@noya-app/noya-designsystem 0.1.13 → 0.1.15
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/CHANGELOG.md +13 -0
- package/dist/index.d.mts +11 -5
- package/dist/index.d.ts +11 -5
- package/dist/index.js +301 -244
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +323 -264
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/components/InputField.tsx +2 -2
- package/src/components/Popover.tsx +25 -24
- package/src/components/Select.tsx +42 -13
- package/src/components/Sortable.tsx +9 -1
- package/src/contexts/DesignSystemConfiguration.tsx +49 -15
- package/src/theme/light.ts +1 -1
package/dist/index.mjs
CHANGED
|
@@ -389,11 +389,14 @@ import React21, { memo as memo11 } from "react";
|
|
|
389
389
|
import styled14 from "styled-components";
|
|
390
390
|
|
|
391
391
|
// src/contexts/DesignSystemConfiguration.tsx
|
|
392
|
+
import { getCurrentPlatform } from "@noya-app/noya-keymap";
|
|
392
393
|
import React19, {
|
|
393
394
|
createContext as createContext5,
|
|
394
395
|
memo as memo10,
|
|
395
396
|
useContext as useContext5,
|
|
396
|
-
|
|
397
|
+
useEffect as useEffect11,
|
|
398
|
+
useMemo as useMemo9,
|
|
399
|
+
useState as useState13
|
|
397
400
|
} from "react";
|
|
398
401
|
import { ThemeProvider, useTheme as useTheme2 } from "styled-components";
|
|
399
402
|
|
|
@@ -485,6 +488,231 @@ var Toast = ({
|
|
|
485
488
|
};
|
|
486
489
|
var ToastProvider = ({ children }) => /* @__PURE__ */ React7.createElement(ToastPrimitive.Provider, null, children, /* @__PURE__ */ React7.createElement(ToastViewport, null));
|
|
487
490
|
|
|
491
|
+
// src/theme/light.ts
|
|
492
|
+
var light_exports = {};
|
|
493
|
+
__export(light_exports, {
|
|
494
|
+
colors: () => colors,
|
|
495
|
+
fonts: () => fonts,
|
|
496
|
+
name: () => name,
|
|
497
|
+
sizes: () => sizes,
|
|
498
|
+
textStyles: () => textStyles
|
|
499
|
+
});
|
|
500
|
+
|
|
501
|
+
// src/mediaQuery.ts
|
|
502
|
+
var size = {
|
|
503
|
+
medium: "800px",
|
|
504
|
+
large: "1280px",
|
|
505
|
+
xlarge: "1550px",
|
|
506
|
+
xxlarge: "1680px"
|
|
507
|
+
};
|
|
508
|
+
var mediaQuery = {
|
|
509
|
+
small: `@media (max-width: ${size.medium})`,
|
|
510
|
+
medium: `@media (max-width: ${size.large}) and (min-width: ${size.medium})`,
|
|
511
|
+
large: `@media (max-width: ${size.xlarge}) and (min-width: ${size.large})`,
|
|
512
|
+
xlarge: `@media (min-width: ${size.xlarge})`
|
|
513
|
+
};
|
|
514
|
+
|
|
515
|
+
// src/theme/light.ts
|
|
516
|
+
var name = "light";
|
|
517
|
+
var colors = {
|
|
518
|
+
logo: {
|
|
519
|
+
fill: "rgb(175,175,175)",
|
|
520
|
+
highlight: "rgb(175,175,175)"
|
|
521
|
+
},
|
|
522
|
+
text: "rgb(38, 48, 83)",
|
|
523
|
+
textMuted: "rgb(85, 85, 85)",
|
|
524
|
+
textSubtle: "rgb(121, 121, 121)",
|
|
525
|
+
textDisabled: "rgb(160, 160, 160)",
|
|
526
|
+
textDecorativeLight: "rgb(168, 185, 212)",
|
|
527
|
+
dividerSubtle: "rgba(0, 0, 0, 0.04)",
|
|
528
|
+
divider: "rgba(0, 0, 0, 0.07)",
|
|
529
|
+
dividerStrong: "rgba(0, 0, 0, 0.09)",
|
|
530
|
+
primary: "rgb(132, 63, 255)",
|
|
531
|
+
primaryLight: "rgb(147, 86, 255)",
|
|
532
|
+
secondary: "rgb(0, 151, 117)",
|
|
533
|
+
secondaryLight: "rgb(0, 160, 129)",
|
|
534
|
+
secondaryBright: "#0ab557",
|
|
535
|
+
warning: "rgb(251, 211, 0)",
|
|
536
|
+
neutralBackground: "rgb(222,223,232)",
|
|
537
|
+
inputBackground: "rgb(240, 240, 242)",
|
|
538
|
+
inputBackgroundLight: "rgb(243, 243, 245)",
|
|
539
|
+
codeBackground: "rgb(250, 250, 250)",
|
|
540
|
+
codeBackgroundLight: "rgb(250, 250, 250)",
|
|
541
|
+
get codeBackgroundDark() {
|
|
542
|
+
return colors.text;
|
|
543
|
+
},
|
|
544
|
+
codeBackgroundDecorativeDark: "#435080",
|
|
545
|
+
selectedBackground: "rgb(242, 245, 250)",
|
|
546
|
+
transparentChecker: "rgba(255,255,255,0.8)",
|
|
547
|
+
activeBackground: "rgba(0,0,0,0.1)",
|
|
548
|
+
scrollbar: "rgba(199,199,199,0.8)",
|
|
549
|
+
placeholderDots: "rgba(0,0,0,0.3)",
|
|
550
|
+
breadcrumb: {
|
|
551
|
+
get text() {
|
|
552
|
+
return colors.textMuted;
|
|
553
|
+
},
|
|
554
|
+
get textHover() {
|
|
555
|
+
return colors.textSubtle;
|
|
556
|
+
},
|
|
557
|
+
get icon() {
|
|
558
|
+
return colors.icon;
|
|
559
|
+
}
|
|
560
|
+
},
|
|
561
|
+
listView: {
|
|
562
|
+
raisedBackground: "rgba(0,0,0,0.03)",
|
|
563
|
+
editingBackground: "#fff"
|
|
564
|
+
},
|
|
565
|
+
canvas: {
|
|
566
|
+
background: "rgb(249,249,249)",
|
|
567
|
+
get selectionStroke() {
|
|
568
|
+
return colors.primary;
|
|
569
|
+
},
|
|
570
|
+
dragHandleStroke: "rgba(180,180,180,0.5)",
|
|
571
|
+
measurement: "rgb(207,92,42)",
|
|
572
|
+
sliceOutline: "rgb(210,210,210)",
|
|
573
|
+
grid: "rgba(0,0,0,0.05)"
|
|
574
|
+
},
|
|
575
|
+
sidebar: {
|
|
576
|
+
background: "rgba(252,252,252,0.85)"
|
|
577
|
+
},
|
|
578
|
+
popover: {
|
|
579
|
+
background: "rgb(252,252,252)",
|
|
580
|
+
divider: "transparent"
|
|
581
|
+
},
|
|
582
|
+
slider: {
|
|
583
|
+
background: "white",
|
|
584
|
+
border: "#BBB"
|
|
585
|
+
},
|
|
586
|
+
radioGroup: {
|
|
587
|
+
background: "white"
|
|
588
|
+
},
|
|
589
|
+
icon: "rgb(139, 139, 139)",
|
|
590
|
+
iconSelected: "rgb(220, 220, 220)",
|
|
591
|
+
mask: "rgb(12,193,67)",
|
|
592
|
+
imageOverlay: "linear-gradient(0deg, rgba(132, 63, 255,0.55), rgba(132, 63, 255,0.55))",
|
|
593
|
+
get dragOutline() {
|
|
594
|
+
return colors.primary;
|
|
595
|
+
},
|
|
596
|
+
selection: "rgb(179,215,254)",
|
|
597
|
+
thumbnailBackground: "#f0efff",
|
|
598
|
+
thumbnailShadow: "#D3CEED66"
|
|
599
|
+
};
|
|
600
|
+
var fonts = {
|
|
601
|
+
normal: "'__Inter_6b0edc', '__Inter_Fallback_6b0edc', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif",
|
|
602
|
+
monospace: "Menlo, Monaco, Consolas, 'Courier New', monospace"
|
|
603
|
+
};
|
|
604
|
+
var typeScale = [3.052, 2.441, 1.953, 1.563, 1.25, 1, 0.85];
|
|
605
|
+
var textStyles = {
|
|
606
|
+
title: {
|
|
607
|
+
fontFamily: fonts.normal,
|
|
608
|
+
fontSize: `${typeScale[0]}rem`,
|
|
609
|
+
fontWeight: "bold",
|
|
610
|
+
lineHeight: "1.4",
|
|
611
|
+
letterSpacing: "-0.05em",
|
|
612
|
+
[mediaQuery.small]: {
|
|
613
|
+
fontSize: "36px"
|
|
614
|
+
}
|
|
615
|
+
},
|
|
616
|
+
subtitle: {
|
|
617
|
+
fontFamily: fonts.normal,
|
|
618
|
+
fontSize: `${typeScale[3]}rem`,
|
|
619
|
+
fontWeight: 500,
|
|
620
|
+
lineHeight: "1.75",
|
|
621
|
+
letterSpacing: "-0.05em",
|
|
622
|
+
[mediaQuery.small]: {
|
|
623
|
+
fontSize: "18px"
|
|
624
|
+
}
|
|
625
|
+
},
|
|
626
|
+
heading1: {
|
|
627
|
+
fontFamily: fonts.normal,
|
|
628
|
+
fontSize: `${typeScale[2]}rem`,
|
|
629
|
+
fontWeight: 500,
|
|
630
|
+
lineHeight: "1.75",
|
|
631
|
+
letterSpacing: "-0.025em"
|
|
632
|
+
},
|
|
633
|
+
heading2: {
|
|
634
|
+
fontFamily: fonts.normal,
|
|
635
|
+
fontSize: `${typeScale[3]}rem`,
|
|
636
|
+
fontWeight: 500,
|
|
637
|
+
lineHeight: "1.75",
|
|
638
|
+
letterSpacing: "-0.025em"
|
|
639
|
+
},
|
|
640
|
+
heading3: {
|
|
641
|
+
fontFamily: fonts.normal,
|
|
642
|
+
fontSize: `${typeScale[4]}rem`,
|
|
643
|
+
fontWeight: 500,
|
|
644
|
+
lineHeight: "1.75",
|
|
645
|
+
letterSpacing: "-0.025em"
|
|
646
|
+
},
|
|
647
|
+
heading4: {
|
|
648
|
+
fontFamily: fonts.normal,
|
|
649
|
+
fontSize: `${typeScale[5]}rem`,
|
|
650
|
+
fontWeight: 500,
|
|
651
|
+
lineHeight: "1.75"
|
|
652
|
+
},
|
|
653
|
+
heading5: {
|
|
654
|
+
fontFamily: fonts.normal,
|
|
655
|
+
fontSize: `${typeScale[6]}rem`,
|
|
656
|
+
fontWeight: 500,
|
|
657
|
+
lineHeight: "1.75"
|
|
658
|
+
},
|
|
659
|
+
body: {
|
|
660
|
+
fontFamily: fonts.normal,
|
|
661
|
+
fontSize: `${typeScale[5]}rem`,
|
|
662
|
+
fontWeight: 400,
|
|
663
|
+
lineHeight: "1.75"
|
|
664
|
+
},
|
|
665
|
+
small: {
|
|
666
|
+
fontFamily: fonts.normal,
|
|
667
|
+
fontSize: `${typeScale[6]}rem`,
|
|
668
|
+
fontWeight: 400,
|
|
669
|
+
lineHeight: "1.4"
|
|
670
|
+
},
|
|
671
|
+
button: {
|
|
672
|
+
fontFamily: fonts.normal,
|
|
673
|
+
fontSize: "0.8rem",
|
|
674
|
+
fontWeight: 500,
|
|
675
|
+
lineHeight: "1.4",
|
|
676
|
+
letterSpacing: "-0.2px"
|
|
677
|
+
},
|
|
678
|
+
code: {
|
|
679
|
+
fontFamily: fonts.monospace,
|
|
680
|
+
fontSize: "90%",
|
|
681
|
+
lineHeight: "1.5"
|
|
682
|
+
},
|
|
683
|
+
label: {
|
|
684
|
+
fontFamily: fonts.normal,
|
|
685
|
+
fontSize: "0.62rem",
|
|
686
|
+
fontWeight: 400,
|
|
687
|
+
lineHeight: "1.4",
|
|
688
|
+
textTransform: "uppercase",
|
|
689
|
+
letterSpacing: "-0.3px"
|
|
690
|
+
}
|
|
691
|
+
};
|
|
692
|
+
var sizes = {
|
|
693
|
+
sidebarWidth: 260,
|
|
694
|
+
toolbar: {
|
|
695
|
+
height: 46,
|
|
696
|
+
itemSeparator: 8
|
|
697
|
+
},
|
|
698
|
+
inspector: {
|
|
699
|
+
horizontalSeparator: 8,
|
|
700
|
+
verticalSeparator: 10
|
|
701
|
+
},
|
|
702
|
+
spacing: {
|
|
703
|
+
nano: 2,
|
|
704
|
+
micro: 4,
|
|
705
|
+
small: 8,
|
|
706
|
+
medium: 16,
|
|
707
|
+
large: 32,
|
|
708
|
+
xlarge: 64,
|
|
709
|
+
xxlarge: 128
|
|
710
|
+
},
|
|
711
|
+
dialog: {
|
|
712
|
+
padding: 16
|
|
713
|
+
}
|
|
714
|
+
};
|
|
715
|
+
|
|
488
716
|
// src/contexts/DialogContext.tsx
|
|
489
717
|
import React17, {
|
|
490
718
|
createContext as createContext3,
|
|
@@ -1500,6 +1728,7 @@ function Popover({
|
|
|
1500
1728
|
onFocusOutside,
|
|
1501
1729
|
onPointerDownOutside,
|
|
1502
1730
|
collisionPadding: 8,
|
|
1731
|
+
arrowPadding: 2,
|
|
1503
1732
|
onPointerDown: (event) => {
|
|
1504
1733
|
event.stopPropagation();
|
|
1505
1734
|
},
|
|
@@ -1525,6 +1754,8 @@ var InputFieldContext = createContext2({
|
|
|
1525
1754
|
}
|
|
1526
1755
|
});
|
|
1527
1756
|
var LabelContainer = styled12.label(({ theme, labelPosition, hasDropdown, pointerEvents }) => ({
|
|
1757
|
+
...theme.textStyles.label,
|
|
1758
|
+
fontWeight: "bold",
|
|
1528
1759
|
color: theme.colors.textDisabled,
|
|
1529
1760
|
position: "absolute",
|
|
1530
1761
|
top: 0,
|
|
@@ -1534,8 +1765,6 @@ var LabelContainer = styled12.label(({ theme, labelPosition, hasDropdown, pointe
|
|
|
1534
1765
|
display: "flex",
|
|
1535
1766
|
alignItems: "center",
|
|
1536
1767
|
pointerEvents,
|
|
1537
|
-
fontWeight: "bold",
|
|
1538
|
-
fontSize: "60%",
|
|
1539
1768
|
userSelect: "none",
|
|
1540
1769
|
...labelPosition === "start" ? { justifyContent: "flex-start", paddingLeft: "6px" } : {
|
|
1541
1770
|
justifyContent: "flex-end",
|
|
@@ -2097,23 +2326,49 @@ var useCurrentFloatingWindowInternal = () => {
|
|
|
2097
2326
|
};
|
|
2098
2327
|
|
|
2099
2328
|
// src/contexts/DesignSystemConfiguration.tsx
|
|
2100
|
-
var
|
|
2329
|
+
var DesignSystemThemeProvider = memo10(
|
|
2330
|
+
function DesignSystemThemeProvider2({
|
|
2331
|
+
children,
|
|
2332
|
+
theme
|
|
2333
|
+
}) {
|
|
2334
|
+
const parentTheme = useTheme2();
|
|
2335
|
+
if (theme) {
|
|
2336
|
+
return /* @__PURE__ */ React19.createElement(ThemeProvider, { theme }, children);
|
|
2337
|
+
} else if (parentTheme) {
|
|
2338
|
+
return children;
|
|
2339
|
+
} else {
|
|
2340
|
+
return /* @__PURE__ */ React19.createElement(ThemeProvider, { theme: light_exports }, children);
|
|
2341
|
+
}
|
|
2342
|
+
}
|
|
2343
|
+
);
|
|
2344
|
+
var DesignSystemConfigurationContext = createContext5({
|
|
2345
|
+
platform: "key"
|
|
2346
|
+
});
|
|
2101
2347
|
var DesignSystemConfigurationProvider = memo10(
|
|
2102
2348
|
function DesignSystemConfigurationProvider2({
|
|
2103
2349
|
children,
|
|
2104
|
-
theme,
|
|
2350
|
+
theme = light_exports,
|
|
2105
2351
|
platform
|
|
2106
2352
|
}) {
|
|
2107
|
-
const
|
|
2353
|
+
const [internalPlatform, setInternalPlatform] = useState13(
|
|
2354
|
+
platform ?? "key"
|
|
2355
|
+
);
|
|
2356
|
+
useEffect11(() => {
|
|
2357
|
+
if (platform !== void 0)
|
|
2358
|
+
return;
|
|
2359
|
+
if (typeof navigator !== "undefined") {
|
|
2360
|
+
setInternalPlatform(getCurrentPlatform(navigator));
|
|
2361
|
+
}
|
|
2362
|
+
}, [platform]);
|
|
2363
|
+
const contextValue = useMemo9(
|
|
2364
|
+
() => ({ platform: platform ?? internalPlatform }),
|
|
2365
|
+
[platform, internalPlatform]
|
|
2366
|
+
);
|
|
2108
2367
|
return /* @__PURE__ */ React19.createElement(DesignSystemConfigurationContext.Provider, { value: contextValue }, /* @__PURE__ */ React19.createElement(ThemeProvider, { theme }, /* @__PURE__ */ React19.createElement(DialogProvider, null, /* @__PURE__ */ React19.createElement(ToastProvider, null, /* @__PURE__ */ React19.createElement(FloatingWindowProvider, null, children)))));
|
|
2109
2368
|
}
|
|
2110
2369
|
);
|
|
2111
2370
|
function useDesignSystemConfiguration() {
|
|
2112
|
-
|
|
2113
|
-
if (!value) {
|
|
2114
|
-
throw new Error("Missing DesignSystemConfigurationProvider");
|
|
2115
|
-
}
|
|
2116
|
-
return value;
|
|
2371
|
+
return useContext5(DesignSystemConfigurationContext);
|
|
2117
2372
|
}
|
|
2118
2373
|
function useDesignSystemTheme() {
|
|
2119
2374
|
return useTheme2();
|
|
@@ -2490,7 +2745,7 @@ var DividerVertical = memo13(function DividerVertical2(props) {
|
|
|
2490
2745
|
|
|
2491
2746
|
// src/components/DraggableMenuButton.tsx
|
|
2492
2747
|
import { DragHandleDots2Icon } from "@noya-app/noya-icons";
|
|
2493
|
-
import React24, { memo as memo14, useCallback as useCallback14, useState as
|
|
2748
|
+
import React24, { memo as memo14, useCallback as useCallback14, useState as useState15 } from "react";
|
|
2494
2749
|
import styled17 from "styled-components";
|
|
2495
2750
|
var DotButtonElement = styled17.div(({ theme }) => ({
|
|
2496
2751
|
cursor: "pointer",
|
|
@@ -2516,7 +2771,7 @@ var DraggableMenuButton = memo14(function DraggableMenuButton2({
|
|
|
2516
2771
|
isVisible = true
|
|
2517
2772
|
}) {
|
|
2518
2773
|
const color = useDesignSystemTheme().colors.icon;
|
|
2519
|
-
const [open, setOpen] =
|
|
2774
|
+
const [open, setOpen] = useState15(false);
|
|
2520
2775
|
const [downPosition, setDownPosition] = React24.useState(null);
|
|
2521
2776
|
const handlePointerDownCapture = useCallback14(
|
|
2522
2777
|
(event) => {
|
|
@@ -3123,7 +3378,7 @@ var FillInputField = memo17(
|
|
|
3123
3378
|
);
|
|
3124
3379
|
|
|
3125
3380
|
// src/components/FloatingWindow.tsx
|
|
3126
|
-
import React28, { useCallback as useCallback15, useRef as useRef13, useState as
|
|
3381
|
+
import React28, { useCallback as useCallback15, useRef as useRef13, useState as useState16 } from "react";
|
|
3127
3382
|
var styles2 = {
|
|
3128
3383
|
noSelect: {
|
|
3129
3384
|
userSelect: "none",
|
|
@@ -3241,15 +3496,15 @@ var FloatingWindow = ({
|
|
|
3241
3496
|
toolbarContent,
|
|
3242
3497
|
renderToolbar = defaultRenderToolbar
|
|
3243
3498
|
}) => {
|
|
3244
|
-
const [position, setPosition] =
|
|
3245
|
-
const [size2, setSize] =
|
|
3499
|
+
const [position, setPosition] = useState16({ x: initialX, y: initialY });
|
|
3500
|
+
const [size2, setSize] = useState16({
|
|
3246
3501
|
width: initialWidth,
|
|
3247
3502
|
height: initialHeight
|
|
3248
3503
|
});
|
|
3249
|
-
const [isDragging, setIsDragging] =
|
|
3250
|
-
const [isResizing, setIsResizing] =
|
|
3251
|
-
const [dragOffset, setDragOffset] =
|
|
3252
|
-
const [resizeDirection, setResizeDirection] =
|
|
3504
|
+
const [isDragging, setIsDragging] = useState16(false);
|
|
3505
|
+
const [isResizing, setIsResizing] = useState16(false);
|
|
3506
|
+
const [dragOffset, setDragOffset] = useState16({ x: 0, y: 0 });
|
|
3507
|
+
const [resizeDirection, setResizeDirection] = useState16(null);
|
|
3253
3508
|
const wrapperRef = useRef13(null);
|
|
3254
3509
|
const toggleGlobalTextSelection = (disable) => {
|
|
3255
3510
|
if (disable) {
|
|
@@ -3504,7 +3759,7 @@ import styled22, { keyframes as keyframes2 } from "styled-components";
|
|
|
3504
3759
|
|
|
3505
3760
|
// src/components/ScrollArea.tsx
|
|
3506
3761
|
import * as RadixScrollArea from "@radix-ui/react-scroll-area";
|
|
3507
|
-
import React30, { memo as memo19, useCallback as useCallback17, useState as
|
|
3762
|
+
import React30, { memo as memo19, useCallback as useCallback17, useState as useState17 } from "react";
|
|
3508
3763
|
import styled21 from "styled-components";
|
|
3509
3764
|
var SCROLLBAR_SIZE = 10;
|
|
3510
3765
|
var StyledViewport = styled21(RadixScrollArea.Viewport)({
|
|
@@ -3533,7 +3788,7 @@ var Container2 = styled21.div({
|
|
|
3533
3788
|
minHeight: 0
|
|
3534
3789
|
});
|
|
3535
3790
|
var ScrollArea = memo19(function ScrollArea2({ children }) {
|
|
3536
|
-
const [scrollElementRef, setScrollElementRef] =
|
|
3791
|
+
const [scrollElementRef, setScrollElementRef] = useState17(null);
|
|
3537
3792
|
return /* @__PURE__ */ React30.createElement(Container2, null, /* @__PURE__ */ React30.createElement(RadixScrollArea.Root, { style: { width: "100%", height: "100%" } }, /* @__PURE__ */ React30.createElement(
|
|
3538
3793
|
StyledViewport,
|
|
3539
3794
|
{
|
|
@@ -3547,7 +3802,7 @@ var ScrollArea = memo19(function ScrollArea2({ children }) {
|
|
|
3547
3802
|
});
|
|
3548
3803
|
|
|
3549
3804
|
// src/components/GridView.tsx
|
|
3550
|
-
var
|
|
3805
|
+
var sizes2 = {
|
|
3551
3806
|
xxs: {
|
|
3552
3807
|
itemWidth: 36,
|
|
3553
3808
|
itemHeight: 36,
|
|
@@ -3583,9 +3838,9 @@ var Grid2 = styled22.div(({ theme, size: size2, padding }) => {
|
|
|
3583
3838
|
return {
|
|
3584
3839
|
color: theme.colors.text,
|
|
3585
3840
|
display: "grid",
|
|
3586
|
-
gridTemplateColumns: `repeat(auto-fill, minmax(${
|
|
3841
|
+
gridTemplateColumns: `repeat(auto-fill, minmax(${sizes2[size2].itemWidth}px, 1fr))`,
|
|
3587
3842
|
// gridAutoRows: `${sizes[size].itemHeight}px`,
|
|
3588
|
-
gap: `${
|
|
3843
|
+
gap: `${sizes2[size2].gap}px`,
|
|
3589
3844
|
// gridTemplateColumns: `repeat(auto-fill, minmax(
|
|
3590
3845
|
// ${size === 'large' ? '280px' : size === 'small' ? '160px' : '116px'}
|
|
3591
3846
|
// , 1fr))`,
|
|
@@ -3871,12 +4126,12 @@ import React35, {
|
|
|
3871
4126
|
forwardRef as forwardRef13,
|
|
3872
4127
|
memo as memo23,
|
|
3873
4128
|
useCallback as useCallback21,
|
|
3874
|
-
useEffect as
|
|
4129
|
+
useEffect as useEffect14,
|
|
3875
4130
|
useImperativeHandle as useImperativeHandle3,
|
|
3876
4131
|
useLayoutEffect as useLayoutEffect7,
|
|
3877
4132
|
useMemo as useMemo19,
|
|
3878
4133
|
useRef as useRef16,
|
|
3879
|
-
useState as
|
|
4134
|
+
useState as useState19
|
|
3880
4135
|
} from "react";
|
|
3881
4136
|
import styled25 from "styled-components";
|
|
3882
4137
|
|
|
@@ -4013,9 +4268,10 @@ import React32, {
|
|
|
4013
4268
|
memo as memo21,
|
|
4014
4269
|
useCallback as useCallback19,
|
|
4015
4270
|
useContext as useContext8,
|
|
4271
|
+
useEffect as useEffect13,
|
|
4016
4272
|
useMemo as useMemo17,
|
|
4017
4273
|
useRef as useRef14,
|
|
4018
|
-
useState as
|
|
4274
|
+
useState as useState18
|
|
4019
4275
|
} from "react";
|
|
4020
4276
|
import { createPortal as createPortal2 } from "react-dom";
|
|
4021
4277
|
var normalizeListDestinationIndex = (index, position) => {
|
|
@@ -4103,12 +4359,12 @@ function SortableRoot({
|
|
|
4103
4359
|
}
|
|
4104
4360
|
})
|
|
4105
4361
|
);
|
|
4106
|
-
const [activeIndex, setActiveIndex] =
|
|
4362
|
+
const [activeIndex, setActiveIndex] = useState18();
|
|
4107
4363
|
const activatorEvent = useRef14(null);
|
|
4108
4364
|
const setActivatorEvent = useCallback19((event) => {
|
|
4109
4365
|
activatorEvent.current = event;
|
|
4110
4366
|
}, []);
|
|
4111
|
-
const [position, setPosition] =
|
|
4367
|
+
const [position, setPosition] = useState18({ x: 0, y: 0 });
|
|
4112
4368
|
const handleDragStart = useCallback19(
|
|
4113
4369
|
(event) => {
|
|
4114
4370
|
setActiveIndex(keys.indexOf(event.active.id));
|
|
@@ -4145,6 +4401,10 @@ function SortableRoot({
|
|
|
4145
4401
|
},
|
|
4146
4402
|
[acceptsDrop, axis, keys, onMoveItem, position.x, position.y]
|
|
4147
4403
|
);
|
|
4404
|
+
const [mounted, setMounted] = useState18(false);
|
|
4405
|
+
useEffect13(() => {
|
|
4406
|
+
setMounted(true);
|
|
4407
|
+
}, []);
|
|
4148
4408
|
return /* @__PURE__ */ React32.createElement(
|
|
4149
4409
|
SortableItemContext.Provider,
|
|
4150
4410
|
{
|
|
@@ -4169,7 +4429,7 @@ function SortableRoot({
|
|
|
4169
4429
|
onDragEnd: handleDragEnd
|
|
4170
4430
|
},
|
|
4171
4431
|
/* @__PURE__ */ React32.createElement(SortableContext, { items: keys, strategy: verticalListSortingStrategy }, children),
|
|
4172
|
-
renderOverlay && createPortal2(
|
|
4432
|
+
mounted && renderOverlay && createPortal2(
|
|
4173
4433
|
/* @__PURE__ */ React32.createElement(DragOverlay, { dropAnimation: null }, activeIndex !== void 0 && activeIndex >= 0 && renderOverlay(activeIndex)),
|
|
4174
4434
|
document.body
|
|
4175
4435
|
)
|
|
@@ -4959,8 +5219,8 @@ var InputFieldWithCompletions = memo23(
|
|
|
4959
5219
|
hideMenuWhenEmptyValue = false
|
|
4960
5220
|
}, forwardedRef) {
|
|
4961
5221
|
const ref = useRef16(null);
|
|
4962
|
-
const [isFocused, setIsFocused] =
|
|
4963
|
-
const [state, _setState] =
|
|
5222
|
+
const [isFocused, setIsFocused] = useState19(false);
|
|
5223
|
+
const [state, _setState] = useState19({
|
|
4964
5224
|
filter: initialValue,
|
|
4965
5225
|
selectedIndex: 0
|
|
4966
5226
|
});
|
|
@@ -5018,7 +5278,7 @@ var InputFieldWithCompletions = memo23(
|
|
|
5018
5278
|
),
|
|
5019
5279
|
ListView.rowHeight * 10.5
|
|
5020
5280
|
);
|
|
5021
|
-
|
|
5281
|
+
useEffect14(() => {
|
|
5022
5282
|
if (listRef.current) {
|
|
5023
5283
|
listRef.current.scrollToIndex(selectedIndex);
|
|
5024
5284
|
}
|
|
@@ -5536,7 +5796,7 @@ import React40, {
|
|
|
5536
5796
|
memo as memo27,
|
|
5537
5797
|
useCallback as useCallback23,
|
|
5538
5798
|
useContext as useContext11,
|
|
5539
|
-
useEffect as
|
|
5799
|
+
useEffect as useEffect15,
|
|
5540
5800
|
useMemo as useMemo22,
|
|
5541
5801
|
useRef as useRef18
|
|
5542
5802
|
} from "react";
|
|
@@ -5548,7 +5808,7 @@ var SelectOption = memo27(function SelectOption2({
|
|
|
5548
5808
|
onSelect
|
|
5549
5809
|
}) {
|
|
5550
5810
|
const { addListener, removeListener } = useContext11(SelectContext);
|
|
5551
|
-
|
|
5811
|
+
useEffect15(() => {
|
|
5552
5812
|
if (!onSelect)
|
|
5553
5813
|
return;
|
|
5554
5814
|
addListener(value, onSelect);
|
|
@@ -5563,6 +5823,14 @@ var createChevronSVGString = memoize2(
|
|
|
5563
5823
|
</svg>
|
|
5564
5824
|
`
|
|
5565
5825
|
);
|
|
5826
|
+
var SelectContainer = styled30.div(
|
|
5827
|
+
({ flex }) => ({
|
|
5828
|
+
flex: flex ?? "1 1 0px",
|
|
5829
|
+
display: "flex",
|
|
5830
|
+
flexDirection: "row",
|
|
5831
|
+
position: "relative"
|
|
5832
|
+
})
|
|
5833
|
+
);
|
|
5566
5834
|
var SelectElement = styled30.select(
|
|
5567
5835
|
({ theme, flex }) => ({
|
|
5568
5836
|
appearance: "none",
|
|
@@ -5594,10 +5862,25 @@ var SelectElement = styled30.select(
|
|
|
5594
5862
|
}
|
|
5595
5863
|
})
|
|
5596
5864
|
);
|
|
5865
|
+
var SelectLabel = styled30.label(({ theme }) => ({
|
|
5866
|
+
...theme.textStyles.label,
|
|
5867
|
+
color: theme.colors.textDisabled,
|
|
5868
|
+
lineHeight: "19px",
|
|
5869
|
+
position: "absolute",
|
|
5870
|
+
inset: "0",
|
|
5871
|
+
fontWeight: "bold",
|
|
5872
|
+
fontSize: "60%",
|
|
5873
|
+
pointerEvents: "none",
|
|
5874
|
+
display: "flex",
|
|
5875
|
+
alignItems: "center",
|
|
5876
|
+
justifyContent: "end",
|
|
5877
|
+
paddingRight: "24px"
|
|
5878
|
+
}));
|
|
5597
5879
|
var Select = memo27(function Select2({
|
|
5598
5880
|
id,
|
|
5599
5881
|
flex,
|
|
5600
5882
|
value,
|
|
5883
|
+
label,
|
|
5601
5884
|
...rest
|
|
5602
5885
|
}) {
|
|
5603
5886
|
const options = "options" in rest ? rest.options : void 0;
|
|
@@ -5624,7 +5907,7 @@ var Select = memo27(function Select2({
|
|
|
5624
5907
|
}),
|
|
5625
5908
|
[]
|
|
5626
5909
|
);
|
|
5627
|
-
return /* @__PURE__ */ React40.createElement(SelectContext.Provider, { value: contextValue }, /* @__PURE__ */ React40.createElement(
|
|
5910
|
+
return /* @__PURE__ */ React40.createElement(SelectContext.Provider, { value: contextValue }, /* @__PURE__ */ React40.createElement(SelectContainer, { flex }, /* @__PURE__ */ React40.createElement(
|
|
5628
5911
|
SelectElement,
|
|
5629
5912
|
{
|
|
5630
5913
|
id,
|
|
@@ -5637,7 +5920,7 @@ var Select = memo27(function Select2({
|
|
|
5637
5920
|
onPointerDown: (event) => event.stopPropagation()
|
|
5638
5921
|
},
|
|
5639
5922
|
optionElements
|
|
5640
|
-
));
|
|
5923
|
+
)), label && /* @__PURE__ */ React40.createElement(SelectLabel, { htmlFor: id }, label));
|
|
5641
5924
|
});
|
|
5642
5925
|
|
|
5643
5926
|
// src/components/Slider.tsx
|
|
@@ -5806,241 +6089,16 @@ function usePlatformModKey() {
|
|
|
5806
6089
|
return platform === "mac" ? "metaKey" : "ctrlKey";
|
|
5807
6090
|
}
|
|
5808
6091
|
|
|
5809
|
-
// src/mediaQuery.ts
|
|
5810
|
-
var size = {
|
|
5811
|
-
medium: "800px",
|
|
5812
|
-
large: "1280px",
|
|
5813
|
-
xlarge: "1550px",
|
|
5814
|
-
xxlarge: "1680px"
|
|
5815
|
-
};
|
|
5816
|
-
var mediaQuery = {
|
|
5817
|
-
small: `@media (max-width: ${size.medium})`,
|
|
5818
|
-
medium: `@media (max-width: ${size.large}) and (min-width: ${size.medium})`,
|
|
5819
|
-
large: `@media (max-width: ${size.xlarge}) and (min-width: ${size.large})`,
|
|
5820
|
-
xlarge: `@media (min-width: ${size.xlarge})`
|
|
5821
|
-
};
|
|
5822
|
-
|
|
5823
6092
|
// src/theme/dark.ts
|
|
5824
6093
|
var dark_exports = {};
|
|
5825
6094
|
__export(dark_exports, {
|
|
5826
6095
|
colors: () => colors2,
|
|
5827
6096
|
fonts: () => fonts,
|
|
5828
6097
|
name: () => name2,
|
|
5829
|
-
sizes: () =>
|
|
6098
|
+
sizes: () => sizes,
|
|
5830
6099
|
textStyles: () => textStyles
|
|
5831
6100
|
});
|
|
5832
6101
|
import produce from "immer";
|
|
5833
|
-
|
|
5834
|
-
// src/theme/light.ts
|
|
5835
|
-
var light_exports = {};
|
|
5836
|
-
__export(light_exports, {
|
|
5837
|
-
colors: () => colors,
|
|
5838
|
-
fonts: () => fonts,
|
|
5839
|
-
name: () => name,
|
|
5840
|
-
sizes: () => sizes2,
|
|
5841
|
-
textStyles: () => textStyles
|
|
5842
|
-
});
|
|
5843
|
-
var name = "light";
|
|
5844
|
-
var colors = {
|
|
5845
|
-
logo: {
|
|
5846
|
-
fill: "rgb(175,175,175)",
|
|
5847
|
-
highlight: "rgb(175,175,175)"
|
|
5848
|
-
},
|
|
5849
|
-
text: "rgb(38, 48, 83)",
|
|
5850
|
-
textMuted: "rgb(85, 85, 85)",
|
|
5851
|
-
textSubtle: "rgb(121, 121, 121)",
|
|
5852
|
-
textDisabled: "rgb(160, 160, 160)",
|
|
5853
|
-
textDecorativeLight: "rgb(168, 185, 212)",
|
|
5854
|
-
dividerSubtle: "rgba(0, 0, 0, 0.04)",
|
|
5855
|
-
divider: "rgba(0, 0, 0, 0.07)",
|
|
5856
|
-
dividerStrong: "rgba(0, 0, 0, 0.09)",
|
|
5857
|
-
primary: "rgb(132, 63, 255)",
|
|
5858
|
-
primaryLight: "rgb(147, 86, 255)",
|
|
5859
|
-
secondary: "rgb(0, 151, 117)",
|
|
5860
|
-
secondaryLight: "rgb(0, 160, 129)",
|
|
5861
|
-
secondaryBright: "#0ab557",
|
|
5862
|
-
warning: "rgb(251, 211, 0)",
|
|
5863
|
-
neutralBackground: "rgb(222,223,232)",
|
|
5864
|
-
inputBackground: "rgb(240, 240, 242)",
|
|
5865
|
-
inputBackgroundLight: "rgb(243, 243, 245)",
|
|
5866
|
-
codeBackground: "rgb(250, 250, 250)",
|
|
5867
|
-
codeBackgroundLight: "rgb(250, 250, 250)",
|
|
5868
|
-
get codeBackgroundDark() {
|
|
5869
|
-
return colors.text;
|
|
5870
|
-
},
|
|
5871
|
-
codeBackgroundDecorativeDark: "#435080",
|
|
5872
|
-
selectedBackground: "rgb(242, 245, 250)",
|
|
5873
|
-
transparentChecker: "rgba(255,255,255,0.8)",
|
|
5874
|
-
activeBackground: "rgba(0,0,0,0.1)",
|
|
5875
|
-
scrollbar: "rgba(199,199,199,0.8)",
|
|
5876
|
-
placeholderDots: "rgba(0,0,0,0.3)",
|
|
5877
|
-
breadcrumb: {
|
|
5878
|
-
get text() {
|
|
5879
|
-
return colors.textMuted;
|
|
5880
|
-
},
|
|
5881
|
-
get textHover() {
|
|
5882
|
-
return colors.textSubtle;
|
|
5883
|
-
},
|
|
5884
|
-
get icon() {
|
|
5885
|
-
return colors.icon;
|
|
5886
|
-
}
|
|
5887
|
-
},
|
|
5888
|
-
listView: {
|
|
5889
|
-
raisedBackground: "rgba(0,0,0,0.03)",
|
|
5890
|
-
editingBackground: "#fff"
|
|
5891
|
-
},
|
|
5892
|
-
canvas: {
|
|
5893
|
-
background: "rgb(249,249,249)",
|
|
5894
|
-
get selectionStroke() {
|
|
5895
|
-
return colors.primary;
|
|
5896
|
-
},
|
|
5897
|
-
dragHandleStroke: "rgba(180,180,180,0.5)",
|
|
5898
|
-
measurement: "rgb(207,92,42)",
|
|
5899
|
-
sliceOutline: "rgb(210,210,210)",
|
|
5900
|
-
grid: "rgba(0,0,0,0.05)"
|
|
5901
|
-
},
|
|
5902
|
-
sidebar: {
|
|
5903
|
-
background: "rgba(252,252,252,0.85)"
|
|
5904
|
-
},
|
|
5905
|
-
popover: {
|
|
5906
|
-
background: "rgb(252,252,252)",
|
|
5907
|
-
divider: "transparent"
|
|
5908
|
-
},
|
|
5909
|
-
slider: {
|
|
5910
|
-
background: "white",
|
|
5911
|
-
border: "#BBB"
|
|
5912
|
-
},
|
|
5913
|
-
radioGroup: {
|
|
5914
|
-
background: "white"
|
|
5915
|
-
},
|
|
5916
|
-
icon: "rgb(139, 139, 139)",
|
|
5917
|
-
iconSelected: "rgb(220, 220, 220)",
|
|
5918
|
-
mask: "rgb(12,193,67)",
|
|
5919
|
-
imageOverlay: "linear-gradient(0deg, rgba(132, 63, 255,0.55), rgba(132, 63, 255,0.55))",
|
|
5920
|
-
get dragOutline() {
|
|
5921
|
-
return colors.primary;
|
|
5922
|
-
},
|
|
5923
|
-
selection: "rgb(179,215,254)",
|
|
5924
|
-
thumbnailBackground: "#f0efff",
|
|
5925
|
-
thumbnailShadow: "#D3CEED66"
|
|
5926
|
-
};
|
|
5927
|
-
var fonts = {
|
|
5928
|
-
normal: "'__Inter_6b0edc', '__Inter_Fallback_6b0edc', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif",
|
|
5929
|
-
monospace: "Menlo, Monaco, Consolas, 'Courier New', monospace"
|
|
5930
|
-
};
|
|
5931
|
-
var typeScale = [3.052, 2.441, 1.953, 1.563, 1.25, 1, 0.85];
|
|
5932
|
-
var textStyles = {
|
|
5933
|
-
title: {
|
|
5934
|
-
fontFamily: fonts.normal,
|
|
5935
|
-
fontSize: `${typeScale[0]}rem`,
|
|
5936
|
-
fontWeight: "bold",
|
|
5937
|
-
lineHeight: "1.4",
|
|
5938
|
-
letterSpacing: "-0.05em",
|
|
5939
|
-
[mediaQuery.small]: {
|
|
5940
|
-
fontSize: "36px"
|
|
5941
|
-
}
|
|
5942
|
-
},
|
|
5943
|
-
subtitle: {
|
|
5944
|
-
fontFamily: fonts.normal,
|
|
5945
|
-
fontSize: `${typeScale[3]}rem`,
|
|
5946
|
-
fontWeight: 500,
|
|
5947
|
-
lineHeight: "1.75",
|
|
5948
|
-
letterSpacing: "-0.05em",
|
|
5949
|
-
[mediaQuery.small]: {
|
|
5950
|
-
fontSize: "18px"
|
|
5951
|
-
}
|
|
5952
|
-
},
|
|
5953
|
-
heading1: {
|
|
5954
|
-
fontFamily: fonts.normal,
|
|
5955
|
-
fontSize: `${typeScale[2]}rem`,
|
|
5956
|
-
fontWeight: 500,
|
|
5957
|
-
lineHeight: "1.75",
|
|
5958
|
-
letterSpacing: "-0.025em"
|
|
5959
|
-
},
|
|
5960
|
-
heading2: {
|
|
5961
|
-
fontFamily: fonts.normal,
|
|
5962
|
-
fontSize: `${typeScale[3]}rem`,
|
|
5963
|
-
fontWeight: 500,
|
|
5964
|
-
lineHeight: "1.75",
|
|
5965
|
-
letterSpacing: "-0.025em"
|
|
5966
|
-
},
|
|
5967
|
-
heading3: {
|
|
5968
|
-
fontFamily: fonts.normal,
|
|
5969
|
-
fontSize: `${typeScale[4]}rem`,
|
|
5970
|
-
fontWeight: 500,
|
|
5971
|
-
lineHeight: "1.75",
|
|
5972
|
-
letterSpacing: "-0.025em"
|
|
5973
|
-
},
|
|
5974
|
-
heading4: {
|
|
5975
|
-
fontFamily: fonts.normal,
|
|
5976
|
-
fontSize: `${typeScale[5]}rem`,
|
|
5977
|
-
fontWeight: 500,
|
|
5978
|
-
lineHeight: "1.75"
|
|
5979
|
-
},
|
|
5980
|
-
heading5: {
|
|
5981
|
-
fontFamily: fonts.normal,
|
|
5982
|
-
fontSize: `${typeScale[6]}rem`,
|
|
5983
|
-
fontWeight: 500,
|
|
5984
|
-
lineHeight: "1.75"
|
|
5985
|
-
},
|
|
5986
|
-
body: {
|
|
5987
|
-
fontFamily: fonts.normal,
|
|
5988
|
-
fontSize: `${typeScale[5]}rem`,
|
|
5989
|
-
fontWeight: 400,
|
|
5990
|
-
lineHeight: "1.75"
|
|
5991
|
-
},
|
|
5992
|
-
small: {
|
|
5993
|
-
fontFamily: fonts.normal,
|
|
5994
|
-
fontSize: `${typeScale[6]}rem`,
|
|
5995
|
-
fontWeight: 400,
|
|
5996
|
-
lineHeight: "1.4"
|
|
5997
|
-
},
|
|
5998
|
-
button: {
|
|
5999
|
-
fontFamily: fonts.normal,
|
|
6000
|
-
fontSize: "0.8rem",
|
|
6001
|
-
fontWeight: 500,
|
|
6002
|
-
lineHeight: "1.4",
|
|
6003
|
-
letterSpacing: "-0.2px"
|
|
6004
|
-
},
|
|
6005
|
-
code: {
|
|
6006
|
-
fontFamily: fonts.monospace,
|
|
6007
|
-
fontSize: "90%",
|
|
6008
|
-
lineHeight: "1.5"
|
|
6009
|
-
},
|
|
6010
|
-
label: {
|
|
6011
|
-
fontFamily: fonts.normal,
|
|
6012
|
-
fontSize: "0.62rem",
|
|
6013
|
-
fontWeight: 400,
|
|
6014
|
-
lineHeight: "1.4",
|
|
6015
|
-
textTransform: "uppercase",
|
|
6016
|
-
letterSpacing: "0.3px"
|
|
6017
|
-
}
|
|
6018
|
-
};
|
|
6019
|
-
var sizes2 = {
|
|
6020
|
-
sidebarWidth: 260,
|
|
6021
|
-
toolbar: {
|
|
6022
|
-
height: 46,
|
|
6023
|
-
itemSeparator: 8
|
|
6024
|
-
},
|
|
6025
|
-
inspector: {
|
|
6026
|
-
horizontalSeparator: 8,
|
|
6027
|
-
verticalSeparator: 10
|
|
6028
|
-
},
|
|
6029
|
-
spacing: {
|
|
6030
|
-
nano: 2,
|
|
6031
|
-
micro: 4,
|
|
6032
|
-
small: 8,
|
|
6033
|
-
medium: 16,
|
|
6034
|
-
large: 32,
|
|
6035
|
-
xlarge: 64,
|
|
6036
|
-
xxlarge: 128
|
|
6037
|
-
},
|
|
6038
|
-
dialog: {
|
|
6039
|
-
padding: 16
|
|
6040
|
-
}
|
|
6041
|
-
};
|
|
6042
|
-
|
|
6043
|
-
// src/theme/dark.ts
|
|
6044
6102
|
var name2 = "dark";
|
|
6045
6103
|
var colors2 = produce(colors, (colors3) => {
|
|
6046
6104
|
colors3.logo.fill = "rgb(248,248,250)";
|
|
@@ -6368,6 +6426,7 @@ export {
|
|
|
6368
6426
|
CompletionToken,
|
|
6369
6427
|
ContextMenu,
|
|
6370
6428
|
DesignSystemConfigurationProvider,
|
|
6429
|
+
DesignSystemThemeProvider,
|
|
6371
6430
|
Dialog,
|
|
6372
6431
|
DialogProvider,
|
|
6373
6432
|
DimensionInput,
|