@vetc-miniapp/ui-react 0.0.23 → 0.0.25
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/README.md +375 -56
- package/dist/bridge.d.ts +11 -0
- package/dist/bridge.js +20 -0
- package/dist/components/app.d.ts +6 -0
- package/dist/components/app.js +34 -0
- package/dist/components/avatar/Avatar.d.ts +21 -0
- package/dist/components/avatar/Avatar.js +33 -0
- package/dist/components/avatar/index.d.ts +2 -0
- package/dist/components/avatar/index.js +1 -0
- package/dist/components/bottom-sheet/BottomSheet.d.ts +19 -0
- package/dist/components/bottom-sheet/BottomSheet.js +70 -0
- package/dist/components/bottom-sheet/index.d.ts +2 -0
- package/dist/components/bottom-sheet/index.js +1 -0
- package/dist/components/button/Button.d.ts +32 -0
- package/dist/components/button/Button.js +165 -0
- package/dist/components/button/index.d.ts +2 -0
- package/dist/components/button/index.js +1 -0
- package/dist/components/button-group/ButtonGroup.d.ts +28 -0
- package/dist/components/button-group/ButtonGroup.js +21 -0
- package/dist/components/button-group/index.d.ts +2 -0
- package/dist/components/button-group/index.js +1 -0
- package/dist/components/card/Card.d.ts +18 -0
- package/dist/components/card/Card.js +35 -0
- package/dist/components/card/index.d.ts +2 -0
- package/dist/components/card/index.js +1 -0
- package/dist/components/checkbox/Checkbox.d.ts +41 -0
- package/dist/components/checkbox/Checkbox.js +94 -0
- package/dist/components/checkbox/index.d.ts +2 -0
- package/dist/components/checkbox/index.js +1 -0
- package/dist/components/chip/Chip.d.ts +24 -0
- package/dist/components/chip/Chip.js +83 -0
- package/dist/components/chip/index.d.ts +2 -0
- package/dist/components/chip/index.js +1 -0
- package/dist/components/dialog/Dialog.d.ts +19 -0
- package/dist/components/dialog/Dialog.js +51 -0
- package/dist/components/dialog/index.d.ts +2 -0
- package/dist/components/dialog/index.js +1 -0
- package/dist/components/divider/Divider.d.ts +16 -0
- package/dist/components/divider/Divider.js +18 -0
- package/dist/components/divider/index.d.ts +2 -0
- package/dist/components/divider/index.js +1 -0
- package/dist/components/input/Input.d.ts +40 -0
- package/dist/components/input/Input.js +51 -0
- package/dist/components/input/index.d.ts +2 -0
- package/dist/components/input/index.js +1 -0
- package/dist/components/list/List.d.ts +31 -0
- package/dist/components/list/List.js +72 -0
- package/dist/components/list/index.d.ts +2 -0
- package/dist/components/list/index.js +1 -0
- package/dist/components/loading/Loading.d.ts +28 -0
- package/dist/components/loading/Loading.js +33 -0
- package/dist/components/loading/index.d.ts +2 -0
- package/dist/components/loading/index.js +1 -0
- package/dist/components/modal/Modal.d.ts +38 -0
- package/dist/components/modal/Modal.js +50 -0
- package/dist/components/modal/index.d.ts +2 -0
- package/dist/components/modal/index.js +1 -0
- package/dist/components/navigation-bar/NavigationBar.d.ts +44 -0
- package/dist/components/navigation-bar/NavigationBar.js +70 -0
- package/dist/components/navigation-bar/index.d.ts +2 -0
- package/dist/components/navigation-bar/index.js +1 -0
- package/dist/components/radio/Radio.d.ts +40 -0
- package/dist/components/radio/Radio.js +88 -0
- package/dist/components/radio/index.d.ts +2 -0
- package/dist/components/radio/index.js +1 -0
- package/dist/components/select/Select.d.ts +29 -0
- package/dist/components/select/Select.js +30 -0
- package/dist/components/select/index.d.ts +2 -0
- package/dist/components/select/index.js +1 -0
- package/dist/components/switch/Switch.d.ts +23 -0
- package/dist/components/switch/Switch.js +81 -0
- package/dist/components/switch/index.d.ts +2 -0
- package/dist/components/switch/index.js +1 -0
- package/dist/components/tab-bar/TabBar.d.ts +28 -0
- package/dist/components/tab-bar/TabBar.js +60 -0
- package/dist/components/tab-bar/index.d.ts +2 -0
- package/dist/components/tab-bar/index.js +1 -0
- package/dist/components/textarea/Textarea.d.ts +31 -0
- package/dist/components/textarea/Textarea.js +33 -0
- package/dist/components/textarea/index.d.ts +2 -0
- package/dist/components/textarea/index.js +1 -0
- package/dist/components/toast/Toast.d.ts +41 -0
- package/dist/components/toast/Toast.js +61 -0
- package/dist/components/toast/index.d.ts +2 -0
- package/dist/components/toast/index.js +1 -0
- package/dist/components/typography/Typography.d.ts +45 -0
- package/dist/components/typography/Typography.js +143 -0
- package/dist/components/typography/index.d.ts +2 -0
- package/dist/components/typography/index.js +1 -0
- package/dist/hooks/use-app-pause.d.ts +6 -0
- package/dist/hooks/use-app-pause.js +29 -0
- package/dist/hooks/use-app-resume.d.ts +6 -0
- package/dist/hooks/use-app-resume.js +28 -0
- package/{src/ui-react/hooks/use-app-state.ts → dist/hooks/use-app-state.d.ts} +0 -1
- package/dist/hooks/use-app-state.js +1 -0
- package/dist/hooks/use-did-hide.d.ts +6 -0
- package/dist/hooks/use-did-hide.js +21 -0
- package/dist/hooks/use-did-show.d.ts +6 -0
- package/dist/hooks/use-did-show.js +21 -0
- package/dist/hooks/use-listener-scan-qr.d.ts +21 -0
- package/dist/hooks/use-listener-scan-qr.js +29 -0
- package/dist/hooks/use-navigate.d.ts +8 -0
- package/dist/hooks/use-navigate.js +23 -0
- package/dist/hooks/use-tap-app-bar.d.ts +6 -0
- package/dist/hooks/use-tap-app-bar.js +21 -0
- package/dist/index.d.ts +56 -0
- package/dist/index.js +41 -0
- package/dist/styles/VETCProvider.d.ts +114 -0
- package/dist/styles/VETCProvider.js +124 -0
- package/dist/styles/tokens.css +448 -0
- package/dist/tokens/colors.d.ts +127 -0
- package/dist/tokens/colors.js +75 -0
- package/dist/tokens/index.d.ts +3 -0
- package/dist/tokens/index.js +3 -0
- package/dist/tokens/spacing.d.ts +56 -0
- package/dist/tokens/spacing.js +56 -0
- package/dist/tokens/typography.d.ts +121 -0
- package/dist/tokens/typography.js +57 -0
- package/dist/types/app.d.ts +21 -0
- package/dist/types/app.js +1 -0
- package/package.json +26 -8
- package/src/dist/ui-react/index.js +0 -2
- package/src/dist/ui-react/index.js.LICENSE.txt +0 -11
- package/src/ui-react/bridge.js +0 -36
- package/src/ui-react/bridge.ts +0 -48
- package/src/ui-react/components/app.d.ts +0 -7
- package/src/ui-react/components/app.jsx +0 -80
- package/src/ui-react/components/app.tsx +0 -42
- package/src/ui-react/components/app1.js +0 -101
- package/src/ui-react/hooks/use-app-pause.js +0 -35
- package/src/ui-react/hooks/use-app-pause.ts +0 -33
- package/src/ui-react/hooks/use-app-resume.js +0 -37
- package/src/ui-react/hooks/use-app-resume.ts +0 -32
- package/src/ui-react/hooks/use-app-state.js +0 -35
- package/src/ui-react/hooks/use-did-hide.js +0 -25
- package/src/ui-react/hooks/use-did-hide.ts +0 -34
- package/src/ui-react/hooks/use-did-show.js +0 -26
- package/src/ui-react/hooks/use-did-show.ts +0 -34
- package/src/ui-react/hooks/use-listener-scan-qr.js +0 -33
- package/src/ui-react/hooks/use-listener-scan-qr.ts +0 -52
- package/src/ui-react/hooks/use-navigate.js +0 -15
- package/src/ui-react/hooks/use-navigate.ts +0 -41
- package/src/ui-react/index.js +0 -8
- package/src/ui-react/index.ts +0 -9
- package/src/ui-react/types/app.js +0 -30
- package/src/ui-react/types/app.ts +0 -32
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
function BackIcon() {
|
|
3
|
+
return (_jsx("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", "aria-hidden": "true", children: _jsx("path", { d: "M15 19L8 12L15 5", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) }));
|
|
4
|
+
}
|
|
5
|
+
function CloseIcon() {
|
|
6
|
+
return (_jsx("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", "aria-hidden": "true", children: _jsx("path", { d: "M18 6L6 18M6 6L18 18", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" }) }));
|
|
7
|
+
}
|
|
8
|
+
const iconBtnStyle = {
|
|
9
|
+
background: 'none',
|
|
10
|
+
border: 'none',
|
|
11
|
+
cursor: 'pointer',
|
|
12
|
+
width: 'var(--vetc-nav-icon-btn-size)',
|
|
13
|
+
height: 'var(--vetc-nav-icon-btn-size)',
|
|
14
|
+
display: 'flex',
|
|
15
|
+
alignItems: 'center',
|
|
16
|
+
justifyContent: 'center',
|
|
17
|
+
borderRadius: 'var(--vetc-radius-pill)',
|
|
18
|
+
color: 'var(--vetc-nav-icon-color)',
|
|
19
|
+
flexShrink: 0,
|
|
20
|
+
padding: 0,
|
|
21
|
+
transition: 'background-color var(--vetc-transition-fast)',
|
|
22
|
+
};
|
|
23
|
+
export function NavigationBar({ title, leading = 'none', leadingIcon, onLeadingPress, actions = [], leftSlot, rightSlot, backgroundColor, divider = true, transparent = false, className = '', style, id,
|
|
24
|
+
// deprecated props
|
|
25
|
+
showBack, backIcon, onBack, left, right, }) {
|
|
26
|
+
// Backward compat
|
|
27
|
+
const resolvedLeading = showBack ? 'back' : leading;
|
|
28
|
+
const resolvedLeadingIcon = leadingIcon ?? backIcon;
|
|
29
|
+
const resolvedOnLeading = onLeadingPress ?? onBack;
|
|
30
|
+
const renderLeadingButton = () => {
|
|
31
|
+
if (leftSlot !== undefined || left !== undefined)
|
|
32
|
+
return leftSlot ?? left;
|
|
33
|
+
if (resolvedLeading === 'none')
|
|
34
|
+
return null;
|
|
35
|
+
const icon = resolvedLeadingIcon ?? (resolvedLeading === 'close' ? _jsx(CloseIcon, {}) : _jsx(BackIcon, {}));
|
|
36
|
+
const label = resolvedLeading === 'close' ? 'Đóng' : 'Quay lại';
|
|
37
|
+
return (_jsx("button", { onClick: resolvedOnLeading, style: iconBtnStyle, "aria-label": label, children: icon }));
|
|
38
|
+
};
|
|
39
|
+
return (_jsxs("header", { id: id, className: `vetc-nav-bar ${className}`, style: {
|
|
40
|
+
display: 'flex',
|
|
41
|
+
alignItems: 'center',
|
|
42
|
+
height: 'var(--vetc-nav-height)',
|
|
43
|
+
padding: `0 var(--vetc-nav-padding-x)`,
|
|
44
|
+
backgroundColor: transparent ? 'transparent' : (backgroundColor ?? 'var(--vetc-nav-bg)'),
|
|
45
|
+
borderBottom: divider && !transparent ? `1px solid var(--vetc-nav-border)` : 'none',
|
|
46
|
+
fontFamily: 'var(--vetc-font-family)',
|
|
47
|
+
position: 'relative',
|
|
48
|
+
...style,
|
|
49
|
+
}, children: [_jsx("div", { style: { display: 'flex', alignItems: 'center', minWidth: 'var(--vetc-nav-icon-btn-size)', zIndex: 1 }, children: renderLeadingButton() }), title && (_jsx("div", { style: {
|
|
50
|
+
position: 'absolute',
|
|
51
|
+
left: 0,
|
|
52
|
+
right: 0,
|
|
53
|
+
display: 'flex',
|
|
54
|
+
alignItems: 'center',
|
|
55
|
+
justifyContent: 'center',
|
|
56
|
+
pointerEvents: 'none',
|
|
57
|
+
}, children: _jsx("span", { style: {
|
|
58
|
+
fontSize: 'var(--vetc-nav-title-size)',
|
|
59
|
+
fontWeight: 'var(--vetc-nav-title-weight)',
|
|
60
|
+
color: 'var(--vetc-nav-title-color)',
|
|
61
|
+
lineHeight: 'var(--vetc-line-height-normal)',
|
|
62
|
+
maxWidth: '60%',
|
|
63
|
+
overflow: 'hidden',
|
|
64
|
+
textOverflow: 'ellipsis',
|
|
65
|
+
whiteSpace: 'nowrap',
|
|
66
|
+
}, children: title }) })), _jsx("div", { style: { display: 'flex', alignItems: 'center', gap: 'var(--vetc-space-4)', marginLeft: 'auto', zIndex: 1 }, children: rightSlot !== undefined || right !== undefined
|
|
67
|
+
? (rightSlot ?? right)
|
|
68
|
+
: actions.slice(0, 2).map((action, i) => (_jsx("button", { id: action.id, onClick: action.onClick, disabled: action.disabled, "aria-label": action.label, style: { ...iconBtnStyle, opacity: action.disabled ? 0.4 : 1 }, children: action.icon }, i))) })] }));
|
|
69
|
+
}
|
|
70
|
+
export default NavigationBar;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { NavigationBar } from './NavigationBar';
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* VETC Radio & RadioGroup
|
|
3
|
+
* Figma: size=20px, states: default/hover/selected/disabled
|
|
4
|
+
* variant: neutral (gray-90) | brand (green-40)
|
|
5
|
+
*/
|
|
6
|
+
import React from 'react';
|
|
7
|
+
export type RadioVariant = 'neutral' | 'brand';
|
|
8
|
+
export interface RadioProps {
|
|
9
|
+
label?: React.ReactNode;
|
|
10
|
+
description?: React.ReactNode;
|
|
11
|
+
checked?: boolean;
|
|
12
|
+
defaultChecked?: boolean;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
variant?: RadioVariant;
|
|
15
|
+
onChange?: (checked: boolean) => void;
|
|
16
|
+
value?: any;
|
|
17
|
+
id?: string;
|
|
18
|
+
className?: string;
|
|
19
|
+
style?: React.CSSProperties;
|
|
20
|
+
}
|
|
21
|
+
export declare function Radio({ label, description, checked, defaultChecked, disabled, variant, onChange, value, id, className, style, }: RadioProps): import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
export interface RadioOption {
|
|
23
|
+
label: React.ReactNode;
|
|
24
|
+
description?: React.ReactNode;
|
|
25
|
+
value: any;
|
|
26
|
+
disabled?: boolean;
|
|
27
|
+
}
|
|
28
|
+
export interface RadioGroupProps {
|
|
29
|
+
options: RadioOption[];
|
|
30
|
+
value?: any;
|
|
31
|
+
defaultValue?: any;
|
|
32
|
+
direction?: 'horizontal' | 'vertical';
|
|
33
|
+
disabled?: boolean;
|
|
34
|
+
variant?: RadioVariant;
|
|
35
|
+
onChange?: (value: any) => void;
|
|
36
|
+
className?: string;
|
|
37
|
+
style?: React.CSSProperties;
|
|
38
|
+
}
|
|
39
|
+
export declare function RadioGroup({ options, value, defaultValue, direction, disabled, variant, onChange, className, style, }: RadioGroupProps): import("react/jsx-runtime").JSX.Element;
|
|
40
|
+
export default Radio;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* VETC Radio & RadioGroup
|
|
4
|
+
* Figma: size=20px, states: default/hover/selected/disabled
|
|
5
|
+
* variant: neutral (gray-90) | brand (green-40)
|
|
6
|
+
*/
|
|
7
|
+
import { useState } from 'react';
|
|
8
|
+
export function Radio({ label, description, checked, defaultChecked = false, disabled = false, variant = 'brand', onChange, value, id, className = '', style, }) {
|
|
9
|
+
const [internalChecked, setInternalChecked] = useState(defaultChecked);
|
|
10
|
+
const [hovered, setHovered] = useState(false);
|
|
11
|
+
const isControlled = checked !== undefined;
|
|
12
|
+
const isChecked = isControlled ? checked : internalChecked;
|
|
13
|
+
const handleChange = () => {
|
|
14
|
+
if (disabled || isChecked)
|
|
15
|
+
return;
|
|
16
|
+
if (!isControlled)
|
|
17
|
+
setInternalChecked(true);
|
|
18
|
+
onChange?.(true);
|
|
19
|
+
};
|
|
20
|
+
const accentColor = variant === 'brand'
|
|
21
|
+
? 'var(--vetc-color-brand)'
|
|
22
|
+
: 'var(--vetc-gray-90)';
|
|
23
|
+
const accentHover = variant === 'brand'
|
|
24
|
+
? 'var(--vetc-color-brand-hover)'
|
|
25
|
+
: 'var(--vetc-gray-70)';
|
|
26
|
+
const ringColor = disabled
|
|
27
|
+
? 'var(--vetc-color-border-disabled)'
|
|
28
|
+
: isChecked
|
|
29
|
+
? (hovered ? accentHover : accentColor)
|
|
30
|
+
: (hovered ? accentColor : 'var(--vetc-color-border)');
|
|
31
|
+
const dotColor = disabled ? 'var(--vetc-color-text-disabled)' : accentColor;
|
|
32
|
+
return (_jsxs("label", { htmlFor: id, className: `vetc-radio ${className}`, onMouseEnter: () => !disabled && setHovered(true), onMouseLeave: () => setHovered(false), style: {
|
|
33
|
+
display: 'inline-flex',
|
|
34
|
+
alignItems: description ? 'flex-start' : 'center',
|
|
35
|
+
gap: 'var(--vetc-space-12)',
|
|
36
|
+
cursor: disabled ? 'not-allowed' : 'pointer',
|
|
37
|
+
userSelect: 'none',
|
|
38
|
+
fontFamily: 'var(--vetc-font-family)',
|
|
39
|
+
...style,
|
|
40
|
+
}, children: [_jsx("input", { id: id, type: "radio", checked: isChecked, disabled: disabled, value: value, onChange: handleChange, style: { position: 'absolute', opacity: 0, width: 0, height: 0, pointerEvents: 'none' } }), _jsx("span", { "aria-hidden": "true", style: {
|
|
41
|
+
width: '20px',
|
|
42
|
+
height: '20px',
|
|
43
|
+
flexShrink: 0,
|
|
44
|
+
borderRadius: '50%',
|
|
45
|
+
border: `1.5px solid ${ringColor}`,
|
|
46
|
+
backgroundColor: 'transparent',
|
|
47
|
+
display: 'flex',
|
|
48
|
+
alignItems: 'center',
|
|
49
|
+
justifyContent: 'center',
|
|
50
|
+
transition: 'border-color var(--vetc-transition-fast)',
|
|
51
|
+
marginTop: description ? '2px' : 0,
|
|
52
|
+
}, children: isChecked && (_jsx("span", { style: {
|
|
53
|
+
width: '8px',
|
|
54
|
+
height: '8px',
|
|
55
|
+
borderRadius: '50%',
|
|
56
|
+
backgroundColor: dotColor,
|
|
57
|
+
flexShrink: 0,
|
|
58
|
+
} })) }), (label || description) && (_jsxs("span", { style: { display: 'flex', flexDirection: 'column', gap: 'var(--vetc-space-2)' }, children: [label && (_jsx("span", { style: {
|
|
59
|
+
fontSize: 'var(--vetc-font-size-base)',
|
|
60
|
+
fontWeight: 'var(--vetc-font-weight-regular)',
|
|
61
|
+
lineHeight: 'var(--vetc-line-height-relaxed)',
|
|
62
|
+
color: disabled ? 'var(--vetc-color-text-disabled)' : 'var(--vetc-color-text-primary)',
|
|
63
|
+
}, children: label })), description && (_jsx("span", { style: {
|
|
64
|
+
fontSize: 'var(--vetc-font-size-sm)',
|
|
65
|
+
fontWeight: 'var(--vetc-font-weight-regular)',
|
|
66
|
+
lineHeight: 'var(--vetc-line-height-relaxed)',
|
|
67
|
+
color: disabled ? 'var(--vetc-color-text-disabled)' : 'var(--vetc-color-text-secondary)',
|
|
68
|
+
}, children: description }))] }))] }));
|
|
69
|
+
}
|
|
70
|
+
export function RadioGroup({ options, value, defaultValue, direction = 'vertical', disabled = false, variant = 'brand', onChange, className = '', style, }) {
|
|
71
|
+
const [internalValue, setInternalValue] = useState(defaultValue);
|
|
72
|
+
const isControlled = value !== undefined;
|
|
73
|
+
const currentValue = isControlled ? value : internalValue;
|
|
74
|
+
const handleChange = (optValue) => {
|
|
75
|
+
if (!isControlled)
|
|
76
|
+
setInternalValue(optValue);
|
|
77
|
+
onChange?.(optValue);
|
|
78
|
+
};
|
|
79
|
+
return (_jsx("div", { role: "radiogroup", className: `vetc-radio-group ${className}`, style: {
|
|
80
|
+
display: 'flex',
|
|
81
|
+
flexDirection: direction === 'vertical' ? 'column' : 'row',
|
|
82
|
+
flexWrap: direction === 'horizontal' ? 'wrap' : undefined,
|
|
83
|
+
gap: direction === 'vertical' ? 'var(--vetc-space-12)' : 'var(--vetc-space-16)',
|
|
84
|
+
fontFamily: 'var(--vetc-font-family)',
|
|
85
|
+
...style,
|
|
86
|
+
}, children: options.map((opt) => (_jsx(Radio, { label: opt.label, description: opt.description, checked: currentValue === opt.value, disabled: opt.disabled ?? disabled, variant: variant, value: opt.value, onChange: () => handleChange(opt.value) }, String(opt.value)))) }));
|
|
87
|
+
}
|
|
88
|
+
export default Radio;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Radio, RadioGroup } from './Radio';
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* VETC Select — tokenized
|
|
3
|
+
*/
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import type { DefaultOptionType } from 'antd/es/select';
|
|
6
|
+
export type SelectOption = DefaultOptionType;
|
|
7
|
+
export interface SelectProps {
|
|
8
|
+
label?: string;
|
|
9
|
+
placeholder?: string;
|
|
10
|
+
value?: string | string[] | number | number[];
|
|
11
|
+
defaultValue?: string | string[] | number | number[];
|
|
12
|
+
options?: SelectOption[];
|
|
13
|
+
helperText?: string;
|
|
14
|
+
error?: string;
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
multiple?: boolean;
|
|
17
|
+
searchable?: boolean;
|
|
18
|
+
allowClear?: boolean;
|
|
19
|
+
loading?: boolean;
|
|
20
|
+
onChange?: (value: any, option: any) => void;
|
|
21
|
+
onSearch?: (value: string) => void;
|
|
22
|
+
id?: string;
|
|
23
|
+
className?: string;
|
|
24
|
+
style?: React.CSSProperties;
|
|
25
|
+
required?: boolean;
|
|
26
|
+
popupMatchSelectWidth?: boolean;
|
|
27
|
+
}
|
|
28
|
+
export declare function Select({ label, placeholder, value, defaultValue, options, helperText, error, disabled, multiple, searchable, allowClear, loading, onChange, onSearch, id, className, style, required, popupMatchSelectWidth, }: SelectProps): import("react/jsx-runtime").JSX.Element;
|
|
29
|
+
export default Select;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Select as AntSelect } from 'antd';
|
|
3
|
+
export function Select({ label, placeholder, value, defaultValue, options = [], helperText, error, disabled = false, multiple = false, searchable = false, allowClear = false, loading = false, onChange, onSearch, id, className = '', style, required = false, popupMatchSelectWidth = true, }) {
|
|
4
|
+
const hasError = !!error;
|
|
5
|
+
const helperMsg = error ?? helperText;
|
|
6
|
+
const helperColor = hasError
|
|
7
|
+
? 'var(--vetc-input-helper-color-error)'
|
|
8
|
+
: 'var(--vetc-input-helper-color)';
|
|
9
|
+
return (_jsxs("div", { className: `vetc-select-wrapper ${className}`, style: { display: 'flex', flexDirection: 'column', gap: 'var(--vetc-input-gap)', ...style }, children: [label && (_jsxs("label", { htmlFor: id, style: {
|
|
10
|
+
fontFamily: 'var(--vetc-font-family)',
|
|
11
|
+
fontSize: 'var(--vetc-input-label-font-size)',
|
|
12
|
+
fontWeight: 'var(--vetc-input-label-font-weight)',
|
|
13
|
+
lineHeight: 'var(--vetc-line-height-relaxed)',
|
|
14
|
+
color: disabled
|
|
15
|
+
? 'var(--vetc-color-text-disabled)'
|
|
16
|
+
: 'var(--vetc-input-label-color)',
|
|
17
|
+
display: 'block',
|
|
18
|
+
}, children: [label, required && (_jsx("span", { style: { color: 'var(--vetc-color-negative)', marginLeft: 'var(--vetc-space-2)' }, children: "*" }))] })), _jsx(AntSelect, { id: id, value: value, defaultValue: defaultValue, placeholder: placeholder, options: options, disabled: disabled, mode: multiple ? 'multiple' : undefined, showSearch: searchable, allowClear: allowClear, loading: loading, status: hasError ? 'error' : undefined, onChange: onChange, onSearch: onSearch, popupMatchSelectWidth: popupMatchSelectWidth, style: {
|
|
19
|
+
height: 'var(--vetc-input-height)',
|
|
20
|
+
width: '100%',
|
|
21
|
+
fontFamily: 'var(--vetc-font-family)',
|
|
22
|
+
fontSize: 'var(--vetc-input-font-size)',
|
|
23
|
+
} }), helperMsg && (_jsx("span", { style: {
|
|
24
|
+
fontFamily: 'var(--vetc-font-family)',
|
|
25
|
+
fontSize: 'var(--vetc-input-helper-font-size)',
|
|
26
|
+
lineHeight: 'var(--vetc-line-height-relaxed)',
|
|
27
|
+
color: helperColor,
|
|
28
|
+
}, children: helperMsg }))] }));
|
|
29
|
+
}
|
|
30
|
+
export default Select;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Select } from './Select';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* VETC Switch
|
|
3
|
+
* Figma: w=52px h=32px, thumb=28px, ON=brand-green, OFF=gray-30
|
|
4
|
+
* variant: neutral (gray-90 on) | brand (green-40 on)
|
|
5
|
+
*/
|
|
6
|
+
import React from 'react';
|
|
7
|
+
export type SwitchVariant = 'neutral' | 'brand';
|
|
8
|
+
export interface SwitchProps {
|
|
9
|
+
label?: React.ReactNode;
|
|
10
|
+
description?: React.ReactNode;
|
|
11
|
+
labelPosition?: 'left' | 'right';
|
|
12
|
+
checked?: boolean;
|
|
13
|
+
defaultChecked?: boolean;
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
loading?: boolean;
|
|
16
|
+
variant?: SwitchVariant;
|
|
17
|
+
onChange?: (checked: boolean) => void;
|
|
18
|
+
id?: string;
|
|
19
|
+
className?: string;
|
|
20
|
+
style?: React.CSSProperties;
|
|
21
|
+
}
|
|
22
|
+
export declare function Switch({ label, description, labelPosition, checked, defaultChecked, disabled, loading, variant, onChange, id, className, style, }: SwitchProps): import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
export default Switch;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* VETC Switch
|
|
4
|
+
* Figma: w=52px h=32px, thumb=28px, ON=brand-green, OFF=gray-30
|
|
5
|
+
* variant: neutral (gray-90 on) | brand (green-40 on)
|
|
6
|
+
*/
|
|
7
|
+
import { useState } from 'react';
|
|
8
|
+
export function Switch({ label, description, labelPosition = 'right', checked, defaultChecked = false, disabled = false, loading = false, variant = 'brand', onChange, id, className = '', style, }) {
|
|
9
|
+
const [internalChecked, setInternalChecked] = useState(defaultChecked);
|
|
10
|
+
const isControlled = checked !== undefined;
|
|
11
|
+
const isChecked = isControlled ? checked : internalChecked;
|
|
12
|
+
const isDisabled = disabled || loading;
|
|
13
|
+
const handleToggle = () => {
|
|
14
|
+
if (isDisabled)
|
|
15
|
+
return;
|
|
16
|
+
const next = !isChecked;
|
|
17
|
+
if (!isControlled)
|
|
18
|
+
setInternalChecked(next);
|
|
19
|
+
onChange?.(next);
|
|
20
|
+
};
|
|
21
|
+
const onColor = variant === 'brand'
|
|
22
|
+
? 'var(--vetc-switch-on-bg)'
|
|
23
|
+
: 'var(--vetc-gray-90)';
|
|
24
|
+
const trackBg = isDisabled
|
|
25
|
+
? 'var(--vetc-color-bg-disabled)'
|
|
26
|
+
: isChecked
|
|
27
|
+
? onColor
|
|
28
|
+
: 'var(--vetc-switch-off-bg)';
|
|
29
|
+
const thumbLeft = isChecked ? 'calc(100% - 30px)' : '2px';
|
|
30
|
+
const switchEl = (_jsxs("button", { id: id, type: "button", role: "switch", "aria-checked": isChecked, disabled: isDisabled, onClick: handleToggle, className: `vetc-switch ${className}`, style: {
|
|
31
|
+
position: 'relative',
|
|
32
|
+
display: 'inline-flex',
|
|
33
|
+
alignItems: 'center',
|
|
34
|
+
width: 'var(--vetc-switch-width)',
|
|
35
|
+
height: 'var(--vetc-switch-height)',
|
|
36
|
+
borderRadius: 'var(--vetc-radius-pill)',
|
|
37
|
+
backgroundColor: trackBg,
|
|
38
|
+
border: 'none',
|
|
39
|
+
cursor: isDisabled ? 'not-allowed' : 'pointer',
|
|
40
|
+
padding: 0,
|
|
41
|
+
flexShrink: 0,
|
|
42
|
+
transition: 'background-color var(--vetc-transition-fast)',
|
|
43
|
+
outline: 'none',
|
|
44
|
+
...(label || description ? {} : style),
|
|
45
|
+
}, children: [_jsx("span", { style: {
|
|
46
|
+
position: 'absolute',
|
|
47
|
+
left: thumbLeft,
|
|
48
|
+
width: 'var(--vetc-switch-thumb-size)',
|
|
49
|
+
height: 'var(--vetc-switch-thumb-size)',
|
|
50
|
+
borderRadius: '50%',
|
|
51
|
+
backgroundColor: isDisabled ? 'var(--vetc-gray-20)' : 'var(--vetc-white)',
|
|
52
|
+
boxShadow: '0 1px 4px rgba(0,0,0,0.25)',
|
|
53
|
+
transition: 'left var(--vetc-transition-fast)',
|
|
54
|
+
display: 'flex',
|
|
55
|
+
alignItems: 'center',
|
|
56
|
+
justifyContent: 'center',
|
|
57
|
+
}, children: loading && (_jsxs("svg", { width: "12", height: "12", viewBox: "0 0 12 12", fill: "none", style: { animation: 'vetc-btn-spin 0.6s linear infinite' }, "aria-hidden": "true", children: [_jsx("circle", { cx: "6", cy: "6", r: "4", stroke: "var(--vetc-gray-30)", strokeWidth: "1.5" }), _jsx("path", { d: "M6 2a4 4 0 014 4", stroke: "var(--vetc-color-brand)", strokeWidth: "1.5", strokeLinecap: "round" })] })) }), _jsx("style", { children: `@keyframes vetc-btn-spin { to { transform: rotate(360deg); } }` })] }));
|
|
58
|
+
if (!label && !description)
|
|
59
|
+
return switchEl;
|
|
60
|
+
const labelBlock = (_jsxs("span", { style: { display: 'flex', flexDirection: 'column', gap: 'var(--vetc-space-2)', flex: 1 }, children: [label && (_jsx("span", { style: {
|
|
61
|
+
fontSize: 'var(--vetc-font-size-base)',
|
|
62
|
+
fontWeight: 'var(--vetc-font-weight-regular)',
|
|
63
|
+
lineHeight: 'var(--vetc-line-height-relaxed)',
|
|
64
|
+
color: isDisabled ? 'var(--vetc-color-text-disabled)' : 'var(--vetc-color-text-primary)',
|
|
65
|
+
}, children: label })), description && (_jsx("span", { style: {
|
|
66
|
+
fontSize: 'var(--vetc-font-size-sm)',
|
|
67
|
+
fontWeight: 'var(--vetc-font-weight-regular)',
|
|
68
|
+
lineHeight: 'var(--vetc-line-height-relaxed)',
|
|
69
|
+
color: isDisabled ? 'var(--vetc-color-text-disabled)' : 'var(--vetc-color-text-secondary)',
|
|
70
|
+
}, children: description }))] }));
|
|
71
|
+
return (_jsx("div", { style: {
|
|
72
|
+
display: 'flex',
|
|
73
|
+
alignItems: 'center',
|
|
74
|
+
gap: 'var(--vetc-space-12)',
|
|
75
|
+
flexDirection: labelPosition === 'left' ? 'row-reverse' : 'row',
|
|
76
|
+
fontFamily: 'var(--vetc-font-family)',
|
|
77
|
+
cursor: isDisabled ? 'not-allowed' : 'pointer',
|
|
78
|
+
...style,
|
|
79
|
+
}, onClick: handleToggle, children: labelPosition === 'right' ? (_jsxs(_Fragment, { children: [switchEl, labelBlock] })) : (_jsxs(_Fragment, { children: [labelBlock, switchEl] })) }));
|
|
80
|
+
}
|
|
81
|
+
export default Switch;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Switch } from './Switch';
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* VETC TabBar (Bottom Navigation)
|
|
3
|
+
* Figma: h=56px, label=12px/semibold, icon=24px
|
|
4
|
+
* variant: neutral (gray-90 active) | brand (green-40 active)
|
|
5
|
+
*/
|
|
6
|
+
import React from 'react';
|
|
7
|
+
export interface TabBarItem {
|
|
8
|
+
key: string;
|
|
9
|
+
label: string;
|
|
10
|
+
icon: React.ReactNode;
|
|
11
|
+
activeIcon?: React.ReactNode;
|
|
12
|
+
badge?: number | string;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
}
|
|
15
|
+
export type TabBarVariant = 'neutral' | 'brand';
|
|
16
|
+
export interface TabBarProps {
|
|
17
|
+
items: TabBarItem[];
|
|
18
|
+
activeKey?: string;
|
|
19
|
+
onChange?: (key: string) => void;
|
|
20
|
+
variant?: TabBarVariant;
|
|
21
|
+
backgroundColor?: string;
|
|
22
|
+
divider?: boolean;
|
|
23
|
+
className?: string;
|
|
24
|
+
style?: React.CSSProperties;
|
|
25
|
+
id?: string;
|
|
26
|
+
}
|
|
27
|
+
export declare function TabBar({ items, activeKey, onChange, variant, backgroundColor, divider, className, style, id, }: TabBarProps): import("react/jsx-runtime").JSX.Element;
|
|
28
|
+
export default TabBar;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
export function TabBar({ items, activeKey, onChange, variant = 'brand', backgroundColor, divider = true, className = '', style, id, }) {
|
|
3
|
+
const activeColor = variant === 'brand'
|
|
4
|
+
? 'var(--vetc-tab-color-active)'
|
|
5
|
+
: 'var(--vetc-color-text-primary)';
|
|
6
|
+
return (_jsx("nav", { id: id, className: `vetc-tab-bar ${className}`, style: {
|
|
7
|
+
display: 'flex',
|
|
8
|
+
alignItems: 'stretch',
|
|
9
|
+
height: 'var(--vetc-tab-height)',
|
|
10
|
+
backgroundColor: backgroundColor ?? 'var(--vetc-tab-bg)',
|
|
11
|
+
borderTop: divider ? `1px solid var(--vetc-tab-border)` : 'none',
|
|
12
|
+
fontFamily: 'var(--vetc-font-family)',
|
|
13
|
+
...style,
|
|
14
|
+
}, children: items.map((item) => {
|
|
15
|
+
const isActive = item.key === activeKey;
|
|
16
|
+
const color = item.disabled
|
|
17
|
+
? 'var(--vetc-tab-color-disabled)'
|
|
18
|
+
: isActive
|
|
19
|
+
? activeColor
|
|
20
|
+
: 'var(--vetc-tab-color-inactive)';
|
|
21
|
+
return (_jsxs("button", { disabled: item.disabled, onClick: () => !item.disabled && onChange?.(item.key), "aria-current": isActive ? 'page' : undefined, "aria-label": item.label, className: `vetc-tab-bar__item${isActive ? ' vetc-tab-bar__item--active' : ''}`, style: {
|
|
22
|
+
flex: 1,
|
|
23
|
+
display: 'flex',
|
|
24
|
+
flexDirection: 'column',
|
|
25
|
+
alignItems: 'center',
|
|
26
|
+
justifyContent: 'center',
|
|
27
|
+
gap: 'var(--vetc-space-2)',
|
|
28
|
+
background: 'none',
|
|
29
|
+
border: 'none',
|
|
30
|
+
cursor: item.disabled ? 'not-allowed' : 'pointer',
|
|
31
|
+
padding: `var(--vetc-space-6) 0`,
|
|
32
|
+
position: 'relative',
|
|
33
|
+
opacity: item.disabled ? 0.5 : 1,
|
|
34
|
+
transition: `color var(--vetc-transition-fast)`,
|
|
35
|
+
color,
|
|
36
|
+
}, children: [_jsxs("div", { style: { position: 'relative', display: 'inline-flex' }, children: [_jsx("span", { style: { color, display: 'flex', fontSize: '24px', lineHeight: 1 }, children: isActive && item.activeIcon ? item.activeIcon : item.icon }), item.badge !== undefined && (_jsx("span", { style: {
|
|
37
|
+
position: 'absolute',
|
|
38
|
+
top: 'calc(-1 * var(--vetc-space-4))',
|
|
39
|
+
right: 'calc(-1 * var(--vetc-space-8))',
|
|
40
|
+
minWidth: 'var(--vetc-tab-badge-size)',
|
|
41
|
+
height: 'var(--vetc-tab-badge-size)',
|
|
42
|
+
backgroundColor: 'var(--vetc-tab-badge-bg)',
|
|
43
|
+
borderRadius: 'var(--vetc-radius-pill)',
|
|
44
|
+
fontSize: 'var(--vetc-tab-badge-font-size)',
|
|
45
|
+
fontWeight: 'var(--vetc-font-weight-semibold)',
|
|
46
|
+
color: 'var(--vetc-tab-badge-text)',
|
|
47
|
+
display: 'flex',
|
|
48
|
+
alignItems: 'center',
|
|
49
|
+
justifyContent: 'center',
|
|
50
|
+
padding: `0 var(--vetc-space-4)`,
|
|
51
|
+
lineHeight: 1,
|
|
52
|
+
}, children: item.badge }))] }), _jsx("span", { style: {
|
|
53
|
+
fontSize: 'var(--vetc-tab-label-size)',
|
|
54
|
+
fontWeight: 'var(--vetc-tab-label-weight)',
|
|
55
|
+
color,
|
|
56
|
+
lineHeight: 'var(--vetc-line-height-relaxed)',
|
|
57
|
+
}, children: item.label })] }, item.key));
|
|
58
|
+
}) }));
|
|
59
|
+
}
|
|
60
|
+
export default TabBar;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { TabBar } from './TabBar';
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* VETC Textarea — tokenized
|
|
3
|
+
*/
|
|
4
|
+
import React from 'react';
|
|
5
|
+
export interface TextareaProps {
|
|
6
|
+
label?: string;
|
|
7
|
+
placeholder?: string;
|
|
8
|
+
value?: string;
|
|
9
|
+
defaultValue?: string;
|
|
10
|
+
helperText?: string;
|
|
11
|
+
error?: string;
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
readOnly?: boolean;
|
|
14
|
+
maxLength?: number;
|
|
15
|
+
showCount?: boolean;
|
|
16
|
+
rows?: number;
|
|
17
|
+
autoSize?: boolean | {
|
|
18
|
+
minRows?: number;
|
|
19
|
+
maxRows?: number;
|
|
20
|
+
};
|
|
21
|
+
onChange?: (value: string) => void;
|
|
22
|
+
onFocus?: React.FocusEventHandler<HTMLTextAreaElement>;
|
|
23
|
+
onBlur?: React.FocusEventHandler<HTMLTextAreaElement>;
|
|
24
|
+
id?: string;
|
|
25
|
+
name?: string;
|
|
26
|
+
className?: string;
|
|
27
|
+
style?: React.CSSProperties;
|
|
28
|
+
required?: boolean;
|
|
29
|
+
}
|
|
30
|
+
export declare function Textarea({ label, placeholder, value, defaultValue, helperText, error, disabled, readOnly, maxLength, showCount, rows, autoSize, onChange, onFocus, onBlur, id, name, className, style, required, }: TextareaProps): import("react/jsx-runtime").JSX.Element;
|
|
31
|
+
export default Textarea;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Input as AntInput } from 'antd';
|
|
3
|
+
const { TextArea: AntTextArea } = AntInput;
|
|
4
|
+
function FieldLabel({ htmlFor, required, disabled, children }) {
|
|
5
|
+
return (_jsxs("label", { htmlFor: htmlFor, style: {
|
|
6
|
+
fontFamily: 'var(--vetc-font-family)',
|
|
7
|
+
fontSize: 'var(--vetc-input-label-font-size)',
|
|
8
|
+
fontWeight: 'var(--vetc-input-label-font-weight)',
|
|
9
|
+
lineHeight: 'var(--vetc-line-height-relaxed)',
|
|
10
|
+
color: disabled ? 'var(--vetc-color-text-disabled)' : 'var(--vetc-input-label-color)',
|
|
11
|
+
display: 'block',
|
|
12
|
+
}, children: [children, required && _jsx("span", { style: { color: 'var(--vetc-color-negative)', marginLeft: 'var(--vetc-space-2)' }, children: "*" })] }));
|
|
13
|
+
}
|
|
14
|
+
export function Textarea({ label, placeholder, value, defaultValue, helperText, error, disabled = false, readOnly = false, maxLength, showCount = false, rows = 4, autoSize, onChange, onFocus, onBlur, id, name, className = '', style, required = false, }) {
|
|
15
|
+
const hasError = !!error;
|
|
16
|
+
const helperMsg = error ?? helperText;
|
|
17
|
+
const helperColor = hasError
|
|
18
|
+
? 'var(--vetc-input-helper-color-error)'
|
|
19
|
+
: 'var(--vetc-input-helper-color)';
|
|
20
|
+
return (_jsxs("div", { className: `vetc-textarea-wrapper ${className}`, style: { display: 'flex', flexDirection: 'column', gap: 'var(--vetc-input-gap)', ...style }, children: [label && _jsx(FieldLabel, { htmlFor: id, required: required, disabled: disabled, children: label }), _jsx(AntTextArea, { id: id, name: name, value: value, defaultValue: defaultValue, placeholder: placeholder, disabled: disabled, readOnly: readOnly, maxLength: maxLength, showCount: showCount, rows: rows, autoSize: autoSize, status: hasError ? 'error' : undefined, onChange: (e) => onChange?.(e.target.value), onFocus: onFocus, onBlur: onBlur, style: {
|
|
21
|
+
borderRadius: 'var(--vetc-input-radius)',
|
|
22
|
+
padding: 'var(--vetc-input-padding-x)',
|
|
23
|
+
fontSize: 'var(--vetc-input-font-size)',
|
|
24
|
+
fontFamily: 'var(--vetc-font-family)',
|
|
25
|
+
resize: 'vertical',
|
|
26
|
+
} }), helperMsg && (_jsx("span", { style: {
|
|
27
|
+
fontFamily: 'var(--vetc-font-family)',
|
|
28
|
+
fontSize: 'var(--vetc-input-helper-font-size)',
|
|
29
|
+
lineHeight: 'var(--vetc-line-height-relaxed)',
|
|
30
|
+
color: helperColor,
|
|
31
|
+
}, children: helperMsg }))] }));
|
|
32
|
+
}
|
|
33
|
+
export default Textarea;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Textarea } from './Textarea';
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* VETC Toast — tokenized
|
|
3
|
+
* Figma: Toast page (7 variants)
|
|
4
|
+
*/
|
|
5
|
+
import React from 'react';
|
|
6
|
+
export type ToastType = 'default' | 'success' | 'error' | 'warning' | 'info';
|
|
7
|
+
export interface ToastOptions {
|
|
8
|
+
message: string;
|
|
9
|
+
description?: string;
|
|
10
|
+
type?: ToastType;
|
|
11
|
+
placement?: 'top' | 'topLeft' | 'topRight' | 'bottom' | 'bottomLeft' | 'bottomRight';
|
|
12
|
+
/** Duration in seconds (0 = persistent) */
|
|
13
|
+
duration?: number;
|
|
14
|
+
icon?: React.ReactNode;
|
|
15
|
+
onClose?: () => void;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Static programmatic toast API
|
|
19
|
+
* Usage: toast.success('Message')
|
|
20
|
+
*/
|
|
21
|
+
export declare const toast: {
|
|
22
|
+
show(opts: ToastOptions): void;
|
|
23
|
+
success: (msg: string, description?: string) => void;
|
|
24
|
+
error: (msg: string, description?: string) => void;
|
|
25
|
+
warning: (msg: string, description?: string) => void;
|
|
26
|
+
info: (msg: string, description?: string) => void;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Hook-based toast — requires VETCProvider (antd App wrapper)
|
|
30
|
+
*/
|
|
31
|
+
export declare function useToast(): {
|
|
32
|
+
contextHolder: React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
|
|
33
|
+
toast: {
|
|
34
|
+
show: (opts: ToastOptions) => void;
|
|
35
|
+
success: (msg: string, description?: string) => void;
|
|
36
|
+
error: (msg: string, description?: string) => void;
|
|
37
|
+
warning: (msg: string, description?: string) => void;
|
|
38
|
+
info: (msg: string, description?: string) => void;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
export default toast;
|