Skip to content

Commit a43815d

Browse files
authored
feat: new style injector (#767)
1 parent 7c8f733 commit a43815d

Some content is hidden

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

60 files changed

+8427
-1641
lines changed

.changeset/calm-monkeys-serve.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@cube-dev/ui-kit": patch
3+
---
4+
5+
Add @property definition support via `property` method.

.changeset/clever-feet-report.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@cube-dev/ui-kit": patch
3+
---
4+
5+
Fix MenuItem prop passing.

.changeset/sharp-books-lie.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@cube-dev/ui-kit": minor
3+
---
4+
5+
A brand new style injector. Drop `styled-components` dependency.

.changeset/smart-pumpkins-exist.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@cube-dev/ui-kit": patch
3+
---
4+
5+
Add `tastyDebug` tool for debugging.

.cursor/rules/coding.mdc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ alwaysApply: true
88
- Do not run tests if you only changed stories or documentation since the last test run.
99
- If you need to move or rename a file: use command line tools for that.
1010
- If you need to move a part of code from one file to another: First, write the code at the new place, then delete the code in the original place.
11+
- Don't implement backward compatibility unless asked.
1112

1213
# Coding rules
1314

.cursor/rules/guidelines.mdc

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ Package name: `@cube-dev/ui-kit`
2727

2828
All tests: `$ pnpm test`
2929
Specific test: `$ pnpm test -- {TestFileName}`
30+
Update snaphosts: `$ pnpm test -u -- {TestFileName}`
3031

3132
## Build
3233

@@ -45,7 +46,6 @@ Specific test: `$ pnpm test -- {TestFileName}`
4546
- `src/stories/CreateComponent.docs.mdx` - create components using tasty helper.
4647
- Storybook v8.6
4748
- React and React DOM v18
48-
- `styled-components` v6
4949
- `react-aria` and `react-stately` with the latest versions.
5050
- `tabler/icons-react` - icons.
5151

@@ -113,7 +113,7 @@ Specific test: `$ pnpm test -- {TestFileName}`
113113
- Sub-elements: Target inner elements using capitalized keys in styles
114114
- Style props: Direct style application without `styles` prop
115115
- CSS custom properties: Use `@token-name` syntax for design tokens
116-
- To declare a CSS animation use `styled-components` and then pass the animation name to the tasty styles.
116+
- To declare a CSS animation use `keyframes` method and then pass the animation name to the tasty styles.
117117

118118
## Export Patterns
119119

@@ -187,7 +187,6 @@ Specific test: `$ pnpm test -- {TestFileName}`
187187
- `src/stories/CreateComponent.docs.mdx` - create components using tasty helper.
188188
- Storybook v8.6
189189
- React and React DOM v18
190-
- `styled-components` v6
191190
- `react-aria` and `react-stately` with the latest versions.
192191
- `tabler/icons-react` - icons.
193192

@@ -255,7 +254,7 @@ Specific test: `$ pnpm test -- {TestFileName}`
255254
- Sub-elements: Target inner elements using capitalized keys in styles
256255
- Style props: Direct style application without `styles` prop
257256
- CSS custom properties: Use `@token-name` syntax for design tokens
258-
- To declare a CSS animation use `styled-components` and then pass the animation name to the tasty styles.
257+
- To declare a CSS animation use `keyframes` method and then pass the animation name to the tasty styles.
259258

260259
## Export Patterns
261260

.github/workflows/main.yml

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,27 @@ jobs:
2323
steps:
2424
- uses: actions/checkout@v4
2525

26-
- name: Install pnpm
27-
uses: pnpm/action-setup@v4
28-
with:
29-
version: 10.14.0
26+
- name: Update Corepack
27+
run: npm i -g corepack@latest
28+
29+
- name: Enable Corepack (pre)
30+
run: corepack enable
31+
32+
- name: Prepare pnpm (pre)
33+
run: corepack prepare [email protected] --activate
3034

3135
- name: Setup Node.js
3236
uses: actions/setup-node@v4
3337
with:
3438
node-version-file: '.nvmrc'
3539
cache: 'pnpm'
3640

41+
- name: Enable Corepack
42+
run: corepack enable
43+
44+
- name: Prepare pnpm
45+
run: corepack prepare [email protected] --activate
46+
3747
- name: Install Dependencies
3848
run: pnpm install
3949

@@ -63,10 +73,14 @@ jobs:
6373
with:
6474
fetch-depth: 0
6575

66-
- name: Install pnpm
67-
uses: pnpm/action-setup@v4
68-
with:
69-
version: 10.14.0
76+
- name: Update Corepack
77+
run: npm i -g corepack@latest
78+
79+
- name: Enable Corepack (pre)
80+
run: corepack enable
81+
82+
- name: Prepare pnpm (pre)
83+
run: corepack prepare [email protected] --activate
7084

7185
- uses: actions/cache@v4
7286
name: Download storybook cache
@@ -82,6 +96,12 @@ jobs:
8296
node-version-file: '.nvmrc'
8397
cache: 'pnpm'
8498

99+
- name: Enable Corepack
100+
run: corepack enable
101+
102+
- name: Prepare pnpm
103+
run: corepack prepare [email protected] --activate
104+
85105
- name: Install dependencies
86106
run: pnpm install
87107

.github/workflows/pull-request.yml

Lines changed: 42 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,26 @@ jobs:
2727
steps:
2828
- uses: actions/checkout@v4
2929

30-
- name: Install pnpm
31-
uses: pnpm/action-setup@v4
32-
with:
33-
version: 10.14.0
30+
- name: Update Corepack
31+
run: npm i -g corepack@latest
32+
33+
- name: Enable Corepack (pre)
34+
run: corepack enable
35+
36+
- name: Prepare pnpm (pre)
37+
run: corepack prepare [email protected] --activate
3438

3539
- uses: actions/setup-node@v4
3640
with:
3741
node-version-file: '.nvmrc'
3842
cache: 'pnpm'
3943

44+
- name: Enable Corepack
45+
run: corepack enable
46+
47+
- name: Prepare pnpm
48+
run: corepack prepare [email protected] --activate
49+
4050
- name: Install dependencies
4151
run: pnpm install
4252

@@ -81,10 +91,14 @@ jobs:
8191
steps:
8292
- uses: actions/checkout@v4
8393

84-
- name: Install pnpm
85-
uses: pnpm/action-setup@v4
86-
with:
87-
version: 10.14.0
94+
- name: Update Corepack
95+
run: npm i -g corepack@latest
96+
97+
- name: Enable Corepack (pre)
98+
run: corepack enable
99+
100+
- name: Prepare pnpm (pre)
101+
run: corepack prepare [email protected] --activate
88102

89103
- uses: actions/cache@v4
90104
name: Download eslint cache
@@ -98,6 +112,12 @@ jobs:
98112
node-version-file: '.nvmrc'
99113
cache: 'pnpm'
100114

115+
- name: Enable Corepack
116+
run: corepack enable
117+
118+
- name: Prepare pnpm
119+
run: corepack prepare [email protected] --activate
120+
101121
- name: Install dependencies
102122
run: pnpm install
103123

@@ -121,10 +141,14 @@ jobs:
121141
with:
122142
fetch-depth: 0
123143

124-
- name: Install pnpm
125-
uses: pnpm/action-setup@v4
126-
with:
127-
version: 10.14.0
144+
- name: Update Corepack
145+
run: npm i -g corepack@latest
146+
147+
- name: Enable Corepack (pre)
148+
run: corepack enable
149+
150+
- name: Prepare pnpm (pre)
151+
run: corepack prepare [email protected] --activate
128152

129153
- uses: actions/cache@v4
130154
name: Download storybook cache
@@ -140,6 +164,12 @@ jobs:
140164
node-version-file: '.nvmrc'
141165
cache: 'pnpm'
142166

167+
- name: Enable Corepack
168+
run: corepack enable
169+
170+
- name: Prepare pnpm
171+
run: corepack prepare [email protected] --activate
172+
143173
- name: Install dependencies
144174
run: pnpm install
145175

.github/workflows/size-limit.yml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,26 @@ jobs:
2525
steps:
2626
- uses: actions/checkout@v4
2727

28-
- name: Install pnpm
29-
uses: pnpm/action-setup@v4
30-
with:
31-
version: 10.14.0
28+
- name: Update Corepack
29+
run: npm i -g corepack@latest
3230

3331
- uses: actions/setup-node@v4
3432
with:
3533
node-version-file: '.nvmrc'
3634
cache: 'pnpm'
3735

36+
- name: Enable Corepack (pre)
37+
run: corepack enable
38+
39+
- name: Prepare pnpm (pre)
40+
run: corepack prepare [email protected] --activate
41+
42+
- name: Enable Corepack
43+
run: corepack enable
44+
45+
- name: Prepare pnpm
46+
run: corepack prepare [email protected] --activate
47+
3848
- name: Install dependencies
3949
run: pnpm install
4050

.size-limit.cjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,20 @@ module.exports = [
2020
}),
2121
);
2222
},
23-
limit: '295kB',
23+
limit: '305kB',
2424
},
2525
{
2626
name: 'Tree shaking (just a Button)',
2727
path: './dist/es/index.js',
2828
webpack: true,
2929
import: '{ Button }',
30-
limit: '26 kB',
30+
limit: '32 kB',
3131
},
3232
{
3333
name: 'Tree shaking (just an Icon)',
3434
path: './dist/es/index.js',
3535
webpack: true,
3636
import: '{ AiIcon }',
37-
limit: '13 kB',
37+
limit: '19 kB',
3838
},
3939
];

0 commit comments

Comments
 (0)