@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.
Files changed (54) hide show
  1. package/.storybook/main.ts +12 -0
  2. package/.storybook/preview.tsx +16 -0
  3. package/package.json +40 -0
  4. package/pnpm-workspace.yaml +2 -0
  5. package/postcss.config.js +6 -0
  6. package/react-shim.js +2 -0
  7. package/src/components/BottomSheet.tsx +113 -0
  8. package/src/components/Button.tsx +92 -0
  9. package/src/components/Card.tsx +102 -0
  10. package/src/components/Collapse.tsx +177 -0
  11. package/src/components/DatePicker.tsx +334 -0
  12. package/src/components/Drawer.tsx +63 -0
  13. package/src/components/Header.tsx +58 -0
  14. package/src/components/Modal.tsx +127 -0
  15. package/src/components/OTPInput.tsx +178 -0
  16. package/src/components/SearchBar.tsx +141 -0
  17. package/src/components/Tabs.tsx +121 -0
  18. package/src/components/TimePicker.tsx +271 -0
  19. package/src/components/Toast.tsx +133 -0
  20. package/src/components/VirtualList.tsx +81 -0
  21. package/src/index.css +3 -0
  22. package/src/index.ts +14 -0
  23. package/src/stories/Button.stories.tsx +76 -0
  24. package/src/stories/Card.stories.tsx +77 -0
  25. package/src/stories/Collapse.stories.tsx +56 -0
  26. package/src/stories/DatePicker.stories.tsx +69 -0
  27. package/src/stories/Modal.stories.tsx +73 -0
  28. package/src/stories/OTPInput.stories.tsx +73 -0
  29. package/src/stories/SearchBar.stories.tsx +78 -0
  30. package/src/stories/Tabs.stories.tsx +66 -0
  31. package/src/stories/TimePicker.stories.tsx +77 -0
  32. package/src/stories/VirtualList.stories.tsx +76 -0
  33. package/src/stories/assets/accessibility.png +0 -0
  34. package/src/stories/assets/accessibility.svg +1 -0
  35. package/src/stories/assets/addon-library.png +0 -0
  36. package/src/stories/assets/assets.png +0 -0
  37. package/src/stories/assets/avif-test-image.avif +0 -0
  38. package/src/stories/assets/context.png +0 -0
  39. package/src/stories/assets/discord.svg +1 -0
  40. package/src/stories/assets/docs.png +0 -0
  41. package/src/stories/assets/figma-plugin.png +0 -0
  42. package/src/stories/assets/github.svg +1 -0
  43. package/src/stories/assets/share.png +0 -0
  44. package/src/stories/assets/styling.png +0 -0
  45. package/src/stories/assets/testing.png +0 -0
  46. package/src/stories/assets/theming.png +0 -0
  47. package/src/stories/assets/tutorials.svg +1 -0
  48. package/src/stories/assets/youtube.svg +1 -0
  49. package/src/vite-env.d.ts +4 -0
  50. package/tailwind.config.js +10 -0
  51. package/tsconfig.json +16 -0
  52. package/tsup.config.ts +15 -0
  53. package/vitest.config.ts +36 -0
  54. 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
+ });
@@ -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" />