@noya-app/noya-designsystem 0.1.37 → 0.1.39

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -14,7 +14,6 @@ import { IItemScore } from 'vscode-fuzzy-scorer';
14
14
  import { useSortable } from '@dnd-kit/sortable';
15
15
  import * as PopoverPrimitive from '@radix-ui/react-popover';
16
16
  import { SelectProps } from '@radix-ui/react-select';
17
- import { Config } from 'tailwindcss';
18
17
  import { ImperativePanelGroupHandle } from 'react-resizable-panels';
19
18
  import { RgbaColor } from '@noya-app/noya-colorpicker';
20
19
 
@@ -274,7 +273,7 @@ declare namespace GridView {
274
273
  }) => React__default.ReactElement | null;
275
274
  }
276
275
 
277
- declare const IconButton: (props: Omit<ButtonRootProps, "size" | "flex" | "children" | "variant"> & {
276
+ declare const IconButton: (props: Omit<ButtonRootProps, "size" | "children" | "flex" | "variant"> & {
278
277
  iconName: IconName;
279
278
  className?: string;
280
279
  style?: CSSProperties;
@@ -316,12 +315,6 @@ type TextInputProps = ReadOnlyProps | ControlledProps | SubmittableProps;
316
315
 
317
316
  type LabelPosition = "start" | "end";
318
317
  type InputFieldSize = "small" | "medium" | "large";
319
- interface InputFieldLabelProps {
320
- children?: ReactNode;
321
- pointerEvents?: Property.PointerEvents;
322
- style?: React__default.CSSProperties;
323
- className?: string;
324
- }
325
318
  interface InputFieldDropdownProps<T extends string> {
326
319
  id?: string;
327
320
  items: MenuItem<T>[];
@@ -369,7 +362,7 @@ declare namespace InputField {
369
362
  const NumberInput: (props: InputFieldNumberInputProps) => React__default.ReactElement | null;
370
363
  const DropdownMenu: <T extends string>(props: InputFieldDropdownProps<T>) => React__default.ReactElement | null;
371
364
  const Button: (props: React__default.ButtonHTMLAttributes<HTMLButtonElement> & React__default.RefAttributes<HTMLButtonElement>) => React__default.ReactElement | null;
372
- const Label: (props: InputFieldLabelProps & React__default.RefAttributes<HTMLLabelElement>) => React__default.ReactElement | null;
365
+ const Label: (props: React__default.LabelHTMLAttributes<HTMLLabelElement> & React__default.RefAttributes<HTMLLabelElement>) => React__default.ReactElement | null;
373
366
  const PrimitiveElement: ({ readOnly, disabled, className, ...props }: {
374
367
  readOnly?: boolean;
375
368
  disabled?: boolean;
@@ -714,18 +707,338 @@ interface Props$3 {
714
707
  }
715
708
  declare const Switch: ({ id, value, onChange, colorScheme, disabled, }: Props$3) => React__default.JSX.Element;
716
709
 
717
- declare const config: Config;
710
+ declare const config: {
711
+ content: string[];
712
+ corePlugins: {
713
+ preflight: false;
714
+ };
715
+ theme: {
716
+ extend: {
717
+ colors: {
718
+ "logo-fill": string;
719
+ "logo-highlight": string;
720
+ background: string;
721
+ text: string;
722
+ "text-muted": string;
723
+ "text-subtle": string;
724
+ "text-disabled": string;
725
+ "text-decorative-light": string;
726
+ "divider-subtle": string;
727
+ divider: string;
728
+ "divider-strong": string;
729
+ primary: string;
730
+ "primary-light": string;
731
+ "primary-pastel": string;
732
+ secondary: string;
733
+ "secondary-light": string;
734
+ "secondary-pastel": string;
735
+ "secondary-bright": string;
736
+ "input-background": string;
737
+ "input-background-light": string;
738
+ "code-background": string;
739
+ "code-background-dark": string;
740
+ "selected-background": string;
741
+ "breadcrumb-text": string;
742
+ "breadcrumb-text-hover": string;
743
+ "breadcrumb-icon": string;
744
+ "canvas-background": string;
745
+ "canvas-grid": string;
746
+ "sidebar-background": string;
747
+ "sidebar-background-transparent": string;
748
+ "popover-background": string;
749
+ "popover-divider": string;
750
+ "listview-raised-background": string;
751
+ "listview-editing-background": string;
752
+ "slider-background": string;
753
+ "slider-border": string;
754
+ "radio-group-background": string;
755
+ mask: string;
756
+ "transparent-checker": string;
757
+ scrollbar: string;
758
+ "placeholder-dots": string;
759
+ "drag-outline": string;
760
+ "active-background": string;
761
+ "thumbnail-background": string;
762
+ "thumbnail-shadow": string;
763
+ "inline-code-text": string;
764
+ "inline-code-background": string;
765
+ "text-link": string;
766
+ "text-link-focused": string;
767
+ icon: string;
768
+ "icon-selected": string;
769
+ warning: string;
770
+ "radio-group-item": string;
771
+ dot: string;
772
+ "row-highlight": string;
773
+ "table-row-background": string;
774
+ "chip-primary-bg": string;
775
+ "chip-secondary-bg": string;
776
+ "chip-error-bg": string;
777
+ "chip-default-bg": string;
778
+ "chip-primary-shadow": string;
779
+ "chip-secondary-shadow": string;
780
+ "chip-error-shadow": string;
781
+ "chip-default-shadow": string;
782
+ };
783
+ fontFamily: {
784
+ sans: [string, string, string, string, string, string, string, string, string, string];
785
+ mono: [string, string, string, string, string];
786
+ };
787
+ fontSize: {
788
+ title: [string, {
789
+ lineHeight: string;
790
+ letterSpacing: string;
791
+ }];
792
+ subtitle: [string, {
793
+ lineHeight: string;
794
+ letterSpacing: string;
795
+ }];
796
+ heading1: [string, {
797
+ lineHeight: string;
798
+ letterSpacing: string;
799
+ }];
800
+ heading2: [string, {
801
+ lineHeight: string;
802
+ letterSpacing: string;
803
+ }];
804
+ heading3: [string, {
805
+ lineHeight: string;
806
+ letterSpacing: string;
807
+ }];
808
+ heading4: [string, {
809
+ lineHeight: string;
810
+ }];
811
+ heading5: [string, {
812
+ lineHeight: string;
813
+ }];
814
+ body: [string, {
815
+ lineHeight: string;
816
+ }];
817
+ small: [string, {
818
+ lineHeight: string;
819
+ }];
820
+ code: [string, {
821
+ lineHeight: string;
822
+ }];
823
+ button: [string, {
824
+ lineHeight: string;
825
+ letterSpacing: string;
826
+ }];
827
+ label: [string, {
828
+ lineHeight: string;
829
+ letterSpacing: string;
830
+ }];
831
+ };
832
+ spacing: {
833
+ nano: string;
834
+ micro: string;
835
+ small: string;
836
+ medium: string;
837
+ large: string;
838
+ xlarge: string;
839
+ xxlarge: string;
840
+ "inset-top": string;
841
+ "sidebar-width": string;
842
+ "toolbar-height": string;
843
+ "toolbar-separator": string;
844
+ "inspector-h-separator": string;
845
+ "inspector-v-separator": string;
846
+ "dialog-padding": string;
847
+ };
848
+ keyframes: {
849
+ spin: {
850
+ "0%": {
851
+ transform: string;
852
+ };
853
+ "100%": {
854
+ transform: string;
855
+ };
856
+ };
857
+ shimmer: {
858
+ "0%": {
859
+ backgroundPosition: string;
860
+ };
861
+ "100%": {
862
+ backgroundPosition: string;
863
+ };
864
+ };
865
+ };
866
+ animation: {
867
+ spin: string;
868
+ shimmer: string;
869
+ };
870
+ zIndex: {
871
+ interactable: string;
872
+ label: string;
873
+ };
874
+ };
875
+ };
876
+ safelist: string[];
877
+ };
718
878
 
719
- type Theme = typeof config.theme.extend;
879
+ type Theme = (typeof config.theme)["extend"];
880
+ type ThemeColor = keyof Theme["colors"];
881
+ declare const cssVars: {
882
+ colors: {
883
+ logoFill: string;
884
+ logoHighlight: string;
885
+ background: string;
886
+ text: string;
887
+ textMuted: string;
888
+ textSubtle: string;
889
+ textDisabled: string;
890
+ textDecorativeLight: string;
891
+ dividerSubtle: string;
892
+ divider: string;
893
+ dividerStrong: string;
894
+ primary: string;
895
+ primaryLight: string;
896
+ primaryPastel: string;
897
+ secondary: string;
898
+ secondaryLight: string;
899
+ secondaryPastel: string;
900
+ secondaryBright: string;
901
+ inputBackground: string;
902
+ inputBackgroundLight: string;
903
+ codeBackground: string;
904
+ codeBackgroundDark: string;
905
+ selectedBackground: string;
906
+ breadcrumbText: string;
907
+ breadcrumbTextHover: string;
908
+ breadcrumbIcon: string;
909
+ canvasBackground: string;
910
+ canvasGrid: string;
911
+ sidebarBackground: string;
912
+ sidebarBackgroundTransparent: string;
913
+ popoverBackground: string;
914
+ popoverDivider: string;
915
+ listviewRaisedBackground: string;
916
+ listviewEditingBackground: string;
917
+ sliderBackground: string;
918
+ sliderBorder: string;
919
+ radioGroupBackground: string;
920
+ mask: string;
921
+ transparentChecker: string;
922
+ scrollbar: string;
923
+ placeholderDots: string;
924
+ dragOutline: string;
925
+ activeBackground: string;
926
+ thumbnailBackground: string;
927
+ thumbnailShadow: string;
928
+ inlineCodeText: string;
929
+ inlineCodeBackground: string;
930
+ textLink: string;
931
+ textLinkFocused: string;
932
+ icon: string;
933
+ iconSelected: string;
934
+ warning: string;
935
+ radioGroupItem: string;
936
+ dot: string;
937
+ rowHighlight: string;
938
+ tableRowBackground: string;
939
+ chipPrimaryBg: string;
940
+ chipSecondaryBg: string;
941
+ chipErrorBg: string;
942
+ chipDefaultBg: string;
943
+ chipPrimaryShadow: string;
944
+ chipSecondaryShadow: string;
945
+ chipErrorShadow: string;
946
+ chipDefaultShadow: string;
947
+ };
948
+ fontFamily: {
949
+ sans: [string, string, string, string, string, string, string, string, string, string];
950
+ mono: [string, string, string, string, string];
951
+ };
952
+ fontSize: {
953
+ title: [string, {
954
+ lineHeight: string;
955
+ letterSpacing: string;
956
+ }];
957
+ subtitle: [string, {
958
+ lineHeight: string;
959
+ letterSpacing: string;
960
+ }];
961
+ heading1: [string, {
962
+ lineHeight: string;
963
+ letterSpacing: string;
964
+ }];
965
+ heading2: [string, {
966
+ lineHeight: string;
967
+ letterSpacing: string;
968
+ }];
969
+ heading3: [string, {
970
+ lineHeight: string;
971
+ letterSpacing: string;
972
+ }];
973
+ heading4: [string, {
974
+ lineHeight: string;
975
+ }];
976
+ heading5: [string, {
977
+ lineHeight: string;
978
+ }];
979
+ body: [string, {
980
+ lineHeight: string;
981
+ }];
982
+ small: [string, {
983
+ lineHeight: string;
984
+ }];
985
+ code: [string, {
986
+ lineHeight: string;
987
+ }];
988
+ button: [string, {
989
+ lineHeight: string;
990
+ letterSpacing: string;
991
+ }];
992
+ label: [string, {
993
+ lineHeight: string;
994
+ letterSpacing: string;
995
+ }];
996
+ };
997
+ spacing: {
998
+ nano: string;
999
+ micro: string;
1000
+ small: string;
1001
+ medium: string;
1002
+ large: string;
1003
+ xlarge: string;
1004
+ xxlarge: string;
1005
+ insetTop: string;
1006
+ sidebarWidth: string;
1007
+ toolbarHeight: string;
1008
+ toolbarSeparator: string;
1009
+ inspectorHSeparator: string;
1010
+ inspectorVSeparator: string;
1011
+ dialogPadding: string;
1012
+ };
1013
+ keyframes: {
1014
+ spin: {
1015
+ "0%": {
1016
+ transform: string;
1017
+ };
1018
+ "100%": {
1019
+ transform: string;
1020
+ };
1021
+ };
1022
+ shimmer: {
1023
+ "0%": {
1024
+ backgroundPosition: string;
1025
+ };
1026
+ "100%": {
1027
+ backgroundPosition: string;
1028
+ };
1029
+ };
1030
+ };
1031
+ animation: {
1032
+ spin: string;
1033
+ shimmer: string;
1034
+ };
1035
+ zIndex: {
1036
+ interactable: string;
1037
+ label: string;
1038
+ };
1039
+ };
720
1040
 
721
- /**
722
- * Utility for merging classes conditionally. Right side will override left side if there are any conflicts.
723
- * Usage: cn('bg-red-500 text-white', 'bg-blue-500') // Returns: 'text-white bg-blue-500'
724
- * @danger do not use this function to concatenate class names. Use it to merge classes conditionally.
725
- */
726
- declare const cn: (...classes: (string | boolean | undefined | null)[]) => string;
727
- type ThemeExtend = NonNullable<Theme['extend']>;
728
- type ThemeColor = keyof ThemeExtend['colors'];
1041
+ type KebabToCamelCase<S extends string> = S extends `${infer First}-${infer Rest}` ? `${First}${Capitalize<KebabToCamelCase<Rest>>}` : S;
729
1042
 
730
1043
  type Variant = "title" | "subtitle" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "body" | "small" | "button" | "code" | "label";
731
1044
  declare const textStyles: Record<Variant, string>;
@@ -735,7 +1048,7 @@ type TextProps = {
735
1048
  className?: string;
736
1049
  style?: React__default.CSSProperties;
737
1050
  variant: Variant;
738
- color?: ThemeColor;
1051
+ color?: KebabToCamelCase<ThemeColor>;
739
1052
  children: ReactNode;
740
1053
  onClick?: () => void;
741
1054
  onDoubleClick?: () => void;
@@ -974,6 +1287,13 @@ declare const mediaQuery: {
974
1287
  xlarge: string;
975
1288
  };
976
1289
 
1290
+ /**
1291
+ * Utility for merging classes conditionally. Right side will override left side if there are any conflicts.
1292
+ * Usage: cn('bg-red-500 text-white', 'bg-blue-500') // Returns: 'text-white bg-blue-500'
1293
+ * @danger do not use this function to concatenate class names. Use it to merge classes conditionally.
1294
+ */
1295
+ declare const cn: (...classes: (string | boolean | undefined | null)[]) => string;
1296
+
977
1297
  type Optional<T> = T | false | null | undefined;
978
1298
  type MenuConfig<T extends string> = Optional<Optional<RegularMenuItem<T>>[]>[];
979
1299
  declare function createSectionedMenu<T extends string>(...sections: MenuConfig<T>): MenuItem<T>[];
@@ -1022,9 +1342,9 @@ declare const Checkbox: (props: React__default.InputHTMLAttributes<HTMLInputElem
1022
1342
  declare const Text: (props: React__default.HTMLAttributes<HTMLSpanElement> & React__default.RefAttributes<HTMLSpanElement>) => React__default.ReactElement | null;
1023
1343
  declare const VerticalSeparator: () => React__default.JSX.Element;
1024
1344
  declare const HorizontalSeparator: () => React__default.JSX.Element;
1025
- declare const RowLabel: (props: React__default.HTMLAttributes<HTMLSpanElement> & {
1345
+ declare const RowLabel: (props: React__default.LabelHTMLAttributes<HTMLLabelElement> & {
1026
1346
  $textStyle?: TitleTextStyle | "label";
1027
- } & React__default.RefAttributes<HTMLSpanElement>) => React__default.ReactElement | null;
1347
+ } & React__default.RefAttributes<HTMLLabelElement>) => React__default.ReactElement | null;
1028
1348
  interface LabeledRowProps {
1029
1349
  id?: string;
1030
1350
  children: ReactNode;
@@ -1055,4 +1375,4 @@ declare module "react" {
1055
1375
  function forwardRef<T, P = {}>(render: (props: P, ref: React.ForwardedRef<T>) => React.ReactElement | null): (props: P & React.RefAttributes<T>) => React.ReactElement | null;
1056
1376
  }
1057
1377
 
1058
- export { ActivityIndicator, AutoResizingTextArea, Avatar, AvatarStack, Body, Button, type ButtonRootProps, CONTENT_AREA_ID, Checkbox$1 as Checkbox, Chip, type ChipProps, type CompletionItem, type CompletionListItem, CompletionMenu, type CompletionSectionHeader, ContextMenu, type DesignSystemConfigurationContextValue, DesignSystemConfigurationProvider, Dialog, type DialogContextValue, DialogProvider, DimensionInput, type DimensionValue, Divider, DividerVertical, DraggableMenuButton, type DropValidator, DropdownMenu, EDITOR_PANEL_GROUP_ID, type EditableRowProps, type ExtractMenuItemType, FillInputField, FillPreviewBackground, FloatingWindow, FloatingWindowProvider, FullscreenDialog, type GlobalInputBlurContextValue, GlobalInputBlurProvider, GradientPicker, GridView, type GridViewSize, Heading1, Heading2, Heading3, Heading4, Heading5, type HoverEvent, type HoverEvents, type HoverProps, type IDialog, type IScoredItem, type IToken, type IVirtualizedList, type IWorkspaceLayout, IconButton, type IconName, type ImageDataContextValue, ImageDataProvider, InputField, type InputFieldInputProps, type InputFieldSize, InputFieldWithCompletions, type InputFieldWithCompletionsProps, type InputFieldWithCompletionsRef, InspectorContainer, InspectorPrimitives, Italic, KeyboardShortcut, LEFT_SIDEBAR_ID, Label, LabeledElementView, type ListRowMarginType, type ListRowPosition, ListView, type MatchRange, type MenuConfig, type MenuItem, type MenuItemProps, type MenuProps, type Optional, type PanelLayoutState, PatternPreviewBackground, Popover, Progress, RIGHT_SIDEBAR_ID, RadioGroup, type RegularMenuItem, type RelativeDropPosition, SEPARATOR_ITEM, SUPPORTED_CANVAS_UPLOAD_TYPES, SUPPORTED_IMAGE_UPLOAD_TYPES, ScrollArea, SelectMenu, type SetNumberMode, type SketchPattern, Slider, Small, Sortable, Spacer, type SupportedCanvasUploadType, type SupportedImageUploadType, Switch, Text$1 as Text, type TextProps, type Theme, type ThemeColor, Toast, ToastProvider, Tooltip, TreeView, WorkspaceLayout, cn, createSectionedMenu, fuzzyFilter, fuzzyScore, fuzzyTokenize, getGradientBackground, getNewValue, mediaQuery, normalizeListDestinationIndex, renderIcon, rgbaToSketchColor, size, sketchColorToHex, sketchColorToRgba, sketchColorToRgbaString, textStyles, useAutoResize, useCurrentFloatingWindowInternal, useDarkMode, useDesignSystemConfiguration, useDialogContainsElement, useFloatingWindowManager, useGlobalInputBlur, useGlobalInputBlurListener, useGlobalInputBlurTrigger, useHover, useImageData, useOpenInputDialog, usePlatform, usePlatformModKey, usePreservePanelSize, withSeparatorElements };
1378
+ export { ActivityIndicator, AutoResizingTextArea, Avatar, AvatarStack, Body, Button, type ButtonRootProps, CONTENT_AREA_ID, Checkbox$1 as Checkbox, Chip, type ChipProps, type CompletionItem, type CompletionListItem, CompletionMenu, type CompletionSectionHeader, ContextMenu, type DesignSystemConfigurationContextValue, DesignSystemConfigurationProvider, Dialog, type DialogContextValue, DialogProvider, DimensionInput, type DimensionValue, Divider, DividerVertical, DraggableMenuButton, type DropValidator, DropdownMenu, EDITOR_PANEL_GROUP_ID, type EditableRowProps, type ExtractMenuItemType, FillInputField, FillPreviewBackground, FloatingWindow, FloatingWindowProvider, FullscreenDialog, type GlobalInputBlurContextValue, GlobalInputBlurProvider, GradientPicker, GridView, type GridViewSize, Heading1, Heading2, Heading3, Heading4, Heading5, type HoverEvent, type HoverEvents, type HoverProps, type IDialog, type IScoredItem, type IToken, type IVirtualizedList, type IWorkspaceLayout, IconButton, type IconName, type ImageDataContextValue, ImageDataProvider, InputField, type InputFieldInputProps, type InputFieldSize, InputFieldWithCompletions, type InputFieldWithCompletionsProps, type InputFieldWithCompletionsRef, InspectorContainer, InspectorPrimitives, Italic, KeyboardShortcut, LEFT_SIDEBAR_ID, Label, LabeledElementView, type ListRowMarginType, type ListRowPosition, ListView, type MatchRange, type MenuConfig, type MenuItem, type MenuItemProps, type MenuProps, type Optional, type PanelLayoutState, PatternPreviewBackground, Popover, Progress, RIGHT_SIDEBAR_ID, RadioGroup, type RegularMenuItem, type RelativeDropPosition, SEPARATOR_ITEM, SUPPORTED_CANVAS_UPLOAD_TYPES, SUPPORTED_IMAGE_UPLOAD_TYPES, ScrollArea, SelectMenu, type SetNumberMode, type SketchPattern, Slider, Small, Sortable, Spacer, type SupportedCanvasUploadType, type SupportedImageUploadType, Switch, Text$1 as Text, type TextProps, type Theme, type ThemeColor, Toast, ToastProvider, Tooltip, TreeView, WorkspaceLayout, cn, createSectionedMenu, cssVars, fuzzyFilter, fuzzyScore, fuzzyTokenize, getGradientBackground, getNewValue, mediaQuery, normalizeListDestinationIndex, renderIcon, rgbaToSketchColor, size, sketchColorToHex, sketchColorToRgba, sketchColorToRgbaString, textStyles, useAutoResize, useCurrentFloatingWindowInternal, useDarkMode, useDesignSystemConfiguration, useDialogContainsElement, useFloatingWindowManager, useGlobalInputBlur, useGlobalInputBlurListener, useGlobalInputBlurTrigger, useHover, useImageData, useOpenInputDialog, usePlatform, usePlatformModKey, usePreservePanelSize, withSeparatorElements };