@noya-app/noya-designsystem 0.1.21 → 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 +11 -0
- package/dist/index.d.mts +53 -31
- package/dist/index.d.ts +53 -31
- package/dist/index.js +248 -159
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +284 -199
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -4
- package/src/components/Chip.tsx +88 -76
- package/src/components/ContextMenu.tsx +15 -21
- package/src/components/InputField.tsx +41 -3
- 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 +2 -1
- package/src/utils/breakpoints.ts +6 -6
|
@@ -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
|
|