@noya-app/noya-designsystem 0.1.30 → 0.1.31

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.mjs CHANGED
@@ -1504,6 +1504,10 @@ var StackBase = forwardRef(function StackBase2({
1504
1504
  breakpoints,
1505
1505
  tabIndex,
1506
1506
  href,
1507
+ paddingHorizontal,
1508
+ paddingVertical,
1509
+ padding,
1510
+ style: style5,
1507
1511
  ...rest
1508
1512
  }, forwardedRef) {
1509
1513
  const elements2 = separator ? withSeparatorElements(Children2.toArray(children2), separator) : children2;
@@ -1511,7 +1515,9 @@ var StackBase = forwardRef(function StackBase2({
1511
1515
  display: "flex",
1512
1516
  position: "relative",
1513
1517
  alignItems: "stretch",
1514
- ...rest
1518
+ padding: padding || `${paddingVertical ?? 0} ${paddingHorizontal ?? 0} ${paddingVertical ?? 0} ${paddingHorizontal ?? 0}`,
1519
+ ...rest,
1520
+ ...style5
1515
1521
  };
1516
1522
  return /* @__PURE__ */ React2.createElement(
1517
1523
  Element2,
@@ -1736,8 +1742,8 @@ var ButtonElement = styled5.button(
1736
1742
  background: "white",
1737
1743
  color: theme.colors.text,
1738
1744
  boxShadow: "0 1px 2px rgba(0, 0, 0, 0.1)",
1739
- fontSize: "12px",
1740
- padding: "0px 4px",
1745
+ fontSize: $size === "small" ? "10px" : "12px",
1746
+ padding: $size === "small" ? "0px 2px" : "0px 4px",
1741
1747
  "&:hover": {
1742
1748
  opacity: 0.8
1743
1749
  },
@@ -3269,35 +3275,38 @@ function Popover({
3269
3275
  // src/components/InputField.tsx
3270
3276
  var InputFieldContext = createContext2({
3271
3277
  labelPosition: "end",
3272
- labelSize: 6,
3273
- hasLabel: false,
3278
+ labelSize: void 0,
3279
+ buttonSize: void 0,
3274
3280
  hasDropdown: false,
3275
3281
  size: "medium",
3276
3282
  isFocused: false,
3277
3283
  onFocusChange: () => {
3278
3284
  }
3279
3285
  });
3280
- var LabelContainer = styled12.label(({ theme, $labelPosition, $hasDropdown, pointerEvents }) => ({
3281
- ...theme.textStyles.label,
3282
- fontWeight: "bold",
3283
- color: theme.colors.textDisabled,
3284
- position: "absolute",
3285
- top: 0,
3286
- right: $labelPosition === "end" ? 0 : void 0,
3287
- bottom: 0,
3288
- left: $labelPosition === "start" ? 0 : void 0,
3289
- display: "flex",
3290
- alignItems: "center",
3291
- pointerEvents,
3292
- userSelect: "none",
3293
- ...$labelPosition === "start" ? { justifyContent: "flex-start", paddingLeft: "6px" } : {
3294
- justifyContent: "flex-end",
3295
- paddingRight: $hasDropdown ? "16px" : "6px"
3296
- }
3297
- }));
3286
+ var LabelContainer = styled12.label(({ theme, $labelPosition, $hasDropdown, pointerEvents, $size }) => {
3287
+ const offsetRelativeToSize = $size === "large" ? 6 : $size === "medium" ? 2 : 0;
3288
+ return {
3289
+ ...theme.textStyles.label,
3290
+ fontWeight: "bold",
3291
+ color: theme.colors.textDisabled,
3292
+ position: "absolute",
3293
+ top: 0,
3294
+ bottom: 0,
3295
+ right: $labelPosition === "end" ? offsetRelativeToSize : void 0,
3296
+ left: $labelPosition === "start" ? offsetRelativeToSize : void 0,
3297
+ display: "flex",
3298
+ alignItems: "center",
3299
+ pointerEvents,
3300
+ userSelect: "none",
3301
+ ...$labelPosition === "start" ? { justifyContent: "flex-start", paddingLeft: "6px" } : {
3302
+ justifyContent: "flex-end",
3303
+ paddingRight: $hasDropdown ? "16px" : "6px"
3304
+ }
3305
+ };
3306
+ });
3298
3307
  var InputFieldLabel = memo9(
3299
3308
  forwardRef9(function InputFieldLabel2({ children: children2 = false, pointerEvents = "none", style: style5 }, forwardedRef) {
3300
- const { labelPosition, hasDropdown, setLabelWidth } = useContext2(InputFieldContext);
3309
+ const { labelPosition, hasDropdown, setLabelWidth, size: size3 } = useContext2(InputFieldContext);
3301
3310
  const ref = useRef11(null);
3302
3311
  useLayoutEffect4(() => {
3303
3312
  if (!setLabelWidth)
@@ -3310,6 +3319,7 @@ var InputFieldLabel = memo9(
3310
3319
  return /* @__PURE__ */ React18.createElement(
3311
3320
  LabelContainer,
3312
3321
  {
3322
+ $size: size3,
3313
3323
  ref: (element) => {
3314
3324
  ref.current = element;
3315
3325
  assignRef(forwardedRef, element);
@@ -3346,40 +3356,56 @@ var ButtonContainer = styled12.span(
3346
3356
  ({ theme, $size }) => ({
3347
3357
  position: "absolute",
3348
3358
  right: $size === "large" ? "9px" : $size === "medium" ? "4px" : "2px",
3349
- top: $size === "large" ? "8px" : $size === "medium" ? "4px" : "2px"
3359
+ top: $size === "large" ? "10px" : $size === "medium" ? "4px" : "2px"
3350
3360
  })
3351
3361
  );
3352
- var InputFieldButton = memo9(function InputFieldButton2({
3353
- children: children2,
3354
- onClick
3355
- }) {
3356
- const { size: size3, inputRef } = useContext2(InputFieldContext);
3357
- const defaultHandleClick = useCallback11(
3358
- (event) => {
3359
- if (inputRef && typeof inputRef !== "function") {
3360
- inputRef.current?.focus();
3361
- inputRef.current?.setSelectionRange(0, inputRef.current.value.length);
3362
- }
3362
+ var InputFieldButton = memo9(
3363
+ forwardRef9(function InputFieldButton2({
3364
+ children: children2,
3365
+ onClick
3366
+ }, forwardedRef) {
3367
+ const { size: size3, inputRef, setButtonWidth } = useContext2(InputFieldContext);
3368
+ const ref = useRef11(null);
3369
+ useLayoutEffect4(() => {
3370
+ if (!setButtonWidth)
3371
+ return;
3372
+ const width = ref.current?.getBoundingClientRect().width;
3373
+ if (!width)
3374
+ return;
3375
+ setButtonWidth(width);
3376
+ }, [setButtonWidth]);
3377
+ const defaultHandleClick = useCallback11(
3378
+ (event) => {
3379
+ if (inputRef && typeof inputRef !== "function") {
3380
+ inputRef.current?.focus();
3381
+ inputRef.current?.setSelectionRange(0, inputRef.current.value.length);
3382
+ }
3383
+ event.preventDefault();
3384
+ event.stopPropagation();
3385
+ },
3386
+ [inputRef]
3387
+ );
3388
+ const handlePointerDown = useCallback11((event) => {
3363
3389
  event.preventDefault();
3364
3390
  event.stopPropagation();
3365
- },
3366
- [inputRef]
3367
- );
3368
- const handlePointerDown = useCallback11((event) => {
3369
- event.preventDefault();
3370
- event.stopPropagation();
3371
- }, []);
3372
- return /* @__PURE__ */ React18.createElement(ButtonContainer, { $size: size3 }, /* @__PURE__ */ React18.createElement(
3373
- Button,
3374
- {
3375
- variant: "floating",
3376
- onClick: onClick ?? defaultHandleClick,
3377
- onPointerDown: handlePointerDown,
3378
- tabIndex: -1
3379
- },
3380
- children2
3381
- ));
3382
- });
3391
+ }, []);
3392
+ return /* @__PURE__ */ React18.createElement(ButtonContainer, { $size: size3 }, /* @__PURE__ */ React18.createElement(
3393
+ Button,
3394
+ {
3395
+ ref: (element) => {
3396
+ ref.current = element;
3397
+ assignRef(forwardedRef, element);
3398
+ },
3399
+ variant: "floating",
3400
+ onClick: onClick ?? defaultHandleClick,
3401
+ onPointerDown: handlePointerDown,
3402
+ tabIndex: -1,
3403
+ size: size3 === "medium" ? "normal" : size3
3404
+ },
3405
+ children2
3406
+ ));
3407
+ })
3408
+ );
3383
3409
  var InputElement = styled12(TextInput_default)(({
3384
3410
  theme,
3385
3411
  $labelPosition,
@@ -3387,7 +3413,6 @@ var InputElement = styled12(TextInput_default)(({
3387
3413
  $hasDropdown,
3388
3414
  $textAlign,
3389
3415
  disabled,
3390
- $hasLabel,
3391
3416
  readOnly,
3392
3417
  $variant = "normal",
3393
3418
  $size
@@ -3414,8 +3439,8 @@ var InputElement = styled12(TextInput_default)(({
3414
3439
  borderRadius: "4px",
3415
3440
  paddingTop: $size === "large" ? "10px" : $size === "medium" ? "4px" : "1px",
3416
3441
  paddingBottom: $size === "large" ? "10px" : $size === "medium" ? "4px" : "1px",
3417
- paddingLeft: ($size === "large" ? 10 : $size === "medium" ? 6 : 4) + ($hasLabel && $labelPosition === "start" ? 6 + $labelSize : 0) + "px",
3418
- paddingRight: ($size === "large" ? 10 : $size === "medium" ? 6 : 4) + ($hasLabel && $labelPosition === "end" ? 6 + $labelSize : 0) + ($hasDropdown ? 11 : 0) + "px",
3442
+ paddingLeft: ($size === "large" ? 10 : $size === "medium" ? 6 : 4) + ($labelSize && $labelPosition === "start" ? 6 + $labelSize : 0) + "px",
3443
+ paddingRight: ($size === "large" ? 10 : $size === "medium" ? 6 : 4) + ($labelSize && $labelPosition === "end" ? 6 + $labelSize : 0) + ($hasDropdown ? 11 : 0) + "px",
3419
3444
  background: theme.colors.inputBackground,
3420
3445
  "&:focus": {
3421
3446
  boxShadow: `0 0 0 2px ${theme.colors.primary}`
@@ -3449,7 +3474,7 @@ var InputFieldInput = forwardRef9(function InputFieldInput2({
3449
3474
  labelPosition,
3450
3475
  labelSize,
3451
3476
  hasDropdown,
3452
- hasLabel,
3477
+ buttonSize,
3453
3478
  size: size3,
3454
3479
  onFocusChange,
3455
3480
  setInputRef
@@ -3468,8 +3493,7 @@ var InputFieldInput = forwardRef9(function InputFieldInput2({
3468
3493
  {
3469
3494
  ref: forwardedRef,
3470
3495
  $labelPosition: labelPosition,
3471
- $labelSize: labelSize,
3472
- $hasLabel: hasLabel,
3496
+ $labelSize: labelSize || buttonSize,
3473
3497
  $hasDropdown: hasDropdown,
3474
3498
  $size: size3,
3475
3499
  $variant: variant,
@@ -3484,7 +3508,6 @@ var InputFieldTypeahead = (props) => {
3484
3508
  labelPosition,
3485
3509
  labelSize,
3486
3510
  hasDropdown,
3487
- hasLabel,
3488
3511
  size: size3
3489
3512
  // onFocusChange,
3490
3513
  } = useContext2(InputFieldContext);
@@ -3494,7 +3517,6 @@ var InputFieldTypeahead = (props) => {
3494
3517
  as: "span",
3495
3518
  $labelPosition: labelPosition,
3496
3519
  $labelSize: labelSize,
3497
- $hasLabel: hasLabel,
3498
3520
  $hasDropdown: hasDropdown,
3499
3521
  $size: size3,
3500
3522
  value: "",
@@ -3581,15 +3603,13 @@ function InputFieldNumberInput(props) {
3581
3603
  }
3582
3604
  );
3583
3605
  }
3584
- var RootContainer = styled12.div(
3585
- ({ theme, $flex, $width }) => ({
3586
- flex: $flex ?? "1",
3587
- display: "flex",
3588
- flexDirection: "row",
3589
- position: "relative",
3590
- maxWidth: typeof $width === "number" ? `${$width}px` : void 0
3591
- })
3592
- );
3606
+ var RootContainer = styled12.div(({ theme, $flex, $width }) => ({
3607
+ flex: $flex ?? "1",
3608
+ display: "flex",
3609
+ flexDirection: "row",
3610
+ position: "relative",
3611
+ maxWidth: typeof $width === "number" ? `${$width}px` : void 0
3612
+ }));
3593
3613
  function InputFieldRoot({
3594
3614
  id,
3595
3615
  flex,
@@ -3607,11 +3627,9 @@ function InputFieldRoot({
3607
3627
  const hasDropdown = childrenArray.some(
3608
3628
  (child) => isValidElement2(child) && child.type === InputFieldDropdownMenu
3609
3629
  );
3610
- const hasLabel = childrenArray.some(
3611
- (child) => isValidElement2(child) && child.type === InputFieldLabel
3612
- );
3613
3630
  const [isFocused, setIsFocused] = React18.useState(false);
3614
3631
  const [measuredLabelSize, setMeasuredLabelSize] = React18.useState();
3632
+ const [measuredButtonSize, setMeasuredButtonSize] = React18.useState();
3615
3633
  const [measuredWidth, setMeasuredWidth] = React18.useState();
3616
3634
  const handleFocusChange = useCallback11(
3617
3635
  (isFocused2) => {
@@ -3631,22 +3649,23 @@ function InputFieldRoot({
3631
3649
  const contextValue = useMemo6(
3632
3650
  () => ({
3633
3651
  labelPosition,
3634
- labelSize: measuredLabelSize ?? labelSize ?? 6,
3652
+ labelSize: measuredLabelSize ?? labelSize,
3653
+ buttonSize: measuredButtonSize,
3635
3654
  hasDropdown,
3636
- hasLabel,
3637
3655
  size: size3,
3638
3656
  isFocused,
3639
3657
  onFocusChange: handleFocusChange,
3640
3658
  inputRef,
3641
3659
  setInputRef,
3642
- setLabelWidth: setMeasuredLabelSize
3660
+ setLabelWidth: setMeasuredLabelSize,
3661
+ setButtonWidth: setMeasuredButtonSize
3643
3662
  }),
3644
3663
  [
3645
3664
  labelPosition,
3646
3665
  measuredLabelSize,
3647
3666
  labelSize,
3667
+ measuredButtonSize,
3648
3668
  hasDropdown,
3649
- hasLabel,
3650
3669
  size3,
3651
3670
  isFocused,
3652
3671
  handleFocusChange,
@@ -14625,79 +14644,21 @@ var RadioGroup;
14625
14644
  RadioGroup2.Item = memo27(ToggleGroupItem);
14626
14645
  })(RadioGroup || (RadioGroup = {}));
14627
14646
 
14628
- // src/components/Select.tsx
14629
- import { memoize } from "@noya-app/noya-utils";
14630
- import React64, {
14631
- createContext as createContext11,
14632
- memo as memo28,
14633
- useCallback as useCallback23,
14634
- useContext as useContext11,
14635
- useEffect as useEffect15,
14636
- useMemo as useMemo22,
14637
- useRef as useRef19
14638
- } from "react";
14639
- import styled30 from "styled-components";
14640
- var SelectContext = createContext11(void 0);
14641
- var SelectOption = memo28(function SelectOption2({
14642
- value,
14643
- title,
14644
- onSelect
14645
- }) {
14646
- const { addListener, removeListener } = useContext11(SelectContext);
14647
- useEffect15(() => {
14648
- if (!onSelect)
14649
- return;
14650
- addListener(value, onSelect);
14651
- return () => removeListener(value);
14652
- }, [addListener, onSelect, removeListener, value]);
14653
- return /* @__PURE__ */ React64.createElement("option", { value }, title ?? value);
14654
- });
14655
- var createChevronSVGString = memoize(
14656
- (color) => `
14657
- <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 15 15' fill='${color}'>
14658
- <path 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'></path>
14659
- </svg>
14660
- `.replace(/\n/g, "")
14661
- );
14662
- var SelectContainer = styled30.div(
14663
- ({ $flex }) => ({
14664
- flex: $flex ?? "1 1 0px",
14665
- display: "flex",
14666
- flexDirection: "row",
14667
- position: "relative"
14668
- })
14669
- );
14670
- var SelectElement = styled30.select(
14671
- ({ theme, $flex }) => ({
14672
- appearance: "none",
14673
- ...theme.textStyles.small,
14674
- color: theme.colors.text,
14675
- lineHeight: "19px",
14676
- width: "0px",
14677
- // Reset intrinsic width
14678
- flex: $flex ?? "1 1 0px",
14679
- position: "relative",
14680
- border: "0",
14681
- outline: "none",
14682
- minWidth: "0",
14683
- textAlign: "left",
14684
- alignSelf: "stretch",
14685
- borderRadius: "4px",
14686
- paddingTop: "4px",
14687
- paddingBottom: "4px",
14688
- paddingLeft: "6px",
14689
- paddingRight: "23px",
14690
- background: [
14691
- `calc(100% - 6px) / 15px url("data:image/svg+xml;utf8,${createChevronSVGString(
14692
- theme.colors.icon
14693
- )}") no-repeat`,
14694
- theme.colors.inputBackground
14695
- ].join(","),
14696
- "&:focus": {
14697
- boxShadow: `0 0 0 2px ${theme.colors.primary}`
14698
- }
14699
- })
14700
- );
14647
+ // src/components/SelectMenu.tsx
14648
+ import { DropdownChevronIcon } from "@noya-app/noya-icons";
14649
+ import * as Select from "@radix-ui/react-select";
14650
+ import React64, { memo as memo28, useMemo as useMemo22 } from "react";
14651
+ import { styled as styled30 } from "styled-components";
14652
+ var readOnlyStyle = {
14653
+ justifyContent: "flex-start",
14654
+ textAlign: "left"
14655
+ };
14656
+ var flexStyle = {
14657
+ flex: 1
14658
+ };
14659
+ var textStyle = {
14660
+ fontSize: "0.85rem"
14661
+ };
14701
14662
  var SelectLabel = styled30.label(({ theme }) => ({
14702
14663
  ...theme.textStyles.label,
14703
14664
  color: theme.colors.textDisabled,
@@ -14712,66 +14673,7 @@ var SelectLabel = styled30.label(({ theme }) => ({
14712
14673
  justifyContent: "end",
14713
14674
  paddingRight: "24px"
14714
14675
  }));
14715
- var Select = memo28(function Select2({
14716
- id,
14717
- flex,
14718
- value,
14719
- label,
14720
- ...rest
14721
- }) {
14722
- const options = "options" in rest ? rest.options : void 0;
14723
- const getTitle = "options" in rest ? rest.getTitle : void 0;
14724
- const onChange = "options" in rest ? rest.onChange : void 0;
14725
- const children2 = "options" in rest ? void 0 : rest.children;
14726
- const optionElements = useMemo22(
14727
- () => options ? options.map((option, index) => /* @__PURE__ */ React64.createElement(
14728
- SelectOption,
14729
- {
14730
- key: option,
14731
- value: option,
14732
- title: getTitle?.(option, index),
14733
- onSelect: () => onChange?.(option)
14734
- }
14735
- )) : children2,
14736
- [children2, getTitle, onChange, options]
14737
- );
14738
- const listeners = useRef19(/* @__PURE__ */ new Map());
14739
- const contextValue = useMemo22(
14740
- () => ({
14741
- addListener: (value2, listener) => listeners.current.set(value2, listener),
14742
- removeListener: (value2) => listeners.current.delete(value2)
14743
- }),
14744
- []
14745
- );
14746
- return /* @__PURE__ */ React64.createElement(SelectContext.Provider, { value: contextValue }, /* @__PURE__ */ React64.createElement(SelectContainer, { $flex: flex }, /* @__PURE__ */ React64.createElement(
14747
- SelectElement,
14748
- {
14749
- id,
14750
- $flex: flex,
14751
- value,
14752
- onChange: useCallback23(
14753
- (event) => listeners.current.get(event.target.value)?.(),
14754
- [listeners]
14755
- ),
14756
- onPointerDown: (event) => event.stopPropagation()
14757
- },
14758
- optionElements
14759
- )), label && /* @__PURE__ */ React64.createElement(SelectLabel, { htmlFor: id }, label));
14760
- });
14761
-
14762
- // src/components/SelectMenu.tsx
14763
- import { DropdownChevronIcon } from "@noya-app/noya-icons";
14764
- import * as Select3 from "@radix-ui/react-select";
14765
- import React65, { memo as memo29 } from "react";
14766
- import { styled as styled31 } from "styled-components";
14767
- var readOnlyStyle = {
14768
- justifyContent: "flex-start",
14769
- textAlign: "left"
14770
- };
14771
- var flexStyle = {
14772
- flex: 1
14773
- };
14774
- var SelectMenu = memo29(function SelectMenu2({
14676
+ var SelectMenu = memo28(function SelectMenu2({
14775
14677
  id,
14776
14678
  style: style5,
14777
14679
  className,
@@ -14780,53 +14682,75 @@ var SelectMenu = memo29(function SelectMenu2({
14780
14682
  onSelect,
14781
14683
  placeholder,
14782
14684
  disabled,
14783
- readOnly
14685
+ readOnly,
14686
+ label,
14687
+ open
14784
14688
  }) {
14785
14689
  const selectedItem = menuItems.find(
14786
14690
  (item) => typeof item !== "string" && item.value === value
14787
14691
  );
14788
14692
  const icon = selectedItem?.icon;
14789
- if (readOnly) {
14790
- return /* @__PURE__ */ React65.createElement(
14693
+ const readOnlyButton = useMemo22(
14694
+ () => /* @__PURE__ */ React64.createElement(
14791
14695
  Button,
14792
14696
  {
14793
14697
  id,
14794
- style: style5,
14698
+ style: { ...style5, ...flexStyle },
14795
14699
  contentStyle: readOnlyStyle,
14796
14700
  className,
14797
14701
  disabled
14798
14702
  },
14799
- icon && /* @__PURE__ */ React65.createElement(React65.Fragment, null, renderIcon(icon), /* @__PURE__ */ React65.createElement(Spacer.Horizontal, { inline: true, size: 6 })),
14800
- /* @__PURE__ */ React65.createElement("span", { style: flexStyle }, selectedItem?.title ?? value)
14801
- );
14703
+ icon && /* @__PURE__ */ React64.createElement(React64.Fragment, null, renderIcon(icon), /* @__PURE__ */ React64.createElement(Spacer.Horizontal, { inline: true, size: 6 })),
14704
+ /* @__PURE__ */ React64.createElement("span", { style: { ...flexStyle, ...textStyle } }, selectedItem?.title ?? value)
14705
+ ),
14706
+ [icon, id, style5, className, disabled, value, selectedItem]
14707
+ );
14708
+ const trigger = useMemo22(
14709
+ () => /* @__PURE__ */ React64.createElement(Select.SelectTrigger, { asChild: true }, /* @__PURE__ */ React64.createElement(
14710
+ Button,
14711
+ {
14712
+ id,
14713
+ style: { ...textStyle, ...style5, ...flexStyle },
14714
+ className,
14715
+ disabled
14716
+ },
14717
+ icon && /* @__PURE__ */ React64.createElement(React64.Fragment, null, renderIcon(icon), /* @__PURE__ */ React64.createElement(Spacer.Horizontal, { inline: true, size: 6 })),
14718
+ /* @__PURE__ */ React64.createElement("span", { style: flexStyle }, /* @__PURE__ */ React64.createElement(Select.Value, { placeholder })),
14719
+ /* @__PURE__ */ React64.createElement(Spacer.Horizontal, { inline: true, size: 6 }),
14720
+ /* @__PURE__ */ React64.createElement(DropdownChevronIcon, null)
14721
+ )),
14722
+ [icon, id, style5, className, disabled, placeholder]
14723
+ );
14724
+ if (readOnly) {
14725
+ return label ? /* @__PURE__ */ React64.createElement(Stack.V, { position: "relative" }, readOnlyButton, /* @__PURE__ */ React64.createElement(SelectLabel, { htmlFor: id }, label)) : readOnlyButton;
14802
14726
  }
14803
- return /* @__PURE__ */ React65.createElement(Select3.Root, { value, onValueChange: onSelect }, /* @__PURE__ */ React65.createElement(Select3.SelectTrigger, { asChild: true }, /* @__PURE__ */ React65.createElement(Button, { id, style: style5, className, disabled }, icon && /* @__PURE__ */ React65.createElement(React65.Fragment, null, renderIcon(icon), /* @__PURE__ */ React65.createElement(Spacer.Horizontal, { inline: true, size: 6 })), /* @__PURE__ */ React65.createElement("span", { style: flexStyle }, /* @__PURE__ */ React65.createElement(Select3.Value, { placeholder })), /* @__PURE__ */ React65.createElement(Spacer.Horizontal, { inline: true, size: 6 }), /* @__PURE__ */ React65.createElement(DropdownChevronIcon, null))), /* @__PURE__ */ React65.createElement(Select3.Portal, null, /* @__PURE__ */ React65.createElement(SelectContent, null, /* @__PURE__ */ React65.createElement(SelectViewport, null, menuItems.map((menuItem) => {
14727
+ return /* @__PURE__ */ React64.createElement(Select.Root, { value, onValueChange: onSelect, open }, label ? /* @__PURE__ */ React64.createElement(Stack.V, { position: "relative", style: flexStyle }, trigger, /* @__PURE__ */ React64.createElement(SelectLabel, { htmlFor: id }, label)) : trigger, /* @__PURE__ */ React64.createElement(Select.Portal, null, /* @__PURE__ */ React64.createElement(SelectContent, null, /* @__PURE__ */ React64.createElement(SelectViewport, null, menuItems.map((menuItem) => {
14804
14728
  if (typeof menuItem === "string") {
14805
- return /* @__PURE__ */ React65.createElement(StyledSeparator, null);
14729
+ return /* @__PURE__ */ React64.createElement(StyledSeparator, null);
14806
14730
  }
14807
14731
  const value2 = menuItem.value ?? "";
14808
- return /* @__PURE__ */ React65.createElement(SelectItem, { key: value2, value: value2, icon: menuItem.icon }, menuItem.title ?? value2);
14732
+ return /* @__PURE__ */ React64.createElement(SelectItem, { key: value2, value: value2, icon: menuItem.icon }, menuItem.title ?? value2);
14809
14733
  })))));
14810
14734
  });
14811
- var SelectContent = styled31(Select3.Content)(styles.contentStyle);
14812
- var SelectViewport = styled31(Select3.Viewport)({});
14813
- var SelectItem = React65.forwardRef(
14735
+ var SelectContent = styled30(Select.Content)(styles.contentStyle);
14736
+ var SelectViewport = styled30(Select.Viewport)({});
14737
+ var SelectItem = React64.forwardRef(
14814
14738
  ({
14815
14739
  children: children2,
14816
14740
  icon,
14817
14741
  ...props
14818
14742
  }, forwardedRef) => {
14819
- return /* @__PURE__ */ React65.createElement(StyledItem2, { ...props, ref: forwardedRef }, icon && /* @__PURE__ */ React65.createElement(React65.Fragment, null, renderIcon(icon), /* @__PURE__ */ React65.createElement(Spacer.Horizontal, { size: 8 })), /* @__PURE__ */ React65.createElement(Select3.ItemText, null, children2));
14743
+ return /* @__PURE__ */ React64.createElement(StyledItem2, { ...props, ref: forwardedRef }, icon && /* @__PURE__ */ React64.createElement(React64.Fragment, null, renderIcon(icon), /* @__PURE__ */ React64.createElement(Spacer.Horizontal, { size: 8 })), /* @__PURE__ */ React64.createElement(Select.ItemText, { style: textStyle }, children2));
14820
14744
  }
14821
14745
  );
14822
- var StyledItem2 = styled31(Select3.Item)(styles.itemStyle);
14823
- var StyledSeparator = styled31(Select3.Separator)(styles.separatorStyle);
14746
+ var StyledItem2 = styled30(Select.Item)(styles.itemStyle);
14747
+ var StyledSeparator = styled30(Select.Separator)(styles.separatorStyle);
14824
14748
 
14825
14749
  // src/components/Slider.tsx
14826
14750
  import * as RadixSlider from "@radix-ui/react-slider";
14827
- import React66, { useCallback as useCallback24, useMemo as useMemo23 } from "react";
14828
- import styled32 from "styled-components";
14829
- var StyledSlider = styled32(RadixSlider.Root)({
14751
+ import React65, { useCallback as useCallback23, useMemo as useMemo23 } from "react";
14752
+ import styled31 from "styled-components";
14753
+ var StyledSlider = styled31(RadixSlider.Root)({
14830
14754
  flex: "1",
14831
14755
  position: "relative",
14832
14756
  display: "flex",
@@ -14835,19 +14759,19 @@ var StyledSlider = styled32(RadixSlider.Root)({
14835
14759
  touchAction: "none",
14836
14760
  height: "16px"
14837
14761
  });
14838
- var StyledTrack = styled32(RadixSlider.Track)(({ theme }) => ({
14762
+ var StyledTrack = styled31(RadixSlider.Track)(({ theme }) => ({
14839
14763
  backgroundColor: theme.colors.divider,
14840
14764
  position: "relative",
14841
14765
  flexGrow: 1,
14842
14766
  height: "2px"
14843
14767
  }));
14844
- var StyledRange = styled32(RadixSlider.Range)(({ theme }) => ({
14768
+ var StyledRange = styled31(RadixSlider.Range)(({ theme }) => ({
14845
14769
  position: "absolute",
14846
14770
  backgroundColor: theme.colors.primary,
14847
14771
  borderRadius: "9999px",
14848
14772
  height: "100%"
14849
14773
  }));
14850
- var StyledThumb2 = styled32(RadixSlider.Thumb)(({ theme }) => ({
14774
+ var StyledThumb2 = styled31(RadixSlider.Thumb)(({ theme }) => ({
14851
14775
  display: "block",
14852
14776
  width: "12px",
14853
14777
  height: "12px",
@@ -14869,13 +14793,13 @@ var Slider = function Slider2({
14869
14793
  () => [Math.min(Math.max(value, min), max)],
14870
14794
  [value, min, max]
14871
14795
  );
14872
- const handleValueChange = useCallback24(
14796
+ const handleValueChange = useCallback23(
14873
14797
  (arrayValue2) => {
14874
14798
  onValueChange(arrayValue2[0]);
14875
14799
  },
14876
14800
  [onValueChange]
14877
14801
  );
14878
- return /* @__PURE__ */ React66.createElement(
14802
+ return /* @__PURE__ */ React65.createElement(
14879
14803
  StyledSlider,
14880
14804
  {
14881
14805
  min,
@@ -14884,16 +14808,16 @@ var Slider = function Slider2({
14884
14808
  value: arrayValue,
14885
14809
  onValueChange: handleValueChange
14886
14810
  },
14887
- /* @__PURE__ */ React66.createElement(StyledTrack, null, /* @__PURE__ */ React66.createElement(StyledRange, null)),
14888
- /* @__PURE__ */ React66.createElement(StyledThumb2, null)
14811
+ /* @__PURE__ */ React65.createElement(StyledTrack, null, /* @__PURE__ */ React65.createElement(StyledRange, null)),
14812
+ /* @__PURE__ */ React65.createElement(StyledThumb2, null)
14889
14813
  );
14890
14814
  };
14891
14815
 
14892
14816
  // src/components/Switch.tsx
14893
14817
  import * as SwitchPrimitive from "@radix-ui/react-switch";
14894
- import React67 from "react";
14895
- import styled33 from "styled-components";
14896
- var SwitchRoot = styled33(SwitchPrimitive.Root)(({ theme, $colorScheme }) => ({
14818
+ import React66 from "react";
14819
+ import styled32 from "styled-components";
14820
+ var SwitchRoot = styled32(SwitchPrimitive.Root)(({ theme, $colorScheme }) => ({
14897
14821
  all: "unset",
14898
14822
  width: 32,
14899
14823
  height: 19,
@@ -14910,7 +14834,7 @@ var SwitchRoot = styled33(SwitchPrimitive.Root)(({ theme, $colorScheme }) => ({
14910
14834
  backgroundColor: $colorScheme === "primary" ? theme.colors.primary : $colorScheme === "secondary" ? theme.colors.secondary : void 0
14911
14835
  }
14912
14836
  }));
14913
- var SwitchThumb = styled33(SwitchPrimitive.Thumb)({
14837
+ var SwitchThumb = styled32(SwitchPrimitive.Thumb)({
14914
14838
  display: "block",
14915
14839
  width: 15,
14916
14840
  height: 15,
@@ -14927,7 +14851,7 @@ var Switch = function Switch2({
14927
14851
  colorScheme = "normal",
14928
14852
  disabled
14929
14853
  }) {
14930
- return /* @__PURE__ */ React67.createElement(
14854
+ return /* @__PURE__ */ React66.createElement(
14931
14855
  SwitchRoot,
14932
14856
  {
14933
14857
  $colorScheme: colorScheme,
@@ -14937,14 +14861,14 @@ var Switch = function Switch2({
14937
14861
  onChange(newValue);
14938
14862
  }
14939
14863
  },
14940
- /* @__PURE__ */ React67.createElement(SwitchThumb, null)
14864
+ /* @__PURE__ */ React66.createElement(SwitchThumb, null)
14941
14865
  );
14942
14866
  };
14943
14867
 
14944
14868
  // src/components/TextArea.tsx
14945
- import React68, { forwardRef as forwardRef18, memo as memo30, useCallback as useCallback25, useEffect as useEffect16, useRef as useRef20 } from "react";
14946
- import styled34 from "styled-components";
14947
- var TextAreaElement = styled34.textarea(({ theme }) => ({
14869
+ import React67, { forwardRef as forwardRef18, memo as memo29, useCallback as useCallback24, useEffect as useEffect15, useRef as useRef19 } from "react";
14870
+ import styled33 from "styled-components";
14871
+ var TextAreaElement = styled33.textarea(({ theme }) => ({
14948
14872
  ...theme.textStyles.small,
14949
14873
  color: theme.colors.text,
14950
14874
  background: theme.colors.inputBackground,
@@ -14968,8 +14892,8 @@ var TextAreaElement = styled34.textarea(({ theme }) => ({
14968
14892
  resize: "none"
14969
14893
  }));
14970
14894
  var useAutoResize = (value) => {
14971
- const textareaRef = useRef20(null);
14972
- useEffect16(() => {
14895
+ const textareaRef = useRef19(null);
14896
+ useEffect15(() => {
14973
14897
  if (!textareaRef.current)
14974
14898
  return;
14975
14899
  textareaRef.current.style.height = "auto";
@@ -14977,25 +14901,25 @@ var useAutoResize = (value) => {
14977
14901
  }, [value]);
14978
14902
  return textareaRef;
14979
14903
  };
14980
- var AutoResizingTextArea = memo30(
14904
+ var AutoResizingTextArea = memo29(
14981
14905
  forwardRef18(function AutoResizingTextArea2({
14982
14906
  value,
14983
14907
  onChangeText,
14984
14908
  ...rest
14985
14909
  }, forwardedRef) {
14986
14910
  const ref = useAutoResize(value || rest.placeholder || "");
14987
- const handleChange = useCallback25(
14911
+ const handleChange = useCallback24(
14988
14912
  (event) => onChangeText(event.target.value),
14989
14913
  [onChangeText]
14990
14914
  );
14991
- const handleRef = useCallback25(
14915
+ const handleRef = useCallback24(
14992
14916
  (value2) => {
14993
14917
  ref.current = value2;
14994
14918
  assignRef(forwardedRef, value2);
14995
14919
  },
14996
14920
  [ref, forwardedRef]
14997
14921
  );
14998
- return /* @__PURE__ */ React68.createElement(
14922
+ return /* @__PURE__ */ React67.createElement(
14999
14923
  TextAreaElement,
15000
14924
  {
15001
14925
  ref: handleRef,
@@ -15008,11 +14932,11 @@ var AutoResizingTextArea = memo30(
15008
14932
  );
15009
14933
 
15010
14934
  // src/components/TreeView.tsx
15011
- import React69, {
14935
+ import React68, {
15012
14936
  forwardRef as forwardRef19,
15013
- memo as memo31,
15014
- useCallback as useCallback26,
15015
- useContext as useContext12
14937
+ memo as memo30,
14938
+ useCallback as useCallback25,
14939
+ useContext as useContext11
15016
14940
  } from "react";
15017
14941
  var TreeRow = forwardRef19(function TreeRow2({
15018
14942
  icon,
@@ -15021,34 +14945,40 @@ var TreeRow = forwardRef19(function TreeRow2({
15021
14945
  children: children2,
15022
14946
  ...rest
15023
14947
  }, forwardedRef) {
15024
- const { expandable } = useContext12(ListView.RowContext);
15025
- const handleClickChevron = useCallback26(
14948
+ const { expandable } = useContext11(ListView.RowContext);
14949
+ const handleClickChevron = useCallback25(
15026
14950
  (event) => {
15027
14951
  event.stopPropagation();
15028
14952
  onClickChevron?.({ altKey: event.altKey });
15029
14953
  },
15030
14954
  [onClickChevron]
15031
14955
  );
15032
- return /* @__PURE__ */ React69.createElement(ListView.Row, { ref: forwardedRef, ...rest }, expandable && /* @__PURE__ */ React69.createElement(React69.Fragment, null, expanded === void 0 ? /* @__PURE__ */ React69.createElement(Spacer.Horizontal, { size: 19 }) : /* @__PURE__ */ React69.createElement(
14956
+ return /* @__PURE__ */ React68.createElement(ListView.Row, { ref: forwardedRef, ...rest }, expandable && /* @__PURE__ */ React68.createElement(React68.Fragment, null, expanded === void 0 ? /* @__PURE__ */ React68.createElement(Spacer.Horizontal, { size: 19 }) : /* @__PURE__ */ React68.createElement(
15033
14957
  IconButton,
15034
14958
  {
15035
14959
  iconName: expanded ? "ChevronDownIcon2" : "ChevronRightIcon2",
15036
14960
  onClick: handleClickChevron,
15037
14961
  selected: rest.selected
15038
14962
  }
15039
- ), /* @__PURE__ */ React69.createElement(Spacer.Horizontal, { size: 6 })), icon && /* @__PURE__ */ React69.createElement(React69.Fragment, null, renderIcon(icon), /* @__PURE__ */ React69.createElement(Spacer.Horizontal, { size: 10 })), children2);
14963
+ ), /* @__PURE__ */ React68.createElement(Spacer.Horizontal, { size: 6 })), icon && /* @__PURE__ */ React68.createElement(React68.Fragment, null, renderIcon(icon), /* @__PURE__ */ React68.createElement(Spacer.Horizontal, { size: 10 })), children2);
15040
14964
  });
15041
14965
  var TreeView;
15042
14966
  ((TreeView2) => {
15043
14967
  TreeView2.Root = ListView.Root;
15044
14968
  TreeView2.RowTitle = ListView.RowTitle;
15045
14969
  TreeView2.EditableRowTitle = ListView.EditableRowTitle;
15046
- TreeView2.Row = memo31(TreeRow);
14970
+ TreeView2.Row = memo30(TreeRow);
15047
14971
  })(TreeView || (TreeView = {}));
15048
14972
 
15049
14973
  // src/components/WorkspaceLayout.tsx
15050
14974
  import { useKeyboardShortcuts as useKeyboardShortcuts3 } from "@noya-app/noya-keymap";
15051
- import React71, { forwardRef as forwardRef20, useImperativeHandle as useImperativeHandle4, useRef as useRef22 } from "react";
14975
+ import React70, {
14976
+ forwardRef as forwardRef20,
14977
+ useCallback as useCallback26,
14978
+ useImperativeHandle as useImperativeHandle4,
14979
+ useRef as useRef21,
14980
+ useState as useState22
14981
+ } from "react";
15052
14982
  import {
15053
14983
  Panel,
15054
14984
  PanelGroup,
@@ -15056,10 +14986,10 @@ import {
15056
14986
  } from "react-resizable-panels";
15057
14987
 
15058
14988
  // src/hooks/usePreservePanelSize.tsx
15059
- import { useLayoutEffect as useLayoutEffect9, useRef as useRef21 } from "react";
14989
+ import { useLayoutEffect as useLayoutEffect9, useRef as useRef20 } from "react";
15060
14990
 
15061
14991
  // src/hooks/useWindowSize.tsx
15062
- import { useEffect as useEffect17, useState as useState21 } from "react";
14992
+ import { useEffect as useEffect16, useState as useState21 } from "react";
15063
14993
  function useWindowSize() {
15064
14994
  const [size3, setSize] = useState21(
15065
14995
  typeof window === "undefined" ? { width: 0, height: 0 } : {
@@ -15067,7 +14997,7 @@ function useWindowSize() {
15067
14997
  height: window.innerHeight
15068
14998
  }
15069
14999
  );
15070
- useEffect17(() => {
15000
+ useEffect16(() => {
15071
15001
  const handleResize = () => setSize({
15072
15002
  width: window.innerWidth,
15073
15003
  height: window.innerHeight
@@ -15085,7 +15015,7 @@ var RIGHT_SIDEBAR_ID = "editor-right-sidebar";
15085
15015
  var CONTENT_AREA_ID = "editor-content-area";
15086
15016
  function usePreservePanelSize(panelGroupRef, setPanelLayoutState) {
15087
15017
  const windowSize = useWindowSize();
15088
- const layoutRef = useRef21();
15018
+ const layoutRef = useRef20();
15089
15019
  useLayoutEffect9(() => {
15090
15020
  const panelGroup = document.querySelector(
15091
15021
  `[data-panel-group-id="${EDITOR_PANEL_GROUP_ID}"]`
@@ -15214,10 +15144,18 @@ var WorkspaceLayoutWithTheme = forwardRef20(function WorkspaceLayoutWithTheme2({
15214
15144
  const rightSidebarPercentage = getPercentage(rightSidebarInitialSize);
15215
15145
  const leftSidebarMinPercentage = leftSidebarMinSize !== void 0 ? getPercentage(leftSidebarMinSize) : void 0;
15216
15146
  const rightSidebarMinPercentage = rightSidebarMinSize !== void 0 ? getPercentage(rightSidebarMinSize) : void 0;
15217
- const panelGroupRef = useRef22(null);
15218
- const leftSidebarRef = useRef22(null);
15219
- const rightSidebarRef = useRef22(null);
15220
- usePreservePanelSize(panelGroupRef, onChangeLayoutState);
15147
+ const panelGroupRef = useRef21(null);
15148
+ const leftSidebarRef = useRef21(null);
15149
+ const rightSidebarRef = useRef21(null);
15150
+ const [internalLayoutState, setInternalLayoutState] = useState22(null);
15151
+ const handleChangeLayoutState = useCallback26(
15152
+ (state) => {
15153
+ setInternalLayoutState(state);
15154
+ onChangeLayoutState?.(state);
15155
+ },
15156
+ [onChangeLayoutState]
15157
+ );
15158
+ usePreservePanelSize(panelGroupRef, handleChangeLayoutState);
15221
15159
  const theme = useDesignSystemTheme();
15222
15160
  useImperativeHandle4(forwardedRef, () => ({
15223
15161
  setLeftSidebarExpanded: (expanded) => {
@@ -15276,7 +15214,7 @@ var WorkspaceLayoutWithTheme = forwardRef20(function WorkspaceLayoutWithTheme2({
15276
15214
  }
15277
15215
  });
15278
15216
  const centerPanelPercentage = 100 - (leftPanelContent ? leftSidebarPercentage : 0) - (rightPanelContent ? rightSidebarPercentage : 0);
15279
- return /* @__PURE__ */ React71.createElement(
15217
+ return /* @__PURE__ */ React70.createElement(
15280
15218
  "div",
15281
15219
  {
15282
15220
  id,
@@ -15288,7 +15226,7 @@ var WorkspaceLayoutWithTheme = forwardRef20(function WorkspaceLayoutWithTheme2({
15288
15226
  ...style5
15289
15227
  }
15290
15228
  },
15291
- /* @__PURE__ */ React71.createElement(
15229
+ /* @__PURE__ */ React70.createElement(
15292
15230
  PanelGroup,
15293
15231
  {
15294
15232
  ref: panelGroupRef,
@@ -15297,7 +15235,7 @@ var WorkspaceLayoutWithTheme = forwardRef20(function WorkspaceLayoutWithTheme2({
15297
15235
  autoSaveId: autoSavePrefix ? `${autoSavePrefix}--${EDITOR_PANEL_GROUP_ID}` : void 0,
15298
15236
  style: { flex: "1" }
15299
15237
  },
15300
- hasLeftSidebar && /* @__PURE__ */ React71.createElement(React71.Fragment, null, /* @__PURE__ */ React71.createElement(
15238
+ hasLeftSidebar && /* @__PURE__ */ React70.createElement(React70.Fragment, null, /* @__PURE__ */ React70.createElement(
15301
15239
  Panel,
15302
15240
  {
15303
15241
  id: LEFT_SIDEBAR_ID,
@@ -15313,8 +15251,8 @@ var WorkspaceLayoutWithTheme = forwardRef20(function WorkspaceLayoutWithTheme2({
15313
15251
  position: "relative"
15314
15252
  }
15315
15253
  },
15316
- leftPanelContent
15317
- ), /* @__PURE__ */ React71.createElement(
15254
+ internalLayoutState?.leftSidebarCollapsed ? null : leftPanelContent
15255
+ ), /* @__PURE__ */ React70.createElement(
15318
15256
  PanelResizeHandle,
15319
15257
  {
15320
15258
  style: {
@@ -15325,7 +15263,7 @@ var WorkspaceLayoutWithTheme = forwardRef20(function WorkspaceLayoutWithTheme2({
15325
15263
  }
15326
15264
  }
15327
15265
  )),
15328
- /* @__PURE__ */ React71.createElement(
15266
+ /* @__PURE__ */ React70.createElement(
15329
15267
  Panel,
15330
15268
  {
15331
15269
  id: CONTENT_AREA_ID,
@@ -15340,7 +15278,7 @@ var WorkspaceLayoutWithTheme = forwardRef20(function WorkspaceLayoutWithTheme2({
15340
15278
  },
15341
15279
  centerPanelContent
15342
15280
  ),
15343
- hasRightSidebar && /* @__PURE__ */ React71.createElement(React71.Fragment, null, /* @__PURE__ */ React71.createElement(
15281
+ hasRightSidebar && /* @__PURE__ */ React70.createElement(React70.Fragment, null, /* @__PURE__ */ React70.createElement(
15344
15282
  PanelResizeHandle,
15345
15283
  {
15346
15284
  style: {
@@ -15350,7 +15288,7 @@ var WorkspaceLayoutWithTheme = forwardRef20(function WorkspaceLayoutWithTheme2({
15350
15288
  backgroundColor: theme.colors.divider
15351
15289
  }
15352
15290
  }
15353
- ), /* @__PURE__ */ React71.createElement(
15291
+ ), /* @__PURE__ */ React70.createElement(
15354
15292
  Panel,
15355
15293
  {
15356
15294
  id: RIGHT_SIDEBAR_ID,
@@ -15365,13 +15303,13 @@ var WorkspaceLayoutWithTheme = forwardRef20(function WorkspaceLayoutWithTheme2({
15365
15303
  position: "relative"
15366
15304
  }
15367
15305
  },
15368
- rightPanelContent
15306
+ internalLayoutState?.rightSidebarCollapsed ? null : rightPanelContent
15369
15307
  ))
15370
15308
  )
15371
15309
  );
15372
15310
  });
15373
15311
  var WorkspaceLayout = forwardRef20(function WorkspaceLayout2(props, forwardedRef) {
15374
- return /* @__PURE__ */ React71.createElement(DesignSystemThemeProvider, null, /* @__PURE__ */ React71.createElement(WorkspaceLayoutWithTheme, { ...props, ref: forwardedRef }));
15312
+ return /* @__PURE__ */ React70.createElement(DesignSystemThemeProvider, null, /* @__PURE__ */ React70.createElement(WorkspaceLayoutWithTheme, { ...props, ref: forwardedRef }));
15375
15313
  });
15376
15314
 
15377
15315
  // src/hooks/usePlatform.ts
@@ -15416,11 +15354,11 @@ var SUPPORTED_CANVAS_UPLOAD_TYPES = [
15416
15354
 
15417
15355
  // src/components/DimensionInput.tsx
15418
15356
  import { round } from "@noya-app/noya-utils";
15419
- import React72, { memo as memo32, useCallback as useCallback27 } from "react";
15357
+ import React71, { memo as memo31, useCallback as useCallback27 } from "react";
15420
15358
  function getNewValue(value, mode, delta) {
15421
15359
  return delta === void 0 ? value : mode === "replace" ? delta : value + delta;
15422
15360
  }
15423
- var DimensionInput = memo32(function DimensionInput2({
15361
+ var DimensionInput = memo31(function DimensionInput2({
15424
15362
  id,
15425
15363
  value,
15426
15364
  onSetValue,
@@ -15438,7 +15376,7 @@ var DimensionInput = memo32(function DimensionInput2({
15438
15376
  (value2) => onSetValue(value2, "replace"),
15439
15377
  [onSetValue]
15440
15378
  );
15441
- return /* @__PURE__ */ React72.createElement(InputField.Root, { id, width: size3 }, /* @__PURE__ */ React72.createElement(
15379
+ return /* @__PURE__ */ React71.createElement(InputField.Root, { id, width: size3 }, /* @__PURE__ */ React71.createElement(
15442
15380
  InputField.NumberInput,
15443
15381
  {
15444
15382
  value: value === void 0 ? value : round(value, 2),
@@ -15447,7 +15385,7 @@ var DimensionInput = memo32(function DimensionInput2({
15447
15385
  disabled,
15448
15386
  ...trigger === "change" ? { onChange: handleSetValue } : { onSubmit: handleSetValue }
15449
15387
  }
15450
- ), label && /* @__PURE__ */ React72.createElement(InputField.Label, null, label));
15388
+ ), label && /* @__PURE__ */ React71.createElement(InputField.Label, null, label));
15451
15389
  });
15452
15390
 
15453
15391
  // src/components/InspectorPrimitives.tsx
@@ -15466,20 +15404,20 @@ __export(InspectorPrimitives_exports, {
15466
15404
  Title: () => Title3,
15467
15405
  VerticalSeparator: () => VerticalSeparator
15468
15406
  });
15469
- import React73, { memo as memo33 } from "react";
15470
- import styled35, { useTheme as useTheme4 } from "styled-components";
15471
- var Section2 = styled35.div(({ theme, $padding = "10px", $gap }) => ({
15407
+ import React72, { memo as memo32 } from "react";
15408
+ import styled34, { useTheme as useTheme4 } from "styled-components";
15409
+ var Section2 = styled34.div(({ theme, $padding = "10px", $gap }) => ({
15472
15410
  flex: "0 0 auto",
15473
15411
  display: "flex",
15474
15412
  flexDirection: "column",
15475
15413
  padding: $padding,
15476
15414
  gap: $gap
15477
15415
  }));
15478
- var SectionHeader = styled35.div(({ theme }) => ({
15416
+ var SectionHeader = styled34.div(({ theme }) => ({
15479
15417
  display: "flex",
15480
15418
  alignItems: "center"
15481
15419
  }));
15482
- var Title3 = styled35.div(({ theme, $textStyle }) => ({
15420
+ var Title3 = styled34.div(({ theme, $textStyle }) => ({
15483
15421
  display: "flex",
15484
15422
  flexDirection: "row",
15485
15423
  userSelect: "none",
@@ -15492,7 +15430,7 @@ var Title3 = styled35.div(({ theme, $textStyle }) => ({
15492
15430
  fontWeight: "bold"
15493
15431
  }
15494
15432
  }));
15495
- var Row2 = styled35.div(
15433
+ var Row2 = styled34.div(
15496
15434
  ({ theme, $gap }) => ({
15497
15435
  flex: "1",
15498
15436
  display: "flex",
@@ -15501,26 +15439,26 @@ var Row2 = styled35.div(
15501
15439
  gap: $gap
15502
15440
  })
15503
15441
  );
15504
- var Column2 = styled35.div(({ theme }) => ({
15442
+ var Column2 = styled34.div(({ theme }) => ({
15505
15443
  flex: "1",
15506
15444
  display: "flex",
15507
15445
  flexDirection: "column",
15508
15446
  gap: "4px"
15509
15447
  }));
15510
- var Checkbox = styled35.input(({ theme }) => ({
15448
+ var Checkbox = styled34.input(({ theme }) => ({
15511
15449
  margin: 0
15512
15450
  }));
15513
- var Text3 = styled35.span(({ theme }) => ({
15451
+ var Text3 = styled34.span(({ theme }) => ({
15514
15452
  ...theme.textStyles.small
15515
15453
  }));
15516
- var VerticalSeparator = () => /* @__PURE__ */ React73.createElement(Spacer.Vertical, { size: useTheme4().sizes.inspector.verticalSeparator });
15517
- var HorizontalSeparator = () => /* @__PURE__ */ React73.createElement(Spacer.Horizontal, { size: useTheme4().sizes.inspector.horizontalSeparator });
15518
- var SliderRowLabel = styled35.span(({ theme }) => ({
15454
+ var VerticalSeparator = () => /* @__PURE__ */ React72.createElement(Spacer.Vertical, { size: useTheme4().sizes.inspector.verticalSeparator });
15455
+ var HorizontalSeparator = () => /* @__PURE__ */ React72.createElement(Spacer.Horizontal, { size: useTheme4().sizes.inspector.horizontalSeparator });
15456
+ var SliderRowLabel = styled34.span(({ theme }) => ({
15519
15457
  ...theme.textStyles.small,
15520
15458
  color: theme.colors.textMuted,
15521
15459
  marginBottom: "-6px"
15522
15460
  }));
15523
- var RowLabel = styled35.span(({ theme, $textStyle }) => ({
15461
+ var RowLabel = styled34.span(({ theme, $textStyle }) => ({
15524
15462
  // marginBottom: '6px',
15525
15463
  display: "flex",
15526
15464
  ...$textStyle ? {
@@ -15534,7 +15472,7 @@ var RowLabel = styled35.span(({ theme, $textStyle }) => ({
15534
15472
  // Button height
15535
15473
  alignItems: "center"
15536
15474
  }));
15537
- var LabeledRow = memo33(function LabeledRow2({
15475
+ var LabeledRow = memo32(function LabeledRow2({
15538
15476
  id,
15539
15477
  children: children2,
15540
15478
  label,
@@ -15542,13 +15480,13 @@ var LabeledRow = memo33(function LabeledRow2({
15542
15480
  gap,
15543
15481
  right
15544
15482
  }) {
15545
- return /* @__PURE__ */ React73.createElement(Row2, { id }, /* @__PURE__ */ React73.createElement(Column2, null, /* @__PURE__ */ React73.createElement(RowLabel, { $textStyle: labelTextStyle }, label, right && /* @__PURE__ */ React73.createElement(Spacer.Horizontal, null), right), /* @__PURE__ */ React73.createElement(Row2, { $gap: gap }, children2)));
15483
+ return /* @__PURE__ */ React72.createElement(Row2, { id }, /* @__PURE__ */ React72.createElement(Column2, null, /* @__PURE__ */ React72.createElement(RowLabel, { $textStyle: labelTextStyle }, label, right && /* @__PURE__ */ React72.createElement(Spacer.Horizontal, null), right), /* @__PURE__ */ React72.createElement(Row2, { $gap: gap }, children2)));
15546
15484
  });
15547
- var LabeledSliderRow = memo33(function LabeledRow3({
15485
+ var LabeledSliderRow = memo32(function LabeledRow3({
15548
15486
  children: children2,
15549
15487
  label
15550
15488
  }) {
15551
- return /* @__PURE__ */ React73.createElement(Row2, null, /* @__PURE__ */ React73.createElement(Column2, null, /* @__PURE__ */ React73.createElement(SliderRowLabel, null, label), /* @__PURE__ */ React73.createElement(Row2, null, children2)));
15489
+ return /* @__PURE__ */ React72.createElement(Row2, null, /* @__PURE__ */ React72.createElement(Column2, null, /* @__PURE__ */ React72.createElement(SliderRowLabel, null, label), /* @__PURE__ */ React72.createElement(Row2, null, children2)));
15552
15490
  });
15553
15491
  export {
15554
15492
  ActivityIndicator,
@@ -15558,6 +15496,7 @@ export {
15558
15496
  Body,
15559
15497
  Button,
15560
15498
  ButtonElement,
15499
+ CONTENT_AREA_ID,
15561
15500
  Chip,
15562
15501
  CloseButtonContainer,
15563
15502
  CompletionMenu,
@@ -15572,6 +15511,7 @@ export {
15572
15511
  DividerVertical,
15573
15512
  DraggableMenuButton,
15574
15513
  DropdownMenu,
15514
+ EDITOR_PANEL_GROUP_ID,
15575
15515
  FillInputField,
15576
15516
  FillPreviewBackground,
15577
15517
  FloatingWindow,
@@ -15595,21 +15535,21 @@ export {
15595
15535
  InspectorPrimitives_exports as InspectorPrimitives,
15596
15536
  Italic,
15597
15537
  KeyboardShortcut,
15538
+ LEFT_SIDEBAR_ID,
15598
15539
  Label,
15599
15540
  LabeledElementView,
15600
15541
  ListView,
15601
15542
  PatternPreviewBackground,
15602
15543
  Popover,
15603
15544
  Progress,
15545
+ RIGHT_SIDEBAR_ID,
15604
15546
  RadioGroup,
15605
15547
  Row,
15606
15548
  SEPARATOR_ITEM,
15607
15549
  SUPPORTED_CANVAS_UPLOAD_TYPES,
15608
15550
  SUPPORTED_IMAGE_UPLOAD_TYPES,
15609
15551
  ScrollArea,
15610
- Select,
15611
15552
  SelectMenu,
15612
- SelectOption,
15613
15553
  Slider,
15614
15554
  Small,
15615
15555
  Sortable,
@@ -15652,6 +15592,7 @@ export {
15652
15592
  useOpenInputDialog,
15653
15593
  usePlatform,
15654
15594
  usePlatformModKey,
15595
+ usePreservePanelSize,
15655
15596
  withSeparatorElements
15656
15597
  };
15657
15598
  /*! Bundled license information: