@noya-app/noya-designsystem 0.1.36 → 0.1.38
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 +10 -10
- package/CHANGELOG.md +12 -0
- package/dist/index.css +1 -1
- package/dist/index.d.mts +358 -33
- package/dist/index.d.ts +358 -33
- package/dist/index.js +1227 -854
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1010 -626
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/components/Button.tsx +1 -1
- package/src/components/Checkbox.tsx +78 -0
- package/src/components/Chip.tsx +15 -8
- package/src/components/DraggableMenuButton.tsx +3 -2
- package/src/components/FillPreviewBackground.tsx +10 -9
- package/src/components/FloatingWindow.tsx +5 -6
- package/src/components/IconButton.tsx +5 -1
- package/src/components/InputField.tsx +95 -68
- package/src/components/InspectorContainer.tsx +2 -2
- package/src/components/InspectorPrimitives.tsx +19 -9
- package/src/components/Label.tsx +16 -29
- package/src/components/ListView.tsx +19 -32
- package/src/components/RadioGroup.tsx +1 -1
- package/src/components/SelectMenu.tsx +41 -35
- package/src/components/Switch.tsx +5 -2
- package/src/components/Text.tsx +20 -7
- package/src/components/TextArea.tsx +1 -1
- package/src/components/Tooltip.tsx +1 -1
- package/src/components/WorkspaceLayout.tsx +4 -3
- package/src/components/internal/TextInput.tsx +1 -0
- package/src/index.css +12 -2
- package/src/index.tsx +1 -1
- package/src/theme/index.ts +6 -3
- package/src/theme/themeUtils.ts +72 -0
- package/src/utils/tailwind.ts +4 -12
- package/src/utils/withSeparatorElements.ts +29 -3
- package/tailwind.config.ts +19 -5
- package/tsconfig.json +1 -1
|
@@ -1,4 +1,26 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
Children,
|
|
3
|
+
cloneElement,
|
|
4
|
+
Fragment,
|
|
5
|
+
isValidElement,
|
|
6
|
+
ReactNode,
|
|
7
|
+
} from "react";
|
|
8
|
+
|
|
9
|
+
interface SeparatorOptions {
|
|
10
|
+
traverseFragments?: boolean;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
function flattenChildren(
|
|
14
|
+
children: ReactNode,
|
|
15
|
+
traverseFragments: boolean
|
|
16
|
+
): ReactNode[] {
|
|
17
|
+
return Children.toArray(children).flatMap((child) => {
|
|
18
|
+
if (traverseFragments && isValidElement(child) && child.type === Fragment) {
|
|
19
|
+
return flattenChildren(child.props.children, traverseFragments);
|
|
20
|
+
}
|
|
21
|
+
return child;
|
|
22
|
+
});
|
|
23
|
+
}
|
|
2
24
|
|
|
3
25
|
function createKey(key: string | number) {
|
|
4
26
|
return `s-${key}`;
|
|
@@ -6,9 +28,13 @@ function createKey(key: string | number) {
|
|
|
6
28
|
|
|
7
29
|
export default function withSeparatorElements(
|
|
8
30
|
elements: ReactNode,
|
|
9
|
-
separator: ReactNode | (() => ReactNode)
|
|
31
|
+
separator: ReactNode | (() => ReactNode),
|
|
32
|
+
options?: SeparatorOptions
|
|
10
33
|
) {
|
|
11
|
-
const childrenArray =
|
|
34
|
+
const childrenArray = flattenChildren(
|
|
35
|
+
elements,
|
|
36
|
+
options?.traverseFragments ?? true
|
|
37
|
+
);
|
|
12
38
|
|
|
13
39
|
for (let i = childrenArray.length - 1; i > 0; i--) {
|
|
14
40
|
let sep =
|
package/tailwind.config.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Config } from "tailwindcss";
|
|
1
|
+
import type { Config } from "tailwindcss";
|
|
2
2
|
|
|
3
|
-
const config
|
|
3
|
+
const config = {
|
|
4
4
|
content: ["./src/**/*.{ts,tsx}"],
|
|
5
5
|
corePlugins: {
|
|
6
6
|
// disables @tailwind base global styles
|
|
@@ -66,6 +66,14 @@ const config: Config = {
|
|
|
66
66
|
dot: "var(--dot)",
|
|
67
67
|
"row-highlight": "var(--row-highlight)",
|
|
68
68
|
"table-row-background": "var(--table-row-background)",
|
|
69
|
+
"chip-primary-bg": "var(--chip-primary-bg)",
|
|
70
|
+
"chip-secondary-bg": "var(--chip-secondary-bg)",
|
|
71
|
+
"chip-error-bg": "var(--chip-error-bg)",
|
|
72
|
+
"chip-default-bg": "var(--chip-default-bg)",
|
|
73
|
+
"chip-primary-shadow": "var(--chip-primary-shadow)",
|
|
74
|
+
"chip-secondary-shadow": "var(--chip-secondary-shadow)",
|
|
75
|
+
"chip-error-shadow": "var(--chip-error-shadow)",
|
|
76
|
+
"chip-default-shadow": "var(--chip-default-shadow)",
|
|
69
77
|
},
|
|
70
78
|
fontFamily: {
|
|
71
79
|
sans: [
|
|
@@ -200,6 +208,10 @@ const config: Config = {
|
|
|
200
208
|
spin: "spin 1s linear infinite",
|
|
201
209
|
shimmer: "shimmer 6s infinite linear",
|
|
202
210
|
},
|
|
211
|
+
zIndex: {
|
|
212
|
+
interactable: "var(--interactable-z-index)",
|
|
213
|
+
label: "var(--label-z-index)",
|
|
214
|
+
}
|
|
203
215
|
},
|
|
204
216
|
},
|
|
205
217
|
safelist: [
|
|
@@ -216,8 +228,10 @@ const config: Config = {
|
|
|
216
228
|
"underline",
|
|
217
229
|
"-left-2.5",
|
|
218
230
|
"-mr-2",
|
|
219
|
-
"border-gray-200"
|
|
231
|
+
"border-gray-200",
|
|
232
|
+
"gap-1.5",
|
|
233
|
+
"gap-toolbar-separator",
|
|
220
234
|
],
|
|
221
|
-
};
|
|
235
|
+
} satisfies Config;
|
|
222
236
|
|
|
223
|
-
export default config
|
|
237
|
+
export default config;
|