@v-miniapp/ui-react 1.0.40 → 1.0.45

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 (141) hide show
  1. package/README.md +1 -1
  2. package/dist/components/icon/icon-mapping.d.ts +4 -0
  3. package/dist/components/navigation-bar/navigation-bar.d.ts +3 -1
  4. package/dist/external/index.js +2009 -2012
  5. package/dist/external/styles.css +1 -1
  6. package/dist/index.js +1029 -1032
  7. package/dist/styles.css +1 -1
  8. package/dist-storybook/assets/ANIMATION-CUdn1GTK.js +99 -0
  9. package/dist-storybook/assets/APP_FRAMEWORK-ljbIOHYd.js +197 -0
  10. package/dist-storybook/assets/BOTTOM_TAB_BAR-DxCwCfBK.js +175 -0
  11. package/dist-storybook/assets/CUSTOM_ERROR_BOUNDARY-B4wTQNZc.js +250 -0
  12. package/dist-storybook/assets/Color-AVL7NMMY-1_8XTICv.js +1 -0
  13. package/dist-storybook/assets/DARK_MODE-CoHseCDO.js +57 -0
  14. package/dist-storybook/assets/DocsRenderer-PQXLIZUC-BO86igwd.js +2 -0
  15. package/dist-storybook/assets/GETTING_STARTED-H_vVi5cv.js +77 -0
  16. package/dist-storybook/assets/INFINITE_SCROLL-BtM3uoX0.js +111 -0
  17. package/dist-storybook/assets/KEEP_ALIVE-CL2au0al.js +126 -0
  18. package/dist-storybook/assets/LOCALE-XTCey55y.js +465 -0
  19. package/dist-storybook/assets/MIGRATION_GUIDE-2LONslE4.js +449 -0
  20. package/dist-storybook/assets/MOBILE_BEHAVIOURS-DZ6alKTX.js +177 -0
  21. package/dist-storybook/assets/PAGE_LAYOUT-BuOpN-1Y.js +192 -0
  22. package/dist-storybook/assets/ROUTING_NAVIGATION-BCPHXNto.js +335 -0
  23. package/dist-storybook/assets/TAILWIND_INTEGRATION-_T-VfvkM.js +87 -0
  24. package/dist-storybook/assets/_setToString-CbM921C9.js +1 -0
  25. package/dist-storybook/assets/alert-DLW8CoyB.js +1 -0
  26. package/dist-storybook/assets/alert.stories-B-vuojPh.js +110 -0
  27. package/dist-storybook/assets/avatar-GxcYPA1p.js +1 -0
  28. package/dist-storybook/assets/avatar.stories-KYFztAc8.js +136 -0
  29. package/dist-storybook/assets/axe-CmvD4WV5.js +20 -0
  30. package/dist-storybook/assets/badge-D_LzMVtw.js +1 -0
  31. package/dist-storybook/assets/badge.stories-Be2ItCmQ.js +262 -0
  32. package/dist-storybook/assets/blocks-BuaOUtiH.js +1243 -0
  33. package/dist-storybook/assets/bottom-tab-bar-CtcTAxuI.js +115 -0
  34. package/dist-storybook/assets/bottom-tab-bar.stories-CDmEve6z.js +186 -0
  35. package/dist-storybook/assets/button-CL7GeC23.js +1 -0
  36. package/dist-storybook/assets/button.stories-CaqLWQiY.js +287 -0
  37. package/dist-storybook/assets/calendar-dOCsjhVU.js +1 -0
  38. package/dist-storybook/assets/calendar.stories-DLWZldet.js +189 -0
  39. package/dist-storybook/assets/carousel-1Kww3hIz.js +37 -0
  40. package/dist-storybook/assets/carousel.stories-B8YbGOOr.js +217 -0
  41. package/dist-storybook/assets/checkbox-MGytNNRt.js +1 -0
  42. package/dist-storybook/assets/checkbox.stories-CLvfZPiw.js +201 -0
  43. package/dist-storybook/assets/chip-kG4p82WT.js +247 -0
  44. package/dist-storybook/assets/chip.stories-BbwJb5eD.js +442 -0
  45. package/dist-storybook/assets/classname-CUR_zgkh.js +1 -0
  46. package/dist-storybook/assets/colors-_6nFGM3e.js +1 -0
  47. package/dist-storybook/assets/date-Cg-Uk_pp.js +1 -0
  48. package/dist-storybook/assets/date-field.stories-Diptwqfv.js +129 -0
  49. package/dist-storybook/assets/date-picker-Dnq_-0Md.js +1 -0
  50. package/dist-storybook/assets/date-picker.stories-BuGWvzFL.js +123 -0
  51. package/dist-storybook/assets/default-error-BcnD8fFO.png +0 -0
  52. package/dist-storybook/assets/dialog.stories-DJ0WsSkA.js +212 -0
  53. package/dist-storybook/assets/dropdown.stories-D6JUYP73.js +200 -0
  54. package/dist-storybook/assets/embla-carousel-react.esm-BYjpaHZ9.js +1 -0
  55. package/dist-storybook/assets/en-Cs9O0XWn.js +15 -0
  56. package/dist-storybook/assets/icon-DdQsMyRa.js +1 -0
  57. package/dist-storybook/assets/icon.stories-B-ZvRzFf.js +365 -0
  58. package/dist-storybook/assets/iframe-CQAwSt4E.js +1071 -0
  59. package/dist-storybook/assets/iframe-yMKl6hJA.css +1 -0
  60. package/dist-storybook/assets/image-C3EsNRhz.js +9 -0
  61. package/dist-storybook/assets/image.stories-C4l8D3ju.js +255 -0
  62. package/dist-storybook/assets/index-B-Ksafg0.js +1 -0
  63. package/dist-storybook/assets/index-BV0AJWP6.js +1 -0
  64. package/dist-storybook/assets/index-CgMRTj-o.js +1 -0
  65. package/dist-storybook/assets/index-DHiZ-gXR.js +1 -0
  66. package/dist-storybook/assets/input-wrapper-BKHgnPy6.js +1 -0
  67. package/dist-storybook/assets/label-DV2iCDmN.js +27 -0
  68. package/dist-storybook/assets/label.stories-BwTIPFXX.js +138 -0
  69. package/dist-storybook/assets/matchers-7Z3WT2CE-Dw4MQV_s.js +14 -0
  70. package/dist-storybook/assets/navigation-bar-vI-FPasP.js +79 -0
  71. package/dist-storybook/assets/navigation-bar.stories-DYuFaJFD.js +73 -0
  72. package/dist-storybook/assets/number-field-CXKmnfKe.js +1 -0
  73. package/dist-storybook/assets/number-field.stories--fn26TJu.js +167 -0
  74. package/dist-storybook/assets/omit-Bsx5nTI0.js +1 -0
  75. package/dist-storybook/assets/option-item-LRh_OyV4.js +1 -0
  76. package/dist-storybook/assets/option-item.stories-snjAvgay.js +66 -0
  77. package/dist-storybook/assets/pagination-DZHoBs_4.js +1 -0
  78. package/dist-storybook/assets/pagination.stories-BoEs0jzS.js +91 -0
  79. package/dist-storybook/assets/pick-BhmhLmLe.js +1 -0
  80. package/dist-storybook/assets/preload-helper-PPVm8Dsz.js +1 -0
  81. package/dist-storybook/assets/radio-B5NJxG_l.js +1 -0
  82. package/dist-storybook/assets/radio.stories-DuN-Awi_.js +183 -0
  83. package/dist-storybook/assets/rating-BdXViYBv.js +1 -0
  84. package/dist-storybook/assets/rating.stories-BCcQjMEx.js +117 -0
  85. package/dist-storybook/assets/react-18-CNyWQ7je.js +9 -0
  86. package/dist-storybook/assets/react-hufnxGVs.js +1 -0
  87. package/dist-storybook/assets/search-field-CQqgFbfg.js +1 -0
  88. package/dist-storybook/assets/search-field.stories-DiCZbhng.js +79 -0
  89. package/dist-storybook/assets/section-content-DGNB4eLN.js +1 -0
  90. package/dist-storybook/assets/section.stories-C2I_kKhu.js +69 -0
  91. package/dist-storybook/assets/sheet.stories-wk1JaKU5.js +152 -0
  92. package/dist-storybook/assets/skeleton-C91JgehG.js +1 -0
  93. package/dist-storybook/assets/skeleton.stories-BCmX-VNr.js +139 -0
  94. package/dist-storybook/assets/store-CPumdfcU.js +1 -0
  95. package/dist-storybook/assets/store-D2RudmNr.js +18 -0
  96. package/dist-storybook/assets/switch-p-aXI-ev.js +1 -0
  97. package/dist-storybook/assets/switch.stories-BqPLNKB9.js +250 -0
  98. package/dist-storybook/assets/tab-bar-CSeCmtIZ.js +31 -0
  99. package/dist-storybook/assets/tab-bar.stories-Cb6v8H2w.js +136 -0
  100. package/dist-storybook/assets/text-area-DwSXyqOe.js +1 -0
  101. package/dist-storybook/assets/text-area.stories-By8bCfgc.js +87 -0
  102. package/dist-storybook/assets/text-field-jK6rpOo2.js +1 -0
  103. package/dist-storybook/assets/text-field.stories-CrWBAhvI.js +92 -0
  104. package/dist-storybook/assets/toast-provider-DurnMJhd.js +9 -0
  105. package/dist-storybook/assets/toast.stories-iWAToAZA.js +201 -0
  106. package/dist-storybook/assets/tooltip-QDdel5My.js +1 -0
  107. package/dist-storybook/assets/tooltip.stories-RC6SuPPD.js +153 -0
  108. package/dist-storybook/assets/typography-DEpAJl_i.js +1 -0
  109. package/dist-storybook/assets/typography.stories-Bu8qFugR.js +202 -0
  110. package/dist-storybook/assets/uploader.stories-B2wW9qVy.js +65 -0
  111. package/dist-storybook/assets/use-app-pause-B_tWHKJK.js +29 -0
  112. package/dist-storybook/assets/use-app-resume--900G-dV.js +29 -0
  113. package/dist-storybook/assets/use-custom-icon-event-3VExRzvC.js +29 -0
  114. package/dist-storybook/assets/use-did-hide-BUsL73ab.js +48 -0
  115. package/dist-storybook/assets/use-did-show-C1-VLDxi.js +49 -0
  116. package/dist-storybook/assets/use-histories-E4E2jJEY.js +50 -0
  117. package/dist-storybook/assets/use-history-o1im8IDj.js +67 -0
  118. package/dist-storybook/assets/use-location-CUEaBO4P.js +56 -0
  119. package/dist-storybook/assets/use-navigate-C4CTuFSZ.js +84 -0
  120. package/dist-storybook/assets/use-navigation-type-Dcz4hgKo.js +44 -0
  121. package/dist-storybook/assets/use-page-config-DSJBVQbq.js +48 -0
  122. package/dist-storybook/assets/use-page-scroll-dY-U1Vv4.js +69 -0
  123. package/dist-storybook/assets/use-page-state-CtNpwGPN.js +79 -0
  124. package/dist-storybook/assets/use-settings-changed-BBJwIHTE.js +29 -0
  125. package/dist-storybook/assets/v-mini-icon-Dn1BmJzb.woff2 +0 -0
  126. package/dist-storybook/assets/visibility-sensor-CwrzJO06.js +1 -0
  127. package/dist-storybook/iframe.html +670 -0
  128. package/dist-storybook/index.html +132 -0
  129. package/dist-storybook/index.json +1 -0
  130. package/dist-storybook/project.json +1 -0
  131. package/dist-storybook/sb-addons/a11y-2/manager-bundle.js +5 -0
  132. package/dist-storybook/sb-addons/docs-1/manager-bundle.js +151 -0
  133. package/dist-storybook/sb-addons/storybook-build-3/manager-bundle.js +3 -0
  134. package/dist-storybook/sb-addons/storybook-core-server-presets-0/common-manager-bundle.js +971 -0
  135. package/dist-storybook/sb-manager/globals-module-info.js +799 -0
  136. package/dist-storybook/sb-manager/globals-runtime.js +69791 -0
  137. package/dist-storybook/sb-manager/globals.js +34 -0
  138. package/dist-storybook/sb-manager/runtime.js +13198 -0
  139. package/dist-storybook/stories-data.json +374 -0
  140. package/dist-storybook/vite-inject-mocker-entry.js +2 -0
  141. package/package.json +1 -1
@@ -0,0 +1,186 @@
1
+ import{j as e,r as i}from"./iframe-CQAwSt4E.js";import{T as v,S as h,M as l,P as B,a as I}from"./blocks-BuaOUtiH.js";import{B as s}from"./bottom-tab-bar-CtcTAxuI.js";import{t}from"./store-D2RudmNr.js";import"./preload-helper-PPVm8Dsz.js";import"./index-DHiZ-gXR.js";import"./icon-DdQsMyRa.js";import"./colors-_6nFGM3e.js";import"./classname-CUR_zgkh.js";import"./typography-DEpAJl_i.js";const T=()=>{const o=`
2
+ ## ${t("common.table.title")}
3
+
4
+ | ${t("common.table.name")} | ${t("common.table.type")} | ${t("common.table.required")} | ${t("common.table.description")} |
5
+ | :--- | :--- | :--- | :--- |
6
+ | \`items\` | \`IBottomTabBarItem[]\` | ${t("common.table.yes")} | ${t("components.bottomTabBar.itemsDescription")} |
7
+ | \`activeId\` | \`string\` | ${t("common.table.yes")} | ${t("components.bottomTabBar.activeIdDescription")} |
8
+ | \`indicator\` | \`boolean\` | ${t("common.table.no")} | ${t("components.bottomTabBar.indicatorDescription")} |
9
+ | \`setCssVariable\` | \`boolean\` | ${t("common.table.no")} | ${t("components.bottomTabBar.setCssVariableDescription")} |
10
+ | \`safeAreaBottomOffset\` | \`boolean\` | ${t("common.table.no")} | ${t("components.bottomTabBar.safeAreaBottomOffsetDescription")} |
11
+ | \`className\` | \`string\` | ${t("common.table.no")} | ${t("components.bottomTabBar.classNameDescription")} |
12
+ | \`onItemClick\` | \`(item: IBottomTabBarItem, index: number) => void\` | ${t("common.table.no")} | ${t("components.bottomTabBar.onItemClickDescription")} |
13
+ | \`...props\` | \`ComponentProps<'div'>\` | ${t("common.table.no")} | ${t("components.bottomTabBar.propsDescription")} |
14
+ `;return e.jsxs(e.Fragment,{children:[e.jsx(v,{}),e.jsx(h,{}),e.jsx(l,{children:t("components.bottomTabBar.description")}),e.jsx(B,{}),e.jsx(l,{children:o}),e.jsx(I,{})]})},D={title:"Components/BottomTabBar",component:s,parameters:{layout:"fullscreen",docs:{page:T}},tags:["autodocs"],argTypes:{items:{control:!1,description:t("components.bottomTabBar.argTypes.itemsDescription"),table:{type:{summary:"IBottomTabBarItem[]"}}},activeId:{control:"text",description:t("components.bottomTabBar.argTypes.activeIdDescription"),table:{type:{summary:"string"}}},indicator:{control:"boolean",description:t("components.bottomTabBar.argTypes.indicatorDescription"),table:{type:{summary:"boolean"},defaultValue:{summary:"true"}}},setCssVariable:{control:"boolean",description:t("components.bottomTabBar.argTypes.setCssVariableDescription"),table:{type:{summary:"boolean"}}},safeAreaBottomOffset:{control:"boolean",description:t("components.bottomTabBar.argTypes.safeAreaBottomOffsetDescription"),table:{type:{summary:"boolean"},defaultValue:{summary:"true"}}},onItemClick:{action:"item-clicked",description:t("components.bottomTabBar.argTypes.onItemClickDescription"),table:{type:{summary:"(item: IBottomTabBarItem, index: number) => void"}}}}},r={storyName:t("components.bottomTabBar.stories.default.title"),render:()=>{const[o,n]=i.useState("1");return e.jsxs("div",{style:{position:"relative",height:"100vh"},children:[e.jsx("div",{style:{padding:"20px"},children:e.jsx("p",{children:t("components.bottomTabBar.stories.default.content")})}),e.jsx(s,{activeId:o,onItemClick:a=>n(a.id),items:[{id:"1",name:t("components.bottomTabBar.stories.tabs.home")},{id:"2",name:t("components.bottomTabBar.stories.tabs.search")},{id:"3",name:t("components.bottomTabBar.stories.tabs.profile")}]})]})}},m={storyName:t("components.bottomTabBar.stories.withIcons.title"),render:()=>{const[o,n]=i.useState("1");return e.jsxs("div",{style:{position:"relative",height:"100vh"},children:[e.jsx("div",{style:{padding:"20px"},children:e.jsx("p",{children:t("components.bottomTabBar.stories.withIcons.content")})}),e.jsx(s,{activeId:o,onItemClick:a=>n(a.id),items:[{id:"1",name:t("components.bottomTabBar.stories.tabs.home"),icon:{name:"placeholder"}},{id:"2",name:t("components.bottomTabBar.stories.tabs.search"),icon:{name:"placeholder"}},{id:"3",name:t("components.bottomTabBar.stories.tabs.profile"),icon:{name:"placeholder"}}]})]})}},c={storyName:t("components.bottomTabBar.stories.withActiveIcons.title"),render:()=>{const[o,n]=i.useState("1");return e.jsxs("div",{style:{position:"relative",height:"100vh"},children:[e.jsx("div",{style:{padding:"20px"},children:e.jsx("p",{children:t("components.bottomTabBar.stories.withActiveIcons.content")})}),e.jsx(s,{activeId:o,onItemClick:a=>n(a.id),items:[{id:"1",name:t("components.bottomTabBar.stories.tabs.home"),icon:{name:"placeholder",type:"outline"},activeIcon:{name:"placeholder",type:"fill"}},{id:"2",name:t("components.bottomTabBar.stories.tabs.search"),icon:{name:"placeholder",type:"outline"},activeIcon:{name:"placeholder",type:"fill"}},{id:"3",name:t("components.bottomTabBar.stories.tabs.profile"),icon:{name:"placeholder",type:"outline"},activeIcon:{name:"placeholder",type:"fill"}}]})]})}},d={storyName:t("components.bottomTabBar.stories.withoutIndicator.title"),render:()=>{const[o,n]=i.useState("1");return e.jsxs("div",{style:{position:"relative",height:"100vh"},children:[e.jsx("div",{style:{padding:"20px"},children:e.jsx("p",{children:t("components.bottomTabBar.stories.withoutIndicator.content")})}),e.jsx(s,{activeId:o,onItemClick:a=>n(a.id),indicator:!1,items:[{id:"1",name:t("components.bottomTabBar.stories.tabs.tab1")},{id:"2",name:t("components.bottomTabBar.stories.tabs.tab2")},{id:"3",name:t("components.bottomTabBar.stories.tabs.tab3")}]})]})}},p={storyName:t("components.bottomTabBar.stories.interactive.title"),render:()=>{const o=[{id:"1",name:t("components.bottomTabBar.stories.tabs.home"),icon:{name:"placeholder"}},{id:"2",name:t("components.bottomTabBar.stories.tabs.search"),icon:{name:"placeholder"}},{id:"3",name:t("components.bottomTabBar.stories.tabs.profile"),icon:{name:"placeholder"}}],[n,a]=i.useState("1");return e.jsxs("div",{style:{position:"relative",height:"100vh"},children:[e.jsx("div",{style:{padding:"20px"},children:e.jsx("p",{children:t("components.bottomTabBar.stories.interactive.activeTab",{tabName:o.find(b=>b.id===n)?.name||""})})}),e.jsx(s,{activeId:n,onItemClick:b=>a(b.id),items:o})]})}};r.parameters={...r.parameters,docs:{...r.parameters?.docs,source:{originalSource:`{
15
+ storyName: t('components.bottomTabBar.stories.default.title'),
16
+ render: () => {
17
+ const [activeId, setActiveId] = useState('1');
18
+ return <div style={{
19
+ position: 'relative',
20
+ height: '100vh'
21
+ }}>
22
+ <div style={{
23
+ padding: '20px'
24
+ }}>
25
+ <p>{t('components.bottomTabBar.stories.default.content')}</p>
26
+ </div>
27
+ <BottomTabBar activeId={activeId} onItemClick={item => setActiveId(item.id)} items={[{
28
+ id: '1',
29
+ name: t('components.bottomTabBar.stories.tabs.home')
30
+ }, {
31
+ id: '2',
32
+ name: t('components.bottomTabBar.stories.tabs.search')
33
+ }, {
34
+ id: '3',
35
+ name: t('components.bottomTabBar.stories.tabs.profile')
36
+ }]} />
37
+ </div>;
38
+ }
39
+ }`,...r.parameters?.docs?.source}}};m.parameters={...m.parameters,docs:{...m.parameters?.docs,source:{originalSource:`{
40
+ storyName: t('components.bottomTabBar.stories.withIcons.title'),
41
+ render: () => {
42
+ const [activeId, setActiveId] = useState('1');
43
+ return <div style={{
44
+ position: 'relative',
45
+ height: '100vh'
46
+ }}>
47
+ <div style={{
48
+ padding: '20px'
49
+ }}>
50
+ <p>{t('components.bottomTabBar.stories.withIcons.content')}</p>
51
+ </div>
52
+ <BottomTabBar activeId={activeId} onItemClick={item => setActiveId(item.id)} items={[{
53
+ id: '1',
54
+ name: t('components.bottomTabBar.stories.tabs.home'),
55
+ icon: {
56
+ name: 'placeholder'
57
+ }
58
+ }, {
59
+ id: '2',
60
+ name: t('components.bottomTabBar.stories.tabs.search'),
61
+ icon: {
62
+ name: 'placeholder'
63
+ }
64
+ }, {
65
+ id: '3',
66
+ name: t('components.bottomTabBar.stories.tabs.profile'),
67
+ icon: {
68
+ name: 'placeholder'
69
+ }
70
+ }]} />
71
+ </div>;
72
+ }
73
+ }`,...m.parameters?.docs?.source}}};c.parameters={...c.parameters,docs:{...c.parameters?.docs,source:{originalSource:`{
74
+ storyName: t('components.bottomTabBar.stories.withActiveIcons.title'),
75
+ render: () => {
76
+ const [activeId, setActiveId] = useState('1');
77
+ return <div style={{
78
+ position: 'relative',
79
+ height: '100vh'
80
+ }}>
81
+ <div style={{
82
+ padding: '20px'
83
+ }}>
84
+ <p>{t('components.bottomTabBar.stories.withActiveIcons.content')}</p>
85
+ </div>
86
+ <BottomTabBar activeId={activeId} onItemClick={item => setActiveId(item.id)} items={[{
87
+ id: '1',
88
+ name: t('components.bottomTabBar.stories.tabs.home'),
89
+ icon: {
90
+ name: 'placeholder',
91
+ type: 'outline'
92
+ },
93
+ activeIcon: {
94
+ name: 'placeholder',
95
+ type: 'fill'
96
+ }
97
+ }, {
98
+ id: '2',
99
+ name: t('components.bottomTabBar.stories.tabs.search'),
100
+ icon: {
101
+ name: 'placeholder',
102
+ type: 'outline'
103
+ },
104
+ activeIcon: {
105
+ name: 'placeholder',
106
+ type: 'fill'
107
+ }
108
+ }, {
109
+ id: '3',
110
+ name: t('components.bottomTabBar.stories.tabs.profile'),
111
+ icon: {
112
+ name: 'placeholder',
113
+ type: 'outline'
114
+ },
115
+ activeIcon: {
116
+ name: 'placeholder',
117
+ type: 'fill'
118
+ }
119
+ }]} />
120
+ </div>;
121
+ }
122
+ }`,...c.parameters?.docs?.source}}};d.parameters={...d.parameters,docs:{...d.parameters?.docs,source:{originalSource:`{
123
+ storyName: t('components.bottomTabBar.stories.withoutIndicator.title'),
124
+ render: () => {
125
+ const [activeId, setActiveId] = useState('1');
126
+ return <div style={{
127
+ position: 'relative',
128
+ height: '100vh'
129
+ }}>
130
+ <div style={{
131
+ padding: '20px'
132
+ }}>
133
+ <p>{t('components.bottomTabBar.stories.withoutIndicator.content')}</p>
134
+ </div>
135
+ <BottomTabBar activeId={activeId} onItemClick={item => setActiveId(item.id)} indicator={false} items={[{
136
+ id: '1',
137
+ name: t('components.bottomTabBar.stories.tabs.tab1')
138
+ }, {
139
+ id: '2',
140
+ name: t('components.bottomTabBar.stories.tabs.tab2')
141
+ }, {
142
+ id: '3',
143
+ name: t('components.bottomTabBar.stories.tabs.tab3')
144
+ }]} />
145
+ </div>;
146
+ }
147
+ }`,...d.parameters?.docs?.source}}};p.parameters={...p.parameters,docs:{...p.parameters?.docs,source:{originalSource:`{
148
+ storyName: t('components.bottomTabBar.stories.interactive.title'),
149
+ render: () => {
150
+ const items = [{
151
+ id: '1',
152
+ name: t('components.bottomTabBar.stories.tabs.home'),
153
+ icon: {
154
+ name: 'placeholder'
155
+ }
156
+ }, {
157
+ id: '2',
158
+ name: t('components.bottomTabBar.stories.tabs.search'),
159
+ icon: {
160
+ name: 'placeholder'
161
+ }
162
+ }, {
163
+ id: '3',
164
+ name: t('components.bottomTabBar.stories.tabs.profile'),
165
+ icon: {
166
+ name: 'placeholder'
167
+ }
168
+ }] as IBottomTabBarItem[];
169
+ const [activeId, setActiveId] = useState('1');
170
+ return <div style={{
171
+ position: 'relative',
172
+ height: '100vh'
173
+ }}>
174
+ <div style={{
175
+ padding: '20px'
176
+ }}>
177
+ <p>
178
+ {t('components.bottomTabBar.stories.interactive.activeTab', {
179
+ tabName: items.find(item => item.id === activeId)?.name || ''
180
+ })}
181
+ </p>
182
+ </div>
183
+ <BottomTabBar activeId={activeId} onItemClick={item => setActiveId(item.id)} items={items} />
184
+ </div>;
185
+ }
186
+ }`,...p.parameters?.docs?.source}}};const k=["Default","WithIcons","WithActiveIcons","WithoutIndicator","Interactive"];export{r as Default,p as Interactive,c as WithActiveIcons,m as WithIcons,d as WithoutIndicator,k as __namedExportsOrder,D as default};
@@ -0,0 +1 @@
1
+ import{j as u}from"./iframe-CQAwSt4E.js";import{r as N}from"./icon-DdQsMyRa.js";import{c as f,g as b}from"./classname-CUR_zgkh.js";import{T as j}from"./typography-DEpAJl_i.js";const v={medium:"small",large:"base"},e=b("button"),g=({shape:p="rounded",size:m="medium",type:c="solid",theme:a="default",disabled:i,loading:s,children:r,className:$,leadingIcon:o,trailingIcon:l,htmlType:_,block:x,...d})=>{a=a==="default"?"brand":a;const n=(t,y)=>t?u.jsx("span",{className:f(`${e}__icon`,y),children:N(t)}):null;return u.jsxs("button",{...d,onClick:t=>{i||s||d.onClick?.(t)},disabled:i,type:_,className:f(e,{[`${e}--${p}`]:!0,[`${e}--${m}`]:!0,[`${e}--${c}`]:!0,[`${e}--block`]:x,[`${e}--theme-${a}`]:!0,[`${e}--icon-only`]:!r&&(o&&!l||!o&&l),[`${e}--loading`]:s},$),children:[u.jsx("span",{className:`${e}__overlay`}),!!s&&n({name:"loader",animation:"spin"},`${e}__icon--loading`),!s&&n(o,`${e}__icon--leading`),!!r&&u.jsx(j,{size:v[m],weight:"medium",children:r}),n(l,`${e}__icon--trailing`)]})};g.__docgenInfo={description:"",methods:[],displayName:"Button",props:{shape:{defaultValue:{value:"'rounded'",computed:!1},required:!1},size:{defaultValue:{value:"'medium'",computed:!1},required:!1},type:{defaultValue:{value:"'solid'",computed:!1},required:!1},theme:{defaultValue:{value:"'default'",computed:!1},required:!1}}};export{g as B};
@@ -0,0 +1,287 @@
1
+ import{j as e}from"./iframe-CQAwSt4E.js";import{T as y,S as x,M as u,P as h,a as g}from"./blocks-BuaOUtiH.js";import{B as o}from"./button-CL7GeC23.js";import{t}from"./store-D2RudmNr.js";import"./preload-helper-PPVm8Dsz.js";import"./index-DHiZ-gXR.js";import"./icon-DdQsMyRa.js";import"./colors-_6nFGM3e.js";import"./classname-CUR_zgkh.js";import"./typography-DEpAJl_i.js";const f=()=>{const b=`
2
+ ## ${t("common.table.title")}
3
+
4
+ | ${t("common.table.name")} | ${t("common.table.type")} | ${t("common.table.required")} | ${t("common.table.description")} |
5
+ | :--- | :--- | :--- | :--- |
6
+ | \`shape\` | \`'rounded' | 'pill'\` | ${t("common.table.no")} | ${t("components.button.shapeDescription")} |
7
+ | \`size\` | \`'large' | 'medium'\` | ${t("common.table.no")} | ${t("components.button.sizeDescription")} |
8
+ | \`type\` | \`'solid' | 'solid-subtle' | 'outline' | 'ghost'\` | ${t("common.table.no")} | ${t("components.button.typeDescription")} |
9
+ | \`theme\` | \`'default' | 'brand' | 'neutral' | 'neutral-inverse'\` | ${t("common.table.no")} | ${t("components.button.themeDescription")} |
10
+ | \`disabled\` | \`boolean\` | ${t("common.table.no")} | ${t("components.button.disabledDescription")} |
11
+ | \`loading\` | \`boolean\` | ${t("common.table.no")} | ${t("components.button.loadingDescription")} |
12
+ | \`leadingIcon\` | \`IIconProps | ReactNode\` | ${t("common.table.no")} | ${t("components.button.leadingIconDescription")} |
13
+ | \`trailingIcon\` | \`IIconProps | ReactNode\` | ${t("common.table.no")} | ${t("components.button.trailingIconDescription")} |
14
+ | \`htmlType\` | \`'button' | 'submit' | 'reset'\` | ${t("common.table.no")} | ${t("components.button.htmlTypeDescription")} |
15
+ | \`block\` | \`boolean\` | ${t("common.table.no")} | ${t("components.button.blockDescription")} |
16
+ | \`children\` | \`ReactNode\` | ${t("common.table.no")} | ${t("components.button.childrenDescription")} |
17
+ | \`className\` | \`string\` | ${t("common.table.no")} | ${t("components.button.classNameDescription")} |
18
+ | \`...props\` | \`ComponentPropsWithRef<'button'>\` | ${t("common.table.no")} | ${t("components.button.propsDescription")} |
19
+ `;return e.jsxs(e.Fragment,{children:[e.jsx(y,{}),e.jsx(x,{}),e.jsx(u,{children:t("components.button.description")}),e.jsx(h,{}),e.jsx(u,{children:b}),e.jsx(g,{})]})},T={title:"Components/Button",component:o,parameters:{layout:"padded",docs:{page:f}},tags:["autodocs"],argTypes:{shape:{control:"select",options:["rounded","pill"],description:t("components.button.argTypes.shapeDescription"),table:{type:{summary:"IButtonShape"},defaultValue:{summary:"rounded"}}},size:{control:"select",options:["large","medium"],description:t("components.button.argTypes.sizeDescription"),table:{type:{summary:"IButtonSize"},defaultValue:{summary:"medium"}}},type:{control:"select",options:["solid","solid-subtle","outline","ghost"],description:t("components.button.argTypes.typeDescription"),table:{type:{summary:"IButtonType"},defaultValue:{summary:"solid"}}},theme:{control:"select",options:["default","brand","neutral","neutral-inverse"],description:t("components.button.argTypes.themeDescription"),table:{type:{summary:"IButtonTheme"},defaultValue:{summary:"default"}}},disabled:{control:"boolean",description:t("components.button.argTypes.disabledDescription"),table:{type:{summary:"boolean"}}},loading:{control:"boolean",description:t("components.button.argTypes.loadingDescription"),table:{type:{summary:"boolean"}}},leadingIcon:{control:!1,description:t("components.button.argTypes.leadingIconDescription"),table:{type:{summary:"IIconProps | ReactNode"}}},trailingIcon:{control:!1,description:t("components.button.argTypes.trailingIconDescription"),table:{type:{summary:"IIconProps | ReactNode"}}},htmlType:{control:"select",options:["button","submit","reset"],description:t("components.button.argTypes.htmlTypeDescription"),table:{type:{summary:'"button" | "submit" | "reset"'}}},block:{control:"boolean",description:t("components.button.argTypes.blockDescription"),table:{type:{summary:"boolean"}}},children:{control:"text",description:t("components.button.argTypes.childrenDescription"),table:{type:{summary:"ReactNode"}}}}},n={storyName:t("components.button.stories.default.title"),args:{children:t("components.button.stories.default.label")}},s={storyName:t("components.button.stories.themes.title"),render:()=>e.jsxs("div",{style:{display:"flex",gap:"12px",flexWrap:"wrap"},children:[e.jsx(o,{theme:"brand",children:t("components.button.stories.themes.brand")}),e.jsx(o,{theme:"neutral",children:t("components.button.stories.themes.neutral")}),e.jsx(o,{theme:"neutral-inverse",children:t("components.button.stories.themes.neutralInverse")})]})},i={storyName:t("components.button.stories.types.title"),render:()=>e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"16px"},children:[e.jsxs("div",{style:{display:"flex",gap:"12px",flexWrap:"wrap"},children:[e.jsx(o,{type:"solid",children:t("components.button.stories.types.solid")}),e.jsx(o,{type:"solid-subtle",children:t("components.button.stories.types.solidSubtle")}),e.jsx(o,{type:"outline",children:t("components.button.stories.types.outline")}),e.jsx(o,{type:"ghost",children:t("components.button.stories.types.ghost")})]}),e.jsxs("div",{style:{display:"flex",gap:"12px",flexWrap:"wrap"},children:[e.jsx(o,{type:"solid",theme:"neutral",children:t("components.button.stories.types.solid")}),e.jsx(o,{type:"solid-subtle",theme:"neutral",children:t("components.button.stories.types.solidSubtle")}),e.jsx(o,{type:"outline",theme:"neutral",children:t("components.button.stories.types.outline")}),e.jsx(o,{type:"ghost",theme:"neutral",children:t("components.button.stories.types.ghost")})]})]})},r={storyName:t("components.button.stories.sizes.title"),render:()=>e.jsxs("div",{style:{display:"flex",gap:"12px",alignItems:"center"},children:[e.jsx(o,{size:"medium",children:t("components.button.stories.sizes.medium")}),e.jsx(o,{size:"large",children:t("components.button.stories.sizes.large")})]})},l={storyName:t("components.button.stories.shapes.title"),render:()=>e.jsxs("div",{style:{display:"flex",gap:"12px",flexWrap:"wrap"},children:[e.jsx(o,{shape:"rounded",children:t("components.button.stories.shapes.rounded")}),e.jsx(o,{shape:"pill",children:t("components.button.stories.shapes.pill")})]})},a={storyName:t("components.button.stories.withIcons.title"),render:()=>e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"16px"},children:[e.jsxs("div",{style:{display:"flex",gap:"12px",flexWrap:"wrap"},children:[e.jsx(o,{leadingIcon:{name:"placeholder"},children:t("components.button.stories.icons.leading")}),e.jsx(o,{trailingIcon:{name:"placeholder"},children:t("components.button.stories.icons.trailing")}),e.jsx(o,{leadingIcon:{name:"placeholder"},trailingIcon:{name:"placeholder"},children:t("components.button.stories.icons.both")})]}),e.jsxs("div",{style:{display:"flex",gap:"12px",flexWrap:"wrap"},children:[e.jsx(o,{leadingIcon:{name:"placeholder"}}),e.jsx(o,{trailingIcon:{name:"placeholder"}})]})]})},p={storyName:t("components.button.stories.states.title"),render:()=>e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"16px"},children:[e.jsxs("div",{style:{display:"flex",gap:"12px",flexWrap:"wrap"},children:[e.jsx(o,{children:t("components.button.stories.states.default")}),e.jsx(o,{disabled:!0,children:t("components.button.stories.states.disabled")}),e.jsx(o,{loading:!0,children:t("components.button.stories.states.loading")}),e.jsx(o,{disabled:!0,loading:!0,children:t("components.button.stories.states.disabledLoading")})]}),e.jsxs("div",{style:{display:"flex",gap:"12px",flexWrap:"wrap"},children:[e.jsx(o,{type:"outline",children:t("components.button.stories.states.default")}),e.jsx(o,{type:"outline",disabled:!0,children:t("components.button.stories.states.disabled")}),e.jsx(o,{type:"outline",loading:!0,children:t("components.button.stories.states.loading")})]})]})},c={storyName:t("components.button.stories.blockButton.title"),render:()=>e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"12px",maxWidth:"400px"},children:[e.jsx(o,{block:!0,children:t("components.button.stories.block.fullWidth")}),e.jsx(o,{block:!0,type:"outline",children:t("components.button.stories.block.fullWidthOutline")}),e.jsx(o,{block:!0,loading:!0,children:t("components.button.stories.block.fullWidthLoading")})]})},d={storyName:t("components.button.stories.completeExample.title"),render:()=>e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"24px"},children:[e.jsxs("div",{children:[e.jsx("h3",{style:{marginBottom:"12px"},children:t("components.button.stories.complete.primaryActions")}),e.jsxs("div",{style:{display:"flex",gap:"12px",flexWrap:"wrap"},children:[e.jsx(o,{type:"solid",size:"large",leadingIcon:{name:"placeholder"},children:t("components.button.stories.complete.saveChanges")}),e.jsx(o,{type:"outline",size:"large",children:t("components.button.stories.complete.cancel")})]})]}),e.jsxs("div",{children:[e.jsx("h3",{style:{marginBottom:"12px"},children:t("components.button.stories.complete.secondaryActions")}),e.jsxs("div",{style:{display:"flex",gap:"12px",flexWrap:"wrap"},children:[e.jsx(o,{type:"solid-subtle",theme:"neutral",children:t("components.button.stories.complete.secondary")}),e.jsx(o,{type:"ghost",theme:"neutral",children:t("components.button.stories.complete.tertiary")})]})]}),e.jsxs("div",{children:[e.jsx("h3",{style:{marginBottom:"12px"},children:t("components.button.stories.complete.iconButtons")}),e.jsxs("div",{style:{display:"flex",gap:"12px",flexWrap:"wrap"},children:[e.jsx(o,{leadingIcon:{name:"placeholder"}}),e.jsx(o,{trailingIcon:{name:"placeholder"}}),e.jsx(o,{leadingIcon:{name:"placeholder"},shape:"pill"})]})]})]})},m={storyName:t("components.button.stories.interactive.title"),args:{children:t("components.button.stories.interactive.label"),shape:"rounded",size:"medium",type:"solid",theme:"default",disabled:!1,loading:!1,block:!1}};n.parameters={...n.parameters,docs:{...n.parameters?.docs,source:{originalSource:`{
20
+ storyName: t('components.button.stories.default.title'),
21
+ args: {
22
+ children: t('components.button.stories.default.label')
23
+ }
24
+ }`,...n.parameters?.docs?.source}}};s.parameters={...s.parameters,docs:{...s.parameters?.docs,source:{originalSource:`{
25
+ storyName: t('components.button.stories.themes.title'),
26
+ render: () => <div style={{
27
+ display: 'flex',
28
+ gap: '12px',
29
+ flexWrap: 'wrap'
30
+ }}>
31
+ <Button theme="brand">
32
+ {t('components.button.stories.themes.brand')}
33
+ </Button>
34
+ <Button theme="neutral">
35
+ {t('components.button.stories.themes.neutral')}
36
+ </Button>
37
+ <Button theme="neutral-inverse">
38
+ {t('components.button.stories.themes.neutralInverse')}
39
+ </Button>
40
+ </div>
41
+ }`,...s.parameters?.docs?.source}}};i.parameters={...i.parameters,docs:{...i.parameters?.docs,source:{originalSource:`{
42
+ storyName: t('components.button.stories.types.title'),
43
+ render: () => <div style={{
44
+ display: 'flex',
45
+ flexDirection: 'column',
46
+ gap: '16px'
47
+ }}>
48
+ <div style={{
49
+ display: 'flex',
50
+ gap: '12px',
51
+ flexWrap: 'wrap'
52
+ }}>
53
+ <Button type="solid">
54
+ {t('components.button.stories.types.solid')}
55
+ </Button>
56
+ <Button type="solid-subtle">
57
+ {t('components.button.stories.types.solidSubtle')}
58
+ </Button>
59
+ <Button type="outline">
60
+ {t('components.button.stories.types.outline')}
61
+ </Button>
62
+ <Button type="ghost">
63
+ {t('components.button.stories.types.ghost')}
64
+ </Button>
65
+ </div>
66
+ <div style={{
67
+ display: 'flex',
68
+ gap: '12px',
69
+ flexWrap: 'wrap'
70
+ }}>
71
+ <Button type="solid" theme="neutral">
72
+ {t('components.button.stories.types.solid')}
73
+ </Button>
74
+ <Button type="solid-subtle" theme="neutral">
75
+ {t('components.button.stories.types.solidSubtle')}
76
+ </Button>
77
+ <Button type="outline" theme="neutral">
78
+ {t('components.button.stories.types.outline')}
79
+ </Button>
80
+ <Button type="ghost" theme="neutral">
81
+ {t('components.button.stories.types.ghost')}
82
+ </Button>
83
+ </div>
84
+ </div>
85
+ }`,...i.parameters?.docs?.source}}};r.parameters={...r.parameters,docs:{...r.parameters?.docs,source:{originalSource:`{
86
+ storyName: t('components.button.stories.sizes.title'),
87
+ render: () => <div style={{
88
+ display: 'flex',
89
+ gap: '12px',
90
+ alignItems: 'center'
91
+ }}>
92
+ <Button size="medium">
93
+ {t('components.button.stories.sizes.medium')}
94
+ </Button>
95
+ <Button size="large">{t('components.button.stories.sizes.large')}</Button>
96
+ </div>
97
+ }`,...r.parameters?.docs?.source}}};l.parameters={...l.parameters,docs:{...l.parameters?.docs,source:{originalSource:`{
98
+ storyName: t('components.button.stories.shapes.title'),
99
+ render: () => <div style={{
100
+ display: 'flex',
101
+ gap: '12px',
102
+ flexWrap: 'wrap'
103
+ }}>
104
+ <Button shape="rounded">
105
+ {t('components.button.stories.shapes.rounded')}
106
+ </Button>
107
+ <Button shape="pill">{t('components.button.stories.shapes.pill')}</Button>
108
+ </div>
109
+ }`,...l.parameters?.docs?.source}}};a.parameters={...a.parameters,docs:{...a.parameters?.docs,source:{originalSource:`{
110
+ storyName: t('components.button.stories.withIcons.title'),
111
+ render: () => <div style={{
112
+ display: 'flex',
113
+ flexDirection: 'column',
114
+ gap: '16px'
115
+ }}>
116
+ <div style={{
117
+ display: 'flex',
118
+ gap: '12px',
119
+ flexWrap: 'wrap'
120
+ }}>
121
+ <Button leadingIcon={{
122
+ name: 'placeholder'
123
+ }}>
124
+ {t('components.button.stories.icons.leading')}
125
+ </Button>
126
+ <Button trailingIcon={{
127
+ name: 'placeholder'
128
+ }}>
129
+ {t('components.button.stories.icons.trailing')}
130
+ </Button>
131
+ <Button leadingIcon={{
132
+ name: 'placeholder'
133
+ }} trailingIcon={{
134
+ name: 'placeholder'
135
+ }}>
136
+ {t('components.button.stories.icons.both')}
137
+ </Button>
138
+ </div>
139
+ <div style={{
140
+ display: 'flex',
141
+ gap: '12px',
142
+ flexWrap: 'wrap'
143
+ }}>
144
+ <Button leadingIcon={{
145
+ name: 'placeholder'
146
+ }} />
147
+ <Button trailingIcon={{
148
+ name: 'placeholder'
149
+ }} />
150
+ </div>
151
+ </div>
152
+ }`,...a.parameters?.docs?.source}}};p.parameters={...p.parameters,docs:{...p.parameters?.docs,source:{originalSource:`{
153
+ storyName: t('components.button.stories.states.title'),
154
+ render: () => <div style={{
155
+ display: 'flex',
156
+ flexDirection: 'column',
157
+ gap: '16px'
158
+ }}>
159
+ <div style={{
160
+ display: 'flex',
161
+ gap: '12px',
162
+ flexWrap: 'wrap'
163
+ }}>
164
+ <Button>{t('components.button.stories.states.default')}</Button>
165
+ <Button disabled>
166
+ {t('components.button.stories.states.disabled')}
167
+ </Button>
168
+ <Button loading>{t('components.button.stories.states.loading')}</Button>
169
+ <Button disabled loading>
170
+ {t('components.button.stories.states.disabledLoading')}
171
+ </Button>
172
+ </div>
173
+ <div style={{
174
+ display: 'flex',
175
+ gap: '12px',
176
+ flexWrap: 'wrap'
177
+ }}>
178
+ <Button type="outline">
179
+ {t('components.button.stories.states.default')}
180
+ </Button>
181
+ <Button type="outline" disabled>
182
+ {t('components.button.stories.states.disabled')}
183
+ </Button>
184
+ <Button type="outline" loading>
185
+ {t('components.button.stories.states.loading')}
186
+ </Button>
187
+ </div>
188
+ </div>
189
+ }`,...p.parameters?.docs?.source}}};c.parameters={...c.parameters,docs:{...c.parameters?.docs,source:{originalSource:`{
190
+ storyName: t('components.button.stories.blockButton.title'),
191
+ render: () => <div style={{
192
+ display: 'flex',
193
+ flexDirection: 'column',
194
+ gap: '12px',
195
+ maxWidth: '400px'
196
+ }}>
197
+ <Button block>{t('components.button.stories.block.fullWidth')}</Button>
198
+ <Button block type="outline">
199
+ {t('components.button.stories.block.fullWidthOutline')}
200
+ </Button>
201
+ <Button block loading>
202
+ {t('components.button.stories.block.fullWidthLoading')}
203
+ </Button>
204
+ </div>
205
+ }`,...c.parameters?.docs?.source}}};d.parameters={...d.parameters,docs:{...d.parameters?.docs,source:{originalSource:`{
206
+ storyName: t('components.button.stories.completeExample.title'),
207
+ render: () => <div style={{
208
+ display: 'flex',
209
+ flexDirection: 'column',
210
+ gap: '24px'
211
+ }}>
212
+ <div>
213
+ <h3 style={{
214
+ marginBottom: '12px'
215
+ }}>
216
+ {t('components.button.stories.complete.primaryActions')}
217
+ </h3>
218
+ <div style={{
219
+ display: 'flex',
220
+ gap: '12px',
221
+ flexWrap: 'wrap'
222
+ }}>
223
+ <Button type="solid" size="large" leadingIcon={{
224
+ name: 'placeholder'
225
+ }}>
226
+ {t('components.button.stories.complete.saveChanges')}
227
+ </Button>
228
+ <Button type="outline" size="large">
229
+ {t('components.button.stories.complete.cancel')}
230
+ </Button>
231
+ </div>
232
+ </div>
233
+ <div>
234
+ <h3 style={{
235
+ marginBottom: '12px'
236
+ }}>
237
+ {t('components.button.stories.complete.secondaryActions')}
238
+ </h3>
239
+ <div style={{
240
+ display: 'flex',
241
+ gap: '12px',
242
+ flexWrap: 'wrap'
243
+ }}>
244
+ <Button type="solid-subtle" theme="neutral">
245
+ {t('components.button.stories.complete.secondary')}
246
+ </Button>
247
+ <Button type="ghost" theme="neutral">
248
+ {t('components.button.stories.complete.tertiary')}
249
+ </Button>
250
+ </div>
251
+ </div>
252
+ <div>
253
+ <h3 style={{
254
+ marginBottom: '12px'
255
+ }}>
256
+ {t('components.button.stories.complete.iconButtons')}
257
+ </h3>
258
+ <div style={{
259
+ display: 'flex',
260
+ gap: '12px',
261
+ flexWrap: 'wrap'
262
+ }}>
263
+ <Button leadingIcon={{
264
+ name: 'placeholder'
265
+ }} />
266
+ <Button trailingIcon={{
267
+ name: 'placeholder'
268
+ }} />
269
+ <Button leadingIcon={{
270
+ name: 'placeholder'
271
+ }} shape="pill" />
272
+ </div>
273
+ </div>
274
+ </div>
275
+ }`,...d.parameters?.docs?.source}}};m.parameters={...m.parameters,docs:{...m.parameters?.docs,source:{originalSource:`{
276
+ storyName: t('components.button.stories.interactive.title'),
277
+ args: {
278
+ children: t('components.button.stories.interactive.label'),
279
+ shape: 'rounded',
280
+ size: 'medium',
281
+ type: 'solid',
282
+ theme: 'default',
283
+ disabled: false,
284
+ loading: false,
285
+ block: false
286
+ }
287
+ }`,...m.parameters?.docs?.source}}};const k=["Default","Themes","Types","Sizes","Shapes","WithIcons","States","BlockButton","CompleteExample","Interactive"];export{c as BlockButton,d as CompleteExample,n as Default,m as Interactive,l as Shapes,r as Sizes,p as States,s as Themes,i as Types,a as WithIcons,k as __namedExportsOrder,T as default};
@@ -0,0 +1 @@
1
+ import{r as b,j as e}from"./iframe-CQAwSt4E.js";import{c as i,g as ye}from"./classname-CUR_zgkh.js";import{d as w}from"./date-Cg-Uk_pp.js";import{I as E}from"./icon-DdQsMyRa.js";import{B as A}from"./button-CL7GeC23.js";import{T as m}from"./typography-DEpAJl_i.js";import{u as ge}from"./index-BV0AJWP6.js";import{u as ee}from"./store-CPumdfcU.js";class we{getNumDaysInMonth(t,o){return new Date(o,t+1,0).getDate()}isSame(t,o){return w(t).isSame(w(o),"day")}isBefore(t,o){return w(t).isBefore(w(o),"day")}isAfter(t,o){return w(t).isAfter(w(o),"day")}isSameOrBefore(t,o){return w(t).isSameOrBefore(w(o),"day")}isSameOrAfter(t,o){return w(t).isSameOrAfter(w(o),"day")}}const x=new we,ce=(n,t,o)=>{const y=ee.getState().translate;return y(n,t,o)};function Ce(){const n=ee(y=>y.language),t=ee(y=>y.systemLanguage),o=ee(y=>y.setLanguage);return{language:n,systemLanguage:t,setLanguage:o}}const Se=n=>({date:t=>t.getDate(),headerLabel:(t,o)=>ce("calendar.headerLabel",{month:ce(`calendar.monthLabel[${t}]`,void 0,n),year:o},n),weekday:t=>ce(`calendar.weekdayLabel[${t}]`,void 0,n)}),xe=(n,t)=>({...t,...Se(n==="en"?"en":"vi")}),be=ye("calendar"),l=be+"-single-picker",pe=new Date(1900,0,1),ze=new Date(2099,11,31),Ie=n=>{const t={};return n.defaultValue!==void 0&&(t.defaultValue=n.defaultValue),n.value!==void 0&&(t.value=n.value),n.onChange!==void 0&&(t.onChange=n.onChange),t},$e=n=>{const{className:t,renderText:o,lang:y,navigationMode:C="month-year",defaultValue:Me,onChange:De,value:S,minDate:F=pe,maxDate:V=ze,...U}=n,[z,W]=ge(Ie(n)),te=xe(y,o),{date:N,dateSubText:h,headerLabel:$,weekday:R}=te,T=new Date,[d,I]=b.useState(()=>z?z.getMonth():T.getMonth()),[c,p]=b.useState(()=>z?z.getFullYear():T.getFullYear()),Y=(new Date(c,d,1).getDay()+6)%7,f=x.getNumDaysInMonth(d,c),K=Y+f,u=Math.ceil(K/7),L=V.getMonth(),M=V.getFullYear(),q=F.getMonth(),G=F.getFullYear(),Q=c<M||c===M&&d<L,H=c>G||c===G&&d>q,O=c<M||c+1===M&&d<=L,X=c>G||c-1===G&&d>=q,v=b.useMemo(()=>{if(!H)return null;let g=c,s=d-1;return s<0&&(g--,s=11),{month:s,year:g}},[d,H,c]),D=b.useMemo(()=>{if(!Q)return null;let g=c,s=d+1;return s>11&&(g++,s=0),{month:s,year:g}},[d,Q,c]),J=b.useMemo(()=>v?x.getNumDaysInMonth(v.month,v.year):null,[v]),ne=b.useMemo(()=>D?x.getNumDaysInMonth(D.month,D.year):null,[D]),ae=g=>{const s=new Date(c,d,g);return x.isSameOrAfter(s,F)&&x.isSameOrBefore(s,V)};return e.jsxs("div",{className:i(be,l,t),...U,children:[e.jsxs("div",{className:`${l}__header`,children:[C==="month-year"&&e.jsx(A,{type:"ghost",theme:"neutral",disabled:!X,onClick:()=>{X&&p(c-1)},children:e.jsx(E,{size:20,name:"double-chevron-left"})}),C!=="time-only"&&e.jsx(A,{type:"ghost",theme:"neutral",disabled:!H,onClick:()=>{v&&(I(v.month),p(v.year))},children:e.jsx(E,{size:20,name:"chevron-left"})}),e.jsx(m,{className:`${l}__header-label`,children:typeof $=="function"?$?.(d,c):$}),C!=="time-only"&&e.jsx(A,{type:"ghost",theme:"neutral",disabled:!Q,onClick:()=>{D&&(I(D.month),p(D.year))},children:e.jsx(E,{size:20,name:"chevron-right"})}),C==="month-year"&&e.jsx(A,{type:"ghost",theme:"neutral",disabled:!O,onClick:()=>{O&&p(c+1)},children:e.jsx(E,{size:20,name:"double-chevron-right"})})]}),e.jsx("div",{children:e.jsxs("div",{className:`${l}__grid`,children:[Array.from({length:7},(g,s)=>{const B=(s+1)%7;return e.jsx("div",{className:i(`${l}__cell-container`),children:e.jsx("div",{className:i(`${l}__cell`,`${l}__cell-week`),children:e.jsx(m,{color:"alias-object-secondary",children:typeof R=="function"?R(B):R})})})}),Array.from({length:u*7},(g,s)=>{if(s<Y){if(!J)return e.jsx("div",{className:i(`${l}__cell-container`),children:e.jsx(m,{size:"base",role:"button",className:i(`${l}__cell`,`${l}__cell-day`,`${l}__cell-day-filler`),children:"null"})},s);const j=J-Y+s+1,r=new Date(c,d,j);return e.jsx("div",{className:i(`${l}__cell-container`),children:e.jsxs(m,{size:"base",role:"button",className:i(`${l}__cell`,`${l}__cell-day`,`${l}__cell-day-filler`),children:[typeof N=="function"?N(r):N,e.jsx(m,{size:"2x-small",className:`${l}__cell-day-sub-title`,children:typeof h=="function"?h(r):h})]})},s)}if(s>=Y+f){if(!ne)return e.jsx("div",{className:i(`${l}__cell-container`),children:e.jsx(m,{size:"base",role:"button",className:i(`${l}__cell`,`${l}__cell-day`,`${l}__cell-day-filler`),children:"null"})},s);const j=s-(Y+f)+1,r=new Date(c,d,j);return e.jsx("div",{className:i(`${l}__cell-container`),children:e.jsxs(m,{size:"base",role:"button",className:i(`${l}__cell`,`${l}__cell-day`,`${l}__cell-day-filler`),children:[typeof N=="function"?N(r):N,e.jsx(m,{size:"2x-small",className:`${l}__cell-day-sub-title`,children:typeof h=="function"?h(r):h})]})},s)}const B=s-Y+1,P=new Date(c,d,B),le=!ae(B);return e.jsx("div",{className:i(`${l}__cell-container`),children:e.jsxs(m,{size:"base",role:"button",onClick:()=>{!P||le||W(P)},className:i(`${l}__cell`,`${l}__cell-day`,{[`${l}__cell-day--disabled`]:le,[`${l}__cell-day--today`]:x.isSame(P,T),[`${l}__cell-day--selected`]:z&&x.isSame(P,z)}),children:[typeof N=="function"?N(P):N,e.jsx(m,{size:"2x-small",className:`${l}__cell-day-sub-title`,children:typeof h=="function"?h(P):h})]})},s)})]})})]})};$e.__docgenInfo={description:"",methods:[],displayName:"SinglePicker"};const je=ye("calendar"),a=je+"-range-picker",Ye=new Date(1900,0,1),Le=new Date(2099,11,31),Pe=n=>{const t={};return(n.defaultValue!==void 0||n.defaultValue===null)&&(t.defaultValue=n.defaultValue),(n.value!==void 0||n.value===null)&&(t.value=n.value),n.onChange!==void 0&&(t.onChange=n.onChange),t},me=n=>{const t=new Date;if(n){const[o,y]=n;return o?o.getMonth():y?y.getMonth():t.getMonth()}return t.getMonth()},he=n=>{const t=new Date;if(n){const[o,y]=n;return o?o.getFullYear():y?y.getFullYear():t.getFullYear()}return t.getFullYear()},fe=n=>{if(!n)return null;const[t]=n;return t},_e=n=>{if(!n)return null;const[,t]=n;return t},ve=n=>{const{className:t,renderText:o,lang:y,navigationMode:C="month-year",defaultValue:Me,onChange:De,value:S,minDate:F=Ye,maxDate:V=Le,onPick:U,...z}=n,[W,te]=ge(Pe(n)),N=xe(y,o),{date:h,dateSubText:$,headerLabel:R,weekday:T}=N,[d,I]=b.useState(fe(W)),[c,p]=b.useState(_e(W)),Y=new Date,[f,K]=b.useState(me(W)),[u,L]=b.useState(he(W)),M=(new Date(u,f,1).getDay()+6)%7,q=x.getNumDaysInMonth(f,u),G=M+q,Q=Math.ceil(G/7),H=V.getMonth(),O=V.getFullYear(),X=F.getMonth(),v=F.getFullYear(),D=u<O||u===O&&f<H,J=u>v||u===v&&f>X,ne=u<O||u+1===O&&f<=H,ae=u>v||u-1===v&&f>=X,g=b.useMemo(()=>{if(!J)return null;let j=u,r=f-1;return r<0&&(j--,r=11),{month:r,year:j}},[f,J,u]),s=b.useMemo(()=>{if(!D)return null;let j=u,r=f+1;return r>11&&(j++,r=0),{month:r,year:j}},[f,D,u]),B=b.useMemo(()=>g?x.getNumDaysInMonth(g.month,g.year):null,[g]),P=b.useMemo(()=>s?x.getNumDaysInMonth(s.month,s.year):null,[s]),le=j=>{const r=new Date(u,f,j);return x.isSameOrAfter(r,F)&&x.isSameOrBefore(r,V)};return b.useEffect(()=>{S!=null&&(K(me(S)),L(he(S)))},[S?.[0]?.getTime()]),b.useEffect(()=>{S!=null&&(I(fe(S)),p(_e(S)))},[S]),e.jsxs("div",{className:i(je,a,t),...z,children:[e.jsxs("div",{className:`${a}__header`,children:[C==="month-year"&&e.jsx(A,{type:"ghost",theme:"neutral",disabled:!ae,onClick:()=>{ae&&L(u-1)},children:e.jsx(E,{size:20,name:"double-chevron-left"})}),C!=="time-only"&&e.jsx(A,{type:"ghost",theme:"neutral",disabled:!J,onClick:()=>{g&&(K(g.month),L(g.year))},children:e.jsx(E,{size:20,name:"chevron-left"})}),e.jsx(m,{className:`${a}__header-label`,children:typeof R=="function"?R?.(f,u):R}),C!=="time-only"&&e.jsx(A,{type:"ghost",theme:"neutral",disabled:!D,onClick:()=>{s&&(K(s.month),L(s.year))},children:e.jsx(E,{size:20,name:"chevron-right"})}),C==="month-year"&&e.jsx(A,{type:"ghost",theme:"neutral",disabled:!ne,onClick:()=>{ne&&L(u+1)},children:e.jsx(E,{size:20,name:"double-chevron-right"})})]}),e.jsx("div",{children:e.jsxs("div",{className:`${a}__grid`,children:[Array.from({length:7},(j,r)=>{const se=(r+1)%7;return e.jsx("div",{className:i(`${a}__cell-container`),children:e.jsx("div",{className:i(`${a}__cell`,`${a}__cell-week`),children:e.jsx(m,{color:"alias-object-secondary",children:typeof T=="function"?T(se):T})})})}),Array.from({length:Q*7},(j,r)=>{if(r<M){if(!B)return e.jsx("div",{className:i(`${a}__cell-container`),children:e.jsx(m,{size:"base",role:"button",className:i(`${a}__cell`,`${a}__cell-day`,`${a}__cell-day-filler`),children:"null"})},r);const k=B-M+r+1,Z=new Date(u,f,k);return e.jsx("div",{className:i(`${a}__cell-container`),children:e.jsxs(m,{size:"base",role:"button",className:i(`${a}__cell`,`${a}__cell-day`,`${a}__cell-day-filler`),children:[typeof h=="function"?h(Z):h,e.jsx(m,{size:"2x-small",className:`${a}__cell-day-sub-title`,children:typeof $=="function"?$(Z):$})]})},r)}if(r>=M+q){if(!P)return e.jsx("div",{className:i(`${a}__cell-container`),children:e.jsx(m,{size:"base",role:"button",className:i(`${a}__cell`,`${a}__cell-day`,`${a}__cell-day-filler`),children:"null"})},r);const k=r-(M+q)+1,Z=new Date(u,f,k);return e.jsx("div",{className:i(`${a}__cell-container`),children:e.jsxs(m,{size:"base",role:"button",className:i(`${a}__cell`,`${a}__cell-day`,`${a}__cell-day-filler`),children:[typeof h=="function"?h(Z):h,e.jsx(m,{size:"2x-small",className:`${a}__cell-day-sub-title`,children:typeof $=="function"?$(Z):$})]})},r)}const se=r%7===6,ke=r%7===0,ie=r-M+1,_=new Date(u,f,ie),de=!le(ie),re=d&&x.isSame(_,d),oe=c&&x.isSame(_,c),ue=(function(){return d&&c?x.isSameOrAfter(_,d)&&x.isSameOrBefore(_,c):!1})();return e.jsxs("div",{className:i(`${a}__cell-container`),children:[ue&&e.jsx("div",{className:i(`${a}__cell-range-background`,{[`${a}__cell-range-background-start`]:re,[`${a}__cell-range-background-end`]:oe,[`${a}__cell-range-background-start-end-row`]:re&&se,[`${a}__cell-range-background-end-start-row`]:oe&&ke})}),e.jsxs(m,{size:"base",role:"button",onClick:()=>{if(de)return;if(d&&c){I(_),p(null),U?.([_,null]);return}if(!d&&!c){I(_),U?.([_,null]);return}const k=d||c;if(_<k){I(_),p(k),te?.([_,k]),U?.([_,k]);return}I(k),p(_),te?.([k,_]),U?.([k,_])},className:i(`${a}__cell`,`${a}__cell-day`,{[`${a}__cell-day--disabled`]:de,[`${a}__cell-day--today`]:x.isSame(_,Y),[`${a}__cell-day--in-range-picker`]:ue,[`${a}__cell-day--selected`]:re||oe}),children:[typeof h=="function"?h(_):h,e.jsx(m,{size:"2x-small",className:`${a}__cell-day-sub-title`,children:typeof $=="function"?$(_):$})]})]},r)})]})})]})};ve.__docgenInfo={description:"",methods:[],displayName:"RangePicker"};const Ee=()=>ee(t=>t.initialized),Ne=({type:n="single",...t})=>n==="single"?e.jsx($e,{...t}):e.jsx(ve,{...t}),Ae=({lang:n,...t})=>{const{language:o}=Ce();return e.jsx(Ne,{lang:n||o,...t})},Fe=n=>Ee()?e.jsx(Ne,{...n}):e.jsx(Ae,{...n});Fe.__docgenInfo={description:"",methods:[],displayName:"Calendar"};export{Fe as C};