@yr3/ui 1.0.5 → 1.0.6

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.cts CHANGED
@@ -1,7 +1,8 @@
1
+ import { Place } from '@yr3/autocomplete-places';
2
+ export * from '@yr3/autocomplete-places';
1
3
  import * as React$1 from 'react';
2
4
  import { SVGProps, CSSProperties } from 'react';
3
5
  import * as csstype from 'csstype';
4
- import { Place } from '@yr3/autocomplete-places';
5
6
  import * as react_jsx_runtime from 'react/jsx-runtime';
6
7
  import { Dayjs } from 'dayjs';
7
8
 
@@ -1350,54 +1351,6 @@ declare const Input: React$1.ForwardRefExoticComponent<Omit<React$1.InputHTMLAtt
1350
1351
  };
1351
1352
  } & React$1.RefAttributes<HTMLInputElement>>;
1352
1353
 
1353
- type SelectorChangeEvent = {
1354
- event: React$1.MouseEvent<HTMLDivElement, MouseEvent>;
1355
- target: {
1356
- name?: string;
1357
- value: string;
1358
- };
1359
- currentTarget: {
1360
- name?: string;
1361
- value: string;
1362
- };
1363
- };
1364
- type SelectorProps = {
1365
- children?: React$1.ReactNode;
1366
- error?: boolean;
1367
- name?: string;
1368
- disabled?: boolean;
1369
- ui?: UIProps;
1370
- style?: React$1.CSSProperties;
1371
- options: {
1372
- value: string;
1373
- label: string;
1374
- }[];
1375
- value?: string;
1376
- defaultValue?: string;
1377
- iconColor?: keyof Theme['colors'];
1378
- icon?: React$1.ReactNode;
1379
- onChange?: (e: SelectorChangeEvent, value: string) => void;
1380
- };
1381
-
1382
- type PhoneInputProps = {
1383
- name?: string;
1384
- value?: number;
1385
- label?: string;
1386
- prefix?: string;
1387
- onChange?: (e: any, value: string) => void;
1388
- countries?: {
1389
- code: string;
1390
- dial: string;
1391
- label: string;
1392
- }[];
1393
- propsComponent?: {
1394
- divider?: DividerProps;
1395
- input?: InputProps;
1396
- selector?: Omit<SelectorProps, 'options'>;
1397
- };
1398
- };
1399
- declare const Phone: React$1.FC<PhoneInputProps>;
1400
-
1401
1354
  declare const bem: (block: string) => (element?: string, modifiers?: Record<string, any>) => string;
1402
1355
  declare const bemMerge: (...args: any[]) => string;
1403
1356
 
@@ -1442,6 +1395,19 @@ type VariantConfig = {
1442
1395
  };
1443
1396
  declare const createVariants: (config: VariantConfig) => (props?: Record<string, any>) => string;
1444
1397
 
1398
+ type CountriesDial = {
1399
+ code: string;
1400
+ dial: string;
1401
+ label: string;
1402
+ };
1403
+ declare const normalizePhone: (phone: string, dial: string) => {
1404
+ number: string;
1405
+ full: string;
1406
+ } | null;
1407
+ declare const getDialPhone: (phone: string, countries: CountriesDial[]) => string | null;
1408
+ declare const getCountryCodePhone: (phone: string, countries: CountriesDial[]) => string | null;
1409
+ declare const getNumberPhone: (phone: string, dial: string) => string;
1410
+
1445
1411
  type InputAreaVariant = 'filled' | 'outlined' | 'base' | 'lined';
1446
1412
  type InputAreaProps = {
1447
1413
  value?: string;
@@ -1523,6 +1489,53 @@ type PendingProps = {
1523
1489
  };
1524
1490
  declare const Pending: React.FC<PendingProps>;
1525
1491
 
1492
+ type SelectorChangeEvent = {
1493
+ event: React$1.MouseEvent<HTMLDivElement, MouseEvent>;
1494
+ target: {
1495
+ name?: string;
1496
+ value: string;
1497
+ };
1498
+ currentTarget: {
1499
+ name?: string;
1500
+ value: string;
1501
+ };
1502
+ };
1503
+ type SelectorProps = {
1504
+ children?: React$1.ReactNode;
1505
+ error?: boolean;
1506
+ name?: string;
1507
+ disabled?: boolean;
1508
+ ui?: UIProps;
1509
+ style?: React$1.CSSProperties;
1510
+ options: {
1511
+ value: string;
1512
+ label: string;
1513
+ }[];
1514
+ value?: string;
1515
+ defaultValue?: string;
1516
+ iconColor?: keyof Theme['colors'];
1517
+ icon?: React$1.ReactNode;
1518
+ propsComponent?: {
1519
+ text?: Omit<TextProps, ''>;
1520
+ };
1521
+ onChange?: (e: SelectorChangeEvent, value: string) => void;
1522
+ };
1523
+
1524
+ type PhoneInputProps = {
1525
+ name?: string;
1526
+ value?: string;
1527
+ label?: string;
1528
+ defaultValue?: string;
1529
+ onChange?: (e: any, value: string) => void;
1530
+ countries: CountriesDial[];
1531
+ propsComponent?: {
1532
+ divider?: DividerProps;
1533
+ input?: InputProps;
1534
+ selector?: Omit<SelectorProps, 'options'>;
1535
+ };
1536
+ };
1537
+ declare const Phone: React$1.FC<PhoneInputProps>;
1538
+
1526
1539
  interface PlaceData extends Place {
1527
1540
  placeId: string;
1528
1541
  }
@@ -1654,4 +1667,4 @@ declare const IconDown: React.FC<IconProps>;
1654
1667
 
1655
1668
  declare const useClickAway: (ref: any, callback: any) => void;
1656
1669
 
1657
- export { Avatar, type AvatarProps, Backdrop, BackdropContext, type BackdropContextType, BackdropProvider, Box, type BoxProps, Button, type ButtonProps, 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, 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 SelectProps, type SelectorChangeEvent, type SelectorProps, Slide, type SlideContentProps, type SlideProps, Switch, Text, type TextProps, type TextVariant, type Theme, ThemeContext, ThemeProvider, type UIProps, adjustColor, applyTheme, baseTokens, bem, bemMerge, breakpoints, composeStyles, createPaletteColor, createTheme, createVariants, cx, getContrast, getMonthCalendar, initTheme, isEmpty, text, times, uiStyle, useBackdrop, useBreakpointValue, useClickAway, useControl, useMediaQuery, useNotistack, useTheme };
1670
+ export { Avatar, type AvatarProps, Backdrop, BackdropContext, type BackdropContextType, BackdropProvider, Box, type BoxProps, Button, type ButtonProps, 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 SelectProps, type SelectorChangeEvent, type SelectorProps, Slide, type SlideContentProps, type SlideProps, Switch, Text, type TextProps, type TextVariant, type Theme, ThemeContext, ThemeProvider, type UIProps, adjustColor, applyTheme, baseTokens, bem, bemMerge, breakpoints, composeStyles, createPaletteColor, createTheme, createVariants, cx, getContrast, getCountryCodePhone, getDialPhone, getMonthCalendar, getNumberPhone, initTheme, isEmpty, normalizePhone, text, times, uiStyle, useBackdrop, useBreakpointValue, useClickAway, useControl, useMediaQuery, useNotistack, useTheme };
package/dist/index.d.ts CHANGED
@@ -1,7 +1,8 @@
1
+ import { Place } from '@yr3/autocomplete-places';
2
+ export * from '@yr3/autocomplete-places';
1
3
  import * as React$1 from 'react';
2
4
  import { SVGProps, CSSProperties } from 'react';
3
5
  import * as csstype from 'csstype';
4
- import { Place } from '@yr3/autocomplete-places';
5
6
  import * as react_jsx_runtime from 'react/jsx-runtime';
6
7
  import { Dayjs } from 'dayjs';
7
8
 
@@ -1350,54 +1351,6 @@ declare const Input: React$1.ForwardRefExoticComponent<Omit<React$1.InputHTMLAtt
1350
1351
  };
1351
1352
  } & React$1.RefAttributes<HTMLInputElement>>;
1352
1353
 
1353
- type SelectorChangeEvent = {
1354
- event: React$1.MouseEvent<HTMLDivElement, MouseEvent>;
1355
- target: {
1356
- name?: string;
1357
- value: string;
1358
- };
1359
- currentTarget: {
1360
- name?: string;
1361
- value: string;
1362
- };
1363
- };
1364
- type SelectorProps = {
1365
- children?: React$1.ReactNode;
1366
- error?: boolean;
1367
- name?: string;
1368
- disabled?: boolean;
1369
- ui?: UIProps;
1370
- style?: React$1.CSSProperties;
1371
- options: {
1372
- value: string;
1373
- label: string;
1374
- }[];
1375
- value?: string;
1376
- defaultValue?: string;
1377
- iconColor?: keyof Theme['colors'];
1378
- icon?: React$1.ReactNode;
1379
- onChange?: (e: SelectorChangeEvent, value: string) => void;
1380
- };
1381
-
1382
- type PhoneInputProps = {
1383
- name?: string;
1384
- value?: number;
1385
- label?: string;
1386
- prefix?: string;
1387
- onChange?: (e: any, value: string) => void;
1388
- countries?: {
1389
- code: string;
1390
- dial: string;
1391
- label: string;
1392
- }[];
1393
- propsComponent?: {
1394
- divider?: DividerProps;
1395
- input?: InputProps;
1396
- selector?: Omit<SelectorProps, 'options'>;
1397
- };
1398
- };
1399
- declare const Phone: React$1.FC<PhoneInputProps>;
1400
-
1401
1354
  declare const bem: (block: string) => (element?: string, modifiers?: Record<string, any>) => string;
1402
1355
  declare const bemMerge: (...args: any[]) => string;
1403
1356
 
@@ -1442,6 +1395,19 @@ type VariantConfig = {
1442
1395
  };
1443
1396
  declare const createVariants: (config: VariantConfig) => (props?: Record<string, any>) => string;
1444
1397
 
1398
+ type CountriesDial = {
1399
+ code: string;
1400
+ dial: string;
1401
+ label: string;
1402
+ };
1403
+ declare const normalizePhone: (phone: string, dial: string) => {
1404
+ number: string;
1405
+ full: string;
1406
+ } | null;
1407
+ declare const getDialPhone: (phone: string, countries: CountriesDial[]) => string | null;
1408
+ declare const getCountryCodePhone: (phone: string, countries: CountriesDial[]) => string | null;
1409
+ declare const getNumberPhone: (phone: string, dial: string) => string;
1410
+
1445
1411
  type InputAreaVariant = 'filled' | 'outlined' | 'base' | 'lined';
1446
1412
  type InputAreaProps = {
1447
1413
  value?: string;
@@ -1523,6 +1489,53 @@ type PendingProps = {
1523
1489
  };
1524
1490
  declare const Pending: React.FC<PendingProps>;
1525
1491
 
1492
+ type SelectorChangeEvent = {
1493
+ event: React$1.MouseEvent<HTMLDivElement, MouseEvent>;
1494
+ target: {
1495
+ name?: string;
1496
+ value: string;
1497
+ };
1498
+ currentTarget: {
1499
+ name?: string;
1500
+ value: string;
1501
+ };
1502
+ };
1503
+ type SelectorProps = {
1504
+ children?: React$1.ReactNode;
1505
+ error?: boolean;
1506
+ name?: string;
1507
+ disabled?: boolean;
1508
+ ui?: UIProps;
1509
+ style?: React$1.CSSProperties;
1510
+ options: {
1511
+ value: string;
1512
+ label: string;
1513
+ }[];
1514
+ value?: string;
1515
+ defaultValue?: string;
1516
+ iconColor?: keyof Theme['colors'];
1517
+ icon?: React$1.ReactNode;
1518
+ propsComponent?: {
1519
+ text?: Omit<TextProps, ''>;
1520
+ };
1521
+ onChange?: (e: SelectorChangeEvent, value: string) => void;
1522
+ };
1523
+
1524
+ type PhoneInputProps = {
1525
+ name?: string;
1526
+ value?: string;
1527
+ label?: string;
1528
+ defaultValue?: string;
1529
+ onChange?: (e: any, value: string) => void;
1530
+ countries: CountriesDial[];
1531
+ propsComponent?: {
1532
+ divider?: DividerProps;
1533
+ input?: InputProps;
1534
+ selector?: Omit<SelectorProps, 'options'>;
1535
+ };
1536
+ };
1537
+ declare const Phone: React$1.FC<PhoneInputProps>;
1538
+
1526
1539
  interface PlaceData extends Place {
1527
1540
  placeId: string;
1528
1541
  }
@@ -1654,4 +1667,4 @@ declare const IconDown: React.FC<IconProps>;
1654
1667
 
1655
1668
  declare const useClickAway: (ref: any, callback: any) => void;
1656
1669
 
1657
- export { Avatar, type AvatarProps, Backdrop, BackdropContext, type BackdropContextType, BackdropProvider, Box, type BoxProps, Button, type ButtonProps, 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, 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 SelectProps, type SelectorChangeEvent, type SelectorProps, Slide, type SlideContentProps, type SlideProps, Switch, Text, type TextProps, type TextVariant, type Theme, ThemeContext, ThemeProvider, type UIProps, adjustColor, applyTheme, baseTokens, bem, bemMerge, breakpoints, composeStyles, createPaletteColor, createTheme, createVariants, cx, getContrast, getMonthCalendar, initTheme, isEmpty, text, times, uiStyle, useBackdrop, useBreakpointValue, useClickAway, useControl, useMediaQuery, useNotistack, useTheme };
1670
+ export { Avatar, type AvatarProps, Backdrop, BackdropContext, type BackdropContextType, BackdropProvider, Box, type BoxProps, Button, type ButtonProps, 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 SelectProps, type SelectorChangeEvent, type SelectorProps, Slide, type SlideContentProps, type SlideProps, Switch, Text, type TextProps, type TextVariant, type Theme, ThemeContext, ThemeProvider, type UIProps, adjustColor, applyTheme, baseTokens, bem, bemMerge, breakpoints, composeStyles, createPaletteColor, createTheme, createVariants, cx, getContrast, getCountryCodePhone, getDialPhone, getMonthCalendar, getNumberPhone, initTheme, isEmpty, normalizePhone, text, times, uiStyle, useBackdrop, useBreakpointValue, useClickAway, useControl, useMediaQuery, useNotistack, useTheme };