@capra/core 1.5.3 → 1.7.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 (104) hide show
  1. package/dist/index.cjs +42 -78
  2. package/dist/index.d.cts +8 -2
  3. package/dist/index.d.mts +8 -2
  4. package/dist/index.mjs +42 -78
  5. package/dist/style.css +62 -32
  6. package/docs/conventions--docs.md +186 -0
  7. package/docs/core-alert--design.md +110 -0
  8. package/docs/core-alert--usage.md +13 -0
  9. package/docs/core-anchor--design.md +39 -0
  10. package/docs/core-anchor--usage.md +39 -0
  11. package/docs/core-autocompletefield--design.md +91 -0
  12. package/docs/core-autocompletefield--usage.md +18 -0
  13. package/docs/core-badge--design.md +70 -0
  14. package/docs/core-badge--usage.md +13 -0
  15. package/docs/core-breadcrumbs--design.md +65 -0
  16. package/docs/core-breadcrumbs--usage.md +16 -0
  17. package/docs/core-button--design.md +97 -0
  18. package/docs/core-button--usage.md +17 -0
  19. package/docs/core-buttonlink--design.md +7 -0
  20. package/docs/core-buttonlink--usage.md +24 -0
  21. package/docs/core-card--design.md +100 -0
  22. package/docs/core-card--usage.md +5 -0
  23. package/docs/core-checkbox--design.md +66 -0
  24. package/docs/core-checkbox--usage.md +34 -0
  25. package/docs/core-collapse--design.md +28 -0
  26. package/docs/core-collapse--usage.md +20 -0
  27. package/docs/core-datepickerfield--design.md +71 -0
  28. package/docs/core-datepickerfield--usage.md +57 -0
  29. package/docs/core-daterangepickerfield--design.md +76 -0
  30. package/docs/core-daterangepickerfield--usage.md +62 -0
  31. package/docs/core-divider--design.md +35 -0
  32. package/docs/core-divider--usage.md +8 -0
  33. package/docs/core-drawer--design.md +87 -0
  34. package/docs/core-drawer--usage.md +9 -0
  35. package/docs/core-emptystate--design.md +45 -0
  36. package/docs/core-emptystate--usage.md +13 -0
  37. package/docs/core-helpertext--design.md +30 -0
  38. package/docs/core-helpertext--usage.md +11 -0
  39. package/docs/core-iconbutton--design.md +87 -0
  40. package/docs/core-iconbutton--usage.md +15 -0
  41. package/docs/core-inputrow--design.md +85 -0
  42. package/docs/core-inputrow--usage.md +6 -0
  43. package/docs/core-label--design.md +27 -0
  44. package/docs/core-label--usage.md +17 -0
  45. package/docs/core-link--design.md +58 -0
  46. package/docs/core-link--usage.md +16 -0
  47. package/docs/core-listitem--design.md +70 -0
  48. package/docs/core-listitem--usage.md +6 -0
  49. package/docs/core-menu--design.md +106 -0
  50. package/docs/core-menu--usage.md +16 -0
  51. package/docs/core-modal--design.md +39 -0
  52. package/docs/core-modal--usage.md +11 -0
  53. package/docs/core-numberfield--design.md +12 -0
  54. package/docs/core-numberfield--usage.md +14 -0
  55. package/docs/core-pagination--design.md +30 -0
  56. package/docs/core-pagination--usage.md +13 -0
  57. package/docs/core-passwordfield--design.md +7 -0
  58. package/docs/core-passwordfield--usage.md +3 -0
  59. package/docs/core-pill--design.md +94 -0
  60. package/docs/core-pill--usage.md +10 -0
  61. package/docs/core-popover--design.md +25 -0
  62. package/docs/core-popover--usage.md +8 -0
  63. package/docs/core-radio--design.md +39 -0
  64. package/docs/core-radio--usage.md +8 -0
  65. package/docs/core-radiogroup--design.md +5 -0
  66. package/docs/core-radiogroup--usage.md +12 -0
  67. package/docs/core-radiotile--design.md +5 -0
  68. package/docs/core-radiotile--usage.md +10 -0
  69. package/docs/core-ribbon--design.md +39 -0
  70. package/docs/core-ribbon--usage.md +12 -0
  71. package/docs/core-skeleton--design.md +88 -0
  72. package/docs/core-skeleton--usage.md +13 -0
  73. package/docs/core-skeletongroup--design.md +50 -0
  74. package/docs/core-skeletongroup--usage.md +10 -0
  75. package/docs/core-spinner--design.md +99 -0
  76. package/docs/core-spinner--usage.md +11 -0
  77. package/docs/core-switch--design.md +145 -0
  78. package/docs/core-switch--usage.md +8 -0
  79. package/docs/core-tabnav--design.md +77 -0
  80. package/docs/core-tabnav--usage.md +63 -0
  81. package/docs/core-tag--design.md +21 -0
  82. package/docs/core-tag--usage.md +11 -0
  83. package/docs/core-text--design.md +32 -0
  84. package/docs/core-text--usage.md +10 -0
  85. package/docs/core-textarea--design.md +74 -0
  86. package/docs/core-textarea--usage.md +18 -0
  87. package/docs/core-textfield--design.md +81 -0
  88. package/docs/core-textfield--usage.md +12 -0
  89. package/docs/core-textinput--design.md +72 -0
  90. package/docs/core-textinput--usage.md +19 -0
  91. package/docs/core-toast--design.md +100 -0
  92. package/docs/core-toast--usage.md +11 -0
  93. package/docs/core-tooltip--design.md +61 -0
  94. package/docs/core-tooltip--usage.md +48 -0
  95. package/docs/core-topnav--design.md +75 -0
  96. package/docs/core-topnav--usage.md +6 -0
  97. package/docs/core-verticalnavigation--design.md +31 -0
  98. package/docs/core-verticalnavigation--usage.md +17 -0
  99. package/docs/core-visuallyhidden--design.md +87 -0
  100. package/docs/core-visuallyhidden--usage.md +35 -0
  101. package/docs/history-changelogs-capra-core--docs.md +60 -0
  102. package/docs/index.md +110 -0
  103. package/docs/using-capra--docs.md +39 -0
  104. package/package.json +5 -4
@@ -0,0 +1,28 @@
1
+ # Core/Collapse - Design
2
+
3
+ A collapsible disclosure section with an expandable header and panel. Pass **`title`** for the header label, optional **`headerTrailingContentSlot`** for trailing actions (switches, buttons), and the panel body via **`children`**.
4
+
5
+ ## Usage
6
+
7
+ Use Collapse to structure readable content, separate regions, or group related information. Pair it with shared spacing, typography, and surface rules. Do not stretch it into an action pattern that already has a dedicated component.
8
+
9
+ ## Best Practices
10
+
11
+ * Do use Collapse to support hierarchy, grouping, and readable scanning.
12
+ * Don't turn Collapse into an action container when a dedicated interactive pattern exists.
13
+
14
+ ## Accessibility
15
+
16
+ ### Keyboard interaction
17
+
18
+ | Key | Function |
19
+ | ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
20
+ | `Tab`, `Shift-Tab` | When contents are collapsed, focus moves to the next or previous collapse header. When contents are expanded, focus moves to the next or previous focusable element within the expanded content. |
21
+ | `Enter`, `Space` | When focus is on the accordion header, toggles the expanded/collapsed state. |
22
+
23
+ * When receiving focus through the keyboard, the focus outline appears around the title of the collapse header.
24
+
25
+ ## Related components
26
+
27
+ * [Card](?path=/docs/core-card--design)
28
+ * [Divider](?path=/docs/core-divider--design)
@@ -0,0 +1,20 @@
1
+ # Core/Collapse - Usage
2
+
3
+ A collapsible disclosure section with an expandable header and panel. Pass **`title`** for the header label, optional **`headerTrailingContentSlot`** for trailing actions (switches, buttons), and the panel body via **`children`**.
4
+
5
+ | Prop | Type | Required | Default | Description |
6
+ | --- | --- | --- | --- | --- |
7
+ | `FORCE__className` | `string` | No | `--` | 🚨 This prop is meant to be an escape hatch. 🚨<br><br>If the desired style cannot be achieved using component props, use this as a last resort. The inner workings of Capra components are implementation details and this escape hatch gives one access to those implementation details. We cannot make any guarantees that styles will applied correctly across version updates. Please use it responsibly.<br><br>Add a CSS class to the component. |
8
+ | `title` | `string` | Yes | `--` | Plain string title rendered in the disclosure heading. |
9
+ | `headerTrailingContentSlot` | `React.ReactNode` | No | `--` | Trailing header region for actions (switches, buttons, etc.). |
10
+ | `children` | `React.ReactNode` | Yes | `--` | Content of the disclosure panel. |
11
+
12
+ ### `Collapse` root API
13
+
14
+ Pass **`title`** (plain string) for the header label, optional **`headerTrailingContentSlot`** for trailing actions
15
+ (switches, buttons), and the panel body via **`children`**.
16
+
17
+ The root forwards these `Disclosure` props from `react-aria-components`:
18
+ **`id`** (use when a parent **`DisclosureGroup`** controls expansion),
19
+ **`defaultExpanded`**, **`isExpanded`**, **`onExpandedChange`**, and **`isDisabled`**. Use **`FORCE__className`** on the
20
+ root as the style escape hatch.
@@ -0,0 +1,71 @@
1
+ # Core/DatePickerField - Design
2
+
3
+ ## Anatomy
4
+
5
+ The date picker combines a segmented date input with a calendar in a popover. Values use types from
6
+ [`@internationalized/date`](https://react-spectrum.adobe.com/internationalized/date/) (for example `CalendarDate`).
7
+ The visible format follows the user’s locale.
8
+
9
+ ## Properties
10
+
11
+ ### Label
12
+
13
+ Provide a visible `label` so the control has a clear accessible name. If another element acts as the label, wire the
14
+ relationship with `aria-labelledby` or `aria-label` instead.
15
+
16
+ ### Value
17
+
18
+ Use `value` with `onChange` for a controlled value, or `defaultValue` for an uncontrolled initial value. The handler
19
+ receives `null` when the field is cleared.
20
+
21
+ ### Placeholder
22
+
23
+ `placeholder` shows a single string when the field is empty and not focused. Prefer `helperText` for requirements or
24
+ instructions that must stay visible.
25
+
26
+ ### Helper text
27
+
28
+ Helper text sits below the field for requirements, hints, or errors. Pair `appearance="danger"` with error copy so
29
+ the invalid state is clear visually and to assistive technologies.
30
+
31
+ ### Layout
32
+
33
+ `layout` can be **vertical** (label above) or **horizontal** (label on the leading side). Prefer vertical; use
34
+ horizontal when horizontal space is tight.
35
+
36
+ ## Feedback
37
+
38
+ ### Appearance
39
+
40
+ `appearance` supports **default**, **danger** (invalid / error), and **warning**. Danger also drives the invalid
41
+ state for accessibility in addition to any explicit `isInvalid` flag.
42
+
43
+ ### Disabled
44
+
45
+ Disabled fields cannot be edited and do not receive focus. Values are not submitted with native form submission.
46
+
47
+ ### Read-only
48
+
49
+ Read-only fields cannot be edited; the value stays visible for reading and assistive technologies.
50
+
51
+ ## Accessibility
52
+
53
+ ### Keyboard and pointer behavior
54
+
55
+ * **Tab** moves focus into the segmented field or calendar trigger; **Shift+Tab** moves out.
56
+ * Arrow keys adjust focused segments; calendar grid follows standard date grid keyboard patterns when the popover is open.
57
+ * **Space** / **Enter** on the calendar button opens the popover where supported by the platform pattern.
58
+
59
+ ### Labeling and instructions
60
+
61
+ Provide a visible `label` or an accessible name via `aria-label` / `aria-labelledby`. Do not rely on `placeholder` alone
62
+ for the accessible name. Prefer persistent `helperText` for requirements; placeholder disappears when the user types.
63
+
64
+ ### Validation and state
65
+
66
+ Use `appearance="danger"` with error content in `helperText` for a consistent error treatment. Set `required` when the
67
+ field is mandatory. Disabled fields are not interactive and are excluded from native submission; read-only fields keep
68
+ their values visible but are not editable.
69
+
70
+ Ensure focus indicators remain visible (at least 2px, 3:1 contrast) and interactive targets meet at least 24×24 CSS
71
+ pixels where applicable.
@@ -0,0 +1,57 @@
1
+ # Core/DatePickerField - Usage
2
+
3
+ | Prop | Type | Required | Default | Description |
4
+ | --- | --- | --- | --- | --- |
5
+ | `helperText` | `string` | No | `--` | Helper text below the field. Replaced by error message when status is error. Use for requirements, disclaimers. |
6
+ | `label` | `string` | No | `--` | Label for the field. Required for accessibility; use aria-label if another element acts as label. |
7
+ | `layout` | `'vertical' \| 'horizontal'` | No | `--` | Label and field layout: vertical (label above) or horizontal (label on leading side). Prefer vertical; use horizontal when space is limited. |
8
+ | `granularity` | `'day' \| 'second'` | No | `--` | Smallest date/time unit shown in the field. Only `day` and `second` are supported. |
9
+ | `FORCE__className` | `string` | No | `--` | 🚨 This prop is meant to be an escape hatch. 🚨<br><br>If the desired style cannot be achieved using component props, use this as a last resort. The inner workings of Capra components are implementation details and this escape hatch gives one access to those implementation details. We cannot make any guarantees that styles will applied correctly across version updates. Please use it responsibly.<br><br>Add a CSS class to the component. |
10
+ | `canClear` | `boolean` | No | `--` | When true, shows a clear control to the left of the calendar button while the field has a value. |
11
+ | `disabled` | `boolean` | No | `--` | Disables the field. |
12
+ | `id` | `string` | No | `--` | Optional id for the root; associates the label and field. |
13
+ | `readOnly` | `boolean` | No | `--` | Read-only field. |
14
+ | `required` | `boolean` | No | `--` | Required field. |
15
+ | `isInvalid` | `boolean` | No | `--` | Invalid value; `appearance="danger"` also forces an invalid state for display. |
16
+
17
+ ## Props reference
18
+
19
+ ### Field layout and presentation
20
+
21
+ | Prop | Type | Description |
22
+ | ------------------ | ------------------------------------ | ------------------------------------------------------------------------------------------------------ |
23
+ | `label` | `string` | Visible label text; pair with `required` or assistive naming when the visible label is not sufficient. |
24
+ | `helperText` | `string` | Descriptive or error text below the field (rendered in the description slot). |
25
+ | `layout` | `'vertical' \| 'horizontal'` | Label placement relative to the control. |
26
+ | `appearance` | `'default' \| 'danger' \| 'warning'` | Visual status; `danger` also marks the field invalid for accessibility. |
27
+ | `size` | `'sm' \| 'md'` | Height and density of the input shell. |
28
+ | `leadingSlot` | `ReactNode` | Optional content before the segmented input (same pattern as `TextInput`). |
29
+ | `placeholder` | `string` | String placeholder when empty and not focus-within. |
30
+ | `id` | `string` | Optional id for the root; associates the label and field. |
31
+ | `FORCE__className` | `string` | Escape hatch: extra class on the field shell; see `StylingOverrideProps` in source. |
32
+ | `disabled` | `boolean` | Disables the control. |
33
+ | `readOnly` | `boolean` | Read-only mode. |
34
+ | `required` | `boolean` | Marks the field required for forms and assistive technologies. |
35
+ | `isInvalid` | `boolean` | Marks the value invalid; combined with `appearance === 'danger'`. |
36
+
37
+ ### Value, format, and change events
38
+
39
+ | Prop | Type | Description |
40
+ | -------------- | --------------------------------------------- | ---------------------------------------------------------------------------------------- |
41
+ | `value` | `T \| null` | Controlled value (`T` is a `DateValue` generic, defaulting to the library `DateValue`). |
42
+ | `defaultValue` | `T \| null` | Initial value when uncontrolled. |
43
+ | `onChange` | `(value: MappedDateValue<T> \| null) => void` | Fired when the committed value changes. |
44
+ | `granularity` | `'day' \| 'hour' \| 'minute' \| 'second'` | Smallest unit shown in the field (default follows value type, e.g. day for plain dates). |
45
+
46
+ `MappedDateValue<T>` preserves time and calendar types aligned with `T` (for example `CalendarDate` vs `CalendarDateTime`).
47
+
48
+ Use `isInvalid` and `helperText` for invalid feedback in Capra layouts. Validation behavior is fixed to ARIA-associated messaging for this shell (not configurable).
49
+
50
+ ### Props not supported or intentionally fixed
51
+
52
+ | Prop | Notes |
53
+ | ---------------------------------------------- | -------------------------------------------------------------------------------------------- |
54
+ | `children` | Ignored; structure (label, input, calendar) is fixed. |
55
+ | `style` | Not part of the public styling contract; use design tokens and `FORCE__className` if needed. |
56
+ | `validationBehavior` | Not configurable; the implementation always uses ARIA-associated validation for this shell. |
57
+ | `description`, `errorMessage` (slot-style API) | Not part of the public props surface; use `helperText` and validation props instead. |
@@ -0,0 +1,76 @@
1
+ # Core/DateRangePickerField - Design
2
+
3
+ ## Anatomy
4
+
5
+ The date range picker combines two segmented date inputs (start and end) with a range calendar in a popover. Values use
6
+ [`RangeValue`](https://react-spectrum.adobe.com/react-aria/DateRangePicker.html) over types from
7
+ [`@internationalized/date`](https://react-spectrum.adobe.com/internationalized/date/) (for example `CalendarDate`). The
8
+ visible format follows the user’s locale.
9
+
10
+ ## Properties
11
+
12
+ ### Label
13
+
14
+ Provide a visible `label` so the control has a clear accessible name. If another element acts as the label, wire the
15
+ relationship with `aria-labelledby` or `aria-label` instead.
16
+
17
+ ### Value
18
+
19
+ Use `value` with `onChange` for a controlled range, or `defaultValue` for an uncontrolled initial range. The handler
20
+ receives `null` when the field is cleared. Each bound is a `DateValue` consistent with your generic (for example
21
+ both `CalendarDate`).
22
+
23
+ ### Placeholder
24
+
25
+ `placeholder` is a pair of strings (`[start, end]`) shown when neither bound is set and the inputs are not
26
+ focus-within, with a swap icon between them. Prefer `helperText` for requirements or instructions that must stay
27
+ visible.
28
+
29
+ ### Helper text
30
+
31
+ Helper text sits below the field for requirements, hints, or errors. Pair `appearance="danger"` with error copy so
32
+ the invalid state is clear visually and to assistive technologies.
33
+
34
+ ### Layout
35
+
36
+ `layout` can be **vertical** (label above) or **horizontal** (label on the leading side). Prefer vertical; use
37
+ horizontal when horizontal space is tight.
38
+
39
+ ## Feedback
40
+
41
+ ### Appearance
42
+
43
+ `appearance` supports **default**, **danger** (invalid / error), and **warning**. Danger also drives the invalid
44
+ state for accessibility in addition to any explicit `isInvalid` flag.
45
+
46
+ ### Disabled
47
+
48
+ Disabled fields cannot be edited and do not receive focus. Values are not submitted with native form submission.
49
+
50
+ ### Read-only
51
+
52
+ Read-only fields cannot be edited; the range stays visible for reading and assistive technologies.
53
+
54
+ ## Accessibility
55
+
56
+ ### Keyboard and pointer behavior
57
+
58
+ * **Tab** moves focus into the segmented fields or calendar trigger; **Shift+Tab** moves out.
59
+ * Arrow keys adjust focused segments; the range calendar grid follows standard date grid and range selection patterns when
60
+ the popover is open.
61
+ * **Space** / **Enter** on the calendar button opens the popover where supported by the platform pattern.
62
+
63
+ ### Labeling and instructions
64
+
65
+ Provide a visible `label` or an accessible name via `aria-label` / `aria-labelledby`. Do not rely on `placeholder` alone
66
+ for the accessible name. Prefer persistent `helperText` for requirements; the string placeholder hides when the user
67
+ focuses or enters either bound.
68
+
69
+ ### Validation and state
70
+
71
+ Use `appearance="danger"` with error content in `helperText` for a consistent error treatment. Set `required` when both
72
+ bounds are mandatory. Disabled fields are not interactive and are excluded from native submission; read-only fields keep
73
+ their values visible but are not editable.
74
+
75
+ Ensure focus indicators remain visible (at least 2px, 3:1 contrast) and interactive targets meet at least 24×24 CSS
76
+ pixels where applicable.
@@ -0,0 +1,62 @@
1
+ # Core/DateRangePickerField - Usage
2
+
3
+ | Prop | Type | Required | Default | Description |
4
+ | --- | --- | --- | --- | --- |
5
+ | `helperText` | `string` | No | `--` | Helper text below the field. Replaced by error message when status is error. Use for requirements, disclaimers. |
6
+ | `label` | `string` | No | `--` | Label for the field. Required for accessibility; use aria-label if another element acts as label. |
7
+ | `layout` | `'vertical' \| 'horizontal'` | No | `--` | Label and field layout: vertical (label above) or horizontal (label on leading side). Prefer vertical; use horizontal when space is limited. |
8
+ | `placeholder` | `unknown` | No | `--` | Placeholders for empty start and end, shown with a swap icon between them when the group is not focus-within. |
9
+ | `granularity` | `'day' \| 'second'` | No | `--` | Smallest date/time unit shown in the fields. Only `day` and `second` are supported. |
10
+ | `FORCE__className` | `string` | No | `--` | 🚨 This prop is meant to be an escape hatch. 🚨<br><br>If the desired style cannot be achieved using component props, use this as a last resort. The inner workings of Capra components are implementation details and this escape hatch gives one access to those implementation details. We cannot make any guarantees that styles will applied correctly across version updates. Please use it responsibly.<br><br>Add a CSS class to the component. |
11
+ | `canClear` | `boolean` | No | `--` | When true, shows a clear control to the left of the calendar button while the field has a value. |
12
+ | `disabled` | `boolean` | No | `--` | Disables the field. |
13
+ | `id` | `string` | No | `--` | Optional id for the root; associates the label and field. |
14
+ | `readOnly` | `boolean` | No | `--` | Read-only field. |
15
+ | `required` | `boolean` | No | `--` | Required field. |
16
+ | `isInvalid` | `boolean` | No | `--` | Invalid value; `appearance="danger"` also forces an invalid state for display. |
17
+
18
+ ## Props reference
19
+
20
+ ### Field layout and presentation
21
+
22
+ | Prop | Type | Description |
23
+ | ------------------ | ------------------------------------ | ------------------------------------------------------------------------------------------------------ |
24
+ | `label` | `string` | Visible label text; pair with `required` or assistive naming when the visible label is not sufficient. |
25
+ | `helperText` | `string` | Descriptive or error text below the field (rendered in the description slot). |
26
+ | `layout` | `'vertical' \| 'horizontal'` | Label placement relative to the control. |
27
+ | `appearance` | `'default' \| 'danger' \| 'warning'` | Visual status; `danger` also marks the field invalid for accessibility. |
28
+ | `size` | `'sm' \| 'md'` | Height and density of the input shell. |
29
+ | `leadingSlot` | `ReactNode` | Optional content before the segmented inputs (same pattern as `TextInput`). |
30
+ | `placeholder` | `readonly [string, string]` | Start and end placeholders when both bounds are empty and the group is not focus-within. |
31
+ | `id` | `string` | Optional id for the root; associates the label and field. |
32
+ | `FORCE__className` | `string` | Escape hatch: extra class on the field shell; see `StylingOverrideProps` in source. |
33
+ | `disabled` | `boolean` | Disables the control. |
34
+ | `readOnly` | `boolean` | Read-only mode. |
35
+ | `required` | `boolean` | Marks the field required for forms and assistive technologies. |
36
+ | `isInvalid` | `boolean` | Marks the value invalid; combined with `appearance === 'danger'`. |
37
+
38
+ ### Value, format, overlay, and change events
39
+
40
+ | Prop | Type | Description |
41
+ | --------------------- | --------------------------------------------------------- | ----------------------------------------------------------------------------------------- |
42
+ | `value` | `RangeValue<T> \| null` | Controlled range (`T` is a `DateValue` generic, defaulting to the library `DateValue`). |
43
+ | `defaultValue` | `RangeValue<T> \| null` | Initial range when uncontrolled. |
44
+ | `onChange` | `(value: RangeValue<MappedDateValue<T>> \| null) => void` | Fired when the committed range changes. |
45
+ | `granularity` | `'day' \| 'hour' \| 'minute' \| 'second'` | Smallest unit shown in the fields (default follows value type, e.g. day for plain dates). |
46
+ | `shouldCloseOnSelect` | `boolean \| () => boolean` | Whether the popover closes after a calendar interaction. |
47
+
48
+ `MappedDateValue<T>` preserves time and calendar types aligned with `T` (for example `CalendarDate` vs `CalendarDateTime`).
49
+
50
+ For selecting a new range entirely inside the calendar without the overlay closing between the first and second date,
51
+ set `shouldCloseOnSelect={false}` (as in the example stories).
52
+
53
+ Use `isInvalid` and `helperText` for invalid feedback in Capra layouts. Validation behavior is fixed to ARIA-associated messaging for this shell (not configurable).
54
+
55
+ ### Props not supported or intentionally fixed
56
+
57
+ | Prop | Notes |
58
+ | ---------------------------------------------- | -------------------------------------------------------------------------------------------- |
59
+ | `children` | Ignored; structure (label, inputs, calendar) is fixed. |
60
+ | `style` | Not part of the public styling contract; use design tokens and `FORCE__className` if needed. |
61
+ | `validationBehavior` | Not configurable; the implementation always uses ARIA-associated validation for this shell. |
62
+ | `description`, `errorMessage` (slot-style API) | Not part of the public props surface; use `helperText` and validation props instead. |
@@ -0,0 +1,35 @@
1
+ # Core/Divider - Design
2
+
3
+ Divider separates and groups content. Use horizontal dividers between sections; use vertical dividers between inline items. A horizontal divider can optionally display a label. Dividers are static and not keyboard focusable.
4
+
5
+ ## Usage
6
+
7
+ Use Collapse to structure readable content, separate regions, or group related information. Pair it with shared spacing, typography, and surface rules. Do not stretch it into an interaction pattern that already has a dedicated component.
8
+
9
+ ## Properties
10
+
11
+ ### Label
12
+
13
+ A horizontal divider can be given a label to provide context to a grouping. When possible, avoid labeled dividers and use headings instead. When you do use a label, ensure it has the proper semantic level (e.g. pass an `<h2>` or `<h3>` as children) so it is announced as a heading by assistive technologies.
14
+
15
+ ## Best Practices
16
+
17
+ Do:
18
+
19
+ * Do use Divider to separate semantically distinct groups.
20
+ * Do use a label when the divider introduces a new conceptual group.
21
+
22
+ Don't:
23
+
24
+ * Don't use Divider between every list item in a dense list.
25
+ * Don't use Divider as pure decoration.
26
+
27
+ ## Accessibility
28
+
29
+ * Dividers are static and not keyboard focusable.
30
+ * Unlabeled horizontal dividers render as an `<hr>` (a thematic break between content).
31
+ * When a horizontal divider has a label, prefer a real heading element as children (for example, `Text` with `as="h2"` or `as="h3"`) when the label introduces a new section, so the label is announced with the correct level. When possible, avoid labeled dividers and use headings instead.
32
+
33
+ ## Related components
34
+
35
+ * [Collapse](?path=/docs/core-collapse--design)
@@ -0,0 +1,8 @@
1
+ # Core/Divider - Usage
2
+
3
+ Divider separates and groups content. Use horizontal dividers between sections; use vertical dividers between inline items. A horizontal divider can optionally display a label. Dividers are static and not keyboard focusable.
4
+
5
+ | Prop | Type | Required | Default | Description |
6
+ | --- | --- | --- | --- | --- |
7
+ | `FORCE__className` | `string` | No | `--` | 🚨 This prop is meant to be an escape hatch. 🚨<br><br>If the desired style cannot be achieved using component props, use this as a last resort. The inner workings of Capra components are implementation details and this escape hatch gives one access to those implementation details. We cannot make any guarantees that styles will applied correctly across version updates. Please use it responsibly.<br><br>Add a CSS class to the component. |
8
+ | `type` | `string` | No | 'horizontal' | `--` |
@@ -0,0 +1,87 @@
1
+ # Core/Drawer - Design
2
+
3
+ ## Behavior
4
+
5
+ ### Modality
6
+
7
+ A contextual sheet can be **modal** or **non-modal**.
8
+
9
+ **Modal** sheets use a scrim to block interaction with the main page.
10
+
11
+ **Non-modal** sheets allow simultaneous interaction with the sheet and main page surfaces.
12
+ Non-modal sheets are best used for experiences that require a persistent but dismissible sheet that benefits from
13
+ interacting with the main page, like viewing location details on a map.
14
+
15
+ ### Navigation
16
+
17
+ Navigating within a context sheet should be avoided where possible. If navigating is necessary, keep it shallow –
18
+ no more than 1 level deep.
19
+
20
+ When presenting a secondary view in a context sheet, the primary view content is replaced. The secondary view is
21
+ dismissed by making a selection or pressing a backward navigation button.
22
+
23
+ ### Dismissing
24
+
25
+ Context sheets are dismissed by:
26
+
27
+ 1. Pressing the close button
28
+ 2. Confirming or cancelling the drawer
29
+ 3. Interacting with the scrim (when present)
30
+ 4. Pressing the escape key when the general sheet container is focused
31
+
32
+ In code, wire footer actions and other dismiss paths to `onClose`. A scrim is shown when the drawer
33
+ is **modal** (`modal`).
34
+
35
+ ## Screen size
36
+
37
+ ### Small screens
38
+
39
+ On small screens, the vertical height of a context sheet defaults up to 50% of the screen height. Scrolling the
40
+ sheet first slides it to full height before the content area scrolls.
41
+
42
+ ### Medium and large screens
43
+
44
+ On larger screens, drawers are fixed to the **trailing** edge of the screen. Content that extends beyond the
45
+ vertical bounds of the drawer scrolls. Do not scroll horizontally. The drawer header and footer are pinned above the
46
+ scrolled content. Drawers have a min-width of 400px and max-width of 80% of the parent viewport.
47
+
48
+ ## Best practices
49
+
50
+ ### Stacking
51
+
52
+ **Do**
53
+
54
+ Keep interactions within context sheets on the sheet surface. Use inline progressive disclosure to reveal
55
+ additional or optional content.
56
+
57
+ **Don't**
58
+
59
+ Launch other context sheets over a context sheet.
60
+
61
+ ### In-sheet navigation
62
+
63
+ **Do**
64
+
65
+ Keep navigation to a minimum within context sheets. Keep the navigation stack shallow when necessary, no more than
66
+ 1 level.
67
+
68
+ **Don't**
69
+
70
+ Add deep or multi-level navigation stacks inside a single context sheet; prefer replacing content or using shallow
71
+ steps instead.
72
+
73
+ ## Accessibility
74
+
75
+ ### Keyboard interaction
76
+
77
+ | Key | Function |
78
+ | ------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
79
+ | `Tab` / `Shift+Tab` | In **modal** mode, focus stays within the drawer while open. In **non-modal** mode, focus can move freely between the sheet and the main page. |
80
+ | `Escape` | Closes the drawer whether focus is on the dialog surface or inside it (capture-phase listener). |
81
+
82
+ ### Roles and properties
83
+
84
+ * The panel uses `role="dialog"` with `aria-labelledby` (title) or `aria-label` as needed. While open, `aria-modal` is `true` for modal drawers and `false` for non-modal drawers.
85
+ * **Modal** mode: focus is trapped; `usePreventScroll` locks page scrolling. **Non-modal** mode: no focus containment or scroll lock on the document.
86
+ * The close control exposes an accessible name (“Close drawer”).
87
+ * When you add `Breadcrumbs` in the title, the trail is an ordered list with an `aria-label` of “Breadcrumb” by default; the last crumb should represent the current page (typically without an `href`).
@@ -0,0 +1,9 @@
1
+ # Core/Drawer - Usage
2
+
3
+ ### Implementation
4
+
5
+ The drawer UI is rendered in a **portal** (default `document.body`), with `position: fixed` and `top`/`bottom` anchoring so the sheet fills the **layout viewport** (the browser window on a real site; the Storybook **preview iframe** in docs/canvas). In the **Story** canvas, a decorator stretches the preview document so the iframe can grow with the panel; that shell is **skipped in Docs** so embedded previews are not forced to full-viewport height. The open drawer still fills the iframe, not the inline story box—resize the preview panel if you need a taller canvas.
6
+
7
+ ### Header
8
+
9
+ The header is the `title` slot: a string for a single heading, or a composition with `Drawer.Heading`, optional `Drawer.Description`, `Drawer.ExpandedTitleLayout`, and the shared `Breadcrumbs` components (matching the `Modal` pattern). The header stays pinned while the body scrolls.
@@ -0,0 +1,45 @@
1
+ # Core/EmptyState - Design
2
+
3
+ The EmptyState component is used to display a message when there is no data to display. Illustrations are lazy-loaded and support light/dark themes via the theme prop.
4
+
5
+ ## Properties
6
+
7
+ ### Title
8
+
9
+ All empty states have a title. Titles provide a brief summary of the reason an empty state is shown.
10
+
11
+ ### Description
12
+
13
+ All empty states have a description. Descriptions provide the details and instructions on next steps the user can take.
14
+
15
+ ### Action (optional)
16
+
17
+ A call to action can be used to provide quick access to relevant next steps. Full page empty states use a primary button. Smaller empty states use a secondary button.
18
+
19
+ ### Illustration
20
+
21
+ All empty states have an illustration. Pass an illustration slug (e.g. `EmptyFolder`, `PizzaBox`) via the `illustration` prop.
22
+
23
+ Use the `theme` prop (`light` or `dark`) to switch between light/dark variants when the illustration supports them. Illustrations are lazy-loaded for optimal bundle size.
24
+
25
+ ## Content
26
+
27
+ ### Title / explanation format
28
+
29
+ This format allows empty states to provide both a catchy main title and a more detailed explanation. The title should provide the broad action with the explanation providing additional detail.
30
+
31
+ Titles should be in sentence format with no ending punctuation. Descriptions should be in sentence format with ending punctuation.
32
+
33
+ ### Call to action
34
+
35
+ A call to action enables users to easily move forward from an empty state. It can take the form of a link embedded within the description to send the user to another page, or a button to perform an action.
36
+
37
+ Full page empty states (`size="lg"`) should use a primary button, as the action is the primary next step for the user. Smaller empty states should use a secondary button if the action is already present elsewhere on the page.
38
+
39
+ ### Description wrapping
40
+
41
+ Descriptions will wrap if the parent container is small enough, but strings should be kept short when possible.
42
+
43
+ ### Graphs
44
+
45
+ When using graph tiles, an empty state should be smaller to match the size of the graph tile.
@@ -0,0 +1,13 @@
1
+ # Core/EmptyState - Usage
2
+
3
+ The EmptyState component is used to display a message when there is no data to display. Illustrations are lazy-loaded and support light/dark themes via the theme prop.
4
+
5
+ | Prop | Type | Required | Default | Description |
6
+ | --- | --- | --- | --- | --- |
7
+ | `illustration` | `(typeof illustrationSlugs)[number]` | No | `--` | The illustration to display, identified by slug. Use theme to switch between light/dark variants when available. @default "EmptyFolder" |
8
+ | `theme` | `'light' \| 'dark'` | No | `--` | The theme for the illustration. Determines which variant to show when light/dark variants exist. @default "light" |
9
+ | `size` | `'md' \| 'lg'` | No | `--` | The size of the empty state. `lg` is for large components or the whole pages. @default "md" |
10
+ | `title` | `string` | Yes | `--` | The title to display in the empty state. |
11
+ | `description` | `string` | No | `--` | The description to display in the empty state. Please do not skip this property without a good reason. |
12
+ | `children` | `React.ReactNode` | No | `--` | Generic use for adding a button or other action elements below the description. |
13
+ | `FORCE__className` | `string` | No | `--` | 🚨 This prop is meant to be an escape hatch. 🚨<br><br>If the desired style cannot be achieved using component props, use this as a last resort. The inner workings of Capra components are implementation details and this escape hatch gives one access to those implementation details. We cannot make any guarantees that styles will applied correctly across version updates. Please use it responsibly.<br><br>Add a CSS class to the component. |
@@ -0,0 +1,30 @@
1
+ # Core/HelperText - Design
2
+
3
+ Helper text for inputs.
4
+
5
+ :::warning
6
+
7
+ Prefer Capra field components—such as `TextField`, `NumberField`, `PasswordField`, `TextArea`, `DatePicker`, `DateRangePicker`, or `AutocompleteField`—which
8
+ include helper text in the standard field layout. Use standalone `HelperText` only when you are building a
9
+ custom field or a layout that those components do not cover.
10
+
11
+ :::
12
+
13
+ ## Accessibility
14
+
15
+ ### Error and warning content
16
+
17
+ For `appearance="danger"`, the helper region uses `role="alert"` so critical validation
18
+ messages are exposed promptly to assistive technologies. Warning and default appearances do not use `alert`;
19
+ ensure critical errors use `danger` when this behavior is desired.
20
+
21
+ ### Live regions
22
+
23
+ When `countText` is present, it is wrapped with `aria-live="polite"` so changes (for example
24
+ remaining characters) are announced without interrupting the user.
25
+
26
+ ### Relationship to the field
27
+
28
+ For custom compositions, associate helper copy with the control using `aria-describedby` on the input
29
+ pointing at an `id` on the helper element, or use patterns documented on the field component you wrap.
30
+ Capra built-in fields handle these relationships when you pass their `helperText` props.
@@ -0,0 +1,11 @@
1
+ # Core/HelperText - Usage
2
+
3
+ Helper text for inputs.
4
+
5
+ | Prop | Type | Required | Default | Description |
6
+ | --- | --- | --- | --- | --- |
7
+ | `appearance` | `(typeof appearances)[number]` | No | `--` | Appearance of the input.<br>@default 'default' |
8
+ | `children` | `string` | No | `--` | Main text. Use for hints, requirements, disclaimers, etc. |
9
+ | `countText` | `string` | No | `--` | Text to display on the right side of the helper text. Is marked as a live content area via `aria-live`. |
10
+ | `disabled` | `boolean` | No | `--` | Whether the input the helper text applies to is disabled. |
11
+ | `FORCE__className` | `string` | No | `--` | 🚨 This prop is meant to be an escape hatch. 🚨<br><br>If the desired style cannot be achieved using component props, use this as a last resort. The inner workings of Capra components are implementation details and this escape hatch gives one access to those implementation details. We cannot make any guarantees that styles will applied correctly across version updates. Please use it responsibly.<br><br>Add a CSS class to the component. |