@lab206/ui 0.1.0
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 +114 -0
- package/README.md +6 -0
- package/dist/components/Accordion.d.ts +25 -0
- package/dist/components/Accordion.d.ts.map +1 -0
- package/dist/components/Accordion.js +123 -0
- package/dist/components/Accordion.js.map +1 -0
- package/dist/components/Alert.d.ts +17 -0
- package/dist/components/Alert.d.ts.map +1 -0
- package/dist/components/Alert.js +59 -0
- package/dist/components/Alert.js.map +1 -0
- package/dist/components/AspectRatio.d.ts +13 -0
- package/dist/components/AspectRatio.d.ts.map +1 -0
- package/dist/components/AspectRatio.js +38 -0
- package/dist/components/AspectRatio.js.map +1 -0
- package/dist/components/Avatar.d.ts +17 -0
- package/dist/components/Avatar.d.ts.map +1 -0
- package/dist/components/Avatar.js +57 -0
- package/dist/components/Avatar.js.map +1 -0
- package/dist/components/Badge.d.ts +12 -0
- package/dist/components/Badge.d.ts.map +1 -0
- package/dist/components/Badge.js +62 -0
- package/dist/components/Badge.js.map +1 -0
- package/dist/components/Breadcrumb.d.ts +16 -0
- package/dist/components/Breadcrumb.d.ts.map +1 -0
- package/dist/components/Breadcrumb.js +76 -0
- package/dist/components/Breadcrumb.js.map +1 -0
- package/dist/components/Button.d.ts +28 -0
- package/dist/components/Button.d.ts.map +1 -0
- package/dist/components/Button.js +110 -0
- package/dist/components/Button.js.map +1 -0
- package/dist/components/Card.d.ts +18 -0
- package/dist/components/Card.d.ts.map +1 -0
- package/dist/components/Card.js +57 -0
- package/dist/components/Card.js.map +1 -0
- package/dist/components/Checkbox.d.ts +23 -0
- package/dist/components/Checkbox.d.ts.map +1 -0
- package/dist/components/Checkbox.js +107 -0
- package/dist/components/Checkbox.js.map +1 -0
- package/dist/components/Chip.d.ts +18 -0
- package/dist/components/Chip.d.ts.map +1 -0
- package/dist/components/Chip.js +103 -0
- package/dist/components/Chip.js.map +1 -0
- package/dist/components/Code.d.ts +12 -0
- package/dist/components/Code.d.ts.map +1 -0
- package/dist/components/Code.js +57 -0
- package/dist/components/Code.js.map +1 -0
- package/dist/components/Collapse.d.ts +15 -0
- package/dist/components/Collapse.d.ts.map +1 -0
- package/dist/components/Collapse.js +49 -0
- package/dist/components/Collapse.js.map +1 -0
- package/dist/components/Combobox.d.ts +47 -0
- package/dist/components/Combobox.d.ts.map +1 -0
- package/dist/components/Combobox.js +325 -0
- package/dist/components/Combobox.js.map +1 -0
- package/dist/components/Command.d.ts +42 -0
- package/dist/components/Command.d.ts.map +1 -0
- package/dist/components/Command.js +263 -0
- package/dist/components/Command.js.map +1 -0
- package/dist/components/Container.d.ts +11 -0
- package/dist/components/Container.d.ts.map +1 -0
- package/dist/components/Container.js +38 -0
- package/dist/components/Container.js.map +1 -0
- package/dist/components/Dialog.d.ts +26 -0
- package/dist/components/Dialog.d.ts.map +1 -0
- package/dist/components/Dialog.js +159 -0
- package/dist/components/Dialog.js.map +1 -0
- package/dist/components/Divider.d.ts +10 -0
- package/dist/components/Divider.d.ts.map +1 -0
- package/dist/components/Divider.js +52 -0
- package/dist/components/Divider.js.map +1 -0
- package/dist/components/Drawer.d.ts +19 -0
- package/dist/components/Drawer.d.ts.map +1 -0
- package/dist/components/Drawer.js +131 -0
- package/dist/components/Drawer.js.map +1 -0
- package/dist/components/Empty.d.ts +17 -0
- package/dist/components/Empty.d.ts.map +1 -0
- package/dist/components/Empty.js +51 -0
- package/dist/components/Empty.js.map +1 -0
- package/dist/components/Field.d.ts +27 -0
- package/dist/components/Field.d.ts.map +1 -0
- package/dist/components/Field.js +153 -0
- package/dist/components/Field.js.map +1 -0
- package/dist/components/Grid.d.ts +13 -0
- package/dist/components/Grid.d.ts.map +1 -0
- package/dist/components/Grid.js +44 -0
- package/dist/components/Grid.js.map +1 -0
- package/dist/components/Input.d.ts +55 -0
- package/dist/components/Input.d.ts.map +1 -0
- package/dist/components/Input.js +113 -0
- package/dist/components/Input.js.map +1 -0
- package/dist/components/Kbd.d.ts +10 -0
- package/dist/components/Kbd.d.ts.map +1 -0
- package/dist/components/Kbd.js +41 -0
- package/dist/components/Kbd.js.map +1 -0
- package/dist/components/Label.d.ts +13 -0
- package/dist/components/Label.d.ts.map +1 -0
- package/dist/components/Label.js +34 -0
- package/dist/components/Label.js.map +1 -0
- package/dist/components/Link.d.ts +18 -0
- package/dist/components/Link.d.ts.map +1 -0
- package/dist/components/Link.js +41 -0
- package/dist/components/Link.js.map +1 -0
- package/dist/components/List.d.ts +22 -0
- package/dist/components/List.d.ts.map +1 -0
- package/dist/components/List.js +157 -0
- package/dist/components/List.js.map +1 -0
- package/dist/components/Menu.d.ts +28 -0
- package/dist/components/Menu.d.ts.map +1 -0
- package/dist/components/Menu.js +126 -0
- package/dist/components/Menu.js.map +1 -0
- package/dist/components/NumberInput.d.ts +27 -0
- package/dist/components/NumberInput.d.ts.map +1 -0
- package/dist/components/NumberInput.js +92 -0
- package/dist/components/NumberInput.js.map +1 -0
- package/dist/components/Pagination.d.ts +13 -0
- package/dist/components/Pagination.d.ts.map +1 -0
- package/dist/components/Pagination.js +104 -0
- package/dist/components/Pagination.js.map +1 -0
- package/dist/components/Popover.d.ts +26 -0
- package/dist/components/Popover.d.ts.map +1 -0
- package/dist/components/Popover.js +165 -0
- package/dist/components/Popover.js.map +1 -0
- package/dist/components/Progress.d.ts +15 -0
- package/dist/components/Progress.d.ts.map +1 -0
- package/dist/components/Progress.js +63 -0
- package/dist/components/Progress.js.map +1 -0
- package/dist/components/Radio.d.ts +25 -0
- package/dist/components/Radio.d.ts.map +1 -0
- package/dist/components/Radio.js +95 -0
- package/dist/components/Radio.js.map +1 -0
- package/dist/components/ScrollArea.d.ts +13 -0
- package/dist/components/ScrollArea.d.ts.map +1 -0
- package/dist/components/ScrollArea.js +33 -0
- package/dist/components/ScrollArea.js.map +1 -0
- package/dist/components/Select.d.ts +34 -0
- package/dist/components/Select.d.ts.map +1 -0
- package/dist/components/Select.js +108 -0
- package/dist/components/Select.js.map +1 -0
- package/dist/components/Skeleton.d.ts +18 -0
- package/dist/components/Skeleton.d.ts.map +1 -0
- package/dist/components/Skeleton.js +86 -0
- package/dist/components/Skeleton.js.map +1 -0
- package/dist/components/Slider.d.ts +26 -0
- package/dist/components/Slider.d.ts.map +1 -0
- package/dist/components/Slider.js +113 -0
- package/dist/components/Slider.js.map +1 -0
- package/dist/components/Spinner.d.ts +12 -0
- package/dist/components/Spinner.d.ts.map +1 -0
- package/dist/components/Spinner.js +44 -0
- package/dist/components/Spinner.js.map +1 -0
- package/dist/components/Stack.d.ts +21 -0
- package/dist/components/Stack.d.ts.map +1 -0
- package/dist/components/Stack.js +48 -0
- package/dist/components/Stack.js.map +1 -0
- package/dist/components/Stat.d.ts +23 -0
- package/dist/components/Stat.d.ts.map +1 -0
- package/dist/components/Stat.js +115 -0
- package/dist/components/Stat.js.map +1 -0
- package/dist/components/Steps.d.ts +20 -0
- package/dist/components/Steps.d.ts.map +1 -0
- package/dist/components/Steps.js +126 -0
- package/dist/components/Steps.js.map +1 -0
- package/dist/components/Switch.d.ts +23 -0
- package/dist/components/Switch.d.ts.map +1 -0
- package/dist/components/Switch.js +108 -0
- package/dist/components/Switch.js.map +1 -0
- package/dist/components/Table.d.ts +27 -0
- package/dist/components/Table.d.ts.map +1 -0
- package/dist/components/Table.js +112 -0
- package/dist/components/Table.js.map +1 -0
- package/dist/components/Tabs.d.ts +27 -0
- package/dist/components/Tabs.d.ts.map +1 -0
- package/dist/components/Tabs.js +171 -0
- package/dist/components/Tabs.js.map +1 -0
- package/dist/components/Text.d.ts +17 -0
- package/dist/components/Text.d.ts.map +1 -0
- package/dist/components/Text.js +48 -0
- package/dist/components/Text.js.map +1 -0
- package/dist/components/Textarea.d.ts +32 -0
- package/dist/components/Textarea.d.ts.map +1 -0
- package/dist/components/Textarea.js +91 -0
- package/dist/components/Textarea.js.map +1 -0
- package/dist/components/Timeline.d.ts +17 -0
- package/dist/components/Timeline.d.ts.map +1 -0
- package/dist/components/Timeline.js +95 -0
- package/dist/components/Timeline.js.map +1 -0
- package/dist/components/Toast.d.ts +36 -0
- package/dist/components/Toast.d.ts.map +1 -0
- package/dist/components/Toast.js +143 -0
- package/dist/components/Toast.js.map +1 -0
- package/dist/components/ToggleGroup.d.ts +25 -0
- package/dist/components/ToggleGroup.d.ts.map +1 -0
- package/dist/components/ToggleGroup.js +103 -0
- package/dist/components/ToggleGroup.js.map +1 -0
- package/dist/components/Tooltip.d.ts +19 -0
- package/dist/components/Tooltip.d.ts.map +1 -0
- package/dist/components/Tooltip.js +141 -0
- package/dist/components/Tooltip.js.map +1 -0
- package/dist/components/Transition.d.ts +22 -0
- package/dist/components/Transition.d.ts.map +1 -0
- package/dist/components/Transition.js +139 -0
- package/dist/components/Transition.js.map +1 -0
- package/dist/density.d.ts +21 -0
- package/dist/density.d.ts.map +1 -0
- package/dist/density.js +31 -0
- package/dist/density.js.map +1 -0
- package/dist/dev.d.ts +27 -0
- package/dist/dev.d.ts.map +1 -0
- package/dist/dev.js +77 -0
- package/dist/dev.js.map +1 -0
- package/dist/focusTrap.d.ts +6 -0
- package/dist/focusTrap.d.ts.map +1 -0
- package/dist/focusTrap.js +55 -0
- package/dist/focusTrap.js.map +1 -0
- package/dist/form.d.ts +125 -0
- package/dist/form.d.ts.map +1 -0
- package/dist/form.js +192 -0
- package/dist/form.js.map +1 -0
- package/dist/index.d.ts +134 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +85 -0
- package/dist/index.js.map +1 -0
- package/dist/motion.d.ts +29 -0
- package/dist/motion.d.ts.map +1 -0
- package/dist/motion.js +43 -0
- package/dist/motion.js.map +1 -0
- package/dist/overlay.d.ts +63 -0
- package/dist/overlay.d.ts.map +1 -0
- package/dist/overlay.js +172 -0
- package/dist/overlay.js.map +1 -0
- package/dist/palette.d.ts +20 -0
- package/dist/palette.d.ts.map +1 -0
- package/dist/palette.js +52 -0
- package/dist/palette.js.map +1 -0
- package/dist/reactive.d.ts +25 -0
- package/dist/reactive.d.ts.map +1 -0
- package/dist/reactive.js +43 -0
- package/dist/reactive.js.map +1 -0
- package/dist/rovingFocus.d.ts +36 -0
- package/dist/rovingFocus.d.ts.map +1 -0
- package/dist/rovingFocus.js +127 -0
- package/dist/rovingFocus.js.map +1 -0
- package/dist/size-entries/form-kit.d.ts +12 -0
- package/dist/size-entries/form-kit.d.ts.map +1 -0
- package/dist/size-entries/form-kit.js +12 -0
- package/dist/size-entries/form-kit.js.map +1 -0
- package/dist/styles.d.ts +29 -0
- package/dist/styles.d.ts.map +1 -0
- package/dist/styles.js +53 -0
- package/dist/styles.js.map +1 -0
- package/dist/theme.d.ts +22 -0
- package/dist/theme.d.ts.map +1 -0
- package/dist/theme.js +32 -0
- package/dist/theme.js.map +1 -0
- package/dist/utils.d.ts +5 -0
- package/dist/utils.d.ts.map +1 -0
- package/dist/utils.js +24 -0
- package/dist/utils.js.map +1 -0
- package/package.json +71 -0
- package/src/components/Accordion.tsx +194 -0
- package/src/components/Alert.tsx +88 -0
- package/src/components/AspectRatio.tsx +64 -0
- package/src/components/Avatar.tsx +89 -0
- package/src/components/Badge.tsx +84 -0
- package/src/components/Breadcrumb.tsx +116 -0
- package/src/components/Button.tsx +148 -0
- package/src/components/Card.tsx +92 -0
- package/src/components/Checkbox.tsx +143 -0
- package/src/components/Chip.tsx +153 -0
- package/src/components/Code.tsx +71 -0
- package/src/components/Collapse.tsx +76 -0
- package/src/components/Combobox.tsx +438 -0
- package/src/components/Command.tsx +380 -0
- package/src/components/Container.tsx +58 -0
- package/src/components/Dialog.tsx +226 -0
- package/src/components/Divider.tsx +72 -0
- package/src/components/Drawer.tsx +191 -0
- package/src/components/Empty.tsx +86 -0
- package/src/components/Field.tsx +184 -0
- package/src/components/Grid.tsx +67 -0
- package/src/components/Input.tsx +169 -0
- package/src/components/Kbd.tsx +57 -0
- package/src/components/Label.tsx +54 -0
- package/src/components/Link.tsx +87 -0
- package/src/components/List.tsx +236 -0
- package/src/components/Menu.tsx +195 -0
- package/src/components/NumberInput.tsx +158 -0
- package/src/components/Pagination.tsx +153 -0
- package/src/components/Popover.tsx +219 -0
- package/src/components/Progress.tsx +108 -0
- package/src/components/Radio.tsx +161 -0
- package/src/components/ScrollArea.tsx +58 -0
- package/src/components/Select.tsx +128 -0
- package/src/components/Skeleton.tsx +117 -0
- package/src/components/Slider.tsx +175 -0
- package/src/components/Spinner.tsx +70 -0
- package/src/components/Stack.tsx +79 -0
- package/src/components/Stat.tsx +169 -0
- package/src/components/Steps.tsx +191 -0
- package/src/components/Switch.tsx +146 -0
- package/src/components/Table.tsx +168 -0
- package/src/components/Tabs.tsx +246 -0
- package/src/components/Text.tsx +69 -0
- package/src/components/Textarea.tsx +128 -0
- package/src/components/Timeline.tsx +150 -0
- package/src/components/Toast.tsx +221 -0
- package/src/components/ToggleGroup.tsx +161 -0
- package/src/components/Tooltip.tsx +187 -0
- package/src/components/Transition.tsx +155 -0
- package/src/density.ts +46 -0
- package/src/dev.ts +87 -0
- package/src/focusTrap.ts +61 -0
- package/src/form.ts +269 -0
- package/src/index.ts +243 -0
- package/src/motion.ts +62 -0
- package/src/overlay.ts +232 -0
- package/src/palette.ts +70 -0
- package/src/reactive.ts +54 -0
- package/src/rovingFocus.ts +171 -0
- package/src/size-entries/form-kit.ts +11 -0
- package/src/styles/base.css +70 -0
- package/src/styles/theme.css +14 -0
- package/src/styles/tokens.css +377 -0
- package/src/styles/utilities.css +216 -0
- package/src/styles.ts +52 -0
- package/src/theme.ts +48 -0
- package/src/utils.ts +25 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"palette.js","sourceRoot":"","sources":["../src/palette.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAe,MAAM,cAAc,CAAC;AAiB3D,MAAM,WAAW,GAAG,YAAY,CAAC;AAEjC,SAAS,UAAU;IACjB,IAAI,OAAO,YAAY,KAAK,WAAW;QAAE,OAAO,IAAI,CAAC;IACrD,IAAI,CAAC;QACH,MAAM,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C,CAAC,CAAC;IACL,CAAC;IAED,OAAO,EAAE,EAAE,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;AACnC,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared prop reading for form / control primitives.
|
|
3
|
+
*
|
|
4
|
+
* Prefer `mergeProps` / `createProps` so accessors and signals unwrap on
|
|
5
|
+
* property access. These helpers still work on *raw* values when needed
|
|
6
|
+
* (e.g. reading before merge, or defensive double-unwrap).
|
|
7
|
+
*
|
|
8
|
+
* Call inside an `effect` (or JSX reactive binding) so dependencies track.
|
|
9
|
+
*/
|
|
10
|
+
/** Plain value or zero-arg accessor / signal-like function. */
|
|
11
|
+
export type MaybeReactive<T> = T | (() => T);
|
|
12
|
+
/**
|
|
13
|
+
* Resolve `T | (() => T)`.
|
|
14
|
+
* - functions with arity 0 (including signals) are called
|
|
15
|
+
* - multi-arg functions are returned as-is (not used as accessors)
|
|
16
|
+
* - everything else is returned as-is
|
|
17
|
+
*/
|
|
18
|
+
export declare function readProp<T>(value: MaybeReactive<T> | null | undefined): T | undefined;
|
|
19
|
+
/** Boolean controls (`disabled`, `checked`, …). */
|
|
20
|
+
export declare function readBool(value: MaybeReactive<boolean> | null | undefined): boolean;
|
|
21
|
+
/** String controls (`value`, `placeholder`, …). Nullish → `""`. */
|
|
22
|
+
export declare function readStr(value: MaybeReactive<string> | null | undefined): string;
|
|
23
|
+
/** Numeric controls. Nullish → `fallback`. */
|
|
24
|
+
export declare function readNum(value: MaybeReactive<number> | null | undefined, fallback?: number): number;
|
|
25
|
+
//# sourceMappingURL=reactive.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reactive.d.ts","sourceRoot":"","sources":["../src/reactive.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,+DAA+D;AAC/D,MAAM,MAAM,aAAa,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC;AAE7C;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,CAAC,EAAE,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,GAAG,IAAI,GAAG,SAAS,GAAG,CAAC,GAAG,SAAS,CASrF;AAED,mDAAmD;AACnD,wBAAgB,QAAQ,CACtB,KAAK,EAAE,aAAa,CAAC,OAAO,CAAC,GAAG,IAAI,GAAG,SAAS,GAC/C,OAAO,CAET;AAED,mEAAmE;AACnE,wBAAgB,OAAO,CACrB,KAAK,EAAE,aAAa,CAAC,MAAM,CAAC,GAAG,IAAI,GAAG,SAAS,GAC9C,MAAM,CAGR;AAED,8CAA8C;AAC9C,wBAAgB,OAAO,CACrB,KAAK,EAAE,aAAa,CAAC,MAAM,CAAC,GAAG,IAAI,GAAG,SAAS,EAC/C,QAAQ,SAAI,GACX,MAAM,CAIR"}
|
package/dist/reactive.js
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared prop reading for form / control primitives.
|
|
3
|
+
*
|
|
4
|
+
* Prefer `mergeProps` / `createProps` so accessors and signals unwrap on
|
|
5
|
+
* property access. These helpers still work on *raw* values when needed
|
|
6
|
+
* (e.g. reading before merge, or defensive double-unwrap).
|
|
7
|
+
*
|
|
8
|
+
* Call inside an `effect` (or JSX reactive binding) so dependencies track.
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Resolve `T | (() => T)`.
|
|
12
|
+
* - functions with arity 0 (including signals) are called
|
|
13
|
+
* - multi-arg functions are returned as-is (not used as accessors)
|
|
14
|
+
* - everything else is returned as-is
|
|
15
|
+
*/
|
|
16
|
+
export function readProp(value) {
|
|
17
|
+
if (value == null)
|
|
18
|
+
return undefined;
|
|
19
|
+
if (typeof value === "function") {
|
|
20
|
+
// Signals and zero-arg accessors only
|
|
21
|
+
if (value.length === 0) {
|
|
22
|
+
return value();
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
return value;
|
|
26
|
+
}
|
|
27
|
+
/** Boolean controls (`disabled`, `checked`, …). */
|
|
28
|
+
export function readBool(value) {
|
|
29
|
+
return !!readProp(value);
|
|
30
|
+
}
|
|
31
|
+
/** String controls (`value`, `placeholder`, …). Nullish → `""`. */
|
|
32
|
+
export function readStr(value) {
|
|
33
|
+
const v = readProp(value);
|
|
34
|
+
return v == null ? "" : String(v);
|
|
35
|
+
}
|
|
36
|
+
/** Numeric controls. Nullish → `fallback`. */
|
|
37
|
+
export function readNum(value, fallback = 0) {
|
|
38
|
+
const v = readProp(value);
|
|
39
|
+
if (v == null || Number.isNaN(Number(v)))
|
|
40
|
+
return fallback;
|
|
41
|
+
return Number(v);
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=reactive.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reactive.js","sourceRoot":"","sources":["../src/reactive.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAKH;;;;;GAKG;AACH,MAAM,UAAU,QAAQ,CAAI,KAA0C;IACpE,IAAI,KAAK,IAAI,IAAI;QAAE,OAAO,SAAS,CAAC;IACpC,IAAI,OAAO,KAAK,KAAK,UAAU,EAAE,CAAC;QAChC,sCAAsC;QACtC,IAAK,KAAyC,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC5D,OAAQ,KAAiB,EAAE,CAAC;QAC9B,CAAC;IACH,CAAC;IACD,OAAO,KAAU,CAAC;AACpB,CAAC;AAED,mDAAmD;AACnD,MAAM,UAAU,QAAQ,CACtB,KAAgD;IAEhD,OAAO,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AAC3B,CAAC;AAED,mEAAmE;AACnE,MAAM,UAAU,OAAO,CACrB,KAA+C;IAE/C,MAAM,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC1B,OAAO,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;AACpC,CAAC;AAED,8CAA8C;AAC9C,MAAM,UAAU,OAAO,CACrB,KAA+C,EAC/C,QAAQ,GAAG,CAAC;IAEZ,MAAM,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC1B,IAAI,CAAC,IAAI,IAAI,IAAI,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;QAAE,OAAO,QAAQ,CAAC;IAC1D,OAAO,MAAM,CAAC,CAAC,CAAC,CAAC;AACnB,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Roving tabindex helpers for Menu, Tabs, List, etc.
|
|
3
|
+
* @see https://www.w3.org/WAI/ARIA/apg/practices/keyboard-interface/#kbd_roving_tabindex
|
|
4
|
+
*/
|
|
5
|
+
export declare function listRovingItems(root: HTMLElement, selector: string): HTMLElement[];
|
|
6
|
+
/** Set tabindex so only `activeIndex` is in sequential tab order. */
|
|
7
|
+
export declare function applyRovingTabIndex(items: HTMLElement[], activeIndex: number): void;
|
|
8
|
+
export declare function focusRovingItem(items: HTMLElement[], index: number): HTMLElement | null;
|
|
9
|
+
export declare function indexOfFocused(items: HTMLElement[], active: Element | null): number;
|
|
10
|
+
export type RovingKeyOptions = {
|
|
11
|
+
orientation?: "horizontal" | "vertical" | "both";
|
|
12
|
+
loop?: boolean;
|
|
13
|
+
/** Home / End jump to ends (default true) */
|
|
14
|
+
homeEnd?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Called when the focused item should activate (Enter / Space).
|
|
17
|
+
* Return true if the event was handled.
|
|
18
|
+
*/
|
|
19
|
+
onActivate?: (el: HTMLElement, index: number) => boolean | void;
|
|
20
|
+
/**
|
|
21
|
+
* Called when focus moves via arrows/home/end.
|
|
22
|
+
* Return true to also activate (tabs pattern).
|
|
23
|
+
*/
|
|
24
|
+
onMove?: (el: HTMLElement, index: number) => boolean | void;
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Handle Arrow / Home / End / Enter / Space on a composite widget.
|
|
28
|
+
* Returns true when the event was consumed.
|
|
29
|
+
*/
|
|
30
|
+
export declare function handleRovingKeydown(e: KeyboardEvent, root: HTMLElement, selector: string, options?: RovingKeyOptions): boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Initial tabindex setup + focus first/selected item.
|
|
33
|
+
* Call when a menu opens or a list mounts.
|
|
34
|
+
*/
|
|
35
|
+
export declare function initRovingFocus(root: HTMLElement, selector: string, preferredIndex?: number): number;
|
|
36
|
+
//# sourceMappingURL=rovingFocus.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rovingFocus.d.ts","sourceRoot":"","sources":["../src/rovingFocus.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,wBAAgB,eAAe,CAC7B,IAAI,EAAE,WAAW,EACjB,QAAQ,EAAE,MAAM,GACf,WAAW,EAAE,CAQf;AAED,qEAAqE;AACrE,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,WAAW,EAAE,EACpB,WAAW,EAAE,MAAM,GAClB,IAAI,CAIN;AAED,wBAAgB,eAAe,CAC7B,KAAK,EAAE,WAAW,EAAE,EACpB,KAAK,EAAE,MAAM,GACZ,WAAW,GAAG,IAAI,CAOpB;AAED,wBAAgB,cAAc,CAC5B,KAAK,EAAE,WAAW,EAAE,EACpB,MAAM,EAAE,OAAO,GAAG,IAAI,GACrB,MAAM,CAGR;AAED,MAAM,MAAM,gBAAgB,GAAG;IAC7B,WAAW,CAAC,EAAE,YAAY,GAAG,UAAU,GAAG,MAAM,CAAC;IACjD,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,6CAA6C;IAC7C,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;OAGG;IACH,UAAU,CAAC,EAAE,CAAC,EAAE,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,KAAK,OAAO,GAAG,IAAI,CAAC;IAChE;;;OAGG;IACH,MAAM,CAAC,EAAE,CAAC,EAAE,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,KAAK,OAAO,GAAG,IAAI,CAAC;CAC7D,CAAC;AAEF;;;GAGG;AACH,wBAAgB,mBAAmB,CACjC,CAAC,EAAE,aAAa,EAChB,IAAI,EAAE,WAAW,EACjB,QAAQ,EAAE,MAAM,EAChB,OAAO,GAAE,gBAAqB,GAC7B,OAAO,CAgFT;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAC7B,IAAI,EAAE,WAAW,EACjB,QAAQ,EAAE,MAAM,EAChB,cAAc,SAAI,GACjB,MAAM,CAMR"}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Roving tabindex helpers for Menu, Tabs, List, etc.
|
|
3
|
+
* @see https://www.w3.org/WAI/ARIA/apg/practices/keyboard-interface/#kbd_roving_tabindex
|
|
4
|
+
*/
|
|
5
|
+
export function listRovingItems(root, selector) {
|
|
6
|
+
return [...root.querySelectorAll(selector)].filter((el) => {
|
|
7
|
+
if (el.hasAttribute("disabled"))
|
|
8
|
+
return false;
|
|
9
|
+
if (el.getAttribute("aria-disabled") === "true")
|
|
10
|
+
return false;
|
|
11
|
+
// hidden from a11y tree
|
|
12
|
+
if (el.getAttribute("aria-hidden") === "true")
|
|
13
|
+
return false;
|
|
14
|
+
return true;
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
/** Set tabindex so only `activeIndex` is in sequential tab order. */
|
|
18
|
+
export function applyRovingTabIndex(items, activeIndex) {
|
|
19
|
+
items.forEach((el, i) => {
|
|
20
|
+
el.tabIndex = i === activeIndex ? 0 : -1;
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
export function focusRovingItem(items, index) {
|
|
24
|
+
if (items.length === 0)
|
|
25
|
+
return null;
|
|
26
|
+
const i = Math.max(0, Math.min(items.length - 1, index));
|
|
27
|
+
applyRovingTabIndex(items, i);
|
|
28
|
+
const el = items[i];
|
|
29
|
+
el.focus();
|
|
30
|
+
return el;
|
|
31
|
+
}
|
|
32
|
+
export function indexOfFocused(items, active) {
|
|
33
|
+
if (!active)
|
|
34
|
+
return -1;
|
|
35
|
+
return items.findIndex((el) => el === active || el.contains(active));
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Handle Arrow / Home / End / Enter / Space on a composite widget.
|
|
39
|
+
* Returns true when the event was consumed.
|
|
40
|
+
*/
|
|
41
|
+
export function handleRovingKeydown(e, root, selector, options = {}) {
|
|
42
|
+
const { orientation = "vertical", loop = true, homeEnd = true, onActivate, onMove, } = options;
|
|
43
|
+
const items = listRovingItems(root, selector);
|
|
44
|
+
if (items.length === 0)
|
|
45
|
+
return false;
|
|
46
|
+
const doc = root.ownerDocument;
|
|
47
|
+
let idx = indexOfFocused(items, doc.activeElement);
|
|
48
|
+
if (idx < 0)
|
|
49
|
+
idx = 0;
|
|
50
|
+
const key = e.key;
|
|
51
|
+
const vertical = orientation === "vertical" || orientation === "both";
|
|
52
|
+
const horizontal = orientation === "horizontal" || orientation === "both";
|
|
53
|
+
let next = idx;
|
|
54
|
+
let moved = false;
|
|
55
|
+
if (vertical && key === "ArrowDown") {
|
|
56
|
+
next = loop
|
|
57
|
+
? (idx + 1) % items.length
|
|
58
|
+
: Math.min(items.length - 1, idx + 1);
|
|
59
|
+
moved = true;
|
|
60
|
+
}
|
|
61
|
+
else if (vertical && key === "ArrowUp") {
|
|
62
|
+
next = loop
|
|
63
|
+
? (idx - 1 + items.length) % items.length
|
|
64
|
+
: Math.max(0, idx - 1);
|
|
65
|
+
moved = true;
|
|
66
|
+
}
|
|
67
|
+
else if (horizontal && key === "ArrowRight") {
|
|
68
|
+
next = loop
|
|
69
|
+
? (idx + 1) % items.length
|
|
70
|
+
: Math.min(items.length - 1, idx + 1);
|
|
71
|
+
moved = true;
|
|
72
|
+
}
|
|
73
|
+
else if (horizontal && key === "ArrowLeft") {
|
|
74
|
+
next = loop
|
|
75
|
+
? (idx - 1 + items.length) % items.length
|
|
76
|
+
: Math.max(0, idx - 1);
|
|
77
|
+
moved = true;
|
|
78
|
+
}
|
|
79
|
+
else if (homeEnd && key === "Home") {
|
|
80
|
+
next = 0;
|
|
81
|
+
moved = true;
|
|
82
|
+
}
|
|
83
|
+
else if (homeEnd && key === "End") {
|
|
84
|
+
next = items.length - 1;
|
|
85
|
+
moved = true;
|
|
86
|
+
}
|
|
87
|
+
else if (key === "Enter" || key === " ") {
|
|
88
|
+
e.preventDefault();
|
|
89
|
+
const el = items[idx];
|
|
90
|
+
onActivate?.(el, idx);
|
|
91
|
+
return true;
|
|
92
|
+
}
|
|
93
|
+
else {
|
|
94
|
+
return false;
|
|
95
|
+
}
|
|
96
|
+
if (!moved || next === idx && key !== "Home" && key !== "End") {
|
|
97
|
+
// still prevent scroll for arrows even if clamped
|
|
98
|
+
if (key === "ArrowDown" ||
|
|
99
|
+
key === "ArrowUp" ||
|
|
100
|
+
key === "ArrowLeft" ||
|
|
101
|
+
key === "ArrowRight" ||
|
|
102
|
+
key === "Home" ||
|
|
103
|
+
key === "End") {
|
|
104
|
+
e.preventDefault();
|
|
105
|
+
return true;
|
|
106
|
+
}
|
|
107
|
+
return false;
|
|
108
|
+
}
|
|
109
|
+
e.preventDefault();
|
|
110
|
+
const el = focusRovingItem(items, next);
|
|
111
|
+
if (el)
|
|
112
|
+
onMove?.(el, next);
|
|
113
|
+
return true;
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Initial tabindex setup + focus first/selected item.
|
|
117
|
+
* Call when a menu opens or a list mounts.
|
|
118
|
+
*/
|
|
119
|
+
export function initRovingFocus(root, selector, preferredIndex = 0) {
|
|
120
|
+
const items = listRovingItems(root, selector);
|
|
121
|
+
if (items.length === 0)
|
|
122
|
+
return -1;
|
|
123
|
+
const i = Math.max(0, Math.min(items.length - 1, preferredIndex));
|
|
124
|
+
applyRovingTabIndex(items, i);
|
|
125
|
+
return i;
|
|
126
|
+
}
|
|
127
|
+
//# sourceMappingURL=rovingFocus.js.map
|
|
@@ -0,0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K,CAAC;QAAE,OAAO,CAAC,CAAC,CAAC;IAClC,MAAM,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,cAAc,CAAC,CAAC,CAAC;IAClE,mBAAmB,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;IAC9B,OAAO,CAAC,CAAC;AACX,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Size entry: golden-path form surface only (tree-shake probe).
|
|
3
|
+
* Measured by scripts/size.ts — not a public export.
|
|
4
|
+
*/
|
|
5
|
+
export { Button } from "../components/Button.js";
|
|
6
|
+
export { Input } from "../components/Input.js";
|
|
7
|
+
export { Field } from "../components/Field.js";
|
|
8
|
+
export { Stack } from "../components/Stack.js";
|
|
9
|
+
export { Text } from "../components/Text.js";
|
|
10
|
+
export { createTheme } from "../theme.js";
|
|
11
|
+
export { required, emailFormat, firstError } from "../form.js";
|
|
12
|
+
//# sourceMappingURL=form-kit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"form-kit.d.ts","sourceRoot":"","sources":["../../src/size-entries/form-kit.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AACjD,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAC/C,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAC/C,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAC/C,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Size entry: golden-path form surface only (tree-shake probe).
|
|
3
|
+
* Measured by scripts/size.ts — not a public export.
|
|
4
|
+
*/
|
|
5
|
+
export { Button } from "../components/Button.js";
|
|
6
|
+
export { Input } from "../components/Input.js";
|
|
7
|
+
export { Field } from "../components/Field.js";
|
|
8
|
+
export { Stack } from "../components/Stack.js";
|
|
9
|
+
export { Text } from "../components/Text.js";
|
|
10
|
+
export { createTheme } from "../theme.js";
|
|
11
|
+
export { required, emailFormat, firstError } from "../form.js";
|
|
12
|
+
//# sourceMappingURL=form-kit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"form-kit.js","sourceRoot":"","sources":["../../src/size-entries/form-kit.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AACjD,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAC/C,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAC/C,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAC/C,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC"}
|
package/dist/styles.d.ts
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Inject a component stylesheet once per document.
|
|
3
|
+
* Use this when writing new primitives — 3 lines of setup.
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* ```ts
|
|
7
|
+
* const ensure = createStyleSheet("my-thing", `.pu-my { color: var(--pu-color-accent); }`);
|
|
8
|
+
* export const MyThing = component((props) => {
|
|
9
|
+
* ensure();
|
|
10
|
+
* return <div class="pu-my" ref={(el) => ensure(el.ownerDocument)}>{props.children}</div>;
|
|
11
|
+
* });
|
|
12
|
+
* ```
|
|
13
|
+
*
|
|
14
|
+
* **Customize without forking:** override CSS variables on a wrapper
|
|
15
|
+
* (`style={{ "--pu-color-accent": "#69BE28" }}`) or restyle via
|
|
16
|
+
* `[data-pu-ui="my-thing"]` rules / class props.
|
|
17
|
+
*/
|
|
18
|
+
export declare function createStyleSheet(id: string, css: string): (doc?: Document) => void;
|
|
19
|
+
/**
|
|
20
|
+
* Build a style object of CSS custom properties for the `style` prop.
|
|
21
|
+
* Keys may omit the leading `--` (both `"pu-color-accent"` and `"--pu-x"` work).
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```tsx
|
|
25
|
+
* <Card style={styleVars({ "pu-color-accent": "#69BE28", "pu-radius-md": "12px" })} />
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
export declare function styleVars(vars: Record<string, string | number | undefined | null>): Record<string, string | number>;
|
|
29
|
+
//# sourceMappingURL=styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../src/styles.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,gBAAgB,CAAC,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,IAC/B,MAAK,QAAmB,KAAG,IAAI,CAQvD;AAED;;;;;;;;GAQG;AACH,wBAAgB,SAAS,CACvB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,GAAG,IAAI,CAAC,GACvD,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,CAYjC"}
|
package/dist/styles.js
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Inject a component stylesheet once per document.
|
|
3
|
+
* Use this when writing new primitives — 3 lines of setup.
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* ```ts
|
|
7
|
+
* const ensure = createStyleSheet("my-thing", `.pu-my { color: var(--pu-color-accent); }`);
|
|
8
|
+
* export const MyThing = component((props) => {
|
|
9
|
+
* ensure();
|
|
10
|
+
* return <div class="pu-my" ref={(el) => ensure(el.ownerDocument)}>{props.children}</div>;
|
|
11
|
+
* });
|
|
12
|
+
* ```
|
|
13
|
+
*
|
|
14
|
+
* **Customize without forking:** override CSS variables on a wrapper
|
|
15
|
+
* (`style={{ "--pu-color-accent": "#69BE28" }}`) or restyle via
|
|
16
|
+
* `[data-pu-ui="my-thing"]` rules / class props.
|
|
17
|
+
*/
|
|
18
|
+
export function createStyleSheet(id, css) {
|
|
19
|
+
return function ensure(doc = document) {
|
|
20
|
+
if (typeof doc === "undefined")
|
|
21
|
+
return;
|
|
22
|
+
if (doc.querySelector(`style[data-pu-ui="${id}"]`))
|
|
23
|
+
return;
|
|
24
|
+
const el = doc.createElement("style");
|
|
25
|
+
el.setAttribute("data-pu-ui", id);
|
|
26
|
+
el.textContent = css;
|
|
27
|
+
doc.head.appendChild(el);
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Build a style object of CSS custom properties for the `style` prop.
|
|
32
|
+
* Keys may omit the leading `--` (both `"pu-color-accent"` and `"--pu-x"` work).
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```tsx
|
|
36
|
+
* <Card style={styleVars({ "pu-color-accent": "#69BE28", "pu-radius-md": "12px" })} />
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
export function styleVars(vars) {
|
|
40
|
+
const out = {};
|
|
41
|
+
for (const [key, value] of Object.entries(vars)) {
|
|
42
|
+
if (value == null || value === "")
|
|
43
|
+
continue;
|
|
44
|
+
const name = key.startsWith("--")
|
|
45
|
+
? key
|
|
46
|
+
: key.startsWith("pu-")
|
|
47
|
+
? `--${key}`
|
|
48
|
+
: `--${key}`;
|
|
49
|
+
out[name] = value;
|
|
50
|
+
}
|
|
51
|
+
return out;
|
|
52
|
+
}
|
|
53
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
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type Signal } from "@lab206/core";
|
|
2
|
+
export type ThemeMode = "light" | "dark";
|
|
3
|
+
export interface ThemeController {
|
|
4
|
+
/** Current mode signal */
|
|
5
|
+
mode: Signal<ThemeMode>;
|
|
6
|
+
setMode(mode: ThemeMode): void;
|
|
7
|
+
toggle(): void;
|
|
8
|
+
/** Apply `data-pu-theme` on an element (default: document.documentElement) */
|
|
9
|
+
bind(target?: Element): () => void;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Create a theme controller. Tokens switch via `data-pu-theme` on the root.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```ts
|
|
16
|
+
* const theme = createTheme("dark");
|
|
17
|
+
* theme.bind(); // <html data-pu-theme="dark">
|
|
18
|
+
* theme.toggle();
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
export declare function createTheme(initial?: ThemeMode): ThemeController;
|
|
22
|
+
//# sourceMappingURL=theme.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../src/theme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,KAAK,MAAM,EAAE,MAAM,cAAc,CAAC;AAGnD,MAAM,MAAM,SAAS,GAAG,OAAO,GAAG,MAAM,CAAC;AAEzC,MAAM,WAAW,eAAe;IAC9B,0BAA0B;IAC1B,IAAI,EAAE,MAAM,CAAC,SAAS,CAAC,CAAC;IACxB,OAAO,CAAC,IAAI,EAAE,SAAS,GAAG,IAAI,CAAC;IAC/B,MAAM,IAAI,IAAI,CAAC;IACf,8EAA8E;IAC9E,IAAI,CAAC,MAAM,CAAC,EAAE,OAAO,GAAG,MAAM,IAAI,CAAC;CACpC;AAED;;;;;;;;;GASG;AACH,wBAAgB,WAAW,CAAC,OAAO,GAAE,SAAmB,GAAG,eAAe,CAuBzE"}
|
package/dist/theme.js
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { signal } from "@lab206/core";
|
|
2
|
+
import { effect } from "@lab206/core";
|
|
3
|
+
/**
|
|
4
|
+
* Create a theme controller. Tokens switch via `data-pu-theme` on the root.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```ts
|
|
8
|
+
* const theme = createTheme("dark");
|
|
9
|
+
* theme.bind(); // <html data-pu-theme="dark">
|
|
10
|
+
* theme.toggle();
|
|
11
|
+
* ```
|
|
12
|
+
*/
|
|
13
|
+
export function createTheme(initial = "light") {
|
|
14
|
+
const mode = signal(initial);
|
|
15
|
+
function setMode(next) {
|
|
16
|
+
mode.set(next);
|
|
17
|
+
}
|
|
18
|
+
function toggle() {
|
|
19
|
+
mode.update((m) => (m === "light" ? "dark" : "light"));
|
|
20
|
+
}
|
|
21
|
+
function bind(target) {
|
|
22
|
+
const el = target ??
|
|
23
|
+
(typeof document !== "undefined" ? document.documentElement : null);
|
|
24
|
+
if (!el)
|
|
25
|
+
return () => { };
|
|
26
|
+
return effect(() => {
|
|
27
|
+
el.setAttribute("data-pu-theme", mode());
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
return { mode, setMode, toggle, bind };
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=theme.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme.js","sourceRoot":"","sources":["../src/theme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAe,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAatC;;;;;;;;;GASG;AACH,MAAM,UAAU,WAAW,CAAC,UAAqB,OAAO;IACtD,MAAM,IAAI,GAAG,MAAM,CAAY,OAAO,CAAC,CAAC;IAExC,SAAS,OAAO,CAAC,IAAe;QAC9B,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACjB,CAAC;IAED,SAAS,MAAM;QACb,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;IACzD,CAAC;IAED,SAAS,IAAI,CAAC,MAAgB;QAC5B,MAAM,EAAE,GACN,MAAM;YACN,CAAC,OAAO,QAAQ,KAAK,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;QACtE,IAAI,CAAC,EAAE;YAAE,OAAO,GAAG,EAAE,GAAE,CAAC,CAAC;QAEzB,OAAO,MAAM,CAAC,GAAG,EAAE;YACjB,EAAE,CAAC,YAAY,CAAC,eAAe,EAAE,IAAI,EAAE,CAAC,CAAC;QAC3C,CAAC,CAAC,CAAC;IACL,CAAC;IAED,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;AACzC,CAAC"}
|
package/dist/utils.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** Join class names, skipping falsy. */
|
|
2
|
+
export declare function cx(...parts: Array<string | false | null | undefined | Record<string, boolean | undefined | null>>): string;
|
|
3
|
+
/** Stable-enough unique id for a11y wiring (dialog titles, field labels, …). */
|
|
4
|
+
export declare function puId(prefix?: string): string;
|
|
5
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA,wCAAwC;AACxC,wBAAgB,EAAE,CAChB,GAAG,KAAK,EAAE,KAAK,CAAC,MAAM,GAAG,KAAK,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,GAAG,SAAS,GAAG,IAAI,CAAC,CAAC,GAC9F,MAAM,CAaR;AAID,gFAAgF;AAChF,wBAAgB,IAAI,CAAC,MAAM,SAAO,GAAG,MAAM,CAG1C"}
|
package/dist/utils.js
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/** Join class names, skipping falsy. */
|
|
2
|
+
export function cx(...parts) {
|
|
3
|
+
const out = [];
|
|
4
|
+
for (const p of parts) {
|
|
5
|
+
if (!p)
|
|
6
|
+
continue;
|
|
7
|
+
if (typeof p === "string") {
|
|
8
|
+
out.push(p);
|
|
9
|
+
continue;
|
|
10
|
+
}
|
|
11
|
+
for (const key of Object.keys(p)) {
|
|
12
|
+
if (p[key])
|
|
13
|
+
out.push(key);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
return out.join(" ");
|
|
17
|
+
}
|
|
18
|
+
let uidSeq = 0;
|
|
19
|
+
/** Stable-enough unique id for a11y wiring (dialog titles, field labels, …). */
|
|
20
|
+
export function puId(prefix = "pu") {
|
|
21
|
+
uidSeq += 1;
|
|
22
|
+
return `${prefix}-${uidSeq.toString(36)}`;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA,wCAAwC;AACxC,MAAM,UAAU,EAAE,CAChB,GAAG,KAA4F;IAE/F,MAAM,GAAG,GAAa,EAAE,CAAC;IACzB,KAAK,MAAM,CAAC,IAAI,KAAK,EAAE,CAAC;QACtB,IAAI,CAAC,CAAC;YAAE,SAAS;QACjB,IAAI,OAAO,CAAC,KAAK,QAAQ,EAAE,CAAC;YAC1B,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YACZ,SAAS;QACX,CAAC;QACD,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;YACjC,IAAI,CAAC,CAAC,GAAG,CAAC;gBAAE,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAC5B,CAAC;IACH,CAAC;IACD,OAAO,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACvB,CAAC;AAED,IAAI,MAAM,GAAG,CAAC,CAAC;AAEf,gFAAgF;AAChF,MAAM,UAAU,IAAI,CAAC,MAAM,GAAG,IAAI;IAChC,MAAM,IAAI,CAAC,CAAC;IACZ,OAAO,GAAG,MAAM,IAAI,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE,CAAC;AAC5C,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@lab206/ui",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Powers design system — tokens, primitives, and token-mapped utilities (batteries included).",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"license": "BUSL-1.1",
|
|
7
|
+
"sideEffects": [
|
|
8
|
+
"./src/styles/tokens.css",
|
|
9
|
+
"./src/styles/base.css",
|
|
10
|
+
"./src/styles/utilities.css",
|
|
11
|
+
"./src/styles/theme.css"
|
|
12
|
+
],
|
|
13
|
+
"exports": {
|
|
14
|
+
".": {
|
|
15
|
+
"types": "./src/index.ts",
|
|
16
|
+
"development": "./src/index.ts",
|
|
17
|
+
"import": "./dist/index.js",
|
|
18
|
+
"default": "./dist/index.js"
|
|
19
|
+
},
|
|
20
|
+
"./tokens.css": "./src/styles/tokens.css",
|
|
21
|
+
"./base.css": "./src/styles/base.css",
|
|
22
|
+
"./utilities.css": "./src/styles/utilities.css",
|
|
23
|
+
"./theme.css": "./src/styles/theme.css"
|
|
24
|
+
},
|
|
25
|
+
"main": "./dist/index.js",
|
|
26
|
+
"types": "./dist/index.d.ts",
|
|
27
|
+
"files": [
|
|
28
|
+
"dist",
|
|
29
|
+
"README.md",
|
|
30
|
+
"src/**/*.ts",
|
|
31
|
+
"src/**/*.tsx",
|
|
32
|
+
"src/**/*.css",
|
|
33
|
+
"!src/**/*.test.ts",
|
|
34
|
+
"!src/**/*.test.tsx",
|
|
35
|
+
"!src/code-connect/**",
|
|
36
|
+
"!src/**/*.figma.ts"
|
|
37
|
+
],
|
|
38
|
+
"dependencies": {
|
|
39
|
+
"@lab206/core": "0.1.0",
|
|
40
|
+
"@lab206/dom": "0.1.0"
|
|
41
|
+
},
|
|
42
|
+
"devDependencies": {
|
|
43
|
+
"esbuild": "^0.25.1",
|
|
44
|
+
"happy-dom": "^17.4.4",
|
|
45
|
+
"tsx": "^4.19.3",
|
|
46
|
+
"typescript": "^5.8.2"
|
|
47
|
+
},
|
|
48
|
+
"author": "Scott Powers",
|
|
49
|
+
"private": false,
|
|
50
|
+
"publishConfig": {
|
|
51
|
+
"access": "public"
|
|
52
|
+
},
|
|
53
|
+
"homepage": "https://lab206.com",
|
|
54
|
+
"bugs": {
|
|
55
|
+
"url": "https://github.com/spowers2/powers/issues"
|
|
56
|
+
},
|
|
57
|
+
"engines": {
|
|
58
|
+
"node": ">=20"
|
|
59
|
+
},
|
|
60
|
+
"repository": {
|
|
61
|
+
"type": "git",
|
|
62
|
+
"url": "git+https://github.com/spowers2/powers.git",
|
|
63
|
+
"directory": "packages/ui"
|
|
64
|
+
},
|
|
65
|
+
"scripts": {
|
|
66
|
+
"build": "tsc -p tsconfig.json",
|
|
67
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
68
|
+
"test": "node --import tsx --test src/*.test.ts",
|
|
69
|
+
"size": "node --import tsx scripts/size.ts"
|
|
70
|
+
}
|
|
71
|
+
}
|