create-rslib 0.19.2 → 0.19.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +114 -295
- package/package.json +5 -6
- package/{template-[node-dual]-[]-ts → template-node-dual-ts}/package.json +1 -1
- package/{template-[node-esm]-[]-ts → template-node-esm-ts}/package.json +1 -1
- package/{template-[react]-[]-js → template-react-js}/package.json +2 -2
- package/{template-[react]-[]-ts → template-react-ts}/package.json +3 -3
- package/{template-[react]-[rstest]-ts → template-react-ts}/src/Button.tsx +18 -1
- package/template-rspress/AGENTS.md +10 -0
- package/template-rspress/react-ts/docs/Button.mdx +31 -0
- package/template-rspress/react-ts/docs/_meta.json +1 -0
- package/template-rspress/react-ts/docs/index.mdx +4 -0
- package/template-rspress/react-ts/package.json +15 -0
- package/template-rspress/react-ts/rspress.config.ts +27 -0
- package/{template-[react]-[rstest,storybook]-ts → template-rspress/react-ts}/tsconfig.json +5 -2
- package/template-rstest/AGENTS.md +10 -0
- package/template-rstest/node-js/package.json +10 -0
- package/template-rstest/node-ts/package.json +10 -0
- package/template-rstest/react-js/package.json +13 -0
- package/template-rstest/react-ts/package.json +13 -0
- package/template-rstest/vue-js/package.json +14 -0
- package/template-rstest/vue-ts/package.json +14 -0
- package/template-storybook/AGENTS.md +6 -0
- package/template-storybook/react-js/package.json +15 -0
- package/template-storybook/react-ts/package.json +15 -0
- package/template-storybook/vue-js/package.json +15 -0
- package/template-storybook/vue-ts/package.json +15 -0
- package/template-vitest/node-js/package.json +8 -0
- package/template-vitest/node-ts/package.json +8 -0
- package/template-vitest/react-js/package.json +11 -0
- package/template-vitest/react-ts/package.json +11 -0
- package/template-vitest/vue-js/package.json +12 -0
- package/template-vitest/vue-ts/package.json +12 -0
- package/{template-[vue]-[vitest]-js/vitest.config.js → template-vitest/vue-ts/vitest.config.ts} +1 -1
- package/{template-[vue]-[]-js → template-vue-js}/package.json +1 -1
- package/{template-[vue]-[]-ts → template-vue-ts}/package.json +2 -2
- package/template-[node-dual]-[rstest]-js/AGENTS.md +0 -5
- package/template-[node-dual]-[rstest]-js/package.json +0 -25
- package/template-[node-dual]-[rstest]-js/rslib.config.mjs +0 -14
- package/template-[node-dual]-[rstest]-ts/AGENTS.md +0 -5
- package/template-[node-dual]-[rstest]-ts/package.json +0 -29
- package/template-[node-dual]-[rstest]-ts/rslib.config.ts +0 -15
- package/template-[node-dual]-[vitest]-js/package.json +0 -24
- package/template-[node-dual]-[vitest]-js/rslib.config.mjs +0 -14
- package/template-[node-dual]-[vitest]-js/src/index.js +0 -1
- package/template-[node-dual]-[vitest]-ts/AGENTS.md +0 -5
- package/template-[node-dual]-[vitest]-ts/package.json +0 -28
- package/template-[node-dual]-[vitest]-ts/rslib.config.ts +0 -15
- package/template-[node-dual]-[vitest]-ts/src/index.ts +0 -1
- package/template-[node-dual]-[vitest]-ts/tsconfig.json +0 -15
- package/template-[node-esm]-[]-js/src/index.js +0 -1
- package/template-[node-esm]-[]-ts/src/index.ts +0 -1
- package/template-[node-esm]-[]-ts/tsconfig.json +0 -15
- package/template-[node-esm]-[rstest]-js/AGENTS.md +0 -5
- package/template-[node-esm]-[rstest]-js/package.json +0 -23
- package/template-[node-esm]-[rstest]-js/rslib.config.mjs +0 -10
- package/template-[node-esm]-[rstest]-js/rstest.config.js +0 -6
- package/template-[node-esm]-[rstest]-js/src/index.js +0 -1
- package/template-[node-esm]-[rstest]-js/tests/index.test.js +0 -7
- package/template-[node-esm]-[rstest]-ts/AGENTS.md +0 -5
- package/template-[node-esm]-[rstest]-ts/package.json +0 -27
- package/template-[node-esm]-[rstest]-ts/rslib.config.ts +0 -11
- package/template-[node-esm]-[rstest]-ts/rstest.config.ts +0 -6
- package/template-[node-esm]-[rstest]-ts/src/index.ts +0 -1
- package/template-[node-esm]-[rstest]-ts/tests/index.test.ts +0 -7
- package/template-[node-esm]-[rstest]-ts/tsconfig.json +0 -15
- package/template-[node-esm]-[vitest]-js/AGENTS.md +0 -5
- package/template-[node-esm]-[vitest]-js/package.json +0 -22
- package/template-[node-esm]-[vitest]-js/rslib.config.mjs +0 -10
- package/template-[node-esm]-[vitest]-js/src/index.js +0 -1
- package/template-[node-esm]-[vitest]-js/tests/index.test.js +0 -7
- package/template-[node-esm]-[vitest]-js/vitest.config.js +0 -8
- package/template-[node-esm]-[vitest]-ts/AGENTS.md +0 -5
- package/template-[node-esm]-[vitest]-ts/package.json +0 -26
- package/template-[node-esm]-[vitest]-ts/rslib.config.ts +0 -11
- package/template-[node-esm]-[vitest]-ts/src/index.ts +0 -1
- package/template-[node-esm]-[vitest]-ts/tests/index.test.ts +0 -7
- package/template-[node-esm]-[vitest]-ts/tsconfig.json +0 -15
- package/template-[node-esm]-[vitest]-ts/vitest.config.ts +0 -6
- package/template-[react]-[]-ts/src/Button.tsx +0 -29
- package/template-[react]-[rstest,storybook]-js/AGENTS.md +0 -9
- package/template-[react]-[rstest,storybook]-js/package.json +0 -41
- package/template-[react]-[rstest,storybook]-js/rslib.config.mjs +0 -20
- package/template-[react]-[rstest,storybook]-js/src/Button.jsx +0 -21
- package/template-[react]-[rstest,storybook]-js/src/button.css +0 -34
- package/template-[react]-[rstest,storybook]-js/src/index.jsx +0 -1
- package/template-[react]-[rstest,storybook]-ts/AGENTS.md +0 -9
- package/template-[react]-[rstest,storybook]-ts/package.json +0 -45
- package/template-[react]-[rstest,storybook]-ts/rslib.config.ts +0 -21
- package/template-[react]-[rstest,storybook]-ts/src/Button.tsx +0 -29
- package/template-[react]-[rstest,storybook]-ts/src/button.css +0 -34
- package/template-[react]-[rstest,storybook]-ts/src/index.tsx +0 -1
- package/template-[react]-[rstest]-js/AGENTS.md +0 -5
- package/template-[react]-[rstest]-js/package.json +0 -32
- package/template-[react]-[rstest]-js/rslib.config.mjs +0 -20
- package/template-[react]-[rstest]-js/src/Button.jsx +0 -21
- package/template-[react]-[rstest]-js/src/button.css +0 -34
- package/template-[react]-[rstest]-js/src/index.jsx +0 -1
- package/template-[react]-[rstest]-js/tests/index.test.jsx +0 -11
- package/template-[react]-[rstest]-ts/AGENTS.md +0 -5
- package/template-[react]-[rstest]-ts/package.json +0 -36
- package/template-[react]-[rstest]-ts/rslib.config.ts +0 -21
- package/template-[react]-[rstest]-ts/src/button.css +0 -34
- package/template-[react]-[rstest]-ts/src/index.tsx +0 -1
- package/template-[react]-[rstest]-ts/tests/index.test.tsx +0 -11
- package/template-[react]-[rstest]-ts/tsconfig.json +0 -14
- package/template-[react]-[storybook,vitest]-js/.storybook/main.js +0 -39
- package/template-[react]-[storybook,vitest]-js/AGENTS.md +0 -9
- package/template-[react]-[storybook,vitest]-js/package.json +0 -40
- package/template-[react]-[storybook,vitest]-js/rslib.config.mjs +0 -20
- package/template-[react]-[storybook,vitest]-js/src/Button.jsx +0 -21
- package/template-[react]-[storybook,vitest]-js/src/button.css +0 -34
- package/template-[react]-[storybook,vitest]-js/src/index.jsx +0 -1
- package/template-[react]-[storybook,vitest]-js/stories/Button.stories.jsx +0 -50
- package/template-[react]-[storybook,vitest]-ts/.storybook/main.ts +0 -41
- package/template-[react]-[storybook,vitest]-ts/.storybook/preview.ts +0 -14
- package/template-[react]-[storybook,vitest]-ts/AGENTS.md +0 -9
- package/template-[react]-[storybook,vitest]-ts/package.json +0 -44
- package/template-[react]-[storybook,vitest]-ts/rslib.config.ts +0 -21
- package/template-[react]-[storybook,vitest]-ts/src/Button.tsx +0 -29
- package/template-[react]-[storybook,vitest]-ts/src/button.css +0 -34
- package/template-[react]-[storybook,vitest]-ts/src/index.tsx +0 -1
- package/template-[react]-[storybook,vitest]-ts/stories/Button.stories.ts +0 -52
- package/template-[react]-[storybook,vitest]-ts/tests/tsconfig.json +0 -4
- package/template-[react]-[storybook,vitest]-ts/tsconfig.json +0 -14
- package/template-[react]-[storybook]-js/.storybook/main.js +0 -39
- package/template-[react]-[storybook]-js/.storybook/preview.js +0 -12
- package/template-[react]-[storybook]-js/AGENTS.md +0 -5
- package/template-[react]-[storybook]-js/package.json +0 -35
- package/template-[react]-[storybook]-js/rslib.config.mjs +0 -20
- package/template-[react]-[storybook]-js/src/Button.jsx +0 -21
- package/template-[react]-[storybook]-js/src/button.css +0 -34
- package/template-[react]-[storybook]-js/src/index.jsx +0 -1
- package/template-[react]-[storybook]-js/stories/Button.stories.jsx +0 -50
- package/template-[react]-[storybook]-ts/.storybook/main.ts +0 -41
- package/template-[react]-[storybook]-ts/.storybook/preview.ts +0 -14
- package/template-[react]-[storybook]-ts/AGENTS.md +0 -5
- package/template-[react]-[storybook]-ts/package.json +0 -39
- package/template-[react]-[storybook]-ts/rslib.config.ts +0 -21
- package/template-[react]-[storybook]-ts/src/Button.tsx +0 -29
- package/template-[react]-[storybook]-ts/src/button.css +0 -34
- package/template-[react]-[storybook]-ts/src/index.tsx +0 -1
- package/template-[react]-[storybook]-ts/stories/Button.stories.ts +0 -52
- package/template-[react]-[storybook]-ts/tsconfig.json +0 -14
- package/template-[react]-[vitest]-js/AGENTS.md +0 -5
- package/template-[react]-[vitest]-js/package.json +0 -31
- package/template-[react]-[vitest]-js/rslib.config.mjs +0 -20
- package/template-[react]-[vitest]-js/src/Button.jsx +0 -21
- package/template-[react]-[vitest]-js/src/button.css +0 -34
- package/template-[react]-[vitest]-js/src/index.jsx +0 -1
- package/template-[react]-[vitest]-js/tests/index.test.jsx +0 -11
- package/template-[react]-[vitest]-js/vitest.config.js +0 -11
- package/template-[react]-[vitest]-ts/AGENTS.md +0 -5
- package/template-[react]-[vitest]-ts/package.json +0 -35
- package/template-[react]-[vitest]-ts/rslib.config.ts +0 -21
- package/template-[react]-[vitest]-ts/src/Button.tsx +0 -29
- package/template-[react]-[vitest]-ts/src/button.css +0 -34
- package/template-[react]-[vitest]-ts/src/index.tsx +0 -1
- package/template-[react]-[vitest]-ts/tests/index.test.tsx +0 -11
- package/template-[react]-[vitest]-ts/tests/tsconfig.json +0 -4
- package/template-[react]-[vitest]-ts/tsconfig.json +0 -14
- package/template-[react]-[vitest]-ts/vitest.config.ts +0 -9
- package/template-[vue]-[rstest,storybook]-js/.storybook/preview.js +0 -12
- package/template-[vue]-[rstest,storybook]-js/AGENTS.md +0 -9
- package/template-[vue]-[rstest,storybook]-js/package.json +0 -43
- package/template-[vue]-[rstest,storybook]-js/rslib.config.ts +0 -15
- package/template-[vue]-[rstest,storybook]-js/rstest.config.js +0 -7
- package/template-[vue]-[rstest,storybook]-js/rstest.setup.js +0 -4
- package/template-[vue]-[rstest,storybook]-js/src/Button.vue +0 -43
- package/template-[vue]-[rstest,storybook]-js/src/index.js +0 -1
- package/template-[vue]-[rstest,storybook]-js/src/style.css +0 -34
- package/template-[vue]-[rstest,storybook]-ts/AGENTS.md +0 -9
- package/template-[vue]-[rstest,storybook]-ts/package.json +0 -45
- package/template-[vue]-[rstest,storybook]-ts/rslib.config.ts +0 -15
- package/template-[vue]-[rstest,storybook]-ts/rstest.config.ts +0 -7
- package/template-[vue]-[rstest,storybook]-ts/rstest.setup.ts +0 -4
- package/template-[vue]-[rstest,storybook]-ts/src/Button.vue +0 -35
- package/template-[vue]-[rstest,storybook]-ts/src/index.ts +0 -1
- package/template-[vue]-[rstest,storybook]-ts/src/style.css +0 -34
- package/template-[vue]-[rstest,storybook]-ts/tests/test.d.ts +0 -1
- package/template-[vue]-[rstest,storybook]-ts/tests/tsconfig.json +0 -4
- package/template-[vue]-[rstest,storybook]-ts/tsconfig.json +0 -24
- package/template-[vue]-[rstest]-js/AGENTS.md +0 -5
- package/template-[vue]-[rstest]-js/package.json +0 -34
- package/template-[vue]-[rstest]-js/rslib.config.ts +0 -15
- package/template-[vue]-[rstest]-js/rstest.config.js +0 -7
- package/template-[vue]-[rstest]-js/rstest.setup.js +0 -4
- package/template-[vue]-[rstest]-js/src/Button.vue +0 -43
- package/template-[vue]-[rstest]-js/src/index.js +0 -1
- package/template-[vue]-[rstest]-js/src/style.css +0 -34
- package/template-[vue]-[rstest]-js/tests/index.test.js +0 -16
- package/template-[vue]-[rstest]-ts/AGENTS.md +0 -5
- package/template-[vue]-[rstest]-ts/package.json +0 -36
- package/template-[vue]-[rstest]-ts/rslib.config.ts +0 -15
- package/template-[vue]-[rstest]-ts/rstest.config.ts +0 -7
- package/template-[vue]-[rstest]-ts/rstest.setup.ts +0 -4
- package/template-[vue]-[rstest]-ts/src/Button.vue +0 -35
- package/template-[vue]-[rstest]-ts/src/index.ts +0 -1
- package/template-[vue]-[rstest]-ts/src/style.css +0 -34
- package/template-[vue]-[rstest]-ts/tests/index.test.ts +0 -16
- package/template-[vue]-[rstest]-ts/tests/test.d.ts +0 -1
- package/template-[vue]-[rstest]-ts/tests/tsconfig.json +0 -4
- package/template-[vue]-[rstest]-ts/tsconfig.json +0 -24
- package/template-[vue]-[storybook,vitest]-js/.storybook/main.js +0 -38
- package/template-[vue]-[storybook,vitest]-js/.storybook/preview.js +0 -12
- package/template-[vue]-[storybook,vitest]-js/AGENTS.md +0 -9
- package/template-[vue]-[storybook,vitest]-js/package.json +0 -42
- package/template-[vue]-[storybook,vitest]-js/rslib.config.ts +0 -15
- package/template-[vue]-[storybook,vitest]-js/src/Button.vue +0 -43
- package/template-[vue]-[storybook,vitest]-js/src/index.js +0 -1
- package/template-[vue]-[storybook,vitest]-js/src/style.css +0 -34
- package/template-[vue]-[storybook,vitest]-js/stories/Button.stories.js +0 -50
- package/template-[vue]-[storybook,vitest]-js/vitest.setup.js +0 -1
- package/template-[vue]-[storybook,vitest]-ts/.storybook/main.ts +0 -40
- package/template-[vue]-[storybook,vitest]-ts/.storybook/preview.ts +0 -12
- package/template-[vue]-[storybook,vitest]-ts/AGENTS.md +0 -9
- package/template-[vue]-[storybook,vitest]-ts/package.json +0 -44
- package/template-[vue]-[storybook,vitest]-ts/rslib.config.ts +0 -15
- package/template-[vue]-[storybook,vitest]-ts/src/Button.vue +0 -35
- package/template-[vue]-[storybook,vitest]-ts/src/index.ts +0 -1
- package/template-[vue]-[storybook,vitest]-ts/src/style.css +0 -34
- package/template-[vue]-[storybook,vitest]-ts/stories/Button.stories.js +0 -50
- package/template-[vue]-[storybook,vitest]-ts/tsconfig.json +0 -24
- package/template-[vue]-[storybook,vitest]-ts/vitest.config.js +0 -13
- package/template-[vue]-[storybook,vitest]-ts/vitest.setup.js +0 -1
- package/template-[vue]-[storybook]-js/.storybook/main.js +0 -38
- package/template-[vue]-[storybook]-js/.storybook/preview.js +0 -12
- package/template-[vue]-[storybook]-js/AGENTS.md +0 -5
- package/template-[vue]-[storybook]-js/package.json +0 -36
- package/template-[vue]-[storybook]-js/rslib.config.ts +0 -15
- package/template-[vue]-[storybook]-js/src/Button.vue +0 -43
- package/template-[vue]-[storybook]-js/src/index.js +0 -1
- package/template-[vue]-[storybook]-js/src/style.css +0 -34
- package/template-[vue]-[storybook]-js/stories/Button.stories.js +0 -50
- package/template-[vue]-[storybook]-ts/.storybook/main.ts +0 -40
- package/template-[vue]-[storybook]-ts/.storybook/preview.ts +0 -12
- package/template-[vue]-[storybook]-ts/AGENTS.md +0 -5
- package/template-[vue]-[storybook]-ts/package.json +0 -38
- package/template-[vue]-[storybook]-ts/rslib.config.ts +0 -15
- package/template-[vue]-[storybook]-ts/src/Button.vue +0 -35
- package/template-[vue]-[storybook]-ts/src/index.ts +0 -1
- package/template-[vue]-[storybook]-ts/src/style.css +0 -34
- package/template-[vue]-[storybook]-ts/stories/Button.stories.js +0 -50
- package/template-[vue]-[storybook]-ts/tsconfig.json +0 -24
- package/template-[vue]-[vitest]-js/AGENTS.md +0 -5
- package/template-[vue]-[vitest]-js/package.json +0 -33
- package/template-[vue]-[vitest]-js/rslib.config.ts +0 -15
- package/template-[vue]-[vitest]-js/src/Button.vue +0 -43
- package/template-[vue]-[vitest]-js/src/index.js +0 -1
- package/template-[vue]-[vitest]-js/src/style.css +0 -34
- package/template-[vue]-[vitest]-js/tests/index.test.js +0 -16
- package/template-[vue]-[vitest]-js/vitest.setup.js +0 -1
- package/template-[vue]-[vitest]-ts/AGENTS.md +0 -5
- package/template-[vue]-[vitest]-ts/package.json +0 -35
- package/template-[vue]-[vitest]-ts/rslib.config.ts +0 -15
- package/template-[vue]-[vitest]-ts/src/Button.vue +0 -35
- package/template-[vue]-[vitest]-ts/src/index.ts +0 -1
- package/template-[vue]-[vitest]-ts/src/style.css +0 -34
- package/template-[vue]-[vitest]-ts/tests/index.test.ts +0 -16
- package/template-[vue]-[vitest]-ts/tsconfig.json +0 -24
- package/template-[vue]-[vitest]-ts/vitest.config.js +0 -13
- package/template-[vue]-[vitest]-ts/vitest.setup.js +0 -1
- /package/{template-[node-dual]-[]-js → template-node-dual-js}/package.json +0 -0
- /package/{template-[node-dual]-[]-js → template-node-dual-js}/rslib.config.mjs +0 -0
- /package/{template-[node-dual]-[]-js → template-node-dual-js}/src/index.js +0 -0
- /package/{template-[node-dual]-[]-ts → template-node-dual-ts}/rslib.config.ts +0 -0
- /package/{template-[node-dual]-[]-ts → template-node-dual-ts}/src/index.ts +0 -0
- /package/{template-[node-dual]-[]-ts → template-node-dual-ts}/tsconfig.json +0 -0
- /package/{template-[node-esm]-[]-js → template-node-esm-js}/package.json +0 -0
- /package/{template-[node-esm]-[]-js → template-node-esm-js}/rslib.config.mjs +0 -0
- /package/{template-[node-dual]-[rstest]-js → template-node-esm-js}/src/index.js +0 -0
- /package/{template-[node-esm]-[]-ts → template-node-esm-ts}/rslib.config.ts +0 -0
- /package/{template-[node-dual]-[rstest]-ts → template-node-esm-ts}/src/index.ts +0 -0
- /package/{template-[node-dual]-[rstest]-ts → template-node-esm-ts}/tsconfig.json +0 -0
- /package/{template-[react]-[]-js → template-react-js}/rslib.config.mjs +0 -0
- /package/{template-[react]-[]-js → template-react-js}/src/Button.jsx +0 -0
- /package/{template-[react]-[]-js → template-react-js}/src/button.css +0 -0
- /package/{template-[react]-[]-js → template-react-js}/src/index.jsx +0 -0
- /package/{template-[react]-[]-ts → template-react-ts}/rslib.config.ts +0 -0
- /package/{template-[react]-[]-ts → template-react-ts}/src/button.css +0 -0
- /package/{template-[react]-[]-ts → template-react-ts}/src/index.tsx +0 -0
- /package/{template-[react]-[]-ts → template-react-ts}/tsconfig.json +0 -0
- /package/{template-[node-dual]-[rstest]-js → template-rstest/node-js}/rstest.config.js +0 -0
- /package/{template-[node-dual]-[rstest]-js → template-rstest/node-js}/tests/index.test.js +0 -0
- /package/{template-[node-dual]-[rstest]-ts → template-rstest/node-ts}/rstest.config.ts +0 -0
- /package/{template-[node-dual]-[rstest]-ts → template-rstest/node-ts}/tests/index.test.ts +0 -0
- /package/{template-[react]-[rstest,storybook]-js → template-rstest/react-js}/rstest.config.js +0 -0
- /package/{template-[react]-[rstest,storybook]-js → template-rstest/react-js}/rstest.setup.js +0 -0
- /package/{template-[react]-[rstest,storybook]-js → template-rstest/react-js}/tests/index.test.jsx +0 -0
- /package/{template-[react]-[rstest,storybook]-ts → template-rstest/react-ts}/rstest.config.ts +0 -0
- /package/{template-[react]-[rstest,storybook]-ts → template-rstest/react-ts}/rstest.setup.ts +0 -0
- /package/{template-[react]-[rstest,storybook]-ts → template-rstest/react-ts}/tests/index.test.tsx +0 -0
- /package/{template-[react]-[rstest,storybook]-ts → template-rstest/react-ts}/tests/test.d.ts +0 -0
- /package/{template-[react]-[rstest,storybook]-ts → template-rstest/react-ts}/tests/tsconfig.json +0 -0
- /package/{template-[react]-[rstest]-js → template-rstest/vue-js}/rstest.config.js +0 -0
- /package/{template-[react]-[rstest]-js → template-rstest/vue-js}/rstest.setup.js +0 -0
- /package/{template-[vue]-[rstest,storybook]-js → template-rstest/vue-js}/tests/index.test.js +0 -0
- /package/{template-[react]-[rstest]-ts → template-rstest/vue-ts}/rstest.config.ts +0 -0
- /package/{template-[react]-[rstest]-ts → template-rstest/vue-ts}/rstest.setup.ts +0 -0
- /package/{template-[vue]-[rstest,storybook]-ts → template-rstest/vue-ts}/tests/index.test.ts +0 -0
- /package/{template-[react]-[rstest]-ts → template-rstest/vue-ts}/tests/test.d.ts +0 -0
- /package/{template-[react]-[rstest]-ts → template-rstest/vue-ts}/tests/tsconfig.json +0 -0
- /package/{template-[react]-[rstest,storybook]-js → template-storybook/react-js}/.storybook/main.js +0 -0
- /package/{template-[react]-[rstest,storybook]-js → template-storybook/react-js}/.storybook/preview.js +0 -0
- /package/{template-[react]-[rstest,storybook]-js → template-storybook/react-js}/stories/Button.stories.jsx +0 -0
- /package/{template-[react]-[rstest,storybook]-ts → template-storybook/react-ts}/.storybook/main.ts +0 -0
- /package/{template-[react]-[rstest,storybook]-ts → template-storybook/react-ts}/.storybook/preview.ts +0 -0
- /package/{template-[react]-[rstest,storybook]-ts → template-storybook/react-ts}/stories/Button.stories.ts +0 -0
- /package/{template-[vue]-[rstest,storybook]-js → template-storybook/vue-js}/.storybook/main.js +0 -0
- /package/{template-[react]-[storybook,vitest]-js → template-storybook/vue-js}/.storybook/preview.js +0 -0
- /package/{template-[vue]-[rstest,storybook]-js → template-storybook/vue-js}/stories/Button.stories.js +0 -0
- /package/{template-[vue]-[rstest,storybook]-ts → template-storybook/vue-ts}/.storybook/main.ts +0 -0
- /package/{template-[vue]-[rstest,storybook]-ts → template-storybook/vue-ts}/.storybook/preview.ts +0 -0
- /package/{template-[vue]-[rstest,storybook]-ts → template-storybook/vue-ts}/stories/Button.stories.js +0 -0
- /package/{template-[node-dual]-[vitest]-js → template-vitest}/AGENTS.md +0 -0
- /package/{template-[node-dual]-[vitest]-js → template-vitest/node-js}/tests/index.test.js +0 -0
- /package/{template-[node-dual]-[vitest]-js → template-vitest/node-js}/vitest.config.js +0 -0
- /package/{template-[node-dual]-[vitest]-ts → template-vitest/node-ts}/tests/index.test.ts +0 -0
- /package/{template-[node-dual]-[vitest]-ts → template-vitest/node-ts}/tests/tsconfig.json +0 -0
- /package/{template-[node-dual]-[vitest]-ts → template-vitest/node-ts}/vitest.config.ts +0 -0
- /package/{template-[react]-[storybook,vitest]-js → template-vitest/react-js}/tests/index.test.jsx +0 -0
- /package/{template-[react]-[storybook,vitest]-js → template-vitest/react-js}/vitest.config.js +0 -0
- /package/{template-[react]-[storybook,vitest]-js → template-vitest/react-js}/vitest.setup.js +0 -0
- /package/{template-[react]-[storybook,vitest]-ts → template-vitest/react-ts}/tests/index.test.tsx +0 -0
- /package/{template-[node-esm]-[vitest]-ts → template-vitest/react-ts}/tests/tsconfig.json +0 -0
- /package/{template-[react]-[storybook,vitest]-ts → template-vitest/react-ts}/vitest.config.ts +0 -0
- /package/{template-[react]-[storybook,vitest]-ts → template-vitest/react-ts}/vitest.setup.ts +0 -0
- /package/{template-[vue]-[storybook,vitest]-js → template-vitest/vue-js}/tests/index.test.js +0 -0
- /package/{template-[vue]-[storybook,vitest]-js → template-vitest/vue-js}/vitest.config.js +0 -0
- /package/{template-[react]-[vitest]-js → template-vitest/vue-js}/vitest.setup.js +0 -0
- /package/{template-[vue]-[storybook,vitest]-ts → template-vitest/vue-ts}/tests/index.test.ts +0 -0
- /package/{template-[react]-[vitest]-ts → template-vitest/vue-ts}/vitest.setup.ts +0 -0
- /package/{template-[vue]-[]-js → template-vue-js}/rslib.config.ts +0 -0
- /package/{template-[vue]-[]-js → template-vue-js}/src/Button.vue +0 -0
- /package/{template-[vue]-[]-js → template-vue-js}/src/index.js +0 -0
- /package/{template-[vue]-[]-js → template-vue-js}/src/style.css +0 -0
- /package/{template-[vue]-[]-ts → template-vue-ts}/rslib.config.ts +0 -0
- /package/{template-[vue]-[]-ts → template-vue-ts}/src/Button.vue +0 -0
- /package/{template-[vue]-[]-ts → template-vue-ts}/src/index.ts +0 -0
- /package/{template-[vue]-[]-ts → template-vue-ts}/src/style.css +0 -0
- /package/{template-[vue]-[]-ts → template-vue-ts}/tsconfig.json +0 -0
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { computed } from 'vue';
|
|
3
|
-
import './style.css';
|
|
4
|
-
|
|
5
|
-
interface Props {
|
|
6
|
-
primary?: boolean;
|
|
7
|
-
backgroundColor?: string;
|
|
8
|
-
size?: 'small' | 'medium' | 'large';
|
|
9
|
-
label: string;
|
|
10
|
-
onClick?: () => void;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
const {
|
|
14
|
-
primary = false,
|
|
15
|
-
backgroundColor = undefined,
|
|
16
|
-
size = 'medium',
|
|
17
|
-
label,
|
|
18
|
-
onClick = undefined,
|
|
19
|
-
} = defineProps<Props>();
|
|
20
|
-
|
|
21
|
-
const mode = computed(() =>
|
|
22
|
-
primary ? 'demo-button--primary' : 'demo-button--secondary',
|
|
23
|
-
);
|
|
24
|
-
</script>
|
|
25
|
-
|
|
26
|
-
<template>
|
|
27
|
-
<button
|
|
28
|
-
type="button"
|
|
29
|
-
:class="['demo-button', `demo-button--${size}`, mode]"
|
|
30
|
-
:style="{ backgroundColor }"
|
|
31
|
-
@click="onClick"
|
|
32
|
-
>
|
|
33
|
-
{{ label }}
|
|
34
|
-
</button>
|
|
35
|
-
</template>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as Button } from './Button.vue';
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
.demo-button {
|
|
2
|
-
font-weight: 700;
|
|
3
|
-
border: 0;
|
|
4
|
-
border-radius: 3em;
|
|
5
|
-
cursor: pointer;
|
|
6
|
-
display: inline-block;
|
|
7
|
-
line-height: 1;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
.demo-button--primary {
|
|
11
|
-
color: white;
|
|
12
|
-
background-color: #1ea7fd;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
.demo-button--secondary {
|
|
16
|
-
color: #333;
|
|
17
|
-
background-color: transparent;
|
|
18
|
-
box-shadow: rgba(0, 0, 0, 0.15) 0px 0px 0px 1px inset;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
.demo-button--small {
|
|
22
|
-
font-size: 12px;
|
|
23
|
-
padding: 10px 16px;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
.demo-button--medium {
|
|
27
|
-
font-size: 14px;
|
|
28
|
-
padding: 11px 20px;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
.demo-button--large {
|
|
32
|
-
font-size: 16px;
|
|
33
|
-
padding: 12px 24px;
|
|
34
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { expect, test } from '@rstest/core';
|
|
2
|
-
import { render, screen } from '@testing-library/vue';
|
|
3
|
-
import Button from '../src/Button.vue';
|
|
4
|
-
|
|
5
|
-
test('The button should have correct background color', async () => {
|
|
6
|
-
render(Button, {
|
|
7
|
-
props: {
|
|
8
|
-
backgroundColor: '#ccc',
|
|
9
|
-
label: 'Demo Button',
|
|
10
|
-
},
|
|
11
|
-
});
|
|
12
|
-
const button = screen.getByText('Demo Button');
|
|
13
|
-
expect(button).toHaveStyle({
|
|
14
|
-
backgroundColor: '#ccc',
|
|
15
|
-
});
|
|
16
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
/// <reference types="@testing-library/jest-dom" />
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"lib": ["DOM", "ES2022"],
|
|
4
|
-
"jsx": "preserve",
|
|
5
|
-
"skipLibCheck": true,
|
|
6
|
-
"jsxImportSource": "vue",
|
|
7
|
-
"useDefineForClassFields": true,
|
|
8
|
-
"declaration": true,
|
|
9
|
-
"outDir": "dist",
|
|
10
|
-
"emitDeclarationOnly": true,
|
|
11
|
-
|
|
12
|
-
/* modules */
|
|
13
|
-
"module": "ESNext",
|
|
14
|
-
"isolatedModules": true,
|
|
15
|
-
"resolveJsonModule": true,
|
|
16
|
-
"moduleResolution": "bundler",
|
|
17
|
-
|
|
18
|
-
/* type checking */
|
|
19
|
-
"strict": true,
|
|
20
|
-
"noUnusedLocals": true,
|
|
21
|
-
"noUnusedParameters": true
|
|
22
|
-
},
|
|
23
|
-
"include": ["src"]
|
|
24
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { resolve } from 'node:path';
|
|
2
|
-
import { fileURLToPath } from 'node:url';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* This function is used to resolve the absolute path of a package.
|
|
6
|
-
* It is needed in projects that use Yarn PnP or are set up within a monorepo.
|
|
7
|
-
*/
|
|
8
|
-
const getAbsolutePath = (value) => {
|
|
9
|
-
return resolve(
|
|
10
|
-
fileURLToPath(
|
|
11
|
-
new URL(import.meta.resolve(`${value}/package.json`, import.meta.url)),
|
|
12
|
-
),
|
|
13
|
-
'..',
|
|
14
|
-
);
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
const config = {
|
|
18
|
-
stories: [
|
|
19
|
-
'../stories/**/*.mdx',
|
|
20
|
-
'../stories/**/*.stories.@(js|jsx|mjs|ts|tsx)',
|
|
21
|
-
],
|
|
22
|
-
addons: [
|
|
23
|
-
'@storybook/addon-docs',
|
|
24
|
-
'@storybook/addon-onboarding',
|
|
25
|
-
{
|
|
26
|
-
name: getAbsolutePath('storybook-addon-rslib'),
|
|
27
|
-
},
|
|
28
|
-
],
|
|
29
|
-
framework: {
|
|
30
|
-
name: getAbsolutePath('storybook-vue3-rsbuild'),
|
|
31
|
-
options: {},
|
|
32
|
-
},
|
|
33
|
-
typescript: {
|
|
34
|
-
check: true,
|
|
35
|
-
},
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
export default config;
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "rslib-vue-js",
|
|
3
|
-
"version": "0.0.0",
|
|
4
|
-
"type": "module",
|
|
5
|
-
"exports": {
|
|
6
|
-
".": {
|
|
7
|
-
"types": "./dist/index.d.ts",
|
|
8
|
-
"import": "./dist/index.js"
|
|
9
|
-
}
|
|
10
|
-
},
|
|
11
|
-
"types": "./dist/index.d.ts",
|
|
12
|
-
"files": [
|
|
13
|
-
"dist"
|
|
14
|
-
],
|
|
15
|
-
"scripts": {
|
|
16
|
-
"build": "rslib build",
|
|
17
|
-
"build:storybook": "storybook build",
|
|
18
|
-
"dev": "rslib build --watch",
|
|
19
|
-
"storybook": "storybook dev",
|
|
20
|
-
"test": "vitest run"
|
|
21
|
-
},
|
|
22
|
-
"devDependencies": {
|
|
23
|
-
"@rsbuild/core": "1.7.1",
|
|
24
|
-
"@rslib/core": "workspace:*",
|
|
25
|
-
"@storybook/addon-docs": "^10.1.11",
|
|
26
|
-
"@storybook/addon-onboarding": "^10.1.11",
|
|
27
|
-
"@storybook/vue3": "^10.1.11",
|
|
28
|
-
"@testing-library/jest-dom": "^6.9.1",
|
|
29
|
-
"@testing-library/vue": "^8.1.0",
|
|
30
|
-
"@vitejs/plugin-vue": "^6.0.3",
|
|
31
|
-
"jsdom": "^26.1.0",
|
|
32
|
-
"rsbuild-plugin-unplugin-vue": "^0.1.0",
|
|
33
|
-
"storybook": "^10.1.11",
|
|
34
|
-
"storybook-addon-rslib": "^3.2.0",
|
|
35
|
-
"storybook-vue3-rsbuild": "^3.2.0",
|
|
36
|
-
"vitest": "^4.0.16",
|
|
37
|
-
"vue": "^3.5.26"
|
|
38
|
-
},
|
|
39
|
-
"peerDependencies": {
|
|
40
|
-
"vue": "^3.2.0"
|
|
41
|
-
}
|
|
42
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { defineConfig } from '@rslib/core';
|
|
2
|
-
import { pluginUnpluginVue } from 'rsbuild-plugin-unplugin-vue';
|
|
3
|
-
|
|
4
|
-
export default defineConfig({
|
|
5
|
-
lib: [
|
|
6
|
-
{
|
|
7
|
-
bundle: false,
|
|
8
|
-
format: 'esm',
|
|
9
|
-
},
|
|
10
|
-
],
|
|
11
|
-
output: {
|
|
12
|
-
target: 'web',
|
|
13
|
-
},
|
|
14
|
-
plugins: [pluginUnpluginVue()],
|
|
15
|
-
});
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
<script setup>
|
|
2
|
-
import { computed } from 'vue';
|
|
3
|
-
import './style.css';
|
|
4
|
-
|
|
5
|
-
const {
|
|
6
|
-
primary = false,
|
|
7
|
-
backgroundColor,
|
|
8
|
-
size = 'medium',
|
|
9
|
-
label,
|
|
10
|
-
onClick,
|
|
11
|
-
} = defineProps({
|
|
12
|
-
primary: {
|
|
13
|
-
type: Boolean,
|
|
14
|
-
},
|
|
15
|
-
backgroundColor: {
|
|
16
|
-
type: String,
|
|
17
|
-
},
|
|
18
|
-
size: {
|
|
19
|
-
type: String,
|
|
20
|
-
},
|
|
21
|
-
label: {
|
|
22
|
-
type: String,
|
|
23
|
-
},
|
|
24
|
-
onClick: {
|
|
25
|
-
type: Function,
|
|
26
|
-
},
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
const mode = computed(() =>
|
|
30
|
-
primary ? 'demo-button--primary' : 'demo-button--secondary',
|
|
31
|
-
);
|
|
32
|
-
</script>
|
|
33
|
-
|
|
34
|
-
<template>
|
|
35
|
-
<button
|
|
36
|
-
type="button"
|
|
37
|
-
:class="['demo-button', `demo-button--${size}`, mode]"
|
|
38
|
-
:style="{ backgroundColor }"
|
|
39
|
-
@click="onClick"
|
|
40
|
-
>
|
|
41
|
-
{{ label }}
|
|
42
|
-
</button>
|
|
43
|
-
</template>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as Button } from './Button.vue';
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
.demo-button {
|
|
2
|
-
font-weight: 700;
|
|
3
|
-
border: 0;
|
|
4
|
-
border-radius: 3em;
|
|
5
|
-
cursor: pointer;
|
|
6
|
-
display: inline-block;
|
|
7
|
-
line-height: 1;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
.demo-button--primary {
|
|
11
|
-
color: white;
|
|
12
|
-
background-color: #1ea7fd;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
.demo-button--secondary {
|
|
16
|
-
color: #333;
|
|
17
|
-
background-color: transparent;
|
|
18
|
-
box-shadow: rgba(0, 0, 0, 0.15) 0px 0px 0px 1px inset;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
.demo-button--small {
|
|
22
|
-
font-size: 12px;
|
|
23
|
-
padding: 10px 16px;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
.demo-button--medium {
|
|
27
|
-
font-size: 14px;
|
|
28
|
-
padding: 11px 20px;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
.demo-button--large {
|
|
32
|
-
font-size: 16px;
|
|
33
|
-
padding: 12px 24px;
|
|
34
|
-
}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { fn } from 'storybook/test';
|
|
2
|
-
import Button from '../src/Button';
|
|
3
|
-
|
|
4
|
-
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories#default-export
|
|
5
|
-
const meta = {
|
|
6
|
-
title: 'Example/Button',
|
|
7
|
-
component: Button,
|
|
8
|
-
parameters: {
|
|
9
|
-
// Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/configure/story-layout
|
|
10
|
-
layout: 'centered',
|
|
11
|
-
},
|
|
12
|
-
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/writing-docs/autodocs
|
|
13
|
-
tags: ['autodocs'],
|
|
14
|
-
// More on argTypes: https://storybook.js.org/docs/api/argtypes
|
|
15
|
-
argTypes: {
|
|
16
|
-
backgroundColor: { control: 'color' },
|
|
17
|
-
},
|
|
18
|
-
// Use `fn` to spy on the onClick arg, which will appear in the actions panel once invoked: https://storybook.js.org/docs/essentials/actions#action-args
|
|
19
|
-
args: { onClick: fn() },
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
export default meta;
|
|
23
|
-
|
|
24
|
-
// More on writing stories with args: https://storybook.js.org/docs/writing-stories/args
|
|
25
|
-
export const Primary = {
|
|
26
|
-
args: {
|
|
27
|
-
primary: true,
|
|
28
|
-
label: 'Button',
|
|
29
|
-
},
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
export const Secondary = {
|
|
33
|
-
args: {
|
|
34
|
-
label: 'Button',
|
|
35
|
-
},
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
export const Large = {
|
|
39
|
-
args: {
|
|
40
|
-
size: 'large',
|
|
41
|
-
label: 'Button',
|
|
42
|
-
},
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
export const Small = {
|
|
46
|
-
args: {
|
|
47
|
-
size: 'small',
|
|
48
|
-
label: 'Button',
|
|
49
|
-
},
|
|
50
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import '@testing-library/jest-dom/vitest';
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { resolve } from 'node:path';
|
|
2
|
-
import { fileURLToPath } from 'node:url';
|
|
3
|
-
|
|
4
|
-
import type { StorybookConfig } from 'storybook-vue3-rsbuild';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* This function is used to resolve the absolute path of a package.
|
|
8
|
-
* It is needed in projects that use Yarn PnP or are set up within a monorepo.
|
|
9
|
-
*/
|
|
10
|
-
const getAbsolutePath = (value: string): any => {
|
|
11
|
-
return resolve(
|
|
12
|
-
fileURLToPath(
|
|
13
|
-
new URL(import.meta.resolve(`${value}/package.json`, import.meta.url)),
|
|
14
|
-
),
|
|
15
|
-
'..',
|
|
16
|
-
);
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
const config: StorybookConfig = {
|
|
20
|
-
stories: [
|
|
21
|
-
'../stories/**/*.mdx',
|
|
22
|
-
'../stories/**/*.stories.@(js|jsx|mjs|ts|tsx)',
|
|
23
|
-
],
|
|
24
|
-
addons: [
|
|
25
|
-
'@storybook/addon-docs',
|
|
26
|
-
'@storybook/addon-onboarding',
|
|
27
|
-
{
|
|
28
|
-
name: getAbsolutePath('storybook-addon-rslib'),
|
|
29
|
-
},
|
|
30
|
-
],
|
|
31
|
-
framework: {
|
|
32
|
-
name: getAbsolutePath('storybook-vue3-rsbuild'),
|
|
33
|
-
options: {},
|
|
34
|
-
},
|
|
35
|
-
typescript: {
|
|
36
|
-
check: true,
|
|
37
|
-
},
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
export default config;
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "rslib-vue-ts",
|
|
3
|
-
"version": "0.0.0",
|
|
4
|
-
"type": "module",
|
|
5
|
-
"exports": {
|
|
6
|
-
".": {
|
|
7
|
-
"types": "./dist/index.d.ts",
|
|
8
|
-
"import": "./dist/index.js"
|
|
9
|
-
}
|
|
10
|
-
},
|
|
11
|
-
"types": "./dist/index.d.ts",
|
|
12
|
-
"files": [
|
|
13
|
-
"dist"
|
|
14
|
-
],
|
|
15
|
-
"scripts": {
|
|
16
|
-
"build": "rslib build && vue-tsc",
|
|
17
|
-
"build:storybook": "storybook build",
|
|
18
|
-
"dev": "rslib build --watch",
|
|
19
|
-
"storybook": "storybook dev",
|
|
20
|
-
"test": "vitest run"
|
|
21
|
-
},
|
|
22
|
-
"devDependencies": {
|
|
23
|
-
"@rsbuild/core": "1.7.1",
|
|
24
|
-
"@rslib/core": "workspace:*",
|
|
25
|
-
"@storybook/addon-docs": "^10.1.11",
|
|
26
|
-
"@storybook/addon-onboarding": "^10.1.11",
|
|
27
|
-
"@storybook/vue3": "^10.1.11",
|
|
28
|
-
"@testing-library/jest-dom": "^6.9.1",
|
|
29
|
-
"@testing-library/vue": "^8.1.0",
|
|
30
|
-
"@vitejs/plugin-vue": "^6.0.3",
|
|
31
|
-
"jsdom": "^26.1.0",
|
|
32
|
-
"rsbuild-plugin-unplugin-vue": "^0.1.0",
|
|
33
|
-
"storybook": "^10.1.11",
|
|
34
|
-
"storybook-addon-rslib": "^3.2.0",
|
|
35
|
-
"storybook-vue3-rsbuild": "^3.2.0",
|
|
36
|
-
"typescript": "^5.9.3",
|
|
37
|
-
"vitest": "^4.0.16",
|
|
38
|
-
"vue": "^3.5.26",
|
|
39
|
-
"vue-tsc": "^3.2.2"
|
|
40
|
-
},
|
|
41
|
-
"peerDependencies": {
|
|
42
|
-
"vue": "^3.2.0"
|
|
43
|
-
}
|
|
44
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { defineConfig } from '@rslib/core';
|
|
2
|
-
import { pluginUnpluginVue } from 'rsbuild-plugin-unplugin-vue';
|
|
3
|
-
|
|
4
|
-
export default defineConfig({
|
|
5
|
-
lib: [
|
|
6
|
-
{
|
|
7
|
-
bundle: false,
|
|
8
|
-
format: 'esm',
|
|
9
|
-
},
|
|
10
|
-
],
|
|
11
|
-
output: {
|
|
12
|
-
target: 'web',
|
|
13
|
-
},
|
|
14
|
-
plugins: [pluginUnpluginVue()],
|
|
15
|
-
});
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { computed } from 'vue';
|
|
3
|
-
import './style.css';
|
|
4
|
-
|
|
5
|
-
interface Props {
|
|
6
|
-
primary?: boolean;
|
|
7
|
-
backgroundColor?: string;
|
|
8
|
-
size?: 'small' | 'medium' | 'large';
|
|
9
|
-
label: string;
|
|
10
|
-
onClick?: () => void;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
const {
|
|
14
|
-
primary = false,
|
|
15
|
-
backgroundColor = undefined,
|
|
16
|
-
size = 'medium',
|
|
17
|
-
label,
|
|
18
|
-
onClick = undefined,
|
|
19
|
-
} = defineProps<Props>();
|
|
20
|
-
|
|
21
|
-
const mode = computed(() =>
|
|
22
|
-
primary ? 'demo-button--primary' : 'demo-button--secondary',
|
|
23
|
-
);
|
|
24
|
-
</script>
|
|
25
|
-
|
|
26
|
-
<template>
|
|
27
|
-
<button
|
|
28
|
-
type="button"
|
|
29
|
-
:class="['demo-button', `demo-button--${size}`, mode]"
|
|
30
|
-
:style="{ backgroundColor }"
|
|
31
|
-
@click="onClick"
|
|
32
|
-
>
|
|
33
|
-
{{ label }}
|
|
34
|
-
</button>
|
|
35
|
-
</template>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as Button } from './Button.vue';
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
.demo-button {
|
|
2
|
-
font-weight: 700;
|
|
3
|
-
border: 0;
|
|
4
|
-
border-radius: 3em;
|
|
5
|
-
cursor: pointer;
|
|
6
|
-
display: inline-block;
|
|
7
|
-
line-height: 1;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
.demo-button--primary {
|
|
11
|
-
color: white;
|
|
12
|
-
background-color: #1ea7fd;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
.demo-button--secondary {
|
|
16
|
-
color: #333;
|
|
17
|
-
background-color: transparent;
|
|
18
|
-
box-shadow: rgba(0, 0, 0, 0.15) 0px 0px 0px 1px inset;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
.demo-button--small {
|
|
22
|
-
font-size: 12px;
|
|
23
|
-
padding: 10px 16px;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
.demo-button--medium {
|
|
27
|
-
font-size: 14px;
|
|
28
|
-
padding: 11px 20px;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
.demo-button--large {
|
|
32
|
-
font-size: 16px;
|
|
33
|
-
padding: 12px 24px;
|
|
34
|
-
}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { fn } from 'storybook/test';
|
|
2
|
-
import Button from '../src/Button';
|
|
3
|
-
|
|
4
|
-
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories#default-export
|
|
5
|
-
const meta = {
|
|
6
|
-
title: 'Example/Button',
|
|
7
|
-
component: Button,
|
|
8
|
-
parameters: {
|
|
9
|
-
// Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/configure/story-layout
|
|
10
|
-
layout: 'centered',
|
|
11
|
-
},
|
|
12
|
-
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/writing-docs/autodocs
|
|
13
|
-
tags: ['autodocs'],
|
|
14
|
-
// More on argTypes: https://storybook.js.org/docs/api/argtypes
|
|
15
|
-
argTypes: {
|
|
16
|
-
backgroundColor: { control: 'color' },
|
|
17
|
-
},
|
|
18
|
-
// Use `fn` to spy on the onClick arg, which will appear in the actions panel once invoked: https://storybook.js.org/docs/essentials/actions#action-args
|
|
19
|
-
args: { onClick: fn() },
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
export default meta;
|
|
23
|
-
|
|
24
|
-
// More on writing stories with args: https://storybook.js.org/docs/writing-stories/args
|
|
25
|
-
export const Primary = {
|
|
26
|
-
args: {
|
|
27
|
-
primary: true,
|
|
28
|
-
label: 'Button',
|
|
29
|
-
},
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
export const Secondary = {
|
|
33
|
-
args: {
|
|
34
|
-
label: 'Button',
|
|
35
|
-
},
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
export const Large = {
|
|
39
|
-
args: {
|
|
40
|
-
size: 'large',
|
|
41
|
-
label: 'Button',
|
|
42
|
-
},
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
export const Small = {
|
|
46
|
-
args: {
|
|
47
|
-
size: 'small',
|
|
48
|
-
label: 'Button',
|
|
49
|
-
},
|
|
50
|
-
};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"lib": ["DOM", "ES2022"],
|
|
4
|
-
"jsx": "preserve",
|
|
5
|
-
"skipLibCheck": true,
|
|
6
|
-
"jsxImportSource": "vue",
|
|
7
|
-
"useDefineForClassFields": true,
|
|
8
|
-
"declaration": true,
|
|
9
|
-
"outDir": "dist",
|
|
10
|
-
"emitDeclarationOnly": true,
|
|
11
|
-
|
|
12
|
-
/* modules */
|
|
13
|
-
"module": "ESNext",
|
|
14
|
-
"isolatedModules": true,
|
|
15
|
-
"resolveJsonModule": true,
|
|
16
|
-
"moduleResolution": "bundler",
|
|
17
|
-
|
|
18
|
-
/* type checking */
|
|
19
|
-
"strict": true,
|
|
20
|
-
"noUnusedLocals": true,
|
|
21
|
-
"noUnusedParameters": true
|
|
22
|
-
},
|
|
23
|
-
"include": ["src"]
|
|
24
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/// <reference types="vitest/config" />
|
|
2
|
-
|
|
3
|
-
import pluginVue from '@vitejs/plugin-vue';
|
|
4
|
-
import { defineConfig } from 'vitest/config';
|
|
5
|
-
|
|
6
|
-
export default defineConfig({
|
|
7
|
-
// Configure Vitest (https://vitest.dev/config/)
|
|
8
|
-
test: {
|
|
9
|
-
environment: 'jsdom',
|
|
10
|
-
setupFiles: './vitest.setup.js',
|
|
11
|
-
},
|
|
12
|
-
plugins: [pluginVue()],
|
|
13
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import '@testing-library/jest-dom/vitest';
|