@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.
- package/dist/actions/Button/Button.d.ts +5 -1
- package/dist/actions/Link/Link.d.ts +7 -0
- package/dist/actions/PaginationControls/PaginationControls.d.ts +7 -5
- package/dist/actions/Toggle/Toggle.d.ts +2 -0
- package/dist/controls/DateFilter/DateFilter.d.ts +16 -1
- package/dist/controls/SegmentedControl/SegmentedControl.d.ts +6 -0
- package/dist/controls/ToolbarSelect/ToolbarSelect.d.ts +9 -1
- package/dist/core/SousChefProvider/SousChefProvider.d.ts +7 -0
- package/dist/empty_states/EmptyStateContainer/types.d.ts +16 -2
- package/dist/feedback/CircularProgress/CircularProgress.d.ts +1 -0
- package/dist/feedback/InlineBanner/InlineBanner.d.ts +1 -0
- package/dist/feedback/MicroBanner/MicroBanner.d.ts +1 -0
- package/dist/feedback/PersistentBanner/PersistentBanner.d.ts +6 -0
- package/dist/feedback/ProgressBar/ProgressBar.d.ts +7 -1
- package/dist/feedback/Spinner/Spinner.d.ts +6 -0
- package/dist/feedback/Toast/Toast.d.ts +13 -0
- package/dist/forms/CheckboxField/CheckboxField.d.ts +4 -0
- package/dist/forms/CurrencyField/CurrencyField.d.ts +5 -21
- package/dist/forms/DateField/DateField.d.ts +13 -1
- package/dist/forms/DateRangeField/DateRangeCalendar/DateRangeCalendar.d.ts +6 -3
- package/dist/forms/DateRangeField/DateRangeField.d.ts +17 -3
- package/dist/forms/Form/Form.d.ts +13 -2
- package/dist/forms/FormFeedback/FormFeedback.d.ts +1 -0
- package/dist/forms/FormFooter/FormFooter.d.ts +11 -5
- package/dist/forms/FormFooter/FormFooterActions/FormFooterActions.d.ts +2 -5
- package/dist/forms/FormFooter/types.d.ts +10 -0
- package/dist/forms/FormRow/FormRow.d.ts +6 -0
- package/dist/forms/FormSection/FormSection.d.ts +4 -0
- package/dist/forms/MultiSelectField/MultiSelectField.d.ts +6 -2
- package/dist/forms/NumberField/NumberField.d.ts +4 -0
- package/dist/forms/PasswordField/PasswordField.d.ts +3 -0
- package/dist/forms/PercentageField/PercentageField.d.ts +13 -0
- package/dist/forms/PhoneField/PhoneField.d.ts +10 -0
- package/dist/forms/PillSelectField/PillSelectField.d.ts +9 -0
- package/dist/forms/PillSelectField/types.d.ts +2 -0
- package/dist/forms/RadioGroupBoxOption/RadioGroupBoxOption.d.ts +7 -0
- package/dist/forms/RadioGroupField/RadioGroupField.d.ts +8 -1
- package/dist/forms/RadioGroupField/RadioGroupFieldContext.d.ts +2 -1
- package/dist/forms/RadioGroupOption/RadioGroupOption.d.ts +6 -1
- package/dist/forms/SelectField/SelectField.d.ts +20 -3
- package/dist/forms/SelectField/types.d.ts +27 -0
- package/dist/forms/TextAreaField/TextAreaField.d.ts +7 -1
- package/dist/forms/TextField/TextField.d.ts +8 -0
- package/dist/forms/TimeField/TimeField.d.ts +23 -1
- package/dist/forms/TimeRangeField/TimeRangeField.d.ts +15 -2
- package/dist/forms/WeekField/WeekField.d.ts +4 -0
- package/dist/forms/WeekSelectField/WeekSelectField.d.ts +4 -0
- package/dist/forms/hooks/useRadioGroupFieldControllers.d.ts +1 -2
- package/dist/forms/hooks/useSelectFieldControllers.d.ts +2 -2
- package/dist/forms/index.d.ts +2 -0
- package/dist/foundation/tokens/color/color-constants.d.ts +34 -0
- package/dist/foundation/tokens/color/color-types.d.ts +1 -1
- package/dist/foundation/tokens/dimension/dimension-tokens.d.ts +1 -0
- package/dist/foundation/tokens/layout/TokenTable.d.ts +14 -0
- package/dist/foundation/tokens/layout/layout-tokens.d.ts +12 -0
- package/dist/hooks/useIsOverflowing.d.ts +2 -0
- package/dist/index.css +755 -479
- package/dist/index.css.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +1295 -941
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +1431 -1098
- package/dist/index.modern.js.map +1 -1
- package/dist/ink_illustrations/components/design/Ink3DModeling.d.ts +7 -0
- package/dist/ink_illustrations/components/design/index.d.ts +1 -1
- package/dist/ink_illustrations/components/index.d.ts +2 -2
- package/dist/ink_illustrations/components/other/InkSculptureBust.d.ts +7 -0
- package/dist/ink_illustrations/components/other/index.d.ts +1 -1
- package/dist/ink_illustrations/components/{design/Ink3DModeling02.d.ts → travel/InkBoardingPass.d.ts} +2 -2
- package/dist/ink_illustrations/components/travel/InkVolcano.d.ts +7 -0
- package/dist/ink_illustrations/components/travel/index.d.ts +2 -2
- package/dist/ink_illustrations/components/weather/InkSun.d.ts +7 -0
- package/dist/ink_illustrations/components/weather/index.d.ts +1 -1
- package/dist/ink_illustrations/deprecatedAliases.d.ts +27 -0
- package/dist/ink_illustrations/index.d.ts +1 -0
- package/dist/layout/CalloutCard/CalloutCard.d.ts +1 -0
- package/dist/layout/Card/Card.d.ts +14 -0
- package/dist/layout/Inline/Inline.d.ts +20 -4
- package/dist/layout/Page/Page.d.ts +11 -3
- package/dist/layout/Page/PageBreadcrumbs/PageBreadcrumbs.d.ts +2 -2
- package/dist/layout/Page/types.d.ts +11 -2
- package/dist/layout/PageLayout/PageLayout.d.ts +18 -0
- package/dist/layout/PageLayout/types.d.ts +10 -0
- package/dist/layout/Stack/Stack.d.ts +16 -4
- package/dist/layout/index.d.ts +1 -0
- package/dist/lists/Accordion/Accordion.d.ts +10 -0
- package/dist/lists/Accordion/types.d.ts +4 -0
- package/dist/lists/ActionList/ActionList.d.ts +12 -0
- package/dist/lists/ActionList/type.d.ts +5 -0
- package/dist/lists/ActionListItem/ActionListItem.d.ts +17 -0
- package/dist/lists/BasicTable/BasicTable.d.ts +22 -0
- package/dist/lists/BasicTable/BasicTableSectionContext.d.ts +4 -0
- package/dist/lists/BasicTable/constants.d.ts +13 -0
- package/dist/lists/BasicTable/index.d.ts +1 -0
- package/dist/lists/BasicTable/types.d.ts +4 -0
- package/dist/lists/BasicTableBody/BasicTableBody.d.ts +9 -0
- package/dist/lists/BasicTableBody/index.d.ts +1 -0
- package/dist/lists/BasicTableCell/BasicTableCell.d.ts +14 -0
- package/dist/lists/BasicTableCell/index.d.ts +1 -0
- package/dist/lists/BasicTableHeader/BasicTableHeader.d.ts +9 -0
- package/dist/lists/BasicTableHeader/index.d.ts +1 -0
- package/dist/lists/BasicTableRow/BasicTableRow.d.ts +9 -0
- package/dist/lists/BasicTableRow/index.d.ts +1 -0
- package/dist/lists/DataTable/DataTable.d.ts +31 -8
- package/dist/lists/DataTable/types.d.ts +35 -0
- package/dist/lists/DataTableCell/DataTableCell.d.ts +1 -0
- package/dist/lists/DataTableEditableCell/DataTableEditableCell.d.ts +1 -0
- package/dist/lists/DataTableRow/DataTableRow.d.ts +12 -0
- package/dist/lists/index.d.ts +7 -1
- package/dist/media/Avatar/Avatar.d.ts +1 -0
- package/dist/media/Badge/Badge.d.ts +7 -2
- package/dist/media/Pill/Pill.d.ts +8 -0
- package/dist/media/Pill/constants.d.ts +2 -0
- package/dist/media/Pill/types.d.ts +3 -1
- package/dist/navigation/BreadcrumbItem/BreadcrumbItem.d.ts +1 -0
- package/dist/navigation/Breadcrumbs/Breadcrumbs.d.ts +1 -0
- package/dist/navigation/PrimaryNav/PrimaryNav.d.ts +1 -0
- package/dist/navigation/PrimaryNavFooter/PrimaryNavFooter.d.ts +1 -0
- package/dist/navigation/PrimaryNavItem/PrimaryNavItem.d.ts +1 -0
- package/dist/navigation/PrimaryNavSubItem/PrimaryNavSubItem.d.ts +1 -0
- package/dist/navigation/Tab/Tab.d.ts +1 -0
- package/dist/navigation/TabList/TabList.d.ts +1 -0
- package/dist/navigation/TabPanel/TabPanel.d.ts +1 -0
- package/dist/navigation/Tabs/Tabs.d.ts +1 -0
- package/dist/overlay/Calendar/Calendar.d.ts +15 -4
- package/dist/overlay/Dropdown/Dropdown.d.ts +1 -0
- package/dist/overlay/DropdownListDivider/DropdownListDivider.d.ts +1 -0
- package/dist/overlay/DropdownListItem/DropdownListItem.d.ts +1 -0
- package/dist/overlay/DropdownListItemSelectable/DropdownListItemSelectable.d.ts +1 -0
- package/dist/overlay/DropdownSubmenu/DropdownSubmenu.d.ts +1 -0
- package/dist/overlay/HintModal/HintModal.d.ts +1 -0
- package/dist/overlay/KebabMenu/types.d.ts +5 -0
- package/dist/overlay/Modal/Modal.d.ts +3 -0
- package/dist/overlay/Modal/ModalBody/ModalBody.d.ts +1 -0
- package/dist/overlay/Modal/ModalFooter/ModalFooter.d.ts +11 -6
- package/dist/overlay/Modal/ModalFooter/types.d.ts +10 -0
- package/dist/overlay/Popover/Popover.d.ts +8 -1
- package/dist/overlay/Tooltip/Tooltip.d.ts +2 -1
- package/dist/overlay/index.d.ts +1 -0
- package/dist/typography/KeyboardKey/KeyboardKey.d.ts +1 -0
- package/dist/typography/Text/Bold/Bold.d.ts +1 -0
- package/dist/typography/Text/Italic/Italic.d.ts +1 -0
- package/dist/typography/Text/Text.d.ts +23 -0
- package/dist/typography/Text/Underline/Underline.d.ts +1 -0
- package/dist/utils/formik.d.ts +5 -0
- package/llms-instructions/guidelines/ActionList.guidelines.md +1 -3
- package/llms-instructions/guidelines/Avatar.guidelines.md +6 -5
- package/llms-instructions/guidelines/Badge.guidelines.md +24 -8
- package/llms-instructions/guidelines/BasicTable.guidelines.md +80 -0
- package/llms-instructions/guidelines/Breadcrumbs.guidelines.md +2 -2
- package/llms-instructions/guidelines/Button.guidelines.md +3 -3
- package/llms-instructions/guidelines/Calendar.guidelines.md +12 -0
- package/llms-instructions/guidelines/Card.guidelines.md +2 -2
- package/llms-instructions/guidelines/CircularProgress.guidelines.md +1 -1
- package/llms-instructions/guidelines/DateFilter.guidelines.md +2 -2
- package/llms-instructions/guidelines/Dropdown.guidelines.md +3 -2
- package/llms-instructions/guidelines/EmptyState.guidelines.md +3 -1
- package/llms-instructions/guidelines/{Forms.guidelines.md → Form.guidelines.md} +41 -6
- package/llms-instructions/guidelines/Icons.guidelines.md +11 -10
- package/llms-instructions/guidelines/InkIllustrations.guidelines.md +5 -4
- package/llms-instructions/guidelines/Inline.guidelines.md +55 -0
- package/llms-instructions/guidelines/InlineBanner.guidelines.md +5 -3
- package/llms-instructions/guidelines/MultiSelectField.guidelines.md +2 -2
- package/llms-instructions/guidelines/Page.guidelines.md +65 -0
- package/llms-instructions/guidelines/PageLayout.guidelines.md +85 -0
- package/llms-instructions/guidelines/Paywall.guidelines.md +3 -2
- package/llms-instructions/guidelines/PersistentBanner.guidelines.md +2 -2
- package/llms-instructions/guidelines/Pill.guidelines.md +31 -3
- package/llms-instructions/guidelines/PillSelectField.guidelines.md +1 -1
- package/llms-instructions/guidelines/PrimaryNav.guidelines.md +144 -0
- package/llms-instructions/guidelines/SegmentedControl.guidelines.md +2 -2
- package/llms-instructions/guidelines/Skeleton.guidelines.md +3 -3
- package/llms-instructions/guidelines/Spinner.guidelines.md +6 -4
- package/llms-instructions/guidelines/Stack.guidelines.md +53 -0
- package/llms-instructions/guidelines/Text.guidelines.md +70 -0
- package/llms-instructions/guidelines/Toast.guidelines.md +2 -1
- package/llms-instructions/guidelines/Toggle.guidelines.md +2 -2
- package/llms-instructions/guidelines/ToolbarSelect.guidelines.md +2 -2
- package/llms-instructions/guidelines/Tooltip.guidelines.md +1 -1
- package/llms-instructions/llms-components.md +91 -19
- package/llms-instructions/llms-composing-components.md +583 -219
- package/llms-instructions/llms-icons-and-illustrations.md +305 -1011
- package/llms-instructions/llms-tokens.md +227 -164
- package/llms-instructions/llms.md +12 -28
- package/package.json +2 -2
- package/dist/ink_illustrations/components/other/InkS/321/201ulptureBust.d.ts +0 -7
- package/dist/ink_illustrations/components/travel/InkDrawing.d.ts +0 -7
- package/dist/ink_illustrations/components/travel/InkDrawing1.d.ts +0 -7
- package/dist/ink_illustrations/components/weather/InkGroup7975.d.ts +0 -7
- /package/dist/ink_illustrations/components/{enterteniment → entertainment}/Ink3DGlasses.d.ts +0 -0
- /package/dist/ink_illustrations/components/{enterteniment → entertainment}/InkAmusementPark.d.ts +0 -0
- /package/dist/ink_illustrations/components/{enterteniment → entertainment}/InkBallet.d.ts +0 -0
- /package/dist/ink_illustrations/components/{enterteniment → entertainment}/InkBowling.d.ts +0 -0
- /package/dist/ink_illustrations/components/{enterteniment → entertainment}/InkCardGames.d.ts +0 -0
- /package/dist/ink_illustrations/components/{enterteniment → entertainment}/InkCarouselWithHorses.d.ts +0 -0
- /package/dist/ink_illustrations/components/{enterteniment → entertainment}/InkDiscoBall.d.ts +0 -0
- /package/dist/ink_illustrations/components/{enterteniment → entertainment}/InkDj.d.ts +0 -0
- /package/dist/ink_illustrations/components/{enterteniment → entertainment}/InkFirecracker.d.ts +0 -0
- /package/dist/ink_illustrations/components/{enterteniment → entertainment}/InkJoystick.d.ts +0 -0
- /package/dist/ink_illustrations/components/{enterteniment → entertainment}/InkMagicTricks.d.ts +0 -0
- /package/dist/ink_illustrations/components/{enterteniment → entertainment}/InkMascarade.d.ts +0 -0
- /package/dist/ink_illustrations/components/{enterteniment → entertainment}/InkNotesChart.d.ts +0 -0
- /package/dist/ink_illustrations/components/{enterteniment → entertainment}/InkRollerSkating.d.ts +0 -0
- /package/dist/ink_illustrations/components/{enterteniment → entertainment}/InkSlotMachine.d.ts +0 -0
- /package/dist/ink_illustrations/components/{enterteniment → entertainment}/InkTheatre.d.ts +0 -0
- /package/dist/ink_illustrations/components/{enterteniment → entertainment}/index.d.ts +0 -0
- /package/dist/ink_illustrations/components/{sciency → science}/InkAnatomy.d.ts +0 -0
- /package/dist/ink_illustrations/components/{sciency → science}/InkAsteroid.d.ts +0 -0
- /package/dist/ink_illustrations/components/{sciency → science}/InkAstronaut.d.ts +0 -0
- /package/dist/ink_illustrations/components/{sciency → science}/InkBacteria.d.ts +0 -0
- /package/dist/ink_illustrations/components/{sciency → science}/InkChemistry.d.ts +0 -0
- /package/dist/ink_illustrations/components/{sciency → science}/InkDna.d.ts +0 -0
- /package/dist/ink_illustrations/components/{sciency → science}/InkLabTube.d.ts +0 -0
- /package/dist/ink_illustrations/components/{sciency → science}/InkMicroChips.d.ts +0 -0
- /package/dist/ink_illustrations/components/{sciency → science}/InkMicroscope.d.ts +0 -0
- /package/dist/ink_illustrations/components/{sciency → science}/InkNewtonsCradle.d.ts +0 -0
- /package/dist/ink_illustrations/components/{sciency → science}/InkNuclearEnergy.d.ts +0 -0
- /package/dist/ink_illustrations/components/{sciency → science}/InkPlanet.d.ts +0 -0
- /package/dist/ink_illustrations/components/{sciency → science}/InkPlantInTube.d.ts +0 -0
- /package/dist/ink_illustrations/components/{sciency → science}/InkRobotics.d.ts +0 -0
- /package/dist/ink_illustrations/components/{sciency → science}/InkSpaceTravel.d.ts +0 -0
- /package/dist/ink_illustrations/components/{sciency → science}/InkTelescope.d.ts +0 -0
- /package/dist/ink_illustrations/components/{sciency → science}/index.d.ts +0 -0
|
@@ -2,11 +2,53 @@
|
|
|
2
2
|
|
|
3
3
|
# @7shifts/sous-chef — Component Reference
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
This document lists the documented components, grouped by category, with a short description of each. Apart from the setup snippet below, it does not include props or per-component code examples: call `get_component_details` with a component name to get its props, guidelines and code examples.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Read the rules below before writing code with Sous Chef.
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
## Constraints
|
|
10
|
+
|
|
11
|
+
To ensure the generated code is consistent, follow these rules:
|
|
12
|
+
|
|
13
|
+
- Don't use hardcoded color hashes. Always use a semantic color token (reference to color tokens: call `get_design_tokens_reference`).
|
|
14
|
+
- Don't use hardcoded pixel values for spacing, padding or radius. Use a semantic token for the property when one fits (`--space-*` for the gap between elements, `--padding-*` for the space inside a page, `--radius-*` for corners), otherwise a `--dim-*` token (reference to dimension tokens: call `get_design_tokens_reference`). Hard-code a pixel value only when you need an exact value that is not on the scale.
|
|
15
|
+
- Not everything needs to use a Sous Chef component. If you notice something is missing in Sous Chef, you can treat that as custom UI to solve a specific problem. In this case:
|
|
16
|
+
- Structure the component in isolation (separate folder, with its own style file, and tests)
|
|
17
|
+
- Make sure it uses the Sous Chef design tokens
|
|
18
|
+
- For text, always try to use the props for the component, for example, the `TextField` component takes a `label` prop for the text, the same goes for other components.
|
|
19
|
+
- If there is no prop for the text, DON'T use `p`, `h1`, `h2`, `h3`, and others. Instead, use the `<Text>` component, which exposes the `as` prop, for example `<Text as="h1">Title</Text>`.
|
|
20
|
+
|
|
21
|
+
## Setup
|
|
22
|
+
|
|
23
|
+
Before using any component, set up the app once:
|
|
24
|
+
|
|
25
|
+
1. Install the package: `yarn add @7shifts/sous-chef`.
|
|
26
|
+
2. Import the stylesheet once, in the app's entry file: `import '@7shifts/sous-chef/dist/index.css';`.
|
|
27
|
+
3. Wrap the app in `SousChefProvider`. Every Sous Chef component must be rendered inside it: it mounts the toast container, follows the light or dark theme, and provides translations and the `PhoneField` and `TimeField` defaults. Render it once, at the root.
|
|
28
|
+
|
|
29
|
+
```tsx
|
|
30
|
+
import '@7shifts/sous-chef/dist/index.css';
|
|
31
|
+
import { SousChefProvider } from '@7shifts/sous-chef';
|
|
32
|
+
|
|
33
|
+
export const App = () => (
|
|
34
|
+
<SousChefProvider>
|
|
35
|
+
<Routes />
|
|
36
|
+
</SousChefProvider>
|
|
37
|
+
);
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Call `get_component_details` with `SousChefProvider` for its props (`country`, `timeFormat`, `i18n`).
|
|
41
|
+
|
|
42
|
+
## Missing components
|
|
43
|
+
|
|
44
|
+
There are a few missing components in the library. When you need something that does not exist in the library, first check if there is something available in the shared components in the application, if nothing was found, then you are free to create your own but, using the Sous Chef tokens.
|
|
45
|
+
|
|
46
|
+
Here are the missing components:
|
|
47
|
+
|
|
48
|
+
- Full screen modals
|
|
49
|
+
- File upload form field
|
|
50
|
+
- Grid system
|
|
51
|
+
- App layout structure (something with slots for top bar, left nav and content)
|
|
10
52
|
|
|
11
53
|
## Actions
|
|
12
54
|
|
|
@@ -14,11 +56,11 @@ Actions are the components a user interacts with to trigger behaviour or navigat
|
|
|
14
56
|
|
|
15
57
|
### Button
|
|
16
58
|
|
|
17
|
-
|
|
59
|
+
Button triggers an immediate action.
|
|
18
60
|
|
|
19
61
|
### Link
|
|
20
62
|
|
|
21
|
-
|
|
63
|
+
Link navigates the user to another page or external resource. Use it when the destination is what matters — not an action being performed.
|
|
22
64
|
|
|
23
65
|
### PaginationControls
|
|
24
66
|
|
|
@@ -34,11 +76,11 @@ Controls contains the components that are usually used in toolbars, for example
|
|
|
34
76
|
|
|
35
77
|
### DateFilter
|
|
36
78
|
|
|
37
|
-
|
|
79
|
+
DateFilter lets a user navigate and select a date — by day, week, or month — to filter the content on the page. It renders a labeled display between two step arrows, with a calendar popover for direct date selection.
|
|
38
80
|
|
|
39
81
|
### SegmentedControl
|
|
40
82
|
|
|
41
|
-
|
|
83
|
+
SegmentedControl lets a user switch between a small set of mutually exclusive views or modes within a specific frame or component. Selecting an option takes effect immediately — no submit step required.
|
|
42
84
|
|
|
43
85
|
### ToolbarSelect
|
|
44
86
|
|
|
@@ -78,7 +120,7 @@ Persistent Banner component is used to provide overarching information in the ap
|
|
|
78
120
|
|
|
79
121
|
### ProgressBar
|
|
80
122
|
|
|
81
|
-
|
|
123
|
+
ProgressBar shows a horizontal bar that fills as a task advances. Use it when progress is linear and the user benefits from seeing how far through a sequence they are.
|
|
82
124
|
|
|
83
125
|
### Skeleton
|
|
84
126
|
|
|
@@ -90,7 +132,7 @@ Used to notify users that their action is being processed or when a partial or f
|
|
|
90
132
|
|
|
91
133
|
### Toast
|
|
92
134
|
|
|
93
|
-
|
|
135
|
+
A non-disruptive message that appears at the bottom of the interface to provide quick, at-a-glance feedback on the outcome of an action.
|
|
94
136
|
|
|
95
137
|
## Forms
|
|
96
138
|
|
|
@@ -118,7 +160,11 @@ A dropdown style field for selecting a single specific date. It will load a cale
|
|
|
118
160
|
|
|
119
161
|
### DateRangeField
|
|
120
162
|
|
|
121
|
-
A dropdown style field with 2 inputs. It allows the user to select a specific start date and end date separately to create a range of dates.
|
|
163
|
+
A dropdown style field with 2 inputs. It allows the user to select a specific start date and end date separately to create a range of dates.
|
|
164
|
+
|
|
165
|
+
### Form
|
|
166
|
+
|
|
167
|
+
Forms collect information from the user. Forms are composed of one or more form field components inside a form wrapper with a single submit button. When related fields need to be submitted together — whether a single field or a complex multi-section layout — they live inside a `<Form />`. Isolated selections and standalone controls don't need one. Forms can be further customized using sections and rows to group fields and organize how they appear to the user.
|
|
122
168
|
|
|
123
169
|
### FormFeedback
|
|
124
170
|
|
|
@@ -134,7 +180,7 @@ Easily add form fields side by side with equal size.
|
|
|
134
180
|
|
|
135
181
|
### FormSection
|
|
136
182
|
|
|
137
|
-
`FormSection` provides visual
|
|
183
|
+
`FormSection` provides visual separation between sections within a `Form` and can have a title and subtitle.
|
|
138
184
|
|
|
139
185
|
### MultiSelectField
|
|
140
186
|
|
|
@@ -164,9 +210,11 @@ A field where the user can select one or more from a vertical line of pills. Can
|
|
|
164
210
|
|
|
165
211
|
A list of radio options appearing either as an input or box. Use when the user can only select one option from a visual list and the user needs to be able to see all the options to make an informed decision.
|
|
166
212
|
|
|
213
|
+
Sub-components: `RadioGroupBoxOption`.
|
|
214
|
+
|
|
167
215
|
### RadioGroupOption
|
|
168
216
|
|
|
169
|
-
RadioGroupField
|
|
217
|
+
A single radio button option, used as a child of `RadioGroupField`. Its `value` is what the group reports in `onChange` when the option is selected.
|
|
170
218
|
|
|
171
219
|
### SelectField
|
|
172
220
|
|
|
@@ -174,7 +222,7 @@ Simple dropdown field where the user chooses one option from a predefined list.
|
|
|
174
222
|
|
|
175
223
|
### TextAreaField
|
|
176
224
|
|
|
177
|
-
A
|
|
225
|
+
A multi-line text input used to get longer text from the user, such as notes or messages. It can grow with its content (`autoGrow`), show a character count (`maxLength`) and host a `toolbar` of actions below the text.
|
|
178
226
|
|
|
179
227
|
### TextField
|
|
180
228
|
|
|
@@ -182,11 +230,11 @@ TextField is a basic open input field used to get text from the user, with optio
|
|
|
182
230
|
|
|
183
231
|
### TimeField
|
|
184
232
|
|
|
185
|
-
A special field
|
|
233
|
+
A special field designed for selecting a specific time of the day. Users can choose from a dropdown of preset time intervals, or type directly into the field. When the user leaves the field, the input is automatically formatted into either AM/PM time or 24h time. **You are in charge of validating the value and parsing it back to a value that you can use on your application**. To show durations, set `startTime` and `endField` so each option shows its duration from `startTime`, or pass the text to `duration`. To pick a start and end time with `subtractDuration` (e.g. for unpaid breaks) or a custom `calculateDuration`, use `TimeRangeField`.
|
|
186
234
|
|
|
187
235
|
### TimeRangeField
|
|
188
236
|
|
|
189
|
-
A special input field for selecting a time range. Comprised of 2 individual time fields, the user selects a start time and an end time individually to.
|
|
237
|
+
A special input field for selecting a time range. Comprised of 2 individual time fields, the user selects a start time and an end time individually to create a time range. The end time field shows the total duration, and each end time option shows its duration from the start time.
|
|
190
238
|
|
|
191
239
|
### WeekField
|
|
192
240
|
|
|
@@ -226,6 +274,8 @@ Layout components structure and arrange the content of a page.
|
|
|
226
274
|
|
|
227
275
|
### CalloutCard
|
|
228
276
|
|
|
277
|
+
**Deprecated.** Use `<EmptyState as='card' />` instead. Don't use it in new code.
|
|
278
|
+
|
|
229
279
|
CalloutCards are containers to present a new product or feature to users.
|
|
230
280
|
|
|
231
281
|
### Card
|
|
@@ -238,11 +288,11 @@ Layout component to easily line elements up in a row.
|
|
|
238
288
|
|
|
239
289
|
### Page
|
|
240
290
|
|
|
241
|
-
The Page component is used to control the elements within a page. It can be full width or restricted using the `size` prop.
|
|
291
|
+
The Page component is used to control the elements within a page. It can be full width or restricted using the `size` prop.
|
|
242
292
|
|
|
243
293
|
### PageLayout
|
|
244
294
|
|
|
245
|
-
PageLayouts are responsible for grouping multiple pages. It will usually render a bunch of routes on its children.
|
|
295
|
+
PageLayouts are responsible for grouping multiple pages under a side menu, like a settings area. It will usually render a bunch of routes on its children. It needs a react-router `Router` above it, unless every menu item sets `reloadDocument`.
|
|
246
296
|
|
|
247
297
|
### Stack
|
|
248
298
|
|
|
@@ -260,10 +310,20 @@ Accordions are lists used to group information into collapsible sections. Only o
|
|
|
260
310
|
|
|
261
311
|
A list of tasks or items that require user attention and can be completed with an action. Each item should have at least one clear action for the user to take.
|
|
262
312
|
|
|
313
|
+
Sub-components: `ActionListItem`.
|
|
314
|
+
|
|
315
|
+
### BasicTable
|
|
316
|
+
|
|
317
|
+
BasicTable lays out simple, static content in rows and columns. Use it for information that does not need to be sorted, paginated or edited. For large or interactive data sets, use `DataTable` instead.
|
|
318
|
+
|
|
319
|
+
Sub-components: `BasicTableHeader`, `BasicTableBody`, `BasicTableRow`, `BasicTableCell`.
|
|
320
|
+
|
|
263
321
|
### DataTable
|
|
264
322
|
|
|
265
323
|
DataTable displays structured data in rows and columns. Use it when data is inherently tabular — each row represents a record and each column represents an attribute of that record.
|
|
266
324
|
|
|
325
|
+
Sub-components: `DataTableRow`, `DataTableCell`, `DataTableEditableCell`.
|
|
326
|
+
|
|
267
327
|
## Navigation
|
|
268
328
|
|
|
269
329
|
Navigation components help a user move around the application and understand where they are.
|
|
@@ -272,13 +332,19 @@ Navigation components help a user move around the application and understand whe
|
|
|
272
332
|
|
|
273
333
|
Used on top of pages to let the user navigate back to parent routes. IMPORTANT: It requires the `react-router-dom` Router to be present on a upper level of the document tree.
|
|
274
334
|
|
|
335
|
+
Sub-components: `BreadcrumbItem`.
|
|
336
|
+
|
|
275
337
|
### PrimaryNav
|
|
276
338
|
|
|
277
339
|
PrimaryNav is the main navigation component for Sous Chef. It provides a vertical navigation menu with support for nested sub-items, badges, and a footer section. The navigation can be expanded or collapsed, and it highlights the active item based on the current selection. The component is designed to be flexible and customizable, allowing for various use cases within the application.
|
|
278
340
|
|
|
341
|
+
Sub-components: `PrimaryNavItem`, `PrimaryNavSubItem`, `PrimaryNavDivider`, `PrimaryNavFooter`.
|
|
342
|
+
|
|
279
343
|
### Tabs
|
|
280
344
|
|
|
281
|
-
Compound component for horizontal tab navigation. Supports uncontrolled (`defaultValue`) and controlled (`value` + `onValueChange`) modes. `TabList` and `TabPanel` can live in different parts of the tree — only the root
|
|
345
|
+
Compound component for horizontal tab navigation. Supports uncontrolled (`defaultValue`) and controlled (`value` + `onValueChange`) modes. `TabList` and `TabPanel` can live in different parts of the tree — only the root `<Tabs>` needs to wrap both.
|
|
346
|
+
|
|
347
|
+
Sub-components: `TabList`, `Tab`, `TabPanel`.
|
|
282
348
|
|
|
283
349
|
## Overlay
|
|
284
350
|
|
|
@@ -292,6 +358,8 @@ Calendar is a date-picking overlay that anchors to a trigger element and lets th
|
|
|
292
358
|
|
|
293
359
|
A Dropdown is where you can have menu options that are hidden until the user clicks or hovers on a trigger element.
|
|
294
360
|
|
|
361
|
+
Sub-components: `DropdownList`, `DropdownListItem`, `DropdownListItemSelectable`, `DropdownListDivider`.
|
|
362
|
+
|
|
295
363
|
### HintModal
|
|
296
364
|
|
|
297
365
|
HintModal can be used to provide tips or guidance to users on a page. It not typically triggered by a button, instead it should be rendered when a user navigates to a page where they might require additional guidance.
|
|
@@ -300,6 +368,8 @@ HintModal can be used to provide tips or guidance to users on a page. It not typ
|
|
|
300
368
|
|
|
301
369
|
Modal is a focused overlay that interrupts the current experience and demands the user's attention. It blocks all interaction with the rest of the page until the user responds — making it best suited for decisions, confirmations, and self-contained flows where that level of focus is warranted.
|
|
302
370
|
|
|
371
|
+
Sub-components: `ModalBody`, `ModalFooter`.
|
|
372
|
+
|
|
303
373
|
### Popover
|
|
304
374
|
|
|
305
375
|
A Popover is a type of dropdown but it is meant to be used for more complex interactions and content that goes beyond a list of actions. If you find yourself needing to put a form, information, or multiple actions within a dropdown, it's probably best to use a Popover instead of a Dropdown.
|
|
@@ -314,4 +384,6 @@ Typography components are used to display text in various styles and hierarchies
|
|
|
314
384
|
|
|
315
385
|
### Text
|
|
316
386
|
|
|
317
|
-
The Text component is used to format text style, size, line spacing, alignment, and color.
|
|
387
|
+
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>`.
|
|
388
|
+
|
|
389
|
+
Sub-components: `Bold`, `Italic`, `Underline`.
|