@refinn/core-ui 0.1.13 → 0.1.15
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 +942 -743
- package/dist/index.d.mts +50 -21
- package/dist/index.d.ts +50 -21
- package/dist/index.js +950 -745
- package/dist/theme.css +5 -5
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -18,12 +18,20 @@ declare const Accordion: react.ForwardRefExoticComponent<AccordionProps & react.
|
|
|
18
18
|
|
|
19
19
|
type AlertVariant$1 = 'none' | 'info' | 'danger' | 'warning' | 'success';
|
|
20
20
|
type AlertMode$1 = 'page' | 'section' | 'inline';
|
|
21
|
+
interface AlertBannerAction {
|
|
22
|
+
label: string;
|
|
23
|
+
href?: string;
|
|
24
|
+
onClick?: () => void;
|
|
25
|
+
}
|
|
21
26
|
interface AlertBannerProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {
|
|
22
27
|
variant?: AlertVariant$1;
|
|
23
28
|
mode?: AlertMode$1;
|
|
24
29
|
title?: ReactNode;
|
|
25
30
|
description?: ReactNode;
|
|
26
|
-
|
|
31
|
+
/** Renders as a button (page mode) or an icon link (section/inline mode) on its own row below the content. */
|
|
32
|
+
buttonAction?: AlertBannerAction;
|
|
33
|
+
/** Renders as an underlined link inline with the content, next to the close button. */
|
|
34
|
+
buttonLink?: AlertBannerAction;
|
|
27
35
|
icon?: ReactNode;
|
|
28
36
|
onClose?: () => void;
|
|
29
37
|
}
|
|
@@ -97,6 +105,41 @@ interface ChipProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
97
105
|
}
|
|
98
106
|
declare const Chip: react.ForwardRefExoticComponent<ChipProps & react.RefAttributes<HTMLDivElement>>;
|
|
99
107
|
|
|
108
|
+
type TextFieldSize = "md" | "lg";
|
|
109
|
+
interface TextFieldProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "size" | "prefix"> {
|
|
110
|
+
size?: TextFieldSize;
|
|
111
|
+
error?: string;
|
|
112
|
+
label?: string;
|
|
113
|
+
placeholder?: string;
|
|
114
|
+
helperText?: string;
|
|
115
|
+
prefix?: ReactNode;
|
|
116
|
+
suffix?: ReactNode;
|
|
117
|
+
optional?: boolean;
|
|
118
|
+
success?: boolean;
|
|
119
|
+
pending?: boolean;
|
|
120
|
+
clearable?: boolean;
|
|
121
|
+
disabled?: boolean;
|
|
122
|
+
value?: string;
|
|
123
|
+
onChange?: (event: react__default.ChangeEvent<HTMLInputElement>) => void;
|
|
124
|
+
}
|
|
125
|
+
declare const TextField: react__default.ForwardRefExoticComponent<TextFieldProps & react__default.RefAttributes<HTMLInputElement>>;
|
|
126
|
+
|
|
127
|
+
interface CurrencyFieldProps extends Omit<TextFieldProps, "value" | "onChange" | "prefix" | "type" | "inputMode"> {
|
|
128
|
+
value?: number;
|
|
129
|
+
onChange?: (value: number | undefined) => void;
|
|
130
|
+
/** จำนวนเงินขั้นต่ำที่ยอมรับได้ — ถ้าไม่กำหนดจะไม่มีการตรวจสอบขั้นต่ำ */
|
|
131
|
+
min?: number;
|
|
132
|
+
/** ข้อความ error ที่แสดงเมื่อค่าต่ำกว่า min (ค่าเริ่มต้นจะสร้างให้อัตโนมัติ) */
|
|
133
|
+
minErrorText?: string;
|
|
134
|
+
/** จำนวนเงินสูงสุดที่ยอมรับได้ — ถ้าไม่กำหนดจะไม่มีการตรวจสอบสูงสุด */
|
|
135
|
+
max?: number;
|
|
136
|
+
/** ข้อความ error ที่แสดงเมื่อค่าเกิน max (ค่าเริ่มต้นจะสร้างให้อัตโนมัติ) */
|
|
137
|
+
maxErrorText?: string;
|
|
138
|
+
/** สัญลักษณ์สกุลเงินที่แสดงหน้าช่องกรอก (ค่าเริ่มต้นคือ ฿) */
|
|
139
|
+
currencyIcon?: ReactNode;
|
|
140
|
+
}
|
|
141
|
+
declare const CurrencyField: react__default.ForwardRefExoticComponent<CurrencyFieldProps & react__default.RefAttributes<HTMLInputElement>>;
|
|
142
|
+
|
|
100
143
|
type DialogDisplay = 'centered' | 'slide-up' | 'full';
|
|
101
144
|
type DialogActionProps = Omit<ButtonProps, 'variant' | 'children'> & {
|
|
102
145
|
label: ReactNode;
|
|
@@ -185,9 +228,14 @@ interface IconProps extends Omit<HTMLAttributes<HTMLSpanElement>, 'children'> {
|
|
|
185
228
|
declare const Icon: react.ForwardRefExoticComponent<IconProps & react.RefAttributes<HTMLSpanElement>>;
|
|
186
229
|
|
|
187
230
|
type IconButtonSize = 'xs' | 's' | 'm' | 'l';
|
|
231
|
+
type IconButtonSurface = 'default' | 'dark' | 'light';
|
|
188
232
|
interface IconButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'children'> {
|
|
189
233
|
icon: ReactNode;
|
|
190
234
|
size?: IconButtonSize;
|
|
235
|
+
/** Which background the button sits on — picks the enabled/hover/active tint. */
|
|
236
|
+
surface?: IconButtonSurface;
|
|
237
|
+
/** Enabled state has no fill; hover/active/focus/disabled/danger are unaffected. */
|
|
238
|
+
transparent?: boolean;
|
|
191
239
|
danger?: boolean;
|
|
192
240
|
'aria-label': string;
|
|
193
241
|
}
|
|
@@ -279,25 +327,6 @@ interface TextAreaProps extends Omit<TextareaHTMLAttributes<HTMLTextAreaElement>
|
|
|
279
327
|
}
|
|
280
328
|
declare const TextArea: react__default.ForwardRefExoticComponent<TextAreaProps & react__default.RefAttributes<HTMLTextAreaElement>>;
|
|
281
329
|
|
|
282
|
-
type TextFieldSize = "md" | "lg";
|
|
283
|
-
interface TextFieldProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "size" | "prefix"> {
|
|
284
|
-
size?: TextFieldSize;
|
|
285
|
-
error?: string;
|
|
286
|
-
label?: string;
|
|
287
|
-
placeholder?: string;
|
|
288
|
-
helperText?: string;
|
|
289
|
-
prefix?: ReactNode;
|
|
290
|
-
suffix?: ReactNode;
|
|
291
|
-
optional?: boolean;
|
|
292
|
-
success?: boolean;
|
|
293
|
-
pending?: boolean;
|
|
294
|
-
clearable?: boolean;
|
|
295
|
-
disabled?: boolean;
|
|
296
|
-
value?: string;
|
|
297
|
-
onChange?: (event: react__default.ChangeEvent<HTMLInputElement>) => void;
|
|
298
|
-
}
|
|
299
|
-
declare const TextField: react__default.ForwardRefExoticComponent<TextFieldProps & react__default.RefAttributes<HTMLInputElement>>;
|
|
300
|
-
|
|
301
330
|
type ToastType = 'default' | 'progress' | 'error';
|
|
302
331
|
interface ToastProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {
|
|
303
332
|
type?: ToastType;
|
|
@@ -327,4 +356,4 @@ interface TooltipProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
327
356
|
}
|
|
328
357
|
declare const Tooltip: react__default.ForwardRefExoticComponent<TooltipProps & react__default.RefAttributes<HTMLDivElement>>;
|
|
329
358
|
|
|
330
|
-
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 };
|
|
359
|
+
export { Accordion, type AccordionItemData, type AccordionProps, AlertBanner, type AlertBannerAction, type AlertBannerProps, Avatar, type AvatarProps, Badge, type BadgeProps, Branding, type BrandingProps, Button, type ButtonProps, Checkbox, type CheckboxProps, Chip, type ChipProps, CurrencyField, type CurrencyFieldProps, 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
|
@@ -18,12 +18,20 @@ declare const Accordion: react.ForwardRefExoticComponent<AccordionProps & react.
|
|
|
18
18
|
|
|
19
19
|
type AlertVariant$1 = 'none' | 'info' | 'danger' | 'warning' | 'success';
|
|
20
20
|
type AlertMode$1 = 'page' | 'section' | 'inline';
|
|
21
|
+
interface AlertBannerAction {
|
|
22
|
+
label: string;
|
|
23
|
+
href?: string;
|
|
24
|
+
onClick?: () => void;
|
|
25
|
+
}
|
|
21
26
|
interface AlertBannerProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {
|
|
22
27
|
variant?: AlertVariant$1;
|
|
23
28
|
mode?: AlertMode$1;
|
|
24
29
|
title?: ReactNode;
|
|
25
30
|
description?: ReactNode;
|
|
26
|
-
|
|
31
|
+
/** Renders as a button (page mode) or an icon link (section/inline mode) on its own row below the content. */
|
|
32
|
+
buttonAction?: AlertBannerAction;
|
|
33
|
+
/** Renders as an underlined link inline with the content, next to the close button. */
|
|
34
|
+
buttonLink?: AlertBannerAction;
|
|
27
35
|
icon?: ReactNode;
|
|
28
36
|
onClose?: () => void;
|
|
29
37
|
}
|
|
@@ -97,6 +105,41 @@ interface ChipProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
97
105
|
}
|
|
98
106
|
declare const Chip: react.ForwardRefExoticComponent<ChipProps & react.RefAttributes<HTMLDivElement>>;
|
|
99
107
|
|
|
108
|
+
type TextFieldSize = "md" | "lg";
|
|
109
|
+
interface TextFieldProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "size" | "prefix"> {
|
|
110
|
+
size?: TextFieldSize;
|
|
111
|
+
error?: string;
|
|
112
|
+
label?: string;
|
|
113
|
+
placeholder?: string;
|
|
114
|
+
helperText?: string;
|
|
115
|
+
prefix?: ReactNode;
|
|
116
|
+
suffix?: ReactNode;
|
|
117
|
+
optional?: boolean;
|
|
118
|
+
success?: boolean;
|
|
119
|
+
pending?: boolean;
|
|
120
|
+
clearable?: boolean;
|
|
121
|
+
disabled?: boolean;
|
|
122
|
+
value?: string;
|
|
123
|
+
onChange?: (event: react__default.ChangeEvent<HTMLInputElement>) => void;
|
|
124
|
+
}
|
|
125
|
+
declare const TextField: react__default.ForwardRefExoticComponent<TextFieldProps & react__default.RefAttributes<HTMLInputElement>>;
|
|
126
|
+
|
|
127
|
+
interface CurrencyFieldProps extends Omit<TextFieldProps, "value" | "onChange" | "prefix" | "type" | "inputMode"> {
|
|
128
|
+
value?: number;
|
|
129
|
+
onChange?: (value: number | undefined) => void;
|
|
130
|
+
/** จำนวนเงินขั้นต่ำที่ยอมรับได้ — ถ้าไม่กำหนดจะไม่มีการตรวจสอบขั้นต่ำ */
|
|
131
|
+
min?: number;
|
|
132
|
+
/** ข้อความ error ที่แสดงเมื่อค่าต่ำกว่า min (ค่าเริ่มต้นจะสร้างให้อัตโนมัติ) */
|
|
133
|
+
minErrorText?: string;
|
|
134
|
+
/** จำนวนเงินสูงสุดที่ยอมรับได้ — ถ้าไม่กำหนดจะไม่มีการตรวจสอบสูงสุด */
|
|
135
|
+
max?: number;
|
|
136
|
+
/** ข้อความ error ที่แสดงเมื่อค่าเกิน max (ค่าเริ่มต้นจะสร้างให้อัตโนมัติ) */
|
|
137
|
+
maxErrorText?: string;
|
|
138
|
+
/** สัญลักษณ์สกุลเงินที่แสดงหน้าช่องกรอก (ค่าเริ่มต้นคือ ฿) */
|
|
139
|
+
currencyIcon?: ReactNode;
|
|
140
|
+
}
|
|
141
|
+
declare const CurrencyField: react__default.ForwardRefExoticComponent<CurrencyFieldProps & react__default.RefAttributes<HTMLInputElement>>;
|
|
142
|
+
|
|
100
143
|
type DialogDisplay = 'centered' | 'slide-up' | 'full';
|
|
101
144
|
type DialogActionProps = Omit<ButtonProps, 'variant' | 'children'> & {
|
|
102
145
|
label: ReactNode;
|
|
@@ -185,9 +228,14 @@ interface IconProps extends Omit<HTMLAttributes<HTMLSpanElement>, 'children'> {
|
|
|
185
228
|
declare const Icon: react.ForwardRefExoticComponent<IconProps & react.RefAttributes<HTMLSpanElement>>;
|
|
186
229
|
|
|
187
230
|
type IconButtonSize = 'xs' | 's' | 'm' | 'l';
|
|
231
|
+
type IconButtonSurface = 'default' | 'dark' | 'light';
|
|
188
232
|
interface IconButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'children'> {
|
|
189
233
|
icon: ReactNode;
|
|
190
234
|
size?: IconButtonSize;
|
|
235
|
+
/** Which background the button sits on — picks the enabled/hover/active tint. */
|
|
236
|
+
surface?: IconButtonSurface;
|
|
237
|
+
/** Enabled state has no fill; hover/active/focus/disabled/danger are unaffected. */
|
|
238
|
+
transparent?: boolean;
|
|
191
239
|
danger?: boolean;
|
|
192
240
|
'aria-label': string;
|
|
193
241
|
}
|
|
@@ -279,25 +327,6 @@ interface TextAreaProps extends Omit<TextareaHTMLAttributes<HTMLTextAreaElement>
|
|
|
279
327
|
}
|
|
280
328
|
declare const TextArea: react__default.ForwardRefExoticComponent<TextAreaProps & react__default.RefAttributes<HTMLTextAreaElement>>;
|
|
281
329
|
|
|
282
|
-
type TextFieldSize = "md" | "lg";
|
|
283
|
-
interface TextFieldProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "size" | "prefix"> {
|
|
284
|
-
size?: TextFieldSize;
|
|
285
|
-
error?: string;
|
|
286
|
-
label?: string;
|
|
287
|
-
placeholder?: string;
|
|
288
|
-
helperText?: string;
|
|
289
|
-
prefix?: ReactNode;
|
|
290
|
-
suffix?: ReactNode;
|
|
291
|
-
optional?: boolean;
|
|
292
|
-
success?: boolean;
|
|
293
|
-
pending?: boolean;
|
|
294
|
-
clearable?: boolean;
|
|
295
|
-
disabled?: boolean;
|
|
296
|
-
value?: string;
|
|
297
|
-
onChange?: (event: react__default.ChangeEvent<HTMLInputElement>) => void;
|
|
298
|
-
}
|
|
299
|
-
declare const TextField: react__default.ForwardRefExoticComponent<TextFieldProps & react__default.RefAttributes<HTMLInputElement>>;
|
|
300
|
-
|
|
301
330
|
type ToastType = 'default' | 'progress' | 'error';
|
|
302
331
|
interface ToastProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {
|
|
303
332
|
type?: ToastType;
|
|
@@ -327,4 +356,4 @@ interface TooltipProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
327
356
|
}
|
|
328
357
|
declare const Tooltip: react__default.ForwardRefExoticComponent<TooltipProps & react__default.RefAttributes<HTMLDivElement>>;
|
|
329
358
|
|
|
330
|
-
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 };
|
|
359
|
+
export { Accordion, type AccordionItemData, type AccordionProps, AlertBanner, type AlertBannerAction, type AlertBannerProps, Avatar, type AvatarProps, Badge, type BadgeProps, Branding, type BrandingProps, Button, type ButtonProps, Checkbox, type CheckboxProps, Chip, type ChipProps, CurrencyField, type CurrencyFieldProps, 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 };
|