@wirecore/wirelayer-react 0.6.0 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (145) hide show
  1. package/dist/Checkbox-BMRax6m4.js +49 -0
  2. package/dist/ContextMenu-C6ZaMtqf.js +1511 -0
  3. package/dist/{Highlight-CX30-nP7.js → Highlight-43-H9459.js} +93 -86
  4. package/dist/Input-CtYSQznO.js +120 -0
  5. package/dist/PasswordInput-dpeKVREo.js +425 -0
  6. package/dist/Select-C2CiPTCK.js +256 -0
  7. package/dist/Slider-Bfm_jjYE.js +80 -0
  8. package/dist/{Tree-BiPIkmwT.js → Tree-DVjwp6FG.js} +1 -1
  9. package/dist/chart.js +1 -1
  10. package/dist/components/Alert/Alert.d.ts +3 -1
  11. package/dist/components/Alert/Alert.d.ts.map +1 -1
  12. package/dist/components/AngleSlider/AngleSlider.d.ts +3 -1
  13. package/dist/components/AngleSlider/AngleSlider.d.ts.map +1 -1
  14. package/dist/components/Autocomplete/Autocomplete.d.ts +1 -1
  15. package/dist/components/Autocomplete/Autocomplete.d.ts.map +1 -1
  16. package/dist/components/Carousel/Carousel.d.ts +3 -1
  17. package/dist/components/Carousel/Carousel.d.ts.map +1 -1
  18. package/dist/components/CascadeSelect/CascadeSelect.d.ts +3 -1
  19. package/dist/components/CascadeSelect/CascadeSelect.d.ts.map +1 -1
  20. package/dist/components/Checkbox/Checkbox.d.ts +9 -5
  21. package/dist/components/Checkbox/Checkbox.d.ts.map +1 -1
  22. package/dist/components/ColorPicker/ColorPicker.d.ts +3 -1
  23. package/dist/components/ColorPicker/ColorPicker.d.ts.map +1 -1
  24. package/dist/components/Combobox/Combobox.d.ts +10 -1
  25. package/dist/components/Combobox/Combobox.d.ts.map +1 -1
  26. package/dist/components/Confirm/ConfirmDialog.d.ts +6 -1
  27. package/dist/components/Confirm/ConfirmDialog.d.ts.map +1 -1
  28. package/dist/components/Confirm/confirm.d.ts +7 -0
  29. package/dist/components/Confirm/confirm.d.ts.map +1 -1
  30. package/dist/components/ContextMenu/ContextMenu.d.ts +12 -3
  31. package/dist/components/ContextMenu/ContextMenu.d.ts.map +1 -1
  32. package/dist/components/DatePicker/DatePicker.d.ts +3 -1
  33. package/dist/components/DatePicker/DatePicker.d.ts.map +1 -1
  34. package/dist/components/DatePicker/DatePickerBase.d.ts +3 -1
  35. package/dist/components/DatePicker/DatePickerBase.d.ts.map +1 -1
  36. package/dist/components/DateRangePicker/DateRangePicker.d.ts +3 -1
  37. package/dist/components/DateRangePicker/DateRangePicker.d.ts.map +1 -1
  38. package/dist/components/Dialog/Dialog.d.ts +8 -1
  39. package/dist/components/Dialog/Dialog.d.ts.map +1 -1
  40. package/dist/components/Drawer/Drawer.d.ts +3 -1
  41. package/dist/components/Drawer/Drawer.d.ts.map +1 -1
  42. package/dist/components/DurationInput/DurationInput.d.ts +3 -1
  43. package/dist/components/DurationInput/DurationInput.d.ts.map +1 -1
  44. package/dist/components/IconButton/IconButton.d.ts +3 -1
  45. package/dist/components/IconButton/IconButton.d.ts.map +1 -1
  46. package/dist/components/Input/Input.d.ts +7 -2
  47. package/dist/components/Input/Input.d.ts.map +1 -1
  48. package/dist/components/Knob/Knob.d.ts +3 -1
  49. package/dist/components/Knob/Knob.d.ts.map +1 -1
  50. package/dist/components/Listbox/Listbox.d.ts +3 -1
  51. package/dist/components/Listbox/Listbox.d.ts.map +1 -1
  52. package/dist/components/Menu/Menu.d.ts +27 -3
  53. package/dist/components/Menu/Menu.d.ts.map +1 -1
  54. package/dist/components/MonthPicker/MonthPicker.d.ts +3 -1
  55. package/dist/components/MonthPicker/MonthPicker.d.ts.map +1 -1
  56. package/dist/components/MultiSelect/MultiSelect.d.ts +1 -1
  57. package/dist/components/MultiSelect/MultiSelect.d.ts.map +1 -1
  58. package/dist/components/NativeSelect/NativeSelect.d.ts +9 -6
  59. package/dist/components/NativeSelect/NativeSelect.d.ts.map +1 -1
  60. package/dist/components/NumberInput/NumberInput.d.ts +2 -2
  61. package/dist/components/NumberInput/NumberInput.d.ts.map +1 -1
  62. package/dist/components/PasswordInput/PasswordInput.d.ts +7 -2
  63. package/dist/components/PasswordInput/PasswordInput.d.ts.map +1 -1
  64. package/dist/components/PinInput/PinInput.d.ts +3 -1
  65. package/dist/components/PinInput/PinInput.d.ts.map +1 -1
  66. package/dist/components/Progress/Progress.d.ts +12 -1
  67. package/dist/components/Progress/Progress.d.ts.map +1 -1
  68. package/dist/components/QuarterPicker/QuarterPicker.d.ts +3 -1
  69. package/dist/components/QuarterPicker/QuarterPicker.d.ts.map +1 -1
  70. package/dist/components/RadioGroup/RadioGroup.d.ts +8 -6
  71. package/dist/components/RadioGroup/RadioGroup.d.ts.map +1 -1
  72. package/dist/components/RadioGroup/RadioGroupItem.d.ts +3 -2
  73. package/dist/components/RadioGroup/RadioGroupItem.d.ts.map +1 -1
  74. package/dist/components/RadioGroup/context.d.ts +3 -0
  75. package/dist/components/RadioGroup/context.d.ts.map +1 -0
  76. package/dist/components/Rating/Rating.d.ts +3 -1
  77. package/dist/components/Rating/Rating.d.ts.map +1 -1
  78. package/dist/components/SegmentedControl/SegmentedControl.d.ts +6 -5
  79. package/dist/components/SegmentedControl/SegmentedControl.d.ts.map +1 -1
  80. package/dist/components/Select/Select.d.ts +10 -1
  81. package/dist/components/Select/Select.d.ts.map +1 -1
  82. package/dist/components/Select/list.d.ts +6 -1
  83. package/dist/components/Select/list.d.ts.map +1 -1
  84. package/dist/components/SelectionCard/SelectionCard.d.ts +1 -1
  85. package/dist/components/SelectionCard/SelectionCard.d.ts.map +1 -1
  86. package/dist/components/Slider/Slider.d.ts +3 -1
  87. package/dist/components/Slider/Slider.d.ts.map +1 -1
  88. package/dist/components/Switch/Switch.d.ts +1 -1
  89. package/dist/components/Switch/Switch.d.ts.map +1 -1
  90. package/dist/components/TagsInput/TagsInput.d.ts +3 -1
  91. package/dist/components/TagsInput/TagsInput.d.ts.map +1 -1
  92. package/dist/components/Textarea/Textarea.d.ts +7 -2
  93. package/dist/components/Textarea/Textarea.d.ts.map +1 -1
  94. package/dist/components/TimePicker/TimePicker.d.ts +3 -1
  95. package/dist/components/TimePicker/TimePicker.d.ts.map +1 -1
  96. package/dist/components/TimeRangePicker/TimeRangePicker.d.ts +3 -1
  97. package/dist/components/TimeRangePicker/TimeRangePicker.d.ts.map +1 -1
  98. package/dist/components/Tooltip/Tooltip.d.ts +3 -1
  99. package/dist/components/Tooltip/Tooltip.d.ts.map +1 -1
  100. package/dist/components/TreeSelect/TreeSelect.d.ts +3 -1
  101. package/dist/components/TreeSelect/TreeSelect.d.ts.map +1 -1
  102. package/dist/components/YearPicker/YearPicker.d.ts +3 -1
  103. package/dist/components/YearPicker/YearPicker.d.ts.map +1 -1
  104. package/dist/data-table/DataTable.d.ts +10 -2
  105. package/dist/data-table/DataTable.d.ts.map +1 -1
  106. package/dist/data-table.js +952 -949
  107. package/dist/editor.js +1 -1
  108. package/dist/form/FormField.d.ts +5 -1
  109. package/dist/form/FormField.d.ts.map +1 -1
  110. package/dist/form.js +7 -5
  111. package/dist/index.d.ts +1 -1
  112. package/dist/index.d.ts.map +1 -1
  113. package/dist/index.js +3376 -3243
  114. package/dist/label-for-DYgV5EwH.js +9 -0
  115. package/dist/pdf.js +3 -3
  116. package/dist/sources/ActionBar.css +1 -0
  117. package/dist/sources/AppShell.css +1 -0
  118. package/dist/sources/ChatPrompt.css +1 -0
  119. package/dist/sources/Gallery.css +1 -0
  120. package/dist/sources/IconButton.css +1 -0
  121. package/dist/sources/Image.css +1 -0
  122. package/dist/sources/ImageCropper.css +1 -0
  123. package/dist/sources/InlineEdit.css +1 -0
  124. package/dist/sources/Marquee.css +1 -0
  125. package/dist/sources/MegaMenu.css +1 -0
  126. package/dist/sources/Menubar.css +1 -0
  127. package/dist/sources/OrderList.css +1 -0
  128. package/dist/sources/PickList.css +1 -0
  129. package/dist/sources/ScrollTop.css +1 -0
  130. package/dist/utils/label-for.d.ts +3 -0
  131. package/dist/utils/label-for.d.ts.map +1 -0
  132. package/dist/virtual/VirtualSelect.d.ts +1 -1
  133. package/dist/virtual/VirtualSelect.d.ts.map +1 -1
  134. package/dist/virtual.js +245 -236
  135. package/fonts.css +2 -0
  136. package/llms-full.txt +237 -25
  137. package/llms.txt +9 -5
  138. package/package.json +7 -3
  139. package/theme.css +14 -0
  140. package/dist/Checkbox-CZTyKWId.js +0 -44
  141. package/dist/ContextMenu-CjDI7Jy5.js +0 -1434
  142. package/dist/Input-D8U-Auys.js +0 -109
  143. package/dist/PasswordInput-DivSjtN8.js +0 -420
  144. package/dist/Select-Cx3KwSzU.js +0 -234
  145. package/dist/Slider-x-SsBc1d.js +0 -74
package/fonts.css ADDED
@@ -0,0 +1,2 @@
1
+ /* The WireLayer fonts (Schibsted Grotesk, JetBrains Mono) – part of styles.css and styles-core.css, separate for theme.css */
2
+ @import '@wirecore/wirelayer-tokens/fonts.css';
package/llms-full.txt CHANGED
@@ -119,6 +119,7 @@ Message box with status colour, icon, title and text; role="alert" for errors an
119
119
  | dismissLabel? | `string` | Accessible name of the close button |
120
120
  | duration? | `number` | Calls `onDismiss` after this many milliseconds. The time pauses while the pointer is over the alert or the focus is in it (WCAG 2.2.1); prefer `dismissible` for messages people need to read |
121
121
  | onDismiss? | `() => void` | |
122
+ | actions? | `ReactNode` | Buttons in the message, e.g. "Unlock" or "Reconnect" – beside the text, below it when there is little room |
122
123
  | classes? | `RecipeClasses<typeof alertRecipe>` | Extra classes per part of the component, e.g. { base: "…" } (see the recipe) |
123
124
 
124
125
  ### AngleSlider
@@ -145,6 +146,7 @@ Dial for an angle: the needle is the slider (arrow keys, Home/End), drag anywher
145
146
  | invalid? | `boolean` | |
146
147
  | name? | `string` | |
147
148
  | aria-label? | `string` | |
149
+ | id? | `string` | Id of the root element; a `<label for>` cannot name the angle slider, use a Field or aria-label |
148
150
  | className? | `string` | |
149
151
  | style? | `CSSProperties` | |
150
152
  | classes? | `RecipeClasses<typeof angleSliderRecipe>` | Extra classes per part of the component, e.g. { base: "…" } (see the recipe) |
@@ -626,6 +628,7 @@ Region "carousel" with slides labelled "Image n of m". Previous/next buttons, on
626
628
  | loop? | `boolean` | |
627
629
  | autoplay? | `boolean \| { delay: number }` | Turns pages by itself (default every 4 s) – always with a pause button (WCAG 2.2.2) |
628
630
  | indicators? | `boolean` | Dots below the slides, one per page |
631
+ | controlsPosition? | `'bottom' \| 'sides'` | Previous and next: in the row below the slides (`bottom`, default) or beside them, vertically centred (`sides`) |
629
632
  | page? | `number` | |
630
633
  | defaultPage? | `number` | |
631
634
  | onPageChange? | `(page: number) => void` | |
@@ -662,6 +665,7 @@ Select with cascading levels: a menu whose groups open to the side (arrow right/
662
665
  | onLoadChildren? | `(option: CascadeOption<V>) => void` | A lazy level opened and there is no loadChildren/dataSource: add its options to the items |
663
666
  | dataSource? | `DataSource<CascadeOption<V>>` | Source of the options of lazy levels (`getChildren`) |
664
667
  | aria-label? | `string` | |
668
+ | id? | `string` | Id of the field (the trigger, with `filter` the search field), e.g. for a `<label for>` |
665
669
  | className? | `string` | |
666
670
  | style? | `CSSProperties` | |
667
671
  | classes? | `RecipeClasses<typeof cascadeSelectRecipe>` | Extra classes per part of the component, e.g. { base: "…" } (see the recipe) |
@@ -846,13 +850,13 @@ Checkbox with label (also indeterminate), works inside Field
846
850
  - Import: `import { Checkbox } from '@wirecore/wirelayer-react'`
847
851
  - Category: Forms
848
852
  - Example: https://wirecore.github.io/WireLayer/?path=/story/react_forms-checkbox--playground
849
- - Also takes: Omit<ComponentProps<'input'>, 'checked' | 'defaultChecked' | 'value' | 'type'>
853
+ - Also takes: Omit< ComponentProps<'input'>, 'checked' | 'defaultChecked' | 'value' | 'type' >
850
854
 
851
855
  | Prop | Type | Description |
852
856
  | --- | --- | --- |
853
- | checked? | `CheckedState` | |
854
- | defaultChecked? | `CheckedState` | |
855
- | onCheckedChange? | `(checked: CheckedState) => void` | |
857
+ | checked? | `C` | |
858
+ | defaultChecked? | `C` | |
859
+ | onCheckedChange? | `(checked: C) => void` | |
856
860
  | invalid? | `boolean` | |
857
861
  | value? | `string` | |
858
862
  | children? | `ReactNode` | |
@@ -1051,6 +1055,7 @@ Colour field: the button opens a panel with area, hue (and opacity) slider, hex
1051
1055
  | invalid? | `boolean` | |
1052
1056
  | name? | `string` | |
1053
1057
  | aria-label? | `string` | Accessible name without a surrounding Field |
1058
+ | id? | `string` | Id of the field (the button), e.g. for a `<label for>` |
1054
1059
  | className? | `string` | |
1055
1060
  | style? | `CSSProperties` | |
1056
1061
  | classes? | `RecipeClasses<typeof colorPickerRecipe>` | Extra classes per part of the component, e.g. { base: "…" } (see the recipe) |
@@ -1118,6 +1123,9 @@ Text field with suggestions (autocomplete): type to filter, arrow keys to choose
1118
1123
  | dataSource? | `DataSource<T>` | Loads the options for the typed text (after a typing pause, outdated answers dropped; pages while scrolling); `getItemsByKeys` gives the label of a chosen value that is not loaded |
1119
1124
  | minSearchLength? | `number` | Fewest characters typed before the data source is asked |
1120
1125
  | pageSize? | `number` | Options per request of the data source (default 50) |
1126
+ | open? | `boolean` | Whether the list is open (controlled, with onOpenChange) |
1127
+ | onOpenChange? | `(open: boolean) => void` | The list opened or closed |
1128
+ | stopKeyPropagation? | `boolean` | Keeps the keys the open list handles itself (Enter choosing, Escape closing, Tab leaving) from bubbling up – e.g. in a dialog with window shortcuts for Enter (save) and Escape (cancel) |
1121
1129
  | renderItem? | `(item: T, state: ListItemState) => ReactNode` | Content of an option (instead of icon and label) |
1122
1130
  | classes? | `RecipeClasses<typeof comboboxRecipe>` | Extra classes per part of the component, e.g. { base: "…" } (see the recipe) |
1123
1131
 
@@ -1239,6 +1247,8 @@ Place once in the app; ask with `await confirm({ title, … })` or `await prompt
1239
1247
  | Prop | Type | Description |
1240
1248
  | --- | --- | --- |
1241
1249
  | closeLabel? | `string` | Accessible name of the close button |
1250
+ | confirmButton? | `ConfirmButtonOptions` | Look of the confirm button in every request (default: size sm, `primary`, `danger` for status danger) |
1251
+ | cancelButton? | `ConfirmButtonOptions` | Look of the cancel button in every request (default: size sm, `outline`) |
1242
1252
  | classes? | `RecipeClasses<typeof dialogRecipe>` | Extra classes per part of the component, e.g. { base: "…" } (see the recipe) |
1243
1253
 
1244
1254
  ### ConfirmPopup
@@ -1283,12 +1293,15 @@ Opens at the pointer on right click, on touch screens with a long press (and wit
1283
1293
  - Import: `import { ContextMenu } from '@wirecore/wirelayer-react'`
1284
1294
  - Category: Overlays
1285
1295
  - Example: https://wirecore.github.io/WireLayer/?path=/story/react_overlays-contextmenu--playground
1286
- - Also takes: MenuItemOptions
1296
+ - Also takes: MenuItemOptions, MenuBehaviorOptions
1287
1297
 
1288
1298
  | Prop | Type | Description |
1289
1299
  | --- | --- | --- |
1290
1300
  | items | `readonly MenuEntry[]` | Items, groups, separators, checkbox items, radio groups and submenus – as in Menu |
1291
1301
  | label? | `string` | Accessible name of the menu – without it the menu is named by the area's content |
1302
+ | open? | `boolean` | Whether the menu is open (controlled, with onOpenChange) |
1303
+ | onOpenChange? | `(open: boolean) => void` | The menu opened or closed – e.g. to pause list shortcuts while it is open |
1304
+ | onBeforeOpen? | `(target: Element) => void` | A right click, long press or the menu key is opening the menu, on this element (e.g. the row under the pointer – select it before the menu shows) |
1292
1305
  | ref? | `Ref<OverlayHandle>` | open(anchor), close(), toggle(anchor) – e.g. open(event) from your own handler |
1293
1306
  | children | `ReactElement` | The area that opens the menu |
1294
1307
  | classes? | `RecipeClasses<typeof menuRecipe>` | Extra classes per part of the component, e.g. { base: "…" } (see the recipe) |
@@ -1404,6 +1417,8 @@ Data table on TanStack Table: sorting (also by several columns), search, filter
1404
1417
  | first? | `number` | Index of the first row of the current page (0-based) – instead of `page`; controlled with onFirstChange |
1405
1418
  | onFirstChange? | `(first: number) => void` | |
1406
1419
  | paginatorPosition? | `'top' \| 'bottom'` | Pagination below (default) or above the table |
1420
+ | paginatorEdges? | `boolean` | Buttons to the first and the last page in the pagination |
1421
+ | paginatorAlign? | `DataTablePaginatorAlign` | Pagination row: rows per page at the start, pages at the end (`between`, default) – or both together |
1407
1422
  | sorting? | `DataTableSort \| DataTableSort[] \| null` | Current sorting; controlled together with onSortingChange – an array in the multiple mode |
1408
1423
  | onSortingChange? | `(sorting: DataTableSort \| DataTableSort[] \| null) => void` | |
1409
1424
  | defaultSorting? | `DataTableSort \| DataTableSort[] \| null` | Sorting at the start (uncontrolled) |
@@ -1434,6 +1449,7 @@ Data table on TanStack Table: sorting (also by several columns), search, filter
1434
1449
  | defaultExpanded? | `string[]` | |
1435
1450
  | onExpandedChange? | `(expanded: string[]) => void` | |
1436
1451
  | expandLabel? | `(row: TData, index: number) => string` | Names the expand button of a row |
1452
+ | rowExpandable? | `(row: TData) => boolean` | Whether a row has details (`expansion`) – rows without get no expand button (default: all rows) |
1437
1453
  | expansion? | `(row: TData, rowId: string) => ReactNode` | Details below an expanded row – adds the expand column |
1438
1454
  | advancedFilter? | `boolean \| ConditionField[]` | Advanced filter: the rows pass a condition tree (nested and/or rules). `true` offers every column with a filter type; or pass the fields. A toolbar button opens the editor from `renderAdvancedFilter` above the table – usually `ConditionBuilder` from `@wirecore/wirelayer-blocks-react`; without it there is no button (the tree still filters). A server filters instead: `dataSource` gets the tree as `condition`, with `manual` the parent applies `advancedFilterValue` |
1439
1455
  | advancedFilterValue? | `ConditionGroup` | The condition tree of the advanced filter (controlled together with onAdvancedFilterValueChange) |
@@ -1493,6 +1509,7 @@ Data table on TanStack Table: sorting (also by several columns), search, filter
1493
1509
  | onSizeChange? | `(size: Density) => void` | |
1494
1510
  | densityToggle? | `boolean` | Menu above the table to change the row height |
1495
1511
  | gridlines? | `boolean` | Lines between the columns |
1512
+ | bordered? | `boolean` | A border around the whole table |
1496
1513
  | striped? | `boolean` | Every other row tinted |
1497
1514
  | fullscreenToggle? | `boolean` | Button above the table to show it on the whole screen |
1498
1515
  | scrollHeight? | `string` | Fixed height (CSS length): the table scrolls inside, header and footer stay visible |
@@ -1600,6 +1617,7 @@ Date field: type the digits one after another (the separators come from the loca
1600
1617
  | responsive? | `boolean` | On narrow screens the calendar opens as a sheet at the bottom |
1601
1618
  | renderDay? | `RenderDay` | Content of a day in the calendar instead of its number, e.g. a dot for appointments |
1602
1619
  | aria-label? | `string` | Accessible name without a surrounding Field |
1620
+ | id? | `string` | Id of the field – the (first) date gets it; a `<label for>` cannot name it, use a Field or aria-label |
1603
1621
  | className? | `string` | |
1604
1622
  | style? | `CSSProperties` | |
1605
1623
  | classes? | `RecipeClasses<typeof datePicker>` | Extra classes per part of the date field, e.g. { control: "…" } (the calendar: RecipesProvider) |
@@ -1645,6 +1663,7 @@ Start and end in one field ("10/20/2026 – 10/24/2026"); the calendar picks sta
1645
1663
  | responsive? | `boolean` | On narrow screens the calendar opens as a sheet at the bottom |
1646
1664
  | renderDay? | `RenderDay` | Content of a day in the calendar instead of its number |
1647
1665
  | aria-label? | `string` | Accessible name without a surrounding Field |
1666
+ | id? | `string` | Id of the field – the (first) date gets it; a `<label for>` cannot name it, use a Field or aria-label |
1648
1667
  | className? | `string` | |
1649
1668
  | style? | `CSSProperties` | |
1650
1669
  | classes? | `RecipeClasses<typeof datePicker>` | Extra classes per part of the date field, e.g. { control: "…" } (the calendar: RecipesProvider) |
@@ -1714,6 +1733,8 @@ The modal window of a Dialog: title, description, focus trap, Escape closes
1714
1733
  | Prop | Type | Description |
1715
1734
  | --- | --- | --- |
1716
1735
  | title | `string` | |
1736
+ | hideTitle? | `boolean` | The title only for screen readers – it still names the dialog (e.g. a video in a dialog) |
1737
+ | titlePosition? | `'body' \| 'header'` | `body` (default): the title below the header row; `header`: in the row of the close button, after a smaller icon, the header separated by a line (as on the Drawer) |
1717
1738
  | description? | `string` | |
1718
1739
  | icon? | `IconComponent` | Icon component in the coloured box at the top |
1719
1740
  | status? | `DialogStatus` | |
@@ -1835,6 +1856,7 @@ The panel of a Drawer, sliding in from a side; title, focus trap, Escape closes
1835
1856
  | Prop | Type | Description |
1836
1857
  | --- | --- | --- |
1837
1858
  | title | `string` | |
1859
+ | hideTitle? | `boolean` | The title only for screen readers – it still names the drawer (e.g. a video in a dialog) |
1838
1860
  | description? | `string` | |
1839
1861
  | placement? | `DrawerPlacement` | |
1840
1862
  | size? | `OverlaySize` | Width (left/right: sm 320px, md 420px, lg 560px, xl 720px) or height (top/bottom: 30–85 % of the screen); `full` covers the whole screen. Without it 420px wide or as high as the content |
@@ -1881,6 +1903,7 @@ Duration field: hours and minutes (optional days and seconds) as spin buttons
1881
1903
  | size? | `'sm' \| 'md' \| 'lg'` | |
1882
1904
  | clearable? | `boolean` | Clear button in the field while it has a value |
1883
1905
  | aria-label? | `string` | Accessible name without a surrounding Field |
1906
+ | id? | `string` | Id of the field (the group of parts); a `<label for>` cannot name it, use a Field or aria-label |
1884
1907
  | className? | `string` | |
1885
1908
  | style? | `CSSProperties` | |
1886
1909
  | classes? | `RecipeClasses<typeof datePickerRecipe>` | Extra classes per part of the field (see the datePicker recipe) |
@@ -2245,6 +2268,8 @@ Label, helper text, error, aria-invalid and aria-describedby come from Field
2245
2268
  | required? | `boolean` | |
2246
2269
  | optional? | `boolean` | "(optional)" after the label |
2247
2270
  | disabled? | `boolean` | |
2271
+ | className? | `string` | |
2272
+ | classes? | `RecipeClasses<typeof fieldRecipe>` | Extra classes per part of the Field, e.g. { label: "…" } (see the field recipe) |
2248
2273
  | children? | `ReactNode` | |
2249
2274
 
2250
2275
  ### FormList
@@ -2489,6 +2514,7 @@ Button with only an icon; the label is its accessible name, optionally with a co
2489
2514
  | color? | `ButtonColor` | Colour combined with the variant, like Button `color` (e.g. a danger text button) |
2490
2515
  | size? | `ButtonSize` | `xs` is 24px – the minimum target size (WCAG 2.5.8) |
2491
2516
  | shape? | `ButtonShape` | Corner shape: `pill` (round, default), `rounded` or `square` |
2517
+ | loading? | `boolean` | Shows a spinner instead of the icon and ignores clicks; stays focusable (aria-disabled + aria-busy) |
2492
2518
  | badge? | `number \| boolean` | Counter (number > 0) or dot (true) in the top-right corner |
2493
2519
  | badgeLabel? | `(count: string \| null) => string` | Appended to the accessible name while a badge is shown, e.g. "Notifications, 4 new". Receives the visible counter text ("4", "99+") or null for the dot – the visible text must stay part of the name (WCAG 2.5.3). |
2494
2520
  | classes? | `RecipeClasses<typeof iconButtonRecipe>` | Extra classes per part of the component, e.g. { base: "…" } (see the recipe) |
@@ -2601,7 +2627,7 @@ Shows a value as a button; activating it swaps in the editor (Escape closes it)
2601
2627
 
2602
2628
  ### Input
2603
2629
 
2604
- Text field with sizes, leading icon, prefix and suffix; works inside Field
2630
+ Text field with sizes, leading icon, prefix and suffix; works inside Field. `ref` reaches the native input (focus, select, setSelectionRange)
2605
2631
 
2606
2632
  - Import: `import { Input } from '@wirecore/wirelayer-react'`
2607
2633
 
@@ -2618,6 +2644,7 @@ Text field with sizes, leading icon, prefix and suffix; works inside Field
2618
2644
  | leadingIcon? | `IconComponent` | Icon component rendered inside the field, before the text |
2619
2645
  | prefix? | `string` | Static text segment before the input, e.g. `https://` |
2620
2646
  | suffix? | `string` | Static text segment after the input, e.g. `.de` |
2647
+ | mono? | `boolean` | Monospace font of the theme (JetBrains Mono) – for paths, tokens, codes, URLs and keys |
2621
2648
  | classes? | `RecipeClasses<typeof inputRecipe>` | Extra classes per part of the component, e.g. { base: "…" } (see the recipe) |
2622
2649
 
2623
2650
  ### InputGroup
@@ -2766,6 +2793,7 @@ Dial (270°): a slider – arrow keys, Page Up/Down, Home/End, or drag around th
2766
2793
  | step? | `number` | |
2767
2794
  | label? | `string` | Visible label, also the accessible name |
2768
2795
  | aria-label? | `string` | |
2796
+ | id? | `string` | Id of the dial (the slider); a `<label for>` cannot name it, use `label`, a Field or aria-label |
2769
2797
  | formatValue? | `(value: number) => string` | Formats the shown and announced value, e.g. (v) => `${v} %` |
2770
2798
  | valueTemplate? | `string` | Text with the value in it, e.g. "{value} %" (when there is no formatValue) |
2771
2799
  | strokeWidth? | `number` | Width of the arc (default 8, of a 100 wide dial) |
@@ -2820,6 +2848,7 @@ Always visible list (role="listbox"): arrow keys move, Enter/Space choose, typin
2820
2848
  | items | `readonly T[]` | Options: ListboxItem objects – or any objects or values, read with itemValue/itemLabel/itemDisabled/itemGroup |
2821
2849
  | label? | `string` | Visible label, also the list's accessible name |
2822
2850
  | aria-label? | `string` | Accessible name without a visible label |
2851
+ | id? | `string` | Id of the root element; a `<label for>` cannot name the list box, use a Field or aria-label |
2823
2852
  | multiple? | `boolean` | Several options can be chosen (Space toggles) |
2824
2853
  | value? | `V[]` | Chosen values; any type (string, number, boolean, object) |
2825
2854
  | defaultValue? | `V[]` | |
@@ -3050,7 +3079,7 @@ The trigger is the slotted element (e.g. a Button or IconButton)
3050
3079
  - Import: `import { Menu } from '@wirecore/wirelayer-react'`
3051
3080
  - Category: Overlays
3052
3081
  - Example: https://wirecore.github.io/WireLayer/?path=/story/react_overlays-menu--playground
3053
- - Also takes: MenuItemOptions
3082
+ - Also takes: MenuItemOptions, MenuBehaviorOptions
3054
3083
 
3055
3084
  | Prop | Type | Description |
3056
3085
  | --- | --- | --- |
@@ -3178,6 +3207,7 @@ Month field ("10.2026"): type the digits in one go, or pick from the month grid;
3178
3207
  | size? | `'sm' \| 'md' \| 'lg'` | |
3179
3208
  | clearable? | `boolean` | Clear button in the field while it has a value |
3180
3209
  | aria-label? | `string` | Accessible name without a surrounding Field |
3210
+ | id? | `string` | Id of the field – the (first) date gets it; a `<label for>` cannot name it, use a Field or aria-label |
3181
3211
  | className? | `string` | |
3182
3212
  | style? | `CSSProperties` | |
3183
3213
  | classes? | `RecipeClasses<typeof datePicker>` | Extra classes per part of the date field, e.g. { control: "…" } (the calendar: RecipesProvider) |
@@ -3237,12 +3267,12 @@ The browser's select: its own keyboard and mobile pickers; inside a Field it is
3237
3267
  - Import: `import { NativeSelect } from '@wirecore/wirelayer-react'`
3238
3268
  - Category: Forms
3239
3269
  - Example: https://wirecore.github.io/WireLayer/?path=/story/react_forms-nativeselect--playground
3240
- - Also takes: Omit<ComponentProps<'select'>, 'size' | 'onChange'>
3270
+ - Also takes: Omit< ComponentProps<'select'>, 'size' | 'onChange' >
3241
3271
 
3242
3272
  | Prop | Type | Description |
3243
3273
  | --- | --- | --- |
3244
- | items | `readonly NativeSelectOption[]` | |
3245
- | onValueChange? | `(value: string) => void` | |
3274
+ | items | `readonly NativeSelectOption<V>[]` | |
3275
+ | onValueChange? | `(value: V \| '') => void` | The chosen option's value with its type; the placeholder option gives an empty string |
3246
3276
  | placeholder? | `string` | First, empty option, e.g. "Please choose" |
3247
3277
  | size? | `Size` | |
3248
3278
  | invalid? | `boolean` | |
@@ -3325,7 +3355,7 @@ A number in the format of the locale ("€1,234.50")
3325
3355
 
3326
3356
  ### NumberInput
3327
3357
 
3328
- Number field with − / + buttons, arrow keys and locale formatting ("1,234.5")
3358
+ Number field with − / + buttons, arrow keys and locale formatting ("1,234.5"); `ref` reaches the native input
3329
3359
 
3330
3360
  - Import: `import { NumberInput } from '@wirecore/wirelayer-react'`
3331
3361
  - Category: Forms
@@ -3535,7 +3565,7 @@ Card with a heading (and actions); toggleable: the heading holds a button with a
3535
3565
 
3536
3566
  ### PasswordInput
3537
3567
 
3538
- Password field with a button that shows/hides the password (named "Show/Hide password")
3568
+ Password field with a button that shows/hides the password (named "Show/Hide password"); `ref` reaches the native input
3539
3569
 
3540
3570
  - Import: `import { PasswordInput } from '@wirecore/wirelayer-react'`
3541
3571
  - Category: Forms
@@ -3555,6 +3585,7 @@ Password field with a button that shows/hides the password (named "Show/Hide pas
3555
3585
  | loading? | `boolean` | Shows a spinner in the field and marks it busy (aria-busy) |
3556
3586
  | clearable? | `boolean` | Shows a button that empties the field while it has a value |
3557
3587
  | clearLabel? | `string` | Accessible name of the clear button (default "Clear input") |
3588
+ | mono? | `boolean` | Monospace font of the theme (JetBrains Mono) – for tokens, passphrases and keys |
3558
3589
  | classes? | `RecipeClasses<typeof passwordInputRecipe>` | Extra classes per part of the component, e.g. { base: "…" } (see the recipe) |
3559
3590
 
3560
3591
  ### PdfViewer
@@ -3717,6 +3748,7 @@ Code input (OTP, PIN): one box per character, typing moves on, pasting fills all
3717
3748
  | disabled? | `boolean` | |
3718
3749
  | name? | `string` | |
3719
3750
  | aria-label? | `string` | Accessible name of the group without a surrounding Field |
3751
+ | id? | `string` | Id of the root element; a `<label for>` cannot name the PIN input, use a Field or aria-label |
3720
3752
  | className? | `string` | |
3721
3753
  | style? | `CSSProperties` | |
3722
3754
  | classes? | `RecipeClasses<typeof pinInputRecipe>` | Extra classes per part of the component, e.g. { base: "…" } (see the recipe) |
@@ -3803,6 +3835,10 @@ Ark names the progressbar after its value; the label is the name, the value its
3803
3835
  | striped? | `boolean` | Diagonal stripes on the filled part |
3804
3836
  | animated? | `boolean` | Moving stripes (only without reduced motion) |
3805
3837
  | orientation? | `'horizontal' \| 'vertical'` | Vertical bar (fills the height of its parent) |
3838
+ | size? | `'xs' \| 'md'` | `xs`: a thin bar with small text, e.g. in a list or a status bar |
3839
+ | status? | `'info' \| 'success' \| 'warn' \| 'danger'` | Colour of the filled part by its state, e.g. `danger` for a failed transfer |
3840
+ | hideLabel? | `boolean` | The label only for screen readers – it still names the progress bar |
3841
+ | barText? | `string` | Short text in the bar, e.g. "42 %", "waiting" or "failed" (a taller bar; horizontal, without segments or steps) – screen readers get it after the value |
3806
3842
  | classes? | `RecipeClasses<typeof progressRecipe>` | Extra classes per part of the component, e.g. { base: "…" } (see the recipe) |
3807
3843
 
3808
3844
  ### ProgressCircle
@@ -3872,6 +3908,7 @@ Quarter field: type "Q4 2026" (also "2026-Q4", "4/2026") or pick from the four q
3872
3908
  | size? | `'sm' \| 'md' \| 'lg'` | |
3873
3909
  | clearable? | `boolean` | Clear button in the field while it has a value |
3874
3910
  | aria-label? | `string` | Accessible name without a surrounding Field |
3911
+ | id? | `string` | Id of the text field, e.g. for a `<label for>` |
3875
3912
  | className? | `string` | |
3876
3913
  | style? | `CSSProperties` | |
3877
3914
  | classes? | `RecipeClasses<typeof datePickerRecipe>` | Extra classes per part of the field, e.g. { control: "…" } (see the datePicker recipe) |
@@ -3916,13 +3953,13 @@ One choice out of several (role="radiogroup", arrow keys), horizontal or vertica
3916
3953
  - Import: `import { RadioGroup } from '@wirecore/wirelayer-react'`
3917
3954
  - Category: Forms
3918
3955
  - Example: https://wirecore.github.io/WireLayer/?path=/story/react_forms-radiogroup--playground
3919
- - Also takes: Omit<ComponentProps<'div'>, 'defaultValue' | 'dir'>
3956
+ - Also takes: Omit< ComponentProps<'div'>, 'defaultValue' | 'dir' >
3920
3957
 
3921
3958
  | Prop | Type | Description |
3922
3959
  | --- | --- | --- |
3923
- | value? | `string \| null` | |
3924
- | defaultValue? | `string \| null` | |
3925
- | onValueChange? | `(value: string \| null) => void` | |
3960
+ | value? | `V \| null` | Selected value; numbers when the items have number values |
3961
+ | defaultValue? | `V \| null` | |
3962
+ | onValueChange? | `(value: V \| null) => void` | |
3926
3963
  | label? | `string` | Visible group label (otherwise pass aria-label – or place the group in a Field with a label) |
3927
3964
  | orientation? | `RadioGroupOrientation` | |
3928
3965
  | columns? | `number` | Cards in a grid with this many columns (one column on small screens) – for RadioCard |
@@ -3943,7 +3980,7 @@ One option of a RadioGroup
3943
3980
 
3944
3981
  | Prop | Type | Description |
3945
3982
  | --- | --- | --- |
3946
- | value | `string` | |
3983
+ | value | `string \| number` | Value of the option – a number makes the group's value a number |
3947
3984
  | disabled? | `boolean` | |
3948
3985
  | classes? | `RecipeClasses<typeof radioGroupRecipe>` | Extra classes per part of the component, e.g. { base: "…" } (see the recipe) |
3949
3986
 
@@ -3968,6 +4005,7 @@ Star rating: a radio group – arrow keys change the value, each star reads "3 s
3968
4005
  | disabled? | `boolean` | |
3969
4006
  | label? | `string` | Visible label, also the group's accessible name |
3970
4007
  | aria-label? | `string` | |
4008
+ | id? | `string` | Id of the root element; a `<label for>` cannot name the rating, use a Field or aria-label |
3971
4009
  | size? | `'sm' \| 'md' \| 'lg'` | |
3972
4010
  | name? | `string` | |
3973
4011
  | className? | `string` | |
@@ -4219,13 +4257,13 @@ Few exclusive options as a segmented switch (radio group)
4219
4257
  - Import: `import { SegmentedControl } from '@wirecore/wirelayer-react'`
4220
4258
  - Category: Buttons
4221
4259
  - Example: https://wirecore.github.io/WireLayer/?path=/story/react_buttons-segmentedcontrol--playground
4222
- - Also takes: Omit<ComponentProps<'div'>, 'defaultValue' | 'dir'>
4260
+ - Also takes: Omit< ComponentProps<'div'>, 'defaultValue' | 'dir' >
4223
4261
 
4224
4262
  | Prop | Type | Description |
4225
4263
  | --- | --- | --- |
4226
- | value? | `string \| null` | |
4227
- | defaultValue? | `string` | |
4228
- | onValueChange? | `(value: string \| null) => void` | |
4264
+ | value? | `V \| null` | |
4265
+ | defaultValue? | `V` | |
4266
+ | onValueChange? | `(value: V \| null) => void` | |
4229
4267
  | label? | `string` | Accessible name of the group (visually hidden) – inside a Field with a label, the Field's label names it |
4230
4268
  | size? | `SegmentedControlSize` | |
4231
4269
  | disabled? | `boolean` | |
@@ -4287,6 +4325,9 @@ Dropdown list for one option: arrow keys, typeahead, Escape; native select hidde
4287
4325
  | minSearchLength? | `number` | Fewest characters the search needs before the data source is asked |
4288
4326
  | pageSize? | `number` | Options per request of the data source (default 50) |
4289
4327
  | standalone? | `boolean` | Not labelled by a surrounding Field – for a second control inside it (e.g. PhoneInput's country) |
4328
+ | open? | `boolean` | Whether the list is open (controlled, with onOpenChange) |
4329
+ | onOpenChange? | `(open: boolean) => void` | The list opened or closed |
4330
+ | stopKeyPropagation? | `boolean` | Keeps the keys the list handles itself (Enter choosing or opening, Escape closing, Tab leaving) from bubbling up – e.g. in a dialog with window shortcuts for Enter (save) and Escape (cancel) |
4290
4331
  | renderItem? | `(item: T, state: ListItemState) => ReactNode` | Content of an option (instead of icon and label) |
4291
4332
  | renderValue? | `(item: T) => ReactNode` | Content of the field for the selected item |
4292
4333
  | classes? | `RecipeClasses<typeof selectRecipe>` | Extra classes per part of the component, e.g. { base: "…" } (see the recipe) |
@@ -4451,6 +4492,7 @@ Range: "Price, Minimum" / "Price, Maximum"
4451
4492
  | label | `string` | Visible label, also the accessible name of the thumbs |
4452
4493
  | thumbLabels? | `readonly string[]` | Names of the thumbs of a range slider, read after the label |
4453
4494
  | showValue? | `boolean` | Shows the formatted value next to the label |
4495
+ | hideLabel? | `boolean` | The label for screen readers only – it stays the accessible name of the thumbs |
4454
4496
  | formatValue? | `(value: number) => string` | Formats the shown and announced value, e.g. (v) => `${v} %` |
4455
4497
  | disabled? | `boolean` | |
4456
4498
  | name? | `string` | |
@@ -4740,7 +4782,7 @@ Sticks to the top or bottom edge while its container scrolls
4740
4782
 
4741
4783
  ### Switch
4742
4784
 
4743
- Ark renders a plain checkbox; role="switch" makes screen readers announce it as a switch
4785
+ Without a text the label is left out: Ark names the input by it, an empty one would hide a <label for>
4744
4786
 
4745
4787
  - Import: `import { Switch } from '@wirecore/wirelayer-react'`
4746
4788
  - Category: Forms
@@ -4900,13 +4942,14 @@ Free entries: Enter or "," adds, Backspace on the empty field selects the last e
4900
4942
  | dataSource? | `DataSource<string>` | Suggestions from a server instead of `suggestions`: asked with the typed text after a typing pause (outdated answers dropped), more while scrolling |
4901
4943
  | minSearchLength? | `number` | Fewest characters the typed text needs before the data source is asked (default 1) |
4902
4944
  | aria-label? | `string` | Accessible name without a surrounding Field |
4945
+ | id? | `string` | Id of the input, e.g. for a `<label for>` |
4903
4946
  | className? | `string` | |
4904
4947
  | style? | `CSSProperties` | |
4905
4948
  | classes? | `RecipeClasses<typeof tagsInputRecipe>` | Extra classes per part of the component, e.g. { base: "…" } (see the recipe) |
4906
4949
 
4907
4950
  ### Textarea
4908
4951
 
4909
- Multi-line text field, optionally growing with the text (autoResize) and with a counter; works inside Field
4952
+ Multi-line text field, optionally growing with the text (autoResize) and with a counter; works inside Field. `ref` reaches the native textarea
4910
4953
 
4911
4954
  - Import: `import { Textarea } from '@wirecore/wirelayer-react'`
4912
4955
  - Category: Forms
@@ -4925,6 +4968,7 @@ Multi-line text field, optionally growing with the text (autoResize) and with a
4925
4968
  | loading? | `boolean` | Shows a spinner in the corner and marks the field busy (aria-busy) |
4926
4969
  | clearable? | `boolean` | Shows a button that empties the field while it has text |
4927
4970
  | clearLabel? | `string` | Accessible name of the clear button (default "Clear input") |
4971
+ | mono? | `boolean` | Monospace font of the theme (JetBrains Mono) – for keys, codes and logs |
4928
4972
  | classes? | `RecipeClasses<typeof textareaRecipe> & RecipeClasses<typeof textareaPartsRecipe>` | Extra classes per part of the component, e.g. { base: "…" } (see the recipes textarea and textareaParts) |
4929
4973
 
4930
4974
  ### TimeGrid
@@ -5017,6 +5061,7 @@ Time field: type the digits one after another ("1430"), arrow keys change hour o
5017
5061
  | referenceDate? | `string` | Day whose offset applies with timeZone (ISO, default today) |
5018
5062
  | showTimeZone? | `boolean` | Short zone name after the time ("CEST") |
5019
5063
  | aria-label? | `string` | Accessible name without a surrounding Field |
5064
+ | id? | `string` | Id of the field – the (first) time gets it; a `<label for>` cannot name it, use a Field or aria-label |
5020
5065
  | className? | `string` | |
5021
5066
  | style? | `CSSProperties` | |
5022
5067
  | classes? | `RecipeClasses<typeof datePickerRecipe>` | Extra classes per part of the component, e.g. { base: "…" } (see the recipe) |
@@ -5047,6 +5092,7 @@ Start and end time in one field ("09:00 – 17:30"): typing runs on from start t
5047
5092
  | size? | `'sm' \| 'md' \| 'lg'` | |
5048
5093
  | clearable? | `boolean` | Clear button in the field while it has a value |
5049
5094
  | aria-label? | `string` | Accessible name without a surrounding Field |
5095
+ | id? | `string` | Id of the field – the (first) time gets it; a `<label for>` cannot name it, use a Field or aria-label |
5050
5096
  | className? | `string` | |
5051
5097
  | style? | `CSSProperties` | |
5052
5098
  | classes? | `RecipeClasses<typeof datePickerRecipe>` | Extra classes per part of the component (see the datePicker recipe) |
@@ -5148,6 +5194,7 @@ No element of its own: the trigger is the slotted element
5148
5194
  | closeDelay? | `number` | Delay before closing (ms); default 150 or that of the TooltipGroup |
5149
5195
  | interactive? | `boolean` | The pointer can move onto the tooltip without it closing (WCAG 1.4.13) |
5150
5196
  | followCursor? | `boolean` | Follows the mouse pointer over the trigger |
5197
+ | closeOnScroll? | `boolean` | Closes when the page (or a container around the trigger) scrolls – false keeps it open while scrolling |
5151
5198
  | disabled? | `boolean` | Never opens (e.g. Truncate while the text fits) – the trigger stays the same element |
5152
5199
  | children | `ReactElement` | The trigger element – no wrapper of its own. A disabled button gets no pointer or focus events: wrap it in a focusable element (`<span tabIndex={0}>`) or use aria-disabled |
5153
5200
  | classes? | `RecipeClasses<typeof tooltipRecipe>` | Extra classes per part of the component, e.g. { base: "…" } (see the recipe) |
@@ -5298,6 +5345,7 @@ Select whose options are a tree: the button opens the tree in a panel, choosing
5298
5345
  | onLoadChildren? | `(node: TreeNode) => void` | A lazy node opened and there is no loadChildren/dataSource: add its children to the items |
5299
5346
  | dataSource? | `DataSource<TreeNode>` | Source of the children of lazy nodes (`getChildren`) |
5300
5347
  | aria-label? | `string` | Accessible name without a surrounding Field |
5348
+ | id? | `string` | Id of the field (the trigger), e.g. for a `<label for>` |
5301
5349
  | className? | `string` | |
5302
5350
  | style? | `CSSProperties` | |
5303
5351
  | classes? | `RecipeClasses<typeof treeSelectRecipe>` | Extra classes per part of the component, e.g. { base: "…" } (see the recipe) |
@@ -5515,6 +5563,7 @@ Year field ("2026"): type the digits, or pick from the year grid; range: start
5515
5563
  | size? | `'sm' \| 'md' \| 'lg'` | |
5516
5564
  | clearable? | `boolean` | Clear button in the field while it has a value |
5517
5565
  | aria-label? | `string` | Accessible name without a surrounding Field |
5566
+ | id? | `string` | Id of the field – the (first) date gets it; a `<label for>` cannot name it, use a Field or aria-label |
5518
5567
  | className? | `string` | |
5519
5568
  | style? | `CSSProperties` | |
5520
5569
  | classes? | `RecipeClasses<typeof datePicker>` | Extra classes per part of the date field, e.g. { control: "…" } (the calendar: RecipesProvider) |
@@ -5717,6 +5766,29 @@ that render components, such as `confirm` or the DataTable feature `dateInput`,
5717
5766
  components warn in the console when the classes of a recipe they render are missing. Recipes you call yourself
5718
5767
  (`card()`) are not checked – add their files along with the import.
5719
5768
 
5769
+ **With Vite** (Vue, React, Nuxt, Astro) the plugin `@wirecore/wirelayer-recipes/vite` adds these files itself: it reads
5770
+ the imports from `@wirecore/wirelayer-*` in your source files and adds the files of the imported components and recipes
5771
+ to the CSS file that imports `theme.css` (or `styles-core.css`). Put it before Tailwind's plugin:
5772
+
5773
+ ```ts
5774
+ // vite.config.ts (Nuxt: vite.plugins in nuxt.config.ts, Astro: vite.plugins in astro.config.mjs)
5775
+ import tailwindcss from '@tailwindcss/vite';
5776
+ import { wirelayer } from '@wirecore/wirelayer-recipes/vite';
5777
+
5778
+ export default { plugins: [wirelayer(), tailwindcss()] };
5779
+ ```
5780
+
5781
+ ```css
5782
+ @import 'tailwindcss';
5783
+ @import '@wirecore/wirelayer-vue/theme.css'; /* the plugin adds the sources files here */
5784
+ @import '@wirecore/wirelayer-vue/fonts.css'; /* the WireLayer fonts – leave it out with a font of your own */
5785
+ ```
5786
+
5787
+ `theme.css` is the theme without fonts and without component classes: an app with its own font
5788
+ (`@theme { --font-sans: … }`) does not bundle Schibsted Grotesk and JetBrains Mono. Components the plugin cannot see –
5789
+ registered globally (`app.component(…)`) or imported automatically – trigger the warning above; import their files by
5790
+ hand. Next.js does not use Vite: there, list the files or use `styles.css`.
5791
+
5720
5792
  ### Usage
5721
5793
 
5722
5794
  ```vue
@@ -5749,9 +5821,13 @@ import { ArrowRight } from 'lucide-react';
5749
5821
  // nuxt.config.ts
5750
5822
  import tailwindcss from '@tailwindcss/vite';
5751
5823
 
5824
+ import { wirelayer } from '@wirecore/wirelayer-recipes/vite';
5825
+
5752
5826
  export default defineNuxtConfig({
5753
- css: ['~/assets/main.css'], // @import 'tailwindcss'; @import '@wirecore/wirelayer-vue/styles.css';
5754
- vite: { plugins: [tailwindcss()] },
5827
+ // main.css: @import 'tailwindcss'; @import '@wirecore/wirelayer-vue/theme.css';
5828
+ // @import '@wirecore/wirelayer-vue/fonts.css'; – or styles.css with all classes, without the plugin
5829
+ css: ['~/assets/main.css'],
5830
+ vite: { plugins: [wirelayer(), tailwindcss()] },
5755
5831
  });
5756
5832
  ```
5757
5833
 
@@ -5834,6 +5910,31 @@ Every component consists of named parts of its recipe (`base`, `icon`, `row`, `t
5834
5910
  The names are the exports of the recipes (`button`, `iconButton`, `dataTable` …) and are checked by TypeScript, as are
5835
5911
  the variants and parts. Your own components use the same through `useRecipe('button', button)`.
5836
5912
 
5913
+ `variants` adds classes for single values of a variant, `compoundVariants` for combinations – instead of selectors on
5914
+ the recipe's own classes, which break when they change:
5915
+
5916
+ ```ts
5917
+ const recipes: RecipeConfig = {
5918
+ // only the medium size: 42px high, 16px text
5919
+ button: {
5920
+ variants: { size: { md: { base: 'h-[2.625rem] text-base' } } },
5921
+ compoundVariants: [{ size: ['sm', 'md'], shape: 'rounded', classes: { base: 'rounded-md' } }],
5922
+ },
5923
+ input: { variants: { size: { md: { base: 'h-[2.625rem]' } }, invalid: { true: { base: 'border-2' } } } },
5924
+ };
5925
+ ```
5926
+
5927
+ Per part the classes come in this order: `classes`, the matching `variants` and `compoundVariants`, the states of the
5928
+ recipe, the overrides of states (`invalid: { true: … }`), and last the class passed to the component. Inner providers
5929
+ extend outer ones (classes of the same value are joined, the inner ones win).
5930
+
5931
+ Classes from a provider or `classes` change the look, not the states: the classes of an active state variant
5932
+ (`invalid`, `success`, `disabled`, `readOnly`, `current`, `selected`, `checked`, `loading`) are added after them, so a
5933
+ field with `classes: { base: 'border-line-2' }` still turns red when it is invalid. States that the components mark as
5934
+ attributes (`data-invalid:`, `data-disabled:`, `data-[state=checked]:`) win through their selector anyway. Only the
5935
+ class passed to the component itself (`class`/`className`) comes after the states – the way out when a single field
5936
+ should look different in every state.
5937
+
5837
5938
  ### Hooks and composables
5838
5939
 
5839
5940
  Around 40 hooks (React) and composables (Vue) with the same names and the same logic – for your own components and
@@ -6212,6 +6313,73 @@ WireLayer is licensed under the MIT license. The fonts shipped with `@wirecore/w
6212
6313
  JetBrains Mono) are licensed under the SIL Open Font License 1.1 (`dist/fonts/OFL.txt`). Optional peer dependencies such
6213
6314
  as `pdfjs-dist` (Apache-2.0), Chart.js, Tiptap and Shiki are installed by the app itself – with their own licenses.
6214
6315
 
6316
+ ### Components and APIs side by side
6317
+
6318
+ | PrimeVue | WireLayer |
6319
+ | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- |
6320
+ | `<Button label icon="pi pi-x">` | the label as slot text, `:leading-icon` with a Lucide component (`@lucide/vue`) |
6321
+ | `severity` / `text` / `outlined` | `color` – or `variant="text"` / `variant="outline"` |
6322
+ | Icon button + `v-tooltip` | `<Tooltip content><IconButton :icon label /></Tooltip>` – `label` is the accessible name (often the tooltip text) |
6323
+ | `Button :loading` | `loading` on `Button` and `IconButton` (stays focusable, ignores clicks) |
6324
+ | `Card` with `#title`/`#content` | `Card` with the default slot and an own heading |
6325
+ | `InputText`, `Password`, `InputNumber`, `InputChips`, `SelectButton`, `RadioButton` | `Input`, `PasswordInput`, `NumberInput`, `TagsInput`, `SegmentedControl`, `RadioGroup` + `RadioGroupItem` |
6326
+ | `IconField` + `InputIcon` | `Input :leading-icon` |
6327
+ | `Select :options optionLabel optionValue` | `Select :items item-label item-value` (object values: `value-key`) |
6328
+ | `Message severity` | `Alert status` (`error` → `danger`) |
6329
+ | `Tag` | `Badge` |
6330
+ | `Dialog v-model:visible header` | `Dialog v-model:open` + `DialogContent title size` (`hide-title` keeps the title for screen readers only) |
6331
+ | `Toolbar` as a container | a plain `div` – WireLayer's `Toolbar` is `role="toolbar"` (one tab stop, arrow keys) |
6332
+ | `useToast().add({ severity, summary, detail, life })` | `toast({ type, title, description, duration })`, `<Toaster />` once in the app |
6333
+ | `useConfirm().require({ … })` | `await confirm({ title, description, … })`, `<ConfirmDialog />` once in the app |
6334
+ | `DataTable` + `Column` | `DataTable :columns` (column objects), `#cell-<id>`, `#expansion`, `v-model:page-size` |
6335
+ | `expandedRows` with a row toggler on some rows | `#expansion` + `row-expandable` |
6336
+ | `paginatorTemplate` (first/last page) | `paginator-edges`, `paginator-align` |
6337
+ | `showGridlines` (with the outer border) | `gridlines` + `bordered` |
6338
+ | `FilterMatchMode`, `filters` | `v-model:global-filter`, column `filter`/`filterOptions`, `filter-display="row"` |
6339
+ | `@primevue/forms` + `zodResolver` | TanStack Form with Zod directly as a Standard Schema, `FormField` + `bindInput`/`bindValue` |
6340
+ | `pt` (pass-through) | `classes` per part, `RecipesProvider` for all components below it |
6341
+ | Theme preset (`definePreset`) | `--wc-*` tokens, `defineTheme`, the component variables (_Foundations › Themes_) |
6342
+ | `darkModeSelector` (a class) | `data-mode` on `<html>` |
6343
+ | `tailwindcss-primeui` (`bg-surface-*`, `text-muted-color`) | semantic tokens: `bg-card`, `bg-bg-2`, `text-muted`, `border-line` … |
6344
+
6345
+ ### Pitfalls
6346
+
6347
+ - **An empty choice is `null`, not `''`.** For PrimeVue's Select `''` means "nothing chosen"; WireLayer's Select treats
6348
+ `''` as a value (it warns in development that it is not among the items). Use `null`.
6349
+ - **TanStack fields start with `''`.** A required text in Zod therefore needs `.min(1)` – `z.string()` alone accepts
6350
+ the empty field.
6351
+ - **Fonts:** set your own with `@theme { --font-sans: … }`. Import `theme.css` instead of `styles.css` (with the
6352
+ sources files, or the Vite plugin `@wirecore/wirelayer-recipes/vite`) so the WireLayer fonts are not bundled
6353
+ (_Getting started › Welcome › Smaller CSS_).
6354
+ - **Card spacing:** `Card` puts a `gap` between its direct children – wrap content that should sit tight in one
6355
+ element.
6356
+ - **Overrides go per part and per variant.** `classes: { base: 'rounded-md' }` reaches every size; only the medium size
6357
+ with `variants: { size: { md: { base: '…' } } }` – no selectors on the recipe's own classes. States such as `invalid`
6358
+ stay visible over such classes; only `class` on the component itself replaces them.
6359
+ - **Sizes and corners in one place:** the height, text and corners of buttons and fields per size, the corners of
6360
+ rounded buttons, the padding of cards and the backdrop of dialogs are CSS variables (`--wc-control-h-md` …).
6361
+ - **Labels:** wrap a control in `Field` (it links label, description and error). A native `<label for>` works with the
6362
+ control's own `id`; date fields, sliders and groups need `Field` or `aria-label`.
6363
+ - **Brand colours:** `checkTheme` lists the pairs below WCAG AA, `suggestThemeFixes` the nearest colours (and `on-*`
6364
+ colours) that meet them – an orange `primary` with white text, common in PrimeVue themes, does not.
6365
+
6366
+ ### Desktop apps (dense UI, many dialogs)
6367
+
6368
+ - **Focus from code:** the text fields expose `focus()`, `select()`, `setSelectionRange()` and the native input
6369
+ (`element`) through a template ref – no `$el.querySelector('input')`. In a dialog, mark the first field with
6370
+ `data-autofocus`: a `focus()` in `onMounted` is overridden by the dialog's focus trap.
6371
+ - **Window shortcuts in dialogs:** Enter/Escape listeners on `window` also get the keys of an open list. `Select` and
6372
+ `Combobox` take `stop-key-propagation` and report `v-model:open`; `ContextMenu` reports `v-model:open` and the
6373
+ right-clicked element (`@before-open`).
6374
+ - **Menus at a point:** `close-on-scroll`, `close-on-resize`, `close-on-blur`, and `highlight-first` so Enter takes the
6375
+ first item.
6376
+ - **Closable tabs** are built in: `TabsTrigger closable @close` – the close button is not nested in the tab, Delete
6377
+ closes the focused tab and the focus moves to its neighbour.
6378
+ - **Typed values:** `RadioGroup`, `SegmentedControl` and `NativeSelect` keep the type of the bound value (unions,
6379
+ numbers); `Checkbox` with a boolean model gives booleans.
6380
+ - **Compact parts:** `Progress size="xs"` with `hide-label`, `bar-text` and `status`; `Alert #actions`; `mono` on text
6381
+ fields; `DialogContent title-position="header"` puts the title next to the close button.
6382
+
6215
6383
  ### Custom theme
6216
6384
 
6217
6385
  A theme overrides any colors per mode. `themeToCss` generates the CSS for it,
@@ -6237,3 +6405,47 @@ writeFileSync('brand.css', themeToCss(brand));
6237
6405
  ```
6238
6406
 
6239
6407
  All bundled themes pass this check in both modes.
6408
+
6409
+ When a pair misses its contrast, `suggestThemeFixes` says how to fix it: per pair the nearest variant of a colour that
6410
+ meets it – its lightness moved in OKLCH, the hue kept – and, where text sits on the colour, a light or dark `on-*`
6411
+ colour. A suggestion never breaks a pair that passed:
6412
+
6413
+ ```ts
6414
+ import { suggestThemeFixes } from '@wirecore/wirelayer-tokens';
6415
+
6416
+ suggestThemeFixes(brand);
6417
+ // [{ name: 'primary: text-on-primary on bg-primary', mode: 'light', ratio: 2.6, min: 4.5,
6418
+ // color: { token: 'primary', value: '#a35c00', ratio: 4.5 },
6419
+ // on: { token: 'on-primary', value: '#050505', ratio: 8.1 } }, …]
6420
+ ```
6421
+
6422
+ ### Component sizes and shapes
6423
+
6424
+ Besides the colors, a few measures that a brand usually changes are CSS variables. Without them every component looks as
6425
+ before – their defaults are the values of the recipes. Set them on `:root` (all pages), on a `[data-theme]` or on any
6426
+ element (that part of the page):
6427
+
6428
+ ```css
6429
+ :root {
6430
+ --wc-control-h-md: 2.625rem; /* buttons and fields of the medium size: 42px */
6431
+ --wc-control-text-md: 1rem;
6432
+ --wc-control-radius-md: 0.375rem;
6433
+ --wc-button-radius: 0.375rem;
6434
+ --wc-card-p: 1.25rem;
6435
+ --wc-backdrop: rgb(0 0 0 / 0.4);
6436
+ }
6437
+ ```
6438
+
6439
+ | Variable | Default | Applies to |
6440
+ | ----------------------------------------------------- | -------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
6441
+ | `--wc-control-h-sm` / `-md` / `-lg` | `2rem` / `2.5rem` / `3rem` | Height of the sizes sm, md, lg: Button, IconButton, Input, NativeSelect, Select, MultiSelect, Combobox, NumberInput, PasswordInput, the date and time fields, ColorPicker, TagsInput (minimum) |
6442
+ | `--wc-control-radius-sm` / `-md` / `-lg` | `6px` / `8px` / `10px` | Corners of the fields above and of Textarea (not of buttons) |
6443
+ | `--wc-control-text-sm` / `-md` / `-lg` | `13px` / `15px` / `16px` | Text in the fields above and in Textarea |
6444
+ | `--wc-button-radius` | `8px` | Corners of Button and IconButton with `shape="rounded"` (`pill` and `square` stay) |
6445
+ | `--wc-card-p` | `1.5rem` | Padding of Card |
6446
+ | `--wc-backdrop` | `rgb(0 0 0 / 0.6)` | Dimming behind Dialog, Drawer and ConfirmDialog |
6447
+ | `--radius-card` / `--radius-panel` / `--radius-popup` | `20px` / `28px` / `12px` | Corners of cards, panels and popups (menus, lists, popovers) |
6448
+ | `--wc-dialog-w` | by `size` | Width of a DialogContent |
6449
+
6450
+ The rest – the padding of a dialog or of table cells, the size of a single variant – is set per part with `classes` or
6451
+ `RecipesProvider` (_Getting started › Welcome › Customizing_). The React Native components keep their fixed sizes.