@7shifts/sous-chef 4.4.1 → 4.5.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 (53) hide show
  1. package/dist/forms/ColorField/ColorOverlay/ColorOverlay.d.ts +1 -1
  2. package/dist/forms/ColorField/ColorOverlay/domain.d.ts +27 -0
  3. package/dist/foundation/tokens/color/color-constants.d.ts +23 -0
  4. package/dist/foundation/tokens/color/color-types.d.ts +1 -1
  5. package/dist/icons/components/image/IconSchool.d.ts +10 -0
  6. package/dist/icons/components/image/index.d.ts +1 -0
  7. package/dist/index.css +69 -139
  8. package/dist/index.css.map +1 -1
  9. package/dist/index.js +542 -362
  10. package/dist/index.js.map +1 -1
  11. package/dist/index.modern.js +534 -363
  12. package/dist/index.modern.js.map +1 -1
  13. package/dist/overlay/DropdownListItem/DropdownListItem.d.ts +3 -1
  14. package/dist/overlay/hooks/useSubmenu.d.ts +1 -0
  15. package/llms-instructions/guidelines/Accordion.guidelines.md +36 -0
  16. package/llms-instructions/guidelines/ActionList.guidelines.md +59 -0
  17. package/llms-instructions/guidelines/Avatar.guidelines.md +51 -0
  18. package/llms-instructions/guidelines/Badge.guidelines.md +40 -0
  19. package/llms-instructions/guidelines/Breadcrumbs.guidelines.md +41 -0
  20. package/llms-instructions/guidelines/Button.guidelines.md +41 -0
  21. package/llms-instructions/guidelines/Calendar.guidelines.md +40 -0
  22. package/llms-instructions/guidelines/Card.guidelines.md +58 -0
  23. package/llms-instructions/guidelines/Chip.guidelines.md +64 -0
  24. package/llms-instructions/guidelines/CircularProgress.guidelines.md +28 -0
  25. package/llms-instructions/guidelines/DataTable.guidelines.md +88 -0
  26. package/llms-instructions/guidelines/DateFilter.guidelines.md +32 -0
  27. package/llms-instructions/guidelines/Dropdown.guidelines.md +54 -0
  28. package/llms-instructions/guidelines/EmptyState.guidelines.md +58 -0
  29. package/llms-instructions/guidelines/Forms.guidelines.md +99 -0
  30. package/llms-instructions/guidelines/HintModal.guidelines.md +47 -0
  31. package/llms-instructions/guidelines/Icons.guidelines.md +59 -0
  32. package/llms-instructions/guidelines/InkIllustrations.guidelines.md +38 -0
  33. package/llms-instructions/guidelines/InlineBanner.guidelines.md +52 -0
  34. package/llms-instructions/guidelines/Link.guidelines.md +26 -0
  35. package/llms-instructions/guidelines/MicroBanner.guidelines.md +21 -0
  36. package/llms-instructions/guidelines/Modal.guidelines.md +52 -0
  37. package/llms-instructions/guidelines/PaginationControls.guidelines.md +21 -0
  38. package/llms-instructions/guidelines/Paywall.guidelines.md +57 -0
  39. package/llms-instructions/guidelines/PersistentBanner.guidelines.md +33 -0
  40. package/llms-instructions/guidelines/Pill.guidelines.md +55 -0
  41. package/llms-instructions/guidelines/Popover.guidelines.md +42 -0
  42. package/llms-instructions/guidelines/ProgressBar.guidelines.md +35 -0
  43. package/llms-instructions/guidelines/SegmentedControl.guidelines.md +21 -0
  44. package/llms-instructions/guidelines/Skeleton.guidelines.md +30 -0
  45. package/llms-instructions/guidelines/Spinner.guidelines.md +32 -0
  46. package/llms-instructions/guidelines/Toast.guidelines.md +34 -0
  47. package/llms-instructions/guidelines/Toggle.guidelines.md +19 -0
  48. package/llms-instructions/guidelines/ToolbarSelect.guidelines.md +22 -0
  49. package/llms-instructions/guidelines/Tooltip.guidelines.md +45 -0
  50. package/llms-instructions/llms-components.md +61 -261
  51. package/llms-instructions/llms-icons-and-illustrations.md +2 -0
  52. package/llms-instructions/llms-tokens.md +97 -16
  53. package/package.json +6 -1
@@ -0,0 +1,33 @@
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
+ - For global messages that apply to the entire application, not a specific page or section
6
+ - When the message must stay visible until the user dismisses it or the condition resolves
7
+ - For billing, subscription, or plan-level notices that affect access across the app
8
+ - App-wide service announcements, outages, or planned maintenance
9
+
10
+ ## When Not to Use
11
+
12
+ - For page- or section-specific messages — use `InlineBanner` instead
13
+ - For brief action confirmations — use `Toast` instead
14
+ - For compact, space-constrained contexts — use `MicroBanner` instead
15
+
16
+ ## Usage
17
+
18
+ - Choose a theme that is appropriate to the urgency and context of your message. See the `Themes` page for more information on using themes.
19
+ - Keep the message brief — PersistentBanner has no title, so the body text must stand alone and be scannable in one line
20
+ - For buttons use `hollow-contrast` for primary, `link-contrast` for secondary — do not override them
21
+ - You can make a banner dismissable. Use when the information is non-critical and users can reasonably acknowledge it later.
22
+ - One at a time — only one Persistent Banner should appear at a time. If multiple messages compete, show the most critical one.
23
+ - Reserve for app-wide scope — if the message applies only to a specific page or workflow, use Inline Banner instead.
24
+ - Lead with the issue — state what happened or what is needed before explaining why.
25
+
26
+ ## Additional Rules
27
+
28
+ - Use `onDismiss` to let the user close the banner. When provided, a close button appears automatically. Managing whether the banner re-appears is the responsibility of the caller.
29
+ `theme` defaults to "info". Always pass it explicitly.
30
+ - `theme` defaults to `"info"`. Always pass it explicitly.
31
+ - `primaryButton` and `secondaryButton` accept `Button` elements. The component forcefully applies `hollow-contrast` to the primary button and `link-contrast` to the secondary button — any `theme` passed on the button itself will be overridden.
32
+ - `onLoad` fires once on mount — use it to trigger analytics or logging when the banner becomes visible.
33
+ - `onDismiss` does not hide the banner automatically. The caller is responsible for conditionally rendering the component based on dismissed state.
@@ -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 show the status of a record — a shift, an employee, a request, an approval
6
+ - When a list or table row has a state that users need to scan quickly
7
+ - When status needs to be communicated without interrupting the reading flow of a label or title
8
+
9
+ ## When Not to Use
10
+
11
+ - To communicate system or product-level status (feature availability, release stage) — use `Chip` instead
12
+ - When the status requires more explanation than a short label can provide — use `InlineBanner` or `MicroBanner` or a tooltip alongside it
13
+ - As a decorative element — every Pill should correspond to a real, meaningful state
14
+
15
+ ## Usage
16
+
17
+ ### Chip or Pill?
18
+
19
+ Pill and Chip are visually similar and often confused. Use this table to decide which one to reach for:
20
+
21
+ | Question | Yes | No |
22
+ | -------------------------------------------------------------- | ---- | ---- |
23
+ | Is it in a DataTable? | Pill | Chip |
24
+ | Are there multiple items in a cluster that each have a status? | Pill | Chip |
25
+ | Is the status related to a page, section, card, or menu item? | Chip | Pill |
26
+ | Is the status something the user can change through an action? | Pill | Chip |
27
+ | Is the status promotional in nature? | Chip | Pill |
28
+ | Can the item be created, edited, or deleted? | Pill | Chip |
29
+
30
+ ### Themes
31
+
32
+ Pill's theme controls its colour and signals the nature of the status at a glance. Use themes consistently across the product so users learn to read them quickly:
33
+
34
+ | Theme | Use | Examples |
35
+ | --------- | ------------------------------------- | ----------------------------------------------- |
36
+ | `default` | Neutral or unclear state | Pending, Unavailable, Inactive |
37
+ | `success` | Positive or active state | Active, Approved, Available, Connected, Enabled |
38
+ | `danger` | Critical or negative state | Declined, Deleted, Closed, Errors |
39
+ | `warning` | Cautionary or at-risk state | Expiring, Overdue, Needs Attention |
40
+ | `info` | Something has changed or been updated | Modified, Updated |
41
+ | `upsell` | Premium or gated content | Pro, Premium |
42
+
43
+ ## Tips & Tricks
44
+
45
+ - Pill content is almost always a short status label — one to three words.
46
+ - Use themes consistently. If "Approved" is always `success` green in one part of the product, it should be everywhere. Inconsistent theme use erodes the visual language users learn to rely on.
47
+ - Pill and Chip look alike but mean different things. Ask: is this the state of a record in the system, or the state of a product feature? Record → Pill. Feature → Chip.
48
+ - Avoid using more than one Pill per row in a dense list unless each one describes a genuinely different dimension of that record. Multiple pills per row adds visual noise and competes for attention.
49
+ - Default (grey) is for genuinely neutral states — not a fallback when you're unsure which theme to use. If the state has a clear positive or negative valence, pick the right colour.
50
+
51
+ ## Additional Rules
52
+
53
+ - `theme` defaults to `default` if not specified.
54
+ - When `children` is a string or non-numeric value, an `alphabetical` style variant is applied automatically for appropriate letter-spacing and padding.
55
+ - Pill accepts a forwarded ref, making it usable as an anchor for tooltips or popovers when additional context is needed.
@@ -0,0 +1,42 @@
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
+ - When a short task is directly tied to a specific element — editing contact details on a profile row, configuring an option on a widget
6
+ - When a user needs to interact with content, not just read it — buttons, forms, or selections that relate to the trigger
7
+ - When a modal would feel like overkill — the task is lightweight and doesn't require the user's full, undivided attention
8
+ - For micro-flows of one or two steps that are part of a larger workflow
9
+
10
+ ## When Not to Use
11
+
12
+ - For complex multi-step flows — if the task has more than a couple of steps or requires significant decision-making, use a `Modal`
13
+ - For read-only information with no interaction needed — use a `Tooltip` instead
14
+ - As a replacement for a `Dropdown` when the content is simply a list of actions — `Dropdown` is the right tool for action menus
15
+ - When the content is so large it obscures a significant portion of the page
16
+
17
+ ## Usage
18
+
19
+ ### Content
20
+
21
+ Popover is an intentionally open canvas — it doesn't prescribe a structure the way Modal or Dropdown does. You build the content yourself using whatever layout and components the task requires. Keep the content focused on a single task or piece of information. If you find yourself adding tabs or multiple distinct sections, the task has outgrown the Popover.
22
+
23
+ ### Trigger behaviour
24
+
25
+ Like Dropdown, Popover accepts a `trigger` element and opens on click or hover. Click is strongly preferred for interactive content — hover triggers are difficult to use on touch devices and can be accidentally triggered.
26
+
27
+ ### Placement and alignment
28
+
29
+ The popover panel positions itself relative to the trigger. Use `alignment` to control which side it opens on when the default causes overflow or covers adjacent content.
30
+
31
+ ## Tips & Tricks
32
+
33
+ - Think of Popover as the middle ground on the disruption scale: more capable than a Tooltip, lighter than a Modal. If your content is purely informational, reach for Tooltip. If it needs a decision, reach for Modal. If it needs light interaction in context, Popover is the right fit.
34
+ - Popovers work best when they feel attached to what triggered them — keep content tightly focused on the element the user clicked.
35
+ - Never chain Popovers — opening a second Popover from inside a Popover adds complexity that's hard for users to navigate. If a task has branching paths, escalate to a Modal.
36
+ - If you're unsure whether to use a Dropdown or a Popover: Dropdown is for lists of actions. Popover is for everything richer than that.
37
+
38
+ ## Additional Rules
39
+
40
+ - `trigger` is required and must accept a forwarded ref.
41
+ - Popover and Dropdown share the same underlying positioning API — the distinction is in what goes inside, not how they open.
42
+ - Content is rendered as an open `children` slot — use layout components like `Stack` and `Inline` to structure the panel contents.
@@ -0,0 +1,35 @@
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 progress through a multi-step flow — onboarding, setup wizards, form sequences
6
+ - File uploads or processing operations where percentage completion is quantifiable
7
+ - Stepped checkout or configuration flows that benefit from named checkpoints (e.g. "Step 1", "Invite Team")
8
+ - When a horizontal format fits the layout better than a circular indicator
9
+
10
+ ## When Not to Use
11
+
12
+ - When progress is circular or needs to be displayed compactly — use `CircularProgress` instead
13
+ - When there is no meaningful progress to communicate — do not use as a decorative element
14
+ - When the total amount of work/steps is unknown
15
+ - When communicating pass/fail or complete/incomplete status
16
+
17
+ ## Usage
18
+
19
+ Supports two modes: Simple and Stepped
20
+
21
+ ### Simple
22
+
23
+ A continuously filling bar. Progress is treated as a percentage by default, or against a custom max value.
24
+
25
+ ### Stepped
26
+
27
+ The bar fills to the center of the active step, anchoring the indicator to a discrete position. With step labels enabled, text labels render below the bar — one per step, evenly distributed across the full width.
28
+
29
+ ### Best Practices
30
+
31
+ - Use `maxValue` without `steps` when progress is a raw number rather than a step index — for example, `progress={35}` out of `maxValue={100}` for a percentage.
32
+ - Keep step labels short so they fit evenly below the bar without wrapping.
33
+ - Step labels should be short noun phrases: "Step 1", "Account Setup", "Invite Team". Avoid full sentences.
34
+ - Keep label style consistent across all steps in a given bar — do not mix "Step N" style labels with verbose descriptive labels in the same instance.
35
+ - Labels use sentence case.
@@ -0,0 +1,21 @@
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
+ - In a toolbar to switch between two or three distinct views of the same content (e.g. Day / Week / Month)
6
+ - When the options are mutually exclusive and switching between them is immediate
7
+ - When all available options should be visible at a glance rather than hidden in a dropdown
8
+
9
+ ## When Not to Use
10
+
11
+ - When you are switching between sub-pages - use a tab instead.
12
+ - When the entire content of the page is switching - use a tab instead.
13
+ - When there are too many options to comfortably fit in the frame.
14
+ - When the user is submitting a value as part of a form — use a radio group instead.
15
+ - When the options trigger an action rather than change a view — use a `Button` group instead
16
+
17
+ ## Usage
18
+
19
+ - You may include as many items as necessary and will fit in your frame, however the SegmentedControl should never be longer than the component it is controlling.
20
+ - Keep option labels short — one or two words. The control is sized to its content, so long labels create an unbalanced layout.
21
+ - Use nouns or short noun phrases that describe the view, not verbs — "Day", "Week", "Month", not "Show Day", "Show Week".
@@ -0,0 +1,30 @@
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
+ - When loading a page, list, table, or card where the layout is known in advance
6
+ - When the loading duration is long enough that a blank area would feel broken
7
+ - To prevent layout shift — match the skeleton dimensions closely to the content that will replace it
8
+
9
+ ## When Not to Use
10
+
11
+ - For short, unpredictable loading operations — use `Spinner` instead
12
+ - As a permanent placeholder — it should always be replaced by real content once loading is complete.
13
+ - When the layout of the loading content is unknown — a rough skeleton is better than no skeleton, but if the shape would be misleading, use `Spinner`
14
+
15
+ ## Usage
16
+
17
+ - Use `as` to match a specific Sous Chef component shape. When no preset fits, use `height` and `width` to size it manually.
18
+ - `avatar` - Circular avatar at various sizes
19
+ - `button` - Button-shaped rectangle
20
+ - `pill` - Pill/badge shape
21
+ - _(none)_ - Plain rectangle — size with `height` and `width`
22
+
23
+ * Build skeleton layouts that closely match the structure of the real content — a row of skeletons for a list, a wide block for a heading, narrower blocks for body text
24
+ * The loading animation is intentionally delayed by 3.5 seconds to avoid a flash on fast loads
25
+
26
+ ## Additional Rules
27
+
28
+ - When `as` is not provided, `height` and `width` must be set manually — an unsized skeleton collapses to zero height.
29
+ - `height` and `width` accept a number (pixels) or a string with units (e.g. `"75%"`, `"2rem"`).
30
+ - `as` and manual sizing can be combined — `as` sets the shape, and `height`/`width` override the default dimensions of that shape if needed.
@@ -0,0 +1,32 @@
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
+ - When an operation is in progress and the user must wait — submitting a form, fetching data, processing a request
6
+ - As a loading state inside a `Button` (handled automatically by `Button`'s `loading` prop)
7
+
8
+ ## When Not to Use
9
+
10
+ - When loading a page or a structured list of content — use `Skeleton` instead, which reduces layout shift and sets better expectations
11
+ - When no async operation is happening — never show a spinner for decorative purposes
12
+ - loading times are expected to be more than a few seconds. If a spinner is used for a longer load time it can appear to be "stuck" even when its not.
13
+ - If load times are going to be more than a few seconds we should communicate how long the expected wait time will be.
14
+
15
+ ## Usage
16
+
17
+ - The default `size` of 28px suits most contexts. Increase it only when the spinner needs to fill a large empty area.
18
+ - Spinners have their own unique set of themes. These differ from the semantic themes that apply to other components like banners.
19
+
20
+ | Theme | When to use |
21
+ | ---------- | ------------------------------------------------------------------------ |
22
+ | `mint` | Standard backgrounds (default) |
23
+ | `contrast` | Inverse-coloured surfaces that require more visual contrast |
24
+ | `disabled` | Inside a disabled element such as a disabled `Button` in a loading state |
25
+ | `pride` | Seasonal spinner that is active during pride month (June 1-30) |
26
+
27
+ ## Additional Rules
28
+
29
+ - `Button` manages its own spinner internally via the `loading` prop — do not place a `Spinner` inside a `Button` manually.
30
+ - `theme` defaults to `"mint"`
31
+ - `block` defaults to `false`. Pass `block={true}` when centring in a container, rather than wrapping the spinner in a custom centering div.
32
+ - `size` is in pixels and defaults to `28`. Do not pass fractional values.
@@ -0,0 +1,34 @@
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 confirm that an action completed successfully — "Schedule published", "Changes saved"
6
+ - To notify the user of an error that occurred as a result of an action they just took
7
+ - When the message is transient and the user does not need to act on it
8
+ - When an optional follow-up action (like "Undo") is available
9
+
10
+ ## When Not to Use
11
+
12
+ - When the message requires the user to read and respond before continuing — use a modal or `InlineBanner` instead
13
+ - When the message is persistent and must remain visible — use `InlineBanner` or `PersistentBanner` instead
14
+ - When the message is not triggered by a user action — use a banner instead
15
+ - For validation errors on a form — show errors inline on the field instead
16
+
17
+ ## Usage
18
+
19
+ ### Behaviour
20
+
21
+ - Toast dismisses on its own — the user does not need to interact with it.
22
+ - Toasts are automatically always placed 32px from the bottom of the screen, and are centred left and right.
23
+ - If an action is easily undoable, then provide the user the option to undo.
24
+
25
+ ### Best Practices
26
+
27
+ - Use `theme="default"` for confirmations and neutral notifications. Use `theme="danger"` for errors.
28
+ - Toasts should be fired after an action has occurred, such as clicking a submit button in a form.
29
+ - Make sure to call toast at least one component level below the `<SousChefProvider>`.
30
+
31
+ ### Copy Writing
32
+
33
+ - Keep toast messages to one short sentence — the user only has a few seconds to read it
34
+ - Write in past tense for confirmations ("Schedule published") and plain present tense for errors ("Something went wrong")
@@ -0,0 +1,19 @@
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 enable or disable a feature or preference that takes effect immediately
6
+ - When the on/off state is clear and the consequence is easily reversible
7
+ - When a single boolean setting needs to stand on its own outside of a form
8
+
9
+ ## When Not to Use
10
+
11
+ - Inside a form that requires a submit action to save — use a `Checkbox` instead
12
+ - When the user is selecting one option from a group of mutually exclusive choices — use a radio group instead
13
+ - When more than two states are needed — use a `Select` or `SegmentedControl` instead
14
+
15
+ ## Usage
16
+
17
+ - The label should describe the feature or setting being controlled, not the state — "Email notifications", not "Turn on email notifications"
18
+ - Use `caption` to add a short supporting sentence when the label alone may not be enough to communicate the consequence of toggling
19
+ - Avoid using Toggle for settings where the effect is delayed or requires confirmation — the visual design implies immediate action
@@ -0,0 +1,22 @@
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
+ - In a page toolbar or a component toolbar to filter content by a single dimension — location, role, status, etc.
6
+ - When the option list is too long for a `SegmentedControl`
7
+ - When options need to be grouped or some options need to be individually disabled
8
+
9
+ ## When Not to Use
10
+
11
+ - Inside a form — use `SelectField` instead
12
+ - When the selection should trigger an action rather than filter content — use a `Button` or `DropdownButton` instead
13
+ - When the user needs to select multiple values — use a multi-select form field instead
14
+ - When there are only 2 or 3 static ungrouped actions - use a `SegmentedControl` instead
15
+
16
+ ## Usage
17
+
18
+ - Always place ToolbarSelect in a toolbar alongside other filters and controls, not inline within page content
19
+ - Use `prefix` to add an icon before the selected value, which helps identify what the filter controls at a glance — especially useful when multiple ToolbarSelects appear in the same toolbar
20
+ - Use `placeholder` to indicate what the filter represents when no selection has been made — e.g. "All locations", "All roles"
21
+ - Use grouped options (`WithDropdownGroups`) when the option list has a natural category structure that helps the user scan and find the right choice faster
22
+ - Use `creatableButton` sparingly — only when the user legitimately needs to add new options on the fly as part of their workflow
@@ -0,0 +1,45 @@
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 label an icon-only button or control where the action isn't immediately obvious
6
+ - To define an unfamiliar term, metric, or abbreviation — things like "SPLH" that not every user will know on sight
7
+ - To show additional metadata that is helpful but not essential to the main task
8
+ - To provide extra context for a truncated label or condensed data point
9
+
10
+ ## When Not to Use
11
+
12
+ - For critical information the user must see to complete a task — don't hide required context behind a hover
13
+ - When the content needs buttons, links, or any interactive element — use a `Popover` instead
14
+ - When the explanation is more than one or two lines — if it takes a paragraph, it belongs in a help article or inline copy
15
+ - As a workaround for unclear UI copy — if something needs a tooltip to be understood, first ask whether the label itself can be improved
16
+
17
+ ## Usage
18
+
19
+ ### Content
20
+
21
+ Keep it short — one line is ideal, two is the limit. Write in plain, direct language. If you need a heading alongside the content, the `header` prop adds a bold label above the body text.
22
+
23
+ ### Themes
24
+
25
+ Tooltip always use the inverse theme the product is using. If the product is in `light mode` the tooltip will be dark. If the product is in `dark mode` the tooltip will be light. This helps give it enough contrast to stand out from the background.
26
+
27
+ ### Placement
28
+
29
+ The tooltip appears above or below the trigger by default, and will reposition itself automatically based on available screen space. You can suggest a preferred `placement` (`top` or `bottom`), but the component may override it to keep the tooltip on screen.
30
+
31
+ ### Delays
32
+
33
+ `delayOnOpen` adds a small pause before the tooltip appears — useful when a trigger is near other interactive elements and you want to avoid tooltips flashing as the user moves between them. `delayOnClose` keeps the tooltip open briefly after the user moves away, which is helpful when the overlay itself contains selectable text or a link (only relevant for the white theme with `delayOnClose`).
34
+
35
+ ## Tips & Tricks
36
+
37
+ - Every icon-only button should have a tooltip. "What does this button do?" is a question a tooltip can always answer.
38
+ - Don't rely on tooltips to rescue confusing UI. If every element on a page needs a tooltip to be understood, the interface needs redesigning, not more tooltips.
39
+ - Avoid putting the same text in both the visible label and the tooltip.
40
+
41
+ ## Additional Rules
42
+
43
+ - `overlay` is the content prop — it accepts text or JSX, but keep interactive elements out of tooltips unless you're using `delayOnClose` intentionally.
44
+ - Tooltip wraps its `children` as the trigger — whatever element is passed as children becomes the hover anchor.
45
+ - The component repositions automatically to stay on screen; the `placement` prop is a preference, not a guarantee.