@a-type/ui 3.0.12 → 3.0.14

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 (160) hide show
  1. package/dist/cjs/__tests__/setup.d.ts +1 -0
  2. package/dist/cjs/__tests__/setup.js +5 -0
  3. package/dist/cjs/__tests__/setup.js.map +1 -0
  4. package/dist/cjs/colors.stories.d.ts +1 -8
  5. package/dist/cjs/colors.stories.js +36 -26
  6. package/dist/cjs/colors.stories.js.map +1 -1
  7. package/dist/cjs/components/box/Box.d.ts +1 -1
  8. package/dist/cjs/components/box/Box.stories.js +2 -2
  9. package/dist/cjs/components/box/Box.stories.js.map +1 -1
  10. package/dist/cjs/components/button/Button.d.ts +1 -1
  11. package/dist/cjs/components/button/Button.stories.js +9 -9
  12. package/dist/cjs/components/button/Button.stories.js.map +1 -1
  13. package/dist/cjs/components/button/classes.d.ts +1 -1
  14. package/dist/cjs/components/card/Card.d.ts +1 -1
  15. package/dist/cjs/components/chip/Chip.d.ts +1 -1
  16. package/dist/cjs/components/colorPicker/ColorPicker.d.ts +1 -1
  17. package/dist/cjs/components/colorPicker/ColorPicker.js +2 -2
  18. package/dist/cjs/components/colorPicker/ColorPicker.js.map +1 -1
  19. package/dist/cjs/components/datePicker/DatePicker.d.ts +1 -1
  20. package/dist/cjs/components/dropdownMenu/DropdownMenu.d.ts +1 -1
  21. package/dist/cjs/components/layouts/PageRoot.d.ts +5 -1
  22. package/dist/cjs/components/layouts/PageRoot.js +22 -2
  23. package/dist/cjs/components/layouts/PageRoot.js.map +1 -1
  24. package/dist/cjs/components/note/Note.d.ts +1 -1
  25. package/dist/cjs/components/progress/Progress.d.ts +1 -1
  26. package/dist/cjs/components/slider/Slider.d.ts +1 -1
  27. package/dist/cjs/hooks/useOverrideTheme.d.ts +1 -1
  28. package/dist/cjs/hooks/useTitleBarColor.d.ts +4 -0
  29. package/dist/cjs/hooks/useTitleBarColor.js +33 -3
  30. package/dist/cjs/hooks/useTitleBarColor.js.map +1 -1
  31. package/dist/cjs/hooks/useTitleBarColor.stories.js +1 -1
  32. package/dist/cjs/hooks/useTitleBarColor.stories.js.map +1 -1
  33. package/dist/cjs/index.d.ts +1 -1
  34. package/dist/cjs/index.js +2 -4
  35. package/dist/cjs/index.js.map +1 -1
  36. package/dist/cjs/uno/index.d.ts +1 -0
  37. package/dist/cjs/uno/index.js +8 -0
  38. package/dist/cjs/uno/index.js.map +1 -0
  39. package/dist/cjs/uno/logic/color.d.ts +100 -27
  40. package/dist/cjs/uno/logic/color.js +259 -42
  41. package/dist/cjs/uno/logic/color.js.map +1 -1
  42. package/dist/cjs/uno/logic/color.test.d.ts +1 -0
  43. package/dist/cjs/uno/logic/color.test.js +74 -0
  44. package/dist/cjs/uno/logic/color.test.js.map +1 -0
  45. package/dist/cjs/uno/logic/oklch.d.ts +3 -0
  46. package/dist/cjs/uno/logic/oklch.js +96 -0
  47. package/dist/cjs/uno/logic/oklch.js.map +1 -0
  48. package/dist/cjs/uno/logic/palettes.d.ts +63 -0
  49. package/dist/cjs/uno/logic/palettes.js +99 -0
  50. package/dist/cjs/uno/logic/palettes.js.map +1 -0
  51. package/dist/cjs/uno/preflights/colors.js +18 -42
  52. package/dist/cjs/uno/preflights/colors.js.map +1 -1
  53. package/dist/cjs/uno/preflights/fonts.d.ts +4 -0
  54. package/dist/cjs/uno/preflights/fonts.js +20 -0
  55. package/dist/cjs/uno/preflights/fonts.js.map +1 -0
  56. package/dist/cjs/uno/preflights/index.d.ts +2 -1
  57. package/dist/cjs/uno/preflights/index.js +2 -0
  58. package/dist/cjs/uno/preflights/index.js.map +1 -1
  59. package/dist/cjs/uno/theme/colors.d.ts +17 -53
  60. package/dist/cjs/uno/theme/colors.js +11 -13
  61. package/dist/cjs/uno/theme/colors.js.map +1 -1
  62. package/dist/cjs/uno/uno.preset.d.ts +2 -1
  63. package/dist/cjs/uno/uno.preset.js +3 -1
  64. package/dist/cjs/uno/uno.preset.js.map +1 -1
  65. package/dist/css/main.css +9 -8
  66. package/dist/esm/__tests__/setup.d.ts +1 -0
  67. package/dist/esm/__tests__/setup.js +3 -0
  68. package/dist/esm/__tests__/setup.js.map +1 -0
  69. package/dist/esm/colors.stories.d.ts +1 -8
  70. package/dist/esm/colors.stories.js +33 -26
  71. package/dist/esm/colors.stories.js.map +1 -1
  72. package/dist/esm/components/box/Box.d.ts +1 -1
  73. package/dist/esm/components/box/Box.stories.js +1 -1
  74. package/dist/esm/components/box/Box.stories.js.map +1 -1
  75. package/dist/esm/components/button/Button.d.ts +1 -1
  76. package/dist/esm/components/button/Button.stories.js +1 -1
  77. package/dist/esm/components/button/Button.stories.js.map +1 -1
  78. package/dist/esm/components/button/classes.d.ts +1 -1
  79. package/dist/esm/components/card/Card.d.ts +1 -1
  80. package/dist/esm/components/chip/Chip.d.ts +1 -1
  81. package/dist/esm/components/colorPicker/ColorPicker.d.ts +1 -1
  82. package/dist/esm/components/colorPicker/ColorPicker.js +1 -1
  83. package/dist/esm/components/colorPicker/ColorPicker.js.map +1 -1
  84. package/dist/esm/components/datePicker/DatePicker.d.ts +1 -1
  85. package/dist/esm/components/dropdownMenu/DropdownMenu.d.ts +1 -1
  86. package/dist/esm/components/layouts/PageRoot.d.ts +5 -1
  87. package/dist/esm/components/layouts/PageRoot.js +19 -2
  88. package/dist/esm/components/layouts/PageRoot.js.map +1 -1
  89. package/dist/esm/components/note/Note.d.ts +1 -1
  90. package/dist/esm/components/progress/Progress.d.ts +1 -1
  91. package/dist/esm/components/slider/Slider.d.ts +1 -1
  92. package/dist/esm/hooks/useOverrideTheme.d.ts +1 -1
  93. package/dist/esm/hooks/useTitleBarColor.d.ts +4 -0
  94. package/dist/esm/hooks/useTitleBarColor.js +32 -3
  95. package/dist/esm/hooks/useTitleBarColor.js.map +1 -1
  96. package/dist/esm/hooks/useTitleBarColor.stories.js +2 -2
  97. package/dist/esm/hooks/useTitleBarColor.stories.js.map +1 -1
  98. package/dist/esm/index.d.ts +1 -1
  99. package/dist/esm/index.js +1 -1
  100. package/dist/esm/index.js.map +1 -1
  101. package/dist/esm/uno/index.d.ts +1 -0
  102. package/dist/esm/uno/index.js +3 -0
  103. package/dist/esm/uno/index.js.map +1 -0
  104. package/dist/esm/uno/logic/color.d.ts +100 -27
  105. package/dist/esm/uno/logic/color.js +256 -38
  106. package/dist/esm/uno/logic/color.js.map +1 -1
  107. package/dist/esm/uno/logic/color.test.d.ts +1 -0
  108. package/dist/esm/uno/logic/color.test.js +72 -0
  109. package/dist/esm/uno/logic/color.test.js.map +1 -0
  110. package/dist/esm/uno/logic/oklch.d.ts +3 -0
  111. package/dist/esm/uno/logic/oklch.js +90 -0
  112. package/dist/esm/uno/logic/oklch.js.map +1 -0
  113. package/dist/esm/uno/logic/palettes.d.ts +63 -0
  114. package/dist/esm/uno/logic/palettes.js +95 -0
  115. package/dist/esm/uno/logic/palettes.js.map +1 -0
  116. package/dist/esm/uno/preflights/colors.js +17 -41
  117. package/dist/esm/uno/preflights/colors.js.map +1 -1
  118. package/dist/esm/uno/preflights/fonts.d.ts +4 -0
  119. package/dist/esm/uno/preflights/fonts.js +16 -0
  120. package/dist/esm/uno/preflights/fonts.js.map +1 -0
  121. package/dist/esm/uno/preflights/index.d.ts +2 -1
  122. package/dist/esm/uno/preflights/index.js +2 -0
  123. package/dist/esm/uno/preflights/index.js.map +1 -1
  124. package/dist/esm/uno/theme/colors.d.ts +17 -53
  125. package/dist/esm/uno/theme/colors.js +11 -13
  126. package/dist/esm/uno/theme/colors.js.map +1 -1
  127. package/dist/esm/uno/uno.preset.d.ts +2 -1
  128. package/dist/esm/uno/uno.preset.js +3 -1
  129. package/dist/esm/uno/uno.preset.js.map +1 -1
  130. package/package.json +132 -125
  131. package/src/__tests__/setup.ts +1 -0
  132. package/src/colors.stories.tsx +94 -71
  133. package/src/components/box/Box.stories.tsx +1 -1
  134. package/src/components/box/Box.tsx +1 -1
  135. package/src/components/button/Button.stories.tsx +1 -1
  136. package/src/components/button/Button.tsx +1 -1
  137. package/src/components/button/classes.tsx +1 -1
  138. package/src/components/chip/Chip.tsx +1 -1
  139. package/src/components/colorPicker/ColorPicker.tsx +1 -1
  140. package/src/components/datePicker/DatePicker.tsx +1 -1
  141. package/src/components/dropdownMenu/DropdownMenu.tsx +1 -1
  142. package/src/components/layouts/PageRoot.tsx +29 -8
  143. package/src/components/note/Note.tsx +1 -1
  144. package/src/components/progress/Progress.tsx +1 -1
  145. package/src/components/slider/Slider.tsx +1 -1
  146. package/src/hooks/useOverrideTheme.ts +1 -1
  147. package/src/hooks/useTitleBarColor.stories.tsx +2 -2
  148. package/src/hooks/useTitleBarColor.ts +41 -3
  149. package/src/index.ts +1 -5
  150. package/src/themes.stories.tsx +1 -1
  151. package/src/uno/index.ts +5 -0
  152. package/src/uno/logic/color.test.ts +109 -0
  153. package/src/uno/logic/color.ts +428 -80
  154. package/src/uno/logic/oklch.ts +120 -0
  155. package/src/uno/logic/palettes.ts +266 -0
  156. package/src/uno/preflights/colors.ts +22 -41
  157. package/src/uno/preflights/fonts.ts +23 -0
  158. package/src/uno/preflights/index.ts +3 -1
  159. package/src/uno/theme/colors.ts +13 -18
  160. package/src/uno/uno.preset.ts +8 -3
package/package.json CHANGED
@@ -1,127 +1,134 @@
1
1
  {
2
- "name": "@a-type/ui",
3
- "version": "3.0.12",
4
- "type": "module",
5
- "files": [
6
- "/dist",
7
- "/src"
8
- ],
9
- "sideEffects": [
10
- ".*\\.css$"
11
- ],
12
- "exports": {
13
- ".": {
14
- "import": "./dist/esm/index.js",
15
- "node": "./dist/esm/index.js",
16
- "require": "./dist/cjs/index.js",
17
- "default": "./dist/cjs/index.js"
18
- },
19
- "./uno-preset": {
20
- "types": "./dist/esm/uno/uno.preset.d.ts",
21
- "import": "./dist/esm/uno/uno.preset.js",
22
- "node": "./dist/esm/uno/uno.preset.js",
23
- "require": "./dist/cjs/uno/uno.preset.js",
24
- "default": "./dist/cjs/uno/uno.preset.js"
25
- },
26
- "./main.css": {
27
- "import": "./dist/css/main.css",
28
- "node": "./dist/css/main.css",
29
- "require": "./dist/css/main.css",
30
- "default": "./dist/css/main.css"
31
- }
32
- },
33
- "scripts": {
34
- "build:transpile": "tsc && tsc -P tsconfig-cjs.json",
35
- "build:prefix": "node ./scripts/addUnoInclude.js",
36
- "build:process": "unocss --write-transformed -o ./dist/css/main.css -m -c uno.config.js \"./dist/**/*.js\"",
37
- "build": "pnpm run build:transpile && pnpm run build:prefix && pnpm run build:process",
38
- "prepublish": "pnpm run build",
39
- "icons": "node ./scripts/generateIcons.js",
40
- "storybook": "storybook dev -p 6006",
41
- "build-storybook": "storybook build",
42
- "up-radix": "pnpm update \"@radix-ui/*\" --latest",
43
- "bump": "pnpx bumpp"
44
- },
45
- "peerDependencies": {
46
- "react": "^19",
47
- "react-dom": "^19",
48
- "unocss": "^66"
49
- },
50
- "dependencies": {
51
- "@a-type/utils": "^1.1.4",
52
- "@radix-ui/react-accordion": "^1.2.2",
53
- "@radix-ui/react-checkbox": "^1.1.3",
54
- "@radix-ui/react-collapsible": "^1.1.2",
55
- "@radix-ui/react-context-menu": "^2.2.3",
56
- "@radix-ui/react-dialog": "^1.1.3",
57
- "@radix-ui/react-dropdown-menu": "^2.1.3",
58
- "@radix-ui/react-icons": "^1.3.2",
59
- "@radix-ui/react-menu": "^2.1.3",
60
- "@radix-ui/react-popover": "^1.1.3",
61
- "@radix-ui/react-progress": "^1.1.1",
62
- "@radix-ui/react-radio-group": "^1.2.2",
63
- "@radix-ui/react-scroll-area": "^1.2.2",
64
- "@radix-ui/react-select": "^2.1.3",
65
- "@radix-ui/react-slider": "^1.2.2",
66
- "@radix-ui/react-slot": "^1.1.1",
67
- "@radix-ui/react-switch": "^1.1.2",
68
- "@radix-ui/react-tabs": "^1.1.2",
69
- "@radix-ui/react-toast": "^1.2.3",
70
- "@radix-ui/react-toggle-group": "^1.1.1",
71
- "@radix-ui/react-tooltip": "^1.1.5",
72
- "@unocss/preset-mini": "66.5.4",
73
- "@unocss/preset-wind3": "66.5.4",
74
- "@use-gesture/react": "^10.3.1",
75
- "browser-image-resizer": "^2.4.1",
76
- "calendar-blocks": "^0.4.0",
77
- "clsx": "^2.1.1",
78
- "color-interpolate": "^1.0.5",
79
- "color-parse": "^2.0.2",
80
- "color-space": "^2.0.1",
81
- "csstype": "^3.1.3",
82
- "date-fns": "^4.1.0",
83
- "formik": "^2.4.6",
84
- "frimousse": "^0.2.0",
85
- "motion": "^12.23.6",
86
- "pluralize": "^8.0.0",
87
- "react-hot-toast": "^2.4.1",
88
- "react-is": "^19.1.0",
89
- "valtio": "^2.1.4"
90
- },
91
- "devDependencies": {
92
- "@storybook/addon-essentials": "8.4.7",
93
- "@storybook/addon-interactions": "8.4.7",
94
- "@storybook/addon-links": "8.4.7",
95
- "@storybook/blocks": "8.4.7",
96
- "@storybook/react": "8.4.7",
97
- "@storybook/react-vite": "8.4.7",
98
- "@storybook/test": "8.4.7",
99
- "@types/pluralize": "^0.0.33",
100
- "@types/react": "^19.0.1",
101
- "@types/react-dom": "^19.0.2",
102
- "@types/react-is": "^19.0.0",
103
- "@types/w3c-image-capture": "^1.0.10",
104
- "@unocss/cli": "66.5.4",
105
- "@unocss/core": "66.5.4",
106
- "@unocss/transformer-variant-group": "66.5.4",
107
- "axios": "^1.5.0",
108
- "bumpp": "^10.3.1",
109
- "change-case": "^4.1.2",
110
- "dotenv": "^16.3.1",
111
- "fs-extra": "^11.1.1",
112
- "prettier": "^3.0.3",
113
- "react": "19.0.0",
114
- "react-dom": "19.0.0",
115
- "storybook": "8.4.7",
116
- "typescript": "^5.7.2",
117
- "unocss": "^66.5.4"
118
- },
119
- "pnpm": {
120
- "ignoredBuiltDependencies": [
121
- "esbuild"
122
- ],
123
- "onlyBuiltDependencies": [
124
- "esbuild"
125
- ]
126
- }
2
+ "name": "@a-type/ui",
3
+ "version": "3.0.14",
4
+ "type": "module",
5
+ "files": [
6
+ "/dist",
7
+ "/src"
8
+ ],
9
+ "sideEffects": [
10
+ ".*\\.css$"
11
+ ],
12
+ "exports": {
13
+ ".": {
14
+ "import": "./dist/esm/index.js",
15
+ "node": "./dist/esm/index.js",
16
+ "require": "./dist/cjs/index.js",
17
+ "default": "./dist/cjs/index.js"
18
+ },
19
+ "./uno-preset": {
20
+ "types": "./dist/esm/uno/uno.preset.d.ts",
21
+ "import": "./dist/esm/uno/uno.preset.js",
22
+ "node": "./dist/esm/uno/uno.preset.js",
23
+ "require": "./dist/cjs/uno/uno.preset.js",
24
+ "default": "./dist/cjs/uno/uno.preset.js"
25
+ },
26
+ "./main.css": {
27
+ "import": "./dist/css/main.css",
28
+ "node": "./dist/css/main.css",
29
+ "require": "./dist/css/main.css",
30
+ "default": "./dist/css/main.css"
31
+ }
32
+ },
33
+ "scripts": {
34
+ "build:transpile": "tsc && tsc -P tsconfig-cjs.json",
35
+ "build:prefix": "node ./scripts/addUnoInclude.js",
36
+ "build:process": "unocss --write-transformed -o ./dist/css/main.css -m -c uno.config.js \"./dist/**/*.js\"",
37
+ "build": "pnpm run build:transpile && pnpm run build:prefix && pnpm run build:process",
38
+ "prepublish": "pnpm run build",
39
+ "icons": "node ./scripts/generateIcons.js",
40
+ "storybook": "storybook dev -p 6006",
41
+ "build-storybook": "storybook build",
42
+ "up-radix": "pnpm update \"@radix-ui/*\" --latest",
43
+ "bump": "pnpx bumpp",
44
+ "test": "vitest",
45
+ "test:browser": "vitest --config=vitest.browser.config.ts"
46
+ },
47
+ "peerDependencies": {
48
+ "react": "^19",
49
+ "react-dom": "^19",
50
+ "unocss": "^66"
51
+ },
52
+ "dependencies": {
53
+ "@a-type/utils": "^1.1.4",
54
+ "@radix-ui/react-accordion": "^1.2.2",
55
+ "@radix-ui/react-checkbox": "^1.1.3",
56
+ "@radix-ui/react-collapsible": "^1.1.2",
57
+ "@radix-ui/react-context-menu": "^2.2.3",
58
+ "@radix-ui/react-dialog": "^1.1.3",
59
+ "@radix-ui/react-dropdown-menu": "^2.1.3",
60
+ "@radix-ui/react-icons": "^1.3.2",
61
+ "@radix-ui/react-menu": "^2.1.3",
62
+ "@radix-ui/react-popover": "^1.1.3",
63
+ "@radix-ui/react-progress": "^1.1.1",
64
+ "@radix-ui/react-radio-group": "^1.2.2",
65
+ "@radix-ui/react-scroll-area": "^1.2.2",
66
+ "@radix-ui/react-select": "^2.1.3",
67
+ "@radix-ui/react-slider": "^1.2.2",
68
+ "@radix-ui/react-slot": "^1.1.1",
69
+ "@radix-ui/react-switch": "^1.1.2",
70
+ "@radix-ui/react-tabs": "^1.1.2",
71
+ "@radix-ui/react-toast": "^1.2.3",
72
+ "@radix-ui/react-toggle-group": "^1.1.1",
73
+ "@radix-ui/react-tooltip": "^1.1.5",
74
+ "@unocss/preset-mini": "66.5.4",
75
+ "@unocss/preset-wind3": "66.5.4",
76
+ "@use-gesture/react": "^10.3.1",
77
+ "browser-image-resizer": "^2.4.1",
78
+ "calendar-blocks": "^0.4.0",
79
+ "clsx": "^2.1.1",
80
+ "color-interpolate": "^1.0.5",
81
+ "color-parse": "^2.0.2",
82
+ "color-space": "^2.0.1",
83
+ "colorjs.io": "^0.5.2",
84
+ "csstype": "^3.1.3",
85
+ "date-fns": "^4.1.0",
86
+ "formik": "^2.4.6",
87
+ "frimousse": "^0.2.0",
88
+ "motion": "^12.23.6",
89
+ "pluralize": "^8.0.0",
90
+ "react-hot-toast": "^2.4.1",
91
+ "react-is": "^19.1.0",
92
+ "valtio": "^2.1.4"
93
+ },
94
+ "devDependencies": {
95
+ "@storybook/addon-essentials": "8.4.7",
96
+ "@storybook/addon-interactions": "8.4.7",
97
+ "@storybook/addon-links": "8.4.7",
98
+ "@storybook/blocks": "8.4.7",
99
+ "@storybook/react": "8.4.7",
100
+ "@storybook/react-vite": "8.4.7",
101
+ "@storybook/test": "8.4.7",
102
+ "@types/pluralize": "^0.0.33",
103
+ "@types/react": "^19.0.1",
104
+ "@types/react-dom": "^19.0.2",
105
+ "@types/react-is": "^19.0.0",
106
+ "@types/w3c-image-capture": "^1.0.10",
107
+ "@unocss/cli": "66.5.4",
108
+ "@unocss/core": "66.5.4",
109
+ "@unocss/transformer-variant-group": "66.5.4",
110
+ "@vitejs/plugin-react": "^5.1.0",
111
+ "@vitest/browser-playwright": "^4.0.6",
112
+ "axios": "^1.5.0",
113
+ "bumpp": "^10.3.1",
114
+ "change-case": "^4.1.2",
115
+ "dotenv": "^16.3.1",
116
+ "fs-extra": "^11.1.1",
117
+ "prettier": "^3.0.3",
118
+ "react": "19.0.0",
119
+ "react-dom": "19.0.0",
120
+ "storybook": "8.4.7",
121
+ "typescript": "^5.7.2",
122
+ "unocss": "^66.5.4",
123
+ "vitest": "^4.0.6",
124
+ "vitest-browser-react": "^2.0.2"
125
+ },
126
+ "pnpm": {
127
+ "ignoredBuiltDependencies": [
128
+ "esbuild"
129
+ ],
130
+ "onlyBuiltDependencies": [
131
+ "esbuild"
132
+ ]
133
+ }
127
134
  }
@@ -0,0 +1 @@
1
+ import 'virtual:uno.css';
@@ -1,5 +1,9 @@
1
1
  import type { Meta, StoryObj } from '@storybook/react';
2
+ import clsx from 'clsx';
3
+ import { CSSProperties } from 'react';
2
4
  import { Box } from './components/index.js';
5
+ import { snapshotColorContext } from './uno/logic/color.js';
6
+ import { palettes } from './uno/logic/palettes.js';
3
7
 
4
8
  const meta = {
5
9
  title: 'System/Colors',
@@ -11,17 +15,9 @@ const meta = {
11
15
  max: 360,
12
16
  },
13
17
  },
14
- customRotate: {
15
- control: {
16
- type: 'number',
17
- min: -20,
18
- max: 20,
19
- },
20
- },
21
18
  },
22
19
  args: {
23
20
  customHue: 0,
24
- customRotate: 0,
25
21
  },
26
22
  parameters: {
27
23
  controls: { expanded: true },
@@ -36,55 +32,45 @@ export const Default: Story = {
36
32
  render(args: any) {
37
33
  const style: any = args.customHue
38
34
  ? {
39
- '--dyn-primary-source': args.customHue,
40
- '--dyn-primary-hue-rotate': args.customRotate,
35
+ '--p-primary-hue': args.customHue,
41
36
  }
42
37
  : {};
38
+
39
+ const ranges = (
40
+ <>
41
+ <Range className="theme" style={style} />
42
+ <Range className="theme-lemon" />
43
+ <Range className="theme-leek" />
44
+ <Range className="theme-tomato" />
45
+ <Range className="theme-eggplant" />
46
+ <Range className="theme-blueberry" />
47
+ <Range className="palette-attention" />
48
+ <Range className="palette-success" />
49
+ <Box className="h-100px">
50
+ <Box grow className="bg-gray-wash" />
51
+ <Box grow className="bg-gray-light" />
52
+ <Box grow className="bg-gray" />
53
+ <Box grow className="bg-gray-dark" />
54
+ <Box grow className="bg-gray-ink" />
55
+ </Box>
56
+ <Range className="palette-high-contrast" />
57
+ <Box className="h-100px">
58
+ <Box grow className="bg-black" />
59
+ <Box grow className="bg-wash" />
60
+ <Box grow className="bg-white" />
61
+ </Box>
62
+ </>
63
+ );
64
+
43
65
  return (
44
66
  <Box col>
45
67
  <input type="color" className="sticky top-0 z-1" />
46
68
  <Box full>
47
69
  <Box d="col" grow p surface>
48
- <Range className="theme" style={style} />
49
- <Range className="theme-lemon" />
50
- <Range className="theme-leek" />
51
- <Range className="theme-tomato" />
52
- <Range className="theme-eggplant" />
53
- <Range className="theme-blueberry" />
54
- <Box className="h-100px">
55
- <Box grow className="bg-gray-wash" />
56
- <Box grow className="bg-gray-light" />
57
- <Box grow className="bg-gray" />
58
- <Box grow className="bg-gray-dark" />
59
- <Box grow className="bg-gray-ink" />
60
- </Box>
61
- <Range className="palette-high-contrast" />
62
- <Box className="h-100px">
63
- <Box grow className="bg-black" />
64
- <Box grow className="bg-wash" />
65
- <Box grow className="bg-white" />
66
- </Box>
70
+ {ranges}
67
71
  </Box>
68
72
  <Box d="col" className="override-dark theme" grow p>
69
- <Range className="theme" style={style} />
70
- <Range className="theme-lemon" />
71
- <Range className="theme-leek" />
72
- <Range className="theme-tomato" />
73
- <Range className="theme-eggplant" />
74
- <Range className="theme-blueberry" />
75
- <Box className="h-100px">
76
- <Box grow className="bg-gray-wash" />
77
- <Box grow className="bg-gray-light" />
78
- <Box grow className="bg-gray" />
79
- <Box grow className="bg-gray-dark" />
80
- <Box grow className="bg-gray-ink" />
81
- </Box>
82
- <Range className="palette-high-contrast" />
83
- <Box className="h-100px">
84
- <Box grow className="bg-black" />
85
- <Box grow className="bg-wash" />
86
- <Box grow className="bg-white" />
87
- </Box>
73
+ {ranges}
88
74
  </Box>
89
75
  </Box>
90
76
  </Box>
@@ -95,19 +81,22 @@ export const Default: Story = {
95
81
  function Swatch({
96
82
  className,
97
83
  children,
84
+ style,
98
85
  }: {
99
86
  className?: string;
100
87
  children?: React.ReactNode;
88
+ style?: CSSProperties;
101
89
  }) {
102
90
  return (
103
91
  <div
104
- className={className}
92
+ className={clsx(className, 'color-contrast')}
105
93
  style={{
106
94
  height: '100px',
107
95
  display: 'flex',
108
96
  justifyContent: 'center',
109
97
  alignItems: 'center',
110
98
  flex: '1',
99
+ ...style,
111
100
  }}
112
101
  >
113
102
  {children}
@@ -118,11 +107,11 @@ function Swatch({
118
107
  function Range({ className, style }: { className?: string; style?: any }) {
119
108
  return (
120
109
  <Box className={className} style={style}>
121
- <Swatch className="bg-primary-wash" />
122
- <Swatch className="bg-primary-light" />
123
- <Swatch className="bg-primary" />
124
- <Swatch className="bg-primary-dark" />
125
- <Swatch className="bg-primary-ink" />
110
+ <Swatch className="bg-main-wash" />
111
+ <Swatch className="bg-main-light" />
112
+ <Swatch className="bg-main" />
113
+ <Swatch className="bg-main-dark" />
114
+ <Swatch className="bg-main-ink" />
126
115
  </Box>
127
116
  );
128
117
  }
@@ -131,8 +120,7 @@ export const Modifiers: Story = {
131
120
  render(args: any) {
132
121
  const style: any = args.customHue
133
122
  ? {
134
- '--dyn-primary-source': args.customHue,
135
- '--dyn-primary-hue-rotate': args.customRotate,
123
+ '--p-primary-hue': args.customHue,
136
124
  }
137
125
  : {};
138
126
  return (
@@ -158,19 +146,19 @@ function ModifierRange({
158
146
  }) {
159
147
  return (
160
148
  <Box className={className} style={style}>
161
- <Swatch className="bg-primary-wash">W</Swatch>
162
- <Swatch className="bg-primary-light bg-lighten-3">L+3</Swatch>
163
- <Swatch className="bg-primary-light">L</Swatch>
164
- {/* <Swatch className="bg-primary bg-lighten-5">P+5</Swatch> */}
165
- <Swatch className="bg-primary bg-lighten-3">P+3</Swatch>
166
- <Swatch className="bg-primary bg-lighten-1">P+1</Swatch>
167
- <Swatch className="bg-primary">P</Swatch>
168
- <Swatch className="bg-primary bg-darken-1">P-1</Swatch>
169
- <Swatch className="bg-primary bg-darken-3">P-3</Swatch>
170
- {/* <Swatch className="bg-primary bg-darken-5">P-5</Swatch> */}
171
- <Swatch className="bg-primary-dark">D</Swatch>
172
- <Swatch className="bg-primary-dark bg-darken-3">D-3</Swatch>
173
- <Swatch className="bg-primary-ink">I</Swatch>
149
+ <Swatch className="bg-main-wash">W</Swatch>
150
+ <Swatch className="bg-main-light bg-lighten-2">L+2</Swatch>
151
+ <Swatch className="bg-main-light">L</Swatch>
152
+ {/* <Swatch className="bg-main bg-lighten-5">P+5</Swatch> */}
153
+ <Swatch className="bg-main bg-lighten-2">P+2</Swatch>
154
+ <Swatch className="bg-main bg-lighten-1">P+1</Swatch>
155
+ <Swatch className="bg-main">P</Swatch>
156
+ <Swatch className="bg-main bg-darken-1">P-1</Swatch>
157
+ <Swatch className="bg-main bg-darken-2">P-2</Swatch>
158
+ {/* <Swatch className="bg-main bg-darken-5">P-5</Swatch> */}
159
+ <Swatch className="bg-main-dark">D</Swatch>
160
+ <Swatch className="bg-main-dark bg-darken-2">D-2</Swatch>
161
+ <Swatch className="bg-main-ink">I</Swatch>
174
162
  </Box>
175
163
  );
176
164
  }
@@ -179,8 +167,7 @@ export const Inheritance: Story = {
179
167
  render(args: any) {
180
168
  const style: any = args.customHue
181
169
  ? {
182
- '--dyn-primary-source': args.customHue,
183
- '--dyn-primary-hue-rotate': args.customRotate,
170
+ '--p-primary-hue': args.customHue,
184
171
  }
185
172
  : {};
186
173
  return (
@@ -266,3 +253,39 @@ export const TweakOpacity: Story = {
266
253
  );
267
254
  },
268
255
  };
256
+
257
+ export const ComputedColors: Story = {
258
+ render() {
259
+ const ctx = snapshotColorContext('primary');
260
+ const hexValues = [
261
+ palettes.primary.definitions.wash.computeHex(ctx),
262
+ palettes.primary.definitions.light.computeHex(ctx),
263
+ palettes.primary.definitions.default.computeHex(ctx),
264
+ palettes.primary.definitions.dark.computeHex(ctx),
265
+ palettes.primary.definitions.ink.computeHex(ctx),
266
+ ];
267
+ const oklchValues = [
268
+ palettes.primary.definitions.wash.computeOklch(ctx),
269
+ palettes.primary.definitions.light.computeOklch(ctx),
270
+ palettes.primary.definitions.default.computeOklch(ctx),
271
+ palettes.primary.definitions.dark.computeOklch(ctx),
272
+ palettes.primary.definitions.ink.computeOklch(ctx),
273
+ ];
274
+
275
+ return (
276
+ <Box col>
277
+ <Range className="theme" />
278
+ <Box className="h-100px">
279
+ {oklchValues.map((oklch) => (
280
+ <Swatch style={{ backgroundColor: oklch }}>OK</Swatch>
281
+ ))}
282
+ </Box>
283
+ <Box className="h-100px">
284
+ {hexValues.map((hex) => (
285
+ <Swatch style={{ backgroundColor: hex }}>Hex</Swatch>
286
+ ))}
287
+ </Box>
288
+ </Box>
289
+ );
290
+ },
291
+ };
@@ -1,5 +1,5 @@
1
1
  import type { Meta, StoryObj } from '@storybook/react';
2
- import { paletteNames } from '../../uno/logic/color.js';
2
+ import { paletteNames } from '../../uno/index.js';
3
3
  import { Button } from '../button/Button.js';
4
4
  import { Checkbox } from '../checkbox/Checkbox.js';
5
5
  import { Progress } from '../progress/Progress.js';
@@ -1,6 +1,6 @@
1
1
  import clsx from 'clsx';
2
2
  import { createContext, Ref, useContext, useMemo } from 'react';
3
- import { PaletteName } from '../../uno/logic/color.js';
3
+ import { PaletteName } from '../../uno/index.js';
4
4
  import { SlotDiv, SlotDivProps } from '../utility/SlotDiv.js';
5
5
 
6
6
  export type BoxAlignment = 'center' | 'stretch' | 'start' | 'end';
@@ -1,6 +1,6 @@
1
1
  import type { Meta, StoryObj } from '@storybook/react';
2
2
  import { useState } from 'react';
3
- import { paletteNames } from '../../uno/logic/color.js';
3
+ import { paletteNames } from '../../uno/index.js';
4
4
  import { Box } from '../box/Box.js';
5
5
  import { Icon } from '../icon/index.js';
6
6
  import { Button } from './Button.js';
@@ -12,7 +12,7 @@ import {
12
12
  } from 'react';
13
13
  import { withClassName } from '../../hooks.js';
14
14
  import useMergedRef from '../../hooks/useMergedRef.js';
15
- import { PaletteName } from '../../uno/logic/color.js';
15
+ import { PaletteName } from '../../uno/index.js';
16
16
  import { DropdownMenuTriggerIcon } from '../dropdownMenu/DropdownMenu.js';
17
17
  import { useIsDropdownTrigger } from '../dropdownMenu/DropdownTriggerContext.js';
18
18
  import { IconLoadingProvider } from '../icon/IconLoadingContext.js';
@@ -1,5 +1,5 @@
1
1
  import clsx from 'clsx';
2
- import { PaletteName } from '../../uno/logic/color.js';
2
+ import { PaletteName } from '../../uno/index.js';
3
3
  import { type ButtonProps } from './Button.jsx';
4
4
 
5
5
  export function getButtonClassName({
@@ -1,7 +1,7 @@
1
1
  import { Slot } from '@radix-ui/react-slot';
2
2
  import classNames from 'clsx';
3
3
  import { HTMLAttributes, Ref } from 'react';
4
- import { PaletteName } from '../../uno/logic/color.js';
4
+ import { PaletteName } from '../../uno/index.js';
5
5
 
6
6
  export interface ChipProps extends HTMLAttributes<HTMLElement> {
7
7
  color?: PaletteName;
@@ -2,7 +2,7 @@ import { SelectTriggerProps } from '@radix-ui/react-select';
2
2
  import classNames, { clsx } from 'clsx';
3
3
  import { ReactNode } from 'react';
4
4
  import { withClassName } from '../../hooks/withClassName.js';
5
- import { PaletteName, paletteNames } from '../../uno/logic/color.js';
5
+ import { PaletteName, paletteNames } from '../../uno/index.js';
6
6
  import {
7
7
  Select,
8
8
  SelectContent,
@@ -6,7 +6,7 @@ import {
6
6
  import classNames from 'clsx';
7
7
  import { useCallback, useState } from 'react';
8
8
  import { withClassName } from '../../hooks.js';
9
- import { PaletteName } from '../../uno/logic/color.js';
9
+ import { PaletteName } from '../../uno/index.js';
10
10
  import { Button } from '../button/index.js';
11
11
  import { Icon } from '../icon/index.js';
12
12
 
@@ -3,7 +3,7 @@ import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
3
3
  import classNames, { clsx } from 'clsx';
4
4
  import { Ref } from 'react';
5
5
  import { withClassName } from '../../hooks/withClassName.js';
6
- import { PaletteName } from '../../uno/logic/color.js';
6
+ import { PaletteName } from '../../uno/index.js';
7
7
  import { BoxContext } from '../box/Box.js';
8
8
  import { SlotDiv } from '../utility/SlotDiv.js';
9
9
  import { DropdownTriggerProvider } from './DropdownTriggerContext.js';
@@ -1,9 +1,30 @@
1
- import { withClassName } from '../../hooks.js';
1
+ import clsx from 'clsx';
2
+ import { HTMLAttributes } from 'react';
3
+ import { useThemedTitleBar } from '../../hooks.js';
2
4
 
3
- export const PageRoot = withClassName(
4
- 'div',
5
- 'layer-components:(flex-grow-1 flex-shrink-1 flex-basis-0 min-h-100dvh bg-wash)',
6
- 'layer-components:(grid grid-areas-[content]-[nav] grid-cols-[1fr] grid-rows-[1fr_auto] items-start justify-center)',
7
- 'md:layer-responsive:(grid-areas-[gutter1_nav_content_gutter2] grid-cols-[1fr_auto_20fr_1fr] min-h-auto h-auto bg-wash)',
8
- 'lg:layer-responsive:(grid-cols-[1fr_auto_min(800px,70vw)_1fr])',
9
- );
5
+ export interface PageRootProps extends HTMLAttributes<HTMLDivElement> {
6
+ disableTitleBarColor?: boolean;
7
+ }
8
+
9
+ export function PageRoot({
10
+ className,
11
+ children,
12
+ disableTitleBarColor,
13
+ ...rest
14
+ }: PageRootProps) {
15
+ useThemedTitleBar('gray', 'wash', undefined, disableTitleBarColor);
16
+ return (
17
+ <div
18
+ className={clsx(
19
+ 'layer-components:(flex-grow-1 flex-shrink-1 flex-basis-0 min-h-100dvh bg-wash)',
20
+ 'layer-components:(grid grid-areas-[content]-[nav] grid-cols-[1fr] grid-rows-[1fr_auto] items-start justify-center)',
21
+ 'md:layer-responsive:(grid-areas-[gutter1_nav_content_gutter2] grid-cols-[1fr_auto_20fr_1fr] min-h-auto h-auto bg-wash)',
22
+ 'lg:layer-responsive:(grid-cols-[1fr_auto_min(800px,70vw)_1fr])',
23
+ className,
24
+ )}
25
+ {...rest}
26
+ >
27
+ {children}
28
+ </div>
29
+ );
30
+ }