@m4l/gclick 0.26.0 → 0.27.0-beta-feature-795-m4l-react-native-ui-indicator-flag.0
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/@types/types.d.ts +8 -0
- package/components/PhoneNumberField/PhoneNumberField.d.ts +4 -0
- package/components/PhoneNumberField/PhoneNumberField.d.ts.map +1 -0
- package/components/PhoneNumberField/PhoneNumberField.js +86 -0
- package/components/PhoneNumberField/index.d.ts +3 -0
- package/components/PhoneNumberField/index.d.ts.map +1 -0
- package/components/PhoneNumberField/phoneNumber.d.ts +7 -0
- package/components/PhoneNumberField/phoneNumber.d.ts.map +1 -0
- package/components/PhoneNumberField/phoneNumber.js +12 -0
- package/components/PhoneNumberField/types.d.ts +25 -0
- package/components/PhoneNumberField/types.d.ts.map +1 -0
- package/components/RHFs/RHFPhoneNumberField/RHFPhoneNumberField.d.ts +5 -0
- package/components/RHFs/RHFPhoneNumberField/RHFPhoneNumberField.d.ts.map +1 -0
- package/components/RHFs/RHFPhoneNumberField/RHFPhoneNumberField.js +81 -0
- package/components/RHFs/RHFPhoneNumberField/RHFPhoneNumberField.slots.d.ts +5 -0
- package/components/RHFs/RHFPhoneNumberField/RHFPhoneNumberField.slots.d.ts.map +1 -0
- package/components/RHFs/RHFPhoneNumberField/RHFPhoneNumberField.slots.js +13 -0
- package/components/RHFs/RHFPhoneNumberField/index.d.ts +3 -0
- package/components/RHFs/RHFPhoneNumberField/index.d.ts.map +1 -0
- package/components/RHFs/RHFPhoneNumberField/types.d.ts +13 -0
- package/components/RHFs/RHFPhoneNumberField/types.d.ts.map +1 -0
- package/components/index.d.ts +2 -0
- package/components/index.d.ts.map +1 -1
- package/components/indicators/IndicatorFlag/IndicatorFlag.d.ts +4 -0
- package/components/indicators/IndicatorFlag/IndicatorFlag.d.ts.map +1 -0
- package/components/indicators/IndicatorFlag/IndicatorFlag.js +168 -0
- package/components/indicators/IndicatorFlag/IndicatorFlag.slots.d.ts +31 -0
- package/components/indicators/IndicatorFlag/IndicatorFlag.slots.d.ts.map +1 -0
- package/components/indicators/IndicatorFlag/IndicatorFlag.slots.js +18 -0
- package/components/indicators/IndicatorFlag/IndicatorFlag.styles.d.ts +4 -0
- package/components/indicators/IndicatorFlag/IndicatorFlag.styles.d.ts.map +1 -0
- package/components/indicators/IndicatorFlag/IndicatorFlag.styles.js +142 -0
- package/components/indicators/IndicatorFlag/constants.d.ts +5 -0
- package/components/indicators/IndicatorFlag/constants.d.ts.map +1 -0
- package/components/indicators/IndicatorFlag/constants.js +7 -0
- package/components/indicators/IndicatorFlag/countryOptions.d.ts +4 -0
- package/components/indicators/IndicatorFlag/countryOptions.d.ts.map +1 -0
- package/components/indicators/IndicatorFlag/countryOptions.js +15 -0
- package/components/indicators/IndicatorFlag/countryStock.generated.d.ts +10 -0
- package/components/indicators/IndicatorFlag/countryStock.generated.d.ts.map +1 -0
- package/components/indicators/IndicatorFlag/countryStock.generated.js +251 -0
- package/components/indicators/IndicatorFlag/index.d.ts +3 -0
- package/components/indicators/IndicatorFlag/index.d.ts.map +1 -0
- package/components/indicators/IndicatorFlag/slots.d.ts +13 -0
- package/components/indicators/IndicatorFlag/slots.d.ts.map +1 -0
- package/components/indicators/IndicatorFlag/slots.js +4 -0
- package/components/indicators/IndicatorFlag/types.d.ts +49 -0
- package/components/indicators/IndicatorFlag/types.d.ts.map +1 -0
- package/components/indicators/index.d.ts +1 -0
- package/components/indicators/index.d.ts.map +1 -1
- package/index.js +191 -185
- package/package.json +2 -2
package/@types/types.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ import { GaugeCircularOwnerState, GaugeCircularSlotsType } from '../components/G
|
|
|
6
6
|
import { IndicatorCSQOwnerState, IndicatorCSQSlotsType } from '../components/indicators/IndicatorCSQ/types';
|
|
7
7
|
import { IndicatorBatteryOwnerState, IndicatorBatterySlotsType } from '../components/indicators/IndicatorBattery/types';
|
|
8
8
|
import { IndicatorValueStatusSlotsType } from '../components/indicators/IndicatorValueStatus/types';
|
|
9
|
+
import { IndicatorFlagOwnerState, IndicatorFlagSlotsType } from '../components/indicators/IndicatorFlag/types';
|
|
9
10
|
import { VideoTimeLineSelectorOwnerState, VideoTimeLineSelectorSlotsType } from '../components/VideoTimeLineSelector/types';
|
|
10
11
|
import { VideoPlayerOwnerState, VideoPlayerSlotsType } from '../components/VideoPlayer/types';
|
|
11
12
|
import { CameraStreamOwnerState, CameraStreamSlotsStyledType } from '../components/CameraStream/types';
|
|
@@ -30,6 +31,7 @@ declare module '@mui/material/styles' {
|
|
|
30
31
|
M4LCSQSignal: IndicatorCSQSlotsType;
|
|
31
32
|
M4LIndicatorBattery: IndicatorBatterySlotsType;
|
|
32
33
|
M4LIndicatorValueStatus: IndicatorValueStatusSlotsType;
|
|
34
|
+
M4LIndicatorFlag: IndicatorFlagSlotsType;
|
|
33
35
|
M4LVideoTimeLineSelector: VideoTimeLineSelectorSlotsType;
|
|
34
36
|
M4LVideoPlayer: VideoPlayerSlotsType;
|
|
35
37
|
M4LCameraStream: CameraStreamSlotsStyledType;
|
|
@@ -48,6 +50,7 @@ declare module '@mui/material/styles' {
|
|
|
48
50
|
M4LCSQSignal: Partial<IndicatorCSQOwnerState>;
|
|
49
51
|
M4LIndicatorBattery: Partial<IndicatorBatteryOwnerState>;
|
|
50
52
|
M4LIndicatorValueStatus: Partial<IndicatorValueStatusOwnerState>;
|
|
53
|
+
M4LIndicatorFlag: Partial<IndicatorFlagOwnerState>;
|
|
51
54
|
M4LVideoTimeLineSelector: Partial<VideoTimeLineSelectorOwnerState>;
|
|
52
55
|
M4LVideoPlayer: Partial<VideoPlayerOwnerState>;
|
|
53
56
|
M4LCameraStream: Partial<CameraStreamOwnerState>;
|
|
@@ -101,6 +104,11 @@ declare module '@mui/material/styles' {
|
|
|
101
104
|
styleOverrides?: ComponentsOverrides<Theme>['M4LIndicatorValueStatus'];
|
|
102
105
|
variants?: ComponentsVariants['M4LIndicatorValueStatus'];
|
|
103
106
|
};
|
|
107
|
+
M4LIndicatorFlag?: {
|
|
108
|
+
defaultProps?: ComponentsPropsList['M4LIndicatorFlag'];
|
|
109
|
+
styleOverrides?: ComponentsOverrides<Theme>['M4LIndicatorFlag'];
|
|
110
|
+
variants?: ComponentsVariants['M4LIndicatorFlag'];
|
|
111
|
+
};
|
|
104
112
|
M4LVideoTimeLineSelector?: {
|
|
105
113
|
defaultProps?: ComponentsPropsList['M4LVideoTimeLineSelector'];
|
|
106
114
|
styleOverrides?: ComponentsOverrides<Theme>['M4LVideoTimeLineSelector'];
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { PhoneNumberFieldProps } from './types';
|
|
2
|
+
/** Enter national digits while storing a complete E.164-style phone value. */
|
|
3
|
+
export declare function PhoneNumberField(props: PhoneNumberFieldProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
4
|
+
//# sourceMappingURL=PhoneNumberField.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PhoneNumberField.d.ts","sourceRoot":"","sources":["../../../../../../packages/gclick/src/components/PhoneNumberField/PhoneNumberField.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AA4BrD,8EAA8E;AAC9E,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,oDAuE5D"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { jsx as u } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import { TextField as z } from "@m4l/components";
|
|
3
|
+
import { InputAdornment as A } from "@mui/material";
|
|
4
|
+
import { styled as N } from "@mui/material/styles";
|
|
5
|
+
import { useMemo as O, useState as v } from "react";
|
|
6
|
+
import { IndicatorFlag as w } from "../indicators/IndicatorFlag/IndicatorFlag.js";
|
|
7
|
+
import { resolveIndicatorFlagCountries as B } from "../indicators/IndicatorFlag/countryOptions.js";
|
|
8
|
+
import { splitPhoneNumber as D } from "./phoneNumber.js";
|
|
9
|
+
const T = N(z, {
|
|
10
|
+
name: "M4LPhoneNumberField",
|
|
11
|
+
slot: "Root",
|
|
12
|
+
shouldForwardProp: (t) => t !== "inputHeight"
|
|
13
|
+
})(({ theme: t, size: n, inputHeight: a }) => {
|
|
14
|
+
const r = a === "compact" ? t.vars.size.baseSpacings.sp6 : n === "small" ? t.vars.size.baseSpacings.sp8 : t.vars.size.baseSpacings.sp9;
|
|
15
|
+
return {
|
|
16
|
+
"&&&& .MuiInputBase-root": {
|
|
17
|
+
height: r,
|
|
18
|
+
minHeight: r,
|
|
19
|
+
overflow: "visible"
|
|
20
|
+
},
|
|
21
|
+
"&&&& .MuiInputAdornment-root": {
|
|
22
|
+
alignSelf: "stretch",
|
|
23
|
+
display: "flex",
|
|
24
|
+
alignItems: "center",
|
|
25
|
+
height: "auto",
|
|
26
|
+
maxHeight: "none"
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
});
|
|
30
|
+
function K(t) {
|
|
31
|
+
const {
|
|
32
|
+
value: n,
|
|
33
|
+
defaultValue: a = "",
|
|
34
|
+
onChange: r,
|
|
35
|
+
options: i,
|
|
36
|
+
defaultCountry: C = "es",
|
|
37
|
+
onCountryChange: b,
|
|
38
|
+
indicatorProps: y,
|
|
39
|
+
inputHeight: P = "comfortable",
|
|
40
|
+
variant: I = "contained",
|
|
41
|
+
disabled: d = !1,
|
|
42
|
+
readOnly: p = !1,
|
|
43
|
+
InputProps: c,
|
|
44
|
+
autoComplete: F = "tel-national",
|
|
45
|
+
...m
|
|
46
|
+
} = t, l = O(() => B(i), [i]), [S, x] = v(a), [g, H] = v(C), M = n ?? S, { country: V, nationalDigits: s } = D(M, l, g), o = V ?? l.find((e) => e.value === g) ?? l[0];
|
|
47
|
+
function f(e) {
|
|
48
|
+
n === void 0 && x(e), r?.(e);
|
|
49
|
+
}
|
|
50
|
+
function $(e) {
|
|
51
|
+
const h = e.target.value.replace(/\D/g, "");
|
|
52
|
+
f(h && o ? `${o.callingCode}${h}` : "");
|
|
53
|
+
}
|
|
54
|
+
return /* @__PURE__ */ u(
|
|
55
|
+
T,
|
|
56
|
+
{
|
|
57
|
+
...m,
|
|
58
|
+
inputHeight: P,
|
|
59
|
+
variant: I,
|
|
60
|
+
value: s,
|
|
61
|
+
onChange: $,
|
|
62
|
+
disabled: d || !o,
|
|
63
|
+
readOnly: p,
|
|
64
|
+
autoComplete: F,
|
|
65
|
+
InputProps: {
|
|
66
|
+
...c,
|
|
67
|
+
type: "tel",
|
|
68
|
+
startAdornment: o ? /* @__PURE__ */ u(A, { position: "start", children: /* @__PURE__ */ u(
|
|
69
|
+
w,
|
|
70
|
+
{
|
|
71
|
+
...y,
|
|
72
|
+
options: i,
|
|
73
|
+
value: o.value,
|
|
74
|
+
disabled: d || p || !!(c?.readOnly || m.inputProps?.readOnly),
|
|
75
|
+
onChange: (e) => {
|
|
76
|
+
H(e.value), f(s ? `${e.callingCode}${s}` : ""), b?.(e);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
) }) : void 0
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
export {
|
|
85
|
+
K as PhoneNumberField
|
|
86
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../packages/gclick/src/components/PhoneNumberField/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,YAAY,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { IndicatorFlagCountry } from '../indicators/IndicatorFlag/countryStock.generated';
|
|
2
|
+
/** Extract the national digits and best matching country from an international value. */
|
|
3
|
+
export declare function splitPhoneNumber(value: string, countries: readonly IndicatorFlagCountry[], preferredCountry: string): {
|
|
4
|
+
country: IndicatorFlagCountry | undefined;
|
|
5
|
+
nationalDigits: string;
|
|
6
|
+
};
|
|
7
|
+
//# sourceMappingURL=phoneNumber.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"phoneNumber.d.ts","sourceRoot":"","sources":["../../../../../../packages/gclick/src/components/PhoneNumberField/phoneNumber.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,oDAAoD,CAAC;AAE/F,yFAAyF;AACzF,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,MAAM,EACb,SAAS,EAAE,SAAS,oBAAoB,EAAE,EAC1C,gBAAgB,EAAE,MAAM,GACvB;IAAE,OAAO,EAAE,oBAAoB,GAAG,SAAS,CAAC;IAAC,cAAc,EAAE,MAAM,CAAA;CAAE,CAevE"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
function r(n, c, s) {
|
|
2
|
+
if (!n.startsWith("+"))
|
|
3
|
+
return { country: void 0, nationalDigits: n.replace(/\D/g, "") };
|
|
4
|
+
const e = `+${n.slice(1).replace(/\D/g, "")}`, l = c.filter((t) => e.startsWith(t.callingCode)), a = Math.max(0, ...l.map((t) => t.callingCode.length)), o = l.filter((t) => t.callingCode.length === a), i = o.find((t) => t.value === s) ?? o[0];
|
|
5
|
+
return {
|
|
6
|
+
country: i,
|
|
7
|
+
nationalDigits: i ? e.slice(i.callingCode.length) : e.slice(1)
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
export {
|
|
11
|
+
r as splitPhoneNumber
|
|
12
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { TextField } from '@m4l/components';
|
|
2
|
+
import { ComponentProps } from 'react';
|
|
3
|
+
import { IndicatorFlagOption, IndicatorFlagProps } from '../indicators/IndicatorFlag/types';
|
|
4
|
+
type TextFieldProps = ComponentProps<typeof TextField>;
|
|
5
|
+
/** Props for a phone field whose form value includes the international prefix. */
|
|
6
|
+
export interface PhoneNumberFieldProps extends Omit<TextFieldProps, 'value' | 'defaultValue' | 'onChange' | 'label' | 'helperText'> {
|
|
7
|
+
/** Complete international number, for example `+34123456789`; empty while no digits are entered. */
|
|
8
|
+
value?: string;
|
|
9
|
+
/** Initial complete number when used without controlled value. */
|
|
10
|
+
defaultValue?: string;
|
|
11
|
+
/** Receives the complete international number or an empty string. */
|
|
12
|
+
onChange?: (value: string) => void;
|
|
13
|
+
/** E.164 calling codes available in the selector. Omit for the full catalog. */
|
|
14
|
+
options?: readonly number[];
|
|
15
|
+
/** Country selected before a number is entered; defaults to Spain. */
|
|
16
|
+
defaultCountry?: string;
|
|
17
|
+
/** Receives the selected country, including its calling code. */
|
|
18
|
+
onCountryChange?: (country: IndicatorFlagOption) => void;
|
|
19
|
+
/** Customize the indicator's chip and popover without replacing its country/value contract. */
|
|
20
|
+
indicatorProps?: Omit<IndicatorFlagProps, 'options' | 'value' | 'defaultValue' | 'onChange' | 'disabled'>;
|
|
21
|
+
/** Select the compact 24 px form layout or the comfortable base field height. */
|
|
22
|
+
inputHeight?: 'compact' | 'comfortable';
|
|
23
|
+
}
|
|
24
|
+
export {};
|
|
25
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../packages/gclick/src/components/PhoneNumberField/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,KAAK,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AAEjG,KAAK,cAAc,GAAG,cAAc,CAAC,OAAO,SAAS,CAAC,CAAC;AAEvD,kFAAkF;AAClF,MAAM,WAAW,qBAAsB,SAAQ,IAAI,CAAC,cAAc,EAAE,OAAO,GAAG,cAAc,GAAG,UAAU,GAAG,OAAO,GAAG,YAAY,CAAC;IACjI,oGAAoG;IACpG,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,kEAAkE;IAClE,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,qEAAqE;IACrE,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,gFAAgF;IAChF,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC5B,sEAAsE;IACtE,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,iEAAiE;IACjE,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,mBAAmB,KAAK,IAAI,CAAC;IACzD,+FAA+F;IAC/F,cAAc,CAAC,EAAE,IAAI,CAAC,kBAAkB,EAAE,SAAS,GAAG,OAAO,GAAG,cAAc,GAAG,UAAU,GAAG,UAAU,CAAC,CAAC;IAC1G,iFAAiF;IACjF,WAAW,CAAC,EAAE,SAAS,GAAG,aAAa,CAAC;CACzC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { FieldValues } from 'react-hook-form';
|
|
2
|
+
import { RHFPhoneNumberFieldProps } from './types';
|
|
3
|
+
/** Bind PhoneNumberField's complete international value to react-hook-form. */
|
|
4
|
+
export declare function RHFPhoneNumberField<TFieldValues extends FieldValues = FieldValues>(props: RHFPhoneNumberFieldProps<TFieldValues>): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
5
|
+
//# sourceMappingURL=RHFPhoneNumberField.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RHFPhoneNumberField.d.ts","sourceRoot":"","sources":["../../../../../../../packages/gclick/src/components/RHFs/RHFPhoneNumberField/RHFPhoneNumberField.tsx"],"names":[],"mappings":"AAEA,OAAO,EAA8B,KAAK,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAG/E,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAC;AAExD,+EAA+E;AAC/E,wBAAgB,mBAAmB,CAAC,YAAY,SAAS,WAAW,GAAG,WAAW,EAChF,KAAK,EAAE,wBAAwB,CAAC,YAAY,CAAC,oDAsF9C"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { jsx as e, jsxs as q } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import { Label as E, HelperError as N } from "@m4l/components";
|
|
3
|
+
import { useId as w } from "react";
|
|
4
|
+
import { useFormContext as z, Controller as D } from "react-hook-form";
|
|
5
|
+
import { RootStyled as L, ErrorStyled as O } from "./RHFPhoneNumberField.slots.js";
|
|
6
|
+
import { PhoneNumberField as S } from "../../PhoneNumberField/PhoneNumberField.js";
|
|
7
|
+
function Q(c) {
|
|
8
|
+
const {
|
|
9
|
+
name: b,
|
|
10
|
+
control: p,
|
|
11
|
+
rules: m,
|
|
12
|
+
disabled: y,
|
|
13
|
+
label: a,
|
|
14
|
+
symbol: g,
|
|
15
|
+
labelOverflow: h,
|
|
16
|
+
mandatory: f,
|
|
17
|
+
mandatoryMessage: B,
|
|
18
|
+
helperMessage: F,
|
|
19
|
+
htmlFor: v,
|
|
20
|
+
id: P,
|
|
21
|
+
size: t = "medium",
|
|
22
|
+
variant: j = "contained",
|
|
23
|
+
inputHeight: x = "compact",
|
|
24
|
+
inputProps: o,
|
|
25
|
+
...C
|
|
26
|
+
} = c, I = z(), M = w(), n = P ?? v ?? M, d = `${n}-error`, s = m?.required, R = f ?? (typeof s == "object" ? !!s.value : !!s);
|
|
27
|
+
return /* @__PURE__ */ e(
|
|
28
|
+
D,
|
|
29
|
+
{
|
|
30
|
+
name: b,
|
|
31
|
+
control: p ?? I?.control,
|
|
32
|
+
rules: m,
|
|
33
|
+
render: ({ field: r, fieldState: i, formState: H }) => {
|
|
34
|
+
const u = y || H.isSubmitting, l = i.error?.message;
|
|
35
|
+
return /* @__PURE__ */ q(L, { children: [
|
|
36
|
+
a && /* @__PURE__ */ e(
|
|
37
|
+
E,
|
|
38
|
+
{
|
|
39
|
+
label: a,
|
|
40
|
+
symbol: g,
|
|
41
|
+
labelOverflow: h,
|
|
42
|
+
mandatory: R,
|
|
43
|
+
mandatoryMessage: B,
|
|
44
|
+
helperMessage: F,
|
|
45
|
+
htmlFor: n,
|
|
46
|
+
size: t,
|
|
47
|
+
disabled: u,
|
|
48
|
+
error: !!i.error
|
|
49
|
+
}
|
|
50
|
+
),
|
|
51
|
+
/* @__PURE__ */ e(
|
|
52
|
+
S,
|
|
53
|
+
{
|
|
54
|
+
...C,
|
|
55
|
+
id: n,
|
|
56
|
+
name: r.name,
|
|
57
|
+
inputRef: r.ref,
|
|
58
|
+
inputProps: {
|
|
59
|
+
...o,
|
|
60
|
+
"aria-label": o?.["aria-label"] ?? a,
|
|
61
|
+
"aria-describedby": l ? [o?.["aria-describedby"], d].filter(Boolean).join(" ") : o?.["aria-describedby"]
|
|
62
|
+
},
|
|
63
|
+
size: t,
|
|
64
|
+
variant: j,
|
|
65
|
+
inputHeight: x,
|
|
66
|
+
value: typeof r.value == "string" ? r.value : "",
|
|
67
|
+
onChange: r.onChange,
|
|
68
|
+
onBlur: r.onBlur,
|
|
69
|
+
disabled: u,
|
|
70
|
+
error: !!i.error
|
|
71
|
+
}
|
|
72
|
+
),
|
|
73
|
+
l && /* @__PURE__ */ e(O, { id: d, children: /* @__PURE__ */ e(N, { message: l, size: t, htmlFor: n }) })
|
|
74
|
+
] });
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
export {
|
|
80
|
+
Q as RHFPhoneNumberField
|
|
81
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** Keep the external label, phone input and validation message in one field stack. */
|
|
2
|
+
export declare const RootStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme>, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').HTMLAttributes<HTMLDivElement> | keyof import('react').ClassAttributes<HTMLDivElement>>, {}>;
|
|
3
|
+
/** Provide an accessible target for the input's error description. */
|
|
4
|
+
export declare const ErrorStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme>, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, keyof import('react').ClassAttributes<HTMLSpanElement> | keyof import('react').HTMLAttributes<HTMLSpanElement>>, {}>;
|
|
5
|
+
//# sourceMappingURL=RHFPhoneNumberField.slots.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RHFPhoneNumberField.slots.d.ts","sourceRoot":"","sources":["../../../../../../../packages/gclick/src/components/RHFs/RHFPhoneNumberField/RHFPhoneNumberField.slots.tsx"],"names":[],"mappings":"AAEA,sFAAsF;AACtF,eAAO,MAAM,UAAU,iVAKpB,CAAC;AAEJ,sEAAsE;AACtE,eAAO,MAAM,WAAW,qVAEtB,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { styled as o } from "@mui/material/styles";
|
|
2
|
+
const r = o("div", { name: "M4LRHFPhoneNumberField", slot: "Root" })(({ theme: e }) => ({
|
|
3
|
+
display: "flex",
|
|
4
|
+
flexDirection: "column",
|
|
5
|
+
gap: e.vars.size.baseSpacings["sp1-5"],
|
|
6
|
+
width: "100%"
|
|
7
|
+
})), s = o("span", { name: "M4LRHFPhoneNumberField", slot: "Error" })({
|
|
8
|
+
display: "block"
|
|
9
|
+
});
|
|
10
|
+
export {
|
|
11
|
+
s as ErrorStyled,
|
|
12
|
+
r as RootStyled
|
|
13
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../packages/gclick/src/components/RHFs/RHFPhoneNumberField/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,YAAY,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Control, FieldPath, FieldValues, UseControllerProps } from 'react-hook-form';
|
|
2
|
+
import { LabelProps } from '@m4l/components';
|
|
3
|
+
import { PhoneNumberFieldProps } from '../../PhoneNumberField';
|
|
4
|
+
/** Props for a phone number stored as one international string in react-hook-form. */
|
|
5
|
+
export interface RHFPhoneNumberFieldProps<TFieldValues extends FieldValues = FieldValues> extends Omit<PhoneNumberFieldProps, 'name' | 'value' | 'defaultValue' | 'onChange' | 'inputRef' | 'error'>, Pick<LabelProps, 'label' | 'symbol' | 'labelOverflow' | 'mandatory' | 'mandatoryMessage' | 'helperMessage' | 'htmlFor'> {
|
|
6
|
+
/** Path of the complete international phone number in the form. */
|
|
7
|
+
name: FieldPath<TFieldValues>;
|
|
8
|
+
/** Optional form control when no FormProvider is present. */
|
|
9
|
+
control?: Control<TFieldValues>;
|
|
10
|
+
/** react-hook-form validation rules for this field. */
|
|
11
|
+
rules?: UseControllerProps<TFieldValues>['rules'];
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../../packages/gclick/src/components/RHFs/RHFPhoneNumberField/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAC3F,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAEpE,sFAAsF;AACtF,MAAM,WAAW,wBAAwB,CAAC,YAAY,SAAS,WAAW,GAAG,WAAW,CACtF,SAAQ,IAAI,CAAC,qBAAqB,EAAE,MAAM,GAAG,OAAO,GAAG,cAAc,GAAG,UAAU,GAAG,UAAU,GAAG,OAAO,CAAC,EACxG,IAAI,CAAC,UAAU,EAAE,OAAO,GAAG,QAAQ,GAAG,eAAe,GAAG,WAAW,GAAG,kBAAkB,GAAG,eAAe,GAAG,SAAS,CAAC;IACzH,mEAAmE;IACnE,IAAI,EAAE,SAAS,CAAC,YAAY,CAAC,CAAC;IAC9B,6DAA6D;IAC7D,OAAO,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;IAChC,uDAAuD;IACvD,KAAK,CAAC,EAAE,kBAAkB,CAAC,YAAY,CAAC,CAAC,OAAO,CAAC,CAAC;CACnD"}
|
package/components/index.d.ts
CHANGED
|
@@ -14,4 +14,6 @@ export * from './ReportsViewer';
|
|
|
14
14
|
export * from './TimelineCardsViewer';
|
|
15
15
|
export * from './AddressLocation';
|
|
16
16
|
export * from './RHFs/RHFAddressLocation';
|
|
17
|
+
export * from './PhoneNumberField';
|
|
18
|
+
export * from './RHFs/RHFPhoneNumberField';
|
|
17
19
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../packages/gclick/src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,OAAO,EAAE,gCAAgC,EAAE,MAAM,QAAQ,CAAC;AAC1D,cAAc,cAAc,CAAC;AAC7B,cAAc,yBAAyB,CAAC;AACxC,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,2BAA2B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../packages/gclick/src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,OAAO,EAAE,gCAAgC,EAAE,MAAM,QAAQ,CAAC;AAC1D,cAAc,cAAc,CAAC;AAC7B,cAAc,yBAAyB,CAAC;AACxC,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oBAAoB,CAAC;AACnC,cAAc,4BAA4B,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { IndicatorFlagProps } from './types';
|
|
2
|
+
/** Render an E.164 country flag selector with a virtualized option panel. */
|
|
3
|
+
export declare function IndicatorFlag(props: IndicatorFlagProps): import("@emotion/react/jsx-runtime").JSX.Element | null;
|
|
4
|
+
//# sourceMappingURL=IndicatorFlag.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IndicatorFlag.d.ts","sourceRoot":"","sources":["../../../../../../../packages/gclick/src/components/indicators/IndicatorFlag/IndicatorFlag.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAuB,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAEvE,6EAA6E;AAC7E,wBAAgB,aAAa,CAAC,KAAK,EAAE,kBAAkB,2DAqPtD"}
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
import { jsxs as w, jsx as a } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import { useVirtualizer as ee } from "@tanstack/react-virtual";
|
|
3
|
+
import { useMemo as te, useState as g, useRef as h, useId as ne, useCallback as le, useEffect as ae } from "react";
|
|
4
|
+
import { INDICATOR_FLAG_VISIBLE_ROWS as E, INDICATOR_FLAG_ROW_HEIGHT as A, INDICATOR_FLAG_ROW_GAP as L } from "./constants.js";
|
|
5
|
+
import { resolveIndicatorFlagCountries as oe } from "./countryOptions.js";
|
|
6
|
+
import { RootStyled as re, ChipStyled as ie, CodeInputStyled as se, TriggerStyled as ce, FlagStyled as P, PopoverStyled as de, MenuStyled as ue, MenuItemStyled as fe, CodeStyled as pe, EmptyStateStyled as ge } from "./IndicatorFlag.slots.js";
|
|
7
|
+
function xe(V) {
|
|
8
|
+
const {
|
|
9
|
+
options: k,
|
|
10
|
+
value: M,
|
|
11
|
+
defaultValue: z = "es",
|
|
12
|
+
onChange: G,
|
|
13
|
+
expanded: m,
|
|
14
|
+
defaultExpanded: H = !1,
|
|
15
|
+
onExpandedChange: R,
|
|
16
|
+
disabled: y = !1,
|
|
17
|
+
chipProps: N,
|
|
18
|
+
popoverProps: W,
|
|
19
|
+
className: K,
|
|
20
|
+
dataTestId: j
|
|
21
|
+
} = V, d = te(() => oe(k), [k]), [Q, B] = g(z), [U, q] = g(H), [u, $] = g(null), [v, f] = g(0), b = h(null), C = h(null), s = h(null), p = h(!1), c = ne(), r = d.find((e) => e.value === (M ?? Q)) ?? d[0], F = m ?? U, J = u?.replace(/\D/g, "") ?? "", l = d.filter((e) => (u !== null || e.value !== r?.value) && e.callingCode.slice(1).startsWith(J)), x = d.length > 1, n = F && x && !y, T = l.length > E, _ = Math.max(0, Math.min(l.length, E) * A - L), I = ee({
|
|
22
|
+
count: l.length,
|
|
23
|
+
getScrollElement: () => s.current,
|
|
24
|
+
estimateSize: () => A,
|
|
25
|
+
initialRect: { width: 59, height: _ },
|
|
26
|
+
overscan: 2,
|
|
27
|
+
enabled: n
|
|
28
|
+
}), i = le((e) => {
|
|
29
|
+
e || $(null), m === void 0 && q(e), R?.(e);
|
|
30
|
+
}, [m, R]);
|
|
31
|
+
if (ae(() => {
|
|
32
|
+
if (!n)
|
|
33
|
+
return;
|
|
34
|
+
p.current && (s.current?.focus(), p.current = !1);
|
|
35
|
+
function e(t) {
|
|
36
|
+
b.current && !b.current.contains(t.target) && i(!1);
|
|
37
|
+
}
|
|
38
|
+
return document.addEventListener("pointerdown", e), () => document.removeEventListener("pointerdown", e);
|
|
39
|
+
}, [n, i]), !r)
|
|
40
|
+
return null;
|
|
41
|
+
function S(e) {
|
|
42
|
+
M === void 0 && B(e.value);
|
|
43
|
+
const t = {
|
|
44
|
+
value: e.value,
|
|
45
|
+
callingCode: e.callingCode,
|
|
46
|
+
label: e.label
|
|
47
|
+
};
|
|
48
|
+
G?.(t), i(!1), C.current?.focus();
|
|
49
|
+
}
|
|
50
|
+
function D(e) {
|
|
51
|
+
if (l.length === 0)
|
|
52
|
+
return;
|
|
53
|
+
const t = Math.max(0, Math.min(e, l.length - 1));
|
|
54
|
+
f(t), I.scrollToIndex(t, { align: "auto" });
|
|
55
|
+
}
|
|
56
|
+
const X = r.flag, o = l[v] ?? l[0], O = I.getVirtualItems(), Y = O.length > 0 ? O : Array.from({ length: Math.min(l.length, E + 2) }, (e, t) => ({
|
|
57
|
+
index: t,
|
|
58
|
+
start: t * A
|
|
59
|
+
}));
|
|
60
|
+
return /* @__PURE__ */ w(
|
|
61
|
+
re,
|
|
62
|
+
{
|
|
63
|
+
ref: b,
|
|
64
|
+
ownerState: { expanded: n },
|
|
65
|
+
className: K,
|
|
66
|
+
"data-testid": j,
|
|
67
|
+
onKeyDown: (e) => {
|
|
68
|
+
e.key === "Escape" && n && (e.stopPropagation(), i(!1), C.current?.focus());
|
|
69
|
+
},
|
|
70
|
+
children: [
|
|
71
|
+
/* @__PURE__ */ a(
|
|
72
|
+
ie,
|
|
73
|
+
{
|
|
74
|
+
...N,
|
|
75
|
+
startIcon: /* @__PURE__ */ a(
|
|
76
|
+
ce,
|
|
77
|
+
{
|
|
78
|
+
ref: C,
|
|
79
|
+
type: "button",
|
|
80
|
+
"aria-label": `${r.label} ${r.callingCode}`,
|
|
81
|
+
"aria-haspopup": "listbox",
|
|
82
|
+
"aria-expanded": n,
|
|
83
|
+
"aria-controls": n ? c : void 0,
|
|
84
|
+
disabled: y || !x,
|
|
85
|
+
onClick: () => {
|
|
86
|
+
f(0), p.current = !n, i(!F);
|
|
87
|
+
},
|
|
88
|
+
children: /* @__PURE__ */ a(P, { "aria-hidden": "true", children: /* @__PURE__ */ a(X, {}) })
|
|
89
|
+
}
|
|
90
|
+
),
|
|
91
|
+
label: /* @__PURE__ */ a(
|
|
92
|
+
se,
|
|
93
|
+
{
|
|
94
|
+
ownerState: { expanded: n, codeLength: Math.max(3, (u ?? r.callingCode).length) },
|
|
95
|
+
type: "text",
|
|
96
|
+
role: "combobox",
|
|
97
|
+
"aria-label": "Country calling code",
|
|
98
|
+
"aria-autocomplete": "list",
|
|
99
|
+
"aria-expanded": n,
|
|
100
|
+
"aria-controls": n ? c : void 0,
|
|
101
|
+
"aria-activedescendant": n && o ? `${c}-${o.value}` : void 0,
|
|
102
|
+
inputMode: "tel",
|
|
103
|
+
autoComplete: "off",
|
|
104
|
+
value: u ?? r.callingCode,
|
|
105
|
+
disabled: y || !x,
|
|
106
|
+
onFocus: (e) => {
|
|
107
|
+
p.current = !1, i(!0), e.currentTarget.select();
|
|
108
|
+
},
|
|
109
|
+
onChange: (e) => {
|
|
110
|
+
const t = e.target.value.replace(/\D/g, "").slice(0, 3);
|
|
111
|
+
$(t ? `+${t}` : ""), f(0), s.current && (s.current.scrollTop = 0), i(!0);
|
|
112
|
+
},
|
|
113
|
+
onKeyDown: (e) => {
|
|
114
|
+
e.key === "ArrowDown" && n ? (e.preventDefault(), s.current?.focus(), D(0)) : e.key === "Enter" && n && o && (e.preventDefault(), S(o));
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
)
|
|
118
|
+
}
|
|
119
|
+
),
|
|
120
|
+
n && /* @__PURE__ */ w(de, { ...W, "data-scrollable": T, children: [
|
|
121
|
+
/* @__PURE__ */ a(
|
|
122
|
+
ue,
|
|
123
|
+
{
|
|
124
|
+
id: c,
|
|
125
|
+
ref: s,
|
|
126
|
+
"data-scrollable": T,
|
|
127
|
+
role: "listbox",
|
|
128
|
+
tabIndex: 0,
|
|
129
|
+
"aria-label": "Country calling codes",
|
|
130
|
+
"aria-activedescendant": o ? `${c}-${o.value}` : void 0,
|
|
131
|
+
style: { height: _ },
|
|
132
|
+
onKeyDown: (e) => {
|
|
133
|
+
e.key === "ArrowDown" || e.key === "ArrowUp" ? (e.preventDefault(), D(v + (e.key === "ArrowDown" ? 1 : -1))) : e.key === "Home" || e.key === "End" ? (e.preventDefault(), D(e.key === "Home" ? 0 : l.length - 1)) : (e.key === "Enter" || e.key === " ") && o && (e.preventDefault(), S(o));
|
|
134
|
+
},
|
|
135
|
+
children: /* @__PURE__ */ a("div", { style: { position: "relative", height: Math.max(0, I.getTotalSize() - L) }, children: Y.map((e) => {
|
|
136
|
+
const t = l[e.index], Z = t.flag;
|
|
137
|
+
return /* @__PURE__ */ w(
|
|
138
|
+
fe,
|
|
139
|
+
{
|
|
140
|
+
id: `${c}-${t.value}`,
|
|
141
|
+
type: "button",
|
|
142
|
+
role: "option",
|
|
143
|
+
"aria-label": `${t.label} ${t.callingCode}`,
|
|
144
|
+
"aria-selected": !1,
|
|
145
|
+
tabIndex: -1,
|
|
146
|
+
"data-active": e.index === v,
|
|
147
|
+
style: { top: e.start },
|
|
148
|
+
onMouseEnter: () => f(e.index),
|
|
149
|
+
onClick: () => S(t),
|
|
150
|
+
children: [
|
|
151
|
+
/* @__PURE__ */ a(P, { "aria-hidden": "true", children: /* @__PURE__ */ a(Z, {}) }),
|
|
152
|
+
/* @__PURE__ */ a(pe, { children: t.callingCode })
|
|
153
|
+
]
|
|
154
|
+
},
|
|
155
|
+
t.value
|
|
156
|
+
);
|
|
157
|
+
}) })
|
|
158
|
+
}
|
|
159
|
+
),
|
|
160
|
+
l.length === 0 && /* @__PURE__ */ a(ge, { role: "status", children: "No matching country codes" })
|
|
161
|
+
] })
|
|
162
|
+
]
|
|
163
|
+
}
|
|
164
|
+
);
|
|
165
|
+
}
|
|
166
|
+
export {
|
|
167
|
+
xe as IndicatorFlag
|
|
168
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export declare const RootStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Record<string, unknown> & {
|
|
2
|
+
ownerState?: (Partial<import('./types').IndicatorFlagOwnerState> & Record<string, unknown>) | undefined;
|
|
3
|
+
}, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').HTMLAttributes<HTMLDivElement> | keyof import('react').ClassAttributes<HTMLDivElement>>, {}>;
|
|
4
|
+
export declare const TriggerStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Record<string, unknown> & {
|
|
5
|
+
ownerState?: (Partial<import('./types').IndicatorFlagOwnerState> & Record<string, unknown>) | undefined;
|
|
6
|
+
}, Pick<import('react').DetailedHTMLProps<import('react').ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, keyof import('react').ClassAttributes<HTMLButtonElement> | keyof import('react').ButtonHTMLAttributes<HTMLButtonElement>>, {}>;
|
|
7
|
+
export declare const ChipStyled: import('@emotion/styled').StyledComponent<Pick<import('@m4l/components').ChipProps & import('react').RefAttributes<HTMLDivElement>, keyof import('react').RefAttributes<HTMLDivElement> | keyof import('@m4l/components').ChipProps> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Record<string, unknown> & {
|
|
8
|
+
ownerState?: (Partial<import('./types').IndicatorFlagOwnerState> & Record<string, unknown>) | undefined;
|
|
9
|
+
}, {}, {}>;
|
|
10
|
+
export declare const PopoverStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Record<string, unknown> & {
|
|
11
|
+
ownerState?: (Partial<import('./types').IndicatorFlagOwnerState> & Record<string, unknown>) | undefined;
|
|
12
|
+
}, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').HTMLAttributes<HTMLDivElement> | keyof import('react').ClassAttributes<HTMLDivElement>>, {}>;
|
|
13
|
+
export declare const MenuStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Record<string, unknown> & {
|
|
14
|
+
ownerState?: (Partial<import('./types').IndicatorFlagOwnerState> & Record<string, unknown>) | undefined;
|
|
15
|
+
}, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').HTMLAttributes<HTMLDivElement> | keyof import('react').ClassAttributes<HTMLDivElement>>, {}>;
|
|
16
|
+
export declare const MenuItemStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Record<string, unknown> & {
|
|
17
|
+
ownerState?: (Partial<import('./types').IndicatorFlagOwnerState> & Record<string, unknown>) | undefined;
|
|
18
|
+
}, Pick<import('react').DetailedHTMLProps<import('react').ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, keyof import('react').ClassAttributes<HTMLButtonElement> | keyof import('react').ButtonHTMLAttributes<HTMLButtonElement>>, {}>;
|
|
19
|
+
export declare const FlagStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Record<string, unknown> & {
|
|
20
|
+
ownerState?: (Partial<import('./types').IndicatorFlagOwnerState> & Record<string, unknown>) | undefined;
|
|
21
|
+
}, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, keyof import('react').ClassAttributes<HTMLSpanElement> | keyof import('react').HTMLAttributes<HTMLSpanElement>>, {}>;
|
|
22
|
+
export declare const CodeStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Record<string, unknown> & {
|
|
23
|
+
ownerState?: (Partial<import('./types').IndicatorFlagOwnerState> & Record<string, unknown>) | undefined;
|
|
24
|
+
}, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, keyof import('react').ClassAttributes<HTMLSpanElement> | keyof import('react').HTMLAttributes<HTMLSpanElement>>, {}>;
|
|
25
|
+
export declare const CodeInputStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Record<string, unknown> & {
|
|
26
|
+
ownerState?: (Partial<import('./types').IndicatorFlagOwnerState> & Record<string, unknown>) | undefined;
|
|
27
|
+
}, Pick<import('react').DetailedHTMLProps<import('react').InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, keyof import('react').ClassAttributes<HTMLInputElement> | keyof import('react').InputHTMLAttributes<HTMLInputElement>>, {}>;
|
|
28
|
+
export declare const EmptyStateStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Record<string, unknown> & {
|
|
29
|
+
ownerState?: (Partial<import('./types').IndicatorFlagOwnerState> & Record<string, unknown>) | undefined;
|
|
30
|
+
}, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, keyof import('react').ClassAttributes<HTMLSpanElement> | keyof import('react').HTMLAttributes<HTMLSpanElement>>, {}>;
|
|
31
|
+
//# sourceMappingURL=IndicatorFlag.slots.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IndicatorFlag.slots.d.ts","sourceRoot":"","sources":["../../../../../../../packages/gclick/src/components/indicators/IndicatorFlag/IndicatorFlag.slots.tsx"],"names":[],"mappings":"AAMA,eAAO,MAAM,UAAU;;6NAAoG,CAAC;AAC5H,eAAO,MAAM,aAAa;;qPAA6G,CAAC;AACxI,eAAO,MAAM,UAAU;;UAAmG,CAAC;AAC3H,eAAO,MAAM,aAAa;;6NAA0G,CAAC;AACrI,eAAO,MAAM,UAAU;;6NAAoG,CAAC;AAC5H,eAAO,MAAM,cAAc;;qPAA+G,CAAC;AAC3I,eAAO,MAAM,UAAU;;iOAAqG,CAAC;AAC7H,eAAO,MAAM,UAAU;;iOAAqG,CAAC;AAC7H,eAAO,MAAM,eAAe;;+OAAgH,CAAC;AAC7I,eAAO,MAAM,gBAAgB;;iOAAiH,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Chip as m } from "@m4l/components";
|
|
2
|
+
import { styled as t } from "@mui/material/styles";
|
|
3
|
+
import { INDICATOR_FLAG_COMPONENT_KEY as o } from "./constants.js";
|
|
4
|
+
import { indicatorFlagStyles as e } from "./IndicatorFlag.styles.js";
|
|
5
|
+
import { IndicatorFlagSlots as n } from "./slots.js";
|
|
6
|
+
const d = t("div", { name: o, slot: n.root })(e.root), i = t("button", { name: o, slot: n.trigger })(e.trigger), c = t(m, { name: o, slot: n.chip })(e.chip), y = t("div", { name: o, slot: n.popover })(e.popover), S = t("div", { name: o, slot: n.menu })(e.menu), u = t("button", { name: o, slot: n.menuItem })(e.menuItem), g = t("span", { name: o, slot: n.flag })(e.flag), I = t("span", { name: o, slot: n.code })(e.code), f = t("input", { name: o, slot: n.codeInput })(e.codeInput), v = t("span", { name: o, slot: n.emptyState })(e.emptyState);
|
|
7
|
+
export {
|
|
8
|
+
c as ChipStyled,
|
|
9
|
+
f as CodeInputStyled,
|
|
10
|
+
I as CodeStyled,
|
|
11
|
+
v as EmptyStateStyled,
|
|
12
|
+
g as FlagStyled,
|
|
13
|
+
u as MenuItemStyled,
|
|
14
|
+
S as MenuStyled,
|
|
15
|
+
y as PopoverStyled,
|
|
16
|
+
d as RootStyled,
|
|
17
|
+
i as TriggerStyled
|
|
18
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IndicatorFlag.styles.d.ts","sourceRoot":"","sources":["../../../../../../../packages/gclick/src/components/indicators/IndicatorFlag/IndicatorFlag.styles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAEnD,yEAAyE;AACzE,eAAO,MAAM,mBAAmB,EAAE,mBA0IjC,CAAC"}
|