@lutra-ui-system/react 0.1.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 (173) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +240 -0
  3. package/dist/components/button/button.d.ts +105 -0
  4. package/dist/components/button/button.d.ts.map +1 -0
  5. package/dist/components/button/button.js +91 -0
  6. package/dist/components/button/button.js.map +1 -0
  7. package/dist/components/button/index.d.ts +3 -0
  8. package/dist/components/button/index.d.ts.map +1 -0
  9. package/dist/components/button/index.js +2 -0
  10. package/dist/components/button/index.js.map +1 -0
  11. package/dist/components/card/card.d.ts +100 -0
  12. package/dist/components/card/card.d.ts.map +1 -0
  13. package/dist/components/card/card.js +51 -0
  14. package/dist/components/card/card.js.map +1 -0
  15. package/dist/components/card/index.d.ts +3 -0
  16. package/dist/components/card/index.d.ts.map +1 -0
  17. package/dist/components/card/index.js +2 -0
  18. package/dist/components/card/index.js.map +1 -0
  19. package/dist/components/checkbox/checkbox.d.ts +67 -0
  20. package/dist/components/checkbox/checkbox.d.ts.map +1 -0
  21. package/dist/components/checkbox/checkbox.js +63 -0
  22. package/dist/components/checkbox/checkbox.js.map +1 -0
  23. package/dist/components/checkbox/index.d.ts +3 -0
  24. package/dist/components/checkbox/index.d.ts.map +1 -0
  25. package/dist/components/checkbox/index.js +2 -0
  26. package/dist/components/checkbox/index.js.map +1 -0
  27. package/dist/components/dialog/dialog.d.ts +88 -0
  28. package/dist/components/dialog/dialog.d.ts.map +1 -0
  29. package/dist/components/dialog/dialog.js +156 -0
  30. package/dist/components/dialog/dialog.js.map +1 -0
  31. package/dist/components/dialog/index.d.ts +3 -0
  32. package/dist/components/dialog/index.d.ts.map +1 -0
  33. package/dist/components/dialog/index.js +2 -0
  34. package/dist/components/dialog/index.js.map +1 -0
  35. package/dist/components/dropdown/dropdown.d.ts +89 -0
  36. package/dist/components/dropdown/dropdown.d.ts.map +1 -0
  37. package/dist/components/dropdown/dropdown.js +173 -0
  38. package/dist/components/dropdown/dropdown.js.map +1 -0
  39. package/dist/components/dropdown/index.d.ts +3 -0
  40. package/dist/components/dropdown/index.d.ts.map +1 -0
  41. package/dist/components/dropdown/index.js +2 -0
  42. package/dist/components/dropdown/index.js.map +1 -0
  43. package/dist/components/error-summary/error-summary.d.ts +81 -0
  44. package/dist/components/error-summary/error-summary.d.ts.map +1 -0
  45. package/dist/components/error-summary/error-summary.js +85 -0
  46. package/dist/components/error-summary/error-summary.js.map +1 -0
  47. package/dist/components/error-summary/index.d.ts +3 -0
  48. package/dist/components/error-summary/index.d.ts.map +1 -0
  49. package/dist/components/error-summary/index.js +2 -0
  50. package/dist/components/error-summary/index.js.map +1 -0
  51. package/dist/components/field/field.d.ts +55 -0
  52. package/dist/components/field/field.d.ts.map +1 -0
  53. package/dist/components/field/field.js +26 -0
  54. package/dist/components/field/field.js.map +1 -0
  55. package/dist/components/field/index.d.ts +3 -0
  56. package/dist/components/field/index.d.ts.map +1 -0
  57. package/dist/components/field/index.js +2 -0
  58. package/dist/components/field/index.js.map +1 -0
  59. package/dist/components/field-group/field-group.d.ts +67 -0
  60. package/dist/components/field-group/field-group.d.ts.map +1 -0
  61. package/dist/components/field-group/field-group.js +38 -0
  62. package/dist/components/field-group/field-group.js.map +1 -0
  63. package/dist/components/field-group/index.d.ts +3 -0
  64. package/dist/components/field-group/index.d.ts.map +1 -0
  65. package/dist/components/field-group/index.js +2 -0
  66. package/dist/components/field-group/index.js.map +1 -0
  67. package/dist/components/input/index.d.ts +3 -0
  68. package/dist/components/input/index.d.ts.map +1 -0
  69. package/dist/components/input/index.js +2 -0
  70. package/dist/components/input/index.js.map +1 -0
  71. package/dist/components/input/input.d.ts +96 -0
  72. package/dist/components/input/input.d.ts.map +1 -0
  73. package/dist/components/input/input.js +26 -0
  74. package/dist/components/input/input.js.map +1 -0
  75. package/dist/components/link/index.d.ts +3 -0
  76. package/dist/components/link/index.d.ts.map +1 -0
  77. package/dist/components/link/index.js +2 -0
  78. package/dist/components/link/index.js.map +1 -0
  79. package/dist/components/link/link.d.ts +44 -0
  80. package/dist/components/link/link.d.ts.map +1 -0
  81. package/dist/components/link/link.js +26 -0
  82. package/dist/components/link/link.js.map +1 -0
  83. package/dist/components/link-card/index.d.ts +3 -0
  84. package/dist/components/link-card/index.d.ts.map +1 -0
  85. package/dist/components/link-card/index.js +2 -0
  86. package/dist/components/link-card/index.js.map +1 -0
  87. package/dist/components/link-card/link-card.d.ts +62 -0
  88. package/dist/components/link-card/link-card.d.ts.map +1 -0
  89. package/dist/components/link-card/link-card.js +43 -0
  90. package/dist/components/link-card/link-card.js.map +1 -0
  91. package/dist/components/mobile-navigation/index.d.ts +3 -0
  92. package/dist/components/mobile-navigation/index.d.ts.map +1 -0
  93. package/dist/components/mobile-navigation/index.js +2 -0
  94. package/dist/components/mobile-navigation/index.js.map +1 -0
  95. package/dist/components/mobile-navigation/mobile-navigation.d.ts +88 -0
  96. package/dist/components/mobile-navigation/mobile-navigation.d.ts.map +1 -0
  97. package/dist/components/mobile-navigation/mobile-navigation.js +153 -0
  98. package/dist/components/mobile-navigation/mobile-navigation.js.map +1 -0
  99. package/dist/components/navigation-item/index.d.ts +3 -0
  100. package/dist/components/navigation-item/index.d.ts.map +1 -0
  101. package/dist/components/navigation-item/index.js +2 -0
  102. package/dist/components/navigation-item/index.js.map +1 -0
  103. package/dist/components/navigation-item/navigation-item.d.ts +38 -0
  104. package/dist/components/navigation-item/navigation-item.d.ts.map +1 -0
  105. package/dist/components/navigation-item/navigation-item.js +22 -0
  106. package/dist/components/navigation-item/navigation-item.js.map +1 -0
  107. package/dist/components/radio/index.d.ts +3 -0
  108. package/dist/components/radio/index.d.ts.map +1 -0
  109. package/dist/components/radio/index.js +2 -0
  110. package/dist/components/radio/index.js.map +1 -0
  111. package/dist/components/radio/radio.d.ts +58 -0
  112. package/dist/components/radio/radio.d.ts.map +1 -0
  113. package/dist/components/radio/radio.js +37 -0
  114. package/dist/components/radio/radio.js.map +1 -0
  115. package/dist/components/select/index.d.ts +3 -0
  116. package/dist/components/select/index.d.ts.map +1 -0
  117. package/dist/components/select/index.js +2 -0
  118. package/dist/components/select/index.js.map +1 -0
  119. package/dist/components/select/select.d.ts +67 -0
  120. package/dist/components/select/select.d.ts.map +1 -0
  121. package/dist/components/select/select.js +25 -0
  122. package/dist/components/select/select.js.map +1 -0
  123. package/dist/components/select-field/index.d.ts +3 -0
  124. package/dist/components/select-field/index.d.ts.map +1 -0
  125. package/dist/components/select-field/index.js +2 -0
  126. package/dist/components/select-field/index.js.map +1 -0
  127. package/dist/components/select-field/select-field.d.ts +43 -0
  128. package/dist/components/select-field/select-field.d.ts.map +1 -0
  129. package/dist/components/select-field/select-field.js +24 -0
  130. package/dist/components/select-field/select-field.js.map +1 -0
  131. package/dist/components/table/index.d.ts +3 -0
  132. package/dist/components/table/index.d.ts.map +1 -0
  133. package/dist/components/table/index.js +2 -0
  134. package/dist/components/table/index.js.map +1 -0
  135. package/dist/components/table/table.d.ts +251 -0
  136. package/dist/components/table/table.d.ts.map +1 -0
  137. package/dist/components/table/table.js +209 -0
  138. package/dist/components/table/table.js.map +1 -0
  139. package/dist/components/toggle/index.d.ts +3 -0
  140. package/dist/components/toggle/index.d.ts.map +1 -0
  141. package/dist/components/toggle/index.js +2 -0
  142. package/dist/components/toggle/index.js.map +1 -0
  143. package/dist/components/toggle/toggle.d.ts +66 -0
  144. package/dist/components/toggle/toggle.d.ts.map +1 -0
  145. package/dist/components/toggle/toggle.js +49 -0
  146. package/dist/components/toggle/toggle.js.map +1 -0
  147. package/dist/components/tooltip/index.d.ts +3 -0
  148. package/dist/components/tooltip/index.d.ts.map +1 -0
  149. package/dist/components/tooltip/index.js +2 -0
  150. package/dist/components/tooltip/index.js.map +1 -0
  151. package/dist/components/tooltip/tooltip.d.ts +74 -0
  152. package/dist/components/tooltip/tooltip.d.ts.map +1 -0
  153. package/dist/components/tooltip/tooltip.js +180 -0
  154. package/dist/components/tooltip/tooltip.js.map +1 -0
  155. package/dist/index.d.ts +57 -0
  156. package/dist/index.d.ts.map +1 -0
  157. package/dist/index.js +38 -0
  158. package/dist/index.js.map +1 -0
  159. package/dist/internal/development.d.ts +2 -0
  160. package/dist/internal/development.d.ts.map +1 -0
  161. package/dist/internal/development.js +2 -0
  162. package/dist/internal/development.js.map +1 -0
  163. package/dist/internal/field-support.d.ts +68 -0
  164. package/dist/internal/field-support.d.ts.map +1 -0
  165. package/dist/internal/field-support.js +42 -0
  166. package/dist/internal/field-support.js.map +1 -0
  167. package/dist/internal/isomorphic-layout-effect.d.ts +26 -0
  168. package/dist/internal/isomorphic-layout-effect.d.ts.map +1 -0
  169. package/dist/internal/isomorphic-layout-effect.js +26 -0
  170. package/dist/internal/isomorphic-layout-effect.js.map +1 -0
  171. package/dist/styles.css +3474 -0
  172. package/dist/tokens.json +995 -0
  173. package/package.json +76 -0
@@ -0,0 +1,251 @@
1
+ import type { HTMLAttributes, ReactNode, TableHTMLAttributes, TdHTMLAttributes, ThHTMLAttributes } from 'react';
2
+ /** Horizontal alignment of a cell's content. Maps to the `align` axis of the Figma component sets. */
3
+ export type TableAlign = 'left' | 'right';
4
+ /**
5
+ * A column header's sort state.
6
+ *
7
+ * **Mind the vocabulary — two of these read like their opposite.**
8
+ *
9
+ * - `'not-sortable'` is a plain header with no sort control and **no `aria-sort` at all**.
10
+ * - `'unsorted'` is sortable but not currently sorted, which is what ARIA calls `aria-sort="none"`.
11
+ *
12
+ * The Figma values were renamed in August 2026 for exactly this reason: the old `sort=none` read as
13
+ * the ARIA value and meant the opposite of it. Do not map `not-sortable` onto `aria-sort="none"`.
14
+ */
15
+ export type TableSortState = 'not-sortable' | 'unsorted' | 'ascending' | 'descending';
16
+ type TableBaseProps = Omit<TableHTMLAttributes<HTMLTableElement>, 'children'> & {
17
+ /** `thead` and `tbody`. Write them yourself — the column count is yours, not this component's. */
18
+ children: ReactNode;
19
+ /**
20
+ * Text announced when the horizontal scroll region is reachable. Defaults to the caption when the
21
+ * caption is a plain string.
22
+ *
23
+ * A focusable region with no name announces nothing, so this matters only when the table
24
+ * overflows — which is exactly when the region becomes focusable.
25
+ */
26
+ scrollRegionLabel?: string;
27
+ /**
28
+ * A polite live region above the table, for the new result count after sorting, filtering or
29
+ * paginating.
30
+ *
31
+ * Each of those replaces the contents underneath someone who may not be looking at them, and the
32
+ * visual change alone is silent. It is rendered visibly as well as announced, because a result
33
+ * count is useful to everyone.
34
+ */
35
+ status?: ReactNode;
36
+ /** Extra class on the table element. */
37
+ className?: string;
38
+ };
39
+ /**
40
+ * Content that actually renders.
41
+ *
42
+ * `ReactNode` admits `null`, `undefined`, `false` and `true`, all of which render nothing. A caption
43
+ * typed as `ReactNode` would let `caption={undefined}` satisfy the naming requirement while naming
44
+ * the table with nothing, which is the failure this type exists to prevent.
45
+ */
46
+ type RenderableNode = Exclude<ReactNode, boolean | null | undefined>;
47
+ /**
48
+ * A table is named, or it is unnavigable. Two unnamed tables on one page are indistinguishable in a
49
+ * screen reader's table list, so the type insists on exactly one of the two ways of naming it — and
50
+ * on the caption branch carrying something that renders.
51
+ */
52
+ type TableNaming = {
53
+ /** A real `<caption>`. */
54
+ caption: RenderableNode;
55
+ labelledBy?: never;
56
+ } | {
57
+ caption?: never;
58
+ /** The id of the heading that names this table. */
59
+ labelledBy: string;
60
+ };
61
+ export type TableProps = TableBaseProps & TableNaming;
62
+ /**
63
+ * A table of records compared across the same set of attributes.
64
+ *
65
+ * **Native `table`, `thead`, `tbody`, `tr`, `th` and `td` throughout.** Those give row and column
66
+ * navigation for free; a grid of divs with roles bolted on does not survive contact with reality.
67
+ * This component supplies the wrapper, the name, the scroll region and the live region — the rows and
68
+ * columns are yours to write, because the column count differs on every screen.
69
+ *
70
+ * When the columns no longer fit, the table scrolls sideways inside a region that becomes focusable
71
+ * so it can be reached without a pointer. Rows are never collapsed into stacked cards: that destroys
72
+ * the comparison the table exists to support, and the semantics with it.
73
+ */
74
+ export declare function Table({ children, caption, labelledBy, scrollRegionLabel, status, className, ...forwarded }: TableProps): import("react").JSX.Element;
75
+ export interface TableRowProps extends HTMLAttributes<HTMLTableRowElement> {
76
+ /**
77
+ * Tints the row to show it is selected.
78
+ *
79
+ * **The tint is the secondary cue.** The checked box in the selection cell is the primary one, so
80
+ * selection survives greyscale, high-contrast modes and a printed page.
81
+ *
82
+ * @default false
83
+ */
84
+ selected?: boolean;
85
+ children: ReactNode;
86
+ }
87
+ /**
88
+ * One row. Renders a native `<tr>`.
89
+ *
90
+ * It exists because the row carries styling — the divider, the hover tint and the selected tint —
91
+ * and the library's stylesheet rules forbid reaching for a bare element selector to apply it. It adds
92
+ * nothing to the semantics a `<tr>` already has.
93
+ *
94
+ * **The row itself stays inert.** There is no row-level click handler and no row-level selection:
95
+ * clicking the row background does nothing, because a row that responds to clicks competes with the
96
+ * controls inside it and is invisible to the keyboard.
97
+ */
98
+ export declare function TableRow({ selected, children, className, ...nativeProps }: TableRowProps): import("react").JSX.Element;
99
+ /**
100
+ * Native `<th>` attributes, minus the three this component owns.
101
+ *
102
+ * `aria-sort` is excluded deliberately: it is derived from `sort` and nothing else, so a consumer
103
+ * cannot set it to something the rendered glyph contradicts. The whole point of the single `sort`
104
+ * value is that the attribute and the indicator cannot disagree, and a passthrough would have handed
105
+ * that back. `scope` is always `col` here, and `children` is typed per variant below.
106
+ */
107
+ type HeaderCellBase = Omit<ThHTMLAttributes<HTMLTableCellElement>, 'scope' | 'children' | 'aria-sort'> & {
108
+ /** @default 'left' */
109
+ align?: TableAlign;
110
+ className?: string;
111
+ };
112
+ type NotSortableHeaderCell = HeaderCellBase & {
113
+ /** @default 'not-sortable' */
114
+ sort?: 'not-sortable';
115
+ onSort?: never;
116
+ sortActionLabel?: never;
117
+ children: ReactNode;
118
+ };
119
+ type SortableHeaderCell = HeaderCellBase & {
120
+ sort: Exclude<TableSortState, 'not-sortable'>;
121
+ /** Called when the sort button is activated. */
122
+ onSort: () => void;
123
+ /**
124
+ * Overrides the sort button's accessible name. The default says what activating it will do,
125
+ * including the column: `"Applicant, sort ascending"`.
126
+ */
127
+ sortActionLabel?: string;
128
+ /**
129
+ * The column label. A plain string when the column is sortable, because it is also read into the
130
+ * sort button's accessible name.
131
+ */
132
+ children: string;
133
+ };
134
+ export type TableHeaderCellProps = NotSortableHeaderCell | SortableHeaderCell;
135
+ /**
136
+ * A column header. Renders `<th scope="col">`.
137
+ *
138
+ * **A sortable header contains a button; the `th` is not itself clickable.** A clickable `th` is not
139
+ * an interactive element to anything but a mouse.
140
+ *
141
+ * `sort` drives the `aria-sort` attribute and the visible glyph together, from one value, so the two
142
+ * cannot drift apart — the pair is a single state, not two props to keep in step. `not-sortable`
143
+ * renders no button and no `aria-sort` at all.
144
+ *
145
+ * The button's accessible name says what activating it will do, including the column name:
146
+ * `"Applicant, sort ascending"`. A column heading is not automatically part of a button's name, so
147
+ * "sort" on its own would leave a screen-reader user with a list of identical buttons.
148
+ *
149
+ * Sort one column at a time. Multi-column sort needs a control outside the table.
150
+ */
151
+ export declare function TableHeaderCell(props: TableHeaderCellProps): import("react").JSX.Element;
152
+ export interface TableCellProps extends TdHTMLAttributes<HTMLTableCellElement> {
153
+ /** @default 'left' */
154
+ align?: TableAlign;
155
+ /**
156
+ * `'strong'` marks the cell that identifies the row, and **renders a `<th scope="row">` rather than
157
+ * a `<td>`**. That is what lets a screen reader announce the applicant's name as someone moves
158
+ * across the row. One per row.
159
+ *
160
+ * `'muted'` is for secondary attributes that should not compete with the identifying cell.
161
+ *
162
+ * @default 'default'
163
+ */
164
+ emphasis?: 'default' | 'strong' | 'muted';
165
+ children?: ReactNode;
166
+ }
167
+ /**
168
+ * One value in a row. Renders a `<td>`, or a `<th scope="row">` when `emphasis="strong"`.
169
+ *
170
+ * `align="right"` sets the cell in tabular figures with `font-variant-numeric: tabular-nums`, so
171
+ * digits align column-wise. Figma cannot express the OpenType feature, so the design silently depends
172
+ * on this — which is why it is bound to the alignment rather than left to be remembered.
173
+ */
174
+ export declare function TableCell({ align, emphasis, children, className, ...nativeProps }: TableCellProps): import("react").JSX.Element;
175
+ export interface TableSelectionCellProps extends Omit<TdHTMLAttributes<HTMLTableCellElement>, 'onChange'> {
176
+ /**
177
+ * The checkbox's accessible name, identifying the record: `"Select Amara Osei"`. Rendered
178
+ * visually hidden, because the column has no visible header text to borrow.
179
+ *
180
+ * "Select" alone leaves a screen-reader user with a column of identical checkboxes.
181
+ */
182
+ label: string;
183
+ checked: boolean;
184
+ /**
185
+ * The header's select-all shows mixed when the selection is partial. Uses the DOM `indeterminate`
186
+ * property, which is the only place that state exists.
187
+ *
188
+ * @default false
189
+ */
190
+ indeterminate?: boolean;
191
+ onChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
192
+ disabled?: boolean;
193
+ /** Renders `<th scope="col">` for the select-all cell in the header row. @default false */
194
+ header?: boolean;
195
+ }
196
+ /**
197
+ * The cell holding a row's selection checkbox, or the select-all in the header row.
198
+ *
199
+ * Add selection only when the table has a bulk action to apply to it.
200
+ *
201
+ * The checkbox communicates selection; the row tint on `TableRow` is supplemental and must never be
202
+ * the only cue. The label is visually hidden rather than absent, and native — a `<label>` wrapping
203
+ * the control, not an `aria-label` — because the column has no visible header text to borrow.
204
+ */
205
+ export declare function TableSelectionCell({ label, checked, indeterminate, onChange, disabled, header, className, ...nativeProps }: TableSelectionCellProps): import("react").JSX.Element;
206
+ export interface TableRowActionsProps extends TdHTMLAttributes<HTMLTableCellElement> {
207
+ /**
208
+ * The controls. One visible action plus an overflow menu is the budget — each control is its own
209
+ * tab stop, so ten rows with two controls each costs twenty of them.
210
+ *
211
+ * An icon-only control needs a name identifying the record: `"More actions for Amara Osei"`, not
212
+ * `"More"`. A screen reader does not read the column heading as part of a button's name.
213
+ */
214
+ children: ReactNode;
215
+ }
216
+ /**
217
+ * The last cell in a row, holding that row's actions. Renders a `<td>`.
218
+ *
219
+ * **The controls stay visually compact, and their pointer targets do not.** Each control gets an
220
+ * invisible 44 × 44px target that expands into the cell's padding rather than adding to the row
221
+ * height, so a dense table keeps its 52px rows while every target still meets the minimum.
222
+ *
223
+ * **Never reveal row actions on hover only.** Keyboard and touch users have no hover, so a
224
+ * hover-revealed action does not exist for them.
225
+ */
226
+ export declare function TableRowActions({ children, className, ...nativeProps }: TableRowActionsProps): import("react").JSX.Element;
227
+ export interface TableEmptyStateProps {
228
+ /** How many columns to span. Every column, so the message is not squeezed into the first one. */
229
+ colSpan: number;
230
+ /** The headline: why the table is empty. */
231
+ title: ReactNode;
232
+ /** What to do about it. */
233
+ children?: ReactNode;
234
+ /** The way back — usually a Button that clears the filters. */
235
+ action?: ReactNode;
236
+ className?: string;
237
+ }
238
+ /**
239
+ * The message shown when a table has no rows. Renders a `<tr>` holding one `<td>` that spans every
240
+ * column, and belongs inside the `tbody`.
241
+ *
242
+ * **The table, the `thead` and the column headers stay on the page.** That structure is what someone
243
+ * has already learned by exploring it; removing it makes an empty result feel like a broken page and
244
+ * discards the work they have done.
245
+ *
246
+ * When a filter is what emptied the table, announce the new result count too — `Table`'s `status`
247
+ * prop is the polite live region for it. The visual change alone is silent.
248
+ */
249
+ export declare function TableEmptyState({ colSpan, title, children, action, className, }: TableEmptyStateProps): import("react").JSX.Element;
250
+ export {};
251
+ //# sourceMappingURL=table.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../../../src/components/table/table.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,cAAc,EACd,SAAS,EACT,mBAAmB,EACnB,gBAAgB,EAChB,gBAAgB,EACjB,MAAM,OAAO,CAAC;AAMf,sGAAsG;AACtG,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,OAAO,CAAC;AAE1C;;;;;;;;;;GAUG;AACH,MAAM,MAAM,cAAc,GAAG,cAAc,GAAG,UAAU,GAAG,WAAW,GAAG,YAAY,CAAC;AAgBtF,KAAK,cAAc,GAAG,IAAI,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,EAAE,UAAU,CAAC,GAAG;IAC9E,kGAAkG;IA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,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,WAAW,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;IAC/D,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,2FAA2F;IAC3F,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAC,EACjC,KAAK,EACL,OAAO,EACP,aAAqB,EACrB,QAAQ,EACR,QAAgB,EAChB,MAAc,EACd,SAAS,EACT,GAAG,WAAW,EACf,EAAE,uBAAuB,+BAiCzB;AAED,MAAM,WAAW,oBAAqB,SAAQ,gBAAgB,CAAC,oBAAoB,CAAC;IAClF;;;;;;OAMG;IACH,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,WAAW,EAAE,EAAE,oBAAoB,+BAW5F;AAED,MAAM,WAAW,oBAAoB;IACnC,iGAAiG;IACjG,OAAO,EAAE,MAAM,CAAC;IAChB,4CAA4C;IAC5C,KAAK,EAAE,SAAS,CAAC;IACjB,2BAA2B;IAC3B,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,+DAA+D;IAC/D,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAmBD;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,CAAC,EAC9B,OAAO,EACP,KAAK,EACL,QAAQ,EACR,MAAM,EACN,SAAS,GACV,EAAE,oBAAoB,+BAwBtB"}
@@ -0,0 +1,209 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { useCallback, useEffect, useRef, useState } from 'react';
3
+ import { isDevelopment } from '../../internal/development.js';
4
+ import { useIsomorphicLayoutEffect } from '../../internal/isomorphic-layout-effect.js';
5
+ import { Checkbox } from '../checkbox/index.js';
6
+ /** The `aria-sort` value each state carries. `not-sortable` carries none. */
7
+ const ARIA_SORT = {
8
+ unsorted: 'none',
9
+ ascending: 'ascending',
10
+ descending: 'descending',
11
+ };
12
+ /** What activating the button will do next, which is what its accessible name has to say. */
13
+ const NEXT_DIRECTION = {
14
+ unsorted: 'ascending',
15
+ ascending: 'descending',
16
+ descending: 'ascending',
17
+ };
18
+ /**
19
+ * A table of records compared across the same set of attributes.
20
+ *
21
+ * **Native `table`, `thead`, `tbody`, `tr`, `th` and `td` throughout.** Those give row and column
22
+ * navigation for free; a grid of divs with roles bolted on does not survive contact with reality.
23
+ * This component supplies the wrapper, the name, the scroll region and the live region — the rows and
24
+ * columns are yours to write, because the column count differs on every screen.
25
+ *
26
+ * When the columns no longer fit, the table scrolls sideways inside a region that becomes focusable
27
+ * so it can be reached without a pointer. Rows are never collapsed into stacked cards: that destroys
28
+ * the comparison the table exists to support, and the semantics with it.
29
+ */
30
+ export function Table({ children, caption, labelledBy, scrollRegionLabel, status, className, ...forwarded }) {
31
+ // Naming is exactly one of `caption` or `labelledBy`, and the type says so — but `aria-labelledby`
32
+ // is hyphenated, and TypeScript exempts hyphenated JSX attributes from excess-property checking,
33
+ // so one can still be passed. It is dropped here so a table cannot end up with two names, one of
34
+ // which the type believed it had ruled out. Same reasoning as `aria-sort` on TableHeaderCell.
35
+ const { 'aria-labelledby': _consumerLabelledBy, ...nativeProps } = forwarded;
36
+ const scrollRef = useRef(null);
37
+ const [overflowing, setOverflowing] = useState(false);
38
+ const measure = useCallback(() => {
39
+ const element = scrollRef.current;
40
+ if (!element)
41
+ return;
42
+ setOverflowing(element.scrollWidth > element.clientWidth);
43
+ }, []);
44
+ // The region is focusable only while there is something to scroll. A permanent tab stop in front
45
+ // of a table that fits is a tab stop that does nothing, and the annotation's reason for making it
46
+ // focusable — reaching the scroll without a pointer — does not apply when it cannot scroll.
47
+ useIsomorphicLayoutEffect(measure);
48
+ useEffect(() => {
49
+ const element = scrollRef.current;
50
+ if (!element)
51
+ return;
52
+ if (typeof ResizeObserver === 'undefined') {
53
+ // No ResizeObserver: the window is the only resize signal available, which catches the common
54
+ // case and misses a container that resizes on its own.
55
+ window.addEventListener('resize', measure);
56
+ return () => {
57
+ window.removeEventListener('resize', measure);
58
+ };
59
+ }
60
+ const observer = new ResizeObserver(measure);
61
+ observer.observe(element);
62
+ for (const child of Array.from(element.children))
63
+ observer.observe(child);
64
+ return () => {
65
+ observer.disconnect();
66
+ };
67
+ }, [measure]);
68
+ const regionLabel = scrollRegionLabel ?? (typeof caption === 'string' ? caption : undefined) ?? undefined;
69
+ if (isDevelopment && overflowing && regionLabel === undefined) {
70
+ console.warn('Table: the table overflows its container, so its scroll region is focusable — but it has no ' +
71
+ 'accessible name. Pass `scrollRegionLabel`, or a string `caption`. A focusable region with ' +
72
+ 'no name announces nothing.');
73
+ }
74
+ return (_jsxs("div", { className: "lutra-table-wrapper", children: [_jsx("div", { className: "lutra-table__status", role: "status", children: status }), _jsx("div", { ref: scrollRef, className: "lutra-table__scroll", "data-overflowing": overflowing ? 'true' : 'false', ...(overflowing
75
+ ? {
76
+ role: 'region',
77
+ tabIndex: 0,
78
+ ...(regionLabel === undefined ? {} : { 'aria-label': regionLabel }),
79
+ }
80
+ : {}), children: _jsxs("table", { ...nativeProps, ...(labelledBy === undefined ? {} : { 'aria-labelledby': labelledBy }), className: className === undefined ? 'lutra-table' : `lutra-table ${className}`, children: [caption !== undefined && _jsx("caption", { className: "lutra-table__caption", children: caption }), children] }) })] }));
81
+ }
82
+ /**
83
+ * One row. Renders a native `<tr>`.
84
+ *
85
+ * It exists because the row carries styling — the divider, the hover tint and the selected tint —
86
+ * and the library's stylesheet rules forbid reaching for a bare element selector to apply it. It adds
87
+ * nothing to the semantics a `<tr>` already has.
88
+ *
89
+ * **The row itself stays inert.** There is no row-level click handler and no row-level selection:
90
+ * clicking the row background does nothing, because a row that responds to clicks competes with the
91
+ * controls inside it and is invisible to the keyboard.
92
+ */
93
+ export function TableRow({ selected = false, children, className, ...nativeProps }) {
94
+ return (_jsx("tr", { ...nativeProps, className: className === undefined ? 'lutra-table-row' : `lutra-table-row ${className}`, ...(selected ? { 'data-selected': 'true' } : {}), children: children }));
95
+ }
96
+ function SortIcon({ state }) {
97
+ // A distinct glyph per state, so direction never depends on colour or on remembering which way the
98
+ // arrow pointed last time.
99
+ return (_jsxs("svg", { className: "lutra-table-header-cell__sort-icon", viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: "2", "aria-hidden": "true", focusable: "false", "data-state": state, children: [state === 'unsorted' && (_jsxs(_Fragment, { children: [_jsx("path", { d: "M5 6.5L8 3.5l3 3", strokeLinecap: "round", strokeLinejoin: "round" }), _jsx("path", { d: "M5 9.5l3 3 3-3", strokeLinecap: "round", strokeLinejoin: "round" })] })), state === 'ascending' && (_jsx("path", { d: "M4 10l4-4 4 4", strokeLinecap: "round", strokeLinejoin: "round" })), state === 'descending' && (_jsx("path", { d: "M4 6l4 4 4-4", strokeLinecap: "round", strokeLinejoin: "round" }))] }));
100
+ }
101
+ /**
102
+ * A column header. Renders `<th scope="col">`.
103
+ *
104
+ * **A sortable header contains a button; the `th` is not itself clickable.** A clickable `th` is not
105
+ * an interactive element to anything but a mouse.
106
+ *
107
+ * `sort` drives the `aria-sort` attribute and the visible glyph together, from one value, so the two
108
+ * cannot drift apart — the pair is a single state, not two props to keep in step. `not-sortable`
109
+ * renders no button and no `aria-sort` at all.
110
+ *
111
+ * The button's accessible name says what activating it will do, including the column name:
112
+ * `"Applicant, sort ascending"`. A column heading is not automatically part of a button's name, so
113
+ * "sort" on its own would leave a screen-reader user with a list of identical buttons.
114
+ *
115
+ * Sort one column at a time. Multi-column sort needs a control outside the table.
116
+ */
117
+ export function TableHeaderCell(props) {
118
+ const { align = 'left', sort = 'not-sortable', className, children, ...forwarded } = props;
119
+ // `aria-sort` is dropped before anything is forwarded, and the type alone cannot do this job.
120
+ // TypeScript exempts **hyphenated** JSX attributes from excess-property checking, so
121
+ // `<TableHeaderCell aria-sort="…">` type-checks even though the props type omits it — the omission
122
+ // only bites when props are built as an object first. Since the attribute is derived from `sort`,
123
+ // a forwarded one would land on a plain header and contradict the glyph on a sorted one.
124
+ const { 'aria-sort': _consumerAriaSort, ...rest } = forwarded;
125
+ const shared = {
126
+ className: className === undefined ? 'lutra-table-header-cell' : `lutra-table-header-cell ${className}`,
127
+ 'data-align': align,
128
+ scope: 'col',
129
+ };
130
+ if (sort === 'not-sortable') {
131
+ const { onSort: _onSort, sortActionLabel: _sortActionLabel, ...nativeProps } = rest;
132
+ return (_jsx("th", { ...nativeProps, ...shared, "data-sort": "not-sortable", children: children }));
133
+ }
134
+ const { onSort, sortActionLabel, ...nativeProps } = rest;
135
+ const label = children;
136
+ return (_jsx("th", { ...nativeProps, ...shared, "data-sort": sort, "aria-sort": ARIA_SORT[sort], children: _jsxs("button", { type: "button", className: "lutra-table-header-cell__button", onClick: onSort, ...(sortActionLabel === undefined ? {} : { 'aria-label': sortActionLabel }), children: [_jsx("span", { className: "lutra-table-header-cell__label", children: label }), _jsx(SortIcon, { state: sort }), _jsx("span", { className: "lutra-table__visually-hidden", children: `, sort ${NEXT_DIRECTION[sort]}` })] }) }));
137
+ }
138
+ /**
139
+ * One value in a row. Renders a `<td>`, or a `<th scope="row">` when `emphasis="strong"`.
140
+ *
141
+ * `align="right"` sets the cell in tabular figures with `font-variant-numeric: tabular-nums`, so
142
+ * digits align column-wise. Figma cannot express the OpenType feature, so the design silently depends
143
+ * on this — which is why it is bound to the alignment rather than left to be remembered.
144
+ */
145
+ export function TableCell({ align = 'left', emphasis = 'default', children, className, ...nativeProps }) {
146
+ const shared = {
147
+ className: className === undefined ? 'lutra-table-cell' : `lutra-table-cell ${className}`,
148
+ 'data-align': align,
149
+ 'data-emphasis': emphasis,
150
+ };
151
+ if (emphasis === 'strong') {
152
+ return (_jsx("th", { ...nativeProps, ...shared, scope: "row", children: children }));
153
+ }
154
+ return (_jsx("td", { ...nativeProps, ...shared, children: children }));
155
+ }
156
+ /**
157
+ * The cell holding a row's selection checkbox, or the select-all in the header row.
158
+ *
159
+ * Add selection only when the table has a bulk action to apply to it.
160
+ *
161
+ * The checkbox communicates selection; the row tint on `TableRow` is supplemental and must never be
162
+ * the only cue. The label is visually hidden rather than absent, and native — a `<label>` wrapping
163
+ * the control, not an `aria-label` — because the column has no visible header text to borrow.
164
+ */
165
+ export function TableSelectionCell({ label, checked, indeterminate = false, onChange, disabled = false, header = false, className, ...nativeProps }) {
166
+ const shared = {
167
+ className: className === undefined
168
+ ? 'lutra-table-selection-cell'
169
+ : `lutra-table-selection-cell ${className}`,
170
+ };
171
+ const control = (_jsxs("label", { className: "lutra-table-selection-cell__label", children: [_jsx(Checkbox, { checked: checked, indeterminate: indeterminate, disabled: disabled, onChange: onChange }), _jsx("span", { className: "lutra-table__visually-hidden", children: label })] }));
172
+ if (header) {
173
+ return (_jsx("th", { ...nativeProps, ...shared, scope: "col", children: control }));
174
+ }
175
+ return (_jsx("td", { ...nativeProps, ...shared, children: control }));
176
+ }
177
+ /**
178
+ * The last cell in a row, holding that row's actions. Renders a `<td>`.
179
+ *
180
+ * **The controls stay visually compact, and their pointer targets do not.** Each control gets an
181
+ * invisible 44 × 44px target that expands into the cell's padding rather than adding to the row
182
+ * height, so a dense table keeps its 52px rows while every target still meets the minimum.
183
+ *
184
+ * **Never reveal row actions on hover only.** Keyboard and touch users have no hover, so a
185
+ * hover-revealed action does not exist for them.
186
+ */
187
+ export function TableRowActions({ children, className, ...nativeProps }) {
188
+ return (_jsx("td", { ...nativeProps, className: className === undefined ? 'lutra-table-row-actions' : `lutra-table-row-actions ${className}`, children: _jsx("div", { className: "lutra-table-row-actions__row", children: children }) }));
189
+ }
190
+ function ListIcon() {
191
+ return (_jsxs("svg", { className: "lutra-table-empty-state__icon", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", "aria-hidden": "true", focusable: "false", children: [_jsx("path", { d: "M9 6h11M9 12h11M9 18h11", strokeLinecap: "round" }), _jsx("path", { d: "M4 6h.01M4 12h.01M4 18h.01", strokeLinecap: "round" })] }));
192
+ }
193
+ /**
194
+ * The message shown when a table has no rows. Renders a `<tr>` holding one `<td>` that spans every
195
+ * column, and belongs inside the `tbody`.
196
+ *
197
+ * **The table, the `thead` and the column headers stay on the page.** That structure is what someone
198
+ * has already learned by exploring it; removing it makes an empty result feel like a broken page and
199
+ * discards the work they have done.
200
+ *
201
+ * When a filter is what emptied the table, announce the new result count too — `Table`'s `status`
202
+ * prop is the polite live region for it. The visual change alone is silent.
203
+ */
204
+ export function TableEmptyState({ colSpan, title, children, action, className, }) {
205
+ return (_jsx("tr", { className: "lutra-table-empty-state", children: _jsx("td", { className: className === undefined
206
+ ? 'lutra-table-empty-state__cell'
207
+ : `lutra-table-empty-state__cell ${className}`, colSpan: colSpan, children: _jsxs("div", { className: "lutra-table-empty-state__content", children: [_jsx(ListIcon, {}), _jsx("p", { className: "lutra-table-empty-state__title", children: title }), children !== undefined && children !== null && children !== false && (_jsx("p", { className: "lutra-table-empty-state__body", children: children })), action !== undefined && action !== null && action !== false && (_jsx("div", { className: "lutra-table-empty-state__action", children: action }))] }) }) }));
208
+ }
209
+ //# sourceMappingURL=table.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"table.js","sourceRoot":"","sources":["../../../src/components/table/table.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AASjE,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EAAE,yBAAyB,EAAE,MAAM,4CAA4C,CAAC;AACvF,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAkBhD,6EAA6E;AAC7E,MAAM,SAAS,GAAG;IAChB,QAAQ,EAAE,MAAM;IAChB,SAAS,EAAE,WAAW;IACtB,UAAU,EAAE,YAAY;CAChB,CAAC;AAEX,6FAA6F;AAC7F,MAAM,cAAc,GAAG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AO,CACL,aAAI,SAAS,EAAC,yBAAyB,YACrC,aACE,SAAS,EACP,SAAS,KAAK,SAAS;gBACrB,CAAC,CAAC,+BAA+B;gBACjC,CAAC,CAAC,iCAAiC,SAAS,EAAE,EAElD,OAAO,EAAE,OAAO,YAEhB,eAAK,SAAS,EAAC,kCAAkC,aAC/C,KAAC,QAAQ,KAAG,EACZ,YAAG,SAAS,EAAC,gCAAgC,YAAE,KAAK,GAAK,EACxD,QAAQ,KAAK,SAAS,IAAI,QAAQ,KAAK,IAAI,IAAI,QAAQ,KAAK,KAAK,IAAI,CACpE,YAAG,SAAS,EAAC,+BAA+B,YAAE,QAAQ,GAAK,CAC5D,EACA,MAAM,KAAK,SAAS,IAAI,MAAM,KAAK,IAAI,IAAI,MAAM,KAAK,KAAK,IAAI,CAC9D,cAAK,SAAS,EAAC,iCAAiC,YAAE,MAAM,GAAO,CAChE,IACG,GACH,GACF,CACN,CAAC;AACJ,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { Toggle, ToggleItem } from './toggle.js';
2
+ export type { ToggleProps, ToggleItemProps } from './toggle.js';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/toggle/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACjD,YAAY,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { Toggle, ToggleItem } from './toggle.js';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/toggle/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC"}
@@ -0,0 +1,66 @@
1
+ import type { InputHTMLAttributes, ReactNode } from 'react';
2
+ /** Native checkbox attributes, minus what this component owns. */
3
+ type NativeToggleProps = Omit<InputHTMLAttributes<HTMLInputElement>, 'type' | 'role' | 'children' | 'size'>;
4
+ export interface ToggleProps extends NativeToggleProps {
5
+ /**
6
+ * Draws the control in its error treatment.
7
+ *
8
+ * Visual only. A switch applies immediately, so there is nothing to validate on submit; the state
9
+ * exists for the rare case where a setting could not be applied and the surrounding field needs to
10
+ * say so.
11
+ *
12
+ * @default false
13
+ */
14
+ invalid?: boolean;
15
+ }
16
+ /**
17
+ * A switch for a setting that applies immediately.
18
+ *
19
+ * Renders `<input type="checkbox" role="switch">`. The element is a checkbox because that is the
20
+ * platform control with the right mechanics — Space toggles it, the label is a click target, it
21
+ * participates in a form, `checked` works controlled or uncontrolled. `role="switch"` is what
22
+ * changes how it is announced: "on" and "off" rather than "checked" and "not checked".
23
+ *
24
+ * **That distinction is the design contract, not a styling choice.** The accessibility annotation
25
+ * concluded this component represents an immediate binary setting rather than a checkbox submitted
26
+ * later with a form, so the semantics follow the behaviour and not the appearance. A checkbox drawn
27
+ * to look like a switch would announce the wrong thing; a switch used for something that is only
28
+ * saved on submit would promise the wrong thing.
29
+ *
30
+ * **Changes apply immediately.** If applying one can fail — a request that is rejected, a setting
31
+ * the server refuses — that failure has to be announced by whatever owns the request, because this
32
+ * component does not model it. There is no pending or error state here, and inventing one would be
33
+ * inventing a design decision the library has not made.
34
+ *
35
+ * **State is never conveyed by colour alone**: the thumb moves, and `role="switch"` puts on/off in
36
+ * the accessibility tree.
37
+ *
38
+ * **Every rendered Toggle must have an accessible name.** Use `ToggleItem` for the ordinary labelled
39
+ * composition.
40
+ */
41
+ export declare const Toggle: import("react").ForwardRefExoticComponent<ToggleProps & import("react").RefAttributes<HTMLInputElement>>;
42
+ export interface ToggleItemProps extends ToggleProps {
43
+ /**
44
+ * The visible label. It names **the setting**, not its current state — "Email notifications",
45
+ * never "Notifications are on". The state is already announced by the switch, and a label that
46
+ * moved with it would contradict itself as soon as it was toggled.
47
+ */
48
+ label: ReactNode;
49
+ /** Supporting text below the label, connected with `aria-describedby`. */
50
+ description?: ReactNode;
51
+ /** Extra class on the item wrapper, not on the control. */
52
+ className?: string;
53
+ }
54
+ /**
55
+ * A switch with its visible label, and optionally a description.
56
+ *
57
+ * The composition the Figma `Toggle Item` component draws: the label leads and the control sits at
58
+ * the end of the row, which is the opposite of Checkbox Item and Radio Item. That is a settings-list
59
+ * convention — the name of the setting reads first, and the switches line up down the right edge.
60
+ *
61
+ * The label comes before the control in the DOM as well as visually, so reading order, Tab order and
62
+ * visual order all agree.
63
+ */
64
+ export declare const ToggleItem: import("react").ForwardRefExoticComponent<ToggleItemProps & import("react").RefAttributes<HTMLInputElement>>;
65
+ export {};
66
+ //# sourceMappingURL=toggle.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toggle.d.ts","sourceRoot":"","sources":["../../../src/components/toggle/toggle.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAI5D,kEAAkE;AAClE,KAAK,iBAAiB,GAAG,IAAI,CAC3B,mBAAmB,CAAC,gBAAgB,CAAC,EACrC,MAAM,GAAG,MAAM,GAAG,UAAU,GAAG,MAAM,CACtC,CAAC;AAEF,MAAM,WAAW,WAAY,SAAQ,iBAAiB;IACpD;;;;;;;;OAQG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,eAAO,MAAM,MAAM,0GAgBjB,CAAC;AAEH,MAAM,WAAW,eAAgB,SAAQ,WAAW;IAClD;;;;OAIG;IACH,KAAK,EAAE,SAAS,CAAC;IACjB,0EAA0E;IAC1E,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,2DAA2D;IAC3D,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,UAAU,8GA2CrB,CAAC"}
@@ -0,0 +1,49 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { forwardRef } from 'react';
3
+ import { useFieldIds } from '../../internal/field-support.js';
4
+ /**
5
+ * A switch for a setting that applies immediately.
6
+ *
7
+ * Renders `<input type="checkbox" role="switch">`. The element is a checkbox because that is the
8
+ * platform control with the right mechanics — Space toggles it, the label is a click target, it
9
+ * participates in a form, `checked` works controlled or uncontrolled. `role="switch"` is what
10
+ * changes how it is announced: "on" and "off" rather than "checked" and "not checked".
11
+ *
12
+ * **That distinction is the design contract, not a styling choice.** The accessibility annotation
13
+ * concluded this component represents an immediate binary setting rather than a checkbox submitted
14
+ * later with a form, so the semantics follow the behaviour and not the appearance. A checkbox drawn
15
+ * to look like a switch would announce the wrong thing; a switch used for something that is only
16
+ * saved on submit would promise the wrong thing.
17
+ *
18
+ * **Changes apply immediately.** If applying one can fail — a request that is rejected, a setting
19
+ * the server refuses — that failure has to be announced by whatever owns the request, because this
20
+ * component does not model it. There is no pending or error state here, and inventing one would be
21
+ * inventing a design decision the library has not made.
22
+ *
23
+ * **State is never conveyed by colour alone**: the thumb moves, and `role="switch"` puts on/off in
24
+ * the accessibility tree.
25
+ *
26
+ * **Every rendered Toggle must have an accessible name.** Use `ToggleItem` for the ordinary labelled
27
+ * composition.
28
+ */
29
+ export const Toggle = forwardRef(function Toggle({ invalid = false, className, ...nativeProps }, ref) {
30
+ return (_jsx("input", { ...nativeProps, ref: ref, type: "checkbox", role: "switch", className: className === undefined ? 'lutra-toggle' : `lutra-toggle ${className}`, "data-invalid": invalid ? 'true' : undefined }));
31
+ });
32
+ /**
33
+ * A switch with its visible label, and optionally a description.
34
+ *
35
+ * The composition the Figma `Toggle Item` component draws: the label leads and the control sits at
36
+ * the end of the row, which is the opposite of Checkbox Item and Radio Item. That is a settings-list
37
+ * convention — the name of the setting reads first, and the switches line up down the right edge.
38
+ *
39
+ * The label comes before the control in the DOM as well as visually, so reading order, Tab order and
40
+ * visual order all agree.
41
+ */
42
+ export const ToggleItem = forwardRef(function ToggleItem({ label, description, className, id, disabled = false, 'aria-describedby': describedBy, ...toggleProps }, ref) {
43
+ const hasDescription = description !== undefined && description !== null && description !== false;
44
+ const ids = useFieldIds({ id, hasHint: hasDescription, hasError: false, describedBy });
45
+ return (_jsxs("div", { className: className === undefined
46
+ ? 'lutra-choice lutra-choice--trailing'
47
+ : `lutra-choice lutra-choice--trailing ${className}`, "data-disabled": disabled ? 'true' : undefined, children: [_jsxs("div", { className: "lutra-choice__content", children: [_jsx("label", { className: "lutra-choice__label", htmlFor: ids.controlId, children: label }), hasDescription && (_jsx("p", { className: "lutra-choice__description", id: ids.hintId, children: description }))] }), _jsx(Toggle, { ...toggleProps, ref: ref, id: ids.controlId, disabled: disabled, "aria-describedby": ids.describedBy })] }));
48
+ });
49
+ //# sourceMappingURL=toggle.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toggle.js","sourceRoot":"","sources":["../../../src/components/toggle/toggle.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAGnC,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAqB9D;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,UAAU,CAAgC,SAAS,MAAM,CAC7E,EAAE,OAAO,GAAG,KAAK,EAAE,SAAS,EAAE,GAAG,WAAW,EAAE,EAC9C,GAAG;IAEH,OAAO,CACL,mBACM,WAAW,EACf,GAAG,EAAE,GAAG,EACR,IAAI,EAAC,UAAU,EACf,IAAI,EAAC,QAAQ,EACb,SAAS,EAAE,SAAS,KAAK,SAAS,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,gBAAgB,SAAS,EAAE,kBAGnE,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,GAC1C,CACH,CAAC;AACJ,CAAC,CAAC,CAAC;AAeH;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,UAAU,CAAoC,SAAS,UAAU,CACzF,EACE,KAAK,EACL,WAAW,EACX,SAAS,EACT,EAAE,EACF,QAAQ,GAAG,KAAK,EAChB,kBAAkB,EAAE,WAAW,EAC/B,GAAG,WAAW,EACf,EACD,GAAG;IAEH,MAAM,cAAc,GAAG,WAAW,KAAK,SAAS,IAAI,WAAW,KAAK,IAAI,IAAI,WAAW,KAAK,KAAK,CAAC;IAClG,MAAM,GAAG,GAAG,WAAW,CAAC,EAAE,EAAE,EAAE,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,KAAK,EAAE,WAAW,EAAE,CAAC,CAAC;IAEvF,OAAO,CACL,eACE,SAAS,EACP,SAAS,KAAK,SAAS;YACrB,CAAC,CAAC,qCAAqC;YACvC,CAAC,CAAC,uCAAuC,SAAS,EAAE,mBAEzC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,aAE5C,eAAK,SAAS,EAAC,uBAAuB,aACpC,gBAAO,SAAS,EAAC,qBAAqB,EAAC,OAAO,EAAE,GAAG,CAAC,SAAS,YAC1D,KAAK,GACA,EACP,cAAc,IAAI,CACjB,YAAG,SAAS,EAAC,2BAA2B,EAAC,EAAE,EAAE,GAAG,CAAC,MAAM,YACpD,WAAW,GACV,CACL,IACG,EACN,KAAC,MAAM,OACD,WAAW,EACf,GAAG,EAAE,GAAG,EACR,EAAE,EAAE,GAAG,CAAC,SAAS,EACjB,QAAQ,EAAE,QAAQ,sBACA,GAAG,CAAC,WAAW,GACjC,IACE,CACP,CAAC;AACJ,CAAC,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { Tooltip } from './tooltip.js';
2
+ export type { TooltipProps, TooltipPlacement, TooltipAlign } from './tooltip.js';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/tooltip/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,YAAY,EAAE,YAAY,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC"}