@iyulab/components 1.21.0 → 1.23.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 +206 -0
- package/README.md +32 -0
- package/dist/components/UOverlayElement.d.ts +18 -0
- package/dist/components/UOverlayElement.js +24 -0
- package/dist/components/badge/UBadge.d.ts +5 -0
- package/dist/components/badge/UBadge.js +9 -0
- package/dist/components/badge/UBadge.styles.js +6 -0
- package/dist/components/button/UButton.styles.js +17 -0
- package/dist/components/dialog/UDialog.styles.js +1 -1
- package/dist/components/drawer/UDrawer.styles.js +1 -1
- package/dist/components/expander/UExpander.d.ts +38 -0
- package/dist/components/expander/UExpander.js +78 -0
- package/dist/components/expander/UExpander.styles.d.ts +1 -0
- package/dist/components/expander/UExpander.styles.js +95 -0
- package/dist/components/panel/UPanel.d.ts +0 -2
- package/dist/components/panel/UPanel.js +0 -5
- package/dist/components/skeleton/USkeleton.d.ts +7 -0
- package/dist/components/skeleton/USkeleton.js +7 -1
- package/dist/components/skeleton/USkeleton.styles.js +64 -0
- package/dist/components/tab-panel/UTabPanel.d.ts +4 -2
- package/dist/components/tab-panel/UTabPanel.js +0 -5
- package/dist/components/tag/UTag.d.ts +7 -0
- package/dist/components/tag/UTag.js +10 -1
- package/dist/components/tag/UTag.styles.js +4 -0
- package/dist/components/tree/UTree.d.ts +4 -2
- package/dist/components/tree/UTree.js +0 -5
- package/dist/components/tree-item/UTreeItem.d.ts +4 -1
- package/dist/components/tree-item/UTreeItem.js +0 -5
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -1
- package/dist/react/UExpander.d.ts +16 -0
- package/dist/react/UExpander.js +13 -0
- package/dist/react/index.d.ts +1 -0
- package/dist/react/index.js +1 -0
- package/dist/utilities/Dialog.js +1 -1
- package/dist/utilities/Locale.d.ts +34 -0
- package/dist/utilities/Locale.js +43 -6
- package/dist/utilities/Theme.d.ts +24 -0
- package/dist/utilities/Theme.js +52 -0
- package/dist/utilities/accent.d.ts +52 -0
- package/dist/utilities/accent.js +127 -0
- package/dist/utilities/icons.js +1 -1
- package/dist/utilities/statusIcon.d.ts +31 -0
- package/dist/utilities/statusIcon.js +34 -0
- package/package.json +3 -2
- package/skills/iyulab-components/SKILL.md +2 -1
- package/skills/iyulab-components/references/components/badge.md +2 -1
- package/skills/iyulab-components/references/components/button.md +3 -1
- package/skills/iyulab-components/references/components/drawer.md +30 -0
- package/skills/iyulab-components/references/components/expander.md +70 -0
- package/skills/iyulab-components/references/components/input.md +6 -0
- package/skills/iyulab-components/references/components/panel.md +6 -4
- package/skills/iyulab-components/references/components/skeleton.md +12 -0
- package/skills/iyulab-components/references/components/tab-panel.md +4 -5
- package/skills/iyulab-components/references/components/tag.md +18 -1
- package/skills/iyulab-components/references/components/textarea.md +5 -0
- package/skills/iyulab-components/references/components/tree.md +2 -4
- package/skills/iyulab-components/references/usage.md +22 -2
- package/skills/iyulab-components/references/utilities/theme.md +23 -4
|
@@ -22,17 +22,34 @@ await Theme.init({
|
|
|
22
22
|
});
|
|
23
23
|
```
|
|
24
24
|
|
|
25
|
-
##
|
|
25
|
+
## Brand accent
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
**Recommended — derive the whole ramp from one seed:**
|
|
28
|
+
|
|
29
|
+
```ts
|
|
30
|
+
Theme.accent('#7c3aed'); // computes --u-primary-color-{weakest…strong} + --u-primary-txt-color
|
|
31
|
+
Theme.accent(null); // back to the sheet defaults
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
The computed ramp satisfies the contrast contract this library tests against — text on the accent
|
|
35
|
+
surface ≥ 4.5:1, accent text on the page background ≥ 4.5:1, `-strong` distinguishable from
|
|
36
|
+
`-color`, and `-weak` usable as a non-text graphic (≥ 3:1). It is **recalculated when the theme
|
|
37
|
+
changes**, because those targets are relative to the page background.
|
|
38
|
+
|
|
39
|
+
**Manual override** — set the steps you use, not just one:
|
|
28
40
|
|
|
29
41
|
```css
|
|
30
42
|
:root {
|
|
31
|
-
--u-primary-color: #
|
|
43
|
+
--u-primary-color-weak: #a78bfa; /* graphics on the page background */
|
|
44
|
+
--u-primary-color: #7c3aed; /* accent surface */
|
|
45
|
+
--u-primary-color-strong: #5b21b6; /* text/icons on the page background */
|
|
46
|
+
--u-primary-txt-color: #ffffff; /* text on the accent surface */
|
|
32
47
|
}
|
|
33
48
|
```
|
|
34
49
|
|
|
35
|
-
|
|
50
|
+
> ⚠ Overriding `--u-primary-color` **alone is not enough**. Hover, focus and link colors resolve
|
|
51
|
+
> from `--u-primary-color-strong`, so they stay on the default ramp and the brand looks
|
|
52
|
+
> half-applied. (The sheet derives no step from `--u-primary-color` — measured: 0 references.)
|
|
36
53
|
|
|
37
54
|
## API
|
|
38
55
|
|
|
@@ -41,6 +58,8 @@ With this single token override, components such as buttons, checkbox/radio/swit
|
|
|
41
58
|
| `Theme.init(options?)` | `Promise<void>` | Initialize and apply theme |
|
|
42
59
|
| `Theme.get()` | `ThemeType \| undefined` | Get current theme |
|
|
43
60
|
| `Theme.set(theme)` | `void` | Set theme (`'light'`, `'dark'`, `'system'`) |
|
|
61
|
+
| `Theme.resolved()` | `'light' | 'dark'` | The theme actually applied — use this, not `get()`, for brightness branches |
|
|
62
|
+
| `Theme.accent(seed)` | `void` | Derive the `--u-primary-*` ramp from a brand color; `null` clears it |
|
|
44
63
|
| `Theme.isInitialized` | `boolean` | Whether `init()` has been called |
|
|
45
64
|
|
|
46
65
|
## Types
|