@baodev/mini-app-component 1.0.1
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/.storybook/main.ts +12 -0
- package/.storybook/preview.tsx +16 -0
- package/package.json +40 -0
- package/pnpm-workspace.yaml +2 -0
- package/postcss.config.js +6 -0
- package/react-shim.js +2 -0
- package/src/components/BottomSheet.tsx +113 -0
- package/src/components/Button.tsx +92 -0
- package/src/components/Card.tsx +102 -0
- package/src/components/Collapse.tsx +177 -0
- package/src/components/DatePicker.tsx +334 -0
- package/src/components/Drawer.tsx +63 -0
- package/src/components/Header.tsx +58 -0
- package/src/components/Modal.tsx +127 -0
- package/src/components/OTPInput.tsx +178 -0
- package/src/components/SearchBar.tsx +141 -0
- package/src/components/Tabs.tsx +121 -0
- package/src/components/TimePicker.tsx +271 -0
- package/src/components/Toast.tsx +133 -0
- package/src/components/VirtualList.tsx +81 -0
- package/src/index.css +3 -0
- package/src/index.ts +14 -0
- package/src/stories/Button.stories.tsx +76 -0
- package/src/stories/Card.stories.tsx +77 -0
- package/src/stories/Collapse.stories.tsx +56 -0
- package/src/stories/DatePicker.stories.tsx +69 -0
- package/src/stories/Modal.stories.tsx +73 -0
- package/src/stories/OTPInput.stories.tsx +73 -0
- package/src/stories/SearchBar.stories.tsx +78 -0
- package/src/stories/Tabs.stories.tsx +66 -0
- package/src/stories/TimePicker.stories.tsx +77 -0
- package/src/stories/VirtualList.stories.tsx +76 -0
- package/src/stories/assets/accessibility.png +0 -0
- package/src/stories/assets/accessibility.svg +1 -0
- package/src/stories/assets/addon-library.png +0 -0
- package/src/stories/assets/assets.png +0 -0
- package/src/stories/assets/avif-test-image.avif +0 -0
- package/src/stories/assets/context.png +0 -0
- package/src/stories/assets/discord.svg +1 -0
- package/src/stories/assets/docs.png +0 -0
- package/src/stories/assets/figma-plugin.png +0 -0
- package/src/stories/assets/github.svg +1 -0
- package/src/stories/assets/share.png +0 -0
- package/src/stories/assets/styling.png +0 -0
- package/src/stories/assets/testing.png +0 -0
- package/src/stories/assets/theming.png +0 -0
- package/src/stories/assets/tutorials.svg +1 -0
- package/src/stories/assets/youtube.svg +1 -0
- package/src/vite-env.d.ts +4 -0
- package/tailwind.config.js +10 -0
- package/tsconfig.json +16 -0
- package/tsup.config.ts +15 -0
- package/vitest.config.ts +36 -0
- package/vitest.shims.d.ts +1 -0
package/tsup.config.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { defineConfig } from "tsup";
|
|
2
|
+
|
|
3
|
+
export default defineConfig({
|
|
4
|
+
entry: ["src/index.ts"],
|
|
5
|
+
format: ["esm"],
|
|
6
|
+
dts: true,
|
|
7
|
+
platform: "browser",
|
|
8
|
+
target: "es2020",
|
|
9
|
+
external: ["react", "react-dom"],
|
|
10
|
+
clean: true,
|
|
11
|
+
esbuildOptions(options) {
|
|
12
|
+
options.jsx = "automatic"; // dùng react/jsx-runtime tự động
|
|
13
|
+
options.jsxImportSource = "react";
|
|
14
|
+
},
|
|
15
|
+
});
|
package/vitest.config.ts
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import path from 'node:path';
|
|
2
|
+
import { fileURLToPath } from 'node:url';
|
|
3
|
+
|
|
4
|
+
import { defineConfig } from 'vitest/config';
|
|
5
|
+
|
|
6
|
+
import { storybookTest } from '@storybook/addon-vitest/vitest-plugin';
|
|
7
|
+
|
|
8
|
+
import { playwright } from '@vitest/browser-playwright';
|
|
9
|
+
|
|
10
|
+
const dirname =
|
|
11
|
+
typeof __dirname !== 'undefined' ? __dirname : path.dirname(fileURLToPath(import.meta.url));
|
|
12
|
+
|
|
13
|
+
// More info at: https://storybook.js.org/docs/next/writing-tests/integrations/vitest-addon
|
|
14
|
+
export default defineConfig({
|
|
15
|
+
test: {
|
|
16
|
+
projects: [
|
|
17
|
+
{
|
|
18
|
+
extends: true,
|
|
19
|
+
plugins: [
|
|
20
|
+
// The plugin will run tests for the stories defined in your Storybook config
|
|
21
|
+
// See options at: https://storybook.js.org/docs/next/writing-tests/integrations/vitest-addon#storybooktest
|
|
22
|
+
storybookTest({ configDir: path.join(dirname, '.storybook') }),
|
|
23
|
+
],
|
|
24
|
+
test: {
|
|
25
|
+
name: 'storybook',
|
|
26
|
+
browser: {
|
|
27
|
+
enabled: true,
|
|
28
|
+
headless: true,
|
|
29
|
+
provider: playwright({}),
|
|
30
|
+
instances: [{ browser: 'chromium' }],
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
],
|
|
35
|
+
},
|
|
36
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/// <reference types="@vitest/browser-playwright" />
|