@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.
- package/.turbo/turbo-build.log +9 -9
- package/CHANGELOG.md +17 -0
- package/dist/index.d.mts +60 -31
- package/dist/index.d.ts +60 -31
- package/dist/index.js +273 -166
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +309 -206
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -4
- package/src/components/Button.tsx +2 -2
- package/src/components/Chip.tsx +88 -76
- package/src/components/ContextMenu.tsx +15 -21
- package/src/components/InputField.tsx +52 -4
- package/src/components/ListView.tsx +27 -1
- package/src/components/Popover.tsx +6 -6
- package/src/components/Select.tsx +2 -2
- 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 +2 -1
- package/src/utils/breakpoints.ts +6 -6
package/src/components/Text.tsx
CHANGED
|
@@ -61,6 +61,8 @@ interface Props extends StyleProps {
|
|
|
61
61
|
children: ReactNode;
|
|
62
62
|
onClick?: () => void;
|
|
63
63
|
onDoubleClick?: () => void;
|
|
64
|
+
onKeyDown?: (event: React.KeyboardEvent<HTMLSpanElement>) => void;
|
|
65
|
+
tabIndex?: number;
|
|
64
66
|
}
|
|
65
67
|
|
|
66
68
|
const StyledElement = styled.span<{
|
|
@@ -84,7 +86,9 @@ export const Text = forwardRef(function Text(
|
|
|
84
86
|
className,
|
|
85
87
|
color,
|
|
86
88
|
href,
|
|
89
|
+
tabIndex,
|
|
87
90
|
onClick,
|
|
91
|
+
onKeyDown,
|
|
88
92
|
...rest
|
|
89
93
|
}: Props,
|
|
90
94
|
forwardedRef: ForwardedRef<HTMLElement>
|
|
@@ -96,11 +100,13 @@ export const Text = forwardRef(function Text(
|
|
|
96
100
|
ref={forwardedRef}
|
|
97
101
|
as={element}
|
|
98
102
|
className={className}
|
|
103
|
+
tabIndex={tabIndex}
|
|
99
104
|
$variant={variant}
|
|
100
105
|
$breakpoints={breakpoints}
|
|
101
106
|
$styleProps={rest}
|
|
102
107
|
$color={color}
|
|
103
108
|
onClick={onClick}
|
|
109
|
+
onKeyDown={onKeyDown}
|
|
104
110
|
{...((href && { href }) as any)}
|
|
105
111
|
>
|
|
106
112
|
{children}
|
|
@@ -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
|
@@ -181,7 +181,8 @@ export const textStyles = {
|
|
|
181
181
|
fontFamily: fonts.normal,
|
|
182
182
|
fontSize: "0.62rem",
|
|
183
183
|
fontWeight: 400,
|
|
184
|
-
lineHeight: "
|
|
184
|
+
lineHeight: "19px",
|
|
185
|
+
// lineHeight: "1.4",
|
|
185
186
|
textTransform: "uppercase",
|
|
186
187
|
letterSpacing: "-0.3px",
|
|
187
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
|
|