@easy-editor/setters 0.0.5 → 0.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -3,7 +3,7 @@
3
3
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react'), require('react/jsx-runtime'), require('react-dom')) :
4
4
  typeof define === 'function' && define.amd ? define(['exports', 'react', 'react/jsx-runtime', 'react-dom'], factory) :
5
5
  (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.EasyEditorSetters = {}, global.React, global.jsxRuntime, global.ReactDOM));
6
- })(this, (function (exports, React, jsxRuntime, ReactDOM) { 'use strict';
6
+ })(this, (function (exports, React$1, jsxRuntime, ReactDOM) { 'use strict';
7
7
 
8
8
  function _interopNamespaceDefault(e) {
9
9
  var n = Object.create(null);
@@ -22,9 +22,19 @@
22
22
  return Object.freeze(n);
23
23
  }
24
24
 
25
- var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
25
+ var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React$1);
26
26
  var ReactDOM__namespace = /*#__PURE__*/_interopNamespaceDefault(ReactDOM);
27
27
 
28
+ function _extends$1() {
29
+ return _extends$1 = Object.assign ? Object.assign.bind() : function (n) {
30
+ for (var e = 1; e < arguments.length; e++) {
31
+ var t = arguments[e];
32
+ for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
33
+ }
34
+ return n;
35
+ }, _extends$1.apply(null, arguments);
36
+ }
37
+
28
38
  // packages/react/compose-refs/src/compose-refs.tsx
29
39
  function setRef(ref, value) {
30
40
  if (typeof ref === "function") {
@@ -3273,7 +3283,7 @@
3273
3283
  ...props
3274
3284
  }, ref) => {
3275
3285
  const Comp = asChild ? Slot$1 : "button";
3276
- return /*#__PURE__*/jsxRuntime.jsx(Comp, {
3286
+ return /*#__PURE__*/React__namespace.createElement(Comp, _extends$1({
3277
3287
  ref: ref,
3278
3288
  "data-slot": "button",
3279
3289
  "data-variant": variant,
@@ -3282,9 +3292,8 @@
3282
3292
  variant,
3283
3293
  size,
3284
3294
  className
3285
- })),
3286
- ...props
3287
- });
3295
+ }))
3296
+ }, props));
3288
3297
  });
3289
3298
  Button.displayName = "Button";
3290
3299
 
@@ -5800,7 +5809,7 @@
5800
5809
  var isClient = typeof document !== 'undefined';
5801
5810
 
5802
5811
  var noop = function noop() {};
5803
- var index = isClient ? React.useLayoutEffect : noop;
5812
+ var index = isClient ? React$1.useLayoutEffect : noop;
5804
5813
 
5805
5814
  // Fork of `fast-deep-equal` that only does the comparisons we need and compares
5806
5815
  // functions
@@ -6857,7 +6866,7 @@
6857
6866
  }
6858
6867
 
6859
6868
  function useCallbackRef(initialValue, callback) {
6860
- var ref = React.useState(function () {
6869
+ var ref = React$1.useState(function () {
6861
6870
  return {
6862
6871
  value: initialValue,
6863
6872
  callback: callback,
@@ -7811,18 +7820,16 @@
7811
7820
  function Popover({
7812
7821
  ...props
7813
7822
  }) {
7814
- return /*#__PURE__*/jsxRuntime.jsx(Root2$1, {
7815
- "data-slot": "popover",
7816
- ...props
7817
- });
7823
+ return /*#__PURE__*/React__namespace.createElement(Root2$1, _extends$1({
7824
+ "data-slot": "popover"
7825
+ }, props));
7818
7826
  }
7819
7827
  function PopoverTrigger({
7820
7828
  ...props
7821
7829
  }) {
7822
- return /*#__PURE__*/jsxRuntime.jsx(Trigger$1, {
7823
- "data-slot": "popover-trigger",
7824
- ...props
7825
- });
7830
+ return /*#__PURE__*/React__namespace.createElement(Trigger$1, _extends$1({
7831
+ "data-slot": "popover-trigger"
7832
+ }, props));
7826
7833
  }
7827
7834
  function PopoverContent({
7828
7835
  className,
@@ -7830,15 +7837,12 @@
7830
7837
  sideOffset = 4,
7831
7838
  ...props
7832
7839
  }) {
7833
- return /*#__PURE__*/jsxRuntime.jsx(Portal, {
7834
- children: /*#__PURE__*/jsxRuntime.jsx(Content2, {
7835
- "data-slot": "popover-content",
7836
- align: align,
7837
- sideOffset: sideOffset,
7838
- className: cn("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden", className),
7839
- ...props
7840
- })
7841
- });
7840
+ return /*#__PURE__*/React__namespace.createElement(Portal, null, /*#__PURE__*/React__namespace.createElement(Content2, _extends$1({
7841
+ "data-slot": "popover-content",
7842
+ align: align,
7843
+ sideOffset: sideOffset,
7844
+ className: cn("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden", className)
7845
+ }, props)));
7842
7846
  }
7843
7847
 
7844
7848
  function _extends() {
@@ -8103,11 +8107,11 @@
8103
8107
  var validHex$1 = hex => /^#?([A-Fa-f0-9]{3,4}){1,2}$/.test(hex);
8104
8108
 
8105
8109
  function useEventCallback(handler) {
8106
- var callbackRef = React.useRef(handler);
8107
- React.useEffect(() => {
8110
+ var callbackRef = React$1.useRef(handler);
8111
+ React$1.useEffect(() => {
8108
8112
  callbackRef.current = handler;
8109
8113
  });
8110
- return React.useCallback((value, event) => callbackRef.current && callbackRef.current(value, event), []);
8114
+ return React$1.useCallback((value, event) => callbackRef.current && callbackRef.current(value, event), []);
8111
8115
  }
8112
8116
  var isTouch = event => 'touches' in event;
8113
8117
  var preventDefaultMove = event => {
@@ -8136,7 +8140,7 @@
8136
8140
  };
8137
8141
 
8138
8142
  var _excluded$8 = ["prefixCls", "className", "onMove", "onDown"];
8139
- var Interactive = /*#__PURE__*/React.forwardRef((props, ref) => {
8143
+ var Interactive = /*#__PURE__*/React$1.forwardRef((props, ref) => {
8140
8144
  var {
8141
8145
  prefixCls = 'w-color-interactive',
8142
8146
  className,
@@ -8144,9 +8148,9 @@
8144
8148
  onDown
8145
8149
  } = props,
8146
8150
  reset = _objectWithoutPropertiesLoose(props, _excluded$8);
8147
- var container = React.useRef(null);
8148
- var hasTouched = React.useRef(false);
8149
- var [isDragging, setDragging] = React.useState(false);
8151
+ var container = React$1.useRef(null);
8152
+ var hasTouched = React$1.useRef(false);
8153
+ var [isDragging, setDragging] = React$1.useState(false);
8150
8154
  var onMoveCallback = useEventCallback(onMove);
8151
8155
  var onKeyCallback = useEventCallback(onDown);
8152
8156
  var isValid = event => {
@@ -8154,7 +8158,7 @@
8154
8158
  hasTouched.current = isTouch(event);
8155
8159
  return true;
8156
8160
  };
8157
- var handleMove = React.useCallback(event => {
8161
+ var handleMove = React$1.useCallback(event => {
8158
8162
  preventDefaultMove(event);
8159
8163
  if (!container.current) return;
8160
8164
  var isDown = isTouch(event) ? event.touches.length > 0 : event.buttons > 0;
@@ -8164,8 +8168,8 @@
8164
8168
  }
8165
8169
  onMoveCallback == null || onMoveCallback(getRelativePosition(container.current, event), event);
8166
8170
  }, [onMoveCallback]);
8167
- var handleMoveEnd = React.useCallback(() => setDragging(false), []);
8168
- var toggleDocumentEvents = React.useCallback(state => {
8171
+ var handleMoveEnd = React$1.useCallback(() => setDragging(false), []);
8172
+ var toggleDocumentEvents = React$1.useCallback(state => {
8169
8173
  if (state) {
8170
8174
  window.addEventListener(hasTouched.current ? 'touchmove' : 'mousemove', handleMove);
8171
8175
  window.addEventListener(hasTouched.current ? 'touchend' : 'mouseup', handleMoveEnd);
@@ -8176,13 +8180,13 @@
8176
8180
  window.removeEventListener('touchend', handleMoveEnd);
8177
8181
  }
8178
8182
  }, [handleMove, handleMoveEnd]);
8179
- React.useEffect(() => {
8183
+ React$1.useEffect(() => {
8180
8184
  toggleDocumentEvents(isDragging);
8181
8185
  return () => {
8182
8186
  toggleDocumentEvents(false);
8183
8187
  };
8184
8188
  }, [isDragging, handleMove, handleMoveEnd, toggleDocumentEvents]);
8185
- var handleMoveStart = React.useCallback(event => {
8189
+ var handleMoveStart = React$1.useCallback(event => {
8186
8190
  var activeEl = document.activeElement;
8187
8191
  activeEl == null || activeEl.blur();
8188
8192
  preventDefaultMove(event.nativeEvent);
@@ -8226,7 +8230,7 @@
8226
8230
  borderRadius: '50%',
8227
8231
  backgroundColor: color
8228
8232
  };
8229
- return React.useMemo(() => /*#__PURE__*/jsxRuntime.jsx("div", {
8233
+ return React$1.useMemo(() => /*#__PURE__*/jsxRuntime.jsx("div", {
8230
8234
  className: prefixCls + "-pointer " + (className || ''),
8231
8235
  style: style,
8232
8236
  children: /*#__PURE__*/jsxRuntime.jsx("div", {
@@ -8237,7 +8241,7 @@
8237
8241
  };
8238
8242
 
8239
8243
  var _excluded$7 = ["prefixCls", "radius", "pointer", "className", "hue", "style", "hsva", "onChange"];
8240
- var Saturation = /*#__PURE__*/React.forwardRef((props, ref) => {
8244
+ var Saturation = /*#__PURE__*/React$1.forwardRef((props, ref) => {
8241
8245
  var _hsva$h;
8242
8246
  var {
8243
8247
  prefixCls = 'w-color-saturation',
@@ -8265,7 +8269,7 @@
8265
8269
  a: hsva.a
8266
8270
  });
8267
8271
  };
8268
- var handleKeyDown = React.useCallback(event => {
8272
+ var handleKeyDown = React$1.useCallback(event => {
8269
8273
  if (!hsva || !onChange) return;
8270
8274
  var step = 1;
8271
8275
  var newS = hsva.s;
@@ -8304,7 +8308,7 @@
8304
8308
  });
8305
8309
  }
8306
8310
  }, [hsva, onChange]);
8307
- var pointerElement = React.useMemo(() => {
8311
+ var pointerElement = React$1.useMemo(() => {
8308
8312
  if (!hsva) return null;
8309
8313
  var comProps = {
8310
8314
  top: 100 - hsva.v + "%",
@@ -8320,7 +8324,7 @@
8320
8324
  prefixCls: prefixCls
8321
8325
  }, comProps));
8322
8326
  }, [hsva, pointer, prefixCls]);
8323
- var handleClick = React.useCallback(event => {
8327
+ var handleClick = React$1.useCallback(event => {
8324
8328
  event.target.focus();
8325
8329
  }, []);
8326
8330
  return /*#__PURE__*/jsxRuntime.jsx(Interactive, _extends({
@@ -8383,7 +8387,7 @@
8383
8387
 
8384
8388
  var _excluded$5 = ["prefixCls", "className", "hsva", "background", "bgProps", "innerProps", "pointerProps", "radius", "width", "height", "direction", "style", "onChange", "pointer"];
8385
8389
  var BACKGROUND_IMG = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAMUlEQVQ4T2NkYGAQYcAP3uCTZhw1gGGYhAGBZIA/nYDCgBDAm9BGDWAAJyRCgLaBCAAgXwixzAS0pgAAAABJRU5ErkJggg==';
8386
- var Alpha = /*#__PURE__*/React.forwardRef((props, ref) => {
8390
+ var Alpha = /*#__PURE__*/React$1.forwardRef((props, ref) => {
8387
8391
  var {
8388
8392
  prefixCls = 'w-color-alpha',
8389
8393
  className,
@@ -8429,7 +8433,7 @@
8429
8433
  }, style, {
8430
8434
  position: 'relative'
8431
8435
  });
8432
- var handleKeyDown = React.useCallback(event => {
8436
+ var handleKeyDown = React$1.useCallback(event => {
8433
8437
  var step = 0.01;
8434
8438
  var currentAlpha = hsva.a;
8435
8439
  var newAlpha = currentAlpha;
@@ -8475,7 +8479,7 @@
8475
8479
  }), syntheticOffset);
8476
8480
  }
8477
8481
  }, [hsva, direction, onChange]);
8478
- var handleClick = React.useCallback(event => {
8482
+ var handleClick = React$1.useCallback(event => {
8479
8483
  event.target.focus();
8480
8484
  }, []);
8481
8485
  var pointerElement = pointer && typeof pointer === 'function' ? pointer(_extends({
@@ -8514,7 +8518,7 @@
8514
8518
  var _excluded$4 = ["prefixCls", "placement", "label", "value", "className", "style", "labelStyle", "inputStyle", "onChange", "onBlur", "renderInput"];
8515
8519
  var validHex = hex => /^#?([A-Fa-f0-9]{3,4}){1,2}$/.test(hex);
8516
8520
  var getNumberValue = value => Number(String(value).replace(/%/g, ''));
8517
- var EditableInput = /*#__PURE__*/React.forwardRef((props, ref) => {
8521
+ var EditableInput = /*#__PURE__*/React$1.forwardRef((props, ref) => {
8518
8522
  var {
8519
8523
  prefixCls = 'w-color-editable-input',
8520
8524
  placement = 'bottom',
@@ -8529,9 +8533,9 @@
8529
8533
  renderInput
8530
8534
  } = props,
8531
8535
  other = _objectWithoutPropertiesLoose(props, _excluded$4);
8532
- var [value, setValue] = React.useState(initValue);
8533
- var isFocus = React.useRef(false);
8534
- React.useEffect(() => {
8536
+ var [value, setValue] = React$1.useState(initValue);
8537
+ var isFocus = React$1.useRef(false);
8538
+ React$1.useEffect(() => {
8535
8539
  if (props.value !== value) {
8536
8540
  if (!isFocus.current) {
8537
8541
  setValue(props.value);
@@ -8616,7 +8620,7 @@
8616
8620
  EditableInput.displayName = 'EditableInput';
8617
8621
 
8618
8622
  var _excluded$3 = ["prefixCls", "hsva", "placement", "rProps", "gProps", "bProps", "aProps", "className", "style", "onChange"];
8619
- var EditableInputRGBA = /*#__PURE__*/React.forwardRef((props, ref) => {
8623
+ var EditableInputRGBA = /*#__PURE__*/React$1.forwardRef((props, ref) => {
8620
8624
  var {
8621
8625
  prefixCls = 'w-color-editable-input-rgba',
8622
8626
  hsva,
@@ -8736,7 +8740,7 @@
8736
8740
  EditableInputRGBA.displayName = 'EditableInputRGBA';
8737
8741
 
8738
8742
  var _excluded$2 = ["prefixCls", "className", "hue", "onChange", "direction"];
8739
- var Hue = /*#__PURE__*/React.forwardRef((props, ref) => {
8743
+ var Hue = /*#__PURE__*/React$1.forwardRef((props, ref) => {
8740
8744
  var {
8741
8745
  prefixCls = 'w-color-hue',
8742
8746
  className,
@@ -8767,7 +8771,7 @@
8767
8771
  Hue.displayName = 'Hue';
8768
8772
 
8769
8773
  var _excluded$1 = ["prefixCls", "className", "color", "colors", "style", "rectProps", "onChange", "addonAfter", "addonBefore", "rectRender"];
8770
- var Swatch = /*#__PURE__*/React.forwardRef((props, ref) => {
8774
+ var Swatch = /*#__PURE__*/React$1.forwardRef((props, ref) => {
8771
8775
  var {
8772
8776
  prefixCls = 'w-color-swatch',
8773
8777
  className,
@@ -8805,7 +8809,7 @@
8805
8809
  flexWrap: 'wrap',
8806
8810
  position: 'relative'
8807
8811
  }, style),
8808
- children: [addonBefore && /*#__PURE__*/React.isValidElement(addonBefore) && addonBefore, colors && Array.isArray(colors) && colors.map((item, idx) => {
8812
+ children: [addonBefore && /*#__PURE__*/React$1.isValidElement(addonBefore) && addonBefore, colors && Array.isArray(colors) && colors.map((item, idx) => {
8809
8813
  var title = '';
8810
8814
  var background = '';
8811
8815
  if (typeof item === 'string') {
@@ -8827,11 +8831,11 @@
8827
8831
  onClick: evn => handleClick(background, evn)
8828
8832
  });
8829
8833
  if (render) {
8830
- return /*#__PURE__*/jsxRuntime.jsx(React.Fragment, {
8834
+ return /*#__PURE__*/jsxRuntime.jsx(React$1.Fragment, {
8831
8835
  children: render
8832
8836
  }, idx);
8833
8837
  }
8834
- var child = rectProps.children && /*#__PURE__*/React.isValidElement(rectProps.children) ? /*#__PURE__*/React.cloneElement(rectProps.children, {
8838
+ var child = rectProps.children && /*#__PURE__*/React$1.isValidElement(rectProps.children) ? /*#__PURE__*/React$1.cloneElement(rectProps.children, {
8835
8839
  color: background,
8836
8840
  checked
8837
8841
  }) : null;
@@ -8845,7 +8849,7 @@
8845
8849
  background
8846
8850
  })
8847
8851
  }), idx);
8848
- }), addonAfter && /*#__PURE__*/React.isValidElement(addonAfter) && addonAfter]
8852
+ }), addonAfter && /*#__PURE__*/React$1.isValidElement(addonAfter) && addonAfter]
8849
8853
  }));
8850
8854
  });
8851
8855
  Swatch.displayName = 'Swatch';
@@ -8864,7 +8868,7 @@
8864
8868
  backgroundColor: '#fff'
8865
8869
  }
8866
8870
  });
8867
- var Sketch = /*#__PURE__*/React.forwardRef((props, ref) => {
8871
+ var Sketch = /*#__PURE__*/React$1.forwardRef((props, ref) => {
8868
8872
  var {
8869
8873
  prefixCls = 'w-color-sketch',
8870
8874
  className,
@@ -8877,13 +8881,13 @@
8877
8881
  style
8878
8882
  } = props,
8879
8883
  other = _objectWithoutPropertiesLoose(props, _excluded);
8880
- var [hsva, setHsva] = React.useState({
8884
+ var [hsva, setHsva] = React$1.useState({
8881
8885
  h: 209,
8882
8886
  s: 36,
8883
8887
  v: 90,
8884
8888
  a: 1
8885
8889
  });
8886
- React.useEffect(() => {
8890
+ React$1.useEffect(() => {
8887
8891
  if (typeof color$1 === 'string' && validHex$1(color$1)) {
8888
8892
  setHsva(hexToHsva(color$1));
8889
8893
  }
@@ -9001,7 +9005,7 @@
9001
9005
  innerProps: {
9002
9006
  style: styleAlpha
9003
9007
  },
9004
- pointer: () => /*#__PURE__*/jsxRuntime.jsx(React.Fragment, {})
9008
+ pointer: () => /*#__PURE__*/jsxRuntime.jsx(React$1.Fragment, {})
9005
9009
  })]
9006
9010
  })]
9007
9011
  }), editableDisable && /*#__PURE__*/jsxRuntime.jsxs("div", {
@@ -9044,51 +9048,42 @@
9044
9048
  onChange,
9045
9049
  disableAlpha = false
9046
9050
  } = props;
9047
- return /*#__PURE__*/jsxRuntime.jsxs(Popover, {
9048
- children: [/*#__PURE__*/jsxRuntime.jsx(PopoverTrigger, {
9049
- asChild: true,
9050
- children: /*#__PURE__*/jsxRuntime.jsxs(Button, {
9051
- "aria-label": "Select color",
9052
- className: 'h-8 w-full justify-start gap-2 bg-transparent px-2 py-[5px] text-left font-normal text-xs',
9053
- variant: 'outline',
9054
- children: [/*#__PURE__*/jsxRuntime.jsx("div", {
9055
- "aria-label": "Current color",
9056
- className: "h-3.5 w-3.5 rounded-full border border-muted-foreground",
9057
- style: {
9058
- backgroundColor: value ?? initialValue
9059
- }
9060
- }), /*#__PURE__*/jsxRuntime.jsx("span", {
9061
- className: "truncate font-mono",
9062
- children: value ?? initialValue
9063
- })]
9064
- })
9065
- }), /*#__PURE__*/jsxRuntime.jsx(PopoverContent, {
9066
- align: "start",
9067
- className: "w-auto p-0",
9068
- children: /*#__PURE__*/jsxRuntime.jsx(Sketch, {
9069
- color: value,
9070
- disableAlpha: disableAlpha,
9071
- onChange: res => onChange(res.hexa),
9072
- presetColors: []
9073
- })
9074
- })]
9075
- });
9051
+ return /*#__PURE__*/React.createElement(Popover, null, /*#__PURE__*/React.createElement(PopoverTrigger, {
9052
+ asChild: true
9053
+ }, /*#__PURE__*/React.createElement(Button, {
9054
+ "aria-label": "Select color",
9055
+ className: 'h-8 w-full justify-start gap-2 bg-transparent px-2 py-[5px] text-left font-normal text-xs',
9056
+ variant: 'outline'
9057
+ }, /*#__PURE__*/React.createElement("div", {
9058
+ "aria-label": "Current color",
9059
+ className: "h-3.5 w-3.5 rounded-full border border-muted-foreground",
9060
+ style: {
9061
+ backgroundColor: value ?? initialValue
9062
+ }
9063
+ }), /*#__PURE__*/React.createElement("span", {
9064
+ className: "truncate font-mono"
9065
+ }, value ?? initialValue))), /*#__PURE__*/React.createElement(PopoverContent, {
9066
+ align: "start",
9067
+ className: "w-auto p-0"
9068
+ }, /*#__PURE__*/React.createElement(Sketch, {
9069
+ color: value,
9070
+ disableAlpha: disableAlpha,
9071
+ onChange: res => onChange(res.hexa),
9072
+ presetColors: []
9073
+ })));
9076
9074
  };
9077
9075
 
9078
9076
  const NodeIdSetter = props => {
9079
9077
  const {
9080
9078
  selected
9081
9079
  } = props;
9082
- return /*#__PURE__*/jsxRuntime.jsxs("div", {
9083
- className: "flex flex-col",
9084
- children: [/*#__PURE__*/jsxRuntime.jsx("p", {
9085
- className: "leading-7",
9086
- children: selected.id
9087
- }), /*#__PURE__*/jsxRuntime.jsx("p", {
9088
- className: "text-muted-foreground text-xs",
9089
- children: selected.componentMeta.title
9090
- })]
9091
- });
9080
+ return /*#__PURE__*/React.createElement("div", {
9081
+ className: "flex flex-col"
9082
+ }, /*#__PURE__*/React.createElement("p", {
9083
+ className: "leading-7"
9084
+ }, selected.id), /*#__PURE__*/React.createElement("p", {
9085
+ className: "text-muted-foreground text-xs"
9086
+ }, selected.componentMeta.title));
9092
9087
  };
9093
9088
 
9094
9089
  function Input({
@@ -9096,12 +9091,11 @@
9096
9091
  type,
9097
9092
  ...props
9098
9093
  }) {
9099
- return /*#__PURE__*/jsxRuntime.jsx("input", {
9094
+ return /*#__PURE__*/React__namespace.createElement("input", _extends$1({
9100
9095
  type: type,
9101
9096
  "data-slot": "input",
9102
- className: cn("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm", "focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]", "aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive", className),
9103
- ...props
9104
- });
9097
+ className: cn("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm", "focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]", "aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive", className)
9098
+ }, props));
9105
9099
  }
9106
9100
 
9107
9101
  const NumberSetter = props => {
@@ -9112,20 +9106,18 @@
9112
9106
  onChange,
9113
9107
  suffix
9114
9108
  } = props;
9115
- return /*#__PURE__*/jsxRuntime.jsxs("div", {
9116
- className: "relative w-full",
9117
- children: [/*#__PURE__*/jsxRuntime.jsx(Input, {
9118
- className: cn('h-8 px-2 py-[5px] pr-8 text-xs! [-moz-appearance:textfield] [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none', !!suffix && 'pr-8'),
9119
- onChange: e => onChange(+e.target.value),
9120
- placeholder: placeholder || '',
9121
- type: "number",
9122
- value: value ?? initialValue
9123
- }), !!suffix && /*#__PURE__*/jsxRuntime.jsx("span", {
9124
- "aria-label": `Unit: ${suffix}`,
9125
- className: "pointer-events-none absolute top-1/2 right-3 -translate-y-1/2 text-muted-foreground",
9126
- children: suffix
9127
- })]
9128
- });
9109
+ return /*#__PURE__*/React.createElement("div", {
9110
+ className: "relative w-full"
9111
+ }, /*#__PURE__*/React.createElement(Input, {
9112
+ className: cn('h-8 px-2 py-[5px] pr-8 text-xs! [-moz-appearance:textfield] [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none', !!suffix && 'pr-8'),
9113
+ onChange: e => onChange(+e.target.value),
9114
+ placeholder: placeholder || '',
9115
+ type: "number",
9116
+ value: value ?? initialValue
9117
+ }), !!suffix && /*#__PURE__*/React.createElement("span", {
9118
+ "aria-label": `Unit: ${suffix}`,
9119
+ className: "pointer-events-none absolute top-1/2 right-3 -translate-y-1/2 text-muted-foreground"
9120
+ }, suffix));
9129
9121
  };
9130
9122
 
9131
9123
  const RectSetter = props => {
@@ -9139,58 +9131,49 @@
9139
9131
  [key]: newValue
9140
9132
  });
9141
9133
  };
9142
- return /*#__PURE__*/jsxRuntime.jsxs("div", {
9143
- className: "flex w-full flex-wrap gap-2",
9144
- children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
9145
- className: "relative w-[calc(50%-4px)]",
9146
- children: [/*#__PURE__*/jsxRuntime.jsx(Input, {
9147
- className: "h-8 px-2 py-[5px] pr-8 text-xs! [-moz-appearance:textfield] [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none",
9148
- onChange: e => handleChange('x', Number(e.target.value)),
9149
- type: "number",
9150
- value: formatDecimal(value.x)
9151
- }), /*#__PURE__*/jsxRuntime.jsx("span", {
9152
- "aria-label": 'Unit: X',
9153
- className: "pointer-events-none absolute top-1/2 right-3 -translate-y-1/2 text-muted-foreground",
9154
- children: "X"
9155
- })]
9156
- }), /*#__PURE__*/jsxRuntime.jsxs("div", {
9157
- className: "relative w-[calc(50%-4px)]",
9158
- children: [/*#__PURE__*/jsxRuntime.jsx(Input, {
9159
- className: "h-8 px-2 py-[5px] pr-8 text-xs! [-moz-appearance:textfield] [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none",
9160
- onChange: e => handleChange('y', Number(e.target.value)),
9161
- type: "number",
9162
- value: formatDecimal(value.y)
9163
- }), /*#__PURE__*/jsxRuntime.jsx("span", {
9164
- "aria-label": 'Unit: Y',
9165
- className: "pointer-events-none absolute top-1/2 right-3 -translate-y-1/2 text-muted-foreground",
9166
- children: "Y"
9167
- })]
9168
- }), /*#__PURE__*/jsxRuntime.jsxs("div", {
9169
- className: "relative w-[calc(50%-4px)]",
9170
- children: [/*#__PURE__*/jsxRuntime.jsx(Input, {
9171
- className: "h-8 px-2 py-[5px] pr-8 text-xs! [-moz-appearance:textfield] [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none",
9172
- onChange: e => handleChange('width', Number(e.target.value)),
9173
- type: "number",
9174
- value: formatDecimal(value.width)
9175
- }), /*#__PURE__*/jsxRuntime.jsx("span", {
9176
- "aria-label": 'Unit: W',
9177
- className: "pointer-events-none absolute top-1/2 right-3 -translate-y-1/2 text-muted-foreground",
9178
- children: "W"
9179
- })]
9180
- }), /*#__PURE__*/jsxRuntime.jsxs("div", {
9181
- className: "relative w-[calc(50%-4px)]",
9182
- children: [/*#__PURE__*/jsxRuntime.jsx(Input, {
9183
- className: "h-8 px-2 py-[5px] pr-8 text-xs! [-moz-appearance:textfield] [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none",
9184
- onChange: e => handleChange('height', Number(e.target.value)),
9185
- type: "number",
9186
- value: formatDecimal(value.height)
9187
- }), /*#__PURE__*/jsxRuntime.jsx("span", {
9188
- "aria-label": 'Unit: H',
9189
- className: "pointer-events-none absolute top-1/2 right-3 -translate-y-1/2 text-muted-foreground",
9190
- children: "H"
9191
- })]
9192
- })]
9193
- });
9134
+ return /*#__PURE__*/React.createElement("div", {
9135
+ className: "flex w-full flex-wrap gap-2"
9136
+ }, /*#__PURE__*/React.createElement("div", {
9137
+ className: "relative w-[calc(50%-4px)]"
9138
+ }, /*#__PURE__*/React.createElement(Input, {
9139
+ className: "h-8 px-2 py-[5px] pr-8 text-xs! [-moz-appearance:textfield] [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none",
9140
+ onChange: e => handleChange('x', Number(e.target.value)),
9141
+ type: "number",
9142
+ value: formatDecimal(value.x)
9143
+ }), /*#__PURE__*/React.createElement("span", {
9144
+ "aria-label": 'Unit: X',
9145
+ className: "pointer-events-none absolute top-1/2 right-3 -translate-y-1/2 text-muted-foreground"
9146
+ }, "X")), /*#__PURE__*/React.createElement("div", {
9147
+ className: "relative w-[calc(50%-4px)]"
9148
+ }, /*#__PURE__*/React.createElement(Input, {
9149
+ className: "h-8 px-2 py-[5px] pr-8 text-xs! [-moz-appearance:textfield] [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none",
9150
+ onChange: e => handleChange('y', Number(e.target.value)),
9151
+ type: "number",
9152
+ value: formatDecimal(value.y)
9153
+ }), /*#__PURE__*/React.createElement("span", {
9154
+ "aria-label": 'Unit: Y',
9155
+ className: "pointer-events-none absolute top-1/2 right-3 -translate-y-1/2 text-muted-foreground"
9156
+ }, "Y")), /*#__PURE__*/React.createElement("div", {
9157
+ className: "relative w-[calc(50%-4px)]"
9158
+ }, /*#__PURE__*/React.createElement(Input, {
9159
+ className: "h-8 px-2 py-[5px] pr-8 text-xs! [-moz-appearance:textfield] [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none",
9160
+ onChange: e => handleChange('width', Number(e.target.value)),
9161
+ type: "number",
9162
+ value: formatDecimal(value.width)
9163
+ }), /*#__PURE__*/React.createElement("span", {
9164
+ "aria-label": 'Unit: W',
9165
+ className: "pointer-events-none absolute top-1/2 right-3 -translate-y-1/2 text-muted-foreground"
9166
+ }, "W")), /*#__PURE__*/React.createElement("div", {
9167
+ className: "relative w-[calc(50%-4px)]"
9168
+ }, /*#__PURE__*/React.createElement(Input, {
9169
+ className: "h-8 px-2 py-[5px] pr-8 text-xs! [-moz-appearance:textfield] [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none",
9170
+ onChange: e => handleChange('height', Number(e.target.value)),
9171
+ type: "number",
9172
+ value: formatDecimal(value.height)
9173
+ }), /*#__PURE__*/React.createElement("span", {
9174
+ "aria-label": 'Unit: H',
9175
+ className: "pointer-events-none absolute top-1/2 right-3 -translate-y-1/2 text-muted-foreground"
9176
+ }, "H")));
9194
9177
  };
9195
9178
  const decimalRegex = /(\.\d{2})\d+$/;
9196
9179
  const formatDecimal = num => num.toString().replace(decimalRegex, '$1');
@@ -9203,19 +9186,17 @@
9203
9186
  onChange,
9204
9187
  suffix
9205
9188
  } = props;
9206
- return /*#__PURE__*/jsxRuntime.jsxs("div", {
9207
- className: "relative w-full",
9208
- children: [/*#__PURE__*/jsxRuntime.jsx(Input, {
9209
- className: cn('h-8 px-2 py-[5px] text-xs!', !!suffix && 'pr-8'),
9210
- onChange: e => onChange(e.target.value),
9211
- placeholder: placeholder || '',
9212
- value: value || initialValue
9213
- }), !!suffix && /*#__PURE__*/jsxRuntime.jsx("span", {
9214
- "aria-label": `Unit: ${suffix}`,
9215
- className: "pointer-events-none absolute top-1/2 right-3 -translate-y-1/2 text-muted-foreground",
9216
- children: suffix
9217
- })]
9218
- });
9189
+ return /*#__PURE__*/React.createElement("div", {
9190
+ className: "relative w-full"
9191
+ }, /*#__PURE__*/React.createElement(Input, {
9192
+ className: cn('h-8 px-2 py-[5px] text-xs!', !!suffix && 'pr-8'),
9193
+ onChange: e => onChange(e.target.value),
9194
+ placeholder: placeholder || '',
9195
+ value: value || initialValue
9196
+ }), !!suffix && /*#__PURE__*/React.createElement("span", {
9197
+ "aria-label": `Unit: ${suffix}`,
9198
+ className: "pointer-events-none absolute top-1/2 right-3 -translate-y-1/2 text-muted-foreground"
9199
+ }, suffix));
9219
9200
  };
9220
9201
 
9221
9202
  // packages/react/use-previous/src/use-previous.tsx
@@ -9375,15 +9356,13 @@
9375
9356
  className,
9376
9357
  ...props
9377
9358
  }) {
9378
- return /*#__PURE__*/jsxRuntime.jsx(Root$2, {
9359
+ return /*#__PURE__*/React__namespace.createElement(Root$2, _extends$1({
9379
9360
  "data-slot": "switch",
9380
- className: cn("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50", className),
9381
- ...props,
9382
- children: /*#__PURE__*/jsxRuntime.jsx(Thumb, {
9383
- "data-slot": "switch-thumb",
9384
- className: cn("bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")
9385
- })
9386
- });
9361
+ className: cn("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50", className)
9362
+ }, props), /*#__PURE__*/React__namespace.createElement(Thumb, {
9363
+ "data-slot": "switch-thumb",
9364
+ className: cn("bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")
9365
+ }));
9387
9366
  }
9388
9367
 
9389
9368
  const SwitchSetter = props => {
@@ -9392,13 +9371,12 @@
9392
9371
  initialValue,
9393
9372
  onChange
9394
9373
  } = props;
9395
- return /*#__PURE__*/jsxRuntime.jsx("div", {
9396
- className: "py-0.5",
9397
- children: /*#__PURE__*/jsxRuntime.jsx(Switch, {
9398
- checked: value || initialValue,
9399
- onCheckedChange: onChange
9400
- })
9401
- });
9374
+ return /*#__PURE__*/React.createElement("div", {
9375
+ className: "py-0.5"
9376
+ }, /*#__PURE__*/React.createElement(Switch, {
9377
+ checked: value || initialValue,
9378
+ onCheckedChange: onChange
9379
+ }));
9402
9380
  };
9403
9381
 
9404
9382
  /**
@@ -9448,7 +9426,7 @@
9448
9426
  * This source code is licensed under the ISC license.
9449
9427
  * See the LICENSE file in the root directory of this source tree.
9450
9428
  */
9451
- const Icon = /*#__PURE__*/React.forwardRef(({
9429
+ const Icon = /*#__PURE__*/React$1.forwardRef(({
9452
9430
  color = "currentColor",
9453
9431
  size = 24,
9454
9432
  strokeWidth = 2,
@@ -9457,7 +9435,7 @@
9457
9435
  children,
9458
9436
  iconNode,
9459
9437
  ...rest
9460
- }, ref) => /*#__PURE__*/React.createElement("svg", {
9438
+ }, ref) => /*#__PURE__*/React$1.createElement("svg", {
9461
9439
  ref,
9462
9440
  ...defaultAttributes,
9463
9441
  width: size,
@@ -9469,7 +9447,7 @@
9469
9447
  "aria-hidden": "true"
9470
9448
  }),
9471
9449
  ...rest
9472
- }, [...iconNode.map(([tag, attrs]) => /*#__PURE__*/React.createElement(tag, attrs)), ...(Array.isArray(children) ? children : [children])]));
9450
+ }, [...iconNode.map(([tag, attrs]) => /*#__PURE__*/React$1.createElement(tag, attrs)), ...(Array.isArray(children) ? children : [children])]));
9473
9451
 
9474
9452
  /**
9475
9453
  * @license lucide-react v0.561.0 - ISC
@@ -9478,10 +9456,10 @@
9478
9456
  * See the LICENSE file in the root directory of this source tree.
9479
9457
  */
9480
9458
  const createLucideIcon = (iconName, iconNode) => {
9481
- const Component = /*#__PURE__*/React.forwardRef(({
9459
+ const Component = /*#__PURE__*/React$1.forwardRef(({
9482
9460
  className,
9483
9461
  ...props
9484
- }, ref) => /*#__PURE__*/React.createElement(Icon, {
9462
+ }, ref) => /*#__PURE__*/React$1.createElement(Icon, {
9485
9463
  ref,
9486
9464
  iconNode,
9487
9465
  className: mergeClasses(`lucide-${toKebabCase(toPascalCase(iconName))}`, `lucide-${iconName}`, className),
@@ -9546,8 +9524,8 @@
9546
9524
  accept = '.jpg,.jpeg,.png,.gif',
9547
9525
  maxSize = 10 * 1024 * 1024
9548
9526
  } = props;
9549
- const [error, setError] = React.useState('');
9550
- const inputRef = React.useRef(null);
9527
+ const [error, setError] = React$1.useState('');
9528
+ const inputRef = React$1.useRef(null);
9551
9529
  const handleFileChange = async e => {
9552
9530
  const file = e.target.files?.[0];
9553
9531
  setError('');
@@ -9610,52 +9588,41 @@
9610
9588
  inputRef.current.value = '';
9611
9589
  }
9612
9590
  };
9613
- return /*#__PURE__*/jsxRuntime.jsxs("div", {
9614
- className: "group relative w-full overflow-hidden",
9615
- children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
9616
- className: "flex gap-2",
9617
- children: [/*#__PURE__*/jsxRuntime.jsxs("label", {
9618
- className: "flex-1 cursor-pointer",
9619
- children: [/*#__PURE__*/jsxRuntime.jsx("input", {
9620
- accept: accept,
9621
- className: cn('h-8 cursor-pointer px-2 py-[5px] text-xs', 'border-dashed transition-colors hover:border-primary', 'absolute h-0 w-0 opacity-0'),
9622
- onChange: handleFileChange,
9623
- ref: inputRef,
9624
- type: "file"
9625
- }), /*#__PURE__*/jsxRuntime.jsxs("div", {
9626
- className: "flex h-8 w-full items-center justify-center rounded-md border border-dashed text-muted-foreground text-xs transition-colors hover:border-primary",
9627
- children: [/*#__PURE__*/jsxRuntime.jsx(Upload, {
9628
- className: "mr-2 h-4 w-4"
9629
- }), /*#__PURE__*/jsxRuntime.jsx("span", {
9630
- children: value ? '更换文件' : '点击上传'
9631
- })]
9632
- })]
9633
- }), !!value && /*#__PURE__*/jsxRuntime.jsx(Button, {
9634
- "aria-label": "\u6E05\u9664\u6587\u4EF6",
9635
- className: "h-8 px-2 text-muted-foreground hover:text-destructive",
9636
- onClick: handleClear,
9637
- size: "sm",
9638
- type: "button",
9639
- variant: "ghost",
9640
- children: /*#__PURE__*/jsxRuntime.jsx(X, {
9641
- className: "h-4 w-4"
9642
- })
9643
- })]
9644
- }), !!value && /*#__PURE__*/jsxRuntime.jsxs("div", {
9645
- className: "mt-2 flex w-full items-center gap-2 text-foreground/80 text-xs",
9646
- children: [/*#__PURE__*/jsxRuntime.jsx("span", {
9647
- className: "min-w-0 flex-1 truncate",
9648
- children: value.raw?.name
9649
- }), /*#__PURE__*/jsxRuntime.jsxs("span", {
9650
- className: "shrink-0 whitespace-nowrap text-muted-foreground/50",
9651
- children: [(value.raw?.size / 1024).toFixed(1), "KB"]
9652
- })]
9653
- }), !!error && /*#__PURE__*/jsxRuntime.jsx("p", {
9654
- className: "mt-1 text-destructive text-xs",
9655
- role: "alert",
9656
- children: error
9657
- })]
9658
- });
9591
+ return /*#__PURE__*/React.createElement("div", {
9592
+ className: "group relative w-full overflow-hidden"
9593
+ }, /*#__PURE__*/React.createElement("div", {
9594
+ className: "flex gap-2"
9595
+ }, /*#__PURE__*/React.createElement("label", {
9596
+ className: "flex-1 cursor-pointer"
9597
+ }, /*#__PURE__*/React.createElement("input", {
9598
+ accept: accept,
9599
+ className: cn('h-8 cursor-pointer px-2 py-[5px] text-xs', 'border-dashed transition-colors hover:border-primary', 'absolute h-0 w-0 opacity-0'),
9600
+ onChange: handleFileChange,
9601
+ ref: inputRef,
9602
+ type: "file"
9603
+ }), /*#__PURE__*/React.createElement("div", {
9604
+ className: "flex h-8 w-full items-center justify-center rounded-md border border-dashed text-muted-foreground text-xs transition-colors hover:border-primary"
9605
+ }, /*#__PURE__*/React.createElement(Upload, {
9606
+ className: "mr-2 h-4 w-4"
9607
+ }), /*#__PURE__*/React.createElement("span", null, value ? '更换文件' : '点击上传'))), !!value && /*#__PURE__*/React.createElement(Button, {
9608
+ "aria-label": "\u6E05\u9664\u6587\u4EF6",
9609
+ className: "h-8 px-2 text-muted-foreground hover:text-destructive",
9610
+ onClick: handleClear,
9611
+ size: "sm",
9612
+ type: "button",
9613
+ variant: "ghost"
9614
+ }, /*#__PURE__*/React.createElement(X, {
9615
+ className: "h-4 w-4"
9616
+ }))), !!value && /*#__PURE__*/React.createElement("div", {
9617
+ className: "mt-2 flex w-full items-center gap-2 text-foreground/80 text-xs"
9618
+ }, /*#__PURE__*/React.createElement("span", {
9619
+ className: "min-w-0 flex-1 truncate"
9620
+ }, value.raw?.name), /*#__PURE__*/React.createElement("span", {
9621
+ className: "shrink-0 whitespace-nowrap text-muted-foreground/50"
9622
+ }, (value.raw?.size / 1024).toFixed(1), "KB")), !!error && /*#__PURE__*/React.createElement("p", {
9623
+ className: "mt-1 text-destructive text-xs",
9624
+ role: "alert"
9625
+ }, error));
9659
9626
  };
9660
9627
 
9661
9628
  var COLLAPSIBLE_NAME = "Collapsible";
@@ -9792,26 +9759,23 @@
9792
9759
  function Collapsible({
9793
9760
  ...props
9794
9761
  }) {
9795
- return /*#__PURE__*/jsxRuntime.jsx(Root$1, {
9796
- "data-slot": "collapsible",
9797
- ...props
9798
- });
9762
+ return /*#__PURE__*/React.createElement(Root$1, _extends$1({
9763
+ "data-slot": "collapsible"
9764
+ }, props));
9799
9765
  }
9800
9766
  function CollapsibleTrigger({
9801
9767
  ...props
9802
9768
  }) {
9803
- return /*#__PURE__*/jsxRuntime.jsx(CollapsibleTrigger$1, {
9804
- "data-slot": "collapsible-trigger",
9805
- ...props
9806
- });
9769
+ return /*#__PURE__*/React.createElement(CollapsibleTrigger$1, _extends$1({
9770
+ "data-slot": "collapsible-trigger"
9771
+ }, props));
9807
9772
  }
9808
9773
  function CollapsibleContent({
9809
9774
  ...props
9810
9775
  }) {
9811
- return /*#__PURE__*/jsxRuntime.jsx(CollapsibleContent$1, {
9812
- "data-slot": "collapsible-content",
9813
- ...props
9814
- });
9776
+ return /*#__PURE__*/React.createElement(CollapsibleContent$1, _extends$1({
9777
+ "data-slot": "collapsible-content"
9778
+ }, props));
9815
9779
  }
9816
9780
 
9817
9781
  const CollapseSetter = props => {
@@ -9821,33 +9785,25 @@
9821
9785
  initialValue,
9822
9786
  icon = true
9823
9787
  } = props;
9824
- const [isOpen, setIsOpen] = React.useState(initialValue ?? true);
9825
- return /*#__PURE__*/jsxRuntime.jsxs(Collapsible, {
9788
+ const [isOpen, setIsOpen] = React$1.useState(initialValue ?? true);
9789
+ return /*#__PURE__*/React.createElement(Collapsible, {
9826
9790
  className: "w-[calc(100%+32px)] -translate-x-4 space-y-2",
9827
9791
  onOpenChange: setIsOpen,
9828
- open: isOpen,
9829
- children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
9830
- className: "flex h-8 items-center justify-between space-x-4 bg-muted px-4",
9831
- children: [/*#__PURE__*/jsxRuntime.jsx("h4", {
9832
- children: field.title
9833
- }), !!icon && /*#__PURE__*/jsxRuntime.jsx(CollapsibleTrigger, {
9834
- asChild: true,
9835
- children: /*#__PURE__*/jsxRuntime.jsxs(Button, {
9836
- size: "sm",
9837
- variant: "ghost",
9838
- children: [/*#__PURE__*/jsxRuntime.jsx(ChevronsUpDown, {
9839
- className: "h-4 w-4"
9840
- }), /*#__PURE__*/jsxRuntime.jsx("span", {
9841
- className: "sr-only",
9842
- children: "Toggle"
9843
- })]
9844
- })
9845
- })]
9846
- }), /*#__PURE__*/jsxRuntime.jsx(CollapsibleContent, {
9847
- className: "space-y-3 px-4 py-2",
9848
- children: children
9849
- })]
9850
- });
9792
+ open: isOpen
9793
+ }, /*#__PURE__*/React.createElement("div", {
9794
+ className: "flex h-8 items-center justify-between space-x-4 bg-muted px-4"
9795
+ }, /*#__PURE__*/React.createElement("h4", null, field.title), !!icon && /*#__PURE__*/React.createElement(CollapsibleTrigger, {
9796
+ asChild: true
9797
+ }, /*#__PURE__*/React.createElement(Button, {
9798
+ size: "sm",
9799
+ variant: "ghost"
9800
+ }, /*#__PURE__*/React.createElement(ChevronsUpDown, {
9801
+ className: "h-4 w-4"
9802
+ }), /*#__PURE__*/React.createElement("span", {
9803
+ className: "sr-only"
9804
+ }, "Toggle")))), /*#__PURE__*/React.createElement(CollapsibleContent, {
9805
+ className: "space-y-3 px-4 py-2"
9806
+ }, children));
9851
9807
  };
9852
9808
 
9853
9809
  function createCollection(name) {
@@ -9859,14 +9815,14 @@
9859
9815
  );
9860
9816
  const CollectionProvider = (props) => {
9861
9817
  const { scope, children } = props;
9862
- const ref = React.useRef(null);
9863
- const itemMap = React.useRef(/* @__PURE__ */ new Map()).current;
9818
+ const ref = React$1.useRef(null);
9819
+ const itemMap = React$1.useRef(/* @__PURE__ */ new Map()).current;
9864
9820
  return /* @__PURE__ */ jsxRuntime.jsx(CollectionProviderImpl, { scope, itemMap, collectionRef: ref, children });
9865
9821
  };
9866
9822
  CollectionProvider.displayName = PROVIDER_NAME;
9867
9823
  const COLLECTION_SLOT_NAME = name + "CollectionSlot";
9868
9824
  const CollectionSlotImpl = createSlot(COLLECTION_SLOT_NAME);
9869
- const CollectionSlot = React.forwardRef(
9825
+ const CollectionSlot = React$1.forwardRef(
9870
9826
  (props, forwardedRef) => {
9871
9827
  const { scope, children } = props;
9872
9828
  const context = useCollectionContext(COLLECTION_SLOT_NAME, scope);
@@ -9878,13 +9834,13 @@
9878
9834
  const ITEM_SLOT_NAME = name + "CollectionItemSlot";
9879
9835
  const ITEM_DATA_ATTR = "data-radix-collection-item";
9880
9836
  const CollectionItemSlotImpl = createSlot(ITEM_SLOT_NAME);
9881
- const CollectionItemSlot = React.forwardRef(
9837
+ const CollectionItemSlot = React$1.forwardRef(
9882
9838
  (props, forwardedRef) => {
9883
9839
  const { scope, children, ...itemData } = props;
9884
- const ref = React.useRef(null);
9840
+ const ref = React$1.useRef(null);
9885
9841
  const composedRefs = useComposedRefs(forwardedRef, ref);
9886
9842
  const context = useCollectionContext(ITEM_SLOT_NAME, scope);
9887
- React.useEffect(() => {
9843
+ React$1.useEffect(() => {
9888
9844
  context.itemMap.set(ref, { ref, ...itemData });
9889
9845
  return () => void context.itemMap.delete(ref);
9890
9846
  });
@@ -9894,7 +9850,7 @@
9894
9850
  CollectionItemSlot.displayName = ITEM_SLOT_NAME;
9895
9851
  function useCollection(scope) {
9896
9852
  const context = useCollectionContext(name + "CollectionConsumer", scope);
9897
- const getItems = React.useCallback(() => {
9853
+ const getItems = React$1.useCallback(() => {
9898
9854
  const collectionNode = context.collectionRef.current;
9899
9855
  if (!collectionNode) return [];
9900
9856
  const orderedNodes = Array.from(collectionNode.querySelectorAll(`[${ITEM_DATA_ATTR}]`));
@@ -10309,41 +10265,37 @@
10309
10265
  className,
10310
10266
  ...props
10311
10267
  }) {
10312
- return /*#__PURE__*/jsxRuntime.jsx(Root2, {
10268
+ return /*#__PURE__*/React__namespace.createElement(Root2, _extends$1({
10313
10269
  "data-slot": "tabs",
10314
- className: cn("flex flex-col gap-2", className),
10315
- ...props
10316
- });
10270
+ className: cn("flex flex-col gap-2", className)
10271
+ }, props));
10317
10272
  }
10318
10273
  function TabsList({
10319
10274
  className,
10320
10275
  ...props
10321
10276
  }) {
10322
- return /*#__PURE__*/jsxRuntime.jsx(List, {
10277
+ return /*#__PURE__*/React__namespace.createElement(List, _extends$1({
10323
10278
  "data-slot": "tabs-list",
10324
- className: cn("bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-[3px]", className),
10325
- ...props
10326
- });
10279
+ className: cn("bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-[3px]", className)
10280
+ }, props));
10327
10281
  }
10328
10282
  function TabsTrigger({
10329
10283
  className,
10330
10284
  ...props
10331
10285
  }) {
10332
- return /*#__PURE__*/jsxRuntime.jsx(Trigger, {
10286
+ return /*#__PURE__*/React__namespace.createElement(Trigger, _extends$1({
10333
10287
  "data-slot": "tabs-trigger",
10334
- className: cn("data-[state=active]:bg-background dark:data-[state=active]:text-foreground focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 text-foreground dark:text-muted-foreground inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
10335
- ...props
10336
- });
10288
+ className: cn("data-[state=active]:bg-background dark:data-[state=active]:text-foreground focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 text-foreground dark:text-muted-foreground inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className)
10289
+ }, props));
10337
10290
  }
10338
10291
  function TabsContent({
10339
10292
  className,
10340
10293
  ...props
10341
10294
  }) {
10342
- return /*#__PURE__*/jsxRuntime.jsx(Content, {
10295
+ return /*#__PURE__*/React__namespace.createElement(Content, _extends$1({
10343
10296
  "data-slot": "tabs-content",
10344
- className: cn("flex-1 outline-none", className),
10345
- ...props
10346
- });
10297
+ className: cn("flex-1 outline-none", className)
10298
+ }, props));
10347
10299
  }
10348
10300
 
10349
10301
  const TabSetter = props => {
@@ -10352,7 +10304,7 @@
10352
10304
  initialValue,
10353
10305
  children
10354
10306
  } = props;
10355
- const tabsList = React.useMemo(() => {
10307
+ const tabsList = React$1.useMemo(() => {
10356
10308
  if (tabs) {
10357
10309
  return tabs;
10358
10310
  }
@@ -10364,25 +10316,23 @@
10364
10316
  }
10365
10317
  throw new Error('TabSetter: children or tabs must be an array');
10366
10318
  }, [tabs, children]);
10367
- const firstTabValue = React.useMemo(() => tabsList[0]?.value, [tabsList]);
10368
- return /*#__PURE__*/jsxRuntime.jsxs(Tabs, {
10319
+ const firstTabValue = React$1.useMemo(() => tabsList[0]?.value, [tabsList]);
10320
+ return /*#__PURE__*/React$1.createElement(Tabs, {
10369
10321
  className: "w-full",
10370
- defaultValue: initialValue ?? firstTabValue,
10371
- children: [/*#__PURE__*/jsxRuntime.jsx(TabsList, {
10372
- className: "grid w-full",
10373
- style: {
10374
- gridTemplateColumns: `repeat(${tabsList.length}, minmax(0, 1fr))`
10375
- },
10376
- children: tabsList.map(tab => /*#__PURE__*/jsxRuntime.jsx(TabsTrigger, {
10377
- value: tab.value,
10378
- children: tab.label
10379
- }, tab.value))
10380
- }), Array.isArray(children) && children.map(child => /*#__PURE__*/jsxRuntime.jsx(TabsContent, {
10381
- className: "mt-0 box-border space-y-3 p-2",
10382
- value: child.props.field.config.key,
10383
- children: child
10384
- }, child.props.field.config.key))]
10385
- });
10322
+ defaultValue: initialValue ?? firstTabValue
10323
+ }, /*#__PURE__*/React$1.createElement(TabsList, {
10324
+ className: "grid w-full",
10325
+ style: {
10326
+ gridTemplateColumns: `repeat(${tabsList.length}, minmax(0, 1fr))`
10327
+ }
10328
+ }, tabsList.map(tab => /*#__PURE__*/React$1.createElement(TabsTrigger, {
10329
+ key: tab.value,
10330
+ value: tab.value
10331
+ }, tab.label))), Array.isArray(children) && children.map(child => /*#__PURE__*/React$1.createElement(TabsContent, {
10332
+ className: "mt-0 box-border space-y-3 p-2",
10333
+ key: child.props.field.config.key,
10334
+ value: child.props.field.config.key
10335
+ }, child)));
10386
10336
  };
10387
10337
 
10388
10338
  const setterMap = {