├── .changeset
├── README.md
├── afraid-bottles-burn.md
├── chilly-apricots-repair.md
├── clean-radios-reply.md
├── clean-tigers-remain.md
├── config.json
├── cool-wolves-learn.md
├── cyan-frogs-pull.md
├── eighty-plants-tap.md
├── eleven-colts-run.md
├── fair-insects-dress.md
├── khaki-bees-rule.md
├── loud-eyes-search.md
├── lucky-gifts-do.md
├── moody-cougars-switch.md
├── odd-falcons-trade.md
├── old-shrimps-yawn.md
├── old-toes-sniff.md
├── poor-roses-attend.md
├── pre.json
├── proud-singers-shout.md
├── red-papayas-rescue.md
├── rotten-pants-reflect.md
├── short-guests-travel.md
├── sixty-rings-cross.md
├── sour-kids-enjoy.md
├── sweet-bags-confess.md
├── sweet-masks-return.md
├── swift-ties-sell.md
├── two-schools-dance.md
├── unlucky-bears-fry.md
├── warm-eels-search.md
└── wicked-olives-drive.md
├── .gitignore
├── .husky
└── pre-commit
├── .vscode
├── extensions.json
└── settings.json
├── LICENSE
├── README.md
├── biome.json
├── package.json
├── packages
├── config.ts
├── core
│ ├── .gitignore
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── package.json
│ ├── src
│ │ ├── create.ts
│ │ ├── group
│ │ │ ├── create.ts
│ │ │ ├── index.ts
│ │ │ ├── types.ts
│ │ │ └── utils.ts
│ │ ├── index.ts
│ │ ├── slots
│ │ │ ├── create.ts
│ │ │ ├── index.ts
│ │ │ └── types.ts
│ │ ├── types.ts
│ │ └── utils.ts
│ ├── tsconfig.json
│ └── vite.config.ts
├── preact
│ ├── .gitignore
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── package.json
│ ├── src
│ │ ├── create.tsx
│ │ ├── index.tsx
│ │ ├── mono
│ │ │ ├── create.tsx
│ │ │ ├── index.tsx
│ │ │ └── types.ts
│ │ ├── types
│ │ │ ├── index.ts
│ │ │ ├── polymorphic.ts
│ │ │ ├── preact.ts
│ │ │ └── utils.ts
│ │ └── utils.ts
│ ├── tsconfig.json
│ └── vite.config.ts
├── qwik
│ ├── .gitignore
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── package.json
│ ├── src
│ │ ├── create.tsx
│ │ ├── index.tsx
│ │ ├── mono
│ │ │ ├── create.tsx
│ │ │ ├── index.tsx
│ │ │ └── types.ts
│ │ ├── types
│ │ │ ├── index.ts
│ │ │ ├── polymorphic.ts
│ │ │ ├── qwik.ts
│ │ │ └── utils.ts
│ │ └── utils.ts
│ ├── tsconfig.json
│ └── vite.config.ts
├── react
│ ├── .gitignore
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── package.json
│ ├── src
│ │ ├── create.tsx
│ │ ├── index.tsx
│ │ ├── mono
│ │ │ ├── create.tsx
│ │ │ ├── index.tsx
│ │ │ └── types.ts
│ │ ├── types
│ │ │ ├── index.ts
│ │ │ ├── polymorphic.ts
│ │ │ ├── react.ts
│ │ │ └── utils.ts
│ │ └── utils.ts
│ ├── tsconfig.json
│ └── vite.config.ts
├── solid
│ ├── .gitignore
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── package.json
│ ├── src
│ │ ├── create.tsx
│ │ ├── index.tsx
│ │ ├── mono
│ │ │ ├── create.tsx
│ │ │ ├── index.tsx
│ │ │ └── types.ts
│ │ ├── types
│ │ │ ├── index.ts
│ │ │ ├── polymorphic.ts
│ │ │ ├── solid.ts
│ │ │ └── utils.ts
│ │ └── utils.ts
│ ├── tsconfig.json
│ └── vite.config.ts
└── vue
│ ├── .gitignore
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── package.json
│ ├── src
│ ├── create.tsx
│ ├── index.tsx
│ ├── mono
│ │ ├── create.tsx
│ │ ├── index.tsx
│ │ └── types.ts
│ ├── types
│ │ ├── index.ts
│ │ ├── polymorphic.ts
│ │ ├── utils.ts
│ │ └── vue.ts
│ └── utils.ts
│ ├── tsconfig.json
│ └── vite.config.ts
├── pnpm-lock.yaml
├── pnpm-workspace.yaml
├── tests
├── config.ts
├── core
│ ├── index.test.ts
│ ├── package.json
│ ├── tsconfig.json
│ ├── utils.ts
│ └── vitest.config.ts
├── preact
│ ├── index.test.tsx
│ ├── package.json
│ ├── tsconfig.json
│ ├── utils.ts
│ └── vitest.config.ts
├── qwik
│ ├── index.test.tsx
│ ├── package.json
│ ├── tsconfig.json
│ ├── utils.ts
│ └── vitest.config.ts
├── react-18
│ ├── index.test.tsx
│ ├── package.json
│ ├── tsconfig.json
│ ├── utils.ts
│ └── vitest.config.ts
├── react
│ ├── ecosystem
│ │ └── ark-ui.test.tsx
│ ├── index.test.tsx
│ ├── package.json
│ ├── tsconfig.json
│ ├── utils.ts
│ └── vitest.config.ts
├── shared
│ ├── fixtures
│ │ ├── compose.ts
│ │ ├── index.ts
│ │ ├── klass.ts
│ │ └── reklass.ts
│ ├── package.json
│ └── utils.ts
├── solid
│ ├── ecosystem
│ │ └── ark-ui.test.tsx
│ ├── index.test.tsx
│ ├── package.json
│ ├── tsconfig.json
│ ├── utils.ts
│ └── vitest.config.ts
└── vue
│ ├── ecosystem
│ └── ark-ui.test.tsx
│ ├── index.test.tsx
│ ├── package.json
│ ├── tsconfig.json
│ ├── utils.ts
│ └── vitest.config.ts
├── tsconfig.json
├── turbo.json
└── vitest.config.ts
/.changeset/README.md:
--------------------------------------------------------------------------------
1 | # Changesets
2 |
3 | Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
4 | with multi-package repos, or single-package repos to help you version and publish your code. You can
5 | find the full documentation for it [in our repository](https://github.com/changesets/changesets)
6 |
7 | We have a quick list of common questions to get you started engaging with this project in
8 | [our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
9 |
--------------------------------------------------------------------------------
/.changeset/afraid-bottles-burn.md:
--------------------------------------------------------------------------------
1 | ---
2 | "@klass/core": patch
3 | "@klass/preact": patch
4 | "@klass/qwik": patch
5 | "@klass/react": patch
6 | "@klass/solid": patch
7 | "@klass/vue": patch
8 | ---
9 |
10 | Optimizations
11 |
--------------------------------------------------------------------------------
/.changeset/chilly-apricots-repair.md:
--------------------------------------------------------------------------------
1 | ---
2 | "@klass/core": patch
3 | "@klass/preact": patch
4 | "@klass/qwik": patch
5 | "@klass/react": patch
6 | "@klass/solid": patch
7 | "@klass/vue": patch
8 | ---
9 |
10 | named import and base fn
11 |
--------------------------------------------------------------------------------
/.changeset/clean-radios-reply.md:
--------------------------------------------------------------------------------
1 | ---
2 | "@klass/core": patch
3 | "@klass/preact": patch
4 | "@klass/qwik": patch
5 | "@klass/react": patch
6 | "@klass/solid": patch
7 | "@klass/vue": patch
8 | ---
9 |
10 | initialization improvements
11 |
--------------------------------------------------------------------------------
/.changeset/clean-tigers-remain.md:
--------------------------------------------------------------------------------
1 | ---
2 | "@klass/core": major
3 | "@klass/preact": major
4 | "@klass/react": major
5 | "@klass/solid": major
6 | ---
7 |
8 | Enter prerelease mode for v4
9 |
--------------------------------------------------------------------------------
/.changeset/config.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://unpkg.com/@changesets/config@3.1.1/schema.json",
3 | "changelog": "@changesets/cli/changelog",
4 | "commit": false,
5 | "fixed": [["@klass/core", "@klass/preact", "@klass/qwik", "@klass/react", "@klass/solid", "@klass/vue"]],
6 | "linked": [],
7 | "access": "restricted",
8 | "baseBranch": "main",
9 | "updateInternalDependencies": "patch",
10 | "ignore": ["@test/core", "@test/preact", "@test/qwik", "@test/react", "@test/react-18", "@test/shared", "@test/solid", "@test/vue"]
11 | }
12 |
--------------------------------------------------------------------------------
/.changeset/cool-wolves-learn.md:
--------------------------------------------------------------------------------
1 | ---
2 | "@klass/core": patch
3 | "@klass/preact": patch
4 | "@klass/qwik": patch
5 | "@klass/react": patch
6 | "@klass/solid": patch
7 | "@klass/vue": patch
8 | ---
9 |
10 | Update README.md
11 |
--------------------------------------------------------------------------------
/.changeset/cyan-frogs-pull.md:
--------------------------------------------------------------------------------
1 | ---
2 | "@klass/core": patch
3 | "@klass/preact": patch
4 | "@klass/qwik": patch
5 | "@klass/react": patch
6 | "@klass/solid": patch
7 | "@klass/vue": patch
8 | ---
9 |
10 | fix polymorphism
11 |
--------------------------------------------------------------------------------
/.changeset/eighty-plants-tap.md:
--------------------------------------------------------------------------------
1 | ---
2 | "@klass/core": patch
3 | "@klass/preact": patch
4 | "@klass/qwik": patch
5 | "@klass/react": patch
6 | "@klass/solid": patch
7 | "@klass/vue": patch
8 | ---
9 |
10 | Optimization
11 |
--------------------------------------------------------------------------------
/.changeset/eleven-colts-run.md:
--------------------------------------------------------------------------------
1 | ---
2 | "@klass/core": patch
3 | "@klass/preact": patch
4 | "@klass/qwik": patch
5 | "@klass/react": patch
6 | "@klass/solid": patch
7 | "@klass/vue": patch
8 | ---
9 |
10 | clean type, fix dts and feat new mono setup
11 |
--------------------------------------------------------------------------------
/.changeset/fair-insects-dress.md:
--------------------------------------------------------------------------------
1 | ---
2 | "@klass/core": patch
3 | "@klass/preact": patch
4 | "@klass/qwik": patch
5 | "@klass/react": patch
6 | "@klass/solid": patch
7 | "@klass/vue": patch
8 | ---
9 |
10 | compose with string
11 |
--------------------------------------------------------------------------------
/.changeset/khaki-bees-rule.md:
--------------------------------------------------------------------------------
1 | ---
2 | "@klass/core": patch
3 | "@klass/preact": patch
4 | "@klass/qwik": patch
5 | "@klass/react": patch
6 | "@klass/solid": patch
7 | "@klass/vue": patch
8 | ---
9 |
10 | Types improvements and new frameworks monomorphic feature
11 |
--------------------------------------------------------------------------------
/.changeset/loud-eyes-search.md:
--------------------------------------------------------------------------------
1 | ---
2 | "@klass/preact": patch
3 | "@klass/react": patch
4 | "@klass/solid": patch
5 | "@klass/core": patch
6 | "@klass/qwik": patch
7 | "@klass/vue": patch
8 | ---
9 |
10 | better workspaces
11 |
--------------------------------------------------------------------------------
/.changeset/lucky-gifts-do.md:
--------------------------------------------------------------------------------
1 | ---
2 | "@klass/core": patch
3 | "@klass/preact": patch
4 | "@klass/qwik": patch
5 | "@klass/react": patch
6 | "@klass/solid": patch
7 | "@klass/vue": patch
8 | ---
9 |
10 | README
11 |
--------------------------------------------------------------------------------
/.changeset/moody-cougars-switch.md:
--------------------------------------------------------------------------------
1 | ---
2 | "@klass/core": patch
3 | "@klass/preact": patch
4 | "@klass/qwik": patch
5 | "@klass/react": patch
6 | "@klass/solid": patch
7 | "@klass/vue": patch
8 | ---
9 |
10 | remove o property and rename component to fx property
11 |
--------------------------------------------------------------------------------
/.changeset/odd-falcons-trade.md:
--------------------------------------------------------------------------------
1 | ---
2 | "@klass/core": patch
3 | "@klass/preact": patch
4 | "@klass/qwik": patch
5 | "@klass/react": patch
6 | "@klass/solid": patch
7 | "@klass/vue": patch
8 | ---
9 |
10 | optimization
11 |
--------------------------------------------------------------------------------
/.changeset/old-shrimps-yawn.md:
--------------------------------------------------------------------------------
1 | ---
2 | "@klass/core": patch
3 | "@klass/preact": patch
4 | "@klass/qwik": patch
5 | "@klass/react": patch
6 | "@klass/solid": patch
7 | "@klass/vue": patch
8 | ---
9 |
10 | test improvements
11 |
--------------------------------------------------------------------------------
/.changeset/old-toes-sniff.md:
--------------------------------------------------------------------------------
1 | ---
2 | "@klass/core": patch
3 | "@klass/preact": patch
4 | "@klass/qwik": patch
5 | "@klass/react": patch
6 | "@klass/solid": patch
7 | "@klass/vue": patch
8 | ---
9 |
10 | fix build
11 |
--------------------------------------------------------------------------------
/.changeset/poor-roses-attend.md:
--------------------------------------------------------------------------------
1 | ---
2 | "@klass/core": patch
3 | "@klass/preact": patch
4 | "@klass/qwik": patch
5 | "@klass/react": patch
6 | "@klass/solid": patch
7 | "@klass/vue": patch
8 | ---
9 |
10 | klasses function options, setup API and utils entry
11 |
--------------------------------------------------------------------------------
/.changeset/pre.json:
--------------------------------------------------------------------------------
1 | {
2 | "mode": "pre",
3 | "tag": "next",
4 | "initialVersions": {
5 | "@klass/core": "3.4.11",
6 | "@klass/preact": "3.4.11",
7 | "@klass/react": "3.4.11",
8 | "@klass/solid": "3.4.11",
9 | "@klass/qwik": "4.0.0-next.1",
10 | "@klass/vue": "4.0.0-next.1",
11 | "@klass/tests": "0.0.0",
12 | "@test/core": "0.0.0",
13 | "@test/preact": "0.0.0",
14 | "@test/qwik": "0.0.0",
15 | "@test/react": "0.0.0",
16 | "@test/react-18": "0.0.0",
17 | "@test/shared": "0.0.0",
18 | "@test/solid": "0.0.0",
19 | "@test/vue": "0.0.0"
20 | },
21 | "changesets": [
22 | "afraid-bottles-burn",
23 | "chilly-apricots-repair",
24 | "clean-radios-reply",
25 | "clean-tigers-remain",
26 | "cool-wolves-learn",
27 | "cyan-frogs-pull",
28 | "eighty-plants-tap",
29 | "eleven-colts-run",
30 | "fair-insects-dress",
31 | "khaki-bees-rule",
32 | "loud-eyes-search",
33 | "lucky-gifts-do",
34 | "moody-cougars-switch",
35 | "odd-falcons-trade",
36 | "old-shrimps-yawn",
37 | "old-toes-sniff",
38 | "poor-roses-attend",
39 | "proud-singers-shout",
40 | "red-papayas-rescue",
41 | "rotten-pants-reflect",
42 | "short-guests-travel",
43 | "sixty-rings-cross",
44 | "sour-kids-enjoy",
45 | "sweet-bags-confess",
46 | "sweet-masks-return",
47 | "swift-ties-sell",
48 | "two-schools-dance",
49 | "unlucky-bears-fry",
50 | "warm-eels-search",
51 | "wicked-olives-drive"
52 | ]
53 | }
54 |
--------------------------------------------------------------------------------
/.changeset/proud-singers-shout.md:
--------------------------------------------------------------------------------
1 | ---
2 | "@klass/core": patch
3 | "@klass/preact": patch
4 | "@klass/react": patch
5 | "@klass/solid": patch
6 | ---
7 |
8 | Performance improvement
9 |
--------------------------------------------------------------------------------
/.changeset/red-papayas-rescue.md:
--------------------------------------------------------------------------------
1 | ---
2 | "@klass/core": patch
3 | "@klass/preact": patch
4 | "@klass/qwik": patch
5 | "@klass/react": patch
6 | "@klass/solid": patch
7 | "@klass/vue": patch
8 | ---
9 |
10 | refactoring typescript features
11 |
--------------------------------------------------------------------------------
/.changeset/rotten-pants-reflect.md:
--------------------------------------------------------------------------------
1 | ---
2 | "@klass/core": patch
3 | "@klass/preact": patch
4 | "@klass/qwik": patch
5 | "@klass/react": patch
6 | "@klass/solid": patch
7 | "@klass/vue": patch
8 | ---
9 |
10 | fix types
11 |
--------------------------------------------------------------------------------
/.changeset/short-guests-travel.md:
--------------------------------------------------------------------------------
1 | ---
2 | "@klass/core": patch
3 | "@klass/preact": patch
4 | "@klass/qwik": patch
5 | "@klass/react": patch
6 | "@klass/solid": patch
7 | "@klass/vue": patch
8 | ---
9 |
10 | stricts customization only with top-level configurations
11 |
--------------------------------------------------------------------------------
/.changeset/sixty-rings-cross.md:
--------------------------------------------------------------------------------
1 | ---
2 | "@klass/core": patch
3 | "@klass/preact": patch
4 | "@klass/qwik": patch
5 | "@klass/react": patch
6 | "@klass/solid": patch
7 | "@klass/vue": patch
8 | ---
9 |
10 | New Vue and Qwik packages
11 |
--------------------------------------------------------------------------------
/.changeset/sour-kids-enjoy.md:
--------------------------------------------------------------------------------
1 | ---
2 | "@klass/core": patch
3 | "@klass/preact": patch
4 | "@klass/qwik": patch
5 | "@klass/react": patch
6 | "@klass/solid": patch
7 | "@klass/vue": patch
8 | ---
9 |
10 | frameworks compatibility
11 |
--------------------------------------------------------------------------------
/.changeset/sweet-bags-confess.md:
--------------------------------------------------------------------------------
1 | ---
2 | "@klass/core": patch
3 | "@klass/preact": patch
4 | "@klass/qwik": patch
5 | "@klass/react": patch
6 | "@klass/solid": patch
7 | "@klass/vue": patch
8 | ---
9 |
10 | Testing improvements
11 |
--------------------------------------------------------------------------------
/.changeset/sweet-masks-return.md:
--------------------------------------------------------------------------------
1 | ---
2 | "@klass/core": patch
3 | "@klass/preact": patch
4 | "@klass/qwik": patch
5 | "@klass/react": patch
6 | "@klass/solid": patch
7 | "@klass/vue": patch
8 | ---
9 |
10 | refactor modules fix types and feat setup
11 |
--------------------------------------------------------------------------------
/.changeset/swift-ties-sell.md:
--------------------------------------------------------------------------------
1 | ---
2 | "@klass/core": patch
3 | "@klass/preact": patch
4 | "@klass/qwik": patch
5 | "@klass/react": patch
6 | "@klass/solid": patch
7 | "@klass/vue": patch
8 | ---
9 |
10 | improves compatibility
11 |
--------------------------------------------------------------------------------
/.changeset/two-schools-dance.md:
--------------------------------------------------------------------------------
1 | ---
2 | "@klass/core": patch
3 | "@klass/preact": patch
4 | "@klass/qwik": patch
5 | "@klass/react": patch
6 | "@klass/solid": patch
7 | "@klass/vue": patch
8 | ---
9 |
10 | Optimization
11 |
--------------------------------------------------------------------------------
/.changeset/unlucky-bears-fry.md:
--------------------------------------------------------------------------------
1 | ---
2 | "@klass/core": patch
3 | "@klass/preact": patch
4 | "@klass/qwik": patch
5 | "@klass/react": patch
6 | "@klass/solid": patch
7 | "@klass/vue": patch
8 | ---
9 |
10 | experimental compose
11 |
--------------------------------------------------------------------------------
/.changeset/warm-eels-search.md:
--------------------------------------------------------------------------------
1 | ---
2 | "@klass/core": patch
3 | "@klass/preact": patch
4 | "@klass/qwik": patch
5 | "@klass/react": patch
6 | "@klass/solid": patch
7 | "@klass/vue": patch
8 | ---
9 |
10 | fix test & build and type improvements
11 |
--------------------------------------------------------------------------------
/.changeset/wicked-olives-drive.md:
--------------------------------------------------------------------------------
1 | ---
2 | "@klass/core": patch
3 | "@klass/preact": patch
4 | "@klass/qwik": patch
5 | "@klass/react": patch
6 | "@klass/solid": patch
7 | "@klass/vue": patch
8 | ---
9 |
10 | build improvements
11 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | .turbo
3 | dist
--------------------------------------------------------------------------------
/.husky/pre-commit:
--------------------------------------------------------------------------------
1 | pnpm test
2 |
--------------------------------------------------------------------------------
/.vscode/extensions.json:
--------------------------------------------------------------------------------
1 | {
2 | "recommendations": ["biomejs.biome"]
3 | }
4 |
--------------------------------------------------------------------------------
/.vscode/settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "editor.defaultFormatter": "biomejs.biome",
3 | "javascript.preferences.importModuleSpecifier": "non-relative",
4 | "typescript.preferences.importModuleSpecifier": "non-relative"
5 | }
6 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2022 flamrdevs
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/biome.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
3 | "vcs": {
4 | "enabled": true,
5 | "clientKind": "git",
6 | "useIgnoreFile": true
7 | },
8 | "formatter": {
9 | "enabled": true,
10 | "indentStyle": "tab",
11 | "lineWidth": 200
12 | },
13 | "organizeImports": {
14 | "enabled": true
15 | },
16 | "linter": {
17 | "enabled": false
18 | },
19 | "javascript": {
20 | "formatter": {
21 | "quoteStyle": "double",
22 | "semicolons": "always",
23 | "trailingCommas": "es5"
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@klass/workspace",
3 | "type": "module",
4 | "private": true,
5 | "scripts": {
6 | "preinstall": "npx only-allow pnpm",
7 | "prepare": "husky",
8 | "build": "turbo run build",
9 | "pretest": "pnpm run build",
10 | "test": "vitest run",
11 | "pretestui": "pnpm run build",
12 | "testui": "vitest --ui",
13 | "prepublint": "pnpm run build",
14 | "publint": "pnpm --parallel --filter=\"@klass/*\" exec publint",
15 | "format": "biome check --write",
16 | "inspect": "pnpx node-modules-inspector"
17 | },
18 | "devDependencies": {
19 | "@babel/plugin-transform-react-jsx": "7.25.9",
20 | "@babel/plugin-transform-react-jsx-development": "7.25.9",
21 | "@biomejs/biome": "1.9.4",
22 | "@builder.io/qwik": "1.13.0",
23 | "@changesets/cli": "2.29.2",
24 | "@preact/preset-vite": "2.10.1",
25 | "@preact/signals": "2.0.4",
26 | "@testing-library/dom": "10.4.0",
27 | "@testing-library/jest-dom": "6.6.3",
28 | "@types/node": "22.15.3",
29 | "@types/react": "19.1.2",
30 | "@types/react-dom": "19.1.2",
31 | "@vitejs/plugin-react": "4.4.1",
32 | "@vitejs/plugin-vue": "5.2.3",
33 | "@vitejs/plugin-vue-jsx": "4.1.2",
34 | "@vitest/ui": "3.1.2",
35 | "babel-plugin-transform-hook-names": "1.0.2",
36 | "husky": "9.1.7",
37 | "jsdom": "26.1.0",
38 | "preact": "10.26.5",
39 | "publint": "0.3.12",
40 | "react": "19.1.0",
41 | "react-dom": "19.1.0",
42 | "solid-js": "1.9.5",
43 | "terser": "5.39.0",
44 | "turbo": "2.5.2",
45 | "typescript": "5.8.3",
46 | "vite": "6.3.3",
47 | "vite-plugin-dts": "4.5.3",
48 | "vite-plugin-solid": "2.11.6",
49 | "vite-tsconfig-paths": "^5.1.4",
50 | "vitest": "3.1.2",
51 | "vue": "3.5.13"
52 | },
53 | "packageManager": "pnpm@10.8.1",
54 | "engines": {
55 | "node": ">=23.0.0"
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/packages/config.ts:
--------------------------------------------------------------------------------
1 | import fs from "node:fs";
2 | import path from "node:path";
3 |
4 | import type { BuildEnvironmentOptions, LibraryOptions } from "vite";
5 |
6 | import dtsPlugin, { type PluginOptions as dtsPluginOptions } from "vite-plugin-dts";
7 |
8 | export const dts = (include: string[], options?: dtsPluginOptions) => dtsPlugin({ include, staticImport: true, ...options });
9 |
10 | const cwd = process.cwd();
11 |
12 | const packagedotjson = JSON.parse(fs.readFileSync(path.resolve(cwd, "package.json"), "utf-8"));
13 |
14 | type MutableOptions = { lib: LibraryOptions };
15 |
16 | export const build = (src: string[], mutate?: (options: MutableOptions) => void) => {
17 | const options: Omit
4 |
2 |
3 |
klass
5 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
124 |
125 |
128 |
4 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
144 |
145 |
148 |
= Omit
& ClassesValueProps;
13 |
14 | export type KlassedOptions = Omit & {
6 | ref?: P extends {
7 | ref?: infer Ref;
8 | }
9 | ? Ref
10 | : unknown;
11 | };
12 |
13 | export type PolymorphicComponentProps = FunctionComponent ;
8 |
9 | export type SupportedComponentProps =
16 | | {
17 | [K in keyof JSX.IntrinsicElements]: P extends JSX.IntrinsicElements[K] ? K : never;
18 | }[keyof JSX.IntrinsicElements]
19 | | SupportedComponentType ;
20 |
21 | export type Classes = "class" | "className";
22 | export type ClassesProps = Partial >(props: P, keys: string[], fkeys?: string[]) => {
10 | const o: /** omited */ Record
4 |
8 |
9 |
144 |
145 | = Omit & ClassesValueProps;
13 |
14 | export type KlassedOptions
2 |
3 |
klass
5 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
30 |
31 |
32 | ## Installation
33 |
34 | ```sh
35 | npm install @klass/core @klass/qwik
36 | # or
37 | yarn add @klass/core @klass/qwik
38 | # or
39 | pnpm add @klass/core @klass/qwik
40 | # or
41 | bun add @klass/core @klass/qwik
42 | ```
43 |
44 | ## Usage
45 |
46 | ```tsx
47 | import { klassed, reklassed } from "@klass/qwik";
48 |
49 | const Button = klassed(
50 | "button",
51 | {
52 | base: "inline-flex items-center justify-center rounded-md outline-none",
53 | variants: {
54 | color: {
55 | default: "bg-neutral-700 text-white",
56 | primary: "bg-indigo-700 text-white",
57 | secondary: "bg-orange-700 text-white",
58 | },
59 | size: {
60 | sm: "px-3 py-0.5 h-7 text-sm font-medium",
61 | md: "px-4 py-1 h-8 text-base font-medium",
62 | lg: "px-5 py-1.5 h-9 text-lg font-semibold",
63 | },
64 | block: {
65 | true: "w-full",
66 | },
67 | // "class" variants are not allowed
68 | },
69 | defaults: {
70 | color: "default",
71 | size: "md",
72 | },
73 | },
74 | {
75 | // default props
76 | dp: {
77 | type: "button",
78 | },
79 | }
80 | );
81 |
82 | const Box = reklassed("div", {
83 | conditions: [
84 | {
85 | base: "",
86 | sm: "sm:",
87 | md: "md:",
88 | lg: "lg:",
89 | xl: "xl:",
90 | "2xl": "2xl:",
91 | },
92 | "base",
93 | ],
94 | variants: {
95 | m: {
96 | "0": "m-0",
97 | "1": "m-1",
98 | "2": "m-2",
99 | "3": "m-3",
100 | "4": "m-4",
101 | "5": "m-5",
102 | "6": "m-6",
103 | "7": "m-7",
104 | "8": "m-8",
105 | },
106 | p: {
107 | "0": "p-0",
108 | "1": "p-1",
109 | "2": "p-2",
110 | "3": "p-3",
111 | "4": "p-4",
112 | "5": "p-5",
113 | "6": "p-6",
114 | "7": "p-7",
115 | "8": "p-8",
116 | },
117 | },
118 | });
119 |
120 | const App = () => {
121 | return (
122 |
148 |