@neut/ui 0.0.6 → 0.0.7

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.
Files changed (107) hide show
  1. package/dist/components/breadcrumb/Breadcrumb/Breadcrumb.d.ts +2 -0
  2. package/dist/components/breadcrumb/Breadcrumb/Breadcrumb.js +10 -0
  3. package/dist/components/breadcrumb/Breadcrumb/Breadcrumb.js.map +1 -0
  4. package/dist/components/breadcrumb/Breadcrumb/Breadcrumb.types.d.ts +2 -0
  5. package/dist/components/breadcrumb/Breadcrumb/index.d.ts +1 -0
  6. package/dist/components/breadcrumb/BreadcrumbEllipsis/BreadcrumbEllipsis.d.ts +2 -0
  7. package/dist/components/breadcrumb/BreadcrumbEllipsis/BreadcrumbEllipsis.js +19 -0
  8. package/dist/components/breadcrumb/BreadcrumbEllipsis/BreadcrumbEllipsis.js.map +1 -0
  9. package/dist/components/breadcrumb/BreadcrumbEllipsis/BreadcrumbEllipsis.styles.d.ts +1 -0
  10. package/dist/components/breadcrumb/BreadcrumbEllipsis/BreadcrumbEllipsis.styles.js +6 -0
  11. package/dist/components/breadcrumb/BreadcrumbEllipsis/BreadcrumbEllipsis.styles.js.map +1 -0
  12. package/dist/components/breadcrumb/BreadcrumbEllipsis/BreadcrumbEllipsis.types.d.ts +2 -0
  13. package/dist/components/breadcrumb/BreadcrumbEllipsis/index.d.ts +1 -0
  14. package/dist/components/breadcrumb/BreadcrumbItem/BreadcrumbItem.d.ts +2 -0
  15. package/dist/components/breadcrumb/BreadcrumbItem/BreadcrumbItem.js +18 -0
  16. package/dist/components/breadcrumb/BreadcrumbItem/BreadcrumbItem.js.map +1 -0
  17. package/dist/components/breadcrumb/BreadcrumbItem/BreadcrumbItem.styles.d.ts +1 -0
  18. package/dist/components/breadcrumb/BreadcrumbItem/BreadcrumbItem.styles.js +6 -0
  19. package/dist/components/breadcrumb/BreadcrumbItem/BreadcrumbItem.styles.js.map +1 -0
  20. package/dist/components/breadcrumb/BreadcrumbItem/BreadcrumbItem.types.d.ts +2 -0
  21. package/dist/components/breadcrumb/BreadcrumbItem/index.d.ts +1 -0
  22. package/dist/components/breadcrumb/BreadcrumbLink/BreadcrumbLink.d.ts +3 -0
  23. package/dist/components/breadcrumb/BreadcrumbLink/BreadcrumbLink.js +29 -0
  24. package/dist/components/breadcrumb/BreadcrumbLink/BreadcrumbLink.js.map +1 -0
  25. package/dist/components/breadcrumb/BreadcrumbLink/BreadcrumbLink.styles.d.ts +1 -0
  26. package/dist/components/breadcrumb/BreadcrumbLink/BreadcrumbLink.styles.js +6 -0
  27. package/dist/components/breadcrumb/BreadcrumbLink/BreadcrumbLink.styles.js.map +1 -0
  28. package/dist/components/breadcrumb/BreadcrumbLink/BreadcrumbLink.types.d.ts +6 -0
  29. package/dist/components/breadcrumb/BreadcrumbLink/index.d.ts +1 -0
  30. package/dist/components/breadcrumb/BreadcrumbList/BreadcrumbList.d.ts +2 -0
  31. package/dist/components/breadcrumb/BreadcrumbList/BreadcrumbList.js +18 -0
  32. package/dist/components/breadcrumb/BreadcrumbList/BreadcrumbList.js.map +1 -0
  33. package/dist/components/breadcrumb/BreadcrumbList/BreadcrumbList.styles.d.ts +1 -0
  34. package/dist/components/breadcrumb/BreadcrumbList/BreadcrumbList.styles.js +6 -0
  35. package/dist/components/breadcrumb/BreadcrumbList/BreadcrumbList.styles.js.map +1 -0
  36. package/dist/components/breadcrumb/BreadcrumbList/BreadcrumbList.types.d.ts +2 -0
  37. package/dist/components/breadcrumb/BreadcrumbList/index.d.ts +1 -0
  38. package/dist/components/breadcrumb/BreadcrumbPage/BreadcrumbPage.d.ts +2 -0
  39. package/dist/components/breadcrumb/BreadcrumbPage/BreadcrumbPage.js +18 -0
  40. package/dist/components/breadcrumb/BreadcrumbPage/BreadcrumbPage.js.map +1 -0
  41. package/dist/components/breadcrumb/BreadcrumbPage/BreadcrumbPage.styles.d.ts +1 -0
  42. package/dist/components/breadcrumb/BreadcrumbPage/BreadcrumbPage.styles.js +6 -0
  43. package/dist/components/breadcrumb/BreadcrumbPage/BreadcrumbPage.styles.js.map +1 -0
  44. package/dist/components/breadcrumb/BreadcrumbPage/BreadcrumbPage.types.d.ts +2 -0
  45. package/dist/components/breadcrumb/BreadcrumbPage/index.d.ts +1 -0
  46. package/dist/components/breadcrumb/BreadcrumbSeparator/BreadcrumbSeparator.d.ts +2 -0
  47. package/dist/components/breadcrumb/BreadcrumbSeparator/BreadcrumbSeparator.js +33 -0
  48. package/dist/components/breadcrumb/BreadcrumbSeparator/BreadcrumbSeparator.js.map +1 -0
  49. package/dist/components/breadcrumb/BreadcrumbSeparator/BreadcrumbSeparator.styles.d.ts +1 -0
  50. package/dist/components/breadcrumb/BreadcrumbSeparator/BreadcrumbSeparator.styles.js +6 -0
  51. package/dist/components/breadcrumb/BreadcrumbSeparator/BreadcrumbSeparator.styles.js.map +1 -0
  52. package/dist/components/breadcrumb/BreadcrumbSeparator/BreadcrumbSeparator.types.d.ts +2 -0
  53. package/dist/components/breadcrumb/BreadcrumbSeparator/index.d.ts +1 -0
  54. package/dist/components/breadcrumb/index.d.ts +7 -0
  55. package/dist/components/breadcrumb/index.js +8 -0
  56. package/dist/components/button/Button.styles.js +3 -3
  57. package/dist/components/button/Button.styles.js.map +1 -1
  58. package/dist/components/checkbox/Checkbox/Checkbox.d.ts +2 -0
  59. package/dist/components/checkbox/Checkbox/Checkbox.js +66 -0
  60. package/dist/components/checkbox/Checkbox/Checkbox.js.map +1 -0
  61. package/dist/components/checkbox/Checkbox/Checkbox.styles.d.ts +1 -0
  62. package/dist/components/checkbox/Checkbox/Checkbox.styles.js +7 -0
  63. package/dist/components/checkbox/Checkbox/Checkbox.styles.js.map +1 -0
  64. package/dist/components/checkbox/Checkbox/Checkbox.types.d.ts +10 -0
  65. package/dist/components/checkbox/Checkbox/index.d.ts +1 -0
  66. package/dist/components/checkbox/CheckboxIndicator/CheckboxIndicator.d.ts +3 -0
  67. package/dist/components/checkbox/CheckboxIndicator/CheckboxIndicator.js +25 -0
  68. package/dist/components/checkbox/CheckboxIndicator/CheckboxIndicator.js.map +1 -0
  69. package/dist/components/checkbox/CheckboxIndicator/CheckboxIndicator.styles.d.ts +1 -0
  70. package/dist/components/checkbox/CheckboxIndicator/CheckboxIndicator.styles.js +6 -0
  71. package/dist/components/checkbox/CheckboxIndicator/CheckboxIndicator.styles.js.map +1 -0
  72. package/dist/components/checkbox/CheckboxIndicator/CheckboxIndicator.types.d.ts +2 -0
  73. package/dist/components/checkbox/CheckboxIndicator/index.d.ts +1 -0
  74. package/dist/components/checkbox/index.d.ts +1 -0
  75. package/dist/components/checkbox/index.js +2 -0
  76. package/dist/components/collapsible/Collapsible/Collapsible.context.d.ts +9 -0
  77. package/dist/components/collapsible/Collapsible/Collapsible.context.js +11 -0
  78. package/dist/components/collapsible/Collapsible/Collapsible.context.js.map +1 -0
  79. package/dist/components/collapsible/Collapsible/Collapsible.d.ts +2 -0
  80. package/dist/components/collapsible/Collapsible/Collapsible.js +33 -0
  81. package/dist/components/collapsible/Collapsible/Collapsible.js.map +1 -0
  82. package/dist/components/collapsible/Collapsible/Collapsible.types.d.ts +8 -0
  83. package/dist/components/collapsible/Collapsible/index.d.ts +2 -0
  84. package/dist/components/collapsible/CollapsibleContent/CollapsibleContent.d.ts +2 -0
  85. package/dist/components/collapsible/CollapsibleContent/CollapsibleContent.js +20 -0
  86. package/dist/components/collapsible/CollapsibleContent/CollapsibleContent.js.map +1 -0
  87. package/dist/components/collapsible/CollapsibleContent/CollapsibleContent.types.d.ts +2 -0
  88. package/dist/components/collapsible/CollapsibleContent/index.d.ts +1 -0
  89. package/dist/components/collapsible/CollapsibleTrigger/CollapsibleTrigger.d.ts +2 -0
  90. package/dist/components/collapsible/CollapsibleTrigger/CollapsibleTrigger.js +24 -0
  91. package/dist/components/collapsible/CollapsibleTrigger/CollapsibleTrigger.js.map +1 -0
  92. package/dist/components/collapsible/CollapsibleTrigger/CollapsibleTrigger.types.d.ts +2 -0
  93. package/dist/components/collapsible/CollapsibleTrigger/index.d.ts +1 -0
  94. package/dist/components/collapsible/index.d.ts +3 -0
  95. package/dist/components/collapsible/index.js +4 -0
  96. package/dist/components/field/FieldLabel/FieldLabel.js +1 -1
  97. package/dist/components/field/FieldLabel/FieldLabel.js.map +1 -1
  98. package/dist/components/input/Input.js +23 -14
  99. package/dist/components/input/Input.js.map +1 -1
  100. package/dist/components/input/Input.types.d.ts +2 -0
  101. package/dist/components/label/Label.js +31 -9
  102. package/dist/components/label/Label.js.map +1 -1
  103. package/dist/index.d.ts +3 -0
  104. package/dist/index.js +108 -97
  105. package/dist/types/props.types.d.ts +11 -0
  106. package/dist/ui.css +1 -1
  107. package/package.json +1 -1
@@ -0,0 +1 @@
1
+ export declare const classes = "grid place-content-center text-current transition-none [&>svg]:size-3.5";
@@ -0,0 +1,6 @@
1
+ //#region src/components/checkbox/CheckboxIndicator/CheckboxIndicator.styles.ts
2
+ var e = "grid place-content-center text-current transition-none [&>svg]:size-3.5";
3
+ //#endregion
4
+ export { e as classes };
5
+
6
+ //# sourceMappingURL=CheckboxIndicator.styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CheckboxIndicator.styles.js","names":[],"sources":["../../../../src/components/checkbox/CheckboxIndicator/CheckboxIndicator.styles.ts"],"sourcesContent":["export const classes =\n \"grid place-content-center text-current transition-none [&>svg]:size-3.5\";\n"],"mappings":";AAAA,IAAa,IACX"}
@@ -0,0 +1,2 @@
1
+ import { BaseProps, PolymorphicProps } from '../../../types';
2
+ export type CheckboxIndicatorProps = Omit<PolymorphicProps<"span", BaseProps, false>, "children">;
@@ -0,0 +1 @@
1
+ export { CheckboxIndicator } from './CheckboxIndicator';
@@ -0,0 +1 @@
1
+ export { Checkbox } from './Checkbox';
@@ -0,0 +1,2 @@
1
+ import { Checkbox as e } from "./Checkbox/Checkbox.js";
2
+ export { e as Checkbox };
@@ -0,0 +1,9 @@
1
+ import { Accessor, Setter } from 'solid-js';
2
+ interface CollapsibleContextValue {
3
+ open: Accessor<boolean>;
4
+ setInternalOpen: Setter<boolean>;
5
+ onOpenChange?: (open: boolean) => void;
6
+ }
7
+ export declare const CollapsibleContext: import('solid-js').Context<CollapsibleContextValue | undefined>;
8
+ export declare const useCollapsibleContext: () => CollapsibleContextValue;
9
+ export {};
@@ -0,0 +1,11 @@
1
+ import { createContext as e, useContext as t } from "solid-js";
2
+ //#region src/components/collapsible/Collapsible/Collapsible.context.ts
3
+ var n = e(), r = () => {
4
+ let e = t(n);
5
+ if (!e) throw Error("useCollapsibleContext must be used within a CollapsibleProvider");
6
+ return e;
7
+ };
8
+ //#endregion
9
+ export { n as CollapsibleContext, r as useCollapsibleContext };
10
+
11
+ //# sourceMappingURL=Collapsible.context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Collapsible.context.js","names":[],"sources":["../../../../src/components/collapsible/Collapsible/Collapsible.context.ts"],"sourcesContent":["import {\n type Accessor,\n createContext,\n type Setter,\n useContext,\n} from \"solid-js\";\n\ninterface CollapsibleContextValue {\n open: Accessor<boolean>;\n setInternalOpen: Setter<boolean>;\n onOpenChange?: (open: boolean) => void;\n}\n\nexport const CollapsibleContext = createContext<CollapsibleContextValue>();\n\nexport const useCollapsibleContext = () => {\n const ctx = useContext(CollapsibleContext);\n if (!ctx) {\n throw new Error(\n \"useCollapsibleContext must be used within a CollapsibleProvider\",\n );\n }\n return ctx;\n};\n"],"mappings":";;AAaA,IAAa,IAAqB,GAAwC,EAE7D,UAA8B;CACzC,IAAM,IAAM,EAAW,EAAmB;AAC1C,KAAI,CAAC,EACH,OAAU,MACR,kEACD;AAEH,QAAO"}
@@ -0,0 +1,2 @@
1
+ import { CollapsibleProps } from './Collapsible.types';
2
+ export declare const Collapsible: (props: CollapsibleProps) => import("solid-js").JSX.Element;
@@ -0,0 +1,33 @@
1
+ import { CollapsibleContext as e } from "./Collapsible.context.js";
2
+ import { createComponent as t, insert as n, mergeProps as r, spread as i, template as a } from "solid-js/web";
3
+ import { createMemo as o, createSignal as s, splitProps as c } from "solid-js";
4
+ //#region src/components/collapsible/Collapsible/Collapsible.tsx
5
+ var l = /* @__PURE__ */ a("<div data-slot=collapsible>"), u = (a) => {
6
+ let [u, d] = c(a, [
7
+ "defaultOpen",
8
+ "open",
9
+ "onOpenChange",
10
+ "children"
11
+ ]), [f, p] = s(u.defaultOpen || !1), m = o(() => u.open === void 0 ? f() : u.open);
12
+ return (() => {
13
+ var a = l();
14
+ return i(a, r({ get "data-open"() {
15
+ return m();
16
+ } }, d), !1, !0), n(a, t(e.Provider, {
17
+ get value() {
18
+ return {
19
+ open: m,
20
+ setInternalOpen: p,
21
+ onOpenChange: u.onOpenChange
22
+ };
23
+ },
24
+ get children() {
25
+ return u.children;
26
+ }
27
+ })), a;
28
+ })();
29
+ };
30
+ //#endregion
31
+ export { u as Collapsible };
32
+
33
+ //# sourceMappingURL=Collapsible.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Collapsible.js","names":["createMemo","createSignal","splitProps","CollapsibleProps","CollapsibleContext","Collapsible","props","local","others","internalOpen","setInternalOpen","defaultOpen","open","undefined","_el$","_tmpl$","_$spread","_$mergeProps","data-open","_$insert","_$createComponent","Provider","value","onOpenChange","children"],"sources":["../../../../src/components/collapsible/Collapsible/Collapsible.tsx"],"sourcesContent":["import { createMemo, createSignal, splitProps } from \"solid-js\";\nimport type { CollapsibleProps } from \"./Collapsible.types\";\nimport { CollapsibleContext } from \"./Collapsible.context\";\n\nexport const Collapsible = (props: CollapsibleProps) => {\n const [local, others] = splitProps(props, [\n \"defaultOpen\",\n \"open\",\n \"onOpenChange\",\n \"children\",\n ]);\n\n const [internalOpen, setInternalOpen] = createSignal(\n local.defaultOpen || false,\n );\n\n const open = createMemo(() =>\n local.open === undefined ? internalOpen() : local.open,\n );\n\n return (\n <div data-slot=\"collapsible\" data-open={open()} {...others}>\n <CollapsibleContext.Provider\n value={{\n open,\n setInternalOpen,\n onOpenChange: local.onOpenChange,\n }}\n >\n {local.children}\n </CollapsibleContext.Provider>\n </div>\n );\n};\n"],"mappings":";;;;0DAIaK,KAAeC,MAA4B;CACtD,IAAM,CAACC,GAAOC,KAAUN,EAAWI,GAAO;EACxC;EACA;EACA;EACA;EACD,CAAC,EAEI,CAACG,GAAcC,KAAmBT,EACtCM,EAAMI,eAAe,GACtB,EAEKC,IAAOZ,QACXO,EAAMK,SAASC,KAAAA,IAAYJ,GAAc,GAAGF,EAAMK,KACnD;AAED,eAAA;EAAA,IAAAE,IAAAC,GAAA;AASqB,SATrBC,EAAAF,GAAAG,EAAA,EAAA,IAAA,cAAA;AAAA,UAC0CL,GAAM;KAAA,EAAMJ,EAAM,EAAA,IAAA,GAAA,EAAAW,EAAAL,GAAAM,EACvDhB,EAAmBiB,UAAQ;GAAA,IAC1BC,QAAK;AAAA,WAAE;KACLV;KACAF;KACAa,cAAchB,EAAMgB;KACrB;;GAAA,IAAAC,WAAA;AAAA,WAEAjB,EAAMiB;;GAAQ,CAAA,CAAA,EAAAV;KAAA"}
@@ -0,0 +1,8 @@
1
+ import { BaseProps, PolymorphicProps } from '../../../types';
2
+ interface BaseCollapsibleProps {
3
+ open?: boolean;
4
+ defaultOpen?: boolean;
5
+ onOpenChange?: (open: boolean) => void;
6
+ }
7
+ export type CollapsibleProps = PolymorphicProps<"div", BaseProps & BaseCollapsibleProps, false>;
8
+ export {};
@@ -0,0 +1,2 @@
1
+ export { Collapsible } from './Collapsible';
2
+ export { useCollapsibleContext } from './Collapsible.context';
@@ -0,0 +1,2 @@
1
+ import { CollapsibleContentProps } from './CollapsibleContent.types';
2
+ export declare const CollapsibleContent: (props: CollapsibleContentProps) => import("solid-js").JSX.Element;
@@ -0,0 +1,20 @@
1
+ import { useCollapsibleContext as e } from "../Collapsible/Collapsible.context.js";
2
+ import { createComponent as t, insert as n, spread as r, template as i } from "solid-js/web";
3
+ import { Show as a, splitProps as o } from "solid-js";
4
+ //#region src/components/collapsible/CollapsibleContent/CollapsibleContent.tsx
5
+ var s = /* @__PURE__ */ i("<div data-slot=collapsible-content>"), c = (i) => {
6
+ let { onOpenChange: c, open: l, setInternalOpen: u } = e(), [d, f] = o(i, ["children"]);
7
+ return t(a, {
8
+ get when() {
9
+ return l();
10
+ },
11
+ get children() {
12
+ var e = s();
13
+ return r(e, f, !1, !0), n(e, () => d.children), e;
14
+ }
15
+ });
16
+ };
17
+ //#endregion
18
+ export { c as CollapsibleContent };
19
+
20
+ //# sourceMappingURL=CollapsibleContent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CollapsibleContent.js","names":["Show","splitProps","CollapsibleContentProps","useCollapsibleContext","CollapsibleContent","props","onOpenChange","open","setInternalOpen","local","others","_$createComponent","when","children","_el$","_tmpl$","_$spread","_$insert"],"sources":["../../../../src/components/collapsible/CollapsibleContent/CollapsibleContent.tsx"],"sourcesContent":["import { Show, splitProps } from \"solid-js\";\nimport type { CollapsibleContentProps } from \"./CollapsibleContent.types\";\nimport { useCollapsibleContext } from \"../Collapsible\";\n\nexport const CollapsibleContent = (props: CollapsibleContentProps) => {\n const { onOpenChange, open, setInternalOpen } = useCollapsibleContext();\n\n const [local, others] = splitProps(props, [\"children\"]);\n\n return (\n <Show when={open()}>\n <div data-slot=\"collapsible-content\" {...others}>\n {local.children}\n </div>\n </Show>\n );\n};\n"],"mappings":";;;;kEAIaI,KAAsBC,MAAmC;CACpE,IAAM,EAAEC,iBAAcC,SAAMC,uBAAoBL,GAAuB,EAEjE,CAACM,GAAOC,KAAUT,EAAWI,GAAO,CAAC,WAAW,CAAC;AAEvD,QAAAM,EACGX,GAAI;EAAA,IAACY,OAAI;AAAA,UAAEL,GAAM;;EAAA,IAAAM,WAAA;GAAA,IAAAC,IAAAC,GAAA;AAEC,UAFDC,EAAAF,GACyBJ,GAAM,IAAA,GAAA,EAAAO,EAAAH,SAC5CL,EAAMI,SAAQ,EAAAC;;EAAA,CAAA"}
@@ -0,0 +1,2 @@
1
+ import { BaseProps, PolymorphicProps } from '../../../types';
2
+ export type CollapsibleContentProps = PolymorphicProps<"div", BaseProps, false>;
@@ -0,0 +1 @@
1
+ export { CollapsibleContent } from './CollapsibleContent';
@@ -0,0 +1,2 @@
1
+ import { CollapsibleTriggerProps } from './CollapsibleTrigger.types';
2
+ export declare const CollapsibleTrigger: (props: CollapsibleTriggerProps) => import("solid-js").JSX.Element;
@@ -0,0 +1,24 @@
1
+ import { Button as e } from "../../button/Button.js";
2
+ import { useCollapsibleContext as t } from "../Collapsible/Collapsible.context.js";
3
+ import { createComponent as n, mergeProps as r } from "solid-js/web";
4
+ //#region src/components/collapsible/CollapsibleTrigger/CollapsibleTrigger.tsx
5
+ var i = (i) => {
6
+ let { onOpenChange: a, open: o, setInternalOpen: s } = t();
7
+ return n(e, r({
8
+ "data-slot": "collapsible-trigger",
9
+ get "data-panel-open"() {
10
+ return o();
11
+ },
12
+ get "aria-expanded"() {
13
+ return o();
14
+ },
15
+ onClick: () => {
16
+ let e = !o();
17
+ s(e), a?.(e);
18
+ }
19
+ }, i));
20
+ };
21
+ //#endregion
22
+ export { i as CollapsibleTrigger };
23
+
24
+ //# sourceMappingURL=CollapsibleTrigger.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CollapsibleTrigger.js","names":["useCollapsibleContext","CollapsibleTriggerProps","Button","CollapsibleTrigger","props","onOpenChange","open","setInternalOpen","handleClick","next","_$createComponent","_$mergeProps","data-panel-open","aria-expanded","onClick"],"sources":["../../../../src/components/collapsible/CollapsibleTrigger/CollapsibleTrigger.tsx"],"sourcesContent":["import { useCollapsibleContext } from \"../Collapsible\";\nimport type { CollapsibleTriggerProps } from \"./CollapsibleTrigger.types\";\nimport { Button } from \"~/components/button\";\n\nexport const CollapsibleTrigger = (props: CollapsibleTriggerProps) => {\n const { onOpenChange, open, setInternalOpen } = useCollapsibleContext();\n\n const handleClick = () => {\n const next = !open();\n setInternalOpen(next);\n onOpenChange?.(next);\n };\n\n return (\n <Button\n data-slot=\"collapsible-trigger\"\n data-panel-open={open()}\n aria-expanded={open()}\n onClick={handleClick}\n {...props}\n />\n );\n};\n"],"mappings":";;;;AAIA,IAAaG,KAAsBC,MAAmC;CACpE,IAAM,EAAEC,iBAAcC,SAAMC,uBAAoBP,GAAuB;AAQvE,QAAAU,EACGR,GAAMS,EAAA;EAAA,aAAA;EAAA,IAAA,oBAAA;AAAA,UAEYL,GAAM;;EAAA,IAAA,kBAAA;AAAA,UACRA,GAAM;;EACrBQ,eAXsB;GACxB,IAAML,IAAO,CAACH,GAAM;AAEpBD,GADAE,EAAgBE,EAAK,EACrBJ,IAAeI,EAAK;;EAQE,EAChBL,EAAK,CAAA"}
@@ -0,0 +1,2 @@
1
+ import { ButtonProps } from '../../button';
2
+ export type CollapsibleTriggerProps = Omit<ButtonProps<"button">, "onClick">;
@@ -0,0 +1 @@
1
+ export { CollapsibleTrigger } from './CollapsibleTrigger';
@@ -0,0 +1,3 @@
1
+ export { Collapsible } from './Collapsible';
2
+ export { CollapsibleTrigger } from './CollapsibleTrigger';
3
+ export { CollapsibleContent } from './CollapsibleContent';
@@ -0,0 +1,4 @@
1
+ import { Collapsible as e } from "./Collapsible/Collapsible.js";
2
+ import { CollapsibleTrigger as t } from "./CollapsibleTrigger/CollapsibleTrigger.js";
3
+ import { CollapsibleContent as n } from "./CollapsibleContent/CollapsibleContent.js";
4
+ export { e as Collapsible, n as CollapsibleContent, t as CollapsibleTrigger };
@@ -8,7 +8,7 @@ var a = (a) => {
8
8
  return n(t, r({
9
9
  "data-slot": "field-label",
10
10
  get class() {
11
- return e("group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50 has-data-checked:border-neutral-900/30 has-data-checked:bg-neutral-900/5 has-[>[data-slot=field]]:rounded-lg has-[>[data-slot=field]]:border *:data-[slot=field]:p-2.5 dark:has-data-checked:border-neutral-200/20 dark:has-data-checked:bg-neutral-200/10", "has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col", o.class);
11
+ return e("group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50 has-data-[checked=true]:border-neutral-900/30 has-data-[checked=true]:bg-neutral-900/5 has-[>[data-slot=field]]:rounded-lg has-[>[data-slot=field]]:border *:data-[slot=field]:p-2.5 dark:has-data-[checked=true]:border-neutral-200/20 dark:has-data-[checked=true]:bg-neutral-200/10", "has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col", o.class);
12
12
  }
13
13
  }, s));
14
14
  };
@@ -1 +1 @@
1
- {"version":3,"file":"FieldLabel.js","names":["splitProps","clsx","FieldLabelProps","Label","FieldLabel","props","local","others","_$createComponent","_$mergeProps","class"],"sources":["../../../../src/components/field/FieldLabel/FieldLabel.tsx"],"sourcesContent":["import { splitProps } from \"solid-js\";\nimport { clsx } from \"~/utils\";\nimport type { FieldLabelProps } from \"./FieldLabel.types\";\nimport { Label } from \"~/components/label\";\n\nexport const FieldLabel = (props: FieldLabelProps) => {\n const [local, others] = splitProps(props, [\"class\", \"classList\"]);\n\n return (\n <Label\n data-slot=\"field-label\"\n class={clsx(\n \"group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50 has-data-checked:border-neutral-900/30 has-data-checked:bg-neutral-900/5 has-[>[data-slot=field]]:rounded-lg has-[>[data-slot=field]]:border *:data-[slot=field]:p-2.5 dark:has-data-checked:border-neutral-200/20 dark:has-data-checked:bg-neutral-200/10\",\n \"has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col\",\n local.class,\n )}\n {...others}\n />\n );\n};\n"],"mappings":";;;;;AAKA,IAAaI,KAAcC,MAA2B;CACpD,IAAM,CAACC,GAAOC,KAAUP,EAAWK,GAAO,CAAC,SAAS,YAAY,CAAC;AAEjE,QAAAG,EACGL,GAAKM,EAAA;EAAA,aAAA;EAAA,IAAA,QAAA;AAAA,UAEGR,EACL,2WACA,qEACAK,EAAMI,MACP;;EAAA,EACGH,EAAM,CAAA"}
1
+ {"version":3,"file":"FieldLabel.js","names":["splitProps","clsx","FieldLabelProps","Label","FieldLabel","props","local","others","_$createComponent","_$mergeProps","class"],"sources":["../../../../src/components/field/FieldLabel/FieldLabel.tsx"],"sourcesContent":["import { splitProps } from \"solid-js\";\nimport { clsx } from \"~/utils\";\nimport type { FieldLabelProps } from \"./FieldLabel.types\";\nimport { Label } from \"~/components/label\";\n\nexport const FieldLabel = (props: FieldLabelProps) => {\n const [local, others] = splitProps(props, [\"class\", \"classList\"]);\n\n return (\n <Label\n data-slot=\"field-label\"\n class={clsx(\n \"group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50 has-data-[checked=true]:border-neutral-900/30 has-data-[checked=true]:bg-neutral-900/5 has-[>[data-slot=field]]:rounded-lg has-[>[data-slot=field]]:border *:data-[slot=field]:p-2.5 dark:has-data-[checked=true]:border-neutral-200/20 dark:has-data-[checked=true]:bg-neutral-200/10\",\n \"has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col\",\n local.class,\n )}\n {...others}\n />\n );\n};\n"],"mappings":";;;;;AAKA,IAAaI,KAAcC,MAA2B;CACpD,IAAM,CAACC,GAAOC,KAAUP,EAAWK,GAAO,CAAC,SAAS,YAAY,CAAC;AAEjE,QAAAG,EACGL,GAAKM,EAAA;EAAA,aAAA;EAAA,IAAA,QAAA;AAAA,UAEGR,EACL,uYACA,qEACAK,EAAMI,MACP;;EAAA,EACGH,EAAM,CAAA"}
@@ -1,33 +1,42 @@
1
1
  import { clsx as e } from "../../utils/clsx.js";
2
2
  import { delegateEvents as t, mergeProps as n, spread as r, template as i } from "solid-js/web";
3
- import { createUniqueId as a, mergeProps as o, splitProps as s } from "solid-js";
3
+ import { createMemo as a, createUniqueId as o, mergeProps as s, splitProps as c } from "solid-js";
4
4
  //#region src/components/input/Input.tsx
5
- var c = /* @__PURE__ */ i("<input data-slot=input>"), l = (t) => {
6
- let [i, l] = s(o({
7
- id: a(),
5
+ var l = /* @__PURE__ */ i("<input data-slot=input>"), u = (t) => {
6
+ let [i, u] = c(s({
7
+ id: o(),
8
8
  type: "text"
9
9
  }, t), [
10
+ "value",
11
+ "defaultValue",
10
12
  "type",
11
13
  "onInput",
12
14
  "onChange",
13
- "class",
14
- "classList"
15
- ]), u = (e) => {
15
+ "class"
16
+ ]), d = (e) => {
16
17
  let t = e.target.value;
17
18
  i.type === "number" && (t = Number(e.target.value)), i.onInput?.(t);
18
- }, d = (e) => {
19
+ }, f = (e) => {
19
20
  let t = e.target.value;
20
21
  i.type === "number" && (t = Number(e.target.value)), i.onChange?.(t);
21
- };
22
+ }, p = a(() => i.value === void 0 ? i.defaultValue : i.value);
22
23
  return (() => {
23
- var t = c();
24
- return t.addEventListener("change", d), t.$$input = u, r(t, n({ get class() {
25
- return e("h-8 w-full min-w-0 rounded-lg border border-neutral-200 dark:border-white/15 bg-transparent px-2.5 py-1 text-base transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-neutral-950 dark:file:text-neutral-50 placeholder:text-neutral-500 dark:placeholder:text-neutral-400 focus-visible:border-neutral-400 dark:focus-visible:border-neutral-500 focus-visible:ring-3 focus-visible:ring-neutral-400/50 dark:focus-visible:ring-neutral-500/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:select-none disabled:bg-neutral-200/50 disabled:opacity-50 aria-invalid:border-red-600 aria-invalid:ring-3 aria-invalid:ring-red-600/20 md:text-sm dark:bg-white/4.5 dark:disabled:bg-white/12 dark:aria-invalid:border-red-400/50 dark:aria-invalid:ring-red-400/40", i.class);
26
- } }, l), !1, !1), t;
24
+ var t = l();
25
+ return t.addEventListener("change", f), t.$$input = d, r(t, n({
26
+ get type() {
27
+ return i.type;
28
+ },
29
+ get value() {
30
+ return p();
31
+ },
32
+ get class() {
33
+ return e("h-8 w-full min-w-0 rounded-lg border border-neutral-200 dark:border-white/15 bg-transparent px-2.5 py-1 text-base transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-neutral-950 dark:file:text-neutral-50 placeholder:text-neutral-500 dark:placeholder:text-neutral-400 focus-visible:border-neutral-400 dark:focus-visible:border-neutral-500 focus-visible:ring-3 focus-visible:ring-neutral-400/50 dark:focus-visible:ring-neutral-500/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:select-none disabled:bg-neutral-200/50 disabled:opacity-50 aria-invalid:border-red-600 aria-invalid:ring-3 aria-invalid:ring-red-600/20 md:text-sm dark:bg-white/4.5 dark:disabled:bg-white/12 dark:aria-invalid:border-red-400/50 dark:aria-invalid:ring-red-400/40", i.class);
34
+ }
35
+ }, u), !1, !1), t;
27
36
  })();
28
37
  };
29
38
  t(["input"]);
30
39
  //#endregion
31
- export { l as Input };
40
+ export { u as Input };
32
41
 
33
42
  //# sourceMappingURL=Input.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Input.js","names":["createUniqueId","JSX","mergeProps","splitProps","InputProps","clsx","Input","props","merged","id","type","const","local","others","handleInput","IntrinsicElements","e","value","target","Number","onInput","handleChange","onChange","_el$","_tmpl$","addEventListener","$$input","_$spread","_$mergeProps","class","_$delegateEvents"],"sources":["../../../src/components/input/Input.tsx"],"sourcesContent":["import { createUniqueId, type JSX, mergeProps, splitProps } from \"solid-js\";\nimport type { InputProps } from \"./Input.types\";\nimport { clsx } from \"~/utils\";\n\nexport const Input = (props: InputProps) => {\n const merged = mergeProps(\n { id: createUniqueId(), type: \"text\" } as const,\n props,\n );\n\n const [local, others] = splitProps(merged, [\n \"type\",\n \"onInput\",\n \"onChange\",\n \"class\",\n \"classList\",\n ]);\n\n const handleInput: JSX.IntrinsicElements[\"input\"][\"onInput\"] = (e) => {\n let value: string | number = e.target.value;\n if (local.type === \"number\") {\n value = Number(e.target.value);\n }\n // @ts-expect-error\n local.onInput?.(value);\n };\n\n const handleChange: JSX.IntrinsicElements[\"input\"][\"onChange\"] = (e) => {\n let value: string | number = e.target.value;\n if (local.type === \"number\") {\n value = Number(e.target.value);\n }\n // @ts-expect-error\n local.onChange?.(value);\n };\n\n return (\n <input\n data-slot=\"input\"\n class={clsx(\n \"h-8 w-full min-w-0 rounded-lg border border-neutral-200 dark:border-white/15 bg-transparent px-2.5 py-1 text-base transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-neutral-950 dark:file:text-neutral-50 placeholder:text-neutral-500 dark:placeholder:text-neutral-400 focus-visible:border-neutral-400 dark:focus-visible:border-neutral-500 focus-visible:ring-3 focus-visible:ring-neutral-400/50 dark:focus-visible:ring-neutral-500/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:select-none disabled:bg-neutral-200/50 disabled:opacity-50 aria-invalid:border-red-600 aria-invalid:ring-3 aria-invalid:ring-red-600/20 md:text-sm dark:bg-white/4.5 dark:disabled:bg-white/12 dark:aria-invalid:border-red-400/50 dark:aria-invalid:ring-red-400/40\",\n local.class,\n )}\n onInput={handleInput}\n onChange={handleChange}\n {...others}\n />\n );\n};\n"],"mappings":";;;;sDAIaM,KAASC,MAAsB;CAM1C,IAAM,CAACK,GAAOC,KAAUV,EALTD,EACb;EAAEO,IAAIT,GAAgB;EAAEU,MAAM;EAAQ,EACtCH,EACD,EAE0C;EACzC;EACA;EACA;EACA;EACA;EACD,CAAC,EAEIO,KAA0DE,MAAM;EACpE,IAAIC,IAAyBD,EAAEE,OAAOD;AAKtCL,EAJIA,EAAMF,SAAS,aACjBO,IAAQE,OAAOH,EAAEE,OAAOD,MAAM,GAGhCL,EAAMQ,UAAUH,EAAM;IAGlBI,KAA4DL,MAAM;EACtE,IAAIC,IAAyBD,EAAEE,OAAOD;AAKtCL,EAJIA,EAAMF,SAAS,aACjBO,IAAQE,OAAOH,EAAEE,OAAOD,MAAM,GAGhCL,EAAMU,WAAWL,EAAM;;AAGzB,eAAA;EAAA,IAAAM,IAAAC,GAAA;AASc,SATdD,EAAAE,iBAAA,UAQcJ,EAAY,EAAAE,EAAAG,UADbZ,GAAWa,EAAAJ,GAAAK,EAAA,EAAA,IAAA,QAAA;AAAA,UAJbvB,EACL,y0BACAO,EAAMiB,MACP;KAAA,EAGGhB,EAAM,EAAA,IAAA,GAAA,EAAAU;KAAA;;AAGdO,EAAA,CAAA,QAAA,CAAA"}
1
+ {"version":3,"file":"Input.js","names":["createMemo","createUniqueId","JSX","mergeProps","splitProps","InputProps","clsx","Input","props","merged","id","type","const","local","others","handleInput","IntrinsicElements","e","value","target","Number","onInput","handleChange","onChange","undefined","defaultValue","_el$","_tmpl$","addEventListener","$$input","_$spread","_$mergeProps","class","_$delegateEvents"],"sources":["../../../src/components/input/Input.tsx"],"sourcesContent":["import {\n createMemo,\n createUniqueId,\n type JSX,\n mergeProps,\n splitProps,\n} from \"solid-js\";\nimport type { InputProps } from \"./Input.types\";\nimport { clsx } from \"~/utils\";\n\nexport const Input = (props: InputProps) => {\n const merged = mergeProps(\n { id: createUniqueId(), type: \"text\" } as const,\n props,\n );\n\n const [local, others] = splitProps(merged, [\n \"value\",\n \"defaultValue\",\n \"type\",\n \"onInput\",\n \"onChange\",\n \"class\",\n ]);\n\n const handleInput: JSX.IntrinsicElements[\"input\"][\"onInput\"] = (e) => {\n let value: string | number = e.target.value;\n if (local.type === \"number\") {\n value = Number(e.target.value);\n }\n // @ts-expect-error\n local.onInput?.(value);\n };\n\n const handleChange: JSX.IntrinsicElements[\"input\"][\"onChange\"] = (e) => {\n let value: string | number = e.target.value;\n if (local.type === \"number\") {\n value = Number(e.target.value);\n }\n // @ts-expect-error\n local.onChange?.(value);\n };\n\n const value = createMemo(() =>\n local.value !== undefined ? local.value : local.defaultValue,\n );\n\n return (\n <input\n type={local.type}\n value={value()}\n data-slot=\"input\"\n class={clsx(\n \"h-8 w-full min-w-0 rounded-lg border border-neutral-200 dark:border-white/15 bg-transparent px-2.5 py-1 text-base transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-neutral-950 dark:file:text-neutral-50 placeholder:text-neutral-500 dark:placeholder:text-neutral-400 focus-visible:border-neutral-400 dark:focus-visible:border-neutral-500 focus-visible:ring-3 focus-visible:ring-neutral-400/50 dark:focus-visible:ring-neutral-500/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:select-none disabled:bg-neutral-200/50 disabled:opacity-50 aria-invalid:border-red-600 aria-invalid:ring-3 aria-invalid:ring-red-600/20 md:text-sm dark:bg-white/4.5 dark:disabled:bg-white/12 dark:aria-invalid:border-red-400/50 dark:aria-invalid:ring-red-400/40\",\n local.class,\n )}\n onInput={handleInput}\n onChange={handleChange}\n {...others}\n />\n );\n};\n"],"mappings":";;;;sDAUaO,KAASC,MAAsB;CAM1C,IAAM,CAACK,GAAOC,KAAUV,EALTD,EACb;EAAEO,IAAIT,GAAgB;EAAEU,MAAM;EAAQ,EACtCH,EACD,EAE0C;EACzC;EACA;EACA;EACA;EACA;EACA;EACD,CAAC,EAEIO,KAA0DE,MAAM;EACpE,IAAIC,IAAyBD,EAAEE,OAAOD;AAKtCL,EAJIA,EAAMF,SAAS,aACjBO,IAAQE,OAAOH,EAAEE,OAAOD,MAAM,GAGhCL,EAAMQ,UAAUH,EAAM;IAGlBI,KAA4DL,MAAM;EACtE,IAAIC,IAAyBD,EAAEE,OAAOD;AAKtCL,EAJIA,EAAMF,SAAS,aACjBO,IAAQE,OAAOH,EAAEE,OAAOD,MAAM,GAGhCL,EAAMU,WAAWL,EAAM;IAGnBA,IAAQlB,QACZa,EAAMK,UAAUM,KAAAA,IAA0BX,EAAMY,eAApBZ,EAAMK,MACnC;AAED,eAAA;EAAA,IAAAQ,IAAAC,GAAA;AAWc,SAXdD,EAAAE,iBAAA,UAUcN,EAAY,EAAAI,EAAAG,UADbd,GAAWe,EAAAJ,GAAAK,EAAA;GAAA,IAPpBpB,OAAI;AAAA,WAAEE,EAAMF;;GAAI,IAChBO,QAAK;AAAA,WAAEA,GAAO;;GAAA,IAAA,QAAA;AAAA,WAEPZ,EACL,y0BACAO,EAAMmB,MACP;;GAAA,EAGGlB,EAAM,EAAA,IAAA,GAAA,EAAAY;KAAA;;AAGdO,EAAA,CAAA,QAAA,CAAA"}
@@ -5,11 +5,13 @@ export interface NumberInputSpecifics {
5
5
  type: "number";
6
6
  onChange?: (value: number) => void;
7
7
  onInput?: (value: number) => void;
8
+ defaultValue?: number;
8
9
  }
9
10
  interface TextInputSpecifics {
10
11
  type?: Exclude<InputType, "number">;
11
12
  onChange?: (value: string) => void;
12
13
  onInput?: (value: string) => void;
14
+ defaultValue?: string;
13
15
  }
14
16
  export type InputProps = (NumberInputSpecifics & Omit<NativeInputProps, keyof NumberInputSpecifics>) | (TextInputSpecifics & Omit<NativeInputProps, keyof TextInputSpecifics>);
15
17
  export {};
@@ -1,17 +1,39 @@
1
1
  import { clsx as e } from "../../utils/clsx.js";
2
- import { mergeProps as t, spread as n, template as r } from "solid-js/web";
3
- import { splitProps as i } from "solid-js";
2
+ import { delegateEvents as t, mergeProps as n, spread as r, template as i, use as a } from "solid-js/web";
3
+ import { splitProps as o } from "solid-js";
4
4
  //#region src/components/label/Label.tsx
5
- var a = /* @__PURE__ */ r("<label data-slot=label>"), o = (r) => {
6
- let [o, s] = i(r, ["class", "classList"]);
5
+ var s = /* @__PURE__ */ i("<label data-slot=label>"), c = (t) => {
6
+ let i, [c, l] = o(t, [
7
+ "for",
8
+ "class",
9
+ "classList"
10
+ ]), u = (e) => {
11
+ let t = c.for;
12
+ if (t) {
13
+ let e = document.querySelector(`[aria-labelledby="${t}"]`);
14
+ if (!e) return;
15
+ e.click();
16
+ return;
17
+ }
18
+ let n = i?.querySelector("[aria-labelledby]");
19
+ n && !n.contains(e.target) && (e.preventDefault(), n.click());
20
+ };
7
21
  return (() => {
8
- var r = a();
9
- return n(r, t({ get class() {
10
- return e("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50", o.class);
11
- } }, s), !1, !1), r;
22
+ var t = s();
23
+ t.$$click = u;
24
+ var o = i;
25
+ return typeof o == "function" ? a(o, t) : i = t, r(t, n({
26
+ get for() {
27
+ return c.for;
28
+ },
29
+ get class() {
30
+ return e("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50", c.class);
31
+ }
32
+ }, l), !1, !1), t;
12
33
  })();
13
34
  };
35
+ t(["click"]);
14
36
  //#endregion
15
- export { o as Label };
37
+ export { c as Label };
16
38
 
17
39
  //# sourceMappingURL=Label.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Label.js","names":["splitProps","LabelProps","clsx","Label","props","local","others","_el$","_tmpl$","_$spread","_$mergeProps","class"],"sources":["../../../src/components/label/Label.tsx"],"sourcesContent":["import { splitProps } from \"solid-js\";\nimport type { LabelProps } from \"./Label.types\";\nimport { clsx } from \"~/utils\";\n\nexport const Label = (props: LabelProps) => {\n const [local, others] = splitProps(props, [\"class\", \"classList\"]);\n\n return (\n // biome-ignore lint/a11y/noLabelWithoutControl: ignore\n <label\n data-slot=\"label\"\n class={clsx(\n \"flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50\",\n local.class,\n )}\n {...others}\n />\n );\n};\n"],"mappings":";;;;sDAIaG,KAASC,MAAsB;CAC1C,IAAM,CAACC,GAAOC,KAAUN,EAAWI,GAAO,CAAC,SAAS,YAAY,CAAC;AAEjE,eACE;EAAA,IAAAG,IAAAC,GAAA;AAOY,SAPZC,EAAAF,GAAAG,EAAA,EAAA,IAAA,QAAA;AAAA,UAGSR,EACL,uNACAG,EAAMM,MACP;KAAA,EACGL,EAAM,EAAA,IAAA,GAAA,EAAAC;KAAA"}
1
+ {"version":3,"file":"Label.js","names":["splitProps","LabelProps","clsx","Label","props","ref","HTMLLabelElement","local","others","handleClick","e","MouseEvent","htmlFor","for","target","document","querySelector","HTMLElement","click","contains","Node","preventDefault","_el$","_tmpl$","$$click","_ref$","_$use","_$spread","_$mergeProps","class","_$delegateEvents"],"sources":["../../../src/components/label/Label.tsx"],"sourcesContent":["import { splitProps } from \"solid-js\";\nimport type { LabelProps } from \"./Label.types\";\nimport { clsx } from \"~/utils\";\n\nexport const Label = (props: LabelProps) => {\n let ref: HTMLLabelElement | undefined;\n const [local, others] = splitProps(props, [\"for\", \"class\", \"classList\"]);\n\n const handleClick = (e: MouseEvent) => {\n // 兄弟元素用 for 查找\n const htmlFor = local.for;\n if (htmlFor) {\n const target = document.querySelector<HTMLElement>(\n `[aria-labelledby=\"${htmlFor}\"]`,\n );\n if (!target) return;\n target.click();\n return;\n }\n\n // 子元素直接查询有 `aria-labelledby` 属性\n const target = ref?.querySelector<HTMLElement>(\"[aria-labelledby]\");\n if (target && !target.contains(e.target as Node)) {\n e.preventDefault(); // 阻止 label 原生的自动点击转发\n target.click(); // 手动触发一次\n }\n };\n\n return (\n // biome-ignore lint/a11y/noLabelWithoutControl: ignore\n <label\n ref={ref}\n for={local.for}\n data-slot=\"label\"\n class={clsx(\n \"flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50\",\n local.class,\n )}\n onClick={handleClick}\n {...others}\n />\n );\n};\n"],"mappings":";;;;sDAIaG,KAASC,MAAsB;CAC1C,IAAIC,GACE,CAACE,GAAOC,KAAUR,EAAWI,GAAO;EAAC;EAAO;EAAS;EAAY,CAAC,EAElEK,KAAeC,MAAkB;EAErC,IAAME,IAAUL,EAAMM;AACtB,MAAID,GAAS;GACX,IAAME,IAASC,SAASC,cACtB,qBAAqBJ,EAAO,IAC7B;AACD,OAAI,CAACE,EAAQ;AACbA,KAAOI,OAAO;AACd;;EAIF,IAAMJ,IAAST,GAAKW,cAA2B,oBAAoB;AACnE,EAAIF,KAAU,CAACA,EAAOK,SAAST,EAAEI,OAAe,KAC9CJ,EAAEW,gBAAgB,EAClBP,EAAOI,OAAO;;AAIlB,eACE;EAAA,IAAAI,IAAAC,GAAA;AAAAD,IAAAE,UASWf;EAAW,IAAAgB,IAPfpB;AAQK,SARF,OAAAoB,KAAA,aAAAC,EAAAD,GAAAH,EAAA,GAAHjB,IAAGiB,GAAAK,EAAAL,GAAAM,EAAA;GAAA,IAAA,MAAA;AAAA,WACHrB,EAAMM;;GAAG,IAAA,QAAA;AAAA,WAEPX,EACL,uNACAK,EAAMsB,MACP;;GAAA,EAEGrB,EAAM,EAAA,IAAA,GAAA,EAAAc;KAAA;;AAGdQ,EAAA,CAAA,QAAA,CAAA"}
package/dist/index.d.ts CHANGED
@@ -4,10 +4,13 @@ export * from './components/alert-dialog';
4
4
  export * from './components/aspect-ratio';
5
5
  export * from './components/avatar';
6
6
  export * from './components/badge';
7
+ export * from './components/breadcrumb';
7
8
  export * from './components/button';
8
9
  export * from './components/button-group';
9
10
  export * from './components/card';
10
11
  export * from './components/carousel';
12
+ export * from './components/checkbox';
13
+ export * from './components/collapsible';
11
14
  export * from './components/field';
12
15
  export * from './components/image';
13
16
  export * from './components/input';