@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.
Files changed (56) hide show
  1. package/dist/cjs/bundle.css +361 -355
  2. package/dist/cjs/bundle.js +171 -171
  3. package/dist/cjs/bundle.js.map +1 -1
  4. package/dist/cjs/types/utils/colors.d.ts +267 -267
  5. package/dist/components/Switch/Switch.styles.js +1 -1
  6. package/dist/esm/bundle.css +361 -355
  7. package/dist/esm/bundle.js +1 -1
  8. package/dist/esm/bundle.js.map +1 -1
  9. package/dist/esm/types/utils/colors.d.ts +267 -267
  10. package/dist/index.d.ts +267 -267
  11. package/dist/src/theme/global.css +2396 -2540
  12. package/dist/utils/colors.js +267 -267
  13. package/package.json +1 -1
  14. package/src/components/Button/Buttons.stories.tsx +15 -7
  15. package/src/components/Switch/Switch.styles.ts +1 -1
  16. package/src/theme/THEME_MAPPING.md +36 -37
  17. package/src/theme/global.css +7 -3
  18. package/src/theme/presets/colors.js +26 -28
  19. package/src/theme/themes/skyller/baseline.css +0 -4
  20. package/src/theme/themes/variable-mapping.css +1064 -0
  21. package/src/theme/themes/variable.css +248 -230
  22. package/src/theme/themes/xspector/baseline.css +0 -4
  23. package/src/theme/themes/xspector/components/dropdown-menu.css +4 -4
  24. package/src/theme/tokens/baseline.css +0 -3
  25. package/src/theme/tokens/color.css +34 -63
  26. package/src/theme/tokens/components/action-button.css +6 -6
  27. package/src/theme/tokens/components/button.css +189 -189
  28. package/src/theme/tokens/components/dropdown-menu.css +2 -2
  29. package/src/theme/tokens/components/footer.css +1 -1
  30. package/src/theme/tokens/components/switch.css +10 -10
  31. package/src/theme/tokens/typography.css +28 -28
  32. package/src/theme/tokens_old/baseline.css +13 -0
  33. package/src/theme/tokens_old/color.css +78 -0
  34. package/src/theme/tokens_old/components/action-button.css +127 -0
  35. package/src/theme/tokens_old/components/button.css +512 -0
  36. package/src/theme/tokens_old/components/dropdown-menu.css +27 -0
  37. package/src/theme/tokens_old/components/footer.css +9 -0
  38. package/src/theme/tokens_old/components/loading.css +11 -0
  39. package/src/theme/tokens_old/components/navbar.css +9 -0
  40. package/src/theme/tokens_old/components/progress-bar.css +8 -0
  41. package/src/theme/tokens_old/components/switch.css +29 -0
  42. package/src/theme/tokens_old/typography.css +199 -0
  43. package/src/theme/tokens_old/variables.css +28 -0
  44. package/src/theme/utils.js +16 -16
  45. package/src/utils/colors.ts +275 -278
  46. package/src/theme/themes/skyller/color.css +0 -79
  47. package/src/theme/themes/skyller/palette.css +0 -143
  48. package/src/theme/themes/skyller/state.css +0 -94
  49. package/src/theme/themes/skyller/transparent.css +0 -94
  50. package/src/theme/themes/xspector/color.css +0 -83
  51. package/src/theme/themes/xspector/palette.css +0 -142
  52. package/src/theme/themes/xspector/state.css +0 -94
  53. package/src/theme/themes/xspector/transparent.css +0 -93
  54. /package/src/theme/{tokens → tokens_old}/palette.css +0 -0
  55. /package/src/theme/{tokens → tokens_old}/state.css +0 -0
  56. /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
- "primary" | "secondary" | "tertiary" | "info" | "success" | "warning" | "error"
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<{ label: string; variant: "solid" | "outline" | "text"; }> =
201
- [
202
- { label: "Solid", variant: "solid" },
203
- { label: "Outline", variant: "outline" },
204
- { label: "Text", variant: "text" },
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-color-tertiary-hover-bg)] data-[state=checked]:text-[var(--state-color-primary-hover-bg)]",
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-color-{base}-{state}` | `--state-color-secondary-stroke` |
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 ใช้ `--state-color-*` (version เก่า), Figma export ใช้ `--state-*` (version ใหม่ ไม่มี "color")
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-color-{base}-default` | `state/{base}/default` |
28
- | `{base}-default` | `--state-color-{base}-default` | `state/{base}/default` |
29
- | `{base}-hover` | `--state-color-{base}-hover` | `state/{base}/hover` |
30
- | `{base}-stroke` | `--state-color-{base}-stroke` | `state/{base}/stroke` |
31
- | `{base}-hover-bg` | `--state-color-{base}-hover-bg` | `state/{base}/hover-bg` |
32
- | `{base}-pressed` | `--state-color-{base}-pressed` | `state/{base}/pressed` |
33
- | `{base}-active` | `--state-color-{base}-active` | `state/{base}/active` |
34
- | `{base}-text-solid` | `--state-color-{base}-text-solid` | `state/{base}/text-solid` |
35
- | `{base}-text-outline` | `--state-color-{base}-text-outline` | `state/{base}/text-outline` |
36
- | `{base}-text-pressed` | `--state-color-{base}-text-pressed` | `state/{base}/text-pressed` |
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 | primary-ramps-primary | 5,10,20...150 |
46
- | secondary | secondary-ramps-secondary | 5,10,20...150 |
47
- | tertiary | tertiary-ramps-tertiary | 5,10,20...150 |
48
- | grey | grey-grey | 5,10,20...150 |
49
- | grey2 | grey2-grey2 | 50,100...950 |
50
- | info | info-info | 50,100...950 |
51
- | success | success-success | 50,100...950 |
52
- | warning | warning-warning | 50,100...950 |
53
- | error | error-error | 50,100...950 |
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` | `--main-transparency-{base}-8` หรือ `--other-transparency-{base}-8` | `--transparency-{base}-8-{theme}` |
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-color-disable-solid | --state-disable-solid-{theme} |
119
- | state-disable-outline | --state-color-disable-outline | --state-disable-outline-{theme} |
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-color-default-text | --input-default-text-{theme} |
125
- | input-default-stroke | --input-color-default-stroke | --input-default-stroke-{theme} |
126
- | input-filled-text | --input-color-filled-text | --input-filled-text-{theme} |
127
- | input-active-stroke | --input-color-active-stroke | --input-active-stroke-{theme} |
128
- | input-disable-text | --input-color-disable-text | --input-disable-text-{theme} |
129
- | input-disable-stroke | --input-color-disable-stroke | --input-disable-stroke-{theme} |
130
- | input-disable-bg | --input-color-disable-bg | --input-disable-bg-{theme} |
131
- | input-label-bg | --input-color-label-bg | --input-label-bg-{theme} |
132
- | input-error | --input-color-error | --input-error-{theme} |
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/{theme}/state.css` | Maps --state-color-*var(--state-*-{theme}) |
229
- | `themes/{theme}/palette.css` | Maps ramps var(--ramps-*-{theme}) |
230
- | `themes/{theme}/color.css` | Maps semantic colors → var(--*-{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 |
@@ -1,7 +1,11 @@
1
- @import "./tokens/baseline.css";
2
1
  @import "./themes/variable.css";
3
- @import "./themes/xspector/baseline.css";
4
- @import "./themes/skyller/baseline.css";
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", "primary-ramps-primary"),
38
- ...generateColorConfig("secondary", "secondary-ramps-secondary"),
39
- ...generateColorConfig("tertiary", "tertiary-ramps-tertiary"),
40
- ...generateColorConfig("grey", "grey-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", "grey2-grey2", secondaryRange),
43
- ...generateColorConfig("info", "info-info", secondaryRange),
44
- ...generateColorConfig("success", "success-success", secondaryRange),
45
- ...generateColorConfig("warning", "warning-warning", secondaryRange),
46
- ...generateColorConfig("error", "error-error", secondaryRange),
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-color-disable-solid"),
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-color-default-text"),
66
- "input-default-stroke": withColorMixin("--input-color-default-stroke"),
67
- "input-filled-text": withColorMixin("--input-color-filled-text"),
68
- "input-active-stroke": withColorMixin("--input-color-active-stroke"),
69
- "input-disable-text": withColorMixin("--input-color-disable-text"),
70
- "input-disable-stroke": withColorMixin("--input-color-disable-stroke"),
71
- "input-disable-bg": withColorMixin("--input-color-disable-bg"),
72
- "input-label-bg": withColorMixin("--input-color-label-bg"),
73
- "input-error": withColorMixin("--input-color-error"),
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"),
@@ -1,6 +1,2 @@
1
- @import url(palette.css);
2
- @import url(state.css);
3
- @import url(color.css);
4
- @import url(transparent.css);
5
1
  @import url(typography.css);
6
2
  @import url(components/action-button.css);