@noya-app/noya-designsystem 0.1.20 → 0.1.22
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 +18 -0
- package/dist/index.d.mts +53 -31
- package/dist/index.d.ts +53 -31
- package/dist/index.js +261 -165
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +297 -205
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -4
- package/src/components/Chip.tsx +90 -78
- package/src/components/ContextMenu.tsx +15 -21
- package/src/components/InputField.tsx +49 -5
- package/src/components/ListView.tsx +9 -0
- package/src/components/Popover.tsx +6 -6
- package/src/components/Select.tsx +1 -1
- package/src/components/SelectMenu.tsx +100 -0
- package/src/components/Stack.tsx +12 -1
- package/src/components/Text.tsx +6 -0
- package/src/components/TreeView.tsx +7 -7
- package/src/components/WorkspaceLayout.tsx +3 -0
- package/src/components/internal/Menu.tsx +2 -2
- package/src/index.tsx +1 -0
- package/src/theme/light.ts +4 -2
- package/src/utils/breakpoints.ts +6 -6
|
@@ -5,10 +5,10 @@ import React, {
|
|
|
5
5
|
ReactNode,
|
|
6
6
|
useCallback,
|
|
7
7
|
useContext,
|
|
8
|
-
} from
|
|
9
|
-
import { IconButton } from
|
|
10
|
-
import { ListView } from
|
|
11
|
-
import { Spacer } from
|
|
8
|
+
} from "react";
|
|
9
|
+
import { IconButton } from "./IconButton";
|
|
10
|
+
import { ListView } from "./ListView";
|
|
11
|
+
import { Spacer } from "./Spacer";
|
|
12
12
|
|
|
13
13
|
/* ----------------------------------------------------------------------------
|
|
14
14
|
* Row
|
|
@@ -31,7 +31,7 @@ const TreeRow = forwardRef(function TreeRow<MenuItemType extends string>(
|
|
|
31
31
|
children,
|
|
32
32
|
...rest
|
|
33
33
|
}: TreeViewRowProps<MenuItemType>,
|
|
34
|
-
forwardedRef: ForwardedRef<HTMLLIElement
|
|
34
|
+
forwardedRef: ForwardedRef<HTMLLIElement>
|
|
35
35
|
) {
|
|
36
36
|
const { expandable } = useContext(ListView.RowContext);
|
|
37
37
|
|
|
@@ -40,7 +40,7 @@ const TreeRow = forwardRef(function TreeRow<MenuItemType extends string>(
|
|
|
40
40
|
event.stopPropagation();
|
|
41
41
|
onClickChevron?.({ altKey: event.altKey });
|
|
42
42
|
},
|
|
43
|
-
[onClickChevron]
|
|
43
|
+
[onClickChevron]
|
|
44
44
|
);
|
|
45
45
|
|
|
46
46
|
return (
|
|
@@ -51,7 +51,7 @@ const TreeRow = forwardRef(function TreeRow<MenuItemType extends string>(
|
|
|
51
51
|
<Spacer.Horizontal size={19} />
|
|
52
52
|
) : (
|
|
53
53
|
<IconButton
|
|
54
|
-
iconName={expanded ?
|
|
54
|
+
iconName={expanded ? "ChevronDownIcon2" : "ChevronRightIcon2"}
|
|
55
55
|
onClick={handleClickChevron}
|
|
56
56
|
selected={rest.selected}
|
|
57
57
|
/>
|
|
@@ -201,6 +201,7 @@ export const WorkspaceLayout = forwardRef(function WorkspaceLayout(
|
|
|
201
201
|
style={{
|
|
202
202
|
display: "flex",
|
|
203
203
|
flexDirection: "row",
|
|
204
|
+
position: "relative",
|
|
204
205
|
}}
|
|
205
206
|
>
|
|
206
207
|
{leftPanelContent}
|
|
@@ -223,6 +224,7 @@ export const WorkspaceLayout = forwardRef(function WorkspaceLayout(
|
|
|
223
224
|
style={{
|
|
224
225
|
display: "flex",
|
|
225
226
|
flexDirection: "row",
|
|
227
|
+
position: "relative",
|
|
226
228
|
}}
|
|
227
229
|
>
|
|
228
230
|
{centerPanelContent}
|
|
@@ -247,6 +249,7 @@ export const WorkspaceLayout = forwardRef(function WorkspaceLayout(
|
|
|
247
249
|
style={{
|
|
248
250
|
display: "flex",
|
|
249
251
|
flexDirection: "row",
|
|
252
|
+
position: "relative",
|
|
250
253
|
}}
|
|
251
254
|
>
|
|
252
255
|
{rightPanelContent}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getShortcutDisplayParts } from "@noya-app/noya-keymap";
|
|
2
|
-
import React, { memo,
|
|
2
|
+
import React, { memo, ReactNode } from "react";
|
|
3
3
|
import styled, { CSSObject } from "styled-components";
|
|
4
4
|
import { useDesignSystemConfiguration } from "../../contexts/DesignSystemConfiguration";
|
|
5
5
|
import { Theme } from "../../theme";
|
|
@@ -63,7 +63,7 @@ export type RegularMenuItem<T extends string> = {
|
|
|
63
63
|
shortcut?: string;
|
|
64
64
|
checked?: boolean;
|
|
65
65
|
disabled?: boolean;
|
|
66
|
-
icon?:
|
|
66
|
+
icon?: ReactNode;
|
|
67
67
|
items?: MenuItem<T>[];
|
|
68
68
|
role?: MenuItemRole;
|
|
69
69
|
};
|
package/src/index.tsx
CHANGED
|
@@ -41,6 +41,7 @@ export * from "./components/Progress";
|
|
|
41
41
|
export * from "./components/RadioGroup";
|
|
42
42
|
export * from "./components/ScrollArea";
|
|
43
43
|
export * from "./components/Select";
|
|
44
|
+
export * from "./components/SelectMenu";
|
|
44
45
|
export * from "./components/Slider";
|
|
45
46
|
export * from "./components/Sortable";
|
|
46
47
|
export type { RelativeDropPosition } from "./components/Sortable";
|
package/src/theme/light.ts
CHANGED
|
@@ -162,7 +162,8 @@ export const textStyles = {
|
|
|
162
162
|
fontFamily: fonts.normal,
|
|
163
163
|
fontSize: `${typeScale[6]}rem`,
|
|
164
164
|
fontWeight: 400,
|
|
165
|
-
lineHeight: "
|
|
165
|
+
lineHeight: "19px",
|
|
166
|
+
// lineHeight: "1.4",
|
|
166
167
|
} as CSSObject,
|
|
167
168
|
button: {
|
|
168
169
|
fontFamily: fonts.normal,
|
|
@@ -180,7 +181,8 @@ export const textStyles = {
|
|
|
180
181
|
fontFamily: fonts.normal,
|
|
181
182
|
fontSize: "0.62rem",
|
|
182
183
|
fontWeight: 400,
|
|
183
|
-
lineHeight: "
|
|
184
|
+
lineHeight: "19px",
|
|
185
|
+
// lineHeight: "1.4",
|
|
184
186
|
textTransform: "uppercase",
|
|
185
187
|
letterSpacing: "-0.3px",
|
|
186
188
|
} as CSSObject,
|
package/src/utils/breakpoints.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CSSObject } from
|
|
1
|
+
import { CSSObject } from "styled-components";
|
|
2
2
|
|
|
3
3
|
type BreakpointKey = number | string;
|
|
4
4
|
|
|
@@ -11,15 +11,15 @@ export type BreakpointCollection<T extends object> =
|
|
|
11
11
|
export type StyleMap = Record<string, CSSObject>;
|
|
12
12
|
|
|
13
13
|
export function mergeBreakpoints(
|
|
14
|
-
breakpoints: BreakpointCollection<CSSObject
|
|
14
|
+
breakpoints: BreakpointCollection<CSSObject>
|
|
15
15
|
): StyleMap;
|
|
16
16
|
export function mergeBreakpoints<T extends object>(
|
|
17
17
|
breakpoints: BreakpointCollection<T>,
|
|
18
|
-
transform?: (value: T) => CSSObject
|
|
18
|
+
transform?: (value: T) => CSSObject
|
|
19
19
|
): StyleMap;
|
|
20
20
|
export function mergeBreakpoints<T extends object>(
|
|
21
21
|
breakpoints: BreakpointCollection<T>,
|
|
22
|
-
transform?: (value: T) => CSSObject
|
|
22
|
+
transform?: (value: T) => CSSObject
|
|
23
23
|
): StyleMap {
|
|
24
24
|
const breakpointMap = Array.isArray(breakpoints)
|
|
25
25
|
? breakpoints.reduce(
|
|
@@ -28,7 +28,7 @@ export function mergeBreakpoints<T extends object>(
|
|
|
28
28
|
result[key] = result[key] ? { ...result[key], ...value } : value;
|
|
29
29
|
return result;
|
|
30
30
|
},
|
|
31
|
-
{}
|
|
31
|
+
{}
|
|
32
32
|
)
|
|
33
33
|
: breakpoints;
|
|
34
34
|
|
|
@@ -37,7 +37,7 @@ export function mergeBreakpoints<T extends object>(
|
|
|
37
37
|
const transformedList = breakpointList
|
|
38
38
|
.sort((a, b) => Number(b[0]) - Number(a[0]))
|
|
39
39
|
.map(([width, value]: Breakpoint<T>) => [
|
|
40
|
-
`@media
|
|
40
|
+
`@media (min-width: ${width}px)`,
|
|
41
41
|
transform?.(value) ?? value,
|
|
42
42
|
]);
|
|
43
43
|
|