@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.
Files changed (59) hide show
  1. package/CHANGELOG.md +206 -0
  2. package/README.md +32 -0
  3. package/dist/components/UOverlayElement.d.ts +18 -0
  4. package/dist/components/UOverlayElement.js +24 -0
  5. package/dist/components/badge/UBadge.d.ts +5 -0
  6. package/dist/components/badge/UBadge.js +9 -0
  7. package/dist/components/badge/UBadge.styles.js +6 -0
  8. package/dist/components/button/UButton.styles.js +17 -0
  9. package/dist/components/dialog/UDialog.styles.js +1 -1
  10. package/dist/components/drawer/UDrawer.styles.js +1 -1
  11. package/dist/components/expander/UExpander.d.ts +38 -0
  12. package/dist/components/expander/UExpander.js +78 -0
  13. package/dist/components/expander/UExpander.styles.d.ts +1 -0
  14. package/dist/components/expander/UExpander.styles.js +95 -0
  15. package/dist/components/panel/UPanel.d.ts +0 -2
  16. package/dist/components/panel/UPanel.js +0 -5
  17. package/dist/components/skeleton/USkeleton.d.ts +7 -0
  18. package/dist/components/skeleton/USkeleton.js +7 -1
  19. package/dist/components/skeleton/USkeleton.styles.js +64 -0
  20. package/dist/components/tab-panel/UTabPanel.d.ts +4 -2
  21. package/dist/components/tab-panel/UTabPanel.js +0 -5
  22. package/dist/components/tag/UTag.d.ts +7 -0
  23. package/dist/components/tag/UTag.js +10 -1
  24. package/dist/components/tag/UTag.styles.js +4 -0
  25. package/dist/components/tree/UTree.d.ts +4 -2
  26. package/dist/components/tree/UTree.js +0 -5
  27. package/dist/components/tree-item/UTreeItem.d.ts +4 -1
  28. package/dist/components/tree-item/UTreeItem.js +0 -5
  29. package/dist/index.d.ts +1 -0
  30. package/dist/index.js +2 -1
  31. package/dist/react/UExpander.d.ts +16 -0
  32. package/dist/react/UExpander.js +13 -0
  33. package/dist/react/index.d.ts +1 -0
  34. package/dist/react/index.js +1 -0
  35. package/dist/utilities/Dialog.js +1 -1
  36. package/dist/utilities/Locale.d.ts +34 -0
  37. package/dist/utilities/Locale.js +43 -6
  38. package/dist/utilities/Theme.d.ts +24 -0
  39. package/dist/utilities/Theme.js +52 -0
  40. package/dist/utilities/accent.d.ts +52 -0
  41. package/dist/utilities/accent.js +127 -0
  42. package/dist/utilities/icons.js +1 -1
  43. package/dist/utilities/statusIcon.d.ts +31 -0
  44. package/dist/utilities/statusIcon.js +34 -0
  45. package/package.json +3 -2
  46. package/skills/iyulab-components/SKILL.md +2 -1
  47. package/skills/iyulab-components/references/components/badge.md +2 -1
  48. package/skills/iyulab-components/references/components/button.md +3 -1
  49. package/skills/iyulab-components/references/components/drawer.md +30 -0
  50. package/skills/iyulab-components/references/components/expander.md +70 -0
  51. package/skills/iyulab-components/references/components/input.md +6 -0
  52. package/skills/iyulab-components/references/components/panel.md +6 -4
  53. package/skills/iyulab-components/references/components/skeleton.md +12 -0
  54. package/skills/iyulab-components/references/components/tab-panel.md +4 -5
  55. package/skills/iyulab-components/references/components/tag.md +18 -1
  56. package/skills/iyulab-components/references/components/textarea.md +5 -0
  57. package/skills/iyulab-components/references/components/tree.md +2 -4
  58. package/skills/iyulab-components/references/usage.md +22 -2
  59. package/skills/iyulab-components/references/utilities/theme.md +23 -4
@@ -22,17 +22,34 @@ await Theme.init({
22
22
  });
23
23
  ```
24
24
 
25
- ## Primary Color Customization
25
+ ## Brand accent
26
26
 
27
- Interactive components derive their accent palette from `--u-primary-color`.
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: #7c3aed; /* global brand/accent 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
- With this single token override, components such as buttons, checkbox/radio/switch, tab-panel, badge, and tag recalculate hover/active/surface/outline colors automatically.
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