@eifi1/ui-kit 0.7.1 → 0.8.1

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 (222) hide show
  1. package/README.md +32 -17
  2. package/dist/chart.d.ts +3 -2
  3. package/dist/components/alert-banner.d.ts +59 -10
  4. package/dist/components/alert-banner.js +114 -8
  5. package/dist/components/alert-banner.js.map +1 -1
  6. package/dist/components/amount-input.d.ts +3 -0
  7. package/dist/components/button-group.d.ts +26 -0
  8. package/dist/components/button-group.js +49 -0
  9. package/dist/components/button-group.js.map +1 -0
  10. package/dist/components/calculator.d.ts +3 -0
  11. package/dist/components/chart-zoom.d.ts +63 -14
  12. package/dist/components/chart-zoom.js +82 -16
  13. package/dist/components/chart-zoom.js.map +1 -1
  14. package/dist/components/chip.d.ts +67 -2
  15. package/dist/components/chip.js +73 -8
  16. package/dist/components/chip.js.map +1 -1
  17. package/dist/components/confirm-dialog.d.ts +120 -0
  18. package/dist/components/confirm-dialog.js +96 -0
  19. package/dist/components/confirm-dialog.js.map +1 -0
  20. package/dist/components/copy-button.d.ts +62 -0
  21. package/dist/components/copy-button.js +95 -0
  22. package/dist/components/copy-button.js.map +1 -0
  23. package/dist/components/data-table-filter-popover.d.ts +1 -1
  24. package/dist/components/data-table-filters.d.ts +1 -1
  25. package/dist/components/data-table-pagination.d.ts +5 -1
  26. package/dist/components/data-table-pagination.js +71 -58
  27. package/dist/components/data-table-pagination.js.map +1 -1
  28. package/dist/components/data-table-sort.d.ts +28 -5
  29. package/dist/components/data-table-sort.js +11 -7
  30. package/dist/components/data-table-sort.js.map +1 -1
  31. package/dist/components/data-table.d.ts +1 -1
  32. package/dist/components/data-table.js +544 -423
  33. package/dist/components/data-table.js.map +1 -1
  34. package/dist/components/date-picker.d.ts +51 -5
  35. package/dist/components/date-picker.js +152 -40
  36. package/dist/components/date-picker.js.map +1 -1
  37. package/dist/components/description-list.d.ts +60 -0
  38. package/dist/components/description-list.js +112 -0
  39. package/dist/components/description-list.js.map +1 -0
  40. package/dist/components/disclosure.d.ts +37 -2
  41. package/dist/components/disclosure.js +14 -5
  42. package/dist/components/disclosure.js.map +1 -1
  43. package/dist/components/facing-pair.d.ts +2 -0
  44. package/dist/components/file-button.d.ts +17 -1
  45. package/dist/components/file-button.js +8 -1
  46. package/dist/components/file-button.js.map +1 -1
  47. package/dist/components/file-dropzone.d.ts +54 -9
  48. package/dist/components/file-dropzone.js +100 -70
  49. package/dist/components/file-dropzone.js.map +1 -1
  50. package/dist/components/floating-panel.d.ts +107 -0
  51. package/dist/components/floating-panel.js +206 -0
  52. package/dist/components/floating-panel.js.map +1 -0
  53. package/dist/components/full-bleed-dialog.d.ts +12 -1
  54. package/dist/components/full-bleed-dialog.js +28 -5
  55. package/dist/components/full-bleed-dialog.js.map +1 -1
  56. package/dist/components/modal.d.ts +6 -2
  57. package/dist/components/modal.js +2 -1
  58. package/dist/components/modal.js.map +1 -1
  59. package/dist/components/number-field.d.ts +3 -0
  60. package/dist/components/number-input.d.ts +3 -0
  61. package/dist/components/numpad-sheet.d.ts +3 -0
  62. package/dist/components/progress-bar.d.ts +54 -0
  63. package/dist/components/progress-bar.js +94 -0
  64. package/dist/components/progress-bar.js.map +1 -0
  65. package/dist/components/scroll-area.d.ts +53 -0
  66. package/dist/components/scroll-area.js +86 -0
  67. package/dist/components/scroll-area.js.map +1 -0
  68. package/dist/components/separator.d.ts +23 -0
  69. package/dist/components/separator.js +24 -0
  70. package/dist/components/separator.js.map +1 -0
  71. package/dist/components/series-chart-ticks.d.ts +34 -1
  72. package/dist/components/series-chart-ticks.js +83 -1
  73. package/dist/components/series-chart-ticks.js.map +1 -1
  74. package/dist/components/series-chart.d.ts +314 -19
  75. package/dist/components/series-chart.js +510 -120
  76. package/dist/components/series-chart.js.map +1 -1
  77. package/dist/components/skeleton.d.ts +36 -0
  78. package/dist/components/skeleton.js +35 -0
  79. package/dist/components/skeleton.js.map +1 -0
  80. package/dist/components/stat-tile.d.ts +60 -6
  81. package/dist/components/stat-tile.js +60 -26
  82. package/dist/components/stat-tile.js.map +1 -1
  83. package/dist/components/table.d.ts +83 -0
  84. package/dist/components/table.js +166 -0
  85. package/dist/components/table.js.map +1 -0
  86. package/dist/components/toggle-legend.d.ts +3 -2
  87. package/dist/components/toggle-legend.js +1 -1
  88. package/dist/components/toggle-legend.js.map +1 -1
  89. package/dist/components/tree-view.d.ts +129 -0
  90. package/dist/components/tree-view.js +376 -0
  91. package/dist/components/tree-view.js.map +1 -0
  92. package/dist/components/treemap.d.ts +9 -2
  93. package/dist/components/treemap.js +6 -2
  94. package/dist/components/treemap.js.map +1 -1
  95. package/dist/components/ui.d.ts +94 -13
  96. package/dist/components/ui.js +111 -29
  97. package/dist/components/ui.js.map +1 -1
  98. package/dist/components/use-table-state.d.ts +1 -1
  99. package/dist/{data-table-filters-noy0Abvi.d.ts → data-table-filters-CF1PXqjQ.d.ts} +73 -3
  100. package/dist/data-table.d.ts +2 -2
  101. package/dist/data-table.js.map +1 -1
  102. package/dist/hooks/use-copy-to-clipboard.d.ts +28 -0
  103. package/dist/hooks/use-copy-to-clipboard.js +81 -0
  104. package/dist/hooks/use-copy-to-clipboard.js.map +1 -0
  105. package/dist/hooks/use-debounce.d.ts +43 -0
  106. package/dist/hooks/use-debounce.js +56 -0
  107. package/dist/hooks/use-debounce.js.map +1 -0
  108. package/dist/hooks/use-file-drop.d.ts +72 -0
  109. package/dist/hooks/use-file-drop.js +57 -0
  110. package/dist/hooks/use-file-drop.js.map +1 -0
  111. package/dist/i18n/defaults.d.ts +3 -0
  112. package/dist/i18n/defaults.js +7 -1
  113. package/dist/i18n/defaults.js.map +1 -1
  114. package/dist/i18n/kit-labels.d.ts +15 -0
  115. package/dist/i18n/kit-labels.js +6 -2
  116. package/dist/i18n/kit-labels.js.map +1 -1
  117. package/dist/i18n/locales/de-CH-informal.d.ts +43 -0
  118. package/dist/i18n/locales/de-CH-informal.js +8 -0
  119. package/dist/i18n/locales/de-CH-informal.js.map +1 -0
  120. package/dist/i18n/locales/de-CH.d.ts +3 -0
  121. package/dist/i18n/locales/de-CH.js +1 -14
  122. package/dist/i18n/locales/de-CH.js.map +1 -1
  123. package/dist/i18n/locales/de-informal.d.ts +64 -0
  124. package/dist/i18n/locales/de-informal.js +37 -0
  125. package/dist/i18n/locales/de-informal.js.map +1 -0
  126. package/dist/i18n/locales/de.d.ts +3 -0
  127. package/dist/i18n/locales/de.js +25 -0
  128. package/dist/i18n/locales/de.js.map +1 -1
  129. package/dist/i18n/locales/es.d.ts +3 -0
  130. package/dist/i18n/locales/es.js +25 -0
  131. package/dist/i18n/locales/es.js.map +1 -1
  132. package/dist/i18n/locales/fr.d.ts +3 -0
  133. package/dist/i18n/locales/fr.js +25 -0
  134. package/dist/i18n/locales/fr.js.map +1 -1
  135. package/dist/i18n/locales/hu.d.ts +3 -0
  136. package/dist/i18n/locales/hu.js +25 -0
  137. package/dist/i18n/locales/hu.js.map +1 -1
  138. package/dist/i18n/locales/it.d.ts +3 -0
  139. package/dist/i18n/locales/it.js +25 -0
  140. package/dist/i18n/locales/it.js.map +1 -1
  141. package/dist/i18n/locales/zh.d.ts +3 -0
  142. package/dist/i18n/locales/zh.js +25 -0
  143. package/dist/i18n/locales/zh.js.map +1 -1
  144. package/dist/i18n/swiss.d.ts +13 -0
  145. package/dist/i18n/swiss.js +19 -0
  146. package/dist/i18n/swiss.js.map +1 -0
  147. package/dist/index.d.ts +25 -10
  148. package/dist/index.js +22 -0
  149. package/dist/index.js.map +1 -1
  150. package/dist/lib/dates.d.ts +37 -1
  151. package/dist/lib/dates.js +19 -0
  152. package/dist/lib/dates.js.map +1 -1
  153. package/dist/search/command-palette.d.ts +15 -1
  154. package/dist/search/command-palette.js +10 -2
  155. package/dist/search/command-palette.js.map +1 -1
  156. package/dist/wizard/stepper-nav.d.ts +35 -2
  157. package/dist/wizard/stepper-nav.js +54 -22
  158. package/dist/wizard/stepper-nav.js.map +1 -1
  159. package/dist/wizard/types.d.ts +107 -5
  160. package/dist/wizard/types.js +2 -1
  161. package/dist/wizard/types.js.map +1 -1
  162. package/dist/wizard/use-wizard.js +141 -21
  163. package/dist/wizard/use-wizard.js.map +1 -1
  164. package/dist/wizard/wizard-summary.d.ts +10 -2
  165. package/dist/wizard/wizard-summary.js +3 -1
  166. package/dist/wizard/wizard-summary.js.map +1 -1
  167. package/dist/wizard.d.ts +4 -1
  168. package/dist/wizard.js.map +1 -1
  169. package/package.json +1 -1
  170. package/src/components/alert-banner.tsx +211 -20
  171. package/src/components/button-group.tsx +75 -0
  172. package/src/components/chart-zoom.tsx +158 -20
  173. package/src/components/chip.tsx +160 -9
  174. package/src/components/confirm-dialog.tsx +242 -0
  175. package/src/components/copy-button.tsx +158 -0
  176. package/src/components/data-table-pagination.tsx +19 -6
  177. package/src/components/data-table-sort.ts +49 -10
  178. package/src/components/data-table.tsx +293 -24
  179. package/src/components/date-picker.tsx +262 -57
  180. package/src/components/description-list.tsx +174 -0
  181. package/src/components/disclosure.tsx +58 -5
  182. package/src/components/file-button.tsx +22 -2
  183. package/src/components/file-dropzone.tsx +198 -100
  184. package/src/components/floating-panel.tsx +341 -0
  185. package/src/components/full-bleed-dialog.tsx +53 -5
  186. package/src/components/modal.tsx +9 -2
  187. package/src/components/progress-bar.tsx +163 -0
  188. package/src/components/scroll-area.tsx +129 -0
  189. package/src/components/separator.tsx +37 -0
  190. package/src/components/series-chart-ticks.ts +135 -0
  191. package/src/components/series-chart.tsx +934 -67
  192. package/src/components/skeleton.tsx +65 -0
  193. package/src/components/stat-tile.tsx +160 -27
  194. package/src/components/table.tsx +263 -0
  195. package/src/components/toggle-legend.tsx +4 -3
  196. package/src/components/tree-view.tsx +589 -0
  197. package/src/components/treemap.tsx +13 -2
  198. package/src/components/ui.tsx +270 -39
  199. package/src/data-table.ts +2 -0
  200. package/src/hooks/use-copy-to-clipboard.ts +122 -0
  201. package/src/hooks/use-debounce.ts +105 -0
  202. package/src/hooks/use-file-drop.ts +123 -0
  203. package/src/i18n/defaults.ts +6 -0
  204. package/src/i18n/kit-labels.tsx +19 -0
  205. package/src/i18n/locales/de-CH-informal.ts +10 -0
  206. package/src/i18n/locales/de-CH.ts +1 -16
  207. package/src/i18n/locales/de-informal.ts +61 -0
  208. package/src/i18n/locales/de.ts +25 -0
  209. package/src/i18n/locales/es.ts +25 -0
  210. package/src/i18n/locales/fr.ts +25 -0
  211. package/src/i18n/locales/hu.ts +25 -0
  212. package/src/i18n/locales/it.ts +25 -0
  213. package/src/i18n/locales/zh.ts +25 -0
  214. package/src/i18n/swiss.ts +25 -0
  215. package/src/index.ts +29 -0
  216. package/src/lib/dates.ts +48 -0
  217. package/src/search/command-palette.tsx +29 -3
  218. package/src/wizard/stepper-nav.tsx +102 -28
  219. package/src/wizard/types.ts +106 -4
  220. package/src/wizard/use-wizard.ts +211 -31
  221. package/src/wizard/wizard-summary.tsx +24 -12
  222. package/src/wizard.ts +3 -2
package/README.md CHANGED
@@ -373,22 +373,22 @@ columns, strings and permissions (see the note at the top of `src/feedback/feedb
373
373
 
374
374
  <!-- BEGIN GENERATED: exports — node scripts/gen-export-inventory.mjs -->
375
375
 
376
- **594 names from 105 modules** — 331 values and 263 types. _Italic_ is a type-only export.
376
+ **705 names from 120 modules** — 368 values and 337 types. _Italic_ is a type-only export.
377
377
 
378
378
  Generated from `dist/index.d.ts` by `node scripts/gen-export-inventory.mjs`; the count
379
379
  is pinned by `src/__tests__/public-surface.test.ts`. Do not edit between the markers.
380
380
 
381
381
  | Entry point | Names |
382
382
  |---|---|
383
- | `@eifi1/ui-kit` | 594 |
384
- | `@eifi1/ui-kit/chart` | 73 |
383
+ | `@eifi1/ui-kit` | 705 |
384
+ | `@eifi1/ui-kit/chart` | 93 |
385
385
  | `@eifi1/ui-kit/shell` | 18 |
386
- | `@eifi1/ui-kit/data-table` | 28 |
387
- | `@eifi1/ui-kit/wizard` | 20 |
386
+ | `@eifi1/ui-kit/data-table` | 32 |
387
+ | `@eifi1/ui-kit/wizard` | 21 |
388
388
  | `@eifi1/ui-kit/tour` | 7 |
389
389
  | `@eifi1/ui-kit/feedback` | 29 |
390
390
  | `@eifi1/ui-kit/search` | 5 |
391
- | `@eifi1/ui-kit/dates` | 16 |
391
+ | `@eifi1/ui-kit/dates` | 20 |
392
392
  | `@eifi1/ui-kit/table-text` | 8 |
393
393
  | `@eifi1/ui-kit/rhf` | 13 |
394
394
 
@@ -417,6 +417,9 @@ re-slicing of it, never a second API.
417
417
  | `hooks/use-overlay-history` | `useOverlayHistory` |
418
418
  | `hooks/use-close-transition` | `OVERLAY_EXIT_MS`, `useCloseTransition` |
419
419
  | `hooks/use-row-swipe` | `useRowSwipe`, _`RowSwipeOptions`_, _`RowSwipeReturn`_, _`SwipeStage`_ |
420
+ | `hooks/use-file-drop` | `dragHasFiles`, `useFileDrop`, _`FileDropProps`_, _`UseFileDropOptions`_, _`UseFileDropReturn`_ |
421
+ | `hooks/use-debounce` | `useDebounce`, `useDebouncedCallback`, _`DebouncedCallbackOptions`_, _`DebouncedFunction`_ |
422
+ | `hooks/use-copy-to-clipboard` | `copyToClipboard`, `useCopyToClipboard`, _`CopyState`_, _`UseCopyToClipboardOptions`_, _`UseCopyToClipboardReturn`_ |
420
423
  | `hooks/use-windowed-rows` | `useWindowedRows`, _`WindowedRows`_ |
421
424
 
422
425
  ### theme, palettes, colour
@@ -434,7 +437,7 @@ re-slicing of it, never a second API.
434
437
 
435
438
  | Module | Exports |
436
439
  |---|---|
437
- | `components/ui` | `Button`, `buttonClasses`, `Card`, `CardAction`, `CardContent`, `CardDescription`, `CardFooter`, `CardHeader`, `CardTitle`, `DEFAULT_PASSWORD_REVEAL_LABELS`, `DEFAULT_TABS_LABELS`, `EmptyState`, `FIELD_BASE`, `FIELD_DISPLAY`, `FIELD_FLOATING_PAD`, `FIELD_INVALID`, `FIELD_TRIGGER`, `FIELD_WRITABLE_LOOK`, `FieldChevron`, `FieldHint`, `FieldLabel`, `FLOATING_INPUT_CLASS`, `FLOATING_LABEL_CLASS`, `FLOATING_LABEL_STATIC`, `FloatingField`, `IconButton`, `Input`, `Label`, `PHONE_QUERY`, `resolvePasswordRevealLabels`, `Select`, `Spinner`, `Tabs`, `Textarea`, _`ButtonProps`_, _`ButtonVariant`_, _`CardActionProps`_, _`CardContentProps`_, _`CardDescriptionProps`_, _`CardFooterProps`_, _`CardHeaderProps`_, _`CardProps`_, _`CardTitleProps`_, _`EmptyStateProps`_, _`FieldChevronProps`_, _`FieldHintProps`_, _`FieldLabelProps`_, _`FloatingFieldProps`_, _`IconButtonProps`_, _`IconButtonSize`_, _`InputProps`_, _`LabelProps`_, _`PasswordRevealLabels`_, _`SelectProps`_, _`SpinnerProps`_, _`TabItem`_, _`TabsLabels`_, _`TabsProps`_, _`TextareaProps`_ |
440
+ | `components/ui` | `Button`, `buttonClasses`, `Card`, `CardAction`, `CardContent`, `CardDescription`, `CardFooter`, `CardHeader`, `CardTitle`, `DEFAULT_PASSWORD_REVEAL_LABELS`, `DEFAULT_TABS_LABELS`, `EmptyState`, `FIELD_BASE`, `FIELD_DISPLAY`, `FIELD_FLOATING_PAD`, `FIELD_INVALID`, `FIELD_TRIGGER`, `FIELD_WRITABLE_LOOK`, `FieldChevron`, `FieldHint`, `FieldLabel`, `FLOATING_INPUT_CLASS`, `FLOATING_LABEL_CLASS`, `FLOATING_LABEL_STATIC`, `FloatingField`, `IconButton`, `Input`, `Label`, `PHONE_QUERY`, `resolvePasswordRevealLabels`, `Select`, `Spinner`, `Tabs`, `Textarea`, _`ButtonClassesOptions`_, _`ButtonProps`_, _`ButtonSize`_, _`ButtonVariant`_, _`CardActionProps`_, _`CardContentProps`_, _`CardDescriptionProps`_, _`CardFooterProps`_, _`CardHeaderProps`_, _`CardProps`_, _`CardTitleProps`_, _`EmptyStateProps`_, _`FieldChevronProps`_, _`FieldHintProps`_, _`FieldLabelProps`_, _`FloatingFieldProps`_, _`IconButtonProps`_, _`IconButtonSize`_, _`InputProps`_, _`LabelProps`_, _`PasswordRevealLabels`_, _`SelectProps`_, _`SpinnerProps`_, _`TabItem`_, _`TabsLabels`_, _`TabsProps`_, _`TextareaProps`_ |
438
441
  | `components/search-field` | `SearchField`, _`SearchFieldProps`_ |
439
442
  | `components/dropdown` | `DropdownPanel`, `DropdownSearchHeader`, `useDropdown`, `useDropdownSearch`, _`DropdownPanelProps`_, _`DropdownSearchHeaderProps`_ |
440
443
  | `components/popover` | `DEFAULT_POPOVER_LABELS`, `Popover`, _`PopoverLabels`_, _`PopoverProps`_ |
@@ -449,7 +452,7 @@ re-slicing of it, never a second API.
449
452
  | `components/entity-combobox` | `EntityCombobox`, _`EntityComboboxProps`_ |
450
453
  | `components/multi-entity-combobox` | `MultiEntityCombobox`, _`MultiEntityComboboxProps`_ |
451
454
  | `components/multi-select` | `MultiSelect`, _`MultiSelectOption`_, _`MultiSelectProps`_ |
452
- | `components/tooltip` | `placeTooltip`, `Tooltip`, _`TooltipPlacement`_, _`TooltipProps`_, _`TooltipSize`_, _`TooltipViewport`_ |
455
+ | `components/tooltip` | `placeTooltip`, `Tooltip`, _`TooltipPlacement`_, _`TooltipProps`_, _`TooltipSide`_, _`TooltipSize`_, _`TooltipViewport`_ |
453
456
  | `components/user-avatar` | `avatarInitials`, `UserAvatar`, _`UserAvatarProps`_ |
454
457
  | `components/settings-fields` | `LanguageSetting`, `ThemeSetting`, _`LanguageSettingProps`_, _`ThemeSettingProps`_ |
455
458
  | `components/field-sync` | `DEFAULT_FIELD_SYNC_LABELS`, `FIELD_SYNC_FRAME`, `FIELD_SYNC_SAVED_MS`, `FieldSyncIndicator`, `FieldSyncRow`, `resolveFieldSyncLabels`, `useFieldSync`, _`FieldSyncIndicatorProps`_, _`FieldSyncLabels`_, _`FieldSyncRowProps`_, _`FieldSyncState`_, _`UseFieldSyncOptions`_, _`UseFieldSyncReturn`_ |
@@ -464,9 +467,11 @@ re-slicing of it, never a second API.
464
467
  | `components/signature-pad` | `DEFAULT_SIGNATURE_PAD_LABELS`, `SignaturePad`, `SignatureView`, _`SignatureDetail`_, _`SignaturePadHandle`_, _`SignaturePadLabels`_, _`SignaturePadProps`_, _`SignatureViewProps`_ |
465
468
  | `components/password-strength` | `DEFAULT_PASSWORD_STRENGTH_LABELS`, `passwordByteLength`, `passwordRules`, `PasswordStrengthMeter`, `scorePassword`, _`PasswordRule`_, _`PasswordRuleId`_, _`PasswordScoreOptions`_, _`PasswordStrengthLabels`_, _`PasswordStrengthMeterProps`_, _`PasswordStrengthScore`_ |
466
469
  | `components/page-contents` | `DEFAULT_PAGE_CONTENTS_LABELS`, `PageContents`, `PageContentsLayout`, `useScrollSpy`, _`PageContentsItem`_, _`PageContentsLabels`_, _`PageContentsLayoutProps`_, _`PageContentsProps`_, _`UseScrollSpyOptions`_ |
467
- | `components/disclosure` | `Collapse`, `Disclosure`, _`CollapseProps`_, _`DisclosureProps`_ |
470
+ | `components/disclosure` | `Collapse`, `Disclosure`, _`CollapseProps`_, _`DisclosureProps`_, _`DisclosureTriggerProps`_ |
468
471
  | `components/dialog-frame` | `DEFAULT_DIALOG_FRAME_LABELS`, `DialogFrame`, _`DialogFrameLabels`_, _`DialogFrameProps`_ |
469
472
  | `components/danger-confirm` | `DangerConfirm`, `DEFAULT_DANGER_CONFIRM_LABELS`, _`DangerConfirmLabels`_, _`DangerConfirmProps`_ |
473
+ | `components/confirm-dialog` | `ConfirmProvider`, `DEFAULT_CONFIRM_DIALOG_LABELS`, `useConfirm`, _`ConfirmDialogLabels`_, _`ConfirmFn`_, _`ConfirmOptions`_, _`ConfirmProviderProps`_, _`ConfirmTone`_ |
474
+ | `components/floating-panel` | `DEFAULT_FLOATING_PANEL_LABELS`, `FloatingActionButton`, `FloatingPanel`, _`FloatingActionButtonProps`_, _`FloatingCorner`_, _`FloatingPanelLabels`_, _`FloatingPanelProps`_ |
470
475
  | `components/swatch-picker` | `DEFAULT_SWATCH_PICKER_LABELS`, `SwatchPicker`, _`SwatchOption`_, _`SwatchPickerLabels`_, _`SwatchPickerProps`_ |
471
476
  | `components/icon-picker` | `DEFAULT_ICON_PICKER_LABELS`, `IconPicker`, _`IconOption`_, _`IconPickerLabels`_, _`IconPickerProps`_ |
472
477
  | `components/choice-card` | `ChoiceCard`, `ChoiceCardGroup`, _`ChoiceCardGroupProps`_, _`ChoiceCardMultipleProps`_, _`ChoiceCardOption`_, _`ChoiceCardProps`_, _`ChoiceCardSingleProps`_, _`ChoiceCardType`_ |
@@ -474,31 +479,41 @@ re-slicing of it, never a second API.
474
479
  | `components/measured-grid` | `DEFAULT_MEASURED_GRID_LABELS`, `MeasuredGrid`, `useMeasuredRows`, _`MeasuredGridColumn`_, _`MeasuredGridLabels`_, _`MeasuredGridProps`_, _`MeasuredGridView`_, _`MeasuredRows`_, _`UseMeasuredRowsOptions`_ |
475
480
  | `components/file-button` | `DEFAULT_FILE_PICKER_LABELS`, `FileButton`, `matchesAccept`, `useFilePicker`, _`FileButtonProps`_, _`FilePickerLabels`_, _`FileRejection`_, _`FileRejectionReason`_, _`FileScreenOptions`_, _`UseFilePickerOptions`_, _`UseFilePickerReturn`_ |
476
481
  | `components/treemap` | `fitLabel`, `Treemap`, `TreemapCell`, _`TreemapCellProps`_, _`TreemapNode`_, _`TreemapProps`_ |
477
- | `components/series-chart` | `AXIS_TICK_WIDTH`, `AXIS_TITLE_STRIP`, `axisBandWidth`, `mergeSeries`, `oneAxis`, `padBand`, `paddedDomain`, `SeriesChart`, `seriesKey`, `soleSeriesColor`, `StaticSeriesChart`, _`SeriesChartAxis`_, _`SeriesChartProps`_, _`SeriesChartSeries`_, _`SeriesChartSpan`_, _`SeriesChartX`_, _`SeriesSource`_ |
478
- | `components/chart-zoom` | `DEFAULT_Y_AXIS`, `fitXToY`, `fitYToX`, `NO_ZOOM`, `selectionFromDrag`, `SharedXZoom`, `withChartZoom`, `ZOOM_MIN_DRAG`, `ZOOM_SQUARE_ENOUGH`, `zoomAfter`, `zoomAxesFor`, `zoomDomains`, _`ZoomAxes`_, _`ZoomBinding`_, _`ZoomDrag`_, _`ZoomFitSource`_, _`ZoomSelection`_, _`ZoomState`_, _`ZoomTarget`_ |
482
+ | `components/series-chart` | `anchoredBand`, `AXIS_TICK_WIDTH`, `AXIS_TITLE_STRIP`, `axisBandWidth`, `mergeSeries`, `oneAxis`, `padBand`, `paddedDomain`, `SeriesChart`, `seriesKey`, `seriesLegendEntries`, `soleSeriesColor`, `StaticSeriesChart`, `visibleSeries`, _`SeriesChartAxis`_, _`SeriesChartHit`_, _`SeriesChartMarker`_, _`SeriesChartPoint`_, _`SeriesChartProps`_, _`SeriesChartReference`_, _`SeriesChartRow`_, _`SeriesChartSeries`_, _`SeriesChartSpan`_, _`SeriesChartTickValues`_, _`SeriesChartTone`_, _`SeriesChartTooltip`_, _`SeriesChartType`_, _`SeriesChartX`_, _`SeriesChartXTick`_, _`SeriesChartXValue`_, _`SeriesSource`_ |
483
+ | `components/chart-zoom` | `axisExtent`, `DEFAULT_Y_AXIS`, `defaultZoomAxes`, `fitXToY`, `fitYToX`, `NO_ZOOM`, `selectionFromDrag`, `SharedXZoom`, `withChartZoom`, `ZOOM_MIN_DRAG`, `ZOOM_SQUARE_ENOUGH`, `zoomAfter`, `zoomAxesFor`, `zoomDomains`, _`ZoomAxes`_, _`ZoomAxesSetting`_, _`ZoomBinding`_, _`ZoomDrag`_, _`ZoomFitSeries`_, _`ZoomFitSource`_, _`ZoomRow`_, _`ZoomSelection`_, _`ZoomState`_, _`ZoomTarget`_ |
479
484
  | `components/toggle-legend` | `LegendColumn`, `LegendGroup`, `STEP_DASH`, `STROKE_PATTERNS`, `strokeDash`, `toggleHidden`, `ToggleLegend`, _`LegendEntry`_, _`ToggleLegendProps`_ |
480
485
  | `components/facing-pair` | `FACING_SIDES`, `facingAxes`, `facingBand`, `facingHeadingPad`, _`FacingSide`_ |
481
486
  | `components/series-chart-labels` | `DEFAULT_SERIES_CHART_LABELS`, _`SeriesChartLabels`_ |
482
487
  | `components/account-settings` | `PasswordSetting`, `ProfileSetting`, `TwoFactorSetting`, _`PasswordSettingLabels`_, _`ProfileSettingLabels`_, _`TwoFactorSettingLabels`_ |
483
488
  | `components/alert-banner` | `AlertBanner`, `alertFrameClass`, `toneFrameClass`, _`AlertBannerProps`_, _`AlertTone`_ |
484
489
  | `components/toggle-group` | `ToggleGroup`, _`ToggleGroupBaseProps`_, _`ToggleGroupClearableProps`_, _`ToggleGroupProps`_, _`ToggleGroupRequiredProps`_, _`ToggleOption`_ |
485
- | `components/chip` | `Chip`, `ChipInput`, `DEFAULT_CHIP_INPUT_LABELS`, `resolveChipInputLabels`, _`ChipInputLabels`_, _`ChipInputProps`_, _`ChipProps`_, _`ChipSize`_, _`ChipTone`_ |
490
+ | `components/chip` | `Chip`, `ChipInput`, `DEFAULT_CHIP_INPUT_LABELS`, `resolveChipInputLabels`, _`ChipInputLabels`_, _`ChipInputProps`_, _`ChipLinkProps`_, _`ChipProps`_, _`ChipShape`_, _`ChipSize`_, _`ChipTone`_, _`ChipVariant`_ |
486
491
  | `components/wizard-stepper` | `WizardStepper` |
487
492
  | `components/hover-menu` | `HoverMenu`, _`HoverMenuProps`_ |
488
493
  | `components/modal` | `Modal`, `ModalCloseContext`, `useBackdropClose`, _`ModalProps`_ |
489
494
  | `components/full-bleed-dialog` | `FullBleedDialog`, _`FullBleedDialogProps`_ |
490
495
  | `components/grouped-picker` | `GroupedPicker`, _`GroupedPickerProps`_, _`PickerGroup`_ |
491
- | `components/file-dropzone` | `FileDropzone`, _`FileDropzoneProps`_, _`FileDropzoneRejectionFeedback`_ |
496
+ | `components/file-dropzone` | `FileDropzone`, _`FileDropzoneProps`_, _`FileDropzoneRejectionFeedback`_, _`FileDropzoneState`_ |
492
497
  | `components/mini-calendar` | `DEFAULT_MINI_CALENDAR_LABELS`, `MiniCalendar`, _`MiniCalendarLabels`_, _`MiniCalendarProps`_, _`WeekDay`_ |
493
- | `components/date-picker` | `DatePicker`, `DateRangePicker`, _`DatePickerProps`_, _`DateRangePickerPreset`_, _`DateRangePickerProps`_ |
498
+ | `components/date-picker` | `DatePicker`, `DateRangePicker`, _`DatePickerProps`_, _`DateRangeCommit`_, _`DateRangePickerPreset`_, _`DateRangePickerProps`_ |
499
+ | `components/tree-view` | `TreeRow`, `TreeView`, _`TreeItemState`_, _`TreeNode`_, _`TreeRowProps`_, _`TreeViewProps`_ |
494
500
  | `components/chart` | `ChartContainer`, `ChartLegend`, `ChartLegendContent`, `ChartTooltip`, `ChartTooltipContent`, `useChart`, _`ChartConfig`_, _`ChartSeriesConfig`_ |
501
+ | `components/description-list` | `DescriptionItem`, `DescriptionList`, _`DescriptionItemProps`_, _`DescriptionListDensity`_, _`DescriptionListLayout`_, _`DescriptionListProps`_ |
502
+ | `components/progress-bar` | `ProgressBar`, _`ProgressBarProps`_, _`ProgressBarSize`_, _`ProgressBarTone`_ |
503
+ | `components/skeleton` | `Skeleton`, _`SkeletonProps`_, _`SkeletonShape`_ |
504
+ | `components/copy-button` | `CopyButton`, `DEFAULT_COPY_BUTTON_LABELS`, _`CopyButtonLabels`_, _`CopyButtonProps`_ |
505
+ | `components/button-group` | `ButtonGroup`, _`ButtonGroupProps`_ |
506
+ | `components/table` | `NUMERIC_CELL_CLASS`, `Table`, `TableBody`, `TableCaption`, `TableCell`, `TableFoot`, `TableHead`, `TableHeaderCell`, `TableRow`, _`TableAlign`_, _`TableBodyProps`_, _`TableCaptionProps`_, _`TableCellProps`_, _`TableDensity`_, _`TableFootProps`_, _`TableHeaderCellProps`_, _`TableHeadProps`_, _`TableProps`_, _`TableRowProps`_ |
507
+ | `components/separator` | `Separator`, _`SeparatorProps`_ |
508
+ | `components/scroll-area` | `ScrollArea`, _`ScrollAreaProps`_ |
495
509
  | `components/data-table-labels` | `DEFAULT_DATA_TABLE_LABELS`, `missingDataTableLabels`, `resolveDataTableLabels`, _`DataTableLabels`_ |
496
- | `components/data-table-sort` | `decodeSorts`, `encodeSorts`, `nextSorts`, `normalizeSorts`, _`SortDir`_, _`SortState`_ |
510
+ | `components/data-table-sort` | `decodeSorts`, `encodeSorts`, `nextSorts`, `normalizeSorts`, _`SortCycle`_, _`SortDir`_, _`SortState`_, _`SortStepOptions`_ |
497
511
  | `components/data-table-filters` | `decodeFilterValue`, `decodeFilterValueOfType`, `defaultFilterState`, `encodeFilterValue`, `isFilterActive`, `resolveFilter`, `rowMatches`, _`ColumnFilter`_, _`FilterValue`_ |
498
- | `components/data-table` | `DataTable`, _`DataTableColumn`_, _`DataTableProps`_, _`FilterState`_, _`MobileSwipeActions`_, _`ServerPagination`_ |
512
+ | `components/data-table` | `DataTable`, _`DataTableChrome`_, _`DataTableColumn`_, _`DataTableDensity`_, _`DataTableProps`_, _`FilterState`_, _`MobileSwipeActions`_, _`ServerPagination`_ |
499
513
  | `components/data-table-pagination` | `PAGE_SIZE_OPTIONS`, `Pagination` |
500
514
  | `components/data-table-filter-popover` | `FilterPopover` |
501
515
  | `components/combobox-core` | _`ComboClearValue`_, _`ComboOption`_ |
516
+ | `components/series-chart-ticks` | _`TimeTickUnit`_ |
502
517
 
503
518
  ### shell
504
519
 
@@ -523,7 +538,7 @@ re-slicing of it, never a second API.
523
538
 
524
539
  | Module | Exports |
525
540
  |---|---|
526
- | `wizard/types` | `DEFAULT_WIZARD_LABELS`, `resolveWizardLabels`, _`FieldErrors`_, _`StepStatus`_, _`SummaryItem`_, _`SummarySection`_, _`UseWizardOptions`_, _`UseWizardReturn`_, _`ValidateResult`_, _`WizardLabels`_, _`WizardStepConfig`_ |
541
+ | `wizard/types` | `DEFAULT_WIZARD_LABELS`, `resolveWizardLabels`, _`FieldErrors`_, _`StepStatus`_, _`SummaryItem`_, _`SummarySection`_, _`UseWizardOptions`_, _`UseWizardReturn`_, _`ValidateResult`_, _`WizardLabels`_, _`WizardStepConfig`_, _`WizardUrlSync`_ |
527
542
  | `wizard/use-wizard` | `useWizard` |
528
543
  | `wizard/wizard-context` | `useWizardContext`, `WizardContextProvider`, _`WizardContextValue`_ |
529
544
  | `wizard/validation` | `requiredFieldsValidator`, _`RequiredFieldSpec`_ |
package/dist/chart.d.ts CHANGED
@@ -1,11 +1,12 @@
1
1
  export { ChartConfig, ChartContainer, ChartLegend, ChartLegendContent, ChartSeriesConfig, ChartTooltip, ChartTooltipContent, useChart } from './components/chart.js';
2
2
  export { CHART_COLORS, HEATMAP_HEX, HeatStops, PALETTE_HEX, lerpHex, paletteFor, textOn } from './theme/chart-palette.js';
3
3
  export { Treemap, TreemapCell, TreemapCellProps, TreemapNode, TreemapProps, fitLabel } from './components/treemap.js';
4
- export { AXIS_TICK_WIDTH, AXIS_TITLE_STRIP, SeriesChart, SeriesChartAxis, SeriesChartProps, SeriesChartSeries, SeriesChartSpan, SeriesChartX, SeriesSource, StaticSeriesChart, axisBandWidth, mergeSeries, oneAxis, padBand, paddedDomain, seriesKey, soleSeriesColor } from './components/series-chart.js';
5
- export { DEFAULT_Y_AXIS, NO_ZOOM, SharedXZoom, ZOOM_MIN_DRAG, ZOOM_SQUARE_ENOUGH, ZoomAxes, ZoomBinding, ZoomDrag, ZoomFitSource, ZoomSelection, ZoomState, ZoomTarget, fitXToY, fitYToX, selectionFromDrag, withChartZoom, zoomAfter, zoomAxesFor, zoomDomains } from './components/chart-zoom.js';
4
+ export { AXIS_TICK_WIDTH, AXIS_TITLE_STRIP, SeriesChart, SeriesChartAxis, SeriesChartHit, SeriesChartMarker, SeriesChartPoint, SeriesChartProps, SeriesChartReference, SeriesChartRow, SeriesChartSeries, SeriesChartSpan, SeriesChartTickValues, SeriesChartTone, SeriesChartTooltip, SeriesChartType, SeriesChartX, SeriesChartXTick, SeriesChartXValue, SeriesSource, StaticSeriesChart, anchoredBand, axisBandWidth, mergeSeries, oneAxis, padBand, paddedDomain, seriesKey, seriesLegendEntries, soleSeriesColor, visibleSeries } from './components/series-chart.js';
5
+ export { DEFAULT_Y_AXIS, NO_ZOOM, SharedXZoom, ZOOM_MIN_DRAG, ZOOM_SQUARE_ENOUGH, ZoomAxes, ZoomAxesSetting, ZoomBinding, ZoomDrag, ZoomFitSeries, ZoomFitSource, ZoomRow, ZoomSelection, ZoomState, ZoomTarget, axisExtent, defaultZoomAxes, fitXToY, fitYToX, selectionFromDrag, withChartZoom, zoomAfter, zoomAxesFor, zoomDomains } from './components/chart-zoom.js';
6
6
  export { LegendColumn, LegendEntry, LegendGroup, STEP_DASH, STROKE_PATTERNS, ToggleLegend, ToggleLegendProps, strokeDash, toggleHidden } from './components/toggle-legend.js';
7
7
  export { FACING_SIDES, FacingSide, facingAxes, facingBand, facingHeadingPad } from './components/facing-pair.js';
8
8
  export { DEFAULT_SERIES_CHART_LABELS, SeriesChartLabels } from './components/series-chart-labels.js';
9
+ export { TimeTickUnit } from './components/series-chart-ticks.js';
9
10
  import 'recharts';
10
11
  import 'react';
11
12
  import './lib/direction.js';
@@ -1,7 +1,10 @@
1
1
  import * as react from 'react';
2
- import { ComponentPropsWithoutRef, ReactNode } from 'react';
2
+ import { ComponentPropsWithoutRef, ReactNode, MouseEvent } from 'react';
3
3
 
4
- type AlertTone = "danger" | "warning" | "neutral";
4
+ /** `info` (0.8.0) is the sky family, for news that is neither good nor bad: keksdose's
5
+ * preview and beta-performance banners, which borrowed `warning` for want of it and
6
+ * so told every user of the preview build that something was wrong. */
7
+ type AlertTone = "danger" | "warning" | "info" | "neutral";
5
8
  /** The tone's border + surface on their own — for a caller that already has a box
6
9
  * with its own radius and padding (e.g. a Card). Remember to shave 1px off that
7
10
  * padding for the colored tones, whose border is 2px wide. */
@@ -10,15 +13,61 @@ declare function toneFrameClass(tone: AlertTone): string;
10
13
  * and surface plus this component's own radius and padding, the latter
11
14
  * compensating the 2px colored border so toggling tones never shifts layout. */
12
15
  declare function alertFrameClass(tone: AlertTone): string;
13
- interface AlertBannerProps extends ComponentPropsWithoutRef<"div"> {
14
- /** `neutral` is deliberately not offered: a callout with a warning triangle in it
15
- * and no colour is a warning that looks like a note, which is the one thing this
16
- * box must never be. The neutral frame is still available on its own through
17
- * {@link toneFrameClass}. */
18
- tone?: Exclude<AlertTone, "neutral">;
16
+ interface AlertBannerBaseProps extends Omit<ComponentPropsWithoutRef<"div">, "onClick"> {
17
+ /** Default `danger`. `info` for news, `neutral` for a plain note — see
18
+ * {@link TONE_GLYPH} for why a neutral banner is now allowed. */
19
+ tone?: AlertTone;
20
+ /**
21
+ * `box` (default): the framed callout. `inline`: the tone's colour, glyph and role
22
+ * and NOTHING else — no border, no surface, no padding — so it fits inside a
23
+ * toolbar row beside the controls it is about. Lenkbank's corner-motion toolbar
24
+ * shows "Radius below the minimum" and "Solving…" there; a box would have doubled
25
+ * the row's height every time either appeared.
26
+ *
27
+ * The inline variant is also a LIVE REGION by default — `role="alert"` for
28
+ * `danger`, `role="status"` for the rest — because a message that appears in a
29
+ * toolbar in answer to what the user just did is exactly the kind a screen reader
30
+ * otherwise never hears. The box stays role-less as it always was: it is usually
31
+ * page furniture present at load, and an alert that fires on every navigation is
32
+ * noise. Either way a `role` you pass wins.
33
+ */
34
+ variant?: "box" | "inline";
35
+ /** Replaces the tone's glyph — a `<Spinner label={null} />` for "Solving…", say.
36
+ * `null` draws none. Always decorative; the text carries the message. */
37
+ icon?: ReactNode;
38
+ /** Renders an × at the end that calls this. The banner does not hide itself — the
39
+ * caller removes it (and remembers that it did), as with every other kit control
40
+ * whose state is app state. */
41
+ onDismiss?: () => void;
42
+ /** Accessible name of the ×. Default: `common.dismiss` from the
43
+ * {@link UiKitProvider}, else "Dismiss". */
44
+ dismissLabel?: string;
19
45
  children: ReactNode;
20
46
  }
21
- /** Static warning/danger callout box with the shared frame and an icon. */
22
- declare function AlertBanner({ tone, className, children, ...rest }: AlertBannerProps): react.JSX.Element;
47
+ /**
48
+ * The whole-row modes. keksdose's budget-summary card is a banner you tap to open
49
+ * the budget; built from a `<div onClick>` it was a mouse-only target, and built as a
50
+ * banner with a link inside it was a small target inside a big one that looked like
51
+ * one. So `onClick` makes the banner itself ONE `<button>`, and `href` makes it one
52
+ * `<a>`, with a trailing chevron that says so. Mutually exclusive, as on `Chip`.
53
+ *
54
+ * With `onDismiss` as well, the × cannot go inside the button (interactive content
55
+ * may not nest), so the frame becomes a wrapper holding two siblings: the row's
56
+ * button, stretched over the whole frame, and the × on top of it. It still looks and
57
+ * clicks like one banner with an × in its corner, and the two are separate tab stops.
58
+ */
59
+ type AlertBannerProps = AlertBannerBaseProps & ({
60
+ /** Makes the whole banner one link. Mutually exclusive with `onClick`. */
61
+ href?: string;
62
+ onClick?: never;
63
+ } | {
64
+ href?: never;
65
+ /** Makes the whole banner one button. Mutually exclusive with `href`. The
66
+ * event's element is the `<button>`, not a `<div>`. */
67
+ onClick?: (event: MouseEvent<HTMLElement>) => void;
68
+ });
69
+ /** Warning/danger/info callout box with the shared frame and an icon — or, with
70
+ * `variant="inline"`, the same message as a frameless line of toned text. */
71
+ declare function AlertBanner({ tone, variant, icon, onDismiss, dismissLabel, href, onClick, className, children, role, ...rest }: AlertBannerProps): react.JSX.Element;
23
72
 
24
73
  export { AlertBanner, type AlertBannerProps, type AlertTone, alertFrameClass, toneFrameClass };
@@ -1,10 +1,12 @@
1
1
  "use client";
2
- import { jsx, jsxs } from "react/jsx-runtime";
3
- import { AlertTriangle } from "lucide-react";
2
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
3
+ import { AlertTriangle, ChevronRight, Info, X } from "lucide-react";
4
4
  import { cn } from "../lib/cn.js";
5
+ import { DEFAULT_COMMON_LABELS, useKitLabels } from "../i18n/kit-labels.js";
5
6
  const TONE_FRAME = {
6
7
  danger: "border-2 border-[var(--danger-border)] bg-[var(--danger-bg)]",
7
8
  warning: "border-2 border-[var(--warning-border)] bg-[var(--warning-bg)]",
9
+ info: "border-2 border-[var(--info-border)] bg-[var(--info-bg)]",
8
10
  neutral: "border border-[var(--border)]"
9
11
  };
10
12
  function toneFrameClass(tone) {
@@ -16,21 +18,125 @@ function alertFrameClass(tone) {
16
18
  }
17
19
  const TONE_TEXT = {
18
20
  danger: "text-[var(--danger)]",
19
- warning: "text-[var(--warning)]"
21
+ warning: "text-[var(--warning)]",
22
+ info: "text-[var(--info)]",
23
+ neutral: "text-[var(--text-secondary)]"
20
24
  };
21
25
  const TONE_ICON = {
22
26
  danger: "text-[var(--danger)]",
23
- warning: "text-[var(--warning)]"
27
+ warning: "text-[var(--warning)]",
28
+ info: "text-[var(--info)]",
29
+ neutral: "text-[var(--text-muted)]"
24
30
  };
25
- function AlertBanner({ tone = "danger", className, children, ...rest }) {
31
+ const TONE_GLYPH = {
32
+ danger: AlertTriangle,
33
+ warning: AlertTriangle,
34
+ info: Info,
35
+ neutral: Info
36
+ };
37
+ function AlertBanner({
38
+ tone = "danger",
39
+ variant = "box",
40
+ icon,
41
+ onDismiss,
42
+ dismissLabel,
43
+ href,
44
+ onClick,
45
+ className,
46
+ children,
47
+ role,
48
+ ...rest
49
+ }) {
50
+ const common = useKitLabels("common", DEFAULT_COMMON_LABELS, { dismiss: dismissLabel });
51
+ const inline = variant === "inline";
52
+ const interactive = href !== void 0 || onClick !== void 0;
53
+ const resolvedRole = role ?? (inline ? tone === "danger" ? "alert" : "status" : void 0);
54
+ const Glyph = TONE_GLYPH[tone];
55
+ const glyph = icon === null ? null : icon !== void 0 ? /* @__PURE__ */ jsx("span", { "aria-hidden": true, className: cn("flex shrink-0 [&_svg]:size-4", !inline && "mt-0.5", TONE_ICON[tone]), children: icon }) : /* @__PURE__ */ jsx(Glyph, { "aria-hidden": true, className: cn("size-4 shrink-0", !inline && "mt-0.5", TONE_ICON[tone]) });
56
+ const row = inline ? "inline-flex items-center gap-1.5 text-sm" : "flex items-start gap-2 text-sm";
57
+ const frame = inline ? "" : alertFrameClass(tone);
58
+ const focusRing = "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--brand)] focus-visible:ring-offset-1 focus-visible:ring-offset-[var(--bg-surface)]";
59
+ const content = /* @__PURE__ */ jsxs(Fragment, { children: [
60
+ glyph,
61
+ /* @__PURE__ */ jsx("span", { className: cn(!inline && "flex-1", "min-w-0 text-start"), children }),
62
+ interactive && /* @__PURE__ */ jsx(
63
+ ChevronRight,
64
+ {
65
+ "aria-hidden": true,
66
+ className: cn("size-4 shrink-0 opacity-70 rtl:-scale-x-100", !inline && "mt-0.5")
67
+ }
68
+ )
69
+ ] });
70
+ const dismiss = onDismiss ? /* @__PURE__ */ jsx(
71
+ "button",
72
+ {
73
+ type: "button",
74
+ "aria-label": common.dismiss,
75
+ onClick: (e) => {
76
+ e.preventDefault();
77
+ e.stopPropagation();
78
+ onDismiss();
79
+ },
80
+ className: cn(
81
+ // Negative margins so the × does not make the box taller than its text; the
82
+ // hover wash takes the tone's own hue, so it works on every tone.
83
+ "relative z-10 -my-0.5 -me-0.5 flex size-6 shrink-0 items-center justify-center rounded transition-colors hover:bg-current/10",
84
+ focusRing
85
+ ),
86
+ children: /* @__PURE__ */ jsx(X, { "aria-hidden": true, className: "size-4" })
87
+ }
88
+ ) : null;
89
+ if (!interactive) {
90
+ return /* @__PURE__ */ jsxs(
91
+ "div",
92
+ {
93
+ ...rest,
94
+ role: resolvedRole,
95
+ className: cn(row, frame, TONE_TEXT[tone], className),
96
+ children: [
97
+ content,
98
+ dismiss
99
+ ]
100
+ }
101
+ );
102
+ }
103
+ const hover = "cursor-pointer transition-[filter] hover:brightness-[0.97] dark:hover:brightness-110";
104
+ const split = dismiss !== null;
105
+ const actionClass = split ? cn(
106
+ "flex min-w-0 flex-1 gap-2 text-start",
107
+ inline ? "items-center" : "items-start",
108
+ "outline-none after:absolute after:inset-0 after:rounded-md after:content-['']",
109
+ "focus-visible:after:ring-2 focus-visible:after:ring-[var(--brand)]"
110
+ ) : cn(row, !inline && "w-full", frame, TONE_TEXT[tone], hover, focusRing, className);
111
+ const actionRest = split ? {} : rest;
112
+ const action = href !== void 0 ? /* @__PURE__ */ jsx(
113
+ "a",
114
+ {
115
+ ...actionRest,
116
+ href,
117
+ className: actionClass,
118
+ children: content
119
+ }
120
+ ) : /* @__PURE__ */ jsx(
121
+ "button",
122
+ {
123
+ ...actionRest,
124
+ type: "button",
125
+ onClick,
126
+ className: actionClass,
127
+ children: content
128
+ }
129
+ );
130
+ if (!split) return action;
26
131
  return /* @__PURE__ */ jsxs(
27
132
  "div",
28
133
  {
29
134
  ...rest,
30
- className: cn("flex items-start gap-2 text-sm", alertFrameClass(tone), TONE_TEXT[tone], className),
135
+ role: resolvedRole,
136
+ className: cn("relative", row, frame, TONE_TEXT[tone], hover, className),
31
137
  children: [
32
- /* @__PURE__ */ jsx(AlertTriangle, { className: cn("mt-0.5 size-4 shrink-0", TONE_ICON[tone]) }),
33
- /* @__PURE__ */ jsx("span", { className: "flex-1", children })
138
+ action,
139
+ dismiss
34
140
  ]
35
141
  }
36
142
  );
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/components/alert-banner.tsx"],"sourcesContent":["import type { ComponentPropsWithoutRef, ReactNode } from \"react\";\nimport { AlertTriangle } from \"lucide-react\";\nimport { cn } from \"../lib/cn\";\n\nexport type AlertTone = \"danger\" | \"warning\" | \"neutral\";\n\n/** Border + surface per tone, WITHOUT a radius or padding, so a caller that owns\n * its own box (a Card, say) can take the tone alone. Single source for both\n * {@link alertFrameClass} and {@link toneFrameClass}.\n *\n * The colored tones are 2px, not 1px, and that is load-bearing rather than\n * decorative. A 1px border is 1.25 device pixels on a 125%-scaled display — the\n * usual Windows setting — so whether it renders as a solid line or as two\n * half-lit pixels depends on where the box happens to land in device-pixel space.\n * The same card then shows a heavy left edge and a right edge that fades out,\n * which is what feedback #264, #277, #491 and #498 all reported. A 2px border is\n * 2.5 device pixels: it always covers at least two pixels fully, on both edges,\n * at any offset. Callers compensate the extra pixel in their own padding so\n * switching tones never shifts the layout. */\nconst TONE_FRAME: Record<AlertTone, string> = {\n danger: \"border-2 border-[var(--danger-border)] bg-[var(--danger-bg)]\",\n warning: \"border-2 border-[var(--warning-border)] bg-[var(--warning-bg)]\",\n neutral: \"border border-[var(--border)]\",\n};\n\n/** The tone's border + surface on their own — for a caller that already has a box\n * with its own radius and padding (e.g. a Card). Remember to shave 1px off that\n * padding for the colored tones, whose border is 2px wide. */\nexport function toneFrameClass(tone: AlertTone): string {\n return TONE_FRAME[tone];\n}\n\n/** Single source for the warning-callout frame (feedback #277): the tone's border\n * and surface plus this component's own radius and padding, the latter\n * compensating the 2px colored border so toggling tones never shifts layout. */\nexport function alertFrameClass(tone: AlertTone): string {\n const box = tone === \"neutral\" ? \"rounded-md p-3\" : \"rounded-md p-[11px]\";\n return `${box} ${TONE_FRAME[tone]}`;\n}\n\nconst TONE_TEXT: Record<Exclude<AlertTone, \"neutral\">, string> = {\n danger: \"text-[var(--danger)]\",\n warning: \"text-[var(--warning)]\",\n};\n\nconst TONE_ICON: Record<Exclude<AlertTone, \"neutral\">, string> = {\n danger: \"text-[var(--danger)]\",\n warning: \"text-[var(--warning)]\",\n};\n\nexport interface AlertBannerProps extends ComponentPropsWithoutRef<\"div\"> {\n /** `neutral` is deliberately not offered: a callout with a warning triangle in it\n * and no colour is a warning that looks like a note, which is the one thing this\n * box must never be. The neutral frame is still available on its own through\n * {@link toneFrameClass}. */\n tone?: Exclude<AlertTone, \"neutral\">;\n children: ReactNode;\n}\n\n/** Static warning/danger callout box with the shared frame and an icon. */\nexport function AlertBanner({ tone = \"danger\", className, children, ...rest }: AlertBannerProps) {\n return (\n <div\n // Arbitrary attributes first — a `data-tour` anchor, a test id, an\n // `aria-describedby` — then the layout and tone classes, which are merged\n // through `cn` rather than spread so a caller's `className` refines the box\n // instead of replacing it.\n {...rest}\n className={cn(\"flex items-start gap-2 text-sm\", alertFrameClass(tone), TONE_TEXT[tone], className)}\n >\n <AlertTriangle className={cn(\"mt-0.5 size-4 shrink-0\", TONE_ICON[tone])} />\n <span className=\"flex-1\">{children}</span>\n </div>\n );\n}\n"],"mappings":";AA8DI,SAQE,KARF;AA7DJ,SAAS,qBAAqB;AAC9B,SAAS,UAAU;AAiBnB,MAAM,aAAwC;AAAA,EAC5C,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,SAAS;AACX;AAKO,SAAS,eAAe,MAAyB;AACtD,SAAO,WAAW,IAAI;AACxB;AAKO,SAAS,gBAAgB,MAAyB;AACvD,QAAM,MAAM,SAAS,YAAY,mBAAmB;AACpD,SAAO,GAAG,GAAG,IAAI,WAAW,IAAI,CAAC;AACnC;AAEA,MAAM,YAA2D;AAAA,EAC/D,QAAQ;AAAA,EACR,SAAS;AACX;AAEA,MAAM,YAA2D;AAAA,EAC/D,QAAQ;AAAA,EACR,SAAS;AACX;AAYO,SAAS,YAAY,EAAE,OAAO,UAAU,WAAW,UAAU,GAAG,KAAK,GAAqB;AAC/F,SACE;AAAA,IAAC;AAAA;AAAA,MAKE,GAAG;AAAA,MACJ,WAAW,GAAG,kCAAkC,gBAAgB,IAAI,GAAG,UAAU,IAAI,GAAG,SAAS;AAAA,MAEjG;AAAA,4BAAC,iBAAc,WAAW,GAAG,0BAA0B,UAAU,IAAI,CAAC,GAAG;AAAA,QACzE,oBAAC,UAAK,WAAU,UAAU,UAAS;AAAA;AAAA;AAAA,EACrC;AAEJ;","names":[]}
1
+ {"version":3,"sources":["../../src/components/alert-banner.tsx"],"sourcesContent":["import type { ComponentPropsWithoutRef, MouseEvent, ReactNode } from \"react\";\nimport { AlertTriangle, ChevronRight, Info, X } from \"lucide-react\";\nimport { cn } from \"../lib/cn\";\nimport { DEFAULT_COMMON_LABELS, useKitLabels } from \"../i18n/kit-labels\";\n\n/** `info` (0.8.0) is the sky family, for news that is neither good nor bad: keksdose's\n * preview and beta-performance banners, which borrowed `warning` for want of it and\n * so told every user of the preview build that something was wrong. */\nexport type AlertTone = \"danger\" | \"warning\" | \"info\" | \"neutral\";\n\n/** Border + surface per tone, WITHOUT a radius or padding, so a caller that owns\n * its own box (a Card, say) can take the tone alone. Single source for both\n * {@link alertFrameClass} and {@link toneFrameClass}.\n *\n * The colored tones are 2px, not 1px, and that is load-bearing rather than\n * decorative. A 1px border is 1.25 device pixels on a 125%-scaled display — the\n * usual Windows setting — so whether it renders as a solid line or as two\n * half-lit pixels depends on where the box happens to land in device-pixel space.\n * The same card then shows a heavy left edge and a right edge that fades out,\n * which is what feedback #264, #277, #491 and #498 all reported. A 2px border is\n * 2.5 device pixels: it always covers at least two pixels fully, on both edges,\n * at any offset. Callers compensate the extra pixel in their own padding so\n * switching tones never shifts the layout. */\nconst TONE_FRAME: Record<AlertTone, string> = {\n danger: \"border-2 border-[var(--danger-border)] bg-[var(--danger-bg)]\",\n warning: \"border-2 border-[var(--warning-border)] bg-[var(--warning-bg)]\",\n info: \"border-2 border-[var(--info-border)] bg-[var(--info-bg)]\",\n neutral: \"border border-[var(--border)]\",\n};\n\n/** The tone's border + surface on their own — for a caller that already has a box\n * with its own radius and padding (e.g. a Card). Remember to shave 1px off that\n * padding for the colored tones, whose border is 2px wide. */\nexport function toneFrameClass(tone: AlertTone): string {\n return TONE_FRAME[tone];\n}\n\n/** Single source for the warning-callout frame (feedback #277): the tone's border\n * and surface plus this component's own radius and padding, the latter\n * compensating the 2px colored border so toggling tones never shifts layout. */\nexport function alertFrameClass(tone: AlertTone): string {\n const box = tone === \"neutral\" ? \"rounded-md p-3\" : \"rounded-md p-[11px]\";\n return `${box} ${TONE_FRAME[tone]}`;\n}\n\nconst TONE_TEXT: Record<AlertTone, string> = {\n danger: \"text-[var(--danger)]\",\n warning: \"text-[var(--warning)]\",\n info: \"text-[var(--info)]\",\n neutral: \"text-[var(--text-secondary)]\",\n};\n\nconst TONE_ICON: Record<AlertTone, string> = {\n danger: \"text-[var(--danger)]\",\n warning: \"text-[var(--warning)]\",\n info: \"text-[var(--info)]\",\n neutral: \"text-[var(--text-muted)]\",\n};\n\n/** Which glyph a tone draws when the caller names none. The triangle belongs to the\n * two tones that mean \"something is wrong\"; `info` and `neutral` get the ⓘ. That is\n * what makes `neutral` safe to offer at all: until 0.8.0 it was withheld because a\n * triangle with no colour is a warning that looks like a note — and a neutral note\n * that draws no triangle is simply a note (lenkbank's \"values are rounded\"). */\nconst TONE_GLYPH: Record<AlertTone, typeof AlertTriangle> = {\n danger: AlertTriangle,\n warning: AlertTriangle,\n info: Info,\n neutral: Info,\n};\n\ninterface AlertBannerBaseProps extends Omit<ComponentPropsWithoutRef<\"div\">, \"onClick\"> {\n /** Default `danger`. `info` for news, `neutral` for a plain note — see\n * {@link TONE_GLYPH} for why a neutral banner is now allowed. */\n tone?: AlertTone;\n /**\n * `box` (default): the framed callout. `inline`: the tone's colour, glyph and role\n * and NOTHING else — no border, no surface, no padding — so it fits inside a\n * toolbar row beside the controls it is about. Lenkbank's corner-motion toolbar\n * shows \"Radius below the minimum\" and \"Solving…\" there; a box would have doubled\n * the row's height every time either appeared.\n *\n * The inline variant is also a LIVE REGION by default — `role=\"alert\"` for\n * `danger`, `role=\"status\"` for the rest — because a message that appears in a\n * toolbar in answer to what the user just did is exactly the kind a screen reader\n * otherwise never hears. The box stays role-less as it always was: it is usually\n * page furniture present at load, and an alert that fires on every navigation is\n * noise. Either way a `role` you pass wins.\n */\n variant?: \"box\" | \"inline\";\n /** Replaces the tone's glyph — a `<Spinner label={null} />` for \"Solving…\", say.\n * `null` draws none. Always decorative; the text carries the message. */\n icon?: ReactNode;\n /** Renders an × at the end that calls this. The banner does not hide itself — the\n * caller removes it (and remembers that it did), as with every other kit control\n * whose state is app state. */\n onDismiss?: () => void;\n /** Accessible name of the ×. Default: `common.dismiss` from the\n * {@link UiKitProvider}, else \"Dismiss\". */\n dismissLabel?: string;\n children: ReactNode;\n}\n\n/**\n * The whole-row modes. keksdose's budget-summary card is a banner you tap to open\n * the budget; built from a `<div onClick>` it was a mouse-only target, and built as a\n * banner with a link inside it was a small target inside a big one that looked like\n * one. So `onClick` makes the banner itself ONE `<button>`, and `href` makes it one\n * `<a>`, with a trailing chevron that says so. Mutually exclusive, as on `Chip`.\n *\n * With `onDismiss` as well, the × cannot go inside the button (interactive content\n * may not nest), so the frame becomes a wrapper holding two siblings: the row's\n * button, stretched over the whole frame, and the × on top of it. It still looks and\n * clicks like one banner with an × in its corner, and the two are separate tab stops.\n */\nexport type AlertBannerProps = AlertBannerBaseProps &\n (\n | {\n /** Makes the whole banner one link. Mutually exclusive with `onClick`. */\n href?: string;\n onClick?: never;\n }\n | {\n href?: never;\n /** Makes the whole banner one button. Mutually exclusive with `href`. The\n * event's element is the `<button>`, not a `<div>`. */\n onClick?: (event: MouseEvent<HTMLElement>) => void;\n }\n );\n\n/** Warning/danger/info callout box with the shared frame and an icon — or, with\n * `variant=\"inline\"`, the same message as a frameless line of toned text. */\nexport function AlertBanner({\n tone = \"danger\",\n variant = \"box\",\n icon,\n onDismiss,\n dismissLabel,\n href,\n onClick,\n className,\n children,\n role,\n ...rest\n}: AlertBannerProps) {\n const common = useKitLabels(\"common\", DEFAULT_COMMON_LABELS, { dismiss: dismissLabel });\n const inline = variant === \"inline\";\n const interactive = href !== undefined || onClick !== undefined;\n const resolvedRole = role ?? (inline ? (tone === \"danger\" ? \"alert\" : \"status\") : undefined);\n\n const Glyph = TONE_GLYPH[tone];\n const glyph =\n icon === null ? null : icon !== undefined ? (\n <span aria-hidden className={cn(\"flex shrink-0 [&_svg]:size-4\", !inline && \"mt-0.5\", TONE_ICON[tone])}>\n {icon}\n </span>\n ) : (\n <Glyph aria-hidden className={cn(\"size-4 shrink-0\", !inline && \"mt-0.5\", TONE_ICON[tone])} />\n );\n\n // The row layout, shared by every shape below.\n const row = inline ? \"inline-flex items-center gap-1.5 text-sm\" : \"flex items-start gap-2 text-sm\";\n const frame = inline ? \"\" : alertFrameClass(tone);\n const focusRing =\n \"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--brand)] focus-visible:ring-offset-1 focus-visible:ring-offset-[var(--bg-surface)]\";\n\n const content = (\n <>\n {glyph}\n <span className={cn(!inline && \"flex-1\", \"min-w-0 text-start\")}>{children}</span>\n {interactive && (\n <ChevronRight\n aria-hidden\n className={cn(\"size-4 shrink-0 opacity-70 rtl:-scale-x-100\", !inline && \"mt-0.5\")}\n />\n )}\n </>\n );\n\n const dismiss = onDismiss ? (\n <button\n type=\"button\"\n aria-label={common.dismiss}\n onClick={(e) => {\n // A dismiss inside a whole-row banner must not also follow the row.\n e.preventDefault();\n e.stopPropagation();\n onDismiss();\n }}\n className={cn(\n // Negative margins so the × does not make the box taller than its text; the\n // hover wash takes the tone's own hue, so it works on every tone.\n \"relative z-10 -my-0.5 -me-0.5 flex size-6 shrink-0 items-center justify-center rounded transition-colors hover:bg-current/10\",\n focusRing,\n )}\n >\n <X aria-hidden className=\"size-4\" />\n </button>\n ) : null;\n\n if (!interactive) {\n return (\n <div\n // Arbitrary attributes first — a `data-tour` anchor, a test id, an\n // `aria-describedby` — then the layout and tone classes, which are merged\n // through `cn` rather than spread so a caller's `className` refines the box\n // instead of replacing it.\n {...rest}\n role={resolvedRole}\n className={cn(row, frame, TONE_TEXT[tone], className)}\n >\n {content}\n {dismiss}\n </div>\n );\n }\n\n const hover = \"cursor-pointer transition-[filter] hover:brightness-[0.97] dark:hover:brightness-110\";\n // With a dismiss the frame is a wrapper and the row element is stretched over it;\n // without one the row element IS the frame.\n const split = dismiss !== null;\n const actionClass = split\n ? cn(\n \"flex min-w-0 flex-1 gap-2 text-start\",\n inline ? \"items-center\" : \"items-start\",\n \"outline-none after:absolute after:inset-0 after:rounded-md after:content-['']\",\n \"focus-visible:after:ring-2 focus-visible:after:ring-[var(--brand)]\",\n )\n : cn(row, !inline && \"w-full\", frame, TONE_TEXT[tone], hover, focusRing, className);\n // The div's attributes are the row element's: an `id`, a test id or an\n // `aria-describedby` belongs on the thing that takes focus. The live-region role is\n // NOT carried over — a button or a link that is also a `status` is neither.\n const actionRest = split ? {} : rest;\n\n const action =\n href !== undefined ? (\n <a\n {...(actionRest as ComponentPropsWithoutRef<\"a\">)}\n href={href}\n className={actionClass}\n >\n {content}\n </a>\n ) : (\n <button\n {...(actionRest as ComponentPropsWithoutRef<\"button\">)}\n type=\"button\"\n onClick={onClick}\n className={actionClass}\n >\n {content}\n </button>\n );\n\n if (!split) return action;\n return (\n <div\n {...rest}\n role={resolvedRole}\n className={cn(\"relative\", row, frame, TONE_TEXT[tone], hover, className)}\n >\n {action}\n {dismiss}\n </div>\n );\n}\n"],"mappings":";AAyJM,SAcF,UAdE,KAcF,YAdE;AAxJN,SAAS,eAAe,cAAc,MAAM,SAAS;AACrD,SAAS,UAAU;AACnB,SAAS,uBAAuB,oBAAoB;AAoBpD,MAAM,aAAwC;AAAA,EAC5C,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,MAAM;AAAA,EACN,SAAS;AACX;AAKO,SAAS,eAAe,MAAyB;AACtD,SAAO,WAAW,IAAI;AACxB;AAKO,SAAS,gBAAgB,MAAyB;AACvD,QAAM,MAAM,SAAS,YAAY,mBAAmB;AACpD,SAAO,GAAG,GAAG,IAAI,WAAW,IAAI,CAAC;AACnC;AAEA,MAAM,YAAuC;AAAA,EAC3C,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,MAAM;AAAA,EACN,SAAS;AACX;AAEA,MAAM,YAAuC;AAAA,EAC3C,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,MAAM;AAAA,EACN,SAAS;AACX;AAOA,MAAM,aAAsD;AAAA,EAC1D,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,MAAM;AAAA,EACN,SAAS;AACX;AA+DO,SAAS,YAAY;AAAA,EAC1B,OAAO;AAAA,EACP,UAAU;AAAA,EACV;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAAqB;AACnB,QAAM,SAAS,aAAa,UAAU,uBAAuB,EAAE,SAAS,aAAa,CAAC;AACtF,QAAM,SAAS,YAAY;AAC3B,QAAM,cAAc,SAAS,UAAa,YAAY;AACtD,QAAM,eAAe,SAAS,SAAU,SAAS,WAAW,UAAU,WAAY;AAElF,QAAM,QAAQ,WAAW,IAAI;AAC7B,QAAM,QACJ,SAAS,OAAO,OAAO,SAAS,SAC9B,oBAAC,UAAK,eAAW,MAAC,WAAW,GAAG,gCAAgC,CAAC,UAAU,UAAU,UAAU,IAAI,CAAC,GACjG,gBACH,IAEA,oBAAC,SAAM,eAAW,MAAC,WAAW,GAAG,mBAAmB,CAAC,UAAU,UAAU,UAAU,IAAI,CAAC,GAAG;AAI/F,QAAM,MAAM,SAAS,6CAA6C;AAClE,QAAM,QAAQ,SAAS,KAAK,gBAAgB,IAAI;AAChD,QAAM,YACJ;AAEF,QAAM,UACJ,iCACG;AAAA;AAAA,IACD,oBAAC,UAAK,WAAW,GAAG,CAAC,UAAU,UAAU,oBAAoB,GAAI,UAAS;AAAA,IACzE,eACC;AAAA,MAAC;AAAA;AAAA,QACC,eAAW;AAAA,QACX,WAAW,GAAG,+CAA+C,CAAC,UAAU,QAAQ;AAAA;AAAA,IAClF;AAAA,KAEJ;AAGF,QAAM,UAAU,YACd;AAAA,IAAC;AAAA;AAAA,MACC,MAAK;AAAA,MACL,cAAY,OAAO;AAAA,MACnB,SAAS,CAAC,MAAM;AAEd,UAAE,eAAe;AACjB,UAAE,gBAAgB;AAClB,kBAAU;AAAA,MACZ;AAAA,MACA,WAAW;AAAA;AAAA;AAAA,QAGT;AAAA,QACA;AAAA,MACF;AAAA,MAEA,8BAAC,KAAE,eAAW,MAAC,WAAU,UAAS;AAAA;AAAA,EACpC,IACE;AAEJ,MAAI,CAAC,aAAa;AAChB,WACE;AAAA,MAAC;AAAA;AAAA,QAKE,GAAG;AAAA,QACJ,MAAM;AAAA,QACN,WAAW,GAAG,KAAK,OAAO,UAAU,IAAI,GAAG,SAAS;AAAA,QAEnD;AAAA;AAAA,UACA;AAAA;AAAA;AAAA,IACH;AAAA,EAEJ;AAEA,QAAM,QAAQ;AAGd,QAAM,QAAQ,YAAY;AAC1B,QAAM,cAAc,QAChB;AAAA,IACE;AAAA,IACA,SAAS,iBAAiB;AAAA,IAC1B;AAAA,IACA;AAAA,EACF,IACA,GAAG,KAAK,CAAC,UAAU,UAAU,OAAO,UAAU,IAAI,GAAG,OAAO,WAAW,SAAS;AAIpF,QAAM,aAAa,QAAQ,CAAC,IAAI;AAEhC,QAAM,SACJ,SAAS,SACP;AAAA,IAAC;AAAA;AAAA,MACE,GAAI;AAAA,MACL;AAAA,MACA,WAAW;AAAA,MAEV;AAAA;AAAA,EACH,IAEA;AAAA,IAAC;AAAA;AAAA,MACE,GAAI;AAAA,MACL,MAAK;AAAA,MACL;AAAA,MACA,WAAW;AAAA,MAEV;AAAA;AAAA,EACH;AAGJ,MAAI,CAAC,MAAO,QAAO;AACnB,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ,MAAM;AAAA,MACN,WAAW,GAAG,YAAY,KAAK,OAAO,UAAU,IAAI,GAAG,OAAO,SAAS;AAAA,MAEtE;AAAA;AAAA,QACA;AAAA;AAAA;AAAA,EACH;AAEJ;","names":[]}
@@ -32,6 +32,9 @@ import './file-button.js';
32
32
  import './measured-grid.js';
33
33
  import '../feedback/feedback-attachment.js';
34
34
  import '../feedback/feedback-dialog.js';
35
+ import './confirm-dialog.js';
36
+ import './floating-panel.js';
37
+ import './copy-button.js';
35
38
 
36
39
  interface AmountInputProps {
37
40
  value: string;
@@ -0,0 +1,26 @@
1
+ import * as react from 'react';
2
+ import { ComponentPropsWithoutRef } from 'react';
3
+
4
+ interface ButtonGroupProps extends Omit<ComponentPropsWithoutRef<"div">, "role"> {
5
+ /** `horizontal` (default): side by side, in reading order. `vertical`: stacked —
6
+ * the map's zoom + over −. */
7
+ orientation?: "horizontal" | "vertical";
8
+ }
9
+ /**
10
+ * Adjacent `Button`s or `IconButton`s drawn as one joined control: a single frame,
11
+ * hairline dividers between the members, rounded only at the outer corners.
12
+ *
13
+ * keksdose asked for it twice — "collapse all / expand all" above its category
14
+ * tree, and the + and − of its map zoom — both hand-built with negative margins and
15
+ * physical `rounded-l` / `rounded-r`, which came out inside-out under `dir="rtl"`.
16
+ *
17
+ * `role="group"` with a name: a reader then introduces the pair as "Zoom, group"
18
+ * before reading "Zoom in", which is what tells a listener that the next button
19
+ * belongs with this one. Pass `aria-label` (or `aria-labelledby`); a group with no
20
+ * name is one more unlabelled wrapper. It is NOT a toolbar — it adds no arrow-key
21
+ * roving, and every member keeps its own tab stop, as plain adjacent buttons do.
22
+ * For one-of-many selection use `ToggleGroup`, which has the radio semantics.
23
+ */
24
+ declare function ButtonGroup({ orientation, className, ...rest }: ButtonGroupProps): react.JSX.Element;
25
+
26
+ export { ButtonGroup, type ButtonGroupProps };
@@ -0,0 +1,49 @@
1
+ "use client";
2
+ import { jsx } from "react/jsx-runtime";
3
+ import { cn } from "../lib/cn.js";
4
+ const JOINED_COMMON = cn(
5
+ "inline-flex rounded-md border border-[var(--border)]",
6
+ // The group draws the frame; each member gives up its own border, radius and shadow.
7
+ "[&>*]:rounded-none [&>*]:border-0 [&>*]:shadow-none",
8
+ "[&>*>button]:rounded-none [&>*>button]:border-0 [&>*>button]:shadow-none",
9
+ "[&>*]:border-[var(--border)]",
10
+ // A focused member rises above its neighbours so its ring is not painted over by
11
+ // the next one's background.
12
+ "[&>*]:relative [&>*:focus-within]:z-10"
13
+ );
14
+ const JOINED = {
15
+ // Logical edges and corners throughout (`border-s`, `rounded-s-*`), so in RTL the
16
+ // first member sits on the right with the right-hand corners rounded — the physical
17
+ // pair would round the outside of the last button and square off the first.
18
+ horizontal: cn(
19
+ JOINED_COMMON,
20
+ "flex-row items-stretch",
21
+ "[&>*:not(:first-child)]:border-s",
22
+ "[&>:first-child]:rounded-s-md [&>:last-child]:rounded-e-md",
23
+ "[&>:first-child>button]:rounded-s-md [&>:last-child>button]:rounded-e-md"
24
+ ),
25
+ // The block axis is top-to-bottom in both reading directions, so top/bottom are
26
+ // already the logical edges here.
27
+ vertical: cn(
28
+ JOINED_COMMON,
29
+ "flex-col items-stretch",
30
+ "[&>*:not(:first-child)]:border-t",
31
+ "[&>:first-child]:rounded-t-md [&>:last-child]:rounded-b-md",
32
+ "[&>:first-child>button]:rounded-t-md [&>:last-child>button]:rounded-b-md"
33
+ )
34
+ };
35
+ function ButtonGroup({ orientation = "horizontal", className, ...rest }) {
36
+ return /* @__PURE__ */ jsx(
37
+ "div",
38
+ {
39
+ ...rest,
40
+ role: "group",
41
+ "data-orientation": orientation,
42
+ className: cn(JOINED[orientation], className)
43
+ }
44
+ );
45
+ }
46
+ export {
47
+ ButtonGroup
48
+ };
49
+ //# sourceMappingURL=button-group.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/components/button-group.tsx"],"sourcesContent":["import type { ComponentPropsWithoutRef } from \"react\";\nimport { cn } from \"../lib/cn\";\n\n// Every class below is spelled out in full rather than assembled from parts: the\n// consumer's Tailwind build finds classes by scanning this package's source as text,\n// and a class that exists only after a template literal runs is never generated.\n//\n// Each rule is written twice, once for a direct child and once for a `<button>` one\n// level down. The second is for a Tooltip-wrapped IconButton — the map zoom's + and −\n// both carry a tooltip — where the direct child is the tooltip's wrapper span and the\n// button that draws the border and the corners sits inside it.\nconst JOINED_COMMON = cn(\n \"inline-flex rounded-md border border-[var(--border)]\",\n // The group draws the frame; each member gives up its own border, radius and shadow.\n \"[&>*]:rounded-none [&>*]:border-0 [&>*]:shadow-none\",\n \"[&>*>button]:rounded-none [&>*>button]:border-0 [&>*>button]:shadow-none\",\n \"[&>*]:border-[var(--border)]\",\n // A focused member rises above its neighbours so its ring is not painted over by\n // the next one's background.\n \"[&>*]:relative [&>*:focus-within]:z-10\",\n);\n\nconst JOINED: Record<\"horizontal\" | \"vertical\", string> = {\n // Logical edges and corners throughout (`border-s`, `rounded-s-*`), so in RTL the\n // first member sits on the right with the right-hand corners rounded — the physical\n // pair would round the outside of the last button and square off the first.\n horizontal: cn(\n JOINED_COMMON,\n \"flex-row items-stretch\",\n \"[&>*:not(:first-child)]:border-s\",\n \"[&>:first-child]:rounded-s-md [&>:last-child]:rounded-e-md\",\n \"[&>:first-child>button]:rounded-s-md [&>:last-child>button]:rounded-e-md\",\n ),\n // The block axis is top-to-bottom in both reading directions, so top/bottom are\n // already the logical edges here.\n vertical: cn(\n JOINED_COMMON,\n \"flex-col items-stretch\",\n \"[&>*:not(:first-child)]:border-t\",\n \"[&>:first-child]:rounded-t-md [&>:last-child]:rounded-b-md\",\n \"[&>:first-child>button]:rounded-t-md [&>:last-child>button]:rounded-b-md\",\n ),\n};\n\nexport interface ButtonGroupProps extends Omit<ComponentPropsWithoutRef<\"div\">, \"role\"> {\n /** `horizontal` (default): side by side, in reading order. `vertical`: stacked —\n * the map's zoom + over −. */\n orientation?: \"horizontal\" | \"vertical\";\n}\n\n/**\n * Adjacent `Button`s or `IconButton`s drawn as one joined control: a single frame,\n * hairline dividers between the members, rounded only at the outer corners.\n *\n * keksdose asked for it twice — \"collapse all / expand all\" above its category\n * tree, and the + and − of its map zoom — both hand-built with negative margins and\n * physical `rounded-l` / `rounded-r`, which came out inside-out under `dir=\"rtl\"`.\n *\n * `role=\"group\"` with a name: a reader then introduces the pair as \"Zoom, group\"\n * before reading \"Zoom in\", which is what tells a listener that the next button\n * belongs with this one. Pass `aria-label` (or `aria-labelledby`); a group with no\n * name is one more unlabelled wrapper. It is NOT a toolbar — it adds no arrow-key\n * roving, and every member keeps its own tab stop, as plain adjacent buttons do.\n * For one-of-many selection use `ToggleGroup`, which has the radio semantics.\n */\nexport function ButtonGroup({ orientation = \"horizontal\", className, ...rest }: ButtonGroupProps) {\n return (\n <div\n {...rest}\n role=\"group\"\n data-orientation={orientation}\n className={cn(JOINED[orientation], className)}\n />\n );\n}\n"],"mappings":";AAmEI;AAlEJ,SAAS,UAAU;AAUnB,MAAM,gBAAgB;AAAA,EACpB;AAAA;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA;AAAA;AAAA,EAGA;AACF;AAEA,MAAM,SAAoD;AAAA;AAAA;AAAA;AAAA,EAIxD,YAAY;AAAA,IACV;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAAA;AAAA;AAAA,EAGA,UAAU;AAAA,IACR;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;AAuBO,SAAS,YAAY,EAAE,cAAc,cAAc,WAAW,GAAG,KAAK,GAAqB;AAChG,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ,MAAK;AAAA,MACL,oBAAkB;AAAA,MAClB,WAAW,GAAG,OAAO,WAAW,GAAG,SAAS;AAAA;AAAA,EAC9C;AAEJ;","names":[]}
@@ -29,6 +29,9 @@ import './file-button.js';
29
29
  import './measured-grid.js';
30
30
  import '../feedback/feedback-attachment.js';
31
31
  import '../feedback/feedback-dialog.js';
32
+ import './confirm-dialog.js';
33
+ import './floating-panel.js';
34
+ import './copy-button.js';
32
35
 
33
36
  /** Screen-reader names for the calculator panel's own controls — any part of the
34
37
  * kit's `calculator` namespace. Once three optional keys of its own; widened, not