@particle-network/ui-react 0.4.5-beta.17 → 0.4.5-beta.19
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/UXButton/button-theme.d.ts +3 -0
- package/dist/components/UXButton/button-theme.js +28 -7
- package/dist/components/UXButton/use-button.js +2 -1
- package/dist/components/UXThemeSwitch/theme-switch.d.ts +4 -2
- package/dist/components/UXThemeSwitch/theme-switch.js +9 -5
- package/dist/components/UXTooltip/index.d.ts +2 -2
- package/package.json +5 -5
- package/tailwind-preset.js +1 -1
|
@@ -31,6 +31,7 @@ declare const button: import("tailwind-variants").TVReturnType<{
|
|
|
31
31
|
sm: string;
|
|
32
32
|
md: string;
|
|
33
33
|
lg: string;
|
|
34
|
+
xl: string;
|
|
34
35
|
auto: string;
|
|
35
36
|
};
|
|
36
37
|
color: {
|
|
@@ -97,6 +98,7 @@ declare const button: import("tailwind-variants").TVReturnType<{
|
|
|
97
98
|
sm: string;
|
|
98
99
|
md: string;
|
|
99
100
|
lg: string;
|
|
101
|
+
xl: string;
|
|
100
102
|
auto: string;
|
|
101
103
|
};
|
|
102
104
|
color: {
|
|
@@ -163,6 +165,7 @@ declare const button: import("tailwind-variants").TVReturnType<{
|
|
|
163
165
|
sm: string;
|
|
164
166
|
md: string;
|
|
165
167
|
lg: string;
|
|
168
|
+
xl: string;
|
|
166
169
|
auto: string;
|
|
167
170
|
};
|
|
168
171
|
color: {
|
|
@@ -33,10 +33,11 @@ const button_theme_button = tv({
|
|
|
33
33
|
text: 'bg-transparent min-w-0 w-auto h-auto px-0'
|
|
34
34
|
},
|
|
35
35
|
size: {
|
|
36
|
-
xs: 'gap-1 rounded-
|
|
37
|
-
sm: 'gap-1 rounded-
|
|
38
|
-
md: 'gap-1 rounded-
|
|
39
|
-
lg: 'gap-1 rounded-
|
|
36
|
+
xs: 'gap-1 rounded-sm !text-caption1 min-w-min font-medium [&>svg]:size-[14px]',
|
|
37
|
+
sm: 'gap-1 rounded-md !text-body3 min-w-min font-medium [&>svg]:size-4',
|
|
38
|
+
md: 'gap-1 rounded-md text-tiny min-w-min font-medium [&>svg]:size-[18px]',
|
|
39
|
+
lg: 'gap-1 rounded-lg text-sm min-w-min font-medium [&>svg]:size-5',
|
|
40
|
+
xl: 'gap-1 rounded-[10px] text-medium min-w-min font-medium [&>svg]:size-6',
|
|
40
41
|
auto: 'min-w-min rounded-[10px]'
|
|
41
42
|
},
|
|
42
43
|
color: {
|
|
@@ -127,6 +128,16 @@ const button_theme_button = tv({
|
|
|
127
128
|
'light',
|
|
128
129
|
'bordered'
|
|
129
130
|
],
|
|
131
|
+
class: 'px-lg h-9'
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
size: 'xl',
|
|
135
|
+
variant: [
|
|
136
|
+
'solid',
|
|
137
|
+
'flat',
|
|
138
|
+
'light',
|
|
139
|
+
'bordered'
|
|
140
|
+
],
|
|
130
141
|
class: 'px-lg h-11'
|
|
131
142
|
},
|
|
132
143
|
{
|
|
@@ -486,17 +497,22 @@ const button_theme_button = tv({
|
|
|
486
497
|
{
|
|
487
498
|
isInGroup: true,
|
|
488
499
|
size: 'sm',
|
|
489
|
-
class: 'rounded-none first:rounded-s-
|
|
500
|
+
class: 'rounded-none first:rounded-s-md last:rounded-e-md'
|
|
490
501
|
},
|
|
491
502
|
{
|
|
492
503
|
isInGroup: true,
|
|
493
504
|
size: 'md',
|
|
494
|
-
class: 'rounded-none first:rounded-s-
|
|
505
|
+
class: 'rounded-none first:rounded-s-md last:rounded-e-md'
|
|
495
506
|
},
|
|
496
507
|
{
|
|
497
508
|
isInGroup: true,
|
|
498
509
|
size: 'lg',
|
|
499
|
-
class: 'rounded-none first:rounded-s-
|
|
510
|
+
class: 'rounded-none first:rounded-s-lg last:rounded-e-lg'
|
|
511
|
+
},
|
|
512
|
+
{
|
|
513
|
+
isInGroup: true,
|
|
514
|
+
size: 'xl',
|
|
515
|
+
class: 'rounded-none first:rounded-s-[10px] last:rounded-e-[10px]'
|
|
500
516
|
},
|
|
501
517
|
{
|
|
502
518
|
isInGroup: true,
|
|
@@ -618,6 +634,11 @@ const button_theme_button = tv({
|
|
|
618
634
|
{
|
|
619
635
|
isIconOnly: true,
|
|
620
636
|
size: 'lg',
|
|
637
|
+
class: 'min-w-9 w-9 h-9'
|
|
638
|
+
},
|
|
639
|
+
{
|
|
640
|
+
isIconOnly: true,
|
|
641
|
+
size: 'xl',
|
|
621
642
|
class: 'min-w-11 w-11 h-11'
|
|
622
643
|
},
|
|
623
644
|
{
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type
|
|
2
|
+
import { type ThemeId } from '@particle-network/ui-shared';
|
|
3
|
+
import { type UXModalProps } from '../UXModal';
|
|
3
4
|
export interface UXThemeSwitchModalProps extends Pick<UXModalProps, 'isOpen' | 'onClose' | 'onOpenChange' | 'backdrop'> {
|
|
4
5
|
as?: 'modal' | 'drawer';
|
|
6
|
+
omitThemes?: ThemeId[];
|
|
5
7
|
}
|
|
6
8
|
export declare const UXThemeSwitchModal: React.FC<UXThemeSwitchModalProps>;
|
|
7
|
-
export interface UXThemeSwitchProps extends Pick<UXThemeSwitchModalProps, 'as' | 'backdrop'> {
|
|
9
|
+
export interface UXThemeSwitchProps extends Pick<UXThemeSwitchModalProps, 'as' | 'omitThemes' | 'backdrop'> {
|
|
8
10
|
children?: (onOpen: () => void) => React.ReactNode;
|
|
9
11
|
}
|
|
10
12
|
export declare const UXThemeSwitch: React.FC<UXThemeSwitchProps>;
|
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useState } from "react";
|
|
2
|
+
import { useMemo, useState } from "react";
|
|
3
3
|
import { cn } from "@heroui/theme";
|
|
4
4
|
import { useDisclosure } from "@heroui/use-disclosure";
|
|
5
5
|
import { ChartColorSwitchIcon, CopyIcon } from "@particle-network/icons/web";
|
|
6
6
|
import { themeData } from "@particle-network/ui-shared";
|
|
7
7
|
import { useI18n } from "../../hooks/index.js";
|
|
8
|
-
import { UXCopy, UXTooltip } from "../index.js";
|
|
9
8
|
import { HStack, VStack } from "../layout/index.js";
|
|
10
9
|
import { Text } from "../typography/Text.js";
|
|
11
10
|
import { UXButton } from "../UXButton/index.js";
|
|
11
|
+
import { UXCopy } from "../UXCopy/index.js";
|
|
12
12
|
import { UXDivider } from "../UXDivider/index.js";
|
|
13
13
|
import { UXDrawer } from "../UXDrawer/index.js";
|
|
14
14
|
import { UXInput } from "../UXInput/index.js";
|
|
15
15
|
import { UXModal } from "../UXModal/index.js";
|
|
16
16
|
import { UXSpinner } from "../UXSpinner/index.js";
|
|
17
|
+
import { UXTooltip } from "../UXTooltip/index.js";
|
|
17
18
|
import { ThemeItem } from "./theme-item.js";
|
|
18
19
|
import { useTheme } from "./use-theme.js";
|
|
19
20
|
const FONT_EXAMPLES = [
|
|
@@ -30,11 +31,14 @@ const FONT_EXAMPLES = [
|
|
|
30
31
|
url: 'https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100..900;1,100..900&display=swap'
|
|
31
32
|
}
|
|
32
33
|
];
|
|
33
|
-
const UXThemeSwitchModal = ({ as = 'modal', backdrop, isOpen, onClose, onOpenChange })=>{
|
|
34
|
+
const UXThemeSwitchModal = ({ as = 'modal', omitThemes = [], backdrop, isOpen, onClose, onOpenChange })=>{
|
|
34
35
|
const i18n = useI18n();
|
|
35
36
|
const { theme: selectedTheme, setTheme, fontUrl, setFontUrl, fontName, fontLoadStatus, clearFontUrl } = useTheme();
|
|
36
37
|
const [isFontExampleOpen, setIsFontExampleOpen] = useState(false);
|
|
37
38
|
const Component = 'modal' === as ? UXModal : UXDrawer;
|
|
39
|
+
const themes = useMemo(()=>themeData.filter((theme)=>!omitThemes.includes(theme.id)), [
|
|
40
|
+
omitThemes
|
|
41
|
+
]);
|
|
38
42
|
return /*#__PURE__*/ jsx(Component, {
|
|
39
43
|
isOpen: isOpen,
|
|
40
44
|
classNames: {
|
|
@@ -44,7 +48,7 @@ const UXThemeSwitchModal = ({ as = 'modal', backdrop, isOpen, onClose, onOpenCha
|
|
|
44
48
|
backdrop: backdrop,
|
|
45
49
|
footer: /*#__PURE__*/ jsx(UXButton, {
|
|
46
50
|
fullWidth: true,
|
|
47
|
-
size: "
|
|
51
|
+
size: "xl",
|
|
48
52
|
color: "primary",
|
|
49
53
|
onPress: onClose,
|
|
50
54
|
children: i18n.theme.done
|
|
@@ -55,7 +59,7 @@ const UXThemeSwitchModal = ({ as = 'modal', backdrop, isOpen, onClose, onOpenCha
|
|
|
55
59
|
children: [
|
|
56
60
|
/*#__PURE__*/ jsx("div", {
|
|
57
61
|
className: "grid grid-cols-3 gap-y-5 pt-1",
|
|
58
|
-
children:
|
|
62
|
+
children: themes.map((theme)=>/*#__PURE__*/ jsx(ThemeItem, {
|
|
59
63
|
isSelected: selectedTheme.id === theme.id,
|
|
60
64
|
onClick: ()=>setTheme(theme),
|
|
61
65
|
...theme
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import
|
|
3
|
-
export type UXTooltipProps =
|
|
2
|
+
import type { TooltipProps } from '@heroui/tooltip';
|
|
3
|
+
export type UXTooltipProps = TooltipProps;
|
|
4
4
|
export declare const UXTooltip: React.FC<UXTooltipProps>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@particle-network/ui-react",
|
|
3
|
-
"version": "0.4.5-beta.
|
|
3
|
+
"version": "0.4.5-beta.19",
|
|
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",
|
|
@@ -49,8 +49,8 @@
|
|
|
49
49
|
"ahooks": "^3.9.4",
|
|
50
50
|
"copy-to-clipboard": "^3.3.3",
|
|
51
51
|
"zustand": "^5.0.8",
|
|
52
|
-
"@particle-network/icons": "0.4.2-beta.
|
|
53
|
-
"@particle-network/ui-shared": "0.3.2-beta.
|
|
52
|
+
"@particle-network/icons": "0.4.2-beta.8",
|
|
53
|
+
"@particle-network/ui-shared": "0.3.2-beta.4"
|
|
54
54
|
},
|
|
55
55
|
"scripts": {
|
|
56
56
|
"build": "rslib build",
|