@particle-network/ui-react 0.5.1-beta.0 → 0.5.1-beta.10
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/components/ProgressWrapper/index.d.ts +2 -2
- package/dist/components/ProgressWrapper/index.js +1 -1
- package/dist/components/UXAutocomplete/index.js +1 -2
- package/dist/components/UXButton/button-theme.js +38 -2
- package/dist/components/UXButton/button.js +1 -1
- package/dist/components/UXCheckbox/checkbox.extend.js +16 -13
- package/dist/components/UXChip/chip.extend.d.ts +2 -1
- package/dist/components/UXChip/index.d.ts +1 -1
- package/dist/components/UXColorPicker/color-fields.d.ts +3 -0
- package/dist/components/UXColorPicker/color-fields.js +142 -0
- package/dist/components/UXColorPicker/color-input.d.ts +7 -0
- package/dist/components/UXColorPicker/color-input.js +12 -0
- package/dist/components/UXColorPicker/color-picker.d.ts +3 -0
- package/dist/components/UXColorPicker/color-picker.js +228 -0
- package/dist/components/UXColorPicker/index.d.ts +5 -0
- package/dist/components/UXColorPicker/index.js +3 -0
- package/dist/components/UXColorPicker/types.d.ts +51 -0
- package/dist/components/UXColorPicker/types.js +0 -0
- package/dist/components/UXColorPicker/utils.d.ts +7 -0
- package/dist/components/UXColorPicker/utils.js +6 -0
- package/dist/components/UXCopy/index.js +2 -2
- package/dist/components/UXEmpty/index.js +2 -2
- package/dist/components/UXHint/index.js +1 -1
- package/dist/components/UXInput/index.d.ts +6 -6
- package/dist/components/UXInput/input.extend.d.ts +6 -6
- package/dist/components/UXRadio/radio.extend.js +3 -3
- package/dist/components/UXSlider/use-slider.d.ts +1 -1
- package/dist/components/UXSlider/use-slider.js +1 -1
- package/dist/components/UXSpinner/spinner.d.ts +1 -5
- package/dist/components/UXSpinner/spinner.js +3 -4
- package/dist/components/UXSwitch/index.d.ts +2 -2
- package/dist/components/UXSwitch/switch.extend.d.ts +2 -2
- package/dist/components/UXSwitch/switch.extend.js +6 -6
- package/dist/components/UXTabs/tabs.classes.js +4 -4
- package/dist/components/UXThemeSwitch/constants.d.ts +9 -0
- package/dist/components/UXThemeSwitch/constants.js +3 -0
- package/dist/components/UXThemeSwitch/custom-theme-config.d.ts +2 -0
- package/dist/components/UXThemeSwitch/custom-theme-config.js +171 -0
- package/dist/components/UXThemeSwitch/theme-item.js +94 -15
- package/dist/components/UXThemeSwitch/theme-switch.js +26 -5
- package/dist/components/UXThemeSwitch/use-color-scheme.js +11 -8
- package/dist/components/UXThemeSwitch/use-theme-color.d.ts +1 -22
- package/dist/components/UXThemeSwitch/use-theme-color.js +3 -7
- package/dist/components/UXThemeSwitch/use-theme-store.d.ts +5 -0
- package/dist/components/UXThemeSwitch/use-theme-store.js +9 -3
- package/dist/components/UXThemeSwitch/use-theme.d.ts +2 -0
- package/dist/components/UXThemeSwitch/use-theme.js +10 -53
- package/dist/components/UXThemeSwitch/utils.d.ts +28 -0
- package/dist/components/UXThemeSwitch/utils.js +222 -0
- package/dist/components/UXToast/index.js +4 -4
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +1 -0
- package/dist/components/layout/Box/box-theme.d.ts +2225 -0
- package/dist/components/layout/Box/box-theme.js +348 -0
- package/dist/components/layout/Box/box.d.ts +14 -0
- package/dist/components/layout/Box/box.js +99 -0
- package/dist/components/layout/Circle.js +2 -3
- package/dist/components/layout/Flex.d.ts +3 -27
- package/dist/components/layout/Flex.js +6 -19
- package/dist/components/layout/HStack.d.ts +1 -1
- package/dist/components/layout/Square.js +3 -3
- package/dist/components/layout/VStack.d.ts +1 -1
- package/dist/components/layout/VStack.js +2 -2
- package/dist/components/layout/index.d.ts +1 -0
- package/dist/components/layout/index.js +1 -0
- package/dist/components/typography/Text.js +22 -7
- package/dist/components/typography/Text.type.d.ts +3 -26
- package/dist/components/typography/Text.type.js +0 -47
- package/dist/components/typography/text-theme.d.ts +178 -0
- package/dist/components/typography/text-theme.js +79 -0
- package/dist/heroui/constants.d.ts +18 -0
- package/dist/heroui/constants.js +98 -0
- package/dist/heroui/types.d.ts +91 -0
- package/dist/heroui/types.js +0 -0
- package/dist/heroui/utils/colors.d.ts +34 -0
- package/dist/heroui/utils/colors.js +121 -0
- package/dist/heroui/utils/object.d.ts +1 -0
- package/dist/heroui/utils/object.js +17 -0
- package/dist/hooks/useI18n.d.ts +133 -25
- package/dist/hooks/useI18n.js +84 -2
- package/dist/hooks/useLang.d.ts +5 -1
- package/dist/hooks/useLang.js +13 -1
- package/dist/utils/cn.d.ts +2 -0
- package/dist/utils/cn.js +258 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +2 -1
- package/dist/utils/input-classes.js +2 -2
- package/package.json +8 -5
- package/tailwind-preset.js +84 -160
package/dist/hooks/useI18n.d.ts
CHANGED
|
@@ -1,31 +1,139 @@
|
|
|
1
1
|
export declare const useI18n: () => {
|
|
2
|
-
table: {
|
|
3
|
-
emptyContent:
|
|
4
|
-
};
|
|
5
|
-
copy: {
|
|
6
|
-
copy:
|
|
7
|
-
success:
|
|
8
|
-
error:
|
|
9
|
-
address:
|
|
10
|
-
};
|
|
11
|
-
theme: {
|
|
12
|
-
title:
|
|
13
|
-
done:
|
|
14
|
-
font: {
|
|
15
|
-
title:
|
|
16
|
-
placeholder:
|
|
17
|
-
loading:
|
|
18
|
-
success:
|
|
19
|
-
error:
|
|
20
|
-
hint:
|
|
21
|
-
example: {
|
|
22
|
-
show:
|
|
23
|
-
hide:
|
|
2
|
+
readonly table: {
|
|
3
|
+
readonly emptyContent: "No data";
|
|
4
|
+
};
|
|
5
|
+
readonly copy: {
|
|
6
|
+
readonly copy: "Copy";
|
|
7
|
+
readonly success: "Copied successfully!";
|
|
8
|
+
readonly error: "Copy failed: ";
|
|
9
|
+
readonly address: "Address copied: ";
|
|
10
|
+
};
|
|
11
|
+
readonly theme: {
|
|
12
|
+
readonly title: "Theme";
|
|
13
|
+
readonly done: "Finish";
|
|
14
|
+
readonly font: {
|
|
15
|
+
readonly title: "Custom Font";
|
|
16
|
+
readonly placeholder: "Enter Google Fonts URL or custom font URL";
|
|
17
|
+
readonly loading: "Loading font...";
|
|
18
|
+
readonly success: "Font loaded: ";
|
|
19
|
+
readonly error: "Failed to load font";
|
|
20
|
+
readonly hint: "Try Google Fonts: ";
|
|
21
|
+
readonly example: {
|
|
22
|
+
readonly show: "Show example";
|
|
23
|
+
readonly hide: "Hide example";
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
readonly custom: {
|
|
27
|
+
readonly title: "Custom Theme";
|
|
28
|
+
readonly preset: "Theme Preset";
|
|
29
|
+
readonly swapUpDown: "Swap Up/Down Color";
|
|
30
|
+
readonly categories: {
|
|
31
|
+
readonly basic: "Basic";
|
|
32
|
+
readonly background: "Background";
|
|
33
|
+
readonly text: "Text";
|
|
34
|
+
readonly candle: "Candle";
|
|
35
|
+
readonly signal: "Signal";
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
readonly colors: {
|
|
40
|
+
readonly primary: "Primary";
|
|
41
|
+
readonly bullish: "Positive";
|
|
42
|
+
readonly bearish: "Negative";
|
|
43
|
+
readonly bgDefault: "Background Primary";
|
|
44
|
+
readonly bg200: "Background Quaternary";
|
|
45
|
+
readonly bg300: "Background Tertiary";
|
|
46
|
+
readonly bg400: "Background Secondary";
|
|
47
|
+
readonly cursor: "Background Selected";
|
|
48
|
+
readonly overlay: "Background Overlay";
|
|
49
|
+
readonly default: "Default";
|
|
50
|
+
readonly foreground: "Text Primary";
|
|
51
|
+
readonly secondary: "Text Secondary";
|
|
52
|
+
readonly tertiary: "Text Tertiary";
|
|
53
|
+
readonly divider: "Divider";
|
|
54
|
+
readonly success: "Signal Green";
|
|
55
|
+
readonly danger: "Signal Red";
|
|
56
|
+
readonly warning: "Signal Yellow";
|
|
57
|
+
readonly alert: "Signal Orange";
|
|
58
|
+
readonly blue: "Signal Blue";
|
|
59
|
+
readonly candleUp: "Body (up)";
|
|
60
|
+
readonly candleDown: "Body (down)";
|
|
61
|
+
readonly candleWickUp: "Wick (up)";
|
|
62
|
+
readonly candleWickDown: "Wick (down)";
|
|
63
|
+
readonly candleBorderUp: "Border (up)";
|
|
64
|
+
readonly candleBorderDown: "Border (down)";
|
|
65
|
+
};
|
|
66
|
+
readonly switch: {
|
|
67
|
+
readonly on: "On";
|
|
68
|
+
readonly off: "Off";
|
|
69
|
+
};
|
|
70
|
+
} | {
|
|
71
|
+
readonly table: {
|
|
72
|
+
readonly emptyContent: "暂无数据";
|
|
73
|
+
};
|
|
74
|
+
readonly copy: {
|
|
75
|
+
readonly copy: "复制";
|
|
76
|
+
readonly success: "复制成功!";
|
|
77
|
+
readonly error: "复制失败:";
|
|
78
|
+
readonly address: "地址已复制:";
|
|
79
|
+
};
|
|
80
|
+
readonly theme: {
|
|
81
|
+
readonly title: "主题";
|
|
82
|
+
readonly done: "完成";
|
|
83
|
+
readonly font: {
|
|
84
|
+
readonly title: "自定义字体";
|
|
85
|
+
readonly placeholder: "输入 Google Fonts 或自定义字体链接";
|
|
86
|
+
readonly loading: "正在加载字体...";
|
|
87
|
+
readonly success: "已加载字体:";
|
|
88
|
+
readonly error: "字体加载失败";
|
|
89
|
+
readonly hint: "参考 Google Fonts: ";
|
|
90
|
+
readonly example: {
|
|
91
|
+
readonly show: "显示示例";
|
|
92
|
+
readonly hide: "隐藏示例";
|
|
24
93
|
};
|
|
25
94
|
};
|
|
95
|
+
readonly custom: {
|
|
96
|
+
readonly title: "自定义主题";
|
|
97
|
+
readonly preset: "主题预设";
|
|
98
|
+
readonly swapUpDown: "涨跌色互换";
|
|
99
|
+
readonly categories: {
|
|
100
|
+
readonly basic: "基础";
|
|
101
|
+
readonly background: "背景";
|
|
102
|
+
readonly text: "文字";
|
|
103
|
+
readonly candle: "K线";
|
|
104
|
+
readonly signal: "信号";
|
|
105
|
+
};
|
|
106
|
+
};
|
|
107
|
+
};
|
|
108
|
+
readonly colors: {
|
|
109
|
+
readonly primary: "主要色";
|
|
110
|
+
readonly bullish: "上涨色";
|
|
111
|
+
readonly bearish: "下跌色";
|
|
112
|
+
readonly bgDefault: "一级背景色";
|
|
113
|
+
readonly bg200: "四级背景色";
|
|
114
|
+
readonly bg300: "三级背景色";
|
|
115
|
+
readonly bg400: "二级背景色";
|
|
116
|
+
readonly cursor: "选中背景色";
|
|
117
|
+
readonly overlay: "浮窗背景色";
|
|
118
|
+
readonly default: "默认";
|
|
119
|
+
readonly foreground: "一级文字色";
|
|
120
|
+
readonly secondary: "二级文字色";
|
|
121
|
+
readonly tertiary: "三级文字色";
|
|
122
|
+
readonly divider: "分割线";
|
|
123
|
+
readonly success: "绿色信号";
|
|
124
|
+
readonly danger: "红色信号";
|
|
125
|
+
readonly warning: "黄色信号";
|
|
126
|
+
readonly alert: "橙色信号";
|
|
127
|
+
readonly blue: "蓝色信号";
|
|
128
|
+
readonly candleUp: "主体色 (上涨)";
|
|
129
|
+
readonly candleDown: "主体色 (下跌)";
|
|
130
|
+
readonly candleWickUp: "影线 (上涨)";
|
|
131
|
+
readonly candleWickDown: "影线 (下跌)";
|
|
132
|
+
readonly candleBorderUp: "边框 (上涨)";
|
|
133
|
+
readonly candleBorderDown: "边框 (下跌)";
|
|
26
134
|
};
|
|
27
|
-
switch: {
|
|
28
|
-
on:
|
|
29
|
-
off:
|
|
135
|
+
readonly switch: {
|
|
136
|
+
readonly on: "开";
|
|
137
|
+
readonly off: "关";
|
|
30
138
|
};
|
|
31
139
|
};
|
package/dist/hooks/useI18n.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { useMemo } from "react";
|
|
1
2
|
import { useLang } from "./useLang.js";
|
|
2
3
|
const en = {
|
|
3
4
|
table: {
|
|
@@ -23,8 +24,47 @@ const en = {
|
|
|
23
24
|
show: 'Show example',
|
|
24
25
|
hide: 'Hide example'
|
|
25
26
|
}
|
|
27
|
+
},
|
|
28
|
+
custom: {
|
|
29
|
+
title: 'Custom Theme',
|
|
30
|
+
preset: 'Theme Preset',
|
|
31
|
+
swapUpDown: 'Swap Up/Down Color',
|
|
32
|
+
categories: {
|
|
33
|
+
basic: 'Basic',
|
|
34
|
+
background: 'Background',
|
|
35
|
+
text: 'Text',
|
|
36
|
+
candle: 'Candle',
|
|
37
|
+
signal: 'Signal'
|
|
38
|
+
}
|
|
26
39
|
}
|
|
27
40
|
},
|
|
41
|
+
colors: {
|
|
42
|
+
primary: 'Primary',
|
|
43
|
+
bullish: 'Positive',
|
|
44
|
+
bearish: 'Negative',
|
|
45
|
+
bgDefault: 'Background Primary',
|
|
46
|
+
bg200: 'Background Quaternary',
|
|
47
|
+
bg300: 'Background Tertiary',
|
|
48
|
+
bg400: 'Background Secondary',
|
|
49
|
+
cursor: 'Background Selected',
|
|
50
|
+
overlay: 'Background Overlay',
|
|
51
|
+
default: 'Default',
|
|
52
|
+
foreground: 'Text Primary',
|
|
53
|
+
secondary: 'Text Secondary',
|
|
54
|
+
tertiary: 'Text Tertiary',
|
|
55
|
+
divider: 'Divider',
|
|
56
|
+
success: 'Signal Green',
|
|
57
|
+
danger: 'Signal Red',
|
|
58
|
+
warning: 'Signal Yellow',
|
|
59
|
+
alert: 'Signal Orange',
|
|
60
|
+
blue: 'Signal Blue',
|
|
61
|
+
candleUp: 'Body (up)',
|
|
62
|
+
candleDown: 'Body (down)',
|
|
63
|
+
candleWickUp: 'Wick (up)',
|
|
64
|
+
candleWickDown: 'Wick (down)',
|
|
65
|
+
candleBorderUp: 'Border (up)',
|
|
66
|
+
candleBorderDown: 'Border (down)'
|
|
67
|
+
},
|
|
28
68
|
switch: {
|
|
29
69
|
on: 'On',
|
|
30
70
|
off: 'Off'
|
|
@@ -54,15 +94,57 @@ const zh = {
|
|
|
54
94
|
show: '显示示例',
|
|
55
95
|
hide: '隐藏示例'
|
|
56
96
|
}
|
|
97
|
+
},
|
|
98
|
+
custom: {
|
|
99
|
+
title: '自定义主题',
|
|
100
|
+
preset: '主题预设',
|
|
101
|
+
swapUpDown: '涨跌色互换',
|
|
102
|
+
categories: {
|
|
103
|
+
basic: '基础',
|
|
104
|
+
background: '背景',
|
|
105
|
+
text: '文字',
|
|
106
|
+
candle: 'K线',
|
|
107
|
+
signal: '信号'
|
|
108
|
+
}
|
|
57
109
|
}
|
|
58
110
|
},
|
|
111
|
+
colors: {
|
|
112
|
+
primary: '主要色',
|
|
113
|
+
bullish: '上涨色',
|
|
114
|
+
bearish: '下跌色',
|
|
115
|
+
bgDefault: '一级背景色',
|
|
116
|
+
bg200: '四级背景色',
|
|
117
|
+
bg300: '三级背景色',
|
|
118
|
+
bg400: '二级背景色',
|
|
119
|
+
cursor: '选中背景色',
|
|
120
|
+
overlay: '浮窗背景色',
|
|
121
|
+
default: '默认',
|
|
122
|
+
foreground: '一级文字色',
|
|
123
|
+
secondary: '二级文字色',
|
|
124
|
+
tertiary: '三级文字色',
|
|
125
|
+
divider: '分割线',
|
|
126
|
+
success: '绿色信号',
|
|
127
|
+
danger: '红色信号',
|
|
128
|
+
warning: '黄色信号',
|
|
129
|
+
alert: '橙色信号',
|
|
130
|
+
blue: '蓝色信号',
|
|
131
|
+
candleUp: '主体色 (上涨)',
|
|
132
|
+
candleDown: '主体色 (下跌)',
|
|
133
|
+
candleWickUp: '影线 (上涨)',
|
|
134
|
+
candleWickDown: '影线 (下跌)',
|
|
135
|
+
candleBorderUp: '边框 (上涨)',
|
|
136
|
+
candleBorderDown: '边框 (下跌)'
|
|
137
|
+
},
|
|
59
138
|
switch: {
|
|
60
139
|
on: '开',
|
|
61
140
|
off: '关'
|
|
62
141
|
}
|
|
63
142
|
};
|
|
64
143
|
const useI18n = ()=>{
|
|
65
|
-
const lang = useLang();
|
|
66
|
-
|
|
144
|
+
const { lang } = useLang();
|
|
145
|
+
const i18n = useMemo(()=>'zh' === lang ? zh : en, [
|
|
146
|
+
lang
|
|
147
|
+
]);
|
|
148
|
+
return i18n;
|
|
67
149
|
};
|
|
68
150
|
export { useI18n };
|
package/dist/hooks/useLang.d.ts
CHANGED
package/dist/hooks/useLang.js
CHANGED
|
@@ -23,6 +23,18 @@ function useLang() {
|
|
|
23
23
|
observer.disconnect();
|
|
24
24
|
};
|
|
25
25
|
}, []);
|
|
26
|
-
|
|
26
|
+
const handleSetLang = (lang)=>{
|
|
27
|
+
setLang(lang);
|
|
28
|
+
document.documentElement.lang = lang;
|
|
29
|
+
};
|
|
30
|
+
const toggleLang = ()=>{
|
|
31
|
+
const newLang = 'zh' === lang ? 'en' : 'zh';
|
|
32
|
+
handleSetLang(newLang);
|
|
33
|
+
};
|
|
34
|
+
return {
|
|
35
|
+
lang,
|
|
36
|
+
setLang: handleSetLang,
|
|
37
|
+
toggleLang
|
|
38
|
+
};
|
|
27
39
|
}
|
|
28
40
|
export { useLang };
|
package/dist/utils/cn.js
ADDED
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
import { clsx } from "clsx";
|
|
2
|
+
import { extendTailwindMerge, twMerge } from "tailwind-merge";
|
|
3
|
+
const COMMON_UNITS = [
|
|
4
|
+
'small',
|
|
5
|
+
'medium',
|
|
6
|
+
'large'
|
|
7
|
+
];
|
|
8
|
+
const FONT_SIZE = [
|
|
9
|
+
'xxs',
|
|
10
|
+
'tiny',
|
|
11
|
+
'caption1',
|
|
12
|
+
'body3',
|
|
13
|
+
'body2',
|
|
14
|
+
'body1',
|
|
15
|
+
'h4',
|
|
16
|
+
'h3',
|
|
17
|
+
'h2',
|
|
18
|
+
'h1'
|
|
19
|
+
];
|
|
20
|
+
const COMMON_SPACING = [
|
|
21
|
+
'xs',
|
|
22
|
+
'sm',
|
|
23
|
+
'md',
|
|
24
|
+
'lg'
|
|
25
|
+
];
|
|
26
|
+
const OPACITY = [
|
|
27
|
+
'disabled',
|
|
28
|
+
'hover'
|
|
29
|
+
];
|
|
30
|
+
const cn_twMerge = extendTailwindMerge({
|
|
31
|
+
extend: {
|
|
32
|
+
classGroups: {
|
|
33
|
+
'font-size': [
|
|
34
|
+
{
|
|
35
|
+
text: [
|
|
36
|
+
...FONT_SIZE,
|
|
37
|
+
...COMMON_UNITS
|
|
38
|
+
]
|
|
39
|
+
}
|
|
40
|
+
],
|
|
41
|
+
px: [
|
|
42
|
+
{
|
|
43
|
+
px: COMMON_SPACING
|
|
44
|
+
}
|
|
45
|
+
],
|
|
46
|
+
py: [
|
|
47
|
+
{
|
|
48
|
+
py: COMMON_SPACING
|
|
49
|
+
}
|
|
50
|
+
],
|
|
51
|
+
pt: [
|
|
52
|
+
{
|
|
53
|
+
pt: COMMON_SPACING
|
|
54
|
+
}
|
|
55
|
+
],
|
|
56
|
+
pb: [
|
|
57
|
+
{
|
|
58
|
+
pb: COMMON_SPACING
|
|
59
|
+
}
|
|
60
|
+
],
|
|
61
|
+
pl: [
|
|
62
|
+
{
|
|
63
|
+
pl: COMMON_SPACING
|
|
64
|
+
}
|
|
65
|
+
],
|
|
66
|
+
pr: [
|
|
67
|
+
{
|
|
68
|
+
pr: COMMON_SPACING
|
|
69
|
+
}
|
|
70
|
+
],
|
|
71
|
+
ps: [
|
|
72
|
+
{
|
|
73
|
+
ps: COMMON_SPACING
|
|
74
|
+
}
|
|
75
|
+
],
|
|
76
|
+
pe: [
|
|
77
|
+
{
|
|
78
|
+
pe: COMMON_SPACING
|
|
79
|
+
}
|
|
80
|
+
],
|
|
81
|
+
p: [
|
|
82
|
+
{
|
|
83
|
+
p: COMMON_SPACING
|
|
84
|
+
}
|
|
85
|
+
],
|
|
86
|
+
m: [
|
|
87
|
+
{
|
|
88
|
+
m: COMMON_SPACING
|
|
89
|
+
}
|
|
90
|
+
],
|
|
91
|
+
mx: [
|
|
92
|
+
{
|
|
93
|
+
mx: COMMON_SPACING
|
|
94
|
+
}
|
|
95
|
+
],
|
|
96
|
+
my: [
|
|
97
|
+
{
|
|
98
|
+
my: COMMON_SPACING
|
|
99
|
+
}
|
|
100
|
+
],
|
|
101
|
+
mt: [
|
|
102
|
+
{
|
|
103
|
+
mt: COMMON_SPACING
|
|
104
|
+
}
|
|
105
|
+
],
|
|
106
|
+
mb: [
|
|
107
|
+
{
|
|
108
|
+
mb: COMMON_SPACING
|
|
109
|
+
}
|
|
110
|
+
],
|
|
111
|
+
ml: [
|
|
112
|
+
{
|
|
113
|
+
ml: COMMON_SPACING
|
|
114
|
+
}
|
|
115
|
+
],
|
|
116
|
+
mr: [
|
|
117
|
+
{
|
|
118
|
+
mr: COMMON_SPACING
|
|
119
|
+
}
|
|
120
|
+
],
|
|
121
|
+
ms: [
|
|
122
|
+
{
|
|
123
|
+
ms: COMMON_SPACING
|
|
124
|
+
}
|
|
125
|
+
],
|
|
126
|
+
me: [
|
|
127
|
+
{
|
|
128
|
+
me: COMMON_SPACING
|
|
129
|
+
}
|
|
130
|
+
],
|
|
131
|
+
gap: [
|
|
132
|
+
{
|
|
133
|
+
gap: COMMON_SPACING
|
|
134
|
+
}
|
|
135
|
+
],
|
|
136
|
+
'gap-x': [
|
|
137
|
+
{
|
|
138
|
+
'gap-x': COMMON_SPACING
|
|
139
|
+
}
|
|
140
|
+
],
|
|
141
|
+
'gap-y': [
|
|
142
|
+
{
|
|
143
|
+
'gap-y': COMMON_SPACING
|
|
144
|
+
}
|
|
145
|
+
],
|
|
146
|
+
rounded: [
|
|
147
|
+
{
|
|
148
|
+
rounded: COMMON_UNITS
|
|
149
|
+
}
|
|
150
|
+
],
|
|
151
|
+
'rounded-s': [
|
|
152
|
+
{
|
|
153
|
+
'rounded-s': COMMON_UNITS
|
|
154
|
+
}
|
|
155
|
+
],
|
|
156
|
+
'rounded-e': [
|
|
157
|
+
{
|
|
158
|
+
'rounded-e': COMMON_UNITS
|
|
159
|
+
}
|
|
160
|
+
],
|
|
161
|
+
'rounded-t': [
|
|
162
|
+
{
|
|
163
|
+
'rounded-t': COMMON_UNITS
|
|
164
|
+
}
|
|
165
|
+
],
|
|
166
|
+
'rounded-r': [
|
|
167
|
+
{
|
|
168
|
+
'rounded-r': COMMON_UNITS
|
|
169
|
+
}
|
|
170
|
+
],
|
|
171
|
+
'rounded-b': [
|
|
172
|
+
{
|
|
173
|
+
'rounded-b': COMMON_UNITS
|
|
174
|
+
}
|
|
175
|
+
],
|
|
176
|
+
'rounded-l': [
|
|
177
|
+
{
|
|
178
|
+
'rounded-l': COMMON_UNITS
|
|
179
|
+
}
|
|
180
|
+
],
|
|
181
|
+
top: [
|
|
182
|
+
{
|
|
183
|
+
top: COMMON_SPACING
|
|
184
|
+
}
|
|
185
|
+
],
|
|
186
|
+
right: [
|
|
187
|
+
{
|
|
188
|
+
right: COMMON_SPACING
|
|
189
|
+
}
|
|
190
|
+
],
|
|
191
|
+
bottom: [
|
|
192
|
+
{
|
|
193
|
+
bottom: COMMON_SPACING
|
|
194
|
+
}
|
|
195
|
+
],
|
|
196
|
+
left: [
|
|
197
|
+
{
|
|
198
|
+
left: COMMON_SPACING
|
|
199
|
+
}
|
|
200
|
+
],
|
|
201
|
+
inset: [
|
|
202
|
+
{
|
|
203
|
+
inset: COMMON_SPACING
|
|
204
|
+
}
|
|
205
|
+
],
|
|
206
|
+
'inset-x': [
|
|
207
|
+
{
|
|
208
|
+
'inset-x': COMMON_SPACING
|
|
209
|
+
}
|
|
210
|
+
],
|
|
211
|
+
'inset-y': [
|
|
212
|
+
{
|
|
213
|
+
'inset-y': COMMON_SPACING
|
|
214
|
+
}
|
|
215
|
+
],
|
|
216
|
+
start: [
|
|
217
|
+
{
|
|
218
|
+
start: COMMON_SPACING
|
|
219
|
+
}
|
|
220
|
+
],
|
|
221
|
+
end: [
|
|
222
|
+
{
|
|
223
|
+
end: COMMON_SPACING
|
|
224
|
+
}
|
|
225
|
+
],
|
|
226
|
+
opacity: [
|
|
227
|
+
{
|
|
228
|
+
opacity: OPACITY
|
|
229
|
+
}
|
|
230
|
+
],
|
|
231
|
+
'border-w': [
|
|
232
|
+
{
|
|
233
|
+
border: COMMON_UNITS
|
|
234
|
+
}
|
|
235
|
+
],
|
|
236
|
+
shadow: [
|
|
237
|
+
{
|
|
238
|
+
shadow: [
|
|
239
|
+
'box',
|
|
240
|
+
...COMMON_UNITS
|
|
241
|
+
]
|
|
242
|
+
}
|
|
243
|
+
]
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
});
|
|
247
|
+
function cn(...inputs) {
|
|
248
|
+
return cn_twMerge(clsx(inputs));
|
|
249
|
+
}
|
|
250
|
+
console.log(cn('text-red-500 text-brand text-h1'), '|', twMerge('text-red-500 text-brand text-h1'));
|
|
251
|
+
console.log(cn('text-red-500 text-sm text-h1'), '|', twMerge('text-red-500 text-sm text-h1'));
|
|
252
|
+
console.log(cn('px-2 px-md'), '|', twMerge('px-2 px-md'));
|
|
253
|
+
console.log(cn('gap-2 gap-md'), '|', twMerge('gap-2 gap-md'));
|
|
254
|
+
console.log(cn('rounded-sm rounded-small'), '|', twMerge('rounded-sm rounded-small'));
|
|
255
|
+
console.log(cn('top-1 top-md'), '|', twMerge('top-1 top-md'));
|
|
256
|
+
console.log(cn('opacity-0 opacity-disabled opacity-hover'), '|', twMerge('opacity-0 opacity-disabled opacity-hover'));
|
|
257
|
+
console.log(cn('border-1 border-large'), '|', twMerge('border-1 border-large'));
|
|
258
|
+
export { cn };
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { absoluteFullClasses, baseStyles, collapseAdjacentVariantBorders, dataFocusVisibleClasses, focusVisibleClasses, groupDataFocusVisibleClasses, hiddenInputClasses, ringClasses, translateCenterClasses, } from './classes';
|
|
2
|
+
export { cn } from './cn';
|
|
2
3
|
export * from './detect';
|
|
3
4
|
export * from './input-classes';
|
|
4
5
|
export { colorVariants } from './variants';
|
package/dist/utils/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { absoluteFullClasses, baseStyles, collapseAdjacentVariantBorders, dataFocusVisibleClasses, focusVisibleClasses, groupDataFocusVisibleClasses, hiddenInputClasses, ringClasses, translateCenterClasses } from "./classes.js";
|
|
2
|
+
import { cn } from "./cn.js";
|
|
2
3
|
import { colorVariants } from "./variants.js";
|
|
3
4
|
export * from "./detect.js";
|
|
4
5
|
export * from "./input-classes.js";
|
|
5
|
-
export { absoluteFullClasses, baseStyles, collapseAdjacentVariantBorders, colorVariants, dataFocusVisibleClasses, focusVisibleClasses, groupDataFocusVisibleClasses, hiddenInputClasses, ringClasses, translateCenterClasses };
|
|
6
|
+
export { absoluteFullClasses, baseStyles, cn, collapseAdjacentVariantBorders, colorVariants, dataFocusVisibleClasses, focusVisibleClasses, groupDataFocusVisibleClasses, hiddenInputClasses, ringClasses, translateCenterClasses };
|
|
@@ -191,9 +191,9 @@ const inputClasses = {
|
|
|
191
191
|
'lg'
|
|
192
192
|
],
|
|
193
193
|
class: {
|
|
194
|
-
inputWrapper: 'bg-background-200 text-
|
|
194
|
+
inputWrapper: 'bg-background-200 text-foreground-100 font-medium',
|
|
195
195
|
label: 'font-medium',
|
|
196
|
-
input: '!outline-none placeholder:text-
|
|
196
|
+
input: '!outline-none placeholder:text-foreground-100 placeholder:font-medium font-medium text-foreground'
|
|
197
197
|
}
|
|
198
198
|
},
|
|
199
199
|
{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@particle-network/ui-react",
|
|
3
|
-
"version": "0.5.1-beta.
|
|
3
|
+
"version": "0.5.1-beta.10",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -38,8 +38,8 @@
|
|
|
38
38
|
"@rslib/core": "^0.12.3",
|
|
39
39
|
"@types/react": "^19.1.10",
|
|
40
40
|
"react": "^19.1.0",
|
|
41
|
-
"@particle-network/
|
|
42
|
-
"@particle-network/
|
|
41
|
+
"@particle-network/eslint-config": "0.3.0",
|
|
42
|
+
"@particle-network/lintstaged-config": "0.1.0"
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
45
45
|
"react": ">=16.9.0",
|
|
@@ -48,9 +48,12 @@
|
|
|
48
48
|
"dependencies": {
|
|
49
49
|
"ahooks": "^3.9.4",
|
|
50
50
|
"copy-to-clipboard": "^3.3.3",
|
|
51
|
+
"immer": "^11.1.3",
|
|
52
|
+
"react-aria-components": "^1.14.0",
|
|
53
|
+
"values.js": "^2.1.1",
|
|
51
54
|
"zustand": "^5.0.8",
|
|
52
|
-
"@particle-network/icons": "0.5.
|
|
53
|
-
"@particle-network/ui-shared": "0.4.
|
|
55
|
+
"@particle-network/icons": "0.5.1-beta.5",
|
|
56
|
+
"@particle-network/ui-shared": "0.4.1-beta.4"
|
|
54
57
|
},
|
|
55
58
|
"scripts": {
|
|
56
59
|
"build": "rslib build",
|