Skip to content

Commit 0db29aa

Browse files
authored
Merge pull request #53 from DouglasNeuroInformatics/dev
Update to Tailwind v4 and React v19
2 parents d142a0d + 23154f8 commit 0db29aa

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+1633
-2164
lines changed

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
lts/iron
1+
lts/jod

.storybook/preview.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import '../src/tailwind/globals.css';
88
i18n.init();
99

1010
const preview: Preview = {
11-
globals: {
11+
initialGlobals: {
1212
locale: 'en',
1313
locales: {
1414
en: 'English',

.storybook/theme.ts

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,49 @@
11
import { create } from '@storybook/theming/create';
2+
import { formatRgb } from 'culori';
23
import colors from 'tailwindcss/colors';
34
import defaultTheme from 'tailwindcss/defaultTheme';
45

56
import logo from '../src/assets/libui-logo.svg';
67

78
export default create({
8-
appBg: colors.slate['800'],
9+
appBg: formatRgb(colors.slate['800']),
910

10-
appBorderColor: colors.slate['700'],
11+
appBorderColor: formatRgb(colors.slate['700']),
1112
appBorderRadius: 4,
1213

13-
appContentBg: colors.slate['800'],
14-
appPreviewBg: colors.slate['800'],
15-
barBg: colors.slate['700'],
16-
barHoverColor: colors.sky['500'],
14+
appContentBg: formatRgb(colors.slate['800']),
15+
appPreviewBg: formatRgb(colors.slate['800']),
16+
barBg: formatRgb(colors.slate['700']),
17+
barHoverColor: formatRgb(colors.sky['500']),
1718

18-
barSelectedColor: colors.slate['300'],
19-
barTextColor: colors.slate['300'],
19+
barSelectedColor: formatRgb(colors.slate['300']),
20+
barTextColor: formatRgb(colors.slate['300']),
2021

2122
base: 'dark',
22-
booleanBg: colors.sky['700'],
23-
booleanSelectedBg: colors.sky['500'],
23+
booleanBg: formatRgb(colors.sky['700']),
24+
booleanSelectedBg: formatRgb(colors.sky['500']),
2425
brandImage: logo,
2526
brandTarget: '_self',
2627

2728
brandTitle: 'libui',
2829
brandUrl: 'https://github.com/DouglasNeuroInformatics/libui',
29-
buttonBg: colors.sky['700'],
30+
buttonBg: formatRgb(colors.sky['700']),
3031

31-
buttonBorder: colors.sky['500'],
32-
colorPrimary: colors.slate['800'],
33-
colorSecondary: colors.slate['400'],
32+
buttonBorder: formatRgb(colors.sky['500']),
33+
colorPrimary: formatRgb(colors.slate['800']),
34+
colorSecondary: formatRgb(colors.slate['400']),
3435
fontBase: defaultTheme.fontFamily.sans.join(','),
3536

3637
fontCode: defaultTheme.fontFamily.mono.join(', '),
3738
gridCellSize: 5,
3839

39-
inputBg: colors.slate['700'],
40-
inputBorder: colors.slate['600'],
40+
inputBg: formatRgb(colors.slate['700']),
41+
inputBorder: formatRgb(colors.slate['600']),
4142

4243
inputBorderRadius: 4,
43-
inputTextColor: colors.slate['100'],
44-
textColor: colors.slate['100'],
45-
textInverseColor: colors.slate['900'],
44+
inputTextColor: formatRgb(colors.slate['100']),
45+
textColor: formatRgb(colors.slate['100']),
46+
textInverseColor: formatRgb(colors.slate['900']),
4647

47-
textMutedColor: colors.slate['500']
48+
textMutedColor: formatRgb(colors.slate['500'])
4849
});

README.md

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@
3131

3232
## About
3333

34-
A React component library built by the Douglas Neuroinformatics Platform (DNP) using [shadcn/ui](https://github.com/shadcn-ui/ui) with [React](https://react.dev/) and [TailwindCSS](https://tailwindcss.com/). Although primarily intended for internal use in our platforms, it is
35-
designed as a generic implementation.
34+
A React component library built by the Douglas Neuroinformatics Platform (DNP) using [shadcn/ui](https://github.com/shadcn-ui/ui) with [React](https://react.dev/) and [TailwindCSS](https://tailwindcss.com/). Although primarily intended for internal use in our platforms, it is designed as a generic implementation.
3635

3736
## Installation
3837

@@ -42,14 +41,13 @@ pnpm install @douglasneuroinformatics/libui
4241

4342
## Usage
4443

45-
**tailwind.config.cjs**
44+
**globals.css**
4645

47-
```js
48-
const config = require('@douglasneuroinformatics/libui/tailwind/config');
46+
```css
47+
@import '@douglasneuroinformatics/libui/tailwind/globals.css';
4948

50-
module.exports = config({
51-
content: ['./index.html', './src/**/*.{js,ts,jsx,tsx}']
52-
});
49+
// adjust as required
50+
@source "../node_modules/@douglasneuroinformatics/libui";
5351
```
5452

5553
**i18n.ts**
@@ -78,7 +76,7 @@ init({ translations: { common } });
7876
**main.tsx**
7977

8078
```js
81-
import '@douglasneuroinformatics/libui/tailwind/globals.css';
79+
import './globals.css';
8280
import './i18n';
8381
```
8482

package.json

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "@douglasneuroinformatics/libui",
33
"type": "module",
44
"version": "3.9.0",
5-
"packageManager": "[email protected].0",
5+
"packageManager": "[email protected].1",
66
"description": "Generic UI components for DNP projects, built using React and Tailwind CSS",
77
"author": "Joshua Unrau",
88
"license": "Apache-2.0",
@@ -32,10 +32,6 @@
3232
"import": "./dist/i18n.js"
3333
},
3434
"./package.json": "./package.json",
35-
"./tailwind/config": {
36-
"types": "./dist/tailwind/config.d.cts",
37-
"require": "./dist/tailwind/config.cjs"
38-
},
3935
"./tailwind/globals.css": "./dist/tailwind/globals.css",
4036
"./utils": {
4137
"types": "./dist/utils.d.ts",
@@ -51,6 +47,9 @@
5147
"/tailwind.config.cjs",
5248
"/tailwind.config.d.cts"
5349
],
50+
"engines": {
51+
"node": "22.x"
52+
},
5453
"scripts": {
5554
"build": "rm -rf dist && tsup --config tsup.config.mts",
5655
"format": "prettier --write src",
@@ -63,13 +62,13 @@
6362
"test:coverage": "vitest --coverage"
6463
},
6564
"peerDependencies": {
66-
"react": "^18.2.0",
67-
"react-dom": "^18.2.0",
68-
"tailwindcss": "^3.4.10",
65+
"react": "^19.1.0",
66+
"react-dom": "^19.1.0",
67+
"tailwindcss": "^4.1.0",
6968
"zod": "^3.23.6"
7069
},
7170
"dependencies": {
72-
"@douglasneuroinformatics/libjs": "^1.5.1",
71+
"@douglasneuroinformatics/libjs": "^2.7.0",
7372
"@douglasneuroinformatics/libui-form-types": "^0.11.0",
7473
"@radix-ui/react-accordion": "^1.2.3",
7574
"@radix-ui/react-alert-dialog": "^1.1.6",
@@ -93,7 +92,6 @@
9392
"@radix-ui/react-switch": "^1.1.3",
9493
"@radix-ui/react-tabs": "^1.1.3",
9594
"@radix-ui/react-tooltip": "^1.1.8",
96-
"@tailwindcss/container-queries": "^0.1.1",
9795
"class-variance-authority": "^0.7.1",
9896
"clsx": "^2.1.1",
9997
"cmdk": "^1.1.1",
@@ -105,11 +103,11 @@
105103
"react-resizable-panels": "^2.1.7",
106104
"recharts": "^2.15.1",
107105
"tailwind-merge": "^2.6.0",
108-
"tailwindcss-animate": "^1.0.7",
109106
"ts-pattern": "^5.7.0",
110-
"type-fest": "^4.38.0",
111-
"vaul": "^0.9.9",
112-
"zustand": "^4.5.6"
107+
"tw-animate-css": "^1.2.5",
108+
"type-fest": "^4.39.0",
109+
"vaul": "^1.1.2",
110+
"zustand": "^5.0.3"
113111
},
114112
"devDependencies": {
115113
"@douglasneuroinformatics/eslint-config": "^5.3.2",
@@ -127,30 +125,31 @@
127125
"@storybook/react": "^8.6.11",
128126
"@storybook/react-vite": "^8.6.11",
129127
"@storybook/theming": "^8.6.11",
128+
"@tailwindcss/vite": "^4.1.0",
130129
"@testing-library/dom": "^10.4.0",
131130
"@testing-library/jest-dom": "^6.6.3",
132131
"@testing-library/react": "16.2.0",
133132
"@testing-library/user-event": "^14.6.1",
133+
"@types/culori": "^2.1.1",
134134
"@types/lodash-es": "^4.17.12",
135-
"@types/node": "^20.17.28",
136-
"@types/react": "^18.3.20",
137-
"@types/react-dom": "^18.3.5",
135+
"@types/node": "22.x",
136+
"@types/react": "^19.0.12",
137+
"@types/react-dom": "^19.0.4",
138138
"@vitejs/plugin-react-swc": "^3.8.1",
139-
"@vitest/coverage-v8": "^2.1.9",
140-
"autoprefixer": "^10.4.21",
139+
"@vitest/coverage-v8": "^3.1.1",
140+
"culori": "^4.0.1",
141141
"eslint": "^9.23.0",
142-
"happy-dom": "^14.12.3",
142+
"happy-dom": "^17.4.4",
143143
"husky": "^9.1.7",
144-
"jsdom": "25.0.1",
145144
"postcss": "^8.5.3",
146145
"prettier": "^3.5.3",
147146
"prettier-plugin-tailwindcss": "^0.6.11",
148147
"sort-json": "^2.0.1",
149148
"storybook": "^8.6.11",
150149
"tsup": "^8.4.0",
151-
"typescript": "5.8.x",
152-
"vite": "5.4.16",
153-
"vitest": "^2.1.9"
150+
"typescript": "5.6.x",
151+
"vite": "6.2.4",
152+
"vitest": "^3.1.1"
154153
},
155154
"commitlint": {
156155
"extends": [

0 commit comments

Comments
 (0)