@epam/ai-dial-ui-kit 0.14.0-dev.2 → 0.14.0-dev.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -1
- package/dist/CHANGELOG.md +56 -1
- package/dist/{JsonEditor-DPtZkKQi.cjs → JsonEditor-CV-hOulW.cjs} +1 -1
- package/dist/{JsonEditor-CM-CG-FK.js → JsonEditor-SPSat7s8.js} +1 -1
- package/dist/MarkdownEditor-CFQxnMBm.js +69 -0
- package/dist/{MarkdownEditor-cdq8UZxL.js → MarkdownEditor-DPaub2SS.js} +1 -1
- package/dist/{MarkdownEditor-D4WuEafx.cjs → MarkdownEditor-DalyXoBI.cjs} +1 -1
- package/dist/MarkdownEditor-jAttSooo.cjs +1 -0
- package/dist/components-manifest.json +1795 -202
- package/dist/dial-ui-kit.cjs.js +1 -1
- package/dist/dial-ui-kit.es.js +231 -195
- package/dist/{index-A_KNCHda.cjs → index-BX0vPSPf.cjs} +31 -31
- package/dist/{index-CBk9P1Pa.js → index-CDB62Oi2.js} +15351 -13549
- package/dist/index.css +2 -2
- package/dist/migration-guides/0.14.0/button-tooltip-2-0.md +111 -0
- package/dist/migration-guides/0.14.0/control-color-token-rename.md +143 -0
- package/dist/migration-guides/0.14.0/focus-border-token-role-naming.md +87 -0
- package/dist/migration-guides/0.14.0/select-multiselect-option-row.md +99 -0
- package/dist/migration-guides/0.14.0/shadow-token-per-step-rename.md +139 -0
- package/dist/migration-guides/0.14.0/tag-single-size.md +121 -0
- package/dist/migration-guides/README.md +6 -0
- package/dist/src/components/FileManager/hooks/use-file-upload.d.ts +3 -1
- package/dist/src/components/Grid/comparators/base-column-comparator.d.ts +1 -4
- package/dist/src/components/Grid/renderers/utils.d.ts +1 -2
- package/dist/src/components/New/Button/Button.d.ts +4 -3
- package/dist/src/components/New/Calendar/constants.d.ts +5 -5
- package/dist/src/components/New/Checkbox/Checkbox.d.ts +50 -0
- package/dist/src/components/New/Checkbox/CheckboxBox.d.ts +30 -0
- package/dist/src/components/New/Checkbox/constants.d.ts +10 -0
- package/dist/src/components/New/CollapsibleSidebar/CollapsibleSidebar.d.ts +82 -0
- package/dist/src/components/New/Dropdown/constants.d.ts +3 -1
- package/dist/src/components/New/EllipsisTooltip/EllipsisTooltip.d.ts +51 -0
- package/dist/src/components/New/EllipsisTooltip/use-truncation.d.ts +26 -0
- package/dist/src/components/New/Grid/Grid.d.ts +124 -0
- package/dist/src/components/New/Grid/components/SelectionCell.d.ts +21 -0
- package/dist/src/components/New/Grid/components/SelectionHeader.d.ts +14 -0
- package/dist/src/components/New/Grid/constants.d.ts +61 -0
- package/dist/src/components/New/Grid/renderers/DateCellRenderer.d.ts +48 -0
- package/dist/src/components/New/Grid/renderers/constants.d.ts +5 -0
- package/dist/src/components/New/Highlight/Highlight.d.ts +1 -1
- package/dist/src/components/New/IconButton/IconButton.d.ts +4 -4
- package/dist/src/components/New/Input/Button/constants.d.ts +1 -1
- package/dist/src/components/New/Label/Label.d.ts +5 -0
- package/dist/src/components/New/NoDataContent/NoDataContent.d.ts +48 -0
- package/dist/src/components/New/Notification/Notification.d.ts +7 -0
- package/dist/src/components/New/Notification/NotificationWrapper.d.ts +2 -0
- package/dist/src/components/New/Popup/Popup.d.ts +48 -9
- package/dist/src/components/New/Popup/constants.d.ts +7 -0
- package/dist/src/components/New/Radio/Radio.d.ts +48 -0
- package/dist/src/components/New/RadioGroup/RadioGroup.d.ts +78 -0
- package/dist/src/components/New/RadioGroup/constants.d.ts +11 -0
- package/dist/src/components/New/RadioGroupPopupField/RadioGroupPopupField.d.ts +93 -0
- package/dist/src/components/New/RadioGroupPopupField/constants.d.ts +22 -0
- package/dist/src/components/New/ResizableContainer/ConditionalResizableContainer.d.ts +34 -0
- package/dist/src/components/New/ResizableContainer/ResizableContainer.d.ts +77 -0
- package/dist/src/components/New/ResizableContainer/components/ResizeHandle.d.ts +21 -0
- package/dist/src/components/New/SegmentedControl/SegmentedControl.d.ts +54 -0
- package/dist/src/components/New/SegmentedControl/constants.d.ts +16 -0
- package/dist/src/components/New/Select/constants.d.ts +2 -2
- package/dist/src/components/New/Slider/Slider.d.ts +70 -0
- package/dist/src/components/New/Tag/Tag.d.ts +26 -4
- package/dist/src/components/New/Tag/constants.d.ts +23 -0
- package/dist/src/components/New/ThemeScope/ThemeScope.d.ts +46 -0
- package/dist/src/components/New/ToggleIconButton/ToggleIconButton.d.ts +47 -0
- package/dist/src/components/New/Tooltip/Tooltip.d.ts +43 -0
- package/dist/src/components/New/Tooltip/TooltipContainer.d.ts +32 -0
- package/dist/src/components/New/Tooltip/TooltipContent.d.ts +18 -0
- package/dist/src/components/New/Tooltip/TooltipContext.d.ts +115 -0
- package/dist/src/components/New/Tooltip/TooltipTrigger.d.ts +18 -0
- package/dist/src/components/New/Tooltip/constants.d.ts +30 -0
- package/dist/src/components/New/constants/icon.d.ts +22 -0
- package/dist/src/components/New/constants/overlay.d.ts +12 -3
- package/dist/src/index.d.ts +47 -1
- package/dist/src/models/dropdown.d.ts +10 -0
- package/dist/src/types/notification.d.ts +2 -1
- package/dist/src/types/tag.d.ts +4 -0
- package/dist/src/types/tooltip.d.ts +6 -0
- package/dist/src/utils/__tests__/element-size-observer.spec.d.ts +1 -0
- package/dist/src/utils/element-size-observer.d.ts +26 -0
- package/dist/src/utils/grid-comparators.d.ts +4 -0
- package/dist/src/utils/grid-date.d.ts +7 -0
- package/package.json +1 -1
- package/dist/MarkdownEditor-DRQoDnC-.js +0 -75
- package/dist/MarkdownEditor-DyIvPpmt.cjs +0 -1
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# Migrating the focus border tokens back to role names — v0.13.0 → v0.14.0
|
|
2
|
+
|
|
3
|
+
## Why this changed
|
|
4
|
+
|
|
5
|
+
0.13.0 renamed the `focus` border token to `focus-black`, on the reasoning that a token should be named for its value so that `focus-black` and `focus-blue` read as siblings. See the [0.13.0 guide](../0.13.0/focus-border-token-rename.md) for that step.
|
|
6
|
+
|
|
7
|
+
That naming does not survive contact with the rest of the border scale, which is named by **role** throughout: `primary`, `secondary`, `accent`, `accent-alpha`, `error-alpha`. Under a dark theme `focus-black` is not black, so the value it was named after is wrong exactly when it matters most. The two tokens are now:
|
|
8
|
+
|
|
9
|
+
- `focus` — the default focus ring (grey-1000 in the light palette).
|
|
10
|
+
- `accent-focus` — the accent focus ring (blue-200), used where the ring sits on an accent-filled control.
|
|
11
|
+
|
|
12
|
+
`border-focus` / `outline-focus` / `divide-focus` / `stroke-focus` are therefore back to the names they had in 0.12.x. **The colours are unchanged**, and so are the CSS variables.
|
|
13
|
+
|
|
14
|
+
## What changed
|
|
15
|
+
|
|
16
|
+
| Before (0.13.0) | After (0.14.0) |
|
|
17
|
+
| --------------------- | ---------------------- |
|
|
18
|
+
| `border-focus-black` | `border-focus` |
|
|
19
|
+
| `outline-focus-black` | `outline-focus` |
|
|
20
|
+
| `divide-focus-black` | `divide-focus` |
|
|
21
|
+
| `stroke-focus-black` | `stroke-focus` |
|
|
22
|
+
| `border-focus-blue` | `border-accent-focus` |
|
|
23
|
+
| `outline-focus-blue` | `outline-accent-focus` |
|
|
24
|
+
| `divide-focus-blue` | `divide-accent-focus` |
|
|
25
|
+
| `stroke-focus-blue` | `stroke-accent-focus` |
|
|
26
|
+
|
|
27
|
+
**Not affected:**
|
|
28
|
+
|
|
29
|
+
- The CSS variables. `focus` still resolves `var(--stroke-focus-black, var(--stroke-focus, #161B2D))` and `accent-focus` still resolves `var(--stroke-focus-blue, #6785FB)`. A theme set up for 0.13.0 — or for 0.12.x, which used `--stroke-focus` — needs no change.
|
|
30
|
+
- Tailwind's `focus:` and `focus-visible:` **variants**, which have nothing to do with the token. `focus-visible:outline-focus-black` becomes `focus-visible:outline-focus`; the `focus-visible:` prefix is untouched.
|
|
31
|
+
- `controls-focus` / `--controls-stroke-focus` — a separate legacy token.
|
|
32
|
+
|
|
33
|
+
## Step-by-step migration
|
|
34
|
+
|
|
35
|
+
### If you are coming from 0.12.x
|
|
36
|
+
|
|
37
|
+
Nothing to do for `focus` — the name you have is the name that ships. Only `focus-blue` → `accent-focus` applies.
|
|
38
|
+
|
|
39
|
+
### If you are coming from 0.13.0
|
|
40
|
+
|
|
41
|
+
#### 1. Find all usages
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
grep -rEn "(border|outline|divide|stroke)-focus-(black|blue)" src/
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
#### 2. Rename the utilities
|
|
48
|
+
|
|
49
|
+
**Before:**
|
|
50
|
+
|
|
51
|
+
```tsx
|
|
52
|
+
<button className="focus-visible:outline focus-visible:outline-focus-black" />
|
|
53
|
+
<div className="focus-within:border-focus-blue" />
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
**After:**
|
|
57
|
+
|
|
58
|
+
```tsx
|
|
59
|
+
<button className="focus-visible:outline focus-visible:outline-focus" />
|
|
60
|
+
<div className="focus-within:border-accent-focus" />
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
In SCSS:
|
|
64
|
+
|
|
65
|
+
```scss
|
|
66
|
+
.my-control:focus-visible {
|
|
67
|
+
@apply outline outline-offset-2 outline-focus;
|
|
68
|
+
}
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
#### 3. Verify
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
npm run build:css # a stale @apply is a hard error here
|
|
75
|
+
npm run typecheck && npm run test
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Then confirm the ring is actually painted, not just present:
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
grep -c "outline-focus" dist/index.css
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
## Notes
|
|
85
|
+
|
|
86
|
+
- `ringColor` is not wired to this token scale, so `ring-focus` does not resolve — it did not in 0.12.x or 0.13.0 either. Use `outline-focus` for focus rings; the `outline` utility already emits a 1px solid ring.
|
|
87
|
+
- A stale `outline-focus-black` in JSX is silent: Tailwind emits nothing, the outline falls back to `currentColor`, and the ring looks _almost_ right. Run the grep.
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
# Migrating the multi-select `Select` option row — v0.13.x → v0.14.0
|
|
2
|
+
|
|
3
|
+
## Why this changed
|
|
4
|
+
|
|
5
|
+
A multi-select option used to be a `role="option"` wrapper with a real
|
|
6
|
+
`<input type="checkbox">` inside it. That gave one choice two controls and two
|
|
7
|
+
states: the option announced `aria-selected` while the checkbox announced
|
|
8
|
+
`aria-checked`, and a screen reader had no way to tell which of the two it had
|
|
9
|
+
landed on. It also left most of the row inert — only the 20px box and the label
|
|
10
|
+
text selected the option, while the rest of the 40px rectangle did nothing, and
|
|
11
|
+
the overlay's arrow keys could not reach the row at all because the wrapper was
|
|
12
|
+
not focusable.
|
|
13
|
+
|
|
14
|
+
The row is now a single control, as the design has it and as the WAI-ARIA
|
|
15
|
+
listbox pattern prescribes: one `option` carrying `aria-selected`, with the
|
|
16
|
+
checkbox drawn as a decorative box. The whole row selects, Enter and Space
|
|
17
|
+
toggle it, and the arrow keys walk it like they already walked single-select
|
|
18
|
+
options.
|
|
19
|
+
|
|
20
|
+
Nothing in `SelectProps` changed. This only affects code — mostly tests — that
|
|
21
|
+
reached for the checkbox inside an option.
|
|
22
|
+
|
|
23
|
+
## What changed
|
|
24
|
+
|
|
25
|
+
| Before | After |
|
|
26
|
+
| -------------------------------------------------- | --------------------------------------------- |
|
|
27
|
+
| `role="option"` wrapper + nested `role="checkbox"` | one `role="option"` element |
|
|
28
|
+
| state on the checkbox's `aria-checked` | state on the option's `aria-selected` |
|
|
29
|
+
| clickable: the box and the label text | clickable: the whole row |
|
|
30
|
+
| `<div>` wrapper, not focusable | `<button role="option">`, arrow-key reachable |
|
|
31
|
+
| Select All: `role="checkbox"` | Select All: `role="checkbox"` (**unchanged**) |
|
|
32
|
+
|
|
33
|
+
## Step-by-step migration
|
|
34
|
+
|
|
35
|
+
### 1. Find all usages
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
# Tests and helpers that address a multi-select option through its checkbox
|
|
39
|
+
grep -rn "getByRole('checkbox'\|getAllByRole('checkbox'\|role=\"checkbox\"" src/
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Only the hits that target an **option of a multiple `Select`** need changing.
|
|
43
|
+
The Select All row above the list is still a real checkbox, as are `Checkbox`
|
|
44
|
+
and every other checkbox in your app.
|
|
45
|
+
|
|
46
|
+
### 2. Query the option instead of its checkbox
|
|
47
|
+
|
|
48
|
+
**Before:**
|
|
49
|
+
|
|
50
|
+
```tsx
|
|
51
|
+
fireEvent.click(screen.getByRole('checkbox', { name: 'Option 1' }));
|
|
52
|
+
expect(screen.getByRole('checkbox', { name: 'Option 1' })).toBeChecked();
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
**After:**
|
|
56
|
+
|
|
57
|
+
```tsx
|
|
58
|
+
fireEvent.click(screen.getByRole('option', { name: 'Option 1' }));
|
|
59
|
+
expect(screen.getByRole('option', { name: 'Option 1' })).toHaveAttribute(
|
|
60
|
+
'aria-selected',
|
|
61
|
+
'true',
|
|
62
|
+
);
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
`toBeChecked()` works on elements with `aria-checked` or a checkbox role, so it
|
|
66
|
+
does not apply to an `option`. Assert `aria-selected` instead.
|
|
67
|
+
|
|
68
|
+
### 3. Drop workarounds for the inert row
|
|
69
|
+
|
|
70
|
+
If you clicked the label text to work around the row not being clickable, or
|
|
71
|
+
focused the inner input to drive the keyboard, target the option directly:
|
|
72
|
+
|
|
73
|
+
**Before:**
|
|
74
|
+
|
|
75
|
+
```tsx
|
|
76
|
+
await user.click(screen.getByText('Option 1'));
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
**After:**
|
|
80
|
+
|
|
81
|
+
```tsx
|
|
82
|
+
await user.click(screen.getByRole('option', { name: 'Option 1' }));
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### 4. Verify
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
npm run typecheck && npm run test
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
## Notes
|
|
92
|
+
|
|
93
|
+
- The option's accessible name now comes from its own content — the label, plus
|
|
94
|
+
the option's `description` when it has one. The decorative box is
|
|
95
|
+
`aria-hidden`, so it contributes nothing to the name.
|
|
96
|
+
- Custom styling that targeted the nested checkbox (for instance
|
|
97
|
+
`[role="option"] input`) no longer matches anything. Style the row itself.
|
|
98
|
+
- If you render your own multiselect-looking row and want the same box, import
|
|
99
|
+
`CheckboxBox` and leave `htmlFor` off — it renders the decorative variant.
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
# Migrating the shadow scale — v0.13.0 → v0.14.0
|
|
2
|
+
|
|
3
|
+
## Why this changed
|
|
4
|
+
|
|
5
|
+
The shadow scale was themed through three variables named after the **colours** in it, not after the steps that used them:
|
|
6
|
+
|
|
7
|
+
```js
|
|
8
|
+
// 0.13.0
|
|
9
|
+
DEFAULT: '0 0 4px 0 var(--shadow-default, rgba(0, 0, 0, 0.30))',
|
|
10
|
+
xs: '0 1px 4px 0 var(--shadow-grey-1000, …), 0 1px 2px 0 var(--shadow-blue-500, …)',
|
|
11
|
+
sm: '0 2px 12px 0 var(--shadow-grey-1000, …), 0 2px 6px 0 var(--shadow-blue-500, …)',
|
|
12
|
+
md: '0 6px 24px 0 var(--shadow-grey-1000, …), 0 6px 16px 0 var(--shadow-blue-500, …)',
|
|
13
|
+
lg: '0 10px 36px 0 var(--shadow-grey-1000, …), 0 10px 24px 0 var(--shadow-blue-500, …)',
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
One `--shadow-blue-500` carried the blue of all four steps, so a theme could not darken `lg` without darkening `xs` by the same amount — the ramp collapsed to a single value. `--shadow-grey-1000` had the same problem across the two steps that still use grey.
|
|
17
|
+
|
|
18
|
+
The design has since split the scale per step: `sm`, `md` and `lg` are a **single** wide blue layer (the grey layer only muddies them at that size), and `xs` keeps two layers but with the blue as the wide one. Each step now reads its own variable, named after the step rather than the hue:
|
|
19
|
+
|
|
20
|
+
- `--shadow-sm`, `--shadow-md`, `--shadow-lg` — the one layer each of those steps draws.
|
|
21
|
+
- `--shadow-xs-1` / `--shadow-xs-2` — the two layers `shadow-xs` draws, outer first.
|
|
22
|
+
|
|
23
|
+
`sm` also changed meaning. It used to be the resting shadow of a solid button; it is now the **side panel** shadow — `0 8px 10px` at blue-500 alpha-8, used by the side bar, the side panel and the right panel. The value it used to hold has not changed at all, but it no longer has a step in the design scale, so it is written out in `buttons.scss` as a class instead of taking a fifth `boxShadow` key:
|
|
24
|
+
|
|
25
|
+
| Role | 0.13.0 | 0.14.0 |
|
|
26
|
+
| --------------------------------------------------------- | ----------- | ------------------------- |
|
|
27
|
+
| Side bar / side panel / right panel | — | `shadow-sm` |
|
|
28
|
+
| Resting shadow of a solid button, the FAB, a slider thumb | `shadow-sm` | `dial-kit-control-shadow` |
|
|
29
|
+
|
|
30
|
+
## What changed
|
|
31
|
+
|
|
32
|
+
### Variables
|
|
33
|
+
|
|
34
|
+
| 0.13.0 variable | 0.14.0 variable | Light default |
|
|
35
|
+
| -------------------- | --------------------------------------------------------------- | ------------------------------- |
|
|
36
|
+
| `--shadow-blue-500` | `--shadow-xs-1` (xs and `dial-kit-control-shadow`) | `#2764D933` (blue-500 alpha-20) |
|
|
37
|
+
| `--shadow-blue-500` | `--shadow-sm` | `#2764D914` (blue-500 alpha-8) |
|
|
38
|
+
| `--shadow-blue-500` | `--shadow-md` | `#2764D90F` (blue-500 alpha-6) |
|
|
39
|
+
| `--shadow-blue-500` | `--shadow-lg` | `#2764D914` (blue-500 alpha-8) |
|
|
40
|
+
| `--shadow-grey-1000` | `--shadow-xs-2` (the same two — no other step has a grey layer) | `#161B2D08` (grey-1000 alpha-3) |
|
|
41
|
+
| `--shadow-default` | _removed_ — `shadow` is no longer a DIAL shadow (see Notes) | — |
|
|
42
|
+
|
|
43
|
+
The 0.13.0 names are **not** kept in the fallback chain: one old variable cannot map onto five new ones without re-flattening the ramp it was split to fix.
|
|
44
|
+
|
|
45
|
+
### Rendered shadows
|
|
46
|
+
|
|
47
|
+
| Step | 0.13.0 | 0.14.0 |
|
|
48
|
+
| ------------------------- | ----------------------------------------------- | -------------------------------------------- |
|
|
49
|
+
| `shadow-xs` | `0 1px 4px` grey, `0 1px 2px` blue alpha-14 | `0 1px 4px` blue alpha-20, `0 1px 2px` grey |
|
|
50
|
+
| `dial-kit-control-shadow` | _(new — held by `shadow-sm` in 0.13.0)_ | `0 2px 12px` blue alpha-20, `0 2px 6px` grey |
|
|
51
|
+
| `shadow-sm` | `0 2px 12px` grey, `0 2px 6px` blue alpha-14 | `0 8px 10px` blue alpha-8 |
|
|
52
|
+
| `shadow-md` | `0 6px 24px` grey, `0 6px 16px` blue alpha-14 | `0 8px 24px` blue alpha-6 |
|
|
53
|
+
| `shadow-lg` | `0 10px 36px` grey, `0 10px 24px` blue alpha-14 | `0 8px 44px` blue alpha-8 |
|
|
54
|
+
|
|
55
|
+
In `xs` the blue and grey layers have **swapped roles**: the blue is now the wide diffuse layer and the grey the tight one. `md` and `lg` sit lower and softer than before, so anything using them — `Card`, `Calendar`, `Input`, overlays, tooltips, the collapsible sidebar (`md`), `Notification` and card hover (`lg`) — reads differently. `dial-kit-control-shadow` renders exactly what `shadow-sm` rendered in 0.13.0, so a control that switches to it is unchanged.
|
|
56
|
+
|
|
57
|
+
## Step-by-step migration
|
|
58
|
+
|
|
59
|
+
### 1. Move the resting control shadow to `dial-kit-control-shadow`
|
|
60
|
+
|
|
61
|
+
`shadow-sm` on a button, a FAB or any other resting control is now the panel shadow — a wider, lower, much fainter blue that reads as a floating surface rather than a raised control. Find them:
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
grep -rn "shadow-sm" src/
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
**Before:**
|
|
68
|
+
|
|
69
|
+
```tsx
|
|
70
|
+
<button className="rounded-full bg-control-neutral shadow-sm">New chat</button>
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
**After:**
|
|
74
|
+
|
|
75
|
+
```tsx
|
|
76
|
+
<button className="rounded-full bg-control-neutral dial-kit-control-shadow">
|
|
77
|
+
New chat
|
|
78
|
+
</button>
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
Keep `shadow-sm` where the element is a side bar, side panel or right panel — that is what the step now means.
|
|
82
|
+
|
|
83
|
+
`dial-kit-control-shadow` is a plain class in the kit's stylesheet, not a Tailwind utility, so it is **unlayered**: it beats any `shadow-*` utility on the same element regardless of order. Do not pair it with one — pick whichever of the two the element should draw.
|
|
84
|
+
|
|
85
|
+
### 2. Find the variables in your theme
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
grep -rEn -- "--shadow-(default|blue-500|grey-1000)" src/ themes/
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
Also check any theme JSON served by the DIAL themes service.
|
|
92
|
+
|
|
93
|
+
### 3. Rename them
|
|
94
|
+
|
|
95
|
+
**Before:**
|
|
96
|
+
|
|
97
|
+
```css
|
|
98
|
+
:root {
|
|
99
|
+
--shadow-blue-500: #2764d924;
|
|
100
|
+
--shadow-grey-1000: #161b2d08;
|
|
101
|
+
--shadow-default: rgba(0, 0, 0, 0.3);
|
|
102
|
+
}
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
**After:**
|
|
106
|
+
|
|
107
|
+
```css
|
|
108
|
+
:root {
|
|
109
|
+
--shadow-xs-1: #2764d933; /* wide blue layer of xs and the control shadow */
|
|
110
|
+
--shadow-xs-2: #161b2d08; /* tight grey layer of the same two */
|
|
111
|
+
--shadow-sm: #2764d914;
|
|
112
|
+
--shadow-md: #2764d90f;
|
|
113
|
+
--shadow-lg: #2764d914;
|
|
114
|
+
}
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
Splitting one blue into four is the point of the change: pick a lighter value for `--shadow-sm`, `--shadow-md` and `--shadow-lg` than for `--shadow-xs-1`, since those steps have no second layer to sit on. Setting all four to your old `--shadow-blue-500` value compiles, but reproduces the flat ramp.
|
|
118
|
+
|
|
119
|
+
### 4. Verify
|
|
120
|
+
|
|
121
|
+
```bash
|
|
122
|
+
npm run build:css
|
|
123
|
+
npm run typecheck && npm run test
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
Then confirm the variables reached the compiled shadows:
|
|
127
|
+
|
|
128
|
+
```bash
|
|
129
|
+
grep -o -- "--tw-shadow:0 [^;]*" dist/index.css | sort -u
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
Every DIAL step should reference a `--shadow-xs-*` / `--shadow-sm` / `--shadow-md` / `--shadow-lg` variable.
|
|
133
|
+
|
|
134
|
+
## Notes
|
|
135
|
+
|
|
136
|
+
- **`shadow` (the `DEFAULT`) is no longer a DIAL shadow.** `boxShadow` is declared under `theme.extend`, so removing the `DEFAULT` entry does not remove the class — it falls back to Tailwind's own `shadow` (`0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)`), which is a neutral black shadow and ignores `--shadow-default`. Replace a bare `shadow` with the step you mean — `dial-kit-control-shadow` for a control, `shadow-md` for a raised surface.
|
|
137
|
+
- **A `shadow-sm` left on a button still compiles.** Nothing typechecks a Tailwind class, so the only signal is the rendering: the control loses its tight halo and picks up a faint wide one. Run the grep in step 1 rather than waiting for an error.
|
|
138
|
+
- A stale `--shadow-blue-500` in a theme is silent: nothing reads it, and every shadow quietly renders at its light default. Run the grep rather than trusting the page to look wrong.
|
|
139
|
+
- These names match `tailwind.config.js` in `ai-dial-chat`, so a variable set for the chat app resolves the same way in the kit.
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
# Migrating `Tag` — one size, no rim — v`0.13.x` → v`0.14.0`
|
|
2
|
+
|
|
3
|
+
## Why this changed
|
|
4
|
+
|
|
5
|
+
The 2.0 tag is one shape: a 32px pill. The old `size` prop offered two heights
|
|
6
|
+
(24px standard, 20px small) that the design system no longer draws, and a tag is
|
|
7
|
+
not a control a caller sizes — it labels content, so it takes the size the
|
|
8
|
+
design gives it. Dropping the prop also removes the branch that had to keep two
|
|
9
|
+
geometries, two pointer-target rules and two radii in step.
|
|
10
|
+
|
|
11
|
+
The rim went with it. No tag draws a border any more: the outlined chip is told
|
|
12
|
+
apart by its fill on the raised layer, and the accent tint carries hover and
|
|
13
|
+
selection. A 1px rim on a 32px pill was doing no work the fill was not already
|
|
14
|
+
doing, and it was the last thing keeping a border box on the borderless
|
|
15
|
+
selectable chip.
|
|
16
|
+
|
|
17
|
+
Alongside it, the selectable chip picks up the rest of its spec: a semibold
|
|
18
|
+
label once selected, and hover carried by the accent tint alone instead of also
|
|
19
|
+
darkening the label.
|
|
20
|
+
|
|
21
|
+
## What changed
|
|
22
|
+
|
|
23
|
+
| Before | After |
|
|
24
|
+
| -------------------------------------------------- | --------------------------------------------------- |
|
|
25
|
+
| `<Tag size={ElementSize.Standard} />` | `<Tag />` |
|
|
26
|
+
| `<Tag size={ElementSize.Small} />` | `<Tag />` — there is no 20px tag |
|
|
27
|
+
| `TagProps['size']` | removed from the type |
|
|
28
|
+
| 24px tall, `rounded-lg`, 8px side padding | 32px tall, `rounded-full`, 12px side padding |
|
|
29
|
+
| 1px rim (`border-tertiary`, `border-accent-alpha`) | no border on any tag |
|
|
30
|
+
| Outlined hover: rim → `border-accent-alpha` | Hover: `bg-control-accent-alpha-hover` on every tag |
|
|
31
|
+
| Selected selectable chip: regular label | Selected selectable chip: semibold label |
|
|
32
|
+
| Selectable chip hover: label → `text-primary` | Label colour unchanged on hover |
|
|
33
|
+
| `disabled` dimmed the tag and sank its fill | `disabled` only stops it responding |
|
|
34
|
+
| `transition-colors duration-200` | no transition — the design switches the fill at 0ms |
|
|
35
|
+
| `TagInput size="sm"` rendered 20px tags | Renders the one 32px tag; the field grows to fit |
|
|
36
|
+
|
|
37
|
+
`Tag` is the only component with a changed public API. `TagInput`, `Select` and
|
|
38
|
+
`MultiSelectTags` compose it and need no changes at the call site, but their
|
|
39
|
+
tags are visibly taller.
|
|
40
|
+
|
|
41
|
+
## Step-by-step migration
|
|
42
|
+
|
|
43
|
+
### 1. Find all usages
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
# Tags that pass a size
|
|
47
|
+
grep -rn "<Tag" -A 6 src/ | grep -n "size="
|
|
48
|
+
|
|
49
|
+
# Layouts that assumed the old 24px/20px tag height
|
|
50
|
+
grep -rn "h-\[24px\]\|h-\[20px\]" src/
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### 2. Drop the prop
|
|
54
|
+
|
|
55
|
+
**Before:**
|
|
56
|
+
|
|
57
|
+
```tsx
|
|
58
|
+
<Tag label="TypeScript" size={ElementSize.Small} />
|
|
59
|
+
<Tag label="Drafts" size={ElementSize.Standard} selected onClick={toggle} />
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
**After:**
|
|
63
|
+
|
|
64
|
+
```tsx
|
|
65
|
+
<Tag label="TypeScript" />
|
|
66
|
+
<Tag label="Drafts" selected onClick={toggle} />
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### 3. Re-check the containers around your tags
|
|
70
|
+
|
|
71
|
+
A tag is 8px taller than the 0.13.x standard one and 12px taller than the small
|
|
72
|
+
one, so any row with a fixed height needs another look:
|
|
73
|
+
|
|
74
|
+
```tsx
|
|
75
|
+
// Before: a row sized to the old tag
|
|
76
|
+
<div className="flex h-[24px] items-center gap-1">{tags}</div>
|
|
77
|
+
|
|
78
|
+
// After: let the row take the tag's height
|
|
79
|
+
<div className="flex items-center gap-1">{tags}</div>
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
The same applies to a small `TagInput`: its field is `min-h-[24px]` over
|
|
83
|
+
`h-auto`, so it grows around the tags rather than clipping them — but a wrapper
|
|
84
|
+
you gave a fixed height will clip.
|
|
85
|
+
|
|
86
|
+
### 4. Update tests that asserted the old geometry
|
|
87
|
+
|
|
88
|
+
```diff
|
|
89
|
+
-expect(tag).toHaveClass('h-[20px]');
|
|
90
|
+
+expect(tag).toHaveClass('h-[32px]');
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### 5. Verify
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
npm run typecheck && npm run test
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
`typecheck` finds every remaining `size` on a `Tag` for you — the prop is gone
|
|
100
|
+
from `TagProps`, so each one is a type error rather than a silent no-op.
|
|
101
|
+
|
|
102
|
+
## Notes
|
|
103
|
+
|
|
104
|
+
- A disabled tag is no longer dimmed — the design defines no disabled tag, so
|
|
105
|
+
`disabled` keeps the colours and only removes the click handling, the remove
|
|
106
|
+
control and the pointer. If your UI relies on a disabled tag being visibly
|
|
107
|
+
inert, say so with the surrounding copy or pass your own `className`.
|
|
108
|
+
- `TagAppearance.Outlined` keeps its name even though it no longer outlines
|
|
109
|
+
anything — renaming it would be a second breaking change in the same release.
|
|
110
|
+
Read it as "the default filled chip".
|
|
111
|
+
- The selected selectable chip is set in `dial-tiny-semi-text`, so selecting one
|
|
112
|
+
changes its width by the difference between the regular and semibold label. In
|
|
113
|
+
a wrapping filter row that is the intended behaviour; give the chip a width if
|
|
114
|
+
a stable layout matters more.
|
|
115
|
+
- `dial-kit-minimum-target` is gone from the tag itself. At 32px the rendered
|
|
116
|
+
size clears the WCAG 2.5.8 minimum of 24×24 on its own, so the pseudo-element
|
|
117
|
+
is no longer needed — and with it goes the target that used to sit over a
|
|
118
|
+
nested remove button. The remove button keeps its own.
|
|
119
|
+
- The class matrix now lives in `src/components/New/Tag/constants.ts`
|
|
120
|
+
(`tagBaseClassName`, `tagStateClassNames`, `tagHoverClassName`). These are
|
|
121
|
+
internal — they are not exported from the package.
|
|
@@ -22,6 +22,12 @@ migration-guides/
|
|
|
22
22
|
| 0.13.0 | [caption-semi-text-lead-rename](0.13.0/caption-semi-text-lead-rename.md) | `dial-caption-semi-text` renamed to `dial-caption-lead-semi-text` and now uppercases |
|
|
23
23
|
| 0.13.0 | [progress-bar-2-0-rewrite](0.13.0/progress-bar-2-0-rewrite.md) | `DialProgressBar` rebuilt on 2.0 tokens as `ProgressBar`; `DialProgressBarSize` → `ElementSize`, `ariaLabel` → `aria-label` |
|
|
24
24
|
| 0.13.0 | [field-label-props-unification](0.13.0/field-label-props-unification.md) | `Calendar`, `Switch` and `ProgressBar` take `labelProps` instead of `label`, so every 2.0 field names itself through `Label` |
|
|
25
|
+
| 0.14.0 | [control-color-token-rename](0.14.0/control-color-token-rename.md) | Control tokens renamed by role: `control-disable-alpha`/`-beta` → `-primary`/`-secondary`, `text-control-blue-*` → `text-control-accent-*`, `bg-control-disable` → `bg-control-disable-primary`, `bg-control-neutral-hover` → `-hover-muted` |
|
|
26
|
+
| 0.14.0 | [focus-border-token-role-naming](0.14.0/focus-border-token-role-naming.md) | Border tokens `focus-black` → `focus` and `focus-blue` → `accent-focus`, reversing the 0.13.0 value-based naming |
|
|
27
|
+
| 0.14.0 | [select-multiselect-option-row](0.14.0/select-multiselect-option-row.md) | A multi-select `Select` option is one `option` with `aria-selected` and a decorative box, instead of an option wrapping a real `role="checkbox"` |
|
|
28
|
+
| 0.14.0 | [button-tooltip-2-0](0.14.0/button-tooltip-2-0.md) | `Button` and `IconButton` wrap the 2.0 `Tooltip` with `asChild`: `placement` takes `TooltipPlacement`, and the trigger `<span>` is gone |
|
|
29
|
+
| 0.14.0 | [tag-single-size](0.14.0/tag-single-size.md) | `Tag` drops `size` for one 32px pill; the selectable chip gets a semibold selected label |
|
|
30
|
+
| 0.14.0 | [shadow-token-per-step-rename](0.14.0/shadow-token-per-step-rename.md) | Shadow scale rebuilt per step: `sm` moves to the side panels, controls keep their shadow under `dial-kit-control-shadow` |
|
|
25
31
|
|
|
26
32
|
---
|
|
27
33
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DragEvent } from 'react';
|
|
1
|
+
import { ChangeEvent, DragEvent } from 'react';
|
|
2
2
|
import { DialFile } from '../../../models/file';
|
|
3
3
|
import { DialFileAcceptType, DialUploadFileItem } from '../../../models/file-manager';
|
|
4
4
|
import { FileConflictDecision } from '../components/ConflictResolutionPopup/ConflictResolutionPopup';
|
|
@@ -50,6 +50,8 @@ export declare const useFileUpload: ({ onUploadFiles, onValidateUpload, maxFileS
|
|
|
50
50
|
openFileDialog: (destinationFolder: string, existingFiles: DialFile[]) => void;
|
|
51
51
|
openArchiveDialog: (destinationFolder: string, existingFiles: DialFile[]) => void;
|
|
52
52
|
fileInputRef: import('react').RefObject<HTMLInputElement | null>;
|
|
53
|
+
fileInputAccept: string | undefined;
|
|
54
|
+
handleFileInputChange: (event: ChangeEvent<HTMLInputElement>) => Promise<void>;
|
|
53
55
|
uploadConflictingFiles: DialFile[];
|
|
54
56
|
uploadConflictResolutionOpen: boolean;
|
|
55
57
|
hasActiveUploadConflictRef: import('react').RefObject<boolean>;
|
|
@@ -1,4 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const baseColumnComparator: (a: string | number | undefined, b: string | number | undefined, _nodeA?: IRowNode, _nodeB?: IRowNode, isInverted?: boolean) => number;
|
|
3
|
-
export declare const omitUndefined: <T extends object>(value: T | undefined) => T;
|
|
4
|
-
export declare const checkColDefsChanges: (cols: ColDef[], initialCols: ColDef[]) => boolean;
|
|
1
|
+
export { baseColumnComparator, checkColDefsChanges, omitUndefined, } from '../../../utils/grid-comparators';
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare function convertToDate(input?: DateValue | null): Date | null;
|
|
1
|
+
export { convertToDate } from '../../../utils/grid-date';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ButtonHTMLAttributes, DetailedHTMLProps, FC, HTMLAttributeAnchorTarget, ReactNode } from 'react';
|
|
2
|
-
import { DialTooltipProps } from '../../Tooltip/Tooltip';
|
|
3
2
|
import { ButtonAppearance, ButtonVariant } from '../../../types/button';
|
|
4
3
|
import { ElementSize } from '../../../types/size';
|
|
5
|
-
|
|
4
|
+
import { TooltipProps } from '../Tooltip/Tooltip';
|
|
5
|
+
type ButtonTooltipProps = Omit<TooltipProps, 'children'>;
|
|
6
6
|
export interface ButtonProps extends DetailedHTMLProps<ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement> {
|
|
7
7
|
variant?: ButtonVariant;
|
|
8
8
|
size?: ElementSize;
|
|
@@ -11,7 +11,7 @@ export interface ButtonProps extends DetailedHTMLProps<ButtonHTMLAttributes<HTML
|
|
|
11
11
|
label?: ReactNode;
|
|
12
12
|
iconBefore?: ReactNode;
|
|
13
13
|
iconAfter?: ReactNode;
|
|
14
|
-
tooltipProps?:
|
|
14
|
+
tooltipProps?: ButtonTooltipProps;
|
|
15
15
|
href?: string;
|
|
16
16
|
target?: HTMLAttributeAnchorTarget;
|
|
17
17
|
rel?: string;
|
|
@@ -58,6 +58,7 @@ export interface ButtonProps extends DetailedHTMLProps<ButtonHTMLAttributes<HTML
|
|
|
58
58
|
* `<button>`, so the control keeps the link role, middle-click, and
|
|
59
59
|
* "open in new tab". Pair it with `ButtonAppearance.Link` (or `LinkButton`)
|
|
60
60
|
* unless a button-shaped link is intended.
|
|
61
|
+
* @param [tooltipProps] - Props of the 2.0 {@link Tooltip} wrapping the button
|
|
61
62
|
* @param [target] - Anchor target, only meaningful alongside `href`
|
|
62
63
|
* @param [rel] - Anchor `rel`. Defaults to `noopener noreferrer` when
|
|
63
64
|
* `target="_blank"`.
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { CalendarMode } from '../../../types/calendar';
|
|
2
2
|
export declare const DEFAULT_CALENDAR_LOCALE = "en-GB";
|
|
3
3
|
export declare const calendarModeDefaultPlaceholder: Record<CalendarMode, string>;
|
|
4
|
-
export declare const calendarFieldBaseClassName = "flex w-full items-center justify-between gap-2 rounded-xl border border-secondary bg-layer-raised px-4 py-3 dial-small-text text-primary outline-none transition-colors hover:border-
|
|
5
|
-
export declare const calendarFieldDisabledClassName = "!cursor-not-allowed !border-transparent bg-layer-sunken text-control-disable-
|
|
4
|
+
export declare const calendarFieldBaseClassName = "flex w-full items-center justify-between gap-2 rounded-xl border border-secondary bg-layer-raised px-4 py-3 dial-small-text text-primary outline-none transition-colors hover:border-accent-alpha focus-within:border-accent-focus";
|
|
5
|
+
export declare const calendarFieldDisabledClassName = "!cursor-not-allowed !border-transparent bg-layer-sunken text-control-disable-primary hover:!border-transparent";
|
|
6
6
|
export declare const calendarFieldInvalidClassName = "!border-error";
|
|
7
|
-
export declare const calendarPopoverClassName = "z-[53] flex w-[248px] flex-col gap-4 rounded-lg bg-layer-raised px-
|
|
8
|
-
export declare const calendarDayButtonBaseClassName = "flex size-
|
|
7
|
+
export declare const calendarPopoverClassName = "z-[53] flex w-[248px] flex-col gap-4 rounded-lg bg-layer-raised px-2 py-4 shadow-md";
|
|
8
|
+
export declare const calendarDayButtonBaseClassName = "flex size-10 items-center justify-center rounded-full dial-small-text text-primary hover:bg-control-accent-alpha-hover hover:text-primary focus:outline-none focus-visible:outline focus-visible:outline-focus";
|
|
9
9
|
export declare const calendarDaySelectedClassName = "bg-control-accent text-control-permanent";
|
|
10
10
|
export declare const calendarDayTodayClassName = "text-accent dial-small-semi-text";
|
|
11
|
-
export declare const calendarDayOutsideClassName = "text-control-disable-
|
|
11
|
+
export declare const calendarDayOutsideClassName = "text-control-disable-primary";
|
|
12
12
|
export declare const calendarFieldIconClassName = "text-secondary";
|
|
13
13
|
export declare const calendarIcon: import("react/jsx-runtime").JSX.Element;
|
|
14
14
|
export declare const calendarNavIcons: {
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { FC, InputHTMLAttributes } from 'react';
|
|
2
|
+
import { LabelProps } from '../Label/Label';
|
|
3
|
+
type NativeInputProps = Omit<InputHTMLAttributes<HTMLInputElement>, 'type' | 'checked' | 'onChange' | 'size'>;
|
|
4
|
+
export interface CheckboxProps extends NativeInputProps {
|
|
5
|
+
labelProps?: LabelProps;
|
|
6
|
+
isSelected?: boolean;
|
|
7
|
+
isIndeterminate?: boolean;
|
|
8
|
+
invalid?: boolean;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
onChange?: (value: boolean) => void;
|
|
11
|
+
caption?: string;
|
|
12
|
+
boxClassName?: string;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* A checkbox from the 2.0 design system.
|
|
16
|
+
* aliases: ToggleCheckbox|MultiSelectOption|TriStateCheckbox
|
|
17
|
+
* Design system 2.0
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```tsx
|
|
21
|
+
* <Checkbox
|
|
22
|
+
* labelProps={{ label: 'Accept terms' }}
|
|
23
|
+
* isSelected={accepted}
|
|
24
|
+
* onChange={setAccepted}
|
|
25
|
+
* />
|
|
26
|
+
* ```
|
|
27
|
+
*
|
|
28
|
+
* `isIndeterminate` takes visual precedence over `isSelected` and announces the
|
|
29
|
+
* control as `mixed` — use it for a parent whose children are partly selected.
|
|
30
|
+
* It also sets the native `indeterminate` DOM property, which no React prop
|
|
31
|
+
* covers. Clicking an indeterminate checkbox selects it, as it does natively.
|
|
32
|
+
*
|
|
33
|
+
* The box and the label text are two sibling `<label for>` elements rather than
|
|
34
|
+
* one wrapper, so the {@link Label} keeps its own `required` marker and
|
|
35
|
+
* `caption` info button — a button nested in a label forwards its clicks to the
|
|
36
|
+
* labelled control. Clicking either one still toggles the checkbox.
|
|
37
|
+
*
|
|
38
|
+
* @param [labelProps] - Props of the {@link Label} rendered next to the control
|
|
39
|
+
* @param [isSelected=false] - The current value of the checkbox
|
|
40
|
+
* @param [isIndeterminate=false] - Whether the checkbox is in the mixed state
|
|
41
|
+
* @param [invalid=false] - Whether the checkbox failed validation (applies error styling)
|
|
42
|
+
* @param [disabled=false] - Whether the checkbox is disabled
|
|
43
|
+
* @param [onChange] - Callback fired with the new value when toggled
|
|
44
|
+
* @param [caption] - Caption text rendered below the label, and described by the checkbox
|
|
45
|
+
* @param [boxClassName] - Additional classes for the box itself. Use it to drop
|
|
46
|
+
* the box's own focus ring where the container already draws one, as a
|
|
47
|
+
* multiselect row does.
|
|
48
|
+
*/
|
|
49
|
+
export declare const Checkbox: FC<CheckboxProps>;
|
|
50
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
export interface CheckboxBoxProps {
|
|
3
|
+
isSelected?: boolean;
|
|
4
|
+
isIndeterminate?: boolean;
|
|
5
|
+
invalid?: boolean;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
htmlFor?: string;
|
|
8
|
+
className?: string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* The 20px box a checkbox draws — the square, its border, its fill and the
|
|
12
|
+
* check or dash inside.
|
|
13
|
+
* Design system 2.0
|
|
14
|
+
*
|
|
15
|
+
* Two things render it: {@link Checkbox}, where it is the `<label for>` that
|
|
16
|
+
* toggles the input next to it, and rows that only *look* like a checkbox —
|
|
17
|
+
* a `menuitemcheckbox` in a dropdown, whose state lives on `aria-checked` and
|
|
18
|
+
* whose whole row is the control. Passing `htmlFor` picks the first: the box
|
|
19
|
+
* becomes a label with a pointer target of its own. Without it the box is a
|
|
20
|
+
* decorative `<span>`, hidden from assistive technology, and the row around it
|
|
21
|
+
* carries both the state and the pointer target.
|
|
22
|
+
*
|
|
23
|
+
* @param [isSelected=false] - Whether the box is filled with a check
|
|
24
|
+
* @param [isIndeterminate=false] - Whether the box is filled with a dash; takes precedence over `isSelected`
|
|
25
|
+
* @param [invalid=false] - Paints the box with the error colour
|
|
26
|
+
* @param [disabled=false] - Greys the box out
|
|
27
|
+
* @param [htmlFor] - Id of the input this box labels; omit for a decorative box
|
|
28
|
+
* @param [className] - Additional classes for the box
|
|
29
|
+
*/
|
|
30
|
+
export declare const CheckboxBox: FC<CheckboxBoxProps>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The check and minus glyphs are decorative: the input's `checked` and
|
|
3
|
+
* `aria-checked` already carry the state, so the icon is hidden from assistive
|
|
4
|
+
* tech. Tabler renders a bare `<svg>` with no role, so `aria-hidden` is explicit.
|
|
5
|
+
*/
|
|
6
|
+
export declare const CHECKBOX_ICON_PROPS: {
|
|
7
|
+
readonly size: 14;
|
|
8
|
+
readonly stroke: 3;
|
|
9
|
+
readonly 'aria-hidden': true;
|
|
10
|
+
};
|