@iyulab/components 1.57.1 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +208 -0
- package/README.md +3 -1
- package/dist/_virtual/_glob-assets_raw/dark.css.e8ac080d.js +1 -1
- package/dist/_virtual/_glob-assets_raw/light.css.637cb2f8.js +1 -1
- package/dist/assets/locales/ar.json.js +16 -2
- package/dist/assets/locales/de.json.js +16 -2
- package/dist/assets/locales/en.json.js +16 -2
- package/dist/assets/locales/es.json.js +18 -2
- package/dist/assets/locales/fr.json.js +16 -2
- package/dist/assets/locales/id.json.js +16 -2
- package/dist/assets/locales/ja.json.js +18 -2
- package/dist/assets/locales/ko.json.js +18 -2
- package/dist/assets/locales/pt-BR.json.js +16 -2
- package/dist/assets/locales/ru.json.js +16 -2
- package/dist/assets/locales/th.json.js +18 -2
- package/dist/assets/locales/vi.json.js +16 -2
- package/dist/assets/locales/zh-CN.json.js +18 -2
- package/dist/assets/locales/zh-TW.json.js +18 -2
- package/dist/components/UElement.styles.js +2 -2
- package/dist/components/alert/UAlert.d.ts +12 -7
- package/dist/components/alert/UAlert.js +3 -3
- package/dist/components/alert/UAlert.styles.js +6 -23
- package/dist/components/badge/UBadge.d.ts +5 -5
- package/dist/components/badge/UBadge.js +3 -3
- package/dist/components/badge/UBadge.styles.js +4 -4
- package/dist/components/breadcrumb-item/UBreadcrumbItem.styles.js +1 -1
- package/dist/components/button/UButton.d.ts +32 -16
- package/dist/components/button/UButton.js +38 -5
- package/dist/components/button/UButton.styles.js +67 -50
- package/dist/components/button/forwarded-aria.d.ts +6 -0
- package/dist/components/button/forwarded-aria.js +15 -0
- package/dist/components/button-group/UButtonGroup.d.ts +4 -4
- package/dist/components/button-group/UButtonGroup.js +8 -8
- package/dist/components/button-group/UButtonGroup.styles.js +2 -2
- package/dist/components/calendar/UCalendar.d.ts +4 -0
- package/dist/components/calendar/UCalendar.js +5 -4
- package/dist/components/calendar/UCalendar.styles.js +4 -3
- package/dist/components/calendar/dates.d.ts +4 -0
- package/dist/components/calendar/dates.js +5 -1
- package/dist/components/calendar/datetime.d.ts +14 -0
- package/dist/components/calendar/datetime.js +35 -0
- package/dist/components/calendar/picker.styles.js +42 -2
- package/dist/components/card/UCard.d.ts +4 -3
- package/dist/components/card/UCard.js +3 -3
- package/dist/components/card/UCard.styles.js +2 -1
- package/dist/components/carousel/UCarousel.d.ts +7 -1
- package/dist/components/carousel/UCarousel.js +10 -3
- package/dist/components/carousel/UCarousel.styles.js +17 -6
- package/dist/components/checkbox/UCheckbox.d.ts +8 -9
- package/dist/components/checkbox/UCheckbox.js +3 -3
- package/dist/components/checkbox/UCheckbox.styles.js +22 -18
- package/dist/components/chip/UChip.d.ts +2 -2
- package/dist/components/chip/UChip.js +4 -4
- package/dist/components/copy-button/UCopyButton.d.ts +2 -2
- package/dist/components/copy-button/UCopyButton.js +4 -4
- package/dist/components/date-picker/UDatePicker.d.ts +32 -1
- package/dist/components/date-picker/UDatePicker.js +96 -33
- package/dist/components/date-picker/UDatePicker.styles.js +10 -18
- package/dist/components/date-range-picker/UDateRangePicker.d.ts +72 -7
- package/dist/components/date-range-picker/UDateRangePicker.js +210 -34
- package/dist/components/date-range-picker/UDateRangePicker.styles.js +13 -3
- package/dist/components/dialog/UDialog.js +1 -1
- package/dist/components/divider/UDivider.d.ts +3 -3
- package/dist/components/divider/UDivider.js +2 -2
- package/dist/components/divider/UDivider.styles.js +5 -5
- package/dist/components/drawer/UDrawer.js +1 -1
- package/dist/components/expander/UExpander.styles.js +2 -2
- package/dist/components/file-input/UFileInput.styles.js +5 -2
- package/dist/components/icon-button/UIconButton.d.ts +4 -3
- package/dist/components/icon-button/UIconButton.js +16 -6
- package/dist/components/icon-button/UIconButton.styles.js +2 -2
- package/dist/components/input/UInput.d.ts +12 -5
- package/dist/components/input/UInput.js +7 -4
- package/dist/components/input/UInput.styles.js +60 -30
- package/dist/components/menu/UMenu.d.ts +5 -4
- package/dist/components/menu/UMenu.js +3 -3
- package/dist/components/menu/UMenu.styles.js +1 -1
- package/dist/components/menu-item/UMenuItem.styles.js +1 -1
- package/dist/components/option/UOption.d.ts +1 -0
- package/dist/components/option/UOption.js +6 -3
- package/dist/components/option/UOption.styles.js +1 -1
- package/dist/components/progress-bar/UProgressBar.styles.js +11 -0
- package/dist/components/radio/URadio.d.ts +27 -6
- package/dist/components/radio/URadio.js +48 -12
- package/dist/components/radio/URadio.styles.js +47 -13
- package/dist/components/rating/URating.styles.js +5 -1
- package/dist/components/select/USelect.d.ts +9 -2
- package/dist/components/select/USelect.js +7 -2
- package/dist/components/select/USelect.styles.js +55 -26
- package/dist/components/slider/USlider.styles.js +4 -4
- package/dist/components/spinner/USpinner.styles.js +2 -0
- package/dist/components/split-panel/USplitPanel.styles.js +2 -1
- package/dist/components/steps/USteps.d.ts +57 -0
- package/dist/components/steps/USteps.js +58 -0
- package/dist/components/steps/USteps.styles.d.ts +1 -0
- package/dist/components/steps/USteps.styles.js +110 -0
- package/dist/components/switch/USwitch.styles.js +5 -3
- package/dist/components/tab/UTab.js +2 -2
- package/dist/components/tab/UTab.styles.js +1 -1
- package/dist/components/tab-panel/UTabPanel.d.ts +11 -2
- package/dist/components/tab-panel/UTabPanel.js +33 -5
- package/dist/components/tab-panel/UTabPanel.styles.js +29 -29
- package/dist/components/tag/UTag.d.ts +14 -6
- package/dist/components/tag/UTag.js +8 -3
- package/dist/components/tag/UTag.styles.js +33 -26
- package/dist/components/textarea/UTextarea.d.ts +9 -3
- package/dist/components/textarea/UTextarea.js +7 -2
- package/dist/components/textarea/UTextarea.styles.js +41 -22
- package/dist/components/tree-item/UTreeItem.styles.js +7 -5
- package/dist/index.d.ts +1 -0
- package/dist/index.js +3 -2
- package/dist/plugins/vite-plugin-react-wrapper.js +14 -5
- package/dist/react/UAlert.d.ts +4 -2
- package/dist/react/UAvatar.d.ts +4 -2
- package/dist/react/UBadge.d.ts +4 -2
- package/dist/react/UBreadcrumb.d.ts +4 -2
- package/dist/react/UBreadcrumbItem.d.ts +4 -2
- package/dist/react/UButton.d.ts +4 -2
- package/dist/react/UButtonGroup.d.ts +4 -2
- package/dist/react/UCard.d.ts +4 -2
- package/dist/react/UCarousel.d.ts +4 -2
- package/dist/react/UCheckbox.d.ts +4 -2
- package/dist/react/UChip.d.ts +4 -2
- package/dist/react/UCopyButton.d.ts +4 -2
- package/dist/react/UDatePicker.d.ts +4 -2
- package/dist/react/UDateRangePicker.d.ts +4 -2
- package/dist/react/UDialog.d.ts +4 -2
- package/dist/react/UDivider.d.ts +4 -2
- package/dist/react/UDrawer.d.ts +4 -2
- package/dist/react/UExpander.d.ts +4 -2
- package/dist/react/UField.d.ts +4 -2
- package/dist/react/UFileInput.d.ts +4 -2
- package/dist/react/UForm.d.ts +4 -2
- package/dist/react/UIcon.d.ts +4 -2
- package/dist/react/UIconButton.d.ts +4 -2
- package/dist/react/UInput.d.ts +4 -2
- package/dist/react/UMenu.d.ts +4 -2
- package/dist/react/UMenuItem.d.ts +4 -2
- package/dist/react/UOption.d.ts +4 -2
- package/dist/react/UPanel.d.ts +4 -2
- package/dist/react/UPopover.d.ts +4 -2
- package/dist/react/UProgressBar.d.ts +4 -2
- package/dist/react/UProgressRing.d.ts +4 -2
- package/dist/react/URadio.d.ts +4 -2
- package/dist/react/URating.d.ts +4 -2
- package/dist/react/USelect.d.ts +4 -2
- package/dist/react/USkeleton.d.ts +4 -2
- package/dist/react/USlider.d.ts +4 -2
- package/dist/react/USpinner.d.ts +4 -2
- package/dist/react/USplitPanel.d.ts +4 -2
- package/dist/react/USteps.d.ts +14 -0
- package/dist/react/USteps.js +10 -0
- package/dist/react/USwitch.d.ts +4 -2
- package/dist/react/UTab.d.ts +4 -2
- package/dist/react/UTabPanel.d.ts +4 -2
- package/dist/react/UTag.d.ts +4 -2
- package/dist/react/UText.d.ts +4 -2
- package/dist/react/UTextarea.d.ts +4 -2
- package/dist/react/UTooltip.d.ts +4 -2
- package/dist/react/UTree.d.ts +4 -2
- package/dist/react/UTreeItem.d.ts +4 -2
- package/dist/react/index.d.ts +1 -0
- package/dist/react/index.js +1 -0
- package/dist/styles/dark.css +42 -0
- package/dist/styles/light.css +44 -0
- package/dist/utilities/Dialog.d.ts +2 -2
- package/dist/utilities/Dialog.js +3 -3
- package/dist/utilities/Locale.d.ts +2 -2
- package/dist/utilities/Locale.js +2 -2
- package/dist/utilities/Toast.d.ts +2 -2
- package/dist/utilities/Toast.js +1 -1
- package/dist/utilities/format.d.ts +32 -4
- package/dist/utilities/format.js +131 -15
- package/dist/utilities/icons.d.ts +12 -3
- package/dist/utilities/icons.js +24 -6
- package/package.json +1 -1
- package/skills/iyulab-components/SKILL.md +3 -3
- package/skills/iyulab-components/references/components/alert.md +5 -5
- package/skills/iyulab-components/references/components/badge.md +3 -3
- package/skills/iyulab-components/references/components/button-group.md +3 -3
- package/skills/iyulab-components/references/components/button.md +34 -19
- package/skills/iyulab-components/references/components/card.md +3 -3
- package/skills/iyulab-components/references/components/carousel.md +3 -1
- package/skills/iyulab-components/references/components/checkbox.md +5 -5
- package/skills/iyulab-components/references/components/chip.md +2 -2
- package/skills/iyulab-components/references/components/copy-button.md +1 -1
- package/skills/iyulab-components/references/components/date-picker.md +35 -2
- package/skills/iyulab-components/references/components/date-range-picker.md +53 -5
- package/skills/iyulab-components/references/components/dialog.md +2 -2
- package/skills/iyulab-components/references/components/divider.md +2 -2
- package/skills/iyulab-components/references/components/drawer.md +1 -1
- package/skills/iyulab-components/references/components/field.md +1 -1
- package/skills/iyulab-components/references/components/icon-button.md +8 -2
- package/skills/iyulab-components/references/components/input.md +4 -2
- package/skills/iyulab-components/references/components/menu.md +1 -1
- package/skills/iyulab-components/references/components/radio.md +16 -4
- package/skills/iyulab-components/references/components/select.md +2 -1
- package/skills/iyulab-components/references/components/steps.md +66 -0
- package/skills/iyulab-components/references/components/tab-panel.md +10 -3
- package/skills/iyulab-components/references/components/tag.md +11 -7
- package/skills/iyulab-components/references/components/textarea.md +2 -1
- package/skills/iyulab-components/references/usage.md +1 -1
- package/skills/iyulab-components/references/utilities/dialog.md +2 -2
- package/skills/iyulab-components/references/utilities/icons.md +2 -2
- package/skills/iyulab-components/references/utilities/locale.md +1 -1
- package/skills/iyulab-components/references/utilities/theme.md +9 -5
- package/skills/iyulab-components/references/utilities/toast.md +2 -2
|
@@ -39,8 +39,8 @@ Interactive chip tag. Supports selectable toggle, removable button, and tooltip.
|
|
|
39
39
|
|
|
40
40
|
| Property | Type | Default | Reflect | Description |
|
|
41
41
|
|----------|------|---------|---------|-------------|
|
|
42
|
-
| `
|
|
43
|
-
| `color` | `'neutral'\|'blue'\|'green'\|'yellow'\|'red'\|'orange'\|'teal'\|'cyan'\|'purple'\|'pink'` | `'neutral'` | ✓ | Color |
|
|
42
|
+
| `appearance` | `'solid'\|'soft'\|'outlined'\|'plain'` | `'soft'` | ✓ | How much chrome (same as [`u-tag`](./tag.md)) |
|
|
43
|
+
| `color` | `'neutral'\|'primary'\|'info'\|'success'\|'warning'\|'danger'\|'blue'\|'green'\|'yellow'\|'red'\|'orange'\|'teal'\|'cyan'\|'purple'\|'pink'` | `'neutral'` | ✓ | Color — `neutral` (the default) is grey; `primary` is the brand colour |
|
|
44
44
|
| `rounded` | `boolean` | `false` | ✓ | Pill-shaped |
|
|
45
45
|
| `removable` | `boolean` | `false` | ✓ | Show remove button |
|
|
46
46
|
| `selectable` | `boolean` | `false` | ✓ | Can be toggled selected |
|
|
@@ -49,7 +49,7 @@ button.addEventListener('copy', (e: ClipboardEvent) => {
|
|
|
49
49
|
|
|
50
50
|
| Property | Type | Default | Reflect | Description |
|
|
51
51
|
|----------|------|---------|---------|-------------|
|
|
52
|
-
| `
|
|
52
|
+
| `appearance` | `'solid'\|'soft'\|'outlined'\|'plain'\|'link'` | `'plain'` | ✓ | Button appearance (see [`u-button`](./button.md)) |
|
|
53
53
|
| `rounded` | `boolean` | `false` | ✓ | Circular shape |
|
|
54
54
|
| `disabled` | `boolean` | `false` | ✓ | Disabled state |
|
|
55
55
|
| `copied` | `boolean` | `false` | ✓ | Currently showing the copied state |
|
|
@@ -22,7 +22,9 @@ field opens the calendar and keeps the caret in the text box; ArrowDown (or Alt+
|
|
|
22
22
|
into the calendar. Text that is not a date clears the value and reports `badInput` (the text stays
|
|
23
23
|
so it can be fixed); a date outside `min`/`max` is kept and reported as out of range.
|
|
24
24
|
In `mode="datetime"` the text box takes a time after the date (`2026-10-02 14:30`, `9:05`, seconds
|
|
25
|
-
dropped) and shows `YYYY-MM-DD HH:mm`; typing only a date keeps the time
|
|
25
|
+
dropped unless `seconds` is set) and shows `YYYY-MM-DD HH:mm`; typing only a date keeps the time
|
|
26
|
+
already set. 12-hour times are read too — `3:00 PM`, `3:00pm`, `p.m. 3:00`, `오후 3:00`, `午後3:00`,
|
|
27
|
+
`下午 3:00` (`12 AM` is midnight) — and shown in 24-hour form; the value is the same either way.
|
|
26
28
|
The parser and formatter are exported as `parseDate`, `parseDateTime`, `formatDateText`,
|
|
27
29
|
`formatDateTimeText` and `dateTextPattern`.
|
|
28
30
|
|
|
@@ -32,6 +34,30 @@ in `mode="datetime"` this also sets the time to right now — disabled when toda
|
|
|
32
34
|
day preserves whatever time-of-day was already set; only the "Today" button overrides the time.
|
|
33
35
|
`min`/`max` are always date-only, even in `mode="datetime"` — time-of-day is never range-checked.
|
|
34
36
|
|
|
37
|
+
### Disabled days
|
|
38
|
+
|
|
39
|
+
`min`/`max` bound the calendar; `isDateDisabled` removes days inside it — weekends, holidays, fully
|
|
40
|
+
booked days. It receives the ISO day and returns `true` to disable it. A disabled day is drawn with
|
|
41
|
+
`aria-disabled="true"` and cannot be picked (nor can "Today" when today is disabled). A typed or
|
|
42
|
+
assigned value on a disabled day reports `stepMismatch` ("This date is not available") — the native
|
|
43
|
+
date input reports the same flag for a readable day its `step` does not allow.
|
|
44
|
+
|
|
45
|
+
```js
|
|
46
|
+
const holidays = new Set(['2026-10-03', '2026-10-09']);
|
|
47
|
+
picker.isDateDisabled = (date) => {
|
|
48
|
+
const day = new Date(`${date}T00:00`).getDay();
|
|
49
|
+
return day === 0 || day === 6 || holidays.has(date);
|
|
50
|
+
};
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### Apply to confirm
|
|
54
|
+
|
|
55
|
+
With `confirm`, choosing in the calendar does not change the value yet: a day, the time, "Today"
|
|
56
|
+
and "Clear value" only stage the choice, shown in the calendar, and the footer adds **Cancel** and
|
|
57
|
+
**Apply**. Apply commits the staged choice (empty if "Clear value" was chosen), fires `change` once
|
|
58
|
+
and closes; Cancel, Escape or closing the calendar any other way drops it, and the next opening
|
|
59
|
+
starts from the value. Typing in the text box still commits on Enter or leaving the field.
|
|
60
|
+
|
|
35
61
|
```html
|
|
36
62
|
<u-date-picker name="start-date" label="Start date"></u-date-picker>
|
|
37
63
|
|
|
@@ -40,6 +66,9 @@ day preserves whatever time-of-day was already set; only the "Today" button over
|
|
|
40
66
|
|
|
41
67
|
<!-- Date + time, value is a full ISO-8601 DateTimeOffset string -->
|
|
42
68
|
<u-date-picker name="sent-at" label="Sent at" mode="datetime"></u-date-picker>
|
|
69
|
+
|
|
70
|
+
<!-- Day and time are applied together -->
|
|
71
|
+
<u-date-picker name="due-at" label="Due at" mode="datetime" confirm></u-date-picker>
|
|
43
72
|
```
|
|
44
73
|
|
|
45
74
|
---
|
|
@@ -52,9 +81,13 @@ day preserves whatever time-of-day was already set; only the "Today" button over
|
|
|
52
81
|
| `value` | `string` | — | — | Selected date (ISO `YYYY-MM-DD`), or full ISO-8601 datetime in `mode="datetime"` |
|
|
53
82
|
| `min` | `string` | — | — | Minimum selectable date (ISO `YYYY-MM-DD`, date-only in both modes) |
|
|
54
83
|
| `max` | `string` | — | — | Maximum selectable date (ISO `YYYY-MM-DD`, date-only in both modes) |
|
|
84
|
+
| `size` | `'sm'\|'md'\|'lg'` | `'md'` | ✓ | Field size, like a button's: 12px · `--u-density` (14px) · 16px. A field and a button of the same size share a height |
|
|
55
85
|
| `clearable` | `boolean` | `false` | ✓ | Show clear button |
|
|
86
|
+
| `isDateDisabled` | `(date: string) => boolean` | — | — | App rule for days that cannot be chosen (ISO in, `true` = disabled). Property only; see «Disabled days» |
|
|
56
87
|
| `placeholder` | `string` | — | — | Placeholder text (defaults to the pattern to type, e.g. `YYYY-MM-DD` or `YYYY-MM-DD HH:mm`) |
|
|
57
88
|
| `format` | `'iso' \| 'locale'` | `'iso'` | ✓ | How the text box writes and reads the date part |
|
|
89
|
+
| `confirm` | `boolean` | `false` | ✓ | Calendar picks wait for an Apply button (see «Apply to confirm») |
|
|
90
|
+
| `seconds` | `boolean` | `false` | ✓ | `mode="datetime"`: enter the time to the second (`HH:mm:ss` in the text box, seconds in the time input). The value carries seconds either way |
|
|
58
91
|
| `disabled` | `boolean` | `false` | ✓ | Disable |
|
|
59
92
|
| `readonly` | `boolean` | `false` | ✓ | Read-only |
|
|
60
93
|
| `required` | `boolean` | `false` | ✓ | Required |
|
|
@@ -68,7 +101,7 @@ day preserves whatever time-of-day was already set; only the "Today" button over
|
|
|
68
101
|
|
|
69
102
|
| Event | Description |
|
|
70
103
|
|-------|-------------|
|
|
71
|
-
| `change` | Fires when the user clicks a date cell, confirms via keyboard, commits typed text (Enter or leaving the field, when the value changes), changes the time input (`mode="datetime"`, once a date is set), or clicks the clear button. Programmatic value assignment does not fire it. |
|
|
104
|
+
| `change` | Fires when the user clicks a date cell, confirms via keyboard, commits typed text (Enter or leaving the field, when the value changes), changes the time input (`mode="datetime"`, once a date is set), or clicks the clear button — with `confirm`, calendar picks fire it only when Apply commits a different value. Programmatic value assignment does not fire it. |
|
|
72
105
|
|
|
73
106
|
## Methods
|
|
74
107
|
|
|
@@ -41,6 +41,46 @@ exported as `parseDateRange` and `formatDateRangeText`.
|
|
|
41
41
|
min="2026-01-01" max="2026-12-31" value="2026-03-01/2026-03-31"></u-date-range-picker>
|
|
42
42
|
```
|
|
43
43
|
|
|
44
|
+
### Date and time (`mode="datetime"`)
|
|
45
|
+
|
|
46
|
+
`mode="datetime"` adds a start time and an end time under the calendar (labelled inputs). Each half of
|
|
47
|
+
the value is then a complete ISO-8601 `DateTimeOffset` — seconds and the browser's local offset are
|
|
48
|
+
always filled in — and `start`/`end` return those halves:
|
|
49
|
+
|
|
50
|
+
```html
|
|
51
|
+
<u-date-range-picker name="shift" label="Shift" mode="datetime"
|
|
52
|
+
value="2026-10-01T09:00:00+09:00/2026-10-01T18:00:00+09:00"></u-date-range-picker>
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
The first range picked covers its days whole (00:00 to 23:59), as do presets; after that, picking
|
|
56
|
+
other days keeps the times already set. Changing a time updates that end at once (the calendar stays
|
|
57
|
+
open); a start time set after the end on the same day swaps the two. The text box reads
|
|
58
|
+
`2026-10-01 09:00 ~ 2026-10-31 18:00` and `2026-10-01 09:00 ~ 18:00` (a time alone ends on the first
|
|
59
|
+
day); a day typed without a time keeps that end's time. 12-hour times are read as well
|
|
60
|
+
(`2026-10-01 오전 9:00 ~ 오후 6:00`, `9:00 AM ~ 6:00 PM`) and shown in 24-hour form. `min`/`max` and `isDateDisabled` stay
|
|
61
|
+
date-only. The reader and writer are exported as `parseDateTimeRange` and `formatDateTimeRangeText`.
|
|
62
|
+
Add `seconds` to enter times to the second: the inputs and the text box show `HH:mm:ss`, and a whole
|
|
63
|
+
day runs from `00:00:00` to `23:59:59`.
|
|
64
|
+
|
|
65
|
+
### Disabled days
|
|
66
|
+
|
|
67
|
+
`isDateDisabled` receives an ISO day and returns `true` to disable it. A disabled day cannot start or
|
|
68
|
+
end a range, but a range may run across it — a working week still spans the weekend between. A preset
|
|
69
|
+
whose range starts or ends on a disabled day is disabled. A typed or assigned range that starts or ends
|
|
70
|
+
on one reports `stepMismatch` ("This date is not available").
|
|
71
|
+
|
|
72
|
+
### Apply to confirm
|
|
73
|
+
|
|
74
|
+
With `confirm`, choosing in the calendar does not change the value yet: a completed range, a preset
|
|
75
|
+
and "Clear value" only stage the choice, shown in the calendar, and the footer adds **Cancel** and
|
|
76
|
+
**Apply**. Apply commits the staged choice (empty if "Clear value" was chosen), fires `change` once
|
|
77
|
+
and closes; Cancel, Escape or closing the calendar any other way drops it, and the next opening
|
|
78
|
+
starts from the value. Typing in the text box still commits on Enter or leaving the field.
|
|
79
|
+
|
|
80
|
+
```html
|
|
81
|
+
<u-date-range-picker name="period" label="Period" presets="last7Days thisMonth" confirm></u-date-range-picker>
|
|
82
|
+
```
|
|
83
|
+
|
|
44
84
|
### Quick ranges (presets)
|
|
45
85
|
|
|
46
86
|
`presets` lists quick ranges beside the calendar (above it on a narrow screen), in the order given.
|
|
@@ -91,14 +131,19 @@ picker.addEventListener('change', () => {
|
|
|
91
131
|
|
|
92
132
|
| Property | Type | Default | Reflect | Description |
|
|
93
133
|
|----------|------|---------|---------|-------------|
|
|
94
|
-
| `
|
|
95
|
-
| `
|
|
96
|
-
| `
|
|
134
|
+
| `mode` | `'date' \| 'datetime'` | `'date'` | ✓ | `datetime` adds start and end times; each half becomes an ISO-8601 `DateTimeOffset` |
|
|
135
|
+
| `value` | `string` | — | — | The range as `YYYY-MM-DD/YYYY-MM-DD` (start first), or two `DateTimeOffset`s in `mode="datetime"` |
|
|
136
|
+
| `start` | `string` (read-only) | — | — | Start of the range (ISO day, or date-time in `mode="datetime"`), `undefined` without a complete range |
|
|
137
|
+
| `end` | `string` (read-only) | — | — | End of the range (ISO day, or date-time in `mode="datetime"`), `undefined` without a complete range |
|
|
97
138
|
| `min` | `string` | — | — | Earliest selectable day (ISO `YYYY-MM-DD`), inclusive |
|
|
98
139
|
| `max` | `string` | — | — | Latest selectable day (ISO `YYYY-MM-DD`), inclusive |
|
|
140
|
+
| `size` | `'sm'\|'md'\|'lg'` | `'md'` | ✓ | Field size, like a button's: 12px · `--u-density` (14px) · 16px. A field and a button of the same size share a height |
|
|
99
141
|
| `clearable` | `boolean` | `false` | ✓ | Show clear button |
|
|
142
|
+
| `isDateDisabled` | `(date: string) => boolean` | — | — | App rule for days that cannot start or end a range (ISO in, `true` = disabled). Property only; see «Disabled days» |
|
|
100
143
|
| `placeholder` | `string` | — | — | Placeholder text (defaults to the pattern to type) |
|
|
101
144
|
| `format` | `'iso' \| 'locale'` | `'iso'` | ✓ | How the text box writes and reads each day |
|
|
145
|
+
| `confirm` | `boolean` | `false` | ✓ | Calendar picks wait for an Apply button (see «Apply to confirm») |
|
|
146
|
+
| `seconds` | `boolean` | `false` | ✓ | `mode="datetime"`: enter times to the second; a whole day ends at `23:59:59` |
|
|
102
147
|
| `presets` | `Array<DateRangePresetName \| DateRangePreset>` | `[]` | — | Quick ranges beside the calendar; attribute form is space-separated built-in names |
|
|
103
148
|
| `disabled` | `boolean` | `false` | ✓ | Disable |
|
|
104
149
|
| `readonly` | `boolean` | `false` | ✓ | Read-only |
|
|
@@ -110,13 +155,14 @@ picker.addEventListener('change', () => {
|
|
|
110
155
|
| `validationMessage` | `string` | — | — | Custom validation message |
|
|
111
156
|
|
|
112
157
|
Validation: `required` with no value → `valueMissing`; a value that is not two ISO days joined by `/`
|
|
113
|
-
→ `badInput`; start before `min` → `rangeUnderflow`; end after `max` → `rangeOverflow
|
|
158
|
+
→ `badInput`; start before `min` → `rangeUnderflow`; end after `max` → `rangeOverflow`; start or end on a day
|
|
159
|
+
`isDateDisabled` refuses → `stepMismatch`.
|
|
114
160
|
|
|
115
161
|
## Events
|
|
116
162
|
|
|
117
163
|
| Event | Description |
|
|
118
164
|
|-------|-------------|
|
|
119
|
-
| `change` | Fires when the user completes a range or clears it. Programmatic value assignment does not fire it. |
|
|
165
|
+
| `change` | Fires when the user completes a range or clears it (with `confirm`, when Apply commits a different value). Programmatic value assignment does not fire it. |
|
|
120
166
|
|
|
121
167
|
## Methods
|
|
122
168
|
|
|
@@ -143,6 +189,8 @@ Validation: `required` with no value → `valueMissing`; a value that is not two
|
|
|
143
189
|
| `calendar-grid` | A date grid |
|
|
144
190
|
| `calendar-week` | One week row inside a date grid |
|
|
145
191
|
| `day` | A date cell button |
|
|
192
|
+
| `calendar-time` | The row holding the start and end time inputs (`mode="datetime"` only) |
|
|
193
|
+
| `time-input` | A time-of-day input (`mode="datetime"` only) |
|
|
146
194
|
| `calendar-footer` | The row holding the "Clear" quick action |
|
|
147
195
|
| `presets` | The list of quick ranges beside the calendar |
|
|
148
196
|
| `preset` | One quick-range button |
|
|
@@ -15,8 +15,8 @@ For programmatic usage (`Dialog.alert`, `Dialog.confirm`, `Dialog.prompt`), see
|
|
|
15
15
|
<span slot="header">Confirm Action</span>
|
|
16
16
|
<p>Are you sure you want to delete this item?</p>
|
|
17
17
|
<div slot="footer">
|
|
18
|
-
<u-button
|
|
19
|
-
<u-button
|
|
18
|
+
<u-button appearance="plain" @click=${() => dlg.hide()}>Cancel</u-button>
|
|
19
|
+
<u-button appearance="solid" @click=${handleConfirm}>Delete</u-button>
|
|
20
20
|
</div>
|
|
21
21
|
</u-dialog>
|
|
22
22
|
|
|
@@ -13,7 +13,7 @@ Horizontal or vertical separator line. Slot content is overlaid as an inline lab
|
|
|
13
13
|
|
|
14
14
|
<u-divider>OR</u-divider>
|
|
15
15
|
|
|
16
|
-
<u-divider
|
|
16
|
+
<u-divider line="dashed" align="start">Section</u-divider>
|
|
17
17
|
|
|
18
18
|
<!-- Vertical -->
|
|
19
19
|
<div style="display:flex; height:40px;">
|
|
@@ -36,7 +36,7 @@ Horizontal or vertical separator line. Slot content is overlaid as an inline lab
|
|
|
36
36
|
| Property | Type | Default | Reflect | Description |
|
|
37
37
|
|----------|------|---------|---------|-------------|
|
|
38
38
|
| `vertical` | `boolean` | `false` | ✓ | Vertical orientation |
|
|
39
|
-
| `
|
|
39
|
+
| `line` | `'solid'\|'dashed'\|'dotted'` | `'solid'` | ✓ | Line style |
|
|
40
40
|
| `align` | `'start'\|'center'\|'end'` | `'center'` | ✓ | Label alignment |
|
|
41
41
|
|
|
42
42
|
## CSS Parts
|
|
@@ -84,7 +84,7 @@ whole contract. Measured in a real browser
|
|
|
84
84
|
<u-textarea label="Note"></u-textarea>
|
|
85
85
|
|
|
86
86
|
<div slot="footer">
|
|
87
|
-
<u-button
|
|
87
|
+
<u-button appearance="plain" @click=${() => edit.hide()}>Cancel</u-button>
|
|
88
88
|
<u-button color="primary" @click=${save}>Save</u-button>
|
|
89
89
|
</div>
|
|
90
90
|
</u-drawer>
|
|
@@ -17,7 +17,7 @@ Layout wrapper for form controls. Renders label, required marker, description te
|
|
|
17
17
|
<u-select name="role">
|
|
18
18
|
<u-option value="admin">Admin</u-option>
|
|
19
19
|
</u-select>
|
|
20
|
-
<u-button slot="label-aside"
|
|
20
|
+
<u-button slot="label-aside" appearance="link">Learn more</u-button>
|
|
21
21
|
</u-field>
|
|
22
22
|
```
|
|
23
23
|
|
|
@@ -13,7 +13,7 @@ Square icon-only button with a built-in tooltip (shown from the default slot). R
|
|
|
13
13
|
Delete
|
|
14
14
|
</u-icon-button>
|
|
15
15
|
|
|
16
|
-
<u-icon-button
|
|
16
|
+
<u-icon-button appearance="outlined" rounded lib="heroicons" name="plus:solid">
|
|
17
17
|
Add item
|
|
18
18
|
</u-icon-button>
|
|
19
19
|
|
|
@@ -34,7 +34,7 @@ Square icon-only button with a built-in tooltip (shown from the default slot). R
|
|
|
34
34
|
|
|
35
35
|
| Property | Type | Default | Reflect | Description |
|
|
36
36
|
|----------|------|---------|---------|-------------|
|
|
37
|
-
| `
|
|
37
|
+
| `appearance` | `'solid'\|'soft'\|'outlined'\|'plain'\|'link'` | `'plain'` | ✓ | Button appearance (see [`u-button`](./button.md)) |
|
|
38
38
|
| `rounded` | `boolean` | `false` | ✓ | Circular shape |
|
|
39
39
|
| `disabled` | `boolean` | `false` | ✓ | Disable the button |
|
|
40
40
|
| `loading` | `boolean` | `false` | ✓ | Loading state |
|
|
@@ -47,6 +47,12 @@ Square icon-only button with a built-in tooltip (shown from the default slot). R
|
|
|
47
47
|
| `tooltipPlacement` | `Placement` | `'top'` | — | Tooltip position |
|
|
48
48
|
| `tooltipOffset` | `OffsetOptions` | `4` | — | Tooltip offset from button |
|
|
49
49
|
|
|
50
|
+
## Accessibility
|
|
51
|
+
|
|
52
|
+
Give every icon button an `aria-label` — the icon has no text. `aria-label` and the button states
|
|
53
|
+
(`aria-pressed`, `aria-expanded`, `aria-controls`, `aria-haspopup`) set on the host reach the
|
|
54
|
+
inner button, as on `u-button`.
|
|
55
|
+
|
|
50
56
|
## CSS Parts
|
|
51
57
|
|
|
52
58
|
| Part | Description |
|
|
@@ -54,7 +54,8 @@ the library does not infer one from field meaning.
|
|
|
54
54
|
|
|
55
55
|
| Property | Type | Default | Reflect | Description |
|
|
56
56
|
|----------|------|---------|---------|-------------|
|
|
57
|
-
| `
|
|
57
|
+
| `appearance` | `'outlined'\|'soft'\|'underlined'\|'plain'` | `'outlined'` | ✓ | How much chrome: `outlined` · `soft` tinted face · `underlined` bottom line only · `plain` no chrome |
|
|
58
|
+
| `size` | `'sm'\|'md'\|'lg'` | `'md'` | ✓ | Field size, like a button's: 12px · `--u-density` (14px) · 16px. A field and a button of the same size share a height |
|
|
58
59
|
| `type` | `'text'\|'password'\|'email'\|'tel'\|'url'\|'search'\|'number'\|'date'\|'time'`… | `'text'` | — | Input type |
|
|
59
60
|
| `placeholder` | `string` | — | — | Placeholder text |
|
|
60
61
|
| `clearable` | `boolean` | `false` | ✓ | Show clear button |
|
|
@@ -72,7 +73,6 @@ the library does not infer one from field meaning.
|
|
|
72
73
|
| `enterkeyhint` | `'enter'\|'done'\|'go'\|'next'\|'previous'\|'search'\|'send'` | — | — | Enter-key label hint |
|
|
73
74
|
| `autocorrect` | `boolean` | `false` | — | Native autocorrect (Safari/iOS) |
|
|
74
75
|
| `autocapitalize` | `'off'\|'none'\|'on'\|'sentences'\|'words'\|'characters'` | `'off'` | — | Auto-capitalization behavior |
|
|
75
|
-
| `size` | `number` | — | — | Native `size` — visible width in characters |
|
|
76
76
|
| `disabled` | `boolean` | `false` | ✓ | Disabled |
|
|
77
77
|
| `readonly` | `boolean` | `false` | ✓ | Read-only |
|
|
78
78
|
| `required` | `boolean` | `false` | ✓ | Required |
|
|
@@ -130,6 +130,8 @@ Call `preventDefault()` on the `keydown` to cancel it. Do not also submit on Ent
|
|
|
130
130
|
|
|
131
131
|
| Property | Description |
|
|
132
132
|
|----------|-------------|
|
|
133
|
+
| `--u-input-display` | Host `display` (default `inline-block`); set `block` to fill a form or grid cell |
|
|
134
|
+
| `--u-input-width` | Host `width` (default `auto`); set `100%` where `block` alone does not stretch, such as in a flex container |
|
|
133
135
|
| `--input-popover-width` | Combobox popover width (fixed to anchor width by default) |
|
|
134
136
|
| `--input-popover-min-height` | Combobox popover min-height |
|
|
135
137
|
| `--input-popover-max-height` | Combobox popover max-height |
|
|
@@ -45,7 +45,7 @@ Keyboard-navigable menu. Supports single/multiple selection, highlight or checkm
|
|
|
45
45
|
| `align` | `'left'\|'center'\|'right'` | `'left'` | ✓ | Item text alignment |
|
|
46
46
|
| `loop` | `boolean` | `false` | ✓ | Keyboard navigation wraps around |
|
|
47
47
|
| `inline` | `boolean` | `false` | ✓ | Horizontal layout |
|
|
48
|
-
| `
|
|
48
|
+
| `appearance` | `'outlined'\|'plain'` | `'outlined'` | ✓ | `outlined` bordered box · `plain` no border and no padding |
|
|
49
49
|
|
|
50
50
|
### Events
|
|
51
51
|
|
|
@@ -17,11 +17,17 @@ Radio group built from `u-option` children. Form-associated.
|
|
|
17
17
|
</u-radio>
|
|
18
18
|
|
|
19
19
|
<!-- Button style, horizontal -->
|
|
20
|
-
<u-radio name="plan" type="button" orientation="horizontal"
|
|
20
|
+
<u-radio name="plan" type="button" orientation="horizontal" appearance="outlined">
|
|
21
21
|
<u-option value="free">Free</u-option>
|
|
22
22
|
<u-option value="pro">Pro</u-option>
|
|
23
23
|
<u-option value="enterprise">Enterprise</u-option>
|
|
24
24
|
</u-radio>
|
|
25
|
+
|
|
26
|
+
<!-- Segmented control -->
|
|
27
|
+
<u-radio name="view" type="button" orientation="horizontal" appearance="soft" value="list">
|
|
28
|
+
<u-option value="list">List</u-option>
|
|
29
|
+
<u-option value="board">Board</u-option>
|
|
30
|
+
</u-radio>
|
|
25
31
|
```
|
|
26
32
|
|
|
27
33
|
---
|
|
@@ -38,7 +44,7 @@ Radio group built from `u-option` children. Form-associated.
|
|
|
38
44
|
|----------|------|---------|---------|-------------|
|
|
39
45
|
| `value` | `string` | — | — | Currently selected value |
|
|
40
46
|
| `type` | `'default'\|'button'` | `'default'` | ✓ | `button` renders options as toggle buttons |
|
|
41
|
-
| `
|
|
47
|
+
| `appearance` | `'solid'\|'outlined'\|'soft'` | `'solid'` | ✓ | `solid` fills the picked option · `outlined` · `soft` (`type="button"` only) a segmented control — a quiet track where the picked segment rises onto the surface |
|
|
42
48
|
| `orientation` | `'vertical'\|'horizontal'` | `'vertical'` | ✓ | Layout direction |
|
|
43
49
|
| `disabled` | `boolean` | `false` | ✓ | Disable all options |
|
|
44
50
|
| `readonly` | `boolean` | `false` | ✓ | Read-only |
|
|
@@ -50,7 +56,7 @@ Radio group built from `u-option` children. Form-associated.
|
|
|
50
56
|
|
|
51
57
|
| Event | Description |
|
|
52
58
|
|-------|-------------|
|
|
53
|
-
| `change` | Fires when
|
|
59
|
+
| `change` | Fires when the user changes the selection — click, Space/Enter, or an arrow key |
|
|
54
60
|
|
|
55
61
|
## Methods
|
|
56
62
|
|
|
@@ -58,9 +64,15 @@ Radio group built from `u-option` children. Form-associated.
|
|
|
58
64
|
|--------|-------------|
|
|
59
65
|
| `validate()` | Validate; sets `invalid` |
|
|
60
66
|
| `reset()` | Reset selection |
|
|
61
|
-
| `focus(options?)` | Focus the
|
|
67
|
+
| `focus(options?)` | Focus the group's tab stop — the selected option, or the first enabled one |
|
|
62
68
|
| `blur()` | Blur the currently focused option, if any |
|
|
63
69
|
|
|
70
|
+
## Keyboard
|
|
71
|
+
|
|
72
|
+
The group is one tab stop (the selected option, or the first enabled one). Arrow keys move focus
|
|
73
|
+
**and** selection together, wrapping at the ends; Home/End jump to the first/last option — the
|
|
74
|
+
native radio group and WAI-ARIA APG behaviour.
|
|
75
|
+
|
|
64
76
|
## CSS Parts
|
|
65
77
|
|
|
66
78
|
| Part | Description |
|
|
@@ -37,7 +37,8 @@ Dropdown select with single or multiple selection, search, and clear support. Fo
|
|
|
37
37
|
| Property | Type | Default | Reflect | Description |
|
|
38
38
|
|----------|------|---------|---------|-------------|
|
|
39
39
|
| `value` | `string \| string[]` | — | — | Selected value(s) |
|
|
40
|
-
| `
|
|
40
|
+
| `appearance` | `'outlined'\|'soft'\|'underlined'\|'plain'` | `'outlined'` | ✓ | How much chrome: `outlined` · `soft` tinted face · `underlined` bottom line only · `plain` no chrome |
|
|
41
|
+
| `size` | `'sm'\|'md'\|'lg'` | `'md'` | ✓ | Field size, like a button's: 12px · `--u-density` (14px) · 16px. A field and a button of the same size share a height |
|
|
41
42
|
| `multiple` | `boolean` | `false` | ✓ | Allow multiple selections |
|
|
42
43
|
| `searchable` | `boolean` | `false` | ✓ | Filter options by text |
|
|
43
44
|
| `clearable` | `boolean` | `false` | ✓ | Show clear button |
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# u-steps
|
|
2
|
+
|
|
3
|
+
```ts
|
|
4
|
+
import '@iyulab/components/dist/components/steps/USteps.js';
|
|
5
|
+
```
|
|
6
|
+
|
|
7
|
+
**Tag:** `u-steps`
|
|
8
|
+
|
|
9
|
+
A display-only progress line — where a record stands in a fixed sequence of steps. Not a wizard:
|
|
10
|
+
moving to the next step is the consumer's own action, placed beside it. For several tracks
|
|
11
|
+
(fulfilment and billing, say), stack one `u-steps` per track and give each a `label`.
|
|
12
|
+
|
|
13
|
+
```html
|
|
14
|
+
<u-steps id="fulfilment" label="Fulfilment" current="1"></u-steps>
|
|
15
|
+
<script type="module">
|
|
16
|
+
document.getElementById('fulfilment').items = [
|
|
17
|
+
{ label: 'Received', description: '10.02' },
|
|
18
|
+
{ label: 'Proof' },
|
|
19
|
+
{ label: 'Print' },
|
|
20
|
+
{ label: 'Ship' },
|
|
21
|
+
];
|
|
22
|
+
</script>
|
|
23
|
+
|
|
24
|
+
<!-- a blocked step -->
|
|
25
|
+
<u-steps label="Billing" .items=${[{ label: 'Invoice' }, { label: 'Paid', status: 'hold' }, { label: 'Closed' }]}></u-steps>
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Status is told by marker shape as well as colour — complete = check, current = heavy ring,
|
|
29
|
+
hold = warning tint, upcoming = empty ring. Assistive tech hears the current step through
|
|
30
|
+
`aria-current="step"` and complete/hold through a hidden status word (`stepComplete`,
|
|
31
|
+
`stepOnHold` locale keys).
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## Properties
|
|
36
|
+
|
|
37
|
+
| Property | Type | Default | Reflect | Description |
|
|
38
|
+
|----------|------|---------|---------|-------------|
|
|
39
|
+
| `items` | `StepItem[]` | `[]` | — | `{ label, description?, status? }` (property only) |
|
|
40
|
+
| `current` | `number` | — | — | Index of the current step; steps without `status` before it are `complete`, after it `upcoming` |
|
|
41
|
+
| `label` | `string` | — | — | Track name shown at the start; also the list's accessible name |
|
|
42
|
+
|
|
43
|
+
`StepStatus` = `'complete' | 'current' | 'hold' | 'upcoming'`. An item's own `status` wins over
|
|
44
|
+
the inference from `current`.
|
|
45
|
+
|
|
46
|
+
## CSS Parts
|
|
47
|
+
|
|
48
|
+
| Part | Description |
|
|
49
|
+
|------|-------------|
|
|
50
|
+
| `base` | Outer box |
|
|
51
|
+
| `label` | Track name |
|
|
52
|
+
| `list` | The `ol` |
|
|
53
|
+
| `step` | One step — also `step-complete`, `step-current`, `step-hold`, `step-upcoming` |
|
|
54
|
+
| `marker` | Ring / check |
|
|
55
|
+
| `title` | Step name |
|
|
56
|
+
| `description` | Step's secondary text |
|
|
57
|
+
| `connector` | Line between steps |
|
|
58
|
+
|
|
59
|
+
## CSS Custom Properties
|
|
60
|
+
|
|
61
|
+
| Property | Description |
|
|
62
|
+
|----------|-------------|
|
|
63
|
+
| `--steps-marker-size` | Marker diameter (default 18px) |
|
|
64
|
+
| `--steps-connector-color` | Connector not yet travelled |
|
|
65
|
+
| `--steps-connector-done-color` | Travelled connector and complete marker |
|
|
66
|
+
| `--steps-label-width` | Width of the track name (default 56px) |
|
|
@@ -21,8 +21,8 @@ Tab-based content switcher. Pair each `u-tab` with a `u-panel` of the same `valu
|
|
|
21
21
|
<u-panel value="settings">Settings content</u-panel>
|
|
22
22
|
</u-tab-panel>
|
|
23
23
|
|
|
24
|
-
<!-- Card
|
|
25
|
-
<u-tab-panel
|
|
24
|
+
<!-- Card appearance, left placement -->
|
|
25
|
+
<u-tab-panel appearance="card" placement="left">
|
|
26
26
|
<u-tab value="a" removable>Tab A</u-tab>
|
|
27
27
|
<u-panel value="a">Panel A</u-panel>
|
|
28
28
|
</u-tab-panel>
|
|
@@ -62,7 +62,7 @@ out of the component.
|
|
|
62
62
|
| Property | Type | Default | Reflect | Description |
|
|
63
63
|
|----------|------|---------|---------|-------------|
|
|
64
64
|
| `value` | `string` | `''` | ✓ | Currently active tab value |
|
|
65
|
-
| `
|
|
65
|
+
| `appearance` | `'line'\|'card'\|'pill'\|'plain'` | `'line'` | ✓ | Tab bar style |
|
|
66
66
|
| `placement` | `'top'\|'bottom'\|'left'\|'right'` | `'top'` | ✓ | Tab bar position |
|
|
67
67
|
| `draggable` | `boolean` | `false` | ✓ | Native drag attribute — **no built-in reordering** |
|
|
68
68
|
| `disabled` | `boolean` | `false` | ✓ | Disable all tabs |
|
|
@@ -73,6 +73,13 @@ out of the component.
|
|
|
73
73
|
|-------|-------------|
|
|
74
74
|
| `change` | Fires on user-driven tab changes (click/keyboard). Not emitted for initial mount or direct `value` assignment. |
|
|
75
75
|
|
|
76
|
+
### Accessibility
|
|
77
|
+
|
|
78
|
+
The panel wires the WAI-ARIA tabs pattern itself: each tab carries `aria-selected`, only the
|
|
79
|
+
selected tab is a tab stop (arrow keys, Home and End move between tabs and select them), each
|
|
80
|
+
`u-panel` becomes a `tabpanel`, and a tab and its panel (same `value`) point at each other with
|
|
81
|
+
`aria-controls` / `aria-labelledby`. Ids are generated when missing; ids you set are kept.
|
|
82
|
+
|
|
76
83
|
### CSS Parts
|
|
77
84
|
|
|
78
85
|
| Part | Description |
|
|
@@ -10,8 +10,9 @@ Non-interactive label tag for categories, status, or metadata display.
|
|
|
10
10
|
|
|
11
11
|
```html
|
|
12
12
|
<u-tag>Default</u-tag>
|
|
13
|
-
<u-tag color="blue"
|
|
13
|
+
<u-tag color="blue" appearance="outlined">TypeScript</u-tag>
|
|
14
14
|
<u-tag color="green" rounded>Active</u-tag>
|
|
15
|
+
<u-tag color="success" dot>Shipped</u-tag>
|
|
15
16
|
|
|
16
17
|
<!-- With icon prefix -->
|
|
17
18
|
<u-tag color="red">
|
|
@@ -36,10 +37,11 @@ For interactive chips (selectable/removable), use [`u-chip`](./chip.md) instead.
|
|
|
36
37
|
|
|
37
38
|
| Property | Type | Default | Reflect | Description |
|
|
38
39
|
|----------|------|---------|---------|-------------|
|
|
39
|
-
| `
|
|
40
|
-
| `color` | `'neutral'\|'primary'\|'info'\|'success'\|'warning'\|'danger'\|'blue'\|'green'\|'yellow'\|'red'\|'orange'\|'teal'\|'cyan'\|'purple'\|'pink'
|
|
40
|
+
| `appearance` | `'solid'\|'soft'\|'outlined'\|'plain'` | `'soft'` | ✓ | How much chrome: `solid` filled · `soft` tint · `outlined` · `plain` coloured text only |
|
|
41
|
+
| `color` | `'neutral'\|'primary'\|'info'\|'success'\|'warning'\|'danger'\|'blue'\|'green'\|'yellow'\|'red'\|'orange'\|'teal'\|'cyan'\|'purple'\|'pink'` | `'neutral'` | ✓ | Color — `neutral` (the default) is grey |
|
|
41
42
|
| `rounded` | `boolean` | `false` | ✓ | Pill shape |
|
|
42
43
|
| `icon` | `boolean` | `false` | ✓ | Adds a status icon so the meaning survives without color (`info`/`success`/`warning`/`danger` only) |
|
|
44
|
+
| `dot` | `boolean` | `false` | ✓ | Adds a small leading mark in the text colour — for status labels repeated down a table column. `icon` wins when both are set |
|
|
43
45
|
|
|
44
46
|
## CSS Parts
|
|
45
47
|
|
|
@@ -48,16 +50,17 @@ For interactive chips (selectable/removable), use [`u-chip`](./chip.md) instead.
|
|
|
48
50
|
| `base` | Outer tag box |
|
|
49
51
|
| `content` | Inner content wrapper |
|
|
50
52
|
| `icon` | Status icon (rendered only with `icon` + a semantic `color`) |
|
|
53
|
+
| `dot` | Leading mark (rendered only with `dot`) |
|
|
51
54
|
|
|
52
55
|
## Color axes
|
|
53
56
|
|
|
54
57
|
`color` carries **two** axes. The **role** axis (`primary`·`info`·`success`·`warning`·`danger`)
|
|
55
58
|
means *semantics* — it follows re-branding and inherits the contrast contract. The **decorative**
|
|
56
|
-
axis (`blue`·`purple` …
|
|
59
|
+
axis (`blue`·`purple` …) means *the color itself* and is deliberately immune to re-branding.
|
|
57
60
|
|
|
58
|
-
`neutral` (the default) is **
|
|
59
|
-
|
|
60
|
-
`info` "Shipped"
|
|
61
|
+
`neutral` (the default) is **achromatic** — a grey label, the same meaning `neutral` has on `u-button`,
|
|
62
|
+
`u-badge` and `u-checkbox`. Use it for a label that should carry no colour at all — a status such as "Pending" next
|
|
63
|
+
to an `info` "Shipped". For a tag tinted with the brand colour, use `primary`.
|
|
61
64
|
|
|
62
65
|
`icon` only applies to the four **status** roles — `neutral` and `primary` are not states, and the
|
|
63
66
|
decorative axis carries no meaning, so no icon is drawn there.
|
|
@@ -75,3 +78,4 @@ decorative axis carries no meaning, so no icon is drawn there.
|
|
|
75
78
|
| `--tag-color` | Text color |
|
|
76
79
|
| `--tag-bg-color` | Background color |
|
|
77
80
|
| `--tag-border-color` | Border color |
|
|
81
|
+
| `--tag-dot-size` | Diameter of the leading `dot` (default 6px) |
|
|
@@ -23,7 +23,8 @@ Multi-line text input with auto-resize and optional character counter. Form-asso
|
|
|
23
23
|
| Property | Type | Default | Reflect | Description |
|
|
24
24
|
|----------|------|---------|---------|-------------|
|
|
25
25
|
| `value` | `string` | — | — | Current text value |
|
|
26
|
-
| `
|
|
26
|
+
| `appearance` | `'outlined'\|'soft'\|'underlined'\|'plain'` | `'outlined'` | ✓ | How much chrome: `outlined` · `soft` tinted face · `underlined` bottom line only · `plain` no chrome |
|
|
27
|
+
| `size` | `'sm'\|'md'\|'lg'` | `'md'` | ✓ | Field size, like a button's: 12px · `--u-density` (14px) · 16px. A field and a button of the same size share a height |
|
|
27
28
|
| `resize` | `'none'\|'vertical'\|'horizontal'\|'both'\|'auto'` | `'auto'` | ✓ | Resize behavior |
|
|
28
29
|
| `minRows` | `number` | — | — | Minimum visible rows |
|
|
29
30
|
| `maxRows` | `number` | — | — | Maximum rows (auto-resize cap) |
|
|
@@ -118,7 +118,7 @@ tracked as open work, because the sheet pairs it by hand across five colour role
|
|
|
118
118
|
|
|
119
119
|
⚠ Setting `--u-primary-color` alone is **not enough**: hover/focus/link colors resolve from
|
|
120
120
|
`--u-primary-color-strong`, so they stay on the default ramp and your brand looks half-applied.
|
|
121
|
-
The measured symptom is a *selected table row* or *tag* that stays blue while buttons turn brand —
|
|
121
|
+
The measured symptom is a *selected table row* or `color="primary"` *tag* that stays blue while buttons turn brand —
|
|
122
122
|
that one is `--u-primary-bg-color`.
|
|
123
123
|
|
|
124
124
|
### Typography
|
|
@@ -30,7 +30,7 @@ const result = await Dialog.show({
|
|
|
30
30
|
content: 'Which plan do you want?',
|
|
31
31
|
actions: [
|
|
32
32
|
{ label: 'Free', value: 'free' },
|
|
33
|
-
{ label: 'Pro', value: 'pro',
|
|
33
|
+
{ label: 'Pro', value: 'pro', appearance: 'solid' }
|
|
34
34
|
]
|
|
35
35
|
});
|
|
36
36
|
// result = 'free' | 'pro' | null (if closed without selecting)
|
|
@@ -79,7 +79,7 @@ interface CustomDialogOptions extends DialogOptions {
|
|
|
79
79
|
interface DialogAction {
|
|
80
80
|
label: string;
|
|
81
81
|
value: string;
|
|
82
|
-
|
|
82
|
+
appearance?: ButtonAppearance; // default: 'solid'
|
|
83
83
|
color?: ButtonColor;
|
|
84
84
|
}
|
|
85
85
|
```
|
|
@@ -27,13 +27,13 @@ IconRegistry.register('my-icons', async (name: string) => {
|
|
|
27
27
|
Resolver contract — the registry owns caching, so a resolver is a pure lookup:
|
|
28
28
|
return `string` = success (cached) · return `undefined` = definitive not-found (negative-cached, not retried) · `throw` = transient error (not cached, retried on next lookup).
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
Registering an existing `lib` name replaces it — to override a built-in library (e.g. air-gapped local bundle), register it again. Replacing evicts that library's cache.
|
|
31
31
|
|
|
32
32
|
## API
|
|
33
33
|
|
|
34
34
|
| Method | Description |
|
|
35
35
|
|--------|-------------|
|
|
36
|
-
| `IconRegistry.register(lib, resolver)` | Register an icon library
|
|
36
|
+
| `IconRegistry.register(lib, resolver)` | Register an icon library; an existing `lib` is replaced (its cached entries are evicted) |
|
|
37
37
|
| `IconRegistry.unregister(lib)` | Remove a library + evict its cached entries |
|
|
38
38
|
| `IconRegistry.has(lib)` | Check if a library is registered |
|
|
39
39
|
| `IconRegistry.resolve(lib, name)` | `Promise<string \| undefined>` — resolve SVG source (cached + in-flight dedupe) |
|
|
@@ -38,7 +38,7 @@ same chain.
|
|
|
38
38
|
| `Locale.set(locale)` | Set active locale |
|
|
39
39
|
| `Locale.get()` | Get active locale |
|
|
40
40
|
| `Locale.register(locale, table)` | Register/override locale messages (partial merge supported) |
|
|
41
|
-
| `Locale.getValue(key, params?)` | Resolve a localized message for current locale |
|
|
41
|
+
| `Locale.getValue(key, params?, locale?)` | Resolve a localized message for the current locale (or `locale`, along its fallback chain) |
|
|
42
42
|
| `Locale.namespace(name)` | A string table for a package or app area, keyed by its own union — returns a handle (below) |
|
|
43
43
|
|
|
44
44
|
### Namespaces
|
|
@@ -51,11 +51,15 @@ changes**, because those targets are relative to the page background.
|
|
|
51
51
|
> from `--u-primary-color-strong`, so they stay on the default ramp and the brand looks
|
|
52
52
|
> half-applied. (The sheet derives no step from `--u-primary-color` — measured: 0 references.)
|
|
53
53
|
|
|
54
|
-
> **Load that block however you like — a plain static `import`
|
|
55
|
-
> built-in sheets
|
|
56
|
-
>
|
|
57
|
-
>
|
|
58
|
-
>
|
|
54
|
+
> **Load that block however you like — a plain static `import` and a plain `:root` rule are
|
|
55
|
+
> enough.** Since 2.0 the built-in sheets live in a cascade layer (`@layer iyu.base, iyu.house;`),
|
|
56
|
+
> and unlayered application CSS beats every layer regardless of load order, `Theme.init()` timing
|
|
57
|
+
> or selector specificity (a `:where(:root)` wrapper wins too). A house theme sits between the two
|
|
58
|
+
> in `@layer iyu.house { … }`.
|
|
59
|
+
>
|
|
60
|
+
> 🔴 **That includes dark mode.** The dark palette is scoped to `:root[theme="dark"]` inside
|
|
61
|
+
> `iyu.base`, so an unlayered `:root` override applies in both themes. Scope a mode-specific value
|
|
62
|
+
> yourself with `:root[theme="dark"] { … }`.
|
|
59
63
|
|
|
60
64
|
## API
|
|
61
65
|
|