@kanso-labs/kanso-ui 0.35.0 → 0.37.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 (220) hide show
  1. package/README.md +90 -9
  2. package/dist/button/context.js +7 -0
  3. package/dist/button/context.js.map +1 -0
  4. package/dist/button/group.js +25 -0
  5. package/dist/button/group.js.map +1 -0
  6. package/dist/button/hooks.js +81 -0
  7. package/dist/button/hooks.js.map +1 -0
  8. package/dist/button/index.d.ts +11 -0
  9. package/dist/button/index.js +273 -0
  10. package/dist/button/index.js.map +1 -0
  11. package/dist/button/styles.js +23 -0
  12. package/dist/button/styles.js.map +1 -0
  13. package/dist/calendar/index.js +473 -7
  14. package/dist/calendar/index.js.map +1 -1
  15. package/dist/calendar/styles.js +132 -4
  16. package/dist/calendar/styles.js.map +1 -1
  17. package/dist/chip/index.js +74 -9
  18. package/dist/chip/index.js.map +1 -1
  19. package/dist/chip/styles.js +78 -4
  20. package/dist/chip/styles.js.map +1 -1
  21. package/dist/collection/index.js +12 -9
  22. package/dist/collection/index.js.map +1 -1
  23. package/dist/collection/styles.js +21 -2
  24. package/dist/collection/styles.js.map +1 -1
  25. package/dist/color-scheme.d.ts +29 -0
  26. package/dist/color-scheme.js +32 -0
  27. package/dist/color-scheme.js.map +1 -0
  28. package/dist/components/avatar/index.js +35 -22
  29. package/dist/components/avatar/index.js.map +1 -1
  30. package/dist/components/badge/index.d.ts +40 -0
  31. package/dist/components/badge/index.js +102 -0
  32. package/dist/components/badge/index.js.map +1 -0
  33. package/dist/components/breadcrumbs/index.d.ts +1 -1
  34. package/dist/components/breadcrumbs/index.js +1 -1
  35. package/dist/components/breadcrumbs/index.js.map +1 -1
  36. package/dist/components/button/index.d.ts +58 -14
  37. package/dist/components/button/index.js +400 -147
  38. package/dist/components/button/index.js.map +1 -1
  39. package/dist/components/button-group/index.d.ts +54 -0
  40. package/dist/components/button-group/index.js +272 -0
  41. package/dist/components/button-group/index.js.map +1 -0
  42. package/dist/components/calendar/index.d.ts +9 -1
  43. package/dist/components/calendar/index.js +71 -44
  44. package/dist/components/calendar/index.js.map +1 -1
  45. package/dist/components/card/index.d.ts +1 -1
  46. package/dist/components/card/index.js +4 -4
  47. package/dist/components/card/index.js.map +1 -1
  48. package/dist/components/checkbox/index.js +15 -1
  49. package/dist/components/checkbox/index.js.map +1 -1
  50. package/dist/components/checkbox-group/index.js +1 -0
  51. package/dist/components/checkbox-group/index.js.map +1 -1
  52. package/dist/components/chip/index.d.ts +55 -8
  53. package/dist/components/chip/index.js +174 -63
  54. package/dist/components/chip/index.js.map +1 -1
  55. package/dist/components/chip-group/index.d.ts +16 -7
  56. package/dist/components/chip-group/index.js +58 -35
  57. package/dist/components/chip-group/index.js.map +1 -1
  58. package/dist/components/color-field/index.js +25 -23
  59. package/dist/components/color-field/index.js.map +1 -1
  60. package/dist/components/color-picker/index.js +42 -31
  61. package/dist/components/color-picker/index.js.map +1 -1
  62. package/dist/components/color-swatch-picker/index.d.ts +1 -1
  63. package/dist/components/color-swatch-picker/index.js +17 -13
  64. package/dist/components/color-swatch-picker/index.js.map +1 -1
  65. package/dist/components/combo-box/index.d.ts +5 -3
  66. package/dist/components/combo-box/index.js +63 -58
  67. package/dist/components/combo-box/index.js.map +1 -1
  68. package/dist/components/copy-field/index.d.ts +7 -6
  69. package/dist/components/copy-field/index.js +92 -90
  70. package/dist/components/copy-field/index.js.map +1 -1
  71. package/dist/components/currency/index.d.ts +8 -7
  72. package/dist/components/currency/index.js +43 -65
  73. package/dist/components/currency/index.js.map +1 -1
  74. package/dist/components/date-field/index.js +24 -22
  75. package/dist/components/date-field/index.js.map +1 -1
  76. package/dist/components/date-picker/index.d.ts +10 -2
  77. package/dist/components/date-picker/index.js +76 -69
  78. package/dist/components/date-picker/index.js.map +1 -1
  79. package/dist/components/date-range-picker/index.d.ts +10 -2
  80. package/dist/components/date-range-picker/index.js +93 -86
  81. package/dist/components/date-range-picker/index.js.map +1 -1
  82. package/dist/components/dialog/index.d.ts +1 -1
  83. package/dist/components/dialog/index.js +2 -2
  84. package/dist/components/dialog/index.js.map +1 -1
  85. package/dist/components/disclosure/index.d.ts +1 -1
  86. package/dist/components/disclosure/index.js +6 -6
  87. package/dist/components/disclosure/index.js.map +1 -1
  88. package/dist/components/fab/index.d.ts +72 -0
  89. package/dist/components/fab/index.js +89 -0
  90. package/dist/components/fab/index.js.map +1 -0
  91. package/dist/components/fab-menu/index.d.ts +90 -0
  92. package/dist/components/fab-menu/index.js +297 -0
  93. package/dist/components/fab-menu/index.js.map +1 -0
  94. package/dist/components/feed/index.d.ts +2 -1
  95. package/dist/components/feed/index.js +1 -1
  96. package/dist/components/feed/index.js.map +1 -1
  97. package/dist/components/icon-button/index.d.ts +11 -8
  98. package/dist/components/icon-button/index.js +244 -181
  99. package/dist/components/icon-button/index.js.map +1 -1
  100. package/dist/components/index.d.ts +30 -21
  101. package/dist/components/list/index.d.ts +15 -13
  102. package/dist/components/list/index.js +60 -61
  103. package/dist/components/list/index.js.map +1 -1
  104. package/dist/components/list-box/index.d.ts +3 -2
  105. package/dist/components/list-box/index.js +16 -16
  106. package/dist/components/list-box/index.js.map +1 -1
  107. package/dist/components/list-item/index.js +1 -1
  108. package/dist/components/list-item/index.js.map +1 -1
  109. package/dist/components/menu/index.d.ts +3 -2
  110. package/dist/components/menu/index.js +2 -2
  111. package/dist/components/menu/index.js.map +1 -1
  112. package/dist/components/navigation-bar/index.d.ts +50 -0
  113. package/dist/components/navigation-bar/index.js +129 -0
  114. package/dist/components/navigation-bar/index.js.map +1 -0
  115. package/dist/components/navigation-rail/index.d.ts +59 -0
  116. package/dist/components/navigation-rail/index.js +166 -0
  117. package/dist/components/navigation-rail/index.js.map +1 -0
  118. package/dist/components/navigation-tree/index.d.ts +1 -5
  119. package/dist/components/navigation-tree/index.js +3 -3
  120. package/dist/components/navigation-tree/index.js.map +1 -1
  121. package/dist/components/number-field/index.d.ts +6 -4
  122. package/dist/components/number-field/index.js +84 -84
  123. package/dist/components/number-field/index.js.map +1 -1
  124. package/dist/components/popover/index.d.ts +1 -1
  125. package/dist/components/popover/index.js +1 -1
  126. package/dist/components/popover/index.js.map +1 -1
  127. package/dist/components/radio-group/index.js +22 -11
  128. package/dist/components/radio-group/index.js.map +1 -1
  129. package/dist/components/range-calendar/index.d.ts +7 -1
  130. package/dist/components/range-calendar/index.js +71 -44
  131. package/dist/components/range-calendar/index.js.map +1 -1
  132. package/dist/components/search-field/index.d.ts +2 -1
  133. package/dist/components/search-field/index.js +24 -25
  134. package/dist/components/search-field/index.js.map +1 -1
  135. package/dist/components/search-view/index.d.ts +79 -0
  136. package/dist/components/search-view/index.js +255 -0
  137. package/dist/components/search-view/index.js.map +1 -0
  138. package/dist/components/segmented-button/index.d.ts +2 -2
  139. package/dist/components/segmented-button/index.js +60 -31
  140. package/dist/components/segmented-button/index.js.map +1 -1
  141. package/dist/components/select/index.js +1 -0
  142. package/dist/components/select/index.js.map +1 -1
  143. package/dist/components/sheet/index.d.ts +1 -1
  144. package/dist/components/sheet/index.js +2 -2
  145. package/dist/components/sheet/index.js.map +1 -1
  146. package/dist/components/slider/index.js +1 -1
  147. package/dist/components/slider/index.js.map +1 -1
  148. package/dist/components/snackbar/index.d.ts +2 -2
  149. package/dist/components/snackbar/index.js +28 -13
  150. package/dist/components/snackbar/index.js.map +1 -1
  151. package/dist/components/split-button/index.d.ts +83 -0
  152. package/dist/components/split-button/index.js +341 -0
  153. package/dist/components/split-button/index.js.map +1 -0
  154. package/dist/components/switch/index.js +11 -1
  155. package/dist/components/switch/index.js.map +1 -1
  156. package/dist/components/table/index.d.ts +11 -9
  157. package/dist/components/table/index.js +87 -31
  158. package/dist/components/table/index.js.map +1 -1
  159. package/dist/components/tabs/index.d.ts +35 -4
  160. package/dist/components/tabs/index.js +403 -93
  161. package/dist/components/tabs/index.js.map +1 -1
  162. package/dist/components/tag/index.d.ts +1 -1
  163. package/dist/components/tag/index.js.map +1 -1
  164. package/dist/components/text-area/index.d.ts +7 -5
  165. package/dist/components/text-area/index.js +28 -26
  166. package/dist/components/text-area/index.js.map +1 -1
  167. package/dist/components/text-field/index.d.ts +7 -5
  168. package/dist/components/text-field/index.js +28 -26
  169. package/dist/components/text-field/index.js.map +1 -1
  170. package/dist/components/time-field/index.js +24 -22
  171. package/dist/components/time-field/index.js.map +1 -1
  172. package/dist/components/tree/index.d.ts +7 -9
  173. package/dist/components/tree/index.js +15 -16
  174. package/dist/components/tree/index.js.map +1 -1
  175. package/dist/drag/index.js.map +1 -1
  176. package/dist/drag/styles.js +4 -1
  177. package/dist/drag/styles.js.map +1 -1
  178. package/dist/fab/styles.js +161 -0
  179. package/dist/fab/styles.js.map +1 -0
  180. package/dist/field/index.js +260 -214
  181. package/dist/field/index.js.map +1 -1
  182. package/dist/field/styles.js +10 -2
  183. package/dist/field/styles.js.map +1 -1
  184. package/dist/glyphs/index.js +55 -1
  185. package/dist/glyphs/index.js.map +1 -1
  186. package/dist/hooks/useRipple.js +199 -162
  187. package/dist/hooks/useRipple.js.map +1 -1
  188. package/dist/hooks/useToggleGroupDisabled.js +24 -0
  189. package/dist/hooks/useToggleGroupDisabled.js.map +1 -0
  190. package/dist/i18n/index.js +43 -0
  191. package/dist/i18n/index.js.map +1 -0
  192. package/dist/i18n/messages.js +387 -0
  193. package/dist/i18n/messages.js.map +1 -0
  194. package/dist/index.d.ts +31 -21
  195. package/dist/index.js +25 -16
  196. package/dist/navigation/context.js +7 -0
  197. package/dist/navigation/context.js.map +1 -0
  198. package/dist/navigation/index.d.ts +28 -0
  199. package/dist/navigation/index.js +96 -0
  200. package/dist/navigation/index.js.map +1 -0
  201. package/dist/navigation/styles.js +312 -0
  202. package/dist/navigation/styles.js.map +1 -0
  203. package/dist/react-aria.d.ts +2 -2
  204. package/dist/react-aria.js +2 -2
  205. package/dist/render/useRender.js +0 -1
  206. package/dist/render/useRender.js.map +1 -1
  207. package/dist/row/styles.js +33 -11
  208. package/dist/row/styles.js.map +1 -1
  209. package/dist/styles/focus.js.map +1 -1
  210. package/dist/styles/icon-button.js +9 -1
  211. package/dist/styles/icon-button.js.map +1 -1
  212. package/dist/styles/overlay.js +1 -0
  213. package/dist/styles/overlay.js.map +1 -1
  214. package/dist/styles/picker.js +1 -1
  215. package/dist/styles/picker.js.map +1 -1
  216. package/dist/styles.css +1104 -336
  217. package/dist/tokens/design.tokens.stylex.js +42 -1
  218. package/dist/tokens/design.tokens.stylex.js.map +1 -1
  219. package/dist/tokens.css +166 -53
  220. package/package.json +9 -5
@@ -55,11 +55,12 @@ type TableLoadMoreProps = Omit<TableLoadMoreItemProps, 'children'> & {
55
55
  /**
56
56
  * What the row says while it is loading. Read by a screen reader; the ring
57
57
  * itself carries no text.
58
- * @default 'Loading more'
58
+ * Left out, it is the word for it in the I18nProvider's locale — "Loading
59
+ * more" in English.
59
60
  */
60
61
  label?: string;
61
62
  };
62
- type TableProps$1 = Omit<TableProps, 'className' | 'style'> & {
63
+ type TableProps$1 = {
63
64
  /** A function may compute the class from the table's render state. */
64
65
  className?: TableProps['className'];
65
66
  /** Called as a column is dragged, with every column's width. */
@@ -75,19 +76,20 @@ type TableProps$1 = Omit<TableProps, 'className' | 'style'> & {
75
76
  resizable?: boolean;
76
77
  /**
77
78
  * What the resize handle is called, for a screen reader. React Aria
78
- * composes it with the column's own name.
79
- * @default 'Resize column'
79
+ * composes it with the column's own name. Left out, React Aria names it in
80
+ * the reader's locale — "Resizer" in English.
80
81
  */
81
82
  resizeLabel?: string;
82
83
  /**
83
- * What the select-all checkbox is called, for a screen reader.
84
- * @default 'Select all'
84
+ * What the select-all checkbox is called, for a screen reader. Left out,
85
+ * React Aria names it in the reader's locale — "Select All" in English.
85
86
  */
86
87
  selectAllLabel?: string;
87
88
  /**
88
89
  * What each row's selection checkbox is called, for a screen reader. The
89
90
  * row's own text is what names the row; this names the box inside it.
90
- * @default 'Select'
91
+ * Left out, React Aria names it in the reader's locale — "Select" in
92
+ * English.
91
93
  */
92
94
  selectLabel?: string;
93
95
  /**
@@ -98,7 +100,7 @@ type TableProps$1 = Omit<TableProps, 'className' | 'style'> & {
98
100
  stickyHeader?: boolean;
99
101
  /** A function may compute the style from the table's render state. */
100
102
  style?: TableProps['style'];
101
- };
103
+ } & Omit<TableProps, 'className' | 'style'>;
102
104
  type TableRowProps<T extends object = object> = Omit<RowProps<T>, 'className' | 'style'> & {
103
105
  /** A function may compute the class from the row's render state. */
104
106
  className?: RowProps<T>['className'];
@@ -195,5 +197,5 @@ declare function TableLoadMore({ label, ...props }: TableLoadMoreProps): import(
195
197
  */
196
198
  declare function TableRow<T extends object = object>(props: TableRowProps<T>): import("react").JSX.Element;
197
199
  //#endregion
198
- export { type TableBodyProps$1 as TableBodyProps, type TableCellProps, type TableColumnProps, type TableFooterProps$1 as TableFooterProps, type TableHeaderProps$1 as TableHeaderProps, type TableLoadMoreProps, type TableProps$1 as TableProps, type TableRowProps, Table$1 as default };
200
+ export { TableBody$1 as TableBody, type TableBodyProps$1 as TableBodyProps, TableCell, type TableCellProps, TableColumn, type TableColumnProps, TableFooter$1 as TableFooter, type TableFooterProps$1 as TableFooterProps, TableHeader$1 as TableHeader, type TableHeaderProps$1 as TableHeaderProps, TableLoadMore, type TableLoadMoreProps, type TableProps$1 as TableProps, TableRow, type TableRowProps, Table$1 as default };
199
201
  //# sourceMappingURL=index.d.ts.map
@@ -5,21 +5,54 @@ import { ArrowDownwardGlyph, ArrowUpwardGlyph } from "../../glyphs/index.js";
5
5
  import Checkbox from "../checkbox/index.js";
6
6
  import { CollectionLoadMore } from "../../collection/index.js";
7
7
  import { rowStyles as rowStyles$1 } from "../../row/styles.js";
8
+ import { collectionStyles } from "../../collection/styles.js";
8
9
  import { c } from "react/compiler-runtime";
9
10
  import { createContext, useContext } from "react";
10
11
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
11
12
  import { Cell, Column, ColumnResizer, ResizableTableContainer, Row, Table, TableBody, TableFooter, TableHeader, TableLoadMoreItem } from "react-aria-components";
12
13
  //#region src/components/table/index.tsx
13
- const SelectAllLabelContext = createContext("Select all");
14
- const SelectLabelContext = createContext("Select");
14
+ const SelectAllLabelContext = createContext(void 0);
15
+ const SelectLabelContext = createContext(void 0);
15
16
  const styles = {
17
+ cell: {
18
+ kB7OPa: "x9f619",
19
+ kg3NbH: "x790zyz",
20
+ k9WMMc: "x1yc453h",
21
+ kXLuUW: "xxymvpz",
22
+ $$css: true
23
+ },
16
24
  focus: {
17
- kjBf7l: "xrgy624",
25
+ kjBf7l: "xrgy624 x1v8yhc2",
18
26
  kInvED: "x2ssjo2",
19
27
  k3XXqK: "x9v5kkp x1t137rt",
20
28
  kMeerF: "x1de99jn",
21
29
  $$css: true
22
30
  },
31
+ header: {
32
+ kZKoxP: "x1ded5cy",
33
+ kMwMTN: "x1w5n3ug",
34
+ kMv6JI: "xkknnkr",
35
+ kGuDYH: "x14zspaw",
36
+ k63SB2: "x1v9cpvo",
37
+ kb6lSQ: "x155f00i",
38
+ kLWn49: "x1lz68p4",
39
+ kVQacm: "x9h1dke",
40
+ kVAEAm: "x1n2onr6",
41
+ $$css: true
42
+ },
43
+ headerHovered: {
44
+ kWkggS: "x1b18xnh",
45
+ $$css: true
46
+ },
47
+ headerPressed: {
48
+ kWkggS: "xjeeohs",
49
+ $$css: true
50
+ },
51
+ headerSortable: {
52
+ kWkggS: "xjbqb8w",
53
+ kkrTdU: "x1ypdohk",
54
+ $$css: true
55
+ },
23
56
  row: {
24
57
  kZKoxP: "xdd8jsf",
25
58
  kLZC3w: "x12smttz",
@@ -31,15 +64,43 @@ const styles = {
31
64
  kWkggS: "xjbqb8w",
32
65
  kMwMTN: "x1xj74d8",
33
66
  kkrTdU: "x1h6gzvc",
67
+ kAXs8y: "xr5dkdi",
34
68
  $$css: true
35
69
  },
36
70
  rowSelected: {
37
- kWkggS: "xp89om9",
38
- kMwMTN: "xscdzaa",
71
+ kWkggS: "xp89om9 x1jzqe4",
72
+ kMwMTN: "xscdzaa x1k5gbb1",
73
+ kAXs8y: "x1g12otp",
74
+ $$css: true
75
+ },
76
+ selection: {
77
+ kzqmXN: "x19ddzpn",
78
+ khDVqt: "xuxw1ft",
79
+ $$css: true
80
+ },
81
+ sticky: {
82
+ kWkggS: "x14s9m32",
83
+ kGVxlE: "x1ixd52e",
84
+ k87sOh: "x13vifvy",
85
+ kVAEAm: "x7wzq59",
86
+ kY2c9j: "x1vjfegm",
87
+ $$css: true
88
+ },
89
+ table: {
90
+ kLvRdT: "x1mwwwfo",
91
+ kB7OPa: "x9f619",
92
+ kMwMTN: "x139gbkf",
93
+ kMv6JI: "xpo2rfv",
94
+ kGuDYH: "x193rfdd",
95
+ k63SB2: "x1hews6w",
96
+ kzqmXN: "xh8yej3",
97
+ kb6lSQ: "xn43zvd",
98
+ kLWn49: "xv61bfh",
99
+ k3XXqK: "x1t137rt",
39
100
  $$css: true
40
101
  }
41
102
  };
42
- const ResizeLabelContext = createContext("Resize column");
103
+ const ResizeLabelContext = createContext(void 0);
43
104
  const ResizableContext = createContext(false);
44
105
  const StickyHeaderContext = createContext(false);
45
106
  function cellContent(children, selection, label) {
@@ -51,8 +112,8 @@ function cellContent(children, selection, label) {
51
112
  }
52
113
  function cellStyles(selection) {
53
114
  return {
54
- 0: { className: "x9f619 x790zyz x1yc453h xxymvpz xrgy624 x2ssjo2 x9v5kkp x1t137rt x1de99jn" },
55
- 1: { className: "x9f619 x790zyz x1yc453h xxymvpz xrgy624 x2ssjo2 x9v5kkp x1t137rt x1de99jn x19ddzpn xuxw1ft" }
115
+ 0: { className: "x9f619 x790zyz x1yc453h xxymvpz xrgy624 x1v8yhc2 x2ssjo2 x9v5kkp x1t137rt x1de99jn" },
116
+ 1: { className: "x9f619 x790zyz x1yc453h xxymvpz xrgy624 x1v8yhc2 x2ssjo2 x9v5kkp x1t137rt x1de99jn x19ddzpn xuxw1ft" }
56
117
  }[!!selection << 0];
57
118
  }
58
119
  function columnContent(children, selection, label, resizable, resizeLabel) {
@@ -65,20 +126,12 @@ function columnContent(children, selection, label, resizable, resizeLabel) {
65
126
  children: [children, sortArrowFor(state.sortDirection)]
66
127
  }), resizable ? /* @__PURE__ */ jsx(ColumnResizer, {
67
128
  "aria-label": resizeLabel,
68
- className: resizerClassName
129
+ className: "x5yr21d x9f619 xicojor xvy4d1p x13vifvy x18zu7yx x10l6tqk x5ve5x3 x1vjfegm",
130
+ children: resizerRule
69
131
  }) : null] });
70
132
  }
71
133
  function columnStyles(selection, sticky) {
72
- return (state) => ({
73
- 0: { className: "x9f619 x790zyz x1yc453h xxymvpz x1ded5cy x1w5n3ug xkknnkr x14zspaw x1v9cpvo x155f00i x1lz68p4 x1n2onr6 xrgy624 x2ssjo2 x9v5kkp x1t137rt x1de99jn" },
74
- 4: { className: "x9f619 x790zyz x1yc453h xxymvpz x1ded5cy x1w5n3ug xkknnkr x14zspaw x1v9cpvo x155f00i x1lz68p4 xrgy624 x2ssjo2 x9v5kkp x1t137rt x1de99jn x14s9m32 x1ixd52e x13vifvy x7wzq59 x1vjfegm" },
75
- 2: { className: "x9f619 x790zyz x1yc453h xxymvpz x1ded5cy x1w5n3ug xkknnkr x14zspaw x1v9cpvo x155f00i x1lz68p4 x1n2onr6 xrgy624 x2ssjo2 x9v5kkp x1t137rt x1de99jn x19ddzpn xuxw1ft" },
76
- 6: { className: "x9f619 x790zyz x1yc453h xxymvpz x1ded5cy x1w5n3ug xkknnkr x14zspaw x1v9cpvo x155f00i x1lz68p4 xrgy624 x2ssjo2 x9v5kkp x1t137rt x1de99jn x14s9m32 x1ixd52e x13vifvy x7wzq59 x1vjfegm x19ddzpn xuxw1ft" },
77
- 1: { className: "x9f619 x790zyz x1yc453h xxymvpz x1ded5cy x1w5n3ug xkknnkr x14zspaw x1v9cpvo x155f00i x1lz68p4 x1n2onr6 xrgy624 x2ssjo2 x9v5kkp x1t137rt x1de99jn x83qkoq x1p2om7n xjbqb8w x1ypdohk" },
78
- 5: { className: "x9f619 x790zyz x1yc453h xxymvpz x1ded5cy x1w5n3ug xkknnkr x14zspaw x1v9cpvo x155f00i x1lz68p4 xrgy624 x2ssjo2 x9v5kkp x1t137rt x1de99jn x1ixd52e x13vifvy x7wzq59 x1vjfegm x83qkoq x1p2om7n xjbqb8w x1ypdohk" },
79
- 3: { className: "x9f619 x790zyz x1yc453h xxymvpz x1ded5cy x1w5n3ug xkknnkr x14zspaw x1v9cpvo x155f00i x1lz68p4 x1n2onr6 xrgy624 x2ssjo2 x9v5kkp x1t137rt x1de99jn x19ddzpn xuxw1ft x83qkoq x1p2om7n xjbqb8w x1ypdohk" },
80
- 7: { className: "x9f619 x790zyz x1yc453h xxymvpz x1ded5cy x1w5n3ug xkknnkr x14zspaw x1v9cpvo x155f00i x1lz68p4 xrgy624 x2ssjo2 x9v5kkp x1t137rt x1de99jn x1ixd52e x13vifvy x7wzq59 x1vjfegm x19ddzpn xuxw1ft x83qkoq x1p2om7n xjbqb8w x1ypdohk" }
81
- })[!!sticky << 2 | !!selection << 1 | !!state.allowsSorting << 0];
134
+ return (state) => props(styles.cell, styles.header, styles.focus, sticky && styles.sticky, selection && styles.selection, state.allowsSorting && styles.headerSortable, state.allowsSorting && state.isHovered && styles.headerHovered, state.allowsSorting && state.isPressed && styles.headerPressed);
82
135
  }
83
136
  function dropAriaLevel(node) {
84
137
  node?.removeAttribute("aria-level");
@@ -92,14 +145,14 @@ function emptyContent(renderEmptyState) {
92
145
  function resizableContainerClassName() {
93
146
  return { className: "x9f619 xh8yej3 xw2csxc" }.className ?? "";
94
147
  }
95
- function resizerClassName(state) {
96
- return {
97
- 0: { className: "x1l12bh x5yr21d x9f619 xicojor x1i1rx1s x13vifvy xtijo5x x10l6tqk x5ve5x3" },
98
- 1: { className: "x5yr21d x9f619 xicojor x13vifvy xtijo5x x10l6tqk x5ve5x3 xnety89 xfo62xy" }
99
- }[!!(state.isResizing || state.isFocusVisible) << 0].className ?? "";
148
+ function resizerRule(state) {
149
+ return /* @__PURE__ */ jsx("span", { ...{
150
+ 0: { className: "x1l12bh x5yr21d x1x0u81l xf1j0q2 xmzn1mo x9f619 x1g12otp x1i1rx1s x13vifvy x9q68il x47corl x10l6tqk" },
151
+ 1: { className: "x5yr21d xf1j0q2 x9f619 x1g12otp x13vifvy x9q68il x47corl x10l6tqk xnety89 x1ksdfms x12inkfj xfo62xy" }
152
+ }[!!(state.isResizing || state.isFocusVisible) << 0] });
100
153
  }
101
154
  function rowStyles(state) {
102
- return props(styles.row, styles.focus, state.isSelected && styles.rowSelected, state.isHovered && rowStyles$1.hovered, state.isPressed && rowStyles$1.pressed, state.isDisabled && styles.rowDisabled);
155
+ return props(styles.row, styles.focus, state.isDragging && rowStyles$1.dragging, state.isSelected && styles.rowSelected, state.isHovered && rowStyles$1.hovered, state.isPressed && rowStyles$1.pressed, state.isDropTarget && rowStyles$1.dropTarget, state.isDisabled && styles.rowDisabled);
103
156
  }
104
157
  function sortArrowFor(direction) {
105
158
  if (direction === void 0) return null;
@@ -151,14 +204,14 @@ function Table$1(t0) {
151
204
  const { onResize: t3, onResizeEnd: t4, resizable: t5, resizeLabel: t6, selectAllLabel: t7, selectLabel: t8, stickyHeader: t9, ...props } = t0;
152
205
  onResize = t3;
153
206
  onResizeEnd = t4;
207
+ resizeLabel = t6;
208
+ selectAllLabel = t7;
209
+ selectLabel = t8;
154
210
  resizable = t5 === void 0 ? false : t5;
155
- resizeLabel = t6 === void 0 ? "Resize column" : t6;
156
- selectAllLabel = t7 === void 0 ? "Select all" : t7;
157
- selectLabel = t8 === void 0 ? "Select" : t8;
158
211
  stickyHeader = t9 === void 0 ? false : t9;
159
212
  T0 = Table;
160
213
  t1 = props;
161
- t2 = mergeStatefulStyles({ className: "x1mwwwfo x9f619 x139gbkf xpo2rfv x193rfdd x1hews6w xh8yej3 xn43zvd xv61bfh x1t137rt" }, props);
214
+ t2 = mergeStatefulStyles(tableClasses, props);
162
215
  $[0] = t0;
163
216
  $[1] = T0;
164
217
  $[2] = onResize;
@@ -334,6 +387,9 @@ function TableCell(t0) {
334
387
  } else t4 = $[8];
335
388
  return t4;
336
389
  }
390
+ function tableClasses(state) {
391
+ return props(styles.table, state.isDropTarget && collectionStyles.dropTarget);
392
+ }
337
393
  /**
338
394
  * One column. `allowsSorting` is React Aria's and makes the header cell
339
395
  * itself the control that sorts; the arrow appears on the column the
@@ -448,7 +504,7 @@ function TableLoadMore(t0) {
448
504
  let t2;
449
505
  if ($[0] !== t0) {
450
506
  const { label: t3, ...props } = t0;
451
- label = t3 === void 0 ? "Loading more" : t3;
507
+ label = t3;
452
508
  T0 = TableLoadMoreItem;
453
509
  t1 = props;
454
510
  t2 = mergeStyles({ className: "xdd8jsf" }, props);
@@ -524,6 +580,6 @@ Table$1.Header = TableHeader$1;
524
580
  Table$1.LoadMore = TableLoadMore;
525
581
  Table$1.Row = TableRow;
526
582
  //#endregion
527
- export { Table$1 as default };
583
+ export { TableBody$1 as TableBody, TableCell, TableColumn, TableFooter$1 as TableFooter, TableHeader$1 as TableHeader, TableLoadMore, TableRow, Table$1 as default };
528
584
 
529
585
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["c","_c","ReactNode","RefAttributes","ColumnRenderProps","ColumnResizerRenderProps","CellProps","RACCellProps","ColumnProps","RACColumnProps","RowProps","RACRowProps","TableBodyProps","RACTableBodyProps","TableFooterProps","RACTableFooterProps","TableHeaderProps","RACTableHeaderProps","TableLoadMoreItemProps","RACTableLoadMoreItemProps","TableProps","RACTableProps","ResizableTableContainerProps","RowRenderProps","TableBodyRenderProps","stylex","createContext","useContext","Cell","RACCell","Column","RACColumn","ColumnResizer","RACColumnResizer","ResizableTableContainer","RACResizableTableContainer","Row","RACRow","Table","RACTable","TableBody","RACTableBody","TableFooter","RACTableFooter","TableHeader","RACTableHeader","TableLoadMoreItem","RACTableLoadMoreItem","CollectionLoadMore","ArrowDownwardGlyph","ArrowUpwardGlyph","rowStyles","rowLayers","mergeStatefulStyles","mergeStyles","colors","sizing","spacing","stateLayerOpacity","typography","Checkbox","SelectAllLabelContext","SelectLabelContext","styles","focus","kjBf7l","kInvED","k3XXqK","kMeerF","$$css","row","kZKoxP","kLZC3w","kPef9Z","kEafiO","rowDisabled","kWkggS","kMwMTN","kkrTdU","rowSelected","Omit","T","className","renderEmptyState","style","TableCellProps","children","selection","TableColumnProps","resizable","TableLoadMoreProps","label","onResize","onResizeEnd","resizeLabel","selectAllLabel","selectLabel","stickyHeader","TableRowProps","ResizeLabelContext","ResizableContext","StickyHeaderContext","cellContent","cellStyles","columnContent","state","sortArrowFor","sortDirection","resizerClassName","columnStyles","sticky","allowsSorting","dropAriaLevel","node","HTMLTableRowElement","removeAttribute","emptyContent","resizableContainerClassName","isResizing","isFocusVisible","props","isSelected","isHovered","hovered","isPressed","pressed","isDisabled","direction","undefined","t0","$","T0","t1","t2","t3","t4","t5","t6","t7","t8","t9","table","TableCell","TableColumn","resizableTable","0","1","TableLoadMore","TableRow","Body","Footer","Header","LoadMore","RACColumnResizer","stylex.props","rowLayers","Table","_c","RACTable","RACResizableTableContainer","TableBody","RACTableBody","RACCell","RACColumn","TableFooter","RACTableFooter","TableHeader","RACTableHeader","RACTableLoadMoreItem","RACRow"],"sources":["../../../src/components/table/index.tsx"],"sourcesContent":["'use client';\n\nimport type { ReactNode, RefAttributes } from 'react';\nimport type { ColumnRenderProps, ColumnResizerRenderProps, CellProps as RACCellProps, ColumnProps as RACColumnProps, RowProps as RACRowProps, TableBodyProps as RACTableBodyProps, TableFooterProps as RACTableFooterProps, TableHeaderProps as RACTableHeaderProps, TableLoadMoreItemProps as RACTableLoadMoreItemProps, TableProps as RACTableProps, ResizableTableContainerProps, RowRenderProps, TableBodyRenderProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { createContext, useContext } from 'react';\nimport { Cell as RACCell, Column as RACColumn, ColumnResizer as RACColumnResizer, ResizableTableContainer as RACResizableTableContainer, Row as RACRow, Table as RACTable, TableBody as RACTableBody, TableFooter as RACTableFooter, TableHeader as RACTableHeader, TableLoadMoreItem as RACTableLoadMoreItem } from 'react-aria-components';\nimport { CollectionLoadMore } from '../../collection';\nimport { ArrowDownwardGlyph, ArrowUpwardGlyph } from '../../glyphs';\nimport { rowStyles as rowLayers } from '../../row/styles';\nimport { mergeStatefulStyles, mergeStyles } from '../../styles/merge';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, sizing, spacing, stateLayerOpacity, typography } from '../../tokens/design.tokens.stylex';\nimport Checkbox from '../checkbox';\n\n// A grid of rows and columns, with sorting and selection. The design system\n// carries no data table page — it was dropped after Material Design 2 — so\n// the geometry comes from the archived one at\n// <https://m2.material.io/components/data-tables>, which is the page this\n// component is drawn from: a 56dp header row, 52dp body rows, 16dp of\n// padding on each side of a cell, a medium-weight header to set it apart\n// from the rows, and an arrow beside the name of the column being sorted.\n//\n// Its colour roles are the current system's rather than that page's, since\n// a table sits beside lists, cards and menus that all draw from the tokens\n// here. That means the row's state layers are the ones `src/row` uses — the\n// same hover, pressed and selected treatment a list row takes — so a\n// selected table row and a selected list row on one page cannot disagree.\n//\n// The row is not `src/row`, and that is the one place this departs from the\n// library's other collections. That module's row is a headline with a\n// supporting line and a slot at each end; a table row is a run of cells with\n// no such shape, and forcing one into the other would give every cell the\n// row's 56dp floor and body-large headline. The state layers are shared by\n// being written from the same tokens rather than by sharing the module.\n//\n// Four things are this component's own.\n//\n// **The rule between rows is drawn on the row, not on its cells.** A cell\n// cannot see whether its row is the first one, so a rule per cell either\n// doubles under the header or needs the row's position passed down. The\n// table collapses its borders, which is what lets a `<tr>` carry one.\n//\n// **A selecting table draws its checkbox where the call site puts it.**\n// `selection` on a column and on a cell renders the library's Checkbox in\n// React Aria's selection slot — the column's is select-all, the cell's is\n// that row's. It is a prop rather than an injected column because the header\n// and every row have to agree on how many columns there are, and only the\n// call site can keep that true.\n//\n// **A sortable column is the press target itself.** React Aria puts no\n// button inside the header cell; it makes the cell pressable and sets\n// `aria-sort` on it. So the arrow is content next to the name, and the\n// hover and pressed layers belong to the cell.\n//\n// **The header sticks only when asked.** A sticky header needs an opaque\n// background to scroll rows under, and that colour is only right when the\n// table is in something that scrolls. `stickyHeader` is what says so.\n//\n// **Resizing is asked for twice, and both are needed.** React Aria puts the\n// resize state on a container around the table and the handle inside a\n// column, so `resizable` on the table is what brings the container and\n// `resizable` on a column is what draws its handle. The archived page has no\n// resizer to take a treatment from — it predates the feature — so the handle\n// is the divider's own rule, thickening and taking the primary role while it\n// is dragged.\n//\n// **A resizable table stops filling its width.** The container sets\n// `table-layout: fixed` and `width: min-content` on the table as inline\n// styles, which no rule here can outrank; the container fills the width\n// instead and scrolls when the columns together are wider than it.\n//\n// One thing about React Aria's collection is worth knowing before writing a\n// call site. **A column's `id` and a row's `id` share one namespace**, and a\n// value used by both silently drops every column — the table then throws\n// \"Cell count must match column count\", naming the cells rather than the\n// duplicate key that caused it. Nothing here can catch it, since both ids\n// are the call site's to choose; the docstrings below say to keep them\n// apart, and the stories and tests use `col`-prefixed column ids so the two\n// sets cannot meet.\n\n// What the selection checkboxes are called. A context rather than a prop on\n// every column and cell, since it is the table's decision and repeating it\n// per row is how the two drift.\nconst SelectAllLabelContext = createContext('Select all');\nconst SelectLabelContext = createContext('Select');\nconst styles = {\n focus: {\n kjBf7l: \"xrgy624\",\n kInvED: \"x2ssjo2\",\n k3XXqK: \"x9v5kkp x1t137rt\",\n kMeerF: \"x1de99jn\",\n $$css: true\n },\n row: {\n kZKoxP: \"xdd8jsf\",\n kLZC3w: \"x12smttz\",\n kPef9Z: \"x13fuv20\",\n kEafiO: \"x1g31smg x178xt8z\",\n $$css: true\n },\n rowDisabled: {\n kWkggS: \"xjbqb8w\",\n kMwMTN: \"x1xj74d8\",\n kkrTdU: \"x1h6gzvc\",\n $$css: true\n },\n rowSelected: {\n kWkggS: \"xp89om9\",\n kMwMTN: \"xscdzaa\",\n $$css: true\n }\n};\ntype TableBodyProps<T extends object = object> = Omit<RACTableBodyProps<T>, 'className' | 'renderEmptyState' | 'style'> & {\n /** A function may compute the class from the body's render state. */\n className?: RACTableBodyProps<T>['className'];\n /**\n * What the table shows in place of rows when it has none: React Aria's own\n * render function, under React Aria's own name, as List, ListBox, Tree and\n * ChipGroup take it. What it returns is drawn in a row of its own spanning\n * every column, inside the muted, padded box the table draws there.\n */\n renderEmptyState?: RACTableBodyProps<T>['renderEmptyState'];\n /** A function may compute the style from the body's render state. */\n style?: RACTableBodyProps<T>['style'];\n};\ntype TableCellProps = Omit<RACCellProps, 'children' | 'className' | 'style'> & {\n /** What the cell holds. */\n children?: ReactNode;\n /** A function may compute the class from the cell's render state. */\n className?: RACCellProps['className'];\n /**\n * Draws this row's selection checkbox instead of `children`. The row's own\n * text is what names the row; the box inside it takes the table's\n * `selectLabel`.\n */\n selection?: boolean;\n /** A function may compute the style from the cell's render state. */\n style?: RACCellProps['style'];\n};\ntype TableColumnProps = {\n /** The column's name. */\n children?: ReactNode;\n /** A function may compute the class from the column's render state. */\n className?: RACColumnProps['className'];\n /**\n * Draws a handle at the column's trailing edge that drags its width. Needs\n * the table's own `resizable` as well — React Aria keeps the resize state\n * on a container around the table, and without it there is nothing for a\n * handle to change. `defaultWidth`, `minWidth` and `maxWidth` are React\n * Aria's and apply only inside that container.\n */\n resizable?: boolean;\n /**\n * Draws the select-all checkbox instead of `children`, for the column the\n * rows put their own checkboxes in.\n */\n selection?: boolean;\n /** A function may compute the style from the column's render state. */\n style?: RACColumnProps['style'];\n} & Omit<RACColumnProps, 'children' | 'className' | 'style'>;\ntype TableFooterProps<T extends object = object> = RACTableFooterProps<T>;\ntype TableHeaderProps<T extends object = object> = RACTableHeaderProps<T>;\ntype TableLoadMoreProps = Omit<RACTableLoadMoreItemProps, 'children'> & {\n /**\n * What the row says while it is loading. Read by a screen reader; the ring\n * itself carries no text.\n * @default 'Loading more'\n */\n label?: string;\n};\ntype TableProps = Omit<RACTableProps, 'className' | 'style'> & {\n /** A function may compute the class from the table's render state. */\n className?: RACTableProps['className'];\n /** Called as a column is dragged, with every column's width. */\n onResize?: ResizableTableContainerProps['onResize'];\n /** Called once a drag ends, with every column's width. */\n onResizeEnd?: ResizableTableContainerProps['onResizeEnd'];\n /**\n * Lets columns marked `resizable` be dragged, by putting the table in the\n * container React Aria keeps the resize state on. A resizable table sizes\n * to its columns rather than to its parent, and that container is what\n * fills the width and scrolls instead.\n */\n resizable?: boolean;\n /**\n * What the resize handle is called, for a screen reader. React Aria\n * composes it with the column's own name.\n * @default 'Resize column'\n */\n resizeLabel?: string;\n /**\n * What the select-all checkbox is called, for a screen reader.\n * @default 'Select all'\n */\n selectAllLabel?: string;\n /**\n * What each row's selection checkbox is called, for a screen reader. The\n * row's own text is what names the row; this names the box inside it.\n * @default 'Select'\n */\n selectLabel?: string;\n /**\n * Holds the header row in place while the rows scroll under it. Needs the\n * table inside something that scrolls; on a table that does not, it draws\n * the same as without it.\n */\n stickyHeader?: boolean;\n /** A function may compute the style from the table's render state. */\n style?: RACTableProps['style'];\n};\ntype TableRowProps<T extends object = object> = Omit<RACRowProps<T>, 'className' | 'style'> & {\n /** A function may compute the class from the row's render state. */\n className?: RACRowProps<T>['className'];\n /** A function may compute the style from the row's render state. */\n style?: RACRowProps<T>['style'];\n};\n\n// What the resize handles are called, for the same reason the selection\n// labels travel this way: it is the table's decision, and repeating it per\n// column is how the two drift.\nconst ResizeLabelContext = createContext('Resize column');\n\n// Whether the table brought the container. React Aria's resizer throws\n// outright without one — \"Wrap your <Table> in a <ResizableTableContainer>\",\n// naming a component a consumer of this library never writes — so a column\n// asking to resize inside a table that does not would take the whole page\n// down. It draws no handle instead.\nconst ResizableContext = createContext(false);\n\n// Whether the header sticks, so a column reaches it without every call site\n// repeating the table's own decision on each one.\nconst StickyHeaderContext = createContext(false);\n\n// What a body cell draws, and the classes it draws with. Written as calls\n// rather than inline at the props, which is what react-perf's\n// no-new-function-as-prop and jsx-no-jsx-as-prop are after; the React\n// Compiler memoises the results on their inputs.\n// The return type is written out rather than inferred, here and in the two\n// below: `ReactNode` is a union that includes a promise, and a function\n// inferred as returning one has to be `async`.\nfunction cellContent(children: ReactNode, selection: boolean, label: string): ReactNode {\n if (!selection) {\n return children;\n }\n return <Checkbox aria-label={label} slot=\"selection\" />;\n}\nfunction cellStyles(selection: boolean) {\n return {\n 0: {\n className: \"x9f619 x790zyz x1yc453h xxymvpz xrgy624 x2ssjo2 x9v5kkp x1t137rt x1de99jn\"\n },\n 1: {\n className: \"x9f619 x790zyz x1yc453h xxymvpz xrgy624 x2ssjo2 x9v5kkp x1t137rt x1de99jn x19ddzpn xuxw1ft\"\n }\n }[!!selection << 0];\n}\nfunction columnContent(children: ReactNode, selection: boolean, label: string, resizable: boolean, resizeLabel: string): RACColumnProps['children'] {\n if (selection) {\n return <Checkbox aria-label={label} slot=\"selection\" />;\n }\n // The handle is a sibling of the name rather than part of it: React Aria\n // renders it as its own element, positioned against the cell's trailing\n // edge, which the name's own box does not reach.\n return (state: ColumnRenderProps): ReactNode => <>\n <span className=\"x6s0dn4 x78zum5 x126z3so\">\n {children}\n {sortArrowFor(state.sortDirection)}\n </span>\n {resizable ? <RACColumnResizer aria-label={resizeLabel} className={resizerClassName} /> : null}\n </>;\n}\nfunction columnStyles(selection: boolean, sticky: boolean) {\n return (state: ColumnRenderProps) => ({\n 0: {\n className: \"x9f619 x790zyz x1yc453h xxymvpz x1ded5cy x1w5n3ug xkknnkr x14zspaw x1v9cpvo x155f00i x1lz68p4 x1n2onr6 xrgy624 x2ssjo2 x9v5kkp x1t137rt x1de99jn\"\n },\n 4: {\n className: \"x9f619 x790zyz x1yc453h xxymvpz x1ded5cy x1w5n3ug xkknnkr x14zspaw x1v9cpvo x155f00i x1lz68p4 xrgy624 x2ssjo2 x9v5kkp x1t137rt x1de99jn x14s9m32 x1ixd52e x13vifvy x7wzq59 x1vjfegm\"\n },\n 2: {\n className: \"x9f619 x790zyz x1yc453h xxymvpz x1ded5cy x1w5n3ug xkknnkr x14zspaw x1v9cpvo x155f00i x1lz68p4 x1n2onr6 xrgy624 x2ssjo2 x9v5kkp x1t137rt x1de99jn x19ddzpn xuxw1ft\"\n },\n 6: {\n className: \"x9f619 x790zyz x1yc453h xxymvpz x1ded5cy x1w5n3ug xkknnkr x14zspaw x1v9cpvo x155f00i x1lz68p4 xrgy624 x2ssjo2 x9v5kkp x1t137rt x1de99jn x14s9m32 x1ixd52e x13vifvy x7wzq59 x1vjfegm x19ddzpn xuxw1ft\"\n },\n 1: {\n className: \"x9f619 x790zyz x1yc453h xxymvpz x1ded5cy x1w5n3ug xkknnkr x14zspaw x1v9cpvo x155f00i x1lz68p4 x1n2onr6 xrgy624 x2ssjo2 x9v5kkp x1t137rt x1de99jn x83qkoq x1p2om7n xjbqb8w x1ypdohk\"\n },\n 5: {\n className: \"x9f619 x790zyz x1yc453h xxymvpz x1ded5cy x1w5n3ug xkknnkr x14zspaw x1v9cpvo x155f00i x1lz68p4 xrgy624 x2ssjo2 x9v5kkp x1t137rt x1de99jn x1ixd52e x13vifvy x7wzq59 x1vjfegm x83qkoq x1p2om7n xjbqb8w x1ypdohk\"\n },\n 3: {\n className: \"x9f619 x790zyz x1yc453h xxymvpz x1ded5cy x1w5n3ug xkknnkr x14zspaw x1v9cpvo x155f00i x1lz68p4 x1n2onr6 xrgy624 x2ssjo2 x9v5kkp x1t137rt x1de99jn x19ddzpn xuxw1ft x83qkoq x1p2om7n xjbqb8w x1ypdohk\"\n },\n 7: {\n className: \"x9f619 x790zyz x1yc453h xxymvpz x1ded5cy x1w5n3ug xkknnkr x14zspaw x1v9cpvo x155f00i x1lz68p4 xrgy624 x2ssjo2 x9v5kkp x1t137rt x1de99jn x1ixd52e x13vifvy x7wzq59 x1vjfegm x19ddzpn xuxw1ft x83qkoq x1p2om7n xjbqb8w x1ypdohk\"\n }\n })[!!sticky << 2 | !!selection << 1 | !!state.allowsSorting << 0];\n}\n\n// React Aria puts `aria-level` on the load-more row, and `aria-level` is only\n// valid on a row inside a `treegrid` — a grid's rows have no level. axe flags\n// it as `aria-conditional-attr`, and this library's stories run axe as an\n// error, so a table with a load-more row would fail on an attribute nothing\n// here asks for.\n//\n// It cannot be turned off through props: React Aria writes it after spreading\n// what the call site passed, so `aria-level={undefined}` is overwritten. The\n// attribute is taken off the element instead. React writes an attribute only\n// when its prop changes between renders, and this one is always 1, so the\n// removal holds rather than being undone by the next render. `load more` in\n// index.test.tsx pins that it is gone, which is what would notice if React\n// Aria stopped setting it or started varying it.\nfunction dropAriaLevel(node: HTMLTableRowElement | null) {\n node?.removeAttribute('aria-level');\n}\n\n// What the body draws in place of rows: whatever the call site's function\n// returns, inside the box that pads and centres it. A call rather than a\n// function written at the prop, for the same reason the others are.\n//\n// The box is the one thing this adds to React Aria's prop, and the one way\n// the table differs from its siblings, which pass theirs straight through and\n// draw nothing around it. A table's empty state goes in a spanning cell that\n// is not this component's and carries no padding, so without the box the\n// content would sit against the table's edge with no room around it.\nfunction emptyContent(renderEmptyState: (state: TableBodyRenderProps) => ReactNode) {\n // The return type is written out rather than inferred: `ReactNode` is a\n // union that includes a promise, and a function inferred as returning one\n // has to be `async`.\n return (state: TableBodyRenderProps): ReactNode => <span className=\"x9f619 x1w5n3ug x1lliihq xpo2rfv x193rfdd x1hews6w xn43zvd xv61bfh x1lrxzt4 x790zyz x2b8uid\">{renderEmptyState(state)}</span>;\n}\n\n// The container's class. React Aria takes a plain string here rather than a\n// function of render state, since the container reports none — so this is a\n// call rather than the function form the other parts pass.\nfunction resizableContainerClassName() {\n return {\n className: \"x9f619 xh8yej3 xw2csxc\"\n }.className ?? '';\n}\n\n// The handle's classes, from React Aria's own render state — it reports the\n// drag and the keyboard focus separately, and the two get one treatment.\nfunction resizerClassName(state: ColumnResizerRenderProps) {\n return {\n 0: {\n className: \"x1l12bh x5yr21d x9f619 xicojor x1i1rx1s x13vifvy xtijo5x x10l6tqk x5ve5x3\"\n },\n 1: {\n className: \"x5yr21d x9f619 xicojor x13vifvy xtijo5x x10l6tqk x5ve5x3 xnety89 xfo62xy\"\n }\n }[!!(state.isResizing || state.isFocusVisible) << 0].className ?? '';\n}\nfunction rowStyles(state: RowRenderProps) {\n return stylex.props(styles.row,\n // The same ring a cell and a column header draw, and for the same\n // reason: React Aria moves focus to the row itself, so the row is where\n // it has to show. Unconditional, as it is on those two — `focus` carries\n // its own `:focus-visible`, and the browser's default ring is what shows\n // through without it: a colour and an offset the rest of the table does\n // not use, and one no forced-colours mode is obliged to keep.\n styles.focus, state.isSelected && styles.rowSelected,\n // The state layers come from the render state, which is what makes a\n // row that only runs an action — `onRowAction`, a row's `onAction` or\n // `href` — take them as a selectable one does: React Aria reports a row\n // hovered or pressed only when a press does something to it, whether\n // that is selecting it, running its action or dragging it.\n state.isHovered && rowLayers.hovered, state.isPressed && rowLayers.pressed, state.isDisabled && styles.rowDisabled);\n}\n\n// The arrow beside a sorted column's name. Nothing is drawn on a column that\n// is sortable but not currently sorted: the page puts the arrow next to the\n// column being sorted, and an arrow on every sortable column would say every\n// one of them was.\nfunction sortArrowFor(direction: 'ascending' | 'descending' | undefined) {\n if (direction === undefined) {\n return null;\n }\n return direction === 'ascending' ? <ArrowUpwardGlyph className=\"xmix8c7 x2lah0s x1xp8n7a\" /> : <ArrowDownwardGlyph className=\"xmix8c7 x2lah0s x1xp8n7a\" />;\n}\n\n/**\n * A grid of rows and columns. Sorting and selection are React Aria's: pass\n * `sortDescriptor` with `onSortChange` and mark the sortable columns\n * `allowsSorting`, and set `selectionMode` to `single` or `multiple` with\n * `selectedKeys` and `onSelectionChange`, or `defaultSelectedKeys`.\n *\n * ```tsx\n * <Table aria-label=\"Label\" selectionMode=\"multiple\">\n * <Table.Header>\n * <Table.Column selection />\n * <Table.Column id=\"name\" isRowHeader>Label</Table.Column>\n * </Table.Header>\n * <Table.Body>\n * <Table.Row id=\"first\">\n * <Table.Cell selection />\n * <Table.Cell>First item</Table.Cell>\n * </Table.Row>\n * </Table.Body>\n * </Table>\n * ```\n *\n * Composed from parts, since a cell takes arbitrary content: `Table.Header`,\n * `Table.Column`, `Table.Body`, `Table.Row`, `Table.Cell` and\n * `Table.Footer`. Name the table with `aria-label` or `aria-labelledby`, and\n * mark one column `isRowHeader` so a screen reader has something to read a\n * row by.\n *\n * The call site's `className` and `style` land on the table, which is the\n * element a layout positions.\n */\nfunction Table({\n onResize,\n onResizeEnd,\n resizable = false,\n resizeLabel = 'Resize column',\n selectAllLabel = 'Select all',\n selectLabel = 'Select',\n stickyHeader = false,\n ...props\n}: RefAttributes<HTMLTableElement> & TableProps) {\n const table = <RACTable {...props} {...mergeStatefulStyles({\n className: \"x1mwwwfo x9f619 x139gbkf xpo2rfv x193rfdd x1hews6w xh8yej3 xn43zvd xv61bfh x1t137rt\"\n }, props)} />;\n return <SelectAllLabelContext value={selectAllLabel}>\n <SelectLabelContext value={selectLabel}>\n <ResizeLabelContext value={resizeLabel}>\n <ResizableContext value={resizable}>\n <StickyHeaderContext value={stickyHeader}>\n {resizable ? <RACResizableTableContainer className={resizableContainerClassName()} onResize={onResize} onResizeEnd={onResizeEnd}>\n {table}\n </RACResizableTableContainer> : table}\n </StickyHeaderContext>\n </ResizableContext>\n </ResizeLabelContext>\n </SelectLabelContext>\n </SelectAllLabelContext>;\n}\n\n/**\n * The rows. `renderEmptyState` is what it shows when there are none — a table\n * with no rows and nothing to say in their place is a blank area with a\n * header over it.\n *\n * It carries no styles of its own, since every rule a body needs is drawn by\n * the rows inside it, so a `className` here lands on the `<tbody>` through\n * React Aria rather than through a merge.\n */\nfunction TableBody<T extends object = object>({\n renderEmptyState,\n ...props\n}: TableBodyProps<T>) {\n return <RACTableBody<T> {...props} renderEmptyState={renderEmptyState === undefined ? undefined : emptyContent(renderEmptyState)} />;\n}\n\n/**\n * One cell. `selection` draws this row's checkbox in place of whatever else\n * the cell would hold.\n */\nfunction TableCell({\n children,\n selection = false,\n ...props\n}: TableCellProps) {\n const label = useContext(SelectLabelContext);\n return <RACCell {...props} {...mergeStatefulStyles(cellStyles(selection), props)}>\n {cellContent(children, selection, label)}\n </RACCell>;\n}\n\n/**\n * One column. `allowsSorting` is React Aria's and makes the header cell\n * itself the control that sorts; the arrow appears on the column the\n * `sortDescriptor` names. `isRowHeader` marks the column a screen reader\n * reads a row by.\n *\n * Its `id` shares a namespace with the rows', so give the two sets values\n * that cannot collide — a column and a row with one id between them leaves\n * the table with no columns at all.\n */\nfunction TableColumn({\n children,\n resizable = false,\n selection = false,\n ...props\n}: TableColumnProps) {\n const label = useContext(SelectAllLabelContext);\n const resizeLabel = useContext(ResizeLabelContext);\n const resizableTable = useContext(ResizableContext);\n const sticky = useContext(StickyHeaderContext);\n return <RACColumn {...props} {...mergeStatefulStyles(columnStyles(selection, sticky), props)}>\n {columnContent(children, selection, label, resizable && resizableTable, resizeLabel)}\n </RACColumn>;\n}\n\n/**\n * A row under the body, for totals and the like. It is not part of the\n * selection or the keyboard navigation — React Aria keeps it out of both.\n */\nfunction TableFooter<T extends object = object>(props: TableFooterProps<T>) {\n return <RACTableFooter<T> {...props} {...mergeStyles({\n className: \"x12smttz x13fuv20 x178xt8z x1w5n3ug xkknnkr x14zspaw x1v9cpvo x155f00i x1lz68p4\"\n }, props)} />;\n}\n\n/**\n * The header row, holding the columns, and the rule drawn under it — which\n * moves to the cells when the header sticks, since a row group's border does\n * not travel with cells `position: sticky` has lifted out of it.\n */\nfunction TableHeader<T extends object = object>(props: TableHeaderProps<T>) {\n const sticky = useContext(StickyHeaderContext);\n return <RACTableHeader<T> {...props} {...mergeStatefulStyles({\n 0: {\n className: \"x1j6faob x1q0q8m5 xso031l\"\n },\n 1: {}\n }[!!sticky << 0], props)} />;\n}\n\n/**\n * The row the table shows while it is fetching more. React Aria calls\n * `onLoadMore` when this comes into view, and draws it only while\n * `isLoading`. It goes inside `Table.Body`, after the rows.\n */\nfunction TableLoadMore({\n label = 'Loading more',\n ...props\n}: TableLoadMoreProps) {\n return <RACTableLoadMoreItem {...props} {...mergeStyles({\n className: \"xdd8jsf\"\n }, props)} ref={dropAriaLevel}>\n <span className=\"x6s0dn4 x9f619 x78zum5 xl56j7k\">\n <CollectionLoadMore label={label} size=\"24px\" />\n </span>\n </RACTableLoadMoreItem>;\n}\n\n/**\n * One row. Give every row an `id` — that is the key selection is reported\n * by, and it has to differ from every column's. `onAction` runs when the\n * row is pressed.\n */\nfunction TableRow<T extends object = object>(props: TableRowProps<T>) {\n return <RACRow<T> {...props} {...mergeStatefulStyles(rowStyles, props)} />;\n}\nTable.Body = TableBody;\nTable.Cell = TableCell;\nTable.Column = TableColumn;\nTable.Footer = TableFooter;\nTable.Header = TableHeader;\nTable.LoadMore = TableLoadMore;\nTable.Row = TableRow;\nexport type { TableBodyProps, TableCellProps, TableColumnProps, TableFooterProps, TableHeaderProps, TableLoadMoreProps, TableProps, TableRowProps };\nexport default Table;"],"mappings":";;;;;;;;;;;;AAoFA,MAAM6D,wBAAwBnC,cAAc,YAAY;AACxD,MAAMoC,qBAAqBpC,cAAc,QAAQ;AACjD,MAAMqC,SAAS;CACbC,OAAO;EACLC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,OAAO;CACT;CACAC,KAAK;EACHC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRL,OAAO;CACT;CACAM,aAAa;EACXC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRT,OAAO;CACT;CACAU,aAAa;EACXH,QAAQ;EACRC,QAAQ;EACRR,OAAO;CACT;AACF;AA6GA,MAAM8B,qBAAqBzE,cAAc,eAAe;AAOxD,MAAM0E,mBAAmB1E,cAAc,KAAK;AAI5C,MAAM2E,sBAAsB3E,cAAc,KAAK;AAS/C,SAAS4E,YAAYhB,UAAqBC,WAAoBI,OAA0B;CACtF,IAAI,CAACJ,WACH,OAAOD;CAET,OAAO,oBAAC,UAAD;EAAU,cAAYK;EAAO,MAAK;CAAW,CAAA;AACtD;AACA,SAASY,WAAWhB,WAAoB;CACtC,OAAO;EACL,GAAG,EACDL,WAAW,4EACb;EACA,GAAG,EACDA,WAAW,6FACb;CACF,EAAE,CAAC,CAACK,aAAa;AACnB;AACA,SAASi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AAAjI,EAAA,CAAA;CAAA,IAAAgI;CAAA,IAAAC,EAAA,OAAAV,OAAA;EACmCS,KAAA5E,oBAAoBF,WAAWqE,KAAK;EAACU,EAAA,KAAAV;EAAAU,EAAA,KAAAD;CAAA,OAAAA,KAAAC,EAAA;CAAA,IAAAE;CAAA,IAAAF,EAAA,OAAAV,SAAAU,EAAA,OAAAD,IAAA;EAA/DG,KAAA,oBAACqC,KAAD;GAAO,GAAQjD;GAAK,GAAMS;EAAqC,CAAA;EAAIC,EAAA,KAAAV;EAAAU,EAAA,KAAAD;EAAAC,EAAA,KAAAE;CAAA,OAAAA,KAAAF,EAAA;CAAA,OAAnEE;AAAmE;AAE5E9F,QAAM+G,OAAO7G;AACbF,QAAMV,OAAOkH;AACbxG,QAAMR,SAASiH;AACfzG,QAAMgH,SAAS5G;AACfJ,QAAMiH,SAAS3G;AACfN,QAAMkH,WAAWL;AACjB7G,QAAMF,MAAMgH"}
1
+ {"version":3,"file":"index.js","names":["c","_c","ReactNode","RefAttributes","ColumnRenderProps","ColumnResizerRenderProps","CellProps","RACCellProps","ColumnProps","RACColumnProps","RowProps","RACRowProps","TableBodyProps","RACTableBodyProps","TableFooterProps","RACTableFooterProps","TableHeaderProps","RACTableHeaderProps","TableLoadMoreItemProps","RACTableLoadMoreItemProps","TableProps","RACTableProps","ResizableTableContainerProps","RowRenderProps","TableBodyRenderProps","TableRenderProps","stylex","createContext","useContext","Cell","RACCell","Column","RACColumn","ColumnResizer","RACColumnResizer","ResizableTableContainer","RACResizableTableContainer","Row","RACRow","Table","RACTable","TableBody","RACTableBody","TableFooter","RACTableFooter","TableHeader","RACTableHeader","TableLoadMoreItem","RACTableLoadMoreItem","CollectionLoadMore","collectionStyles","ArrowDownwardGlyph","ArrowUpwardGlyph","rowStyles","rowLayers","mergeStatefulStyles","mergeStyles","colors","sizing","spacing","stateLayerOpacity","typography","Checkbox","FORCED_COLORS","SelectAllLabelContext","undefined","SelectLabelContext","styles","cell","kB7OPa","kg3NbH","k9WMMc","kXLuUW","$$css","focus","kjBf7l","kInvED","k3XXqK","kMeerF","header","kZKoxP","kMwMTN","kMv6JI","kGuDYH","k63SB2","kb6lSQ","kLWn49","kVQacm","kVAEAm","headerHovered","kWkggS","headerPressed","headerSortable","kkrTdU","row","kLZC3w","kPef9Z","kEafiO","rowDisabled","kAXs8y","rowSelected","selection","kzqmXN","khDVqt","sticky","kGVxlE","k87sOh","kY2c9j","table","kLvRdT","Omit","T","className","renderEmptyState","style","TableCellProps","children","TableColumnProps","resizable","TableLoadMoreProps","label","onResize","onResizeEnd","resizeLabel","selectAllLabel","selectLabel","stickyHeader","TableRowProps","ResizeLabelContext","ResizableContext","StickyHeaderContext","cellContent","cellStyles","columnContent","state","sortArrowFor","sortDirection","resizerRule","columnStyles","props","allowsSorting","isHovered","isPressed","dropAriaLevel","node","HTMLTableRowElement","removeAttribute","emptyContent","resizableContainerClassName","isResizing","isFocusVisible","isDragging","dragging","isSelected","hovered","pressed","isDropTarget","dropTarget","isDisabled","direction","t0","$","T0","t1","t2","t3","t4","t5","t6","t7","t8","t9","tableClasses","TableCell","TableColumn","resizableTable","0","1","TableLoadMore","TableRow","Body","Footer","Header","LoadMore","RACColumnResizer","stylex.props","rowLayers","Table","_c","RACTable","RACResizableTableContainer","TableBody","RACTableBody","RACCell","RACColumn","TableFooter","RACTableFooter","TableHeader","RACTableHeader","RACTableLoadMoreItem","RACRow"],"sources":["../../../src/components/table/index.tsx"],"sourcesContent":["'use client';\n\nimport type { ReactNode, RefAttributes } from 'react';\nimport type { ColumnRenderProps, ColumnResizerRenderProps, CellProps as RACCellProps, ColumnProps as RACColumnProps, RowProps as RACRowProps, TableBodyProps as RACTableBodyProps, TableFooterProps as RACTableFooterProps, TableHeaderProps as RACTableHeaderProps, TableLoadMoreItemProps as RACTableLoadMoreItemProps, TableProps as RACTableProps, ResizableTableContainerProps, RowRenderProps, TableBodyRenderProps, TableRenderProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { createContext, useContext } from 'react';\nimport { Cell as RACCell, Column as RACColumn, ColumnResizer as RACColumnResizer, ResizableTableContainer as RACResizableTableContainer, Row as RACRow, Table as RACTable, TableBody as RACTableBody, TableFooter as RACTableFooter, TableHeader as RACTableHeader, TableLoadMoreItem as RACTableLoadMoreItem } from 'react-aria-components';\nimport { CollectionLoadMore } from '../../collection';\nimport { collectionStyles } from '../../collection/styles';\nimport { ArrowDownwardGlyph, ArrowUpwardGlyph } from '../../glyphs';\nimport { rowStyles as rowLayers } from '../../row/styles';\nimport { mergeStatefulStyles, mergeStyles } from '../../styles/merge';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, sizing, spacing, stateLayerOpacity, typography } from '../../tokens/design.tokens.stylex';\nimport Checkbox from '../checkbox';\n\n// Windows High Contrast and the rest of the forced-colours modes. Spelled\n// here rather than imported, for the reason src/field/styles.ts records: the\n// StyleX compiler resolves a constant across files only out of a `.stylex.ts`\n// module, and the generated one holds design tokens rather than queries.\nconst FORCED_COLORS = '@media (forced-colors: active)';\n\n// A grid of rows and columns, with sorting and selection. The design system\n// carries no data table page — it was dropped after Material Design 2 — so\n// the geometry comes from the archived one at\n// <https://m2.material.io/components/data-tables>, which is the page this\n// component is drawn from: a 56dp header row, 52dp body rows, 16dp of\n// padding on each side of a cell, a medium-weight header to set it apart\n// from the rows, and an arrow beside the name of the column being sorted.\n//\n// Its colour roles are the current system's rather than that page's, since\n// a table sits beside lists, cards and menus that all draw from the tokens\n// here. That means the row's state layers are the ones `src/row` uses — the\n// same hover, pressed and selected treatment a list row takes — so a\n// selected table row and a selected list row on one page cannot disagree.\n//\n// The row is not `src/row`, and that is the one place this departs from the\n// library's other collections. That module's row is a headline with a\n// supporting line and a slot at each end; a table row is a run of cells with\n// no such shape, and forcing one into the other would give every cell the\n// row's 56dp floor and body-large headline. The state layers are shared by\n// being written from the same tokens rather than by sharing the module.\n//\n// Four things are this component's own.\n//\n// **The rule between rows is drawn on the row, not on its cells.** A cell\n// cannot see whether its row is the first one, so a rule per cell either\n// doubles under the header or needs the row's position passed down. The\n// table collapses its borders, which is what lets a `<tr>` carry one.\n//\n// **A selecting table draws its checkbox where the call site puts it.**\n// `selection` on a column and on a cell renders the library's Checkbox in\n// React Aria's selection slot — the column's is select-all, the cell's is\n// that row's. It is a prop rather than an injected column because the header\n// and every row have to agree on how many columns there are, and only the\n// call site can keep that true.\n//\n// **A sortable column is the press target itself.** React Aria puts no\n// button inside the header cell; it makes the cell pressable and sets\n// `aria-sort` on it. So the arrow is content next to the name, and the\n// hover and pressed layers belong to the cell.\n//\n// **The header sticks only when asked.** A sticky header needs an opaque\n// background to scroll rows under, and that colour is only right when the\n// table is in something that scrolls. `stickyHeader` is what says so.\n//\n// **Resizing is asked for twice, and both are needed.** React Aria puts the\n// resize state on a container around the table and the handle inside a\n// column, so `resizable` on the table is what brings the container and\n// `resizable` on a column is what draws its handle. The archived page has no\n// resizer to take a treatment from — it predates the feature — so the handle\n// draws the divider's own rule, thickening and taking the primary role while\n// it is dragged, over a target far wider than the rule.\n//\n// **A resizable table stops filling its width.** The container sets\n// `table-layout: fixed` and `width: min-content` on the table as inline\n// styles, which no rule here can outrank; the container fills the width\n// instead and scrolls when the columns together are wider than it.\n//\n// One thing about React Aria's collection is worth knowing before writing a\n// call site. **A column's `id` and a row's `id` share one namespace**, and a\n// value used by both silently drops every column — the table then throws\n// \"Cell count must match column count\", naming the cells rather than the\n// duplicate key that caused it. Nothing here can catch it, since both ids\n// are the call site's to choose; the docstrings below say to keep them\n// apart, and the stories and tests use `col`-prefixed column ids so the two\n// sets cannot meet.\n\n// What the selection checkboxes are called. A context rather than a prop on\n// every column and cell, since it is the table's decision and repeating it\n// per row is how the two drift. Undefined unless the table is given one,\n// which leaves the names React Aria gives in the reader's locale.\nconst SelectAllLabelContext = createContext<string | undefined>(undefined);\nconst SelectLabelContext = createContext<string | undefined>(undefined);\nconst styles = {\n cell: {\n kB7OPa: \"x9f619\",\n kg3NbH: \"x790zyz\",\n k9WMMc: \"x1yc453h\",\n kXLuUW: \"xxymvpz\",\n $$css: true\n },\n focus: {\n kjBf7l: \"xrgy624 x1v8yhc2\",\n kInvED: \"x2ssjo2\",\n k3XXqK: \"x9v5kkp x1t137rt\",\n kMeerF: \"x1de99jn\",\n $$css: true\n },\n header: {\n kZKoxP: \"x1ded5cy\",\n kMwMTN: \"x1w5n3ug\",\n kMv6JI: \"xkknnkr\",\n kGuDYH: \"x14zspaw\",\n k63SB2: \"x1v9cpvo\",\n kb6lSQ: \"x155f00i\",\n kLWn49: \"x1lz68p4\",\n kVQacm: \"x9h1dke\",\n kVAEAm: \"x1n2onr6\",\n $$css: true\n },\n headerHovered: {\n kWkggS: \"x1b18xnh\",\n $$css: true\n },\n headerPressed: {\n kWkggS: \"xjeeohs\",\n $$css: true\n },\n headerSortable: {\n kWkggS: \"xjbqb8w\",\n kkrTdU: \"x1ypdohk\",\n $$css: true\n },\n row: {\n kZKoxP: \"xdd8jsf\",\n kLZC3w: \"x12smttz\",\n kPef9Z: \"x13fuv20\",\n kEafiO: \"x1g31smg x178xt8z\",\n $$css: true\n },\n rowDisabled: {\n kWkggS: \"xjbqb8w\",\n kMwMTN: \"x1xj74d8\",\n kkrTdU: \"x1h6gzvc\",\n kAXs8y: \"xr5dkdi\",\n $$css: true\n },\n rowSelected: {\n kWkggS: \"xp89om9 x1jzqe4\",\n kMwMTN: \"xscdzaa x1k5gbb1\",\n kAXs8y: \"x1g12otp\",\n $$css: true\n },\n selection: {\n kzqmXN: \"x19ddzpn\",\n khDVqt: \"xuxw1ft\",\n $$css: true\n },\n sticky: {\n kWkggS: \"x14s9m32\",\n kGVxlE: \"x1ixd52e\",\n k87sOh: \"x13vifvy\",\n kVAEAm: \"x7wzq59\",\n kY2c9j: \"x1vjfegm\",\n $$css: true\n },\n table: {\n kLvRdT: \"x1mwwwfo\",\n kB7OPa: \"x9f619\",\n kMwMTN: \"x139gbkf\",\n kMv6JI: \"xpo2rfv\",\n kGuDYH: \"x193rfdd\",\n k63SB2: \"x1hews6w\",\n kzqmXN: \"xh8yej3\",\n kb6lSQ: \"xn43zvd\",\n kLWn49: \"xv61bfh\",\n k3XXqK: \"x1t137rt\",\n $$css: true\n }\n};\ntype TableBodyProps<T extends object = object> = Omit<RACTableBodyProps<T>, 'className' | 'renderEmptyState' | 'style'> & {\n /** A function may compute the class from the body's render state. */\n className?: RACTableBodyProps<T>['className'];\n /**\n * What the table shows in place of rows when it has none: React Aria's own\n * render function, under React Aria's own name, as List, ListBox, Tree and\n * ChipGroup take it. What it returns is drawn in a row of its own spanning\n * every column, inside the muted, padded box the table draws there.\n */\n renderEmptyState?: RACTableBodyProps<T>['renderEmptyState'];\n /** A function may compute the style from the body's render state. */\n style?: RACTableBodyProps<T>['style'];\n};\ntype TableCellProps = Omit<RACCellProps, 'children' | 'className' | 'style'> & {\n /** What the cell holds. */\n children?: ReactNode;\n /** A function may compute the class from the cell's render state. */\n className?: RACCellProps['className'];\n /**\n * Draws this row's selection checkbox instead of `children`. The row's own\n * text is what names the row; the box inside it takes the table's\n * `selectLabel`.\n */\n selection?: boolean;\n /** A function may compute the style from the cell's render state. */\n style?: RACCellProps['style'];\n};\ntype TableColumnProps = {\n /** The column's name. */\n children?: ReactNode;\n /** A function may compute the class from the column's render state. */\n className?: RACColumnProps['className'];\n /**\n * Draws a handle at the column's trailing edge that drags its width. Needs\n * the table's own `resizable` as well — React Aria keeps the resize state\n * on a container around the table, and without it there is nothing for a\n * handle to change. `defaultWidth`, `minWidth` and `maxWidth` are React\n * Aria's and apply only inside that container.\n */\n resizable?: boolean;\n /**\n * Draws the select-all checkbox instead of `children`, for the column the\n * rows put their own checkboxes in.\n */\n selection?: boolean;\n /** A function may compute the style from the column's render state. */\n style?: RACColumnProps['style'];\n} & Omit<RACColumnProps, 'children' | 'className' | 'style'>;\ntype TableFooterProps<T extends object = object> = RACTableFooterProps<T>;\ntype TableHeaderProps<T extends object = object> = RACTableHeaderProps<T>;\ntype TableLoadMoreProps = Omit<RACTableLoadMoreItemProps, 'children'> & {\n /**\n * What the row says while it is loading. Read by a screen reader; the ring\n * itself carries no text.\n * Left out, it is the word for it in the I18nProvider's locale — \"Loading\n * more\" in English.\n */\n label?: string;\n};\ntype TableProps = {\n /** A function may compute the class from the table's render state. */\n className?: RACTableProps['className'];\n /** Called as a column is dragged, with every column's width. */\n onResize?: ResizableTableContainerProps['onResize'];\n /** Called once a drag ends, with every column's width. */\n onResizeEnd?: ResizableTableContainerProps['onResizeEnd'];\n /**\n * Lets columns marked `resizable` be dragged, by putting the table in the\n * container React Aria keeps the resize state on. A resizable table sizes\n * to its columns rather than to its parent, and that container is what\n * fills the width and scrolls instead.\n */\n resizable?: boolean;\n /**\n * What the resize handle is called, for a screen reader. React Aria\n * composes it with the column's own name. Left out, React Aria names it in\n * the reader's locale — \"Resizer\" in English.\n */\n resizeLabel?: string;\n /**\n * What the select-all checkbox is called, for a screen reader. Left out,\n * React Aria names it in the reader's locale — \"Select All\" in English.\n */\n selectAllLabel?: string;\n /**\n * What each row's selection checkbox is called, for a screen reader. The\n * row's own text is what names the row; this names the box inside it.\n * Left out, React Aria names it in the reader's locale — \"Select\" in\n * English.\n */\n selectLabel?: string;\n /**\n * Holds the header row in place while the rows scroll under it. Needs the\n * table inside something that scrolls; on a table that does not, it draws\n * the same as without it.\n */\n stickyHeader?: boolean;\n /** A function may compute the style from the table's render state. */\n style?: RACTableProps['style'];\n} & Omit<RACTableProps, 'className' | 'style'>;\ntype TableRowProps<T extends object = object> = Omit<RACRowProps<T>, 'className' | 'style'> & {\n /** A function may compute the class from the row's render state. */\n className?: RACRowProps<T>['className'];\n /** A function may compute the style from the row's render state. */\n style?: RACRowProps<T>['style'];\n};\n\n// What the resize handles are called, for the same reason the selection\n// labels travel this way: it is the table's decision, and repeating it per\n// column is how the two drift. Undefined by default, as they are.\nconst ResizeLabelContext = createContext<string | undefined>(undefined);\n\n// Whether the table brought the container. React Aria's resizer throws\n// outright without one — \"Wrap your <Table> in a <ResizableTableContainer>\",\n// naming a component a consumer of this library never writes — so a column\n// asking to resize inside a table that does not would take the whole page\n// down. It draws no handle instead.\nconst ResizableContext = createContext(false);\n\n// Whether the header sticks, so a column reaches it without every call site\n// repeating the table's own decision on each one.\nconst StickyHeaderContext = createContext(false);\n\n// What a body cell draws, and the classes it draws with. Written as calls\n// rather than inline at the props, which is what react-perf's\n// no-new-function-as-prop and jsx-no-jsx-as-prop are after; the React\n// Compiler memoises the results on their inputs.\n// The return type is written out rather than inferred, here and in the two\n// below: `ReactNode` is a union that includes a promise, and a function\n// inferred as returning one has to be `async`.\nfunction cellContent(children: ReactNode, selection: boolean, label: string | undefined): ReactNode {\n if (!selection) {\n return children;\n }\n return <Checkbox aria-label={label} slot=\"selection\" />;\n}\nfunction cellStyles(selection: boolean) {\n return {\n 0: {\n className: \"x9f619 x790zyz x1yc453h xxymvpz xrgy624 x1v8yhc2 x2ssjo2 x9v5kkp x1t137rt x1de99jn\"\n },\n 1: {\n className: \"x9f619 x790zyz x1yc453h xxymvpz xrgy624 x1v8yhc2 x2ssjo2 x9v5kkp x1t137rt x1de99jn x19ddzpn xuxw1ft\"\n }\n }[!!selection << 0];\n}\nfunction columnContent(children: ReactNode, selection: boolean, label: string | undefined, resizable: boolean, resizeLabel: string | undefined): RACColumnProps['children'] {\n if (selection) {\n return <Checkbox aria-label={label} slot=\"selection\" />;\n }\n // The handle is a sibling of the name rather than part of it: React Aria\n // renders it as its own element, positioned against the cell's trailing\n // edge, which the name's own box does not reach.\n return (state: ColumnRenderProps): ReactNode => <>\n <span className=\"x6s0dn4 x78zum5 x126z3so\">\n {children}\n {sortArrowFor(state.sortDirection)}\n </span>\n {resizable ? <RACColumnResizer aria-label={resizeLabel} className=\"x5yr21d x9f619 xicojor xvy4d1p x13vifvy x18zu7yx x10l6tqk x5ve5x3 x1vjfegm\">\n {resizerRule}\n </RACColumnResizer> : null}\n </>;\n}\nfunction columnStyles(selection: boolean, sticky: boolean) {\n return (state: ColumnRenderProps) => stylex.props(styles.cell, styles.header, styles.focus, sticky && styles.sticky, selection && styles.selection, state.allowsSorting && styles.headerSortable, state.allowsSorting && state.isHovered && styles.headerHovered, state.allowsSorting && state.isPressed && styles.headerPressed);\n}\n\n// React Aria puts `aria-level` on the load-more row, and `aria-level` is only\n// valid on a row inside a `treegrid` — a grid's rows have no level. axe flags\n// it as `aria-conditional-attr`, and this library's stories run axe as an\n// error, so a table with a load-more row would fail on an attribute nothing\n// here asks for.\n//\n// It cannot be turned off through props: React Aria writes it after spreading\n// what the call site passed, so `aria-level={undefined}` is overwritten. The\n// attribute is taken off the element instead. React writes an attribute only\n// when its prop changes between renders, and this one is always 1, so the\n// removal holds rather than being undone by the next render. `load more` in\n// index.test.tsx pins that it is gone, which is what would notice if React\n// Aria stopped setting it or started varying it.\nfunction dropAriaLevel(node: HTMLTableRowElement | null) {\n node?.removeAttribute('aria-level');\n}\n\n// What the body draws in place of rows: whatever the call site's function\n// returns, inside the box that pads and centres it. A call rather than a\n// function written at the prop, for the same reason the others are.\n//\n// The box is the one thing this adds to React Aria's prop, and the one way\n// the table differs from its siblings, which pass theirs straight through and\n// draw nothing around it. A table's empty state goes in a spanning cell that\n// is not this component's and carries no padding, so without the box the\n// content would sit against the table's edge with no room around it.\nfunction emptyContent(renderEmptyState: (state: TableBodyRenderProps) => ReactNode) {\n // The return type is written out rather than inferred: `ReactNode` is a\n // union that includes a promise, and a function inferred as returning one\n // has to be `async`.\n return (state: TableBodyRenderProps): ReactNode => <span className=\"x9f619 x1w5n3ug x1lliihq xpo2rfv x193rfdd x1hews6w xn43zvd xv61bfh x1lrxzt4 x790zyz x2b8uid\">{renderEmptyState(state)}</span>;\n}\n\n// The container's class. React Aria takes a plain string here rather than a\n// function of render state, since the container reports none — so this is a\n// call rather than the function form the other parts pass.\nfunction resizableContainerClassName() {\n return {\n className: \"x9f619 xh8yej3 xw2csxc\"\n }.className ?? '';\n}\n\n// The rule a handle draws, from React Aria's own render state — it reports\n// the drag and the keyboard focus separately, and the two get one treatment.\nfunction resizerRule(state: ColumnResizerRenderProps): ReactNode {\n return <span {...{\n 0: {\n className: \"x1l12bh x5yr21d x1x0u81l xf1j0q2 xmzn1mo x9f619 x1g12otp x1i1rx1s x13vifvy x9q68il x47corl x10l6tqk\"\n },\n 1: {\n className: \"x5yr21d xf1j0q2 x9f619 x1g12otp x13vifvy x9q68il x47corl x10l6tqk xnety89 x1ksdfms x12inkfj xfo62xy\"\n }\n }[!!(state.isResizing || state.isFocusVisible) << 0]} />;\n}\nfunction rowStyles(state: RowRenderProps) {\n return stylex.props(styles.row,\n // The same ring a cell and a column header draw, and for the same\n // reason: React Aria moves focus to the row itself, so the row is where\n // it has to show. Unconditional, as it is on those two — `focus` carries\n // its own `:focus-visible`, and the browser's default ring is what shows\n // through without it: a colour and an offset the rest of the table does\n // not use, and one no forced-colours mode is obliged to keep.\n styles.focus,\n // The lists page's dragged row and the drop target a row draws, from\n // `src/row` as every other collection's row takes them — the dragged one\n // before the selected container, so a selected row keeps it while it\n // moves.\n state.isDragging && rowLayers.dragging, state.isSelected && styles.rowSelected,\n // The state layers come from the render state, which is what makes a\n // row that only runs an action — `onRowAction`, a row's `onAction` or\n // `href` — take them as a selectable one does: React Aria reports a row\n // hovered or pressed only when a press does something to it, whether\n // that is selecting it, running its action or dragging it.\n state.isHovered && rowLayers.hovered, state.isPressed && rowLayers.pressed, state.isDropTarget && rowLayers.dropTarget, state.isDisabled && styles.rowDisabled);\n}\n\n// The arrow beside a sorted column's name. Nothing is drawn on a column that\n// is sortable but not currently sorted: the page puts the arrow next to the\n// column being sorted, and an arrow on every sortable column would say every\n// one of them was.\nfunction sortArrowFor(direction: 'ascending' | 'descending' | undefined) {\n if (direction === undefined) {\n return null;\n }\n return direction === 'ascending' ? <ArrowUpwardGlyph className=\"xmix8c7 x2lah0s x1xp8n7a\" /> : <ArrowDownwardGlyph className=\"xmix8c7 x2lah0s x1xp8n7a\" />;\n}\n\n/**\n * A grid of rows and columns. Sorting and selection are React Aria's: pass\n * `sortDescriptor` with `onSortChange` and mark the sortable columns\n * `allowsSorting`, and set `selectionMode` to `single` or `multiple` with\n * `selectedKeys` and `onSelectionChange`, or `defaultSelectedKeys`.\n *\n * ```tsx\n * <Table aria-label=\"Label\" selectionMode=\"multiple\">\n * <Table.Header>\n * <Table.Column selection />\n * <Table.Column id=\"name\" isRowHeader>Label</Table.Column>\n * </Table.Header>\n * <Table.Body>\n * <Table.Row id=\"first\">\n * <Table.Cell selection />\n * <Table.Cell>First item</Table.Cell>\n * </Table.Row>\n * </Table.Body>\n * </Table>\n * ```\n *\n * Composed from parts, since a cell takes arbitrary content: `Table.Header`,\n * `Table.Column`, `Table.Body`, `Table.Row`, `Table.Cell` and\n * `Table.Footer`. Name the table with `aria-label` or `aria-labelledby`, and\n * mark one column `isRowHeader` so a screen reader has something to read a\n * row by.\n *\n * The call site's `className` and `style` land on the table, which is the\n * element a layout positions.\n */\nfunction Table({\n onResize,\n onResizeEnd,\n resizable = false,\n resizeLabel,\n selectAllLabel,\n selectLabel,\n stickyHeader = false,\n ...props\n}: RefAttributes<HTMLTableElement> & TableProps) {\n const table = <RACTable {...props} {...mergeStatefulStyles(tableClasses, props)} />;\n return <SelectAllLabelContext value={selectAllLabel}>\n <SelectLabelContext value={selectLabel}>\n <ResizeLabelContext value={resizeLabel}>\n <ResizableContext value={resizable}>\n <StickyHeaderContext value={stickyHeader}>\n {resizable ? <RACResizableTableContainer className={resizableContainerClassName()} onResize={onResize} onResizeEnd={onResizeEnd}>\n {table}\n </RACResizableTableContainer> : table}\n </StickyHeaderContext>\n </ResizableContext>\n </ResizeLabelContext>\n </SelectLabelContext>\n </SelectAllLabelContext>;\n}\n\n/**\n * The rows. `renderEmptyState` is what it shows when there are none — a table\n * with no rows and nothing to say in their place is a blank area with a\n * header over it.\n *\n * It carries no styles of its own, since every rule a body needs is drawn by\n * the rows inside it, so a `className` here lands on the `<tbody>` through\n * React Aria rather than through a merge.\n */\nfunction TableBody<T extends object = object>({\n renderEmptyState,\n ...props\n}: TableBodyProps<T>) {\n return <RACTableBody<T> {...props} renderEmptyState={renderEmptyState === undefined ? undefined : emptyContent(renderEmptyState)} />;\n}\n\n/**\n * One cell. `selection` draws this row's checkbox in place of whatever else\n * the cell would hold.\n */\nfunction TableCell({\n children,\n selection = false,\n ...props\n}: TableCellProps) {\n const label = useContext(SelectLabelContext);\n return <RACCell {...props} {...mergeStatefulStyles(cellStyles(selection), props)}>\n {cellContent(children, selection, label)}\n </RACCell>;\n}\n\n// The table's own classes, with the drop target the other collections'\n// boxes draw while a drop would land on the table as a whole.\nfunction tableClasses(state: TableRenderProps) {\n return stylex.props(styles.table, state.isDropTarget && collectionStyles.dropTarget);\n}\n\n/**\n * One column. `allowsSorting` is React Aria's and makes the header cell\n * itself the control that sorts; the arrow appears on the column the\n * `sortDescriptor` names. `isRowHeader` marks the column a screen reader\n * reads a row by.\n *\n * Its `id` shares a namespace with the rows', so give the two sets values\n * that cannot collide — a column and a row with one id between them leaves\n * the table with no columns at all.\n */\nfunction TableColumn({\n children,\n resizable = false,\n selection = false,\n ...props\n}: TableColumnProps) {\n const label = useContext(SelectAllLabelContext);\n const resizeLabel = useContext(ResizeLabelContext);\n const resizableTable = useContext(ResizableContext);\n const sticky = useContext(StickyHeaderContext);\n return <RACColumn {...props} {...mergeStatefulStyles(columnStyles(selection, sticky), props)}>\n {columnContent(children, selection, label, resizable && resizableTable, resizeLabel)}\n </RACColumn>;\n}\n\n/**\n * A row under the body, for totals and the like. It is not part of the\n * selection or the keyboard navigation — React Aria keeps it out of both.\n */\nfunction TableFooter<T extends object = object>(props: TableFooterProps<T>) {\n return <RACTableFooter<T> {...props} {...mergeStyles({\n className: \"x12smttz x13fuv20 x178xt8z x1w5n3ug xkknnkr x14zspaw x1v9cpvo x155f00i x1lz68p4\"\n }, props)} />;\n}\n\n/**\n * The header row, holding the columns, and the rule drawn under it — which\n * moves to the cells when the header sticks, since a row group's border does\n * not travel with cells `position: sticky` has lifted out of it.\n */\nfunction TableHeader<T extends object = object>(props: TableHeaderProps<T>) {\n const sticky = useContext(StickyHeaderContext);\n return <RACTableHeader<T> {...props} {...mergeStatefulStyles({\n 0: {\n className: \"x1j6faob x1q0q8m5 xso031l\"\n },\n 1: {}\n }[!!sticky << 0], props)} />;\n}\n\n/**\n * The row the table shows while it is fetching more. React Aria calls\n * `onLoadMore` when this comes into view, and draws it only while\n * `isLoading`. It goes inside `Table.Body`, after the rows.\n */\nfunction TableLoadMore({\n label,\n ...props\n}: TableLoadMoreProps) {\n return <RACTableLoadMoreItem {...props} {...mergeStyles({\n className: \"xdd8jsf\"\n }, props)} ref={dropAriaLevel}>\n <span className=\"x6s0dn4 x9f619 x78zum5 xl56j7k\">\n <CollectionLoadMore label={label} size=\"24px\" />\n </span>\n </RACTableLoadMoreItem>;\n}\n\n/**\n * One row. Give every row an `id` — that is the key selection is reported\n * by, and it has to differ from every column's. `onAction` runs when the\n * row is pressed.\n */\nfunction TableRow<T extends object = object>(props: TableRowProps<T>) {\n return <RACRow<T> {...props} {...mergeStatefulStyles(rowStyles, props)} />;\n}\nTable.Body = TableBody;\nTable.Cell = TableCell;\nTable.Column = TableColumn;\nTable.Footer = TableFooter;\nTable.Header = TableHeader;\nTable.LoadMore = TableLoadMore;\nTable.Row = TableRow;\nexport type { TableBodyProps, TableCellProps, TableColumnProps, TableFooterProps, TableHeaderProps, TableLoadMoreProps, TableProps, TableRowProps };\nexport { TableBody, TableCell, TableColumn, TableFooter, TableHeader, TableLoadMore, TableRow };\nexport default Table;"],"mappings":";;;;;;;;;;;;;AA4FA,MAAMgE,wBAAwBrC,cAAkCsC,KAAAA,CAAS;AACzE,MAAMC,qBAAqBvC,cAAkCsC,KAAAA,CAAS;AACtE,MAAME,SAAS;CACbC,MAAM;EACJC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,OAAO;CACT;CACAC,OAAO;EACLC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRL,OA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;EAAAF,EAAA,KAAAG;EAAAH,EAAA,MAAAI;EAAAJ,EAAA,MAAAK;CAAA,OAAAA,KAAAL,EAAA;CAAA,OANlBK;AAMkB;;;;;;AAQ3B,SAAAa,SAAAxC,OAAA;CAAA,MAAAsB,IAAAhK,EAAA,CAAA;CAAA,IAAA+J;CAAA,IAAAC,EAAA,OAAAtB,OAAA;EACmCqB,KAAAzG,oBAAoBF,WAAWsF,KAAK;EAACsB,EAAA,KAAAtB;EAAAsB,EAAA,KAAAD;CAAA,OAAAA,KAAAC,EAAA;CAAA,IAAAE;CAAA,IAAAF,EAAA,OAAAtB,SAAAsB,EAAA,OAAAD,IAAA;EAA/DG,KAAA,oBAACqC,KAAD;GAAO,GAAQ7D;GAAK,GAAMqB;EAAqC,CAAA;EAAIC,EAAA,KAAAtB;EAAAsB,EAAA,KAAAD;EAAAC,EAAA,KAAAE;CAAA,OAAAA,KAAAF,EAAA;CAAA,OAAnEE;AAAmE;AAE5E5H,QAAM6I,OAAO3I;AACbF,QAAMV,OAAOgJ;AACbtI,QAAMR,SAAS+I;AACfvI,QAAM8I,SAAS1I;AACfJ,QAAM+I,SAASzI;AACfN,QAAMgJ,WAAWL;AACjB3I,QAAMF,MAAM8I"}
@@ -1,8 +1,25 @@
1
1
  import { ReactNode, RefAttributes } from "react";
2
2
  import { TabListProps, TabPanelProps, TabPanelsProps, TabProps, TabsProps } from "react-aria-components";
3
3
  //#region src/components/tabs/index.d.ts
4
+ /** The tabs page's two styles of tab bar. */
5
+ type TabsVariant = 'primary' | 'secondary';
6
+ /** How the bar shares its room among the tabs. */
7
+ type TabsLayout = 'fixed' | 'scrollable';
4
8
  type TabsProps$1 = Omit<TabsProps, 'children'> & {
5
9
  children?: ReactNode;
10
+ /**
11
+ * How the bar shares its room: `fixed` divides it into equal sections, and
12
+ * `scrollable` gives each tab its label's width in a bar that scrolls,
13
+ * which is the page's choice for more tabs than the room has sections for.
14
+ * @default 'fixed'
15
+ */
16
+ layout?: TabsLayout;
17
+ /**
18
+ * Which of the page's two tab bars this is: `primary` for the main one,
19
+ * `secondary` for a strip under a primary one.
20
+ * @default 'primary'
21
+ */
22
+ variant?: TabsVariant;
6
23
  };
7
24
  /**
8
25
  * A tab bar and its panels. Selection is React Aria's `selectedKey`: pass
@@ -14,7 +31,7 @@ type TabsProps$1 = Omit<TabsProps, 'children'> & {
14
31
  * what each panel holds are the call site's to decide — the parts are
15
32
  * `Tabs.List`, `Tabs.Tab`, and `Tabs.Panel`.
16
33
  */
17
- declare function Tabs$1({ children, ...props }: RefAttributes<HTMLDivElement> & TabsProps$1): import("react").JSX.Element;
34
+ declare function Tabs$1({ children, layout, orientation, variant, ...props }: RefAttributes<HTMLDivElement> & TabsProps$1): import("react").JSX.Element;
18
35
  declare namespace Tabs$1 {
19
36
  var List: typeof TabsList;
20
37
  var Panel: typeof TabsPanel;
@@ -29,13 +46,27 @@ declare function TabsPanel(props: TabsPanelProps): import("react").JSX.Element;
29
46
  * them simply jumps from one height to the other.
30
47
  */
31
48
  declare function TabsPanels(props: TabsPanelsProps): import("react").JSX.Element;
32
- declare function TabsTab({ children, render, ...props }: TabsTabProps): import("react").JSX.Element;
49
+ declare function TabsTab({ badge, children, icon, render, ...props }: TabsTabProps): import("react").JSX.Element;
33
50
  type TabsListProps = TabListProps<object>;
34
51
  type TabsPanelProps = TabPanelProps;
35
52
  type TabsPanelsProps = Omit<TabPanelsProps<object>, 'children'> & {
36
53
  children?: ReactNode;
37
54
  };
38
- type TabsTabProps = TabProps;
55
+ type TabsTabProps = {
56
+ /**
57
+ * A badge on the tab: `true` for the badges page's small dot, a number for
58
+ * the large badge holding it. It sits on a primary tab's icon, and after
59
+ * the label anywhere else. The badge is hidden from assistive technology,
60
+ * so say what it says in the tab's name too — "First item, 3 new".
61
+ */
62
+ badge?: boolean | number;
63
+ /**
64
+ * An icon with the label, at the page's 24dp: over it on a primary tab,
65
+ * whose bar grows to 64dp, and before it on a secondary one. An icon drawn
66
+ * in `em` takes its size from the slot.
67
+ */
68
+ icon?: ReactNode;
69
+ } & TabProps;
39
70
  //#endregion
40
- export { type TabsListProps, type TabsPanelProps, type TabsPanelsProps, type TabsProps$1 as TabsProps, type TabsTabProps, Tabs$1 as default };
71
+ export { type TabsLayout, TabsList, type TabsListProps, TabsPanel, type TabsPanelProps, TabsPanels, type TabsPanelsProps, type TabsProps$1 as TabsProps, TabsTab, type TabsTabProps, type TabsVariant, Tabs$1 as default };
41
72
  //# sourceMappingURL=index.d.ts.map