@chotot/clad-ui 3.0.0 → 3.1.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 (264) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/README.md +9 -9
  3. package/dist/{chunk-Bmb41Sf3.cjs → _virtual/_rolldown/runtime.cjs} +1 -1
  4. package/dist/brand/ChototLogoText.cjs +1 -0
  5. package/dist/brand/ChototLogoText.es.js +15 -0
  6. package/dist/brand/CtC2C.cjs +1 -0
  7. package/dist/brand/CtC2C.es.js +18 -0
  8. package/dist/brand/CtProperty.cjs +1 -0
  9. package/dist/brand/CtProperty.es.js +204 -0
  10. package/dist/brand/CtVehicle.cjs +1 -0
  11. package/dist/brand/CtVehicle.es.js +70 -0
  12. package/dist/brand/Tot.cjs +1 -0
  13. package/dist/brand/Tot.es.js +17 -0
  14. package/dist/components/Announcer/Announcer.cjs +1 -0
  15. package/dist/components/Announcer/Announcer.es.js +100 -0
  16. package/dist/components/Announcer/announcer.styles.cjs +1 -0
  17. package/dist/components/Announcer/announcer.styles.es.js +24 -0
  18. package/dist/components/Badge/Badge.cjs +1 -0
  19. package/dist/components/Badge/Badge.es.js +83 -0
  20. package/dist/components/Badge/badge.styles.cjs +1 -0
  21. package/dist/components/Badge/badge.styles.es.js +83 -0
  22. package/dist/components/Box/Box.cjs +1 -0
  23. package/dist/components/Box/Box.es.js +72 -0
  24. package/dist/components/Breadcrumbs/BreadcrumbItem.cjs +1 -0
  25. package/dist/components/Breadcrumbs/BreadcrumbItem.es.js +17 -0
  26. package/dist/components/Breadcrumbs/Breadcrumbs.cjs +1 -0
  27. package/dist/components/Breadcrumbs/Breadcrumbs.es.js +44 -0
  28. package/dist/components/Breadcrumbs/breadcrumbs.styles.cjs +1 -0
  29. package/dist/components/Breadcrumbs/breadcrumbs.styles.es.js +5 -0
  30. package/dist/components/Button/Button.cjs +1 -0
  31. package/dist/components/Button/Button.es.js +41 -0
  32. package/dist/components/Button/ButtonLink.cjs +1 -0
  33. package/dist/components/Button/ButtonLink.es.js +5 -0
  34. package/dist/components/Button/GhostButton.cjs +1 -0
  35. package/dist/components/Button/GhostButton.es.js +25 -0
  36. package/dist/components/Button/IconButton.cjs +1 -0
  37. package/dist/components/Button/IconButton.es.js +13 -0
  38. package/dist/components/Button/button.styles.cjs +1 -0
  39. package/dist/components/Button/button.styles.es.js +100 -0
  40. package/dist/components/Checkbox/Checkbox.cjs +1 -0
  41. package/dist/components/Checkbox/Checkbox.es.js +43 -0
  42. package/dist/components/Checkbox/checkbox.styles.cjs +1 -0
  43. package/dist/components/Checkbox/checkbox.styles.es.js +15 -0
  44. package/dist/components/Chip/Chip.cjs +1 -0
  45. package/dist/components/Chip/Chip.es.js +35 -0
  46. package/dist/components/Chip/chip.styles.cjs +1 -0
  47. package/dist/components/Chip/chip.styles.es.js +33 -0
  48. package/dist/components/CurrencyInput/CurrencyInput.cjs +1 -0
  49. package/dist/components/CurrencyInput/CurrencyInput.es.js +142 -0
  50. package/dist/components/CurrencyInput/currency-input.styles.cjs +1 -0
  51. package/dist/components/CurrencyInput/currency-input.styles.es.js +13 -0
  52. package/dist/components/CurrencyInput/utils.cjs +1 -0
  53. package/dist/components/CurrencyInput/utils.es.js +30 -0
  54. package/dist/components/DatePicker/DatePicker.cjs +1 -0
  55. package/dist/components/DatePicker/DatePicker.es.js +354 -0
  56. package/dist/components/DatePicker/DateTimePicker.cjs +1 -0
  57. package/dist/components/DatePicker/DateTimePicker.es.js +416 -0
  58. package/dist/components/DatePicker/date-picker.styles.cjs +1 -0
  59. package/dist/components/DatePicker/date-picker.styles.es.js +8 -0
  60. package/dist/components/DatePicker/date-time-picker.styles.cjs +1 -0
  61. package/dist/components/DatePicker/date-time-picker.styles.es.js +8 -0
  62. package/dist/components/DatePicker/index.d.ts +2 -1
  63. package/dist/components/DatePicker/types.cjs +1 -0
  64. package/dist/components/DatePicker/types.es.js +6 -0
  65. package/dist/components/Drawer/Drawer.cjs +1 -0
  66. package/dist/components/Drawer/Drawer.es.js +407 -0
  67. package/dist/components/Dropdown/Dropdown.cjs +1 -0
  68. package/dist/components/Dropdown/Dropdown.es.js +145 -0
  69. package/dist/components/Dropdown/dropdown.styles.cjs +1 -0
  70. package/dist/components/Dropdown/dropdown.styles.es.js +12 -0
  71. package/dist/components/EmptyState/EmptyState.cjs +2 -0
  72. package/dist/components/EmptyState/EmptyState.es.js +114 -0
  73. package/dist/components/EmptyState/empty-state.styles.cjs +1 -0
  74. package/dist/components/EmptyState/empty-state.styles.es.js +5 -0
  75. package/dist/components/Grid/Col.cjs +1 -0
  76. package/dist/components/Grid/Col.es.js +37 -0
  77. package/dist/components/Grid/Grid.cjs +1 -0
  78. package/dist/components/Grid/Grid.es.js +66 -0
  79. package/dist/components/Input/Input.cjs +1 -0
  80. package/dist/components/Input/Input.es.js +122 -0
  81. package/dist/components/Input/input.styles.cjs +1 -0
  82. package/dist/components/Input/input.styles.es.js +14 -0
  83. package/dist/components/InputGroup/InputGroup.cjs +1 -0
  84. package/dist/components/InputGroup/InputGroup.es.js +16 -0
  85. package/dist/components/InputGroup/input-group.styles.cjs +1 -0
  86. package/dist/components/InputGroup/input-group.styles.es.js +12 -0
  87. package/dist/components/LegacyDialog/DialogMainIcon.cjs +1 -0
  88. package/dist/components/LegacyDialog/DialogMainIcon.es.js +52 -0
  89. package/dist/components/LegacyDialog/LegacyDialog.cjs +1 -0
  90. package/dist/components/LegacyDialog/LegacyDialog.es.js +54 -0
  91. package/dist/components/LegacyPopup/LegacyPopup.cjs +1 -0
  92. package/dist/components/LegacyPopup/LegacyPopup.es.js +72 -0
  93. package/dist/components/MultiSearchDropdown/MultiSearchDropdown.cjs +1 -0
  94. package/dist/components/MultiSearchDropdown/MultiSearchDropdown.es.js +215 -0
  95. package/dist/components/MultiSearchDropdown/multi-search-dropdown.styles.cjs +1 -0
  96. package/dist/components/MultiSearchDropdown/multi-search-dropdown.styles.es.js +12 -0
  97. package/dist/components/Pagination/PageItem.cjs +1 -0
  98. package/dist/components/Pagination/PageItem.es.js +20 -0
  99. package/dist/components/Pagination/Pagination.cjs +1 -0
  100. package/dist/components/Pagination/Pagination.es.js +84 -0
  101. package/dist/components/Pagination/pagination.styles.cjs +1 -0
  102. package/dist/components/Pagination/pagination.styles.es.js +15 -0
  103. package/dist/components/Pagination/types.d.ts +1 -1
  104. package/dist/components/Popover/Popover.cjs +1 -0
  105. package/dist/components/Popover/Popover.es.js +54 -0
  106. package/dist/components/Popover/popover.styles.cjs +1 -0
  107. package/dist/components/Popover/popover.styles.es.js +5 -0
  108. package/dist/components/Popup/Popup.cjs +1 -0
  109. package/dist/components/Popup/Popup.es.js +148 -0
  110. package/dist/components/RadioButton/RadioButton.cjs +1 -0
  111. package/dist/components/RadioButton/RadioButton.es.js +61 -0
  112. package/dist/components/RadioButton/radio-button.styles.cjs +1 -0
  113. package/dist/components/RadioButton/radio-button.styles.es.js +15 -0
  114. package/dist/components/RangeInput/RangeInput.cjs +1 -0
  115. package/dist/components/RangeInput/RangeInput.es.js +32 -0
  116. package/dist/components/RangeInput/range-input.styles.cjs +1 -0
  117. package/dist/components/RangeInput/range-input.styles.es.js +5 -0
  118. package/dist/components/RowItem/RowItem.cjs +1 -0
  119. package/dist/components/RowItem/RowItem.es.js +56 -0
  120. package/dist/components/RowItem/rowitem.styles.cjs +1 -0
  121. package/dist/components/RowItem/rowitem.styles.es.js +23 -0
  122. package/dist/components/SearchInput/SearchInput.cjs +1 -0
  123. package/dist/components/SearchInput/SearchInput.es.js +129 -0
  124. package/dist/components/SearchInput/search-input.styles.cjs +1 -0
  125. package/dist/components/SearchInput/search-input.styles.es.js +12 -0
  126. package/dist/components/Searchbar/Searchbar.cjs +1 -0
  127. package/dist/components/Searchbar/Searchbar.es.js +51 -0
  128. package/dist/components/Searchbar/searchbar.styles.cjs +1 -0
  129. package/dist/components/Searchbar/searchbar.styles.es.js +5 -0
  130. package/dist/components/ShapeIcon/ShapeIcon.cjs +1 -0
  131. package/dist/components/ShapeIcon/ShapeIcon.es.js +22 -0
  132. package/dist/components/ShapeIcon/shape-icon.styles.cjs +1 -0
  133. package/dist/components/ShapeIcon/shape-icon.styles.es.js +65 -0
  134. package/dist/components/Slider/Slider.cjs +1 -0
  135. package/dist/components/Slider/Slider.es.js +169 -0
  136. package/dist/components/Slider/slider.styles.cjs +1 -0
  137. package/dist/components/Slider/slider.styles.es.js +5 -0
  138. package/dist/components/Snack/Snack.cjs +1 -0
  139. package/dist/components/Snack/Snack.es.js +69 -0
  140. package/dist/components/Snack/snack.styles.cjs +1 -0
  141. package/dist/components/Snack/snack.styles.es.js +13 -0
  142. package/dist/components/Tabs/Tab.cjs +1 -0
  143. package/dist/components/Tabs/Tab.es.js +42 -0
  144. package/dist/components/Tabs/Tabs.cjs +1 -0
  145. package/dist/components/Tabs/Tabs.es.js +115 -0
  146. package/dist/components/Tabs/tabs.styles.cjs +1 -0
  147. package/dist/components/Tabs/tabs.styles.es.js +33 -0
  148. package/dist/components/TagCloud/TagCloud.cjs +1 -0
  149. package/dist/components/TagCloud/TagCloud.d.ts +1 -1
  150. package/dist/components/TagCloud/TagCloud.es.js +48 -0
  151. package/dist/components/TagCloud/tagcloud.styles.cjs +1 -0
  152. package/dist/components/TagCloud/tagcloud.styles.es.js +12 -0
  153. package/dist/components/TagCloud/types.d.ts +5 -0
  154. package/dist/components/TextArea/TextArea.cjs +1 -0
  155. package/dist/components/TextArea/TextArea.es.js +104 -0
  156. package/dist/components/TextArea/text-area.styles.cjs +1 -0
  157. package/dist/components/TextArea/text-area.styles.es.js +13 -0
  158. package/dist/components/TextLabel/TextLabel.cjs +1 -0
  159. package/dist/components/TextLabel/TextLabel.es.js +28 -0
  160. package/dist/components/TextLabel/textlabel.styles.cjs +1 -0
  161. package/dist/components/TextLabel/textlabel.styles.es.js +29 -0
  162. package/dist/components/ToggleSwitch/ToggleSwitch.cjs +1 -0
  163. package/dist/components/ToggleSwitch/ToggleSwitch.es.js +37 -0
  164. package/dist/components/ToggleSwitch/toggle-switch.styles.cjs +1 -0
  165. package/dist/components/ToggleSwitch/toggle-switch.styles.es.js +24 -0
  166. package/dist/components/Tooltip/Tooltip.cjs +1 -0
  167. package/dist/components/Tooltip/Tooltip.es.js +103 -0
  168. package/dist/components/Tooltip/tooltip.styles.cjs +1 -0
  169. package/dist/components/Tooltip/tooltip.styles.es.js +12 -0
  170. package/dist/forge/index.cjs +1 -0
  171. package/dist/icons.cjs +1 -1
  172. package/dist/index.cjs +1 -0
  173. package/dist/index.es.js +82 -0
  174. package/dist/styles.css +1 -1
  175. package/dist/types/index.cjs +1 -0
  176. package/dist/types/index.es.js +7 -0
  177. package/dist/typography/BodyAnnotation.cjs +1 -0
  178. package/dist/typography/BodyAnnotation.es.js +10 -0
  179. package/dist/typography/BodyCaption.cjs +1 -0
  180. package/dist/typography/BodyCaption.es.js +10 -0
  181. package/dist/typography/BodyPage.cjs +1 -0
  182. package/dist/typography/BodyPage.es.js +10 -0
  183. package/dist/typography/BodySection.cjs +1 -0
  184. package/dist/typography/BodySection.es.js +10 -0
  185. package/dist/typography/DisplayAnnotation.cjs +1 -0
  186. package/dist/typography/DisplayAnnotation.es.js +10 -0
  187. package/dist/typography/DisplayCaption.cjs +1 -0
  188. package/dist/typography/DisplayCaption.es.js +10 -0
  189. package/dist/typography/DisplayPage.cjs +1 -0
  190. package/dist/typography/DisplayPage.es.js +10 -0
  191. package/dist/typography/DisplayPrice.cjs +1 -0
  192. package/dist/typography/DisplayPrice.es.js +10 -0
  193. package/dist/typography/DisplaySection.cjs +1 -0
  194. package/dist/typography/DisplaySection.es.js +10 -0
  195. package/dist/typography/HeaderAnnotation.cjs +1 -0
  196. package/dist/typography/HeaderAnnotation.es.js +10 -0
  197. package/dist/typography/HeaderCaption.cjs +1 -0
  198. package/dist/typography/HeaderCaption.es.js +10 -0
  199. package/dist/typography/HeaderPage.cjs +1 -0
  200. package/dist/typography/HeaderPage.es.js +10 -0
  201. package/dist/typography/HeaderSection.cjs +1 -0
  202. package/dist/typography/HeaderSection.es.js +10 -0
  203. package/dist/typography/LabelAnnotation.cjs +1 -0
  204. package/dist/typography/LabelAnnotation.es.js +10 -0
  205. package/dist/typography/LabelCaption.cjs +1 -0
  206. package/dist/typography/LabelCaption.es.js +10 -0
  207. package/dist/typography/LabelPage.cjs +1 -0
  208. package/dist/typography/LabelPage.es.js +10 -0
  209. package/dist/typography/LabelSection.cjs +1 -0
  210. package/dist/typography/LabelSection.es.js +10 -0
  211. package/dist/typography/NoteCaption.cjs +1 -0
  212. package/dist/typography/NoteCaption.es.js +10 -0
  213. package/dist/typography/NotePage.cjs +1 -0
  214. package/dist/typography/NotePage.es.js +10 -0
  215. package/dist/typography/NoteSection.cjs +1 -0
  216. package/dist/typography/NoteSection.es.js +10 -0
  217. package/dist/typography/TaglineAnnotation.cjs +1 -0
  218. package/dist/typography/TaglineAnnotation.es.js +10 -0
  219. package/dist/typography/TaglineCaption.cjs +1 -0
  220. package/dist/typography/TaglineCaption.es.js +10 -0
  221. package/dist/typography/TaglineFootext.cjs +1 -0
  222. package/dist/typography/TaglineFootext.es.js +10 -0
  223. package/dist/typography/TaglineSection.cjs +1 -0
  224. package/dist/typography/TaglineSection.es.js +10 -0
  225. package/dist/utils/bundleCss.cjs +1 -1
  226. package/dist/utils/cleanHtml.cjs +1 -0
  227. package/dist/utils/cleanHtml.es.js +6 -0
  228. package/dist/utils/cn.cjs +1 -0
  229. package/dist/utils/cn.es.js +59 -0
  230. package/dist/utils/createUniversalPortal.cjs +1 -0
  231. package/dist/utils/createUniversalPortal.es.js +17 -0
  232. package/dist/utils/floating.cjs +1 -0
  233. package/dist/utils/floating.es.js +374 -0
  234. package/dist/utils/getBreakpointsValues.cjs +1 -0
  235. package/dist/utils/getBreakpointsValues.es.js +27 -0
  236. package/dist/utils/sizes.cjs +1 -0
  237. package/dist/utils/sizes.es.js +30 -0
  238. package/dist/utils/themeTokens.cjs +1 -0
  239. package/dist/utils/themeTokens.es.js +319 -0
  240. package/dist/utils/useBodyScrollLock.cjs +1 -0
  241. package/dist/utils/useBodyScrollLock.es.js +24 -0
  242. package/dist/utils/useScrollTop.cjs +1 -0
  243. package/dist/utils/useScrollTop.es.js +9 -0
  244. package/package.json +6 -6
  245. package/scripts/postinstall.cjs +34 -6
  246. package/skills/clad-ui/SKILL.md +17 -2
  247. package/skills/clad-ui/references/components-display-layout.md +1 -0
  248. package/skills/clad-ui-feedback/SKILL.md +1 -1
  249. package/skills/migrate-clad-ui-v3/SKILL.md +4 -2
  250. package/skills/migrate-clad-ui-v3/references/component-api-changes.md +42 -0
  251. package/skills/migrate-clad-ui-v3/references/token-and-linaria-mapping.md +4 -1
  252. package/src/styles/base/base.css +1 -0
  253. package/src/styles/components/button.css +25 -0
  254. package/src/styles/components/chip.css +35 -0
  255. package/src/styles/components/drawer.css +9 -0
  256. package/src/styles/preset.css +1 -1
  257. package/dist/clad-ui.cjs +0 -2
  258. package/dist/clad-ui.d.ts +0 -2
  259. package/dist/clad-ui.es.js +0 -9791
  260. package/dist/components/Drawer/Drawer.pw.fixtures.d.ts +0 -9
  261. package/dist/components/Grid/Grid.pw.fixtures.d.ts +0 -3
  262. package/dist/components/Popover/Popover.pw.fixtures.d.ts +0 -6
  263. package/dist/components/Popup/Popup.pw.fixtures.d.ts +0 -5
  264. package/dist/components/Tooltip/Tooltip.pw.fixtures.d.ts +0 -1
@@ -0,0 +1 @@
1
+ require(`../../_virtual/_rolldown/runtime.cjs`);var e=(0,require(`tailwind-variants`).tv)({base:`slider-wrapper`});exports.sliderStyles=e;
@@ -0,0 +1,5 @@
1
+ import { tv as e } from "tailwind-variants";
2
+ //#region src/components/Slider/slider.styles.ts
3
+ var t = e({ base: "slider-wrapper" });
4
+ //#endregion
5
+ export { t as sliderStyles };
@@ -0,0 +1 @@
1
+ "use client";require(`../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../utils/cn.cjs`),t=require(`../../utils/createUniversalPortal.cjs`),n=require(`./snack.styles.cjs`);let r=require(`react`),i=require(`@chotot/icons`),a=require(`react/jsx-runtime`);var o={none:0,xxxs:100,xxs:150,xs:300,sm:500,md:1e3,lg:2e3,xl:4e3,xxl:6e3,xxxl:8e3,xxxxl:1e4},s=()=>{},c=({children:c,onClose:l=s,desktopSize:u=`lg`,autoHideDuration:d=`xl`,haveClose:f=!1,onActionClick:p=s,actionLabel:m=``,icon:h,layout:g=`horizontal`,className:_,...v})=>{let[y,b]=(0,r.useState)(!1);(0,r.useEffect)(()=>{let e=setTimeout(()=>{b(!0),l()},o[d]);return()=>{clearTimeout(e)}});let x=()=>{y&&l()};return(0,a.jsx)(a.Fragment,{children:t.default((0,a.jsx)(`div`,{className:`snack-wrapper`,children:(0,a.jsxs)(`div`,{...v,className:e.default(n.snackVariants({desktopSize:u}),y&&`exit`,m&&`hasAction`,g===`vertical`&&m&&`verticalLayout`,!h&&!m&&!f&&`centerText`,_),onAnimationEnd:x,"data-clad":`Snack`,children:[(0,a.jsxs)(`div`,{className:`snack-content`,children:[!!h&&(0,a.jsx)(`div`,{className:`snack-icon`,children:h}),c]}),!!f&&m.length===0&&(0,a.jsx)(`button`,{type:`button`,className:`snack-close-btn`,onClick:()=>{l()},children:(0,a.jsx)(i.Close,{})}),m.length>0&&(0,a.jsx)(`button`,{type:`button`,className:`snack-action-btn`,onClick:p,children:m})]})}))})};c.displayName=`Snack`,exports.default=c;
@@ -0,0 +1,69 @@
1
+ "use client";
2
+ import e from "../../utils/cn.es.js";
3
+ import t from "../../utils/createUniversalPortal.es.js";
4
+ import { snackVariants as n } from "./snack.styles.es.js";
5
+ import { useEffect as r, useState as i } from "react";
6
+ import { Close as a } from "@chotot/icons";
7
+ import { Fragment as o, jsx as s, jsxs as c } from "react/jsx-runtime";
8
+ //#region src/components/Snack/Snack.tsx
9
+ var l = {
10
+ none: 0,
11
+ xxxs: 100,
12
+ xxs: 150,
13
+ xs: 300,
14
+ sm: 500,
15
+ md: 1e3,
16
+ lg: 2e3,
17
+ xl: 4e3,
18
+ xxl: 6e3,
19
+ xxxl: 8e3,
20
+ xxxxl: 1e4
21
+ }, u = () => {}, d = ({ children: d, onClose: f = u, desktopSize: p = "lg", autoHideDuration: m = "xl", haveClose: h = !1, onActionClick: g = u, actionLabel: _ = "", icon: v, layout: y = "horizontal", className: b, ...x }) => {
22
+ let [S, C] = i(!1);
23
+ r(() => {
24
+ let e = setTimeout(() => {
25
+ C(!0), f();
26
+ }, l[m]);
27
+ return () => {
28
+ clearTimeout(e);
29
+ };
30
+ });
31
+ let w = () => {
32
+ S && f();
33
+ };
34
+ return /* @__PURE__ */ s(o, { children: t(/* @__PURE__ */ s("div", {
35
+ className: "snack-wrapper",
36
+ children: /* @__PURE__ */ c("div", {
37
+ ...x,
38
+ className: e(n({ desktopSize: p }), S && "exit", _ && "hasAction", y === "vertical" && _ && "verticalLayout", !v && !_ && !h && "centerText", b),
39
+ onAnimationEnd: w,
40
+ "data-clad": "Snack",
41
+ children: [
42
+ /* @__PURE__ */ c("div", {
43
+ className: "snack-content",
44
+ children: [!!v && /* @__PURE__ */ s("div", {
45
+ className: "snack-icon",
46
+ children: v
47
+ }), d]
48
+ }),
49
+ !!h && _.length === 0 && /* @__PURE__ */ s("button", {
50
+ type: "button",
51
+ className: "snack-close-btn",
52
+ onClick: () => {
53
+ f();
54
+ },
55
+ children: /* @__PURE__ */ s(a, {})
56
+ }),
57
+ _.length > 0 && /* @__PURE__ */ s("button", {
58
+ type: "button",
59
+ className: "snack-action-btn",
60
+ onClick: g,
61
+ children: _
62
+ })
63
+ ]
64
+ })
65
+ })) });
66
+ };
67
+ d.displayName = "Snack";
68
+ //#endregion
69
+ export { d as default };
@@ -0,0 +1 @@
1
+ require(`../../_virtual/_rolldown/runtime.cjs`);var e=(0,require(`tailwind-variants/lite`).tv)({base:`snack`,variants:{desktopSize:{md:`md`,lg:`lg`,xl:`xl`}},defaultVariants:{desktopSize:`lg`}});exports.snackVariants=e;
@@ -0,0 +1,13 @@
1
+ import { tv as e } from "tailwind-variants/lite";
2
+ //#region src/components/Snack/snack.styles.ts
3
+ var t = e({
4
+ base: "snack",
5
+ variants: { desktopSize: {
6
+ md: "md",
7
+ lg: "lg",
8
+ xl: "xl"
9
+ } },
10
+ defaultVariants: { desktopSize: "lg" }
11
+ });
12
+ //#endregion
13
+ export { t as snackVariants };
@@ -0,0 +1 @@
1
+ require(`../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../utils/cn.cjs`),t=require(`../../types/index.cjs`),n=require(`./tabs.styles.cjs`);let r=require(`react`);var i=t.forwardRef((t,i)=>{let{value:a,label:o=``,indicator:s=null,icon:c=null,onClick:l,className:u=``,disabled:d=!1,active:f=!1,as:p,tabIndex:m=-1,fontWeight:h=`bold`,width:g,height:_,lineClamp:v=1,variant:y,...b}=t,x=l&&!d?e=>{l(e,a)}:void 0,S=!!(v&&_&&parseInt(_,10)>20),C=e.default(`tab__label`,f&&!d&&`tab__label--active`,d&&`tab__label--disabled`,h===`normal`&&!f&&`tab__label--font-normal`),w=S?{WebkitBoxOrient:`vertical`,display:`-webkit-box`,WebkitLineClamp:v,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`normal`}:void 0;return(0,r.createElement)(p||`button`,{ref:i,onClick:x,className:e.default(n.tabVariants({variant:y,disabled:d,active:f}),u),style:{width:g?`${g}`:void 0,height:_?`${_}`:void 0},role:`tab`,"aria-selected":m===0,"aria-disabled":!!d,tabIndex:m,"data-clad":`Tab`,...b},c?(0,r.createElement)(`span`,{className:`tab__icon`},c):null,o?(0,r.createElement)(`div`,{className:`flex h-full items-center`},(0,r.createElement)(`span`,{className:C,style:w},o)):null,s)});i.displayName=`Tab`,exports.default=i;
@@ -0,0 +1,42 @@
1
+ import e from "../../utils/cn.es.js";
2
+ import { forwardRef as t } from "../../types/index.es.js";
3
+ import { tabVariants as n } from "./tabs.styles.es.js";
4
+ import { createElement as r } from "react";
5
+ //#region src/components/Tabs/Tab.tsx
6
+ var i = t((t, i) => {
7
+ let { value: a, label: o = "", indicator: s = null, icon: c = null, onClick: l, className: u = "", disabled: d = !1, active: f = !1, as: p, tabIndex: m = -1, fontWeight: h = "bold", width: g, height: _, lineClamp: v = 1, variant: y, ...b } = t, x = l && !d ? (e) => {
8
+ l(e, a);
9
+ } : void 0, S = !!(v && _ && parseInt(_, 10) > 20), C = e("tab__label", f && !d && "tab__label--active", d && "tab__label--disabled", h === "normal" && !f && "tab__label--font-normal"), w = S ? {
10
+ WebkitBoxOrient: "vertical",
11
+ display: "-webkit-box",
12
+ WebkitLineClamp: v,
13
+ overflow: "hidden",
14
+ textOverflow: "ellipsis",
15
+ whiteSpace: "normal"
16
+ } : void 0;
17
+ return r(p || "button", {
18
+ ref: i,
19
+ onClick: x,
20
+ className: e(n({
21
+ variant: y,
22
+ disabled: d,
23
+ active: f
24
+ }), u),
25
+ style: {
26
+ width: g ? `${g}` : void 0,
27
+ height: _ ? `${_}` : void 0
28
+ },
29
+ role: "tab",
30
+ "aria-selected": m === 0,
31
+ "aria-disabled": !!d,
32
+ tabIndex: m,
33
+ "data-clad": "Tab",
34
+ ...b
35
+ }, c ? r("span", { className: "tab__icon" }, c) : null, o ? r("div", { className: "flex h-full items-center" }, r("span", {
36
+ className: C,
37
+ style: w
38
+ }, o)) : null, s);
39
+ });
40
+ i.displayName = "Tab";
41
+ //#endregion
42
+ export { i as default };
@@ -0,0 +1 @@
1
+ "use client";require(`../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../utils/cn.cjs`),t=require(`./tabs.styles.cjs`);let n=require(`react`),r=require(`@chotot/icons`);var i=()=>{},a=({children:a,onChange:o=i,className:s,value:c,variant:l=`standard`,showDivider:u=!1,fontWeight:d=`bold`,height:f,lineClamp:p=1,showScrollBtn:m=!1,widthScroll:h,style:g,..._})=>{let[v,y]=(0,n.useState)(!1),[b,x]=(0,n.useState)(!1),[S,C]=(0,n.useState)(0),w=(0,n.useRef)(null),T=(0,n.useRef)(null),E=(0,n.useCallback)(()=>{let e=w.current;if(!e||!m||l!==`standard`){y(!1),x(!1);return}let t=T.current;if(t&&e.scrollWidth<=t.clientWidth+1){y(!1),x(!1);return}let{scrollLeft:n,scrollWidth:r,clientWidth:i}=e;y(n>1),x(n+i<r-1)},[m,l]);(0,n.useEffect)(()=>{if(!m||l!==`standard`){y(!1),x(!1);return}let e=w.current;if(!e)return;let t=!1,n=()=>{t||E()};n();let r=requestAnimationFrame(n);e.addEventListener(`scroll`,n,{passive:!0});let a;return typeof ResizeObserver<`u`&&(a=new ResizeObserver(n),a.observe(e),T.current&&a.observe(T.current),Array.from(e.children).forEach(e=>{a?.observe(e)})),typeof document<`u`&&document.fonts?.ready&&document.fonts.ready.then(n).catch(i),()=>{t=!0,cancelAnimationFrame(r),e.removeEventListener(`scroll`,n),a?.disconnect()}},[m,l,a,E]);let D=(0,n.createElement)(`span`,{className:`tabs__indicator`}),O=n.Children.toArray(a),k=O.length,A=e=>{let t=w.current?.childNodes,r=S;if(e.keyCode===32){let t=O[r];(0,n.isValidElement)(t)&&o(e,t.props.value);return}e.keyCode===39&&r+1<k&&(r+=1),e.keyCode===37&&r-1>=0&&--r,C(r),(t?.[r])?.focus()},j=e=>{let t=e.currentTarget.dataset.value;if(w.current){let{childNodes:e}=w.current,n=w.current.scrollWidth??0,r=w.current.clientWidth??0,i=w.current.scrollLeft??0,a=h??Math.round(n/Math.max(e?.length??1,1)),o=Math.max(0,n-r),s=Math.min(o,Math.max(0,t===`left`?i-a:i+a));w.current.scrollTo({left:s,behavior:`smooth`}),y(s>1),x(s+r<n-1),requestAnimationFrame(E)}},M=e.default(`tabs__scroller`,l===`standard`&&`tabs__scroller--scrollable`),N=n.Children.map(a,(e,t)=>{if(!(0,n.isValidElement)(e))return null;let r=e.props,i=r.value===c;return(0,n.createElement)(e.type,{...r,indicator:i?D:null,active:i,variant:l,onClick:o,tabIndex:S===t?0:-1,fontWeight:d,height:f,lineClamp:p})});return(0,n.createElement)(`div`,{..._,ref:T,className:e.default(t.tabsVariants({showDivider:u}),s),style:{...f?{height:f}:void 0,...g},"data-clad":`Tabs`},m&&l===`standard`?(0,n.createElement)(`button`,{className:e.default(`tabs__scroll-btn`,!v&&`hidden`),onClick:j,type:`button`,"data-value":`left`},(0,n.createElement)(r.ChevronLeft,{width:`24px`,height:`24px`,"aria-hidden":!0})):null,(0,n.createElement)(`div`,{ref:w,role:`tablist`,className:M,onKeyDown:A},N),m&&l===`standard`?(0,n.createElement)(`button`,{className:e.default(`tabs__scroll-btn`,!b&&`hidden`),onClick:j,type:`button`,"data-value":`right`},(0,n.createElement)(r.ChevronRight,{width:`24px`,height:`24px`,"aria-hidden":!0})):null)};a.displayName=`Tabs`,exports.default=a;
@@ -0,0 +1,115 @@
1
+ "use client";
2
+ import e from "../../utils/cn.es.js";
3
+ import { tabsVariants as t } from "./tabs.styles.es.js";
4
+ import { Children as n, createElement as r, isValidElement as i, useCallback as a, useEffect as o, useRef as s, useState as c } from "react";
5
+ import { ChevronLeft as l, ChevronRight as u } from "@chotot/icons";
6
+ //#region src/components/Tabs/Tabs.tsx
7
+ var d = () => {}, f = ({ children: f, onChange: p = d, className: m, value: h, variant: g = "standard", showDivider: _ = !1, fontWeight: v = "bold", height: y, lineClamp: b = 1, showScrollBtn: x = !1, widthScroll: S, style: C, ...w }) => {
8
+ let [T, E] = c(!1), [D, O] = c(!1), [k, A] = c(0), j = s(null), M = s(null), N = a(() => {
9
+ let e = j.current;
10
+ if (!e || !x || g !== "standard") {
11
+ E(!1), O(!1);
12
+ return;
13
+ }
14
+ let t = M.current;
15
+ if (t && e.scrollWidth <= t.clientWidth + 1) {
16
+ E(!1), O(!1);
17
+ return;
18
+ }
19
+ let { scrollLeft: n, scrollWidth: r, clientWidth: i } = e;
20
+ E(n > 1), O(n + i < r - 1);
21
+ }, [x, g]);
22
+ o(() => {
23
+ if (!x || g !== "standard") {
24
+ E(!1), O(!1);
25
+ return;
26
+ }
27
+ let e = j.current;
28
+ if (!e) return;
29
+ let t = !1, n = () => {
30
+ t || N();
31
+ };
32
+ n();
33
+ let r = requestAnimationFrame(n);
34
+ e.addEventListener("scroll", n, { passive: !0 });
35
+ let i;
36
+ return typeof ResizeObserver < "u" && (i = new ResizeObserver(n), i.observe(e), M.current && i.observe(M.current), Array.from(e.children).forEach((e) => {
37
+ i?.observe(e);
38
+ })), typeof document < "u" && document.fonts?.ready && document.fonts.ready.then(n).catch(d), () => {
39
+ t = !0, cancelAnimationFrame(r), e.removeEventListener("scroll", n), i?.disconnect();
40
+ };
41
+ }, [
42
+ x,
43
+ g,
44
+ f,
45
+ N
46
+ ]);
47
+ let P = r("span", { className: "tabs__indicator" }), F = n.toArray(f), I = F.length, L = (e) => {
48
+ let t = j.current?.childNodes, n = k;
49
+ if (e.keyCode === 32) {
50
+ let t = F[n];
51
+ i(t) && p(e, t.props.value);
52
+ return;
53
+ }
54
+ e.keyCode === 39 && n + 1 < I && (n += 1), e.keyCode === 37 && n - 1 >= 0 && --n, A(n), (t?.[n])?.focus();
55
+ }, R = (e) => {
56
+ let t = e.currentTarget.dataset.value;
57
+ if (j.current) {
58
+ let { childNodes: e } = j.current, n = j.current.scrollWidth ?? 0, r = j.current.clientWidth ?? 0, i = j.current.scrollLeft ?? 0, a = S ?? Math.round(n / Math.max(e?.length ?? 1, 1)), o = Math.max(0, n - r), s = Math.min(o, Math.max(0, t === "left" ? i - a : i + a));
59
+ j.current.scrollTo({
60
+ left: s,
61
+ behavior: "smooth"
62
+ }), E(s > 1), O(s + r < n - 1), requestAnimationFrame(N);
63
+ }
64
+ }, z = e("tabs__scroller", g === "standard" && "tabs__scroller--scrollable"), B = n.map(f, (e, t) => {
65
+ if (!i(e)) return null;
66
+ let n = e.props, a = n.value === h;
67
+ return r(e.type, {
68
+ ...n,
69
+ indicator: a ? P : null,
70
+ active: a,
71
+ variant: g,
72
+ onClick: p,
73
+ tabIndex: k === t ? 0 : -1,
74
+ fontWeight: v,
75
+ height: y,
76
+ lineClamp: b
77
+ });
78
+ });
79
+ return r("div", {
80
+ ...w,
81
+ ref: M,
82
+ className: e(t({ showDivider: _ }), m),
83
+ style: {
84
+ ...y ? { height: y } : void 0,
85
+ ...C
86
+ },
87
+ "data-clad": "Tabs"
88
+ }, x && g === "standard" ? r("button", {
89
+ className: e("tabs__scroll-btn", !T && "hidden"),
90
+ onClick: R,
91
+ type: "button",
92
+ "data-value": "left"
93
+ }, r(l, {
94
+ width: "24px",
95
+ height: "24px",
96
+ "aria-hidden": !0
97
+ })) : null, r("div", {
98
+ ref: j,
99
+ role: "tablist",
100
+ className: z,
101
+ onKeyDown: L
102
+ }, B), x && g === "standard" ? r("button", {
103
+ className: e("tabs__scroll-btn", !D && "hidden"),
104
+ onClick: R,
105
+ type: "button",
106
+ "data-value": "right"
107
+ }, r(u, {
108
+ width: "24px",
109
+ height: "24px",
110
+ "aria-hidden": !0
111
+ })) : null);
112
+ };
113
+ f.displayName = "Tabs";
114
+ //#endregion
115
+ export { f as default };
@@ -0,0 +1 @@
1
+ require(`../../_virtual/_rolldown/runtime.cjs`);let e=require(`tailwind-variants/lite`);var t=(0,e.tv)({base:`tabs`,defaultVariants:{showDivider:!1},variants:{showDivider:{true:`tabs--divider`,false:``}}}),n=(0,e.tv)({base:`tab`,defaultVariants:{variant:`standard`,disabled:!1,active:!1},variants:{variant:{fullWidth:`tab--full-width`,standard:`tab--standard`},disabled:{true:`tab--disabled`,false:``},active:{true:``,false:``}}});exports.tabVariants=n,exports.tabsVariants=t;
@@ -0,0 +1,33 @@
1
+ import { tv as e } from "tailwind-variants/lite";
2
+ //#region src/components/Tabs/tabs.styles.ts
3
+ var t = e({
4
+ base: "tabs",
5
+ defaultVariants: { showDivider: !1 },
6
+ variants: { showDivider: {
7
+ true: "tabs--divider",
8
+ false: ""
9
+ } }
10
+ }), n = e({
11
+ base: "tab",
12
+ defaultVariants: {
13
+ variant: "standard",
14
+ disabled: !1,
15
+ active: !1
16
+ },
17
+ variants: {
18
+ variant: {
19
+ fullWidth: "tab--full-width",
20
+ standard: "tab--standard"
21
+ },
22
+ disabled: {
23
+ true: "tab--disabled",
24
+ false: ""
25
+ },
26
+ active: {
27
+ true: "",
28
+ false: ""
29
+ }
30
+ }
31
+ });
32
+ //#endregion
33
+ export { n as tabVariants, t as tabsVariants };
@@ -0,0 +1 @@
1
+ "use client";require(`../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../utils/cn.cjs`),t=require(`../Chip/Chip.cjs`),n=require(`./tagcloud.styles.cjs`);let r=require(`react`);function i(e,t){return e.current&&(e.current.value=t,e.current.dispatchEvent(new Event(`change`,{bubbles:!0}))),{target:{value:t}}}function a(e,t){return Array.isArray(e)?e.filter(e=>t.includes(e)):t.includes(e)?e:null}function o(e,t,n){if(t==null)return[e];if(Array.isArray(t)){let r=t.indexOf(e),i=[...t];return r===-1?((!n||t.length<n)&&i.push(e),i):(i.splice(r,1),i)}return t===e?[]:[t,e]}var s=({className:s,options:c=[],label:l=``,value:u=``,onChange:d,required:f=!1,multiple:p=!1,maxSelection:m=0,tagCloudRef:h,status:g=`default`,helptext:_=``,variant:v=`fill`,size:y=`md`,selectedTextStyle:b=`bold`,...x})=>{let S=(0,r.useRef)(null),C=h&&typeof h==`object`?h:S;(0,r.useImperativeHandle)(h??null,()=>C.current);let w=c.map(e=>e.value),T=p?a(u,w):u,E=e=>{d&&d(i(C,p?o(e,T,m||void 0):e))},D=c.map(e=>{let n=p?Array.isArray(T)&&T.includes(e.value):T===e.value,i=!p&&b===`normal`?`tag-cloud__chip--normal-selected`:void 0;return(0,r.createElement)(t.default,{key:e.value,active:n,as:`button`,onClick:()=>E(e.value),variant:v,size:y,className:i,type:`button`},e.label)});return(0,r.createElement)(`div`,{...x,ref:C,className:e.default(n.tagCloudVariants({status:g}),s),"data-clad":`Tag Cloud`},l?(0,r.createElement)(`label`,{className:e.default(`tag-cloud__label`,f&&`required`)},l):null,(0,r.createElement)(`div`,{className:`tag-cloud__chips`},...D),_?(0,r.createElement)(`p`,{className:`tag-cloud__helptext`},_):null)};s.displayName=`TagCloud`,exports.default=s;
@@ -1,6 +1,6 @@
1
1
  import { TagCloudProps } from './types';
2
2
  declare const TagCloud: {
3
- ({ className, options, label, value, onChange, required, multiple, maxSelection, tagCloudRef, status, helptext, variant, selectedTextStyle, ...rest }: TagCloudProps): import('react').DetailedReactHTMLElement<{
3
+ ({ className, options, label, value, onChange, required, multiple, maxSelection, tagCloudRef, status, helptext, variant, size, selectedTextStyle, ...rest }: TagCloudProps): import('react').DetailedReactHTMLElement<{
4
4
  ref: import('react').RefObject<HTMLDivElement>;
5
5
  className: string;
6
6
  'data-clad': string;
@@ -0,0 +1,48 @@
1
+ "use client";
2
+ import e from "../../utils/cn.es.js";
3
+ import t from "../Chip/Chip.es.js";
4
+ import { tagCloudVariants as n } from "./tagcloud.styles.es.js";
5
+ import { createElement as r, useImperativeHandle as i, useRef as a } from "react";
6
+ //#region src/components/TagCloud/TagCloud.tsx
7
+ function o(e, t) {
8
+ return e.current && (e.current.value = t, e.current.dispatchEvent(new Event("change", { bubbles: !0 }))), { target: { value: t } };
9
+ }
10
+ function s(e, t) {
11
+ return Array.isArray(e) ? e.filter((e) => t.includes(e)) : t.includes(e) ? e : null;
12
+ }
13
+ function c(e, t, n) {
14
+ if (t == null) return [e];
15
+ if (Array.isArray(t)) {
16
+ let r = t.indexOf(e), i = [...t];
17
+ return r === -1 ? ((!n || t.length < n) && i.push(e), i) : (i.splice(r, 1), i);
18
+ }
19
+ return t === e ? [] : [t, e];
20
+ }
21
+ var l = ({ className: l, options: u = [], label: d = "", value: f = "", onChange: p, required: m = !1, multiple: h = !1, maxSelection: g = 0, tagCloudRef: _, status: v = "default", helptext: y = "", variant: b = "fill", size: x = "md", selectedTextStyle: S = "bold", ...C }) => {
22
+ let w = a(null), T = _ && typeof _ == "object" ? _ : w;
23
+ i(_ ?? null, () => T.current);
24
+ let E = u.map((e) => e.value), D = h ? s(f, E) : f, O = (e) => {
25
+ p && p(o(T, h ? c(e, D, g || void 0) : e));
26
+ }, k = u.map((e) => {
27
+ let n = h ? Array.isArray(D) && D.includes(e.value) : D === e.value, i = !h && S === "normal" ? "tag-cloud__chip--normal-selected" : void 0;
28
+ return r(t, {
29
+ key: e.value,
30
+ active: n,
31
+ as: "button",
32
+ onClick: () => O(e.value),
33
+ variant: b,
34
+ size: x,
35
+ className: i,
36
+ type: "button"
37
+ }, e.label);
38
+ });
39
+ return r("div", {
40
+ ...C,
41
+ ref: T,
42
+ className: e(n({ status: v }), l),
43
+ "data-clad": "Tag Cloud"
44
+ }, d ? r("label", { className: e("tag-cloud__label", m && "required") }, d) : null, r("div", { className: "tag-cloud__chips" }, ...k), y ? r("p", { className: "tag-cloud__helptext" }, y) : null);
45
+ };
46
+ l.displayName = "TagCloud";
47
+ //#endregion
48
+ export { l as default };
@@ -0,0 +1 @@
1
+ require(`../../_virtual/_rolldown/runtime.cjs`);var e=(0,require(`tailwind-variants/lite`).tv)({base:`tag-cloud`,defaultVariants:{status:`default`},variants:{status:{default:``,error:`tag-cloud--error`}}});exports.tagCloudVariants=e;
@@ -0,0 +1,12 @@
1
+ import { tv as e } from "tailwind-variants/lite";
2
+ //#region src/components/TagCloud/tagcloud.styles.ts
3
+ var t = e({
4
+ base: "tag-cloud",
5
+ defaultVariants: { status: "default" },
6
+ variants: { status: {
7
+ default: "",
8
+ error: "tag-cloud--error"
9
+ } }
10
+ });
11
+ //#endregion
12
+ export { t as tagCloudVariants };
@@ -22,5 +22,10 @@ export type TagCloudProps = TagCloudVariants & Omit<React.HTMLAttributes<HTMLDiv
22
22
  tagCloudRef?: React.Ref<HTMLDivElement>;
23
23
  helptext?: string;
24
24
  variant?: 'fill' | 'normal' | 'outline';
25
+ /**
26
+ * Size forwarded to each rendered Chip
27
+ * @default 'md'
28
+ */
29
+ size?: 'sm' | 'md' | 'lg' | 'xl';
25
30
  selectedTextStyle?: 'bold' | 'normal';
26
31
  };
@@ -0,0 +1 @@
1
+ "use client";require(`../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../utils/cn.cjs`),t=require(`../../utils/sizes.cjs`),n=require(`./text-area.styles.cjs`);let r=require(`react`),i=require(`@chotot/icons`),a=require(`react/jsx-runtime`);var o=()=>{};function s(e){let{current:t}=e;if(!t)return;let n=t.value;t.value=``;let r=new Event(`change`,{bubbles:!0});r.simulated=!0,t._valueTracker?.setValue?.(n),t.dispatchEvent(r)}var c=({id:c=``,name:l,label:u=``,value:d=``,onChange:f=o,onBlur:p=o,onFocus:m=o,disabled:h=!1,required:g=!1,status:_=`default`,helptext:v=``,helptextClassName:y=``,inputRef:b,resize:x=`none`,lines:S=5,placeholder:C=``,inputMode:w=`text`,width:T=`full`,characterLimit:E=0,isResizeableOnFocus:D=!1,allowClear:O=!0,autoSize:k=!1,className:A,...j})=>{let M=(0,r.useRef)(null),N=typeof b==`object`&&b?b:M;(0,r.useImperativeHandle)(b,()=>N.current);let P=16+(S+1)*20,[F,I]=(0,r.useState)(P),L=e.default(`text-area-el`,d&&`hasValue`,g&&`required`),R=()=>{N.current&&(N.current.style.height=`auto`,N.current.style.height=`${N.current.scrollHeight}px`)};(0,r.useEffect)(()=>{k&&R()},[d,k]);let z=e=>{k&&R(),f(e)},B=[`both`,`horizontal`,`vertical`].includes(x),V=e.default(n.textAreaVariants({status:_}),h&&`disabled`,B&&`resize-${x}`,O&&`showRightIcon`),H=t.SIZES_MAP[T]||`initial`,U=()=>{N.current?.focus()},W=(0,r.useCallback)(e=>{D&&I(P*2),m(e)},[D,P,m]),G=(0,r.useCallback)(e=>{D&&I(P),p(e)},[D,P,p]),K=()=>{O&&s(N)};return(0,a.jsxs)(`div`,{"data-clad":`Input Field - Text Area`,className:e.default(`text-area-container`,A),style:{width:H},children:[(0,a.jsxs)(`div`,{className:V,style:{height:k?void 0:`${F}px`,minHeight:`${F}px`},children:[(0,a.jsx)(`div`,{className:`focus-capture`,onClick:U}),(0,a.jsx)(`textarea`,{...j,ref:N,className:L,id:c||void 0,name:l||void 0,placeholder:C||void 0,maxLength:E||void 0,value:d,disabled:h,required:g,inputMode:w,onChange:z,onFocus:W,onBlur:G}),!!u&&(0,a.jsx)(`label`,{htmlFor:c,children:u}),!!O&&!!d&&(0,a.jsx)(`button`,{tabIndex:-1,type:`button`,onClick:K,children:(0,a.jsx)(i.CloseFilled,{width:`20px`,height:`30px`,color:`var(--color-icon-tertiary)`})})]}),v?(0,a.jsx)(`p`,{className:e.default(`text-area-helptext`,y),children:v}):null]})};c.displayName=`TextArea`,exports.default=c;
@@ -0,0 +1,104 @@
1
+ "use client";
2
+ import e from "../../utils/cn.es.js";
3
+ import { SIZES_MAP as t } from "../../utils/sizes.es.js";
4
+ import { textAreaVariants as n } from "./text-area.styles.es.js";
5
+ import { useCallback as r, useEffect as i, useImperativeHandle as a, useRef as o, useState as s } from "react";
6
+ import { CloseFilled as c } from "@chotot/icons";
7
+ import { jsx as l, jsxs as u } from "react/jsx-runtime";
8
+ //#region src/components/TextArea/TextArea.tsx
9
+ var d = () => {};
10
+ function f(e) {
11
+ let { current: t } = e;
12
+ if (!t) return;
13
+ let n = t.value;
14
+ t.value = "";
15
+ let r = new Event("change", { bubbles: !0 });
16
+ r.simulated = !0, t._valueTracker?.setValue?.(n), t.dispatchEvent(r);
17
+ }
18
+ var p = ({ id: p = "", name: m, label: h = "", value: g = "", onChange: _ = d, onBlur: v = d, onFocus: y = d, disabled: b = !1, required: x = !1, status: S = "default", helptext: C = "", helptextClassName: w = "", inputRef: T, resize: E = "none", lines: D = 5, placeholder: O = "", inputMode: k = "text", width: A = "full", characterLimit: j = 0, isResizeableOnFocus: M = !1, allowClear: N = !0, autoSize: P = !1, className: F, ...I }) => {
19
+ let L = o(null), R = typeof T == "object" && T ? T : L;
20
+ a(T, () => R.current);
21
+ let z = 16 + (D + 1) * 20, [B, V] = s(z), H = e("text-area-el", g && "hasValue", x && "required"), U = () => {
22
+ R.current && (R.current.style.height = "auto", R.current.style.height = `${R.current.scrollHeight}px`);
23
+ };
24
+ i(() => {
25
+ P && U();
26
+ }, [g, P]);
27
+ let W = (e) => {
28
+ P && U(), _(e);
29
+ }, G = [
30
+ "both",
31
+ "horizontal",
32
+ "vertical"
33
+ ].includes(E), K = e(n({ status: S }), b && "disabled", G && `resize-${E}`, N && "showRightIcon"), q = t[A] || "initial", J = () => {
34
+ R.current?.focus();
35
+ }, Y = r((e) => {
36
+ M && V(z * 2), y(e);
37
+ }, [
38
+ M,
39
+ z,
40
+ y
41
+ ]), X = r((e) => {
42
+ M && V(z), v(e);
43
+ }, [
44
+ M,
45
+ z,
46
+ v
47
+ ]), Z = () => {
48
+ N && f(R);
49
+ };
50
+ return /* @__PURE__ */ u("div", {
51
+ "data-clad": "Input Field - Text Area",
52
+ className: e("text-area-container", F),
53
+ style: { width: q },
54
+ children: [/* @__PURE__ */ u("div", {
55
+ className: K,
56
+ style: {
57
+ height: P ? void 0 : `${B}px`,
58
+ minHeight: `${B}px`
59
+ },
60
+ children: [
61
+ /* @__PURE__ */ l("div", {
62
+ className: "focus-capture",
63
+ onClick: J
64
+ }),
65
+ /* @__PURE__ */ l("textarea", {
66
+ ...I,
67
+ ref: R,
68
+ className: H,
69
+ id: p || void 0,
70
+ name: m || void 0,
71
+ placeholder: O || void 0,
72
+ maxLength: j || void 0,
73
+ value: g,
74
+ disabled: b,
75
+ required: x,
76
+ inputMode: k,
77
+ onChange: W,
78
+ onFocus: Y,
79
+ onBlur: X
80
+ }),
81
+ !!h && /* @__PURE__ */ l("label", {
82
+ htmlFor: p,
83
+ children: h
84
+ }),
85
+ !!N && !!g && /* @__PURE__ */ l("button", {
86
+ tabIndex: -1,
87
+ type: "button",
88
+ onClick: Z,
89
+ children: /* @__PURE__ */ l(c, {
90
+ width: "20px",
91
+ height: "30px",
92
+ color: "var(--color-icon-tertiary)"
93
+ })
94
+ })
95
+ ]
96
+ }), C ? /* @__PURE__ */ l("p", {
97
+ className: e("text-area-helptext", w),
98
+ children: C
99
+ }) : null]
100
+ });
101
+ };
102
+ p.displayName = "TextArea";
103
+ //#endregion
104
+ export { p as default };
@@ -0,0 +1 @@
1
+ require(`../../_virtual/_rolldown/runtime.cjs`);var e=(0,require(`tailwind-variants/lite`).tv)({base:`text-area`,defaultVariants:{status:`default`},variants:{status:{default:``,warning:`warning`,error:`error`}}});exports.textAreaVariants=e;
@@ -0,0 +1,13 @@
1
+ import { tv as e } from "tailwind-variants/lite";
2
+ //#region src/components/TextArea/text-area.styles.ts
3
+ var t = e({
4
+ base: "text-area",
5
+ defaultVariants: { status: "default" },
6
+ variants: { status: {
7
+ default: "",
8
+ warning: "warning",
9
+ error: "error"
10
+ } }
11
+ });
12
+ //#endregion
13
+ export { t as textAreaVariants };
@@ -0,0 +1 @@
1
+ require(`../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../utils/cn.cjs`),t=require(`../../types/index.cjs`),n=require(`./textlabel.styles.cjs`);let r=require(`react`),i=require(`@chotot/icons`);var a={info:i.InfoFilled,success:i.CircleCheckFilled,error:i.CloseFilled,warning:i.WarningFilled,neutral:i.InfoFilled},o=t.forwardRef((t,i)=>{let{size:o=`md`,color:s=`info`,type:c=`text`,label:l=``,icon:u,className:d,as:f=`div`,children:p,...m}=t,h=a[s??`info`],g=c===`status`?u??(0,r.createElement)(h,{"aria-hidden":!0}):null;return(0,r.createElement)(f,{ref:i,className:e.default(n.textlabelVariants({size:o,color:s,type:c}),d),"data-clad":`TextLabel`,...m},g,(0,r.createElement)(`span`,null,l??p))});o.displayName=`TextLabel`,exports.default=o;
@@ -0,0 +1,28 @@
1
+ import e from "../../utils/cn.es.js";
2
+ import { forwardRef as t } from "../../types/index.es.js";
3
+ import { textlabelVariants as n } from "./textlabel.styles.es.js";
4
+ import { createElement as r } from "react";
5
+ import { CircleCheckFilled as i, CloseFilled as a, InfoFilled as o, WarningFilled as s } from "@chotot/icons";
6
+ //#region src/components/TextLabel/TextLabel.tsx
7
+ var c = {
8
+ info: o,
9
+ success: i,
10
+ error: a,
11
+ warning: s,
12
+ neutral: o
13
+ }, l = t((t, i) => {
14
+ let { size: a = "md", color: o = "info", type: s = "text", label: l = "", icon: u, className: d, as: f = "div", children: p, ...m } = t, h = c[o ?? "info"], g = s === "status" ? u ?? r(h, { "aria-hidden": !0 }) : null;
15
+ return r(f, {
16
+ ref: i,
17
+ className: e(n({
18
+ size: a,
19
+ color: o,
20
+ type: s
21
+ }), d),
22
+ "data-clad": "TextLabel",
23
+ ...m
24
+ }, g, r("span", null, l ?? p));
25
+ });
26
+ l.displayName = "TextLabel";
27
+ //#endregion
28
+ export { l as default };
@@ -0,0 +1 @@
1
+ require(`../../_virtual/_rolldown/runtime.cjs`);var e=(0,require(`tailwind-variants/lite`).tv)({base:`textlabel`,defaultVariants:{size:`md`,color:`info`,type:`text`},variants:{size:{md:`textlabel--md`,sm:`textlabel--sm`},color:{info:`textlabel--info`,success:`textlabel--success`,error:`textlabel--error`,warning:`textlabel--warning`,neutral:`textlabel--neutral`},type:{text:`textlabel--text`,status:`textlabel--status`}}});exports.textlabelVariants=e;
@@ -0,0 +1,29 @@
1
+ import { tv as e } from "tailwind-variants/lite";
2
+ //#region src/components/TextLabel/textlabel.styles.ts
3
+ var t = e({
4
+ base: "textlabel",
5
+ defaultVariants: {
6
+ size: "md",
7
+ color: "info",
8
+ type: "text"
9
+ },
10
+ variants: {
11
+ size: {
12
+ md: "textlabel--md",
13
+ sm: "textlabel--sm"
14
+ },
15
+ color: {
16
+ info: "textlabel--info",
17
+ success: "textlabel--success",
18
+ error: "textlabel--error",
19
+ warning: "textlabel--warning",
20
+ neutral: "textlabel--neutral"
21
+ },
22
+ type: {
23
+ text: "textlabel--text",
24
+ status: "textlabel--status"
25
+ }
26
+ }
27
+ });
28
+ //#endregion
29
+ export { t as textlabelVariants };
@@ -0,0 +1 @@
1
+ "use client";require(`../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../utils/cn.cjs`),t=require(`./toggle-switch.styles.cjs`);let n=require(`react/jsx-runtime`);var r=()=>{},i=({id:i,name:a,value:o,checked:s=!1,color:c=`primary`,disabled:l=!1,onChange:u=r,size:d=`md`,className:f,...p})=>{let m=!!s;return(0,n.jsx)(`div`,{"data-clad":`Toggle`,className:e.default(t.toggleSwitchVariants({size:d,color:c}),l&&`toggle-switch--disabled`,f),children:(0,n.jsxs)(`label`,{htmlFor:i,className:`toggle-switch-label`,children:[(0,n.jsx)(`span`,{className:e.default(`toggle-switch-inner`,m&&`toggle-switch-inner--active`)}),(0,n.jsx)(`span`,{className:e.default(`toggle-switch-switcher`,m&&`toggle-switch-switcher--active`)}),(0,n.jsx)(`input`,{...p,type:`checkbox`,className:`toggle-switch-checkbox`,name:a,id:i,onChange:u,checked:s,disabled:l,value:o})]})})};i.displayName=`ToggleSwitch`,exports.default=i;
@@ -0,0 +1,37 @@
1
+ "use client";
2
+ import e from "../../utils/cn.es.js";
3
+ import { toggleSwitchVariants as t } from "./toggle-switch.styles.es.js";
4
+ import { jsx as n, jsxs as r } from "react/jsx-runtime";
5
+ //#region src/components/ToggleSwitch/ToggleSwitch.tsx
6
+ var i = () => {}, a = ({ id: a, name: o, value: s, checked: c = !1, color: l = "primary", disabled: u = !1, onChange: d = i, size: f = "md", className: p, ...m }) => {
7
+ let h = !!c;
8
+ return /* @__PURE__ */ n("div", {
9
+ "data-clad": "Toggle",
10
+ className: e(t({
11
+ size: f,
12
+ color: l
13
+ }), u && "toggle-switch--disabled", p),
14
+ children: /* @__PURE__ */ r("label", {
15
+ htmlFor: a,
16
+ className: "toggle-switch-label",
17
+ children: [
18
+ /* @__PURE__ */ n("span", { className: e("toggle-switch-inner", h && "toggle-switch-inner--active") }),
19
+ /* @__PURE__ */ n("span", { className: e("toggle-switch-switcher", h && "toggle-switch-switcher--active") }),
20
+ /* @__PURE__ */ n("input", {
21
+ ...m,
22
+ type: "checkbox",
23
+ className: "toggle-switch-checkbox",
24
+ name: o,
25
+ id: a,
26
+ onChange: d,
27
+ checked: c,
28
+ disabled: u,
29
+ value: s
30
+ })
31
+ ]
32
+ })
33
+ });
34
+ };
35
+ a.displayName = "ToggleSwitch";
36
+ //#endregion
37
+ export { a as default };
@@ -0,0 +1 @@
1
+ require(`../../_virtual/_rolldown/runtime.cjs`);var e=(0,require(`tailwind-variants/lite`).tv)({base:`toggle-switch`,defaultVariants:{size:`md`,color:`primary`},variants:{size:{md:`toggle-switch--md`,sm:`toggle-switch--sm`},color:{primary:`toggle-switch--primary`,info:`toggle-switch--info`,success:`toggle-switch--success`,error:`toggle-switch--error`,neutral:`toggle-switch--neutral`}}});exports.toggleSwitchVariants=e;