@noya-app/noya-designsystem 0.1.5 → 0.1.7

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
- CJS dist/index.js 198.96 KB
9
- CJS dist/index.js.map 403.34 KB
10
- CJS ⚡️ Build success in 70ms
11
- ESM dist/index.mjs 182.68 KB
12
- ESM dist/index.mjs.map 403.05 KB
13
- ESM ⚡️ Build success in 70ms
14
8
  DTS Build start
15
- DTS ⚡️ Build success in 5910ms
16
- DTS dist/index.d.ts 54.16 KB
17
- DTS dist/index.d.mts 54.16 KB
9
+ CJS dist/index.js 199.65 KB
10
+ CJS dist/index.js.map 404.79 KB
11
+ CJS ⚡️ Build success in 185ms
12
+ ESM dist/index.mjs 183.34 KB
13
+ ESM dist/index.mjs.map 404.50 KB
14
+ ESM ⚡️ Build success in 190ms
15
+ DTS ⚡️ Build success in 6688ms
16
+ DTS dist/index.d.ts 54.34 KB
17
+ DTS dist/index.d.mts 54.34 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,24 @@
1
1
  # @noya-app/noya-designsystem
2
2
 
3
+ ## 0.1.7
4
+
5
+ ### Patch Changes
6
+
7
+ - 6a13e8b: Improve multiplayer and design system
8
+ - Updated dependencies [6a13e8b]
9
+ - @noya-app/noya-colorpicker@0.1.5
10
+ - @noya-app/noya-geometry@0.1.2
11
+ - @noya-app/noya-icons@0.1.2
12
+
13
+ ## 0.1.6
14
+
15
+ ### Patch Changes
16
+
17
+ - 149f2f9: Improve multiplayer
18
+ - Updated dependencies [149f2f9]
19
+ - @noya-app/noya-icons@0.1.1
20
+ - @noya-app/noya-colorpicker@0.1.4
21
+
3
22
  ## 0.1.5
4
23
 
5
24
  ### Patch Changes
package/dist/index.d.mts CHANGED
@@ -33,7 +33,7 @@ declare function Avatar({ image, name, fallback, size, overflow, }: {
33
33
  overflow?: number;
34
34
  }): React__default.JSX.Element;
35
35
 
36
- type ButtonVariant = "normal" | "primary" | "secondary" | "secondaryBright" | "white" | "thin" | "floating" | "none";
36
+ type ButtonVariant = "normal" | "primary" | "primaryGradient" | "secondary" | "secondaryBright" | "white" | "thin" | "floating" | "none";
37
37
  type ButtonSize = "normal" | "large";
38
38
  declare const ButtonElement: styled_components.StyledComponent<"button", styled_components.DefaultTheme, {
39
39
  active: boolean;
@@ -283,8 +283,8 @@ declare const DividerVertical: (props: DividerProps) => React__default.ReactElem
283
283
  * A button that opens a menu when clicked, but also allows dragging the
284
284
  */
285
285
  declare const DraggableMenuButton: <T extends string>(props: {
286
- items: MenuItem<T>[];
287
- onSelect: (value: T) => void;
286
+ items?: MenuItem<T>[] | undefined;
287
+ onSelect?: ((value: T) => void) | undefined;
288
288
  isVisible?: boolean | undefined;
289
289
  }) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
290
290
 
@@ -621,6 +621,7 @@ interface ListViewRowProps<MenuItemType extends string = string> {
621
621
  onContextMenu?: () => void;
622
622
  onMenuOpenChange?: (isOpen: boolean) => void;
623
623
  onKeyDown?: (event: React__default.KeyboardEvent) => void;
624
+ style?: CSSProperties;
624
625
  }
625
626
  interface IVirtualizedList {
626
627
  scrollToIndex(index: number): void;
@@ -636,7 +637,9 @@ type RenderProps<T> = {
636
637
  renderItem: (item: T, index: number, info: ListViewItemInfo) => ReactNode;
637
638
  keyExtractor: (item: T, index: number) => string;
638
639
  /**
639
- * Each item must have an `id` in order to be sortable
640
+ * Each item must have an `id` in order to be sortable.
641
+ *
642
+ * Additionally, the key extracted with `keyExtractor` must match the ListItem.Row `id`.
640
643
  */
641
644
  sortable?: boolean;
642
645
  virtualized?: Size;
@@ -758,7 +761,7 @@ declare function Progress({ value, width, height, flex, variant, }: {
758
761
  variant?: ProgressVariant;
759
762
  }): React__default.JSX.Element;
760
763
 
761
- type RadioGroupColorScheme = 'primary' | 'secondary';
764
+ type RadioGroupColorScheme = "primary" | "secondary";
762
765
  declare const StyledRoot: styled_components.StyledComponent<React__default.ForwardRefExoticComponent<(ToggleGroupPrimitive.ToggleGroupSingleProps | ToggleGroupPrimitive.ToggleGroupMultipleProps) & React__default.RefAttributes<HTMLDivElement>>, styled_components.DefaultTheme, {
763
766
  colorScheme?: RadioGroupColorScheme | undefined;
764
767
  }, never>;
@@ -771,7 +774,7 @@ interface ItemProps {
771
774
  interface Props$9 {
772
775
  id?: string;
773
776
  value?: string;
774
- onValueChange?: ComponentProps<typeof StyledRoot>['onValueChange'];
777
+ onValueChange?: ComponentProps<typeof StyledRoot>["onValueChange"];
775
778
  colorScheme?: RadioGroupColorScheme;
776
779
  allowEmpty?: boolean;
777
780
  children: ReactNode;
@@ -795,7 +798,7 @@ declare const SelectOption: <T extends string>(props: SelectOptionProps<T>) => R
795
798
  type ChildrenProps<T> = {
796
799
  children: ReactNode;
797
800
  } | {
798
- options: T[];
801
+ options: readonly T[];
799
802
  getTitle?: (option: T, index: number) => string;
800
803
  onChange: (value: T) => void;
801
804
  };
package/dist/index.d.ts CHANGED
@@ -33,7 +33,7 @@ declare function Avatar({ image, name, fallback, size, overflow, }: {
33
33
  overflow?: number;
34
34
  }): React__default.JSX.Element;
35
35
 
36
- type ButtonVariant = "normal" | "primary" | "secondary" | "secondaryBright" | "white" | "thin" | "floating" | "none";
36
+ type ButtonVariant = "normal" | "primary" | "primaryGradient" | "secondary" | "secondaryBright" | "white" | "thin" | "floating" | "none";
37
37
  type ButtonSize = "normal" | "large";
38
38
  declare const ButtonElement: styled_components.StyledComponent<"button", styled_components.DefaultTheme, {
39
39
  active: boolean;
@@ -283,8 +283,8 @@ declare const DividerVertical: (props: DividerProps) => React__default.ReactElem
283
283
  * A button that opens a menu when clicked, but also allows dragging the
284
284
  */
285
285
  declare const DraggableMenuButton: <T extends string>(props: {
286
- items: MenuItem<T>[];
287
- onSelect: (value: T) => void;
286
+ items?: MenuItem<T>[] | undefined;
287
+ onSelect?: ((value: T) => void) | undefined;
288
288
  isVisible?: boolean | undefined;
289
289
  }) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
290
290
 
@@ -621,6 +621,7 @@ interface ListViewRowProps<MenuItemType extends string = string> {
621
621
  onContextMenu?: () => void;
622
622
  onMenuOpenChange?: (isOpen: boolean) => void;
623
623
  onKeyDown?: (event: React__default.KeyboardEvent) => void;
624
+ style?: CSSProperties;
624
625
  }
625
626
  interface IVirtualizedList {
626
627
  scrollToIndex(index: number): void;
@@ -636,7 +637,9 @@ type RenderProps<T> = {
636
637
  renderItem: (item: T, index: number, info: ListViewItemInfo) => ReactNode;
637
638
  keyExtractor: (item: T, index: number) => string;
638
639
  /**
639
- * Each item must have an `id` in order to be sortable
640
+ * Each item must have an `id` in order to be sortable.
641
+ *
642
+ * Additionally, the key extracted with `keyExtractor` must match the ListItem.Row `id`.
640
643
  */
641
644
  sortable?: boolean;
642
645
  virtualized?: Size;
@@ -758,7 +761,7 @@ declare function Progress({ value, width, height, flex, variant, }: {
758
761
  variant?: ProgressVariant;
759
762
  }): React__default.JSX.Element;
760
763
 
761
- type RadioGroupColorScheme = 'primary' | 'secondary';
764
+ type RadioGroupColorScheme = "primary" | "secondary";
762
765
  declare const StyledRoot: styled_components.StyledComponent<React__default.ForwardRefExoticComponent<(ToggleGroupPrimitive.ToggleGroupSingleProps | ToggleGroupPrimitive.ToggleGroupMultipleProps) & React__default.RefAttributes<HTMLDivElement>>, styled_components.DefaultTheme, {
763
766
  colorScheme?: RadioGroupColorScheme | undefined;
764
767
  }, never>;
@@ -771,7 +774,7 @@ interface ItemProps {
771
774
  interface Props$9 {
772
775
  id?: string;
773
776
  value?: string;
774
- onValueChange?: ComponentProps<typeof StyledRoot>['onValueChange'];
777
+ onValueChange?: ComponentProps<typeof StyledRoot>["onValueChange"];
775
778
  colorScheme?: RadioGroupColorScheme;
776
779
  allowEmpty?: boolean;
777
780
  children: ReactNode;
@@ -795,7 +798,7 @@ declare const SelectOption: <T extends string>(props: SelectOptionProps<T>) => R
795
798
  type ChildrenProps<T> = {
796
799
  children: ReactNode;
797
800
  } | {
798
- options: T[];
801
+ options: readonly T[];
799
802
  getTitle?: (option: T, index: number) => string;
800
803
  onChange: (value: T) => void;
801
804
  };
package/dist/index.js CHANGED
@@ -253,17 +253,17 @@ var ButtonElement = import_styled_components4.default.button(({ theme, active, d
253
253
  paddingBottom: "12px",
254
254
  paddingLeft: "16px"
255
255
  },
256
- background: active ? theme.colors.primary : variant === "none" || variant === "thin" ? "transparent" : theme.colors.inputBackground,
256
+ background: active ? theme.colors.primary : variant === "primaryGradient" ? `linear-gradient(90deg, ${theme.colors.primary}, ${theme.colors.primaryLight})` : variant === "none" || variant === "thin" ? "transparent" : theme.colors.inputBackground,
257
257
  color: active ? "white" : theme.colors.text,
258
258
  opacity: disabled ? 0.25 : 1,
259
259
  "&:focus": {
260
260
  boxShadow: `0 0 0 1px ${theme.colors.sidebar.background}, 0 0 0 3px ${theme.colors.primary}`
261
261
  },
262
262
  "&:hover": {
263
- background: theme.colors.inputBackgroundLight
263
+ background: variant === "primaryGradient" ? theme.colors.primaryLight : theme.colors.inputBackgroundLight
264
264
  },
265
265
  "&:active": {
266
- background: theme.colors.activeBackground
266
+ background: variant === "primaryGradient" ? theme.colors.primary : theme.colors.activeBackground
267
267
  },
268
268
  ...variant === "primary" && {
269
269
  background: theme.colors.primary,
@@ -654,18 +654,22 @@ var style = {
654
654
  flex: "1 0 0",
655
655
  flexDirection: "column"
656
656
  };
657
- var AutoSizer = (0, import_react8.memo)(function AutoSizer2({ children }) {
657
+ var AutoSizer = (0, import_react8.memo)(function AutoSizer2({
658
+ children,
659
+ className
660
+ }) {
658
661
  const containerRef = (0, import_react8.useRef)(null);
659
662
  const containerSize = useSize(containerRef);
660
- return /* @__PURE__ */ import_react8.default.createElement("div", { ref: containerRef, style }, containerSize && containerSize.width > 0 && containerSize.height > 0 && children(containerSize));
663
+ return /* @__PURE__ */ import_react8.default.createElement("div", { ref: containerRef, style, className }, containerSize && containerSize.width > 0 && containerSize.height > 0 && children(containerSize));
661
664
  });
662
665
  var SingleDimensionAutoSizer = (0, import_react8.memo)(function SingleDimensionAutoSizer2({
663
666
  children,
664
- dimension
667
+ dimension,
668
+ className
665
669
  }) {
666
670
  const containerRef = (0, import_react8.useRef)(null);
667
671
  const containerSize = useSize(containerRef, dimension);
668
- return /* @__PURE__ */ import_react8.default.createElement("div", { ref: containerRef, style }, containerSize && containerSize[dimension] > 0 && children(containerSize[dimension]));
672
+ return /* @__PURE__ */ import_react8.default.createElement("div", { ref: containerRef, style, className }, containerSize && containerSize[dimension] > 0 && children(containerSize[dimension]));
669
673
  });
670
674
 
671
675
  // ../noya-react-utils/src/components/FileDropTarget.tsx
@@ -2431,7 +2435,7 @@ var DraggableMenuButton = (0, import_react36.memo)(function DraggableMenuButton2
2431
2435
  event.preventDefault();
2432
2436
  }
2433
2437
  },
2434
- /* @__PURE__ */ import_react36.default.createElement(
2438
+ items && onSelect ? /* @__PURE__ */ import_react36.default.createElement(
2435
2439
  DropdownMenu,
2436
2440
  {
2437
2441
  open,
@@ -2446,6 +2450,11 @@ var DraggableMenuButton = (0, import_react36.memo)(function DraggableMenuButton2
2446
2450
  color: isVisible || open ? color : "transparent"
2447
2451
  }
2448
2452
  ))
2453
+ ) : /* @__PURE__ */ import_react36.default.createElement(
2454
+ import_noya_icons5.DragHandleDots2Icon,
2455
+ {
2456
+ color: isVisible || open ? color : "transparent"
2457
+ }
2449
2458
  )
2450
2459
  );
2451
2460
  });
@@ -3896,7 +3905,8 @@ var ListViewRow = (0, import_react45.forwardRef)(function ListViewRow2({
3896
3905
  onContextMenu,
3897
3906
  onSelectMenuItem,
3898
3907
  onMenuOpenChange,
3899
- onKeyDown
3908
+ onKeyDown,
3909
+ style: style3
3900
3910
  }, forwardedRef) {
3901
3911
  depth = Math.max(0, depth);
3902
3912
  const {
@@ -3930,13 +3940,14 @@ var ListViewRow = (0, import_react45.forwardRef)(function ListViewRow2({
3930
3940
  },
3931
3941
  [onDoubleClick]
3932
3942
  );
3933
- const isDraggingStyle = (0, import_react45.useMemo)(() => {
3943
+ const mergedStyle = (0, import_react45.useMemo)(() => {
3934
3944
  return isDragging ? {
3935
3945
  // TODO: Where do these offsets actually come from?
3936
3946
  transform: `translate3d(-36px, -6px, 0)`,
3937
- width: `calc(100% + 48px)`
3938
- } : void 0;
3939
- }, [isDragging]);
3947
+ width: `calc(100% + 48px)`,
3948
+ ...style3
3949
+ } : style3;
3950
+ }, [isDragging, style3]);
3940
3951
  const renderContent = ({
3941
3952
  relativeDropPosition,
3942
3953
  ...renderProps
@@ -3964,7 +3975,7 @@ var ListViewRow = (0, import_react45.forwardRef)(function ListViewRow2({
3964
3975
  "aria-selected": selected,
3965
3976
  divider: !isDragging && divider,
3966
3977
  onKeyDown,
3967
- style: isDraggingStyle,
3978
+ style: mergedStyle,
3968
3979
  ...renderProps,
3969
3980
  ...mergeEventHandlers(
3970
3981
  { onPointerDown: renderProps.onPointerDown },
@@ -4961,6 +4972,7 @@ var StyledRoot = (0, import_styled_components31.default)(ToggleGroupPrimitive.Ro
4961
4972
  var StyledItem = (0, import_styled_components31.default)(ToggleGroupPrimitive.Item).withConfig({
4962
4973
  shouldForwardProp: (prop) => !ignoredProps3.has(prop)
4963
4974
  })(({ theme, colorScheme }) => ({
4975
+ ...theme.textStyles.small,
4964
4976
  position: "relative",
4965
4977
  flex: "1 1 0",
4966
4978
  appearance: "none",
@@ -5558,6 +5570,9 @@ var colors2 = (0, import_immer.default)(colors, (colors3) => {
5558
5570
  colors3.activeBackground = "rgba(181,178,255,0.08)";
5559
5571
  colors3.thumbnailBackground = "#1f1d33";
5560
5572
  colors3.thumbnailShadow = "#1f1d3366";
5573
+ colors3.breadcrumb.text = colors3.textMuted;
5574
+ colors3.breadcrumb.textHover = colors3.textSubtle;
5575
+ colors3.breadcrumb.icon = colors3.icon;
5561
5576
  });
5562
5577
 
5563
5578
  // src/utils/createSectionedMenu.ts
@@ -5676,8 +5691,9 @@ var RowLabel = import_styled_components35.default.span(({ theme, textStyle }) =>
5676
5691
  color: theme.colors.textSubtle,
5677
5692
  fontWeight: "bold"
5678
5693
  },
5679
- lineHeight: "19px"
5694
+ lineHeight: "19px",
5680
5695
  // Button height
5696
+ alignItems: "center"
5681
5697
  }));
5682
5698
  var LabeledRow = (0, import_react56.memo)(function LabeledRow2({
5683
5699
  id,