@noya-app/noya-designsystem 0.1.29 → 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/.turbo/turbo-build.log +9 -9
- package/.turbo/turbo-lint.log +13 -0
- package/CHANGELOG.md +16 -0
- package/dist/index.d.mts +172 -200
- package/dist/index.d.ts +172 -200
- package/dist/index.js +304 -467
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +301 -468
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -3
- package/src/components/Button.tsx +5 -3
- package/src/components/GridView.tsx +37 -35
- package/src/components/InputField.tsx +118 -88
- package/src/components/ListView.tsx +1 -0
- package/src/components/RadioGroup.tsx +2 -0
- package/src/components/SelectMenu.tsx +69 -12
- package/src/components/Stack.tsx +10 -1
- package/src/components/Switch.tsx +1 -0
- package/src/components/WorkspaceLayout.tsx +29 -6
- package/src/index.tsx +1 -2
- package/tailwind.config.ts +283 -0
- package/tailwind.d.ts +11 -0
- package/tsconfig.json +4 -1
- package/src/components/ArrayController.tsx +0 -168
- package/src/components/Select.tsx +0 -183
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
|
-
|
|
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:
|
|
3273
|
-
|
|
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
|
-
|
|
3282
|
-
|
|
3283
|
-
|
|
3284
|
-
|
|
3285
|
-
|
|
3286
|
-
|
|
3287
|
-
|
|
3288
|
-
|
|
3289
|
-
|
|
3290
|
-
|
|
3291
|
-
|
|
3292
|
-
|
|
3293
|
-
|
|
3294
|
-
|
|
3295
|
-
|
|
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" ? "
|
|
3359
|
+
top: $size === "large" ? "10px" : $size === "medium" ? "4px" : "2px"
|
|
3350
3360
|
})
|
|
3351
3361
|
);
|
|
3352
|
-
var InputFieldButton = memo9(
|
|
3353
|
-
|
|
3354
|
-
|
|
3355
|
-
|
|
3356
|
-
|
|
3357
|
-
|
|
3358
|
-
(
|
|
3359
|
-
|
|
3360
|
-
|
|
3361
|
-
|
|
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
|
-
|
|
3367
|
-
|
|
3368
|
-
|
|
3369
|
-
|
|
3370
|
-
|
|
3371
|
-
|
|
3372
|
-
|
|
3373
|
-
|
|
3374
|
-
|
|
3375
|
-
|
|
3376
|
-
|
|
3377
|
-
|
|
3378
|
-
|
|
3379
|
-
|
|
3380
|
-
|
|
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) + ($
|
|
3418
|
-
paddingRight: ($size === "large" ? 10 : $size === "medium" ? 6 : 4) + ($
|
|
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
|
-
|
|
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
|
-
|
|
3586
|
-
|
|
3587
|
-
|
|
3588
|
-
|
|
3589
|
-
|
|
3590
|
-
|
|
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
|
|
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,
|
|
@@ -5446,44 +5465,44 @@ var sizes2 = {
|
|
|
5446
5465
|
gap: 32
|
|
5447
5466
|
}
|
|
5448
5467
|
};
|
|
5449
|
-
var Grid2 = styled22.div(({ theme, size
|
|
5468
|
+
var Grid2 = styled22.div(({ theme, $size, $padding }) => {
|
|
5450
5469
|
return {
|
|
5451
5470
|
color: theme.colors.text,
|
|
5452
5471
|
display: "grid",
|
|
5453
|
-
gridTemplateColumns: `repeat(auto-fill, minmax(${sizes2[
|
|
5472
|
+
gridTemplateColumns: `repeat(auto-fill, minmax(${sizes2[$size].itemWidth}px, 1fr))`,
|
|
5454
5473
|
// gridAutoRows: `${sizes[size].itemHeight}px`,
|
|
5455
|
-
gap: `${sizes2[
|
|
5474
|
+
gap: `${sizes2[$size].gap}px`,
|
|
5456
5475
|
// gridTemplateColumns: `repeat(auto-fill, minmax(
|
|
5457
5476
|
// ${size === 'large' ? '280px' : size === 'small' ? '160px' : '116px'}
|
|
5458
5477
|
// , 1fr))`,
|
|
5459
5478
|
// gridAutoRows:
|
|
5460
5479
|
// size === 'large' ? '280px' : size === 'small' ? '170px' : '116px',
|
|
5461
5480
|
// gap: size === 'large' || size === 'small' ? `20px` : `12px`,
|
|
5462
|
-
padding
|
|
5481
|
+
padding: $padding
|
|
5463
5482
|
};
|
|
5464
5483
|
});
|
|
5465
5484
|
var Container3 = styled22.div(
|
|
5466
|
-
({ theme, scrollable }) => ({
|
|
5467
|
-
flex: scrollable ? "1" : "0 0 auto",
|
|
5485
|
+
({ theme, $scrollable }) => ({
|
|
5486
|
+
flex: $scrollable ? "1" : "0 0 auto",
|
|
5468
5487
|
display: "flex",
|
|
5469
5488
|
flexDirection: "column"
|
|
5470
5489
|
})
|
|
5471
5490
|
);
|
|
5472
|
-
var ContentContainer = styled22.div(({ theme, selected, hovered, bordered, disabled }) => ({
|
|
5491
|
+
var ContentContainer = styled22.div(({ theme, $selected, $hovered, $bordered, $disabled }) => ({
|
|
5473
5492
|
display: "flex",
|
|
5474
5493
|
flex: "1",
|
|
5475
5494
|
backgroundColor: theme.colors.sidebar.background,
|
|
5476
5495
|
alignItems: "center",
|
|
5477
5496
|
justifyContent: "center",
|
|
5478
5497
|
borderRadius: "2px",
|
|
5479
|
-
border: `1px solid ${selected ? theme.colors.primary : (
|
|
5498
|
+
border: `1px solid ${$selected ? theme.colors.primary : (
|
|
5480
5499
|
// : hovered
|
|
5481
5500
|
// ? `rgb(132, 63, 255, 0.5)`
|
|
5482
|
-
bordered ? theme.colors.divider : "transparent"
|
|
5501
|
+
$bordered ? theme.colors.divider : "transparent"
|
|
5483
5502
|
)}`,
|
|
5484
5503
|
overflow: "hidden",
|
|
5485
5504
|
cursor: "pointer",
|
|
5486
|
-
|
|
5505
|
+
...$disabled ? { opacity: 0.5 } : {
|
|
5487
5506
|
"&:hover": { opacity: 0.85 },
|
|
5488
5507
|
"&:active": { opacity: 0.7 }
|
|
5489
5508
|
}
|
|
@@ -5498,7 +5517,7 @@ var ItemContainer = styled22.div(({ theme }) => ({
|
|
|
5498
5517
|
}
|
|
5499
5518
|
}));
|
|
5500
5519
|
var ItemTitle = styled22.span(
|
|
5501
|
-
({ theme, showBackground }) => ({
|
|
5520
|
+
({ theme, $showBackground }) => ({
|
|
5502
5521
|
...theme.textStyles.small,
|
|
5503
5522
|
lineHeight: "1",
|
|
5504
5523
|
color: theme.colors.text,
|
|
@@ -5507,7 +5526,7 @@ var ItemTitle = styled22.span(
|
|
|
5507
5526
|
whiteSpace: "pre",
|
|
5508
5527
|
overflow: "hidden",
|
|
5509
5528
|
textOverflow: "ellipsis",
|
|
5510
|
-
|
|
5529
|
+
...$showBackground && {
|
|
5511
5530
|
background: theme.colors.sidebar.background,
|
|
5512
5531
|
// border: `1px solid ${theme.colors.dividerSubtle}`,
|
|
5513
5532
|
padding: "2px 4px",
|
|
@@ -5517,7 +5536,7 @@ var ItemTitle = styled22.span(
|
|
|
5517
5536
|
})
|
|
5518
5537
|
);
|
|
5519
5538
|
var ItemDescription = styled22.span(
|
|
5520
|
-
({ theme, showBackground }) => ({
|
|
5539
|
+
({ theme, $showBackground }) => ({
|
|
5521
5540
|
...theme.textStyles.small,
|
|
5522
5541
|
fontSize: "0.7rem",
|
|
5523
5542
|
lineHeight: "1",
|
|
@@ -5526,7 +5545,7 @@ var ItemDescription = styled22.span(
|
|
|
5526
5545
|
whiteSpace: "pre",
|
|
5527
5546
|
overflow: "hidden",
|
|
5528
5547
|
textOverflow: "ellipsis",
|
|
5529
|
-
|
|
5548
|
+
...$showBackground && {
|
|
5530
5549
|
background: theme.colors.sidebar.background,
|
|
5531
5550
|
// border: `1px solid ${theme.colors.dividerSubtle}`,
|
|
5532
5551
|
padding: "2px 4px",
|
|
@@ -5647,10 +5666,10 @@ var GridViewItem = forwardRef12(function GridViewItem2({
|
|
|
5647
5666
|
/* @__PURE__ */ React33.createElement(
|
|
5648
5667
|
ContentContainer,
|
|
5649
5668
|
{
|
|
5650
|
-
disabled,
|
|
5651
|
-
bordered,
|
|
5652
|
-
selected,
|
|
5653
|
-
hovered: !disabled && hovered,
|
|
5669
|
+
$disabled: disabled,
|
|
5670
|
+
$bordered: bordered,
|
|
5671
|
+
$selected: selected,
|
|
5672
|
+
$hovered: !disabled && hovered,
|
|
5654
5673
|
onClick: handleClick,
|
|
5655
5674
|
onDoubleClick,
|
|
5656
5675
|
onContextMenu,
|
|
@@ -5658,8 +5677,8 @@ var GridViewItem = forwardRef12(function GridViewItem2({
|
|
|
5658
5677
|
},
|
|
5659
5678
|
children2
|
|
5660
5679
|
),
|
|
5661
|
-
textPosition === "below" && /* @__PURE__ */ React33.createElement(React33.Fragment, null, /* @__PURE__ */ React33.createElement(Spacer.Vertical, { size: 8 }), /* @__PURE__ */ React33.createElement(ItemTitle, { showBackground: false }, title || " "), /* @__PURE__ */ React33.createElement(ItemDescription, { showBackground: false }, subtitle || " ")),
|
|
5662
|
-
textPosition === "overlay" && hovered && (title || subtitle) && /* @__PURE__ */ React33.createElement(TextOverlay, null, title && /* @__PURE__ */ React33.createElement(ItemTitle, { showBackground: true }, title), subtitle && /* @__PURE__ */ React33.createElement(ItemDescription, { showBackground: true }, subtitle)),
|
|
5680
|
+
textPosition === "below" && /* @__PURE__ */ React33.createElement(React33.Fragment, null, /* @__PURE__ */ React33.createElement(Spacer.Vertical, { size: 8 }), /* @__PURE__ */ React33.createElement(ItemTitle, { $showBackground: false }, title || " "), /* @__PURE__ */ React33.createElement(ItemDescription, { $showBackground: false }, subtitle || " ")),
|
|
5681
|
+
textPosition === "overlay" && hovered && (title || subtitle) && /* @__PURE__ */ React33.createElement(TextOverlay, null, title && /* @__PURE__ */ React33.createElement(ItemTitle, { $showBackground: true }, title), subtitle && /* @__PURE__ */ React33.createElement(ItemDescription, { $showBackground: true }, subtitle)),
|
|
5663
5682
|
loading && /* @__PURE__ */ React33.createElement(Shimmer, null, /* @__PURE__ */ React33.createElement(ActivityIndicator, { opacity: 0.5, size: 13 }))
|
|
5664
5683
|
);
|
|
5665
5684
|
if (menuItems && onSelectMenuItem) {
|
|
@@ -5669,7 +5688,7 @@ var GridViewItem = forwardRef12(function GridViewItem2({
|
|
|
5669
5688
|
element = /* @__PURE__ */ React33.createElement(
|
|
5670
5689
|
Tooltip,
|
|
5671
5690
|
{
|
|
5672
|
-
content: /* @__PURE__ */ React33.createElement(Stack.V, { gap: 2 }, /* @__PURE__ */ React33.createElement(ItemTitle, { showBackground: false }, title), /* @__PURE__ */ React33.createElement(ItemDescription, { showBackground: false }, subtitle))
|
|
5691
|
+
content: /* @__PURE__ */ React33.createElement(Stack.V, { gap: 2 }, /* @__PURE__ */ React33.createElement(ItemTitle, { $showBackground: false }, title), /* @__PURE__ */ React33.createElement(ItemDescription, { $showBackground: false }, subtitle))
|
|
5673
5692
|
},
|
|
5674
5693
|
element
|
|
5675
5694
|
);
|
|
@@ -5708,14 +5727,14 @@ function GridViewRoot({
|
|
|
5708
5727
|
}),
|
|
5709
5728
|
[bordered, disabled, size3, textPosition]
|
|
5710
5729
|
);
|
|
5711
|
-
return /* @__PURE__ */ React33.createElement(GridViewContext.Provider, { value: contextValue }, /* @__PURE__ */ React33.createElement(Container3, { onClick: handleClick, scrollable }, scrollable ? /* @__PURE__ */ React33.createElement(ScrollArea, null, children2) : children2));
|
|
5730
|
+
return /* @__PURE__ */ React33.createElement(GridViewContext.Provider, { value: contextValue }, /* @__PURE__ */ React33.createElement(Container3, { onClick: handleClick, $scrollable: scrollable }, scrollable ? /* @__PURE__ */ React33.createElement(ScrollArea, null, children2) : children2));
|
|
5712
5731
|
}
|
|
5713
5732
|
function GridViewSection({
|
|
5714
5733
|
children: children2,
|
|
5715
5734
|
padding = "20px"
|
|
5716
5735
|
}) {
|
|
5717
5736
|
const { size: size3 } = useContext7(GridViewContext);
|
|
5718
|
-
return /* @__PURE__ */ React33.createElement(Grid2, { size: size3, padding }, children2);
|
|
5737
|
+
return /* @__PURE__ */ React33.createElement(Grid2, { $size: size3, $padding: padding }, children2);
|
|
5719
5738
|
}
|
|
5720
5739
|
function GridViewSectionHeader({ title }) {
|
|
5721
5740
|
const grouped = title.split("/");
|
|
@@ -5802,14 +5821,14 @@ function mergeRanges(ranges) {
|
|
|
5802
5821
|
const merged = [];
|
|
5803
5822
|
const sorted = [...ranges].sort((a, b) => a.start - b.start);
|
|
5804
5823
|
let current;
|
|
5805
|
-
for (const
|
|
5824
|
+
for (const range2 of sorted) {
|
|
5806
5825
|
if (!current) {
|
|
5807
|
-
current =
|
|
5808
|
-
} else if (
|
|
5809
|
-
current.end = Math.max(current.end,
|
|
5826
|
+
current = range2;
|
|
5827
|
+
} else if (range2.start <= current.end) {
|
|
5828
|
+
current.end = Math.max(current.end, range2.end);
|
|
5810
5829
|
} else {
|
|
5811
5830
|
merged.push(current);
|
|
5812
|
-
current =
|
|
5831
|
+
current = range2;
|
|
5813
5832
|
}
|
|
5814
5833
|
}
|
|
5815
5834
|
if (current) {
|
|
@@ -10462,7 +10481,7 @@ var PositionCache = /* @__PURE__ */ function() {
|
|
|
10462
10481
|
// Render all cells visible within the viewport range defined.
|
|
10463
10482
|
}, {
|
|
10464
10483
|
key: "range",
|
|
10465
|
-
value: function
|
|
10484
|
+
value: function range2(scrollTop, clientHeight, renderCallback) {
|
|
10466
10485
|
var _this = this;
|
|
10467
10486
|
this._intervalTree.queryInterval(scrollTop, scrollTop + clientHeight, function(_ref) {
|
|
10468
10487
|
var _ref2 = (0, import_slicedToArray.default)(_ref, 3), top = _ref2[0], _ = _ref2[1], index = _ref2[2];
|
|
@@ -14625,79 +14644,21 @@ var RadioGroup;
|
|
|
14625
14644
|
RadioGroup2.Item = memo27(ToggleGroupItem);
|
|
14626
14645
|
})(RadioGroup || (RadioGroup = {}));
|
|
14627
14646
|
|
|
14628
|
-
// src/components/
|
|
14629
|
-
import {
|
|
14630
|
-
import
|
|
14631
|
-
|
|
14632
|
-
|
|
14633
|
-
|
|
14634
|
-
|
|
14635
|
-
|
|
14636
|
-
|
|
14637
|
-
|
|
14638
|
-
|
|
14639
|
-
|
|
14640
|
-
var
|
|
14641
|
-
|
|
14642
|
-
|
|
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
|
|
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
|
-
|
|
14790
|
-
|
|
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__ */
|
|
14800
|
-
/* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
14729
|
+
return /* @__PURE__ */ React64.createElement(StyledSeparator, null);
|
|
14806
14730
|
}
|
|
14807
14731
|
const value2 = menuItem.value ?? "";
|
|
14808
|
-
return /* @__PURE__ */
|
|
14732
|
+
return /* @__PURE__ */ React64.createElement(SelectItem, { key: value2, value: value2, icon: menuItem.icon }, menuItem.title ?? value2);
|
|
14809
14733
|
})))));
|
|
14810
14734
|
});
|
|
14811
|
-
var SelectContent =
|
|
14812
|
-
var SelectViewport =
|
|
14813
|
-
var SelectItem =
|
|
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__ */
|
|
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 =
|
|
14823
|
-
var StyledSeparator =
|
|
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
|
|
14828
|
-
import
|
|
14829
|
-
var StyledSlider =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
14796
|
+
const handleValueChange = useCallback23(
|
|
14873
14797
|
(arrayValue2) => {
|
|
14874
14798
|
onValueChange(arrayValue2[0]);
|
|
14875
14799
|
},
|
|
14876
14800
|
[onValueChange]
|
|
14877
14801
|
);
|
|
14878
|
-
return /* @__PURE__ */
|
|
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__ */
|
|
14888
|
-
/* @__PURE__ */
|
|
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
|
|
14895
|
-
import
|
|
14896
|
-
var SwitchRoot =
|
|
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 =
|
|
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__ */
|
|
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__ */
|
|
14864
|
+
/* @__PURE__ */ React66.createElement(SwitchThumb, null)
|
|
14941
14865
|
);
|
|
14942
14866
|
};
|
|
14943
14867
|
|
|
14944
14868
|
// src/components/TextArea.tsx
|
|
14945
|
-
import
|
|
14946
|
-
import
|
|
14947
|
-
var TextAreaElement =
|
|
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 =
|
|
14972
|
-
|
|
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 =
|
|
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 =
|
|
14911
|
+
const handleChange = useCallback24(
|
|
14988
14912
|
(event) => onChangeText(event.target.value),
|
|
14989
14913
|
[onChangeText]
|
|
14990
14914
|
);
|
|
14991
|
-
const handleRef =
|
|
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__ */
|
|
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
|
|
14935
|
+
import React68, {
|
|
15012
14936
|
forwardRef as forwardRef19,
|
|
15013
|
-
memo as
|
|
15014
|
-
useCallback as
|
|
15015
|
-
useContext as
|
|
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 } =
|
|
15025
|
-
const handleClickChevron =
|
|
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__ */
|
|
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__ */
|
|
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 =
|
|
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
|
|
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
|
|
14989
|
+
import { useLayoutEffect as useLayoutEffect9, useRef as useRef20 } from "react";
|
|
15060
14990
|
|
|
15061
14991
|
// src/hooks/useWindowSize.tsx
|
|
15062
|
-
import { useEffect as
|
|
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
|
-
|
|
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 =
|
|
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 =
|
|
15218
|
-
const leftSidebarRef =
|
|
15219
|
-
const rightSidebarRef =
|
|
15220
|
-
|
|
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__ */
|
|
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__ */
|
|
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__ */
|
|
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__ */
|
|
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__ */
|
|
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__ */
|
|
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__ */
|
|
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
|
-
var WorkspaceLayout =
|
|
15374
|
-
return /* @__PURE__ */
|
|
15311
|
+
var WorkspaceLayout = forwardRef20(function WorkspaceLayout2(props, 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
|
|
@@ -15414,10 +15352,41 @@ var SUPPORTED_CANVAS_UPLOAD_TYPES = [
|
|
|
15414
15352
|
""
|
|
15415
15353
|
];
|
|
15416
15354
|
|
|
15417
|
-
// src/components/
|
|
15418
|
-
import {
|
|
15419
|
-
import
|
|
15420
|
-
|
|
15355
|
+
// src/components/DimensionInput.tsx
|
|
15356
|
+
import { round } from "@noya-app/noya-utils";
|
|
15357
|
+
import React71, { memo as memo31, useCallback as useCallback27 } from "react";
|
|
15358
|
+
function getNewValue(value, mode, delta) {
|
|
15359
|
+
return delta === void 0 ? value : mode === "replace" ? delta : value + delta;
|
|
15360
|
+
}
|
|
15361
|
+
var DimensionInput = memo31(function DimensionInput2({
|
|
15362
|
+
id,
|
|
15363
|
+
value,
|
|
15364
|
+
onSetValue,
|
|
15365
|
+
label,
|
|
15366
|
+
size: size3,
|
|
15367
|
+
placeholder = "multi",
|
|
15368
|
+
disabled,
|
|
15369
|
+
trigger = "submit"
|
|
15370
|
+
}) {
|
|
15371
|
+
const handleNudgeValue = useCallback27(
|
|
15372
|
+
(value2) => onSetValue(value2, "adjust"),
|
|
15373
|
+
[onSetValue]
|
|
15374
|
+
);
|
|
15375
|
+
const handleSetValue = useCallback27(
|
|
15376
|
+
(value2) => onSetValue(value2, "replace"),
|
|
15377
|
+
[onSetValue]
|
|
15378
|
+
);
|
|
15379
|
+
return /* @__PURE__ */ React71.createElement(InputField.Root, { id, width: size3 }, /* @__PURE__ */ React71.createElement(
|
|
15380
|
+
InputField.NumberInput,
|
|
15381
|
+
{
|
|
15382
|
+
value: value === void 0 ? value : round(value, 2),
|
|
15383
|
+
placeholder: value === void 0 ? placeholder : void 0,
|
|
15384
|
+
onNudge: handleNudgeValue,
|
|
15385
|
+
disabled,
|
|
15386
|
+
...trigger === "change" ? { onChange: handleSetValue } : { onSubmit: handleSetValue }
|
|
15387
|
+
}
|
|
15388
|
+
), label && /* @__PURE__ */ React71.createElement(InputField.Label, null, label));
|
|
15389
|
+
});
|
|
15421
15390
|
|
|
15422
15391
|
// src/components/InspectorPrimitives.tsx
|
|
15423
15392
|
var InspectorPrimitives_exports = {};
|
|
@@ -15435,20 +15404,20 @@ __export(InspectorPrimitives_exports, {
|
|
|
15435
15404
|
Title: () => Title3,
|
|
15436
15405
|
VerticalSeparator: () => VerticalSeparator
|
|
15437
15406
|
});
|
|
15438
|
-
import React72, { memo as
|
|
15439
|
-
import
|
|
15440
|
-
var Section2 =
|
|
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 }) => ({
|
|
15441
15410
|
flex: "0 0 auto",
|
|
15442
15411
|
display: "flex",
|
|
15443
15412
|
flexDirection: "column",
|
|
15444
15413
|
padding: $padding,
|
|
15445
15414
|
gap: $gap
|
|
15446
15415
|
}));
|
|
15447
|
-
var SectionHeader =
|
|
15416
|
+
var SectionHeader = styled34.div(({ theme }) => ({
|
|
15448
15417
|
display: "flex",
|
|
15449
15418
|
alignItems: "center"
|
|
15450
15419
|
}));
|
|
15451
|
-
var Title3 =
|
|
15420
|
+
var Title3 = styled34.div(({ theme, $textStyle }) => ({
|
|
15452
15421
|
display: "flex",
|
|
15453
15422
|
flexDirection: "row",
|
|
15454
15423
|
userSelect: "none",
|
|
@@ -15461,7 +15430,7 @@ var Title3 = styled35.div(({ theme, $textStyle }) => ({
|
|
|
15461
15430
|
fontWeight: "bold"
|
|
15462
15431
|
}
|
|
15463
15432
|
}));
|
|
15464
|
-
var Row2 =
|
|
15433
|
+
var Row2 = styled34.div(
|
|
15465
15434
|
({ theme, $gap }) => ({
|
|
15466
15435
|
flex: "1",
|
|
15467
15436
|
display: "flex",
|
|
@@ -15470,26 +15439,26 @@ var Row2 = styled35.div(
|
|
|
15470
15439
|
gap: $gap
|
|
15471
15440
|
})
|
|
15472
15441
|
);
|
|
15473
|
-
var Column2 =
|
|
15442
|
+
var Column2 = styled34.div(({ theme }) => ({
|
|
15474
15443
|
flex: "1",
|
|
15475
15444
|
display: "flex",
|
|
15476
15445
|
flexDirection: "column",
|
|
15477
15446
|
gap: "4px"
|
|
15478
15447
|
}));
|
|
15479
|
-
var Checkbox =
|
|
15448
|
+
var Checkbox = styled34.input(({ theme }) => ({
|
|
15480
15449
|
margin: 0
|
|
15481
15450
|
}));
|
|
15482
|
-
var Text3 =
|
|
15451
|
+
var Text3 = styled34.span(({ theme }) => ({
|
|
15483
15452
|
...theme.textStyles.small
|
|
15484
15453
|
}));
|
|
15485
15454
|
var VerticalSeparator = () => /* @__PURE__ */ React72.createElement(Spacer.Vertical, { size: useTheme4().sizes.inspector.verticalSeparator });
|
|
15486
15455
|
var HorizontalSeparator = () => /* @__PURE__ */ React72.createElement(Spacer.Horizontal, { size: useTheme4().sizes.inspector.horizontalSeparator });
|
|
15487
|
-
var SliderRowLabel =
|
|
15456
|
+
var SliderRowLabel = styled34.span(({ theme }) => ({
|
|
15488
15457
|
...theme.textStyles.small,
|
|
15489
15458
|
color: theme.colors.textMuted,
|
|
15490
15459
|
marginBottom: "-6px"
|
|
15491
15460
|
}));
|
|
15492
|
-
var RowLabel =
|
|
15461
|
+
var RowLabel = styled34.span(({ theme, $textStyle }) => ({
|
|
15493
15462
|
// marginBottom: '6px',
|
|
15494
15463
|
display: "flex",
|
|
15495
15464
|
...$textStyle ? {
|
|
@@ -15503,7 +15472,7 @@ var RowLabel = styled35.span(({ theme, $textStyle }) => ({
|
|
|
15503
15472
|
// Button height
|
|
15504
15473
|
alignItems: "center"
|
|
15505
15474
|
}));
|
|
15506
|
-
var LabeledRow =
|
|
15475
|
+
var LabeledRow = memo32(function LabeledRow2({
|
|
15507
15476
|
id,
|
|
15508
15477
|
children: children2,
|
|
15509
15478
|
label,
|
|
@@ -15513,159 +15482,21 @@ var LabeledRow = memo33(function LabeledRow2({
|
|
|
15513
15482
|
}) {
|
|
15514
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)));
|
|
15515
15484
|
});
|
|
15516
|
-
var LabeledSliderRow =
|
|
15485
|
+
var LabeledSliderRow = memo32(function LabeledRow3({
|
|
15517
15486
|
children: children2,
|
|
15518
15487
|
label
|
|
15519
15488
|
}) {
|
|
15520
15489
|
return /* @__PURE__ */ React72.createElement(Row2, null, /* @__PURE__ */ React72.createElement(Column2, null, /* @__PURE__ */ React72.createElement(SliderRowLabel, null, label), /* @__PURE__ */ React72.createElement(Row2, null, children2)));
|
|
15521
15490
|
});
|
|
15522
|
-
|
|
15523
|
-
// src/components/ArrayController.tsx
|
|
15524
|
-
var ElementRow = styled36.div({
|
|
15525
|
-
flex: "0 0 auto",
|
|
15526
|
-
display: "flex",
|
|
15527
|
-
flexDirection: "row",
|
|
15528
|
-
alignItems: "center"
|
|
15529
|
-
});
|
|
15530
|
-
var ItemContainer2 = styled36.div({
|
|
15531
|
-
position: "relative"
|
|
15532
|
-
});
|
|
15533
|
-
var ArrayController = memo34(function ArrayController2({
|
|
15534
|
-
id,
|
|
15535
|
-
items,
|
|
15536
|
-
title,
|
|
15537
|
-
sortable = false,
|
|
15538
|
-
reversed = true,
|
|
15539
|
-
expanded = false,
|
|
15540
|
-
getKey,
|
|
15541
|
-
onMoveItem,
|
|
15542
|
-
onClickPlus,
|
|
15543
|
-
onClickTrash,
|
|
15544
|
-
onClickExpand,
|
|
15545
|
-
renderItem,
|
|
15546
|
-
renderExpandedContent,
|
|
15547
|
-
padding = 10
|
|
15548
|
-
}) {
|
|
15549
|
-
const iconColor = useTheme5().colors.icon;
|
|
15550
|
-
const primaryLightColor = useTheme5().colors.primaryLight;
|
|
15551
|
-
const keys = useMemo24(
|
|
15552
|
-
() => items.map((item, index) => getKey?.(item) ?? index.toString()),
|
|
15553
|
-
[getKey, items]
|
|
15554
|
-
);
|
|
15555
|
-
const indexes = reversed ? range2(0, items.length).reverse() : range2(0, items.length);
|
|
15556
|
-
const handleMoveItem = useCallback27(
|
|
15557
|
-
(sourceIndex, destinationIndex, position) => {
|
|
15558
|
-
if (reversed) {
|
|
15559
|
-
if (position === "above") {
|
|
15560
|
-
position = "below";
|
|
15561
|
-
} else if (position === "below") {
|
|
15562
|
-
position = "above";
|
|
15563
|
-
}
|
|
15564
|
-
}
|
|
15565
|
-
onMoveItem?.(
|
|
15566
|
-
sourceIndex,
|
|
15567
|
-
position === "below" ? destinationIndex + 1 : destinationIndex
|
|
15568
|
-
);
|
|
15569
|
-
},
|
|
15570
|
-
[onMoveItem, reversed]
|
|
15571
|
-
);
|
|
15572
|
-
const renderRow = (index) => {
|
|
15573
|
-
return /* @__PURE__ */ React73.createElement(ElementRow, { key: keys[index] }, renderItem({ item: items[index], index }));
|
|
15574
|
-
};
|
|
15575
|
-
return /* @__PURE__ */ React73.createElement(Section2, { id, $padding: padding, $gap: "2px" }, /* @__PURE__ */ React73.createElement(SectionHeader, null, /* @__PURE__ */ React73.createElement(Button, { variant: "none", onClick: onClickPlus }, /* @__PURE__ */ React73.createElement(Title3, null, title)), /* @__PURE__ */ React73.createElement(Spacer.Horizontal, null), withSeparatorElements(
|
|
15576
|
-
[
|
|
15577
|
-
onClickTrash && /* @__PURE__ */ React73.createElement(
|
|
15578
|
-
IconButton,
|
|
15579
|
-
{
|
|
15580
|
-
id: `${id}-trash`,
|
|
15581
|
-
iconName: "TrashIcon",
|
|
15582
|
-
color: iconColor,
|
|
15583
|
-
onClick: onClickTrash
|
|
15584
|
-
}
|
|
15585
|
-
),
|
|
15586
|
-
onClickExpand && /* @__PURE__ */ React73.createElement(
|
|
15587
|
-
IconButton,
|
|
15588
|
-
{
|
|
15589
|
-
id: `${id}-gear`,
|
|
15590
|
-
iconName: "GearIcon",
|
|
15591
|
-
color: expanded ? primaryLightColor : iconColor,
|
|
15592
|
-
onClick: onClickExpand
|
|
15593
|
-
}
|
|
15594
|
-
),
|
|
15595
|
-
onClickPlus && /* @__PURE__ */ React73.createElement(
|
|
15596
|
-
IconButton,
|
|
15597
|
-
{
|
|
15598
|
-
id: `${id}-add`,
|
|
15599
|
-
iconName: "PlusIcon",
|
|
15600
|
-
color: iconColor,
|
|
15601
|
-
onClick: onClickPlus
|
|
15602
|
-
}
|
|
15603
|
-
)
|
|
15604
|
-
],
|
|
15605
|
-
/* @__PURE__ */ React73.createElement(Spacer.Horizontal, { size: 8 })
|
|
15606
|
-
)), /* @__PURE__ */ React73.createElement(Stack.V, { gap: "4px" }, sortable ? /* @__PURE__ */ React73.createElement(
|
|
15607
|
-
Sortable.Root,
|
|
15608
|
-
{
|
|
15609
|
-
keys,
|
|
15610
|
-
renderOverlay: renderRow,
|
|
15611
|
-
onMoveItem: handleMoveItem
|
|
15612
|
-
},
|
|
15613
|
-
indexes.map((index) => /* @__PURE__ */ React73.createElement(Sortable.Item, { id: keys[index], key: keys[index] }, ({ relativeDropPosition, ...sortableProps }) => /* @__PURE__ */ React73.createElement(ItemContainer2, { ...sortableProps }, renderRow(index), relativeDropPosition && /* @__PURE__ */ React73.createElement(
|
|
15614
|
-
ListView.DragIndicator,
|
|
15615
|
-
{
|
|
15616
|
-
$gap: 0,
|
|
15617
|
-
$colorScheme: "primary",
|
|
15618
|
-
$relativeDropPosition: relativeDropPosition,
|
|
15619
|
-
$offsetLeft: 0
|
|
15620
|
-
}
|
|
15621
|
-
))))
|
|
15622
|
-
) : indexes.map(renderRow)), expanded && renderExpandedContent?.());
|
|
15623
|
-
});
|
|
15624
|
-
|
|
15625
|
-
// src/components/DimensionInput.tsx
|
|
15626
|
-
import { round } from "@noya-app/noya-utils";
|
|
15627
|
-
import React74, { memo as memo35, useCallback as useCallback28 } from "react";
|
|
15628
|
-
function getNewValue(value, mode, delta) {
|
|
15629
|
-
return delta === void 0 ? value : mode === "replace" ? delta : value + delta;
|
|
15630
|
-
}
|
|
15631
|
-
var DimensionInput = memo35(function DimensionInput2({
|
|
15632
|
-
id,
|
|
15633
|
-
value,
|
|
15634
|
-
onSetValue,
|
|
15635
|
-
label,
|
|
15636
|
-
size: size3,
|
|
15637
|
-
placeholder = "multi",
|
|
15638
|
-
disabled,
|
|
15639
|
-
trigger = "submit"
|
|
15640
|
-
}) {
|
|
15641
|
-
const handleNudgeValue = useCallback28(
|
|
15642
|
-
(value2) => onSetValue(value2, "adjust"),
|
|
15643
|
-
[onSetValue]
|
|
15644
|
-
);
|
|
15645
|
-
const handleSetValue = useCallback28(
|
|
15646
|
-
(value2) => onSetValue(value2, "replace"),
|
|
15647
|
-
[onSetValue]
|
|
15648
|
-
);
|
|
15649
|
-
return /* @__PURE__ */ React74.createElement(InputField.Root, { id, width: size3 }, /* @__PURE__ */ React74.createElement(
|
|
15650
|
-
InputField.NumberInput,
|
|
15651
|
-
{
|
|
15652
|
-
value: value === void 0 ? value : round(value, 2),
|
|
15653
|
-
placeholder: value === void 0 ? placeholder : void 0,
|
|
15654
|
-
onNudge: handleNudgeValue,
|
|
15655
|
-
disabled,
|
|
15656
|
-
...trigger === "change" ? { onChange: handleSetValue } : { onSubmit: handleSetValue }
|
|
15657
|
-
}
|
|
15658
|
-
), label && /* @__PURE__ */ React74.createElement(InputField.Label, null, label));
|
|
15659
|
-
});
|
|
15660
15491
|
export {
|
|
15661
15492
|
ActivityIndicator,
|
|
15662
|
-
ArrayController,
|
|
15663
15493
|
AutoResizingTextArea,
|
|
15664
15494
|
Avatar,
|
|
15665
15495
|
AvatarStack,
|
|
15666
15496
|
Body,
|
|
15667
15497
|
Button,
|
|
15668
15498
|
ButtonElement,
|
|
15499
|
+
CONTENT_AREA_ID,
|
|
15669
15500
|
Chip,
|
|
15670
15501
|
CloseButtonContainer,
|
|
15671
15502
|
CompletionMenu,
|
|
@@ -15680,6 +15511,7 @@ export {
|
|
|
15680
15511
|
DividerVertical,
|
|
15681
15512
|
DraggableMenuButton,
|
|
15682
15513
|
DropdownMenu,
|
|
15514
|
+
EDITOR_PANEL_GROUP_ID,
|
|
15683
15515
|
FillInputField,
|
|
15684
15516
|
FillPreviewBackground,
|
|
15685
15517
|
FloatingWindow,
|
|
@@ -15703,21 +15535,21 @@ export {
|
|
|
15703
15535
|
InspectorPrimitives_exports as InspectorPrimitives,
|
|
15704
15536
|
Italic,
|
|
15705
15537
|
KeyboardShortcut,
|
|
15538
|
+
LEFT_SIDEBAR_ID,
|
|
15706
15539
|
Label,
|
|
15707
15540
|
LabeledElementView,
|
|
15708
15541
|
ListView,
|
|
15709
15542
|
PatternPreviewBackground,
|
|
15710
15543
|
Popover,
|
|
15711
15544
|
Progress,
|
|
15545
|
+
RIGHT_SIDEBAR_ID,
|
|
15712
15546
|
RadioGroup,
|
|
15713
15547
|
Row,
|
|
15714
15548
|
SEPARATOR_ITEM,
|
|
15715
15549
|
SUPPORTED_CANVAS_UPLOAD_TYPES,
|
|
15716
15550
|
SUPPORTED_IMAGE_UPLOAD_TYPES,
|
|
15717
15551
|
ScrollArea,
|
|
15718
|
-
Select,
|
|
15719
15552
|
SelectMenu,
|
|
15720
|
-
SelectOption,
|
|
15721
15553
|
Slider,
|
|
15722
15554
|
Small,
|
|
15723
15555
|
Sortable,
|
|
@@ -15760,6 +15592,7 @@ export {
|
|
|
15760
15592
|
useOpenInputDialog,
|
|
15761
15593
|
usePlatform,
|
|
15762
15594
|
usePlatformModKey,
|
|
15595
|
+
usePreservePanelSize,
|
|
15763
15596
|
withSeparatorElements
|
|
15764
15597
|
};
|
|
15765
15598
|
/*! Bundled license information:
|