Skip to content

Commit accc5ed

Browse files
committed
feat!: merge main updates into v1.x for Tailwind v4 release
Bring component/theme updates from main into v1.x, switch CI/package workflow to npm, and expose base color context utilities for v4-only usage.
2 parents 9bfd79e + 7325e74 commit accc5ed

43 files changed

Lines changed: 13292 additions & 4153 deletions

Some content is hidden

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

.github/workflows/npm.yml

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,23 +12,17 @@ jobs:
1212
- name: Checkout
1313
uses: actions/checkout@v4
1414

15-
- name: Enable Corepack
16-
run: corepack enable
17-
1815
- name: Setup Node
1916
uses: actions/setup-node@v4
2017
with:
2118
node-version: '22.x'
19+
cache: 'npm'
2220

23-
- name: Cache node_modules
24-
uses: actions/cache@v4
25-
with:
26-
path: node_modules
27-
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
28-
restore-keys: ${{ runner.os }}-yarn-
21+
- name: Install dependencies
22+
run: npm ci
2923

3024
- name: Build
31-
run: yarn install --immutable && yarn build
25+
run: npm run build
3226

3327
- name: Set up .npmrc file for authentication
3428
run: echo "registry=https://registry.npmjs.org/" >> .npmrc && echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" >> .npmrc

README.md

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

1515
## Usage
1616

17-
v4: On your app.css file, add the source file:
17+
### Tailwind CSS v4
18+
19+
On your app.css file, add the source file:
1820

1921
```diff
2022
+ @source './node_modules/@wedevs/tail-react/dist/index.{js,ts,jsx,tsx}';
2123
```
2224

23-
v3: On your `tailwind.config.js` file, update the content entry:
25+
### Customizing the theme color
2426

25-
```diff
26-
/** @type {import('tailwindcss').Config} */
27-
export default {
28-
content: [
29-
"./index.html",
30-
"./src/**/*.{js,ts,jsx,tsx}",
31-
+ "node_modules/@wedevs/tail-react/dist/index.js"
32-
],
33-
theme: {
34-
extend: {},
35-
},
36-
plugins: [
37-
+ import('@tailwindcss/forms'),
38-
],
27+
By default, the component library uses `indigo` as the primary color. You can customize this using the `TailReactBaseColorProvider`:
28+
29+
```jsx
30+
import { TailReactBaseColorProvider, Button } from '@wedevs/tail-react';
31+
32+
function App() {
33+
return (
34+
<TailReactBaseColorProvider color="blue">
35+
{/* All components inside will use blue as the primary color */}
36+
<Button variant="primary">Primary Blue Button</Button>
37+
</TailReactBaseColorProvider>
38+
);
3939
}
4040
```
41+
42+
Available color options include all Tailwind CSS colors:
43+
44+
- `slate`, `gray`, `zinc`, `neutral`, `stone`
45+
- `red`, `orange`, `amber`, `yellow`, `lime`
46+
- `green`, `emerald`, `teal`, `cyan`, `sky`
47+
- `blue`, `indigo` (default), `violet`, `purple`, `fuchsia`
48+
- `pink`, `rose`
49+
50+
#### Important
51+
52+
Tailwind v4 setup depends on the `@source` entry above so Tailwind can scan classes used by this package.
53+
54+
## Development
55+
56+
To get started with development:
57+
58+
1. Clone the repository
59+
2. Install dependencies:
60+
```bash
61+
npm install
62+
```
63+
3. Start the development server:
64+
```bash
65+
npm run dev
66+
```
67+
4. Build the library:
68+
```bash
69+
npm run build
70+
```
71+
5. Run Storybook:
72+
```bash
73+
npm run storybook
74+
```

0 commit comments

Comments
 (0)