@particle-network/ui-react 0.3.0-beta.1 → 0.3.0-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.
- package/dist/components/ProgressWrapper/index.d.ts +1 -2
- package/dist/components/ProgressWrapper/index.js +2 -3
- package/dist/components/UXButton/button-theme.js +9 -9
- package/dist/components/UXCheckbox/index.d.ts +1 -2
- package/dist/components/UXCheckbox/index.js +1 -2
- package/dist/components/UXChip/index.d.ts +1 -2
- package/dist/components/UXChip/index.js +3 -4
- package/dist/components/UXDivider/index.d.ts +1 -2
- package/dist/components/UXDivider/index.js +3 -4
- package/dist/components/UXEmpty/index.d.ts +1 -1
- package/dist/components/UXEmpty/index.js +2 -2
- package/dist/components/UXHint/index.d.ts +2 -2
- package/dist/components/UXHint/index.js +22 -12
- package/dist/components/UXInput/index.d.ts +2 -3
- package/dist/components/UXInput/index.js +4 -6
- package/dist/components/UXModal/index.d.ts +1 -2
- package/dist/components/UXModal/index.js +1 -2
- package/dist/components/UXNumberInput/index.d.ts +1 -2
- package/dist/components/UXNumberInput/index.js +3 -4
- package/dist/components/UXPopover/index.d.ts +1 -2
- package/dist/components/UXPopover/index.js +1 -2
- package/dist/components/UXPopover/popover.extend.js +3 -3
- package/dist/components/UXRadio/index.d.ts +1 -2
- package/dist/components/UXRadio/index.js +1 -2
- package/dist/components/UXSelect/index.d.ts +1 -2
- package/dist/components/UXSelect/index.js +3 -4
- package/dist/components/UXSpinner/spinner.d.ts +1 -1
- package/dist/components/UXSpinner/spinner.js +4 -6
- package/dist/components/UXSwitch/index.d.ts +1 -2
- package/dist/components/UXSwitch/index.js +3 -4
- package/dist/components/UXTabs/index.d.ts +1 -2
- package/dist/components/UXTabs/index.js +3 -4
- package/dist/components/UXToast/index.d.ts +16 -0
- package/dist/components/UXToast/index.js +91 -0
- package/dist/components/UXTooltip/index.d.ts +1 -2
- package/dist/components/UXTooltip/index.js +3 -4
- package/dist/components/UXTooltip/tooltip.extend.js +3 -3
- package/dist/components/index.d.ts +10 -35
- package/dist/components/index.js +10 -22
- package/dist/components/layout/Center.d.ts +1 -2
- package/dist/components/layout/Center.js +4 -5
- package/dist/components/layout/Circle.d.ts +1 -2
- package/dist/components/layout/Circle.js +2 -3
- package/dist/components/layout/Flex.d.ts +1 -2
- package/dist/components/layout/Flex.js +3 -4
- package/dist/components/layout/HStack.d.ts +1 -2
- package/dist/components/layout/HStack.js +4 -5
- package/dist/components/layout/Square.d.ts +1 -2
- package/dist/components/layout/Square.js +4 -5
- package/dist/components/layout/VStack.d.ts +1 -2
- package/dist/components/layout/VStack.js +2 -3
- package/dist/components/layout/index.d.ts +6 -0
- package/dist/components/layout/index.js +6 -0
- package/dist/components/typography/Text.d.ts +1 -2
- package/dist/components/typography/Text.js +5 -3
- package/dist/components/typography/Text.type.d.ts +2 -2
- package/dist/utils/input-classes.js +11 -11
- package/package.json +5 -4
- package/tailwind-preset.js +7 -7
|
@@ -30,5 +30,4 @@ export interface ProgressWrapperProps extends React.HTMLAttributes<HTMLDivElemen
|
|
|
30
30
|
*/
|
|
31
31
|
svgClassName?: string;
|
|
32
32
|
}
|
|
33
|
-
declare const ProgressWrapper: React.FC<ProgressWrapperProps>;
|
|
34
|
-
export default ProgressWrapper;
|
|
33
|
+
export declare const ProgressWrapper: React.FC<ProgressWrapperProps>;
|
|
@@ -4,7 +4,7 @@ import { useMemo, useRef } from "react";
|
|
|
4
4
|
import { cn } from "@heroui/theme";
|
|
5
5
|
import { getHexColorFromCSSVariable, radiusMap } from "@particle-network/ui-shared";
|
|
6
6
|
import { useSize } from "ahooks";
|
|
7
|
-
import Center from "../layout/
|
|
7
|
+
import { Center } from "../layout/index.js";
|
|
8
8
|
const ProgressWrapper = ({ className, value = 0, width, height, radius = 'sm', strokeWidth = 1, color = 'primary', children, svgClassName, ...restProps })=>{
|
|
9
9
|
const autoLayout = !width && !height;
|
|
10
10
|
const containerRef = useRef(null);
|
|
@@ -98,5 +98,4 @@ const ProgressWrapper = ({ className, value = 0, width, height, radius = 'sm', s
|
|
|
98
98
|
});
|
|
99
99
|
};
|
|
100
100
|
ProgressWrapper.displayName = 'UX.ProgressWrapper';
|
|
101
|
-
|
|
102
|
-
export { components_ProgressWrapper as default };
|
|
101
|
+
export { ProgressWrapper };
|
|
@@ -33,11 +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-2 rounded-
|
|
37
|
-
sm: 'gap-2 rounded-
|
|
38
|
-
md: 'gap-2 rounded-
|
|
39
|
-
lg: 'gap-2 rounded-
|
|
40
|
-
auto: 'min-w-min rounded-
|
|
36
|
+
xs: 'gap-2 rounded-[6px] !text-body3 min-w-min font-medium [&_[aria-label="Loading"]>div]:size-3',
|
|
37
|
+
sm: 'gap-2 rounded-[6px] !text-body3 min-w-min font-medium [&_[aria-label="Loading"]>div]:size-3',
|
|
38
|
+
md: 'gap-2 rounded-[6px] text-tiny min-w-min font-medium [&_[aria-label="Loading"]>div]:size-4',
|
|
39
|
+
lg: 'gap-2 rounded-[10px] text-medium min-w-min font-medium [&_[aria-label="Loading"]>div]:size-6',
|
|
40
|
+
auto: 'min-w-min rounded-[10px]'
|
|
41
41
|
},
|
|
42
42
|
color: {
|
|
43
43
|
default: '',
|
|
@@ -52,10 +52,10 @@ const button_theme_button = tv({
|
|
|
52
52
|
},
|
|
53
53
|
radius: {
|
|
54
54
|
none: 'rounded-none',
|
|
55
|
-
xs: 'rounded-
|
|
56
|
-
sm: 'rounded-
|
|
57
|
-
md: 'rounded-
|
|
58
|
-
lg: 'rounded-
|
|
55
|
+
xs: 'rounded-[4px]',
|
|
56
|
+
sm: 'rounded-[6px]',
|
|
57
|
+
md: 'rounded-[10px]',
|
|
58
|
+
lg: 'rounded-[14px]',
|
|
59
59
|
full: 'rounded-full'
|
|
60
60
|
},
|
|
61
61
|
fullWidth: {
|
|
@@ -2,10 +2,9 @@ import React from 'react';
|
|
|
2
2
|
import { type CheckboxGroupProps } from '@heroui/checkbox';
|
|
3
3
|
import ExtendedCheckbox from './checkbox.extend';
|
|
4
4
|
export type UXCheckboxProps = React.ComponentPropsWithRef<typeof ExtendedCheckbox>;
|
|
5
|
-
declare const UXCheckbox: React.ForwardRefExoticComponent<Omit<Omit<import("@heroui/checkbox").CheckboxProps, "color"> & {
|
|
5
|
+
export declare const UXCheckbox: React.ForwardRefExoticComponent<Omit<Omit<import("@heroui/checkbox").CheckboxProps, "color"> & {
|
|
6
6
|
color?: "primary" | "secondary" | "success" | "warning" | "danger" | "bullish" | "bearish";
|
|
7
7
|
labelPlacement?: "left" | "right";
|
|
8
8
|
}, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
|
9
|
-
export default UXCheckbox;
|
|
10
9
|
export declare const UXCheckboxGroup: import("@heroui/system-rsc").InternalForwardRefRenderFunction<"div", CheckboxGroupProps, never>;
|
|
11
10
|
export type UXCheckboxGroupProps = CheckboxGroupProps;
|
|
@@ -12,6 +12,5 @@ const UXCheckbox = /*#__PURE__*/ forwardRef((props, ref)=>{
|
|
|
12
12
|
});
|
|
13
13
|
});
|
|
14
14
|
UXCheckbox.displayName = 'UX.Checkbox';
|
|
15
|
-
const components_UXCheckbox = UXCheckbox;
|
|
16
15
|
const UXCheckboxGroup = CheckboxGroup;
|
|
17
|
-
export {
|
|
16
|
+
export { UXCheckbox, UXCheckboxGroup };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import ExtendedChip from './chip.extend';
|
|
3
3
|
export type UXChipProps = React.ComponentPropsWithRef<typeof ExtendedChip>;
|
|
4
|
-
declare const UXChip: import("@heroui/system-rsc").InternalForwardRefRenderFunction<"div", Omit<import("@heroui/chip").ChipProps, "color"> & {
|
|
4
|
+
export declare const UXChip: import("@heroui/system-rsc").InternalForwardRefRenderFunction<"div", Omit<import("@heroui/chip").ChipProps, "color"> & {
|
|
5
5
|
color?: "default" | "primary" | "success" | "warning" | "danger" | "bullish" | "bearish" | `#${string}`;
|
|
6
6
|
}, never>;
|
|
7
|
-
export default UXChip;
|
|
@@ -2,7 +2,7 @@ import { jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import "react";
|
|
3
3
|
import { forwardRef } from "@heroui/system";
|
|
4
4
|
import chip_extend from "./chip.extend.js";
|
|
5
|
-
const
|
|
5
|
+
const UXChip = forwardRef((props, ref)=>{
|
|
6
6
|
const { color, variant, style, ...restProps } = props;
|
|
7
7
|
if ('string' == typeof color && color.startsWith('#')) return /*#__PURE__*/ jsx(chip_extend, {
|
|
8
8
|
ref: ref,
|
|
@@ -22,6 +22,5 @@ const UXChip_UXChip = forwardRef((props, ref)=>{
|
|
|
22
22
|
...restProps
|
|
23
23
|
});
|
|
24
24
|
});
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
export { UXChip as default };
|
|
25
|
+
UXChip.displayName = 'UX.Chip';
|
|
26
|
+
export { UXChip };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
import type { DividerProps } from '@heroui/divider';
|
|
2
2
|
export type UXDividerProps = DividerProps;
|
|
3
|
-
declare const UXDivider: import("react").ForwardRefExoticComponent<Omit<DividerProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
4
|
-
export default UXDivider;
|
|
3
|
+
export declare const UXDivider: import("react").ForwardRefExoticComponent<Omit<DividerProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef } from "react";
|
|
3
3
|
import divider_extend from "./divider.extend.js";
|
|
4
|
-
const
|
|
4
|
+
const UXDivider = /*#__PURE__*/ forwardRef((props, ref)=>/*#__PURE__*/ jsx(divider_extend, {
|
|
5
5
|
ref: ref,
|
|
6
6
|
...props
|
|
7
7
|
}));
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
export { UXDivider as default };
|
|
8
|
+
UXDivider.displayName = 'UX.Divider';
|
|
9
|
+
export { UXDivider };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type IconProps } from '../../icons';
|
|
3
|
-
import { type VStackProps } from '../layout
|
|
3
|
+
import { type VStackProps } from '../layout';
|
|
4
4
|
export interface UXEmptyProps extends VStackProps {
|
|
5
5
|
iconProps?: IconProps;
|
|
6
6
|
text?: React.ReactNode;
|
|
@@ -3,8 +3,8 @@ import "react";
|
|
|
3
3
|
import { forwardRef } from "@heroui/system";
|
|
4
4
|
import { useI18n } from "../../hooks/useI18n.js";
|
|
5
5
|
import { EmptyIcon } from "../../icons/index.js";
|
|
6
|
-
import VStack from "../layout/
|
|
7
|
-
import Text from "../typography/Text.js";
|
|
6
|
+
import { VStack } from "../layout/index.js";
|
|
7
|
+
import { Text } from "../typography/Text.js";
|
|
8
8
|
const UXEmpty = forwardRef((props, ref)=>{
|
|
9
9
|
const i18n = useI18n();
|
|
10
10
|
const { text = i18n.table.emptyContent, iconProps, ...restProps } = props;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type UXTooltipProps } from '..';
|
|
3
3
|
export type UXHintProps = UXTooltipProps & {
|
|
4
|
+
triggerType?: 'hover' | 'click';
|
|
4
5
|
buttonClassName?: string;
|
|
5
6
|
iconClassName?: string;
|
|
6
7
|
};
|
|
7
|
-
declare const UXHint: React.FC<UXHintProps>;
|
|
8
|
-
export default UXHint;
|
|
8
|
+
export declare const UXHint: React.FC<UXHintProps>;
|
|
@@ -1,22 +1,32 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
3
|
import { cn } from "@heroui/theme";
|
|
4
|
-
import { Center, UXTooltip } from "../index.js";
|
|
4
|
+
import { Center, UXPopover, UXPopoverContent, UXPopoverTrigger, UXTooltip } from "../index.js";
|
|
5
5
|
import { CircleQuestionIcon } from "../../icons/index.js";
|
|
6
|
-
const
|
|
7
|
-
const { content, children, buttonClassName, iconClassName, ...restProps } = props;
|
|
8
|
-
|
|
9
|
-
content: content || children,
|
|
10
|
-
...restProps,
|
|
11
|
-
children: /*#__PURE__*/ jsx(Center, {
|
|
6
|
+
const UXHint = (props)=>{
|
|
7
|
+
const { content, children, buttonClassName, iconClassName, triggerType = 'hover', ...restProps } = props;
|
|
8
|
+
const renderTriggerContent = ()=>/*#__PURE__*/ jsx(Center, {
|
|
12
9
|
className: cn('size-4 cursor-pointer', buttonClassName),
|
|
13
10
|
children: /*#__PURE__*/ jsx(CircleQuestionIcon, {
|
|
14
11
|
size: 14,
|
|
15
12
|
className: iconClassName
|
|
16
13
|
})
|
|
17
|
-
})
|
|
14
|
+
});
|
|
15
|
+
if ('hover' === triggerType) return /*#__PURE__*/ jsx(UXTooltip, {
|
|
16
|
+
content: content || children,
|
|
17
|
+
...restProps,
|
|
18
|
+
children: renderTriggerContent()
|
|
19
|
+
});
|
|
20
|
+
return /*#__PURE__*/ jsxs(UXPopover, {
|
|
21
|
+
children: [
|
|
22
|
+
/*#__PURE__*/ jsx(UXPopoverTrigger, {
|
|
23
|
+
children: renderTriggerContent()
|
|
24
|
+
}),
|
|
25
|
+
/*#__PURE__*/ jsx(UXPopoverContent, {
|
|
26
|
+
children: content || children
|
|
27
|
+
})
|
|
28
|
+
]
|
|
18
29
|
});
|
|
19
30
|
};
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
export { UXHint as default };
|
|
31
|
+
UXHint.displayName = 'UX.Hint';
|
|
32
|
+
export { UXHint };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import ExtendedInput from './input.extend';
|
|
3
3
|
export type UXInputProps = React.ComponentPropsWithRef<typeof ExtendedInput>;
|
|
4
|
-
declare const UXInput:
|
|
4
|
+
export declare const UXInput: React.ForwardRefExoticComponent<Omit<Omit<{
|
|
5
5
|
fullWidth?: boolean | undefined;
|
|
6
6
|
ref?: React.Ref<HTMLInputElement> | undefined;
|
|
7
7
|
children?: React.ReactNode;
|
|
@@ -342,5 +342,4 @@ declare const UXInput: import("@heroui/system-rsc").InternalForwardRefRenderFunc
|
|
|
342
342
|
wrapperRef?: React.Ref<HTMLDivElement> | undefined;
|
|
343
343
|
innerWrapperRef?: React.Ref<HTMLDivElement> | undefined;
|
|
344
344
|
textAlign?: "center" | "left" | "right" | undefined;
|
|
345
|
-
}, "ref"> & React.RefAttributes<React.ReactElement<unknown, string | React.JSXElementConstructor<any>>>,
|
|
346
|
-
export default UXInput;
|
|
345
|
+
}, "ref"> & React.RefAttributes<React.ReactElement<unknown, string | React.JSXElementConstructor<any>>>, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import "react";
|
|
3
|
-
import { forwardRef } from "@heroui/system";
|
|
2
|
+
import { forwardRef } from "react";
|
|
4
3
|
import input_extend from "./input.extend.js";
|
|
5
|
-
const
|
|
4
|
+
const UXInput = /*#__PURE__*/ forwardRef((props, ref)=>/*#__PURE__*/ jsx(input_extend, {
|
|
6
5
|
...props,
|
|
7
6
|
ref: ref
|
|
8
7
|
}));
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
export { UXInput as default };
|
|
8
|
+
UXInput.displayName = 'UX.Input';
|
|
9
|
+
export { UXInput };
|
|
@@ -6,5 +6,4 @@ export type UXModalProps = Omit<ModalProps, 'closeButton'> & {
|
|
|
6
6
|
tip?: React.ReactNode;
|
|
7
7
|
titleAlign?: 'left' | 'center';
|
|
8
8
|
};
|
|
9
|
-
declare const UXModal: React.ForwardRefExoticComponent<Omit<UXModalProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
10
|
-
export default UXModal;
|
|
9
|
+
export declare const UXModal: React.ForwardRefExoticComponent<Omit<UXModalProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import ExtendedNumberInput from './number-input.extend';
|
|
3
3
|
export type UXNumberInputProps = React.ComponentPropsWithRef<typeof ExtendedNumberInput>;
|
|
4
|
-
declare const UXNumberInput: React.ForwardRefExoticComponent<UXNumberInputProps>;
|
|
5
|
-
export default UXNumberInput;
|
|
4
|
+
export declare const UXNumberInput: React.ForwardRefExoticComponent<UXNumberInputProps>;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef } from "react";
|
|
3
3
|
import number_input_extend from "./number-input.extend.js";
|
|
4
|
-
const
|
|
4
|
+
const UXNumberInput = /*#__PURE__*/ forwardRef((props, ref)=>/*#__PURE__*/ jsx(number_input_extend, {
|
|
5
5
|
...props,
|
|
6
6
|
ref: ref
|
|
7
7
|
}));
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
export { UXNumberInput as default };
|
|
8
|
+
UXNumberInput.displayName = 'UX.NumberInput';
|
|
9
|
+
export { UXNumberInput };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import ExtendedPopover from './popover.extend';
|
|
3
3
|
export type UXPopoverProps = React.ComponentPropsWithRef<typeof ExtendedPopover>;
|
|
4
|
-
declare const UXPopover: React.FC<UXPopoverProps>;
|
|
5
|
-
export default UXPopover;
|
|
4
|
+
export declare const UXPopover: React.FC<UXPopoverProps>;
|
|
6
5
|
export { PopoverContent as UXPopoverContent, PopoverTrigger as UXPopoverTrigger } from '@heroui/popover';
|
|
@@ -6,5 +6,4 @@ const UXPopover = (props)=>/*#__PURE__*/ jsx(popover_extend, {
|
|
|
6
6
|
...props
|
|
7
7
|
});
|
|
8
8
|
UXPopover.displayName = 'UX.Popover';
|
|
9
|
-
|
|
10
|
-
export { PopoverContent as UXPopoverContent, PopoverTrigger as UXPopoverTrigger, components_UXPopover as default };
|
|
9
|
+
export { UXPopover, PopoverContent as UXPopoverContent, PopoverTrigger as UXPopoverTrigger };
|
|
@@ -4,13 +4,13 @@ const ExtendedPopover = extendVariants(Popover, {
|
|
|
4
4
|
variants: {
|
|
5
5
|
size: {
|
|
6
6
|
sm: {
|
|
7
|
-
content: '
|
|
7
|
+
content: 'p-1.5 max-w-[300px]'
|
|
8
8
|
},
|
|
9
9
|
md: {
|
|
10
|
-
content: '
|
|
10
|
+
content: 'p-2.5 max-w-[300px]'
|
|
11
11
|
},
|
|
12
12
|
lg: {
|
|
13
|
-
content: '
|
|
13
|
+
content: 'p-3.5 max-w-[300px]'
|
|
14
14
|
}
|
|
15
15
|
},
|
|
16
16
|
color: {
|
|
@@ -2,9 +2,8 @@ import React from 'react';
|
|
|
2
2
|
import { type RadioGroupProps } from '@heroui/radio';
|
|
3
3
|
import ExtendedRadio from './radio.extend';
|
|
4
4
|
export type UXRadioProps = React.ComponentPropsWithRef<typeof ExtendedRadio>;
|
|
5
|
-
declare const UXRadio: React.ForwardRefExoticComponent<Omit<Omit<import("@heroui/radio").RadioProps, "color"> & {
|
|
5
|
+
export declare const UXRadio: React.ForwardRefExoticComponent<Omit<Omit<import("@heroui/radio").RadioProps, "color"> & {
|
|
6
6
|
color?: "default" | "primary" | "secondary" | "success" | "warning" | "danger" | "bullish" | "bearish";
|
|
7
7
|
}, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
|
8
|
-
export default UXRadio;
|
|
9
8
|
export declare const UXRadioGroup: import("@heroui/system-rsc").InternalForwardRefRenderFunction<"div", RadioGroupProps, never>;
|
|
10
9
|
export type UXRadioGroupProps = RadioGroupProps;
|
|
@@ -7,6 +7,5 @@ const UXRadio = /*#__PURE__*/ forwardRef((props, ref)=>/*#__PURE__*/ jsx(radio_e
|
|
|
7
7
|
...props
|
|
8
8
|
}));
|
|
9
9
|
UXRadio.displayName = 'UX.Radio';
|
|
10
|
-
const components_UXRadio = UXRadio;
|
|
11
10
|
const UXRadioGroup = RadioGroup;
|
|
12
|
-
export {
|
|
11
|
+
export { UXRadio, UXRadioGroup };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { type SelectProps } from '@heroui/select';
|
|
2
2
|
type UXSelectProps = SelectProps;
|
|
3
|
-
declare const UXSelect: import("react").ForwardRefExoticComponent<Omit<UXSelectProps, "ref"> & import("react").RefAttributes<HTMLSelectElement>>;
|
|
4
|
-
export default UXSelect;
|
|
3
|
+
export declare const UXSelect: import("react").ForwardRefExoticComponent<Omit<UXSelectProps, "ref"> & import("react").RefAttributes<HTMLSelectElement>>;
|
|
5
4
|
export { SelectItem as UXSelectItem, SelectSection as UXSelectSection } from '@heroui/select';
|
|
6
5
|
export type { UXSelectProps };
|
|
@@ -2,7 +2,7 @@ import { jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { forwardRef } from "react";
|
|
3
3
|
import { Select, SelectItem, SelectSection } from "@heroui/select";
|
|
4
4
|
import { ChevronDownIcon } from "../../icons/index.js";
|
|
5
|
-
const
|
|
5
|
+
const UXSelect = /*#__PURE__*/ forwardRef((props, ref)=>{
|
|
6
6
|
const { fullWidth = false, classNames = {}, radius = 'sm', ...restProps } = props;
|
|
7
7
|
const { popoverContent, selectorIcon, trigger, value, ...restClassNames } = classNames;
|
|
8
8
|
return /*#__PURE__*/ jsx(Select, {
|
|
@@ -46,6 +46,5 @@ const UXSelect_UXSelect = /*#__PURE__*/ forwardRef((props, ref)=>{
|
|
|
46
46
|
...restProps
|
|
47
47
|
});
|
|
48
48
|
});
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
export { SelectItem as UXSelectItem, SelectSection as UXSelectSection, UXSelect as default };
|
|
49
|
+
UXSelect.displayName = 'UX.Select';
|
|
50
|
+
export { UXSelect, SelectItem as UXSelectItem, SelectSection as UXSelectSection };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type UXForegroundColor } from '@particle-network/ui-shared';
|
|
3
|
-
import { type SquareProps } from '../layout
|
|
3
|
+
import { type SquareProps } from '../layout';
|
|
4
4
|
export interface UXSpinnerProps extends SquareProps {
|
|
5
5
|
/**
|
|
6
6
|
* 颜色
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useEffect, useRef, useState } from "react";
|
|
3
3
|
import { cn } from "@heroui/theme";
|
|
4
|
-
import {
|
|
5
|
-
import Square from "../layout/
|
|
4
|
+
import { colorToClassName } from "@particle-network/ui-shared";
|
|
5
|
+
import { Square } from "../layout/index.js";
|
|
6
6
|
import { SpinnerIcon } from "./SpinnerIcon.js";
|
|
7
7
|
const UXSpinner = ({ size = 18, color = 'primary', duration = 1000, className, style, ...restProps })=>{
|
|
8
8
|
const [currentIndex, setCurrentIndex] = useState(0);
|
|
9
9
|
const animationRef = useRef(null);
|
|
10
|
-
const
|
|
10
|
+
const iconClassName = 'currentColor' === color ? void 0 : colorToClassName[color];
|
|
11
11
|
useEffect(()=>{
|
|
12
12
|
const stepDuration = duration / 12;
|
|
13
13
|
const animate = ()=>{
|
|
@@ -29,9 +29,7 @@ const UXSpinner = ({ size = 18, color = 'primary', duration = 1000, className, s
|
|
|
29
29
|
children: /*#__PURE__*/ jsx(SpinnerIcon, {
|
|
30
30
|
width: size,
|
|
31
31
|
height: size,
|
|
32
|
-
|
|
33
|
-
color: actualColor
|
|
34
|
-
},
|
|
32
|
+
className: iconClassName,
|
|
35
33
|
currentIndex: currentIndex
|
|
36
34
|
})
|
|
37
35
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import ExtendedSwitch from './switch.extend';
|
|
3
3
|
export type UXSwitchProps = React.ComponentPropsWithRef<typeof ExtendedSwitch>;
|
|
4
|
-
declare const UXSwitch: React.ForwardRefExoticComponent<Omit<Omit<{
|
|
4
|
+
export declare const UXSwitch: React.ForwardRefExoticComponent<Omit<Omit<{
|
|
5
5
|
ref?: React.Ref<HTMLInputElement> | undefined;
|
|
6
6
|
children?: React.ReactNode;
|
|
7
7
|
defaultChecked?: any;
|
|
@@ -328,4 +328,3 @@ declare const UXSwitch: React.ForwardRefExoticComponent<Omit<Omit<{
|
|
|
328
328
|
defaultSelected?: boolean | undefined;
|
|
329
329
|
thumbIcon?: React.ReactNode | ((props: import("@heroui/switch").SwitchThumbIconProps) => React.ReactNode);
|
|
330
330
|
}, "ref"> & React.RefAttributes<React.ReactElement<unknown, string | React.JSXElementConstructor<any>>>, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
|
331
|
-
export default UXSwitch;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef } from "react";
|
|
3
3
|
import switch_extend from "./switch.extend.js";
|
|
4
|
-
const
|
|
4
|
+
const UXSwitch = /*#__PURE__*/ forwardRef((props, ref)=>/*#__PURE__*/ jsx(switch_extend, {
|
|
5
5
|
...props,
|
|
6
6
|
ref: ref
|
|
7
7
|
}));
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
export { UXSwitch as default };
|
|
8
|
+
UXSwitch.displayName = 'UX.Switch';
|
|
9
|
+
export { UXSwitch };
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import ExtendedTabs from './tabs.extend';
|
|
3
3
|
export type UXTabsProps = React.ComponentPropsWithRef<typeof ExtendedTabs>;
|
|
4
|
-
declare const UXTabs: React.ForwardRefExoticComponent<Omit<Omit<import("@heroui/tabs").TabsProps, "color" | "variant"> & {
|
|
4
|
+
export declare const UXTabs: React.ForwardRefExoticComponent<Omit<Omit<import("@heroui/tabs").TabsProps, "color" | "variant"> & {
|
|
5
5
|
variant?: "solid" | "light" | "text" | "switch";
|
|
6
6
|
color?: "default" | "primary" | "success" | "warning" | "danger" | "bullish" | "bearish";
|
|
7
7
|
}, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
8
|
-
export default UXTabs;
|
|
9
8
|
export { Tab as UXTab } from '@heroui/tabs';
|
|
@@ -2,10 +2,9 @@ import { jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { forwardRef } from "react";
|
|
3
3
|
import tabs_extend from "./tabs.extend.js";
|
|
4
4
|
import { Tab } from "@heroui/tabs";
|
|
5
|
-
const
|
|
5
|
+
const UXTabs = /*#__PURE__*/ forwardRef((props, ref)=>/*#__PURE__*/ jsx(tabs_extend, {
|
|
6
6
|
...props,
|
|
7
7
|
ref: ref
|
|
8
8
|
}));
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
export { Tab as UXTab, UXTabs as default };
|
|
9
|
+
UXTabs.displayName = 'UX.Tabs';
|
|
10
|
+
export { Tab as UXTab, UXTabs };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ToastProps } from '@heroui/toast';
|
|
2
|
+
export type UXToastType = 'success' | 'error' | 'loading';
|
|
3
|
+
export type UXToastProps = Partial<ToastProps> & {
|
|
4
|
+
type: UXToastType;
|
|
5
|
+
};
|
|
6
|
+
export declare const UXToastProvider: () => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare const toast: {
|
|
8
|
+
success: (message: string, props?: Partial<ToastProps>) => string | null;
|
|
9
|
+
error: (message: string, props?: Partial<ToastProps>) => string | null;
|
|
10
|
+
loading: (message: string, props?: Partial<ToastProps>) => string | null;
|
|
11
|
+
show: (props?: Partial<ToastProps> & {
|
|
12
|
+
type: UXToastType;
|
|
13
|
+
}) => string | null;
|
|
14
|
+
closeAll: () => void;
|
|
15
|
+
close: (key: string) => void;
|
|
16
|
+
};
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { ToastProvider, addToast, closeAll, closeToast } from "@heroui/toast";
|
|
3
|
+
import CircleCheckIcon from "@particle-network/icons/web/CircleCheckIcon";
|
|
4
|
+
import CircleCloseIcon from "@particle-network/icons/web/CircleCloseIcon";
|
|
5
|
+
import CloseIcon from "@particle-network/icons/web/CloseIcon";
|
|
6
|
+
import { UXSpinner } from "../UXSpinner/index.js";
|
|
7
|
+
const UXToastProvider = ()=>/*#__PURE__*/ jsx(ToastProvider, {
|
|
8
|
+
placement: "top-center",
|
|
9
|
+
maxVisibleToasts: 5,
|
|
10
|
+
toastOffset: 40,
|
|
11
|
+
toastProps: {
|
|
12
|
+
timeout: 4000
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
const getIcon = (type)=>{
|
|
16
|
+
if ('success' === type) return /*#__PURE__*/ jsx(CircleCheckIcon, {
|
|
17
|
+
size: 18
|
|
18
|
+
});
|
|
19
|
+
if ('error' === type) return /*#__PURE__*/ jsx(CircleCloseIcon, {
|
|
20
|
+
size: 18
|
|
21
|
+
});
|
|
22
|
+
if ('loading' === type) return /*#__PURE__*/ jsx(UXSpinner, {
|
|
23
|
+
size: 18
|
|
24
|
+
});
|
|
25
|
+
return null;
|
|
26
|
+
};
|
|
27
|
+
const show = (props)=>{
|
|
28
|
+
const { type, hideCloseButton, variant, classNames, ...toastProps } = props ?? {};
|
|
29
|
+
return addToast({
|
|
30
|
+
classNames: {
|
|
31
|
+
base: [
|
|
32
|
+
'bg-tertiary rounded-xl px-3.5 py-3 shadow-none !w-fit max-w-[350px]',
|
|
33
|
+
!hideCloseButton && 'pr-12',
|
|
34
|
+
'flat' === variant && 'success' === type && 'bg-[#0E3728]',
|
|
35
|
+
'flat' === variant && 'error' === type && 'bg-[#501D1D]'
|
|
36
|
+
],
|
|
37
|
+
description: [
|
|
38
|
+
'text-foreground text-xs font-medium me-0 leading-4',
|
|
39
|
+
'flat' === variant && 'text-white'
|
|
40
|
+
],
|
|
41
|
+
icon: [
|
|
42
|
+
'shrink-0 h-5 w-5',
|
|
43
|
+
'success' === type && 'text-success',
|
|
44
|
+
'error' === type && 'text-danger',
|
|
45
|
+
'loading' === type && 'text-primary'
|
|
46
|
+
],
|
|
47
|
+
loadingComponent: [
|
|
48
|
+
'text-primary h-5 w-5'
|
|
49
|
+
],
|
|
50
|
+
content: [
|
|
51
|
+
'gap-x-2.5'
|
|
52
|
+
],
|
|
53
|
+
closeButton: [
|
|
54
|
+
'absolute right-3 top-1/2 -translate-y-1/2',
|
|
55
|
+
hideCloseButton ? 'opacity-0' : 'opacity-100'
|
|
56
|
+
],
|
|
57
|
+
...classNames
|
|
58
|
+
},
|
|
59
|
+
icon: getIcon(type),
|
|
60
|
+
closeIcon: /*#__PURE__*/ jsx(CloseIcon, {
|
|
61
|
+
className: 'flat' === variant ? 'text-white' : 'text-foreground'
|
|
62
|
+
}),
|
|
63
|
+
loadingComponent: /*#__PURE__*/ jsx(UXSpinner, {
|
|
64
|
+
size: 18
|
|
65
|
+
}),
|
|
66
|
+
timeout: 'loading' === type ? 1 / 0 : 4000,
|
|
67
|
+
...toastProps
|
|
68
|
+
});
|
|
69
|
+
};
|
|
70
|
+
const toast = {
|
|
71
|
+
success: (message, props)=>show({
|
|
72
|
+
type: 'success',
|
|
73
|
+
description: message,
|
|
74
|
+
...props
|
|
75
|
+
}),
|
|
76
|
+
error: (message, props)=>show({
|
|
77
|
+
type: 'error',
|
|
78
|
+
description: message,
|
|
79
|
+
...props
|
|
80
|
+
}),
|
|
81
|
+
loading: (message, props)=>show({
|
|
82
|
+
type: 'loading',
|
|
83
|
+
description: message,
|
|
84
|
+
timeout: 1 / 0,
|
|
85
|
+
...props
|
|
86
|
+
}),
|
|
87
|
+
show,
|
|
88
|
+
closeAll: closeAll,
|
|
89
|
+
close: closeToast
|
|
90
|
+
};
|
|
91
|
+
export { UXToastProvider, toast };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import ExtendedTooltip from './tooltip.extend';
|
|
3
3
|
export type UXTooltipProps = React.ComponentPropsWithRef<typeof ExtendedTooltip>;
|
|
4
|
-
declare const UXTooltip: React.FC<UXTooltipProps>;
|
|
5
|
-
export default UXTooltip;
|
|
4
|
+
export declare const UXTooltip: React.FC<UXTooltipProps>;
|
|
@@ -12,13 +12,12 @@ const renderContent = (content)=>{
|
|
|
12
12
|
x
|
|
13
13
|
]);
|
|
14
14
|
};
|
|
15
|
-
const
|
|
15
|
+
const UXTooltip = (props)=>{
|
|
16
16
|
const { content, ...restProps } = props;
|
|
17
17
|
return /*#__PURE__*/ jsx(tooltip_extend, {
|
|
18
18
|
content: renderContent(content),
|
|
19
19
|
...restProps
|
|
20
20
|
});
|
|
21
21
|
};
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
export { UXTooltip as default };
|
|
22
|
+
UXTooltip.displayName = 'UX.Tooltip';
|
|
23
|
+
export { UXTooltip };
|
|
@@ -4,13 +4,13 @@ const ExtendedTooltip = extendVariants(Tooltip, {
|
|
|
4
4
|
variants: {
|
|
5
5
|
size: {
|
|
6
6
|
sm: {
|
|
7
|
-
content: '
|
|
7
|
+
content: 'p-1.5 max-w-[300px]'
|
|
8
8
|
},
|
|
9
9
|
md: {
|
|
10
|
-
content: '
|
|
10
|
+
content: 'p-2.5 max-w-[300px]'
|
|
11
11
|
},
|
|
12
12
|
lg: {
|
|
13
|
-
content: '
|
|
13
|
+
content: 'p-3.5 max-w-[300px]'
|
|
14
14
|
}
|
|
15
15
|
},
|
|
16
16
|
color: {
|
|
@@ -1,52 +1,27 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export { default as Circle } from './layout/Circle';
|
|
5
|
-
export type { FlexProps } from './layout/Flex';
|
|
6
|
-
export { default as Flex } from './layout/Flex';
|
|
7
|
-
export type { HStackProps } from './layout/HStack';
|
|
8
|
-
export { default as HStack } from './layout/HStack';
|
|
9
|
-
export type { SquareProps } from './layout/Square';
|
|
10
|
-
export { default as Square } from './layout/Square';
|
|
11
|
-
export type { VStackProps } from './layout/VStack';
|
|
12
|
-
export { default as VStack } from './layout/VStack';
|
|
13
|
-
export type { ProgressWrapperProps } from './ProgressWrapper';
|
|
14
|
-
export { default as ProgressWrapper } from './ProgressWrapper';
|
|
15
|
-
export { default as Text } from './typography/Text';
|
|
16
|
-
export type { TextProps } from './typography/Text.type';
|
|
1
|
+
export * from './layout';
|
|
2
|
+
export * from './ProgressWrapper';
|
|
3
|
+
export * from './typography/Text';
|
|
17
4
|
export * from './UXButton';
|
|
18
5
|
export * from './UXCalendar';
|
|
19
|
-
export { default as UXCheckbox } from './UXCheckbox';
|
|
20
6
|
export * from './UXCheckbox';
|
|
21
|
-
export
|
|
22
|
-
export { default as UXChip } from './UXChip';
|
|
7
|
+
export * from './UXChip';
|
|
23
8
|
export * from './UXDatePicker';
|
|
24
9
|
export * from './UXDateRangePicker';
|
|
25
|
-
export
|
|
26
|
-
export { default as UXDivider } from './UXDivider';
|
|
10
|
+
export * from './UXDivider';
|
|
27
11
|
export * from './UXDropdown';
|
|
28
12
|
export * from './UXEmpty';
|
|
29
|
-
export
|
|
30
|
-
export { default as UXHint } from './UXHint';
|
|
31
|
-
export { default as UXInput } from './UXInput';
|
|
13
|
+
export * from './UXHint';
|
|
32
14
|
export * from './UXInput';
|
|
33
|
-
export
|
|
34
|
-
export { default as UXModal } from './UXModal';
|
|
35
|
-
export { default as UXNumberInput } from './UXNumberInput';
|
|
15
|
+
export * from './UXModal';
|
|
36
16
|
export * from './UXNumberInput';
|
|
37
17
|
export * from './UXPagination';
|
|
38
|
-
export { default as UXPopover } from './UXPopover';
|
|
39
18
|
export * from './UXPopover';
|
|
40
|
-
export { default as UXRadio } from './UXRadio';
|
|
41
19
|
export * from './UXRadio';
|
|
42
|
-
export { default as UXSelect } from './UXSelect';
|
|
43
20
|
export * from './UXSelect';
|
|
44
21
|
export * from './UXSpinner';
|
|
45
|
-
export
|
|
46
|
-
export { default as UXSwitch } from './UXSwitch';
|
|
22
|
+
export * from './UXSwitch';
|
|
47
23
|
export * from './UXTable';
|
|
48
|
-
export { default as UXTabs } from './UXTabs';
|
|
49
24
|
export * from './UXTabs';
|
|
50
25
|
export * from './UXTextarea';
|
|
51
|
-
export
|
|
52
|
-
export
|
|
26
|
+
export * from './UXToast';
|
|
27
|
+
export * from './UXTooltip';
|
package/dist/components/index.js
CHANGED
|
@@ -1,39 +1,27 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import HStack from "./layout/HStack.js";
|
|
5
|
-
import Square from "./layout/Square.js";
|
|
6
|
-
import VStack from "./layout/VStack.js";
|
|
7
|
-
import ProgressWrapper from "./ProgressWrapper/index.js";
|
|
8
|
-
import Text from "./typography/Text.js";
|
|
9
|
-
import UXCheckbox from "./UXCheckbox/index.js";
|
|
10
|
-
import UXChip from "./UXChip/index.js";
|
|
11
|
-
import UXDivider from "./UXDivider/index.js";
|
|
12
|
-
import UXHint from "./UXHint/index.js";
|
|
13
|
-
import UXInput from "./UXInput/index.js";
|
|
14
|
-
import UXModal from "./UXModal/index.js";
|
|
15
|
-
import UXNumberInput from "./UXNumberInput/index.js";
|
|
16
|
-
import UXPopover from "./UXPopover/index.js";
|
|
17
|
-
import UXRadio from "./UXRadio/index.js";
|
|
18
|
-
import UXSelect from "./UXSelect/index.js";
|
|
19
|
-
import UXSwitch from "./UXSwitch/index.js";
|
|
20
|
-
import UXTabs from "./UXTabs/index.js";
|
|
21
|
-
import UXTooltip from "./UXTooltip/index.js";
|
|
1
|
+
export * from "./layout/index.js";
|
|
2
|
+
export * from "./ProgressWrapper/index.js";
|
|
3
|
+
export * from "./typography/Text.js";
|
|
22
4
|
export * from "./UXButton/index.js";
|
|
23
5
|
export * from "./UXCalendar/index.js";
|
|
24
6
|
export * from "./UXCheckbox/index.js";
|
|
7
|
+
export * from "./UXChip/index.js";
|
|
25
8
|
export * from "./UXDatePicker/index.js";
|
|
26
9
|
export * from "./UXDateRangePicker/index.js";
|
|
10
|
+
export * from "./UXDivider/index.js";
|
|
27
11
|
export * from "./UXDropdown/index.js";
|
|
28
12
|
export * from "./UXEmpty/index.js";
|
|
13
|
+
export * from "./UXHint/index.js";
|
|
29
14
|
export * from "./UXInput/index.js";
|
|
15
|
+
export * from "./UXModal/index.js";
|
|
30
16
|
export * from "./UXNumberInput/index.js";
|
|
31
17
|
export * from "./UXPagination/index.js";
|
|
32
18
|
export * from "./UXPopover/index.js";
|
|
33
19
|
export * from "./UXRadio/index.js";
|
|
34
20
|
export * from "./UXSelect/index.js";
|
|
35
21
|
export * from "./UXSpinner/index.js";
|
|
22
|
+
export * from "./UXSwitch/index.js";
|
|
36
23
|
export * from "./UXTable/index.js";
|
|
37
24
|
export * from "./UXTabs/index.js";
|
|
38
25
|
export * from "./UXTextarea/index.js";
|
|
39
|
-
export
|
|
26
|
+
export * from "./UXToast/index.js";
|
|
27
|
+
export * from "./UXTooltip/index.js";
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
import { type FlexProps } from './Flex';
|
|
2
2
|
export type CenterProps = Omit<FlexProps, 'justify' | 'align'>;
|
|
3
|
-
declare const Center: import("react").ForwardRefExoticComponent<CenterProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
4
|
-
export default Center;
|
|
3
|
+
export declare const Center: import("react").ForwardRefExoticComponent<CenterProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef } from "react";
|
|
3
|
-
import Flex from "./Flex.js";
|
|
4
|
-
const
|
|
3
|
+
import { Flex } from "./Flex.js";
|
|
4
|
+
const Center = /*#__PURE__*/ forwardRef((props, ref)=>/*#__PURE__*/ jsx(Flex, {
|
|
5
5
|
ref: ref,
|
|
6
6
|
center: true,
|
|
7
7
|
...props
|
|
8
8
|
}));
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
export { Center as default };
|
|
9
|
+
Center.displayName = 'UX.Center';
|
|
10
|
+
export { Center };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { type SquareProps } from './Square';
|
|
2
2
|
export type CircleProps = SquareProps;
|
|
3
|
-
declare const Circle: import("react").ForwardRefExoticComponent<import("./Center").CenterProps & {
|
|
3
|
+
export declare const Circle: import("react").ForwardRefExoticComponent<import("./Center").CenterProps & {
|
|
4
4
|
size?: number;
|
|
5
5
|
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
6
|
-
export default Circle;
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef } from "react";
|
|
3
3
|
import { cn } from "@heroui/theme";
|
|
4
|
-
import Square from "./Square.js";
|
|
4
|
+
import { Square } from "./Square.js";
|
|
5
5
|
const Circle = /*#__PURE__*/ forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ jsx(Square, {
|
|
6
6
|
ref: ref,
|
|
7
7
|
className: cn('rounded-full', className),
|
|
8
8
|
...props
|
|
9
9
|
}));
|
|
10
10
|
Circle.displayName = 'UX.Circle';
|
|
11
|
-
|
|
12
|
-
export { layout_Circle as default };
|
|
11
|
+
export { Circle };
|
|
@@ -25,5 +25,4 @@ export interface FlexProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
25
25
|
self?: 'auto' | 'start' | 'end' | 'end-safe' | 'center' | 'center-safe' | 'stretch' | 'baseline' | 'baseline-last';
|
|
26
26
|
children?: React.ReactNode;
|
|
27
27
|
}
|
|
28
|
-
declare const Flex: React.ForwardRefExoticComponent<FlexProps & React.RefAttributes<HTMLDivElement>>;
|
|
29
|
-
export default Flex;
|
|
28
|
+
export declare const Flex: React.ForwardRefExoticComponent<FlexProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -3,7 +3,7 @@ import { forwardRef, useMemo } from "react";
|
|
|
3
3
|
import { cn } from "@heroui/theme";
|
|
4
4
|
import { spacingMap } from "@particle-network/ui-shared";
|
|
5
5
|
const isNil = (value)=>null == value;
|
|
6
|
-
const
|
|
6
|
+
const Flex = /*#__PURE__*/ forwardRef(({ fill, fullWidth, direction, center, items, justify, gap, wrap, vertical, grow, shrink, order, self, className, children, ...props }, ref)=>{
|
|
7
7
|
const gapValue = useMemo(()=>{
|
|
8
8
|
if (!gap) return '';
|
|
9
9
|
if ('number' == typeof gap) return `gap-${gap}`;
|
|
@@ -19,6 +19,5 @@ const Flex_Flex = /*#__PURE__*/ forwardRef(({ fill, fullWidth, direction, center
|
|
|
19
19
|
children: children
|
|
20
20
|
});
|
|
21
21
|
});
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
export { Flex as default };
|
|
22
|
+
Flex.displayName = 'UX.Flex';
|
|
23
|
+
export { Flex };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
import { type FlexProps } from './Flex';
|
|
2
2
|
export type HStackProps = Omit<FlexProps, 'direction' | 'vertical'>;
|
|
3
|
-
declare const HStack: import("react").ForwardRefExoticComponent<HStackProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
4
|
-
export default HStack;
|
|
3
|
+
export declare const HStack: import("react").ForwardRefExoticComponent<HStackProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef } from "react";
|
|
3
|
-
import Flex from "./Flex.js";
|
|
4
|
-
const
|
|
3
|
+
import { Flex } from "./Flex.js";
|
|
4
|
+
const HStack = /*#__PURE__*/ forwardRef((props, ref)=>/*#__PURE__*/ jsx(Flex, {
|
|
5
5
|
ref: ref,
|
|
6
6
|
direction: "row",
|
|
7
7
|
items: "center",
|
|
8
8
|
...props
|
|
9
9
|
}));
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
export { HStack as default };
|
|
10
|
+
HStack.displayName = 'UX.HStack';
|
|
11
|
+
export { HStack };
|
|
@@ -2,7 +2,6 @@ import { type CenterProps } from './Center';
|
|
|
2
2
|
export type SquareProps = CenterProps & {
|
|
3
3
|
size?: number;
|
|
4
4
|
};
|
|
5
|
-
declare const Square: import("react").ForwardRefExoticComponent<CenterProps & {
|
|
5
|
+
export declare const Square: import("react").ForwardRefExoticComponent<CenterProps & {
|
|
6
6
|
size?: number;
|
|
7
7
|
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
8
|
-
export default Square;
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef } from "react";
|
|
3
3
|
import { cn } from "@heroui/theme";
|
|
4
|
-
import Center from "./Center.js";
|
|
5
|
-
const
|
|
4
|
+
import { Center } from "./Center.js";
|
|
5
|
+
const Square = /*#__PURE__*/ forwardRef(({ size, className, ...props }, ref)=>/*#__PURE__*/ jsx(Center, {
|
|
6
6
|
ref: ref,
|
|
7
7
|
shrink: 0,
|
|
8
8
|
className: cn(size && `w-[${size}px] h-[${size}px]`, className),
|
|
9
9
|
...props
|
|
10
10
|
}));
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
export { Square as default };
|
|
11
|
+
Square.displayName = 'UX.Square';
|
|
12
|
+
export { Square };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
import { type FlexProps } from './Flex';
|
|
2
2
|
export type VStackProps = Omit<FlexProps, 'direction' | 'vertical'>;
|
|
3
|
-
declare const VStack: import("react").ForwardRefExoticComponent<VStackProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
4
|
-
export default VStack;
|
|
3
|
+
export declare const VStack: import("react").ForwardRefExoticComponent<VStackProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef } from "react";
|
|
3
|
-
import Flex from "./Flex.js";
|
|
3
|
+
import { Flex } from "./Flex.js";
|
|
4
4
|
const VStack = /*#__PURE__*/ forwardRef(({ items = 'stretch', ...props }, ref)=>/*#__PURE__*/ jsx(Flex, {
|
|
5
5
|
ref: ref,
|
|
6
6
|
vertical: true,
|
|
@@ -8,5 +8,4 @@ const VStack = /*#__PURE__*/ forwardRef(({ items = 'stretch', ...props }, ref)=>
|
|
|
8
8
|
...props
|
|
9
9
|
}));
|
|
10
10
|
VStack.displayName = 'UX.VStack';
|
|
11
|
-
|
|
12
|
-
export { layout_VStack as default };
|
|
11
|
+
export { VStack };
|
|
@@ -1,3 +1,2 @@
|
|
|
1
1
|
import { type TextProps } from './Text.type';
|
|
2
|
-
declare const Text: import("react").ForwardRefExoticComponent<TextProps & import("react").RefAttributes<HTMLSpanElement>>;
|
|
3
|
-
export default Text;
|
|
2
|
+
export declare const Text: import("react").ForwardRefExoticComponent<TextProps & import("react").RefAttributes<HTMLSpanElement>>;
|
|
@@ -4,9 +4,11 @@ import { cn } from "@heroui/theme";
|
|
|
4
4
|
import { textClasses } from "./Text.type.js";
|
|
5
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", {
|
|
6
6
|
ref: ref,
|
|
7
|
-
|
|
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),
|
|
8
11
|
...props
|
|
9
12
|
}));
|
|
10
13
|
Text.displayName = 'UX.Text';
|
|
11
|
-
|
|
12
|
-
export { typography_Text as default };
|
|
14
|
+
export { Text };
|
|
@@ -81,7 +81,7 @@ export interface TextProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
|
81
81
|
* | default | - | - |
|
|
82
82
|
* | foreground | #FFFFFF | #000000 |
|
|
83
83
|
* | secondary | #A1A1AA | #767A80 |
|
|
84
|
-
* | tertiary | #4E4E56 | #
|
|
84
|
+
* | tertiary | #4E4E56 | #D8D8DE |
|
|
85
85
|
* | primary | #D745FF | #000000 |
|
|
86
86
|
* | success | #45B167 | #2E9F4A |
|
|
87
87
|
* | danger | #E84A5A | #DE4A40 |
|
|
@@ -89,7 +89,7 @@ export interface TextProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
|
89
89
|
* | warning | #FF9821 | #FF9821 |
|
|
90
90
|
* | gold | #FFB800 | #F38300 |
|
|
91
91
|
*/
|
|
92
|
-
color?: UXForegroundColor
|
|
92
|
+
color?: UXForegroundColor | `#${string}`;
|
|
93
93
|
lineHeight?: TextLineHeight;
|
|
94
94
|
align?: TextAlign;
|
|
95
95
|
}
|
|
@@ -41,7 +41,7 @@ const inputClasses = {
|
|
|
41
41
|
color: {
|
|
42
42
|
default: {
|
|
43
43
|
inputWrapper: 'caret-foreground',
|
|
44
|
-
input: 'text-foreground
|
|
44
|
+
input: 'text-foreground'
|
|
45
45
|
},
|
|
46
46
|
primary: {
|
|
47
47
|
inputWrapper: 'caret-primary',
|
|
@@ -49,7 +49,7 @@ const inputClasses = {
|
|
|
49
49
|
},
|
|
50
50
|
secondary: {
|
|
51
51
|
inputWrapper: 'caret-foreground',
|
|
52
|
-
input: 'text-
|
|
52
|
+
input: 'text-secondary'
|
|
53
53
|
},
|
|
54
54
|
success: {
|
|
55
55
|
inputWrapper: 'caret-success',
|
|
@@ -185,9 +185,9 @@ const inputClasses = {
|
|
|
185
185
|
'lg'
|
|
186
186
|
],
|
|
187
187
|
class: {
|
|
188
|
-
inputWrapper: 'bg-background-200 text-
|
|
188
|
+
inputWrapper: 'bg-background-200 text-tertiary font-medium',
|
|
189
189
|
label: 'font-medium',
|
|
190
|
-
input: '!outline-none placeholder:text-
|
|
190
|
+
input: '!outline-none placeholder:text-tertiary dark:placeholder:text-tertiary placeholder:font-medium font-medium text-foreground'
|
|
191
191
|
}
|
|
192
192
|
},
|
|
193
193
|
{
|
|
@@ -195,7 +195,7 @@ const inputClasses = {
|
|
|
195
195
|
color: 'default',
|
|
196
196
|
isInvalid: false,
|
|
197
197
|
class: {
|
|
198
|
-
inputWrapper: 'group-data-[focus=true]:border-foreground
|
|
198
|
+
inputWrapper: 'group-data-[focus=true]:border-foreground'
|
|
199
199
|
}
|
|
200
200
|
},
|
|
201
201
|
{
|
|
@@ -211,7 +211,7 @@ const inputClasses = {
|
|
|
211
211
|
color: 'secondary',
|
|
212
212
|
isInvalid: false,
|
|
213
213
|
class: {
|
|
214
|
-
inputWrapper: 'group-data-[focus=true]:border-
|
|
214
|
+
inputWrapper: 'group-data-[focus=true]:border-secondary'
|
|
215
215
|
}
|
|
216
216
|
},
|
|
217
217
|
{
|
|
@@ -260,9 +260,9 @@ const inputClasses = {
|
|
|
260
260
|
isInvalid: false,
|
|
261
261
|
class: {
|
|
262
262
|
inputWrapper: [
|
|
263
|
-
'border-foreground
|
|
264
|
-
'data-[hover=true]:border-foreground
|
|
265
|
-
'group-data-[focus=true]:border-foreground
|
|
263
|
+
'border-foreground',
|
|
264
|
+
'data-[hover=true]:border-foreground',
|
|
265
|
+
'group-data-[focus=true]:border-foreground'
|
|
266
266
|
]
|
|
267
267
|
}
|
|
268
268
|
},
|
|
@@ -284,9 +284,9 @@ const inputClasses = {
|
|
|
284
284
|
isInvalid: false,
|
|
285
285
|
class: {
|
|
286
286
|
inputWrapper: [
|
|
287
|
-
'border-
|
|
287
|
+
'border-secondary',
|
|
288
288
|
'data-[hover=true]:bg-background-200/70',
|
|
289
|
-
'group-data-[focus=true]:border-
|
|
289
|
+
'group-data-[focus=true]:border-secondary'
|
|
290
290
|
]
|
|
291
291
|
}
|
|
292
292
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@particle-network/ui-react",
|
|
3
|
-
"version": "0.3.0-beta.
|
|
3
|
+
"version": "0.3.0-beta.11",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -39,8 +39,8 @@
|
|
|
39
39
|
"@types/react": "^19.1.10",
|
|
40
40
|
"react": "^19.1.0",
|
|
41
41
|
"typescript": "^5.8.3",
|
|
42
|
-
"@particle-network/
|
|
43
|
-
"@particle-network/
|
|
42
|
+
"@particle-network/eslint-config": "0.3.0",
|
|
43
|
+
"@particle-network/lintstaged-config": "0.1.0"
|
|
44
44
|
},
|
|
45
45
|
"peerDependencies": {
|
|
46
46
|
"react": ">=16.9.0",
|
|
@@ -48,7 +48,8 @@
|
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
50
|
"ahooks": "^3.9.4",
|
|
51
|
-
"@particle-network/ui-shared": "0.
|
|
51
|
+
"@particle-network/ui-shared": "0.2.0-beta.3",
|
|
52
|
+
"@particle-network/icons": "0.3.0-beta.6"
|
|
52
53
|
},
|
|
53
54
|
"scripts": {
|
|
54
55
|
"build": "rslib build",
|
package/tailwind-preset.js
CHANGED
|
@@ -128,14 +128,14 @@ module.exports = {
|
|
|
128
128
|
DEFAULT: '#FFFFFF',
|
|
129
129
|
},
|
|
130
130
|
background: {
|
|
131
|
-
200: '#
|
|
132
|
-
300: '#
|
|
133
|
-
400: '#
|
|
131
|
+
200: '#F0F0F2',
|
|
132
|
+
300: '#F8F8FA',
|
|
133
|
+
400: '#FFFFFF',
|
|
134
134
|
500: '#FFFFFF',
|
|
135
|
-
DEFAULT: '#
|
|
135
|
+
DEFAULT: '#F8F8FA',
|
|
136
136
|
},
|
|
137
137
|
foreground: {
|
|
138
|
-
100: '#
|
|
138
|
+
100: '#D8D8DE',
|
|
139
139
|
300: '#767A80',
|
|
140
140
|
500: '#000000',
|
|
141
141
|
DEFAULT: '#000000',
|
|
@@ -156,7 +156,7 @@ module.exports = {
|
|
|
156
156
|
foreground: '#FFFFFF',
|
|
157
157
|
},
|
|
158
158
|
tertiary: {
|
|
159
|
-
DEFAULT: '#
|
|
159
|
+
DEFAULT: '#D8D8DE',
|
|
160
160
|
foreground: '#000000',
|
|
161
161
|
},
|
|
162
162
|
success: {
|
|
@@ -172,7 +172,7 @@ module.exports = {
|
|
|
172
172
|
foreground: '#FFFFFF',
|
|
173
173
|
},
|
|
174
174
|
focus: '#D745FF',
|
|
175
|
-
divider: '#
|
|
175
|
+
divider: '#E8E8ED',
|
|
176
176
|
alert: '#E65E16',
|
|
177
177
|
gold: '#F38300',
|
|
178
178
|
},
|