@hypoth-ui/wc 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +60 -0
- package/dist/button-MKQKTC5Q.js +10 -0
- package/dist/button-MKQKTC5Q.js.map +1 -0
- package/dist/chunk-4HLM6DBG.js +910 -0
- package/dist/chunk-4HLM6DBG.js.map +1 -0
- package/dist/chunk-55ID7LJL.js +3602 -0
- package/dist/chunk-55ID7LJL.js.map +1 -0
- package/dist/chunk-66HFYJD7.js +86 -0
- package/dist/chunk-66HFYJD7.js.map +1 -0
- package/dist/chunk-CZOXIJVS.js +70 -0
- package/dist/chunk-CZOXIJVS.js.map +1 -0
- package/dist/chunk-DHUM4Q5Y.js +495 -0
- package/dist/chunk-DHUM4Q5Y.js.map +1 -0
- package/dist/chunk-DNNI5BDE.js +1842 -0
- package/dist/chunk-DNNI5BDE.js.map +1 -0
- package/dist/chunk-GXKZ6E6K.js +99 -0
- package/dist/chunk-GXKZ6E6K.js.map +1 -0
- package/dist/chunk-H4GJJZ3N.js +51 -0
- package/dist/chunk-H4GJJZ3N.js.map +1 -0
- package/dist/chunk-JMPTFALJ.js +175 -0
- package/dist/chunk-JMPTFALJ.js.map +1 -0
- package/dist/chunk-MYQWCLUJ.js +45 -0
- package/dist/chunk-MYQWCLUJ.js.map +1 -0
- package/dist/chunk-QZSPWT7L.js +183 -0
- package/dist/chunk-QZSPWT7L.js.map +1 -0
- package/dist/chunk-TSKBQCTR.js +5137 -0
- package/dist/chunk-TSKBQCTR.js.map +1 -0
- package/dist/chunk-TXIIUVL3.js +130 -0
- package/dist/chunk-TXIIUVL3.js.map +1 -0
- package/dist/chunk-UM7WRO7W.js +237 -0
- package/dist/chunk-UM7WRO7W.js.map +1 -0
- package/dist/chunk-VPXL4RB3.js +202 -0
- package/dist/chunk-VPXL4RB3.js.map +1 -0
- package/dist/chunk-VX5CKSMN.js +39 -0
- package/dist/chunk-VX5CKSMN.js.map +1 -0
- package/dist/chunk-WQ5BEP3E.js +2845 -0
- package/dist/chunk-WQ5BEP3E.js.map +1 -0
- package/dist/chunk-YDQ434UH.js +60 -0
- package/dist/chunk-YDQ434UH.js.map +1 -0
- package/dist/chunk-ZWV4VI6D.js +153 -0
- package/dist/chunk-ZWV4VI6D.js.map +1 -0
- package/dist/core.d.ts +127 -0
- package/dist/core.js +38 -0
- package/dist/core.js.map +1 -0
- package/dist/data-display.d.ts +872 -0
- package/dist/data-display.js +57 -0
- package/dist/data-display.js.map +1 -0
- package/dist/ds-element-Db0LMfxI.d.ts +43 -0
- package/dist/feedback.d.ts +292 -0
- package/dist/feedback.js +31 -0
- package/dist/feedback.js.map +1 -0
- package/dist/form-controls.d.ts +1713 -0
- package/dist/form-controls.js +63 -0
- package/dist/form-controls.js.map +1 -0
- package/dist/icon-7IZTJ5WT.js +8 -0
- package/dist/icon-7IZTJ5WT.js.map +1 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.js +423 -0
- package/dist/index.js.map +1 -0
- package/dist/input-LB6UR37A.js +10 -0
- package/dist/input-LB6UR37A.js.map +1 -0
- package/dist/layout.d.ts +504 -0
- package/dist/layout.js +34 -0
- package/dist/layout.js.map +1 -0
- package/dist/link-NHDJ6SFY.js +9 -0
- package/dist/link-NHDJ6SFY.js.map +1 -0
- package/dist/navigation.d.ts +255 -0
- package/dist/navigation.js +111 -0
- package/dist/navigation.js.map +1 -0
- package/dist/overlays.d.ts +1291 -0
- package/dist/overlays.js +106 -0
- package/dist/overlays.js.map +1 -0
- package/dist/primitives.d.ts +230 -0
- package/dist/primitives.js +26 -0
- package/dist/primitives.js.map +1 -0
- package/dist/registry-Bns0t11H.d.ts +233 -0
- package/dist/skeleton-MUdd2029.d.ts +109 -0
- package/dist/spinner-BWaNlc-Y.d.ts +45 -0
- package/dist/spinner-UIYDUVBZ.js +8 -0
- package/dist/spinner-UIYDUVBZ.js.map +1 -0
- package/dist/stepper-CCRwcQOe.d.ts +851 -0
- package/dist/text-MT3S3EMU.js +8 -0
- package/dist/text-MT3S3EMU.js.map +1 -0
- package/dist/visually-hidden-MW2XY4CS.js +8 -0
- package/dist/visually-hidden-MW2XY4CS.js.map +1 -0
- package/package.json +92 -0
package/dist/overlays.js
ADDED
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import {
|
|
2
|
+
DsAlertDialog,
|
|
3
|
+
DsAlertDialogAction,
|
|
4
|
+
DsAlertDialogCancel,
|
|
5
|
+
DsAlertDialogContent,
|
|
6
|
+
DsAlertDialogDescription,
|
|
7
|
+
DsAlertDialogFooter,
|
|
8
|
+
DsAlertDialogHeader,
|
|
9
|
+
DsAlertDialogTitle,
|
|
10
|
+
DsAlertDialogTrigger,
|
|
11
|
+
DsContextMenu,
|
|
12
|
+
DsContextMenuContent,
|
|
13
|
+
DsContextMenuItem,
|
|
14
|
+
DsContextMenuLabel,
|
|
15
|
+
DsContextMenuSeparator,
|
|
16
|
+
DsDialog,
|
|
17
|
+
DsDialogContent,
|
|
18
|
+
DsDialogDescription,
|
|
19
|
+
DsDialogTitle,
|
|
20
|
+
DsDrawer,
|
|
21
|
+
DsDrawerContent,
|
|
22
|
+
DsDrawerDescription,
|
|
23
|
+
DsDrawerFooter,
|
|
24
|
+
DsDrawerHeader,
|
|
25
|
+
DsDrawerTitle,
|
|
26
|
+
DsDropdownMenu,
|
|
27
|
+
DsDropdownMenuCheckboxItem,
|
|
28
|
+
DsDropdownMenuContent,
|
|
29
|
+
DsDropdownMenuItem,
|
|
30
|
+
DsDropdownMenuLabel,
|
|
31
|
+
DsDropdownMenuRadioGroup,
|
|
32
|
+
DsDropdownMenuRadioItem,
|
|
33
|
+
DsDropdownMenuSeparator,
|
|
34
|
+
DsHoverCard,
|
|
35
|
+
DsHoverCardContent,
|
|
36
|
+
DsMenu,
|
|
37
|
+
DsMenuContent,
|
|
38
|
+
DsMenuItem,
|
|
39
|
+
DsPopover,
|
|
40
|
+
DsPopoverContent,
|
|
41
|
+
DsSheet,
|
|
42
|
+
DsSheetClose,
|
|
43
|
+
DsSheetContent,
|
|
44
|
+
DsSheetDescription,
|
|
45
|
+
DsSheetFooter,
|
|
46
|
+
DsSheetHeader,
|
|
47
|
+
DsSheetOverlay,
|
|
48
|
+
DsSheetTitle,
|
|
49
|
+
DsTooltip,
|
|
50
|
+
DsTooltipContent
|
|
51
|
+
} from "./chunk-55ID7LJL.js";
|
|
52
|
+
import "./chunk-JMPTFALJ.js";
|
|
53
|
+
import "./chunk-YDQ434UH.js";
|
|
54
|
+
import "./chunk-H4GJJZ3N.js";
|
|
55
|
+
export {
|
|
56
|
+
DsAlertDialog,
|
|
57
|
+
DsAlertDialogAction,
|
|
58
|
+
DsAlertDialogCancel,
|
|
59
|
+
DsAlertDialogContent,
|
|
60
|
+
DsAlertDialogDescription,
|
|
61
|
+
DsAlertDialogFooter,
|
|
62
|
+
DsAlertDialogHeader,
|
|
63
|
+
DsAlertDialogTitle,
|
|
64
|
+
DsAlertDialogTrigger,
|
|
65
|
+
DsContextMenu,
|
|
66
|
+
DsContextMenuContent,
|
|
67
|
+
DsContextMenuItem,
|
|
68
|
+
DsContextMenuLabel,
|
|
69
|
+
DsContextMenuSeparator,
|
|
70
|
+
DsDialog,
|
|
71
|
+
DsDialogContent,
|
|
72
|
+
DsDialogDescription,
|
|
73
|
+
DsDialogTitle,
|
|
74
|
+
DsDrawer,
|
|
75
|
+
DsDrawerContent,
|
|
76
|
+
DsDrawerDescription,
|
|
77
|
+
DsDrawerFooter,
|
|
78
|
+
DsDrawerHeader,
|
|
79
|
+
DsDrawerTitle,
|
|
80
|
+
DsDropdownMenu,
|
|
81
|
+
DsDropdownMenuCheckboxItem,
|
|
82
|
+
DsDropdownMenuContent,
|
|
83
|
+
DsDropdownMenuItem,
|
|
84
|
+
DsDropdownMenuLabel,
|
|
85
|
+
DsDropdownMenuRadioGroup,
|
|
86
|
+
DsDropdownMenuRadioItem,
|
|
87
|
+
DsDropdownMenuSeparator,
|
|
88
|
+
DsHoverCard,
|
|
89
|
+
DsHoverCardContent,
|
|
90
|
+
DsMenu,
|
|
91
|
+
DsMenuContent,
|
|
92
|
+
DsMenuItem,
|
|
93
|
+
DsPopover,
|
|
94
|
+
DsPopoverContent,
|
|
95
|
+
DsSheet,
|
|
96
|
+
DsSheetClose,
|
|
97
|
+
DsSheetContent,
|
|
98
|
+
DsSheetDescription,
|
|
99
|
+
DsSheetFooter,
|
|
100
|
+
DsSheetHeader,
|
|
101
|
+
DsSheetOverlay,
|
|
102
|
+
DsSheetTitle,
|
|
103
|
+
DsTooltip,
|
|
104
|
+
DsTooltipContent
|
|
105
|
+
};
|
|
106
|
+
//# sourceMappingURL=overlays.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
import { TemplateResult } from 'lit';
|
|
2
|
+
import { D as DSElement } from './ds-element-Db0LMfxI.js';
|
|
3
|
+
|
|
4
|
+
type ButtonVariant = "primary" | "secondary" | "ghost" | "destructive";
|
|
5
|
+
type ButtonSize = "sm" | "md" | "lg";
|
|
6
|
+
/**
|
|
7
|
+
* A button component following WAI-ARIA button pattern.
|
|
8
|
+
*
|
|
9
|
+
* @element ds-button
|
|
10
|
+
* @slot - Default slot for button content
|
|
11
|
+
*
|
|
12
|
+
* @csspart button - The button element
|
|
13
|
+
*
|
|
14
|
+
* @fires ds:press - When the button is activated (click, Enter, Space)
|
|
15
|
+
*/
|
|
16
|
+
declare class DsButton extends DSElement {
|
|
17
|
+
static styles: never[];
|
|
18
|
+
/**
|
|
19
|
+
* The button variant.
|
|
20
|
+
*/
|
|
21
|
+
variant: ButtonVariant;
|
|
22
|
+
/**
|
|
23
|
+
* The button size.
|
|
24
|
+
*/
|
|
25
|
+
size: ButtonSize;
|
|
26
|
+
/**
|
|
27
|
+
* Whether the button is disabled.
|
|
28
|
+
*/
|
|
29
|
+
disabled: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Whether the button is in a loading state.
|
|
32
|
+
*/
|
|
33
|
+
loading: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Button type attribute.
|
|
36
|
+
*/
|
|
37
|
+
type: "button" | "submit" | "reset";
|
|
38
|
+
/** Button behavior instance */
|
|
39
|
+
private behavior;
|
|
40
|
+
connectedCallback(): void;
|
|
41
|
+
updated(changedProperties: Map<string, unknown>): void;
|
|
42
|
+
private handleClick;
|
|
43
|
+
private handleKeyDown;
|
|
44
|
+
render(): TemplateResult;
|
|
45
|
+
}
|
|
46
|
+
declare global {
|
|
47
|
+
interface HTMLElementTagNameMap {
|
|
48
|
+
"ds-button": DsButton;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
type IconSize = "xs" | "sm" | "md" | "lg" | "xl";
|
|
53
|
+
/**
|
|
54
|
+
* An accessible icon component with Lucide integration.
|
|
55
|
+
*
|
|
56
|
+
* @element ds-icon
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* ```html
|
|
60
|
+
* <!-- Decorative icon (hidden from screen readers) -->
|
|
61
|
+
* <ds-icon name="search"></ds-icon>
|
|
62
|
+
*
|
|
63
|
+
* <!-- Meaningful icon (announced to screen readers) -->
|
|
64
|
+
* <ds-icon name="alert-triangle" label="Warning"></ds-icon>
|
|
65
|
+
* ```
|
|
66
|
+
*/
|
|
67
|
+
declare class DsIcon extends DSElement {
|
|
68
|
+
static styles: never[];
|
|
69
|
+
/**
|
|
70
|
+
* The icon name from Lucide library (kebab-case).
|
|
71
|
+
* e.g., "search", "arrow-right", "external-link"
|
|
72
|
+
*/
|
|
73
|
+
name: string;
|
|
74
|
+
/**
|
|
75
|
+
* The icon size.
|
|
76
|
+
*/
|
|
77
|
+
size: IconSize;
|
|
78
|
+
/**
|
|
79
|
+
* Accessible label for meaningful icons.
|
|
80
|
+
* When provided, the icon is announced to screen readers.
|
|
81
|
+
* When omitted, the icon is decorative and hidden from screen readers.
|
|
82
|
+
*/
|
|
83
|
+
label: string;
|
|
84
|
+
/**
|
|
85
|
+
* Custom color for the icon.
|
|
86
|
+
* Accepts any valid CSS color value.
|
|
87
|
+
* Default is currentColor (inherits from text color).
|
|
88
|
+
*/
|
|
89
|
+
color: string;
|
|
90
|
+
/**
|
|
91
|
+
* Cached SVG element
|
|
92
|
+
*/
|
|
93
|
+
private _svgElement;
|
|
94
|
+
/**
|
|
95
|
+
* Track if icon is valid
|
|
96
|
+
*/
|
|
97
|
+
private _isValidIcon;
|
|
98
|
+
willUpdate(changedProperties: Map<string, unknown>): void;
|
|
99
|
+
private updateSvg;
|
|
100
|
+
render(): TemplateResult;
|
|
101
|
+
}
|
|
102
|
+
declare global {
|
|
103
|
+
interface HTMLElementTagNameMap {
|
|
104
|
+
"ds-icon": DsIcon;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
type LinkVariant = "default" | "muted" | "underline";
|
|
109
|
+
interface DsNavigateEventDetail {
|
|
110
|
+
href: string;
|
|
111
|
+
external: boolean;
|
|
112
|
+
originalEvent: MouseEvent | KeyboardEvent;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* A link component following WAI-ARIA link pattern.
|
|
116
|
+
*
|
|
117
|
+
* @element ds-link
|
|
118
|
+
* @slot - Default slot for link content
|
|
119
|
+
*
|
|
120
|
+
* @fires ds:navigate - When the link is activated (cancelable)
|
|
121
|
+
*/
|
|
122
|
+
declare class DsLink extends DSElement {
|
|
123
|
+
static styles: never[];
|
|
124
|
+
/**
|
|
125
|
+
* The URL to navigate to.
|
|
126
|
+
* Required for proper link functionality.
|
|
127
|
+
*/
|
|
128
|
+
href: string;
|
|
129
|
+
/**
|
|
130
|
+
* Whether this link opens in a new tab.
|
|
131
|
+
* When true, adds target="_blank" and rel="noopener noreferrer".
|
|
132
|
+
*/
|
|
133
|
+
external: boolean;
|
|
134
|
+
/**
|
|
135
|
+
* The link visual variant.
|
|
136
|
+
*/
|
|
137
|
+
variant: LinkVariant;
|
|
138
|
+
private handleClick;
|
|
139
|
+
render(): TemplateResult;
|
|
140
|
+
private renderExternalIndicator;
|
|
141
|
+
}
|
|
142
|
+
declare global {
|
|
143
|
+
interface HTMLElementTagNameMap {
|
|
144
|
+
"ds-link": DsLink;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
type TextSize = "xs" | "sm" | "md" | "lg" | "xl" | "2xl";
|
|
149
|
+
type TextWeight = "normal" | "medium" | "semibold" | "bold";
|
|
150
|
+
type TextVariant = "default" | "muted" | "success" | "warning" | "error";
|
|
151
|
+
type TextAs = "span" | "p" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6";
|
|
152
|
+
/**
|
|
153
|
+
* A typography component for consistent text styling.
|
|
154
|
+
*
|
|
155
|
+
* @element ds-text
|
|
156
|
+
* @slot - Default slot for text content
|
|
157
|
+
*/
|
|
158
|
+
declare class DsText extends DSElement {
|
|
159
|
+
static styles: never[];
|
|
160
|
+
/**
|
|
161
|
+
* The text size.
|
|
162
|
+
*/
|
|
163
|
+
size: TextSize;
|
|
164
|
+
/**
|
|
165
|
+
* The font weight.
|
|
166
|
+
*/
|
|
167
|
+
weight: TextWeight;
|
|
168
|
+
/**
|
|
169
|
+
* The color variant.
|
|
170
|
+
*/
|
|
171
|
+
variant: TextVariant;
|
|
172
|
+
/**
|
|
173
|
+
* The semantic element to render as.
|
|
174
|
+
* Supports: span, p, h1-h6
|
|
175
|
+
*/
|
|
176
|
+
as: TextAs;
|
|
177
|
+
/**
|
|
178
|
+
* Whether to truncate text with ellipsis.
|
|
179
|
+
*/
|
|
180
|
+
truncate: boolean;
|
|
181
|
+
private getValidAs;
|
|
182
|
+
render(): TemplateResult;
|
|
183
|
+
}
|
|
184
|
+
declare global {
|
|
185
|
+
interface HTMLElementTagNameMap {
|
|
186
|
+
"ds-text": DsText;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* A utility component that hides content visually while keeping it accessible to screen readers.
|
|
192
|
+
*
|
|
193
|
+
* Use this component to provide additional context for assistive technology users
|
|
194
|
+
* that would be redundant or unnecessary for sighted users.
|
|
195
|
+
*
|
|
196
|
+
* @element ds-visually-hidden
|
|
197
|
+
* @slot - Content to be hidden visually but announced by screen readers
|
|
198
|
+
*
|
|
199
|
+
* @example
|
|
200
|
+
* ```html
|
|
201
|
+
* <button>
|
|
202
|
+
* <ds-icon name="trash" aria-hidden="true"></ds-icon>
|
|
203
|
+
* <ds-visually-hidden>Delete item</ds-visually-hidden>
|
|
204
|
+
* </button>
|
|
205
|
+
* ```
|
|
206
|
+
*
|
|
207
|
+
* @example
|
|
208
|
+
* ```html
|
|
209
|
+
* <!-- Skip link that becomes visible on focus -->
|
|
210
|
+
* <ds-visually-hidden focusable>
|
|
211
|
+
* <a href="#main-content">Skip to main content</a>
|
|
212
|
+
* </ds-visually-hidden>
|
|
213
|
+
* ```
|
|
214
|
+
*/
|
|
215
|
+
declare class DsVisuallyHidden extends DSElement {
|
|
216
|
+
static styles: never[];
|
|
217
|
+
/**
|
|
218
|
+
* When true, the content becomes visible when it or its children receive focus.
|
|
219
|
+
* Useful for skip links and other focus-triggered content.
|
|
220
|
+
*/
|
|
221
|
+
focusable: boolean;
|
|
222
|
+
render(): TemplateResult;
|
|
223
|
+
}
|
|
224
|
+
declare global {
|
|
225
|
+
interface HTMLElementTagNameMap {
|
|
226
|
+
"ds-visually-hidden": DsVisuallyHidden;
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
export { type ButtonSize, type ButtonVariant, DsButton, DsIcon, DsLink, type DsNavigateEventDetail, DsText, DsVisuallyHidden, type IconSize, type LinkVariant, type TextAs, type TextSize, type TextVariant, type TextWeight };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import {
|
|
2
|
+
DsButton
|
|
3
|
+
} from "./chunk-TXIIUVL3.js";
|
|
4
|
+
import {
|
|
5
|
+
DsLink
|
|
6
|
+
} from "./chunk-GXKZ6E6K.js";
|
|
7
|
+
import {
|
|
8
|
+
DsText
|
|
9
|
+
} from "./chunk-CZOXIJVS.js";
|
|
10
|
+
import {
|
|
11
|
+
DsIcon
|
|
12
|
+
} from "./chunk-ZWV4VI6D.js";
|
|
13
|
+
import {
|
|
14
|
+
DsVisuallyHidden
|
|
15
|
+
} from "./chunk-VX5CKSMN.js";
|
|
16
|
+
import "./chunk-JMPTFALJ.js";
|
|
17
|
+
import "./chunk-YDQ434UH.js";
|
|
18
|
+
import "./chunk-H4GJJZ3N.js";
|
|
19
|
+
export {
|
|
20
|
+
DsButton,
|
|
21
|
+
DsIcon,
|
|
22
|
+
DsLink,
|
|
23
|
+
DsText,
|
|
24
|
+
DsVisuallyHidden
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=primitives.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
import * as lit from 'lit';
|
|
2
|
+
import { LitElement } from 'lit';
|
|
3
|
+
import { DsButton, DsLink, DsText, DsIcon, DsVisuallyHidden } from './primitives.js';
|
|
4
|
+
import { D as DSElement } from './ds-element-Db0LMfxI.js';
|
|
5
|
+
import { D as DsSpinner } from './spinner-BWaNlc-Y.js';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Validation flags for ElementInternals.setValidity().
|
|
9
|
+
*/
|
|
10
|
+
interface ValidationFlags {
|
|
11
|
+
/** Element is required but has no value */
|
|
12
|
+
valueMissing?: boolean;
|
|
13
|
+
/** Value doesn't match the expected type */
|
|
14
|
+
typeMismatch?: boolean;
|
|
15
|
+
/** Value doesn't match the pattern attribute */
|
|
16
|
+
patternMismatch?: boolean;
|
|
17
|
+
/** Value exceeds maxlength */
|
|
18
|
+
tooLong?: boolean;
|
|
19
|
+
/** Value is shorter than minlength */
|
|
20
|
+
tooShort?: boolean;
|
|
21
|
+
/** Value exceeds max */
|
|
22
|
+
rangeOverflow?: boolean;
|
|
23
|
+
/** Value is less than min */
|
|
24
|
+
rangeUnderflow?: boolean;
|
|
25
|
+
/** Value doesn't match step */
|
|
26
|
+
stepMismatch?: boolean;
|
|
27
|
+
/** Custom validation failed */
|
|
28
|
+
customError?: boolean;
|
|
29
|
+
/** Value doesn't match any option */
|
|
30
|
+
badInput?: boolean;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Type for mixin constructor with any args.
|
|
34
|
+
*/
|
|
35
|
+
type Constructor<T = object> = new (...args: any[]) => T;
|
|
36
|
+
/**
|
|
37
|
+
* Interface for form-associated element properties and methods.
|
|
38
|
+
*/
|
|
39
|
+
interface FormAssociatedInterface {
|
|
40
|
+
name: string;
|
|
41
|
+
value: string;
|
|
42
|
+
disabled: boolean;
|
|
43
|
+
required: boolean;
|
|
44
|
+
customValidation: boolean;
|
|
45
|
+
readonly validity: ValidityState;
|
|
46
|
+
readonly validationMessage: string;
|
|
47
|
+
readonly willValidate: boolean;
|
|
48
|
+
readonly form: HTMLFormElement | null;
|
|
49
|
+
checkValidity(): boolean;
|
|
50
|
+
reportValidity(): boolean;
|
|
51
|
+
setCustomValidity(message: string): void;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Type for form lifecycle callbacks.
|
|
55
|
+
*/
|
|
56
|
+
interface FormLifecycleCallbacks {
|
|
57
|
+
formAssociatedCallback?(form: HTMLFormElement | null): void;
|
|
58
|
+
formDisabledCallback?(disabled: boolean): void;
|
|
59
|
+
formResetCallback?(): void;
|
|
60
|
+
formStateRestoreCallback?(state: string | File | FormData | null, mode: "restore" | "autocomplete"): void;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Combined interface for form-associated elements.
|
|
64
|
+
*/
|
|
65
|
+
type FormAssociatedElement = FormAssociatedInterface & FormLifecycleCallbacks;
|
|
66
|
+
/**
|
|
67
|
+
* Form-associated mixin for Lit elements.
|
|
68
|
+
*
|
|
69
|
+
* Adds ElementInternals-based form participation to any Lit component.
|
|
70
|
+
* Components using this mixin participate in native HTML form submission,
|
|
71
|
+
* validation, and lifecycle callbacks.
|
|
72
|
+
*
|
|
73
|
+
* @example
|
|
74
|
+
* ```typescript
|
|
75
|
+
* import { FormAssociatedMixin } from '../base/form-associated.js';
|
|
76
|
+
* import { DSElement } from '../base/ds-element.js';
|
|
77
|
+
*
|
|
78
|
+
* class DsCheckbox extends FormAssociatedMixin(DSElement) {
|
|
79
|
+
* @property({ type: Boolean }) checked = false;
|
|
80
|
+
*
|
|
81
|
+
* protected getFormValue(): FormData | string | null {
|
|
82
|
+
* return this.checked ? this.value : null;
|
|
83
|
+
* }
|
|
84
|
+
*
|
|
85
|
+
* protected getValidationAnchor(): HTMLElement | undefined {
|
|
86
|
+
* return this.renderRoot.querySelector('.ds-checkbox__control') ?? undefined;
|
|
87
|
+
* }
|
|
88
|
+
* }
|
|
89
|
+
* ```
|
|
90
|
+
*/
|
|
91
|
+
declare function FormAssociatedMixin<T extends Constructor<LitElement>>(Base: T): Constructor<FormAssociatedInterface & LitElement> & T & {
|
|
92
|
+
formAssociated: true;
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
type InputType = "text" | "email" | "password" | "number" | "tel" | "url" | "search";
|
|
96
|
+
type InputSize = "sm" | "md" | "lg";
|
|
97
|
+
/**
|
|
98
|
+
* A text input field component.
|
|
99
|
+
*
|
|
100
|
+
* @element ds-input
|
|
101
|
+
* @fires input - Fired when the input value changes
|
|
102
|
+
* @fires change - Fired when the input value is committed
|
|
103
|
+
*
|
|
104
|
+
* @example
|
|
105
|
+
* ```html
|
|
106
|
+
* <ds-field>
|
|
107
|
+
* <ds-label>Email</ds-label>
|
|
108
|
+
* <ds-input type="email" name="email"></ds-input>
|
|
109
|
+
* </ds-field>
|
|
110
|
+
* ```
|
|
111
|
+
*/
|
|
112
|
+
declare class DsInput extends DSElement {
|
|
113
|
+
/** Input type */
|
|
114
|
+
type: InputType;
|
|
115
|
+
/** Input size */
|
|
116
|
+
size: InputSize;
|
|
117
|
+
/** Input name */
|
|
118
|
+
name: string;
|
|
119
|
+
/** Input value */
|
|
120
|
+
value: string;
|
|
121
|
+
/** Placeholder text */
|
|
122
|
+
placeholder: string;
|
|
123
|
+
/** Disabled state */
|
|
124
|
+
disabled: boolean;
|
|
125
|
+
/** Read-only state */
|
|
126
|
+
readonly: boolean;
|
|
127
|
+
/** Required state */
|
|
128
|
+
required: boolean;
|
|
129
|
+
/** Error state */
|
|
130
|
+
error: boolean;
|
|
131
|
+
/** Minimum length */
|
|
132
|
+
minlength?: number;
|
|
133
|
+
/** Maximum length */
|
|
134
|
+
maxlength?: number;
|
|
135
|
+
/** Pattern for validation */
|
|
136
|
+
pattern?: string;
|
|
137
|
+
/** ARIA labelledby - ID of element that labels this input */
|
|
138
|
+
private ariaLabelledBy?;
|
|
139
|
+
/** ARIA describedby - IDs of elements that describe this input */
|
|
140
|
+
private ariaDescribedBy?;
|
|
141
|
+
private attributeObserver;
|
|
142
|
+
connectedCallback(): void;
|
|
143
|
+
disconnectedCallback(): void;
|
|
144
|
+
/**
|
|
145
|
+
* Syncs ARIA attributes from the host element to internal state.
|
|
146
|
+
* The render method will apply these to the native input.
|
|
147
|
+
*/
|
|
148
|
+
private syncAriaAttributes;
|
|
149
|
+
private handleInput;
|
|
150
|
+
private handleChange;
|
|
151
|
+
render(): lit.TemplateResult<1>;
|
|
152
|
+
}
|
|
153
|
+
declare global {
|
|
154
|
+
interface HTMLElementTagNameMap {
|
|
155
|
+
"ds-input": DsInput;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* Component Registry - Centralized mapping of tag names to component classes.
|
|
161
|
+
*
|
|
162
|
+
* This registry is the single source of truth for all design system component registrations.
|
|
163
|
+
* Components do NOT self-register; instead, the loader uses this registry to register
|
|
164
|
+
* components when the application starts.
|
|
165
|
+
*/
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* Custom element constructor type
|
|
169
|
+
*/
|
|
170
|
+
type CustomElementConstructor = new (...args: unknown[]) => HTMLElement;
|
|
171
|
+
/**
|
|
172
|
+
* Component registry type - maps tag names to component classes
|
|
173
|
+
*/
|
|
174
|
+
type ComponentRegistryType = Record<string, CustomElementConstructor>;
|
|
175
|
+
/**
|
|
176
|
+
* Valid component tag names in the design system
|
|
177
|
+
*/
|
|
178
|
+
type ComponentTag = "ds-button" | "ds-input" | "ds-link" | "ds-text" | "ds-icon" | "ds-spinner" | "ds-visually-hidden";
|
|
179
|
+
/**
|
|
180
|
+
* Get all registered tag names.
|
|
181
|
+
*
|
|
182
|
+
* @returns Array of all tag names in the registry
|
|
183
|
+
*/
|
|
184
|
+
declare function getRegisteredTags(): ComponentTag[];
|
|
185
|
+
/**
|
|
186
|
+
* Get component class by tag name.
|
|
187
|
+
* If the component uses lazy loading, this will trigger the load.
|
|
188
|
+
*
|
|
189
|
+
* @param tagName - The custom element tag name
|
|
190
|
+
* @returns Promise resolving to the component class or undefined if not found
|
|
191
|
+
*/
|
|
192
|
+
declare function getComponentClass(tagName: string): Promise<CustomElementConstructor | undefined>;
|
|
193
|
+
/**
|
|
194
|
+
* Get component class synchronously (only works for already-loaded components).
|
|
195
|
+
*
|
|
196
|
+
* @param tagName - The custom element tag name
|
|
197
|
+
* @returns The component class or undefined if not loaded/found
|
|
198
|
+
*/
|
|
199
|
+
declare function getComponentClassSync(tagName: string): CustomElementConstructor | undefined;
|
|
200
|
+
/**
|
|
201
|
+
* Register a component class directly (for pre-loaded components).
|
|
202
|
+
*
|
|
203
|
+
* @param tagName - The custom element tag name
|
|
204
|
+
* @param componentClass - The component class constructor
|
|
205
|
+
*/
|
|
206
|
+
declare function registerComponent(tagName: string, componentClass: CustomElementConstructor): void;
|
|
207
|
+
/**
|
|
208
|
+
* Check if a tag name is in the registry.
|
|
209
|
+
*
|
|
210
|
+
* @param tagName - The custom element tag name
|
|
211
|
+
* @returns True if the tag is registered
|
|
212
|
+
*/
|
|
213
|
+
declare function hasComponent(tagName: string): boolean;
|
|
214
|
+
/**
|
|
215
|
+
* Load all components in the registry.
|
|
216
|
+
* This is useful for eager loading all components at once.
|
|
217
|
+
*
|
|
218
|
+
* @returns Promise that resolves when all components are loaded
|
|
219
|
+
*/
|
|
220
|
+
declare function loadAllComponents(): Promise<void>;
|
|
221
|
+
declare global {
|
|
222
|
+
interface HTMLElementTagNameMap {
|
|
223
|
+
"ds-button": DsButton;
|
|
224
|
+
"ds-input": DsInput;
|
|
225
|
+
"ds-link": DsLink;
|
|
226
|
+
"ds-text": DsText;
|
|
227
|
+
"ds-icon": DsIcon;
|
|
228
|
+
"ds-spinner": DsSpinner;
|
|
229
|
+
"ds-visually-hidden": DsVisuallyHidden;
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
export { type CustomElementConstructor as C, DsInput as D, FormAssociatedMixin as F, type InputType as I, type ValidationFlags as V, type FormAssociatedElement as a, type FormAssociatedInterface as b, type FormLifecycleCallbacks as c, getComponentClass as d, getComponentClassSync as e, type ComponentRegistryType as f, getRegisteredTags as g, hasComponent as h, type ComponentTag as i, type InputSize as j, loadAllComponents as l, registerComponent as r };
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { TemplateResult } from 'lit';
|
|
2
|
+
import { D as DSElement } from './ds-element-Db0LMfxI.js';
|
|
3
|
+
|
|
4
|
+
type ProgressVariant = "linear" | "circular";
|
|
5
|
+
type ProgressSize = "sm" | "md" | "lg";
|
|
6
|
+
/**
|
|
7
|
+
* Progress indicator component.
|
|
8
|
+
*
|
|
9
|
+
* @element ds-progress
|
|
10
|
+
*
|
|
11
|
+
* @csspart track - The progress track
|
|
12
|
+
* @csspart bar - The progress bar/fill
|
|
13
|
+
* @csspart label - The accessible label
|
|
14
|
+
*
|
|
15
|
+
* @cssprop --ds-progress-track - Track background color
|
|
16
|
+
* @cssprop --ds-progress-fill - Fill/indicator color
|
|
17
|
+
* @cssprop --ds-progress-height - Track height (linear)
|
|
18
|
+
*/
|
|
19
|
+
declare class DsProgress extends DSElement {
|
|
20
|
+
static styles: never[];
|
|
21
|
+
/**
|
|
22
|
+
* Current progress value (0-100). Omit for indeterminate.
|
|
23
|
+
*/
|
|
24
|
+
value?: number;
|
|
25
|
+
/**
|
|
26
|
+
* Maximum value.
|
|
27
|
+
*/
|
|
28
|
+
max: number;
|
|
29
|
+
/**
|
|
30
|
+
* Visual variant.
|
|
31
|
+
*/
|
|
32
|
+
variant: ProgressVariant;
|
|
33
|
+
/**
|
|
34
|
+
* Size variant.
|
|
35
|
+
*/
|
|
36
|
+
size: ProgressSize;
|
|
37
|
+
/**
|
|
38
|
+
* Accessible label.
|
|
39
|
+
*/
|
|
40
|
+
label: string;
|
|
41
|
+
/**
|
|
42
|
+
* Show value as percentage text (circular only).
|
|
43
|
+
*/
|
|
44
|
+
showValue: boolean;
|
|
45
|
+
private get isIndeterminate();
|
|
46
|
+
private get percentage();
|
|
47
|
+
private get valueText();
|
|
48
|
+
private renderLinear;
|
|
49
|
+
private renderCircular;
|
|
50
|
+
render(): TemplateResult;
|
|
51
|
+
}
|
|
52
|
+
declare global {
|
|
53
|
+
interface HTMLElementTagNameMap {
|
|
54
|
+
"ds-progress": DsProgress;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
type SkeletonVariant = "text" | "circular" | "rectangular" | "rounded";
|
|
59
|
+
type SkeletonSize = "xs" | "sm" | "md" | "lg" | "xl";
|
|
60
|
+
type SkeletonWidth = "full" | "3/4" | "1/2" | "1/4";
|
|
61
|
+
type SkeletonAnimation = "wave" | "pulse" | "none";
|
|
62
|
+
/**
|
|
63
|
+
* Skeleton loading placeholder component.
|
|
64
|
+
*
|
|
65
|
+
* @element ds-skeleton
|
|
66
|
+
*
|
|
67
|
+
* @cssprop --ds-skeleton-bg - Background color
|
|
68
|
+
* @cssprop --ds-skeleton-highlight - Shimmer highlight color
|
|
69
|
+
* @cssprop --ds-skeleton-radius - Border radius
|
|
70
|
+
*/
|
|
71
|
+
declare class DsSkeleton extends DSElement {
|
|
72
|
+
static styles: never[];
|
|
73
|
+
/**
|
|
74
|
+
* Shape variant.
|
|
75
|
+
*/
|
|
76
|
+
variant: SkeletonVariant;
|
|
77
|
+
/**
|
|
78
|
+
* Size preset for height.
|
|
79
|
+
*/
|
|
80
|
+
size?: SkeletonSize;
|
|
81
|
+
/**
|
|
82
|
+
* Width preset.
|
|
83
|
+
*/
|
|
84
|
+
width?: SkeletonWidth;
|
|
85
|
+
/**
|
|
86
|
+
* Custom width (CSS value).
|
|
87
|
+
*/
|
|
88
|
+
customWidth: string;
|
|
89
|
+
/**
|
|
90
|
+
* Custom height (CSS value).
|
|
91
|
+
*/
|
|
92
|
+
customHeight: string;
|
|
93
|
+
/**
|
|
94
|
+
* Animation type.
|
|
95
|
+
*/
|
|
96
|
+
animation: SkeletonAnimation;
|
|
97
|
+
/**
|
|
98
|
+
* Accessible label for screen readers.
|
|
99
|
+
*/
|
|
100
|
+
label: string;
|
|
101
|
+
render(): TemplateResult;
|
|
102
|
+
}
|
|
103
|
+
declare global {
|
|
104
|
+
interface HTMLElementTagNameMap {
|
|
105
|
+
"ds-skeleton": DsSkeleton;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export { DsProgress as D, type ProgressVariant as P, type SkeletonVariant as S, type ProgressSize as a, DsSkeleton as b, type SkeletonSize as c, type SkeletonWidth as d, type SkeletonAnimation as e };
|