@weing-dev/ui-kit-primitive 0.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 (328) hide show
  1. package/README.md +50 -0
  2. package/eslint.config.js +29 -0
  3. package/index.html +13 -0
  4. package/package.json +75 -0
  5. package/public/static/icon/Add.svg +1 -0
  6. package/public/static/icon/ApprovalInactive.svg +1 -0
  7. package/public/static/icon/ArrowRight.svg +5 -0
  8. package/public/static/icon/Cancle Filled.svg +1 -0
  9. package/public/static/icon/Cancle.svg +1 -0
  10. package/public/static/icon/Cart Filled.svg +1 -0
  11. package/public/static/icon/Cart.svg +1 -0
  12. package/public/static/icon/Check.svg +1 -0
  13. package/public/static/icon/CheckBoxRound.svg +3 -0
  14. package/public/static/icon/Company.svg +1 -0
  15. package/public/static/icon/DragHandle.svg +1 -0
  16. package/public/static/icon/Eco.svg +1 -0
  17. package/public/static/icon/EditSquare.svg +1 -0
  18. package/public/static/icon/Error Filled.svg +1 -0
  19. package/public/static/icon/Error.svg +1 -0
  20. package/public/static/icon/File Upload.svg +1 -0
  21. package/public/static/icon/FilecheckInactive.svg +1 -0
  22. package/public/static/icon/Go Before.svg +1 -0
  23. package/public/static/icon/Go Next.svg +1 -0
  24. package/public/static/icon/Hamburger Menu.svg +1 -0
  25. package/public/static/icon/ImagecheckPlay.svg +4 -0
  26. package/public/static/icon/Kakao Talk.svg +1 -0
  27. package/public/static/icon/Minus.svg +1 -0
  28. package/public/static/icon/Naver Blog.svg +1 -0
  29. package/public/static/icon/Naver.svg +1 -0
  30. package/public/static/icon/OrderApprove.svg +1 -0
  31. package/public/static/icon/OrderInactive.svg +1 -0
  32. package/public/static/icon/OrderPlay.svg +1 -0
  33. package/public/static/icon/PayApprove.svg +1 -0
  34. package/public/static/icon/PayInactive.svg +1 -0
  35. package/public/static/icon/PrintInactive.svg +1 -0
  36. package/public/static/icon/PrintPlay.svg +1 -0
  37. package/public/static/icon/Search.svg +1 -0
  38. package/public/static/icon/ShippingDone.svg +1 -0
  39. package/public/static/icon/Support Agent.svg +1 -0
  40. package/public/static/icon/Task.svg +1 -0
  41. package/public/static/icon/User.svg +1 -0
  42. package/public/static/icon/Warning Filled.svg +1 -0
  43. package/public/static/icon/Warning.svg +1 -0
  44. package/public/static/icon/add_a_photo.svg +3 -0
  45. package/public/static/icon/attach_file.svg +1 -0
  46. package/public/static/icon/check_circle.svg +1 -0
  47. package/public/static/icon/close.svg +1 -0
  48. package/public/static/icon/download.svg +1 -0
  49. package/public/static/icon/expand all.svg +1 -0
  50. package/public/static/icon/expand_less.svg +1 -0
  51. package/public/static/icon/expand_more.svg +1 -0
  52. package/public/static/icon/factory.svg +1 -0
  53. package/public/static/icon/inventory.svg +1 -0
  54. package/public/static/icon/listAll.svg +1 -0
  55. package/public/static/icon/local_shipping.svg +1 -0
  56. package/public/static/icon/logout.svg +1 -0
  57. package/public/static/icon/menu.svg +1 -0
  58. package/public/static/icon/mode_edit.svg +4 -0
  59. package/public/static/icon/more.svg +1 -0
  60. package/public/static/icon/outward.svg +1 -0
  61. package/public/static/icon/personcard.svg +1 -0
  62. package/public/static/icon/product.svg +1 -0
  63. package/public/static/icon/settings.svg +1 -0
  64. package/public/static/icon/swap_vert.svg +3 -0
  65. package/public/static/icon/upload.svg +1 -0
  66. package/public/static/icon/warning_amber.svg +3 -0
  67. package/public/static/image/Thumbnail.png +0 -0
  68. package/public/vite.svg +1 -0
  69. package/public/weing_logo_final.png +0 -0
  70. package/scripts/icons/setIcon.cjs +151 -0
  71. package/scripts/icons/svg-template.cjs +18 -0
  72. package/scripts/icons/svgo-config.json +9 -0
  73. package/scripts/icons/svgr-config.json +16 -0
  74. package/src/@types/color.d.ts +51 -0
  75. package/src/@types/common.d.ts +6 -0
  76. package/src/@types/extends/react.extends.d.ts +7 -0
  77. package/src/@types/quill-image-resize-module-react/index.d.ts +1 -0
  78. package/src/App.css +0 -0
  79. package/src/App.tsx +84 -0
  80. package/src/assets/react.svg +1 -0
  81. package/src/components/Accordion/Accordion.context.tsx +62 -0
  82. package/src/components/Accordion/Accordion.module.scss +163 -0
  83. package/src/components/Accordion/Accordion.tsx +242 -0
  84. package/src/components/Accordion/README.md +408 -0
  85. package/src/components/Accordion/images/as_trigger.gif +0 -0
  86. package/src/components/Accordion/images/closed.png +0 -0
  87. package/src/components/Accordion/images/open.png +0 -0
  88. package/src/components/Accordion/images/thumbnail1.png +0 -0
  89. package/src/components/Accordion/images/thumbnail2.png +0 -0
  90. package/src/components/Accordion/images/thumbnail3.png +0 -0
  91. package/src/components/Avatar/Avatar.module.scss +47 -0
  92. package/src/components/Avatar/Avatar.tsx +230 -0
  93. package/src/components/Avatar/README.md +333 -0
  94. package/src/components/Badge/Badge.module.scss +49 -0
  95. package/src/components/Badge/Badge.tsx +87 -0
  96. package/src/components/Badge/README.md +223 -0
  97. package/src/components/BarCode/BarCode.module.scss +0 -0
  98. package/src/components/BarCode/BarCode.tsx +153 -0
  99. package/src/components/Breadcrumb/Breadcrumb.module.scss +36 -0
  100. package/src/components/Breadcrumb/Breadcrumb.tsx +114 -0
  101. package/src/components/Breadcrumb/README.md +339 -0
  102. package/src/components/Button/Button.colors.tsx +322 -0
  103. package/src/components/Button/Button.context.tsx +47 -0
  104. package/src/components/Button/Button.module.scss +156 -0
  105. package/src/components/Button/Button.tsx +190 -0
  106. package/src/components/Button/Button.type.ts +11 -0
  107. package/src/components/Calendar/Calendar.context.tsx +138 -0
  108. package/src/components/Calendar/Calendar.module.scss +116 -0
  109. package/src/components/Calendar/Calendar.tsx +440 -0
  110. package/src/components/Calendar/dayjs.util.ts +312 -0
  111. package/src/components/Cascader/Cacader.data.ts +1185 -0
  112. package/src/components/Cascader/Cascader.context.tsx +61 -0
  113. package/src/components/Cascader/Cascader.hook.ts +502 -0
  114. package/src/components/Cascader/Cascader.module.scss +143 -0
  115. package/src/components/Cascader/Cascader.tsx +281 -0
  116. package/src/components/Cascader/README.md +735 -0
  117. package/src/components/Chart/Chart.module.scss +0 -0
  118. package/src/components/Chart/Chart.tsx +230 -0
  119. package/src/components/Chart/README.md +85 -0
  120. package/src/components/Chart/images/barChart.png +0 -0
  121. package/src/components/Chips/Chips.colors.tsx +185 -0
  122. package/src/components/Chips/Chips.module.scss +49 -0
  123. package/src/components/Chips/Chips.tsx +78 -0
  124. package/src/components/Comment/Comment.module.scss +14 -0
  125. package/src/components/Comment/Comment.tsx +105 -0
  126. package/src/components/Dialog/Dialog.module.scss +0 -0
  127. package/src/components/Dialog/Dialog.tsx +12 -0
  128. package/src/components/Divider/Divider.module.scss +12 -0
  129. package/src/components/Divider/Divider.tsx +33 -0
  130. package/src/components/Editor/Editor.context.tsx +12 -0
  131. package/src/components/Editor/Editor.module.scss +40 -0
  132. package/src/components/Editor/Editor.tsx +174 -0
  133. package/src/components/Form/CheckBox/CheckBox.context.tsx +56 -0
  134. package/src/components/Form/CheckBox/CheckBox.module.scss +81 -0
  135. package/src/components/Form/CheckBox/CheckBox.tsx +196 -0
  136. package/src/components/Form/CheckBox/Checkbox.colors.tsx +42 -0
  137. package/src/components/Form/Dropdown/Dropdown.colors.tsx +125 -0
  138. package/src/components/Form/Dropdown/Dropdown.context.tsx +62 -0
  139. package/src/components/Form/Dropdown/Dropdown.module.scss +133 -0
  140. package/src/components/Form/Dropdown/Dropdown.tsx +404 -0
  141. package/src/components/Form/OTPInput/OTPInput.context.tsx +104 -0
  142. package/src/components/Form/OTPInput/OTPInput.module.scss +22 -0
  143. package/src/components/Form/OTPInput/OTPInput.tsx +67 -0
  144. package/src/components/Form/Radio/Radio.colors.tsx +42 -0
  145. package/src/components/Form/Radio/Radio.context.tsx +40 -0
  146. package/src/components/Form/Radio/Radio.module.scss +61 -0
  147. package/src/components/Form/Radio/Radio.tsx +174 -0
  148. package/src/components/Form/Switch/Switch.colors.tsx +42 -0
  149. package/src/components/Form/Switch/Switch.context.tsx +50 -0
  150. package/src/components/Form/Switch/Switch.module.scss +53 -0
  151. package/src/components/Form/Switch/Switch.tsx +151 -0
  152. package/src/components/Form/TextArea/TextArea.colors.tsx +76 -0
  153. package/src/components/Form/TextArea/TextArea.context.tsx +97 -0
  154. package/src/components/Form/TextArea/TextArea.module.scss +138 -0
  155. package/src/components/Form/TextArea/TextArea.tsx +246 -0
  156. package/src/components/Form/TextInput/TextInput.colors.tsx +76 -0
  157. package/src/components/Form/TextInput/TextInput.context.tsx +106 -0
  158. package/src/components/Form/TextInput/TextInput.module.scss +160 -0
  159. package/src/components/Form/TextInput/TextInput.tsx +225 -0
  160. package/src/components/GlobalStyle/GlobalStyle.tsx +20 -0
  161. package/src/components/HelperText/HelperText.module.scss +28 -0
  162. package/src/components/HelperText/HelperText.tsx +130 -0
  163. package/src/components/Icon/Icon.tsx +29 -0
  164. package/src/components/Icons/Add.tsx +20 -0
  165. package/src/components/Icons/AddAPhoto.tsx +21 -0
  166. package/src/components/Icons/ApprovalInactive.tsx +26 -0
  167. package/src/components/Icons/ArrowRight.tsx +24 -0
  168. package/src/components/Icons/AttachFile.tsx +20 -0
  169. package/src/components/Icons/Cancle.tsx +20 -0
  170. package/src/components/Icons/CancleFilled.tsx +20 -0
  171. package/src/components/Icons/Cart.tsx +20 -0
  172. package/src/components/Icons/CartFilled.tsx +20 -0
  173. package/src/components/Icons/Check.tsx +20 -0
  174. package/src/components/Icons/CheckBoxRound.tsx +21 -0
  175. package/src/components/Icons/CheckCircle.tsx +35 -0
  176. package/src/components/Icons/Close.tsx +20 -0
  177. package/src/components/Icons/Company.tsx +20 -0
  178. package/src/components/Icons/Download.tsx +20 -0
  179. package/src/components/Icons/DragHandle.tsx +20 -0
  180. package/src/components/Icons/Eco.tsx +20 -0
  181. package/src/components/Icons/EditSquare.tsx +20 -0
  182. package/src/components/Icons/Error.tsx +20 -0
  183. package/src/components/Icons/ErrorFilled.tsx +20 -0
  184. package/src/components/Icons/ExpandAll.tsx +20 -0
  185. package/src/components/Icons/ExpandLess.tsx +20 -0
  186. package/src/components/Icons/ExpandMore.tsx +20 -0
  187. package/src/components/Icons/Factory.tsx +20 -0
  188. package/src/components/Icons/FileUpload.tsx +20 -0
  189. package/src/components/Icons/FilecheckInactive.tsx +22 -0
  190. package/src/components/Icons/GoBefore.tsx +20 -0
  191. package/src/components/Icons/GoNext.tsx +20 -0
  192. package/src/components/Icons/HamburgerMenu.tsx +20 -0
  193. package/src/components/Icons/ImagecheckPlay.tsx +27 -0
  194. package/src/components/Icons/Inventory.tsx +20 -0
  195. package/src/components/Icons/KakaoTalk.tsx +22 -0
  196. package/src/components/Icons/ListAll.tsx +20 -0
  197. package/src/components/Icons/LocalShipping.tsx +20 -0
  198. package/src/components/Icons/Logout.tsx +20 -0
  199. package/src/components/Icons/Menu.tsx +20 -0
  200. package/src/components/Icons/Minus.tsx +18 -0
  201. package/src/components/Icons/ModeEdit.tsx +25 -0
  202. package/src/components/Icons/More.tsx +20 -0
  203. package/src/components/Icons/Naver.tsx +20 -0
  204. package/src/components/Icons/NaverBlog.tsx +22 -0
  205. package/src/components/Icons/OrderApprove.tsx +20 -0
  206. package/src/components/Icons/OrderInactive.tsx +20 -0
  207. package/src/components/Icons/OrderPlay.tsx +20 -0
  208. package/src/components/Icons/Outward.tsx +20 -0
  209. package/src/components/Icons/PayApprove.tsx +24 -0
  210. package/src/components/Icons/PayInactive.tsx +24 -0
  211. package/src/components/Icons/Personcard.tsx +20 -0
  212. package/src/components/Icons/PrintInactive.tsx +24 -0
  213. package/src/components/Icons/PrintPlay.tsx +24 -0
  214. package/src/components/Icons/Product.tsx +20 -0
  215. package/src/components/Icons/Search.tsx +20 -0
  216. package/src/components/Icons/Settings.tsx +20 -0
  217. package/src/components/Icons/ShippingDone.tsx +20 -0
  218. package/src/components/Icons/SupportAgent.tsx +20 -0
  219. package/src/components/Icons/SwapVert.tsx +21 -0
  220. package/src/components/Icons/Task.tsx +20 -0
  221. package/src/components/Icons/Upload.tsx +20 -0
  222. package/src/components/Icons/User.tsx +20 -0
  223. package/src/components/Icons/Warning.tsx +20 -0
  224. package/src/components/Icons/WarningAmber.tsx +21 -0
  225. package/src/components/Icons/WarningFilled.tsx +20 -0
  226. package/src/components/Icons/index.ts +62 -0
  227. package/src/components/LNB/LNB.context.tsx +32 -0
  228. package/src/components/LNB/LNB.module.scss +99 -0
  229. package/src/components/LNB/LNB.tsx +190 -0
  230. package/src/components/LNB/README.md +411 -0
  231. package/src/components/LNB/makeNavigation.ts +51 -0
  232. package/src/components/LNB/navigation.d.ts +15 -0
  233. package/src/components/LNB/navigation.json +211 -0
  234. package/src/components/Label/Label.colors.tsx +241 -0
  235. package/src/components/Label/Label.module.scss +31 -0
  236. package/src/components/Label/Label.tsx +54 -0
  237. package/src/components/LazyImage/LazyImage.module.scss +6 -0
  238. package/src/components/LazyImage/LazyImage.tsx +107 -0
  239. package/src/components/List/List.module.scss +81 -0
  240. package/src/components/List/List.tsx +91 -0
  241. package/src/components/List/README.md +87 -0
  242. package/src/components/MobilePicker/MobilePicker.context.tsx +22 -0
  243. package/src/components/MobilePicker/MobilePicker.module.scss +57 -0
  244. package/src/components/MobilePicker/MobilePicker.tsx +336 -0
  245. package/src/components/MobilePicker/README.md +159 -0
  246. package/src/components/Modal/Modal.tsx +77 -0
  247. package/src/components/Modal/README.md +130 -0
  248. package/src/components/Pagination/Pagination.colors.tsx +85 -0
  249. package/src/components/Pagination/Pagination.context.tsx +28 -0
  250. package/src/components/Pagination/Pagination.module.scss +60 -0
  251. package/src/components/Pagination/Pagination.tsx +234 -0
  252. package/src/components/Popup/Popup.context.tsx +15 -0
  253. package/src/components/Popup/Popup.module.scss +53 -0
  254. package/src/components/Popup/Popup.tsx +116 -0
  255. package/src/components/Popup/README.md +170 -0
  256. package/src/components/QRCode/QRCode.module.scss +2 -0
  257. package/src/components/QRCode/QRCode.tsx +61 -0
  258. package/src/components/ScrollCalendar/ScrollCalendar.context.tsx +26 -0
  259. package/src/components/ScrollCalendar/ScrollCalendar.module.scss +42 -0
  260. package/src/components/ScrollCalendar/ScrollCalendar.tsx +448 -0
  261. package/src/components/ScrollSpy/README.md +62 -0
  262. package/src/components/ScrollSpy/ScrollSpy.tsx +130 -0
  263. package/src/components/Sheet/README.md +92 -0
  264. package/src/components/Sheet/Sheet.context.tsx +23 -0
  265. package/src/components/Sheet/Sheet.module.scss +68 -0
  266. package/src/components/Sheet/Sheet.tsx +146 -0
  267. package/src/components/Slider/README.md +639 -0
  268. package/src/components/Slider/Slider.backup.tsx +477 -0
  269. package/src/components/Slider/Slider.context.tsx +67 -0
  270. package/src/components/Slider/Slider.module.scss +123 -0
  271. package/src/components/Slider/Slider.tsx +467 -0
  272. package/src/components/Stepper/README.md +320 -0
  273. package/src/components/Stepper/Stepper.context.tsx +49 -0
  274. package/src/components/Stepper/Stepper.module.scss +163 -0
  275. package/src/components/Stepper/Stepper.tsx +219 -0
  276. package/src/components/Tab/Tab.colors.tsx +54 -0
  277. package/src/components/Tab/Tab.context.tsx +64 -0
  278. package/src/components/Tab/Tab.module.scss +239 -0
  279. package/src/components/Tab/Tab.tsx +123 -0
  280. package/src/components/Tab/cx.ts +6 -0
  281. package/src/components/Table/README.md +162 -0
  282. package/src/components/Table/Table.context.tsx +23 -0
  283. package/src/components/Table/Table.hook.ts +51 -0
  284. package/src/components/Table/Table.module.scss +83 -0
  285. package/src/components/Table/Table.tsx +147 -0
  286. package/src/components/Thumbnail/README.md +302 -0
  287. package/src/components/Thumbnail/Thumbnail.context.tsx +42 -0
  288. package/src/components/Thumbnail/Thumbnail.module.scss +149 -0
  289. package/src/components/Thumbnail/Thumbnail.tsx +391 -0
  290. package/src/components/TimeInput/README.md +118 -0
  291. package/src/components/TimeInput/TimeInput.colors.tsx +76 -0
  292. package/src/components/TimeInput/TimeInput.context.tsx +58 -0
  293. package/src/components/TimeInput/TimeInput.module.scss +211 -0
  294. package/src/components/TimeInput/TimeInput.tsx +411 -0
  295. package/src/components/WeeklyCalendar/WeeklyCalendar.context.tsx +88 -0
  296. package/src/components/WeeklyCalendar/WeeklyCalendar.module.scss +225 -0
  297. package/src/components/WeeklyCalendar/WeeklyCalendar.tsx +772 -0
  298. package/src/components/WeeklyCalendar/dayjs.util.ts +336 -0
  299. package/src/components/WeeklyCalendar/weeklyCalendar.util.ts +583 -0
  300. package/src/components/WisywygEditor/Quill/Editor.tsx +148 -0
  301. package/src/constant/locale.constant.ts +6 -0
  302. package/src/globals.scss +80 -0
  303. package/src/hooks/useColorScheme.tsx +48 -0
  304. package/src/hooks/useElementRect.tsx +128 -0
  305. package/src/hooks/useIntersectionObserver.tsx +33 -0
  306. package/src/index.css +17 -0
  307. package/src/index.ts +187 -0
  308. package/src/main.tsx +10 -0
  309. package/src/styles/_fontSize.mixin.scss +57 -0
  310. package/src/styles/_fontWeight.mixin.scss +15 -0
  311. package/src/styles/_lineHeight.mixin.scss +57 -0
  312. package/src/styles/_scrollbar.mixin.scss +49 -0
  313. package/src/styles/baseColor.ts +297 -0
  314. package/src/styles/color.ts +272 -0
  315. package/src/styles/color2.ts +200 -0
  316. package/src/styles/scrollbar.README.md +72 -0
  317. package/src/styles/typography.scss +170 -0
  318. package/src/utils/aws.util.ts +180 -0
  319. package/src/utils/common.utill.ts +45 -0
  320. package/src/vite-env.d.ts +1 -0
  321. package/tsconfig.app.json +24 -0
  322. package/tsconfig.json +29 -0
  323. package/tsconfig.node.json +10 -0
  324. package/tsconfig.node.tsbuildinfo +1 -0
  325. package/tsconfig.tsbuildinfo +1 -0
  326. package/vite.config.d.ts +2 -0
  327. package/vite.config.js +47 -0
  328. package/vite.config.ts +50 -0
@@ -0,0 +1,219 @@
1
+ "use client";
2
+ /* eslint-disable react-refresh/only-export-components */
3
+ import React from "react";
4
+ import cn from "classnames/bind";
5
+ import styles from "./Stepper.module.scss";
6
+ import {
7
+ StepperContext,
8
+ StepperProvider,
9
+ StepperProviderProps,
10
+ } from "./Stepper.context";
11
+ import Divider from "../Divider/Divider";
12
+
13
+ const cx = cn.bind(styles);
14
+
15
+ type ContentProps = { children: React.ReactNode };
16
+ const Content = (props: ContentProps) => {
17
+ const { children } = props;
18
+
19
+ const { direction } = React.useContext(StepperContext);
20
+
21
+ switch (direction) {
22
+ case "row":
23
+ return <div className={cx("Content")}>{children}</div>;
24
+ case "column":
25
+ return <>{children}</>;
26
+ }
27
+ };
28
+
29
+ type StepsRenderProps = {
30
+ index: number;
31
+ active: boolean;
32
+ defaultClassName: string;
33
+ };
34
+ type StepProps = {
35
+ className?: string;
36
+ index?: number;
37
+ title?: string | number | ((props: StepsRenderProps) => React.ReactNode);
38
+ desc?: string | number | ((props: StepsRenderProps) => React.ReactNode);
39
+ point?: string | number | ((props: StepsRenderProps) => React.ReactNode);
40
+ };
41
+ const Step = (props: StepProps) => {
42
+ const { className, index, title, desc, point } = props;
43
+
44
+ const { activeStep, contentsPosition, direction, linear, onClick } =
45
+ React.useContext(StepperContext);
46
+
47
+ const [before, after, inline, block] = React.useMemo(() => {
48
+ if (!contentsPosition) return [];
49
+ return [
50
+ ["top", "left"].includes(contentsPosition),
51
+ ["bottom", "right"].includes(contentsPosition),
52
+ ["left", "right"].includes(contentsPosition),
53
+ ["top", "bottom"].includes(contentsPosition),
54
+ ];
55
+ }, [contentsPosition]);
56
+
57
+ const active = React.useMemo(() => {
58
+ if (index === undefined) return false;
59
+ return activeStep === index;
60
+ }, [index, activeStep]);
61
+
62
+ const clickHandler = React.useCallback(() => {
63
+ if (index === undefined) return;
64
+ if (onClick) {
65
+ if (!linear) {
66
+ onClick(index);
67
+ }
68
+ }
69
+ }, [index, linear, onClick]);
70
+
71
+ const isFunction = React.useCallback(
72
+ (data: unknown) => typeof data === "function",
73
+ []
74
+ );
75
+
76
+ if (index === undefined) return;
77
+
78
+ return (
79
+ <div
80
+ className={cx("StepWrap", direction, contentsPosition, {
81
+ linear,
82
+ inline,
83
+ active,
84
+ })}
85
+ onClick={clickHandler}
86
+ >
87
+ <div
88
+ className={cx("Step", className, direction, contentsPosition, {
89
+ block,
90
+ inline,
91
+ active,
92
+ })}
93
+ >
94
+ {before && (
95
+ <Content>
96
+ {isFunction(title) ? (
97
+ title({ index, active, defaultClassName: cx("Title") })
98
+ ) : (
99
+ <div className={cx("Title")}>
100
+ <span>{title ?? index}</span>
101
+ </div>
102
+ )}
103
+ {!(direction === "column" && inline) &&
104
+ (isFunction(desc) ? (
105
+ desc({ index, active, defaultClassName: cx("Desc") })
106
+ ) : (
107
+ <div className={cx("Desc")}>
108
+ <span>{desc ?? index}</span>
109
+ </div>
110
+ ))}
111
+ </Content>
112
+ )}
113
+ {isFunction(point) ? (
114
+ point({ index, active, defaultClassName: cx("Point") })
115
+ ) : (
116
+ <div className={cx("Point")}>
117
+ <span>{point ?? index}</span>
118
+ </div>
119
+ )}
120
+ {after && (
121
+ <Content>
122
+ {isFunction(title) ? (
123
+ title({ index, active, defaultClassName: cx("Title") })
124
+ ) : (
125
+ <div className={cx("Title")}>
126
+ <span>{title ?? index}</span>
127
+ </div>
128
+ )}
129
+ {!(direction === "column" && inline) &&
130
+ (isFunction(desc) ? (
131
+ desc({ index, active, defaultClassName: cx("Desc") })
132
+ ) : (
133
+ <div className={cx("Desc")}>
134
+ <span>{desc ?? index}</span>
135
+ </div>
136
+ ))}
137
+ </Content>
138
+ )}
139
+ </div>
140
+ {direction === "column" &&
141
+ inline &&
142
+ (isFunction(desc) ? (
143
+ desc({ index, active, defaultClassName: cx("Desc") })
144
+ ) : (
145
+ <div className={cx("Desc")}>
146
+ <span>{desc ?? index}</span>
147
+ </div>
148
+ ))}
149
+ </div>
150
+ );
151
+ };
152
+
153
+ type OmitContext = "";
154
+ const Root = (props: Omit<StepperProviderProps, OmitContext>) => {
155
+ const {
156
+ children,
157
+ className,
158
+ direction = "row",
159
+ contentsPosition = "bottom",
160
+ lineAs,
161
+ } = props;
162
+
163
+ const contextValue = React.useMemo(() => {
164
+ return {
165
+ direction,
166
+ contentsPosition,
167
+ ...props,
168
+ };
169
+ }, [props, direction, contentsPosition]);
170
+
171
+ return (
172
+ <StepperProvider {...contextValue}>
173
+ <div className={cx("Root", direction, className)}>
174
+ {React.Children.map(children, (child, index) => {
175
+ if (React.isValidElement(child) && child.type === Step) {
176
+ return (
177
+ <React.Fragment>
178
+ {index !== 0 &&
179
+ (lineAs
180
+ ? lineAs({
181
+ defaultClassName: cx("Divider", direction, {
182
+ isTop: contentsPosition === "top",
183
+ }),
184
+ direction,
185
+ contentsPosition,
186
+ index,
187
+ })
188
+ : direction === "row" && (
189
+ <Divider
190
+ className={cx("Divider", direction, {
191
+ isTop: contentsPosition === "top",
192
+ })}
193
+ size={direction === "row" ? 1 : undefined}
194
+ />
195
+ ))}
196
+ {React.cloneElement(child, { index } as React.ComponentProps<
197
+ typeof Step
198
+ >)}
199
+ </React.Fragment>
200
+ );
201
+ }
202
+ return child;
203
+ })}
204
+ </div>
205
+ </StepperProvider>
206
+ );
207
+ };
208
+
209
+ interface IStepper {
210
+ Root: typeof Root;
211
+ Step: typeof Step;
212
+ }
213
+
214
+ export default {
215
+ Root,
216
+ Step,
217
+ } as IStepper;
218
+
219
+ export type { StepperProviderProps };
@@ -0,0 +1,54 @@
1
+ const useTabColors = () => {
2
+ const selected = {
3
+ // line: {
4
+ // backgroundColor: ,
5
+ // color: ,
6
+ // borderColor: ,
7
+ // },
8
+ // text: {
9
+ // backgroundColor: ,
10
+ // color: ,
11
+ // borderColor: ,
12
+ // },
13
+ // square: {
14
+ // backgroundColor: ,
15
+ // color: ,
16
+ // borderColor: ,
17
+ // },
18
+ // circle: {
19
+ // backgroundColor: ,
20
+ // color: ,
21
+ // borderColor: ,derColor: ,
22
+ // }
23
+ };
24
+
25
+ const unselected = {
26
+ // line: {
27
+ // backgroundColor: ,
28
+ // color: ,
29
+ // borderColor: ,
30
+ // },
31
+ // text: {
32
+ // backgroundColor: ,
33
+ // color: ,
34
+ // borderColor: ,
35
+ // },
36
+ // square: {
37
+ // backgroundColor: ,
38
+ // color: ,
39
+ // borderColor: ,
40
+ // },
41
+ // circle: {
42
+ // backgroundColor: ,
43
+ // color: ,
44
+ // borderColor: ,
45
+ // }
46
+ };
47
+
48
+ return {
49
+ selected,
50
+ unselected,
51
+ };
52
+ };
53
+
54
+ export default useTabColors;
@@ -0,0 +1,64 @@
1
+ import React from "react";
2
+
3
+ export const TabType = [
4
+ "textLine",
5
+ "line",
6
+ "text",
7
+ "squareLine",
8
+ "circle",
9
+ "square",
10
+ "rounded",
11
+ ] as const;
12
+
13
+ type ITabContext = {
14
+ /** align */
15
+ align: "start" | "center" | "end";
16
+ /** direction */
17
+ direction: "horizontal" | "vertical";
18
+ /** isFitted */
19
+ isFitted?: boolean;
20
+ /** onChange */
21
+ onChange: (id: string) => void;
22
+ /** background Color */
23
+ bg?: string;
24
+ /** size */
25
+ size?: "small" | "medium" | "large";
26
+ /** active */
27
+ active?: string;
28
+ /** tabType */
29
+ tabType?: (typeof TabType)[number];
30
+ };
31
+
32
+ const initialState: ITabContext = {
33
+ align: "center",
34
+ direction: "horizontal",
35
+ isFitted: false,
36
+ onChange: () => {},
37
+ bg: "transparent",
38
+ size: "small",
39
+ tabType: "line",
40
+ active: "0",
41
+ };
42
+
43
+ export const TabsContext = React.createContext<ITabContext>(initialState);
44
+
45
+ export type TabsProviderProps = React.PropsWithChildren<
46
+ Partial<ITabContext> & {
47
+ className?: string;
48
+ }
49
+ >;
50
+
51
+ export const TabProvider = (props: TabsProviderProps) => {
52
+ const contextValue = React.useMemo(() => {
53
+ return {
54
+ ...initialState,
55
+ ...props,
56
+ };
57
+ }, [props]);
58
+
59
+ return (
60
+ <TabsContext.Provider value={contextValue}>
61
+ {props.children}
62
+ </TabsContext.Provider>
63
+ );
64
+ };
@@ -0,0 +1,239 @@
1
+ @layer Tab {
2
+ .Root {
3
+ display: flex;
4
+ flex-direction: column;
5
+ box-sizing: content-box;
6
+
7
+ &.vertical {
8
+ flex-direction: row;
9
+ }
10
+ }
11
+
12
+ .List {
13
+ display: flex;
14
+ flex-direction: row;
15
+
16
+ &.small {
17
+ height: 32px;
18
+ }
19
+ &.medium {
20
+ height: 40px;
21
+ }
22
+ &.large {
23
+ height: 48px;
24
+ }
25
+
26
+ &.circle {
27
+ border-radius: 50px;
28
+ padding: 4px;
29
+ background: var(--grey8, #919eab14);
30
+ }
31
+ &.square {
32
+ border-radius: 8px;
33
+ padding: 4px;
34
+ background-color: var(--grey8, #919eab14);
35
+ }
36
+
37
+ &.squareLine {
38
+ background-color: var(--grey4, #919eab0a);
39
+ }
40
+
41
+ &.squareLine,
42
+ &.circle,
43
+ &.square {
44
+ &:not(.fitted) {
45
+ width: max-content;
46
+ }
47
+ }
48
+
49
+ &.rounded {
50
+ border-bottom: 1px solid var(--Simentic-On-Surface-Sub, #abadb0);
51
+ }
52
+
53
+ &.vertical {
54
+ flex-direction: column;
55
+
56
+ &.circle {
57
+ // padding: 8px;
58
+ }
59
+ }
60
+
61
+ &.circle,
62
+ &.square,
63
+ &.squareLine {
64
+ &.vertical {
65
+ &.start {
66
+ justify-self: flex-start;
67
+ }
68
+
69
+ &.center {
70
+ justify-self: center;
71
+ }
72
+
73
+ &.end {
74
+ justify-self: flex-end;
75
+ }
76
+ }
77
+
78
+ &.horizontal:not(.fitted) {
79
+ &.start {
80
+ align-self: flex-start;
81
+ }
82
+
83
+ &.center {
84
+ align-self: center;
85
+ }
86
+
87
+ &.end {
88
+ align-self: flex-end;
89
+ }
90
+ }
91
+ }
92
+
93
+ &.line,
94
+ &.textLine,
95
+ &.rounded,
96
+ &.text {
97
+ &.start {
98
+ justify-content: flex-start;
99
+ }
100
+
101
+ &.center {
102
+ justify-content: center;
103
+ }
104
+
105
+ &.end {
106
+ justify-content: flex-end;
107
+ }
108
+ }
109
+ }
110
+
111
+ .Panel {
112
+ display: none;
113
+ padding: 4px;
114
+
115
+ &.active {
116
+ display: block;
117
+ }
118
+ }
119
+
120
+ .Item {
121
+ // height: inherit;
122
+ padding-inline: 12px;
123
+ display: flex;
124
+ align-items: center;
125
+ justify-content: center;
126
+ color: var(--textTertiary, #919eab);
127
+
128
+ &.active {
129
+ color: var(--textPrimary, #1c252e);
130
+ }
131
+
132
+ &.large {
133
+ @include bodyRegularLarge;
134
+ padding-inline: 16px;
135
+
136
+ &.active {
137
+ @include bodyBoldLarge;
138
+ }
139
+ }
140
+
141
+ &.medium {
142
+ @include bodyRegularMedium;
143
+
144
+ &.active {
145
+ @include bodyBoldMedium;
146
+ }
147
+ }
148
+
149
+ &.small {
150
+ @include bodyRegularSmall;
151
+ // padding: 0 16px;
152
+
153
+ &.active {
154
+ @include bodyBoldSmall;
155
+ }
156
+ }
157
+
158
+ &:not(.textLine) {
159
+ &.small {
160
+ // padding-top: 4px;
161
+ // padding-bottom: 4px;
162
+ }
163
+
164
+ &.large {
165
+ // padding-top: 8px;
166
+ // padding-bottom: 8px;
167
+ }
168
+ }
169
+
170
+ &.line {
171
+ padding-inline: 16px;
172
+ border-bottom: 2px solid var(--actionDisabled, #919eab66);
173
+
174
+ &.large {
175
+ padding-inline: 24px;
176
+ }
177
+
178
+ &.active {
179
+ border-color: var(--textPrimary, #1c252e);
180
+ }
181
+ }
182
+
183
+ &.squareLine {
184
+ border: 1px solid var(--textTertiary, #919eab);
185
+ background-color: var(--grey4, #919eab0a);
186
+
187
+ &.active {
188
+ border-color: var(--textPrimary, #1c252e);
189
+ background-color: var(--backgroundDefault, #ffffff);
190
+ }
191
+ }
192
+
193
+ &.rounded {
194
+ &.active {
195
+ border: 1px solid var(--Simentic-On-Surface-Sub, #abadb0);
196
+ border-top-left-radius: 8px;
197
+ border-top-right-radius: 8px;
198
+ border-bottom-color: transparent;
199
+ }
200
+ }
201
+
202
+ &.circle {
203
+ border-radius: 40px;
204
+
205
+ &.active {
206
+ background: var(--Simentic-On-Surface-Variant, #ffffff);
207
+ }
208
+ }
209
+ &.square {
210
+ border-radius: 8px;
211
+
212
+ &.active {
213
+ background: var(--Simentic-On-Surface-Variant, #ffffff);
214
+ box-shadow: 0 4px 8px 0 var(--shadow12, #919eab1f);
215
+ }
216
+ }
217
+
218
+ &.fitted {
219
+ flex: 1 auto;
220
+ }
221
+
222
+ .ItemButton {
223
+ font: inherit;
224
+ line-height: initial !important;
225
+ color: inherit;
226
+ width: 100%;
227
+ height: 100%;
228
+
229
+ &.textLine {
230
+ // padding-bottom: 5px;
231
+ border-bottom: 2px solid transparent;
232
+
233
+ &.active {
234
+ border-color: var(--Simentic-On-Surface, #121416);
235
+ }
236
+ }
237
+ }
238
+ }
239
+ }
@@ -0,0 +1,123 @@
1
+ "use client";
2
+ /* eslint-disable react-refresh/only-export-components */
3
+ import React from "react";
4
+ import { TabProvider, TabsContext, TabsProviderProps } from "./Tab.context";
5
+ import cx from "./cx";
6
+
7
+ type PanelProps = React.PropsWithChildren<{
8
+ className?: string;
9
+ id?: string;
10
+ index: number;
11
+ }>;
12
+
13
+ const Panel = (props: PanelProps) => {
14
+ const { className, children, id, index } = props;
15
+ const { active } = React.useContext(TabsContext);
16
+ const PanelId = id ?? index.toString();
17
+
18
+ return (
19
+ <div
20
+ className={cx("Panel", className, {
21
+ active: active === PanelId,
22
+ })}
23
+ >
24
+ {children}
25
+ </div>
26
+ );
27
+ };
28
+
29
+ type PanelsProps = React.PropsWithChildren<{
30
+ className?: string;
31
+ }>;
32
+
33
+ const Panels = (props: PanelsProps) => {
34
+ const { className, children } = props;
35
+
36
+ return <div className={cx("Paenls", className)}>{children}</div>;
37
+ };
38
+
39
+ type TabListProps = React.PropsWithChildren<{
40
+ className?: string;
41
+ }>;
42
+
43
+ const List = (props: TabListProps) => {
44
+ const { className } = props;
45
+ const { tabType, direction, align, isFitted, size } =
46
+ React.useContext(TabsContext);
47
+
48
+ return (
49
+ <div
50
+ className={cx("List", direction, align, tabType, className, size, {
51
+ fitted: isFitted,
52
+ })}
53
+ >
54
+ {props.children}
55
+ </div>
56
+ );
57
+ };
58
+
59
+ type TabProps = React.PropsWithChildren<{
60
+ className?: string;
61
+ id?: string;
62
+ index: number;
63
+ onClick?: (...args: any) => void;
64
+ isActive?: boolean;
65
+ }>;
66
+
67
+ const Item = (props: TabProps) => {
68
+ const {
69
+ className,
70
+ children,
71
+ id,
72
+ index,
73
+ onClick,
74
+ isActive: forcedActive,
75
+ } = props;
76
+ const { onChange, tabType, size, active, isFitted } =
77
+ React.useContext(TabsContext);
78
+ const value = id ?? index.toString();
79
+
80
+ const isActive = active === value;
81
+ return (
82
+ <div
83
+ className={cx("Item", size, tabType, className, {
84
+ active: forcedActive ?? isActive,
85
+ fitted: isFitted,
86
+ })}
87
+ onClick={onClick ?? onChange.bind(null, id ?? index.toString())}
88
+ >
89
+ <button
90
+ className={cx("ItemButton", tabType, {
91
+ active: forcedActive ?? isActive,
92
+ })}
93
+ >
94
+ {children}
95
+ </button>
96
+ </div>
97
+ );
98
+ };
99
+
100
+ const Root = (props: TabsProviderProps) => {
101
+ const { children, className, direction } = props;
102
+ return (
103
+ <TabProvider {...props}>
104
+ <div className={cx("Root", direction, className)}>{children}</div>
105
+ </TabProvider>
106
+ );
107
+ };
108
+
109
+ interface ITab {
110
+ Root: typeof Root;
111
+ List: typeof List;
112
+ Item: typeof Item;
113
+ Panel: typeof Panel;
114
+ Panels: typeof Panels;
115
+ }
116
+
117
+ export default {
118
+ Root,
119
+ List,
120
+ Item,
121
+ Panel,
122
+ Panels,
123
+ } as ITab;
@@ -0,0 +1,6 @@
1
+ import cn from "classnames/bind";
2
+ import styles from "./Tab.module.scss";
3
+
4
+ const cx = cn.bind(styles);
5
+
6
+ export default cx;