@zimyo/ui 1.2.1 → 1.4.0

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.
Files changed (46) hide show
  1. package/dist/Accordion/index.esm.js +5 -218
  2. package/dist/Accordion/index.js +5 -225
  3. package/dist/Badge/index.d.ts +29 -0
  4. package/dist/Badge/index.esm.js +1 -0
  5. package/dist/Badge/index.js +1 -0
  6. package/dist/Button/index.esm.js +1 -13
  7. package/dist/Button/index.js +1 -18
  8. package/dist/Card/index.esm.js +1 -36
  9. package/dist/Card/index.js +1 -38
  10. package/dist/DatePicker/index.d.ts +38 -0
  11. package/dist/DatePicker/index.esm.js +27 -0
  12. package/dist/DatePicker/index.js +27 -0
  13. package/dist/DateRangePicker/index.d.ts +27 -0
  14. package/dist/DateRangePicker/index.esm.js +27 -0
  15. package/dist/DateRangePicker/index.js +27 -0
  16. package/dist/Input/index.d.ts +18 -0
  17. package/dist/Input/index.esm.js +26 -0
  18. package/dist/Input/index.js +26 -0
  19. package/dist/Modal/index.d.ts +11 -9
  20. package/dist/Modal/index.esm.js +5 -123
  21. package/dist/Modal/index.js +5 -128
  22. package/dist/Notice/index.d.ts +19 -0
  23. package/dist/Notice/index.esm.js +26 -0
  24. package/dist/Notice/index.js +26 -0
  25. package/dist/Popover/index.esm.js +1 -22
  26. package/dist/Popover/index.js +1 -27
  27. package/dist/RadioGroup/index.esm.js +1 -91
  28. package/dist/RadioGroup/index.js +1 -96
  29. package/dist/Select/index.d.ts +15 -13
  30. package/dist/Select/index.esm.js +5 -173
  31. package/dist/Select/index.js +5 -178
  32. package/dist/Switch/index.esm.js +1 -9
  33. package/dist/Switch/index.js +1 -14
  34. package/dist/Tabs/index.esm.js +1 -202
  35. package/dist/Tabs/index.js +1 -207
  36. package/dist/Typography/index.esm.js +1 -57
  37. package/dist/Typography/index.js +1 -66
  38. package/dist/index.d.ts +169 -54
  39. package/dist/index.esm.js +5 -746
  40. package/dist/index.js +5 -770
  41. package/dist/theme/index.esm.js +1 -234
  42. package/dist/theme/index.js +1 -239
  43. package/package.json +44 -8
  44. package/dist/TextInput/index.d.ts +0 -18
  45. package/dist/TextInput/index.esm.js +0 -33
  46. package/dist/TextInput/index.js +0 -38
package/dist/index.d.ts CHANGED
@@ -1,8 +1,13 @@
1
- import React$1, { ReactNode } from 'react';
2
- import { ButtonProps as ButtonProps$1, SelectProps as SelectProps$1, SelectChangeEvent, AccordionProps as AccordionProps$1, AccordionSummaryProps, AccordionDetailsProps, SwitchProps as SwitchProps$1, TextFieldProps, TypographyProps, SxProps as SxProps$1, DialogProps } from '@mui/material';
1
+ import * as React$1 from 'react';
2
+ import React__default from 'react';
3
+ import { ButtonProps as ButtonProps$1, AccordionProps as AccordionProps$1, AccordionSummaryProps, AccordionDetailsProps, SwitchProps as SwitchProps$1, TypographyProps, SxProps as SxProps$1 } from '@mui/material';
3
4
  import { SxProps } from '@mui/system';
4
5
  import * as react_jsx_runtime from 'react/jsx-runtime';
6
+ import { Props, GroupBase } from 'react-select';
7
+ import * as class_variance_authority_dist_types from 'class-variance-authority/dist/types';
8
+ import { VariantProps } from 'class-variance-authority';
5
9
  import { Theme } from '@mui/material/styles';
10
+ import { ClassValue } from 'clsx';
6
11
 
7
12
  interface ButtonProps extends Omit<ButtonProps$1, 'sx'> {
8
13
  loading?: boolean;
@@ -11,24 +16,26 @@ interface ButtonProps extends Omit<ButtonProps$1, 'sx'> {
11
16
  loaderSize?: number;
12
17
  loaderPosition?: 'start' | 'end' | 'center';
13
18
  }
14
- declare const Button: React$1.ForwardRefExoticComponent<Omit<ButtonProps, "ref"> & React$1.RefAttributes<HTMLButtonElement>>;
19
+ declare const Button: React__default.ForwardRefExoticComponent<Omit<ButtonProps, "ref"> & React__default.RefAttributes<HTMLButtonElement>>;
15
20
 
16
- interface OptionType {
21
+ interface Option {
17
22
  label: string;
18
23
  value: string | number;
24
+ [key: string]: any;
19
25
  }
20
- interface SelectProps extends Omit<SelectProps$1, 'value' | 'onChange'> {
26
+ type SelectSize = "sm" | "md" | "lg";
27
+ type SelectProps<OptionType extends Option> = {
21
28
  label?: string;
22
- options: OptionType[];
23
- error?: boolean;
24
- helperText?: string;
29
+ error?: string;
30
+ isClearable?: boolean;
31
+ isSearchable?: boolean;
32
+ className?: string;
33
+ size?: SelectSize;
25
34
  required?: boolean;
26
- placeholder?: string;
27
- value?: any;
28
- onChange?: (event: SelectChangeEvent<any>) => void;
29
- isMulti?: boolean;
30
- }
31
- declare const Select: React$1.ForwardRefExoticComponent<Omit<SelectProps, "ref"> & React$1.RefAttributes<any>>;
35
+ valueKey?: string;
36
+ labelKey?: string;
37
+ } & Props<OptionType, boolean, GroupBase<OptionType>>;
38
+ declare function Select<OptionType extends Option>({ label, error, className, size, required, valueKey, labelKey, ...props }: SelectProps<OptionType>): react_jsx_runtime.JSX.Element;
32
39
 
33
40
  interface AccordionProps extends Omit<AccordionProps$1, 'sx' | 'onChange' | 'expanded'> {
34
41
  type?: 'single' | 'multiple';
@@ -36,49 +43,36 @@ interface AccordionProps extends Omit<AccordionProps$1, 'sx' | 'onChange' | 'exp
36
43
  value?: string | string[];
37
44
  defaultValue?: string | string[];
38
45
  onValueChange?: (value: string | string[]) => void;
39
- children: React$1.ReactNode;
46
+ children: React__default.ReactNode;
40
47
  sx?: SxProps;
41
48
  }
42
49
  interface AccordionItemProps extends Omit<AccordionProps$1, 'sx'> {
43
50
  value: string;
44
- children: React$1.ReactNode;
51
+ children: React__default.ReactNode;
45
52
  sx?: SxProps;
46
53
  }
47
54
  interface AccordionTriggerProps extends Omit<AccordionSummaryProps, 'sx'> {
48
- children: React$1.ReactNode;
55
+ children: React__default.ReactNode;
49
56
  sx?: SxProps;
50
- expandIcon?: React$1.ReactNode;
57
+ expandIcon?: React__default.ReactNode;
51
58
  }
52
59
  interface AccordionContentProps extends Omit<AccordionDetailsProps, 'sx'> {
53
- children: React$1.ReactNode;
60
+ children: React__default.ReactNode;
54
61
  sx?: SxProps;
55
62
  }
56
- declare const Accordion: React$1.ForwardRefExoticComponent<Omit<AccordionProps, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
57
- declare const AccordionItem: React$1.ForwardRefExoticComponent<Omit<AccordionItemProps, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
58
- declare const AccordionTrigger: React$1.ForwardRefExoticComponent<Omit<AccordionTriggerProps, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
59
- declare const AccordionContent: React$1.ForwardRefExoticComponent<Omit<AccordionContentProps, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
63
+ declare const Accordion: React__default.ForwardRefExoticComponent<Omit<AccordionProps, "ref"> & React__default.RefAttributes<HTMLDivElement>>;
64
+ declare const AccordionItem: React__default.ForwardRefExoticComponent<Omit<AccordionItemProps, "ref"> & React__default.RefAttributes<HTMLDivElement>>;
65
+ declare const AccordionTrigger: React__default.ForwardRefExoticComponent<Omit<AccordionTriggerProps, "ref"> & React__default.RefAttributes<HTMLDivElement>>;
66
+ declare const AccordionContent: React__default.ForwardRefExoticComponent<Omit<AccordionContentProps, "ref"> & React__default.RefAttributes<HTMLDivElement>>;
60
67
 
61
68
  interface SwitchProps extends Omit<SwitchProps$1, 'onChange'> {
62
69
  label?: string;
63
70
  helperText?: string;
64
71
  error?: boolean;
65
72
  required?: boolean | number;
66
- onChange?: (event: React$1.ChangeEvent<HTMLInputElement>, checked: boolean) => void;
67
- }
68
- declare const Switch: React$1.ForwardRefExoticComponent<Omit<SwitchProps, "ref"> & React$1.RefAttributes<HTMLButtonElement>>;
69
-
70
- interface TextInputProps extends Omit<TextFieldProps, 'variant'> {
71
- label?: string;
72
- placeholder?: string;
73
- IS_MANDATORY?: boolean | number | string;
74
- startIcon?: React$1.ReactNode;
75
- endIcon?: React$1.ReactNode;
76
- error?: boolean;
77
- variant?: 'outlined' | 'filled' | 'standard';
78
- helperText?: string;
79
- type?: 'text' | 'password' | 'email' | 'number' | 'tel' | 'search';
73
+ onChange?: (event: React__default.ChangeEvent<HTMLInputElement>, checked: boolean) => void;
80
74
  }
81
- declare const TextInput: React$1.ForwardRefExoticComponent<Omit<TextInputProps, "ref"> & React$1.RefAttributes<HTMLInputElement>>;
75
+ declare const Switch: React__default.ForwardRefExoticComponent<Omit<SwitchProps, "ref"> & React__default.RefAttributes<HTMLButtonElement>>;
82
76
 
83
77
  interface RadioOption {
84
78
  value: string;
@@ -104,7 +98,7 @@ interface RadioGroupProps {
104
98
  radioSx?: SxProps;
105
99
  labelSx?: SxProps;
106
100
  }
107
- declare const RadioGroup: React$1.ForwardRefExoticComponent<RadioGroupProps & React$1.RefAttributes<HTMLDivElement>>;
101
+ declare const RadioGroup: React__default.ForwardRefExoticComponent<RadioGroupProps & React__default.RefAttributes<HTMLDivElement>>;
108
102
 
109
103
  interface HeadingProps extends TypographyProps {
110
104
  level?: 1 | 2 | 3 | 4 | 5 | 6;
@@ -132,34 +126,152 @@ interface CodeProps {
132
126
  }
133
127
  declare const Code: ({ children, sx }: CodeProps) => react_jsx_runtime.JSX.Element;
134
128
 
135
- interface ModalProps extends Omit<DialogProps, 'title'> {
129
+ interface ModalProps {
136
130
  open: boolean;
137
131
  onClose: () => void;
138
- title?: ReactNode;
139
- content?: ReactNode;
140
- actions?: ReactNode;
141
- maxWidth?: DialogProps['maxWidth'];
132
+ title?: string;
133
+ description?: string;
134
+ children?: React$1.ReactNode;
135
+ actions?: React$1.ReactNode;
136
+ showCloseIcon?: boolean;
137
+ maxWidth?: false | 'xs' | 'sm' | 'md' | 'lg' | 'xl';
142
138
  fullWidth?: boolean;
139
+ fullScreen?: boolean;
140
+ className?: string;
143
141
  }
144
- declare const Modal: ({ open, onClose, title, content, actions, fullWidth, maxWidth, ...rest }: ModalProps) => react_jsx_runtime.JSX.Element;
142
+ declare const Modal: React$1.FC<ModalProps>;
145
143
 
146
- interface AnimatedDrawerProps {
144
+ interface DrawerProps {
147
145
  open: boolean;
148
146
  onClose: () => void;
149
- anchor?: "left" | "right";
150
- width?: number;
147
+ title?: string;
151
148
  children: React$1.ReactNode;
152
- closeButton?: boolean;
149
+ footer?: React$1.ReactNode;
150
+ side?: "left" | "right" | "top" | "bottom";
151
+ className?: string;
152
+ showCloseIcon?: boolean;
153
+ withOverlay?: boolean;
154
+ stickyFooter?: boolean;
155
+ width?: number | string;
156
+ height?: number | string;
153
157
  }
154
- declare const Drawer: React$1.FC<AnimatedDrawerProps>;
158
+ declare const Drawer: React$1.FC<DrawerProps>;
159
+
160
+ type Position = "start" | "end";
161
+ interface CustomColor {
162
+ bg?: string;
163
+ text?: string;
164
+ border?: string;
165
+ }
166
+ interface BadgeProps extends VariantProps<typeof badgeVariants> {
167
+ label: string;
168
+ icon?: React__default.ReactNode;
169
+ iconPosition?: Position;
170
+ dot?: boolean;
171
+ dotPosition?: Position;
172
+ color?: CustomColor;
173
+ className?: string;
174
+ }
175
+ declare const badgeVariants: (props?: ({
176
+ variant?: "text" | "outlined" | "contained" | null | undefined;
177
+ size?: "sm" | "md" | "lg" | null | undefined;
178
+ type?: "default" | "success" | "error" | "info" | "warning" | null | undefined;
179
+ } & class_variance_authority_dist_types.ClassProp) | undefined) => string;
180
+ declare const Badge: ({ label, icon, iconPosition, dot, dotPosition, variant, size, type, color, className, }: BadgeProps) => react_jsx_runtime.JSX.Element;
181
+
182
+ type InputSize$2 = "sm" | "md" | "lg";
183
+ type InputVariant = "outlined" | "contained";
184
+ interface InputProps extends React$1.InputHTMLAttributes<HTMLInputElement> {
185
+ label?: string;
186
+ description?: string;
187
+ error?: string;
188
+ leftIcon?: React$1.ReactNode;
189
+ rightIcon?: React$1.ReactNode;
190
+ size?: InputSize$2;
191
+ variant?: InputVariant;
192
+ allowedPattern?: "number" | "alpha" | RegExp;
193
+ }
194
+ declare const Input: React$1.ForwardRefExoticComponent<InputProps & React$1.RefAttributes<HTMLInputElement>>;
195
+
196
+ type NoticeVariant = 'success' | 'error' | 'warning' | 'info';
197
+ type NoticeSize = 'sm' | 'md' | 'lg';
198
+ type NoticeStyleType = 'contained' | 'outlined';
199
+ interface NoticeProps {
200
+ title?: string;
201
+ message: string;
202
+ variant?: NoticeVariant;
203
+ size?: NoticeSize;
204
+ styleType?: NoticeStyleType;
205
+ onClose?: () => void;
206
+ className?: string;
207
+ showCloseIcon?: boolean;
208
+ }
209
+ declare const Notice: React$1.FC<NoticeProps>;
210
+
211
+ type DayOfWeek = 0 | 1 | 2 | 3 | 4 | 5 | 6;
212
+ type DateRange = {
213
+ from: Date;
214
+ to: Date;
215
+ };
216
+ type DisabledDateObject = {
217
+ dayOfWeek: DayOfWeek[];
218
+ } | {
219
+ before: Date;
220
+ } | {
221
+ after: Date;
222
+ } | {
223
+ before: Date;
224
+ after: Date;
225
+ } | DateRange;
226
+ type DisabledProp = boolean | Date | Date[] | DisabledDateObject;
227
+ type InputSize$1 = "sm" | "md" | "lg";
228
+ type DatePickerVariant$1 = "outlined" | "contained";
229
+ interface DatePickerProps {
230
+ label?: string;
231
+ value?: Date;
232
+ onChange?: (date: Date | undefined) => void;
233
+ placeholder?: string;
234
+ required?: boolean;
235
+ description?: string;
236
+ error?: string;
237
+ disabled?: boolean;
238
+ variant?: DatePickerVariant$1;
239
+ size?: InputSize$1;
240
+ className?: string;
241
+ disableRange?: DisabledProp;
242
+ }
243
+ declare const DatePicker: React$1.FC<DatePickerProps>;
244
+
245
+ type InputSize = "sm" | "md" | "lg";
246
+ type DatePickerVariant = "outlined" | "contained";
247
+ interface DateRangePickerProps {
248
+ label?: string;
249
+ value?: {
250
+ from: Date;
251
+ to: Date;
252
+ };
253
+ onChange?: (range: {
254
+ from: Date;
255
+ to: Date;
256
+ } | undefined) => void;
257
+ placeholder?: string;
258
+ required?: boolean;
259
+ description?: string;
260
+ error?: string;
261
+ disabled?: boolean;
262
+ variant?: DatePickerVariant;
263
+ size?: InputSize;
264
+ className?: string;
265
+ }
266
+ declare const DateRangePicker: React$1.FC<DateRangePickerProps>;
155
267
 
156
268
  interface UILibraryThemeProviderProps {
157
- children: React$1.ReactNode;
269
+ children: React__default.ReactNode;
158
270
  primaryColor?: string;
159
271
  secondaryColor?: string;
160
272
  enableCssBaseline?: boolean;
161
273
  }
162
- declare const UILibraryThemeProvider: React$1.FC<UILibraryThemeProviderProps>;
274
+ declare const UILibraryThemeProvider: React__default.FC<UILibraryThemeProviderProps>;
163
275
 
164
276
  declare module '@mui/material/styles' {
165
277
  interface Theme {
@@ -239,5 +351,8 @@ declare const designTokens: {
239
351
  };
240
352
  };
241
353
 
242
- export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Blockquote, Button, Caption, Code, Drawer, Heading, Lead, Modal, Muted, RadioGroup, Select, Strong, Switch, Text, TextInput, UILibraryThemeProvider, createCustomTheme, designTokens, theme };
243
- export type { AccordionContentProps, AccordionItemProps, AccordionProps, AccordionTriggerProps, AnimatedDrawerProps, ButtonProps, ModalProps, RadioGroupProps, RadioOption, SelectProps, SwitchProps, TextInputProps, ThemeConfig, UILibraryThemeProviderProps };
354
+ declare function cn(...inputs: ClassValue[]): string;
355
+ declare function useStableId(prefix?: string): string;
356
+
357
+ export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Badge, Blockquote, Button, Caption, Code, DatePicker, DateRangePicker, Drawer, Heading, Input, Lead, Modal, Muted, Notice, RadioGroup, Select, Strong, Switch, Text, UILibraryThemeProvider, cn, createCustomTheme, designTokens, theme, useStableId };
358
+ export type { AccordionContentProps, AccordionItemProps, AccordionProps, AccordionTriggerProps, BadgeProps, ButtonProps, DatePickerProps, DateRangePickerProps, DrawerProps, InputProps, ModalProps, NoticeProps, RadioGroupProps, RadioOption, SelectProps, SwitchProps, ThemeConfig, UILibraryThemeProviderProps };