@panneau/ui 5.0.0-alpha.5 → 5.0.0-alpha.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (201) hide show
  1. package/README.md +77 -1
  2. package/dist/alert/Alert.js +108 -40
  3. package/dist/alert/Alert.js.map +1 -1
  4. package/dist/alert/tokens.js.map +1 -1
  5. package/dist/badge/Badge.js +34 -6
  6. package/dist/badge/Badge.js.map +1 -1
  7. package/dist/badge/tokens.js.map +1 -1
  8. package/dist/button/Button.js +111 -17
  9. package/dist/button/Button.js.map +1 -1
  10. package/dist/button/tokens.js.map +1 -1
  11. package/dist/card/Card.js +76 -23
  12. package/dist/card/Card.js.map +1 -1
  13. package/dist/card/tokens.js.map +1 -1
  14. package/dist/checkbox/Checkbox.js +86 -25
  15. package/dist/checkbox/Checkbox.js.map +1 -1
  16. package/dist/checkbox/ChoiceChrome.js +82 -21
  17. package/dist/checkbox/ChoiceChrome.js.map +1 -1
  18. package/dist/checkbox/tokens.js.map +1 -1
  19. package/dist/combo-box/ComboBox.js +291 -79
  20. package/dist/combo-box/ComboBox.js.map +1 -1
  21. package/dist/command-palette/CommandPalette.js +463 -160
  22. package/dist/command-palette/CommandPalette.js.map +1 -1
  23. package/dist/command-palette/match.js.map +1 -1
  24. package/dist/command-palette/tokens.js.map +1 -1
  25. package/dist/command-palette/useCommandShortcut.js +31 -12
  26. package/dist/command-palette/useCommandShortcut.js.map +1 -1
  27. package/dist/container/Container.js +48 -5
  28. package/dist/container/Container.js.map +1 -1
  29. package/dist/container/tokens.js.map +1 -1
  30. package/dist/date-picker/DatePicker.js +234 -73
  31. package/dist/date-picker/DatePicker.js.map +1 -1
  32. package/dist/date-picker/calendarTokens.js.map +1 -1
  33. package/dist/dialog/Dialog.js +161 -45
  34. package/dist/dialog/Dialog.js.map +1 -1
  35. package/dist/dialog/tokens.js.map +1 -1
  36. package/dist/disclosure/Disclosure.js +132 -28
  37. package/dist/disclosure/Disclosure.js.map +1 -1
  38. package/dist/disclosure/tokens.js.map +1 -1
  39. package/dist/divider/Divider.js +55 -11
  40. package/dist/divider/Divider.js.map +1 -1
  41. package/dist/divider/tokens.js.map +1 -1
  42. package/dist/field/FieldParts.js +69 -15
  43. package/dist/field/FieldParts.js.map +1 -1
  44. package/dist/field/Fieldset.js +99 -32
  45. package/dist/field/Fieldset.js.map +1 -1
  46. package/dist/field/inputTokens.js.map +1 -1
  47. package/dist/field/tokens.js.map +1 -1
  48. package/dist/grid/Grid.js +123 -14
  49. package/dist/grid/Grid.js.map +1 -1
  50. package/dist/grid/tokens.js.map +1 -1
  51. package/dist/heading/Heading.js +41 -6
  52. package/dist/heading/Heading.js.map +1 -1
  53. package/dist/heading/tokens.js.map +1 -1
  54. package/dist/icon/Icon.js +36 -11
  55. package/dist/icon/Icon.js.map +1 -1
  56. package/dist/icon/lucideIconLoader.js.map +1 -1
  57. package/dist/icon/namedIcons.js +87 -26
  58. package/dist/icon/namedIcons.js.map +1 -1
  59. package/dist/icon-button/IconButton.js +70 -13
  60. package/dist/icon-button/IconButton.js.map +1 -1
  61. package/dist/index.d.ts +7 -2
  62. package/dist/index.d.ts.map +1 -1
  63. package/dist/index.js +7 -2
  64. package/dist/inline/Inline.js +65 -7
  65. package/dist/inline/Inline.js.map +1 -1
  66. package/dist/inline/tokens.js.map +1 -1
  67. package/dist/intl/usePanneauIntl.js.map +1 -1
  68. package/dist/layout/responsive.js.map +1 -1
  69. package/dist/locales/index.js.map +1 -1
  70. package/dist/menu/Menu.css +84 -0
  71. package/dist/menu/Menu.d.ts +33 -6
  72. package/dist/menu/Menu.d.ts.map +1 -1
  73. package/dist/menu/Menu.js +243 -32
  74. package/dist/menu/Menu.js.map +1 -1
  75. package/dist/menu/Menu.module.js +22 -0
  76. package/dist/menu/Menu.module.js.map +1 -0
  77. package/dist/menu/tokens.d.ts +3 -0
  78. package/dist/menu/tokens.d.ts.map +1 -0
  79. package/dist/menu/tokens.js +31 -0
  80. package/dist/menu/tokens.js.map +1 -0
  81. package/dist/number-input/NumberInput.css +18 -0
  82. package/dist/number-input/NumberInput.js +232 -60
  83. package/dist/number-input/NumberInput.js.map +1 -1
  84. package/dist/number-input/NumberInput.module.js +3 -1
  85. package/dist/number-input/NumberInput.module.js.map +1 -1
  86. package/dist/number-input/tokens.js.map +1 -1
  87. package/dist/pill-trigger/PillTrigger.css +104 -0
  88. package/dist/pill-trigger/PillTrigger.d.ts +20 -0
  89. package/dist/pill-trigger/PillTrigger.d.ts.map +1 -0
  90. package/dist/pill-trigger/PillTrigger.js +94 -0
  91. package/dist/pill-trigger/PillTrigger.js.map +1 -0
  92. package/dist/pill-trigger/PillTrigger.module.js +18 -0
  93. package/dist/pill-trigger/PillTrigger.module.js.map +1 -0
  94. package/dist/pill-trigger/tokens.d.ts +3 -0
  95. package/dist/pill-trigger/tokens.d.ts.map +1 -0
  96. package/dist/pill-trigger/tokens.js +37 -0
  97. package/dist/pill-trigger/tokens.js.map +1 -0
  98. package/dist/popover/Popover.js +109 -18
  99. package/dist/popover/Popover.js.map +1 -1
  100. package/dist/popover/tokens.js.map +1 -1
  101. package/dist/prose/Prose.js +36 -5
  102. package/dist/prose/Prose.js.map +1 -1
  103. package/dist/prose/tokens.js.map +1 -1
  104. package/dist/radio-group/RadioGroup.css +90 -0
  105. package/dist/radio-group/RadioGroup.d.ts +22 -3
  106. package/dist/radio-group/RadioGroup.d.ts.map +1 -1
  107. package/dist/radio-group/RadioGroup.js +214 -43
  108. package/dist/radio-group/RadioGroup.js.map +1 -1
  109. package/dist/radio-group/RadioGroup.module.js +12 -2
  110. package/dist/radio-group/RadioGroup.module.js.map +1 -1
  111. package/dist/radio-group/tokens.d.ts +2 -2
  112. package/dist/radio-group/tokens.d.ts.map +1 -1
  113. package/dist/radio-group/tokens.js +22 -2
  114. package/dist/radio-group/tokens.js.map +1 -1
  115. package/dist/root/PanneauRoot.js +197 -49
  116. package/dist/root/PanneauRoot.js.map +1 -1
  117. package/dist/root/ThemeScope.js +107 -26
  118. package/dist/root/ThemeScope.js.map +1 -1
  119. package/dist/segmented-control/SegmentedControl.js +120 -22
  120. package/dist/segmented-control/SegmentedControl.js.map +1 -1
  121. package/dist/segmented-control/tokens.js.map +1 -1
  122. package/dist/select/ListBox.css +15 -0
  123. package/dist/select/ListBox.module.js.map +1 -1
  124. package/dist/select/Select.js +298 -92
  125. package/dist/select/Select.js.map +1 -1
  126. package/dist/select/listBoxTokens.js.map +1 -1
  127. package/dist/skeleton/LoadingRegion.d.ts +16 -0
  128. package/dist/skeleton/LoadingRegion.d.ts.map +1 -0
  129. package/dist/skeleton/LoadingRegion.js +65 -0
  130. package/dist/skeleton/LoadingRegion.js.map +1 -0
  131. package/dist/skeleton/Skeleton.css +62 -0
  132. package/dist/skeleton/Skeleton.d.ts +25 -0
  133. package/dist/skeleton/Skeleton.d.ts.map +1 -0
  134. package/dist/skeleton/Skeleton.js +106 -0
  135. package/dist/skeleton/Skeleton.js.map +1 -0
  136. package/dist/skeleton/Skeleton.module.js +22 -0
  137. package/dist/skeleton/Skeleton.module.js.map +1 -0
  138. package/dist/skeleton/tokens.d.ts +3 -0
  139. package/dist/skeleton/tokens.d.ts.map +1 -0
  140. package/dist/skeleton/tokens.js +15 -0
  141. package/dist/skeleton/tokens.js.map +1 -0
  142. package/dist/slider/Slider.css +84 -0
  143. package/dist/slider/Slider.d.ts +20 -0
  144. package/dist/slider/Slider.d.ts.map +1 -0
  145. package/dist/slider/Slider.js +248 -0
  146. package/dist/slider/Slider.js.map +1 -0
  147. package/dist/slider/Slider.module.js +20 -0
  148. package/dist/slider/Slider.module.js.map +1 -0
  149. package/dist/spinner/Spinner.js +49 -9
  150. package/dist/spinner/Spinner.js.map +1 -1
  151. package/dist/spinner/tokens.js.map +1 -1
  152. package/dist/stack/Stack.js +60 -7
  153. package/dist/stack/Stack.js.map +1 -1
  154. package/dist/stack/tokens.js.map +1 -1
  155. package/dist/switch/Switch.js +68 -11
  156. package/dist/switch/Switch.js.map +1 -1
  157. package/dist/switch/tokens.js.map +1 -1
  158. package/dist/tabs/Tabs.js +1 -1
  159. package/dist/tabs/Tabs.js.map +1 -1
  160. package/dist/tabs/tokens.js.map +1 -1
  161. package/dist/tags-input/TagsInput.css +60 -0
  162. package/dist/tags-input/TagsInput.d.ts +32 -0
  163. package/dist/tags-input/TagsInput.d.ts.map +1 -0
  164. package/dist/tags-input/TagsInput.js +316 -0
  165. package/dist/tags-input/TagsInput.js.map +1 -0
  166. package/dist/tags-input/TagsInput.module.js +20 -0
  167. package/dist/tags-input/TagsInput.module.js.map +1 -0
  168. package/dist/text/Text.js +70 -5
  169. package/dist/text/Text.js.map +1 -1
  170. package/dist/text/tokens.js.map +1 -1
  171. package/dist/text-area/TextArea.js +135 -28
  172. package/dist/text-area/TextArea.js.map +1 -1
  173. package/dist/text-input/TextInput.js +164 -49
  174. package/dist/text-input/TextInput.js.map +1 -1
  175. package/dist/theme/bootstrap.js.map +1 -1
  176. package/dist/theme/chartColors.js.map +1 -1
  177. package/dist/theme/checkTheme.js.map +1 -1
  178. package/dist/theme/cli.js.map +1 -1
  179. package/dist/theme/color.js.map +1 -1
  180. package/dist/theme/colorVision.js.map +1 -1
  181. package/dist/theme/componentTokens.js.map +1 -1
  182. package/dist/theme/components.d.ts +4 -1
  183. package/dist/theme/components.d.ts.map +1 -1
  184. package/dist/theme/components.js +6 -0
  185. package/dist/theme/components.js.map +1 -1
  186. package/dist/theme/defineTheme.js.map +1 -1
  187. package/dist/theme/fonts.js.map +1 -1
  188. package/dist/theme/semanticTokens.js.map +1 -1
  189. package/dist/theme/theme.js.map +1 -1
  190. package/dist/theme/toneClass.js.map +1 -1
  191. package/dist/theme/tones.js.map +1 -1
  192. package/dist/time-input/TimeInput.js +138 -31
  193. package/dist/time-input/TimeInput.js.map +1 -1
  194. package/dist/toast/Toast.js +1 -1
  195. package/dist/toast/Toast.js.map +1 -1
  196. package/dist/toast/tokens.js.map +1 -1
  197. package/dist/tooltip/Tooltip.js +38 -8
  198. package/dist/tooltip/Tooltip.js.map +1 -1
  199. package/dist/tooltip/tokens.js.map +1 -1
  200. package/dist/utils/cx.js.map +1 -1
  201. package/package.json +3 -3
@@ -1 +1 @@
1
- {"version":3,"file":"Divider.js","names":["styles"],"sources":["../../src/divider/Divider.tsx"],"sourcesContent":["import type { HTMLAttributes } from 'react';\n\nimport { cx } from '../utils/cx';\nimport styles from './Divider.module.css';\n\nexport interface DividerProps extends HTMLAttributes<HTMLElement> {\n /** `vertical` separates items of a row. Defaults to `horizontal`. */\n orientation?: 'horizontal' | 'vertical';\n}\n\n/** A line between groups of content: an `hr`, or a vertical separator in a row. */\nexport function Divider({ orientation = 'horizontal', className, ...props }: DividerProps) {\n if (orientation === 'vertical') {\n return (\n <div\n role=\"separator\"\n aria-orientation=\"vertical\"\n {...props}\n className={cx('panneau-divider', styles.divider, styles.vertical, className)}\n />\n );\n }\n return <hr {...props} className={cx('panneau-divider', styles.divider, className)} />;\n}\n"],"mappings":";;;;;AAWA,SAAgB,QAAQ,EAAE,cAAc,cAAc,WAAW,GAAG,SAAuB;CACvF,IAAI,gBAAgB,YAChB,OACI,oBAAC,OAAD;EACI,MAAK;EACL,oBAAiB;EACjB,GAAI;EACJ,WAAW,GAAG,mBAAmBA,uBAAO,SAASA,uBAAO,UAAU,SAAS;CAAE,CAAA;CAIzF,OAAO,oBAAC,MAAD;EAAI,GAAI;EAAO,WAAW,GAAG,mBAAmBA,uBAAO,SAAS,SAAS;CAAE,CAAA;AACtF"}
1
+ {"version":3,"file":"Divider.js","names":["HTMLAttributes","cx","styles","DividerProps","HTMLElement","orientation","Divider","t0","$","_c","className","props","t1","undefined","t2","divider","vertical","t3","_c","styles"],"sources":["../../src/divider/Divider.tsx"],"sourcesContent":["import type { HTMLAttributes } from 'react';\n\nimport { cx } from '../utils/cx';\nimport styles from './Divider.module.css';\n\nexport interface DividerProps extends HTMLAttributes<HTMLElement> {\n /** `vertical` separates items of a row. Defaults to `horizontal`. */\n orientation?: 'horizontal' | 'vertical';\n}\n\n/** A line between groups of content: an `hr`, or a vertical separator in a row. */\nexport function Divider({ orientation = 'horizontal', className, ...props }: DividerProps) {\n if (orientation === 'vertical') {\n return (\n <div\n role=\"separator\"\n aria-orientation=\"vertical\"\n {...props}\n className={cx('panneau-divider', styles.divider, styles.vertical, className)}\n />\n );\n }\n return <hr {...props} className={cx('panneau-divider', styles.divider, className)} />;\n}\n"],"mappings":";;;;;;AAWA,SAAOM,QAAAC,IAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAJ,EAAA,OAAAD,IAAA;EAAiB,CAAA,CAAAF,aAAAO,IAAAF,WAAA,GAAAC,SAAAJ;EAAiEC,EAAA,KAAAD;EAAAC,EAAA,KAAAE;EAAAF,EAAA,KAAAG;EAAAH,EAAA,KAAAI;CAAA,OAAA;EAAAF,YAAAF,EAAA;EAAAG,QAAAH,EAAA;EAAAI,KAAAJ,EAAA;CAAA;CACrF,KADsBI,OAAAC,KAAAA,IAAA,eAAAD,QACF,YAAU;EAAA,IAAAE;EAAA,IAAAN,EAAA,OAAAE,WAAA;GAMPI,KAAAb,GAAG,mBAAmBC,uBAAMa,SAAUb,uBAAMc,UAAWN,SAAS;GAACF,EAAA,KAAAE;GAAAF,EAAA,KAAAM;EAAA,OAAAA,KAAAN,EAAA;EAAA,IAAAS;EAAA,IAAAT,EAAA,OAAAG,SAAAH,EAAA,OAAAM,IAAA;GAJhFG,KAAA,oBAAA,OAAA;IACS,MAAA;IACY,oBAAA;IAAU,GACvBN;IACO,WAAAG;GAAiE,CAAA;GAC9EN,EAAA,KAAAG;GAAAH,EAAA,KAAAM;GAAAN,EAAA,KAAAS;EAAA,OAAAA,KAAAT,EAAA;EAAA,OALFS;CAKE;CAET,IAAAH;CAAA,IAAAN,EAAA,OAAAE,WAAA;EACgCI,KAAAb,GAAG,mBAAmBC,uBAAMa,SAAUL,SAAS;EAACF,EAAA,KAAAE;EAAAF,EAAA,MAAAM;CAAA,OAAAA,KAAAN,EAAA;CAAA,IAAAS;CAAA,IAAAT,EAAA,QAAAG,SAAAH,EAAA,QAAAM,IAAA;EAA1EG,KAAA,oBAAA,MAAA;GAA8E,GAAtEN;GAAkB,WAAAG;EAAgD,CAAA;EAAIN,EAAA,MAAAG;EAAAH,EAAA,MAAAM;EAAAN,EAAA,MAAAS;CAAA,OAAAA,KAAAT,EAAA;CAAA,OAA9ES;AAA8E"}
@@ -1 +1 @@
1
- {"version":3,"file":"tokens.js","names":[],"sources":["../../src/divider/tokens.ts"],"sourcesContent":["import { defineComponentTokens } from '../theme/componentTokens';\n\n/** Tokens of Divider. */\nexport const dividerTokens = defineComponentTokens('divider', {\n /** Color of the line. */\n color: 'var(--panneau-color-border)',\n /** Thickness of the line. */\n width: 'var(--panneau-border-width)',\n});\n"],"mappings":";;;AAGA,IAAa,gBAAgB,sBAAsB,WAAW;;CAE1D,OAAO;;CAEP,OAAO;AACX,CAAC"}
1
+ {"version":3,"file":"tokens.js","names":["defineComponentTokens","dividerTokens","color","width"],"sources":["../../src/divider/tokens.ts"],"sourcesContent":["import { defineComponentTokens } from '../theme/componentTokens';\n\n/** Tokens of Divider. */\nexport const dividerTokens = defineComponentTokens('divider', {\n /** Color of the line. */\n color: 'var(--panneau-color-border)',\n /** Thickness of the line. */\n width: 'var(--panneau-border-width)',\n});\n"],"mappings":";;;AAGA,IAAaC,gBAAgBD,sBAAsB,WAAW;;CAE1DE,OAAO;;CAEPC,OAAO;AACX,CAAC"}
@@ -1,20 +1,43 @@
1
1
  import { cx } from "../utils/cx.js";
2
2
  import Field_module_default from "./Field.module.js";
3
+ import { c } from "react/compiler-runtime";
3
4
  import { FieldError, Label, Text } from "react-aria-components";
4
5
  import { jsx, jsxs } from "react/jsx-runtime";
5
6
  import { Fragment as Fragment$1 } from "react";
6
- import { c } from "react/compiler-runtime";
7
7
  //#region src/field/FieldParts.tsx
8
- function FieldLabel({ children, isRequired = false, className }) {
8
+ function FieldLabel(t0) {
9
+ const $ = c(8);
10
+ const { children, isRequired: t1, className } = t0;
11
+ const isRequired = t1 === void 0 ? false : t1;
9
12
  if (children === void 0 || children === null) return null;
10
- return /* @__PURE__ */ jsxs(Label, {
11
- className: cx(Field_module_default.label, className),
12
- children: [children, isRequired ? /* @__PURE__ */ jsx("span", {
13
+ let t2;
14
+ if ($[0] !== className) {
15
+ t2 = cx(Field_module_default.label, className);
16
+ $[0] = className;
17
+ $[1] = t2;
18
+ } else t2 = $[1];
19
+ let t3;
20
+ if ($[2] !== isRequired) {
21
+ t3 = isRequired ? /* @__PURE__ */ jsx("span", {
13
22
  className: Field_module_default.required,
14
23
  "aria-hidden": "true",
15
24
  children: "*"
16
- }) : null]
17
- });
25
+ }) : null;
26
+ $[2] = isRequired;
27
+ $[3] = t3;
28
+ } else t3 = $[3];
29
+ let t4;
30
+ if ($[4] !== children || $[5] !== t2 || $[6] !== t3) {
31
+ t4 = /* @__PURE__ */ jsxs(Label, {
32
+ className: t2,
33
+ children: [children, t3]
34
+ });
35
+ $[4] = children;
36
+ $[5] = t2;
37
+ $[6] = t3;
38
+ $[7] = t4;
39
+ } else t4 = $[7];
40
+ return t4;
18
41
  }
19
42
  function FieldDescription(t0) {
20
43
  const $ = c(5);
@@ -40,15 +63,46 @@ function FieldDescription(t0) {
40
63
  return t2;
41
64
  }
42
65
  /** Error messages of a React Aria field. They show when the field is invalid. */
43
- function FieldErrors({ errors = [], className }) {
66
+ function FieldErrors(t0) {
67
+ const $ = c(9);
68
+ const { errors: t1, className } = t0;
69
+ let t2;
70
+ if ($[0] !== t1) {
71
+ t2 = t1 === void 0 ? [] : t1;
72
+ $[0] = t1;
73
+ $[1] = t2;
74
+ } else t2 = $[1];
75
+ const errors = t2;
44
76
  if (errors.length === 0) return null;
45
- return /* @__PURE__ */ jsx(FieldError, {
46
- className: cx(Field_module_default.errors, className),
47
- children: errors.map((error, index) => /* @__PURE__ */ jsxs(Fragment$1, { children: [index > 0 ? " " : null, /* @__PURE__ */ jsx("span", {
48
- className: Field_module_default.error,
49
- children: error
50
- })] }, index))
51
- });
77
+ let t3;
78
+ if ($[2] !== className) {
79
+ t3 = cx(Field_module_default.errors, className);
80
+ $[2] = className;
81
+ $[3] = t3;
82
+ } else t3 = $[3];
83
+ let t4;
84
+ if ($[4] !== errors) {
85
+ t4 = errors.map(_temp);
86
+ $[4] = errors;
87
+ $[5] = t4;
88
+ } else t4 = $[5];
89
+ let t5;
90
+ if ($[6] !== t3 || $[7] !== t4) {
91
+ t5 = /* @__PURE__ */ jsx(FieldError, {
92
+ className: t3,
93
+ children: t4
94
+ });
95
+ $[6] = t3;
96
+ $[7] = t4;
97
+ $[8] = t5;
98
+ } else t5 = $[8];
99
+ return t5;
100
+ }
101
+ function _temp(error, index) {
102
+ return /* @__PURE__ */ jsxs(Fragment$1, { children: [index > 0 ? " " : null, /* @__PURE__ */ jsx("span", {
103
+ className: Field_module_default.error,
104
+ children: error
105
+ })] }, index);
52
106
  }
53
107
  //#endregion
54
108
  export { FieldDescription, FieldErrors, FieldLabel, Field_module_default as fieldStyles };
@@ -1 +1 @@
1
- {"version":3,"file":"FieldParts.js","names":["children","styles","_c","Fragment"],"sources":["../../src/field/FieldParts.tsx"],"sourcesContent":["import { Fragment, type ReactNode } from 'react';\nimport { FieldError, Label, Text } from 'react-aria-components';\n\nimport { cx } from '../utils/cx';\nimport styles from './Field.module.css';\n\n/** Props that every labelled control of `@panneau/ui` accepts. */\nexport interface FieldChromeProps {\n /** Visible label. Without one, pass `aria-label`. */\n label?: ReactNode;\n /** Help text under the control. */\n description?: ReactNode;\n /** Error messages. Any message makes the control invalid. */\n errors?: readonly string[];\n /** Class name of the outer element. */\n className?: string;\n labelClassName?: string;\n descriptionClassName?: string;\n errorsClassName?: string;\n}\n\nexport function FieldLabel({\n children,\n isRequired = false,\n className,\n}: {\n children?: ReactNode;\n isRequired?: boolean;\n className?: string | undefined;\n}) {\n if (children === undefined || children === null) {\n return null;\n }\n return (\n <Label className={cx(styles.label, className)}>\n {children}\n {isRequired ? (\n <span className={styles.required} aria-hidden=\"true\">\n *\n </span>\n ) : null}\n </Label>\n );\n}\n\nexport function FieldDescription({\n children,\n className,\n}: {\n children?: ReactNode;\n className?: string | undefined;\n}) {\n if (children === undefined || children === null) {\n return null;\n }\n return (\n <Text slot=\"description\" className={cx(styles.description, className)}>\n {children}\n </Text>\n );\n}\n\n/** Error messages of a React Aria field. They show when the field is invalid. */\nexport function FieldErrors({\n errors = [],\n className,\n}: {\n errors?: readonly string[] | undefined;\n className?: string | undefined;\n}) {\n if (errors.length === 0) {\n return null;\n }\n return (\n <FieldError className={cx(styles.errors, className)}>\n {errors.map((error, index) => (\n <Fragment key={index}>\n {/* A space between messages, for assistive technologies. */}\n {index > 0 ? ' ' : null}\n <span className={styles.error}>{error}</span>\n </Fragment>\n ))}\n </FieldError>\n );\n}\n\nexport { styles as fieldStyles };\n"],"mappings":";;;;;;;AAqBA,SAAgB,WAAW,EACvB,UACA,aAAa,OACb,aAKD;CACC,IAAI,aAAa,KAAA,KAAa,aAAa,MACvC,OAAO;CAEX,OACI,qBAAC,OAAD;EAAO,WAAW,GAAGC,qBAAO,OAAO,SAAS;EAA5C,UAAA,CACK,UACA,aACG,oBAAC,QAAD;GAAM,WAAWA,qBAAO;GAAU,eAAY;GAAM,UAAA;EAE9C,CAAA,IACN,IACD;;AAEf;AAEA,SAAO,iBAAA,IAAA;CAAA,MAAA,IAAAC,EAAA,CAAA;CAA0B,MAAA,EAAA,UAAA,cAAA;CAO7B,IAAI,aAAa,KAAA,KAAa,aAAa,MAAI,OACpC;CACV,IAAA;CAAA,IAAA,EAAA,OAAA,WAAA;EAEuC,KAAA,GAAGD,qBAAM,aAAc,SAAS;EAAC,EAAA,KAAA;EAAA,EAAA,KAAA;CAAA,OAAA,KAAA,EAAA;CAAA,IAAA;CAAA,IAAA,EAAA,OAAA,YAAA,EAAA,OAAA,IAAA;EAArE,KAAA,oBAAC,MAAD;GAAW,MAAA;GAAyB,WAAA;GAC/B;EADA,CAAA;EAEE,EAAA,KAAA;EAAA,EAAA,KAAA;EAAA,EAAA,KAAA;CAAA,OAAA,KAAA,EAAA;CAAA,OAFP;AAEO;;AAKf,SAAgB,YAAY,EACxB,SAAS,CAAA,GACT,aAID;CACC,IAAI,OAAO,WAAW,GAClB,OAAO;CAEX,OACI,oBAAC,YAAD;EAAY,WAAW,GAAGA,qBAAO,QAAQ,SAAS;EAC7C,UAAA,OAAO,KAAK,OAAO,UAChB,qBAACE,YAAD,EAAA,UAAA,CAEK,QAAQ,IAAI,MAAM,MACnB,oBAAC,QAAD;GAAM,WAAWF,qBAAO;GAAQ,UAAA;EAAY,CAAA,CACtC,EAAA,GAJK,KAIL,CACb;CACO,CAAA;AAEpB"}
1
+ {"version":3,"file":"FieldParts.js","names":["Fragment","ReactNode","FieldError","Label","Text","cx","styles","FieldChromeProps","label","description","errors","className","labelClassName","descriptionClassName","errorsClassName","FieldLabel","t0","$","_c","children","isRequired","t1","undefined","t2","t3","required","t4","FieldDescription","FieldErrors","length","map","_temp","t5","error","index","fieldStyles","_c","styles","Fragment"],"sources":["../../src/field/FieldParts.tsx"],"sourcesContent":["import { Fragment, type ReactNode } from 'react';\nimport { FieldError, Label, Text } from 'react-aria-components';\n\nimport { cx } from '../utils/cx';\nimport styles from './Field.module.css';\n\n/** Props that every labelled control of `@panneau/ui` accepts. */\nexport interface FieldChromeProps {\n /** Visible label. Without one, pass `aria-label`. */\n label?: ReactNode;\n /** Help text under the control. */\n description?: ReactNode;\n /** Error messages. Any message makes the control invalid. */\n errors?: readonly string[];\n /** Class name of the outer element. */\n className?: string;\n labelClassName?: string;\n descriptionClassName?: string;\n errorsClassName?: string;\n}\n\nexport function FieldLabel({\n children,\n isRequired = false,\n className,\n}: {\n children?: ReactNode;\n isRequired?: boolean;\n className?: string | undefined;\n}) {\n if (children === undefined || children === null) {\n return null;\n }\n return (\n <Label className={cx(styles.label, className)}>\n {children}\n {isRequired ? (\n <span className={styles.required} aria-hidden=\"true\">\n *\n </span>\n ) : null}\n </Label>\n );\n}\n\nexport function FieldDescription({\n children,\n className,\n}: {\n children?: ReactNode;\n className?: string | undefined;\n}) {\n if (children === undefined || children === null) {\n return null;\n }\n return (\n <Text slot=\"description\" className={cx(styles.description, className)}>\n {children}\n </Text>\n );\n}\n\n/** Error messages of a React Aria field. They show when the field is invalid. */\nexport function FieldErrors({\n errors = [],\n className,\n}: {\n errors?: readonly string[] | undefined;\n className?: string | undefined;\n}) {\n if (errors.length === 0) {\n return null;\n }\n return (\n <FieldError className={cx(styles.errors, className)}>\n {errors.map((error, index) => (\n <Fragment key={index}>\n {/* A space between messages, for assistive technologies. */}\n {index > 0 ? ' ' : null}\n <span className={styles.error}>{error}</span>\n </Fragment>\n ))}\n </FieldError>\n );\n}\n\nexport { styles as fieldStyles };\n"],"mappings":";;;;;;;AAqBA,SAAOe,WAAAC,IAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CAAoB,MAAA,EAAAC,UAAAC,YAAAC,IAAAV,cAAAK;CAEvB,MAAAI,aAAAC,OAAAC,KAAAA,IAAA,QAAAD;CAOA,IAAIF,aAAaG,KAAAA,KAAaH,aAAa,MAAI,OACpC;CACV,IAAAI;CAAA,IAAAN,EAAA,OAAAN,WAAA;EAEqBY,KAAAlB,GAAGC,qBAAME,OAAQG,SAAS;EAACM,EAAA,KAAAN;EAAAM,EAAA,KAAAM;CAAA,OAAAA,KAAAN,EAAA;CAAA,IAAAO;CAAA,IAAAP,EAAA,OAAAG,YAAA;EAExCI,KAAAJ,aACG,oBAAA,QAAA;GAAiB,WAAAd,qBAAMmB;GAAuB,eAAA;GAAO,UAAA;EAE9C,CAAA,IAHV;EAIOR,EAAA,KAAAG;EAAAH,EAAA,KAAAO;CAAA,OAAAA,KAAAP,EAAA;CAAA,IAAAS;CAAA,IAAAT,EAAA,OAAAE,YAAAF,EAAA,OAAAM,MAAAN,EAAA,OAAAO,IAAA;EANZE,KAAA,qBAAC,OAAD;G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A,IAAAT,EAAA,OAAAP,QAAA;EAC9CgB,KAAAhB,OAAMoB,IAAKC,KAMX;EAACd,EAAA,KAAAP;EAAAO,EAAA,KAAAS;CAAA,OAAAA,KAAAT,EAAA;CAAA,IAAAe;CAAA,IAAAf,EAAA,OAAAO,MAAAP,EAAA,OAAAS,IAAA;EAPNM,KAAA,oBAAC,YAAD;GAAuB,WAAAR;GAClBE,UAAAA;EADM,CAAA;EAQET,EAAA,KAAAO;EAAAP,EAAA,KAAAS;EAAAT,EAAA,KAAAe;CAAA,OAAAA,KAAAf,EAAA;CAAA,OARbe;AAQa;AAnBd,SAAAD,MAAAE,OAAAC,OAAA;CAAA,OAaS,qBAACI,YAAD,EAAA,UAAA,CAEKJ,QAAQ,IAAR,MAAA,MACD,oBAAA,QAAA;EAAiB,WAAA5B,qBAAM2B;EAASA,UAAAA;CAAa,CAAA,CAHxC,EAAA,GAAMC,KAAN;AAIE"}
@@ -1,5 +1,6 @@
1
1
  import { cx } from "../utils/cx.js";
2
2
  import Field_module_default from "./Field.module.js";
3
+ import { c } from "react/compiler-runtime";
3
4
  import { jsx, jsxs } from "react/jsx-runtime";
4
5
  import { Fragment as Fragment$1, useId } from "react";
5
6
  //#region src/field/Fieldset.tsx
@@ -8,41 +9,107 @@ import { Fragment as Fragment$1, useId } from "react";
8
9
  * (a group of fields, a list of blocks, a value per locale). The description and the errors
9
10
  * describe the group for assistive technologies.
10
11
  */
11
- function Fieldset({ legend, description, errors = [], isRequired = false, isDisabled = false, children, className, legendClassName, descriptionClassName, errorsClassName }) {
12
+ function Fieldset(t0) {
13
+ const $ = c(28);
14
+ const { legend, description, errors: t1, isRequired: t2, isDisabled: t3, children, className, legendClassName, descriptionClassName, errorsClassName } = t0;
15
+ let t4;
16
+ if ($[0] !== t1) {
17
+ t4 = t1 === void 0 ? [] : t1;
18
+ $[0] = t1;
19
+ $[1] = t4;
20
+ } else t4 = $[1];
21
+ const errors = t4;
22
+ const isRequired = t2 === void 0 ? false : t2;
23
+ const isDisabled = t3 === void 0 ? false : t3;
12
24
  const id = useId();
13
25
  const descriptionId = description !== void 0 ? `${id}-description` : null;
14
26
  const errorsId = errors.length > 0 ? `${id}-errors` : null;
15
- const describedBy = [descriptionId, errorsId].filter(Boolean).join(" ");
16
- return /* @__PURE__ */ jsxs("fieldset", {
17
- className: cx("panneau-fieldset", Field_module_default.fieldset, className),
18
- "aria-describedby": describedBy !== "" ? describedBy : void 0,
19
- "aria-invalid": errors.length > 0 ? true : void 0,
20
- disabled: isDisabled,
21
- children: [
22
- legend !== void 0 && legend !== null ? /* @__PURE__ */ jsxs("legend", {
23
- className: cx(Field_module_default.legend, Field_module_default.label, legendClassName),
24
- children: [legend, isRequired ? /* @__PURE__ */ jsx("span", {
25
- className: Field_module_default.required,
26
- "aria-hidden": "true",
27
- children: "*"
28
- }) : null]
29
- }) : null,
30
- descriptionId !== null ? /* @__PURE__ */ jsx("div", {
31
- id: descriptionId,
32
- className: cx(Field_module_default.description, descriptionClassName),
33
- children: description
34
- }) : null,
35
- children,
36
- errorsId !== null ? /* @__PURE__ */ jsx("div", {
37
- id: errorsId,
38
- className: cx(Field_module_default.errors, errorsClassName),
39
- children: errors.map((error, index) => /* @__PURE__ */ jsxs(Fragment$1, { children: [index > 0 ? " " : null, /* @__PURE__ */ jsx("span", {
40
- className: Field_module_default.error,
41
- children: error
42
- })] }, index))
43
- }) : null
44
- ]
45
- });
27
+ let t5;
28
+ if ($[2] !== descriptionId || $[3] !== errorsId) {
29
+ t5 = [descriptionId, errorsId].filter(Boolean);
30
+ $[2] = descriptionId;
31
+ $[3] = errorsId;
32
+ $[4] = t5;
33
+ } else t5 = $[4];
34
+ const describedBy = t5.join(" ");
35
+ let t6;
36
+ if ($[5] !== className) {
37
+ t6 = cx("panneau-fieldset", Field_module_default.fieldset, className);
38
+ $[5] = className;
39
+ $[6] = t6;
40
+ } else t6 = $[6];
41
+ const t7 = describedBy !== "" ? describedBy : void 0;
42
+ const t8 = errors.length > 0 ? true : void 0;
43
+ let t9;
44
+ if ($[7] !== isRequired || $[8] !== legend || $[9] !== legendClassName) {
45
+ t9 = legend !== void 0 && legend !== null ? /* @__PURE__ */ jsxs("legend", {
46
+ className: cx(Field_module_default.legend, Field_module_default.label, legendClassName),
47
+ children: [legend, isRequired ? /* @__PURE__ */ jsx("span", {
48
+ className: Field_module_default.required,
49
+ "aria-hidden": "true",
50
+ children: "*"
51
+ }) : null]
52
+ }) : null;
53
+ $[7] = isRequired;
54
+ $[8] = legend;
55
+ $[9] = legendClassName;
56
+ $[10] = t9;
57
+ } else t9 = $[10];
58
+ let t10;
59
+ if ($[11] !== description || $[12] !== descriptionClassName || $[13] !== descriptionId) {
60
+ t10 = descriptionId !== null ? /* @__PURE__ */ jsx("div", {
61
+ id: descriptionId,
62
+ className: cx(Field_module_default.description, descriptionClassName),
63
+ children: description
64
+ }) : null;
65
+ $[11] = description;
66
+ $[12] = descriptionClassName;
67
+ $[13] = descriptionId;
68
+ $[14] = t10;
69
+ } else t10 = $[14];
70
+ let t11;
71
+ if ($[15] !== errors || $[16] !== errorsClassName || $[17] !== errorsId) {
72
+ t11 = errorsId !== null ? /* @__PURE__ */ jsx("div", {
73
+ id: errorsId,
74
+ className: cx(Field_module_default.errors, errorsClassName),
75
+ children: errors.map(_temp)
76
+ }) : null;
77
+ $[15] = errors;
78
+ $[16] = errorsClassName;
79
+ $[17] = errorsId;
80
+ $[18] = t11;
81
+ } else t11 = $[18];
82
+ let t12;
83
+ if ($[19] !== children || $[20] !== isDisabled || $[21] !== t10 || $[22] !== t11 || $[23] !== t6 || $[24] !== t7 || $[25] !== t8 || $[26] !== t9) {
84
+ t12 = /* @__PURE__ */ jsxs("fieldset", {
85
+ className: t6,
86
+ "aria-describedby": t7,
87
+ "aria-invalid": t8,
88
+ disabled: isDisabled,
89
+ children: [
90
+ t9,
91
+ t10,
92
+ children,
93
+ t11
94
+ ]
95
+ });
96
+ $[19] = children;
97
+ $[20] = isDisabled;
98
+ $[21] = t10;
99
+ $[22] = t11;
100
+ $[23] = t6;
101
+ $[24] = t7;
102
+ $[25] = t8;
103
+ $[26] = t9;
104
+ $[27] = t12;
105
+ } else t12 = $[27];
106
+ return t12;
107
+ }
108
+ function _temp(error, index) {
109
+ return /* @__PURE__ */ jsxs(Fragment$1, { children: [index > 0 ? " " : null, /* @__PURE__ */ jsx("span", {
110
+ className: Field_module_default.error,
111
+ children: error
112
+ })] }, index);
46
113
  }
47
114
  //#endregion
48
115
  export { Fieldset };
@@ -1 +1 @@
1
- {"version":3,"file":"Fieldset.js","names":["styles","Fragment"],"sources":["../../src/field/Fieldset.tsx"],"sourcesContent":["import { Fragment, type ReactNode, useId } from 'react';\n\nimport { cx } from '../utils/cx';\nimport styles from './Field.module.css';\n\nexport interface FieldsetProps {\n /** Title of the group of controls. */\n legend?: ReactNode;\n description?: ReactNode;\n /** Errors of the group as a whole. */\n errors?: readonly string[];\n isRequired?: boolean;\n isDisabled?: boolean;\n children?: ReactNode;\n className?: string;\n legendClassName?: string;\n descriptionClassName?: string;\n errorsClassName?: string;\n}\n\n/**\n * Groups related controls under a legend, with a description and errors: for composite values\n * (a group of fields, a list of blocks, a value per locale). The description and the errors\n * describe the group for assistive technologies.\n */\nexport function Fieldset({\n legend,\n description,\n errors = [],\n isRequired = false,\n isDisabled = false,\n children,\n className,\n legendClassName,\n descriptionClassName,\n errorsClassName,\n}: FieldsetProps) {\n const id = useId();\n const descriptionId = description !== undefined ? `${id}-description` : null;\n const errorsId = errors.length > 0 ? `${id}-errors` : null;\n const describedBy = [descriptionId, errorsId].filter(Boolean).join(' ');\n return (\n <fieldset\n className={cx('panneau-fieldset', styles.fieldset, className)}\n aria-describedby={describedBy !== '' ? describedBy : undefined}\n aria-invalid={errors.length > 0 ? true : undefined}\n disabled={isDisabled}\n >\n {legend !== undefined && legend !== null ? (\n <legend className={cx(styles.legend, styles.label, legendClassName)}>\n {legend}\n {isRequired ? (\n <span className={styles.required} aria-hidden=\"true\">\n *\n </span>\n ) : null}\n </legend>\n ) : null}\n {descriptionId !== null ? (\n <div id={descriptionId} className={cx(styles.description, descriptionClassName)}>\n {description}\n </div>\n ) : null}\n {children}\n {errorsId !== null ? (\n <div id={errorsId} className={cx(styles.errors, errorsClassName)}>\n {errors.map((error, index) => (\n <Fragment key={index}>\n {/* A space between messages, for assistive technologies. */}\n {index > 0 ? ' ' : null}\n <span className={styles.error}>{error}</span>\n </Fragment>\n ))}\n </div>\n ) : null}\n </fieldset>\n );\n}\n"],"mappings":";;;;;;;;;;AAyBA,SAAgB,SAAS,EACrB,QACA,aACA,SAAS,CAAA,GACT,aAAa,OACb,aAAa,OACb,UACA,WACA,iBACA,sBACA,mBACc;CACd,MAAM,KAAK,MAAM;CACjB,MAAM,gBAAgB,gBAAgB,KAAA,IAAY,GAAG,GAAE,gBAAiB;CACxE,MAAM,WAAW,OAAO,SAAS,IAAI,GAAG,GAAE,WAAY;CACtD,MAAM,cAAc,CAAC,eAAe,QAAQ,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG;CACtE,OACI,qBAAC,YAAD;EACI,WAAW,GAAG,oBAAoBA,qBAAO,UAAU,SAAS;EAC5D,oBAAkB,gBAAgB,KAAK,cAAc,KAAA;EACrD,gBAAc,OAAO,SAAS,IAAI,OAAO,KAAA;EACzC,UAAU;EAJd,UAAA;GAMK,WAAW,KAAA,KAAa,WAAW,OAChC,qBAAC,UAAD;IAAQ,WAAW,GAAGA,qBAAO,QAAQA,qBAAO,OAAO,eAAe;IAAlE,UAAA,CACK,QACA,aACG,oBAAC,QAAD;KAAM,WAAWA,qBAAO;KAAU,eAAY;KAAM,UAAA;IAE9C,CAAA,IACN,IACA;GACR,CAAA,IAAA;GACH,kBAAkB,OACf,oBAAC,OAAD;IAAK,IAAI;IAAe,WAAW,GAAGA,qBAAO,aAAa,oBAAoB;IACzE,UAAA;GACA,CAAA,IACL;GACH;GACA,aAAa,OACV,oBAAC,OAAD;IAAK,IAAI;IAAU,WAAW,GAAGA,qBAAO,QAAQ,eAAe;IAC1D,UAAA,OAAO,KAAK,OAAO,UAChB,qBAACC,YAAD,EAAA,UAAA,CAEK,QAAQ,IAAI,MAAM,MACnB,oBAAC,QAAD;KAAM,WAAWD,qBAAO;KAAQ,UAAA;IAAY,CAAA,CACtC,EAAA,GAJK,KAIL,CACb;GACA,CAAA,IACL;EACE;;AAElB"}
1
+ {"version":3,"file":"Fieldset.js","names":["Fragment","ReactNode","useId","cx","styles","FieldsetProps","legend","description","errors","isRequired","isDisabled","children","className","legendClassName","descriptionClassName","errorsClassName","Fieldset","t0","$","_c","t1","t2","t3","t4","undefined","id","descriptionId","errorsId","length","t5","filter","Boolean","describedBy","join","t6","fieldset","t7","t8","t9","label","required","t10","t11","map","_temp","t12","error","index","_c","styles","Fragment"],"sources":["../../src/field/Fieldset.tsx"],"sourcesContent":["import { Fragment, type ReactNode, useId } from 'react';\n\nimport { cx } from '../utils/cx';\nimport styles from './Field.module.css';\n\nexport interface FieldsetProps {\n /** Title of the group of controls. */\n legend?: ReactNode;\n description?: ReactNode;\n /** Errors of the group as a whole. */\n errors?: readonly string[];\n isRequired?: boolean;\n isDisabled?: boolean;\n children?: ReactNode;\n className?: string;\n legendClassName?: string;\n descriptionClassName?: string;\n errorsClassName?: string;\n}\n\n/**\n * Groups related controls under a legend, with a description and errors: for composite values\n * (a group of fields, a list of blocks, a value per locale). The description and the errors\n * describe the group for assistive technologies.\n */\nexport function Fieldset({\n legend,\n description,\n errors = [],\n isRequired = false,\n isDisabled = false,\n children,\n className,\n legendClassName,\n descriptionClassName,\n errorsClassName,\n}: FieldsetProps) {\n const id = useId();\n const descriptionId = description !== undefined ? `${id}-description` : null;\n const errorsId = errors.length > 0 ? `${id}-errors` : null;\n const describedBy = [descriptionId, errorsId].filter(Boolean).join(' ');\n return (\n <fieldset\n className={cx('panneau-fieldset', styles.fieldset, className)}\n aria-describedby={describedBy !== '' ? describedBy : undefined}\n aria-invalid={errors.length > 0 ? true : undefined}\n disabled={isDisabled}\n >\n {legend !== undefined && legend !== null ? (\n <legend className={cx(styles.legend, styles.label, legendClassName)}>\n {legend}\n {isRequired ? (\n <span className={styles.required} aria-hidden=\"true\">\n *\n </span>\n ) : null}\n </legend>\n ) : null}\n {descriptionId !== null ? (\n <div id={descriptionId} className={cx(styles.description, descriptionClassName)}>\n {description}\n </div>\n ) : null}\n {children}\n {errorsId !== null ? (\n <div id={errorsId} className={cx(styles.errors, errorsClassName)}>\n {errors.map((error, index) => (\n <Fragment key={index}>\n {/* A space between messages, for assistive technologies. */}\n {index > 0 ? ' ' : null}\n <span className={styles.error}>{error}</span>\n </Fragment>\n ))}\n </div>\n ) : null}\n </fieldset>\n );\n}\n"],"mappings":";;;;;;;;;;;AAyBA,SAAOgB,SAAAC,IAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CAAkB,MAAA,EAAAb,QAAAC,aAAAC,QAAAY,IAAAX,YAAAY,IAAAX,YAAAY,IAAAX,UAAAC,WAAAC,iBAAAC,sBAAAC,oBAAAE;CAWT,IAAAM;CAAA,IAAAL,EAAA,OAAAE,IAAA;EARZG,KAAAH,OAAAI,KAAAA,IAAA,CAAA,IAAAJ;EAAWF,EAAA,KAAAE;EAAAF,EAAA,KAAAK;CAAA,OAAAA,KAAAL,EAAA;CAAX,MAAAV,SAAAe;CACA,MAAAd,aAAAY,OAAAG,KAAAA,IAAA,QAAAH;CACA,MAAAX,aAAAY,OAAAE,KAAAA,IAAA,QAAAF;CAOA,MAAAG,KAAWvB,MAAM;CACjB,MAAAwB,gBAAsBnB,gBAAgBiB,KAAAA,IAAhB,GAA+BC,GAAE,gBAAjC;CACtB,MAAAE,WAAiBnB,OAAMoB,SAAU,IAAhB,GAAuBH,GAAE,WAAzB;CAA0C,IAAAI;CAAA,IAAAX,EAAA,OAAAQ,iBAAAR,EAAA,OAAAS,UAAA;EACvCE,KAAA,CAACH,eAAeC,QAAQ,CAAC,CAAAG,OAAQC,OAAO;EAACb,EAAA,KAAAQ;EAAAR,EAAA,K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,EAAA,QAAAH,mBAAAG,EAAA,QAAAS,UAAA;EAEPe,MAAAf,aAAa,OACV,oBAAA,OAAA;GAASA,IAAAA;GAAqB,WAAAxB,GAAGC,qBAAMI,QAASO,eAAe;GAC1DP,UAAAA,OAAMmC,IAAKC,KAMX;EACC,CAAA,IATT;EAUO1B,EAAA,MAAAV;EAAAU,EAAA,MAAAH;EAAAG,EAAA,MAAAS;EAAAT,EAAA,MAAAwB;CAAA,OAAAA,MAAAxB,EAAA;CAAA,IAAA2B;CAAA,IAAA3B,EAAA,QAAAP,YAAAO,EAAA,QAAAR,cAAAQ,EAAA,QAAAuB,OAAAvB,EAAA,QAAAwB,OAAAxB,EAAA,QAAAgB,MAAAhB,EAAA,QAAAkB,MAAAlB,EAAA,QAAAmB,MAAAnB,EAAA,QAAAoB,IAAA;EAhCZO,MAAA,qBAAA,YAAA;GACe,WAAAX;GACO,oBAAAE;GACJ,gBAAAC;GACJ3B,UAAAA;GAJd,UAAA;IAMK4B;IAUAG;IAKA9B;IACA+B;GAWM;;EAAAxB,EAAA,MAAAP;EAAAO,EAAA,MAAAR;EAAAQ,EAAA,MAAAuB;EAAAvB,EAAA,MAAAwB;EAAAxB,EAAA,MAAAgB;EAAAhB,EAAA,MAAAkB;EAAAlB,EAAA,MAAAmB;EAAAnB,EAAA,MAAAoB;EAAApB,EAAA,MAAA2B;CAAA,OAAAA,MAAA3B,EAAA;CAAA,OAjCX2B;AAiCW;AAlDZ,SAAAD,MAAAE,OAAAC,OAAA;CAAA,OA0CiB,qBAACG,YAAD,EAAA,UAAA,CAEKH,QAAQ,IAAR,MAAA,MACD,oBAAA,QAAA;EAAiB,WAAA3C,qBAAM0C;EAASA,UAAAA;CAAa,CAAA,CAHxC,EAAA,GAAMC,KAAN;AAIE"}
@@ -1 +1 @@
1
- {"version":3,"file":"inputTokens.js","names":[],"sources":["../../src/field/inputTokens.ts"],"sourcesContent":["import { defineComponentTokens } from '../theme/componentTokens';\n\n/** Tokens of the input box of text inputs, text areas, selects, combo boxes, number inputs, date pickers and time inputs. */\nexport const inputTokens = defineComponentTokens('input', {\n /** Horizontal padding. */\n 'padding-x': 'var(--panneau-control-padding-x)',\n /** Background. */\n bg: 'var(--panneau-color-surface)',\n /** Width of the border. */\n 'border-width': 'var(--panneau-border-width)',\n /** Border color. */\n 'border-color': 'var(--panneau-color-border-control)',\n /** Corner radius. */\n radius: 'var(--panneau-radius-md)',\n /** Border color of a hovered input. */\n 'border-color-hover': 'var(--panneau-color-text-muted)',\n});\n"],"mappings":";;;AAGA,IAAa,cAAc,sBAAsB,SAAS;;CAEtD,aAAa;;CAEb,IAAI;;CAEJ,gBAAgB;;CAEhB,gBAAgB;;CAEhB,QAAQ;;CAER,sBAAsB;AAC1B,CAAC"}
1
+ {"version":3,"file":"inputTokens.js","names":["defineComponentTokens","inputTokens","bg","radius"],"sources":["../../src/field/inputTokens.ts"],"sourcesContent":["import { defineComponentTokens } from '../theme/componentTokens';\n\n/** Tokens of the input box of text inputs, text areas, selects, combo boxes, number inputs, date pickers and time inputs. */\nexport const inputTokens = defineComponentTokens('input', {\n /** Horizontal padding. */\n 'padding-x': 'var(--panneau-control-padding-x)',\n /** Background. */\n bg: 'var(--panneau-color-surface)',\n /** Width of the border. */\n 'border-width': 'var(--panneau-border-width)',\n /** Border color. */\n 'border-color': 'var(--panneau-color-border-control)',\n /** Corner radius. */\n radius: 'var(--panneau-radius-md)',\n /** Border color of a hovered input. */\n 'border-color-hover': 'var(--panneau-color-text-muted)',\n});\n"],"mappings":";;;AAGA,IAAaC,cAAcD,sBAAsB,SAAS;;CAEtD,aAAa;;CAEbE,IAAI;;CAEJ,gBAAgB;;CAEhB,gBAAgB;;CAEhBC,QAAQ;;CAER,sBAAsB;AAC1B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"tokens.js","names":[],"sources":["../../src/field/tokens.ts"],"sourcesContent":["import { defineComponentTokens } from '../theme/componentTokens';\n\n/** Tokens of the label, description and errors around inputs. */\nexport const fieldTokens = defineComponentTokens('field', {\n /** Space between the label, the input, the description and the errors. */\n gap: 'var(--panneau-space-1)',\n /** Font size of the label. */\n 'label-font-size': 'var(--panneau-font-size-md)',\n /** Font weight of the label. */\n 'label-font-weight': 'var(--panneau-font-weight-medium)',\n});\n"],"mappings":";;;AAGA,IAAa,cAAc,sBAAsB,SAAS;;CAEtD,KAAK;;CAEL,mBAAmB;;CAEnB,qBAAqB;AACzB,CAAC"}
1
+ {"version":3,"file":"tokens.js","names":["defineComponentTokens","fieldTokens","gap"],"sources":["../../src/field/tokens.ts"],"sourcesContent":["import { defineComponentTokens } from '../theme/componentTokens';\n\n/** Tokens of the label, description and errors around inputs. */\nexport const fieldTokens = defineComponentTokens('field', {\n /** Space between the label, the input, the description and the errors. */\n gap: 'var(--panneau-space-1)',\n /** Font size of the label. */\n 'label-font-size': 'var(--panneau-font-size-md)',\n /** Font weight of the label. */\n 'label-font-weight': 'var(--panneau-font-weight-medium)',\n});\n"],"mappings":";;;AAGA,IAAaC,cAAcD,sBAAsB,SAAS;;CAEtDE,KAAK;;CAEL,mBAAmB;;CAEnB,qBAAqB;AACzB,CAAC"}
package/dist/grid/Grid.js CHANGED
@@ -2,28 +2,137 @@ import { cx } from "../utils/cx.js";
2
2
  import { responsiveVariables, space, withVariables } from "../layout/responsive.js";
3
3
  import Grid_module_default from "./Grid.module.js";
4
4
  import GridItem_module_default from "./GridItem.module.js";
5
+ import { c } from "react/compiler-runtime";
5
6
  import { jsx } from "react/jsx-runtime";
6
7
  //#region src/grid/Grid.tsx
7
8
  /** Cells in columns: a fixed number per breakpoint, or as many as fit. */
8
- function Grid({ as: Element = "div", columns, minItemWidth, gap, align, className, style, ...props }) {
9
- return /* @__PURE__ */ jsx(Element, {
10
- ...props,
11
- className: cx("panneau-grid", Grid_module_default.grid, minItemWidth !== void 0 && Grid_module_default.auto, className),
12
- style: withVariables([
13
- responsiveVariables("grid", "columns", columns, (count) => String(Math.max(1, Math.floor(count)))),
9
+ function Grid(t0) {
10
+ const $ = c(23);
11
+ let align;
12
+ let className;
13
+ let columns;
14
+ let gap;
15
+ let minItemWidth;
16
+ let props;
17
+ let style;
18
+ let t1;
19
+ if ($[0] !== t0) {
20
+ ({as: t1, columns, minItemWidth, gap, align, className, style, ...props} = t0);
21
+ $[0] = t0;
22
+ $[1] = align;
23
+ $[2] = className;
24
+ $[3] = columns;
25
+ $[4] = gap;
26
+ $[5] = minItemWidth;
27
+ $[6] = props;
28
+ $[7] = style;
29
+ $[8] = t1;
30
+ } else {
31
+ align = $[1];
32
+ className = $[2];
33
+ columns = $[3];
34
+ gap = $[4];
35
+ minItemWidth = $[5];
36
+ props = $[6];
37
+ style = $[7];
38
+ t1 = $[8];
39
+ }
40
+ const Element = t1 === void 0 ? "div" : t1;
41
+ const t2 = minItemWidth !== void 0 && Grid_module_default.auto;
42
+ let t3;
43
+ if ($[9] !== className || $[10] !== t2) {
44
+ t3 = cx("panneau-grid", Grid_module_default.grid, t2, className);
45
+ $[9] = className;
46
+ $[10] = t2;
47
+ $[11] = t3;
48
+ } else t3 = $[11];
49
+ let t4;
50
+ if ($[12] !== align || $[13] !== columns || $[14] !== gap || $[15] !== minItemWidth || $[16] !== style) {
51
+ t4 = withVariables([
52
+ responsiveVariables("grid", "columns", columns, _temp),
14
53
  minItemWidth !== void 0 ? { "--_panneau-grid-min-item-width": minItemWidth } : {},
15
54
  responsiveVariables("grid", "gap", gap, space),
16
55
  responsiveVariables("grid", "align", align, String)
17
- ], style)
18
- });
56
+ ], style);
57
+ $[12] = align;
58
+ $[13] = columns;
59
+ $[14] = gap;
60
+ $[15] = minItemWidth;
61
+ $[16] = style;
62
+ $[17] = t4;
63
+ } else t4 = $[17];
64
+ let t5;
65
+ if ($[18] !== Element || $[19] !== props || $[20] !== t3 || $[21] !== t4) {
66
+ t5 = /* @__PURE__ */ jsx(Element, {
67
+ ...props,
68
+ className: t3,
69
+ style: t4
70
+ });
71
+ $[18] = Element;
72
+ $[19] = props;
73
+ $[20] = t3;
74
+ $[21] = t4;
75
+ $[22] = t5;
76
+ } else t5 = $[22];
77
+ return t5;
78
+ }
79
+ function _temp(count) {
80
+ return String(Math.max(1, Math.floor(count)));
19
81
  }
20
82
  /** A cell of a `Grid` that spans several columns, per breakpoint. */
21
- function GridItem({ as: Element = "div", span, className, style, ...props }) {
22
- return /* @__PURE__ */ jsx(Element, {
23
- ...props,
24
- className: cx("panneau-grid-item", GridItem_module_default["grid-item"], className),
25
- style: withVariables([responsiveVariables("grid-item", "span", span, (value) => value === "full" ? "1 / -1" : `span ${Math.max(1, Math.floor(value))}`)], style)
26
- });
83
+ function GridItem(t0) {
84
+ const $ = c(16);
85
+ let className;
86
+ let props;
87
+ let span;
88
+ let style;
89
+ let t1;
90
+ if ($[0] !== t0) {
91
+ ({as: t1, span, className, style, ...props} = t0);
92
+ $[0] = t0;
93
+ $[1] = className;
94
+ $[2] = props;
95
+ $[3] = span;
96
+ $[4] = style;
97
+ $[5] = t1;
98
+ } else {
99
+ className = $[1];
100
+ props = $[2];
101
+ span = $[3];
102
+ style = $[4];
103
+ t1 = $[5];
104
+ }
105
+ const Element = t1 === void 0 ? "div" : t1;
106
+ let t2;
107
+ if ($[6] !== className) {
108
+ t2 = cx("panneau-grid-item", GridItem_module_default["grid-item"], className);
109
+ $[6] = className;
110
+ $[7] = t2;
111
+ } else t2 = $[7];
112
+ let t3;
113
+ if ($[8] !== span || $[9] !== style) {
114
+ t3 = withVariables([responsiveVariables("grid-item", "span", span, _temp2)], style);
115
+ $[8] = span;
116
+ $[9] = style;
117
+ $[10] = t3;
118
+ } else t3 = $[10];
119
+ let t4;
120
+ if ($[11] !== Element || $[12] !== props || $[13] !== t2 || $[14] !== t3) {
121
+ t4 = /* @__PURE__ */ jsx(Element, {
122
+ ...props,
123
+ className: t2,
124
+ style: t3
125
+ });
126
+ $[11] = Element;
127
+ $[12] = props;
128
+ $[13] = t2;
129
+ $[14] = t3;
130
+ $[15] = t4;
131
+ } else t4 = $[15];
132
+ return t4;
133
+ }
134
+ function _temp2(value) {
135
+ return value === "full" ? "1 / -1" : `span ${Math.max(1, Math.floor(value))}`;
27
136
  }
28
137
  //#endregion
29
138
  export { Grid, GridItem };
@@ -1 +1 @@
1
- {"version":3,"file":"Grid.js","names":["styles","itemStyles"],"sources":["../../src/grid/Grid.tsx"],"sourcesContent":["import type { HTMLAttributes } from 'react';\n\nimport {\n type Responsive,\n type Space,\n responsiveVariables,\n space,\n withVariables,\n} from '../layout/responsive';\nimport { cx } from '../utils/cx';\nimport styles from './Grid.module.css';\nimport itemStyles from './GridItem.module.css';\n\nexport interface GridProps extends HTMLAttributes<HTMLElement> {\n /** Element to render. Defaults to `div`. */\n as?: 'div' | 'section' | 'ul' | 'ol' | 'dl';\n /** Number of equal columns: `3`, or `{ base: 1, md: 2, lg: 3 }`. Defaults to 1. */\n columns?: Responsive<number>;\n /**\n * Minimum width of a cell (`'16rem'`): as many columns as fit, like `repeat(auto-fit, ...)`.\n * It replaces `columns`.\n */\n minItemWidth?: string;\n /** Space between cells, from the space scale. Defaults to the `--panneau-grid-gap` token. */\n gap?: Responsive<Space>;\n /** Vertical alignment of the cells in their row. Defaults to `stretch`. */\n align?: Responsive<'start' | 'center' | 'end' | 'stretch'>;\n}\n\n/** Cells in columns: a fixed number per breakpoint, or as many as fit. */\nexport function Grid({\n as: Element = 'div',\n columns,\n minItemWidth,\n gap,\n align,\n className,\n style,\n ...props\n}: GridProps) {\n return (\n <Element\n {...props}\n className={cx(\n 'panneau-grid',\n styles.grid,\n minItemWidth !== undefined && styles.auto,\n className,\n )}\n style={withVariables(\n [\n responsiveVariables('grid', 'columns', columns, (count) =>\n String(Math.max(1, Math.floor(count))),\n ),\n minItemWidth !== undefined\n ? { '--_panneau-grid-min-item-width': minItemWidth }\n : {},\n responsiveVariables('grid', 'gap', gap, space),\n responsiveVariables('grid', 'align', align, String),\n ],\n style,\n )}\n />\n );\n}\n\nexport interface GridItemProps extends HTMLAttributes<HTMLElement> {\n /** Element to render. Defaults to `div`. */\n as?: 'div' | 'section' | 'article' | 'li';\n /** Columns the cell spans: a number, or `full` for the whole row. Defaults to 1. */\n span?: Responsive<number | 'full'>;\n}\n\n/** A cell of a `Grid` that spans several columns, per breakpoint. */\nexport function GridItem({ as: Element = 'div', span, className, style, ...props }: GridItemProps) {\n return (\n <Element\n {...props}\n className={cx('panneau-grid-item', itemStyles['grid-item'], className)}\n style={withVariables(\n [\n responsiveVariables('grid-item', 'span', span, (value) =>\n value === 'full' ? '1 / -1' : `span ${Math.max(1, Math.floor(value))}`,\n ),\n ],\n style,\n )}\n />\n );\n}\n"],"mappings":";;;;;;;AA8BA,SAAgB,KAAK,EACjB,IAAI,UAAU,OACd,SACA,cACA,KACA,OACA,WACA,OACA,GAAG,SACO;CACV,OACI,oBAAC,SAAD;EACI,GAAI;EACJ,WAAW,GACP,gBACAA,oBAAO,MACP,iBAAiB,KAAA,KAAaA,oBAAO,MACrC,SACJ;EACA,OAAO,cACH;GACI,oBAAoB,QAAQ,WAAW,UAAU,UAC7C,OAAO,KAAK,IAAI,GAAG,KAAK,MAAM,KAAK,CAAC,CAAC,CACzC;GACA,iBAAiB,KAAA,IACX,EAAE,kCAAkC,aAAa,IACjD,CAAC;GACP,oBAAoB,QAAQ,OAAO,KAAK,KAAK;GAC7C,oBAAoB,QAAQ,SAAS,OAAO,MAAM;EAAC,GAEvD,KACJ;CAAE,CAAA;AAGd;;AAUA,SAAgB,SAAS,EAAE,IAAI,UAAU,OAAO,MAAM,WAAW,OAAO,GAAG,SAAwB;CAC/F,OACI,oBAAC,SAAD;EACI,GAAI;EACJ,WAAW,GAAG,qBAAqBC,wBAAW,cAAc,SAAS;EACrE,OAAO,cACH,CACI,oBAAoB,aAAa,QAAQ,OAAO,UAC5C,UAAU,SAAS,WAAW,QAAQ,KAAK,IAAI,GAAG,KAAK,MAAM,KAAK,CAAC,GACvE,CAAC,GAEL,KACJ;CAAE,CAAA;AAGd"}
1
+ {"version":3,"file":"Grid.js","names":["HTMLAttributes","Responsive","Space","responsiveVariables","space","withVariables","cx","styles","itemStyles","GridProps","HTMLElement","as","columns","minItemWidth","gap","align","Grid","t0","$","_c","className","props","style","t1","Element","undefined","t2","auto","t3","grid","t4","_temp","String","t5","count","Math","max","floor","GridItemProps","span","GridItem","_temp2","value","_c","styles","itemStyles"],"sources":["../../src/grid/Grid.tsx"],"sourcesContent":["import type { HTMLAttributes } from 'react';\n\nimport {\n type Responsive,\n type Space,\n responsiveVariables,\n space,\n withVariables,\n} from '../layout/responsive';\nimport { cx } from '../utils/cx';\nimport styles from './Grid.module.css';\nimport itemStyles from './GridItem.module.css';\n\nexport interface GridProps extends HTMLAttributes<HTMLElement> {\n /** Element to render. Defaults to `div`. */\n as?: 'div' | 'section' | 'ul' | 'ol' | 'dl';\n /** Number of equal columns: `3`, or `{ base: 1, md: 2, lg: 3 }`. Defaults to 1. */\n columns?: Responsive<number>;\n /**\n * Minimum width of a cell (`'16rem'`): as many columns as fit, like `repeat(auto-fit, ...)`.\n * It replaces `columns`.\n */\n minItemWidth?: string;\n /** Space between cells, from the space scale. Defaults to the `--panneau-grid-gap` token. */\n gap?: Responsive<Space>;\n /** Vertical alignment of the cells in their row. Defaults to `stretch`. */\n align?: Responsive<'start' | 'center' | 'end' | 'stretch'>;\n}\n\n/** Cells in columns: a fixed number per breakpoint, or as many as fit. */\nexport function Grid({\n as: Element = 'div',\n columns,\n minItemWidth,\n gap,\n align,\n className,\n style,\n ...props\n}: GridProps) {\n return (\n <Element\n {...props}\n className={cx(\n 'panneau-grid',\n styles.grid,\n minItemWidth !== undefined && styles.auto,\n className,\n )}\n style={withVariables(\n [\n responsiveVariables('grid', 'columns', columns, (count) =>\n String(Math.max(1, Math.floor(count))),\n ),\n minItemWidth !== undefined\n ? { '--_panneau-grid-min-item-width': minItemWidth }\n : {},\n responsiveVariables('grid', 'gap', gap, space),\n responsiveVariables('grid', 'align', align, String),\n ],\n style,\n )}\n />\n );\n}\n\nexport interface GridItemProps extends HTMLAttributes<HTMLElement> {\n /** Element to render. Defaults to `div`. */\n as?: 'div' | 'section' | 'article' | 'li';\n /** Columns the cell spans: a number, or `full` for the whole row. Defaults to 1. */\n span?: Responsive<number | 'full'>;\n}\n\n/** A cell of a `Grid` that spans several columns, per breakpoint. */\nexport function GridItem({ as: Element = 'div', span, className, style, ...props }: GridItemProps) {\n return (\n <Element\n {...props}\n className={cx('panneau-grid-item', itemStyles['grid-item'], className)}\n style={withVariables(\n [\n responsiveVariables('grid-item', 'span', span, (value) =>\n value === 'full' ? '1 / -1' : `span ${Math.max(1, Math.floor(value))}`,\n ),\n ],\n style,\n )}\n />\n );\n}\n"],"mappings":";;;;;;;;AA8BA,SAAOgB,KAAAC,IAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CAAA,IAAAJ;CAAA,IAAAK;CAAA,IAAAR;CAAA,IAAAE;CAAA,IAAAD;CAAA,IAAAQ;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAL,EAAA,OAAAD,IAAA;EAAc,CAAA,CAAAN,IAAAY,IAAAX,SAAAC,cAAAC,KAAAC,OAAAK,WAAAE,OAAA,GAAAD,SAAAJ;EASTC,EAAA,KAAAD;EAAAC,EAAA,KAAAH;EAAAG,EAAA,KAAAE;EAAAF,EAAA,KAAAN;EAAAM,EAAA,KAAAJ;EAAAI,EAAA,KAAAL;EAAAK,EAAA,KAAAG;EAAAH,EAAA,KAAAI;EAAAJ,EAAA,KAAAK;CAAA,OAAA;EAAAR,QAAAG,EAAA;EAAAE,YAAAF,EAAA;EAAAN,UAAAM,EAAA;EAAAJ,MAAAI,EAAA;EAAAL,eAAAK,EAAA;EAAAG,QAAAH,EAAA;EAAAI,QAAAJ,EAAA;EAAAK,KAAAL,EAAA;CAAA;CARJ,MAAAM,UAAAD,OAAAE,KAAAA,IAAA,QAAAF;CAeQ,MAAAG,KAAAb,iBAAiBY,KAAAA,KAAalB,oBAAMoB;CAAK,IAAAC;CAAA,IAAAV,EAAA,OAAAE,aAAAF,EAAA,QAAAQ,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AIC,IAAK,GAAGD,KAAIE,MAAOK,KAAK,CAAC;AAAG"}
@@ -1 +1 @@
1
- {"version":3,"file":"tokens.js","names":[],"sources":["../../src/grid/tokens.ts"],"sourcesContent":["import { defineComponentTokens } from '../theme/componentTokens';\n\n/** Tokens of Grid. */\nexport const gridTokens = defineComponentTokens('grid', {\n /** Space between cells, in both directions, when the `gap` prop is not set. */\n gap: 'var(--panneau-space-4)',\n});\n"],"mappings":";;;AAGA,IAAa,aAAa,sBAAsB,QAAQ;;AAEpD,KAAK,yBACT,CAAC"}
1
+ {"version":3,"file":"tokens.js","names":["defineComponentTokens","gridTokens","gap"],"sources":["../../src/grid/tokens.ts"],"sourcesContent":["import { defineComponentTokens } from '../theme/componentTokens';\n\n/** Tokens of Grid. */\nexport const gridTokens = defineComponentTokens('grid', {\n /** Space between cells, in both directions, when the `gap` prop is not set. */\n gap: 'var(--panneau-space-4)',\n});\n"],"mappings":";;;AAGA,IAAaC,aAAaD,sBAAsB,QAAQ;;AAEpDE,KAAK,yBACT,CAAC"}
@@ -1,15 +1,50 @@
1
1
  import { cx } from "../utils/cx.js";
2
2
  import Heading_module_default from "./Heading.module.js";
3
+ import { c } from "react/compiler-runtime";
3
4
  import { jsx } from "react/jsx-runtime";
4
5
  //#region src/heading/Heading.tsx
5
6
  /** A heading, styled by the heading tokens of the theme. */
6
- function Heading({ level = 2, size, className, ...props }) {
7
+ function Heading(t0) {
8
+ const $ = c(12);
9
+ let className;
10
+ let props;
11
+ let size;
12
+ let t1;
13
+ if ($[0] !== t0) {
14
+ ({level: t1, size, className, ...props} = t0);
15
+ $[0] = t0;
16
+ $[1] = className;
17
+ $[2] = props;
18
+ $[3] = size;
19
+ $[4] = t1;
20
+ } else {
21
+ className = $[1];
22
+ props = $[2];
23
+ size = $[3];
24
+ t1 = $[4];
25
+ }
26
+ const level = t1 === void 0 ? 2 : t1;
7
27
  const Element = `h${level}`;
8
- const visualSize = size ?? Math.min(level, 4);
9
- return /* @__PURE__ */ jsx(Element, {
10
- ...props,
11
- className: cx("panneau-heading", Heading_module_default.heading, Heading_module_default[`size-${visualSize}`], className)
12
- });
28
+ const t2 = Heading_module_default[`size-${size ?? Math.min(level, 4)}`];
29
+ let t3;
30
+ if ($[5] !== className || $[6] !== t2) {
31
+ t3 = cx("panneau-heading", Heading_module_default.heading, t2, className);
32
+ $[5] = className;
33
+ $[6] = t2;
34
+ $[7] = t3;
35
+ } else t3 = $[7];
36
+ let t4;
37
+ if ($[8] !== Element || $[9] !== props || $[10] !== t3) {
38
+ t4 = /* @__PURE__ */ jsx(Element, {
39
+ ...props,
40
+ className: t3
41
+ });
42
+ $[8] = Element;
43
+ $[9] = props;
44
+ $[10] = t3;
45
+ $[11] = t4;
46
+ } else t4 = $[11];
47
+ return t4;
13
48
  }
14
49
  //#endregion
15
50
  export { Heading };
@@ -1 +1 @@
1
- {"version":3,"file":"Heading.js","names":["styles"],"sources":["../../src/heading/Heading.tsx"],"sourcesContent":["import type { HTMLAttributes } from 'react';\n\nimport { cx } from '../utils/cx';\nimport styles from './Heading.module.css';\n\n/** The level of a heading element: `h1` to `h6`. */\nexport type HeadingLevel = 1 | 2 | 3 | 4 | 5 | 6;\n\n/** The visual size of a heading: 1 to 4, or a display size for hero text and stats. */\nexport type HeadingSize = 1 | 2 | 3 | 4 | 'display-1' | 'display-2';\n\nexport interface HeadingProps extends HTMLAttributes<HTMLHeadingElement> {\n /** Level of the element, for the outline of the page. Defaults to 2. */\n level?: HeadingLevel;\n /**\n * Visual size, independent of the level, like Bootstrap's `.h1` and `.display-1`. Defaults to\n * the level, and to 4 for levels 5 and 6.\n */\n size?: HeadingSize;\n}\n\n/** A heading, styled by the heading tokens of the theme. */\nexport function Heading({ level = 2, size, className, ...props }: HeadingProps) {\n const Element = `h${level}` as const;\n const visualSize = size ?? Math.min(level, 4);\n return (\n <Element\n {...props}\n className={cx(\n 'panneau-heading',\n styles.heading,\n styles[`size-${visualSize}`],\n className,\n )}\n />\n );\n}\n"],"mappings":";;;;;AAsBA,SAAgB,QAAQ,EAAE,QAAQ,GAAG,MAAM,WAAW,GAAG,SAAuB;CAC5E,MAAM,UAAU,IAAI;CACpB,MAAM,aAAa,QAAQ,KAAK,IAAI,OAAO,CAAC;CAC5C,OACI,oBAAC,SAAD;EACI,GAAI;EACJ,WAAW,GACP,mBACAA,uBAAO,SACPA,uBAAO,QAAQ,eACf,SACJ;CAAE,CAAA;AAGd"}
1
+ {"version":3,"file":"Heading.js","names":["HTMLAttributes","cx","styles","HeadingLevel","HeadingSize","HeadingProps","HTMLHeadingElement","level","size","Heading","t0","$","_c","className","props","t1","undefined","Element","const","visualSize","Math","min","t2","t3","heading","t4","_c","styles"],"sources":["../../src/heading/Heading.tsx"],"sourcesContent":["import type { HTMLAttributes } from 'react';\n\nimport { cx } from '../utils/cx';\nimport styles from './Heading.module.css';\n\n/** The level of a heading element: `h1` to `h6`. */\nexport type HeadingLevel = 1 | 2 | 3 | 4 | 5 | 6;\n\n/** The visual size of a heading: 1 to 4, or a display size for hero text and stats. */\nexport type HeadingSize = 1 | 2 | 3 | 4 | 'display-1' | 'display-2';\n\nexport interface HeadingProps extends HTMLAttributes<HTMLHeadingElement> {\n /** Level of the element, for the outline of the page. Defaults to 2. */\n level?: HeadingLevel;\n /**\n * Visual size, independent of the level, like Bootstrap's `.h1` and `.display-1`. Defaults to\n * the level, and to 4 for levels 5 and 6.\n */\n size?: HeadingSize;\n}\n\n/** A heading, styled by the heading tokens of the theme. */\nexport function Heading({ level = 2, size, className, ...props }: HeadingProps) {\n const Element = `h${level}` as const;\n const visualSize = size ?? Math.min(level, 4);\n return (\n <Element\n {...props}\n className={cx(\n 'panneau-heading',\n styles.heading,\n styles[`size-${visualSize}`],\n className,\n )}\n />\n );\n}\n"],"mappings":";;;;;;AAsBA,SAAOS,QAAAC,IAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAN;CAAA,IAAAO;CAAA,IAAAJ,EAAA,OAAAD,IAAA;EAAiB,CAAA,CAAAH,OAAAQ,IAAAP,MAAAK,WAAA,GAAAC,SAAAJ;EAAsDC,EAAA,KAAAD;EAAAC,EAAA,KAAAE;EAAAF,EAAA,KAAAG;EAAAH,EAAA,KAAAH;EAAAG,EAAA,KAAAI;CAAA,OAAA;EAAAF,YAAAF,EAAA;EAAAG,QAAAH,EAAA;EAAAH,OAAAG,EAAA;EAAAI,KAAAJ,EAAA;CAAA;CAApD,MAAAJ,QAAAQ,OAAAC,KAAAA,IAAA,IAAAD;CACtB,MAAAE,UAAgB,IAAIV;CAQR,MAAAe,KAAApB,uBAAO,QAPAM,QAAQY,KAAIC,IAAKd,OAAO,CAAC;CAOJ,IAAAgB;CAAA,IAAAZ,EAAA,OAAAE,aAAAF,EAAA,OAAAW,IAAA;EAHrBC,KAAAtB,GACP,mBACAC,uBAAMsB,SACNF,IACAT,SACJ;EAACF,EAAA,KAAAE;EAAAF,EAAA,KAAAW;EAAAX,EAAA,KAAAY;CAAA,OAAAA,KAAAZ,EAAA;CAAA,IAAAc;CAAA,IAAAd,EAAA,OAAAM,WAAAN,EAAA,OAAAG,SAAAH,EAAA,QAAAY,IAAA;EAPLE,KAAA,oBAAC,SAAD;GAAQ,GACAX;GACO,WAAAS;EAKV,CAAA;EACHZ,EAAA,KAAAM;EAAAN,EAAA,KAAAG;EAAAH,EAAA,MAAAY;EAAAZ,EAAA,MAAAc;CAAA,OAAAA,KAAAd,EAAA;CAAA,OARFc;AAQE"}