@bigstack-oss/cube-ui 0.0.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/icons.d.cts +790 -0
- package/dist/icons.d.ts +790 -0
- package/dist/icons.js +1477 -0
- package/dist/icons.js.map +1 -0
- package/dist/icons.mjs +1345 -0
- package/dist/icons.mjs.map +1 -0
- package/dist/index.css +40048 -0
- package/dist/index.d.cts +181 -0
- package/dist/index.d.ts +181 -0
- package/dist/index.js +1483 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +1463 -0
- package/dist/index.mjs.map +1 -0
- package/dist/theme.d.cts +765 -0
- package/dist/theme.d.ts +765 -0
- package/dist/theme.js +683 -0
- package/dist/theme.js.map +1 -0
- package/dist/theme.mjs +674 -0
- package/dist/theme.mjs.map +1 -0
- package/package.json +120 -0
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,1463 @@
|
|
|
1
|
+
import { omit } from 'lodash';
|
|
2
|
+
import { twMerge } from 'tailwind-merge';
|
|
3
|
+
import { cva } from 'class-variance-authority';
|
|
4
|
+
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
5
|
+
import { forwardRef, useId, cloneElement, useState, useEffect } from 'react';
|
|
6
|
+
import i18next from 'i18next';
|
|
7
|
+
import { initReactI18next, useTranslation } from 'react-i18next';
|
|
8
|
+
import defaultTheme from 'tailwindcss/defaultTheme';
|
|
9
|
+
|
|
10
|
+
// src/components/CubeButton/CubeButton.tsx
|
|
11
|
+
var button = cva(
|
|
12
|
+
"flex shrink-0 items-center justify-center gap-x-2 whitespace-nowrap rounded-[5px] font-urbanist font-semibold transition-colors",
|
|
13
|
+
{
|
|
14
|
+
variants: {
|
|
15
|
+
type: {
|
|
16
|
+
primary: [
|
|
17
|
+
"bg-primary text-grey-0",
|
|
18
|
+
"hover:bg-functional-hover-primary"
|
|
19
|
+
],
|
|
20
|
+
secondary: [
|
|
21
|
+
"border border-primary bg-grey-0 text-primary",
|
|
22
|
+
"hover:border-functional-hover-primary hover:bg-functional-hover-secondary"
|
|
23
|
+
],
|
|
24
|
+
ghost: [
|
|
25
|
+
"bg-transparent text-primary",
|
|
26
|
+
"hover:bg-functional-hover-secondary"
|
|
27
|
+
],
|
|
28
|
+
warning: [
|
|
29
|
+
"border border-status-negative bg-grey-0 text-status-negative",
|
|
30
|
+
"hover:bg-status-negative hover:text-grey-0"
|
|
31
|
+
],
|
|
32
|
+
light: ["bg-secondary text-dark-400", "hover:bg-secondary-400"]
|
|
33
|
+
},
|
|
34
|
+
size: {
|
|
35
|
+
sm: "secondary-body3 h-[26px] px-3 py-[5px]",
|
|
36
|
+
md: "secondary-body2 h-[34px] px-4 py-2",
|
|
37
|
+
lg: "secondary-body2 h-[42px] px-5 py-3"
|
|
38
|
+
},
|
|
39
|
+
usage: {},
|
|
40
|
+
loading: {
|
|
41
|
+
true: "cursor-default",
|
|
42
|
+
false: ""
|
|
43
|
+
},
|
|
44
|
+
disabled: {
|
|
45
|
+
true: "cursor-default",
|
|
46
|
+
false: ""
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
compoundVariants: [
|
|
50
|
+
{ usage: "icon-only", size: "sm", className: "p-[5px]" },
|
|
51
|
+
{ usage: "icon-only", size: "md", className: "p-2" },
|
|
52
|
+
{ usage: "icon-only", size: "lg", className: "p-3" },
|
|
53
|
+
{
|
|
54
|
+
type: "primary",
|
|
55
|
+
disabled: true,
|
|
56
|
+
className: [
|
|
57
|
+
"bg-functional-disable-light text-functional-disable-text",
|
|
58
|
+
"hover:bg-functional-disable-light hover:text-functional-disable-text"
|
|
59
|
+
]
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
type: "primary",
|
|
63
|
+
loading: true,
|
|
64
|
+
className: [
|
|
65
|
+
[
|
|
66
|
+
"bg-functional-disable-light text-functional-border-darker",
|
|
67
|
+
"hover:text-functional-border-darker"
|
|
68
|
+
]
|
|
69
|
+
]
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
type: "secondary",
|
|
73
|
+
disabled: true,
|
|
74
|
+
className: [
|
|
75
|
+
"border-functional-disable-text bg-grey-0 text-functional-disable-text",
|
|
76
|
+
"hover:border-functional-disable-text hover:bg-grey-0"
|
|
77
|
+
]
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
type: "secondary",
|
|
81
|
+
loading: true,
|
|
82
|
+
className: [
|
|
83
|
+
"border-functional-border-darker bg-grey-0 text-functional-border-darker",
|
|
84
|
+
"hover:border-functional-border-darker hover:text-functional-border-darker"
|
|
85
|
+
]
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
type: "ghost",
|
|
89
|
+
disabled: true,
|
|
90
|
+
className: [
|
|
91
|
+
"bg-transparent text-functional-disable-text",
|
|
92
|
+
"text-functional-disable-text hover:bg-transparent"
|
|
93
|
+
]
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
type: "ghost",
|
|
97
|
+
loading: true,
|
|
98
|
+
className: "bg-transparent text-functional-border-darker"
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
type: "warning",
|
|
102
|
+
disabled: true,
|
|
103
|
+
className: [
|
|
104
|
+
"border-red-100 bg-grey-0 text-red-100",
|
|
105
|
+
"hover:border-red-100 hover:bg-grey-0 hover:text-red-100"
|
|
106
|
+
]
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
type: "warning",
|
|
110
|
+
loading: true,
|
|
111
|
+
className: [
|
|
112
|
+
"border-red-200 bg-grey-0 text-red-200",
|
|
113
|
+
"hover:text-red-200"
|
|
114
|
+
]
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
type: "light",
|
|
118
|
+
disabled: true,
|
|
119
|
+
className: [
|
|
120
|
+
"bg-secondary-50 text-functional-disable-text",
|
|
121
|
+
"hover:bg-secondary-50 hover:text-functional-disable-text"
|
|
122
|
+
]
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
type: "light",
|
|
126
|
+
loading: true,
|
|
127
|
+
className: [
|
|
128
|
+
"bg-secondary-50 text-functional-border-darker",
|
|
129
|
+
"hover:text-functional-border-darker"
|
|
130
|
+
]
|
|
131
|
+
},
|
|
132
|
+
/**
|
|
133
|
+
* We expect the button only show the loading spinner when the usage is 'text-only'.
|
|
134
|
+
*
|
|
135
|
+
* disabled:relative => position the absolute positioned spinner relative to the button.
|
|
136
|
+
* disabled:text-transparent => hide the text but keep the button's width and height.
|
|
137
|
+
*/
|
|
138
|
+
{
|
|
139
|
+
usage: "text-only",
|
|
140
|
+
loading: true,
|
|
141
|
+
className: "relative text-transparent hover:text-transparent"
|
|
142
|
+
}
|
|
143
|
+
]
|
|
144
|
+
}
|
|
145
|
+
);
|
|
146
|
+
var iconContainer = cva("flex items-center justify-center", {
|
|
147
|
+
variants: {
|
|
148
|
+
size: {
|
|
149
|
+
sm: "size-[16px]",
|
|
150
|
+
md: "size-[18px]",
|
|
151
|
+
lg: "size-[18px]"
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
});
|
|
155
|
+
var loadingSpinner = cva(void 0, {
|
|
156
|
+
variants: {
|
|
157
|
+
type: {
|
|
158
|
+
primary: "text-functional-border-darker",
|
|
159
|
+
secondary: "text-functional-border-darker",
|
|
160
|
+
ghost: "text-functional-border-darker",
|
|
161
|
+
warning: "text-red-200",
|
|
162
|
+
light: "text-functional-border-darker"
|
|
163
|
+
},
|
|
164
|
+
/**
|
|
165
|
+
* The button should only show the loading spinner when the usage is 'text-only',
|
|
166
|
+
* so we need to center the absolute positioned spinner within the button.
|
|
167
|
+
*/
|
|
168
|
+
usage: {
|
|
169
|
+
"text-only": "absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2"
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
});
|
|
173
|
+
var buttonSkeleton = cva(void 0, {
|
|
174
|
+
variants: {
|
|
175
|
+
size: {
|
|
176
|
+
sm: "h-[26px]",
|
|
177
|
+
md: "h-[34px]",
|
|
178
|
+
lg: "h-[42px]"
|
|
179
|
+
},
|
|
180
|
+
usage: {
|
|
181
|
+
"text-only": "",
|
|
182
|
+
"icon-only": "",
|
|
183
|
+
"icon-left": "",
|
|
184
|
+
"icon-right": ""
|
|
185
|
+
}
|
|
186
|
+
},
|
|
187
|
+
compoundVariants: [
|
|
188
|
+
{
|
|
189
|
+
usage: "text-only",
|
|
190
|
+
size: "sm",
|
|
191
|
+
className: "w-[104px]"
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
usage: "text-only",
|
|
195
|
+
size: "md",
|
|
196
|
+
className: "w-[118px]"
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
usage: "text-only",
|
|
200
|
+
size: "lg",
|
|
201
|
+
className: "w-[126px]"
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
usage: "icon-only",
|
|
205
|
+
size: "sm",
|
|
206
|
+
className: "w-[26px]"
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
usage: "icon-only",
|
|
210
|
+
size: "md",
|
|
211
|
+
className: "w-[34px]"
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
usage: "icon-only",
|
|
215
|
+
size: "lg",
|
|
216
|
+
className: "w-[42px]"
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
usage: ["icon-left", "icon-right"],
|
|
220
|
+
size: "sm",
|
|
221
|
+
className: "w-[128px]"
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
usage: ["icon-left", "icon-right"],
|
|
225
|
+
size: "md",
|
|
226
|
+
className: "w-[144px]"
|
|
227
|
+
},
|
|
228
|
+
{
|
|
229
|
+
usage: ["icon-left", "icon-right"],
|
|
230
|
+
size: "lg",
|
|
231
|
+
className: "w-[156px]"
|
|
232
|
+
}
|
|
233
|
+
]
|
|
234
|
+
});
|
|
235
|
+
var sizeClasses = {
|
|
236
|
+
xs: {
|
|
237
|
+
container: twMerge("icon-frame-xs"),
|
|
238
|
+
icon: twMerge("icon-xs")
|
|
239
|
+
},
|
|
240
|
+
sm: {
|
|
241
|
+
container: twMerge("icon-frame-sm"),
|
|
242
|
+
icon: twMerge("icon-sm")
|
|
243
|
+
},
|
|
244
|
+
"md-sm": {
|
|
245
|
+
container: twMerge("icon-frame-md-sm"),
|
|
246
|
+
icon: twMerge("icon-md-sm")
|
|
247
|
+
},
|
|
248
|
+
md: {
|
|
249
|
+
container: twMerge("icon-frame-md"),
|
|
250
|
+
icon: twMerge("icon-md")
|
|
251
|
+
},
|
|
252
|
+
lg: {
|
|
253
|
+
container: twMerge("icon-frame-lg"),
|
|
254
|
+
icon: twMerge("icon-lg")
|
|
255
|
+
},
|
|
256
|
+
xl: {
|
|
257
|
+
container: twMerge("icon-frame-xl"),
|
|
258
|
+
icon: twMerge("icon-xl")
|
|
259
|
+
}
|
|
260
|
+
};
|
|
261
|
+
var getIconSizeClass = (size) => {
|
|
262
|
+
return sizeClasses[size].icon;
|
|
263
|
+
};
|
|
264
|
+
var getContainerClasses = (size, classNameProps) => {
|
|
265
|
+
return twMerge(
|
|
266
|
+
"inline-flex items-center justify-center",
|
|
267
|
+
classNameProps,
|
|
268
|
+
sizeClasses[size].container
|
|
269
|
+
);
|
|
270
|
+
};
|
|
271
|
+
var getIconClasses = (size, classNameProps) => {
|
|
272
|
+
return twMerge(classNameProps, getIconSizeClass(size));
|
|
273
|
+
};
|
|
274
|
+
|
|
275
|
+
// src/components/CubeButton/cubeButtonUtils.ts
|
|
276
|
+
var getIconSizeByButtonSize = (size) => {
|
|
277
|
+
const sizeMapping = {
|
|
278
|
+
sm: "md-sm",
|
|
279
|
+
md: "md",
|
|
280
|
+
lg: "md"
|
|
281
|
+
};
|
|
282
|
+
const iconSize = sizeMapping[size];
|
|
283
|
+
return getIconSizeClass(iconSize);
|
|
284
|
+
};
|
|
285
|
+
var CubeLeft = (props) => {
|
|
286
|
+
const { className } = props;
|
|
287
|
+
return /* @__PURE__ */ jsx(
|
|
288
|
+
"svg",
|
|
289
|
+
{
|
|
290
|
+
className,
|
|
291
|
+
width: "30",
|
|
292
|
+
height: "30",
|
|
293
|
+
viewBox: "0 0 30 30",
|
|
294
|
+
fill: "none",
|
|
295
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
296
|
+
children: /* @__PURE__ */ jsx(
|
|
297
|
+
"path",
|
|
298
|
+
{
|
|
299
|
+
d: "M5.96908 21.6725C5.36405 21.366 5.00776 20.7837 5.02457 20.1571L4.95062 11.9881C4.96743 11.4568 5.52875 11.1333 5.98252 11.3955L8.60428 12.9006C8.83284 13.0335 8.96729 13.2854 8.95385 13.5544L8.87654 17.6747C8.84629 18.4818 9.03115 19.0402 9.43114 19.5272C9.6429 19.786 9.90171 20.0005 10.1874 20.1674L13.9722 22.425C14.1839 22.551 14.315 22.786 14.315 23.038V25.534C14.315 26.0754 13.747 26.4159 13.2831 26.1503L5.96908 21.6725Z",
|
|
300
|
+
fill: "currentColor"
|
|
301
|
+
}
|
|
302
|
+
)
|
|
303
|
+
}
|
|
304
|
+
);
|
|
305
|
+
};
|
|
306
|
+
var CubeRight = (props) => {
|
|
307
|
+
const { className } = props;
|
|
308
|
+
return /* @__PURE__ */ jsx(
|
|
309
|
+
"svg",
|
|
310
|
+
{
|
|
311
|
+
className,
|
|
312
|
+
width: "30",
|
|
313
|
+
height: "30",
|
|
314
|
+
viewBox: "0 0 30 30",
|
|
315
|
+
fill: "none",
|
|
316
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
317
|
+
children: /* @__PURE__ */ jsx(
|
|
318
|
+
"path",
|
|
319
|
+
{
|
|
320
|
+
d: "M24.95 19.8473L25.0474 12.2945C25.0878 11.7258 24.4895 11.3411 24.0088 11.6305L16.7486 15.7849C16.5368 15.9108 15.9116 16.3637 15.9116 17.1469V25.5408C15.9116 26.089 16.4931 26.4295 16.9536 26.1503C16.9536 26.1503 24.0357 21.9108 24.234 21.7099C24.4323 21.509 24.95 21.1957 24.95 19.8473Z",
|
|
321
|
+
fill: "currentColor"
|
|
322
|
+
}
|
|
323
|
+
)
|
|
324
|
+
}
|
|
325
|
+
);
|
|
326
|
+
};
|
|
327
|
+
var CubeTop = (props) => {
|
|
328
|
+
const { className } = props;
|
|
329
|
+
return /* @__PURE__ */ jsx(
|
|
330
|
+
"svg",
|
|
331
|
+
{
|
|
332
|
+
className,
|
|
333
|
+
width: "30",
|
|
334
|
+
height: "30",
|
|
335
|
+
viewBox: "0 0 30 30",
|
|
336
|
+
fill: "none",
|
|
337
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
338
|
+
children: /* @__PURE__ */ jsx(
|
|
339
|
+
"path",
|
|
340
|
+
{
|
|
341
|
+
d: "M6.05312 8.78375L14.5268 3.83939C14.7352 3.7202 14.994 3.7202 15.2024 3.83939L23.5349 8.47728C24.0021 8.74629 24.0088 9.43074 23.545 9.70656L15.0511 14.6373C14.836 14.7667 14.5671 14.7667 14.352 14.6373L6.03968 10.013C5.57583 9.73721 5.58255 9.04936 6.05312 8.78375Z",
|
|
342
|
+
fill: "currentColor"
|
|
343
|
+
}
|
|
344
|
+
)
|
|
345
|
+
}
|
|
346
|
+
);
|
|
347
|
+
};
|
|
348
|
+
var CubeLogoSpinner = (props) => {
|
|
349
|
+
const { className } = props;
|
|
350
|
+
return (
|
|
351
|
+
// The size of container must be equal to the size of dots.
|
|
352
|
+
/* @__PURE__ */ jsxs(
|
|
353
|
+
"div",
|
|
354
|
+
{
|
|
355
|
+
className: twMerge(
|
|
356
|
+
"relative inline size-[30px] text-functional-text",
|
|
357
|
+
className
|
|
358
|
+
),
|
|
359
|
+
children: [
|
|
360
|
+
/* @__PURE__ */ jsx(CubeLeft, { className: "absolute animate-cube-spinner-vector-0" }),
|
|
361
|
+
/* @__PURE__ */ jsx(CubeTop, { className: "absolute animate-cube-spinner-vector-1" }),
|
|
362
|
+
/* @__PURE__ */ jsx(CubeRight, { className: "absolute animate-cube-spinner-vector-2" })
|
|
363
|
+
]
|
|
364
|
+
}
|
|
365
|
+
)
|
|
366
|
+
);
|
|
367
|
+
};
|
|
368
|
+
var Dot120 = (props) => {
|
|
369
|
+
const { className } = props;
|
|
370
|
+
return /* @__PURE__ */ jsx(
|
|
371
|
+
"svg",
|
|
372
|
+
{
|
|
373
|
+
className,
|
|
374
|
+
width: "16",
|
|
375
|
+
height: "16",
|
|
376
|
+
viewBox: "0 0 16 16",
|
|
377
|
+
fill: "none",
|
|
378
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
379
|
+
children: /* @__PURE__ */ jsx(
|
|
380
|
+
"path",
|
|
381
|
+
{
|
|
382
|
+
fillRule: "evenodd",
|
|
383
|
+
clipRule: "evenodd",
|
|
384
|
+
d: "M2.138 6.905c.59.003 1.065.482 1.062 1.071v.048a1.067 1.067 0 1 1-2.133.01v-.068a1.067 1.067 0 0 1 1.071-1.061Zm11.723 0a1.067 1.067 0 0 1 1.072 1.061v.068a1.067 1.067 0 1 1-2.133-.01v-.048a1.067 1.067 0 0 1 1.061-1.071ZM3.082 11.37a1.067 1.067 0 0 1 1.508.008l.033.033a1.067 1.067 0 1 1-1.548 1.468 1.067 1.067 0 0 1 .007-1.509Zm9.838 0a1.067 1.067 0 0 1-.04 1.556 1.067 1.067 0 0 1-1.501-1.515l.033-.033a1.067 1.067 0 0 1 1.508-.008Zm-6.014 2.492a1.067 1.067 0 0 1 1.07-1.062h.047a1.067 1.067 0 0 1 .01 2.133h-.067a1.067 1.067 0 0 1-1.061-1.072Z",
|
|
385
|
+
fill: "currentColor"
|
|
386
|
+
}
|
|
387
|
+
)
|
|
388
|
+
}
|
|
389
|
+
);
|
|
390
|
+
};
|
|
391
|
+
var CubeDotSpinner120 = (props) => {
|
|
392
|
+
const { className } = props;
|
|
393
|
+
return (
|
|
394
|
+
// The size of container must be equal to the size of dots.
|
|
395
|
+
/* @__PURE__ */ jsxs(
|
|
396
|
+
"div",
|
|
397
|
+
{
|
|
398
|
+
className: twMerge(
|
|
399
|
+
"relative inline size-4 text-cosmos-primary",
|
|
400
|
+
className
|
|
401
|
+
),
|
|
402
|
+
children: [
|
|
403
|
+
/* @__PURE__ */ jsx(Dot120, { className: "absolute rotate-0 animate-cube-dot-spinner-120-vector-0" }),
|
|
404
|
+
/* @__PURE__ */ jsx(Dot120, { className: "absolute rotate-[135deg] animate-cube-dot-spinner-120-vector-1" }),
|
|
405
|
+
/* @__PURE__ */ jsx(Dot120, { className: "absolute rotate-[270deg] animate-cube-dot-spinner-120-vector-2" })
|
|
406
|
+
]
|
|
407
|
+
}
|
|
408
|
+
)
|
|
409
|
+
);
|
|
410
|
+
};
|
|
411
|
+
var Dot45 = (props) => {
|
|
412
|
+
const { className } = props;
|
|
413
|
+
return /* @__PURE__ */ jsx(
|
|
414
|
+
"svg",
|
|
415
|
+
{
|
|
416
|
+
className,
|
|
417
|
+
width: "16",
|
|
418
|
+
height: "16",
|
|
419
|
+
viewBox: "0 0 16 16",
|
|
420
|
+
fill: "none",
|
|
421
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
422
|
+
children: /* @__PURE__ */ jsx(
|
|
423
|
+
"path",
|
|
424
|
+
{
|
|
425
|
+
fillRule: "evenodd",
|
|
426
|
+
clipRule: "evenodd",
|
|
427
|
+
d: "M3.38841 11.1597C3.78081 10.771 4.41397 10.7741 4.80261 11.1665L4.83351 11.1974C5.22591 11.586 5.22896 12.2192 4.84032 12.6116C4.45168 13.004 3.81852 13.007 3.42612 12.6184C3.41121 12.6036 3.39637 12.5888 3.3816 12.5739C2.99296 12.1815 2.99601 11.5483 3.38841 11.1597ZM12.6116 11.1597C13.004 11.5483 13.007 12.1815 12.6184 12.5739C12.6036 12.5888 12.5888 12.6036 12.5739 12.6184C12.1815 13.007 11.5483 13.004 11.1597 12.6116C10.771 12.2192 10.7741 11.586 11.1665 11.1974L11.1974 11.1665C11.586 10.7741 12.2192 10.771 12.6116 11.1597ZM6.9732 13.4952C6.97584 12.9429 7.42569 12.4973 7.97796 12.4999L8 12.5L8.02203 12.4999C8.57431 12.4973 9.02416 12.9429 9.02679 13.4952C9.02943 14.0474 8.58386 14.4973 8.03158 14.4999L8 14.5L7.96842 14.4999C7.41614 14.4973 6.97057 14.0474 6.9732 13.4952Z",
|
|
428
|
+
fill: "currentColor"
|
|
429
|
+
}
|
|
430
|
+
)
|
|
431
|
+
}
|
|
432
|
+
);
|
|
433
|
+
};
|
|
434
|
+
var CubeDotSpinner45 = (props) => {
|
|
435
|
+
const { className } = props;
|
|
436
|
+
return /* @__PURE__ */ jsxs(
|
|
437
|
+
"div",
|
|
438
|
+
{
|
|
439
|
+
className: twMerge(
|
|
440
|
+
// The size of container must be equal to the size of dots.
|
|
441
|
+
"relative inline size-4 text-cosmos-primary",
|
|
442
|
+
className
|
|
443
|
+
),
|
|
444
|
+
children: [
|
|
445
|
+
/* @__PURE__ */ jsx(Dot45, { className: "absolute rotate-0 animate-cube-dot-spinner-45-vector-0" }),
|
|
446
|
+
/* @__PURE__ */ jsx(Dot45, { className: "absolute rotate-45 animate-cube-dot-spinner-45-vector-1" }),
|
|
447
|
+
/* @__PURE__ */ jsx(Dot45, { className: "absolute rotate-90 animate-cube-dot-spinner-45-vector-2" }),
|
|
448
|
+
/* @__PURE__ */ jsx(Dot45, { className: "absolute rotate-[135deg] animate-cube-dot-spinner-45-vector-3" }),
|
|
449
|
+
/* @__PURE__ */ jsx(Dot45, { className: "absolute rotate-180 animate-cube-dot-spinner-45-vector-4" }),
|
|
450
|
+
/* @__PURE__ */ jsx(Dot45, { className: "absolute rotate-[225deg] animate-cube-dot-spinner-45-vector-5" }),
|
|
451
|
+
/* @__PURE__ */ jsx(Dot45, { className: "absolute rotate-[270deg] animate-cube-dot-spinner-45-vector-6" }),
|
|
452
|
+
/* @__PURE__ */ jsx(Dot45, { className: "absolute rotate-[315deg] animate-cube-dot-spinner-45-vector-7" })
|
|
453
|
+
]
|
|
454
|
+
}
|
|
455
|
+
);
|
|
456
|
+
};
|
|
457
|
+
var spinnerComponents = {
|
|
458
|
+
dot45: CubeDotSpinner45,
|
|
459
|
+
dot120: CubeDotSpinner120,
|
|
460
|
+
cube: CubeLogoSpinner
|
|
461
|
+
};
|
|
462
|
+
var CubeLoadingSpinner = (props) => {
|
|
463
|
+
const { variant, className } = props;
|
|
464
|
+
const Component = spinnerComponents[variant];
|
|
465
|
+
return /* @__PURE__ */ jsx(Component, { className });
|
|
466
|
+
};
|
|
467
|
+
var CubeButtonLoadingSpinner = (props) => {
|
|
468
|
+
const { type, usage } = props;
|
|
469
|
+
return /* @__PURE__ */ jsx(
|
|
470
|
+
CubeLoadingSpinner,
|
|
471
|
+
{
|
|
472
|
+
variant: "dot45",
|
|
473
|
+
className: loadingSpinner({ type, usage })
|
|
474
|
+
}
|
|
475
|
+
);
|
|
476
|
+
};
|
|
477
|
+
var CubeButton = (props) => {
|
|
478
|
+
const {
|
|
479
|
+
htmlType = "button",
|
|
480
|
+
type = "primary",
|
|
481
|
+
size = "md",
|
|
482
|
+
usage = "text-only",
|
|
483
|
+
disabled: disabledProp = false,
|
|
484
|
+
loading = false,
|
|
485
|
+
onClick,
|
|
486
|
+
className,
|
|
487
|
+
...restProps
|
|
488
|
+
} = props;
|
|
489
|
+
const disabled = disabledProp || loading;
|
|
490
|
+
const renderIcon = (Icon) => {
|
|
491
|
+
return /* @__PURE__ */ jsx("div", { className: twMerge(iconContainer({ size })), children: loading ? /* @__PURE__ */ jsx(CubeButtonLoadingSpinner, { type, usage }) : /* @__PURE__ */ jsx(Icon, { className: getIconSizeByButtonSize(size) }) });
|
|
492
|
+
};
|
|
493
|
+
const renderButtonContent = () => {
|
|
494
|
+
switch (props.usage) {
|
|
495
|
+
case "icon-only":
|
|
496
|
+
return renderIcon(props.Icon);
|
|
497
|
+
case "icon-left":
|
|
498
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
499
|
+
renderIcon(props.Icon),
|
|
500
|
+
props.children
|
|
501
|
+
] });
|
|
502
|
+
case "icon-right":
|
|
503
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
504
|
+
props.children,
|
|
505
|
+
renderIcon(props.Icon)
|
|
506
|
+
] });
|
|
507
|
+
case "text-only":
|
|
508
|
+
default:
|
|
509
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
510
|
+
props.children,
|
|
511
|
+
loading && /* @__PURE__ */ jsx(CubeButtonLoadingSpinner, { type, usage })
|
|
512
|
+
] });
|
|
513
|
+
}
|
|
514
|
+
};
|
|
515
|
+
return /* @__PURE__ */ jsx(
|
|
516
|
+
"button",
|
|
517
|
+
{
|
|
518
|
+
type: htmlType,
|
|
519
|
+
className: twMerge(
|
|
520
|
+
button({ type, size, usage, loading, disabled }),
|
|
521
|
+
className
|
|
522
|
+
),
|
|
523
|
+
disabled,
|
|
524
|
+
onClick,
|
|
525
|
+
...omit(restProps, "Icon"),
|
|
526
|
+
children: renderButtonContent()
|
|
527
|
+
}
|
|
528
|
+
);
|
|
529
|
+
};
|
|
530
|
+
var CubeSkeleton = (props) => {
|
|
531
|
+
const { className, style } = props;
|
|
532
|
+
return /* @__PURE__ */ jsx(
|
|
533
|
+
"div",
|
|
534
|
+
{
|
|
535
|
+
className: twMerge(
|
|
536
|
+
"cube-skeleton animate-cube-skeleton rounded-[5px]",
|
|
537
|
+
className
|
|
538
|
+
),
|
|
539
|
+
style
|
|
540
|
+
}
|
|
541
|
+
);
|
|
542
|
+
};
|
|
543
|
+
var CubeButtonSkeleton = (props) => {
|
|
544
|
+
const { size = "md", usage = "text-only" } = props;
|
|
545
|
+
return /* @__PURE__ */ jsx(CubeSkeleton, { className: twMerge(buttonSkeleton({ size, usage })) });
|
|
546
|
+
};
|
|
547
|
+
var CubeIconFrame = (props) => {
|
|
548
|
+
const { className: classNameProps, size = "md", children, onClick } = props;
|
|
549
|
+
const containerClasses = getContainerClasses(size, classNameProps);
|
|
550
|
+
const iconClasses = getIconClasses(size, children.props.className);
|
|
551
|
+
const icon = cloneElement(children, { className: iconClasses });
|
|
552
|
+
return /* @__PURE__ */ jsx("div", { className: containerClasses, onClick, children: icon });
|
|
553
|
+
};
|
|
554
|
+
var SvgView = ({
|
|
555
|
+
title,
|
|
556
|
+
titleId,
|
|
557
|
+
...props
|
|
558
|
+
}, ref) => /* @__PURE__ */ jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 16 15.286", ref, "aria-labelledby": titleId, ...props, children: [
|
|
559
|
+
title ? /* @__PURE__ */ jsx("title", { id: titleId, children: title }) : null,
|
|
560
|
+
/* @__PURE__ */ jsx("path", { fill: "currentColor", d: "m1.5 8-.58-.154a.6.6 0 0 0 0 .308zm13 0 .58.154a.6.6 0 0 0 0-.308zM9.718 8c0 .95-.77 1.721-1.721 1.721v1.2A2.92 2.92 0 0 0 10.918 8zM7.997 9.721c-.951 0-1.722-.77-1.722-1.721h-1.2a2.92 2.92 0 0 0 2.922 2.921zM6.275 8c0-.95.771-1.721 1.722-1.721v-1.2A2.92 2.92 0 0 0 5.075 8zm1.722-1.721c.95 0 1.721.77 1.721 1.721h1.2a2.92 2.92 0 0 0-2.921-2.921zm0-3.522C4.122 2.757 1.6 5.276.92 7.847l1.16.307c.549-2.073 2.615-4.197 5.917-4.197zM.92 8.154c.68 2.57 3.202 5.089 7.08 5.089v-1.2c-3.305 0-5.371-2.125-5.92-4.197zM8 13.243c3.878 0 6.396-2.519 7.08-5.089l-1.16-.308c-.552 2.073-2.615 4.197-5.92 4.197zm7.08-5.397c-.685-2.57-3.209-5.089-7.083-5.089v1.2c3.302 0 5.371 2.125 5.923 4.197z" })
|
|
561
|
+
] });
|
|
562
|
+
var ForwardRef = forwardRef(SvgView);
|
|
563
|
+
var View_default = ForwardRef;
|
|
564
|
+
var SvgViewOff = ({
|
|
565
|
+
title,
|
|
566
|
+
titleId,
|
|
567
|
+
...props
|
|
568
|
+
}, ref) => /* @__PURE__ */ jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 16 16", ref, "aria-labelledby": titleId, ...props, children: [
|
|
569
|
+
title ? /* @__PURE__ */ jsx("title", { id: titleId, children: title }) : null,
|
|
570
|
+
/* @__PURE__ */ jsx("path", { stroke: "currentColor", strokeLinecap: "round", strokeWidth: 1.2, d: "M5.675 8.143A2.32 2.32 0 0 1 7.997 5.82M6.41 9.838a2.321 2.321 0 0 0 3.322-3.237M11.715 4.5c1.464.893 2.419 2.268 2.785 3.643-.618 2.321-2.908 4.643-6.5 4.643-1.424 0-2.643-.365-3.635-.95M3 10.76a6.04 6.04 0 0 1-1.5-2.617C2.115 5.82 4.408 3.5 7.997 3.5c.761 0 1.464.105 2.106.291M14.2 2l-12 12" })
|
|
571
|
+
] });
|
|
572
|
+
var ForwardRef2 = forwardRef(SvgViewOff);
|
|
573
|
+
var ViewOff_default = ForwardRef2;
|
|
574
|
+
var SvgWarningFilled = ({
|
|
575
|
+
title,
|
|
576
|
+
titleId,
|
|
577
|
+
...props
|
|
578
|
+
}, ref) => /* @__PURE__ */ jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 16 16", ref, "aria-labelledby": titleId, ...props, children: [
|
|
579
|
+
title ? /* @__PURE__ */ jsx("title", { id: titleId, children: title }) : null,
|
|
580
|
+
/* @__PURE__ */ jsx("path", { fill: "currentColor", fillRule: "evenodd", d: "M8.1 15.2A7.1 7.1 0 1 0 8.1 1a7.1 7.1 0 0 0 0 14.2m.9-4.1a.9.9 0 1 1-1.8 0 .9.9 0 0 1 1.8 0M7.5 8.5a.6.6 0 0 0 1.2 0v-4a.6.6 0 1 0-1.2 0z", clipRule: "evenodd" })
|
|
581
|
+
] });
|
|
582
|
+
var ForwardRef3 = forwardRef(SvgWarningFilled);
|
|
583
|
+
var WarningFilled_default = ForwardRef3;
|
|
584
|
+
var input = cva(
|
|
585
|
+
[
|
|
586
|
+
"primary-body2 w-full truncate rounded-[6px] py-[9px] outline-none",
|
|
587
|
+
"bg-grey-0",
|
|
588
|
+
"text-functional-text placeholder:text-functional-border-darker",
|
|
589
|
+
"border border-functional-border-divider",
|
|
590
|
+
"hover:border-functional-hover-primary focus:border-functional-hover-primary"
|
|
591
|
+
],
|
|
592
|
+
{
|
|
593
|
+
variants: {
|
|
594
|
+
isError: {
|
|
595
|
+
true: [
|
|
596
|
+
"pl-4 pr-8",
|
|
597
|
+
"border-status-negative hover:border-status-negative"
|
|
598
|
+
]
|
|
599
|
+
},
|
|
600
|
+
disabled: {
|
|
601
|
+
true: [
|
|
602
|
+
"disabled:border-functional-disable-text disabled:text-functional-disable-text disabled:placeholder:text-functional-border-divider",
|
|
603
|
+
"disabled:hover:border-functional-disable-text"
|
|
604
|
+
]
|
|
605
|
+
},
|
|
606
|
+
hasIcon: {
|
|
607
|
+
true: "pl-4 pr-8",
|
|
608
|
+
false: "px-4"
|
|
609
|
+
}
|
|
610
|
+
},
|
|
611
|
+
compoundVariants: [
|
|
612
|
+
{ isError: true, hasIcon: true, class: "pr-[56px]" },
|
|
613
|
+
{ isError: true, hasIcon: false, class: "pr-9" }
|
|
614
|
+
]
|
|
615
|
+
}
|
|
616
|
+
);
|
|
617
|
+
var customIcon = cva("icon-md", {
|
|
618
|
+
variants: {
|
|
619
|
+
disabled: {
|
|
620
|
+
true: "cursor-default text-functional-border-divider",
|
|
621
|
+
false: "cursor-pointer text-functional-text"
|
|
622
|
+
}
|
|
623
|
+
}
|
|
624
|
+
});
|
|
625
|
+
var footer = cva("primary-body4", {
|
|
626
|
+
variants: {
|
|
627
|
+
isError: {
|
|
628
|
+
true: "text-status-negative",
|
|
629
|
+
false: "text-functional-text-light"
|
|
630
|
+
}
|
|
631
|
+
}
|
|
632
|
+
});
|
|
633
|
+
var skeleton = cva("w-full", {
|
|
634
|
+
variants: {
|
|
635
|
+
type: {
|
|
636
|
+
label: "h-[20px]",
|
|
637
|
+
input: "h-[38px]",
|
|
638
|
+
footer: "h-[16px]"
|
|
639
|
+
}
|
|
640
|
+
}
|
|
641
|
+
});
|
|
642
|
+
var CubeInputSkeleton = (props) => {
|
|
643
|
+
const { type } = props;
|
|
644
|
+
return /* @__PURE__ */ jsx(CubeSkeleton, { className: skeleton({ type }) });
|
|
645
|
+
};
|
|
646
|
+
var CubeInput = forwardRef(
|
|
647
|
+
(props, ref) => {
|
|
648
|
+
const {
|
|
649
|
+
className,
|
|
650
|
+
required = false,
|
|
651
|
+
isLoading = false,
|
|
652
|
+
label,
|
|
653
|
+
tooltip,
|
|
654
|
+
helpMessage,
|
|
655
|
+
errorMessage,
|
|
656
|
+
trailingIcon,
|
|
657
|
+
disabled,
|
|
658
|
+
...restProps
|
|
659
|
+
} = props;
|
|
660
|
+
const defaultId = useId();
|
|
661
|
+
const inputId = restProps.id || defaultId;
|
|
662
|
+
const isError = !!errorMessage && typeof errorMessage === "string";
|
|
663
|
+
const hasFooter = !!helpMessage || isError;
|
|
664
|
+
const hasIcon = !!trailingIcon;
|
|
665
|
+
const renderLabel = () => {
|
|
666
|
+
if (!label && !tooltip) return null;
|
|
667
|
+
if (isLoading) return /* @__PURE__ */ jsx(CubeInputSkeleton, { type: "label" });
|
|
668
|
+
return /* @__PURE__ */ jsxs("div", { className: "primary-body2 flex items-center space-x-1", children: [
|
|
669
|
+
/* @__PURE__ */ jsx(
|
|
670
|
+
"label",
|
|
671
|
+
{
|
|
672
|
+
htmlFor: inputId,
|
|
673
|
+
className: "font-semibold text-functional-title",
|
|
674
|
+
children: label
|
|
675
|
+
}
|
|
676
|
+
),
|
|
677
|
+
required && /* @__PURE__ */ jsx("span", { className: "text-status-negative", children: "*" }),
|
|
678
|
+
tooltip
|
|
679
|
+
] });
|
|
680
|
+
};
|
|
681
|
+
const renderIcon = () => {
|
|
682
|
+
const errorIcon = (() => {
|
|
683
|
+
if (!isError) return null;
|
|
684
|
+
return /* @__PURE__ */ jsx(WarningFilled_default, { className: "icon-md text-status-negative" });
|
|
685
|
+
})();
|
|
686
|
+
const customIcon2 = (() => {
|
|
687
|
+
if (!hasIcon) return null;
|
|
688
|
+
return cloneElement(trailingIcon, {
|
|
689
|
+
className: twMerge(
|
|
690
|
+
trailingIcon.props.className,
|
|
691
|
+
// Overrides icon size, color, and cursor style within the input.
|
|
692
|
+
customIcon({ disabled })
|
|
693
|
+
)
|
|
694
|
+
});
|
|
695
|
+
})();
|
|
696
|
+
return /* @__PURE__ */ jsxs("span", { className: "absolute right-0 flex h-4 shrink-0 -translate-x-4 items-center justify-center gap-2 overflow-hidden", children: [
|
|
697
|
+
errorIcon,
|
|
698
|
+
customIcon2
|
|
699
|
+
] });
|
|
700
|
+
};
|
|
701
|
+
const renderInput = () => {
|
|
702
|
+
if (isLoading) return /* @__PURE__ */ jsx(CubeInputSkeleton, { type: "input" });
|
|
703
|
+
return /* @__PURE__ */ jsx(
|
|
704
|
+
"input",
|
|
705
|
+
{
|
|
706
|
+
...restProps,
|
|
707
|
+
id: inputId,
|
|
708
|
+
ref,
|
|
709
|
+
disabled,
|
|
710
|
+
className: twMerge(input({ isError, disabled, hasIcon }), className),
|
|
711
|
+
required
|
|
712
|
+
}
|
|
713
|
+
);
|
|
714
|
+
};
|
|
715
|
+
const renderFooter = () => {
|
|
716
|
+
if (!hasFooter) return null;
|
|
717
|
+
if (isLoading) return /* @__PURE__ */ jsx(CubeInputSkeleton, { type: "footer" });
|
|
718
|
+
return /* @__PURE__ */ jsx("div", { className: twMerge(footer({ isError })), children: errorMessage ?? helpMessage });
|
|
719
|
+
};
|
|
720
|
+
return /* @__PURE__ */ jsxs("div", { className: "min-w-[202px] space-y-[6px]", children: [
|
|
721
|
+
renderLabel(),
|
|
722
|
+
/* @__PURE__ */ jsxs("div", { className: "relative flex items-center", children: [
|
|
723
|
+
renderInput(),
|
|
724
|
+
renderIcon()
|
|
725
|
+
] }),
|
|
726
|
+
renderFooter()
|
|
727
|
+
] });
|
|
728
|
+
}
|
|
729
|
+
);
|
|
730
|
+
CubeInput.displayName = "CubeInput";
|
|
731
|
+
var CubePasswordInput = (props) => {
|
|
732
|
+
const { initialShowPassword = false, disabled, ...restProps } = props;
|
|
733
|
+
const [showPassword, setShowPassword] = useState(initialShowPassword);
|
|
734
|
+
const handleShowHide = () => {
|
|
735
|
+
setShowPassword((prev) => !prev);
|
|
736
|
+
};
|
|
737
|
+
const IconComponent = showPassword ? View_default : ViewOff_default;
|
|
738
|
+
return /* @__PURE__ */ jsx(
|
|
739
|
+
CubeInput,
|
|
740
|
+
{
|
|
741
|
+
...restProps,
|
|
742
|
+
type: showPassword ? "text" : "password",
|
|
743
|
+
disabled,
|
|
744
|
+
trailingIcon: /* @__PURE__ */ jsx(IconComponent, { onClick: disabled ? void 0 : handleShowHide })
|
|
745
|
+
}
|
|
746
|
+
);
|
|
747
|
+
};
|
|
748
|
+
|
|
749
|
+
// src/i18n/resources/en-US.json
|
|
750
|
+
var en_US_default = {
|
|
751
|
+
"component.common.loading": "Loading",
|
|
752
|
+
"component.common.noData": "No Data"
|
|
753
|
+
};
|
|
754
|
+
|
|
755
|
+
// src/i18n/resources/zh-TW.json
|
|
756
|
+
var zh_TW_default = {
|
|
757
|
+
"component.common.loading": "\u8F09\u5165\u4E2D",
|
|
758
|
+
"component.common.noData": "\u6C92\u6709\u8CC7\u6599"
|
|
759
|
+
};
|
|
760
|
+
|
|
761
|
+
// src/i18n/i18n.ts
|
|
762
|
+
var i18n = i18next.createInstance();
|
|
763
|
+
i18n.use(initReactI18next).init({
|
|
764
|
+
resources: {
|
|
765
|
+
"en-US": { translation: en_US_default },
|
|
766
|
+
"zh-TW": { translation: zh_TW_default }
|
|
767
|
+
},
|
|
768
|
+
lng: "en-US",
|
|
769
|
+
fallbackLng: "en-US",
|
|
770
|
+
interpolation: {
|
|
771
|
+
escapeValue: false
|
|
772
|
+
// react already escapes from xss
|
|
773
|
+
}
|
|
774
|
+
});
|
|
775
|
+
var i18n_default = i18n;
|
|
776
|
+
|
|
777
|
+
// src/i18n/addCubeUiTranslations.ts
|
|
778
|
+
function addCubeUiTranslations(locale, resources) {
|
|
779
|
+
i18n_default.addResourceBundle(locale, "translation", resources, true, true);
|
|
780
|
+
if (i18n_default.isInitialized) {
|
|
781
|
+
i18n_default.emit("languageChanged", i18n_default.language);
|
|
782
|
+
}
|
|
783
|
+
}
|
|
784
|
+
var CubeUiLocaleProvider = (props) => {
|
|
785
|
+
const { locale, children } = props;
|
|
786
|
+
useEffect(() => {
|
|
787
|
+
i18n_default.changeLanguage(locale);
|
|
788
|
+
}, [locale]);
|
|
789
|
+
return children;
|
|
790
|
+
};
|
|
791
|
+
var useCubeUiTranslation = (ns, options) => {
|
|
792
|
+
return useTranslation(ns, { ...options, i18n: i18n_default });
|
|
793
|
+
};
|
|
794
|
+
var CubeThemeProvider = (props) => {
|
|
795
|
+
const { theme, children } = props;
|
|
796
|
+
useEffect(() => {
|
|
797
|
+
document.documentElement.dataset.cubeTheme = theme;
|
|
798
|
+
}, [theme]);
|
|
799
|
+
return children;
|
|
800
|
+
};
|
|
801
|
+
|
|
802
|
+
// src/theme/tokens/utils/animationKeyframes.ts
|
|
803
|
+
var skeletonKeyframes = {
|
|
804
|
+
"cube-skeleton": {
|
|
805
|
+
"100%": {
|
|
806
|
+
backgroundPositionX: "-20%"
|
|
807
|
+
}
|
|
808
|
+
}
|
|
809
|
+
};
|
|
810
|
+
var dotSpinner45Keyframes = {
|
|
811
|
+
"cube-dot-spinner-45-vector-0": {
|
|
812
|
+
"0%, 100%": { opacity: "1" },
|
|
813
|
+
"12.5%, 87.5%": { opacity: "0" }
|
|
814
|
+
},
|
|
815
|
+
"cube-dot-spinner-45-vector-1": {
|
|
816
|
+
"0%, 25%, 100%": { opacity: "0" },
|
|
817
|
+
"12.5%": { opacity: "1" }
|
|
818
|
+
},
|
|
819
|
+
"cube-dot-spinner-45-vector-2": {
|
|
820
|
+
"0%, 12.5%, 37.5%, 100%": { opacity: "0" },
|
|
821
|
+
"25%": { opacity: "1" }
|
|
822
|
+
},
|
|
823
|
+
"cube-dot-spinner-45-vector-3": {
|
|
824
|
+
"0%, 25%, 50%, 100%": { opacity: "0" },
|
|
825
|
+
"37.5%": { opacity: "1" }
|
|
826
|
+
},
|
|
827
|
+
"cube-dot-spinner-45-vector-4": {
|
|
828
|
+
"0%, 37.5%, 62.5%, 100%": { opacity: "0" },
|
|
829
|
+
"50%": { opacity: "1" }
|
|
830
|
+
},
|
|
831
|
+
"cube-dot-spinner-45-vector-5": {
|
|
832
|
+
"0%, 50%, 75%, 100%": { opacity: "0" },
|
|
833
|
+
"62.5%": { opacity: "1" }
|
|
834
|
+
},
|
|
835
|
+
"cube-dot-spinner-45-vector-6": {
|
|
836
|
+
"0%, 62.5%, 87.5%, 100%": { opacity: "0" },
|
|
837
|
+
"75%": { opacity: "1" }
|
|
838
|
+
},
|
|
839
|
+
"cube-dot-spinner-45-vector-7": {
|
|
840
|
+
"0%, 75%, 100%": { opacity: "0" },
|
|
841
|
+
"87.5%": { opacity: "1" }
|
|
842
|
+
}
|
|
843
|
+
};
|
|
844
|
+
var dotSpinner120Keyframes = {
|
|
845
|
+
"cube-dot-spinner-120-vector-0": {
|
|
846
|
+
"0%, 100%": { opacity: "1" },
|
|
847
|
+
"33.3%, 66.6%": { opacity: "0" }
|
|
848
|
+
},
|
|
849
|
+
"cube-dot-spinner-120-vector-1": {
|
|
850
|
+
"0%, 66.6%, 100%": { opacity: "0" },
|
|
851
|
+
"33.3%": { opacity: "1" }
|
|
852
|
+
},
|
|
853
|
+
"cube-dot-spinner-120-vector-2": {
|
|
854
|
+
"0%, 33.3%, 100%": { opacity: "0" },
|
|
855
|
+
"66.6%": { opacity: "1" }
|
|
856
|
+
}
|
|
857
|
+
};
|
|
858
|
+
var cubeSpinnerKeyframes = {
|
|
859
|
+
"cube-spinner-vector-0": {
|
|
860
|
+
"0%, 100%": { opacity: "1" },
|
|
861
|
+
"33.3%, 66.6%": { opacity: "0" }
|
|
862
|
+
},
|
|
863
|
+
"cube-spinner-vector-1": {
|
|
864
|
+
"0%, 66.6%, 100%": { opacity: "0" },
|
|
865
|
+
"33.3%": { opacity: "1" }
|
|
866
|
+
},
|
|
867
|
+
"cube-spinner-vector-2": {
|
|
868
|
+
"0%, 33.3%, 100%": { opacity: "0" },
|
|
869
|
+
"66.6%": { opacity: "1" }
|
|
870
|
+
}
|
|
871
|
+
};
|
|
872
|
+
var cubeAnimationKeyframes = {
|
|
873
|
+
...skeletonKeyframes,
|
|
874
|
+
...dotSpinner45Keyframes,
|
|
875
|
+
...dotSpinner120Keyframes,
|
|
876
|
+
...cubeSpinnerKeyframes
|
|
877
|
+
};
|
|
878
|
+
|
|
879
|
+
// src/theme/tokens/utils/animations.ts
|
|
880
|
+
var skeletonAnimations = {
|
|
881
|
+
"cube-skeleton": "cube-skeleton 1.5s ease-in-out infinite"
|
|
882
|
+
};
|
|
883
|
+
var dotSpinner45VectorShorthand = (vectorIndex) => `cube-dot-spinner-45-vector-${vectorIndex} 1s linear infinite`;
|
|
884
|
+
var dotSpinner45Animations = {
|
|
885
|
+
"cube-dot-spinner-45-vector-0": dotSpinner45VectorShorthand(0),
|
|
886
|
+
"cube-dot-spinner-45-vector-1": dotSpinner45VectorShorthand(1),
|
|
887
|
+
"cube-dot-spinner-45-vector-2": dotSpinner45VectorShorthand(2),
|
|
888
|
+
"cube-dot-spinner-45-vector-3": dotSpinner45VectorShorthand(3),
|
|
889
|
+
"cube-dot-spinner-45-vector-4": dotSpinner45VectorShorthand(4),
|
|
890
|
+
"cube-dot-spinner-45-vector-5": dotSpinner45VectorShorthand(5),
|
|
891
|
+
"cube-dot-spinner-45-vector-6": dotSpinner45VectorShorthand(6),
|
|
892
|
+
"cube-dot-spinner-45-vector-7": dotSpinner45VectorShorthand(7)
|
|
893
|
+
};
|
|
894
|
+
var dotSpinner120VectorShorthand = (vectorIndex) => `cube-dot-spinner-120-vector-${vectorIndex} 1s linear infinite`;
|
|
895
|
+
var dotSpinner120Animations = {
|
|
896
|
+
"cube-dot-spinner-120-vector-0": dotSpinner120VectorShorthand(0),
|
|
897
|
+
"cube-dot-spinner-120-vector-1": dotSpinner120VectorShorthand(1),
|
|
898
|
+
"cube-dot-spinner-120-vector-2": dotSpinner120VectorShorthand(2)
|
|
899
|
+
};
|
|
900
|
+
var cubeSpinnerVectorShorthand = (vectorIndex) => `cube-spinner-vector-${vectorIndex} 1.25s linear infinite`;
|
|
901
|
+
var cubeSpinnerAnimations = {
|
|
902
|
+
"cube-spinner-vector-0": cubeSpinnerVectorShorthand(0),
|
|
903
|
+
"cube-spinner-vector-1": cubeSpinnerVectorShorthand(1),
|
|
904
|
+
"cube-spinner-vector-2": cubeSpinnerVectorShorthand(2)
|
|
905
|
+
};
|
|
906
|
+
var cubeAnimations = {
|
|
907
|
+
...skeletonAnimations,
|
|
908
|
+
...dotSpinner45Animations,
|
|
909
|
+
...dotSpinner120Animations,
|
|
910
|
+
...cubeSpinnerAnimations
|
|
911
|
+
};
|
|
912
|
+
|
|
913
|
+
// src/theme/tokens/cubeTheme.ts
|
|
914
|
+
var cubeTheme = {
|
|
915
|
+
screens: {
|
|
916
|
+
"height-sm": {
|
|
917
|
+
raw: "(min-height: 768px)"
|
|
918
|
+
},
|
|
919
|
+
"height-md": {
|
|
920
|
+
raw: "(min-height: 864px)"
|
|
921
|
+
},
|
|
922
|
+
"height-lg": {
|
|
923
|
+
raw: "(min-height: 960px)"
|
|
924
|
+
},
|
|
925
|
+
"height-xl": {
|
|
926
|
+
raw: "(min-height: 1080px)"
|
|
927
|
+
}
|
|
928
|
+
},
|
|
929
|
+
colors: {
|
|
930
|
+
// Every color below resolves through a CSS custom property (defined in
|
|
931
|
+
// `themes/*.css`) so a consuming product can swap colors at runtime
|
|
932
|
+
// without a rebuild. Only `cubeCOS` sets all of them; other
|
|
933
|
+
// themes only need to override the tokens that actually differ (e.g.
|
|
934
|
+
// primary/secondary/cosmos) - anything unset falls back to `cubeCOS`'s
|
|
935
|
+
// value via normal CSS cascade.
|
|
936
|
+
primary: {
|
|
937
|
+
DEFAULT: "var(--cube-color-primary-DEFAULT)",
|
|
938
|
+
0: "var(--cube-color-primary-0)",
|
|
939
|
+
50: "var(--cube-color-primary-50)",
|
|
940
|
+
100: "var(--cube-color-primary-100)",
|
|
941
|
+
150: "var(--cube-color-primary-150)",
|
|
942
|
+
200: "var(--cube-color-primary-200)",
|
|
943
|
+
300: "var(--cube-color-primary-300)",
|
|
944
|
+
400: "var(--cube-color-primary-400)",
|
|
945
|
+
500: "var(--cube-color-primary-500)",
|
|
946
|
+
600: "var(--cube-color-primary-600)",
|
|
947
|
+
700: "var(--cube-color-primary-700)",
|
|
948
|
+
800: "var(--cube-color-primary-800)",
|
|
949
|
+
850: "var(--cube-color-primary-850)"
|
|
950
|
+
},
|
|
951
|
+
secondary: {
|
|
952
|
+
DEFAULT: "var(--cube-color-secondary-DEFAULT)",
|
|
953
|
+
0: "var(--cube-color-secondary-0)",
|
|
954
|
+
50: "var(--cube-color-secondary-50)",
|
|
955
|
+
100: "var(--cube-color-secondary-100)",
|
|
956
|
+
150: "var(--cube-color-secondary-150)",
|
|
957
|
+
200: "var(--cube-color-secondary-200)",
|
|
958
|
+
300: "var(--cube-color-secondary-300)",
|
|
959
|
+
400: "var(--cube-color-secondary-400)",
|
|
960
|
+
500: "var(--cube-color-secondary-500)",
|
|
961
|
+
600: "var(--cube-color-secondary-600)",
|
|
962
|
+
700: "var(--cube-color-secondary-700)",
|
|
963
|
+
800: "var(--cube-color-secondary-800)",
|
|
964
|
+
850: "var(--cube-color-secondary-850)"
|
|
965
|
+
},
|
|
966
|
+
dark: {
|
|
967
|
+
0: "var(--cube-color-dark-0)",
|
|
968
|
+
50: "var(--cube-color-dark-50)",
|
|
969
|
+
100: "var(--cube-color-dark-100)",
|
|
970
|
+
150: "var(--cube-color-dark-150)",
|
|
971
|
+
200: "var(--cube-color-dark-200)",
|
|
972
|
+
300: "var(--cube-color-dark-300)",
|
|
973
|
+
400: "var(--cube-color-dark-400)",
|
|
974
|
+
500: "var(--cube-color-dark-500)",
|
|
975
|
+
600: "var(--cube-color-dark-600)",
|
|
976
|
+
700: "var(--cube-color-dark-700)",
|
|
977
|
+
800: "var(--cube-color-dark-800)",
|
|
978
|
+
850: "var(--cube-color-dark-850)"
|
|
979
|
+
},
|
|
980
|
+
grey: {
|
|
981
|
+
0: "var(--cube-color-grey-0)",
|
|
982
|
+
50: "var(--cube-color-grey-50)",
|
|
983
|
+
100: "var(--cube-color-grey-100)",
|
|
984
|
+
150: "var(--cube-color-grey-150)",
|
|
985
|
+
200: "var(--cube-color-grey-200)",
|
|
986
|
+
300: "var(--cube-color-grey-300)",
|
|
987
|
+
400: "var(--cube-color-grey-400)",
|
|
988
|
+
500: "var(--cube-color-grey-500)",
|
|
989
|
+
600: "var(--cube-color-grey-600)",
|
|
990
|
+
700: "var(--cube-color-grey-700)",
|
|
991
|
+
800: "var(--cube-color-grey-800)",
|
|
992
|
+
850: "var(--cube-color-grey-850)"
|
|
993
|
+
},
|
|
994
|
+
blue: {
|
|
995
|
+
0: "var(--cube-color-blue-0)",
|
|
996
|
+
50: "var(--cube-color-blue-50)",
|
|
997
|
+
100: "var(--cube-color-blue-100)",
|
|
998
|
+
150: "var(--cube-color-blue-150)",
|
|
999
|
+
200: "var(--cube-color-blue-200)",
|
|
1000
|
+
300: "var(--cube-color-blue-300)",
|
|
1001
|
+
400: "var(--cube-color-blue-400)",
|
|
1002
|
+
500: "var(--cube-color-blue-500)",
|
|
1003
|
+
600: "var(--cube-color-blue-600)",
|
|
1004
|
+
700: "var(--cube-color-blue-700)",
|
|
1005
|
+
800: "var(--cube-color-blue-800)",
|
|
1006
|
+
850: "var(--cube-color-blue-850)"
|
|
1007
|
+
},
|
|
1008
|
+
green: {
|
|
1009
|
+
0: "var(--cube-color-green-0)",
|
|
1010
|
+
50: "var(--cube-color-green-50)",
|
|
1011
|
+
100: "var(--cube-color-green-100)",
|
|
1012
|
+
150: "var(--cube-color-green-150)",
|
|
1013
|
+
200: "var(--cube-color-green-200)",
|
|
1014
|
+
300: "var(--cube-color-green-300)",
|
|
1015
|
+
400: "var(--cube-color-green-400)",
|
|
1016
|
+
500: "var(--cube-color-green-500)",
|
|
1017
|
+
600: "var(--cube-color-green-600)",
|
|
1018
|
+
700: "var(--cube-color-green-700)",
|
|
1019
|
+
800: "var(--cube-color-green-800)",
|
|
1020
|
+
850: "var(--cube-color-green-850)"
|
|
1021
|
+
},
|
|
1022
|
+
yellow: {
|
|
1023
|
+
0: "var(--cube-color-yellow-0)",
|
|
1024
|
+
50: "var(--cube-color-yellow-50)",
|
|
1025
|
+
100: "var(--cube-color-yellow-100)",
|
|
1026
|
+
150: "var(--cube-color-yellow-150)",
|
|
1027
|
+
200: "var(--cube-color-yellow-200)",
|
|
1028
|
+
300: "var(--cube-color-yellow-300)",
|
|
1029
|
+
400: "var(--cube-color-yellow-400)",
|
|
1030
|
+
500: "var(--cube-color-yellow-500)",
|
|
1031
|
+
600: "var(--cube-color-yellow-600)",
|
|
1032
|
+
700: "var(--cube-color-yellow-700)",
|
|
1033
|
+
800: "var(--cube-color-yellow-800)",
|
|
1034
|
+
850: "var(--cube-color-yellow-850)"
|
|
1035
|
+
},
|
|
1036
|
+
red: {
|
|
1037
|
+
0: "var(--cube-color-red-0)",
|
|
1038
|
+
50: "var(--cube-color-red-50)",
|
|
1039
|
+
100: "var(--cube-color-red-100)",
|
|
1040
|
+
150: "var(--cube-color-red-150)",
|
|
1041
|
+
200: "var(--cube-color-red-200)",
|
|
1042
|
+
300: "var(--cube-color-red-300)",
|
|
1043
|
+
400: "var(--cube-color-red-400)",
|
|
1044
|
+
500: "var(--cube-color-red-500)",
|
|
1045
|
+
600: "var(--cube-color-red-600)",
|
|
1046
|
+
700: "var(--cube-color-red-700)",
|
|
1047
|
+
800: "var(--cube-color-red-800)",
|
|
1048
|
+
850: "var(--cube-color-red-850)"
|
|
1049
|
+
},
|
|
1050
|
+
cosmos: {
|
|
1051
|
+
primary: "var(--cube-color-primary-DEFAULT)",
|
|
1052
|
+
secondary: "var(--cube-color-secondary-DEFAULT)"
|
|
1053
|
+
},
|
|
1054
|
+
scene: {
|
|
1055
|
+
gradient: "linear-gradient(90deg, var(--cube-color-scene-gradient-1) 0%, var(--cube-color-scene-gradient-2) 30%, var(--cube-color-scene-gradient-3) 65%, var(--cube-color-scene-gradient-4) 100%)",
|
|
1056
|
+
background: "var(--cube-color-scene-background)"
|
|
1057
|
+
},
|
|
1058
|
+
functional: {
|
|
1059
|
+
title: "var(--cube-color-functional-title)",
|
|
1060
|
+
text: "var(--cube-color-functional-text)",
|
|
1061
|
+
"text-light": "var(--cube-color-functional-text-light)",
|
|
1062
|
+
"hover-primary": "var(--cube-color-functional-hover-primary)",
|
|
1063
|
+
"hover-secondary": "var(--cube-color-functional-hover-secondary)",
|
|
1064
|
+
"hover-grey": "var(--cube-color-functional-hover-grey)",
|
|
1065
|
+
"hover-grey-darker": "var(--cube-color-functional-hover-grey-darker)",
|
|
1066
|
+
"border-divider": "var(--cube-color-functional-border-divider)",
|
|
1067
|
+
"border-darker": "var(--cube-color-functional-border-darker)",
|
|
1068
|
+
disable: "var(--cube-color-functional-disable)",
|
|
1069
|
+
"disable-text": "var(--cube-color-functional-disable-text)",
|
|
1070
|
+
"disable-light": "var(--cube-color-functional-disable-light)",
|
|
1071
|
+
skeleton: "var(--cube-color-functional-skeleton)"
|
|
1072
|
+
},
|
|
1073
|
+
status: {
|
|
1074
|
+
positive: "var(--cube-color-status-positive)",
|
|
1075
|
+
"positive-text": "var(--cube-color-status-positive-text)",
|
|
1076
|
+
negative: "var(--cube-color-status-negative)",
|
|
1077
|
+
warning: "var(--cube-color-status-warning)",
|
|
1078
|
+
paused: "var(--cube-color-status-paused)",
|
|
1079
|
+
neutral: "var(--cube-color-status-neutral)",
|
|
1080
|
+
"over-limit": "var(--cube-color-status-over-limit)"
|
|
1081
|
+
},
|
|
1082
|
+
chart: {
|
|
1083
|
+
1: "var(--cube-color-chart-1)",
|
|
1084
|
+
2: "var(--cube-color-chart-2)",
|
|
1085
|
+
3: "var(--cube-color-chart-3)",
|
|
1086
|
+
4: "var(--cube-color-chart-4)",
|
|
1087
|
+
5: "var(--cube-color-chart-5)",
|
|
1088
|
+
6: "var(--cube-color-chart-6)",
|
|
1089
|
+
7: "var(--cube-color-chart-7)",
|
|
1090
|
+
8: "var(--cube-color-chart-8)",
|
|
1091
|
+
9: "var(--cube-color-chart-9)",
|
|
1092
|
+
10: "var(--cube-color-chart-10)",
|
|
1093
|
+
11: "var(--cube-color-chart-11)",
|
|
1094
|
+
12: "var(--cube-color-chart-12)",
|
|
1095
|
+
13: "var(--cube-color-chart-13)",
|
|
1096
|
+
14: "var(--cube-color-chart-14)",
|
|
1097
|
+
15: "var(--cube-color-chart-15)",
|
|
1098
|
+
16: "var(--cube-color-chart-16)",
|
|
1099
|
+
17: "var(--cube-color-chart-17)",
|
|
1100
|
+
18: "var(--cube-color-chart-18)",
|
|
1101
|
+
19: "var(--cube-color-chart-19)",
|
|
1102
|
+
20: "var(--cube-color-chart-20)",
|
|
1103
|
+
21: "var(--cube-color-chart-21)",
|
|
1104
|
+
22: "var(--cube-color-chart-22)",
|
|
1105
|
+
23: "var(--cube-color-chart-23)",
|
|
1106
|
+
24: "var(--cube-color-chart-24)",
|
|
1107
|
+
25: "var(--cube-color-chart-25)",
|
|
1108
|
+
26: "var(--cube-color-chart-26)",
|
|
1109
|
+
27: "var(--cube-color-chart-27)",
|
|
1110
|
+
28: "var(--cube-color-chart-28)",
|
|
1111
|
+
29: "var(--cube-color-chart-29)",
|
|
1112
|
+
30: "var(--cube-color-chart-30)",
|
|
1113
|
+
31: "var(--cube-color-chart-31)",
|
|
1114
|
+
32: "var(--cube-color-chart-32)"
|
|
1115
|
+
}
|
|
1116
|
+
},
|
|
1117
|
+
fontFamily: {
|
|
1118
|
+
// Fallback to Noto Sans TC for Traditional Chinese.
|
|
1119
|
+
urbanist: ["Urbanist", "Noto Sans TC", ...defaultTheme.fontFamily.sans],
|
|
1120
|
+
inter: ["Inter", "Noto Sans TC", ...defaultTheme.fontFamily.sans],
|
|
1121
|
+
["noto-sans-tc"]: ["Noto Sans TC", ...defaultTheme.fontFamily.sans],
|
|
1122
|
+
sans: ["Inter", "Noto Sans TC", ...defaultTheme.fontFamily.sans]
|
|
1123
|
+
},
|
|
1124
|
+
fontWeight: {
|
|
1125
|
+
regular: "400",
|
|
1126
|
+
medium: "500",
|
|
1127
|
+
semibold: "600"
|
|
1128
|
+
},
|
|
1129
|
+
keyframes: {
|
|
1130
|
+
...cubeAnimationKeyframes
|
|
1131
|
+
},
|
|
1132
|
+
animation: {
|
|
1133
|
+
...cubeAnimations
|
|
1134
|
+
}
|
|
1135
|
+
};
|
|
1136
|
+
|
|
1137
|
+
// src/theme/tokens/plugins/backgroundGradientPlugin.ts
|
|
1138
|
+
var backgroundGradientPlugin = ({
|
|
1139
|
+
addUtilities,
|
|
1140
|
+
theme
|
|
1141
|
+
}) => {
|
|
1142
|
+
addUtilities({
|
|
1143
|
+
".background-scene-gradient": {
|
|
1144
|
+
background: theme("colors.scene.gradient")
|
|
1145
|
+
},
|
|
1146
|
+
".bg-image-scene-gradient": {
|
|
1147
|
+
backgroundImage: theme("colors.scene.gradient")
|
|
1148
|
+
}
|
|
1149
|
+
});
|
|
1150
|
+
};
|
|
1151
|
+
|
|
1152
|
+
// src/theme/tokens/plugins/iconPlugin.ts
|
|
1153
|
+
var iconPlugin = ({ addComponents }) => {
|
|
1154
|
+
addComponents({
|
|
1155
|
+
".icon-xs": {
|
|
1156
|
+
width: "10px",
|
|
1157
|
+
height: "10px"
|
|
1158
|
+
},
|
|
1159
|
+
".icon-frame-xs": {
|
|
1160
|
+
width: "16px",
|
|
1161
|
+
height: "16px"
|
|
1162
|
+
},
|
|
1163
|
+
".icon-sm": {
|
|
1164
|
+
width: "12px",
|
|
1165
|
+
height: "12px"
|
|
1166
|
+
},
|
|
1167
|
+
".icon-frame-sm": {
|
|
1168
|
+
width: "24px",
|
|
1169
|
+
height: "24px"
|
|
1170
|
+
},
|
|
1171
|
+
".icon-md-sm": {
|
|
1172
|
+
width: "14px",
|
|
1173
|
+
height: "14px"
|
|
1174
|
+
},
|
|
1175
|
+
".icon-frame-md-sm": {
|
|
1176
|
+
width: "28px",
|
|
1177
|
+
height: "28px"
|
|
1178
|
+
},
|
|
1179
|
+
".icon-md": {
|
|
1180
|
+
width: "16px",
|
|
1181
|
+
height: "16px"
|
|
1182
|
+
},
|
|
1183
|
+
".icon-frame-md": {
|
|
1184
|
+
width: "32px",
|
|
1185
|
+
height: "32px"
|
|
1186
|
+
},
|
|
1187
|
+
".icon-lg": {
|
|
1188
|
+
width: "18px",
|
|
1189
|
+
height: "18px"
|
|
1190
|
+
},
|
|
1191
|
+
".icon-frame-lg": {
|
|
1192
|
+
width: "40px",
|
|
1193
|
+
height: "40px"
|
|
1194
|
+
},
|
|
1195
|
+
".icon-xl": {
|
|
1196
|
+
width: "24px",
|
|
1197
|
+
height: "24px"
|
|
1198
|
+
},
|
|
1199
|
+
".icon-frame-xl": {
|
|
1200
|
+
width: "48px",
|
|
1201
|
+
height: "48px"
|
|
1202
|
+
}
|
|
1203
|
+
});
|
|
1204
|
+
};
|
|
1205
|
+
|
|
1206
|
+
// src/theme/tokens/plugins/skeletonPlugin.ts
|
|
1207
|
+
var skeletonPlugin = ({ addComponents, theme }) => {
|
|
1208
|
+
const skeletonColor = theme("colors.functional.skeleton");
|
|
1209
|
+
addComponents({
|
|
1210
|
+
".cube-skeleton": {
|
|
1211
|
+
background: `linear-gradient(90deg, transparent 60%, rgba(255, 255, 255, .5) 70%, transparent 80%) ${skeletonColor}`,
|
|
1212
|
+
backgroundSize: "200% 100%",
|
|
1213
|
+
backgroundPositionX: "180%"
|
|
1214
|
+
}
|
|
1215
|
+
});
|
|
1216
|
+
};
|
|
1217
|
+
|
|
1218
|
+
// src/theme/tokens/utils/typography/primaryBodies.ts
|
|
1219
|
+
var FONT_FAMILY = "inter";
|
|
1220
|
+
var LETTER_SPACING = "normal";
|
|
1221
|
+
var FONT_WEIGHT = 400;
|
|
1222
|
+
var primaryBody1 = {
|
|
1223
|
+
fontFamily: FONT_FAMILY,
|
|
1224
|
+
fontSize: "15px",
|
|
1225
|
+
lineHeight: "22px",
|
|
1226
|
+
letterSpacing: LETTER_SPACING,
|
|
1227
|
+
fontWeight: FONT_WEIGHT
|
|
1228
|
+
};
|
|
1229
|
+
var primaryBody2 = {
|
|
1230
|
+
fontFamily: FONT_FAMILY,
|
|
1231
|
+
fontSize: "14px",
|
|
1232
|
+
lineHeight: "20px",
|
|
1233
|
+
letterSpacing: LETTER_SPACING,
|
|
1234
|
+
fontWeight: FONT_WEIGHT
|
|
1235
|
+
};
|
|
1236
|
+
var primaryBody3 = {
|
|
1237
|
+
fontFamily: FONT_FAMILY,
|
|
1238
|
+
fontSize: "13px",
|
|
1239
|
+
lineHeight: "18px",
|
|
1240
|
+
letterSpacing: LETTER_SPACING,
|
|
1241
|
+
fontWeight: FONT_WEIGHT
|
|
1242
|
+
};
|
|
1243
|
+
var primaryBody4 = {
|
|
1244
|
+
fontFamily: FONT_FAMILY,
|
|
1245
|
+
fontSize: "12px",
|
|
1246
|
+
lineHeight: "16px",
|
|
1247
|
+
letterSpacing: LETTER_SPACING,
|
|
1248
|
+
fontWeight: FONT_WEIGHT
|
|
1249
|
+
};
|
|
1250
|
+
var primaryBody5 = {
|
|
1251
|
+
fontFamily: FONT_FAMILY,
|
|
1252
|
+
fontSize: "11px",
|
|
1253
|
+
lineHeight: "15px",
|
|
1254
|
+
letterSpacing: LETTER_SPACING,
|
|
1255
|
+
fontWeight: FONT_WEIGHT
|
|
1256
|
+
};
|
|
1257
|
+
var primaryBody6 = {
|
|
1258
|
+
fontFamily: FONT_FAMILY,
|
|
1259
|
+
fontSize: "10px",
|
|
1260
|
+
lineHeight: "13px",
|
|
1261
|
+
letterSpacing: LETTER_SPACING,
|
|
1262
|
+
fontWeight: FONT_WEIGHT
|
|
1263
|
+
};
|
|
1264
|
+
|
|
1265
|
+
// src/theme/tokens/utils/typography/primaryHeadings.ts
|
|
1266
|
+
var FONT_FAMILY2 = "urbanist";
|
|
1267
|
+
var LETTER_SPACING2 = "0.02em";
|
|
1268
|
+
var FONT_WEIGHT2 = 600;
|
|
1269
|
+
var primaryH1 = {
|
|
1270
|
+
fontFamily: FONT_FAMILY2,
|
|
1271
|
+
fontSize: "30px",
|
|
1272
|
+
lineHeight: "38px",
|
|
1273
|
+
letterSpacing: LETTER_SPACING2,
|
|
1274
|
+
fontWeight: FONT_WEIGHT2
|
|
1275
|
+
};
|
|
1276
|
+
var primaryH2 = {
|
|
1277
|
+
fontFamily: FONT_FAMILY2,
|
|
1278
|
+
fontSize: "24px",
|
|
1279
|
+
lineHeight: "30px",
|
|
1280
|
+
letterSpacing: LETTER_SPACING2,
|
|
1281
|
+
fontWeight: FONT_WEIGHT2
|
|
1282
|
+
};
|
|
1283
|
+
var primaryH3 = {
|
|
1284
|
+
fontFamily: FONT_FAMILY2,
|
|
1285
|
+
fontSize: "20px",
|
|
1286
|
+
lineHeight: "24px",
|
|
1287
|
+
letterSpacing: LETTER_SPACING2,
|
|
1288
|
+
fontWeight: FONT_WEIGHT2
|
|
1289
|
+
};
|
|
1290
|
+
var primaryH4 = {
|
|
1291
|
+
fontFamily: FONT_FAMILY2,
|
|
1292
|
+
fontSize: "18px",
|
|
1293
|
+
lineHeight: "22px",
|
|
1294
|
+
letterSpacing: LETTER_SPACING2,
|
|
1295
|
+
fontWeight: FONT_WEIGHT2
|
|
1296
|
+
};
|
|
1297
|
+
var primaryH5 = {
|
|
1298
|
+
fontFamily: FONT_FAMILY2,
|
|
1299
|
+
fontSize: "16px",
|
|
1300
|
+
lineHeight: "20px",
|
|
1301
|
+
letterSpacing: LETTER_SPACING2,
|
|
1302
|
+
fontWeight: FONT_WEIGHT2
|
|
1303
|
+
};
|
|
1304
|
+
|
|
1305
|
+
// src/theme/tokens/utils/typography/secondaryBodies.ts
|
|
1306
|
+
var FONT_FAMILY3 = "urbanist";
|
|
1307
|
+
var LETTER_SPACING3 = "0.02em";
|
|
1308
|
+
var FONT_WEIGHT3 = 400;
|
|
1309
|
+
var secondaryBody1 = {
|
|
1310
|
+
fontFamily: FONT_FAMILY3,
|
|
1311
|
+
fontSize: "15px",
|
|
1312
|
+
lineHeight: "22px",
|
|
1313
|
+
letterSpacing: LETTER_SPACING3,
|
|
1314
|
+
fontWeight: FONT_WEIGHT3
|
|
1315
|
+
};
|
|
1316
|
+
var secondaryBody2 = {
|
|
1317
|
+
fontFamily: FONT_FAMILY3,
|
|
1318
|
+
fontSize: "14px",
|
|
1319
|
+
lineHeight: "18px",
|
|
1320
|
+
letterSpacing: LETTER_SPACING3,
|
|
1321
|
+
fontWeight: FONT_WEIGHT3
|
|
1322
|
+
};
|
|
1323
|
+
var secondaryBody3 = {
|
|
1324
|
+
fontFamily: FONT_FAMILY3,
|
|
1325
|
+
fontSize: "13px",
|
|
1326
|
+
lineHeight: "16px",
|
|
1327
|
+
letterSpacing: LETTER_SPACING3,
|
|
1328
|
+
fontWeight: FONT_WEIGHT3
|
|
1329
|
+
};
|
|
1330
|
+
var secondaryBody4 = {
|
|
1331
|
+
fontFamily: FONT_FAMILY3,
|
|
1332
|
+
fontSize: "12px",
|
|
1333
|
+
lineHeight: "16px",
|
|
1334
|
+
letterSpacing: LETTER_SPACING3,
|
|
1335
|
+
fontWeight: FONT_WEIGHT3
|
|
1336
|
+
};
|
|
1337
|
+
var secondaryBody5 = {
|
|
1338
|
+
fontFamily: FONT_FAMILY3,
|
|
1339
|
+
fontSize: "11px",
|
|
1340
|
+
lineHeight: "15px",
|
|
1341
|
+
letterSpacing: LETTER_SPACING3,
|
|
1342
|
+
fontWeight: FONT_WEIGHT3
|
|
1343
|
+
};
|
|
1344
|
+
var secondaryBody6 = {
|
|
1345
|
+
fontFamily: FONT_FAMILY3,
|
|
1346
|
+
fontSize: "10px",
|
|
1347
|
+
lineHeight: "14px",
|
|
1348
|
+
letterSpacing: LETTER_SPACING3,
|
|
1349
|
+
fontWeight: FONT_WEIGHT3
|
|
1350
|
+
};
|
|
1351
|
+
var secondaryBody7 = {
|
|
1352
|
+
fontFamily: FONT_FAMILY3,
|
|
1353
|
+
fontSize: "9px",
|
|
1354
|
+
lineHeight: "12px",
|
|
1355
|
+
letterSpacing: LETTER_SPACING3,
|
|
1356
|
+
fontWeight: FONT_WEIGHT3
|
|
1357
|
+
};
|
|
1358
|
+
|
|
1359
|
+
// src/theme/tokens/utils/typography/secondaryHeadings.ts
|
|
1360
|
+
var FONT_FAMILY4 = "inter";
|
|
1361
|
+
var LETTER_SPACING4 = "0.02em";
|
|
1362
|
+
var FONT_WEIGHT4 = 600;
|
|
1363
|
+
var secondaryH1 = {
|
|
1364
|
+
fontFamily: FONT_FAMILY4,
|
|
1365
|
+
fontSize: "30px",
|
|
1366
|
+
lineHeight: "38px",
|
|
1367
|
+
letterSpacing: LETTER_SPACING4,
|
|
1368
|
+
fontWeight: FONT_WEIGHT4
|
|
1369
|
+
};
|
|
1370
|
+
var secondaryH2 = {
|
|
1371
|
+
fontFamily: FONT_FAMILY4,
|
|
1372
|
+
fontSize: "24px",
|
|
1373
|
+
lineHeight: "30px",
|
|
1374
|
+
letterSpacing: LETTER_SPACING4,
|
|
1375
|
+
fontWeight: FONT_WEIGHT4
|
|
1376
|
+
};
|
|
1377
|
+
var secondaryH3 = {
|
|
1378
|
+
fontFamily: FONT_FAMILY4,
|
|
1379
|
+
fontSize: "20px",
|
|
1380
|
+
lineHeight: "24px",
|
|
1381
|
+
letterSpacing: LETTER_SPACING4,
|
|
1382
|
+
fontWeight: FONT_WEIGHT4
|
|
1383
|
+
};
|
|
1384
|
+
var secondaryH4 = {
|
|
1385
|
+
fontFamily: FONT_FAMILY4,
|
|
1386
|
+
fontSize: "18px",
|
|
1387
|
+
lineHeight: "22px",
|
|
1388
|
+
letterSpacing: LETTER_SPACING4,
|
|
1389
|
+
fontWeight: FONT_WEIGHT4
|
|
1390
|
+
};
|
|
1391
|
+
var secondaryH5 = {
|
|
1392
|
+
fontFamily: FONT_FAMILY4,
|
|
1393
|
+
fontSize: "16px",
|
|
1394
|
+
lineHeight: "20px",
|
|
1395
|
+
letterSpacing: LETTER_SPACING4,
|
|
1396
|
+
fontWeight: FONT_WEIGHT4
|
|
1397
|
+
};
|
|
1398
|
+
|
|
1399
|
+
// src/theme/tokens/utils/typography/typography.ts
|
|
1400
|
+
var typographyMap = {
|
|
1401
|
+
"primary-h1": primaryH1,
|
|
1402
|
+
"primary-h2": primaryH2,
|
|
1403
|
+
"primary-h3": primaryH3,
|
|
1404
|
+
"primary-h4": primaryH4,
|
|
1405
|
+
"primary-h5": primaryH5,
|
|
1406
|
+
"secondary-h1": secondaryH1,
|
|
1407
|
+
"secondary-h2": secondaryH2,
|
|
1408
|
+
"secondary-h3": secondaryH3,
|
|
1409
|
+
"secondary-h4": secondaryH4,
|
|
1410
|
+
"secondary-h5": secondaryH5,
|
|
1411
|
+
"primary-body1": primaryBody1,
|
|
1412
|
+
"primary-body2": primaryBody2,
|
|
1413
|
+
"primary-body3": primaryBody3,
|
|
1414
|
+
"primary-body4": primaryBody4,
|
|
1415
|
+
"primary-body5": primaryBody5,
|
|
1416
|
+
"primary-body6": primaryBody6,
|
|
1417
|
+
"secondary-body1": secondaryBody1,
|
|
1418
|
+
"secondary-body2": secondaryBody2,
|
|
1419
|
+
"secondary-body3": secondaryBody3,
|
|
1420
|
+
"secondary-body4": secondaryBody4,
|
|
1421
|
+
"secondary-body5": secondaryBody5,
|
|
1422
|
+
"secondary-body6": secondaryBody6,
|
|
1423
|
+
"secondary-body7": secondaryBody7
|
|
1424
|
+
};
|
|
1425
|
+
var getTypography = (className) => {
|
|
1426
|
+
return typographyMap[className];
|
|
1427
|
+
};
|
|
1428
|
+
|
|
1429
|
+
// src/theme/tokens/plugins/typographyPlugin.ts
|
|
1430
|
+
var typographyPlugin = ({ addComponents }) => {
|
|
1431
|
+
const components = Object.fromEntries(
|
|
1432
|
+
Object.entries(typographyMap).map(([className, typography]) => {
|
|
1433
|
+
const selector = `.${className}`;
|
|
1434
|
+
const fontFamily = cubeTheme.fontFamily[typography.fontFamily].join(", ");
|
|
1435
|
+
const definition = {
|
|
1436
|
+
fontFamily,
|
|
1437
|
+
fontSize: typography.fontSize,
|
|
1438
|
+
lineHeight: typography.lineHeight,
|
|
1439
|
+
letterSpacing: typography.letterSpacing ?? null,
|
|
1440
|
+
fontWeight: typography.fontWeight.toString()
|
|
1441
|
+
};
|
|
1442
|
+
return [selector, definition];
|
|
1443
|
+
})
|
|
1444
|
+
);
|
|
1445
|
+
addComponents(components);
|
|
1446
|
+
};
|
|
1447
|
+
|
|
1448
|
+
// src/theme/tokens/cubePreset.ts
|
|
1449
|
+
var cubePreset = {
|
|
1450
|
+
theme: {
|
|
1451
|
+
extend: cubeTheme
|
|
1452
|
+
},
|
|
1453
|
+
plugins: [
|
|
1454
|
+
backgroundGradientPlugin,
|
|
1455
|
+
iconPlugin,
|
|
1456
|
+
skeletonPlugin,
|
|
1457
|
+
typographyPlugin
|
|
1458
|
+
]
|
|
1459
|
+
};
|
|
1460
|
+
|
|
1461
|
+
export { CubeButton, CubeButtonSkeleton, CubeIconFrame, CubeInput, CubeLoadingSpinner, CubePasswordInput, CubeSkeleton, CubeThemeProvider, CubeUiLocaleProvider, addCubeUiTranslations, cubePreset, cubeTheme, getTypography, useCubeUiTranslation };
|
|
1462
|
+
//# sourceMappingURL=index.mjs.map
|
|
1463
|
+
//# sourceMappingURL=index.mjs.map
|