@rovula/ui 0.1.0 → 0.1.2
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 +129 -0
- package/dist/cjs/bundle.js +9255 -3
- package/dist/cjs/bundle.js.map +1 -1
- package/dist/cjs/types/components/Dropdown/Dropdown.stories.d.ts +1 -0
- package/dist/cjs/types/components/Footer/Footer.d.ts +21 -0
- package/dist/cjs/types/components/Footer/Footer.stories.d.ts +45 -0
- package/dist/cjs/types/components/Footer/index.d.ts +2 -0
- package/dist/cjs/types/components/Icon/Icon.d.ts +1 -1
- package/dist/cjs/types/components/Icon/Icon.stories.d.ts +9 -1
- package/dist/cjs/types/components/InputFilter/InputFilter.stories.d.ts +1 -0
- package/dist/cjs/types/components/MaskedTextInput/MaskedTextInput.d.ts +1 -0
- package/dist/cjs/types/components/MaskedTextInput/MaskedTextInput.stories.d.ts +2 -0
- package/dist/cjs/types/components/Navbar/Navbar.d.ts +5 -0
- package/dist/cjs/types/components/Navbar/Navbar.stories.d.ts +14 -0
- package/dist/cjs/types/components/PasswordInput/PasswordInput.d.ts +19 -0
- package/dist/cjs/types/components/PasswordInput/PasswordInput.stories.d.ts +396 -0
- package/dist/cjs/types/components/PasswordInput/index.d.ts +2 -0
- package/dist/cjs/types/components/Search/Search.stories.d.ts +1 -0
- package/dist/cjs/types/components/TextInput/TextInput.d.ts +2 -0
- package/dist/cjs/types/components/TextInput/TextInput.stories.d.ts +10 -0
- package/dist/cjs/types/components/TextInput/TextInput.styles.d.ts +15 -0
- package/dist/cjs/types/icons/index.d.ts +1 -0
- package/dist/cjs/types/icons/lucideIconNames.d.ts +9 -0
- package/dist/cjs/types/index.d.ts +7 -1
- package/dist/cjs/types/utils/colors.d.ts +330 -0
- package/dist/components/Footer/Footer.js +11 -0
- package/dist/components/Footer/Footer.stories.js +34 -0
- package/dist/components/Footer/index.js +2 -0
- package/dist/components/Icon/Icon.js +28 -11
- package/dist/components/Icon/Icon.stories.js +39 -0
- package/dist/components/Navbar/Navbar.js +18 -4
- package/dist/components/Navbar/Navbar.stories.js +16 -9
- package/dist/components/PasswordInput/PasswordInput.js +36 -0
- package/dist/components/PasswordInput/PasswordInput.stories.js +67 -0
- package/dist/components/PasswordInput/index.js +1 -0
- package/dist/components/TextArea/TextArea.styles.js +1 -1
- package/dist/components/TextInput/TextInput.js +33 -24
- package/dist/components/TextInput/TextInput.stories.js +14 -2
- package/dist/components/TextInput/TextInput.styles.js +25 -10
- package/dist/esm/bundle.css +129 -0
- package/dist/esm/bundle.js +9255 -3
- package/dist/esm/bundle.js.map +1 -1
- package/dist/esm/types/components/Dropdown/Dropdown.stories.d.ts +1 -0
- package/dist/esm/types/components/Footer/Footer.d.ts +21 -0
- package/dist/esm/types/components/Footer/Footer.stories.d.ts +45 -0
- package/dist/esm/types/components/Footer/index.d.ts +2 -0
- package/dist/esm/types/components/Icon/Icon.d.ts +1 -1
- package/dist/esm/types/components/Icon/Icon.stories.d.ts +9 -1
- package/dist/esm/types/components/InputFilter/InputFilter.stories.d.ts +1 -0
- package/dist/esm/types/components/MaskedTextInput/MaskedTextInput.d.ts +1 -0
- package/dist/esm/types/components/MaskedTextInput/MaskedTextInput.stories.d.ts +2 -0
- package/dist/esm/types/components/Navbar/Navbar.d.ts +5 -0
- package/dist/esm/types/components/Navbar/Navbar.stories.d.ts +14 -0
- package/dist/esm/types/components/PasswordInput/PasswordInput.d.ts +19 -0
- package/dist/esm/types/components/PasswordInput/PasswordInput.stories.d.ts +396 -0
- package/dist/esm/types/components/PasswordInput/index.d.ts +2 -0
- package/dist/esm/types/components/Search/Search.stories.d.ts +1 -0
- package/dist/esm/types/components/TextInput/TextInput.d.ts +2 -0
- package/dist/esm/types/components/TextInput/TextInput.stories.d.ts +10 -0
- package/dist/esm/types/components/TextInput/TextInput.styles.d.ts +15 -0
- package/dist/esm/types/icons/index.d.ts +1 -0
- package/dist/esm/types/icons/lucideIconNames.d.ts +9 -0
- package/dist/esm/types/index.d.ts +7 -1
- package/dist/esm/types/utils/colors.d.ts +330 -0
- package/dist/icons/index.js +1 -0
- package/dist/icons/lucideIconNames.js +12 -0
- package/dist/index.d.ts +389 -2
- package/dist/index.js +4 -0
- package/dist/src/theme/global.css +200 -24
- package/dist/utils/colors.js +369 -0
- package/package.json +2 -1
- package/src/components/Footer/Footer.stories.tsx +119 -0
- package/src/components/Footer/Footer.tsx +122 -0
- package/src/components/Footer/index.ts +3 -0
- package/src/components/Icon/Icon.stories.tsx +89 -0
- package/src/components/Icon/Icon.tsx +44 -23
- package/src/components/Navbar/Navbar.stories.tsx +109 -55
- package/src/components/Navbar/Navbar.tsx +41 -3
- package/src/components/PasswordInput/PasswordInput.stories.tsx +111 -0
- package/src/components/PasswordInput/PasswordInput.tsx +50 -0
- package/src/components/PasswordInput/index.ts +2 -0
- package/src/components/TextArea/TextArea.styles.ts +1 -1
- package/src/components/TextInput/TextInput.stories.tsx +60 -2
- package/src/components/TextInput/TextInput.styles.ts +36 -19
- package/src/components/TextInput/TextInput.tsx +83 -55
- package/src/icons/index.ts +1 -0
- package/src/icons/lucideIconNames.ts +14 -0
- package/src/index.ts +15 -1
- package/src/theme/themes/skyller/typography.css +24 -24
- package/src/theme/tokens/baseline.css +1 -0
- package/src/theme/tokens/components/footer.css +9 -0
- package/src/theme/tokens/components/navbar.css +2 -1
- package/src/types/lucide-react.d.ts +5 -0
- package/src/utils/colors.ts +383 -0
package/dist/utils/colors.js
CHANGED
|
@@ -1,3 +1,372 @@
|
|
|
1
|
+
/** CSS variable names for theme colors (resolved by data-theme) */
|
|
2
|
+
export const THEME_COLOR_KEYS = {
|
|
3
|
+
/* ----- Palette: Primary ----- */
|
|
4
|
+
"primary-5": "--primary-ramps-primary-5",
|
|
5
|
+
"primary-10": "--primary-ramps-primary-10",
|
|
6
|
+
"primary-20": "--primary-ramps-primary-20",
|
|
7
|
+
"primary-30": "--primary-ramps-primary-30",
|
|
8
|
+
"primary-40": "--primary-ramps-primary-40",
|
|
9
|
+
"primary-50": "--primary-ramps-primary-50",
|
|
10
|
+
"primary-60": "--primary-ramps-primary-60",
|
|
11
|
+
"primary-70": "--primary-ramps-primary-70",
|
|
12
|
+
"primary-80": "--primary-ramps-primary-80",
|
|
13
|
+
"primary-90": "--primary-ramps-primary-90",
|
|
14
|
+
"primary-100": "--primary-ramps-primary-100",
|
|
15
|
+
"primary-110": "--primary-ramps-primary-110",
|
|
16
|
+
"primary-120": "--primary-ramps-primary-120",
|
|
17
|
+
"primary-130": "--primary-ramps-primary-130",
|
|
18
|
+
"primary-140": "--primary-ramps-primary-140",
|
|
19
|
+
"primary-150": "--primary-ramps-primary-150",
|
|
20
|
+
/* ----- Palette: Secondary ----- */
|
|
21
|
+
"secondary-5": "--secondary-ramps-secondary-5",
|
|
22
|
+
"secondary-10": "--secondary-ramps-secondary-10",
|
|
23
|
+
"secondary-20": "--secondary-ramps-secondary-20",
|
|
24
|
+
"secondary-30": "--secondary-ramps-secondary-30",
|
|
25
|
+
"secondary-40": "--secondary-ramps-secondary-40",
|
|
26
|
+
"secondary-50": "--secondary-ramps-secondary-50",
|
|
27
|
+
"secondary-60": "--secondary-ramps-secondary-60",
|
|
28
|
+
"secondary-70": "--secondary-ramps-secondary-70",
|
|
29
|
+
"secondary-80": "--secondary-ramps-secondary-80",
|
|
30
|
+
"secondary-90": "--secondary-ramps-secondary-90",
|
|
31
|
+
"secondary-100": "--secondary-ramps-secondary-100",
|
|
32
|
+
"secondary-110": "--secondary-ramps-secondary-110",
|
|
33
|
+
"secondary-120": "--secondary-ramps-secondary-120",
|
|
34
|
+
"secondary-130": "--secondary-ramps-secondary-130",
|
|
35
|
+
"secondary-140": "--secondary-ramps-secondary-140",
|
|
36
|
+
"secondary-150": "--secondary-ramps-secondary-150",
|
|
37
|
+
/* ----- Palette: Tertiary ----- */
|
|
38
|
+
"tertiary-5": "--tertiary-ramps-tertiary-5",
|
|
39
|
+
"tertiary-10": "--tertiary-ramps-tertiary-10",
|
|
40
|
+
"tertiary-20": "--tertiary-ramps-tertiary-20",
|
|
41
|
+
"tertiary-30": "--tertiary-ramps-tertiary-30",
|
|
42
|
+
"tertiary-40": "--tertiary-ramps-tertiary-40",
|
|
43
|
+
"tertiary-50": "--tertiary-ramps-tertiary-50",
|
|
44
|
+
"tertiary-60": "--tertiary-ramps-tertiary-60",
|
|
45
|
+
"tertiary-70": "--tertiary-ramps-tertiary-70",
|
|
46
|
+
"tertiary-80": "--tertiary-ramps-tertiary-80",
|
|
47
|
+
"tertiary-90": "--tertiary-ramps-tertiary-90",
|
|
48
|
+
"tertiary-100": "--tertiary-ramps-tertiary-100",
|
|
49
|
+
"tertiary-110": "--tertiary-ramps-tertiary-110",
|
|
50
|
+
"tertiary-120": "--tertiary-ramps-tertiary-120",
|
|
51
|
+
"tertiary-130": "--tertiary-ramps-tertiary-130",
|
|
52
|
+
"tertiary-140": "--tertiary-ramps-tertiary-140",
|
|
53
|
+
"tertiary-150": "--tertiary-ramps-tertiary-150",
|
|
54
|
+
/* ----- Palette: Grey ----- */
|
|
55
|
+
"grey-5": "--grey-grey-5",
|
|
56
|
+
"grey-10": "--grey-grey-10",
|
|
57
|
+
"grey-20": "--grey-grey-20",
|
|
58
|
+
"grey-30": "--grey-grey-30",
|
|
59
|
+
"grey-40": "--grey-grey-40",
|
|
60
|
+
"grey-50": "--grey-grey-50",
|
|
61
|
+
"grey-60": "--grey-grey-60",
|
|
62
|
+
"grey-70": "--grey-grey-70",
|
|
63
|
+
"grey-80": "--grey-grey-80",
|
|
64
|
+
"grey-90": "--grey-grey-90",
|
|
65
|
+
"grey-100": "--grey-grey-100",
|
|
66
|
+
"grey-110": "--grey-grey-110",
|
|
67
|
+
"grey-120": "--grey-grey-120",
|
|
68
|
+
"grey-130": "--grey-grey-130",
|
|
69
|
+
"grey-140": "--grey-grey-140",
|
|
70
|
+
"grey-150": "--grey-grey-150",
|
|
71
|
+
/* ----- Palette: Grey2 ----- */
|
|
72
|
+
"grey2-50": "--grey2-grey2-50",
|
|
73
|
+
"grey2-100": "--grey2-grey2-100",
|
|
74
|
+
"grey2-200": "--grey2-grey2-200",
|
|
75
|
+
"grey2-300": "--grey2-grey2-300",
|
|
76
|
+
"grey2-400": "--grey2-grey2-400",
|
|
77
|
+
"grey2-500": "--grey2-grey2-500",
|
|
78
|
+
"grey2-600": "--grey2-grey2-600",
|
|
79
|
+
"grey2-700": "--grey2-grey2-700",
|
|
80
|
+
"grey2-800": "--grey2-grey2-800",
|
|
81
|
+
"grey2-900": "--grey2-grey2-900",
|
|
82
|
+
"grey2-950": "--grey2-grey2-950",
|
|
83
|
+
/* ----- Palette: Info, Success, Warning, Error ----- */
|
|
84
|
+
"info-50": "--info-info-50",
|
|
85
|
+
"info-100": "--info-info-100",
|
|
86
|
+
"info-200": "--info-info-200",
|
|
87
|
+
"info-300": "--info-info-300",
|
|
88
|
+
"info-400": "--info-info-400",
|
|
89
|
+
"info-500": "--info-info-500",
|
|
90
|
+
"info-600": "--info-info-600",
|
|
91
|
+
"info-700": "--info-info-700",
|
|
92
|
+
"info-800": "--info-info-800",
|
|
93
|
+
"info-900": "--info-info-900",
|
|
94
|
+
"info-950": "--info-info-950",
|
|
95
|
+
"success-50": "--success-success-50",
|
|
96
|
+
"success-100": "--success-success-100",
|
|
97
|
+
"success-200": "--success-success-200",
|
|
98
|
+
"success-300": "--success-success-300",
|
|
99
|
+
"success-400": "--success-success-400",
|
|
100
|
+
"success-500": "--success-success-500",
|
|
101
|
+
"success-600": "--success-success-600",
|
|
102
|
+
"success-700": "--success-success-700",
|
|
103
|
+
"success-800": "--success-success-800",
|
|
104
|
+
"success-900": "--success-success-900",
|
|
105
|
+
"success-950": "--success-success-950",
|
|
106
|
+
"warning-50": "--warning-warning-50",
|
|
107
|
+
"warning-100": "--warning-warning-100",
|
|
108
|
+
"warning-200": "--warning-warning-200",
|
|
109
|
+
"warning-300": "--warning-warning-300",
|
|
110
|
+
"warning-400": "--warning-warning-400",
|
|
111
|
+
"warning-500": "--warning-warning-500",
|
|
112
|
+
"warning-600": "--warning-warning-600",
|
|
113
|
+
"warning-700": "--warning-warning-700",
|
|
114
|
+
"warning-800": "--warning-warning-800",
|
|
115
|
+
"warning-900": "--warning-warning-900",
|
|
116
|
+
"warning-950": "--warning-warning-950",
|
|
117
|
+
"error-50": "--error-error-50",
|
|
118
|
+
"error-100": "--error-error-100",
|
|
119
|
+
"error-200": "--error-error-200",
|
|
120
|
+
"error-300": "--error-error-300",
|
|
121
|
+
"error-400": "--error-error-400",
|
|
122
|
+
"error-500": "--error-error-500",
|
|
123
|
+
"error-600": "--error-error-600",
|
|
124
|
+
"error-700": "--error-error-700",
|
|
125
|
+
"error-800": "--error-error-800",
|
|
126
|
+
"error-900": "--error-error-900",
|
|
127
|
+
"error-950": "--error-error-950",
|
|
128
|
+
/* ----- State: Primary ----- */
|
|
129
|
+
primary: "--state-color-primary-default",
|
|
130
|
+
"primary-hover": "--state-color-primary-hover",
|
|
131
|
+
"primary-stroke": "--state-color-primary-stroke",
|
|
132
|
+
"primary-hover-bg": "--state-color-primary-hover-bg",
|
|
133
|
+
"primary-pressed": "--state-color-primary-pressed",
|
|
134
|
+
"primary-active": "--state-color-primary-active",
|
|
135
|
+
"primary-text-solid": "--state-color-primary-text-solid",
|
|
136
|
+
"primary-text-outline": "--state-color-primary-text-outline",
|
|
137
|
+
"primary-text-hover": "--state-color-primary-text-hover",
|
|
138
|
+
"primary-text-pressed": "--state-color-primary-text-pressed",
|
|
139
|
+
/* ----- State: Secondary ----- */
|
|
140
|
+
secondary: "--state-color-secondary-default",
|
|
141
|
+
"secondary-hover": "--state-color-secondary-hover",
|
|
142
|
+
"secondary-stroke": "--state-color-secondary-stroke",
|
|
143
|
+
"secondary-hover-bg": "--state-color-secondary-hover-bg",
|
|
144
|
+
"secondary-pressed": "--state-color-secondary-pressed",
|
|
145
|
+
"secondary-active": "--state-color-secondary-active",
|
|
146
|
+
"secondary-text-solid": "--state-color-secondary-text-solid",
|
|
147
|
+
"secondary-text-outline": "--state-color-secondary-text-outline",
|
|
148
|
+
"secondary-text-hover": "--state-color-secondary-text-hover",
|
|
149
|
+
"secondary-text-pressed": "--state-color-secondary-text-pressed",
|
|
150
|
+
/* ----- State: Tertiary ----- */
|
|
151
|
+
tertiary: "--state-color-tertiary-default",
|
|
152
|
+
"tertiary-hover": "--state-color-tertiary-hover",
|
|
153
|
+
"tertiary-stroke": "--state-color-tertiary-stroke",
|
|
154
|
+
"tertiary-hover-bg": "--state-color-tertiary-hover-bg",
|
|
155
|
+
"tertiary-pressed": "--state-color-tertiary-pressed",
|
|
156
|
+
"tertiary-active": "--state-color-tertiary-active",
|
|
157
|
+
"tertiary-text-solid": "--state-color-tertiary-text-solid",
|
|
158
|
+
"tertiary-text-outline": "--state-color-tertiary-text-outline",
|
|
159
|
+
"tertiary-text-hover": "--state-color-tertiary-text-hover",
|
|
160
|
+
"tertiary-text-pressed": "--state-color-tertiary-text-pressed",
|
|
161
|
+
/* ----- State: Info ----- */
|
|
162
|
+
info: "--state-color-info-default",
|
|
163
|
+
"info-hover": "--state-color-info-hover",
|
|
164
|
+
"info-stroke": "--state-color-info-stroke",
|
|
165
|
+
"info-hover-bg": "--state-color-info-hover-bg",
|
|
166
|
+
"info-pressed": "--state-color-info-pressed",
|
|
167
|
+
"info-active": "--state-color-info-active",
|
|
168
|
+
"info-text-solid": "--state-color-info-text-solid",
|
|
169
|
+
"info-text-outline": "--state-color-info-text-outline",
|
|
170
|
+
"info-text-hover": "--state-color-info-text-hover",
|
|
171
|
+
"info-text-pressed": "--state-color-info-text-pressed",
|
|
172
|
+
/* ----- State: Success ----- */
|
|
173
|
+
success: "--state-color-success-default",
|
|
174
|
+
"success-hover": "--state-color-success-hover",
|
|
175
|
+
"success-stroke": "--state-color-success-stroke",
|
|
176
|
+
"success-hover-bg": "--state-color-success-hover-bg",
|
|
177
|
+
"success-pressed": "--state-color-success-pressed",
|
|
178
|
+
"success-active": "--state-color-success-active",
|
|
179
|
+
"success-text-solid": "--state-color-success-text-solid",
|
|
180
|
+
"success-text-outline": "--state-color-success-text-outline",
|
|
181
|
+
"success-text-hover": "--state-color-success-text-hover",
|
|
182
|
+
"success-text-pressed": "--state-color-success-text-pressed",
|
|
183
|
+
/* ----- State: Warning ----- */
|
|
184
|
+
warning: "--state-color-warning-default",
|
|
185
|
+
"warning-hover": "--state-color-warning-hover",
|
|
186
|
+
"warning-stroke": "--state-color-warning-stroke",
|
|
187
|
+
"warning-hover-bg": "--state-color-warning-hover-bg",
|
|
188
|
+
"warning-pressed": "--state-color-warning-pressed",
|
|
189
|
+
"warning-active": "--state-color-warning-active",
|
|
190
|
+
"warning-text-solid": "--state-color-warning-text-solid",
|
|
191
|
+
"warning-text-outline": "--state-color-warning-text-outline",
|
|
192
|
+
"warning-text-hover": "--state-color-warning-text-hover",
|
|
193
|
+
"warning-text-pressed": "--state-color-warning-text-pressed",
|
|
194
|
+
/* ----- State: Error ----- */
|
|
195
|
+
error: "--state-color-error-default",
|
|
196
|
+
"error-hover": "--state-color-error-hover",
|
|
197
|
+
"error-stroke": "--state-color-error-stroke",
|
|
198
|
+
"error-hover-bg": "--state-color-error-hover-bg",
|
|
199
|
+
"error-pressed": "--state-color-error-pressed",
|
|
200
|
+
"error-active": "--state-color-error-active",
|
|
201
|
+
"error-text-solid": "--state-color-error-text-solid",
|
|
202
|
+
"error-text-outline": "--state-color-error-text-outline",
|
|
203
|
+
"error-text-hover": "--state-color-error-text-hover",
|
|
204
|
+
"error-text-pressed": "--state-color-error-text-pressed",
|
|
205
|
+
/* ----- State: Disable ----- */
|
|
206
|
+
"disable-solid": "--state-color-disable-solid",
|
|
207
|
+
"disable-outline": "--state-color-disable-outline",
|
|
208
|
+
/* ----- Text ----- */
|
|
209
|
+
"text-black": "--text-black",
|
|
210
|
+
"text-dark": "--text-dark",
|
|
211
|
+
"text-medium": "--text-medium",
|
|
212
|
+
"text-light": "--text-light",
|
|
213
|
+
"text-grey-dark": "--text-grey-dark",
|
|
214
|
+
"text-grey-medium": "--text-grey-medium",
|
|
215
|
+
"text-grey-light": "--text-grey-light",
|
|
216
|
+
"text-white": "--text-white",
|
|
217
|
+
/* ----- Input ----- */
|
|
218
|
+
"input-default-text": "--input-color-default-text",
|
|
219
|
+
"input-default-stroke": "--input-color-default-stroke",
|
|
220
|
+
"input-filled-text": "--input-color-filled-text",
|
|
221
|
+
"input-active-stroke": "--input-color-active-stroke",
|
|
222
|
+
"input-disable-text": "--input-color-disable-text",
|
|
223
|
+
"input-disable-stroke": "--input-color-disable-stroke",
|
|
224
|
+
"input-disable-bg": "--input-color-disable-bg",
|
|
225
|
+
"input-label-bg": "--input-color-label-bg",
|
|
226
|
+
"input-error": "--input-color-error",
|
|
227
|
+
/* ----- Function button ----- */
|
|
228
|
+
"function-default-solid": "--function-default-solid",
|
|
229
|
+
"function-default-hover": "--function-default-hover",
|
|
230
|
+
"function-default-hover-bg": "--function-default-hover-bg",
|
|
231
|
+
"function-default-stroke": "--function-default-stroke",
|
|
232
|
+
"function-default-icon": "--function-default-icon",
|
|
233
|
+
"function-default-outline-icon": "--function-default-outline-icon",
|
|
234
|
+
"function-active-solid": "--function-active-solid",
|
|
235
|
+
"function-active-hover": "--function-active-hover",
|
|
236
|
+
"function-active-hover-bg": "--function-active-hover-bg",
|
|
237
|
+
"function-active-stroke": "--function-active-stroke",
|
|
238
|
+
"function-active-icon": "--function-active-icon",
|
|
239
|
+
/* ----- Base ----- */
|
|
240
|
+
"base-bg": "--base-color-bg",
|
|
241
|
+
"base-bg2": "--base-color-bg2",
|
|
242
|
+
"base-bg3": "--base-color-bg3",
|
|
243
|
+
"base-workspace-stroke": "--base-color-workspace-stroke",
|
|
244
|
+
"base-guideline-stroke": "--base-color-guideline-stroke",
|
|
245
|
+
"base-popup": "--base-color-popup",
|
|
246
|
+
"base-popup-highlight": "--base-color-popup-hightlight",
|
|
247
|
+
"base-popup-curtain": "--base-color-popup-curtain",
|
|
248
|
+
"base-popup-foreground": "--base-color-popup-foreground",
|
|
249
|
+
/* ----- Common ----- */
|
|
250
|
+
"common-white": "--common-white",
|
|
251
|
+
"common-black": "--common-black",
|
|
252
|
+
/* ----- Semantic ----- */
|
|
253
|
+
background: "--background",
|
|
254
|
+
foreground: "--foreground",
|
|
255
|
+
surface: "--surface",
|
|
256
|
+
"surface-foreground": "--surface-foreground",
|
|
257
|
+
"primary-foreground": "--primary-foreground",
|
|
258
|
+
"secondary-foreground": "--secondary-foreground",
|
|
259
|
+
"tertiary-foreground": "--tertiary-foreground",
|
|
260
|
+
"info-foreground": "--info-foreground",
|
|
261
|
+
"success-foreground": "--success-foreground",
|
|
262
|
+
"warning-foreground": "--warning-foreground",
|
|
263
|
+
"error-foreground": "--error-foreground",
|
|
264
|
+
"grey-foreground": "--grey-foreground",
|
|
265
|
+
"grey2-foreground": "--grey2-foreground",
|
|
266
|
+
/* ----- Transparency: Primary ----- */
|
|
267
|
+
"primary-transparent-8": "--main-transparency-primary-8",
|
|
268
|
+
"primary-transparent-12": "--main-transparency-primary-12",
|
|
269
|
+
"primary-transparent-16": "--main-transparency-primary-16",
|
|
270
|
+
"primary-transparent-24": "--main-transparency-primary-24",
|
|
271
|
+
"primary-transparent-32": "--main-transparency-primary-32",
|
|
272
|
+
"primary-transparent-48": "--main-transparency-primary-48",
|
|
273
|
+
/* ----- Transparency: Secondary ----- */
|
|
274
|
+
"secondary-transparent-8": "--main-transparency-secondary-8",
|
|
275
|
+
"secondary-transparent-12": "--main-transparency-secondary-12",
|
|
276
|
+
"secondary-transparent-16": "--main-transparency-secondary-16",
|
|
277
|
+
"secondary-transparent-24": "--main-transparency-secondary-24",
|
|
278
|
+
"secondary-transparent-32": "--main-transparency-secondary-32",
|
|
279
|
+
"secondary-transparent-48": "--main-transparency-secondary-48",
|
|
280
|
+
/* ----- Transparency: Tertiary ----- */
|
|
281
|
+
"tertiary-transparent-8": "--main-transparency-tertiary-8",
|
|
282
|
+
"tertiary-transparent-12": "--main-transparency-tertiary-12",
|
|
283
|
+
"tertiary-transparent-16": "--main-transparency-tertiary-16",
|
|
284
|
+
"tertiary-transparent-24": "--main-transparency-tertiary-24",
|
|
285
|
+
"tertiary-transparent-32": "--main-transparency-tertiary-32",
|
|
286
|
+
"tertiary-transparent-48": "--main-transparency-tertiary-48",
|
|
287
|
+
/* ----- Transparency: Info, Success, Warning, Error, Grey, Grey2 ----- */
|
|
288
|
+
"info-transparent-8": "--other-transparency-info-8",
|
|
289
|
+
"info-transparent-12": "--other-transparency-info-12",
|
|
290
|
+
"info-transparent-16": "--other-transparency-info-16",
|
|
291
|
+
"info-transparent-24": "--other-transparency-info-24",
|
|
292
|
+
"info-transparent-32": "--other-transparency-info-32",
|
|
293
|
+
"info-transparent-48": "--other-transparency-info-48",
|
|
294
|
+
"success-transparent-8": "--other-transparency-success-8",
|
|
295
|
+
"success-transparent-12": "--other-transparency-success-12",
|
|
296
|
+
"success-transparent-16": "--other-transparency-success-16",
|
|
297
|
+
"success-transparent-24": "--other-transparency-success-24",
|
|
298
|
+
"success-transparent-32": "--other-transparency-success-32",
|
|
299
|
+
"success-transparent-48": "--other-transparency-success-48",
|
|
300
|
+
"warning-transparent-8": "--other-transparency-warning-8",
|
|
301
|
+
"warning-transparent-12": "--other-transparency-warning-12",
|
|
302
|
+
"warning-transparent-16": "--other-transparency-warning-16",
|
|
303
|
+
"warning-transparent-24": "--other-transparency-warning-24",
|
|
304
|
+
"warning-transparent-32": "--other-transparency-warning-32",
|
|
305
|
+
"warning-transparent-48": "--other-transparency-warning-48",
|
|
306
|
+
"error-transparent-8": "--other-transparency-error-8",
|
|
307
|
+
"error-transparent-12": "--other-transparency-error-12",
|
|
308
|
+
"error-transparent-16": "--other-transparency-error-16",
|
|
309
|
+
"error-transparent-24": "--other-transparency-error-24",
|
|
310
|
+
"error-transparent-32": "--other-transparency-error-32",
|
|
311
|
+
"error-transparent-48": "--other-transparency-error-48",
|
|
312
|
+
"grey-transparent-8": "--other-transparency-grey-8",
|
|
313
|
+
"grey-transparent-12": "--other-transparency-grey-12",
|
|
314
|
+
"grey-transparent-16": "--other-transparency-grey-16",
|
|
315
|
+
"grey-transparent-24": "--other-transparency-grey-24",
|
|
316
|
+
"grey-transparent-32": "--other-transparency-grey-32",
|
|
317
|
+
"grey-transparent-48": "--other-transparency-grey-48",
|
|
318
|
+
"grey2-transparent-8": "--other-transparency-grey2-8",
|
|
319
|
+
"grey2-transparent-12": "--other-transparency-grey2-12",
|
|
320
|
+
"grey2-transparent-16": "--other-transparency-grey2-16",
|
|
321
|
+
"grey2-transparent-24": "--other-transparency-grey2-24",
|
|
322
|
+
"grey2-transparent-32": "--other-transparency-grey2-32",
|
|
323
|
+
"grey2-transparent-48": "--other-transparency-grey2-48",
|
|
324
|
+
/* ----- Transparency: White, Black ----- */
|
|
325
|
+
"white-transparent-8": "--other-transparency-white-08",
|
|
326
|
+
"white-transparent-12": "--other-transparency-white-12",
|
|
327
|
+
"white-transparent-16": "--other-transparency-white-16",
|
|
328
|
+
"white-transparent-24": "--other-transparency-white-24",
|
|
329
|
+
"white-transparent-32": "--other-transparency-white-32",
|
|
330
|
+
"white-transparent-48": "--other-transparency-white-48",
|
|
331
|
+
"black-transparent-8": "--other-transparency-black-08",
|
|
332
|
+
"black-transparent-12": "--other-transparency-black-12",
|
|
333
|
+
"black-transparent-16": "--other-transparency-black-16",
|
|
334
|
+
"black-transparent-24": "--other-transparency-black-24",
|
|
335
|
+
"black-transparent-32": "--other-transparency-black-32",
|
|
336
|
+
"black-transparent-48": "--other-transparency-black-48",
|
|
337
|
+
};
|
|
338
|
+
/**
|
|
339
|
+
* Get computed color value from a CSS variable (respects current theme).
|
|
340
|
+
* Use in browser only; returns empty string during SSR.
|
|
341
|
+
*
|
|
342
|
+
* @example
|
|
343
|
+
* const primary = getThemeColor('primary');
|
|
344
|
+
* const hex = getThemeColor('--primary-ramps-primary-100');
|
|
345
|
+
*/
|
|
346
|
+
export function getThemeColor(keyOrVar, element = document) {
|
|
347
|
+
if (typeof window === "undefined")
|
|
348
|
+
return "";
|
|
349
|
+
const root = element instanceof Document ? element.documentElement : element;
|
|
350
|
+
const varName = keyOrVar in THEME_COLOR_KEYS
|
|
351
|
+
? THEME_COLOR_KEYS[keyOrVar]
|
|
352
|
+
: keyOrVar.startsWith("--")
|
|
353
|
+
? keyOrVar
|
|
354
|
+
: `--${keyOrVar}`;
|
|
355
|
+
return getComputedStyle(root).getPropertyValue(varName).trim();
|
|
356
|
+
}
|
|
357
|
+
/**
|
|
358
|
+
* Get multiple theme colors as a JS object.
|
|
359
|
+
*
|
|
360
|
+
* @example
|
|
361
|
+
* const colors = getThemeColors();
|
|
362
|
+
* // { primary: '#2563eb', secondary: '#60a5fa', ... }
|
|
363
|
+
*/
|
|
364
|
+
export function getThemeColors(keys = Object.keys(THEME_COLOR_KEYS), element) {
|
|
365
|
+
return keys.reduce((acc, key) => {
|
|
366
|
+
acc[key] = getThemeColor(key, element);
|
|
367
|
+
return acc;
|
|
368
|
+
}, {});
|
|
369
|
+
}
|
|
1
370
|
export const srgbToHex = (color) => {
|
|
2
371
|
if (color.startsWith("color(")) {
|
|
3
372
|
const rgbValues = color.match(/([\d.]+)/g);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rovula/ui",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"main": "dist/cjs/bundle.js",
|
|
5
5
|
"module": "dist/esm/bundle.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -77,6 +77,7 @@
|
|
|
77
77
|
"dependencies": {
|
|
78
78
|
"@headlessui/react": "^2.0.3",
|
|
79
79
|
"@heroicons/react": "^2.1.3",
|
|
80
|
+
"lucide-react": "^0.460.0",
|
|
80
81
|
"@radix-ui/react-alert-dialog": "^1.0.5",
|
|
81
82
|
"@radix-ui/react-avatar": "^1.1.0",
|
|
82
83
|
"@radix-ui/react-checkbox": "^1.0.4",
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
3
|
+
|
|
4
|
+
import Footer from "./Footer";
|
|
5
|
+
|
|
6
|
+
const meta = {
|
|
7
|
+
title: "Components/Footer",
|
|
8
|
+
component: Footer,
|
|
9
|
+
tags: ["autodocs"],
|
|
10
|
+
parameters: {
|
|
11
|
+
layout: "fullscreen",
|
|
12
|
+
},
|
|
13
|
+
decorators: [
|
|
14
|
+
(Story) => (
|
|
15
|
+
<div className="p-5 w-full h-screen flex flex-col">
|
|
16
|
+
<div className="flex-1">Page content</div>
|
|
17
|
+
<Story />
|
|
18
|
+
</div>
|
|
19
|
+
),
|
|
20
|
+
],
|
|
21
|
+
} satisfies Meta<typeof Footer>;
|
|
22
|
+
|
|
23
|
+
export default meta;
|
|
24
|
+
|
|
25
|
+
export const Default = {
|
|
26
|
+
args: {},
|
|
27
|
+
render: (args) => (
|
|
28
|
+
<Footer
|
|
29
|
+
leftNav={
|
|
30
|
+
<ul className="flex gap-2">
|
|
31
|
+
<li>© 2024 Company</li>
|
|
32
|
+
<li>Privacy</li>
|
|
33
|
+
<li>Terms</li>
|
|
34
|
+
</ul>
|
|
35
|
+
}
|
|
36
|
+
center={<>Footer center</>}
|
|
37
|
+
rightNav={
|
|
38
|
+
<ul className="flex gap-2">
|
|
39
|
+
<li>Link 1</li>
|
|
40
|
+
<li>Link 2</li>
|
|
41
|
+
<li>Link 3</li>
|
|
42
|
+
</ul>
|
|
43
|
+
}
|
|
44
|
+
/>
|
|
45
|
+
),
|
|
46
|
+
} satisfies StoryObj;
|
|
47
|
+
|
|
48
|
+
export const WithCopyright = {
|
|
49
|
+
args: {},
|
|
50
|
+
render: (args) => (
|
|
51
|
+
<Footer
|
|
52
|
+
copyright="© 2024 Company. All rights reserved."
|
|
53
|
+
leftNav={
|
|
54
|
+
<ul className="flex gap-2">
|
|
55
|
+
<li>Privacy</li>
|
|
56
|
+
<li>Terms</li>
|
|
57
|
+
</ul>
|
|
58
|
+
}
|
|
59
|
+
rightNav={
|
|
60
|
+
<ul className="flex gap-2">
|
|
61
|
+
<li>Help</li>
|
|
62
|
+
<li>Contact</li>
|
|
63
|
+
</ul>
|
|
64
|
+
}
|
|
65
|
+
/>
|
|
66
|
+
),
|
|
67
|
+
} satisfies StoryObj;
|
|
68
|
+
|
|
69
|
+
export const Simple = {
|
|
70
|
+
args: {},
|
|
71
|
+
render: (args) => (
|
|
72
|
+
<Footer
|
|
73
|
+
variant="simple"
|
|
74
|
+
copyright="© 2024 Company. Powered by Rovula."
|
|
75
|
+
/>
|
|
76
|
+
),
|
|
77
|
+
} satisfies StoryObj;
|
|
78
|
+
|
|
79
|
+
export const Transparent = {
|
|
80
|
+
args: {},
|
|
81
|
+
render: (args) => (
|
|
82
|
+
<div className="flex flex-col w-full min-h-screen bg-primary-5">
|
|
83
|
+
<div className="flex-1 p-8">Page content</div>
|
|
84
|
+
<Footer
|
|
85
|
+
variant="transparent"
|
|
86
|
+
copyright="© 2024 Company"
|
|
87
|
+
leftNav={
|
|
88
|
+
<ul className="flex gap-2">
|
|
89
|
+
<li>Privacy</li>
|
|
90
|
+
<li>Terms</li>
|
|
91
|
+
</ul>
|
|
92
|
+
}
|
|
93
|
+
rightNav={
|
|
94
|
+
<ul className="flex gap-2">
|
|
95
|
+
<li>Help</li>
|
|
96
|
+
<li>Contact</li>
|
|
97
|
+
</ul>
|
|
98
|
+
}
|
|
99
|
+
/>
|
|
100
|
+
</div>
|
|
101
|
+
),
|
|
102
|
+
} satisfies StoryObj;
|
|
103
|
+
|
|
104
|
+
export const Custom = {
|
|
105
|
+
args: {},
|
|
106
|
+
render: (args) => (
|
|
107
|
+
<Footer
|
|
108
|
+
className="px-8"
|
|
109
|
+
copyright="© 2024 Company"
|
|
110
|
+
center={<>Powered by Rovula</>}
|
|
111
|
+
rightNav={
|
|
112
|
+
<ul className="flex gap-2">
|
|
113
|
+
<li>Help</li>
|
|
114
|
+
<li>Contact</li>
|
|
115
|
+
</ul>
|
|
116
|
+
}
|
|
117
|
+
/>
|
|
118
|
+
),
|
|
119
|
+
} satisfies StoryObj;
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { cn } from "@/utils/cn";
|
|
2
|
+
import React, { FC, ReactNode } from "react";
|
|
3
|
+
|
|
4
|
+
export type FooterVariant = "default" | "simple" | "transparent";
|
|
5
|
+
|
|
6
|
+
export type FooterProps = {
|
|
7
|
+
/** Layout variant: default (3-column) | simple (centered) | transparent (no bg) */
|
|
8
|
+
variant?: FooterVariant;
|
|
9
|
+
/** Copyright text - renders in left (default) or center (simple) */
|
|
10
|
+
copyright?: ReactNode;
|
|
11
|
+
position?: "static" | "sticky";
|
|
12
|
+
children?: ReactNode;
|
|
13
|
+
leftNav?: ReactNode;
|
|
14
|
+
rightNav?: ReactNode;
|
|
15
|
+
center?: ReactNode;
|
|
16
|
+
container?: boolean;
|
|
17
|
+
className?: string;
|
|
18
|
+
containerClassName?: string;
|
|
19
|
+
leftNavClassName?: string;
|
|
20
|
+
centerClassName?: string;
|
|
21
|
+
rightNavClassName?: string;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
const Footer: FC<FooterProps> = ({
|
|
25
|
+
children,
|
|
26
|
+
className,
|
|
27
|
+
variant = "default",
|
|
28
|
+
copyright,
|
|
29
|
+
center,
|
|
30
|
+
leftNav,
|
|
31
|
+
rightNav,
|
|
32
|
+
position,
|
|
33
|
+
container = false,
|
|
34
|
+
containerClassName,
|
|
35
|
+
leftNavClassName,
|
|
36
|
+
centerClassName,
|
|
37
|
+
rightNavClassName,
|
|
38
|
+
}) => {
|
|
39
|
+
const isSimple = variant === "simple";
|
|
40
|
+
const isTransparent = variant === "transparent";
|
|
41
|
+
|
|
42
|
+
const defaultLeft = leftNav || copyright;
|
|
43
|
+
const defaultCenter = isSimple ? copyright ?? center : center;
|
|
44
|
+
const defaultRight = isSimple ? null : rightNav;
|
|
45
|
+
|
|
46
|
+
return (
|
|
47
|
+
<footer
|
|
48
|
+
className={cn(
|
|
49
|
+
"relative w-full px-4 py-6 box-border overflow-hidden typography-subtitile2 border-solid border-t-2 text-[var(--footer-text-color)] border-t-[var(--footer-border-color)]",
|
|
50
|
+
isSimple ? "h-[var(--footer-height-simple)]" : "h-[var(--footer-height)]",
|
|
51
|
+
{ position },
|
|
52
|
+
className
|
|
53
|
+
)}
|
|
54
|
+
>
|
|
55
|
+
{/* Default bg (z:-10) + overlay for className override - hidden when transparent */}
|
|
56
|
+
{!isTransparent && (
|
|
57
|
+
<div
|
|
58
|
+
className="absolute inset-0 -z-10 bg-[var(--footer-bg-color)]"
|
|
59
|
+
aria-hidden
|
|
60
|
+
/>
|
|
61
|
+
)}
|
|
62
|
+
<div
|
|
63
|
+
className={cn("absolute inset-0 -z-[5] pointer-events-none", className)}
|
|
64
|
+
aria-hidden
|
|
65
|
+
/>
|
|
66
|
+
<div
|
|
67
|
+
className={cn(
|
|
68
|
+
"relative mx-auto flex h-full items-center",
|
|
69
|
+
isSimple ? "justify-center" : "justify-between",
|
|
70
|
+
{ container },
|
|
71
|
+
containerClassName
|
|
72
|
+
)}
|
|
73
|
+
>
|
|
74
|
+
{children ?? (
|
|
75
|
+
isSimple ? (
|
|
76
|
+
<div className={cn("text-center", centerClassName)}>
|
|
77
|
+
{defaultCenter}
|
|
78
|
+
</div>
|
|
79
|
+
) : (
|
|
80
|
+
<>
|
|
81
|
+
<nav
|
|
82
|
+
className={cn(
|
|
83
|
+
"flex w-1/2 items-center gap-x-[var(--footer-gap)] text-xl",
|
|
84
|
+
leftNavClassName
|
|
85
|
+
)}
|
|
86
|
+
>
|
|
87
|
+
{copyright && leftNav ? (
|
|
88
|
+
<>
|
|
89
|
+
<span className="flex-shrink-0">{copyright}</span>
|
|
90
|
+
{leftNav}
|
|
91
|
+
</>
|
|
92
|
+
) : (
|
|
93
|
+
defaultLeft
|
|
94
|
+
)}
|
|
95
|
+
</nav>
|
|
96
|
+
|
|
97
|
+
<div
|
|
98
|
+
className={cn(
|
|
99
|
+
"flex flex-shrink-0 flex-wrap justify-center",
|
|
100
|
+
centerClassName
|
|
101
|
+
)}
|
|
102
|
+
>
|
|
103
|
+
{defaultCenter}
|
|
104
|
+
</div>
|
|
105
|
+
|
|
106
|
+
<nav
|
|
107
|
+
className={cn(
|
|
108
|
+
"flex w-1/2 justify-end gap-x-[var(--footer-gap)] text-xl",
|
|
109
|
+
rightNavClassName
|
|
110
|
+
)}
|
|
111
|
+
>
|
|
112
|
+
{defaultRight}
|
|
113
|
+
</nav>
|
|
114
|
+
</>
|
|
115
|
+
)
|
|
116
|
+
)}
|
|
117
|
+
</div>
|
|
118
|
+
</footer>
|
|
119
|
+
);
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
export default Footer;
|