@yr3/ui 1.0.12 → 1.0.14

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 (44) hide show
  1. package/dist/components/Avatar/avatar.css +14 -2
  2. package/dist/components/Avatar/avatar.css.map +1 -1
  3. package/dist/components/Backdrop/backdrop.css +1 -1
  4. package/dist/components/Button/buttons.css +7 -4
  5. package/dist/components/Button/buttons.css.map +1 -1
  6. package/dist/components/Checkbox/checkbox.css +55 -31
  7. package/dist/components/Checkbox/checkbox.css.map +1 -1
  8. package/dist/components/Chip/chip.css +9 -0
  9. package/dist/components/Chip/chip.css.map +1 -1
  10. package/dist/components/Control/control.css +12 -0
  11. package/dist/components/Control/control.css.map +1 -1
  12. package/dist/components/Divider/divider.css +4 -0
  13. package/dist/components/Divider/divider.css.map +1 -1
  14. package/dist/components/Group/group.css +26 -18
  15. package/dist/components/Group/group.css.map +1 -1
  16. package/dist/components/Input/input.css +5 -1
  17. package/dist/components/Input/input.css.map +1 -1
  18. package/dist/components/InputArea/inputArea.css +5 -0
  19. package/dist/components/InputArea/inputArea.css.map +1 -1
  20. package/dist/components/Label/label.css +4 -0
  21. package/dist/components/Label/label.css.map +1 -1
  22. package/dist/components/Loader/loader.css +112 -0
  23. package/dist/components/Loader/loader.css.map +1 -0
  24. package/dist/components/Notistack/notistack.css +5 -0
  25. package/dist/components/Notistack/notistack.css.map +1 -1
  26. package/dist/components/Pending/pending.css +4 -0
  27. package/dist/components/Pending/pending.css.map +1 -1
  28. package/dist/components/Radio/radio.css +5 -0
  29. package/dist/components/Radio/radio.css.map +1 -1
  30. package/dist/components/Select/select.css +44 -0
  31. package/dist/components/Select/select.css.map +1 -1
  32. package/dist/components/Switch/switch.css +28 -0
  33. package/dist/components/Switch/switch.css.map +1 -1
  34. package/dist/components/Text/text.css +9 -1
  35. package/dist/components/Text/text.css.map +1 -1
  36. package/dist/index.cjs +511 -228
  37. package/dist/index.d.cts +170 -96
  38. package/dist/index.d.ts +170 -96
  39. package/dist/index.js +503 -228
  40. package/dist/styles/global.css +5 -0
  41. package/dist/styles/global.css.map +1 -1
  42. package/dist/styles/index.css +352 -58
  43. package/dist/styles/index.css.map +1 -1
  44. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -95,6 +95,11 @@ type Theme = {
95
95
  primary: string;
96
96
  secondary: string;
97
97
  };
98
+ backdrop?: string;
99
+ common?: {
100
+ white: string;
101
+ black: string;
102
+ };
98
103
  };
99
104
  breakpoints: typeof breakpoints;
100
105
  text: typeof text;
@@ -981,7 +986,7 @@ declare const composeStyles: (ui?: UIProps, style?: React.CSSProperties) => {
981
986
 
982
987
  type AvatarProps = {
983
988
  label?: string;
984
- variant?: 'circle' | 'square' | 'rounded';
989
+ variant?: 'circle' | 'square' | 'rounded' | 'bordered';
985
990
  src?: string;
986
991
  alt?: string;
987
992
  children?: React$1.ReactNode;
@@ -1079,8 +1084,116 @@ declare const baseTokens: {
1079
1084
  };
1080
1085
  };
1081
1086
 
1087
+ declare const bem: (block: string) => (element?: string, modifiers?: Record<string, any>) => string;
1088
+ declare const bemMerge: (...args: any[]) => string;
1089
+
1090
+ type CalendarDayProps = {
1091
+ day: number;
1092
+ date: Dayjs;
1093
+ isToday: boolean;
1094
+ isPast: boolean;
1095
+ isFuture: boolean;
1096
+ isCurrentMonth: boolean;
1097
+ selected: any;
1098
+ data?: any;
1099
+ };
1100
+ type CalendarComponentProps = {
1101
+ calendar: (CalendarDayProps | null)[][];
1102
+ month: number;
1103
+ monthLabel: string;
1104
+ yearLabel: string;
1105
+ daysContainer: number[];
1106
+ days: number;
1107
+ weeks: number;
1108
+ isWeekend: boolean;
1109
+ date: Dayjs;
1110
+ selected: CalendarDayProps | null;
1111
+ currentDay: CalendarDayProps;
1112
+ props?: any;
1113
+ };
1114
+ declare function getMonthCalendar(year: number, month: number, startIndex: number, selected: CalendarDayProps, props?: any): CalendarComponentProps;
1115
+
1116
+ declare const rgbToHex: (r: number, g: number, b: number) => string;
1117
+ declare const hexToRgb: (hex: string) => {
1118
+ r: number;
1119
+ g: number;
1120
+ b: number;
1121
+ };
1122
+ declare const adjustColor: (hex: string, amount: number) => string;
1123
+ declare const getContrast: (hex: string) => "#000000" | "#ffffff";
1124
+ declare const createPaletteColor: (main: string) => PaletteColor;
1125
+ declare const lighten: (hex: string, amount: number) => string;
1126
+ declare const darken: (hex: string, amount: number) => string;
1127
+ declare const alpha: (hex: string, opacity: number) => string;
1128
+
1129
+ declare function isEmpty(value: unknown): boolean;
1130
+ declare function times<T>(n: number, iteratee: (index: number) => T): T[];
1131
+
1132
+ declare const cx: (...args: any[]) => string;
1133
+
1134
+ type VariantConfig = {
1135
+ base: string;
1136
+ variants?: Record<string, Record<string, string>>;
1137
+ };
1138
+ declare const createVariants: (config: VariantConfig) => (props?: Record<string, any>) => string;
1139
+
1140
+ type CountriesDial = {
1141
+ code: string;
1142
+ dial: string;
1143
+ label: string;
1144
+ };
1145
+ declare const normalizePhone: (phone: string, dial: string) => {
1146
+ number: string;
1147
+ full: string;
1148
+ } | null;
1149
+ declare const getDialPhone: (phone: string, countries: CountriesDial[]) => string | null;
1150
+ declare const getCountryCodePhone: (phone: string, countries: CountriesDial[]) => string | null;
1151
+ declare const getNumberPhone: (phone: string, dial: string) => string;
1152
+
1153
+ declare function mergeDeep<T>(target: T, source?: Partial<T>): T;
1154
+
1155
+ type NotistackAnchorProps = {
1156
+ vertical: 'top' | 'bottom';
1157
+ horizontal: 'left' | 'center' | 'right';
1158
+ };
1159
+ type NotistackProps = {
1160
+ message: string;
1161
+ duration?: number;
1162
+ variant?: 'info' | 'success' | 'warning' | 'error';
1163
+ color?: keyof Theme['colors'];
1164
+ anchor?: NotistackAnchorProps;
1165
+ exiting?: boolean;
1166
+ propsComponent?: {
1167
+ notistack?: {
1168
+ ui?: UIProps;
1169
+ style?: React.CSSProperties;
1170
+ };
1171
+ container?: {
1172
+ ui?: UIProps;
1173
+ style?: React.CSSProperties;
1174
+ };
1175
+ progress?: {
1176
+ ui?: UIProps;
1177
+ style?: React.CSSProperties;
1178
+ };
1179
+ };
1180
+ };
1181
+ declare const Notistack: React.FC<NotistackProps>;
1182
+
1183
+ type Snack = NotistackProps & {
1184
+ id: number;
1185
+ message: string;
1186
+ duration?: number;
1187
+ variant?: 'success' | 'error' | 'info';
1188
+ exiting?: boolean;
1189
+ anchor?: NotistackAnchorProps;
1190
+ };
1191
+ type NotistackContextType = {
1192
+ notistack: (snack: Snack) => void;
1193
+ };
1194
+ declare const NotistackContext: React$1.Context<NotistackContextType | null>;
1082
1195
  declare const NotistackProvider: ({ children }: any) => react_jsx_runtime.JSX.Element;
1083
- declare const useNotistack: () => any;
1196
+ declare const useNotistack: () => NotistackContextType;
1084
1197
 
1085
1198
  declare function useMediaQuery(query: string | ((theme: any) => string)): boolean;
1086
1199
  type Breakpoint = keyof typeof breakpoints;
@@ -1130,6 +1243,7 @@ type CheckboxProps = {
1130
1243
  onChange?: (e: React$1.ChangeEvent<HTMLInputElement>, checked: boolean) => void;
1131
1244
  label?: string;
1132
1245
  variant?: 'filled' | 'outlined' | 'text';
1246
+ type?: 'default' | 'circle';
1133
1247
  color?: keyof Theme['colors'];
1134
1248
  disabled?: boolean;
1135
1249
  propsComponent?: {
@@ -1152,9 +1266,23 @@ type ChipProps = {
1152
1266
  size?: 'small' | 'medium' | 'large';
1153
1267
  onClick?: (e: React$1.MouseEvent<HTMLDivElement, MouseEvent>) => void;
1154
1268
  icon?: React$1.ReactNode;
1269
+ deleted?: boolean;
1155
1270
  onDelete?: (e: React$1.MouseEvent<HTMLDivElement, MouseEvent>) => void;
1156
- ui?: UIProps;
1157
- style?: React$1.CSSProperties;
1271
+ propsComponent?: {
1272
+ chip?: {
1273
+ ui?: UIProps;
1274
+ style?: React$1.CSSProperties;
1275
+ };
1276
+ label?: {
1277
+ ui?: UIProps;
1278
+ style?: React$1.CSSProperties;
1279
+ };
1280
+ delete?: {
1281
+ ui?: UIProps;
1282
+ style?: React$1.CSSProperties;
1283
+ };
1284
+ icon?: IconProps;
1285
+ };
1158
1286
  };
1159
1287
  declare const Chip: React$1.FC<ChipProps>;
1160
1288
 
@@ -1263,11 +1391,13 @@ type Option = {
1263
1391
  value: string;
1264
1392
  };
1265
1393
  type GroupsVariant = 'filled' | 'outlined' | 'text';
1394
+ type GroupsType = 'rounded' | 'square';
1266
1395
  type GroupProps = {
1267
1396
  options: Option[];
1268
1397
  value?: string | string[];
1269
1398
  onChange?: (value: any) => void;
1270
1399
  variant?: GroupsVariant;
1400
+ type?: GroupsType;
1271
1401
  color?: keyof Theme['colors'];
1272
1402
  propsComponent?: {
1273
1403
  group?: {
@@ -1291,12 +1421,10 @@ type ImageProps = {
1291
1421
  };
1292
1422
  declare const Image: React$1.FC<ImageProps>;
1293
1423
 
1294
- type Props = {
1424
+ type ImageDropzoneProps = {
1295
1425
  onChange?: (files: File[]) => void;
1296
1426
  multiple?: boolean;
1297
- ui?: UIProps;
1298
1427
  bordered?: boolean;
1299
- style?: React$1.CSSProperties;
1300
1428
  component?: React$1.ReactNode;
1301
1429
  defaultImage?: string;
1302
1430
  variant?: 'base' | 'outlined';
@@ -1305,9 +1433,21 @@ type Props = {
1305
1433
  text?: Omit<TextProps, 'children' | 'as'> & {
1306
1434
  primary?: string;
1307
1435
  };
1436
+ container?: {
1437
+ ui?: UIProps;
1438
+ style?: React$1.CSSProperties;
1439
+ };
1440
+ preview?: {
1441
+ ui?: UIProps;
1442
+ style?: React$1.CSSProperties;
1443
+ };
1444
+ content?: {
1445
+ ui?: UIProps;
1446
+ style?: React$1.CSSProperties;
1447
+ };
1308
1448
  };
1309
1449
  };
1310
- declare const ImageDropzone: React$1.FC<Props>;
1450
+ declare const ImageDropzone: React$1.FC<ImageDropzoneProps>;
1311
1451
 
1312
1452
  type LabelProps = {
1313
1453
  display?: boolean;
@@ -1323,7 +1463,7 @@ declare const Label: React$1.FC<LabelProps>;
1323
1463
  type InputProps = Omit<React$1.InputHTMLAttributes<HTMLInputElement>, 'onChange'> & {
1324
1464
  label?: string;
1325
1465
  value?: string;
1326
- type?: 'text' | 'email' | 'phone' | 'number' | 'password' | 'search';
1466
+ type?: 'text' | 'email' | 'phone' | 'number' | 'password' | 'search' | 'date';
1327
1467
  variant?: ControlVariants;
1328
1468
  color?: keyof Theme['colors'];
1329
1469
  onChange?: (e: React$1.ChangeEvent<HTMLInputElement>, value: string) => void;
@@ -1340,7 +1480,7 @@ type InputProps = Omit<React$1.InputHTMLAttributes<HTMLInputElement>, 'onChange'
1340
1480
  declare const Input: React$1.ForwardRefExoticComponent<Omit<React$1.InputHTMLAttributes<HTMLInputElement>, "onChange"> & {
1341
1481
  label?: string;
1342
1482
  value?: string;
1343
- type?: "text" | "email" | "phone" | "number" | "password" | "search";
1483
+ type?: "text" | "email" | "phone" | "number" | "password" | "search" | "date";
1344
1484
  variant?: ControlVariants;
1345
1485
  color?: keyof Theme["colors"];
1346
1486
  onChange?: (e: React$1.ChangeEvent<HTMLInputElement>, value: string) => void;
@@ -1355,63 +1495,6 @@ declare const Input: React$1.ForwardRefExoticComponent<Omit<React$1.InputHTMLAtt
1355
1495
  };
1356
1496
  } & React$1.RefAttributes<HTMLInputElement>>;
1357
1497
 
1358
- declare const bem: (block: string) => (element?: string, modifiers?: Record<string, any>) => string;
1359
- declare const bemMerge: (...args: any[]) => string;
1360
-
1361
- type CalendarDayProps = {
1362
- day: number;
1363
- date: Dayjs;
1364
- isToday: boolean;
1365
- isPast: boolean;
1366
- isFuture: boolean;
1367
- isCurrentMonth: boolean;
1368
- selected: any;
1369
- data?: any;
1370
- };
1371
- type CalendarComponentProps = {
1372
- calendar: (CalendarDayProps | null)[][];
1373
- month: number;
1374
- monthLabel: string;
1375
- yearLabel: string;
1376
- daysContainer: number[];
1377
- days: number;
1378
- weeks: number;
1379
- isWeekend: boolean;
1380
- date: Dayjs;
1381
- selected: CalendarDayProps | null;
1382
- currentDay: CalendarDayProps;
1383
- props?: any;
1384
- };
1385
- declare function getMonthCalendar(year: number, month: number, startIndex: number, selected: CalendarDayProps, props?: any): CalendarComponentProps;
1386
-
1387
- declare const adjustColor: (hex: string, amount: number) => string;
1388
- declare const getContrast: (hex: string) => "#000000" | "#ffffff";
1389
- declare const createPaletteColor: (main: string) => PaletteColor;
1390
-
1391
- declare function isEmpty(value: unknown): boolean;
1392
- declare function times<T>(n: number, iteratee: (index: number) => T): T[];
1393
-
1394
- declare const cx: (...args: any[]) => string;
1395
-
1396
- type VariantConfig = {
1397
- base: string;
1398
- variants?: Record<string, Record<string, string>>;
1399
- };
1400
- declare const createVariants: (config: VariantConfig) => (props?: Record<string, any>) => string;
1401
-
1402
- type CountriesDial = {
1403
- code: string;
1404
- dial: string;
1405
- label: string;
1406
- };
1407
- declare const normalizePhone: (phone: string, dial: string) => {
1408
- number: string;
1409
- full: string;
1410
- } | null;
1411
- declare const getDialPhone: (phone: string, countries: CountriesDial[]) => string | null;
1412
- declare const getCountryCodePhone: (phone: string, countries: CountriesDial[]) => string | null;
1413
- declare const getNumberPhone: (phone: string, dial: string) => string;
1414
-
1415
1498
  type InputAreaVariant = 'filled' | 'outlined' | 'base' | 'lined';
1416
1499
  type InputAreaProps = {
1417
1500
  value?: string;
@@ -1435,6 +1518,24 @@ type InputAreaProps = {
1435
1518
  };
1436
1519
  declare const InputArea: React$1.FC<InputAreaProps>;
1437
1520
 
1521
+ type LoaderProps = {
1522
+ component?: React$1.ReactNode;
1523
+ loading?: boolean;
1524
+ propsComponent?: {
1525
+ loader?: {
1526
+ ui?: UIProps;
1527
+ style?: React$1.CSSProperties;
1528
+ };
1529
+ spinner?: {
1530
+ size?: 'sm' | 'md' | 'lg';
1531
+ color?: keyof Theme['colors'];
1532
+ type: 'default' | 'dots' | 'fancy';
1533
+ };
1534
+ container?: Omit<FlexProps, 'children'>;
1535
+ };
1536
+ };
1537
+ declare const Loader: React$1.FC<LoaderProps>;
1538
+
1438
1539
  type ModalContainerProps = {
1439
1540
  children?: React$1.ReactNode;
1440
1541
  size?: 'sm' | 'md' | 'lg';
@@ -1454,34 +1555,6 @@ type ModalProps = {
1454
1555
  };
1455
1556
  declare const Modal: React$1.FC<ModalProps>;
1456
1557
 
1457
- type NotistackAnchorProps = {
1458
- vertical: 'top' | 'bottom';
1459
- horizontal: 'left' | 'center' | 'right';
1460
- };
1461
- type NotistackProps = {
1462
- message: string;
1463
- duration?: number;
1464
- variant?: 'info' | 'success' | 'warning' | 'error';
1465
- color?: keyof Theme['colors'];
1466
- anchor?: NotistackAnchorProps;
1467
- exiting?: boolean;
1468
- propsComponent?: {
1469
- notistack?: {
1470
- ui?: UIProps;
1471
- style?: React.CSSProperties;
1472
- };
1473
- container?: {
1474
- ui?: UIProps;
1475
- style?: React.CSSProperties;
1476
- };
1477
- progress?: {
1478
- ui?: UIProps;
1479
- style?: React.CSSProperties;
1480
- };
1481
- };
1482
- };
1483
- declare const Notistack: React.FC<NotistackProps>;
1484
-
1485
1558
  type PendingProps = {
1486
1559
  variant?: 'rect' | 'circle' | 'text';
1487
1560
  width?: number | string;
@@ -1627,6 +1700,7 @@ type SelectProps = {
1627
1700
  icon?: {
1628
1701
  style?: React$1.CSSProperties;
1629
1702
  component?: React$1.ReactNode;
1703
+ color?: keyof Theme['colors'];
1630
1704
  };
1631
1705
  label?: Omit<LabelProps, 'text'>;
1632
1706
  menu?: {
@@ -1706,4 +1780,4 @@ declare const breakUp: (bp: number) => string;
1706
1780
  declare const breakDown: (bp: number) => string;
1707
1781
  declare function useBreakpoint(queryInput: QueryInput): boolean;
1708
1782
 
1709
- export { Avatar, type AvatarProps, Backdrop, BackdropContext, type BackdropContextType, BackdropProvider, Box, type BoxProps, Button, type ButtonProps, type ButtonVariant, Calendar, type CalendarComponentProps, type CalendarDayProps, type CalendarProps, Checkbox, type CheckboxProps, Chip, type ChipProps, Collapse, type CollapseProps, Container, type ContainerProps, Control, ControlContext, type ControlProps, type ControlVariants, type CountriesDial, Divider, type DividerProps, Drawer, type DrawerProps, Fade, type FadeProps, Flex, type FlexProps, Grid, type GridProps, Group, type GroupProps, type GroupsVariant, IconClose, IconDown, IconSearch, Image, ImageDropzone, type ImageProps, Input, InputArea, type InputAreaProps, type InputAreaVariant, type InputProps, Label, type LabelProps, Modal, ModalContainer, type ModalContainerProps, type ModalProps, Notistack, type NotistackAnchorProps, type NotistackProps, NotistackProvider, type Option, Pending, type PendingProps, Phone, type PhoneInputProps, type PlaceData, PlacesAutocomplete, type PropsPlaces, Radio, type RadioVariant, Select, type SelectChangeEvent, type SelectOptionsProps, type SelectProps, type SelectorChangeEvent, type SelectorProps, Slide, type SlideContentProps, type SlideProps, Switch, type SwitchProps, Text, type TextProps, type TextVariant, type TextWeight, type Theme, ThemeContext, ThemeProvider, type UIProps, adjustColor, applyTheme, baseTokens, bem, bemMerge, breakDown, breakUp, breakpoints, composeStyles, createPaletteColor, createTheme, createVariants, cx, getContrast, getCountryCodePhone, getDialPhone, getMonthCalendar, getNumberPhone, initTheme, isEmpty, normalizePhone, text, times, uiStyle, useBackdrop, useBreakpoint, useBreakpointValue, useClickAway, useControl, useMediaQuery, useNotistack, usePlaces, useTheme };
1783
+ export { Avatar, type AvatarProps, Backdrop, BackdropContext, type BackdropContextType, BackdropProvider, Box, type BoxProps, Button, type ButtonProps, type ButtonVariant, Calendar, type CalendarComponentProps, type CalendarDayProps, type CalendarProps, Checkbox, type CheckboxProps, Chip, type ChipProps, Collapse, type CollapseProps, Container, type ContainerProps, Control, ControlContext, type ControlProps, type ControlVariants, type CountriesDial, Divider, type DividerProps, Drawer, type DrawerProps, Fade, type FadeProps, Flex, type FlexProps, Grid, type GridProps, Group, type GroupProps, type GroupsType, type GroupsVariant, IconClose, IconDown, IconSearch, Image, ImageDropzone, type ImageDropzoneProps, type ImageProps, Input, InputArea, type InputAreaProps, type InputAreaVariant, type InputProps, Label, type LabelProps, Loader, type LoaderProps, Modal, ModalContainer, type ModalContainerProps, type ModalProps, Notistack, type NotistackAnchorProps, NotistackContext, type NotistackContextType, type NotistackProps, NotistackProvider, type Option, Pending, type PendingProps, Phone, type PhoneInputProps, type PlaceData, PlacesAutocomplete, type PropsPlaces, Radio, type RadioVariant, Select, type SelectChangeEvent, type SelectOptionsProps, type SelectProps, type SelectorChangeEvent, type SelectorProps, Slide, type SlideContentProps, type SlideProps, type Snack, Switch, type SwitchProps, Text, type TextProps, type TextVariant, type TextWeight, type Theme, ThemeContext, ThemeProvider, type UIProps, adjustColor, alpha, applyTheme, baseTokens, bem, bemMerge, breakDown, breakUp, breakpoints, composeStyles, createPaletteColor, createTheme, createVariants, cx, darken, getContrast, getCountryCodePhone, getDialPhone, getMonthCalendar, getNumberPhone, hexToRgb, initTheme, isEmpty, lighten, mergeDeep, normalizePhone, rgbToHex, text, times, uiStyle, useBackdrop, useBreakpoint, useBreakpointValue, useClickAway, useControl, useMediaQuery, useNotistack, usePlaces, useTheme };