@soyfri/shared-library 1.5.0-beta.4 → 1.6.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (247) hide show
  1. package/Button-C17mExpd.cjs.map +1 -1
  2. package/Button-UkkP-bNw.js.map +1 -1
  3. package/components/ActionMenu/ActionMenu.cjs +107 -0
  4. package/components/ActionMenu/ActionMenu.cjs.map +1 -0
  5. package/components/ActionMenu/ActionMenu.d.ts +44 -0
  6. package/components/ActionMenu/ActionMenu.js +107 -0
  7. package/components/ActionMenu/ActionMenu.js.map +1 -0
  8. package/components/ActionMenu/index.d.ts +2 -0
  9. package/components/ActionMenu.d.ts +6 -0
  10. package/components/AppBar/AppBar.cjs +129 -0
  11. package/components/AppBar/AppBar.cjs.map +1 -0
  12. package/components/AppBar/AppBar.d.ts +55 -0
  13. package/components/AppBar/AppBar.js +129 -0
  14. package/components/AppBar/AppBar.js.map +1 -0
  15. package/components/AppBar/AppBar.sx.d.ts +12 -0
  16. package/components/AppBar/AppBarContext.d.ts +18 -0
  17. package/components/AppBar/AppBarMenuToggle.d.ts +39 -0
  18. package/components/AppBar/index.d.ts +6 -0
  19. package/components/AppBar.d.ts +6 -0
  20. package/components/Autocomplete/Autocomplete.cjs +263 -82
  21. package/components/Autocomplete/Autocomplete.cjs.map +1 -1
  22. package/components/Autocomplete/Autocomplete.d.ts +71 -13
  23. package/components/Autocomplete/Autocomplete.definitions.d.ts +7 -0
  24. package/components/Autocomplete/Autocomplete.helpers.d.ts +22 -0
  25. package/components/Autocomplete/Autocomplete.js +264 -83
  26. package/components/Autocomplete/Autocomplete.js.map +1 -1
  27. package/components/Autocomplete/Autocomplete.sx.d.ts +7 -0
  28. package/components/Autocomplete/_parts/AutocompleteChips.d.ts +20 -0
  29. package/components/Autocomplete/_parts/AutocompleteLoader.d.ts +9 -0
  30. package/components/Autocomplete/_parts/AutocompleteOption.d.ts +16 -0
  31. package/components/Autocomplete/index.d.ts +2 -1
  32. package/components/Autocomplete.d.ts +4 -0
  33. package/components/Avatar/Avatar.cjs +117 -81
  34. package/components/Avatar/Avatar.cjs.map +1 -1
  35. package/components/Avatar/Avatar.d.ts +16 -2
  36. package/components/Avatar/Avatar.definitions.d.ts +11 -0
  37. package/components/Avatar/Avatar.js +118 -82
  38. package/components/Avatar/Avatar.js.map +1 -1
  39. package/components/Avatar/index.d.ts +1 -0
  40. package/components/Button/Button.d.ts +5 -5
  41. package/components/Button/index.d.ts +1 -0
  42. package/components/Card/Card.cjs +78 -7
  43. package/components/Card/Card.cjs.map +1 -1
  44. package/components/Card/Card.d.ts +31 -8
  45. package/components/Card/Card.js +79 -8
  46. package/components/Card/Card.js.map +1 -1
  47. package/components/Card/Card.sx.d.ts +14 -0
  48. package/components/Card/index.d.ts +4 -1
  49. package/components/Card.d.ts +4 -0
  50. package/components/Checkbox/Checkbox.cjs +189 -0
  51. package/components/Checkbox/Checkbox.cjs.map +1 -0
  52. package/components/Checkbox/Checkbox.d.ts +55 -0
  53. package/components/Checkbox/Checkbox.js +189 -0
  54. package/components/Checkbox/Checkbox.js.map +1 -0
  55. package/components/Checkbox/Checkbox.sx.d.ts +13 -0
  56. package/components/Checkbox/index.d.ts +2 -0
  57. package/components/Checkbox.d.ts +6 -0
  58. package/components/Chip/Chip.cjs +2 -1
  59. package/components/Chip/Chip.cjs.map +1 -1
  60. package/components/Chip/Chip.js +2 -1
  61. package/components/Chip/Chip.js.map +1 -1
  62. package/components/Chip/index.d.ts +2 -1
  63. package/components/Chip.d.ts +4 -0
  64. package/components/DatePicker/DatePicker.cjs +178 -3
  65. package/components/DatePicker/DatePicker.cjs.map +1 -1
  66. package/components/DatePicker/DatePicker.d.ts +35 -9
  67. package/components/DatePicker/DatePicker.definitions.d.ts +1 -0
  68. package/components/DatePicker/DatePicker.helpers.d.ts +7 -0
  69. package/components/DatePicker/DatePicker.js +177 -2
  70. package/components/DatePicker/DatePicker.js.map +1 -1
  71. package/components/DatePicker/DatePicker.sx.d.ts +9 -0
  72. package/components/DatePicker/index.d.ts +2 -1
  73. package/components/DatePicker.d.ts +4 -0
  74. package/components/DateTimePicker/DateTimePicker.cjs +121 -131
  75. package/components/DateTimePicker/DateTimePicker.cjs.map +1 -1
  76. package/components/DateTimePicker/DateTimePicker.d.ts +41 -12
  77. package/components/DateTimePicker/DateTimePicker.definitions.d.ts +3 -0
  78. package/components/DateTimePicker/DateTimePicker.helpers.d.ts +13 -0
  79. package/components/DateTimePicker/DateTimePicker.js +121 -131
  80. package/components/DateTimePicker/DateTimePicker.js.map +1 -1
  81. package/components/DateTimePicker/DateTimePicker.sx.d.ts +7 -0
  82. package/components/DateTimePicker/index.d.ts +2 -1
  83. package/components/DateTimePicker.d.ts +4 -0
  84. package/components/Drawer/Drawer.cjs +272 -0
  85. package/components/Drawer/Drawer.cjs.map +1 -0
  86. package/components/Drawer/Drawer.d.ts +58 -0
  87. package/components/Drawer/Drawer.js +272 -0
  88. package/components/Drawer/Drawer.js.map +1 -0
  89. package/components/Drawer/Drawer.sx.d.ts +23 -0
  90. package/components/Drawer/DrawerContext.d.ts +18 -0
  91. package/components/Drawer/DrawerItem.d.ts +40 -0
  92. package/components/Drawer/index.d.ts +6 -0
  93. package/components/Drawer.d.ts +6 -0
  94. package/components/Gallery/Gallery.cjs +154 -79
  95. package/components/Gallery/Gallery.cjs.map +1 -1
  96. package/components/Gallery/Gallery.d.ts +25 -9
  97. package/components/Gallery/Gallery.js +154 -79
  98. package/components/Gallery/Gallery.js.map +1 -1
  99. package/components/Gallery/GalleryLightbox.d.ts +6 -10
  100. package/components/Gallery/GalleryMain.d.ts +3 -7
  101. package/components/Gallery/GalleryThumbnails.d.ts +7 -11
  102. package/components/Gallery/index.d.ts +2 -1
  103. package/components/Gallery.d.ts +4 -0
  104. package/components/Icon/Icon.cjs +49 -10
  105. package/components/Icon/Icon.cjs.map +1 -1
  106. package/components/Icon/Icon.d.ts +29 -2
  107. package/components/Icon/Icon.js +49 -10
  108. package/components/Icon/Icon.js.map +1 -1
  109. package/components/Icon/index.d.ts +2 -1
  110. package/components/Icon.d.ts +4 -0
  111. package/components/Input/Input.cjs +186 -3
  112. package/components/Input/Input.cjs.map +1 -1
  113. package/components/Input/Input.d.ts +29 -17
  114. package/components/Input/Input.definitions.d.ts +6 -2
  115. package/components/Input/Input.helpers.d.ts +14 -0
  116. package/components/Input/Input.js +185 -2
  117. package/components/Input/Input.js.map +1 -1
  118. package/components/Input/Input.sx.d.ts +8 -0
  119. package/components/Input/index.d.ts +2 -1
  120. package/components/Input.d.ts +4 -0
  121. package/components/InputGroup/InputGroup.cjs +107 -93
  122. package/components/InputGroup/InputGroup.cjs.map +1 -1
  123. package/components/InputGroup/InputGroup.d.ts +38 -2
  124. package/components/InputGroup/InputGroup.definitions.d.ts +6 -0
  125. package/components/InputGroup/InputGroup.js +109 -95
  126. package/components/InputGroup/InputGroup.js.map +1 -1
  127. package/components/InputGroup/index.d.ts +2 -1
  128. package/components/InputGroup.d.ts +4 -0
  129. package/components/Modal/Modal.cjs +287 -148
  130. package/components/Modal/Modal.cjs.map +1 -1
  131. package/components/Modal/Modal.d.ts +57 -6
  132. package/components/Modal/Modal.js +289 -150
  133. package/components/Modal/Modal.js.map +1 -1
  134. package/components/Modal/ModalBody.d.ts +6 -1
  135. package/components/Modal/ModalFooter.d.ts +12 -4
  136. package/components/Modal/ModalHeader.d.ts +6 -1
  137. package/components/Modal/index.d.ts +8 -1
  138. package/components/Modal.d.ts +4 -0
  139. package/components/RadioGroup/RadioGroup.cjs +204 -0
  140. package/components/RadioGroup/RadioGroup.cjs.map +1 -0
  141. package/components/RadioGroup/RadioGroup.d.ts +59 -0
  142. package/components/RadioGroup/RadioGroup.definitions.d.ts +6 -0
  143. package/components/RadioGroup/RadioGroup.js +204 -0
  144. package/components/RadioGroup/RadioGroup.js.map +1 -0
  145. package/components/RadioGroup/RadioGroup.sx.d.ts +20 -0
  146. package/components/RadioGroup/index.d.ts +2 -0
  147. package/components/RadioGroup.d.ts +6 -0
  148. package/components/Select/Select.cjs +311 -4
  149. package/components/Select/Select.cjs.map +1 -1
  150. package/components/Select/Select.d.ts +62 -27
  151. package/components/Select/Select.helpers.d.ts +15 -0
  152. package/components/Select/Select.js +310 -3
  153. package/components/Select/Select.js.map +1 -1
  154. package/components/Select/Select.sx.d.ts +7 -0
  155. package/components/Select/_parts/SelectMenuItem.d.ts +20 -0
  156. package/components/Select/index.d.ts +2 -1
  157. package/components/Select.d.ts +4 -0
  158. package/components/Stat/Stat.cjs +2 -2
  159. package/components/Stat/Stat.cjs.map +1 -1
  160. package/components/Stat/Stat.js +2 -2
  161. package/components/Stat/Stat.js.map +1 -1
  162. package/components/Stat/index.d.ts +2 -1
  163. package/components/Stat.d.ts +4 -0
  164. package/components/StatusMessage/StatusMessage.cjs +66 -55
  165. package/components/StatusMessage/StatusMessage.cjs.map +1 -1
  166. package/components/StatusMessage/StatusMessage.d.ts +20 -36
  167. package/components/StatusMessage/StatusMessage.js +68 -57
  168. package/components/StatusMessage/StatusMessage.js.map +1 -1
  169. package/components/StatusMessage/index.d.ts +2 -1
  170. package/components/StatusMessage.d.ts +4 -0
  171. package/components/Stepper/Stepper.cjs +285 -29
  172. package/components/Stepper/Stepper.cjs.map +1 -1
  173. package/components/Stepper/Stepper.d.ts +13 -7
  174. package/components/Stepper/Stepper.js +287 -31
  175. package/components/Stepper/Stepper.js.map +1 -1
  176. package/components/Stepper/StepperContext.d.ts +73 -0
  177. package/components/Stepper/_hooks/useHorizontalScroll.d.ts +19 -0
  178. package/components/Stepper/_parts/StepperScrollArrow.d.ts +19 -0
  179. package/components/Stepper/index.d.ts +6 -2
  180. package/components/Stepper.d.ts +4 -0
  181. package/components/Switch/Switch.cjs +184 -0
  182. package/components/Switch/Switch.cjs.map +1 -0
  183. package/components/Switch/Switch.d.ts +48 -0
  184. package/components/Switch/Switch.definitions.d.ts +7 -0
  185. package/components/Switch/Switch.js +184 -0
  186. package/components/Switch/Switch.js.map +1 -0
  187. package/components/Switch/Switch.sx.d.ts +22 -0
  188. package/components/Switch/Switch.types.d.ts +1 -0
  189. package/components/Switch/index.d.ts +2 -0
  190. package/components/Switch.d.ts +6 -0
  191. package/components/Tabs/Tabs.cjs +45 -29
  192. package/components/Tabs/Tabs.cjs.map +1 -1
  193. package/components/Tabs/Tabs.d.ts +21 -16
  194. package/components/Tabs/Tabs.js +46 -30
  195. package/components/Tabs/Tabs.js.map +1 -1
  196. package/components/Tabs/index.d.ts +4 -2
  197. package/components/Tabs.d.ts +4 -0
  198. package/components/Timeline/Timeline.cjs +3 -2
  199. package/components/Timeline/Timeline.cjs.map +1 -1
  200. package/components/Timeline/Timeline.d.ts +4 -8
  201. package/components/Timeline/Timeline.js +3 -2
  202. package/components/Timeline/Timeline.js.map +1 -1
  203. package/components/Timeline/index.d.ts +4 -2
  204. package/components/Timeline.d.ts +4 -0
  205. package/components/_shared/formField.sx.d.ts +33 -0
  206. package/components/_shared/mergeSx.d.ts +7 -0
  207. package/components/_shared/resolvePreset.d.ts +18 -0
  208. package/formField.sx-8_QRnKxv.js +68 -0
  209. package/formField.sx-8_QRnKxv.js.map +1 -0
  210. package/formField.sx-BAX7KwMR.cjs +67 -0
  211. package/formField.sx-BAX7KwMR.cjs.map +1 -0
  212. package/index.cjs +144 -1
  213. package/index.cjs.map +1 -1
  214. package/index.d.ts +4 -0
  215. package/index.js +49 -2
  216. package/index.js.map +1 -1
  217. package/mergeSx-BXoNZjB_.js +10 -0
  218. package/mergeSx-BXoNZjB_.js.map +1 -0
  219. package/mergeSx-Dbccoo_H.cjs +9 -0
  220. package/mergeSx-Dbccoo_H.cjs.map +1 -0
  221. package/mui.d.ts +7 -0
  222. package/package.json +31 -1
  223. package/resolvePreset-B-IB0ehH.js +15 -0
  224. package/resolvePreset-B-IB0ehH.js.map +1 -0
  225. package/resolvePreset-CT3kU-K2.cjs +14 -0
  226. package/resolvePreset-CT3kU-K2.cjs.map +1 -0
  227. package/theme/componentStyles.d.ts +32 -0
  228. package/theme/tokens.d.ts +28 -0
  229. package/tokens-BRrcP_p_.js +21 -0
  230. package/tokens-BRrcP_p_.js.map +1 -0
  231. package/tokens-jaWWNk39.cjs +20 -0
  232. package/tokens-jaWWNk39.cjs.map +1 -0
  233. package/utils/index.d.ts +2 -0
  234. package/utils/scrollToTop.d.ts +28 -0
  235. package/DatePicker-BSNboVhN.js +0 -201
  236. package/DatePicker-BSNboVhN.js.map +0 -1
  237. package/DatePicker-BoqxWAhj.cjs +0 -200
  238. package/DatePicker-BoqxWAhj.cjs.map +0 -1
  239. package/Input-DFHs7cJ_.js +0 -171
  240. package/Input-DFHs7cJ_.js.map +0 -1
  241. package/Input-c8MwNNPg.cjs +0 -170
  242. package/Input-c8MwNNPg.cjs.map +0 -1
  243. package/Select-BO2N56sm.cjs +0 -411
  244. package/Select-BO2N56sm.cjs.map +0 -1
  245. package/Select-BcLkyHSE.js +0 -412
  246. package/Select-BcLkyHSE.js.map +0 -1
  247. package/components/Select/Select.definitions.d.ts +0 -14
@@ -1 +1 @@
1
- {"version":3,"file":"Tabs.cjs","sources":["../../../src/components/Tabs/_tabUtils.tsx","../../../src/components/Tabs/Tabs.tsx","../../../src/components/Tabs/Tab.tsx"],"sourcesContent":["export const TAB_DISPLAY_MAP: Record<\"horizontal\" | \"vertical\", { display: string, flexDirection: string }> = {\n horizontal: { display: \"flex\", flexDirection: \"column\" },\n vertical: { display: \"flex\", flexDirection: \"row\" }\n};","import React, { useState, ReactElement } from \"react\";\nimport { Tabs as MuiTabs, Tab as MuiTab, Box, TabsProps as MuiTabsProps } from \"@mui/material\";\nimport { TabProps } from \"./Tab\";\nimport { TAB_DISPLAY_MAP } from \"./_tabUtils\";\n\ntype PickTabsProps = Pick<\n MuiTabsProps,\n \"centered\" | \"indicatorColor\" | \"orientation\" | \"scrollButtons\" | \"variant\" | \"className\" | \"sx\" | \"visibleScrollbar\" | 'indicatorColor'| 'allowScrollButtonsMobile'\n>;\n\ninterface MyTabsProps extends PickTabsProps {\n children: ReactElement<TabProps>[];\n defaultValue?: number;\n onChange?: () => void;\n centered?: boolean;\n orientation?: \"horizontal\" | \"vertical\";\n scrollButtons?: \"auto\" | false | true;\n variant?: \"standard\" | \"scrollable\" | \"fullWidth\";\n indicatorColor?: \"primary\" | \"secondary\";\n labelColor?: \"primary\" | \"secondary\" | \"inherit\";\n onChangeValue?: (newValue: number) => void;\n allowScrollButtonsMobile?: boolean;\n}\n\nexport const Tabs: React.FC<MyTabsProps> = ({\n children,\n defaultValue,\n onChange,\n centered = true,\n orientation = 'horizontal',\n scrollButtons = \"auto\",\n variant = \"standard\",\n indicatorColor = \"primary\",\n labelColor = \"primary\",\n className,\n onChangeValue,\n allowScrollButtonsMobile = true,\n sx,\n}) => {\n const firstValue = children[0]?.props.value;\n const [currentValue, setCurrentValue] = useState<string | number>(\n defaultValue ?? firstValue ?? 0\n );\n\n const handleChange = (event: React.SyntheticEvent, newValue: number) => {\n setCurrentValue(newValue);\n onChange?.();\n onChangeValue?.(newValue);\n };\n\n return (\n <Box sx={{ display: TAB_DISPLAY_MAP[orientation].display, flexDirection: TAB_DISPLAY_MAP[orientation].flexDirection}}>\n <MuiTabs\n value={currentValue}\n onChange={handleChange}\n centered={centered}\n indicatorColor={indicatorColor}\n orientation={orientation}\n scrollButtons={scrollButtons}\n variant={variant}\n className={className}\n textColor={labelColor}\n sx={{ ...sx }}\n allowScrollButtonsMobile={allowScrollButtonsMobile}\n \n\n >\n {children.map((child, idx) => {\n const { label, icon, value = idx, disabled, wrapped, iconPosition, className: tabClassName, sx: tabSx } = child.props;\n return (\n <MuiTab\n key={value}\n label={label}\n icon={icon}\n value={value}\n disabled={disabled}\n wrapped={wrapped}\n iconPosition={iconPosition}\n className={tabClassName}\n sx={tabSx}\n />\n );\n })}\n </MuiTabs>\n\n <Box m={2} role=\"tabpanel\" sx={{width:'100%'}} >\n {children.map((child, idx) => {\n const value = child.props.value ?? idx;\n return value === currentValue ? (\n <Box key={value}>{child.props.children}</Box>\n ) : null;\n })}\n </Box>\n </Box>\n\n );\n};\n\nexport default Tabs;\n","import React from \"react\";\nimport { TabProps as MuiTabProps } from \"@mui/material\";\n\ntype PickMuiTabProps = Pick<\n MuiTabProps,\n \"label\" | \"icon\" | \"disabled\" | \"sx\" | \"value\" | \"wrapped\" | \"iconPosition\" | \"className\" | \"disabled\"| 'disableRipple'\n>;\n\nexport interface TabProps extends PickMuiTabProps {\n value?: number;\n onChange?: () => void;\n children?: React.ReactNode;\n}\n\nexport const Tab = (_: TabProps): null => null;\n\nTab.displayName = \"Tab\";\n\nexport default Tab;\n"],"names":["useState","jsxs","Box","jsx","MuiTabs","MuiTab","_a"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAO,MAAM,kBAAiG;AAAA,EAC5G,YAAY,EAAE,SAAS,QAAQ,eAAe,SAAA;AAAA,EAC9C,UAAU,EAAE,SAAS,QAAQ,eAAe,MAAA;AAC9C;ACqBO,MAAM,OAA8B,CAAC;AAAA,EAC1C;AAAA,EACA;AAAA,EACA;AAAA,EACA,WAAW;AAAA,EACX,cAAc;AAAA,EACd,gBAAgB;AAAA,EAChB,UAAU;AAAA,EACV,iBAAiB;AAAA,EACjB,aAAa;AAAA,EACb;AAAA,EACA;AAAA,EACA,2BAA2B;AAAA,EAC3B;AACF,MAAM;;AACJ,QAAM,cAAa,cAAS,CAAC,MAAV,mBAAa,MAAM;AACtC,QAAM,CAAC,cAAc,eAAe,IAAIA,MAAAA;AAAAA,KACtC,2CAAgB,eAAhB,YAA8B;AAAA,EAAA;AAGhC,QAAM,eAAe,CAAC,OAA6B,aAAqB;AACtE,oBAAgB,QAAQ;AACxB;AACA,mDAAgB;AAAA,EAClB;AAEA,SACEC,2BAAAA,KAACC,SAAAA,KAAA,EAAI,IAAI,EAAE,SAAS,gBAAgB,WAAW,EAAE,SAAS,eAAe,gBAAgB,WAAW,EAAE,iBACpG,UAAA;AAAA,IAAAC,2BAAAA;AAAAA,MAACC,SAAAA;AAAAA,MAAA;AAAA,QACC,OAAO;AAAA,QACP,UAAU;AAAA,QACV;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA,WAAW;AAAA,QACX,IAAI,mBAAK;AAAA,QACT;AAAA,QAIC,UAAA,SAAS,IAAI,CAAC,OAAO,QAAQ;AAC5B,gBAAM,EAAE,OAAO,MAAM,QAAQ,KAAK,UAAU,SAAS,cAAc,WAAW,cAAc,IAAI,MAAA,IAAU,MAAM;AAChH,iBACED,2BAAAA;AAAAA,YAACE,SAAAA;AAAAA,YAAA;AAAA,cAEC;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,cACA,WAAW;AAAA,cACX,IAAI;AAAA,YAAA;AAAA,YARC;AAAA,UAAA;AAAA,QAWX,CAAC;AAAA,MAAA;AAAA,IAAA;AAAA,IAGHF,2BAAAA,IAACD,SAAAA,KAAA,EAAI,GAAG,GAAG,MAAK,YAAW,IAAI,EAAC,OAAM,UACnC,UAAA,SAAS,IAAI,CAAC,OAAO,QAAQ;;AAC5B,YAAM,SAAQI,MAAA,MAAM,MAAM,UAAZ,OAAAA,MAAqB;AACnC,aAAO,UAAU,eACfH,2BAAAA,IAACD,SAAAA,KAAA,EAAiB,gBAAM,MAAM,YAApB,KAA6B,IACrC;AAAA,IACN,CAAC,EAAA,CACH;AAAA,EAAA,GACF;AAGJ;AClFO,MAAM,MAAM,CAAC,MAAsB;AAE1C,IAAI,cAAc;;;"}
1
+ {"version":3,"file":"Tabs.cjs","sources":["../../../src/components/Tabs/_tabUtils.tsx","../../../src/components/Tabs/Tabs.tsx","../../../src/components/Tabs/Tab.tsx"],"sourcesContent":["export const TAB_DISPLAY_MAP: Record<\"horizontal\" | \"vertical\", { display: string, flexDirection: string }> = {\n horizontal: { display: \"flex\", flexDirection: \"column\" },\n vertical: { display: \"flex\", flexDirection: \"row\" }\n};","import {\n Children,\n isValidElement,\n useState,\n type FC,\n type ReactElement,\n type ReactNode,\n type SyntheticEvent,\n} from 'react';\nimport {\n Tabs as MuiTabs,\n Tab as MuiTab,\n Box,\n type TabsProps as MuiTabsProps,\n} from '@mui/material';\n\nimport { TabProps } from './Tab';\nimport { TAB_DISPLAY_MAP } from './_tabUtils';\nimport { mergeSx } from '../_shared/mergeSx';\n\ntype PickTabsProps = Pick<\n MuiTabsProps,\n | 'centered'\n | 'indicatorColor'\n | 'orientation'\n | 'scrollButtons'\n | 'variant'\n | 'className'\n | 'sx'\n | 'visibleScrollbar'\n | 'allowScrollButtonsMobile'\n>;\n\nexport interface TabsProps extends PickTabsProps {\n /** Uno o varios `<Tab>`. Children que no sean `<Tab>` se ignoran. */\n children: ReactNode;\n /** Valor del tab inicialmente activo. Si no se provee, toma el `value` del primer `<Tab>` o `0`. */\n defaultValue?: number | string;\n /** Callback al cambiar de tab. Recibe el `value` del tab nuevo. */\n onChangeValue?: (newValue: number | string) => void;\n labelColor?: 'primary' | 'secondary' | 'inherit';\n /**\n * Cómo se manejan los paneles al cambiar de tab:\n * - `false` (default): **unmount** — solo se renderiza el panel activo; los\n * demás se desmontan. El state interno de los hijos se pierde al navegar.\n * Menor uso de memoria.\n * - `true`: **keep mounted** — renderiza todos los paneles pero oculta los\n * no activos con `display: none`. El state se preserva (inputs, scroll,\n * timers, subscripciones) al navegar entre tabs.\n */\n keepMounted?: boolean;\n}\n\nexport const Tabs: FC<TabsProps> = ({\n children,\n defaultValue,\n onChangeValue,\n centered = true,\n orientation = 'horizontal',\n scrollButtons = 'auto',\n variant = 'standard',\n indicatorColor = 'primary',\n labelColor = 'primary',\n className,\n allowScrollButtonsMobile = true,\n keepMounted = false,\n sx,\n}) => {\n // Filtra a solo <Tab> children — acepta arrays, single child, fragments,\n // y descarta cualquier otra cosa (strings, null, condicionales falsy).\n const tabs: ReactElement<TabProps>[] = Children.toArray(children).filter(\n (child): child is ReactElement<TabProps> =>\n isValidElement(child) &&\n (child.type as { displayName?: string })?.displayName === 'Tab',\n );\n\n const firstValue = tabs[0]?.props.value;\n const [currentValue, setCurrentValue] = useState<string | number>(\n defaultValue ?? firstValue ?? 0,\n );\n\n const handleChange = (_event: SyntheticEvent, newValue: number | string) => {\n setCurrentValue(newValue);\n onChangeValue?.(newValue);\n };\n\n const { display, flexDirection } = TAB_DISPLAY_MAP[orientation];\n\n return (\n <Box sx={{ display, flexDirection }}>\n <MuiTabs\n value={currentValue}\n onChange={handleChange}\n centered={centered}\n indicatorColor={indicatorColor}\n orientation={orientation}\n scrollButtons={scrollButtons}\n variant={variant}\n className={className}\n textColor={labelColor}\n allowScrollButtonsMobile={allowScrollButtonsMobile}\n sx={mergeSx({}, sx)}\n >\n {tabs.map((tab, idx) => {\n const {\n label,\n icon,\n value = idx,\n disabled,\n wrapped,\n iconPosition,\n className: tabClassName,\n sx: tabSx,\n } = tab.props;\n return (\n <MuiTab\n key={value}\n label={label}\n icon={icon}\n value={value}\n disabled={disabled}\n wrapped={wrapped}\n iconPosition={iconPosition}\n className={tabClassName}\n sx={tabSx}\n />\n );\n })}\n </MuiTabs>\n\n <Box m={2} sx={{ width: '100%' }}>\n {keepMounted\n ? tabs.map((tab, idx) => {\n const value = tab.props.value ?? idx;\n const isActive = value === currentValue;\n return (\n <Box\n key={value}\n role=\"tabpanel\"\n // `display: none` mantiene el nodo en el DOM — state de los\n // hijos (inputs, useState, etc.) no se pierde al navegar.\n sx={{ display: isActive ? 'block' : 'none' }}\n aria-hidden={!isActive}\n >\n {tab.props.children}\n </Box>\n );\n })\n : tabs.map((tab, idx) => {\n const value = tab.props.value ?? idx;\n if (value !== currentValue) return null;\n return (\n <Box key={value} role=\"tabpanel\">\n {tab.props.children}\n </Box>\n );\n })}\n </Box>\n </Box>\n );\n};\n\nexport default Tabs;\n","import React from \"react\";\nimport { TabProps as MuiTabProps } from \"@mui/material\";\n\ntype PickMuiTabProps = Pick<\n MuiTabProps,\n \"label\" | \"icon\" | \"disabled\" | \"sx\" | \"value\" | \"wrapped\" | \"iconPosition\" | \"className\" | \"disabled\"| 'disableRipple'\n>;\n\nexport interface TabProps extends PickMuiTabProps {\n value?: number;\n onChange?: () => void;\n children?: React.ReactNode;\n}\n\nexport const Tab = (_: TabProps): null => null;\n\nTab.displayName = \"Tab\";\n\nexport default Tab;\n"],"names":["Children","isValidElement","_a","useState","Box","jsx","MuiTabs","mergeSx","MuiTab"],"mappings":";;;;;;AAAO,MAAM,kBAAiG;AAAA,EAC5G,YAAY,EAAE,SAAS,QAAQ,eAAe,SAAA;AAAA,EAC9C,UAAU,EAAE,SAAS,QAAQ,eAAe,MAAA;AAC9C;ACkDO,MAAM,OAAsB,CAAC;AAAA,EAClC;AAAA,EACA;AAAA,EACA;AAAA,EACA,WAAW;AAAA,EACX,cAAc;AAAA,EACd,gBAAgB;AAAA,EAChB,UAAU;AAAA,EACV,iBAAiB;AAAA,EACjB,aAAa;AAAA,EACb;AAAA,EACA,2BAA2B;AAAA,EAC3B,cAAc;AAAA,EACd;AACF,MAAM;;AAGJ,QAAM,OAAiCA,MAAAA,SAAS,QAAQ,QAAQ,EAAE;AAAA,IAChE,CAAC,UAAA;;AACCC,mBAAAA,eAAe,KAAK,OACnBC,MAAA,MAAM,SAAN,gBAAAA,IAAyC,iBAAgB;AAAA;AAAA,EAAA;AAG9D,QAAM,cAAa,UAAK,CAAC,MAAN,mBAAS,MAAM;AAClC,QAAM,CAAC,cAAc,eAAe,IAAIC,MAAAA;AAAAA,KACtC,2CAAgB,eAAhB,YAA8B;AAAA,EAAA;AAGhC,QAAM,eAAe,CAAC,QAAwB,aAA8B;AAC1E,oBAAgB,QAAQ;AACxB,mDAAgB;AAAA,EAClB;AAEA,QAAM,EAAE,SAAS,kBAAkB,gBAAgB,WAAW;AAE9D,yCACGC,SAAAA,KAAA,EAAI,IAAI,EAAE,SAAS,iBAClB,UAAA;AAAA,IAAAC,2BAAAA;AAAAA,MAACC,SAAAA;AAAAA,MAAA;AAAA,QACC,OAAO;AAAA,QACP,UAAU;AAAA,QACV;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA,WAAW;AAAA,QACX;AAAA,QACA,IAAIC,QAAAA,QAAQ,CAAA,GAAI,EAAE;AAAA,QAEjB,UAAA,KAAK,IAAI,CAAC,KAAK,QAAQ;AACtB,gBAAM;AAAA,YACJ;AAAA,YACA;AAAA,YACA,QAAQ;AAAA,YACR;AAAA,YACA;AAAA,YACA;AAAA,YACA,WAAW;AAAA,YACX,IAAI;AAAA,UAAA,IACF,IAAI;AACR,iBACEF,2BAAAA;AAAAA,YAACG,SAAAA;AAAAA,YAAA;AAAA,cAEC;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,cACA,WAAW;AAAA,cACX,IAAI;AAAA,YAAA;AAAA,YARC;AAAA,UAAA;AAAA,QAWX,CAAC;AAAA,MAAA;AAAA,IAAA;AAAA,IAGHH,2BAAAA,IAACD,SAAAA,KAAA,EAAI,GAAG,GAAG,IAAI,EAAE,OAAO,OAAA,GACrB,UAAA,cACG,KAAK,IAAI,CAAC,KAAK,QAAQ;;AACrB,YAAM,SAAQF,MAAA,IAAI,MAAM,UAAV,OAAAA,MAAmB;AACjC,YAAM,WAAW,UAAU;AAC3B,aACEG,2BAAAA;AAAAA,QAACD,SAAAA;AAAAA,QAAA;AAAA,UAEC,MAAK;AAAA,UAGL,IAAI,EAAE,SAAS,WAAW,UAAU,OAAA;AAAA,UACpC,eAAa,CAAC;AAAA,UAEb,cAAI,MAAM;AAAA,QAAA;AAAA,QAPN;AAAA,MAAA;AAAA,IAUX,CAAC,IACD,KAAK,IAAI,CAAC,KAAK,QAAQ;;AACrB,YAAM,SAAQF,MAAA,IAAI,MAAM,UAAV,OAAAA,MAAmB;AACjC,UAAI,UAAU,aAAc,QAAO;AACnC,4CACGE,SAAAA,KAAA,EAAgB,MAAK,YACnB,UAAA,IAAI,MAAM,YADH,KAEV;AAAA,IAEJ,CAAC,EAAA,CACP;AAAA,EAAA,GACF;AAEJ;AClJO,MAAM,MAAM,CAAC,MAAsB;AAE1C,IAAI,cAAc;;;;"}
@@ -1,19 +1,24 @@
1
- import { default as React, ReactElement } from 'react';
1
+ import { FC, ReactNode } from 'react';
2
2
  import { TabsProps as MuiTabsProps } from '@mui/material';
3
- import { TabProps } from './Tab';
4
- type PickTabsProps = Pick<MuiTabsProps, "centered" | "indicatorColor" | "orientation" | "scrollButtons" | "variant" | "className" | "sx" | "visibleScrollbar" | 'indicatorColor' | 'allowScrollButtonsMobile'>;
5
- interface MyTabsProps extends PickTabsProps {
6
- children: ReactElement<TabProps>[];
7
- defaultValue?: number;
8
- onChange?: () => void;
9
- centered?: boolean;
10
- orientation?: "horizontal" | "vertical";
11
- scrollButtons?: "auto" | false | true;
12
- variant?: "standard" | "scrollable" | "fullWidth";
13
- indicatorColor?: "primary" | "secondary";
14
- labelColor?: "primary" | "secondary" | "inherit";
15
- onChangeValue?: (newValue: number) => void;
16
- allowScrollButtonsMobile?: boolean;
3
+ type PickTabsProps = Pick<MuiTabsProps, 'centered' | 'indicatorColor' | 'orientation' | 'scrollButtons' | 'variant' | 'className' | 'sx' | 'visibleScrollbar' | 'allowScrollButtonsMobile'>;
4
+ export interface TabsProps extends PickTabsProps {
5
+ /** Uno o varios `<Tab>`. Children que no sean `<Tab>` se ignoran. */
6
+ children: ReactNode;
7
+ /** Valor del tab inicialmente activo. Si no se provee, toma el `value` del primer `<Tab>` o `0`. */
8
+ defaultValue?: number | string;
9
+ /** Callback al cambiar de tab. Recibe el `value` del tab nuevo. */
10
+ onChangeValue?: (newValue: number | string) => void;
11
+ labelColor?: 'primary' | 'secondary' | 'inherit';
12
+ /**
13
+ * Cómo se manejan los paneles al cambiar de tab:
14
+ * - `false` (default): **unmount** — solo se renderiza el panel activo; los
15
+ * demás se desmontan. El state interno de los hijos se pierde al navegar.
16
+ * Menor uso de memoria.
17
+ * - `true`: **keep mounted** — renderiza todos los paneles pero oculta los
18
+ * no activos con `display: none`. El state se preserva (inputs, scroll,
19
+ * timers, subscripciones) al navegar entre tabs.
20
+ */
21
+ keepMounted?: boolean;
17
22
  }
18
- export declare const Tabs: React.FC<MyTabsProps>;
23
+ export declare const Tabs: FC<TabsProps>;
19
24
  export default Tabs;
@@ -1,22 +1,7 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
3
- var __hasOwnProp = Object.prototype.hasOwnProperty;
4
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
5
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6
- var __spreadValues = (a, b) => {
7
- for (var prop in b || (b = {}))
8
- if (__hasOwnProp.call(b, prop))
9
- __defNormalProp(a, prop, b[prop]);
10
- if (__getOwnPropSymbols)
11
- for (var prop of __getOwnPropSymbols(b)) {
12
- if (__propIsEnum.call(b, prop))
13
- __defNormalProp(a, prop, b[prop]);
14
- }
15
- return a;
16
- };
17
1
  import { jsxs, jsx } from "react/jsx-runtime";
18
- import { useState } from "react";
2
+ import { Children, isValidElement, useState } from "react";
19
3
  import { Box, Tabs as Tabs$1, Tab as Tab$1 } from "@mui/material";
4
+ import { m as mergeSx } from "../../mergeSx-BXoNZjB_.js";
20
5
  const TAB_DISPLAY_MAP = {
21
6
  horizontal: { display: "flex", flexDirection: "column" },
22
7
  vertical: { display: "flex", flexDirection: "row" }
@@ -24,7 +9,7 @@ const TAB_DISPLAY_MAP = {
24
9
  const Tabs = ({
25
10
  children,
26
11
  defaultValue,
27
- onChange,
12
+ onChangeValue,
28
13
  centered = true,
29
14
  orientation = "horizontal",
30
15
  scrollButtons = "auto",
@@ -32,21 +17,27 @@ const Tabs = ({
32
17
  indicatorColor = "primary",
33
18
  labelColor = "primary",
34
19
  className,
35
- onChangeValue,
36
20
  allowScrollButtonsMobile = true,
21
+ keepMounted = false,
37
22
  sx
38
23
  }) => {
39
24
  var _a, _b;
40
- const firstValue = (_a = children[0]) == null ? void 0 : _a.props.value;
25
+ const tabs = Children.toArray(children).filter(
26
+ (child) => {
27
+ var _a2;
28
+ return isValidElement(child) && ((_a2 = child.type) == null ? void 0 : _a2.displayName) === "Tab";
29
+ }
30
+ );
31
+ const firstValue = (_a = tabs[0]) == null ? void 0 : _a.props.value;
41
32
  const [currentValue, setCurrentValue] = useState(
42
33
  (_b = defaultValue != null ? defaultValue : firstValue) != null ? _b : 0
43
34
  );
44
- const handleChange = (event, newValue) => {
35
+ const handleChange = (_event, newValue) => {
45
36
  setCurrentValue(newValue);
46
- onChange == null ? void 0 : onChange();
47
37
  onChangeValue == null ? void 0 : onChangeValue(newValue);
48
38
  };
49
- return /* @__PURE__ */ jsxs(Box, { sx: { display: TAB_DISPLAY_MAP[orientation].display, flexDirection: TAB_DISPLAY_MAP[orientation].flexDirection }, children: [
39
+ const { display, flexDirection } = TAB_DISPLAY_MAP[orientation];
40
+ return /* @__PURE__ */ jsxs(Box, { sx: { display, flexDirection }, children: [
50
41
  /* @__PURE__ */ jsx(
51
42
  Tabs$1,
52
43
  {
@@ -59,10 +50,19 @@ const Tabs = ({
59
50
  variant,
60
51
  className,
61
52
  textColor: labelColor,
62
- sx: __spreadValues({}, sx),
63
53
  allowScrollButtonsMobile,
64
- children: children.map((child, idx) => {
65
- const { label, icon, value = idx, disabled, wrapped, iconPosition, className: tabClassName, sx: tabSx } = child.props;
54
+ sx: mergeSx({}, sx),
55
+ children: tabs.map((tab, idx) => {
56
+ const {
57
+ label,
58
+ icon,
59
+ value = idx,
60
+ disabled,
61
+ wrapped,
62
+ iconPosition,
63
+ className: tabClassName,
64
+ sx: tabSx
65
+ } = tab.props;
66
66
  return /* @__PURE__ */ jsx(
67
67
  Tab$1,
68
68
  {
@@ -80,10 +80,25 @@ const Tabs = ({
80
80
  })
81
81
  }
82
82
  ),
83
- /* @__PURE__ */ jsx(Box, { m: 2, role: "tabpanel", sx: { width: "100%" }, children: children.map((child, idx) => {
83
+ /* @__PURE__ */ jsx(Box, { m: 2, sx: { width: "100%" }, children: keepMounted ? tabs.map((tab, idx) => {
84
+ var _a2;
85
+ const value = (_a2 = tab.props.value) != null ? _a2 : idx;
86
+ const isActive = value === currentValue;
87
+ return /* @__PURE__ */ jsx(
88
+ Box,
89
+ {
90
+ role: "tabpanel",
91
+ sx: { display: isActive ? "block" : "none" },
92
+ "aria-hidden": !isActive,
93
+ children: tab.props.children
94
+ },
95
+ value
96
+ );
97
+ }) : tabs.map((tab, idx) => {
84
98
  var _a2;
85
- const value = (_a2 = child.props.value) != null ? _a2 : idx;
86
- return value === currentValue ? /* @__PURE__ */ jsx(Box, { children: child.props.children }, value) : null;
99
+ const value = (_a2 = tab.props.value) != null ? _a2 : idx;
100
+ if (value !== currentValue) return null;
101
+ return /* @__PURE__ */ jsx(Box, { role: "tabpanel", children: tab.props.children }, value);
87
102
  }) })
88
103
  ] });
89
104
  };
@@ -91,6 +106,7 @@ const Tab = (_) => null;
91
106
  Tab.displayName = "Tab";
92
107
  export {
93
108
  Tab,
94
- Tabs
109
+ Tabs,
110
+ Tabs as default
95
111
  };
96
112
  //# sourceMappingURL=Tabs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Tabs.js","sources":["../../../src/components/Tabs/_tabUtils.tsx","../../../src/components/Tabs/Tabs.tsx","../../../src/components/Tabs/Tab.tsx"],"sourcesContent":["export const TAB_DISPLAY_MAP: Record<\"horizontal\" | \"vertical\", { display: string, flexDirection: string }> = {\n horizontal: { display: \"flex\", flexDirection: \"column\" },\n vertical: { display: \"flex\", flexDirection: \"row\" }\n};","import React, { useState, ReactElement } from \"react\";\nimport { Tabs as MuiTabs, Tab as MuiTab, Box, TabsProps as MuiTabsProps } from \"@mui/material\";\nimport { TabProps } from \"./Tab\";\nimport { TAB_DISPLAY_MAP } from \"./_tabUtils\";\n\ntype PickTabsProps = Pick<\n MuiTabsProps,\n \"centered\" | \"indicatorColor\" | \"orientation\" | \"scrollButtons\" | \"variant\" | \"className\" | \"sx\" | \"visibleScrollbar\" | 'indicatorColor'| 'allowScrollButtonsMobile'\n>;\n\ninterface MyTabsProps extends PickTabsProps {\n children: ReactElement<TabProps>[];\n defaultValue?: number;\n onChange?: () => void;\n centered?: boolean;\n orientation?: \"horizontal\" | \"vertical\";\n scrollButtons?: \"auto\" | false | true;\n variant?: \"standard\" | \"scrollable\" | \"fullWidth\";\n indicatorColor?: \"primary\" | \"secondary\";\n labelColor?: \"primary\" | \"secondary\" | \"inherit\";\n onChangeValue?: (newValue: number) => void;\n allowScrollButtonsMobile?: boolean;\n}\n\nexport const Tabs: React.FC<MyTabsProps> = ({\n children,\n defaultValue,\n onChange,\n centered = true,\n orientation = 'horizontal',\n scrollButtons = \"auto\",\n variant = \"standard\",\n indicatorColor = \"primary\",\n labelColor = \"primary\",\n className,\n onChangeValue,\n allowScrollButtonsMobile = true,\n sx,\n}) => {\n const firstValue = children[0]?.props.value;\n const [currentValue, setCurrentValue] = useState<string | number>(\n defaultValue ?? firstValue ?? 0\n );\n\n const handleChange = (event: React.SyntheticEvent, newValue: number) => {\n setCurrentValue(newValue);\n onChange?.();\n onChangeValue?.(newValue);\n };\n\n return (\n <Box sx={{ display: TAB_DISPLAY_MAP[orientation].display, flexDirection: TAB_DISPLAY_MAP[orientation].flexDirection}}>\n <MuiTabs\n value={currentValue}\n onChange={handleChange}\n centered={centered}\n indicatorColor={indicatorColor}\n orientation={orientation}\n scrollButtons={scrollButtons}\n variant={variant}\n className={className}\n textColor={labelColor}\n sx={{ ...sx }}\n allowScrollButtonsMobile={allowScrollButtonsMobile}\n \n\n >\n {children.map((child, idx) => {\n const { label, icon, value = idx, disabled, wrapped, iconPosition, className: tabClassName, sx: tabSx } = child.props;\n return (\n <MuiTab\n key={value}\n label={label}\n icon={icon}\n value={value}\n disabled={disabled}\n wrapped={wrapped}\n iconPosition={iconPosition}\n className={tabClassName}\n sx={tabSx}\n />\n );\n })}\n </MuiTabs>\n\n <Box m={2} role=\"tabpanel\" sx={{width:'100%'}} >\n {children.map((child, idx) => {\n const value = child.props.value ?? idx;\n return value === currentValue ? (\n <Box key={value}>{child.props.children}</Box>\n ) : null;\n })}\n </Box>\n </Box>\n\n );\n};\n\nexport default Tabs;\n","import React from \"react\";\nimport { TabProps as MuiTabProps } from \"@mui/material\";\n\ntype PickMuiTabProps = Pick<\n MuiTabProps,\n \"label\" | \"icon\" | \"disabled\" | \"sx\" | \"value\" | \"wrapped\" | \"iconPosition\" | \"className\" | \"disabled\"| 'disableRipple'\n>;\n\nexport interface TabProps extends PickMuiTabProps {\n value?: number;\n onChange?: () => void;\n children?: React.ReactNode;\n}\n\nexport const Tab = (_: TabProps): null => null;\n\nTab.displayName = \"Tab\";\n\nexport default Tab;\n"],"names":["MuiTabs","MuiTab","_a"],"mappings":";;;;;;;;;;;;;;;;;;;AAAO,MAAM,kBAAiG;AAAA,EAC5G,YAAY,EAAE,SAAS,QAAQ,eAAe,SAAA;AAAA,EAC9C,UAAU,EAAE,SAAS,QAAQ,eAAe,MAAA;AAC9C;ACqBO,MAAM,OAA8B,CAAC;AAAA,EAC1C;AAAA,EACA;AAAA,EACA;AAAA,EACA,WAAW;AAAA,EACX,cAAc;AAAA,EACd,gBAAgB;AAAA,EAChB,UAAU;AAAA,EACV,iBAAiB;AAAA,EACjB,aAAa;AAAA,EACb;AAAA,EACA;AAAA,EACA,2BAA2B;AAAA,EAC3B;AACF,MAAM;;AACJ,QAAM,cAAa,cAAS,CAAC,MAAV,mBAAa,MAAM;AACtC,QAAM,CAAC,cAAc,eAAe,IAAI;AAAA,KACtC,2CAAgB,eAAhB,YAA8B;AAAA,EAAA;AAGhC,QAAM,eAAe,CAAC,OAA6B,aAAqB;AACtE,oBAAgB,QAAQ;AACxB;AACA,mDAAgB;AAAA,EAClB;AAEA,SACE,qBAAC,KAAA,EAAI,IAAI,EAAE,SAAS,gBAAgB,WAAW,EAAE,SAAS,eAAe,gBAAgB,WAAW,EAAE,iBACpG,UAAA;AAAA,IAAA;AAAA,MAACA;AAAAA,MAAA;AAAA,QACC,OAAO;AAAA,QACP,UAAU;AAAA,QACV;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA,WAAW;AAAA,QACX,IAAI,mBAAK;AAAA,QACT;AAAA,QAIC,UAAA,SAAS,IAAI,CAAC,OAAO,QAAQ;AAC5B,gBAAM,EAAE,OAAO,MAAM,QAAQ,KAAK,UAAU,SAAS,cAAc,WAAW,cAAc,IAAI,MAAA,IAAU,MAAM;AAChH,iBACE;AAAA,YAACC;AAAAA,YAAA;AAAA,cAEC;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,cACA,WAAW;AAAA,cACX,IAAI;AAAA,YAAA;AAAA,YARC;AAAA,UAAA;AAAA,QAWX,CAAC;AAAA,MAAA;AAAA,IAAA;AAAA,IAGH,oBAAC,KAAA,EAAI,GAAG,GAAG,MAAK,YAAW,IAAI,EAAC,OAAM,UACnC,UAAA,SAAS,IAAI,CAAC,OAAO,QAAQ;;AAC5B,YAAM,SAAQC,MAAA,MAAM,MAAM,UAAZ,OAAAA,MAAqB;AACnC,aAAO,UAAU,eACf,oBAAC,KAAA,EAAiB,gBAAM,MAAM,YAApB,KAA6B,IACrC;AAAA,IACN,CAAC,EAAA,CACH;AAAA,EAAA,GACF;AAGJ;AClFO,MAAM,MAAM,CAAC,MAAsB;AAE1C,IAAI,cAAc;"}
1
+ {"version":3,"file":"Tabs.js","sources":["../../../src/components/Tabs/_tabUtils.tsx","../../../src/components/Tabs/Tabs.tsx","../../../src/components/Tabs/Tab.tsx"],"sourcesContent":["export const TAB_DISPLAY_MAP: Record<\"horizontal\" | \"vertical\", { display: string, flexDirection: string }> = {\n horizontal: { display: \"flex\", flexDirection: \"column\" },\n vertical: { display: \"flex\", flexDirection: \"row\" }\n};","import {\n Children,\n isValidElement,\n useState,\n type FC,\n type ReactElement,\n type ReactNode,\n type SyntheticEvent,\n} from 'react';\nimport {\n Tabs as MuiTabs,\n Tab as MuiTab,\n Box,\n type TabsProps as MuiTabsProps,\n} from '@mui/material';\n\nimport { TabProps } from './Tab';\nimport { TAB_DISPLAY_MAP } from './_tabUtils';\nimport { mergeSx } from '../_shared/mergeSx';\n\ntype PickTabsProps = Pick<\n MuiTabsProps,\n | 'centered'\n | 'indicatorColor'\n | 'orientation'\n | 'scrollButtons'\n | 'variant'\n | 'className'\n | 'sx'\n | 'visibleScrollbar'\n | 'allowScrollButtonsMobile'\n>;\n\nexport interface TabsProps extends PickTabsProps {\n /** Uno o varios `<Tab>`. Children que no sean `<Tab>` se ignoran. */\n children: ReactNode;\n /** Valor del tab inicialmente activo. Si no se provee, toma el `value` del primer `<Tab>` o `0`. */\n defaultValue?: number | string;\n /** Callback al cambiar de tab. Recibe el `value` del tab nuevo. */\n onChangeValue?: (newValue: number | string) => void;\n labelColor?: 'primary' | 'secondary' | 'inherit';\n /**\n * Cómo se manejan los paneles al cambiar de tab:\n * - `false` (default): **unmount** — solo se renderiza el panel activo; los\n * demás se desmontan. El state interno de los hijos se pierde al navegar.\n * Menor uso de memoria.\n * - `true`: **keep mounted** — renderiza todos los paneles pero oculta los\n * no activos con `display: none`. El state se preserva (inputs, scroll,\n * timers, subscripciones) al navegar entre tabs.\n */\n keepMounted?: boolean;\n}\n\nexport const Tabs: FC<TabsProps> = ({\n children,\n defaultValue,\n onChangeValue,\n centered = true,\n orientation = 'horizontal',\n scrollButtons = 'auto',\n variant = 'standard',\n indicatorColor = 'primary',\n labelColor = 'primary',\n className,\n allowScrollButtonsMobile = true,\n keepMounted = false,\n sx,\n}) => {\n // Filtra a solo <Tab> children — acepta arrays, single child, fragments,\n // y descarta cualquier otra cosa (strings, null, condicionales falsy).\n const tabs: ReactElement<TabProps>[] = Children.toArray(children).filter(\n (child): child is ReactElement<TabProps> =>\n isValidElement(child) &&\n (child.type as { displayName?: string })?.displayName === 'Tab',\n );\n\n const firstValue = tabs[0]?.props.value;\n const [currentValue, setCurrentValue] = useState<string | number>(\n defaultValue ?? firstValue ?? 0,\n );\n\n const handleChange = (_event: SyntheticEvent, newValue: number | string) => {\n setCurrentValue(newValue);\n onChangeValue?.(newValue);\n };\n\n const { display, flexDirection } = TAB_DISPLAY_MAP[orientation];\n\n return (\n <Box sx={{ display, flexDirection }}>\n <MuiTabs\n value={currentValue}\n onChange={handleChange}\n centered={centered}\n indicatorColor={indicatorColor}\n orientation={orientation}\n scrollButtons={scrollButtons}\n variant={variant}\n className={className}\n textColor={labelColor}\n allowScrollButtonsMobile={allowScrollButtonsMobile}\n sx={mergeSx({}, sx)}\n >\n {tabs.map((tab, idx) => {\n const {\n label,\n icon,\n value = idx,\n disabled,\n wrapped,\n iconPosition,\n className: tabClassName,\n sx: tabSx,\n } = tab.props;\n return (\n <MuiTab\n key={value}\n label={label}\n icon={icon}\n value={value}\n disabled={disabled}\n wrapped={wrapped}\n iconPosition={iconPosition}\n className={tabClassName}\n sx={tabSx}\n />\n );\n })}\n </MuiTabs>\n\n <Box m={2} sx={{ width: '100%' }}>\n {keepMounted\n ? tabs.map((tab, idx) => {\n const value = tab.props.value ?? idx;\n const isActive = value === currentValue;\n return (\n <Box\n key={value}\n role=\"tabpanel\"\n // `display: none` mantiene el nodo en el DOM — state de los\n // hijos (inputs, useState, etc.) no se pierde al navegar.\n sx={{ display: isActive ? 'block' : 'none' }}\n aria-hidden={!isActive}\n >\n {tab.props.children}\n </Box>\n );\n })\n : tabs.map((tab, idx) => {\n const value = tab.props.value ?? idx;\n if (value !== currentValue) return null;\n return (\n <Box key={value} role=\"tabpanel\">\n {tab.props.children}\n </Box>\n );\n })}\n </Box>\n </Box>\n );\n};\n\nexport default Tabs;\n","import React from \"react\";\nimport { TabProps as MuiTabProps } from \"@mui/material\";\n\ntype PickMuiTabProps = Pick<\n MuiTabProps,\n \"label\" | \"icon\" | \"disabled\" | \"sx\" | \"value\" | \"wrapped\" | \"iconPosition\" | \"className\" | \"disabled\"| 'disableRipple'\n>;\n\nexport interface TabProps extends PickMuiTabProps {\n value?: number;\n onChange?: () => void;\n children?: React.ReactNode;\n}\n\nexport const Tab = (_: TabProps): null => null;\n\nTab.displayName = \"Tab\";\n\nexport default Tab;\n"],"names":["_a","MuiTabs","MuiTab"],"mappings":";;;;AAAO,MAAM,kBAAiG;AAAA,EAC5G,YAAY,EAAE,SAAS,QAAQ,eAAe,SAAA;AAAA,EAC9C,UAAU,EAAE,SAAS,QAAQ,eAAe,MAAA;AAC9C;ACkDO,MAAM,OAAsB,CAAC;AAAA,EAClC;AAAA,EACA;AAAA,EACA;AAAA,EACA,WAAW;AAAA,EACX,cAAc;AAAA,EACd,gBAAgB;AAAA,EAChB,UAAU;AAAA,EACV,iBAAiB;AAAA,EACjB,aAAa;AAAA,EACb;AAAA,EACA,2BAA2B;AAAA,EAC3B,cAAc;AAAA,EACd;AACF,MAAM;;AAGJ,QAAM,OAAiC,SAAS,QAAQ,QAAQ,EAAE;AAAA,IAChE,CAAC,UAAA;;AACC,4BAAe,KAAK,OACnBA,MAAA,MAAM,SAAN,gBAAAA,IAAyC,iBAAgB;AAAA;AAAA,EAAA;AAG9D,QAAM,cAAa,UAAK,CAAC,MAAN,mBAAS,MAAM;AAClC,QAAM,CAAC,cAAc,eAAe,IAAI;AAAA,KACtC,2CAAgB,eAAhB,YAA8B;AAAA,EAAA;AAGhC,QAAM,eAAe,CAAC,QAAwB,aAA8B;AAC1E,oBAAgB,QAAQ;AACxB,mDAAgB;AAAA,EAClB;AAEA,QAAM,EAAE,SAAS,kBAAkB,gBAAgB,WAAW;AAE9D,8BACG,KAAA,EAAI,IAAI,EAAE,SAAS,iBAClB,UAAA;AAAA,IAAA;AAAA,MAACC;AAAAA,MAAA;AAAA,QACC,OAAO;AAAA,QACP,UAAU;AAAA,QACV;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA,WAAW;AAAA,QACX;AAAA,QACA,IAAI,QAAQ,CAAA,GAAI,EAAE;AAAA,QAEjB,UAAA,KAAK,IAAI,CAAC,KAAK,QAAQ;AACtB,gBAAM;AAAA,YACJ;AAAA,YACA;AAAA,YACA,QAAQ;AAAA,YACR;AAAA,YACA;AAAA,YACA;AAAA,YACA,WAAW;AAAA,YACX,IAAI;AAAA,UAAA,IACF,IAAI;AACR,iBACE;AAAA,YAACC;AAAAA,YAAA;AAAA,cAEC;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,cACA,WAAW;AAAA,cACX,IAAI;AAAA,YAAA;AAAA,YARC;AAAA,UAAA;AAAA,QAWX,CAAC;AAAA,MAAA;AAAA,IAAA;AAAA,IAGH,oBAAC,KAAA,EAAI,GAAG,GAAG,IAAI,EAAE,OAAO,OAAA,GACrB,UAAA,cACG,KAAK,IAAI,CAAC,KAAK,QAAQ;;AACrB,YAAM,SAAQF,MAAA,IAAI,MAAM,UAAV,OAAAA,MAAmB;AACjC,YAAM,WAAW,UAAU;AAC3B,aACE;AAAA,QAAC;AAAA,QAAA;AAAA,UAEC,MAAK;AAAA,UAGL,IAAI,EAAE,SAAS,WAAW,UAAU,OAAA;AAAA,UACpC,eAAa,CAAC;AAAA,UAEb,cAAI,MAAM;AAAA,QAAA;AAAA,QAPN;AAAA,MAAA;AAAA,IAUX,CAAC,IACD,KAAK,IAAI,CAAC,KAAK,QAAQ;;AACrB,YAAM,SAAQA,MAAA,IAAI,MAAM,UAAV,OAAAA,MAAmB;AACjC,UAAI,UAAU,aAAc,QAAO;AACnC,iCACG,KAAA,EAAgB,MAAK,YACnB,UAAA,IAAI,MAAM,YADH,KAEV;AAAA,IAEJ,CAAC,EAAA,CACP;AAAA,EAAA,GACF;AAEJ;AClJO,MAAM,MAAM,CAAC,MAAsB;AAE1C,IAAI,cAAc;"}
@@ -1,2 +1,4 @@
1
- export { default as Tabs } from './Tabs';
2
- export { default as Tab } from './Tab';
1
+ export { Tabs, default } from './Tabs';
2
+ export type { TabsProps } from './Tabs';
3
+ export { Tab } from './Tab';
4
+ export type { TabProps } from './Tab';
@@ -1,2 +1,6 @@
1
1
  export * from './Tabs/index'
2
2
  export {}
3
+ import _default from './Tabs/index'
4
+ export default _default
5
+ export * from './Tabs/index'
6
+ export {}
@@ -15,7 +15,7 @@ var __spreadValues = (a, b) => {
15
15
  }
16
16
  return a;
17
17
  };
18
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
18
+ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
19
19
  const jsxRuntime = require("react/jsx-runtime");
20
20
  const React = require("react");
21
21
  const MuiTimeline = require("@mui/lab/Timeline");
@@ -59,7 +59,7 @@ const Timeline = ({ children, position = "right", sx }) => {
59
59
  (child, idx) => {
60
60
  var _a;
61
61
  return React__namespace.isValidElement(child) ? React__namespace.cloneElement(child, {
62
- connectorColor: idx < count - 1 ? (_a = child.props.connectorColor) != null ? _a : "gray.main" : void 0
62
+ connectorColor: idx < count - 1 ? (_a = child.props.connectorColor) != null ? _a : "grey" : void 0
63
63
  }) : null;
64
64
  }
65
65
  )
@@ -82,4 +82,5 @@ const TimelineItem = ({
82
82
  };
83
83
  exports.Timeline = Timeline;
84
84
  exports.TimelineItem = TimelineItem;
85
+ exports.default = Timeline;
85
86
  //# sourceMappingURL=Timeline.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"Timeline.cjs","sources":["../../../src/components/Timeline/Timeline.tsx","../../../src/components/Timeline/TimelineItem.tsx"],"sourcesContent":["import * as React from \"react\";\nimport MuiTimeline from \"@mui/lab/Timeline\";\nimport { timelineContentClasses } from \"@mui/lab/TimelineContent\";\nimport { timelineItemClasses, TimelineItemProps as MuiTimelineItemProps } from \"@mui/lab/TimelineItem\";\nimport { Box } from \"@mui/material\";\n\ninterface TimelineItemProps extends MuiTimelineItemProps {\n connectorColor?: string;\n sx?: object;\n}\n\ninterface TimelineProps {\n children: React.ReactElement<TimelineItemProps>[];\n position?: \"left\" | \"right\" | 'alternate' | 'alternate-reverse' ;\n sx?: object;\n}\n\nexport const Timeline: React.FC<TimelineProps> = ({ children, position = \"right\", sx }) => {\n const count = React.Children.count(children);\n\n const customSx = (position === \"left\" || position === \"right\")\n ? {\n [`& .${timelineItemClasses.root}:before`]: {\n flex: 0,\n padding: 0,\n },\n ...sx,\n }\n : sx;\n \n return (\n <MuiTimeline position={position}\n sx={{...customSx}}\n >\n {React.Children.map(children, (child, idx) =>\n React.isValidElement(child)\n ? React.cloneElement(child, {\n connectorColor: idx < count - 1\n ? child.props.connectorColor ?? 'gray.main'\n : undefined,\n })\n : null\n )}\n </MuiTimeline>\n\n );\n};\n\nexport default Timeline;","\nimport MuiTimelineItem from \"@mui/lab/TimelineItem\";\nimport MuiTimelineSeparator from \"@mui/lab/TimelineSeparator\";\nimport MuiTimelineConnector from \"@mui/lab/TimelineConnector\";\nimport MuiTimelineContent from \"@mui/lab/TimelineContent\";\nimport MuiTimelineDot from \"@mui/lab/TimelineDot\";\n\nexport interface TimelineItemProps {\n dotColor?: 'primary' | 'secondary' | 'grey' | 'inherit' | 'success' | 'error' | 'info' | 'warning';\n connectorColor?: 'success' | 'error' | 'info' | 'warning' | 'primary' | 'secondary' | 'grey';\n children: React.ReactNode;\n}\n\nexport const TimelineItem: React.FC<TimelineItemProps> = ({\n dotColor = 'grey',\n connectorColor,\n children\n}) => {\n const color = connectorColor ? `${connectorColor}.main` : 'secondary.main';\n return (\n <MuiTimelineItem>\n <MuiTimelineSeparator>\n <MuiTimelineDot color={dotColor} />\n {connectorColor !== undefined && <MuiTimelineConnector sx={{ bgcolor: color }} />}\n </MuiTimelineSeparator>\n <MuiTimelineContent>{children}</MuiTimelineContent>\n </MuiTimelineItem>\n );\n};\n\nexport default TimelineItem"],"names":["React","timelineItemClasses","jsx","jsxs"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiBO,MAAM,WAAoC,CAAC,EAAE,UAAU,WAAW,SAAS,SAAS;AACzF,QAAM,QAAQA,iBAAM,SAAS,MAAM,QAAQ;AAEzC,QAAM,WAAY,aAAa,UAAU,aAAa,UACpD;AAAA,IACE,CAAC,MAAMC,gBAAAA,oBAAoB,IAAI,SAAS,GAAG;AAAA,MACzC,MAAM;AAAA,MACN,SAAS;AAAA,IAAA;AAAA,KAER,MAEL;AAEJ,SACEC,2BAAAA;AAAAA,IAAC;AAAA,IAAA;AAAA,MAAY;AAAA,MACX,IAAI,mBAAI;AAAA,MAEP,2BAAM,SAAS;AAAA,QAAI;AAAA,QAAU,CAAC,OAAO,QAAA;;AACpCF,kCAAM,eAAe,KAAK,IACtBA,iBAAM,aAAa,OAAO;AAAA,YAC1B,gBAAgB,MAAM,QAAQ,KAC1B,WAAM,MAAM,mBAAZ,YAA8B,cAC9B;AAAA,UAAA,CACL,IACC;AAAA;AAAA,MAAA;AAAA,IACN;AAAA,EAAA;AAIN;ACjCO,MAAM,eAA4C,CAAC;AAAA,EACxD,WAAW;AAAA,EACX;AAAA,EACA;AACF,MAAM;AACJ,QAAM,QAAQ,iBAAiB,GAAG,cAAc,UAAU;AAC1D,yCACG,iBAAA,EACC,UAAA;AAAA,IAAAG,gCAAC,sBAAA,EACC,UAAA;AAAA,MAAAD,2BAAAA,IAAC,gBAAA,EAAe,OAAO,SAAA,CAAU;AAAA,MAChC,mBAAmB,UAAaA,2BAAAA,IAAC,sBAAA,EAAqB,IAAI,EAAE,SAAS,QAAM,CAAG;AAAA,IAAA,GACjF;AAAA,IACAA,+BAAC,sBAAoB,SAAA,CAAS;AAAA,EAAA,GAChC;AAEJ;;;"}
1
+ {"version":3,"file":"Timeline.cjs","sources":["../../../src/components/Timeline/Timeline.tsx","../../../src/components/Timeline/TimelineItem.tsx"],"sourcesContent":["import * as React from 'react';\nimport MuiTimeline from '@mui/lab/Timeline';\nimport { timelineItemClasses } from '@mui/lab/TimelineItem';\n\nimport type { TimelineItemProps } from './TimelineItem';\n\nexport interface TimelineProps {\n children: React.ReactElement<TimelineItemProps>[];\n position?: 'left' | 'right' | 'alternate' | 'alternate-reverse';\n sx?: object;\n}\n\nexport const Timeline: React.FC<TimelineProps> = ({ children, position = \"right\", sx }) => {\n const count = React.Children.count(children);\n\n const customSx = (position === \"left\" || position === \"right\")\n ? {\n [`& .${timelineItemClasses.root}:before`]: {\n flex: 0,\n padding: 0,\n },\n ...sx,\n }\n : sx;\n \n return (\n <MuiTimeline position={position}\n sx={{...customSx}}\n >\n {React.Children.map(children, (child, idx) =>\n React.isValidElement(child)\n ? React.cloneElement(child, {\n connectorColor: idx < count - 1\n ? child.props.connectorColor ?? 'grey'\n : undefined,\n })\n : null\n )}\n </MuiTimeline>\n\n );\n};\n\nexport default Timeline;","\nimport MuiTimelineItem from \"@mui/lab/TimelineItem\";\nimport MuiTimelineSeparator from \"@mui/lab/TimelineSeparator\";\nimport MuiTimelineConnector from \"@mui/lab/TimelineConnector\";\nimport MuiTimelineContent from \"@mui/lab/TimelineContent\";\nimport MuiTimelineDot from \"@mui/lab/TimelineDot\";\n\nexport interface TimelineItemProps {\n dotColor?: 'primary' | 'secondary' | 'grey' | 'inherit' | 'success' | 'error' | 'info' | 'warning';\n connectorColor?: 'success' | 'error' | 'info' | 'warning' | 'primary' | 'secondary' | 'grey';\n children: React.ReactNode;\n}\n\nexport const TimelineItem: React.FC<TimelineItemProps> = ({\n dotColor = 'grey',\n connectorColor,\n children\n}) => {\n const color = connectorColor ? `${connectorColor}.main` : 'secondary.main';\n return (\n <MuiTimelineItem>\n <MuiTimelineSeparator>\n <MuiTimelineDot color={dotColor} />\n {connectorColor !== undefined && <MuiTimelineConnector sx={{ bgcolor: color }} />}\n </MuiTimelineSeparator>\n <MuiTimelineContent>{children}</MuiTimelineContent>\n </MuiTimelineItem>\n );\n};\n\nexport default TimelineItem"],"names":["React","timelineItemClasses","jsx","jsxs"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAYO,MAAM,WAAoC,CAAC,EAAE,UAAU,WAAW,SAAS,SAAS;AACzF,QAAM,QAAQA,iBAAM,SAAS,MAAM,QAAQ;AAEzC,QAAM,WAAY,aAAa,UAAU,aAAa,UACpD;AAAA,IACE,CAAC,MAAMC,gBAAAA,oBAAoB,IAAI,SAAS,GAAG;AAAA,MACzC,MAAM;AAAA,MACN,SAAS;AAAA,IAAA;AAAA,KAER,MAEL;AAEJ,SACEC,2BAAAA;AAAAA,IAAC;AAAA,IAAA;AAAA,MAAY;AAAA,MACX,IAAI,mBAAI;AAAA,MAEP,2BAAM,SAAS;AAAA,QAAI;AAAA,QAAU,CAAC,OAAO,QAAA;;AACpCF,kCAAM,eAAe,KAAK,IACtBA,iBAAM,aAAa,OAAO;AAAA,YAC1B,gBAAgB,MAAM,QAAQ,KAC1B,WAAM,MAAM,mBAAZ,YAA8B,SAC9B;AAAA,UAAA,CACL,IACC;AAAA;AAAA,MAAA;AAAA,IACN;AAAA,EAAA;AAIN;AC5BO,MAAM,eAA4C,CAAC;AAAA,EACxD,WAAW;AAAA,EACX;AAAA,EACA;AACF,MAAM;AACJ,QAAM,QAAQ,iBAAiB,GAAG,cAAc,UAAU;AAC1D,yCACG,iBAAA,EACC,UAAA;AAAA,IAAAG,gCAAC,sBAAA,EACC,UAAA;AAAA,MAAAD,2BAAAA,IAAC,gBAAA,EAAe,OAAO,SAAA,CAAU;AAAA,MAChC,mBAAmB,UAAaA,2BAAAA,IAAC,sBAAA,EAAqB,IAAI,EAAE,SAAS,QAAM,CAAG;AAAA,IAAA,GACjF;AAAA,IACAA,+BAAC,sBAAoB,SAAA,CAAS;AAAA,EAAA,GAChC;AAEJ;;;;"}
@@ -1,12 +1,8 @@
1
- import { TimelineItemProps as MuiTimelineItemProps } from '@mui/lab/TimelineItem';
2
- import * as React from "react";
3
- interface TimelineItemProps extends MuiTimelineItemProps {
4
- connectorColor?: string;
5
- sx?: object;
6
- }
7
- interface TimelineProps {
1
+ import { TimelineItemProps } from './TimelineItem';
2
+ import * as React from 'react';
3
+ export interface TimelineProps {
8
4
  children: React.ReactElement<TimelineItemProps>[];
9
- position?: "left" | "right" | 'alternate' | 'alternate-reverse';
5
+ position?: 'left' | 'right' | 'alternate' | 'alternate-reverse';
10
6
  sx?: object;
11
7
  }
12
8
  export declare const Timeline: React.FC<TimelineProps>;
@@ -40,7 +40,7 @@ const Timeline = ({ children, position = "right", sx }) => {
40
40
  (child, idx) => {
41
41
  var _a;
42
42
  return React.isValidElement(child) ? React.cloneElement(child, {
43
- connectorColor: idx < count - 1 ? (_a = child.props.connectorColor) != null ? _a : "gray.main" : void 0
43
+ connectorColor: idx < count - 1 ? (_a = child.props.connectorColor) != null ? _a : "grey" : void 0
44
44
  }) : null;
45
45
  }
46
46
  )
@@ -63,6 +63,7 @@ const TimelineItem = ({
63
63
  };
64
64
  export {
65
65
  Timeline,
66
- TimelineItem
66
+ TimelineItem,
67
+ Timeline as default
67
68
  };
68
69
  //# sourceMappingURL=Timeline.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Timeline.js","sources":["../../../src/components/Timeline/Timeline.tsx","../../../src/components/Timeline/TimelineItem.tsx"],"sourcesContent":["import * as React from \"react\";\nimport MuiTimeline from \"@mui/lab/Timeline\";\nimport { timelineContentClasses } from \"@mui/lab/TimelineContent\";\nimport { timelineItemClasses, TimelineItemProps as MuiTimelineItemProps } from \"@mui/lab/TimelineItem\";\nimport { Box } from \"@mui/material\";\n\ninterface TimelineItemProps extends MuiTimelineItemProps {\n connectorColor?: string;\n sx?: object;\n}\n\ninterface TimelineProps {\n children: React.ReactElement<TimelineItemProps>[];\n position?: \"left\" | \"right\" | 'alternate' | 'alternate-reverse' ;\n sx?: object;\n}\n\nexport const Timeline: React.FC<TimelineProps> = ({ children, position = \"right\", sx }) => {\n const count = React.Children.count(children);\n\n const customSx = (position === \"left\" || position === \"right\")\n ? {\n [`& .${timelineItemClasses.root}:before`]: {\n flex: 0,\n padding: 0,\n },\n ...sx,\n }\n : sx;\n \n return (\n <MuiTimeline position={position}\n sx={{...customSx}}\n >\n {React.Children.map(children, (child, idx) =>\n React.isValidElement(child)\n ? React.cloneElement(child, {\n connectorColor: idx < count - 1\n ? child.props.connectorColor ?? 'gray.main'\n : undefined,\n })\n : null\n )}\n </MuiTimeline>\n\n );\n};\n\nexport default Timeline;","\nimport MuiTimelineItem from \"@mui/lab/TimelineItem\";\nimport MuiTimelineSeparator from \"@mui/lab/TimelineSeparator\";\nimport MuiTimelineConnector from \"@mui/lab/TimelineConnector\";\nimport MuiTimelineContent from \"@mui/lab/TimelineContent\";\nimport MuiTimelineDot from \"@mui/lab/TimelineDot\";\n\nexport interface TimelineItemProps {\n dotColor?: 'primary' | 'secondary' | 'grey' | 'inherit' | 'success' | 'error' | 'info' | 'warning';\n connectorColor?: 'success' | 'error' | 'info' | 'warning' | 'primary' | 'secondary' | 'grey';\n children: React.ReactNode;\n}\n\nexport const TimelineItem: React.FC<TimelineItemProps> = ({\n dotColor = 'grey',\n connectorColor,\n children\n}) => {\n const color = connectorColor ? `${connectorColor}.main` : 'secondary.main';\n return (\n <MuiTimelineItem>\n <MuiTimelineSeparator>\n <MuiTimelineDot color={dotColor} />\n {connectorColor !== undefined && <MuiTimelineConnector sx={{ bgcolor: color }} />}\n </MuiTimelineSeparator>\n <MuiTimelineContent>{children}</MuiTimelineContent>\n </MuiTimelineItem>\n );\n};\n\nexport default TimelineItem"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAiBO,MAAM,WAAoC,CAAC,EAAE,UAAU,WAAW,SAAS,SAAS;AACzF,QAAM,QAAQ,MAAM,SAAS,MAAM,QAAQ;AAEzC,QAAM,WAAY,aAAa,UAAU,aAAa,UACpD;AAAA,IACE,CAAC,MAAM,oBAAoB,IAAI,SAAS,GAAG;AAAA,MACzC,MAAM;AAAA,MACN,SAAS;AAAA,IAAA;AAAA,KAER,MAEL;AAEJ,SACE;AAAA,IAAC;AAAA,IAAA;AAAA,MAAY;AAAA,MACX,IAAI,mBAAI;AAAA,MAEP,gBAAM,SAAS;AAAA,QAAI;AAAA,QAAU,CAAC,OAAO,QAAA;;AACpC,uBAAM,eAAe,KAAK,IACtB,MAAM,aAAa,OAAO;AAAA,YAC1B,gBAAgB,MAAM,QAAQ,KAC1B,WAAM,MAAM,mBAAZ,YAA8B,cAC9B;AAAA,UAAA,CACL,IACC;AAAA;AAAA,MAAA;AAAA,IACN;AAAA,EAAA;AAIN;ACjCO,MAAM,eAA4C,CAAC;AAAA,EACxD,WAAW;AAAA,EACX;AAAA,EACA;AACF,MAAM;AACJ,QAAM,QAAQ,iBAAiB,GAAG,cAAc,UAAU;AAC1D,8BACG,iBAAA,EACC,UAAA;AAAA,IAAA,qBAAC,sBAAA,EACC,UAAA;AAAA,MAAA,oBAAC,gBAAA,EAAe,OAAO,SAAA,CAAU;AAAA,MAChC,mBAAmB,UAAa,oBAAC,sBAAA,EAAqB,IAAI,EAAE,SAAS,QAAM,CAAG;AAAA,IAAA,GACjF;AAAA,IACA,oBAAC,sBAAoB,SAAA,CAAS;AAAA,EAAA,GAChC;AAEJ;"}
1
+ {"version":3,"file":"Timeline.js","sources":["../../../src/components/Timeline/Timeline.tsx","../../../src/components/Timeline/TimelineItem.tsx"],"sourcesContent":["import * as React from 'react';\nimport MuiTimeline from '@mui/lab/Timeline';\nimport { timelineItemClasses } from '@mui/lab/TimelineItem';\n\nimport type { TimelineItemProps } from './TimelineItem';\n\nexport interface TimelineProps {\n children: React.ReactElement<TimelineItemProps>[];\n position?: 'left' | 'right' | 'alternate' | 'alternate-reverse';\n sx?: object;\n}\n\nexport const Timeline: React.FC<TimelineProps> = ({ children, position = \"right\", sx }) => {\n const count = React.Children.count(children);\n\n const customSx = (position === \"left\" || position === \"right\")\n ? {\n [`& .${timelineItemClasses.root}:before`]: {\n flex: 0,\n padding: 0,\n },\n ...sx,\n }\n : sx;\n \n return (\n <MuiTimeline position={position}\n sx={{...customSx}}\n >\n {React.Children.map(children, (child, idx) =>\n React.isValidElement(child)\n ? React.cloneElement(child, {\n connectorColor: idx < count - 1\n ? child.props.connectorColor ?? 'grey'\n : undefined,\n })\n : null\n )}\n </MuiTimeline>\n\n );\n};\n\nexport default Timeline;","\nimport MuiTimelineItem from \"@mui/lab/TimelineItem\";\nimport MuiTimelineSeparator from \"@mui/lab/TimelineSeparator\";\nimport MuiTimelineConnector from \"@mui/lab/TimelineConnector\";\nimport MuiTimelineContent from \"@mui/lab/TimelineContent\";\nimport MuiTimelineDot from \"@mui/lab/TimelineDot\";\n\nexport interface TimelineItemProps {\n dotColor?: 'primary' | 'secondary' | 'grey' | 'inherit' | 'success' | 'error' | 'info' | 'warning';\n connectorColor?: 'success' | 'error' | 'info' | 'warning' | 'primary' | 'secondary' | 'grey';\n children: React.ReactNode;\n}\n\nexport const TimelineItem: React.FC<TimelineItemProps> = ({\n dotColor = 'grey',\n connectorColor,\n children\n}) => {\n const color = connectorColor ? `${connectorColor}.main` : 'secondary.main';\n return (\n <MuiTimelineItem>\n <MuiTimelineSeparator>\n <MuiTimelineDot color={dotColor} />\n {connectorColor !== undefined && <MuiTimelineConnector sx={{ bgcolor: color }} />}\n </MuiTimelineSeparator>\n <MuiTimelineContent>{children}</MuiTimelineContent>\n </MuiTimelineItem>\n );\n};\n\nexport default TimelineItem"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAYO,MAAM,WAAoC,CAAC,EAAE,UAAU,WAAW,SAAS,SAAS;AACzF,QAAM,QAAQ,MAAM,SAAS,MAAM,QAAQ;AAEzC,QAAM,WAAY,aAAa,UAAU,aAAa,UACpD;AAAA,IACE,CAAC,MAAM,oBAAoB,IAAI,SAAS,GAAG;AAAA,MACzC,MAAM;AAAA,MACN,SAAS;AAAA,IAAA;AAAA,KAER,MAEL;AAEJ,SACE;AAAA,IAAC;AAAA,IAAA;AAAA,MAAY;AAAA,MACX,IAAI,mBAAI;AAAA,MAEP,gBAAM,SAAS;AAAA,QAAI;AAAA,QAAU,CAAC,OAAO,QAAA;;AACpC,uBAAM,eAAe,KAAK,IACtB,MAAM,aAAa,OAAO;AAAA,YAC1B,gBAAgB,MAAM,QAAQ,KAC1B,WAAM,MAAM,mBAAZ,YAA8B,SAC9B;AAAA,UAAA,CACL,IACC;AAAA;AAAA,MAAA;AAAA,IACN;AAAA,EAAA;AAIN;AC5BO,MAAM,eAA4C,CAAC;AAAA,EACxD,WAAW;AAAA,EACX;AAAA,EACA;AACF,MAAM;AACJ,QAAM,QAAQ,iBAAiB,GAAG,cAAc,UAAU;AAC1D,8BACG,iBAAA,EACC,UAAA;AAAA,IAAA,qBAAC,sBAAA,EACC,UAAA;AAAA,MAAA,oBAAC,gBAAA,EAAe,OAAO,SAAA,CAAU;AAAA,MAChC,mBAAmB,UAAa,oBAAC,sBAAA,EAAqB,IAAI,EAAE,SAAS,QAAM,CAAG;AAAA,IAAA,GACjF;AAAA,IACA,oBAAC,sBAAoB,SAAA,CAAS;AAAA,EAAA,GAChC;AAEJ;"}
@@ -1,2 +1,4 @@
1
- export { default as Timeline } from './Timeline';
2
- export { default as TimelineItem } from './TimelineItem';
1
+ export { Timeline, default } from './Timeline';
2
+ export type { TimelineProps } from './Timeline';
3
+ export { TimelineItem } from './TimelineItem';
4
+ export type { TimelineItemProps } from './TimelineItem';
@@ -1,2 +1,6 @@
1
1
  export * from './Timeline/index'
2
2
  export {}
3
+ import _default from './Timeline/index'
4
+ export default _default
5
+ export * from './Timeline/index'
6
+ export {}
@@ -0,0 +1,33 @@
1
+ import { SxProps, Theme } from '@mui/material/styles';
2
+ export type LabelPosition = 'outside' | 'floating';
3
+ export interface BuildFormFieldSxOptions {
4
+ borderRadius: number | string;
5
+ labelPosition: LabelPosition;
6
+ /**
7
+ * Si es `true`, los selectores incluyen también la API nueva de MUI X
8
+ * Pickers (v8): `MuiPickersInputBase-root`, `MuiPickersOutlinedInput-*`.
9
+ */
10
+ includePickersApi?: boolean;
11
+ /**
12
+ * Selectores/valores extra que se mergean SOLO cuando labelPosition === 'outside'.
13
+ * Usar para paddings específicos del componente (p.ej. MuiAutocomplete-input).
14
+ */
15
+ extraOutsideSx?: Record<string, any>;
16
+ /**
17
+ * Selectores/valores extra que se mergean SOLO cuando labelPosition === 'floating'.
18
+ */
19
+ extraFloatingSx?: Record<string, any>;
20
+ }
21
+ /**
22
+ * Builder del sx compartido por todos los campos de formulario
23
+ * (Input/Select/Autocomplete/DatePicker/DateTimePicker).
24
+ *
25
+ * Produce:
26
+ * - en modo "floating": sólo el border-radius del outlined input;
27
+ * - en modo "outside": todo el pack (margen superior, label flotante afuera,
28
+ * input base, notched outline oculto, helper text sin margen izquierdo).
29
+ *
30
+ * Componentes con paddings o selectores propios pueden inyectarlos vía
31
+ * `extraOutsideSx` / `extraFloatingSx`.
32
+ */
33
+ export declare const buildFormFieldSx: ({ borderRadius, labelPosition, includePickersApi, extraOutsideSx, extraFloatingSx, }: BuildFormFieldSxOptions) => SxProps<Theme>;
@@ -0,0 +1,7 @@
1
+ import { SxProps, Theme } from '@mui/material/styles';
2
+ /**
3
+ * Merge helper para props `sx` de MUI. Acepta formatos objeto o array y
4
+ * devuelve un array combinado. El `extra` se aplica después del `base` —
5
+ * el consumer puede pisar los defaults del componente.
6
+ */
7
+ export declare const mergeSx: (base: SxProps<Theme>, extra?: SxProps<Theme>) => SxProps<Theme>;
@@ -0,0 +1,18 @@
1
+ import { SxProps, Theme } from '@mui/material/styles';
2
+ import { LibraryComponentName } from '../../theme/componentStyles';
3
+ /**
4
+ * Nombre del preset built-in del paquete. No se registra en el theme: si un
5
+ * componente recibe `preset="default"` (o no recibe preset), sólo aplica el
6
+ * estilo base de fábrica.
7
+ */
8
+ export declare const DEFAULT_PRESET_NAME = "default";
9
+ /**
10
+ * Resuelve el sx de un preset registrado en `theme.styles[componentName]`.
11
+ *
12
+ * - Si `presetName` es `"default"` o `undefined`, devuelve `undefined`
13
+ * (caller sólo aplicará el estilo base del paquete).
14
+ * - Si la entrada en el theme es una función `(theme) => sx`, se ejecuta.
15
+ * - Si la entrada no existe, devuelve `undefined` silenciosamente (no se
16
+ * rompe el componente — la responsabilidad de registrarlo es del consumer).
17
+ */
18
+ export declare function resolvePreset(componentName: LibraryComponentName, presetName: string | undefined, theme: Theme): SxProps<Theme> | undefined;
@@ -0,0 +1,68 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
3
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
4
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
5
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6
+ var __spreadValues = (a, b) => {
7
+ for (var prop in b || (b = {}))
8
+ if (__hasOwnProp.call(b, prop))
9
+ __defNormalProp(a, prop, b[prop]);
10
+ if (__getOwnPropSymbols)
11
+ for (var prop of __getOwnPropSymbols(b)) {
12
+ if (__propIsEnum.call(b, prop))
13
+ __defNormalProp(a, prop, b[prop]);
14
+ }
15
+ return a;
16
+ };
17
+ import { a as LABEL_COLOR_FOCUSED, b as LABEL_FONT_WEIGHT_FILLED, c as LABEL_COLOR_FILLED, d as LABEL_TRANSFORM_ORIGIN, e as LABEL_SHRINK_TRANSFORM, f as LABEL_TRANSITION, g as LABEL_COLOR_REST, L as LABEL_MARGIN_TOP } from "./tokens-BRrcP_p_.js";
18
+ const toRadius = (borderRadius) => typeof borderRadius === "number" ? `${borderRadius}px` : borderRadius;
19
+ const buildFormFieldSx = ({
20
+ borderRadius,
21
+ labelPosition,
22
+ includePickersApi = false,
23
+ extraOutsideSx,
24
+ extraFloatingSx
25
+ }) => {
26
+ const radius = toRadius(borderRadius);
27
+ const outlinedRootSelector = includePickersApi ? "& .MuiOutlinedInput-root, & .MuiPickersOutlinedInput-root" : "& .MuiOutlinedInput-root";
28
+ const inputBaseSelector = includePickersApi ? "& .MuiInputBase-root, & .MuiPickersInputBase-root" : "& .MuiInputBase-root";
29
+ const notchedOutlineSelector = includePickersApi ? "& .MuiOutlinedInput-notchedOutline, & .MuiPickersOutlinedInput-notchedOutline" : "& .MuiOutlinedInput-notchedOutline";
30
+ if (labelPosition === "floating") {
31
+ return __spreadValues({
32
+ [outlinedRootSelector]: { borderRadius: radius }
33
+ }, extraFloatingSx != null ? extraFloatingSx : {});
34
+ }
35
+ return __spreadValues({
36
+ marginTop: LABEL_MARGIN_TOP,
37
+ "& .MuiInputLabel-root": {
38
+ color: LABEL_COLOR_REST,
39
+ transition: LABEL_TRANSITION,
40
+ // Estado shrunk (focused o con valor): flota ARRIBA del input.
41
+ "&.MuiInputLabel-shrink": {
42
+ transform: LABEL_SHRINK_TRANSFORM,
43
+ transformOrigin: LABEL_TRANSFORM_ORIGIN,
44
+ color: LABEL_COLOR_FILLED,
45
+ fontWeight: LABEL_FONT_WEIGHT_FILLED
46
+ },
47
+ "&.Mui-focused": { color: LABEL_COLOR_FOCUSED }
48
+ },
49
+ // Input base — centra verticalmente (clásico y, si aplica, pickers).
50
+ [inputBaseSelector]: {
51
+ borderRadius: radius,
52
+ display: "flex",
53
+ alignItems: "center"
54
+ },
55
+ // El label flota afuera: ocultar legend del notch.
56
+ [notchedOutlineSelector]: {
57
+ top: 0,
58
+ "& legend": { display: "none" }
59
+ },
60
+ "& .MuiFormHelperText-root": {
61
+ marginLeft: 0
62
+ }
63
+ }, extraOutsideSx != null ? extraOutsideSx : {});
64
+ };
65
+ export {
66
+ buildFormFieldSx as b
67
+ };
68
+ //# sourceMappingURL=formField.sx-8_QRnKxv.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formField.sx-8_QRnKxv.js","sources":["../src/components/_shared/formField.sx.ts"],"sourcesContent":["import type { SxProps, Theme } from '@mui/material/styles';\n\nimport {\n LABEL_COLOR_FILLED,\n LABEL_COLOR_FOCUSED,\n LABEL_COLOR_REST,\n LABEL_FONT_WEIGHT_FILLED,\n LABEL_MARGIN_TOP,\n LABEL_SHRINK_TRANSFORM,\n LABEL_TRANSFORM_ORIGIN,\n LABEL_TRANSITION,\n} from '../../theme/tokens';\n\nexport type LabelPosition = 'outside' | 'floating';\n\nexport interface BuildFormFieldSxOptions {\n borderRadius: number | string;\n labelPosition: LabelPosition;\n /**\n * Si es `true`, los selectores incluyen también la API nueva de MUI X\n * Pickers (v8): `MuiPickersInputBase-root`, `MuiPickersOutlinedInput-*`.\n */\n includePickersApi?: boolean;\n /**\n * Selectores/valores extra que se mergean SOLO cuando labelPosition === 'outside'.\n * Usar para paddings específicos del componente (p.ej. MuiAutocomplete-input).\n */\n extraOutsideSx?: Record<string, any>;\n /**\n * Selectores/valores extra que se mergean SOLO cuando labelPosition === 'floating'.\n */\n extraFloatingSx?: Record<string, any>;\n}\n\nconst toRadius = (borderRadius: number | string) =>\n typeof borderRadius === 'number' ? `${borderRadius}px` : borderRadius;\n\n/**\n * Builder del sx compartido por todos los campos de formulario\n * (Input/Select/Autocomplete/DatePicker/DateTimePicker).\n *\n * Produce:\n * - en modo \"floating\": sólo el border-radius del outlined input;\n * - en modo \"outside\": todo el pack (margen superior, label flotante afuera,\n * input base, notched outline oculto, helper text sin margen izquierdo).\n *\n * Componentes con paddings o selectores propios pueden inyectarlos vía\n * `extraOutsideSx` / `extraFloatingSx`.\n */\nexport const buildFormFieldSx = ({\n borderRadius,\n labelPosition,\n includePickersApi = false,\n extraOutsideSx,\n extraFloatingSx,\n}: BuildFormFieldSxOptions): SxProps<Theme> => {\n const radius = toRadius(borderRadius);\n\n // ── Selectores (alternan según la API de pickers) ────────────────────\n const outlinedRootSelector = includePickersApi\n ? '& .MuiOutlinedInput-root, & .MuiPickersOutlinedInput-root'\n : '& .MuiOutlinedInput-root';\n\n const inputBaseSelector = includePickersApi\n ? '& .MuiInputBase-root, & .MuiPickersInputBase-root'\n : '& .MuiInputBase-root';\n\n const notchedOutlineSelector = includePickersApi\n ? '& .MuiOutlinedInput-notchedOutline, & .MuiPickersOutlinedInput-notchedOutline'\n : '& .MuiOutlinedInput-notchedOutline';\n\n // ── Floating ─────────────────────────────────────────────────────────\n if (labelPosition === 'floating') {\n return {\n [outlinedRootSelector]: { borderRadius: radius },\n ...(extraFloatingSx ?? {}),\n };\n }\n\n // ── Outside ──────────────────────────────────────────────────────────\n return {\n marginTop: LABEL_MARGIN_TOP,\n\n '& .MuiInputLabel-root': {\n color: LABEL_COLOR_REST,\n transition: LABEL_TRANSITION,\n\n // Estado shrunk (focused o con valor): flota ARRIBA del input.\n '&.MuiInputLabel-shrink': {\n transform: LABEL_SHRINK_TRANSFORM,\n transformOrigin: LABEL_TRANSFORM_ORIGIN,\n color: LABEL_COLOR_FILLED,\n fontWeight: LABEL_FONT_WEIGHT_FILLED,\n },\n\n '&.Mui-focused': { color: LABEL_COLOR_FOCUSED },\n },\n\n // Input base — centra verticalmente (clásico y, si aplica, pickers).\n [inputBaseSelector]: {\n borderRadius: radius,\n display: 'flex',\n alignItems: 'center',\n },\n\n // El label flota afuera: ocultar legend del notch.\n [notchedOutlineSelector]: {\n top: 0,\n '& legend': { display: 'none' },\n },\n\n '& .MuiFormHelperText-root': {\n marginLeft: 0,\n },\n\n ...(extraOutsideSx ?? {}),\n };\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAkCA,MAAM,WAAW,CAAC,iBAChB,OAAO,iBAAiB,WAAW,GAAG,YAAY,OAAO;AAcpD,MAAM,mBAAmB,CAAC;AAAA,EAC/B;AAAA,EACA;AAAA,EACA,oBAAoB;AAAA,EACpB;AAAA,EACA;AACF,MAA+C;AAC7C,QAAM,SAAS,SAAS,YAAY;AAGpC,QAAM,uBAAuB,oBACzB,8DACA;AAEJ,QAAM,oBAAoB,oBACtB,sDACA;AAEJ,QAAM,yBAAyB,oBAC3B,kFACA;AAGJ,MAAI,kBAAkB,YAAY;AAChC,WAAO;AAAA,MACL,CAAC,oBAAoB,GAAG,EAAE,cAAc,OAAA;AAAA,OACpC,4CAAmB,CAAA;AAAA,EAE3B;AAGA,SAAO;AAAA,IACL,WAAW;AAAA,IAEX,yBAAyB;AAAA,MACvB,OAAO;AAAA,MACP,YAAY;AAAA;AAAA,MAGZ,0BAA0B;AAAA,QACxB,WAAW;AAAA,QACX,iBAAiB;AAAA,QACjB,OAAO;AAAA,QACP,YAAY;AAAA,MAAA;AAAA,MAGd,iBAAiB,EAAE,OAAO,oBAAA;AAAA,IAAoB;AAAA;AAAA,IAIhD,CAAC,iBAAiB,GAAG;AAAA,MACnB,cAAc;AAAA,MACd,SAAS;AAAA,MACT,YAAY;AAAA,IAAA;AAAA;AAAA,IAId,CAAC,sBAAsB,GAAG;AAAA,MACxB,KAAK;AAAA,MACL,YAAY,EAAE,SAAS,OAAA;AAAA,IAAO;AAAA,IAGhC,6BAA6B;AAAA,MAC3B,YAAY;AAAA,IAAA;AAAA,KAGV,0CAAkB,CAAA;AAE1B;"}
@@ -0,0 +1,67 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
6
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7
+ var __spreadValues = (a, b) => {
8
+ for (var prop in b || (b = {}))
9
+ if (__hasOwnProp.call(b, prop))
10
+ __defNormalProp(a, prop, b[prop]);
11
+ if (__getOwnPropSymbols)
12
+ for (var prop of __getOwnPropSymbols(b)) {
13
+ if (__propIsEnum.call(b, prop))
14
+ __defNormalProp(a, prop, b[prop]);
15
+ }
16
+ return a;
17
+ };
18
+ const tokens = require("./tokens-jaWWNk39.cjs");
19
+ const toRadius = (borderRadius) => typeof borderRadius === "number" ? `${borderRadius}px` : borderRadius;
20
+ const buildFormFieldSx = ({
21
+ borderRadius,
22
+ labelPosition,
23
+ includePickersApi = false,
24
+ extraOutsideSx,
25
+ extraFloatingSx
26
+ }) => {
27
+ const radius = toRadius(borderRadius);
28
+ const outlinedRootSelector = includePickersApi ? "& .MuiOutlinedInput-root, & .MuiPickersOutlinedInput-root" : "& .MuiOutlinedInput-root";
29
+ const inputBaseSelector = includePickersApi ? "& .MuiInputBase-root, & .MuiPickersInputBase-root" : "& .MuiInputBase-root";
30
+ const notchedOutlineSelector = includePickersApi ? "& .MuiOutlinedInput-notchedOutline, & .MuiPickersOutlinedInput-notchedOutline" : "& .MuiOutlinedInput-notchedOutline";
31
+ if (labelPosition === "floating") {
32
+ return __spreadValues({
33
+ [outlinedRootSelector]: { borderRadius: radius }
34
+ }, extraFloatingSx != null ? extraFloatingSx : {});
35
+ }
36
+ return __spreadValues({
37
+ marginTop: tokens.LABEL_MARGIN_TOP,
38
+ "& .MuiInputLabel-root": {
39
+ color: tokens.LABEL_COLOR_REST,
40
+ transition: tokens.LABEL_TRANSITION,
41
+ // Estado shrunk (focused o con valor): flota ARRIBA del input.
42
+ "&.MuiInputLabel-shrink": {
43
+ transform: tokens.LABEL_SHRINK_TRANSFORM,
44
+ transformOrigin: tokens.LABEL_TRANSFORM_ORIGIN,
45
+ color: tokens.LABEL_COLOR_FILLED,
46
+ fontWeight: tokens.LABEL_FONT_WEIGHT_FILLED
47
+ },
48
+ "&.Mui-focused": { color: tokens.LABEL_COLOR_FOCUSED }
49
+ },
50
+ // Input base — centra verticalmente (clásico y, si aplica, pickers).
51
+ [inputBaseSelector]: {
52
+ borderRadius: radius,
53
+ display: "flex",
54
+ alignItems: "center"
55
+ },
56
+ // El label flota afuera: ocultar legend del notch.
57
+ [notchedOutlineSelector]: {
58
+ top: 0,
59
+ "& legend": { display: "none" }
60
+ },
61
+ "& .MuiFormHelperText-root": {
62
+ marginLeft: 0
63
+ }
64
+ }, extraOutsideSx != null ? extraOutsideSx : {});
65
+ };
66
+ exports.buildFormFieldSx = buildFormFieldSx;
67
+ //# sourceMappingURL=formField.sx-BAX7KwMR.cjs.map