@adea-ai/ui 0.85.0 → 0.88.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.
Files changed (239) hide show
  1. package/README.md +17 -1
  2. package/dist/NOTICE +34 -0
  3. package/dist/components/composites/action-button/action-button.d.ts.map +1 -1
  4. package/dist/components/composites/action-button/action-button.js +2 -2
  5. package/dist/components/composites/action-button/action-button.js.map +1 -1
  6. package/dist/components/composites/list-row/list-row.d.ts +6 -3
  7. package/dist/components/composites/list-row/list-row.d.ts.map +1 -1
  8. package/dist/components/composites/list-row/list-row.js +69 -7
  9. package/dist/components/composites/list-row/list-row.js.map +1 -1
  10. package/dist/components/composites/settings/settings.d.ts +9 -11
  11. package/dist/components/composites/settings/settings.d.ts.map +1 -1
  12. package/dist/components/composites/settings/settings.js +48 -33
  13. package/dist/components/composites/settings/settings.js.map +1 -1
  14. package/dist/components/conversation/message-composer.js +1 -1
  15. package/dist/components/conversation/scroll-follow.d.ts.map +1 -1
  16. package/dist/components/conversation/scroll-follow.js +95 -15
  17. package/dist/components/conversation/scroll-follow.js.map +1 -1
  18. package/dist/components/layout/app-shell/index.d.ts +1 -0
  19. package/dist/components/layout/app-shell/index.d.ts.map +1 -1
  20. package/dist/components/layout/app-shell/index.js +2 -1
  21. package/dist/components/layout/app-shell/skip-link.d.ts +11 -0
  22. package/dist/components/layout/app-shell/skip-link.d.ts.map +1 -0
  23. package/dist/components/layout/app-shell/skip-link.js +44 -0
  24. package/dist/components/layout/app-shell/skip-link.js.map +1 -0
  25. package/dist/components/layout/floating-preview/floating-preview.d.ts +12 -0
  26. package/dist/components/layout/floating-preview/floating-preview.d.ts.map +1 -0
  27. package/dist/components/layout/floating-preview/floating-preview.js +283 -0
  28. package/dist/components/layout/floating-preview/floating-preview.js.map +1 -0
  29. package/dist/components/layout/floating-preview/index.d.ts +3 -0
  30. package/dist/components/layout/floating-preview/index.d.ts.map +1 -0
  31. package/dist/components/layout/floating-preview/index.js +3 -0
  32. package/dist/components/layout/floating-preview/model.d.ts +74 -0
  33. package/dist/components/layout/floating-preview/model.d.ts.map +1 -0
  34. package/dist/components/layout/floating-preview/model.js +146 -0
  35. package/dist/components/layout/floating-preview/model.js.map +1 -0
  36. package/dist/components/layout/sidebar-nav/index.d.ts +1 -1
  37. package/dist/components/layout/sidebar-nav/index.d.ts.map +1 -1
  38. package/dist/components/layout/sidebar-nav/sidebar-nav.d.ts +18 -2
  39. package/dist/components/layout/sidebar-nav/sidebar-nav.d.ts.map +1 -1
  40. package/dist/components/layout/sidebar-nav/sidebar-nav.js +42 -11
  41. package/dist/components/layout/sidebar-nav/sidebar-nav.js.map +1 -1
  42. package/dist/components/theme/index.d.ts +1 -0
  43. package/dist/components/theme/index.d.ts.map +1 -1
  44. package/dist/components/theme/index.js +2 -1
  45. package/dist/components/theme/theme-mode-toggle.d.ts +10 -0
  46. package/dist/components/theme/theme-mode-toggle.d.ts.map +1 -0
  47. package/dist/components/theme/theme-mode-toggle.js +82 -0
  48. package/dist/components/theme/theme-mode-toggle.js.map +1 -0
  49. package/dist/components/ui/checkbox/checkbox.d.ts +2 -0
  50. package/dist/components/ui/checkbox/checkbox.d.ts.map +1 -1
  51. package/dist/components/ui/checkbox/checkbox.js +24 -3
  52. package/dist/components/ui/checkbox/checkbox.js.map +1 -1
  53. package/dist/components/ui/combobox/combobox.d.ts.map +1 -1
  54. package/dist/components/ui/combobox/combobox.js +41 -4
  55. package/dist/components/ui/combobox/combobox.js.map +1 -1
  56. package/dist/components/ui/combobox/index.d.ts +1 -0
  57. package/dist/components/ui/combobox/index.d.ts.map +1 -1
  58. package/dist/components/ui/combobox/index.js +2 -1
  59. package/dist/components/ui/combobox/value-combobox.d.ts +19 -0
  60. package/dist/components/ui/combobox/value-combobox.d.ts.map +1 -0
  61. package/dist/components/ui/combobox/value-combobox.js +42 -0
  62. package/dist/components/ui/combobox/value-combobox.js.map +1 -0
  63. package/dist/components/ui/empty/empty-state.d.ts +15 -0
  64. package/dist/components/ui/empty/empty-state.d.ts.map +1 -0
  65. package/dist/components/ui/empty/empty-state.js +96 -0
  66. package/dist/components/ui/empty/empty-state.js.map +1 -0
  67. package/dist/components/ui/empty/index.d.ts +1 -0
  68. package/dist/components/ui/empty/index.d.ts.map +1 -1
  69. package/dist/components/ui/empty/index.js +2 -1
  70. package/dist/components/ui/entity-icon/entity-icon.d.ts +4 -1
  71. package/dist/components/ui/entity-icon/entity-icon.d.ts.map +1 -1
  72. package/dist/components/ui/entity-icon/entity-icon.js +37 -13
  73. package/dist/components/ui/entity-icon/entity-icon.js.map +1 -1
  74. package/dist/components/ui/field/field.d.ts +36 -13
  75. package/dist/components/ui/field/field.d.ts.map +1 -1
  76. package/dist/components/ui/field/field.js +146 -24
  77. package/dist/components/ui/field/field.js.map +1 -1
  78. package/dist/components/ui/field/index.d.ts +3 -1
  79. package/dist/components/ui/field/index.d.ts.map +1 -1
  80. package/dist/components/ui/field/index.js +3 -2
  81. package/dist/components/ui/field/number-field.d.ts +19 -0
  82. package/dist/components/ui/field/number-field.d.ts.map +1 -0
  83. package/dist/components/ui/field/number-field.js +76 -0
  84. package/dist/components/ui/field/number-field.js.map +1 -0
  85. package/dist/components/ui/input/index.d.ts +1 -0
  86. package/dist/components/ui/input/index.d.ts.map +1 -1
  87. package/dist/components/ui/input/index.js +2 -1
  88. package/dist/components/ui/input/input-control.d.ts +11 -0
  89. package/dist/components/ui/input/input-control.d.ts.map +1 -0
  90. package/dist/components/ui/input/input-control.js +24 -0
  91. package/dist/components/ui/input/input-control.js.map +1 -0
  92. package/dist/components/ui/input/input.d.ts.map +1 -1
  93. package/dist/components/ui/input/input.js +56 -28
  94. package/dist/components/ui/input/input.js.map +1 -1
  95. package/dist/components/ui/input-group/index.d.ts +1 -0
  96. package/dist/components/ui/input-group/index.d.ts.map +1 -1
  97. package/dist/components/ui/input-group/index.js +2 -1
  98. package/dist/components/ui/input-group/input-group.d.ts.map +1 -1
  99. package/dist/components/ui/input-group/input-group.js +42 -5
  100. package/dist/components/ui/input-group/input-group.js.map +1 -1
  101. package/dist/components/ui/input-group/secret-input-group.d.ts +11 -0
  102. package/dist/components/ui/input-group/secret-input-group.d.ts.map +1 -0
  103. package/dist/components/ui/input-group/secret-input-group.js +67 -0
  104. package/dist/components/ui/input-group/secret-input-group.js.map +1 -0
  105. package/dist/components/ui/native-select/native-select.d.ts.map +1 -1
  106. package/dist/components/ui/native-select/native-select.js +39 -4
  107. package/dist/components/ui/native-select/native-select.js.map +1 -1
  108. package/dist/components/ui/progress/progress.d.ts.map +1 -1
  109. package/dist/components/ui/progress/progress.js +30 -18
  110. package/dist/components/ui/progress/progress.js.map +1 -1
  111. package/dist/components/ui/radio-group/radio-group.d.ts.map +1 -1
  112. package/dist/components/ui/radio-group/radio-group.js +41 -4
  113. package/dist/components/ui/radio-group/radio-group.js.map +1 -1
  114. package/dist/components/ui/switch/switch.d.ts +2 -0
  115. package/dist/components/ui/switch/switch.d.ts.map +1 -1
  116. package/dist/components/ui/switch/switch.js +24 -3
  117. package/dist/components/ui/switch/switch.js.map +1 -1
  118. package/dist/components/ui/tabs/tabs.js +1 -1
  119. package/dist/components/ui/tabs/tabs.js.map +1 -1
  120. package/dist/components/ui/text-link/index.d.ts +2 -0
  121. package/dist/components/ui/text-link/index.d.ts.map +1 -0
  122. package/dist/components/ui/text-link/index.js +2 -0
  123. package/dist/components/ui/text-link/text-link.d.ts +9 -0
  124. package/dist/components/ui/text-link/text-link.d.ts.map +1 -0
  125. package/dist/components/ui/text-link/text-link.js +30 -0
  126. package/dist/components/ui/text-link/text-link.js.map +1 -0
  127. package/dist/components/ui/textarea/textarea.d.ts.map +1 -1
  128. package/dist/components/ui/textarea/textarea.js +41 -4
  129. package/dist/components/ui/textarea/textarea.js.map +1 -1
  130. package/dist/index.d.ts +3 -0
  131. package/dist/index.d.ts.map +1 -1
  132. package/dist/index.js +18 -7
  133. package/dist/lib/clipboard.d.ts +3 -0
  134. package/dist/lib/clipboard.d.ts.map +1 -0
  135. package/dist/lib/clipboard.js +35 -0
  136. package/dist/lib/clipboard.js.map +1 -0
  137. package/dist/lib/download.d.ts +3 -0
  138. package/dist/lib/download.d.ts.map +1 -0
  139. package/dist/lib/download.js +31 -0
  140. package/dist/lib/download.js.map +1 -0
  141. package/dist/lib/form-field.d.ts +37 -0
  142. package/dist/lib/form-field.d.ts.map +1 -0
  143. package/dist/lib/form-field.js +47 -0
  144. package/dist/lib/form-field.js.map +1 -0
  145. package/dist/r/app-shell.json +5 -0
  146. package/dist/r/combobox.json +5 -0
  147. package/dist/r/empty.json +10 -1
  148. package/dist/r/field.json +7 -0
  149. package/dist/r/floating-preview.json +30 -0
  150. package/dist/r/input-group.json +6 -0
  151. package/dist/r/input.json +5 -0
  152. package/dist/r/lib.json +15 -0
  153. package/dist/r/list-row.json +1 -0
  154. package/dist/r/registry.json +112 -1
  155. package/dist/r/src/components/composites/action-button/action-button.tsx +5 -1
  156. package/dist/r/src/components/composites/list-row/list-row.tsx +81 -8
  157. package/dist/r/src/components/composites/settings/settings.tsx +67 -37
  158. package/dist/r/src/components/conversation/scroll-follow.ts +109 -15
  159. package/dist/r/src/components/layout/app-shell/index.ts +1 -0
  160. package/dist/r/src/components/layout/app-shell/skip-link.tsx +35 -0
  161. package/dist/r/src/components/layout/floating-preview/floating-preview.tsx +260 -0
  162. package/dist/r/src/components/layout/floating-preview/index.ts +2 -0
  163. package/dist/r/src/components/layout/floating-preview/model.ts +285 -0
  164. package/dist/r/src/components/layout/sidebar-nav/index.ts +2 -0
  165. package/dist/r/src/components/layout/sidebar-nav/sidebar-nav.tsx +71 -16
  166. package/dist/r/src/components/theme/index.ts +1 -0
  167. package/dist/r/src/components/theme/theme-mode-toggle.tsx +56 -0
  168. package/dist/r/src/components/ui/checkbox/checkbox.tsx +20 -3
  169. package/dist/r/src/components/ui/combobox/combobox.tsx +24 -1
  170. package/dist/r/src/components/ui/combobox/index.ts +1 -0
  171. package/dist/r/src/components/ui/combobox/value-combobox.tsx +38 -0
  172. package/dist/r/src/components/ui/empty/empty-state.tsx +71 -0
  173. package/dist/r/src/components/ui/empty/index.ts +1 -0
  174. package/dist/r/src/components/ui/entity-icon/entity-icon.tsx +33 -2
  175. package/dist/r/src/components/ui/field/field.tsx +102 -5
  176. package/dist/r/src/components/ui/field/index.ts +5 -0
  177. package/dist/r/src/components/ui/field/number-field.tsx +71 -0
  178. package/dist/r/src/components/ui/input/index.ts +1 -0
  179. package/dist/r/src/components/ui/input/input-control.tsx +38 -0
  180. package/dist/r/src/components/ui/input/input.tsx +32 -20
  181. package/dist/r/src/components/ui/input-group/index.ts +1 -0
  182. package/dist/r/src/components/ui/input-group/input-group.tsx +25 -2
  183. package/dist/r/src/components/ui/input-group/secret-input-group.tsx +58 -0
  184. package/dist/r/src/components/ui/native-select/native-select.tsx +27 -1
  185. package/dist/r/src/components/ui/progress/progress.tsx +12 -8
  186. package/dist/r/src/components/ui/radio-group/radio-group.tsx +30 -2
  187. package/dist/r/src/components/ui/switch/switch.tsx +20 -3
  188. package/dist/r/src/components/ui/tabs/tabs.tsx +1 -1
  189. package/dist/r/src/components/ui/text-link/index.ts +2 -0
  190. package/dist/r/src/components/ui/text-link/text-link.tsx +28 -0
  191. package/dist/r/src/components/ui/textarea/textarea.tsx +24 -1
  192. package/dist/r/src/lib/clipboard.ts +41 -0
  193. package/dist/r/src/lib/download.ts +29 -0
  194. package/dist/r/src/lib/form-field.ts +93 -0
  195. package/dist/r/text-link.json +22 -0
  196. package/dist/r/theming.json +6 -0
  197. package/package.json +1 -1
  198. package/registry.json +112 -1
  199. package/src/components/composites/action-button/action-button.tsx +5 -1
  200. package/src/components/composites/list-row/list-row.tsx +81 -8
  201. package/src/components/composites/settings/settings.tsx +67 -37
  202. package/src/components/conversation/scroll-follow.ts +109 -15
  203. package/src/components/layout/app-shell/index.ts +1 -0
  204. package/src/components/layout/app-shell/skip-link.tsx +35 -0
  205. package/src/components/layout/floating-preview/floating-preview.tsx +260 -0
  206. package/src/components/layout/floating-preview/index.ts +2 -0
  207. package/src/components/layout/floating-preview/model.ts +285 -0
  208. package/src/components/layout/sidebar-nav/index.ts +2 -0
  209. package/src/components/layout/sidebar-nav/sidebar-nav.tsx +71 -16
  210. package/src/components/theme/index.ts +1 -0
  211. package/src/components/theme/theme-mode-toggle.tsx +56 -0
  212. package/src/components/ui/checkbox/checkbox.tsx +20 -3
  213. package/src/components/ui/combobox/combobox.tsx +24 -1
  214. package/src/components/ui/combobox/index.ts +1 -0
  215. package/src/components/ui/combobox/value-combobox.tsx +38 -0
  216. package/src/components/ui/empty/empty-state.tsx +71 -0
  217. package/src/components/ui/empty/index.ts +1 -0
  218. package/src/components/ui/entity-icon/entity-icon.tsx +33 -2
  219. package/src/components/ui/field/field.tsx +102 -5
  220. package/src/components/ui/field/index.ts +5 -0
  221. package/src/components/ui/field/number-field.tsx +71 -0
  222. package/src/components/ui/input/index.ts +1 -0
  223. package/src/components/ui/input/input-control.tsx +38 -0
  224. package/src/components/ui/input/input.tsx +32 -20
  225. package/src/components/ui/input-group/index.ts +1 -0
  226. package/src/components/ui/input-group/input-group.tsx +25 -2
  227. package/src/components/ui/input-group/secret-input-group.tsx +58 -0
  228. package/src/components/ui/native-select/native-select.tsx +27 -1
  229. package/src/components/ui/progress/progress.tsx +12 -8
  230. package/src/components/ui/radio-group/radio-group.tsx +30 -2
  231. package/src/components/ui/switch/switch.tsx +20 -3
  232. package/src/components/ui/tabs/tabs.tsx +1 -1
  233. package/src/components/ui/text-link/index.ts +2 -0
  234. package/src/components/ui/text-link/text-link.tsx +28 -0
  235. package/src/components/ui/textarea/textarea.tsx +24 -1
  236. package/src/index.ts +3 -0
  237. package/src/lib/clipboard.ts +41 -0
  238. package/src/lib/download.ts +29 -0
  239. package/src/lib/form-field.ts +93 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"number-field.js","names":["createEffect","createSignal","JSX","FormField","Input","NumberFieldProps","label","hint","value","min","max","integer","onChange","class","onBlur","EventHandler","HTMLInputElement","FocusEvent","NumberField","props","draft","setDraft","String","error","setError","validate","raw","next","Number","isFinite","isInteger","_$createComponent","children","type","step","required","onInput","event","currentTarget","nextError","_$createComponent"],"sources":["../../../../src/components/ui/field/number-field.tsx"],"sourcesContent":["import { createEffect, createSignal, type JSX } from 'solid-js'\nimport { FormField } from './field'\nimport { Input } from '../input/input'\n\nexport type NumberFieldProps = {\n label: string\n hint?: string\n value: number\n min: number\n max: number\n integer?: boolean\n onChange: (value: number) => void\n class?: string\n onBlur?: JSX.EventHandler<HTMLInputElement, FocusEvent>\n}\n\n/**\n * A controlled numeric field that keeps an editable draft while validating\n * range and integer constraints. Invalid drafts are announced and restored\n * to the latest controlled value when focus leaves the input.\n */\nexport function NumberField(props: NumberFieldProps) {\n const [draft, setDraft] = createSignal(String(props.value))\n const [error, setError] = createSignal('')\n const integer = () => props.integer ?? true\n\n createEffect(() => {\n setDraft(String(props.value))\n })\n\n const validate = (raw: string) => {\n if (!raw) return `${props.label} is required.`\n const next = Number(raw)\n if (!Number.isFinite(next)) return `${props.label} must be a valid number.`\n if (integer() && !Number.isInteger(next)) {\n return `${props.label} must be a whole number.`\n }\n if (next < props.min || next > props.max) {\n return `${props.label} must be between ${props.min} and ${props.max}.`\n }\n return ''\n }\n\n return (\n <FormField label={props.label} hint={props.hint} error={error()} class={props.class}>\n <Input\n type=\"number\"\n value={draft()}\n min={props.min}\n max={props.max}\n step={integer() ? 1 : 'any'}\n required\n onInput={(event) => {\n const raw = event.currentTarget.value\n setDraft(raw)\n const nextError = validate(raw)\n setError(nextError)\n if (!nextError) props.onChange(Number(raw))\n }}\n onBlur={(event) => {\n const nextError = validate(draft())\n if (nextError) {\n setDraft(String(props.value))\n setError('')\n }\n props.onBlur?.(event)\n }}\n />\n </FormField>\n )\n}\n"],"mappings":";;;;;;;;;;AAqBA,SAAgBkB,YAAYC,OAAyB;CACnD,MAAM,CAACC,OAAOC,YAAYpB,aAAaqB,OAAOH,MAAMX,KAAK,CAAC;CAC1D,MAAM,CAAC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IACAZ,SAASuB,UAAU;KAEjB,IADkBZ,SAASL,MAAM,CAC7BmB,GAAW;MACblB,SAASC,OAAOH,MAAMX,KAAK,CAAC;MAC5BgB,SAAS,EAAE;KACb;KACAL,MAAML,SAASuB,KAAK;IACtB;GAAC,CAAA;EAAA;CAAA,CAAA;AAIT"}
@@ -1,2 +1,3 @@
1
1
  export { Input, type InputProps } from './input';
2
+ export { InputControl, type InputControlProps } from './input-control';
2
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/input/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,KAAK,UAAU,EAAE,MAAM,SAAS,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/input/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,KAAK,UAAU,EAAE,MAAM,SAAS,CAAA;AAChD,OAAO,EAAE,YAAY,EAAE,KAAK,iBAAiB,EAAE,MAAM,iBAAiB,CAAA"}
@@ -1,2 +1,3 @@
1
+ import { InputControl } from "./input-control.js";
1
2
  import { Input } from "./input.js";
2
- export { Input };
3
+ export { Input, InputControl };
@@ -0,0 +1,11 @@
1
+ import type { ComponentProps } from 'solid-js';
2
+ /**
3
+ * InputControl.
4
+ *
5
+ * A styled native input with no optional suggestion-list behavior. Use this
6
+ * when a consumer needs only the control; `Input` adds native datalist
7
+ * suggestions for forms that need them.
8
+ */
9
+ export type InputControlProps = ComponentProps<'input'>;
10
+ export declare function InputControl(props: InputControlProps): import("solid-js").JSX.Element;
11
+ //# sourceMappingURL=input-control.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"input-control.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/input/input-control.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAI9C;;;;;;GAMG;AACH,MAAM,MAAM,iBAAiB,GAAG,cAAc,CAAC,OAAO,CAAC,CAAA;AAEvD,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,kCAwBpD"}
@@ -0,0 +1,24 @@
1
+ import { cn } from "../../../lib/utils.js";
2
+ import { mergeProps, spread, template } from "solid-js/web";
3
+ import { splitProps } from "solid-js";
4
+ //#region src/components/ui/input/input-control.tsx
5
+ var _tmpl$ = /*#__PURE__*/ template(`<input data-slot=input>`);
6
+ function InputControl(props) {
7
+ const [local, rest] = splitProps(props, ["class", "type"]);
8
+ return (() => {
9
+ var _el$ = _tmpl$();
10
+ spread(_el$, mergeProps({
11
+ get type() {
12
+ return local.type ?? "text";
13
+ },
14
+ get ["class"]() {
15
+ return cn("h-control-md w-full min-w-0 rounded-md border border-input bg-transparent px-control-md py-1 text-sm", "transition-[color,box-shadow,border-color] ease-out outline-none", "placeholder:text-muted-foreground", "selection:bg-primary selection:text-primary-foreground", "file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground", "focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle", "aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive-subtle", "disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50", "read-only:bg-surface-hover", local.class);
16
+ }
17
+ }, rest), false, false);
18
+ return _el$;
19
+ })();
20
+ }
21
+ //#endregion
22
+ export { InputControl };
23
+
24
+ //# sourceMappingURL=input-control.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"input-control.js","names":["ComponentProps","splitProps","cn","InputControlProps","InputControl","props","local","rest","_el$","_tmpl$","_$spread","_$mergeProps","type","class","_$mergeProps"],"sources":["../../../../src/components/ui/input/input-control.tsx"],"sourcesContent":["import type { ComponentProps } from 'solid-js'\nimport { splitProps } from 'solid-js'\nimport { cn } from '#lib/utils'\n\n/**\n * InputControl.\n *\n * A styled native input with no optional suggestion-list behavior. Use this\n * when a consumer needs only the control; `Input` adds native datalist\n * suggestions for forms that need them.\n */\nexport type InputControlProps = ComponentProps<'input'>\n\nexport function InputControl(props: InputControlProps) {\n const [local, rest] = splitProps(props, ['class', 'type'])\n\n return (\n <input\n data-slot=\"input\"\n type={local.type ?? 'text'}\n class={cn(\n 'h-control-md w-full min-w-0 rounded-md border border-input bg-transparent px-control-md py-1 text-sm',\n 'transition-[color,box-shadow,border-color] ease-out outline-none',\n 'placeholder:text-muted-foreground',\n 'selection:bg-primary selection:text-primary-foreground',\n 'file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground',\n /* A pointer click on a text field is a typing affordance, so the ring\n appears where the user agent already matches :focus-visible. */\n 'focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle',\n 'aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive-subtle',\n 'disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50',\n 'read-only:bg-surface-hover',\n local.class\n )}\n {...rest}\n />\n )\n}\n"],"mappings":";;;;;AAaA,SAAgBI,aAAaC,OAA0B;CACrD,MAAM,CAACC,OAAOC,QAAQN,WAAWI,OAAO,CAAC,SAAS,MAAM,CAAC;CAEzD,cAAA;EAAA,IAAAG,OAAAC,OAAA;EAAAC,OAAAF,MAAAG,WAAA;GAAA,IAGIC,OAAI;IAAA,OAAEN,MAAMM,QAAQ;GAAM;GAAA,KAAA,WAAA;IAAA,OACnBV,GACL,wGACA,oEACA,qCACA,0DACA,kHAGA,oFACA,4FACA,gFACA,8BACAI,MAAMO,KACR;GAAC;EAAA,GACGN,IAAI,GAAA,OAAA,KAAA;EAAA,OAAAC;CAAA,EAAA,CAAA;AAGd"}
@@ -1 +1 @@
1
- {"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/input/input.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAI9C;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,UAAU,GAAG,cAAc,CAAC,OAAO,CAAC,GAAG;IACjD,gFAAgF;IAChF,WAAW,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;CAChC,CAAA;AAED,wBAAgB,KAAK,CAAC,KAAK,EAAE,UAAU,kCAoCtC"}
1
+ {"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/input/input.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAK9C;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,UAAU,GAAG,cAAc,CAAC,OAAO,CAAC,GAAG;IACjD,gFAAgF;IAChF,WAAW,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;CAChC,CAAA;AAED,wBAAgB,KAAK,CAAC,KAAK,EAAE,UAAU,kCA+CtC"}
@@ -1,51 +1,79 @@
1
- import { cn } from "../../../lib/utils.js";
2
- import { createComponent, effect, insert, memo, mergeProps, setAttribute, spread, template } from "solid-js/web";
1
+ import { useFormFieldControl } from "../../../lib/form-field.js";
2
+ import { InputControl } from "./input-control.js";
3
+ import { createComponent, effect, insert, memo, mergeProps, setAttribute, template } from "solid-js/web";
3
4
  import { For, Show, createUniqueId, splitProps } from "solid-js";
4
5
  //#region src/components/ui/input/input.tsx
5
- var _tmpl$ = /*#__PURE__*/ template(`<input data-slot=input>`);
6
- var _tmpl$2 = /*#__PURE__*/ template(`<datalist>`);
7
- var _tmpl$3 = /*#__PURE__*/ template(`<option>`);
6
+ var _tmpl$ = /*#__PURE__*/ template(`<datalist>`);
7
+ var _tmpl$2 = /*#__PURE__*/ template(`<option>`);
8
8
  function Input(props) {
9
9
  const [local, rest] = splitProps(props, [
10
10
  "class",
11
11
  "type",
12
+ "id",
12
13
  "list",
13
- "suggestions"
14
+ "suggestions",
15
+ "aria-label",
16
+ "aria-labelledby",
17
+ "aria-describedby",
18
+ "aria-invalid",
19
+ "aria-errormessage"
14
20
  ]);
21
+ const field = useFormFieldControl("control", {
22
+ id: local.id,
23
+ "aria-label": local["aria-label"],
24
+ "aria-labelledby": local["aria-labelledby"],
25
+ "aria-describedby": local["aria-describedby"],
26
+ "aria-invalid": local["aria-invalid"],
27
+ "aria-errormessage": local["aria-errormessage"]
28
+ });
15
29
  const suggestionsId = createUniqueId();
16
30
  const listId = () => local.list ?? `input-suggestions-${suggestionsId}`;
17
- return [(() => {
18
- var _el$ = _tmpl$();
19
- spread(_el$, mergeProps({
20
- get type() {
21
- return local.type ?? "text";
22
- },
23
- get list() {
24
- return memo(() => !!local.suggestions)() ? listId() : local.list;
25
- },
26
- get ["class"]() {
27
- return cn("h-control-md w-full min-w-0 rounded-md border border-input bg-transparent px-control-md py-1 text-sm", "transition-[color,box-shadow,border-color] ease-out outline-none", "placeholder:text-muted-foreground", "selection:bg-primary selection:text-primary-foreground", "file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground", "focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle", "aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive-subtle", "disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50", "read-only:bg-surface-hover", local.class);
28
- }
29
- }, rest), false, false);
30
- return _el$;
31
- })(), createComponent(Show, {
31
+ return [createComponent(InputControl, mergeProps(rest, {
32
+ get ["class"]() {
33
+ return local.class;
34
+ },
35
+ get type() {
36
+ return local.type;
37
+ },
38
+ get id() {
39
+ return field?.id ?? local.id;
40
+ },
41
+ get list() {
42
+ return memo(() => !!local.suggestions)() ? listId() : local.list;
43
+ },
44
+ get ["aria-label"]() {
45
+ return local["aria-label"];
46
+ },
47
+ get ["aria-labelledby"]() {
48
+ return field?.["aria-labelledby"] ?? local["aria-labelledby"];
49
+ },
50
+ get ["aria-describedby"]() {
51
+ return field?.["aria-describedby"] ?? local["aria-describedby"];
52
+ },
53
+ get ["aria-invalid"]() {
54
+ return field?.["aria-invalid"] ?? local["aria-invalid"];
55
+ },
56
+ get ["aria-errormessage"]() {
57
+ return field?.["aria-errormessage"] ?? local["aria-errormessage"];
58
+ }
59
+ })), createComponent(Show, {
32
60
  get when() {
33
61
  return local.suggestions;
34
62
  },
35
63
  children: (suggestions) => (() => {
36
- var _el$2 = _tmpl$2();
37
- insert(_el$2, createComponent(For, {
64
+ var _el$ = _tmpl$();
65
+ insert(_el$, createComponent(For, {
38
66
  get each() {
39
67
  return suggestions();
40
68
  },
41
69
  children: (value) => (() => {
42
- var _el$3 = _tmpl$3();
43
- _el$3.value = value;
44
- return _el$3;
70
+ var _el$2 = _tmpl$2();
71
+ _el$2.value = value;
72
+ return _el$2;
45
73
  })()
46
74
  }));
47
- effect(() => setAttribute(_el$2, "id", listId()));
48
- return _el$2;
75
+ effect(() => setAttribute(_el$, "id", listId()));
76
+ return _el$;
49
77
  })()
50
78
  })];
51
79
  }
@@ -1 +1 @@
1
- {"version":3,"file":"input.js","names":["ComponentProps","createUniqueId","For","Show","splitProps","cn","InputProps","suggestions","Input","props","local","rest","suggestionsId","listId","list","_el$","_tmpl$","_$spread","_$mergeProps","type","_$memo","class","_$createComponent","when","children","_el$2","_tmpl$2","_$insert","each","value","_el$3","_tmpl$3","_$effect","_$setAttribute","_$mergeProps","_$memo","_$createComponent","_$setAttribute"],"sources":["../../../../src/components/ui/input/input.tsx"],"sourcesContent":["import type { ComponentProps } from 'solid-js'\nimport { createUniqueId, For, Show, splitProps } from 'solid-js'\nimport { cn } from '#lib/utils'\n\n/**\n * Input.\n *\n * Deliberately a plain `<input>` rather than a Kobalte TextField part. The\n * styling contract is what a consumer needs from an input; validation,\n * description and error wiring come from `Field`, which composes this. Keeping\n * them separate is what lets an input sit inside a custom control without\n * inheriting a form's ARIA graph.\n *\n * Height comes from `h-control-md`; an input cannot be given a new height\n * without a new token, which is what keeps it aligned with Button and Select.\n */\nexport type InputProps = ComponentProps<'input'> & {\n /** Native text suggestions; custom values remain valid and submit unchanged. */\n suggestions?: readonly string[]\n}\n\nexport function Input(props: InputProps) {\n const [local, rest] = splitProps(props, ['class', 'type', 'list', 'suggestions'])\n const suggestionsId = createUniqueId()\n const listId = () => local.list ?? `input-suggestions-${suggestionsId}`\n\n return (\n <>\n <input\n data-slot=\"input\"\n type={local.type ?? 'text'}\n list={local.suggestions ? listId() : local.list}\n class={cn(\n 'h-control-md w-full min-w-0 rounded-md border border-input bg-transparent px-control-md py-1 text-sm',\n 'transition-[color,box-shadow,border-color] ease-out outline-none',\n 'placeholder:text-muted-foreground',\n 'selection:bg-primary selection:text-primary-foreground',\n 'file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground',\n /* A pointer click on a text field is a typing affordance, so the ring\n appears where the user agent already matches :focus-visible. */\n 'focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle',\n 'aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive-subtle',\n 'disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50',\n 'read-only:bg-surface-hover',\n local.class\n )}\n {...rest}\n />\n <Show when={local.suggestions}>\n {(suggestions) => (\n <datalist id={listId()}>\n <For each={suggestions()}>{(value) => <option value={value} />}</For>\n </datalist>\n )}\n </Show>\n </>\n )\n}\n"],"mappings":";;;;;;;AAqBA,SAAgBQ,MAAMC,OAAmB;CACvC,MAAM,CAACC,OAAOC,QAAQP,WAAWK,OAAO;EAAC;EAAS;EAAQ;EAAQ;CAAa,CAAC;CAChF,MAAMG,gBAAgBX,eAAe;CACrC,MAAMY,eAAeH,MAAMI,QAAQ,qBAAqBF;CAExD,OAAA,QAAA;EAAA,IAAAG,OAAAC,OAAA;EAAAC,OAAAF,MAAAG,WAAA;GAAA,IAIMC,OAAI;IAAA,OAAET,MAAMS,QAAQ;GAAM;GAAA,IAC1BL,OAAI;IAAA,OAAEM,WAAA,CAAA,CAAAV,MAAMH,WAAW,CAAA,CAAA,IAAGM,OAAO,IAAIH,MAAMI;GAAI;GAAA,KAAA,WAAA;IAAA,OACxCT,GACL,wGACA,oEACA,qCACA,0DACA,kHAGA,oFACA,4FACA,gFACA,8BACAK,MAAMW,KACR;GAAC;EAAA,GACGV,IAAI,GAAA,OAAA,KAAA;EAAA,OAAAI;CAAA,EAAA,CAAA,GAAAO,gBAETnB,MAAI;EAAA,IAACoB,OAAI;GAAA,OAAEb,MAAMH;EAAW;EAAAiB,WACzBjB,uBAAW;GAAA,IAAAkB,QAAAC,QAAA;GAAAC,OAAAF,OAAAH,gBAERpB,KAAG;IAAA,IAAC0B,OAAI;KAAA,OAAErB,YAAY;IAAC;IAAAiB,WAAIK,iBAAK;KAAA,IAAAC,QAAAC,QAAA;KAAAD,MAAAD,QAAoBA;KAAK,OAAAC;IAAA,EAAA,CAAA;GAAI,CAAA,CAAA;GAAAE,aAAAC,aAAAR,OAAA,MADlDZ,OAAO,CAAC,CAAA;GAAA,OAAAY;EAAA,EAAA,CAAA;CAGvB,CAAA,CAAA;AAIT"}
1
+ {"version":3,"file":"input.js","names":["ComponentProps","createUniqueId","For","Show","splitProps","useFormFieldControl","InputControl","InputProps","suggestions","Input","props","local","rest","field","id","suggestionsId","listId","list","_$createComponent","_$mergeProps","class","type","_$memo","aria-label","aria-labelledby","aria-describedby","aria-invalid","aria-errormessage","when","children","_el$","_tmpl$","_$insert","each","value","_el$2","_tmpl$2","_$effect","_$setAttribute","_$createComponent","_$mergeProps","_$memo","_$setAttribute"],"sources":["../../../../src/components/ui/input/input.tsx"],"sourcesContent":["import type { ComponentProps } from 'solid-js'\nimport { createUniqueId, For, Show, splitProps } from 'solid-js'\nimport { useFormFieldControl } from '#lib/form-field'\nimport { InputControl } from './input-control'\n\n/**\n * Input.\n *\n * Deliberately a plain `<input>` rather than a Kobalte TextField part. The\n * styling contract is what a consumer needs from an input; validation,\n * description and error wiring come from `Field`, which composes this. Keeping\n * them separate is what lets an input sit inside a custom control without\n * inheriting a form's ARIA graph.\n *\n * Height comes from `h-control-md`; an input cannot be given a new height\n * without a new token, which is what keeps it aligned with Button and Select.\n */\nexport type InputProps = ComponentProps<'input'> & {\n /** Native text suggestions; custom values remain valid and submit unchanged. */\n suggestions?: readonly string[]\n}\n\nexport function Input(props: InputProps) {\n const [local, rest] = splitProps(props, [\n 'class',\n 'type',\n 'id',\n 'list',\n 'suggestions',\n 'aria-label',\n 'aria-labelledby',\n 'aria-describedby',\n 'aria-invalid',\n 'aria-errormessage',\n ])\n const field = useFormFieldControl('control', {\n id: local.id,\n 'aria-label': local['aria-label'],\n 'aria-labelledby': local['aria-labelledby'],\n 'aria-describedby': local['aria-describedby'],\n 'aria-invalid': local['aria-invalid'],\n 'aria-errormessage': local['aria-errormessage'],\n })\n const suggestionsId = createUniqueId()\n const listId = () => local.list ?? `input-suggestions-${suggestionsId}`\n\n return (\n <>\n <InputControl\n {...rest}\n class={local.class}\n type={local.type}\n id={field?.id ?? local.id}\n list={local.suggestions ? listId() : local.list}\n aria-label={local['aria-label']}\n aria-labelledby={field?.['aria-labelledby'] ?? local['aria-labelledby']}\n aria-describedby={field?.['aria-describedby'] ?? local['aria-describedby']}\n aria-invalid={field?.['aria-invalid'] ?? local['aria-invalid']}\n aria-errormessage={field?.['aria-errormessage'] ?? local['aria-errormessage']}\n />\n <Show when={local.suggestions}>\n {(suggestions) => (\n <datalist id={listId()}>\n <For each={suggestions()}>{(value) => <option value={value} />}</For>\n </datalist>\n )}\n </Show>\n </>\n )\n}\n"],"mappings":";;;;;;;AAsBA,SAAgBS,MAAMC,OAAmB;CACvC,MAAM,CAACC,OAAOC,QAAQR,WAAWM,OAAO;EACtC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CAAmB,CACpB;CACD,MAAMG,QAAQR,oBAAoB,WAAW;EAC3CS,IAAIH,MAAMG;EACV,cAAcH,MAAM;EACpB,mBAAmBA,MAAM;EACzB,oBAAoBA,MAAM;EAC1B,gBAAgBA,MAAM;EACtB,qBAAqBA,MAAM;CAC7B,CAAC;CACD,MAAMI,gBAAgBd,eAAe;CACrC,MAAMe,eAAeL,MAAMM,QAAQ,qBAAqBF;CAExD,OAAA,CAAAG,gBAEKZ,cAAYa,WACPP,MAAI;EAAA,KAAA,WAAA;GAAA,OACDD,MAAMS;EAAK;EAAA,IAClBC,OAAI;GAAA,OAAEV,MAAMU;EAAI;EAAA,IAChBP,KAAE;GAAA,OAAED,OAAOC,MAAMH,MAAMG;EAAE;EAAA,IACzBG,OAAI;GAAA,OAAEK,WAAA,CAAA,CAAAX,MAAMH,WAAW,CAAA,CAAA,IAAGQ,OAAO,IAAIL,MAAMM;EAAI;EAAA,KAAA,gBAAA;GAAA,OACnCN,MAAM;EAAa;EAAA,KAAA,qBAAA;GAAA,OACdE,QAAQ,sBAAsBF,MAAM;EAAkB;EAAA,KAAA,sBAAA;GAAA,OACrDE,QAAQ,uBAAuBF,MAAM;EAAmB;EAAA,KAAA,kBAAA;GAAA,OAC5DE,QAAQ,mBAAmBF,MAAM;EAAe;EAAA,KAAA,uBAAA;GAAA,OAC3CE,QAAQ,wBAAwBF,MAAM;EAAoB;CAAA,CAAA,CAAA,GAAAO,gBAE9Ef,MAAI;EAAA,IAACyB,OAAI;GAAA,OAAEjB,MAAMH;EAAW;EAAAqB,WACzBrB,uBAAW;GAAA,IAAAsB,OAAAC,OAAA;GAAAC,OAAAF,MAAAZ,gBAERhB,KAAG;IAAA,IAAC+B,OAAI;KAAA,OAAEzB,YAAY;IAAC;IAAAqB,WAAIK,iBAAK;KAAA,IAAAC,QAAAC,QAAA;KAAAD,MAAAD,QAAoBA;KAAK,OAAAC;IAAA,EAAA,CAAA;GAAI,CAAA,CAAA;GAAAE,aAAAC,aAAAR,MAAA,MADlDd,OAAO,CAAC,CAAA;GAAA,OAAAc;EAAA,EAAA,CAAA;CAGvB,CAAA,CAAA;AAIT"}
@@ -1,2 +1,3 @@
1
1
  export { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, type InputGroupAddonProps, } from './input-group';
2
+ export { SecretInputGroup, type SecretInputGroupProps } from './secret-input-group';
2
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/input-group/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,eAAe,EACf,gBAAgB,EAChB,eAAe,EACf,cAAc,EACd,KAAK,oBAAoB,GAC1B,MAAM,eAAe,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/input-group/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,eAAe,EACf,gBAAgB,EAChB,eAAe,EACf,cAAc,EACd,KAAK,oBAAoB,GAC1B,MAAM,eAAe,CAAA;AACtB,OAAO,EAAE,gBAAgB,EAAE,KAAK,qBAAqB,EAAE,MAAM,sBAAsB,CAAA"}
@@ -1,2 +1,3 @@
1
1
  import { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText } from "./input-group.js";
2
- export { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText };
2
+ import { SecretInputGroup } from "./secret-input-group.js";
3
+ export { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, SecretInputGroup };
@@ -1 +1 @@
1
- {"version":3,"file":"input-group.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/input-group/input-group.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAInD;;;;;;;;;;;;GAYG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,cAAc,CAAC,KAAK,CAAC,eAiBtD;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,CAAC,eAe7D;AAED,MAAM,MAAM,oBAAoB,GAAG,cAAc,CAAC,MAAM,CAAC,GAAG;IAC1D,2EAA2E;IAC3E,KAAK,CAAC,EAAE,OAAO,GAAG,KAAK,CAAA;CACxB,CAAA;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,oBAAoB,eAiB1D;AAED,gEAAgE;AAChE,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,cAAc,CAAC,QAAQ,CAAC,eAoB/D;AAED,+EAA+E;AAC/E,wBAAgB,cAAc,CAAC,KAAK,EAAE,cAAc,CAAC,MAAM,CAAC,GAAG;IAAE,QAAQ,CAAC,EAAE,GAAG,CAAC,OAAO,CAAA;CAAE,eAGxF"}
1
+ {"version":3,"file":"input-group.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/input-group/input-group.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAKnD;;;;;;;;;;;;GAYG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,cAAc,CAAC,KAAK,CAAC,eAiBtD;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,CAAC,eAqC7D;AAED,MAAM,MAAM,oBAAoB,GAAG,cAAc,CAAC,MAAM,CAAC,GAAG;IAC1D,2EAA2E;IAC3E,KAAK,CAAC,EAAE,OAAO,GAAG,KAAK,CAAA;CACxB,CAAA;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,oBAAoB,eAiB1D;AAED,gEAAgE;AAChE,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,cAAc,CAAC,QAAQ,CAAC,eAoB/D;AAED,+EAA+E;AAC/E,wBAAgB,cAAc,CAAC,KAAK,EAAE,cAAc,CAAC,MAAM,CAAC,GAAG;IAAE,QAAQ,CAAC,EAAE,GAAG,CAAC,OAAO,CAAA;CAAE,eAGxF"}
@@ -1,4 +1,5 @@
1
1
  import { cn } from "../../../lib/utils.js";
2
+ import { useFormFieldControl } from "../../../lib/form-field.js";
2
3
  import { insert, mergeProps, spread, template } from "solid-js/web";
3
4
  import { splitProps } from "solid-js";
4
5
  //#region src/components/ui/input-group/input-group.tsx
@@ -25,18 +26,54 @@ function InputGroup(props) {
25
26
  return (() => {
26
27
  var _el$ = _tmpl$();
27
28
  spread(_el$, mergeProps({ get ["class"]() {
28
- return cn("border-input flex h-control-md w-full min-w-0 items-center gap-1.5 rounded-md border bg-transparent px-control-sm", "transition-[color,box-shadow,border-color] ease-out", "focus-within:border-ring focus-within:ring-3 focus-within:ring-primary-subtle", "has-[[aria-invalid=true]]:border-destructive has-[[aria-invalid=true]]:ring-3 has-[[aria-invalid=true]]:ring-destructive-subtle", "has-[input:disabled]:pointer-events-none has-[input:disabled]:cursor-not-allowed has-[input:disabled]:opacity-50", local.class);
29
+ return cn("border-input flex h-control-md w-full min-w-0 items-center gap-1.5 rounded-md border bg-transparent px-control-sm", "transition-[color,box-shadow,border-color] ease-out", "focus-within:border-ring focus-within:ring-3 focus-within:ring-primary-subtle", "has-[[aria-invalid=true]]:border-destructive has-[[aria-invalid=true]]:ring-3 has-[[aria-invalid=true]]:ring-destructive-subtle", "has-[input:disabled]:cursor-not-allowed has-[input:disabled]:opacity-50", local.class);
29
30
  } }, rest), false, false);
30
31
  return _el$;
31
32
  })();
32
33
  }
33
34
  function InputGroupInput(props) {
34
- const [local, rest] = splitProps(props, ["class"]);
35
+ const [local, rest] = splitProps(props, [
36
+ "class",
37
+ "id",
38
+ "aria-label",
39
+ "aria-labelledby",
40
+ "aria-describedby",
41
+ "aria-invalid",
42
+ "aria-errormessage"
43
+ ]);
44
+ const field = useFormFieldControl("control", {
45
+ id: local.id,
46
+ "aria-label": local["aria-label"],
47
+ "aria-labelledby": local["aria-labelledby"],
48
+ "aria-describedby": local["aria-describedby"],
49
+ "aria-invalid": local["aria-invalid"],
50
+ "aria-errormessage": local["aria-errormessage"]
51
+ });
35
52
  return (() => {
36
53
  var _el$2 = _tmpl$2();
37
- spread(_el$2, mergeProps({ get ["class"]() {
38
- return cn("h-full min-w-0 flex-1 bg-transparent text-sm outline-none", "placeholder:text-muted-foreground", "disabled:cursor-not-allowed", local.class);
39
- } }, rest), false, false);
54
+ spread(_el$2, mergeProps({
55
+ get id() {
56
+ return field?.id ?? local.id;
57
+ },
58
+ get ["aria-label"]() {
59
+ return local["aria-label"];
60
+ },
61
+ get ["aria-labelledby"]() {
62
+ return field?.["aria-labelledby"] ?? local["aria-labelledby"];
63
+ },
64
+ get ["aria-describedby"]() {
65
+ return field?.["aria-describedby"] ?? local["aria-describedby"];
66
+ },
67
+ get ["aria-invalid"]() {
68
+ return field?.["aria-invalid"] ?? local["aria-invalid"];
69
+ },
70
+ get ["aria-errormessage"]() {
71
+ return field?.["aria-errormessage"] ?? local["aria-errormessage"];
72
+ },
73
+ get ["class"]() {
74
+ return cn("h-full min-w-0 flex-1 bg-transparent text-sm outline-none", "placeholder:text-muted-foreground", "disabled:cursor-not-allowed", local.class);
75
+ }
76
+ }, rest), false, false);
40
77
  return _el$2;
41
78
  })();
42
79
  }
@@ -1 +1 @@
1
- {"version":3,"file":"input-group.js","names":["ComponentProps","JSX","splitProps","cn","InputGroup","props","local","rest","_el$","_tmpl$","_$spread","_$mergeProps","class","InputGroupInput","_el$2","_tmpl$2","InputGroupAddonProps","align","InputGroupAddon","_el$3","_tmpl$3","_$insert","children","InputGroupButton","_el$4","_tmpl$4","InputGroupText","Element","_el$5","_tmpl$5","_$mergeProps"],"sources":["../../../../src/components/ui/input-group/input-group.tsx"],"sourcesContent":["import type { ComponentProps, JSX } from 'solid-js'\nimport { splitProps } from 'solid-js'\nimport { cn } from '#lib/utils'\n\n/**\n * InputGroup.\n *\n * A field with attached chrome: a leading icon, a unit, a trailing button, a\n * clear affordance. The point of the component is that the adornments and the\n * input share *one* border and *one* focus ring, so the group reads as a single\n * control. Two separate elements side by side always drift — the ring appears\n * on the wrong box, or the border doubles where they meet.\n *\n * The focus ring therefore lives on the group and follows `focus-within`. A\n * group containing several focusable things still reads as focused once, which\n * is the correct affordance: the user is somewhere inside it.\n */\nexport function InputGroup(props: ComponentProps<'div'>) {\n const [local, rest] = splitProps(props, ['class'])\n\n return (\n <div\n data-slot=\"input-group\"\n class={cn(\n 'border-input flex h-control-md w-full min-w-0 items-center gap-1.5 rounded-md border bg-transparent px-control-sm',\n 'transition-[color,box-shadow,border-color] ease-out',\n 'focus-within:border-ring focus-within:ring-3 focus-within:ring-primary-subtle',\n 'has-[[aria-invalid=true]]:border-destructive has-[[aria-invalid=true]]:ring-3 has-[[aria-invalid=true]]:ring-destructive-subtle',\n 'has-[input:disabled]:pointer-events-none has-[input:disabled]:cursor-not-allowed has-[input:disabled]:opacity-50',\n local.class\n )}\n {...rest}\n />\n )\n}\n\nexport function InputGroupInput(props: ComponentProps<'input'>) {\n const [local, rest] = splitProps(props, ['class'])\n\n return (\n <input\n data-slot=\"input-group-input\"\n class={cn(\n 'h-full min-w-0 flex-1 bg-transparent text-sm outline-none',\n 'placeholder:text-muted-foreground',\n 'disabled:cursor-not-allowed',\n local.class\n )}\n {...rest}\n />\n )\n}\n\nexport type InputGroupAddonProps = ComponentProps<'span'> & {\n /** Which edge the adornment sits on; also sets the pointer-events rule. */\n align?: 'start' | 'end'\n}\n\n/**\n * A non-interactive adornment. `pointer-events-none` by default, because an\n * adornment that swallows a click makes the whole control feel dead just to\n * the left of the caret — the most annoying possible bug. Pass `align=\"end\"`\n * and a real element when the adornment must be clickable.\n */\nexport function InputGroupAddon(props: InputGroupAddonProps) {\n const [local, rest] = splitProps(props, ['class', 'align', 'children'])\n\n return (\n <span\n data-slot=\"input-group-addon\"\n class={cn(\n 'text-muted-foreground flex shrink-0 items-center gap-1.5 text-sm select-none',\n '[&_svg]:pointer-events-none [&_svg]:size-4',\n { 'order-first': local.align !== 'end', 'order-last': local.align === 'end' },\n local.class\n )}\n {...rest}\n >\n {local.children}\n </span>\n )\n}\n\n/** A clickable trailing button, sized to the group's height. */\nexport function InputGroupButton(props: ComponentProps<'button'>) {\n const [local, rest] = splitProps(props, ['class', 'children'])\n\n return (\n <button\n type=\"button\"\n data-slot=\"input-group-button\"\n class={cn(\n 'text-muted-foreground -me-1 flex size-6 shrink-0 items-center justify-center rounded-sm',\n 'transition-colors ease-out outline-none hover:bg-surface-hover hover:text-foreground',\n 'focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle',\n 'disabled:pointer-events-none disabled:opacity-50',\n '[&_svg]:size-3.5',\n local.class\n )}\n {...rest}\n >\n {local.children}\n </button>\n )\n}\n\n/** Text that reads as a value but is not an input, e.g. a unit or a suffix. */\nexport function InputGroupText(props: ComponentProps<'span'> & { children?: JSX.Element }) {\n const [local, rest] = splitProps(props, ['class'])\n return <span class={cn('text-muted-foreground text-sm', local.class)} {...rest} />\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAiBA,SAAgBI,WAAWC,OAA8B;CACvD,MAAM,CAACC,OAAOC,QAAQL,WAAWG,OAAO,CAAC,OAAO,CAAC;CAEjD,cAAA;EAAA,IAAAG,OAAAC,OAAA;EAAAC,OAAAF,MAAAG,WAAA,EAAA,KAAA,WAAA;GAAA,OAGWR,GACL,qHACA,uDACA,iFACA,mIACA,oHACAG,MAAMM,KACR;EAAC,EAAA,GACGL,IAAI,GAAA,OAAA,KAAA;EAAA,OAAAC;CAAA,EAAA,CAAA;AAGd;AAEA,SAAgBK,gBAAgBR,OAAgC;CAC9D,MAAM,CAACC,OAAOC,QAAQL,WAAWG,OAAO,CAAC,OAAO,CAAC;CAEjD,cAAA;EAAA,IAAAS,QAAAC,QAAA;EAAAL,OAAAI,OAAAH,WAAA,EAAA,KAAA,WAAA;GAAA,OAGWR,GACL,6DACA,qCACA,+BACAG,MAAMM,KACR;EAAC,EAAA,GACGL,IAAI,GAAA,OAAA,KAAA;EAAA,OAAAO;CAAA,EAAA,CAAA;AAGd;;;;;;;AAaA,SAAgBI,gBAAgBb,OAA6B;CAC3D,MAAM,CAACC,OAAOC,QAAQL,WAAWG,OAAO;EAAC;EAAS;EAAS;CAAU,CAAC;CAEtE,cAAA;EAAA,IAAAc,QAAAC,QAAA;EAAAV,OAAAS,OAAAR,WAAA,EAAA,KAAA,WAAA;GAAA,OAGWR,GACL,gFACA,8CACA;IAAE,eAAeG,MAAMW,UAAU;IAAO,cAAcX,MAAMW,UAAU;GAAM,GAC5EX,MAAMM,KACR;EAAC,EAAA,GACGL,IAAI,GAAA,OAAA,IAAA;EAAAc,OAAAF,aAEPb,MAAMgB,QAAQ;EAAA,OAAAH;CAAA,EAAA,CAAA;AAGrB;;AAGA,SAAgBI,iBAAiBlB,OAAiC;CAChE,MAAM,CAACC,OAAOC,QAAQL,WAAWG,OAAO,CAAC,SAAS,UAAU,CAAC;CAE7D,cAAA;EAAA,IAAAmB,QAAAC,QAAA;EAAAf,OAAAc,OAAAb,WAAA,EAAA,KAAA,WAAA;GAAA,OAIWR,GACL,2FACA,wFACA,oFACA,oDACA,oBACAG,MAAMM,KACR;EAAC,EAAA,GACGL,IAAI,GAAA,OAAA,IAAA;EAAAc,OAAAG,aAEPlB,MAAMgB,QAAQ;EAAA,OAAAE;CAAA,EAAA,CAAA;AAGrB;;AAGA,SAAgBE,eAAerB,OAA4D;CACzF,MAAM,CAACC,OAAOC,QAAQL,WAAWG,OAAO,CAAC,OAAO,CAAC;CACjD,cAAA;EAAA,IAAAuB,QAAAC,QAAA;EAAAnB,OAAAkB,OAAAjB,WAAA,EAAA,KAAA,WAAA;GAAA,OAAoBR,GAAG,iCAAiCG,MAAMM,KAAK;EAAC,EAAA,GAAML,IAAI,GAAA,OAAA,KAAA;EAAA,OAAAqB;CAAA,EAAA,CAAA;AAChF"}
1
+ {"version":3,"file":"input-group.js","names":["ComponentProps","JSX","splitProps","useFormFieldControl","cn","InputGroup","props","local","rest","_el$","_tmpl$","_$spread","_$mergeProps","class","InputGroupInput","field","id","_el$2","_tmpl$2","aria-label","aria-labelledby","aria-describedby","aria-invalid","aria-errormessage","InputGroupAddonProps","align","InputGroupAddon","_el$3","_tmpl$3","_$insert","children","InputGroupButton","_el$4","_tmpl$4","InputGroupText","Element","_el$5","_tmpl$5","_$mergeProps"],"sources":["../../../../src/components/ui/input-group/input-group.tsx"],"sourcesContent":["import type { ComponentProps, JSX } from 'solid-js'\nimport { splitProps } from 'solid-js'\nimport { useFormFieldControl } from '#lib/form-field'\nimport { cn } from '#lib/utils'\n\n/**\n * InputGroup.\n *\n * A field with attached chrome: a leading icon, a unit, a trailing button, a\n * clear affordance. The point of the component is that the adornments and the\n * input share *one* border and *one* focus ring, so the group reads as a single\n * control. Two separate elements side by side always drift — the ring appears\n * on the wrong box, or the border doubles where they meet.\n *\n * The focus ring therefore lives on the group and follows `focus-within`. A\n * group containing several focusable things still reads as focused once, which\n * is the correct affordance: the user is somewhere inside it.\n */\nexport function InputGroup(props: ComponentProps<'div'>) {\n const [local, rest] = splitProps(props, ['class'])\n\n return (\n <div\n data-slot=\"input-group\"\n class={cn(\n 'border-input flex h-control-md w-full min-w-0 items-center gap-1.5 rounded-md border bg-transparent px-control-sm',\n 'transition-[color,box-shadow,border-color] ease-out',\n 'focus-within:border-ring focus-within:ring-3 focus-within:ring-primary-subtle',\n 'has-[[aria-invalid=true]]:border-destructive has-[[aria-invalid=true]]:ring-3 has-[[aria-invalid=true]]:ring-destructive-subtle',\n 'has-[input:disabled]:cursor-not-allowed has-[input:disabled]:opacity-50',\n local.class\n )}\n {...rest}\n />\n )\n}\n\nexport function InputGroupInput(props: ComponentProps<'input'>) {\n const [local, rest] = splitProps(props, [\n 'class',\n 'id',\n 'aria-label',\n 'aria-labelledby',\n 'aria-describedby',\n 'aria-invalid',\n 'aria-errormessage',\n ])\n const field = useFormFieldControl('control', {\n id: local.id,\n 'aria-label': local['aria-label'],\n 'aria-labelledby': local['aria-labelledby'],\n 'aria-describedby': local['aria-describedby'],\n 'aria-invalid': local['aria-invalid'],\n 'aria-errormessage': local['aria-errormessage'],\n })\n\n return (\n <input\n data-slot=\"input-group-input\"\n id={field?.id ?? local.id}\n aria-label={local['aria-label']}\n aria-labelledby={field?.['aria-labelledby'] ?? local['aria-labelledby']}\n aria-describedby={field?.['aria-describedby'] ?? local['aria-describedby']}\n aria-invalid={field?.['aria-invalid'] ?? local['aria-invalid']}\n aria-errormessage={field?.['aria-errormessage'] ?? local['aria-errormessage']}\n class={cn(\n 'h-full min-w-0 flex-1 bg-transparent text-sm outline-none',\n 'placeholder:text-muted-foreground',\n 'disabled:cursor-not-allowed',\n local.class\n )}\n {...rest}\n />\n )\n}\n\nexport type InputGroupAddonProps = ComponentProps<'span'> & {\n /** Which edge the adornment sits on; also sets the pointer-events rule. */\n align?: 'start' | 'end'\n}\n\n/**\n * A non-interactive adornment. `pointer-events-none` by default, because an\n * adornment that swallows a click makes the whole control feel dead just to\n * the left of the caret — the most annoying possible bug. Pass `align=\"end\"`\n * and a real element when the adornment must be clickable.\n */\nexport function InputGroupAddon(props: InputGroupAddonProps) {\n const [local, rest] = splitProps(props, ['class', 'align', 'children'])\n\n return (\n <span\n data-slot=\"input-group-addon\"\n class={cn(\n 'text-muted-foreground flex shrink-0 items-center gap-1.5 text-sm select-none',\n '[&_svg]:pointer-events-none [&_svg]:size-4',\n { 'order-first': local.align !== 'end', 'order-last': local.align === 'end' },\n local.class\n )}\n {...rest}\n >\n {local.children}\n </span>\n )\n}\n\n/** A clickable trailing button, sized to the group's height. */\nexport function InputGroupButton(props: ComponentProps<'button'>) {\n const [local, rest] = splitProps(props, ['class', 'children'])\n\n return (\n <button\n type=\"button\"\n data-slot=\"input-group-button\"\n class={cn(\n 'text-muted-foreground -me-1 flex size-6 shrink-0 items-center justify-center rounded-sm',\n 'transition-colors ease-out outline-none hover:bg-surface-hover hover:text-foreground',\n 'focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle',\n 'disabled:pointer-events-none disabled:opacity-50',\n '[&_svg]:size-3.5',\n local.class\n )}\n {...rest}\n >\n {local.children}\n </button>\n )\n}\n\n/** Text that reads as a value but is not an input, e.g. a unit or a suffix. */\nexport function InputGroupText(props: ComponentProps<'span'> & { children?: JSX.Element }) {\n const [local, rest] = splitProps(props, ['class'])\n return <span class={cn('text-muted-foreground text-sm', local.class)} {...rest} />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 onChange: JSX.EventHandler<HTMLInputElement, Event>;
6
+ onClear?: () => void;
7
+ class?: string;
8
+ } & Pick<ComponentProps<'input'>, 'id' | 'aria-label' | 'aria-describedby' | 'aria-invalid'>;
9
+ /** A password input with an optional keyboard-accessible clear action. */
10
+ export declare function SecretInputGroup(props: SecretInputGroupProps): JSX.Element;
11
+ //# sourceMappingURL=secret-input-group.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"secret-input-group.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/input-group/secret-input-group.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA0B,KAAK,cAAc,EAAE,KAAK,GAAG,EAAE,MAAM,UAAU,CAAA;AAKhF,MAAM,MAAM,qBAAqB,GAAG;IAClC,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,OAAO,CAAA;IACjB,QAAQ,EAAE,GAAG,CAAC,YAAY,CAAC,gBAAgB,EAAE,KAAK,CAAC,CAAA;IACnD,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;IACpB,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,GAAG,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE,IAAI,GAAG,YAAY,GAAG,kBAAkB,GAAG,cAAc,CAAC,CAAA;AAE5F,0EAA0E;AAC1E,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,eA2C5D"}
@@ -0,0 +1,67 @@
1
+ import { FormFieldContext } from "../../../lib/form-field.js";
2
+ import { ActionButton } from "../../composites/action-button/action-button.js";
3
+ import { InputGroup, InputGroupInput } from "./input-group.js";
4
+ import { createComponent, mergeProps } from "solid-js/web";
5
+ import { splitProps, useContext } from "solid-js";
6
+ //#region src/components/ui/input-group/secret-input-group.tsx
7
+ /** A password input with an optional keyboard-accessible clear action. */
8
+ function SecretInputGroup(props) {
9
+ const field = useContext(FormFieldContext);
10
+ const [local, rest] = splitProps(props, [
11
+ "value",
12
+ "disabled",
13
+ "onChange",
14
+ "onClear",
15
+ "aria-label",
16
+ "class"
17
+ ]);
18
+ const input = createComponent(InputGroupInput, mergeProps(rest, {
19
+ get ["aria-label"]() {
20
+ return local["aria-label"] ?? (field ? void 0 : "New API key");
21
+ },
22
+ type: "password",
23
+ autocomplete: "new-password",
24
+ get value() {
25
+ return local.value;
26
+ },
27
+ get disabled() {
28
+ return local.disabled;
29
+ },
30
+ get onInput() {
31
+ return local.onChange;
32
+ }
33
+ }));
34
+ if (!local.onClear) return createComponent(InputGroup, {
35
+ get ["class"]() {
36
+ return local.class;
37
+ },
38
+ children: input
39
+ });
40
+ return createComponent(InputGroup, {
41
+ get ["class"]() {
42
+ return local.class;
43
+ },
44
+ get children() {
45
+ return [input, createComponent(ActionButton, {
46
+ "data-slot": "input-group-button",
47
+ variant: "ghost",
48
+ size: "xs",
49
+ "class": "-me-1 h-6 min-w-0 shrink-0 px-2",
50
+ get disabled() {
51
+ return local.disabled;
52
+ },
53
+ get tooltip() {
54
+ return local.disabled ? "This API key is managed by policy" : "Clear API key";
55
+ },
56
+ tooltipSide: "top",
57
+ "aria-label": "Clear API key",
58
+ onClick: () => local.onClear?.(),
59
+ children: "Clear"
60
+ })];
61
+ }
62
+ });
63
+ }
64
+ //#endregion
65
+ export { SecretInputGroup };
66
+
67
+ //# sourceMappingURL=secret-input-group.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"secret-input-group.js","names":["splitProps","useContext","ComponentProps","JSX","ActionButton","FormFieldContext","InputGroup","InputGroupInput","SecretInputGroupProps","value","disabled","onChange","EventHandler","HTMLInputElement","Event","onClear","class","Pick","SecretInputGroup","props","field","local","rest","input","_$createComponent","_$mergeProps","aria-label","undefined","type","autocomplete","onInput","children","variant","size","tooltip","tooltipSide","onClick","_$createComponent","_$mergeProps"],"sources":["../../../../src/components/ui/input-group/secret-input-group.tsx"],"sourcesContent":["import { splitProps, useContext, type ComponentProps, type JSX } from 'solid-js'\nimport { ActionButton } from '../../composites/action-button'\nimport { FormFieldContext } from '#lib/form-field'\nimport { InputGroup, InputGroupInput } from './input-group'\n\nexport type SecretInputGroupProps = {\n value: string\n disabled: boolean\n onChange: JSX.EventHandler<HTMLInputElement, Event>\n onClear?: () => void\n class?: string\n} & Pick<ComponentProps<'input'>, 'id' | 'aria-label' | 'aria-describedby' | 'aria-invalid'>\n\n/** A password input with an optional keyboard-accessible clear action. */\nexport function SecretInputGroup(props: SecretInputGroupProps) {\n const field = useContext(FormFieldContext)\n const [local, rest] = splitProps(props, [\n 'value',\n 'disabled',\n 'onChange',\n 'onClear',\n 'aria-label',\n 'class',\n ])\n\n const input = (\n <InputGroupInput\n {...rest}\n aria-label={local['aria-label'] ?? (field ? undefined : 'New API key')}\n type=\"password\"\n autocomplete=\"new-password\"\n value={local.value}\n disabled={local.disabled}\n onInput={local.onChange}\n />\n )\n\n if (!local.onClear) return <InputGroup class={local.class}>{input}</InputGroup>\n\n return (\n <InputGroup class={local.class}>\n {input}\n <ActionButton\n data-slot=\"input-group-button\"\n variant=\"ghost\"\n size=\"xs\"\n class=\"-me-1 h-6 min-w-0 shrink-0 px-2\"\n disabled={local.disabled}\n tooltip={local.disabled ? 'This API key is managed by policy' : 'Clear API key'}\n tooltipSide=\"top\"\n aria-label=\"Clear API key\"\n onClick={() => local.onClear?.()}\n >\n Clear\n </ActionButton>\n </InputGroup>\n )\n}\n"],"mappings":";;;;;;;AAcA,SAAgBkB,iBAAiBC,OAA8B;CAC7D,MAAMC,QAAQnB,WAAWI,gBAAgB;CACzC,MAAM,CAACgB,OAAOC,QAAQtB,WAAWmB,OAAO;EACtC;EACA;EACA;EACA;EACA;EACA;CAAO,CACR;CAED,MAAMI,QAAKC,gBACRjB,iBAAekB,WACVH,MAAI;EAAA,KAAA,gBAAA;GAAA,OACID,MAAM,kBAAkBD,QAAQO,KAAAA,IAAY;EAAc;EACtEC,MAAI;EACJC,cAAY;EAAA,IACZpB,QAAK;GAAA,OAAEY,MAAMZ;EAAK;EAAA,IAClBC,WAAQ;GAAA,OAAEW,MAAMX;EAAQ;EAAA,IACxBoB,UAAO;GAAA,OAAET,MAAMV;EAAQ;CAAA,CAAA,CAAA;CAI3B,IAAI,CAACU,MAAMN,SAAS,OAAAS,gBAAQlB,YAAU;EAAA,KAAA,WAAA;GAAA,OAAQe,MAAML;EAAK;EAAAe,UAAGR;CAAK,CAAA;CAEjE,OAAAC,gBACGlB,YAAU;EAAA,KAAA,WAAA;GAAA,OAAQe,MAAML;EAAK;EAAA,IAAAe,WAAA;GAAA,OAAA,CAC3BR,OAAKC,gBACLpB,cAAY;IAAA,aAAA;IAEX4B,SAAO;IACPC,MAAI;IAAA,SAAA;IAAA,IAEJvB,WAAQ;KAAA,OAAEW,MAAMX;IAAQ;IAAA,IACxBwB,UAAO;KAAA,OAAEb,MAAMX,WAAW,sCAAsC;IAAe;IAC/EyB,aAAW;IAAA,cAAA;IAEXC,eAAef,MAAMN,UAAU;IAACgB,UAAA;GAAA,CAAA,CAAA;EAAA;CAAA,CAAA;AAMxC"}
@@ -1 +1 @@
1
- {"version":3,"file":"native-select.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/native-select/native-select.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAI9C,MAAM,MAAM,iBAAiB,GAAG,cAAc,CAAC,QAAQ,CAAC,GAAG;IACzD,mEAAmE;IACnE,OAAO,CAAC,EAAE,SAAS,kBAAkB,EAAE,CAAA;IACvC,2EAA2E;IAC3E,YAAY,CAAC,EAAE,cAAc,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,CAAA;CACjD,CAAA;AAkCD;;;;;;;;;GASG;AACH,MAAM,MAAM,kBAAkB,GAAG,QAAQ,CAAC;IACxC,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,CAAC,CAAA;AAEF,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,kCAoDpD"}
1
+ {"version":3,"file":"native-select.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/native-select/native-select.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAK9C,MAAM,MAAM,iBAAiB,GAAG,cAAc,CAAC,QAAQ,CAAC,GAAG;IACzD,mEAAmE;IACnE,OAAO,CAAC,EAAE,SAAS,kBAAkB,EAAE,CAAA;IACvC,2EAA2E;IAC3E,YAAY,CAAC,EAAE,cAAc,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,CAAA;CACjD,CAAA;AAkCD;;;;;;;;;GASG;AACH,MAAM,MAAM,kBAAkB,GAAG,QAAQ,CAAC;IACxC,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,CAAC,CAAA;AAEF,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,kCA6EpD"}
@@ -1,4 +1,5 @@
1
1
  import { cn } from "../../../lib/utils.js";
2
+ import { useFormFieldControl } from "../../../lib/form-field.js";
2
3
  import { createComponent, effect, insert, mergeProps, spread, template, use } from "solid-js/web";
3
4
  import { ChevronDownIcon } from "lucide-solid";
4
5
  import { For, Show, createEffect, onMount, splitProps } from "solid-js";
@@ -25,8 +26,22 @@ function NativeSelect(props) {
25
26
  "class",
26
27
  "children",
27
28
  "defaultValue",
28
- "options"
29
+ "options",
30
+ "id",
31
+ "aria-label",
32
+ "aria-labelledby",
33
+ "aria-describedby",
34
+ "aria-invalid",
35
+ "aria-errormessage"
29
36
  ]);
37
+ const field = useFormFieldControl("control", {
38
+ id: local.id,
39
+ "aria-label": local["aria-label"],
40
+ "aria-labelledby": local["aria-labelledby"],
41
+ "aria-describedby": local["aria-describedby"],
42
+ "aria-invalid": local["aria-invalid"],
43
+ "aria-errormessage": local["aria-errormessage"]
44
+ });
30
45
  let select;
31
46
  createEffect(() => {
32
47
  if (!select) return;
@@ -40,9 +55,29 @@ function NativeSelect(props) {
40
55
  use((element) => {
41
56
  select = element;
42
57
  }, _el$2);
43
- spread(_el$2, mergeProps({ get ["class"]() {
44
- return cn("h-control-md min-w-0 appearance-none rounded-md border border-input bg-transparent px-control-md pr-9 text-sm", "transition-[color,box-shadow,border-color] ease-out outline-none", "focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle", "aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive-subtle", "disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 dark:bg-input/30", local.class);
45
- } }, rest), false, true);
58
+ spread(_el$2, mergeProps({
59
+ get id() {
60
+ return field?.id ?? local.id;
61
+ },
62
+ get ["aria-label"]() {
63
+ return local["aria-label"];
64
+ },
65
+ get ["aria-labelledby"]() {
66
+ return field?.["aria-labelledby"] ?? local["aria-labelledby"];
67
+ },
68
+ get ["aria-describedby"]() {
69
+ return field?.["aria-describedby"] ?? local["aria-describedby"];
70
+ },
71
+ get ["aria-invalid"]() {
72
+ return field?.["aria-invalid"] ?? local["aria-invalid"];
73
+ },
74
+ get ["aria-errormessage"]() {
75
+ return field?.["aria-errormessage"] ?? local["aria-errormessage"];
76
+ },
77
+ get ["class"]() {
78
+ return cn("h-control-md min-w-0 appearance-none rounded-md border border-input bg-transparent px-control-md pr-9 text-sm", "transition-[color,box-shadow,border-color] ease-out outline-none", "focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle", "aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive-subtle", "disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 dark:bg-input/30", local.class);
79
+ }
80
+ }, rest), false, true);
46
81
  insert(_el$2, createComponent(Show, {
47
82
  get when() {
48
83
  return local.options;
@@ -1 +1 @@
1
- {"version":3,"file":"native-select.js","names":["ChevronDownIcon","ComponentProps","createEffect","For","onMount","Show","splitProps","cn","NativeSelectProps","options","NativeSelectOption","defaultValue","setSelectedValue","select","HTMLSelectElement","value","multiple","undefined","Array","isArray","selected","Set","map","String","option","has","initializeDefaultSelection","defaultValues","defaultSelected","Readonly","label","disabled","NativeSelect","props","local","rest","Boolean","_el$","_tmpl$","_el$2","firstChild","_$use","element","_$spread","_$mergeProps","class","_$insert","_$createComponent","when","fallback","children","each","_el$3","_tmpl$2","_$effect","_$mergeProps","_$createComponent"],"sources":["../../../../src/components/ui/native-select/native-select.tsx"],"sourcesContent":["import { ChevronDownIcon } from 'lucide-solid'\nimport type { ComponentProps } from 'solid-js'\nimport { createEffect, For, onMount, Show, splitProps } from 'solid-js'\nimport { cn } from '#lib/utils'\n\nexport type NativeSelectProps = ComponentProps<'select'> & {\n /** Render the choices from data instead of raw option children. */\n options?: readonly NativeSelectOption[]\n /** Initialize an uncontrolled selection after its native options mount. */\n defaultValue?: ComponentProps<'select'>['value']\n}\n\nfunction setSelectedValue(\n select: HTMLSelectElement,\n value: ComponentProps<'select'>['value'],\n multiple: boolean\n) {\n if (value === undefined) return\n\n if (multiple && Array.isArray(value)) {\n const selected = new Set(value.map(String))\n for (const option of select.options) option.selected = selected.has(option.value)\n return\n }\n\n select.value = String(Array.isArray(value) ? (value[0] ?? '') : value)\n}\n\nfunction initializeDefaultSelection(\n select: HTMLSelectElement,\n value: ComponentProps<'select'>['value'],\n multiple: boolean\n) {\n if (value === undefined) return\n\n const defaultValues =\n multiple && Array.isArray(value)\n ? new Set(value.map(String))\n : new Set([String(Array.isArray(value) ? (value[0] ?? '') : value)])\n\n for (const option of select.options) option.defaultSelected = defaultValues.has(option.value)\n setSelectedValue(select, value, multiple)\n}\n\n/**\n * NativeSelect.\n *\n * A styled native `<select>` for compact, finite choices. Use `Select` when the\n * list needs a custom popover, typed options, or runtime filtering; this keeps\n * the browser's built-in keyboard, form, option, and label behavior.\n *\n * Translated from shadcn/ui's MIT-licensed NativeSelect wrapper to SolidJS and\n * the Adea token system; see the root NOTICE for source and attribution.\n */\nexport type NativeSelectOption = Readonly<{\n value: string\n label: string\n disabled?: boolean\n}>\n\nexport function NativeSelect(props: NativeSelectProps) {\n const [local, rest] = splitProps(props, ['class', 'children', 'defaultValue', 'options'])\n let select: HTMLSelectElement | undefined\n\n // Set selection after native options exist; setting select.value before its\n // children are mounted makes browsers fall back to the first option.\n createEffect(() => {\n if (!select) return\n setSelectedValue(select, rest.value, Boolean(rest.multiple))\n })\n onMount(() => {\n if (select && rest.value === undefined) {\n initializeDefaultSelection(select, local.defaultValue, Boolean(rest.multiple))\n }\n })\n\n return (\n <span data-slot=\"native-select-wrapper\" class=\"relative inline-flex min-w-0\">\n <select\n ref={(element) => {\n select = element\n }}\n data-slot=\"native-select\"\n class={cn(\n 'h-control-md min-w-0 appearance-none rounded-md border border-input bg-transparent px-control-md pr-9 text-sm',\n 'transition-[color,box-shadow,border-color] ease-out outline-none',\n 'focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle',\n 'aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive-subtle',\n 'disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 dark:bg-input/30',\n local.class\n )}\n {...rest}\n >\n <Show when={local.options} fallback={local.children}>\n {(options) => (\n <For each={options()}>\n {(option) => (\n <option value={option.value} disabled={option.disabled}>\n {option.label}\n </option>\n )}\n </For>\n )}\n </Show>\n </select>\n <ChevronDownIcon\n data-slot=\"native-select-icon\"\n aria-hidden=\"true\"\n class=\"pointer-events-none absolute end-2 top-1/2 size-4 -translate-y-1/2 text-muted-foreground\"\n />\n </span>\n )\n}\n"],"mappings":";;;;;;;AAYA,SAASY,iBACPC,QACAE,OACAC,UACA;CACA,IAAID,UAAUE,KAAAA,GAAW;CAEzB,IAAID,YAAYE,MAAMC,QAAQJ,KAAK,GAAG;EACpC,MAAMK,WAAW,IAAIC,IAAIN,MAAMO,IAAIC,MAAM,CAAC;EAC1C,KAAK,MAAMC,UAAUX,OAAOJ,SAASe,OAAOJ,WAAWA,SAASK,IAAID,OAAOT,KAAK;EAChF;CACF;CAE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;GAAO;GAAA,IAAEwC,WAAQ;IAAA,OAAEf,MAAMgB;GAAQ;GAAAA,WAC/CzC,YAAOsC,gBACN5C,KAAG;IAAA,IAACgD,OAAI;KAAA,OAAE1C,QAAQ;IAAC;IAAAyC,WAChB1B,kBAAM;KAAA,IAAA4B,QAAAC,QAAA;KAAAP,OAAAM,aAEH5B,OAAOM,KAAK;KAAAwB,aAAAF,MAAArB,WADwBP,OAAOO,QAAQ;KAAAuB,aAAAF,MAAArC,QAAvCS,OAAOT,KAAK;KAAA,OAAAqC;IAAA,EAAA,CAAA;GAG5B,CAAA;EAEJ,CAAA,CAAA;EAAAN,OAAAT,MAAAU,gBAGJ/C,iBAAe;GAAA,aAAA;GAAA,eAAA;GAAA,SAAA;EAAA,CAAA,GAAA,IAAA;EAAA,OAAAqC;CAAA,EAAA,CAAA;AAOtB"}
1
+ {"version":3,"file":"native-select.js","names":["ChevronDownIcon","ComponentProps","createEffect","For","onMount","Show","splitProps","useFormFieldControl","cn","NativeSelectProps","options","NativeSelectOption","defaultValue","setSelectedValue","select","HTMLSelectElement","value","multiple","undefined","Array","isArray","selected","Set","map","String","option","has","initializeDefaultSelection","defaultValues","defaultSelected","Readonly","label","disabled","NativeSelect","props","local","rest","field","id","Boolean","_el$","_tmpl$","_el$2","firstChild","_$use","element","_$spread","_$mergeProps","aria-label","aria-labelledby","aria-describedby","aria-invalid","aria-errormessage","class","_$insert","_$createComponent","when","fallback","children","each","_el$3","_tmpl$2","_$effect","_$mergeProps","_$createComponent"],"sources":["../../../../src/components/ui/native-select/native-select.tsx"],"sourcesContent":["import { ChevronDownIcon } from 'lucide-solid'\nimport type { ComponentProps } from 'solid-js'\nimport { createEffect, For, onMount, Show, splitProps } from 'solid-js'\nimport { useFormFieldControl } from '#lib/form-field'\nimport { cn } from '#lib/utils'\n\nexport type NativeSelectProps = ComponentProps<'select'> & {\n /** Render the choices from data instead of raw option children. */\n options?: readonly NativeSelectOption[]\n /** Initialize an uncontrolled selection after its native options mount. */\n defaultValue?: ComponentProps<'select'>['value']\n}\n\nfunction setSelectedValue(\n select: HTMLSelectElement,\n value: ComponentProps<'select'>['value'],\n multiple: boolean\n) {\n if (value === undefined) return\n\n if (multiple && Array.isArray(value)) {\n const selected = new Set(value.map(String))\n for (const option of select.options) option.selected = selected.has(option.value)\n return\n }\n\n select.value = String(Array.isArray(value) ? (value[0] ?? '') : value)\n}\n\nfunction initializeDefaultSelection(\n select: HTMLSelectElement,\n value: ComponentProps<'select'>['value'],\n multiple: boolean\n) {\n if (value === undefined) return\n\n const defaultValues =\n multiple && Array.isArray(value)\n ? new Set(value.map(String))\n : new Set([String(Array.isArray(value) ? (value[0] ?? '') : value)])\n\n for (const option of select.options) option.defaultSelected = defaultValues.has(option.value)\n setSelectedValue(select, value, multiple)\n}\n\n/**\n * NativeSelect.\n *\n * A styled native `<select>` for compact, finite choices. Use `Select` when the\n * list needs a custom popover, typed options, or runtime filtering; this keeps\n * the browser's built-in keyboard, form, option, and label behavior.\n *\n * Translated from shadcn/ui's MIT-licensed NativeSelect wrapper to SolidJS and\n * the Adea token system; see the root NOTICE for source and attribution.\n */\nexport type NativeSelectOption = Readonly<{\n value: string\n label: string\n disabled?: boolean\n}>\n\nexport function NativeSelect(props: NativeSelectProps) {\n const [local, rest] = splitProps(props, [\n 'class',\n 'children',\n 'defaultValue',\n 'options',\n 'id',\n 'aria-label',\n 'aria-labelledby',\n 'aria-describedby',\n 'aria-invalid',\n 'aria-errormessage',\n ])\n const field = useFormFieldControl('control', {\n id: local.id,\n 'aria-label': local['aria-label'],\n 'aria-labelledby': local['aria-labelledby'],\n 'aria-describedby': local['aria-describedby'],\n 'aria-invalid': local['aria-invalid'],\n 'aria-errormessage': local['aria-errormessage'],\n })\n let select: HTMLSelectElement | undefined\n\n // Set selection after native options exist; setting select.value before its\n // children are mounted makes browsers fall back to the first option.\n createEffect(() => {\n if (!select) return\n setSelectedValue(select, rest.value, Boolean(rest.multiple))\n })\n onMount(() => {\n if (select && rest.value === undefined) {\n initializeDefaultSelection(select, local.defaultValue, Boolean(rest.multiple))\n }\n })\n\n return (\n <span data-slot=\"native-select-wrapper\" class=\"relative inline-flex min-w-0\">\n <select\n ref={(element) => {\n select = element\n }}\n data-slot=\"native-select\"\n id={field?.id ?? local.id}\n aria-label={local['aria-label']}\n aria-labelledby={field?.['aria-labelledby'] ?? local['aria-labelledby']}\n aria-describedby={field?.['aria-describedby'] ?? local['aria-describedby']}\n aria-invalid={field?.['aria-invalid'] ?? local['aria-invalid']}\n aria-errormessage={field?.['aria-errormessage'] ?? local['aria-errormessage']}\n class={cn(\n 'h-control-md min-w-0 appearance-none rounded-md border border-input bg-transparent px-control-md pr-9 text-sm',\n 'transition-[color,box-shadow,border-color] ease-out outline-none',\n 'focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle',\n 'aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive-subtle',\n 'disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 dark:bg-input/30',\n local.class\n )}\n {...rest}\n >\n <Show when={local.options} fallback={local.children}>\n {(options) => (\n <For each={options()}>\n {(option) => (\n <option value={option.value} disabled={option.disabled}>\n {option.label}\n </option>\n )}\n </For>\n )}\n </Show>\n </select>\n <ChevronDownIcon\n data-slot=\"native-select-icon\"\n aria-hidden=\"true\"\n class=\"pointer-events-none absolute end-2 top-1/2 size-4 -translate-y-1/2 text-muted-foreground\"\n />\n </span>\n )\n}\n"],"mappings":";;;;;;;;AAaA,SAASa,iBACPC,QACAE,OACAC,UACA;CACA,IAAID,UAAUE,KAAAA,GAAW;CAEzB,IAAID,YAAYE,MAAMC,QAAQJ,KAAK,GAAG;EACpC,MAAMK,WAAW,IAAIC,IAAIN,MAAMO,IAAIC,MAAM,CAAC;EAC1C,KAAK,MAAMC,UAAUX,OAAOJ,SAASe,OAAOJ,WAAWA,SAASK,IAAID,OAAOT,KAAK;EAChF;CACF;CAEAF,OAAOE,QAAQQ,OAAOL,MAAMC,QAA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E,cAAc,EAAE,MAAM,UAAU,CAAA;AAI9C;;;;;;;;;;GAUG;AACH,MAAM,MAAM,aAAa,GAAG,cAAc,CAAC,OAAO,eAAe,CAAC,GAAG;IACnE;;;;;;OAMG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,qEAAqE;IACrE,SAAS,CAAC,EAAE,OAAO,CAAA;CACpB,CAAA;AAED,wBAAgB,QAAQ,CAAC,KAAK,EAAE,aAAa,kCAmC5C"}
1
+ {"version":3,"file":"progress.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/progress/progress.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,IAAI,eAAe,EAAE,MAAM,wBAAwB,CAAA;AACpE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAI9C;;;;;;;;;;GAUG;AACH,MAAM,MAAM,aAAa,GAAG,cAAc,CAAC,OAAO,eAAe,CAAC,GAAG;IACnE;;;;;;OAMG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,qEAAqE;IACrE,SAAS,CAAC,EAAE,OAAO,CAAA;CACpB,CAAA;AAED,wBAAgB,QAAQ,CAAC,KAAK,EAAE,aAAa,kCAuC5C"}