@iyulab/components 2.23.2 → 2.25.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/CHANGELOG.md +40 -0
  2. package/README.md +1 -1
  3. package/dist/_virtual/_glob-assets_raw/dark.css.e8ac080d.js +1 -1
  4. package/dist/_virtual/_glob-assets_raw/light.css.637cb2f8.js +1 -1
  5. package/dist/components/alert/UAlert.d.ts +8 -0
  6. package/dist/components/alert/UAlert.js +16 -7
  7. package/dist/components/alert/UAlert.styles.js +21 -1
  8. package/dist/components/breadcrumb-item/UBreadcrumbItem.styles.js +5 -1
  9. package/dist/components/card/UCard.d.ts +15 -2
  10. package/dist/components/card/UCard.js +23 -2
  11. package/dist/components/card/UCard.styles.js +18 -0
  12. package/dist/components/checkbox/UCheckbox.styles.js +4 -2
  13. package/dist/components/expander/UExpander.styles.js +3 -1
  14. package/dist/components/menu-item/UMenuItem.styles.js +4 -1
  15. package/dist/components/radio/URadio.d.ts +1 -1
  16. package/dist/components/radio/URadio.styles.js +1 -1
  17. package/dist/components/switch/USwitch.d.ts +1 -1
  18. package/dist/components/switch/USwitch.styles.js +1 -1
  19. package/dist/components/tab/UTab.d.ts +24 -4
  20. package/dist/components/tab/UTab.js +51 -8
  21. package/dist/components/tab/UTab.styles.js +33 -1
  22. package/dist/components/tab-nav/UTabNav.d.ts +34 -0
  23. package/dist/components/tab-nav/UTabNav.js +44 -0
  24. package/dist/components/tab-nav/UTabNav.styles.d.ts +1 -0
  25. package/dist/components/tab-nav/UTabNav.styles.js +38 -0
  26. package/dist/components/tag/UTag.d.ts +4 -0
  27. package/dist/components/tag/UTag.js +5 -0
  28. package/dist/components/tag/UTag.styles.js +12 -0
  29. package/dist/components/tree-item/UTreeItem.styles.js +4 -1
  30. package/dist/index.d.ts +1 -0
  31. package/dist/index.js +2 -1
  32. package/dist/react/UTabNav.d.ts +14 -0
  33. package/dist/react/UTabNav.js +10 -0
  34. package/dist/react/index.d.ts +1 -0
  35. package/dist/react/index.js +1 -0
  36. package/dist/styles/dark.css +6 -0
  37. package/dist/styles/light.css +6 -0
  38. package/package.json +1 -1
  39. package/skills/iyulab-components/SKILL.md +2 -1
  40. package/skills/iyulab-components/references/components/alert.md +18 -0
  41. package/skills/iyulab-components/references/components/card.md +16 -1
  42. package/skills/iyulab-components/references/components/checkbox.md +1 -1
  43. package/skills/iyulab-components/references/components/radio.md +1 -1
  44. package/skills/iyulab-components/references/components/switch.md +1 -1
  45. package/skills/iyulab-components/references/components/tab-nav.md +63 -0
  46. package/skills/iyulab-components/references/components/tab-panel.md +15 -1
  47. package/skills/iyulab-components/references/components/tag.md +9 -1
@@ -34,7 +34,7 @@ Checkbox with `indeterminate` state support. Form-associated (`formAssociated =
34
34
  | `checked` | `boolean` | `false` | ✓ | Checked state |
35
35
  | `indeterminate` | `boolean` | `false` | ✓ | Partial / indeterminate state |
36
36
  | `appearance` | `'solid'\|'outlined'` | `'solid'` | ✓ | `solid` fills the checked box with the colour · `outlined` colours the border and checkmark |
37
- | `color` | `'primary'\|'info'\|'success'\|'warning'\|'danger'\|'blue'\|'green'\|'red'\|'orange'\|'teal'\|'cyan'\|'purple'\|'pink'\|'neutral'` | `'primary'` | ✓ | Accent color — role axis (`primary`…`danger`, follows rebranding) and decorative axis (`blue`…, the palette colour itself, immune to it). `neutral` is grey |
37
+ | `color` | `'primary'\|'info'\|'success'\|'warning'\|'danger'\|'blue'\|'green'\|'red'\|'orange'\|'teal'\|'cyan'\|'purple'\|'pink'\|'neutral'` | `'primary'` | ✓ | Accent color — role axis (`primary`…`danger`, follows rebranding) and decorative axis (`blue`…, the palette colour itself, immune to it). `neutral` is grey. `primary` fills with the selection colour `--u-selection-color` (the primary colour unless the theme sets it) |
38
38
  | `disabled` | `boolean` | `false` | ✓ | Disable the control |
39
39
  | `readonly` | `boolean` | `false` | ✓ | Read-only |
40
40
  | `required` | `boolean` | `false` | ✓ | Required field |
@@ -84,5 +84,5 @@ native radio group and WAI-ARIA APG behaviour.
84
84
 
85
85
  | Property | Description |
86
86
  |----------|-------------|
87
- | `--radio-color` | Base color of the selected state (default `--u-primary-color`) |
87
+ | `--radio-color` | Base color of the selected state (default `--u-selection-color`, which is `--u-primary-color` unless the theme sets it) |
88
88
  | `--radio-color-active` | Selected-state active tone (default `--radio-color` at 85% + black) |
@@ -80,7 +80,7 @@ Exposed as a **`switch`** (on/off), not a checkbox — screen readers announce "
80
80
  | `--switch-track-width` | Track width |
81
81
  | `--switch-track-height` | Track height |
82
82
  | `--switch-track-color` | Track color (unchecked) |
83
- | `--switch-track-color-checked` | Track color (checked) |
83
+ | `--switch-track-color-checked` | Track color (checked) — default `--u-selection-color`, which is `--u-primary-color` unless the theme sets it |
84
84
  | `--switch-thumb-size` | Thumb diameter |
85
85
  | `--switch-thumb-offset` | Thumb padding from track edge |
86
86
  | `--switch-thumb-color` | Thumb color (unchecked) |
@@ -0,0 +1,63 @@
1
+ # u-tab-nav
2
+
3
+ ```ts
4
+ import '@iyulab/components/dist/components/tab-nav/UTabNav.js';
5
+ import '@iyulab/components/dist/components/tab/UTab.js';
6
+ ```
7
+
8
+ **Tags:** `u-tab-nav`, `u-tab` (with `href`)
9
+
10
+ A tab strip of **links** — saved views, sections of a record, anything where each tab is a URL. It looks like the
11
+ `line` appearance of [`u-tab-panel`](./tab-panel.md) but does a different job: `u-tab-panel` switches panels on the
12
+ same page (a `tablist`), `u-tab-nav` takes you to another URL (a `<nav>` landmark).
13
+
14
+ ```html
15
+ <u-tab-nav label="Saved views" value="open">
16
+ <u-tab value="all" href="?view=all">All</u-tab>
17
+ <u-tab value="open" href="?view=open" count="12">Open</u-tab>
18
+ <u-tab value="mine" href="?view=mine" count="3">Mine</u-tab>
19
+ </u-tab-nav>
20
+ ```
21
+
22
+ Each `u-tab` needs an `href`. Mark the current view with `value` on the strip (the tab with the same `value` becomes
23
+ `active`), or leave `value` empty and put `active` on the current tab yourself. With a router, set `value` from the
24
+ route.
25
+
26
+ ### Accessibility
27
+
28
+ - The strip is a `<nav>` named by `label` — give it one when the page has other navigation.
29
+ - Each tab is a link, and each link is a Tab stop; Enter follows it. There are no arrow keys and no tab role — the
30
+ WAI-ARIA tabs pattern is for panels on one page, and a link announced as a «tab» promises a panel that never
31
+ appears.
32
+ - The current tab carries `aria-current="page"`.
33
+ - A disabled link tab has no `href` and reports `aria-disabled`.
34
+ - A `count` is part of the link's name («Open 12»).
35
+
36
+ ---
37
+
38
+ ## Properties
39
+
40
+ | Property | Type | Default | Reflect | Description |
41
+ |----------|------|---------|---------|-------------|
42
+ | `value` | `string` | `''` | ✓ | The current view — the tab with this `value` becomes `active`. Empty leaves `active` to the tabs |
43
+ | `label` | `string` | `''` | | Accessible name of the navigation landmark |
44
+
45
+ `u-tab` properties for link tabs (`href`, `target`, `rel`, `active`, `count`) are in [tab-panel.md](./tab-panel.md#u-tab).
46
+
47
+ ## Slots
48
+
49
+ | Name | Description |
50
+ |------|-------------|
51
+ | *(default)* | `u-tab` elements with `href` |
52
+
53
+ ## CSS Parts
54
+
55
+ | Part | Description |
56
+ |------|-------------|
57
+ | `base` | The `<nav>` strip |
58
+
59
+ ## CSS Custom Properties
60
+
61
+ | Property | Description |
62
+ |----------|-------------|
63
+ | `--tab-nav-color` | Text and underline colour of the current tab (default: `--u-primary-color`) |
@@ -8,7 +8,8 @@ import '@iyulab/components/dist/components/panel/UPanel.js';
8
8
 
9
9
  **Tags:** `u-tab-panel`, `u-tab`
10
10
 
11
- Tab-based content switcher. Pair each `u-tab` with a `u-panel` of the same `value`.
11
+ Tab-based content switcher. Pair each `u-tab` with a `u-panel` of the same `value`. For tabs that are links to other
12
+ URLs (saved views), use [`u-tab-nav`](./tab-nav.md).
12
13
 
13
14
  ```html
14
15
  <u-tab-panel value="home">
@@ -104,6 +105,12 @@ selected tab is a tab stop (arrow keys, Home and End move between tabs and selec
104
105
  A control placed in a slot (a button, a link) keeps its own keys and clicks — it does not select or
105
106
  activate the tab, and the tab's arrow-key navigation applies only while the tab itself has focus.
106
107
 
108
+ **Link tabs.** With `href` the tab renders as a link for [`u-tab-nav`](./tab-nav.md): no tab role and no host tab
109
+ stop (the inner `<a>` is the stop), `aria-current="page"` while `active`, and no remove button.
110
+
111
+ **Count.** `count` draws a quiet number after the label — smaller, weaker, tabular digits in the active locale — in a
112
+ panel tab or a link tab. It is part of the tab's name.
113
+
107
114
  ### Properties
108
115
 
109
116
  | Property | Type | Default | Reflect | Description |
@@ -112,6 +119,11 @@ activate the tab, and the tab's arrow-key navigation applies only while the tab
112
119
  | `disabled` | `boolean` | `false` | ✓ | Disable the tab |
113
120
  | `removable` | `boolean` | `false` | ✓ | Show close/remove button |
114
121
  | `draggable` | `boolean` | `false` | ✓ | Native drag attribute — **no built-in reordering** |
122
+ | `active` | `boolean` | `false` | ✓ | The selected tab — set by the container's `value`; set it yourself on a link tab when `u-tab-nav` has no `value` |
123
+ | `href` | `string` | — | ✓ | Makes the tab a link (inside `u-tab-nav`) |
124
+ | `target` | `string` | — | | Link target (with `href`) |
125
+ | `rel` | `string` | — | | Link relationship (with `href`) |
126
+ | `count` | `number` | — | | Quiet count after the label, in the active locale's digits |
115
127
 
116
128
  ### Events
117
129
 
@@ -123,4 +135,6 @@ activate the tab, and the tab's arrow-key navigation applies only while the tab
123
135
 
124
136
  | Part | Description |
125
137
  |------|-------------|
138
+ | `base` | Tab box — the `<a>` when `href` is set |
139
+ | `count` | The count (only with `count`) |
126
140
  | `remove-btn` | Remove button |
@@ -14,6 +14,9 @@ Non-interactive label tag for categories, status, or metadata display.
14
14
  <u-tag color="green" rounded>Active</u-tag>
15
15
  <u-tag color="success" dot>Shipped</u-tag>
16
16
 
17
+ <!-- A small mark inside a line of text — an attribute next to an id in a table cell -->
18
+ <a href="/orders/42">SO-42</a> <u-tag size="sm" appearance="outlined">Rush</u-tag>
19
+
17
20
  <!-- With icon prefix -->
18
21
  <u-tag color="red">
19
22
  <u-icon slot="prefix" lib="tabler" name="alert-circle"></u-icon>
@@ -23,6 +26,10 @@ Non-interactive label tag for categories, status, or metadata display.
23
26
 
24
27
  For interactive chips (selectable/removable), use [`u-chip`](./chip.md) instead.
25
28
 
29
+ **`size="sm"`** sits inside a line of text: the overline text size (`--u-text-overline-size`) and its leading, no
30
+ block padding — about 18px with the border, so it does not grow a dense table row. It carries no letter spacing (the
31
+ overline tracking assumes Latin labels).
32
+
26
33
  ---
27
34
 
28
35
  ## Slots
@@ -42,6 +49,7 @@ For interactive chips (selectable/removable), use [`u-chip`](./chip.md) instead.
42
49
  | `rounded` | `boolean` | `false` | ✓ | Pill shape |
43
50
  | `icon` | `boolean` | `false` | ✓ | Adds a status icon so the meaning survives without color (`info`/`success`/`warning`/`danger` only) |
44
51
  | `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 |
52
+ | `size` | `'sm'\|'md'` | `'md'` | ✓ | `md` caption text · `sm` overline text with no block padding, for a mark inside a line of text |
45
53
 
46
54
  ## CSS Parts
47
55
 
@@ -78,4 +86,4 @@ decorative axis carries no meaning, so no icon is drawn there.
78
86
  | `--tag-color` | Text color |
79
87
  | `--tag-bg-color` | Background color |
80
88
  | `--tag-border-color` | Border color |
81
- | `--tag-dot-size` | Diameter of the leading `dot` (default 6px) |
89
+ | `--tag-dot-size` | Diameter of the leading `dot` (default 6px · 5px at `size="sm"`) |