@rovula/ui 0.0.82 → 0.1.1
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 +67 -1
- package/dist/cjs/bundle.js +9261 -3
- package/dist/cjs/bundle.js.map +1 -1
- 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/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 +395 -0
- package/dist/cjs/types/components/PasswordInput/index.d.ts +2 -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/esm/bundle.css +67 -1
- package/dist/esm/bundle.js +9261 -3
- package/dist/esm/bundle.js.map +1 -1
- 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/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 +395 -0
- package/dist/esm/types/components/PasswordInput/index.d.ts +2 -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 +386 -2
- package/dist/index.js +4 -0
- package/dist/src/theme/global.css +1946 -309
- package/dist/utils/colors.js +369 -0
- package/package.json +5 -2
- package/src/components/Button/Button.tsx +7 -7
- 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/icons/index.ts +1 -0
- package/src/icons/lucideIconNames.ts +14 -0
- package/src/index.ts +15 -1
- package/src/theme/THEME_MAPPING.md +231 -0
- package/src/theme/global.css +2 -1
- package/src/theme/themes/skyller/baseline.css +6 -0
- package/src/theme/themes/skyller/color.css +79 -0
- package/src/theme/themes/skyller/components/action-button.css +81 -0
- package/src/theme/themes/skyller/palette.css +143 -0
- package/src/theme/themes/skyller/state.css +94 -0
- package/src/theme/themes/skyller/transparent.css +94 -0
- package/src/theme/themes/skyller/typography.css +30 -0
- package/src/theme/themes/variable.css +1057 -0
- package/src/theme/themes/xspector/color.css +50 -48
- package/src/theme/themes/xspector/palette.css +141 -121
- package/src/theme/themes/xspector/state.css +83 -78
- package/src/theme/themes/xspector/transparent.css +93 -68
- 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
|
@@ -1 +1,331 @@
|
|
|
1
|
+
/** CSS variable names for theme colors (resolved by data-theme) */
|
|
2
|
+
export declare const THEME_COLOR_KEYS: {
|
|
3
|
+
readonly "primary-5": "--primary-ramps-primary-5";
|
|
4
|
+
readonly "primary-10": "--primary-ramps-primary-10";
|
|
5
|
+
readonly "primary-20": "--primary-ramps-primary-20";
|
|
6
|
+
readonly "primary-30": "--primary-ramps-primary-30";
|
|
7
|
+
readonly "primary-40": "--primary-ramps-primary-40";
|
|
8
|
+
readonly "primary-50": "--primary-ramps-primary-50";
|
|
9
|
+
readonly "primary-60": "--primary-ramps-primary-60";
|
|
10
|
+
readonly "primary-70": "--primary-ramps-primary-70";
|
|
11
|
+
readonly "primary-80": "--primary-ramps-primary-80";
|
|
12
|
+
readonly "primary-90": "--primary-ramps-primary-90";
|
|
13
|
+
readonly "primary-100": "--primary-ramps-primary-100";
|
|
14
|
+
readonly "primary-110": "--primary-ramps-primary-110";
|
|
15
|
+
readonly "primary-120": "--primary-ramps-primary-120";
|
|
16
|
+
readonly "primary-130": "--primary-ramps-primary-130";
|
|
17
|
+
readonly "primary-140": "--primary-ramps-primary-140";
|
|
18
|
+
readonly "primary-150": "--primary-ramps-primary-150";
|
|
19
|
+
readonly "secondary-5": "--secondary-ramps-secondary-5";
|
|
20
|
+
readonly "secondary-10": "--secondary-ramps-secondary-10";
|
|
21
|
+
readonly "secondary-20": "--secondary-ramps-secondary-20";
|
|
22
|
+
readonly "secondary-30": "--secondary-ramps-secondary-30";
|
|
23
|
+
readonly "secondary-40": "--secondary-ramps-secondary-40";
|
|
24
|
+
readonly "secondary-50": "--secondary-ramps-secondary-50";
|
|
25
|
+
readonly "secondary-60": "--secondary-ramps-secondary-60";
|
|
26
|
+
readonly "secondary-70": "--secondary-ramps-secondary-70";
|
|
27
|
+
readonly "secondary-80": "--secondary-ramps-secondary-80";
|
|
28
|
+
readonly "secondary-90": "--secondary-ramps-secondary-90";
|
|
29
|
+
readonly "secondary-100": "--secondary-ramps-secondary-100";
|
|
30
|
+
readonly "secondary-110": "--secondary-ramps-secondary-110";
|
|
31
|
+
readonly "secondary-120": "--secondary-ramps-secondary-120";
|
|
32
|
+
readonly "secondary-130": "--secondary-ramps-secondary-130";
|
|
33
|
+
readonly "secondary-140": "--secondary-ramps-secondary-140";
|
|
34
|
+
readonly "secondary-150": "--secondary-ramps-secondary-150";
|
|
35
|
+
readonly "tertiary-5": "--tertiary-ramps-tertiary-5";
|
|
36
|
+
readonly "tertiary-10": "--tertiary-ramps-tertiary-10";
|
|
37
|
+
readonly "tertiary-20": "--tertiary-ramps-tertiary-20";
|
|
38
|
+
readonly "tertiary-30": "--tertiary-ramps-tertiary-30";
|
|
39
|
+
readonly "tertiary-40": "--tertiary-ramps-tertiary-40";
|
|
40
|
+
readonly "tertiary-50": "--tertiary-ramps-tertiary-50";
|
|
41
|
+
readonly "tertiary-60": "--tertiary-ramps-tertiary-60";
|
|
42
|
+
readonly "tertiary-70": "--tertiary-ramps-tertiary-70";
|
|
43
|
+
readonly "tertiary-80": "--tertiary-ramps-tertiary-80";
|
|
44
|
+
readonly "tertiary-90": "--tertiary-ramps-tertiary-90";
|
|
45
|
+
readonly "tertiary-100": "--tertiary-ramps-tertiary-100";
|
|
46
|
+
readonly "tertiary-110": "--tertiary-ramps-tertiary-110";
|
|
47
|
+
readonly "tertiary-120": "--tertiary-ramps-tertiary-120";
|
|
48
|
+
readonly "tertiary-130": "--tertiary-ramps-tertiary-130";
|
|
49
|
+
readonly "tertiary-140": "--tertiary-ramps-tertiary-140";
|
|
50
|
+
readonly "tertiary-150": "--tertiary-ramps-tertiary-150";
|
|
51
|
+
readonly "grey-5": "--grey-grey-5";
|
|
52
|
+
readonly "grey-10": "--grey-grey-10";
|
|
53
|
+
readonly "grey-20": "--grey-grey-20";
|
|
54
|
+
readonly "grey-30": "--grey-grey-30";
|
|
55
|
+
readonly "grey-40": "--grey-grey-40";
|
|
56
|
+
readonly "grey-50": "--grey-grey-50";
|
|
57
|
+
readonly "grey-60": "--grey-grey-60";
|
|
58
|
+
readonly "grey-70": "--grey-grey-70";
|
|
59
|
+
readonly "grey-80": "--grey-grey-80";
|
|
60
|
+
readonly "grey-90": "--grey-grey-90";
|
|
61
|
+
readonly "grey-100": "--grey-grey-100";
|
|
62
|
+
readonly "grey-110": "--grey-grey-110";
|
|
63
|
+
readonly "grey-120": "--grey-grey-120";
|
|
64
|
+
readonly "grey-130": "--grey-grey-130";
|
|
65
|
+
readonly "grey-140": "--grey-grey-140";
|
|
66
|
+
readonly "grey-150": "--grey-grey-150";
|
|
67
|
+
readonly "grey2-50": "--grey2-grey2-50";
|
|
68
|
+
readonly "grey2-100": "--grey2-grey2-100";
|
|
69
|
+
readonly "grey2-200": "--grey2-grey2-200";
|
|
70
|
+
readonly "grey2-300": "--grey2-grey2-300";
|
|
71
|
+
readonly "grey2-400": "--grey2-grey2-400";
|
|
72
|
+
readonly "grey2-500": "--grey2-grey2-500";
|
|
73
|
+
readonly "grey2-600": "--grey2-grey2-600";
|
|
74
|
+
readonly "grey2-700": "--grey2-grey2-700";
|
|
75
|
+
readonly "grey2-800": "--grey2-grey2-800";
|
|
76
|
+
readonly "grey2-900": "--grey2-grey2-900";
|
|
77
|
+
readonly "grey2-950": "--grey2-grey2-950";
|
|
78
|
+
readonly "info-50": "--info-info-50";
|
|
79
|
+
readonly "info-100": "--info-info-100";
|
|
80
|
+
readonly "info-200": "--info-info-200";
|
|
81
|
+
readonly "info-300": "--info-info-300";
|
|
82
|
+
readonly "info-400": "--info-info-400";
|
|
83
|
+
readonly "info-500": "--info-info-500";
|
|
84
|
+
readonly "info-600": "--info-info-600";
|
|
85
|
+
readonly "info-700": "--info-info-700";
|
|
86
|
+
readonly "info-800": "--info-info-800";
|
|
87
|
+
readonly "info-900": "--info-info-900";
|
|
88
|
+
readonly "info-950": "--info-info-950";
|
|
89
|
+
readonly "success-50": "--success-success-50";
|
|
90
|
+
readonly "success-100": "--success-success-100";
|
|
91
|
+
readonly "success-200": "--success-success-200";
|
|
92
|
+
readonly "success-300": "--success-success-300";
|
|
93
|
+
readonly "success-400": "--success-success-400";
|
|
94
|
+
readonly "success-500": "--success-success-500";
|
|
95
|
+
readonly "success-600": "--success-success-600";
|
|
96
|
+
readonly "success-700": "--success-success-700";
|
|
97
|
+
readonly "success-800": "--success-success-800";
|
|
98
|
+
readonly "success-900": "--success-success-900";
|
|
99
|
+
readonly "success-950": "--success-success-950";
|
|
100
|
+
readonly "warning-50": "--warning-warning-50";
|
|
101
|
+
readonly "warning-100": "--warning-warning-100";
|
|
102
|
+
readonly "warning-200": "--warning-warning-200";
|
|
103
|
+
readonly "warning-300": "--warning-warning-300";
|
|
104
|
+
readonly "warning-400": "--warning-warning-400";
|
|
105
|
+
readonly "warning-500": "--warning-warning-500";
|
|
106
|
+
readonly "warning-600": "--warning-warning-600";
|
|
107
|
+
readonly "warning-700": "--warning-warning-700";
|
|
108
|
+
readonly "warning-800": "--warning-warning-800";
|
|
109
|
+
readonly "warning-900": "--warning-warning-900";
|
|
110
|
+
readonly "warning-950": "--warning-warning-950";
|
|
111
|
+
readonly "error-50": "--error-error-50";
|
|
112
|
+
readonly "error-100": "--error-error-100";
|
|
113
|
+
readonly "error-200": "--error-error-200";
|
|
114
|
+
readonly "error-300": "--error-error-300";
|
|
115
|
+
readonly "error-400": "--error-error-400";
|
|
116
|
+
readonly "error-500": "--error-error-500";
|
|
117
|
+
readonly "error-600": "--error-error-600";
|
|
118
|
+
readonly "error-700": "--error-error-700";
|
|
119
|
+
readonly "error-800": "--error-error-800";
|
|
120
|
+
readonly "error-900": "--error-error-900";
|
|
121
|
+
readonly "error-950": "--error-error-950";
|
|
122
|
+
readonly primary: "--state-color-primary-default";
|
|
123
|
+
readonly "primary-hover": "--state-color-primary-hover";
|
|
124
|
+
readonly "primary-stroke": "--state-color-primary-stroke";
|
|
125
|
+
readonly "primary-hover-bg": "--state-color-primary-hover-bg";
|
|
126
|
+
readonly "primary-pressed": "--state-color-primary-pressed";
|
|
127
|
+
readonly "primary-active": "--state-color-primary-active";
|
|
128
|
+
readonly "primary-text-solid": "--state-color-primary-text-solid";
|
|
129
|
+
readonly "primary-text-outline": "--state-color-primary-text-outline";
|
|
130
|
+
readonly "primary-text-hover": "--state-color-primary-text-hover";
|
|
131
|
+
readonly "primary-text-pressed": "--state-color-primary-text-pressed";
|
|
132
|
+
readonly secondary: "--state-color-secondary-default";
|
|
133
|
+
readonly "secondary-hover": "--state-color-secondary-hover";
|
|
134
|
+
readonly "secondary-stroke": "--state-color-secondary-stroke";
|
|
135
|
+
readonly "secondary-hover-bg": "--state-color-secondary-hover-bg";
|
|
136
|
+
readonly "secondary-pressed": "--state-color-secondary-pressed";
|
|
137
|
+
readonly "secondary-active": "--state-color-secondary-active";
|
|
138
|
+
readonly "secondary-text-solid": "--state-color-secondary-text-solid";
|
|
139
|
+
readonly "secondary-text-outline": "--state-color-secondary-text-outline";
|
|
140
|
+
readonly "secondary-text-hover": "--state-color-secondary-text-hover";
|
|
141
|
+
readonly "secondary-text-pressed": "--state-color-secondary-text-pressed";
|
|
142
|
+
readonly tertiary: "--state-color-tertiary-default";
|
|
143
|
+
readonly "tertiary-hover": "--state-color-tertiary-hover";
|
|
144
|
+
readonly "tertiary-stroke": "--state-color-tertiary-stroke";
|
|
145
|
+
readonly "tertiary-hover-bg": "--state-color-tertiary-hover-bg";
|
|
146
|
+
readonly "tertiary-pressed": "--state-color-tertiary-pressed";
|
|
147
|
+
readonly "tertiary-active": "--state-color-tertiary-active";
|
|
148
|
+
readonly "tertiary-text-solid": "--state-color-tertiary-text-solid";
|
|
149
|
+
readonly "tertiary-text-outline": "--state-color-tertiary-text-outline";
|
|
150
|
+
readonly "tertiary-text-hover": "--state-color-tertiary-text-hover";
|
|
151
|
+
readonly "tertiary-text-pressed": "--state-color-tertiary-text-pressed";
|
|
152
|
+
readonly info: "--state-color-info-default";
|
|
153
|
+
readonly "info-hover": "--state-color-info-hover";
|
|
154
|
+
readonly "info-stroke": "--state-color-info-stroke";
|
|
155
|
+
readonly "info-hover-bg": "--state-color-info-hover-bg";
|
|
156
|
+
readonly "info-pressed": "--state-color-info-pressed";
|
|
157
|
+
readonly "info-active": "--state-color-info-active";
|
|
158
|
+
readonly "info-text-solid": "--state-color-info-text-solid";
|
|
159
|
+
readonly "info-text-outline": "--state-color-info-text-outline";
|
|
160
|
+
readonly "info-text-hover": "--state-color-info-text-hover";
|
|
161
|
+
readonly "info-text-pressed": "--state-color-info-text-pressed";
|
|
162
|
+
readonly success: "--state-color-success-default";
|
|
163
|
+
readonly "success-hover": "--state-color-success-hover";
|
|
164
|
+
readonly "success-stroke": "--state-color-success-stroke";
|
|
165
|
+
readonly "success-hover-bg": "--state-color-success-hover-bg";
|
|
166
|
+
readonly "success-pressed": "--state-color-success-pressed";
|
|
167
|
+
readonly "success-active": "--state-color-success-active";
|
|
168
|
+
readonly "success-text-solid": "--state-color-success-text-solid";
|
|
169
|
+
readonly "success-text-outline": "--state-color-success-text-outline";
|
|
170
|
+
readonly "success-text-hover": "--state-color-success-text-hover";
|
|
171
|
+
readonly "success-text-pressed": "--state-color-success-text-pressed";
|
|
172
|
+
readonly warning: "--state-color-warning-default";
|
|
173
|
+
readonly "warning-hover": "--state-color-warning-hover";
|
|
174
|
+
readonly "warning-stroke": "--state-color-warning-stroke";
|
|
175
|
+
readonly "warning-hover-bg": "--state-color-warning-hover-bg";
|
|
176
|
+
readonly "warning-pressed": "--state-color-warning-pressed";
|
|
177
|
+
readonly "warning-active": "--state-color-warning-active";
|
|
178
|
+
readonly "warning-text-solid": "--state-color-warning-text-solid";
|
|
179
|
+
readonly "warning-text-outline": "--state-color-warning-text-outline";
|
|
180
|
+
readonly "warning-text-hover": "--state-color-warning-text-hover";
|
|
181
|
+
readonly "warning-text-pressed": "--state-color-warning-text-pressed";
|
|
182
|
+
readonly error: "--state-color-error-default";
|
|
183
|
+
readonly "error-hover": "--state-color-error-hover";
|
|
184
|
+
readonly "error-stroke": "--state-color-error-stroke";
|
|
185
|
+
readonly "error-hover-bg": "--state-color-error-hover-bg";
|
|
186
|
+
readonly "error-pressed": "--state-color-error-pressed";
|
|
187
|
+
readonly "error-active": "--state-color-error-active";
|
|
188
|
+
readonly "error-text-solid": "--state-color-error-text-solid";
|
|
189
|
+
readonly "error-text-outline": "--state-color-error-text-outline";
|
|
190
|
+
readonly "error-text-hover": "--state-color-error-text-hover";
|
|
191
|
+
readonly "error-text-pressed": "--state-color-error-text-pressed";
|
|
192
|
+
readonly "disable-solid": "--state-color-disable-solid";
|
|
193
|
+
readonly "disable-outline": "--state-color-disable-outline";
|
|
194
|
+
readonly "text-black": "--text-black";
|
|
195
|
+
readonly "text-dark": "--text-dark";
|
|
196
|
+
readonly "text-medium": "--text-medium";
|
|
197
|
+
readonly "text-light": "--text-light";
|
|
198
|
+
readonly "text-grey-dark": "--text-grey-dark";
|
|
199
|
+
readonly "text-grey-medium": "--text-grey-medium";
|
|
200
|
+
readonly "text-grey-light": "--text-grey-light";
|
|
201
|
+
readonly "text-white": "--text-white";
|
|
202
|
+
readonly "input-default-text": "--input-color-default-text";
|
|
203
|
+
readonly "input-default-stroke": "--input-color-default-stroke";
|
|
204
|
+
readonly "input-filled-text": "--input-color-filled-text";
|
|
205
|
+
readonly "input-active-stroke": "--input-color-active-stroke";
|
|
206
|
+
readonly "input-disable-text": "--input-color-disable-text";
|
|
207
|
+
readonly "input-disable-stroke": "--input-color-disable-stroke";
|
|
208
|
+
readonly "input-disable-bg": "--input-color-disable-bg";
|
|
209
|
+
readonly "input-label-bg": "--input-color-label-bg";
|
|
210
|
+
readonly "input-error": "--input-color-error";
|
|
211
|
+
readonly "function-default-solid": "--function-default-solid";
|
|
212
|
+
readonly "function-default-hover": "--function-default-hover";
|
|
213
|
+
readonly "function-default-hover-bg": "--function-default-hover-bg";
|
|
214
|
+
readonly "function-default-stroke": "--function-default-stroke";
|
|
215
|
+
readonly "function-default-icon": "--function-default-icon";
|
|
216
|
+
readonly "function-default-outline-icon": "--function-default-outline-icon";
|
|
217
|
+
readonly "function-active-solid": "--function-active-solid";
|
|
218
|
+
readonly "function-active-hover": "--function-active-hover";
|
|
219
|
+
readonly "function-active-hover-bg": "--function-active-hover-bg";
|
|
220
|
+
readonly "function-active-stroke": "--function-active-stroke";
|
|
221
|
+
readonly "function-active-icon": "--function-active-icon";
|
|
222
|
+
readonly "base-bg": "--base-color-bg";
|
|
223
|
+
readonly "base-bg2": "--base-color-bg2";
|
|
224
|
+
readonly "base-bg3": "--base-color-bg3";
|
|
225
|
+
readonly "base-workspace-stroke": "--base-color-workspace-stroke";
|
|
226
|
+
readonly "base-guideline-stroke": "--base-color-guideline-stroke";
|
|
227
|
+
readonly "base-popup": "--base-color-popup";
|
|
228
|
+
readonly "base-popup-highlight": "--base-color-popup-hightlight";
|
|
229
|
+
readonly "base-popup-curtain": "--base-color-popup-curtain";
|
|
230
|
+
readonly "base-popup-foreground": "--base-color-popup-foreground";
|
|
231
|
+
readonly "common-white": "--common-white";
|
|
232
|
+
readonly "common-black": "--common-black";
|
|
233
|
+
readonly background: "--background";
|
|
234
|
+
readonly foreground: "--foreground";
|
|
235
|
+
readonly surface: "--surface";
|
|
236
|
+
readonly "surface-foreground": "--surface-foreground";
|
|
237
|
+
readonly "primary-foreground": "--primary-foreground";
|
|
238
|
+
readonly "secondary-foreground": "--secondary-foreground";
|
|
239
|
+
readonly "tertiary-foreground": "--tertiary-foreground";
|
|
240
|
+
readonly "info-foreground": "--info-foreground";
|
|
241
|
+
readonly "success-foreground": "--success-foreground";
|
|
242
|
+
readonly "warning-foreground": "--warning-foreground";
|
|
243
|
+
readonly "error-foreground": "--error-foreground";
|
|
244
|
+
readonly "grey-foreground": "--grey-foreground";
|
|
245
|
+
readonly "grey2-foreground": "--grey2-foreground";
|
|
246
|
+
readonly "primary-transparent-8": "--main-transparency-primary-8";
|
|
247
|
+
readonly "primary-transparent-12": "--main-transparency-primary-12";
|
|
248
|
+
readonly "primary-transparent-16": "--main-transparency-primary-16";
|
|
249
|
+
readonly "primary-transparent-24": "--main-transparency-primary-24";
|
|
250
|
+
readonly "primary-transparent-32": "--main-transparency-primary-32";
|
|
251
|
+
readonly "primary-transparent-48": "--main-transparency-primary-48";
|
|
252
|
+
readonly "secondary-transparent-8": "--main-transparency-secondary-8";
|
|
253
|
+
readonly "secondary-transparent-12": "--main-transparency-secondary-12";
|
|
254
|
+
readonly "secondary-transparent-16": "--main-transparency-secondary-16";
|
|
255
|
+
readonly "secondary-transparent-24": "--main-transparency-secondary-24";
|
|
256
|
+
readonly "secondary-transparent-32": "--main-transparency-secondary-32";
|
|
257
|
+
readonly "secondary-transparent-48": "--main-transparency-secondary-48";
|
|
258
|
+
readonly "tertiary-transparent-8": "--main-transparency-tertiary-8";
|
|
259
|
+
readonly "tertiary-transparent-12": "--main-transparency-tertiary-12";
|
|
260
|
+
readonly "tertiary-transparent-16": "--main-transparency-tertiary-16";
|
|
261
|
+
readonly "tertiary-transparent-24": "--main-transparency-tertiary-24";
|
|
262
|
+
readonly "tertiary-transparent-32": "--main-transparency-tertiary-32";
|
|
263
|
+
readonly "tertiary-transparent-48": "--main-transparency-tertiary-48";
|
|
264
|
+
readonly "info-transparent-8": "--other-transparency-info-8";
|
|
265
|
+
readonly "info-transparent-12": "--other-transparency-info-12";
|
|
266
|
+
readonly "info-transparent-16": "--other-transparency-info-16";
|
|
267
|
+
readonly "info-transparent-24": "--other-transparency-info-24";
|
|
268
|
+
readonly "info-transparent-32": "--other-transparency-info-32";
|
|
269
|
+
readonly "info-transparent-48": "--other-transparency-info-48";
|
|
270
|
+
readonly "success-transparent-8": "--other-transparency-success-8";
|
|
271
|
+
readonly "success-transparent-12": "--other-transparency-success-12";
|
|
272
|
+
readonly "success-transparent-16": "--other-transparency-success-16";
|
|
273
|
+
readonly "success-transparent-24": "--other-transparency-success-24";
|
|
274
|
+
readonly "success-transparent-32": "--other-transparency-success-32";
|
|
275
|
+
readonly "success-transparent-48": "--other-transparency-success-48";
|
|
276
|
+
readonly "warning-transparent-8": "--other-transparency-warning-8";
|
|
277
|
+
readonly "warning-transparent-12": "--other-transparency-warning-12";
|
|
278
|
+
readonly "warning-transparent-16": "--other-transparency-warning-16";
|
|
279
|
+
readonly "warning-transparent-24": "--other-transparency-warning-24";
|
|
280
|
+
readonly "warning-transparent-32": "--other-transparency-warning-32";
|
|
281
|
+
readonly "warning-transparent-48": "--other-transparency-warning-48";
|
|
282
|
+
readonly "error-transparent-8": "--other-transparency-error-8";
|
|
283
|
+
readonly "error-transparent-12": "--other-transparency-error-12";
|
|
284
|
+
readonly "error-transparent-16": "--other-transparency-error-16";
|
|
285
|
+
readonly "error-transparent-24": "--other-transparency-error-24";
|
|
286
|
+
readonly "error-transparent-32": "--other-transparency-error-32";
|
|
287
|
+
readonly "error-transparent-48": "--other-transparency-error-48";
|
|
288
|
+
readonly "grey-transparent-8": "--other-transparency-grey-8";
|
|
289
|
+
readonly "grey-transparent-12": "--other-transparency-grey-12";
|
|
290
|
+
readonly "grey-transparent-16": "--other-transparency-grey-16";
|
|
291
|
+
readonly "grey-transparent-24": "--other-transparency-grey-24";
|
|
292
|
+
readonly "grey-transparent-32": "--other-transparency-grey-32";
|
|
293
|
+
readonly "grey-transparent-48": "--other-transparency-grey-48";
|
|
294
|
+
readonly "grey2-transparent-8": "--other-transparency-grey2-8";
|
|
295
|
+
readonly "grey2-transparent-12": "--other-transparency-grey2-12";
|
|
296
|
+
readonly "grey2-transparent-16": "--other-transparency-grey2-16";
|
|
297
|
+
readonly "grey2-transparent-24": "--other-transparency-grey2-24";
|
|
298
|
+
readonly "grey2-transparent-32": "--other-transparency-grey2-32";
|
|
299
|
+
readonly "grey2-transparent-48": "--other-transparency-grey2-48";
|
|
300
|
+
readonly "white-transparent-8": "--other-transparency-white-08";
|
|
301
|
+
readonly "white-transparent-12": "--other-transparency-white-12";
|
|
302
|
+
readonly "white-transparent-16": "--other-transparency-white-16";
|
|
303
|
+
readonly "white-transparent-24": "--other-transparency-white-24";
|
|
304
|
+
readonly "white-transparent-32": "--other-transparency-white-32";
|
|
305
|
+
readonly "white-transparent-48": "--other-transparency-white-48";
|
|
306
|
+
readonly "black-transparent-8": "--other-transparency-black-08";
|
|
307
|
+
readonly "black-transparent-12": "--other-transparency-black-12";
|
|
308
|
+
readonly "black-transparent-16": "--other-transparency-black-16";
|
|
309
|
+
readonly "black-transparent-24": "--other-transparency-black-24";
|
|
310
|
+
readonly "black-transparent-32": "--other-transparency-black-32";
|
|
311
|
+
readonly "black-transparent-48": "--other-transparency-black-48";
|
|
312
|
+
};
|
|
313
|
+
export type ThemeColorKey = keyof typeof THEME_COLOR_KEYS;
|
|
314
|
+
/**
|
|
315
|
+
* Get computed color value from a CSS variable (respects current theme).
|
|
316
|
+
* Use in browser only; returns empty string during SSR.
|
|
317
|
+
*
|
|
318
|
+
* @example
|
|
319
|
+
* const primary = getThemeColor('primary');
|
|
320
|
+
* const hex = getThemeColor('--primary-ramps-primary-100');
|
|
321
|
+
*/
|
|
322
|
+
export declare function getThemeColor(keyOrVar: ThemeColorKey | string, element?: HTMLElement | Document): string;
|
|
323
|
+
/**
|
|
324
|
+
* Get multiple theme colors as a JS object.
|
|
325
|
+
*
|
|
326
|
+
* @example
|
|
327
|
+
* const colors = getThemeColors();
|
|
328
|
+
* // { primary: '#2563eb', secondary: '#60a5fa', ... }
|
|
329
|
+
*/
|
|
330
|
+
export declare function getThemeColors(keys?: ThemeColorKey[], element?: HTMLElement | Document): Record<string, string>;
|
|
1
331
|
export declare const srgbToHex: (color: string) => string;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "@/utils/cn";
|
|
3
|
+
const Footer = ({ children, className, variant = "default", copyright, center, leftNav, rightNav, position, container = false, containerClassName, leftNavClassName, centerClassName, rightNavClassName, }) => {
|
|
4
|
+
const isSimple = variant === "simple";
|
|
5
|
+
const isTransparent = variant === "transparent";
|
|
6
|
+
const defaultLeft = leftNav || copyright;
|
|
7
|
+
const defaultCenter = isSimple ? copyright !== null && copyright !== void 0 ? copyright : center : center;
|
|
8
|
+
const defaultRight = isSimple ? null : rightNav;
|
|
9
|
+
return (_jsxs("footer", { className: cn("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)]", isSimple ? "h-[var(--footer-height-simple)]" : "h-[var(--footer-height)]", { position }, className), children: [!isTransparent && (_jsx("div", { className: "absolute inset-0 -z-10 bg-[var(--footer-bg-color)]", "aria-hidden": true })), _jsx("div", { className: cn("absolute inset-0 -z-[5] pointer-events-none", className), "aria-hidden": true }), _jsx("div", { className: cn("relative mx-auto flex h-full items-center", isSimple ? "justify-center" : "justify-between", { container }, containerClassName), children: children !== null && children !== void 0 ? children : (isSimple ? (_jsx("div", { className: cn("text-center", centerClassName), children: defaultCenter })) : (_jsxs(_Fragment, { children: [_jsx("nav", { className: cn("flex w-1/2 items-center gap-x-[var(--footer-gap)] text-xl", leftNavClassName), children: copyright && leftNav ? (_jsxs(_Fragment, { children: [_jsx("span", { className: "flex-shrink-0", children: copyright }), leftNav] })) : (defaultLeft) }), _jsx("div", { className: cn("flex flex-shrink-0 flex-wrap justify-center", centerClassName), children: defaultCenter }), _jsx("nav", { className: cn("flex w-1/2 justify-end gap-x-[var(--footer-gap)] text-xl", rightNavClassName), children: defaultRight })] }))) })] }));
|
|
10
|
+
};
|
|
11
|
+
export default Footer;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import Footer from "./Footer";
|
|
3
|
+
const meta = {
|
|
4
|
+
title: "Components/Footer",
|
|
5
|
+
component: Footer,
|
|
6
|
+
tags: ["autodocs"],
|
|
7
|
+
parameters: {
|
|
8
|
+
layout: "fullscreen",
|
|
9
|
+
},
|
|
10
|
+
decorators: [
|
|
11
|
+
(Story) => (_jsxs("div", { className: "p-5 w-full h-screen flex flex-col", children: [_jsx("div", { className: "flex-1", children: "Page content" }), _jsx(Story, {})] })),
|
|
12
|
+
],
|
|
13
|
+
};
|
|
14
|
+
export default meta;
|
|
15
|
+
export const Default = {
|
|
16
|
+
args: {},
|
|
17
|
+
render: (args) => (_jsx(Footer, { leftNav: _jsxs("ul", { className: "flex gap-2", children: [_jsx("li", { children: "\u00A9 2024 Company" }), _jsx("li", { children: "Privacy" }), _jsx("li", { children: "Terms" })] }), center: _jsx(_Fragment, { children: "Footer center" }), rightNav: _jsxs("ul", { className: "flex gap-2", children: [_jsx("li", { children: "Link 1" }), _jsx("li", { children: "Link 2" }), _jsx("li", { children: "Link 3" })] }) })),
|
|
18
|
+
};
|
|
19
|
+
export const WithCopyright = {
|
|
20
|
+
args: {},
|
|
21
|
+
render: (args) => (_jsx(Footer, { copyright: "\u00A9 2024 Company. All rights reserved.", leftNav: _jsxs("ul", { className: "flex gap-2", children: [_jsx("li", { children: "Privacy" }), _jsx("li", { children: "Terms" })] }), rightNav: _jsxs("ul", { className: "flex gap-2", children: [_jsx("li", { children: "Help" }), _jsx("li", { children: "Contact" })] }) })),
|
|
22
|
+
};
|
|
23
|
+
export const Simple = {
|
|
24
|
+
args: {},
|
|
25
|
+
render: (args) => (_jsx(Footer, { variant: "simple", copyright: "\u00A9 2024 Company. Powered by Rovula." })),
|
|
26
|
+
};
|
|
27
|
+
export const Transparent = {
|
|
28
|
+
args: {},
|
|
29
|
+
render: (args) => (_jsxs("div", { className: "flex flex-col w-full min-h-screen bg-primary-5", children: [_jsx("div", { className: "flex-1 p-8", children: "Page content" }), _jsx(Footer, { variant: "transparent", copyright: "\u00A9 2024 Company", leftNav: _jsxs("ul", { className: "flex gap-2", children: [_jsx("li", { children: "Privacy" }), _jsx("li", { children: "Terms" })] }), rightNav: _jsxs("ul", { className: "flex gap-2", children: [_jsx("li", { children: "Help" }), _jsx("li", { children: "Contact" })] }) })] })),
|
|
30
|
+
};
|
|
31
|
+
export const Custom = {
|
|
32
|
+
args: {},
|
|
33
|
+
render: (args) => (_jsx(Footer, { className: "px-8", copyright: "\u00A9 2024 Company", center: _jsx(_Fragment, { children: "Powered by Rovula" }), rightNav: _jsxs("ul", { className: "flex gap-2", children: [_jsx("li", { children: "Help" }), _jsx("li", { children: "Contact" })] }) })),
|
|
34
|
+
};
|
|
@@ -15,23 +15,40 @@ import { getIcon } from "@/icons";
|
|
|
15
15
|
import { cn } from "@/utils/cn";
|
|
16
16
|
import React from "react";
|
|
17
17
|
import { iconVariants } from "./Icon.styles";
|
|
18
|
+
const LUCIDE_SIZE = { sm: 16, md: 24, lg: 32 };
|
|
18
19
|
const Icon = (_a) => {
|
|
19
20
|
var { name, type = "heroicons", color = "inherit", variant = "solid", size = "md", className } = _a, props = __rest(_a, ["name", "type", "color", "variant", "size", "className"]);
|
|
20
21
|
const [IconComponent, setIconComponent] = React.useState(null);
|
|
21
22
|
React.useEffect(() => {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
23
|
+
if (type === "lucide") {
|
|
24
|
+
import("lucide-react/dynamicIconImports").then(({ default: dynamicIconImports }) => {
|
|
25
|
+
const loader = dynamicIconImports[name];
|
|
26
|
+
if (loader) {
|
|
27
|
+
loader().then((m) => {
|
|
28
|
+
setIconComponent(() => m.default);
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
console.warn(`Lucide icon "${name}" not found.`);
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
const icon = getIcon(type, name, variant);
|
|
38
|
+
if (icon)
|
|
39
|
+
setIconComponent(() => icon);
|
|
40
|
+
else
|
|
41
|
+
console.warn(`Icon "${name}" from "${type}" not found.`);
|
|
32
42
|
}, [name, type, variant]);
|
|
43
|
+
if (type === "lucide") {
|
|
44
|
+
if (!IconComponent) {
|
|
45
|
+
return _jsx("span", { className: cn(iconVariants({ color, size }), className) });
|
|
46
|
+
}
|
|
47
|
+
const sizeNum = size === "inherit" ? 24 : LUCIDE_SIZE[size];
|
|
48
|
+
return (_jsx(IconComponent, Object.assign({}, props, { size: sizeNum, strokeWidth: sizeNum <= 16 ? 1.5 : 2, absoluteStrokeWidth: true, shapeRendering: "geometricPrecision", className: cn(iconVariants({ color, size }), "stroke-current", className) })));
|
|
49
|
+
}
|
|
33
50
|
if (!IconComponent)
|
|
34
|
-
return
|
|
51
|
+
return _jsx("svg", Object.assign({ className: cn(iconVariants({ color, size }), className) }, props));
|
|
35
52
|
return (_jsx(IconComponent, Object.assign({ className: cn(iconVariants({ color, size }), className) }, props)));
|
|
36
53
|
};
|
|
37
54
|
export default Icon;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import React from "react";
|
|
2
3
|
import Icon from "./Icon";
|
|
3
4
|
const meta = {
|
|
4
5
|
title: "Components/Icon",
|
|
@@ -331,6 +332,44 @@ export const PreviewHeroIcon = {
|
|
|
331
332
|
return (_jsx("div", { className: "grid grid-cols-1 gap-4 w-full h-full", children: _jsxs("div", { className: "flex flex-col justify-start gap-4 w-full h-full", children: [_jsx("h4", { children: "Hero icons" }), heroIcons.map((iconName) => (_jsxs("div", { className: "flex flex-row gap-6 items-center", children: [_jsx(Icon, Object.assign({}, props, { name: iconName, variant: "solid", size: "sm" })), _jsx(Icon, Object.assign({}, props, { name: iconName, variant: "outline", size: "sm" })), _jsx(Icon, Object.assign({}, props, { name: iconName, variant: "outline", size: "md" })), _jsx(Icon, Object.assign({}, props, { name: iconName, variant: "solid", size: "md" })), _jsx(Icon, Object.assign({}, props, { name: iconName, variant: "outline", size: "lg" })), _jsx(Icon, Object.assign({}, props, { name: iconName, variant: "solid", size: "lg" })), _jsx("p", { className: "ml-4", children: iconName })] }, iconName)))] }) }));
|
|
332
333
|
},
|
|
333
334
|
};
|
|
335
|
+
const LUCIDE_DESIGNER_ICONS = [
|
|
336
|
+
"user",
|
|
337
|
+
"lock",
|
|
338
|
+
"eye-closed",
|
|
339
|
+
"eye",
|
|
340
|
+
"circle-check",
|
|
341
|
+
"circle-x",
|
|
342
|
+
"circle-alert",
|
|
343
|
+
"sliders-horizontal",
|
|
344
|
+
"calendar",
|
|
345
|
+
"search",
|
|
346
|
+
"check",
|
|
347
|
+
"triangle-alert",
|
|
348
|
+
];
|
|
349
|
+
export const PreviewLucideIcon = {
|
|
350
|
+
args: {},
|
|
351
|
+
render: (args) => (_jsx("div", { className: "grid grid-cols-1 gap-4 w-full h-full", children: _jsxs("div", { className: "flex flex-col justify-start gap-4 w-full h-full", children: [_jsx("h4", { children: "Lucide icons (designer set)" }), _jsxs("p", { className: "text-sm text-gray-500", children: ["Names from ", _jsx("a", { href: "https://lucide.dev/icons", target: "_blank", rel: "noreferrer", className: "underline", children: "lucide.dev/icons" }), ". Use ", _jsx("code", { children: "getLucideIconNames()" }), " for full list."] }), LUCIDE_DESIGNER_ICONS.map((iconName) => (_jsxs("div", { className: "flex flex-row gap-6 items-center", children: [_jsx(Icon, Object.assign({}, args, { type: "lucide", name: iconName, variant: "outline", size: "sm" })), _jsx(Icon, Object.assign({}, args, { type: "lucide", name: iconName, variant: "outline", size: "md" })), _jsx(Icon, Object.assign({}, args, { type: "lucide", name: iconName, variant: "outline", size: "lg" })), _jsx("p", { className: "ml-4 font-mono text-sm", children: iconName })] }, iconName)))] }) })),
|
|
352
|
+
};
|
|
353
|
+
export const LucideIconBrowser = {
|
|
354
|
+
args: {},
|
|
355
|
+
render: () => {
|
|
356
|
+
const [names, setNames] = React.useState([]);
|
|
357
|
+
const [filter, setFilter] = React.useState("");
|
|
358
|
+
const [loading, setLoading] = React.useState(true);
|
|
359
|
+
React.useEffect(() => {
|
|
360
|
+
import("@/icons").then(({ getLucideIconNames }) => {
|
|
361
|
+
getLucideIconNames().then((n) => {
|
|
362
|
+
setNames(n.sort());
|
|
363
|
+
setLoading(false);
|
|
364
|
+
});
|
|
365
|
+
});
|
|
366
|
+
}, []);
|
|
367
|
+
const filtered = filter
|
|
368
|
+
? names.filter((n) => n.toLowerCase().includes(filter.toLowerCase())).slice(0, 80)
|
|
369
|
+
: names.slice(0, 50);
|
|
370
|
+
return (_jsxs("div", { className: "flex flex-col gap-4 p-4 max-h-[80vh] overflow-auto", children: [_jsxs("h4", { children: ["Lucide icon names (", names.length, " total)"] }), _jsx("input", { type: "text", placeholder: "Search icons...", value: filter, onChange: (e) => setFilter(e.target.value), className: "px-3 py-2 border rounded w-64" }), loading ? (_jsx("p", { children: "Loading..." })) : (_jsx("div", { className: "grid grid-cols-[repeat(auto-fill,minmax(140px,1fr))] gap-2", children: filtered.map((name) => (_jsxs("div", { className: "flex flex-col items-center gap-1 p-2 border rounded hover:bg-gray-50", children: [_jsx(Icon, { type: "lucide", name: name, size: "md" }), _jsx("span", { className: "font-mono text-xs truncate w-full text-center", children: name })] }, name))) }))] }));
|
|
371
|
+
},
|
|
372
|
+
};
|
|
334
373
|
export const PreviewMaterialIcon = {
|
|
335
374
|
args: {
|
|
336
375
|
// variant: "outline",
|
|
@@ -1,8 +1,22 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { cn } from "@/utils/cn";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
import { useEffect, useState } from "react";
|
|
4
|
+
const SCROLL_THRESHOLD = 4;
|
|
5
|
+
const Navbar = ({ children, className, variant = "default", scrollShadow = false, center, leftNav, rightNav, position, container = false, containerClassName, leftNavClassName, centerClassName, rightNavClassName, }) => {
|
|
6
|
+
const [isScrolled, setIsScrolled] = useState(false);
|
|
7
|
+
useEffect(() => {
|
|
8
|
+
if (!scrollShadow || typeof window === "undefined")
|
|
9
|
+
return;
|
|
10
|
+
const handleScroll = () => {
|
|
11
|
+
setIsScrolled(window.scrollY > SCROLL_THRESHOLD);
|
|
12
|
+
};
|
|
13
|
+
handleScroll(); // init
|
|
14
|
+
window.addEventListener("scroll", handleScroll, { passive: true });
|
|
15
|
+
return () => window.removeEventListener("scroll", handleScroll);
|
|
16
|
+
}, [scrollShadow]);
|
|
17
|
+
const isTransparent = variant === "transparent";
|
|
18
|
+
return (_jsxs("header", { className: cn("relative w-full px-4 py-6 h-[var(--navbar-height)] box-border overflow-hidden typography-subtitile2 border-solid border-b-2 text-[rgb(var(--navbar-text-color))] border-b-[rgb(var(--navbar-border-color))] transition-shadow duration-200", { position }, scrollShadow && isScrolled && "shadow-[var(--navbar-shadow-scrolled)]", className), children: [!isTransparent && (_jsx("div", { className: "absolute inset-0 -z-10 bg-[rgb(var(--navbar-bg-color))]", "aria-hidden": true })), _jsx("div", { className: cn("absolute inset-0 -z-[5] pointer-events-none", className), "aria-hidden": true }), _jsx("div", { className: cn("relative mx-auto flex h-full justify-between items-center", {
|
|
19
|
+
container,
|
|
20
|
+
}, containerClassName), children: children || (_jsxs(_Fragment, { children: [_jsx("nav", { className: cn("flex w-1/2 gap-x-[var(--navbar-gap)] text-xl", leftNavClassName), children: leftNav }), _jsx("div", { className: cn("flex flex-shrink-0 flex-wrap justify-center", centerClassName), children: center }), _jsx("nav", { className: cn("flex w-1/2 justify-end gap-x-[var(--navbar-gap)] text-xl", rightNavClassName), children: rightNav })] })) })] }));
|
|
7
21
|
};
|
|
8
22
|
export default Navbar;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import Navbar from "./Navbar";
|
|
3
|
+
import { Footer } from "../Footer";
|
|
3
4
|
const meta = {
|
|
4
5
|
title: "Components/Navbar",
|
|
5
6
|
component: Navbar,
|
|
@@ -14,17 +15,23 @@ const meta = {
|
|
|
14
15
|
export default meta;
|
|
15
16
|
export const Default = {
|
|
16
17
|
args: {},
|
|
17
|
-
render: (args) => {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
render: (args) => (_jsx("div", { className: "flex flex-row gap-4 w-full", children: _jsx(Navbar, { leftNav: _jsxs("ul", { className: "flex gap-2", children: [_jsx("li", { children: "link 1" }), _jsx("li", { children: "link 2" }), _jsx("li", { children: "link 3" })] }), center: _jsx(_Fragment, { children: "Center text" }), rightNav: _jsxs("ul", { className: "flex gap-2", children: [_jsx("li", { children: "sss 1" }), _jsx("li", { children: "ddd 2" }), _jsx("li", { children: "vvvv 3" })] }) }) })),
|
|
19
|
+
};
|
|
20
|
+
export const Transparent = {
|
|
21
|
+
args: {},
|
|
22
|
+
render: (args) => (_jsxs("div", { className: "flex flex-col w-full min-h-screen bg-primary-5", children: [_jsx(Navbar, { variant: "transparent", position: "sticky", scrollShadow: true, leftNav: _jsxs("ul", { className: "flex gap-2", children: [_jsx("li", { children: "link 1" }), _jsx("li", { children: "link 2" })] }), center: _jsx(_Fragment, { children: "Transparent Navbar" }), rightNav: _jsxs("ul", { className: "flex gap-2", children: [_jsx("li", { children: "Menu 1" }), _jsx("li", { children: "Menu 2" })] }) }), _jsx("div", { className: "flex-1 p-8", children: "Scroll down to see shadow" }), _jsx(Footer, { variant: "transparent", copyright: "\u00A9 2024" })] })),
|
|
23
|
+
};
|
|
24
|
+
export const WithScrollShadow = {
|
|
25
|
+
args: {},
|
|
26
|
+
parameters: {
|
|
27
|
+
layout: "fullscreen",
|
|
21
28
|
},
|
|
29
|
+
decorators: [
|
|
30
|
+
(Story) => (_jsx("div", { className: "w-full h-[200vh]", children: _jsxs("div", { className: "h-screen flex flex-col", children: [_jsx(Story, {}), _jsx("div", { className: "flex-1 p-8 text-center", children: "Scroll down to see navbar shadow" })] }) })),
|
|
31
|
+
],
|
|
32
|
+
render: (args) => (_jsx(Navbar, { position: "sticky", scrollShadow: true, leftNav: _jsxs("ul", { className: "flex gap-2", children: [_jsx("li", { children: "link 1" }), _jsx("li", { children: "link 2" })] }), center: _jsx(_Fragment, { children: "Sticky + Scroll Shadow" }), rightNav: _jsxs("ul", { className: "flex gap-2", children: [_jsx("li", { children: "Menu 1" }), _jsx("li", { children: "Menu 2" })] }) })),
|
|
22
33
|
};
|
|
23
34
|
export const Custom = {
|
|
24
35
|
args: {},
|
|
25
|
-
render: (args) => {
|
|
26
|
-
console.log("args ", args);
|
|
27
|
-
const props = Object.assign({}, args);
|
|
28
|
-
return (_jsx("div", { className: "flex flex-row gap-4 w-full", children: _jsx(Navbar, { className: "px-8", leftNav: _jsxs("ul", { className: "flex gap-2", children: [_jsx("li", { children: "link 1" }), _jsx("li", { children: "link 2" }), _jsx("li", { children: "link 3" })] }), center: _jsx(_Fragment, { children: "Center text" }), rightNav: _jsxs("ul", { className: "flex gap-2", children: [_jsx("li", { children: "sss 1" }), _jsx("li", { children: "ddd 2" }), _jsx("li", { children: "vvvv 3" })] }) }) }));
|
|
29
|
-
},
|
|
36
|
+
render: (args) => (_jsx("div", { className: "flex flex-row gap-4 w-full", children: _jsx(Navbar, { className: "px-8", leftNav: _jsxs("ul", { className: "flex gap-2", children: [_jsx("li", { children: "link 1" }), _jsx("li", { children: "link 2" }), _jsx("li", { children: "link 3" })] }), center: _jsx(_Fragment, { children: "Center text" }), rightNav: _jsxs("ul", { className: "flex gap-2", children: [_jsx("li", { children: "sss 1" }), _jsx("li", { children: "ddd 2" }), _jsx("li", { children: "vvvv 3" })] }) }) })),
|
|
30
37
|
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
import { forwardRef, useImperativeHandle, useRef, useState } from "react";
|
|
14
|
+
import TextInput from "../TextInput/TextInput";
|
|
15
|
+
import Icon from "../Icon/Icon";
|
|
16
|
+
export const PasswordInput = forwardRef((_a, ref) => {
|
|
17
|
+
var _b;
|
|
18
|
+
var { showToggle = true, hasClearIcon = false, hideIcon, showIcon, endIcon, renderEndIcon, onClickEndIcon } = _a, props = __rest(_a, ["showToggle", "hasClearIcon", "hideIcon", "showIcon", "endIcon", "renderEndIcon", "onClickEndIcon"]);
|
|
19
|
+
const inputRef = useRef(null);
|
|
20
|
+
const [visible, setVisible] = useState(false);
|
|
21
|
+
useImperativeHandle(ref, () => inputRef === null || inputRef === void 0 ? void 0 : inputRef.current);
|
|
22
|
+
const handleToggleVisibility = () => {
|
|
23
|
+
var _a;
|
|
24
|
+
if (props.disabled)
|
|
25
|
+
return;
|
|
26
|
+
setVisible((v) => !v);
|
|
27
|
+
(_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
28
|
+
onClickEndIcon === null || onClickEndIcon === void 0 ? void 0 : onClickEndIcon();
|
|
29
|
+
};
|
|
30
|
+
const toggleIcon = visible
|
|
31
|
+
? showIcon !== null && showIcon !== void 0 ? showIcon : _jsx(Icon, { name: "eye", type: "lucide", size: "inherit", className: "size-full", "aria-label": "Hide password" })
|
|
32
|
+
: hideIcon !== null && hideIcon !== void 0 ? hideIcon : _jsx(Icon, { name: "eye-closed", type: "lucide", size: "inherit", className: "size-full", "aria-label": "Show password" });
|
|
33
|
+
return (_jsx(TextInput, Object.assign({ iconMode: "flat" }, props, { ref: inputRef, type: visible ? "text" : "password", hasClearIcon: hasClearIcon, endIcon: showToggle ? toggleIcon : endIcon, renderEndIcon: renderEndIcon, onClickEndIcon: showToggle ? handleToggleVisibility : onClickEndIcon, autoComplete: (_b = props.autoComplete) !== null && _b !== void 0 ? _b : "current-password" })));
|
|
34
|
+
});
|
|
35
|
+
PasswordInput.displayName = "PasswordInput";
|
|
36
|
+
export default PasswordInput;
|