@rovula/ui 0.1.6 → 0.1.7
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/dist/cjs/bundle.css +361 -355
- package/dist/cjs/bundle.js +171 -171
- package/dist/cjs/bundle.js.map +1 -1
- package/dist/cjs/types/utils/colors.d.ts +267 -267
- package/dist/components/Switch/Switch.styles.js +1 -1
- package/dist/esm/bundle.css +361 -355
- package/dist/esm/bundle.js +1 -1
- package/dist/esm/bundle.js.map +1 -1
- package/dist/esm/types/utils/colors.d.ts +267 -267
- package/dist/index.d.ts +267 -267
- package/dist/src/theme/global.css +2396 -2540
- package/dist/utils/colors.js +267 -267
- package/package.json +1 -1
- package/src/components/Button/Buttons.stories.tsx +15 -7
- package/src/components/Switch/Switch.styles.ts +1 -1
- package/src/theme/THEME_MAPPING.md +36 -37
- package/src/theme/global.css +7 -3
- package/src/theme/presets/colors.js +26 -28
- package/src/theme/themes/skyller/baseline.css +0 -4
- package/src/theme/themes/variable-mapping.css +1064 -0
- package/src/theme/themes/variable.css +248 -230
- package/src/theme/themes/xspector/baseline.css +0 -4
- package/src/theme/themes/xspector/components/dropdown-menu.css +4 -4
- package/src/theme/tokens/baseline.css +0 -3
- package/src/theme/tokens/color.css +34 -63
- package/src/theme/tokens/components/action-button.css +6 -6
- package/src/theme/tokens/components/button.css +189 -189
- package/src/theme/tokens/components/dropdown-menu.css +2 -2
- package/src/theme/tokens/components/footer.css +1 -1
- package/src/theme/tokens/components/switch.css +10 -10
- package/src/theme/tokens/typography.css +28 -28
- package/src/theme/tokens_old/baseline.css +13 -0
- package/src/theme/tokens_old/color.css +78 -0
- package/src/theme/tokens_old/components/action-button.css +127 -0
- package/src/theme/tokens_old/components/button.css +512 -0
- package/src/theme/tokens_old/components/dropdown-menu.css +27 -0
- package/src/theme/tokens_old/components/footer.css +9 -0
- package/src/theme/tokens_old/components/loading.css +11 -0
- package/src/theme/tokens_old/components/navbar.css +9 -0
- package/src/theme/tokens_old/components/progress-bar.css +8 -0
- package/src/theme/tokens_old/components/switch.css +29 -0
- package/src/theme/tokens_old/typography.css +199 -0
- package/src/theme/tokens_old/variables.css +28 -0
- package/src/theme/utils.js +16 -16
- package/src/utils/colors.ts +275 -278
- package/src/theme/themes/skyller/color.css +0 -79
- package/src/theme/themes/skyller/palette.css +0 -143
- package/src/theme/themes/skyller/state.css +0 -94
- package/src/theme/themes/skyller/transparent.css +0 -94
- package/src/theme/themes/xspector/color.css +0 -83
- package/src/theme/themes/xspector/palette.css +0 -142
- package/src/theme/themes/xspector/state.css +0 -94
- package/src/theme/themes/xspector/transparent.css +0 -93
- /package/src/theme/{tokens → tokens_old}/palette.css +0 -0
- /package/src/theme/{tokens → tokens_old}/state.css +0 -0
- /package/src/theme/{tokens → tokens_old}/transparent.css +0 -0
|
@@ -189,7 +189,13 @@ export const ShapePreview = {
|
|
|
189
189
|
} satisfies Story;
|
|
190
190
|
|
|
191
191
|
const previewColors: Array<
|
|
192
|
-
|
|
192
|
+
| "primary"
|
|
193
|
+
| "secondary"
|
|
194
|
+
| "tertiary"
|
|
195
|
+
| "info"
|
|
196
|
+
| "success"
|
|
197
|
+
| "warning"
|
|
198
|
+
| "error"
|
|
193
199
|
> = ["primary", "secondary", "tertiary", "info", "success", "warning", "error"];
|
|
194
200
|
const previewSizes: Array<"lg" | "md" | "sm"> = ["lg", "md", "sm"];
|
|
195
201
|
const previewSizeLabel: Record<(typeof previewSizes)[number], string> = {
|
|
@@ -197,12 +203,14 @@ const previewSizeLabel: Record<(typeof previewSizes)[number], string> = {
|
|
|
197
203
|
md: "Medium",
|
|
198
204
|
sm: "Small",
|
|
199
205
|
};
|
|
200
|
-
const previewStyles: Array<{
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
+
const previewStyles: Array<{
|
|
207
|
+
label: string;
|
|
208
|
+
variant: "solid" | "outline" | "text";
|
|
209
|
+
}> = [
|
|
210
|
+
{ label: "Solid", variant: "solid" },
|
|
211
|
+
{ label: "Outline", variant: "outline" },
|
|
212
|
+
{ label: "Text", variant: "text" },
|
|
213
|
+
];
|
|
206
214
|
|
|
207
215
|
const icon = <ArrowsUpDownIcon />;
|
|
208
216
|
const previewStates = [
|
|
@@ -26,7 +26,7 @@ export const switchThumbVariants = cva(
|
|
|
26
26
|
"relative isolate block size-4 rounded-full [filter:var(--switch-thumb-filter)] transition-[transform,background-color,color,filter]",
|
|
27
27
|
"data-[state=unchecked]:bg-[var(--switch-thumb-default-color)] data-[state=unchecked]:translate-x-0",
|
|
28
28
|
"data-[state=checked]:bg-[var(--switch-thumb-active-color)] data-[state=checked]:translate-x-4",
|
|
29
|
-
"data-[state=unchecked]:text-[var(--state-
|
|
29
|
+
"data-[state=unchecked]:text-[var(--state-tertiary-hover-bg)] data-[state=checked]:text-[var(--state-primary-hover-bg)]",
|
|
30
30
|
"group-hover:[&_.switch-thumb-halo]:opacity-100 group-hover:data-[state=checked]:bg-[var(--switch-thumb-active-hover-color)] group-hover:data-[state=unchecked]:bg-[var(--switch-thumb-hover-color)]",
|
|
31
31
|
"group-disabled:!bg-[var(--switch-thumb-disabled-color)] group-disabled:[&_.switch-thumb-halo]:opacity-0",
|
|
32
32
|
],
|
|
@@ -9,10 +9,10 @@
|
|
|
9
9
|
| แหล่ง | Pattern | ตัวอย่าง |
|
|
10
10
|
|------|---------|----------|
|
|
11
11
|
| **Tailwind class** | `{utility}-{token}` | `bg-primary-stroke`, `text-secondary-default` |
|
|
12
|
-
| **Code CSS (runtime)** | `--state-
|
|
12
|
+
| **Code CSS (runtime)** | `--state-{base}-{state}` | `--state-secondary-stroke` |
|
|
13
13
|
| **Figma export (variable.css)** | `--{name}-{theme}` | `--state-secondary-stroke-skyller` |
|
|
14
14
|
|
|
15
|
-
> **Note:** Code
|
|
15
|
+
> **Note:** ปัจจุบัน Code และ Figma export ใช้ `--state-*` เหมือนกันแล้ว (ไม่มี "color")
|
|
16
16
|
|
|
17
17
|
---
|
|
18
18
|
|
|
@@ -24,16 +24,16 @@
|
|
|
24
24
|
|
|
25
25
|
| Tailwind class | CSS variable (code) | Figma path |
|
|
26
26
|
|----------------|-------------------|------------|
|
|
27
|
-
| `{base}` | `--state-
|
|
28
|
-
| `{base}-default` | `--state-
|
|
29
|
-
| `{base}-hover` | `--state-
|
|
30
|
-
| `{base}-stroke` | `--state-
|
|
31
|
-
| `{base}-hover-bg` | `--state-
|
|
32
|
-
| `{base}-pressed` | `--state-
|
|
33
|
-
| `{base}-active` | `--state-
|
|
34
|
-
| `{base}-text-solid` | `--state-
|
|
35
|
-
| `{base}-text-outline` | `--state-
|
|
36
|
-
| `{base}-text-pressed` | `--state-
|
|
27
|
+
| `{base}` | `--state-{base}-default` | `state/{base}/default` |
|
|
28
|
+
| `{base}-default` | `--state-{base}-default` | `state/{base}/default` |
|
|
29
|
+
| `{base}-hover` | `--state-{base}-hover` | `state/{base}/hover` |
|
|
30
|
+
| `{base}-stroke` | `--state-{base}-stroke` | `state/{base}/stroke` |
|
|
31
|
+
| `{base}-hover-bg` | `--state-{base}-hover-bg` | `state/{base}/hover-bg` |
|
|
32
|
+
| `{base}-pressed` | `--state-{base}-pressed` | `state/{base}/pressed` |
|
|
33
|
+
| `{base}-active` | `--state-{base}-active` | `state/{base}/active` |
|
|
34
|
+
| `{base}-text-solid` | `--state-{base}-text-solid` | `state/{base}/text-solid` |
|
|
35
|
+
| `{base}-text-outline` | `--state-{base}-text-outline` | `state/{base}/text-outline` |
|
|
36
|
+
| `{base}-text-pressed` | `--state-{base}-text-pressed` | `state/{base}/text-pressed` |
|
|
37
37
|
| `{base}-text-hover` | ⚠️ ไม่มีใน utils (มีใน state.css) | `state/{base}/text-hover` |
|
|
38
38
|
| `{base}-foreground` | `--{base}-foreground` | - |
|
|
39
39
|
| `{base}-{num}` | `--{variablePrefix}-{num}` | `ramps/{base}/{num}` |
|
|
@@ -42,15 +42,15 @@
|
|
|
42
42
|
|
|
43
43
|
| baseName | variablePrefix | range |
|
|
44
44
|
|----------|----------------|-------|
|
|
45
|
-
| primary |
|
|
46
|
-
| secondary |
|
|
47
|
-
| tertiary |
|
|
48
|
-
| grey |
|
|
49
|
-
| grey2 |
|
|
50
|
-
| info |
|
|
51
|
-
| success |
|
|
52
|
-
| warning |
|
|
53
|
-
| error |
|
|
45
|
+
| primary | ramps-primary | 5,10,20...150 |
|
|
46
|
+
| secondary | ramps-secondary | 5,10,20...150 |
|
|
47
|
+
| tertiary | ramps-tertiary | 5,10,20...150 |
|
|
48
|
+
| grey | ramps-grey | 5,10,20...150 |
|
|
49
|
+
| grey2 | ramps-grey2 | 50,100...950 |
|
|
50
|
+
| info | ramps-info | 50,100...950 |
|
|
51
|
+
| success | ramps-success | 50,100...950 |
|
|
52
|
+
| warning | ramps-warning | 50,100...950 |
|
|
53
|
+
| error | ramps-error | 50,100...950 |
|
|
54
54
|
|
|
55
55
|
---
|
|
56
56
|
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
|
|
59
59
|
| Tailwind class | CSS variable (code) | Figma (variable.css) |
|
|
60
60
|
|----------------|---------------------|----------------------|
|
|
61
|
-
| `{base}-transparent-8` | `--
|
|
61
|
+
| `{base}-transparent-8` | `--transparent-{base}-8` | `--transparency-{base}-8-{theme}` |
|
|
62
62
|
| `{base}-transparent-12` | ... | ... |
|
|
63
63
|
| `{base}-transparent-16` | ... | ... |
|
|
64
64
|
| `{base}-transparent-24` | ... | ... |
|
|
@@ -115,21 +115,21 @@
|
|
|
115
115
|
#### State disable
|
|
116
116
|
| Tailwind | CSS variable | Figma |
|
|
117
117
|
|----------|--------------|-------|
|
|
118
|
-
| state-disable-solid | --state-
|
|
119
|
-
| state-disable-outline | --state-
|
|
118
|
+
| state-disable-solid | --state-disable-solid | --state-disable-solid-{theme} |
|
|
119
|
+
| state-disable-outline | --state-disable-outline | --state-disable-outline-{theme} |
|
|
120
120
|
|
|
121
121
|
#### Input
|
|
122
122
|
| Tailwind | CSS variable | Figma |
|
|
123
123
|
|----------|--------------|-------|
|
|
124
|
-
| input-default-text | --input-
|
|
125
|
-
| input-default-stroke | --input-
|
|
126
|
-
| input-filled-text | --input-
|
|
127
|
-
| input-active-stroke | --input-
|
|
128
|
-
| input-disable-text | --input-
|
|
129
|
-
| input-disable-stroke | --input-
|
|
130
|
-
| input-disable-bg | --input-
|
|
131
|
-
| input-label-bg | --input-
|
|
132
|
-
| input-error | --input-
|
|
124
|
+
| input-default-text | --input-default-text | --input-default-text-{theme} |
|
|
125
|
+
| input-default-stroke | --input-default-stroke | --input-default-stroke-{theme} |
|
|
126
|
+
| input-filled-text | --input-filled-text | --input-filled-text-{theme} |
|
|
127
|
+
| input-active-stroke | --input-active-stroke | --input-active-stroke-{theme} |
|
|
128
|
+
| input-disable-text | --input-disable-text | --input-disable-text-{theme} |
|
|
129
|
+
| input-disable-stroke | --input-disable-stroke | --input-disable-stroke-{theme} |
|
|
130
|
+
| input-disable-bg | --input-disable-bg | --input-disable-bg-{theme} |
|
|
131
|
+
| input-label-bg | --input-label-bg | --input-label-bg-{theme} |
|
|
132
|
+
| input-error | --input-error | --input-error-{theme} |
|
|
133
133
|
|
|
134
134
|
#### Function
|
|
135
135
|
| Tailwind | CSS variable | Figma |
|
|
@@ -225,7 +225,6 @@
|
|
|
225
225
|
| `presets/colors.js` | Tailwind theme extend |
|
|
226
226
|
| `themes/variable_lasted.css` | **Figma export (source)** — imported in global.css |
|
|
227
227
|
| `themes/variable.css` | Figma export (legacy) |
|
|
228
|
-
| `themes/
|
|
229
|
-
| `themes/{theme}/
|
|
230
|
-
| `themes/{theme}/
|
|
231
|
-
| `themes/{theme}/transparent.css` | Maps transparency → var(--transparency-*-{theme}) |
|
|
228
|
+
| `themes/variable-mapping.css` | Maps unscoped runtime tokens → theme-scoped variables |
|
|
229
|
+
| `themes/{theme}/typography.css` | Theme-specific typography override |
|
|
230
|
+
| `themes/{theme}/components/*` | Theme-specific component overrides |
|
package/src/theme/global.css
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
@import "./tokens/baseline.css";
|
|
2
1
|
@import "./themes/variable.css";
|
|
3
|
-
@import "./themes/
|
|
4
|
-
@import "./
|
|
2
|
+
@import "./themes/variable-mapping.css";
|
|
3
|
+
@import "./tokens/color.css";
|
|
4
|
+
@import "./tokens/baseline.css";
|
|
5
|
+
|
|
6
|
+
/* TODO: remove this */
|
|
7
|
+
/* @import "./themes/xspector/baseline.css";
|
|
8
|
+
@import "./themes/skyller/baseline.css"; */
|
|
5
9
|
|
|
6
10
|
@tailwind base;
|
|
7
11
|
@tailwind components;
|
|
@@ -34,16 +34,16 @@ module.exports = {
|
|
|
34
34
|
"text-grey-light": withColorMixin("--text-grey-light"),
|
|
35
35
|
"text-white": withColorMixin("--text-white"),
|
|
36
36
|
|
|
37
|
-
...generateColorConfig("primary", "
|
|
38
|
-
...generateColorConfig("secondary", "
|
|
39
|
-
...generateColorConfig("tertiary", "
|
|
40
|
-
...generateColorConfig("grey", "
|
|
37
|
+
...generateColorConfig("primary", "ramps-primary"),
|
|
38
|
+
...generateColorConfig("secondary", "ramps-secondary"),
|
|
39
|
+
...generateColorConfig("tertiary", "ramps-tertiary"),
|
|
40
|
+
...generateColorConfig("grey", "ramps-grey"),
|
|
41
41
|
|
|
42
|
-
...generateColorConfig("grey2", "
|
|
43
|
-
...generateColorConfig("info", "
|
|
44
|
-
...generateColorConfig("success", "
|
|
45
|
-
...generateColorConfig("warning", "
|
|
46
|
-
...generateColorConfig("error", "
|
|
42
|
+
...generateColorConfig("grey2", "ramps-grey2", secondaryRange), // border-t-grey-transparent-24
|
|
43
|
+
...generateColorConfig("info", "ramps-info", secondaryRange),
|
|
44
|
+
...generateColorConfig("success", "ramps-success", secondaryRange),
|
|
45
|
+
...generateColorConfig("warning", "ramps-warning", secondaryRange),
|
|
46
|
+
...generateColorConfig("error", "ramps-error", secondaryRange),
|
|
47
47
|
|
|
48
48
|
...generateTransparentColorConfig("primary", "main"),
|
|
49
49
|
...generateTransparentColorConfig("secondary", "main"),
|
|
@@ -57,35 +57,33 @@ module.exports = {
|
|
|
57
57
|
...generateTransparentColorConfig("black", "other"),
|
|
58
58
|
...generateTransparentColorConfig("white", "other"),
|
|
59
59
|
|
|
60
|
-
"state-disable-solid": withColorMixin("--state-
|
|
61
|
-
"state-disable-outline": withColorMixin(
|
|
62
|
-
"--state-color-disable-outline"
|
|
63
|
-
),
|
|
60
|
+
"state-disable-solid": withColorMixin("--state-disable-solid"),
|
|
61
|
+
"state-disable-outline": withColorMixin("--state-disable-outline"),
|
|
64
62
|
|
|
65
|
-
"input-default-text": withColorMixin("--input-
|
|
66
|
-
"input-default-stroke": withColorMixin("--input-
|
|
67
|
-
"input-filled-text": withColorMixin("--input-
|
|
68
|
-
"input-active-stroke": withColorMixin("--input-
|
|
69
|
-
"input-disable-text": withColorMixin("--input-
|
|
70
|
-
"input-disable-stroke": withColorMixin("--input-
|
|
71
|
-
"input-disable-bg": withColorMixin("--input-
|
|
72
|
-
"input-label-bg": withColorMixin("--input-
|
|
73
|
-
"input-error": withColorMixin("--input-
|
|
63
|
+
"input-default-text": withColorMixin("--input-default-text"),
|
|
64
|
+
"input-default-stroke": withColorMixin("--input-default-stroke"),
|
|
65
|
+
"input-filled-text": withColorMixin("--input-filled-text"),
|
|
66
|
+
"input-active-stroke": withColorMixin("--input-active-stroke"),
|
|
67
|
+
"input-disable-text": withColorMixin("--input-disable-text"),
|
|
68
|
+
"input-disable-stroke": withColorMixin("--input-disable-stroke"),
|
|
69
|
+
"input-disable-bg": withColorMixin("--input-disable-bg"),
|
|
70
|
+
"input-label-bg": withColorMixin("--input-label-bg"),
|
|
71
|
+
"input-error": withColorMixin("--input-error"),
|
|
74
72
|
|
|
75
73
|
"function-default-solid": withColorMixin("--function-default-solid"),
|
|
76
74
|
"function-default-hover": withColorMixin("--function-default-hover"),
|
|
77
75
|
"function-default-hover-bg": withColorMixin(
|
|
78
|
-
"--function-default-hover-bg"
|
|
76
|
+
"--function-default-hover-bg",
|
|
79
77
|
),
|
|
80
78
|
"function-default-stroke": withColorMixin("--function-default-stroke"),
|
|
81
79
|
"function-default-icon": withColorMixin("--function-default-icon"),
|
|
82
80
|
"function-default-outline": withColorMixin(
|
|
83
|
-
"--function-default-outline-icon"
|
|
81
|
+
"--function-default-outline-icon",
|
|
84
82
|
),
|
|
85
83
|
"function-active-solid": withColorMixin("--function-active-solid"),
|
|
86
84
|
"function-active-hover": withColorMixin("--function-active-hover"),
|
|
87
85
|
"function-active-hover-bg": withColorMixin(
|
|
88
|
-
"--function-active-hover-bg"
|
|
86
|
+
"--function-active-hover-bg",
|
|
89
87
|
),
|
|
90
88
|
"function-active-stroke": withColorMixin("--function-active-stroke"),
|
|
91
89
|
"function-active-icon": withColorMixin("--function-active-icon"),
|
|
@@ -97,14 +95,14 @@ module.exports = {
|
|
|
97
95
|
"base-popup-highlight": withColorMixin("--base-color-popup-highlight"),
|
|
98
96
|
"base-popup-curtain": withColorMixin("--base-color-popup-curtain"),
|
|
99
97
|
"base-popup-foreground": withColorMixin(
|
|
100
|
-
"--base-color-popup-foreground"
|
|
98
|
+
"--base-color-popup-foreground",
|
|
101
99
|
),
|
|
102
100
|
"base-stroke": withColorMixin("--base-color-workspace-stroke"),
|
|
103
101
|
"base-workspace-stroke": withColorMixin(
|
|
104
|
-
"--base-color-workspace-stroke"
|
|
102
|
+
"--base-color-workspace-stroke",
|
|
105
103
|
),
|
|
106
104
|
"base-guideline-stroke": withColorMixin(
|
|
107
|
-
"--base-color-guideline-stroke"
|
|
105
|
+
"--base-color-guideline-stroke",
|
|
108
106
|
),
|
|
109
107
|
|
|
110
108
|
"common-white": withColorMixin("--common-white"),
|