Skip to content

Commit 2b46e44

Browse files
committed
feat(types): Add new InputType utility type
1 parent 219f67b commit 2b46e44

File tree

6 files changed

+54
-6
lines changed

6 files changed

+54
-6
lines changed

apps/starlight/src/assets/sidebar.ts

+4
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ export const sidebar: StarlightUserConfigWithPlugins['sidebar'] = [
3030
label: 'Styles and Themes',
3131
slug: 'browser-utils/styles-and-themes',
3232
},
33+
{
34+
label: 'Types',
35+
autogenerate: { directory: 'browser-utils/types' },
36+
},
3337
{
3438
label: 'Services',
3539
autogenerate: { directory: 'browser-utils/services' },

apps/starlight/src/content/docs/browser-utils/styles-and-themes.mdx

+1-6
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ title: 'Styles and Themes'
33
description: '@spuxx/browser-utils provides a set of CSS styles and themes primarily intended for my personal use.'
44
---
55

6-
import TypeDoc from '@docs/browser-utils/types/styles.md';
7-
86
The package provides a set of CSS styles and themes primarily intended for my personal use. You are free to use it in your own projects, but I will not be accepting pull requests or issues requesting changes to this part of the library.
97

108
## Styles
@@ -136,7 +134,4 @@ To do this, you can use the `spx-theme` attribute on the element itself.
136134

137135
## Variables and Types
138136

139-
The library also provides a set of variables and types for use with TypeScript. They can help you use the styles correctly and in a type-safe manner.
140-
They are primarily intended for use with [SolidJS](https://www.solidjs.com/) and my [@spuxx/solid](https://spuxx-dev.github.io/jslibs/browser-utils) library.
141-
142-
<TypeDoc />
137+
The library also provides a set of variables and types for use with TypeScript. They can help you use the styles correctly and in a type-safe manner. You can find them [here](types/styles).
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
title: 'HTML Types'
3+
description: 'A selection of HTML-related utility types for use in browser applications.'
4+
---
5+
6+
import TypeDoc from '@docs/browser-utils/types/html.md';
7+
8+
The package includes a collection of useful TypeScript types that can help with HTML-related use-cases in browser applications.
9+
10+
<TypeDoc />
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
title: 'Style-related Types'
3+
description: 'A selection of style-related utility types for use in browser applications.'
4+
---
5+
6+
import TypeDoc from '@docs/browser-utils/types/styles.md';
7+
8+
The library also provides a set of variables and types for use with TypeScript. They can help you use the styles correctly and in a type-safe manner.
9+
They are primarily intended for use with [SolidJS](https://www.solidjs.com/) and my [@spuxx/solid](https://spuxx-dev.github.io/jslibs/browser-utils) library.
10+
11+
<TypeDoc />

packages/browser-utils/src/main.ts

+1
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ export * from './services/config';
66
export * from './services/local-storage';
77
export * from './services/user-agent';
88
export * from './types/styles';
9+
export * from './types/html';
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/**
2+
* Valid input types according to the HTML specification.
3+
* @see {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#input_types}
4+
*/
5+
export type InputType =
6+
| 'button'
7+
| 'checkbox'
8+
| 'color'
9+
| 'date'
10+
| 'datetime-local'
11+
| 'email'
12+
| 'file'
13+
| 'hidden'
14+
| 'image'
15+
| 'month'
16+
| 'number'
17+
| 'password'
18+
| 'radio'
19+
| 'range'
20+
| 'reset'
21+
| 'search'
22+
| 'submit'
23+
| 'tel'
24+
| 'text'
25+
| 'time'
26+
| 'url'
27+
| 'week';

0 commit comments

Comments
 (0)