@noya-app/noya-designsystem 0.1.21 → 0.1.23

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.
@@ -5,13 +5,13 @@
5
5
  CLI Target: esnext
6
6
  CJS Build start
7
7
  ESM Build start
8
- ESM dist/index.mjs 209.89 KB
9
- ESM dist/index.mjs.map 459.25 KB
10
- ESM ⚡️ Build success in 295ms
11
- CJS dist/index.js 227.68 KB
12
- CJS dist/index.js.map 459.13 KB
13
- CJS ⚡️ Build success in 296ms
8
+ CJS dist/index.js 231.87 KB
9
+ CJS dist/index.js.map 466.94 KB
10
+ CJS ⚡️ Build success in 168ms
11
+ ESM dist/index.mjs 213.59 KB
12
+ ESM dist/index.mjs.map 467.05 KB
13
+ ESM ⚡️ Build success in 170ms
14
14
  DTS Build start
15
- DTS ⚡️ Build success in 12004ms
16
- DTS dist/index.d.ts 60.59 KB
17
- DTS dist/index.d.mts 60.59 KB
15
+ DTS ⚡️ Build success in 10431ms
16
+ DTS dist/index.d.ts 61.61 KB
17
+ DTS dist/index.d.mts 61.61 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # @noya-app/noya-designsystem
2
2
 
3
+ ## 0.1.23
4
+
5
+ ### Patch Changes
6
+
7
+ - 61cb70a: Add tree editor
8
+
9
+ ## 0.1.22
10
+
11
+ ### Patch Changes
12
+
13
+ - f3e588d: Improve json editing
14
+ - b104428: Package improvements, mainly around json
15
+ - Updated dependencies [b104428]
16
+ - @noya-app/noya-utils@0.1.2
17
+ - @noya-app/noya-colorpicker@0.1.10
18
+ - @noya-app/noya-geometry@0.1.4
19
+
3
20
  ## 0.1.21
4
21
 
5
22
  ### Patch Changes
package/dist/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as React$1 from 'react';
2
- import React__default, { CSSProperties, ReactNode, ReactElement, ComponentProps, AriaRole, KeyboardEventHandler, MouseEventHandler, PointerEventHandler, FocusEventHandler, InputHTMLAttributes, Ref, ReactHTML } from 'react';
2
+ import React__default, { CSSProperties, ReactNode, ComponentProps, AriaRole, KeyboardEventHandler, MouseEventHandler, PointerEventHandler, FocusEventHandler, InputHTMLAttributes, Ref, ReactHTML } from 'react';
3
3
  import * as styled_components_dist_types from 'styled-components/dist/types';
4
4
  import * as styled_components from 'styled-components';
5
5
  import { CSSObject, CSSProperties as CSSProperties$1 } from 'styled-components';
@@ -18,13 +18,13 @@ import { useSortable } from '@dnd-kit/sortable';
18
18
  import * as PopoverPrimitive from '@radix-ui/react-popover';
19
19
  import { RgbaColor } from '@noya-app/noya-colorpicker';
20
20
 
21
- interface Props$i {
21
+ interface Props$j {
22
22
  size?: number;
23
23
  opacity?: number;
24
24
  color?: string;
25
25
  trackColor?: string;
26
26
  }
27
- declare const ActivityIndicator: (props: Props$i) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
27
+ declare const ActivityIndicator: (props: Props$j) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
28
28
 
29
29
  declare const Avatar: (props: {
30
30
  image?: string | undefined;
@@ -76,10 +76,13 @@ type ChipColorScheme = "primary" | "secondary" | "error";
76
76
  type ChipSize = "small" | "medium";
77
77
  type ChipVariant = "solid" | "outlined" | "ghost";
78
78
  interface ChipProps {
79
+ id?: string;
80
+ className?: string;
79
81
  colorScheme?: ChipColorScheme;
80
82
  variant?: ChipVariant;
81
83
  size?: ChipSize;
82
84
  children?: React__default.ReactNode;
85
+ clickable?: boolean;
83
86
  deletable?: boolean;
84
87
  addable?: boolean;
85
88
  monospace?: boolean;
@@ -90,7 +93,7 @@ interface ChipProps {
90
93
  style?: React__default.CSSProperties;
91
94
  tabIndex?: number;
92
95
  }
93
- declare const Chip: (props: ChipProps) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
96
+ declare const Chip: (props: ChipProps & React__default.RefAttributes<HTMLSpanElement>) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
94
97
 
95
98
  declare const name$1: string;
96
99
  declare const colors$1: {
@@ -234,7 +237,7 @@ type RegularMenuItem<T extends string> = {
234
237
  shortcut?: string;
235
238
  checked?: boolean;
236
239
  disabled?: boolean;
237
- icon?: ReactElement;
240
+ icon?: ReactNode;
238
241
  items?: MenuItem<T>[];
239
242
  role?: MenuItemRole;
240
243
  };
@@ -252,7 +255,7 @@ interface MenuItemProps<T extends string> {
252
255
  disabled: boolean;
253
256
  indented: boolean;
254
257
  shortcut?: string;
255
- icon?: ReactElement;
258
+ icon?: ReactNode;
256
259
  items?: MenuItem<T>[];
257
260
  }
258
261
  interface MenuProps<T extends string> {
@@ -270,7 +273,7 @@ declare const CloseButtonContainer: styled_components_dist_types.IStyledComponen
270
273
  interface IDialog {
271
274
  containsElement: (element: HTMLElement) => boolean;
272
275
  }
273
- interface Props$h {
276
+ interface Props$i {
274
277
  title?: ReactNode;
275
278
  description?: ReactNode;
276
279
  children?: ReactNode;
@@ -280,8 +283,8 @@ interface Props$h {
280
283
  onOpenAutoFocus?: ComponentProps<typeof DialogPrimitive.Content>["onOpenAutoFocus"];
281
284
  closeOnInteractOutside?: boolean;
282
285
  }
283
- declare const Dialog: (props: Props$h & React__default.RefAttributes<IDialog>) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
284
- declare const FullscreenDialog: (props: Props$h & React__default.RefAttributes<IDialog>) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
286
+ declare const Dialog: (props: Props$i & React__default.RefAttributes<IDialog>) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
287
+ declare const FullscreenDialog: (props: Props$i & React__default.RefAttributes<IDialog>) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
285
288
 
286
289
  type DividerVariant = "normal" | "strong" | "subtle";
287
290
  interface DividerProps {
@@ -316,22 +319,22 @@ type SketchPattern = {
316
319
  patternTileScale: number;
317
320
  };
318
321
 
319
- interface Props$g {
322
+ interface Props$h {
320
323
  id?: string;
321
324
  value?: Sketch.Color | Sketch.Gradient | SketchPattern;
322
325
  flex?: CSSProperties["flex"];
323
326
  }
324
- declare const FillInputField: (props: Props$g & React__default.RefAttributes<HTMLButtonElement>) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
327
+ declare const FillInputField: (props: Props$h & React__default.RefAttributes<HTMLButtonElement>) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
325
328
 
326
329
  declare const PatternPreviewBackground: (props: {
327
330
  fillType: Sketch.PatternFillType;
328
331
  tileScale: number;
329
332
  imageRef: string;
330
333
  }) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
331
- interface Props$f {
334
+ interface Props$g {
332
335
  value?: Sketch.Color | Sketch.Gradient | SketchPattern;
333
336
  }
334
- declare const FillPreviewBackground: (props: Props$f) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
337
+ declare const FillPreviewBackground: (props: Props$g) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
335
338
 
336
339
  interface FloatingWindowProps {
337
340
  title?: string;
@@ -352,7 +355,7 @@ interface FloatingWindowProps {
352
355
  }
353
356
  declare const FloatingWindow: React__default.FC<FloatingWindowProps>;
354
357
 
355
- interface Props$e {
358
+ interface Props$f {
356
359
  value: Sketch.GradientStop[];
357
360
  selectedStop: number;
358
361
  onChangeColor: (color: Sketch.Color) => void;
@@ -361,7 +364,7 @@ interface Props$e {
361
364
  onDelete: () => void;
362
365
  onSelectStop: (index: number) => void;
363
366
  }
364
- declare const GradientPicker: (props: Props$e) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
367
+ declare const GradientPicker: (props: Props$f) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
365
368
 
366
369
  type GridProps = {
367
370
  columns?: string;
@@ -437,7 +440,7 @@ declare const IconButton: (props: Omit<ButtonRootProps, "children" | "size" | "f
437
440
  size?: number | undefined;
438
441
  } & React__default.RefAttributes<HTMLButtonElement>) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
439
442
 
440
- type Props$d = {
443
+ type Props$e = {
441
444
  id?: string;
442
445
  style?: any;
443
446
  className?: string;
@@ -455,13 +458,13 @@ type Props$d = {
455
458
  onFocusChange?: (isFocused: boolean) => void;
456
459
  onBlur?: FocusEventHandler;
457
460
  } & Pick<InputHTMLAttributes<HTMLInputElement>, "autoComplete" | "autoCapitalize" | "autoCorrect" | "spellCheck" | "autoFocus">;
458
- type ReadOnlyProps = Props$d & {
461
+ type ReadOnlyProps = Props$e & {
459
462
  readOnly: true;
460
463
  };
461
- type ControlledProps = Props$d & {
464
+ type ControlledProps = Props$e & {
462
465
  onChange: (value: string) => void;
463
466
  };
464
- type SubmittableProps = Props$d & {
467
+ type SubmittableProps = Props$e & {
465
468
  onSubmit: (value: string) => void;
466
469
  allowSubmittingWithSameValue?: boolean;
467
470
  submitAutomaticallyAfterDelay?: number;
@@ -515,6 +518,8 @@ interface InputFieldRootProps {
515
518
  width: number;
516
519
  }) => ReactNode;
517
520
  onFocusChange?: (isFocused: boolean) => void;
521
+ style?: React__default.CSSProperties;
522
+ className?: string;
518
523
  }
519
524
  declare namespace InputField {
520
525
  const Root: (props: InputFieldRootProps) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
@@ -653,6 +658,11 @@ interface ListViewRowProps<MenuItemType extends string = string> {
653
658
  onMenuOpenChange?: (isOpen: boolean) => void;
654
659
  onKeyDown?: (event: React__default.KeyboardEvent) => void;
655
660
  style?: CSSProperties;
661
+ dragIndicatorStyle?: CSSProperties | ((props: {
662
+ depth: number;
663
+ indentation: number;
664
+ position: RelativeDropPosition;
665
+ }) => CSSProperties);
656
666
  }
657
667
  interface IVirtualizedList {
658
668
  scrollToIndex(index: number): void;
@@ -678,6 +688,9 @@ type RenderProps<T> = {
678
688
  type ListViewVariant = "normal" | "padded" | "bare";
679
689
  type ListViewSectionHeaderVariant = "normal" | "label";
680
690
  type ListViewRootProps = {
691
+ id?: string;
692
+ className?: string;
693
+ style?: CSSProperties;
681
694
  onPress?: () => void;
682
695
  scrollable?: boolean;
683
696
  expandable?: boolean;
@@ -724,7 +737,7 @@ interface CompletionMenuProps {
724
737
  listSize: Size;
725
738
  }
726
739
  declare const CompletionMenu: (props: CompletionMenuProps & React__default.RefAttributes<IVirtualizedList>) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
727
- type Props$c = {
740
+ type Props$d = {
728
741
  loading?: boolean;
729
742
  initialValue?: string;
730
743
  placeholder?: string;
@@ -747,7 +760,7 @@ interface IInputFieldWithCompletions {
747
760
  setValue(value: string): void;
748
761
  selectAllInputText(): void;
749
762
  }
750
- declare const InputFieldWithCompletions: (props: Props$c & React__default.RefAttributes<IInputFieldWithCompletions>) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
763
+ declare const InputFieldWithCompletions: (props: Props$d & React__default.RefAttributes<IInputFieldWithCompletions>) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
751
764
 
752
765
  declare const InspectorContainer: (props: {
753
766
  header?: React__default.ReactNode;
@@ -780,7 +793,7 @@ interface ContainerProps {
780
793
  declare const LabeledElementView: (props: ContainerProps) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
781
794
 
782
795
  type PopoverVariant = "normal" | "large";
783
- interface Props$b extends Pick<ComponentProps<(typeof PopoverPrimitive)["Content"]>, "onOpenAutoFocus" | "onCloseAutoFocus" | "onPointerDownOutside" | "onInteractOutside" | "onFocusOutside" | "side"> {
796
+ interface Props$c extends Pick<ComponentProps<(typeof PopoverPrimitive)["Content"]>, "onOpenAutoFocus" | "onCloseAutoFocus" | "onPointerDownOutside" | "onInteractOutside" | "onFocusOutside" | "side"> {
784
797
  children: React__default.ReactNode;
785
798
  trigger: React__default.ReactNode;
786
799
  variant?: PopoverVariant;
@@ -791,7 +804,7 @@ interface Props$b extends Pick<ComponentProps<(typeof PopoverPrimitive)["Content
791
804
  onClickClose?: () => void;
792
805
  showArrow?: boolean;
793
806
  }
794
- declare function Popover({ children, trigger, variant, closable, open, side, sideOffset, showArrow, onOpenChange, onOpenAutoFocus, onCloseAutoFocus, onPointerDownOutside, onInteractOutside, onFocusOutside, onClickClose, }: Props$b): React__default.JSX.Element;
807
+ declare function Popover({ children, trigger, variant, closable, open, side, sideOffset, showArrow, onOpenChange, onOpenAutoFocus, onCloseAutoFocus, onPointerDownOutside, onInteractOutside, onFocusOutside, onClickClose, }: Props$c): React__default.JSX.Element;
795
808
 
796
809
  type ProgressVariant = 'normal' | 'warning' | 'primary' | 'secondary';
797
810
  declare function Progress({ value, width, height, flex, variant, }: {
@@ -809,7 +822,7 @@ interface ItemProps {
809
822
  children: ReactNode;
810
823
  disabled?: boolean;
811
824
  }
812
- interface Props$a {
825
+ interface Props$b {
813
826
  id?: string;
814
827
  value?: string;
815
828
  onValueChange?: (value: string) => void;
@@ -818,14 +831,14 @@ interface Props$a {
818
831
  children: ReactNode;
819
832
  }
820
833
  declare namespace RadioGroup {
821
- const Root: (props: Props$a) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
834
+ const Root: (props: Props$b) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
822
835
  const Item: (props: ItemProps & React__default.RefAttributes<HTMLButtonElement>) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
823
836
  }
824
837
 
825
- interface Props$9 {
838
+ interface Props$a {
826
839
  children?: ReactNode | ((scrollElementRef: HTMLDivElement) => ReactNode);
827
840
  }
828
- declare const ScrollArea: (props: Props$9) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
841
+ declare const ScrollArea: (props: Props$a) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
829
842
 
830
843
  interface SelectOptionProps<T extends string> {
831
844
  value: T;
@@ -840,13 +853,24 @@ type ChildrenProps<T> = {
840
853
  getTitle?: (option: T, index: number) => string;
841
854
  onChange: (value: T) => void;
842
855
  };
843
- type Props$8<T extends string> = ChildrenProps<T> & {
856
+ type Props$9<T extends string> = ChildrenProps<T> & {
844
857
  id: string;
845
858
  flex?: CSSProperties["flex"];
846
859
  value: T;
847
- label?: string;
860
+ label?: ReactNode;
848
861
  };
849
- declare const Select: <T extends string>(props: Props$8<T>) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
862
+ declare const Select: <T extends string>(props: Props$9<T>) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
863
+
864
+ type Props$8<T extends string> = {
865
+ id?: string;
866
+ style?: React__default.CSSProperties;
867
+ className?: string;
868
+ menuItems: MenuItem<T>[];
869
+ value: T;
870
+ onSelect?: (value: T) => void;
871
+ placeholder?: string;
872
+ };
873
+ declare const SelectMenu: <T extends string = string>(props: Props$8<T>) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
850
874
 
851
875
  interface Props$7 {
852
876
  id?: string;
@@ -993,6 +1017,8 @@ interface Props$3 extends StyleProps {
993
1017
  children: ReactNode;
994
1018
  onClick?: () => void;
995
1019
  onDoubleClick?: () => void;
1020
+ onKeyDown?: (event: React__default.KeyboardEvent<HTMLSpanElement>) => void;
1021
+ tabIndex?: number;
996
1022
  }
997
1023
  declare const Text$1: (props: Props$3 & React__default.RefAttributes<HTMLElement>) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
998
1024
  type PresetProps = Omit<Props$3, "variant">;
@@ -1042,6 +1068,9 @@ declare namespace TreeView {
1042
1068
  sortable?: boolean | undefined;
1043
1069
  virtualized?: _noya_app_noya_geometry.Size | undefined;
1044
1070
  }) & {
1071
+ id?: string | undefined;
1072
+ className?: string | undefined;
1073
+ style?: React__default.CSSProperties | undefined;
1045
1074
  onPress?: (() => void) | undefined;
1046
1075
  scrollable?: boolean | undefined;
1047
1076
  expandable?: boolean | undefined;
@@ -1399,4 +1428,4 @@ declare module "react" {
1399
1428
  function forwardRef<T, P = {}>(render: (props: P, ref: React.ForwardedRef<T>) => React.ReactElement | null): (props: P & React.RefAttributes<T>) => React.ReactElement | null;
1400
1429
  }
1401
1430
 
1402
- export { ActivityIndicator, ArrayController, type ArrayControllerProps, Avatar, AvatarStack, Body, Button, ButtonElement, type ButtonRootProps, Chip, type ChipProps, CloseButtonContainer, type Colors, type CompletionItem, type CompletionListItem, CompletionMenu, type CompletionSectionHeader, CompletionToken, ContextMenu, type DesignSystemConfigurationContextValue, DesignSystemConfigurationProvider, DesignSystemThemeProvider, Dialog, type DialogContextValue, DialogProvider, DimensionInput, type DimensionValue, Divider, DividerVertical, DraggableMenuButton, type DropValidator, DropdownMenu, type EditableRowProps, type ExtractMenuItemType, FillInputField, FillPreviewBackground, FloatingWindow, FloatingWindowProvider, FullscreenDialog, type GlobalInputBlurContextValue, GlobalInputBlurProvider, GradientPicker, type GridProps, GridView, type GridViewSize, Heading1, Heading2, Heading3, Heading4, Heading5, type HoverEvent, type HoverEvents, type HoverProps, type IDialog, type IInputFieldWithCompletions, type IScoredItem, type IToken, type IVirtualizedList, type IWorkspaceLayout, IconButton, type ImageDataContextValue, ImageDataProvider, InputElement, InputField, type InputFieldSize, InputFieldWithCompletions, InspectorContainer, InspectorPrimitives, Italic, KeyboardShortcut, Label, LabeledElementView, type ListRowMarginType, type ListRowPosition, ListView, type MatchRange, type MenuConfig, type MenuItem, type MenuItemProps, type MenuProps, type Optional, PatternPreviewBackground, Popover, Progress, RadioGroup, type RegularMenuItem, type RelativeDropPosition, Row$1 as Row, SEPARATOR_ITEM, SUPPORTED_CANVAS_UPLOAD_TYPES, SUPPORTED_IMAGE_UPLOAD_TYPES, ScrollArea, Select, SelectOption, type SetNumberMode, type SketchPattern, Slider, Small, Sortable, Spacer, Stack, type StackBreakpointList, type SupportedCanvasUploadType, type SupportedImageUploadType, Switch, Text$1 as Text, type TextBreakpointList, type Theme, type ThemeColorName, Toast, ToastProvider, Tooltip, TreeView, WorkspaceLayout, createSectionedMenu, dark as darkTheme, fuzzyFilter, fuzzyScore, fuzzyTokenize, getGradientBackground, getNewValue, lightTheme, mediaQuery, normalizeListDestinationIndex, rgbaToSketchColor, size, sketchColorToHex, sketchColorToRgba, sketchColorToRgbaString, useCurrentFloatingWindowInternal, useDesignSystemConfiguration, useDesignSystemTheme, useDialogContainsElement, useFloatingWindowManager, useGlobalInputBlur, useGlobalInputBlurListener, useGlobalInputBlurTrigger, useHover, useImageData, useOpenInputDialog, usePlatform, usePlatformModKey, withSeparatorElements };
1431
+ export { ActivityIndicator, ArrayController, type ArrayControllerProps, Avatar, AvatarStack, Body, Button, ButtonElement, type ButtonRootProps, Chip, type ChipProps, CloseButtonContainer, type Colors, type CompletionItem, type CompletionListItem, CompletionMenu, type CompletionSectionHeader, CompletionToken, ContextMenu, type DesignSystemConfigurationContextValue, DesignSystemConfigurationProvider, DesignSystemThemeProvider, Dialog, type DialogContextValue, DialogProvider, DimensionInput, type DimensionValue, Divider, DividerVertical, DraggableMenuButton, type DropValidator, DropdownMenu, type EditableRowProps, type ExtractMenuItemType, FillInputField, FillPreviewBackground, FloatingWindow, FloatingWindowProvider, FullscreenDialog, type GlobalInputBlurContextValue, GlobalInputBlurProvider, GradientPicker, type GridProps, GridView, type GridViewSize, Heading1, Heading2, Heading3, Heading4, Heading5, type HoverEvent, type HoverEvents, type HoverProps, type IDialog, type IInputFieldWithCompletions, type IScoredItem, type IToken, type IVirtualizedList, type IWorkspaceLayout, IconButton, type ImageDataContextValue, ImageDataProvider, InputElement, InputField, type InputFieldSize, InputFieldWithCompletions, InspectorContainer, InspectorPrimitives, Italic, KeyboardShortcut, Label, LabeledElementView, type ListRowMarginType, type ListRowPosition, ListView, type MatchRange, type MenuConfig, type MenuItem, type MenuItemProps, type MenuProps, type Optional, PatternPreviewBackground, Popover, Progress, RadioGroup, type RegularMenuItem, type RelativeDropPosition, Row$1 as Row, SEPARATOR_ITEM, SUPPORTED_CANVAS_UPLOAD_TYPES, SUPPORTED_IMAGE_UPLOAD_TYPES, ScrollArea, Select, SelectMenu, SelectOption, type SetNumberMode, type SketchPattern, Slider, Small, Sortable, Spacer, Stack, type StackBreakpointList, type SupportedCanvasUploadType, type SupportedImageUploadType, Switch, Text$1 as Text, type TextBreakpointList, type Theme, type ThemeColorName, Toast, ToastProvider, Tooltip, TreeView, WorkspaceLayout, createSectionedMenu, dark as darkTheme, fuzzyFilter, fuzzyScore, fuzzyTokenize, getGradientBackground, getNewValue, lightTheme, mediaQuery, normalizeListDestinationIndex, rgbaToSketchColor, size, sketchColorToHex, sketchColorToRgba, sketchColorToRgbaString, useCurrentFloatingWindowInternal, useDesignSystemConfiguration, useDesignSystemTheme, useDialogContainsElement, useFloatingWindowManager, useGlobalInputBlur, useGlobalInputBlurListener, useGlobalInputBlurTrigger, useHover, useImageData, useOpenInputDialog, usePlatform, usePlatformModKey, withSeparatorElements };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as React$1 from 'react';
2
- import React__default, { CSSProperties, ReactNode, ReactElement, ComponentProps, AriaRole, KeyboardEventHandler, MouseEventHandler, PointerEventHandler, FocusEventHandler, InputHTMLAttributes, Ref, ReactHTML } from 'react';
2
+ import React__default, { CSSProperties, ReactNode, ComponentProps, AriaRole, KeyboardEventHandler, MouseEventHandler, PointerEventHandler, FocusEventHandler, InputHTMLAttributes, Ref, ReactHTML } from 'react';
3
3
  import * as styled_components_dist_types from 'styled-components/dist/types';
4
4
  import * as styled_components from 'styled-components';
5
5
  import { CSSObject, CSSProperties as CSSProperties$1 } from 'styled-components';
@@ -18,13 +18,13 @@ import { useSortable } from '@dnd-kit/sortable';
18
18
  import * as PopoverPrimitive from '@radix-ui/react-popover';
19
19
  import { RgbaColor } from '@noya-app/noya-colorpicker';
20
20
 
21
- interface Props$i {
21
+ interface Props$j {
22
22
  size?: number;
23
23
  opacity?: number;
24
24
  color?: string;
25
25
  trackColor?: string;
26
26
  }
27
- declare const ActivityIndicator: (props: Props$i) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
27
+ declare const ActivityIndicator: (props: Props$j) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
28
28
 
29
29
  declare const Avatar: (props: {
30
30
  image?: string | undefined;
@@ -76,10 +76,13 @@ type ChipColorScheme = "primary" | "secondary" | "error";
76
76
  type ChipSize = "small" | "medium";
77
77
  type ChipVariant = "solid" | "outlined" | "ghost";
78
78
  interface ChipProps {
79
+ id?: string;
80
+ className?: string;
79
81
  colorScheme?: ChipColorScheme;
80
82
  variant?: ChipVariant;
81
83
  size?: ChipSize;
82
84
  children?: React__default.ReactNode;
85
+ clickable?: boolean;
83
86
  deletable?: boolean;
84
87
  addable?: boolean;
85
88
  monospace?: boolean;
@@ -90,7 +93,7 @@ interface ChipProps {
90
93
  style?: React__default.CSSProperties;
91
94
  tabIndex?: number;
92
95
  }
93
- declare const Chip: (props: ChipProps) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
96
+ declare const Chip: (props: ChipProps & React__default.RefAttributes<HTMLSpanElement>) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
94
97
 
95
98
  declare const name$1: string;
96
99
  declare const colors$1: {
@@ -234,7 +237,7 @@ type RegularMenuItem<T extends string> = {
234
237
  shortcut?: string;
235
238
  checked?: boolean;
236
239
  disabled?: boolean;
237
- icon?: ReactElement;
240
+ icon?: ReactNode;
238
241
  items?: MenuItem<T>[];
239
242
  role?: MenuItemRole;
240
243
  };
@@ -252,7 +255,7 @@ interface MenuItemProps<T extends string> {
252
255
  disabled: boolean;
253
256
  indented: boolean;
254
257
  shortcut?: string;
255
- icon?: ReactElement;
258
+ icon?: ReactNode;
256
259
  items?: MenuItem<T>[];
257
260
  }
258
261
  interface MenuProps<T extends string> {
@@ -270,7 +273,7 @@ declare const CloseButtonContainer: styled_components_dist_types.IStyledComponen
270
273
  interface IDialog {
271
274
  containsElement: (element: HTMLElement) => boolean;
272
275
  }
273
- interface Props$h {
276
+ interface Props$i {
274
277
  title?: ReactNode;
275
278
  description?: ReactNode;
276
279
  children?: ReactNode;
@@ -280,8 +283,8 @@ interface Props$h {
280
283
  onOpenAutoFocus?: ComponentProps<typeof DialogPrimitive.Content>["onOpenAutoFocus"];
281
284
  closeOnInteractOutside?: boolean;
282
285
  }
283
- declare const Dialog: (props: Props$h & React__default.RefAttributes<IDialog>) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
284
- declare const FullscreenDialog: (props: Props$h & React__default.RefAttributes<IDialog>) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
286
+ declare const Dialog: (props: Props$i & React__default.RefAttributes<IDialog>) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
287
+ declare const FullscreenDialog: (props: Props$i & React__default.RefAttributes<IDialog>) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
285
288
 
286
289
  type DividerVariant = "normal" | "strong" | "subtle";
287
290
  interface DividerProps {
@@ -316,22 +319,22 @@ type SketchPattern = {
316
319
  patternTileScale: number;
317
320
  };
318
321
 
319
- interface Props$g {
322
+ interface Props$h {
320
323
  id?: string;
321
324
  value?: Sketch.Color | Sketch.Gradient | SketchPattern;
322
325
  flex?: CSSProperties["flex"];
323
326
  }
324
- declare const FillInputField: (props: Props$g & React__default.RefAttributes<HTMLButtonElement>) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
327
+ declare const FillInputField: (props: Props$h & React__default.RefAttributes<HTMLButtonElement>) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
325
328
 
326
329
  declare const PatternPreviewBackground: (props: {
327
330
  fillType: Sketch.PatternFillType;
328
331
  tileScale: number;
329
332
  imageRef: string;
330
333
  }) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
331
- interface Props$f {
334
+ interface Props$g {
332
335
  value?: Sketch.Color | Sketch.Gradient | SketchPattern;
333
336
  }
334
- declare const FillPreviewBackground: (props: Props$f) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
337
+ declare const FillPreviewBackground: (props: Props$g) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
335
338
 
336
339
  interface FloatingWindowProps {
337
340
  title?: string;
@@ -352,7 +355,7 @@ interface FloatingWindowProps {
352
355
  }
353
356
  declare const FloatingWindow: React__default.FC<FloatingWindowProps>;
354
357
 
355
- interface Props$e {
358
+ interface Props$f {
356
359
  value: Sketch.GradientStop[];
357
360
  selectedStop: number;
358
361
  onChangeColor: (color: Sketch.Color) => void;
@@ -361,7 +364,7 @@ interface Props$e {
361
364
  onDelete: () => void;
362
365
  onSelectStop: (index: number) => void;
363
366
  }
364
- declare const GradientPicker: (props: Props$e) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
367
+ declare const GradientPicker: (props: Props$f) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
365
368
 
366
369
  type GridProps = {
367
370
  columns?: string;
@@ -437,7 +440,7 @@ declare const IconButton: (props: Omit<ButtonRootProps, "children" | "size" | "f
437
440
  size?: number | undefined;
438
441
  } & React__default.RefAttributes<HTMLButtonElement>) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
439
442
 
440
- type Props$d = {
443
+ type Props$e = {
441
444
  id?: string;
442
445
  style?: any;
443
446
  className?: string;
@@ -455,13 +458,13 @@ type Props$d = {
455
458
  onFocusChange?: (isFocused: boolean) => void;
456
459
  onBlur?: FocusEventHandler;
457
460
  } & Pick<InputHTMLAttributes<HTMLInputElement>, "autoComplete" | "autoCapitalize" | "autoCorrect" | "spellCheck" | "autoFocus">;
458
- type ReadOnlyProps = Props$d & {
461
+ type ReadOnlyProps = Props$e & {
459
462
  readOnly: true;
460
463
  };
461
- type ControlledProps = Props$d & {
464
+ type ControlledProps = Props$e & {
462
465
  onChange: (value: string) => void;
463
466
  };
464
- type SubmittableProps = Props$d & {
467
+ type SubmittableProps = Props$e & {
465
468
  onSubmit: (value: string) => void;
466
469
  allowSubmittingWithSameValue?: boolean;
467
470
  submitAutomaticallyAfterDelay?: number;
@@ -515,6 +518,8 @@ interface InputFieldRootProps {
515
518
  width: number;
516
519
  }) => ReactNode;
517
520
  onFocusChange?: (isFocused: boolean) => void;
521
+ style?: React__default.CSSProperties;
522
+ className?: string;
518
523
  }
519
524
  declare namespace InputField {
520
525
  const Root: (props: InputFieldRootProps) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
@@ -653,6 +658,11 @@ interface ListViewRowProps<MenuItemType extends string = string> {
653
658
  onMenuOpenChange?: (isOpen: boolean) => void;
654
659
  onKeyDown?: (event: React__default.KeyboardEvent) => void;
655
660
  style?: CSSProperties;
661
+ dragIndicatorStyle?: CSSProperties | ((props: {
662
+ depth: number;
663
+ indentation: number;
664
+ position: RelativeDropPosition;
665
+ }) => CSSProperties);
656
666
  }
657
667
  interface IVirtualizedList {
658
668
  scrollToIndex(index: number): void;
@@ -678,6 +688,9 @@ type RenderProps<T> = {
678
688
  type ListViewVariant = "normal" | "padded" | "bare";
679
689
  type ListViewSectionHeaderVariant = "normal" | "label";
680
690
  type ListViewRootProps = {
691
+ id?: string;
692
+ className?: string;
693
+ style?: CSSProperties;
681
694
  onPress?: () => void;
682
695
  scrollable?: boolean;
683
696
  expandable?: boolean;
@@ -724,7 +737,7 @@ interface CompletionMenuProps {
724
737
  listSize: Size;
725
738
  }
726
739
  declare const CompletionMenu: (props: CompletionMenuProps & React__default.RefAttributes<IVirtualizedList>) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
727
- type Props$c = {
740
+ type Props$d = {
728
741
  loading?: boolean;
729
742
  initialValue?: string;
730
743
  placeholder?: string;
@@ -747,7 +760,7 @@ interface IInputFieldWithCompletions {
747
760
  setValue(value: string): void;
748
761
  selectAllInputText(): void;
749
762
  }
750
- declare const InputFieldWithCompletions: (props: Props$c & React__default.RefAttributes<IInputFieldWithCompletions>) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
763
+ declare const InputFieldWithCompletions: (props: Props$d & React__default.RefAttributes<IInputFieldWithCompletions>) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
751
764
 
752
765
  declare const InspectorContainer: (props: {
753
766
  header?: React__default.ReactNode;
@@ -780,7 +793,7 @@ interface ContainerProps {
780
793
  declare const LabeledElementView: (props: ContainerProps) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
781
794
 
782
795
  type PopoverVariant = "normal" | "large";
783
- interface Props$b extends Pick<ComponentProps<(typeof PopoverPrimitive)["Content"]>, "onOpenAutoFocus" | "onCloseAutoFocus" | "onPointerDownOutside" | "onInteractOutside" | "onFocusOutside" | "side"> {
796
+ interface Props$c extends Pick<ComponentProps<(typeof PopoverPrimitive)["Content"]>, "onOpenAutoFocus" | "onCloseAutoFocus" | "onPointerDownOutside" | "onInteractOutside" | "onFocusOutside" | "side"> {
784
797
  children: React__default.ReactNode;
785
798
  trigger: React__default.ReactNode;
786
799
  variant?: PopoverVariant;
@@ -791,7 +804,7 @@ interface Props$b extends Pick<ComponentProps<(typeof PopoverPrimitive)["Content
791
804
  onClickClose?: () => void;
792
805
  showArrow?: boolean;
793
806
  }
794
- declare function Popover({ children, trigger, variant, closable, open, side, sideOffset, showArrow, onOpenChange, onOpenAutoFocus, onCloseAutoFocus, onPointerDownOutside, onInteractOutside, onFocusOutside, onClickClose, }: Props$b): React__default.JSX.Element;
807
+ declare function Popover({ children, trigger, variant, closable, open, side, sideOffset, showArrow, onOpenChange, onOpenAutoFocus, onCloseAutoFocus, onPointerDownOutside, onInteractOutside, onFocusOutside, onClickClose, }: Props$c): React__default.JSX.Element;
795
808
 
796
809
  type ProgressVariant = 'normal' | 'warning' | 'primary' | 'secondary';
797
810
  declare function Progress({ value, width, height, flex, variant, }: {
@@ -809,7 +822,7 @@ interface ItemProps {
809
822
  children: ReactNode;
810
823
  disabled?: boolean;
811
824
  }
812
- interface Props$a {
825
+ interface Props$b {
813
826
  id?: string;
814
827
  value?: string;
815
828
  onValueChange?: (value: string) => void;
@@ -818,14 +831,14 @@ interface Props$a {
818
831
  children: ReactNode;
819
832
  }
820
833
  declare namespace RadioGroup {
821
- const Root: (props: Props$a) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
834
+ const Root: (props: Props$b) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
822
835
  const Item: (props: ItemProps & React__default.RefAttributes<HTMLButtonElement>) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
823
836
  }
824
837
 
825
- interface Props$9 {
838
+ interface Props$a {
826
839
  children?: ReactNode | ((scrollElementRef: HTMLDivElement) => ReactNode);
827
840
  }
828
- declare const ScrollArea: (props: Props$9) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
841
+ declare const ScrollArea: (props: Props$a) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
829
842
 
830
843
  interface SelectOptionProps<T extends string> {
831
844
  value: T;
@@ -840,13 +853,24 @@ type ChildrenProps<T> = {
840
853
  getTitle?: (option: T, index: number) => string;
841
854
  onChange: (value: T) => void;
842
855
  };
843
- type Props$8<T extends string> = ChildrenProps<T> & {
856
+ type Props$9<T extends string> = ChildrenProps<T> & {
844
857
  id: string;
845
858
  flex?: CSSProperties["flex"];
846
859
  value: T;
847
- label?: string;
860
+ label?: ReactNode;
848
861
  };
849
- declare const Select: <T extends string>(props: Props$8<T>) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
862
+ declare const Select: <T extends string>(props: Props$9<T>) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
863
+
864
+ type Props$8<T extends string> = {
865
+ id?: string;
866
+ style?: React__default.CSSProperties;
867
+ className?: string;
868
+ menuItems: MenuItem<T>[];
869
+ value: T;
870
+ onSelect?: (value: T) => void;
871
+ placeholder?: string;
872
+ };
873
+ declare const SelectMenu: <T extends string = string>(props: Props$8<T>) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
850
874
 
851
875
  interface Props$7 {
852
876
  id?: string;
@@ -993,6 +1017,8 @@ interface Props$3 extends StyleProps {
993
1017
  children: ReactNode;
994
1018
  onClick?: () => void;
995
1019
  onDoubleClick?: () => void;
1020
+ onKeyDown?: (event: React__default.KeyboardEvent<HTMLSpanElement>) => void;
1021
+ tabIndex?: number;
996
1022
  }
997
1023
  declare const Text$1: (props: Props$3 & React__default.RefAttributes<HTMLElement>) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
998
1024
  type PresetProps = Omit<Props$3, "variant">;
@@ -1042,6 +1068,9 @@ declare namespace TreeView {
1042
1068
  sortable?: boolean | undefined;
1043
1069
  virtualized?: _noya_app_noya_geometry.Size | undefined;
1044
1070
  }) & {
1071
+ id?: string | undefined;
1072
+ className?: string | undefined;
1073
+ style?: React__default.CSSProperties | undefined;
1045
1074
  onPress?: (() => void) | undefined;
1046
1075
  scrollable?: boolean | undefined;
1047
1076
  expandable?: boolean | undefined;
@@ -1399,4 +1428,4 @@ declare module "react" {
1399
1428
  function forwardRef<T, P = {}>(render: (props: P, ref: React.ForwardedRef<T>) => React.ReactElement | null): (props: P & React.RefAttributes<T>) => React.ReactElement | null;
1400
1429
  }
1401
1430
 
1402
- export { ActivityIndicator, ArrayController, type ArrayControllerProps, Avatar, AvatarStack, Body, Button, ButtonElement, type ButtonRootProps, Chip, type ChipProps, CloseButtonContainer, type Colors, type CompletionItem, type CompletionListItem, CompletionMenu, type CompletionSectionHeader, CompletionToken, ContextMenu, type DesignSystemConfigurationContextValue, DesignSystemConfigurationProvider, DesignSystemThemeProvider, Dialog, type DialogContextValue, DialogProvider, DimensionInput, type DimensionValue, Divider, DividerVertical, DraggableMenuButton, type DropValidator, DropdownMenu, type EditableRowProps, type ExtractMenuItemType, FillInputField, FillPreviewBackground, FloatingWindow, FloatingWindowProvider, FullscreenDialog, type GlobalInputBlurContextValue, GlobalInputBlurProvider, GradientPicker, type GridProps, GridView, type GridViewSize, Heading1, Heading2, Heading3, Heading4, Heading5, type HoverEvent, type HoverEvents, type HoverProps, type IDialog, type IInputFieldWithCompletions, type IScoredItem, type IToken, type IVirtualizedList, type IWorkspaceLayout, IconButton, type ImageDataContextValue, ImageDataProvider, InputElement, InputField, type InputFieldSize, InputFieldWithCompletions, InspectorContainer, InspectorPrimitives, Italic, KeyboardShortcut, Label, LabeledElementView, type ListRowMarginType, type ListRowPosition, ListView, type MatchRange, type MenuConfig, type MenuItem, type MenuItemProps, type MenuProps, type Optional, PatternPreviewBackground, Popover, Progress, RadioGroup, type RegularMenuItem, type RelativeDropPosition, Row$1 as Row, SEPARATOR_ITEM, SUPPORTED_CANVAS_UPLOAD_TYPES, SUPPORTED_IMAGE_UPLOAD_TYPES, ScrollArea, Select, SelectOption, type SetNumberMode, type SketchPattern, Slider, Small, Sortable, Spacer, Stack, type StackBreakpointList, type SupportedCanvasUploadType, type SupportedImageUploadType, Switch, Text$1 as Text, type TextBreakpointList, type Theme, type ThemeColorName, Toast, ToastProvider, Tooltip, TreeView, WorkspaceLayout, createSectionedMenu, dark as darkTheme, fuzzyFilter, fuzzyScore, fuzzyTokenize, getGradientBackground, getNewValue, lightTheme, mediaQuery, normalizeListDestinationIndex, rgbaToSketchColor, size, sketchColorToHex, sketchColorToRgba, sketchColorToRgbaString, useCurrentFloatingWindowInternal, useDesignSystemConfiguration, useDesignSystemTheme, useDialogContainsElement, useFloatingWindowManager, useGlobalInputBlur, useGlobalInputBlurListener, useGlobalInputBlurTrigger, useHover, useImageData, useOpenInputDialog, usePlatform, usePlatformModKey, withSeparatorElements };
1431
+ export { ActivityIndicator, ArrayController, type ArrayControllerProps, Avatar, AvatarStack, Body, Button, ButtonElement, type ButtonRootProps, Chip, type ChipProps, CloseButtonContainer, type Colors, type CompletionItem, type CompletionListItem, CompletionMenu, type CompletionSectionHeader, CompletionToken, ContextMenu, type DesignSystemConfigurationContextValue, DesignSystemConfigurationProvider, DesignSystemThemeProvider, Dialog, type DialogContextValue, DialogProvider, DimensionInput, type DimensionValue, Divider, DividerVertical, DraggableMenuButton, type DropValidator, DropdownMenu, type EditableRowProps, type ExtractMenuItemType, FillInputField, FillPreviewBackground, FloatingWindow, FloatingWindowProvider, FullscreenDialog, type GlobalInputBlurContextValue, GlobalInputBlurProvider, GradientPicker, type GridProps, GridView, type GridViewSize, Heading1, Heading2, Heading3, Heading4, Heading5, type HoverEvent, type HoverEvents, type HoverProps, type IDialog, type IInputFieldWithCompletions, type IScoredItem, type IToken, type IVirtualizedList, type IWorkspaceLayout, IconButton, type ImageDataContextValue, ImageDataProvider, InputElement, InputField, type InputFieldSize, InputFieldWithCompletions, InspectorContainer, InspectorPrimitives, Italic, KeyboardShortcut, Label, LabeledElementView, type ListRowMarginType, type ListRowPosition, ListView, type MatchRange, type MenuConfig, type MenuItem, type MenuItemProps, type MenuProps, type Optional, PatternPreviewBackground, Popover, Progress, RadioGroup, type RegularMenuItem, type RelativeDropPosition, Row$1 as Row, SEPARATOR_ITEM, SUPPORTED_CANVAS_UPLOAD_TYPES, SUPPORTED_IMAGE_UPLOAD_TYPES, ScrollArea, Select, SelectMenu, SelectOption, type SetNumberMode, type SketchPattern, Slider, Small, Sortable, Spacer, Stack, type StackBreakpointList, type SupportedCanvasUploadType, type SupportedImageUploadType, Switch, Text$1 as Text, type TextBreakpointList, type Theme, type ThemeColorName, Toast, ToastProvider, Tooltip, TreeView, WorkspaceLayout, createSectionedMenu, dark as darkTheme, fuzzyFilter, fuzzyScore, fuzzyTokenize, getGradientBackground, getNewValue, lightTheme, mediaQuery, normalizeListDestinationIndex, rgbaToSketchColor, size, sketchColorToHex, sketchColorToRgba, sketchColorToRgbaString, useCurrentFloatingWindowInternal, useDesignSystemConfiguration, useDesignSystemTheme, useDialogContainsElement, useFloatingWindowManager, useGlobalInputBlur, useGlobalInputBlurListener, useGlobalInputBlurTrigger, useHover, useImageData, useOpenInputDialog, usePlatform, usePlatformModKey, withSeparatorElements };