Skip to content

Commit 4e07fc6

Browse files
Merge v1.x: upgrade to Tailwind CSS v4 (#30)
Merge the v1.x branch into main, combining Tailwind CSS v4 upgrade with features developed on main (pagination, ref forwarding, context API, etc.). Key changes from v1.x: - Upgrade to Tailwind CSS v4 with @tailwindcss/vite plugin - Remove tailwind.config.js and postcss.config.js (TW4 CSS-first config) - Upgrade Vite to v6, TypeScript to v5.7, Storybook to v8 - Use HeadlessUI v2 API (DialogPanel, DialogBackdrop, Field, Label) - Add cn() utility (classnames + tailwind-merge) - Update to Node.js 22 in CI - Add prettier + prettier-plugin-tailwindcss Preserved from main: - TailReactBaseColorProvider context API for dynamic colors - Pagination component - Ref forwarding for TextField and Checkbox - Modal initialFocus support - prepare script for git installs
1 parent a294385 commit 4e07fc6

77 files changed

Lines changed: 7434 additions & 13412 deletions

Some content is hidden

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

.editorconfig

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,19 @@ root = true
33
[*]
44
charset = utf-8
55
end_of_line = lf
6-
insert_final_newline = true
7-
indent_style = space
86
indent_size = 4
7+
indent_style = space
8+
insert_final_newline = true
99
trim_trailing_whitespace = true
1010

11-
[*.json]
12-
indent_size = 2
13-
1411
[*.md]
1512
trim_trailing_whitespace = false
1613

17-
[*.{yml,yaml,ts,tsx,js}]
14+
[*.{tsx,ts,js,json,css}]
15+
indent_size = 2
16+
indent_style = space
17+
18+
[*.{yml,yaml}]
1819
indent_size = 2
1920

2021
[docker-compose.yml]

.eslintrc.cjs

Lines changed: 0 additions & 16 deletions
This file was deleted.

.github/workflows/npm.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
- name: Setup Node
1616
uses: actions/setup-node@v4
1717
with:
18-
node-version: '21.6'
18+
node-version: '22.x'
1919
cache: 'npm'
2020

2121
- name: Install dependencies

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,5 @@ storybook-static
2727

2828
.vercel
2929
.yarnrc.yml
30+
31+
*storybook.log

.prettierrc

Lines changed: 0 additions & 13 deletions
This file was deleted.

.storybook/main.ts

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,32 @@
11
import type { StorybookConfig } from '@storybook/react-vite';
2+
import remarkGfm from 'remark-gfm';
3+
24

35
const config: StorybookConfig = {
4-
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
6+
framework: '@storybook/react-vite',
7+
stories: [
8+
'../src/**/*.mdx',
9+
'../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'
10+
],
11+
512
addons: [
6-
'@storybook/addon-links',
7-
'@storybook/addon-essentials',
813
'@storybook/addon-onboarding',
9-
'@storybook/addon-interactions',
10-
'storybook-dark-mode',
14+
'@storybook/addon-essentials',
15+
'@chromatic-com/storybook',
16+
'@storybook/addon-interactions', {
17+
name: '@storybook/addon-docs',
18+
options: {
19+
mdxPluginOptions: {
20+
mdxCompileOptions: {
21+
remarkPlugins: [remarkGfm],
22+
},
23+
},
24+
},
25+
},
1126
],
12-
framework: {
13-
name: '@storybook/react-vite',
14-
options: {},
15-
},
16-
docs: {
17-
autodocs: 'tag',
18-
},
27+
28+
typescript: {
29+
reactDocgen: 'react-docgen-typescript'
30+
}
1931
};
2032
export default config;

.storybook/preview.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
import type { Preview } from '@storybook/react';
22
import { themes } from '@storybook/theming';
33

4-
import '../src/index.css';
4+
import '../src/app.css';
55

66
const preview: Preview = {
77
parameters: {
8-
actions: { argTypesRegex: '^on[A-Z].*' },
98
darkMode: {
109
dark: { ...themes.dark, appBg: 'black', base: 'dark', appPreviewBg: 'black' },
1110
stylePreview: true,
@@ -18,6 +17,8 @@ const preview: Preview = {
1817
},
1918
},
2019
},
20+
21+
tags: ['autodocs', 'autodocs']
2122
};
2223

2324
export default preview;

README.md

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,17 @@ yarn add @wedevs/tail-react
1414

1515
## Usage
1616

17+
### Tailwind CSS v4
18+
19+
On your app.css file, add the source file:
20+
21+
```diff
22+
+ @source './node_modules/@wedevs/tail-react/dist/index.{js,ts,jsx,tsx}';
23+
```
24+
1725
### Tailwind CSS v3
1826

19-
If you're using Tailwind CSS v3, update your `tailwind.config.js` file:
27+
On your `tailwind.config.js` file, update the content entry:
2028

2129
```diff
2230
/** @type {import('tailwindcss').Config} */
@@ -35,21 +43,6 @@ export default {
3543
}
3644
```
3745

38-
### Tailwind CSS v4
39-
40-
For Tailwind CSS v4, configuration is done in your CSS file:
41-
42-
```css
43-
@import 'tailwindcss';
44-
45-
/* Import tail-react components */
46-
@source "node_modules/@wedevs/tail-react/dist/index.js";
47-
48-
@theme {
49-
/* Your theme customizations */
50-
}
51-
```
52-
5346
### Customizing the theme color
5447

5548
By default, the component library uses `indigo` as the primary color. You can customize this using the `TailReactBaseColorProvider`:

RELEASE.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,25 +10,25 @@ Follow these steps to release a new version:
1010

1111
2. **Commit the changes**: Commit the updated `package.json` file using the following command:
1212

13-
```shell
14-
git add package.json
15-
git commit -m "Bump version to vX.X.X"
16-
```
13+
```shell
14+
git add package.json
15+
git commit -m "Bump version to vX.X.X"
16+
```
1717

1818
3. **Tag the release**: Create a new Git tag for the release using the following command:
1919

20-
```shell
21-
git tag -a vX.X.X -m "Release vX.X.X"
22-
```
20+
```shell
21+
git tag -a vX.X.X -m "Release vX.X.X"
22+
```
2323

24-
Replace `X.X.X` with the actual version number.
24+
Replace `X.X.X` with the actual version number.
2525

2626
4. **Push the changes**: Push the committed changes and the newly created tag to the GitHub repository:
2727

28-
```shell
29-
git push origin main
30-
git push origin vX.X.X
31-
```
28+
```shell
29+
git push origin main
30+
git push origin vX.X.X
31+
```
3232

3333
5. **Create a GitHub release**: Create a new release in GitHub with the new tag. This will trigger a GitHub action that will automatically publish the new version to npm.
3434

index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
<body>
1111
<div id="root"></div>
12+
1213
<script type="module" src="/src/main.tsx"></script>
1314
</body>
1415

0 commit comments

Comments
 (0)