@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
package/dist/utils/formik.d.ts
CHANGED
|
@@ -3,4 +3,9 @@ export declare const getFormikState: (name: string, formik?: FormikType) => {
|
|
|
3
3
|
error: any;
|
|
4
4
|
value: any;
|
|
5
5
|
} | null;
|
|
6
|
+
/**
|
|
7
|
+
* Splits a field name into a Formik path. It uses the same parser as Formik's
|
|
8
|
+
* `getIn`/`setIn`, so only `.`, `[` and `]` are path separators and names like
|
|
9
|
+
* `first_name` or `day-parts` are kept as a single key.
|
|
10
|
+
*/
|
|
6
11
|
export declare const getFormikArrayPath: (name: string) => string[];
|
|
@@ -30,11 +30,9 @@
|
|
|
30
30
|
|
|
31
31
|
If you are using `ActionList` as a basic checklist, do the following:
|
|
32
32
|
|
|
33
|
-
- Incomplete `ActionListItems` should be the `
|
|
33
|
+
- Incomplete `ActionListItems` should be the `neutral` theme and use `IconCheckCircleIncomplete` as the icon.
|
|
34
34
|
- Complete `ActionListItems` should be the `success` theme and use `IconCheck` as the icon.
|
|
35
35
|
|
|
36
|
-

|
|
37
|
-
|
|
38
36
|
### Themes
|
|
39
37
|
|
|
40
38
|
- Each `ActionListItem` has a `theme` prop that controls the icon color. Use themes to communicate the nature or urgency of the item.
|
|
@@ -34,11 +34,11 @@ Colour communicates entity identity at a glance and reinforces visual continuity
|
|
|
34
34
|
|
|
35
35
|
#### Users
|
|
36
36
|
|
|
37
|
-
User avatars reflect the colour of the user's **Primary Role** for the department they are being displayed in:
|
|
37
|
+
User avatars reflect the colour of the user's **Primary Role** for the department they are being displayed in. Pass it with the `color` prop:
|
|
38
38
|
|
|
39
39
|
- **No photo uploaded** — the role colour fills the avatar background, behind the user's initials
|
|
40
|
-
- **Photo uploaded** — the role colour
|
|
41
|
-
- **No assigned role** — the avatar appears grey
|
|
40
|
+
- **Photo uploaded** — the photo fills the avatar and the role colour is not shown. There is no coloured border.
|
|
41
|
+
- **No assigned role** — leave `color` unset and the avatar appears grey
|
|
42
42
|
- **Multiple roles** — the Primary Role's colour is always used. If the user has multiple roles but none is set as primary, the colour of their oldest assigned role is shown instead
|
|
43
43
|
|
|
44
44
|
#### Roles
|
|
@@ -57,7 +57,7 @@ When there is no user-uploaded photo, the avatar uses the pre-defined placeholde
|
|
|
57
57
|
|
|
58
58
|
A badge can be overlaid on the avatar to surface supplementary information — an action, a status indicator, or a count. The badge sits in the bottom-right corner of the avatar.
|
|
59
59
|
|
|
60
|
-
|
|
60
|
+
Pass the badge with the `badge` prop, typically a `Badge` component. Badges render on `medium`, `large` and `extra-large` avatars. At `size="small"` the badge is not rendered at all, so don't rely on it to communicate anything important at that size.
|
|
61
61
|
|
|
62
62
|
## Tips & Tricks
|
|
63
63
|
|
|
@@ -71,6 +71,7 @@ Badges are supported on all sizes. When the avatar is set to `small` or `medium`
|
|
|
71
71
|
|
|
72
72
|
- `size` defaults to `medium` if not specified.
|
|
73
73
|
- `children` takes priority over `url` — if both are provided, the children render and the image is ignored.
|
|
74
|
-
- When `size="small"
|
|
74
|
+
- When `size="small"`, the `badge` prop is ignored and nothing is rendered. On other sizes the badge is rendered as passed — there is no dot variant.
|
|
75
|
+
- When a `url` is provided, the `color` prop is not applied — the avatar shows a light grey background while the image loads.
|
|
75
76
|
- Images are lazy-loaded and only fetched when the avatar enters the viewport.
|
|
76
77
|
- If the image URL returns an error, the avatar falls back to a generated illustrated placeholder — not a broken image.
|
|
@@ -20,13 +20,27 @@ Badge accepts any content — a number, an icon, or short text. Numbers are the
|
|
|
20
20
|
|
|
21
21
|
### Themes
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
The `theme` prop accepts 7 values that change the badge's colour: `success`, `danger`, `warning`, `info`, `neutral`, `upsell` and `disabled`. Leave `theme` unset for the default (secondary) colour. Use themes to reinforce the meaning of what the badge is communicating:
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
- `neutral` for counts or statuses with no positive or negative meaning
|
|
26
|
+
- `info` for informational counts or updates that aren't urgent, such as new announcements or tips
|
|
27
|
+
- `success` for positive outcomes or completed items, such as approved requests
|
|
28
|
+
- `warning` for things that need attention but aren't broken, such as items nearing a deadline or limit
|
|
29
|
+
- `danger` for errors, failures, or items that need the user to act, such as failed syncs or rejected requests
|
|
30
|
+
- `upsell` for premium or gated features
|
|
31
|
+
- `disabled` when the element the badge belongs to is disabled
|
|
32
|
+
|
|
33
|
+
### Dot
|
|
34
|
+
|
|
35
|
+
Set `size="small"` to render a small dot with no content. Use it to signal that something needs attention when the exact count doesn't matter, such as unread activity on a nav item. Any `children` are ignored. Because a dot has no text, add a `title` or make sure nearby content explains what it means.
|
|
26
36
|
|
|
27
|
-
|
|
37
|
+
### Border
|
|
38
|
+
|
|
39
|
+
Set `hasBorder` to add a 1px stroke around the badge. Use it when the badge overlaps another element, such as an Avatar or an icon, so it stays visually separate. The stroke uses `--color-surface-color`, except for the `disabled` theme, which uses `--color-outline`. The border works with every badge type, including the dot.
|
|
40
|
+
|
|
41
|
+
### Size
|
|
28
42
|
|
|
29
|
-
|
|
43
|
+
Badge has two sizes: `default` and `small`. The `default` size grows to fit its content, so keep the content short. The `small` size is the dot, which has no content.
|
|
30
44
|
|
|
31
45
|
### Tooltip
|
|
32
46
|
|
|
@@ -36,13 +50,15 @@ When a badge contains only an icon or a number that may not be self-explanatory,
|
|
|
36
50
|
|
|
37
51
|
- Badges with numbers work best for counts under 100 — if the count can go higher, consider capping the display at "99+" to prevent the badge from growing too wide.
|
|
38
52
|
- Icon badges are ideal for edit or camera actions on avatars — they communicate "you can change this" without needing any text.
|
|
39
|
-
- Badge is intentionally minimal — resist the urge to put too much inside it. If you need more than a number or a single icon, you probably want a `Pill` or `
|
|
40
|
-
-
|
|
53
|
+
- Badge is intentionally minimal — resist the urge to put too much inside it. If you need more than a number or a single icon, you probably want a `Pill` or `Chip` instead.
|
|
54
|
+
- Don't rely on colour alone to distinguish statuses — it is not accessible. Make sure the content or a `title` tooltip also communicates the meaning.
|
|
41
55
|
|
|
42
56
|
## Additional Rules
|
|
43
57
|
|
|
44
58
|
- When `children` is a finite number, a `badge--numeric` style is applied automatically for appropriate sizing.
|
|
45
59
|
- When `children` is a React element (e.g. an icon), the badge height is set to match its width to keep it circular.
|
|
46
|
-
- `theme` is optional — without it the badge renders in its default
|
|
60
|
+
- `theme` is optional — without it the badge renders in its default (secondary) colour.
|
|
47
61
|
- `title` renders as a `Tooltip` overlay on hover. It does not render any visible label at rest.
|
|
48
|
-
-
|
|
62
|
+
- `size` defaults to `default` and `hasBorder` defaults to `false`.
|
|
63
|
+
- The border is drawn outside the badge, so turning it on doesn't change the badge's size.
|
|
64
|
+
- Badge accepts only `children`, `theme`, `size`, `hasBorder`, `title` and `testId`.
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
<!-- AUTO-GENERATED by scripts/build-llms-guidelines.js. Do not edit manually. Run `yarn build-llms-guidelines` to regenerate. -->
|
|
2
|
+
|
|
3
|
+
## When to Use
|
|
4
|
+
|
|
5
|
+
- To show a small, fixed set of information that reads best in columns — opening hours, a pay summary, a comparison of options or prices
|
|
6
|
+
- When each row describes one item and each column describes the same attribute for every item
|
|
7
|
+
- When the content is known up front and doesn't change while the user is looking at it
|
|
8
|
+
- Inside a page, card or modal, where a lightweight table fits better than a full `DataTable`
|
|
9
|
+
|
|
10
|
+
## When Not to Use
|
|
11
|
+
|
|
12
|
+
- When users need to sort, paginate, select, edit or take actions on rows — use `DataTable` instead
|
|
13
|
+
- For large or dynamic data sets that load from the server — use `DataTable` instead
|
|
14
|
+
- For a list of items with a single attribute — a simpler list, `ActionList` or `Stack` may be cleaner
|
|
15
|
+
- To arrange content visually in rows and columns — screen readers announce a table's rows, columns and headers, so non-tabular content becomes confusing. Use `Inline` or `Stack` instead
|
|
16
|
+
- For an entire page layout — tables should exist within sections of a page
|
|
17
|
+
|
|
18
|
+
## Usage
|
|
19
|
+
|
|
20
|
+
### Structure
|
|
21
|
+
|
|
22
|
+
BasicTable is compositional and mirrors HTML:
|
|
23
|
+
|
|
24
|
+
- `BasicTable` renders the `<table>`.
|
|
25
|
+
- `BasicTableHeader` renders the header row. Pass `BasicTableCell` as direct children — there is no need to wrap them in a `BasicTableRow`.
|
|
26
|
+
- `BasicTableBody` holds one `BasicTableRow` per row.
|
|
27
|
+
- `BasicTableCell` renders a column header (`<th scope="col">`) inside the header and a regular cell (`<td>`) in the body.
|
|
28
|
+
|
|
29
|
+
```tsx
|
|
30
|
+
<BasicTable caption="Hours by employee">
|
|
31
|
+
<BasicTableHeader>
|
|
32
|
+
<BasicTableCell>Name</BasicTableCell>
|
|
33
|
+
<BasicTableCell align="right">Hours</BasicTableCell>
|
|
34
|
+
</BasicTableHeader>
|
|
35
|
+
<BasicTableBody>
|
|
36
|
+
<BasicTableRow>
|
|
37
|
+
<BasicTableCell isRowHeader>Jane</BasicTableCell>
|
|
38
|
+
<BasicTableCell align="right">32</BasicTableCell>
|
|
39
|
+
</BasicTableRow>
|
|
40
|
+
</BasicTableBody>
|
|
41
|
+
</BasicTable>
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### Theme (`theme`)
|
|
45
|
+
|
|
46
|
+
- **`inline`** (default) sits flat on the page, with no outer border or fill. Use it when the table is already inside a container, like a `Card` or a `Modal`, or when you want the table to blend seamlessly into the rest of your content.
|
|
47
|
+
- **`card`** adds an outer border, rounded corners, a filled surface and a filled header row. Use it when you want the table to act as a card or be a more distinct self contained element of your design.
|
|
48
|
+
|
|
49
|
+
### Vertical borders
|
|
50
|
+
|
|
51
|
+
By default only row separators are shown. Turn on `hasVerticalBorders` when the table content is dense and the extra borders help the eye follow a column.
|
|
52
|
+
|
|
53
|
+
### Size (`size`)
|
|
54
|
+
|
|
55
|
+
`size` sets the minimum height and vertical padding of the body rows. The header row keeps the same height in every size.
|
|
56
|
+
|
|
57
|
+
- **`compact`** — highest density of information. Use when space efficiency matters, or the content of the table is very short and simple, like a contact card or price list.
|
|
58
|
+
- **`default`** (default) — standard sized tables for a balance between density and reading comfort.
|
|
59
|
+
- **`loose`** — rows with large spacing for rich content or multi-line blocks of text.
|
|
60
|
+
|
|
61
|
+
### Alignment
|
|
62
|
+
|
|
63
|
+
Right-align numeric values, like hours or amounts, so the digits line up. Set `align="right"` on the header cell **and** on every body cell in that column.
|
|
64
|
+
|
|
65
|
+
## Accessibility
|
|
66
|
+
|
|
67
|
+
### Caption
|
|
68
|
+
|
|
69
|
+
Always pass a `caption`. It gives the table an accessible name, so screen reader users know what the table is about before they read it. The caption is visually hidden — if the table needs a visible title, add a heading above it as well.
|
|
70
|
+
|
|
71
|
+
### Row headers
|
|
72
|
+
|
|
73
|
+
Set `isRowHeader` on the cell that identifies its row, usually the first one (for example, the employee name or the day of the week). It renders a `<th scope="row">`, so screen readers announce it together with every other cell in that row. Row headers look like regular body cells.
|
|
74
|
+
|
|
75
|
+
## Tips & Tricks
|
|
76
|
+
|
|
77
|
+
- Keep column header labels short — one or two words.
|
|
78
|
+
- Content wraps inside the cell and stays top-aligned. Avoid very long paragraphs; link out to more detail instead.
|
|
79
|
+
- Wide tables scroll horizontally inside their container instead of overflowing the page.
|
|
80
|
+
- If you find yourself adding sorting, filtering or actions, switch to `DataTable`.
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
## When to Use
|
|
4
4
|
|
|
5
|
-
-
|
|
5
|
+
- Outside of a `Page` component, when the user may need to navigate back to a parent page. Inside a `Page`, don't render `Breadcrumbs` yourself — use the `Page` component's `breadcrumbs` prop instead, which renders them in the correct position for you.
|
|
6
6
|
- When a page is nested within a parent section and the user may need to navigate back — for example, an employee detail page nested under the Employees list
|
|
7
7
|
- When the navigation path has two or more levels and the parent context is meaningful
|
|
8
8
|
- When the user arrived at the current page by drilling down from a list or overview
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
|
|
18
18
|
### Structure
|
|
19
19
|
|
|
20
|
-
Each item is a clickable link with a back chevron, representing one level in the navigation path. The last item in the list represents the most immediate parent — the page the user would go back to. Each `BreadcrumbItem` requires an `href` and a label.
|
|
20
|
+
Each item is a clickable link with a back chevron, representing one level in the navigation path. The label is underlined on hover, and the chevron lines up with the left edge of the page title. The last item in the list represents the most immediate parent — the page the user would go back to. Each `BreadcrumbItem` requires an `href` and a label.
|
|
21
21
|
|
|
22
22
|
### How Many Items to Show
|
|
23
23
|
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
|
|
12
12
|
- When the action is purely navigational — use `Link` instead
|
|
13
13
|
- When the action lives inline inside a sentence or body copy — use `Link` instead
|
|
14
|
-
- When the user is choosing between options rather than triggering something — use `
|
|
14
|
+
- When the user is choosing between options rather than triggering something — use `SelectField`, `RadioGroupField`, or `SegmentedControl` instead
|
|
15
15
|
|
|
16
16
|
## Usage
|
|
17
17
|
|
|
@@ -30,9 +30,9 @@
|
|
|
30
30
|
|
|
31
31
|
### Layout
|
|
32
32
|
|
|
33
|
-
-
|
|
33
|
+
- Lay out a group of buttons with `Inline`. Its default spacing is 20px; set `space={12}` for 12px spacing between buttons. `Inline` applies the same gap to every child, so `link-icon` buttons in the same group get that gap too.
|
|
34
34
|
- Position buttons in consistent places depending on the context they are in (e.g. side card, form or modal footer, toolbar page actions)
|
|
35
|
-
- In a
|
|
35
|
+
- In a group of buttons laid out with `Inline`, primary actions should always be the right-most button.
|
|
36
36
|
- Buttons with text should always have a minimum width of 100px. This does not apply to `link-icon` buttons
|
|
37
37
|
|
|
38
38
|
## Additional Rules
|
|
@@ -26,6 +26,18 @@ Calendar positions itself relative to the trigger element. It opens below the an
|
|
|
26
26
|
|
|
27
27
|
Use `disabledDays` to prevent selection of dates that aren't valid choices — past dates, dates outside a booking window, or dates already taken.
|
|
28
28
|
|
|
29
|
+
`disabledDays` takes a react-day-picker v8 [`Matcher`](https://daypicker.dev/v8/api/type-aliases/Matcher) or an array of them: a `Date`, an array of dates, `{ from, to }`, `{ before }`, `{ after }`, `{ dayOfWeek: number[] }` (0 is Sunday) or a `(date: Date) => boolean` function. v7 shapes such as `{ daysOfWeek }` silently match nothing.
|
|
30
|
+
|
|
31
|
+
```tsx
|
|
32
|
+
// Disable past dates and weekends
|
|
33
|
+
<Calendar
|
|
34
|
+
anchorRef={anchorRef}
|
|
35
|
+
onSelect={setDate}
|
|
36
|
+
onClickOutside={close}
|
|
37
|
+
disabledDays={[{ before: new Date() }, { dayOfWeek: [0, 6] }]}
|
|
38
|
+
/>
|
|
39
|
+
```
|
|
40
|
+
|
|
29
41
|
### Highlighting days
|
|
30
42
|
|
|
31
43
|
You can highlight a specific day on the calendar with a special visual treatment. This can be useful for showing a user that a day has special significance that might affect their decision making. For example:
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
- Cards may be freely stacked vertically or put in a row horizontally as needed.
|
|
25
25
|
- You may use a card within a card, but do so with caution. Too many nested cards can confuse the layout.
|
|
26
26
|
- You can modify cards by making them: interactive, selectable, dismissible or by adding an action menu.
|
|
27
|
-
|
|
28
|
-
-
|
|
27
|
+
- `Card` expands to fill its parent container and has no width prop. To control its size, set the width on a wrapping element, as the "With Set Width" story does.
|
|
28
|
+
- Some components, such as `EmptyState` and `Paywall`, accept an `as="card"` prop that renders them inside a card. Use `as="card"` for these rather than placing them inside a `Card` manually.
|
|
29
29
|
|
|
30
30
|
### Interactive Cards
|
|
31
31
|
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
- This component lacks context when used on its own. It should always be in context and with a close relationship to whatever it is the CircularProgress is counting.
|
|
17
17
|
- If there is an action the user can take to change the count, it should be placed close to it so there is a clear visual relationship between the progress and the action.
|
|
18
18
|
- If the CircularProgress is showing a statistic — like on a dashboard — give it a clear label of what stat it is displaying. If more context is needed, consider adding a description in a tooltip either attached to the CircularProgress or its label
|
|
19
|
-
-
|
|
19
|
+
- By default the label inside the ring shows `progress/maxValue` (e.g. `3/10`). Pass `children` to replace it with a custom label.
|
|
20
20
|
- Keep custom labels short — the label area is small and long strings will overflow.
|
|
21
21
|
- CircularProgress is fairly simplistic and does not have any additional states or label when the bar is empty or complete.
|
|
22
22
|
|
|
@@ -23,10 +23,10 @@
|
|
|
23
23
|
- `mode` defaults to `"day"`. Always pass it explicitly so the intent is clear at the call site.
|
|
24
24
|
- In `week` mode, `onChange` receives the first day of the selected week, not the day the user clicked. Account for this when updating state or fetching data.
|
|
25
25
|
- `weekStart` accepts a day-of-week integer (0 = Sunday, 1 = Monday, etc.). Pass it when the product context uses a non-Sunday week start.
|
|
26
|
-
- In `month` mode, the calendar popover
|
|
26
|
+
- In `month` mode, the calendar popover shows a month picker rather than the standard day/week calendar. Direct date selection within the month is not available — only month-level selection.
|
|
27
27
|
|
|
28
28
|
| Mode | Display | Calendar selection |
|
|
29
29
|
| ------- | ------------------------------------- | ------------------------------------------------------------------- |
|
|
30
30
|
| `day` | Single date (e.g. "Sun, Dec 25") | Day picker |
|
|
31
31
|
| `week` | Week range (e.g. "Dec 19 – Dec 25") | Week picker — `onChange` returns the first day of the selected week |
|
|
32
|
-
| `month` | Month and year (e.g. "December 2022") | Month picker
|
|
32
|
+
| `month` | Month and year (e.g. "December 2022") | Month picker, not the standard day calendar |
|
|
@@ -25,9 +25,10 @@
|
|
|
25
25
|
### Submenus
|
|
26
26
|
|
|
27
27
|
- Dropdowns can have Submenus which fly off to the right or left of the main Dropdown.
|
|
28
|
+
- Create a submenu by passing a `DropdownList` to the `submenu` prop of a `DropdownListItem`. Use `onSubmenuOpen` if you need to react when it opens.
|
|
28
29
|
- Use these to nest different options within a single menu item - For example choosing a flag to apply from a list, or choosing an optional theme (Light mode, Dark mode)
|
|
29
30
|
- You can trigger a Submenu from a Submenu, however try to avoid this whenever possible.
|
|
30
|
-
-
|
|
31
|
+
- An item with a `submenu` shows an `IconChevronRight` automatically — you don't need to add it yourself. If you pass your own `suffix` and set `openSubmenuOnSuffixClick`, clicking the suffix opens the submenu instead.
|
|
31
32
|
|
|
32
33
|
### Alignment
|
|
33
34
|
|
|
@@ -42,7 +43,7 @@ Use `DropdownListDivider` to group related items visually. A divider between des
|
|
|
42
43
|
|
|
43
44
|
- Keep dropdown lists short and scannable. If a menu has more than 6–8 items, consider grouping with dividers or rethinking the information architecture.
|
|
44
45
|
- Lead with the most commonly used actions. Users scan from the top — don't bury "Edit" below five less-frequent options.
|
|
45
|
-
- Destructive actions like Delete should always sit at the bottom of the list, separated by a
|
|
46
|
+
- Destructive actions like Delete should always sit at the bottom of the list, separated by a `DropdownListDivider`. `DropdownListItem` has no `theme` prop, so position and a clear label (e.g. "Delete shift") carry the weight — confirm the action with a `Modal` when it can't be undone.
|
|
46
47
|
- Avoid putting form fields or multi-step interactions inside a Dropdown. If you need that, use a `Popover`.
|
|
47
48
|
- Icons in list items help scannability, but aren't required. If you use icons, be consistent across the whole list — mixing icon and non-icon items looks unbalanced.
|
|
48
49
|
|
|
@@ -55,4 +55,6 @@ Use `as="card"` with `size="medium"` when the empty state needs to sit within a
|
|
|
55
55
|
- `title` is required. All other props are optional.
|
|
56
56
|
- `as` defaults to `"banner"`. Pass `as="card"` explicitly when the empty state should render inside a `Card` wrapper.
|
|
57
57
|
- `onClose` is only valid when `as="card"`. Passing it in banner mode has no effect.
|
|
58
|
-
- `
|
|
58
|
+
- `size` defaults to `"large"`.
|
|
59
|
+
- `header` is not rendered when `size="small"`. Use it only on `medium` and `large` empty states.
|
|
60
|
+
- `mediaUrl` expects the URL of an image or gif. It is used as the `src` of an `<img>`, so pass an absolute URL or a path your app serves. The image's alt text is taken from `title`, so pass `title` as a string when using `mediaUrl`.
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
## When Not to Use
|
|
10
10
|
|
|
11
|
-
- When the user is making a selection rather than entering data — use a standalone `
|
|
11
|
+
- When the user is making a selection rather than entering data — use a standalone `SelectField`, `Toggle`, or `SegmentedControl` instead
|
|
12
12
|
- When a single inline action is needed — avoid wrapping isolated controls in a Form just for layout
|
|
13
13
|
- When there is no submission of information from the user being written by the system
|
|
14
14
|
|
|
@@ -22,9 +22,27 @@ Forms are comprised of the following components:
|
|
|
22
22
|
- `FormSection` - A visual grouping of fields within a form that can have a title and subtitle
|
|
23
23
|
- `FormRow` - A horizontal row of up to 4 fields
|
|
24
24
|
- `FormFooter` Contains the CTA buttons that control the entire form
|
|
25
|
-
-
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
- Field components - The individual fields in a form, such as `TextField`, `SelectField` or `CheckboxField`. See the Field Types table below for the full list
|
|
26
|
+
|
|
27
|
+
Put together, a form looks like this:
|
|
28
|
+
|
|
29
|
+
```tsx
|
|
30
|
+
<Form onSubmit={handleSubmit}>
|
|
31
|
+
<FormSection title="Contact information">
|
|
32
|
+
<FormRow>
|
|
33
|
+
<TextField name="firstName" label="First name" />
|
|
34
|
+
<TextField name="lastName" label="Last name" />
|
|
35
|
+
</FormRow>
|
|
36
|
+
<TextField name="email" label="Email" />
|
|
37
|
+
</FormSection>
|
|
38
|
+
<FormFooter
|
|
39
|
+
actions={{
|
|
40
|
+
primary: <Button>Save</Button>,
|
|
41
|
+
secondary: <Button onClick={handleCancel}>Cancel</Button>
|
|
42
|
+
}}
|
|
43
|
+
/>
|
|
44
|
+
</Form>
|
|
45
|
+
```
|
|
28
46
|
|
|
29
47
|
### Form Widths
|
|
30
48
|
|
|
@@ -45,8 +63,24 @@ Forms are comprised of the following components:
|
|
|
45
63
|
|
|
46
64
|
### Submission and Validation
|
|
47
65
|
|
|
48
|
-
- Typically speaking, each form uses a single submit button to complete. This uses our standard `
|
|
49
|
-
- The primary CTA
|
|
66
|
+
- Typically speaking, each form uses a single submit button to complete. This uses our standard `Button` component.
|
|
67
|
+
- The primary CTA in `FormFooter` is the submit button. Without Formik, handle saving in the `Form` `onSubmit`. With Formik, handle saving in Formik's `onSubmit`: it only runs when validation passes, while the `Form` `onSubmit` also runs when validation fails. Do not save from an `onClick` on the button, so pressing ENTER in a field also submits. A `Form` without `onSubmit` or `formik` does a native form submission, which reloads the page.
|
|
68
|
+
- The primary CTA Button can be disabled while required fields are incomplete. A field doesn't need to be valid to enable it — just attempted (i.e. the user has interacted with it, or it already has a value, such as when editing a saved record). Sous Chef doesn't do this for you: derive the `disabled` prop from your form state. With Formik, for example:
|
|
69
|
+
|
|
70
|
+
```tsx
|
|
71
|
+
const requiredFields = ['firstName', 'email'] as const;
|
|
72
|
+
// Check the value too: fields such as `WeekSelectField` are only marked touched on submit.
|
|
73
|
+
const hasUnattemptedFields = requiredFields.some(
|
|
74
|
+
(name) => !formik.touched[name] && !formik.values[name]
|
|
75
|
+
);
|
|
76
|
+
|
|
77
|
+
<FormFooter
|
|
78
|
+
actions={{
|
|
79
|
+
primary: <Button disabled={hasUnattemptedFields}>Save</Button>
|
|
80
|
+
}}
|
|
81
|
+
/>;
|
|
82
|
+
```
|
|
83
|
+
|
|
50
84
|
- Field error states trigger after the user interacts with a field and leaves it in an invalid state. They do not show on initial load.
|
|
51
85
|
- Example: a required field is empty, the user clicks into it and then moves focus away while it's still empty → error state triggers.
|
|
52
86
|
- Form buttons have a built-in minimum width of 100px.
|
|
@@ -96,4 +130,5 @@ Because forms often have many required and many optional fields, marking every f
|
|
|
96
130
|
| `TextField` | A basic open input field used to get text from the user, with options to add a prefix or suffix element if necessary. Accepts any characters, so do not use if you want to limit the format of the input to numbers only. |
|
|
97
131
|
| `TimeField` | 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. |
|
|
98
132
|
| `TimeRangeField` | 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. |
|
|
133
|
+
| `WeekSelectField` | A row of pills, one per day of a given week, where the user picks one or more days. Use when the user chooses which days of a specific week apply, like the days an employee works that week. |
|
|
99
134
|
| `WeekField` | A special dropdown style field used to select a single week from a calendar widget. Selections must always be 7 consecutive days, but you may customize the day of the week the selectable range starts on. |
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
## When Not to Use
|
|
11
11
|
|
|
12
12
|
- As a standalone element without a label or tooltip — icons are rarely self-explanatory enough to stand alone, especially for new or infrequent users
|
|
13
|
-
- As decoration or expressive visual element with no functional meaning — use an `
|
|
13
|
+
- As decoration or expressive visual element with no functional meaning — use an ink illustration (e.g. `InkWallCalendar`, see the InkIllustrations guidelines) for empty states, onboarding moments, or anywhere illustration-quality imagery is appropriate
|
|
14
14
|
|
|
15
15
|
## Usage
|
|
16
16
|
|
|
@@ -27,12 +27,13 @@ Each icon comes in two variants: `outline` (default) and `solid`. Outline is the
|
|
|
27
27
|
|
|
28
28
|
### Sizes
|
|
29
29
|
|
|
30
|
-
| Size
|
|
31
|
-
|
|
|
32
|
-
| `small`
|
|
33
|
-
| `medium`
|
|
34
|
-
| `default`
|
|
35
|
-
| `large`
|
|
30
|
+
| Size | Dimensions |
|
|
31
|
+
| ------------- | ---------- |
|
|
32
|
+
| `small` | 12×12px |
|
|
33
|
+
| `medium` | 16×16px |
|
|
34
|
+
| `default` | 20×20px |
|
|
35
|
+
| `large` | 24×24px |
|
|
36
|
+
| `extra-large` | 40×40px |
|
|
36
37
|
|
|
37
38
|
`default` is the standard for most UI contexts. Use `small` for dense layouts like table cells or compact toolbars. `flexible` removes the fixed width and height entirely, letting you control the size through CSS — useful in edge cases where none of the named sizes fit the surrounding layout.
|
|
38
39
|
|
|
@@ -52,8 +53,8 @@ By default, icons inherit the colour of their surrounding text. Pass a `color` p
|
|
|
52
53
|
|
|
53
54
|
## Additional Rules
|
|
54
55
|
|
|
55
|
-
-
|
|
56
|
-
- `variant` defaults to `'outline'` if not specified.
|
|
56
|
+
- Icon components accept `size`, `variant`, `color`, and `testId` props, with two exceptions: the Emojis icons have no `variant`, and the full-colour Emojis icons (`IconAwful`, `IconBad`, `IconDecent`, `IconGood` and `IconGreat`) have hard-coded fills, so `color` has no effect on them. Their `Monochromatic` versions (e.g. `IconAwfulMonochromatic`) are a monochromatic alternative, but only the mouth follows the text colour (and `color`); the face and eyes keep fixed fills.
|
|
57
|
+
- `variant` defaults to `'outline'` if not specified (on icons that have it).
|
|
57
58
|
- `size` defaults to `'default'` (20×20px) if not specified.
|
|
58
|
-
- When used inside a `Button`, icon `size`
|
|
59
|
+
- When used inside a `Button`, icon `size` defaults to `'medium'` instead of `'default'`. An explicit `size` still wins, so only pass one inside a button when you really need a different size.
|
|
59
60
|
- `size="flexible"` renders with no `width` or `height` attributes — size must be controlled entirely via CSS.
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
|
|
19
19
|
### Sizing
|
|
20
20
|
|
|
21
|
-
Unlike icons, illustration size is set as a CSS value string — for example `"100px"`, `"200px"`, or a responsive value like `"100%"`. There are no named size tokens. Choose a size that gives the illustration enough presence without overwhelming the surrounding layout. In empty states, something in the range of 80–150px typically works well.
|
|
21
|
+
Unlike icons, illustration size is set as a number of pixels or a CSS value string — for example `"100px"`, `"200px"`, or a responsive value like `"100%"`. There are no named size tokens. Choose a size that gives the illustration enough presence without overwhelming the surrounding layout. In empty states, something in the range of 80–150px typically works well.
|
|
22
22
|
|
|
23
23
|
### Colour
|
|
24
24
|
|
|
@@ -28,11 +28,12 @@ Ink Illustrations are fixed illustrations — they are not colour-customisable.
|
|
|
28
28
|
|
|
29
29
|
- Empty states are the most common use case. A well-chosen illustration paired with a clear heading and a call-to-action ("Add your first employee") transforms a dead end into an invitation.
|
|
30
30
|
- People and hands illustrations work well for onboarding and educational moments — they feel approachable and human without being overly literal.
|
|
31
|
-
- Don't stretch illustrations with
|
|
31
|
+
- Don't stretch illustrations. Set their size with the `size` prop, which sets both the width and the height, rather than giving them a separate width and height in CSS.
|
|
32
32
|
- When pairing an illustration with text in an empty state, centre both horizontally and keep the text concise. The illustration draws the eye — the text closes the loop.
|
|
33
|
+
- `EmptyState` and `Paywall` accept an image URL (`mediaUrl`), not an illustration component, for their media. Their `children` is the body text, so an illustration passed there renders below the title, not as the media. To show an illustration as the media, compose the empty state yourself, for example with a centred `Stack` holding the illustration and `Text`.
|
|
33
34
|
|
|
34
35
|
## Additional Rules
|
|
35
36
|
|
|
36
37
|
- Each illustration is a standalone React component — import and use it directly, no wrapper component required.
|
|
37
|
-
- `size` accepts any valid CSS dimension string and defaults to `'
|
|
38
|
-
- Illustrations are
|
|
38
|
+
- `size` accepts a number of pixels or any valid CSS dimension string, and defaults to `'140px'` if not provided.
|
|
39
|
+
- Illustrations are decorative. Don't use them as interactive controls (such as buttons or links); put the action on a `Button` or `Link` instead.
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
<!-- AUTO-GENERATED by scripts/build-llms-guidelines.js. Do not edit manually. Run `yarn build-llms-guidelines` to regenerate. -->
|
|
2
|
+
|
|
3
|
+
## When to Use
|
|
4
|
+
|
|
5
|
+
- To place elements side by side: a group of buttons, an avatar next to a name, an icon next to text, a row of filters
|
|
6
|
+
- To push elements apart, e.g. a title on the left and an action on the right, with `justifyContent="space-between"`
|
|
7
|
+
- Instead of writing custom CSS with `display: flex` and `gap`, or adding margins between elements
|
|
8
|
+
- Combined with `Stack` to build more complex layouts
|
|
9
|
+
|
|
10
|
+
## When Not to Use
|
|
11
|
+
|
|
12
|
+
- To stack elements in a column. Use `Stack`
|
|
13
|
+
- For two fields side by side in a `Form`. Use `FormRow`, which handles field widths
|
|
14
|
+
- For a two-dimensional grid where rows and columns must line up. There is no grid component; use custom CSS grid with the Sous Chef tokens
|
|
15
|
+
- For tabular data. Use `DataTable` or `BasicTable`
|
|
16
|
+
- To style a few words within a sentence. Nest a `Text as="span"` inside the `Text` instead
|
|
17
|
+
|
|
18
|
+
## Usage
|
|
19
|
+
|
|
20
|
+
### Space
|
|
21
|
+
|
|
22
|
+
- `space` is the gap between items, in pixels. It defaults to `20`, which matches `--space-section-default`.
|
|
23
|
+
- It only accepts multiples of `4` from `0` to `60` (`0`, `4`, `8`, `12` … `60`), the same 4px scale as the `--dim-*` tokens. Values off the scale, like `10`, are not allowed.
|
|
24
|
+
- Pick the value that matches the space token for the relationship between the items:
|
|
25
|
+
|
|
26
|
+
| `space` | Token | When to use |
|
|
27
|
+
| -------------- | ------------------------- | --------------------------------------------- |
|
|
28
|
+
| `4` | `--space-content-xs` | An icon and its label |
|
|
29
|
+
| `8` | `--space-content-sm` | An avatar and a name, chips or pills in a row |
|
|
30
|
+
| `12` | `--space-content-md` | A group of buttons |
|
|
31
|
+
| `16` | `--space-content-lg` | Parts inside a card or modal |
|
|
32
|
+
| `20` (default) | `--space-section-default` | Cards side by side, a row of filters |
|
|
33
|
+
|
|
34
|
+
- When items wrap (`flexWrap="wrap"`), pass `{ row, column }` to set the gap between rows and between items separately, e.g. `space={{ row: 8, column: 16 }}`.
|
|
35
|
+
|
|
36
|
+
### Alignment
|
|
37
|
+
|
|
38
|
+
In an `Inline` the items run left to right, so:
|
|
39
|
+
|
|
40
|
+
- `alignItems` sets the **vertical** alignment: `flex-start` (default), `center`, `flex-end` or `stretch`. Use `center` when items have different heights, such as an icon next to text or an avatar next to a name.
|
|
41
|
+
- `justifyContent` sets the **horizontal** distribution: `start` (default), `center`, `end` or `space-between`. Use `end` to align a group of buttons to the right, and `space-between` to push items to opposite ends.
|
|
42
|
+
|
|
43
|
+
### Sizing and wrapping
|
|
44
|
+
|
|
45
|
+
- `flex` sets the CSS `flex` value of each child by position. For example, `flex={[1]}` makes the first child fill the remaining width, such as a search field next to a button. Children without an entry, or with a falsy entry such as the number `0`, use `0 1 auto`. Pass the string `'0 0 auto'` to make a child neither grow nor shrink.
|
|
46
|
+
- `flexWrap` defaults to `nowrap`, so items stay on one line and may overflow. Set `flexWrap="wrap"` for lists of variable length, such as chips or filters.
|
|
47
|
+
- `inlineFlex` makes the `Inline` only as wide as its content.
|
|
48
|
+
- `flexGrow` lets the `Inline` itself grow when it is a child of another `Stack` or `Inline`.
|
|
49
|
+
|
|
50
|
+
## Additional Rules
|
|
51
|
+
|
|
52
|
+
- Each child is wrapped in its own item `div`. Direct children that are `null`, `undefined` or `false` are dropped and don't create a gap, so conditional rendering like `{isVisible && <Button />}` is safe. A component that renders `null` still gets a wrapper, so its neighbours keep the gap around it; render it conditionally from the parent instead.
|
|
53
|
+
- Don't add margins to the children to tweak the space. Change `space`, or nest another `Inline` with a different `space` for a sub-group.
|
|
54
|
+
- In a group of buttons, the primary action is the right-most button.
|
|
55
|
+
- Prefer `Inline` over `Flex`. `Flex` is internal to Sous Chef and is not exported.
|
|
@@ -23,7 +23,8 @@
|
|
|
23
23
|
- Without a title, the banner renders as a compact single-line layout
|
|
24
24
|
- If the message is critical, do not let the user dismiss it.
|
|
25
25
|
- Use `primaryButton` and `secondaryButton` to offer CTAs. Button themes are inferred from the banner theme automatically — do not manually set button themes inside InlineBanner
|
|
26
|
-
-
|
|
26
|
+
- `secondaryButton` and `caption` are only rendered when a `primaryButton` is also provided. A secondary button on its own will not appear
|
|
27
|
+
- Use a caption below the CTAs for supplementary detail, plan names, or pricing info. The caption only appears in the multi-line layout, so it requires a `title`
|
|
27
28
|
- Only override the icon when there is a strong contextual reason — the default icon communicates the theme reliably
|
|
28
29
|
|
|
29
30
|
### Where Do Banners Go?
|
|
@@ -31,7 +32,7 @@
|
|
|
31
32
|
- A good rule is to keep the banner relatively nearby to what it is referring to.
|
|
32
33
|
- Banners relevant to an entire page should be placed at the top of that page, below the page header. They should occupy the full width of the content area.
|
|
33
34
|
- Banners related to a section of a page (like a card, drawer, or modal) should be placed inside that section, below any section heading.
|
|
34
|
-
- When only a specific UI element is paywalled within a section of content, the feature is typically replaced with an
|
|
35
|
+
- When only a specific UI element is paywalled within a section of content, the feature is typically replaced with an `InlineBanner` with `theme="upsell"` for said feature.
|
|
35
36
|
|
|
36
37
|
### Choosing a theme
|
|
37
38
|
|
|
@@ -48,5 +49,6 @@
|
|
|
48
49
|
- `children` is required — the banner body text.
|
|
49
50
|
- `theme` defaults to `"info"`. Always pass it explicitly so the intent is clear.
|
|
50
51
|
- Providing `title` changes the layout from single-line to multi-line. Do not use `title` for single-line messages where the body text is sufficient.
|
|
51
|
-
- `primaryButton` and `secondaryButton` accept a `Button` element. The component infers the
|
|
52
|
+
- `primaryButton` and `secondaryButton` accept a `Button` element. The component infers the button theme: both buttons get `hollow`, except the primary button in an `upsell` banner, which gets `upsell`. A `theme` passed on the button takes precedence — do not pass one unless you intentionally need to override it.
|
|
53
|
+
- `secondaryButton` and `caption` are ignored when there is no `primaryButton`. `caption` is also only rendered when `title` is set (multi-line layout).
|
|
52
54
|
- The `icon` prop is an escape hatch. Only use icons from Sous Chef — custom SVGs will break visual consistency.
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
## When to Use
|
|
2
2
|
|
|
3
3
|
- When the user needs to select more than one option from a predefined list — selected items appear as removable chips inside the field
|
|
4
|
-
- When the set of valid options
|
|
4
|
+
- When the set of valid options can be passed up front through `options`. MultiSelectField has no async loading — if the options come from a server, fetch them first and pass the result to `options`. Don't reach for `AsyncSelectField` here: it is single-select only
|
|
5
5
|
- When you want to allow the user to create new options on the fly in addition to selecting from the existing list (via `onCreate` + `creatableButton`)
|
|
6
6
|
- When options benefit from logical grouping (e.g. cities grouped by province)
|
|
7
7
|
|
|
8
8
|
## When Not to Use
|
|
9
9
|
|
|
10
10
|
- When only a single selection is allowed — use `SelectField` instead
|
|
11
|
-
- When the list of options is
|
|
11
|
+
- When the list of options is too large to load up front and must be searched on the server — no Sous Chef field supports async multi-select, so reconsider the interaction (e.g. a single-select `AsyncSelectField` that adds each pick to a list)
|
|
12
12
|
- When the number of choices is small and benefits from full visual exposure — use `PillSelectField` or `CheckboxField` instead
|
|
13
13
|
- When the user must confirm a single boolean — use `CheckboxField` instead
|
|
14
14
|
|