@vritti/quantum-ui 0.1.9 → 0.1.11
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/AuthProvider.d.ts +32 -0
- package/dist/Button.js +1 -1
- package/dist/Checkbox.js +3 -61
- package/dist/Checkbox.js.map +1 -1
- package/dist/Label.js +1 -1
- package/dist/OnboardingProvider.js +91 -0
- package/dist/OnboardingProvider.js.map +1 -0
- package/dist/Progress.d.ts +7 -0
- package/dist/assets/quantum-ui.css +118 -1
- package/dist/axios.d.ts +7 -0
- package/dist/components/Progress.d.ts +2 -0
- package/dist/components/Progress.js +119 -0
- package/dist/components/Progress.js.map +1 -0
- package/dist/context/AuthProvider.d.ts +2 -0
- package/dist/context/AuthProvider.js +2 -0
- package/dist/context/AuthProvider.js.map +1 -0
- package/dist/index.d.ts +29 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/index2.js +58 -35
- package/dist/index2.js.map +1 -1
- package/dist/index3.js +34 -119
- package/dist/index3.js.map +1 -1
- package/dist/index4.js +126 -0
- package/dist/index4.js.map +1 -0
- package/dist/utils/axios.d.ts +3 -0
- package/dist/utils/axios.js +3856 -0
- package/dist/utils/axios.js.map +1 -0
- package/package.json +19 -3
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { c as createContextScope } from '../index2.js';
|
|
4
|
+
import { P as Primitive } from '../index3.js';
|
|
5
|
+
import { c as cn } from '../utils.js';
|
|
6
|
+
|
|
7
|
+
var PROGRESS_NAME = "Progress";
|
|
8
|
+
var DEFAULT_MAX = 100;
|
|
9
|
+
var [createProgressContext] = createContextScope(PROGRESS_NAME);
|
|
10
|
+
var [ProgressProvider, useProgressContext] = createProgressContext(PROGRESS_NAME);
|
|
11
|
+
var Progress$2 = React.forwardRef(
|
|
12
|
+
(props, forwardedRef) => {
|
|
13
|
+
const {
|
|
14
|
+
__scopeProgress,
|
|
15
|
+
value: valueProp = null,
|
|
16
|
+
max: maxProp,
|
|
17
|
+
getValueLabel = defaultGetValueLabel,
|
|
18
|
+
...progressProps
|
|
19
|
+
} = props;
|
|
20
|
+
if ((maxProp || maxProp === 0) && !isValidMaxNumber(maxProp)) {
|
|
21
|
+
console.error(getInvalidMaxError(`${maxProp}`, "Progress"));
|
|
22
|
+
}
|
|
23
|
+
const max = isValidMaxNumber(maxProp) ? maxProp : DEFAULT_MAX;
|
|
24
|
+
if (valueProp !== null && !isValidValueNumber(valueProp, max)) {
|
|
25
|
+
console.error(getInvalidValueError(`${valueProp}`, "Progress"));
|
|
26
|
+
}
|
|
27
|
+
const value = isValidValueNumber(valueProp, max) ? valueProp : null;
|
|
28
|
+
const valueLabel = isNumber(value) ? getValueLabel(value, max) : void 0;
|
|
29
|
+
return /* @__PURE__ */ jsx(ProgressProvider, { scope: __scopeProgress, value, max, children: /* @__PURE__ */ jsx(
|
|
30
|
+
Primitive.div,
|
|
31
|
+
{
|
|
32
|
+
"aria-valuemax": max,
|
|
33
|
+
"aria-valuemin": 0,
|
|
34
|
+
"aria-valuenow": isNumber(value) ? value : void 0,
|
|
35
|
+
"aria-valuetext": valueLabel,
|
|
36
|
+
role: "progressbar",
|
|
37
|
+
"data-state": getProgressState(value, max),
|
|
38
|
+
"data-value": value ?? void 0,
|
|
39
|
+
"data-max": max,
|
|
40
|
+
...progressProps,
|
|
41
|
+
ref: forwardedRef
|
|
42
|
+
}
|
|
43
|
+
) });
|
|
44
|
+
}
|
|
45
|
+
);
|
|
46
|
+
Progress$2.displayName = PROGRESS_NAME;
|
|
47
|
+
var INDICATOR_NAME = "ProgressIndicator";
|
|
48
|
+
var ProgressIndicator = React.forwardRef(
|
|
49
|
+
(props, forwardedRef) => {
|
|
50
|
+
const { __scopeProgress, ...indicatorProps } = props;
|
|
51
|
+
const context = useProgressContext(INDICATOR_NAME, __scopeProgress);
|
|
52
|
+
return /* @__PURE__ */ jsx(
|
|
53
|
+
Primitive.div,
|
|
54
|
+
{
|
|
55
|
+
"data-state": getProgressState(context.value, context.max),
|
|
56
|
+
"data-value": context.value ?? void 0,
|
|
57
|
+
"data-max": context.max,
|
|
58
|
+
...indicatorProps,
|
|
59
|
+
ref: forwardedRef
|
|
60
|
+
}
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
);
|
|
64
|
+
ProgressIndicator.displayName = INDICATOR_NAME;
|
|
65
|
+
function defaultGetValueLabel(value, max) {
|
|
66
|
+
return `${Math.round(value / max * 100)}%`;
|
|
67
|
+
}
|
|
68
|
+
function getProgressState(value, maxValue) {
|
|
69
|
+
return value == null ? "indeterminate" : value === maxValue ? "complete" : "loading";
|
|
70
|
+
}
|
|
71
|
+
function isNumber(value) {
|
|
72
|
+
return typeof value === "number";
|
|
73
|
+
}
|
|
74
|
+
function isValidMaxNumber(max) {
|
|
75
|
+
return isNumber(max) && !isNaN(max) && max > 0;
|
|
76
|
+
}
|
|
77
|
+
function isValidValueNumber(value, max) {
|
|
78
|
+
return isNumber(value) && !isNaN(value) && value <= max && value >= 0;
|
|
79
|
+
}
|
|
80
|
+
function getInvalidMaxError(propValue, componentName) {
|
|
81
|
+
return `Invalid prop \`max\` of value \`${propValue}\` supplied to \`${componentName}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${DEFAULT_MAX}\`.`;
|
|
82
|
+
}
|
|
83
|
+
function getInvalidValueError(propValue, componentName) {
|
|
84
|
+
return `Invalid prop \`value\` of value \`${propValue}\` supplied to \`${componentName}\`. The \`value\` prop must be:
|
|
85
|
+
- a positive number
|
|
86
|
+
- less than the value passed to \`max\` (or ${DEFAULT_MAX} if no \`max\` prop is set)
|
|
87
|
+
- \`null\` or \`undefined\` if the progress is indeterminate.
|
|
88
|
+
|
|
89
|
+
Defaulting to \`null\`.`;
|
|
90
|
+
}
|
|
91
|
+
var Root = Progress$2;
|
|
92
|
+
var Indicator = ProgressIndicator;
|
|
93
|
+
|
|
94
|
+
const Progress$1 = React.forwardRef(({ className, value, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
95
|
+
Root,
|
|
96
|
+
{
|
|
97
|
+
ref,
|
|
98
|
+
"data-slot": "progress",
|
|
99
|
+
className: cn(
|
|
100
|
+
"bg-primary/20 relative h-2 w-full overflow-hidden rounded-full",
|
|
101
|
+
className
|
|
102
|
+
),
|
|
103
|
+
...props,
|
|
104
|
+
children: /* @__PURE__ */ jsx(
|
|
105
|
+
Indicator,
|
|
106
|
+
{
|
|
107
|
+
"data-slot": "progress-indicator",
|
|
108
|
+
className: "bg-primary h-full w-full flex-1 transition-all",
|
|
109
|
+
style: { transform: `translateX(-${100 - (value || 0)}%)` }
|
|
110
|
+
}
|
|
111
|
+
)
|
|
112
|
+
}
|
|
113
|
+
));
|
|
114
|
+
Progress$1.displayName = Root.displayName;
|
|
115
|
+
|
|
116
|
+
const Progress = Progress$1;
|
|
117
|
+
|
|
118
|
+
export { Progress };
|
|
119
|
+
//# sourceMappingURL=Progress.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Progress.js","sources":["../../node_modules/@radix-ui/react-progress/dist/index.mjs","../../shadcn/shadcnProgress/Progress.tsx","../../lib/components/Progress/Progress.tsx"],"sourcesContent":["\"use client\";\n\n// src/progress.tsx\nimport * as React from \"react\";\nimport { createContextScope } from \"@radix-ui/react-context\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { jsx } from \"react/jsx-runtime\";\nvar PROGRESS_NAME = \"Progress\";\nvar DEFAULT_MAX = 100;\nvar [createProgressContext, createProgressScope] = createContextScope(PROGRESS_NAME);\nvar [ProgressProvider, useProgressContext] = createProgressContext(PROGRESS_NAME);\nvar Progress = React.forwardRef(\n (props, forwardedRef) => {\n const {\n __scopeProgress,\n value: valueProp = null,\n max: maxProp,\n getValueLabel = defaultGetValueLabel,\n ...progressProps\n } = props;\n if ((maxProp || maxProp === 0) && !isValidMaxNumber(maxProp)) {\n console.error(getInvalidMaxError(`${maxProp}`, \"Progress\"));\n }\n const max = isValidMaxNumber(maxProp) ? maxProp : DEFAULT_MAX;\n if (valueProp !== null && !isValidValueNumber(valueProp, max)) {\n console.error(getInvalidValueError(`${valueProp}`, \"Progress\"));\n }\n const value = isValidValueNumber(valueProp, max) ? valueProp : null;\n const valueLabel = isNumber(value) ? getValueLabel(value, max) : void 0;\n return /* @__PURE__ */ jsx(ProgressProvider, { scope: __scopeProgress, value, max, children: /* @__PURE__ */ jsx(\n Primitive.div,\n {\n \"aria-valuemax\": max,\n \"aria-valuemin\": 0,\n \"aria-valuenow\": isNumber(value) ? value : void 0,\n \"aria-valuetext\": valueLabel,\n role: \"progressbar\",\n \"data-state\": getProgressState(value, max),\n \"data-value\": value ?? void 0,\n \"data-max\": max,\n ...progressProps,\n ref: forwardedRef\n }\n ) });\n }\n);\nProgress.displayName = PROGRESS_NAME;\nvar INDICATOR_NAME = \"ProgressIndicator\";\nvar ProgressIndicator = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeProgress, ...indicatorProps } = props;\n const context = useProgressContext(INDICATOR_NAME, __scopeProgress);\n return /* @__PURE__ */ jsx(\n Primitive.div,\n {\n \"data-state\": getProgressState(context.value, context.max),\n \"data-value\": context.value ?? void 0,\n \"data-max\": context.max,\n ...indicatorProps,\n ref: forwardedRef\n }\n );\n }\n);\nProgressIndicator.displayName = INDICATOR_NAME;\nfunction defaultGetValueLabel(value, max) {\n return `${Math.round(value / max * 100)}%`;\n}\nfunction getProgressState(value, maxValue) {\n return value == null ? \"indeterminate\" : value === maxValue ? \"complete\" : \"loading\";\n}\nfunction isNumber(value) {\n return typeof value === \"number\";\n}\nfunction isValidMaxNumber(max) {\n return isNumber(max) && !isNaN(max) && max > 0;\n}\nfunction isValidValueNumber(value, max) {\n return isNumber(value) && !isNaN(value) && value <= max && value >= 0;\n}\nfunction getInvalidMaxError(propValue, componentName) {\n return `Invalid prop \\`max\\` of value \\`${propValue}\\` supplied to \\`${componentName}\\`. Only numbers greater than 0 are valid max values. Defaulting to \\`${DEFAULT_MAX}\\`.`;\n}\nfunction getInvalidValueError(propValue, componentName) {\n return `Invalid prop \\`value\\` of value \\`${propValue}\\` supplied to \\`${componentName}\\`. The \\`value\\` prop must be:\n - a positive number\n - less than the value passed to \\`max\\` (or ${DEFAULT_MAX} if no \\`max\\` prop is set)\n - \\`null\\` or \\`undefined\\` if the progress is indeterminate.\n\nDefaulting to \\`null\\`.`;\n}\nvar Root = Progress;\nvar Indicator = ProgressIndicator;\nexport {\n Indicator,\n Progress,\n ProgressIndicator,\n Root,\n createProgressScope\n};\n//# sourceMappingURL=index.mjs.map\n","\"use client\"\n\nimport * as React from \"react\"\nimport * as ProgressPrimitive from \"@radix-ui/react-progress\"\n\nimport { cn } from \"../utils\"\n\nconst Progress = React.forwardRef<\n React.ElementRef<typeof ProgressPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof ProgressPrimitive.Root>\n>(({ className, value, ...props }, ref) => (\n <ProgressPrimitive.Root\n ref={ref}\n data-slot=\"progress\"\n className={cn(\n \"bg-primary/20 relative h-2 w-full overflow-hidden rounded-full\",\n className\n )}\n {...props}\n >\n <ProgressPrimitive.Indicator\n data-slot=\"progress-indicator\"\n className=\"bg-primary h-full w-full flex-1 transition-all\"\n style={{ transform: `translateX(-${100 - (value || 0)}%)` }}\n />\n </ProgressPrimitive.Root>\n))\n\nProgress.displayName = ProgressPrimitive.Root.displayName\n\nexport { Progress }\n","import { Progress as ShadcnProgress } from '../../../shadcn/shadcnProgress/Progress';\n\nexport const Progress = ShadcnProgress;\n"],"names":["Progress","ProgressPrimitive.Root","ProgressPrimitive.Indicator","ShadcnProgress"],"mappings":";;;;;;AAOA,IAAI,aAAa,GAAG,UAAU;AAC9B,IAAI,WAAW,GAAG,GAAG;AACrB,IAAI,CAAC,qBAA0C,CAAC,GAAG,kBAAkB,CAAC,aAAa,CAAC;AACpF,IAAI,CAAC,gBAAgB,EAAE,kBAAkB,CAAC,GAAG,qBAAqB,CA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,gEAAA;AAAA,MACA;AAAA,KACF;AAAA,IACC,GAAG,KAAA;AAAA,IAEJ,QAAA,kBAAA,GAAA;AAAA,MAACC,SAAkB;AAAA,MAAlB;AAAA,QACC,WAAA,EAAU,oBAAA;AAAA,QACV,SAAA,EAAU,gDAAA;AAAA,QACV,OAAO,EAAE,SAAA,EAAW,eAAe,GAAA,IAAO,KAAA,IAAS,EAAE,CAAA,EAAA,CAAA;AAAK;AAAA;AAC5D;AACF,CACD,CAAA;AAEDF,UAAA,CAAS,WAAA,GAAcC,IAAkB,CAAK,WAAA;;AC1BvC,MAAM,QAAA,GAAWE;;;;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AuthProvider.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
|
|
2
2
|
import { ClassValue } from 'clsx';
|
|
3
|
+
import { Context } from 'react';
|
|
3
4
|
import { Country } from 'react-phone-number-input';
|
|
4
5
|
import { default as default_2 } from 'react';
|
|
5
6
|
import { isValidPhoneNumber } from 'react-phone-number-input';
|
|
@@ -120,6 +121,32 @@ export declare function cn(...inputs: ClassValue[]) {
|
|
|
120
121
|
|
|
121
122
|
export { isValidPhoneNumber }
|
|
122
123
|
|
|
124
|
+
export declare const OnboardingContext: Context<OnboardingContextType | undefined>;
|
|
125
|
+
|
|
126
|
+
export declare interface OnboardingContextType extends OnboardingData {
|
|
127
|
+
onboardingToken: string | null;
|
|
128
|
+
isLoading: boolean;
|
|
129
|
+
error: string | null;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
export declare interface OnboardingData {
|
|
133
|
+
userId: string;
|
|
134
|
+
email: string;
|
|
135
|
+
firstName: string;
|
|
136
|
+
lastName: string;
|
|
137
|
+
currentStep: string;
|
|
138
|
+
onboardingComplete: boolean;
|
|
139
|
+
accountStatus: string;
|
|
140
|
+
emailVerified: boolean;
|
|
141
|
+
phoneVerified: boolean;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
export declare const OnboardingProvider: default_2.FC<OnboardingProviderProps>;
|
|
145
|
+
|
|
146
|
+
declare interface OnboardingProviderProps {
|
|
147
|
+
children: default_2.ReactNode;
|
|
148
|
+
}
|
|
149
|
+
|
|
123
150
|
export declare const PasswordField: default_2.FC<PasswordFieldProps>;
|
|
124
151
|
|
|
125
152
|
declare interface PasswordFieldProps extends Omit<TextFieldProps, 'type' | 'endAdornment'> {
|
|
@@ -172,4 +199,6 @@ declare interface TypographyProps {
|
|
|
172
199
|
className?: string;
|
|
173
200
|
}
|
|
174
201
|
|
|
202
|
+
export declare const useOnboarding: () => OnboardingContextType;
|
|
203
|
+
|
|
175
204
|
export { }
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export { O as OnboardingContext, a as OnboardingProvider, u as useOnboarding } from './OnboardingProvider.js';
|
|
1
2
|
export { c as cn } from './utils.js';
|
|
2
3
|
export { B as Button, b as buttonVariants } from './Button.js';
|
|
3
4
|
export { C as Card, a as CardContent, b as CardDescription, c as CardFooter, d as CardHeader, e as CardTitle } from './Card.js';
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;"}
|
package/dist/index2.js
CHANGED
|
@@ -1,41 +1,64 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import 'react-dom';
|
|
3
|
-
import { c as createSlot } from './index3.js';
|
|
4
2
|
import { jsx } from 'react/jsx-runtime';
|
|
5
3
|
|
|
6
|
-
// src/
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
var Primitive = NODES.reduce((primitive, node) => {
|
|
27
|
-
const Slot = createSlot(`Primitive.${node}`);
|
|
28
|
-
const Node = React.forwardRef((props, forwardedRef) => {
|
|
29
|
-
const { asChild, ...primitiveProps } = props;
|
|
30
|
-
const Comp = asChild ? Slot : node;
|
|
31
|
-
if (typeof window !== "undefined") {
|
|
32
|
-
window[Symbol.for("radix-ui")] = true;
|
|
4
|
+
// packages/react/context/src/create-context.tsx
|
|
5
|
+
function createContextScope(scopeName, createContextScopeDeps = []) {
|
|
6
|
+
let defaultContexts = [];
|
|
7
|
+
function createContext3(rootComponentName, defaultContext) {
|
|
8
|
+
const BaseContext = React.createContext(defaultContext);
|
|
9
|
+
const index = defaultContexts.length;
|
|
10
|
+
defaultContexts = [...defaultContexts, defaultContext];
|
|
11
|
+
const Provider = (props) => {
|
|
12
|
+
const { scope, children, ...context } = props;
|
|
13
|
+
const Context = scope?.[scopeName]?.[index] || BaseContext;
|
|
14
|
+
const value = React.useMemo(() => context, Object.values(context));
|
|
15
|
+
return /* @__PURE__ */ jsx(Context.Provider, { value, children });
|
|
16
|
+
};
|
|
17
|
+
Provider.displayName = rootComponentName + "Provider";
|
|
18
|
+
function useContext2(consumerName, scope) {
|
|
19
|
+
const Context = scope?.[scopeName]?.[index] || BaseContext;
|
|
20
|
+
const context = React.useContext(Context);
|
|
21
|
+
if (context) return context;
|
|
22
|
+
if (defaultContext !== void 0) return defaultContext;
|
|
23
|
+
throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
|
|
33
24
|
}
|
|
34
|
-
return
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
25
|
+
return [Provider, useContext2];
|
|
26
|
+
}
|
|
27
|
+
const createScope = () => {
|
|
28
|
+
const scopeContexts = defaultContexts.map((defaultContext) => {
|
|
29
|
+
return React.createContext(defaultContext);
|
|
30
|
+
});
|
|
31
|
+
return function useScope(scope) {
|
|
32
|
+
const contexts = scope?.[scopeName] || scopeContexts;
|
|
33
|
+
return React.useMemo(
|
|
34
|
+
() => ({ [`__scope${scopeName}`]: { ...scope, [scopeName]: contexts } }),
|
|
35
|
+
[scope, contexts]
|
|
36
|
+
);
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
createScope.scopeName = scopeName;
|
|
40
|
+
return [createContext3, composeContextScopes(createScope, ...createContextScopeDeps)];
|
|
41
|
+
}
|
|
42
|
+
function composeContextScopes(...scopes) {
|
|
43
|
+
const baseScope = scopes[0];
|
|
44
|
+
if (scopes.length === 1) return baseScope;
|
|
45
|
+
const createScope = () => {
|
|
46
|
+
const scopeHooks = scopes.map((createScope2) => ({
|
|
47
|
+
useScope: createScope2(),
|
|
48
|
+
scopeName: createScope2.scopeName
|
|
49
|
+
}));
|
|
50
|
+
return function useComposedScopes(overrideScopes) {
|
|
51
|
+
const nextScopes = scopeHooks.reduce((nextScopes2, { useScope, scopeName }) => {
|
|
52
|
+
const scopeProps = useScope(overrideScopes);
|
|
53
|
+
const currentScope = scopeProps[`__scope${scopeName}`];
|
|
54
|
+
return { ...nextScopes2, ...currentScope };
|
|
55
|
+
}, {});
|
|
56
|
+
return React.useMemo(() => ({ [`__scope${baseScope.scopeName}`]: nextScopes }), [nextScopes]);
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
createScope.scopeName = baseScope.scopeName;
|
|
60
|
+
return createScope;
|
|
61
|
+
}
|
|
39
62
|
|
|
40
|
-
export {
|
|
63
|
+
export { createContextScope as c };
|
|
41
64
|
//# sourceMappingURL=index2.js.map
|
package/dist/index2.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index2.js","sources":["../node_modules/@radix-ui/react-
|
|
1
|
+
{"version":3,"file":"index2.js","sources":["../node_modules/@radix-ui/react-context/dist/index.mjs"],"sourcesContent":["// packages/react/context/src/create-context.tsx\nimport * as React from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\nfunction createContext2(rootComponentName, defaultContext) {\n const Context = React.createContext(defaultContext);\n const Provider = (props) => {\n const { children, ...context } = props;\n const value = React.useMemo(() => context, Object.values(context));\n return /* @__PURE__ */ jsx(Context.Provider, { value, children });\n };\n Provider.displayName = rootComponentName + \"Provider\";\n function useContext2(consumerName) {\n const context = React.useContext(Context);\n if (context) return context;\n if (defaultContext !== void 0) return defaultContext;\n throw new Error(`\\`${consumerName}\\` must be used within \\`${rootComponentName}\\``);\n }\n return [Provider, useContext2];\n}\nfunction createContextScope(scopeName, createContextScopeDeps = []) {\n let defaultContexts = [];\n function createContext3(rootComponentName, defaultContext) {\n const BaseContext = React.createContext(defaultContext);\n const index = defaultContexts.length;\n defaultContexts = [...defaultContexts, defaultContext];\n const Provider = (props) => {\n const { scope, children, ...context } = props;\n const Context = scope?.[scopeName]?.[index] || BaseContext;\n const value = React.useMemo(() => context, Object.values(context));\n return /* @__PURE__ */ jsx(Context.Provider, { value, children });\n };\n Provider.displayName = rootComponentName + \"Provider\";\n function useContext2(consumerName, scope) {\n const Context = scope?.[scopeName]?.[index] || BaseContext;\n const context = React.useContext(Context);\n if (context) return context;\n if (defaultContext !== void 0) return defaultContext;\n throw new Error(`\\`${consumerName}\\` must be used within \\`${rootComponentName}\\``);\n }\n return [Provider, useContext2];\n }\n const createScope = () => {\n const scopeContexts = defaultContexts.map((defaultContext) => {\n return React.createContext(defaultContext);\n });\n return function useScope(scope) {\n const contexts = scope?.[scopeName] || scopeContexts;\n return React.useMemo(\n () => ({ [`__scope${scopeName}`]: { ...scope, [scopeName]: contexts } }),\n [scope, contexts]\n );\n };\n };\n createScope.scopeName = scopeName;\n return [createContext3, composeContextScopes(createScope, ...createContextScopeDeps)];\n}\nfunction composeContextScopes(...scopes) {\n const baseScope = scopes[0];\n if (scopes.length === 1) return baseScope;\n const createScope = () => {\n const scopeHooks = scopes.map((createScope2) => ({\n useScope: createScope2(),\n scopeName: createScope2.scopeName\n }));\n return function useComposedScopes(overrideScopes) {\n const nextScopes = scopeHooks.reduce((nextScopes2, { useScope, scopeName }) => {\n const scopeProps = useScope(overrideScopes);\n const currentScope = scopeProps[`__scope${scopeName}`];\n return { ...nextScopes2, ...currentScope };\n }, {});\n return React.useMemo(() => ({ [`__scope${baseScope.scopeName}`]: nextScopes }), [nextScopes]);\n };\n };\n createScope.scopeName = baseScope.scopeName;\n return createScope;\n}\nexport {\n createContext2 as createContext,\n createContextScope\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":[],"mappings":";;;AAAA;AAmBA,SAAS,kBAAkB,CAAC,SAAS,EAAE,sBAAsB,GAAG,EAAE,EAAE;AACpE,EAAE,IAAI,eAAe,GAAG,EAAE;AAC1B,EAAE,SAAS,cAAc,CAAC,iBAAiB,EAAE,cAAc,EAAE;AAC7D,IAAI,MAAM,WAAW,GAAG,KAAK,CAAC,aAAa,CAAC,cAAc,CAAC;AAC3D,IAAI,MAAM,KAAK,GAAG,eAAe,CAAC,MAAM;AACxC,IAAI,eAAe,GAAG,CAAC,GAAG,eAAe,EAAE,cAAc,CAAC;AAC1D,IAAI,MAAM,QAAQ,GAAG,CAAC,KAAK,KAAK;AAChC,MAAM,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,OAAO,EAAE,GAAG,KAAK;AACnD,MAAM,MAAM,OAAO,GAAG,KAAK,GAAG,SAAS,CAAC,GAAG,KAAK,CAAC,IAAI,WAAW;AAChE,MAAM,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,MAAM,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;AACxE,MAAM,uBAAuB,GAAG,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC;AACvE,IAAI,CAAC;AACL,IAAI,QAAQ,CAAC,WA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,oBAAoB,CAAC,GAAG,MAAM,EAAE;AACzC,EAAE,MAAM,SAAS,GAAG,MAAM,CAAC,CAAC,CAAC;AAC7B,EAAE,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,OAAO,SAAS;AAC3C,EAAE,MAAM,WAAW,GAAG,MAAM;AAC5B,IAAI,MAAM,UAAU,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,YAAY,MAAM;AACrD,MAAM,QAAQ,EAAE,YAAY,EAAE;AAC9B,MAAM,SAAS,EAAE,YAAY,CAAC;AAC9B,KAAK,CAAC,CAAC;AACP,IAAI,OAAO,SAAS,iBAAiB,CAAC,cAAc,EAAE;AACtD,MAAM,MAAM,UAAU,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC,WAAW,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK;AACrF,QAAQ,MAAM,UAAU,GAAG,QAAQ,CAAC,cAAc,CAAC;AACnD,QAAQ,MAAM,YAAY,GAAG,UAAU,CAAC,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC,CAAC;AAC9D,QAAQ,OAAO,EAAE,GAAG,WAAW,EAAE,GAAG,YAAY,EAAE;AAClD,MAAM,CAAC,EAAE,EAAE,CAAC;AACZ,MAAM,OAAO,KAAK,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC,GAAG,UAAU,EAAE,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC;AACnG,IAAI,CAAC;AACL,EAAE,CAAC;AACH,EAAE,WAAW,CAAC,SAAS,GAAG,SAAS,CAAC,SAAS;AAC7C,EAAE,OAAO,WAAW;AACpB;;;;","x_google_ignoreList":[0]}
|
package/dist/index3.js
CHANGED
|
@@ -1,126 +1,41 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import 'react-dom';
|
|
3
|
+
import { c as createSlot } from './index4.js';
|
|
2
4
|
import { jsx } from 'react/jsx-runtime';
|
|
3
5
|
|
|
4
|
-
//
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}
|
|
32
|
-
};
|
|
6
|
+
// src/primitive.tsx
|
|
7
|
+
var NODES = [
|
|
8
|
+
"a",
|
|
9
|
+
"button",
|
|
10
|
+
"div",
|
|
11
|
+
"form",
|
|
12
|
+
"h2",
|
|
13
|
+
"h3",
|
|
14
|
+
"img",
|
|
15
|
+
"input",
|
|
16
|
+
"label",
|
|
17
|
+
"li",
|
|
18
|
+
"nav",
|
|
19
|
+
"ol",
|
|
20
|
+
"p",
|
|
21
|
+
"select",
|
|
22
|
+
"span",
|
|
23
|
+
"svg",
|
|
24
|
+
"ul"
|
|
25
|
+
];
|
|
26
|
+
var Primitive = NODES.reduce((primitive, node) => {
|
|
27
|
+
const Slot = createSlot(`Primitive.${node}`);
|
|
28
|
+
const Node = React.forwardRef((props, forwardedRef) => {
|
|
29
|
+
const { asChild, ...primitiveProps } = props;
|
|
30
|
+
const Comp = asChild ? Slot : node;
|
|
31
|
+
if (typeof window !== "undefined") {
|
|
32
|
+
window[Symbol.for("radix-ui")] = true;
|
|
33
33
|
}
|
|
34
|
-
|
|
35
|
-
}
|
|
36
|
-
function useComposedRefs(...refs) {
|
|
37
|
-
return React.useCallback(composeRefs(...refs), refs);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
// src/slot.tsx
|
|
41
|
-
// @__NO_SIDE_EFFECTS__
|
|
42
|
-
function createSlot(ownerName) {
|
|
43
|
-
const SlotClone = /* @__PURE__ */ createSlotClone(ownerName);
|
|
44
|
-
const Slot2 = React.forwardRef((props, forwardedRef) => {
|
|
45
|
-
const { children, ...slotProps } = props;
|
|
46
|
-
const childrenArray = React.Children.toArray(children);
|
|
47
|
-
const slottable = childrenArray.find(isSlottable);
|
|
48
|
-
if (slottable) {
|
|
49
|
-
const newElement = slottable.props.children;
|
|
50
|
-
const newChildren = childrenArray.map((child) => {
|
|
51
|
-
if (child === slottable) {
|
|
52
|
-
if (React.Children.count(newElement) > 1) return React.Children.only(null);
|
|
53
|
-
return React.isValidElement(newElement) ? newElement.props.children : null;
|
|
54
|
-
} else {
|
|
55
|
-
return child;
|
|
56
|
-
}
|
|
57
|
-
});
|
|
58
|
-
return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children: React.isValidElement(newElement) ? React.cloneElement(newElement, void 0, newChildren) : null });
|
|
59
|
-
}
|
|
60
|
-
return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children });
|
|
34
|
+
return /* @__PURE__ */ jsx(Comp, { ...primitiveProps, ref: forwardedRef });
|
|
61
35
|
});
|
|
62
|
-
|
|
63
|
-
return
|
|
64
|
-
}
|
|
65
|
-
var Slot = /* @__PURE__ */ createSlot("Slot");
|
|
66
|
-
// @__NO_SIDE_EFFECTS__
|
|
67
|
-
function createSlotClone(ownerName) {
|
|
68
|
-
const SlotClone = React.forwardRef((props, forwardedRef) => {
|
|
69
|
-
const { children, ...slotProps } = props;
|
|
70
|
-
if (React.isValidElement(children)) {
|
|
71
|
-
const childrenRef = getElementRef(children);
|
|
72
|
-
const props2 = mergeProps(slotProps, children.props);
|
|
73
|
-
if (children.type !== React.Fragment) {
|
|
74
|
-
props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;
|
|
75
|
-
}
|
|
76
|
-
return React.cloneElement(children, props2);
|
|
77
|
-
}
|
|
78
|
-
return React.Children.count(children) > 1 ? React.Children.only(null) : null;
|
|
79
|
-
});
|
|
80
|
-
SlotClone.displayName = `${ownerName}.SlotClone`;
|
|
81
|
-
return SlotClone;
|
|
82
|
-
}
|
|
83
|
-
var SLOTTABLE_IDENTIFIER = Symbol("radix.slottable");
|
|
84
|
-
function isSlottable(child) {
|
|
85
|
-
return React.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER;
|
|
86
|
-
}
|
|
87
|
-
function mergeProps(slotProps, childProps) {
|
|
88
|
-
const overrideProps = { ...childProps };
|
|
89
|
-
for (const propName in childProps) {
|
|
90
|
-
const slotPropValue = slotProps[propName];
|
|
91
|
-
const childPropValue = childProps[propName];
|
|
92
|
-
const isHandler = /^on[A-Z]/.test(propName);
|
|
93
|
-
if (isHandler) {
|
|
94
|
-
if (slotPropValue && childPropValue) {
|
|
95
|
-
overrideProps[propName] = (...args) => {
|
|
96
|
-
const result = childPropValue(...args);
|
|
97
|
-
slotPropValue(...args);
|
|
98
|
-
return result;
|
|
99
|
-
};
|
|
100
|
-
} else if (slotPropValue) {
|
|
101
|
-
overrideProps[propName] = slotPropValue;
|
|
102
|
-
}
|
|
103
|
-
} else if (propName === "style") {
|
|
104
|
-
overrideProps[propName] = { ...slotPropValue, ...childPropValue };
|
|
105
|
-
} else if (propName === "className") {
|
|
106
|
-
overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(" ");
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
return { ...slotProps, ...overrideProps };
|
|
110
|
-
}
|
|
111
|
-
function getElementRef(element) {
|
|
112
|
-
let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get;
|
|
113
|
-
let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
114
|
-
if (mayWarn) {
|
|
115
|
-
return element.ref;
|
|
116
|
-
}
|
|
117
|
-
getter = Object.getOwnPropertyDescriptor(element, "ref")?.get;
|
|
118
|
-
mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
119
|
-
if (mayWarn) {
|
|
120
|
-
return element.props.ref;
|
|
121
|
-
}
|
|
122
|
-
return element.props.ref || element.ref;
|
|
123
|
-
}
|
|
36
|
+
Node.displayName = `Primitive.${node}`;
|
|
37
|
+
return { ...primitive, [node]: Node };
|
|
38
|
+
}, {});
|
|
124
39
|
|
|
125
|
-
export {
|
|
40
|
+
export { Primitive as P };
|
|
126
41
|
//# sourceMappingURL=index3.js.map
|
package/dist/index3.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index3.js","sources":["../node_modules/@radix-ui/react-compose-refs/dist/index.mjs","../node_modules/@radix-ui/react-slot/dist/index.mjs"],"sourcesContent":["// packages/react/compose-refs/src/compose-refs.tsx\nimport * as React from \"react\";\nfunction setRef(ref, value) {\n if (typeof ref === \"function\") {\n return ref(value);\n } else if (ref !== null && ref !== void 0) {\n ref.current = value;\n }\n}\nfunction composeRefs(...refs) {\n return (node) => {\n let hasCleanup = false;\n const cleanups = refs.map((ref) => {\n const cleanup = setRef(ref, node);\n if (!hasCleanup && typeof cleanup == \"function\") {\n hasCleanup = true;\n }\n return cleanup;\n });\n if (hasCleanup) {\n return () => {\n for (let i = 0; i < cleanups.length; i++) {\n const cleanup = cleanups[i];\n if (typeof cleanup == \"function\") {\n cleanup();\n } else {\n setRef(refs[i], null);\n }\n }\n };\n }\n };\n}\nfunction useComposedRefs(...refs) {\n return React.useCallback(composeRefs(...refs), refs);\n}\nexport {\n composeRefs,\n useComposedRefs\n};\n//# sourceMappingURL=index.mjs.map\n","// src/slot.tsx\nimport * as React from \"react\";\nimport { composeRefs } from \"@radix-ui/react-compose-refs\";\nimport { Fragment as Fragment2, jsx } from \"react/jsx-runtime\";\n// @__NO_SIDE_EFFECTS__\nfunction createSlot(ownerName) {\n const SlotClone = /* @__PURE__ */ createSlotClone(ownerName);\n const Slot2 = React.forwardRef((props, forwardedRef) => {\n const { children, ...slotProps } = props;\n const childrenArray = React.Children.toArray(children);\n const slottable = childrenArray.find(isSlottable);\n if (slottable) {\n const newElement = slottable.props.children;\n const newChildren = childrenArray.map((child) => {\n if (child === slottable) {\n if (React.Children.count(newElement) > 1) return React.Children.only(null);\n return React.isValidElement(newElement) ? newElement.props.children : null;\n } else {\n return child;\n }\n });\n return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children: React.isValidElement(newElement) ? React.cloneElement(newElement, void 0, newChildren) : null });\n }\n return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children });\n });\n Slot2.displayName = `${ownerName}.Slot`;\n return Slot2;\n}\nvar Slot = /* @__PURE__ */ createSlot(\"Slot\");\n// @__NO_SIDE_EFFECTS__\nfunction createSlotClone(ownerName) {\n const SlotClone = React.forwardRef((props, forwardedRef) => {\n const { children, ...slotProps } = props;\n if (React.isValidElement(children)) {\n const childrenRef = getElementRef(children);\n const props2 = mergeProps(slotProps, children.props);\n if (children.type !== React.Fragment) {\n props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;\n }\n return React.cloneElement(children, props2);\n }\n return React.Children.count(children) > 1 ? React.Children.only(null) : null;\n });\n SlotClone.displayName = `${ownerName}.SlotClone`;\n return SlotClone;\n}\nvar SLOTTABLE_IDENTIFIER = Symbol(\"radix.slottable\");\n// @__NO_SIDE_EFFECTS__\nfunction createSlottable(ownerName) {\n const Slottable2 = ({ children }) => {\n return /* @__PURE__ */ jsx(Fragment2, { children });\n };\n Slottable2.displayName = `${ownerName}.Slottable`;\n Slottable2.__radixId = SLOTTABLE_IDENTIFIER;\n return Slottable2;\n}\nvar Slottable = /* @__PURE__ */ createSlottable(\"Slottable\");\nfunction isSlottable(child) {\n return React.isValidElement(child) && typeof child.type === \"function\" && \"__radixId\" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER;\n}\nfunction mergeProps(slotProps, childProps) {\n const overrideProps = { ...childProps };\n for (const propName in childProps) {\n const slotPropValue = slotProps[propName];\n const childPropValue = childProps[propName];\n const isHandler = /^on[A-Z]/.test(propName);\n if (isHandler) {\n if (slotPropValue && childPropValue) {\n overrideProps[propName] = (...args) => {\n const result = childPropValue(...args);\n slotPropValue(...args);\n return result;\n };\n } else if (slotPropValue) {\n overrideProps[propName] = slotPropValue;\n }\n } else if (propName === \"style\") {\n overrideProps[propName] = { ...slotPropValue, ...childPropValue };\n } else if (propName === \"className\") {\n overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(\" \");\n }\n }\n return { ...slotProps, ...overrideProps };\n}\nfunction getElementRef(element) {\n let getter = Object.getOwnPropertyDescriptor(element.props, \"ref\")?.get;\n let mayWarn = getter && \"isReactWarning\" in getter && getter.isReactWarning;\n if (mayWarn) {\n return element.ref;\n }\n getter = Object.getOwnPropertyDescriptor(element, \"ref\")?.get;\n mayWarn = getter && \"isReactWarning\" in getter && getter.isReactWarning;\n if (mayWarn) {\n return element.props.ref;\n }\n return element.props.ref || element.ref;\n}\nexport {\n Slot as Root,\n Slot,\n Slottable,\n createSlot,\n createSlottable\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":[],"mappings":";;;AAAA;AAEA,SAAS,MAAM,CAAC,GAAG,EAAE,KAAK,EAAE;AAC5B,EAAE,IAAI,OAAO,GAAG,KAAK,UAAU,EAAE;AACjC,IAAI,OAAO,GAAG,CAAC,KAAK,CAAC;AACrB,EAAE,CAAC,MAAM,IAAI,GAAG,KAAK,IAAI,IAAI,GAAG,KAAK,MAAM,EAAE;AAC7C,IAAI,GAAG,CAAC,OAAO,GAAG,KAAK;AACvB,EAAE;AACF;AACA,SAAS,WAAW,CAAC,GAAG,IAAI,EAAE;AAC9B,EAAE,OAAO,CAAC,IAAI,KAAK;AACnB,IAAI,IAAI,UAAU,GAAG,KAAK;AAC1B,IAAI,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,KAAK;AACvC,MAAM,MAAM,OAAO,GAAG,MAAM,CAAC,GAAG,EAAE,IAAI,CAAC;AACvC,MAAM,IAAI,CAAC,UAAU,IA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,EAAE,OAAO,GAAG,MAAM,IAAI,gBAAgB,IAAI,MAAM,IAAI,MAAM,CAAC,cAAc;AACzE,EAAE,IAAI,OAAO,EAAE;AACf,IAAI,OAAO,OAAO,CAAC,KAAK,CAAC,GAAG;AAC5B,EAAE;AACF,EAAE,OAAO,OAAO,CAAC,KAAK,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG;AACzC;;;;","x_google_ignoreList":[0,1]}
|
|
1
|
+
{"version":3,"file":"index3.js","sources":["../node_modules/@radix-ui/react-primitive/dist/index.mjs"],"sourcesContent":["// src/primitive.tsx\nimport * as React from \"react\";\nimport * as ReactDOM from \"react-dom\";\nimport { createSlot } from \"@radix-ui/react-slot\";\nimport { jsx } from \"react/jsx-runtime\";\nvar NODES = [\n \"a\",\n \"button\",\n \"div\",\n \"form\",\n \"h2\",\n \"h3\",\n \"img\",\n \"input\",\n \"label\",\n \"li\",\n \"nav\",\n \"ol\",\n \"p\",\n \"select\",\n \"span\",\n \"svg\",\n \"ul\"\n];\nvar Primitive = NODES.reduce((primitive, node) => {\n const Slot = createSlot(`Primitive.${node}`);\n const Node = React.forwardRef((props, forwardedRef) => {\n const { asChild, ...primitiveProps } = props;\n const Comp = asChild ? Slot : node;\n if (typeof window !== \"undefined\") {\n window[Symbol.for(\"radix-ui\")] = true;\n }\n return /* @__PURE__ */ jsx(Comp, { ...primitiveProps, ref: forwardedRef });\n });\n Node.displayName = `Primitive.${node}`;\n return { ...primitive, [node]: Node };\n}, {});\nfunction dispatchDiscreteCustomEvent(target, event) {\n if (target) ReactDOM.flushSync(() => target.dispatchEvent(event));\n}\nvar Root = Primitive;\nexport {\n Primitive,\n Root,\n dispatchDiscreteCustomEvent\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":[],"mappings":";;;;;AAAA;AAKA,IAAI,KAAK,GAAG;AACZ,EAAE,GAAG;AACL,EAAE,QAAQ;AACV,EAAE,KAAK;AACP,EAAE,MAAM;AACR,EAAE,IAAI;AACN,EAAE,IAAI;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