@noya-app/noya-designsystem 0.1.15 → 0.1.17
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 +17 -0
- package/dist/index.d.mts +58 -59
- package/dist/index.d.ts +58 -59
- package/dist/index.js +853 -828
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +561 -536
- package/dist/index.mjs.map +1 -1
- package/package.json +7 -7
- package/src/components/ActivityIndicator.tsx +23 -13
- package/src/components/ArrayController.tsx +5 -5
- package/src/components/Avatar.tsx +5 -5
- package/src/components/Button.tsx +39 -36
- package/src/components/Chip.tsx +25 -25
- package/src/components/Divider.tsx +45 -20
- package/src/components/FillInputField.tsx +23 -23
- package/src/components/InputField.tsx +78 -91
- package/src/components/InputFieldWithCompletions.tsx +4 -4
- package/src/components/InspectorPrimitives.tsx +18 -18
- package/src/components/Label.tsx +21 -21
- package/src/components/ListView.tsx +100 -95
- package/src/components/RadioGroup.tsx +1 -2
- package/src/components/Select.tsx +11 -11
- package/src/components/Spacer.tsx +30 -7
- package/src/components/Stack.tsx +8 -8
- package/src/components/Switch.tsx +9 -10
- package/src/components/Text.tsx +15 -15
- package/src/components/internal/Menu.tsx +6 -10
- package/src/contexts/DesignSystemConfiguration.tsx +8 -1
- package/src/theme/dark.ts +2 -1
- package/src/theme/light.ts +2 -1
package/dist/index.mjs
CHANGED
|
@@ -15,14 +15,14 @@ var Spinner = styled.div`
|
|
|
15
15
|
display: flex;
|
|
16
16
|
justify-content: center;
|
|
17
17
|
align-items: center;
|
|
18
|
-
opacity: ${({ opacity }) => opacity};
|
|
18
|
+
opacity: ${({ $opacity }) => $opacity};
|
|
19
19
|
`;
|
|
20
20
|
var SpinnerCircle = styled.div`
|
|
21
|
-
border: 2px solid ${({ trackColor }) => trackColor};
|
|
22
|
-
border-top: 2px solid ${({ color }) => color};
|
|
21
|
+
border: 2px solid ${({ $trackColor }) => $trackColor};
|
|
22
|
+
border-top: 2px solid ${({ $color }) => $color};
|
|
23
23
|
border-radius: 50%;
|
|
24
|
-
width: ${({ size
|
|
25
|
-
height: ${({ size
|
|
24
|
+
width: ${({ $size }) => `${$size}px`};
|
|
25
|
+
height: ${({ $size }) => `${$size}px`};
|
|
26
26
|
animation: ${spin} 1s linear infinite;
|
|
27
27
|
`;
|
|
28
28
|
var ActivityIndicator = memo(function ActivityIndicator2({
|
|
@@ -31,7 +31,7 @@ var ActivityIndicator = memo(function ActivityIndicator2({
|
|
|
31
31
|
color = "black",
|
|
32
32
|
trackColor = "rgba(0, 0, 0, 0.1)"
|
|
33
33
|
}) {
|
|
34
|
-
return /* @__PURE__ */ React.createElement(Spinner, { opacity }, /* @__PURE__ */ React.createElement(SpinnerCircle, { size: size2, color, trackColor }));
|
|
34
|
+
return /* @__PURE__ */ React.createElement(Spinner, { $opacity: opacity }, /* @__PURE__ */ React.createElement(SpinnerCircle, { $size: size2, $color: color, $trackColor: trackColor }));
|
|
35
35
|
});
|
|
36
36
|
|
|
37
37
|
// src/components/Avatar.tsx
|
|
@@ -85,9 +85,9 @@ function withSeparatorElements(elements2, separator) {
|
|
|
85
85
|
}
|
|
86
86
|
|
|
87
87
|
// src/components/Stack.tsx
|
|
88
|
-
var Element = styled2.div(({ styleProps, breakpoints }) => ({
|
|
89
|
-
|
|
90
|
-
...mergeBreakpoints(breakpoints || [])
|
|
88
|
+
var Element = styled2.div(({ $styleProps, $breakpoints }) => ({
|
|
89
|
+
...$styleProps,
|
|
90
|
+
...mergeBreakpoints($breakpoints || [])
|
|
91
91
|
}));
|
|
92
92
|
var StackBase = forwardRef(function StackBase2({ id, as, children, separator, breakpoints, tabIndex, href, ...rest }, forwardedRef) {
|
|
93
93
|
const elements2 = separator ? withSeparatorElements(Children2.toArray(children), separator) : children;
|
|
@@ -103,8 +103,8 @@ var StackBase = forwardRef(function StackBase2({ id, as, children, separator, br
|
|
|
103
103
|
ref: forwardedRef,
|
|
104
104
|
id,
|
|
105
105
|
as,
|
|
106
|
-
styleProps,
|
|
107
|
-
breakpoints,
|
|
106
|
+
$styleProps: styleProps,
|
|
107
|
+
$breakpoints: breakpoints,
|
|
108
108
|
tabIndex,
|
|
109
109
|
...href && { href }
|
|
110
110
|
},
|
|
@@ -173,10 +173,10 @@ var Avatar = forwardRef2(function Avatar2({
|
|
|
173
173
|
}, forwardedRef) {
|
|
174
174
|
return /* @__PURE__ */ React3.createElement(AvatarRoot, { ref: forwardedRef, size: size2, overflow, ...props }, /* @__PURE__ */ React3.createElement(AvatarImage, { src: image, alt: name3 }), /* @__PURE__ */ React3.createElement(AvatarFallback, { size: size2 }, fallback));
|
|
175
175
|
});
|
|
176
|
-
var AvatarStackItemWrapper = styled3.div(({ size
|
|
176
|
+
var AvatarStackItemWrapper = styled3.div(({ $size, theme }) => ({
|
|
177
177
|
position: "relative",
|
|
178
|
-
width:
|
|
179
|
-
height:
|
|
178
|
+
width: $size,
|
|
179
|
+
height: $size,
|
|
180
180
|
marginLeft: "-8px",
|
|
181
181
|
// outline: `2px solid ${theme.colors.sidebar.background}`,
|
|
182
182
|
borderRadius: "50%",
|
|
@@ -193,7 +193,7 @@ function AvatarStack({
|
|
|
193
193
|
return /* @__PURE__ */ React3.createElement(Stack.H, null, childrenArray.map((child, index) => {
|
|
194
194
|
if (index === 0)
|
|
195
195
|
return child;
|
|
196
|
-
return /* @__PURE__ */ React3.createElement(AvatarStackItemWrapper, { size: size2, key: index }, child);
|
|
196
|
+
return /* @__PURE__ */ React3.createElement(AvatarStackItemWrapper, { $size: size2, key: index }, child);
|
|
197
197
|
}));
|
|
198
198
|
}
|
|
199
199
|
|
|
@@ -234,48 +234,49 @@ var Tooltip = memo3(function Tooltip2({ children, content }) {
|
|
|
234
234
|
var ButtonElement = styled5.button(
|
|
235
235
|
({
|
|
236
236
|
theme,
|
|
237
|
-
active,
|
|
237
|
+
$active,
|
|
238
238
|
disabled,
|
|
239
|
-
variant,
|
|
240
|
-
size
|
|
241
|
-
flex,
|
|
242
|
-
defaultBackground = theme.colors.inputBackground
|
|
239
|
+
$variant,
|
|
240
|
+
$size,
|
|
241
|
+
$flex,
|
|
242
|
+
$defaultBackground = theme.colors.inputBackground
|
|
243
243
|
}) => ({
|
|
244
|
-
|
|
244
|
+
...$size === "large" ? theme.textStyles.heading4 : theme.textStyles.button,
|
|
245
245
|
textDecoration: "none",
|
|
246
246
|
lineHeight: "1",
|
|
247
|
-
flex: flex ?? "0 0 auto",
|
|
247
|
+
flex: $flex ?? "0 0 auto",
|
|
248
248
|
position: "relative",
|
|
249
249
|
border: "0",
|
|
250
250
|
outline: "none",
|
|
251
251
|
WebkitAppRegion: "no-drag",
|
|
252
252
|
userSelect: "none",
|
|
253
|
-
minWidth: variant === "normal" ? "31px" : void 0,
|
|
253
|
+
minWidth: $variant === "normal" ? "31px" : void 0,
|
|
254
254
|
textAlign: "left",
|
|
255
255
|
borderRadius: "4px",
|
|
256
|
-
paddingTop: variant === "none" ? "0px" : "4px",
|
|
257
|
-
paddingRight: variant === "none" ? "0px" : variant === "thin" ? "1px" : "8px",
|
|
258
|
-
paddingBottom: variant === "none" ? "0px" : "4px",
|
|
259
|
-
paddingLeft: variant === "none" ? "0px" : variant === "thin" ? "1px" : "8px",
|
|
260
|
-
|
|
256
|
+
paddingTop: $variant === "none" ? "0px" : "4px",
|
|
257
|
+
paddingRight: $variant === "none" ? "0px" : $variant === "thin" ? "1px" : "8px",
|
|
258
|
+
paddingBottom: $variant === "none" ? "0px" : "4px",
|
|
259
|
+
paddingLeft: $variant === "none" ? "0px" : $variant === "thin" ? "1px" : "8px",
|
|
260
|
+
...$size === "large" && {
|
|
261
261
|
paddingTop: "12px",
|
|
262
262
|
paddingRight: "16px",
|
|
263
263
|
paddingBottom: "12px",
|
|
264
264
|
paddingLeft: "16px"
|
|
265
265
|
},
|
|
266
|
-
background: active ? theme.colors.primary : variant === "primaryGradient" ? `linear-gradient(90deg, ${theme.colors.primary}, ${theme.colors.primaryLight})` : variant === "none" || variant === "thin" ? "transparent" : defaultBackground,
|
|
267
|
-
color: active ? "white" : theme.colors.text,
|
|
266
|
+
background: $active ? theme.colors.primary : $variant === "primaryGradient" ? `linear-gradient(90deg, ${theme.colors.primary}, ${theme.colors.primaryLight})` : $variant === "none" || $variant === "thin" ? "transparent" : $defaultBackground,
|
|
267
|
+
color: $active ? "white" : theme.colors.text,
|
|
268
268
|
opacity: disabled ? 0.25 : 1,
|
|
269
269
|
"&:focus": {
|
|
270
|
-
|
|
270
|
+
outline: `2px solid ${theme.colors.primary}`,
|
|
271
|
+
boxShadow: `0 0 0 1px ${theme.colors.popover.background} inset`
|
|
271
272
|
},
|
|
272
273
|
"&:hover": {
|
|
273
|
-
background: variant === "primaryGradient" || active ? theme.colors.primaryLight : theme.colors.inputBackgroundLight
|
|
274
|
+
background: $variant === "primaryGradient" || $active ? theme.colors.primaryLight : theme.colors.inputBackgroundLight
|
|
274
275
|
},
|
|
275
276
|
"&:active": {
|
|
276
|
-
background: variant === "primaryGradient" || active ? theme.colors.primary : theme.colors.activeBackground
|
|
277
|
+
background: $variant === "primaryGradient" || $active ? theme.colors.primary : theme.colors.activeBackground
|
|
277
278
|
},
|
|
278
|
-
|
|
279
|
+
...$variant === "primary" && {
|
|
279
280
|
background: theme.colors.primary,
|
|
280
281
|
color: "white",
|
|
281
282
|
"&:hover": {
|
|
@@ -285,7 +286,7 @@ var ButtonElement = styled5.button(
|
|
|
285
286
|
background: theme.colors.primary
|
|
286
287
|
}
|
|
287
288
|
},
|
|
288
|
-
|
|
289
|
+
...$variant === "secondary" && {
|
|
289
290
|
background: theme.colors.secondary,
|
|
290
291
|
color: "white",
|
|
291
292
|
"&:hover": {
|
|
@@ -295,7 +296,7 @@ var ButtonElement = styled5.button(
|
|
|
295
296
|
background: theme.colors.secondary
|
|
296
297
|
}
|
|
297
298
|
},
|
|
298
|
-
|
|
299
|
+
...$variant === "secondaryBright" && {
|
|
299
300
|
background: "#0ab557",
|
|
300
301
|
color: "white",
|
|
301
302
|
"&:hover": {
|
|
@@ -305,7 +306,7 @@ var ButtonElement = styled5.button(
|
|
|
305
306
|
opacity: 0.9
|
|
306
307
|
}
|
|
307
308
|
},
|
|
308
|
-
|
|
309
|
+
...$variant === "white" && {
|
|
309
310
|
background: "white",
|
|
310
311
|
"&:hover": {
|
|
311
312
|
opacity: 0.8
|
|
@@ -314,7 +315,7 @@ var ButtonElement = styled5.button(
|
|
|
314
315
|
opacity: 0.9
|
|
315
316
|
}
|
|
316
317
|
},
|
|
317
|
-
|
|
318
|
+
...$variant === "floating" && {
|
|
318
319
|
background: "white",
|
|
319
320
|
color: theme.colors.text,
|
|
320
321
|
boxShadow: "0 1px 2px rgba(0, 0, 0, 0.1)",
|
|
@@ -365,13 +366,13 @@ var Button = forwardRef3(function Button2({
|
|
|
365
366
|
id,
|
|
366
367
|
className,
|
|
367
368
|
style: style3,
|
|
368
|
-
flex,
|
|
369
|
+
$flex: flex,
|
|
369
370
|
tabIndex,
|
|
370
|
-
active,
|
|
371
|
+
$active: active,
|
|
371
372
|
disabled,
|
|
372
|
-
variant,
|
|
373
|
-
size: size2,
|
|
374
|
-
defaultBackground,
|
|
373
|
+
$variant: variant,
|
|
374
|
+
$size: size2,
|
|
375
|
+
$defaultBackground: defaultBackground,
|
|
375
376
|
onClick,
|
|
376
377
|
onDoubleClick: useCallback((event) => {
|
|
377
378
|
event.stopPropagation();
|
|
@@ -385,12 +386,12 @@ var Button = forwardRef3(function Button2({
|
|
|
385
386
|
|
|
386
387
|
// src/components/Chip.tsx
|
|
387
388
|
import { Cross1Icon, PlusIcon } from "@noya-app/noya-icons";
|
|
388
|
-
import
|
|
389
|
+
import React22, { memo as memo11 } from "react";
|
|
389
390
|
import styled14 from "styled-components";
|
|
390
391
|
|
|
391
392
|
// src/contexts/DesignSystemConfiguration.tsx
|
|
392
393
|
import { getCurrentPlatform } from "@noya-app/noya-keymap";
|
|
393
|
-
import
|
|
394
|
+
import React20, {
|
|
394
395
|
createContext as createContext5,
|
|
395
396
|
memo as memo10,
|
|
396
397
|
useContext as useContext5,
|
|
@@ -573,7 +574,8 @@ var colors = {
|
|
|
573
574
|
grid: "rgba(0,0,0,0.05)"
|
|
574
575
|
},
|
|
575
576
|
sidebar: {
|
|
576
|
-
background: "
|
|
577
|
+
background: "rgb(252,252,252)",
|
|
578
|
+
backgroundTransparent: "rgba(252,252,252,0.85)"
|
|
577
579
|
},
|
|
578
580
|
popover: {
|
|
579
581
|
background: "rgb(252,252,252)",
|
|
@@ -714,7 +716,7 @@ var sizes = {
|
|
|
714
716
|
};
|
|
715
717
|
|
|
716
718
|
// src/contexts/DialogContext.tsx
|
|
717
|
-
import
|
|
719
|
+
import React18, {
|
|
718
720
|
createContext as createContext3,
|
|
719
721
|
useCallback as useCallback12,
|
|
720
722
|
useContext as useContext3,
|
|
@@ -726,23 +728,34 @@ import styled13 from "styled-components";
|
|
|
726
728
|
|
|
727
729
|
// src/components/Dialog.tsx
|
|
728
730
|
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
729
|
-
import
|
|
730
|
-
forwardRef as
|
|
731
|
+
import React9, {
|
|
732
|
+
forwardRef as forwardRef6,
|
|
731
733
|
useImperativeHandle,
|
|
732
734
|
useRef
|
|
733
735
|
} from "react";
|
|
734
736
|
import styled8 from "styled-components";
|
|
735
737
|
|
|
736
738
|
// src/components/Spacer.tsx
|
|
739
|
+
import React8, { forwardRef as forwardRef5 } from "react";
|
|
737
740
|
import styled7 from "styled-components";
|
|
738
|
-
var
|
|
739
|
-
display: inline ? "inline-block" : "block",
|
|
740
|
-
|
|
741
|
+
var SpacerVertical_ = styled7.span(({ $size, $inline }) => ({
|
|
742
|
+
display: $inline ? "inline-block" : "block",
|
|
743
|
+
...$size === void 0 ? { flex: 1 } : { minHeight: $size }
|
|
741
744
|
}));
|
|
742
|
-
var
|
|
743
|
-
|
|
744
|
-
|
|
745
|
+
var SpacerVertical = forwardRef5(
|
|
746
|
+
({ size: size2, inline, ...props }, ref) => {
|
|
747
|
+
return /* @__PURE__ */ React8.createElement(SpacerVertical_, { $size: size2, $inline: inline, ...props, ref });
|
|
748
|
+
}
|
|
749
|
+
);
|
|
750
|
+
var SpacerHorizontal_ = styled7.span(({ $size, $inline }) => ({
|
|
751
|
+
display: $inline ? "inline-block" : "block",
|
|
752
|
+
...$size === void 0 ? { flex: 1 } : { minWidth: $size }
|
|
745
753
|
}));
|
|
754
|
+
var SpacerHorizontal = forwardRef5(
|
|
755
|
+
({ size: size2, inline, ...props }, ref) => {
|
|
756
|
+
return /* @__PURE__ */ React8.createElement(SpacerHorizontal_, { $size: size2, $inline: inline, ...props, ref });
|
|
757
|
+
}
|
|
758
|
+
);
|
|
746
759
|
var Spacer;
|
|
747
760
|
((Spacer2) => {
|
|
748
761
|
Spacer2.Vertical = SpacerVertical;
|
|
@@ -795,7 +808,7 @@ var CloseButtonContainer = styled8.div(({ theme }) => ({
|
|
|
795
808
|
// boxShadow: `0 0 2px rgba(0, 0, 0, 0.2)`,
|
|
796
809
|
border: `1px solid rgba(128,128,128,0.2)`
|
|
797
810
|
}));
|
|
798
|
-
var Dialog =
|
|
811
|
+
var Dialog = forwardRef6(function Dialog2({
|
|
799
812
|
children,
|
|
800
813
|
title,
|
|
801
814
|
description,
|
|
@@ -813,7 +826,7 @@ var Dialog = forwardRef5(function Dialog2({
|
|
|
813
826
|
return contentRef.current.contains(element);
|
|
814
827
|
}
|
|
815
828
|
}));
|
|
816
|
-
return /* @__PURE__ */
|
|
829
|
+
return /* @__PURE__ */ React9.createElement(DialogPrimitive.Root, { open, onOpenChange }, /* @__PURE__ */ React9.createElement(StyledOverlay, null), /* @__PURE__ */ React9.createElement(
|
|
817
830
|
StyledContent,
|
|
818
831
|
{
|
|
819
832
|
ref: contentRef,
|
|
@@ -828,14 +841,14 @@ var Dialog = forwardRef5(function Dialog2({
|
|
|
828
841
|
}
|
|
829
842
|
}
|
|
830
843
|
},
|
|
831
|
-
/* @__PURE__ */
|
|
832
|
-
title && /* @__PURE__ */
|
|
833
|
-
description && /* @__PURE__ */
|
|
844
|
+
/* @__PURE__ */ React9.createElement(CloseButtonContainer, null, /* @__PURE__ */ React9.createElement(DialogPrimitive.Close, { asChild: true }, /* @__PURE__ */ React9.createElement(IconButton, { iconName: "Cross1Icon" }))),
|
|
845
|
+
title && /* @__PURE__ */ React9.createElement(React9.Fragment, null, /* @__PURE__ */ React9.createElement(StyledTitle, null, title), /* @__PURE__ */ React9.createElement(Spacer.Vertical, { size: description ? 10 : 20 })),
|
|
846
|
+
description && /* @__PURE__ */ React9.createElement(React9.Fragment, null, /* @__PURE__ */ React9.createElement(Spacer.Vertical, { size: 10 }), /* @__PURE__ */ React9.createElement(StyledDescription, null, description), /* @__PURE__ */ React9.createElement(Spacer.Vertical, { size: 20 })),
|
|
834
847
|
children
|
|
835
848
|
));
|
|
836
849
|
});
|
|
837
|
-
var FullscreenDialog =
|
|
838
|
-
return /* @__PURE__ */
|
|
850
|
+
var FullscreenDialog = forwardRef6(function FullscreenDialog2({ style: style3, ...rest }, forwardedRef) {
|
|
851
|
+
return /* @__PURE__ */ React9.createElement(
|
|
839
852
|
Dialog,
|
|
840
853
|
{
|
|
841
854
|
ref: forwardedRef,
|
|
@@ -859,16 +872,15 @@ var FullscreenDialog = forwardRef5(function FullscreenDialog2({ style: style3, .
|
|
|
859
872
|
|
|
860
873
|
// src/components/InputField.tsx
|
|
861
874
|
import { CaretDownIcon } from "@noya-app/noya-icons";
|
|
862
|
-
import { memoize } from "@noya-app/noya-utils";
|
|
863
875
|
|
|
864
876
|
// ../noya-react-utils/src/components/AutoSizer.tsx
|
|
865
|
-
import
|
|
877
|
+
import React11, { memo as memo5, useRef as useRef2 } from "react";
|
|
866
878
|
|
|
867
879
|
// ../noya-react-utils/src/hooks/useSize.ts
|
|
868
|
-
import * as
|
|
880
|
+
import * as React10 from "react";
|
|
869
881
|
function useSize(refToObserve, dimensions = "both") {
|
|
870
|
-
const [size2, setSize] =
|
|
871
|
-
|
|
882
|
+
const [size2, setSize] = React10.useState(void 0);
|
|
883
|
+
React10.useEffect(() => {
|
|
872
884
|
if (refToObserve.current) {
|
|
873
885
|
const elementToObserve = refToObserve.current;
|
|
874
886
|
const resizeObserver = new ResizeObserver((entries) => {
|
|
@@ -921,7 +933,7 @@ var AutoSizer = memo5(function AutoSizer2({
|
|
|
921
933
|
}) {
|
|
922
934
|
const containerRef = useRef2(null);
|
|
923
935
|
const containerSize = useSize(containerRef);
|
|
924
|
-
return /* @__PURE__ */
|
|
936
|
+
return /* @__PURE__ */ React11.createElement("div", { ref: containerRef, style, className }, containerSize && containerSize.width > 0 && containerSize.height > 0 && children(containerSize));
|
|
925
937
|
});
|
|
926
938
|
var SingleDimensionAutoSizer = memo5(function SingleDimensionAutoSizer2({
|
|
927
939
|
children,
|
|
@@ -930,11 +942,11 @@ var SingleDimensionAutoSizer = memo5(function SingleDimensionAutoSizer2({
|
|
|
930
942
|
}) {
|
|
931
943
|
const containerRef = useRef2(null);
|
|
932
944
|
const containerSize = useSize(containerRef, dimension);
|
|
933
|
-
return /* @__PURE__ */
|
|
945
|
+
return /* @__PURE__ */ React11.createElement("div", { ref: containerRef, style, className }, containerSize && containerSize[dimension] > 0 && children(containerSize[dimension]));
|
|
934
946
|
});
|
|
935
947
|
|
|
936
948
|
// ../noya-react-utils/src/components/FileDropTarget.tsx
|
|
937
|
-
import
|
|
949
|
+
import React12, {
|
|
938
950
|
memo as memo6,
|
|
939
951
|
useCallback as useCallback3
|
|
940
952
|
} from "react";
|
|
@@ -1009,7 +1021,7 @@ var FileDropTarget = memo6(function FileDropTarget2({
|
|
|
1009
1021
|
[onDropFiles, supportedFileTypes]
|
|
1010
1022
|
);
|
|
1011
1023
|
const { dropTargetProps, isDropTargetActive } = useFileDropTarget(handleFile);
|
|
1012
|
-
return /* @__PURE__ */
|
|
1024
|
+
return /* @__PURE__ */ React12.createElement("div", { style: style2, ...dropTargetProps }, typeof children === "function" ? children(isDropTargetActive) : children);
|
|
1013
1025
|
});
|
|
1014
1026
|
|
|
1015
1027
|
// ../noya-react-utils/src/hooks/useDeepArray.ts
|
|
@@ -1149,10 +1161,10 @@ function assignRef(ref, value) {
|
|
|
1149
1161
|
}
|
|
1150
1162
|
|
|
1151
1163
|
// src/components/InputField.tsx
|
|
1152
|
-
import
|
|
1164
|
+
import React17, {
|
|
1153
1165
|
Children as Children3,
|
|
1154
1166
|
createContext as createContext2,
|
|
1155
|
-
forwardRef as
|
|
1167
|
+
forwardRef as forwardRef9,
|
|
1156
1168
|
isValidElement as isValidElement2,
|
|
1157
1169
|
memo as memo9,
|
|
1158
1170
|
useCallback as useCallback11,
|
|
@@ -1192,8 +1204,8 @@ function handleNudge(e) {
|
|
|
1192
1204
|
import { CheckIcon, ChevronRightIcon } from "@noya-app/noya-icons";
|
|
1193
1205
|
import { useKeyboardShortcuts } from "@noya-app/noya-keymap";
|
|
1194
1206
|
import * as RadixDropdownMenu from "@radix-ui/react-dropdown-menu";
|
|
1195
|
-
import
|
|
1196
|
-
forwardRef as
|
|
1207
|
+
import React14, {
|
|
1208
|
+
forwardRef as forwardRef7,
|
|
1197
1209
|
memo as memo8,
|
|
1198
1210
|
useCallback as useCallback9,
|
|
1199
1211
|
useMemo as useMemo5
|
|
@@ -1202,7 +1214,7 @@ import styled10 from "styled-components";
|
|
|
1202
1214
|
|
|
1203
1215
|
// src/components/internal/Menu.tsx
|
|
1204
1216
|
import { getShortcutDisplayParts } from "@noya-app/noya-keymap";
|
|
1205
|
-
import
|
|
1217
|
+
import React13, { memo as memo7 } from "react";
|
|
1206
1218
|
import styled9 from "styled-components";
|
|
1207
1219
|
var SEPARATOR_ITEM = "separator";
|
|
1208
1220
|
var CHECKBOX_WIDTH = 15;
|
|
@@ -1280,13 +1292,10 @@ function getKeyboardShortcutsForMenuItems(menuItems, onSelect) {
|
|
|
1280
1292
|
);
|
|
1281
1293
|
}
|
|
1282
1294
|
var ShortcutElement = styled9.kbd(
|
|
1283
|
-
({
|
|
1284
|
-
theme,
|
|
1285
|
-
fixedWidth
|
|
1286
|
-
}) => ({
|
|
1295
|
+
({ theme, $fixedWidth }) => ({
|
|
1287
1296
|
...theme.textStyles.small,
|
|
1288
1297
|
color: theme.colors.textDisabled,
|
|
1289
|
-
|
|
1298
|
+
...$fixedWidth && {
|
|
1290
1299
|
width: "0.9rem",
|
|
1291
1300
|
textAlign: "center"
|
|
1292
1301
|
}
|
|
@@ -1297,17 +1306,17 @@ var KeyboardShortcut = memo7(function KeyboardShortcut2({
|
|
|
1297
1306
|
}) {
|
|
1298
1307
|
const platform = useDesignSystemConfiguration().platform;
|
|
1299
1308
|
const { keys, separator } = getShortcutDisplayParts(shortcut, platform);
|
|
1300
|
-
const keyElements = keys.map((key) => /* @__PURE__ */
|
|
1309
|
+
const keyElements = keys.map((key) => /* @__PURE__ */ React13.createElement(
|
|
1301
1310
|
ShortcutElement,
|
|
1302
1311
|
{
|
|
1303
1312
|
key,
|
|
1304
|
-
fixedWidth: platform === "mac" && key.length === 1
|
|
1313
|
+
$fixedWidth: platform === "mac" && key.length === 1
|
|
1305
1314
|
},
|
|
1306
1315
|
key
|
|
1307
1316
|
));
|
|
1308
|
-
return /* @__PURE__ */
|
|
1317
|
+
return /* @__PURE__ */ React13.createElement(React13.Fragment, null, separator ? withSeparatorElements(
|
|
1309
1318
|
keyElements,
|
|
1310
|
-
/* @__PURE__ */
|
|
1319
|
+
/* @__PURE__ */ React13.createElement(ShortcutElement, null, separator)
|
|
1311
1320
|
) : keyElements);
|
|
1312
1321
|
});
|
|
1313
1322
|
|
|
@@ -1339,21 +1348,21 @@ var DropdownMenuItem = memo8(function ContextMenuItem({
|
|
|
1339
1348
|
onSelect(value);
|
|
1340
1349
|
}, [onSelect, value]);
|
|
1341
1350
|
if (checked) {
|
|
1342
|
-
return /* @__PURE__ */
|
|
1351
|
+
return /* @__PURE__ */ React14.createElement(
|
|
1343
1352
|
CheckboxItemElement,
|
|
1344
1353
|
{
|
|
1345
1354
|
checked,
|
|
1346
1355
|
disabled,
|
|
1347
1356
|
onSelect: handleSelectItem
|
|
1348
1357
|
},
|
|
1349
|
-
/* @__PURE__ */
|
|
1350
|
-
icon && /* @__PURE__ */
|
|
1358
|
+
/* @__PURE__ */ React14.createElement(StyledItemIndicator, null, /* @__PURE__ */ React14.createElement(CheckIcon, null)),
|
|
1359
|
+
icon && /* @__PURE__ */ React14.createElement(React14.Fragment, null, icon, /* @__PURE__ */ React14.createElement(Spacer.Horizontal, { size: 8 })),
|
|
1351
1360
|
children
|
|
1352
1361
|
);
|
|
1353
1362
|
}
|
|
1354
|
-
const element = /* @__PURE__ */
|
|
1363
|
+
const element = /* @__PURE__ */ React14.createElement(ItemElement, { disabled, onSelect: handleSelectItem }, indented && /* @__PURE__ */ React14.createElement(Spacer.Horizontal, { size: CHECKBOX_WIDTH - CHECKBOX_RIGHT_INSET }), icon && /* @__PURE__ */ React14.createElement(React14.Fragment, null, icon, /* @__PURE__ */ React14.createElement(Spacer.Horizontal, { size: 8 })), children, shortcut && /* @__PURE__ */ React14.createElement(React14.Fragment, null, /* @__PURE__ */ React14.createElement(Spacer.Horizontal, null), /* @__PURE__ */ React14.createElement(Spacer.Horizontal, { size: 24 }), /* @__PURE__ */ React14.createElement(KeyboardShortcut, { shortcut })), items && items.length > 0 && /* @__PURE__ */ React14.createElement(React14.Fragment, null, /* @__PURE__ */ React14.createElement(Spacer.Horizontal, null), /* @__PURE__ */ React14.createElement(Spacer.Horizontal, { size: 16 }), /* @__PURE__ */ React14.createElement(ChevronRightIcon, null)));
|
|
1355
1364
|
if (items && items.length > 0) {
|
|
1356
|
-
return /* @__PURE__ */
|
|
1365
|
+
return /* @__PURE__ */ React14.createElement(
|
|
1357
1366
|
DropdownMenuRoot,
|
|
1358
1367
|
{
|
|
1359
1368
|
isNested: true,
|
|
@@ -1369,7 +1378,7 @@ var DropdownMenuItem = memo8(function ContextMenuItem({
|
|
|
1369
1378
|
});
|
|
1370
1379
|
var Content5 = styled10(RadixDropdownMenu.Content)(styles.contentStyle);
|
|
1371
1380
|
var SubContent2 = styled10(RadixDropdownMenu.SubContent)(styles.contentStyle);
|
|
1372
|
-
var DropdownMenuRoot =
|
|
1381
|
+
var DropdownMenuRoot = forwardRef7(function DropdownMenuRoot2({
|
|
1373
1382
|
items,
|
|
1374
1383
|
children,
|
|
1375
1384
|
onSelect,
|
|
@@ -1396,7 +1405,7 @@ var DropdownMenuRoot = forwardRef6(function DropdownMenuRoot2({
|
|
|
1396
1405
|
const TriggerComponent = isNested ? RadixDropdownMenu.SubTrigger : RadixDropdownMenu.Trigger;
|
|
1397
1406
|
const ContentComponent = isNested ? SubContent2 : Content5;
|
|
1398
1407
|
const contentStyle = useMemo5(() => ({ zIndex: 1e3 }), []);
|
|
1399
|
-
return /* @__PURE__ */
|
|
1408
|
+
return /* @__PURE__ */ React14.createElement(RootComponent, { onOpenChange, open }, /* @__PURE__ */ React14.createElement(TriggerComponent, { ref: forwardedRef, asChild: true }, children), /* @__PURE__ */ React14.createElement(RadixDropdownMenu.Portal, null, /* @__PURE__ */ React14.createElement(
|
|
1400
1409
|
ContentComponent,
|
|
1401
1410
|
{
|
|
1402
1411
|
side,
|
|
@@ -1408,7 +1417,7 @@ var DropdownMenuRoot = forwardRef6(function DropdownMenuRoot2({
|
|
|
1408
1417
|
...{ onCloseAutoFocus }
|
|
1409
1418
|
},
|
|
1410
1419
|
items.map(
|
|
1411
|
-
(item, index) => item === SEPARATOR_ITEM ? /* @__PURE__ */
|
|
1420
|
+
(item, index) => item === SEPARATOR_ITEM ? /* @__PURE__ */ React14.createElement(SeparatorElement, { key: index }) : /* @__PURE__ */ React14.createElement(
|
|
1412
1421
|
DropdownMenuItem,
|
|
1413
1422
|
{
|
|
1414
1423
|
key: item.value ?? index,
|
|
@@ -1430,8 +1439,8 @@ var DropdownMenu = memo8(DropdownMenuRoot);
|
|
|
1430
1439
|
|
|
1431
1440
|
// src/components/internal/TextInput.tsx
|
|
1432
1441
|
import { composeRefs } from "@radix-ui/react-compose-refs";
|
|
1433
|
-
import
|
|
1434
|
-
forwardRef as
|
|
1442
|
+
import React15, {
|
|
1443
|
+
forwardRef as forwardRef8,
|
|
1435
1444
|
useCallback as useCallback10,
|
|
1436
1445
|
useEffect as useEffect9,
|
|
1437
1446
|
useLayoutEffect as useLayoutEffect3,
|
|
@@ -1480,8 +1489,8 @@ function useGlobalInputBlurTrigger() {
|
|
|
1480
1489
|
}
|
|
1481
1490
|
|
|
1482
1491
|
// src/components/internal/TextInput.tsx
|
|
1483
|
-
var ReadOnlyTextInput =
|
|
1484
|
-
return /* @__PURE__ */
|
|
1492
|
+
var ReadOnlyTextInput = forwardRef8(function ReadOnlyTextInput2({ onKeyDown, onFocusChange, value, ...rest }, forwardedRef) {
|
|
1493
|
+
return /* @__PURE__ */ React15.createElement(
|
|
1485
1494
|
"input",
|
|
1486
1495
|
{
|
|
1487
1496
|
ref: forwardedRef,
|
|
@@ -1492,7 +1501,7 @@ var ReadOnlyTextInput = forwardRef7(function ReadOnlyTextInput2({ onKeyDown, onF
|
|
|
1492
1501
|
}
|
|
1493
1502
|
);
|
|
1494
1503
|
});
|
|
1495
|
-
var ControlledTextInput =
|
|
1504
|
+
var ControlledTextInput = forwardRef8(function ControlledTextInput2({
|
|
1496
1505
|
onKeyDown,
|
|
1497
1506
|
value,
|
|
1498
1507
|
onChange,
|
|
@@ -1515,7 +1524,7 @@ var ControlledTextInput = forwardRef7(function ControlledTextInput2({
|
|
|
1515
1524
|
},
|
|
1516
1525
|
[onFocusCapture, onFocusChange]
|
|
1517
1526
|
);
|
|
1518
|
-
return /* @__PURE__ */
|
|
1527
|
+
return /* @__PURE__ */ React15.createElement(
|
|
1519
1528
|
"input",
|
|
1520
1529
|
{
|
|
1521
1530
|
ref: forwardedRef,
|
|
@@ -1531,7 +1540,7 @@ var ControlledTextInput = forwardRef7(function ControlledTextInput2({
|
|
|
1531
1540
|
}
|
|
1532
1541
|
);
|
|
1533
1542
|
});
|
|
1534
|
-
var SubmittableTextInput =
|
|
1543
|
+
var SubmittableTextInput = forwardRef8(function SubmittableTextInput2({
|
|
1535
1544
|
onKeyDown,
|
|
1536
1545
|
value,
|
|
1537
1546
|
onSubmit,
|
|
@@ -1542,7 +1551,7 @@ var SubmittableTextInput = forwardRef7(function SubmittableTextInput2({
|
|
|
1542
1551
|
submitAutomaticallyAfterDelay,
|
|
1543
1552
|
...rest
|
|
1544
1553
|
}, forwardedRef) {
|
|
1545
|
-
const ref =
|
|
1554
|
+
const ref = React15.useRef(null);
|
|
1546
1555
|
const latestValue = useRef9(value);
|
|
1547
1556
|
latestValue.current = value;
|
|
1548
1557
|
const userDidEdit = useRef9(false);
|
|
@@ -1626,7 +1635,7 @@ var SubmittableTextInput = forwardRef7(function SubmittableTextInput2({
|
|
|
1626
1635
|
}
|
|
1627
1636
|
};
|
|
1628
1637
|
}, [internalValue, submitAutomaticallyAfterDelay]);
|
|
1629
|
-
return /* @__PURE__ */
|
|
1638
|
+
return /* @__PURE__ */ React15.createElement(
|
|
1630
1639
|
"input",
|
|
1631
1640
|
{
|
|
1632
1641
|
ref: composeRefs(ref, forwardedRef),
|
|
@@ -1639,7 +1648,7 @@ var SubmittableTextInput = forwardRef7(function SubmittableTextInput2({
|
|
|
1639
1648
|
}
|
|
1640
1649
|
);
|
|
1641
1650
|
});
|
|
1642
|
-
var TextInput_default =
|
|
1651
|
+
var TextInput_default = forwardRef8(function TextInput(props, forwardedRef) {
|
|
1643
1652
|
const commonProps = {
|
|
1644
1653
|
onPointerDown: useCallback10(
|
|
1645
1654
|
(event) => event.stopPropagation(),
|
|
@@ -1658,17 +1667,17 @@ var TextInput_default = forwardRef7(function TextInput(props, forwardedRef) {
|
|
|
1658
1667
|
...props
|
|
1659
1668
|
};
|
|
1660
1669
|
if ("readOnly" in commonProps) {
|
|
1661
|
-
return /* @__PURE__ */
|
|
1670
|
+
return /* @__PURE__ */ React15.createElement(ReadOnlyTextInput, { ref: forwardedRef, ...commonProps, readOnly: true });
|
|
1662
1671
|
} else if ("onChange" in commonProps) {
|
|
1663
|
-
return /* @__PURE__ */
|
|
1672
|
+
return /* @__PURE__ */ React15.createElement(ControlledTextInput, { ref: forwardedRef, ...commonProps });
|
|
1664
1673
|
} else {
|
|
1665
|
-
return /* @__PURE__ */
|
|
1674
|
+
return /* @__PURE__ */ React15.createElement(SubmittableTextInput, { ref: forwardedRef, ...commonProps });
|
|
1666
1675
|
}
|
|
1667
1676
|
});
|
|
1668
1677
|
|
|
1669
1678
|
// src/components/Popover.tsx
|
|
1670
1679
|
import * as PopoverPrimitive from "@radix-ui/react-popover";
|
|
1671
|
-
import
|
|
1680
|
+
import React16 from "react";
|
|
1672
1681
|
import styled11 from "styled-components";
|
|
1673
1682
|
var ContentElement = styled11(PopoverPrimitive.Content)(({ theme, variant }) => ({
|
|
1674
1683
|
borderRadius: 4,
|
|
@@ -1715,7 +1724,7 @@ function Popover({
|
|
|
1715
1724
|
onFocusOutside,
|
|
1716
1725
|
onClickClose
|
|
1717
1726
|
}) {
|
|
1718
|
-
return /* @__PURE__ */
|
|
1727
|
+
return /* @__PURE__ */ React16.createElement(PopoverPrimitive.Root, { open, onOpenChange }, /* @__PURE__ */ React16.createElement(PopoverPrimitive.Trigger, { asChild: true }, trigger), /* @__PURE__ */ React16.createElement(PopoverPrimitive.Portal, null, /* @__PURE__ */ React16.createElement(
|
|
1719
1728
|
ContentElement,
|
|
1720
1729
|
{
|
|
1721
1730
|
variant,
|
|
@@ -1737,8 +1746,8 @@ function Popover({
|
|
|
1737
1746
|
}
|
|
1738
1747
|
},
|
|
1739
1748
|
children,
|
|
1740
|
-
showArrow && /* @__PURE__ */
|
|
1741
|
-
closable && /* @__PURE__ */
|
|
1749
|
+
showArrow && /* @__PURE__ */ React16.createElement(ArrowElement, null),
|
|
1750
|
+
closable && /* @__PURE__ */ React16.createElement(PopoverClose, null, /* @__PURE__ */ React16.createElement(IconButton, { iconName: "Cross2Icon", onClick: onClickClose }))
|
|
1742
1751
|
)));
|
|
1743
1752
|
}
|
|
1744
1753
|
|
|
@@ -1753,26 +1762,26 @@ var InputFieldContext = createContext2({
|
|
|
1753
1762
|
onFocusChange: () => {
|
|
1754
1763
|
}
|
|
1755
1764
|
});
|
|
1756
|
-
var LabelContainer = styled12.label(({ theme, labelPosition, hasDropdown, pointerEvents }) => ({
|
|
1765
|
+
var LabelContainer = styled12.label(({ theme, $labelPosition, $hasDropdown, pointerEvents }) => ({
|
|
1757
1766
|
...theme.textStyles.label,
|
|
1758
1767
|
fontWeight: "bold",
|
|
1759
1768
|
color: theme.colors.textDisabled,
|
|
1760
1769
|
position: "absolute",
|
|
1761
1770
|
top: 0,
|
|
1762
|
-
right: labelPosition === "end" ? 0 : void 0,
|
|
1771
|
+
right: $labelPosition === "end" ? 0 : void 0,
|
|
1763
1772
|
bottom: 0,
|
|
1764
|
-
left: labelPosition === "start" ? 0 : void 0,
|
|
1773
|
+
left: $labelPosition === "start" ? 0 : void 0,
|
|
1765
1774
|
display: "flex",
|
|
1766
1775
|
alignItems: "center",
|
|
1767
1776
|
pointerEvents,
|
|
1768
1777
|
userSelect: "none",
|
|
1769
|
-
|
|
1778
|
+
...$labelPosition === "start" ? { justifyContent: "flex-start", paddingLeft: "6px" } : {
|
|
1770
1779
|
justifyContent: "flex-end",
|
|
1771
|
-
paddingRight: hasDropdown ? "16px" : "6px"
|
|
1780
|
+
paddingRight: $hasDropdown ? "16px" : "6px"
|
|
1772
1781
|
}
|
|
1773
1782
|
}));
|
|
1774
1783
|
var InputFieldLabel = memo9(
|
|
1775
|
-
|
|
1784
|
+
forwardRef9(function InputFieldLabel2({ children = false, pointerEvents = "none", style: style3 }, forwardedRef) {
|
|
1776
1785
|
const { labelPosition, hasDropdown, setLabelWidth } = useContext2(InputFieldContext);
|
|
1777
1786
|
const ref = useRef10(null);
|
|
1778
1787
|
useLayoutEffect4(() => {
|
|
@@ -1783,7 +1792,7 @@ var InputFieldLabel = memo9(
|
|
|
1783
1792
|
return;
|
|
1784
1793
|
setLabelWidth(width);
|
|
1785
1794
|
}, [setLabelWidth]);
|
|
1786
|
-
return /* @__PURE__ */
|
|
1795
|
+
return /* @__PURE__ */ React17.createElement(
|
|
1787
1796
|
LabelContainer,
|
|
1788
1797
|
{
|
|
1789
1798
|
ref: (element) => {
|
|
@@ -1791,8 +1800,8 @@ var InputFieldLabel = memo9(
|
|
|
1791
1800
|
assignRef(forwardedRef, element);
|
|
1792
1801
|
},
|
|
1793
1802
|
pointerEvents,
|
|
1794
|
-
labelPosition,
|
|
1795
|
-
hasDropdown,
|
|
1803
|
+
$labelPosition: labelPosition,
|
|
1804
|
+
$hasDropdown: hasDropdown,
|
|
1796
1805
|
style: style3
|
|
1797
1806
|
},
|
|
1798
1807
|
children
|
|
@@ -1816,13 +1825,13 @@ var InputFieldDropdownMenu = memo9(function InputFieldDropdownMenu2({ id, items,
|
|
|
1816
1825
|
}),
|
|
1817
1826
|
[size2]
|
|
1818
1827
|
);
|
|
1819
|
-
return /* @__PURE__ */
|
|
1828
|
+
return /* @__PURE__ */ React17.createElement(DropdownContainer, null, /* @__PURE__ */ React17.createElement(DropdownMenu, { items, onSelect }, children || /* @__PURE__ */ React17.createElement(Button, { id, variant: "thin", flex: "1", contentStyle }, /* @__PURE__ */ React17.createElement(CaretDownIcon, null))));
|
|
1820
1829
|
});
|
|
1821
1830
|
var ButtonContainer = styled12.span(
|
|
1822
|
-
({ theme, size
|
|
1831
|
+
({ theme, $size }) => ({
|
|
1823
1832
|
position: "absolute",
|
|
1824
|
-
right:
|
|
1825
|
-
top:
|
|
1833
|
+
right: $size === "large" ? "9px" : $size === "medium" ? "4px" : "2px",
|
|
1834
|
+
top: $size === "large" ? "8px" : $size === "medium" ? "4px" : "2px"
|
|
1826
1835
|
})
|
|
1827
1836
|
);
|
|
1828
1837
|
var InputFieldButton = memo9(function InputFieldButton2({
|
|
@@ -1845,7 +1854,7 @@ var InputFieldButton = memo9(function InputFieldButton2({
|
|
|
1845
1854
|
event.preventDefault();
|
|
1846
1855
|
event.stopPropagation();
|
|
1847
1856
|
}, []);
|
|
1848
|
-
return /* @__PURE__ */
|
|
1857
|
+
return /* @__PURE__ */ React17.createElement(ButtonContainer, { $size: size2 }, /* @__PURE__ */ React17.createElement(
|
|
1849
1858
|
Button,
|
|
1850
1859
|
{
|
|
1851
1860
|
variant: "floating",
|
|
@@ -1856,42 +1865,26 @@ var InputFieldButton = memo9(function InputFieldButton2({
|
|
|
1856
1865
|
children
|
|
1857
1866
|
));
|
|
1858
1867
|
});
|
|
1859
|
-
var
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
"
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
]);
|
|
1873
|
-
var InputElement = styled12(TextInput_default).withConfig({
|
|
1874
|
-
shouldForwardProp: (prop) => ignoredProps.has(prop) ? false : true
|
|
1875
|
-
})(
|
|
1876
|
-
({
|
|
1877
|
-
theme,
|
|
1878
|
-
labelPosition,
|
|
1879
|
-
labelSize,
|
|
1880
|
-
hasDropdown,
|
|
1881
|
-
textAlign,
|
|
1882
|
-
disabled,
|
|
1883
|
-
hasLabel,
|
|
1884
|
-
readOnly,
|
|
1885
|
-
variant = "normal",
|
|
1886
|
-
size: size2
|
|
1887
|
-
}) => ({
|
|
1868
|
+
var InputElement = styled12(TextInput_default)(({
|
|
1869
|
+
theme,
|
|
1870
|
+
$labelPosition,
|
|
1871
|
+
$labelSize,
|
|
1872
|
+
$hasDropdown,
|
|
1873
|
+
$textAlign,
|
|
1874
|
+
disabled,
|
|
1875
|
+
$hasLabel,
|
|
1876
|
+
readOnly,
|
|
1877
|
+
$variant = "normal",
|
|
1878
|
+
$size
|
|
1879
|
+
}) => {
|
|
1880
|
+
return {
|
|
1888
1881
|
// placeholder
|
|
1889
1882
|
"&::placeholder": {
|
|
1890
1883
|
color: theme.colors.textDisabled
|
|
1891
1884
|
},
|
|
1892
1885
|
...theme.textStyles.small,
|
|
1893
1886
|
color: readOnly ? theme.colors.textMuted : disabled ? theme.colors.textDisabled : theme.colors.text,
|
|
1894
|
-
|
|
1887
|
+
...$size === "small" && {
|
|
1895
1888
|
fontSize: "11px"
|
|
1896
1889
|
},
|
|
1897
1890
|
width: "0px",
|
|
@@ -1901,18 +1894,18 @@ var InputElement = styled12(TextInput_default).withConfig({
|
|
|
1901
1894
|
border: "0",
|
|
1902
1895
|
outline: "none",
|
|
1903
1896
|
minWidth: "0",
|
|
1904
|
-
textAlign: textAlign ?? "left",
|
|
1897
|
+
textAlign: $textAlign ?? "left",
|
|
1905
1898
|
alignSelf: "stretch",
|
|
1906
1899
|
borderRadius: "4px",
|
|
1907
|
-
paddingTop:
|
|
1908
|
-
paddingBottom:
|
|
1909
|
-
paddingLeft: (
|
|
1910
|
-
paddingRight: (
|
|
1900
|
+
paddingTop: $size === "large" ? "10px" : $size === "medium" ? "4px" : "1px",
|
|
1901
|
+
paddingBottom: $size === "large" ? "10px" : $size === "medium" ? "4px" : "1px",
|
|
1902
|
+
paddingLeft: ($size === "large" ? 10 : $size === "medium" ? 6 : 4) + ($hasLabel && $labelPosition === "start" ? 6 + $labelSize : 0) + "px",
|
|
1903
|
+
paddingRight: ($size === "large" ? 10 : $size === "medium" ? 6 : 4) + ($hasLabel && $labelPosition === "end" ? 6 + $labelSize : 0) + ($hasDropdown ? 11 : 0) + "px",
|
|
1911
1904
|
background: theme.colors.inputBackground,
|
|
1912
1905
|
"&:focus": {
|
|
1913
1906
|
boxShadow: `0 0 0 2px ${theme.colors.primary}`
|
|
1914
1907
|
},
|
|
1915
|
-
|
|
1908
|
+
...$variant === "bare" && {
|
|
1916
1909
|
paddingTop: "4px",
|
|
1917
1910
|
paddingRight: "4px",
|
|
1918
1911
|
paddingBottom: "4px",
|
|
@@ -1921,18 +1914,18 @@ var InputElement = styled12(TextInput_default).withConfig({
|
|
|
1921
1914
|
marginRight: "-4px",
|
|
1922
1915
|
marginBottom: "-4px",
|
|
1923
1916
|
marginLeft: "-4px"
|
|
1924
|
-
},
|
|
1925
|
-
'&[type="search"]::-webkit-search-cancel-button': {
|
|
1926
|
-
appearance: "none",
|
|
1927
|
-
height: "15px",
|
|
1928
|
-
width: "15px",
|
|
1929
|
-
background: `url("data:image/svg+xml;utf8,${createCrossSVGString(
|
|
1930
|
-
theme.colors.icon
|
|
1931
|
-
)}") no-repeat`
|
|
1932
1917
|
}
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1918
|
+
// '&[type="search"]::-webkit-search-cancel-button': {
|
|
1919
|
+
// appearance: "none",
|
|
1920
|
+
// height: "15px",
|
|
1921
|
+
// width: "15px",
|
|
1922
|
+
// background: `url("data:image/svg+xml;utf8,${createCrossSVGString(
|
|
1923
|
+
// theme.colors.icon
|
|
1924
|
+
// )}") no-repeat`,
|
|
1925
|
+
// },
|
|
1926
|
+
};
|
|
1927
|
+
});
|
|
1928
|
+
var InputFieldInput = forwardRef9(function InputFieldInput2(props, forwardedRef) {
|
|
1936
1929
|
const {
|
|
1937
1930
|
labelPosition,
|
|
1938
1931
|
labelSize,
|
|
@@ -1951,15 +1944,15 @@ var InputFieldInput = forwardRef8(function InputFieldInput2(props, forwardedRef)
|
|
|
1951
1944
|
useLayoutEffect4(() => {
|
|
1952
1945
|
setInputRef?.(forwardedRef);
|
|
1953
1946
|
}, [forwardedRef, setInputRef]);
|
|
1954
|
-
return /* @__PURE__ */
|
|
1947
|
+
return /* @__PURE__ */ React17.createElement(
|
|
1955
1948
|
InputElement,
|
|
1956
1949
|
{
|
|
1957
1950
|
ref: forwardedRef,
|
|
1958
|
-
labelPosition,
|
|
1959
|
-
labelSize,
|
|
1960
|
-
hasLabel,
|
|
1961
|
-
hasDropdown,
|
|
1962
|
-
size: size2,
|
|
1951
|
+
$labelPosition: labelPosition,
|
|
1952
|
+
$labelSize: labelSize,
|
|
1953
|
+
$hasLabel: hasLabel,
|
|
1954
|
+
$hasDropdown: hasDropdown,
|
|
1955
|
+
$size: size2,
|
|
1963
1956
|
onFocusChange: handleFocusChange,
|
|
1964
1957
|
...props
|
|
1965
1958
|
}
|
|
@@ -1974,14 +1967,14 @@ var InputFieldTypeahead = (props) => {
|
|
|
1974
1967
|
size: size2,
|
|
1975
1968
|
onFocusChange
|
|
1976
1969
|
} = useContext2(InputFieldContext);
|
|
1977
|
-
return /* @__PURE__ */
|
|
1970
|
+
return /* @__PURE__ */ React17.createElement(
|
|
1978
1971
|
InputElement,
|
|
1979
1972
|
{
|
|
1980
|
-
labelPosition,
|
|
1981
|
-
labelSize,
|
|
1982
|
-
hasLabel,
|
|
1983
|
-
hasDropdown,
|
|
1984
|
-
size: size2,
|
|
1973
|
+
$labelPosition: labelPosition,
|
|
1974
|
+
$labelSize: labelSize,
|
|
1975
|
+
$hasLabel: hasLabel,
|
|
1976
|
+
$hasDropdown: hasDropdown,
|
|
1977
|
+
$size: size2,
|
|
1985
1978
|
onFocusChange,
|
|
1986
1979
|
readOnly: true,
|
|
1987
1980
|
placeholder: props.value,
|
|
@@ -2005,7 +1998,7 @@ function parseNumber(value) {
|
|
|
2005
1998
|
return value ? Number(value) : NaN;
|
|
2006
1999
|
}
|
|
2007
2000
|
function InputFieldNumberInput(props) {
|
|
2008
|
-
const { value, placeholder, onNudge } = props;
|
|
2001
|
+
const { value, placeholder, onNudge, ...rest } = props;
|
|
2009
2002
|
const onSubmit = "onSubmit" in props ? props.onSubmit : void 0;
|
|
2010
2003
|
const onChange = "onChange" in props ? props.onChange : void 0;
|
|
2011
2004
|
const handleSubmit = useCallback11(
|
|
@@ -2034,10 +2027,10 @@ function InputFieldNumberInput(props) {
|
|
|
2034
2027
|
},
|
|
2035
2028
|
[onChange]
|
|
2036
2029
|
);
|
|
2037
|
-
return /* @__PURE__ */
|
|
2030
|
+
return /* @__PURE__ */ React17.createElement(
|
|
2038
2031
|
InputFieldInput,
|
|
2039
2032
|
{
|
|
2040
|
-
...
|
|
2033
|
+
...rest,
|
|
2041
2034
|
value: value === void 0 ? "" : String(value),
|
|
2042
2035
|
placeholder,
|
|
2043
2036
|
onKeyDown: handleKeyDown,
|
|
@@ -2046,12 +2039,12 @@ function InputFieldNumberInput(props) {
|
|
|
2046
2039
|
);
|
|
2047
2040
|
}
|
|
2048
2041
|
var RootContainer = styled12.div(
|
|
2049
|
-
({ theme, flex, width }) => ({
|
|
2050
|
-
flex: flex ?? "1",
|
|
2042
|
+
({ theme, $flex, $width }) => ({
|
|
2043
|
+
flex: $flex ?? "1",
|
|
2051
2044
|
display: "flex",
|
|
2052
2045
|
flexDirection: "row",
|
|
2053
2046
|
position: "relative",
|
|
2054
|
-
maxWidth: typeof width === "number" ? `${width}px` : void 0
|
|
2047
|
+
maxWidth: typeof $width === "number" ? `${$width}px` : void 0
|
|
2055
2048
|
})
|
|
2056
2049
|
);
|
|
2057
2050
|
function InputFieldRoot({
|
|
@@ -2072,9 +2065,9 @@ function InputFieldRoot({
|
|
|
2072
2065
|
const hasLabel = childrenArray.some(
|
|
2073
2066
|
(child) => isValidElement2(child) && child.type === InputFieldLabel
|
|
2074
2067
|
);
|
|
2075
|
-
const [isFocused, setIsFocused] =
|
|
2076
|
-
const [measuredLabelSize, setMeasuredLabelSize] =
|
|
2077
|
-
const [measuredWidth, setMeasuredWidth] =
|
|
2068
|
+
const [isFocused, setIsFocused] = React17.useState(false);
|
|
2069
|
+
const [measuredLabelSize, setMeasuredLabelSize] = React17.useState();
|
|
2070
|
+
const [measuredWidth, setMeasuredWidth] = React17.useState();
|
|
2078
2071
|
const handleFocusChange = useCallback11(
|
|
2079
2072
|
(isFocused2) => {
|
|
2080
2073
|
setIsFocused(isFocused2);
|
|
@@ -2082,7 +2075,7 @@ function InputFieldRoot({
|
|
|
2082
2075
|
},
|
|
2083
2076
|
[onFocusChange]
|
|
2084
2077
|
);
|
|
2085
|
-
const [inputRef, setInputRef] =
|
|
2078
|
+
const [inputRef, setInputRef] = React17.useState();
|
|
2086
2079
|
useEffect10(() => {
|
|
2087
2080
|
if (inputRef && typeof inputRef !== "function") {
|
|
2088
2081
|
setMeasuredWidth?.(
|
|
@@ -2115,8 +2108,8 @@ function InputFieldRoot({
|
|
|
2115
2108
|
inputRef
|
|
2116
2109
|
]
|
|
2117
2110
|
);
|
|
2118
|
-
const rootElement = /* @__PURE__ */
|
|
2119
|
-
return /* @__PURE__ */
|
|
2111
|
+
const rootElement = /* @__PURE__ */ React17.createElement(RootContainer, { id, $width: width, $flex: flex }, children);
|
|
2112
|
+
return /* @__PURE__ */ React17.createElement(InputFieldContext.Provider, { value: contextValue }, renderPopoverContent ? /* @__PURE__ */ React17.createElement(
|
|
2120
2113
|
Popover,
|
|
2121
2114
|
{
|
|
2122
2115
|
open: true,
|
|
@@ -2132,7 +2125,7 @@ function InputFieldRoot({
|
|
|
2132
2125
|
event.stopPropagation();
|
|
2133
2126
|
}
|
|
2134
2127
|
},
|
|
2135
|
-
measuredWidth && /* @__PURE__ */
|
|
2128
|
+
measuredWidth && /* @__PURE__ */ React17.createElement(Stack.V, { width: measuredWidth, overflow: "hidden" }, renderPopoverContent({ width: measuredWidth }))
|
|
2136
2129
|
) : rootElement);
|
|
2137
2130
|
}
|
|
2138
2131
|
var InputField;
|
|
@@ -2213,7 +2206,7 @@ var DialogProvider = function DialogProvider2({
|
|
|
2213
2206
|
return false;
|
|
2214
2207
|
return dialogRef.current.containsElement(element);
|
|
2215
2208
|
}, []);
|
|
2216
|
-
return /* @__PURE__ */
|
|
2209
|
+
return /* @__PURE__ */ React18.createElement(React18.Fragment, null, /* @__PURE__ */ React18.createElement(
|
|
2217
2210
|
DialogContext.Provider,
|
|
2218
2211
|
{
|
|
2219
2212
|
value: useMemo7(
|
|
@@ -2222,7 +2215,7 @@ var DialogProvider = function DialogProvider2({
|
|
|
2222
2215
|
)
|
|
2223
2216
|
},
|
|
2224
2217
|
children
|
|
2225
|
-
), /* @__PURE__ */
|
|
2218
|
+
), /* @__PURE__ */ React18.createElement(
|
|
2226
2219
|
Dialog,
|
|
2227
2220
|
{
|
|
2228
2221
|
ref: dialogRef,
|
|
@@ -2243,7 +2236,7 @@ var DialogProvider = function DialogProvider2({
|
|
|
2243
2236
|
inputRef.current?.setSelectionRange(0, inputRef.current.value.length);
|
|
2244
2237
|
}, [])
|
|
2245
2238
|
},
|
|
2246
|
-
/* @__PURE__ */
|
|
2239
|
+
/* @__PURE__ */ React18.createElement(InputField.Root, null, /* @__PURE__ */ React18.createElement(
|
|
2247
2240
|
InputField.Input,
|
|
2248
2241
|
{
|
|
2249
2242
|
ref: inputRef,
|
|
@@ -2259,8 +2252,8 @@ var DialogProvider = function DialogProvider2({
|
|
|
2259
2252
|
onKeyDown: handleKeyDown
|
|
2260
2253
|
}
|
|
2261
2254
|
)),
|
|
2262
|
-
/* @__PURE__ */
|
|
2263
|
-
/* @__PURE__ */
|
|
2255
|
+
/* @__PURE__ */ React18.createElement(Spacer.Vertical, { size: 20 }),
|
|
2256
|
+
/* @__PURE__ */ React18.createElement(Row, null, /* @__PURE__ */ React18.createElement(Spacer.Horizontal, null), /* @__PURE__ */ React18.createElement(Button, { onClick: close }, "Cancel"), /* @__PURE__ */ React18.createElement(Spacer.Horizontal, { size: 16 }), /* @__PURE__ */ React18.createElement(Button, { disabled: !contents?.inputValue, onClick: submit }, "Submit"))
|
|
2264
2257
|
));
|
|
2265
2258
|
};
|
|
2266
2259
|
function useDialog() {
|
|
@@ -2279,7 +2272,7 @@ function useDialogContainsElement() {
|
|
|
2279
2272
|
|
|
2280
2273
|
// src/contexts/FloatingWindowContext.tsx
|
|
2281
2274
|
import { uuid } from "@noya-app/noya-utils";
|
|
2282
|
-
import
|
|
2275
|
+
import React19, { createContext as createContext4, useContext as useContext4, useMemo as useMemo8, useState as useState12 } from "react";
|
|
2283
2276
|
import { createPortal } from "react-dom";
|
|
2284
2277
|
var FloatingWindowContext = createContext4(void 0);
|
|
2285
2278
|
var CurrentWindowContext = createContext4(void 0);
|
|
@@ -2292,7 +2285,7 @@ var FloatingWindowProvider = ({
|
|
|
2292
2285
|
const id = uuid();
|
|
2293
2286
|
setWindows((windows2) => ({
|
|
2294
2287
|
...windows2,
|
|
2295
|
-
[id]: /* @__PURE__ */
|
|
2288
|
+
[id]: /* @__PURE__ */ React19.createElement(CurrentWindowContext.Provider, { value: { id } }, element)
|
|
2296
2289
|
}));
|
|
2297
2290
|
return id;
|
|
2298
2291
|
};
|
|
@@ -2304,7 +2297,7 @@ var FloatingWindowProvider = ({
|
|
|
2304
2297
|
};
|
|
2305
2298
|
return { createWindow, closeWindow };
|
|
2306
2299
|
}, []);
|
|
2307
|
-
return /* @__PURE__ */
|
|
2300
|
+
return /* @__PURE__ */ React19.createElement(FloatingWindowContext.Provider, { value: contextValue }, children, Object.entries(windows).map(
|
|
2308
2301
|
([id, element]) => createPortal(element, document.body, id)
|
|
2309
2302
|
));
|
|
2310
2303
|
};
|
|
@@ -2331,13 +2324,17 @@ var DesignSystemThemeProvider = memo10(
|
|
|
2331
2324
|
children,
|
|
2332
2325
|
theme
|
|
2333
2326
|
}) {
|
|
2334
|
-
|
|
2327
|
+
let parentTheme;
|
|
2328
|
+
try {
|
|
2329
|
+
parentTheme = useTheme2();
|
|
2330
|
+
} catch (e) {
|
|
2331
|
+
}
|
|
2335
2332
|
if (theme) {
|
|
2336
|
-
return /* @__PURE__ */
|
|
2333
|
+
return /* @__PURE__ */ React20.createElement(ThemeProvider, { theme }, children);
|
|
2337
2334
|
} else if (parentTheme) {
|
|
2338
2335
|
return children;
|
|
2339
2336
|
} else {
|
|
2340
|
-
return /* @__PURE__ */
|
|
2337
|
+
return /* @__PURE__ */ React20.createElement(ThemeProvider, { theme: light_exports }, children);
|
|
2341
2338
|
}
|
|
2342
2339
|
}
|
|
2343
2340
|
);
|
|
@@ -2364,7 +2361,7 @@ var DesignSystemConfigurationProvider = memo10(
|
|
|
2364
2361
|
() => ({ platform: platform ?? internalPlatform }),
|
|
2365
2362
|
[platform, internalPlatform]
|
|
2366
2363
|
);
|
|
2367
|
-
return /* @__PURE__ */
|
|
2364
|
+
return /* @__PURE__ */ React20.createElement(DesignSystemConfigurationContext.Provider, { value: contextValue }, /* @__PURE__ */ React20.createElement(ThemeProvider, { theme }, /* @__PURE__ */ React20.createElement(DialogProvider, null, /* @__PURE__ */ React20.createElement(ToastProvider, null, /* @__PURE__ */ React20.createElement(FloatingWindowProvider, null, children)))));
|
|
2368
2365
|
}
|
|
2369
2366
|
);
|
|
2370
2367
|
function useDesignSystemConfiguration() {
|
|
@@ -2375,7 +2372,7 @@ function useDesignSystemTheme() {
|
|
|
2375
2372
|
}
|
|
2376
2373
|
|
|
2377
2374
|
// src/hooks/useHover.ts
|
|
2378
|
-
import * as
|
|
2375
|
+
import * as React21 from "react";
|
|
2379
2376
|
var globalIgnoreEmulatedMouseEvents = false;
|
|
2380
2377
|
var hoverCount = 0;
|
|
2381
2378
|
function setGlobalIgnoreEmulatedMouseEvents() {
|
|
@@ -2405,13 +2402,13 @@ function setupGlobalTouchEvents() {
|
|
|
2405
2402
|
}
|
|
2406
2403
|
function useHover(props = {}) {
|
|
2407
2404
|
const { onHoverStart, onHoverChange, onHoverEnd, isDisabled } = props;
|
|
2408
|
-
const [isHovered, setHovered] =
|
|
2409
|
-
const state =
|
|
2405
|
+
const [isHovered, setHovered] = React21.useState(false);
|
|
2406
|
+
const state = React21.useRef({
|
|
2410
2407
|
isHovered: false,
|
|
2411
2408
|
ignoreEmulatedMouseEvents: false
|
|
2412
2409
|
}).current;
|
|
2413
|
-
|
|
2414
|
-
const hoverProps =
|
|
2410
|
+
React21.useEffect(setupGlobalTouchEvents, []);
|
|
2411
|
+
const hoverProps = React21.useMemo(
|
|
2415
2412
|
function getHoverProps() {
|
|
2416
2413
|
function triggerHoverStart(event, pointerType) {
|
|
2417
2414
|
if (isDisabled || pointerType === "touch" || state.isHovered) {
|
|
@@ -2471,10 +2468,10 @@ function useHover(props = {}) {
|
|
|
2471
2468
|
}
|
|
2472
2469
|
|
|
2473
2470
|
// src/components/Chip.tsx
|
|
2474
|
-
var ChipElement = styled14.span(({ theme, colorScheme, size
|
|
2475
|
-
const color = colorScheme === "primary" ? theme.colors.primary : colorScheme === "secondary" ? theme.colors.secondary : theme.colors.text;
|
|
2476
|
-
const backgroundColor = colorScheme === "primary" ? "rgb(238, 229, 255)" : colorScheme === "secondary" ? "rgb(205, 238, 231)" : colorScheme === "error" ? "rgb(255, 219, 219)" : theme.colors.inputBackground;
|
|
2477
|
-
const subtleColor = colorScheme === "primary" ? "rgba(238, 229, 255, 0.2)" : colorScheme === "secondary" ? "rgba(205, 238, 231, 0.2)" : colorScheme === "error" ? "rgba(255, 219, 219, 0.2)" : "rgba(0, 0, 0, 0.1)";
|
|
2471
|
+
var ChipElement = styled14.span(({ theme, $colorScheme, $size, $variant, $monospace, $isInteractive }) => {
|
|
2472
|
+
const color = $colorScheme === "primary" ? theme.colors.primary : $colorScheme === "secondary" ? theme.colors.secondary : theme.colors.text;
|
|
2473
|
+
const backgroundColor = $colorScheme === "primary" ? "rgb(238, 229, 255)" : $colorScheme === "secondary" ? "rgb(205, 238, 231)" : $colorScheme === "error" ? "rgb(255, 219, 219)" : theme.colors.inputBackground;
|
|
2474
|
+
const subtleColor = $colorScheme === "primary" ? "rgba(238, 229, 255, 0.2)" : $colorScheme === "secondary" ? "rgba(205, 238, 231, 0.2)" : $colorScheme === "error" ? "rgba(255, 219, 219, 0.2)" : "rgba(0, 0, 0, 0.1)";
|
|
2478
2475
|
return {
|
|
2479
2476
|
textTransform: "initial",
|
|
2480
2477
|
borderRadius: 4,
|
|
@@ -2483,7 +2480,7 @@ var ChipElement = styled14.span(({ theme, colorScheme, size: size2, variant, mon
|
|
|
2483
2480
|
alignItems: "center",
|
|
2484
2481
|
lineHeight: "1.4",
|
|
2485
2482
|
whiteSpace: "pre",
|
|
2486
|
-
|
|
2483
|
+
...$size === "medium" ? {
|
|
2487
2484
|
fontSize: "11px",
|
|
2488
2485
|
padding: "4px 8px"
|
|
2489
2486
|
} : {
|
|
@@ -2491,24 +2488,24 @@ var ChipElement = styled14.span(({ theme, colorScheme, size: size2, variant, mon
|
|
|
2491
2488
|
padding: "0px 4px",
|
|
2492
2489
|
lineHeight: "15px"
|
|
2493
2490
|
},
|
|
2494
|
-
|
|
2491
|
+
...$monospace && {
|
|
2495
2492
|
fontFamily: theme.fonts.monospace
|
|
2496
2493
|
},
|
|
2497
|
-
|
|
2494
|
+
...$variant === "solid" ? {
|
|
2498
2495
|
color,
|
|
2499
2496
|
backgroundColor
|
|
2500
|
-
} : variant === "outlined" ? {
|
|
2497
|
+
} : $variant === "outlined" ? {
|
|
2501
2498
|
color,
|
|
2502
2499
|
backgroundColor: "transparent",
|
|
2503
2500
|
boxShadow: `0 0 0 1px ${subtleColor} inset`
|
|
2504
2501
|
} : {},
|
|
2505
2502
|
"&:hover": {
|
|
2506
|
-
|
|
2503
|
+
...$variant === "outlined" && {
|
|
2507
2504
|
backgroundColor: subtleColor,
|
|
2508
2505
|
boxShadow: "none"
|
|
2509
2506
|
}
|
|
2510
2507
|
},
|
|
2511
|
-
|
|
2508
|
+
...$isInteractive && {
|
|
2512
2509
|
cursor: "pointer",
|
|
2513
2510
|
"&:hover": {
|
|
2514
2511
|
opacity: 0.85
|
|
@@ -2532,9 +2529,9 @@ var DeleteElement = styled14(Cross1Icon)(({ size: size2 }) => ({
|
|
|
2532
2529
|
opacity: 0.85
|
|
2533
2530
|
}
|
|
2534
2531
|
}));
|
|
2535
|
-
var
|
|
2532
|
+
var ignoredProps = /* @__PURE__ */ new Set(["size", "isOnlyChild"]);
|
|
2536
2533
|
var AddElement = styled14(PlusIcon).withConfig({
|
|
2537
|
-
shouldForwardProp: (prop) => !
|
|
2534
|
+
shouldForwardProp: (prop) => !ignoredProps.has(prop)
|
|
2538
2535
|
})(({ size: size2, isOnlyChild }) => ({
|
|
2539
2536
|
position: "relative",
|
|
2540
2537
|
marginLeft: "-2px",
|
|
@@ -2573,19 +2570,19 @@ var Chip = memo11(function Chip2({
|
|
|
2573
2570
|
});
|
|
2574
2571
|
const handleClick = !children && !deletable && addable ? onAdd : onClick;
|
|
2575
2572
|
const color = colorScheme === "primary" ? theme.colors.primary : colorScheme === "secondary" ? theme.colors.secondary : theme.colors.text;
|
|
2576
|
-
return /* @__PURE__ */
|
|
2573
|
+
return /* @__PURE__ */ React22.createElement(
|
|
2577
2574
|
ChipElement,
|
|
2578
2575
|
{
|
|
2579
|
-
variant,
|
|
2580
|
-
colorScheme,
|
|
2576
|
+
$variant: variant,
|
|
2577
|
+
$colorScheme: colorScheme,
|
|
2581
2578
|
style: style3,
|
|
2582
2579
|
onClick: handleClick,
|
|
2583
|
-
size: size2,
|
|
2584
|
-
monospace,
|
|
2585
|
-
isInteractive: !!handleClick,
|
|
2580
|
+
$size: size2,
|
|
2581
|
+
$monospace: monospace,
|
|
2582
|
+
$isInteractive: !!handleClick,
|
|
2586
2583
|
tabIndex
|
|
2587
2584
|
},
|
|
2588
|
-
addable && /* @__PURE__ */
|
|
2585
|
+
addable && /* @__PURE__ */ React22.createElement(
|
|
2589
2586
|
AddElement,
|
|
2590
2587
|
{
|
|
2591
2588
|
size: size2,
|
|
@@ -2598,7 +2595,7 @@ var Chip = memo11(function Chip2({
|
|
|
2598
2595
|
}
|
|
2599
2596
|
),
|
|
2600
2597
|
children,
|
|
2601
|
-
deletable && /* @__PURE__ */
|
|
2598
|
+
deletable && /* @__PURE__ */ React22.createElement(
|
|
2602
2599
|
DeleteElement,
|
|
2603
2600
|
{
|
|
2604
2601
|
size: size2,
|
|
@@ -2617,7 +2614,7 @@ var Chip = memo11(function Chip2({
|
|
|
2617
2614
|
import { CheckIcon as CheckIcon2, ChevronRightIcon as ChevronRightIcon2 } from "@noya-app/noya-icons";
|
|
2618
2615
|
import { useKeyboardShortcuts as useKeyboardShortcuts2 } from "@noya-app/noya-keymap";
|
|
2619
2616
|
import * as RadixContextMenu from "@radix-ui/react-context-menu";
|
|
2620
|
-
import
|
|
2617
|
+
import React23, {
|
|
2621
2618
|
memo as memo12,
|
|
2622
2619
|
useCallback as useCallback13,
|
|
2623
2620
|
useMemo as useMemo11
|
|
@@ -2654,32 +2651,32 @@ var ContextMenuItem2 = memo12(function ContextMenuItem3({
|
|
|
2654
2651
|
onSelect(value);
|
|
2655
2652
|
}, [onSelect, value]);
|
|
2656
2653
|
if (checked) {
|
|
2657
|
-
return /* @__PURE__ */
|
|
2654
|
+
return /* @__PURE__ */ React23.createElement(
|
|
2658
2655
|
CheckboxItemElement2,
|
|
2659
2656
|
{
|
|
2660
2657
|
checked,
|
|
2661
2658
|
disabled,
|
|
2662
2659
|
onSelect: handleSelectItem
|
|
2663
2660
|
},
|
|
2664
|
-
/* @__PURE__ */
|
|
2661
|
+
/* @__PURE__ */ React23.createElement(StyledItemIndicator2, null, /* @__PURE__ */ React23.createElement(CheckIcon2, null)),
|
|
2665
2662
|
children
|
|
2666
2663
|
);
|
|
2667
2664
|
}
|
|
2668
|
-
const element = /* @__PURE__ */
|
|
2665
|
+
const element = /* @__PURE__ */ React23.createElement(
|
|
2669
2666
|
ItemElement2,
|
|
2670
2667
|
{
|
|
2671
2668
|
disabled,
|
|
2672
2669
|
onSelect: handleSelectItem,
|
|
2673
2670
|
onPointerDown: handlePointerDown
|
|
2674
2671
|
},
|
|
2675
|
-
indented && /* @__PURE__ */
|
|
2676
|
-
icon && /* @__PURE__ */
|
|
2672
|
+
indented && /* @__PURE__ */ React23.createElement(Spacer.Horizontal, { size: CHECKBOX_WIDTH - CHECKBOX_RIGHT_INSET }),
|
|
2673
|
+
icon && /* @__PURE__ */ React23.createElement(React23.Fragment, null, icon, /* @__PURE__ */ React23.createElement(Spacer.Horizontal, { size: 8 })),
|
|
2677
2674
|
children,
|
|
2678
|
-
shortcut && /* @__PURE__ */
|
|
2679
|
-
items && items.length > 0 && /* @__PURE__ */
|
|
2675
|
+
shortcut && /* @__PURE__ */ React23.createElement(React23.Fragment, null, /* @__PURE__ */ React23.createElement(Spacer.Horizontal, null), /* @__PURE__ */ React23.createElement(Spacer.Horizontal, { size: 24 }), /* @__PURE__ */ React23.createElement(KeyboardShortcut, { shortcut })),
|
|
2676
|
+
items && items.length > 0 && /* @__PURE__ */ React23.createElement(React23.Fragment, null, /* @__PURE__ */ React23.createElement(Spacer.Horizontal, null), /* @__PURE__ */ React23.createElement(Spacer.Horizontal, { size: 16 }), /* @__PURE__ */ React23.createElement(ChevronRightIcon2, null))
|
|
2680
2677
|
);
|
|
2681
2678
|
if (items && items.length > 0) {
|
|
2682
|
-
return /* @__PURE__ */
|
|
2679
|
+
return /* @__PURE__ */ React23.createElement(ContextMenuRoot, { isNested: true, items, onSelect }, element);
|
|
2683
2680
|
} else {
|
|
2684
2681
|
return element;
|
|
2685
2682
|
}
|
|
@@ -2708,8 +2705,8 @@ function ContextMenuRoot({
|
|
|
2708
2705
|
const RootComponent = isNested ? RadixContextMenu.Sub : RadixContextMenu.Root;
|
|
2709
2706
|
const TriggerComponent = isNested ? RadixContextMenu.SubTrigger : RadixContextMenu.Trigger;
|
|
2710
2707
|
const ContentComponent = isNested ? SubContent4 : Content8;
|
|
2711
|
-
return /* @__PURE__ */
|
|
2712
|
-
(item, index) => item === SEPARATOR_ITEM ? /* @__PURE__ */
|
|
2708
|
+
return /* @__PURE__ */ React23.createElement(RootComponent, { onOpenChange }, /* @__PURE__ */ React23.createElement(TriggerComponent, { asChild: true, onPointerDown }, children), /* @__PURE__ */ React23.createElement(RadixContextMenu.Portal, null, /* @__PURE__ */ React23.createElement(ContentComponent, null, items.map(
|
|
2709
|
+
(item, index) => item === SEPARATOR_ITEM ? /* @__PURE__ */ React23.createElement(SeparatorElement2, { key: index }) : /* @__PURE__ */ React23.createElement(
|
|
2713
2710
|
ContextMenuItem2,
|
|
2714
2711
|
{
|
|
2715
2712
|
key: item.value ?? index,
|
|
@@ -2729,23 +2726,47 @@ function ContextMenuRoot({
|
|
|
2729
2726
|
var ContextMenu = memo12(ContextMenuRoot);
|
|
2730
2727
|
|
|
2731
2728
|
// src/components/Divider.tsx
|
|
2732
|
-
import
|
|
2729
|
+
import React24, { memo as memo13 } from "react";
|
|
2733
2730
|
import styled16 from "styled-components";
|
|
2734
|
-
var DividerContainer = styled16.div(({ theme, variant = "normal", orientation, overflow = 0 }) => ({
|
|
2735
|
-
|
|
2736
|
-
background: variant === "strong" ? theme.colors.dividerStrong : variant === "subtle" ? theme.colors.dividerSubtle : theme.colors.divider,
|
|
2731
|
+
var DividerContainer = styled16.div(({ theme, $variant = "normal", $orientation, $overflow = 0 }) => ({
|
|
2732
|
+
...$orientation === "horizontal" ? { height: "1px", minHeight: "1px", margin: `0px -${$overflow}px` } : { width: "1px", minWidth: "1px", margin: `-${$overflow}px 0px` },
|
|
2733
|
+
background: $variant === "strong" ? theme.colors.dividerStrong : $variant === "subtle" ? theme.colors.dividerSubtle : theme.colors.divider,
|
|
2737
2734
|
alignSelf: "stretch"
|
|
2738
2735
|
}));
|
|
2739
|
-
var Divider = memo13(function Divider2(
|
|
2740
|
-
|
|
2736
|
+
var Divider = memo13(function Divider2({
|
|
2737
|
+
variant,
|
|
2738
|
+
overflow,
|
|
2739
|
+
...props
|
|
2740
|
+
}) {
|
|
2741
|
+
return /* @__PURE__ */ React24.createElement(
|
|
2742
|
+
DividerContainer,
|
|
2743
|
+
{
|
|
2744
|
+
$orientation: "horizontal",
|
|
2745
|
+
$variant: variant,
|
|
2746
|
+
$overflow: overflow,
|
|
2747
|
+
...props
|
|
2748
|
+
}
|
|
2749
|
+
);
|
|
2741
2750
|
});
|
|
2742
|
-
var DividerVertical = memo13(function DividerVertical2(
|
|
2743
|
-
|
|
2751
|
+
var DividerVertical = memo13(function DividerVertical2({
|
|
2752
|
+
variant,
|
|
2753
|
+
overflow,
|
|
2754
|
+
...props
|
|
2755
|
+
}) {
|
|
2756
|
+
return /* @__PURE__ */ React24.createElement(
|
|
2757
|
+
DividerContainer,
|
|
2758
|
+
{
|
|
2759
|
+
$orientation: "vertical",
|
|
2760
|
+
$variant: variant,
|
|
2761
|
+
$overflow: overflow,
|
|
2762
|
+
...props
|
|
2763
|
+
}
|
|
2764
|
+
);
|
|
2744
2765
|
});
|
|
2745
2766
|
|
|
2746
2767
|
// src/components/DraggableMenuButton.tsx
|
|
2747
2768
|
import { DragHandleDots2Icon } from "@noya-app/noya-icons";
|
|
2748
|
-
import
|
|
2769
|
+
import React25, { memo as memo14, useCallback as useCallback14, useState as useState15 } from "react";
|
|
2749
2770
|
import styled17 from "styled-components";
|
|
2750
2771
|
var DotButtonElement = styled17.div(({ theme }) => ({
|
|
2751
2772
|
cursor: "pointer",
|
|
@@ -2772,7 +2793,7 @@ var DraggableMenuButton = memo14(function DraggableMenuButton2({
|
|
|
2772
2793
|
}) {
|
|
2773
2794
|
const color = useDesignSystemTheme().colors.icon;
|
|
2774
2795
|
const [open, setOpen] = useState15(false);
|
|
2775
|
-
const [downPosition, setDownPosition] =
|
|
2796
|
+
const [downPosition, setDownPosition] = React25.useState(null);
|
|
2776
2797
|
const handlePointerDownCapture = useCallback14(
|
|
2777
2798
|
(event) => {
|
|
2778
2799
|
if (open) {
|
|
@@ -2809,7 +2830,7 @@ var DraggableMenuButton = memo14(function DraggableMenuButton2({
|
|
|
2809
2830
|
},
|
|
2810
2831
|
[setOpen]
|
|
2811
2832
|
);
|
|
2812
|
-
return /* @__PURE__ */
|
|
2833
|
+
return /* @__PURE__ */ React25.createElement(
|
|
2813
2834
|
DotButtonElement,
|
|
2814
2835
|
{
|
|
2815
2836
|
onPointerDownCapture: handlePointerDownCapture,
|
|
@@ -2819,7 +2840,7 @@ var DraggableMenuButton = memo14(function DraggableMenuButton2({
|
|
|
2819
2840
|
event.preventDefault();
|
|
2820
2841
|
}
|
|
2821
2842
|
},
|
|
2822
|
-
items && onSelect ? /* @__PURE__ */
|
|
2843
|
+
items && onSelect ? /* @__PURE__ */ React25.createElement(
|
|
2823
2844
|
DropdownMenu,
|
|
2824
2845
|
{
|
|
2825
2846
|
open,
|
|
@@ -2828,13 +2849,13 @@ var DraggableMenuButton = memo14(function DraggableMenuButton2({
|
|
|
2828
2849
|
onSelect,
|
|
2829
2850
|
shouldBindKeyboardShortcuts: false
|
|
2830
2851
|
},
|
|
2831
|
-
/* @__PURE__ */
|
|
2852
|
+
/* @__PURE__ */ React25.createElement(TriggerElement, null, /* @__PURE__ */ React25.createElement(
|
|
2832
2853
|
DragHandleDots2Icon,
|
|
2833
2854
|
{
|
|
2834
2855
|
color: isVisible || open ? color : "transparent"
|
|
2835
2856
|
}
|
|
2836
2857
|
))
|
|
2837
|
-
) : /* @__PURE__ */
|
|
2858
|
+
) : /* @__PURE__ */ React25.createElement(
|
|
2838
2859
|
DragHandleDots2Icon,
|
|
2839
2860
|
{
|
|
2840
2861
|
color: isVisible || open ? color : "transparent"
|
|
@@ -2844,7 +2865,7 @@ var DraggableMenuButton = memo14(function DraggableMenuButton2({
|
|
|
2844
2865
|
});
|
|
2845
2866
|
|
|
2846
2867
|
// src/components/FillInputField.tsx
|
|
2847
|
-
import
|
|
2868
|
+
import React28, { forwardRef as forwardRef10, memo as memo17 } from "react";
|
|
2848
2869
|
import styled19 from "styled-components";
|
|
2849
2870
|
|
|
2850
2871
|
// ../noya-file-format/src/types.ts
|
|
@@ -3170,11 +3191,11 @@ var ClassValue = /* @__PURE__ */ ((ClassValue2) => {
|
|
|
3170
3191
|
})(ClassValue || {});
|
|
3171
3192
|
|
|
3172
3193
|
// src/components/FillPreviewBackground.tsx
|
|
3173
|
-
import
|
|
3194
|
+
import React27, { memo as memo16, useMemo as useMemo14 } from "react";
|
|
3174
3195
|
import styled18, { useTheme as useTheme3 } from "styled-components";
|
|
3175
3196
|
|
|
3176
3197
|
// src/contexts/ImageDataContext.tsx
|
|
3177
|
-
import
|
|
3198
|
+
import React26, {
|
|
3178
3199
|
createContext as createContext6,
|
|
3179
3200
|
memo as memo15,
|
|
3180
3201
|
useContext as useContext6,
|
|
@@ -3191,7 +3212,7 @@ var ImageDataProvider = memo15(function ImageDataProvider2({
|
|
|
3191
3212
|
() => ({ getImageData: getImageData ?? (() => void 0) }),
|
|
3192
3213
|
[getImageData]
|
|
3193
3214
|
);
|
|
3194
|
-
return /* @__PURE__ */
|
|
3215
|
+
return /* @__PURE__ */ React26.createElement(ImageDataContext.Provider, { value: contextValue }, children);
|
|
3195
3216
|
});
|
|
3196
3217
|
function useImageData(ref) {
|
|
3197
3218
|
const value = useContext6(ImageDataContext);
|
|
@@ -3281,7 +3302,7 @@ var HorizontalDotsBackground = memo16(function HorizontalDotsBackground2() {
|
|
|
3281
3302
|
].join(","),
|
|
3282
3303
|
[inputBackground, placeholderDots]
|
|
3283
3304
|
);
|
|
3284
|
-
return /* @__PURE__ */
|
|
3305
|
+
return /* @__PURE__ */ React27.createElement(Background, { background });
|
|
3285
3306
|
});
|
|
3286
3307
|
function getPatternSizeAndPosition(fillType, tileScale) {
|
|
3287
3308
|
switch (fillType) {
|
|
@@ -3311,13 +3332,13 @@ var PatternPreviewBackground = memo16(function PatternPreviewBackground2({
|
|
|
3311
3332
|
].join(" "),
|
|
3312
3333
|
[fillType, size2, url]
|
|
3313
3334
|
);
|
|
3314
|
-
return /* @__PURE__ */
|
|
3335
|
+
return /* @__PURE__ */ React27.createElement(Background, { background });
|
|
3315
3336
|
});
|
|
3316
3337
|
var ColorPreviewBackground = memo16(function ColorPreviewBackground2({
|
|
3317
3338
|
color
|
|
3318
3339
|
}) {
|
|
3319
3340
|
const background = useMemo14(() => sketchColorToRgbaString(color), [color]);
|
|
3320
|
-
return /* @__PURE__ */
|
|
3341
|
+
return /* @__PURE__ */ React27.createElement(Background, { background });
|
|
3321
3342
|
});
|
|
3322
3343
|
var GradientPreviewBackground = memo16(function GradientPreviewBackground2({
|
|
3323
3344
|
gradient
|
|
@@ -3326,22 +3347,22 @@ var GradientPreviewBackground = memo16(function GradientPreviewBackground2({
|
|
|
3326
3347
|
() => getGradientBackground(gradient.stops, gradient.gradientType, 180),
|
|
3327
3348
|
[gradient.gradientType, gradient.stops]
|
|
3328
3349
|
);
|
|
3329
|
-
return /* @__PURE__ */
|
|
3350
|
+
return /* @__PURE__ */ React27.createElement(Background, { background });
|
|
3330
3351
|
});
|
|
3331
3352
|
var FillPreviewBackground = memo16(function FillPreviewBackground2({
|
|
3332
3353
|
value
|
|
3333
3354
|
}) {
|
|
3334
3355
|
if (!value)
|
|
3335
|
-
return /* @__PURE__ */
|
|
3356
|
+
return /* @__PURE__ */ React27.createElement(HorizontalDotsBackground, null);
|
|
3336
3357
|
switch (value._class) {
|
|
3337
3358
|
case "color":
|
|
3338
|
-
return /* @__PURE__ */
|
|
3359
|
+
return /* @__PURE__ */ React27.createElement(ColorPreviewBackground, { color: value });
|
|
3339
3360
|
case "gradient":
|
|
3340
|
-
return /* @__PURE__ */
|
|
3361
|
+
return /* @__PURE__ */ React27.createElement(GradientPreviewBackground, { gradient: value });
|
|
3341
3362
|
case "pattern":
|
|
3342
3363
|
if (!value.image)
|
|
3343
3364
|
return null;
|
|
3344
|
-
return /* @__PURE__ */
|
|
3365
|
+
return /* @__PURE__ */ React27.createElement(
|
|
3345
3366
|
PatternPreviewBackground,
|
|
3346
3367
|
{
|
|
3347
3368
|
fillType: value.patternFillType,
|
|
@@ -3354,7 +3375,7 @@ var FillPreviewBackground = memo16(function FillPreviewBackground2({
|
|
|
3354
3375
|
|
|
3355
3376
|
// src/components/FillInputField.tsx
|
|
3356
3377
|
var Container = styled19.button(
|
|
3357
|
-
({ theme, flex }) => ({
|
|
3378
|
+
({ theme, $flex }) => ({
|
|
3358
3379
|
outline: "none",
|
|
3359
3380
|
padding: 0,
|
|
3360
3381
|
width: "50px",
|
|
@@ -3368,17 +3389,17 @@ var Container = styled19.button(
|
|
|
3368
3389
|
boxShadow: `0 0 0 1px ${theme.colors.sidebar.background}, 0 0 0 3px ${theme.colors.primary}`
|
|
3369
3390
|
},
|
|
3370
3391
|
position: "relative",
|
|
3371
|
-
flex
|
|
3392
|
+
flex: $flex
|
|
3372
3393
|
})
|
|
3373
3394
|
);
|
|
3374
3395
|
var FillInputField = memo17(
|
|
3375
|
-
|
|
3376
|
-
return /* @__PURE__ */
|
|
3396
|
+
forwardRef10(function FillInputField2({ id, value, flex, ...rest }, ref) {
|
|
3397
|
+
return /* @__PURE__ */ React28.createElement(Container, { ref, id, $flex: flex, ...rest }, /* @__PURE__ */ React28.createElement(FillPreviewBackground, { value }));
|
|
3377
3398
|
})
|
|
3378
3399
|
);
|
|
3379
3400
|
|
|
3380
3401
|
// src/components/FloatingWindow.tsx
|
|
3381
|
-
import
|
|
3402
|
+
import React29, { useCallback as useCallback15, useRef as useRef13, useState as useState16 } from "react";
|
|
3382
3403
|
var styles2 = {
|
|
3383
3404
|
noSelect: {
|
|
3384
3405
|
userSelect: "none",
|
|
@@ -3471,7 +3492,7 @@ function defaultRenderToolbar({
|
|
|
3471
3492
|
toolbarContent,
|
|
3472
3493
|
onClose
|
|
3473
3494
|
}) {
|
|
3474
|
-
return /* @__PURE__ */
|
|
3495
|
+
return /* @__PURE__ */ React29.createElement(React29.Fragment, null, /* @__PURE__ */ React29.createElement(Small, { flex: "1", fontWeight: "500", color: "text" }, title), toolbarContent, /* @__PURE__ */ React29.createElement(
|
|
3475
3496
|
IconButton,
|
|
3476
3497
|
{
|
|
3477
3498
|
iconName: "Cross3Icon",
|
|
@@ -3592,7 +3613,7 @@ var FloatingWindow = ({
|
|
|
3592
3613
|
setResizeDirection(null);
|
|
3593
3614
|
toggleGlobalTextSelection(false);
|
|
3594
3615
|
}, []);
|
|
3595
|
-
|
|
3616
|
+
React29.useEffect(() => {
|
|
3596
3617
|
document.addEventListener("mousemove", handleMouseMove);
|
|
3597
3618
|
document.addEventListener("mouseup", handleMouseUp);
|
|
3598
3619
|
return () => {
|
|
@@ -3608,7 +3629,7 @@ var FloatingWindow = ({
|
|
|
3608
3629
|
onClose();
|
|
3609
3630
|
floatingWindowManager.closeWindow(currentFloatingWindow.id);
|
|
3610
3631
|
}, [currentFloatingWindow.id, floatingWindowManager, onClose]);
|
|
3611
|
-
return /* @__PURE__ */
|
|
3632
|
+
return /* @__PURE__ */ React29.createElement(
|
|
3612
3633
|
"div",
|
|
3613
3634
|
{
|
|
3614
3635
|
ref: wrapperRef,
|
|
@@ -3622,7 +3643,7 @@ var FloatingWindow = ({
|
|
|
3622
3643
|
backgroundColor: theme.colors.canvas.background
|
|
3623
3644
|
}
|
|
3624
3645
|
},
|
|
3625
|
-
/* @__PURE__ */
|
|
3646
|
+
/* @__PURE__ */ React29.createElement(
|
|
3626
3647
|
"div",
|
|
3627
3648
|
{
|
|
3628
3649
|
style: {
|
|
@@ -3633,9 +3654,9 @@ var FloatingWindow = ({
|
|
|
3633
3654
|
},
|
|
3634
3655
|
renderToolbar({ title, toolbarContent, onClose: handleClose })
|
|
3635
3656
|
),
|
|
3636
|
-
/* @__PURE__ */
|
|
3637
|
-
/* @__PURE__ */
|
|
3638
|
-
Object.entries(resizeHandlePositions).map(([direction, style3]) => /* @__PURE__ */
|
|
3657
|
+
/* @__PURE__ */ React29.createElement(Divider, null),
|
|
3658
|
+
/* @__PURE__ */ React29.createElement("div", { style: styles2.content }, children),
|
|
3659
|
+
Object.entries(resizeHandlePositions).map(([direction, style3]) => /* @__PURE__ */ React29.createElement(
|
|
3639
3660
|
"div",
|
|
3640
3661
|
{
|
|
3641
3662
|
key: direction,
|
|
@@ -3657,7 +3678,7 @@ import {
|
|
|
3657
3678
|
hsvaToRgba,
|
|
3658
3679
|
rgbaToHsva as rgbaToHsva2
|
|
3659
3680
|
} from "@noya-app/noya-colorpicker";
|
|
3660
|
-
import
|
|
3681
|
+
import React30, { memo as memo18, useCallback as useCallback16, useMemo as useMemo15 } from "react";
|
|
3661
3682
|
var GradientPicker = memo18(function GradientPicker2({
|
|
3662
3683
|
value,
|
|
3663
3684
|
selectedStop,
|
|
@@ -3692,14 +3713,14 @@ var GradientPicker = memo18(function GradientPicker2({
|
|
|
3692
3713
|
},
|
|
3693
3714
|
[onAdd]
|
|
3694
3715
|
);
|
|
3695
|
-
return /* @__PURE__ */
|
|
3716
|
+
return /* @__PURE__ */ React30.createElement(
|
|
3696
3717
|
NoyaColorPicker,
|
|
3697
3718
|
{
|
|
3698
3719
|
onChange: handleChangeColor,
|
|
3699
3720
|
colorModel,
|
|
3700
3721
|
color: rgbaColor
|
|
3701
3722
|
},
|
|
3702
|
-
/* @__PURE__ */
|
|
3723
|
+
/* @__PURE__ */ React30.createElement(
|
|
3703
3724
|
Gradient,
|
|
3704
3725
|
{
|
|
3705
3726
|
gradients: value,
|
|
@@ -3710,12 +3731,12 @@ var GradientPicker = memo18(function GradientPicker2({
|
|
|
3710
3731
|
onDelete
|
|
3711
3732
|
}
|
|
3712
3733
|
),
|
|
3713
|
-
/* @__PURE__ */
|
|
3714
|
-
/* @__PURE__ */
|
|
3715
|
-
/* @__PURE__ */
|
|
3716
|
-
/* @__PURE__ */
|
|
3717
|
-
/* @__PURE__ */
|
|
3718
|
-
/* @__PURE__ */
|
|
3734
|
+
/* @__PURE__ */ React30.createElement(Spacer.Vertical, { size: 10 }),
|
|
3735
|
+
/* @__PURE__ */ React30.createElement(Saturation, null),
|
|
3736
|
+
/* @__PURE__ */ React30.createElement(Spacer.Vertical, { size: 12 }),
|
|
3737
|
+
/* @__PURE__ */ React30.createElement(Hue, null),
|
|
3738
|
+
/* @__PURE__ */ React30.createElement(Spacer.Vertical, { size: 5 }),
|
|
3739
|
+
/* @__PURE__ */ React30.createElement(Alpha, null)
|
|
3719
3740
|
);
|
|
3720
3741
|
});
|
|
3721
3742
|
|
|
@@ -3747,9 +3768,9 @@ var Grid = styled20.div((props) => ({
|
|
|
3747
3768
|
}));
|
|
3748
3769
|
|
|
3749
3770
|
// src/components/GridView.tsx
|
|
3750
|
-
import
|
|
3771
|
+
import React32, {
|
|
3751
3772
|
createContext as createContext7,
|
|
3752
|
-
forwardRef as
|
|
3773
|
+
forwardRef as forwardRef11,
|
|
3753
3774
|
memo as memo20,
|
|
3754
3775
|
useCallback as useCallback18,
|
|
3755
3776
|
useContext as useContext7,
|
|
@@ -3759,7 +3780,7 @@ import styled22, { keyframes as keyframes2 } from "styled-components";
|
|
|
3759
3780
|
|
|
3760
3781
|
// src/components/ScrollArea.tsx
|
|
3761
3782
|
import * as RadixScrollArea from "@radix-ui/react-scroll-area";
|
|
3762
|
-
import
|
|
3783
|
+
import React31, { memo as memo19, useCallback as useCallback17, useState as useState17 } from "react";
|
|
3763
3784
|
import styled21 from "styled-components";
|
|
3764
3785
|
var SCROLLBAR_SIZE = 10;
|
|
3765
3786
|
var StyledViewport = styled21(RadixScrollArea.Viewport)({
|
|
@@ -3789,7 +3810,7 @@ var Container2 = styled21.div({
|
|
|
3789
3810
|
});
|
|
3790
3811
|
var ScrollArea = memo19(function ScrollArea2({ children }) {
|
|
3791
3812
|
const [scrollElementRef, setScrollElementRef] = useState17(null);
|
|
3792
|
-
return /* @__PURE__ */
|
|
3813
|
+
return /* @__PURE__ */ React31.createElement(Container2, null, /* @__PURE__ */ React31.createElement(RadixScrollArea.Root, { style: { width: "100%", height: "100%" } }, /* @__PURE__ */ React31.createElement(
|
|
3793
3814
|
StyledViewport,
|
|
3794
3815
|
{
|
|
3795
3816
|
ref: useCallback17(
|
|
@@ -3798,7 +3819,7 @@ var ScrollArea = memo19(function ScrollArea2({ children }) {
|
|
|
3798
3819
|
)
|
|
3799
3820
|
},
|
|
3800
3821
|
typeof children === "function" ? scrollElementRef ? children(scrollElementRef) : null : children
|
|
3801
|
-
), /* @__PURE__ */
|
|
3822
|
+
), /* @__PURE__ */ React31.createElement(StyledScrollbar, { orientation: "vertical", className: "scroll-component" }, /* @__PURE__ */ React31.createElement(StyledThumb, { className: "scroll-component" }))));
|
|
3802
3823
|
});
|
|
3803
3824
|
|
|
3804
3825
|
// src/components/GridView.tsx
|
|
@@ -3978,7 +3999,7 @@ var Shimmer = styled22.div`
|
|
|
3978
3999
|
align-items: end;
|
|
3979
4000
|
padding: 4px;
|
|
3980
4001
|
`;
|
|
3981
|
-
var GridViewItem =
|
|
4002
|
+
var GridViewItem = forwardRef11(function GridViewItem2({
|
|
3982
4003
|
id,
|
|
3983
4004
|
title,
|
|
3984
4005
|
subtitle,
|
|
@@ -3994,7 +4015,7 @@ var GridViewItem = forwardRef10(function GridViewItem2({
|
|
|
3994
4015
|
onContextMenu,
|
|
3995
4016
|
style: style3
|
|
3996
4017
|
}, forwardedRef) {
|
|
3997
|
-
const [hovered, setHovered] =
|
|
4018
|
+
const [hovered, setHovered] = React32.useState(false);
|
|
3998
4019
|
const { hoverProps } = useHover({
|
|
3999
4020
|
onHoverChange: (isHovering) => {
|
|
4000
4021
|
onHoverChange?.(isHovering);
|
|
@@ -4023,7 +4044,7 @@ var GridViewItem = forwardRef10(function GridViewItem2({
|
|
|
4023
4044
|
},
|
|
4024
4045
|
[onPress]
|
|
4025
4046
|
);
|
|
4026
|
-
let element = /* @__PURE__ */
|
|
4047
|
+
let element = /* @__PURE__ */ React32.createElement(
|
|
4027
4048
|
ItemContainer,
|
|
4028
4049
|
{
|
|
4029
4050
|
id,
|
|
@@ -4032,7 +4053,7 @@ var GridViewItem = forwardRef10(function GridViewItem2({
|
|
|
4032
4053
|
tabIndex: disabled ? void 0 : 0,
|
|
4033
4054
|
onKeyDown: handleKeyDown
|
|
4034
4055
|
},
|
|
4035
|
-
/* @__PURE__ */
|
|
4056
|
+
/* @__PURE__ */ React32.createElement(
|
|
4036
4057
|
ContentContainer,
|
|
4037
4058
|
{
|
|
4038
4059
|
disabled,
|
|
@@ -4046,18 +4067,18 @@ var GridViewItem = forwardRef10(function GridViewItem2({
|
|
|
4046
4067
|
},
|
|
4047
4068
|
children
|
|
4048
4069
|
),
|
|
4049
|
-
textPosition === "below" && /* @__PURE__ */
|
|
4050
|
-
textPosition === "overlay" && hovered && (title || subtitle) && /* @__PURE__ */
|
|
4051
|
-
loading && /* @__PURE__ */
|
|
4070
|
+
textPosition === "below" && /* @__PURE__ */ React32.createElement(React32.Fragment, null, /* @__PURE__ */ React32.createElement(Spacer.Vertical, { size: 8 }), /* @__PURE__ */ React32.createElement(ItemTitle, { showBackground: false }, title || " "), /* @__PURE__ */ React32.createElement(ItemDescription, { showBackground: false }, subtitle || " ")),
|
|
4071
|
+
textPosition === "overlay" && hovered && (title || subtitle) && /* @__PURE__ */ React32.createElement(TextOverlay, null, title && /* @__PURE__ */ React32.createElement(ItemTitle, { showBackground: true }, title), subtitle && /* @__PURE__ */ React32.createElement(ItemDescription, { showBackground: true }, subtitle)),
|
|
4072
|
+
loading && /* @__PURE__ */ React32.createElement(Shimmer, null, /* @__PURE__ */ React32.createElement(ActivityIndicator, { opacity: 0.5, size: 13 }))
|
|
4052
4073
|
);
|
|
4053
4074
|
if (menuItems && onSelectMenuItem) {
|
|
4054
|
-
element = /* @__PURE__ */
|
|
4075
|
+
element = /* @__PURE__ */ React32.createElement(ContextMenu, { items: menuItems, onSelect: onSelectMenuItem }, element);
|
|
4055
4076
|
}
|
|
4056
4077
|
if (textPosition === "toolip") {
|
|
4057
|
-
element = /* @__PURE__ */
|
|
4078
|
+
element = /* @__PURE__ */ React32.createElement(
|
|
4058
4079
|
Tooltip,
|
|
4059
4080
|
{
|
|
4060
|
-
content: /* @__PURE__ */
|
|
4081
|
+
content: /* @__PURE__ */ React32.createElement(Stack.V, { gap: 2 }, /* @__PURE__ */ React32.createElement(ItemTitle, { showBackground: false }, title), /* @__PURE__ */ React32.createElement(ItemDescription, { showBackground: false }, subtitle))
|
|
4061
4082
|
},
|
|
4062
4083
|
element
|
|
4063
4084
|
);
|
|
@@ -4096,20 +4117,20 @@ function GridViewRoot({
|
|
|
4096
4117
|
}),
|
|
4097
4118
|
[bordered, disabled, size2, textPosition]
|
|
4098
4119
|
);
|
|
4099
|
-
return /* @__PURE__ */
|
|
4120
|
+
return /* @__PURE__ */ React32.createElement(GridViewContext.Provider, { value: contextValue }, /* @__PURE__ */ React32.createElement(Container3, { onClick: handleClick, scrollable }, scrollable ? /* @__PURE__ */ React32.createElement(ScrollArea, null, children) : children));
|
|
4100
4121
|
}
|
|
4101
4122
|
function GridViewSection({
|
|
4102
4123
|
children,
|
|
4103
4124
|
padding = "20px"
|
|
4104
4125
|
}) {
|
|
4105
4126
|
const { size: size2 } = useContext7(GridViewContext);
|
|
4106
|
-
return /* @__PURE__ */
|
|
4127
|
+
return /* @__PURE__ */ React32.createElement(Grid2, { size: size2, padding }, children);
|
|
4107
4128
|
}
|
|
4108
4129
|
function GridViewSectionHeader({ title }) {
|
|
4109
4130
|
const grouped = title.split("/");
|
|
4110
|
-
return /* @__PURE__ */
|
|
4111
|
-
grouped.map((title2, index) => /* @__PURE__ */
|
|
4112
|
-
/* @__PURE__ */
|
|
4131
|
+
return /* @__PURE__ */ React32.createElement(SectionHeaderContainer, null, /* @__PURE__ */ React32.createElement(Spacer.Vertical, { size: 24 }), withSeparatorElements(
|
|
4132
|
+
grouped.map((title2, index) => /* @__PURE__ */ React32.createElement(SectionTitle, { last: index === grouped.length - 1 }, title2)),
|
|
4133
|
+
/* @__PURE__ */ React32.createElement(SectionTitle, null, " / ")
|
|
4113
4134
|
));
|
|
4114
4135
|
}
|
|
4115
4136
|
var GridView;
|
|
@@ -4122,8 +4143,8 @@ var GridView;
|
|
|
4122
4143
|
|
|
4123
4144
|
// src/components/InputFieldWithCompletions.tsx
|
|
4124
4145
|
import { chunkBy, partition } from "@noya-app/noya-utils";
|
|
4125
|
-
import
|
|
4126
|
-
forwardRef as
|
|
4146
|
+
import React36, {
|
|
4147
|
+
forwardRef as forwardRef14,
|
|
4127
4148
|
memo as memo23,
|
|
4128
4149
|
useCallback as useCallback21,
|
|
4129
4150
|
useEffect as useEffect14,
|
|
@@ -4209,10 +4230,10 @@ function mergeRanges(ranges) {
|
|
|
4209
4230
|
// src/components/ListView.tsx
|
|
4210
4231
|
import { range } from "@noya-app/noya-utils";
|
|
4211
4232
|
import { composeRefs as composeRefs2 } from "@radix-ui/react-compose-refs";
|
|
4212
|
-
import
|
|
4233
|
+
import React34, {
|
|
4213
4234
|
Children as Children4,
|
|
4214
4235
|
createContext as createContext9,
|
|
4215
|
-
forwardRef as
|
|
4236
|
+
forwardRef as forwardRef12,
|
|
4216
4237
|
isValidElement as isValidElement3,
|
|
4217
4238
|
memo as memo22,
|
|
4218
4239
|
useCallback as useCallback20,
|
|
@@ -4263,7 +4284,7 @@ import {
|
|
|
4263
4284
|
useSortable,
|
|
4264
4285
|
verticalListSortingStrategy
|
|
4265
4286
|
} from "@dnd-kit/sortable";
|
|
4266
|
-
import
|
|
4287
|
+
import React33, {
|
|
4267
4288
|
createContext as createContext8,
|
|
4268
4289
|
memo as memo21,
|
|
4269
4290
|
useCallback as useCallback19,
|
|
@@ -4405,7 +4426,7 @@ function SortableRoot({
|
|
|
4405
4426
|
useEffect13(() => {
|
|
4406
4427
|
setMounted(true);
|
|
4407
4428
|
}, []);
|
|
4408
|
-
return /* @__PURE__ */
|
|
4429
|
+
return /* @__PURE__ */ React33.createElement(
|
|
4409
4430
|
SortableItemContext.Provider,
|
|
4410
4431
|
{
|
|
4411
4432
|
value: useMemo17(
|
|
@@ -4419,7 +4440,7 @@ function SortableRoot({
|
|
|
4419
4440
|
[acceptsDrop, axis, keys, position, setActivatorEvent]
|
|
4420
4441
|
)
|
|
4421
4442
|
},
|
|
4422
|
-
/* @__PURE__ */
|
|
4443
|
+
/* @__PURE__ */ React33.createElement(
|
|
4423
4444
|
DndContext,
|
|
4424
4445
|
{
|
|
4425
4446
|
sensors,
|
|
@@ -4428,9 +4449,9 @@ function SortableRoot({
|
|
|
4428
4449
|
onDragMove: handleDragMove,
|
|
4429
4450
|
onDragEnd: handleDragEnd
|
|
4430
4451
|
},
|
|
4431
|
-
/* @__PURE__ */
|
|
4452
|
+
/* @__PURE__ */ React33.createElement(SortableContext, { items: keys, strategy: verticalListSortingStrategy }, children),
|
|
4432
4453
|
mounted && renderOverlay && createPortal2(
|
|
4433
|
-
/* @__PURE__ */
|
|
4454
|
+
/* @__PURE__ */ React33.createElement(DragOverlay, { dropAnimation: null }, activeIndex !== void 0 && activeIndex >= 0 && renderOverlay(activeIndex)),
|
|
4434
4455
|
document.body
|
|
4435
4456
|
)
|
|
4436
4457
|
)
|
|
@@ -4488,7 +4509,7 @@ function ListViewEditableRowTitle({
|
|
|
4488
4509
|
element.select();
|
|
4489
4510
|
}, 0);
|
|
4490
4511
|
}, [autoFocus]);
|
|
4491
|
-
return /* @__PURE__ */
|
|
4512
|
+
return /* @__PURE__ */ React34.createElement(
|
|
4492
4513
|
ListViewEditableRowTitleElement,
|
|
4493
4514
|
{
|
|
4494
4515
|
ref: inputRef,
|
|
@@ -4509,34 +4530,34 @@ function getPositionMargin(marginType) {
|
|
|
4509
4530
|
var RowContainer = styled23.div(
|
|
4510
4531
|
({
|
|
4511
4532
|
theme,
|
|
4512
|
-
marginType,
|
|
4513
|
-
selected,
|
|
4514
|
-
selectedPosition,
|
|
4515
|
-
disabled,
|
|
4516
|
-
hovered,
|
|
4517
|
-
variant,
|
|
4518
|
-
divider,
|
|
4519
|
-
isSectionHeader,
|
|
4520
|
-
showsActiveState,
|
|
4521
|
-
sectionHeaderVariant,
|
|
4522
|
-
colorScheme,
|
|
4523
|
-
gap,
|
|
4524
|
-
backgroundColor
|
|
4533
|
+
$marginType,
|
|
4534
|
+
$selected,
|
|
4535
|
+
$selectedPosition,
|
|
4536
|
+
$disabled,
|
|
4537
|
+
$hovered,
|
|
4538
|
+
$variant,
|
|
4539
|
+
$divider,
|
|
4540
|
+
$isSectionHeader,
|
|
4541
|
+
$showsActiveState,
|
|
4542
|
+
$sectionHeaderVariant,
|
|
4543
|
+
$colorScheme,
|
|
4544
|
+
$gap,
|
|
4545
|
+
$backgroundColor
|
|
4525
4546
|
}) => {
|
|
4526
|
-
const margin = getPositionMargin(marginType);
|
|
4547
|
+
const margin = getPositionMargin($marginType);
|
|
4527
4548
|
return {
|
|
4528
|
-
|
|
4529
|
-
|
|
4530
|
-
gap,
|
|
4549
|
+
...$isSectionHeader && $sectionHeaderVariant === "label" ? theme.textStyles.label : theme.textStyles.small,
|
|
4550
|
+
...$isSectionHeader && { fontWeight: 500 },
|
|
4551
|
+
gap: $gap,
|
|
4531
4552
|
flex: "0 0 auto",
|
|
4532
4553
|
userSelect: "none",
|
|
4533
4554
|
cursor: "default",
|
|
4534
|
-
|
|
4555
|
+
...$variant !== "bare" && {
|
|
4535
4556
|
paddingTop: "6px",
|
|
4536
4557
|
paddingRight: "12px",
|
|
4537
4558
|
paddingBottom: "6px",
|
|
4538
4559
|
paddingLeft: "12px",
|
|
4539
|
-
|
|
4560
|
+
...$variant === "padded" && {
|
|
4540
4561
|
borderRadius: "2px",
|
|
4541
4562
|
marginLeft: "8px",
|
|
4542
4563
|
marginRight: "8px",
|
|
@@ -4545,72 +4566,72 @@ var RowContainer = styled23.div(
|
|
|
4545
4566
|
}
|
|
4546
4567
|
},
|
|
4547
4568
|
color: theme.colors.textMuted,
|
|
4548
|
-
|
|
4569
|
+
...$isSectionHeader && {
|
|
4549
4570
|
backgroundColor: theme.colors.listView.raisedBackground,
|
|
4550
|
-
|
|
4571
|
+
...$sectionHeaderVariant === "label" && {
|
|
4551
4572
|
color: theme.colors.textDisabled
|
|
4552
4573
|
}
|
|
4553
4574
|
},
|
|
4554
|
-
|
|
4575
|
+
...$disabled && {
|
|
4555
4576
|
color: theme.colors.textDisabled
|
|
4556
4577
|
},
|
|
4557
|
-
|
|
4578
|
+
...$selected && {
|
|
4558
4579
|
color: "white",
|
|
4559
|
-
backgroundColor: theme.colors[colorScheme]
|
|
4580
|
+
backgroundColor: theme.colors[$colorScheme]
|
|
4560
4581
|
},
|
|
4561
4582
|
display: "flex",
|
|
4562
4583
|
alignItems: "center",
|
|
4563
|
-
|
|
4584
|
+
...$selected && !$isSectionHeader && ($selectedPosition === "middle" || $selectedPosition === "last") && {
|
|
4564
4585
|
borderTopRightRadius: "0px",
|
|
4565
4586
|
borderTopLeftRadius: "0px"
|
|
4566
4587
|
},
|
|
4567
|
-
|
|
4588
|
+
...$selected && !$isSectionHeader && ($selectedPosition === "middle" || $selectedPosition === "first") && {
|
|
4568
4589
|
borderBottomRightRadius: "0px",
|
|
4569
4590
|
borderBottomLeftRadius: "0px"
|
|
4570
4591
|
},
|
|
4571
4592
|
position: "relative",
|
|
4572
|
-
|
|
4573
|
-
boxShadow: `0 0 0 1px ${theme.colors[colorScheme]} inset`
|
|
4593
|
+
...$hovered && {
|
|
4594
|
+
boxShadow: `0 0 0 1px ${theme.colors[$colorScheme]} inset`
|
|
4574
4595
|
},
|
|
4575
|
-
|
|
4596
|
+
...$showsActiveState && {
|
|
4576
4597
|
"&:active": {
|
|
4577
|
-
backgroundColor: selected ? colorScheme === "secondary" ? theme.colors.secondaryLight : theme.colors.primaryLight : theme.colors.activeBackground
|
|
4598
|
+
backgroundColor: $selected ? $colorScheme === "secondary" ? theme.colors.secondaryLight : theme.colors.primaryLight : theme.colors.activeBackground
|
|
4578
4599
|
}
|
|
4579
4600
|
},
|
|
4580
|
-
|
|
4601
|
+
...$divider && {
|
|
4581
4602
|
borderBottom: `1px solid ${theme.colors.dividerSubtle}`
|
|
4582
4603
|
},
|
|
4583
|
-
|
|
4584
|
-
backgroundColor,
|
|
4604
|
+
...$backgroundColor && {
|
|
4605
|
+
backgroundColor: $backgroundColor,
|
|
4585
4606
|
"&:hover": {
|
|
4586
|
-
backgroundColor
|
|
4607
|
+
backgroundColor: $backgroundColor
|
|
4587
4608
|
},
|
|
4588
4609
|
"&:active": {
|
|
4589
|
-
backgroundColor
|
|
4610
|
+
backgroundColor: $backgroundColor
|
|
4590
4611
|
}
|
|
4591
4612
|
}
|
|
4592
4613
|
};
|
|
4593
4614
|
}
|
|
4594
4615
|
);
|
|
4595
|
-
var ListViewDragIndicatorElement = styled23.div(({ theme, relativeDropPosition, offsetLeft, colorScheme, gap }) => ({
|
|
4616
|
+
var ListViewDragIndicatorElement = styled23.div(({ theme, $relativeDropPosition, $offsetLeft, $colorScheme, $gap }) => ({
|
|
4596
4617
|
zIndex: 1,
|
|
4597
4618
|
position: "absolute",
|
|
4598
4619
|
borderRadius: "3px",
|
|
4599
|
-
|
|
4620
|
+
...$relativeDropPosition === "inside" ? {
|
|
4600
4621
|
inset: 2,
|
|
4601
|
-
boxShadow: `0 0 0 1px ${theme.colors.sidebar.background}, 0 0 0 3px ${colorScheme === "secondary" ? theme.colors.secondary : theme.colors.dragOutline}`
|
|
4622
|
+
boxShadow: `0 0 0 1px ${theme.colors.sidebar.background}, 0 0 0 3px ${$colorScheme === "secondary" ? theme.colors.secondary : theme.colors.dragOutline}`
|
|
4602
4623
|
} : {
|
|
4603
|
-
top: relativeDropPosition === "above" ? -(3 + gap / 2) : void 0,
|
|
4604
|
-
bottom: relativeDropPosition === "below" ? -(3 + gap / 2) : void 0,
|
|
4605
|
-
left: offsetLeft,
|
|
4624
|
+
top: $relativeDropPosition === "above" ? -(3 + $gap / 2) : void 0,
|
|
4625
|
+
bottom: $relativeDropPosition === "below" ? -(3 + $gap / 2) : void 0,
|
|
4626
|
+
left: $offsetLeft,
|
|
4606
4627
|
right: 0,
|
|
4607
4628
|
height: 6,
|
|
4608
|
-
background: theme.colors[colorScheme],
|
|
4629
|
+
background: theme.colors[$colorScheme],
|
|
4609
4630
|
border: `2px solid white`,
|
|
4610
4631
|
boxShadow: "0 0 2px rgba(0,0,0,0.5)"
|
|
4611
4632
|
}
|
|
4612
4633
|
}));
|
|
4613
|
-
var ListViewRow =
|
|
4634
|
+
var ListViewRow = forwardRef12(function ListViewRow2({
|
|
4614
4635
|
id,
|
|
4615
4636
|
tabIndex = 0,
|
|
4616
4637
|
gap,
|
|
@@ -4676,28 +4697,29 @@ var ListViewRow = forwardRef11(function ListViewRow2({
|
|
|
4676
4697
|
relativeDropPosition,
|
|
4677
4698
|
...renderProps
|
|
4678
4699
|
}, ref) => {
|
|
4679
|
-
const
|
|
4680
|
-
|
|
4700
|
+
const Component = RowContainer;
|
|
4701
|
+
const element = /* @__PURE__ */ React34.createElement(
|
|
4702
|
+
Component,
|
|
4681
4703
|
{
|
|
4682
4704
|
ref,
|
|
4683
|
-
colorScheme,
|
|
4705
|
+
$colorScheme: colorScheme,
|
|
4684
4706
|
onContextMenu,
|
|
4685
|
-
isSectionHeader,
|
|
4707
|
+
$isSectionHeader: isSectionHeader,
|
|
4686
4708
|
id,
|
|
4687
|
-
gap,
|
|
4688
|
-
backgroundColor,
|
|
4709
|
+
$gap: gap ?? 0,
|
|
4710
|
+
$backgroundColor: backgroundColor,
|
|
4689
4711
|
...hoverProps,
|
|
4690
4712
|
onDoubleClick: handleDoubleClick,
|
|
4691
|
-
marginType,
|
|
4692
|
-
disabled,
|
|
4693
|
-
hovered,
|
|
4694
|
-
selected,
|
|
4695
|
-
variant,
|
|
4696
|
-
sectionHeaderVariant,
|
|
4697
|
-
selectedPosition,
|
|
4698
|
-
showsActiveState: pressEventName === "onClick",
|
|
4713
|
+
$marginType: marginType ?? "none",
|
|
4714
|
+
$disabled: disabled,
|
|
4715
|
+
$hovered: hovered,
|
|
4716
|
+
$selected: selected,
|
|
4717
|
+
$variant: variant,
|
|
4718
|
+
$sectionHeaderVariant: sectionHeaderVariant,
|
|
4719
|
+
$selectedPosition: selectedPosition,
|
|
4720
|
+
$showsActiveState: pressEventName === "onClick",
|
|
4699
4721
|
"aria-selected": selected,
|
|
4700
|
-
divider: !isDragging && divider,
|
|
4722
|
+
$divider: !isDragging && divider,
|
|
4701
4723
|
onKeyDown,
|
|
4702
4724
|
style: mergedStyle,
|
|
4703
4725
|
...renderProps,
|
|
@@ -4707,20 +4729,20 @@ var ListViewRow = forwardRef11(function ListViewRow2({
|
|
|
4707
4729
|
),
|
|
4708
4730
|
tabIndex
|
|
4709
4731
|
},
|
|
4710
|
-
relativeDropPosition && /* @__PURE__ */
|
|
4732
|
+
relativeDropPosition && /* @__PURE__ */ React34.createElement(
|
|
4711
4733
|
ListViewDragIndicatorElement,
|
|
4712
4734
|
{
|
|
4713
|
-
colorScheme,
|
|
4714
|
-
relativeDropPosition,
|
|
4715
|
-
offsetLeft: 33 + depth * indentation,
|
|
4716
|
-
gap: listGap
|
|
4735
|
+
$colorScheme: colorScheme,
|
|
4736
|
+
$relativeDropPosition: relativeDropPosition,
|
|
4737
|
+
$offsetLeft: 33 + depth * indentation,
|
|
4738
|
+
$gap: listGap
|
|
4717
4739
|
}
|
|
4718
4740
|
),
|
|
4719
|
-
depth > 0 && /* @__PURE__ */
|
|
4741
|
+
depth > 0 && /* @__PURE__ */ React34.createElement(Spacer.Horizontal, { size: depth * indentation }),
|
|
4720
4742
|
children
|
|
4721
4743
|
);
|
|
4722
4744
|
if (menuItems && onSelectMenuItem) {
|
|
4723
|
-
return /* @__PURE__ */
|
|
4745
|
+
return /* @__PURE__ */ React34.createElement(
|
|
4724
4746
|
ContextMenu,
|
|
4725
4747
|
{
|
|
4726
4748
|
items: menuItems,
|
|
@@ -4733,7 +4755,10 @@ var ListViewRow = forwardRef11(function ListViewRow2({
|
|
|
4733
4755
|
return element;
|
|
4734
4756
|
};
|
|
4735
4757
|
if (sortable && id) {
|
|
4736
|
-
return /* @__PURE__ */
|
|
4758
|
+
return /* @__PURE__ */ React34.createElement(Sortable.Item, { id, disabled: overrideSortable === false }, ({ ref: sortableRef, ...sortableProps }) => renderContent(
|
|
4759
|
+
sortableProps,
|
|
4760
|
+
composeRefs2(sortableRef, forwardedRef)
|
|
4761
|
+
));
|
|
4737
4762
|
}
|
|
4738
4763
|
return renderContent({}, forwardedRef);
|
|
4739
4764
|
});
|
|
@@ -4745,9 +4770,9 @@ var VirtualizedListRow = memo22(function VirtualizedListRow2({
|
|
|
4745
4770
|
style: style3
|
|
4746
4771
|
}) {
|
|
4747
4772
|
const renderItem = useContext9(RenderItemContext);
|
|
4748
|
-
return /* @__PURE__ */
|
|
4773
|
+
return /* @__PURE__ */ React34.createElement("div", { key: index, style: style3 }, renderItem(index));
|
|
4749
4774
|
});
|
|
4750
|
-
var VirtualizedListInner =
|
|
4775
|
+
var VirtualizedListInner = forwardRef12(function VirtualizedListInner2({
|
|
4751
4776
|
size: size2,
|
|
4752
4777
|
scrollElement,
|
|
4753
4778
|
items,
|
|
@@ -4776,7 +4801,7 @@ var VirtualizedListInner = forwardRef11(function VirtualizedListInner2({
|
|
|
4776
4801
|
}),
|
|
4777
4802
|
[]
|
|
4778
4803
|
);
|
|
4779
|
-
return /* @__PURE__ */
|
|
4804
|
+
return /* @__PURE__ */ React34.createElement(RenderItemContext.Provider, { value: renderItem }, /* @__PURE__ */ React34.createElement(
|
|
4780
4805
|
WindowScroller,
|
|
4781
4806
|
{
|
|
4782
4807
|
scrollElement,
|
|
@@ -4787,7 +4812,7 @@ var VirtualizedListInner = forwardRef11(function VirtualizedListInner2({
|
|
|
4787
4812
|
registerChild,
|
|
4788
4813
|
onChildScroll,
|
|
4789
4814
|
scrollTop
|
|
4790
|
-
}) => /* @__PURE__ */
|
|
4815
|
+
}) => /* @__PURE__ */ React34.createElement("div", { ref: registerChild }, /* @__PURE__ */ React34.createElement(
|
|
4791
4816
|
VariableSizeList,
|
|
4792
4817
|
{
|
|
4793
4818
|
ref: listRef,
|
|
@@ -4820,15 +4845,15 @@ var VirtualizedListInner = forwardRef11(function VirtualizedListInner2({
|
|
|
4820
4845
|
var VirtualizedList = memo22(
|
|
4821
4846
|
VirtualizedListInner
|
|
4822
4847
|
);
|
|
4823
|
-
var RootContainer2 = styled23.div(({ theme, scrollable, gap }) => ({
|
|
4824
|
-
flex: scrollable ? "1 0 0" : "0 0 auto",
|
|
4848
|
+
var RootContainer2 = styled23.div(({ theme, $scrollable, $gap }) => ({
|
|
4849
|
+
flex: $scrollable ? "1 0 0" : "0 0 auto",
|
|
4825
4850
|
display: "flex",
|
|
4826
4851
|
flexDirection: "column",
|
|
4827
4852
|
flexWrap: "nowrap",
|
|
4828
4853
|
color: theme.colors.textMuted,
|
|
4829
|
-
gap
|
|
4854
|
+
gap: $gap
|
|
4830
4855
|
}));
|
|
4831
|
-
var ListViewRootInner =
|
|
4856
|
+
var ListViewRootInner = forwardRef12(function ListViewRootInner2({
|
|
4832
4857
|
onPress,
|
|
4833
4858
|
scrollable = false,
|
|
4834
4859
|
expandable = true,
|
|
@@ -4926,7 +4951,7 @@ var ListViewRootInner = forwardRef11(function ListViewRootInner2({
|
|
|
4926
4951
|
[indentation]
|
|
4927
4952
|
);
|
|
4928
4953
|
const renderOverlay = useCallback20(
|
|
4929
|
-
(index) => /* @__PURE__ */
|
|
4954
|
+
(index) => /* @__PURE__ */ React34.createElement("div", { style: { opacity: 0.25 } }, /* @__PURE__ */ React34.createElement(DraggingContext.Provider, { value: draggingContextOverlayValue }, renderItem(data[index], index, { isDragging: true }))),
|
|
4930
4955
|
[draggingContextOverlayValue, renderItem, data]
|
|
4931
4956
|
);
|
|
4932
4957
|
const renderWrappedChild = useCallback20(
|
|
@@ -4935,12 +4960,12 @@ var ListViewRootInner = forwardRef11(function ListViewRootInner2({
|
|
|
4935
4960
|
const current = renderChild(index);
|
|
4936
4961
|
if (!contextValue || !isValidElement3(current))
|
|
4937
4962
|
return null;
|
|
4938
|
-
return /* @__PURE__ */
|
|
4963
|
+
return /* @__PURE__ */ React34.createElement(ListRowContext.Provider, { key: current.key, value: contextValue }, current);
|
|
4939
4964
|
},
|
|
4940
4965
|
[getItemContextValue, renderChild]
|
|
4941
4966
|
);
|
|
4942
4967
|
const ids = useMemo18(() => data.map(keyExtractor), [keyExtractor, data]);
|
|
4943
|
-
const withSortable = (children) => sortable ? /* @__PURE__ */
|
|
4968
|
+
const withSortable = (children) => sortable ? /* @__PURE__ */ React34.createElement(
|
|
4944
4969
|
Sortable.Root,
|
|
4945
4970
|
{
|
|
4946
4971
|
onMoveItem,
|
|
@@ -4950,7 +4975,7 @@ var ListViewRootInner = forwardRef11(function ListViewRootInner2({
|
|
|
4950
4975
|
},
|
|
4951
4976
|
children
|
|
4952
4977
|
) : children;
|
|
4953
|
-
const withScrollable = (children) => scrollable ? /* @__PURE__ */
|
|
4978
|
+
const withScrollable = (children) => scrollable ? /* @__PURE__ */ React34.createElement(ScrollArea, null, children) : children(null);
|
|
4954
4979
|
const getItemHeight = useCallback20(
|
|
4955
4980
|
(index) => {
|
|
4956
4981
|
const child = getItemContextValue(index);
|
|
@@ -4965,18 +4990,18 @@ var ListViewRootInner = forwardRef11(function ListViewRootInner2({
|
|
|
4965
4990
|
[data, keyExtractor]
|
|
4966
4991
|
);
|
|
4967
4992
|
const draggingContextValue = useMemo18(() => ({ indentation }), [indentation]);
|
|
4968
|
-
return /* @__PURE__ */
|
|
4993
|
+
return /* @__PURE__ */ React34.createElement(DraggingContext.Provider, { value: draggingContextValue }, /* @__PURE__ */ React34.createElement(
|
|
4969
4994
|
RootContainer2,
|
|
4970
4995
|
{
|
|
4971
4996
|
...{
|
|
4972
4997
|
[pressEventName]: handleClick
|
|
4973
4998
|
},
|
|
4974
|
-
gap,
|
|
4975
|
-
scrollable
|
|
4999
|
+
$gap: gap,
|
|
5000
|
+
$scrollable: scrollable
|
|
4976
5001
|
},
|
|
4977
5002
|
withScrollable(
|
|
4978
5003
|
(scrollElementRef) => withSortable(
|
|
4979
|
-
virtualized ? /* @__PURE__ */
|
|
5004
|
+
virtualized ? /* @__PURE__ */ React34.createElement(
|
|
4980
5005
|
VirtualizedList,
|
|
4981
5006
|
{
|
|
4982
5007
|
ref: forwardedRef,
|
|
@@ -4993,14 +5018,14 @@ var ListViewRootInner = forwardRef11(function ListViewRootInner2({
|
|
|
4993
5018
|
));
|
|
4994
5019
|
});
|
|
4995
5020
|
var ListViewRoot = memo22(ListViewRootInner);
|
|
4996
|
-
var ChildrenListViewInner =
|
|
5021
|
+
var ChildrenListViewInner = forwardRef12(function ChildrenListViewInner2({ children, ...rest }, forwardedRef) {
|
|
4997
5022
|
const items = useMemo18(
|
|
4998
5023
|
() => Children4.toArray(children).flatMap(
|
|
4999
5024
|
(child) => isValidElement3(child) ? [child] : []
|
|
5000
5025
|
),
|
|
5001
5026
|
[children]
|
|
5002
5027
|
);
|
|
5003
|
-
return /* @__PURE__ */
|
|
5028
|
+
return /* @__PURE__ */ React34.createElement(
|
|
5004
5029
|
ListViewRoot,
|
|
5005
5030
|
{
|
|
5006
5031
|
ref: forwardedRef,
|
|
@@ -5015,11 +5040,11 @@ var ChildrenListViewInner = forwardRef11(function ChildrenListViewInner2({ child
|
|
|
5015
5040
|
);
|
|
5016
5041
|
});
|
|
5017
5042
|
var ChildrenListView = memo22(ChildrenListViewInner);
|
|
5018
|
-
var SimpleListViewInner =
|
|
5043
|
+
var SimpleListViewInner = forwardRef12(function SimpleListViewInner2(props, forwardedRef) {
|
|
5019
5044
|
if ("children" in props) {
|
|
5020
|
-
return /* @__PURE__ */
|
|
5045
|
+
return /* @__PURE__ */ React34.createElement(ChildrenListView, { ref: forwardedRef, ...props });
|
|
5021
5046
|
} else {
|
|
5022
|
-
return /* @__PURE__ */
|
|
5047
|
+
return /* @__PURE__ */ React34.createElement(ListViewRoot, { ref: forwardedRef, ...props });
|
|
5023
5048
|
}
|
|
5024
5049
|
});
|
|
5025
5050
|
var SimpleListView = memo22(SimpleListViewInner);
|
|
@@ -5040,7 +5065,7 @@ var ListView;
|
|
|
5040
5065
|
})(ListView || (ListView = {}));
|
|
5041
5066
|
|
|
5042
5067
|
// src/components/Text.tsx
|
|
5043
|
-
import
|
|
5068
|
+
import React35, { forwardRef as forwardRef13 } from "react";
|
|
5044
5069
|
import styled24 from "styled-components";
|
|
5045
5070
|
var elements = {
|
|
5046
5071
|
title: "h1",
|
|
@@ -5056,13 +5081,13 @@ var elements = {
|
|
|
5056
5081
|
code: "code",
|
|
5057
5082
|
label: "span"
|
|
5058
5083
|
};
|
|
5059
|
-
var StyledElement = styled24.span(({ theme, variant, styleProps, breakpoints, color }) => ({
|
|
5060
|
-
...theme.textStyles[variant],
|
|
5061
|
-
color: color ? theme.colors[color] : void 0,
|
|
5062
|
-
|
|
5063
|
-
...mergeBreakpoints(breakpoints || [])
|
|
5084
|
+
var StyledElement = styled24.span(({ theme, $variant, $styleProps, $breakpoints, $color }) => ({
|
|
5085
|
+
...theme.textStyles[$variant],
|
|
5086
|
+
color: $color ? theme.colors[$color] : void 0,
|
|
5087
|
+
...$styleProps,
|
|
5088
|
+
...mergeBreakpoints($breakpoints || [])
|
|
5064
5089
|
}));
|
|
5065
|
-
var Text =
|
|
5090
|
+
var Text = forwardRef13(function Text2({
|
|
5066
5091
|
as,
|
|
5067
5092
|
variant,
|
|
5068
5093
|
breakpoints,
|
|
@@ -5074,44 +5099,44 @@ var Text = forwardRef12(function Text2({
|
|
|
5074
5099
|
...rest
|
|
5075
5100
|
}, forwardedRef) {
|
|
5076
5101
|
const element = as ?? elements[variant] ?? "span";
|
|
5077
|
-
return /* @__PURE__ */
|
|
5102
|
+
return /* @__PURE__ */ React35.createElement(
|
|
5078
5103
|
StyledElement,
|
|
5079
5104
|
{
|
|
5080
5105
|
ref: forwardedRef,
|
|
5081
5106
|
as: element,
|
|
5082
5107
|
className,
|
|
5083
|
-
variant,
|
|
5084
|
-
breakpoints,
|
|
5085
|
-
styleProps: rest,
|
|
5086
|
-
color,
|
|
5108
|
+
$variant: variant,
|
|
5109
|
+
$breakpoints: breakpoints,
|
|
5110
|
+
$styleProps: rest,
|
|
5111
|
+
$color: color,
|
|
5087
5112
|
onClick,
|
|
5088
5113
|
...href && { href }
|
|
5089
5114
|
},
|
|
5090
5115
|
children
|
|
5091
5116
|
);
|
|
5092
5117
|
});
|
|
5093
|
-
var Heading1 =
|
|
5094
|
-
(props, ref) => /* @__PURE__ */
|
|
5118
|
+
var Heading1 = forwardRef13(
|
|
5119
|
+
(props, ref) => /* @__PURE__ */ React35.createElement(Text, { ref, ...props, variant: "heading1" })
|
|
5095
5120
|
);
|
|
5096
|
-
var Heading2 =
|
|
5097
|
-
(props, ref) => /* @__PURE__ */
|
|
5121
|
+
var Heading2 = forwardRef13(
|
|
5122
|
+
(props, ref) => /* @__PURE__ */ React35.createElement(Text, { ref, ...props, variant: "heading2" })
|
|
5098
5123
|
);
|
|
5099
|
-
var Heading3 =
|
|
5100
|
-
(props, ref) => /* @__PURE__ */
|
|
5124
|
+
var Heading3 = forwardRef13(
|
|
5125
|
+
(props, ref) => /* @__PURE__ */ React35.createElement(Text, { ref, ...props, variant: "heading3" })
|
|
5101
5126
|
);
|
|
5102
|
-
var Heading4 =
|
|
5103
|
-
(props, ref) => /* @__PURE__ */
|
|
5127
|
+
var Heading4 = forwardRef13(
|
|
5128
|
+
(props, ref) => /* @__PURE__ */ React35.createElement(Text, { ref, ...props, variant: "heading4" })
|
|
5104
5129
|
);
|
|
5105
|
-
var Heading5 =
|
|
5106
|
-
(props, ref) => /* @__PURE__ */
|
|
5130
|
+
var Heading5 = forwardRef13(
|
|
5131
|
+
(props, ref) => /* @__PURE__ */ React35.createElement(Text, { ref, ...props, variant: "heading5" })
|
|
5107
5132
|
);
|
|
5108
|
-
var Body =
|
|
5109
|
-
(props, ref) => /* @__PURE__ */
|
|
5133
|
+
var Body = forwardRef13(
|
|
5134
|
+
(props, ref) => /* @__PURE__ */ React35.createElement(Text, { ref, ...props, variant: "body" })
|
|
5110
5135
|
);
|
|
5111
|
-
var Small =
|
|
5112
|
-
(props, ref) => /* @__PURE__ */
|
|
5136
|
+
var Small = forwardRef13(
|
|
5137
|
+
(props, ref) => /* @__PURE__ */ React35.createElement(Text, { ref, ...props, variant: "small" })
|
|
5113
5138
|
);
|
|
5114
|
-
var Italic = ({ children }) => /* @__PURE__ */
|
|
5139
|
+
var Italic = ({ children }) => /* @__PURE__ */ React35.createElement(
|
|
5115
5140
|
"span",
|
|
5116
5141
|
{
|
|
5117
5142
|
style: {
|
|
@@ -5148,20 +5173,20 @@ function filterWithGroupedSections(items, query) {
|
|
|
5148
5173
|
});
|
|
5149
5174
|
}
|
|
5150
5175
|
var CompletionToken = styled25.span(
|
|
5151
|
-
({ type }) => ({
|
|
5152
|
-
fontWeight: type === "match" ? "bold" : "normal",
|
|
5176
|
+
({ $type }) => ({
|
|
5177
|
+
fontWeight: $type === "match" ? "bold" : "normal",
|
|
5153
5178
|
whiteSpace: "pre"
|
|
5154
5179
|
})
|
|
5155
5180
|
);
|
|
5156
5181
|
var CompletionMenu = memo23(
|
|
5157
|
-
|
|
5182
|
+
forwardRef14(function CompletionMenu2({
|
|
5158
5183
|
items,
|
|
5159
5184
|
selectedIndex,
|
|
5160
5185
|
onSelectItem,
|
|
5161
5186
|
onHoverIndex,
|
|
5162
5187
|
listSize
|
|
5163
5188
|
}, forwardedRef) {
|
|
5164
|
-
return /* @__PURE__ */
|
|
5189
|
+
return /* @__PURE__ */ React36.createElement(
|
|
5165
5190
|
ListView.Root,
|
|
5166
5191
|
{
|
|
5167
5192
|
ref: forwardedRef,
|
|
@@ -5173,13 +5198,13 @@ var CompletionMenu = memo23(
|
|
|
5173
5198
|
sectionHeaderVariant: "label",
|
|
5174
5199
|
renderItem: (item, i) => {
|
|
5175
5200
|
if (item.type === "sectionHeader") {
|
|
5176
|
-
return /* @__PURE__ */
|
|
5201
|
+
return /* @__PURE__ */ React36.createElement(ListView.Row, { key: item.id, isSectionHeader: true }, item.name);
|
|
5177
5202
|
}
|
|
5178
5203
|
const tokens = fuzzyTokenize({
|
|
5179
5204
|
item: item.name,
|
|
5180
5205
|
itemScore: item
|
|
5181
5206
|
});
|
|
5182
|
-
return /* @__PURE__ */
|
|
5207
|
+
return /* @__PURE__ */ React36.createElement(
|
|
5183
5208
|
ListView.Row,
|
|
5184
5209
|
{
|
|
5185
5210
|
key: item.id,
|
|
@@ -5191,8 +5216,8 @@ var CompletionMenu = memo23(
|
|
|
5191
5216
|
}
|
|
5192
5217
|
}
|
|
5193
5218
|
},
|
|
5194
|
-
tokens.map((token, j) => /* @__PURE__ */
|
|
5195
|
-
item.icon && /* @__PURE__ */
|
|
5219
|
+
tokens.map((token, j) => /* @__PURE__ */ React36.createElement(CompletionToken, { key: j, $type: token.type }, token.text)),
|
|
5220
|
+
item.icon && /* @__PURE__ */ React36.createElement(React36.Fragment, null, /* @__PURE__ */ React36.createElement(Spacer.Horizontal, null), item.icon)
|
|
5196
5221
|
);
|
|
5197
5222
|
}
|
|
5198
5223
|
}
|
|
@@ -5200,7 +5225,7 @@ var CompletionMenu = memo23(
|
|
|
5200
5225
|
})
|
|
5201
5226
|
);
|
|
5202
5227
|
var InputFieldWithCompletions = memo23(
|
|
5203
|
-
|
|
5228
|
+
forwardRef14(function InputFieldWithCompletions2({
|
|
5204
5229
|
loading,
|
|
5205
5230
|
initialValue = "",
|
|
5206
5231
|
placeholder,
|
|
@@ -5261,7 +5286,7 @@ var InputFieldWithCompletions = memo23(
|
|
|
5261
5286
|
updateState({ filter: initialValue });
|
|
5262
5287
|
}, [initialValue, updateState]);
|
|
5263
5288
|
const { filter, selectedIndex } = state;
|
|
5264
|
-
const listRef =
|
|
5289
|
+
const listRef = React36.useRef(null);
|
|
5265
5290
|
const filteredItems = useMemo19(
|
|
5266
5291
|
() => filterWithGroupedSections(items, filter),
|
|
5267
5292
|
[items, filter]
|
|
@@ -5397,14 +5422,14 @@ var InputFieldWithCompletions = memo23(
|
|
|
5397
5422
|
ref.current?.setSelectionRange(0, ref.current.value.length);
|
|
5398
5423
|
}
|
|
5399
5424
|
}));
|
|
5400
|
-
return /* @__PURE__ */
|
|
5425
|
+
return /* @__PURE__ */ React36.createElement(
|
|
5401
5426
|
InputField.Root,
|
|
5402
5427
|
{
|
|
5403
5428
|
size: size2,
|
|
5404
5429
|
labelSize: 16,
|
|
5405
5430
|
renderPopoverContent: ({ width }) => {
|
|
5406
5431
|
const listSize = { width, height };
|
|
5407
|
-
return /* @__PURE__ */
|
|
5432
|
+
return /* @__PURE__ */ React36.createElement(Stack.V, { flex: `0 0 ${height}px`, display }, filteredItems.length > 0 ? /* @__PURE__ */ React36.createElement(
|
|
5408
5433
|
CompletionMenu,
|
|
5409
5434
|
{
|
|
5410
5435
|
ref: listRef,
|
|
@@ -5414,7 +5439,7 @@ var InputFieldWithCompletions = memo23(
|
|
|
5414
5439
|
onHoverIndex: handleIndexChange,
|
|
5415
5440
|
listSize
|
|
5416
5441
|
}
|
|
5417
|
-
) : /* @__PURE__ */
|
|
5442
|
+
) : /* @__PURE__ */ React36.createElement(
|
|
5418
5443
|
Stack.V,
|
|
5419
5444
|
{
|
|
5420
5445
|
height: "100px",
|
|
@@ -5422,11 +5447,11 @@ var InputFieldWithCompletions = memo23(
|
|
|
5422
5447
|
alignItems: "center",
|
|
5423
5448
|
justifyContent: "center"
|
|
5424
5449
|
},
|
|
5425
|
-
/* @__PURE__ */
|
|
5450
|
+
/* @__PURE__ */ React36.createElement(Small, { color: "textDisabled" }, loading ? "Loading" : "No results")
|
|
5426
5451
|
));
|
|
5427
5452
|
}
|
|
5428
5453
|
},
|
|
5429
|
-
/* @__PURE__ */
|
|
5454
|
+
/* @__PURE__ */ React36.createElement(
|
|
5430
5455
|
InputField.Input,
|
|
5431
5456
|
{
|
|
5432
5457
|
ref,
|
|
@@ -5450,9 +5475,9 @@ var InputFieldWithCompletions = memo23(
|
|
|
5450
5475
|
"aria-controls": "component-listbox"
|
|
5451
5476
|
}
|
|
5452
5477
|
),
|
|
5453
|
-
filter && typeaheadValue && typeaheadValue.startsWith(filter) && /* @__PURE__ */
|
|
5478
|
+
filter && typeaheadValue && typeaheadValue.startsWith(filter) && /* @__PURE__ */ React36.createElement(InputField.Typeahead, { value: typeaheadValue }),
|
|
5454
5479
|
(!isFocused || !hideChildrenWhenFocused) && children,
|
|
5455
|
-
loading && isFocused && /* @__PURE__ */
|
|
5480
|
+
loading && isFocused && /* @__PURE__ */ React36.createElement(InputField.Label, null, /* @__PURE__ */ React36.createElement(ActivityIndicator, null))
|
|
5456
5481
|
);
|
|
5457
5482
|
})
|
|
5458
5483
|
);
|
|
@@ -5474,13 +5499,13 @@ function getNextIndex(items, currentIndex, direction, isDisabled) {
|
|
|
5474
5499
|
}
|
|
5475
5500
|
|
|
5476
5501
|
// src/components/Label.tsx
|
|
5477
|
-
import
|
|
5502
|
+
import React37, { memo as memo24 } from "react";
|
|
5478
5503
|
import styled26 from "styled-components";
|
|
5479
5504
|
var LabelLabel = styled26.label(
|
|
5480
|
-
({ theme, selected }) => ({
|
|
5505
|
+
({ theme, $selected }) => ({
|
|
5481
5506
|
...theme.textStyles.small,
|
|
5482
5507
|
color: theme.colors.textMuted,
|
|
5483
|
-
|
|
5508
|
+
...$selected && {
|
|
5484
5509
|
color: theme.colors.text
|
|
5485
5510
|
},
|
|
5486
5511
|
fontSize: "11px",
|
|
@@ -5503,7 +5528,7 @@ var LabelContainer2 = styled26.span(({ theme }) => ({
|
|
|
5503
5528
|
alignItems: "center"
|
|
5504
5529
|
}));
|
|
5505
5530
|
function LabelRoot({ label, children }) {
|
|
5506
|
-
return /* @__PURE__ */
|
|
5531
|
+
return /* @__PURE__ */ React37.createElement(LabelContainer2, null, children, label && /* @__PURE__ */ React37.createElement(React37.Fragment, null, /* @__PURE__ */ React37.createElement(Spacer.Vertical, { size: 2 }), /* @__PURE__ */ React37.createElement(LabelLabel, null, label)));
|
|
5507
5532
|
}
|
|
5508
5533
|
var Label;
|
|
5509
5534
|
((_Label) => {
|
|
@@ -5513,7 +5538,7 @@ var Label;
|
|
|
5513
5538
|
|
|
5514
5539
|
// src/components/LabeledElementView.tsx
|
|
5515
5540
|
import * as kiwi from "kiwi.js";
|
|
5516
|
-
import
|
|
5541
|
+
import React38, {
|
|
5517
5542
|
Children as Children5,
|
|
5518
5543
|
createRef,
|
|
5519
5544
|
Fragment,
|
|
@@ -5558,7 +5583,7 @@ var LabeledElementView = memo25(function LabeledElementView2({
|
|
|
5558
5583
|
);
|
|
5559
5584
|
}, [serializedIds]);
|
|
5560
5585
|
const labelElements = useMemo20(() => {
|
|
5561
|
-
return serializedIds.split(",").map((id, index) => /* @__PURE__ */
|
|
5586
|
+
return serializedIds.split(",").map((id, index) => /* @__PURE__ */ React38.createElement(
|
|
5562
5587
|
"span",
|
|
5563
5588
|
{
|
|
5564
5589
|
key: id,
|
|
@@ -5636,13 +5661,13 @@ var LabeledElementView = memo25(function LabeledElementView2({
|
|
|
5636
5661
|
`${Math.max(...heights)}px`
|
|
5637
5662
|
);
|
|
5638
5663
|
}, [refs, labelElements]);
|
|
5639
|
-
return /* @__PURE__ */
|
|
5664
|
+
return /* @__PURE__ */ React38.createElement(Container4, { ref: containerRef }, /* @__PURE__ */ React38.createElement(Tools, null, children), /* @__PURE__ */ React38.createElement(Labels, null, labelElements));
|
|
5640
5665
|
});
|
|
5641
5666
|
|
|
5642
5667
|
// src/components/Progress.tsx
|
|
5643
5668
|
import { clamp } from "@noya-app/noya-utils";
|
|
5644
5669
|
import * as ProgressPrimitive from "@radix-ui/react-progress";
|
|
5645
|
-
import
|
|
5670
|
+
import React39 from "react";
|
|
5646
5671
|
import styled28 from "styled-components";
|
|
5647
5672
|
function Progress({
|
|
5648
5673
|
value,
|
|
@@ -5652,7 +5677,7 @@ function Progress({
|
|
|
5652
5677
|
variant = "normal"
|
|
5653
5678
|
}) {
|
|
5654
5679
|
const clampedValue = clamp(value, 0, 100);
|
|
5655
|
-
return /* @__PURE__ */
|
|
5680
|
+
return /* @__PURE__ */ React39.createElement(ProgressRoot, { value: clampedValue, style: { width, flex, height } }, /* @__PURE__ */ React39.createElement(
|
|
5656
5681
|
ProgressIndicator,
|
|
5657
5682
|
{
|
|
5658
5683
|
variant,
|
|
@@ -5677,18 +5702,18 @@ var ProgressIndicator = styled28(ProgressPrimitive.Indicator)(({ theme, variant
|
|
|
5677
5702
|
|
|
5678
5703
|
// src/components/RadioGroup.tsx
|
|
5679
5704
|
import * as ToggleGroupPrimitive from "@radix-ui/react-toggle-group";
|
|
5680
|
-
import
|
|
5705
|
+
import React40, {
|
|
5681
5706
|
createContext as createContext10,
|
|
5682
|
-
forwardRef as
|
|
5707
|
+
forwardRef as forwardRef15,
|
|
5683
5708
|
memo as memo26,
|
|
5684
5709
|
useCallback as useCallback22,
|
|
5685
5710
|
useContext as useContext10,
|
|
5686
5711
|
useMemo as useMemo21
|
|
5687
5712
|
} from "react";
|
|
5688
5713
|
import styled29 from "styled-components";
|
|
5689
|
-
var
|
|
5714
|
+
var ignoredProps2 = /* @__PURE__ */ new Set(["colorScheme"]);
|
|
5690
5715
|
var StyledRoot = styled29(ToggleGroupPrimitive.Root).withConfig({
|
|
5691
|
-
shouldForwardProp: (prop) => !
|
|
5716
|
+
shouldForwardProp: (prop) => !ignoredProps2.has(prop)
|
|
5692
5717
|
})(({ theme, colorScheme }) => ({
|
|
5693
5718
|
appearance: "none",
|
|
5694
5719
|
width: "0px",
|
|
@@ -5711,7 +5736,7 @@ var StyledRoot = styled29(ToggleGroupPrimitive.Root).withConfig({
|
|
|
5711
5736
|
padding: colorScheme === void 0 ? "2px" : 0
|
|
5712
5737
|
}));
|
|
5713
5738
|
var StyledItem = styled29(ToggleGroupPrimitive.Item).withConfig({
|
|
5714
|
-
shouldForwardProp: (prop) => !
|
|
5739
|
+
shouldForwardProp: (prop) => !ignoredProps2.has(prop)
|
|
5715
5740
|
})(({ theme, colorScheme }) => ({
|
|
5716
5741
|
...theme.textStyles.small,
|
|
5717
5742
|
position: "relative",
|
|
@@ -5737,9 +5762,9 @@ var StyledItem = styled29(ToggleGroupPrimitive.Item).withConfig({
|
|
|
5737
5762
|
boxShadow: `0 0 0 1px ${theme.colors.sidebar.background}, 0 0 0 3px ${theme.colors[colorScheme ?? "primary"]}`
|
|
5738
5763
|
}
|
|
5739
5764
|
}));
|
|
5740
|
-
var ToggleGroupItem =
|
|
5765
|
+
var ToggleGroupItem = forwardRef15(function ToggleGroupItem2({ value, tooltip, children, disabled = false }, forwardedRef) {
|
|
5741
5766
|
const { colorScheme } = useContext10(RadioGroupContext);
|
|
5742
|
-
const itemElement = /* @__PURE__ */
|
|
5767
|
+
const itemElement = /* @__PURE__ */ React40.createElement(
|
|
5743
5768
|
StyledItem,
|
|
5744
5769
|
{
|
|
5745
5770
|
ref: forwardedRef,
|
|
@@ -5749,7 +5774,7 @@ var ToggleGroupItem = forwardRef14(function ToggleGroupItem2({ value, tooltip, c
|
|
|
5749
5774
|
},
|
|
5750
5775
|
children
|
|
5751
5776
|
);
|
|
5752
|
-
return tooltip ? /* @__PURE__ */
|
|
5777
|
+
return tooltip ? /* @__PURE__ */ React40.createElement(Tooltip, { content: tooltip }, itemElement) : itemElement;
|
|
5753
5778
|
});
|
|
5754
5779
|
var RadioGroupContext = createContext10({
|
|
5755
5780
|
colorScheme: "primary"
|
|
@@ -5771,7 +5796,7 @@ function ToggleGroupRoot({
|
|
|
5771
5796
|
},
|
|
5772
5797
|
[allowEmpty, onValueChange]
|
|
5773
5798
|
);
|
|
5774
|
-
return /* @__PURE__ */
|
|
5799
|
+
return /* @__PURE__ */ React40.createElement(RadioGroupContext.Provider, { value: contextValue }, /* @__PURE__ */ React40.createElement(
|
|
5775
5800
|
StyledRoot,
|
|
5776
5801
|
{
|
|
5777
5802
|
id,
|
|
@@ -5790,8 +5815,8 @@ var RadioGroup;
|
|
|
5790
5815
|
})(RadioGroup || (RadioGroup = {}));
|
|
5791
5816
|
|
|
5792
5817
|
// src/components/Select.tsx
|
|
5793
|
-
import { memoize
|
|
5794
|
-
import
|
|
5818
|
+
import { memoize } from "@noya-app/noya-utils";
|
|
5819
|
+
import React41, {
|
|
5795
5820
|
createContext as createContext11,
|
|
5796
5821
|
memo as memo27,
|
|
5797
5822
|
useCallback as useCallback23,
|
|
@@ -5814,32 +5839,32 @@ var SelectOption = memo27(function SelectOption2({
|
|
|
5814
5839
|
addListener(value, onSelect);
|
|
5815
5840
|
return () => removeListener(value);
|
|
5816
5841
|
}, [addListener, onSelect, removeListener, value]);
|
|
5817
|
-
return /* @__PURE__ */
|
|
5842
|
+
return /* @__PURE__ */ React41.createElement("option", { value }, title ?? value);
|
|
5818
5843
|
});
|
|
5819
|
-
var createChevronSVGString =
|
|
5844
|
+
var createChevronSVGString = memoize(
|
|
5820
5845
|
(color) => `
|
|
5821
5846
|
<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 15 15' fill='${color}'>
|
|
5822
5847
|
<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>
|
|
5823
5848
|
</svg>
|
|
5824
|
-
|
|
5849
|
+
`.replace(/\n/g, "")
|
|
5825
5850
|
);
|
|
5826
5851
|
var SelectContainer = styled30.div(
|
|
5827
|
-
({ flex }) => ({
|
|
5828
|
-
flex: flex ?? "1 1 0px",
|
|
5852
|
+
({ $flex }) => ({
|
|
5853
|
+
flex: $flex ?? "1 1 0px",
|
|
5829
5854
|
display: "flex",
|
|
5830
5855
|
flexDirection: "row",
|
|
5831
5856
|
position: "relative"
|
|
5832
5857
|
})
|
|
5833
5858
|
);
|
|
5834
5859
|
var SelectElement = styled30.select(
|
|
5835
|
-
({ theme, flex }) => ({
|
|
5860
|
+
({ theme, $flex }) => ({
|
|
5836
5861
|
appearance: "none",
|
|
5837
5862
|
...theme.textStyles.small,
|
|
5838
5863
|
color: theme.colors.text,
|
|
5839
5864
|
lineHeight: "19px",
|
|
5840
5865
|
width: "0px",
|
|
5841
5866
|
// Reset intrinsic width
|
|
5842
|
-
flex: flex ?? "1 1 0px",
|
|
5867
|
+
flex: $flex ?? "1 1 0px",
|
|
5843
5868
|
position: "relative",
|
|
5844
5869
|
border: "0",
|
|
5845
5870
|
outline: "none",
|
|
@@ -5888,7 +5913,7 @@ var Select = memo27(function Select2({
|
|
|
5888
5913
|
const onChange = "options" in rest ? rest.onChange : void 0;
|
|
5889
5914
|
const children = "options" in rest ? void 0 : rest.children;
|
|
5890
5915
|
const optionElements = useMemo22(
|
|
5891
|
-
() => options ? options.map((option, index) => /* @__PURE__ */
|
|
5916
|
+
() => options ? options.map((option, index) => /* @__PURE__ */ React41.createElement(
|
|
5892
5917
|
SelectOption,
|
|
5893
5918
|
{
|
|
5894
5919
|
key: option,
|
|
@@ -5907,11 +5932,11 @@ var Select = memo27(function Select2({
|
|
|
5907
5932
|
}),
|
|
5908
5933
|
[]
|
|
5909
5934
|
);
|
|
5910
|
-
return /* @__PURE__ */
|
|
5935
|
+
return /* @__PURE__ */ React41.createElement(SelectContext.Provider, { value: contextValue }, /* @__PURE__ */ React41.createElement(SelectContainer, { $flex: flex }, /* @__PURE__ */ React41.createElement(
|
|
5911
5936
|
SelectElement,
|
|
5912
5937
|
{
|
|
5913
5938
|
id,
|
|
5914
|
-
flex,
|
|
5939
|
+
$flex: flex,
|
|
5915
5940
|
value,
|
|
5916
5941
|
onChange: useCallback23(
|
|
5917
5942
|
(event) => listeners.current.get(event.target.value)?.(),
|
|
@@ -5920,12 +5945,12 @@ var Select = memo27(function Select2({
|
|
|
5920
5945
|
onPointerDown: (event) => event.stopPropagation()
|
|
5921
5946
|
},
|
|
5922
5947
|
optionElements
|
|
5923
|
-
)), label && /* @__PURE__ */
|
|
5948
|
+
)), label && /* @__PURE__ */ React41.createElement(SelectLabel, { htmlFor: id }, label));
|
|
5924
5949
|
});
|
|
5925
5950
|
|
|
5926
5951
|
// src/components/Slider.tsx
|
|
5927
5952
|
import * as RadixSlider from "@radix-ui/react-slider";
|
|
5928
|
-
import
|
|
5953
|
+
import React42, { useCallback as useCallback24, useMemo as useMemo23 } from "react";
|
|
5929
5954
|
import styled31 from "styled-components";
|
|
5930
5955
|
var StyledSlider = styled31(RadixSlider.Root)({
|
|
5931
5956
|
flex: "1",
|
|
@@ -5976,7 +6001,7 @@ var Slider = function Slider2({
|
|
|
5976
6001
|
},
|
|
5977
6002
|
[onValueChange]
|
|
5978
6003
|
);
|
|
5979
|
-
return /* @__PURE__ */
|
|
6004
|
+
return /* @__PURE__ */ React42.createElement(
|
|
5980
6005
|
StyledSlider,
|
|
5981
6006
|
{
|
|
5982
6007
|
min,
|
|
@@ -5985,16 +6010,16 @@ var Slider = function Slider2({
|
|
|
5985
6010
|
value: arrayValue,
|
|
5986
6011
|
onValueChange: handleValueChange
|
|
5987
6012
|
},
|
|
5988
|
-
/* @__PURE__ */
|
|
5989
|
-
/* @__PURE__ */
|
|
6013
|
+
/* @__PURE__ */ React42.createElement(StyledTrack, null, /* @__PURE__ */ React42.createElement(StyledRange, null)),
|
|
6014
|
+
/* @__PURE__ */ React42.createElement(StyledThumb2, null)
|
|
5990
6015
|
);
|
|
5991
6016
|
};
|
|
5992
6017
|
|
|
5993
6018
|
// src/components/Switch.tsx
|
|
5994
6019
|
import * as SwitchPrimitive from "@radix-ui/react-switch";
|
|
5995
|
-
import
|
|
6020
|
+
import React43 from "react";
|
|
5996
6021
|
import styled32 from "styled-components";
|
|
5997
|
-
var SwitchRoot = styled32(SwitchPrimitive.Root)(({ theme, colorScheme
|
|
6022
|
+
var SwitchRoot = styled32(SwitchPrimitive.Root)(({ theme, $colorScheme }) => ({
|
|
5998
6023
|
all: "unset",
|
|
5999
6024
|
width: 32,
|
|
6000
6025
|
height: 19,
|
|
@@ -6003,13 +6028,12 @@ var SwitchRoot = styled32(SwitchPrimitive.Root)(({ theme, colorScheme: variant }
|
|
|
6003
6028
|
position: "relative",
|
|
6004
6029
|
WebkitTapHighlightColor: "rgba(0, 0, 0, 0)",
|
|
6005
6030
|
cursor: "pointer",
|
|
6006
|
-
|
|
6007
|
-
|
|
6008
|
-
|
|
6009
|
-
|
|
6010
|
-
// },
|
|
6031
|
+
"&:focus": {
|
|
6032
|
+
outline: `2px solid ${theme.colors.primary}`,
|
|
6033
|
+
outlineOffset: "1px"
|
|
6034
|
+
},
|
|
6011
6035
|
'&[data-state="checked"]': {
|
|
6012
|
-
backgroundColor:
|
|
6036
|
+
backgroundColor: $colorScheme === "primary" ? theme.colors.primary : $colorScheme === "secondary" ? theme.colors.secondary : void 0
|
|
6013
6037
|
}
|
|
6014
6038
|
}));
|
|
6015
6039
|
var SwitchThumb = styled32(SwitchPrimitive.Thumb)({
|
|
@@ -6028,27 +6052,27 @@ var Switch = function Switch2({
|
|
|
6028
6052
|
onChange,
|
|
6029
6053
|
colorScheme = "normal"
|
|
6030
6054
|
}) {
|
|
6031
|
-
return /* @__PURE__ */
|
|
6055
|
+
return /* @__PURE__ */ React43.createElement(
|
|
6032
6056
|
SwitchRoot,
|
|
6033
6057
|
{
|
|
6034
|
-
colorScheme,
|
|
6058
|
+
$colorScheme: colorScheme,
|
|
6035
6059
|
checked: value,
|
|
6036
6060
|
onCheckedChange: (newValue) => {
|
|
6037
6061
|
onChange(newValue);
|
|
6038
6062
|
}
|
|
6039
6063
|
},
|
|
6040
|
-
/* @__PURE__ */
|
|
6064
|
+
/* @__PURE__ */ React43.createElement(SwitchThumb, null)
|
|
6041
6065
|
);
|
|
6042
6066
|
};
|
|
6043
6067
|
|
|
6044
6068
|
// src/components/TreeView.tsx
|
|
6045
|
-
import
|
|
6046
|
-
forwardRef as
|
|
6069
|
+
import React44, {
|
|
6070
|
+
forwardRef as forwardRef16,
|
|
6047
6071
|
memo as memo28,
|
|
6048
6072
|
useCallback as useCallback25,
|
|
6049
6073
|
useContext as useContext12
|
|
6050
6074
|
} from "react";
|
|
6051
|
-
var TreeRow =
|
|
6075
|
+
var TreeRow = forwardRef16(function TreeRow2({
|
|
6052
6076
|
icon,
|
|
6053
6077
|
expanded,
|
|
6054
6078
|
onClickChevron,
|
|
@@ -6063,14 +6087,14 @@ var TreeRow = forwardRef15(function TreeRow2({
|
|
|
6063
6087
|
},
|
|
6064
6088
|
[onClickChevron]
|
|
6065
6089
|
);
|
|
6066
|
-
return /* @__PURE__ */
|
|
6090
|
+
return /* @__PURE__ */ React44.createElement(ListView.Row, { ref: forwardedRef, ...rest }, expandable && /* @__PURE__ */ React44.createElement(React44.Fragment, null, expanded === void 0 ? /* @__PURE__ */ React44.createElement(Spacer.Horizontal, { size: 19 }) : /* @__PURE__ */ React44.createElement(
|
|
6067
6091
|
IconButton,
|
|
6068
6092
|
{
|
|
6069
6093
|
iconName: expanded ? "ChevronDownIcon" : "ChevronRightIcon",
|
|
6070
6094
|
onClick: handleClickChevron,
|
|
6071
6095
|
selected: rest.selected
|
|
6072
6096
|
}
|
|
6073
|
-
), /* @__PURE__ */
|
|
6097
|
+
), /* @__PURE__ */ React44.createElement(Spacer.Horizontal, { size: 6 })), icon && /* @__PURE__ */ React44.createElement(React44.Fragment, null, icon, /* @__PURE__ */ React44.createElement(Spacer.Horizontal, { size: 10 })), children);
|
|
6074
6098
|
});
|
|
6075
6099
|
var TreeView;
|
|
6076
6100
|
((TreeView2) => {
|
|
@@ -6118,7 +6142,8 @@ var colors2 = produce(colors, (colors3) => {
|
|
|
6118
6142
|
colors3.canvas.background = "rgb(20,19,23)";
|
|
6119
6143
|
colors3.canvas.sliceOutline = "rgb(150,150,150)";
|
|
6120
6144
|
colors3.canvas.grid = "rgba(0,0,0,0.1)";
|
|
6121
|
-
colors3.sidebar.background = "
|
|
6145
|
+
colors3.sidebar.background = "rgb(34,33,39)";
|
|
6146
|
+
colors3.sidebar.backgroundTransparent = "rgba(34,33,39,0.95)";
|
|
6122
6147
|
colors3.popover.background = "rgba(34,33,39,1)";
|
|
6123
6148
|
colors3.popover.divider = colors3.divider;
|
|
6124
6149
|
colors3.listView.raisedBackground = "rgba(181,178,255,0.1)";
|
|
@@ -6171,7 +6196,7 @@ var SUPPORTED_CANVAS_UPLOAD_TYPES = [
|
|
|
6171
6196
|
|
|
6172
6197
|
// src/components/ArrayController.tsx
|
|
6173
6198
|
import { range as range2 } from "@noya-app/noya-utils";
|
|
6174
|
-
import
|
|
6199
|
+
import React46, { memo as memo30, useCallback as useCallback26, useMemo as useMemo24 } from "react";
|
|
6175
6200
|
import styled34, { useTheme as useTheme5 } from "styled-components";
|
|
6176
6201
|
|
|
6177
6202
|
// src/components/InspectorPrimitives.tsx
|
|
@@ -6190,25 +6215,25 @@ __export(InspectorPrimitives_exports, {
|
|
|
6190
6215
|
Title: () => Title3,
|
|
6191
6216
|
VerticalSeparator: () => VerticalSeparator
|
|
6192
6217
|
});
|
|
6193
|
-
import
|
|
6218
|
+
import React45, { memo as memo29 } from "react";
|
|
6194
6219
|
import styled33, { useTheme as useTheme4 } from "styled-components";
|
|
6195
|
-
var Section = styled33.div(({ theme, padding = "10px", gap }) => ({
|
|
6220
|
+
var Section = styled33.div(({ theme, $padding = "10px", $gap }) => ({
|
|
6196
6221
|
flex: "0 0 auto",
|
|
6197
6222
|
display: "flex",
|
|
6198
6223
|
flexDirection: "column",
|
|
6199
|
-
padding,
|
|
6200
|
-
gap
|
|
6224
|
+
padding: $padding,
|
|
6225
|
+
gap: $gap
|
|
6201
6226
|
}));
|
|
6202
6227
|
var SectionHeader = styled33.div(({ theme }) => ({
|
|
6203
6228
|
display: "flex",
|
|
6204
6229
|
alignItems: "center"
|
|
6205
6230
|
}));
|
|
6206
|
-
var Title3 = styled33.div(({ theme, textStyle }) => ({
|
|
6231
|
+
var Title3 = styled33.div(({ theme, $textStyle }) => ({
|
|
6207
6232
|
display: "flex",
|
|
6208
6233
|
flexDirection: "row",
|
|
6209
6234
|
userSelect: "none",
|
|
6210
|
-
|
|
6211
|
-
...theme.textStyles[textStyle],
|
|
6235
|
+
...$textStyle ? {
|
|
6236
|
+
...theme.textStyles[$textStyle],
|
|
6212
6237
|
color: theme.colors.text
|
|
6213
6238
|
} : {
|
|
6214
6239
|
...theme.textStyles.label,
|
|
@@ -6217,12 +6242,12 @@ var Title3 = styled33.div(({ theme, textStyle }) => ({
|
|
|
6217
6242
|
}
|
|
6218
6243
|
}));
|
|
6219
6244
|
var Row2 = styled33.div(
|
|
6220
|
-
({ theme, gap }) => ({
|
|
6245
|
+
({ theme, $gap }) => ({
|
|
6221
6246
|
flex: "1",
|
|
6222
6247
|
display: "flex",
|
|
6223
6248
|
flexDirection: "row",
|
|
6224
6249
|
alignItems: "center",
|
|
6225
|
-
gap
|
|
6250
|
+
gap: $gap
|
|
6226
6251
|
})
|
|
6227
6252
|
);
|
|
6228
6253
|
var Column = styled33.div(({ theme }) => ({
|
|
@@ -6237,18 +6262,18 @@ var Checkbox = styled33.input(({ theme }) => ({
|
|
|
6237
6262
|
var Text3 = styled33.span(({ theme }) => ({
|
|
6238
6263
|
...theme.textStyles.small
|
|
6239
6264
|
}));
|
|
6240
|
-
var VerticalSeparator = () => /* @__PURE__ */
|
|
6241
|
-
var HorizontalSeparator = () => /* @__PURE__ */
|
|
6265
|
+
var VerticalSeparator = () => /* @__PURE__ */ React45.createElement(Spacer.Vertical, { size: useTheme4().sizes.inspector.verticalSeparator });
|
|
6266
|
+
var HorizontalSeparator = () => /* @__PURE__ */ React45.createElement(Spacer.Horizontal, { size: useTheme4().sizes.inspector.horizontalSeparator });
|
|
6242
6267
|
var SliderRowLabel = styled33.span(({ theme }) => ({
|
|
6243
6268
|
...theme.textStyles.small,
|
|
6244
6269
|
color: theme.colors.textMuted,
|
|
6245
6270
|
marginBottom: "-6px"
|
|
6246
6271
|
}));
|
|
6247
|
-
var RowLabel = styled33.span(({ theme, textStyle }) => ({
|
|
6272
|
+
var RowLabel = styled33.span(({ theme, $textStyle }) => ({
|
|
6248
6273
|
// marginBottom: '6px',
|
|
6249
6274
|
display: "flex",
|
|
6250
|
-
|
|
6251
|
-
...theme.textStyles[textStyle]
|
|
6275
|
+
...$textStyle ? {
|
|
6276
|
+
...theme.textStyles[$textStyle]
|
|
6252
6277
|
} : {
|
|
6253
6278
|
...theme.textStyles.label,
|
|
6254
6279
|
color: theme.colors.textSubtle,
|
|
@@ -6266,13 +6291,13 @@ var LabeledRow = memo29(function LabeledRow2({
|
|
|
6266
6291
|
gap,
|
|
6267
6292
|
right
|
|
6268
6293
|
}) {
|
|
6269
|
-
return /* @__PURE__ */
|
|
6294
|
+
return /* @__PURE__ */ React45.createElement(Row2, { id }, /* @__PURE__ */ React45.createElement(Column, null, /* @__PURE__ */ React45.createElement(RowLabel, { $textStyle: labelTextStyle }, label, right && /* @__PURE__ */ React45.createElement(Spacer.Horizontal, null), right), /* @__PURE__ */ React45.createElement(Row2, { $gap: gap }, children)));
|
|
6270
6295
|
});
|
|
6271
6296
|
var LabeledSliderRow = memo29(function LabeledRow3({
|
|
6272
6297
|
children,
|
|
6273
6298
|
label
|
|
6274
6299
|
}) {
|
|
6275
|
-
return /* @__PURE__ */
|
|
6300
|
+
return /* @__PURE__ */ React45.createElement(Row2, null, /* @__PURE__ */ React45.createElement(Column, null, /* @__PURE__ */ React45.createElement(SliderRowLabel, null, label), /* @__PURE__ */ React45.createElement(Row2, null, children)));
|
|
6276
6301
|
});
|
|
6277
6302
|
|
|
6278
6303
|
// src/components/ArrayController.tsx
|
|
@@ -6325,11 +6350,11 @@ var ArrayController = memo30(function ArrayController2({
|
|
|
6325
6350
|
[onMoveItem, reversed]
|
|
6326
6351
|
);
|
|
6327
6352
|
const renderRow = (index) => {
|
|
6328
|
-
return /* @__PURE__ */
|
|
6353
|
+
return /* @__PURE__ */ React46.createElement(ElementRow, { key: keys[index] }, renderItem({ item: items[index], index }));
|
|
6329
6354
|
};
|
|
6330
|
-
return /* @__PURE__ */
|
|
6355
|
+
return /* @__PURE__ */ React46.createElement(Section, { id, $padding: padding, $gap: "2px" }, /* @__PURE__ */ React46.createElement(SectionHeader, null, /* @__PURE__ */ React46.createElement(Button, { variant: "none", onClick: onClickPlus }, /* @__PURE__ */ React46.createElement(Title3, null, title)), /* @__PURE__ */ React46.createElement(Spacer.Horizontal, null), withSeparatorElements(
|
|
6331
6356
|
[
|
|
6332
|
-
onClickTrash && /* @__PURE__ */
|
|
6357
|
+
onClickTrash && /* @__PURE__ */ React46.createElement(
|
|
6333
6358
|
IconButton,
|
|
6334
6359
|
{
|
|
6335
6360
|
id: `${id}-trash`,
|
|
@@ -6338,7 +6363,7 @@ var ArrayController = memo30(function ArrayController2({
|
|
|
6338
6363
|
onClick: onClickTrash
|
|
6339
6364
|
}
|
|
6340
6365
|
),
|
|
6341
|
-
onClickExpand && /* @__PURE__ */
|
|
6366
|
+
onClickExpand && /* @__PURE__ */ React46.createElement(
|
|
6342
6367
|
IconButton,
|
|
6343
6368
|
{
|
|
6344
6369
|
id: `${id}-gear`,
|
|
@@ -6347,7 +6372,7 @@ var ArrayController = memo30(function ArrayController2({
|
|
|
6347
6372
|
onClick: onClickExpand
|
|
6348
6373
|
}
|
|
6349
6374
|
),
|
|
6350
|
-
onClickPlus && /* @__PURE__ */
|
|
6375
|
+
onClickPlus && /* @__PURE__ */ React46.createElement(
|
|
6351
6376
|
IconButton,
|
|
6352
6377
|
{
|
|
6353
6378
|
id: `${id}-add`,
|
|
@@ -6357,21 +6382,21 @@ var ArrayController = memo30(function ArrayController2({
|
|
|
6357
6382
|
}
|
|
6358
6383
|
)
|
|
6359
6384
|
],
|
|
6360
|
-
/* @__PURE__ */
|
|
6361
|
-
)), /* @__PURE__ */
|
|
6385
|
+
/* @__PURE__ */ React46.createElement(Spacer.Horizontal, { size: 8 })
|
|
6386
|
+
)), /* @__PURE__ */ React46.createElement(Stack.V, { gap: "4px" }, sortable ? /* @__PURE__ */ React46.createElement(
|
|
6362
6387
|
Sortable.Root,
|
|
6363
6388
|
{
|
|
6364
6389
|
keys,
|
|
6365
6390
|
renderOverlay: renderRow,
|
|
6366
6391
|
onMoveItem: handleMoveItem
|
|
6367
6392
|
},
|
|
6368
|
-
indexes.map((index) => /* @__PURE__ */
|
|
6393
|
+
indexes.map((index) => /* @__PURE__ */ React46.createElement(Sortable.Item, { id: keys[index], key: keys[index] }, ({ relativeDropPosition, ...sortableProps }) => /* @__PURE__ */ React46.createElement(ItemContainer2, { ...sortableProps }, renderRow(index), relativeDropPosition && /* @__PURE__ */ React46.createElement(
|
|
6369
6394
|
ListView.DragIndicator,
|
|
6370
6395
|
{
|
|
6371
|
-
gap: 0,
|
|
6372
|
-
colorScheme: "primary",
|
|
6373
|
-
relativeDropPosition,
|
|
6374
|
-
offsetLeft: 0
|
|
6396
|
+
$gap: 0,
|
|
6397
|
+
$colorScheme: "primary",
|
|
6398
|
+
$relativeDropPosition: relativeDropPosition,
|
|
6399
|
+
$offsetLeft: 0
|
|
6375
6400
|
}
|
|
6376
6401
|
))))
|
|
6377
6402
|
) : indexes.map(renderRow)), expanded && renderExpandedContent?.());
|
|
@@ -6379,7 +6404,7 @@ var ArrayController = memo30(function ArrayController2({
|
|
|
6379
6404
|
|
|
6380
6405
|
// src/components/DimensionInput.tsx
|
|
6381
6406
|
import { round } from "@noya-app/noya-utils";
|
|
6382
|
-
import
|
|
6407
|
+
import React47, { memo as memo31, useCallback as useCallback27 } from "react";
|
|
6383
6408
|
function getNewValue(value, mode, delta) {
|
|
6384
6409
|
return delta === void 0 ? value : mode === "replace" ? delta : value + delta;
|
|
6385
6410
|
}
|
|
@@ -6401,7 +6426,7 @@ var DimensionInput = memo31(function DimensionInput2({
|
|
|
6401
6426
|
(value2) => onSetValue(value2, "replace"),
|
|
6402
6427
|
[onSetValue]
|
|
6403
6428
|
);
|
|
6404
|
-
return /* @__PURE__ */
|
|
6429
|
+
return /* @__PURE__ */ React47.createElement(InputField.Root, { id, width: size2 }, /* @__PURE__ */ React47.createElement(
|
|
6405
6430
|
InputField.NumberInput,
|
|
6406
6431
|
{
|
|
6407
6432
|
value: value === void 0 ? value : round(value, 2),
|
|
@@ -6410,7 +6435,7 @@ var DimensionInput = memo31(function DimensionInput2({
|
|
|
6410
6435
|
disabled,
|
|
6411
6436
|
...trigger === "change" ? { onChange: handleSetValue } : { onSubmit: handleSetValue }
|
|
6412
6437
|
}
|
|
6413
|
-
), label && /* @__PURE__ */
|
|
6438
|
+
), label && /* @__PURE__ */ React47.createElement(InputField.Label, null, label));
|
|
6414
6439
|
});
|
|
6415
6440
|
export {
|
|
6416
6441
|
ActivityIndicator,
|