@particle-network/ui-react 0.4.0-beta.1 → 0.4.0-beta.3
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/UXThemeSwitch/index.d.ts +0 -1
- package/dist/components/UXThemeSwitch/index.js +0 -1
- package/dist/components/UXThemeSwitch/theme-data.d.ts +2 -1
- package/dist/components/UXThemeSwitch/theme-item.js +2 -1
- package/dist/components/UXThemeSwitch/use-color-scheme.d.ts +5 -1
- package/dist/components/UXThemeSwitch/use-color-scheme.js +6 -1
- package/package.json +2 -2
- package/dist/components/UXThemeSwitch/use-quote-color.d.ts +0 -6
- package/dist/components/UXThemeSwitch/use-quote-color.js +0 -12
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
export type ThemeId = 'ux-purple-gold-dark' | 'ux-purple-gold-light' | 'ux-green-red-dark' | 'ux-green-red-light' | 'ux-green-red-soft-dark' | 'ux-green-red-soft-light' | 'gmgn-dark' | 'axiom-dark' | 'hyperliquid-dark' | 'phantom-dark' | 'binance-dark' | 'bullx-dark';
|
|
2
|
+
export type ColorScheme = 'dark' | 'light';
|
|
2
3
|
export interface ThemeItemType {
|
|
3
4
|
id: ThemeId;
|
|
4
5
|
zhName: string;
|
|
5
6
|
enName: string;
|
|
6
|
-
colorScheme:
|
|
7
|
+
colorScheme: ColorScheme;
|
|
7
8
|
colorVariables: {
|
|
8
9
|
foreground: string;
|
|
9
10
|
secondary: string;
|
|
@@ -8,11 +8,12 @@ const ThemeItem = ({ id, zhName, enName, isSelected, onClick })=>{
|
|
|
8
8
|
const lang = useLang();
|
|
9
9
|
return /*#__PURE__*/ jsxs(VStack, {
|
|
10
10
|
center: true,
|
|
11
|
+
gap: 2,
|
|
11
12
|
className: cn('cursor-pointer hover:scale-105 transition-all duration-300', id),
|
|
12
13
|
onClick: onClick,
|
|
13
14
|
children: [
|
|
14
15
|
/*#__PURE__*/ jsx("div", {
|
|
15
|
-
className: cn('rounded-
|
|
16
|
+
className: cn('rounded-medium border-2', isSelected ? 'border-primary' : 'border-transparent'),
|
|
16
17
|
children: /*#__PURE__*/ jsxs("svg", {
|
|
17
18
|
xmlns: "http://www.w3.org/2000/svg",
|
|
18
19
|
width: "180",
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import { useThemeStore } from "./use-theme-store.js";
|
|
2
2
|
const useColorScheme = ()=>{
|
|
3
3
|
const { selectedTheme } = useThemeStore();
|
|
4
|
-
|
|
4
|
+
const { colorScheme } = selectedTheme;
|
|
5
|
+
return {
|
|
6
|
+
colorScheme,
|
|
7
|
+
isDark: 'dark' === colorScheme,
|
|
8
|
+
isLight: 'light' === colorScheme
|
|
9
|
+
};
|
|
5
10
|
};
|
|
6
11
|
export { useColorScheme };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@particle-network/ui-react",
|
|
3
|
-
"version": "0.4.0-beta.
|
|
3
|
+
"version": "0.4.0-beta.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"ahooks": "^3.9.4",
|
|
51
51
|
"copy-to-clipboard": "^3.3.3",
|
|
52
52
|
"zustand": "^5.0.8",
|
|
53
|
-
"@particle-network/icons": "0.4.0-beta.
|
|
53
|
+
"@particle-network/icons": "0.4.0-beta.1",
|
|
54
54
|
"@particle-network/ui-shared": "0.3.0-beta.0"
|
|
55
55
|
},
|
|
56
56
|
"scripts": {
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { useThemeStore } from "./use-theme-store.js";
|
|
2
|
-
const useQuoteColor = ()=>{
|
|
3
|
-
const { selectedTheme } = useThemeStore();
|
|
4
|
-
const { bullish, bearish } = selectedTheme.colorVariables;
|
|
5
|
-
return {
|
|
6
|
-
bullish,
|
|
7
|
-
bearish,
|
|
8
|
-
upColor: bullish,
|
|
9
|
-
downColor: bearish
|
|
10
|
-
};
|
|
11
|
-
};
|
|
12
|
-
export { useQuoteColor };
|