@yr3/ui 1.0.5 → 1.0.7

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
1
  import * as React$1 from 'react';
2
2
  import { SVGProps, CSSProperties } from 'react';
3
3
  import * as csstype from 'csstype';
4
- import { Place } from '@yr3/autocomplete-places';
4
+ import * as _yr3_autocomplete_places from '@yr3/autocomplete-places';
5
+ import { Place, Provider } from '@yr3/autocomplete-places';
5
6
  import * as react_jsx_runtime from 'react/jsx-runtime';
6
7
  import { Dayjs } from 'dayjs';
7
8
 
@@ -1100,6 +1101,7 @@ type CalendarProps = {
1100
1101
  bordered?: boolean;
1101
1102
  ui?: UIProps;
1102
1103
  style?: React$1.CSSProperties;
1104
+ component?: React$1.ReactNode;
1103
1105
  };
1104
1106
  month?: {
1105
1107
  color?: keyof Theme['colors'];
@@ -1181,6 +1183,7 @@ type ControlProps = {
1181
1183
  variant?: ControlVariants;
1182
1184
  label?: boolean;
1183
1185
  ui?: UIProps;
1186
+ size?: 'auto' | 'full';
1184
1187
  color?: keyof Theme['colors'];
1185
1188
  };
1186
1189
  declare const Control: React$1.FC<ControlProps>;
@@ -1328,6 +1331,7 @@ type InputProps = Omit<React$1.InputHTMLAttributes<HTMLInputElement>, 'onChange'
1328
1331
  ui?: UIProps;
1329
1332
  style?: React$1.CSSProperties;
1330
1333
  propsComponent?: {
1334
+ control?: Omit<ControlProps, 'children'>;
1331
1335
  label?: LabelProps & {
1332
1336
  display?: boolean;
1333
1337
  };
@@ -1344,60 +1348,13 @@ declare const Input: React$1.ForwardRefExoticComponent<Omit<React$1.InputHTMLAtt
1344
1348
  ui?: UIProps;
1345
1349
  style?: React$1.CSSProperties;
1346
1350
  propsComponent?: {
1351
+ control?: Omit<ControlProps, "children">;
1347
1352
  label?: LabelProps & {
1348
1353
  display?: boolean;
1349
1354
  };
1350
1355
  };
1351
1356
  } & React$1.RefAttributes<HTMLInputElement>>;
1352
1357
 
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
1358
  declare const bem: (block: string) => (element?: string, modifiers?: Record<string, any>) => string;
1402
1359
  declare const bemMerge: (...args: any[]) => string;
1403
1360
 
@@ -1442,6 +1399,19 @@ type VariantConfig = {
1442
1399
  };
1443
1400
  declare const createVariants: (config: VariantConfig) => (props?: Record<string, any>) => string;
1444
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
+
1445
1415
  type InputAreaVariant = 'filled' | 'outlined' | 'base' | 'lined';
1446
1416
  type InputAreaProps = {
1447
1417
  value?: string;
@@ -1523,6 +1493,57 @@ type PendingProps = {
1523
1493
  };
1524
1494
  declare const Pending: React.FC<PendingProps>;
1525
1495
 
1496
+ type SelectorChangeEvent = {
1497
+ event: React$1.MouseEvent<HTMLDivElement, MouseEvent>;
1498
+ target: {
1499
+ name?: string;
1500
+ value: string;
1501
+ };
1502
+ currentTarget: {
1503
+ name?: string;
1504
+ value: string;
1505
+ };
1506
+ };
1507
+ type SelectorProps = {
1508
+ children?: React$1.ReactNode;
1509
+ error?: boolean;
1510
+ name?: string;
1511
+ disabled?: boolean;
1512
+ ui?: UIProps;
1513
+ style?: React$1.CSSProperties;
1514
+ options: {
1515
+ value: string;
1516
+ label: string;
1517
+ }[];
1518
+ value?: string;
1519
+ defaultValue?: string;
1520
+ iconColor?: keyof Theme['colors'];
1521
+ icon?: React$1.ReactNode;
1522
+ propsComponent?: {
1523
+ text?: Omit<TextProps, ''>;
1524
+ menu?: {
1525
+ ui?: UIProps;
1526
+ style?: React$1.CSSProperties;
1527
+ };
1528
+ };
1529
+ onChange?: (e: SelectorChangeEvent, value: string) => void;
1530
+ };
1531
+
1532
+ type PhoneInputProps = {
1533
+ name?: string;
1534
+ value?: string;
1535
+ label?: string;
1536
+ defaultValue?: string;
1537
+ onChange?: (e: any, value: string) => void;
1538
+ countries: CountriesDial[];
1539
+ propsComponent?: {
1540
+ divider?: DividerProps;
1541
+ input?: InputProps;
1542
+ selector?: Omit<SelectorProps, 'options'>;
1543
+ };
1544
+ };
1545
+ declare const Phone: React$1.FC<PhoneInputProps>;
1546
+
1526
1547
  interface PlaceData extends Place {
1527
1548
  placeId: string;
1528
1549
  }
@@ -1654,4 +1675,15 @@ declare const IconDown: React.FC<IconProps>;
1654
1675
 
1655
1676
  declare const useClickAway: (ref: any, callback: any) => void;
1656
1677
 
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 };
1678
+ type UsePlacesProps = {
1679
+ apiKey: string;
1680
+ provider?: Provider;
1681
+ language?: string;
1682
+ input: string;
1683
+ };
1684
+ declare const usePlaces: ({ input, language, apiKey, provider }: UsePlacesProps) => {
1685
+ suggestions: _yr3_autocomplete_places.PlaceSuggestion[];
1686
+ selectPlace: (id: string) => Promise<_yr3_autocomplete_places.Place>;
1687
+ };
1688
+
1689
+ 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, usePlaces, useTheme };
package/dist/index.d.ts CHANGED
@@ -1,7 +1,8 @@
1
1
  import * as React$1 from 'react';
2
2
  import { SVGProps, CSSProperties } from 'react';
3
3
  import * as csstype from 'csstype';
4
- import { Place } from '@yr3/autocomplete-places';
4
+ import * as _yr3_autocomplete_places from '@yr3/autocomplete-places';
5
+ import { Place, Provider } from '@yr3/autocomplete-places';
5
6
  import * as react_jsx_runtime from 'react/jsx-runtime';
6
7
  import { Dayjs } from 'dayjs';
7
8
 
@@ -1100,6 +1101,7 @@ type CalendarProps = {
1100
1101
  bordered?: boolean;
1101
1102
  ui?: UIProps;
1102
1103
  style?: React$1.CSSProperties;
1104
+ component?: React$1.ReactNode;
1103
1105
  };
1104
1106
  month?: {
1105
1107
  color?: keyof Theme['colors'];
@@ -1181,6 +1183,7 @@ type ControlProps = {
1181
1183
  variant?: ControlVariants;
1182
1184
  label?: boolean;
1183
1185
  ui?: UIProps;
1186
+ size?: 'auto' | 'full';
1184
1187
  color?: keyof Theme['colors'];
1185
1188
  };
1186
1189
  declare const Control: React$1.FC<ControlProps>;
@@ -1328,6 +1331,7 @@ type InputProps = Omit<React$1.InputHTMLAttributes<HTMLInputElement>, 'onChange'
1328
1331
  ui?: UIProps;
1329
1332
  style?: React$1.CSSProperties;
1330
1333
  propsComponent?: {
1334
+ control?: Omit<ControlProps, 'children'>;
1331
1335
  label?: LabelProps & {
1332
1336
  display?: boolean;
1333
1337
  };
@@ -1344,60 +1348,13 @@ declare const Input: React$1.ForwardRefExoticComponent<Omit<React$1.InputHTMLAtt
1344
1348
  ui?: UIProps;
1345
1349
  style?: React$1.CSSProperties;
1346
1350
  propsComponent?: {
1351
+ control?: Omit<ControlProps, "children">;
1347
1352
  label?: LabelProps & {
1348
1353
  display?: boolean;
1349
1354
  };
1350
1355
  };
1351
1356
  } & React$1.RefAttributes<HTMLInputElement>>;
1352
1357
 
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
1358
  declare const bem: (block: string) => (element?: string, modifiers?: Record<string, any>) => string;
1402
1359
  declare const bemMerge: (...args: any[]) => string;
1403
1360
 
@@ -1442,6 +1399,19 @@ type VariantConfig = {
1442
1399
  };
1443
1400
  declare const createVariants: (config: VariantConfig) => (props?: Record<string, any>) => string;
1444
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
+
1445
1415
  type InputAreaVariant = 'filled' | 'outlined' | 'base' | 'lined';
1446
1416
  type InputAreaProps = {
1447
1417
  value?: string;
@@ -1523,6 +1493,57 @@ type PendingProps = {
1523
1493
  };
1524
1494
  declare const Pending: React.FC<PendingProps>;
1525
1495
 
1496
+ type SelectorChangeEvent = {
1497
+ event: React$1.MouseEvent<HTMLDivElement, MouseEvent>;
1498
+ target: {
1499
+ name?: string;
1500
+ value: string;
1501
+ };
1502
+ currentTarget: {
1503
+ name?: string;
1504
+ value: string;
1505
+ };
1506
+ };
1507
+ type SelectorProps = {
1508
+ children?: React$1.ReactNode;
1509
+ error?: boolean;
1510
+ name?: string;
1511
+ disabled?: boolean;
1512
+ ui?: UIProps;
1513
+ style?: React$1.CSSProperties;
1514
+ options: {
1515
+ value: string;
1516
+ label: string;
1517
+ }[];
1518
+ value?: string;
1519
+ defaultValue?: string;
1520
+ iconColor?: keyof Theme['colors'];
1521
+ icon?: React$1.ReactNode;
1522
+ propsComponent?: {
1523
+ text?: Omit<TextProps, ''>;
1524
+ menu?: {
1525
+ ui?: UIProps;
1526
+ style?: React$1.CSSProperties;
1527
+ };
1528
+ };
1529
+ onChange?: (e: SelectorChangeEvent, value: string) => void;
1530
+ };
1531
+
1532
+ type PhoneInputProps = {
1533
+ name?: string;
1534
+ value?: string;
1535
+ label?: string;
1536
+ defaultValue?: string;
1537
+ onChange?: (e: any, value: string) => void;
1538
+ countries: CountriesDial[];
1539
+ propsComponent?: {
1540
+ divider?: DividerProps;
1541
+ input?: InputProps;
1542
+ selector?: Omit<SelectorProps, 'options'>;
1543
+ };
1544
+ };
1545
+ declare const Phone: React$1.FC<PhoneInputProps>;
1546
+
1526
1547
  interface PlaceData extends Place {
1527
1548
  placeId: string;
1528
1549
  }
@@ -1654,4 +1675,15 @@ declare const IconDown: React.FC<IconProps>;
1654
1675
 
1655
1676
  declare const useClickAway: (ref: any, callback: any) => void;
1656
1677
 
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 };
1678
+ type UsePlacesProps = {
1679
+ apiKey: string;
1680
+ provider?: Provider;
1681
+ language?: string;
1682
+ input: string;
1683
+ };
1684
+ declare const usePlaces: ({ input, language, apiKey, provider }: UsePlacesProps) => {
1685
+ suggestions: _yr3_autocomplete_places.PlaceSuggestion[];
1686
+ selectPlace: (id: string) => Promise<_yr3_autocomplete_places.Place>;
1687
+ };
1688
+
1689
+ 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, usePlaces, useTheme };