@refinn/core-ui 0.1.8 → 0.1.10
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/index.cjs +1041 -735
- package/dist/index.d.mts +69 -58
- package/dist/index.d.ts +69 -58
- package/dist/index.js +1030 -709
- package/dist/theme.css +11 -11
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import react__default, { HTMLAttributes, ReactNode, ButtonHTMLAttributes,
|
|
2
|
+
import react__default, { HTMLAttributes, ReactNode, ButtonHTMLAttributes, InputHTMLAttributes, TextareaHTMLAttributes } from 'react';
|
|
3
3
|
|
|
4
4
|
interface AccordionItemData {
|
|
5
5
|
id?: string;
|
|
@@ -72,25 +72,6 @@ interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
|
72
72
|
}
|
|
73
73
|
declare const Button: react.ForwardRefExoticComponent<ButtonProps & react.RefAttributes<HTMLButtonElement>>;
|
|
74
74
|
|
|
75
|
-
type BottomSheetSize = 'sm' | 'md' | 'lg';
|
|
76
|
-
interface BottomSheetProps extends HTMLAttributes<HTMLSpanElement> {
|
|
77
|
-
isForceOpen?: boolean;
|
|
78
|
-
setIsForceOpen?: (val: boolean) => void;
|
|
79
|
-
isClosedAble?: boolean;
|
|
80
|
-
children: ReactNode;
|
|
81
|
-
startModalBtn?: ReactElement<{
|
|
82
|
-
onClick?: (e: react__default.MouseEvent) => void;
|
|
83
|
-
}>;
|
|
84
|
-
stopModalBtn?: ReactElement<{
|
|
85
|
-
onClick?: (e: react__default.MouseEvent) => void;
|
|
86
|
-
}>;
|
|
87
|
-
afterStopBtn?: ReactElement<() => void>;
|
|
88
|
-
size?: BottomSheetSize;
|
|
89
|
-
modalTitle: string;
|
|
90
|
-
modalDesc: string;
|
|
91
|
-
}
|
|
92
|
-
declare const BottomSheet: react__default.ForwardRefExoticComponent<BottomSheetProps & react__default.RefAttributes<HTMLSpanElement>>;
|
|
93
|
-
|
|
94
75
|
interface CheckboxProps extends InputHTMLAttributes<HTMLInputElement> {
|
|
95
76
|
label?: ReactNode;
|
|
96
77
|
description?: ReactNode;
|
|
@@ -114,37 +95,58 @@ interface ChipProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
114
95
|
}
|
|
115
96
|
declare const Chip: react.ForwardRefExoticComponent<ChipProps & react.RefAttributes<HTMLDivElement>>;
|
|
116
97
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
98
|
+
type DialogDisplay = 'centered' | 'slide-up' | 'full';
|
|
99
|
+
type DialogActionProps = Omit<ButtonProps, 'variant' | 'children'> & {
|
|
100
|
+
label: ReactNode;
|
|
101
|
+
};
|
|
102
|
+
interface DialogProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {
|
|
103
|
+
open: boolean;
|
|
104
|
+
onOpenChange?: (open: boolean) => void;
|
|
105
|
+
display?: DialogDisplay;
|
|
106
|
+
artwork?: ReactNode;
|
|
107
|
+
title?: ReactNode;
|
|
108
|
+
subtitle?: ReactNode;
|
|
109
|
+
warning?: boolean;
|
|
110
|
+
closable?: boolean;
|
|
111
|
+
backdrop?: boolean;
|
|
112
|
+
children?: ReactNode;
|
|
113
|
+
dismiss?: DialogActionProps;
|
|
114
|
+
secondary?: DialogActionProps;
|
|
115
|
+
confirm?: DialogActionProps;
|
|
116
|
+
}
|
|
117
|
+
declare const Dialog: react.ForwardRefExoticComponent<DialogProps & react.RefAttributes<HTMLDivElement>>;
|
|
118
|
+
|
|
119
|
+
type DrawerActionProps = DialogActionProps;
|
|
120
|
+
interface DrawerProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {
|
|
121
|
+
open: boolean;
|
|
122
|
+
onOpenChange?: (open: boolean) => void;
|
|
123
|
+
title?: ReactNode;
|
|
124
|
+
subtitle?: ReactNode;
|
|
125
|
+
closable?: boolean;
|
|
126
|
+
backdrop?: boolean;
|
|
127
|
+
children?: ReactNode;
|
|
128
|
+
dismiss?: DrawerActionProps;
|
|
129
|
+
secondary?: DrawerActionProps;
|
|
130
|
+
confirm?: DrawerActionProps;
|
|
132
131
|
}
|
|
133
|
-
declare const
|
|
132
|
+
declare const Drawer: react.ForwardRefExoticComponent<DrawerProps & react.RefAttributes<HTMLDivElement>>;
|
|
134
133
|
|
|
135
134
|
type DropdownSize = "md" | "lg";
|
|
135
|
+
type DropdownVariant = "default" | "combobox";
|
|
136
136
|
interface DropdownItemsInterface {
|
|
137
137
|
label: string;
|
|
138
138
|
value: string;
|
|
139
139
|
}
|
|
140
140
|
interface DropdownProps extends HTMLAttributes<HTMLDivElement> {
|
|
141
141
|
size?: DropdownSize;
|
|
142
|
+
/** "default" = เลือกจากรายการอย่างเดียว, "combobox" = พิมพ์ค้นหาในช่องได้ */
|
|
143
|
+
variant?: DropdownVariant;
|
|
142
144
|
error?: string;
|
|
143
145
|
label?: string;
|
|
144
146
|
placeholder?: string;
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
147
|
+
helperText?: string;
|
|
148
|
+
disabled?: boolean;
|
|
149
|
+
textCenter?: boolean;
|
|
148
150
|
value: DropdownItemsInterface;
|
|
149
151
|
setValue: (value: DropdownItemsInterface) => void;
|
|
150
152
|
dropDownItems?: DropdownItemsInterface[];
|
|
@@ -177,6 +179,15 @@ interface IconProps extends Omit<HTMLAttributes<HTMLSpanElement>, 'children'> {
|
|
|
177
179
|
}
|
|
178
180
|
declare const Icon: react.ForwardRefExoticComponent<IconProps & react.RefAttributes<HTMLSpanElement>>;
|
|
179
181
|
|
|
182
|
+
type IconButtonSize = 'xs' | 's' | 'm' | 'l';
|
|
183
|
+
interface IconButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'children'> {
|
|
184
|
+
icon: ReactNode;
|
|
185
|
+
size?: IconButtonSize;
|
|
186
|
+
danger?: boolean;
|
|
187
|
+
'aria-label': string;
|
|
188
|
+
}
|
|
189
|
+
declare const IconButton: react.ForwardRefExoticComponent<IconButtonProps & react.RefAttributes<HTMLButtonElement>>;
|
|
190
|
+
|
|
180
191
|
type LinkVariant = 'xs' | 'sm' | 'md' | 'lg';
|
|
181
192
|
type LinkStyle = 'brand' | 'white' | 'black' | 'brandLooped' | 'whiteLooped' | 'blackLooped';
|
|
182
193
|
interface LinkProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {
|
|
@@ -245,37 +256,37 @@ interface TabProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
245
256
|
}
|
|
246
257
|
declare const Tab: react.ForwardRefExoticComponent<TabProps & react.RefAttributes<HTMLDivElement>>;
|
|
247
258
|
|
|
248
|
-
interface TextAreaProps extends
|
|
249
|
-
maxText?: number;
|
|
250
|
-
height?: number;
|
|
259
|
+
interface TextAreaProps extends Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, "size" | "prefix"> {
|
|
251
260
|
error?: string;
|
|
252
261
|
label?: string;
|
|
253
262
|
placeholder?: string;
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
isClearable?: boolean;
|
|
263
|
+
helperText?: string;
|
|
264
|
+
optional?: boolean;
|
|
265
|
+
success?: boolean;
|
|
266
|
+
pending?: boolean;
|
|
267
|
+
clearable?: boolean;
|
|
260
268
|
disabled?: boolean;
|
|
269
|
+
showCounter?: boolean;
|
|
270
|
+
maxLength?: number;
|
|
271
|
+
height?: number;
|
|
261
272
|
value?: string;
|
|
262
273
|
onChange?: (event: react__default.ChangeEvent<HTMLTextAreaElement>) => void;
|
|
263
274
|
}
|
|
264
275
|
declare const TextArea: react__default.ForwardRefExoticComponent<TextAreaProps & react__default.RefAttributes<HTMLTextAreaElement>>;
|
|
265
276
|
|
|
266
277
|
type TextFieldSize = "md" | "lg";
|
|
267
|
-
interface TextFieldProps extends InputHTMLAttributes<HTMLInputElement> {
|
|
268
|
-
|
|
278
|
+
interface TextFieldProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "size" | "prefix"> {
|
|
279
|
+
size?: TextFieldSize;
|
|
269
280
|
error?: string;
|
|
270
281
|
label?: string;
|
|
271
282
|
placeholder?: string;
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
283
|
+
helperText?: string;
|
|
284
|
+
prefix?: ReactNode;
|
|
285
|
+
suffix?: ReactNode;
|
|
286
|
+
optional?: boolean;
|
|
287
|
+
success?: boolean;
|
|
288
|
+
pending?: boolean;
|
|
289
|
+
clearable?: boolean;
|
|
279
290
|
disabled?: boolean;
|
|
280
291
|
value?: string;
|
|
281
292
|
onChange?: (event: react__default.ChangeEvent<HTMLInputElement>) => void;
|
|
@@ -311,4 +322,4 @@ interface TooltipProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
311
322
|
}
|
|
312
323
|
declare const Tooltip: react__default.ForwardRefExoticComponent<TooltipProps & react__default.RefAttributes<HTMLDivElement>>;
|
|
313
324
|
|
|
314
|
-
export { Accordion, type AccordionItemData, type AccordionProps, AlertBanner, type AlertBannerProps, Avatar, type AvatarProps, Badge, type BadgeProps,
|
|
325
|
+
export { Accordion, type AccordionItemData, type AccordionProps, AlertBanner, type AlertBannerProps, Avatar, type AvatarProps, Badge, type BadgeProps, Branding, type BrandingProps, Button, type ButtonProps, Checkbox, type CheckboxProps, Chip, type ChipProps, Dialog, type DialogActionProps, type DialogDisplay, type DialogProps, Drawer, type DrawerActionProps, type DrawerProps, Dropdown, type DropdownItemsInterface, type DropdownProps, FinancialLogo, type FinancialLogoProps, Icon, IconButton, type IconButtonProps, type IconProps, Link, type LinkProps, Loading, type LoadingProps, Radio, type RadioProps, SegmentControl, type SegmentControlProps, Slider, type SliderProps, Tab, type TabProps, TextArea, type TextAreaProps, TextField, type TextFieldProps, Toast, type ToastProps, ToggleSwitch, type ToggleSwitchProps, Tooltip, type TooltipProps };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import react__default, { HTMLAttributes, ReactNode, ButtonHTMLAttributes,
|
|
2
|
+
import react__default, { HTMLAttributes, ReactNode, ButtonHTMLAttributes, InputHTMLAttributes, TextareaHTMLAttributes } from 'react';
|
|
3
3
|
|
|
4
4
|
interface AccordionItemData {
|
|
5
5
|
id?: string;
|
|
@@ -72,25 +72,6 @@ interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
|
72
72
|
}
|
|
73
73
|
declare const Button: react.ForwardRefExoticComponent<ButtonProps & react.RefAttributes<HTMLButtonElement>>;
|
|
74
74
|
|
|
75
|
-
type BottomSheetSize = 'sm' | 'md' | 'lg';
|
|
76
|
-
interface BottomSheetProps extends HTMLAttributes<HTMLSpanElement> {
|
|
77
|
-
isForceOpen?: boolean;
|
|
78
|
-
setIsForceOpen?: (val: boolean) => void;
|
|
79
|
-
isClosedAble?: boolean;
|
|
80
|
-
children: ReactNode;
|
|
81
|
-
startModalBtn?: ReactElement<{
|
|
82
|
-
onClick?: (e: react__default.MouseEvent) => void;
|
|
83
|
-
}>;
|
|
84
|
-
stopModalBtn?: ReactElement<{
|
|
85
|
-
onClick?: (e: react__default.MouseEvent) => void;
|
|
86
|
-
}>;
|
|
87
|
-
afterStopBtn?: ReactElement<() => void>;
|
|
88
|
-
size?: BottomSheetSize;
|
|
89
|
-
modalTitle: string;
|
|
90
|
-
modalDesc: string;
|
|
91
|
-
}
|
|
92
|
-
declare const BottomSheet: react__default.ForwardRefExoticComponent<BottomSheetProps & react__default.RefAttributes<HTMLSpanElement>>;
|
|
93
|
-
|
|
94
75
|
interface CheckboxProps extends InputHTMLAttributes<HTMLInputElement> {
|
|
95
76
|
label?: ReactNode;
|
|
96
77
|
description?: ReactNode;
|
|
@@ -114,37 +95,58 @@ interface ChipProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
114
95
|
}
|
|
115
96
|
declare const Chip: react.ForwardRefExoticComponent<ChipProps & react.RefAttributes<HTMLDivElement>>;
|
|
116
97
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
98
|
+
type DialogDisplay = 'centered' | 'slide-up' | 'full';
|
|
99
|
+
type DialogActionProps = Omit<ButtonProps, 'variant' | 'children'> & {
|
|
100
|
+
label: ReactNode;
|
|
101
|
+
};
|
|
102
|
+
interface DialogProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {
|
|
103
|
+
open: boolean;
|
|
104
|
+
onOpenChange?: (open: boolean) => void;
|
|
105
|
+
display?: DialogDisplay;
|
|
106
|
+
artwork?: ReactNode;
|
|
107
|
+
title?: ReactNode;
|
|
108
|
+
subtitle?: ReactNode;
|
|
109
|
+
warning?: boolean;
|
|
110
|
+
closable?: boolean;
|
|
111
|
+
backdrop?: boolean;
|
|
112
|
+
children?: ReactNode;
|
|
113
|
+
dismiss?: DialogActionProps;
|
|
114
|
+
secondary?: DialogActionProps;
|
|
115
|
+
confirm?: DialogActionProps;
|
|
116
|
+
}
|
|
117
|
+
declare const Dialog: react.ForwardRefExoticComponent<DialogProps & react.RefAttributes<HTMLDivElement>>;
|
|
118
|
+
|
|
119
|
+
type DrawerActionProps = DialogActionProps;
|
|
120
|
+
interface DrawerProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {
|
|
121
|
+
open: boolean;
|
|
122
|
+
onOpenChange?: (open: boolean) => void;
|
|
123
|
+
title?: ReactNode;
|
|
124
|
+
subtitle?: ReactNode;
|
|
125
|
+
closable?: boolean;
|
|
126
|
+
backdrop?: boolean;
|
|
127
|
+
children?: ReactNode;
|
|
128
|
+
dismiss?: DrawerActionProps;
|
|
129
|
+
secondary?: DrawerActionProps;
|
|
130
|
+
confirm?: DrawerActionProps;
|
|
132
131
|
}
|
|
133
|
-
declare const
|
|
132
|
+
declare const Drawer: react.ForwardRefExoticComponent<DrawerProps & react.RefAttributes<HTMLDivElement>>;
|
|
134
133
|
|
|
135
134
|
type DropdownSize = "md" | "lg";
|
|
135
|
+
type DropdownVariant = "default" | "combobox";
|
|
136
136
|
interface DropdownItemsInterface {
|
|
137
137
|
label: string;
|
|
138
138
|
value: string;
|
|
139
139
|
}
|
|
140
140
|
interface DropdownProps extends HTMLAttributes<HTMLDivElement> {
|
|
141
141
|
size?: DropdownSize;
|
|
142
|
+
/** "default" = เลือกจากรายการอย่างเดียว, "combobox" = พิมพ์ค้นหาในช่องได้ */
|
|
143
|
+
variant?: DropdownVariant;
|
|
142
144
|
error?: string;
|
|
143
145
|
label?: string;
|
|
144
146
|
placeholder?: string;
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
147
|
+
helperText?: string;
|
|
148
|
+
disabled?: boolean;
|
|
149
|
+
textCenter?: boolean;
|
|
148
150
|
value: DropdownItemsInterface;
|
|
149
151
|
setValue: (value: DropdownItemsInterface) => void;
|
|
150
152
|
dropDownItems?: DropdownItemsInterface[];
|
|
@@ -177,6 +179,15 @@ interface IconProps extends Omit<HTMLAttributes<HTMLSpanElement>, 'children'> {
|
|
|
177
179
|
}
|
|
178
180
|
declare const Icon: react.ForwardRefExoticComponent<IconProps & react.RefAttributes<HTMLSpanElement>>;
|
|
179
181
|
|
|
182
|
+
type IconButtonSize = 'xs' | 's' | 'm' | 'l';
|
|
183
|
+
interface IconButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'children'> {
|
|
184
|
+
icon: ReactNode;
|
|
185
|
+
size?: IconButtonSize;
|
|
186
|
+
danger?: boolean;
|
|
187
|
+
'aria-label': string;
|
|
188
|
+
}
|
|
189
|
+
declare const IconButton: react.ForwardRefExoticComponent<IconButtonProps & react.RefAttributes<HTMLButtonElement>>;
|
|
190
|
+
|
|
180
191
|
type LinkVariant = 'xs' | 'sm' | 'md' | 'lg';
|
|
181
192
|
type LinkStyle = 'brand' | 'white' | 'black' | 'brandLooped' | 'whiteLooped' | 'blackLooped';
|
|
182
193
|
interface LinkProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {
|
|
@@ -245,37 +256,37 @@ interface TabProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
245
256
|
}
|
|
246
257
|
declare const Tab: react.ForwardRefExoticComponent<TabProps & react.RefAttributes<HTMLDivElement>>;
|
|
247
258
|
|
|
248
|
-
interface TextAreaProps extends
|
|
249
|
-
maxText?: number;
|
|
250
|
-
height?: number;
|
|
259
|
+
interface TextAreaProps extends Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, "size" | "prefix"> {
|
|
251
260
|
error?: string;
|
|
252
261
|
label?: string;
|
|
253
262
|
placeholder?: string;
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
isClearable?: boolean;
|
|
263
|
+
helperText?: string;
|
|
264
|
+
optional?: boolean;
|
|
265
|
+
success?: boolean;
|
|
266
|
+
pending?: boolean;
|
|
267
|
+
clearable?: boolean;
|
|
260
268
|
disabled?: boolean;
|
|
269
|
+
showCounter?: boolean;
|
|
270
|
+
maxLength?: number;
|
|
271
|
+
height?: number;
|
|
261
272
|
value?: string;
|
|
262
273
|
onChange?: (event: react__default.ChangeEvent<HTMLTextAreaElement>) => void;
|
|
263
274
|
}
|
|
264
275
|
declare const TextArea: react__default.ForwardRefExoticComponent<TextAreaProps & react__default.RefAttributes<HTMLTextAreaElement>>;
|
|
265
276
|
|
|
266
277
|
type TextFieldSize = "md" | "lg";
|
|
267
|
-
interface TextFieldProps extends InputHTMLAttributes<HTMLInputElement> {
|
|
268
|
-
|
|
278
|
+
interface TextFieldProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "size" | "prefix"> {
|
|
279
|
+
size?: TextFieldSize;
|
|
269
280
|
error?: string;
|
|
270
281
|
label?: string;
|
|
271
282
|
placeholder?: string;
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
283
|
+
helperText?: string;
|
|
284
|
+
prefix?: ReactNode;
|
|
285
|
+
suffix?: ReactNode;
|
|
286
|
+
optional?: boolean;
|
|
287
|
+
success?: boolean;
|
|
288
|
+
pending?: boolean;
|
|
289
|
+
clearable?: boolean;
|
|
279
290
|
disabled?: boolean;
|
|
280
291
|
value?: string;
|
|
281
292
|
onChange?: (event: react__default.ChangeEvent<HTMLInputElement>) => void;
|
|
@@ -311,4 +322,4 @@ interface TooltipProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
311
322
|
}
|
|
312
323
|
declare const Tooltip: react__default.ForwardRefExoticComponent<TooltipProps & react__default.RefAttributes<HTMLDivElement>>;
|
|
313
324
|
|
|
314
|
-
export { Accordion, type AccordionItemData, type AccordionProps, AlertBanner, type AlertBannerProps, Avatar, type AvatarProps, Badge, type BadgeProps,
|
|
325
|
+
export { Accordion, type AccordionItemData, type AccordionProps, AlertBanner, type AlertBannerProps, Avatar, type AvatarProps, Badge, type BadgeProps, Branding, type BrandingProps, Button, type ButtonProps, Checkbox, type CheckboxProps, Chip, type ChipProps, Dialog, type DialogActionProps, type DialogDisplay, type DialogProps, Drawer, type DrawerActionProps, type DrawerProps, Dropdown, type DropdownItemsInterface, type DropdownProps, FinancialLogo, type FinancialLogoProps, Icon, IconButton, type IconButtonProps, type IconProps, Link, type LinkProps, Loading, type LoadingProps, Radio, type RadioProps, SegmentControl, type SegmentControlProps, Slider, type SliderProps, Tab, type TabProps, TextArea, type TextAreaProps, TextField, type TextFieldProps, Toast, type ToastProps, ToggleSwitch, type ToggleSwitchProps, Tooltip, type TooltipProps };
|