@noya-app/noya-designsystem 0.1.4 → 0.1.6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@noya-app/noya-designsystem",
3
- "version": "0.1.4",
3
+ "version": "0.1.6",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.mjs",
6
6
  "types": "./dist/index.d.ts",
@@ -13,10 +13,10 @@
13
13
  "@dnd-kit/core": "3.1.1",
14
14
  "@dnd-kit/modifiers": "3.0.0",
15
15
  "@dnd-kit/sortable": "4.0.0",
16
- "@noya-app/noya-colorpicker": "0.1.2",
16
+ "@noya-app/noya-colorpicker": "0.1.4",
17
17
  "@noya-app/noya-utils": "0.1.0",
18
18
  "@noya-app/noya-geometry": "0.1.1",
19
- "@noya-app/noya-icons": "0.1.0",
19
+ "@noya-app/noya-icons": "0.1.1",
20
20
  "@noya-app/noya-keymap": "0.1.0",
21
21
  "@radix-ui/primitive": "^1.0.0",
22
22
  "@radix-ui/react-avatar": "^1.0.1",
@@ -11,6 +11,7 @@ import { Tooltip } from "./Tooltip";
11
11
  type ButtonVariant =
12
12
  | "normal"
13
13
  | "primary"
14
+ | "primaryGradient"
14
15
  | "secondary"
15
16
  | "secondaryBright"
16
17
  | "white"
@@ -54,19 +55,27 @@ export const ButtonElement = styled.button<{
54
55
  }),
55
56
  background: active
56
57
  ? theme.colors.primary
57
- : variant === "none" || variant === "thin"
58
- ? "transparent"
59
- : theme.colors.inputBackground,
58
+ : variant === "primaryGradient"
59
+ ? `linear-gradient(90deg, ${theme.colors.primary}, ${theme.colors.primaryLight})`
60
+ : variant === "none" || variant === "thin"
61
+ ? "transparent"
62
+ : theme.colors.inputBackground,
60
63
  color: active ? "white" : theme.colors.text,
61
64
  opacity: disabled ? 0.25 : 1,
62
65
  "&:focus": {
63
66
  boxShadow: `0 0 0 1px ${theme.colors.sidebar.background}, 0 0 0 3px ${theme.colors.primary}`,
64
67
  },
65
68
  "&:hover": {
66
- background: theme.colors.inputBackgroundLight,
69
+ background:
70
+ variant === "primaryGradient"
71
+ ? theme.colors.primaryLight
72
+ : theme.colors.inputBackgroundLight,
67
73
  },
68
74
  "&:active": {
69
- background: theme.colors.activeBackground,
75
+ background:
76
+ variant === "primaryGradient"
77
+ ? theme.colors.primary
78
+ : theme.colors.activeBackground,
70
79
  },
71
80
  ...(variant === "primary" && {
72
81
  background: theme.colors.primary,
@@ -1,4 +1,4 @@
1
- import * as ToggleGroupPrimitive from '@radix-ui/react-toggle-group';
1
+ import * as ToggleGroupPrimitive from "@radix-ui/react-toggle-group";
2
2
  import React, {
3
3
  ComponentProps,
4
4
  createContext,
@@ -8,39 +8,39 @@ import React, {
8
8
  useCallback,
9
9
  useContext,
10
10
  useMemo,
11
- } from 'react';
12
- import styled from 'styled-components';
13
- import { Tooltip } from './Tooltip';
11
+ } from "react";
12
+ import styled from "styled-components";
13
+ import { Tooltip } from "./Tooltip";
14
14
 
15
- type RadioGroupColorScheme = 'primary' | 'secondary';
15
+ type RadioGroupColorScheme = "primary" | "secondary";
16
16
 
17
- const ignoredProps = new Set(['colorScheme']);
17
+ const ignoredProps = new Set(["colorScheme"]);
18
18
 
19
19
  const StyledRoot = styled(ToggleGroupPrimitive.Root).withConfig({
20
20
  shouldForwardProp: (prop) => !ignoredProps.has(prop),
21
21
  })<{
22
22
  colorScheme?: RadioGroupColorScheme;
23
23
  }>(({ theme, colorScheme }) => ({
24
- appearance: 'none',
25
- width: '0px', // Reset intrinsic width
26
- flex: '1 1 0px',
27
- position: 'relative',
28
- border: '0',
29
- outline: 'none',
30
- minWidth: '0',
31
- textAlign: 'left',
32
- alignSelf: 'stretch',
33
- borderRadius: '4px',
24
+ appearance: "none",
25
+ width: "0px", // Reset intrinsic width
26
+ flex: "1 1 0px",
27
+ position: "relative",
28
+ border: "0",
29
+ outline: "none",
30
+ minWidth: "0",
31
+ textAlign: "left",
32
+ alignSelf: "stretch",
33
+ borderRadius: "4px",
34
34
  background: theme.colors.inputBackground,
35
- '&:focus': {
35
+ "&:focus": {
36
36
  boxShadow: `0 0 0 1px ${theme.colors.sidebar.background}, 0 0 0 3px ${
37
- theme.colors[colorScheme ?? 'primary']
37
+ theme.colors[colorScheme ?? "primary"]
38
38
  }`,
39
39
  },
40
- display: 'flex',
41
- alignItems: 'stretch',
42
- minHeight: '27px',
43
- padding: colorScheme === undefined ? '2px' : 0,
40
+ display: "flex",
41
+ alignItems: "stretch",
42
+ minHeight: "27px",
43
+ padding: colorScheme === undefined ? "2px" : 0,
44
44
  }));
45
45
 
46
46
  const StyledItem = styled(ToggleGroupPrimitive.Item).withConfig({
@@ -48,19 +48,20 @@ const StyledItem = styled(ToggleGroupPrimitive.Item).withConfig({
48
48
  })<{
49
49
  colorScheme?: RadioGroupColorScheme;
50
50
  }>(({ theme, colorScheme }) => ({
51
- position: 'relative',
52
- flex: '1 1 0',
53
- appearance: 'none',
54
- border: 'none',
55
- background: 'none',
56
- color: 'rgb(139, 139, 139)',
51
+ ...theme.textStyles.small,
52
+ position: "relative",
53
+ flex: "1 1 0",
54
+ appearance: "none",
55
+ border: "none",
56
+ background: "none",
57
+ color: "rgb(139, 139, 139)",
57
58
  padding: 0,
58
59
  margin: 0,
59
- borderRadius: '4px',
60
- display: 'inline-flex',
61
- alignItems: 'center',
62
- justifyContent: 'center',
63
- verticalAlign: 'middle',
60
+ borderRadius: "4px",
61
+ display: "inline-flex",
62
+ alignItems: "center",
63
+ justifyContent: "center",
64
+ verticalAlign: "middle",
64
65
  '&[aria-checked="true"]': {
65
66
  backgroundColor: colorScheme
66
67
  ? theme.colors[colorScheme]
@@ -68,10 +69,10 @@ const StyledItem = styled(ToggleGroupPrimitive.Item).withConfig({
68
69
  color: colorScheme ? theme.colors.radioGroup.background : theme.colors.text,
69
70
  boxShadow: colorScheme ? undefined : `0 1px 1px rgba(0,0,0,0.1)`,
70
71
  },
71
- '&:focus': {
72
- outline: 'none',
72
+ "&:focus": {
73
+ outline: "none",
73
74
  boxShadow: `0 0 0 1px ${theme.colors.sidebar.background}, 0 0 0 3px ${
74
- theme.colors[colorScheme ?? 'primary']
75
+ theme.colors[colorScheme ?? "primary"]
75
76
  }`,
76
77
  },
77
78
  }));
@@ -85,7 +86,7 @@ interface ItemProps {
85
86
 
86
87
  const ToggleGroupItem = forwardRef(function ToggleGroupItem(
87
88
  { value, tooltip, children, disabled = false }: ItemProps,
88
- forwardedRef: React.ForwardedRef<HTMLButtonElement>,
89
+ forwardedRef: React.ForwardedRef<HTMLButtonElement>
89
90
  ) {
90
91
  const { colorScheme } = useContext(RadioGroupContext);
91
92
 
@@ -112,13 +113,13 @@ type RadioGroupContextValue = {
112
113
  };
113
114
 
114
115
  const RadioGroupContext = createContext<RadioGroupContextValue>({
115
- colorScheme: 'primary',
116
+ colorScheme: "primary",
116
117
  });
117
118
 
118
119
  interface Props {
119
120
  id?: string;
120
121
  value?: string;
121
- onValueChange?: ComponentProps<typeof StyledRoot>['onValueChange'];
122
+ onValueChange?: ComponentProps<typeof StyledRoot>["onValueChange"];
122
123
  colorScheme?: RadioGroupColorScheme;
123
124
  allowEmpty?: boolean;
124
125
  children: ReactNode;
@@ -139,7 +140,7 @@ function ToggleGroupRoot({
139
140
  if (!allowEmpty && !value) return;
140
141
  onValueChange?.(value);
141
142
  },
142
- [allowEmpty, onValueChange],
143
+ [allowEmpty, onValueChange]
143
144
  );
144
145
 
145
146
  return (
@@ -64,6 +64,7 @@ interface StyleProps {
64
64
  pointerEvents?: CSSProperties["pointerEvents"];
65
65
  lineHeight?: CSSProperties["lineHeight"];
66
66
  isolation?: CSSProperties["isolation"];
67
+ backdropFilter?: CSSProperties["backdropFilter"];
67
68
  }
68
69
 
69
70
  export type StackBreakpointList = BreakpointCollection<StyleProps>;
@@ -73,9 +73,8 @@ export type MenuItem<T extends string> =
73
73
  | RegularMenuItem<T>;
74
74
 
75
75
  // Extract type T of RegularMenuItem<T> within MenuItem<T>
76
- export type ExtractMenuItemType<T> = T extends RegularMenuItem<infer U>
77
- ? U
78
- : never;
76
+ export type ExtractMenuItemType<T> =
77
+ T extends RegularMenuItem<infer U> ? U : never;
79
78
 
80
79
  export const CHECKBOX_WIDTH = 15;
81
80
  export const CHECKBOX_RIGHT_INSET = 3;
package/src/theme/dark.ts CHANGED
@@ -34,6 +34,9 @@ export const colors = produce(lightTheme.colors, (colors) => {
34
34
  colors.activeBackground = "rgba(181,178,255,0.08)";
35
35
  colors.thumbnailBackground = "#1f1d33";
36
36
  colors.thumbnailShadow = "#1f1d3366";
37
+ colors.breadcrumb.text = colors.textMuted;
38
+ colors.breadcrumb.textHover = colors.textSubtle;
39
+ colors.breadcrumb.icon = colors.icon;
37
40
  });
38
41
 
39
42
  export { fonts, sizes, textStyles } from "./light";
@@ -34,6 +34,17 @@ export const colors = {
34
34
  activeBackground: "rgba(0,0,0,0.1)",
35
35
  scrollbar: "rgba(199,199,199,0.8)",
36
36
  placeholderDots: "rgba(0,0,0,0.3)",
37
+ breadcrumb: {
38
+ get text() {
39
+ return colors.textMuted;
40
+ },
41
+ get textHover() {
42
+ return colors.textSubtle;
43
+ },
44
+ get icon() {
45
+ return colors.icon;
46
+ },
47
+ },
37
48
  listView: {
38
49
  raisedBackground: "rgba(0,0,0,0.03)",
39
50
  editingBackground: "#fff",