@process.co/ui 0.0.22 → 0.0.23
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/css/ui.css +48 -0
- package/dist/components/dev/index.cjs +213 -7
- package/dist/components/dev/index.cjs.map +1 -1
- package/dist/components/dev/index.d.cts +64 -3
- package/dist/components/dev/index.d.ts +64 -3
- package/dist/components/dev/index.js +214 -9
- package/dist/components/dev/index.js.map +1 -1
- package/dist/components/fields/index.cjs.map +1 -1
- package/dist/components/fields/index.js.map +1 -1
- package/dist/components/slots/index.cjs +73 -59
- package/dist/components/slots/index.cjs.map +1 -1
- package/dist/components/slots/index.d.cts +1 -1
- package/dist/components/slots/index.d.ts +1 -1
- package/dist/components/slots/index.js +73 -60
- package/dist/components/slots/index.js.map +1 -1
- package/dist/{index-NpNmoYuX.d.cts → index-D4Fc9AJv.d.cts} +15 -2
- package/dist/{index-NpNmoYuX.d.ts → index-D4Fc9AJv.d.ts} +15 -2
- package/dist/index.cjs +14 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +15 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { E as ExportManager, b as ExportManagerProps, e as SlotDelete, f as SlotDeleteProps, g as SlotDragHandle, h as SlotDragHandleProps, S as SlotElements, a as SlotElementsProps, c as SlotEnable, d as SlotEnableProps } from '../../index-
|
|
1
|
+
export { E as ExportManager, b as ExportManagerProps, e as SlotDelete, f as SlotDeleteProps, g as SlotDragHandle, h as SlotDragHandleProps, S as SlotElements, a as SlotElementsProps, c as SlotEnable, d as SlotEnableProps, u as useSlotContext } from '../../index-D4Fc9AJv.cjs';
|
|
2
2
|
import 'react';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { E as ExportManager, b as ExportManagerProps, e as SlotDelete, f as SlotDeleteProps, g as SlotDragHandle, h as SlotDragHandleProps, S as SlotElements, a as SlotElementsProps, c as SlotEnable, d as SlotEnableProps } from '../../index-
|
|
1
|
+
export { E as ExportManager, b as ExportManagerProps, e as SlotDelete, f as SlotDeleteProps, g as SlotDragHandle, h as SlotDragHandleProps, S as SlotElements, a as SlotElementsProps, c as SlotEnable, d as SlotEnableProps, u as useSlotContext } from '../../index-D4Fc9AJv.js';
|
|
2
2
|
import 'react';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import
|
|
1
|
+
import * as React4 from 'react';
|
|
2
|
+
import React4__default, { createContext, useContext, useState, useEffect } from 'react';
|
|
3
3
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
4
4
|
import 'react-dom';
|
|
5
5
|
|
|
@@ -1043,6 +1043,7 @@ var require_package = __commonJS({
|
|
|
1043
1043
|
};
|
|
1044
1044
|
}
|
|
1045
1045
|
});
|
|
1046
|
+
var DevContext = createContext(null);
|
|
1046
1047
|
|
|
1047
1048
|
// src/components/slots/SlotElements.tsx
|
|
1048
1049
|
var SlotElements = (props) => {
|
|
@@ -1081,10 +1082,10 @@ function composeRefs(...refs) {
|
|
|
1081
1082
|
};
|
|
1082
1083
|
}
|
|
1083
1084
|
function useComposedRefs(...refs) {
|
|
1084
|
-
return
|
|
1085
|
+
return React4.useCallback(composeRefs(...refs), refs);
|
|
1085
1086
|
}
|
|
1086
1087
|
var REACT_LAZY_TYPE = Symbol.for("react.lazy");
|
|
1087
|
-
var use =
|
|
1088
|
+
var use = React4[" use ".trim().toString()];
|
|
1088
1089
|
function isPromiseLike(value) {
|
|
1089
1090
|
return typeof value === "object" && value !== null && "then" in value;
|
|
1090
1091
|
}
|
|
@@ -1094,24 +1095,24 @@ function isLazyComponent(element) {
|
|
|
1094
1095
|
// @__NO_SIDE_EFFECTS__
|
|
1095
1096
|
function createSlot(ownerName) {
|
|
1096
1097
|
const SlotClone = /* @__PURE__ */ createSlotClone(ownerName);
|
|
1097
|
-
const Slot2 =
|
|
1098
|
+
const Slot2 = React4.forwardRef((props, forwardedRef) => {
|
|
1098
1099
|
let { children, ...slotProps } = props;
|
|
1099
1100
|
if (isLazyComponent(children) && typeof use === "function") {
|
|
1100
1101
|
children = use(children._payload);
|
|
1101
1102
|
}
|
|
1102
|
-
const childrenArray =
|
|
1103
|
+
const childrenArray = React4.Children.toArray(children);
|
|
1103
1104
|
const slottable = childrenArray.find(isSlottable);
|
|
1104
1105
|
if (slottable) {
|
|
1105
1106
|
const newElement = slottable.props.children;
|
|
1106
1107
|
const newChildren = childrenArray.map((child) => {
|
|
1107
1108
|
if (child === slottable) {
|
|
1108
|
-
if (
|
|
1109
|
-
return
|
|
1109
|
+
if (React4.Children.count(newElement) > 1) return React4.Children.only(null);
|
|
1110
|
+
return React4.isValidElement(newElement) ? newElement.props.children : null;
|
|
1110
1111
|
} else {
|
|
1111
1112
|
return child;
|
|
1112
1113
|
}
|
|
1113
1114
|
});
|
|
1114
|
-
return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children:
|
|
1115
|
+
return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children: React4.isValidElement(newElement) ? React4.cloneElement(newElement, void 0, newChildren) : null });
|
|
1115
1116
|
}
|
|
1116
1117
|
return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children });
|
|
1117
1118
|
});
|
|
@@ -1121,27 +1122,27 @@ function createSlot(ownerName) {
|
|
|
1121
1122
|
var Slot = /* @__PURE__ */ createSlot("Slot");
|
|
1122
1123
|
// @__NO_SIDE_EFFECTS__
|
|
1123
1124
|
function createSlotClone(ownerName) {
|
|
1124
|
-
const SlotClone =
|
|
1125
|
+
const SlotClone = React4.forwardRef((props, forwardedRef) => {
|
|
1125
1126
|
let { children, ...slotProps } = props;
|
|
1126
1127
|
if (isLazyComponent(children) && typeof use === "function") {
|
|
1127
1128
|
children = use(children._payload);
|
|
1128
1129
|
}
|
|
1129
|
-
if (
|
|
1130
|
+
if (React4.isValidElement(children)) {
|
|
1130
1131
|
const childrenRef = getElementRef(children);
|
|
1131
1132
|
const props2 = mergeProps(slotProps, children.props);
|
|
1132
|
-
if (children.type !==
|
|
1133
|
+
if (children.type !== React4.Fragment) {
|
|
1133
1134
|
props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;
|
|
1134
1135
|
}
|
|
1135
|
-
return
|
|
1136
|
+
return React4.cloneElement(children, props2);
|
|
1136
1137
|
}
|
|
1137
|
-
return
|
|
1138
|
+
return React4.Children.count(children) > 1 ? React4.Children.only(null) : null;
|
|
1138
1139
|
});
|
|
1139
1140
|
SlotClone.displayName = `${ownerName}.SlotClone`;
|
|
1140
1141
|
return SlotClone;
|
|
1141
1142
|
}
|
|
1142
1143
|
var SLOTTABLE_IDENTIFIER = Symbol("radix.slottable");
|
|
1143
1144
|
function isSlottable(child) {
|
|
1144
|
-
return
|
|
1145
|
+
return React4.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER;
|
|
1145
1146
|
}
|
|
1146
1147
|
function mergeProps(slotProps, childProps) {
|
|
1147
1148
|
const overrideProps = { ...childProps };
|
|
@@ -4288,7 +4289,7 @@ function Button({
|
|
|
4288
4289
|
...props
|
|
4289
4290
|
}) {
|
|
4290
4291
|
const Comp = asChild ? Slot : "button";
|
|
4291
|
-
return /* @__PURE__ */
|
|
4292
|
+
return /* @__PURE__ */ React4.createElement(
|
|
4292
4293
|
Comp,
|
|
4293
4294
|
{
|
|
4294
4295
|
"data-slot": "button",
|
|
@@ -4314,32 +4315,32 @@ function composeEventHandlers(originalEventHandler, ourEventHandler, { checkForD
|
|
|
4314
4315
|
function createContextScope(scopeName, createContextScopeDeps = []) {
|
|
4315
4316
|
let defaultContexts = [];
|
|
4316
4317
|
function createContext3(rootComponentName, defaultContext) {
|
|
4317
|
-
const BaseContext =
|
|
4318
|
+
const BaseContext = React4.createContext(defaultContext);
|
|
4318
4319
|
const index = defaultContexts.length;
|
|
4319
4320
|
defaultContexts = [...defaultContexts, defaultContext];
|
|
4320
4321
|
const Provider = (props) => {
|
|
4321
4322
|
const { scope, children, ...context } = props;
|
|
4322
4323
|
const Context = scope?.[scopeName]?.[index] || BaseContext;
|
|
4323
|
-
const value =
|
|
4324
|
+
const value = React4.useMemo(() => context, Object.values(context));
|
|
4324
4325
|
return /* @__PURE__ */ jsx(Context.Provider, { value, children });
|
|
4325
4326
|
};
|
|
4326
4327
|
Provider.displayName = rootComponentName + "Provider";
|
|
4327
|
-
function
|
|
4328
|
+
function useContext22(consumerName, scope) {
|
|
4328
4329
|
const Context = scope?.[scopeName]?.[index] || BaseContext;
|
|
4329
|
-
const context =
|
|
4330
|
+
const context = React4.useContext(Context);
|
|
4330
4331
|
if (context) return context;
|
|
4331
4332
|
if (defaultContext !== void 0) return defaultContext;
|
|
4332
4333
|
throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
|
|
4333
4334
|
}
|
|
4334
|
-
return [Provider,
|
|
4335
|
+
return [Provider, useContext22];
|
|
4335
4336
|
}
|
|
4336
4337
|
const createScope = () => {
|
|
4337
4338
|
const scopeContexts = defaultContexts.map((defaultContext) => {
|
|
4338
|
-
return
|
|
4339
|
+
return React4.createContext(defaultContext);
|
|
4339
4340
|
});
|
|
4340
4341
|
return function useScope(scope) {
|
|
4341
4342
|
const contexts = scope?.[scopeName] || scopeContexts;
|
|
4342
|
-
return
|
|
4343
|
+
return React4.useMemo(
|
|
4343
4344
|
() => ({ [`__scope${scopeName}`]: { ...scope, [scopeName]: contexts } }),
|
|
4344
4345
|
[scope, contexts]
|
|
4345
4346
|
);
|
|
@@ -4362,15 +4363,15 @@ function composeContextScopes(...scopes) {
|
|
|
4362
4363
|
const currentScope = scopeProps[`__scope${scopeName}`];
|
|
4363
4364
|
return { ...nextScopes2, ...currentScope };
|
|
4364
4365
|
}, {});
|
|
4365
|
-
return
|
|
4366
|
+
return React4.useMemo(() => ({ [`__scope${baseScope.scopeName}`]: nextScopes }), [nextScopes]);
|
|
4366
4367
|
};
|
|
4367
4368
|
};
|
|
4368
4369
|
createScope.scopeName = baseScope.scopeName;
|
|
4369
4370
|
return createScope;
|
|
4370
4371
|
}
|
|
4371
|
-
var useLayoutEffect2 = globalThis?.document ?
|
|
4372
|
+
var useLayoutEffect2 = globalThis?.document ? React4.useLayoutEffect : () => {
|
|
4372
4373
|
};
|
|
4373
|
-
var useInsertionEffect =
|
|
4374
|
+
var useInsertionEffect = React4[" useInsertionEffect ".trim().toString()] || useLayoutEffect2;
|
|
4374
4375
|
function useControllableState({
|
|
4375
4376
|
prop,
|
|
4376
4377
|
defaultProp,
|
|
@@ -4385,8 +4386,8 @@ function useControllableState({
|
|
|
4385
4386
|
const isControlled = prop !== void 0;
|
|
4386
4387
|
const value = isControlled ? prop : uncontrolledProp;
|
|
4387
4388
|
{
|
|
4388
|
-
const isControlledRef =
|
|
4389
|
-
|
|
4389
|
+
const isControlledRef = React4.useRef(prop !== void 0);
|
|
4390
|
+
React4.useEffect(() => {
|
|
4390
4391
|
const wasControlled = isControlledRef.current;
|
|
4391
4392
|
if (wasControlled !== isControlled) {
|
|
4392
4393
|
const from = wasControlled ? "controlled" : "uncontrolled";
|
|
@@ -4398,7 +4399,7 @@ function useControllableState({
|
|
|
4398
4399
|
isControlledRef.current = isControlled;
|
|
4399
4400
|
}, [isControlled, caller]);
|
|
4400
4401
|
}
|
|
4401
|
-
const setValue =
|
|
4402
|
+
const setValue = React4.useCallback(
|
|
4402
4403
|
(nextValue) => {
|
|
4403
4404
|
if (isControlled) {
|
|
4404
4405
|
const value2 = isFunction(nextValue) ? nextValue(prop) : nextValue;
|
|
@@ -4417,13 +4418,13 @@ function useUncontrolledState({
|
|
|
4417
4418
|
defaultProp,
|
|
4418
4419
|
onChange: onChange2
|
|
4419
4420
|
}) {
|
|
4420
|
-
const [value, setValue] =
|
|
4421
|
-
const prevValueRef =
|
|
4422
|
-
const onChangeRef =
|
|
4421
|
+
const [value, setValue] = React4.useState(defaultProp);
|
|
4422
|
+
const prevValueRef = React4.useRef(value);
|
|
4423
|
+
const onChangeRef = React4.useRef(onChange2);
|
|
4423
4424
|
useInsertionEffect(() => {
|
|
4424
4425
|
onChangeRef.current = onChange2;
|
|
4425
4426
|
}, [onChange2]);
|
|
4426
|
-
|
|
4427
|
+
React4.useEffect(() => {
|
|
4427
4428
|
if (prevValueRef.current !== value) {
|
|
4428
4429
|
onChangeRef.current?.(value);
|
|
4429
4430
|
prevValueRef.current = value;
|
|
@@ -4435,8 +4436,8 @@ function isFunction(value) {
|
|
|
4435
4436
|
return typeof value === "function";
|
|
4436
4437
|
}
|
|
4437
4438
|
function usePrevious(value) {
|
|
4438
|
-
const ref =
|
|
4439
|
-
return
|
|
4439
|
+
const ref = React4.useRef({ value, previous: value });
|
|
4440
|
+
return React4.useMemo(() => {
|
|
4440
4441
|
if (ref.current.value !== value) {
|
|
4441
4442
|
ref.current.previous = ref.current.value;
|
|
4442
4443
|
ref.current.value = value;
|
|
@@ -4445,7 +4446,7 @@ function usePrevious(value) {
|
|
|
4445
4446
|
}, [value]);
|
|
4446
4447
|
}
|
|
4447
4448
|
function useSize(element) {
|
|
4448
|
-
const [size, setSize] =
|
|
4449
|
+
const [size, setSize] = React4.useState(void 0);
|
|
4449
4450
|
useLayoutEffect2(() => {
|
|
4450
4451
|
if (element) {
|
|
4451
4452
|
setSize({ width: element.offsetWidth, height: element.offsetHeight });
|
|
@@ -4481,21 +4482,21 @@ function useSize(element) {
|
|
|
4481
4482
|
// @__NO_SIDE_EFFECTS__
|
|
4482
4483
|
function createSlot2(ownerName) {
|
|
4483
4484
|
const SlotClone = /* @__PURE__ */ createSlotClone2(ownerName);
|
|
4484
|
-
const Slot2 =
|
|
4485
|
+
const Slot2 = React4.forwardRef((props, forwardedRef) => {
|
|
4485
4486
|
const { children, ...slotProps } = props;
|
|
4486
|
-
const childrenArray =
|
|
4487
|
+
const childrenArray = React4.Children.toArray(children);
|
|
4487
4488
|
const slottable = childrenArray.find(isSlottable2);
|
|
4488
4489
|
if (slottable) {
|
|
4489
4490
|
const newElement = slottable.props.children;
|
|
4490
4491
|
const newChildren = childrenArray.map((child) => {
|
|
4491
4492
|
if (child === slottable) {
|
|
4492
|
-
if (
|
|
4493
|
-
return
|
|
4493
|
+
if (React4.Children.count(newElement) > 1) return React4.Children.only(null);
|
|
4494
|
+
return React4.isValidElement(newElement) ? newElement.props.children : null;
|
|
4494
4495
|
} else {
|
|
4495
4496
|
return child;
|
|
4496
4497
|
}
|
|
4497
4498
|
});
|
|
4498
|
-
return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children:
|
|
4499
|
+
return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children: React4.isValidElement(newElement) ? React4.cloneElement(newElement, void 0, newChildren) : null });
|
|
4499
4500
|
}
|
|
4500
4501
|
return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children });
|
|
4501
4502
|
});
|
|
@@ -4504,24 +4505,24 @@ function createSlot2(ownerName) {
|
|
|
4504
4505
|
}
|
|
4505
4506
|
// @__NO_SIDE_EFFECTS__
|
|
4506
4507
|
function createSlotClone2(ownerName) {
|
|
4507
|
-
const SlotClone =
|
|
4508
|
+
const SlotClone = React4.forwardRef((props, forwardedRef) => {
|
|
4508
4509
|
const { children, ...slotProps } = props;
|
|
4509
|
-
if (
|
|
4510
|
+
if (React4.isValidElement(children)) {
|
|
4510
4511
|
const childrenRef = getElementRef2(children);
|
|
4511
4512
|
const props2 = mergeProps2(slotProps, children.props);
|
|
4512
|
-
if (children.type !==
|
|
4513
|
+
if (children.type !== React4.Fragment) {
|
|
4513
4514
|
props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;
|
|
4514
4515
|
}
|
|
4515
|
-
return
|
|
4516
|
+
return React4.cloneElement(children, props2);
|
|
4516
4517
|
}
|
|
4517
|
-
return
|
|
4518
|
+
return React4.Children.count(children) > 1 ? React4.Children.only(null) : null;
|
|
4518
4519
|
});
|
|
4519
4520
|
SlotClone.displayName = `${ownerName}.SlotClone`;
|
|
4520
4521
|
return SlotClone;
|
|
4521
4522
|
}
|
|
4522
4523
|
var SLOTTABLE_IDENTIFIER2 = Symbol("radix.slottable");
|
|
4523
4524
|
function isSlottable2(child) {
|
|
4524
|
-
return
|
|
4525
|
+
return React4.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER2;
|
|
4525
4526
|
}
|
|
4526
4527
|
function mergeProps2(slotProps, childProps) {
|
|
4527
4528
|
const overrideProps = { ...childProps };
|
|
@@ -4581,7 +4582,7 @@ var NODES = [
|
|
|
4581
4582
|
];
|
|
4582
4583
|
var Primitive = NODES.reduce((primitive, node) => {
|
|
4583
4584
|
const Slot2 = createSlot2(`Primitive.${node}`);
|
|
4584
|
-
const Node2 =
|
|
4585
|
+
const Node2 = React4.forwardRef((props, forwardedRef) => {
|
|
4585
4586
|
const { asChild, ...primitiveProps } = props;
|
|
4586
4587
|
const Comp = asChild ? Slot2 : node;
|
|
4587
4588
|
if (typeof window !== "undefined") {
|
|
@@ -4595,7 +4596,7 @@ var Primitive = NODES.reduce((primitive, node) => {
|
|
|
4595
4596
|
var SWITCH_NAME = "Switch";
|
|
4596
4597
|
var [createSwitchContext] = createContextScope(SWITCH_NAME);
|
|
4597
4598
|
var [SwitchProvider, useSwitchContext] = createSwitchContext(SWITCH_NAME);
|
|
4598
|
-
var Switch =
|
|
4599
|
+
var Switch = React4.forwardRef(
|
|
4599
4600
|
(props, forwardedRef) => {
|
|
4600
4601
|
const {
|
|
4601
4602
|
__scopeSwitch,
|
|
@@ -4609,9 +4610,9 @@ var Switch = React3.forwardRef(
|
|
|
4609
4610
|
form,
|
|
4610
4611
|
...switchProps
|
|
4611
4612
|
} = props;
|
|
4612
|
-
const [button, setButton] =
|
|
4613
|
+
const [button, setButton] = React4.useState(null);
|
|
4613
4614
|
const composedRefs = useComposedRefs(forwardedRef, (node) => setButton(node));
|
|
4614
|
-
const hasConsumerStoppedPropagationRef =
|
|
4615
|
+
const hasConsumerStoppedPropagationRef = React4.useRef(false);
|
|
4615
4616
|
const isFormControl = button ? form || !!button.closest("form") : true;
|
|
4616
4617
|
const [checked, setChecked] = useControllableState({
|
|
4617
4618
|
prop: checkedProp,
|
|
@@ -4661,7 +4662,7 @@ var Switch = React3.forwardRef(
|
|
|
4661
4662
|
);
|
|
4662
4663
|
Switch.displayName = SWITCH_NAME;
|
|
4663
4664
|
var THUMB_NAME = "SwitchThumb";
|
|
4664
|
-
var SwitchThumb =
|
|
4665
|
+
var SwitchThumb = React4.forwardRef(
|
|
4665
4666
|
(props, forwardedRef) => {
|
|
4666
4667
|
const { __scopeSwitch, ...thumbProps } = props;
|
|
4667
4668
|
const context = useSwitchContext(THUMB_NAME, __scopeSwitch);
|
|
@@ -4678,7 +4679,7 @@ var SwitchThumb = React3.forwardRef(
|
|
|
4678
4679
|
);
|
|
4679
4680
|
SwitchThumb.displayName = THUMB_NAME;
|
|
4680
4681
|
var BUBBLE_INPUT_NAME = "SwitchBubbleInput";
|
|
4681
|
-
var SwitchBubbleInput =
|
|
4682
|
+
var SwitchBubbleInput = React4.forwardRef(
|
|
4682
4683
|
({
|
|
4683
4684
|
__scopeSwitch,
|
|
4684
4685
|
control,
|
|
@@ -4686,11 +4687,11 @@ var SwitchBubbleInput = React3.forwardRef(
|
|
|
4686
4687
|
bubbles = true,
|
|
4687
4688
|
...props
|
|
4688
4689
|
}, forwardedRef) => {
|
|
4689
|
-
const ref =
|
|
4690
|
+
const ref = React4.useRef(null);
|
|
4690
4691
|
const composedRefs = useComposedRefs(ref, forwardedRef);
|
|
4691
4692
|
const prevChecked = usePrevious(checked);
|
|
4692
4693
|
const controlSize = useSize(control);
|
|
4693
|
-
|
|
4694
|
+
React4.useEffect(() => {
|
|
4694
4695
|
const input = ref.current;
|
|
4695
4696
|
if (!input) return;
|
|
4696
4697
|
const inputProto = window.HTMLInputElement.prototype;
|
|
@@ -4771,14 +4772,14 @@ var switchThumbVariants = cva(
|
|
|
4771
4772
|
}
|
|
4772
4773
|
);
|
|
4773
4774
|
function Switch2({ className, size, ...props }) {
|
|
4774
|
-
return /* @__PURE__ */
|
|
4775
|
+
return /* @__PURE__ */ React4.createElement(
|
|
4775
4776
|
Root,
|
|
4776
4777
|
{
|
|
4777
4778
|
"data-slot": "switch",
|
|
4778
4779
|
className: cn(switchRootVariants({ size }), className),
|
|
4779
4780
|
...props
|
|
4780
4781
|
},
|
|
4781
|
-
/* @__PURE__ */
|
|
4782
|
+
/* @__PURE__ */ React4.createElement(
|
|
4782
4783
|
Thumb,
|
|
4783
4784
|
{
|
|
4784
4785
|
"data-slot": "switch-thumb",
|
|
@@ -7903,7 +7904,7 @@ var defaultProps = {
|
|
|
7903
7904
|
swapOpacity: false,
|
|
7904
7905
|
widthAuto: false
|
|
7905
7906
|
};
|
|
7906
|
-
var FontAwesomeIcon = /* @__PURE__ */
|
|
7907
|
+
var FontAwesomeIcon = /* @__PURE__ */ React4__default.forwardRef(function(props, ref) {
|
|
7907
7908
|
var allProps = _objectSpread22(_objectSpread22({}, defaultProps), props);
|
|
7908
7909
|
var iconArgs = allProps.icon, maskArgs = allProps.mask, symbol = allProps.symbol, className = allProps.className, title = allProps.title, titleId = allProps.titleId, maskId = allProps.maskId;
|
|
7909
7910
|
var iconLookup = normalizeIconArgs(iconArgs);
|
|
@@ -7964,7 +7965,7 @@ FontAwesomeIcon.propTypes = {
|
|
|
7964
7965
|
swapOpacity: import_prop_types.default.bool,
|
|
7965
7966
|
widthAuto: import_prop_types.default.bool
|
|
7966
7967
|
};
|
|
7967
|
-
var convertCurry = convert.bind(null,
|
|
7968
|
+
var convertCurry = convert.bind(null, React4__default.createElement);
|
|
7968
7969
|
|
|
7969
7970
|
// ../../node_modules/.pnpm/@fortawesome+pro-solid-svg-icons@6.7.2/node_modules/@fortawesome/pro-solid-svg-icons/index.mjs
|
|
7970
7971
|
var faGripVertical = {
|
|
@@ -7989,6 +7990,18 @@ var SlotDragHandle = (props) => {
|
|
|
7989
7990
|
const { slotId } = props;
|
|
7990
7991
|
return /* @__PURE__ */ React.createElement("div", { className: "uii:cursor-grab" }, /* @__PURE__ */ React.createElement(FontAwesomeIcon, { icon: faGripVertical }));
|
|
7991
7992
|
};
|
|
7993
|
+
|
|
7994
|
+
// src/components/slots/index.tsx
|
|
7995
|
+
function useSlotContext(slotId) {
|
|
7996
|
+
const devContext = useContext(DevContext);
|
|
7997
|
+
const [activeSlotId, setActiveSlotId] = useState(void 0);
|
|
7998
|
+
useEffect(() => {
|
|
7999
|
+
if (devContext) {
|
|
8000
|
+
setActiveSlotId(devContext.activeSlotId ?? void 0);
|
|
8001
|
+
}
|
|
8002
|
+
}, [devContext, slotId]);
|
|
8003
|
+
return { active: (activeSlotId ?? "") === slotId, enabled: true };
|
|
8004
|
+
}
|
|
7992
8005
|
/*! Bundled license information:
|
|
7993
8006
|
|
|
7994
8007
|
react-is/cjs/react-is.production.min.js:
|
|
@@ -8033,6 +8046,6 @@ object-assign/index.js:
|
|
|
8033
8046
|
*)
|
|
8034
8047
|
*/
|
|
8035
8048
|
|
|
8036
|
-
export { ExportManager, SlotDelete, SlotDragHandle, SlotElements, SlotEnable };
|
|
8049
|
+
export { ExportManager, SlotDelete, SlotDragHandle, SlotElements, SlotEnable, useSlotContext };
|
|
8037
8050
|
//# sourceMappingURL=index.js.map
|
|
8038
8051
|
//# sourceMappingURL=index.js.map
|