@7shifts/sous-chef 4.7.1 → 4.8.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 (72) hide show
  1. package/dist/empty_states/EmptyState/EmptyState.d.ts +3 -0
  2. package/dist/empty_states/Paywall/Paywall.d.ts +3 -0
  3. package/dist/feedback/CircularProgress/CircularProgress.d.ts +3 -0
  4. package/dist/feedback/InlineBanner/InlineBanner.d.ts +3 -0
  5. package/dist/feedback/MicroBanner/MicroBanner.d.ts +3 -0
  6. package/dist/feedback/PersistentBanner/PersistentBanner.d.ts +3 -0
  7. package/dist/feedback/ProgressBar/ProgressBar.d.ts +3 -0
  8. package/dist/feedback/Skeleton/Skeleton.d.ts +3 -0
  9. package/dist/forms/ColorField/ColorField.d.ts +3 -0
  10. package/dist/forms/FormFeedback/FormFeedback.d.ts +3 -0
  11. package/dist/forms/FormFooter/FormFooter.d.ts +3 -0
  12. package/dist/forms/FormSection/FormSection.d.ts +3 -0
  13. package/dist/forms/PhoneField/PhoneField.d.ts +3 -0
  14. package/dist/forms/TextField/TextField.d.ts +3 -1
  15. package/dist/forms/WeekSelectField/WeekSelectField.d.ts +3 -0
  16. package/dist/icons/components/arrows/IconArrowLeftRight.d.ts +10 -0
  17. package/dist/icons/components/arrows/index.d.ts +1 -0
  18. package/dist/icons/components/communication/IconLanguage.d.ts +10 -0
  19. package/dist/icons/components/communication/index.d.ts +1 -0
  20. package/dist/icons/components/controls/IconInputText.d.ts +10 -0
  21. package/dist/icons/components/controls/IconListRadio.d.ts +10 -0
  22. package/dist/icons/components/controls/index.d.ts +2 -0
  23. package/dist/index.css +1 -1
  24. package/dist/index.css.map +1 -1
  25. package/dist/index.js +433 -152
  26. package/dist/index.js.map +1 -1
  27. package/dist/index.modern.js +430 -153
  28. package/dist/index.modern.js.map +1 -1
  29. package/dist/layout/Card/Card.d.ts +3 -0
  30. package/dist/layout/Page/Page.d.ts +3 -0
  31. package/dist/lists/Accordion/Accordion.d.ts +3 -0
  32. package/dist/lists/ActionList/ActionList.d.ts +3 -0
  33. package/dist/lists/DataTable/DataTable.d.ts +3 -0
  34. package/dist/media/Avatar/Avatar.d.ts +3 -0
  35. package/dist/media/Badge/Badge.d.ts +4 -1
  36. package/dist/media/Chip/Chip.d.ts +3 -0
  37. package/dist/media/Pill/Pill.d.ts +3 -0
  38. package/dist/navigation/Breadcrumbs/Breadcrumbs.d.ts +3 -0
  39. package/dist/navigation/PrimaryNav/PrimaryNav.d.ts +3 -0
  40. package/dist/navigation/Tabs/Tabs.d.ts +3 -0
  41. package/dist/overlay/Calendar/Calendar.d.ts +3 -1
  42. package/dist/overlay/Dropdown/Dropdown.d.ts +3 -0
  43. package/dist/overlay/HintModal/HintModal.d.ts +3 -0
  44. package/dist/overlay/Modal/Modal.d.ts +3 -0
  45. package/dist/overlay/Popover/Popover.d.ts +3 -0
  46. package/dist/overlay/Tooltip/Tooltip.d.ts +3 -0
  47. package/llms-instructions/guidelines/AsyncSelectField.guidelines.md +20 -0
  48. package/llms-instructions/guidelines/Avatar.guidelines.md +1 -0
  49. package/llms-instructions/guidelines/Breadcrumbs.guidelines.md +1 -0
  50. package/llms-instructions/guidelines/CheckboxField.guidelines.md +20 -0
  51. package/llms-instructions/guidelines/ColorField.guidelines.md +18 -0
  52. package/llms-instructions/guidelines/CurrencyField.guidelines.md +28 -0
  53. package/llms-instructions/guidelines/DateField.guidelines.md +22 -0
  54. package/llms-instructions/guidelines/DateRangeField.guidelines.md +21 -0
  55. package/llms-instructions/guidelines/MultiSelectField.guidelines.md +22 -0
  56. package/llms-instructions/guidelines/NumberField.guidelines.md +29 -0
  57. package/llms-instructions/guidelines/PaginationControls.guidelines.md +1 -0
  58. package/llms-instructions/guidelines/PasswordField.guidelines.md +20 -0
  59. package/llms-instructions/guidelines/PercentageField.guidelines.md +22 -0
  60. package/llms-instructions/guidelines/PhoneField.guidelines.md +23 -0
  61. package/llms-instructions/guidelines/PillSelectField.guidelines.md +22 -0
  62. package/llms-instructions/guidelines/RadioGroupField.guidelines.md +20 -0
  63. package/llms-instructions/guidelines/SelectField.guidelines.md +24 -0
  64. package/llms-instructions/guidelines/Tabs.guidelines.md +4 -0
  65. package/llms-instructions/guidelines/TextAreaField.guidelines.md +25 -0
  66. package/llms-instructions/guidelines/TextField.guidelines.md +22 -0
  67. package/llms-instructions/guidelines/TimeField.guidelines.md +23 -0
  68. package/llms-instructions/guidelines/TimeRangeField.guidelines.md +19 -0
  69. package/llms-instructions/guidelines/WeekField.guidelines.md +20 -0
  70. package/llms-instructions/guidelines/WeekSelectField.guidelines.md +1 -0
  71. package/llms-instructions/llms-components.md +80 -0
  72. package/package.json +1 -1
@@ -10,5 +10,8 @@ type Props = {
10
10
  actions?: MenuAction[];
11
11
  testId?: string;
12
12
  } & PositionStyles & DataProps;
13
+ /**
14
+ * Card is a versatile container that groups related content or options into a visually distinct surface. It's used to introduce visual separation between pieces of content without requiring a full page boundary. It is used to perceptually group content into a meaningful whole. Cards are simple container components that can hold whatever content the designer sees fit.
15
+ */
13
16
  declare const Card: ({ children, onClick, onClose, isSelected, disabled, actions, testId, ...rest }: Props) => React.JSX.Element;
14
17
  export default Card;
@@ -18,5 +18,8 @@ type Props = {
18
18
  testId?: string;
19
19
  children: React.ReactNode;
20
20
  };
21
+ /**
22
+ * Page component is used to control the elements within a page like breadcrumbs, title, subtitle, actions, banner, and filter bar.
23
+ */
21
24
  declare const Page: ({ children, breadcrumbs, title, subtitle, actions, banner, filterBar, size, testId }: Props) => React.JSX.Element;
22
25
  export default Page;
@@ -6,5 +6,8 @@ type Props = {
6
6
  onExpand?: (item: AccordionItemType) => void;
7
7
  defaultOpenId?: string;
8
8
  } & DataProps;
9
+ /**
10
+ * Accordion groups related content into a list of collapsible sections. Only one section can be open at a time, keeping the interface compact while still making all content accessible.
11
+ */
9
12
  declare const Accordion: ({ items, onExpand, defaultOpenId, ...rest }: Props) => React.JSX.Element | null;
10
13
  export default Accordion;
@@ -7,5 +7,8 @@ type Props = {
7
7
  emptyState?: ActionListEmptyState;
8
8
  maxHeight?: number;
9
9
  };
10
+ /**
11
+ * 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.
12
+ */
10
13
  declare const ActionList: ({ children, testId, title, emptyState, maxHeight }: Props) => React.JSX.Element;
11
14
  export default ActionList;
@@ -33,5 +33,8 @@ type Props<T> = {
33
33
  stickyColumns?: StickyColumns;
34
34
  emptyState?: DataTableEmptyStateType;
35
35
  } & DataProps & PositionStyles;
36
+ /**
37
+ * 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.
38
+ */
36
39
  declare const DataTable: <T extends unknown>({ items, columns, itemComponent, maxHeight, hasPrevious, hasNext, onPreviousClick, onNextClick, onSort, isLoading, showActionMenu, footerComponent, hasVerticalBorders, testId, skeletonRowLayout, stickyColumns, emptyState, ...rest }: Props<T>) => React.JSX.Element;
37
40
  export default DataTable;
@@ -8,5 +8,8 @@ type Props = {
8
8
  alt?: string;
9
9
  testId?: string;
10
10
  };
11
+ /**
12
+ * Avatar represents a person or entity — such as a company, location, department, or role — with a visual identifier. It appears wherever a person or entity's identity needs to be communicated at a glance.
13
+ */
11
14
  declare const Avatar: React.FC<Props>;
12
15
  export default Avatar;
@@ -2,9 +2,12 @@ import React from 'react';
2
2
  type Props = {
3
3
  children: React.ReactNode;
4
4
  theme?: 'success' | 'danger' | 'warning' | 'info';
5
- /** This will show a black tooltip when the user hover the button */
5
+ /** This will show a black tooltip when the user hover the badge */
6
6
  title?: string;
7
7
  testId?: string;
8
8
  };
9
+ /**
10
+ * Badge is a small circular indicator used to draw attention to something associated with another element — a count, a status, or a quick action.
11
+ */
9
12
  declare const Badge: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLDivElement>>;
10
13
  export default Badge;
@@ -7,5 +7,8 @@ type Props = {
7
7
  /** This is used for overriding the default data-testid */
8
8
  testId?: string;
9
9
  };
10
+ /**
11
+ * Chip is a compact label used to communicate status about a nearby element — things like feature availability, product tier, or release stage. It is visually similar to Pill but serves a distinct purpose: where Pill communicates the status of data or records, Chip communicates the status of the product or interface itself.
12
+ */
10
13
  declare const Chip: ({ children, theme, testId }: Props) => React.JSX.Element;
11
14
  export default Chip;
@@ -6,5 +6,8 @@ type Props = {
6
6
  theme?: PillTheme;
7
7
  testId?: string;
8
8
  };
9
+ /**
10
+ * Pill is a compact status label that communicates the current state of a data record or object. It appears alongside the thing it describes and gives users a quick, at-a-glance read on what state something is in — approved, pending, active, declined, and so on.
11
+ */
9
12
  declare const Pill: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLDivElement>>;
10
13
  export default Pill;
@@ -2,5 +2,8 @@ import React from 'react';
2
2
  type Props = {
3
3
  children: React.ReactNode;
4
4
  };
5
+ /**
6
+ * Breadcrumbs show the user where they are in the app's hierarchy and let them navigate back up to a parent page. They appear at the top of a page when that page is reached by drilling into a deeper level of the product.
7
+ */
5
8
  declare const Breadcrumbs: ({ children }: Props) => React.JSX.Element;
6
9
  export default Breadcrumbs;
@@ -11,5 +11,8 @@ type Props = {
11
11
  /** Accessible label announced for the nav landmark. Defaults to "Main". */
12
12
  ariaLabel?: string;
13
13
  };
14
+ /**
15
+ * PrimaryNav is a vertical navigation component that provides a consistent way for users to navigate through the main sections of an application.
16
+ */
14
17
  declare const PrimaryNav: ({ children, isExpanded, onToggleExpand, footer, shortLogo, longLogo, ariaLabel }: Props) => React.JSX.Element;
15
18
  export default PrimaryNav;
@@ -5,5 +5,8 @@ type Props = {
5
5
  defaultValue?: string;
6
6
  onValueChange?: (value: string) => void;
7
7
  };
8
+ /**
9
+ * Tabs organize content into sections within a single view, letting users switch between them without leaving the page.
10
+ */
8
11
  declare const Tabs: ({ children, value, defaultValue, onValueChange }: Props) => React.JSX.Element;
9
12
  export default Tabs;
@@ -23,6 +23,8 @@ type Props = {
23
23
  testId?: string;
24
24
  onMonthChange?: (month: Date) => void;
25
25
  };
26
- /**Calendar overlay component*/
26
+ /**
27
+ * Calendar is a date picker component that allows users to select a single day or a week. Used when you want to trigger it from a custom element such a button.
28
+ */
27
29
  declare const Calendar: React.FC<Props>;
28
30
  export default Calendar;
@@ -14,5 +14,8 @@ type Props = {
14
14
  /** Sets the z-index of the dropdown menu pane */
15
15
  zIndex?: number | ZIndex;
16
16
  };
17
+ /**
18
+ * Dropdown is an overlay that reveals a list of actions or options when a user clicks or hovers a trigger element. It is the go-to pattern for contextual menus — things like "Edit, Duplicate, Delete" on a table row, or a set of filter options behind a button.
19
+ */
17
20
  declare const Dropdown: ({ trigger, triggersOn, alignment, width, maxHeight, testId, children, triggerWidth, zIndex }: Props) => React.JSX.Element;
18
21
  export default Dropdown;
@@ -11,5 +11,8 @@ export type Props = {
11
11
  testId?: string;
12
12
  onSetDoNotShowAgainStatus?: (doNotShowAgain: boolean) => void;
13
13
  } & PositionStyles;
14
+ /**
15
+ * Hint Modal is a lightweight modal used to surface tips, guidance, or onboarding callouts to users the first time they encounter a feature or page. Unlike a regular Modal, it is not triggered by a user action — it appears automatically when the user navigates somewhere that warrants a guided introduction. It includes a "Don't show this again" option so users can dismiss it permanently once they've absorbed the information.
16
+ */
14
17
  declare const HintModal: ({ header, children, mediaUrl, onClose, modalId, primaryButton, secondaryButton, testId, onSetDoNotShowAgainStatus, ...positionProps }: Props) => React.JSX.Element;
15
18
  export default HintModal;
@@ -18,6 +18,9 @@ type Props = {
18
18
  shouldReturnFocusAfterClose?: boolean;
19
19
  testId?: string;
20
20
  } & DataProps;
21
+ /**
22
+ * 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.
23
+ */
21
24
  declare const Modal: {
22
25
  ({ children, header, subHeader, onClose, loading, zIndex, rootElementId, width, height, maxWidth, shouldReturnFocusAfterClose, testId, ...otherProps }: Props): React.JSX.Element;
23
26
  setAppElement(rootElement: string | HTMLElement): void;
@@ -14,5 +14,8 @@ type Props = {
14
14
  /** Sets the z-index of the dropdown menu pane */
15
15
  zIndex?: number | ZIndex;
16
16
  };
17
+ /**
18
+ * Popover is a contextual overlay "widget" that appears anchored to a trigger element and can contain rich, interactive content. It sits between a `Tooltip` and a `Modal` in terms of weight — less disruptive than a modal, but capable of real interaction unlike a tooltip. Use it when you need the user to take action in context, without pulling them away from what they were doing.
19
+ */
17
20
  declare const Popover: (props: Props) => React.JSX.Element;
18
21
  export default Popover;
@@ -24,5 +24,8 @@ type Props = {
24
24
  testId?: string;
25
25
  maxHeight?: string | number;
26
26
  };
27
+ /**
28
+ * Tooltip is a small, non-interactive label that appears on hover to provide a brief explanation. It is the lightest overlay in the system — low interruption, no interaction, disappears when the user moves away. Its job is to add micro-clarity: explaining an icon, defining an abbreviation, or surfacing supplementary detail without cluttering the UI.
29
+ */
27
30
  declare const Tooltip: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLElement>>;
28
31
  export default Tooltip;
@@ -0,0 +1,20 @@
1
+ ## When to Use
2
+
3
+ - When the user needs to select from a list of options that is loaded dynamically from an API or other async source — employees, roles, locations, etc.
4
+ - When the full list of options is too large to load upfront and should be fetched on demand or filtered server-side
5
+ - When the available options depend on another field's value (e.g. employees filtered by location)
6
+
7
+ ## When Not to Use
8
+
9
+ - When the list of options is fixed and known at render time — use `SelectField` instead
10
+ - When the user must be able to select more than one option — use `MultiSelectField` instead
11
+ - When the options are few and benefit from being fully visible — use `RadioGroupField` or `PillSelectField` instead
12
+ - When the user needs to enter free-form text — use `TextField` instead
13
+
14
+ ## Usage
15
+
16
+ ### Copy
17
+
18
+ - Use sentence case for labels, captions, and placeholder text
19
+ - Write placeholder text as a concrete search prompt ("Search for an employee") rather than a generic instruction ("Select something")
20
+ - Keep labels short — one to three words is ideal
@@ -25,6 +25,7 @@ Avatars can display different kinds of content. Within 7shifts, the entity being
25
25
  ### Sizes
26
26
 
27
27
  Avatars come in four sizes: `small`, `medium`, `large`, and `extra-large`. Choose the size based on how prominent the identity needs to be and what works in your layout.
28
+ On table cells and list rows, `medium` is the most common size as `small` is quite small.
28
29
 
29
30
  ### Colour
30
31
 
@@ -2,6 +2,7 @@
2
2
 
3
3
  ## When to Use
4
4
 
5
+ - When using it outside of a `Page` component as it already handles breadcrumbs for you. But if you are using it outside of a `Page` component, use breadcrumbs when the user may need to navigate back to a parent page.
5
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
6
7
  - When the navigation path has two or more levels and the parent context is meaningful
7
8
  - When the user arrived at the current page by drilling down from a list or overview
@@ -0,0 +1,20 @@
1
+ ## When to Use
2
+
3
+ - To collect a simple boolean confirmation from the user — agreeing to terms, enabling a setting, or acknowledging a statement
4
+ - When the user can independently toggle an option on or off without affecting other fields
5
+ - When multiple options may be selected from a list (use one `CheckboxField` per option rather than `RadioGroupField`, which enforces single selection)
6
+ - When a parent checkbox needs to represent a group of children with mixed checked/unchecked states — use the `indeterminate` prop
7
+
8
+ ## When Not to Use
9
+
10
+ - When only one option from a list may be chosen — use `RadioGroupField` instead
11
+ - When the user is selecting from a predefined list of many options — use `SelectField`, `MultiSelectField`, or `PillSelectField` instead
12
+ - When the value is not a simple boolean — use the appropriate typed field (`TextField`, `NumberField`, etc.)
13
+
14
+ ## Usage
15
+
16
+ ### Copy
17
+
18
+ - Use sentence case for labels and captions
19
+ - Write labels as affirmative statements the user is confirming ("Appear as employee", "Accept terms and conditions") rather than as questions
20
+ - Keep labels concise; use `caption` for any additional explanation that does not fit in a short label
@@ -0,0 +1,18 @@
1
+ ## When to Use
2
+
3
+ - When the user needs to choose a single color from the design system's sequential color palette — for example, assigning a color to a role, a tag, or a category
4
+ - When the stored value must be a hex string that maps back to a theme-aware sequential color token
5
+
6
+ ## When Not to Use
7
+
8
+ - When the user needs to select from a list of non-color options — use `SelectField` instead
9
+ - When color is purely decorative and not a user-configurable value — render a static swatch instead
10
+ - When you need a free-form text input — use `TextField` instead
11
+
12
+ ## Usage
13
+
14
+ ### Copy
15
+
16
+ - Use sentence case for labels and captions
17
+ - Keep labels short and descriptive — "Role color", "Tag color", "Event color"
18
+ - Use caption text to explain what the color will be applied to (e.g. "The color displayed on the schedule for this role")
@@ -0,0 +1,28 @@
1
+ ## When to Use
2
+
3
+ - When the user must enter a monetary value — wages, prices, budgets, tips, or any other currency amount
4
+ - When the input should be formatted as currency on blur (e.g. `1234.56` becomes `1,234.56`)
5
+ - When only non-negative numeric input is valid and a currency symbol prefix is expected
6
+
7
+ ## When Not to Use
8
+
9
+ - When the value is a plain number without currency semantics — use `NumberField` instead
10
+ - When the value is a percentage — use `PercentageField` instead
11
+ - When the user should pick from a predefined list of amounts — use `SelectField` instead
12
+ - When the input accepts any characters — use `TextField` instead
13
+
14
+ ## Usage
15
+
16
+ ### Formatting behaviour
17
+
18
+ - On blur the raw numeric value is normalized: two decimal places by default, zero decimal places when `step` is a whole number
19
+ - A thousands-separator mask (`1,234.56`) is displayed over the input when the field is not focused
20
+ - Scrolling over the input does not change the value (scroll-to-change is disabled)
21
+ - Negative values and the `e` key (scientific notation) are always blocked regardless of `step`
22
+
23
+ ### Copy
24
+
25
+ - Use short, descriptive labels in sentence case — "Hourly rate", "Amount", "Total cost"
26
+ - Do not use the label to explain the currency; the `currencySymbol` prefix communicates that visually
27
+ - Captions can clarify scope or units — e.g. "Before tax" or "Per shift" — but keep them brief
28
+ - Avoid placeholder text; the currency symbol prefix already signals the expected format
@@ -0,0 +1,22 @@
1
+ ## When to Use
2
+
3
+ - When the user must select a single specific date from a calendar widget
4
+ - When free-form date entry alone is insufficient and a visual calendar picker improves accuracy
5
+ - When you need to constrain selectable dates (e.g. past dates only, future dates only, or an arbitrary set of rules)
6
+ - When you want to highlight notable dates — pay days, holidays, blackout periods — directly on the calendar
7
+
8
+ ## When Not to Use
9
+
10
+ - When the user needs to select a start and end date — use `DateRangeField` instead
11
+ - When the user needs to select an entire week — use `WeekField` instead
12
+ - When the user needs to select a time — use `TimeField` instead
13
+ - When a date and time are needed together, compose `DateField` with `TimeField` separately
14
+
15
+ ## Usage
16
+
17
+ ### Copy
18
+
19
+ - Use sentence case for labels, captions, and placeholder text
20
+ - Keep labels short and specific to the date being captured (e.g. "Start date", "Birthday", "Effective date")
21
+ - When the date has business significance, use a caption to clarify the expected value (e.g. "Date the change takes effect")
22
+ - Avoid overriding the placeholder unless the default format string is genuinely unclear in context
@@ -0,0 +1,21 @@
1
+ ## When to Use
2
+
3
+ - When the user must select both a start date and an end date to define a contiguous date range (e.g. time-off requests, pay periods, reporting windows)
4
+ - When the two date boundaries need to be chosen independently — the user picks the start first, then the end, via separate calendar pickers
5
+ - When you need to surface contextual date information alongside the picker (e.g. pay days, holidays, blackout periods) using `highlightedDays`
6
+
7
+ ## When Not to Use
8
+
9
+ - When only a single date is needed — use `DateField` instead
10
+ - When the selection must always span exactly seven consecutive days — use `WeekField` instead
11
+ - When the user is selecting a time range rather than a date range — use `TimeRangeField` instead
12
+ - When the range boundaries are times within a single day — use `TimeField` or `TimeRangeField` instead
13
+
14
+ ## Usage
15
+
16
+ ### Copy
17
+
18
+ - Use sentence case for labels and captions
19
+ - Labels should be short and describe the range being selected, not the action (e.g. "Time off range", "Pay period", "Report dates")
20
+ - Captions can clarify the purpose or constraints (e.g. "Select start and end date", "Maximum 7 days")
21
+ - The default placeholder mirrors the date format (`MM/DD/YYYY`); only override it if the format is non-obvious to the user
@@ -0,0 +1,22 @@
1
+ ## When to Use
2
+
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 is fixed and known ahead of time; for dynamic lists loaded from a server, use `AsyncSelectField` instead
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
+ - When options benefit from logical grouping (e.g. cities grouped by province)
7
+
8
+ ## When Not to Use
9
+
10
+ - When only a single selection is allowed — use `SelectField` instead
11
+ - When the list of options is loaded dynamically from a server — use `AsyncSelectField` instead
12
+ - When the number of choices is small and benefits from full visual exposure — use `PillSelectField` or `CheckboxField` instead
13
+ - When the user must confirm a single boolean — use `CheckboxField` instead
14
+
15
+ ## Usage
16
+
17
+ ### Copy
18
+
19
+ - Use sentence case for labels, captions, and placeholder text
20
+ - Write placeholder text as a concrete example of what to pick ("Select a language"), not as an instruction ("Choose options")
21
+ - Keep labels short — one to three words is ideal
22
+ - Label the `creatableButton` with an action phrase that names the thing being created ("Add city", "Create new type")
@@ -0,0 +1,29 @@
1
+ ## When to Use
2
+
3
+ - When the user must enter a numeric value — whole numbers by default
4
+ - When you need built-in range enforcement (minimum and maximum bounds)
5
+ - When the value may include decimals — configure `precision` and `stepSize` accordingly
6
+ - When negative values are valid — set `min` to a negative number to unlock them
7
+
8
+ ## When Not to Use
9
+
10
+ - When the value is a currency amount — use `CurrencyField` instead, which handles currency formatting automatically
11
+ - When the value is a percentage — use `PercentageField` instead
12
+ - When the input accepts any characters or free-form text — use `TextField` instead
13
+ - When the user should pick from a predefined list — use `SelectField` or `AsyncSelectField` instead
14
+ - When the value is a date or time — use `DateField`, `TimeField`, or their range variants instead
15
+
16
+ ## Usage
17
+
18
+ ### Behavior notes
19
+
20
+ - Scientific notation (`e`) and the `+` key are always blocked
21
+ - The `-` key is blocked when `min` is `0` or greater (the default); set `min` to a negative value to allow negative input
22
+ - The `.` key is blocked when `precision` is `0` (the default) or when the current value is already at `max`
23
+ - Scrolling the mouse wheel over the field does not change the value — the input loses focus on wheel to prevent accidental changes
24
+
25
+ ### Copy
26
+
27
+ - Use sentence case for labels, captions, and placeholder text
28
+ - Keep labels short and specific to the value being entered (e.g. "Time off hours", "Max shifts per week")
29
+ - Write placeholder text as a concrete example ("e.g. 8"), not as an instruction ("Enter a number")
@@ -2,6 +2,7 @@
2
2
 
3
3
  ## When to Use
4
4
 
5
+ - When controlling pagination outside of the `DataTable` component. The `DataTable` component has its own built-in pagination controls, but if you are using a custom table or list implementation, you can use `PaginationControls` to provide the same functionality.
5
6
  - Consider adding pagination if your list of items is around 15 single line text rows in height or more.
6
7
  - When a data set is split across multiple pages and the user needs to step forward or backward through them
7
8
  - When the list or table has a fixed page size and the total count is large enough that showing all records at once is impractical
@@ -0,0 +1,20 @@
1
+ ## When to Use
2
+
3
+ - To collect a password or other sensitive text input that should be masked by default
4
+ - When the user needs the option to reveal what they have typed (the toggle is always rendered)
5
+ - When you want to display a live checklist of password requirements that updates as the user types — use the `criterias` prop for this
6
+
7
+ ## When Not to Use
8
+
9
+ - When the input is not a password or sensitive secret — use `TextField` instead
10
+ - When you want to collect a PIN or numeric code — use `NumberField` or `TextField` depending on whether non-numeric characters are valid
11
+ - When you need to confirm a password matches — render two separate `PasswordField` instances and validate the values yourself; the component does not handle confirmation internally
12
+
13
+ ## Usage
14
+
15
+ ### Copy
16
+
17
+ - Use sentence case for labels and placeholder text
18
+ - Label the field "Password" for login flows and "New password" / "Confirm password" for registration or change-password flows
19
+ - Keep placeholder text generic (e.g. "Type your password") — avoid hinting at format requirements in the placeholder; use `criterias` for that instead
20
+ - Write each criteria label as a short, scannable rule in plain language (e.g. "Min. 8 characters", "1 uppercase letter")
@@ -0,0 +1,22 @@
1
+ ## When to Use
2
+
3
+ - When the user must enter a percentage value — tips contribution, tax rate, discount percentage, etc.
4
+ - When the input must be constrained to a numeric range with a `%` suffix displayed automatically
5
+ - When the percentage should be a whole integer between 0 and 100 (the default behavior)
6
+ - When the percentage may need decimal precision (e.g. 12.5%) or allow negative values (e.g. -10%)
7
+
8
+ ## When Not to Use
9
+
10
+ - When the value is a plain number with no percentage meaning — use `NumberField` instead
11
+ - When the value is a currency amount — use `CurrencyField` instead
12
+ - When the value is free-form text — use `TextField` instead
13
+ - When the user should pick from a predefined list of options — use `SelectField` or `AsyncSelectField` instead
14
+ - When the value is a date or time — use `DateField`, `TimeField`, or their range variants instead
15
+
16
+ ## Usage
17
+
18
+ ### Copy
19
+
20
+ - Use sentence case for labels, captions, and placeholder text
21
+ - Keep labels short and outcome-focused — "Tips contribution", "Discount rate", "Tax rate"
22
+ - Use caption text to clarify the range or meaning when it is not obvious from the label alone (e.g. "The amount of sales contributed to the tip pool")
@@ -0,0 +1,23 @@
1
+ ## When to Use
2
+
3
+ - When collecting a phone number from the user, especially when the number may be international
4
+ - When you need built-in country code selection alongside phone number input
5
+ - When phone number validation is required — the field formats input as the user types and validates on blur using `libphonenumber-js`
6
+ - When integrating with Formik/Yup validation using the exported `isValidPhoneNumber` helper
7
+
8
+ ## When Not to Use
9
+
10
+ - When collecting free-form text that happens to include numbers — use `TextField` instead
11
+ - When collecting a numeric value (not a phone number) — use `NumberField` instead
12
+ - When you only need a plain text input with no formatting — use `TextField` instead
13
+
14
+ ## Usage
15
+
16
+ Changing the country resets the phone input and calls `onChange("")` automatically.
17
+
18
+ ### Copy
19
+
20
+ - Use sentence case for labels and captions
21
+ - A label of "Phone" is sufficient in most contexts; use "Mobile number" or "Work phone" only when distinguishing between multiple phone fields
22
+ - Write captions as context, not instructions — e.g. "The best number we can reach you" rather than "Enter your phone number"
23
+ - Do not use placeholder text as a substitute for a label
@@ -0,0 +1,22 @@
1
+ ## When to Use
2
+
3
+ - When the user must select one or more options from a small, fixed set and the options benefit from being visible all at once rather than hidden in a dropdown
4
+ - When options are short labels that fit naturally as pills — days of the week, shift types, role names
5
+ - When the option count is low enough that displaying them inline does not cause visual clutter (roughly 2–10 items)
6
+ - When users may also need to add or remove their own custom options at runtime (use the creatable mode via `createOptionLabel` and `onCreate`)
7
+
8
+ ## When Not to Use
9
+
10
+ - When the option list is long or dynamic — use `SelectField` or `AsyncSelectField` instead
11
+ - When only a single selection is allowed and all options must be visible — use `RadioGroupField` instead
12
+ - When multiple selections are needed from a longer, searchable list — use `MultiSelectField` instead
13
+ - When options carry enough detail that a pill label alone is insufficient context
14
+
15
+ ## Usage
16
+
17
+ ### Copy
18
+
19
+ - Use sentence case for labels and captions
20
+ - Keep option labels short — one or two words is ideal for pills (e.g. "Mon", "Server", "Host")
21
+ - Caption text should describe what the selection controls, not restate the label (e.g. "Select the days your location is open")
22
+ - For `createOptionLabel`, use an action phrase such as "Add your own" or "Add option"
@@ -0,0 +1,20 @@
1
+ ## When to Use
2
+
3
+ - When the user must select exactly one option from a visible list and needs to see all choices at once to make an informed decision
4
+ - When the number of options is small enough that displaying them all simultaneously is practical
5
+ - When the visual presentation of choices matters — use box-style options (`RadioGroupBoxOption`) for card-like selections with icons or extra context, and standard options (`RadioGroupOption`) for simple text lists
6
+
7
+ ## When Not to Use
8
+
9
+ - When the user can select more than one option — use `CheckboxField` or `MultiSelectField` instead
10
+ - When the option list is long or dynamic — use `SelectField` or `AsyncSelectField` instead, which hide options behind a dropdown
11
+ - When choosing from a short, visually distinct set where a pill layout is preferred — use `PillSelectField` instead
12
+
13
+ ## Usage
14
+
15
+ ### Copy
16
+
17
+ - Use sentence case for the group `label`, option labels, and `caption` text
18
+ - Keep option labels concise — one to four words is ideal
19
+ - Use `caption` on individual options (via `RadioGroupOption` or `RadioGroupBoxOption`) to add brief clarifying detail without cluttering the label
20
+ - Write the group `label` as a noun or short noun phrase ("Restaurant type", "Day parts"), not as a question or instruction
@@ -0,0 +1,24 @@
1
+ ## When to Use
2
+
3
+ - When the user must choose exactly one option from a fixed, predefined list
4
+ - When the list of options is static and known at render time — use `AsyncSelectField` when options are dynamic or fetched from a server
5
+ - When the number of options is large enough that radio buttons would be unwieldy, but the user still only needs a single selection
6
+ - When options can be logically grouped into labeled categories
7
+
8
+ ## When Not to Use
9
+
10
+ - When the list of options is dynamic or loaded from a server — use `AsyncSelectField` instead
11
+ - When the user needs to select more than one option — use `MultiSelectField` instead
12
+ - When the list is short and all options should be visible at once — use `RadioGroupField` instead
13
+ - When the user should select from a visual set of pills (e.g. days of the week) — use `PillSelectField` instead
14
+ - When the value is a date or time — use `DateField`, `TimeField`, or their range variants instead
15
+ - When the value is a color — use `ColorField` instead
16
+
17
+ ## Usage
18
+
19
+ ### Copy
20
+
21
+ - Use sentence case for labels, captions, and placeholder text
22
+ - Write placeholder text as a prompt to act, e.g. "Select a language" rather than repeating the label verbatim
23
+ - Keep labels short — one to three words is ideal
24
+ - For grouped options, use concise, descriptive group labels (e.g. "Saskatchewan", "Alberta") that help the user scan quickly
@@ -15,6 +15,10 @@
15
15
 
16
16
  ## Usage
17
17
 
18
+ ### Spanning Tabs
19
+
20
+ A set of Tabs should always span to fill the entire width of their container, even when the tabs themselves are not long enough to fill it. This gives Tabs a grounded structural feel, instead of feeling like they are floating. The `TabPanel` should also span the entire width of the container and always match the width of the tabs.
21
+
18
22
  ### Tab labels
19
23
 
20
24
  Keep tab labels short — one or two words at most. Labels should name the content category, not describe an action. Use sentence case.
@@ -0,0 +1,25 @@
1
+ ## When to Use
2
+
3
+ - When the input is expected to span multiple lines — notes, descriptions, comments, or other long-form text
4
+ - When the user needs more vertical space to write freely without a fixed line cap
5
+ - When you want to optionally enforce a character limit and show a live countdown to the user
6
+ - When the field needs an embedded toolbar (e.g. action buttons, formatting controls) rendered inside the input area
7
+
8
+ ## When Not to Use
9
+
10
+ - When a single line of input is sufficient — use `TextField` instead
11
+ - When only numbers are valid — use `NumberField` instead
12
+ - When the value is a currency amount — use `CurrencyField` instead
13
+ - When the value is a percentage — use `PercentageField` instead
14
+ - When the user should pick from a predefined list — use `SelectField` or `AsyncSelectField` instead
15
+ - When the value is a date or time — use `DateField`, `TimeField`, or their range variants instead
16
+ - When the input is a password — use `PasswordField` instead
17
+
18
+ ## Usage
19
+
20
+ ### Copy
21
+
22
+ - Use sentence case for labels, captions, and placeholder text
23
+ - Write placeholder text as a concrete example ("e.g. Available Monday mornings"), not as an instruction ("Enter your notes")
24
+ - Keep labels short — one to three words is ideal
25
+ - Use captions to set expectations about how the text will be used (e.g. "These notes will be visible on the schedule")
@@ -0,0 +1,22 @@
1
+ ## When to Use
2
+
3
+ - To collect short, free-form text from the user — names, titles, search queries, notes
4
+ - When the input accepts any characters and has no format constraints
5
+ - When a single line of input is sufficient — use `TextAreaField` for longer or multi-line text
6
+
7
+ ## When Not to Use
8
+
9
+ - When only numbers are valid — use `NumberField` instead
10
+ - When the value is a currency amount — use `CurrencyField` instead
11
+ - When the value is a percentage — use `PercentageField` instead
12
+ - When the user should pick from a predefined list — use `SelectField` or `AsyncSelectField` instead
13
+ - When the value is a date or time — use `DateField`, `TimeField`, or their range variants instead
14
+ - When the input is a password — use `PasswordField` instead
15
+
16
+ ## Usage
17
+
18
+ ### Copy
19
+
20
+ - Use sentence case for labels, captions, and placeholder text
21
+ - Write placeholder text as a concrete example ("e.g. Alex Smith"), not as an instruction ("Enter your name")
22
+ - Keep labels short — one to three words is ideal