@particle-network/ui-react 0.5.1-beta.8 → 0.6.0
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.js +2 -3
- package/dist/components/UXAutocomplete/index.js +1 -2
- package/dist/components/UXCheckbox/checkbox.extend.js +15 -12
- package/dist/components/UXColorPicker/color-input.js +1 -1
- package/dist/components/UXColorPicker/color-picker.js +43 -31
- package/dist/components/UXColorPicker/types.d.ts +4 -0
- package/dist/components/UXCopy/index.js +1 -1
- package/dist/components/UXEmpty/index.js +1 -1
- package/dist/components/UXHint/index.js +2 -2
- package/dist/components/UXModal/index.d.ts +1 -1
- package/dist/components/UXRangeInput/index.d.ts +42 -0
- package/dist/components/UXRangeInput/index.js +94 -0
- package/dist/components/UXSlider/use-slider.js +1 -1
- package/dist/components/UXSpinner/spinner.js +1 -1
- package/dist/components/UXSwitch/switch.extend.js +6 -6
- package/dist/components/UXThemeSwitch/custom-theme-config.d.ts +4 -1
- package/dist/components/UXThemeSwitch/custom-theme-config.js +8 -7
- package/dist/components/UXThemeSwitch/index.d.ts +2 -2
- package/dist/components/UXThemeSwitch/index.js +2 -2
- package/dist/components/UXThemeSwitch/theme-item.js +6 -7
- package/dist/components/UXThemeSwitch/theme-switch.d.ts +8 -1
- package/dist/components/UXThemeSwitch/theme-switch.js +12 -18
- package/dist/components/UXThemeSwitch/use-theme.d.ts +2 -1
- package/dist/components/UXThemeSwitch/use-theme.js +4 -9
- package/dist/components/UXThemeSwitch/utils.js +52 -15
- package/dist/components/UXToast/index.d.ts +1 -1
- package/dist/components/UXToast/index.js +22 -10
- package/dist/components/UXTooltip/index.js +4 -12
- package/dist/components/WrapText/index.d.ts +6 -0
- package/dist/components/WrapText/index.js +15 -0
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.js +2 -0
- package/dist/components/layout/Box/box-theme.d.ts +36 -18
- package/dist/components/layout/Box/box-theme.js +25 -19
- package/dist/components/layout/Box/box.js +14 -5
- package/dist/components/layout/Square.js +2 -4
- package/dist/components/typography/Text.js +18 -8
- package/dist/components/typography/Text.type.d.ts +1 -0
- package/dist/hooks/useI18n.d.ts +18 -10
- package/dist/hooks/useI18n.js +18 -10
- package/dist/utils/cn.d.ts +2 -0
- package/dist/utils/cn.js +250 -0
- package/dist/utils/common.d.ts +4 -0
- package/dist/utils/common.js +13 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +2 -1
- package/package.json +5 -5
- package/tailwind-preset.js +18 -18
- package/dist/components/UXThemeSwitch/use-color-scheme.d.ts +0 -5
- package/dist/components/UXThemeSwitch/use-color-scheme.js +0 -14
- package/dist/components/UXThemeSwitch/use-theme-color.d.ts +0 -1
- package/dist/components/UXThemeSwitch/use-theme-color.js +0 -6
- package/dist/components/UXThemeSwitch/use-theme-store.d.ts +0 -46
- package/dist/components/UXThemeSwitch/use-theme-store.js +0 -36
package/tailwind-preset.js
CHANGED
|
@@ -148,7 +148,7 @@ module.exports = {
|
|
|
148
148
|
},
|
|
149
149
|
tertiary: {
|
|
150
150
|
DEFAULT: '#75757E',
|
|
151
|
-
foreground: '#
|
|
151
|
+
foreground: '#000000',
|
|
152
152
|
},
|
|
153
153
|
cursor: {
|
|
154
154
|
DEFAULT: '#4E4E56',
|
|
@@ -231,7 +231,7 @@ module.exports = {
|
|
|
231
231
|
},
|
|
232
232
|
tertiary: {
|
|
233
233
|
DEFAULT: '#83878D',
|
|
234
|
-
foreground: '#
|
|
234
|
+
foreground: '#FFFFFF',
|
|
235
235
|
},
|
|
236
236
|
cursor: {
|
|
237
237
|
DEFAULT: '#D8D8DE',
|
|
@@ -314,7 +314,7 @@ module.exports = {
|
|
|
314
314
|
},
|
|
315
315
|
tertiary: {
|
|
316
316
|
DEFAULT: '#75757E',
|
|
317
|
-
foreground: '#
|
|
317
|
+
foreground: '#000000',
|
|
318
318
|
},
|
|
319
319
|
cursor: {
|
|
320
320
|
DEFAULT: '#4E4E56',
|
|
@@ -397,7 +397,7 @@ module.exports = {
|
|
|
397
397
|
},
|
|
398
398
|
tertiary: {
|
|
399
399
|
DEFAULT: '#83878D',
|
|
400
|
-
foreground: '#
|
|
400
|
+
foreground: '#FFFFFF',
|
|
401
401
|
},
|
|
402
402
|
cursor: {
|
|
403
403
|
DEFAULT: '#D8D8DE',
|
|
@@ -480,7 +480,7 @@ module.exports = {
|
|
|
480
480
|
},
|
|
481
481
|
tertiary: {
|
|
482
482
|
DEFAULT: '#888891',
|
|
483
|
-
foreground: '#
|
|
483
|
+
foreground: '#000000',
|
|
484
484
|
},
|
|
485
485
|
cursor: {
|
|
486
486
|
DEFAULT: '#4E4E56',
|
|
@@ -563,7 +563,7 @@ module.exports = {
|
|
|
563
563
|
},
|
|
564
564
|
tertiary: {
|
|
565
565
|
DEFAULT: '#7A7E84',
|
|
566
|
-
foreground: '#
|
|
566
|
+
foreground: '#FFFFFF',
|
|
567
567
|
},
|
|
568
568
|
cursor: {
|
|
569
569
|
DEFAULT: '#CFCFD7',
|
|
@@ -646,7 +646,7 @@ module.exports = {
|
|
|
646
646
|
},
|
|
647
647
|
tertiary: {
|
|
648
648
|
DEFAULT: '#757E80',
|
|
649
|
-
foreground: '#
|
|
649
|
+
foreground: '#000000',
|
|
650
650
|
},
|
|
651
651
|
cursor: {
|
|
652
652
|
DEFAULT: '#5D6466',
|
|
@@ -729,7 +729,7 @@ module.exports = {
|
|
|
729
729
|
},
|
|
730
730
|
tertiary: {
|
|
731
731
|
DEFAULT: '#777A8C',
|
|
732
|
-
foreground: '#
|
|
732
|
+
foreground: '#000000',
|
|
733
733
|
},
|
|
734
734
|
cursor: {
|
|
735
735
|
DEFAULT: '#4A4D5E',
|
|
@@ -812,7 +812,7 @@ module.exports = {
|
|
|
812
812
|
},
|
|
813
813
|
tertiary: {
|
|
814
814
|
DEFAULT: '#949E9C',
|
|
815
|
-
foreground: '#
|
|
815
|
+
foreground: '#000000',
|
|
816
816
|
},
|
|
817
817
|
cursor: {
|
|
818
818
|
DEFAULT: '#5D6466',
|
|
@@ -895,7 +895,7 @@ module.exports = {
|
|
|
895
895
|
},
|
|
896
896
|
tertiary: {
|
|
897
897
|
DEFAULT: '#717373',
|
|
898
|
-
foreground: '#
|
|
898
|
+
foreground: '#000000',
|
|
899
899
|
},
|
|
900
900
|
cursor: {
|
|
901
901
|
DEFAULT: '#54515E',
|
|
@@ -978,7 +978,7 @@ module.exports = {
|
|
|
978
978
|
},
|
|
979
979
|
tertiary: {
|
|
980
980
|
DEFAULT: '#707A8A',
|
|
981
|
-
foreground: '#
|
|
981
|
+
foreground: '#000000',
|
|
982
982
|
},
|
|
983
983
|
cursor: {
|
|
984
984
|
DEFAULT: '#444A56',
|
|
@@ -986,11 +986,11 @@ module.exports = {
|
|
|
986
986
|
},
|
|
987
987
|
success: {
|
|
988
988
|
DEFAULT: '#2EBD85',
|
|
989
|
-
foreground: '#
|
|
989
|
+
foreground: '#FFFFFF',
|
|
990
990
|
},
|
|
991
991
|
danger: {
|
|
992
|
-
DEFAULT: '#
|
|
993
|
-
foreground: '#
|
|
992
|
+
DEFAULT: '#F5465D',
|
|
993
|
+
foreground: '#FFFFFF',
|
|
994
994
|
},
|
|
995
995
|
warning: {
|
|
996
996
|
DEFAULT: '#F0B90B',
|
|
@@ -1006,11 +1006,11 @@ module.exports = {
|
|
|
1006
1006
|
},
|
|
1007
1007
|
bullish: {
|
|
1008
1008
|
DEFAULT: '#2EBD85',
|
|
1009
|
-
foreground: '#
|
|
1009
|
+
foreground: '#FFFFFF',
|
|
1010
1010
|
},
|
|
1011
1011
|
bearish: {
|
|
1012
|
-
DEFAULT: '#
|
|
1013
|
-
foreground: '#
|
|
1012
|
+
DEFAULT: '#F5465D',
|
|
1013
|
+
foreground: '#FFFFFF',
|
|
1014
1014
|
},
|
|
1015
1015
|
},
|
|
1016
1016
|
},
|
|
@@ -1061,7 +1061,7 @@ module.exports = {
|
|
|
1061
1061
|
},
|
|
1062
1062
|
tertiary: {
|
|
1063
1063
|
DEFAULT: '#686A6D',
|
|
1064
|
-
foreground: '#
|
|
1064
|
+
foreground: '#000000',
|
|
1065
1065
|
},
|
|
1066
1066
|
cursor: {
|
|
1067
1067
|
DEFAULT: '#4B4D51',
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { useMemo } from "react";
|
|
2
|
-
import { useThemeStore } from "./use-theme-store.js";
|
|
3
|
-
const useColorScheme = ()=>{
|
|
4
|
-
const { colorScheme } = useThemeStore((state)=>state.theme);
|
|
5
|
-
const scheme = useMemo(()=>({
|
|
6
|
-
colorScheme,
|
|
7
|
-
isDark: 'dark' === colorScheme,
|
|
8
|
-
isLight: 'light' === colorScheme
|
|
9
|
-
}), [
|
|
10
|
-
colorScheme
|
|
11
|
-
]);
|
|
12
|
-
return scheme;
|
|
13
|
-
};
|
|
14
|
-
export { useColorScheme };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const useThemeColor: () => Record<import("@particle-network/ui-shared").ThemeColorVariable, string>;
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { type ThemeItemType } from '@particle-network/ui-shared';
|
|
2
|
-
export type FontLoadStatus = 'idle' | 'loading' | 'success' | 'error';
|
|
3
|
-
interface State {
|
|
4
|
-
/**
|
|
5
|
-
* 保存的主题
|
|
6
|
-
*/
|
|
7
|
-
theme: ThemeItemType;
|
|
8
|
-
/**
|
|
9
|
-
* 保存的自定义主题配置(当切换到其他主题时保存,切回 custom 时恢复)
|
|
10
|
-
*/
|
|
11
|
-
customTheme: ThemeItemType;
|
|
12
|
-
/**
|
|
13
|
-
* 保存的字体链接
|
|
14
|
-
*/
|
|
15
|
-
fontUrl: string;
|
|
16
|
-
/**
|
|
17
|
-
* 应用的字体名称
|
|
18
|
-
*/
|
|
19
|
-
fontName: string;
|
|
20
|
-
/**
|
|
21
|
-
* 字体加载状态
|
|
22
|
-
*/
|
|
23
|
-
fontLoadStatus: FontLoadStatus;
|
|
24
|
-
}
|
|
25
|
-
interface Actions {
|
|
26
|
-
setTheme: (theme: ThemeItemType) => void;
|
|
27
|
-
setCustomTheme: (customTheme: ThemeItemType) => void;
|
|
28
|
-
setFontUrl: (fontUrl: string) => void;
|
|
29
|
-
setFontLoadStatus: (status: FontLoadStatus) => void;
|
|
30
|
-
setFontName: (name: string) => void;
|
|
31
|
-
}
|
|
32
|
-
type ThemeStore = State & Actions;
|
|
33
|
-
export declare const useThemeStore: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<ThemeStore>, "setState" | "persist"> & {
|
|
34
|
-
setState(partial: ThemeStore | Partial<ThemeStore> | ((state: ThemeStore) => ThemeStore | Partial<ThemeStore>), replace?: false | undefined): unknown;
|
|
35
|
-
setState(state: ThemeStore | ((state: ThemeStore) => ThemeStore), replace: true): unknown;
|
|
36
|
-
persist: {
|
|
37
|
-
setOptions: (options: Partial<import("zustand/middleware").PersistOptions<ThemeStore, unknown, unknown>>) => void;
|
|
38
|
-
clearStorage: () => void;
|
|
39
|
-
rehydrate: () => Promise<void> | void;
|
|
40
|
-
hasHydrated: () => boolean;
|
|
41
|
-
onHydrate: (fn: (state: ThemeStore) => void) => () => void;
|
|
42
|
-
onFinishHydration: (fn: (state: ThemeStore) => void) => () => void;
|
|
43
|
-
getOptions: () => Partial<import("zustand/middleware").PersistOptions<ThemeStore, unknown, unknown>>;
|
|
44
|
-
};
|
|
45
|
-
}>;
|
|
46
|
-
export {};
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { CustomTheme, UXDarkTheme } from "@particle-network/ui-shared";
|
|
2
|
-
import { create } from "zustand";
|
|
3
|
-
import { createJSONStorage, persist } from "zustand/middleware";
|
|
4
|
-
const useThemeStore = create()(persist((set)=>({
|
|
5
|
-
theme: UXDarkTheme,
|
|
6
|
-
customTheme: CustomTheme,
|
|
7
|
-
fontUrl: '',
|
|
8
|
-
fontName: '',
|
|
9
|
-
fontLoadStatus: 'idle',
|
|
10
|
-
setTheme: (theme)=>set({
|
|
11
|
-
theme
|
|
12
|
-
}),
|
|
13
|
-
setCustomTheme: (customTheme)=>set({
|
|
14
|
-
customTheme
|
|
15
|
-
}),
|
|
16
|
-
setFontUrl: (fontUrl)=>set({
|
|
17
|
-
fontUrl
|
|
18
|
-
}),
|
|
19
|
-
setFontLoadStatus: (fontLoadStatus)=>set({
|
|
20
|
-
fontLoadStatus
|
|
21
|
-
}),
|
|
22
|
-
setFontName: (fontName)=>set({
|
|
23
|
-
fontName
|
|
24
|
-
})
|
|
25
|
-
}), {
|
|
26
|
-
name: 'ux-preference-theme',
|
|
27
|
-
version: 1,
|
|
28
|
-
storage: createJSONStorage(()=>'undefined' != typeof window ? window.localStorage : {}),
|
|
29
|
-
partialize: (state)=>({
|
|
30
|
-
theme: state.theme,
|
|
31
|
-
customTheme: state.customTheme,
|
|
32
|
-
fontName: state.fontName,
|
|
33
|
-
fontUrl: state.fontUrl
|
|
34
|
-
})
|
|
35
|
-
}));
|
|
36
|
-
export { useThemeStore };
|