@7shifts/sous-chef 4.15.0 → 4.16.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 (223) hide show
  1. package/dist/actions/Button/Button.d.ts +5 -1
  2. package/dist/actions/Link/Link.d.ts +7 -0
  3. package/dist/actions/PaginationControls/PaginationControls.d.ts +7 -5
  4. package/dist/actions/Toggle/Toggle.d.ts +2 -0
  5. package/dist/controls/DateFilter/DateFilter.d.ts +16 -1
  6. package/dist/controls/SegmentedControl/SegmentedControl.d.ts +6 -0
  7. package/dist/controls/ToolbarSelect/ToolbarSelect.d.ts +9 -1
  8. package/dist/core/SousChefProvider/SousChefProvider.d.ts +7 -0
  9. package/dist/empty_states/EmptyStateContainer/types.d.ts +16 -2
  10. package/dist/feedback/CircularProgress/CircularProgress.d.ts +1 -0
  11. package/dist/feedback/InlineBanner/InlineBanner.d.ts +1 -0
  12. package/dist/feedback/MicroBanner/MicroBanner.d.ts +1 -0
  13. package/dist/feedback/PersistentBanner/PersistentBanner.d.ts +6 -0
  14. package/dist/feedback/ProgressBar/ProgressBar.d.ts +7 -1
  15. package/dist/feedback/Spinner/Spinner.d.ts +6 -0
  16. package/dist/feedback/Toast/Toast.d.ts +13 -0
  17. package/dist/forms/CheckboxField/CheckboxField.d.ts +4 -0
  18. package/dist/forms/CurrencyField/CurrencyField.d.ts +5 -21
  19. package/dist/forms/DateField/DateField.d.ts +13 -1
  20. package/dist/forms/DateRangeField/DateRangeCalendar/DateRangeCalendar.d.ts +6 -3
  21. package/dist/forms/DateRangeField/DateRangeField.d.ts +17 -3
  22. package/dist/forms/Form/Form.d.ts +13 -2
  23. package/dist/forms/FormFeedback/FormFeedback.d.ts +1 -0
  24. package/dist/forms/FormFooter/FormFooter.d.ts +11 -5
  25. package/dist/forms/FormFooter/FormFooterActions/FormFooterActions.d.ts +2 -5
  26. package/dist/forms/FormFooter/types.d.ts +10 -0
  27. package/dist/forms/FormRow/FormRow.d.ts +6 -0
  28. package/dist/forms/FormSection/FormSection.d.ts +4 -0
  29. package/dist/forms/MultiSelectField/MultiSelectField.d.ts +6 -2
  30. package/dist/forms/NumberField/NumberField.d.ts +4 -0
  31. package/dist/forms/PasswordField/PasswordField.d.ts +3 -0
  32. package/dist/forms/PercentageField/PercentageField.d.ts +13 -0
  33. package/dist/forms/PhoneField/PhoneField.d.ts +10 -0
  34. package/dist/forms/PillSelectField/PillSelectField.d.ts +9 -0
  35. package/dist/forms/PillSelectField/types.d.ts +2 -0
  36. package/dist/forms/RadioGroupBoxOption/RadioGroupBoxOption.d.ts +7 -0
  37. package/dist/forms/RadioGroupField/RadioGroupField.d.ts +8 -1
  38. package/dist/forms/RadioGroupField/RadioGroupFieldContext.d.ts +2 -1
  39. package/dist/forms/RadioGroupOption/RadioGroupOption.d.ts +6 -1
  40. package/dist/forms/SelectField/SelectField.d.ts +20 -3
  41. package/dist/forms/SelectField/types.d.ts +27 -0
  42. package/dist/forms/TextAreaField/TextAreaField.d.ts +7 -1
  43. package/dist/forms/TextField/TextField.d.ts +8 -0
  44. package/dist/forms/TimeField/TimeField.d.ts +23 -1
  45. package/dist/forms/TimeRangeField/TimeRangeField.d.ts +15 -2
  46. package/dist/forms/WeekField/WeekField.d.ts +4 -0
  47. package/dist/forms/WeekSelectField/WeekSelectField.d.ts +4 -0
  48. package/dist/forms/hooks/useRadioGroupFieldControllers.d.ts +1 -2
  49. package/dist/forms/hooks/useSelectFieldControllers.d.ts +2 -2
  50. package/dist/forms/index.d.ts +2 -0
  51. package/dist/foundation/tokens/color/color-constants.d.ts +34 -0
  52. package/dist/foundation/tokens/color/color-types.d.ts +1 -1
  53. package/dist/foundation/tokens/dimension/dimension-tokens.d.ts +1 -0
  54. package/dist/foundation/tokens/layout/TokenTable.d.ts +14 -0
  55. package/dist/foundation/tokens/layout/layout-tokens.d.ts +12 -0
  56. package/dist/hooks/useIsOverflowing.d.ts +2 -0
  57. package/dist/index.css +755 -479
  58. package/dist/index.css.map +1 -1
  59. package/dist/index.d.ts +2 -1
  60. package/dist/index.js +1295 -941
  61. package/dist/index.js.map +1 -1
  62. package/dist/index.modern.js +1431 -1098
  63. package/dist/index.modern.js.map +1 -1
  64. package/dist/ink_illustrations/components/design/Ink3DModeling.d.ts +7 -0
  65. package/dist/ink_illustrations/components/design/index.d.ts +1 -1
  66. package/dist/ink_illustrations/components/index.d.ts +2 -2
  67. package/dist/ink_illustrations/components/other/InkSculptureBust.d.ts +7 -0
  68. package/dist/ink_illustrations/components/other/index.d.ts +1 -1
  69. package/dist/ink_illustrations/components/{design/Ink3DModeling02.d.ts → travel/InkBoardingPass.d.ts} +2 -2
  70. package/dist/ink_illustrations/components/travel/InkVolcano.d.ts +7 -0
  71. package/dist/ink_illustrations/components/travel/index.d.ts +2 -2
  72. package/dist/ink_illustrations/components/weather/InkSun.d.ts +7 -0
  73. package/dist/ink_illustrations/components/weather/index.d.ts +1 -1
  74. package/dist/ink_illustrations/deprecatedAliases.d.ts +27 -0
  75. package/dist/ink_illustrations/index.d.ts +1 -0
  76. package/dist/layout/CalloutCard/CalloutCard.d.ts +1 -0
  77. package/dist/layout/Card/Card.d.ts +14 -0
  78. package/dist/layout/Inline/Inline.d.ts +20 -4
  79. package/dist/layout/Page/Page.d.ts +11 -3
  80. package/dist/layout/Page/PageBreadcrumbs/PageBreadcrumbs.d.ts +2 -2
  81. package/dist/layout/Page/types.d.ts +11 -2
  82. package/dist/layout/PageLayout/PageLayout.d.ts +18 -0
  83. package/dist/layout/PageLayout/types.d.ts +10 -0
  84. package/dist/layout/Stack/Stack.d.ts +16 -4
  85. package/dist/layout/index.d.ts +1 -0
  86. package/dist/lists/Accordion/Accordion.d.ts +10 -0
  87. package/dist/lists/Accordion/types.d.ts +4 -0
  88. package/dist/lists/ActionList/ActionList.d.ts +12 -0
  89. package/dist/lists/ActionList/type.d.ts +5 -0
  90. package/dist/lists/ActionListItem/ActionListItem.d.ts +17 -0
  91. package/dist/lists/BasicTable/BasicTable.d.ts +22 -0
  92. package/dist/lists/BasicTable/BasicTableSectionContext.d.ts +4 -0
  93. package/dist/lists/BasicTable/constants.d.ts +13 -0
  94. package/dist/lists/BasicTable/index.d.ts +1 -0
  95. package/dist/lists/BasicTable/types.d.ts +4 -0
  96. package/dist/lists/BasicTableBody/BasicTableBody.d.ts +9 -0
  97. package/dist/lists/BasicTableBody/index.d.ts +1 -0
  98. package/dist/lists/BasicTableCell/BasicTableCell.d.ts +14 -0
  99. package/dist/lists/BasicTableCell/index.d.ts +1 -0
  100. package/dist/lists/BasicTableHeader/BasicTableHeader.d.ts +9 -0
  101. package/dist/lists/BasicTableHeader/index.d.ts +1 -0
  102. package/dist/lists/BasicTableRow/BasicTableRow.d.ts +9 -0
  103. package/dist/lists/BasicTableRow/index.d.ts +1 -0
  104. package/dist/lists/DataTable/DataTable.d.ts +31 -8
  105. package/dist/lists/DataTable/types.d.ts +35 -0
  106. package/dist/lists/DataTableCell/DataTableCell.d.ts +1 -0
  107. package/dist/lists/DataTableEditableCell/DataTableEditableCell.d.ts +1 -0
  108. package/dist/lists/DataTableRow/DataTableRow.d.ts +12 -0
  109. package/dist/lists/index.d.ts +7 -1
  110. package/dist/media/Avatar/Avatar.d.ts +1 -0
  111. package/dist/media/Badge/Badge.d.ts +7 -2
  112. package/dist/media/Pill/Pill.d.ts +8 -0
  113. package/dist/media/Pill/constants.d.ts +2 -0
  114. package/dist/media/Pill/types.d.ts +3 -1
  115. package/dist/navigation/BreadcrumbItem/BreadcrumbItem.d.ts +1 -0
  116. package/dist/navigation/Breadcrumbs/Breadcrumbs.d.ts +1 -0
  117. package/dist/navigation/PrimaryNav/PrimaryNav.d.ts +1 -0
  118. package/dist/navigation/PrimaryNavFooter/PrimaryNavFooter.d.ts +1 -0
  119. package/dist/navigation/PrimaryNavItem/PrimaryNavItem.d.ts +1 -0
  120. package/dist/navigation/PrimaryNavSubItem/PrimaryNavSubItem.d.ts +1 -0
  121. package/dist/navigation/Tab/Tab.d.ts +1 -0
  122. package/dist/navigation/TabList/TabList.d.ts +1 -0
  123. package/dist/navigation/TabPanel/TabPanel.d.ts +1 -0
  124. package/dist/navigation/Tabs/Tabs.d.ts +1 -0
  125. package/dist/overlay/Calendar/Calendar.d.ts +15 -4
  126. package/dist/overlay/Dropdown/Dropdown.d.ts +1 -0
  127. package/dist/overlay/DropdownListDivider/DropdownListDivider.d.ts +1 -0
  128. package/dist/overlay/DropdownListItem/DropdownListItem.d.ts +1 -0
  129. package/dist/overlay/DropdownListItemSelectable/DropdownListItemSelectable.d.ts +1 -0
  130. package/dist/overlay/DropdownSubmenu/DropdownSubmenu.d.ts +1 -0
  131. package/dist/overlay/HintModal/HintModal.d.ts +1 -0
  132. package/dist/overlay/KebabMenu/types.d.ts +5 -0
  133. package/dist/overlay/Modal/Modal.d.ts +3 -0
  134. package/dist/overlay/Modal/ModalBody/ModalBody.d.ts +1 -0
  135. package/dist/overlay/Modal/ModalFooter/ModalFooter.d.ts +11 -6
  136. package/dist/overlay/Modal/ModalFooter/types.d.ts +10 -0
  137. package/dist/overlay/Popover/Popover.d.ts +8 -1
  138. package/dist/overlay/Tooltip/Tooltip.d.ts +2 -1
  139. package/dist/overlay/index.d.ts +1 -0
  140. package/dist/typography/KeyboardKey/KeyboardKey.d.ts +1 -0
  141. package/dist/typography/Text/Bold/Bold.d.ts +1 -0
  142. package/dist/typography/Text/Italic/Italic.d.ts +1 -0
  143. package/dist/typography/Text/Text.d.ts +23 -0
  144. package/dist/typography/Text/Underline/Underline.d.ts +1 -0
  145. package/dist/utils/formik.d.ts +5 -0
  146. package/llms-instructions/guidelines/ActionList.guidelines.md +1 -3
  147. package/llms-instructions/guidelines/Avatar.guidelines.md +6 -5
  148. package/llms-instructions/guidelines/Badge.guidelines.md +24 -8
  149. package/llms-instructions/guidelines/BasicTable.guidelines.md +80 -0
  150. package/llms-instructions/guidelines/Breadcrumbs.guidelines.md +2 -2
  151. package/llms-instructions/guidelines/Button.guidelines.md +3 -3
  152. package/llms-instructions/guidelines/Calendar.guidelines.md +12 -0
  153. package/llms-instructions/guidelines/Card.guidelines.md +2 -2
  154. package/llms-instructions/guidelines/CircularProgress.guidelines.md +1 -1
  155. package/llms-instructions/guidelines/DateFilter.guidelines.md +2 -2
  156. package/llms-instructions/guidelines/Dropdown.guidelines.md +3 -2
  157. package/llms-instructions/guidelines/EmptyState.guidelines.md +3 -1
  158. package/llms-instructions/guidelines/{Forms.guidelines.md → Form.guidelines.md} +41 -6
  159. package/llms-instructions/guidelines/Icons.guidelines.md +11 -10
  160. package/llms-instructions/guidelines/InkIllustrations.guidelines.md +5 -4
  161. package/llms-instructions/guidelines/Inline.guidelines.md +55 -0
  162. package/llms-instructions/guidelines/InlineBanner.guidelines.md +5 -3
  163. package/llms-instructions/guidelines/MultiSelectField.guidelines.md +2 -2
  164. package/llms-instructions/guidelines/Page.guidelines.md +65 -0
  165. package/llms-instructions/guidelines/PageLayout.guidelines.md +85 -0
  166. package/llms-instructions/guidelines/Paywall.guidelines.md +3 -2
  167. package/llms-instructions/guidelines/PersistentBanner.guidelines.md +2 -2
  168. package/llms-instructions/guidelines/Pill.guidelines.md +31 -3
  169. package/llms-instructions/guidelines/PillSelectField.guidelines.md +1 -1
  170. package/llms-instructions/guidelines/PrimaryNav.guidelines.md +144 -0
  171. package/llms-instructions/guidelines/SegmentedControl.guidelines.md +2 -2
  172. package/llms-instructions/guidelines/Skeleton.guidelines.md +3 -3
  173. package/llms-instructions/guidelines/Spinner.guidelines.md +6 -4
  174. package/llms-instructions/guidelines/Stack.guidelines.md +53 -0
  175. package/llms-instructions/guidelines/Text.guidelines.md +70 -0
  176. package/llms-instructions/guidelines/Toast.guidelines.md +2 -1
  177. package/llms-instructions/guidelines/Toggle.guidelines.md +2 -2
  178. package/llms-instructions/guidelines/ToolbarSelect.guidelines.md +2 -2
  179. package/llms-instructions/guidelines/Tooltip.guidelines.md +1 -1
  180. package/llms-instructions/llms-components.md +91 -19
  181. package/llms-instructions/llms-composing-components.md +583 -219
  182. package/llms-instructions/llms-icons-and-illustrations.md +305 -1011
  183. package/llms-instructions/llms-tokens.md +227 -164
  184. package/llms-instructions/llms.md +12 -28
  185. package/package.json +2 -2
  186. package/dist/ink_illustrations/components/other/InkS/321/201ulptureBust.d.ts +0 -7
  187. package/dist/ink_illustrations/components/travel/InkDrawing.d.ts +0 -7
  188. package/dist/ink_illustrations/components/travel/InkDrawing1.d.ts +0 -7
  189. package/dist/ink_illustrations/components/weather/InkGroup7975.d.ts +0 -7
  190. /package/dist/ink_illustrations/components/{enterteniment → entertainment}/Ink3DGlasses.d.ts +0 -0
  191. /package/dist/ink_illustrations/components/{enterteniment → entertainment}/InkAmusementPark.d.ts +0 -0
  192. /package/dist/ink_illustrations/components/{enterteniment → entertainment}/InkBallet.d.ts +0 -0
  193. /package/dist/ink_illustrations/components/{enterteniment → entertainment}/InkBowling.d.ts +0 -0
  194. /package/dist/ink_illustrations/components/{enterteniment → entertainment}/InkCardGames.d.ts +0 -0
  195. /package/dist/ink_illustrations/components/{enterteniment → entertainment}/InkCarouselWithHorses.d.ts +0 -0
  196. /package/dist/ink_illustrations/components/{enterteniment → entertainment}/InkDiscoBall.d.ts +0 -0
  197. /package/dist/ink_illustrations/components/{enterteniment → entertainment}/InkDj.d.ts +0 -0
  198. /package/dist/ink_illustrations/components/{enterteniment → entertainment}/InkFirecracker.d.ts +0 -0
  199. /package/dist/ink_illustrations/components/{enterteniment → entertainment}/InkJoystick.d.ts +0 -0
  200. /package/dist/ink_illustrations/components/{enterteniment → entertainment}/InkMagicTricks.d.ts +0 -0
  201. /package/dist/ink_illustrations/components/{enterteniment → entertainment}/InkMascarade.d.ts +0 -0
  202. /package/dist/ink_illustrations/components/{enterteniment → entertainment}/InkNotesChart.d.ts +0 -0
  203. /package/dist/ink_illustrations/components/{enterteniment → entertainment}/InkRollerSkating.d.ts +0 -0
  204. /package/dist/ink_illustrations/components/{enterteniment → entertainment}/InkSlotMachine.d.ts +0 -0
  205. /package/dist/ink_illustrations/components/{enterteniment → entertainment}/InkTheatre.d.ts +0 -0
  206. /package/dist/ink_illustrations/components/{enterteniment → entertainment}/index.d.ts +0 -0
  207. /package/dist/ink_illustrations/components/{sciency → science}/InkAnatomy.d.ts +0 -0
  208. /package/dist/ink_illustrations/components/{sciency → science}/InkAsteroid.d.ts +0 -0
  209. /package/dist/ink_illustrations/components/{sciency → science}/InkAstronaut.d.ts +0 -0
  210. /package/dist/ink_illustrations/components/{sciency → science}/InkBacteria.d.ts +0 -0
  211. /package/dist/ink_illustrations/components/{sciency → science}/InkChemistry.d.ts +0 -0
  212. /package/dist/ink_illustrations/components/{sciency → science}/InkDna.d.ts +0 -0
  213. /package/dist/ink_illustrations/components/{sciency → science}/InkLabTube.d.ts +0 -0
  214. /package/dist/ink_illustrations/components/{sciency → science}/InkMicroChips.d.ts +0 -0
  215. /package/dist/ink_illustrations/components/{sciency → science}/InkMicroscope.d.ts +0 -0
  216. /package/dist/ink_illustrations/components/{sciency → science}/InkNewtonsCradle.d.ts +0 -0
  217. /package/dist/ink_illustrations/components/{sciency → science}/InkNuclearEnergy.d.ts +0 -0
  218. /package/dist/ink_illustrations/components/{sciency → science}/InkPlanet.d.ts +0 -0
  219. /package/dist/ink_illustrations/components/{sciency → science}/InkPlantInTube.d.ts +0 -0
  220. /package/dist/ink_illustrations/components/{sciency → science}/InkRobotics.d.ts +0 -0
  221. /package/dist/ink_illustrations/components/{sciency → science}/InkSpaceTravel.d.ts +0 -0
  222. /package/dist/ink_illustrations/components/{sciency → science}/InkTelescope.d.ts +0 -0
  223. /package/dist/ink_illustrations/components/{sciency → science}/index.d.ts +0 -0
@@ -2,26 +2,40 @@ import React from 'react';
2
2
  import type { DataTableColumn, DataTableCustomComponent, DataTableEmptyState as DataTableEmptyStateType, DataTableItem, DataTableSort, StickyColumns } from './types';
3
3
  import type { DataProps, PositionStyles } from '../../foundation/types';
4
4
  type Props<T> = {
5
- /** Each element represents a row and each key of the object represents a column */
5
+ /** Each element represents a row and each key of the object represents a column. An item can also have `actions` (`DataTableAction[]`, see `DataTableRow` for the shape), shown by the default item component when `showActionMenu` is set; a custom `itemComponent` must pass them to `DataTableRow` itself. An item can also have a `key` used as the React key. */
6
6
  items: DataTableItem<T>[];
7
- /** For each column element, the `name` property should match the key on `items` */
7
+ /**
8
+ * Column definitions. Each `DataTableColumn` is an object with:
9
+ * - `name` (required): unique key. With the default item component it must match the key on `items`. It is also the `columnName` sent to `onSort`.
10
+ * - `label`: header text. If no column has a label, the header row is hidden and columns only define sizes.
11
+ * - `size`: relative width compared to the other columns (defaults to `1`).
12
+ * - `isRightAligned`: right-aligns the header and the `DataTableCell`/`DataTableEditableCell` cells of the column, e.g. for numbers.
13
+ * - `isSortable`: clicking the header calls `onSort`.
14
+ * - `currentSort`: `'asc' | 'desc' | null`. The table does not keep sort state: pass the direction received in `onSort` back in on the matching column for sorting to work.
15
+ * - `reverseSortOrder`: cycle `asc` → `desc` → none instead of `desc` → `asc` → none.
16
+ * - `hidden`: hides the column (the header and the cells rendered with `DataTableCell`).
17
+ * - `description`: tooltip text shown when hovering the header label.
18
+ */
8
19
  columns?: DataTableColumn[];
9
- /** A custom component for customizing how the each item is rendered. It pass as props: `item`, `index`, `columnSizes` and `columns` */
20
+ /** A custom component to customize how each item is rendered, usually built with `DataTableRow` and `DataTableCell`. It receives `DataTableCustomComponent` props: `item`, `index`, `columns` and `testId`. */
10
21
  itemComponent?: React.ComponentType<DataTableCustomComponent<T>>;
11
22
  /** The layout of how the table will look like when loading the data */
12
23
  skeletonRowLayout?: React.ReactNode;
24
+ /** Maximum height of the table in pixels. When set, the rows scroll vertically inside the table. */
13
25
  maxHeight?: number;
14
- /** Used for pagination */
26
+ /** Enables the `Previous` pagination button. Defaults to `true`, so pass `false` on the first page. When both `hasPrevious` and `hasNext` are `false` the pagination controls are hidden. */
15
27
  hasPrevious?: boolean;
16
- /** Used for pagination */
28
+ /** Enables the `Next` pagination button. Defaults to `true`, so pass `false` on the last page. When both `hasPrevious` and `hasNext` are `false` the pagination controls are hidden. */
17
29
  hasNext?: boolean;
18
- /** Used for pagination */
30
+ /** Called when the `Previous` pagination button is clicked (or J is pressed, see `PaginationControls`). Pagination controls render below the table only when both `onPreviousClick` and `onNextClick` are set. */
19
31
  onPreviousClick?: () => void;
20
- /** Used for pagination */
32
+ /** Called when the `Next` pagination button is clicked (or K is pressed, see `PaginationControls`). Pagination controls render below the table only when both `onPreviousClick` and `onNextClick` are set. */
21
33
  onNextClick?: () => void;
34
+ /** Shows the loading state. With no previously rendered items it shows skeleton rows (see `skeletonRowLayout`); otherwise it keeps showing the previous items with a spinner and disables pagination. */
22
35
  isLoading?: boolean;
23
- /** It is fired when a sorted column is clicked to be sorted */
36
+ /** Called with a `DataTableSort` (`{ columnName, direction }`) when a sortable column header is clicked. Sort your data and pass `direction` back as that column's `currentSort`. */
24
37
  onSort?: (sort: DataTableSort) => void;
38
+ /** Adds an actions column at the end of each row, where `DataTableRow` renders its `actions` (`DataTableAction[]`) as buttons or in a kebab menu. Required for any row actions to show. The default item component passes `item.actions` to `DataTableRow`; a custom `itemComponent` must pass the actions to `DataTableRow` itself. */
25
39
  showActionMenu?: boolean;
26
40
  /** Will render footer component if not null - expects a custom RowItem component */
27
41
  footerComponent?: React.ReactNode;
@@ -31,6 +45,15 @@ type Props<T> = {
31
45
  testId?: string;
32
46
  /** Used to make the left, rigth or both edge columns sticky */
33
47
  stickyColumns?: StickyColumns;
48
+ /**
49
+ * Content shown when there are no items and the table is not loading. A `DataTableEmptyState` object:
50
+ * - `title` (required): `string`.
51
+ * - `caption` (required): `string` shown below the title.
52
+ * - `image`: URL of an image to show instead of the default illustration.
53
+ * - `actions`: `{ primary?: <Button />, secondary?: <Button /> }`.
54
+ *
55
+ * Defaults to a generic "no results" message.
56
+ */
34
57
  emptyState?: DataTableEmptyStateType;
35
58
  } & DataProps & PositionStyles;
36
59
  /**
@@ -1,31 +1,55 @@
1
1
  import React from 'react';
2
2
  import Button from '../../actions/Button/Button';
3
3
  import { MenuAction } from '../../overlay/KebabMenu/types';
4
+ /**
5
+ * A DataTable column. Example: `{ name: 'wage', label: 'Wage', size: 2, isSortable: true, currentSort: 'asc', isRightAligned: true }`
6
+ */
4
7
  export type DataTableColumn = {
8
+ /** Unique column key. With the default item component it must match the key of the value in each item. It is also the `columnName` sent to `onSort`. */
5
9
  name: string;
10
+ /** Header text. When no column has a label, the header row is not rendered and the columns only define the sizes. */
6
11
  label?: React.ReactNode;
12
+ /** Relative width of the column compared to the others (defaults to `1`). For example, sizes `2` and `1` make the first column twice as wide as the second. */
7
13
  size?: number;
14
+ /** When `true`, clicking the header calls `onSort` with the next sort direction. */
8
15
  isSortable?: boolean;
16
+ /**
17
+ * Current sort direction of this column: `'asc'`, `'desc'` or `null`. The table does not keep sort state: store the `DataTableSort` received in `onSort` and pass it back here on the matching column, otherwise the sort icon won't update and every click sends the same direction.
18
+ */
9
19
  currentSort?: DataTableSortDirection;
20
+ /** Right-aligns the header and the cells of this column rendered with `DataTableCell` or `DataTableEditableCell`. Use it for numeric columns. */
10
21
  isRightAligned?: boolean;
22
+ /** When `true` the column is not rendered. Hides the header and the body cells rendered with `DataTableCell`; custom item components must use `DataTableCell` for this to apply. */
11
23
  hidden?: boolean;
24
+ /** Changes the order sort directions cycle through on click. By default it is `desc` → `asc` → none; when `true` it is `asc` → `desc` → none. */
12
25
  reverseSortOrder?: boolean;
26
+ /** Text shown in a tooltip when hovering the header label. */
13
27
  description?: string;
14
28
  };
15
29
  export type DataTableSortDirection = 'asc' | 'desc' | null;
30
+ /** Sent to `onSort` when a sortable column header is clicked. */
16
31
  export type DataTableSort = {
32
+ /** The `name` of the clicked column. */
17
33
  columnName: string;
34
+ /** The next sort direction: `'asc'`, `'desc'` or `null` (sort removed). */
18
35
  direction: DataTableSortDirection;
19
36
  };
37
+ /** A row of the table: your item object, plus optional `actions` for the row action menu and a `key` used as the React key. */
20
38
  export type DataTableItem<T> = (T & {
21
39
  actions?: DataTableAction[];
22
40
  key?: string | number | null;
23
41
  });
42
+ /** Props received by the component passed to `itemComponent`. */
24
43
  export type DataTableCustomComponent<T> = {
44
+ /** The item to render. */
25
45
  item: DataTableItem<T>;
46
+ /** Index of the item in `items`. */
26
47
  index: number;
48
+ /** Not currently passed by `DataTable`. */
27
49
  columnSizes?: number[];
50
+ /** The `columns` passed to the table. */
28
51
  columns?: DataTableColumn[];
52
+ /** The `testId` passed to the table. */
29
53
  testId?: string;
30
54
  };
31
55
  type KebabAction = {
@@ -35,14 +59,25 @@ type ButtonAction = {
35
59
  buttonProps?: Pick<React.ComponentPropsWithoutRef<typeof Button>, 'theme' | 'disabled' | 'loading' | 'title'>;
36
60
  showInKebab: false;
37
61
  } & MenuAction;
62
+ /**
63
+ * A row action, set on `item.actions` (requires `showActionMenu`). An object with `action` (unique key), `label`, `onAction` and optional `hidden` (only applies to kebab menu actions). Actions go in the row kebab menu by default; set `showInKebab: false` to show the action as a button instead, styled with `buttonProps` (`theme`, `disabled`, `loading`, `title`).
64
+ */
38
65
  export type DataTableAction = KebabAction | ButtonAction;
39
66
  export type DataTableState = 'CONTENT' | 'SKELETON_LOADING' | 'BACKGROUND_LOADING' | 'EMPTY';
40
67
  export type StickyColumns = 'left' | 'right' | 'both';
41
68
  export type ScrollState = 'NO_SCROLL' | 'SCROLLABLE_CONTENT_ON_BOTH_SIDES' | 'SCROLLABLE_CONTENT_ON_LEFT' | 'SCROLLABLE_CONTENT_ON_RIGHT';
69
+ /**
70
+ * Custom content shown when the table has no items and is not loading.
71
+ * Example: `{ title: 'No employees yet', caption: 'Add your first employee to get started.' }`
72
+ */
42
73
  export type DataTableEmptyState = {
74
+ /** Title of the empty state. */
43
75
  title: string;
76
+ /** Body text below the title. Required. */
44
77
  caption: string;
78
+ /** URL of an image to show instead of the default illustration. */
45
79
  image?: string;
80
+ /** Buttons shown below the caption: `{ primary?: <Button />, secondary?: <Button /> }`. */
46
81
  actions?: {
47
82
  primary?: React.ReactElement;
48
83
  secondary?: React.ReactElement;
@@ -1,5 +1,6 @@
1
1
  import React, { ReactNode } from 'react';
2
2
  type Props = {
3
+ /** Content of the cell. */
3
4
  children: React.ReactNode;
4
5
  columnIndex: number;
5
6
  error?: ReactNode | string;
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
2
  type Props = {
3
+ /** Field name. Inside a Sous Chef `Form` it binds the field to Formik: the field reads its value and error from the Formik key with this name and writes changes back to it. An `error` you pass overrides the Formik error, a `value` you pass overrides the Formik value, and an `onChange` you pass replaces the Formik update, so call `formik.setFieldValue` yourself if you still need it. Nested paths such as `address.city` or `shifts[0].start` work. Also used to generate the `id` when none is given. */
3
4
  name: string;
4
5
  columnIndex: number;
5
6
  rowIndex: number;
@@ -1,9 +1,21 @@
1
1
  import React from 'react';
2
2
  import type { DataTableAction } from '../DataTable/types';
3
3
  type Props = {
4
+ /** The row cells, usually `DataTableCell` elements, one per column. */
4
5
  children: React.ReactNode;
5
6
  onClick?: () => void;
6
7
  isSelected?: boolean;
8
+ /**
9
+ * Row actions, shown in the actions column added by the `DataTable` `showActionMenu` prop (nothing shows without it). An array of `DataTableAction` objects:
10
+ * - `action` (required): unique key.
11
+ * - `label` (required): content of the menu item or button, such as text or an icon.
12
+ * - `onAction` (required): called when the action is clicked.
13
+ * - `showInKebab`: actions go in the row kebab menu by default; set `false` to show the action as a button instead.
14
+ * - `buttonProps`: `theme`, `disabled`, `loading` and `title` for the button when `showInKebab` is `false`. The button uses the `default` theme for text labels and `link-icon` otherwise.
15
+ * - `hidden`: when `true` the action is not shown in the kebab menu.
16
+ *
17
+ * Example: `[{ action: 'edit', label: 'Edit', onAction: () => {}, showInKebab: false }, { action: 'delete', label: 'Delete', onAction: () => {} }]`.
18
+ */
7
19
  actions?: DataTableAction[];
8
20
  /**
9
21
  * @deprecated This should lo longer have any effect since the DataTableCell controls the padding
@@ -6,6 +6,12 @@ import { useDataTableContext } from './DataTable/DataTableContext';
6
6
  import Accordion from './Accordion';
7
7
  import ActionList from './ActionList';
8
8
  import ActionListItem from './ActionListItem';
9
- export { DataTable, DataTableRow, DataTableCell, DataTableEditableCell, useDataTableContext, Accordion, ActionList, ActionListItem };
9
+ import BasicTable from './BasicTable';
10
+ import BasicTableHeader from './BasicTableHeader';
11
+ import BasicTableBody from './BasicTableBody';
12
+ import BasicTableRow from './BasicTableRow';
13
+ import BasicTableCell from './BasicTableCell';
14
+ export { DataTable, DataTableRow, DataTableCell, DataTableEditableCell, useDataTableContext, Accordion, ActionList, ActionListItem, BasicTable, BasicTableHeader, BasicTableBody, BasicTableRow, BasicTableCell };
10
15
  export type { DataTableColumn, DataTableCustomComponent, DataTableSortDirection, DataTableSort, DataTableAction } from './DataTable/types';
11
16
  export type { AccordionItem } from './Accordion/types';
17
+ export type { BasicTableTheme, BasicTableSize } from './BasicTable/types';
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
2
  type Props = {
3
+ /** Content shown inside the avatar instead of the image, such as initials or an icon. */
3
4
  children?: React.ReactNode;
4
5
  size?: 'small' | 'medium' | 'large' | 'extra-large';
5
6
  color?: string;
@@ -1,7 +1,12 @@
1
1
  import React from 'react';
2
2
  type Props = {
3
- children: React.ReactNode;
4
- theme?: 'success' | 'danger' | 'warning' | 'info';
3
+ /** Content of the badge: a short text, a number or an icon. Ignored when `size` is `small`. */
4
+ children?: React.ReactNode;
5
+ theme?: 'success' | 'danger' | 'warning' | 'info' | 'neutral' | 'upsell' | 'disabled';
6
+ /** `small` renders a dot with no content instead of the regular badge. */
7
+ size?: 'small' | 'default';
8
+ /** Adds a 1px stroke around the badge. Uses `--color-surface-color`, or `--color-outline` for the `disabled` theme. */
9
+ hasBorder?: boolean;
5
10
  /** This will show a black tooltip when the user hover the badge */
6
11
  title?: string;
7
12
  testId?: string;
@@ -2,8 +2,16 @@ import type { ReactNode } from 'react';
2
2
  import React from 'react';
3
3
  import { PillTheme } from './types';
4
4
  type Props = {
5
+ /** Text of the pill. Keep it short. */
5
6
  children: ReactNode;
7
+ /** Colour theme of the pill. `default` is a deprecated alias of `neutral`. */
6
8
  theme?: PillTheme;
9
+ /** Shows a `Badge` dot in the pill's theme before the text. Use it instead of an icon. */
10
+ hasStatus?: boolean;
11
+ /** Makes the pill clickable, with hover and active states. Clicking an interactive pill toggles its active state on and off; clicking outside it turns it off. Pills are static by default. */
12
+ isInteractive?: boolean;
13
+ /** Called when an interactive pill is clicked, or activated with Enter or Space. */
14
+ onClick?: (event: React.MouseEvent<HTMLDivElement> | React.KeyboardEvent<HTMLDivElement>) => void;
7
15
  testId?: string;
8
16
  };
9
17
  /**
@@ -3,6 +3,8 @@ export declare const PILL_THEME: {
3
3
  SUCCESS: "success";
4
4
  DANGER: "danger";
5
5
  WARNING: "warning";
6
+ NEUTRAL: "neutral";
7
+ /** @deprecated Use `NEUTRAL` instead. */
6
8
  DEFAULT: "default";
7
9
  UPSELL: "upsell";
8
10
  };
@@ -1 +1,3 @@
1
- export type PillTheme = 'info' | 'success' | 'danger' | 'warning' | 'upsell' | 'default';
1
+ export type PillTheme = 'info' | 'success' | 'danger' | 'warning' | 'upsell' | 'neutral'
2
+ /** @deprecated Use `neutral` instead. */
3
+ | 'default';
@@ -4,6 +4,7 @@ type Props = {
4
4
  /** When `true` it will skip client side routing and let the browser handle the transition normally (as if it were an `<a href>`). */
5
5
  reloadDocument?: boolean;
6
6
  testId?: string;
7
+ /** Text of the breadcrumb link. */
7
8
  children: React.ReactNode;
8
9
  };
9
10
  declare const BreadcrumbItem: ({ href, reloadDocument, testId, children }: Props) => React.JSX.Element;
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
2
  type Props = {
3
+ /** One or more `BreadcrumbItem` elements. */
3
4
  children: React.ReactNode;
4
5
  };
5
6
  /**
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
2
  type Props = {
3
+ /** Navigation items: `PrimaryNavItem` and `PrimaryNavDivider` elements. Pass `PrimaryNavFooter` through `footer` instead. */
3
4
  children: React.ReactNode;
4
5
  isExpanded?: boolean;
5
6
  onToggleExpand?: (state: 'expanded' | 'collapsed') => void;
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
2
  type Props = {
3
+ /** Items pinned to the bottom of the navigation, usually `PrimaryNavItem` elements. */
3
4
  children: React.ReactNode;
4
5
  };
5
6
  declare const PrimaryNavFooter: ({ children }: Props) => React.JSX.Element;
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
2
  import { DataProps } from '../../foundation/types';
3
3
  type Props = {
4
+ /** Optional `PrimaryNavSubItem` elements shown as a submenu of this item. */
4
5
  children?: React.ReactNode;
5
6
  icon: React.ReactNode;
6
7
  isActive?: boolean;
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
2
  import { DataProps } from '../../foundation/types';
3
3
  type Props = {
4
+ /** Text of the sub item. */
4
5
  children: React.ReactNode;
5
6
  isActive?: boolean;
6
7
  badge?: string | number;
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
2
  type Props = {
3
+ /** Label of the tab. */
3
4
  children: React.ReactNode;
4
5
  value: string;
5
6
  disabled?: boolean;
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
2
  type Props = {
3
+ /** The `Tab` elements. */
3
4
  children: React.ReactNode;
4
5
  'aria-label'?: string;
5
6
  };
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
2
  type Props = {
3
+ /** Content shown when the matching tab is selected. */
3
4
  children: React.ReactNode;
4
5
  value: string;
5
6
  forceMount?: boolean;
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
2
  type Props = {
3
+ /** A `TabList` with the tabs and one `TabPanel` per tab. Panels are matched to tabs by `value`, so they can live anywhere inside `Tabs`. */
3
4
  children: React.ReactNode;
4
5
  value?: string;
5
6
  defaultValue?: string;
@@ -12,12 +12,23 @@ type Props = {
12
12
  initialMonth?: Date;
13
13
  onSelect: (selected: Date) => void;
14
14
  onClickOutside: () => void;
15
- /** It disable some dates so the user can't click on them. Refer to this
16
- * [doc](https://react-day-picker-v7.netlify.app/api/DayPicker#disabledDays) to see what
17
- * values you can use. */
15
+ /** Dates the user can't select. Takes a react-day-picker v8
16
+ * [`Matcher`](https://daypicker.dev/v8/api/type-aliases/Matcher) or an array of them:
17
+ * a `Date`, an array of dates, `{ from, to }`, `{ before }`, `{ after }`,
18
+ * `{ dayOfWeek: number[] }` (0 is Sunday) or a `(date: Date) => boolean` function.
19
+ * v7 shapes such as `{ daysOfWeek }` don't match anything.
20
+ * Example: `[{ before: new Date() }, { dayOfWeek: [0, 6] }]` disables past dates and weekends. */
18
21
  disabledDays?: BlockedDays;
19
22
  /** Highlight one or more groups of dates, each with its own shape, colour
20
- * theme, and legend label, e.g. pay days or holidays. */
23
+ * theme, and legend label, e.g. pay days or holidays.
24
+ *
25
+ * Each `HighlightGroup` is an object with:
26
+ * - `dates` (required): `Matcher | Matcher[]` from react-day-picker: a `Date`, an array of dates, a `{ from, to }` range, `{ dayOfWeek: number[] }` or a `(date: Date) => boolean` function. Helpers such as `nthWeekdayOfMonth`, `everyOtherWeekday`, `firstOfMonth` and `lastOfMonth` build common patterns.
27
+ * - `label` (required): `string` shown in the legend, e.g. "Pay Days".
28
+ * - `theme`: `'success' | 'danger' | 'warning' | 'info' | 'upsell' | 'neutral'`. Defaults to `'success'`.
29
+ * - `shape`: `'circle' | 'circle-dashed' | 'square' | 'square-dashed' | 'octagon' | 'star'`. Defaults to `'circle'`.
30
+ *
31
+ * When a day matches more than one group, the first group wins. */
21
32
  highlightedDays?: HighlightGroup[] | HighlightGroup;
22
33
  anchorRef: MutableRefObject<HTMLElement | null>;
23
34
  testId?: string;
@@ -9,6 +9,7 @@ type Props = {
9
9
  triggersOn?: DropdownTrigger;
10
10
  alignment?: DropdownAlignment;
11
11
  testId?: string;
12
+ /** Content of the dropdown, usually a `DropdownList` with `DropdownListItem` elements. */
12
13
  children: React.ReactNode;
13
14
  triggerWidth?: 'full' | 'restricted';
14
15
  /** Sets the z-index of the dropdown menu pane */
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
2
  type Props = {
3
3
  testId?: string;
4
+ /** Optional title shown in the divider, used to label a group of items. */
4
5
  children?: React.ReactNode;
5
6
  line?: 'top' | 'bottom' | 'both';
6
7
  };
@@ -8,6 +8,7 @@ type Props = {
8
8
  selected?: boolean;
9
9
  disabled?: boolean;
10
10
  testId?: string;
11
+ /** Content of the item, usually its label. */
11
12
  children: React.ReactNode;
12
13
  /** Setting an `href` on `DropdownListItem` will configure it to behave as a link. */
13
14
  href?: string;
@@ -5,6 +5,7 @@ type Props = {
5
5
  selected?: boolean;
6
6
  disabled?: boolean;
7
7
  testId?: string;
8
+ /** Content of the item, usually its label. */
8
9
  children: React.ReactNode;
9
10
  };
10
11
  declare const DropdownListItemSelectable: ({ onClick, caption, selected, disabled, testId, children }: Props) => React.JSX.Element;
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
2
  type Props = {
3
+ /** The submenu items, usually `DropdownListItem` elements. */
3
4
  children: React.ReactNode;
4
5
  direction: 'left' | 'right';
5
6
  openSubmenu: () => void;
@@ -2,6 +2,7 @@ import React, { ReactNode } from 'react';
2
2
  import { PositionStyles } from '../../foundation/types';
3
3
  export type Props = {
4
4
  header: ReactNode;
5
+ /** Body content of the hint modal, shown below the header. */
5
6
  children?: ReactNode;
6
7
  mediaUrl?: string;
7
8
  onClose: () => void;
@@ -1,6 +1,11 @@
1
+ /** An item of a kebab (more actions) menu. */
1
2
  export type MenuAction = {
3
+ /** Unique key of the action. */
2
4
  action: string;
5
+ /** Content shown in the menu, such as text or an icon. */
3
6
  label: React.ReactNode;
7
+ /** Called when the item is clicked or selected with the keyboard. */
4
8
  onAction: (e: React.MouseEvent | React.KeyboardEvent) => void;
9
+ /** When `true` the item is not shown in the menu. */
5
10
  hidden?: boolean;
6
11
  };
@@ -2,8 +2,11 @@ import React from 'react';
2
2
  import { ZIndex } from '../../foundation/tokens/zindex/z-index-types';
3
3
  import type { DataProps } from '../../foundation/types';
4
4
  type Props = {
5
+ /** Content of the modal, usually a `ModalBody` followed by a `ModalFooter`. */
5
6
  children: React.ReactNode;
7
+ /** Title of the modal, shown at the top below the close button. With `draggable`, the user drags the modal by its header. */
6
8
  header?: React.ReactNode;
9
+ /** Secondary text shown below the `header`, e.g. the name of the record the modal acts on. */
7
10
  subHeader?: React.ReactNode;
8
11
  /** Called when the user closes the modal, can be undefined to create a non-closable loading modal */
9
12
  onClose?: () => void;
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
2
  type Props = {
3
+ /** Content of the modal body. */
3
4
  children: React.ReactNode;
4
5
  testId?: string;
5
6
  };
@@ -1,12 +1,17 @@
1
1
  import React from 'react';
2
+ import type { ModalFooterActions } from './types';
2
3
  type Props = {
4
+ /** Custom footer content. Use it instead of `actions` when you need more flexibility. */
3
5
  children?: React.ReactNode;
4
- /** This will streamline the button creation and all the design pattern applied on buttons with a modal footer. If you want more flexibility to build the footer you can pass a `children` instead of using the `actions` prop. */
5
- actions?: {
6
- primary?: React.ReactElement;
7
- secondary?: React.ReactElement;
8
- tertiary?: React.ReactElement;
9
- };
6
+ /**
7
+ * The footer buttons, laid out and styled for you. A `ModalFooterActions` object with optional `primary`, `secondary` and `tertiary` keys, each a `Button` element, e.g. `{ primary: <Button>Save</Button>, secondary: <Button>Cancel</Button> }`.
8
+ * - `primary`: shown on the far right with the `primary` theme.
9
+ * - `secondary`: shown to the left of the primary button with the `default` theme.
10
+ * - `tertiary`: shown on the far left with the `link-primary` theme.
11
+ *
12
+ * A `theme` you set on the button wins over these, e.g. `<Button theme="danger">Delete</Button>` for a destructive confirm. Every button gets a minimum width of 100px. To submit a form, wrap the `ModalBody` and `ModalFooter` in a `Form` with `stackContent={false}` (so it does not add a `Stack` around them) and set `type="submit"` on the primary button yourself. Pass `children` instead when you need a custom footer.
13
+ */
14
+ actions?: ModalFooterActions;
10
15
  testId?: string;
11
16
  };
12
17
  declare const ModalFooter: ({ children, actions, testId }: Props) => React.JSX.Element;
@@ -0,0 +1,10 @@
1
+ import type { ReactElement } from 'react';
2
+ /** The buttons of a `ModalFooter`, passed through its `actions` prop. */
3
+ export type ModalFooterActions = {
4
+ /** Main action, e.g. "Save". Rendered on the far right with the `primary` theme. */
5
+ primary?: ReactElement;
6
+ /** Rendered to the left of the primary button with the `default` theme, e.g. "Cancel". */
7
+ secondary?: ReactElement;
8
+ /** Rendered on the far left of the footer with the `link-primary` theme. */
9
+ tertiary?: ReactElement;
10
+ };
@@ -3,15 +3,22 @@ import { ZIndex } from '../../foundation/tokens/zindex/z-index-types';
3
3
  import { DropdownAlignment, DropdownTrigger } from '../Dropdown/types';
4
4
  import React from 'react';
5
5
  type Props = {
6
+ /** Element that opens the popover, usually a `Button`. Elements other than `Button` or `<button>` are wrapped in a `<button>`. */
6
7
  trigger: React.ReactElement & RefAttributes<unknown>;
8
+ /** Width of the popover in pixels. By default it fits its content. */
7
9
  width?: number;
10
+ /** Maximum height of the popover in pixels. Content beyond it scrolls. */
8
11
  maxHeight?: number;
12
+ /** Whether the popover opens on `click` (default) or `hover`. Prefer `click`. */
9
13
  triggersOn?: DropdownTrigger;
14
+ /** Which edge of the trigger the popover aligns to: `left` or `right` (default). */
10
15
  alignment?: DropdownAlignment;
11
16
  testId?: string;
17
+ /** Content of the popover. It is an empty canvas, so it can hold any content, including interactive elements. */
12
18
  children: React.ReactNode;
19
+ /** `full` makes the trigger wrapper take the full width of its container; otherwise it fits the trigger. */
13
20
  triggerWidth?: 'full' | 'restricted';
14
- /** Sets the z-index of the dropdown menu pane */
21
+ /** Sets the z-index of the popover. Accepts a number or a z-index token name. */
15
22
  zIndex?: number | ZIndex;
16
23
  };
17
24
  /**
@@ -11,7 +11,7 @@ type Props = {
11
11
  placement?: Placement;
12
12
  /** It can be text or a JSX. */
13
13
  overlay?: React.ReactNode;
14
- /** Used on the `white` theme when there is a need of adding a header to the tooltip. */
14
+ /** A header shown above the `overlay` content. Works with any theme. The tooltip only opens when `overlay` is also set. */
15
15
  header?: React.ReactNode;
16
16
  /** If `true` it allow the overlay to keep open if the user hover it so, user can iteract with it (click on a link or copy the text). */
17
17
  delayOnClose?: boolean;
@@ -20,6 +20,7 @@ type Props = {
20
20
  extraClass?: string;
21
21
  onClose?: () => void;
22
22
  onVisibleChange?: (isVisible: boolean) => void;
23
+ /** The element that shows the tooltip on hover or focus. A single DOM element (e.g. `<span>`) is used as the anchor directly; anything else, including components such as `Button`, is wrapped in a `div`. */
23
24
  children: React.ReactNode;
24
25
  testId?: string;
25
26
  maxHeight?: string | number;
@@ -12,4 +12,5 @@ import HintModal from './HintModal';
12
12
  import Popover from './Popover';
13
13
  export { useModalPosition } from './Modal/useModalPosition';
14
14
  export type { ModalPosition } from './Modal/useModalPosition';
15
+ export type { ModalFooterActions } from './Modal/ModalFooter/types';
15
16
  export { Tooltip, Modal, ModalBody, ModalFooter, Calendar, Dropdown, DropdownList, DropdownListDivider, DropdownListItem, DropdownListItemSelectable, HintModal, Popover };
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
2
  type Props = {
3
+ /** The key label, e.g. `Ctrl` or `K`. */
3
4
  children?: string;
4
5
  theme?: 'dark' | 'light';
5
6
  };
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
2
  type Props = {
3
+ /** Text to show in bold. */
3
4
  children: React.ReactNode;
4
5
  };
5
6
  declare const Bold: ({ children }: Props) => React.JSX.Element;
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
2
  type Props = {
3
+ /** Text to show in italic. */
3
4
  children: React.ReactNode;
4
5
  };
5
6
  declare const Italic: ({ children }: Props) => React.JSX.Element;
@@ -1,13 +1,36 @@
1
1
  import React from 'react';
2
2
  import { DataProps, PositionStyles } from '../../foundation/types';
3
3
  import { TextType, Emphasis, Alignment } from './types';
4
+ /**
5
+ * The Text component is used to format text style, size, line spacing, alignment, and color. Use it for any text that is not covered by another component's props, instead of raw `p`, `span` or `h1`-`h5` elements, e.g. `<Text as="h1">Title</Text>`.
6
+ */
4
7
  declare const Text: React.ForwardRefExoticComponent<{
8
+ /** The text to display. It can include inline elements such as `Bold`, `Italic`, `Underline` or links. */
5
9
  children: React.ReactNode;
10
+ /**
11
+ * Sets the element type and the matching text style:
12
+ * - `h1` to `h5`: headings, rendered as the same HTML heading element.
13
+ * - `body` (default): standard UI text (13px), rendered as `<p>`.
14
+ * - `paragraph`: long-form reading text (14px), rendered as `<p>`.
15
+ * - `caption`: small secondary text (11px), rendered as `<p>`.
16
+ * - `insight`: large text (28px) for highlighting key numbers or metrics, rendered as `<p>`.
17
+ * - `tagline`: large text (24px) for short headlines such as empty state titles, rendered as `<p>`.
18
+ * - `span`: body-styled inline text, rendered as `<span>`.
19
+ */
6
20
  as?: TextType | undefined;
21
+ /**
22
+ * Text emphasis. A single value or an array to combine several, e.g. `['bold', 'italic']`:
23
+ * - `bold`, `italic`, `underline`, `strikethrough`: the usual font styles.
24
+ * - `dotted-underline`: dotted underline, commonly used to signal that hovering the text shows a tooltip.
25
+ * - `monospace`: tabular (fixed-width) numbers, so digits line up in columns. It does not change the font of letters.
26
+ */
7
27
  emphasis?: Emphasis | Emphasis[] | undefined;
28
+ /** Horizontal alignment of the text: `left`, `right`, `center` or `justify`. */
8
29
  alignment?: Alignment | undefined;
30
+ /** Text color. Prefer a color token name (e.g. `surface-on-color-subtle`); any CSS color string also works. Defaults to the inherited color. */
9
31
  color?: string | undefined;
10
32
  testId?: string | undefined;
33
+ /** Set `nowrap` to keep the text on a single line. */
11
34
  textWrap?: "wrap" | "nowrap" | undefined;
12
35
  } & PositionStyles & DataProps & React.RefAttributes<HTMLElement>>;
13
36
  export default Text;
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
2
  type Props = {
3
+ /** Text to underline. */
3
4
  children: React.ReactNode;
4
5
  };
5
6
  declare const Underline: ({ children }: Props) => React.JSX.Element;