@panneau/ui 5.0.0-alpha.6 → 5.0.0-alpha.8

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 (234) hide show
  1. package/README.md +24 -1
  2. package/dist/alert/Alert.d.ts +2 -2
  3. package/dist/alert/Alert.js +108 -40
  4. package/dist/alert/Alert.js.map +1 -1
  5. package/dist/alert/tokens.d.ts +1 -1
  6. package/dist/alert/tokens.js.map +1 -1
  7. package/dist/badge/Badge.d.ts +1 -1
  8. package/dist/badge/Badge.js +34 -6
  9. package/dist/badge/Badge.js.map +1 -1
  10. package/dist/badge/tokens.d.ts +1 -1
  11. package/dist/badge/tokens.js.map +1 -1
  12. package/dist/button/Button.d.ts +3 -3
  13. package/dist/button/Button.js +111 -17
  14. package/dist/button/Button.js.map +1 -1
  15. package/dist/button/tokens.d.ts +1 -1
  16. package/dist/button/tokens.js.map +1 -1
  17. package/dist/card/Card.js +76 -23
  18. package/dist/card/Card.js.map +1 -1
  19. package/dist/card/tokens.d.ts +1 -1
  20. package/dist/card/tokens.js.map +1 -1
  21. package/dist/checkbox/Checkbox.d.ts +1 -1
  22. package/dist/checkbox/Checkbox.js +86 -25
  23. package/dist/checkbox/Checkbox.js.map +1 -1
  24. package/dist/checkbox/ChoiceChrome.js +82 -21
  25. package/dist/checkbox/ChoiceChrome.js.map +1 -1
  26. package/dist/checkbox/tokens.d.ts +1 -1
  27. package/dist/checkbox/tokens.js.map +1 -1
  28. package/dist/combo-box/ComboBox.d.ts +1 -1
  29. package/dist/combo-box/ComboBox.js +291 -79
  30. package/dist/combo-box/ComboBox.js.map +1 -1
  31. package/dist/command-palette/CommandPalette.d.ts +1 -1
  32. package/dist/command-palette/CommandPalette.js +463 -160
  33. package/dist/command-palette/CommandPalette.js.map +1 -1
  34. package/dist/command-palette/match.d.ts +1 -1
  35. package/dist/command-palette/match.js.map +1 -1
  36. package/dist/command-palette/tokens.d.ts +1 -1
  37. package/dist/command-palette/tokens.js.map +1 -1
  38. package/dist/command-palette/useCommandShortcut.js +31 -12
  39. package/dist/command-palette/useCommandShortcut.js.map +1 -1
  40. package/dist/container/Container.js +48 -5
  41. package/dist/container/Container.js.map +1 -1
  42. package/dist/container/tokens.d.ts +1 -1
  43. package/dist/container/tokens.js.map +1 -1
  44. package/dist/date-picker/DatePicker.d.ts +1 -1
  45. package/dist/date-picker/DatePicker.js +234 -73
  46. package/dist/date-picker/DatePicker.js.map +1 -1
  47. package/dist/date-picker/calendarTokens.d.ts +1 -1
  48. package/dist/date-picker/calendarTokens.js.map +1 -1
  49. package/dist/dialog/Dialog.js +161 -45
  50. package/dist/dialog/Dialog.js.map +1 -1
  51. package/dist/dialog/tokens.d.ts +1 -1
  52. package/dist/dialog/tokens.js.map +1 -1
  53. package/dist/disclosure/Disclosure.js +132 -28
  54. package/dist/disclosure/Disclosure.js.map +1 -1
  55. package/dist/disclosure/tokens.d.ts +1 -1
  56. package/dist/disclosure/tokens.js.map +1 -1
  57. package/dist/divider/Divider.js +55 -11
  58. package/dist/divider/Divider.js.map +1 -1
  59. package/dist/divider/tokens.d.ts +1 -1
  60. package/dist/divider/tokens.js.map +1 -1
  61. package/dist/field/FieldParts.d.ts +1 -1
  62. package/dist/field/FieldParts.js +69 -15
  63. package/dist/field/FieldParts.js.map +1 -1
  64. package/dist/field/Fieldset.js +99 -32
  65. package/dist/field/Fieldset.js.map +1 -1
  66. package/dist/field/inputTokens.d.ts +1 -1
  67. package/dist/field/inputTokens.js.map +1 -1
  68. package/dist/field/tokens.d.ts +1 -1
  69. package/dist/field/tokens.js.map +1 -1
  70. package/dist/grid/Grid.d.ts +1 -1
  71. package/dist/grid/Grid.js +123 -14
  72. package/dist/grid/Grid.js.map +1 -1
  73. package/dist/grid/tokens.d.ts +1 -1
  74. package/dist/grid/tokens.js.map +1 -1
  75. package/dist/heading/Heading.js +41 -6
  76. package/dist/heading/Heading.js.map +1 -1
  77. package/dist/heading/tokens.d.ts +1 -1
  78. package/dist/heading/tokens.js.map +1 -1
  79. package/dist/icon/Icon.js +36 -11
  80. package/dist/icon/Icon.js.map +1 -1
  81. package/dist/icon/lucideIconLoader.d.ts +1 -1
  82. package/dist/icon/lucideIconLoader.js.map +1 -1
  83. package/dist/icon/namedIcons.d.ts +1 -1
  84. package/dist/icon/namedIcons.js +87 -26
  85. package/dist/icon/namedIcons.js.map +1 -1
  86. package/dist/icon-button/IconButton.d.ts +2 -2
  87. package/dist/icon-button/IconButton.js +70 -13
  88. package/dist/icon-button/IconButton.js.map +1 -1
  89. package/dist/index.d.ts +61 -59
  90. package/dist/index.d.ts.map +1 -1
  91. package/dist/index.js +3 -1
  92. package/dist/inline/Inline.d.ts +1 -1
  93. package/dist/inline/Inline.js +65 -7
  94. package/dist/inline/Inline.js.map +1 -1
  95. package/dist/inline/tokens.d.ts +1 -1
  96. package/dist/inline/tokens.js.map +1 -1
  97. package/dist/intl/usePanneauIntl.js.map +1 -1
  98. package/dist/layout/responsive.js.map +1 -1
  99. package/dist/locales/index.js.map +1 -1
  100. package/dist/menu/Menu.d.ts +1 -1
  101. package/dist/menu/Menu.js +170 -44
  102. package/dist/menu/Menu.js.map +1 -1
  103. package/dist/menu/tokens.d.ts +1 -1
  104. package/dist/menu/tokens.js.map +1 -1
  105. package/dist/named-icons/index.d.ts +1 -1
  106. package/dist/number-input/NumberInput.d.ts +1 -1
  107. package/dist/number-input/NumberInput.js +232 -60
  108. package/dist/number-input/NumberInput.js.map +1 -1
  109. package/dist/number-input/tokens.d.ts +1 -1
  110. package/dist/number-input/tokens.js.map +1 -1
  111. package/dist/pill-trigger/PillTrigger.js +76 -20
  112. package/dist/pill-trigger/PillTrigger.js.map +1 -1
  113. package/dist/pill-trigger/tokens.d.ts +1 -1
  114. package/dist/pill-trigger/tokens.js.map +1 -1
  115. package/dist/popover/Popover.js +109 -18
  116. package/dist/popover/Popover.js.map +1 -1
  117. package/dist/popover/tokens.d.ts +1 -1
  118. package/dist/popover/tokens.js.map +1 -1
  119. package/dist/prose/Prose.js +36 -5
  120. package/dist/prose/Prose.js.map +1 -1
  121. package/dist/prose/tokens.d.ts +1 -1
  122. package/dist/prose/tokens.js.map +1 -1
  123. package/dist/radio-group/RadioGroup.d.ts +2 -2
  124. package/dist/radio-group/RadioGroup.js +211 -61
  125. package/dist/radio-group/RadioGroup.js.map +1 -1
  126. package/dist/radio-group/tokens.d.ts +1 -1
  127. package/dist/radio-group/tokens.js.map +1 -1
  128. package/dist/root/PanneauRoot.d.ts +9 -3
  129. package/dist/root/PanneauRoot.d.ts.map +1 -1
  130. package/dist/root/PanneauRoot.js +212 -49
  131. package/dist/root/PanneauRoot.js.map +1 -1
  132. package/dist/root/ThemeScope.d.ts +1 -1
  133. package/dist/root/ThemeScope.js +107 -26
  134. package/dist/root/ThemeScope.js.map +1 -1
  135. package/dist/segmented-control/SegmentedControl.d.ts +1 -1
  136. package/dist/segmented-control/SegmentedControl.js +120 -22
  137. package/dist/segmented-control/SegmentedControl.js.map +1 -1
  138. package/dist/segmented-control/tokens.d.ts +1 -1
  139. package/dist/segmented-control/tokens.js.map +1 -1
  140. package/dist/select/Select.d.ts +1 -1
  141. package/dist/select/Select.js +298 -92
  142. package/dist/select/Select.js.map +1 -1
  143. package/dist/select/listBoxTokens.d.ts +1 -1
  144. package/dist/select/listBoxTokens.js.map +1 -1
  145. package/dist/skeleton/LoadingRegion.d.ts +16 -0
  146. package/dist/skeleton/LoadingRegion.d.ts.map +1 -0
  147. package/dist/skeleton/LoadingRegion.js +65 -0
  148. package/dist/skeleton/LoadingRegion.js.map +1 -0
  149. package/dist/skeleton/Skeleton.css +62 -0
  150. package/dist/skeleton/Skeleton.d.ts +25 -0
  151. package/dist/skeleton/Skeleton.d.ts.map +1 -0
  152. package/dist/skeleton/Skeleton.js +106 -0
  153. package/dist/skeleton/Skeleton.js.map +1 -0
  154. package/dist/skeleton/Skeleton.module.js +22 -0
  155. package/dist/skeleton/Skeleton.module.js.map +1 -0
  156. package/dist/skeleton/tokens.d.ts +3 -0
  157. package/dist/skeleton/tokens.d.ts.map +1 -0
  158. package/dist/skeleton/tokens.js +15 -0
  159. package/dist/skeleton/tokens.js.map +1 -0
  160. package/dist/slider/Slider.d.ts +1 -1
  161. package/dist/slider/Slider.js +222 -44
  162. package/dist/slider/Slider.js.map +1 -1
  163. package/dist/spinner/Spinner.js +49 -9
  164. package/dist/spinner/Spinner.js.map +1 -1
  165. package/dist/spinner/tokens.d.ts +1 -1
  166. package/dist/spinner/tokens.js.map +1 -1
  167. package/dist/stack/Stack.d.ts +1 -1
  168. package/dist/stack/Stack.js +60 -7
  169. package/dist/stack/Stack.js.map +1 -1
  170. package/dist/stack/tokens.d.ts +1 -1
  171. package/dist/stack/tokens.js.map +1 -1
  172. package/dist/switch/Switch.d.ts +1 -1
  173. package/dist/switch/Switch.js +68 -11
  174. package/dist/switch/Switch.js.map +1 -1
  175. package/dist/switch/tokens.d.ts +1 -1
  176. package/dist/switch/tokens.js.map +1 -1
  177. package/dist/tabs/Tabs.js +1 -1
  178. package/dist/tabs/Tabs.js.map +1 -1
  179. package/dist/tabs/tokens.d.ts +1 -1
  180. package/dist/tabs/tokens.js.map +1 -1
  181. package/dist/tags-input/TagsInput.d.ts +1 -1
  182. package/dist/tags-input/TagsInput.js +277 -121
  183. package/dist/tags-input/TagsInput.js.map +1 -1
  184. package/dist/text/Text.d.ts +1 -1
  185. package/dist/text/Text.js +70 -5
  186. package/dist/text/Text.js.map +1 -1
  187. package/dist/text/tokens.d.ts +1 -1
  188. package/dist/text/tokens.js.map +1 -1
  189. package/dist/text-area/TextArea.d.ts +1 -1
  190. package/dist/text-area/TextArea.js +135 -28
  191. package/dist/text-area/TextArea.js.map +1 -1
  192. package/dist/text-input/TextInput.d.ts +1 -1
  193. package/dist/text-input/TextInput.js +164 -49
  194. package/dist/text-input/TextInput.js.map +1 -1
  195. package/dist/theme/bootstrap.d.ts +2 -2
  196. package/dist/theme/bootstrap.js.map +1 -1
  197. package/dist/theme/chartColors.js.map +1 -1
  198. package/dist/theme/checkTheme.d.ts +2 -2
  199. package/dist/theme/checkTheme.js.map +1 -1
  200. package/dist/theme/cli.d.ts +2 -2
  201. package/dist/theme/cli.js.map +1 -1
  202. package/dist/theme/color.js.map +1 -1
  203. package/dist/theme/colorVision.d.ts +1 -1
  204. package/dist/theme/colorVision.js.map +1 -1
  205. package/dist/theme/componentTokens.js.map +1 -1
  206. package/dist/theme/components.d.ts +1 -0
  207. package/dist/theme/components.d.ts.map +1 -1
  208. package/dist/theme/components.js +2 -0
  209. package/dist/theme/components.js.map +1 -1
  210. package/dist/theme/defineTheme.d.ts +5 -5
  211. package/dist/theme/defineTheme.js.map +1 -1
  212. package/dist/theme/fonts.js.map +1 -1
  213. package/dist/theme/index.d.ts +12 -12
  214. package/dist/theme/semanticTokens.js.map +1 -1
  215. package/dist/theme/theme.d.ts +2 -2
  216. package/dist/theme/theme.js.map +1 -1
  217. package/dist/theme/toneClass.d.ts +1 -1
  218. package/dist/theme/toneClass.js.map +1 -1
  219. package/dist/theme/tones.d.ts +1 -1
  220. package/dist/theme/tones.js.map +1 -1
  221. package/dist/time-input/TimeInput.d.ts +1 -1
  222. package/dist/time-input/TimeInput.js +138 -31
  223. package/dist/time-input/TimeInput.js.map +1 -1
  224. package/dist/toast/Toast.d.ts +1 -1
  225. package/dist/toast/Toast.js +1 -1
  226. package/dist/toast/Toast.js.map +1 -1
  227. package/dist/toast/tokens.d.ts +1 -1
  228. package/dist/toast/tokens.js.map +1 -1
  229. package/dist/tooltip/Tooltip.js +38 -8
  230. package/dist/tooltip/Tooltip.js.map +1 -1
  231. package/dist/tooltip/tokens.d.ts +1 -1
  232. package/dist/tooltip/tokens.js.map +1 -1
  233. package/dist/utils/cx.js.map +1 -1
  234. package/package.json +5 -5
@@ -1,19 +1,52 @@
1
1
  import { cx } from "../utils/cx.js";
2
2
  import { ChoiceChrome } from "../checkbox/ChoiceChrome.js";
3
3
  import Switch_module_default from "./Switch.module.js";
4
+ import { c } from "react/compiler-runtime";
4
5
  import { Switch } from "react-aria-components";
5
6
  import { jsx, jsxs } from "react/jsx-runtime";
6
7
  //#region src/switch/Switch.tsx
7
8
  /** An on and off switch, for settings that apply at once. */
8
- function Switch$1({ children, description, errors = [], className, switchClassName, descriptionClassName, errorsClassName, ...props }) {
9
- return /* @__PURE__ */ jsx(ChoiceChrome, {
10
- component: "switch",
11
- description,
12
- errors,
13
- className,
14
- descriptionClassName,
15
- errorsClassName,
16
- children: (describedBy) => /* @__PURE__ */ jsxs(Switch, {
9
+ function Switch$1(t0) {
10
+ const $ = c(22);
11
+ let children;
12
+ let className;
13
+ let description;
14
+ let descriptionClassName;
15
+ let errorsClassName;
16
+ let props;
17
+ let switchClassName;
18
+ let t1;
19
+ if ($[0] !== t0) {
20
+ ({children, description, errors: t1, className, switchClassName, descriptionClassName, errorsClassName, ...props} = t0);
21
+ $[0] = t0;
22
+ $[1] = children;
23
+ $[2] = className;
24
+ $[3] = description;
25
+ $[4] = descriptionClassName;
26
+ $[5] = errorsClassName;
27
+ $[6] = props;
28
+ $[7] = switchClassName;
29
+ $[8] = t1;
30
+ } else {
31
+ children = $[1];
32
+ className = $[2];
33
+ description = $[3];
34
+ descriptionClassName = $[4];
35
+ errorsClassName = $[5];
36
+ props = $[6];
37
+ switchClassName = $[7];
38
+ t1 = $[8];
39
+ }
40
+ let t2;
41
+ if ($[9] !== t1) {
42
+ t2 = t1 === void 0 ? [] : t1;
43
+ $[9] = t1;
44
+ $[10] = t2;
45
+ } else t2 = $[10];
46
+ const errors = t2;
47
+ let t3;
48
+ if ($[11] !== children || $[12] !== props || $[13] !== switchClassName) {
49
+ t3 = (describedBy) => /* @__PURE__ */ jsxs(Switch, {
17
50
  ...props,
18
51
  "aria-describedby": describedBy,
19
52
  className: cx(Switch_module_default.control, switchClassName),
@@ -25,8 +58,32 @@ function Switch$1({ children, description, errors = [], className, switchClassNa
25
58
  className: Switch_module_default.label,
26
59
  children
27
60
  }) : null]
28
- })
29
- });
61
+ });
62
+ $[11] = children;
63
+ $[12] = props;
64
+ $[13] = switchClassName;
65
+ $[14] = t3;
66
+ } else t3 = $[14];
67
+ let t4;
68
+ if ($[15] !== className || $[16] !== description || $[17] !== descriptionClassName || $[18] !== errors || $[19] !== errorsClassName || $[20] !== t3) {
69
+ t4 = /* @__PURE__ */ jsx(ChoiceChrome, {
70
+ component: "switch",
71
+ description,
72
+ errors,
73
+ className,
74
+ descriptionClassName,
75
+ errorsClassName,
76
+ children: t3
77
+ });
78
+ $[15] = className;
79
+ $[16] = description;
80
+ $[17] = descriptionClassName;
81
+ $[18] = errors;
82
+ $[19] = errorsClassName;
83
+ $[20] = t3;
84
+ $[21] = t4;
85
+ } else t4 = $[21];
86
+ return t4;
30
87
  }
31
88
  //#endregion
32
89
  export { Switch$1 as Switch };
@@ -1 +1 @@
1
- {"version":3,"file":"Switch.js","names":["Switch","AriaSwitch","styles"],"sources":["../../src/switch/Switch.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\nimport { Switch as AriaSwitch, type SwitchProps as AriaSwitchProps } from 'react-aria-components';\n\nimport { ChoiceChrome, type ChoiceChromeProps } from '../checkbox/ChoiceChrome';\nimport { cx } from '../utils/cx';\nimport styles from './Switch.module.css';\n\nexport interface SwitchProps\n extends Omit<AriaSwitchProps, 'className' | 'style' | 'children'>, ChoiceChromeProps {\n /** Label, next to the switch. */\n children?: ReactNode;\n switchClassName?: string;\n}\n\n/** An on and off switch, for settings that apply at once. */\nexport function Switch({\n children,\n description,\n errors = [],\n className,\n switchClassName,\n descriptionClassName,\n errorsClassName,\n ...props\n}: SwitchProps) {\n return (\n <ChoiceChrome\n component=\"switch\"\n description={description}\n errors={errors}\n className={className}\n descriptionClassName={descriptionClassName}\n errorsClassName={errorsClassName}\n >\n {(describedBy) => (\n <AriaSwitch\n {...props}\n aria-describedby={describedBy}\n className={cx(styles.control, switchClassName)}\n >\n <span className={styles.track} aria-hidden=\"true\">\n <span className={styles.thumb} />\n </span>\n {children !== undefined ? (\n <span className={styles.label}>{children}</span>\n ) : null}\n </AriaSwitch>\n )}\n </ChoiceChrome>\n );\n}\n"],"mappings":";;;;;;;AAeA,SAAgBA,SAAO,EACnB,UACA,aACA,SAAS,CAAA,GACT,WACA,iBACA,sBACA,iBACA,GAAG,SACS;CACZ,OACI,oBAAC,cAAD;EACI,WAAU;EACG;EACL;EACG;EACW;EACL;EAEf,WAAA,gBACE,qBAACC,QAAD;GACI,GAAI;GACJ,oBAAkB;GAClB,WAAW,GAAGC,sBAAO,SAAS,eAAe;GAHjD,UAAA,CAKI,oBAAC,QAAD;IAAM,WAAWA,sBAAO;IAAO,eAAY;IACvC,UAAA,oBAAC,QAAD,EAAM,WAAWA,sBAAO,MAAM,CAAA;GAC5B,CAAA,GACL,aAAa,KAAA,IACV,oBAAC,QAAD;IAAM,WAAWA,sBAAO;IAAQ;GAAe,CAAA,IAC/C,IACI;;CAEN,CAAA;AAEtB"}
1
+ {"version":3,"file":"Switch.js","names":["ReactNode","Switch","AriaSwitch","SwitchProps","AriaSwitchProps","ChoiceChrome","ChoiceChromeProps","cx","styles","Omit","children","switchClassName","t0","$","_c","className","description","descriptionClassName","errorsClassName","props","t1","errors","t2","undefined","t3","describedBy","control","track","thumb","label","t4","Switch","_c","AriaSwitch","styles"],"sources":["../../src/switch/Switch.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\nimport { Switch as AriaSwitch, type SwitchProps as AriaSwitchProps } from 'react-aria-components';\n\nimport { ChoiceChrome, type ChoiceChromeProps } from '../checkbox/ChoiceChrome';\nimport { cx } from '../utils/cx';\nimport styles from './Switch.module.css';\n\nexport interface SwitchProps\n extends Omit<AriaSwitchProps, 'className' | 'style' | 'children'>, ChoiceChromeProps {\n /** Label, next to the switch. */\n children?: ReactNode;\n switchClassName?: string;\n}\n\n/** An on and off switch, for settings that apply at once. */\nexport function Switch({\n children,\n description,\n errors = [],\n className,\n switchClassName,\n descriptionClassName,\n errorsClassName,\n ...props\n}: SwitchProps) {\n return (\n <ChoiceChrome\n component=\"switch\"\n description={description}\n errors={errors}\n className={className}\n descriptionClassName={descriptionClassName}\n errorsClassName={errorsClassName}\n >\n {(describedBy) => (\n <AriaSwitch\n {...props}\n aria-describedby={describedBy}\n className={cx(styles.control, switchClassName)}\n >\n <span className={styles.track} aria-hidden=\"true\">\n <span className={styles.thumb} />\n </span>\n {children !== undefined ? (\n <span className={styles.label}>{children}</span>\n ) : null}\n </AriaSwitch>\n )}\n </ChoiceChrome>\n );\n}\n"],"mappings":";;;;;;;;AAeA,SAAOC,SAAAW,IAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CAAA,IAAAJ;CAAA,IAAAK;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAR;CAAA,IAAAS;CAAA,IAAAP,EAAA,OAAAD,IAAA;EAAgB,CAAA,CAAAF,UAAAM,aAAAK,QAAAD,IAAAL,WAAAJ,iBAAAM,sBAAAC,iBAAA,GAAAC,SAAAP;EASTC,EAAA,KAAAD;EAAAC,EAAA,KAAAH;EAAAG,EAAA,KAAAE;EAAAF,EAAA,KAAAG;EAAAH,EAAA,KAAAI;EAAAJ,EAAA,KAAAK;EAAAL,EAAA,KAAAM;EAAAN,EAAA,KAAAF;EAAAE,EAAA,KAAAO;CAAA,OAAA;EAAAV,WAAAG,EAAA;EAAAE,YAAAF,EAAA;EAAAG,cAAAH,EAAA;EAAAI,uBAAAJ,EAAA;EAAAK,kBAAAL,EAAA;EAAAM,QAAAN,EAAA;EAAAF,kBAAAE,EAAA;EAAAO,KAAAP,EAAA;CAAA;CAAA,IAAAS;CAAA,IAAAT,EAAA,OAAAO,IAAA;EANVE,KAAAF,OAAAG,KAAAA,IAAA,CAAA,IAAAH;EAAWP,EAAA,KAAAO;EAAAP,EAAA,MAAAS;CAAA,OAAAA,KAAAT,EAAA;CAAX,MAAAQ,SAAAC;CAAW,IAAAE;CAAA,IAAAX,EAAA,QAAAH,YAAAG,EAAA,QAAAM,SAAAN,EAAA,QAAAF,iBAAA;EAgBFa,MAAAC,gBACG,qBAACQ,QAAD;GAAW,GACHd;GACcM,oBAAAA;GACP,WAAAlB,GAAGC,sBAAMkB,SAAUf,eAAe;GAHjD,UAAA,CAKI,oBAAA,QAAA;IAAiB,WAAAH,sBAAMmB;IAAoB,eAAA;IACvC,UAAA,oBAAA,QAAA,EAAiB,WAAAnB,sBAAMoB,MAAM,CAAA;GAC1B,CAAA,GACNlB,aAAaa,KAAAA,IACV,oBAAA,QAAA;IAAiB,WAAAf,sBAAMqB;IAASnB;GAAgB,CAAA,IADnD,IARM;;EAYdG,EAAA,MAAAH;EAAAG,EAAA,MAAAM;EAAAN,EAAA,MAAAF;EAAAE,EAAA,MAAAW;CAAA,OAAAA,KAAAX,EAAA;CAAA,IAAAiB;CAAA,IAAAjB,EAAA,QAAAE,aAAAF,EAAA,QAAAG,eAAAH,EAAA,QAAAI,wBAAAJ,EAAA,QAAAQ,UAAAR,EAAA,QAAAK,mBAAAL,EAAA,QAAAW,IAAA;EArBLM,KAAA,oBAAC,cAAD;GACc,WAAA;GACGd;GACLK;GACGN;GACWE;GACLC;GAEhBM,UAAAA;EARQ,CAAA;EAsBEX,EAAA,MAAAE;EAAAF,EAAA,MAAAG;EAAAH,EAAA,MAAAI;EAAAJ,EAAA,MAAAQ;EAAAR,EAAA,MAAAK;EAAAL,EAAA,MAAAW;EAAAX,EAAA,MAAAiB;CAAA,OAAAA,KAAAjB,EAAA;CAAA,OAtBfiB;AAsBe"}
@@ -1,3 +1,3 @@
1
1
  /** Tokens of Switch. */
2
- export declare const switchTokens: import("..").ComponentTokens<"switch", "panneau-switch-height" | "panneau-switch-width" | "panneau-switch-radius" | "panneau-switch-checked-bg" | "panneau-switch-track-bg" | "panneau-switch-thumb-size" | "panneau-switch-thumb-bg" | "panneau-switch-checked-thumb-bg">;
2
+ export declare const switchTokens: import("../index.js").ComponentTokens<"switch", "panneau-switch-height" | "panneau-switch-width" | "panneau-switch-radius" | "panneau-switch-checked-bg" | "panneau-switch-track-bg" | "panneau-switch-thumb-size" | "panneau-switch-thumb-bg" | "panneau-switch-checked-thumb-bg">;
3
3
  //# sourceMappingURL=tokens.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"tokens.js","names":[],"sources":["../../src/switch/tokens.ts"],"sourcesContent":["import { defineComponentTokens } from '../theme/componentTokens';\n\n/** Tokens of Switch. */\nexport const switchTokens = defineComponentTokens('switch', {\n /** Width of the track. */\n width: '2.25rem',\n /** Height of the track. */\n height: '1.25rem',\n /** Background of the track when off. */\n 'track-bg': 'var(--panneau-color-border-control)',\n /** Corner radius of the track and the thumb. */\n radius: 'var(--panneau-radius-full)',\n /** Size of the thumb. */\n 'thumb-size': '1rem',\n /** Background of the thumb when off. */\n 'thumb-bg': 'var(--panneau-color-surface)',\n /** Background of the track when on. */\n 'checked-bg': 'var(--panneau-color-accent)',\n /** Background of the thumb when on. */\n 'checked-thumb-bg': 'var(--panneau-color-accent-text)',\n});\n"],"mappings":";;;AAGA,IAAa,eAAe,sBAAsB,UAAU;;CAExD,OAAO;;CAEP,QAAQ;;CAER,YAAY;;CAEZ,QAAQ;;CAER,cAAc;;CAEd,YAAY;;CAEZ,cAAc;;CAEd,oBAAoB;AACxB,CAAC"}
1
+ {"version":3,"file":"tokens.js","names":["defineComponentTokens","switchTokens","width","height","radius"],"sources":["../../src/switch/tokens.ts"],"sourcesContent":["import { defineComponentTokens } from '../theme/componentTokens';\n\n/** Tokens of Switch. */\nexport const switchTokens = defineComponentTokens('switch', {\n /** Width of the track. */\n width: '2.25rem',\n /** Height of the track. */\n height: '1.25rem',\n /** Background of the track when off. */\n 'track-bg': 'var(--panneau-color-border-control)',\n /** Corner radius of the track and the thumb. */\n radius: 'var(--panneau-radius-full)',\n /** Size of the thumb. */\n 'thumb-size': '1rem',\n /** Background of the thumb when off. */\n 'thumb-bg': 'var(--panneau-color-surface)',\n /** Background of the track when on. */\n 'checked-bg': 'var(--panneau-color-accent)',\n /** Background of the thumb when on. */\n 'checked-thumb-bg': 'var(--panneau-color-accent-text)',\n});\n"],"mappings":";;;AAGA,IAAaC,eAAeD,sBAAsB,UAAU;;CAExDE,OAAO;;CAEPC,QAAQ;;CAER,YAAY;;CAEZC,QAAQ;;CAER,cAAc;;CAEd,YAAY;;CAEZ,cAAc;;CAEd,oBAAoB;AACxB,CAAC"}
package/dist/tabs/Tabs.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import { cx } from "../utils/cx.js";
2
2
  import Tabs_module_default from "./Tabs.module.js";
3
+ import { c } from "react/compiler-runtime";
3
4
  import { Tab, TabList, TabPanel, Tabs } from "react-aria-components";
4
5
  import { jsx } from "react/jsx-runtime";
5
- import { c } from "react/compiler-runtime";
6
6
  //#region src/tabs/Tabs.tsx
7
7
  /** Tabs: a `TabList` of `Tab`s, then a `TabPanel` per tab, matched by `id`. */
8
8
  function Tabs$1(t0) {
@@ -1 +1 @@
1
- {"version":3,"file":"Tabs.js","names":["Tabs","_c","styles","AriaTabs","TabList","AriaTabList","Tab","AriaTab","TabPanel","AriaTabPanel"],"sources":["../../src/tabs/Tabs.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\nimport {\n Tab as AriaTab,\n TabList as AriaTabList,\n type TabListProps as AriaTabListProps,\n TabPanel as AriaTabPanel,\n type TabPanelProps as AriaTabPanelProps,\n type TabProps as AriaTabProps,\n Tabs as AriaTabs,\n type TabsProps as AriaTabsProps,\n} from 'react-aria-components';\n\nimport { cx } from '../utils/cx';\nimport styles from './Tabs.module.css';\n\nexport interface TabsProps extends Omit<AriaTabsProps, 'className' | 'style'> {\n className?: string;\n}\n\n/** Tabs: a `TabList` of `Tab`s, then a `TabPanel` per tab, matched by `id`. */\nexport function Tabs({ className, ...props }: TabsProps) {\n return <AriaTabs {...props} className={cx('panneau-tabs', styles.tabs, className)} />;\n}\n\nexport interface TabListProps<T extends object> extends Omit<\n AriaTabListProps<T>,\n 'className' | 'style'\n> {\n className?: string;\n}\n\n/** The row of tabs. It scrolls sideways when the tabs don't fit, on phones. */\nexport function TabList<T extends object>({ className, ...props }: TabListProps<T>) {\n return <AriaTabList {...props} className={cx('panneau-tab-list', styles.list, className)} />;\n}\n\nexport interface TabProps extends Omit<AriaTabProps, 'className' | 'style' | 'children'> {\n children?: ReactNode;\n className?: string;\n}\n\n/** A tab. Put a `Badge` in it for a count, such as the errors of the panel. */\nexport function Tab({ className, ...props }: TabProps) {\n return <AriaTab {...props} className={cx('panneau-tab', styles.tab, className)} />;\n}\n\nexport interface TabPanelProps extends Omit<AriaTabPanelProps, 'className' | 'style'> {\n className?: string;\n}\n\n/**\n * The content of a tab. With `shouldForceMount`, the panel stays mounted (and hidden) when another\n * tab is selected, which keeps the state of its fields.\n */\nexport function TabPanel({ className, ...props }: TabPanelProps) {\n return <AriaTabPanel {...props} className={cx('panneau-tab-panel', styles.panel, className)} />;\n}\n"],"mappings":";;;;;;;AAoBA,SAAOA,OAAA,IAAA;CAAA,MAAA,IAAAC,EAAA,CAAA;CAAA,IAAA;CAAA,IAAA;CAAA,IAAA,EAAA,OAAA,IAAA;EAAc,CAAA,CAAA,WAAA,GAAA,SAAA;EAAkC,EAAA,KAAA;EAAA,EAAA,KAAA;EAAA,EAAA,KAAA;CAAA,OAAA;EAAA,YAAA,EAAA;EAAA,QAAA,EAAA;CAAA;CAAA,IAAA;CAAA,IAAA,EAAA,OAAA,WAAA;EACZ,KAAA,GAAG,gBAAgBC,oBAAM,MAAO,SAAS;EAAC,EAAA,KAAA;EAAA,EAAA,KAAA;CAAA,OAAA,KAAA,EAAA;CAAA,IAAA;CAAA,IAAA,EAAA,OAAA,SAAA,EAAA,OAAA,IAAA;EAA1E,KAAA,oBAACC,MAAD;GAAS,GAAK;GAAkB,WAAA;EAA0C,CAAA;EAAI,EAAA,KAAA;EAAA,EAAA,KAAA;EAAA,EAAA,KAAA;CAAA,OAAA,KAAA,EAAA;CAAA,OAA9E;AAA8E;;AAWzF,SAAOC,UAAA,IAAA;CAAA,MAAA,IAAAH,EAAA,CA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AA;CAAA,MAAA,IAAAP,EAAA,CAAA;CAAA,IAAA;CAAA,IAAA;CAAA,IAAA,EAAA,OAAA,IAAA;EAAkB,CAAA,CAAA,WAAA,GAAA,SAAA;EAAsC,EAAA,KAAA;EAAA,EAAA,KAAA;EAAA,EAAA,KAAA;CAAA,OAAA;EAAA,YAAA,EAAA;EAAA,QAAA,EAAA;CAAA;CAAA,IAAA;CAAA,IAAA,EAAA,OAAA,WAAA;EAChB,KAAA,GAAG,qBAAqBC,oBAAM,OAAQ,SAAS;EAAC,EAAA,KAAA;EAAA,EAAA,KAAA;CAAA,OAAA,KAAA,EAAA;CAAA,IAAA;CAAA,IAAA,EAAA,OAAA,SAAA,EAAA,OAAA,IAAA;EAApF,KAAA,oBAACO,UAAD;GAAa,GAAK;GAAkB,WAAA;EAAgD,CAAA;EAAI,EAAA,KAAA;EAAA,EAAA,KAAA;EAAA,EAAA,KAAA;CAAA,OAAA,KAAA,EAAA;CAAA,OAAxF;AAAwF"}
1
+ {"version":3,"file":"Tabs.js","names":["ReactNode","Tab","AriaTab","TabList","AriaTabList","TabListProps","AriaTabListProps","TabPanel","AriaTabPanel","TabPanelProps","AriaTabPanelProps","TabProps","AriaTabProps","Tabs","AriaTabs","TabsProps","AriaTabsProps","cx","styles","Omit","className","t0","$","_c","props","t1","tabs","t2","T","list","children","tab","panel","Tabs","_c","styles","AriaTabs","TabList","AriaTabList","Tab","AriaTab","TabPanel","AriaTabPanel"],"sources":["../../src/tabs/Tabs.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\nimport {\n Tab as AriaTab,\n TabList as AriaTabList,\n type TabListProps as AriaTabListProps,\n TabPanel as AriaTabPanel,\n type TabPanelProps as AriaTabPanelProps,\n type TabProps as AriaTabProps,\n Tabs as AriaTabs,\n type TabsProps as AriaTabsProps,\n} from 'react-aria-components';\n\nimport { cx } from '../utils/cx';\nimport styles from './Tabs.module.css';\n\nexport interface TabsProps extends Omit<AriaTabsProps, 'className' | 'style'> {\n className?: string;\n}\n\n/** Tabs: a `TabList` of `Tab`s, then a `TabPanel` per tab, matched by `id`. */\nexport function Tabs({ className, ...props }: TabsProps) {\n return <AriaTabs {...props} className={cx('panneau-tabs', styles.tabs, className)} />;\n}\n\nexport interface TabListProps<T extends object> extends Omit<\n AriaTabListProps<T>,\n 'className' | 'style'\n> {\n className?: string;\n}\n\n/** The row of tabs. It scrolls sideways when the tabs don't fit, on phones. */\nexport function TabList<T extends object>({ className, ...props }: TabListProps<T>) {\n return <AriaTabList {...props} className={cx('panneau-tab-list', styles.list, className)} />;\n}\n\nexport interface TabProps extends Omit<AriaTabProps, 'className' | 'style' | 'children'> {\n children?: ReactNode;\n className?: string;\n}\n\n/** A tab. Put a `Badge` in it for a count, such as the errors of the panel. */\nexport function Tab({ className, ...props }: TabProps) {\n return <AriaTab {...props} className={cx('panneau-tab', styles.tab, className)} />;\n}\n\nexport interface TabPanelProps extends Omit<AriaTabPanelProps, 'className' | 'style'> {\n className?: string;\n}\n\n/**\n * The content of a tab. With `shouldForceMount`, the panel stays mounted (and hidden) when another\n * tab is selected, which keeps the state of its fields.\n */\nexport function TabPanel({ className, ...props }: TabPanelProps) {\n return <AriaTabPanel {...props} className={cx('panneau-tab-panel', styles.panel, className)} />;\n}\n"],"mappings":";;;;;;;AAoBA,SAAOa,OAAAQ,IAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CAAA,IAAAH;CAAA,IAAAI;CAAA,IAAAF,EAAA,OAAAD,IAAA;EAAc,CAAA,CAAAD,WAAA,GAAAI,SAAAH;EAAkCC,EAAA,KAAAD;EAAAC,EAAA,KAAAF;EAAAE,EAAA,KAAAE;CAAA,OAAA;EAAAJ,YAAAE,EAAA;EAAAE,QAAAF,EAAA;CAAA;CAAA,IAAAG;CAAA,IAAAH,EAAA,OAAAF,WAAA;EACZK,KAAAR,GAAG,gBAAgBC,oBAAMQ,MAAON,SAAS;EAACE,EAAA,KAAAF;EAAAE,EAAA,KAAAG;CAAA,OAAAA,KAAAH,EA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" | "panneau-tabs-tab-font-weight" | "panneau-tabs-tab-color" | "panneau-tabs-indicator-height" | "panneau-tabs-tab-color-selected" | "panneau-tabs-indicator-color">;
2
+ export declare const tabsTokens: import("../index.js").ComponentTokens<"tabs", "panneau-tabs-gap" | "panneau-tabs-border-color" | "panneau-tabs-tab-padding-x" | "panneau-tabs-tab-font-weight" | "panneau-tabs-tab-color" | "panneau-tabs-indicator-height" | "panneau-tabs-tab-color-selected" | "panneau-tabs-indicator-color">;
3
3
  //# sourceMappingURL=tokens.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"tokens.js","names":[],"sources":["../../src/tabs/tokens.ts"],"sourcesContent":["import { defineComponentTokens } from '../theme/componentTokens';\n\n/** Tokens of Tabs. */\nexport const tabsTokens = defineComponentTokens('tabs', {\n /** Space between the tab list and the panel. */\n gap: 'var(--panneau-space-4)',\n /** Color of the line under the tab list. */\n 'border-color': 'var(--panneau-color-border)',\n /** Horizontal padding of a tab. */\n 'tab-padding-x': 'var(--panneau-space-3)',\n /** Font weight of a tab. */\n 'tab-font-weight': 'var(--panneau-font-weight-medium)',\n /** Text color of a tab. */\n 'tab-color': 'var(--panneau-color-text-muted)',\n /** Height of the indicator under the selected tab. */\n 'indicator-height': '2px',\n /** Text color of a hovered or selected tab. */\n 'tab-color-selected': 'var(--panneau-color-text)',\n /** Color of the indicator under the selected tab. */\n 'indicator-color': 'var(--panneau-color-accent)',\n});\n"],"mappings":";;;AAGA,IAAa,aAAa,sBAAsB,QAAQ;;CAEpD,KAAK;;CAEL,gBAAgB;;CAEhB,iBAAiB;;CAEjB,mBAAmB;;CAEnB,aAAa;;CAEb,oBAAoB;;CAEpB,sBAAsB;;CAEtB,mBAAmB;AACvB,CAAC"}
1
+ {"version":3,"file":"tokens.js","names":["defineComponentTokens","tabsTokens","gap"],"sources":["../../src/tabs/tokens.ts"],"sourcesContent":["import { defineComponentTokens } from '../theme/componentTokens';\n\n/** Tokens of Tabs. */\nexport const tabsTokens = defineComponentTokens('tabs', {\n /** Space between the tab list and the panel. */\n gap: 'var(--panneau-space-4)',\n /** Color of the line under the tab list. */\n 'border-color': 'var(--panneau-color-border)',\n /** Horizontal padding of a tab. */\n 'tab-padding-x': 'var(--panneau-space-3)',\n /** Font weight of a tab. */\n 'tab-font-weight': 'var(--panneau-font-weight-medium)',\n /** Text color of a tab. */\n 'tab-color': 'var(--panneau-color-text-muted)',\n /** Height of the indicator under the selected tab. */\n 'indicator-height': '2px',\n /** Text color of a hovered or selected tab. */\n 'tab-color-selected': 'var(--panneau-color-text)',\n /** Color of the indicator under the selected tab. */\n 'indicator-color': 'var(--panneau-color-accent)',\n});\n"],"mappings":";;;AAGA,IAAaC,aAAaD,sBAAsB,QAAQ;;CAEpDE,KAAK;;CAEL,gBAAgB;;CAEhB,iBAAiB;;CAEjB,mBAAmB;;CAEnB,aAAa;;CAEb,oBAAoB;;CAEpB,sBAAsB;;CAEtB,mBAAmB;AACvB,CAAC"}
@@ -1,4 +1,4 @@
1
- import { type FieldChromeProps } from '../field/FieldParts';
1
+ import { type FieldChromeProps } from '../field/FieldParts.js';
2
2
  /** A suggested tag: its value, and the label shown for it. */
3
3
  export interface TagSuggestion {
4
4
  value: string;
@@ -4,6 +4,7 @@ import { messages } from "../intl/messages.js";
4
4
  import { usePanneauIntl } from "../intl/usePanneauIntl.js";
5
5
  import Field_module_default from "../field/Field.module.js";
6
6
  import TagsInput_module_default from "./TagsInput.module.js";
7
+ import { c } from "react/compiler-runtime";
7
8
  import { X } from "lucide-react";
8
9
  import { Button, Tag, TagGroup, TagList } from "react-aria-components";
9
10
  import { jsx, jsxs } from "react/jsx-runtime";
@@ -15,15 +16,31 @@ import { useId, useState } from "react";
15
16
  * and a tag already in the list isn't added again. Suggestions complete what is typed; without
16
17
  * `allowCustom`, only they can be added.
17
18
  */
18
- function TagsInput({ label, description, errors = [], value, onChange, onBlur, suggestions = [], allowCustom = true, placeholder, name, isRequired, isDisabled, isReadOnly, autoFocus, className, labelClassName, descriptionClassName, errorsClassName, controlClassName }) {
19
+ function TagsInput(t0) {
20
+ const $ = c(67);
21
+ const { label, description, errors: t1, value, onChange, onBlur, suggestions: t2, allowCustom: t3, placeholder, name, isRequired, isDisabled, isReadOnly, autoFocus, className, labelClassName, descriptionClassName, errorsClassName, controlClassName } = t0;
22
+ let t4;
23
+ if ($[0] !== t1) {
24
+ t4 = t1 === void 0 ? [] : t1;
25
+ $[0] = t1;
26
+ $[1] = t4;
27
+ } else t4 = $[1];
28
+ const errors = t4;
29
+ const suggestions = t2 === void 0 ? [] : t2;
30
+ const allowCustom = t3 === void 0 ? true : t3;
19
31
  const intl = usePanneauIntl();
20
32
  const id = useId();
21
33
  const [draft, setDraft] = useState("");
22
- const tags = value ?? [];
34
+ let t5;
35
+ if ($[2] !== value) {
36
+ t5 = value ?? [];
37
+ $[2] = value;
38
+ $[3] = t5;
39
+ } else t5 = $[3];
40
+ const tags = t5;
23
41
  const invalid = errors.length > 0;
24
42
  const editable = isDisabled !== true && isReadOnly !== true;
25
43
  const labelOf = (tag) => suggestions.find((suggestion) => suggestion.value === tag)?.label ?? tag;
26
- /** The tag a text adds: the suggestion it names, or the text itself when allowed. */
27
44
  const resolve = (text) => {
28
45
  const trimmed = text.trim();
29
46
  if (trimmed === "") return null;
@@ -32,127 +49,266 @@ function TagsInput({ label, description, errors = [], value, onChange, onBlur, s
32
49
  if (suggestion_0 !== void 0) return suggestion_0.value;
33
50
  return allowCustom ? trimmed : null;
34
51
  };
35
- const add = (texts) => {
36
- const next = [...tags];
37
- texts.forEach((text_0) => {
38
- const tag_0 = resolve(text_0);
39
- if (tag_0 !== null && !next.includes(tag_0)) next.push(tag_0);
40
- });
41
- if (next.length !== tags.length) onChange?.(next);
42
- };
43
- const remove = (removed) => {
44
- const next_0 = tags.filter((tag_1) => !removed.has(tag_1));
45
- onChange?.(next_0.length > 0 ? next_0 : null);
46
- };
47
- const commit = () => {
48
- if (draft.trim() !== "") {
49
- add([draft]);
50
- setDraft("");
51
- }
52
- };
53
- const onKeyDown = (event) => {
54
- if (event.key === "Enter" || event.key === "," || event.key === "Tab" && draft !== "") {
52
+ let t6;
53
+ if ($[4] !== onChange || $[5] !== resolve || $[6] !== tags) {
54
+ t6 = (texts) => {
55
+ const next = [...tags];
56
+ texts.forEach((text_0) => {
57
+ const tag_0 = resolve(text_0);
58
+ if (tag_0 !== null && !next.includes(tag_0)) next.push(tag_0);
59
+ });
60
+ if (next.length !== tags.length) onChange?.(next);
61
+ };
62
+ $[4] = onChange;
63
+ $[5] = resolve;
64
+ $[6] = tags;
65
+ $[7] = t6;
66
+ } else t6 = $[7];
67
+ const add = t6;
68
+ let t7;
69
+ if ($[8] !== onChange || $[9] !== tags) {
70
+ t7 = (removed) => {
71
+ const next_0 = tags.filter((tag_1) => !removed.has(tag_1));
72
+ onChange?.(next_0.length > 0 ? next_0 : null);
73
+ };
74
+ $[8] = onChange;
75
+ $[9] = tags;
76
+ $[10] = t7;
77
+ } else t7 = $[10];
78
+ const remove = t7;
79
+ let t8;
80
+ if ($[11] !== add || $[12] !== draft) {
81
+ t8 = () => {
55
82
  if (draft.trim() !== "") {
83
+ add([draft]);
84
+ setDraft("");
85
+ }
86
+ };
87
+ $[11] = add;
88
+ $[12] = draft;
89
+ $[13] = t8;
90
+ } else t8 = $[13];
91
+ const commit = t8;
92
+ let t9;
93
+ if ($[14] !== commit || $[15] !== draft || $[16] !== remove || $[17] !== tags) {
94
+ t9 = (event) => {
95
+ if (event.key === "Enter" || event.key === "," || event.key === "Tab" && draft !== "") {
96
+ if (draft.trim() !== "") {
97
+ event.preventDefault();
98
+ commit();
99
+ } else if (event.key !== "Tab") event.preventDefault();
100
+ } else if (event.key === "Backspace" && draft === "" && tags.length > 0) {
56
101
  event.preventDefault();
57
- commit();
58
- } else if (event.key !== "Tab") event.preventDefault();
59
- } else if (event.key === "Backspace" && draft === "" && tags.length > 0) {
60
- event.preventDefault();
61
- remove(/* @__PURE__ */ new Set([tags[tags.length - 1]]));
62
- }
63
- };
64
- const onPaste = (event_0) => {
65
- const text_1 = event_0.clipboardData.getData("text");
66
- if (/[,\n]/.test(text_1)) {
67
- event_0.preventDefault();
68
- add(text_1.split(/[,\n]/));
69
- }
70
- };
71
- const describedBy = [description !== void 0 && description !== null ? `${id}-description` : null, invalid ? `${id}-errors` : null].filter((part) => part !== null).join(" ");
72
- return /* @__PURE__ */ jsxs("div", {
73
- className: cx("panneau-tags-input", Field_module_default.field, className),
74
- children: [
75
- label !== void 0 && label !== null ? /* @__PURE__ */ jsxs("label", {
76
- htmlFor: `${id}-input`,
77
- className: cx(Field_module_default.label, labelClassName),
78
- children: [label, isRequired === true ? /* @__PURE__ */ jsx("span", {
79
- className: Field_module_default.required,
80
- "aria-hidden": "true",
81
- children: "*"
82
- }) : null]
83
- }) : null,
84
- /* @__PURE__ */ jsxs("div", {
85
- className: cx(Field_module_default.control, TagsInput_module_default.control, controlClassName),
86
- "data-invalid": invalid || void 0,
87
- "data-disabled": isDisabled || void 0,
88
- "data-readonly": isReadOnly || void 0,
89
- children: [
90
- tags.length > 0 ? /* @__PURE__ */ jsx(TagGroup, {
91
- "aria-label": intl.formatMessage(messages.tags, { label: typeof label === "string" ? label : "" }),
92
- onRemove: editable ? remove : void 0,
93
- className: TagsInput_module_default.group,
94
- children: /* @__PURE__ */ jsx(TagList, {
95
- className: TagsInput_module_default.list,
96
- children: tags.map((tag_2) => /* @__PURE__ */ jsxs(Tag, {
97
- id: tag_2,
98
- textValue: labelOf(tag_2),
99
- className: TagsInput_module_default.tag,
100
- children: [labelOf(tag_2), editable ? /* @__PURE__ */ jsx(Button, {
101
- slot: "remove",
102
- className: TagsInput_module_default.remove,
103
- children: /* @__PURE__ */ jsx(Icon, {
104
- icon: X,
105
- size: "xs"
106
- })
107
- }) : null]
108
- }, tag_2))
102
+ remove(/* @__PURE__ */ new Set([tags[tags.length - 1]]));
103
+ }
104
+ };
105
+ $[14] = commit;
106
+ $[15] = draft;
107
+ $[16] = remove;
108
+ $[17] = tags;
109
+ $[18] = t9;
110
+ } else t9 = $[18];
111
+ const onKeyDown = t9;
112
+ let t10;
113
+ if ($[19] !== add) {
114
+ t10 = (event_0) => {
115
+ const text_1 = event_0.clipboardData.getData("text");
116
+ if (/[,\n]/.test(text_1)) {
117
+ event_0.preventDefault();
118
+ add(text_1.split(/[,\n]/));
119
+ }
120
+ };
121
+ $[19] = add;
122
+ $[20] = t10;
123
+ } else t10 = $[20];
124
+ const onPaste = t10;
125
+ const t11 = description !== void 0 && description !== null ? `${id}-description` : null;
126
+ const t12 = invalid ? `${id}-errors` : null;
127
+ let t13;
128
+ if ($[21] !== t11 || $[22] !== t12) {
129
+ t13 = [t11, t12].filter(_temp);
130
+ $[21] = t11;
131
+ $[22] = t12;
132
+ $[23] = t13;
133
+ } else t13 = $[23];
134
+ const describedBy = t13.join(" ");
135
+ let t14;
136
+ if ($[24] !== className) {
137
+ t14 = cx("panneau-tags-input", Field_module_default.field, className);
138
+ $[24] = className;
139
+ $[25] = t14;
140
+ } else t14 = $[25];
141
+ let t15;
142
+ if ($[26] !== id || $[27] !== isRequired || $[28] !== label || $[29] !== labelClassName) {
143
+ t15 = label !== void 0 && label !== null ? /* @__PURE__ */ jsxs("label", {
144
+ htmlFor: `${id}-input`,
145
+ className: cx(Field_module_default.label, labelClassName),
146
+ children: [label, isRequired === true ? /* @__PURE__ */ jsx("span", {
147
+ className: Field_module_default.required,
148
+ "aria-hidden": "true",
149
+ children: "*"
150
+ }) : null]
151
+ }) : null;
152
+ $[26] = id;
153
+ $[27] = isRequired;
154
+ $[28] = label;
155
+ $[29] = labelClassName;
156
+ $[30] = t15;
157
+ } else t15 = $[30];
158
+ let t16;
159
+ if ($[31] !== controlClassName) {
160
+ t16 = cx(Field_module_default.control, TagsInput_module_default.control, controlClassName);
161
+ $[31] = controlClassName;
162
+ $[32] = t16;
163
+ } else t16 = $[32];
164
+ const t17 = invalid || void 0;
165
+ const t18 = isDisabled || void 0;
166
+ const t19 = isReadOnly || void 0;
167
+ let t20;
168
+ if ($[33] !== editable || $[34] !== intl || $[35] !== label || $[36] !== labelOf || $[37] !== remove || $[38] !== tags) {
169
+ t20 = tags.length > 0 ? /* @__PURE__ */ jsx(TagGroup, {
170
+ "aria-label": intl.formatMessage(messages.tags, { label: typeof label === "string" ? label : "" }),
171
+ onRemove: editable ? remove : void 0,
172
+ className: TagsInput_module_default.group,
173
+ children: /* @__PURE__ */ jsx(TagList, {
174
+ className: TagsInput_module_default.list,
175
+ children: tags.map((tag_2) => /* @__PURE__ */ jsxs(Tag, {
176
+ id: tag_2,
177
+ textValue: labelOf(tag_2),
178
+ className: TagsInput_module_default.tag,
179
+ children: [labelOf(tag_2), editable ? /* @__PURE__ */ jsx(Button, {
180
+ slot: "remove",
181
+ className: TagsInput_module_default.remove,
182
+ children: /* @__PURE__ */ jsx(Icon, {
183
+ icon: X,
184
+ size: "xs"
109
185
  })
110
- }) : null,
111
- editable ? /* @__PURE__ */ jsx("input", {
112
- id: `${id}-input`,
113
- className: cx(Field_module_default.bare, TagsInput_module_default.input),
114
- value: draft,
115
- placeholder: tags.length === 0 ? placeholder : void 0,
116
- list: suggestions.length > 0 ? `${id}-suggestions` : void 0,
117
- autoComplete: "off",
118
- autoFocus,
119
- "aria-invalid": invalid || void 0,
120
- "aria-required": isRequired || void 0,
121
- "aria-describedby": describedBy !== "" ? describedBy : void 0,
122
- onChange: (event_1) => setDraft(event_1.target.value),
123
- onKeyDown,
124
- onPaste,
125
- onBlur: () => {
126
- commit();
127
- onBlur?.();
128
- }
129
- }) : null,
130
- suggestions.length > 0 ? /* @__PURE__ */ jsx("datalist", {
131
- id: `${id}-suggestions`,
132
- children: suggestions.filter((suggestion_1) => !tags.includes(suggestion_1.value)).map((suggestion_2) => /* @__PURE__ */ jsx("option", { value: suggestion_2.label ?? suggestion_2.value }, suggestion_2.value))
133
- }) : null
134
- ]
135
- }),
136
- name !== void 0 ? tags.map((tag_3) => /* @__PURE__ */ jsx("input", {
137
- type: "hidden",
138
- name: `${name}[]`,
139
- value: tag_3
140
- }, tag_3)) : null,
141
- description !== void 0 && description !== null ? /* @__PURE__ */ jsx("div", {
142
- id: `${id}-description`,
143
- className: cx(Field_module_default.description, descriptionClassName),
144
- children: description
145
- }) : null,
146
- invalid ? /* @__PURE__ */ jsx("div", {
147
- id: `${id}-errors`,
148
- className: cx(Field_module_default.errors, errorsClassName),
149
- children: errors.map((error, index) => /* @__PURE__ */ jsx("span", {
150
- className: Field_module_default.error,
151
- children: error
152
- }, index))
153
- }) : null
154
- ]
155
- });
186
+ }) : null]
187
+ }, tag_2))
188
+ })
189
+ }) : null;
190
+ $[33] = editable;
191
+ $[34] = intl;
192
+ $[35] = label;
193
+ $[36] = labelOf;
194
+ $[37] = remove;
195
+ $[38] = tags;
196
+ $[39] = t20;
197
+ } else t20 = $[39];
198
+ const t21 = editable ? /* @__PURE__ */ jsx("input", {
199
+ id: `${id}-input`,
200
+ className: cx(Field_module_default.bare, TagsInput_module_default.input),
201
+ value: draft,
202
+ placeholder: tags.length === 0 ? placeholder : void 0,
203
+ list: suggestions.length > 0 ? `${id}-suggestions` : void 0,
204
+ autoComplete: "off",
205
+ autoFocus,
206
+ "aria-invalid": invalid || void 0,
207
+ "aria-required": isRequired || void 0,
208
+ "aria-describedby": describedBy !== "" ? describedBy : void 0,
209
+ onChange: (event_1) => setDraft(event_1.target.value),
210
+ onKeyDown,
211
+ onPaste,
212
+ onBlur: () => {
213
+ commit();
214
+ onBlur?.();
215
+ }
216
+ }) : null;
217
+ const t22 = suggestions.length > 0 ? /* @__PURE__ */ jsx("datalist", {
218
+ id: `${id}-suggestions`,
219
+ children: suggestions.filter((suggestion_1) => !tags.includes(suggestion_1.value)).map(_temp2)
220
+ }) : null;
221
+ let t23;
222
+ if ($[40] !== t16 || $[41] !== t17 || $[42] !== t18 || $[43] !== t19 || $[44] !== t20 || $[45] !== t21 || $[46] !== t22) {
223
+ t23 = /* @__PURE__ */ jsxs("div", {
224
+ className: t16,
225
+ "data-invalid": t17,
226
+ "data-disabled": t18,
227
+ "data-readonly": t19,
228
+ children: [
229
+ t20,
230
+ t21,
231
+ t22
232
+ ]
233
+ });
234
+ $[40] = t16;
235
+ $[41] = t17;
236
+ $[42] = t18;
237
+ $[43] = t19;
238
+ $[44] = t20;
239
+ $[45] = t21;
240
+ $[46] = t22;
241
+ $[47] = t23;
242
+ } else t23 = $[47];
243
+ let t24;
244
+ if ($[48] !== name || $[49] !== tags) {
245
+ t24 = name !== void 0 ? tags.map((tag_3) => /* @__PURE__ */ jsx("input", {
246
+ type: "hidden",
247
+ name: `${name}[]`,
248
+ value: tag_3
249
+ }, tag_3)) : null;
250
+ $[48] = name;
251
+ $[49] = tags;
252
+ $[50] = t24;
253
+ } else t24 = $[50];
254
+ let t25;
255
+ if ($[51] !== description || $[52] !== descriptionClassName || $[53] !== id) {
256
+ t25 = description !== void 0 && description !== null ? /* @__PURE__ */ jsx("div", {
257
+ id: `${id}-description`,
258
+ className: cx(Field_module_default.description, descriptionClassName),
259
+ children: description
260
+ }) : null;
261
+ $[51] = description;
262
+ $[52] = descriptionClassName;
263
+ $[53] = id;
264
+ $[54] = t25;
265
+ } else t25 = $[54];
266
+ let t26;
267
+ if ($[55] !== errors || $[56] !== errorsClassName || $[57] !== id || $[58] !== invalid) {
268
+ t26 = invalid ? /* @__PURE__ */ jsx("div", {
269
+ id: `${id}-errors`,
270
+ className: cx(Field_module_default.errors, errorsClassName),
271
+ children: errors.map(_temp3)
272
+ }) : null;
273
+ $[55] = errors;
274
+ $[56] = errorsClassName;
275
+ $[57] = id;
276
+ $[58] = invalid;
277
+ $[59] = t26;
278
+ } else t26 = $[59];
279
+ let t27;
280
+ if ($[60] !== t14 || $[61] !== t15 || $[62] !== t23 || $[63] !== t24 || $[64] !== t25 || $[65] !== t26) {
281
+ t27 = /* @__PURE__ */ jsxs("div", {
282
+ className: t14,
283
+ children: [
284
+ t15,
285
+ t23,
286
+ t24,
287
+ t25,
288
+ t26
289
+ ]
290
+ });
291
+ $[60] = t14;
292
+ $[61] = t15;
293
+ $[62] = t23;
294
+ $[63] = t24;
295
+ $[64] = t25;
296
+ $[65] = t26;
297
+ $[66] = t27;
298
+ } else t27 = $[66];
299
+ return t27;
300
+ }
301
+ function _temp3(error, index) {
302
+ return /* @__PURE__ */ jsx("span", {
303
+ className: Field_module_default.error,
304
+ children: error
305
+ }, index);
306
+ }
307
+ function _temp2(suggestion_2) {
308
+ return /* @__PURE__ */ jsx("option", { value: suggestion_2.label ?? suggestion_2.value }, suggestion_2.value);
309
+ }
310
+ function _temp(part) {
311
+ return part !== null;
156
312
  }
157
313
  //#endregion
158
314
  export { TagsInput };