@douglasneuroinformatics/libui 3.9.0 → 4.0.1
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/README.md +3 -48
- package/dist/{chunk-IYOZHDZL.js → chunk-655XRTXX.js} +1 -1
- package/dist/{chunk-IYOZHDZL.js.map → chunk-655XRTXX.js.map} +1 -1
- package/dist/{chunk-VJSOLDCS.js → chunk-HCQE34RL.js} +1 -1
- package/dist/chunk-HCQE34RL.js.map +1 -0
- package/dist/{chunk-JTEI2ZYI.js → chunk-KI6BSSS6.js} +3 -4
- package/dist/chunk-KI6BSSS6.js.map +1 -0
- package/dist/components.d.ts +77 -29
- package/dist/components.js +67 -69
- package/dist/components.js.map +1 -1
- package/dist/hooks.d.ts +1 -1
- package/dist/hooks.js +3 -3
- package/dist/i18n.d.ts +2 -2
- package/dist/i18n.js +1 -1
- package/dist/tailwind/globals.css +181 -39
- package/dist/{types-CU3FS63U.d.ts → types-CMuti1SJ.d.ts} +2 -2
- package/dist/utils.js +1 -1
- package/package.json +88 -82
- package/src/components/ActionDropdown/ActionDropdown.tsx +1 -1
- package/src/components/ArrowToggle/ArrowToggle.spec.tsx +3 -1
- package/src/components/ArrowToggle/ArrowToggle.tsx +3 -1
- package/src/components/Badge/Badge.tsx +7 -5
- package/src/components/Button/Button.tsx +7 -6
- package/src/components/Card/Card.tsx +3 -3
- package/src/components/Chart/ChartContainer.tsx +1 -1
- package/src/components/Checkbox/Checkbox.tsx +1 -1
- package/src/components/ClientTable/ClientTable.stories.tsx +12 -9
- package/src/components/ClientTable/ClientTable.tsx +3 -3
- package/src/components/Collapsible/Collapsible.stories.tsx +3 -3
- package/src/components/Command/CommandInput.tsx +1 -1
- package/src/components/Command/CommandItem.tsx +1 -1
- package/src/components/ContextMenu/ContextMenuCheckboxItem.tsx +1 -1
- package/src/components/ContextMenu/ContextMenuItem.tsx +1 -1
- package/src/components/ContextMenu/ContextMenuRadioItem.tsx +1 -1
- package/src/components/ContextMenu/ContextMenuSubTrigger.tsx +1 -1
- package/src/components/CopyButton/CopyButton.tsx +3 -1
- package/src/components/DatePicker/DatePicker.tsx +3 -3
- package/src/components/Dialog/DialogContent.tsx +2 -2
- package/src/components/DropdownButton/DropdownButton.tsx +1 -1
- package/src/components/DropdownMenu/DropdownMenuCheckboxItem.tsx +1 -1
- package/src/components/DropdownMenu/DropdownMenuItem.tsx +1 -1
- package/src/components/DropdownMenu/DropdownMenuRadioItem.tsx +1 -1
- package/src/components/DropdownMenu/DropdownMenuSubTrigger.tsx +1 -1
- package/src/components/FileDropzone/FileDropzone.stories.tsx +4 -6
- package/src/components/FileDropzone/FileDropzone.tsx +2 -1
- package/src/components/Form/BooleanField/BooleanField.spec.tsx +3 -1
- package/src/components/Form/BooleanField/BooleanField.tsx +5 -2
- package/src/components/Form/DateField/DateField.tsx +2 -1
- package/src/components/Form/Form.stories.tsx +15 -15
- package/src/components/Form/NumberField/NumberField.tsx +7 -3
- package/src/components/Form/NumberField/NumberFieldSelect.tsx +2 -1
- package/src/components/Form/RecordArrayField.tsx +1 -3
- package/src/components/Form/ScalarField.tsx +10 -5
- package/src/components/Form/StaticField.tsx +2 -1
- package/src/components/Form/StringField/StringField.tsx +9 -4
- package/src/components/Form/StringField/StringFieldPassword.tsx +5 -5
- package/src/components/Form/StringField/StringFieldSelect.tsx +2 -1
- package/src/components/HoverCard/HoverCardContent.tsx +1 -1
- package/src/components/Input/Input.tsx +1 -1
- package/src/components/Label/Label.tsx +2 -1
- package/src/components/LanguageToggle/LanguageToggle.tsx +3 -1
- package/src/components/LineGraph/LineGraph.tsx +3 -2
- package/src/components/ListboxDropdown/ListboxDropdown.stories.tsx +4 -4
- package/src/components/ListboxDropdown/ListboxDropdown.tsx +2 -1
- package/src/components/MenuBar/MenuBarCheckboxItem.tsx +1 -1
- package/src/components/MenuBar/MenuBarItem.tsx +1 -1
- package/src/components/MenuBar/MenuBarRadioItem.tsx +1 -1
- package/src/components/MenuBar/MenuBarRoot.tsx +1 -1
- package/src/components/MenuBar/MenuBarSubTrigger.tsx +1 -1
- package/src/components/MenuBar/MenuBarTrigger.tsx +1 -1
- package/src/components/NotificationHub/NotificationHub.tsx +3 -3
- package/src/components/NotificationHub/NotificationIcon.tsx +1 -1
- package/src/components/Pagination/PaginationLink.tsx +3 -1
- package/src/components/Pagination/PaginationPrevious.tsx +3 -1
- package/src/components/Popover/PopoverContent.tsx +1 -1
- package/src/components/RadioGroup/RadioGroup.spec.tsx +3 -1
- package/src/components/RadioGroup/RadioGroupItem.tsx +1 -1
- package/src/components/Resizable/Resizable.tsx +7 -3
- package/src/components/Resizable/ResizableHandle.tsx +2 -2
- package/src/components/SearchBar/SearchBar.tsx +3 -1
- package/src/components/Select/SelectItem.tsx +1 -1
- package/src/components/Sheet/SheetContent.tsx +3 -2
- package/src/components/Slider/Slider.tsx +4 -4
- package/src/components/StatisticCard/StatisticCard.tsx +2 -1
- package/src/components/Switch/Switch.tsx +2 -2
- package/src/components/Tabs/TabsContent.tsx +1 -1
- package/src/components/Tabs/TabsTrigger.tsx +1 -1
- package/src/components/TextArea/TextArea.tsx +1 -1
- package/src/components/ThemeToggle/ThemeToggle.tsx +3 -1
- package/src/components/Tooltip/TooltipTrigger.tsx +3 -1
- package/src/hooks/useEventListener/useEventListener.ts +2 -1
- package/src/hooks/useOnClickOutside/useOnClickOutside.ts +1 -1
- package/src/hooks/useStorage/useLocalStorage.ts +3 -1
- package/src/hooks/useStorage/useSessionStorage.ts +3 -1
- package/src/hooks/useTheme/useTheme.test.ts +14 -11
- package/src/i18n/internal.ts +1 -1
- package/src/i18n/types.ts +2 -2
- package/src/tailwind/globals.css +181 -39
- package/src/utils/index.ts +2 -1
- package/dist/chunk-JTEI2ZYI.js.map +0 -1
- package/dist/chunk-VJSOLDCS.js.map +0 -1
- package/dist/tailwind/config.cjs +0 -178
- package/dist/tailwind/config.cjs.map +0 -1
- package/dist/tailwind/config.d.cts +0 -16
- package/src/tailwind/config.cts +0 -174
- package/tailwind.config.cjs +0 -3
package/src/tailwind/config.cts
DELETED
|
@@ -1,174 +0,0 @@
|
|
|
1
|
-
import type { Config } from 'tailwindcss';
|
|
2
|
-
import type { CustomThemeConfig, PluginsConfig } from 'tailwindcss/types/config';
|
|
3
|
-
|
|
4
|
-
import fs = require('node:fs');
|
|
5
|
-
import path = require('node:path');
|
|
6
|
-
|
|
7
|
-
import animate = require('tailwindcss-animate');
|
|
8
|
-
import containerQueries = require('@tailwindcss/container-queries');
|
|
9
|
-
import plugin = require('tailwindcss/plugin');
|
|
10
|
-
import _ = require('lodash-es');
|
|
11
|
-
|
|
12
|
-
const packageRoot = path.dirname(require.resolve('@douglasneuroinformatics/libui/package.json'));
|
|
13
|
-
|
|
14
|
-
const isDev = fs.existsSync(path.resolve(packageRoot, 'src'));
|
|
15
|
-
|
|
16
|
-
type ConfigOptions = {
|
|
17
|
-
content?: string[];
|
|
18
|
-
include?: string[];
|
|
19
|
-
includeOwnContent?: boolean;
|
|
20
|
-
plugins?: PluginsConfig;
|
|
21
|
-
root?: string;
|
|
22
|
-
extend?: {
|
|
23
|
-
theme?: Partial<CustomThemeConfig> | Partial<CustomThemeConfig>[];
|
|
24
|
-
};
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
const config = ({
|
|
28
|
-
content = [],
|
|
29
|
-
include = [],
|
|
30
|
-
includeOwnContent = true,
|
|
31
|
-
root = undefined,
|
|
32
|
-
plugins = [],
|
|
33
|
-
extend = {}
|
|
34
|
-
}: ConfigOptions = {}): Config => {
|
|
35
|
-
if (includeOwnContent) {
|
|
36
|
-
if (isDev) {
|
|
37
|
-
content.push(path.resolve(packageRoot, 'src/**/*.{js,jsx,ts,tsx}'));
|
|
38
|
-
} else {
|
|
39
|
-
content.push(path.resolve(packageRoot, 'dist/**/*.js'));
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
for (const id of include) {
|
|
44
|
-
const baseDir = path.dirname(require.resolve(`${id}/package.json`, { paths: root ? [root] : undefined }));
|
|
45
|
-
content.push(path.resolve(baseDir, 'src/**/*.{js,ts,jsx,tsx}'));
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
let userTheme: Partial<CustomThemeConfig>[];
|
|
49
|
-
if (Array.isArray(extend.theme)) {
|
|
50
|
-
userTheme = extend.theme;
|
|
51
|
-
} else if (_.isPlainObject(extend.theme)) {
|
|
52
|
-
userTheme = [extend.theme!];
|
|
53
|
-
} else {
|
|
54
|
-
userTheme = [];
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
return {
|
|
58
|
-
content,
|
|
59
|
-
darkMode: ['class', '[data-mode="dark"]'],
|
|
60
|
-
plugins: [
|
|
61
|
-
animate,
|
|
62
|
-
containerQueries,
|
|
63
|
-
plugin((api) => {
|
|
64
|
-
api.addUtilities({
|
|
65
|
-
'.scrollbar-none': {
|
|
66
|
-
'&::-webkit-scrollbar': {
|
|
67
|
-
display: 'none'
|
|
68
|
-
},
|
|
69
|
-
'-ms-overflow-style': 'none',
|
|
70
|
-
'scrollbar-width': 'none'
|
|
71
|
-
}
|
|
72
|
-
});
|
|
73
|
-
}),
|
|
74
|
-
...plugins
|
|
75
|
-
],
|
|
76
|
-
theme: {
|
|
77
|
-
container: {
|
|
78
|
-
center: true,
|
|
79
|
-
padding: {
|
|
80
|
-
DEFAULT: '1rem',
|
|
81
|
-
md: '2rem',
|
|
82
|
-
xl: '3rem'
|
|
83
|
-
}
|
|
84
|
-
},
|
|
85
|
-
extend: _.merge(
|
|
86
|
-
{
|
|
87
|
-
animation: {
|
|
88
|
-
'accordion-down': 'accordion-down 0.2s ease-out',
|
|
89
|
-
'accordion-up': 'accordion-up 0.2s ease-out',
|
|
90
|
-
spinner: 'spinner-spin 1.7s infinite ease, round 1.7s infinite ease'
|
|
91
|
-
},
|
|
92
|
-
borderRadius: {
|
|
93
|
-
lg: `var(--radius)`,
|
|
94
|
-
md: `calc(var(--radius) - 2px)`,
|
|
95
|
-
sm: 'calc(var(--radius) - 4px)'
|
|
96
|
-
},
|
|
97
|
-
colors: {
|
|
98
|
-
accent: {
|
|
99
|
-
DEFAULT: 'var(--accent)',
|
|
100
|
-
foreground: 'var(--accent-foreground)'
|
|
101
|
-
},
|
|
102
|
-
background: 'var(--background)',
|
|
103
|
-
border: 'var(--border)',
|
|
104
|
-
card: {
|
|
105
|
-
DEFAULT: 'var(--card)',
|
|
106
|
-
foreground: 'var(--card-foreground)'
|
|
107
|
-
},
|
|
108
|
-
destructive: {
|
|
109
|
-
DEFAULT: 'var(--destructive)',
|
|
110
|
-
foreground: 'var(--destructive-foreground)'
|
|
111
|
-
},
|
|
112
|
-
foreground: 'var(--foreground)',
|
|
113
|
-
input: 'var(--input)',
|
|
114
|
-
muted: {
|
|
115
|
-
DEFAULT: 'var(--muted)',
|
|
116
|
-
foreground: 'var(--muted-foreground)'
|
|
117
|
-
},
|
|
118
|
-
popover: {
|
|
119
|
-
DEFAULT: 'var(--popover)',
|
|
120
|
-
foreground: 'var(--popover-foreground)'
|
|
121
|
-
},
|
|
122
|
-
primary: {
|
|
123
|
-
DEFAULT: 'var(--primary)',
|
|
124
|
-
foreground: 'var(--primary-foreground)'
|
|
125
|
-
},
|
|
126
|
-
ring: 'var(--ring)',
|
|
127
|
-
secondary: {
|
|
128
|
-
DEFAULT: 'var(--secondary)',
|
|
129
|
-
foreground: 'var(--secondary-foreground)'
|
|
130
|
-
}
|
|
131
|
-
},
|
|
132
|
-
keyframes: {
|
|
133
|
-
'accordion-down': {
|
|
134
|
-
from: { height: '0' },
|
|
135
|
-
to: { height: 'var(--radix-accordion-content-height)' }
|
|
136
|
-
},
|
|
137
|
-
'accordion-up': {
|
|
138
|
-
from: { height: 'var(--radix-accordion-content-height)' },
|
|
139
|
-
to: { height: '0' }
|
|
140
|
-
},
|
|
141
|
-
round: {
|
|
142
|
-
'0%': {
|
|
143
|
-
transform: 'rotate(0deg)'
|
|
144
|
-
},
|
|
145
|
-
'100%': {
|
|
146
|
-
transform: 'rotate(360deg)'
|
|
147
|
-
}
|
|
148
|
-
},
|
|
149
|
-
'spinner-spin': {
|
|
150
|
-
'0%, 5%, 95%, 100%': {
|
|
151
|
-
boxShadow: `0 -0.83em 0 -0.4em, 0 -0.83em 0 -0.42em, 0 -0.83em 0 -0.44em, 0 -0.83em 0 -0.46em, 0 -0.83em 0 -0.477em`
|
|
152
|
-
},
|
|
153
|
-
'10%, 59%': {
|
|
154
|
-
boxShadow: `0 -0.83em 0 -0.4em, -0.087em -0.825em 0 -0.42em, -0.173em -0.812em 0 -0.44em, -0.256em -0.789em 0 -0.46em, -0.297em -0.775em 0 -0.477em`
|
|
155
|
-
},
|
|
156
|
-
'20%': {
|
|
157
|
-
boxShadow: `0 -0.83em 0 -0.4em, -0.338em -0.758em 0 -0.42em, -0.555em -0.617em 0 -0.44em, -0.671em -0.488em 0 -0.46em, -0.749em -0.34em 0 -0.477em`
|
|
158
|
-
},
|
|
159
|
-
'38%': {
|
|
160
|
-
boxShadow: `0 -0.83em 0 -0.4em, -0.377em -0.74em 0 -0.42em, -0.645em -0.522em 0 -0.44em, -0.775em -0.297em 0 -0.46em, -0.82em -0.09em 0 -0.477em`
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
},
|
|
164
|
-
screens: {
|
|
165
|
-
'2xl': '1400px'
|
|
166
|
-
}
|
|
167
|
-
},
|
|
168
|
-
...userTheme
|
|
169
|
-
) as Partial<CustomThemeConfig>
|
|
170
|
-
}
|
|
171
|
-
};
|
|
172
|
-
};
|
|
173
|
-
|
|
174
|
-
export = config;
|
package/tailwind.config.cjs
DELETED