@noya-app/noya-designsystem 0.1.31 → 0.1.33

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.
Files changed (61) hide show
  1. package/.turbo/turbo-build.log +20 -12
  2. package/.turbo/turbo-lint.log +2 -1
  3. package/CHANGELOG.md +14 -0
  4. package/README.md +13 -1
  5. package/dist/index.css +1 -0
  6. package/dist/index.d.ts +132 -509
  7. package/dist/index.js +4167 -2716
  8. package/dist/index.js.map +1 -1
  9. package/dist/index.mjs +4097 -2643
  10. package/dist/index.mjs.map +1 -1
  11. package/package.json +15 -6
  12. package/src/components/ActivityIndicator.tsx +4 -36
  13. package/src/components/Avatar.tsx +63 -62
  14. package/src/components/Button.tsx +53 -172
  15. package/src/components/Chip.tsx +117 -150
  16. package/src/components/ContextMenu.tsx +13 -35
  17. package/src/components/Dialog.tsx +66 -54
  18. package/src/components/Divider.tsx +31 -41
  19. package/src/components/DraggableMenuButton.tsx +29 -30
  20. package/src/components/DropdownMenu.tsx +30 -40
  21. package/src/components/FillInputField.tsx +16 -26
  22. package/src/components/FillPreviewBackground.tsx +18 -22
  23. package/src/components/FloatingWindow.tsx +4 -7
  24. package/src/components/GridView.tsx +70 -200
  25. package/src/components/IconButton.tsx +1 -5
  26. package/src/components/InputField.tsx +191 -194
  27. package/src/components/InputFieldWithCompletions.tsx +20 -27
  28. package/src/components/InspectorContainer.tsx +4 -9
  29. package/src/components/InspectorPrimitives.tsx +135 -109
  30. package/src/components/Label.tsx +5 -36
  31. package/src/components/LabeledElementView.tsx +5 -26
  32. package/src/components/ListView.tsx +239 -167
  33. package/src/components/Popover.tsx +15 -39
  34. package/src/components/Progress.tsx +21 -44
  35. package/src/components/RadioGroup.tsx +6 -71
  36. package/src/components/ScrollArea.tsx +11 -39
  37. package/src/components/SelectMenu.tsx +31 -48
  38. package/src/components/Slider.tsx +7 -43
  39. package/src/components/Spacer.tsx +6 -18
  40. package/src/components/Switch.tsx +4 -42
  41. package/src/components/Text.tsx +31 -66
  42. package/src/components/TextArea.tsx +5 -31
  43. package/src/components/Toast.tsx +15 -57
  44. package/src/components/Tooltip.tsx +4 -13
  45. package/src/components/WorkspaceLayout.tsx +4 -14
  46. package/src/components/internal/Menu.tsx +37 -83
  47. package/src/contexts/DesignSystemConfiguration.tsx +1 -47
  48. package/src/contexts/DialogContext.tsx +2 -10
  49. package/src/hooks/useDarkMode.ts +14 -0
  50. package/src/index.css +108 -0
  51. package/src/index.tsx +3 -4
  52. package/src/theme/index.ts +4 -16
  53. package/src/utils/tailwind.ts +17 -0
  54. package/tailwind.config.ts +106 -166
  55. package/tsup.config.ts +16 -0
  56. package/dist/index.d.mts +0 -1443
  57. package/src/components/Grid.tsx +0 -54
  58. package/src/components/Stack.tsx +0 -164
  59. package/src/theme/dark.ts +0 -45
  60. package/src/theme/light.ts +0 -226
  61. package/src/utils/breakpoints.ts +0 -45
@@ -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";
@@ -46,7 +45,6 @@ export * from "./components/Slider";
46
45
  export * from "./components/Sortable";
47
46
  export type { RelativeDropPosition } from "./components/Sortable";
48
47
  export * from "./components/Spacer";
49
- export * from "./components/Stack";
50
48
  export * from "./components/Switch";
51
49
  export * from "./components/Text";
52
50
  export * from "./components/TextArea";
@@ -71,11 +69,12 @@ export * from "./hooks/useHover";
71
69
  export * from "./hooks/usePlatform";
72
70
  export * from "./mediaQuery";
73
71
  export * from "./theme";
74
- export * as darkTheme from "./theme/dark";
75
- export * as lightTheme from "./theme/light";
72
+ export { cn } from './utils/tailwind';
73
+ export type { ThemeColor } from './utils/tailwind';
76
74
  export * from "./utils/createSectionedMenu";
77
75
  export * from "./utils/getGradientBackground";
78
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";
@@ -1,17 +1,5 @@
1
- import * as lightTheme from './light';
1
+ import tailwindConfig from "../../tailwind.config";
2
2
 
3
- export type Theme = typeof lightTheme;
4
-
5
- declare module 'styled-components' {
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
+ }
@@ -1,167 +1,71 @@
1
1
  import { Config } from "tailwindcss";
2
2
 
3
- export default {
3
+ const config: Config = {
4
4
  content: ["./src/**/*.{ts,tsx}"],
5
- // if you add the dark className anywhere in the DOM tree all descendants will use dark style variables
6
- darkMode: "class",
5
+ corePlugins: {
6
+ // disables @tailwind base global styles
7
+ preflight: false,
8
+ },
7
9
  theme: {
8
10
  extend: {
9
- // colors should alway have a flat structure with the exception of dark/DEFAULT variables
10
- // keys should always be kebab-case, since that's the tailwind convention
11
11
  colors: {
12
- "logo-fill": {
13
- DEFAULT: "rgb(150, 152, 172)",
14
- dark: "rgb(248, 248, 250)",
15
- },
16
- "logo-highlight": {
17
- DEFAULT: "rgb(150, 152, 172)",
18
- dark: "rgb(248, 248, 250)",
19
- },
20
- background: "rgb(255, 255, 255)",
21
- text: {
22
- DEFAULT: "rgb(38, 48, 83)",
23
- dark: "rgb(248, 248, 250)",
24
- },
25
- "text-muted": {
26
- DEFAULT: "rgb(107, 113, 136)",
27
- dark: "rgb(180, 179, 182)",
28
- },
29
- "text-subtle": {
30
- DEFAULT: "rgb(117, 121, 129)",
31
- dark: "rgb(180, 179, 182)",
32
- },
33
- "text-disabled": {
34
- DEFAULT: "rgb(150, 152, 172)",
35
- dark: "rgb(100, 99, 102)",
36
- },
37
- "text-decorative": {
38
- light: "rgb(168, 185, 212)",
39
- },
40
- "divider-subtle": {
41
- DEFAULT: "rgba(30, 50, 100, 0.04)",
42
- dark: "rgba(255, 255, 255, 0.04)",
43
- },
44
- divider: {
45
- DEFAULT: "rgba(30, 50, 100, 0.07)",
46
- dark: "rgba(255, 255, 255, 0.08)",
47
- },
48
- "divider-strong": {
49
- DEFAULT: "rgba(30, 50, 100, 0.09)",
50
- dark: "rgba(0, 0, 0, 1)",
51
- },
52
- primary: {
53
- DEFAULT: "rgb(103, 70, 255)",
54
- dark: "rgb(119, 66, 255)",
55
- },
56
- "primary-light": {
57
- DEFAULT: "rgb(147, 86, 255)",
58
- dark: "rgb(134, 86, 255)",
59
- },
60
- "primary-pastel": "rgba(234, 230, 255)",
61
- secondary: "rgb(0, 151, 117)",
62
- "secondary-light": "rgb(0, 160, 129)",
63
- "secondary-pastel": "rgb(205, 238, 231)",
64
- "secondary-bright": {
65
- DEFAULT: "#0ab557",
66
- dark: "#36fe91",
67
- },
68
- "input-background": {
69
- DEFAULT: "rgb(240, 242, 246)",
70
- dark: "rgba(181, 178, 255, 0.08)",
71
- },
72
- "input-background-light": {
73
- DEFAULT: "rgb(243, 245, 249)",
74
- dark: "rgba(181, 178, 255, 0.10)",
75
- },
76
- "code-background": {
77
- DEFAULT: "rgb(250, 250, 250)",
78
- dark: "rgb(20, 19, 23)",
79
- },
80
- "code-background-decorative-dark": "#435080",
81
- "selected-background": "rgb(242, 245, 250)",
82
- "breadcrumb-text": {
83
- DEFAULT: "rgb(107, 113, 136)",
84
- dark: "rgb(180, 179, 182)",
85
- },
86
- "breadcrumb-text-hover": "rgb(117, 121, 129)",
87
- "breadcrumb-icon": "rgb(129, 131, 165)",
88
- "canvas-background": {
89
- DEFAULT: "rgb(249, 249, 249)",
90
- dark: "rgb(20, 19, 23)",
91
- },
92
- "canvas-grid": {
93
- DEFAULT: "rgba(0, 0, 0, 0.05)",
94
- dark: "rgba(0, 0, 0, 0.1)",
95
- },
96
- "sidebar-background": {
97
- DEFAULT: "rgb(255, 255, 255)",
98
- dark: "rgb(34, 33, 39)",
99
- },
100
- "sidebar-background-transparent": {
101
- DEFAULT: "rgba(255, 255, 255, 0.85)",
102
- dark: "rgba(34, 33, 39, 0.95)",
103
- },
104
- "popover-background": {
105
- DEFAULT: "rgb(252, 252, 252)",
106
- dark: "rgb(34, 33, 39)",
107
- },
108
- "popover-divider": {
109
- DEFAULT: "transparent",
110
- dark: "rgba(255, 255, 255, 0.08)",
111
- },
112
- "listview-raised-background": {
113
- DEFAULT: "rgba(0, 0, 0, 0.03)",
114
- dark: "rgba(181, 178, 255, 0.1)",
115
- },
116
- "listview-editing-background": {
117
- DEFAULT: "#fff",
118
- dark: "#000",
119
- },
120
- "slider-background": {
121
- DEFAULT: "white",
122
- dark: "#BBB",
123
- },
124
- "slider-border": "#BBB",
125
- "radio-group-background": {
126
- DEFAULT: "white",
127
- dark: "rgba(181, 178, 255, 0.08)",
128
- },
129
- mask: {
130
- DEFAULT: "rgb(12, 193, 67)",
131
- dark: "rgb(102, 187, 106)",
132
- },
133
- "transparent-checker": {
134
- DEFAULT: "rgba(255, 255, 255, 0.8)",
135
- dark: "rgba(255, 255, 255, 0.3)",
136
- },
137
- scrollbar: {
138
- DEFAULT: "rgba(199, 199, 199, 0.8)",
139
- dark: "rgba(199, 199, 199, 0.2)",
140
- },
141
- "placeholder-dots": {
142
- DEFAULT: "rgba(0, 0, 0, 0.3)",
143
- dark: "rgba(255, 255, 255, 0.3)",
144
- },
145
- "drag-outline": {
146
- DEFAULT: "rgb(103, 70, 255)",
147
- dark: "white",
148
- },
149
- "active-background": {
150
- DEFAULT: "rgba(0, 0, 0, 0.1)",
151
- dark: "rgba(181, 178, 255, 0.08)",
152
- },
153
- "thumbnail-background": {
154
- DEFAULT: "#f0efff",
155
- dark: "#1f1d33",
156
- },
157
- "thumbnail-shadow": {
158
- DEFAULT: "#D3CEED66",
159
- dark: "#1f1d3366",
160
- },
161
- "inline-code-text": "rgb(103, 70, 255)",
162
- "inline-code-background": "rgb(240, 242, 246)",
163
- "text-link": "rgb(103, 70, 255)",
164
- "text-link-focused": "rgb(147, 86, 255)",
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)",
165
69
  },
166
70
  fontFamily: {
167
71
  sans: [
@@ -270,14 +174,50 @@ export default {
270
174
  large: "32px",
271
175
  xlarge: "64px",
272
176
  xxlarge: "128px",
273
- "inset-top": "46px",
274
- "sidebar-width": "260px",
275
- "toolbar-height": "8px",
276
- "toolbar-separator": "8px",
277
- "inspector-h-separator": "8px",
278
- "inspector-v-separator": "10px",
279
- "dialog-padding": "16px",
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",
280
202
  },
281
203
  },
282
204
  },
283
- } as Config;
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/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
  });