@particle-network/ui-react 0.5.1-beta.1 → 0.5.1-beta.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (89) hide show
  1. package/dist/components/ProgressWrapper/index.d.ts +2 -2
  2. package/dist/components/ProgressWrapper/index.js +1 -1
  3. package/dist/components/UXAutocomplete/index.js +1 -2
  4. package/dist/components/UXButton/button-theme.js +38 -2
  5. package/dist/components/UXButton/button.js +1 -1
  6. package/dist/components/UXCheckbox/checkbox.extend.js +16 -13
  7. package/dist/components/UXChip/chip.extend.d.ts +2 -1
  8. package/dist/components/UXChip/index.d.ts +1 -1
  9. package/dist/components/UXColorPicker/color-fields.d.ts +3 -0
  10. package/dist/components/UXColorPicker/color-fields.js +142 -0
  11. package/dist/components/UXColorPicker/color-input.d.ts +7 -0
  12. package/dist/components/UXColorPicker/color-input.js +12 -0
  13. package/dist/components/UXColorPicker/color-picker.d.ts +3 -0
  14. package/dist/components/UXColorPicker/color-picker.js +228 -0
  15. package/dist/components/UXColorPicker/index.d.ts +5 -0
  16. package/dist/components/UXColorPicker/index.js +3 -0
  17. package/dist/components/UXColorPicker/types.d.ts +51 -0
  18. package/dist/components/UXColorPicker/types.js +0 -0
  19. package/dist/components/UXColorPicker/utils.d.ts +7 -0
  20. package/dist/components/UXColorPicker/utils.js +6 -0
  21. package/dist/components/UXCopy/index.js +2 -2
  22. package/dist/components/UXEmpty/index.js +2 -2
  23. package/dist/components/UXHint/index.js +1 -1
  24. package/dist/components/UXInput/index.d.ts +6 -6
  25. package/dist/components/UXInput/input.extend.d.ts +6 -6
  26. package/dist/components/UXRadio/radio.extend.js +3 -3
  27. package/dist/components/UXSlider/use-slider.d.ts +1 -1
  28. package/dist/components/UXSlider/use-slider.js +1 -1
  29. package/dist/components/UXSpinner/spinner.d.ts +1 -5
  30. package/dist/components/UXSpinner/spinner.js +3 -4
  31. package/dist/components/UXSwitch/index.d.ts +2 -2
  32. package/dist/components/UXSwitch/switch.extend.d.ts +2 -2
  33. package/dist/components/UXSwitch/switch.extend.js +6 -6
  34. package/dist/components/UXTabs/tabs.classes.js +4 -4
  35. package/dist/components/UXThemeSwitch/constants.d.ts +9 -0
  36. package/dist/components/UXThemeSwitch/constants.js +3 -0
  37. package/dist/components/UXThemeSwitch/custom-theme-config.d.ts +2 -0
  38. package/dist/components/UXThemeSwitch/custom-theme-config.js +171 -0
  39. package/dist/components/UXThemeSwitch/theme-item.js +94 -15
  40. package/dist/components/UXThemeSwitch/theme-switch.js +26 -5
  41. package/dist/components/UXThemeSwitch/use-color-scheme.js +11 -8
  42. package/dist/components/UXThemeSwitch/use-theme-color.d.ts +1 -22
  43. package/dist/components/UXThemeSwitch/use-theme-color.js +3 -7
  44. package/dist/components/UXThemeSwitch/use-theme-store.d.ts +5 -0
  45. package/dist/components/UXThemeSwitch/use-theme-store.js +9 -3
  46. package/dist/components/UXThemeSwitch/use-theme.d.ts +2 -0
  47. package/dist/components/UXThemeSwitch/use-theme.js +10 -53
  48. package/dist/components/UXThemeSwitch/utils.d.ts +28 -0
  49. package/dist/components/UXThemeSwitch/utils.js +222 -0
  50. package/dist/components/UXToast/index.js +3 -3
  51. package/dist/components/index.d.ts +1 -0
  52. package/dist/components/index.js +1 -0
  53. package/dist/components/layout/Box/box-theme.d.ts +2213 -0
  54. package/dist/components/layout/Box/box-theme.js +344 -0
  55. package/dist/components/layout/Box/box.d.ts +14 -0
  56. package/dist/components/layout/Box/box.js +99 -0
  57. package/dist/components/layout/Circle.js +2 -3
  58. package/dist/components/layout/Flex.d.ts +3 -27
  59. package/dist/components/layout/Flex.js +6 -19
  60. package/dist/components/layout/HStack.d.ts +1 -1
  61. package/dist/components/layout/Square.js +3 -3
  62. package/dist/components/layout/VStack.d.ts +1 -1
  63. package/dist/components/layout/VStack.js +2 -2
  64. package/dist/components/layout/index.d.ts +1 -0
  65. package/dist/components/layout/index.js +1 -0
  66. package/dist/components/typography/Text.js +22 -7
  67. package/dist/components/typography/Text.type.d.ts +3 -26
  68. package/dist/components/typography/Text.type.js +0 -47
  69. package/dist/components/typography/text-theme.d.ts +178 -0
  70. package/dist/components/typography/text-theme.js +79 -0
  71. package/dist/heroui/constants.d.ts +18 -0
  72. package/dist/heroui/constants.js +98 -0
  73. package/dist/heroui/types.d.ts +91 -0
  74. package/dist/heroui/types.js +0 -0
  75. package/dist/heroui/utils/colors.d.ts +34 -0
  76. package/dist/heroui/utils/colors.js +121 -0
  77. package/dist/heroui/utils/object.d.ts +1 -0
  78. package/dist/heroui/utils/object.js +17 -0
  79. package/dist/hooks/useI18n.d.ts +133 -25
  80. package/dist/hooks/useI18n.js +84 -2
  81. package/dist/hooks/useLang.d.ts +5 -1
  82. package/dist/hooks/useLang.js +13 -1
  83. package/dist/utils/cn.d.ts +2 -0
  84. package/dist/utils/cn.js +258 -0
  85. package/dist/utils/index.d.ts +1 -0
  86. package/dist/utils/index.js +2 -1
  87. package/dist/utils/input-classes.js +2 -2
  88. package/package.json +6 -3
  89. package/tailwind-preset.js +84 -160
@@ -0,0 +1,344 @@
1
+ import { tv } from "@heroui/theme";
2
+ const spacingClasses = (prefix)=>({
3
+ px: `${prefix}-px`,
4
+ 0: `${prefix}-0`,
5
+ 1: `${prefix}-1`,
6
+ 2: `${prefix}-2`,
7
+ 3: `${prefix}-3`,
8
+ 4: `${prefix}-4`,
9
+ 5: `${prefix}-5`,
10
+ 6: `${prefix}-6`,
11
+ 7: `${prefix}-7`,
12
+ 8: `${prefix}-8`,
13
+ 9: `${prefix}-9`,
14
+ 10: `${prefix}-10`,
15
+ xs: `${prefix}-xs`,
16
+ sm: `${prefix}-sm`,
17
+ md: `${prefix}-md`,
18
+ lg: `${prefix}-lg`
19
+ });
20
+ const sizingClasses = (prefix)=>({
21
+ auto: `${prefix}-auto`,
22
+ px: `${prefix}-px`,
23
+ full: `${prefix}-full`,
24
+ screen: `${prefix}-screen`,
25
+ dvw: `${prefix}-dvw`,
26
+ dvh: `${prefix}-dvh`,
27
+ lvw: `${prefix}-lvw`,
28
+ lvh: `${prefix}-lvh`,
29
+ svw: `${prefix}-svw`,
30
+ svh: `${prefix}-svh`,
31
+ min: `${prefix}-min`,
32
+ max: `${prefix}-max`,
33
+ fit: `${prefix}-fit`
34
+ });
35
+ const sizingPresets = [
36
+ 'auto',
37
+ 'px',
38
+ 'full',
39
+ 'screen',
40
+ 'dvw',
41
+ 'dvh',
42
+ 'lvw',
43
+ 'lvh',
44
+ 'svw',
45
+ 'svh',
46
+ 'min',
47
+ 'max',
48
+ 'fit'
49
+ ];
50
+ const bgClasses = {
51
+ current: 'bg-current',
52
+ transparent: 'bg-transparent',
53
+ bgDefault: 'bg-background',
54
+ bgPure: 'light:bg-white dark:bg-black',
55
+ bg100: 'bg-background-100',
56
+ bg200: 'bg-background-200',
57
+ bg300: 'bg-background-300',
58
+ bg400: 'bg-background-400',
59
+ overlay: 'bg-overlay',
60
+ divider: 'bg-divider',
61
+ foreground: 'bg-foreground',
62
+ secondary: 'bg-secondary',
63
+ tertiary: 'bg-tertiary',
64
+ cursor: 'bg-cursor text-cursor-foreground',
65
+ primary: 'bg-primary text-primary-foreground',
66
+ success: 'bg-success text-success-foreground',
67
+ warning: 'bg-warning text-warning-foreground',
68
+ danger: 'bg-danger text-danger-foreground',
69
+ alert: 'bg-alert text-alert-foreground',
70
+ bullish: 'bg-bullish text-bullish-foreground',
71
+ bearish: 'bg-bearish text-bearish-foreground'
72
+ };
73
+ const colorClasses = {
74
+ current: 'text-current',
75
+ transparent: 'text-transparent',
76
+ divider: 'text-divider',
77
+ foreground: 'text-foreground',
78
+ secondary: 'text-secondary',
79
+ secondaryForeground: 'text-secondary-foreground',
80
+ tertiary: 'text-tertiary',
81
+ tertiaryForeground: 'text-tertiary-foreground',
82
+ cursor: 'text-cursor',
83
+ cursorForeground: 'text-cursor-foreground',
84
+ primary: 'text-primary',
85
+ primaryForeground: 'text-primary-foreground',
86
+ success: 'text-success',
87
+ successForeground: 'text-success-foreground',
88
+ warning: 'text-warning',
89
+ warningForeground: 'text-warning-foreground',
90
+ danger: 'text-danger',
91
+ dangerForeground: 'text-danger-foreground',
92
+ alert: 'text-alert',
93
+ alertForeground: 'text-alert-foreground',
94
+ bullish: 'text-bullish',
95
+ bullishForeground: 'text-bullish-foreground',
96
+ bearish: 'text-bearish',
97
+ bearishForeground: 'text-bearish-foreground'
98
+ };
99
+ const borderColorClasses = {
100
+ transparent: 'border-transparent',
101
+ divider: 'border-divider',
102
+ foreground: 'border-foreground',
103
+ secondary: 'border-secondary',
104
+ tertiary: 'border-tertiary',
105
+ cursor: 'border-cursor',
106
+ primary: 'border-primary',
107
+ success: 'border-success',
108
+ warning: 'border-warning',
109
+ danger: 'border-danger',
110
+ alert: 'border-alert',
111
+ bullish: 'border-bullish',
112
+ bearish: 'border-bearish'
113
+ };
114
+ const roundedClasses = {
115
+ none: 'rounded-none',
116
+ sm: 'rounded-sm',
117
+ md: 'rounded-md',
118
+ lg: 'rounded-lg',
119
+ xl: 'rounded-xl',
120
+ small: 'rounded-small',
121
+ medium: 'rounded-medium',
122
+ large: 'rounded-large',
123
+ full: 'rounded-full'
124
+ };
125
+ const boxVariants = tv({
126
+ base: 'ux-box-base',
127
+ variants: {
128
+ position: {
129
+ static: 'static',
130
+ relative: 'relative',
131
+ absolute: 'absolute',
132
+ fixed: 'fixed',
133
+ sticky: 'sticky'
134
+ },
135
+ top: spacingClasses('top'),
136
+ right: spacingClasses('right'),
137
+ bottom: spacingClasses('bottom'),
138
+ left: spacingClasses('left'),
139
+ start: spacingClasses('start'),
140
+ end: spacingClasses('end'),
141
+ inset: spacingClasses('inset'),
142
+ display: {
143
+ flex: 'flex',
144
+ inlineFlex: 'inline-flex',
145
+ block: 'block',
146
+ hidden: 'hidden',
147
+ grid: 'grid',
148
+ inlineGrid: 'inline-grid'
149
+ },
150
+ aspect: {
151
+ square: 'aspect-square',
152
+ video: 'aspect-video',
153
+ auto: 'aspect-auto'
154
+ },
155
+ overflow: {
156
+ visible: 'overflow-visible',
157
+ hidden: 'overflow-hidden',
158
+ clip: 'overflow-clip',
159
+ scroll: 'overflow-scroll',
160
+ auto: 'overflow-auto'
161
+ },
162
+ zIndex: {
163
+ auto: 'z-auto',
164
+ 0: 'z-0',
165
+ 10: 'z-10',
166
+ 20: 'z-20',
167
+ 30: 'z-30',
168
+ 40: 'z-40',
169
+ 50: 'z-50',
170
+ 60: 'z-60',
171
+ 70: 'z-70',
172
+ 80: 'z-80',
173
+ 90: 'z-90',
174
+ 100: 'z-100'
175
+ },
176
+ direction: {
177
+ row: 'flex-row',
178
+ col: 'flex-col',
179
+ 'row-reverse': 'flex-row-reverse',
180
+ 'col-reverse': 'flex-col-reverse'
181
+ },
182
+ items: {
183
+ start: 'items-start',
184
+ center: 'items-center',
185
+ end: 'items-end',
186
+ baseline: 'items-baseline',
187
+ stretch: 'items-stretch',
188
+ normal: 'items-normal'
189
+ },
190
+ justify: {
191
+ start: 'justify-start',
192
+ center: 'justify-center',
193
+ end: 'justify-end',
194
+ between: 'justify-between',
195
+ around: 'justify-around',
196
+ evenly: 'justify-evenly',
197
+ stretch: 'justify-stretch',
198
+ baseline: 'justify-baseline',
199
+ normal: 'justify-normal'
200
+ },
201
+ gap: spacingClasses('gap'),
202
+ wrap: {
203
+ true: 'flex-wrap',
204
+ wrap: 'flex-wrap',
205
+ nowrap: 'flex-nowrap',
206
+ 'wrap-reverse': 'flex-wrap-reverse'
207
+ },
208
+ self: {
209
+ auto: 'self-auto',
210
+ start: 'self-start',
211
+ end: 'self-end',
212
+ center: 'self-center',
213
+ stretch: 'self-stretch',
214
+ baseline: 'self-baseline',
215
+ normal: 'self-normal'
216
+ },
217
+ grow: {
218
+ true: 'grow',
219
+ 0: 'grow-0',
220
+ 1: 'grow'
221
+ },
222
+ shrink: {
223
+ true: 'shrink',
224
+ 0: 'shrink-0',
225
+ 1: 'shrink'
226
+ },
227
+ order: {
228
+ first: 'order-first',
229
+ last: 'order-last',
230
+ none: 'order-none',
231
+ 0: 'order-0',
232
+ 1: 'order-1',
233
+ 2: 'order-2',
234
+ 3: 'order-3',
235
+ 4: 'order-4',
236
+ 5: 'order-5',
237
+ 6: 'order-6',
238
+ 7: 'order-7',
239
+ 8: 'order-8',
240
+ 9: 'order-9',
241
+ 10: 'order-10'
242
+ },
243
+ fill: {
244
+ true: 'flex-1'
245
+ },
246
+ vertical: {
247
+ true: 'flex-col'
248
+ },
249
+ horizontal: {
250
+ true: 'flex-row'
251
+ },
252
+ center: {
253
+ true: 'items-center justify-center'
254
+ },
255
+ p: spacingClasses('p'),
256
+ pt: spacingClasses('pt'),
257
+ pr: spacingClasses('pr'),
258
+ pb: spacingClasses('pb'),
259
+ pl: spacingClasses('pl'),
260
+ ps: spacingClasses('ps'),
261
+ pe: spacingClasses('pe'),
262
+ px: spacingClasses('px'),
263
+ py: spacingClasses('py'),
264
+ m: spacingClasses('m'),
265
+ mt: spacingClasses('mt'),
266
+ mr: spacingClasses('mr'),
267
+ mb: spacingClasses('mb'),
268
+ ml: spacingClasses('ml'),
269
+ ms: spacingClasses('ms'),
270
+ me: spacingClasses('me'),
271
+ mx: spacingClasses('mx'),
272
+ my: spacingClasses('my'),
273
+ w: sizingClasses('w'),
274
+ h: sizingClasses('h'),
275
+ minW: sizingClasses('min-w'),
276
+ maxW: sizingClasses('max-w'),
277
+ minH: sizingClasses('min-h'),
278
+ maxH: sizingClasses('max-h'),
279
+ fullWidth: {
280
+ true: 'w-full'
281
+ },
282
+ fullHeight: {
283
+ true: 'h-full'
284
+ },
285
+ bg: bgClasses,
286
+ opacity: {
287
+ disabled: 'opacity-disabled',
288
+ hover: 'opacity-hover'
289
+ },
290
+ shadow: {
291
+ true: 'shadow-box',
292
+ box: 'shadow-box',
293
+ none: 'shadow-none',
294
+ sm: 'shadow-sm',
295
+ md: 'shadow-md',
296
+ lg: 'shadow-lg',
297
+ xl: 'shadow-xl'
298
+ },
299
+ rounded: roundedClasses,
300
+ radius: roundedClasses,
301
+ borderStyle: {
302
+ solid: 'border-solid',
303
+ dashed: 'border-dashed',
304
+ dotted: 'border-dotted',
305
+ double: 'border-double'
306
+ },
307
+ borderColor: borderColorClasses,
308
+ borderWidth: {
309
+ none: 'border-none',
310
+ '0.5': 'border-[0.5px]',
311
+ 1: 'border-[1px]',
312
+ '1.5': 'border-[1.5px]',
313
+ 2: 'border-[2px]'
314
+ },
315
+ cursor: {
316
+ auto: 'cursor-auto',
317
+ default: 'cursor-default',
318
+ pointer: 'cursor-pointer',
319
+ wait: 'cursor-wait',
320
+ help: 'cursor-help',
321
+ notAllowed: 'cursor-not-allowed'
322
+ },
323
+ color: colorClasses,
324
+ fontWeight: {
325
+ normal: 'font-normal',
326
+ medium: 'font-medium',
327
+ semibold: 'font-semibold',
328
+ bold: 'font-bold',
329
+ extrabold: 'font-extrabold'
330
+ },
331
+ lineHeight: {
332
+ 1: 'leading-none',
333
+ '1.4': 'leading-[1.4]'
334
+ },
335
+ textAlign: {
336
+ left: 'text-left',
337
+ center: 'text-center',
338
+ right: 'text-right'
339
+ }
340
+ },
341
+ compoundVariants: [],
342
+ defaultVariants: {}
343
+ });
344
+ export { boxVariants, sizingPresets };
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+ import type { HexColor } from '@particle-network/ui-shared';
3
+ import type { BoxVariants, Sizing } from './box-theme';
4
+ export interface BoxProps<T extends HTMLElement = HTMLDivElement> extends Omit<React.HTMLAttributes<T>, 'color'>, Omit<BoxVariants, 'color' | 'w' | 'h' | 'minW' | 'maxW' | 'minH' | 'maxH'> {
5
+ as?: React.ElementType;
6
+ w?: Sizing | number;
7
+ h?: Sizing | number;
8
+ minW?: Sizing | number;
9
+ maxW?: Sizing | number;
10
+ minH?: Sizing | number;
11
+ maxH?: Sizing | number;
12
+ color?: BoxVariants['color'] | HexColor;
13
+ }
14
+ export declare const Box: React.ForwardRefExoticComponent<BoxProps<HTMLDivElement> & React.RefAttributes<HTMLElement>>;
@@ -0,0 +1,99 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { forwardRef, useMemo } from "react";
3
+ import { boxVariants } from "./box-theme.js";
4
+ const Box = /*#__PURE__*/ forwardRef(({ as, position, top, right, bottom, left, start, end, inset, display, aspect, overflow, zIndex, direction, items, justify, gap, wrap, self, fill, vertical, horizontal, center, grow, shrink, order, p, pt, pr, pb, pl, ps, pe, px, py, m, mt, mr, mb, ml, ms, me, mx, my, w, h, minW, maxW, minH, maxH, fullWidth, fullHeight, bg, opacity, shadow, rounded, radius, borderStyle, borderColor, borderWidth, cursor, color, fontWeight, lineHeight, textAlign, style = {}, className, ...props }, ref)=>{
5
+ const Component = as || 'div';
6
+ const boxStyle = useMemo(()=>({
7
+ width: 'number' == typeof w ? `${w}px` : void 0,
8
+ height: 'number' == typeof h ? `${h}px` : void 0,
9
+ minWidth: 'number' == typeof minW ? `${minW}px` : void 0,
10
+ maxWidth: 'number' == typeof maxW ? `${maxW}px` : void 0,
11
+ minHeight: 'number' == typeof minH ? `${minH}px` : void 0,
12
+ maxHeight: 'number' == typeof maxH ? `${maxH}px` : void 0,
13
+ color: color?.startsWith('#') ? color : void 0,
14
+ ...style
15
+ }), [
16
+ w,
17
+ h,
18
+ minW,
19
+ maxW,
20
+ minH,
21
+ maxH,
22
+ color,
23
+ style
24
+ ]);
25
+ return /*#__PURE__*/ jsx(Component, {
26
+ ref: ref,
27
+ style: boxStyle,
28
+ className: boxVariants({
29
+ position,
30
+ top,
31
+ right,
32
+ bottom,
33
+ left,
34
+ start,
35
+ end,
36
+ inset,
37
+ display,
38
+ aspect,
39
+ overflow,
40
+ zIndex,
41
+ direction,
42
+ items,
43
+ justify,
44
+ gap,
45
+ wrap,
46
+ self,
47
+ fill,
48
+ vertical,
49
+ horizontal,
50
+ center,
51
+ grow,
52
+ shrink,
53
+ order,
54
+ p,
55
+ pt,
56
+ pr,
57
+ pb,
58
+ pl,
59
+ ps,
60
+ pe,
61
+ px,
62
+ py,
63
+ m,
64
+ mt,
65
+ mr,
66
+ mb,
67
+ ml,
68
+ ms,
69
+ me,
70
+ mx,
71
+ my,
72
+ w: w,
73
+ h: h,
74
+ minW: minW,
75
+ maxW: maxW,
76
+ minH: minH,
77
+ maxH: maxH,
78
+ fullWidth,
79
+ fullHeight,
80
+ bg,
81
+ opacity,
82
+ shadow,
83
+ rounded,
84
+ radius,
85
+ borderStyle,
86
+ borderColor,
87
+ borderWidth,
88
+ cursor,
89
+ color: color,
90
+ fontWeight,
91
+ lineHeight,
92
+ textAlign,
93
+ className
94
+ }),
95
+ ...props
96
+ });
97
+ });
98
+ Box.displayName = 'Box';
99
+ export { Box };
@@ -1,10 +1,9 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import { forwardRef } from "react";
3
- import { cn } from "@heroui/theme";
4
3
  import { Square } from "./Square.js";
5
- const Circle = /*#__PURE__*/ forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ jsx(Square, {
4
+ const Circle = /*#__PURE__*/ forwardRef((props, ref)=>/*#__PURE__*/ jsx(Square, {
6
5
  ref: ref,
7
- className: cn('rounded-full', className),
6
+ rounded: "full",
8
7
  ...props
9
8
  }));
10
9
  Circle.displayName = 'UX.Circle';
@@ -1,28 +1,4 @@
1
1
  import React from 'react';
2
- import { type UXSpacing } from '@particle-network/ui-shared';
3
- export type AlignItems = 'start' | 'end' | 'center' | 'baseline' | 'stretch' | 'normal';
4
- export type JustifyContent = 'start' | 'end' | 'center' | 'between' | 'around' | 'evenly' | 'stretch' | 'baseline' | 'normal';
5
- export interface FlexProps extends React.HTMLAttributes<HTMLDivElement> {
6
- fill?: boolean;
7
- fullWidth?: boolean;
8
- direction?: 'row' | 'col' | 'row-reverse' | 'col-reverse';
9
- vertical?: boolean;
10
- center?: boolean;
11
- items?: AlignItems;
12
- justify?: JustifyContent;
13
- grow?: number | true;
14
- shrink?: number;
15
- /**
16
- * 常用的非标准 gap
17
- * xs - 2px
18
- * sm - 6px
19
- * md - 10px
20
- * lg - 14px
21
- */
22
- gap?: UXSpacing | number;
23
- wrap?: 'wrap' | 'nowrap' | 'wrap-reverse' | true;
24
- order?: number;
25
- self?: 'auto' | 'start' | 'end' | 'end-safe' | 'center' | 'center-safe' | 'stretch' | 'baseline' | 'baseline-last';
26
- children?: React.ReactNode;
27
- }
28
- export declare const Flex: React.ForwardRefExoticComponent<FlexProps & React.RefAttributes<HTMLDivElement>>;
2
+ import type { BoxProps } from './Box/box';
3
+ export type FlexProps = BoxProps;
4
+ export declare const Flex: React.ForwardRefExoticComponent<BoxProps<HTMLDivElement> & React.RefAttributes<HTMLElement>>;
@@ -1,23 +1,10 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
- import { forwardRef, useMemo } from "react";
3
- import { cn } from "@heroui/theme";
4
- import { spacingMap } from "@particle-network/ui-shared";
5
- const isNil = (value)=>null == value;
6
- const Flex = /*#__PURE__*/ forwardRef(({ fill, fullWidth, direction, center, items, justify, gap, wrap, vertical, grow, shrink, order, self, className, children, ...props }, ref)=>{
7
- const gapValue = useMemo(()=>{
8
- if (!gap) return '';
9
- if ('number' == typeof gap) return `gap-${gap}`;
10
- if (!isNil(spacingMap[gap])) return `gap-${gap}`;
11
- return `gap-[${gap}]`;
12
- }, [
13
- gap
14
- ]);
15
- return /*#__PURE__*/ jsx("div", {
2
+ import { forwardRef } from "react";
3
+ import { Box } from "./Box/box.js";
4
+ const Flex = /*#__PURE__*/ forwardRef((props, ref)=>/*#__PURE__*/ jsx(Box, {
16
5
  ref: ref,
17
- className: cn('flex', fullWidth && 'w-full', direction && `flex-${direction}`, vertical && 'flex-col', items && `items-${items}`, justify && `justify-${justify}`, center && 'items-center justify-center', gapValue, 'string' == typeof wrap && `flex-${wrap}`, true === wrap && 'flex-wrap', 'number' == typeof grow && `flex-${grow}`, true === grow && 'flex-1', fill && 'flex-1', !isNil(shrink) && `shrink-${shrink}`, !isNil(order) && `order-${order}`, self && `self-${self}`, className),
18
- ...props,
19
- children: children
20
- });
21
- });
6
+ display: "flex",
7
+ ...props
8
+ }));
22
9
  Flex.displayName = 'UX.Flex';
23
10
  export { Flex };
@@ -1,3 +1,3 @@
1
1
  import { type FlexProps } from './Flex';
2
- export type HStackProps = Omit<FlexProps, 'direction' | 'vertical'>;
2
+ export type HStackProps = Omit<FlexProps, 'direction' | 'vertical' | 'horizontal'>;
3
3
  export declare const HStack: import("react").ForwardRefExoticComponent<HStackProps & import("react").RefAttributes<HTMLDivElement>>;
@@ -1,11 +1,11 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import { forwardRef } from "react";
3
- import { cn } from "@heroui/theme";
4
3
  import { Center } from "./Center.js";
5
- const Square = /*#__PURE__*/ forwardRef(({ size, className, ...props }, ref)=>/*#__PURE__*/ jsx(Center, {
4
+ const Square = /*#__PURE__*/ forwardRef(({ size, ...props }, ref)=>/*#__PURE__*/ jsx(Center, {
6
5
  ref: ref,
7
6
  shrink: 0,
8
- className: cn(size && `w-[${size}px] h-[${size}px]`, className),
7
+ w: size,
8
+ aspect: "square",
9
9
  ...props
10
10
  }));
11
11
  Square.displayName = 'UX.Square';
@@ -1,3 +1,3 @@
1
1
  import { type FlexProps } from './Flex';
2
- export type VStackProps = Omit<FlexProps, 'direction' | 'vertical'>;
2
+ export type VStackProps = Omit<FlexProps, 'direction' | 'vertical' | 'horizontal'>;
3
3
  export declare const VStack: import("react").ForwardRefExoticComponent<VStackProps & import("react").RefAttributes<HTMLDivElement>>;
@@ -1,10 +1,10 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import { forwardRef } from "react";
3
3
  import { Flex } from "./Flex.js";
4
- const VStack = /*#__PURE__*/ forwardRef(({ items = 'stretch', ...props }, ref)=>/*#__PURE__*/ jsx(Flex, {
4
+ const VStack = /*#__PURE__*/ forwardRef((props, ref)=>/*#__PURE__*/ jsx(Flex, {
5
5
  ref: ref,
6
6
  vertical: true,
7
- items: items,
7
+ items: "stretch",
8
8
  ...props
9
9
  }));
10
10
  VStack.displayName = 'UX.VStack';
@@ -1,3 +1,4 @@
1
+ export * from './Box/box';
1
2
  export * from './Center';
2
3
  export * from './Circle';
3
4
  export * from './Flex';
@@ -1,3 +1,4 @@
1
+ export * from "./Box/box.js";
1
2
  export * from "./Center.js";
2
3
  export * from "./Circle.js";
3
4
  export * from "./Flex.js";
@@ -1,13 +1,28 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import { forwardRef } from "react";
3
- import { cn } from "@heroui/theme";
4
- import { textClasses } from "./Text.type.js";
5
- const Text = /*#__PURE__*/ forwardRef(({ variant = 'body2Bold', fontWeight, color, lineHeight, align, className, h1, h2, h3, body1, body1Bold, body2, body2Bold, body3, body3Bold, caption1, caption1Bold, ...props }, ref)=>/*#__PURE__*/ jsx("span", {
3
+ import { Box } from "../layout/index.js";
4
+ import { textVariants } from "./text-theme.js";
5
+ const Text = /*#__PURE__*/ forwardRef(({ variant, className, h1, h2, h3, body1, body1Bold, body2, body2Bold, body3, body3Bold, caption1, caption1Bold, fontWeight, lineHeight, align, textAlign, ...props }, ref)=>/*#__PURE__*/ jsx(Box, {
6
6
  ref: ref,
7
- style: {
8
- color: color?.startsWith('#') ? color : void 0
9
- },
10
- className: cn(textClasses.variant[variant], h1 && textClasses.variant.h1, h2 && textClasses.variant.h2, h3 && textClasses.variant.h3, body1 && textClasses.variant.body1, body1Bold && textClasses.variant.body1Bold, body2 && textClasses.variant.body2, body2Bold && textClasses.variant.body2Bold, body3 && textClasses.variant.body3, body3Bold && textClasses.variant.body3Bold, caption1 && textClasses.variant.caption1, caption1Bold && textClasses.variant.caption1Bold, textClasses.fontWeight[fontWeight], !color?.startsWith('#') && textClasses.color[color], textClasses.lineHeight[lineHeight], textClasses.align[align], className),
7
+ as: "span",
8
+ textAlign: textAlign || align,
9
+ className: textVariants({
10
+ variant,
11
+ h1,
12
+ h2,
13
+ h3,
14
+ body1,
15
+ body1Bold,
16
+ body2,
17
+ body2Bold,
18
+ body3,
19
+ body3Bold,
20
+ caption1,
21
+ caption1Bold,
22
+ fontWeight,
23
+ lineHeight,
24
+ className
25
+ }),
11
26
  ...props
12
27
  }));
13
28
  Text.displayName = 'UX.Text';
@@ -1,10 +1,6 @@
1
- import type React from 'react';
2
- import type { UXForegroundColor } from '@particle-network/ui-shared';
1
+ import type { BoxProps } from '../layout';
3
2
  type TextVariant = 'h1' | 'h2' | 'h3' | 'body1' | 'body1Bold' | 'body2' | 'body2Bold' | 'body3' | 'body3Bold' | 'caption1' | 'caption1Bold';
4
- type TextWeight = 'normal' | 'medium' | 'semibold' | 'bold' | 'extrabold';
5
- type TextLineHeight = '1' | '1.4';
6
- type TextAlign = 'left' | 'center' | 'right';
7
- export interface TextProps extends React.HTMLAttributes<HTMLSpanElement> {
3
+ export interface TextProps extends BoxProps<HTMLSpanElement> {
8
4
  /**
9
5
  * | variant | font-size | font-weight |
10
6
  * | :----------- | :-------- | :---------- |
@@ -65,25 +61,6 @@ export interface TextProps extends React.HTMLAttributes<HTMLSpanElement> {
65
61
  * `10px 500`
66
62
  */
67
63
  caption1Bold?: boolean;
68
- /**
69
- * | weight | font-weight |
70
- * | :-------- | :---------: |
71
- * | normal | 400 |
72
- * | medium | 500 |
73
- * | semibold | 600 |
74
- * | bold | 700 |
75
- * | extrabold | 800 |
76
- */
77
- fontWeight?: TextWeight;
78
- color?: UXForegroundColor | `#${string}`;
79
- lineHeight?: TextLineHeight;
80
- align?: TextAlign;
64
+ align?: BoxProps['textAlign'];
81
65
  }
82
- export declare const textClasses: {
83
- variant: Record<TextVariant, string>;
84
- color: Record<UXForegroundColor, string>;
85
- fontWeight: Record<TextWeight, string>;
86
- lineHeight: Record<TextLineHeight, string>;
87
- align: Record<TextAlign, string>;
88
- };
89
66
  export {};