@yr3/ui 1.0.7 → 1.0.9
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/components/Button/buttons.css +90 -57
- package/dist/components/Button/buttons.css.map +1 -1
- package/dist/components/Select/select.css +18 -23
- package/dist/components/Select/select.css.map +1 -1
- package/dist/components/Switch/switch.css +16 -0
- package/dist/components/Switch/switch.css.map +1 -1
- package/dist/index.cjs +184 -62
- package/dist/index.d.cts +25 -10
- package/dist/index.d.ts +25 -10
- package/dist/index.js +184 -62
- package/dist/styles/index.css +125 -80
- package/dist/styles/index.css.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1012,11 +1012,12 @@ type BoxProps = {
|
|
|
1012
1012
|
declare const Box: React$1.FC<BoxProps>;
|
|
1013
1013
|
|
|
1014
1014
|
type TextVariant = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'title' | 'subtitle' | 'body1' | 'body2' | 'caption' | 'button' | 'helper' | 'inherit' | 'code';
|
|
1015
|
+
type TextWeight = 'light' | 'regular' | 'medium' | 'semibold' | 'bold' | 'black' | 'thin';
|
|
1015
1016
|
type TextProps = {
|
|
1016
1017
|
children?: React$1.ReactNode;
|
|
1017
1018
|
variant?: TextVariant;
|
|
1018
1019
|
color?: keyof Theme['colors'];
|
|
1019
|
-
weight?:
|
|
1020
|
+
weight?: TextWeight;
|
|
1020
1021
|
as?: keyof React$1.JSX.IntrinsicElements;
|
|
1021
1022
|
gutters?: number[];
|
|
1022
1023
|
ui?: UIProps;
|
|
@@ -1025,17 +1026,16 @@ type TextProps = {
|
|
|
1025
1026
|
};
|
|
1026
1027
|
declare const Text: React$1.FC<TextProps>;
|
|
1027
1028
|
|
|
1029
|
+
type ButtonVariant = 'outlined' | 'filled' | 'text';
|
|
1028
1030
|
type ButtonProps = React$1.ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
1029
|
-
variant?:
|
|
1031
|
+
variant?: ButtonVariant;
|
|
1030
1032
|
color?: keyof Theme['colors'];
|
|
1031
1033
|
animated?: boolean;
|
|
1032
1034
|
gradientBorder?: boolean;
|
|
1033
1035
|
ui?: UIProps;
|
|
1034
1036
|
size?: 'auto' | 'full';
|
|
1035
1037
|
propsComponent?: {
|
|
1036
|
-
text?:
|
|
1037
|
-
variant: keyof TextProps['variant'];
|
|
1038
|
-
};
|
|
1038
|
+
text?: Omit<TextProps, 'children'>;
|
|
1039
1039
|
};
|
|
1040
1040
|
};
|
|
1041
1041
|
declare const Button: React$1.FC<ButtonProps>;
|
|
@@ -1594,6 +1594,10 @@ type RadioProps = {
|
|
|
1594
1594
|
};
|
|
1595
1595
|
declare const Radio: React$1.FC<RadioProps>;
|
|
1596
1596
|
|
|
1597
|
+
type SelectOptionsProps = {
|
|
1598
|
+
value: string;
|
|
1599
|
+
label: string;
|
|
1600
|
+
};
|
|
1597
1601
|
type SelectChangeEvent = {
|
|
1598
1602
|
event: React$1.MouseEvent<HTMLDivElement, MouseEvent>;
|
|
1599
1603
|
target: {
|
|
@@ -1611,10 +1615,9 @@ type SelectProps = {
|
|
|
1611
1615
|
label?: string;
|
|
1612
1616
|
name?: string;
|
|
1613
1617
|
disabled?: boolean;
|
|
1614
|
-
options:
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
}[];
|
|
1618
|
+
options: SelectOptionsProps[];
|
|
1619
|
+
variant?: ControlProps['variant'];
|
|
1620
|
+
color?: keyof Theme['colors'];
|
|
1618
1621
|
propsComponent?: {
|
|
1619
1622
|
control?: Omit<ControlProps, 'children'>;
|
|
1620
1623
|
wrapper?: {
|
|
@@ -1629,6 +1632,11 @@ type SelectProps = {
|
|
|
1629
1632
|
menu?: {
|
|
1630
1633
|
ui?: UIProps;
|
|
1631
1634
|
style?: React$1.CSSProperties;
|
|
1635
|
+
options?: {
|
|
1636
|
+
text?: Omit<TextProps, 'children'>;
|
|
1637
|
+
ui?: UIProps;
|
|
1638
|
+
style?: React$1.CSSProperties;
|
|
1639
|
+
};
|
|
1632
1640
|
};
|
|
1633
1641
|
};
|
|
1634
1642
|
value?: string;
|
|
@@ -1664,6 +1672,13 @@ type SwitchProps = {
|
|
|
1664
1672
|
label?: string;
|
|
1665
1673
|
color?: keyof Theme['colors'];
|
|
1666
1674
|
size?: 'sm' | 'md' | 'lg';
|
|
1675
|
+
placement?: 'start' | 'end';
|
|
1676
|
+
propsComponent?: {
|
|
1677
|
+
label: {
|
|
1678
|
+
ui?: UIProps;
|
|
1679
|
+
style?: React$1.CSSProperties;
|
|
1680
|
+
};
|
|
1681
|
+
};
|
|
1667
1682
|
};
|
|
1668
1683
|
declare const Switch: React$1.FC<SwitchProps>;
|
|
1669
1684
|
|
|
@@ -1686,4 +1701,4 @@ declare const usePlaces: ({ input, language, apiKey, provider }: UsePlacesProps)
|
|
|
1686
1701
|
selectPlace: (id: string) => Promise<_yr3_autocomplete_places.Place>;
|
|
1687
1702
|
};
|
|
1688
1703
|
|
|
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 };
|
|
1704
|
+
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, 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
|
@@ -1012,11 +1012,12 @@ type BoxProps = {
|
|
|
1012
1012
|
declare const Box: React$1.FC<BoxProps>;
|
|
1013
1013
|
|
|
1014
1014
|
type TextVariant = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'title' | 'subtitle' | 'body1' | 'body2' | 'caption' | 'button' | 'helper' | 'inherit' | 'code';
|
|
1015
|
+
type TextWeight = 'light' | 'regular' | 'medium' | 'semibold' | 'bold' | 'black' | 'thin';
|
|
1015
1016
|
type TextProps = {
|
|
1016
1017
|
children?: React$1.ReactNode;
|
|
1017
1018
|
variant?: TextVariant;
|
|
1018
1019
|
color?: keyof Theme['colors'];
|
|
1019
|
-
weight?:
|
|
1020
|
+
weight?: TextWeight;
|
|
1020
1021
|
as?: keyof React$1.JSX.IntrinsicElements;
|
|
1021
1022
|
gutters?: number[];
|
|
1022
1023
|
ui?: UIProps;
|
|
@@ -1025,17 +1026,16 @@ type TextProps = {
|
|
|
1025
1026
|
};
|
|
1026
1027
|
declare const Text: React$1.FC<TextProps>;
|
|
1027
1028
|
|
|
1029
|
+
type ButtonVariant = 'outlined' | 'filled' | 'text';
|
|
1028
1030
|
type ButtonProps = React$1.ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
1029
|
-
variant?:
|
|
1031
|
+
variant?: ButtonVariant;
|
|
1030
1032
|
color?: keyof Theme['colors'];
|
|
1031
1033
|
animated?: boolean;
|
|
1032
1034
|
gradientBorder?: boolean;
|
|
1033
1035
|
ui?: UIProps;
|
|
1034
1036
|
size?: 'auto' | 'full';
|
|
1035
1037
|
propsComponent?: {
|
|
1036
|
-
text?:
|
|
1037
|
-
variant: keyof TextProps['variant'];
|
|
1038
|
-
};
|
|
1038
|
+
text?: Omit<TextProps, 'children'>;
|
|
1039
1039
|
};
|
|
1040
1040
|
};
|
|
1041
1041
|
declare const Button: React$1.FC<ButtonProps>;
|
|
@@ -1594,6 +1594,10 @@ type RadioProps = {
|
|
|
1594
1594
|
};
|
|
1595
1595
|
declare const Radio: React$1.FC<RadioProps>;
|
|
1596
1596
|
|
|
1597
|
+
type SelectOptionsProps = {
|
|
1598
|
+
value: string;
|
|
1599
|
+
label: string;
|
|
1600
|
+
};
|
|
1597
1601
|
type SelectChangeEvent = {
|
|
1598
1602
|
event: React$1.MouseEvent<HTMLDivElement, MouseEvent>;
|
|
1599
1603
|
target: {
|
|
@@ -1611,10 +1615,9 @@ type SelectProps = {
|
|
|
1611
1615
|
label?: string;
|
|
1612
1616
|
name?: string;
|
|
1613
1617
|
disabled?: boolean;
|
|
1614
|
-
options:
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
}[];
|
|
1618
|
+
options: SelectOptionsProps[];
|
|
1619
|
+
variant?: ControlProps['variant'];
|
|
1620
|
+
color?: keyof Theme['colors'];
|
|
1618
1621
|
propsComponent?: {
|
|
1619
1622
|
control?: Omit<ControlProps, 'children'>;
|
|
1620
1623
|
wrapper?: {
|
|
@@ -1629,6 +1632,11 @@ type SelectProps = {
|
|
|
1629
1632
|
menu?: {
|
|
1630
1633
|
ui?: UIProps;
|
|
1631
1634
|
style?: React$1.CSSProperties;
|
|
1635
|
+
options?: {
|
|
1636
|
+
text?: Omit<TextProps, 'children'>;
|
|
1637
|
+
ui?: UIProps;
|
|
1638
|
+
style?: React$1.CSSProperties;
|
|
1639
|
+
};
|
|
1632
1640
|
};
|
|
1633
1641
|
};
|
|
1634
1642
|
value?: string;
|
|
@@ -1664,6 +1672,13 @@ type SwitchProps = {
|
|
|
1664
1672
|
label?: string;
|
|
1665
1673
|
color?: keyof Theme['colors'];
|
|
1666
1674
|
size?: 'sm' | 'md' | 'lg';
|
|
1675
|
+
placement?: 'start' | 'end';
|
|
1676
|
+
propsComponent?: {
|
|
1677
|
+
label: {
|
|
1678
|
+
ui?: UIProps;
|
|
1679
|
+
style?: React$1.CSSProperties;
|
|
1680
|
+
};
|
|
1681
|
+
};
|
|
1667
1682
|
};
|
|
1668
1683
|
declare const Switch: React$1.FC<SwitchProps>;
|
|
1669
1684
|
|
|
@@ -1686,4 +1701,4 @@ declare const usePlaces: ({ input, language, apiKey, provider }: UsePlacesProps)
|
|
|
1686
1701
|
selectPlace: (id: string) => Promise<_yr3_autocomplete_places.Place>;
|
|
1687
1702
|
};
|
|
1688
1703
|
|
|
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 };
|
|
1704
|
+
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, 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.js
CHANGED
|
@@ -606,6 +606,42 @@ var Box = ({
|
|
|
606
606
|
);
|
|
607
607
|
};
|
|
608
608
|
|
|
609
|
+
// src/components/Text/text.variants.ts
|
|
610
|
+
var textVariants = createVariants({
|
|
611
|
+
base: "yr3Text",
|
|
612
|
+
variants: {
|
|
613
|
+
variant: {
|
|
614
|
+
h1: "yr3Text--h1",
|
|
615
|
+
h2: "yr3Text--h2",
|
|
616
|
+
h3: "yr3Text--h3",
|
|
617
|
+
h4: "yr3Text--h4",
|
|
618
|
+
h5: "yr3Text--h5",
|
|
619
|
+
h6: "yr3Text--h6",
|
|
620
|
+
title: "yr3Text--title",
|
|
621
|
+
subtitle: "yr3Text--subtitle",
|
|
622
|
+
body1: "yr3Text--body1",
|
|
623
|
+
body2: "yr3Text--body2",
|
|
624
|
+
helper: "yr3Text--helper",
|
|
625
|
+
inherit: "yr3Text--inherit",
|
|
626
|
+
caption: "yr3Text--caption",
|
|
627
|
+
button: "yr3Text--button",
|
|
628
|
+
code: "yr3Text--code"
|
|
629
|
+
},
|
|
630
|
+
color: {
|
|
631
|
+
primary: "yr3Text--color-primary",
|
|
632
|
+
secondary: "yr3Text--color-secondary",
|
|
633
|
+
success: "yr3Text--color-success",
|
|
634
|
+
text: "yr3Text--color-text",
|
|
635
|
+
disabled: "yr3Text--color-disabled",
|
|
636
|
+
warning: "yr3Text--color-warning",
|
|
637
|
+
error: "yr3Text--color-error",
|
|
638
|
+
info: "yr3Text--color-info",
|
|
639
|
+
background: "yr3Text--color-background"
|
|
640
|
+
}
|
|
641
|
+
}
|
|
642
|
+
});
|
|
643
|
+
var text_variants_default = textVariants;
|
|
644
|
+
|
|
609
645
|
// src/components/Text/Text.tsx
|
|
610
646
|
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
611
647
|
var Text = ({
|
|
@@ -620,16 +656,11 @@ var Text = ({
|
|
|
620
656
|
onClick
|
|
621
657
|
}) => {
|
|
622
658
|
const styleUI = uiStyle({ ...ui, marginTop: gutters[0] || 0, marginBottom: gutters[1] || 0 });
|
|
659
|
+
const classes = text_variants_default({ variant, color, weight });
|
|
623
660
|
return /* @__PURE__ */ jsx5(
|
|
624
661
|
Component,
|
|
625
662
|
{
|
|
626
|
-
className:
|
|
627
|
-
yr3Text
|
|
628
|
-
yr3Text--${variant}
|
|
629
|
-
yr3Text--${color}
|
|
630
|
-
${weight ? `yr3Text--${weight}` : ""}
|
|
631
|
-
|
|
632
|
-
`,
|
|
663
|
+
className: classes,
|
|
633
664
|
style: composeStyles(styleUI, style),
|
|
634
665
|
onClick,
|
|
635
666
|
"data-testid": "yr3Text",
|
|
@@ -652,7 +683,11 @@ var buttonVariant = createVariants({
|
|
|
652
683
|
secondary: "yr3Button--color-secondary",
|
|
653
684
|
success: "yr3Button--color-success",
|
|
654
685
|
text: "yr3Button--color-text",
|
|
655
|
-
disabled: "yr3Button--color-disabled"
|
|
686
|
+
disabled: "yr3Button--color-disabled",
|
|
687
|
+
info: "yr3Button--color-info",
|
|
688
|
+
error: "yr3Button--color-error",
|
|
689
|
+
background: "yr3Button--color-background",
|
|
690
|
+
warning: "yr3Button--color-warning"
|
|
656
691
|
},
|
|
657
692
|
size: {
|
|
658
693
|
auto: "yr3Button--size-auto",
|
|
@@ -682,7 +717,7 @@ var Button = ({ children, color = "text", variant = "text", animated, disabled,
|
|
|
682
717
|
"data-testid": "yr3Button",
|
|
683
718
|
...props,
|
|
684
719
|
style: composeStyles(ui, style),
|
|
685
|
-
children: /* @__PURE__ */ jsx6(Text, { variant: propsComponent?.text?.variant || "button", children })
|
|
720
|
+
children: /* @__PURE__ */ jsx6(Text, { variant: propsComponent?.text?.variant || "button", ...propsComponent?.text, children })
|
|
686
721
|
}
|
|
687
722
|
);
|
|
688
723
|
};
|
|
@@ -2160,67 +2195,140 @@ var Radio = ({
|
|
|
2160
2195
|
|
|
2161
2196
|
// src/components/Select/Select.tsx
|
|
2162
2197
|
import * as React18 from "react";
|
|
2198
|
+
|
|
2199
|
+
// src/components/Select/select.variants.ts
|
|
2200
|
+
var selectVariants = createVariants({
|
|
2201
|
+
base: "yr3Select",
|
|
2202
|
+
variants: {
|
|
2203
|
+
wrapper: {
|
|
2204
|
+
true: "yr3Select--wrapper"
|
|
2205
|
+
},
|
|
2206
|
+
variant: {
|
|
2207
|
+
filled: "yr3Select--filled",
|
|
2208
|
+
outlined: "yr3Select--outlined",
|
|
2209
|
+
base: "yr3Select--base",
|
|
2210
|
+
lined: "yr3Select--lined"
|
|
2211
|
+
},
|
|
2212
|
+
color: {
|
|
2213
|
+
primary: "yr3Select--color-primary",
|
|
2214
|
+
secondary: "yr3Select--color-secondary",
|
|
2215
|
+
success: "yr3Select--color-success",
|
|
2216
|
+
text: "yr3Select--color-text",
|
|
2217
|
+
disabled: "yr3Select--color-disabled",
|
|
2218
|
+
background: "yr3Select--color-background",
|
|
2219
|
+
error: "yr3Select--color-error",
|
|
2220
|
+
warning: "yr3Select--color-warning",
|
|
2221
|
+
info: "yr3Select--color-info"
|
|
2222
|
+
},
|
|
2223
|
+
animated: {
|
|
2224
|
+
true: "yr3Select--animated"
|
|
2225
|
+
}
|
|
2226
|
+
}
|
|
2227
|
+
});
|
|
2228
|
+
var select_variants_default = selectVariants;
|
|
2229
|
+
|
|
2230
|
+
// src/components/Select/Select.tsx
|
|
2163
2231
|
import { jsx as jsx35, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
2164
|
-
var
|
|
2232
|
+
var initiaPropsComponent3 = {
|
|
2233
|
+
control: {
|
|
2234
|
+
variant: "outlined",
|
|
2235
|
+
color: "primary",
|
|
2236
|
+
ui: {},
|
|
2237
|
+
style: {}
|
|
2238
|
+
},
|
|
2239
|
+
label: {
|
|
2240
|
+
display: true,
|
|
2241
|
+
ui: {},
|
|
2242
|
+
style: {}
|
|
2243
|
+
},
|
|
2244
|
+
wrapper: {
|
|
2245
|
+
ui: {},
|
|
2246
|
+
style: {}
|
|
2247
|
+
},
|
|
2248
|
+
menu: {
|
|
2249
|
+
ui: {},
|
|
2250
|
+
style: {},
|
|
2251
|
+
options: {
|
|
2252
|
+
text: {
|
|
2253
|
+
variant: "caption",
|
|
2254
|
+
color: "primary"
|
|
2255
|
+
},
|
|
2256
|
+
ui: {},
|
|
2257
|
+
style: {}
|
|
2258
|
+
}
|
|
2259
|
+
},
|
|
2260
|
+
icon: {
|
|
2261
|
+
style: {
|
|
2262
|
+
width: 24,
|
|
2263
|
+
height: 24,
|
|
2264
|
+
stroke: "currentColor"
|
|
2265
|
+
},
|
|
2266
|
+
component: void 0
|
|
2267
|
+
}
|
|
2268
|
+
};
|
|
2269
|
+
var Select = ({ label, options, name, value, defaultValue, onChange, propsComponent = initiaPropsComponent3 }) => {
|
|
2165
2270
|
const [open, setOpen] = React18.useState(false);
|
|
2166
2271
|
const [valueState, setValueState] = React18.useState(value || defaultValue || null);
|
|
2167
2272
|
const ref = React18.useRef(null);
|
|
2168
2273
|
useClickAway(ref, () => setOpen(false));
|
|
2169
|
-
|
|
2274
|
+
const classes = select_variants_default({ wrapper: true });
|
|
2275
|
+
return /* @__PURE__ */ jsxs14("div", { className: classes, ref, children: [
|
|
2170
2276
|
/* @__PURE__ */ jsx35(
|
|
2171
|
-
|
|
2277
|
+
Input,
|
|
2172
2278
|
{
|
|
2173
|
-
|
|
2174
|
-
|
|
2279
|
+
label,
|
|
2280
|
+
variant: "base",
|
|
2281
|
+
disabled: true,
|
|
2282
|
+
value: valueState,
|
|
2283
|
+
propsComponent: {
|
|
2284
|
+
control: propsComponent?.control,
|
|
2285
|
+
label: propsComponent?.label
|
|
2286
|
+
}
|
|
2175
2287
|
}
|
|
2176
2288
|
),
|
|
2177
|
-
/* @__PURE__ */
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2289
|
+
/* @__PURE__ */ jsx35("div", { className: `yr3Select--icon ${open ? "yr3Select--icon--open" : ""}`, onClick: () => setOpen((prev) => !prev), "data-testid": "yr3Select-icon", children: propsComponent?.icon?.component ? propsComponent.icon.component : /* @__PURE__ */ jsx35(
|
|
2290
|
+
IconDown,
|
|
2291
|
+
{
|
|
2292
|
+
width: propsComponent?.icon?.style?.width,
|
|
2293
|
+
height: propsComponent?.icon?.style?.height,
|
|
2294
|
+
stroke: propsComponent?.icon?.style?.stroke || "currentColor",
|
|
2295
|
+
style: propsComponent?.icon?.style
|
|
2296
|
+
}
|
|
2297
|
+
) }),
|
|
2298
|
+
open && /* @__PURE__ */ jsx35(
|
|
2299
|
+
"div",
|
|
2300
|
+
{
|
|
2301
|
+
className: "yr3Select--menu",
|
|
2302
|
+
style: composeStyles(propsComponent?.menu?.ui, propsComponent?.menu?.style),
|
|
2303
|
+
"data-testid": "yr3Select-menu",
|
|
2304
|
+
children: options.map((opt) => /* @__PURE__ */ jsx35(
|
|
2305
|
+
"div",
|
|
2182
2306
|
{
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
onClick: (e) => {
|
|
2201
|
-
e.stopPropagation();
|
|
2202
|
-
setValueState(opt.value);
|
|
2203
|
-
setOpen(false);
|
|
2204
|
-
const event = {
|
|
2205
|
-
event: e,
|
|
2206
|
-
target: {
|
|
2207
|
-
name,
|
|
2208
|
-
value: opt.value
|
|
2209
|
-
},
|
|
2210
|
-
currentTarget: {
|
|
2211
|
-
name,
|
|
2212
|
-
value: opt.value
|
|
2213
|
-
}
|
|
2214
|
-
};
|
|
2215
|
-
onChange?.(event, opt.value);
|
|
2216
|
-
},
|
|
2217
|
-
children: opt.label
|
|
2307
|
+
className: "yr3Select--option",
|
|
2308
|
+
onClick: (e) => {
|
|
2309
|
+
e.stopPropagation();
|
|
2310
|
+
setValueState(opt.value);
|
|
2311
|
+
setOpen(false);
|
|
2312
|
+
const event = {
|
|
2313
|
+
event: e,
|
|
2314
|
+
target: {
|
|
2315
|
+
name,
|
|
2316
|
+
value: opt.value
|
|
2317
|
+
},
|
|
2318
|
+
currentTarget: {
|
|
2319
|
+
name,
|
|
2320
|
+
value: opt.value
|
|
2321
|
+
}
|
|
2322
|
+
};
|
|
2323
|
+
onChange?.(event, opt.value);
|
|
2218
2324
|
},
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
-
|
|
2222
|
-
|
|
2223
|
-
|
|
2325
|
+
style: composeStyles(propsComponent?.menu?.options?.ui, propsComponent?.menu?.options?.style),
|
|
2326
|
+
children: /* @__PURE__ */ jsx35(Text, { as: "span", variant: "caption", color: propsComponent?.menu?.options?.text?.color || "primary", ...propsComponent?.menu?.options?.text, children: opt.label })
|
|
2327
|
+
},
|
|
2328
|
+
opt.value
|
|
2329
|
+
))
|
|
2330
|
+
}
|
|
2331
|
+
)
|
|
2224
2332
|
] });
|
|
2225
2333
|
};
|
|
2226
2334
|
|
|
@@ -2294,6 +2402,10 @@ var switchVariants = createVariants({
|
|
|
2294
2402
|
},
|
|
2295
2403
|
checked: {
|
|
2296
2404
|
true: "yr3Switch--checked"
|
|
2405
|
+
},
|
|
2406
|
+
placement: {
|
|
2407
|
+
start: "yr3Switch--label-start",
|
|
2408
|
+
end: "yr3Switch--label-end"
|
|
2297
2409
|
}
|
|
2298
2410
|
}
|
|
2299
2411
|
});
|
|
@@ -2307,10 +2419,12 @@ var Switch = ({
|
|
|
2307
2419
|
disabled,
|
|
2308
2420
|
color = "primary",
|
|
2309
2421
|
size = "sm",
|
|
2310
|
-
label
|
|
2422
|
+
label,
|
|
2423
|
+
placement = "end",
|
|
2424
|
+
propsComponent
|
|
2311
2425
|
}) => {
|
|
2312
2426
|
const [internal, setInternal] = React20.useState(defaultChecked || false);
|
|
2313
|
-
const classname = switchVariants({ colors: color, size, disabled: !!disabled, checked: checked ?? internal });
|
|
2427
|
+
const classname = switchVariants({ colors: color, size, disabled: !!disabled, checked: checked ?? internal, placement });
|
|
2314
2428
|
const isControlled = checked !== void 0;
|
|
2315
2429
|
const value = isControlled ? checked : internal;
|
|
2316
2430
|
const handleChange = (e) => {
|
|
@@ -2333,7 +2447,15 @@ var Switch = ({
|
|
|
2333
2447
|
}
|
|
2334
2448
|
),
|
|
2335
2449
|
/* @__PURE__ */ jsx37("span", { className: "yr3Switch--track", children: /* @__PURE__ */ jsx37("span", { className: "yr3Switch--thumb" }) }),
|
|
2336
|
-
/* @__PURE__ */ jsx37(
|
|
2450
|
+
/* @__PURE__ */ jsx37(
|
|
2451
|
+
"span",
|
|
2452
|
+
{
|
|
2453
|
+
className: "yr3Switch--label",
|
|
2454
|
+
"data-testid": "yr3Switch-label",
|
|
2455
|
+
style: composeStyles(propsComponent?.label.ui, propsComponent?.label?.style),
|
|
2456
|
+
children: label
|
|
2457
|
+
}
|
|
2458
|
+
)
|
|
2337
2459
|
]
|
|
2338
2460
|
}
|
|
2339
2461
|
);
|