@noya-app/noya-designsystem 0.1.49 → 0.1.50
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 +11 -0
- package/dist/index.css +1 -1
- package/dist/index.d.mts +137 -12
- package/dist/index.d.ts +137 -12
- package/dist/index.js +1627 -1129
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1582 -1102
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -5
- package/src/components/Avatar.tsx +2 -2
- package/src/components/Banner.tsx +29 -0
- package/src/components/Button.tsx +2 -2
- package/src/components/Chip.tsx +8 -8
- package/src/components/Collection.tsx +6 -1
- package/src/components/Dialog.tsx +2 -2
- package/src/components/FillInputField.tsx +1 -1
- package/src/components/Grid.tsx +1 -3
- package/src/components/Label.tsx +11 -6
- package/src/components/LabeledField.tsx +6 -1
- package/src/components/List.tsx +4 -4
- package/src/components/ListView.tsx +10 -5
- package/src/components/MediaThumbnail.tsx +11 -3
- package/src/components/Popover.tsx +9 -6
- package/src/components/Section.tsx +172 -0
- package/src/components/SelectMenu.tsx +1 -1
- package/src/components/Slider.tsx +1 -1
- package/src/components/Sortable.tsx +124 -22
- package/src/components/UserPointer.tsx +1 -1
- package/src/components/ai-assistant/AIAssistantLayout.tsx +102 -0
- package/src/components/connected-users-menu/ConnectedUsersMenuLayout.tsx +71 -0
- package/src/components/file-explorer/FileExplorerLayout.tsx +71 -0
- package/src/components/internal/Menu.tsx +12 -7
- package/src/components/pipeline/PipelineResultLayout.tsx +32 -0
- package/src/index.css +118 -118
- package/src/index.tsx +7 -0
- package/src/utils/classNames.ts +27 -2
- package/src/utils/moveTreeItem.ts +99 -0
- package/tailwind.config.ts +79 -79
package/src/index.css
CHANGED
|
@@ -3,125 +3,125 @@
|
|
|
3
3
|
@tailwind utilities;
|
|
4
4
|
|
|
5
5
|
:root {
|
|
6
|
-
--logo-fill: rgb(150, 152, 172);
|
|
7
|
-
--logo-highlight: rgb(150, 152, 172);
|
|
8
|
-
--background: rgb(255, 255, 255);
|
|
9
|
-
--text: rgb(38, 48, 83);
|
|
10
|
-
--text-muted: rgb(107, 113, 136);
|
|
11
|
-
--text-subtle: rgb(117, 121, 129);
|
|
12
|
-
--text-disabled: rgb(150, 152, 172);
|
|
13
|
-
--text-decorative-light: rgb(168, 185, 212);
|
|
14
|
-
--divider-subtle: rgba(30, 50, 100, 0.04);
|
|
15
|
-
--divider: rgba(30, 50, 100, 0.07);
|
|
16
|
-
--divider-strong: rgba(30, 50, 100, 0.09);
|
|
17
|
-
--primary: rgb(103, 70, 255);
|
|
18
|
-
--primary-light: rgb(147, 86, 255);
|
|
19
|
-
--primary-pastel: rgba(234, 230, 255);
|
|
20
|
-
--secondary: rgb(0, 151, 117);
|
|
21
|
-
--secondary-light: rgb(0, 160, 129);
|
|
22
|
-
--secondary-pastel: rgb(205, 238, 231);
|
|
23
|
-
--secondary-bright: #0ab557;
|
|
24
|
-
--input-background-light: rgb(243, 245, 249);
|
|
25
|
-
--code-background: rgb(250, 250, 250);
|
|
26
|
-
--code-background-dark: #435080;
|
|
27
|
-
--selected-background: rgb(242, 245, 250);
|
|
28
|
-
--breadcrumb-text: rgb(107, 113, 136);
|
|
29
|
-
--breadcrumb-text-hover: rgb(117, 121, 129);
|
|
30
|
-
--breadcrumb-icon: rgb(129, 131, 165);
|
|
31
|
-
--canvas-background: rgb(249, 249, 249);
|
|
32
|
-
--canvas-grid: rgba(0, 0, 0, 0.05);
|
|
33
|
-
--sidebar-background: rgb(255, 255, 255);
|
|
34
|
-
--sidebar-background-transparent: rgba(255, 255, 255, 0.85);
|
|
35
|
-
--popover-background: rgb(252, 252, 252);
|
|
36
|
-
--popover-divider: transparent;
|
|
37
|
-
--listview-raised-background: rgba(0, 0, 0, 0.03);
|
|
38
|
-
--listview-editing-background: #fff;
|
|
39
|
-
--input-background: rgb(240, 242, 246);
|
|
40
|
-
--list-view-hover-background: rgb(244, 246, 250);
|
|
41
|
-
--list-view-thumbnail-background: var(--input-background);
|
|
42
|
-
--slider-thumb-background: white;
|
|
43
|
-
--slider-border: #9698ac;
|
|
44
|
-
--mask: rgb(12, 193, 67);
|
|
45
|
-
--transparent-checker: rgba(255, 255, 255, 0.8);
|
|
46
|
-
--scrollbar: rgba(199, 199, 199, 0.8);
|
|
47
|
-
--placeholder-dots: rgba(0, 0, 0, 0.3);
|
|
48
|
-
--drag-outline: rgb(103, 70, 255);
|
|
49
|
-
--active-background: rgba(0, 0, 0, 0.1);
|
|
50
|
-
--thumbnail-background: #f0efff;
|
|
51
|
-
--thumbnail-shadow: #d3ceed66;
|
|
52
|
-
--inline-code-text: rgb(103, 70, 255);
|
|
53
|
-
--inline-code-background: rgb(240, 242, 246);
|
|
54
|
-
--text-link: rgb(103, 70, 255);
|
|
55
|
-
--text-link-focused: rgb(147, 86, 255);
|
|
56
|
-
--inset-top: 46px;
|
|
57
|
-
--sidebar-width: 260px;
|
|
58
|
-
--toolbar-height: 46px;
|
|
59
|
-
--toolbar-separator: 8px;
|
|
60
|
-
--inspector-h-separator: 8px;
|
|
61
|
-
--inspector-v-separator: 10px;
|
|
62
|
-
--dialog-padding: 16px;
|
|
63
|
-
--input-height: 27px;
|
|
64
|
-
--icon: rgb(129, 131, 165);
|
|
65
|
-
--icon-selected: rgb(220, 220, 220);
|
|
66
|
-
--warning: rgb(251, 211, 0);
|
|
67
|
-
--segmented-control-item: rgb(139, 139, 139);
|
|
68
|
-
--dot: rgba(0, 0, 0, 0.25);
|
|
69
|
-
--row-highlight: #3390ff10;
|
|
70
|
-
--table-row-background: var(--background);
|
|
71
|
-
--interactable-z-index: 2;
|
|
72
|
-
--label-z-index: 3;
|
|
73
|
-
--menu-z-index: 5000;
|
|
74
|
-
--chip-primary-bg: rgba(238, 229, 255, 0.2);
|
|
75
|
-
--chip-secondary-bg: rgba(205, 238, 231, 0.2);
|
|
76
|
-
--chip-error-bg: rgba(255, 219, 219, 0.2);
|
|
77
|
-
--chip-default-bg: rgba(0, 0, 0, 0.1);
|
|
78
|
-
--chip-primary-shadow: rgb(238, 229, 255);
|
|
79
|
-
--chip-secondary-shadow: rgb(205, 238, 231);
|
|
80
|
-
--chip-error-shadow: rgb(255, 219, 219);
|
|
81
|
-
--chip-default-shadow: rgb(0, 0, 0);
|
|
82
|
-
--floating-button: rgb(248, 248, 250);
|
|
83
|
-
--block-border: rgb(184, 201, 218);
|
|
84
|
-
--block-highlight: rgb(255, 165, 0);
|
|
6
|
+
--n-logo-fill: rgb(150, 152, 172);
|
|
7
|
+
--n-logo-highlight: rgb(150, 152, 172);
|
|
8
|
+
--n-background: rgb(255, 255, 255);
|
|
9
|
+
--n-text: rgb(38, 48, 83);
|
|
10
|
+
--n-text-muted: rgb(107, 113, 136);
|
|
11
|
+
--n-text-subtle: rgb(117, 121, 129);
|
|
12
|
+
--n-text-disabled: rgb(150, 152, 172);
|
|
13
|
+
--n-text-decorative-light: rgb(168, 185, 212);
|
|
14
|
+
--n-divider-subtle: rgba(30, 50, 100, 0.04);
|
|
15
|
+
--n-divider: rgba(30, 50, 100, 0.07);
|
|
16
|
+
--n-divider-strong: rgba(30, 50, 100, 0.09);
|
|
17
|
+
--n-primary: rgb(103, 70, 255);
|
|
18
|
+
--n-primary-light: rgb(147, 86, 255);
|
|
19
|
+
--n-primary-pastel: rgba(234, 230, 255);
|
|
20
|
+
--n-secondary: rgb(0, 151, 117);
|
|
21
|
+
--n-secondary-light: rgb(0, 160, 129);
|
|
22
|
+
--n-secondary-pastel: rgb(205, 238, 231);
|
|
23
|
+
--n-secondary-bright: #0ab557;
|
|
24
|
+
--n-input-background-light: rgb(243, 245, 249);
|
|
25
|
+
--n-code-background: rgb(250, 250, 250);
|
|
26
|
+
--n-code-background-dark: #435080;
|
|
27
|
+
--n-selected-background: rgb(242, 245, 250);
|
|
28
|
+
--n-breadcrumb-text: rgb(107, 113, 136);
|
|
29
|
+
--n-breadcrumb-text-hover: rgb(117, 121, 129);
|
|
30
|
+
--n-breadcrumb-icon: rgb(129, 131, 165);
|
|
31
|
+
--n-canvas-background: rgb(249, 249, 249);
|
|
32
|
+
--n-canvas-grid: rgba(0, 0, 0, 0.05);
|
|
33
|
+
--n-sidebar-background: rgb(255, 255, 255);
|
|
34
|
+
--n-sidebar-background-transparent: rgba(255, 255, 255, 0.85);
|
|
35
|
+
--n-popover-background: rgb(252, 252, 252);
|
|
36
|
+
--n-popover-divider: transparent;
|
|
37
|
+
--n-listview-raised-background: rgba(0, 0, 0, 0.03);
|
|
38
|
+
--n-listview-editing-background: #fff;
|
|
39
|
+
--n-input-background: rgb(240, 242, 246);
|
|
40
|
+
--n-list-view-hover-background: rgb(244, 246, 250);
|
|
41
|
+
--n-list-view-thumbnail-background: var(--n-input-background);
|
|
42
|
+
--n-slider-thumb-background: white;
|
|
43
|
+
--n-slider-border: #9698ac;
|
|
44
|
+
--n-mask: rgb(12, 193, 67);
|
|
45
|
+
--n-transparent-checker: rgba(255, 255, 255, 0.8);
|
|
46
|
+
--n-scrollbar: rgba(199, 199, 199, 0.8);
|
|
47
|
+
--n-placeholder-dots: rgba(0, 0, 0, 0.3);
|
|
48
|
+
--n-drag-outline: rgb(103, 70, 255);
|
|
49
|
+
--n-active-background: rgba(0, 0, 0, 0.1);
|
|
50
|
+
--n-thumbnail-background: #f0efff;
|
|
51
|
+
--n-thumbnail-shadow: #d3ceed66;
|
|
52
|
+
--n-inline-code-text: rgb(103, 70, 255);
|
|
53
|
+
--n-inline-code-background: rgb(240, 242, 246);
|
|
54
|
+
--n-text-link: rgb(103, 70, 255);
|
|
55
|
+
--n-text-link-focused: rgb(147, 86, 255);
|
|
56
|
+
--n-inset-top: 46px;
|
|
57
|
+
--n-sidebar-width: 260px;
|
|
58
|
+
--n-toolbar-height: 46px;
|
|
59
|
+
--n-toolbar-separator: 8px;
|
|
60
|
+
--n-inspector-h-separator: 8px;
|
|
61
|
+
--n-inspector-v-separator: 10px;
|
|
62
|
+
--n-dialog-padding: 16px;
|
|
63
|
+
--n-input-height: 27px;
|
|
64
|
+
--n-icon: rgb(129, 131, 165);
|
|
65
|
+
--n-icon-selected: rgb(220, 220, 220);
|
|
66
|
+
--n-warning: rgb(251, 211, 0);
|
|
67
|
+
--n-segmented-control-item: rgb(139, 139, 139);
|
|
68
|
+
--n-dot: rgba(0, 0, 0, 0.25);
|
|
69
|
+
--n-row-highlight: #3390ff10;
|
|
70
|
+
--n-table-row-background: var(--n-background);
|
|
71
|
+
--n-interactable-z-index: 2;
|
|
72
|
+
--n-label-z-index: 3;
|
|
73
|
+
--n-menu-z-index: 5000;
|
|
74
|
+
--n-chip-primary-bg: rgba(238, 229, 255, 0.2);
|
|
75
|
+
--n-chip-secondary-bg: rgba(205, 238, 231, 0.2);
|
|
76
|
+
--n-chip-error-bg: rgba(255, 219, 219, 0.2);
|
|
77
|
+
--n-chip-default-bg: rgba(0, 0, 0, 0.1);
|
|
78
|
+
--n-chip-primary-shadow: rgb(238, 229, 255);
|
|
79
|
+
--n-chip-secondary-shadow: rgb(205, 238, 231);
|
|
80
|
+
--n-chip-error-shadow: rgb(255, 219, 219);
|
|
81
|
+
--n-chip-default-shadow: rgb(0, 0, 0);
|
|
82
|
+
--n-floating-button: rgb(248, 248, 250);
|
|
83
|
+
--n-block-border: rgb(184, 201, 218);
|
|
84
|
+
--n-block-highlight: rgb(255, 165, 0);
|
|
85
85
|
}
|
|
86
86
|
|
|
87
87
|
[data-theme="dark"] {
|
|
88
|
-
--background: #111111;
|
|
89
|
-
--logo-fill: rgb(248, 248, 250);
|
|
90
|
-
--logo-highlight: rgb(248, 248, 250);
|
|
91
|
-
--text: rgb(248, 248, 250);
|
|
92
|
-
--text-muted: rgb(180, 179, 182);
|
|
93
|
-
--text-subtle: rgb(180, 179, 182);
|
|
94
|
-
--text-disabled: rgb(115, 114, 126);
|
|
95
|
-
--divider-subtle: rgba(255, 255, 255, 0.04);
|
|
96
|
-
--divider: rgba(255, 255, 255, 0.08);
|
|
97
|
-
--divider-strong: rgba(0, 0, 0, 1);
|
|
98
|
-
--primary: rgb(119, 66, 255);
|
|
99
|
-
--primary-light: rgb(134, 86, 255);
|
|
100
|
-
--secondary-bright: #36fe91;
|
|
101
|
-
--input-background: rgba(181, 178, 255, 0.08);
|
|
102
|
-
--input-background-light: rgba(181, 178, 255, 0.1);
|
|
103
|
-
--code-background: rgb(20, 19, 23);
|
|
104
|
-
--canvas-background: rgb(20, 19, 23);
|
|
105
|
-
--canvas-grid: rgba(0, 0, 0, 0.1);
|
|
106
|
-
--sidebar-background: rgb(34, 33, 39);
|
|
107
|
-
--sidebar-background-transparent: rgba(34, 33, 39, 0.95);
|
|
108
|
-
--popover-background: rgb(34, 33, 39);
|
|
109
|
-
--popover-divider: rgba(255, 255, 255, 0.08);
|
|
110
|
-
--listview-raised-background: rgba(181, 178, 255, 0.1);
|
|
111
|
-
--listview-editing-background: #000;
|
|
112
|
-
--list-view-hover-background: var(--input-background-light);
|
|
113
|
-
--list-view-thumbnail-background: var(--input-background);
|
|
114
|
-
--slider-thumb-background: var(--input-background-light);
|
|
115
|
-
--slider-border: var(--divider);
|
|
116
|
-
--mask: rgb(102, 187, 106);
|
|
117
|
-
--transparent-checker: rgba(255, 255, 255, 0.3);
|
|
118
|
-
--scrollbar: rgba(199, 199, 199, 0.2);
|
|
119
|
-
--placeholder-dots: rgba(255, 255, 255, 0.3);
|
|
120
|
-
--drag-outline: white;
|
|
121
|
-
--active-background: rgba(181, 178, 255, 0.08);
|
|
122
|
-
--thumbnail-background: #1f1d33;
|
|
123
|
-
--thumbnail-shadow: #1f1d3366;
|
|
124
|
-
--dot: rgba(255, 255, 255, 0.15);
|
|
125
|
-
--table-row-background: var(--sidebar-background);
|
|
126
|
-
--floating-button: #333333;
|
|
88
|
+
--n-background: #111111;
|
|
89
|
+
--n-logo-fill: rgb(248, 248, 250);
|
|
90
|
+
--n-logo-highlight: rgb(248, 248, 250);
|
|
91
|
+
--n-text: rgb(248, 248, 250);
|
|
92
|
+
--n-text-muted: rgb(180, 179, 182);
|
|
93
|
+
--n-text-subtle: rgb(180, 179, 182);
|
|
94
|
+
--n-text-disabled: rgb(115, 114, 126);
|
|
95
|
+
--n-divider-subtle: rgba(255, 255, 255, 0.04);
|
|
96
|
+
--n-divider: rgba(255, 255, 255, 0.08);
|
|
97
|
+
--n-divider-strong: rgba(0, 0, 0, 1);
|
|
98
|
+
--n-primary: rgb(119, 66, 255);
|
|
99
|
+
--n-primary-light: rgb(134, 86, 255);
|
|
100
|
+
--n-secondary-bright: #36fe91;
|
|
101
|
+
--n-input-background: rgba(181, 178, 255, 0.08);
|
|
102
|
+
--n-input-background-light: rgba(181, 178, 255, 0.1);
|
|
103
|
+
--n-code-background: rgb(20, 19, 23);
|
|
104
|
+
--n-canvas-background: rgb(20, 19, 23);
|
|
105
|
+
--n-canvas-grid: rgba(0, 0, 0, 0.1);
|
|
106
|
+
--n-sidebar-background: rgb(34, 33, 39);
|
|
107
|
+
--n-sidebar-background-transparent: rgba(34, 33, 39, 0.95);
|
|
108
|
+
--n-popover-background: rgb(34, 33, 39);
|
|
109
|
+
--n-popover-divider: rgba(255, 255, 255, 0.08);
|
|
110
|
+
--n-listview-raised-background: rgba(181, 178, 255, 0.1);
|
|
111
|
+
--n-listview-editing-background: #000;
|
|
112
|
+
--n-list-view-hover-background: var(--n-input-background-light);
|
|
113
|
+
--n-list-view-thumbnail-background: var(--n-input-background);
|
|
114
|
+
--n-slider-thumb-background: var(--n-input-background-light);
|
|
115
|
+
--n-slider-border: var(--n-divider);
|
|
116
|
+
--n-mask: rgb(102, 187, 106);
|
|
117
|
+
--n-transparent-checker: rgba(255, 255, 255, 0.3);
|
|
118
|
+
--n-scrollbar: rgba(199, 199, 199, 0.2);
|
|
119
|
+
--n-placeholder-dots: rgba(255, 255, 255, 0.3);
|
|
120
|
+
--n-drag-outline: white;
|
|
121
|
+
--n-active-background: rgba(181, 178, 255, 0.08);
|
|
122
|
+
--n-thumbnail-background: #1f1d33;
|
|
123
|
+
--n-thumbnail-shadow: #1f1d3366;
|
|
124
|
+
--n-dot: rgba(255, 255, 255, 0.15);
|
|
125
|
+
--n-table-row-background: var(--n-sidebar-background);
|
|
126
|
+
--n-floating-button: #333333;
|
|
127
127
|
}
|
package/src/index.tsx
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
// Components
|
|
2
2
|
export * from "./components/ActionMenu";
|
|
3
3
|
export * from "./components/ActivityIndicator";
|
|
4
|
+
export * from "./components/ai-assistant/AIAssistantLayout";
|
|
4
5
|
export * from "./components/AnimatePresence";
|
|
5
6
|
export * from "./components/Avatar";
|
|
7
|
+
export * from "./components/Banner";
|
|
6
8
|
export * from "./components/Breadcrumbs";
|
|
7
9
|
export * from "./components/Button";
|
|
8
10
|
export * from "./components/Checkbox";
|
|
@@ -11,6 +13,7 @@ export * from "./components/Collection";
|
|
|
11
13
|
export * from "./components/Combobox";
|
|
12
14
|
export * from "./components/ComboboxMenu";
|
|
13
15
|
export * from "./components/CommandPalette";
|
|
16
|
+
export * from "./components/connected-users-menu/ConnectedUsersMenuLayout";
|
|
14
17
|
export * from "./components/ContextMenu";
|
|
15
18
|
export * from "./components/Dialog";
|
|
16
19
|
export * from "./components/Divider";
|
|
@@ -19,6 +22,7 @@ export * from "./components/Drawer";
|
|
|
19
22
|
export * from "./components/DropdownMenu";
|
|
20
23
|
export * from "./components/EditableText";
|
|
21
24
|
export * from "./components/Fade";
|
|
25
|
+
export * from "./components/file-explorer/FileExplorerLayout";
|
|
22
26
|
export * from "./components/FillInputField";
|
|
23
27
|
export * from "./components/FillPreviewBackground";
|
|
24
28
|
export * from "./components/FloatingWindow";
|
|
@@ -44,10 +48,12 @@ export * from "./components/ListView";
|
|
|
44
48
|
export * from "./components/MediaThumbnail";
|
|
45
49
|
export * from "./components/Message";
|
|
46
50
|
export * from "./components/NoyaLogo";
|
|
51
|
+
export * from "./components/pipeline/PipelineResultLayout";
|
|
47
52
|
export * from "./components/Popover";
|
|
48
53
|
export * from "./components/Progress";
|
|
49
54
|
export * from "./components/ScrollArea";
|
|
50
55
|
export * from "./components/SearchCompletionMenu";
|
|
56
|
+
export * from "./components/Section";
|
|
51
57
|
export * from "./components/SegmentedControl";
|
|
52
58
|
export * from "./components/SelectMenu";
|
|
53
59
|
export * from "./components/Slider";
|
|
@@ -85,6 +91,7 @@ export * from "./utils/getGradientBackground";
|
|
|
85
91
|
export * from "./utils/colorFromString";
|
|
86
92
|
export * from "./utils/combobox";
|
|
87
93
|
export * from "./utils/fuzzyScorer";
|
|
94
|
+
export * from "./utils/moveTreeItem";
|
|
88
95
|
export * from "./utils/selection";
|
|
89
96
|
export * from "./utils/sketchColor";
|
|
90
97
|
export * from "./utils/sketchPattern";
|
package/src/utils/classNames.ts
CHANGED
|
@@ -1,18 +1,43 @@
|
|
|
1
1
|
import tailwindConfig from "../../tailwind.config";
|
|
2
2
|
|
|
3
3
|
type ClassNameItem = string | number | BigInt | boolean | null | undefined;
|
|
4
|
-
type Category = "text" | "flex";
|
|
4
|
+
type Category = "text" | "color" | "font" | "flex";
|
|
5
5
|
type Options = {
|
|
6
6
|
categories?: Category[];
|
|
7
7
|
};
|
|
8
8
|
|
|
9
|
+
const colorKeys = Object.keys(tailwindConfig.theme.extend.colors).map(
|
|
10
|
+
(key) => `text-${key}`
|
|
11
|
+
);
|
|
12
|
+
const colorKeysSet = new Set(colorKeys);
|
|
9
13
|
const textKeys = Object.keys(tailwindConfig.theme.extend.fontSize).map(
|
|
10
14
|
(key) => `text-${key}`
|
|
11
15
|
);
|
|
12
16
|
const textKeysSet = new Set(textKeys);
|
|
17
|
+
const fontKeys = [
|
|
18
|
+
"thin",
|
|
19
|
+
"extralight",
|
|
20
|
+
"light",
|
|
21
|
+
"normal",
|
|
22
|
+
"medium",
|
|
23
|
+
"semibold",
|
|
24
|
+
"bold",
|
|
25
|
+
"extra-bold",
|
|
26
|
+
"black",
|
|
27
|
+
].map((key) => `font-${key}`);
|
|
28
|
+
const fontKeysSet = new Set(fontKeys);
|
|
29
|
+
const flexKeysSet = new Set([
|
|
30
|
+
"flex-auto",
|
|
31
|
+
"flex-none",
|
|
32
|
+
"flex-[0_0_auto]",
|
|
33
|
+
"flex-1",
|
|
34
|
+
]);
|
|
35
|
+
|
|
13
36
|
const keyMap: Record<Category, Set<string>> = {
|
|
14
37
|
text: textKeysSet,
|
|
15
|
-
flex:
|
|
38
|
+
flex: flexKeysSet,
|
|
39
|
+
color: colorKeysSet,
|
|
40
|
+
font: fontKeysSet,
|
|
16
41
|
};
|
|
17
42
|
|
|
18
43
|
export function cx(...args: ClassNameItem[]): string {
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { isDeepEqual } from "@noya-app/noya-utils";
|
|
2
|
+
import {
|
|
3
|
+
defaultAcceptsDrop,
|
|
4
|
+
RelativeDropPosition,
|
|
5
|
+
} from "../components/Sortable";
|
|
6
|
+
|
|
7
|
+
type MoveOptions = {
|
|
8
|
+
indexPaths: number[][];
|
|
9
|
+
to: number[];
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export type MoveTreeItemOptions<T> = {
|
|
13
|
+
root: T;
|
|
14
|
+
move: (root: T, options: MoveOptions) => T;
|
|
15
|
+
position: RelativeDropPosition;
|
|
16
|
+
sourceIndexPath: number[];
|
|
17
|
+
targetIndexPath: number[];
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export function moveTreeItem<T>({
|
|
21
|
+
root,
|
|
22
|
+
move,
|
|
23
|
+
position,
|
|
24
|
+
sourceIndexPath,
|
|
25
|
+
targetIndexPath,
|
|
26
|
+
}: MoveTreeItemOptions<T>): T {
|
|
27
|
+
switch (position) {
|
|
28
|
+
case "above": {
|
|
29
|
+
return move(root, {
|
|
30
|
+
indexPaths: [sourceIndexPath],
|
|
31
|
+
to: targetIndexPath,
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
case "below": {
|
|
35
|
+
return move(root, {
|
|
36
|
+
indexPaths: [sourceIndexPath],
|
|
37
|
+
to: [...targetIndexPath.slice(0, -1), targetIndexPath.at(-1)! + 1],
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
case "inside": {
|
|
41
|
+
return move(root, {
|
|
42
|
+
indexPaths: [sourceIndexPath],
|
|
43
|
+
to: [...targetIndexPath, 1000],
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export type AcceptsDropOptions = {
|
|
50
|
+
sourceIndexPath: number[];
|
|
51
|
+
targetIndexPath: number[];
|
|
52
|
+
position: RelativeDropPosition;
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Whether to allow dropping the source item within the same parent as the target item.
|
|
56
|
+
*/
|
|
57
|
+
allowSiblings: boolean;
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Whether to allow dropping the source item within itself or one of its descendants.
|
|
61
|
+
*/
|
|
62
|
+
allowRecursion: boolean;
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
export function acceptsDrop({
|
|
66
|
+
sourceIndexPath,
|
|
67
|
+
targetIndexPath,
|
|
68
|
+
position,
|
|
69
|
+
allowSiblings,
|
|
70
|
+
allowRecursion,
|
|
71
|
+
}: AcceptsDropOptions): boolean {
|
|
72
|
+
if (!allowRecursion) {
|
|
73
|
+
const targetIsDescendantOfSource = isDeepEqual(
|
|
74
|
+
sourceIndexPath,
|
|
75
|
+
targetIndexPath.slice(0, sourceIndexPath.length)
|
|
76
|
+
);
|
|
77
|
+
|
|
78
|
+
if (targetIsDescendantOfSource) return false;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
const areSiblings = isDeepEqual(
|
|
82
|
+
sourceIndexPath.slice(0, -1),
|
|
83
|
+
targetIndexPath.slice(0, -1)
|
|
84
|
+
);
|
|
85
|
+
|
|
86
|
+
if (areSiblings && position !== "inside") {
|
|
87
|
+
if (!allowSiblings) {
|
|
88
|
+
return false;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
return defaultAcceptsDrop(
|
|
92
|
+
sourceIndexPath.at(-1)!,
|
|
93
|
+
targetIndexPath.at(-1)!,
|
|
94
|
+
position
|
|
95
|
+
);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
return true;
|
|
99
|
+
}
|
package/tailwind.config.ts
CHANGED
|
@@ -10,76 +10,76 @@ const config = {
|
|
|
10
10
|
theme: {
|
|
11
11
|
extend: {
|
|
12
12
|
colors: {
|
|
13
|
-
"logo-fill": "var(--logo-fill)",
|
|
14
|
-
"logo-highlight": "var(--logo-highlight)",
|
|
15
|
-
background: "var(--background)",
|
|
16
|
-
text: "var(--text)",
|
|
17
|
-
"text-muted": "var(--text-muted)",
|
|
18
|
-
"text-subtle": "var(--text-subtle)",
|
|
19
|
-
"text-disabled": "var(--text-disabled)",
|
|
20
|
-
"text-decorative-light": "var(--text-decorative-light)",
|
|
21
|
-
"divider-subtle": "var(--divider-subtle)",
|
|
22
|
-
divider: "var(--divider)",
|
|
23
|
-
"divider-strong": "var(--divider-strong)",
|
|
24
|
-
primary: "var(--primary)",
|
|
25
|
-
"primary-light": "var(--primary-light)",
|
|
26
|
-
"primary-pastel": "var(--primary-pastel)",
|
|
27
|
-
secondary: "var(--secondary)",
|
|
28
|
-
"secondary-light": "var(--secondary-light)",
|
|
29
|
-
"secondary-pastel": "var(--secondary-pastel)",
|
|
30
|
-
"secondary-bright": "var(--secondary-bright)",
|
|
31
|
-
"input-background": "var(--input-background)",
|
|
32
|
-
"input-background-light": "var(--input-background-light)",
|
|
33
|
-
"list-view-hover-background": "var(--list-view-hover-background)",
|
|
13
|
+
"logo-fill": "var(--n-logo-fill)",
|
|
14
|
+
"logo-highlight": "var(--n-logo-highlight)",
|
|
15
|
+
background: "var(--n-background)",
|
|
16
|
+
text: "var(--n-text)",
|
|
17
|
+
"text-muted": "var(--n-text-muted)",
|
|
18
|
+
"text-subtle": "var(--n-text-subtle)",
|
|
19
|
+
"text-disabled": "var(--n-text-disabled)",
|
|
20
|
+
"text-decorative-light": "var(--n-text-decorative-light)",
|
|
21
|
+
"divider-subtle": "var(--n-divider-subtle)",
|
|
22
|
+
divider: "var(--n-divider)",
|
|
23
|
+
"divider-strong": "var(--n-divider-strong)",
|
|
24
|
+
primary: "var(--n-primary)",
|
|
25
|
+
"primary-light": "var(--n-primary-light)",
|
|
26
|
+
"primary-pastel": "var(--n-primary-pastel)",
|
|
27
|
+
secondary: "var(--n-secondary)",
|
|
28
|
+
"secondary-light": "var(--n-secondary-light)",
|
|
29
|
+
"secondary-pastel": "var(--n-secondary-pastel)",
|
|
30
|
+
"secondary-bright": "var(--n-secondary-bright)",
|
|
31
|
+
"input-background": "var(--n-input-background)",
|
|
32
|
+
"input-background-light": "var(--n-input-background-light)",
|
|
33
|
+
"list-view-hover-background": "var(--n-list-view-hover-background)",
|
|
34
34
|
"list-view-thumbnail-background":
|
|
35
|
-
"var(--list-view-thumbnail-background)",
|
|
36
|
-
"code-background": "var(--code-background)",
|
|
37
|
-
"code-background-dark": "var(--code-background-dark)",
|
|
38
|
-
"selected-background": "var(--selected-background)",
|
|
39
|
-
"breadcrumb-text": "var(--breadcrumb-text)",
|
|
40
|
-
"breadcrumb-text-hover": "var(--breadcrumb-text-hover)",
|
|
41
|
-
"breadcrumb-icon": "var(--breadcrumb-icon)",
|
|
42
|
-
"canvas-background": "var(--canvas-background)",
|
|
43
|
-
"canvas-grid": "var(--canvas-grid)",
|
|
44
|
-
"sidebar-background": "var(--sidebar-background)",
|
|
35
|
+
"var(--n-list-view-thumbnail-background)",
|
|
36
|
+
"code-background": "var(--n-code-background)",
|
|
37
|
+
"code-background-dark": "var(--n-code-background-dark)",
|
|
38
|
+
"selected-background": "var(--n-selected-background)",
|
|
39
|
+
"breadcrumb-text": "var(--n-breadcrumb-text)",
|
|
40
|
+
"breadcrumb-text-hover": "var(--n-breadcrumb-text-hover)",
|
|
41
|
+
"breadcrumb-icon": "var(--n-breadcrumb-icon)",
|
|
42
|
+
"canvas-background": "var(--n-canvas-background)",
|
|
43
|
+
"canvas-grid": "var(--n-canvas-grid)",
|
|
44
|
+
"sidebar-background": "var(--n-sidebar-background)",
|
|
45
45
|
"sidebar-background-transparent":
|
|
46
|
-
"var(--sidebar-background-transparent)",
|
|
47
|
-
"popover-background": "var(--popover-background)",
|
|
48
|
-
"popover-divider": "var(--popover-divider)",
|
|
49
|
-
"listview-raised-background": "var(--listview-raised-background)",
|
|
50
|
-
"listview-editing-background": "var(--listview-editing-background)",
|
|
51
|
-
"slider-thumb-background": "var(--slider-thumb-background)",
|
|
52
|
-
"slider-border": "var(--slider-border)",
|
|
53
|
-
"segmented-control-item": "var(--segmented-control-item)",
|
|
54
|
-
mask: "var(--mask)",
|
|
55
|
-
"transparent-checker": "var(--transparent-checker)",
|
|
56
|
-
scrollbar: "var(--scrollbar)",
|
|
57
|
-
"placeholder-dots": "var(--placeholder-dots)",
|
|
58
|
-
"drag-outline": "var(--drag-outline)",
|
|
59
|
-
"active-background": "var(--active-background)",
|
|
60
|
-
"thumbnail-background": "var(--thumbnail-background)",
|
|
61
|
-
"thumbnail-shadow": "var(--thumbnail-shadow)",
|
|
62
|
-
"inline-code-text": "var(--inline-code-text)",
|
|
63
|
-
"inline-code-background": "var(--inline-code-background)",
|
|
64
|
-
"text-link": "var(--text-link)",
|
|
65
|
-
"text-link-focused": "var(--text-link-focused)",
|
|
66
|
-
icon: "var(--icon)",
|
|
67
|
-
"icon-selected": "var(--icon-selected)",
|
|
68
|
-
warning: "var(--warning)",
|
|
69
|
-
dot: "var(--dot)",
|
|
70
|
-
"row-highlight": "var(--row-highlight)",
|
|
71
|
-
"table-row-background": "var(--table-row-background)",
|
|
72
|
-
"chip-primary-bg": "var(--chip-primary-bg)",
|
|
73
|
-
"chip-secondary-bg": "var(--chip-secondary-bg)",
|
|
74
|
-
"chip-error-bg": "var(--chip-error-bg)",
|
|
75
|
-
"chip-default-bg": "var(--chip-default-bg)",
|
|
76
|
-
"chip-primary-shadow": "var(--chip-primary-shadow)",
|
|
77
|
-
"chip-secondary-shadow": "var(--chip-secondary-shadow)",
|
|
78
|
-
"chip-error-shadow": "var(--chip-error-shadow)",
|
|
79
|
-
"chip-default-shadow": "var(--chip-default-shadow)",
|
|
80
|
-
"floating-button": "var(--floating-button)",
|
|
81
|
-
"block-border": "var(--block-border)",
|
|
82
|
-
"block-highlight": "var(--block-highlight)",
|
|
46
|
+
"var(--n-sidebar-background-transparent)",
|
|
47
|
+
"popover-background": "var(--n-popover-background)",
|
|
48
|
+
"popover-divider": "var(--n-popover-divider)",
|
|
49
|
+
"listview-raised-background": "var(--n-listview-raised-background)",
|
|
50
|
+
"listview-editing-background": "var(--n-listview-editing-background)",
|
|
51
|
+
"slider-thumb-background": "var(--n-slider-thumb-background)",
|
|
52
|
+
"slider-border": "var(--n-slider-border)",
|
|
53
|
+
"segmented-control-item": "var(--n-segmented-control-item)",
|
|
54
|
+
mask: "var(--n-mask)",
|
|
55
|
+
"transparent-checker": "var(--n-transparent-checker)",
|
|
56
|
+
scrollbar: "var(--n-scrollbar)",
|
|
57
|
+
"placeholder-dots": "var(--n-placeholder-dots)",
|
|
58
|
+
"drag-outline": "var(--n-drag-outline)",
|
|
59
|
+
"active-background": "var(--n-active-background)",
|
|
60
|
+
"thumbnail-background": "var(--n-thumbnail-background)",
|
|
61
|
+
"thumbnail-shadow": "var(--n-thumbnail-shadow)",
|
|
62
|
+
"inline-code-text": "var(--n-inline-code-text)",
|
|
63
|
+
"inline-code-background": "var(--n-inline-code-background)",
|
|
64
|
+
"text-link": "var(--n-text-link)",
|
|
65
|
+
"text-link-focused": "var(--n-text-link-focused)",
|
|
66
|
+
icon: "var(--n-icon)",
|
|
67
|
+
"icon-selected": "var(--n-icon-selected)",
|
|
68
|
+
warning: "var(--n-warning)",
|
|
69
|
+
dot: "var(--n-dot)",
|
|
70
|
+
"row-highlight": "var(--n-row-highlight)",
|
|
71
|
+
"table-row-background": "var(--n-table-row-background)",
|
|
72
|
+
"chip-primary-bg": "var(--n-chip-primary-bg)",
|
|
73
|
+
"chip-secondary-bg": "var(--n-chip-secondary-bg)",
|
|
74
|
+
"chip-error-bg": "var(--n-chip-error-bg)",
|
|
75
|
+
"chip-default-bg": "var(--n-chip-default-bg)",
|
|
76
|
+
"chip-primary-shadow": "var(--n-chip-primary-shadow)",
|
|
77
|
+
"chip-secondary-shadow": "var(--n-chip-secondary-shadow)",
|
|
78
|
+
"chip-error-shadow": "var(--n-chip-error-shadow)",
|
|
79
|
+
"chip-default-shadow": "var(--n-chip-default-shadow)",
|
|
80
|
+
"floating-button": "var(--n-floating-button)",
|
|
81
|
+
"block-border": "var(--n-block-border)",
|
|
82
|
+
"block-highlight": "var(--n-block-highlight)",
|
|
83
83
|
},
|
|
84
84
|
fontFamily: {
|
|
85
85
|
sans: [
|
|
@@ -188,14 +188,14 @@ const config = {
|
|
|
188
188
|
large: "32px",
|
|
189
189
|
xlarge: "64px",
|
|
190
190
|
xxlarge: "128px",
|
|
191
|
-
"inset-top": "var(--inset-top)",
|
|
192
|
-
"sidebar-width": "var(--sidebar-width)",
|
|
193
|
-
"toolbar-height": "var(--toolbar-height)",
|
|
194
|
-
"toolbar-separator": "var(--toolbar-separator)",
|
|
195
|
-
"inspector-h-separator": "var(--inspector-h-separator)",
|
|
196
|
-
"inspector-v-separator": "var(--inspector-v-separator)",
|
|
197
|
-
"dialog-padding": "var(--dialog-padding)",
|
|
198
|
-
"input-height": "var(--input-height)",
|
|
191
|
+
"inset-top": "var(--n-inset-top)",
|
|
192
|
+
"sidebar-width": "var(--n-sidebar-width)",
|
|
193
|
+
"toolbar-height": "var(--n-toolbar-height)",
|
|
194
|
+
"toolbar-separator": "var(--n-toolbar-separator)",
|
|
195
|
+
"inspector-h-separator": "var(--n-inspector-h-separator)",
|
|
196
|
+
"inspector-v-separator": "var(--n-inspector-v-separator)",
|
|
197
|
+
"dialog-padding": "var(--n-dialog-padding)",
|
|
198
|
+
"input-height": "var(--n-input-height)",
|
|
199
199
|
},
|
|
200
200
|
keyframes: {
|
|
201
201
|
spin: {
|
|
@@ -216,9 +216,9 @@ const config = {
|
|
|
216
216
|
shimmer: "shimmer 6s infinite linear",
|
|
217
217
|
},
|
|
218
218
|
zIndex: {
|
|
219
|
-
interactable: "var(--interactable-z-index)",
|
|
220
|
-
label: "var(--label-z-index)",
|
|
221
|
-
menu: "var(--menu-z-index)",
|
|
219
|
+
interactable: "var(--n-interactable-z-index)",
|
|
220
|
+
label: "var(--n-label-z-index)",
|
|
221
|
+
menu: "var(--n-menu-z-index)",
|
|
222
222
|
},
|
|
223
223
|
},
|
|
224
224
|
},
|