@iziui/react 0.0.87-rc → 0.0.89-rc

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 (186) hide show
  1. package/dist/.types/_internal/core/options/CustomOptions.d.ts +6 -1
  2. package/dist/.types/_internal/core/options/createOptions/createOptions.d.ts +1 -1
  3. package/dist/.types/_internal/core/plugin/behavior/defineBoxShadow/defineBoxShadow.d.ts +5 -1
  4. package/dist/.types/_internal/core/plugin/breakpoint/defineBreakpoint/defineBreakpoint.d.ts +2 -0
  5. package/dist/.types/_internal/core/plugin/breakpoint/defineBreakpoint/index.d.ts +1 -0
  6. package/dist/.types/_internal/core/plugin/breakpoint/index.d.ts +1 -0
  7. package/dist/.types/_internal/core/plugin/color/defineBackground/defineBackground.d.ts +5 -1
  8. package/dist/.types/_internal/core/plugin/color/defineBackgroundColor/defineBackgroundColor.d.ts +5 -1
  9. package/dist/.types/_internal/core/plugin/color/defineBorderColor/defineBorderColor.d.ts +5 -1
  10. package/dist/.types/_internal/core/plugin/color/defineColor/defineColor.d.ts +5 -1
  11. package/dist/.types/_internal/core/plugin/definePlugin/definePlugin.d.ts +2 -3
  12. package/dist/.types/_internal/core/plugin/index.d.ts +1 -0
  13. package/dist/.types/_internal/core/plugin/plugin.d.ts +2 -1
  14. package/dist/.types/_internal/core/plugin/shape/defineBorderRadius/defineBorderRadius.d.ts +5 -1
  15. package/dist/.types/_internal/core/plugin/spacing/defineMargin/defineMargin.d.ts +7 -1
  16. package/dist/.types/_internal/core/plugin/spacing/definePadding/definePadding.d.ts +7 -1
  17. package/dist/.types/_internal/toolkit/string/string.d.ts +1 -0
  18. package/dist/.types/_internal/toolkit/uuid/index.d.ts +1 -1
  19. package/dist/.types/_internal/toolkit/uuid/uuid.d.ts +1 -0
  20. package/dist/.types/actions/ButtonIcon/ButtonIcon.d.ts +1 -1
  21. package/dist/.types/actions/ButtonIcon/ButtonIcon.d.ts.map +1 -1
  22. package/dist/.types/core/createComponent.d.ts.map +1 -1
  23. package/dist/.types/display/Icon/Icon.d.ts +2 -0
  24. package/dist/.types/display/Icon/Icon.d.ts.map +1 -1
  25. package/dist/.types/display/Icon/Icon.stories.d.ts.map +1 -1
  26. package/dist/.types/hooks/useResize/useResize.d.ts +1 -1
  27. package/dist/.types/hooks/useResize/useResize.d.ts.map +1 -1
  28. package/dist/.types/lab/Form/Form.stories.d.ts.map +1 -1
  29. package/dist/.types/layout/Stack/Stack.stories.d.ts +1 -0
  30. package/dist/.types/layout/Stack/Stack.stories.d.ts.map +1 -1
  31. package/dist/chunks/{Alert-c5rRrf_E.cjs → Alert-CUgp08gU.cjs} +2 -2
  32. package/dist/chunks/{Alert-c5rRrf_E.cjs.map → Alert-CUgp08gU.cjs.map} +1 -1
  33. package/dist/chunks/{Alert-CxSNWq4w.js → Alert-mOXPwc3e.js} +2 -2
  34. package/dist/chunks/{Alert-CxSNWq4w.js.map → Alert-mOXPwc3e.js.map} +1 -1
  35. package/dist/chunks/{Box-D7fnBKFY.cjs → Box-DdpIV_Bl.cjs} +2 -2
  36. package/dist/chunks/{Box-D7fnBKFY.cjs.map → Box-DdpIV_Bl.cjs.map} +1 -1
  37. package/dist/chunks/{Box-BzStXj3R.js → Box-O2jw08Hf.js} +2 -2
  38. package/dist/chunks/{Box-BzStXj3R.js.map → Box-O2jw08Hf.js.map} +1 -1
  39. package/dist/chunks/ButtonIcon-BMOZPxpN.cjs +2 -0
  40. package/dist/chunks/ButtonIcon-BMOZPxpN.cjs.map +1 -0
  41. package/dist/chunks/ButtonIcon-CYO1Crb-.js +2 -0
  42. package/dist/chunks/ButtonIcon-CYO1Crb-.js.map +1 -0
  43. package/dist/chunks/{Card-wBDtOPXO.js → Card-D_RFnUk2.js} +2 -2
  44. package/dist/chunks/{Card-wBDtOPXO.js.map → Card-D_RFnUk2.js.map} +1 -1
  45. package/dist/chunks/{Card-DqoL_8z0.cjs → Card-DtjP8NP7.cjs} +2 -2
  46. package/dist/chunks/{Card-DqoL_8z0.cjs.map → Card-DtjP8NP7.cjs.map} +1 -1
  47. package/dist/chunks/{CardContent-BOuRiZyj.cjs → CardContent-BqqU9iwO.cjs} +2 -2
  48. package/dist/chunks/{CardContent-BOuRiZyj.cjs.map → CardContent-BqqU9iwO.cjs.map} +1 -1
  49. package/dist/chunks/{CardContent-D0o8c1Yf.js → CardContent-BsSfxSQH.js} +2 -2
  50. package/dist/chunks/{CardContent-D0o8c1Yf.js.map → CardContent-BsSfxSQH.js.map} +1 -1
  51. package/dist/chunks/{DrawerContent-DuvNqOEG.js → DrawerContent-CYQSz1G-.js} +2 -2
  52. package/dist/chunks/{DrawerContent-DuvNqOEG.js.map → DrawerContent-CYQSz1G-.js.map} +1 -1
  53. package/dist/chunks/{DrawerContent-CQrCertn.cjs → DrawerContent-Dyc1evVF.cjs} +2 -2
  54. package/dist/chunks/{DrawerContent-CQrCertn.cjs.map → DrawerContent-Dyc1evVF.cjs.map} +1 -1
  55. package/dist/chunks/Icon-CIrgQex7.cjs +2 -0
  56. package/dist/chunks/Icon-CIrgQex7.cjs.map +1 -0
  57. package/dist/chunks/Icon-imOBrsbL.js +2 -0
  58. package/dist/chunks/Icon-imOBrsbL.js.map +1 -0
  59. package/dist/chunks/{MenuButton-DbrtU31-.js → MenuButton-CvQxSdho.js} +2 -2
  60. package/dist/chunks/{MenuButton-DbrtU31-.js.map → MenuButton-CvQxSdho.js.map} +1 -1
  61. package/dist/chunks/{MenuButton-BF6coRYt.cjs → MenuButton-D0cPZU6x.cjs} +2 -2
  62. package/dist/chunks/{MenuButton-BF6coRYt.cjs.map → MenuButton-D0cPZU6x.cjs.map} +1 -1
  63. package/dist/chunks/{Stack-DsVkiTT_.cjs → Stack-B_lU0ez7.cjs} +2 -2
  64. package/dist/chunks/{Stack-DsVkiTT_.cjs.map → Stack-B_lU0ez7.cjs.map} +1 -1
  65. package/dist/chunks/{Stack-D0feJnm7.js → Stack-Deow48Th.js} +2 -2
  66. package/dist/chunks/{Stack-D0feJnm7.js.map → Stack-Deow48Th.js.map} +1 -1
  67. package/dist/chunks/{TableHeader-BDY2xI-0.js → TableHeader-DnifrYxO.js} +2 -2
  68. package/dist/chunks/{TableHeader-BDY2xI-0.js.map → TableHeader-DnifrYxO.js.map} +1 -1
  69. package/dist/chunks/{TableHeader-DNnzAUGG.cjs → TableHeader-SKzj2zHB.cjs} +2 -2
  70. package/dist/chunks/{TableHeader-DNnzAUGG.cjs.map → TableHeader-SKzj2zHB.cjs.map} +1 -1
  71. package/dist/chunks/{Typography-hazfs4Ye.js → Typography-BrJZyxiT.js} +2 -2
  72. package/dist/chunks/{Typography-hazfs4Ye.js.map → Typography-BrJZyxiT.js.map} +1 -1
  73. package/dist/chunks/{Typography-C7B3jwUf.cjs → Typography-DW57lh3e.cjs} +2 -2
  74. package/dist/chunks/{Typography-C7B3jwUf.cjs.map → Typography-DW57lh3e.cjs.map} +1 -1
  75. package/dist/chunks/createComponent-CovqNaAJ.js +8 -0
  76. package/dist/chunks/createComponent-CovqNaAJ.js.map +1 -0
  77. package/dist/chunks/createComponent-Dkt68kvT.cjs +8 -0
  78. package/dist/chunks/createComponent-Dkt68kvT.cjs.map +1 -0
  79. package/dist/chunks/useMenu-DewYBiar.cjs +2 -0
  80. package/dist/chunks/{useMenu-Bw3Im-FW.cjs.map → useMenu-DewYBiar.cjs.map} +1 -1
  81. package/dist/chunks/useMenu-DuX7EGHi.js +2 -0
  82. package/dist/chunks/{useMenu-DU5PYJUH.js.map → useMenu-DuX7EGHi.js.map} +1 -1
  83. package/dist/chunks/useResize-BUftB918.js +2 -0
  84. package/dist/chunks/useResize-BUftB918.js.map +1 -0
  85. package/dist/chunks/useResize-Dnf6Ktrn.cjs +2 -0
  86. package/dist/chunks/useResize-Dnf6Ktrn.cjs.map +1 -0
  87. package/dist/chunks/{useTheme-g5gOUmLf.js → useTheme-BYuNiCiH.js} +2 -2
  88. package/dist/chunks/{useTheme-g5gOUmLf.js.map → useTheme-BYuNiCiH.js.map} +1 -1
  89. package/dist/chunks/{useTheme-DhX2tM8O.cjs → useTheme-DsrjDJKC.cjs} +2 -2
  90. package/dist/chunks/{useTheme-DhX2tM8O.cjs.map → useTheme-DsrjDJKC.cjs.map} +1 -1
  91. package/dist/components/Alert/index.cjs +1 -1
  92. package/dist/components/Alert/index.js +1 -1
  93. package/dist/components/Avatar/index.cjs +1 -1
  94. package/dist/components/Avatar/index.cjs.map +1 -1
  95. package/dist/components/Avatar/index.js +1 -1
  96. package/dist/components/Avatar/index.js.map +1 -1
  97. package/dist/components/Box/index.cjs +1 -1
  98. package/dist/components/Box/index.js +1 -1
  99. package/dist/components/Button/index.cjs +1 -1
  100. package/dist/components/Button/index.js +1 -1
  101. package/dist/components/ButtonIcon/index.cjs +1 -1
  102. package/dist/components/ButtonIcon/index.js +1 -1
  103. package/dist/components/Card/index.cjs +1 -1
  104. package/dist/components/Card/index.js +1 -1
  105. package/dist/components/Checkbox/index.cjs +1 -1
  106. package/dist/components/Checkbox/index.js +1 -1
  107. package/dist/components/CheckboxGroup/index.cjs +1 -1
  108. package/dist/components/CheckboxGroup/index.js +1 -1
  109. package/dist/components/Chip/index.cjs +1 -1
  110. package/dist/components/Chip/index.js +1 -1
  111. package/dist/components/ColorPicker/index.cjs +1 -1
  112. package/dist/components/ColorPicker/index.cjs.map +1 -1
  113. package/dist/components/ColorPicker/index.js +1 -1
  114. package/dist/components/ColorPicker/index.js.map +1 -1
  115. package/dist/components/Container/index.cjs +1 -1
  116. package/dist/components/Container/index.js +1 -1
  117. package/dist/components/Divider/index.cjs +1 -1
  118. package/dist/components/Divider/index.js +1 -1
  119. package/dist/components/Drawer/index.cjs +1 -1
  120. package/dist/components/Drawer/index.js +1 -1
  121. package/dist/components/Icon/index.cjs +1 -1
  122. package/dist/components/Icon/index.js +1 -1
  123. package/dist/components/Input/index.cjs +1 -1
  124. package/dist/components/Input/index.js +1 -1
  125. package/dist/components/InputFile/index.cjs +1 -1
  126. package/dist/components/InputFile/index.js +1 -1
  127. package/dist/components/Loading/index.cjs +1 -1
  128. package/dist/components/Loading/index.js +1 -1
  129. package/dist/components/Menu/index.cjs +1 -1
  130. package/dist/components/Menu/index.js +1 -1
  131. package/dist/components/Modal/index.cjs +1 -1
  132. package/dist/components/Modal/index.cjs.map +1 -1
  133. package/dist/components/Modal/index.js +1 -1
  134. package/dist/components/Modal/index.js.map +1 -1
  135. package/dist/components/Select/index.cjs +1 -1
  136. package/dist/components/Select/index.cjs.map +1 -1
  137. package/dist/components/Select/index.js +1 -1
  138. package/dist/components/Select/index.js.map +1 -1
  139. package/dist/components/Skeleton/index.cjs +1 -1
  140. package/dist/components/Skeleton/index.js +1 -1
  141. package/dist/components/Stack/index.cjs +1 -1
  142. package/dist/components/Stack/index.js +1 -1
  143. package/dist/components/Switch/index.cjs +1 -1
  144. package/dist/components/Switch/index.cjs.map +1 -1
  145. package/dist/components/Switch/index.js +1 -1
  146. package/dist/components/Switch/index.js.map +1 -1
  147. package/dist/components/Table/index.cjs +1 -1
  148. package/dist/components/Table/index.js +1 -1
  149. package/dist/components/Toast/index.cjs +1 -1
  150. package/dist/components/Toast/index.cjs.map +1 -1
  151. package/dist/components/Toast/index.js +1 -1
  152. package/dist/components/Toast/index.js.map +1 -1
  153. package/dist/components/Tooltip/index.cjs +1 -1
  154. package/dist/components/Tooltip/index.js +1 -1
  155. package/dist/components/Typography/index.cjs +1 -1
  156. package/dist/components/Typography/index.js +1 -1
  157. package/dist/hooks/useResize/index.cjs +1 -1
  158. package/dist/hooks/useResize/index.js +1 -1
  159. package/dist/index.cjs +1 -1
  160. package/dist/index.js +1 -1
  161. package/dist/style.css +7 -7
  162. package/dist/theme/index.cjs +1 -1
  163. package/dist/theme/index.js +1 -1
  164. package/package.json +1 -1
  165. package/dist/chunks/ButtonIcon-Cad6goHv.js +0 -2
  166. package/dist/chunks/ButtonIcon-Cad6goHv.js.map +0 -1
  167. package/dist/chunks/ButtonIcon-QfMInabj.cjs +0 -2
  168. package/dist/chunks/ButtonIcon-QfMInabj.cjs.map +0 -1
  169. package/dist/chunks/Icon-BGZ3K3Nf.js +0 -2
  170. package/dist/chunks/Icon-BGZ3K3Nf.js.map +0 -1
  171. package/dist/chunks/Icon-D5fDXkwG.cjs +0 -2
  172. package/dist/chunks/Icon-D5fDXkwG.cjs.map +0 -1
  173. package/dist/chunks/createComponent-BBXW0GJ6.cjs +0 -2
  174. package/dist/chunks/createComponent-BBXW0GJ6.cjs.map +0 -1
  175. package/dist/chunks/createComponent-DZqrA_Tp.js +0 -2
  176. package/dist/chunks/createComponent-DZqrA_Tp.js.map +0 -1
  177. package/dist/chunks/useMenu-Bw3Im-FW.cjs +0 -2
  178. package/dist/chunks/useMenu-DU5PYJUH.js +0 -2
  179. package/dist/chunks/useResize-B-oebgDR.cjs +0 -2
  180. package/dist/chunks/useResize-B-oebgDR.cjs.map +0 -1
  181. package/dist/chunks/useResize-BjM6tiAF.js +0 -2
  182. package/dist/chunks/useResize-BjM6tiAF.js.map +0 -1
  183. package/dist/chunks/uuid-dGvr9vBZ.js +0 -2
  184. package/dist/chunks/uuid-dGvr9vBZ.js.map +0 -1
  185. package/dist/chunks/uuid-omnJ9TjZ.cjs +0 -2
  186. package/dist/chunks/uuid-omnJ9TjZ.cjs.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Icon-CIrgQex7.cjs","sources":["../../src/display/Icon/Icon.tsx"],"sourcesContent":["import { HTMLAttributes } from 'react';\n\nimport { prefix } from '@iziui/tokens/web/js';\n\nimport { joinClass } from '@iziui/core/utils';\nimport type { Colors } from '@iziui/core/theme';\n\nimport createComponent from '../../core/createComponent';\n\nimport '@iziui/styles/components/Icon.scss';\n\nexport interface IconProps extends HTMLAttributes<HTMLElement> {\n name: string;\n size?: number;\n color?: Colors;\n}\n\nfunction Icon({ name, color, size = 24, ...props }: IconProps) {\n const clss = joinClass(\n `${prefix}-icon`,\n color && `${prefix}-icon--${color}`,\n 'uil',\n `uil-${name}`,\n props.className\n );\n\n return (\n <i {...props} className={clss} style={{ fontSize: size, ...props.style }}></i>\n );\n}\n\nexport default createComponent(Icon);"],"names":["Icon","name","color","size","props","clss","joinClass","prefix","jsx","createComponent"],"mappings":"sKAiBA,SAASA,EAAK,CAAE,KAAAC,EAAM,MAAAC,EAAO,KAAAC,EAAO,GAAI,GAAGC,GAAoB,CAC7D,MAAMC,EAAOC,EAAAA,UACX,GAAGC,EAAAA,MAAM,QACTL,GAAS,GAAGK,EAAAA,MAAM,UAAUL,CAAK,GACjC,MACA,OAAOD,CAAI,GACXG,EAAM,SAAA,EAGR,OACEI,EAAAA,IAAC,IAAA,CAAG,GAAGJ,EAAO,UAAWC,EAAM,MAAO,CAAE,SAAUF,EAAM,GAAGC,EAAM,MAAM,CAAG,CAE9E,CAEA,MAAAJ,EAAeS,EAAAA,gBAAgBT,CAAI"}
@@ -0,0 +1,2 @@
1
+ import{jsx as e}from"react/jsx-runtime";import{p as t}from"./index-CZ41y9Hn.js";import{j as m}from"./joinClass-anSpaauN.js";import{c as a}from"./createComponent-CovqNaAJ.js";function r({name:i,color:s,size:n=24,...o}){const c=m(`${t}-icon`,s&&`${t}-icon--${s}`,"uil",`uil-${i}`,o.className);return e("i",{...o,className:c,style:{fontSize:n,...o.style}})}const u=a(r);export{u as I};
2
+ //# sourceMappingURL=Icon-imOBrsbL.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Icon-imOBrsbL.js","sources":["../../src/display/Icon/Icon.tsx"],"sourcesContent":["import { HTMLAttributes } from 'react';\n\nimport { prefix } from '@iziui/tokens/web/js';\n\nimport { joinClass } from '@iziui/core/utils';\nimport type { Colors } from '@iziui/core/theme';\n\nimport createComponent from '../../core/createComponent';\n\nimport '@iziui/styles/components/Icon.scss';\n\nexport interface IconProps extends HTMLAttributes<HTMLElement> {\n name: string;\n size?: number;\n color?: Colors;\n}\n\nfunction Icon({ name, color, size = 24, ...props }: IconProps) {\n const clss = joinClass(\n `${prefix}-icon`,\n color && `${prefix}-icon--${color}`,\n 'uil',\n `uil-${name}`,\n props.className\n );\n\n return (\n <i {...props} className={clss} style={{ fontSize: size, ...props.style }}></i>\n );\n}\n\nexport default createComponent(Icon);"],"names":["Icon","name","color","size","props","clss","joinClass","prefix","jsx","Icon$1","createComponent"],"mappings":"8KAiBA,SAASA,EAAK,CAAE,KAAAC,EAAM,MAAAC,EAAO,KAAAC,EAAO,GAAI,GAAGC,GAAoB,CAC7D,MAAMC,EAAOC,EACX,GAAGC,CAAM,QACTL,GAAS,GAAGK,CAAM,UAAUL,CAAK,GACjC,MACA,OAAOD,CAAI,GACXG,EAAM,SAAA,EAGR,OACEI,EAAC,IAAA,CAAG,GAAGJ,EAAO,UAAWC,EAAM,MAAO,CAAE,SAAUF,EAAM,GAAGC,EAAM,MAAM,CAAG,CAE9E,CAEA,MAAAK,EAAeC,EAAgBV,CAAI"}
@@ -1,2 +1,2 @@
1
- import{jsxs as s,jsx as i}from"react/jsx-runtime";import{cloneElement as a}from"react";import{p as r}from"./index-CZ41y9Hn.js";import{j as u}from"./joinClass-anSpaauN.js";import{R as c}from"./Ripple-Bq9bxg4k.js";import{c as p}from"./createComponent-DZqrA_Tp.js";function f({label:o,icon:e,color:t="grey",...n}){const m=u(`${r}-menu__item`,t&&`${r}-menu__item--${t}`,n.className);return s("button",{...n,className:m,children:[e&&a(e,{size:18,style:{marginRight:8}}),o,i(c,{})]})}const R=p(f);export{R as M};
2
- //# sourceMappingURL=MenuButton-DbrtU31-.js.map
1
+ import{jsxs as s,jsx as i}from"react/jsx-runtime";import{cloneElement as a}from"react";import{p as r}from"./index-CZ41y9Hn.js";import{j as u}from"./joinClass-anSpaauN.js";import{R as c}from"./Ripple-Bq9bxg4k.js";import{c as p}from"./createComponent-CovqNaAJ.js";function f({label:o,icon:e,color:t="grey",...n}){const m=u(`${r}-menu__item`,t&&`${r}-menu__item--${t}`,n.className);return s("button",{...n,className:m,children:[e&&a(e,{size:18,style:{marginRight:8}}),o,i(c,{})]})}const R=p(f);export{R as M};
2
+ //# sourceMappingURL=MenuButton-CvQxSdho.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"MenuButton-DbrtU31-.js","sources":["../../src/navigation/Menu/MenuButton.tsx"],"sourcesContent":["import { type ButtonHTMLAttributes, cloneElement } from 'react';\n\nimport { prefix } from '@iziui/tokens/web/js';\n\nimport { joinClass } from '@iziui/core/utils/joinClass';\nimport type { Colors } from '@iziui/core/theme';\n\nimport type { IconProps } from '@/display/Icon';\nimport Ripple from '@/actions/Ripple';\n\nimport createComponent from '../../core/createComponent';\n\nexport interface MenuButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {\n label: string;\n color?: Colors;\n icon?: React.JSX.Element;\n}\n\nfunction MenuButton({ label, icon, color = 'grey', ...props }: MenuButtonProps) {\n const className = joinClass(\n `${prefix}-menu__item`,\n color && `${prefix}-menu__item--${color}`,\n props.className\n );\n\n const renderIcon = () => {\n return icon && cloneElement<IconProps>(icon, {\n size: 18,\n style: { marginRight: 8 }\n });\n };\n\n return (\n <button {...props} className={className}>\n {renderIcon()}\n {label}\n <Ripple />\n </button>\n );\n}\n\nexport default createComponent(MenuButton);"],"names":["MenuButton","label","icon","color","props","className","joinClass","prefix","jsxs","cloneElement","Ripple","MenuButton_default","createComponent"],"mappings":"sQAkBA,SAASA,EAAW,CAAE,MAAAC,EAAO,KAAAC,EAAM,MAAAC,EAAQ,OAAQ,GAAGC,GAA0B,CAC9E,MAAMC,EAAYC,EAChB,GAAGC,CAAM,cACTJ,GAAS,GAAGI,CAAM,gBAAgBJ,CAAK,GACvCC,EAAM,SAAA,EAUR,OACEI,EAAC,SAAA,CAAQ,GAAGJ,EAAO,UAAAC,EAChB,SAAA,CARIH,GAAQO,EAAwBP,EAAM,CAC3C,KAAM,GACN,MAAO,CAAE,YAAa,CAAA,CAAE,CACzB,EAMED,IACAS,EAAA,CAAA,CAAO,CAAA,EACV,CAEJ,CAEA,MAAAC,EAAeC,EAAgBZ,CAAU"}
1
+ {"version":3,"file":"MenuButton-CvQxSdho.js","sources":["../../src/navigation/Menu/MenuButton.tsx"],"sourcesContent":["import { type ButtonHTMLAttributes, cloneElement } from 'react';\n\nimport { prefix } from '@iziui/tokens/web/js';\n\nimport { joinClass } from '@iziui/core/utils/joinClass';\nimport type { Colors } from '@iziui/core/theme';\n\nimport type { IconProps } from '@/display/Icon';\nimport Ripple from '@/actions/Ripple';\n\nimport createComponent from '../../core/createComponent';\n\nexport interface MenuButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {\n label: string;\n color?: Colors;\n icon?: React.JSX.Element;\n}\n\nfunction MenuButton({ label, icon, color = 'grey', ...props }: MenuButtonProps) {\n const className = joinClass(\n `${prefix}-menu__item`,\n color && `${prefix}-menu__item--${color}`,\n props.className\n );\n\n const renderIcon = () => {\n return icon && cloneElement<IconProps>(icon, {\n size: 18,\n style: { marginRight: 8 }\n });\n };\n\n return (\n <button {...props} className={className}>\n {renderIcon()}\n {label}\n <Ripple />\n </button>\n );\n}\n\nexport default createComponent(MenuButton);"],"names":["MenuButton","label","icon","color","props","className","joinClass","prefix","jsxs","cloneElement","Ripple","MenuButton_default","createComponent"],"mappings":"sQAkBA,SAASA,EAAW,CAAE,MAAAC,EAAO,KAAAC,EAAM,MAAAC,EAAQ,OAAQ,GAAGC,GAA0B,CAC9E,MAAMC,EAAYC,EAChB,GAAGC,CAAM,cACTJ,GAAS,GAAGI,CAAM,gBAAgBJ,CAAK,GACvCC,EAAM,SAAA,EAUR,OACEI,EAAC,SAAA,CAAQ,GAAGJ,EAAO,UAAAC,EAChB,SAAA,CARIH,GAAQO,EAAwBP,EAAM,CAC3C,KAAM,GACN,MAAO,CAAE,YAAa,CAAA,CAAE,CACzB,EAMED,IACAS,EAAA,CAAA,CAAO,CAAA,EACV,CAEJ,CAEA,MAAAC,EAAeC,EAAgBZ,CAAU"}
@@ -1,2 +1,2 @@
1
- "use strict";const r=require("react/jsx-runtime"),c=require("react"),s=require("./index-DYxwT4uW.cjs"),a=require("./joinClass-Jk3EszKD.cjs"),l=require("./Ripple-Dy4i91j1.cjs"),m=require("./createComponent-BBXW0GJ6.cjs");function p({label:u,icon:e,color:n="grey",...t}){const i=a.joinClass(`${s.prefix}-menu__item`,n&&`${s.prefix}-menu__item--${n}`,t.className),o=()=>e&&c.cloneElement(e,{size:18,style:{marginRight:8}});return r.jsxs("button",{...t,className:i,children:[o(),u,r.jsx(l.Ripple,{})]})}const q=m.createComponent(p);exports.MenuButton_default=q;
2
- //# sourceMappingURL=MenuButton-BF6coRYt.cjs.map
1
+ "use strict";const r=require("react/jsx-runtime"),c=require("react"),s=require("./index-DYxwT4uW.cjs"),a=require("./joinClass-Jk3EszKD.cjs"),l=require("./Ripple-Dy4i91j1.cjs"),m=require("./createComponent-Dkt68kvT.cjs");function p({label:u,icon:e,color:n="grey",...t}){const i=a.joinClass(`${s.prefix}-menu__item`,n&&`${s.prefix}-menu__item--${n}`,t.className),o=()=>e&&c.cloneElement(e,{size:18,style:{marginRight:8}});return r.jsxs("button",{...t,className:i,children:[o(),u,r.jsx(l.Ripple,{})]})}const q=m.createComponent(p);exports.MenuButton_default=q;
2
+ //# sourceMappingURL=MenuButton-D0cPZU6x.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"MenuButton-BF6coRYt.cjs","sources":["../../src/navigation/Menu/MenuButton.tsx"],"sourcesContent":["import { type ButtonHTMLAttributes, cloneElement } from 'react';\n\nimport { prefix } from '@iziui/tokens/web/js';\n\nimport { joinClass } from '@iziui/core/utils/joinClass';\nimport type { Colors } from '@iziui/core/theme';\n\nimport type { IconProps } from '@/display/Icon';\nimport Ripple from '@/actions/Ripple';\n\nimport createComponent from '../../core/createComponent';\n\nexport interface MenuButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {\n label: string;\n color?: Colors;\n icon?: React.JSX.Element;\n}\n\nfunction MenuButton({ label, icon, color = 'grey', ...props }: MenuButtonProps) {\n const className = joinClass(\n `${prefix}-menu__item`,\n color && `${prefix}-menu__item--${color}`,\n props.className\n );\n\n const renderIcon = () => {\n return icon && cloneElement<IconProps>(icon, {\n size: 18,\n style: { marginRight: 8 }\n });\n };\n\n return (\n <button {...props} className={className}>\n {renderIcon()}\n {label}\n <Ripple />\n </button>\n );\n}\n\nexport default createComponent(MenuButton);"],"names":["MenuButton","label","icon","color","props","className","joinClass","prefix","renderIcon","cloneElement","jsxs","Ripple","MenuButton_default","createComponent"],"mappings":"4NAkBA,SAASA,EAAW,CAAE,MAAAC,EAAO,KAAAC,EAAM,MAAAC,EAAQ,OAAQ,GAAGC,GAA0B,CAC9E,MAAMC,EAAYC,EAAAA,UAChB,GAAGC,EAAAA,MAAM,cACTJ,GAAS,GAAGI,EAAAA,MAAM,gBAAgBJ,CAAK,GACvCC,EAAM,SAAA,EAGFI,EAAa,IACVN,GAAQO,EAAAA,aAAwBP,EAAM,CAC3C,KAAM,GACN,MAAO,CAAE,YAAa,CAAA,CAAE,CACzB,EAGH,OACEQ,EAAAA,KAAC,SAAA,CAAQ,GAAGN,EAAO,UAAAC,EAChB,SAAA,CAAAG,EAAA,EACAP,QACAU,EAAAA,OAAA,CAAA,CAAO,CAAA,EACV,CAEJ,CAEA,MAAAC,EAAeC,EAAAA,gBAAgBb,CAAU"}
1
+ {"version":3,"file":"MenuButton-D0cPZU6x.cjs","sources":["../../src/navigation/Menu/MenuButton.tsx"],"sourcesContent":["import { type ButtonHTMLAttributes, cloneElement } from 'react';\n\nimport { prefix } from '@iziui/tokens/web/js';\n\nimport { joinClass } from '@iziui/core/utils/joinClass';\nimport type { Colors } from '@iziui/core/theme';\n\nimport type { IconProps } from '@/display/Icon';\nimport Ripple from '@/actions/Ripple';\n\nimport createComponent from '../../core/createComponent';\n\nexport interface MenuButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {\n label: string;\n color?: Colors;\n icon?: React.JSX.Element;\n}\n\nfunction MenuButton({ label, icon, color = 'grey', ...props }: MenuButtonProps) {\n const className = joinClass(\n `${prefix}-menu__item`,\n color && `${prefix}-menu__item--${color}`,\n props.className\n );\n\n const renderIcon = () => {\n return icon && cloneElement<IconProps>(icon, {\n size: 18,\n style: { marginRight: 8 }\n });\n };\n\n return (\n <button {...props} className={className}>\n {renderIcon()}\n {label}\n <Ripple />\n </button>\n );\n}\n\nexport default createComponent(MenuButton);"],"names":["MenuButton","label","icon","color","props","className","joinClass","prefix","renderIcon","cloneElement","jsxs","Ripple","MenuButton_default","createComponent"],"mappings":"4NAkBA,SAASA,EAAW,CAAE,MAAAC,EAAO,KAAAC,EAAM,MAAAC,EAAQ,OAAQ,GAAGC,GAA0B,CAC9E,MAAMC,EAAYC,EAAAA,UAChB,GAAGC,EAAAA,MAAM,cACTJ,GAAS,GAAGI,EAAAA,MAAM,gBAAgBJ,CAAK,GACvCC,EAAM,SAAA,EAGFI,EAAa,IACVN,GAAQO,EAAAA,aAAwBP,EAAM,CAC3C,KAAM,GACN,MAAO,CAAE,YAAa,CAAA,CAAE,CACzB,EAGH,OACEQ,EAAAA,KAAC,SAAA,CAAQ,GAAGN,EAAO,UAAAC,EAChB,SAAA,CAAAG,EAAA,EACAP,QACAU,EAAAA,OAAA,CAAA,CAAO,CAAA,EACV,CAEJ,CAEA,MAAAC,EAAeC,EAAAA,gBAAgBb,CAAU"}
@@ -1,2 +1,2 @@
1
- "use strict";const f=require("react/jsx-runtime"),k=require("react"),x=require("./index-DYxwT4uW.cjs"),C=require("./joinClass-Jk3EszKD.cjs"),q=require("./createComponent-BBXW0GJ6.cjs"),j=k.forwardRef(function({children:e,tag:s="div",gap:c=16,alignSelf:n,flexWrap:a="nowrap",alignItems:r="flex-start",flexDirection:o="column",justifyContent:i="flex-start",...t},u){const l=C.joinClass(`${x.prefix}-stack`,t.className),m=s;return f.jsx(m,{...t,ref:u,className:l,style:{gap:c,flexWrap:a,alignItems:r,alignSelf:n,flexDirection:o,justifyContent:i,...t.style},children:e})}),S=q.createComponent(j);exports.Stack=S;
2
- //# sourceMappingURL=Stack-DsVkiTT_.cjs.map
1
+ "use strict";const f=require("react/jsx-runtime"),k=require("react"),x=require("./index-DYxwT4uW.cjs"),C=require("./joinClass-Jk3EszKD.cjs"),q=require("./createComponent-Dkt68kvT.cjs"),j=k.forwardRef(function({children:e,tag:s="div",gap:c=16,alignSelf:n,flexWrap:a="nowrap",alignItems:r="flex-start",flexDirection:o="column",justifyContent:i="flex-start",...t},u){const l=C.joinClass(`${x.prefix}-stack`,t.className),m=s;return f.jsx(m,{...t,ref:u,className:l,style:{gap:c,flexWrap:a,alignItems:r,alignSelf:n,flexDirection:o,justifyContent:i,...t.style},children:e})}),S=q.createComponent(j);exports.Stack=S;
2
+ //# sourceMappingURL=Stack-B_lU0ez7.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"Stack-DsVkiTT_.cjs","sources":["../../src/layout/Stack/Stack.tsx"],"sourcesContent":["import type { HTMLAttributes, CSSProperties } from 'react';\nimport { forwardRef } from 'react';\n\nimport { prefix } from '@iziui/tokens/web/js';\n\nimport { joinClass } from '@iziui/core/utils';\n\nimport createComponent from '@/core/createComponent';\n\nimport '@iziui/styles/components/Stack.scss';\n\nexport interface StackProps extends HTMLAttributes<HTMLElement> {\n tag?: React.ElementType;\n gap?: number;\n flexDirection?: CSSProperties['flexDirection'];\n justifyContent?: CSSProperties['justifyContent'];\n alignItems?: CSSProperties['alignItems'];\n alignSelf?: CSSProperties['alignSelf'];\n flexWrap?: CSSProperties['flexWrap'];\n}\n\nconst Stack = forwardRef<HTMLElement, StackProps>(\n function Stack(\n {\n children,\n tag = 'div',\n gap = 16,\n alignSelf,\n flexWrap = 'nowrap',\n alignItems = 'flex-start',\n flexDirection = 'column',\n justifyContent = 'flex-start',\n ...props\n },\n ref\n ) {\n const stackClasses = joinClass(\n `${prefix}-stack`,\n props.className\n );\n\n const CustomTag = tag;\n\n return (\n <CustomTag\n {...props}\n ref={ref}\n className={stackClasses}\n style={{\n gap,\n flexWrap,\n alignItems,\n alignSelf,\n flexDirection,\n justifyContent,\n ...props.style,\n }}\n >\n {children}\n </CustomTag>\n );\n }\n);\n\nexport default createComponent(Stack);\n"],"names":["Stack","forwardRef","children","tag","gap","alignSelf","flexWrap","alignItems","flexDirection","justifyContent","props","ref","stackClasses","joinClass","prefix","CustomTag","jsx","createComponent"],"mappings":"yLAqBMA,EAAQC,EAAAA,WACZ,SACE,CACE,SAAAC,EACA,IAAAC,EAAM,MACN,IAAAC,EAAM,GACN,UAAAC,EACA,SAAAC,EAAW,SACX,WAAAC,EAAa,aACb,cAAAC,EAAgB,SAChB,eAAAC,EAAiB,aACjB,GAAGC,CAAA,EAELC,EACA,CACA,MAAMC,EAAeC,EAAAA,UACnB,GAAGC,EAAAA,MAAM,SACTJ,EAAM,SAAA,EAGFK,EAAYZ,EAElB,OACEa,EAAAA,IAACD,EAAA,CACE,GAAGL,EACJ,IAAAC,EACA,UAAWC,EACX,MAAO,CACL,IAAAR,EACA,SAAAE,EACA,WAAAC,EACA,UAAAF,EACA,cAAAG,EACA,eAAAC,EACA,GAAGC,EAAM,KAAA,EAGV,SAAAR,CAAA,CAAA,CAGP,CACF,EAEAF,EAAeiB,EAAAA,gBAAgBjB,CAAK"}
1
+ {"version":3,"file":"Stack-B_lU0ez7.cjs","sources":["../../src/layout/Stack/Stack.tsx"],"sourcesContent":["import type { HTMLAttributes, CSSProperties } from 'react';\nimport { forwardRef } from 'react';\n\nimport { prefix } from '@iziui/tokens/web/js';\n\nimport { joinClass } from '@iziui/core/utils';\n\nimport createComponent from '@/core/createComponent';\n\nimport '@iziui/styles/components/Stack.scss';\n\nexport interface StackProps extends HTMLAttributes<HTMLElement> {\n tag?: React.ElementType;\n gap?: number;\n flexDirection?: CSSProperties['flexDirection'];\n justifyContent?: CSSProperties['justifyContent'];\n alignItems?: CSSProperties['alignItems'];\n alignSelf?: CSSProperties['alignSelf'];\n flexWrap?: CSSProperties['flexWrap'];\n}\n\nconst Stack = forwardRef<HTMLElement, StackProps>(\n function Stack(\n {\n children,\n tag = 'div',\n gap = 16,\n alignSelf,\n flexWrap = 'nowrap',\n alignItems = 'flex-start',\n flexDirection = 'column',\n justifyContent = 'flex-start',\n ...props\n },\n ref\n ) {\n const stackClasses = joinClass(\n `${prefix}-stack`,\n props.className\n );\n\n const CustomTag = tag;\n\n return (\n <CustomTag\n {...props}\n ref={ref}\n className={stackClasses}\n style={{\n gap,\n flexWrap,\n alignItems,\n alignSelf,\n flexDirection,\n justifyContent,\n ...props.style,\n }}\n >\n {children}\n </CustomTag>\n );\n }\n);\n\nexport default createComponent(Stack);\n"],"names":["Stack","forwardRef","children","tag","gap","alignSelf","flexWrap","alignItems","flexDirection","justifyContent","props","ref","stackClasses","joinClass","prefix","CustomTag","jsx","createComponent"],"mappings":"yLAqBMA,EAAQC,EAAAA,WACZ,SACE,CACE,SAAAC,EACA,IAAAC,EAAM,MACN,IAAAC,EAAM,GACN,UAAAC,EACA,SAAAC,EAAW,SACX,WAAAC,EAAa,aACb,cAAAC,EAAgB,SAChB,eAAAC,EAAiB,aACjB,GAAGC,CAAA,EAELC,EACA,CACA,MAAMC,EAAeC,EAAAA,UACnB,GAAGC,EAAAA,MAAM,SACTJ,EAAM,SAAA,EAGFK,EAAYZ,EAElB,OACEa,EAAAA,IAACD,EAAA,CACE,GAAGL,EACJ,IAAAC,EACA,UAAWC,EACX,MAAO,CACL,IAAAR,EACA,SAAAE,EACA,WAAAC,EACA,UAAAF,EACA,cAAAG,EACA,eAAAC,EACA,GAAGC,EAAM,KAAA,EAGV,SAAAR,CAAA,CAAA,CAGP,CACF,EAEAF,EAAeiB,EAAAA,gBAAgBjB,CAAK"}
@@ -1,2 +1,2 @@
1
- import{jsx as l}from"react/jsx-runtime";import{forwardRef as p}from"react";import{p as k}from"./index-CZ41y9Hn.js";import{j as u}from"./joinClass-anSpaauN.js";import{c as x}from"./createComponent-DZqrA_Tp.js";const C=p(function({children:s,tag:a="div",gap:o=16,alignSelf:r,flexWrap:m="nowrap",alignItems:c="flex-start",flexDirection:e="column",justifyContent:n="flex-start",...t},f){const i=u(`${k}-stack`,t.className);return l(a,{...t,ref:f,className:i,style:{gap:o,flexWrap:m,alignItems:c,alignSelf:r,flexDirection:e,justifyContent:n,...t.style},children:s})}),T=x(C);export{T as S};
2
- //# sourceMappingURL=Stack-D0feJnm7.js.map
1
+ import{jsx as l}from"react/jsx-runtime";import{forwardRef as p}from"react";import{p as k}from"./index-CZ41y9Hn.js";import{j as u}from"./joinClass-anSpaauN.js";import{c as x}from"./createComponent-CovqNaAJ.js";const C=p(function({children:s,tag:a="div",gap:o=16,alignSelf:r,flexWrap:m="nowrap",alignItems:c="flex-start",flexDirection:e="column",justifyContent:n="flex-start",...t},f){const i=u(`${k}-stack`,t.className);return l(a,{...t,ref:f,className:i,style:{gap:o,flexWrap:m,alignItems:c,alignSelf:r,flexDirection:e,justifyContent:n,...t.style},children:s})}),T=x(C);export{T as S};
2
+ //# sourceMappingURL=Stack-Deow48Th.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Stack-D0feJnm7.js","sources":["../../src/layout/Stack/Stack.tsx"],"sourcesContent":["import type { HTMLAttributes, CSSProperties } from 'react';\nimport { forwardRef } from 'react';\n\nimport { prefix } from '@iziui/tokens/web/js';\n\nimport { joinClass } from '@iziui/core/utils';\n\nimport createComponent from '@/core/createComponent';\n\nimport '@iziui/styles/components/Stack.scss';\n\nexport interface StackProps extends HTMLAttributes<HTMLElement> {\n tag?: React.ElementType;\n gap?: number;\n flexDirection?: CSSProperties['flexDirection'];\n justifyContent?: CSSProperties['justifyContent'];\n alignItems?: CSSProperties['alignItems'];\n alignSelf?: CSSProperties['alignSelf'];\n flexWrap?: CSSProperties['flexWrap'];\n}\n\nconst Stack = forwardRef<HTMLElement, StackProps>(\n function Stack(\n {\n children,\n tag = 'div',\n gap = 16,\n alignSelf,\n flexWrap = 'nowrap',\n alignItems = 'flex-start',\n flexDirection = 'column',\n justifyContent = 'flex-start',\n ...props\n },\n ref\n ) {\n const stackClasses = joinClass(\n `${prefix}-stack`,\n props.className\n );\n\n const CustomTag = tag;\n\n return (\n <CustomTag\n {...props}\n ref={ref}\n className={stackClasses}\n style={{\n gap,\n flexWrap,\n alignItems,\n alignSelf,\n flexDirection,\n justifyContent,\n ...props.style,\n }}\n >\n {children}\n </CustomTag>\n );\n }\n);\n\nexport default createComponent(Stack);\n"],"names":["Stack","forwardRef","children","tag","gap","alignSelf","flexWrap","alignItems","flexDirection","justifyContent","props","ref","stackClasses","joinClass","prefix","jsx","Stack$1","createComponent"],"mappings":"iNAqBA,MAAMA,EAAQC,EACZ,SACE,CACE,SAAAC,EACA,IAAAC,EAAM,MACN,IAAAC,EAAM,GACN,UAAAC,EACA,SAAAC,EAAW,SACX,WAAAC,EAAa,aACb,cAAAC,EAAgB,SAChB,eAAAC,EAAiB,aACjB,GAAGC,CAAA,EAELC,EACA,CACA,MAAMC,EAAeC,EACnB,GAAGC,CAAM,SACTJ,EAAM,SAAA,EAKR,OACEK,EAHgBZ,EAGf,CACE,GAAGO,EACJ,IAAAC,EACA,UAAWC,EACX,MAAO,CACL,IAAAR,EACA,SAAAE,EACA,WAAAC,EACA,UAAAF,EACA,cAAAG,EACA,eAAAC,EACA,GAAGC,EAAM,KAAA,EAGV,SAAAR,CAAA,CAAA,CAGP,CACF,EAEAc,EAAeC,EAAgBjB,CAAK"}
1
+ {"version":3,"file":"Stack-Deow48Th.js","sources":["../../src/layout/Stack/Stack.tsx"],"sourcesContent":["import type { HTMLAttributes, CSSProperties } from 'react';\nimport { forwardRef } from 'react';\n\nimport { prefix } from '@iziui/tokens/web/js';\n\nimport { joinClass } from '@iziui/core/utils';\n\nimport createComponent from '@/core/createComponent';\n\nimport '@iziui/styles/components/Stack.scss';\n\nexport interface StackProps extends HTMLAttributes<HTMLElement> {\n tag?: React.ElementType;\n gap?: number;\n flexDirection?: CSSProperties['flexDirection'];\n justifyContent?: CSSProperties['justifyContent'];\n alignItems?: CSSProperties['alignItems'];\n alignSelf?: CSSProperties['alignSelf'];\n flexWrap?: CSSProperties['flexWrap'];\n}\n\nconst Stack = forwardRef<HTMLElement, StackProps>(\n function Stack(\n {\n children,\n tag = 'div',\n gap = 16,\n alignSelf,\n flexWrap = 'nowrap',\n alignItems = 'flex-start',\n flexDirection = 'column',\n justifyContent = 'flex-start',\n ...props\n },\n ref\n ) {\n const stackClasses = joinClass(\n `${prefix}-stack`,\n props.className\n );\n\n const CustomTag = tag;\n\n return (\n <CustomTag\n {...props}\n ref={ref}\n className={stackClasses}\n style={{\n gap,\n flexWrap,\n alignItems,\n alignSelf,\n flexDirection,\n justifyContent,\n ...props.style,\n }}\n >\n {children}\n </CustomTag>\n );\n }\n);\n\nexport default createComponent(Stack);\n"],"names":["Stack","forwardRef","children","tag","gap","alignSelf","flexWrap","alignItems","flexDirection","justifyContent","props","ref","stackClasses","joinClass","prefix","jsx","Stack$1","createComponent"],"mappings":"iNAqBA,MAAMA,EAAQC,EACZ,SACE,CACE,SAAAC,EACA,IAAAC,EAAM,MACN,IAAAC,EAAM,GACN,UAAAC,EACA,SAAAC,EAAW,SACX,WAAAC,EAAa,aACb,cAAAC,EAAgB,SAChB,eAAAC,EAAiB,aACjB,GAAGC,CAAA,EAELC,EACA,CACA,MAAMC,EAAeC,EACnB,GAAGC,CAAM,SACTJ,EAAM,SAAA,EAKR,OACEK,EAHgBZ,EAGf,CACE,GAAGO,EACJ,IAAAC,EACA,UAAWC,EACX,MAAO,CACL,IAAAR,EACA,SAAAE,EACA,WAAAC,EACA,UAAAF,EACA,cAAAG,EACA,eAAAC,EACA,GAAGC,EAAM,KAAA,EAGV,SAAAR,CAAA,CAAA,CAGP,CACF,EAEAc,EAAeC,EAAgBjB,CAAK"}
@@ -1,2 +1,2 @@
1
- import{jsx as l}from"react/jsx-runtime";import{p as s}from"./index-CZ41y9Hn.js";import{j as o}from"./joinClass-anSpaauN.js";import{c as r}from"./createComponent-DZqrA_Tp.js";import{C as n}from"./Card-wBDtOPXO.js";function m({children:a,...e}){const t=o(`${s}-table`,e.className);return l(n,{fullWidth:!0,style:{overflow:"auto"},children:l("table",{className:t,...e,children:a})})}const p=r(m);function b({children:a,...e}){const t=o(`${s}-table__body`,e.className);return l("tbody",{className:t,...e,children:a})}b.displayName="TableBody";function d({align:a="left",children:e,...t}){const c=o(`${s}-table__cell`,`${s}-table__cell--${a}`);return l("td",{className:c,...t,children:e})}const y=r(d);function i({children:a}){const e=o(`${s}-table__header`);return l("thead",{className:e,children:l("tr",{children:a})})}i.displayName="TableHeader";export{p as T,b as a,y as b,i as c};
2
- //# sourceMappingURL=TableHeader-BDY2xI-0.js.map
1
+ import{jsx as l}from"react/jsx-runtime";import{p as s}from"./index-CZ41y9Hn.js";import{j as o}from"./joinClass-anSpaauN.js";import{c as r}from"./createComponent-CovqNaAJ.js";import{C as n}from"./Card-D_RFnUk2.js";function m({children:a,...e}){const t=o(`${s}-table`,e.className);return l(n,{fullWidth:!0,style:{overflow:"auto"},children:l("table",{className:t,...e,children:a})})}const p=r(m);function b({children:a,...e}){const t=o(`${s}-table__body`,e.className);return l("tbody",{className:t,...e,children:a})}b.displayName="TableBody";function d({align:a="left",children:e,...t}){const c=o(`${s}-table__cell`,`${s}-table__cell--${a}`);return l("td",{className:c,...t,children:e})}const y=r(d);function i({children:a}){const e=o(`${s}-table__header`);return l("thead",{className:e,children:l("tr",{children:a})})}i.displayName="TableHeader";export{p as T,b as a,y as b,i as c};
2
+ //# sourceMappingURL=TableHeader-DnifrYxO.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"TableHeader-BDY2xI-0.js","sources":["../../src/display/Table/Table.tsx","../../src/display/Table/TableBody.tsx","../../src/display/Table/TableCell.tsx","../../src/display/Table/TableHeader.tsx"],"sourcesContent":["import type { TableHTMLAttributes } from 'react';\n\nimport { prefix } from '@iziui/tokens/web/js';\n\nimport { joinClass } from '@iziui/core/utils/joinClass';\n\nimport createComponent from '@/core/createComponent';\n\nimport { Card } from '../Card';\n\nimport '@iziui/styles/components/Table.scss';\n\nexport type TableProps = TableHTMLAttributes<HTMLTableElement>;\n\nfunction Table({ children, ...props }: TableProps) {\n const cls = joinClass(\n `${prefix}-table`,\n props.className\n );\n\n return (\n <Card fullWidth style={{ overflow: 'auto' }}>\n <table className={cls} {...props}>\n {children}\n </table>\n </Card>\n );\n}\n\nexport default createComponent(Table);\n","import type { TableHTMLAttributes } from 'react';\n\nimport { prefix } from '@iziui/tokens/web/js';\n\nimport { joinClass } from '@iziui/core/utils/joinClass';\n\ninterface TableBodyProps extends TableHTMLAttributes<HTMLTableSectionElement> {\n children: React.ReactNode;\n}\n\nfunction TableBody({ children, ...props }: TableBodyProps) {\n\n const cls = joinClass(\n `${prefix}-table__body`,\n props.className\n );\n\n return (\n <tbody className={cls} {...props}>\n {children}\n </tbody>\n );\n}\n\nTableBody.displayName = 'TableBody';\n\nexport default TableBody;","import { TdHTMLAttributes } from 'react';\n\nimport { prefix } from '@iziui/tokens/web/js';\n\nimport { joinClass } from '@iziui/core/utils/joinClass';\n\nimport createComponent from '../../core/createComponent';\n\ninterface TableCellProps extends TdHTMLAttributes<HTMLTableDataCellElement> {\n align?: 'left' | 'center' | 'right';\n children: React.JSX.Element | string | number | null;\n}\nfunction TableCell({ align = 'left', children, ...props }: TableCellProps) {\n const className = joinClass(\n `${prefix}-table__cell`,\n `${prefix}-table__cell--${align}`,\n );\n\n return (\n <td className={className} {...props}>\n {children}\n </td>\n );\n}\n\nexport default createComponent(TableCell);","import type { PropsWithChildren } from 'react';\n\nimport { prefix } from '@iziui/tokens/web/js';\n\nimport { joinClass } from '@iziui/core/utils/joinClass';\n\nfunction TableHeader({ children }: PropsWithChildren) {\n const className = joinClass(\n `${prefix}-table__header`,\n );\n\n return (\n <thead className={className}>\n <tr>\n {children}\n </tr>\n </thead>\n );\n}\n\nTableHeader.displayName = 'TableHeader';\n\nexport default TableHeader;"],"names":["Table","children","props","cls","joinClass","prefix","Card","jsx","Table_default","createComponent","TableBody","TableCell","align","className","TableCell_default","TableHeader"],"mappings":"qNAcA,SAASA,EAAM,CAAE,SAAAC,EAAU,GAAGC,GAAqB,CACjD,MAAMC,EAAMC,EACV,GAAGC,CAAM,SACTH,EAAM,SAAA,EAGR,SACGI,EAAA,CAAK,UAAS,GAAC,MAAO,CAAE,SAAU,MAAA,EACjC,SAAAC,EAAC,SAAM,UAAWJ,EAAM,GAAGD,EACxB,SAAAD,EACH,EACF,CAEJ,CAEA,MAAAO,EAAeC,EAAgBT,CAAK,ECnBpC,SAASU,EAAU,CAAE,SAAAT,EAAU,GAAGC,GAAyB,CAEzD,MAAMC,EAAMC,EACV,GAAGC,CAAM,eACTH,EAAM,SAAA,EAGR,SACG,QAAA,CAAM,UAAWC,EAAM,GAAGD,EACxB,SAAAD,EACH,CAEJ,CAEAS,EAAU,YAAc,YCZxB,SAASC,EAAU,CAAE,MAAAC,EAAQ,OAAQ,SAAAX,EAAU,GAAGC,GAAyB,CACzE,MAAMW,EAAYT,EAChB,GAAGC,CAAM,eACT,GAAGA,CAAM,iBAAiBO,CAAK,EAAA,EAGjC,OACEL,EAAC,KAAA,CAAG,UAAAM,EAAuB,GAAGX,EAC3B,SAAAD,EACH,CAEJ,CAEA,MAAAa,EAAeL,EAAgBE,CAAS,ECnBxC,SAASI,EAAY,CAAE,SAAAd,GAA+B,CACpD,MAAMY,EAAYT,EAChB,GAAGC,CAAM,gBAAA,EAGX,SACG,QAAA,CAAM,UAAAQ,EACL,SAAAN,EAAC,KAAA,CACE,SAAAN,EACH,EACF,CAEJ,CAEAc,EAAY,YAAc"}
1
+ {"version":3,"file":"TableHeader-DnifrYxO.js","sources":["../../src/display/Table/Table.tsx","../../src/display/Table/TableBody.tsx","../../src/display/Table/TableCell.tsx","../../src/display/Table/TableHeader.tsx"],"sourcesContent":["import type { TableHTMLAttributes } from 'react';\n\nimport { prefix } from '@iziui/tokens/web/js';\n\nimport { joinClass } from '@iziui/core/utils/joinClass';\n\nimport createComponent from '@/core/createComponent';\n\nimport { Card } from '../Card';\n\nimport '@iziui/styles/components/Table.scss';\n\nexport type TableProps = TableHTMLAttributes<HTMLTableElement>;\n\nfunction Table({ children, ...props }: TableProps) {\n const cls = joinClass(\n `${prefix}-table`,\n props.className\n );\n\n return (\n <Card fullWidth style={{ overflow: 'auto' }}>\n <table className={cls} {...props}>\n {children}\n </table>\n </Card>\n );\n}\n\nexport default createComponent(Table);\n","import type { TableHTMLAttributes } from 'react';\n\nimport { prefix } from '@iziui/tokens/web/js';\n\nimport { joinClass } from '@iziui/core/utils/joinClass';\n\ninterface TableBodyProps extends TableHTMLAttributes<HTMLTableSectionElement> {\n children: React.ReactNode;\n}\n\nfunction TableBody({ children, ...props }: TableBodyProps) {\n\n const cls = joinClass(\n `${prefix}-table__body`,\n props.className\n );\n\n return (\n <tbody className={cls} {...props}>\n {children}\n </tbody>\n );\n}\n\nTableBody.displayName = 'TableBody';\n\nexport default TableBody;","import { TdHTMLAttributes } from 'react';\n\nimport { prefix } from '@iziui/tokens/web/js';\n\nimport { joinClass } from '@iziui/core/utils/joinClass';\n\nimport createComponent from '../../core/createComponent';\n\ninterface TableCellProps extends TdHTMLAttributes<HTMLTableDataCellElement> {\n align?: 'left' | 'center' | 'right';\n children: React.JSX.Element | string | number | null;\n}\nfunction TableCell({ align = 'left', children, ...props }: TableCellProps) {\n const className = joinClass(\n `${prefix}-table__cell`,\n `${prefix}-table__cell--${align}`,\n );\n\n return (\n <td className={className} {...props}>\n {children}\n </td>\n );\n}\n\nexport default createComponent(TableCell);","import type { PropsWithChildren } from 'react';\n\nimport { prefix } from '@iziui/tokens/web/js';\n\nimport { joinClass } from '@iziui/core/utils/joinClass';\n\nfunction TableHeader({ children }: PropsWithChildren) {\n const className = joinClass(\n `${prefix}-table__header`,\n );\n\n return (\n <thead className={className}>\n <tr>\n {children}\n </tr>\n </thead>\n );\n}\n\nTableHeader.displayName = 'TableHeader';\n\nexport default TableHeader;"],"names":["Table","children","props","cls","joinClass","prefix","Card","jsx","Table_default","createComponent","TableBody","TableCell","align","className","TableCell_default","TableHeader"],"mappings":"qNAcA,SAASA,EAAM,CAAE,SAAAC,EAAU,GAAGC,GAAqB,CACjD,MAAMC,EAAMC,EACV,GAAGC,CAAM,SACTH,EAAM,SAAA,EAGR,SACGI,EAAA,CAAK,UAAS,GAAC,MAAO,CAAE,SAAU,MAAA,EACjC,SAAAC,EAAC,SAAM,UAAWJ,EAAM,GAAGD,EACxB,SAAAD,EACH,EACF,CAEJ,CAEA,MAAAO,EAAeC,EAAgBT,CAAK,ECnBpC,SAASU,EAAU,CAAE,SAAAT,EAAU,GAAGC,GAAyB,CAEzD,MAAMC,EAAMC,EACV,GAAGC,CAAM,eACTH,EAAM,SAAA,EAGR,SACG,QAAA,CAAM,UAAWC,EAAM,GAAGD,EACxB,SAAAD,EACH,CAEJ,CAEAS,EAAU,YAAc,YCZxB,SAASC,EAAU,CAAE,MAAAC,EAAQ,OAAQ,SAAAX,EAAU,GAAGC,GAAyB,CACzE,MAAMW,EAAYT,EAChB,GAAGC,CAAM,eACT,GAAGA,CAAM,iBAAiBO,CAAK,EAAA,EAGjC,OACEL,EAAC,KAAA,CAAG,UAAAM,EAAuB,GAAGX,EAC3B,SAAAD,EACH,CAEJ,CAEA,MAAAa,EAAeL,EAAgBE,CAAS,ECnBxC,SAASI,EAAY,CAAE,SAAAd,GAA+B,CACpD,MAAMY,EAAYT,EAChB,GAAGC,CAAM,gBAAA,EAGX,SACG,QAAA,CAAM,UAAAQ,EACL,SAAAN,EAAC,KAAA,CACE,SAAAN,EACH,EACF,CAEJ,CAEAc,EAAY,YAAc"}
@@ -1,2 +1,2 @@
1
- "use strict";const l=require("react/jsx-runtime"),s=require("./index-DYxwT4uW.cjs"),n=require("./joinClass-Jk3EszKD.cjs"),r=require("./createComponent-BBXW0GJ6.cjs"),d=require("./Card-DqoL_8z0.cjs");function u({children:a,...e}){const t=n.joinClass(`${s.prefix}-table`,e.className);return l.jsx(d.Card,{fullWidth:!0,style:{overflow:"auto"},children:l.jsx("table",{className:t,...e,children:a})})}const b=r.createComponent(u);function o({children:a,...e}){const t=n.joinClass(`${s.prefix}-table__body`,e.className);return l.jsx("tbody",{className:t,...e,children:a})}o.displayName="TableBody";function f({align:a="left",children:e,...t}){const i=n.joinClass(`${s.prefix}-table__cell`,`${s.prefix}-table__cell--${a}`);return l.jsx("td",{className:i,...t,children:e})}const x=r.createComponent(f);function c({children:a}){const e=n.joinClass(`${s.prefix}-table__header`);return l.jsx("thead",{className:e,children:l.jsx("tr",{children:a})})}c.displayName="TableHeader";exports.TableBody=o;exports.TableCell_default=x;exports.TableHeader=c;exports.Table_default=b;
2
- //# sourceMappingURL=TableHeader-DNnzAUGG.cjs.map
1
+ "use strict";const l=require("react/jsx-runtime"),s=require("./index-DYxwT4uW.cjs"),n=require("./joinClass-Jk3EszKD.cjs"),r=require("./createComponent-Dkt68kvT.cjs"),d=require("./Card-DtjP8NP7.cjs");function u({children:a,...e}){const t=n.joinClass(`${s.prefix}-table`,e.className);return l.jsx(d.Card,{fullWidth:!0,style:{overflow:"auto"},children:l.jsx("table",{className:t,...e,children:a})})}const b=r.createComponent(u);function o({children:a,...e}){const t=n.joinClass(`${s.prefix}-table__body`,e.className);return l.jsx("tbody",{className:t,...e,children:a})}o.displayName="TableBody";function f({align:a="left",children:e,...t}){const i=n.joinClass(`${s.prefix}-table__cell`,`${s.prefix}-table__cell--${a}`);return l.jsx("td",{className:i,...t,children:e})}const x=r.createComponent(f);function c({children:a}){const e=n.joinClass(`${s.prefix}-table__header`);return l.jsx("thead",{className:e,children:l.jsx("tr",{children:a})})}c.displayName="TableHeader";exports.TableBody=o;exports.TableCell_default=x;exports.TableHeader=c;exports.Table_default=b;
2
+ //# sourceMappingURL=TableHeader-SKzj2zHB.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"TableHeader-DNnzAUGG.cjs","sources":["../../src/display/Table/Table.tsx","../../src/display/Table/TableBody.tsx","../../src/display/Table/TableCell.tsx","../../src/display/Table/TableHeader.tsx"],"sourcesContent":["import type { TableHTMLAttributes } from 'react';\n\nimport { prefix } from '@iziui/tokens/web/js';\n\nimport { joinClass } from '@iziui/core/utils/joinClass';\n\nimport createComponent from '@/core/createComponent';\n\nimport { Card } from '../Card';\n\nimport '@iziui/styles/components/Table.scss';\n\nexport type TableProps = TableHTMLAttributes<HTMLTableElement>;\n\nfunction Table({ children, ...props }: TableProps) {\n const cls = joinClass(\n `${prefix}-table`,\n props.className\n );\n\n return (\n <Card fullWidth style={{ overflow: 'auto' }}>\n <table className={cls} {...props}>\n {children}\n </table>\n </Card>\n );\n}\n\nexport default createComponent(Table);\n","import type { TableHTMLAttributes } from 'react';\n\nimport { prefix } from '@iziui/tokens/web/js';\n\nimport { joinClass } from '@iziui/core/utils/joinClass';\n\ninterface TableBodyProps extends TableHTMLAttributes<HTMLTableSectionElement> {\n children: React.ReactNode;\n}\n\nfunction TableBody({ children, ...props }: TableBodyProps) {\n\n const cls = joinClass(\n `${prefix}-table__body`,\n props.className\n );\n\n return (\n <tbody className={cls} {...props}>\n {children}\n </tbody>\n );\n}\n\nTableBody.displayName = 'TableBody';\n\nexport default TableBody;","import { TdHTMLAttributes } from 'react';\n\nimport { prefix } from '@iziui/tokens/web/js';\n\nimport { joinClass } from '@iziui/core/utils/joinClass';\n\nimport createComponent from '../../core/createComponent';\n\ninterface TableCellProps extends TdHTMLAttributes<HTMLTableDataCellElement> {\n align?: 'left' | 'center' | 'right';\n children: React.JSX.Element | string | number | null;\n}\nfunction TableCell({ align = 'left', children, ...props }: TableCellProps) {\n const className = joinClass(\n `${prefix}-table__cell`,\n `${prefix}-table__cell--${align}`,\n );\n\n return (\n <td className={className} {...props}>\n {children}\n </td>\n );\n}\n\nexport default createComponent(TableCell);","import type { PropsWithChildren } from 'react';\n\nimport { prefix } from '@iziui/tokens/web/js';\n\nimport { joinClass } from '@iziui/core/utils/joinClass';\n\nfunction TableHeader({ children }: PropsWithChildren) {\n const className = joinClass(\n `${prefix}-table__header`,\n );\n\n return (\n <thead className={className}>\n <tr>\n {children}\n </tr>\n </thead>\n );\n}\n\nTableHeader.displayName = 'TableHeader';\n\nexport default TableHeader;"],"names":["Table","children","props","cls","joinClass","prefix","Card","jsx","Table_default","createComponent","TableBody","TableCell","align","className","TableCell_default","TableHeader"],"mappings":"uMAcA,SAASA,EAAM,CAAE,SAAAC,EAAU,GAAGC,GAAqB,CACjD,MAAMC,EAAMC,EAAAA,UACV,GAAGC,EAAAA,MAAM,SACTH,EAAM,SAAA,EAGR,aACGI,EAAAA,KAAA,CAAK,UAAS,GAAC,MAAO,CAAE,SAAU,MAAA,EACjC,SAAAC,MAAC,SAAM,UAAWJ,EAAM,GAAGD,EACxB,SAAAD,EACH,EACF,CAEJ,CAEA,MAAAO,EAAeC,EAAAA,gBAAgBT,CAAK,ECnBpC,SAASU,EAAU,CAAE,SAAAT,EAAU,GAAGC,GAAyB,CAEzD,MAAMC,EAAMC,EAAAA,UACV,GAAGC,EAAAA,MAAM,eACTH,EAAM,SAAA,EAGR,aACG,QAAA,CAAM,UAAWC,EAAM,GAAGD,EACxB,SAAAD,EACH,CAEJ,CAEAS,EAAU,YAAc,YCZxB,SAASC,EAAU,CAAE,MAAAC,EAAQ,OAAQ,SAAAX,EAAU,GAAGC,GAAyB,CACzE,MAAMW,EAAYT,EAAAA,UAChB,GAAGC,EAAAA,MAAM,eACT,GAAGA,EAAAA,MAAM,iBAAiBO,CAAK,EAAA,EAGjC,OACEL,EAAAA,IAAC,KAAA,CAAG,UAAAM,EAAuB,GAAGX,EAC3B,SAAAD,EACH,CAEJ,CAEA,MAAAa,EAAeL,EAAAA,gBAAgBE,CAAS,ECnBxC,SAASI,EAAY,CAAE,SAAAd,GAA+B,CACpD,MAAMY,EAAYT,EAAAA,UAChB,GAAGC,EAAAA,MAAM,gBAAA,EAGX,aACG,QAAA,CAAM,UAAAQ,EACL,SAAAN,EAAAA,IAAC,KAAA,CACE,SAAAN,EACH,EACF,CAEJ,CAEAc,EAAY,YAAc"}
1
+ {"version":3,"file":"TableHeader-SKzj2zHB.cjs","sources":["../../src/display/Table/Table.tsx","../../src/display/Table/TableBody.tsx","../../src/display/Table/TableCell.tsx","../../src/display/Table/TableHeader.tsx"],"sourcesContent":["import type { TableHTMLAttributes } from 'react';\n\nimport { prefix } from '@iziui/tokens/web/js';\n\nimport { joinClass } from '@iziui/core/utils/joinClass';\n\nimport createComponent from '@/core/createComponent';\n\nimport { Card } from '../Card';\n\nimport '@iziui/styles/components/Table.scss';\n\nexport type TableProps = TableHTMLAttributes<HTMLTableElement>;\n\nfunction Table({ children, ...props }: TableProps) {\n const cls = joinClass(\n `${prefix}-table`,\n props.className\n );\n\n return (\n <Card fullWidth style={{ overflow: 'auto' }}>\n <table className={cls} {...props}>\n {children}\n </table>\n </Card>\n );\n}\n\nexport default createComponent(Table);\n","import type { TableHTMLAttributes } from 'react';\n\nimport { prefix } from '@iziui/tokens/web/js';\n\nimport { joinClass } from '@iziui/core/utils/joinClass';\n\ninterface TableBodyProps extends TableHTMLAttributes<HTMLTableSectionElement> {\n children: React.ReactNode;\n}\n\nfunction TableBody({ children, ...props }: TableBodyProps) {\n\n const cls = joinClass(\n `${prefix}-table__body`,\n props.className\n );\n\n return (\n <tbody className={cls} {...props}>\n {children}\n </tbody>\n );\n}\n\nTableBody.displayName = 'TableBody';\n\nexport default TableBody;","import { TdHTMLAttributes } from 'react';\n\nimport { prefix } from '@iziui/tokens/web/js';\n\nimport { joinClass } from '@iziui/core/utils/joinClass';\n\nimport createComponent from '../../core/createComponent';\n\ninterface TableCellProps extends TdHTMLAttributes<HTMLTableDataCellElement> {\n align?: 'left' | 'center' | 'right';\n children: React.JSX.Element | string | number | null;\n}\nfunction TableCell({ align = 'left', children, ...props }: TableCellProps) {\n const className = joinClass(\n `${prefix}-table__cell`,\n `${prefix}-table__cell--${align}`,\n );\n\n return (\n <td className={className} {...props}>\n {children}\n </td>\n );\n}\n\nexport default createComponent(TableCell);","import type { PropsWithChildren } from 'react';\n\nimport { prefix } from '@iziui/tokens/web/js';\n\nimport { joinClass } from '@iziui/core/utils/joinClass';\n\nfunction TableHeader({ children }: PropsWithChildren) {\n const className = joinClass(\n `${prefix}-table__header`,\n );\n\n return (\n <thead className={className}>\n <tr>\n {children}\n </tr>\n </thead>\n );\n}\n\nTableHeader.displayName = 'TableHeader';\n\nexport default TableHeader;"],"names":["Table","children","props","cls","joinClass","prefix","Card","jsx","Table_default","createComponent","TableBody","TableCell","align","className","TableCell_default","TableHeader"],"mappings":"uMAcA,SAASA,EAAM,CAAE,SAAAC,EAAU,GAAGC,GAAqB,CACjD,MAAMC,EAAMC,EAAAA,UACV,GAAGC,EAAAA,MAAM,SACTH,EAAM,SAAA,EAGR,aACGI,EAAAA,KAAA,CAAK,UAAS,GAAC,MAAO,CAAE,SAAU,MAAA,EACjC,SAAAC,MAAC,SAAM,UAAWJ,EAAM,GAAGD,EACxB,SAAAD,EACH,EACF,CAEJ,CAEA,MAAAO,EAAeC,EAAAA,gBAAgBT,CAAK,ECnBpC,SAASU,EAAU,CAAE,SAAAT,EAAU,GAAGC,GAAyB,CAEzD,MAAMC,EAAMC,EAAAA,UACV,GAAGC,EAAAA,MAAM,eACTH,EAAM,SAAA,EAGR,aACG,QAAA,CAAM,UAAWC,EAAM,GAAGD,EACxB,SAAAD,EACH,CAEJ,CAEAS,EAAU,YAAc,YCZxB,SAASC,EAAU,CAAE,MAAAC,EAAQ,OAAQ,SAAAX,EAAU,GAAGC,GAAyB,CACzE,MAAMW,EAAYT,EAAAA,UAChB,GAAGC,EAAAA,MAAM,eACT,GAAGA,EAAAA,MAAM,iBAAiBO,CAAK,EAAA,EAGjC,OACEL,EAAAA,IAAC,KAAA,CAAG,UAAAM,EAAuB,GAAGX,EAC3B,SAAAD,EACH,CAEJ,CAEA,MAAAa,EAAeL,EAAAA,gBAAgBE,CAAS,ECnBxC,SAASI,EAAY,CAAE,SAAAd,GAA+B,CACpD,MAAMY,EAAYT,EAAAA,UAChB,GAAGC,EAAAA,MAAM,gBAAA,EAGX,aACG,QAAA,CAAM,UAAAQ,EACL,SAAAN,EAAAA,IAAC,KAAA,CACE,SAAAN,EACH,EACF,CAEJ,CAEAc,EAAY,YAAc"}
@@ -1,2 +1,2 @@
1
- import{jsx as i}from"react/jsx-runtime";import{p as t}from"./index-CZ41y9Hn.js";import{j as l}from"./joinClass-anSpaauN.js";import{c as n}from"./convertPathToColor-DtOjH4ZP.js";import{u as b}from"./useTheme-g5gOUmLf.js";import{c as u}from"./createComponent-DZqrA_Tp.js";const v=["h1","h2","h3","h4","h5","h6","subtitle1","subtitle2","body1","body2"],f={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p"};function g({children:e,variant:s="body1",color:a="text.primary",weight:h,textAlign:p,...o}){const{theme:{palette:m}}=b(),y=f[s],c=l(`${t}-typography`,`${t}-typography--${s}`,h&&`${t}-typography--weight-${h}`,o.className),r=n(a,m);return i(y,{...o,className:c,style:{...r?{color:r}:{},textAlign:p,...o.style},children:e})}const N=u(g);export{N as T,v};
2
- //# sourceMappingURL=Typography-hazfs4Ye.js.map
1
+ import{jsx as i}from"react/jsx-runtime";import{p as t}from"./index-CZ41y9Hn.js";import{j as l}from"./joinClass-anSpaauN.js";import{c as n}from"./convertPathToColor-DtOjH4ZP.js";import{u as b}from"./useTheme-BYuNiCiH.js";import{c as u}from"./createComponent-CovqNaAJ.js";const v=["h1","h2","h3","h4","h5","h6","subtitle1","subtitle2","body1","body2"],f={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p"};function g({children:e,variant:s="body1",color:a="text.primary",weight:h,textAlign:p,...o}){const{theme:{palette:m}}=b(),y=f[s],c=l(`${t}-typography`,`${t}-typography--${s}`,h&&`${t}-typography--weight-${h}`,o.className),r=n(a,m);return i(y,{...o,className:c,style:{...r?{color:r}:{},textAlign:p,...o.style},children:e})}const N=u(g);export{N as T,v};
2
+ //# sourceMappingURL=Typography-BrJZyxiT.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Typography-hazfs4Ye.js","sources":["../../src/display/Typography/Typography.tsx"],"sourcesContent":["import { type PropsWithChildren, type HTMLAttributes, type CSSProperties } from 'react';\n\nimport { prefix } from '@iziui/tokens/web/js';\n\nimport type { MappedColors } from '@iziui/core/theme';\nimport { joinClass } from '@iziui/core/utils/joinClass';\nimport { convertPathToColor } from '@iziui/core/utils/convertPathToColor';\n\nimport { useTheme } from '@/theme';\nimport createComponent from '@/core/createComponent';\n\nimport '@iziui/styles/components/Typography.scss';\n\nexport const variants = [\n 'h1',\n 'h2',\n 'h3',\n 'h4',\n 'h5',\n 'h6',\n 'subtitle1',\n 'subtitle2',\n 'body1',\n 'body2',\n] as const;\n\nexport type Variant = typeof variants[number];\n\nconst MAP: { [x: string]: React.ElementType } = {\n h1: 'h1',\n h2: 'h2',\n h3: 'h3',\n h4: 'h4',\n h5: 'h5',\n h6: 'h6',\n subtitle1: 'h6',\n subtitle2: 'h6',\n body1: 'p',\n body2: 'p',\n};\n\nexport interface TypographyProps extends PropsWithChildren<HTMLAttributes<HTMLParagraphElement>> {\n variant?: Variant;\n color?: MappedColors;\n textAlign?: CSSProperties['textAlign'];\n weight?: 'bold' | 'normal' | 'light';\n}\n\nfunction Typography({\n children,\n variant = 'body1',\n color: _color = 'text.primary',\n weight,\n textAlign,\n ...props\n}: TypographyProps) {\n const { theme: { palette } } = useTheme();\n\n const CustomTag = MAP[variant];\n\n const cls = joinClass(\n `${prefix}-typography`,\n `${prefix}-typography--${variant}`,\n weight && `${prefix}-typography--weight-${weight}`,\n props.className\n );\n\n const color = convertPathToColor(_color, palette);\n\n return (\n <CustomTag\n {...props}\n className={cls}\n style={{\n ...(color ? { color } : {}),\n textAlign,\n ...props.style\n }}\n >\n {children}\n </CustomTag>\n );\n}\n\nexport default createComponent(Typography);"],"names":["variants","MAP","Typography","children","variant","_color","weight","textAlign","props","palette","useTheme","CustomTag","cls","joinClass","prefix","color","convertPathToColor","jsx","Typography$1","createComponent"],"mappings":"8QAaO,MAAMA,EAAW,CACtB,KACA,KACA,KACA,KACA,KACA,KACA,YACA,YACA,QACA,OACF,EAIMC,EAA0C,CAC9C,GAAI,KACJ,GAAI,KACJ,GAAI,KACJ,GAAI,KACJ,GAAI,KACJ,GAAI,KACJ,UAAW,KACX,UAAW,KACX,MAAO,IACP,MAAO,GACT,EASA,SAASC,EAAW,CAClB,SAAAC,EACA,QAAAC,EAAU,QACV,MAAOC,EAAS,eAChB,OAAAC,EACA,UAAAC,EACA,GAAGC,CACL,EAAoB,CAClB,KAAM,CAAE,MAAO,CAAE,QAAAC,CAAA,CAAQ,EAAMC,EAAA,EAEzBC,EAAYV,EAAIG,CAAO,EAEvBQ,EAAMC,EACV,GAAGC,CAAM,cACT,GAAGA,CAAM,gBAAgBV,CAAO,GAChCE,GAAU,GAAGQ,CAAM,uBAAuBR,CAAM,GAChDE,EAAM,SAAA,EAGFO,EAAQC,EAAmBX,EAAQI,CAAO,EAEhD,OACEQ,EAACN,EAAA,CACE,GAAGH,EACJ,UAAWI,EACX,MAAO,CACL,GAAIG,EAAQ,CAAE,MAAAA,CAAA,EAAU,CAAA,EACxB,UAAAR,EACA,GAAGC,EAAM,KAAA,EAGV,SAAAL,CAAA,CAAA,CAGP,CAEA,MAAAe,EAAeC,EAAgBjB,CAAU"}
1
+ {"version":3,"file":"Typography-BrJZyxiT.js","sources":["../../src/display/Typography/Typography.tsx"],"sourcesContent":["import { type PropsWithChildren, type HTMLAttributes, type CSSProperties } from 'react';\n\nimport { prefix } from '@iziui/tokens/web/js';\n\nimport type { MappedColors } from '@iziui/core/theme';\nimport { joinClass } from '@iziui/core/utils/joinClass';\nimport { convertPathToColor } from '@iziui/core/utils/convertPathToColor';\n\nimport { useTheme } from '@/theme';\nimport createComponent from '@/core/createComponent';\n\nimport '@iziui/styles/components/Typography.scss';\n\nexport const variants = [\n 'h1',\n 'h2',\n 'h3',\n 'h4',\n 'h5',\n 'h6',\n 'subtitle1',\n 'subtitle2',\n 'body1',\n 'body2',\n] as const;\n\nexport type Variant = typeof variants[number];\n\nconst MAP: { [x: string]: React.ElementType } = {\n h1: 'h1',\n h2: 'h2',\n h3: 'h3',\n h4: 'h4',\n h5: 'h5',\n h6: 'h6',\n subtitle1: 'h6',\n subtitle2: 'h6',\n body1: 'p',\n body2: 'p',\n};\n\nexport interface TypographyProps extends PropsWithChildren<HTMLAttributes<HTMLParagraphElement>> {\n variant?: Variant;\n color?: MappedColors;\n textAlign?: CSSProperties['textAlign'];\n weight?: 'bold' | 'normal' | 'light';\n}\n\nfunction Typography({\n children,\n variant = 'body1',\n color: _color = 'text.primary',\n weight,\n textAlign,\n ...props\n}: TypographyProps) {\n const { theme: { palette } } = useTheme();\n\n const CustomTag = MAP[variant];\n\n const cls = joinClass(\n `${prefix}-typography`,\n `${prefix}-typography--${variant}`,\n weight && `${prefix}-typography--weight-${weight}`,\n props.className\n );\n\n const color = convertPathToColor(_color, palette);\n\n return (\n <CustomTag\n {...props}\n className={cls}\n style={{\n ...(color ? { color } : {}),\n textAlign,\n ...props.style\n }}\n >\n {children}\n </CustomTag>\n );\n}\n\nexport default createComponent(Typography);"],"names":["variants","MAP","Typography","children","variant","_color","weight","textAlign","props","palette","useTheme","CustomTag","cls","joinClass","prefix","color","convertPathToColor","jsx","Typography$1","createComponent"],"mappings":"8QAaO,MAAMA,EAAW,CACtB,KACA,KACA,KACA,KACA,KACA,KACA,YACA,YACA,QACA,OACF,EAIMC,EAA0C,CAC9C,GAAI,KACJ,GAAI,KACJ,GAAI,KACJ,GAAI,KACJ,GAAI,KACJ,GAAI,KACJ,UAAW,KACX,UAAW,KACX,MAAO,IACP,MAAO,GACT,EASA,SAASC,EAAW,CAClB,SAAAC,EACA,QAAAC,EAAU,QACV,MAAOC,EAAS,eAChB,OAAAC,EACA,UAAAC,EACA,GAAGC,CACL,EAAoB,CAClB,KAAM,CAAE,MAAO,CAAE,QAAAC,CAAA,CAAQ,EAAMC,EAAA,EAEzBC,EAAYV,EAAIG,CAAO,EAEvBQ,EAAMC,EACV,GAAGC,CAAM,cACT,GAAGA,CAAM,gBAAgBV,CAAO,GAChCE,GAAU,GAAGQ,CAAM,uBAAuBR,CAAM,GAChDE,EAAM,SAAA,EAGFO,EAAQC,EAAmBX,EAAQI,CAAO,EAEhD,OACEQ,EAACN,EAAA,CACE,GAAGH,EACJ,UAAWI,EACX,MAAO,CACL,GAAIG,EAAQ,CAAE,MAAAA,CAAA,EAAU,CAAA,EACxB,UAAAR,EACA,GAAGC,EAAM,KAAA,EAGV,SAAAL,CAAA,CAAA,CAGP,CAEA,MAAAe,EAAeC,EAAgBjB,CAAU"}
@@ -1,2 +1,2 @@
1
- "use strict";const p=require("react/jsx-runtime"),t=require("./index-DYxwT4uW.cjs"),u=require("./joinClass-Jk3EszKD.cjs"),l=require("./convertPathToColor-D8eBpd_D.cjs"),m=require("./useTheme-DhX2tM8O.cjs"),b=require("./createComponent-BBXW0GJ6.cjs"),T=["h1","h2","h3","h4","h5","h6","subtitle1","subtitle2","body1","body2"],g={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p"};function x({children:h,variant:o="body1",color:n="text.primary",weight:s,textAlign:c,...e}){const{theme:{palette:a}}=m.useTheme(),i=g[o],y=u.joinClass(`${t.prefix}-typography`,`${t.prefix}-typography--${o}`,s&&`${t.prefix}-typography--weight-${s}`,e.className),r=l.convertPathToColor(n,a);return p.jsx(i,{...e,className:y,style:{...r?{color:r}:{},textAlign:c,...e.style},children:h})}const C=b.createComponent(x);exports.Typography=C;exports.variants=T;
2
- //# sourceMappingURL=Typography-C7B3jwUf.cjs.map
1
+ "use strict";const p=require("react/jsx-runtime"),t=require("./index-DYxwT4uW.cjs"),u=require("./joinClass-Jk3EszKD.cjs"),l=require("./convertPathToColor-D8eBpd_D.cjs"),m=require("./useTheme-DsrjDJKC.cjs"),b=require("./createComponent-Dkt68kvT.cjs"),T=["h1","h2","h3","h4","h5","h6","subtitle1","subtitle2","body1","body2"],g={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p"};function x({children:h,variant:o="body1",color:n="text.primary",weight:s,textAlign:c,...e}){const{theme:{palette:a}}=m.useTheme(),i=g[o],y=u.joinClass(`${t.prefix}-typography`,`${t.prefix}-typography--${o}`,s&&`${t.prefix}-typography--weight-${s}`,e.className),r=l.convertPathToColor(n,a);return p.jsx(i,{...e,className:y,style:{...r?{color:r}:{},textAlign:c,...e.style},children:h})}const C=b.createComponent(x);exports.Typography=C;exports.variants=T;
2
+ //# sourceMappingURL=Typography-DW57lh3e.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"Typography-C7B3jwUf.cjs","sources":["../../src/display/Typography/Typography.tsx"],"sourcesContent":["import { type PropsWithChildren, type HTMLAttributes, type CSSProperties } from 'react';\n\nimport { prefix } from '@iziui/tokens/web/js';\n\nimport type { MappedColors } from '@iziui/core/theme';\nimport { joinClass } from '@iziui/core/utils/joinClass';\nimport { convertPathToColor } from '@iziui/core/utils/convertPathToColor';\n\nimport { useTheme } from '@/theme';\nimport createComponent from '@/core/createComponent';\n\nimport '@iziui/styles/components/Typography.scss';\n\nexport const variants = [\n 'h1',\n 'h2',\n 'h3',\n 'h4',\n 'h5',\n 'h6',\n 'subtitle1',\n 'subtitle2',\n 'body1',\n 'body2',\n] as const;\n\nexport type Variant = typeof variants[number];\n\nconst MAP: { [x: string]: React.ElementType } = {\n h1: 'h1',\n h2: 'h2',\n h3: 'h3',\n h4: 'h4',\n h5: 'h5',\n h6: 'h6',\n subtitle1: 'h6',\n subtitle2: 'h6',\n body1: 'p',\n body2: 'p',\n};\n\nexport interface TypographyProps extends PropsWithChildren<HTMLAttributes<HTMLParagraphElement>> {\n variant?: Variant;\n color?: MappedColors;\n textAlign?: CSSProperties['textAlign'];\n weight?: 'bold' | 'normal' | 'light';\n}\n\nfunction Typography({\n children,\n variant = 'body1',\n color: _color = 'text.primary',\n weight,\n textAlign,\n ...props\n}: TypographyProps) {\n const { theme: { palette } } = useTheme();\n\n const CustomTag = MAP[variant];\n\n const cls = joinClass(\n `${prefix}-typography`,\n `${prefix}-typography--${variant}`,\n weight && `${prefix}-typography--weight-${weight}`,\n props.className\n );\n\n const color = convertPathToColor(_color, palette);\n\n return (\n <CustomTag\n {...props}\n className={cls}\n style={{\n ...(color ? { color } : {}),\n textAlign,\n ...props.style\n }}\n >\n {children}\n </CustomTag>\n );\n}\n\nexport default createComponent(Typography);"],"names":["variants","MAP","Typography","children","variant","_color","weight","textAlign","props","palette","useTheme","CustomTag","cls","joinClass","prefix","color","convertPathToColor","jsx","createComponent"],"mappings":"0PAaaA,EAAW,CACtB,KACA,KACA,KACA,KACA,KACA,KACA,YACA,YACA,QACA,OACF,EAIMC,EAA0C,CAC9C,GAAI,KACJ,GAAI,KACJ,GAAI,KACJ,GAAI,KACJ,GAAI,KACJ,GAAI,KACJ,UAAW,KACX,UAAW,KACX,MAAO,IACP,MAAO,GACT,EASA,SAASC,EAAW,CAClB,SAAAC,EACA,QAAAC,EAAU,QACV,MAAOC,EAAS,eAChB,OAAAC,EACA,UAAAC,EACA,GAAGC,CACL,EAAoB,CAClB,KAAM,CAAE,MAAO,CAAE,QAAAC,CAAA,CAAQ,EAAMC,EAAAA,SAAA,EAEzBC,EAAYV,EAAIG,CAAO,EAEvBQ,EAAMC,EAAAA,UACV,GAAGC,EAAAA,MAAM,cACT,GAAGA,EAAAA,MAAM,gBAAgBV,CAAO,GAChCE,GAAU,GAAGQ,EAAAA,MAAM,uBAAuBR,CAAM,GAChDE,EAAM,SAAA,EAGFO,EAAQC,EAAAA,mBAAmBX,EAAQI,CAAO,EAEhD,OACEQ,EAAAA,IAACN,EAAA,CACE,GAAGH,EACJ,UAAWI,EACX,MAAO,CACL,GAAIG,EAAQ,CAAE,MAAAA,CAAA,EAAU,CAAA,EACxB,UAAAR,EACA,GAAGC,EAAM,KAAA,EAGV,SAAAL,CAAA,CAAA,CAGP,CAEA,MAAAD,EAAegB,EAAAA,gBAAgBhB,CAAU"}
1
+ {"version":3,"file":"Typography-DW57lh3e.cjs","sources":["../../src/display/Typography/Typography.tsx"],"sourcesContent":["import { type PropsWithChildren, type HTMLAttributes, type CSSProperties } from 'react';\n\nimport { prefix } from '@iziui/tokens/web/js';\n\nimport type { MappedColors } from '@iziui/core/theme';\nimport { joinClass } from '@iziui/core/utils/joinClass';\nimport { convertPathToColor } from '@iziui/core/utils/convertPathToColor';\n\nimport { useTheme } from '@/theme';\nimport createComponent from '@/core/createComponent';\n\nimport '@iziui/styles/components/Typography.scss';\n\nexport const variants = [\n 'h1',\n 'h2',\n 'h3',\n 'h4',\n 'h5',\n 'h6',\n 'subtitle1',\n 'subtitle2',\n 'body1',\n 'body2',\n] as const;\n\nexport type Variant = typeof variants[number];\n\nconst MAP: { [x: string]: React.ElementType } = {\n h1: 'h1',\n h2: 'h2',\n h3: 'h3',\n h4: 'h4',\n h5: 'h5',\n h6: 'h6',\n subtitle1: 'h6',\n subtitle2: 'h6',\n body1: 'p',\n body2: 'p',\n};\n\nexport interface TypographyProps extends PropsWithChildren<HTMLAttributes<HTMLParagraphElement>> {\n variant?: Variant;\n color?: MappedColors;\n textAlign?: CSSProperties['textAlign'];\n weight?: 'bold' | 'normal' | 'light';\n}\n\nfunction Typography({\n children,\n variant = 'body1',\n color: _color = 'text.primary',\n weight,\n textAlign,\n ...props\n}: TypographyProps) {\n const { theme: { palette } } = useTheme();\n\n const CustomTag = MAP[variant];\n\n const cls = joinClass(\n `${prefix}-typography`,\n `${prefix}-typography--${variant}`,\n weight && `${prefix}-typography--weight-${weight}`,\n props.className\n );\n\n const color = convertPathToColor(_color, palette);\n\n return (\n <CustomTag\n {...props}\n className={cls}\n style={{\n ...(color ? { color } : {}),\n textAlign,\n ...props.style\n }}\n >\n {children}\n </CustomTag>\n );\n}\n\nexport default createComponent(Typography);"],"names":["variants","MAP","Typography","children","variant","_color","weight","textAlign","props","palette","useTheme","CustomTag","cls","joinClass","prefix","color","convertPathToColor","jsx","createComponent"],"mappings":"0PAaaA,EAAW,CACtB,KACA,KACA,KACA,KACA,KACA,KACA,YACA,YACA,QACA,OACF,EAIMC,EAA0C,CAC9C,GAAI,KACJ,GAAI,KACJ,GAAI,KACJ,GAAI,KACJ,GAAI,KACJ,GAAI,KACJ,UAAW,KACX,UAAW,KACX,MAAO,IACP,MAAO,GACT,EASA,SAASC,EAAW,CAClB,SAAAC,EACA,QAAAC,EAAU,QACV,MAAOC,EAAS,eAChB,OAAAC,EACA,UAAAC,EACA,GAAGC,CACL,EAAoB,CAClB,KAAM,CAAE,MAAO,CAAE,QAAAC,CAAA,CAAQ,EAAMC,EAAAA,SAAA,EAEzBC,EAAYV,EAAIG,CAAO,EAEvBQ,EAAMC,EAAAA,UACV,GAAGC,EAAAA,MAAM,cACT,GAAGA,EAAAA,MAAM,gBAAgBV,CAAO,GAChCE,GAAU,GAAGQ,EAAAA,MAAM,uBAAuBR,CAAM,GAChDE,EAAM,SAAA,EAGFO,EAAQC,EAAAA,mBAAmBX,EAAQI,CAAO,EAEhD,OACEQ,EAAAA,IAACN,EAAA,CACE,GAAGH,EACJ,UAAWI,EACX,MAAO,CACL,GAAIG,EAAQ,CAAE,MAAAA,CAAA,EAAU,CAAA,EACxB,UAAAR,EACA,GAAGC,EAAM,KAAA,EAGV,SAAAL,CAAA,CAAA,CAGP,CAEA,MAAAD,EAAegB,EAAAA,gBAAgBhB,CAAU"}
@@ -0,0 +1,8 @@
1
+ import{jsx as C}from"react/jsx-runtime";import{b as w,c as y,d as B,l as _,m as $,s as z,a as S}from"./index-CZ41y9Hn.js";import{u as L}from"./useTheme-BYuNiCiH.js";function N({sx:n,theme:t},...e){return e.reduce((r,s)=>(r={...r,...s(t,n)},r),{})}const j=(n,{color:t})=>{const{palette:e}=n;return t?{color:t(e)}:{}},A=(n,{background:t})=>{const{palette:e}=n;return t?{background:t(e)}:{}},O=(n,{borderColor:t})=>{const{palette:e}=n;return t?{borderColor:t(e)}:{}},k=(n,{backgroundColor:t})=>{const{palette:e}=n;return t?{backgroundColor:t(e)}:{}},T=(n,{borderRadius:t})=>{const{shape:e}=n;return t?{borderRadius:`${e.radius*t}px`}:{}},R=(n,{m:t,mb:e,ml:r,mr:s,mt:u,mx:a,my:i})=>{const{spacing:l}=n,o=d=>d||d===0?`${String(d*l)}px`:"",c=o(t),m=o(u),p=o(e),x=o(i),f=o(a),b=o(r),M=o(s);return{margin:c,marginTop:m||x||c,marginBottom:p||x||c,marginLeft:b||f||c,marginRight:M||f||c}},v=(n,{p:t,pb:e,pl:r,pr:s,pt:u,px:a,py:i})=>{const{spacing:l}=n,o=d=>d||d===0?`${String(d*l)}px`:"",c=o(t),m=o(u),p=o(e),x=o(i),f=o(a),b=o(r),M=o(s);return{padding:c,paddingTop:m||x||c,paddingBottom:p||x||c,paddingLeft:b||f||c,paddingRight:M||f||c}},I=(n,{boxShadow:t})=>t?{boxShadow:{sm:B,md:y,lg:w}[t]}:{};function U(){let n=new Date().getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){const r=(n+Math.random()*16)%16|0;return n=Math.floor(n/16),(e=="x"?r:r&3|8).toString(16)})}function D(n){let t=5381;for(let e=0;e<n.length;e++)t=(t<<5)+t+n.charCodeAt(e);return(t>>>0).toString(36)}function P(n){return n.normalize("NFD").trim().toLowerCase().replace(/a-zA-Z0-9_.-+/g,"").replace(/_/g,"").replace(/[^\w\s]/gi,"")}function Q(n){const t=n.trim().split(" "),e=t.length===1,r=P(t[0]).charAt(0).toLocaleUpperCase(),s=e?P(t[0]).charAt(1).toLocaleUpperCase():P(t.reverse()[0]).charAt(0).toLocaleUpperCase();return r+s}function E(n){return n.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}const h={xs:Number(S),sm:Number(S)+1,md:Number(z)+1,lg:Number($)+1,xl:Number(_)+1};function Z(n){return Object.entries(n).map(([t,e])=>e===void 0?"":`${E(t)}: ${e};`).join("")}function g(n,t,e){return`
2
+ @media (min-width: ${n}px) {
3
+ .${t} {
4
+ ${Z(e)}
5
+ }
6
+ }
7
+ `}const F=(n,{xs:t,sm:e,md:r,lg:s,xl:u})=>{const a=[],i=D(U());return t&&a.push(g(h.xs,i,t)),e&&a.push(g(h.sm,i,e)),r&&a.push(g(h.md,i,r)),s&&a.push(g(h.lg,i,s)),u&&a.push(g(h.xl,i,u)),a.join("")},K=Object.freeze(Object.defineProperty({__proto__:null,defineBackground:A,defineBackgroundColor:k,defineBorderColor:O,defineBorderRadius:T,defineBoxShadow:I,defineBreakpoint:F,defineColor:j,defineMargin:R,definePadding:v},Symbol.toStringTag,{value:"Module"}));function q(n){return Object.values(n).map(t=>t)}function V(n){return n.displayName=n.name,({sx:e,fullWidth:r,...s})=>{const{theme:u}=L(),{defineBreakpoint:a,...i}=K;e&&console.log(a(u,e));const l=e&&N({theme:u,sx:e},...q(i));return C(n,{...s,style:{boxSizing:"border-box",...s.style,...l,...r?{width:"100%"}:{}}})}}export{V as c,Q as g,U as u};
8
+ //# sourceMappingURL=createComponent-CovqNaAJ.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createComponent-CovqNaAJ.js","sources":["../../../../core/src/options/createOptions/createOptions.ts","../../../../core/src/plugin/color/defineColor/defineColor.ts","../../../../core/src/plugin/color/defineBackground/defineBackground.ts","../../../../core/src/plugin/color/defineBorderColor/defineBorderColor.ts","../../../../core/src/plugin/color/defineBackgroundColor/defineBackgroundColor.ts","../../../../core/src/plugin/shape/defineBorderRadius/defineBorderRadius.ts","../../../../core/src/plugin/spacing/defineMargin/defineMargin.ts","../../../../core/src/plugin/spacing/definePadding/definePadding.ts","../../../../core/src/plugin/behavior/defineBoxShadow/defineBoxShadow.ts","../../../../toolkit/src/uuid/uuid.ts","../../../../toolkit/src/string/string.ts","../../../../core/src/plugin/breakpoint/defineBreakpoint/defineBreakpoint.ts","../../src/core/createComponent.tsx"],"sourcesContent":["import type { Properties } from 'csstype';\n\nimport type { Plugin } from '../../plugin';\nimport type { ThemeBuilded } from '../../theme';\nimport type { CustomOptions } from '../CustomOptions';\n\ntype Data = {\n sx: CustomOptions;\n theme: ThemeBuilded;\n}\n\nexport default function createOptions({\n sx,\n theme\n}: Data, ...plugins: Plugin[]) {\n return plugins.reduce<Properties>((acc, plugin) => {\n acc = { ...acc, ...plugin(theme, sx) };\n\n return acc;\n }, {});\n}","import definePlugin from '../../definePlugin';\n\nexport default definePlugin((theme, { color }) => {\n const { palette } = theme;\n\n if (!color) { return {}; }\n\n return {\n color: color(palette)\n };\n});","import definePlugin from '../../definePlugin';\n\nexport default definePlugin((theme, { background }) => {\n const { palette } = theme;\n\n if (!background) { return {}; }\n\n return {\n background: background(palette)\n };\n});","import definePlugin from '../../definePlugin';\n\nexport default definePlugin((theme, { borderColor }) => {\n const { palette } = theme;\n\n if (!borderColor) { return {}; }\n\n return {\n borderColor: borderColor(palette)\n };\n});","import definePlugin from '../../definePlugin';\n\nexport default definePlugin((theme, { backgroundColor }) => {\n const { palette } = theme;\n\n if (!backgroundColor) { return {}; }\n\n return {\n backgroundColor: backgroundColor(palette)\n };\n});","import definePlugin from '../../definePlugin';\n\nexport default definePlugin((theme, { borderRadius }) => {\n const { shape } = theme;\n\n if (!borderRadius) { return {}; }\n\n return {\n borderRadius: `${shape.radius * borderRadius}px`\n };\n});","import definePlugin from '../../definePlugin';\n\nexport default definePlugin((theme, { m, mb, ml, mr, mt, mx, my }) => {\n const { spacing } = theme;\n\n const calculateMargin = (mg?: number) => {\n return !!mg || mg === 0 ? `${String(mg * spacing)}px` : '';\n };\n\n const hasM = calculateMargin(m);\n\n const hasMt = calculateMargin(mt);\n const hasMb = calculateMargin(mb);\n\n const hasMy = calculateMargin(my);\n const hasMx = calculateMargin(mx);\n\n const hasMl = calculateMargin(ml);\n const hasMr = calculateMargin(mr);\n\n return {\n margin: hasM,\n marginTop: hasMt || hasMy || hasM,\n marginBottom: hasMb || hasMy || hasM,\n marginLeft: hasMl || hasMx || hasM,\n marginRight: hasMr || hasMx || hasM,\n };\n});","import definePlugin from '../../definePlugin';\n\nexport default definePlugin((theme, { p, pb, pl, pr, pt, px, py }) => {\n const { spacing } = theme;\n\n const calculatePadding = (pd?: number) => {\n return !!pd || pd === 0 ? `${String(pd * spacing)}px` : '';\n };\n\n const hasP = calculatePadding(p);\n\n const hasPt = calculatePadding(pt);\n const hasPb = calculatePadding(pb);\n\n const hasPy = calculatePadding(py);\n const hasPx = calculatePadding(px);\n\n const hasPl = calculatePadding(pl);\n const hasPr = calculatePadding(pr);\n\n return {\n padding: hasP,\n paddingTop: hasPt || hasPy || hasP,\n paddingBottom: hasPb || hasPy || hasP,\n paddingLeft: hasPl || hasPx || hasP,\n paddingRight: hasPr || hasPx || hasP,\n };\n});","import { boxShadowSmall, boxShadowRegular, boxShadowLarge } from '@iziui/tokens/web/js';\n\nimport definePlugin from '../../definePlugin';\nimport type { CustomOptions } from '../../../options/CustomOptions';\n\ntype ExtractSize = NonNullable<CustomOptions['boxShadow']>;\n\nexport default definePlugin((_, { boxShadow }) => {\n\n if (!boxShadow) { return {}; }\n\n const sizes: { [s in ExtractSize]: string } = {\n sm: boxShadowSmall,\n md: boxShadowRegular,\n lg: boxShadowLarge,\n };\n\n return {\n boxShadow: sizes[boxShadow]\n };\n});","export function uuid() {\n let dt = new Date().getTime();\n\n const uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {\n const r = (dt + Math.random() * 16) % 16 | 0;\n dt = Math.floor(dt / 16);\n return (c == 'x' ? r : (r & 0x3 | 0x8)).toString(16);\n });\n\n return uuid;\n}\n\nexport function hash(str: string): string {\n let h = 5381;\n\n for (let i = 0; i < str.length; i++) {\n h = ((h << 5) + h) + str.charCodeAt(i);\n }\n\n return (h >>> 0).toString(36);\n}","export function sanitize(value: string) {\n return value.normalize('NFD')\n .trim().toLowerCase()\n .replace(/a-zA-Z0-9_.-+/g, '')\n .replace(/_/g, '')\n .replace(/[^\\w\\s]/gi, '');\n};\n\nexport function getInitials(name: string) {\n const names: string[] = name.trim().split(' ');\n\n const hasOneName = names.length === 1;\n\n const firstInitial = sanitize(names[0]).charAt(0).toLocaleUpperCase();\n\n const secondInitial = hasOneName\n ? sanitize(names[0]).charAt(1).toLocaleUpperCase()\n : sanitize(names.reverse()[0]).charAt(0).toLocaleUpperCase();\n\n return firstInitial + secondInitial;\n};\n\nexport function slug(str: string) {\n if (!str) { return ''; }\n\n return sanitize(str)\n .replace(/\\s+/g, '-');\n}\n\nexport function capitalize(str: string) {\n if (!str) { return ''; }\n return str[0].toUpperCase() + str.slice(1);\n}\n\nexport function toKebabCase(value: string) {\n return value.replace(/[A-Z]/g, match => `-${match.toLowerCase()}`);\n}","import type { Properties } from 'csstype';\n\nimport { xs, sm, md, lg } from '@iziui/tokens/web/js';\n\nimport { hash, uuid } from '@iziui/toolkit/uuid';\nimport { toKebabCase } from '@iziui/toolkit/string';\n\nimport definePlugin from '../../definePlugin';\n\nconst breakpoints = {\n xs: Number(xs),\n sm: Number(xs) + 1,\n md: Number(sm) + 1,\n lg: Number(md) + 1,\n xl: Number(lg) + 1,\n} as const;\n\nfunction serialize(styles: Properties) {\n return Object.entries(styles)\n .map(([key, value]) => {\n if (value === undefined) return '';\n\n return `${toKebabCase(key)}: ${value};`;\n })\n .join('');\n}\n\nfunction createMedia(breakpoint: number, className: string, props: Properties) {\n return `\n @media (min-width: ${breakpoint}px) {\n .${className} {\n ${serialize(props)}\n }\n }\n `;\n}\n\nexport default definePlugin<string>((_, { xs, sm, md, lg, xl }) => {\n const medias = [];\n\n const _hash = hash(uuid());\n\n if (xs) { medias.push(createMedia(breakpoints.xs, _hash, xs)); };\n if (sm) { medias.push(createMedia(breakpoints.sm, _hash, sm)); };\n if (md) { medias.push(createMedia(breakpoints.md, _hash, md)); };\n if (lg) { medias.push(createMedia(breakpoints.lg, _hash, lg)); };\n if (xl) { medias.push(createMedia(breakpoints.xl, _hash, xl)); };\n\n return medias.join('');\n});\n","import type { ComponentType, FC } from 'react';\n\nimport type { Sx } from '@iziui/core/system';\nimport type { Plugin } from '@iziui/core/plugin';\nimport createOptions from '@iziui/core/options';\nimport * as plugins from '@iziui/core/plugin';\n\nimport { useTheme } from '@/theme';\n\nfunction extract(module: { [key: string]: Plugin }) {\n return Object.values(module).map((fn) => fn);\n}\n\nexport default function createComponent<P>(WrappedComponent: ComponentType<P>) {\n WrappedComponent.displayName = WrappedComponent.name;\n\n const EnhancedComponent: FC<Sx<P>> = ({ sx, fullWidth, ...props }) => {\n const { theme } = useTheme();\n\n const { defineBreakpoint, ...restPlugins } = plugins;\n\n if (sx) {\n console.log(defineBreakpoint(theme, sx));\n }\n\n const options = sx && createOptions({ theme, sx },\n ...extract(restPlugins),\n );\n\n return (\n <WrappedComponent\n {...(props as P)}\n style={{\n boxSizing: 'border-box',\n ...props['style'],\n ...options,\n ...(fullWidth ? { width: '100%' } : {}),\n }}\n />\n );\n };\n\n return EnhancedComponent;\n}"],"names":["createOptions","sx","theme","plugins","acc","plugin","defineColor","color","palette","defineBackground","background","defineBorderColor","borderColor","defineBackgroundColor","backgroundColor","defineBorderRadius","borderRadius","shape","defineMargin","m","mb","ml","mr","mt","mx","my","spacing","calculateMargin","mg","hasM","hasMt","hasMb","hasMy","hasMx","hasMl","hasMr","definePadding","p","pb","pl","pr","pt","px","py","calculatePadding","pd","hasP","hasPt","hasPb","hasPy","hasPx","hasPl","hasPr","defineBoxShadow","_","boxShadow","boxShadowSmall","boxShadowRegular","boxShadowLarge","uuid","dt","c","hash","str","h","i","sanitize","value","getInitials","name","names","hasOneName","firstInitial","secondInitial","toKebabCase","match","breakpoints","xs","sm","md","lg","serialize","styles","key","createMedia","breakpoint","className","props","defineBreakpoint","xl","medias","_hash","extract","module","fn","createComponent","WrappedComponent","fullWidth","useTheme","restPlugins","options","jsx"],"mappings":"qKAWA,SAAwBA,EAAc,CACpC,GAAAC,EACA,MAAAC,CACF,KAAYC,EAAmB,C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,EACL,MAAO,CACL,UAAW,aACX,GAAGA,EAAM,MACT,GAAGa,EACH,GAAIH,EAAY,CAAE,MAAO,QAAW,CAAA,CAAC,CACvC,CAAA,CAGN,CAGF"}
@@ -0,0 +1,8 @@
1
+ "use strict";const w=require("react/jsx-runtime"),d=require("./index-DYxwT4uW.cjs"),y=require("./useTheme-DsrjDJKC.cjs");function B({sx:t,theme:e},...n){return n.reduce((r,s)=>(r={...r,...s(e,t)},r),{})}const _=(t,{color:e})=>{const{palette:n}=t;return e?{color:e(n)}:{}},$=(t,{background:e})=>{const{palette:n}=t;return e?{background:e(n)}:{}},j=(t,{borderColor:e})=>{const{palette:n}=t;return e?{borderColor:e(n)}:{}},z=(t,{backgroundColor:e})=>{const{palette:n}=t;return e?{backgroundColor:e(n)}:{}},L=(t,{borderRadius:e})=>{const{shape:n}=t;return e?{borderRadius:`${n.radius*e}px`}:{}},N=(t,{m:e,mb:n,ml:r,mr:s,mt:u,mx:i,my:a})=>{const{spacing:x}=t,o=l=>l||l===0?`${String(l*x)}px`:"",c=o(e),p=o(u),b=o(n),h=o(a),g=o(i),M=o(r),C=o(s);return{margin:c,marginTop:p||h||c,marginBottom:b||h||c,marginLeft:M||g||c,marginRight:C||g||c}},A=(t,{p:e,pb:n,pl:r,pr:s,pt:u,px:i,py:a})=>{const{spacing:x}=t,o=l=>l||l===0?`${String(l*x)}px`:"",c=o(e),p=o(u),b=o(n),h=o(a),g=o(i),M=o(r),C=o(s);return{padding:c,paddingTop:p||h||c,paddingBottom:b||h||c,paddingLeft:M||g||c,paddingRight:C||g||c}},O=(t,{boxShadow:e})=>e?{boxShadow:{sm:d.boxShadowSmall,md:d.boxShadowRegular,lg:d.boxShadowLarge}[e]}:{};function S(){let t=new Date().getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(n){const r=(t+Math.random()*16)%16|0;return t=Math.floor(t/16),(n=="x"?r:r&3|8).toString(16)})}function T(t){let e=5381;for(let n=0;n<t.length;n++)e=(e<<5)+e+t.charCodeAt(n);return(e>>>0).toString(36)}function P(t){return t.normalize("NFD").trim().toLowerCase().replace(/a-zA-Z0-9_.-+/g,"").replace(/_/g,"").replace(/[^\w\s]/gi,"")}function k(t){const e=t.trim().split(" "),n=e.length===1,r=P(e[0]).charAt(0).toLocaleUpperCase(),s=n?P(e[0]).charAt(1).toLocaleUpperCase():P(e.reverse()[0]).charAt(0).toLocaleUpperCase();return r+s}function R(t){return t.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}const f={xs:Number(d.xs),sm:Number(d.xs)+1,md:Number(d.sm)+1,lg:Number(d.md)+1,xl:Number(d.lg)+1};function I(t){return Object.entries(t).map(([e,n])=>n===void 0?"":`${R(e)}: ${n};`).join("")}function m(t,e,n){return`
2
+ @media (min-width: ${t}px) {
3
+ .${e} {
4
+ ${I(n)}
5
+ }
6
+ }
7
+ `}const q=(t,{xs:e,sm:n,md:r,lg:s,xl:u})=>{const i=[],a=T(S());return e&&i.push(m(f.xs,a,e)),n&&i.push(m(f.sm,a,n)),r&&i.push(m(f.md,a,r)),s&&i.push(m(f.lg,a,s)),u&&i.push(m(f.xl,a,u)),i.join("")},v=Object.freeze(Object.defineProperty({__proto__:null,defineBackground:$,defineBackgroundColor:z,defineBorderColor:j,defineBorderRadius:L,defineBoxShadow:O,defineBreakpoint:q,defineColor:_,defineMargin:N,definePadding:A},Symbol.toStringTag,{value:"Module"}));function U(t){return Object.values(t).map(e=>e)}function D(t){return t.displayName=t.name,({sx:n,fullWidth:r,...s})=>{const{theme:u}=y.useTheme(),{defineBreakpoint:i,...a}=v;n&&console.log(i(u,n));const x=n&&B({theme:u,sx:n},...U(a));return w.jsx(t,{...s,style:{boxSizing:"border-box",...s.style,...x,...r?{width:"100%"}:{}}})}}exports.createComponent=D;exports.getInitials=k;exports.uuid=S;
8
+ //# sourceMappingURL=createComponent-Dkt68kvT.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createComponent-Dkt68kvT.cjs","sources":["../../../../core/src/options/createOptions/createOptions.ts","../../../../core/src/plugin/color/defineColor/defineColor.ts","../../../../core/src/plugin/color/defineBackground/defineBackground.ts","../../../../core/src/plugin/color/defineBorderColor/defineBorderColor.ts","../../../../core/src/plugin/color/defineBackgroundColor/defineBackgroundColor.ts","../../../../core/src/plugin/shape/defineBorderRadius/defineBorderRadius.ts","../../../../core/src/plugin/spacing/defineMargin/defineMargin.ts","../../../../core/src/plugin/spacing/definePadding/definePadding.ts","../../../../core/src/plugin/behavior/defineBoxShadow/defineBoxShadow.ts","../../../../toolkit/src/uuid/uuid.ts","../../../../toolkit/src/string/string.ts","../../../../core/src/plugin/breakpoint/defineBreakpoint/defineBreakpoint.ts","../../src/core/createComponent.tsx"],"sourcesContent":["import type { Properties } from 'csstype';\n\nimport type { Plugin } from '../../plugin';\nimport type { ThemeBuilded } from '../../theme';\nimport type { CustomOptions } from '../CustomOptions';\n\ntype Data = {\n sx: CustomOptions;\n theme: ThemeBuilded;\n}\n\nexport default function createOptions({\n sx,\n theme\n}: Data, ...plugins: Plugin[]) {\n return plugins.reduce<Properties>((acc, plugin) => {\n acc = { ...acc, ...plugin(theme, sx) };\n\n return acc;\n }, {});\n}","import definePlugin from '../../definePlugin';\n\nexport default definePlugin((theme, { color }) => {\n const { palette } = theme;\n\n if (!color) { return {}; }\n\n return {\n color: color(palette)\n };\n});","import definePlugin from '../../definePlugin';\n\nexport default definePlugin((theme, { background }) => {\n const { palette } = theme;\n\n if (!background) { return {}; }\n\n return {\n background: background(palette)\n };\n});","import definePlugin from '../../definePlugin';\n\nexport default definePlugin((theme, { borderColor }) => {\n const { palette } = theme;\n\n if (!borderColor) { return {}; }\n\n return {\n borderColor: borderColor(palette)\n };\n});","import definePlugin from '../../definePlugin';\n\nexport default definePlugin((theme, { backgroundColor }) => {\n const { palette } = theme;\n\n if (!backgroundColor) { return {}; }\n\n return {\n backgroundColor: backgroundColor(palette)\n };\n});","import definePlugin from '../../definePlugin';\n\nexport default definePlugin((theme, { borderRadius }) => {\n const { shape } = theme;\n\n if (!borderRadius) { return {}; }\n\n return {\n borderRadius: `${shape.radius * borderRadius}px`\n };\n});","import definePlugin from '../../definePlugin';\n\nexport default definePlugin((theme, { m, mb, ml, mr, mt, mx, my }) => {\n const { spacing } = theme;\n\n const calculateMargin = (mg?: number) => {\n return !!mg || mg === 0 ? `${String(mg * spacing)}px` : '';\n };\n\n const hasM = calculateMargin(m);\n\n const hasMt = calculateMargin(mt);\n const hasMb = calculateMargin(mb);\n\n const hasMy = calculateMargin(my);\n const hasMx = calculateMargin(mx);\n\n const hasMl = calculateMargin(ml);\n const hasMr = calculateMargin(mr);\n\n return {\n margin: hasM,\n marginTop: hasMt || hasMy || hasM,\n marginBottom: hasMb || hasMy || hasM,\n marginLeft: hasMl || hasMx || hasM,\n marginRight: hasMr || hasMx || hasM,\n };\n});","import definePlugin from '../../definePlugin';\n\nexport default definePlugin((theme, { p, pb, pl, pr, pt, px, py }) => {\n const { spacing } = theme;\n\n const calculatePadding = (pd?: number) => {\n return !!pd || pd === 0 ? `${String(pd * spacing)}px` : '';\n };\n\n const hasP = calculatePadding(p);\n\n const hasPt = calculatePadding(pt);\n const hasPb = calculatePadding(pb);\n\n const hasPy = calculatePadding(py);\n const hasPx = calculatePadding(px);\n\n const hasPl = calculatePadding(pl);\n const hasPr = calculatePadding(pr);\n\n return {\n padding: hasP,\n paddingTop: hasPt || hasPy || hasP,\n paddingBottom: hasPb || hasPy || hasP,\n paddingLeft: hasPl || hasPx || hasP,\n paddingRight: hasPr || hasPx || hasP,\n };\n});","import { boxShadowSmall, boxShadowRegular, boxShadowLarge } from '@iziui/tokens/web/js';\n\nimport definePlugin from '../../definePlugin';\nimport type { CustomOptions } from '../../../options/CustomOptions';\n\ntype ExtractSize = NonNullable<CustomOptions['boxShadow']>;\n\nexport default definePlugin((_, { boxShadow }) => {\n\n if (!boxShadow) { return {}; }\n\n const sizes: { [s in ExtractSize]: string } = {\n sm: boxShadowSmall,\n md: boxShadowRegular,\n lg: boxShadowLarge,\n };\n\n return {\n boxShadow: sizes[boxShadow]\n };\n});","export function uuid() {\n let dt = new Date().getTime();\n\n const uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {\n const r = (dt + Math.random() * 16) % 16 | 0;\n dt = Math.floor(dt / 16);\n return (c == 'x' ? r : (r & 0x3 | 0x8)).toString(16);\n });\n\n return uuid;\n}\n\nexport function hash(str: string): string {\n let h = 5381;\n\n for (let i = 0; i < str.length; i++) {\n h = ((h << 5) + h) + str.charCodeAt(i);\n }\n\n return (h >>> 0).toString(36);\n}","export function sanitize(value: string) {\n return value.normalize('NFD')\n .trim().toLowerCase()\n .replace(/a-zA-Z0-9_.-+/g, '')\n .replace(/_/g, '')\n .replace(/[^\\w\\s]/gi, '');\n};\n\nexport function getInitials(name: string) {\n const names: string[] = name.trim().split(' ');\n\n const hasOneName = names.length === 1;\n\n const firstInitial = sanitize(names[0]).charAt(0).toLocaleUpperCase();\n\n const secondInitial = hasOneName\n ? sanitize(names[0]).charAt(1).toLocaleUpperCase()\n : sanitize(names.reverse()[0]).charAt(0).toLocaleUpperCase();\n\n return firstInitial + secondInitial;\n};\n\nexport function slug(str: string) {\n if (!str) { return ''; }\n\n return sanitize(str)\n .replace(/\\s+/g, '-');\n}\n\nexport function capitalize(str: string) {\n if (!str) { return ''; }\n return str[0].toUpperCase() + str.slice(1);\n}\n\nexport function toKebabCase(value: string) {\n return value.replace(/[A-Z]/g, match => `-${match.toLowerCase()}`);\n}","import type { Properties } from 'csstype';\n\nimport { xs, sm, md, lg } from '@iziui/tokens/web/js';\n\nimport { hash, uuid } from '@iziui/toolkit/uuid';\nimport { toKebabCase } from '@iziui/toolkit/string';\n\nimport definePlugin from '../../definePlugin';\n\nconst breakpoints = {\n xs: Number(xs),\n sm: Number(xs) + 1,\n md: Number(sm) + 1,\n lg: Number(md) + 1,\n xl: Number(lg) + 1,\n} as const;\n\nfunction serialize(styles: Properties) {\n return Object.entries(styles)\n .map(([key, value]) => {\n if (value === undefined) return '';\n\n return `${toKebabCase(key)}: ${value};`;\n })\n .join('');\n}\n\nfunction createMedia(breakpoint: number, className: string, props: Properties) {\n return `\n @media (min-width: ${breakpoint}px) {\n .${className} {\n ${serialize(props)}\n }\n }\n `;\n}\n\nexport default definePlugin<string>((_, { xs, sm, md, lg, xl }) => {\n const medias = [];\n\n const _hash = hash(uuid());\n\n if (xs) { medias.push(createMedia(breakpoints.xs, _hash, xs)); };\n if (sm) { medias.push(createMedia(breakpoints.sm, _hash, sm)); };\n if (md) { medias.push(createMedia(breakpoints.md, _hash, md)); };\n if (lg) { medias.push(createMedia(breakpoints.lg, _hash, lg)); };\n if (xl) { medias.push(createMedia(breakpoints.xl, _hash, xl)); };\n\n return medias.join('');\n});\n","import type { ComponentType, FC } from 'react';\n\nimport type { Sx } from '@iziui/core/system';\nimport type { Plugin } from '@iziui/core/plugin';\nimport createOptions from '@iziui/core/options';\nimport * as plugins from '@iziui/core/plugin';\n\nimport { useTheme } from '@/theme';\n\nfunction extract(module: { [key: string]: Plugin }) {\n return Object.values(module).map((fn) => fn);\n}\n\nexport default function createComponent<P>(WrappedComponent: ComponentType<P>) {\n WrappedComponent.displayName = WrappedComponent.name;\n\n const EnhancedComponent: FC<Sx<P>> = ({ sx, fullWidth, ...props }) => {\n const { theme } = useTheme();\n\n const { defineBreakpoint, ...restPlugins } = plugins;\n\n if (sx) {\n console.log(defineBreakpoint(theme, sx));\n }\n\n const options = sx && createOptions({ theme, sx },\n ...extract(restPlugins),\n );\n\n return (\n <WrappedComponent\n {...(props as P)}\n style={{\n boxSizing: 'border-box',\n ...props['style'],\n ...options,\n ...(fullWidth ? { width: '100%' } : {}),\n }}\n />\n );\n };\n\n return EnhancedComponent;\n}"],"names":["createOptions","sx","theme","plugins","acc","plugin","defineColor","color","palette","defineBackground","background","defineBorderColor","borderColor","defineBackgroundColor","backgroundColor","defineBorderRadius","borderRadius","shape","defineMargin","m","mb","ml","mr","mt","mx","my","spacing","calculateMargin","mg","hasM","hasMt","hasMb","hasMy","hasMx","hasMl","hasMr","definePadding","p","pb","pl","pr","pt","px","py","calculatePadding","pd","hasP","hasPt","hasPb","hasPy","hasPx","hasPl","hasPr","defineBoxShadow","_","boxShadow","boxShadowSmall","boxShadowRegular","boxShadowLarge","uuid","dt","c","hash","str","h","i","sanitize","value","getInitials","name","names","hasOneName","firstInitial","secondInitial","toKebabCase","match","breakpoints","xs","sm","md","lg","serialize","styles","key","createMedia","breakpoint","className","props","defineBreakpoint","xl","medias","_hash","extract","module","fn","createComponent","WrappedComponent","fullWidth","useTheme","restPlugins","options","jsx"],"mappings":"yHAWA,SAAwBA,EAAc,CACpC,GAAAC,EACA,MAAAC,CACF,KAAYC,EAAmB,CAC7B,OAAOA,EAAQ,OAAmB,CAACC,EAAKC,KACtCD,EAAM,CAAE,GAAGA,EAAK,GAAGC,EAAOH,EAAOD,CAAE,CAAA,EAE5BG,GACN,CAAA,CAAE,CACP,CClBA,MAAAE,EAA4B,CAACJ,EAAO,CAAE,MAAAK,KAAY,CAChD,KAAM,CAAE,QAAAC,GAAYN,EAEpB,OAAKK,EAEE,CACL,MAAOA,EAAMC,CAAO,CAAA,EAHD,CAAA,CAKvB,ECRAC,EAA4B,CAACP,EAAO,CAAE,WAAAQ,KAAiB,CACrD,KAAM,CAAE,QAAAF,GAAYN,EAEpB,OAAKQ,EAEE,CACL,WAAYA,EAAWF,CAAO,CAAA,EAHN,CAAA,CAK5B,ECRAG,EAA4B,CAACT,EAAO,CAAE,YAAAU,KAAkB,CACtD,KAAM,CAAE,QAAAJ,GAAYN,EAEpB,OAAKU,EAEE,CACL,YAAaA,EAAYJ,CAAO,CAAA,EAHP,CAAA,CAK7B,ECRAK,EAA4B,CAACX,EAAO,CAAE,gBAAAY,KAAsB,CAC1D,KAAM,CAAE,QAAAN,GAAYN,EAEpB,OAAKY,EAEE,CACL,gBAAiBA,EAAgBN,CAAO,C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AAC,EAErDC,EAAO,KAAK,EAAE,CACvB,qQCxCA,SAASE,EAAQC,EAAmC,CAClD,OAAO,OAAO,OAAOA,CAAM,EAAE,IAAKC,GAAOA,CAAE,CAC7C,CAEA,SAAwBC,EAAmBC,EAAoC,CAC7E,OAAAA,EAAiB,YAAcA,EAAiB,KAEX,CAAC,CAAE,GAAA/F,EAAI,UAAAgG,EAAW,GAAGV,KAAY,CACpE,KAAM,CAAE,MAAArF,CAAA,EAAUgG,WAAA,EAEZ,CAAE,iBAAAV,EAAkB,GAAGW,CAAA,EAAgBhG,EAEzCF,GACF,QAAQ,IAAIuF,EAAiBtF,EAAOD,CAAE,CAAC,EAGzC,MAAMmG,EAAUnG,GAAMD,EAAc,CAAE,MAAAE,EAAO,GAAAD,CAAA,EAC3C,GAAG2F,EAAQO,CAAW,CAAA,EAGxB,OACEE,EAAAA,IAACL,EAAA,CACE,GAAIT,EACL,MAAO,CACL,UAAW,aACX,GAAGA,EAAM,MACT,GAAGa,EACH,GAAIH,EAAY,CAAE,MAAO,QAAW,CAAA,CAAC,CACvC,CAAA,CAGN,CAGF"}
@@ -0,0 +1,2 @@
1
+ "use strict";const a=require("react/jsx-runtime"),n=require("react"),l=require("./index-DYxwT4uW.cjs"),D=require("./joinClass-Jk3EszKD.cjs"),$=require("./createComponent-Dkt68kvT.cjs"),E=require("./useListenerResized-AwpsZLcP.cjs"),L=require("./Card-DtjP8NP7.cjs"),S=require("./CardContent-BqqU9iwO.cjs");class B{delay(t,s=500){if(!s){t();return}clearTimeout(this.timeout),this.timeout=setTimeout(()=>{t()},s)}}const P=new B,W=n.forwardRef(function({open:t,width:s,children:d,anchorEl:o,direction:f="left",maxHeight:i,autoClose:j,onClose:q,...m},M){const[g,N]=n.useState(),[h,c]=n.useState({state:"invisible",animation:"close",width:"auto"}),k=16,y=150,v=n.Children.toArray(d),T=n.useMemo(()=>$.uuid(),[]),w=D.joinClass(`${l.prefix}-menu`,`${l.prefix}-menu--${h?.animation}`,m.className);E.useListenerResized(()=>b(),[o]),n.useEffect(()=>{b()},[o]),n.useEffect(()=>{t?A():C()},[t]);const b=()=>{o&&setTimeout(()=>{let e={};const{offsetWidth:r,offsetHeight:p,offsetLeft:_,offsetTop:R}=o;c(z=>({...z,width:r}));const x=R+p+k/2,O=document.getElementById(T);f==="center"&&(e={top:x,right:r}),f==="left"&&(e={top:x,left:_}),f==="right"&&(e={top:x,left:_-(O.offsetWidth-r)}),N(e)},0)},A=()=>{c(e=>({...e,state:"visible"})),setTimeout(()=>{c(e=>({...e,animation:"open"}))},10)},C=()=>{c(e=>({...e,animation:"close"})),setTimeout(()=>{c(e=>({...e,state:"invisible"})),q()},y)},I=()=>v.map((e,r)=>n.cloneElement(e,{tabIndex:r+1,key:`button-${r}`,onClick:p=>{P.delay(()=>{j&&C(),e.props.onClick&&e.props.onClick(p)},0)}}));return a.jsxs(a.Fragment,{children:[a.jsx("div",{id:T,ref:M,...m,style:{width:s||h.width,top:g?.top,left:g?.left,display:h?.state==="visible"?"block":"none",transition:`all ${y}ms ease-in`,zIndex:50,...m.style},className:w,children:t&&a.jsx(L.Card,{className:`${l.prefix}-menu__card`,children:a.jsx(S.CardContent,{className:`${l.prefix}-menu__card__content`,sx:{py:1},style:{display:"flex",flexDirection:"column",maxHeight:i},children:I()})})}),t&&a.jsx("div",{className:`${l.prefix}-menu__overlay`,onClick:C})]})}),F=$.createComponent(W);function G(){const[u,t]=n.useState(null),s=!!u,d=i=>{t(i?i.currentTarget:null)},o=()=>{t(null)};return[s,u,i=>{if(s){o();return}d(i)}]}exports.Menu=F;exports.useMenu=G;
2
+ //# sourceMappingURL=useMenu-DewYBiar.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"useMenu-Bw3Im-FW.cjs","sources":["../../../../toolkit/src/debounce/debounce.ts","../../src/navigation/Menu/Menu.tsx","../../src/navigation/Menu/useMenu.ts"],"sourcesContent":["class Debounce {\n private timeout: NodeJS.Timeout | undefined;\n public delay(func: (a?: any) => void, milliseconds = 500) {\n if (!milliseconds) {\n func();\n return;\n }\n\n clearTimeout(this.timeout);\n this.timeout = setTimeout(() => { func(); }, milliseconds);\n }\n}\n\nexport const debounce = new Debounce();\n","import {\n useMemo,\n useState,\n useEffect,\n Children,\n forwardRef,\n type ReactElement,\n type CSSProperties,\n type HTMLAttributes,\n cloneElement\n} from 'react';\n\nimport { prefix } from '@iziui/tokens/web/js';\n\nimport { joinClass } from '@iziui/core/utils';\n\nimport { uuid } from '@iziui/toolkit/uuid';\nimport { debounce } from '@iziui/toolkit/debounce';\n\nimport useListenerResized from '@/hooks/useListenerResized';\nimport { Card, CardContent } from '@/display/Card';\n\nimport createComponent from '../../core/createComponent';\n\nimport '@iziui/styles/components/Menu.scss';\n\ntype Direction = 'left' | 'right' | 'center';\ntype AnimationClass = 'open' | 'close';\ntype State = 'visible' | 'invisible';\ntype Coordinates = { top?: number; right?: number; bottom?: number; left?: number; };\ntype Config = { animation: AnimationClass, state: State; width: CSSProperties['width'] };\n\nexport interface MenuProps extends HTMLAttributes<HTMLDivElement> {\n open: boolean;\n autoClose?: boolean;\n maxHeight?: CSSProperties['maxHeight'];\n direction?: Direction;\n anchorEl: HTMLElement | null;\n width?: CSSProperties['width'];\n children: React.JSX.Element | React.JSX.Element[];\n onClose: (e?: React.MouseEvent<HTMLButtonElement>) => void;\n}\n\nconst Menu = forwardRef<HTMLDivElement, MenuProps>(function Menu({\n open,\n width,\n children,\n anchorEl,\n direction = 'left',\n maxHeight,\n autoClose,\n onClose,\n ...props\n}: MenuProps, ref) {\n const [coordinate, setCoordinate] = useState<Coordinates>();\n const [config, setConfig] = useState<Config>({ state: 'invisible', animation: 'close', width: 'auto' });\n\n const GAP = 16;\n const ANIMATION_DURATION = 150;\n\n const arrayChildren = Children.toArray(children) as ReactElement<any>[];\n\n const id = useMemo(() => uuid(), []);\n\n const classes = joinClass(\n `${prefix}-menu`,\n `${prefix}-menu--${config?.animation}`,\n props.className\n );\n\n useListenerResized(() => changePosition(), [anchorEl]);\n\n useEffect(() => { changePosition(); }, [anchorEl]);\n\n // eslint-disable-next-line @typescript-eslint/no-unused-expressions\n useEffect(() => { open ? handleOpen() : handleClose(); }, [open]);\n\n const changePosition = () => {\n if (!anchorEl) { return; }\n\n setTimeout(() => {\n let coordinates: Coordinates = {};\n\n const { offsetWidth, offsetHeight, offsetLeft, offsetTop } = anchorEl;\n\n setConfig(prev => ({ ...prev, width: offsetWidth }));\n\n const top = offsetTop + offsetHeight + (GAP / 2);\n\n const el = document.getElementById(id) as HTMLElement;\n\n if (direction === 'center') { coordinates = { top, right: offsetWidth }; }\n\n if (direction === 'left') { coordinates = { top, left: offsetLeft }; }\n\n if (direction === 'right') { coordinates = { top, left: offsetLeft - (el.offsetWidth - offsetWidth) }; }\n\n setCoordinate(coordinates);\n }, 0);\n };\n\n const handleOpen = () => {\n setConfig(prev => ({ ...prev, state: 'visible' }));\n\n setTimeout(() => { setConfig(prev => ({ ...prev, animation: 'open' })); }, 10);\n };\n\n const handleClose = () => {\n setConfig(prev => ({ ...prev, animation: 'close' }));\n\n setTimeout(() => {\n setConfig(prev => ({ ...prev, state: 'invisible' }));\n onClose();\n }, ANIMATION_DURATION);\n };\n\n const renderChildren = () => {\n return arrayChildren.map((child, index) => {\n return cloneElement(child, {\n 'tabIndex': index + 1,\n key: `button-${index}`,\n onClick: (e: React.MouseEvent<HTMLButtonElement>) => {\n debounce.delay(() => {\n\n if (autoClose) { handleClose(); }\n\n if (child.props.onClick) { child.props.onClick(e); }\n }, 0);\n },\n });\n });\n };\n\n return (\n <>\n <div\n id={id}\n ref={ref}\n {...props}\n style={{\n width: width || config.width,\n top: coordinate?.top,\n left: coordinate?.left,\n display: config?.state === 'visible' ? 'block' : 'none',\n transition: `all ${ANIMATION_DURATION}ms ease-in`,\n zIndex: 50,\n ...props.style\n }}\n className={classes}\n >\n {\n open && (\n <Card className={`${prefix}-menu__card`}>\n <CardContent\n className={`${prefix}-menu__card__content`}\n sx={{ py: 1 }}\n style={{ display: 'flex', flexDirection: 'column', maxHeight }}\n >\n {renderChildren()}\n </CardContent>\n </Card>\n )\n }\n </div>\n {open && <div className={`${prefix}-menu__overlay`} onClick={handleClose} />}\n </>\n );\n});\n\nexport default createComponent(Menu);\n","import { useState } from 'react';\n\ntype UseMenu = [\n boolean,\n HTMLElement | null,\n (event?: React.MouseEvent<HTMLButtonElement>) => void,\n];\n\nexport default function useMenu(): UseMenu {\n const [anchorEl, setAnchorEl] = useState<null | HTMLElement>(null);\n\n const open = Boolean(anchorEl);\n\n const handleOpen = (event?: React.MouseEvent<HTMLElement, MouseEvent>) => {\n setAnchorEl(event ? event.currentTarget : null);\n };\n\n const handleClose = () => { setAnchorEl(null); };\n\n const handleToggle = (event?: React.MouseEvent<HTMLElement, MouseEvent>) => {\n if (open) {\n handleClose();\n return;\n }\n\n handleOpen(event);\n };\n\n return [open, anchorEl, handleToggle];\n}\n"],"names":["Debounce","func","milliseconds","debounce","Menu","forwardRef","open","width","children","anchorEl","direction","maxHeight","autoClose","onClose","props","ref","coordinate","setCoordinate","useState","config","setConfig","GAP","ANIMATION_DURATION","arrayChildren","Children","id","useMemo","uuid","classes","joinClass","prefix","useListenerResized","changePosition","useEffect","handleOpen","handleClose","coordinates","offsetWidth","offsetHeight","offsetLeft","offsetTop","prev","top","el","renderChildren","child","index","cloneElement","e","jsxs","Fragment","jsx","Card","CardContent","createComponent","useMenu","setAnchorEl","event"],"mappings":"kVAAA,MAAMA,CAAS,CAEN,MAAMC,EAAyBC,EAAe,IAAK,CACxD,GAAI,CAACA,EAAc,CACjBD,EAAA,EACA,MACF,CAEA,aAAa,KAAK,OAAO,EACzB,KAAK,QAAU,WAAW,IAAM,CAAEA,EAAA,CAAQ,EAAGC,CAAY,CAC3D,CACF,CAEO,MAAMC,EAAW,IAAIH,EC8BtBI,EAAOC,EAAAA,WAAsC,SAAc,CAC/D,KAAAC,EACA,MAAAC,EACA,SAAAC,EACA,SAAAC,EACA,UAAAC,EAAY,OACZ,UAAAC,EACA,UA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CAAA,CAAa,CAAA,EAC5E,CAEJ,CAAC,EAED/B,EAAekD,EAAAA,gBAAgBlD,CAAI,ECjKnC,SAAwBmD,GAAmB,CACzC,KAAM,CAAC9C,EAAU+C,CAAW,EAAItC,EAAAA,SAA6B,IAAI,EAE3DZ,EAAO,EAAQG,EAEfyB,EAAcuB,GAAsD,CACxED,EAAYC,EAAQA,EAAM,cAAgB,IAAI,CAChD,EAEMtB,EAAc,IAAM,CAAEqB,EAAY,IAAI,CAAG,EAW/C,MAAO,CAAClD,EAAMG,EATQgD,GAAsD,CAC1E,GAAInD,EAAM,CACR6B,EAAA,EACA,MACF,CAEAD,EAAWuB,CAAK,CAClB,CAEoC,CACtC"}
1
+ {"version":3,"file":"useMenu-DewYBiar.cjs","sources":["../../../../toolkit/src/debounce/debounce.ts","../../src/navigation/Menu/Menu.tsx","../../src/navigation/Menu/useMenu.ts"],"sourcesContent":["class Debounce {\n private timeout: NodeJS.Timeout | undefined;\n public delay(func: (a?: any) => void, milliseconds = 500) {\n if (!milliseconds) {\n func();\n return;\n }\n\n clearTimeout(this.timeout);\n this.timeout = setTimeout(() => { func(); }, milliseconds);\n }\n}\n\nexport const debounce = new Debounce();\n","import {\n useMemo,\n useState,\n useEffect,\n Children,\n forwardRef,\n type ReactElement,\n type CSSProperties,\n type HTMLAttributes,\n cloneElement\n} from 'react';\n\nimport { prefix } from '@iziui/tokens/web/js';\n\nimport { joinClass } from '@iziui/core/utils';\n\nimport { uuid } from '@iziui/toolkit/uuid';\nimport { debounce } from '@iziui/toolkit/debounce';\n\nimport useListenerResized from '@/hooks/useListenerResized';\nimport { Card, CardContent } from '@/display/Card';\n\nimport createComponent from '../../core/createComponent';\n\nimport '@iziui/styles/components/Menu.scss';\n\ntype Direction = 'left' | 'right' | 'center';\ntype AnimationClass = 'open' | 'close';\ntype State = 'visible' | 'invisible';\ntype Coordinates = { top?: number; right?: number; bottom?: number; left?: number; };\ntype Config = { animation: AnimationClass, state: State; width: CSSProperties['width'] };\n\nexport interface MenuProps extends HTMLAttributes<HTMLDivElement> {\n open: boolean;\n autoClose?: boolean;\n maxHeight?: CSSProperties['maxHeight'];\n direction?: Direction;\n anchorEl: HTMLElement | null;\n width?: CSSProperties['width'];\n children: React.JSX.Element | React.JSX.Element[];\n onClose: (e?: React.MouseEvent<HTMLButtonElement>) => void;\n}\n\nconst Menu = forwardRef<HTMLDivElement, MenuProps>(function Menu({\n open,\n width,\n children,\n anchorEl,\n direction = 'left',\n maxHeight,\n autoClose,\n onClose,\n ...props\n}: MenuProps, ref) {\n const [coordinate, setCoordinate] = useState<Coordinates>();\n const [config, setConfig] = useState<Config>({ state: 'invisible', animation: 'close', width: 'auto' });\n\n const GAP = 16;\n const ANIMATION_DURATION = 150;\n\n const arrayChildren = Children.toArray(children) as ReactElement<any>[];\n\n const id = useMemo(() => uuid(), []);\n\n const classes = joinClass(\n `${prefix}-menu`,\n `${prefix}-menu--${config?.animation}`,\n props.className\n );\n\n useListenerResized(() => changePosition(), [anchorEl]);\n\n useEffect(() => { changePosition(); }, [anchorEl]);\n\n // eslint-disable-next-line @typescript-eslint/no-unused-expressions\n useEffect(() => { open ? handleOpen() : handleClose(); }, [open]);\n\n const changePosition = () => {\n if (!anchorEl) { return; }\n\n setTimeout(() => {\n let coordinates: Coordinates = {};\n\n const { offsetWidth, offsetHeight, offsetLeft, offsetTop } = anchorEl;\n\n setConfig(prev => ({ ...prev, width: offsetWidth }));\n\n const top = offsetTop + offsetHeight + (GAP / 2);\n\n const el = document.getElementById(id) as HTMLElement;\n\n if (direction === 'center') { coordinates = { top, right: offsetWidth }; }\n\n if (direction === 'left') { coordinates = { top, left: offsetLeft }; }\n\n if (direction === 'right') { coordinates = { top, left: offsetLeft - (el.offsetWidth - offsetWidth) }; }\n\n setCoordinate(coordinates);\n }, 0);\n };\n\n const handleOpen = () => {\n setConfig(prev => ({ ...prev, state: 'visible' }));\n\n setTimeout(() => { setConfig(prev => ({ ...prev, animation: 'open' })); }, 10);\n };\n\n const handleClose = () => {\n setConfig(prev => ({ ...prev, animation: 'close' }));\n\n setTimeout(() => {\n setConfig(prev => ({ ...prev, state: 'invisible' }));\n onClose();\n }, ANIMATION_DURATION);\n };\n\n const renderChildren = () => {\n return arrayChildren.map((child, index) => {\n return cloneElement(child, {\n 'tabIndex': index + 1,\n key: `button-${index}`,\n onClick: (e: React.MouseEvent<HTMLButtonElement>) => {\n debounce.delay(() => {\n\n if (autoClose) { handleClose(); }\n\n if (child.props.onClick) { child.props.onClick(e); }\n }, 0);\n },\n });\n });\n };\n\n return (\n <>\n <div\n id={id}\n ref={ref}\n {...props}\n style={{\n width: width || config.width,\n top: coordinate?.top,\n left: coordinate?.left,\n display: config?.state === 'visible' ? 'block' : 'none',\n transition: `all ${ANIMATION_DURATION}ms ease-in`,\n zIndex: 50,\n ...props.style\n }}\n className={classes}\n >\n {\n open && (\n <Card className={`${prefix}-menu__card`}>\n <CardContent\n className={`${prefix}-menu__card__content`}\n sx={{ py: 1 }}\n style={{ display: 'flex', flexDirection: 'column', maxHeight }}\n >\n {renderChildren()}\n </CardContent>\n </Card>\n )\n }\n </div>\n {open && <div className={`${prefix}-menu__overlay`} onClick={handleClose} />}\n </>\n );\n});\n\nexport default createComponent(Menu);\n","import { useState } from 'react';\n\ntype UseMenu = [\n boolean,\n HTMLElement | null,\n (event?: React.MouseEvent<HTMLButtonElement>) => void,\n];\n\nexport default function useMenu(): UseMenu {\n const [anchorEl, setAnchorEl] = useState<null | HTMLElement>(null);\n\n const open = Boolean(anchorEl);\n\n const handleOpen = (event?: React.MouseEvent<HTMLElement, MouseEvent>) => {\n setAnchorEl(event ? event.currentTarget : null);\n };\n\n const handleClose = () => { setAnchorEl(null); };\n\n const handleToggle = (event?: React.MouseEvent<HTMLElement, MouseEvent>) => {\n if (open) {\n handleClose();\n return;\n }\n\n handleOpen(event);\n };\n\n return [open, anchorEl, handleToggle];\n}\n"],"names":["Debounce","func","milliseconds","debounce","Menu","forwardRef","open","width","children","anchorEl","direction","maxHeight","autoClose","onClose","props","ref","coordinate","setCoordinate","useState","config","setConfig","GAP","ANIMATION_DURATION","arrayChildren","Children","id","useMemo","uuid","classes","joinClass","prefix","useListenerResized","changePosition","useEffect","handleOpen","handleClose","coordinates","offsetWidth","offsetHeight","offsetLeft","offsetTop","prev","top","el","renderChildren","child","index","cloneElement","e","jsxs","Fragment","jsx","Card","CardContent","createComponent","useMenu","setAnchorEl","event"],"mappings":"iTAAA,MAAMA,CAAS,CAEN,MAAMC,EAAyBC,EAAe,IAAK,CACxD,GAAI,CAACA,EAAc,CACjBD,EAAA,EACA,MACF,CAEA,aAAa,KAAK,OAAO,EACzB,KAAK,QAAU,WAAW,IAAM,CAAEA,EAAA,CAAQ,EAAGC,CAAY,CAC3D,CACF,CAEO,MAAMC,EAAW,IAAIH,EC8BtBI,EAAOC,EAAAA,WAAsC,SAAc,CAC/D,KAAAC,EACA,MAAAC,EACA,SAAAC,EACA,SAAAC,EACA,UAAAC,EAAY,OACZ,UAAAC,EACA,UAAAC,EACA,QAAAC,EACA,GAAGC,CACL,EAAcC,EAAK,CACjB,KAAM,CAACC,EAAYC,CAAa,EAAIC,WAAA,EAC9B,CAACC,EAAQC,CAAS,EAAIF,EAAAA,SAAiB,CAAE,MAAO,YAAa,UAAW,QAAS,MAAO,MAAA,CAAQ,EAEhGG,EAAM,GACNC,EAAqB,IAErBC,EAAgBC,EAAAA,SAAS,QAAQhB,CAAQ,EAEzCiB,EAAKC,EAAAA,QAAQ,IAAMC,EAAAA,KAAA,EAAQ,CAAA,CAAE,EAE7BC,EAAUC,EAAAA,UACd,GAAGC,EAAAA,MAAM,QACT,GAAGA,EAAAA,MAAM,UAAUX,GAAQ,SAAS,GACpCL,EAAM,SAAA,EAGRiB,EAAAA,mBAAmB,IAAMC,IAAkB,CAACvB,CAAQ,CAAC,EAErDwB,EAAAA,UAAU,IAAM,CAAED,EAAA,CAAkB,EAAG,CAACvB,CAAQ,CAAC,EAGjDwB,EAAAA,UAAU,IAAM,CAA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A,KAAAC,WAAA,CACE,SAAA,CAAAC,EAAAA,IAAC,MAAA,CACC,GAAA1B,EACA,IAAAV,EACC,GAAGD,EACJ,MAAO,CACL,MAAOP,GAASY,EAAO,MACvB,IAAKH,GAAY,IACjB,KAAMA,GAAY,KAClB,QAASG,GAAQ,QAAU,UAAY,QAAU,OACjD,WAAY,OAAOG,CAAkB,aACrC,OAAQ,GACR,GAAGR,EAAM,KAAA,EAEX,UAAWc,EAGT,YACEuB,MAACC,EAAAA,KAAA,CAAK,UAAW,GAAGtB,QAAM,cACxB,SAAAqB,EAAAA,IAACE,EAAAA,YAAA,CACC,UAAW,GAAGvB,EAAAA,MAAM,uBACpB,GAAI,CAAE,GAAI,CAAA,EACV,MAAO,CAAE,QAAS,OAAQ,cAAe,SAAU,UAAAnB,CAAA,EAElD,SAAAiC,EAAA,CAAe,CAAA,CAClB,CACF,CAAA,CAAA,EAILtC,SAAS,MAAA,CAAI,UAAW,GAAGwB,EAAAA,MAAM,iBAAkB,QAASK,CAAA,CAAa,CAAA,EAC5E,CAEJ,CAAC,EAED/B,EAAekD,EAAAA,gBAAgBlD,CAAI,ECjKnC,SAAwBmD,GAAmB,CACzC,KAAM,CAAC9C,EAAU+C,CAAW,EAAItC,EAAAA,SAA6B,IAAI,EAE3DZ,EAAO,EAAQG,EAEfyB,EAAcuB,GAAsD,CACxED,EAAYC,EAAQA,EAAM,cAAgB,IAAI,CAChD,EAEMtB,EAAc,IAAM,CAAEqB,EAAY,IAAI,CAAG,EAW/C,MAAO,CAAClD,EAAMG,EATQgD,GAAsD,CAC1E,GAAInD,EAAM,CACR6B,EAAA,EACA,MACF,CAEAD,EAAWuB,CAAK,CAClB,CAEoC,CACtC"}
@@ -0,0 +1,2 @@
1
+ import{jsxs as B,Fragment as E,jsx as m}from"react/jsx-runtime";import{forwardRef as L,useState as g,Children as P,useMemo as W,useEffect as x,cloneElement as F}from"react";import{p as r}from"./index-CZ41y9Hn.js";import{j as G}from"./joinClass-anSpaauN.js";import{c as H,u as S}from"./createComponent-CovqNaAJ.js";import{u as U}from"./useListenerResized-Bnqxrt7k.js";import{C as q}from"./Card-D_RFnUk2.js";import{C as J}from"./CardContent-BsSfxSQH.js";class K{delay(t,n=500){if(!n){t();return}clearTimeout(this.timeout),this.timeout=setTimeout(()=>{t()},n)}}const Q=new K,V=L(function({open:t,width:n,children:u,anchorEl:o,direction:c="left",maxHeight:s,autoClose:N,onClose:M,...f},k){const[y,v]=g(),[d,a]=g({state:"invisible",animation:"close",width:"auto"}),w=16,T=150,A=P.toArray(u),b=W(()=>S(),[]),I=G(`${r}-menu`,`${r}-menu--${d?.animation}`,f.className);U(()=>_(),[o]),x(()=>{_()},[o]),x(()=>{t?j():h()},[t]);const _=()=>{o&&setTimeout(()=>{let e={};const{offsetWidth:i,offsetHeight:p,offsetLeft:$,offsetTop:D}=o;a(z=>({...z,width:i}));const C=D+p+w/2,R=document.getElementById(b);c==="center"&&(e={top:C,right:i}),c==="left"&&(e={top:C,left:$}),c==="right"&&(e={top:C,left:$-(R.offsetWidth-i)}),v(e)},0)},j=()=>{a(e=>({...e,state:"visible"})),setTimeout(()=>{a(e=>({...e,animation:"open"}))},10)},h=()=>{a(e=>({...e,animation:"close"})),setTimeout(()=>{a(e=>({...e,state:"invisible"})),M()},T)},O=()=>A.map((e,i)=>F(e,{tabIndex:i+1,key:`button-${i}`,onClick:p=>{Q.delay(()=>{N&&h(),e.props.onClick&&e.props.onClick(p)},0)}}));return B(E,{children:[m("div",{id:b,ref:k,...f,style:{width:n||d.width,top:y?.top,left:y?.left,display:d?.state==="visible"?"block":"none",transition:`all ${T}ms ease-in`,zIndex:50,...f.style},className:I,children:t&&m(q,{className:`${r}-menu__card`,children:m(J,{className:`${r}-menu__card__content`,sx:{py:1},style:{display:"flex",flexDirection:"column",maxHeight:s},children:O()})})}),t&&m("div",{className:`${r}-menu__overlay`,onClick:h})]})}),ie=H(V);function ae(){const[l,t]=g(null),n=!!l,u=s=>{t(s?s.currentTarget:null)},o=()=>{t(null)};return[n,l,s=>{if(n){o();return}u(s)}]}export{ie as M,ae as u};
2
+ //# sourceMappingURL=useMenu-DuX7EGHi.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useMenu-DU5PYJUH.js","sources":["../../../../toolkit/src/debounce/debounce.ts","../../src/navigation/Menu/Menu.tsx","../../src/navigation/Menu/useMenu.ts"],"sourcesContent":["class Debounce {\n private timeout: NodeJS.Timeout | undefined;\n public delay(func: (a?: any) => void, milliseconds = 500) {\n if (!milliseconds) {\n func();\n return;\n }\n\n clearTimeout(this.timeout);\n this.timeout = setTimeout(() => { func(); }, milliseconds);\n }\n}\n\nexport const debounce = new Debounce();\n","import {\n useMemo,\n useState,\n useEffect,\n Children,\n forwardRef,\n type ReactElement,\n type CSSProperties,\n type HTMLAttributes,\n cloneElement\n} from 'react';\n\nimport { prefix } from '@iziui/tokens/web/js';\n\nimport { joinClass } from '@iziui/core/utils';\n\nimport { uuid } from '@iziui/toolkit/uuid';\nimport { debounce } from '@iziui/toolkit/debounce';\n\nimport useListenerResized from '@/hooks/useListenerResized';\nimport { Card, CardContent } from '@/display/Card';\n\nimport createComponent from '../../core/createComponent';\n\nimport '@iziui/styles/components/Menu.scss';\n\ntype Direction = 'left' | 'right' | 'center';\ntype AnimationClass = 'open' | 'close';\ntype State = 'visible' | 'invisible';\ntype Coordinates = { top?: number; right?: number; bottom?: number; left?: number; };\ntype Config = { animation: AnimationClass, state: State; width: CSSProperties['width'] };\n\nexport interface MenuProps extends HTMLAttributes<HTMLDivElement> {\n open: boolean;\n autoClose?: boolean;\n maxHeight?: CSSProperties['maxHeight'];\n direction?: Direction;\n anchorEl: HTMLElement | null;\n width?: CSSProperties['width'];\n children: React.JSX.Element | React.JSX.Element[];\n onClose: (e?: React.MouseEvent<HTMLButtonElement>) => void;\n}\n\nconst Menu = forwardRef<HTMLDivElement, MenuProps>(function Menu({\n open,\n width,\n children,\n anchorEl,\n direction = 'left',\n maxHeight,\n autoClose,\n onClose,\n ...props\n}: MenuProps, ref) {\n const [coordinate, setCoordinate] = useState<Coordinates>();\n const [config, setConfig] = useState<Config>({ state: 'invisible', animation: 'close', width: 'auto' });\n\n const GAP = 16;\n const ANIMATION_DURATION = 150;\n\n const arrayChildren = Children.toArray(children) as ReactElement<any>[];\n\n const id = useMemo(() => uuid(), []);\n\n const classes = joinClass(\n `${prefix}-menu`,\n `${prefix}-menu--${config?.animation}`,\n props.className\n );\n\n useListenerResized(() => changePosition(), [anchorEl]);\n\n useEffect(() => { changePosition(); }, [anchorEl]);\n\n // eslint-disable-next-line @typescript-eslint/no-unused-expressions\n useEffect(() => { open ? handleOpen() : handleClose(); }, [open]);\n\n const changePosition = () => {\n if (!anchorEl) { return; }\n\n setTimeout(() => {\n let coordinates: Coordinates = {};\n\n const { offsetWidth, offsetHeight, offsetLeft, offsetTop } = anchorEl;\n\n setConfig(prev => ({ ...prev, width: offsetWidth }));\n\n const top = offsetTop + offsetHeight + (GAP / 2);\n\n const el = document.getElementById(id) as HTMLElement;\n\n if (direction === 'center') { coordinates = { top, right: offsetWidth }; }\n\n if (direction === 'left') { coordinates = { top, left: offsetLeft }; }\n\n if (direction === 'right') { coordinates = { top, left: offsetLeft - (el.offsetWidth - offsetWidth) }; }\n\n setCoordinate(coordinates);\n }, 0);\n };\n\n const handleOpen = () => {\n setConfig(prev => ({ ...prev, state: 'visible' }));\n\n setTimeout(() => { setConfig(prev => ({ ...prev, animation: 'open' })); }, 10);\n };\n\n const handleClose = () => {\n setConfig(prev => ({ ...prev, animation: 'close' }));\n\n setTimeout(() => {\n setConfig(prev => ({ ...prev, state: 'invisible' }));\n onClose();\n }, ANIMATION_DURATION);\n };\n\n const renderChildren = () => {\n return arrayChildren.map((child, index) => {\n return cloneElement(child, {\n 'tabIndex': index + 1,\n key: `button-${index}`,\n onClick: (e: React.MouseEvent<HTMLButtonElement>) => {\n debounce.delay(() => {\n\n if (autoClose) { handleClose(); }\n\n if (child.props.onClick) { child.props.onClick(e); }\n }, 0);\n },\n });\n });\n };\n\n return (\n <>\n <div\n id={id}\n ref={ref}\n {...props}\n style={{\n width: width || config.width,\n top: coordinate?.top,\n left: coordinate?.left,\n display: config?.state === 'visible' ? 'block' : 'none',\n transition: `all ${ANIMATION_DURATION}ms ease-in`,\n zIndex: 50,\n ...props.style\n }}\n className={classes}\n >\n {\n open && (\n <Card className={`${prefix}-menu__card`}>\n <CardContent\n className={`${prefix}-menu__card__content`}\n sx={{ py: 1 }}\n style={{ display: 'flex', flexDirection: 'column', maxHeight }}\n >\n {renderChildren()}\n </CardContent>\n </Card>\n )\n }\n </div>\n {open && <div className={`${prefix}-menu__overlay`} onClick={handleClose} />}\n </>\n );\n});\n\nexport default createComponent(Menu);\n","import { useState } from 'react';\n\ntype UseMenu = [\n boolean,\n HTMLElement | null,\n (event?: React.MouseEvent<HTMLButtonElement>) => void,\n];\n\nexport default function useMenu(): UseMenu {\n const [anchorEl, setAnchorEl] = useState<null | HTMLElement>(null);\n\n const open = Boolean(anchorEl);\n\n const handleOpen = (event?: React.MouseEvent<HTMLElement, MouseEvent>) => {\n setAnchorEl(event ? event.currentTarget : null);\n };\n\n const handleClose = () => { setAnchorEl(null); };\n\n const handleToggle = (event?: React.MouseEvent<HTMLElement, MouseEvent>) => {\n if (open) {\n handleClose();\n return;\n }\n\n handleOpen(event);\n };\n\n return [open, anchorEl, handleToggle];\n}\n"],"names":["Debounce","func","milliseconds","debounce","Menu","forwardRef","open","width","children","anchorEl","direction","maxHeight","autoClose","onClose","props","ref","coordinate","setCoordinate","useState","config","setConfig","GAP","ANIMATION_DURATION","arrayChildren","Children","id","useMemo","uuid","classes","joinClass","prefix","useListenerResized","changePosition","useEffect","handleOpen","handleClose","coordinates","offsetWidth","offsetHeight","offsetLeft","offsetTop","prev","top","el","renderChildren","child","index","cloneElement","e","jsxs","Fragment","jsx","Card","CardContent","Menu$1","createComponent","useMenu","setAnchorEl","event"],"mappings":"oeAAA,MAAMA,CAAS,CAEN,MAAMC,EAAyBC,EAAe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,MAAO,CAAE,QAAS,OAAQ,cAAe,SAAU,UAAAnB,CAAA,EAElD,SAAAiC,EAAA,CAAe,CAAA,CAClB,CACF,CAAA,CAAA,EAILtC,KAAS,MAAA,CAAI,UAAW,GAAGwB,CAAM,iBAAkB,QAASK,CAAA,CAAa,CAAA,EAC5E,CAEJ,CAAC,EAEDmB,GAAeC,EAAgBnD,CAAI,ECjKnC,SAAwBoD,IAAmB,CACzC,KAAM,CAAC/C,EAAUgD,CAAW,EAAIvC,EAA6B,IAAI,EAE3DZ,EAAO,EAAQG,EAEfyB,EAAcwB,GAAsD,CACxED,EAAYC,EAAQA,EAAM,cAAgB,IAAI,CAChD,EAEMvB,EAAc,IAAM,CAAEsB,EAAY,IAAI,CAAG,EAW/C,MAAO,CAACnD,EAAMG,EATQiD,GAAsD,CAC1E,GAAIpD,EAAM,CACR6B,EAAA,EACA,MACF,CAEAD,EAAWwB,CAAK,CAClB,CAEoC,CACtC"}
1
+ {"version":3,"file":"useMenu-DuX7EGHi.js","sources":["../../../../toolkit/src/debounce/debounce.ts","../../src/navigation/Menu/Menu.tsx","../../src/navigation/Menu/useMenu.ts"],"sourcesContent":["class Debounce {\n private timeout: NodeJS.Timeout | undefined;\n public delay(func: (a?: any) => void, milliseconds = 500) {\n if (!milliseconds) {\n func();\n return;\n }\n\n clearTimeout(this.timeout);\n this.timeout = setTimeout(() => { func(); }, milliseconds);\n }\n}\n\nexport const debounce = new Debounce();\n","import {\n useMemo,\n useState,\n useEffect,\n Children,\n forwardRef,\n type ReactElement,\n type CSSProperties,\n type HTMLAttributes,\n cloneElement\n} from 'react';\n\nimport { prefix } from '@iziui/tokens/web/js';\n\nimport { joinClass } from '@iziui/core/utils';\n\nimport { uuid } from '@iziui/toolkit/uuid';\nimport { debounce } from '@iziui/toolkit/debounce';\n\nimport useListenerResized from '@/hooks/useListenerResized';\nimport { Card, CardContent } from '@/display/Card';\n\nimport createComponent from '../../core/createComponent';\n\nimport '@iziui/styles/components/Menu.scss';\n\ntype Direction = 'left' | 'right' | 'center';\ntype AnimationClass = 'open' | 'close';\ntype State = 'visible' | 'invisible';\ntype Coordinates = { top?: number; right?: number; bottom?: number; left?: number; };\ntype Config = { animation: AnimationClass, state: State; width: CSSProperties['width'] };\n\nexport interface MenuProps extends HTMLAttributes<HTMLDivElement> {\n open: boolean;\n autoClose?: boolean;\n maxHeight?: CSSProperties['maxHeight'];\n direction?: Direction;\n anchorEl: HTMLElement | null;\n width?: CSSProperties['width'];\n children: React.JSX.Element | React.JSX.Element[];\n onClose: (e?: React.MouseEvent<HTMLButtonElement>) => void;\n}\n\nconst Menu = forwardRef<HTMLDivElement, MenuProps>(function Menu({\n open,\n width,\n children,\n anchorEl,\n direction = 'left',\n maxHeight,\n autoClose,\n onClose,\n ...props\n}: MenuProps, ref) {\n const [coordinate, setCoordinate] = useState<Coordinates>();\n const [config, setConfig] = useState<Config>({ state: 'invisible', animation: 'close', width: 'auto' });\n\n const GAP = 16;\n const ANIMATION_DURATION = 150;\n\n const arrayChildren = Children.toArray(children) as ReactElement<any>[];\n\n const id = useMemo(() => uuid(), []);\n\n const classes = joinClass(\n `${prefix}-menu`,\n `${prefix}-menu--${config?.animation}`,\n props.className\n );\n\n useListenerResized(() => changePosition(), [anchorEl]);\n\n useEffect(() => { changePosition(); }, [anchorEl]);\n\n // eslint-disable-next-line @typescript-eslint/no-unused-expressions\n useEffect(() => { open ? handleOpen() : handleClose(); }, [open]);\n\n const changePosition = () => {\n if (!anchorEl) { return; }\n\n setTimeout(() => {\n let coordinates: Coordinates = {};\n\n const { offsetWidth, offsetHeight, offsetLeft, offsetTop } = anchorEl;\n\n setConfig(prev => ({ ...prev, width: offsetWidth }));\n\n const top = offsetTop + offsetHeight + (GAP / 2);\n\n const el = document.getElementById(id) as HTMLElement;\n\n if (direction === 'center') { coordinates = { top, right: offsetWidth }; }\n\n if (direction === 'left') { coordinates = { top, left: offsetLeft }; }\n\n if (direction === 'right') { coordinates = { top, left: offsetLeft - (el.offsetWidth - offsetWidth) }; }\n\n setCoordinate(coordinates);\n }, 0);\n };\n\n const handleOpen = () => {\n setConfig(prev => ({ ...prev, state: 'visible' }));\n\n setTimeout(() => { setConfig(prev => ({ ...prev, animation: 'open' })); }, 10);\n };\n\n const handleClose = () => {\n setConfig(prev => ({ ...prev, animation: 'close' }));\n\n setTimeout(() => {\n setConfig(prev => ({ ...prev, state: 'invisible' }));\n onClose();\n }, ANIMATION_DURATION);\n };\n\n const renderChildren = () => {\n return arrayChildren.map((child, index) => {\n return cloneElement(child, {\n 'tabIndex': index + 1,\n key: `button-${index}`,\n onClick: (e: React.MouseEvent<HTMLButtonElement>) => {\n debounce.delay(() => {\n\n if (autoClose) { handleClose(); }\n\n if (child.props.onClick) { child.props.onClick(e); }\n }, 0);\n },\n });\n });\n };\n\n return (\n <>\n <div\n id={id}\n ref={ref}\n {...props}\n style={{\n width: width || config.width,\n top: coordinate?.top,\n left: coordinate?.left,\n display: config?.state === 'visible' ? 'block' : 'none',\n transition: `all ${ANIMATION_DURATION}ms ease-in`,\n zIndex: 50,\n ...props.style\n }}\n className={classes}\n >\n {\n open && (\n <Card className={`${prefix}-menu__card`}>\n <CardContent\n className={`${prefix}-menu__card__content`}\n sx={{ py: 1 }}\n style={{ display: 'flex', flexDirection: 'column', maxHeight }}\n >\n {renderChildren()}\n </CardContent>\n </Card>\n )\n }\n </div>\n {open && <div className={`${prefix}-menu__overlay`} onClick={handleClose} />}\n </>\n );\n});\n\nexport default createComponent(Menu);\n","import { useState } from 'react';\n\ntype UseMenu = [\n boolean,\n HTMLElement | null,\n (event?: React.MouseEvent<HTMLButtonElement>) => void,\n];\n\nexport default function useMenu(): UseMenu {\n const [anchorEl, setAnchorEl] = useState<null | HTMLElement>(null);\n\n const open = Boolean(anchorEl);\n\n const handleOpen = (event?: React.MouseEvent<HTMLElement, MouseEvent>) => {\n setAnchorEl(event ? event.currentTarget : null);\n };\n\n const handleClose = () => { setAnchorEl(null); };\n\n const handleToggle = (event?: React.MouseEvent<HTMLElement, MouseEvent>) => {\n if (open) {\n handleClose();\n return;\n }\n\n handleOpen(event);\n };\n\n return [open, anchorEl, handleToggle];\n}\n"],"names":["Debounce","func","milliseconds","debounce","Menu","forwardRef","open","width","children","anchorEl","direction","maxHeight","autoClose","onClose","props","ref","coordinate","setCoordinate","useState","config","setConfig","GAP","ANIMATION_DURATION","arrayChildren","Children","id","useMemo","uuid","classes","joinClass","prefix","useListenerResized","changePosition","useEffect","handleOpen","handleClose","coordinates","offsetWidth","offsetHeight","offsetLeft","offsetTop","prev","top","el","renderChildren","child","index","cloneElement","e","jsxs","Fragment","jsx","Card","CardContent","Menu$1","createComponent","useMenu","setAnchorEl","event"],"mappings":"ocAAA,MAAMA,CAAS,CAEN,MAAMC,EAAyBC,EAAe,IAAK,CACxD,GAAI,CAACA,EAAc,CACjBD,EAAA,EACA,MACF,CAEA,aAAa,KAAK,OAAO,EACzB,KAAK,QAAU,WAAW,IAAM,CAAEA,EAAA,CAAQ,EAAGC,CAAY,CAC3D,CACF,CAEO,MAAMC,EAAW,IAAIH,EC8BtBI,EAAOC,EAAsC,SAAc,CAC/D,KAAAC,EACA,MAAAC,EACA,SAAAC,EACA,SAAAC,EACA,UAAAC,EAAY,OACZ,UAAAC,EACA,UAAAC,EACA,QAAAC,EACA,GAAGC,CACL,EAAcC,EAAK,CACjB,KAAM,CAACC,EAAYC,CAAa,EAAIC,EAAA,EAC9B,CAACC,EAAQC,CAAS,EAAIF,EAAiB,CAAE,MAAO,YAAa,UAAW,QAAS,MAAO,MAAA,CAAQ,EAEhGG,EAAM,GACNC,EAAqB,IAErBC,EAAgBC,EAAS,QAAQhB,CAAQ,EAEzCiB,EAAKC,EAAQ,IAAMC,EAAA,EAAQ,CAAA,CAAE,EAE7BC,EAAUC,EACd,GAAGC,CAAM,QACT,GAAGA,CAAM,UAAUX,GAAQ,SAAS,GACpCL,EAAM,SAAA,EAGRiB,EAAmB,IAAMC,IAAkB,CAACvB,CAAQ,CAAC,EAErDwB,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,MAAM,QAAQG,CAAC,CAClD,EAAG,CAAC,CACN,CAAA,CACD,CACF,EAGH,OACEC,EAAAC,EAAA,CACE,SAAA,CAAAC,EAAC,MAAA,CACC,GAAA1B,EACA,IAAAV,EACC,GAAGD,EACJ,MAAO,CACL,MAAOP,GAASY,EAAO,MACvB,IAAKH,GAAY,IACjB,KAAMA,GAAY,KAClB,QAASG,GAAQ,QAAU,UAAY,QAAU,OACjD,WAAY,OAAOG,CAAkB,aACrC,OAAQ,GACR,GAAGR,EAAM,KAAA,EAEX,UAAWc,EAGT,YACEuB,EAACC,EAAA,CAAK,UAAW,GAAGtB,CAAM,cACxB,SAAAqB,EAACE,EAAA,CACC,UAAW,GAAGvB,CAAM,uBACpB,GAAI,CAAE,GAAI,CAAA,EACV,MAAO,CAAE,QAAS,OAAQ,cAAe,SAAU,UAAAnB,CAAA,EAElD,SAAAiC,EAAA,CAAe,CAAA,CAClB,CACF,CAAA,CAAA,EAILtC,KAAS,MAAA,CAAI,UAAW,GAAGwB,CAAM,iBAAkB,QAASK,CAAA,CAAa,CAAA,EAC5E,CAEJ,CAAC,EAEDmB,GAAeC,EAAgBnD,CAAI,ECjKnC,SAAwBoD,IAAmB,CACzC,KAAM,CAAC/C,EAAUgD,CAAW,EAAIvC,EAA6B,IAAI,EAE3DZ,EAAO,EAAQG,EAEfyB,EAAcwB,GAAsD,CACxED,EAAYC,EAAQA,EAAM,cAAgB,IAAI,CAChD,EAEMvB,EAAc,IAAM,CAAEsB,EAAY,IAAI,CAAG,EAW/C,MAAO,CAACnD,EAAMG,EATQiD,GAAsD,CAC1E,GAAIpD,EAAM,CACR6B,EAAA,EACA,MACF,CAEAD,EAAWwB,CAAK,CAClB,CAEoC,CACtC"}
@@ -0,0 +1,2 @@
1
+ import{useEffect as l}from"react";import{x as N,l as _,m as d,s as r,a as M}from"./index-CZ41y9Hn.js";const t={MAX_XS:`(max-width: ${Number(M)}px)`,MIN_SM:`(min-width: ${Number(M)+1}px)`,MAX_SM:`(max-width: ${Number(r)}px)`,MIN_MD:`(min-width: ${Number(r)+1}px)`,MAX_MD:`(max-width: ${Number(d)}px)`,MIN_LG:`(min-width: ${Number(d)+1}px)`,MAX_LG:`(max-width: ${Number(_)}px)`,MIN_XL:`(min-width: ${Number(N)}px)`},m={xs:t.MAX_XS,sm:`${t.MIN_SM} and ${t.MAX_SM}`,md:`${t.MIN_MD} and ${t.MAX_MD}`,lg:`${t.MIN_LG} and ${t.MAX_LG}`,xl:t.MIN_XL};function p({onXs:c,onSm:o,onMd:x,onLg:h,onXl:u}){l(()=>{if(typeof window>"u")return;const n={xs:window.matchMedia(m.xs),sm:window.matchMedia(m.sm),md:window.matchMedia(m.md),lg:window.matchMedia(m.lg),xl:window.matchMedia(m.xl)},a={xs:c,sm:o,md:x,lg:h,xl:u},i=()=>{const e=Object.keys(n).find(w=>n[w].matches);e&&a[e]&&a[e]()},s=e=>{e.matches&&i()};return Object.values(n).forEach(e=>{e.addEventListener("change",s)}),i(),()=>{Object.values(n).forEach(e=>{e.removeEventListener("change",s)})}},[])}export{p as u};
2
+ //# sourceMappingURL=useResize-BUftB918.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useResize-BUftB918.js","sources":["../../src/hooks/useResize/useResize.ts"],"sourcesContent":["import { useEffect } from 'react';\n\nimport { xs, sm, md, lg, xl } from '@iziui/tokens/web/js';\n\nexport const DeviceBreakpoints = {\n MAX_XS: `(max-width: ${Number(xs)}px)`,\n MIN_SM: `(min-width: ${Number(xs) + 1}px)`,\n MAX_SM: `(max-width: ${Number(sm)}px)`,\n MIN_MD: `(min-width: ${Number(sm) + 1}px)`,\n MAX_MD: `(max-width: ${Number(md)}px)`,\n MIN_LG: `(min-width: ${Number(md) + 1}px)`,\n MAX_LG: `(max-width: ${Number(lg)}px)`,\n MIN_XL: `(min-width: ${Number(xl)}px)`,\n};\n\ntype Device = 'xs' | 'sm' | 'md' | 'lg' | 'xl';\n\nexport interface Callback {\n onXs?: () => void;\n onSm?: () => void;\n onMd?: () => void;\n onLg?: () => void;\n onXl?: () => void;\n}\n\nconst MEDIAS: Record<Device, string> = {\n xs: DeviceBreakpoints.MAX_XS,\n sm: `${DeviceBreakpoints.MIN_SM} and ${DeviceBreakpoints.MAX_SM}`,\n md: `${DeviceBreakpoints.MIN_MD} and ${DeviceBreakpoints.MAX_MD}`,\n lg: `${DeviceBreakpoints.MIN_LG} and ${DeviceBreakpoints.MAX_LG}`,\n xl: DeviceBreakpoints.MIN_XL,\n};\n\nexport default function useResize({ onXs, onSm, onMd, onLg, onXl }: Callback) {\n useEffect(() => {\n if (typeof window === 'undefined') return;\n\n const medias = {\n xs: window.matchMedia(MEDIAS.xs),\n sm: window.matchMedia(MEDIAS.sm),\n md: window.matchMedia(MEDIAS.md),\n lg: window.matchMedia(MEDIAS.lg),\n xl: window.matchMedia(MEDIAS.xl),\n };\n\n const callbacks: Record<Device, (() => void) | undefined> = {\n xs: onXs,\n sm: onSm,\n md: onMd,\n lg: onLg,\n xl: onXl,\n };\n\n const runCurrentDevice = () => {\n const currentDevice = Object.keys(medias).find(\n (key) => medias[key as Device].matches\n ) as Device | undefined;\n\n if (currentDevice && callbacks[currentDevice]) {\n callbacks[currentDevice]();\n }\n };\n\n const handleChange = (event: MediaQueryListEvent) => {\n if (!event.matches) { return; }\n\n runCurrentDevice();\n };\n\n Object.values(medias).forEach((media) => {\n media.addEventListener('change', handleChange);\n });\n\n runCurrentDevice();\n\n return () => {\n Object.values(medias).forEach((media) => {\n media.removeEventListener('change', handleChange);\n });\n };\n }, []);\n}"],"names":["DeviceBreakpoints","xs","sm","md","lg","xl","MEDIAS","useResize","onXs","onSm","onMd","onLg","onXl","useEffect","medias","callbacks","runCurrentDevice","currentDevice","key","handleChange","event","media"],"mappings":"sGAIO,MAAMA,EAAoB,CAC/B,OAAQ,eAAe,OAAOC,CAAE,CAAC,MACjC,OAAQ,eAAe,OAAOA,CAAE,EAAI,CAAC,MACrC,OAAQ,eAAe,OAAOC,CAAE,CAAC,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,OAAO,OAAOF,CAAM,EAAE,QAASO,GAAU,CACvCA,EAAM,oBAAoB,SAAUF,CAAY,CAClD,CAAC,CACH,CACF,EAAG,CAAA,CAAE,CACP"}
@@ -0,0 +1,2 @@
1
+ "use strict";const o=require("react"),n=require("./index-DYxwT4uW.cjs"),t={MAX_XS:`(max-width: ${Number(n.xs)}px)`,MIN_SM:`(min-width: ${Number(n.xs)+1}px)`,MAX_SM:`(max-width: ${Number(n.sm)}px)`,MIN_MD:`(min-width: ${Number(n.sm)+1}px)`,MAX_MD:`(max-width: ${Number(n.md)}px)`,MIN_LG:`(min-width: ${Number(n.md)+1}px)`,MAX_LG:`(max-width: ${Number(n.lg)}px)`,MIN_XL:`(min-width: ${Number(n.xl)}px)`},i={xs:t.MAX_XS,sm:`${t.MIN_SM} and ${t.MAX_SM}`,md:`${t.MIN_MD} and ${t.MAX_MD}`,lg:`${t.MIN_LG} and ${t.MAX_LG}`,xl:t.MIN_XL};function w({onXs:c,onSm:r,onMd:M,onLg:u,onXl:x}){o.useEffect(()=>{if(typeof window>"u")return;const s={xs:window.matchMedia(i.xs),sm:window.matchMedia(i.sm),md:window.matchMedia(i.md),lg:window.matchMedia(i.lg),xl:window.matchMedia(i.xl)},m={xs:c,sm:r,md:M,lg:u,xl:x},d=()=>{const e=Object.keys(s).find(h=>s[h].matches);e&&m[e]&&m[e]()},a=e=>{e.matches&&d()};return Object.values(s).forEach(e=>{e.addEventListener("change",a)}),d(),()=>{Object.values(s).forEach(e=>{e.removeEventListener("change",a)})}},[])}exports.useResize=w;
2
+ //# sourceMappingURL=useResize-Dnf6Ktrn.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useResize-Dnf6Ktrn.cjs","sources":["../../src/hooks/useResize/useResize.ts"],"sourcesContent":["import { useEffect } from 'react';\n\nimport { xs, sm, md, lg, xl } from '@iziui/tokens/web/js';\n\nexport const DeviceBreakpoints = {\n MAX_XS: `(max-width: ${Number(xs)}px)`,\n MIN_SM: `(min-width: ${Number(xs) + 1}px)`,\n MAX_SM: `(max-width: ${Number(sm)}px)`,\n MIN_MD: `(min-width: ${Number(sm) + 1}px)`,\n MAX_MD: `(max-width: ${Number(md)}px)`,\n MIN_LG: `(min-width: ${Number(md) + 1}px)`,\n MAX_LG: `(max-width: ${Number(lg)}px)`,\n MIN_XL: `(min-width: ${Number(xl)}px)`,\n};\n\ntype Device = 'xs' | 'sm' | 'md' | 'lg' | 'xl';\n\nexport interface Callback {\n onXs?: () => void;\n onSm?: () => void;\n onMd?: () => void;\n onLg?: () => void;\n onXl?: () => void;\n}\n\nconst MEDIAS: Record<Device, string> = {\n xs: DeviceBreakpoints.MAX_XS,\n sm: `${DeviceBreakpoints.MIN_SM} and ${DeviceBreakpoints.MAX_SM}`,\n md: `${DeviceBreakpoints.MIN_MD} and ${DeviceBreakpoints.MAX_MD}`,\n lg: `${DeviceBreakpoints.MIN_LG} and ${DeviceBreakpoints.MAX_LG}`,\n xl: DeviceBreakpoints.MIN_XL,\n};\n\nexport default function useResize({ onXs, onSm, onMd, onLg, onXl }: Callback) {\n useEffect(() => {\n if (typeof window === 'undefined') return;\n\n const medias = {\n xs: window.matchMedia(MEDIAS.xs),\n sm: window.matchMedia(MEDIAS.sm),\n md: window.matchMedia(MEDIAS.md),\n lg: window.matchMedia(MEDIAS.lg),\n xl: window.matchMedia(MEDIAS.xl),\n };\n\n const callbacks: Record<Device, (() => void) | undefined> = {\n xs: onXs,\n sm: onSm,\n md: onMd,\n lg: onLg,\n xl: onXl,\n };\n\n const runCurrentDevice = () => {\n const currentDevice = Object.keys(medias).find(\n (key) => medias[key as Device].matches\n ) as Device | undefined;\n\n if (currentDevice && callbacks[currentDevice]) {\n callbacks[currentDevice]();\n }\n };\n\n const handleChange = (event: MediaQueryListEvent) => {\n if (!event.matches) { return; }\n\n runCurrentDevice();\n };\n\n Object.values(medias).forEach((media) => {\n media.addEventListener('change', handleChange);\n });\n\n runCurrentDevice();\n\n return () => {\n Object.values(medias).forEach((media) => {\n media.removeEventListener('change', handleChange);\n });\n };\n }, []);\n}"],"names":["DeviceBreakpoints","xs","sm","md","lg","xl","MEDIAS","useResize","onXs","onSm","onMd","onLg","onXl","useEffect","medias","callbacks","runCurrentDevice","currentDevice","key","handleChange","event","media"],"mappings":"wEAIaA,EAAoB,CAC/B,OAAQ,eAAe,OAAOC,EAAAA,EAAE,CAAC,MACjC,OAAQ,eAAe,OAAOA,EAAAA,EAAE,EAAI,CAAC,MACrC,OAAQ,eAAe,OAAOC,EAAAA,EAAE,CAAC,MACjC,OAAQ,eAAe,OAAOA,EAAAA,EAAE,EAAI,CAAC,MACrC,OAAQ,eAAe,OAAOC,EAAAA,EAAE,CAAC,MACjC,OAAQ,eAAe,OAAOA,EAAAA,EAAE,EAAI,CAAC,MACrC,OAAQ,eAAe,OAAOC,EAAAA,EAAE,CAAC,MACjC,OAAQ,eAAe,OAAOC,EAAAA,EAAE,CAAC,KACnC,EAYMC,EAAiC,CACrC,GAAIN,EAAkB,OACtB,GAAI,GAAGA,EAAkB,MAAM,QAAQA,EAAkB,MAAM,GAC/D,GAAI,GAAGA,EAAkB,MAAM,QAAQA,EAAkB,MAAM,GAC/D,GAAI,GAAGA,EAAkB,MAAM,QAAQA,EAAkB,MAAM,GAC/D,GAAIA,EAAkB,MACxB,EAEA,SAAwBO,EAAU,CAAE,KAAAC,EAAM,KAAAC,EAAM,KAAAC,EAAM,KAAAC,EAAM,KAAAC,GAAkB,CAC5EC,EAAAA,UAAU,IAAM,CACd,GAAI,OAAO,OAAW,IAAa,OAEnC,MAAMC,EAAS,CACb,GAAI,OAAO,WAAWR,EAAO,EAAE,EAC/B,GAAI,OAAO,WAAWA,EAAO,EAAE,EAC/B,GAAI,OAAO,WAAWA,EAAO,EAAE,EAC/B,GAAI,OAAO,WAAWA,EAAO,EAAE,EAC/B,GAAI,OAAO,WAAWA,EAAO,EAAE,CAAA,EAG3BS,EAAsD,CAC1D,GAAIP,EACJ,GAAIC,EACJ,GAAIC,EACJ,GAAIC,EACJ,GAAIC,CAAA,EAGAI,EAAmB,IAAM,CAC7B,MAAMC,EAAgB,OAAO,KAAKH,CAAM,EAAE,KACvCI,GAAQJ,EAAOI,CAAa,EAAE,OAAA,EAG7BD,GAAiBF,EAAUE,CAAa,GAC1CF,EAAUE,CAAa,EAAA,CAE3B,EAEME,EAAgBC,GAA+B,CAC9CA,EAAM,SAEXJ,EAAA,CACF,EAEA,cAAO,OAAOF,CAAM,EAAE,QAASO,GAAU,CACvCA,EAAM,iBAAiB,SAAUF,CAAY,CAC/C,CAAC,EAEDH,EAAA,EAEO,IAAM,CACX,OAAO,OAAOF,CAAM,EAAE,QAASO,GAAU,CACvCA,EAAM,oBAAoB,SAAUF,CAAY,CAClD,CAAC,CACH,CACF,EAAG,CAAA,CAAE,CACP"}
@@ -1,2 +1,2 @@
1
- import{useState as m,useMemo as y,useEffect as l,createContext as g,useContext as f}from"react";import{jsx as h}from"react/jsx-runtime";import{g as b}from"./generateSupportColors-BN5t8dA-.js";function E(t){return[`${t}.main`,`${t}.dark`,`${t}.light`,`${t}.opacity`,`${t}.contrast`]}function x(t){return t.reduce((e,r)=>{const n=E(r);return e=[...e,...n],e},["text.primary","text.secondary","text.disabled","background.paper","background.default","divider"])}const F=["primary","secondary","error","warning","success","info","grey"];x(F);function a(t,e){document.documentElement.style.setProperty(`--${t}`,e.main),document.documentElement.style.setProperty(`--${t}-light`,e.light),document.documentElement.style.setProperty(`--${t}-dark`,e.dark),document.documentElement.style.setProperty(`--${t}-contrast`,e.contrast),document.documentElement.style.setProperty(`--${t}-opacity`,e.opacity)}function P(t){if(document.querySelector(`link[href="${t}"]`))return;const e=document.createElement("link");e.rel="stylesheet",e.href=t,document.head.appendChild(e)}function k(t){if(typeof window>"u")return;const{palette:e,shape:r,spacing:n,typography:o}=t;o.url&&P(o.url),a("info",e.info),a("error",e.error),a("warning",e.warning),a("success",e.success),a("primary",e.primary),a("secondary",e.secondary),a("grey",e.grey),document.documentElement.style.setProperty("--typography",o.family),document.documentElement.style.setProperty("--text-primary",e.text?.primary),document.documentElement.style.setProperty("--text-secondary",e.text?.secondary),document.documentElement.style.setProperty("--text-disabled",e.text?.disabled),document.documentElement.style.setProperty("--background-paper",e.background?.paper),document.documentElement.style.setProperty("--background-default",e.background?.default),document.documentElement.style.setProperty("--divider",e.divider),document.documentElement.style.setProperty("--radius",`${r.radius}px`),document.documentElement.style.setProperty("--spacing",`${n}px`)}const d=8,c={radius:8},i={mode:"light",palette:{info:"#72E4FC",error:"#FF5377",warning:"#FF9457",success:"#36E79B",primary:"#6C37F4",secondary:"#FB7185",grey:"#545f6f",text:{primary:"rgb(31, 41, 55)",secondary:"rgb(75, 85, 99)",disabled:"rgb(172, 172, 172)"},background:{paper:"#F9F8F9",default:"#FFF"},divider:"rgba(0, 0, 0, 0.12)"},spacing:d,shape:c,typography:{family:"Poppins",url:"https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500;1,600;1,700&display=swap"}},$={palette:{info:"#72E4FC",error:"#FF5377",warning:"#FF9457",success:"#36E79B",primary:"#8b5dff",secondary:"#EBFF5E",grey:"#b3b3b3",text:{primary:"rgba(255, 255, 255, 0.87)",secondary:"rgba(255, 255, 255, 0.6)",disabled:"rgba(255, 255, 255, 0.38)"},background:{paper:"#0D0225",default:"#30294E"},divider:"rgba(255, 255, 255, 0.25)"},spacing:d,shape:c,typography:{family:"Poppins",url:"https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500;1,600;1,700&display=swap"}},w=["primary","secondary","error","warning","success","info","grey"];function C(t){const e=t?.mode??"light",r=e==="dark"?$:i,n=t?.palette??{},o=r.palette,p=Object.fromEntries(w.map(s=>[s,b(n[s]??o[s])]));return{mode:e,palette:{text:n.text??o.text,background:n.background??o.background,divider:n.divider??o.divider,...p},shape:t?.shape??r.shape,spacing:t?.spacing??r.spacing,typography:t?.typography??r.typography}}const u=g({theme:C(i),updateTheme:()=>{}});function B({theme:t,children:e}){const[r,n]=m(t),o=y(()=>({theme:r,updateTheme:s=>p(s)}),[t,r]);l(()=>{k(r)},[r]);const p=s=>{n(s)};return h(u.Provider,{value:o,children:e})}function D(){return f(u)}export{B as T,C as c,D as u};
2
- //# sourceMappingURL=useTheme-g5gOUmLf.js.map
1
+ import{useState as m,useMemo as y,useEffect as l,createContext as g,useContext as f}from"react";import{jsx as h}from"react/jsx-runtime";import{g as b}from"./generateSupportColors-BN5t8dA-.js";function E(t){return[`${t}.main`,`${t}.dark`,`${t}.light`,`${t}.opacity`,`${t}.contrast`]}function x(t){return t.reduce((e,r)=>{const n=E(r);return e=[...e,...n],e},["text.primary","text.secondary","text.disabled","background.paper","background.default","divider"])}const F=["primary","secondary","error","warning","success","info","grey"];x(F);function a(t,e){document.documentElement.style.setProperty(`--${t}`,e.main),document.documentElement.style.setProperty(`--${t}-light`,e.light),document.documentElement.style.setProperty(`--${t}-dark`,e.dark),document.documentElement.style.setProperty(`--${t}-contrast`,e.contrast),document.documentElement.style.setProperty(`--${t}-opacity`,e.opacity)}function P(t){if(document.querySelector(`link[href="${t}"]`))return;const e=document.createElement("link");e.rel="stylesheet",e.href=t,document.head.appendChild(e)}function k(t){if(typeof window>"u")return;const{palette:e,shape:r,spacing:n,typography:o}=t;o.url&&P(o.url),a("info",e.info),a("error",e.error),a("warning",e.warning),a("success",e.success),a("primary",e.primary),a("secondary",e.secondary),a("grey",e.grey),document.documentElement.style.setProperty("--typography",o.family),document.documentElement.style.setProperty("--text-primary",e.text?.primary),document.documentElement.style.setProperty("--text-secondary",e.text?.secondary),document.documentElement.style.setProperty("--text-disabled",e.text?.disabled),document.documentElement.style.setProperty("--background-paper",e.background?.paper),document.documentElement.style.setProperty("--background-default",e.background?.default),document.documentElement.style.setProperty("--divider",e.divider),document.documentElement.style.setProperty("--radius",`${r.radius}px`),document.documentElement.style.setProperty("--spacing",`${n}px`)}const d=8,c={radius:8},i={mode:"light",palette:{info:"#72E4FC",error:"#FF5377",warning:"#FF9457",success:"#36E79B",primary:"#6C37F4",secondary:"#FB7185",grey:"#545f6f",text:{primary:"rgb(31, 41, 55)",secondary:"rgb(75, 85, 99)",disabled:"rgb(172, 172, 172)"},background:{paper:"#F9F8F9",default:"#FFF"},divider:"rgba(0, 0, 0, 0.12)"},spacing:d,shape:c,typography:{family:"Poppins",url:"https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500;1,600;1,700&display=swap"}},$={palette:{info:"#72E4FC",error:"#FF5377",warning:"#FF9457",success:"#36E79B",primary:"#8b5dff",secondary:"#EBFF5E",grey:"#2A2A2A",text:{primary:"rgba(255, 255, 255, 0.87)",secondary:"rgba(255, 255, 255, 0.6)",disabled:"rgba(255, 255, 255, 0.38)"},background:{paper:"#0D0225",default:"#30294E"},divider:"rgba(242, 242, 242, 0.12)"},spacing:d,shape:c,typography:{family:"Poppins",url:"https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500;1,600;1,700&display=swap"}},w=["primary","secondary","error","warning","success","info","grey"];function C(t){const e=t?.mode??"light",r=e==="dark"?$:i,n=t?.palette??{},o=r.palette,p=Object.fromEntries(w.map(s=>[s,b(n[s]??o[s])]));return{mode:e,palette:{text:n.text??o.text,background:n.background??o.background,divider:n.divider??o.divider,...p},shape:t?.shape??r.shape,spacing:t?.spacing??r.spacing,typography:t?.typography??r.typography}}const u=g({theme:C(i),updateTheme:()=>{}});function B({theme:t,children:e}){const[r,n]=m(t),o=y(()=>({theme:r,updateTheme:s=>p(s)}),[t,r]);l(()=>{k(r)},[r]);const p=s=>{n(s)};return h(u.Provider,{value:o,children:e})}function D(){return f(u)}export{B as T,C as c,D as u};
2
+ //# sourceMappingURL=useTheme-BYuNiCiH.js.map