@refinn/core-ui 0.1.0 → 0.1.1

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.d.mts CHANGED
@@ -1,5 +1,62 @@
1
1
  import * as react from 'react';
2
- import { ButtonHTMLAttributes, ReactNode, InputHTMLAttributes } from 'react';
2
+ import { HTMLAttributes, ReactNode, ButtonHTMLAttributes, InputHTMLAttributes } from 'react';
3
+
4
+ type AccordionSize = 'small' | 'medium' | 'large';
5
+ interface AccordionItemData {
6
+ id?: string;
7
+ title: ReactNode;
8
+ subtitle?: ReactNode;
9
+ content: ReactNode;
10
+ disabled?: boolean;
11
+ defaultOpen?: boolean;
12
+ }
13
+ interface AccordionProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {
14
+ items: AccordionItemData[];
15
+ size?: AccordionSize;
16
+ multiple?: boolean;
17
+ loading?: boolean;
18
+ }
19
+ declare const Accordion: react.ForwardRefExoticComponent<AccordionProps & react.RefAttributes<HTMLDivElement>>;
20
+
21
+ type AlertVariant = 'info' | 'success' | 'warning' | 'danger' | 'common';
22
+ type AlertMode = 'inline' | 'page';
23
+ interface AlertBannerProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {
24
+ variant?: AlertVariant;
25
+ mode?: AlertMode;
26
+ title?: ReactNode;
27
+ description?: ReactNode;
28
+ icon?: ReactNode;
29
+ onClose?: () => void;
30
+ }
31
+ declare const AlertBanner: react.ForwardRefExoticComponent<AlertBannerProps & react.RefAttributes<HTMLDivElement>>;
32
+
33
+ type AvatarSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';
34
+ type AvatarShape = 'circle' | 'square';
35
+ type AvatarStatus = 'online' | 'offline' | 'busy';
36
+ interface AvatarProps extends HTMLAttributes<HTMLDivElement> {
37
+ size?: AvatarSize;
38
+ shape?: AvatarShape;
39
+ src?: string;
40
+ alt?: string;
41
+ name?: string;
42
+ icon?: ReactNode;
43
+ status?: AvatarStatus;
44
+ }
45
+ declare const Avatar: react.ForwardRefExoticComponent<AvatarProps & react.RefAttributes<HTMLDivElement>>;
46
+
47
+ type BadgeStatus = 'common' | 'success' | 'warning' | 'info' | 'brand' | 'danger';
48
+ type BadgeStyle = 'minimal' | 'subtle' | 'bold';
49
+ type BadgeSize = 'sm' | 'md' | 'lg';
50
+ type BadgeShape = 'square' | 'round';
51
+ interface BadgeProps extends HTMLAttributes<HTMLSpanElement> {
52
+ status?: BadgeStatus;
53
+ badgeStyle?: BadgeStyle;
54
+ size?: BadgeSize;
55
+ shape?: BadgeShape;
56
+ icon?: ReactNode;
57
+ dot?: boolean;
58
+ }
59
+ declare const Badge: react.ForwardRefExoticComponent<BadgeProps & react.RefAttributes<HTMLSpanElement>>;
3
60
 
4
61
  type ButtonVariant = 'primary' | 'secondary' | 'tertiary' | 'contrast' | 'transparent';
5
62
  type ButtonSize = 'small' | 'medium' | 'large' | 'extra-large';
@@ -24,4 +81,54 @@ interface CheckboxProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'siz
24
81
  }
25
82
  declare const Checkbox: react.ForwardRefExoticComponent<CheckboxProps & react.RefAttributes<HTMLInputElement>>;
26
83
 
27
- export { Button, type ButtonProps, Checkbox, type CheckboxProps };
84
+ type IconSize = 16 | 20 | 24;
85
+ type IconWeight = 100 | 200 | 300 | 400 | 500 | 600 | 700;
86
+ type IconGrade = -25 | 0 | 200;
87
+ interface IconProps extends Omit<HTMLAttributes<HTMLSpanElement>, 'children'> {
88
+ name: string;
89
+ size?: IconSize;
90
+ weight?: IconWeight;
91
+ fill?: boolean;
92
+ grade?: IconGrade;
93
+ opticalSize?: 20 | 24 | 40 | 48;
94
+ }
95
+ declare const Icon: react.ForwardRefExoticComponent<IconProps & react.RefAttributes<HTMLSpanElement>>;
96
+
97
+ type RadioSize = 'small' | 'medium';
98
+ interface RadioProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'size' | 'type'> {
99
+ size?: RadioSize;
100
+ label?: ReactNode;
101
+ description?: ReactNode;
102
+ error?: boolean;
103
+ contrast?: boolean;
104
+ }
105
+ declare const Radio: react.ForwardRefExoticComponent<RadioProps & react.RefAttributes<HTMLInputElement>>;
106
+
107
+ type SliderSize = 'small' | 'medium' | 'large';
108
+ interface SliderProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'size' | 'type' | 'onChange'> {
109
+ size?: SliderSize;
110
+ label?: ReactNode;
111
+ description?: ReactNode;
112
+ 'aria-label'?: string;
113
+ error?: boolean;
114
+ showValue?: boolean;
115
+ min?: number;
116
+ max?: number;
117
+ step?: number;
118
+ value?: number;
119
+ defaultValue?: number;
120
+ onChange?: (value: number, event: React.ChangeEvent<HTMLInputElement>) => void;
121
+ }
122
+ declare const Slider: react.ForwardRefExoticComponent<SliderProps & react.RefAttributes<HTMLInputElement>>;
123
+
124
+ type ToastType = 'default' | 'progress' | 'error';
125
+ interface ToastProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {
126
+ type?: ToastType;
127
+ icon?: boolean;
128
+ actionLabel?: ReactNode;
129
+ onAction?: () => void;
130
+ onDismiss?: () => void;
131
+ }
132
+ declare const Toast: react.ForwardRefExoticComponent<ToastProps & react.RefAttributes<HTMLDivElement>>;
133
+
134
+ export { Accordion, type AccordionItemData, type AccordionProps, AlertBanner, type AlertBannerProps, Avatar, type AvatarProps, Badge, type BadgeProps, Button, type ButtonProps, Checkbox, type CheckboxProps, Icon, type IconProps, Radio, type RadioProps, Slider, type SliderProps, Toast, type ToastProps };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,62 @@
1
1
  import * as react from 'react';
2
- import { ButtonHTMLAttributes, ReactNode, InputHTMLAttributes } from 'react';
2
+ import { HTMLAttributes, ReactNode, ButtonHTMLAttributes, InputHTMLAttributes } from 'react';
3
+
4
+ type AccordionSize = 'small' | 'medium' | 'large';
5
+ interface AccordionItemData {
6
+ id?: string;
7
+ title: ReactNode;
8
+ subtitle?: ReactNode;
9
+ content: ReactNode;
10
+ disabled?: boolean;
11
+ defaultOpen?: boolean;
12
+ }
13
+ interface AccordionProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {
14
+ items: AccordionItemData[];
15
+ size?: AccordionSize;
16
+ multiple?: boolean;
17
+ loading?: boolean;
18
+ }
19
+ declare const Accordion: react.ForwardRefExoticComponent<AccordionProps & react.RefAttributes<HTMLDivElement>>;
20
+
21
+ type AlertVariant = 'info' | 'success' | 'warning' | 'danger' | 'common';
22
+ type AlertMode = 'inline' | 'page';
23
+ interface AlertBannerProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {
24
+ variant?: AlertVariant;
25
+ mode?: AlertMode;
26
+ title?: ReactNode;
27
+ description?: ReactNode;
28
+ icon?: ReactNode;
29
+ onClose?: () => void;
30
+ }
31
+ declare const AlertBanner: react.ForwardRefExoticComponent<AlertBannerProps & react.RefAttributes<HTMLDivElement>>;
32
+
33
+ type AvatarSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';
34
+ type AvatarShape = 'circle' | 'square';
35
+ type AvatarStatus = 'online' | 'offline' | 'busy';
36
+ interface AvatarProps extends HTMLAttributes<HTMLDivElement> {
37
+ size?: AvatarSize;
38
+ shape?: AvatarShape;
39
+ src?: string;
40
+ alt?: string;
41
+ name?: string;
42
+ icon?: ReactNode;
43
+ status?: AvatarStatus;
44
+ }
45
+ declare const Avatar: react.ForwardRefExoticComponent<AvatarProps & react.RefAttributes<HTMLDivElement>>;
46
+
47
+ type BadgeStatus = 'common' | 'success' | 'warning' | 'info' | 'brand' | 'danger';
48
+ type BadgeStyle = 'minimal' | 'subtle' | 'bold';
49
+ type BadgeSize = 'sm' | 'md' | 'lg';
50
+ type BadgeShape = 'square' | 'round';
51
+ interface BadgeProps extends HTMLAttributes<HTMLSpanElement> {
52
+ status?: BadgeStatus;
53
+ badgeStyle?: BadgeStyle;
54
+ size?: BadgeSize;
55
+ shape?: BadgeShape;
56
+ icon?: ReactNode;
57
+ dot?: boolean;
58
+ }
59
+ declare const Badge: react.ForwardRefExoticComponent<BadgeProps & react.RefAttributes<HTMLSpanElement>>;
3
60
 
4
61
  type ButtonVariant = 'primary' | 'secondary' | 'tertiary' | 'contrast' | 'transparent';
5
62
  type ButtonSize = 'small' | 'medium' | 'large' | 'extra-large';
@@ -24,4 +81,54 @@ interface CheckboxProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'siz
24
81
  }
25
82
  declare const Checkbox: react.ForwardRefExoticComponent<CheckboxProps & react.RefAttributes<HTMLInputElement>>;
26
83
 
27
- export { Button, type ButtonProps, Checkbox, type CheckboxProps };
84
+ type IconSize = 16 | 20 | 24;
85
+ type IconWeight = 100 | 200 | 300 | 400 | 500 | 600 | 700;
86
+ type IconGrade = -25 | 0 | 200;
87
+ interface IconProps extends Omit<HTMLAttributes<HTMLSpanElement>, 'children'> {
88
+ name: string;
89
+ size?: IconSize;
90
+ weight?: IconWeight;
91
+ fill?: boolean;
92
+ grade?: IconGrade;
93
+ opticalSize?: 20 | 24 | 40 | 48;
94
+ }
95
+ declare const Icon: react.ForwardRefExoticComponent<IconProps & react.RefAttributes<HTMLSpanElement>>;
96
+
97
+ type RadioSize = 'small' | 'medium';
98
+ interface RadioProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'size' | 'type'> {
99
+ size?: RadioSize;
100
+ label?: ReactNode;
101
+ description?: ReactNode;
102
+ error?: boolean;
103
+ contrast?: boolean;
104
+ }
105
+ declare const Radio: react.ForwardRefExoticComponent<RadioProps & react.RefAttributes<HTMLInputElement>>;
106
+
107
+ type SliderSize = 'small' | 'medium' | 'large';
108
+ interface SliderProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'size' | 'type' | 'onChange'> {
109
+ size?: SliderSize;
110
+ label?: ReactNode;
111
+ description?: ReactNode;
112
+ 'aria-label'?: string;
113
+ error?: boolean;
114
+ showValue?: boolean;
115
+ min?: number;
116
+ max?: number;
117
+ step?: number;
118
+ value?: number;
119
+ defaultValue?: number;
120
+ onChange?: (value: number, event: React.ChangeEvent<HTMLInputElement>) => void;
121
+ }
122
+ declare const Slider: react.ForwardRefExoticComponent<SliderProps & react.RefAttributes<HTMLInputElement>>;
123
+
124
+ type ToastType = 'default' | 'progress' | 'error';
125
+ interface ToastProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {
126
+ type?: ToastType;
127
+ icon?: boolean;
128
+ actionLabel?: ReactNode;
129
+ onAction?: () => void;
130
+ onDismiss?: () => void;
131
+ }
132
+ declare const Toast: react.ForwardRefExoticComponent<ToastProps & react.RefAttributes<HTMLDivElement>>;
133
+
134
+ export { Accordion, type AccordionItemData, type AccordionProps, AlertBanner, type AlertBannerProps, Avatar, type AvatarProps, Badge, type BadgeProps, Button, type ButtonProps, Checkbox, type CheckboxProps, Icon, type IconProps, Radio, type RadioProps, Slider, type SliderProps, Toast, type ToastProps };