@noya-app/noya-designsystem 0.1.30 → 0.1.32
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 +20 -12
- package/.turbo/turbo-lint.log +15 -1
- package/CHANGELOG.md +17 -0
- package/README.md +13 -1
- package/dist/index.css +1 -0
- package/dist/index.d.ts +238 -627
- package/dist/index.js +4259 -2862
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +4159 -2764
- package/dist/index.mjs.map +1 -1
- package/package.json +17 -7
- package/src/components/ActivityIndicator.tsx +4 -36
- package/src/components/Avatar.tsx +63 -62
- package/src/components/Button.tsx +53 -170
- package/src/components/Chip.tsx +117 -150
- package/src/components/ContextMenu.tsx +13 -35
- package/src/components/Dialog.tsx +66 -54
- package/src/components/Divider.tsx +31 -41
- package/src/components/DraggableMenuButton.tsx +29 -30
- package/src/components/DropdownMenu.tsx +30 -40
- package/src/components/FillInputField.tsx +16 -26
- package/src/components/FillPreviewBackground.tsx +18 -22
- package/src/components/FloatingWindow.tsx +4 -7
- package/src/components/GridView.tsx +70 -200
- package/src/components/IconButton.tsx +1 -5
- package/src/components/InputField.tsx +258 -234
- package/src/components/InputFieldWithCompletions.tsx +20 -27
- package/src/components/InspectorContainer.tsx +4 -9
- package/src/components/InspectorPrimitives.tsx +135 -109
- package/src/components/Label.tsx +5 -36
- package/src/components/LabeledElementView.tsx +5 -26
- package/src/components/ListView.tsx +239 -167
- package/src/components/Popover.tsx +15 -39
- package/src/components/Progress.tsx +21 -44
- package/src/components/RadioGroup.tsx +6 -71
- package/src/components/ScrollArea.tsx +11 -39
- package/src/components/SelectMenu.tsx +72 -32
- package/src/components/Slider.tsx +7 -43
- package/src/components/Spacer.tsx +6 -18
- package/src/components/Switch.tsx +4 -42
- package/src/components/Text.tsx +31 -66
- package/src/components/TextArea.tsx +5 -31
- package/src/components/Toast.tsx +15 -57
- package/src/components/Tooltip.tsx +4 -13
- package/src/components/WorkspaceLayout.tsx +27 -17
- package/src/components/internal/Menu.tsx +37 -83
- package/src/contexts/DesignSystemConfiguration.tsx +1 -47
- package/src/contexts/DialogContext.tsx +2 -10
- package/src/hooks/useDarkMode.ts +14 -0
- package/src/index.css +108 -0
- package/src/index.tsx +4 -5
- package/src/theme/index.ts +4 -16
- package/src/utils/tailwind.ts +17 -0
- package/tailwind.config.ts +223 -0
- package/tailwind.d.ts +11 -0
- package/tsconfig.json +4 -1
- package/tsup.config.ts +16 -0
- package/dist/index.d.mts +0 -1455
- package/src/components/Grid.tsx +0 -54
- package/src/components/Select.tsx +0 -183
- package/src/components/Stack.tsx +0 -155
- package/src/theme/dark.ts +0 -45
- package/src/theme/light.ts +0 -226
- package/src/utils/breakpoints.ts +0 -45
|
@@ -7,19 +7,11 @@ import React, {
|
|
|
7
7
|
useRef,
|
|
8
8
|
useState,
|
|
9
9
|
} from "react";
|
|
10
|
-
import styled from "styled-components";
|
|
11
10
|
import { Button } from "../components/Button";
|
|
12
11
|
import { Dialog, IDialog } from "../components/Dialog";
|
|
13
12
|
import { InputField } from "../components/InputField";
|
|
14
13
|
import { Spacer } from "../components/Spacer";
|
|
15
14
|
|
|
16
|
-
export const Row = styled.div(({ theme }) => ({
|
|
17
|
-
flex: "1",
|
|
18
|
-
display: "flex",
|
|
19
|
-
flexDirection: "row",
|
|
20
|
-
alignItems: "center",
|
|
21
|
-
}));
|
|
22
|
-
|
|
23
15
|
function createDeferredPromise<T>() {
|
|
24
16
|
let resolve: (value: T) => void = () => {};
|
|
25
17
|
let reject: (value: any) => void = () => {};
|
|
@@ -161,14 +153,14 @@ export const DialogProvider = function DialogProvider({
|
|
|
161
153
|
/>
|
|
162
154
|
</InputField.Root>
|
|
163
155
|
<Spacer.Vertical size={20} />
|
|
164
|
-
<
|
|
156
|
+
<div className="flex-1 flex-row items-center">
|
|
165
157
|
<Spacer.Horizontal />
|
|
166
158
|
<Button onClick={close}>Cancel</Button>
|
|
167
159
|
<Spacer.Horizontal size={16} />
|
|
168
160
|
<Button disabled={!contents?.inputValue} onClick={submit}>
|
|
169
161
|
Submit
|
|
170
162
|
</Button>
|
|
171
|
-
</
|
|
163
|
+
</div>
|
|
172
164
|
</Dialog>
|
|
173
165
|
</>
|
|
174
166
|
);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { useState, useEffect } from "react"
|
|
2
|
+
|
|
3
|
+
export function useDarkMode(elementRef: React.RefObject<HTMLElement>) {
|
|
4
|
+
const [isDark, setIsDark] = useState(false)
|
|
5
|
+
|
|
6
|
+
useEffect(() => {
|
|
7
|
+
if (!elementRef.current) return;
|
|
8
|
+
|
|
9
|
+
const hasDarkTheme = elementRef.current.closest('[data-theme="dark"]') !== null
|
|
10
|
+
setIsDark(hasDarkTheme)
|
|
11
|
+
}, [elementRef])
|
|
12
|
+
|
|
13
|
+
return { isDark, elementRef }
|
|
14
|
+
}
|
package/src/index.css
ADDED
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
@tailwind base;
|
|
2
|
+
@tailwind components;
|
|
3
|
+
@tailwind utilities;
|
|
4
|
+
|
|
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: rgb(240, 242, 246);
|
|
25
|
+
--input-background-light: rgb(243, 245, 249);
|
|
26
|
+
--code-background: rgb(250, 250, 250);
|
|
27
|
+
--code-background-dark: #435080;
|
|
28
|
+
--selected-background: rgb(242, 245, 250);
|
|
29
|
+
--breadcrumb-text: rgb(107, 113, 136);
|
|
30
|
+
--breadcrumb-text-hover: rgb(117, 121, 129);
|
|
31
|
+
--breadcrumb-icon: rgb(129, 131, 165);
|
|
32
|
+
--canvas-background: rgb(249, 249, 249);
|
|
33
|
+
--canvas-grid: rgba(0, 0, 0, 0.05);
|
|
34
|
+
--sidebar-background: rgb(255, 255, 255);
|
|
35
|
+
--sidebar-background-transparent: rgba(255, 255, 255, 0.85);
|
|
36
|
+
--popover-background: rgb(252, 252, 252);
|
|
37
|
+
--popover-divider: transparent;
|
|
38
|
+
--listview-raised-background: rgba(0, 0, 0, 0.03);
|
|
39
|
+
--listview-editing-background: #fff;
|
|
40
|
+
--slider-background: white;
|
|
41
|
+
--slider-border: #bbb;
|
|
42
|
+
--radio-group-background: white;
|
|
43
|
+
--mask: rgb(12, 193, 67);
|
|
44
|
+
--transparent-checker: rgba(255, 255, 255, 0.8);
|
|
45
|
+
--scrollbar: rgba(199, 199, 199, 0.8);
|
|
46
|
+
--placeholder-dots: rgba(0, 0, 0, 0.3);
|
|
47
|
+
--drag-outline: rgb(103, 70, 255);
|
|
48
|
+
--active-background: rgba(0, 0, 0, 0.1);
|
|
49
|
+
--thumbnail-background: #f0efff;
|
|
50
|
+
--thumbnail-shadow: #d3ceed66;
|
|
51
|
+
--inline-code-text: rgb(103, 70, 255);
|
|
52
|
+
--inline-code-background: rgb(240, 242, 246);
|
|
53
|
+
--text-link: rgb(103, 70, 255);
|
|
54
|
+
--text-link-focused: rgb(147, 86, 255);
|
|
55
|
+
--inset-top: 46px;
|
|
56
|
+
--sidebar-width: 260px;
|
|
57
|
+
--toolbar-height: 46px;
|
|
58
|
+
--toolbar-separator: 8px;
|
|
59
|
+
--inspector-h-separator: 8px;
|
|
60
|
+
--inspector-v-separator: 10px;
|
|
61
|
+
--dialog-padding: 16px;
|
|
62
|
+
--icon: rgb(129, 131, 165);
|
|
63
|
+
--icon-selected: rgb(220, 220, 220);
|
|
64
|
+
--warning: rgb(251, 211, 0);
|
|
65
|
+
--radio-group-item: rgb(139, 139, 139);
|
|
66
|
+
--dot: rgba(0,0,0,0.25);
|
|
67
|
+
--row-highlight: #3390FF10;
|
|
68
|
+
--table-row-background: var(--background)
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
[data-theme="dark"] {
|
|
72
|
+
--background: #111111;
|
|
73
|
+
--logo-fill: rgb(248, 248, 250);
|
|
74
|
+
--logo-highlight: rgb(248, 248, 250);
|
|
75
|
+
--text: rgb(248, 248, 250);
|
|
76
|
+
--text-muted: rgb(180, 179, 182);
|
|
77
|
+
--text-subtle: rgb(180, 179, 182);
|
|
78
|
+
--text-disabled: rgb(100, 99, 102);
|
|
79
|
+
--divider-subtle: rgba(255, 255, 255, 0.04);
|
|
80
|
+
--divider: rgba(255, 255, 255, 0.08);
|
|
81
|
+
--divider-strong: rgba(0, 0, 0, 1);
|
|
82
|
+
--primary: rgb(119, 66, 255);
|
|
83
|
+
--primary-light: rgb(134, 86, 255);
|
|
84
|
+
--secondary-bright: #36fe91;
|
|
85
|
+
--input-background: rgba(181, 178, 255, 0.08);
|
|
86
|
+
--input-background-light: rgba(181, 178, 255, 0.1);
|
|
87
|
+
--code-background: rgb(20, 19, 23);
|
|
88
|
+
--canvas-background: rgb(20, 19, 23);
|
|
89
|
+
--canvas-grid: rgba(0, 0, 0, 0.1);
|
|
90
|
+
--sidebar-background: rgb(34, 33, 39);
|
|
91
|
+
--sidebar-background-transparent: rgba(34, 33, 39, 0.95);
|
|
92
|
+
--popover-background: rgb(34, 33, 39);
|
|
93
|
+
--popover-divider: rgba(255, 255, 255, 0.08);
|
|
94
|
+
--listview-raised-background: rgba(181, 178, 255, 0.1);
|
|
95
|
+
--listview-editing-background: #000;
|
|
96
|
+
--slider-background: #bbb;
|
|
97
|
+
--radio-group-background: rgba(181, 178, 255, 0.08);
|
|
98
|
+
--mask: rgb(102, 187, 106);
|
|
99
|
+
--transparent-checker: rgba(255, 255, 255, 0.3);
|
|
100
|
+
--scrollbar: rgba(199, 199, 199, 0.2);
|
|
101
|
+
--placeholder-dots: rgba(255, 255, 255, 0.3);
|
|
102
|
+
--drag-outline: white;
|
|
103
|
+
--active-background: rgba(181, 178, 255, 0.08);
|
|
104
|
+
--thumbnail-background: #1f1d33;
|
|
105
|
+
--thumbnail-shadow: #1f1d3366;
|
|
106
|
+
--dot: rgba(255,255,255,0.15);
|
|
107
|
+
--table-row-background: var(--sidebar-background);
|
|
108
|
+
}
|
package/src/index.tsx
CHANGED
|
@@ -27,7 +27,6 @@ export * from "./components/FillInputField";
|
|
|
27
27
|
export * from "./components/FillPreviewBackground";
|
|
28
28
|
export * from "./components/FloatingWindow";
|
|
29
29
|
export * from "./components/GradientPicker";
|
|
30
|
-
export * from "./components/Grid";
|
|
31
30
|
export * from "./components/GridView";
|
|
32
31
|
export * from "./components/IconButton";
|
|
33
32
|
export * from "./components/Icons";
|
|
@@ -41,13 +40,11 @@ export * from "./components/Popover";
|
|
|
41
40
|
export * from "./components/Progress";
|
|
42
41
|
export * from "./components/RadioGroup";
|
|
43
42
|
export * from "./components/ScrollArea";
|
|
44
|
-
export * from "./components/Select";
|
|
45
43
|
export * from "./components/SelectMenu";
|
|
46
44
|
export * from "./components/Slider";
|
|
47
45
|
export * from "./components/Sortable";
|
|
48
46
|
export type { RelativeDropPosition } from "./components/Sortable";
|
|
49
47
|
export * from "./components/Spacer";
|
|
50
|
-
export * from "./components/Stack";
|
|
51
48
|
export * from "./components/Switch";
|
|
52
49
|
export * from "./components/Text";
|
|
53
50
|
export * from "./components/TextArea";
|
|
@@ -72,10 +69,12 @@ export * from "./hooks/useHover";
|
|
|
72
69
|
export * from "./hooks/usePlatform";
|
|
73
70
|
export * from "./mediaQuery";
|
|
74
71
|
export * from "./theme";
|
|
75
|
-
export
|
|
76
|
-
export
|
|
72
|
+
export { cn } from './utils/tailwind';
|
|
73
|
+
export type { ThemeColor } from './utils/tailwind';
|
|
77
74
|
export * from "./utils/createSectionedMenu";
|
|
78
75
|
export * from "./utils/getGradientBackground";
|
|
76
|
+
export * from "./hooks/usePreservePanelSize";
|
|
77
|
+
export * from './hooks/useDarkMode';
|
|
79
78
|
// Utils
|
|
80
79
|
export * from "./utils/completions";
|
|
81
80
|
export * from "./utils/fuzzyScorer";
|
package/src/theme/index.ts
CHANGED
|
@@ -1,17 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import tailwindConfig from "../../tailwind.config";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export interface DefaultTheme extends Theme {}
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export interface Colors {}
|
|
10
|
-
|
|
11
|
-
type PickByValue<T, V> = Pick<
|
|
12
|
-
T,
|
|
13
|
-
// Remove any value that extends V
|
|
14
|
-
{ [K in keyof T]-?: T[K] extends V ? K : never }[keyof T]
|
|
15
|
-
>;
|
|
16
|
-
|
|
17
|
-
export type ThemeColorName = keyof PickByValue<Theme['colors'], string>;
|
|
3
|
+
// Extract the theme configuration
|
|
4
|
+
// @ts-expect-error TODO: figure this out
|
|
5
|
+
export type Theme = typeof tailwindConfig.theme.extend;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Theme } from '../theme';
|
|
2
|
+
import { twMerge } from "tailwind-merge";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Utility for merging classes conditionally. Right side will override left side if there are any conflicts.
|
|
6
|
+
* Usage: cn('bg-red-500 text-white', 'bg-blue-500') // Returns: 'text-white bg-blue-500'
|
|
7
|
+
* @danger do not use this function to concatenate class names. Use it to merge classes conditionally.
|
|
8
|
+
*/
|
|
9
|
+
export const cn = (...classes: (string | boolean | undefined | null)[]) => twMerge(classes.filter(Boolean) as string[])
|
|
10
|
+
|
|
11
|
+
// @ts-expect-error TODO: figure this out
|
|
12
|
+
type ThemeExtend = NonNullable<Theme['extend']>
|
|
13
|
+
export type ThemeColor = keyof ThemeExtend['colors'];
|
|
14
|
+
|
|
15
|
+
export function camelCaseToKebabCase(string: string) {
|
|
16
|
+
return string.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
|
|
17
|
+
}
|
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
import { Config } from "tailwindcss";
|
|
2
|
+
|
|
3
|
+
const config: Config = {
|
|
4
|
+
content: ["./src/**/*.{ts,tsx}"],
|
|
5
|
+
corePlugins: {
|
|
6
|
+
// disables @tailwind base global styles
|
|
7
|
+
preflight: false,
|
|
8
|
+
},
|
|
9
|
+
theme: {
|
|
10
|
+
extend: {
|
|
11
|
+
colors: {
|
|
12
|
+
"logo-fill": "var(--logo-fill)",
|
|
13
|
+
"logo-highlight": "var(--logo-highlight)",
|
|
14
|
+
background: "var(--background)",
|
|
15
|
+
text: "var(--text)",
|
|
16
|
+
"text-muted": "var(--text-muted)",
|
|
17
|
+
"text-subtle": "var(--text-subtle)",
|
|
18
|
+
"text-disabled": "var(--text-disabled)",
|
|
19
|
+
"text-decorative-light": "var(--text-decorative-light)",
|
|
20
|
+
"divider-subtle": "var(--divider-subtle)",
|
|
21
|
+
divider: "var(--divider)",
|
|
22
|
+
"divider-strong": "var(--divider-strong)",
|
|
23
|
+
primary: "var(--primary)",
|
|
24
|
+
"primary-light": "var(--primary-light)",
|
|
25
|
+
"primary-pastel": "var(--primary-pastel)",
|
|
26
|
+
secondary: "var(--secondary)",
|
|
27
|
+
"secondary-light": "var(--secondary-light)",
|
|
28
|
+
"secondary-pastel": "var(--secondary-pastel)",
|
|
29
|
+
"secondary-bright": "var(--secondary-bright)",
|
|
30
|
+
"input-background": "var(--input-background)",
|
|
31
|
+
"input-background-light": "var(--input-background-light)",
|
|
32
|
+
"code-background": "var(--code-background)",
|
|
33
|
+
"code-background-dark": "var(--code-background-dark)",
|
|
34
|
+
"selected-background": "var(--selected-background)",
|
|
35
|
+
"breadcrumb-text": "var(--breadcrumb-text)",
|
|
36
|
+
"breadcrumb-text-hover": "var(--breadcrumb-text-hover)",
|
|
37
|
+
"breadcrumb-icon": "var(--breadcrumb-icon)",
|
|
38
|
+
"canvas-background": "var(--canvas-background)",
|
|
39
|
+
"canvas-grid": "var(--canvas-grid)",
|
|
40
|
+
"sidebar-background": "var(--sidebar-background)",
|
|
41
|
+
"sidebar-background-transparent":
|
|
42
|
+
"var(--sidebar-background-transparent)",
|
|
43
|
+
"popover-background": "var(--popover-background)",
|
|
44
|
+
"popover-divider": "var(--popover-divider)",
|
|
45
|
+
"listview-raised-background": "var(--listview-raised-background)",
|
|
46
|
+
"listview-editing-background": "var(--listview-editing-background)",
|
|
47
|
+
"slider-background": "var(--slider-background)",
|
|
48
|
+
"slider-border": "var(--slider-border)",
|
|
49
|
+
"radio-group-background": "var(--radio-group-background)",
|
|
50
|
+
mask: "var(--mask)",
|
|
51
|
+
"transparent-checker": "var(--transparent-checker)",
|
|
52
|
+
scrollbar: "var(--scrollbar)",
|
|
53
|
+
"placeholder-dots": "var(--placeholder-dots)",
|
|
54
|
+
"drag-outline": "var(--drag-outline)",
|
|
55
|
+
"active-background": "var(--active-background)",
|
|
56
|
+
"thumbnail-background": "var(--thumbnail-background)",
|
|
57
|
+
"thumbnail-shadow": "var(--thumbnail-shadow)",
|
|
58
|
+
"inline-code-text": "var(--inline-code-text)",
|
|
59
|
+
"inline-code-background": "var(--inline-code-background)",
|
|
60
|
+
"text-link": "var(--text-link)",
|
|
61
|
+
"text-link-focused": "var(--text-link-focused)",
|
|
62
|
+
icon: "var(--icon)",
|
|
63
|
+
"icon-selected": "var(--icon-selected)",
|
|
64
|
+
warning: "var(--warning)",
|
|
65
|
+
"radio-group-item": "var(--radio-group-item)",
|
|
66
|
+
dot: "var(--dot)",
|
|
67
|
+
"row-highlight": "var(--row-highlight)",
|
|
68
|
+
"table-row-background": "var(--table-row-background)",
|
|
69
|
+
},
|
|
70
|
+
fontFamily: {
|
|
71
|
+
sans: [
|
|
72
|
+
"__Inter_6b0edc",
|
|
73
|
+
"__Inter_Fallback_6b0edc",
|
|
74
|
+
"-apple-system",
|
|
75
|
+
"BlinkMacSystemFont",
|
|
76
|
+
"Helvetica Neue",
|
|
77
|
+
"Segoe UI",
|
|
78
|
+
"Roboto",
|
|
79
|
+
"Helvetica",
|
|
80
|
+
"Arial",
|
|
81
|
+
"sans-serif",
|
|
82
|
+
],
|
|
83
|
+
mono: ["Menlo", "Monaco", "Consolas", "Courier New", "monospace"],
|
|
84
|
+
},
|
|
85
|
+
// Type scale
|
|
86
|
+
// The last one, 0.85, I just eyeballed
|
|
87
|
+
// old: typeScale = [3.052, 2.441, 1.953, 1.563, 1.25, 1, 0.85]; // Major third
|
|
88
|
+
fontSize: {
|
|
89
|
+
title: [
|
|
90
|
+
"3.052rem",
|
|
91
|
+
{
|
|
92
|
+
lineHeight: "1.4",
|
|
93
|
+
letterSpacing: "-0.05em",
|
|
94
|
+
},
|
|
95
|
+
],
|
|
96
|
+
subtitle: [
|
|
97
|
+
"1.563rem",
|
|
98
|
+
{
|
|
99
|
+
lineHeight: "1.75",
|
|
100
|
+
letterSpacing: "-0.05em",
|
|
101
|
+
},
|
|
102
|
+
],
|
|
103
|
+
heading1: [
|
|
104
|
+
"1.953rem",
|
|
105
|
+
{
|
|
106
|
+
lineHeight: "1.6",
|
|
107
|
+
letterSpacing: "-0.025em",
|
|
108
|
+
},
|
|
109
|
+
],
|
|
110
|
+
heading2: [
|
|
111
|
+
"1.563rem",
|
|
112
|
+
{
|
|
113
|
+
lineHeight: "1.5",
|
|
114
|
+
letterSpacing: "-0.025em",
|
|
115
|
+
},
|
|
116
|
+
],
|
|
117
|
+
heading3: [
|
|
118
|
+
"1.25rem",
|
|
119
|
+
{
|
|
120
|
+
lineHeight: "1.4",
|
|
121
|
+
letterSpacing: "-0.025em",
|
|
122
|
+
},
|
|
123
|
+
],
|
|
124
|
+
heading4: [
|
|
125
|
+
"1rem",
|
|
126
|
+
{
|
|
127
|
+
lineHeight: "1.4",
|
|
128
|
+
},
|
|
129
|
+
],
|
|
130
|
+
heading5: [
|
|
131
|
+
"0.85rem",
|
|
132
|
+
{
|
|
133
|
+
lineHeight: "1.4",
|
|
134
|
+
},
|
|
135
|
+
],
|
|
136
|
+
body: [
|
|
137
|
+
"1",
|
|
138
|
+
{
|
|
139
|
+
lineHeight: "1.4",
|
|
140
|
+
},
|
|
141
|
+
],
|
|
142
|
+
small: [
|
|
143
|
+
"1",
|
|
144
|
+
{
|
|
145
|
+
lineHeight: "19px",
|
|
146
|
+
},
|
|
147
|
+
],
|
|
148
|
+
code: [
|
|
149
|
+
"90%",
|
|
150
|
+
{
|
|
151
|
+
lineHeight: "1.5",
|
|
152
|
+
},
|
|
153
|
+
],
|
|
154
|
+
button: [
|
|
155
|
+
"0.8rem",
|
|
156
|
+
{
|
|
157
|
+
lineHeight: "1.4",
|
|
158
|
+
letterSpacing: "-0.2px",
|
|
159
|
+
},
|
|
160
|
+
],
|
|
161
|
+
label: [
|
|
162
|
+
"0.62rem",
|
|
163
|
+
{
|
|
164
|
+
lineHeight: "19px",
|
|
165
|
+
letterSpacing: "-0.3px",
|
|
166
|
+
},
|
|
167
|
+
],
|
|
168
|
+
},
|
|
169
|
+
spacing: {
|
|
170
|
+
nano: "2px",
|
|
171
|
+
micro: "4px",
|
|
172
|
+
small: "8px",
|
|
173
|
+
medium: "16px",
|
|
174
|
+
large: "32px",
|
|
175
|
+
xlarge: "64px",
|
|
176
|
+
xxlarge: "128px",
|
|
177
|
+
"inset-top": "var(--inset-top)",
|
|
178
|
+
"sidebar-width": "var(--sidebar-width)",
|
|
179
|
+
"toolbar-height": "var(--toolbar-height)",
|
|
180
|
+
"toolbar-separator": "var(--toolbar-separator)",
|
|
181
|
+
"inspector-h-separator": "var(--inspector-h-separator)",
|
|
182
|
+
"inspector-v-separator": "var(--inspector-v-separator)",
|
|
183
|
+
"dialog-padding": "var(--dialog-padding)",
|
|
184
|
+
},
|
|
185
|
+
keyframes: {
|
|
186
|
+
spin: {
|
|
187
|
+
"0%": { transform: "rotate(0deg)" },
|
|
188
|
+
"100%": { transform: "rotate(360deg)" },
|
|
189
|
+
},
|
|
190
|
+
shimmer: {
|
|
191
|
+
"0%": {
|
|
192
|
+
backgroundPosition: "-200% 0",
|
|
193
|
+
},
|
|
194
|
+
"100%": {
|
|
195
|
+
backgroundPosition: "200% 0",
|
|
196
|
+
},
|
|
197
|
+
},
|
|
198
|
+
},
|
|
199
|
+
animation: {
|
|
200
|
+
spin: "spin 1s linear infinite",
|
|
201
|
+
shimmer: "shimmer 6s infinite linear",
|
|
202
|
+
},
|
|
203
|
+
},
|
|
204
|
+
},
|
|
205
|
+
safelist: [
|
|
206
|
+
"group",
|
|
207
|
+
"group-hover:flex",
|
|
208
|
+
"bg-row-highlight",
|
|
209
|
+
"left-5",
|
|
210
|
+
"right-6",
|
|
211
|
+
"m-[0_-24px_0_-20px]",
|
|
212
|
+
"p-[0_24px_0_20px]",
|
|
213
|
+
"left-0",
|
|
214
|
+
"border-divider-strong",
|
|
215
|
+
"decoration-text-decorative-light",
|
|
216
|
+
"underline",
|
|
217
|
+
"-left-2.5",
|
|
218
|
+
"-mr-2",
|
|
219
|
+
"border-gray-200"
|
|
220
|
+
],
|
|
221
|
+
};
|
|
222
|
+
|
|
223
|
+
export default config
|
package/tailwind.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// Get the config from your actual config file
|
|
2
|
+
import tailwindConfig from "./tailwind.config";
|
|
3
|
+
|
|
4
|
+
type ExtractThemeTypes<T> = T extends { theme: { extend: infer E } }
|
|
5
|
+
? E
|
|
6
|
+
: never;
|
|
7
|
+
|
|
8
|
+
declare module "tailwindcss/types/generated/default-theme" {
|
|
9
|
+
export interface DefaultTheme
|
|
10
|
+
extends ExtractThemeTypes<typeof tailwindConfig> {}
|
|
11
|
+
}
|
package/tsconfig.json
CHANGED
package/tsup.config.ts
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
|
+
import { exec } from "child_process";
|
|
1
2
|
import fixReactVirtualized from "esbuild-plugin-react-virtualized";
|
|
2
3
|
import { defineConfig } from "tsup";
|
|
4
|
+
import { promisify } from "util";
|
|
5
|
+
|
|
6
|
+
const execAsync = promisify(exec);
|
|
3
7
|
|
|
4
8
|
// "build": "tsup src/index.tsx --format cjs,esm --dts --sourcemap",
|
|
5
9
|
export default defineConfig({
|
|
@@ -9,4 +13,16 @@ export default defineConfig({
|
|
|
9
13
|
sourcemap: true,
|
|
10
14
|
noExternal: ["react-virtualized"],
|
|
11
15
|
esbuildPlugins: [fixReactVirtualized],
|
|
16
|
+
async onSuccess() {
|
|
17
|
+
// Build Tailwind CSS after successful tsup build
|
|
18
|
+
try {
|
|
19
|
+
const { stdout, stderr } = await execAsync(
|
|
20
|
+
"tailwindcss -i ./src/index.css -o ./dist/index.css --minify"
|
|
21
|
+
);
|
|
22
|
+
if (stdout) console.info(stdout);
|
|
23
|
+
if (stderr) console.error(stderr);
|
|
24
|
+
} catch (error) {
|
|
25
|
+
console.error("Error building CSS:", error);
|
|
26
|
+
}
|
|
27
|
+
},
|
|
12
28
|
});
|