@zimyo/ui 1.3.0 → 1.5.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.
@@ -1 +1 @@
1
- import{jsxs as e,jsx as r}from"react/jsx-runtime";import o from"react";import{FormControl as i,FormControlLabel as t,Switch as a,FormHelperText as d}from"@mui/material";const l=o.forwardRef(({label:o="",helperText:l="",error:c=!1,onChange:n,checked:m,required:f=!1,disabled:h=!1,...s},p)=>e(i,{error:c,disabled:h,component:"fieldset",children:[r(t,{control:r(a,{inputRef:p,checked:m,onChange:(e,r)=>n?.(e,r),disabled:h,required:1==f||!0===f,...s}),label:o}),l&&r(d,{children:l})]}));export{l as Switch,l as default};
1
+ import{jsxs as e,jsx as r}from"react/jsx-runtime";import a from"react";import{FormControl as o,FormControlLabel as i,Switch as l,FormHelperText as t}from"@mui/material";const d=a.forwardRef(({label:a="",helperText:d="",error:c=!1,onChange:m,checked:n,required:s=!1,disabled:f=!1,className:h,...p},u)=>e(o,{className:h,error:c,disabled:f,component:"fieldset",children:[r(i,{control:r(l,{inputRef:u,checked:n,onChange:(e,r)=>m?.(e,r),disabled:f,required:1==s||!0===s,...p}),label:a}),d&&r(t,{children:d})]}));export{d as Switch,d as default};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("react"),t=require("@mui/material");const o=r.forwardRef(({label:r="",helperText:o="",error:l=!1,onChange:i,checked:d,required:s=!1,disabled:a=!1,...c},n)=>e.jsxs(t.FormControl,{error:l,disabled:a,component:"fieldset",children:[e.jsx(t.FormControlLabel,{control:e.jsx(t.Switch,{inputRef:n,checked:d,onChange:(e,r)=>i?.(e,r),disabled:a,required:1==s||!0===s,...c}),label:r}),o&&e.jsx(t.FormHelperText,{children:o})]}));exports.Switch=o,exports.default=o;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("react"),t=require("@mui/material");const l=r.forwardRef(({label:r="",helperText:l="",error:o=!1,onChange:s,checked:a,required:i=!1,disabled:c=!1,className:d,...n},u)=>e.jsxs(t.FormControl,{className:d,error:o,disabled:c,component:"fieldset",children:[e.jsx(t.FormControlLabel,{control:e.jsx(t.Switch,{inputRef:u,checked:a,onChange:(e,r)=>s?.(e,r),disabled:c,required:1==i||!0===i,...n}),label:r}),l&&e.jsx(t.FormHelperText,{children:l})]}));exports.Switch=l,exports.default=l;
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as React$1 from 'react';
2
2
  import React__default from 'react';
3
- import { ButtonProps as ButtonProps$1, AccordionProps as AccordionProps$1, AccordionSummaryProps, AccordionDetailsProps, SwitchProps as SwitchProps$1, TextFieldProps, TypographyProps, SxProps as SxProps$1 } from '@mui/material';
3
+ import { ButtonProps as ButtonProps$1, AccordionProps as AccordionProps$1, AccordionSummaryProps, AccordionDetailsProps, SwitchProps as SwitchProps$1, TypographyProps, SxProps as SxProps$1 } from '@mui/material';
4
4
  import { SxProps } from '@mui/system';
5
5
  import * as react_jsx_runtime from 'react/jsx-runtime';
6
6
  import { Props, GroupBase } from 'react-select';
@@ -15,12 +15,14 @@ interface ButtonProps extends Omit<ButtonProps$1, 'sx'> {
15
15
  sx?: SxProps;
16
16
  loaderSize?: number;
17
17
  loaderPosition?: 'start' | 'end' | 'center';
18
+ onStartIconClick?: (e: React__default.MouseEvent) => void;
19
+ onEndIconClick?: (e: React__default.MouseEvent) => void;
18
20
  }
19
21
  declare const Button: React__default.ForwardRefExoticComponent<Omit<ButtonProps, "ref"> & React__default.RefAttributes<HTMLButtonElement>>;
20
22
 
21
23
  interface Option {
22
- label: string;
23
- value: string | number;
24
+ label?: string;
25
+ value?: string | number;
24
26
  [key: string]: any;
25
27
  }
26
28
  type SelectSize = "sm" | "md" | "lg";
@@ -34,8 +36,10 @@ type SelectProps<OptionType extends Option> = {
34
36
  required?: boolean;
35
37
  valueKey?: string;
36
38
  labelKey?: string;
39
+ searchByID?: boolean;
40
+ value?: any;
37
41
  } & 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;
42
+ declare function Select<OptionType extends Option>({ label, error, className, size, required, valueKey, labelKey, isMulti, value, options, onChange, searchByID, ...props }: SelectProps<OptionType>): react_jsx_runtime.JSX.Element;
39
43
 
40
44
  interface AccordionProps extends Omit<AccordionProps$1, 'sx' | 'onChange' | 'expanded'> {
41
45
  type?: 'single' | 'multiple';
@@ -74,19 +78,6 @@ interface SwitchProps extends Omit<SwitchProps$1, 'onChange'> {
74
78
  }
75
79
  declare const Switch: React__default.ForwardRefExoticComponent<Omit<SwitchProps, "ref"> & React__default.RefAttributes<HTMLButtonElement>>;
76
80
 
77
- interface TextInputProps extends Omit<TextFieldProps, 'variant'> {
78
- label?: string;
79
- placeholder?: string;
80
- IS_MANDATORY?: boolean | number | string;
81
- startIcon?: React__default.ReactNode;
82
- endIcon?: React__default.ReactNode;
83
- error?: boolean;
84
- variant?: 'outlined' | 'filled' | 'standard';
85
- helperText?: string;
86
- type?: 'text' | 'password' | 'email' | 'number' | 'tel' | 'search';
87
- }
88
- declare const TextInput: React__default.ForwardRefExoticComponent<Omit<TextInputProps, "ref"> & React__default.RefAttributes<HTMLInputElement>>;
89
-
90
81
  interface RadioOption {
91
82
  value: string;
92
83
  label: string;
@@ -192,7 +183,7 @@ declare const badgeVariants: (props?: ({
192
183
  } & class_variance_authority_dist_types.ClassProp) | undefined) => string;
193
184
  declare const Badge: ({ label, icon, iconPosition, dot, dotPosition, variant, size, type, color, className, }: BadgeProps) => react_jsx_runtime.JSX.Element;
194
185
 
195
- type InputSize = "sm" | "md" | "lg";
186
+ type InputSize$2 = "sm" | "md" | "lg";
196
187
  type InputVariant = "outlined" | "contained";
197
188
  interface InputProps extends React$1.InputHTMLAttributes<HTMLInputElement> {
198
189
  label?: string;
@@ -200,7 +191,7 @@ interface InputProps extends React$1.InputHTMLAttributes<HTMLInputElement> {
200
191
  error?: string;
201
192
  leftIcon?: React$1.ReactNode;
202
193
  rightIcon?: React$1.ReactNode;
203
- size?: InputSize;
194
+ size?: InputSize$2;
204
195
  variant?: InputVariant;
205
196
  allowedPattern?: "number" | "alpha" | RegExp;
206
197
  }
@@ -221,6 +212,63 @@ interface NoticeProps {
221
212
  }
222
213
  declare const Notice: React$1.FC<NoticeProps>;
223
214
 
215
+ type DayOfWeek = 0 | 1 | 2 | 3 | 4 | 5 | 6;
216
+ type DateRange = {
217
+ from: Date;
218
+ to: Date;
219
+ };
220
+ type DisabledDateObject = {
221
+ dayOfWeek: DayOfWeek[];
222
+ } | {
223
+ before: Date;
224
+ } | {
225
+ after: Date;
226
+ } | {
227
+ before: Date;
228
+ after: Date;
229
+ } | DateRange;
230
+ type DisabledProp = boolean | Date | Date[] | DisabledDateObject;
231
+ type InputSize$1 = "sm" | "md" | "lg";
232
+ type DatePickerVariant$1 = "outlined" | "contained";
233
+ interface DatePickerProps {
234
+ label?: string;
235
+ value?: Date;
236
+ onChange?: (date: Date | undefined) => void;
237
+ placeholder?: string;
238
+ required?: boolean;
239
+ description?: string;
240
+ error?: string;
241
+ disabled?: boolean;
242
+ variant?: DatePickerVariant$1;
243
+ size?: InputSize$1;
244
+ className?: string;
245
+ disableRange?: DisabledProp;
246
+ }
247
+ declare const DatePicker: React$1.FC<DatePickerProps>;
248
+
249
+ type InputSize = "sm" | "md" | "lg";
250
+ type DatePickerVariant = "outlined" | "contained";
251
+ interface DateRangePickerProps {
252
+ label?: string;
253
+ value?: {
254
+ from: Date;
255
+ to: Date;
256
+ };
257
+ onChange?: (range: {
258
+ from: Date;
259
+ to: Date;
260
+ } | undefined) => void;
261
+ placeholder?: string;
262
+ required?: boolean;
263
+ description?: string;
264
+ error?: string;
265
+ disabled?: boolean;
266
+ variant?: DatePickerVariant;
267
+ size?: InputSize;
268
+ className?: string;
269
+ }
270
+ declare const DateRangePicker: React$1.FC<DateRangePickerProps>;
271
+
224
272
  interface UILibraryThemeProviderProps {
225
273
  children: React__default.ReactNode;
226
274
  primaryColor?: string;
@@ -310,5 +358,5 @@ declare const designTokens: {
310
358
  declare function cn(...inputs: ClassValue[]): string;
311
359
  declare function useStableId(prefix?: string): string;
312
360
 
313
- export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Badge, Blockquote, Button, Caption, Code, Drawer, Heading, Input, Lead, Modal, Muted, Notice, RadioGroup, Select, Strong, Switch, Text, TextInput, UILibraryThemeProvider, cn, createCustomTheme, designTokens, theme, useStableId };
314
- export type { AccordionContentProps, AccordionItemProps, AccordionProps, AccordionTriggerProps, BadgeProps, ButtonProps, DrawerProps, InputProps, ModalProps, NoticeProps, RadioGroupProps, RadioOption, SelectProps, SwitchProps, TextInputProps, ThemeConfig, UILibraryThemeProviderProps };
361
+ 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 };
362
+ export type { AccordionContentProps, AccordionItemProps, AccordionProps, AccordionTriggerProps, BadgeProps, ButtonProps, DatePickerProps, DateRangePickerProps, DrawerProps, InputProps, ModalProps, NoticeProps, RadioGroupProps, RadioOption, SelectProps, SwitchProps, ThemeConfig, UILibraryThemeProviderProps };