dst-rg 1.0.0

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 (249) hide show
  1. package/.gitlab-ci.yml +43 -0
  2. package/.storybook/main.ts +15 -0
  3. package/.storybook/preview.ts +15 -0
  4. package/README.md +254 -0
  5. package/components.json +21 -0
  6. package/dist/Avatar.png +0 -0
  7. package/dist/assets/index-CCq7hmG3.js +186 -0
  8. package/dist/assets/index-Mg-hjQGu.css +1 -0
  9. package/dist/index.html +15 -0
  10. package/dist/test.png +0 -0
  11. package/dist/vite.svg +1 -0
  12. package/eslint.config.js +29 -0
  13. package/index.html +14 -0
  14. package/package.json +102 -0
  15. package/postcss.config.mjs +11 -0
  16. package/rollup.config.mjs +55 -0
  17. package/src/assets/react.svg +1 -0
  18. package/src/assets/style/animation.css +27 -0
  19. package/src/assets/style/box-shadow.css +25 -0
  20. package/src/assets/style/colors.css +402 -0
  21. package/src/assets/style/dark-theme.css +288 -0
  22. package/src/assets/style/font-size.css +14 -0
  23. package/src/assets/style/gradient.css +3 -0
  24. package/src/assets/style/index.css +12 -0
  25. package/src/assets/style/light-theme.css +148 -0
  26. package/src/assets/style/line-height.css +13 -0
  27. package/src/assets/style/max-width.css +5 -0
  28. package/src/assets/style/radius.css +13 -0
  29. package/src/assets/style/utility-colors.css +166 -0
  30. package/src/components/Accordion/_.stories.tsx +75 -0
  31. package/src/components/Accordion/_.test.tsx +77 -0
  32. package/src/components/Accordion/index.tsx +47 -0
  33. package/src/components/Accordion/type.ts +24 -0
  34. package/src/components/Avatar/_.stories.tsx +179 -0
  35. package/src/components/Avatar/_.style.ts +40 -0
  36. package/src/components/Avatar/_.test.tsx +150 -0
  37. package/src/components/Avatar/_.types.ts +66 -0
  38. package/src/components/Avatar/index.tsx +63 -0
  39. package/src/components/Badge/_.stories.tsx +75 -0
  40. package/src/components/Badge/_.style.ts +53 -0
  41. package/src/components/Badge/_.test.tsx +27 -0
  42. package/src/components/Badge/_.types.ts +11 -0
  43. package/src/components/Badge/index.tsx +42 -0
  44. package/src/components/Breadcrumbs/_.stories.tsx +95 -0
  45. package/src/components/Breadcrumbs/_.test.tsx +29 -0
  46. package/src/components/Breadcrumbs/_.type.ts +15 -0
  47. package/src/components/Breadcrumbs/index.tsx +103 -0
  48. package/src/components/Button/_.stories.tsx +85 -0
  49. package/src/components/Button/_.style.ts +56 -0
  50. package/src/components/Button/_.test.tsx +103 -0
  51. package/src/components/Button/_.types.ts +14 -0
  52. package/src/components/Button/index.tsx +70 -0
  53. package/src/components/Checkbox/_.stories.tsx +96 -0
  54. package/src/components/Checkbox/_.style.ts +24 -0
  55. package/src/components/Checkbox/_.test.tsx +85 -0
  56. package/src/components/Checkbox/_.types.ts +23 -0
  57. package/src/components/Checkbox/index.tsx +93 -0
  58. package/src/components/CheckboxGroup/PaymentCard/_.stories.tsx +104 -0
  59. package/src/components/CheckboxGroup/PaymentCard/_.style.ts +28 -0
  60. package/src/components/CheckboxGroup/PaymentCard/_.test.tsx +58 -0
  61. package/src/components/CheckboxGroup/PaymentCard/_.types.ts +28 -0
  62. package/src/components/CheckboxGroup/PaymentCard/index.tsx +71 -0
  63. package/src/components/CheckboxGroup/PlanCard/_.stories.tsx +165 -0
  64. package/src/components/CheckboxGroup/PlanCard/_.style.ts +32 -0
  65. package/src/components/CheckboxGroup/PlanCard/_.test.tsx +54 -0
  66. package/src/components/CheckboxGroup/PlanCard/_.types.ts +35 -0
  67. package/src/components/CheckboxGroup/PlanCard/index.tsx +53 -0
  68. package/src/components/CheckboxGroup/UserCard/_.stories.tsx +89 -0
  69. package/src/components/CheckboxGroup/UserCard/_.style.ts +42 -0
  70. package/src/components/CheckboxGroup/UserCard/_.test.tsx +66 -0
  71. package/src/components/CheckboxGroup/UserCard/_.types.ts +26 -0
  72. package/src/components/CheckboxGroup/UserCard/index.tsx +75 -0
  73. package/src/components/Dropdown/_.stories.tsx +180 -0
  74. package/src/components/Dropdown/_.style.ts +108 -0
  75. package/src/components/Dropdown/_.test.tsx +334 -0
  76. package/src/components/Dropdown/_.types.ts +12 -0
  77. package/src/components/Dropdown/index.tsx +130 -0
  78. package/src/components/FileUpload/_.stories.tsx +74 -0
  79. package/src/components/FileUpload/_.style.ts +0 -0
  80. package/src/components/FileUpload/_.test.tsx +222 -0
  81. package/src/components/FileUpload/_.types.ts +53 -0
  82. package/src/components/FileUpload/index.tsx +44 -0
  83. package/src/components/ImageMagnify/_.stories.tsx +226 -0
  84. package/src/components/ImageMagnify/_.style.ts +109 -0
  85. package/src/components/ImageMagnify/_.types.ts +44 -0
  86. package/src/components/ImageMagnify/index.tsx +204 -0
  87. package/src/components/Input/_.stories.tsx +177 -0
  88. package/src/components/Input/_.style.ts +79 -0
  89. package/src/components/Input/_.test.tsx +146 -0
  90. package/src/components/Input/_.types.ts +66 -0
  91. package/src/components/Input/index.tsx +231 -0
  92. package/src/components/InputTags/_.stories.tsx +51 -0
  93. package/src/components/InputTags/_.style.ts +28 -0
  94. package/src/components/InputTags/_.test.tsx +123 -0
  95. package/src/components/InputTags/_.types.ts +26 -0
  96. package/src/components/InputTags/index.tsx +140 -0
  97. package/src/components/Message/_.stories.tsx +79 -0
  98. package/src/components/Message/_.style.ts +87 -0
  99. package/src/components/Message/_.test.tsx +73 -0
  100. package/src/components/Message/_.types.ts +13 -0
  101. package/src/components/Message/index.tsx +57 -0
  102. package/src/components/Metric/_.stories.tsx +142 -0
  103. package/src/components/Metric/_.style.ts +14 -0
  104. package/src/components/Metric/_.test.tsx +166 -0
  105. package/src/components/Metric/_.types.ts +18 -0
  106. package/src/components/Metric/index.tsx +100 -0
  107. package/src/components/Modal/_.stories.tsx +93 -0
  108. package/src/components/Modal/_.style.ts +31 -0
  109. package/src/components/Modal/_.test.tsx +90 -0
  110. package/src/components/Modal/_.types.ts +14 -0
  111. package/src/components/Modal/index.tsx +82 -0
  112. package/src/components/Pagination/_.stories.tsx +118 -0
  113. package/src/components/Pagination/_.test.tsx +51 -0
  114. package/src/components/Pagination/index.tsx +256 -0
  115. package/src/components/Pagination/type.ts +48 -0
  116. package/src/components/PriceSlider/_.stories.tsx +107 -0
  117. package/src/components/PriceSlider/_.test.tsx +63 -0
  118. package/src/components/PriceSlider/_.type.tsx +19 -0
  119. package/src/components/PriceSlider/index.tsx +86 -0
  120. package/src/components/Progress/_.stories.tsx +93 -0
  121. package/src/components/Progress/_.style.ts +15 -0
  122. package/src/components/Progress/_.test.tsx +34 -0
  123. package/src/components/Progress/_.types.ts +17 -0
  124. package/src/components/Progress/index.tsx +173 -0
  125. package/src/components/Radio/_.stories.tsx +391 -0
  126. package/src/components/Radio/_.style.ts +33 -0
  127. package/src/components/Radio/_.test.tsx +77 -0
  128. package/src/components/Radio/_.types.ts +14 -0
  129. package/src/components/Radio/index.tsx +59 -0
  130. package/src/components/Select/_.stories.tsx +308 -0
  131. package/src/components/Select/_.style.ts +5 -0
  132. package/src/components/Select/_.types.ts +24 -0
  133. package/src/components/Select/index.tsx +172 -0
  134. package/src/components/Switch/_.stories.tsx +61 -0
  135. package/src/components/Switch/_.test.tsx +69 -0
  136. package/src/components/Switch/_.type.ts +12 -0
  137. package/src/components/Switch/index.tsx +70 -0
  138. package/src/components/Tabs/_.stories.tsx +508 -0
  139. package/src/components/Tabs/_.style.ts +63 -0
  140. package/src/components/Tabs/_.test.tsx +174 -0
  141. package/src/components/Tabs/_.type.ts +19 -0
  142. package/src/components/Tabs/index.tsx +35 -0
  143. package/src/components/Tag/_.stories.tsx +78 -0
  144. package/src/components/Tag/_.style.ts +71 -0
  145. package/src/components/Tag/_.test.tsx +44 -0
  146. package/src/components/Tag/_.types.ts +27 -0
  147. package/src/components/Tag/index.tsx +46 -0
  148. package/src/components/TextArea/_.stories.tsx +62 -0
  149. package/src/components/TextArea/_.style.ts +11 -0
  150. package/src/components/TextArea/_.test.tsx +43 -0
  151. package/src/components/TextArea/_.types.ts +29 -0
  152. package/src/components/TextArea/index.tsx +83 -0
  153. package/src/components/Toast/_.style.tsx +27 -0
  154. package/src/components/Toast/_.type.ts +30 -0
  155. package/src/components/Toast/_.utils.ts +23 -0
  156. package/src/components/Toast/container.tsx +171 -0
  157. package/src/components/Toast/index.tsx +29 -0
  158. package/src/components/Tooltip/_.stories.tsx +106 -0
  159. package/src/components/Tooltip/_.style.ts +27 -0
  160. package/src/components/Tooltip/_.test.tsx +54 -0
  161. package/src/components/Tooltip/_.types.ts +31 -0
  162. package/src/components/Tooltip/index.tsx +80 -0
  163. package/src/components/developers/AmirHossein.tsx +149 -0
  164. package/src/components/developers/Fardin.tsx +130 -0
  165. package/src/components/developers/Maryam.tsx +260 -0
  166. package/src/components/developers/Milad.tsx +431 -0
  167. package/src/components/developers/Rasoul.tsx +198 -0
  168. package/src/components/index.ts +28 -0
  169. package/src/components/ui/accordion.tsx +162 -0
  170. package/src/components/ui/avatars-component/avatar-description.tsx +30 -0
  171. package/src/components/ui/avatars-component/avatar-groups.tsx +68 -0
  172. package/src/components/ui/avatars-component/avatar-single.tsx +50 -0
  173. package/src/components/ui/card.tsx +92 -0
  174. package/src/components/ui/checkbox-group/plan-card/basic/_.test.tsx +66 -0
  175. package/src/components/ui/checkbox-group/plan-card/basic/index.tsx +70 -0
  176. package/src/components/ui/checkbox-group/plan-card/with-header/_.test.tsx +110 -0
  177. package/src/components/ui/checkbox-group/plan-card/with-header/header.test.tsx +96 -0
  178. package/src/components/ui/checkbox-group/plan-card/with-header/header.tsx +74 -0
  179. package/src/components/ui/checkbox-group/plan-card/with-header/index.tsx +65 -0
  180. package/src/components/ui/file-content/File-content.tsx +43 -0
  181. package/src/components/ui/file-uploader-components/file-uploader-box.tsx +76 -0
  182. package/src/components/ui/file-uploader-components/file-uploader-item.tsx +64 -0
  183. package/src/components/ui/icon-wrapper/_.test.tsx +60 -0
  184. package/src/components/ui/icon-wrapper/index.tsx +19 -0
  185. package/src/components/ui/input-component/input-label.tsx +11 -0
  186. package/src/components/ui/number.tsx +18 -0
  187. package/src/components/ui/pagination/card-minimal-center-align.tsx +96 -0
  188. package/src/components/ui/pagination/card-minimal-right-aligne.tsx +90 -0
  189. package/src/components/ui/pagination/default-pagination.tsx +128 -0
  190. package/src/components/ui/pagination/get-pagination-item.tsx +36 -0
  191. package/src/components/ui/pagination/pagination-card-button-group-aligned.tsx +94 -0
  192. package/src/components/ui/pagination/pagination-card-minimal-left-aligned.tsx +90 -0
  193. package/src/components/ui/pagination/pagination-content.tsx +15 -0
  194. package/src/components/ui/pagination/pagination-item.tsx +11 -0
  195. package/src/components/ui/pagination/pagination-link.tsx +42 -0
  196. package/src/components/ui/tab-components/tabs-content.tsx +15 -0
  197. package/src/components/ui/tab-components/tabs-list.tsx +27 -0
  198. package/src/components/ui/tab-components/tabs-trigger.tsx +25 -0
  199. package/src/components/ui/text-content-wrapper.tsx +36 -0
  200. package/src/hooks/useClickOutside.ts +23 -0
  201. package/src/icons/general/ArrowLeft.tsx +31 -0
  202. package/src/icons/general/ArrowRight.tsx +31 -0
  203. package/src/icons/general/activity-heart.tsx +31 -0
  204. package/src/icons/general/activity.tsx +31 -0
  205. package/src/icons/general/anchor.tsx +31 -0
  206. package/src/icons/general/archive.tsx +31 -0
  207. package/src/icons/general/arrow-left.tsx +25 -0
  208. package/src/icons/general/arrow-right.tsx +25 -0
  209. package/src/icons/general/asterisk-01.tsx +31 -0
  210. package/src/icons/general/asterisk-02.tsx +31 -0
  211. package/src/icons/general/at-sign.tsx +31 -0
  212. package/src/icons/general/attention-mark.tsx +43 -0
  213. package/src/icons/general/bookmark-add.tsx +31 -0
  214. package/src/icons/general/bookmark.tsx +31 -0
  215. package/src/icons/general/chevron-left.tsx +25 -0
  216. package/src/icons/general/chevron-right.tsx +25 -0
  217. package/src/icons/general/circle-minues.tsx +25 -0
  218. package/src/icons/general/circle-plus.tsx +25 -0
  219. package/src/icons/general/circle-question-mark.tsx +32 -0
  220. package/src/icons/general/circle.tsx +32 -0
  221. package/src/icons/general/copy.tsx +43 -0
  222. package/src/icons/general/email.tsx +32 -0
  223. package/src/icons/general/home.tsx +25 -0
  224. package/src/icons/general/layer.tsx +36 -0
  225. package/src/icons/general/leading.tsx +19 -0
  226. package/src/icons/general/master-card.tsx +37 -0
  227. package/src/icons/general/minus.tsx +36 -0
  228. package/src/icons/general/plus.tsx +19 -0
  229. package/src/icons/general/remove.tsx +32 -0
  230. package/src/icons/general/slash-divider.tsx +26 -0
  231. package/src/icons/general/tick-box.tsx +37 -0
  232. package/src/icons/general/trailing.tsx +19 -0
  233. package/src/icons/general/unkown-format.tsx +25 -0
  234. package/src/icons/general/visa-card.tsx +38 -0
  235. package/src/icons/general/x-close.tsx +35 -0
  236. package/src/icons/icons.type.ts +7 -0
  237. package/src/index.css +21 -0
  238. package/src/index.ts +3 -0
  239. package/src/lib/utils.ts +6 -0
  240. package/src/lib/zIndexUtils.ts +2 -0
  241. package/src/main.tsx +50 -0
  242. package/src/vite-env.d.ts +1 -0
  243. package/tests/setup.ts +8 -0
  244. package/tsconfig.app.json +31 -0
  245. package/tsconfig.json +7 -0
  246. package/tsconfig.node.json +24 -0
  247. package/tsconfig.rollup.json +12 -0
  248. package/vite.config.ts +20 -0
  249. package/vitest.config.ts +47 -0
@@ -0,0 +1,70 @@
1
+ import { cn } from "@/lib/utils";
2
+ import * as SwitchPrimitives from "@radix-ui/react-switch";
3
+ import * as React from "react";
4
+ import TextContentWrapper from "../ui/text-content-wrapper";
5
+ import { SwitchProps } from "./_.type";
6
+
7
+ const Switch = React.forwardRef<
8
+ React.ComponentRef<typeof SwitchPrimitives.Root>,
9
+ SwitchProps
10
+ >(
11
+ (
12
+ {
13
+ className,
14
+ thumbClassName,
15
+ label,
16
+ labelClassName,
17
+ descriptionClassName,
18
+ description,
19
+ onToggle,
20
+ ...props
21
+ },
22
+ ref
23
+ ) => {
24
+ const [checked, setChecked] = React.useState(false);
25
+ const handleToggle = () => {
26
+ setChecked((prev) => !prev);
27
+ onToggle();
28
+ };
29
+
30
+ return (
31
+ <div
32
+ className={cn(
33
+ "flex gap-1",
34
+ description ? "items-start" : "items-center"
35
+ )}
36
+ >
37
+ <SwitchPrimitives.Root
38
+ ref={ref}
39
+ className={cn(
40
+ "peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-start rounded-full border-2 border-transparent transition-colors focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-brand-600 data-[state=unchecked]:bg-gray-light-100",
41
+ className,
42
+ description ? "mt-0.5" : "mt-0"
43
+ )}
44
+ onCheckedChange={handleToggle}
45
+ checked={checked}
46
+ {...props}
47
+ >
48
+ <SwitchPrimitives.Thumb
49
+ className={cn(
50
+ "pointer-events-none block h-5 w-5 rounded-full bg-white shadow-lg ring-0 transition-transform data-[state=checked]:-translate-x-5 data-[state=checked]:ltr:translate-x-5 data-[state=unchecked]:-translate-x-0",
51
+ thumbClassName
52
+ )}
53
+ />
54
+ </SwitchPrimitives.Root>
55
+
56
+ <TextContentWrapper
57
+ label={label}
58
+ labelClassName={labelClassName}
59
+ handleClick={handleToggle}
60
+ description={description}
61
+ descriptionClassName={descriptionClassName}
62
+ />
63
+ </div>
64
+ );
65
+ }
66
+ );
67
+
68
+ Switch.displayName = "Switch";
69
+
70
+ export { Switch };
@@ -0,0 +1,508 @@
1
+ import { Meta, StoryObj } from "@storybook/react-vite";
2
+ import { TabsListProps, TabsProps, TabsTriggerProps } from "./_.type";
3
+ import { Tabs } from ".";
4
+
5
+ const meta: Meta<typeof Tabs> = {
6
+ title: "Components/Tabs",
7
+ component: Tabs,
8
+ tags: ["autodocs"],
9
+ parameters: {
10
+ docs: {
11
+ description: {
12
+ component:
13
+ "Custom Tabs component built using Radix UI and styled via CVA. Supports direction, RTL, list and trigger variants, and fullWidth layout.",
14
+ },
15
+ },
16
+ },
17
+ // ✅ Only include Tabs-specific props here
18
+ argTypes: {
19
+ direction: {
20
+ control: "inline-radio",
21
+ options: ["horizontal", "vertical"],
22
+ description:
23
+ "Layout direction of the Tabs (applies to root Tabs component)",
24
+ },
25
+ dir: {
26
+ control: "inline-radio",
27
+ options: ["ltr", "rtl"],
28
+ description: "Text direction for Tabs",
29
+ },
30
+ },
31
+ };
32
+ export default meta;
33
+
34
+ // ✅ Shared content
35
+ const Content = (
36
+ <>
37
+ <Tabs.Content value="tab1">
38
+ <div className="p-4 border rounded bg-white text-black">
39
+ Content for Tab 1
40
+ </div>
41
+ </Tabs.Content>
42
+ <Tabs.Content value="tab2">
43
+ <div className="p-4 border rounded bg-white text-black">
44
+ Content for Tab 2
45
+ </div>
46
+ </Tabs.Content>
47
+ </>
48
+ );
49
+
50
+ export const Default: StoryObj<TabsProps> = {
51
+ args: {
52
+ defaultValue: "tab1",
53
+ direction: "horizontal",
54
+ dir: "rtl",
55
+ },
56
+ render: (args) => (
57
+ <Tabs {...args}>
58
+ <Tabs.List>
59
+ <Tabs.Trigger value="tab1">Tab One</Tabs.Trigger>
60
+ <Tabs.Trigger value="tab2">Tab Two</Tabs.Trigger>
61
+ </Tabs.List>
62
+ {Content}
63
+ </Tabs>
64
+ ),
65
+ };
66
+
67
+ // ✅ Story with Tabs.List variant controls
68
+ export const WithListVariants: StoryObj<
69
+ TabsProps & {
70
+ listVariant: TabsListProps["listVariant"];
71
+ fullWidth: boolean;
72
+ } & { triggerVariant: TabsTriggerProps["triggerVariant"]; fullWidth: boolean }
73
+ > = {
74
+ args: {
75
+ defaultValue: "tab1",
76
+ direction: "horizontal",
77
+ dir: "rtl",
78
+ listVariant: "bordered",
79
+ fullWidth: true,
80
+ },
81
+ argTypes: {
82
+ listVariant: {
83
+ control: "select",
84
+ options: ["brand", "gray", "outlined", "bordered", "minimal"],
85
+ description: "Visual style for the Tabs list",
86
+ },
87
+ triggerVariant: {
88
+ control: "select",
89
+ options: ["brand", "gray", "outlined", "bordered", "minimal"],
90
+ description: "Visual style for the Tabs list",
91
+ },
92
+ fullWidth: {
93
+ control: "boolean",
94
+ description: "Stretch list items to fill container",
95
+ },
96
+ },
97
+ render: ({
98
+ defaultValue,
99
+ direction,
100
+ dir,
101
+ listVariant,
102
+ fullWidth,
103
+ triggerVariant,
104
+ }) => (
105
+ <Tabs defaultValue={defaultValue} direction={direction} dir={dir}>
106
+ <Tabs.List
107
+ listVariant={listVariant}
108
+ direction={direction}
109
+ fullWidth={fullWidth}
110
+ >
111
+ <Tabs.Trigger
112
+ triggerVariant={triggerVariant}
113
+ fullWidth={fullWidth}
114
+ value="tab1"
115
+ >
116
+ Tab One
117
+ </Tabs.Trigger>
118
+ <Tabs.Trigger
119
+ triggerVariant={triggerVariant}
120
+ fullWidth={fullWidth}
121
+ value="tab2"
122
+ >
123
+ Tab Two
124
+ </Tabs.Trigger>
125
+ </Tabs.List>
126
+ {Content}
127
+ </Tabs>
128
+ ),
129
+ };
130
+ export const WithListVariantsVertical: StoryObj<
131
+ TabsProps & {
132
+ listVariant: TabsListProps["listVariant"];
133
+ fullWidth: boolean;
134
+ } & { triggerVariant: TabsTriggerProps["triggerVariant"]; fullWidth: boolean }
135
+ > = {
136
+ args: {
137
+ defaultValue: "tab1",
138
+ direction: "vertical",
139
+ dir: "rtl",
140
+ listVariant: "bordered",
141
+ triggerVariant: "bordered",
142
+ fullWidth: true,
143
+ },
144
+ argTypes: {
145
+ listVariant: {
146
+ control: "select",
147
+ options: ["brand", "gray", "outlined", "bordered", "minimal"],
148
+ description: "Visual style for the Tabs list",
149
+ },
150
+ triggerVariant: {
151
+ control: "select",
152
+ options: ["brand", "gray", "outlined", "bordered", "minimal"],
153
+ description: "Visual style for the Tabs list",
154
+ },
155
+ fullWidth: {
156
+ control: "boolean",
157
+ description: "Stretch list items to fill container",
158
+ },
159
+ },
160
+ render: ({
161
+ defaultValue,
162
+ direction,
163
+ dir,
164
+ listVariant,
165
+ fullWidth,
166
+ triggerVariant,
167
+ }) => (
168
+ <Tabs defaultValue={defaultValue} direction={direction} dir={dir}>
169
+ <Tabs.List
170
+ listVariant={listVariant}
171
+ direction={direction}
172
+ fullWidth={fullWidth}
173
+ >
174
+ <Tabs.Trigger
175
+ triggerVariant={triggerVariant}
176
+ fullWidth={fullWidth}
177
+ value="tab1"
178
+ >
179
+ Tab One
180
+ </Tabs.Trigger>
181
+ <Tabs.Trigger
182
+ triggerVariant={triggerVariant}
183
+ fullWidth={fullWidth}
184
+ value="tab2"
185
+ >
186
+ Tab Two
187
+ </Tabs.Trigger>
188
+ </Tabs.List>
189
+ {Content}
190
+ </Tabs>
191
+ ),
192
+ };
193
+
194
+ export const WithListVariantsminimal: StoryObj<
195
+ TabsProps & {
196
+ listVariant: TabsListProps["listVariant"];
197
+ fullWidth: boolean;
198
+ } & { triggerVariant: TabsTriggerProps["triggerVariant"]; fullWidth: boolean }
199
+ > = {
200
+ args: {
201
+ defaultValue: "tab1",
202
+ direction: "horizontal",
203
+ dir: "rtl",
204
+ listVariant: "minimal",
205
+ triggerVariant: "minimal",
206
+ fullWidth: true,
207
+ },
208
+ argTypes: {
209
+ listVariant: {
210
+ control: "select",
211
+ options: ["brand", "gray", "outlined", "bordered", "minimal"],
212
+ description: "Visual style for the Tabs list",
213
+ },
214
+ triggerVariant: {
215
+ control: "select",
216
+ options: ["brand", "gray", "outlined", "bordered", "minimal"],
217
+ description: "Visual style for the Tabs list",
218
+ },
219
+ fullWidth: {
220
+ control: "boolean",
221
+ description: "Stretch list items to fill container",
222
+ },
223
+ },
224
+ render: ({
225
+ defaultValue,
226
+ direction,
227
+ dir,
228
+ listVariant,
229
+ fullWidth,
230
+ triggerVariant,
231
+ }) => (
232
+ <Tabs defaultValue={defaultValue} direction={direction} dir={dir}>
233
+ <Tabs.List
234
+ listVariant={listVariant}
235
+ direction={direction}
236
+ fullWidth={fullWidth}
237
+ >
238
+ <Tabs.Trigger
239
+ triggerVariant={triggerVariant}
240
+ fullWidth={fullWidth}
241
+ value="tab1"
242
+ >
243
+ Tab One
244
+ </Tabs.Trigger>
245
+ <Tabs.Trigger
246
+ triggerVariant={triggerVariant}
247
+ fullWidth={fullWidth}
248
+ value="tab2"
249
+ >
250
+ Tab Two
251
+ </Tabs.Trigger>
252
+ </Tabs.List>
253
+ {Content}
254
+ </Tabs>
255
+ ),
256
+ };
257
+ export const WithListVariantsOutlined: StoryObj<
258
+ TabsProps & {
259
+ listVariant: TabsListProps["listVariant"];
260
+ fullWidth: boolean;
261
+ } & { triggerVariant: TabsTriggerProps["triggerVariant"]; fullWidth: boolean }
262
+ > = {
263
+ args: {
264
+ defaultValue: "tab1",
265
+ direction: "horizontal",
266
+ dir: "rtl",
267
+ listVariant: "outlined",
268
+ triggerVariant: "outlined",
269
+ fullWidth: true,
270
+ },
271
+ argTypes: {
272
+ listVariant: {
273
+ control: "select",
274
+ options: ["brand", "gray", "outlined", "bordered", "minimal"],
275
+ description: "Visual style for the Tabs list",
276
+ },
277
+ triggerVariant: {
278
+ control: "select",
279
+ options: ["brand", "gray", "outlined", "bordered", "minimal"],
280
+ description: "Visual style for the Tabs list",
281
+ },
282
+ fullWidth: {
283
+ control: "boolean",
284
+ description: "Stretch list items to fill container",
285
+ },
286
+ },
287
+ render: ({
288
+ defaultValue,
289
+ direction,
290
+ dir,
291
+ listVariant,
292
+ fullWidth,
293
+ triggerVariant,
294
+ }) => (
295
+ <Tabs defaultValue={defaultValue} direction={direction} dir={dir}>
296
+ <Tabs.List
297
+ listVariant={listVariant}
298
+ direction={direction}
299
+ fullWidth={fullWidth}
300
+ >
301
+ <Tabs.Trigger
302
+ triggerVariant={triggerVariant}
303
+ fullWidth={fullWidth}
304
+ value="tab1"
305
+ >
306
+ Tab One
307
+ </Tabs.Trigger>
308
+ <Tabs.Trigger
309
+ triggerVariant={triggerVariant}
310
+ fullWidth={fullWidth}
311
+ value="tab2"
312
+ >
313
+ Tab Two
314
+ </Tabs.Trigger>
315
+ </Tabs.List>
316
+ {Content}
317
+ </Tabs>
318
+ ),
319
+ };
320
+ export const WithListVariantsBordered: StoryObj<
321
+ TabsProps & {
322
+ listVariant: TabsListProps["listVariant"];
323
+ fullWidth: boolean;
324
+ } & { triggerVariant: TabsTriggerProps["triggerVariant"]; fullWidth: boolean }
325
+ > = {
326
+ args: {
327
+ defaultValue: "tab1",
328
+ direction: "horizontal",
329
+ dir: "rtl",
330
+ listVariant: "bordered",
331
+ triggerVariant: "bordered",
332
+ fullWidth: true,
333
+ },
334
+ argTypes: {
335
+ listVariant: {
336
+ control: "select",
337
+ options: ["brand", "gray", "outlined", "bordered", "minimal"],
338
+ description: "Visual style for the Tabs list",
339
+ },
340
+ triggerVariant: {
341
+ control: "select",
342
+ options: ["brand", "gray", "outlined", "bordered", "minimal"],
343
+ description: "Visual style for the Tabs list",
344
+ },
345
+ fullWidth: {
346
+ control: "boolean",
347
+ description: "Stretch list items to fill container",
348
+ },
349
+ },
350
+ render: ({
351
+ defaultValue,
352
+ direction,
353
+ dir,
354
+ listVariant,
355
+ fullWidth,
356
+ triggerVariant,
357
+ }) => (
358
+ <Tabs defaultValue={defaultValue} direction={direction} dir={dir}>
359
+ <Tabs.List
360
+ listVariant={listVariant}
361
+ direction={direction}
362
+ fullWidth={fullWidth}
363
+ >
364
+ <Tabs.Trigger
365
+ triggerVariant={triggerVariant}
366
+ fullWidth={fullWidth}
367
+ value="tab1"
368
+ >
369
+ Tab One
370
+ </Tabs.Trigger>
371
+ <Tabs.Trigger
372
+ triggerVariant={triggerVariant}
373
+ fullWidth={fullWidth}
374
+ value="tab2"
375
+ >
376
+ Tab Two
377
+ </Tabs.Trigger>
378
+ </Tabs.List>
379
+ {Content}
380
+ </Tabs>
381
+ ),
382
+ };
383
+ export const WithListVariantsBrand: StoryObj<
384
+ TabsProps & {
385
+ listVariant: TabsListProps["listVariant"];
386
+ fullWidth: boolean;
387
+ } & { triggerVariant: TabsTriggerProps["triggerVariant"]; fullWidth: boolean }
388
+ > = {
389
+ args: {
390
+ defaultValue: "tab1",
391
+ direction: "horizontal",
392
+ dir: "rtl",
393
+ listVariant: "brand",
394
+ triggerVariant: "brand",
395
+ fullWidth: true,
396
+ },
397
+ argTypes: {
398
+ listVariant: {
399
+ control: "select",
400
+ options: ["brand", "gray", "outlined", "bordered", "minimal"],
401
+ description: "Visual style for the Tabs list",
402
+ },
403
+ triggerVariant: {
404
+ control: "select",
405
+ options: ["brand", "gray", "outlined", "bordered", "minimal"],
406
+ description: "Visual style for the Tabs list",
407
+ },
408
+ fullWidth: {
409
+ control: "boolean",
410
+ description: "Stretch list items to fill container",
411
+ },
412
+ },
413
+ render: ({
414
+ defaultValue,
415
+ direction,
416
+ dir,
417
+ listVariant,
418
+ fullWidth,
419
+ triggerVariant,
420
+ }) => (
421
+ <Tabs defaultValue={defaultValue} direction={direction} dir={dir}>
422
+ <Tabs.List
423
+ listVariant={listVariant}
424
+ direction={direction}
425
+ fullWidth={fullWidth}
426
+ >
427
+ <Tabs.Trigger
428
+ triggerVariant={triggerVariant}
429
+ fullWidth={fullWidth}
430
+ value="tab1"
431
+ >
432
+ Tab One
433
+ </Tabs.Trigger>
434
+ <Tabs.Trigger
435
+ triggerVariant={triggerVariant}
436
+ fullWidth={fullWidth}
437
+ value="tab2"
438
+ >
439
+ Tab Two
440
+ </Tabs.Trigger>
441
+ </Tabs.List>
442
+ {Content}
443
+ </Tabs>
444
+ ),
445
+ };
446
+ export const WithListVariantsGray: StoryObj<
447
+ TabsProps & {
448
+ listVariant: TabsListProps["listVariant"];
449
+ fullWidth: boolean;
450
+ } & { triggerVariant: TabsTriggerProps["triggerVariant"]; fullWidth: boolean }
451
+ > = {
452
+ args: {
453
+ defaultValue: "tab1",
454
+ direction: "horizontal",
455
+ dir: "rtl",
456
+ listVariant: "gray",
457
+ triggerVariant: "gray",
458
+ fullWidth: true,
459
+ },
460
+ argTypes: {
461
+ listVariant: {
462
+ control: "select",
463
+ options: ["brand", "gray", "outlined", "bordered", "minimal"],
464
+ description: "Visual style for the Tabs list",
465
+ },
466
+ triggerVariant: {
467
+ control: "select",
468
+ options: ["brand", "gray", "outlined", "bordered", "minimal"],
469
+ description: "Visual style for the Tabs list",
470
+ },
471
+ fullWidth: {
472
+ control: "boolean",
473
+ description: "Stretch list items to fill container",
474
+ },
475
+ },
476
+ render: ({
477
+ defaultValue,
478
+ direction,
479
+ dir,
480
+ listVariant,
481
+ fullWidth,
482
+ triggerVariant,
483
+ }) => (
484
+ <Tabs defaultValue={defaultValue} direction={direction} dir={dir}>
485
+ <Tabs.List
486
+ listVariant={listVariant}
487
+ direction={direction}
488
+ fullWidth={fullWidth}
489
+ >
490
+ <Tabs.Trigger
491
+ triggerVariant={triggerVariant}
492
+ fullWidth={fullWidth}
493
+ value="tab1"
494
+ >
495
+ Tab One
496
+ </Tabs.Trigger>
497
+ <Tabs.Trigger
498
+ triggerVariant={triggerVariant}
499
+ fullWidth={fullWidth}
500
+ value="tab2"
501
+ >
502
+ Tab Two
503
+ </Tabs.Trigger>
504
+ </Tabs.List>
505
+ {Content}
506
+ </Tabs>
507
+ ),
508
+ };
@@ -0,0 +1,63 @@
1
+ import { cva } from "class-variance-authority";
2
+
3
+ const basetabListStyles =
4
+ " text-muted-foreground inline-flex flex-row h-9 items-center";
5
+
6
+ const listVariantStyle = {
7
+ brand: "",
8
+ gray: "",
9
+ outlined: "border-b border-rborder-secondary gap-2",
10
+ bordered:
11
+ "rounded-lg border border-rborder-secondary bg-rbg-secondary-alt p-1",
12
+ minimal:
13
+ " rounded-md border border-rborder-secondary bg-rbg-secondary-alt !gap-0.5",
14
+ };
15
+
16
+ export const tabListVariants = cva(basetabListStyles, {
17
+ variants: {
18
+ listVariant: listVariantStyle,
19
+ fullWidth: {
20
+ true: "justify-between",
21
+ false: "justify-start gap-1",
22
+ },
23
+ direction: {
24
+ vertical: "flex-col min-h-fit max-w-fit ",
25
+ horizontal: "flex-row w-full",
26
+ },
27
+ },
28
+ defaultVariants: {
29
+ listVariant: "brand",
30
+ fullWidth: true,
31
+ direction: "horizontal",
32
+ },
33
+ });
34
+
35
+ const basetabTriggerStyles =
36
+ " h-full py-2 px-3 cursor-pointer inline-flex items-center justify-center gap-2 text-sm font-normal whitespace-nowrap transition-[color,box-shadow] disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4";
37
+
38
+ const TriggerVariantStyle = {
39
+ brand:
40
+ "text-rtext-quaternary-500 data-[state=active]:rounded-sm data-[state=active]:bg-rbg-brand-primary-alt data-[state=active]:text-rtext-brand-secondary-700 ",
41
+ gray: "text-rtext-quaternary-500 data-[state=active]:rounded-sm data-[state=active]:bg-rbg-active data-[state=active]:text-rtext-secondary-700 ",
42
+ outlined:
43
+ "text-rtext-quaternary-500 data-[state=active]:text-rtext-brand-secondary-700 pb-2.5 data-[state=active]:pb-2 data-[state=active]:border-b-2 data-[state=active]:border-rgf-brand-primary-alt",
44
+ bordered:
45
+ "text-rtext-quaternary-500 data-[state=active]:rounded-sm data-[state=active]:text-rtext-secondary-700 data-[state=active]:bg-rbg-primary-alt data-[state=active]:shadow-sm",
46
+
47
+ minimal:
48
+ "text-rtext-quaternary-500 data-[state=active]:rounded-md data-[state=active]:text-rtext-secondary-700 data-[state=active]:bg-rbg-primary-alt data-[state=active]:border data-[state=active]:border-rborder-primary data-[state=active]:shadow-xs",
49
+ };
50
+
51
+ export const tabTriggerVariants = cva(basetabTriggerStyles, {
52
+ variants: {
53
+ triggerVariant: TriggerVariantStyle,
54
+ fullWidth: {
55
+ true: "w-full",
56
+ false: "w-fit justify-start gap-1 items-center",
57
+ },
58
+ },
59
+ defaultVariants: {
60
+ triggerVariant: "gray",
61
+ fullWidth: true,
62
+ },
63
+ });