@yr3/ui 1.0.4 → 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,3 +1,5 @@
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';
@@ -1349,65 +1351,6 @@ declare const Input: React$1.ForwardRefExoticComponent<Omit<React$1.InputHTMLAtt
1349
1351
  };
1350
1352
  } & React$1.RefAttributes<HTMLInputElement>>;
1351
1353
 
1352
- type SelectorChangeEvent = {
1353
- event: React$1.MouseEvent<HTMLDivElement, MouseEvent>;
1354
- target: {
1355
- name?: string;
1356
- value: string;
1357
- };
1358
- currentTarget: {
1359
- name?: string;
1360
- value: string;
1361
- };
1362
- };
1363
- type SelectorProps = {
1364
- children?: React$1.ReactNode;
1365
- error?: boolean;
1366
- name?: string;
1367
- disabled?: boolean;
1368
- ui?: UIProps;
1369
- style?: React$1.CSSProperties;
1370
- options: {
1371
- value: string;
1372
- label: string;
1373
- }[];
1374
- value?: string;
1375
- defaultValue?: string;
1376
- iconColor?: keyof Theme['colors'];
1377
- icon?: React$1.ReactNode;
1378
- onChange?: (e: SelectorChangeEvent, value: string) => void;
1379
- };
1380
-
1381
- type PhoneInputProps = {
1382
- name?: string;
1383
- value?: number;
1384
- label?: string;
1385
- prefix?: string;
1386
- onChange?: (e: any, value: string) => void;
1387
- countries?: {
1388
- code: string;
1389
- dial: string;
1390
- label: string;
1391
- }[];
1392
- propsComponent?: {
1393
- divider?: DividerProps;
1394
- input?: InputProps;
1395
- selector?: Omit<SelectorProps, 'options'>;
1396
- };
1397
- };
1398
- declare const Phone: React$1.FC<PhoneInputProps>;
1399
-
1400
- type PlaceData = {
1401
- name: string;
1402
- address: string;
1403
- city: string;
1404
- country: string;
1405
- zip: string;
1406
- lat: number;
1407
- lng: number;
1408
- placeId?: string;
1409
- };
1410
-
1411
1354
  declare const bem: (block: string) => (element?: string, modifiers?: Record<string, any>) => string;
1412
1355
  declare const bemMerge: (...args: any[]) => string;
1413
1356
 
@@ -1452,6 +1395,19 @@ type VariantConfig = {
1452
1395
  };
1453
1396
  declare const createVariants: (config: VariantConfig) => (props?: Record<string, any>) => string;
1454
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
+
1455
1411
  type InputAreaVariant = 'filled' | 'outlined' | 'base' | 'lined';
1456
1412
  type InputAreaProps = {
1457
1413
  value?: string;
@@ -1533,6 +1489,78 @@ type PendingProps = {
1533
1489
  };
1534
1490
  declare const Pending: React.FC<PendingProps>;
1535
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
+
1539
+ interface PlaceData extends Place {
1540
+ placeId: string;
1541
+ }
1542
+ type PropsPlaces = {
1543
+ onSelect: (place: PlaceData) => void;
1544
+ onChangeForm?: (e: React$1.ChangeEvent<HTMLInputElement>) => void;
1545
+ language?: string;
1546
+ defaultLocation?: string;
1547
+ propsComponent?: {
1548
+ label?: Omit<LabelProps, 'children'> & {
1549
+ display?: boolean;
1550
+ };
1551
+ control?: Omit<ControlProps, 'children'>;
1552
+ input?: Omit<InputProps, 'onChange' | 'value'>;
1553
+ menu?: {
1554
+ ui?: UIProps;
1555
+ style?: React$1.CSSProperties;
1556
+ text?: Omit<TextProps, 'children'>;
1557
+ };
1558
+ };
1559
+ provider?: 'google' | 'mapbox';
1560
+ keyApi?: string;
1561
+ };
1562
+ declare const PlacesAutocomplete: React$1.FC<PropsPlaces>;
1563
+
1536
1564
  type RadioVariant = 'circle' | 'square';
1537
1565
  type RadioProps = {
1538
1566
  checked?: boolean;
@@ -1639,4 +1667,4 @@ declare const IconDown: React.FC<IconProps>;
1639
1667
 
1640
1668
  declare const useClickAway: (ref: any, callback: any) => void;
1641
1669
 
1642
- 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, 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,3 +1,5 @@
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';
@@ -1349,65 +1351,6 @@ declare const Input: React$1.ForwardRefExoticComponent<Omit<React$1.InputHTMLAtt
1349
1351
  };
1350
1352
  } & React$1.RefAttributes<HTMLInputElement>>;
1351
1353
 
1352
- type SelectorChangeEvent = {
1353
- event: React$1.MouseEvent<HTMLDivElement, MouseEvent>;
1354
- target: {
1355
- name?: string;
1356
- value: string;
1357
- };
1358
- currentTarget: {
1359
- name?: string;
1360
- value: string;
1361
- };
1362
- };
1363
- type SelectorProps = {
1364
- children?: React$1.ReactNode;
1365
- error?: boolean;
1366
- name?: string;
1367
- disabled?: boolean;
1368
- ui?: UIProps;
1369
- style?: React$1.CSSProperties;
1370
- options: {
1371
- value: string;
1372
- label: string;
1373
- }[];
1374
- value?: string;
1375
- defaultValue?: string;
1376
- iconColor?: keyof Theme['colors'];
1377
- icon?: React$1.ReactNode;
1378
- onChange?: (e: SelectorChangeEvent, value: string) => void;
1379
- };
1380
-
1381
- type PhoneInputProps = {
1382
- name?: string;
1383
- value?: number;
1384
- label?: string;
1385
- prefix?: string;
1386
- onChange?: (e: any, value: string) => void;
1387
- countries?: {
1388
- code: string;
1389
- dial: string;
1390
- label: string;
1391
- }[];
1392
- propsComponent?: {
1393
- divider?: DividerProps;
1394
- input?: InputProps;
1395
- selector?: Omit<SelectorProps, 'options'>;
1396
- };
1397
- };
1398
- declare const Phone: React$1.FC<PhoneInputProps>;
1399
-
1400
- type PlaceData = {
1401
- name: string;
1402
- address: string;
1403
- city: string;
1404
- country: string;
1405
- zip: string;
1406
- lat: number;
1407
- lng: number;
1408
- placeId?: string;
1409
- };
1410
-
1411
1354
  declare const bem: (block: string) => (element?: string, modifiers?: Record<string, any>) => string;
1412
1355
  declare const bemMerge: (...args: any[]) => string;
1413
1356
 
@@ -1452,6 +1395,19 @@ type VariantConfig = {
1452
1395
  };
1453
1396
  declare const createVariants: (config: VariantConfig) => (props?: Record<string, any>) => string;
1454
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
+
1455
1411
  type InputAreaVariant = 'filled' | 'outlined' | 'base' | 'lined';
1456
1412
  type InputAreaProps = {
1457
1413
  value?: string;
@@ -1533,6 +1489,78 @@ type PendingProps = {
1533
1489
  };
1534
1490
  declare const Pending: React.FC<PendingProps>;
1535
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
+
1539
+ interface PlaceData extends Place {
1540
+ placeId: string;
1541
+ }
1542
+ type PropsPlaces = {
1543
+ onSelect: (place: PlaceData) => void;
1544
+ onChangeForm?: (e: React$1.ChangeEvent<HTMLInputElement>) => void;
1545
+ language?: string;
1546
+ defaultLocation?: string;
1547
+ propsComponent?: {
1548
+ label?: Omit<LabelProps, 'children'> & {
1549
+ display?: boolean;
1550
+ };
1551
+ control?: Omit<ControlProps, 'children'>;
1552
+ input?: Omit<InputProps, 'onChange' | 'value'>;
1553
+ menu?: {
1554
+ ui?: UIProps;
1555
+ style?: React$1.CSSProperties;
1556
+ text?: Omit<TextProps, 'children'>;
1557
+ };
1558
+ };
1559
+ provider?: 'google' | 'mapbox';
1560
+ keyApi?: string;
1561
+ };
1562
+ declare const PlacesAutocomplete: React$1.FC<PropsPlaces>;
1563
+
1536
1564
  type RadioVariant = 'circle' | 'square';
1537
1565
  type RadioProps = {
1538
1566
  checked?: boolean;
@@ -1639,4 +1667,4 @@ declare const IconDown: React.FC<IconProps>;
1639
1667
 
1640
1668
  declare const useClickAway: (ref: any, callback: any) => void;
1641
1669
 
1642
- 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, 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 };