am-shared-assets 0.0.3 → 0.0.5

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 (109) hide show
  1. package/dist/am-shared-assets.js +1967 -0
  2. package/package.json +5 -6
  3. package/.gitlab-ci.yml +0 -31
  4. package/.storybook/main.ts +0 -17
  5. package/.storybook/preview.ts +0 -22
  6. package/.storybook/vitest.setup.ts +0 -7
  7. package/Dockerfile +0 -36
  8. package/docker-compose.yml +0 -12
  9. package/eslint.config.js +0 -23
  10. package/index.html +0 -13
  11. package/postcss.config.js +0 -6
  12. package/src/App.tsx +0 -8
  13. package/src/components/Alert.tsx +0 -194
  14. package/src/components/Badge.tsx +0 -48
  15. package/src/components/Button.tsx +0 -137
  16. package/src/components/Chip.tsx +0 -139
  17. package/src/components/Input.tsx +0 -137
  18. package/src/components/Radio.tsx +0 -89
  19. package/src/components/RangeSlider.tsx +0 -106
  20. package/src/components/Select.tsx +0 -13
  21. package/src/components/Switch.tsx +0 -76
  22. package/src/components/Tooltip.tsx +0 -111
  23. package/src/icons/components/AddIcon.tsx +0 -27
  24. package/src/icons/components/ArrowDownIcon.tsx +0 -25
  25. package/src/icons/components/ArrowRightIcon.tsx +0 -37
  26. package/src/icons/components/BagIcon.tsx +0 -25
  27. package/src/icons/components/BoxIcon.tsx +0 -43
  28. package/src/icons/components/BoxTimeIcon.tsx +0 -47
  29. package/src/icons/components/CardTickIcon.tsx +0 -54
  30. package/src/icons/components/CardsIcon.tsx +0 -48
  31. package/src/icons/components/CategoryIcon.tsx +0 -37
  32. package/src/icons/components/ChevronBottomIcon.tsx +0 -22
  33. package/src/icons/components/ChevronLeftIcon.tsx +0 -29
  34. package/src/icons/components/ChevronRightIcon.tsx +0 -29
  35. package/src/icons/components/ChevronTopIcon.tsx +0 -29
  36. package/src/icons/components/CloseCircleIcon.tsx +0 -25
  37. package/src/icons/components/CloseIcon.tsx +0 -29
  38. package/src/icons/components/DislikeIcon.tsx +0 -32
  39. package/src/icons/components/EditIcon.tsx +0 -39
  40. package/src/icons/components/HeartIcon.tsx +0 -28
  41. package/src/icons/components/HomeIcon.tsx +0 -19
  42. package/src/icons/components/InfoIcon.tsx +0 -25
  43. package/src/icons/components/LikeIcon.tsx +0 -32
  44. package/src/icons/components/MessageIcon.tsx +0 -50
  45. package/src/icons/components/MoneyIcon.tsx +0 -57
  46. package/src/icons/components/MoreIcon.tsx +0 -33
  47. package/src/icons/components/OutlineTickCircleIcon.tsx +0 -35
  48. package/src/icons/components/RotateBoxIcon.tsx +0 -56
  49. package/src/icons/components/RotateInfoIcon.tsx +0 -34
  50. package/src/icons/components/SearchIcon.tsx +0 -35
  51. package/src/icons/components/SettingIcon.tsx +0 -69
  52. package/src/icons/components/ShareIcon.tsx +0 -37
  53. package/src/icons/components/ShopIcon.tsx +0 -56
  54. package/src/icons/components/ShoppingCartIcon.tsx +0 -53
  55. package/src/icons/components/SpinnerIcon.tsx +0 -25
  56. package/src/icons/components/StarIcon.tsx +0 -29
  57. package/src/icons/components/TickCircleIcon.tsx +0 -25
  58. package/src/icons/components/TrashIcon.tsx +0 -56
  59. package/src/icons/components/TruckIcon.tsx +0 -51
  60. package/src/icons/components/UserIcon.tsx +0 -29
  61. package/src/icons/components/WalletCheckIcon.tsx +0 -52
  62. package/src/icons/components/WarningIcon.tsx +0 -19
  63. package/src/icons/index.ts +0 -83
  64. package/src/index.css +0 -36
  65. package/src/index.ts +0 -2
  66. package/src/main.tsx +0 -10
  67. package/src/stories/Alert.stories.ts +0 -22
  68. package/src/stories/Badge.stories.tsx +0 -20
  69. package/src/stories/Button.stories.tsx +0 -108
  70. package/src/stories/Chip.stories.ts +0 -20
  71. package/src/stories/Configure.mdx +0 -364
  72. package/src/stories/IconGallery.stories.tsx +0 -99
  73. package/src/stories/Input.stories.ts +0 -21
  74. package/src/stories/Radio.stories.tsx +0 -21
  75. package/src/stories/RangeSlider.stories.tsx +0 -68
  76. package/src/stories/Select.stories.ts +0 -21
  77. package/src/stories/Switch.stories.tsx +0 -21
  78. package/src/stories/Tooltip.stories.ts +0 -20
  79. package/src/stories/assets/accessibility.png +0 -0
  80. package/src/stories/assets/accessibility.svg +0 -1
  81. package/src/stories/assets/addon-library.png +0 -0
  82. package/src/stories/assets/assets.png +0 -0
  83. package/src/stories/assets/avif-test-image.avif +0 -0
  84. package/src/stories/assets/context.png +0 -0
  85. package/src/stories/assets/discord.svg +0 -1
  86. package/src/stories/assets/docs.png +0 -0
  87. package/src/stories/assets/figma-plugin.png +0 -0
  88. package/src/stories/assets/fonts/woff/IRANSansXFaNum-Bold.woff +0 -0
  89. package/src/stories/assets/fonts/woff/IRANSansXFaNum-DemiBold.woff +0 -0
  90. package/src/stories/assets/fonts/woff/IRANSansXFaNum-Medium.woff +0 -0
  91. package/src/stories/assets/fonts/woff/IRANSansXFaNum-Regular.woff +0 -0
  92. package/src/stories/assets/fonts/woff2/IRANSansXFaNum-Bold.woff2 +0 -0
  93. package/src/stories/assets/fonts/woff2/IRANSansXFaNum-DemiBold.woff2 +0 -0
  94. package/src/stories/assets/fonts/woff2/IRANSansXFaNum-Medium.woff2 +0 -0
  95. package/src/stories/assets/fonts/woff2/IRANSansXFaNum-Regular.woff2 +0 -0
  96. package/src/stories/assets/github.svg +0 -1
  97. package/src/stories/assets/share.png +0 -0
  98. package/src/stories/assets/styling.png +0 -0
  99. package/src/stories/assets/testing.png +0 -0
  100. package/src/stories/assets/theming.png +0 -0
  101. package/src/stories/assets/tutorials.svg +0 -1
  102. package/src/stories/assets/youtube.svg +0 -1
  103. package/tailwind.config.js +0 -165
  104. package/tsconfig.app.json +0 -28
  105. package/tsconfig.json +0 -7
  106. package/tsconfig.node.json +0 -26
  107. package/vite.config.ts +0 -38
  108. package/vitest.shims.d.ts +0 -1
  109. /package/{public → dist}/vite.svg +0 -0
@@ -1,51 +0,0 @@
1
- const TruckIcon = ({
2
- color,
3
- size = 20,
4
- }: {
5
- color?: string;
6
- size?: number;
7
- }) => {
8
- return (
9
- <svg
10
- width={size}
11
- height={size}
12
- viewBox="0 0 16 16"
13
- fill="none"
14
- xmlns="http://www.w3.org/2000/svg"
15
- style={{color}}
16
- >
17
- <path
18
- d="M9.99992 1.33333V8C9.99992 8.73333 9.39992 9.33333 8.66659 9.33333H1.33325V3.99999C1.33325 2.52666 2.52659 1.33333 3.99992 1.33333H9.99992Z"
19
- stroke="currentColor"
20
- stroke-linecap="round"
21
- stroke-linejoin="round"
22
- />
23
- <path
24
- d="M14.6666 9.33333V11.3333C14.6666 12.44 13.7733 13.3333 12.6666 13.3333H11.9999C11.9999 12.6 11.3999 12 10.6666 12C9.93325 12 9.33325 12.6 9.33325 13.3333H6.66659C6.66659 12.6 6.06659 12 5.33325 12C4.59992 12 3.99992 12.6 3.99992 13.3333H3.33325C2.22659 13.3333 1.33325 12.44 1.33325 11.3333V9.33333H8.66659C9.39992 9.33333 9.99992 8.73333 9.99992 8V3.33333H11.2266C11.7066 3.33333 12.1466 3.59333 12.3866 4.00667L13.5266 5.99999H12.6666C12.2999 5.99999 11.9999 6.29999 11.9999 6.66666V8.66666C11.9999 9.03333 12.2999 9.33333 12.6666 9.33333H14.6666Z"
25
- stroke="currentColor"
26
- stroke-linecap="round"
27
- stroke-linejoin="round"
28
- />
29
- <path
30
- d="M5.33333 14.6667C6.06971 14.6667 6.66667 14.0697 6.66667 13.3333C6.66667 12.597 6.06971 12 5.33333 12C4.59695 12 4 12.597 4 13.3333C4 14.0697 4.59695 14.6667 5.33333 14.6667Z"
31
- stroke="currentColor"
32
- stroke-linecap="round"
33
- stroke-linejoin="round"
34
- />
35
- <path
36
- d="M10.6666 14.6667C11.403 14.6667 11.9999 14.0697 11.9999 13.3333C11.9999 12.597 11.403 12 10.6666 12C9.93021 12 9.33325 12.597 9.33325 13.3333C9.33325 14.0697 9.93021 14.6667 10.6666 14.6667Z"
37
- stroke="currentColor"
38
- stroke-linecap="round"
39
- stroke-linejoin="round"
40
- />
41
- <path
42
- d="M14.6667 8V9.33333H12.6667C12.3 9.33333 12 9.03333 12 8.66667V6.66667C12 6.3 12.3 6 12.6667 6H13.5267L14.6667 8Z"
43
- stroke="currentColor"
44
- stroke-linecap="round"
45
- stroke-linejoin="round"
46
- />
47
- </svg>
48
- );
49
- };
50
-
51
- export default TruckIcon;
@@ -1,29 +0,0 @@
1
- const UserIcon = ({
2
- color,
3
- size = 20,
4
- }: {
5
- color?: string;
6
- size?: number;
7
- }) => {
8
- return (
9
- <svg
10
- width={size}
11
- height={size}
12
- viewBox="0 0 20 20"
13
- fill="none"
14
- xmlns="http://www.w3.org/2000/svg"
15
- style={{color}}
16
- >
17
- <path
18
- d="M9.99992 9.99984C12.3011 9.99984 14.1666 8.13436 14.1666 5.83317C14.1666 3.53198 12.3011 1.6665 9.99992 1.6665C7.69873 1.6665 5.83325 3.53198 5.83325 5.83317C5.83325 8.13436 7.69873 9.99984 9.99992 9.99984Z"
19
- fill="currentColor"
20
- />
21
- <path
22
- d="M10 12.0835C5.82505 12.0835 2.42505 14.8835 2.42505 18.3335C2.42505 18.5668 2.60838 18.7502 2.84172 18.7502H17.1584C17.3917 18.7502 17.575 18.5668 17.575 18.3335C17.575 14.8835 14.175 12.0835 10 12.0835Z"
23
- fill="currentColor"
24
- />
25
- </svg>
26
- );
27
- };
28
-
29
- export default UserIcon;
@@ -1,52 +0,0 @@
1
- const WalletCheckIcon = ({
2
- color,
3
- size = 20,
4
- }: {
5
- color?: string;
6
- size?: number;
7
- }) => {
8
- return (
9
- <svg
10
- width={size}
11
- height={size}
12
- viewBox="0 0 16 16"
13
- fill="none"
14
- xmlns="http://www.w3.org/2000/svg"
15
- style={{color}}
16
- >
17
- <path
18
- d="M6.00008 12.6667C6.00008 13.1667 5.86008 13.64 5.61341 14.04C5.15341 14.8133 4.30675 15.3333 3.33341 15.3333C2.36008 15.3333 1.51342 14.8133 1.05342 14.04C0.806749 13.64 0.666748 13.1667 0.666748 12.6667C0.666748 11.1933 1.86008 10 3.33341 10C4.80675 10 6.00008 11.1933 6.00008 12.6667Z"
19
- stroke="currentColor"
20
- stroke-miterlimit="10"
21
- stroke-linecap="round"
22
- stroke-linejoin="round"
23
- />
24
- <path
25
- d="M2.29443 12.6663L2.95443 13.3263L4.37444 12.013"
26
- stroke="currentColor"
27
- stroke-linecap="round"
28
- stroke-linejoin="round"
29
- />
30
- <path
31
- d="M11.8344 4.69998C11.6744 4.67331 11.5077 4.66665 11.3344 4.66665H4.66769C4.48102 4.66665 4.30102 4.67998 4.12769 4.70665C4.22102 4.51998 4.35435 4.34667 4.51435 4.18667L6.68102 2.01333C7.59435 1.10667 9.07435 1.10667 9.98769 2.01333L11.1544 3.1933C11.581 3.6133 11.8077 4.14664 11.8344 4.69998Z"
32
- stroke="currentColor"
33
- stroke-linecap="round"
34
- stroke-linejoin="round"
35
- />
36
- <path
37
- d="M14.6666 8V11.3333C14.6666 13.3333 13.3333 14.6667 11.3333 14.6667H5.08659C5.29325 14.4933 5.47325 14.28 5.61325 14.04C5.85992 13.64 5.99992 13.1667 5.99992 12.6667C5.99992 11.1933 4.80659 10 3.33325 10C2.53325 10 1.81992 10.3533 1.33325 10.9067V8C1.33325 6.18667 2.42658 4.92 4.12658 4.70667C4.29992 4.68 4.47992 4.66667 4.66659 4.66667H11.3333C11.5066 4.66667 11.6733 4.67333 11.8333 4.69999C13.5533 4.89999 14.6666 6.17333 14.6666 8Z"
38
- stroke="currentColor"
39
- stroke-linecap="round"
40
- stroke-linejoin="round"
41
- />
42
- <path
43
- d="M14.6666 8.33334H12.6666C11.9333 8.33334 11.3333 8.93334 11.3333 9.66667C11.3333 10.4 11.9333 11 12.6666 11H14.6666"
44
- stroke="currentColor"
45
- stroke-linecap="round"
46
- stroke-linejoin="round"
47
- />
48
- </svg>
49
- );
50
- };
51
-
52
- export default WalletCheckIcon;
@@ -1,19 +0,0 @@
1
- const WarningIcon = ({ color, size = 24 }: { color?: string; size?: number }) => {
2
- return (
3
- <svg
4
- width={size}
5
- height={size}
6
- viewBox="0 0 21 20"
7
- fill="none"
8
- xmlns="http://www.w3.org/2000/svg"
9
- style={{ color }}
10
- >
11
- <path
12
- d="M20.1999 13.92L13.7999 2.4C12.9399 0.85 11.7499 0 10.4399 0C9.12992 0 7.93992 0.85 7.07992 2.4L0.679919 13.92C-0.130081 15.39 -0.220081 16.8 0.429919 17.91C1.07992 19.02 2.35992 19.63 4.03992 19.63H16.8399C18.5199 19.63 19.7999 19.02 20.4499 17.91C21.0999 16.8 21.0099 15.38 20.1999 13.92ZM9.68992 7C9.68992 6.59 10.0299 6.25 10.4399 6.25C10.8499 6.25 11.1899 6.59 11.1899 7V12C11.1899 12.41 10.8499 12.75 10.4399 12.75C10.0299 12.75 9.68992 12.41 9.68992 12V7ZM11.1499 15.71C11.0999 15.75 11.0499 15.79 10.9999 15.83C10.9399 15.87 10.8799 15.9 10.8199 15.92C10.7599 15.95 10.6999 15.97 10.6299 15.98C10.5699 15.99 10.4999 16 10.4399 16C10.3799 16 10.3099 15.99 10.2399 15.98C10.1799 15.97 10.1199 15.95 10.0599 15.92C9.99992 15.9 9.93992 15.87 9.87992 15.83C9.82992 15.79 9.77992 15.75 9.72992 15.71C9.54992 15.52 9.43992 15.26 9.43992 15C9.43992 14.74 9.54992 14.48 9.72992 14.29C9.77992 14.25 9.82992 14.21 9.87992 14.17C9.93992 14.13 9.99992 14.1 10.0599 14.08C10.1199 14.05 10.1799 14.03 10.2399 14.02C10.3699 13.99 10.5099 13.99 10.6299 14.02C10.6999 14.03 10.7599 14.05 10.8199 14.08C10.8799 14.1 10.9399 14.13 10.9999 14.17C11.0499 14.21 11.0999 14.25 11.1499 14.29C11.3299 14.48 11.4399 14.74 11.4399 15C11.4399 15.26 11.3299 15.52 11.1499 15.71Z"
13
- fill="currentColor"
14
- />
15
- </svg>
16
- );
17
- };
18
-
19
- export default WarningIcon;
@@ -1,83 +0,0 @@
1
- import CloseIcon from './components/CloseIcon';
2
- import InfoIcon from './components/InfoIcon';
3
- import WarningIcon from './components/WarningIcon';
4
- import CloseCircleIcon from './components/CloseCircleIcon';
5
- import TickCircleIcon from './components/TickCircleIcon';
6
- import ShoppingCartIcon from './components/ShoppingCartIcon';
7
- import SearchIcon from './components/SearchIcon';
8
- import ArrowRightIcon from './components/ArrowRightIcon';
9
- import ChevronLeftIcon from './components/ChevronLeftIcon';
10
- import ChevronRightIcon from './components/ChevronRightIcon';
11
- import ChevronTopIcon from './components/ChevronTopIcon';
12
- import ShopIcon from './components/ShopIcon';
13
- import StarIcon from './components/StarIcon';
14
- import HeartIcon from './components/HeartIcon';
15
- import ShareIcon from './components/ShareIcon';
16
- import TruckIcon from './components/TruckIcon';
17
- import BoxIcon from './components/BoxIcon';
18
- import CardTickIcon from './components/CardTickIcon';
19
- import CardsIcon from './components/CardsIcon';
20
- import WalletCheckIcon from './components/WalletCheckIcon';
21
- import RotateBoxIcon from './components/RotateBoxIcon';
22
- import LikeIcon from './components/LikeIcon';
23
- import DislikeIcon from './components/DislikeIcon';
24
- import RotateInfoIcon from './components/RotateInfoIcon';
25
- import ChevronBottomIcon from './components/ChevronBottomIcon';
26
- import EditIcon from './components/EditIcon';
27
- import SettingIcon from './components/SettingIcon';
28
- import UserIcon from './components/UserIcon';
29
- import BagIcon from './components/BagIcon';
30
- import CategoryIcon from './components/CategoryIcon';
31
- import HomeIcon from './components/HomeIcon';
32
- import TrashIcon from './components/TrashIcon';
33
- import MoreIcon from './components/MoreIcon';
34
- import MessageIcon from './components/MessageIcon';
35
- import AddIcon from './components/AddIcon';
36
- import BoxTimeIcon from './components/BoxTimeIcon';
37
- import MoneyIcon from './components/MoneyIcon';
38
- import ArrowDownIcon from './components/ArrowDownIcon';
39
- import SpinnerIcon from './components/SpinnerIcon';
40
- import OutlineTickCircleIcon from './components/OutlineTickCircleIcon';
41
-
42
- export {
43
- CloseIcon,
44
- InfoIcon,
45
- WarningIcon,
46
- CloseCircleIcon,
47
- TickCircleIcon,
48
- ShoppingCartIcon,
49
- SearchIcon,
50
- ArrowRightIcon,
51
- ChevronLeftIcon,
52
- ChevronRightIcon,
53
- ChevronTopIcon,
54
- ShopIcon,
55
- StarIcon,
56
- HeartIcon,
57
- ShareIcon,
58
- TruckIcon,
59
- BoxIcon,
60
- CardTickIcon,
61
- CardsIcon,
62
- WalletCheckIcon,
63
- RotateBoxIcon,
64
- LikeIcon,
65
- DislikeIcon,
66
- RotateInfoIcon,
67
- ChevronBottomIcon,
68
- EditIcon,
69
- SettingIcon,
70
- UserIcon,
71
- BagIcon,
72
- CategoryIcon,
73
- HomeIcon,
74
- TrashIcon,
75
- MoreIcon,
76
- MessageIcon,
77
- AddIcon,
78
- BoxTimeIcon,
79
- MoneyIcon,
80
- ArrowDownIcon,
81
- SpinnerIcon,
82
- OutlineTickCircleIcon
83
- };
package/src/index.css DELETED
@@ -1,36 +0,0 @@
1
- @tailwind base;
2
- @tailwind components;
3
- @tailwind utilities;
4
-
5
- * {
6
- font-family: "IranSansX";
7
- }
8
-
9
- .css-1erac46 {
10
- direction: rtl;
11
- }
12
-
13
- @font-face {
14
- font-family: "IranSansX";
15
- src: url("./stories/assets/fonts/woff/IRANSansXFaNum-Regular.woff") format("woff"),
16
- url("./stories/assets/fonts/woff/IRANSansXFaNum-Regular.woff2") format("woff2");
17
- font-weight: 400;
18
- }
19
- @font-face {
20
- font-family: "IranSansX";
21
- src: url("./stories/assets/fonts/woff/IRANSansXFaNum-Medium.woff") format("woff"),
22
- url("./stories/assets/fonts/woff2/IRANSansXFaNum-Medium.woff2") format("woff2");
23
- font-weight: 500;
24
- }
25
- @font-face {
26
- font-family: "IranSansX";
27
- src: url("./stories/assets/fonts/woff/IRANSansXFaNum-DemiBold.woff") format("woff"),
28
- url("./stories/assets/fonts/woff2/IRANSansXFaNum-DemiBold.woff2") format("woff2");
29
- font-weight: 600;
30
- }
31
- @font-face {
32
- font-family: "IranSansX";
33
- src: url("./stories/assets/fonts/woff/IRANSansXFaNum-Bold.woff") format("woff"),
34
- url("./stories/assets/fonts/woff2/IRANSansXFaNum-Bold.woff2") format("woff2");
35
- font-weight: 700;
36
- }
package/src/index.ts DELETED
@@ -1,2 +0,0 @@
1
- export { Button } from "./components/Button";
2
- export { Alert } from "./components/Alert";
package/src/main.tsx DELETED
@@ -1,10 +0,0 @@
1
- import { StrictMode } from 'react'
2
- import { createRoot } from 'react-dom/client'
3
- import './index.css'
4
- import App from './App.tsx'
5
-
6
- createRoot(document.getElementById('root')!).render(
7
- <StrictMode>
8
- <App />
9
- </StrictMode>,
10
- )
@@ -1,22 +0,0 @@
1
- import type { Meta, StoryObj } from "@storybook/react-vite";
2
- import { Alert } from "../components/Alert";
3
-
4
- const meta = {
5
- title: "Example/Alert",
6
- component: Alert,
7
- parameters: {
8
- layout: "centered",
9
- },
10
- tags: ["autodocs"],
11
- } satisfies Meta<typeof Alert>;
12
-
13
- export default meta;
14
- type Story = StoryObj<typeof meta>;
15
-
16
- export const Primary: Story = {
17
- args: {
18
- title: "ایمیل ارسال شد",
19
- description: "به زودی پاسخ دریافت خواهید کرد",
20
- buttonTitle: "دکمه",
21
- },
22
- };
@@ -1,20 +0,0 @@
1
- import type { Meta, StoryObj } from "@storybook/react-vite";
2
- import Badge from "../components/Badge";
3
-
4
- const meta = {
5
- title: "Example/Badge",
6
- component: Badge,
7
- parameters: {
8
- layout: "centered",
9
- },
10
- tags: ["autodocs"],
11
- } satisfies Meta<typeof Badge>;
12
-
13
- export default meta;
14
- type Story = StoryObj<typeof meta>;
15
-
16
- export const Primary: Story = {
17
- args: {
18
- label: "متن",
19
- },
20
- };
@@ -1,108 +0,0 @@
1
- import type { Meta, StoryObj } from "@storybook/react-vite";
2
- import { Button as ButtonComponent } from "../components/Button";
3
- import * as icons from "../icons";
4
-
5
- const Button = (args: any) => {
6
- const Icon = icons[args.icon];
7
- const IconComponent = Icon ? (
8
- <Icon color={args.iconColor} size={args.iconSize} />
9
- ) : (
10
- <></>
11
- );
12
-
13
- return (
14
- <div className="flex justify-center w-96">
15
- <ButtonComponent {...args} icon={IconComponent} />
16
- </div>
17
- );
18
- };
19
-
20
- const meta = {
21
- title: "Example/Button",
22
- component: Button,
23
- parameters: {
24
- layout: "centered",
25
- docs: {
26
- source: {
27
- transform: (_: any, context: any) => {
28
- const { args } = context;
29
- const entries = Object.entries(args);
30
-
31
- const props = entries
32
- .map(([key, value]) => {
33
- if (key === "icon" && value) {
34
- const color = args.iconColor;
35
- return `icon={<${value}${color ? ` color="${color}"` : ""} />}`;
36
- }
37
-
38
- if (key === "iconColor") return null;
39
-
40
- if (typeof value === "string" && value) {
41
- return `${key}="${value}"`;
42
- }
43
- })
44
- .filter(Boolean)
45
- .join("\n ");
46
-
47
- return `<Button\n ${props}\n/>`;
48
- },
49
- },
50
- },
51
- },
52
- tags: ["autodocs"],
53
- argTypes: {
54
- variant: {
55
- control: "select",
56
- options: ["solid", "bordered", "light", "flat", "faded", "shadow"],
57
- },
58
- color: {
59
- control: "select",
60
- options: [
61
- "default",
62
- "primary",
63
- "secondary",
64
- "success",
65
- "warning",
66
- "danger",
67
- ],
68
- },
69
- textColor: {
70
- control: "select",
71
- options: ["black", "white"],
72
- },
73
- size: {
74
- control: "select",
75
- options: ["sm", "md", "lg"],
76
- },
77
- width: {
78
- control: "select",
79
- options: ["full", "auto"],
80
- },
81
- rounded: {
82
- control: "select",
83
- options: ["none", "sm", "md", "lg", "full"],
84
- },
85
- iconPosition: {
86
- control: "select",
87
- options: ["right", "left"],
88
- },
89
- icon: {
90
- control: "text",
91
- },
92
- iconColor: {
93
- control: "color",
94
- },
95
- iconSize: {
96
- control: { type: "range", min: 8, max: 36, step: 1 },
97
- },
98
- },
99
- } satisfies Meta<typeof Button>;
100
-
101
- export default meta;
102
- type Story = StoryObj<typeof meta>;
103
-
104
- export const Primary: Story = {
105
- args: {
106
- label: "دکمه",
107
- },
108
- };
@@ -1,20 +0,0 @@
1
- import type { Meta, StoryObj } from "@storybook/react-vite";
2
- import Chip from "../components/Chip";
3
-
4
- const meta = {
5
- title: "Example/Chip",
6
- component: Chip,
7
- parameters: {
8
- layout: "centered",
9
- },
10
- tags: ["autodocs"],
11
- } satisfies Meta<typeof Chip>;
12
-
13
- export default meta;
14
- type Story = StoryObj<typeof meta>;
15
-
16
- export const Primary: Story = {
17
- args: {
18
- label: "متن",
19
- },
20
- };