@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 +1 @@
1
- {"version":3,"file":"usePanneauIntl.js","names":[],"sources":["../../src/intl/usePanneauIntl.ts"],"sourcesContent":["import { use } from 'react';\nimport { IntlContext, type IntlShape, createIntl, createIntlCache } from 'react-intl';\n\nlet fallback: IntlShape | null = null;\n\n/**\n * The react-intl object of the closest `IntlProvider`. Without a provider, an English one with the\n * default messages, so that Panneau components also render outside of an internationalized app.\n */\nexport function usePanneauIntl(): IntlShape {\n const intl = use(IntlContext) as IntlShape | null | undefined;\n if (intl !== null && intl !== undefined) {\n return intl;\n }\n fallback ??= createIntl({ locale: 'en', defaultLocale: 'en', messages: {} }, createIntlCache());\n return fallback;\n}\n"],"mappings":";;;AAGA,IAAI,WAA6B;;;;;AAMjC,SAAgB,iBAA4B;CACxC,MAAM,OAAO,IAAI,WAAW;CAC5B,IAAI,SAAS,QAAQ,SAAS,KAAA,GAC1B,OAAO;CAEX,aAAa,WAAW;EAAE,QAAQ;EAAM,eAAe;EAAM,UAAU,CAAC;CAAE,GAAG,gBAAgB,CAAC;CAC9F,OAAO;AACX"}
1
+ {"version":3,"file":"usePanneauIntl.js","names":["use","IntlContext","IntlShape","createIntl","createIntlCache","fallback","usePanneauIntl","intl","undefined","locale","defaultLocale","messages"],"sources":["../../src/intl/usePanneauIntl.ts"],"sourcesContent":["import { use } from 'react';\nimport { IntlContext, type IntlShape, createIntl, createIntlCache } from 'react-intl';\n\nlet fallback: IntlShape | null = null;\n\n/**\n * The react-intl object of the closest `IntlProvider`. Without a provider, an English one with the\n * default messages, so that Panneau components also render outside of an internationalized app.\n */\nexport function usePanneauIntl(): IntlShape {\n const intl = use(IntlContext) as IntlShape | null | undefined;\n if (intl !== null && intl !== undefined) {\n return intl;\n }\n fallback ??= createIntl({ locale: 'en', defaultLocale: 'en', messages: {} }, createIntlCache());\n return fallback;\n}\n"],"mappings":";;;AAGA,IAAIK,WAA6B;;;;;AAMjC,SAAgBC,iBAA4B;CACxC,MAAMC,OAAOP,IAAIC,WAAW;CAC5B,IAAIM,SAAS,QAAQA,SAASC,KAAAA,GAC1B,OAAOD;CAEXF,aAAaF,WAAW;EAAEM,QAAQ;EAAMC,eAAe;EAAMC,UAAU,CAAC;CAAE,GAAGP,gBAAgB,CAAC;CAC9F,OAAOC;AACX"}
@@ -1 +1 @@
1
- {"version":3,"file":"responsive.js","names":[],"sources":["../../src/layout/responsive.ts"],"sourcesContent":["import type { CSSProperties } from 'react';\n\n/**\n * Breakpoints of the layout primitives, like Bootstrap's `$grid-breakpoints`: the minimum width of\n * the nearest container at which a responsive value applies. They are constants, since CSS\n * variables can't be used in queries; the stylesheets of the primitives use the same values.\n */\nexport const BREAKPOINTS = Object.freeze({\n sm: '40rem',\n md: '48rem',\n lg: '64rem',\n xl: '80rem',\n});\n\n/** A breakpoint: `sm`, `md`, `lg` or `xl`. */\nexport type Breakpoint = keyof typeof BREAKPOINTS;\n\n/**\n * A value, or values by breakpoint: `{ base: 1, md: 2, lg: 3 }`. Each value applies from its\n * breakpoint up, until a larger one sets another. Breakpoints are widths of the nearest container\n * (`PanneauRoot`, `Container`, a form, a list), not of the viewport, so that a grid in a narrow\n * sidebar behaves as on a phone.\n */\nexport type Responsive<T> = T | Partial<Record<'base' | Breakpoint, T>>;\n\n/** A step of the space scale of the theme (`--panneau-space-<step>`), or 0. */\nexport type Space = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 8 | 10;\n\n/** The CSS value of a step of the space scale. */\nexport function space(step: Space): string {\n return step === 0 ? '0' : `var(--panneau-space-${step})`;\n}\n\nconst KEYS = ['base', ...(Object.keys(BREAKPOINTS) as Breakpoint[])] as const;\n\nfunction isByBreakpoint<T>(value: Responsive<T>): value is Partial<Record<'base' | Breakpoint, T>> {\n return typeof value === 'object' && value !== null;\n}\n\n/**\n * The inline variables of a responsive prop, `--_panneau-<component>-<prop>-<breakpoint>`, which\n * the static rules of the component read in each container query. Unset breakpoints fall back to\n * smaller ones in CSS.\n */\nexport function responsiveVariables<T>(\n component: string,\n prop: string,\n value: Responsive<T> | undefined,\n toCss: (value: T) => string,\n): Record<string, string> {\n if (value === undefined) {\n return {};\n }\n const values: Partial<Record<'base' | Breakpoint, T>> = isByBreakpoint(value)\n ? value\n : { base: value };\n return Object.fromEntries(\n KEYS.flatMap((key) => {\n const item = values[key];\n return item !== undefined\n ? [[`--_panneau-${component}-${prop}-${key}`, toCss(item)]]\n : [];\n }),\n );\n}\n\n/** Merges inline variables with the `style` prop, which wins. */\nexport function withVariables(\n variables: Record<string, string>[],\n style: CSSProperties | undefined,\n): CSSProperties | undefined {\n const merged = Object.assign({}, ...variables) as Record<string, string>;\n return Object.keys(merged).length > 0 ? { ...merged, ...style } : style;\n}\n\n/** How the primitives distribute items along their axis: `between` is `space-between`. */\nexport type Justification = 'start' | 'center' | 'end' | 'between';\n\n/** The CSS value of a justification. */\nexport function justification(value: Justification): string {\n return value === 'between' ? 'space-between' : value;\n}\n"],"mappings":";;;;;;AAOA,IAAa,cAAc,OAAO,OAAO;CACrC,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;AACR,CAAC;;AAiBD,SAAgB,MAAM,MAAqB;CACvC,OAAO,SAAS,IAAI,MAAM,uBAAuB,KAAI;AACzD;AAEA,IAAM,OAAO,CAAC,QAAQ,GAAI,OAAO,KAAK,WAAW,CAAkB;AAEnE,SAAS,eAAkB,OAAwE;CAC/F,OAAO,OAAO,UAAU,YAAY,UAAU;AAClD;;;;;;AAOA,SAAgB,oBACZ,WACA,MACA,OACA,OACsB;CACtB,IAAI,UAAU,KAAA,GACV,OAAO,CAAC;CAEZ,MAAM,SAAkD,eAAe,KAAK,IACtE,QACA,EAAE,MAAM,MAAM;CACpB,OAAO,OAAO,YACV,KAAK,SAAS,QAAQ;EAClB,MAAM,OAAO,OAAO;EACpB,OAAO,SAAS,KAAA,IACV,CAAC,CAAC,cAAc,UAAS,GAAI,KAAI,GAAI,OAAO,MAAM,IAAI,CAAC,CAAC,IACxD,CAAA;CACV,CAAC,CACL;AACJ;;AAGA,SAAgB,cACZ,WACA,OACyB;CACzB,MAAM,SAAS,OAAO,OAAO,CAAC,GAAG,GAAG,SAAS;CAC7C,OAAO,OAAO,KAAK,MAAM,CAAC,CAAC,SAAS,IAAI;EAAE,GAAG;EAAQ,GAAG;CAAM,IAAI;AACtE;;AAMA,SAAgB,cAAc,OAA8B;CACxD,OAAO,UAAU,YAAY,kBAAkB;AACnD"}
1
+ {"version":3,"file":"responsive.js","names":["CSSProperties","BREAKPOINTS","Object","freeze","sm","md","lg","xl","Breakpoint","Responsive","T","Partial","Record","Space","space","step","KEYS","keys","const","isByBreakpoint","value","responsiveVariables","component","prop","toCss","undefined","values","base","fromEntries","flatMap","key","item","withVariables","variables","style","merged","assign","length","Justification","justification"],"sources":["../../src/layout/responsive.ts"],"sourcesContent":["import type { CSSProperties } from 'react';\n\n/**\n * Breakpoints of the layout primitives, like Bootstrap's `$grid-breakpoints`: the minimum width of\n * the nearest container at which a responsive value applies. They are constants, since CSS\n * variables can't be used in queries; the stylesheets of the primitives use the same values.\n */\nexport const BREAKPOINTS = Object.freeze({\n sm: '40rem',\n md: '48rem',\n lg: '64rem',\n xl: '80rem',\n});\n\n/** A breakpoint: `sm`, `md`, `lg` or `xl`. */\nexport type Breakpoint = keyof typeof BREAKPOINTS;\n\n/**\n * A value, or values by breakpoint: `{ base: 1, md: 2, lg: 3 }`. Each value applies from its\n * breakpoint up, until a larger one sets another. Breakpoints are widths of the nearest container\n * (`PanneauRoot`, `Container`, a form, a list), not of the viewport, so that a grid in a narrow\n * sidebar behaves as on a phone.\n */\nexport type Responsive<T> = T | Partial<Record<'base' | Breakpoint, T>>;\n\n/** A step of the space scale of the theme (`--panneau-space-<step>`), or 0. */\nexport type Space = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 8 | 10;\n\n/** The CSS value of a step of the space scale. */\nexport function space(step: Space): string {\n return step === 0 ? '0' : `var(--panneau-space-${step})`;\n}\n\nconst KEYS = ['base', ...(Object.keys(BREAKPOINTS) as Breakpoint[])] as const;\n\nfunction isByBreakpoint<T>(value: Responsive<T>): value is Partial<Record<'base' | Breakpoint, T>> {\n return typeof value === 'object' && value !== null;\n}\n\n/**\n * The inline variables of a responsive prop, `--_panneau-<component>-<prop>-<breakpoint>`, which\n * the static rules of the component read in each container query. Unset breakpoints fall back to\n * smaller ones in CSS.\n */\nexport function responsiveVariables<T>(\n component: string,\n prop: string,\n value: Responsive<T> | undefined,\n toCss: (value: T) => string,\n): Record<string, string> {\n if (value === undefined) {\n return {};\n }\n const values: Partial<Record<'base' | Breakpoint, T>> = isByBreakpoint(value)\n ? value\n : { base: value };\n return Object.fromEntries(\n KEYS.flatMap((key) => {\n const item = values[key];\n return item !== undefined\n ? [[`--_panneau-${component}-${prop}-${key}`, toCss(item)]]\n : [];\n }),\n );\n}\n\n/** Merges inline variables with the `style` prop, which wins. */\nexport function withVariables(\n variables: Record<string, string>[],\n style: CSSProperties | undefined,\n): CSSProperties | undefined {\n const merged = Object.assign({}, ...variables) as Record<string, string>;\n return Object.keys(merged).length > 0 ? { ...merged, ...style } : style;\n}\n\n/** How the primitives distribute items along their axis: `between` is `space-between`. */\nexport type Justification = 'start' | 'center' | 'end' | 'between';\n\n/** The CSS value of a justification. */\nexport function justification(value: Justification): string {\n return value === 'between' ? 'space-between' : value;\n}\n"],"mappings":";;;;;;AAOA,IAAaC,cAAcC,OAAOC,OAAO;CACrCC,IAAI;CACJC,IAAI;CACJC,IAAI;CACJC,IAAI;AACR,CAAC;;AAiBD,SAAgBO,MAAMC,MAAqB;CACvC,OAAOA,SAAS,IAAI,MAAM,uBAAuBA,KAAI;AACzD;AAEA,IAAMC,OAAO,CAAC,QAAQ,GAAId,OAAOe,KAAKhB,WAAW,CAAkB;AAEnE,SAASkB,eAAkBC,OAAwE;CAC/F,OAAO,OAAOA,UAAU,YAAYA,UAAU;AAClD;;;;;;AAOA,SAAgBC,oBACZC,WACAC,MACAH,OACAI,OACsB;CACtB,IAAIJ,UAAUK,KAAAA,GACV,OAAO,CAAC;CAEZ,MAAMC,SAAkDP,eAAeC,KAAK,IACtEA,QACA,EAAEO,MAAMP,MAAM;CACpB,OAAOlB,OAAO0B,YACVZ,KAAKa,SAASC,QAAQ;EAClB,MAAMC,OAAOL,OAAOI;EACpB,OAAOC,SAASN,KAAAA,IACV,CAAC,CAAC,cAAcH,UAAS,GAAIC,KAAI,GAAIO,OAAON,MAAMO,IAAI,CAAC,CAAC,IACxD,CAAA;CACV,CAAC,CACL;AACJ;;AAGA,SAAgBC,cACZC,WACAC,OACyB;CACzB,MAAMC,SAASjC,OAAOkC,OAAO,CAAC,GAAG,GAAGH,SAAS;CAC7C,OAAO/B,OAAOe,KAAKkB,MAAM,CAAC,CAACE,SAAS,IAAI;EAAE,GAAGF;EAAQ,GAAGD;CAAM,IAAIA;AACtE;;AAMA,SAAgBK,cAAcnB,OAA8B;CACxD,OAAOA,UAAU,YAAY,kBAAkBA;AACnD"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["allFr"],"sources":["../../src/locales/index.ts"],"sourcesContent":["import { fr as allFr, getDefaultMessages } from '@panneau/intl';\n\nimport { messages } from '../intl/messages';\n\n/**\n * The English messages of `@panneau/ui`, by id. They are also the default messages.\n *\n * @deprecated Use `en`, or `withPanneauMessages()`, from `@panneau/intl`: they have the messages\n * of every package.\n */\nexport const en: Record<string, string> = getDefaultMessages(messages);\n\n/**\n * The French messages of `@panneau/ui`, by id.\n *\n * @deprecated Use `fr`, or `withPanneauMessages()`, from `@panneau/intl`: they have the messages\n * of every package.\n */\nexport const fr: Record<string, string> = Object.fromEntries(\n Object.entries(allFr).filter(([id]) => id in en),\n);\n"],"mappings":";;;;;;;;;AAUA,IAAa,KAA6B,mBAAmB,QAAQ;;;;;;;AAQrE,IAAa,KAA6B,OAAO,YAC7C,OAAO,QAAQA,IAAK,CAAC,CAAC,QAAQ,CAAC,QAAQ,MAAM,EAAE,CACnD"}
1
+ {"version":3,"file":"index.js","names":["fr","allFr","getDefaultMessages","messages","en","Record","Object","fromEntries","entries","filter","id","allFr"],"sources":["../../src/locales/index.ts"],"sourcesContent":["import { fr as allFr, getDefaultMessages } from '@panneau/intl';\n\nimport { messages } from '../intl/messages';\n\n/**\n * The English messages of `@panneau/ui`, by id. They are also the default messages.\n *\n * @deprecated Use `en`, or `withPanneauMessages()`, from `@panneau/intl`: they have the messages\n * of every package.\n */\nexport const en: Record<string, string> = getDefaultMessages(messages);\n\n/**\n * The French messages of `@panneau/ui`, by id.\n *\n * @deprecated Use `fr`, or `withPanneauMessages()`, from `@panneau/intl`: they have the messages\n * of every package.\n */\nexport const fr: Record<string, string> = Object.fromEntries(\n Object.entries(allFr).filter(([id]) => id in en),\n);\n"],"mappings":";;;;;;;;;AAUA,IAAaI,KAA6BF,mBAAmBC,QAAQ;;;;;;;AAQrE,IAAaH,KAA6BM,OAAOC,YAC7CD,OAAOE,QAAQP,IAAK,CAAC,CAACQ,QAAQ,CAACC,QAAQA,MAAMN,EAAE,CACnD"}
@@ -1,6 +1,6 @@
1
1
  import { type ReactNode } from 'react';
2
2
  import { type MenuItemProps as AriaMenuItemProps, type MenuProps as AriaMenuProps, type MenuSectionProps as AriaMenuSectionProps } from 'react-aria-components';
3
- import { type IconComponent } from '../icon/Icon';
3
+ import { type IconComponent } from '../icon/Icon.js';
4
4
  export interface MenuProps<T extends object> extends Omit<AriaMenuProps<T>, 'className' | 'style'> {
5
5
  className?: string;
6
6
  popoverClassName?: string;
package/dist/menu/Menu.js CHANGED
@@ -3,74 +3,200 @@ import { Icon } from "../icon/Icon.js";
3
3
  import { PopoverSurface } from "../popover/Popover.js";
4
4
  import ListBox_module_default from "../select/ListBox.module.js";
5
5
  import Menu_module_default from "./Menu.module.js";
6
+ import { c } from "react/compiler-runtime";
6
7
  import { Check } from "lucide-react";
7
8
  import { Header, Menu, MenuItem, MenuSection, MenuTrigger, Separator, Text } from "react-aria-components";
8
9
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
9
10
  import { useId } from "react";
10
- import { c } from "react/compiler-runtime";
11
11
  //#region src/menu/Menu.tsx
12
12
  /**
13
13
  * A menu of actions, inside a `MenuTrigger` with its button as the first child. Arrow keys move
14
14
  * between items, and typing a letter jumps to an item. With `selectionMode` (`single` or
15
15
  * `multiple`) and `selectedKeys`, its items are choices, and the selected ones have a check.
16
16
  */
17
- function Menu$1({ className, popoverClassName, placement = "bottom start", footer, footerClassName, ...props }) {
17
+ function Menu$1(t0) {
18
+ const $ = c(27);
19
+ let className;
20
+ let footer;
21
+ let footerClassName;
22
+ let popoverClassName;
23
+ let props;
24
+ let t1;
25
+ if ($[0] !== t0) {
26
+ ({className, popoverClassName, placement: t1, footer, footerClassName, ...props} = t0);
27
+ $[0] = t0;
28
+ $[1] = className;
29
+ $[2] = footer;
30
+ $[3] = footerClassName;
31
+ $[4] = popoverClassName;
32
+ $[5] = props;
33
+ $[6] = t1;
34
+ } else {
35
+ className = $[1];
36
+ footer = $[2];
37
+ footerClassName = $[3];
38
+ popoverClassName = $[4];
39
+ props = $[5];
40
+ t1 = $[6];
41
+ }
42
+ const placement = t1 === void 0 ? "bottom start" : t1;
18
43
  const footerId = useId();
19
44
  const hasFooter = footer !== void 0 && footer !== null;
20
- const menu = /* @__PURE__ */ jsx(Menu, {
21
- ...props,
22
- "aria-describedby": hasFooter ? [props["aria-describedby"], footerId].filter(Boolean).join(" ") : props["aria-describedby"],
23
- className: cx("panneau-menu", ListBox_module_default.listBox, className)
24
- });
25
- return /* @__PURE__ */ jsx(PopoverSurface, {
26
- placement,
27
- className: popoverClassName,
28
- children: hasFooter ? /* @__PURE__ */ jsxs("div", {
45
+ let t2;
46
+ if ($[7] !== footerId || $[8] !== hasFooter || $[9] !== props) {
47
+ t2 = hasFooter ? [props["aria-describedby"], footerId].filter(Boolean).join(" ") : props["aria-describedby"];
48
+ $[7] = footerId;
49
+ $[8] = hasFooter;
50
+ $[9] = props;
51
+ $[10] = t2;
52
+ } else t2 = $[10];
53
+ let t3;
54
+ if ($[11] !== className) {
55
+ t3 = cx("panneau-menu", ListBox_module_default.listBox, className);
56
+ $[11] = className;
57
+ $[12] = t3;
58
+ } else t3 = $[12];
59
+ let t4;
60
+ if ($[13] !== props || $[14] !== t2 || $[15] !== t3) {
61
+ t4 = /* @__PURE__ */ jsx(Menu, {
62
+ ...props,
63
+ "aria-describedby": t2,
64
+ className: t3
65
+ });
66
+ $[13] = props;
67
+ $[14] = t2;
68
+ $[15] = t3;
69
+ $[16] = t4;
70
+ } else t4 = $[16];
71
+ const menu = t4;
72
+ let t5;
73
+ if ($[17] !== footer || $[18] !== footerClassName || $[19] !== footerId || $[20] !== hasFooter || $[21] !== menu) {
74
+ t5 = hasFooter ? /* @__PURE__ */ jsxs("div", {
29
75
  className: Menu_module_default.layout,
30
76
  children: [menu, /* @__PURE__ */ jsx("div", {
31
77
  id: footerId,
32
78
  className: cx(Menu_module_default.footer, footerClassName),
33
79
  children: footer
34
80
  })]
35
- }) : menu
36
- });
81
+ }) : menu;
82
+ $[17] = footer;
83
+ $[18] = footerClassName;
84
+ $[19] = footerId;
85
+ $[20] = hasFooter;
86
+ $[21] = menu;
87
+ $[22] = t5;
88
+ } else t5 = $[22];
89
+ let t6;
90
+ if ($[23] !== placement || $[24] !== popoverClassName || $[25] !== t5) {
91
+ t6 = /* @__PURE__ */ jsx(PopoverSurface, {
92
+ placement,
93
+ className: popoverClassName,
94
+ children: t5
95
+ });
96
+ $[23] = placement;
97
+ $[24] = popoverClassName;
98
+ $[25] = t5;
99
+ $[26] = t6;
100
+ } else t6 = $[26];
101
+ return t6;
37
102
  }
38
103
  /**
39
104
  * An item of a `Menu`. In a menu with a `selectionMode`, a selected item has a check at its end,
40
105
  * and the role of a radio (single) or a checkbox (multiple) item.
41
106
  */
42
- function MenuItem$1({ children, icon, media, description, isDanger = false, className, textValue, ...props }) {
43
- return /* @__PURE__ */ jsx(MenuItem, {
44
- ...props,
45
- textValue: textValue ?? (typeof children === "string" ? children : void 0),
46
- className: cx("panneau-menu-item", ListBox_module_default.item, Menu_module_default.item, className),
47
- "data-danger": isDanger || void 0,
48
- children: ({ isSelected, selectionMode }) => /* @__PURE__ */ jsxs(Fragment, { children: [
49
- media !== void 0 && media !== null ? /* @__PURE__ */ jsx("span", {
50
- className: Menu_module_default.media,
51
- children: media
52
- }) : icon !== void 0 ? /* @__PURE__ */ jsx(Icon, { icon }) : null,
53
- /* @__PURE__ */ jsxs("span", {
54
- className: ListBox_module_default.itemText,
55
- children: [/* @__PURE__ */ jsx(Text, {
56
- slot: "label",
57
- className: ListBox_module_default.itemLabel,
58
- children
59
- }), description !== void 0 ? /* @__PURE__ */ jsx(Text, {
60
- slot: "description",
61
- className: ListBox_module_default.itemDescription,
62
- children: description
63
- }) : null]
64
- }),
65
- selectionMode !== "none" ? /* @__PURE__ */ jsx("span", {
66
- className: Menu_module_default.check,
67
- children: isSelected ? /* @__PURE__ */ jsx(Icon, {
68
- icon: Check,
69
- size: "sm"
107
+ function MenuItem$1(t0) {
108
+ const $ = c(22);
109
+ let children;
110
+ let className;
111
+ let description;
112
+ let icon;
113
+ let media;
114
+ let props;
115
+ let t1;
116
+ let textValue;
117
+ if ($[0] !== t0) {
118
+ ({children, icon, media, description, isDanger: t1, className, textValue, ...props} = t0);
119
+ $[0] = t0;
120
+ $[1] = children;
121
+ $[2] = className;
122
+ $[3] = description;
123
+ $[4] = icon;
124
+ $[5] = media;
125
+ $[6] = props;
126
+ $[7] = t1;
127
+ $[8] = textValue;
128
+ } else {
129
+ children = $[1];
130
+ className = $[2];
131
+ description = $[3];
132
+ icon = $[4];
133
+ media = $[5];
134
+ props = $[6];
135
+ t1 = $[7];
136
+ textValue = $[8];
137
+ }
138
+ const isDanger = t1 === void 0 ? false : t1;
139
+ const t2 = textValue ?? (typeof children === "string" ? children : void 0);
140
+ let t3;
141
+ if ($[9] !== className) {
142
+ t3 = cx("panneau-menu-item", ListBox_module_default.item, Menu_module_default.item, className);
143
+ $[9] = className;
144
+ $[10] = t3;
145
+ } else t3 = $[10];
146
+ const t4 = isDanger || void 0;
147
+ let t5;
148
+ if ($[11] !== children || $[12] !== description || $[13] !== icon || $[14] !== media) {
149
+ t5 = (t6) => {
150
+ const { isSelected, selectionMode } = t6;
151
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
152
+ media !== void 0 && media !== null ? /* @__PURE__ */ jsx("span", {
153
+ className: Menu_module_default.media,
154
+ children: media
155
+ }) : icon !== void 0 ? /* @__PURE__ */ jsx(Icon, { icon }) : null,
156
+ /* @__PURE__ */ jsxs("span", {
157
+ className: ListBox_module_default.itemText,
158
+ children: [/* @__PURE__ */ jsx(Text, {
159
+ slot: "label",
160
+ className: ListBox_module_default.itemLabel,
161
+ children
162
+ }), description !== void 0 ? /* @__PURE__ */ jsx(Text, {
163
+ slot: "description",
164
+ className: ListBox_module_default.itemDescription,
165
+ children: description
166
+ }) : null]
167
+ }),
168
+ selectionMode !== "none" ? /* @__PURE__ */ jsx("span", {
169
+ className: Menu_module_default.check,
170
+ children: isSelected ? /* @__PURE__ */ jsx(Icon, {
171
+ icon: Check,
172
+ size: "sm"
173
+ }) : null
70
174
  }) : null
71
- }) : null
72
- ] })
73
- });
175
+ ] });
176
+ };
177
+ $[11] = children;
178
+ $[12] = description;
179
+ $[13] = icon;
180
+ $[14] = media;
181
+ $[15] = t5;
182
+ } else t5 = $[15];
183
+ let t6;
184
+ if ($[16] !== props || $[17] !== t2 || $[18] !== t3 || $[19] !== t4 || $[20] !== t5) {
185
+ t6 = /* @__PURE__ */ jsx(MenuItem, {
186
+ ...props,
187
+ textValue: t2,
188
+ className: t3,
189
+ "data-danger": t4,
190
+ children: t5
191
+ });
192
+ $[16] = props;
193
+ $[17] = t2;
194
+ $[18] = t3;
195
+ $[19] = t4;
196
+ $[20] = t5;
197
+ $[21] = t6;
198
+ } else t6 = $[21];
199
+ return t6;
74
200
  }
75
201
  /** A group of items of a `Menu`, with a header. */
76
202
  function MenuSection$1(t0) {
@@ -1 +1 @@
1
- {"version":3,"file":"Menu.js","names":["title","children","Menu","AriaMenu","listBoxStyles","styles","MenuItem","AriaMenuItem","_Fragment","MenuSection","_c","AriaMenuSection"],"sources":["../../src/menu/Menu.tsx"],"sourcesContent":["import { Check } from 'lucide-react';\nimport { type ReactNode, useId } from 'react';\nimport {\n Menu as AriaMenu,\n MenuItem as AriaMenuItem,\n type MenuItemProps as AriaMenuItemProps,\n type MenuProps as AriaMenuProps,\n MenuSection as AriaMenuSection,\n type MenuSectionProps as AriaMenuSectionProps,\n Header,\n Separator,\n Text,\n} from 'react-aria-components';\n\nimport { Icon, type IconComponent } from '../icon/Icon';\nimport { PopoverSurface } from '../popover/Popover';\nimport listBoxStyles from '../select/ListBox.module.css';\nimport { cx } from '../utils/cx';\nimport styles from './Menu.module.css';\n\nexport interface MenuProps<T extends object> extends Omit<AriaMenuProps<T>, 'className' | 'style'> {\n className?: string;\n popoverClassName?: string;\n placement?: 'bottom start' | 'bottom end' | 'top start' | 'top end';\n /**\n * A short note under the items, after a line, such as \"Only this step changes.\". It isn't an\n * item and can't be focused: the menu is described by it.\n */\n footer?: ReactNode;\n footerClassName?: string;\n}\n\n/**\n * A menu of actions, inside a `MenuTrigger` with its button as the first child. Arrow keys move\n * between items, and typing a letter jumps to an item. With `selectionMode` (`single` or\n * `multiple`) and `selectedKeys`, its items are choices, and the selected ones have a check.\n */\nexport function Menu<T extends object>({\n className,\n popoverClassName,\n placement = 'bottom start',\n footer,\n footerClassName,\n ...props\n}: MenuProps<T>) {\n const footerId = useId();\n const hasFooter = footer !== undefined && footer !== null;\n const menu = (\n <AriaMenu\n {...props}\n aria-describedby={\n hasFooter\n ? [props['aria-describedby'], footerId].filter(Boolean).join(' ')\n : props['aria-describedby']\n }\n className={cx('panneau-menu', listBoxStyles.listBox, className)}\n />\n );\n return (\n <PopoverSurface placement={placement} className={popoverClassName}>\n {hasFooter ? (\n <div className={styles.layout}>\n {menu}\n <div id={footerId} className={cx(styles.footer, footerClassName)}>\n {footer}\n </div>\n </div>\n ) : (\n menu\n )}\n </PopoverSurface>\n );\n}\n\nexport interface MenuItemProps extends Omit<AriaMenuItemProps, 'className' | 'style' | 'children'> {\n children?: ReactNode;\n icon?: IconComponent;\n /**\n * Leading media instead of an icon, such as an avatar or an image, sized with the item: larger\n * when the item has a description.\n */\n media?: ReactNode;\n description?: string;\n /** Styles the item as destructive. */\n isDanger?: boolean;\n className?: string;\n}\n\n/**\n * An item of a `Menu`. In a menu with a `selectionMode`, a selected item has a check at its end,\n * and the role of a radio (single) or a checkbox (multiple) item.\n */\nexport function MenuItem({\n children,\n icon,\n media,\n description,\n isDanger = false,\n className,\n textValue,\n ...props\n}: MenuItemProps) {\n return (\n <AriaMenuItem\n {...props}\n textValue={textValue ?? (typeof children === 'string' ? children : undefined)}\n className={cx('panneau-menu-item', listBoxStyles.item, styles.item, className)}\n data-danger={isDanger || undefined}\n >\n {({ isSelected, selectionMode }) => (\n <>\n {media !== undefined && media !== null ? (\n <span className={styles.media}>{media}</span>\n ) : icon !== undefined ? (\n <Icon icon={icon} />\n ) : null}\n <span className={listBoxStyles.itemText}>\n <Text slot=\"label\" className={listBoxStyles.itemLabel}>\n {children}\n </Text>\n {description !== undefined ? (\n <Text slot=\"description\" className={listBoxStyles.itemDescription}>\n {description}\n </Text>\n ) : null}\n </span>\n {selectionMode !== 'none' ? (\n <span className={styles.check}>\n {isSelected ? <Icon icon={Check} size=\"sm\" /> : null}\n </span>\n ) : null}\n </>\n )}\n </AriaMenuItem>\n );\n}\n\nexport interface MenuSectionProps<T extends object> extends Omit<\n AriaMenuSectionProps<T>,\n 'className' | 'style' | 'children' | 'items'\n> {\n /**\n * The header of the section, a small muted eyebrow above its items, such as \"Publish on\". It\n * labels the group. Without it, give the section an `aria-label`.\n */\n title?: ReactNode;\n children?: ReactNode;\n className?: string;\n headerClassName?: string;\n}\n\n/** A group of items of a `Menu`, with a header. */\nexport function MenuSection<T extends object>({\n title,\n children,\n className,\n headerClassName,\n ...props\n}: MenuSectionProps<T>) {\n return (\n <AriaMenuSection {...props} className={cx(styles.section, className)}>\n {title !== undefined && title !== null ? (\n <Header className={cx(styles.header, headerClassName)}>{title}</Header>\n ) : null}\n {children}\n </AriaMenuSection>\n );\n}\n\n/** A line between groups of menu items. */\nexport function MenuSeparator() {\n return <Separator className={listBoxStyles.separator} />;\n}\n\nexport { MenuTrigger } from 'react-aria-components';\n"],"mappings":";;;;;;;;;;;;;;;;AAqCA,SAAgBE,OAAuB,EACnC,WACA,kBACA,YAAY,gBACZ,QACA,iBACA,GAAG,SACU;CACb,MAAM,WAAW,MAAM;CACvB,MAAM,YAAY,WAAW,KAAA,KAAa,WAAW;CACrD,MAAM,OACF,oBAACC,MAAD;EACI,GAAI;EACJ,oBACI,YACM,CAAC,MAAM,qBAAqB,QAAQ,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG,IAC9D,MAAM;EAEhB,WAAW,GAAG,gBAAgBC,uBAAc,SAAS,SAAS;CAAE,CAAA;CAGxE,OACI,oBAAC,gBAAD;EAA2B;EAAW,WAAW;EAC5C,UAAA,YACG,qBAAC,OAAD;GAAK,WAAWC,oBAAO;GAAvB,UAAA,CACK,MACD,oBAAC,OAAD;IAAK,IAAI;IAAU,WAAW,GAAGA,oBAAO,QAAQ,eAAe;IAC1D,UAAA;GACA,CAAA,CACJ;EAEL,CAAA,IAAA;CAEQ,CAAA;AAExB;;;;;AAoBA,SAAgBC,WAAS,EACrB,UACA,MACA,OACA,aACA,WAAW,OACX,WACA,WACA,GAAG,SACW;CACd,OACI,oBAACC,UAAD;EACI,GAAI;EACJ,WAAW,cAAc,OAAO,aAAa,WAAW,WAAW,KAAA;EACnE,WAAW,GAAG,qBAAqBH,uBAAc,MAAMC,oBAAO,MAAM,SAAS;EAC7E,eAAa,YAAY,KAAA;EAEvB,WAAA,EAAE,YAAY,oBACZ,qBAAAG,UAAA,EAAA,UAAA;GACK,UAAU,KAAA,KAAa,UAAU,OAC9B,oBAAC,QAAD;IAAM,WAAWH,oBAAO;IAAQ,UAAA;GAAY,CAAA,IAC5C,SAAS,KAAA,IACT,oBAAC,MAAD,EAAY,KAAK,CAAA,IACjB;GACJ,qBAAC,QAAD;IAAM,WAAWD,uBAAc;IAA/B,UAAA,CACI,oBAAC,MAAD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AA,QAAA,MAAA,EAAA,QAAA,IAAA;EAHZ,KAAA,qBAACM,aAAD;GAAgB,GAAK;GAAkB,WAAA;GAAvC,UAAA,CACK,IAGA,QAJW;;EAKE,EAAA,MAAA;EAAA,EAAA,MAAA;EAAA,EAAA,MAAA;EAAA,EAAA,MAAA;EAAA,EAAA,MAAA;CAAA,OAAA,KAAA,EAAA;CAAA,OALlB;AAKkB;;AAK1B,SAAO,gBAAA;CAAA,MAAA,IAAAD,EAAA,CAAA;CAAA,IAAA;CAAA,IAAA,EAAA,OAAA,OAAA,IAAA,2BAAA,GAAA;EACI,KAAA,oBAAC,WAAD,EAAsB,WAAAN,uBAAa,UAAU,CAAA;EAAI,EAAA,KAAA;CAAA,OAAA,KAAA,EAAA;CAAA,OAAjD;AAAiD"}
1
+ {"version":3,"file":"Menu.js","names":["Check","ReactNode","useId","Menu","AriaMenu","MenuItem","AriaMenuItem","MenuItemProps","AriaMenuItemProps","MenuProps","AriaMenuProps","MenuSection","AriaMenuSection","MenuSectionProps","AriaMenuSectionProps","Header","Separator","Text","Icon","IconComponent","PopoverSurface","listBoxStyles","cx","styles","Omit","T","className","popoverClassName","placement","footer","footerClassName","t0","$","_c","props","t1","undefined","footerId","hasFooter","t2","filter","Boolean","join","t3","listBox","t4","menu","t5","layout","t6","children","icon","media","description","isDanger","textValue","item","isSelected","selectionMode","itemText","itemLabel","itemDescription","check","title","headerClassName","section","header","MenuSeparator","Symbol","for","separator","MenuTrigger","Menu","_c","listBoxStyles","AriaMenu","styles","MenuItem","_Fragment","AriaMenuItem","MenuSection","AriaMenuSection"],"sources":["../../src/menu/Menu.tsx"],"sourcesContent":["import { Check } from 'lucide-react';\nimport { type ReactNode, useId } from 'react';\nimport {\n Menu as AriaMenu,\n MenuItem as AriaMenuItem,\n type MenuItemProps as AriaMenuItemProps,\n type MenuProps as AriaMenuProps,\n MenuSection as AriaMenuSection,\n type MenuSectionProps as AriaMenuSectionProps,\n Header,\n Separator,\n Text,\n} from 'react-aria-components';\n\nimport { Icon, type IconComponent } from '../icon/Icon';\nimport { PopoverSurface } from '../popover/Popover';\nimport listBoxStyles from '../select/ListBox.module.css';\nimport { cx } from '../utils/cx';\nimport styles from './Menu.module.css';\n\nexport interface MenuProps<T extends object> extends Omit<AriaMenuProps<T>, 'className' | 'style'> {\n className?: string;\n popoverClassName?: string;\n placement?: 'bottom start' | 'bottom end' | 'top start' | 'top end';\n /**\n * A short note under the items, after a line, such as \"Only this step changes.\". It isn't an\n * item and can't be focused: the menu is described by it.\n */\n footer?: ReactNode;\n footerClassName?: string;\n}\n\n/**\n * A menu of actions, inside a `MenuTrigger` with its button as the first child. Arrow keys move\n * between items, and typing a letter jumps to an item. With `selectionMode` (`single` or\n * `multiple`) and `selectedKeys`, its items are choices, and the selected ones have a check.\n */\nexport function Menu<T extends object>({\n className,\n popoverClassName,\n placement = 'bottom start',\n footer,\n footerClassName,\n ...props\n}: MenuProps<T>) {\n const footerId = useId();\n const hasFooter = footer !== undefined && footer !== null;\n const menu = (\n <AriaMenu\n {...props}\n aria-describedby={\n hasFooter\n ? [props['aria-describedby'], footerId].filter(Boolean).join(' ')\n : props['aria-describedby']\n }\n className={cx('panneau-menu', listBoxStyles.listBox, className)}\n />\n );\n return (\n <PopoverSurface placement={placement} className={popoverClassName}>\n {hasFooter ? (\n <div className={styles.layout}>\n {menu}\n <div id={footerId} className={cx(styles.footer, footerClassName)}>\n {footer}\n </div>\n </div>\n ) : (\n menu\n )}\n </PopoverSurface>\n );\n}\n\nexport interface MenuItemProps extends Omit<AriaMenuItemProps, 'className' | 'style' | 'children'> {\n children?: ReactNode;\n icon?: IconComponent;\n /**\n * Leading media instead of an icon, such as an avatar or an image, sized with the item: larger\n * when the item has a description.\n */\n media?: ReactNode;\n description?: string;\n /** Styles the item as destructive. */\n isDanger?: boolean;\n className?: string;\n}\n\n/**\n * An item of a `Menu`. In a menu with a `selectionMode`, a selected item has a check at its end,\n * and the role of a radio (single) or a checkbox (multiple) item.\n */\nexport function MenuItem({\n children,\n icon,\n media,\n description,\n isDanger = false,\n className,\n textValue,\n ...props\n}: MenuItemProps) {\n return (\n <AriaMenuItem\n {...props}\n textValue={textValue ?? (typeof children === 'string' ? children : undefined)}\n className={cx('panneau-menu-item', listBoxStyles.item, styles.item, className)}\n data-danger={isDanger || undefined}\n >\n {({ isSelected, selectionMode }) => (\n <>\n {media !== undefined && media !== null ? (\n <span className={styles.media}>{media}</span>\n ) : icon !== undefined ? (\n <Icon icon={icon} />\n ) : null}\n <span className={listBoxStyles.itemText}>\n <Text slot=\"label\" className={listBoxStyles.itemLabel}>\n {children}\n </Text>\n {description !== undefined ? (\n <Text slot=\"description\" className={listBoxStyles.itemDescription}>\n {description}\n </Text>\n ) : null}\n </span>\n {selectionMode !== 'none' ? (\n <span className={styles.check}>\n {isSelected ? <Icon icon={Check} size=\"sm\" /> : null}\n </span>\n ) : null}\n </>\n )}\n </AriaMenuItem>\n );\n}\n\nexport interface MenuSectionProps<T extends object> extends Omit<\n AriaMenuSectionProps<T>,\n 'className' | 'style' | 'children' | 'items'\n> {\n /**\n * The header of the section, a small muted eyebrow above its items, such as \"Publish on\". It\n * labels the group. Without it, give the section an `aria-label`.\n */\n title?: ReactNode;\n children?: ReactNode;\n className?: string;\n headerClassName?: string;\n}\n\n/** A group of items of a `Menu`, with a header. */\nexport function MenuSection<T extends object>({\n title,\n children,\n className,\n headerClassName,\n ...props\n}: MenuSectionProps<T>) {\n return (\n <AriaMenuSection {...props} className={cx(styles.section, className)}>\n {title !== undefined && title !== null ? (\n <Header className={cx(styles.header, headerClassName)}>{title}</Header>\n ) : null}\n {children}\n </AriaMenuSection>\n );\n}\n\n/** A line between groups of menu items. */\nexport function MenuSeparator() {\n return <Separator className={listBoxStyles.separator} />;\n}\n\nexport { MenuTrigger } from 'react-aria-components';\n"],"mappings":";;;;;;;;;;;;;;;;AAqCA,SAAOG,OAAA4B,IAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CAAA,IAAAP;CAAA,IAA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and selection of its items. */
2
- export declare const menuTokens: import("..").ComponentTokens<"menu", "panneau-menu-header-font-size" | "panneau-menu-header-font-weight" | "panneau-menu-header-color" | "panneau-menu-header-text-transform" | "panneau-menu-header-letter-spacing" | "panneau-menu-footer-font-size" | "panneau-menu-footer-color" | "panneau-menu-media-size" | "panneau-menu-media-size-described" | "panneau-menu-media-radius" | "panneau-menu-item-bg-selected">;
2
+ export declare const menuTokens: import("../index.js").ComponentTokens<"menu", "panneau-menu-header-font-size" | "panneau-menu-header-font-weight" | "panneau-menu-header-color" | "panneau-menu-header-text-transform" | "panneau-menu-header-letter-spacing" | "panneau-menu-footer-font-size" | "panneau-menu-footer-color" | "panneau-menu-media-size" | "panneau-menu-media-size-described" | "panneau-menu-media-radius" | "panneau-menu-item-bg-selected">;
3
3
  //# sourceMappingURL=tokens.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"tokens.js","names":[],"sources":["../../src/menu/tokens.ts"],"sourcesContent":["import { defineComponentTokens } from '../theme/componentTokens';\n\n/** Tokens of Menu: its sections, its footer, and the media and selection of its items. */\nexport const menuTokens = defineComponentTokens('menu', {\n /** Font size of the header of a section. */\n 'header-font-size': 'var(--panneau-font-size-xs)',\n /** Font weight of the header of a section. */\n 'header-font-weight': 'var(--panneau-font-weight-medium)',\n /** Color of the header of a section. */\n 'header-color': 'var(--panneau-color-text-muted)',\n /** Case of the header of a section: `uppercase` makes it an eyebrow, `none` keeps its text. */\n 'header-text-transform': 'uppercase',\n /** Letter spacing of the header of a section. */\n 'header-letter-spacing': '0.04em',\n /** Font size of the footer note. */\n 'footer-font-size': 'var(--panneau-font-size-xs)',\n /** Color of the footer note. */\n 'footer-color': 'var(--panneau-color-text-muted)',\n /** Size of the leading media of an item. */\n 'media-size': '1.5rem',\n /** Size of the leading media of an item with a description, on two lines. */\n 'media-size-described': '2rem',\n /** Corner radius of the leading media of an item: its content is clipped to it. */\n 'media-radius': 'var(--panneau-radius-full)',\n /** Background of a selected item. */\n 'item-bg-selected': 'var(--panneau-color-surface-sunken)',\n});\n"],"mappings":";;;AAGA,IAAa,aAAa,sBAAsB,QAAQ;;CAEpD,oBAAoB;;CAEpB,sBAAsB;;CAEtB,gBAAgB;;CAEhB,yBAAyB;;CAEzB,yBAAyB;;CAEzB,oBAAoB;;CAEpB,gBAAgB;;CAEhB,cAAc;;CAEd,wBAAwB;;CAExB,gBAAgB;;CAEhB,oBAAoB;AACxB,CAAC"}
1
+ {"version":3,"file":"tokens.js","names":["defineComponentTokens","menuTokens"],"sources":["../../src/menu/tokens.ts"],"sourcesContent":["import { defineComponentTokens } from '../theme/componentTokens';\n\n/** Tokens of Menu: its sections, its footer, and the media and selection of its items. */\nexport const menuTokens = defineComponentTokens('menu', {\n /** Font size of the header of a section. */\n 'header-font-size': 'var(--panneau-font-size-xs)',\n /** Font weight of the header of a section. */\n 'header-font-weight': 'var(--panneau-font-weight-medium)',\n /** Color of the header of a section. */\n 'header-color': 'var(--panneau-color-text-muted)',\n /** Case of the header of a section: `uppercase` makes it an eyebrow, `none` keeps its text. */\n 'header-text-transform': 'uppercase',\n /** Letter spacing of the header of a section. */\n 'header-letter-spacing': '0.04em',\n /** Font size of the footer note. */\n 'footer-font-size': 'var(--panneau-font-size-xs)',\n /** Color of the footer note. */\n 'footer-color': 'var(--panneau-color-text-muted)',\n /** Size of the leading media of an item. */\n 'media-size': '1.5rem',\n /** Size of the leading media of an item with a description, on two lines. */\n 'media-size-described': '2rem',\n /** Corner radius of the leading media of an item: its content is clipped to it. */\n 'media-radius': 'var(--panneau-radius-full)',\n /** Background of a selected item. */\n 'item-bg-selected': 'var(--panneau-color-surface-sunken)',\n});\n"],"mappings":";;;AAGA,IAAaC,aAAaD,sBAAsB,QAAQ;;CAEpD,oBAAoB;;CAEpB,sBAAsB;;CAEtB,gBAAgB;;CAEhB,yBAAyB;;CAEzB,yBAAyB;;CAEzB,oBAAoB;;CAEpB,gBAAgB;;CAEhB,cAAc;;CAEd,wBAAwB;;CAExB,gBAAgB;;CAEhB,oBAAoB;AACxB,CAAC"}
@@ -1,2 +1,2 @@
1
- export { lucideIconLoader } from '../icon/lucideIconLoader';
1
+ export { lucideIconLoader } from '../icon/lucideIconLoader.js';
2
2
  //# sourceMappingURL=index.d.ts.map
@@ -1,6 +1,6 @@
1
1
  import type { ReactNode } from 'react';
2
2
  import { type NumberFieldProps as AriaNumberFieldProps } from 'react-aria-components';
3
- import { type FieldChromeProps } from '../field/FieldParts';
3
+ import { type FieldChromeProps } from '../field/FieldParts.js';
4
4
  export interface NumberInputProps extends Omit<AriaNumberFieldProps, 'className' | 'style' | 'children' | 'isInvalid' | 'validate' | 'value' | 'defaultValue' | 'onChange'>, FieldChromeProps {
5
5
  /** The number, or `null` when empty. */
6
6
  value?: number | null;