@lets-events/react 12.3.9 → 12.4.1
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/.turbo/turbo-build.log +9 -9
- package/CHANGELOG.md +18 -0
- package/dist/index.d.mts +35 -3
- package/dist/index.d.ts +35 -3
- package/dist/index.js +564 -345
- package/dist/index.mjs +537 -320
- package/package.json +1 -1
- package/src/components/Calendar/styledComponents.ts +18 -9
- package/src/components/DoubleCalendar/index.tsx +166 -0
- package/src/components/Drawer/index.tsx +1 -0
- package/src/components/FormFields/DoubleCalendarFormField.tsx +90 -0
- package/src/components/FormFields/TextAreaFormField.tsx +2 -0
- package/src/components/TextareaField.tsx +35 -24
- package/src/index.tsx +2 -0
- package/dist/index.css +0 -171
package/package.json
CHANGED
|
@@ -76,7 +76,8 @@ export const CalendarFooterStyled = styled("div", {
|
|
|
76
76
|
borderTop: "2px solid $neutral100",
|
|
77
77
|
padding: "$4 $16",
|
|
78
78
|
display: "flex",
|
|
79
|
-
|
|
79
|
+
gap: '1rem',
|
|
80
|
+
justifyContent: "flex-end",
|
|
80
81
|
alignItems: "center",
|
|
81
82
|
height: "3rem",
|
|
82
83
|
});
|
|
@@ -88,7 +89,7 @@ export const DayPickerWrapperStyled = styled("div", {
|
|
|
88
89
|
color: "$dark500",
|
|
89
90
|
},
|
|
90
91
|
".rdp-root": {
|
|
91
|
-
padding: "$8",
|
|
92
|
+
padding: "0 $8",
|
|
92
93
|
},
|
|
93
94
|
".rdp-today .rdp-day_button": {
|
|
94
95
|
color: "$brand500",
|
|
@@ -98,8 +99,8 @@ export const DayPickerWrapperStyled = styled("div", {
|
|
|
98
99
|
color: "$dark400",
|
|
99
100
|
},
|
|
100
101
|
".rdp-day_button": {
|
|
101
|
-
height: "
|
|
102
|
-
width: "
|
|
102
|
+
height: "28px",
|
|
103
|
+
width: "28px",
|
|
103
104
|
borderRadius: "$sm",
|
|
104
105
|
fontSize: "$14",
|
|
105
106
|
color: "$text",
|
|
@@ -117,9 +118,10 @@ export const DayPickerWrapperStyled = styled("div", {
|
|
|
117
118
|
borderColor: "transparent",
|
|
118
119
|
},
|
|
119
120
|
".rdp-nav": {
|
|
121
|
+
position: "absolute",
|
|
122
|
+
width: "98%",
|
|
120
123
|
display: "flex",
|
|
121
124
|
justifyContent: "space-between",
|
|
122
|
-
width: "100%",
|
|
123
125
|
},
|
|
124
126
|
".rdp-nav .rdp-chevron": {
|
|
125
127
|
display: "none",
|
|
@@ -159,8 +161,15 @@ export const DayPickerWrapperStyled = styled("div", {
|
|
|
159
161
|
backgroundColor: "transparent",
|
|
160
162
|
cursor: "pointer",
|
|
161
163
|
},
|
|
164
|
+
".rdp-months": {
|
|
165
|
+
display: "flex",
|
|
166
|
+
columnGap: "$16",
|
|
167
|
+
alignItems: "flex-start",
|
|
168
|
+
paddingTop: "$12",
|
|
169
|
+
},
|
|
162
170
|
".rdp-month": {
|
|
163
|
-
marginTop: "
|
|
171
|
+
marginTop: "0",
|
|
172
|
+
paddingTop: "$6",
|
|
164
173
|
},
|
|
165
174
|
".rdp-month_caption": {
|
|
166
175
|
display: "flex",
|
|
@@ -212,9 +221,9 @@ export const DayPickerWrapperStyled = styled("div", {
|
|
|
212
221
|
boxShadow: "none",
|
|
213
222
|
},
|
|
214
223
|
".rdp-dropdown.rdp-months_dropdown:focus, .rdp-dropdown.rdp-years_dropdown:focus":
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
224
|
+
{
|
|
225
|
+
border: "none",
|
|
226
|
+
},
|
|
218
227
|
".rdp-dropdown_root": {
|
|
219
228
|
position: "relative",
|
|
220
229
|
},
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
import React, { ComponentProps, useRef, useEffect, useState } from "react";
|
|
2
|
+
import { useOnClickOutside } from "../../hooks/useOnClickOutside";
|
|
3
|
+
import { DayPicker } from "react-day-picker";
|
|
4
|
+
import { ptBR } from "date-fns/locale";
|
|
5
|
+
import { format, addYears } from "date-fns";
|
|
6
|
+
import { Button } from "../Button";
|
|
7
|
+
import { Box } from "../Box";
|
|
8
|
+
import { TextField, TextFieldSlot } from "../TextField";
|
|
9
|
+
import Icon from "../Icon";
|
|
10
|
+
import {
|
|
11
|
+
CalendarContentStyled,
|
|
12
|
+
CalendarFooterStyled,
|
|
13
|
+
CalendarStyled,
|
|
14
|
+
DayPickerWrapperStyled,
|
|
15
|
+
CalendarButtonStyled,
|
|
16
|
+
} from "../Calendar/styledComponents";
|
|
17
|
+
|
|
18
|
+
export type DateRange = { from?: Date; to?: Date } | undefined;
|
|
19
|
+
|
|
20
|
+
export type DoubleCalendarProps = ComponentProps<typeof CalendarStyled> & {
|
|
21
|
+
calendarLayout?: "label" | "dropdown" | "dropdown-months" | "dropdown-years";
|
|
22
|
+
selected: DateRange;
|
|
23
|
+
setSelected: React.Dispatch<React.SetStateAction<DateRange>>;
|
|
24
|
+
position?: "top" | "bottom" | "top-right" | "bottom-right";
|
|
25
|
+
action?: boolean;
|
|
26
|
+
actionText?: string;
|
|
27
|
+
hasError?: boolean;
|
|
28
|
+
expand?: boolean;
|
|
29
|
+
allowPastDates?: boolean;
|
|
30
|
+
maxYearsFromNow?: number;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export function DoubleCalendar({
|
|
34
|
+
action,
|
|
35
|
+
actionText,
|
|
36
|
+
calendarLayout,
|
|
37
|
+
selected,
|
|
38
|
+
setSelected,
|
|
39
|
+
position = "bottom",
|
|
40
|
+
hasError,
|
|
41
|
+
expand,
|
|
42
|
+
allowPastDates = false,
|
|
43
|
+
maxYearsFromNow = 20,
|
|
44
|
+
...props
|
|
45
|
+
}: DoubleCalendarProps) {
|
|
46
|
+
const [startValue, setStartValue] = useState("");
|
|
47
|
+
const [endValue, setEndValue] = useState("");
|
|
48
|
+
const [showContainer, setShowCalendar] = useState(false);
|
|
49
|
+
const initialSelectedRef = useRef<DateRange | undefined>(undefined);
|
|
50
|
+
|
|
51
|
+
const dropdownRef = useRef<HTMLDivElement>(null);
|
|
52
|
+
|
|
53
|
+
useOnClickOutside(dropdownRef, () => {
|
|
54
|
+
setShowCalendar(false);
|
|
55
|
+
});
|
|
56
|
+
const today = new Date();
|
|
57
|
+
const maxDate = addYears(today, maxYearsFromNow);
|
|
58
|
+
|
|
59
|
+
useEffect(() => {
|
|
60
|
+
if (selected && selected.from) {
|
|
61
|
+
setStartValue(format(selected.from, "dd/MM/yyyy"));
|
|
62
|
+
} else {
|
|
63
|
+
setStartValue("");
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
if (selected && selected.to) {
|
|
67
|
+
setEndValue(format(selected.to, "dd/MM/yyyy"));
|
|
68
|
+
} else {
|
|
69
|
+
setEndValue("");
|
|
70
|
+
}
|
|
71
|
+
}, [selected]);
|
|
72
|
+
|
|
73
|
+
return (
|
|
74
|
+
<div>
|
|
75
|
+
<CalendarStyled {...props} expand={expand} ref={dropdownRef}>
|
|
76
|
+
<CalendarButtonStyled
|
|
77
|
+
expand={expand}
|
|
78
|
+
type="button"
|
|
79
|
+
onClick={() =>
|
|
80
|
+
setShowCalendar((prev) => {
|
|
81
|
+
const next = !prev;
|
|
82
|
+
if (!prev) initialSelectedRef.current = selected;
|
|
83
|
+
return next;
|
|
84
|
+
})
|
|
85
|
+
}
|
|
86
|
+
>
|
|
87
|
+
<div style={{ display: "flex", gap: "8px", width: "100%" }}>
|
|
88
|
+
<TextField
|
|
89
|
+
placeholder="00/00/0000 - 00/00/0000"
|
|
90
|
+
type="text"
|
|
91
|
+
value={`${startValue || "00/00/0000"} - ${endValue || "00/00/0000"}`}
|
|
92
|
+
readOnly
|
|
93
|
+
inputMode="numeric"
|
|
94
|
+
textAlign={"right"}
|
|
95
|
+
color={hasError ? "error" : "default"}
|
|
96
|
+
>
|
|
97
|
+
<TextFieldSlot>
|
|
98
|
+
<Icon name="calendar" size={"xl"} />
|
|
99
|
+
</TextFieldSlot>
|
|
100
|
+
</TextField>
|
|
101
|
+
</div>
|
|
102
|
+
</CalendarButtonStyled>
|
|
103
|
+
|
|
104
|
+
{showContainer && (
|
|
105
|
+
<CalendarContentStyled position={position}>
|
|
106
|
+
<Box>
|
|
107
|
+
<DayPickerWrapperStyled>
|
|
108
|
+
<DayPicker
|
|
109
|
+
mode="range"
|
|
110
|
+
numberOfMonths={2}
|
|
111
|
+
captionLayout={calendarLayout}
|
|
112
|
+
selected={selected as any}
|
|
113
|
+
onSelect={setSelected}
|
|
114
|
+
required
|
|
115
|
+
locale={ptBR}
|
|
116
|
+
disabled={allowPastDates ? undefined : { before: today }}
|
|
117
|
+
fromMonth={allowPastDates ? undefined : today}
|
|
118
|
+
toMonth={maxDate}
|
|
119
|
+
/>
|
|
120
|
+
</DayPickerWrapperStyled>
|
|
121
|
+
</Box>
|
|
122
|
+
|
|
123
|
+
{action && (
|
|
124
|
+
<CalendarFooterStyled>
|
|
125
|
+
<div style={{ textAlign: "center", padding: "1rem" }}>
|
|
126
|
+
<span>
|
|
127
|
+
{`${selected?.from ? format(selected.from, "dd/MM/yyyy") : "00/00/0000"} — ${selected?.to ? format(selected.to, "dd/MM/yyyy") : "00/00/0000"}`}
|
|
128
|
+
</span>
|
|
129
|
+
</div>
|
|
130
|
+
<Button
|
|
131
|
+
style={{ margin: "0 0.5rem" }}
|
|
132
|
+
variant="text"
|
|
133
|
+
color="neutral"
|
|
134
|
+
type="button"
|
|
135
|
+
onClick={() => {
|
|
136
|
+
setSelected(initialSelectedRef.current);
|
|
137
|
+
setShowCalendar(false);
|
|
138
|
+
}}
|
|
139
|
+
size={"medium"}
|
|
140
|
+
fontWeight="regular"
|
|
141
|
+
>
|
|
142
|
+
Cancelar
|
|
143
|
+
</Button>
|
|
144
|
+
<Button
|
|
145
|
+
style={{ margin: "0 0.5rem" }}
|
|
146
|
+
variant="text"
|
|
147
|
+
color="brand"
|
|
148
|
+
type="button"
|
|
149
|
+
onClick={() => {
|
|
150
|
+
setShowCalendar(false);
|
|
151
|
+
}}
|
|
152
|
+
size={"medium"}
|
|
153
|
+
fontWeight="medium"
|
|
154
|
+
>
|
|
155
|
+
{actionText ?? "Aplicar"}
|
|
156
|
+
</Button>
|
|
157
|
+
</CalendarFooterStyled>
|
|
158
|
+
)}
|
|
159
|
+
</CalendarContentStyled>
|
|
160
|
+
)}
|
|
161
|
+
</CalendarStyled>
|
|
162
|
+
</div>
|
|
163
|
+
);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
export default DoubleCalendar;
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { useCallback } from "react";
|
|
2
|
+
import { FieldValues, useController, RegisterOptions } from "react-hook-form";
|
|
3
|
+
import { Flex } from "../Flex";
|
|
4
|
+
import { FormLabel } from "./subComponents/FormLabel";
|
|
5
|
+
import { ErrorFormMessage } from "./subComponents/ErrorFormMessage";
|
|
6
|
+
import { DoubleCalendar, DateRange, DoubleCalendarProps } from "../DoubleCalendar";
|
|
7
|
+
|
|
8
|
+
export type DoubleCalendarFormFieldProps = Omit<
|
|
9
|
+
DoubleCalendarProps,
|
|
10
|
+
"selected" | "setSelected"
|
|
11
|
+
> & {
|
|
12
|
+
name: string;
|
|
13
|
+
label?: string;
|
|
14
|
+
required?: boolean;
|
|
15
|
+
validate?: (value: DateRange) => boolean | string;
|
|
16
|
+
validationErrorMessage?: string;
|
|
17
|
+
rules?: Omit<
|
|
18
|
+
RegisterOptions<FieldValues, string>,
|
|
19
|
+
"valueAsNumber" | "valueAsDate" | "setValueAs" | "disabled"
|
|
20
|
+
>;
|
|
21
|
+
allowPastDates?: boolean;
|
|
22
|
+
maxYearsFromNow?: number;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export const DoubleCalendarFormField = ({
|
|
26
|
+
name,
|
|
27
|
+
label,
|
|
28
|
+
required,
|
|
29
|
+
validate,
|
|
30
|
+
validationErrorMessage = "Este campo é obrigatório.",
|
|
31
|
+
rules,
|
|
32
|
+
allowPastDates,
|
|
33
|
+
maxYearsFromNow = 20,
|
|
34
|
+
...calendarProps
|
|
35
|
+
}: DoubleCalendarFormFieldProps) => {
|
|
36
|
+
const handleValidate = useCallback(
|
|
37
|
+
(value?: DateRange) => {
|
|
38
|
+
if (value === undefined || value === null) {
|
|
39
|
+
if (required) return validationErrorMessage;
|
|
40
|
+
return true;
|
|
41
|
+
}
|
|
42
|
+
return validate?.(value) ?? true;
|
|
43
|
+
},
|
|
44
|
+
[validate, required, validationErrorMessage]
|
|
45
|
+
);
|
|
46
|
+
|
|
47
|
+
const { field, fieldState } = useController({
|
|
48
|
+
name,
|
|
49
|
+
rules: {
|
|
50
|
+
required: required ? validationErrorMessage : false,
|
|
51
|
+
validate: handleValidate,
|
|
52
|
+
...rules,
|
|
53
|
+
},
|
|
54
|
+
defaultValue: undefined,
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
const fieldError = fieldState.error;
|
|
58
|
+
const haveError = !!fieldError;
|
|
59
|
+
const errorMsg = fieldError?.message;
|
|
60
|
+
|
|
61
|
+
const { value: selected, onChange: setSelected } = field as any;
|
|
62
|
+
|
|
63
|
+
const handleCalendarChange = (range: DateRange) => {
|
|
64
|
+
setSelected(range);
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
return (
|
|
68
|
+
<Flex direction="column" style={{ flex: "1" }}>
|
|
69
|
+
{label && (
|
|
70
|
+
<FormLabel name={name} label={label} required={required} haveError={haveError} />
|
|
71
|
+
)}
|
|
72
|
+
|
|
73
|
+
<DoubleCalendar
|
|
74
|
+
selected={selected}
|
|
75
|
+
setSelected={(value) => {
|
|
76
|
+
const newValue = typeof value === "function" ? value(selected) : value;
|
|
77
|
+
handleCalendarChange(newValue);
|
|
78
|
+
}}
|
|
79
|
+
hasError={haveError}
|
|
80
|
+
allowPastDates={allowPastDates}
|
|
81
|
+
maxYearsFromNow={maxYearsFromNow}
|
|
82
|
+
{...calendarProps}
|
|
83
|
+
/>
|
|
84
|
+
|
|
85
|
+
<ErrorFormMessage message={errorMsg} />
|
|
86
|
+
</Flex>
|
|
87
|
+
);
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
export default DoubleCalendarFormField;
|
|
@@ -20,6 +20,7 @@ export const TextAreaFormField = ({
|
|
|
20
20
|
placeholder,
|
|
21
21
|
validate,
|
|
22
22
|
validationErrorMessage = "Este campo é obrigatório.",
|
|
23
|
+
simpleLayout = false,
|
|
23
24
|
...props
|
|
24
25
|
}: TextAreaFormFieldProps) => {
|
|
25
26
|
const {
|
|
@@ -49,6 +50,7 @@ export const TextAreaFormField = ({
|
|
|
49
50
|
{...register(name, validationRules)}
|
|
50
51
|
placeholder={placeholder}
|
|
51
52
|
color={haveError ? "error" : "default"}
|
|
53
|
+
simpleLayout={simpleLayout}
|
|
52
54
|
aria-labelledby={`${name}-label`}
|
|
53
55
|
/>
|
|
54
56
|
<ErrorFormMessage message={errorMsg} />
|
|
@@ -3,6 +3,8 @@ import { styled } from "../styles";
|
|
|
3
3
|
import React, { ComponentProps, useRef, useState, useEffect } from "react";
|
|
4
4
|
import { typographyValues } from "../types/typographyValues";
|
|
5
5
|
import { Text } from "./Text";
|
|
6
|
+
import { Badge } from "./Badge";
|
|
7
|
+
import { Flex } from "./Flex";
|
|
6
8
|
|
|
7
9
|
export const TextareaFieldStyle = styled(TextAreaRadix, {
|
|
8
10
|
display: "flex",
|
|
@@ -77,12 +79,14 @@ export type TextareaFieldProps = Omit<
|
|
|
77
79
|
ComponentProps<typeof TextareaFieldStyle>,
|
|
78
80
|
"color"
|
|
79
81
|
> &
|
|
80
|
-
ComponentProps<typeof TextareaContainer
|
|
82
|
+
ComponentProps<typeof TextareaContainer> & {
|
|
83
|
+
simpleLayout?: boolean;
|
|
84
|
+
};
|
|
81
85
|
|
|
82
86
|
export const TextareaField = React.forwardRef<
|
|
83
87
|
HTMLTextAreaElement,
|
|
84
88
|
TextareaFieldProps
|
|
85
|
-
>(({ maxLength, color, ...props }, forwardedRef) => {
|
|
89
|
+
>(({ maxLength, color, simpleLayout = false, ...props }, forwardedRef) => {
|
|
86
90
|
const inputRef = useRef<HTMLTextAreaElement>(null);
|
|
87
91
|
const [remaining, setRemaining] = useState(maxLength);
|
|
88
92
|
|
|
@@ -100,28 +104,35 @@ export const TextareaField = React.forwardRef<
|
|
|
100
104
|
};
|
|
101
105
|
|
|
102
106
|
return (
|
|
103
|
-
<
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
inputRef.current = r;
|
|
109
|
-
if (forwardedRef) {
|
|
110
|
-
if (typeof forwardedRef === "function") forwardedRef(r);
|
|
111
|
-
else forwardedRef.current = r;
|
|
112
|
-
}
|
|
113
|
-
}}
|
|
114
|
-
onInput={handleInput}
|
|
115
|
-
maxLength={maxLength}
|
|
116
|
-
{...props}
|
|
117
|
-
/>
|
|
118
|
-
{maxLength && (
|
|
119
|
-
<TextareaLimitIndicator>
|
|
120
|
-
<Text typography="badgeMedium">
|
|
121
|
-
{remaining}
|
|
122
|
-
</Text>
|
|
123
|
-
</TextareaLimitIndicator>
|
|
107
|
+
<Flex direction="column" align="end" style={{ position: 'relative' }}>
|
|
108
|
+
{maxLength && simpleLayout && (
|
|
109
|
+
<Badge size="sm" color="grey" style={{ position: 'absolute', right: 0, top: '-1.75rem' }}>
|
|
110
|
+
{remaining}
|
|
111
|
+
</Badge>
|
|
124
112
|
)}
|
|
125
|
-
|
|
113
|
+
<TextareaContainer color={color}>
|
|
114
|
+
<TextareaFieldStyle
|
|
115
|
+
rows={4}
|
|
116
|
+
ref={(r) => {
|
|
117
|
+
if (!r) return;
|
|
118
|
+
inputRef.current = r;
|
|
119
|
+
if (forwardedRef) {
|
|
120
|
+
if (typeof forwardedRef === "function") forwardedRef(r);
|
|
121
|
+
else forwardedRef.current = r;
|
|
122
|
+
}
|
|
123
|
+
}}
|
|
124
|
+
onInput={handleInput}
|
|
125
|
+
maxLength={maxLength}
|
|
126
|
+
{...props}
|
|
127
|
+
/>
|
|
128
|
+
{maxLength && !simpleLayout && (
|
|
129
|
+
<TextareaLimitIndicator>
|
|
130
|
+
<Text typography="badgeMedium">
|
|
131
|
+
{remaining}
|
|
132
|
+
</Text>
|
|
133
|
+
</TextareaLimitIndicator>
|
|
134
|
+
)}
|
|
135
|
+
</TextareaContainer>
|
|
136
|
+
</Flex>
|
|
126
137
|
);
|
|
127
138
|
});
|
package/src/index.tsx
CHANGED
|
@@ -17,6 +17,7 @@ export * from "./components/Badge";
|
|
|
17
17
|
export * from "./components/Modal";
|
|
18
18
|
export * from "./components/MenuDropdown";
|
|
19
19
|
export * from "./components/Calendar";
|
|
20
|
+
export * from "./components/DoubleCalendar";
|
|
20
21
|
export * from "./components/Drawer";
|
|
21
22
|
export * from "./components/TimePicker";
|
|
22
23
|
export * from "./components/Alert";
|
|
@@ -57,6 +58,7 @@ export * from "./components/FormFields/SwitchFormField";
|
|
|
57
58
|
export * from "./components/FormFields/EmailFormField";
|
|
58
59
|
export * from "./components/FormFields/RichEditorFormField";
|
|
59
60
|
export * from "./components/FormFields/CalendarFormField";
|
|
61
|
+
export * from "./components/FormFields/DoubleCalendarFormField";
|
|
60
62
|
export * from "./components/FormFields/TimePickerFormField";
|
|
61
63
|
|
|
62
64
|
// Rich Editor
|
package/dist/index.css
DELETED
|
@@ -1,171 +0,0 @@
|
|
|
1
|
-
/* ../../node_modules/react-international-phone/dist/index.css */
|
|
2
|
-
.react-international-phone-country-selector {
|
|
3
|
-
position: relative;
|
|
4
|
-
}
|
|
5
|
-
.react-international-phone-country-selector-button {
|
|
6
|
-
display: flex;
|
|
7
|
-
height: var(--react-international-phone-height, 36px);
|
|
8
|
-
box-sizing: border-box;
|
|
9
|
-
align-items: center;
|
|
10
|
-
justify-content: center;
|
|
11
|
-
padding: 0;
|
|
12
|
-
border: 1px solid var(--react-international-phone-country-selector-border-color, var(--react-international-phone-border-color, gainsboro));
|
|
13
|
-
margin: 0;
|
|
14
|
-
appearance: button;
|
|
15
|
-
-webkit-appearance: button;
|
|
16
|
-
background-color: var(--react-international-phone-country-selector-background-color, var(--react-international-phone-background-color, white));
|
|
17
|
-
cursor: pointer;
|
|
18
|
-
text-transform: none;
|
|
19
|
-
user-select: none;
|
|
20
|
-
}
|
|
21
|
-
.react-international-phone-country-selector-button:hover {
|
|
22
|
-
background-color: var(--react-international-phone-country-selector-background-color-hover, whitesmoke);
|
|
23
|
-
}
|
|
24
|
-
.react-international-phone-country-selector-button--hide-dropdown {
|
|
25
|
-
cursor: auto;
|
|
26
|
-
}
|
|
27
|
-
.react-international-phone-country-selector-button--hide-dropdown:hover {
|
|
28
|
-
background-color: transparent;
|
|
29
|
-
}
|
|
30
|
-
.react-international-phone-country-selector-button__button-content {
|
|
31
|
-
display: flex;
|
|
32
|
-
align-items: center;
|
|
33
|
-
justify-content: center;
|
|
34
|
-
}
|
|
35
|
-
.react-international-phone-country-selector-button__flag-emoji {
|
|
36
|
-
margin: 0 4px;
|
|
37
|
-
}
|
|
38
|
-
.react-international-phone-country-selector-button__flag-emoji--disabled {
|
|
39
|
-
opacity: .75;
|
|
40
|
-
}
|
|
41
|
-
.react-international-phone-country-selector-button__dropdown-arrow {
|
|
42
|
-
border-top: var(--react-international-phone-country-selector-arrow-size, 4px) solid var(--react-international-phone-country-selector-arrow-color, #777);
|
|
43
|
-
border-right: var(--react-international-phone-country-selector-arrow-size, 4px) solid transparent;
|
|
44
|
-
border-left: var(--react-international-phone-country-selector-arrow-size, 4px) solid transparent;
|
|
45
|
-
margin-right: 4px;
|
|
46
|
-
transition: all .1s ease-out;
|
|
47
|
-
}
|
|
48
|
-
.react-international-phone-country-selector-button__dropdown-arrow--active {
|
|
49
|
-
transform: rotateX(180deg);
|
|
50
|
-
}
|
|
51
|
-
.react-international-phone-country-selector-button__dropdown-arrow--disabled {
|
|
52
|
-
border-top-color: var(--react-international-phone-disabled-country-selector-arrow-color, #999);
|
|
53
|
-
}
|
|
54
|
-
.react-international-phone-country-selector-button--disabled {
|
|
55
|
-
background-color: var(--react-international-phone-disabled-country-selector-background-color, var(--react-international-phone-disabled-background-color, whitesmoke));
|
|
56
|
-
cursor: auto;
|
|
57
|
-
}
|
|
58
|
-
.react-international-phone-country-selector-button--disabled:hover {
|
|
59
|
-
background-color: var(--react-international-phone-disabled-country-selector-background-color, var(--react-international-phone-disabled-background-color, whitesmoke));
|
|
60
|
-
}
|
|
61
|
-
.react-international-phone-flag-emoji {
|
|
62
|
-
width: var(--react-international-phone-flag-width, 24px);
|
|
63
|
-
height: var(--react-international-phone-flag-height, 24px);
|
|
64
|
-
box-sizing: border-box;
|
|
65
|
-
}
|
|
66
|
-
.react-international-phone-country-selector-dropdown {
|
|
67
|
-
position: absolute;
|
|
68
|
-
z-index: 1;
|
|
69
|
-
top: var(--react-international-phone-dropdown-top, 44px);
|
|
70
|
-
left: var(--react-international-phone-dropdown-left, 0);
|
|
71
|
-
display: flex;
|
|
72
|
-
width: 300px;
|
|
73
|
-
max-height: 200px;
|
|
74
|
-
flex-direction: column;
|
|
75
|
-
padding: 4px 0;
|
|
76
|
-
margin: 0;
|
|
77
|
-
background-color: var(--react-international-phone-dropdown-item-background-color, var(--react-international-phone-background-color, white));
|
|
78
|
-
box-shadow: var(--react-international-phone-dropdown-shadow, 2px 2px 16px rgba(0, 0, 0, .25));
|
|
79
|
-
color: var(--react-international-phone-dropdown-item-text-color, var(--react-international-phone-text-color, #222));
|
|
80
|
-
list-style: none;
|
|
81
|
-
overflow-y: scroll;
|
|
82
|
-
}
|
|
83
|
-
.react-international-phone-country-selector-dropdown__preferred-list-divider {
|
|
84
|
-
height: 1px;
|
|
85
|
-
border: none;
|
|
86
|
-
margin: var(--react-international-phone-dropdown-preferred-list-divider-margin, 0);
|
|
87
|
-
background: var(--react-international-phone-dropdown-preferred-list-divider-color, var(--react-international-phone-border-color, gainsboro));
|
|
88
|
-
}
|
|
89
|
-
.react-international-phone-country-selector-dropdown__list-item {
|
|
90
|
-
display: flex;
|
|
91
|
-
min-height: var(--react-international-phone-dropdown-item-height, 28px);
|
|
92
|
-
box-sizing: border-box;
|
|
93
|
-
align-items: center;
|
|
94
|
-
padding: 2px 8px;
|
|
95
|
-
}
|
|
96
|
-
.react-international-phone-country-selector-dropdown__list-item-flag-emoji {
|
|
97
|
-
margin-right: 8px;
|
|
98
|
-
}
|
|
99
|
-
.react-international-phone-country-selector-dropdown__list-item-country-name {
|
|
100
|
-
overflow: hidden;
|
|
101
|
-
margin-right: 8px;
|
|
102
|
-
font-size: var(--react-international-phone-dropdown-item-font-size, 14px);
|
|
103
|
-
text-overflow: ellipsis;
|
|
104
|
-
white-space: nowrap;
|
|
105
|
-
}
|
|
106
|
-
.react-international-phone-country-selector-dropdown__list-item-dial-code {
|
|
107
|
-
color: var(--react-international-phone-dropdown-item-dial-code-color, gray);
|
|
108
|
-
font-size: var(--react-international-phone-dropdown-item-font-size, 14px);
|
|
109
|
-
}
|
|
110
|
-
.react-international-phone-country-selector-dropdown__list-item:hover {
|
|
111
|
-
background-color: var(--react-international-phone-selected-dropdown-item-background-color, var(--react-international-phone-selected-dropdown-item-background-color, whitesmoke));
|
|
112
|
-
cursor: pointer;
|
|
113
|
-
}
|
|
114
|
-
.react-international-phone-country-selector-dropdown__list-item--selected,
|
|
115
|
-
.react-international-phone-country-selector-dropdown__list-item--focused {
|
|
116
|
-
background-color: var(--react-international-phone-selected-dropdown-item-background-color, whitesmoke);
|
|
117
|
-
color: var(--react-international-phone-selected-dropdown-item-text-color, var(--react-international-phone-text-color, #222));
|
|
118
|
-
}
|
|
119
|
-
.react-international-phone-country-selector-dropdown__list-item--selected .react-international-phone-country-selector-dropdown__list-item-dial-code,
|
|
120
|
-
.react-international-phone-country-selector-dropdown__list-item--focused .react-international-phone-country-selector-dropdown__list-item-dial-code {
|
|
121
|
-
color: var(--react-international-phone-selected-dropdown-item-dial-code-color, var(--react-international-phone-dropdown-item-dial-code-color, gray));
|
|
122
|
-
}
|
|
123
|
-
.react-international-phone-country-selector-dropdown__list-item--focused {
|
|
124
|
-
background-color: var(--react-international-phone-selected-dropdown-item-background-color, var(--react-international-phone-selected-dropdown-item-background-color, whitesmoke));
|
|
125
|
-
}
|
|
126
|
-
.react-international-phone-dial-code-preview {
|
|
127
|
-
display: flex;
|
|
128
|
-
align-items: center;
|
|
129
|
-
justify-content: center;
|
|
130
|
-
padding: 0 8px;
|
|
131
|
-
border: 1px solid var(--react-international-phone-dial-code-preview-border-color, var(--react-international-phone-border-color, gainsboro));
|
|
132
|
-
margin-right: -1px;
|
|
133
|
-
background-color: var(--react-international-phone-dial-code-preview-background-color, var(--react-international-phone-background-color, white));
|
|
134
|
-
color: var(--react-international-phone-dial-code-preview-text-color, var(--react-international-phone-text-color, #222));
|
|
135
|
-
font-size: var(--react-international-phone-dial-code-preview-font-size, var(--react-international-phone-font-size, 13px));
|
|
136
|
-
}
|
|
137
|
-
.react-international-phone-dial-code-preview--disabled {
|
|
138
|
-
background-color: var(--react-international-phone-dial-code-preview-disabled-background-color, var(--react-international-phone-disabled-background-color, whitesmoke));
|
|
139
|
-
color: var(--react-international-phone-dial-code-preview-disabled-text-color, var(--react-international-phone-disabled-text-color, #666));
|
|
140
|
-
}
|
|
141
|
-
.react-international-phone-input-container {
|
|
142
|
-
display: flex;
|
|
143
|
-
}
|
|
144
|
-
.react-international-phone-input-container .react-international-phone-country-selector-button {
|
|
145
|
-
border-radius: var(--react-international-phone-border-radius, 4px);
|
|
146
|
-
margin-right: -1px;
|
|
147
|
-
border-bottom-right-radius: 0;
|
|
148
|
-
border-top-right-radius: 0;
|
|
149
|
-
}
|
|
150
|
-
.react-international-phone-input-container .react-international-phone-input {
|
|
151
|
-
overflow: visible;
|
|
152
|
-
height: var(--react-international-phone-height, 36px);
|
|
153
|
-
box-sizing: border-box;
|
|
154
|
-
padding: 0 8px;
|
|
155
|
-
border: 1px solid var(--react-international-phone-border-color, gainsboro);
|
|
156
|
-
border-radius: var(--react-international-phone-border-radius, 4px);
|
|
157
|
-
margin: 0;
|
|
158
|
-
background-color: var(--react-international-phone-background-color, white);
|
|
159
|
-
border-bottom-left-radius: 0;
|
|
160
|
-
border-top-left-radius: 0;
|
|
161
|
-
color: var(--react-international-phone-text-color, #222);
|
|
162
|
-
font-family: inherit;
|
|
163
|
-
font-size: var(--react-international-phone-font-size, 13px);
|
|
164
|
-
}
|
|
165
|
-
.react-international-phone-input-container .react-international-phone-input:focus {
|
|
166
|
-
outline: none;
|
|
167
|
-
}
|
|
168
|
-
.react-international-phone-input-container .react-international-phone-input--disabled {
|
|
169
|
-
background-color: var(--react-international-phone-disabled-background-color, whitesmoke);
|
|
170
|
-
color: var(--react-international-phone-disabled-text-color, #666);
|
|
171
|
-
}
|