@axdspub/axiom-ui-forms 0.1.2 → 0.1.3
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/library/axiom-ui-forms.d.ts +9 -1
- package/library/index.js +305 -253
- package/library/index.js.map +1 -1
- package/library/umd.js +599 -546
- package/library/umd.js.map +1 -1
- package/package.json +1 -1
- package/rollup.config.mjs +10 -0
- package/src/Form/index.ts +1 -0
package/library/umd.js
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react'), require('react-dom'), require('react/jsx-runtime'), require('lodash')) :
|
3
3
|
typeof define === 'function' && define.amd ? define(['exports', 'react', 'react-dom', 'react/jsx-runtime', 'lodash'], factory) :
|
4
4
|
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.AxiomUIforms = {}, global.React, global.ReactDOM, global.JSXRuntime, global.lodash));
|
5
|
-
})(this, (function (exports,
|
5
|
+
})(this, (function (exports, React, ReactDOM__default, jsxRuntime, lodash) { 'use strict';
|
6
6
|
|
7
7
|
function _interopNamespaceDefault(e) {
|
8
8
|
var n = Object.create(null);
|
@@ -21,7 +21,7 @@
|
|
21
21
|
return Object.freeze(n);
|
22
22
|
}
|
23
23
|
|
24
|
-
var
|
24
|
+
var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
|
25
25
|
var ReactDOM__default__namespace = /*#__PURE__*/_interopNamespaceDefault(ReactDOM__default);
|
26
26
|
|
27
27
|
var getChildFields = function (field) {
|
@@ -146,14 +146,14 @@
|
|
146
146
|
};
|
147
147
|
|
148
148
|
var FieldLabelText = function (field) {
|
149
|
-
return (
|
149
|
+
return (React.createElement("strong", null,
|
150
150
|
field.label,
|
151
151
|
" ",
|
152
|
-
field.required === true ?
|
152
|
+
field.required === true ? React.createElement("span", { className: 'text-red-500' }, "*") : ''));
|
153
153
|
};
|
154
154
|
var FieldLabel = function (field) {
|
155
|
-
return
|
156
|
-
|
155
|
+
return React.createElement("p", { className: 'pb-2' },
|
156
|
+
React.createElement(FieldLabelText, __assign$1({}, field)));
|
157
157
|
};
|
158
158
|
|
159
159
|
var global$2 = (typeof global !== "undefined" ? global :
|
@@ -2905,9 +2905,9 @@
|
|
2905
2905
|
size: size,
|
2906
2906
|
type: type
|
2907
2907
|
});
|
2908
|
-
return (
|
2909
|
-
?
|
2910
|
-
:
|
2908
|
+
return (React.createElement(React.Fragment, null, href !== undefined
|
2909
|
+
? React.createElement("a", { href: href, target: target, className: cn, "aria-disabled": disabled }, children !== undefined ? children : label)
|
2910
|
+
: React.createElement("button", { className: cn, disabled: disabled, onClick: _onClick }, children !== undefined ? children : label)));
|
2911
2911
|
}
|
2912
2912
|
|
2913
2913
|
/** @class */ ((function (_super) {
|
@@ -2936,13 +2936,13 @@
|
|
2936
2936
|
ErrorBoundary.prototype.render = function () {
|
2937
2937
|
if (this.state.hasError) {
|
2938
2938
|
return this.props.FallbackComponent !== undefined && this.state.error !== undefined
|
2939
|
-
?
|
2940
|
-
:
|
2939
|
+
? React.createElement(this.props.FallbackComponent, { error: this.state.error })
|
2940
|
+
: React.createElement("h1", null, "There was an error");
|
2941
2941
|
}
|
2942
2942
|
return this.props.children;
|
2943
2943
|
};
|
2944
2944
|
return ErrorBoundary;
|
2945
|
-
})(
|
2945
|
+
})(React.Component));
|
2946
2946
|
|
2947
2947
|
function Checkbox(_a) {
|
2948
2948
|
_a.id; var _b = _a.testId, testId = _b === void 0 ? 'checkbox' : _b, value = _a.value, error = _a.error, _c = _a.disabled, disabled = _c === void 0 ? false : _c, onChange = _a.onChange, defaultClassName = _a.defaultClassName, _d = _a.className, className = _d === void 0 ? '' : _d, _e = _a.defaultWrapperClassName, defaultWrapperClassName = _e === void 0 ? 'block align-middle' : _e, wrapperClassName = _a.wrapperClassName; _a.size; var label = _a.label, after = _a.after, before = _a.before, _f = _a.align, align = _f === void 0 ? 'left' : _f;
|
@@ -2951,12 +2951,12 @@
|
|
2951
2951
|
right: 'ml-2',
|
2952
2952
|
none: ''
|
2953
2953
|
};
|
2954
|
-
var _g =
|
2954
|
+
var _g = React.useState(value), v = _g[0], setV = _g[1];
|
2955
2955
|
var updateValue = function (newValue) {
|
2956
2956
|
setV(newValue);
|
2957
2957
|
value = newValue;
|
2958
2958
|
};
|
2959
|
-
|
2959
|
+
React.useEffect(function () {
|
2960
2960
|
updateValue(value);
|
2961
2961
|
}, [value]);
|
2962
2962
|
var onInputChange = function (e) {
|
@@ -2967,7 +2967,7 @@
|
|
2967
2967
|
}
|
2968
2968
|
};
|
2969
2969
|
var CheckboxInput = function () {
|
2970
|
-
return (
|
2970
|
+
return (React.createElement("input", { "data-testid": testId, type: "checkbox", className: makeClassName({
|
2971
2971
|
defaultClassName: defaultClassName,
|
2972
2972
|
className: className,
|
2973
2973
|
error: error,
|
@@ -2975,30 +2975,30 @@
|
|
2975
2975
|
}), onChange: onInputChange, checked: !!v, disabled: disabled }));
|
2976
2976
|
};
|
2977
2977
|
var CheckboxContent = function () {
|
2978
|
-
return (
|
2978
|
+
return (React.createElement(React.Fragment, null,
|
2979
2979
|
before !== undefined ? before : '',
|
2980
|
-
align !== 'right' ?
|
2980
|
+
align !== 'right' ? React.createElement(CheckboxInput, null) : '',
|
2981
2981
|
label !== undefined ? label : '',
|
2982
|
-
align === 'right' ?
|
2982
|
+
align === 'right' ? React.createElement(CheckboxInput, null) : '',
|
2983
2983
|
after !== undefined ? after : ''));
|
2984
2984
|
};
|
2985
|
-
return (
|
2986
|
-
?
|
2985
|
+
return (React.createElement(React.Fragment, null, label !== undefined || after !== undefined || before !== undefined
|
2986
|
+
? React.createElement("label", { className: makeClassName({
|
2987
2987
|
defaultClassName: defaultWrapperClassName,
|
2988
2988
|
className: wrapperClassName
|
2989
2989
|
}) },
|
2990
|
-
|
2991
|
-
:
|
2990
|
+
React.createElement(CheckboxContent, null))
|
2991
|
+
: React.createElement(CheckboxContent, null)));
|
2992
2992
|
}
|
2993
2993
|
|
2994
2994
|
function Label(_a) {
|
2995
2995
|
var label = _a.label, children = _a.children, _b = _a.defaultClassName, defaultClassName = _b === void 0 ? 'block mb-2' : _b, className = _a.className;
|
2996
|
-
return (
|
2996
|
+
return (React.createElement(React.Fragment, null, label !== undefined ? React.createElement("span", { className: makeClassName({ defaultClassName: defaultClassName, className: className }) }, children !== undefined ? children : label) : ''));
|
2997
2997
|
}
|
2998
2998
|
|
2999
2999
|
function Description(_a) {
|
3000
3000
|
var description = _a.description, _b = _a.defaultClassName, defaultClassName = _b === void 0 ? 'block text-xs mb-2 mt-2' : _b, className = _a.className;
|
3001
|
-
return (
|
3001
|
+
return (React.createElement(React.Fragment, null, description !== undefined ? React.createElement("span", { className: makeClassName({ defaultClassName: defaultClassName, className: className }) }, description) : ''));
|
3002
3002
|
}
|
3003
3003
|
|
3004
3004
|
function _extends() {
|
@@ -3043,7 +3043,7 @@
|
|
3043
3043
|
* Accepts callback refs and RefObject(s)
|
3044
3044
|
*/ function $6ed0406888f73fc4$export$c7b2cbe3552a0d05(...refs) {
|
3045
3045
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
3046
|
-
return
|
3046
|
+
return React.useCallback($6ed0406888f73fc4$export$43e446d32b3d21af(...refs), refs);
|
3047
3047
|
}
|
3048
3048
|
|
3049
3049
|
/* -------------------------------------------------------------------------------------------------
|
@@ -3053,7 +3053,7 @@
|
|
3053
3053
|
/* -----------------------------------------------------------------------------------------------
|
3054
3054
|
* createContext
|
3055
3055
|
* ---------------------------------------------------------------------------------------------*/ function $c512c27ab02ef895$export$fd42f52fd3ae1109(rootComponentName, defaultContext) {
|
3056
|
-
const BaseContext = /*#__PURE__*/
|
3056
|
+
const BaseContext = /*#__PURE__*/ React.createContext(defaultContext);
|
3057
3057
|
const index = defaultContexts.length;
|
3058
3058
|
defaultContexts = [
|
3059
3059
|
...defaultContexts,
|
@@ -3063,15 +3063,15 @@
|
|
3063
3063
|
const { scope: scope , children: children , ...context } = props;
|
3064
3064
|
const Context = (scope === null || scope === void 0 ? void 0 : scope[scopeName][index]) || BaseContext; // Only re-memoize when prop values change
|
3065
3065
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
3066
|
-
const value =
|
3066
|
+
const value = React.useMemo(()=>context
|
3067
3067
|
, Object.values(context));
|
3068
|
-
return /*#__PURE__*/
|
3068
|
+
return /*#__PURE__*/ React.createElement(Context.Provider, {
|
3069
3069
|
value: value
|
3070
3070
|
}, children);
|
3071
3071
|
}
|
3072
3072
|
function useContext$1(consumerName, scope) {
|
3073
3073
|
const Context = (scope === null || scope === void 0 ? void 0 : scope[scopeName][index]) || BaseContext;
|
3074
|
-
const context =
|
3074
|
+
const context = React.useContext(Context);
|
3075
3075
|
if (context) return context;
|
3076
3076
|
if (defaultContext !== undefined) return defaultContext; // if a defaultContext wasn't specified, it's a required context.
|
3077
3077
|
throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
|
@@ -3086,11 +3086,11 @@
|
|
3086
3086
|
* createScope
|
3087
3087
|
* ---------------------------------------------------------------------------------------------*/ const createScope = ()=>{
|
3088
3088
|
const scopeContexts = defaultContexts.map((defaultContext)=>{
|
3089
|
-
return /*#__PURE__*/
|
3089
|
+
return /*#__PURE__*/ React.createContext(defaultContext);
|
3090
3090
|
});
|
3091
3091
|
return function useScope(scope) {
|
3092
3092
|
const contexts = (scope === null || scope === void 0 ? void 0 : scope[scopeName]) || scopeContexts;
|
3093
|
-
return
|
3093
|
+
return React.useMemo(()=>({
|
3094
3094
|
[`__scope${scopeName}`]: {
|
3095
3095
|
...scope,
|
3096
3096
|
[scopeName]: contexts
|
@@ -3131,7 +3131,7 @@
|
|
3131
3131
|
...currentScope
|
3132
3132
|
};
|
3133
3133
|
}, {});
|
3134
|
-
return
|
3134
|
+
return React.useMemo(()=>({
|
3135
3135
|
[`__scope${baseScope.scopeName}`]: nextScopes1
|
3136
3136
|
})
|
3137
3137
|
, [
|
@@ -3145,9 +3145,9 @@
|
|
3145
3145
|
|
3146
3146
|
/* -------------------------------------------------------------------------------------------------
|
3147
3147
|
* Slot
|
3148
|
-
* -----------------------------------------------------------------------------------------------*/ const $5e63c961fc1ce211$export$8c6ed5c666ac1360 = /*#__PURE__*/
|
3148
|
+
* -----------------------------------------------------------------------------------------------*/ const $5e63c961fc1ce211$export$8c6ed5c666ac1360 = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
3149
3149
|
const { children: children , ...slotProps } = props;
|
3150
|
-
const childrenArray =
|
3150
|
+
const childrenArray = React.Children.toArray(children);
|
3151
3151
|
const slottable = childrenArray.find($5e63c961fc1ce211$var$isSlottable);
|
3152
3152
|
if (slottable) {
|
3153
3153
|
// the new element to render is the one passed as a child of `Slottable`
|
@@ -3156,37 +3156,37 @@
|
|
3156
3156
|
if (child === slottable) {
|
3157
3157
|
// because the new element will be the one rendered, we are only interested
|
3158
3158
|
// in grabbing its children (`newElement.props.children`)
|
3159
|
-
if (
|
3160
|
-
return /*#__PURE__*/
|
3159
|
+
if (React.Children.count(newElement) > 1) return React.Children.only(null);
|
3160
|
+
return /*#__PURE__*/ React.isValidElement(newElement) ? newElement.props.children : null;
|
3161
3161
|
} else return child;
|
3162
3162
|
});
|
3163
|
-
return /*#__PURE__*/
|
3163
|
+
return /*#__PURE__*/ React.createElement($5e63c961fc1ce211$var$SlotClone, _extends({}, slotProps, {
|
3164
3164
|
ref: forwardedRef
|
3165
|
-
}), /*#__PURE__*/
|
3165
|
+
}), /*#__PURE__*/ React.isValidElement(newElement) ? /*#__PURE__*/ React.cloneElement(newElement, undefined, newChildren) : null);
|
3166
3166
|
}
|
3167
|
-
return /*#__PURE__*/
|
3167
|
+
return /*#__PURE__*/ React.createElement($5e63c961fc1ce211$var$SlotClone, _extends({}, slotProps, {
|
3168
3168
|
ref: forwardedRef
|
3169
3169
|
}), children);
|
3170
3170
|
});
|
3171
3171
|
$5e63c961fc1ce211$export$8c6ed5c666ac1360.displayName = 'Slot';
|
3172
3172
|
/* -------------------------------------------------------------------------------------------------
|
3173
3173
|
* SlotClone
|
3174
|
-
* -----------------------------------------------------------------------------------------------*/ const $5e63c961fc1ce211$var$SlotClone = /*#__PURE__*/
|
3174
|
+
* -----------------------------------------------------------------------------------------------*/ const $5e63c961fc1ce211$var$SlotClone = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
3175
3175
|
const { children: children , ...slotProps } = props;
|
3176
|
-
if (/*#__PURE__*/
|
3176
|
+
if (/*#__PURE__*/ React.isValidElement(children)) return /*#__PURE__*/ React.cloneElement(children, {
|
3177
3177
|
...$5e63c961fc1ce211$var$mergeProps(slotProps, children.props),
|
3178
3178
|
ref: forwardedRef ? $6ed0406888f73fc4$export$43e446d32b3d21af(forwardedRef, children.ref) : children.ref
|
3179
3179
|
});
|
3180
|
-
return
|
3180
|
+
return React.Children.count(children) > 1 ? React.Children.only(null) : null;
|
3181
3181
|
});
|
3182
3182
|
$5e63c961fc1ce211$var$SlotClone.displayName = 'SlotClone';
|
3183
3183
|
/* -------------------------------------------------------------------------------------------------
|
3184
3184
|
* Slottable
|
3185
3185
|
* -----------------------------------------------------------------------------------------------*/ const $5e63c961fc1ce211$export$d9f1ccf0bdb05d45 = ({ children: children })=>{
|
3186
|
-
return /*#__PURE__*/
|
3186
|
+
return /*#__PURE__*/ React.createElement(React.Fragment, null, children);
|
3187
3187
|
};
|
3188
3188
|
/* ---------------------------------------------------------------------------------------------- */ function $5e63c961fc1ce211$var$isSlottable(child) {
|
3189
|
-
return /*#__PURE__*/
|
3189
|
+
return /*#__PURE__*/ React.isValidElement(child) && child.type === $5e63c961fc1ce211$export$d9f1ccf0bdb05d45;
|
3190
3190
|
}
|
3191
3191
|
function $5e63c961fc1ce211$var$mergeProps(slotProps, childProps) {
|
3192
3192
|
// all child props should override
|
@@ -3242,13 +3242,13 @@
|
|
3242
3242
|
/* -------------------------------------------------------------------------------------------------
|
3243
3243
|
* Primitive
|
3244
3244
|
* -----------------------------------------------------------------------------------------------*/ const $8927f6f2acc4f386$export$250ffa63cdc0d034 = $8927f6f2acc4f386$var$NODES.reduce((primitive, node)=>{
|
3245
|
-
const Node = /*#__PURE__*/
|
3245
|
+
const Node = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
3246
3246
|
const { asChild: asChild , ...primitiveProps } = props;
|
3247
3247
|
const Comp = asChild ? $5e63c961fc1ce211$export$8c6ed5c666ac1360 : node;
|
3248
|
-
|
3248
|
+
React.useEffect(()=>{
|
3249
3249
|
window[Symbol.for('radix-ui')] = true;
|
3250
3250
|
}, []);
|
3251
|
-
return /*#__PURE__*/
|
3251
|
+
return /*#__PURE__*/ React.createElement(Comp, _extends({}, primitiveProps, {
|
3252
3252
|
ref: forwardedRef
|
3253
3253
|
}));
|
3254
3254
|
});
|
@@ -3317,9 +3317,9 @@
|
|
3317
3317
|
});
|
3318
3318
|
const CollectionProvider = (props)=>{
|
3319
3319
|
const { scope: scope , children: children } = props;
|
3320
|
-
const ref =
|
3321
|
-
const itemMap =
|
3322
|
-
return /*#__PURE__*/
|
3320
|
+
const ref = React.useRef(null);
|
3321
|
+
const itemMap = React.useRef(new Map()).current;
|
3322
|
+
return /*#__PURE__*/ React.createElement(CollectionProviderImpl, {
|
3323
3323
|
scope: scope,
|
3324
3324
|
itemMap: itemMap,
|
3325
3325
|
collectionRef: ref
|
@@ -3328,11 +3328,11 @@
|
|
3328
3328
|
/* -----------------------------------------------------------------------------------------------
|
3329
3329
|
* CollectionSlot
|
3330
3330
|
* ---------------------------------------------------------------------------------------------*/ const COLLECTION_SLOT_NAME = name + 'CollectionSlot';
|
3331
|
-
const CollectionSlot = /*#__PURE__*/
|
3331
|
+
const CollectionSlot = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
3332
3332
|
const { scope: scope , children: children } = props;
|
3333
3333
|
const context = useCollectionContext(COLLECTION_SLOT_NAME, scope);
|
3334
3334
|
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, context.collectionRef);
|
3335
|
-
return /*#__PURE__*/
|
3335
|
+
return /*#__PURE__*/ React.createElement($5e63c961fc1ce211$export$8c6ed5c666ac1360, {
|
3336
3336
|
ref: composedRefs
|
3337
3337
|
}, children);
|
3338
3338
|
});
|
@@ -3340,12 +3340,12 @@
|
|
3340
3340
|
* CollectionItem
|
3341
3341
|
* ---------------------------------------------------------------------------------------------*/ const ITEM_SLOT_NAME = name + 'CollectionItemSlot';
|
3342
3342
|
const ITEM_DATA_ATTR = 'data-radix-collection-item';
|
3343
|
-
const CollectionItemSlot = /*#__PURE__*/
|
3343
|
+
const CollectionItemSlot = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
3344
3344
|
const { scope: scope , children: children , ...itemData } = props;
|
3345
|
-
const ref =
|
3345
|
+
const ref = React.useRef(null);
|
3346
3346
|
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, ref);
|
3347
3347
|
const context = useCollectionContext(ITEM_SLOT_NAME, scope);
|
3348
|
-
|
3348
|
+
React.useEffect(()=>{
|
3349
3349
|
context.itemMap.set(ref, {
|
3350
3350
|
ref: ref,
|
3351
3351
|
...itemData
|
@@ -3353,7 +3353,7 @@
|
|
3353
3353
|
return ()=>void context.itemMap.delete(ref)
|
3354
3354
|
;
|
3355
3355
|
});
|
3356
|
-
return /*#__PURE__*/
|
3356
|
+
return /*#__PURE__*/ React.createElement($5e63c961fc1ce211$export$8c6ed5c666ac1360, {
|
3357
3357
|
[ITEM_DATA_ATTR]: '',
|
3358
3358
|
ref: composedRefs
|
3359
3359
|
}, children);
|
@@ -3362,7 +3362,7 @@
|
|
3362
3362
|
* useCollection
|
3363
3363
|
* ---------------------------------------------------------------------------------------------*/ function useCollection(scope) {
|
3364
3364
|
const context = useCollectionContext(name + 'CollectionConsumer', scope);
|
3365
|
-
const getItems =
|
3365
|
+
const getItems = React.useCallback(()=>{
|
3366
3366
|
const collectionNode = context.collectionRef.current;
|
3367
3367
|
if (!collectionNode) return [];
|
3368
3368
|
const orderedNodes = Array.from(collectionNode.querySelectorAll(`[${ITEM_DATA_ATTR}]`));
|
@@ -3393,13 +3393,13 @@
|
|
3393
3393
|
* We use this safe version which suppresses the warning by replacing it with a noop on the server.
|
3394
3394
|
*
|
3395
3395
|
* See: https://reactjs.org/docs/hooks-reference.html#uselayouteffect
|
3396
|
-
*/ const $9f79659886946c16$export$e5c5a5f917a5871c = Boolean(globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) ?
|
3396
|
+
*/ const $9f79659886946c16$export$e5c5a5f917a5871c = Boolean(globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) ? React.useLayoutEffect : ()=>{};
|
3397
3397
|
|
3398
|
-
const $1746a345f3d73bb7$var$useReactId =
|
3398
|
+
const $1746a345f3d73bb7$var$useReactId = React__namespace['useId'.toString()] || (()=>undefined
|
3399
3399
|
);
|
3400
3400
|
let $1746a345f3d73bb7$var$count = 0;
|
3401
3401
|
function $1746a345f3d73bb7$export$f680877a34711e37(deterministicId) {
|
3402
|
-
const [id, setId] =
|
3402
|
+
const [id, setId] = React__namespace.useState($1746a345f3d73bb7$var$useReactId()); // React versions older than 18 will have client-side ids only.
|
3403
3403
|
$9f79659886946c16$export$e5c5a5f917a5871c(()=>{
|
3404
3404
|
setId((reactId)=>reactId !== null && reactId !== void 0 ? reactId : String($1746a345f3d73bb7$var$count++)
|
3405
3405
|
);
|
@@ -3413,11 +3413,11 @@
|
|
3413
3413
|
* A custom hook that converts a callback to a ref to avoid triggering re-renders when passed as a
|
3414
3414
|
* prop or avoid re-executing effects when passed as a dependency
|
3415
3415
|
*/ function $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(callback) {
|
3416
|
-
const callbackRef =
|
3417
|
-
|
3416
|
+
const callbackRef = React.useRef(callback);
|
3417
|
+
React.useEffect(()=>{
|
3418
3418
|
callbackRef.current = callback;
|
3419
3419
|
}); // https://github.com/facebook/react/issues/19240
|
3420
|
-
return
|
3420
|
+
return React.useMemo(()=>(...args)=>{
|
3421
3421
|
var _callbackRef$current;
|
3422
3422
|
return (_callbackRef$current = callbackRef.current) === null || _callbackRef$current === void 0 ? void 0 : _callbackRef$current.call(callbackRef, ...args);
|
3423
3423
|
}
|
@@ -3432,7 +3432,7 @@
|
|
3432
3432
|
const isControlled = prop !== undefined;
|
3433
3433
|
const value1 = isControlled ? prop : uncontrolledProp;
|
3434
3434
|
const handleChange = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onChange);
|
3435
|
-
const setValue =
|
3435
|
+
const setValue = React.useCallback((nextValue)=>{
|
3436
3436
|
if (isControlled) {
|
3437
3437
|
const setter = nextValue;
|
3438
3438
|
const value = typeof nextValue === 'function' ? setter(prop) : nextValue;
|
@@ -3450,11 +3450,11 @@
|
|
3450
3450
|
];
|
3451
3451
|
}
|
3452
3452
|
function $71cd76cc60e0454e$var$useUncontrolledState({ defaultProp: defaultProp , onChange: onChange }) {
|
3453
|
-
const uncontrolledState =
|
3453
|
+
const uncontrolledState = React.useState(defaultProp);
|
3454
3454
|
const [value] = uncontrolledState;
|
3455
|
-
const prevValueRef =
|
3455
|
+
const prevValueRef = React.useRef(value);
|
3456
3456
|
const handleChange = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onChange);
|
3457
|
-
|
3457
|
+
React.useEffect(()=>{
|
3458
3458
|
if (prevValueRef.current !== value) {
|
3459
3459
|
handleChange(value);
|
3460
3460
|
prevValueRef.current = value;
|
@@ -3467,9 +3467,9 @@
|
|
3467
3467
|
return uncontrolledState;
|
3468
3468
|
}
|
3469
3469
|
|
3470
|
-
const $f631663db3294ace$var$DirectionContext = /*#__PURE__*/
|
3470
|
+
const $f631663db3294ace$var$DirectionContext = /*#__PURE__*/ React.createContext(undefined);
|
3471
3471
|
/* -----------------------------------------------------------------------------------------------*/ function $f631663db3294ace$export$b39126d51d94e6f3(localDir) {
|
3472
|
-
const globalDir =
|
3472
|
+
const globalDir = React.useContext($f631663db3294ace$var$DirectionContext);
|
3473
3473
|
return localDir || globalDir || 'ltr';
|
3474
3474
|
}
|
3475
3475
|
|
@@ -3486,18 +3486,18 @@
|
|
3486
3486
|
$d7bdfb9eb0fdf311$var$createCollectionScope
|
3487
3487
|
]);
|
3488
3488
|
const [$d7bdfb9eb0fdf311$var$RovingFocusProvider, $d7bdfb9eb0fdf311$var$useRovingFocusContext] = $d7bdfb9eb0fdf311$var$createRovingFocusGroupContext($d7bdfb9eb0fdf311$var$GROUP_NAME);
|
3489
|
-
const $d7bdfb9eb0fdf311$export$8699f7c8af148338 = /*#__PURE__*/
|
3490
|
-
return /*#__PURE__*/
|
3489
|
+
const $d7bdfb9eb0fdf311$export$8699f7c8af148338 = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
3490
|
+
return /*#__PURE__*/ React.createElement($d7bdfb9eb0fdf311$var$Collection.Provider, {
|
3491
3491
|
scope: props.__scopeRovingFocusGroup
|
3492
|
-
}, /*#__PURE__*/
|
3492
|
+
}, /*#__PURE__*/ React.createElement($d7bdfb9eb0fdf311$var$Collection.Slot, {
|
3493
3493
|
scope: props.__scopeRovingFocusGroup
|
3494
|
-
}, /*#__PURE__*/
|
3494
|
+
}, /*#__PURE__*/ React.createElement($d7bdfb9eb0fdf311$var$RovingFocusGroupImpl, _extends({}, props, {
|
3495
3495
|
ref: forwardedRef
|
3496
3496
|
}))));
|
3497
3497
|
});
|
3498
|
-
/* -----------------------------------------------------------------------------------------------*/ const $d7bdfb9eb0fdf311$var$RovingFocusGroupImpl = /*#__PURE__*/
|
3498
|
+
/* -----------------------------------------------------------------------------------------------*/ const $d7bdfb9eb0fdf311$var$RovingFocusGroupImpl = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
3499
3499
|
const { __scopeRovingFocusGroup: __scopeRovingFocusGroup , orientation: orientation , loop: loop = false , dir: dir , currentTabStopId: currentTabStopIdProp , defaultCurrentTabStopId: defaultCurrentTabStopId , onCurrentTabStopIdChange: onCurrentTabStopIdChange , onEntryFocus: onEntryFocus , ...groupProps } = props;
|
3500
|
-
const ref =
|
3500
|
+
const ref = React.useRef(null);
|
3501
3501
|
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, ref);
|
3502
3502
|
const direction = $f631663db3294ace$export$b39126d51d94e6f3(dir);
|
3503
3503
|
const [currentTabStopId = null, setCurrentTabStopId] = $71cd76cc60e0454e$export$6f32135080cb4c3({
|
@@ -3505,12 +3505,12 @@
|
|
3505
3505
|
defaultProp: defaultCurrentTabStopId,
|
3506
3506
|
onChange: onCurrentTabStopIdChange
|
3507
3507
|
});
|
3508
|
-
const [isTabbingBackOut, setIsTabbingBackOut] =
|
3508
|
+
const [isTabbingBackOut, setIsTabbingBackOut] = React.useState(false);
|
3509
3509
|
const handleEntryFocus = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onEntryFocus);
|
3510
3510
|
const getItems = $d7bdfb9eb0fdf311$var$useCollection(__scopeRovingFocusGroup);
|
3511
|
-
const isClickFocusRef =
|
3512
|
-
const [focusableItemsCount, setFocusableItemsCount] =
|
3513
|
-
|
3511
|
+
const isClickFocusRef = React.useRef(false);
|
3512
|
+
const [focusableItemsCount, setFocusableItemsCount] = React.useState(0);
|
3513
|
+
React.useEffect(()=>{
|
3514
3514
|
const node = ref.current;
|
3515
3515
|
if (node) {
|
3516
3516
|
node.addEventListener($d7bdfb9eb0fdf311$var$ENTRY_FOCUS, handleEntryFocus);
|
@@ -3520,25 +3520,25 @@
|
|
3520
3520
|
}, [
|
3521
3521
|
handleEntryFocus
|
3522
3522
|
]);
|
3523
|
-
return /*#__PURE__*/
|
3523
|
+
return /*#__PURE__*/ React.createElement($d7bdfb9eb0fdf311$var$RovingFocusProvider, {
|
3524
3524
|
scope: __scopeRovingFocusGroup,
|
3525
3525
|
orientation: orientation,
|
3526
3526
|
dir: direction,
|
3527
3527
|
loop: loop,
|
3528
3528
|
currentTabStopId: currentTabStopId,
|
3529
|
-
onItemFocus:
|
3529
|
+
onItemFocus: React.useCallback((tabStopId)=>setCurrentTabStopId(tabStopId)
|
3530
3530
|
, [
|
3531
3531
|
setCurrentTabStopId
|
3532
3532
|
]),
|
3533
|
-
onItemShiftTab:
|
3533
|
+
onItemShiftTab: React.useCallback(()=>setIsTabbingBackOut(true)
|
3534
3534
|
, []),
|
3535
|
-
onFocusableItemAdd:
|
3535
|
+
onFocusableItemAdd: React.useCallback(()=>setFocusableItemsCount((prevCount)=>prevCount + 1
|
3536
3536
|
)
|
3537
3537
|
, []),
|
3538
|
-
onFocusableItemRemove:
|
3538
|
+
onFocusableItemRemove: React.useCallback(()=>setFocusableItemsCount((prevCount)=>prevCount - 1
|
3539
3539
|
)
|
3540
3540
|
, [])
|
3541
|
-
}, /*#__PURE__*/
|
3541
|
+
}, /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({
|
3542
3542
|
tabIndex: isTabbingBackOut || focusableItemsCount === 0 ? -1 : 0,
|
3543
3543
|
"data-orientation": orientation
|
3544
3544
|
}, groupProps, {
|
@@ -3585,7 +3585,7 @@
|
|
3585
3585
|
/* -------------------------------------------------------------------------------------------------
|
3586
3586
|
* RovingFocusGroupItem
|
3587
3587
|
* -----------------------------------------------------------------------------------------------*/ const $d7bdfb9eb0fdf311$var$ITEM_NAME = 'RovingFocusGroupItem';
|
3588
|
-
const $d7bdfb9eb0fdf311$export$ab9df7c53fe8454 = /*#__PURE__*/
|
3588
|
+
const $d7bdfb9eb0fdf311$export$ab9df7c53fe8454 = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
3589
3589
|
const { __scopeRovingFocusGroup: __scopeRovingFocusGroup , focusable: focusable = true , active: active = false , tabStopId: tabStopId , ...itemProps } = props;
|
3590
3590
|
const autoId = $1746a345f3d73bb7$export$f680877a34711e37();
|
3591
3591
|
const id = tabStopId || autoId;
|
@@ -3593,7 +3593,7 @@
|
|
3593
3593
|
const isCurrentTabStop = context.currentTabStopId === id;
|
3594
3594
|
const getItems = $d7bdfb9eb0fdf311$var$useCollection(__scopeRovingFocusGroup);
|
3595
3595
|
const { onFocusableItemAdd: onFocusableItemAdd , onFocusableItemRemove: onFocusableItemRemove } = context;
|
3596
|
-
|
3596
|
+
React.useEffect(()=>{
|
3597
3597
|
if (focusable) {
|
3598
3598
|
onFocusableItemAdd();
|
3599
3599
|
return ()=>onFocusableItemRemove()
|
@@ -3604,12 +3604,12 @@
|
|
3604
3604
|
onFocusableItemAdd,
|
3605
3605
|
onFocusableItemRemove
|
3606
3606
|
]);
|
3607
|
-
return /*#__PURE__*/
|
3607
|
+
return /*#__PURE__*/ React.createElement($d7bdfb9eb0fdf311$var$Collection.ItemSlot, {
|
3608
3608
|
scope: __scopeRovingFocusGroup,
|
3609
3609
|
id: id,
|
3610
3610
|
focusable: focusable,
|
3611
3611
|
active: active
|
3612
|
-
}, /*#__PURE__*/
|
3612
|
+
}, /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.span, _extends({
|
3613
3613
|
tabIndex: isCurrentTabStop ? 0 : -1,
|
3614
3614
|
"data-orientation": context.orientation
|
3615
3615
|
}, itemProps, {
|
@@ -3697,7 +3697,7 @@
|
|
3697
3697
|
const $d7bdfb9eb0fdf311$export$6d08773d2e66f8f2 = $d7bdfb9eb0fdf311$export$ab9df7c53fe8454;
|
3698
3698
|
|
3699
3699
|
function $db6c3485150b8e66$export$1ab7ae714698c4b8(element) {
|
3700
|
-
const [size, setSize] =
|
3700
|
+
const [size, setSize] = React.useState(undefined);
|
3701
3701
|
$9f79659886946c16$export$e5c5a5f917a5871c(()=>{
|
3702
3702
|
if (element) {
|
3703
3703
|
// provide size as early as possible
|
@@ -3744,13 +3744,13 @@
|
|
3744
3744
|
}
|
3745
3745
|
|
3746
3746
|
function $010c2913dbd2fe3d$export$5cae361ad82dce8b(value) {
|
3747
|
-
const ref =
|
3747
|
+
const ref = React.useRef({
|
3748
3748
|
value: value,
|
3749
3749
|
previous: value
|
3750
3750
|
}); // We compare values before making an update to ensure that
|
3751
3751
|
// a change has been made. This ensures the previous value is
|
3752
3752
|
// persisted correctly between renders.
|
3753
|
-
return
|
3753
|
+
return React.useMemo(()=>{
|
3754
3754
|
if (ref.current.value !== value) {
|
3755
3755
|
ref.current.previous = ref.current.value;
|
3756
3756
|
ref.current.value = value;
|
@@ -3762,7 +3762,7 @@
|
|
3762
3762
|
}
|
3763
3763
|
|
3764
3764
|
function $fe963b355347cc68$export$3e6543de14f8614f(initialState, machine) {
|
3765
|
-
return
|
3765
|
+
return React.useReducer((state, event)=>{
|
3766
3766
|
const nextState = machine[state][event];
|
3767
3767
|
return nextState !== null && nextState !== void 0 ? nextState : state;
|
3768
3768
|
}, initialState);
|
@@ -3774,10 +3774,10 @@
|
|
3774
3774
|
const presence = $921a889cee6df7e8$var$usePresence(present);
|
3775
3775
|
const child = typeof children === 'function' ? children({
|
3776
3776
|
present: presence.isPresent
|
3777
|
-
}) :
|
3777
|
+
}) : React.Children.only(children);
|
3778
3778
|
const ref = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(presence.ref, child.ref);
|
3779
3779
|
const forceMount = typeof children === 'function';
|
3780
|
-
return forceMount || presence.isPresent ? /*#__PURE__*/
|
3780
|
+
return forceMount || presence.isPresent ? /*#__PURE__*/ React.cloneElement(child, {
|
3781
3781
|
ref: ref
|
3782
3782
|
}) : null;
|
3783
3783
|
};
|
@@ -3785,10 +3785,10 @@
|
|
3785
3785
|
/* -------------------------------------------------------------------------------------------------
|
3786
3786
|
* usePresence
|
3787
3787
|
* -----------------------------------------------------------------------------------------------*/ function $921a889cee6df7e8$var$usePresence(present) {
|
3788
|
-
const [node1, setNode] =
|
3789
|
-
const stylesRef =
|
3790
|
-
const prevPresentRef =
|
3791
|
-
const prevAnimationNameRef =
|
3788
|
+
const [node1, setNode] = React.useState();
|
3789
|
+
const stylesRef = React.useRef({});
|
3790
|
+
const prevPresentRef = React.useRef(present);
|
3791
|
+
const prevAnimationNameRef = React.useRef('none');
|
3792
3792
|
const initialState = present ? 'mounted' : 'unmounted';
|
3793
3793
|
const [state, send] = $fe963b355347cc68$export$3e6543de14f8614f(initialState, {
|
3794
3794
|
mounted: {
|
@@ -3803,7 +3803,7 @@
|
|
3803
3803
|
MOUNT: 'mounted'
|
3804
3804
|
}
|
3805
3805
|
});
|
3806
|
-
|
3806
|
+
React.useEffect(()=>{
|
3807
3807
|
const currentAnimationName = $921a889cee6df7e8$var$getAnimationName(stylesRef.current);
|
3808
3808
|
prevAnimationNameRef.current = state === 'mounted' ? currentAnimationName : 'none';
|
3809
3809
|
}, [
|
@@ -3875,7 +3875,7 @@
|
|
3875
3875
|
'mounted',
|
3876
3876
|
'unmountSuspended'
|
3877
3877
|
].includes(state),
|
3878
|
-
ref:
|
3878
|
+
ref: React.useCallback((node)=>{
|
3879
3879
|
if (node) stylesRef.current = getComputedStyle(node);
|
3880
3880
|
setNode(node);
|
3881
3881
|
}, [])
|
@@ -3890,18 +3890,18 @@
|
|
3890
3890
|
* -----------------------------------------------------------------------------------------------*/ const $ce77a8961b41be9e$var$RADIO_NAME = 'Radio';
|
3891
3891
|
const [$ce77a8961b41be9e$var$createRadioContext, $ce77a8961b41be9e$export$67d2296460f1b002] = $c512c27ab02ef895$export$50c7b4e9d9f19c1($ce77a8961b41be9e$var$RADIO_NAME);
|
3892
3892
|
const [$ce77a8961b41be9e$var$RadioProvider, $ce77a8961b41be9e$var$useRadioContext] = $ce77a8961b41be9e$var$createRadioContext($ce77a8961b41be9e$var$RADIO_NAME);
|
3893
|
-
const $ce77a8961b41be9e$export$d7b12c4107be0d61 = /*#__PURE__*/
|
3893
|
+
const $ce77a8961b41be9e$export$d7b12c4107be0d61 = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
3894
3894
|
const { __scopeRadio: __scopeRadio , name: name , checked: checked = false , required: required , disabled: disabled , value: value = 'on' , onCheck: onCheck , ...radioProps } = props;
|
3895
|
-
const [button, setButton] =
|
3895
|
+
const [button, setButton] = React.useState(null);
|
3896
3896
|
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, (node)=>setButton(node)
|
3897
3897
|
);
|
3898
|
-
const hasConsumerStoppedPropagationRef =
|
3898
|
+
const hasConsumerStoppedPropagationRef = React.useRef(false); // We set this to true by default so that events bubble to forms without JS (SSR)
|
3899
3899
|
const isFormControl = button ? Boolean(button.closest('form')) : true;
|
3900
|
-
return /*#__PURE__*/
|
3900
|
+
return /*#__PURE__*/ React.createElement($ce77a8961b41be9e$var$RadioProvider, {
|
3901
3901
|
scope: __scopeRadio,
|
3902
3902
|
checked: checked,
|
3903
3903
|
disabled: disabled
|
3904
|
-
}, /*#__PURE__*/
|
3904
|
+
}, /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.button, _extends({
|
3905
3905
|
type: "button",
|
3906
3906
|
role: "radio",
|
3907
3907
|
"aria-checked": checked,
|
@@ -3921,7 +3921,7 @@
|
|
3921
3921
|
if (!hasConsumerStoppedPropagationRef.current) event.stopPropagation();
|
3922
3922
|
}
|
3923
3923
|
})
|
3924
|
-
})), isFormControl && /*#__PURE__*/
|
3924
|
+
})), isFormControl && /*#__PURE__*/ React.createElement($ce77a8961b41be9e$var$BubbleInput, {
|
3925
3925
|
control: button,
|
3926
3926
|
bubbles: !hasConsumerStoppedPropagationRef.current,
|
3927
3927
|
name: name,
|
@@ -3938,12 +3938,12 @@
|
|
3938
3938
|
/* -------------------------------------------------------------------------------------------------
|
3939
3939
|
* RadioIndicator
|
3940
3940
|
* -----------------------------------------------------------------------------------------------*/ const $ce77a8961b41be9e$var$INDICATOR_NAME = 'RadioIndicator';
|
3941
|
-
const $ce77a8961b41be9e$export$d35a9ffa9a04f9e7 = /*#__PURE__*/
|
3941
|
+
const $ce77a8961b41be9e$export$d35a9ffa9a04f9e7 = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
3942
3942
|
const { __scopeRadio: __scopeRadio , forceMount: forceMount , ...indicatorProps } = props;
|
3943
3943
|
const context = $ce77a8961b41be9e$var$useRadioContext($ce77a8961b41be9e$var$INDICATOR_NAME, __scopeRadio);
|
3944
|
-
return /*#__PURE__*/
|
3944
|
+
return /*#__PURE__*/ React.createElement($921a889cee6df7e8$export$99c2b779aa4e8b8b, {
|
3945
3945
|
present: forceMount || context.checked
|
3946
|
-
}, /*#__PURE__*/
|
3946
|
+
}, /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.span, _extends({
|
3947
3947
|
"data-state": $ce77a8961b41be9e$var$getState(context.checked),
|
3948
3948
|
"data-disabled": context.disabled ? '' : undefined
|
3949
3949
|
}, indicatorProps, {
|
@@ -3952,10 +3952,10 @@
|
|
3952
3952
|
});
|
3953
3953
|
/* ---------------------------------------------------------------------------------------------- */ const $ce77a8961b41be9e$var$BubbleInput = (props)=>{
|
3954
3954
|
const { control: control , checked: checked , bubbles: bubbles = true , ...inputProps } = props;
|
3955
|
-
const ref =
|
3955
|
+
const ref = React.useRef(null);
|
3956
3956
|
const prevChecked = $010c2913dbd2fe3d$export$5cae361ad82dce8b(checked);
|
3957
3957
|
const controlSize = $db6c3485150b8e66$export$1ab7ae714698c4b8(control); // Bubble checked change to parents (e.g form change event)
|
3958
|
-
|
3958
|
+
React.useEffect(()=>{
|
3959
3959
|
const input = ref.current;
|
3960
3960
|
const inputProto = window.HTMLInputElement.prototype;
|
3961
3961
|
const descriptor = Object.getOwnPropertyDescriptor(inputProto, 'checked');
|
@@ -3972,7 +3972,7 @@
|
|
3972
3972
|
checked,
|
3973
3973
|
bubbles
|
3974
3974
|
]);
|
3975
|
-
return /*#__PURE__*/
|
3975
|
+
return /*#__PURE__*/ React.createElement("input", _extends({
|
3976
3976
|
type: "radio",
|
3977
3977
|
"aria-hidden": true,
|
3978
3978
|
defaultChecked: checked
|
@@ -4010,7 +4010,7 @@
|
|
4010
4010
|
const $f99a8c78507165f7$var$useRovingFocusGroupScope = $d7bdfb9eb0fdf311$export$c7109489551a4f4();
|
4011
4011
|
const $f99a8c78507165f7$var$useRadioScope = $ce77a8961b41be9e$export$67d2296460f1b002();
|
4012
4012
|
const [$f99a8c78507165f7$var$RadioGroupProvider, $f99a8c78507165f7$var$useRadioGroupContext] = $f99a8c78507165f7$var$createRadioGroupContext($f99a8c78507165f7$var$RADIO_GROUP_NAME);
|
4013
|
-
const $f99a8c78507165f7$export$a98f0dcb43a68a25 = /*#__PURE__*/
|
4013
|
+
const $f99a8c78507165f7$export$a98f0dcb43a68a25 = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
4014
4014
|
const { __scopeRadioGroup: __scopeRadioGroup , name: name , defaultValue: defaultValue , value: valueProp , required: required = false , disabled: disabled = false , orientation: orientation , dir: dir , loop: loop = true , onValueChange: onValueChange , ...groupProps } = props;
|
4015
4015
|
const rovingFocusGroupScope = $f99a8c78507165f7$var$useRovingFocusGroupScope(__scopeRadioGroup);
|
4016
4016
|
const direction = $f631663db3294ace$export$b39126d51d94e6f3(dir);
|
@@ -4019,20 +4019,20 @@
|
|
4019
4019
|
defaultProp: defaultValue,
|
4020
4020
|
onChange: onValueChange
|
4021
4021
|
});
|
4022
|
-
return /*#__PURE__*/
|
4022
|
+
return /*#__PURE__*/ React.createElement($f99a8c78507165f7$var$RadioGroupProvider, {
|
4023
4023
|
scope: __scopeRadioGroup,
|
4024
4024
|
name: name,
|
4025
4025
|
required: required,
|
4026
4026
|
disabled: disabled,
|
4027
4027
|
value: value,
|
4028
4028
|
onValueChange: setValue
|
4029
|
-
}, /*#__PURE__*/
|
4029
|
+
}, /*#__PURE__*/ React.createElement($d7bdfb9eb0fdf311$export$be92b6f5f03c0fe9, _extends({
|
4030
4030
|
asChild: true
|
4031
4031
|
}, rovingFocusGroupScope, {
|
4032
4032
|
orientation: orientation,
|
4033
4033
|
dir: direction,
|
4034
4034
|
loop: loop
|
4035
|
-
}), /*#__PURE__*/
|
4035
|
+
}), /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({
|
4036
4036
|
role: "radiogroup",
|
4037
4037
|
"aria-required": required,
|
4038
4038
|
"aria-orientation": orientation,
|
@@ -4045,17 +4045,17 @@
|
|
4045
4045
|
/* -------------------------------------------------------------------------------------------------
|
4046
4046
|
* RadioGroupItem
|
4047
4047
|
* -----------------------------------------------------------------------------------------------*/ const $f99a8c78507165f7$var$ITEM_NAME = 'RadioGroupItem';
|
4048
|
-
const $f99a8c78507165f7$export$9f866c100ef519e4 = /*#__PURE__*/
|
4048
|
+
const $f99a8c78507165f7$export$9f866c100ef519e4 = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
4049
4049
|
const { __scopeRadioGroup: __scopeRadioGroup , disabled: disabled , ...itemProps } = props;
|
4050
4050
|
const context = $f99a8c78507165f7$var$useRadioGroupContext($f99a8c78507165f7$var$ITEM_NAME, __scopeRadioGroup);
|
4051
4051
|
const isDisabled = context.disabled || disabled;
|
4052
4052
|
const rovingFocusGroupScope = $f99a8c78507165f7$var$useRovingFocusGroupScope(__scopeRadioGroup);
|
4053
4053
|
const radioScope = $f99a8c78507165f7$var$useRadioScope(__scopeRadioGroup);
|
4054
|
-
const ref =
|
4054
|
+
const ref = React.useRef(null);
|
4055
4055
|
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, ref);
|
4056
4056
|
const checked = context.value === itemProps.value;
|
4057
|
-
const isArrowKeyPressedRef =
|
4058
|
-
|
4057
|
+
const isArrowKeyPressedRef = React.useRef(false);
|
4058
|
+
React.useEffect(()=>{
|
4059
4059
|
const handleKeyDown = (event)=>{
|
4060
4060
|
if ($f99a8c78507165f7$var$ARROW_KEYS.includes(event.key)) isArrowKeyPressedRef.current = true;
|
4061
4061
|
};
|
@@ -4068,12 +4068,12 @@
|
|
4068
4068
|
document.removeEventListener('keyup', handleKeyUp);
|
4069
4069
|
};
|
4070
4070
|
}, []);
|
4071
|
-
return /*#__PURE__*/
|
4071
|
+
return /*#__PURE__*/ React.createElement($d7bdfb9eb0fdf311$export$6d08773d2e66f8f2, _extends({
|
4072
4072
|
asChild: true
|
4073
4073
|
}, rovingFocusGroupScope, {
|
4074
4074
|
focusable: !isDisabled,
|
4075
4075
|
active: checked
|
4076
|
-
}), /*#__PURE__*/
|
4076
|
+
}), /*#__PURE__*/ React.createElement($ce77a8961b41be9e$export$d7b12c4107be0d61, _extends({
|
4077
4077
|
disabled: isDisabled,
|
4078
4078
|
required: context.required,
|
4079
4079
|
checked: checked
|
@@ -4096,10 +4096,10 @@
|
|
4096
4096
|
})
|
4097
4097
|
})));
|
4098
4098
|
});
|
4099
|
-
const $f99a8c78507165f7$export$5fb54c671a65c88 = /*#__PURE__*/
|
4099
|
+
const $f99a8c78507165f7$export$5fb54c671a65c88 = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
4100
4100
|
const { __scopeRadioGroup: __scopeRadioGroup , ...indicatorProps } = props;
|
4101
4101
|
const radioScope = $f99a8c78507165f7$var$useRadioScope(__scopeRadioGroup);
|
4102
|
-
return /*#__PURE__*/
|
4102
|
+
return /*#__PURE__*/ React.createElement($ce77a8961b41be9e$export$d35a9ffa9a04f9e7, _extends({}, radioScope, indicatorProps, {
|
4103
4103
|
ref: forwardedRef
|
4104
4104
|
}));
|
4105
4105
|
});
|
@@ -4153,38 +4153,38 @@
|
|
4153
4153
|
}
|
4154
4154
|
}
|
4155
4155
|
};
|
4156
|
-
var _k =
|
4156
|
+
var _k = React.useState(value), val = _k[0], setVal = _k[1];
|
4157
4157
|
var instanceId = crypto !== undefined ? crypto.randomUUID() : "".concat(Math.random().toString(36).substring(2, 15), "-").concat(Math.random().toString(36).substring(2, 15));
|
4158
|
-
|
4158
|
+
React.useEffect(function () {
|
4159
4159
|
setVal(value);
|
4160
4160
|
}, [value]);
|
4161
|
-
return (
|
4161
|
+
return (React.createElement("div", null,
|
4162
4162
|
before !== undefined ? before : '',
|
4163
4163
|
typeof label === 'string'
|
4164
|
-
?
|
4164
|
+
? React.createElement(Label, { label: label })
|
4165
4165
|
: label !== undefined ? label : '',
|
4166
4166
|
typeof description === 'string'
|
4167
|
-
?
|
4167
|
+
? React.createElement(Description, { description: description })
|
4168
4168
|
: description !== undefined ? description : '',
|
4169
|
-
|
4170
|
-
|
4169
|
+
React.createElement("div", { className: "flex gap-2" },
|
4170
|
+
React.createElement($f99a8c78507165f7$export$be92b6f5f03c0fe9, { className: "".concat(makeClassName({ defaultClassName: defaultClassName, className: className })), "aria-label": 'Select from options', onValueChange: onSelectChange, defaultValue: value, value: val }, options.map(function (option) {
|
4171
4171
|
var optionId = "".concat(option.value, ".").concat(instanceId);
|
4172
|
-
return (
|
4173
|
-
|
4174
|
-
|
4175
|
-
|
4172
|
+
return (React.createElement("div", { className: "flex items-center", key: option.value },
|
4173
|
+
React.createElement($f99a8c78507165f7$export$6d08773d2e66f8f2, { className: defaultSelectorStyle, id: optionId, value: option.value },
|
4174
|
+
React.createElement($f99a8c78507165f7$export$adb584737d712b70, { className: defaultSelectedStyle })),
|
4175
|
+
React.createElement("label", { className: defaultLabelStyle, htmlFor: optionId }, option.label)));
|
4176
4176
|
}))),
|
4177
4177
|
after !== undefined ? after : ''));
|
4178
4178
|
}
|
4179
4179
|
|
4180
4180
|
function Input(_a) {
|
4181
4181
|
_a.id; var _b = _a.testId, testId = _b === void 0 ? 'input' : _b, value = _a.value, onChange = _a.onChange, onSubmit = _a.onSubmit; _a.submitOnEnter; var error = _a.error, _d = _a.size, size = _d === void 0 ? 'med' : _d, _e = _a.defaultClassName, defaultClassName = _e === void 0 ? 'block border border-slate-300 focus:outline-blue-400 w-full disabled:opacity-50 disabled:bg-slate-50' : _e, className = _a.className, wrapperClassName = _a.wrapperClassName, _f = _a.defaultWrapperClassName, defaultWrapperClassName = _f === void 0 ? 'block' : _f, _g = _a.disabled, disabled = _g === void 0 ? false : _g, placeholder = _a.placeholder, label = _a.label, description = _a.description, before = _a.before, after = _a.after, cleaner = _a.cleaner, _h = _a.autofocus, autofocus = _h === void 0 ? false : _h, _j = _a.type, type = _j === void 0 ? 'text' : _j, validator = _a.validator;
|
4182
|
-
var _k =
|
4182
|
+
var _k = React.useState(value), v = _k[0], setV = _k[1];
|
4183
4183
|
var updateValue = function (newValue) {
|
4184
4184
|
setV(newValue);
|
4185
4185
|
value = newValue;
|
4186
4186
|
};
|
4187
|
-
|
4187
|
+
React.useMemo(function () {
|
4188
4188
|
updateValue(value);
|
4189
4189
|
}, [value]);
|
4190
4190
|
var onInputChange = function (e) {
|
@@ -4197,19 +4197,19 @@
|
|
4197
4197
|
onChange(newV);
|
4198
4198
|
}
|
4199
4199
|
};
|
4200
|
-
return (
|
4201
|
-
|
4200
|
+
return (React.createElement(React.Fragment, null,
|
4201
|
+
React.createElement("label", { className: makeClassName({
|
4202
4202
|
defaultClassName: defaultWrapperClassName,
|
4203
4203
|
className: wrapperClassName
|
4204
4204
|
}) },
|
4205
4205
|
typeof label === 'string'
|
4206
|
-
?
|
4206
|
+
? React.createElement(Label, { label: label })
|
4207
4207
|
: label !== undefined ? label : '',
|
4208
4208
|
typeof description === 'string'
|
4209
|
-
?
|
4209
|
+
? React.createElement(Description, { description: description })
|
4210
4210
|
: description !== undefined ? description : '',
|
4211
4211
|
before !== undefined ? before : '',
|
4212
|
-
|
4212
|
+
React.createElement("input", __assign({ autoFocus: autofocus, className: makeClassName({ defaultClassName: defaultClassName, size: size, className: className, error: error, errorClassName: 'border-2 border-rose-600' }), placeholder: placeholder, onChange: onInputChange, "data-testid": testId, disabled: disabled, onKeyUp: function (e) {
|
4213
4213
|
if (typeof onSubmit === 'function' && e.key === 'Enter') {
|
4214
4214
|
onSubmit(v);
|
4215
4215
|
}
|
@@ -4221,7 +4221,7 @@
|
|
4221
4221
|
* Listens for when the escape key is down
|
4222
4222
|
*/ function $addc16e1bbe58fd0$export$3a72a57244d6e765(onEscapeKeyDownProp, ownerDocument = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) {
|
4223
4223
|
const onEscapeKeyDown = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onEscapeKeyDownProp);
|
4224
|
-
|
4224
|
+
React.useEffect(()=>{
|
4225
4225
|
const handleKeyDown = (event)=>{
|
4226
4226
|
if (event.key === 'Escape') onEscapeKeyDown(event);
|
4227
4227
|
};
|
@@ -4238,18 +4238,18 @@
|
|
4238
4238
|
const $5cb92bef7577960e$var$POINTER_DOWN_OUTSIDE$1 = 'dismissableLayer.pointerDownOutside';
|
4239
4239
|
const $5cb92bef7577960e$var$FOCUS_OUTSIDE$1 = 'dismissableLayer.focusOutside';
|
4240
4240
|
let $5cb92bef7577960e$var$originalBodyPointerEvents$1;
|
4241
|
-
const $5cb92bef7577960e$var$DismissableLayerContext$1 = /*#__PURE__*/
|
4241
|
+
const $5cb92bef7577960e$var$DismissableLayerContext$1 = /*#__PURE__*/ React.createContext({
|
4242
4242
|
layers: new Set(),
|
4243
4243
|
layersWithOutsidePointerEventsDisabled: new Set(),
|
4244
4244
|
branches: new Set()
|
4245
4245
|
});
|
4246
|
-
const $5cb92bef7577960e$export$177fb62ff3ec1f22$1 = /*#__PURE__*/
|
4246
|
+
const $5cb92bef7577960e$export$177fb62ff3ec1f22$1 = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
4247
4247
|
var _node$ownerDocument;
|
4248
4248
|
const { disableOutsidePointerEvents: disableOutsidePointerEvents = false , onEscapeKeyDown: onEscapeKeyDown , onPointerDownOutside: onPointerDownOutside , onFocusOutside: onFocusOutside , onInteractOutside: onInteractOutside , onDismiss: onDismiss , ...layerProps } = props;
|
4249
|
-
const context =
|
4250
|
-
const [node1, setNode] =
|
4249
|
+
const context = React.useContext($5cb92bef7577960e$var$DismissableLayerContext$1);
|
4250
|
+
const [node1, setNode] = React.useState(null);
|
4251
4251
|
const ownerDocument = (_node$ownerDocument = node1 === null || node1 === void 0 ? void 0 : node1.ownerDocument) !== null && _node$ownerDocument !== void 0 ? _node$ownerDocument : globalThis === null || globalThis === void 0 ? void 0 : globalThis.document;
|
4252
|
-
const [, force] =
|
4252
|
+
const [, force] = React.useState({});
|
4253
4253
|
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, (node)=>setNode(node)
|
4254
4254
|
);
|
4255
4255
|
const layers = Array.from(context.layers);
|
@@ -4291,7 +4291,7 @@
|
|
4291
4291
|
onDismiss();
|
4292
4292
|
}
|
4293
4293
|
}, ownerDocument);
|
4294
|
-
|
4294
|
+
React.useEffect(()=>{
|
4295
4295
|
if (!node1) return;
|
4296
4296
|
if (disableOutsidePointerEvents) {
|
4297
4297
|
if (context.layersWithOutsidePointerEventsDisabled.size === 0) {
|
@@ -4316,7 +4316,7 @@
|
|
4316
4316
|
* because a change to `disableOutsidePointerEvents` would remove this layer from the stack
|
4317
4317
|
* and add it to the end again so the layering order wouldn't be _creation order_.
|
4318
4318
|
* We only want them to be removed from context stacks when unmounted.
|
4319
|
-
*/
|
4319
|
+
*/ React.useEffect(()=>{
|
4320
4320
|
return ()=>{
|
4321
4321
|
if (!node1) return;
|
4322
4322
|
context.layers.delete(node1);
|
@@ -4327,14 +4327,14 @@
|
|
4327
4327
|
node1,
|
4328
4328
|
context
|
4329
4329
|
]);
|
4330
|
-
|
4330
|
+
React.useEffect(()=>{
|
4331
4331
|
const handleUpdate = ()=>force({})
|
4332
4332
|
;
|
4333
4333
|
document.addEventListener($5cb92bef7577960e$var$CONTEXT_UPDATE$1, handleUpdate);
|
4334
4334
|
return ()=>document.removeEventListener($5cb92bef7577960e$var$CONTEXT_UPDATE$1, handleUpdate)
|
4335
4335
|
;
|
4336
4336
|
}, []);
|
4337
|
-
return /*#__PURE__*/
|
4337
|
+
return /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({}, layerProps, {
|
4338
4338
|
ref: composedRefs,
|
4339
4339
|
style: {
|
4340
4340
|
pointerEvents: isBodyPointerEventsDisabled ? isPointerEventsEnabled ? 'auto' : 'none' : undefined,
|
@@ -4351,9 +4351,9 @@
|
|
4351
4351
|
* Returns props to pass to the node we want to check for outside events.
|
4352
4352
|
*/ function $5cb92bef7577960e$var$usePointerDownOutside$1(onPointerDownOutside, ownerDocument = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) {
|
4353
4353
|
const handlePointerDownOutside = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onPointerDownOutside);
|
4354
|
-
const isPointerInsideReactTreeRef =
|
4355
|
-
const handleClickRef =
|
4356
|
-
|
4354
|
+
const isPointerInsideReactTreeRef = React.useRef(false);
|
4355
|
+
const handleClickRef = React.useRef(()=>{});
|
4356
|
+
React.useEffect(()=>{
|
4357
4357
|
const handlePointerDown = (event)=>{
|
4358
4358
|
if (event.target && !isPointerInsideReactTreeRef.current) {
|
4359
4359
|
const eventDetail = {
|
@@ -4419,8 +4419,8 @@
|
|
4419
4419
|
* Returns props to pass to the root (node) of the subtree we want to check.
|
4420
4420
|
*/ function $5cb92bef7577960e$var$useFocusOutside$1(onFocusOutside, ownerDocument = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) {
|
4421
4421
|
const handleFocusOutside = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onFocusOutside);
|
4422
|
-
const isFocusInsideReactTreeRef =
|
4423
|
-
|
4422
|
+
const isFocusInsideReactTreeRef = React.useRef(false);
|
4423
|
+
React.useEffect(()=>{
|
4424
4424
|
const handleFocus = (event)=>{
|
4425
4425
|
if (event.target && !isFocusInsideReactTreeRef.current) {
|
4426
4426
|
const eventDetail = {
|
@@ -6097,7 +6097,7 @@
|
|
6097
6097
|
};
|
6098
6098
|
};
|
6099
6099
|
|
6100
|
-
var index = typeof document !== 'undefined' ?
|
6100
|
+
var index = typeof document !== 'undefined' ? React.useLayoutEffect : React.useEffect;
|
6101
6101
|
|
6102
6102
|
// Fork of `fast-deep-equal` that only does the comparisons we need and compares
|
6103
6103
|
// functions
|
@@ -6161,7 +6161,7 @@
|
|
6161
6161
|
}
|
6162
6162
|
|
6163
6163
|
function useLatestRef(value) {
|
6164
|
-
const ref =
|
6164
|
+
const ref = React__namespace.useRef(value);
|
6165
6165
|
index(() => {
|
6166
6166
|
ref.current = value;
|
6167
6167
|
});
|
@@ -6189,7 +6189,7 @@
|
|
6189
6189
|
whileElementsMounted,
|
6190
6190
|
open
|
6191
6191
|
} = options;
|
6192
|
-
const [data, setData] =
|
6192
|
+
const [data, setData] = React__namespace.useState({
|
6193
6193
|
x: 0,
|
6194
6194
|
y: 0,
|
6195
6195
|
strategy,
|
@@ -6197,19 +6197,19 @@
|
|
6197
6197
|
middlewareData: {},
|
6198
6198
|
isPositioned: false
|
6199
6199
|
});
|
6200
|
-
const [latestMiddleware, setLatestMiddleware] =
|
6200
|
+
const [latestMiddleware, setLatestMiddleware] = React__namespace.useState(middleware);
|
6201
6201
|
if (!deepEqual$1(latestMiddleware, middleware)) {
|
6202
6202
|
setLatestMiddleware(middleware);
|
6203
6203
|
}
|
6204
|
-
const [_reference, _setReference] =
|
6205
|
-
const [_floating, _setFloating] =
|
6206
|
-
const setReference =
|
6204
|
+
const [_reference, _setReference] = React__namespace.useState(null);
|
6205
|
+
const [_floating, _setFloating] = React__namespace.useState(null);
|
6206
|
+
const setReference = React__namespace.useCallback(node => {
|
6207
6207
|
if (node != referenceRef.current) {
|
6208
6208
|
referenceRef.current = node;
|
6209
6209
|
_setReference(node);
|
6210
6210
|
}
|
6211
6211
|
}, [_setReference]);
|
6212
|
-
const setFloating =
|
6212
|
+
const setFloating = React__namespace.useCallback(node => {
|
6213
6213
|
if (node !== floatingRef.current) {
|
6214
6214
|
floatingRef.current = node;
|
6215
6215
|
_setFloating(node);
|
@@ -6217,12 +6217,12 @@
|
|
6217
6217
|
}, [_setFloating]);
|
6218
6218
|
const referenceEl = externalReference || _reference;
|
6219
6219
|
const floatingEl = externalFloating || _floating;
|
6220
|
-
const referenceRef =
|
6221
|
-
const floatingRef =
|
6222
|
-
const dataRef =
|
6220
|
+
const referenceRef = React__namespace.useRef(null);
|
6221
|
+
const floatingRef = React__namespace.useRef(null);
|
6222
|
+
const dataRef = React__namespace.useRef(data);
|
6223
6223
|
const whileElementsMountedRef = useLatestRef(whileElementsMounted);
|
6224
6224
|
const platformRef = useLatestRef(platform);
|
6225
|
-
const update =
|
6225
|
+
const update = React__namespace.useCallback(() => {
|
6226
6226
|
if (!referenceRef.current || !floatingRef.current) {
|
6227
6227
|
return;
|
6228
6228
|
}
|
@@ -6256,7 +6256,7 @@
|
|
6256
6256
|
}));
|
6257
6257
|
}
|
6258
6258
|
}, [open]);
|
6259
|
-
const isMountedRef =
|
6259
|
+
const isMountedRef = React__namespace.useRef(false);
|
6260
6260
|
index(() => {
|
6261
6261
|
isMountedRef.current = true;
|
6262
6262
|
return () => {
|
@@ -6274,17 +6274,17 @@
|
|
6274
6274
|
}
|
6275
6275
|
}
|
6276
6276
|
}, [referenceEl, floatingEl, update, whileElementsMountedRef]);
|
6277
|
-
const refs =
|
6277
|
+
const refs = React__namespace.useMemo(() => ({
|
6278
6278
|
reference: referenceRef,
|
6279
6279
|
floating: floatingRef,
|
6280
6280
|
setReference,
|
6281
6281
|
setFloating
|
6282
6282
|
}), [setReference, setFloating]);
|
6283
|
-
const elements =
|
6283
|
+
const elements = React__namespace.useMemo(() => ({
|
6284
6284
|
reference: referenceEl,
|
6285
6285
|
floating: floatingEl
|
6286
6286
|
}), [referenceEl, floatingEl]);
|
6287
|
-
const floatingStyles =
|
6287
|
+
const floatingStyles = React__namespace.useMemo(() => {
|
6288
6288
|
const initialStyles = {
|
6289
6289
|
position: strategy,
|
6290
6290
|
left: 0,
|
@@ -6310,7 +6310,7 @@
|
|
6310
6310
|
top: y
|
6311
6311
|
};
|
6312
6312
|
}, [strategy, transform, elements.floating, data.x, data.y]);
|
6313
|
-
return
|
6313
|
+
return React__namespace.useMemo(() => ({
|
6314
6314
|
...data,
|
6315
6315
|
update,
|
6316
6316
|
refs,
|
@@ -6319,15 +6319,15 @@
|
|
6319
6319
|
}), [data, update, refs, elements, floatingStyles]);
|
6320
6320
|
}
|
6321
6321
|
|
6322
|
-
const $7e8f5cd07187803e$export$21b07c8f274aebd5 = /*#__PURE__*/
|
6322
|
+
const $7e8f5cd07187803e$export$21b07c8f274aebd5 = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
6323
6323
|
const { children: children , width: width = 10 , height: height = 5 , ...arrowProps } = props;
|
6324
|
-
return /*#__PURE__*/
|
6324
|
+
return /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.svg, _extends({}, arrowProps, {
|
6325
6325
|
ref: forwardedRef,
|
6326
6326
|
width: width,
|
6327
6327
|
height: height,
|
6328
6328
|
viewBox: "0 0 30 10",
|
6329
6329
|
preserveAspectRatio: "none"
|
6330
|
-
}), props.asChild ? children : /*#__PURE__*/
|
6330
|
+
}), props.asChild ? children : /*#__PURE__*/ React.createElement("polygon", {
|
6331
6331
|
points: "0,0 30,0 15,10"
|
6332
6332
|
}));
|
6333
6333
|
});
|
@@ -6341,18 +6341,18 @@
|
|
6341
6341
|
/* -------------------------------------------------------------------------------------------------
|
6342
6342
|
* PopperAnchor
|
6343
6343
|
* -----------------------------------------------------------------------------------------------*/ const $cf1ac5d9fe0e8206$var$ANCHOR_NAME = 'PopperAnchor';
|
6344
|
-
const $cf1ac5d9fe0e8206$export$ecd4e1ccab6ed6d = /*#__PURE__*/
|
6344
|
+
const $cf1ac5d9fe0e8206$export$ecd4e1ccab6ed6d = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
6345
6345
|
const { __scopePopper: __scopePopper , virtualRef: virtualRef , ...anchorProps } = props;
|
6346
6346
|
const context = $cf1ac5d9fe0e8206$var$usePopperContext($cf1ac5d9fe0e8206$var$ANCHOR_NAME, __scopePopper);
|
6347
|
-
const ref =
|
6347
|
+
const ref = React.useRef(null);
|
6348
6348
|
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, ref);
|
6349
|
-
|
6349
|
+
React.useEffect(()=>{
|
6350
6350
|
// Consumer can anchor the popper to something that isn't
|
6351
6351
|
// a DOM node e.g. pointer position, so we override the
|
6352
6352
|
// `anchorRef` with their virtual ref in this case.
|
6353
6353
|
context.onAnchorChange((virtualRef === null || virtualRef === void 0 ? void 0 : virtualRef.current) || ref.current);
|
6354
6354
|
});
|
6355
|
-
return virtualRef ? null : /*#__PURE__*/
|
6355
|
+
return virtualRef ? null : /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({}, anchorProps, {
|
6356
6356
|
ref: composedRefs
|
6357
6357
|
}));
|
6358
6358
|
});
|
@@ -6360,14 +6360,14 @@
|
|
6360
6360
|
* PopperContent
|
6361
6361
|
* -----------------------------------------------------------------------------------------------*/ const $cf1ac5d9fe0e8206$var$CONTENT_NAME = 'PopperContent';
|
6362
6362
|
const [$cf1ac5d9fe0e8206$var$PopperContentProvider, $cf1ac5d9fe0e8206$var$useContentContext] = $cf1ac5d9fe0e8206$var$createPopperContext($cf1ac5d9fe0e8206$var$CONTENT_NAME);
|
6363
|
-
const $cf1ac5d9fe0e8206$export$bc4ae5855d3c4fc = /*#__PURE__*/
|
6363
|
+
const $cf1ac5d9fe0e8206$export$bc4ae5855d3c4fc = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
6364
6364
|
var _arrowSize$width, _arrowSize$height, _middlewareData$arrow, _middlewareData$arrow2, _middlewareData$arrow3, _middlewareData$trans, _middlewareData$trans2, _middlewareData$hide;
|
6365
6365
|
const { __scopePopper: __scopePopper , side: side = 'bottom' , sideOffset: sideOffset = 0 , align: align = 'center' , alignOffset: alignOffset = 0 , arrowPadding: arrowPadding = 0 , collisionBoundary: collisionBoundary = [] , collisionPadding: collisionPaddingProp = 0 , sticky: sticky = 'partial' , hideWhenDetached: hideWhenDetached = false , avoidCollisions: avoidCollisions = true , onPlaced: onPlaced , ...contentProps } = props;
|
6366
6366
|
const context = $cf1ac5d9fe0e8206$var$usePopperContext($cf1ac5d9fe0e8206$var$CONTENT_NAME, __scopePopper);
|
6367
|
-
const [content, setContent] =
|
6367
|
+
const [content, setContent] = React.useState(null);
|
6368
6368
|
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, (node)=>setContent(node)
|
6369
6369
|
);
|
6370
|
-
const [arrow$1, setArrow] =
|
6370
|
+
const [arrow$1, setArrow] = React.useState(null);
|
6371
6371
|
const arrowSize = $db6c3485150b8e66$export$1ab7ae714698c4b8(arrow$1);
|
6372
6372
|
const arrowWidth = (_arrowSize$width = arrowSize === null || arrowSize === void 0 ? void 0 : arrowSize.width) !== null && _arrowSize$width !== void 0 ? _arrowSize$width : 0;
|
6373
6373
|
const arrowHeight = (_arrowSize$height = arrowSize === null || arrowSize === void 0 ? void 0 : arrowSize.height) !== null && _arrowSize$height !== void 0 ? _arrowSize$height : 0;
|
@@ -6446,13 +6446,13 @@
|
|
6446
6446
|
const arrowX = (_middlewareData$arrow = middlewareData.arrow) === null || _middlewareData$arrow === void 0 ? void 0 : _middlewareData$arrow.x;
|
6447
6447
|
const arrowY = (_middlewareData$arrow2 = middlewareData.arrow) === null || _middlewareData$arrow2 === void 0 ? void 0 : _middlewareData$arrow2.y;
|
6448
6448
|
const cannotCenterArrow = ((_middlewareData$arrow3 = middlewareData.arrow) === null || _middlewareData$arrow3 === void 0 ? void 0 : _middlewareData$arrow3.centerOffset) !== 0;
|
6449
|
-
const [contentZIndex, setContentZIndex] =
|
6449
|
+
const [contentZIndex, setContentZIndex] = React.useState();
|
6450
6450
|
$9f79659886946c16$export$e5c5a5f917a5871c(()=>{
|
6451
6451
|
if (content) setContentZIndex(window.getComputedStyle(content).zIndex);
|
6452
6452
|
}, [
|
6453
6453
|
content
|
6454
6454
|
]);
|
6455
|
-
return /*#__PURE__*/
|
6455
|
+
return /*#__PURE__*/ React.createElement("div", {
|
6456
6456
|
ref: refs.setFloating,
|
6457
6457
|
"data-radix-popper-content-wrapper": "",
|
6458
6458
|
style: {
|
@@ -6468,14 +6468,14 @@
|
|
6468
6468
|
} // Floating UI interally calculates logical alignment based the `dir` attribute on
|
6469
6469
|
,
|
6470
6470
|
dir: props.dir
|
6471
|
-
}, /*#__PURE__*/
|
6471
|
+
}, /*#__PURE__*/ React.createElement($cf1ac5d9fe0e8206$var$PopperContentProvider, {
|
6472
6472
|
scope: __scopePopper,
|
6473
6473
|
placedSide: placedSide,
|
6474
6474
|
onArrowChange: setArrow,
|
6475
6475
|
arrowX: arrowX,
|
6476
6476
|
arrowY: arrowY,
|
6477
6477
|
shouldHideArrow: cannotCenterArrow
|
6478
|
-
}, /*#__PURE__*/
|
6478
|
+
}, /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({
|
6479
6479
|
"data-side": placedSide,
|
6480
6480
|
"data-align": placedAlign
|
6481
6481
|
}, contentProps, {
|
@@ -6499,14 +6499,14 @@
|
|
6499
6499
|
bottom: 'top',
|
6500
6500
|
left: 'right'
|
6501
6501
|
};
|
6502
|
-
const $cf1ac5d9fe0e8206$export$79d62cd4e10a3fd0 = /*#__PURE__*/
|
6502
|
+
const $cf1ac5d9fe0e8206$export$79d62cd4e10a3fd0 = /*#__PURE__*/ React.forwardRef(function $cf1ac5d9fe0e8206$export$79d62cd4e10a3fd0(props, forwardedRef) {
|
6503
6503
|
const { __scopePopper: __scopePopper , ...arrowProps } = props;
|
6504
6504
|
const contentContext = $cf1ac5d9fe0e8206$var$useContentContext($cf1ac5d9fe0e8206$var$ARROW_NAME, __scopePopper);
|
6505
6505
|
const baseSide = $cf1ac5d9fe0e8206$var$OPPOSITE_SIDE[contentContext.placedSide];
|
6506
6506
|
return(/*#__PURE__*/ // we have to use an extra wrapper because `ResizeObserver` (used by `useSize`)
|
6507
6507
|
// doesn't report size as we'd expect on SVG elements.
|
6508
6508
|
// it reports their bounding box which is effectively the largest path inside the SVG.
|
6509
|
-
|
6509
|
+
React.createElement("span", {
|
6510
6510
|
ref: contentContext.onArrowChange,
|
6511
6511
|
style: {
|
6512
6512
|
position: 'absolute',
|
@@ -6527,7 +6527,7 @@
|
|
6527
6527
|
}[contentContext.placedSide],
|
6528
6528
|
visibility: contentContext.shouldHideArrow ? 'hidden' : undefined
|
6529
6529
|
}
|
6530
|
-
}, /*#__PURE__*/
|
6530
|
+
}, /*#__PURE__*/ React.createElement($7e8f5cd07187803e$export$be92b6f5f03c0fe9, _extends({}, arrowProps, {
|
6531
6531
|
ref: forwardedRef,
|
6532
6532
|
style: {
|
6533
6533
|
...arrowProps.style,
|
@@ -6592,16 +6592,16 @@
|
|
6592
6592
|
const $cf1ac5d9fe0e8206$export$7c6e2c02157bb7d2 = $cf1ac5d9fe0e8206$export$bc4ae5855d3c4fc;
|
6593
6593
|
const $cf1ac5d9fe0e8206$export$21b07c8f274aebd5 = $cf1ac5d9fe0e8206$export$79d62cd4e10a3fd0;
|
6594
6594
|
|
6595
|
-
/*#__PURE__*/
|
6595
|
+
/*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
6596
6596
|
var _globalThis$document;
|
6597
6597
|
const { container: container = globalThis === null || globalThis === void 0 ? void 0 : (_globalThis$document = globalThis.document) === null || _globalThis$document === void 0 ? void 0 : _globalThis$document.body , ...portalProps } = props;
|
6598
|
-
return container ? /*#__PURE__*/ ReactDOM__default.createPortal(/*#__PURE__*/
|
6598
|
+
return container ? /*#__PURE__*/ ReactDOM__default.createPortal(/*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({}, portalProps, {
|
6599
6599
|
ref: forwardedRef
|
6600
6600
|
})), container) : null;
|
6601
6601
|
});
|
6602
6602
|
|
6603
|
-
const $ea1ef594cf570d83$export$439d29a4e110a164 = /*#__PURE__*/
|
6604
|
-
return /*#__PURE__*/
|
6603
|
+
const $ea1ef594cf570d83$export$439d29a4e110a164 = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
6604
|
+
return /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.span, _extends({}, props, {
|
6605
6605
|
ref: forwardedRef,
|
6606
6606
|
style: {
|
6607
6607
|
// See: https://github.com/twbs/bootstrap/blob/master/scss/mixins/_screen-reader.scss
|
@@ -6637,26 +6637,26 @@
|
|
6637
6637
|
/* -------------------------------------------------------------------------------------------------
|
6638
6638
|
* TooltipTrigger
|
6639
6639
|
* -----------------------------------------------------------------------------------------------*/ const $a093c7e1ec25a057$var$TRIGGER_NAME = 'TooltipTrigger';
|
6640
|
-
/*#__PURE__*/
|
6640
|
+
/*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
6641
6641
|
const { __scopeTooltip: __scopeTooltip , ...triggerProps } = props;
|
6642
6642
|
const context = $a093c7e1ec25a057$var$useTooltipContext($a093c7e1ec25a057$var$TRIGGER_NAME, __scopeTooltip);
|
6643
6643
|
const providerContext = $a093c7e1ec25a057$var$useTooltipProviderContext($a093c7e1ec25a057$var$TRIGGER_NAME, __scopeTooltip);
|
6644
6644
|
const popperScope = $a093c7e1ec25a057$var$usePopperScope(__scopeTooltip);
|
6645
|
-
const ref =
|
6645
|
+
const ref = React.useRef(null);
|
6646
6646
|
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, ref, context.onTriggerChange);
|
6647
|
-
const isPointerDownRef =
|
6648
|
-
const hasPointerMoveOpenedRef =
|
6649
|
-
const handlePointerUp =
|
6647
|
+
const isPointerDownRef = React.useRef(false);
|
6648
|
+
const hasPointerMoveOpenedRef = React.useRef(false);
|
6649
|
+
const handlePointerUp = React.useCallback(()=>isPointerDownRef.current = false
|
6650
6650
|
, []);
|
6651
|
-
|
6651
|
+
React.useEffect(()=>{
|
6652
6652
|
return ()=>document.removeEventListener('pointerup', handlePointerUp)
|
6653
6653
|
;
|
6654
6654
|
}, [
|
6655
6655
|
handlePointerUp
|
6656
6656
|
]);
|
6657
|
-
return /*#__PURE__*/
|
6657
|
+
return /*#__PURE__*/ React.createElement($cf1ac5d9fe0e8206$export$b688253958b8dfe7, _extends({
|
6658
6658
|
asChild: true
|
6659
|
-
}, popperScope), /*#__PURE__*/
|
6659
|
+
}, popperScope), /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.button, _extends({
|
6660
6660
|
// We purposefully avoid adding `type=button` here because tooltip triggers are also
|
6661
6661
|
// commonly anchors and the anchor `type` attribute signifies MIME type.
|
6662
6662
|
"aria-describedby": context.open ? context.contentId : undefined,
|
@@ -6696,38 +6696,38 @@
|
|
6696
6696
|
/* -------------------------------------------------------------------------------------------------
|
6697
6697
|
* TooltipContent
|
6698
6698
|
* -----------------------------------------------------------------------------------------------*/ const $a093c7e1ec25a057$var$CONTENT_NAME = 'TooltipContent';
|
6699
|
-
/*#__PURE__*/
|
6699
|
+
/*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
6700
6700
|
const portalContext = $a093c7e1ec25a057$var$usePortalContext($a093c7e1ec25a057$var$CONTENT_NAME, props.__scopeTooltip);
|
6701
6701
|
const { forceMount: forceMount = portalContext.forceMount , side: side = 'top' , ...contentProps } = props;
|
6702
6702
|
const context = $a093c7e1ec25a057$var$useTooltipContext($a093c7e1ec25a057$var$CONTENT_NAME, props.__scopeTooltip);
|
6703
|
-
return /*#__PURE__*/
|
6703
|
+
return /*#__PURE__*/ React.createElement($921a889cee6df7e8$export$99c2b779aa4e8b8b, {
|
6704
6704
|
present: forceMount || context.open
|
6705
|
-
}, context.disableHoverableContent ? /*#__PURE__*/
|
6705
|
+
}, context.disableHoverableContent ? /*#__PURE__*/ React.createElement($a093c7e1ec25a057$var$TooltipContentImpl, _extends({
|
6706
6706
|
side: side
|
6707
6707
|
}, contentProps, {
|
6708
6708
|
ref: forwardedRef
|
6709
|
-
})) : /*#__PURE__*/
|
6709
|
+
})) : /*#__PURE__*/ React.createElement($a093c7e1ec25a057$var$TooltipContentHoverable, _extends({
|
6710
6710
|
side: side
|
6711
6711
|
}, contentProps, {
|
6712
6712
|
ref: forwardedRef
|
6713
6713
|
})));
|
6714
6714
|
});
|
6715
|
-
const $a093c7e1ec25a057$var$TooltipContentHoverable = /*#__PURE__*/
|
6715
|
+
const $a093c7e1ec25a057$var$TooltipContentHoverable = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
6716
6716
|
const context = $a093c7e1ec25a057$var$useTooltipContext($a093c7e1ec25a057$var$CONTENT_NAME, props.__scopeTooltip);
|
6717
6717
|
const providerContext = $a093c7e1ec25a057$var$useTooltipProviderContext($a093c7e1ec25a057$var$CONTENT_NAME, props.__scopeTooltip);
|
6718
|
-
const ref =
|
6718
|
+
const ref = React.useRef(null);
|
6719
6719
|
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, ref);
|
6720
|
-
const [pointerGraceArea, setPointerGraceArea] =
|
6720
|
+
const [pointerGraceArea, setPointerGraceArea] = React.useState(null);
|
6721
6721
|
const { trigger: trigger , onClose: onClose } = context;
|
6722
6722
|
const content = ref.current;
|
6723
6723
|
const { onPointerInTransitChange: onPointerInTransitChange } = providerContext;
|
6724
|
-
const handleRemoveGraceArea =
|
6724
|
+
const handleRemoveGraceArea = React.useCallback(()=>{
|
6725
6725
|
setPointerGraceArea(null);
|
6726
6726
|
onPointerInTransitChange(false);
|
6727
6727
|
}, [
|
6728
6728
|
onPointerInTransitChange
|
6729
6729
|
]);
|
6730
|
-
const handleCreateGraceArea =
|
6730
|
+
const handleCreateGraceArea = React.useCallback((event, hoverTarget)=>{
|
6731
6731
|
const currentTarget = event.currentTarget;
|
6732
6732
|
const exitPoint = {
|
6733
6733
|
x: event.clientX,
|
@@ -6745,13 +6745,13 @@
|
|
6745
6745
|
}, [
|
6746
6746
|
onPointerInTransitChange
|
6747
6747
|
]);
|
6748
|
-
|
6748
|
+
React.useEffect(()=>{
|
6749
6749
|
return ()=>handleRemoveGraceArea()
|
6750
6750
|
;
|
6751
6751
|
}, [
|
6752
6752
|
handleRemoveGraceArea
|
6753
6753
|
]);
|
6754
|
-
|
6754
|
+
React.useEffect(()=>{
|
6755
6755
|
if (trigger && content) {
|
6756
6756
|
const handleTriggerLeave = (event)=>handleCreateGraceArea(event, content)
|
6757
6757
|
;
|
@@ -6770,7 +6770,7 @@
|
|
6770
6770
|
handleCreateGraceArea,
|
6771
6771
|
handleRemoveGraceArea
|
6772
6772
|
]);
|
6773
|
-
|
6773
|
+
React.useEffect(()=>{
|
6774
6774
|
if (pointerGraceArea) {
|
6775
6775
|
const handleTrackPointerGrace = (event)=>{
|
6776
6776
|
const target = event.target;
|
@@ -6797,26 +6797,26 @@
|
|
6797
6797
|
onClose,
|
6798
6798
|
handleRemoveGraceArea
|
6799
6799
|
]);
|
6800
|
-
return /*#__PURE__*/
|
6800
|
+
return /*#__PURE__*/ React.createElement($a093c7e1ec25a057$var$TooltipContentImpl, _extends({}, props, {
|
6801
6801
|
ref: composedRefs
|
6802
6802
|
}));
|
6803
6803
|
});
|
6804
6804
|
const [$a093c7e1ec25a057$var$VisuallyHiddenContentContextProvider, $a093c7e1ec25a057$var$useVisuallyHiddenContentContext] = $a093c7e1ec25a057$var$createTooltipContext($a093c7e1ec25a057$var$TOOLTIP_NAME, {
|
6805
6805
|
isInside: false
|
6806
6806
|
});
|
6807
|
-
const $a093c7e1ec25a057$var$TooltipContentImpl = /*#__PURE__*/
|
6807
|
+
const $a093c7e1ec25a057$var$TooltipContentImpl = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
6808
6808
|
const { __scopeTooltip: __scopeTooltip , children: children , 'aria-label': ariaLabel , onEscapeKeyDown: onEscapeKeyDown , onPointerDownOutside: onPointerDownOutside , ...contentProps } = props;
|
6809
6809
|
const context = $a093c7e1ec25a057$var$useTooltipContext($a093c7e1ec25a057$var$CONTENT_NAME, __scopeTooltip);
|
6810
6810
|
const popperScope = $a093c7e1ec25a057$var$usePopperScope(__scopeTooltip);
|
6811
6811
|
const { onClose: onClose } = context; // Close this tooltip if another one opens
|
6812
|
-
|
6812
|
+
React.useEffect(()=>{
|
6813
6813
|
document.addEventListener($a093c7e1ec25a057$var$TOOLTIP_OPEN, onClose);
|
6814
6814
|
return ()=>document.removeEventListener($a093c7e1ec25a057$var$TOOLTIP_OPEN, onClose)
|
6815
6815
|
;
|
6816
6816
|
}, [
|
6817
6817
|
onClose
|
6818
6818
|
]); // Close the tooltip if the trigger is scrolled
|
6819
|
-
|
6819
|
+
React.useEffect(()=>{
|
6820
6820
|
if (context.trigger) {
|
6821
6821
|
const handleScroll = (event)=>{
|
6822
6822
|
const target = event.target;
|
@@ -6834,7 +6834,7 @@
|
|
6834
6834
|
context.trigger,
|
6835
6835
|
onClose
|
6836
6836
|
]);
|
6837
|
-
return /*#__PURE__*/
|
6837
|
+
return /*#__PURE__*/ React.createElement($5cb92bef7577960e$export$177fb62ff3ec1f22$1, {
|
6838
6838
|
asChild: true,
|
6839
6839
|
disableOutsidePointerEvents: false,
|
6840
6840
|
onEscapeKeyDown: onEscapeKeyDown,
|
@@ -6842,7 +6842,7 @@
|
|
6842
6842
|
onFocusOutside: (event)=>event.preventDefault()
|
6843
6843
|
,
|
6844
6844
|
onDismiss: onClose
|
6845
|
-
}, /*#__PURE__*/
|
6845
|
+
}, /*#__PURE__*/ React.createElement($cf1ac5d9fe0e8206$export$7c6e2c02157bb7d2, _extends({
|
6846
6846
|
"data-state": context.stateAttribute
|
6847
6847
|
}, popperScope, contentProps, {
|
6848
6848
|
ref: forwardedRef,
|
@@ -6854,10 +6854,10 @@
|
|
6854
6854
|
'--radix-tooltip-trigger-width': 'var(--radix-popper-anchor-width)',
|
6855
6855
|
'--radix-tooltip-trigger-height': 'var(--radix-popper-anchor-height)'
|
6856
6856
|
}
|
6857
|
-
}), /*#__PURE__*/
|
6857
|
+
}), /*#__PURE__*/ React.createElement($5e63c961fc1ce211$export$d9f1ccf0bdb05d45, null, children), /*#__PURE__*/ React.createElement($a093c7e1ec25a057$var$VisuallyHiddenContentContextProvider, {
|
6858
6858
|
scope: __scopeTooltip,
|
6859
6859
|
isInside: true
|
6860
|
-
}, /*#__PURE__*/
|
6860
|
+
}, /*#__PURE__*/ React.createElement($ea1ef594cf570d83$export$be92b6f5f03c0fe9, {
|
6861
6861
|
id: context.contentId,
|
6862
6862
|
role: "tooltip"
|
6863
6863
|
}, ariaLabel || children))));
|
@@ -6865,12 +6865,12 @@
|
|
6865
6865
|
/* -------------------------------------------------------------------------------------------------
|
6866
6866
|
* TooltipArrow
|
6867
6867
|
* -----------------------------------------------------------------------------------------------*/ const $a093c7e1ec25a057$var$ARROW_NAME = 'TooltipArrow';
|
6868
|
-
/*#__PURE__*/
|
6868
|
+
/*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
6869
6869
|
const { __scopeTooltip: __scopeTooltip , ...arrowProps } = props;
|
6870
6870
|
const popperScope = $a093c7e1ec25a057$var$usePopperScope(__scopeTooltip);
|
6871
6871
|
const visuallyHiddenContentContext = $a093c7e1ec25a057$var$useVisuallyHiddenContentContext($a093c7e1ec25a057$var$ARROW_NAME, __scopeTooltip); // if the arrow is inside the `VisuallyHidden`, we don't want to render it all to
|
6872
6872
|
// prevent issues in positioning the arrow due to the duplicate
|
6873
|
-
return visuallyHiddenContentContext.isInside ? null : /*#__PURE__*/
|
6873
|
+
return visuallyHiddenContentContext.isInside ? null : /*#__PURE__*/ React.createElement($cf1ac5d9fe0e8206$export$21b07c8f274aebd5, _extends({}, popperScope, arrowProps, {
|
6874
6874
|
ref: forwardedRef
|
6875
6875
|
}));
|
6876
6876
|
});
|
@@ -7012,15 +7012,15 @@
|
|
7012
7012
|
}
|
7013
7013
|
|
7014
7014
|
function Option(option) {
|
7015
|
-
return (
|
7015
|
+
return (React.createElement("option", { value: option.value }, option.label));
|
7016
7016
|
}
|
7017
7017
|
function Select(_a) {
|
7018
7018
|
var children = _a.children, _b = _a.placeholder, placeholder = _b === void 0 ? 'Select one' : _b, _c = _a.includePrompt, includePrompt = _c === void 0 ? true : _c, onChange = _a.onChange, value = _a.value; _a.id; var _d = _a.testId, testId = _d === void 0 ? 'select' : _d, _e = _a.options, options = _e === void 0 ? [] : _e, label = _a.label, description = _a.description, before = _a.before, after = _a.after, _f = _a.size, size = _f === void 0 ? 'med' : _f, _g = _a.defaultClassName, defaultClassName = _g === void 0 ? 'block w-full pr-10 border-slate-200 border focus:outline-blue-400 w-full disabled:opacity-50 disabled:bg-slate-50' : _g, _h = _a.disabled, disabled = _h === void 0 ? false : _h, _j = _a.className, className = _j === void 0 ? '' : _j, error = _a.error;
|
7019
|
-
var _k =
|
7019
|
+
var _k = React.useState(value), v = _k[0], setV = _k[1];
|
7020
7020
|
var updateValue = function (newValue) {
|
7021
7021
|
setV(newValue);
|
7022
7022
|
};
|
7023
|
-
|
7023
|
+
React.useEffect(function () {
|
7024
7024
|
updateValue(value);
|
7025
7025
|
}, [value]);
|
7026
7026
|
var optionsToUse = options.slice();
|
@@ -7041,18 +7041,18 @@
|
|
7041
7041
|
}
|
7042
7042
|
}
|
7043
7043
|
};
|
7044
|
-
return (
|
7044
|
+
return (React.createElement("label", { className: "block" },
|
7045
7045
|
before !== undefined ? before : '',
|
7046
7046
|
typeof label === 'string'
|
7047
|
-
?
|
7047
|
+
? React.createElement(Label, { label: label })
|
7048
7048
|
: label !== undefined ? label : '',
|
7049
7049
|
typeof description === 'string'
|
7050
|
-
?
|
7050
|
+
? React.createElement(Description, { description: description })
|
7051
7051
|
: description !== undefined ? description : '',
|
7052
|
-
|
7053
|
-
|
7052
|
+
React.createElement("div", { className: "flex gap-2" },
|
7053
|
+
React.createElement("select", { "data-testid": testId, disabled: disabled, onChange: onSelectChange, className: makeClassName({ size: size, defaultClassName: defaultClassName, className: className, error: error, errorClassName: 'border-2 border-rose-600 focus:border-rose-600 focus:ring-offset-0' }), value: v !== undefined && v !== null ? v : '' }, children !== undefined
|
7054
7054
|
? children
|
7055
|
-
: optionsToUse.map(function (option) { return (
|
7055
|
+
: optionsToUse.map(function (option) { return (React.createElement(Option, __assign({}, option, { key: option.value }))); })),
|
7056
7056
|
after !== undefined ? after : '')));
|
7057
7057
|
}
|
7058
7058
|
|
@@ -7104,15 +7104,15 @@
|
|
7104
7104
|
$faa2e61a3361514f$var$createCollectionScope
|
7105
7105
|
]);
|
7106
7106
|
const [$faa2e61a3361514f$var$SliderProvider, $faa2e61a3361514f$var$useSliderContext] = $faa2e61a3361514f$var$createSliderContext($faa2e61a3361514f$var$SLIDER_NAME);
|
7107
|
-
/*#__PURE__*/
|
7107
|
+
/*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
7108
7108
|
const { name: name , min: min = 0 , max: max = 100 , step: step = 1 , orientation: orientation = 'horizontal' , disabled: disabled = false , minStepsBetweenThumbs: minStepsBetweenThumbs = 0 , defaultValue: defaultValue = [
|
7109
7109
|
min
|
7110
7110
|
] , value: value1 , onValueChange: onValueChange = ()=>{} , onValueCommit: onValueCommit = ()=>{} , inverted: inverted = false , ...sliderProps } = props;
|
7111
|
-
const [slider, setSlider] =
|
7111
|
+
const [slider, setSlider] = React.useState(null);
|
7112
7112
|
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, (node)=>setSlider(node)
|
7113
7113
|
);
|
7114
|
-
const thumbRefs =
|
7115
|
-
const valueIndexToChangeRef =
|
7114
|
+
const thumbRefs = React.useRef(new Set());
|
7115
|
+
const valueIndexToChangeRef = React.useRef(0);
|
7116
7116
|
const isHorizontal = orientation === 'horizontal'; // We set this to true by default so that events bubble to forms without JS (SSR)
|
7117
7117
|
const isFormControl = slider ? Boolean(slider.closest('form')) : true;
|
7118
7118
|
const SliderOrientation = isHorizontal ? $faa2e61a3361514f$var$SliderHorizontal : $faa2e61a3361514f$var$SliderVertical;
|
@@ -7128,7 +7128,7 @@
|
|
7128
7128
|
onValueChange(value);
|
7129
7129
|
}
|
7130
7130
|
});
|
7131
|
-
const valuesBeforeSlideStartRef =
|
7131
|
+
const valuesBeforeSlideStartRef = React.useRef(values);
|
7132
7132
|
function handleSlideStart(value) {
|
7133
7133
|
const closestIndex = $faa2e61a3361514f$var$getClosestValueIndex(values, value);
|
7134
7134
|
updateValues(value, closestIndex);
|
@@ -7161,7 +7161,7 @@
|
|
7161
7161
|
} else return prevValues;
|
7162
7162
|
});
|
7163
7163
|
}
|
7164
|
-
return /*#__PURE__*/
|
7164
|
+
return /*#__PURE__*/ React.createElement($faa2e61a3361514f$var$SliderProvider, {
|
7165
7165
|
scope: props.__scopeSlider,
|
7166
7166
|
disabled: disabled,
|
7167
7167
|
min: min,
|
@@ -7170,11 +7170,11 @@
|
|
7170
7170
|
thumbs: thumbRefs.current,
|
7171
7171
|
values: values,
|
7172
7172
|
orientation: orientation
|
7173
|
-
}, /*#__PURE__*/
|
7173
|
+
}, /*#__PURE__*/ React.createElement($faa2e61a3361514f$var$Collection.Provider, {
|
7174
7174
|
scope: props.__scopeSlider
|
7175
|
-
}, /*#__PURE__*/
|
7175
|
+
}, /*#__PURE__*/ React.createElement($faa2e61a3361514f$var$Collection.Slot, {
|
7176
7176
|
scope: props.__scopeSlider
|
7177
|
-
}, /*#__PURE__*/
|
7177
|
+
}, /*#__PURE__*/ React.createElement(SliderOrientation, _extends({
|
7178
7178
|
"aria-disabled": disabled,
|
7179
7179
|
"data-disabled": disabled ? '' : undefined
|
7180
7180
|
}, sliderProps, {
|
@@ -7209,7 +7209,7 @@
|
|
7209
7209
|
});
|
7210
7210
|
}
|
7211
7211
|
}
|
7212
|
-
})))), isFormControl && values.map((value, index)=>/*#__PURE__*/
|
7212
|
+
})))), isFormControl && values.map((value, index)=>/*#__PURE__*/ React.createElement($faa2e61a3361514f$var$BubbleInput, {
|
7213
7213
|
key: index,
|
7214
7214
|
name: name ? name + (values.length > 1 ? '[]' : '') : undefined,
|
7215
7215
|
value: value
|
@@ -7224,12 +7224,12 @@
|
|
7224
7224
|
size: 'width',
|
7225
7225
|
direction: 1
|
7226
7226
|
});
|
7227
|
-
const $faa2e61a3361514f$var$SliderHorizontal = /*#__PURE__*/
|
7227
|
+
const $faa2e61a3361514f$var$SliderHorizontal = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
7228
7228
|
const { min: min , max: max , dir: dir , inverted: inverted , onSlideStart: onSlideStart , onSlideMove: onSlideMove , onSlideEnd: onSlideEnd , onStepKeyDown: onStepKeyDown , ...sliderProps } = props;
|
7229
|
-
const [slider, setSlider] =
|
7229
|
+
const [slider, setSlider] = React.useState(null);
|
7230
7230
|
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, (node)=>setSlider(node)
|
7231
7231
|
);
|
7232
|
-
const rectRef =
|
7232
|
+
const rectRef = React.useRef();
|
7233
7233
|
const direction = $f631663db3294ace$export$b39126d51d94e6f3(dir);
|
7234
7234
|
const isDirectionLTR = direction === 'ltr';
|
7235
7235
|
const isSlidingFromLeft = isDirectionLTR && !inverted || !isDirectionLTR && inverted;
|
@@ -7250,13 +7250,13 @@
|
|
7250
7250
|
rectRef.current = rect;
|
7251
7251
|
return value(pointerPosition - rect.left);
|
7252
7252
|
}
|
7253
|
-
return /*#__PURE__*/
|
7253
|
+
return /*#__PURE__*/ React.createElement($faa2e61a3361514f$var$SliderOrientationProvider, {
|
7254
7254
|
scope: props.__scopeSlider,
|
7255
7255
|
startEdge: isSlidingFromLeft ? 'left' : 'right',
|
7256
7256
|
endEdge: isSlidingFromLeft ? 'right' : 'left',
|
7257
7257
|
direction: isSlidingFromLeft ? 1 : -1,
|
7258
7258
|
size: "width"
|
7259
|
-
}, /*#__PURE__*/
|
7259
|
+
}, /*#__PURE__*/ React.createElement($faa2e61a3361514f$var$SliderImpl, _extends({
|
7260
7260
|
dir: direction,
|
7261
7261
|
"data-orientation": "horizontal"
|
7262
7262
|
}, sliderProps, {
|
@@ -7289,11 +7289,11 @@
|
|
7289
7289
|
});
|
7290
7290
|
/* -------------------------------------------------------------------------------------------------
|
7291
7291
|
* SliderVertical
|
7292
|
-
* -----------------------------------------------------------------------------------------------*/ const $faa2e61a3361514f$var$SliderVertical = /*#__PURE__*/
|
7292
|
+
* -----------------------------------------------------------------------------------------------*/ const $faa2e61a3361514f$var$SliderVertical = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
7293
7293
|
const { min: min , max: max , inverted: inverted , onSlideStart: onSlideStart , onSlideMove: onSlideMove , onSlideEnd: onSlideEnd , onStepKeyDown: onStepKeyDown , ...sliderProps } = props;
|
7294
|
-
const sliderRef =
|
7294
|
+
const sliderRef = React.useRef(null);
|
7295
7295
|
const ref = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, sliderRef);
|
7296
|
-
const rectRef =
|
7296
|
+
const rectRef = React.useRef();
|
7297
7297
|
const isSlidingFromBottom = !inverted;
|
7298
7298
|
function getValueFromPointer(pointerPosition) {
|
7299
7299
|
const rect = rectRef.current || sliderRef.current.getBoundingClientRect();
|
@@ -7312,13 +7312,13 @@
|
|
7312
7312
|
rectRef.current = rect;
|
7313
7313
|
return value(pointerPosition - rect.top);
|
7314
7314
|
}
|
7315
|
-
return /*#__PURE__*/
|
7315
|
+
return /*#__PURE__*/ React.createElement($faa2e61a3361514f$var$SliderOrientationProvider, {
|
7316
7316
|
scope: props.__scopeSlider,
|
7317
7317
|
startEdge: isSlidingFromBottom ? 'bottom' : 'top',
|
7318
7318
|
endEdge: isSlidingFromBottom ? 'top' : 'bottom',
|
7319
7319
|
size: "height",
|
7320
7320
|
direction: isSlidingFromBottom ? 1 : -1
|
7321
|
-
}, /*#__PURE__*/
|
7321
|
+
}, /*#__PURE__*/ React.createElement($faa2e61a3361514f$var$SliderImpl, _extends({
|
7322
7322
|
"data-orientation": "vertical"
|
7323
7323
|
}, sliderProps, {
|
7324
7324
|
ref: ref,
|
@@ -7350,10 +7350,10 @@
|
|
7350
7350
|
});
|
7351
7351
|
/* -------------------------------------------------------------------------------------------------
|
7352
7352
|
* SliderImpl
|
7353
|
-
* -----------------------------------------------------------------------------------------------*/ const $faa2e61a3361514f$var$SliderImpl = /*#__PURE__*/
|
7353
|
+
* -----------------------------------------------------------------------------------------------*/ const $faa2e61a3361514f$var$SliderImpl = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
7354
7354
|
const { __scopeSlider: __scopeSlider , onSlideStart: onSlideStart , onSlideMove: onSlideMove , onSlideEnd: onSlideEnd , onHomeKeyDown: onHomeKeyDown , onEndKeyDown: onEndKeyDown , onStepKeyDown: onStepKeyDown , ...sliderProps } = props;
|
7355
7355
|
const context = $faa2e61a3361514f$var$useSliderContext($faa2e61a3361514f$var$SLIDER_NAME, __scopeSlider);
|
7356
|
-
return /*#__PURE__*/
|
7356
|
+
return /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.span, _extends({}, sliderProps, {
|
7357
7357
|
ref: forwardedRef,
|
7358
7358
|
onKeyDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onKeyDown, (event)=>{
|
7359
7359
|
if (event.key === 'Home') {
|
@@ -7391,10 +7391,10 @@
|
|
7391
7391
|
/* -------------------------------------------------------------------------------------------------
|
7392
7392
|
* SliderTrack
|
7393
7393
|
* -----------------------------------------------------------------------------------------------*/ const $faa2e61a3361514f$var$TRACK_NAME = 'SliderTrack';
|
7394
|
-
/*#__PURE__*/
|
7394
|
+
/*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
7395
7395
|
const { __scopeSlider: __scopeSlider , ...trackProps } = props;
|
7396
7396
|
const context = $faa2e61a3361514f$var$useSliderContext($faa2e61a3361514f$var$TRACK_NAME, __scopeSlider);
|
7397
|
-
return /*#__PURE__*/
|
7397
|
+
return /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.span, _extends({
|
7398
7398
|
"data-disabled": context.disabled ? '' : undefined,
|
7399
7399
|
"data-orientation": context.orientation
|
7400
7400
|
}, trackProps, {
|
@@ -7404,18 +7404,18 @@
|
|
7404
7404
|
/* -------------------------------------------------------------------------------------------------
|
7405
7405
|
* SliderRange
|
7406
7406
|
* -----------------------------------------------------------------------------------------------*/ const $faa2e61a3361514f$var$RANGE_NAME = 'SliderRange';
|
7407
|
-
/*#__PURE__*/
|
7407
|
+
/*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
7408
7408
|
const { __scopeSlider: __scopeSlider , ...rangeProps } = props;
|
7409
7409
|
const context = $faa2e61a3361514f$var$useSliderContext($faa2e61a3361514f$var$RANGE_NAME, __scopeSlider);
|
7410
7410
|
const orientation = $faa2e61a3361514f$var$useSliderOrientationContext($faa2e61a3361514f$var$RANGE_NAME, __scopeSlider);
|
7411
|
-
const ref =
|
7411
|
+
const ref = React.useRef(null);
|
7412
7412
|
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, ref);
|
7413
7413
|
const valuesCount = context.values.length;
|
7414
7414
|
const percentages = context.values.map((value)=>$faa2e61a3361514f$var$convertValueToPercentage(value, context.min, context.max)
|
7415
7415
|
);
|
7416
7416
|
const offsetStart = valuesCount > 1 ? Math.min(...percentages) : 0;
|
7417
7417
|
const offsetEnd = 100 - Math.max(...percentages);
|
7418
|
-
return /*#__PURE__*/
|
7418
|
+
return /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.span, _extends({
|
7419
7419
|
"data-orientation": context.orientation,
|
7420
7420
|
"data-disabled": context.disabled ? '' : undefined
|
7421
7421
|
}, rangeProps, {
|
@@ -7430,27 +7430,27 @@
|
|
7430
7430
|
/* -------------------------------------------------------------------------------------------------
|
7431
7431
|
* SliderThumb
|
7432
7432
|
* -----------------------------------------------------------------------------------------------*/ const $faa2e61a3361514f$var$THUMB_NAME = 'SliderThumb';
|
7433
|
-
/*#__PURE__*/
|
7433
|
+
/*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
7434
7434
|
const getItems = $faa2e61a3361514f$var$useCollection(props.__scopeSlider);
|
7435
|
-
const [thumb, setThumb] =
|
7435
|
+
const [thumb, setThumb] = React.useState(null);
|
7436
7436
|
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, (node)=>setThumb(node)
|
7437
7437
|
);
|
7438
|
-
const index =
|
7438
|
+
const index = React.useMemo(()=>thumb ? getItems().findIndex((item)=>item.ref.current === thumb
|
7439
7439
|
) : -1
|
7440
7440
|
, [
|
7441
7441
|
getItems,
|
7442
7442
|
thumb
|
7443
7443
|
]);
|
7444
|
-
return /*#__PURE__*/
|
7444
|
+
return /*#__PURE__*/ React.createElement($faa2e61a3361514f$var$SliderThumbImpl, _extends({}, props, {
|
7445
7445
|
ref: composedRefs,
|
7446
7446
|
index: index
|
7447
7447
|
}));
|
7448
7448
|
});
|
7449
|
-
const $faa2e61a3361514f$var$SliderThumbImpl = /*#__PURE__*/
|
7449
|
+
const $faa2e61a3361514f$var$SliderThumbImpl = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
7450
7450
|
const { __scopeSlider: __scopeSlider , index: index , ...thumbProps } = props;
|
7451
7451
|
const context = $faa2e61a3361514f$var$useSliderContext($faa2e61a3361514f$var$THUMB_NAME, __scopeSlider);
|
7452
7452
|
const orientation = $faa2e61a3361514f$var$useSliderOrientationContext($faa2e61a3361514f$var$THUMB_NAME, __scopeSlider);
|
7453
|
-
const [thumb, setThumb] =
|
7453
|
+
const [thumb, setThumb] = React.useState(null);
|
7454
7454
|
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, (node)=>setThumb(node)
|
7455
7455
|
);
|
7456
7456
|
const size = $db6c3485150b8e66$export$1ab7ae714698c4b8(thumb); // We cast because index could be `-1` which would return undefined
|
@@ -7459,7 +7459,7 @@
|
|
7459
7459
|
const label = $faa2e61a3361514f$var$getLabel(index, context.values.length);
|
7460
7460
|
const orientationSize = size === null || size === void 0 ? void 0 : size[orientation.size];
|
7461
7461
|
const thumbInBoundsOffset = orientationSize ? $faa2e61a3361514f$var$getThumbInBoundsOffset(orientationSize, percent, orientation.direction) : 0;
|
7462
|
-
|
7462
|
+
React.useEffect(()=>{
|
7463
7463
|
if (thumb) {
|
7464
7464
|
context.thumbs.add(thumb);
|
7465
7465
|
return ()=>{
|
@@ -7470,15 +7470,15 @@
|
|
7470
7470
|
thumb,
|
7471
7471
|
context.thumbs
|
7472
7472
|
]);
|
7473
|
-
return /*#__PURE__*/
|
7473
|
+
return /*#__PURE__*/ React.createElement("span", {
|
7474
7474
|
style: {
|
7475
7475
|
transform: 'var(--radix-slider-thumb-transform)',
|
7476
7476
|
position: 'absolute',
|
7477
7477
|
[orientation.startEdge]: `calc(${percent}% + ${thumbInBoundsOffset}px)`
|
7478
7478
|
}
|
7479
|
-
}, /*#__PURE__*/
|
7479
|
+
}, /*#__PURE__*/ React.createElement($faa2e61a3361514f$var$Collection.ItemSlot, {
|
7480
7480
|
scope: props.__scopeSlider
|
7481
|
-
}, /*#__PURE__*/
|
7481
|
+
}, /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.span, _extends({
|
7482
7482
|
role: "slider",
|
7483
7483
|
"aria-label": props['aria-label'] || label,
|
7484
7484
|
"aria-valuemin": context.min,
|
@@ -7500,9 +7500,9 @@
|
|
7500
7500
|
});
|
7501
7501
|
/* -----------------------------------------------------------------------------------------------*/ const $faa2e61a3361514f$var$BubbleInput = (props)=>{
|
7502
7502
|
const { value: value , ...inputProps } = props;
|
7503
|
-
const ref =
|
7503
|
+
const ref = React.useRef(null);
|
7504
7504
|
const prevValue = $010c2913dbd2fe3d$export$5cae361ad82dce8b(value); // Bubble value change to parents (e.g form change event)
|
7505
|
-
|
7505
|
+
React.useEffect(()=>{
|
7506
7506
|
const input = ref.current;
|
7507
7507
|
const inputProto = window.HTMLInputElement.prototype;
|
7508
7508
|
const descriptor = Object.getOwnPropertyDescriptor(inputProto, 'value');
|
@@ -7526,7 +7526,7 @@
|
|
7526
7526
|
* to be set programatically and bubble to any parent form `onChange` event.
|
7527
7527
|
* Adding the `value` will cause React to consider the programatic
|
7528
7528
|
* dispatch a duplicate and it will get swallowed.
|
7529
|
-
*/ return /*#__PURE__*/
|
7529
|
+
*/ return /*#__PURE__*/ React.createElement("input", _extends({
|
7530
7530
|
style: {
|
7531
7531
|
display: 'none'
|
7532
7532
|
}
|
@@ -7637,12 +7637,12 @@
|
|
7637
7637
|
|
7638
7638
|
function TextArea(_a) {
|
7639
7639
|
_a.id; var _b = _a.testId, testId = _b === void 0 ? 'textarea' : _b, value = _a.value, onChange = _a.onChange, error = _a.error, _c = _a.size, size = _c === void 0 ? 'med' : _c, _d = _a.defaultClassName, defaultClassName = _d === void 0 ? 'block border border-slate-300 focus:outline-blue-400 w-full disabled:opacity-50 disabled:bg-slate-50' : _d, _e = _a.disabled, disabled = _e === void 0 ? false : _e, className = _a.className, _f = _a.defaultWrapperClassName, defaultWrapperClassName = _f === void 0 ? 'block' : _f, wrapperClassName = _a.wrapperClassName, placeholder = _a.placeholder, label = _a.label, description = _a.description, before = _a.before, after = _a.after, cleaner = _a.cleaner, autofocus = _a.autofocus;
|
7640
|
-
var _g =
|
7640
|
+
var _g = React.useState(value), v = _g[0], setV = _g[1];
|
7641
7641
|
var updateValue = function (newValue) {
|
7642
7642
|
setV(newValue);
|
7643
7643
|
value = newValue;
|
7644
7644
|
};
|
7645
|
-
|
7645
|
+
React.useMemo(function () {
|
7646
7646
|
updateValue(value);
|
7647
7647
|
}, [value]);
|
7648
7648
|
var onInputChange = function (e) {
|
@@ -7655,19 +7655,19 @@
|
|
7655
7655
|
onChange(newV);
|
7656
7656
|
}
|
7657
7657
|
};
|
7658
|
-
return (
|
7658
|
+
return (React.createElement("label", { className: makeClassName({
|
7659
7659
|
defaultClassName: defaultWrapperClassName,
|
7660
7660
|
className: wrapperClassName
|
7661
7661
|
}) },
|
7662
7662
|
typeof label === 'string'
|
7663
|
-
?
|
7663
|
+
? React.createElement(Label, { label: label })
|
7664
7664
|
: label !== undefined ? label : '',
|
7665
7665
|
typeof description === 'string'
|
7666
|
-
?
|
7666
|
+
? React.createElement(Description, { description: description })
|
7667
7667
|
: description !== undefined ? description : '',
|
7668
7668
|
before !== undefined ? before : '',
|
7669
|
-
error !== undefined ?
|
7670
|
-
|
7669
|
+
error !== undefined ? React.createElement("p", { className: "text-rose-800 text-xs" }, error) : '',
|
7670
|
+
React.createElement("textarea", { autoFocus: autofocus !== null && autofocus !== void 0 ? autofocus : false, "data-testid": testId, className: makeClassName({
|
7671
7671
|
size: size,
|
7672
7672
|
defaultClassName: defaultClassName,
|
7673
7673
|
className: className,
|
@@ -7725,18 +7725,18 @@
|
|
7725
7725
|
const $5cb92bef7577960e$var$POINTER_DOWN_OUTSIDE = 'dismissableLayer.pointerDownOutside';
|
7726
7726
|
const $5cb92bef7577960e$var$FOCUS_OUTSIDE = 'dismissableLayer.focusOutside';
|
7727
7727
|
let $5cb92bef7577960e$var$originalBodyPointerEvents;
|
7728
|
-
const $5cb92bef7577960e$var$DismissableLayerContext = /*#__PURE__*/
|
7728
|
+
const $5cb92bef7577960e$var$DismissableLayerContext = /*#__PURE__*/ React.createContext({
|
7729
7729
|
layers: new Set(),
|
7730
7730
|
layersWithOutsidePointerEventsDisabled: new Set(),
|
7731
7731
|
branches: new Set()
|
7732
7732
|
});
|
7733
|
-
const $5cb92bef7577960e$export$177fb62ff3ec1f22 = /*#__PURE__*/
|
7733
|
+
const $5cb92bef7577960e$export$177fb62ff3ec1f22 = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
7734
7734
|
var _node$ownerDocument;
|
7735
7735
|
const { disableOutsidePointerEvents: disableOutsidePointerEvents = false , onEscapeKeyDown: onEscapeKeyDown , onPointerDownOutside: onPointerDownOutside , onFocusOutside: onFocusOutside , onInteractOutside: onInteractOutside , onDismiss: onDismiss , ...layerProps } = props;
|
7736
|
-
const context =
|
7737
|
-
const [node1, setNode] =
|
7736
|
+
const context = React.useContext($5cb92bef7577960e$var$DismissableLayerContext);
|
7737
|
+
const [node1, setNode] = React.useState(null);
|
7738
7738
|
const ownerDocument = (_node$ownerDocument = node1 === null || node1 === void 0 ? void 0 : node1.ownerDocument) !== null && _node$ownerDocument !== void 0 ? _node$ownerDocument : globalThis === null || globalThis === void 0 ? void 0 : globalThis.document;
|
7739
|
-
const [, force] =
|
7739
|
+
const [, force] = React.useState({});
|
7740
7740
|
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, (node)=>setNode(node)
|
7741
7741
|
);
|
7742
7742
|
const layers = Array.from(context.layers);
|
@@ -7778,7 +7778,7 @@
|
|
7778
7778
|
onDismiss();
|
7779
7779
|
}
|
7780
7780
|
}, ownerDocument);
|
7781
|
-
|
7781
|
+
React.useEffect(()=>{
|
7782
7782
|
if (!node1) return;
|
7783
7783
|
if (disableOutsidePointerEvents) {
|
7784
7784
|
if (context.layersWithOutsidePointerEventsDisabled.size === 0) {
|
@@ -7803,7 +7803,7 @@
|
|
7803
7803
|
* because a change to `disableOutsidePointerEvents` would remove this layer from the stack
|
7804
7804
|
* and add it to the end again so the layering order wouldn't be _creation order_.
|
7805
7805
|
* We only want them to be removed from context stacks when unmounted.
|
7806
|
-
*/
|
7806
|
+
*/ React.useEffect(()=>{
|
7807
7807
|
return ()=>{
|
7808
7808
|
if (!node1) return;
|
7809
7809
|
context.layers.delete(node1);
|
@@ -7814,14 +7814,14 @@
|
|
7814
7814
|
node1,
|
7815
7815
|
context
|
7816
7816
|
]);
|
7817
|
-
|
7817
|
+
React.useEffect(()=>{
|
7818
7818
|
const handleUpdate = ()=>force({})
|
7819
7819
|
;
|
7820
7820
|
document.addEventListener($5cb92bef7577960e$var$CONTEXT_UPDATE, handleUpdate);
|
7821
7821
|
return ()=>document.removeEventListener($5cb92bef7577960e$var$CONTEXT_UPDATE, handleUpdate)
|
7822
7822
|
;
|
7823
7823
|
}, []);
|
7824
|
-
return /*#__PURE__*/
|
7824
|
+
return /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({}, layerProps, {
|
7825
7825
|
ref: composedRefs,
|
7826
7826
|
style: {
|
7827
7827
|
pointerEvents: isBodyPointerEventsDisabled ? isPointerEventsEnabled ? 'auto' : 'none' : undefined,
|
@@ -7838,9 +7838,9 @@
|
|
7838
7838
|
* Returns props to pass to the node we want to check for outside events.
|
7839
7839
|
*/ function $5cb92bef7577960e$var$usePointerDownOutside(onPointerDownOutside, ownerDocument = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) {
|
7840
7840
|
const handlePointerDownOutside = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onPointerDownOutside);
|
7841
|
-
const isPointerInsideReactTreeRef =
|
7842
|
-
const handleClickRef =
|
7843
|
-
|
7841
|
+
const isPointerInsideReactTreeRef = React.useRef(false);
|
7842
|
+
const handleClickRef = React.useRef(()=>{});
|
7843
|
+
React.useEffect(()=>{
|
7844
7844
|
const handlePointerDown = (event)=>{
|
7845
7845
|
if (event.target && !isPointerInsideReactTreeRef.current) {
|
7846
7846
|
const eventDetail = {
|
@@ -7908,8 +7908,8 @@
|
|
7908
7908
|
* Returns props to pass to the root (node) of the subtree we want to check.
|
7909
7909
|
*/ function $5cb92bef7577960e$var$useFocusOutside(onFocusOutside, ownerDocument = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) {
|
7910
7910
|
const handleFocusOutside = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onFocusOutside);
|
7911
|
-
const isFocusInsideReactTreeRef =
|
7912
|
-
|
7911
|
+
const isFocusInsideReactTreeRef = React.useRef(false);
|
7912
|
+
React.useEffect(()=>{
|
7913
7913
|
const handleFocus = (event)=>{
|
7914
7914
|
if (event.target && !isFocusInsideReactTreeRef.current) {
|
7915
7915
|
const eventDetail = {
|
@@ -7957,15 +7957,15 @@
|
|
7957
7957
|
bubbles: false,
|
7958
7958
|
cancelable: true
|
7959
7959
|
};
|
7960
|
-
const $d3863c46a17e8a28$export$20e40289641fbbb6 = /*#__PURE__*/
|
7960
|
+
const $d3863c46a17e8a28$export$20e40289641fbbb6 = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
7961
7961
|
const { loop: loop = false , trapped: trapped = false , onMountAutoFocus: onMountAutoFocusProp , onUnmountAutoFocus: onUnmountAutoFocusProp , ...scopeProps } = props;
|
7962
|
-
const [container1, setContainer] =
|
7962
|
+
const [container1, setContainer] = React.useState(null);
|
7963
7963
|
const onMountAutoFocus = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onMountAutoFocusProp);
|
7964
7964
|
const onUnmountAutoFocus = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onUnmountAutoFocusProp);
|
7965
|
-
const lastFocusedElementRef =
|
7965
|
+
const lastFocusedElementRef = React.useRef(null);
|
7966
7966
|
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, (node)=>setContainer(node)
|
7967
7967
|
);
|
7968
|
-
const focusScope =
|
7968
|
+
const focusScope = React.useRef({
|
7969
7969
|
paused: false,
|
7970
7970
|
pause () {
|
7971
7971
|
this.paused = true;
|
@@ -7974,7 +7974,7 @@
|
|
7974
7974
|
this.paused = false;
|
7975
7975
|
}
|
7976
7976
|
}).current; // Takes care of trapping focus if focus is moved outside programmatically for example
|
7977
|
-
|
7977
|
+
React.useEffect(()=>{
|
7978
7978
|
if (trapped) {
|
7979
7979
|
function handleFocusIn(event) {
|
7980
7980
|
if (focusScope.paused || !container1) return;
|
@@ -8027,7 +8027,7 @@
|
|
8027
8027
|
container1,
|
8028
8028
|
focusScope.paused
|
8029
8029
|
]);
|
8030
|
-
|
8030
|
+
React.useEffect(()=>{
|
8031
8031
|
if (container1) {
|
8032
8032
|
$d3863c46a17e8a28$var$focusScopesStack.add(focusScope);
|
8033
8033
|
const previouslyFocusedElement = document.activeElement;
|
@@ -8066,7 +8066,7 @@
|
|
8066
8066
|
onUnmountAutoFocus,
|
8067
8067
|
focusScope
|
8068
8068
|
]); // Takes care of looping focus (when tabbing whilst at the edges)
|
8069
|
-
const handleKeyDown =
|
8069
|
+
const handleKeyDown = React.useCallback((event)=>{
|
8070
8070
|
if (!loop && !trapped) return;
|
8071
8071
|
if (focusScope.paused) return;
|
8072
8072
|
const isTabKey = event.key === 'Tab' && !event.altKey && !event.ctrlKey && !event.metaKey;
|
@@ -8096,7 +8096,7 @@
|
|
8096
8096
|
trapped,
|
8097
8097
|
focusScope.paused
|
8098
8098
|
]);
|
8099
|
-
return /*#__PURE__*/
|
8099
|
+
return /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({
|
8100
8100
|
tabIndex: -1
|
8101
8101
|
}, scopeProps, {
|
8102
8102
|
ref: composedRefs,
|
@@ -8220,10 +8220,10 @@
|
|
8220
8220
|
);
|
8221
8221
|
}
|
8222
8222
|
|
8223
|
-
/*#__PURE__*/
|
8223
|
+
/*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
8224
8224
|
var _globalThis$document;
|
8225
8225
|
const { container: container = globalThis === null || globalThis === void 0 ? void 0 : (_globalThis$document = globalThis.document) === null || _globalThis$document === void 0 ? void 0 : _globalThis$document.body , ...portalProps } = props;
|
8226
|
-
return container ? /*#__PURE__*/ ReactDOM__default.createPortal(/*#__PURE__*/
|
8226
|
+
return container ? /*#__PURE__*/ ReactDOM__default.createPortal(/*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({}, portalProps, {
|
8227
8227
|
ref: forwardedRef
|
8228
8228
|
})), container) : null;
|
8229
8229
|
});
|
@@ -8233,7 +8233,7 @@
|
|
8233
8233
|
* Injects a pair of focus guards at the edges of the whole DOM tree
|
8234
8234
|
* to ensure `focusin` & `focusout` events can be caught consistently.
|
8235
8235
|
*/ function $3db38b7d1fb3fe6a$export$b7ece24a22aeda8c() {
|
8236
|
-
|
8236
|
+
React.useEffect(()=>{
|
8237
8237
|
var _edgeGuards$, _edgeGuards$2;
|
8238
8238
|
const edgeGuards = document.querySelectorAll('[data-radix-focus-guard]');
|
8239
8239
|
document.body.insertAdjacentElement('afterbegin', (_edgeGuards$ = edgeGuards[0]) !== null && _edgeGuards$ !== void 0 ? _edgeGuards$ : $3db38b7d1fb3fe6a$var$createFocusGuard());
|
@@ -8301,7 +8301,7 @@
|
|
8301
8301
|
* @returns {MutableRefObject}
|
8302
8302
|
*/
|
8303
8303
|
function useCallbackRef$2(initialValue, callback) {
|
8304
|
-
var ref =
|
8304
|
+
var ref = React.useState(function () { return ({
|
8305
8305
|
// value
|
8306
8306
|
value: initialValue,
|
8307
8307
|
// last callback
|
@@ -8426,7 +8426,7 @@
|
|
8426
8426
|
if (!Target) {
|
8427
8427
|
throw new Error('Sidecar medium not found');
|
8428
8428
|
}
|
8429
|
-
return
|
8429
|
+
return React__namespace.createElement(Target, __assign({}, rest));
|
8430
8430
|
};
|
8431
8431
|
SideCar$1.isSideCarExport = true;
|
8432
8432
|
function exportSidecar(medium, exported) {
|
@@ -8442,9 +8442,9 @@
|
|
8442
8442
|
/**
|
8443
8443
|
* Removes scrollbar from the page and contain the scroll within the Lock
|
8444
8444
|
*/
|
8445
|
-
var RemoveScroll =
|
8446
|
-
var ref =
|
8447
|
-
var _a =
|
8445
|
+
var RemoveScroll = React__namespace.forwardRef(function (props, parentRef) {
|
8446
|
+
var ref = React__namespace.useRef(null);
|
8447
|
+
var _a = React__namespace.useState({
|
8448
8448
|
onScrollCapture: nothing,
|
8449
8449
|
onWheelCapture: nothing,
|
8450
8450
|
onTouchMoveCapture: nothing,
|
@@ -8453,9 +8453,9 @@
|
|
8453
8453
|
var SideCar = sideCar;
|
8454
8454
|
var containerRef = useMergeRefs([ref, parentRef]);
|
8455
8455
|
var containerProps = __assign(__assign({}, rest), callbacks);
|
8456
|
-
return (
|
8457
|
-
enabled && (
|
8458
|
-
forwardProps ? (
|
8456
|
+
return (React__namespace.createElement(React__namespace.Fragment, null,
|
8457
|
+
enabled && (React__namespace.createElement(SideCar, { sideCar: effectCar, removeScrollBar: removeScrollBar, shards: shards, noIsolation: noIsolation, inert: inert, setCallbacks: setCallbacks, allowPinchZoom: !!allowPinchZoom, lockRef: ref })),
|
8458
|
+
forwardProps ? (React__namespace.cloneElement(React__namespace.Children.only(children), __assign(__assign({}, containerProps), { ref: containerRef }))) : (React__namespace.createElement(Container, __assign({}, containerProps, { className: className, ref: containerRef }), children))));
|
8459
8459
|
});
|
8460
8460
|
RemoveScroll.defaultProps = {
|
8461
8461
|
enabled: true,
|
@@ -8533,7 +8533,7 @@
|
|
8533
8533
|
var styleHookSingleton = function () {
|
8534
8534
|
var sheet = stylesheetSingleton();
|
8535
8535
|
return function (styles, isDynamic) {
|
8536
|
-
|
8536
|
+
React__namespace.useEffect(function () {
|
8537
8537
|
sheet.add(styles);
|
8538
8538
|
return function () {
|
8539
8539
|
sheet.remove();
|
@@ -8614,8 +8614,8 @@
|
|
8614
8614
|
however it will be used only by the "first" invocation
|
8615
8615
|
due to singleton nature of <Style
|
8616
8616
|
*/
|
8617
|
-
var gap =
|
8618
|
-
return
|
8617
|
+
var gap = React__namespace.useMemo(function () { return getGapWidth(gapMode); }, [gapMode]);
|
8618
|
+
return React__namespace.createElement(Style, { styles: getStyles(gap, !noRelative, gapMode, !noImportant ? '!important' : '') });
|
8619
8619
|
};
|
8620
8620
|
|
8621
8621
|
var passiveSupported = false;
|
@@ -8747,16 +8747,16 @@
|
|
8747
8747
|
var idCounter = 0;
|
8748
8748
|
var lockStack = [];
|
8749
8749
|
function RemoveScrollSideCar(props) {
|
8750
|
-
var shouldPreventQueue =
|
8751
|
-
var touchStartRef =
|
8752
|
-
var activeAxis =
|
8753
|
-
var id =
|
8754
|
-
var Style =
|
8755
|
-
var lastProps =
|
8756
|
-
|
8750
|
+
var shouldPreventQueue = React__namespace.useRef([]);
|
8751
|
+
var touchStartRef = React__namespace.useRef([0, 0]);
|
8752
|
+
var activeAxis = React__namespace.useRef();
|
8753
|
+
var id = React__namespace.useState(idCounter++)[0];
|
8754
|
+
var Style = React__namespace.useState(function () { return styleSingleton(); })[0];
|
8755
|
+
var lastProps = React__namespace.useRef(props);
|
8756
|
+
React__namespace.useEffect(function () {
|
8757
8757
|
lastProps.current = props;
|
8758
8758
|
}, [props]);
|
8759
|
-
|
8759
|
+
React__namespace.useEffect(function () {
|
8760
8760
|
if (props.inert) {
|
8761
8761
|
document.body.classList.add("block-interactivity-".concat(id));
|
8762
8762
|
var allow_1 = __spreadArray([props.lockRef.current], (props.shards || []).map(extractRef)).filter(Boolean);
|
@@ -8768,7 +8768,7 @@
|
|
8768
8768
|
}
|
8769
8769
|
return;
|
8770
8770
|
}, [props.inert, props.lockRef.current, props.shards]);
|
8771
|
-
var shouldCancelEvent =
|
8771
|
+
var shouldCancelEvent = React__namespace.useCallback(function (event, parent) {
|
8772
8772
|
if ('touches' in event && event.touches.length === 2) {
|
8773
8773
|
return !lastProps.current.allowPinchZoom;
|
8774
8774
|
}
|
@@ -8807,7 +8807,7 @@
|
|
8807
8807
|
var cancelingAxis = activeAxis.current || currentAxis;
|
8808
8808
|
return handleScroll(cancelingAxis, parent, event, cancelingAxis === 'h' ? deltaX : deltaY);
|
8809
8809
|
}, []);
|
8810
|
-
var shouldPrevent =
|
8810
|
+
var shouldPrevent = React__namespace.useCallback(function (_event) {
|
8811
8811
|
var event = _event;
|
8812
8812
|
if (!lockStack.length || lockStack[lockStack.length - 1] !== Style) {
|
8813
8813
|
// not the last active
|
@@ -8836,24 +8836,24 @@
|
|
8836
8836
|
}
|
8837
8837
|
}
|
8838
8838
|
}, []);
|
8839
|
-
var shouldCancel =
|
8839
|
+
var shouldCancel = React__namespace.useCallback(function (name, delta, target, should) {
|
8840
8840
|
var event = { name: name, delta: delta, target: target, should: should };
|
8841
8841
|
shouldPreventQueue.current.push(event);
|
8842
8842
|
setTimeout(function () {
|
8843
8843
|
shouldPreventQueue.current = shouldPreventQueue.current.filter(function (e) { return e !== event; });
|
8844
8844
|
}, 1);
|
8845
8845
|
}, []);
|
8846
|
-
var scrollTouchStart =
|
8846
|
+
var scrollTouchStart = React__namespace.useCallback(function (event) {
|
8847
8847
|
touchStartRef.current = getTouchXY(event);
|
8848
8848
|
activeAxis.current = undefined;
|
8849
8849
|
}, []);
|
8850
|
-
var scrollWheel =
|
8850
|
+
var scrollWheel = React__namespace.useCallback(function (event) {
|
8851
8851
|
shouldCancel(event.type, getDeltaXY(event), event.target, shouldCancelEvent(event, props.lockRef.current));
|
8852
8852
|
}, []);
|
8853
|
-
var scrollTouchMove =
|
8853
|
+
var scrollTouchMove = React__namespace.useCallback(function (event) {
|
8854
8854
|
shouldCancel(event.type, getTouchXY(event), event.target, shouldCancelEvent(event, props.lockRef.current));
|
8855
8855
|
}, []);
|
8856
|
-
|
8856
|
+
React__namespace.useEffect(function () {
|
8857
8857
|
lockStack.push(Style);
|
8858
8858
|
props.setCallbacks({
|
8859
8859
|
onScrollCapture: scrollWheel,
|
@@ -8871,14 +8871,14 @@
|
|
8871
8871
|
};
|
8872
8872
|
}, []);
|
8873
8873
|
var removeScrollBar = props.removeScrollBar, inert = props.inert;
|
8874
|
-
return (
|
8875
|
-
inert ?
|
8876
|
-
removeScrollBar ?
|
8874
|
+
return (React__namespace.createElement(React__namespace.Fragment, null,
|
8875
|
+
inert ? React__namespace.createElement(Style, { styles: generateStyle(id) }) : null,
|
8876
|
+
removeScrollBar ? React__namespace.createElement(RemoveScrollBar, { gapMode: "margin" }) : null));
|
8877
8877
|
}
|
8878
8878
|
|
8879
8879
|
var SideCar = exportSidecar(effectCar, RemoveScrollSideCar);
|
8880
8880
|
|
8881
|
-
var ReactRemoveScroll =
|
8881
|
+
var ReactRemoveScroll = React__namespace.forwardRef(function (props, ref) { return (React__namespace.createElement(RemoveScroll, __assign({}, props, { ref: ref, sideCar: SideCar }))); });
|
8882
8882
|
ReactRemoveScroll.classNames = RemoveScroll.classNames;
|
8883
8883
|
var $67UHm$RemoveScroll = ReactRemoveScroll;
|
8884
8884
|
|
@@ -9020,11 +9020,11 @@
|
|
9020
9020
|
/* -------------------------------------------------------------------------------------------------
|
9021
9021
|
* DialogTrigger
|
9022
9022
|
* -----------------------------------------------------------------------------------------------*/ const $5d3850c4d0b4e6c7$var$TRIGGER_NAME = 'DialogTrigger';
|
9023
|
-
/*#__PURE__*/
|
9023
|
+
/*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
9024
9024
|
const { __scopeDialog: __scopeDialog , ...triggerProps } = props;
|
9025
9025
|
const context = $5d3850c4d0b4e6c7$var$useDialogContext($5d3850c4d0b4e6c7$var$TRIGGER_NAME, __scopeDialog);
|
9026
9026
|
const composedTriggerRef = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, context.triggerRef);
|
9027
|
-
return /*#__PURE__*/
|
9027
|
+
return /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.button, _extends({
|
9028
9028
|
type: "button",
|
9029
9029
|
"aria-haspopup": "dialog",
|
9030
9030
|
"aria-expanded": context.open,
|
@@ -9044,28 +9044,28 @@
|
|
9044
9044
|
/* -------------------------------------------------------------------------------------------------
|
9045
9045
|
* DialogOverlay
|
9046
9046
|
* -----------------------------------------------------------------------------------------------*/ const $5d3850c4d0b4e6c7$var$OVERLAY_NAME = 'DialogOverlay';
|
9047
|
-
/*#__PURE__*/
|
9047
|
+
/*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
9048
9048
|
const portalContext = $5d3850c4d0b4e6c7$var$usePortalContext($5d3850c4d0b4e6c7$var$OVERLAY_NAME, props.__scopeDialog);
|
9049
9049
|
const { forceMount: forceMount = portalContext.forceMount , ...overlayProps } = props;
|
9050
9050
|
const context = $5d3850c4d0b4e6c7$var$useDialogContext($5d3850c4d0b4e6c7$var$OVERLAY_NAME, props.__scopeDialog);
|
9051
|
-
return context.modal ? /*#__PURE__*/
|
9051
|
+
return context.modal ? /*#__PURE__*/ React.createElement($921a889cee6df7e8$export$99c2b779aa4e8b8b, {
|
9052
9052
|
present: forceMount || context.open
|
9053
|
-
}, /*#__PURE__*/
|
9053
|
+
}, /*#__PURE__*/ React.createElement($5d3850c4d0b4e6c7$var$DialogOverlayImpl, _extends({}, overlayProps, {
|
9054
9054
|
ref: forwardedRef
|
9055
9055
|
}))) : null;
|
9056
9056
|
});
|
9057
|
-
const $5d3850c4d0b4e6c7$var$DialogOverlayImpl = /*#__PURE__*/
|
9057
|
+
const $5d3850c4d0b4e6c7$var$DialogOverlayImpl = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
9058
9058
|
const { __scopeDialog: __scopeDialog , ...overlayProps } = props;
|
9059
9059
|
const context = $5d3850c4d0b4e6c7$var$useDialogContext($5d3850c4d0b4e6c7$var$OVERLAY_NAME, __scopeDialog);
|
9060
9060
|
return(/*#__PURE__*/ // Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`
|
9061
9061
|
// ie. when `Overlay` and `Content` are siblings
|
9062
|
-
|
9062
|
+
React.createElement($67UHm$RemoveScroll, {
|
9063
9063
|
as: $5e63c961fc1ce211$export$8c6ed5c666ac1360,
|
9064
9064
|
allowPinchZoom: true,
|
9065
9065
|
shards: [
|
9066
9066
|
context.contentRef
|
9067
9067
|
]
|
9068
|
-
}, /*#__PURE__*/
|
9068
|
+
}, /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({
|
9069
9069
|
"data-state": $5d3850c4d0b4e6c7$var$getState(context.open)
|
9070
9070
|
}, overlayProps, {
|
9071
9071
|
ref: forwardedRef // We re-enable pointer-events prevented by `Dialog.Content` to allow scrolling the overlay.
|
@@ -9079,27 +9079,27 @@
|
|
9079
9079
|
/* -------------------------------------------------------------------------------------------------
|
9080
9080
|
* DialogContent
|
9081
9081
|
* -----------------------------------------------------------------------------------------------*/ const $5d3850c4d0b4e6c7$var$CONTENT_NAME = 'DialogContent';
|
9082
|
-
/*#__PURE__*/
|
9082
|
+
/*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
9083
9083
|
const portalContext = $5d3850c4d0b4e6c7$var$usePortalContext($5d3850c4d0b4e6c7$var$CONTENT_NAME, props.__scopeDialog);
|
9084
9084
|
const { forceMount: forceMount = portalContext.forceMount , ...contentProps } = props;
|
9085
9085
|
const context = $5d3850c4d0b4e6c7$var$useDialogContext($5d3850c4d0b4e6c7$var$CONTENT_NAME, props.__scopeDialog);
|
9086
|
-
return /*#__PURE__*/
|
9086
|
+
return /*#__PURE__*/ React.createElement($921a889cee6df7e8$export$99c2b779aa4e8b8b, {
|
9087
9087
|
present: forceMount || context.open
|
9088
|
-
}, context.modal ? /*#__PURE__*/
|
9088
|
+
}, context.modal ? /*#__PURE__*/ React.createElement($5d3850c4d0b4e6c7$var$DialogContentModal, _extends({}, contentProps, {
|
9089
9089
|
ref: forwardedRef
|
9090
|
-
})) : /*#__PURE__*/
|
9090
|
+
})) : /*#__PURE__*/ React.createElement($5d3850c4d0b4e6c7$var$DialogContentNonModal, _extends({}, contentProps, {
|
9091
9091
|
ref: forwardedRef
|
9092
9092
|
})));
|
9093
9093
|
});
|
9094
|
-
/* -----------------------------------------------------------------------------------------------*/ const $5d3850c4d0b4e6c7$var$DialogContentModal = /*#__PURE__*/
|
9094
|
+
/* -----------------------------------------------------------------------------------------------*/ const $5d3850c4d0b4e6c7$var$DialogContentModal = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
9095
9095
|
const context = $5d3850c4d0b4e6c7$var$useDialogContext($5d3850c4d0b4e6c7$var$CONTENT_NAME, props.__scopeDialog);
|
9096
|
-
const contentRef =
|
9096
|
+
const contentRef = React.useRef(null);
|
9097
9097
|
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, context.contentRef, contentRef); // aria-hide everything except the content (better supported equivalent to setting aria-modal)
|
9098
|
-
|
9098
|
+
React.useEffect(()=>{
|
9099
9099
|
const content = contentRef.current;
|
9100
9100
|
if (content) return hideOthers(content);
|
9101
9101
|
}, []);
|
9102
|
-
return /*#__PURE__*/
|
9102
|
+
return /*#__PURE__*/ React.createElement($5d3850c4d0b4e6c7$var$DialogContentImpl, _extends({}, props, {
|
9103
9103
|
ref: composedRefs // we make sure focus isn't trapped once `DialogContent` has been closed
|
9104
9104
|
,
|
9105
9105
|
trapFocus: context.open,
|
@@ -9121,11 +9121,11 @@
|
|
9121
9121
|
)
|
9122
9122
|
}));
|
9123
9123
|
});
|
9124
|
-
/* -----------------------------------------------------------------------------------------------*/ const $5d3850c4d0b4e6c7$var$DialogContentNonModal = /*#__PURE__*/
|
9124
|
+
/* -----------------------------------------------------------------------------------------------*/ const $5d3850c4d0b4e6c7$var$DialogContentNonModal = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
9125
9125
|
const context = $5d3850c4d0b4e6c7$var$useDialogContext($5d3850c4d0b4e6c7$var$CONTENT_NAME, props.__scopeDialog);
|
9126
|
-
const hasInteractedOutsideRef =
|
9127
|
-
const hasPointerDownOutsideRef =
|
9128
|
-
return /*#__PURE__*/
|
9126
|
+
const hasInteractedOutsideRef = React.useRef(false);
|
9127
|
+
const hasPointerDownOutsideRef = React.useRef(false);
|
9128
|
+
return /*#__PURE__*/ React.createElement($5d3850c4d0b4e6c7$var$DialogContentImpl, _extends({}, props, {
|
9129
9129
|
ref: forwardedRef,
|
9130
9130
|
trapFocus: false,
|
9131
9131
|
disableOutsidePointerEvents: false,
|
@@ -9159,20 +9159,20 @@
|
|
9159
9159
|
}
|
9160
9160
|
}));
|
9161
9161
|
});
|
9162
|
-
/* -----------------------------------------------------------------------------------------------*/ const $5d3850c4d0b4e6c7$var$DialogContentImpl = /*#__PURE__*/
|
9162
|
+
/* -----------------------------------------------------------------------------------------------*/ const $5d3850c4d0b4e6c7$var$DialogContentImpl = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
9163
9163
|
const { __scopeDialog: __scopeDialog , trapFocus: trapFocus , onOpenAutoFocus: onOpenAutoFocus , onCloseAutoFocus: onCloseAutoFocus , ...contentProps } = props;
|
9164
9164
|
const context = $5d3850c4d0b4e6c7$var$useDialogContext($5d3850c4d0b4e6c7$var$CONTENT_NAME, __scopeDialog);
|
9165
|
-
const contentRef =
|
9165
|
+
const contentRef = React.useRef(null);
|
9166
9166
|
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, contentRef); // Make sure the whole tree has focus guards as our `Dialog` will be
|
9167
9167
|
// the last element in the DOM (beacuse of the `Portal`)
|
9168
9168
|
$3db38b7d1fb3fe6a$export$b7ece24a22aeda8c();
|
9169
|
-
return /*#__PURE__*/
|
9169
|
+
return /*#__PURE__*/ React.createElement(React.Fragment, null, /*#__PURE__*/ React.createElement($d3863c46a17e8a28$export$20e40289641fbbb6, {
|
9170
9170
|
asChild: true,
|
9171
9171
|
loop: true,
|
9172
9172
|
trapped: trapFocus,
|
9173
9173
|
onMountAutoFocus: onOpenAutoFocus,
|
9174
9174
|
onUnmountAutoFocus: onCloseAutoFocus
|
9175
|
-
}, /*#__PURE__*/
|
9175
|
+
}, /*#__PURE__*/ React.createElement($5cb92bef7577960e$export$177fb62ff3ec1f22, _extends({
|
9176
9176
|
role: "dialog",
|
9177
9177
|
id: context.contentId,
|
9178
9178
|
"aria-describedby": context.descriptionId,
|
@@ -9203,12 +9203,12 @@
|
|
9203
9203
|
}
|
9204
9204
|
|
9205
9205
|
var _excluded$W = ["color"];
|
9206
|
-
/*#__PURE__*/
|
9206
|
+
/*#__PURE__*/React.forwardRef(function (_ref, forwardedRef) {
|
9207
9207
|
var _ref$color = _ref.color,
|
9208
9208
|
color = _ref$color === void 0 ? 'currentColor' : _ref$color,
|
9209
9209
|
props = _objectWithoutPropertiesLoose$1(_ref, _excluded$W);
|
9210
9210
|
|
9211
|
-
return
|
9211
|
+
return React.createElement("svg", Object.assign({
|
9212
9212
|
width: "15",
|
9213
9213
|
height: "15",
|
9214
9214
|
viewBox: "0 0 15 15",
|
@@ -9216,7 +9216,7 @@
|
|
9216
9216
|
xmlns: "http://www.w3.org/2000/svg"
|
9217
9217
|
}, props, {
|
9218
9218
|
ref: forwardedRef
|
9219
|
-
}),
|
9219
|
+
}), React.createElement("path", {
|
9220
9220
|
d: "M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z",
|
9221
9221
|
fill: color,
|
9222
9222
|
fillRule: "evenodd",
|
@@ -9225,12 +9225,12 @@
|
|
9225
9225
|
});
|
9226
9226
|
|
9227
9227
|
var _excluded$1r = ["color"];
|
9228
|
-
/*#__PURE__*/
|
9228
|
+
/*#__PURE__*/React.forwardRef(function (_ref, forwardedRef) {
|
9229
9229
|
var _ref$color = _ref.color,
|
9230
9230
|
color = _ref$color === void 0 ? 'currentColor' : _ref$color,
|
9231
9231
|
props = _objectWithoutPropertiesLoose$1(_ref, _excluded$1r);
|
9232
9232
|
|
9233
|
-
return
|
9233
|
+
return React.createElement("svg", Object.assign({
|
9234
9234
|
width: "15",
|
9235
9235
|
height: "15",
|
9236
9236
|
viewBox: "0 0 15 15",
|
@@ -9238,7 +9238,7 @@
|
|
9238
9238
|
xmlns: "http://www.w3.org/2000/svg"
|
9239
9239
|
}, props, {
|
9240
9240
|
ref: forwardedRef
|
9241
|
-
}),
|
9241
|
+
}), React.createElement("path", {
|
9242
9242
|
d: "M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",
|
9243
9243
|
fill: color,
|
9244
9244
|
fillRule: "evenodd",
|
@@ -9254,7 +9254,7 @@
|
|
9254
9254
|
]);
|
9255
9255
|
const $69cb30bb0017df05$var$useRovingFocusGroupScope = $d7bdfb9eb0fdf311$export$c7109489551a4f4();
|
9256
9256
|
const [$69cb30bb0017df05$var$TabsProvider, $69cb30bb0017df05$var$useTabsContext] = $69cb30bb0017df05$var$createTabsContext($69cb30bb0017df05$var$TABS_NAME);
|
9257
|
-
/*#__PURE__*/
|
9257
|
+
/*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
9258
9258
|
const { __scopeTabs: __scopeTabs , value: valueProp , onValueChange: onValueChange , defaultValue: defaultValue , orientation: orientation = 'horizontal' , dir: dir , activationMode: activationMode = 'automatic' , ...tabsProps } = props;
|
9259
9259
|
const direction = $f631663db3294ace$export$b39126d51d94e6f3(dir);
|
9260
9260
|
const [value, setValue] = $71cd76cc60e0454e$export$6f32135080cb4c3({
|
@@ -9262,7 +9262,7 @@
|
|
9262
9262
|
onChange: onValueChange,
|
9263
9263
|
defaultProp: defaultValue
|
9264
9264
|
});
|
9265
|
-
return /*#__PURE__*/
|
9265
|
+
return /*#__PURE__*/ React.createElement($69cb30bb0017df05$var$TabsProvider, {
|
9266
9266
|
scope: __scopeTabs,
|
9267
9267
|
baseId: $1746a345f3d73bb7$export$f680877a34711e37(),
|
9268
9268
|
value: value,
|
@@ -9270,7 +9270,7 @@
|
|
9270
9270
|
orientation: orientation,
|
9271
9271
|
dir: direction,
|
9272
9272
|
activationMode: activationMode
|
9273
|
-
}, /*#__PURE__*/
|
9273
|
+
}, /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({
|
9274
9274
|
dir: direction,
|
9275
9275
|
"data-orientation": orientation
|
9276
9276
|
}, tabsProps, {
|
@@ -9280,17 +9280,17 @@
|
|
9280
9280
|
/* -------------------------------------------------------------------------------------------------
|
9281
9281
|
* TabsList
|
9282
9282
|
* -----------------------------------------------------------------------------------------------*/ const $69cb30bb0017df05$var$TAB_LIST_NAME = 'TabsList';
|
9283
|
-
/*#__PURE__*/
|
9283
|
+
/*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
9284
9284
|
const { __scopeTabs: __scopeTabs , loop: loop = true , ...listProps } = props;
|
9285
9285
|
const context = $69cb30bb0017df05$var$useTabsContext($69cb30bb0017df05$var$TAB_LIST_NAME, __scopeTabs);
|
9286
9286
|
const rovingFocusGroupScope = $69cb30bb0017df05$var$useRovingFocusGroupScope(__scopeTabs);
|
9287
|
-
return /*#__PURE__*/
|
9287
|
+
return /*#__PURE__*/ React.createElement($d7bdfb9eb0fdf311$export$be92b6f5f03c0fe9, _extends({
|
9288
9288
|
asChild: true
|
9289
9289
|
}, rovingFocusGroupScope, {
|
9290
9290
|
orientation: context.orientation,
|
9291
9291
|
dir: context.dir,
|
9292
9292
|
loop: loop
|
9293
|
-
}), /*#__PURE__*/
|
9293
|
+
}), /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({
|
9294
9294
|
role: "tablist",
|
9295
9295
|
"aria-orientation": context.orientation
|
9296
9296
|
}, listProps, {
|
@@ -9300,19 +9300,19 @@
|
|
9300
9300
|
/* -------------------------------------------------------------------------------------------------
|
9301
9301
|
* TabsTrigger
|
9302
9302
|
* -----------------------------------------------------------------------------------------------*/ const $69cb30bb0017df05$var$TRIGGER_NAME = 'TabsTrigger';
|
9303
|
-
/*#__PURE__*/
|
9303
|
+
/*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
9304
9304
|
const { __scopeTabs: __scopeTabs , value: value , disabled: disabled = false , ...triggerProps } = props;
|
9305
9305
|
const context = $69cb30bb0017df05$var$useTabsContext($69cb30bb0017df05$var$TRIGGER_NAME, __scopeTabs);
|
9306
9306
|
const rovingFocusGroupScope = $69cb30bb0017df05$var$useRovingFocusGroupScope(__scopeTabs);
|
9307
9307
|
const triggerId = $69cb30bb0017df05$var$makeTriggerId(context.baseId, value);
|
9308
9308
|
const contentId = $69cb30bb0017df05$var$makeContentId(context.baseId, value);
|
9309
9309
|
const isSelected = value === context.value;
|
9310
|
-
return /*#__PURE__*/
|
9310
|
+
return /*#__PURE__*/ React.createElement($d7bdfb9eb0fdf311$export$6d08773d2e66f8f2, _extends({
|
9311
9311
|
asChild: true
|
9312
9312
|
}, rovingFocusGroupScope, {
|
9313
9313
|
focusable: !disabled,
|
9314
9314
|
active: isSelected
|
9315
|
-
}), /*#__PURE__*/
|
9315
|
+
}), /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.button, _extends({
|
9316
9316
|
type: "button",
|
9317
9317
|
role: "tab",
|
9318
9318
|
"aria-selected": isSelected,
|
@@ -9347,22 +9347,22 @@
|
|
9347
9347
|
/* -------------------------------------------------------------------------------------------------
|
9348
9348
|
* TabsContent
|
9349
9349
|
* -----------------------------------------------------------------------------------------------*/ const $69cb30bb0017df05$var$CONTENT_NAME = 'TabsContent';
|
9350
|
-
/*#__PURE__*/
|
9350
|
+
/*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
9351
9351
|
const { __scopeTabs: __scopeTabs , value: value , forceMount: forceMount , children: children , ...contentProps } = props;
|
9352
9352
|
const context = $69cb30bb0017df05$var$useTabsContext($69cb30bb0017df05$var$CONTENT_NAME, __scopeTabs);
|
9353
9353
|
const triggerId = $69cb30bb0017df05$var$makeTriggerId(context.baseId, value);
|
9354
9354
|
const contentId = $69cb30bb0017df05$var$makeContentId(context.baseId, value);
|
9355
9355
|
const isSelected = value === context.value;
|
9356
|
-
const isMountAnimationPreventedRef =
|
9357
|
-
|
9356
|
+
const isMountAnimationPreventedRef = React.useRef(isSelected);
|
9357
|
+
React.useEffect(()=>{
|
9358
9358
|
const rAF = requestAnimationFrame(()=>isMountAnimationPreventedRef.current = false
|
9359
9359
|
);
|
9360
9360
|
return ()=>cancelAnimationFrame(rAF)
|
9361
9361
|
;
|
9362
9362
|
}, []);
|
9363
|
-
return /*#__PURE__*/
|
9363
|
+
return /*#__PURE__*/ React.createElement($921a889cee6df7e8$export$99c2b779aa4e8b8b, {
|
9364
9364
|
present: forceMount || isSelected
|
9365
|
-
}, ({ present: present })=>/*#__PURE__*/
|
9365
|
+
}, ({ present: present })=>/*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({
|
9366
9366
|
"data-state": isSelected ? 'active' : 'inactive',
|
9367
9367
|
"data-orientation": context.orientation,
|
9368
9368
|
role: "tabpanel",
|
@@ -9390,19 +9390,19 @@
|
|
9390
9390
|
function createContextScope$2(scopeName, createContextScopeDeps = []) {
|
9391
9391
|
let defaultContexts = [];
|
9392
9392
|
function createContext3(rootComponentName, defaultContext) {
|
9393
|
-
const BaseContext =
|
9393
|
+
const BaseContext = React__namespace.createContext(defaultContext);
|
9394
9394
|
const index = defaultContexts.length;
|
9395
9395
|
defaultContexts = [...defaultContexts, defaultContext];
|
9396
9396
|
const Provider = (props) => {
|
9397
9397
|
const { scope, children, ...context } = props;
|
9398
9398
|
const Context = scope?.[scopeName]?.[index] || BaseContext;
|
9399
|
-
const value =
|
9399
|
+
const value = React__namespace.useMemo(() => context, Object.values(context));
|
9400
9400
|
return /* @__PURE__ */ jsxRuntime.jsx(Context.Provider, { value, children });
|
9401
9401
|
};
|
9402
9402
|
Provider.displayName = rootComponentName + "Provider";
|
9403
9403
|
function useContext2(consumerName, scope) {
|
9404
9404
|
const Context = scope?.[scopeName]?.[index] || BaseContext;
|
9405
|
-
const context =
|
9405
|
+
const context = React__namespace.useContext(Context);
|
9406
9406
|
if (context) return context;
|
9407
9407
|
if (defaultContext !== void 0) return defaultContext;
|
9408
9408
|
throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
|
@@ -9411,11 +9411,11 @@
|
|
9411
9411
|
}
|
9412
9412
|
const createScope = () => {
|
9413
9413
|
const scopeContexts = defaultContexts.map((defaultContext) => {
|
9414
|
-
return
|
9414
|
+
return React__namespace.createContext(defaultContext);
|
9415
9415
|
});
|
9416
9416
|
return function useScope(scope) {
|
9417
9417
|
const contexts = scope?.[scopeName] || scopeContexts;
|
9418
|
-
return
|
9418
|
+
return React__namespace.useMemo(
|
9419
9419
|
() => ({ [`__scope${scopeName}`]: { ...scope, [scopeName]: contexts } }),
|
9420
9420
|
[scope, contexts]
|
9421
9421
|
);
|
@@ -9438,7 +9438,7 @@
|
|
9438
9438
|
const currentScope = scopeProps[`__scope${scopeName}`];
|
9439
9439
|
return { ...nextScopes2, ...currentScope };
|
9440
9440
|
}, {});
|
9441
|
-
return
|
9441
|
+
return React__namespace.useMemo(() => ({ [`__scope${baseScope.scopeName}`]: nextScopes }), [nextScopes]);
|
9442
9442
|
};
|
9443
9443
|
};
|
9444
9444
|
createScope.scopeName = baseScope.scopeName;
|
@@ -9449,18 +9449,18 @@
|
|
9449
9449
|
function createContextScope$1(scopeName, createContextScopeDeps = []) {
|
9450
9450
|
let defaultContexts = [];
|
9451
9451
|
function createContext3(rootComponentName, defaultContext) {
|
9452
|
-
const BaseContext =
|
9452
|
+
const BaseContext = React__namespace.createContext(defaultContext);
|
9453
9453
|
const index = defaultContexts.length;
|
9454
9454
|
defaultContexts = [...defaultContexts, defaultContext];
|
9455
9455
|
function Provider(props) {
|
9456
9456
|
const { scope, children, ...context } = props;
|
9457
9457
|
const Context = scope?.[scopeName][index] || BaseContext;
|
9458
|
-
const value =
|
9458
|
+
const value = React__namespace.useMemo(() => context, Object.values(context));
|
9459
9459
|
return /* @__PURE__ */ jsxRuntime.jsx(Context.Provider, { value, children });
|
9460
9460
|
}
|
9461
9461
|
function useContext2(consumerName, scope) {
|
9462
9462
|
const Context = scope?.[scopeName][index] || BaseContext;
|
9463
|
-
const context =
|
9463
|
+
const context = React__namespace.useContext(Context);
|
9464
9464
|
if (context) return context;
|
9465
9465
|
if (defaultContext !== void 0) return defaultContext;
|
9466
9466
|
throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
|
@@ -9470,11 +9470,11 @@
|
|
9470
9470
|
}
|
9471
9471
|
const createScope = () => {
|
9472
9472
|
const scopeContexts = defaultContexts.map((defaultContext) => {
|
9473
|
-
return
|
9473
|
+
return React__namespace.createContext(defaultContext);
|
9474
9474
|
});
|
9475
9475
|
return function useScope(scope) {
|
9476
9476
|
const contexts = scope?.[scopeName] || scopeContexts;
|
9477
|
-
return
|
9477
|
+
return React__namespace.useMemo(
|
9478
9478
|
() => ({ [`__scope${scopeName}`]: { ...scope, [scopeName]: contexts } }),
|
9479
9479
|
[scope, contexts]
|
9480
9480
|
);
|
@@ -9497,7 +9497,7 @@
|
|
9497
9497
|
const currentScope = scopeProps[`__scope${scopeName}`];
|
9498
9498
|
return { ...nextScopes2, ...currentScope };
|
9499
9499
|
}, {});
|
9500
|
-
return
|
9500
|
+
return React__namespace.useMemo(() => ({ [`__scope${baseScope.scopeName}`]: nextScopes }), [nextScopes]);
|
9501
9501
|
};
|
9502
9502
|
};
|
9503
9503
|
createScope.scopeName = baseScope.scopeName;
|
@@ -9516,47 +9516,47 @@
|
|
9516
9516
|
return (node) => refs.forEach((ref) => setRef$1(ref, node));
|
9517
9517
|
}
|
9518
9518
|
function useComposedRefs$1(...refs) {
|
9519
|
-
return
|
9519
|
+
return React__namespace.useCallback(composeRefs$1(...refs), refs);
|
9520
9520
|
}
|
9521
9521
|
|
9522
9522
|
// packages/react/slot/src/Slot.tsx
|
9523
|
-
var Slot$1 =
|
9523
|
+
var Slot$1 = React__namespace.forwardRef((props, forwardedRef) => {
|
9524
9524
|
const { children, ...slotProps } = props;
|
9525
|
-
const childrenArray =
|
9525
|
+
const childrenArray = React__namespace.Children.toArray(children);
|
9526
9526
|
const slottable = childrenArray.find(isSlottable$1);
|
9527
9527
|
if (slottable) {
|
9528
9528
|
const newElement = slottable.props.children;
|
9529
9529
|
const newChildren = childrenArray.map((child) => {
|
9530
9530
|
if (child === slottable) {
|
9531
|
-
if (
|
9532
|
-
return
|
9531
|
+
if (React__namespace.Children.count(newElement) > 1) return React__namespace.Children.only(null);
|
9532
|
+
return React__namespace.isValidElement(newElement) ? newElement.props.children : null;
|
9533
9533
|
} else {
|
9534
9534
|
return child;
|
9535
9535
|
}
|
9536
9536
|
});
|
9537
|
-
return /* @__PURE__ */ jsxRuntime.jsx(SlotClone$1, { ...slotProps, ref: forwardedRef, children:
|
9537
|
+
return /* @__PURE__ */ jsxRuntime.jsx(SlotClone$1, { ...slotProps, ref: forwardedRef, children: React__namespace.isValidElement(newElement) ? React__namespace.cloneElement(newElement, void 0, newChildren) : null });
|
9538
9538
|
}
|
9539
9539
|
return /* @__PURE__ */ jsxRuntime.jsx(SlotClone$1, { ...slotProps, ref: forwardedRef, children });
|
9540
9540
|
});
|
9541
9541
|
Slot$1.displayName = "Slot";
|
9542
|
-
var SlotClone$1 =
|
9542
|
+
var SlotClone$1 = React__namespace.forwardRef((props, forwardedRef) => {
|
9543
9543
|
const { children, ...slotProps } = props;
|
9544
|
-
if (
|
9544
|
+
if (React__namespace.isValidElement(children)) {
|
9545
9545
|
const childrenRef = getElementRef$2(children);
|
9546
|
-
return
|
9546
|
+
return React__namespace.cloneElement(children, {
|
9547
9547
|
...mergeProps$1(slotProps, children.props),
|
9548
9548
|
// @ts-ignore
|
9549
9549
|
ref: forwardedRef ? composeRefs$1(forwardedRef, childrenRef) : childrenRef
|
9550
9550
|
});
|
9551
9551
|
}
|
9552
|
-
return
|
9552
|
+
return React__namespace.Children.count(children) > 1 ? React__namespace.Children.only(null) : null;
|
9553
9553
|
});
|
9554
9554
|
SlotClone$1.displayName = "SlotClone";
|
9555
9555
|
var Slottable$1 = ({ children }) => {
|
9556
9556
|
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children });
|
9557
9557
|
};
|
9558
9558
|
function isSlottable$1(child) {
|
9559
|
-
return
|
9559
|
+
return React__namespace.isValidElement(child) && child.type === Slottable$1;
|
9560
9560
|
}
|
9561
9561
|
function mergeProps$1(slotProps, childProps) {
|
9562
9562
|
const overrideProps = { ...childProps };
|
@@ -9604,13 +9604,13 @@
|
|
9604
9604
|
);
|
9605
9605
|
const CollectionProvider = (props) => {
|
9606
9606
|
const { scope, children } = props;
|
9607
|
-
const ref =
|
9608
|
-
const itemMap =
|
9607
|
+
const ref = React.useRef(null);
|
9608
|
+
const itemMap = React.useRef(/* @__PURE__ */ new Map()).current;
|
9609
9609
|
return /* @__PURE__ */ jsxRuntime.jsx(CollectionProviderImpl, { scope, itemMap, collectionRef: ref, children });
|
9610
9610
|
};
|
9611
9611
|
CollectionProvider.displayName = PROVIDER_NAME;
|
9612
9612
|
const COLLECTION_SLOT_NAME = name + "CollectionSlot";
|
9613
|
-
const CollectionSlot =
|
9613
|
+
const CollectionSlot = React.forwardRef(
|
9614
9614
|
(props, forwardedRef) => {
|
9615
9615
|
const { scope, children } = props;
|
9616
9616
|
const context = useCollectionContext(COLLECTION_SLOT_NAME, scope);
|
@@ -9621,13 +9621,13 @@
|
|
9621
9621
|
CollectionSlot.displayName = COLLECTION_SLOT_NAME;
|
9622
9622
|
const ITEM_SLOT_NAME = name + "CollectionItemSlot";
|
9623
9623
|
const ITEM_DATA_ATTR = "data-radix-collection-item";
|
9624
|
-
const CollectionItemSlot =
|
9624
|
+
const CollectionItemSlot = React.forwardRef(
|
9625
9625
|
(props, forwardedRef) => {
|
9626
9626
|
const { scope, children, ...itemData } = props;
|
9627
|
-
const ref =
|
9627
|
+
const ref = React.useRef(null);
|
9628
9628
|
const composedRefs = useComposedRefs$1(forwardedRef, ref);
|
9629
9629
|
const context = useCollectionContext(ITEM_SLOT_NAME, scope);
|
9630
|
-
|
9630
|
+
React.useEffect(() => {
|
9631
9631
|
context.itemMap.set(ref, { ref, ...itemData });
|
9632
9632
|
return () => void context.itemMap.delete(ref);
|
9633
9633
|
});
|
@@ -9637,7 +9637,7 @@
|
|
9637
9637
|
CollectionItemSlot.displayName = ITEM_SLOT_NAME;
|
9638
9638
|
function useCollection(scope) {
|
9639
9639
|
const context = useCollectionContext(name + "CollectionConsumer", scope);
|
9640
|
-
const getItems =
|
9640
|
+
const getItems = React.useCallback(() => {
|
9641
9641
|
const collectionNode = context.collectionRef.current;
|
9642
9642
|
if (!collectionNode) return [];
|
9643
9643
|
const orderedNodes = Array.from(collectionNode.querySelectorAll(`[${ITEM_DATA_ATTR}]`));
|
@@ -9668,11 +9668,11 @@
|
|
9668
9668
|
|
9669
9669
|
// packages/react/use-callback-ref/src/useCallbackRef.tsx
|
9670
9670
|
function useCallbackRef$1(callback) {
|
9671
|
-
const callbackRef =
|
9672
|
-
|
9671
|
+
const callbackRef = React__namespace.useRef(callback);
|
9672
|
+
React__namespace.useEffect(() => {
|
9673
9673
|
callbackRef.current = callback;
|
9674
9674
|
});
|
9675
|
-
return
|
9675
|
+
return React__namespace.useMemo(() => (...args) => callbackRef.current?.(...args), []);
|
9676
9676
|
}
|
9677
9677
|
|
9678
9678
|
// packages/react/use-controllable-state/src/useControllableState.tsx
|
@@ -9686,7 +9686,7 @@
|
|
9686
9686
|
const isControlled = prop !== void 0;
|
9687
9687
|
const value = isControlled ? prop : uncontrolledProp;
|
9688
9688
|
const handleChange = useCallbackRef$1(onChange);
|
9689
|
-
const setValue =
|
9689
|
+
const setValue = React__namespace.useCallback(
|
9690
9690
|
(nextValue) => {
|
9691
9691
|
if (isControlled) {
|
9692
9692
|
const setter = nextValue;
|
@@ -9704,11 +9704,11 @@
|
|
9704
9704
|
defaultProp,
|
9705
9705
|
onChange
|
9706
9706
|
}) {
|
9707
|
-
const uncontrolledState =
|
9707
|
+
const uncontrolledState = React__namespace.useState(defaultProp);
|
9708
9708
|
const [value] = uncontrolledState;
|
9709
|
-
const prevValueRef =
|
9709
|
+
const prevValueRef = React__namespace.useRef(value);
|
9710
9710
|
const handleChange = useCallbackRef$1(onChange);
|
9711
|
-
|
9711
|
+
React__namespace.useEffect(() => {
|
9712
9712
|
if (prevValueRef.current !== value) {
|
9713
9713
|
handleChange(value);
|
9714
9714
|
prevValueRef.current = value;
|
@@ -9737,7 +9737,7 @@
|
|
9737
9737
|
"ul"
|
9738
9738
|
];
|
9739
9739
|
var Primitive$1 = NODES$1.reduce((primitive, node) => {
|
9740
|
-
const Node =
|
9740
|
+
const Node = React__namespace.forwardRef((props, forwardedRef) => {
|
9741
9741
|
const { asChild, ...primitiveProps } = props;
|
9742
9742
|
const Comp = asChild ? Slot$1 : node;
|
9743
9743
|
if (typeof window !== "undefined") {
|
@@ -9763,19 +9763,19 @@
|
|
9763
9763
|
function createContextScope(scopeName, createContextScopeDeps = []) {
|
9764
9764
|
let defaultContexts = [];
|
9765
9765
|
function createContext3(rootComponentName, defaultContext) {
|
9766
|
-
const BaseContext =
|
9766
|
+
const BaseContext = React__namespace.createContext(defaultContext);
|
9767
9767
|
const index = defaultContexts.length;
|
9768
9768
|
defaultContexts = [...defaultContexts, defaultContext];
|
9769
9769
|
const Provider = (props) => {
|
9770
9770
|
const { scope, children, ...context } = props;
|
9771
9771
|
const Context = scope?.[scopeName]?.[index] || BaseContext;
|
9772
|
-
const value =
|
9772
|
+
const value = React__namespace.useMemo(() => context, Object.values(context));
|
9773
9773
|
return /* @__PURE__ */ jsxRuntime.jsx(Context.Provider, { value, children });
|
9774
9774
|
};
|
9775
9775
|
Provider.displayName = rootComponentName + "Provider";
|
9776
9776
|
function useContext2(consumerName, scope) {
|
9777
9777
|
const Context = scope?.[scopeName]?.[index] || BaseContext;
|
9778
|
-
const context =
|
9778
|
+
const context = React__namespace.useContext(Context);
|
9779
9779
|
if (context) return context;
|
9780
9780
|
if (defaultContext !== void 0) return defaultContext;
|
9781
9781
|
throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
|
@@ -9784,11 +9784,11 @@
|
|
9784
9784
|
}
|
9785
9785
|
const createScope = () => {
|
9786
9786
|
const scopeContexts = defaultContexts.map((defaultContext) => {
|
9787
|
-
return
|
9787
|
+
return React__namespace.createContext(defaultContext);
|
9788
9788
|
});
|
9789
9789
|
return function useScope(scope) {
|
9790
9790
|
const contexts = scope?.[scopeName] || scopeContexts;
|
9791
|
-
return
|
9791
|
+
return React__namespace.useMemo(
|
9792
9792
|
() => ({ [`__scope${scopeName}`]: { ...scope, [scopeName]: contexts } }),
|
9793
9793
|
[scope, contexts]
|
9794
9794
|
);
|
@@ -9811,7 +9811,7 @@
|
|
9811
9811
|
const currentScope = scopeProps[`__scope${scopeName}`];
|
9812
9812
|
return { ...nextScopes2, ...currentScope };
|
9813
9813
|
}, {});
|
9814
|
-
return
|
9814
|
+
return React__namespace.useMemo(() => ({ [`__scope${baseScope.scopeName}`]: nextScopes }), [nextScopes]);
|
9815
9815
|
};
|
9816
9816
|
};
|
9817
9817
|
createScope.scopeName = baseScope.scopeName;
|
@@ -9820,11 +9820,11 @@
|
|
9820
9820
|
|
9821
9821
|
// packages/react/use-callback-ref/src/useCallbackRef.tsx
|
9822
9822
|
function useCallbackRef(callback) {
|
9823
|
-
const callbackRef =
|
9824
|
-
|
9823
|
+
const callbackRef = React__namespace.useRef(callback);
|
9824
|
+
React__namespace.useEffect(() => {
|
9825
9825
|
callbackRef.current = callback;
|
9826
9826
|
});
|
9827
|
-
return
|
9827
|
+
return React__namespace.useMemo(() => (...args) => callbackRef.current?.(...args), []);
|
9828
9828
|
}
|
9829
9829
|
|
9830
9830
|
// packages/react/use-controllable-state/src/useControllableState.tsx
|
@@ -9838,7 +9838,7 @@
|
|
9838
9838
|
const isControlled = prop !== void 0;
|
9839
9839
|
const value = isControlled ? prop : uncontrolledProp;
|
9840
9840
|
const handleChange = useCallbackRef(onChange);
|
9841
|
-
const setValue =
|
9841
|
+
const setValue = React__namespace.useCallback(
|
9842
9842
|
(nextValue) => {
|
9843
9843
|
if (isControlled) {
|
9844
9844
|
const setter = nextValue;
|
@@ -9856,11 +9856,11 @@
|
|
9856
9856
|
defaultProp,
|
9857
9857
|
onChange
|
9858
9858
|
}) {
|
9859
|
-
const uncontrolledState =
|
9859
|
+
const uncontrolledState = React__namespace.useState(defaultProp);
|
9860
9860
|
const [value] = uncontrolledState;
|
9861
|
-
const prevValueRef =
|
9861
|
+
const prevValueRef = React__namespace.useRef(value);
|
9862
9862
|
const handleChange = useCallbackRef(onChange);
|
9863
|
-
|
9863
|
+
React__namespace.useEffect(() => {
|
9864
9864
|
if (prevValueRef.current !== value) {
|
9865
9865
|
handleChange(value);
|
9866
9866
|
prevValueRef.current = value;
|
@@ -9870,7 +9870,7 @@
|
|
9870
9870
|
}
|
9871
9871
|
|
9872
9872
|
// packages/react/use-layout-effect/src/useLayoutEffect.tsx
|
9873
|
-
var useLayoutEffect2$1 = Boolean(globalThis?.document) ?
|
9873
|
+
var useLayoutEffect2$1 = Boolean(globalThis?.document) ? React__namespace.useLayoutEffect : () => {
|
9874
9874
|
};
|
9875
9875
|
|
9876
9876
|
// packages/react/compose-refs/src/composeRefs.tsx
|
@@ -9885,47 +9885,47 @@
|
|
9885
9885
|
return (node) => refs.forEach((ref) => setRef(ref, node));
|
9886
9886
|
}
|
9887
9887
|
function useComposedRefs(...refs) {
|
9888
|
-
return
|
9888
|
+
return React__namespace.useCallback(composeRefs(...refs), refs);
|
9889
9889
|
}
|
9890
9890
|
|
9891
9891
|
// packages/react/slot/src/Slot.tsx
|
9892
|
-
var Slot =
|
9892
|
+
var Slot = React__namespace.forwardRef((props, forwardedRef) => {
|
9893
9893
|
const { children, ...slotProps } = props;
|
9894
|
-
const childrenArray =
|
9894
|
+
const childrenArray = React__namespace.Children.toArray(children);
|
9895
9895
|
const slottable = childrenArray.find(isSlottable);
|
9896
9896
|
if (slottable) {
|
9897
9897
|
const newElement = slottable.props.children;
|
9898
9898
|
const newChildren = childrenArray.map((child) => {
|
9899
9899
|
if (child === slottable) {
|
9900
|
-
if (
|
9901
|
-
return
|
9900
|
+
if (React__namespace.Children.count(newElement) > 1) return React__namespace.Children.only(null);
|
9901
|
+
return React__namespace.isValidElement(newElement) ? newElement.props.children : null;
|
9902
9902
|
} else {
|
9903
9903
|
return child;
|
9904
9904
|
}
|
9905
9905
|
});
|
9906
|
-
return /* @__PURE__ */ jsxRuntime.jsx(SlotClone, { ...slotProps, ref: forwardedRef, children:
|
9906
|
+
return /* @__PURE__ */ jsxRuntime.jsx(SlotClone, { ...slotProps, ref: forwardedRef, children: React__namespace.isValidElement(newElement) ? React__namespace.cloneElement(newElement, void 0, newChildren) : null });
|
9907
9907
|
}
|
9908
9908
|
return /* @__PURE__ */ jsxRuntime.jsx(SlotClone, { ...slotProps, ref: forwardedRef, children });
|
9909
9909
|
});
|
9910
9910
|
Slot.displayName = "Slot";
|
9911
|
-
var SlotClone =
|
9911
|
+
var SlotClone = React__namespace.forwardRef((props, forwardedRef) => {
|
9912
9912
|
const { children, ...slotProps } = props;
|
9913
|
-
if (
|
9913
|
+
if (React__namespace.isValidElement(children)) {
|
9914
9914
|
const childrenRef = getElementRef$1(children);
|
9915
|
-
return
|
9915
|
+
return React__namespace.cloneElement(children, {
|
9916
9916
|
...mergeProps(slotProps, children.props),
|
9917
9917
|
// @ts-ignore
|
9918
9918
|
ref: forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef
|
9919
9919
|
});
|
9920
9920
|
}
|
9921
|
-
return
|
9921
|
+
return React__namespace.Children.count(children) > 1 ? React__namespace.Children.only(null) : null;
|
9922
9922
|
});
|
9923
9923
|
SlotClone.displayName = "SlotClone";
|
9924
9924
|
var Slottable = ({ children }) => {
|
9925
9925
|
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children });
|
9926
9926
|
};
|
9927
9927
|
function isSlottable(child) {
|
9928
|
-
return
|
9928
|
+
return React__namespace.isValidElement(child) && child.type === Slottable;
|
9929
9929
|
}
|
9930
9930
|
function mergeProps(slotProps, childProps) {
|
9931
9931
|
const overrideProps = { ...childProps };
|
@@ -9984,7 +9984,7 @@
|
|
9984
9984
|
"ul"
|
9985
9985
|
];
|
9986
9986
|
var Primitive = NODES.reduce((primitive, node) => {
|
9987
|
-
const Node =
|
9987
|
+
const Node = React__namespace.forwardRef((props, forwardedRef) => {
|
9988
9988
|
const { asChild, ...primitiveProps } = props;
|
9989
9989
|
const Comp = asChild ? Slot : node;
|
9990
9990
|
if (typeof window !== "undefined") {
|
@@ -9997,7 +9997,7 @@
|
|
9997
9997
|
}, {});
|
9998
9998
|
|
9999
9999
|
function useStateMachine(initialState, machine) {
|
10000
|
-
return
|
10000
|
+
return React__namespace.useReducer((state, event) => {
|
10001
10001
|
const nextState = machine[state][event];
|
10002
10002
|
return nextState ?? state;
|
10003
10003
|
}, initialState);
|
@@ -10007,17 +10007,17 @@
|
|
10007
10007
|
var Presence = (props) => {
|
10008
10008
|
const { present, children } = props;
|
10009
10009
|
const presence = usePresence(present);
|
10010
|
-
const child = typeof children === "function" ? children({ present: presence.isPresent }) :
|
10010
|
+
const child = typeof children === "function" ? children({ present: presence.isPresent }) : React__namespace.Children.only(children);
|
10011
10011
|
const ref = useComposedRefs(presence.ref, getElementRef(child));
|
10012
10012
|
const forceMount = typeof children === "function";
|
10013
|
-
return forceMount || presence.isPresent ?
|
10013
|
+
return forceMount || presence.isPresent ? React__namespace.cloneElement(child, { ref }) : null;
|
10014
10014
|
};
|
10015
10015
|
Presence.displayName = "Presence";
|
10016
10016
|
function usePresence(present) {
|
10017
|
-
const [node, setNode] =
|
10018
|
-
const stylesRef =
|
10019
|
-
const prevPresentRef =
|
10020
|
-
const prevAnimationNameRef =
|
10017
|
+
const [node, setNode] = React__namespace.useState();
|
10018
|
+
const stylesRef = React__namespace.useRef({});
|
10019
|
+
const prevPresentRef = React__namespace.useRef(present);
|
10020
|
+
const prevAnimationNameRef = React__namespace.useRef("none");
|
10021
10021
|
const initialState = present ? "mounted" : "unmounted";
|
10022
10022
|
const [state, send] = useStateMachine(initialState, {
|
10023
10023
|
mounted: {
|
@@ -10032,7 +10032,7 @@
|
|
10032
10032
|
MOUNT: "mounted"
|
10033
10033
|
}
|
10034
10034
|
});
|
10035
|
-
|
10035
|
+
React__namespace.useEffect(() => {
|
10036
10036
|
const currentAnimationName = getAnimationName(stylesRef.current);
|
10037
10037
|
prevAnimationNameRef.current = state === "mounted" ? currentAnimationName : "none";
|
10038
10038
|
}, [state]);
|
@@ -10098,7 +10098,7 @@
|
|
10098
10098
|
}, [node, send]);
|
10099
10099
|
return {
|
10100
10100
|
isPresent: ["mounted", "unmountSuspended"].includes(state),
|
10101
|
-
ref:
|
10101
|
+
ref: React__namespace.useCallback((node2) => {
|
10102
10102
|
if (node2) stylesRef.current = getComputedStyle(node2);
|
10103
10103
|
setNode(node2);
|
10104
10104
|
}, [])
|
@@ -10122,10 +10122,10 @@
|
|
10122
10122
|
}
|
10123
10123
|
|
10124
10124
|
// packages/react/id/src/id.tsx
|
10125
|
-
var useReactId$1 =
|
10125
|
+
var useReactId$1 = React__namespace["useId".toString()] || (() => void 0);
|
10126
10126
|
var count$1 = 0;
|
10127
10127
|
function useId$1(deterministicId) {
|
10128
|
-
const [id, setId] =
|
10128
|
+
const [id, setId] = React__namespace.useState(useReactId$1());
|
10129
10129
|
useLayoutEffect2$1(() => {
|
10130
10130
|
setId((reactId) => reactId ?? String(count$1++));
|
10131
10131
|
}, [deterministicId]);
|
@@ -10135,7 +10135,7 @@
|
|
10135
10135
|
var COLLAPSIBLE_NAME = "Collapsible";
|
10136
10136
|
var [createCollapsibleContext, createCollapsibleScope] = createContextScope(COLLAPSIBLE_NAME);
|
10137
10137
|
var [CollapsibleProvider, useCollapsibleContext] = createCollapsibleContext(COLLAPSIBLE_NAME);
|
10138
|
-
var Collapsible =
|
10138
|
+
var Collapsible = React__namespace.forwardRef(
|
10139
10139
|
(props, forwardedRef) => {
|
10140
10140
|
const {
|
10141
10141
|
__scopeCollapsible,
|
@@ -10157,7 +10157,7 @@
|
|
10157
10157
|
disabled,
|
10158
10158
|
contentId: useId$1(),
|
10159
10159
|
open,
|
10160
|
-
onOpenToggle:
|
10160
|
+
onOpenToggle: React__namespace.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]),
|
10161
10161
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
10162
10162
|
Primitive.div,
|
10163
10163
|
{
|
@@ -10173,7 +10173,7 @@
|
|
10173
10173
|
);
|
10174
10174
|
Collapsible.displayName = COLLAPSIBLE_NAME;
|
10175
10175
|
var TRIGGER_NAME$1 = "CollapsibleTrigger";
|
10176
|
-
var CollapsibleTrigger =
|
10176
|
+
var CollapsibleTrigger = React__namespace.forwardRef(
|
10177
10177
|
(props, forwardedRef) => {
|
10178
10178
|
const { __scopeCollapsible, ...triggerProps } = props;
|
10179
10179
|
const context = useCollapsibleContext(TRIGGER_NAME$1, __scopeCollapsible);
|
@@ -10195,7 +10195,7 @@
|
|
10195
10195
|
);
|
10196
10196
|
CollapsibleTrigger.displayName = TRIGGER_NAME$1;
|
10197
10197
|
var CONTENT_NAME$1 = "CollapsibleContent";
|
10198
|
-
var CollapsibleContent =
|
10198
|
+
var CollapsibleContent = React__namespace.forwardRef(
|
10199
10199
|
(props, forwardedRef) => {
|
10200
10200
|
const { forceMount, ...contentProps } = props;
|
10201
10201
|
const context = useCollapsibleContext(CONTENT_NAME$1, props.__scopeCollapsible);
|
@@ -10203,20 +10203,20 @@
|
|
10203
10203
|
}
|
10204
10204
|
);
|
10205
10205
|
CollapsibleContent.displayName = CONTENT_NAME$1;
|
10206
|
-
var CollapsibleContentImpl =
|
10206
|
+
var CollapsibleContentImpl = React__namespace.forwardRef((props, forwardedRef) => {
|
10207
10207
|
const { __scopeCollapsible, present, children, ...contentProps } = props;
|
10208
10208
|
const context = useCollapsibleContext(CONTENT_NAME$1, __scopeCollapsible);
|
10209
|
-
const [isPresent, setIsPresent] =
|
10210
|
-
const ref =
|
10209
|
+
const [isPresent, setIsPresent] = React__namespace.useState(present);
|
10210
|
+
const ref = React__namespace.useRef(null);
|
10211
10211
|
const composedRefs = useComposedRefs(forwardedRef, ref);
|
10212
|
-
const heightRef =
|
10212
|
+
const heightRef = React__namespace.useRef(0);
|
10213
10213
|
const height = heightRef.current;
|
10214
|
-
const widthRef =
|
10214
|
+
const widthRef = React__namespace.useRef(0);
|
10215
10215
|
const width = widthRef.current;
|
10216
10216
|
const isOpen = context.open || isPresent;
|
10217
|
-
const isMountAnimationPreventedRef =
|
10218
|
-
const originalStylesRef =
|
10219
|
-
|
10217
|
+
const isMountAnimationPreventedRef = React__namespace.useRef(isOpen);
|
10218
|
+
const originalStylesRef = React__namespace.useRef();
|
10219
|
+
React__namespace.useEffect(() => {
|
10220
10220
|
const rAF = requestAnimationFrame(() => isMountAnimationPreventedRef.current = false);
|
10221
10221
|
return () => cancelAnimationFrame(rAF);
|
10222
10222
|
}, []);
|
@@ -10265,14 +10265,14 @@
|
|
10265
10265
|
var Content = CollapsibleContent;
|
10266
10266
|
|
10267
10267
|
// packages/react/use-layout-effect/src/useLayoutEffect.tsx
|
10268
|
-
var useLayoutEffect2 = Boolean(globalThis?.document) ?
|
10268
|
+
var useLayoutEffect2 = Boolean(globalThis?.document) ? React__namespace.useLayoutEffect : () => {
|
10269
10269
|
};
|
10270
10270
|
|
10271
10271
|
// packages/react/id/src/id.tsx
|
10272
|
-
var useReactId =
|
10272
|
+
var useReactId = React__namespace["useId".toString()] || (() => void 0);
|
10273
10273
|
var count = 0;
|
10274
10274
|
function useId(deterministicId) {
|
10275
|
-
const [id, setId] =
|
10275
|
+
const [id, setId] = React__namespace.useState(useReactId());
|
10276
10276
|
useLayoutEffect2(() => {
|
10277
10277
|
setId((reactId) => reactId ?? String(count++));
|
10278
10278
|
}, [deterministicId]);
|
@@ -10280,9 +10280,9 @@
|
|
10280
10280
|
}
|
10281
10281
|
|
10282
10282
|
// packages/react/direction/src/Direction.tsx
|
10283
|
-
var DirectionContext =
|
10283
|
+
var DirectionContext = React__namespace.createContext(void 0);
|
10284
10284
|
function useDirection(localDir) {
|
10285
|
-
const globalDir =
|
10285
|
+
const globalDir = React__namespace.useContext(DirectionContext);
|
10286
10286
|
return localDir || globalDir || "ltr";
|
10287
10287
|
}
|
10288
10288
|
|
@@ -10294,7 +10294,7 @@
|
|
10294
10294
|
createCollapsibleScope
|
10295
10295
|
]);
|
10296
10296
|
var useCollapsibleScope = createCollapsibleScope();
|
10297
|
-
var Accordion$1 =
|
10297
|
+
var Accordion$1 = React.forwardRef(
|
10298
10298
|
(props, forwardedRef) => {
|
10299
10299
|
const { type, ...accordionProps } = props;
|
10300
10300
|
const singleProps = accordionProps;
|
@@ -10308,7 +10308,7 @@
|
|
10308
10308
|
ACCORDION_NAME,
|
10309
10309
|
{ collapsible: false }
|
10310
10310
|
);
|
10311
|
-
var AccordionImplSingle =
|
10311
|
+
var AccordionImplSingle = React.forwardRef(
|
10312
10312
|
(props, forwardedRef) => {
|
10313
10313
|
const {
|
10314
10314
|
value: valueProp,
|
@@ -10329,13 +10329,13 @@
|
|
10329
10329
|
scope: props.__scopeAccordion,
|
10330
10330
|
value: value ? [value] : [],
|
10331
10331
|
onItemOpen: setValue,
|
10332
|
-
onItemClose:
|
10332
|
+
onItemClose: React.useCallback(() => collapsible && setValue(""), [collapsible, setValue]),
|
10333
10333
|
children: /* @__PURE__ */ jsxRuntime.jsx(AccordionCollapsibleProvider, { scope: props.__scopeAccordion, collapsible, children: /* @__PURE__ */ jsxRuntime.jsx(AccordionImpl, { ...accordionSingleProps, ref: forwardedRef }) })
|
10334
10334
|
}
|
10335
10335
|
);
|
10336
10336
|
}
|
10337
10337
|
);
|
10338
|
-
var AccordionImplMultiple =
|
10338
|
+
var AccordionImplMultiple = React.forwardRef((props, forwardedRef) => {
|
10339
10339
|
const {
|
10340
10340
|
value: valueProp,
|
10341
10341
|
defaultValue,
|
@@ -10348,11 +10348,11 @@
|
|
10348
10348
|
defaultProp: defaultValue,
|
10349
10349
|
onChange: onValueChange
|
10350
10350
|
});
|
10351
|
-
const handleItemOpen =
|
10351
|
+
const handleItemOpen = React.useCallback(
|
10352
10352
|
(itemValue) => setValue((prevValue = []) => [...prevValue, itemValue]),
|
10353
10353
|
[setValue]
|
10354
10354
|
);
|
10355
|
-
const handleItemClose =
|
10355
|
+
const handleItemClose = React.useCallback(
|
10356
10356
|
(itemValue) => setValue((prevValue = []) => prevValue.filter((value2) => value2 !== itemValue)),
|
10357
10357
|
[setValue]
|
10358
10358
|
);
|
@@ -10368,10 +10368,10 @@
|
|
10368
10368
|
);
|
10369
10369
|
});
|
10370
10370
|
var [AccordionImplProvider, useAccordionContext] = createAccordionContext(ACCORDION_NAME);
|
10371
|
-
var AccordionImpl =
|
10371
|
+
var AccordionImpl = React.forwardRef(
|
10372
10372
|
(props, forwardedRef) => {
|
10373
10373
|
const { __scopeAccordion, disabled, dir, orientation = "vertical", ...accordionProps } = props;
|
10374
|
-
const accordionRef =
|
10374
|
+
const accordionRef = React.useRef(null);
|
10375
10375
|
const composedRefs = useComposedRefs$1(accordionRef, forwardedRef);
|
10376
10376
|
const getItems = useCollection(__scopeAccordion);
|
10377
10377
|
const direction = useDirection(dir);
|
@@ -10460,7 +10460,7 @@
|
|
10460
10460
|
);
|
10461
10461
|
var ITEM_NAME = "AccordionItem";
|
10462
10462
|
var [AccordionItemProvider, useAccordionItemContext] = createAccordionContext(ITEM_NAME);
|
10463
|
-
var AccordionItem =
|
10463
|
+
var AccordionItem = React.forwardRef(
|
10464
10464
|
(props, forwardedRef) => {
|
10465
10465
|
const { __scopeAccordion, value, ...accordionItemProps } = props;
|
10466
10466
|
const accordionContext = useAccordionContext(ITEM_NAME, __scopeAccordion);
|
@@ -10501,7 +10501,7 @@
|
|
10501
10501
|
);
|
10502
10502
|
AccordionItem.displayName = ITEM_NAME;
|
10503
10503
|
var HEADER_NAME = "AccordionHeader";
|
10504
|
-
var AccordionHeader =
|
10504
|
+
var AccordionHeader = React.forwardRef(
|
10505
10505
|
(props, forwardedRef) => {
|
10506
10506
|
const { __scopeAccordion, ...headerProps } = props;
|
10507
10507
|
const accordionContext = useAccordionContext(ACCORDION_NAME, __scopeAccordion);
|
@@ -10520,7 +10520,7 @@
|
|
10520
10520
|
);
|
10521
10521
|
AccordionHeader.displayName = HEADER_NAME;
|
10522
10522
|
var TRIGGER_NAME = "AccordionTrigger";
|
10523
|
-
var AccordionTrigger =
|
10523
|
+
var AccordionTrigger = React.forwardRef(
|
10524
10524
|
(props, forwardedRef) => {
|
10525
10525
|
const { __scopeAccordion, ...triggerProps } = props;
|
10526
10526
|
const accordionContext = useAccordionContext(ACCORDION_NAME, __scopeAccordion);
|
@@ -10542,7 +10542,7 @@
|
|
10542
10542
|
);
|
10543
10543
|
AccordionTrigger.displayName = TRIGGER_NAME;
|
10544
10544
|
var CONTENT_NAME = "AccordionContent";
|
10545
|
-
var AccordionContent =
|
10545
|
+
var AccordionContent = React.forwardRef(
|
10546
10546
|
(props, forwardedRef) => {
|
10547
10547
|
const { __scopeAccordion, ...contentProps } = props;
|
10548
10548
|
const accordionContext = useAccordionContext(ACCORDION_NAME, __scopeAccordion);
|
@@ -10571,7 +10571,7 @@
|
|
10571
10571
|
return open ? "open" : "closed";
|
10572
10572
|
}
|
10573
10573
|
|
10574
|
-
|
10574
|
+
React.createContext(null);
|
10575
10575
|
|
10576
10576
|
function bind(fn, thisArg) {
|
10577
10577
|
return function wrap() {
|
@@ -15807,7 +15807,7 @@
|
|
15807
15807
|
var BooleanInput = function (_a) {
|
15808
15808
|
var field = _a.field, onChange = _a.onChange, value = _a.value;
|
15809
15809
|
var initialValue = value !== undefined ? value : false;
|
15810
|
-
return
|
15810
|
+
return React.createElement(Checkbox, { id: field.id, testId: field.id, label: React.createElement(FieldLabelText, __assign$1({}, field)), value: Boolean(initialValue), onChange: function (e) {
|
15811
15811
|
onChange(e);
|
15812
15812
|
} });
|
15813
15813
|
};
|
@@ -15818,8 +15818,8 @@
|
|
15818
15818
|
var getValue = function () {
|
15819
15819
|
return initialValue !== undefined && initialValue !== null ? String(initialValue) : '';
|
15820
15820
|
};
|
15821
|
-
return
|
15822
|
-
|
15821
|
+
return React.createElement("div", null,
|
15822
|
+
React.createElement(TextArea, { id: field.id, testId: field.id, label: React.createElement(FieldLabel, __assign$1({}, field)), value: getValue(), onChange: function (e) {
|
15823
15823
|
onChange(e);
|
15824
15824
|
} }));
|
15825
15825
|
};
|
@@ -15827,8 +15827,8 @@
|
|
15827
15827
|
var StringInput = function (_a) {
|
15828
15828
|
var field = _a.field, onChange = _a.onChange, value = _a.value;
|
15829
15829
|
var initialValue = value !== undefined ? value : '';
|
15830
|
-
return
|
15831
|
-
|
15830
|
+
return React.createElement("div", null,
|
15831
|
+
React.createElement(Input, { id: field.id, testId: field.id, value: initialValue !== undefined && initialValue !== null ? String(initialValue) : '', label: React.createElement(FieldLabel, __assign$1({}, field)), onChange: function (e) {
|
15832
15832
|
onChange(e);
|
15833
15833
|
} }));
|
15834
15834
|
};
|
@@ -15839,18 +15839,18 @@
|
|
15839
15839
|
if (field.type === 'object' && field.fields !== undefined) {
|
15840
15840
|
var cl = "".concat(field.layout === 'horizontal' ? "flex flex-row gap-4 ".concat(field.label !== undefined ? 'px-0' : '') : 'flex flex-col gap-4');
|
15841
15841
|
var fc_1 = field.layout === 'horizontal' ? 'flex-1' : '';
|
15842
|
-
return (
|
15842
|
+
return (React.createElement("div", null,
|
15843
15843
|
field.label !== undefined
|
15844
|
-
?
|
15844
|
+
? React.createElement(FieldLabel, __assign$1({}, field))
|
15845
15845
|
: null,
|
15846
|
-
|
15846
|
+
React.createElement("div", { className: "p-4 bg-slate-100 ".concat(cl) }, field.fields.map(function (childField) {
|
15847
15847
|
var _a;
|
15848
15848
|
var id = ((_a = field.path) !== null && _a !== void 0 ? _a : [field.id]).concat(childField.id).join('.');
|
15849
15849
|
if (childField.type === 'object') {
|
15850
15850
|
childField.path = field.path !== undefined ? field.path.concat(id) : [id];
|
15851
15851
|
childField.level = field.level !== undefined ? field.level + 1 : 1;
|
15852
15852
|
}
|
15853
|
-
return (
|
15853
|
+
return (React.createElement(FieldCreator, { formValueState: formValueState, onChange: field.skip_path === true
|
15854
15854
|
? undefined
|
15855
15855
|
: function (e) {
|
15856
15856
|
initialValue[childField.id] = e;
|
@@ -15861,7 +15861,7 @@
|
|
15861
15861
|
}), value: initialValue[childField.id], field: __assign$1(__assign$1({}, childField), { id: id }), form: form, key: id }));
|
15862
15862
|
}))));
|
15863
15863
|
}
|
15864
|
-
return
|
15864
|
+
return React.createElement("p", null,
|
15865
15865
|
"Field config for ",
|
15866
15866
|
field.id,
|
15867
15867
|
" is missing 'fields'");
|
@@ -15871,11 +15871,11 @@
|
|
15871
15871
|
var field = _a.field, onChange = _a.onChange, value = _a.value;
|
15872
15872
|
var initialValue = value !== undefined ? value : '';
|
15873
15873
|
if (field.type === 'radio' && field.options !== undefined) {
|
15874
|
-
return
|
15874
|
+
return React.createElement(RadixRadioGroup, { id: field.id, label: React.createElement(FieldLabel, __assign$1({}, field)), testId: field.id, options: field.options, value: initialValue !== undefined && initialValue !== null ? String(initialValue) : '', onChange: function (e) {
|
15875
15875
|
onChange(e === null || e === void 0 ? void 0 : e.value);
|
15876
15876
|
} });
|
15877
15877
|
}
|
15878
|
-
return
|
15878
|
+
return React.createElement("p", null,
|
15879
15879
|
"Field config for ",
|
15880
15880
|
field.id,
|
15881
15881
|
" is missing 'options'");
|
@@ -15885,11 +15885,11 @@
|
|
15885
15885
|
var field = _a.field, onChange = _a.onChange, value = _a.value;
|
15886
15886
|
var initialValue = value !== undefined ? value : '';
|
15887
15887
|
if (field.type === 'select' && field.options !== undefined) {
|
15888
|
-
return
|
15888
|
+
return React.createElement(Select, { id: field.id, label: React.createElement(FieldLabel, __assign$1({}, field)), testId: field.id, options: field.options, value: initialValue !== undefined && initialValue !== null ? String(initialValue) : '', onChange: function (e) {
|
15889
15889
|
onChange(e === null || e === void 0 ? void 0 : e.value);
|
15890
15890
|
} });
|
15891
15891
|
}
|
15892
|
-
return
|
15892
|
+
return React.createElement("p", null,
|
15893
15893
|
"Field config for ",
|
15894
15894
|
field.id,
|
15895
15895
|
" is missing 'options'");
|
@@ -15897,7 +15897,7 @@
|
|
15897
15897
|
|
15898
15898
|
var JSONStringInput = function (_a) {
|
15899
15899
|
var field = _a.field, onChange = _a.onChange, value = _a.value;
|
15900
|
-
var _b =
|
15900
|
+
var _b = React.useState(undefined), error = _b[0], setError = _b[1];
|
15901
15901
|
var initialValue = value !== undefined ? value : '';
|
15902
15902
|
var getValue = function () {
|
15903
15903
|
return initialValue !== undefined && initialValue !== null
|
@@ -15906,11 +15906,11 @@
|
|
15906
15906
|
: String(initialValue)
|
15907
15907
|
: '';
|
15908
15908
|
};
|
15909
|
-
return
|
15910
|
-
|
15909
|
+
return React.createElement("div", null,
|
15910
|
+
React.createElement(TextArea, { error: error, className: [
|
15911
15911
|
'min-h-[500px] bg-slate-50 rounded-lg shadow-inner'
|
15912
15912
|
// 'p-0 bg-[repeating-linear-gradient(to_bottom,var(--tw-gradient-stops))] from-[#efefef] from-[length:0_25px] to-[#FFF] to-[length:25px_50px]'
|
15913
|
-
].join(' '), id: field.id, testId: field.id, label:
|
15913
|
+
].join(' '), id: field.id, testId: field.id, label: React.createElement(FieldLabel, __assign$1({}, field)), value: getValue(), onChange: function (e) {
|
15914
15914
|
try {
|
15915
15915
|
JSON.parse(e !== null && e !== void 0 ? e : '');
|
15916
15916
|
onChange(JSON.parse(e !== null && e !== void 0 ? e : ''));
|
@@ -15925,8 +15925,8 @@
|
|
15925
15925
|
var NumberInput = function (_a) {
|
15926
15926
|
var field = _a.field, onChange = _a.onChange, value = _a.value;
|
15927
15927
|
var initialValue = value !== undefined ? value : '';
|
15928
|
-
return
|
15929
|
-
|
15928
|
+
return React.createElement("div", null,
|
15929
|
+
React.createElement(Input, { id: field.id, testId: field.id, value: initialValue !== undefined && initialValue !== null ? String(initialValue) : '', label: React.createElement(FieldLabel, __assign$1({}, field)), onChange: function (e) {
|
15930
15930
|
if (e !== undefined && !isNaN(+e)) {
|
15931
15931
|
onChange(+e);
|
15932
15932
|
}
|
@@ -15963,12 +15963,12 @@
|
|
15963
15963
|
}
|
15964
15964
|
|
15965
15965
|
var _excluded$T = ["color"];
|
15966
|
-
var CheckIcon = /*#__PURE__*/
|
15966
|
+
var CheckIcon = /*#__PURE__*/React.forwardRef(function (_ref, forwardedRef) {
|
15967
15967
|
var _ref$color = _ref.color,
|
15968
15968
|
color = _ref$color === void 0 ? 'currentColor' : _ref$color,
|
15969
15969
|
props = _objectWithoutPropertiesLoose(_ref, _excluded$T);
|
15970
15970
|
|
15971
|
-
return
|
15971
|
+
return React.createElement("svg", Object.assign({
|
15972
15972
|
width: "15",
|
15973
15973
|
height: "15",
|
15974
15974
|
viewBox: "0 0 15 15",
|
@@ -15976,7 +15976,7 @@
|
|
15976
15976
|
xmlns: "http://www.w3.org/2000/svg"
|
15977
15977
|
}, props, {
|
15978
15978
|
ref: forwardedRef
|
15979
|
-
}),
|
15979
|
+
}), React.createElement("path", {
|
15980
15980
|
d: "M11.4669 3.72684C11.7558 3.91574 11.8369 4.30308 11.648 4.59198L7.39799 11.092C7.29783 11.2452 7.13556 11.3467 6.95402 11.3699C6.77247 11.3931 6.58989 11.3355 6.45446 11.2124L3.70446 8.71241C3.44905 8.48022 3.43023 8.08494 3.66242 7.82953C3.89461 7.57412 4.28989 7.55529 4.5453 7.78749L6.75292 9.79441L10.6018 3.90792C10.7907 3.61902 11.178 3.53795 11.4669 3.72684Z",
|
15981
15981
|
fill: color,
|
15982
15982
|
fillRule: "evenodd",
|
@@ -15985,12 +15985,12 @@
|
|
15985
15985
|
});
|
15986
15986
|
|
15987
15987
|
var _excluded$1h = ["color"];
|
15988
|
-
var CopyIcon = /*#__PURE__*/
|
15988
|
+
var CopyIcon = /*#__PURE__*/React.forwardRef(function (_ref, forwardedRef) {
|
15989
15989
|
var _ref$color = _ref.color,
|
15990
15990
|
color = _ref$color === void 0 ? 'currentColor' : _ref$color,
|
15991
15991
|
props = _objectWithoutPropertiesLoose(_ref, _excluded$1h);
|
15992
15992
|
|
15993
|
-
return
|
15993
|
+
return React.createElement("svg", Object.assign({
|
15994
15994
|
width: "15",
|
15995
15995
|
height: "15",
|
15996
15996
|
viewBox: "0 0 15 15",
|
@@ -15998,7 +15998,7 @@
|
|
15998
15998
|
xmlns: "http://www.w3.org/2000/svg"
|
15999
15999
|
}, props, {
|
16000
16000
|
ref: forwardedRef
|
16001
|
-
}),
|
16001
|
+
}), React.createElement("path", {
|
16002
16002
|
d: "M1 9.50006C1 10.3285 1.67157 11.0001 2.5 11.0001H4L4 10.0001H2.5C2.22386 10.0001 2 9.7762 2 9.50006L2 2.50006C2 2.22392 2.22386 2.00006 2.5 2.00006L9.5 2.00006C9.77614 2.00006 10 2.22392 10 2.50006V4.00002H5.5C4.67158 4.00002 4 4.67159 4 5.50002V12.5C4 13.3284 4.67158 14 5.5 14H12.5C13.3284 14 14 13.3284 14 12.5V5.50002C14 4.67159 13.3284 4.00002 12.5 4.00002H11V2.50006C11 1.67163 10.3284 1.00006 9.5 1.00006H2.5C1.67157 1.00006 1 1.67163 1 2.50006V9.50006ZM5 5.50002C5 5.22388 5.22386 5.00002 5.5 5.00002H12.5C12.7761 5.00002 13 5.22388 13 5.50002V12.5C13 12.7762 12.7761 13 12.5 13H5.5C5.22386 13 5 12.7762 5 12.5V5.50002Z",
|
16003
16003
|
fill: color,
|
16004
16004
|
fillRule: "evenodd",
|
@@ -16007,12 +16007,12 @@
|
|
16007
16007
|
});
|
16008
16008
|
|
16009
16009
|
var _excluded$1q = ["color"];
|
16010
|
-
var Cross1Icon = /*#__PURE__*/
|
16010
|
+
var Cross1Icon = /*#__PURE__*/React.forwardRef(function (_ref, forwardedRef) {
|
16011
16011
|
var _ref$color = _ref.color,
|
16012
16012
|
color = _ref$color === void 0 ? 'currentColor' : _ref$color,
|
16013
16013
|
props = _objectWithoutPropertiesLoose(_ref, _excluded$1q);
|
16014
16014
|
|
16015
|
-
return
|
16015
|
+
return React.createElement("svg", Object.assign({
|
16016
16016
|
width: "15",
|
16017
16017
|
height: "15",
|
16018
16018
|
viewBox: "0 0 15 15",
|
@@ -16020,7 +16020,7 @@
|
|
16020
16020
|
xmlns: "http://www.w3.org/2000/svg"
|
16021
16021
|
}, props, {
|
16022
16022
|
ref: forwardedRef
|
16023
|
-
}),
|
16023
|
+
}), React.createElement("path", {
|
16024
16024
|
d: "M12.8536 2.85355C13.0488 2.65829 13.0488 2.34171 12.8536 2.14645C12.6583 1.95118 12.3417 1.95118 12.1464 2.14645L7.5 6.79289L2.85355 2.14645C2.65829 1.95118 2.34171 1.95118 2.14645 2.14645C1.95118 2.34171 1.95118 2.65829 2.14645 2.85355L6.79289 7.5L2.14645 12.1464C1.95118 12.3417 1.95118 12.6583 2.14645 12.8536C2.34171 13.0488 2.65829 13.0488 2.85355 12.8536L7.5 8.20711L12.1464 12.8536C12.3417 13.0488 12.6583 13.0488 12.8536 12.8536C13.0488 12.6583 13.0488 12.3417 12.8536 12.1464L8.20711 7.5L12.8536 2.85355Z",
|
16025
16025
|
fill: color,
|
16026
16026
|
fillRule: "evenodd",
|
@@ -16028,13 +16028,35 @@
|
|
16028
16028
|
}));
|
16029
16029
|
});
|
16030
16030
|
|
16031
|
+
var _excluded$20 = ["color"];
|
16032
|
+
var ExclamationTriangleIcon = /*#__PURE__*/React.forwardRef(function (_ref, forwardedRef) {
|
16033
|
+
var _ref$color = _ref.color,
|
16034
|
+
color = _ref$color === void 0 ? 'currentColor' : _ref$color,
|
16035
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$20);
|
16036
|
+
|
16037
|
+
return React.createElement("svg", Object.assign({
|
16038
|
+
width: "15",
|
16039
|
+
height: "15",
|
16040
|
+
viewBox: "0 0 15 15",
|
16041
|
+
fill: "none",
|
16042
|
+
xmlns: "http://www.w3.org/2000/svg"
|
16043
|
+
}, props, {
|
16044
|
+
ref: forwardedRef
|
16045
|
+
}), React.createElement("path", {
|
16046
|
+
d: "M8.4449 0.608765C8.0183 -0.107015 6.9817 -0.107015 6.55509 0.608766L0.161178 11.3368C-0.275824 12.07 0.252503 13 1.10608 13H13.8939C14.7475 13 15.2758 12.07 14.8388 11.3368L8.4449 0.608765ZM7.4141 1.12073C7.45288 1.05566 7.54712 1.05566 7.5859 1.12073L13.9798 11.8488C14.0196 11.9154 13.9715 12 13.8939 12H1.10608C1.02849 12 0.980454 11.9154 1.02018 11.8488L7.4141 1.12073ZM6.8269 4.48611C6.81221 4.10423 7.11783 3.78663 7.5 3.78663C7.88217 3.78663 8.18778 4.10423 8.1731 4.48612L8.01921 8.48701C8.00848 8.766 7.7792 8.98664 7.5 8.98664C7.2208 8.98664 6.99151 8.766 6.98078 8.48701L6.8269 4.48611ZM8.24989 10.476C8.24989 10.8902 7.9141 11.226 7.49989 11.226C7.08567 11.226 6.74989 10.8902 6.74989 10.476C6.74989 10.0618 7.08567 9.72599 7.49989 9.72599C7.9141 9.72599 8.24989 10.0618 8.24989 10.476Z",
|
16047
|
+
fill: color,
|
16048
|
+
fillRule: "evenodd",
|
16049
|
+
clipRule: "evenodd"
|
16050
|
+
}));
|
16051
|
+
});
|
16052
|
+
|
16031
16053
|
var _excluded$3x = ["color"];
|
16032
|
-
var PlusIcon = /*#__PURE__*/
|
16054
|
+
var PlusIcon = /*#__PURE__*/React.forwardRef(function (_ref, forwardedRef) {
|
16033
16055
|
var _ref$color = _ref.color,
|
16034
16056
|
color = _ref$color === void 0 ? 'currentColor' : _ref$color,
|
16035
16057
|
props = _objectWithoutPropertiesLoose(_ref, _excluded$3x);
|
16036
16058
|
|
16037
|
-
return
|
16059
|
+
return React.createElement("svg", Object.assign({
|
16038
16060
|
width: "15",
|
16039
16061
|
height: "15",
|
16040
16062
|
viewBox: "0 0 15 15",
|
@@ -16042,7 +16064,7 @@
|
|
16042
16064
|
xmlns: "http://www.w3.org/2000/svg"
|
16043
16065
|
}, props, {
|
16044
16066
|
ref: forwardedRef
|
16045
|
-
}),
|
16067
|
+
}), React.createElement("path", {
|
16046
16068
|
d: "M8 2.75C8 2.47386 7.77614 2.25 7.5 2.25C7.22386 2.25 7 2.47386 7 2.75V7H2.75C2.47386 7 2.25 7.22386 2.25 7.5C2.25 7.77614 2.47386 8 2.75 8H7V12.25C7 12.5261 7.22386 12.75 7.5 12.75C7.77614 12.75 8 12.5261 8 12.25V8H12.25C12.5261 8 12.75 7.77614 12.75 7.5C12.75 7.22386 12.5261 7 12.25 7H8V2.75Z",
|
16047
16069
|
fill: color,
|
16048
16070
|
fillRule: "evenodd",
|
@@ -16051,12 +16073,12 @@
|
|
16051
16073
|
});
|
16052
16074
|
|
16053
16075
|
var _excluded$4G = ["color"];
|
16054
|
-
var TrashIcon = /*#__PURE__*/
|
16076
|
+
var TrashIcon = /*#__PURE__*/React.forwardRef(function (_ref, forwardedRef) {
|
16055
16077
|
var _ref$color = _ref.color,
|
16056
16078
|
color = _ref$color === void 0 ? 'currentColor' : _ref$color,
|
16057
16079
|
props = _objectWithoutPropertiesLoose(_ref, _excluded$4G);
|
16058
16080
|
|
16059
|
-
return
|
16081
|
+
return React.createElement("svg", Object.assign({
|
16060
16082
|
width: "15",
|
16061
16083
|
height: "15",
|
16062
16084
|
viewBox: "0 0 15 15",
|
@@ -16064,7 +16086,7 @@
|
|
16064
16086
|
xmlns: "http://www.w3.org/2000/svg"
|
16065
16087
|
}, props, {
|
16066
16088
|
ref: forwardedRef
|
16067
|
-
}),
|
16089
|
+
}), React.createElement("path", {
|
16068
16090
|
d: "M5.5 1C5.22386 1 5 1.22386 5 1.5C5 1.77614 5.22386 2 5.5 2H9.5C9.77614 2 10 1.77614 10 1.5C10 1.22386 9.77614 1 9.5 1H5.5ZM3 3.5C3 3.22386 3.22386 3 3.5 3H5H10H11.5C11.7761 3 12 3.22386 12 3.5C12 3.77614 11.7761 4 11.5 4H11V12C11 12.5523 10.5523 13 10 13H5C4.44772 13 4 12.5523 4 12V4L3.5 4C3.22386 4 3 3.77614 3 3.5ZM5 4H10V12H5V4Z",
|
16069
16091
|
fill: color,
|
16070
16092
|
fillRule: "evenodd",
|
@@ -16075,25 +16097,25 @@
|
|
16075
16097
|
var toolButtonClass = 'border-white hover:border-single hover:border-1 hover:border-slate-400';
|
16076
16098
|
var DeleteMultiple = function (_a) {
|
16077
16099
|
var doDelete = _a.doDelete;
|
16078
|
-
var _b =
|
16079
|
-
return (
|
16080
|
-
?
|
16081
|
-
|
16100
|
+
var _b = React.useState(false), confirm = _b[0], setConfirm = _b[1];
|
16101
|
+
return (React.createElement(React.Fragment, null, confirm
|
16102
|
+
? React.createElement("p", { className: 'flex flex-row gap-2 text-sm' },
|
16103
|
+
React.createElement("span", { className: 'text-slate-600' }, "Deleting: "),
|
16082
16104
|
" Are you sure?",
|
16083
|
-
|
16105
|
+
React.createElement(Button, { size: 'xs', type: 'submit', onClick: function () {
|
16084
16106
|
doDelete();
|
16085
16107
|
setConfirm(false);
|
16086
16108
|
} },
|
16087
16109
|
"Yes ",
|
16088
|
-
|
16089
|
-
|
16110
|
+
React.createElement(CheckIcon, { className: 'inline ml-2' })),
|
16111
|
+
React.createElement(Button, { size: 'xs', type: 'alert', onClick: function () {
|
16090
16112
|
setConfirm(false);
|
16091
16113
|
} },
|
16092
16114
|
"Cancel ",
|
16093
|
-
|
16094
|
-
:
|
16115
|
+
React.createElement(Cross1Icon, { className: 'inline ml-2' })))
|
16116
|
+
: React.createElement(Button, { size: 'xs', className: toolButtonClass, onClick: function () { setConfirm(true); } },
|
16095
16117
|
"Delete ",
|
16096
|
-
|
16118
|
+
React.createElement(TrashIcon, { className: 'inline ml-2 fill-white' }))));
|
16097
16119
|
};
|
16098
16120
|
var OneOfMultiple = function (_a) {
|
16099
16121
|
var InputComponent = _a.InputComponent, field = _a.field, form = _a.form, value = _a.value, index = _a.index, onChange = _a.onChange, values = _a.values, formValueState = _a.formValueState;
|
@@ -16102,29 +16124,29 @@
|
|
16102
16124
|
newValues.splice(index + 1, 0, v);
|
16103
16125
|
onChange(newValues);
|
16104
16126
|
};
|
16105
|
-
return (
|
16106
|
-
|
16127
|
+
return (React.createElement("div", { className: 'flex flex-col gap-2' },
|
16128
|
+
React.createElement(InputComponent, { formValueState: formValueState, form: form, field: __assign$1(__assign$1({}, field), { required: false, label: index > 0 ? null : field.label, id: "".concat(field.id, "-").concat(index) }), value: value, onChange: function (v) {
|
16107
16129
|
var newValues = __spreadArray$1([], values, true);
|
16108
16130
|
newValues[index] = String(v);
|
16109
16131
|
onChange(newValues);
|
16110
16132
|
} }),
|
16111
|
-
|
16112
|
-
index > 0 && (
|
16133
|
+
React.createElement("div", { className: 'flex flex-row justify-between w-full p-2' },
|
16134
|
+
index > 0 && (React.createElement(DeleteMultiple, { doDelete: function () {
|
16113
16135
|
var newValues = __spreadArray$1([], values, true);
|
16114
16136
|
newValues.splice(index, 1);
|
16115
16137
|
onChange(newValues);
|
16116
16138
|
} })),
|
16117
|
-
|
16118
|
-
|
16139
|
+
React.createElement("div", { className: 'ml-auto flex gap-2' },
|
16140
|
+
React.createElement(Button, { size: 'xs', className: toolButtonClass, onClick: function () {
|
16119
16141
|
addValue(null);
|
16120
16142
|
} },
|
16121
16143
|
"Add ",
|
16122
|
-
|
16123
|
-
|
16144
|
+
React.createElement(PlusIcon, { className: 'inline ml-2' })),
|
16145
|
+
React.createElement(Button, { size: 'xs', className: toolButtonClass, onClick: function () {
|
16124
16146
|
addValue(structuredClone(value));
|
16125
16147
|
} },
|
16126
16148
|
"Duplicate ",
|
16127
|
-
|
16149
|
+
React.createElement(CopyIcon, { className: 'inline ml-2' }))))));
|
16128
16150
|
};
|
16129
16151
|
var MultipleFieldCreator = function (_a) {
|
16130
16152
|
var form = _a.form, field = _a.field, onChange = _a.onChange, value = _a.value, formValueState = _a.formValueState;
|
@@ -16144,8 +16166,8 @@
|
|
16144
16166
|
: [null]
|
16145
16167
|
) as IValueType[] */
|
16146
16168
|
var InputComponent = inputMap[field.type];
|
16147
|
-
return
|
16148
|
-
return
|
16169
|
+
return React.createElement("div", null, initialValues === null || initialValues === void 0 ? void 0 : initialValues.map(function (value, index) {
|
16170
|
+
return React.createElement(OneOfMultiple, { formValueState: formValueState, key: "".concat(field.id, "-").concat(index), InputComponent: InputComponent, form: form, field: field, value: value, index: index, onChange: onChange !== null && onChange !== void 0 ? onChange : defaultOnChange, values: initialValues });
|
16149
16171
|
}));
|
16150
16172
|
};
|
16151
16173
|
var FieldCreator = function (_a) {
|
@@ -16165,13 +16187,13 @@
|
|
16165
16187
|
};
|
16166
16188
|
var initialValue = value !== undefined ? value : getFieldValue(field, formValues);
|
16167
16189
|
return InputComponent !== undefined
|
16168
|
-
?
|
16190
|
+
? React.createElement("div", { className: index$1.makeClassName({
|
16169
16191
|
className: className,
|
16170
16192
|
defaultClassName: defaultClassName
|
16171
16193
|
}) }, field.multiple === true
|
16172
|
-
?
|
16173
|
-
:
|
16174
|
-
:
|
16194
|
+
? React.createElement(MultipleFieldCreator, { field: field, form: form, onChange: onChange, value: initialValue, formValueState: formValueState })
|
16195
|
+
: React.createElement(InputComponent, { field: field, form: form, onChange: onChange !== null && onChange !== void 0 ? onChange : defaultOnChange, value: Array.isArray(initialValue) ? initialValue[0] : initialValue, formValueState: formValueState }))
|
16196
|
+
: React.createElement("p", null,
|
16175
16197
|
"No component definition for ",
|
16176
16198
|
field.type,
|
16177
16199
|
" (",
|
@@ -16179,8 +16201,39 @@
|
|
16179
16201
|
")");
|
16180
16202
|
};
|
16181
16203
|
|
16204
|
+
var FormCreator = function (_a) {
|
16205
|
+
var form = _a.form, formValueState = _a.formValueState, note = _a.note, error = _a.error, onChange = _a.onChange;
|
16206
|
+
var _b = React.useState(null), activeForm = _b[0], setActiveForm = _b[1];
|
16207
|
+
React.useEffect(function () {
|
16208
|
+
var newForm = copyAndAddPathToFields(form);
|
16209
|
+
setActiveForm(newForm);
|
16210
|
+
}, [form]);
|
16211
|
+
if (activeForm === null) {
|
16212
|
+
return React.createElement("p", null, "Processing");
|
16213
|
+
}
|
16214
|
+
return (React.createElement(React.Fragment, null,
|
16215
|
+
React.createElement("div", null,
|
16216
|
+
React.createElement("h2", { className: 'text-2xl pb-4 font-bold' }, form.label),
|
16217
|
+
note !== undefined
|
16218
|
+
? React.createElement("p", { className: 'pb-4' }, note)
|
16219
|
+
: null,
|
16220
|
+
error !== undefined
|
16221
|
+
? React.createElement("p", { className: 'pb-4 text-rose-800' },
|
16222
|
+
React.createElement(ExclamationTriangleIcon, { className: 'inline mr-2' }),
|
16223
|
+
" ",
|
16224
|
+
error)
|
16225
|
+
: null,
|
16226
|
+
activeForm.description !== undefined
|
16227
|
+
? React.createElement("p", { className: 'pb-4' }, form.description)
|
16228
|
+
: null,
|
16229
|
+
React.createElement("div", { className: 'flex flex-col gap-2' }, activeForm.fields.map(function (field) {
|
16230
|
+
return (React.createElement(FieldCreator, { onChange: onChange, form: form, field: field, key: field.id, formValueState: formValueState }));
|
16231
|
+
})))));
|
16232
|
+
};
|
16233
|
+
|
16182
16234
|
exports.BooleanInput = BooleanInput;
|
16183
16235
|
exports.FieldCreator = FieldCreator;
|
16236
|
+
exports.FormCreator = FormCreator;
|
16184
16237
|
exports.JSONStringInput = JSONStringInput;
|
16185
16238
|
exports.LongTextInput = LongStringInput;
|
16186
16239
|
exports.NumberInput = NumberInput;
|