@apia/theme 3.0.1 → 3.0.2

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 (278) hide show
  1. package/dist/{markdown/html.js → html-B-K0BIiw.js} +1 -1
  2. package/dist/html-B-K0BIiw.js.map +1 -0
  3. package/dist/index-YQcMmPq6.js +5682 -0
  4. package/dist/index-YQcMmPq6.js.map +1 -0
  5. package/dist/index.d.ts +581 -30
  6. package/dist/index.js +8 -23
  7. package/dist/index.js.map +1 -1
  8. package/dist/{markdown/theme/markdownTheme.js → styles-BzChuFms.js} +67 -2
  9. package/dist/styles-BzChuFms.js.map +1 -0
  10. package/jsx-runtime/dist/jsx-runtime.d.ts +3 -3
  11. package/jsx-runtime/dist/theme-ui-jsx-runtime.browser.esm.js +2 -2
  12. package/jsx-runtime/dist/theme-ui-jsx-runtime.cjs.d.ts +2 -2
  13. package/jsx-runtime/dist/theme-ui-jsx-runtime.cjs.d.ts.map +1 -1
  14. package/jsx-runtime/dist/theme-ui-jsx-runtime.cjs.dev.js +21 -21
  15. package/jsx-runtime/dist/theme-ui-jsx-runtime.cjs.js +7 -7
  16. package/jsx-runtime/dist/theme-ui-jsx-runtime.cjs.prod.js +21 -21
  17. package/jsx-runtime/dist/theme-ui-jsx-runtime.esm.js +2 -2
  18. package/jsx-runtime/dist/theme-ui-jsx-runtime.worker.esm.js +2 -2
  19. package/jsx-runtime/package.json +8 -8
  20. package/package.json +2 -2
  21. package/dist/ApiaThemeProvider.d.ts +0 -15
  22. package/dist/ApiaThemeProvider.d.ts.map +0 -1
  23. package/dist/ApiaThemeProvider.js +0 -32
  24. package/dist/ApiaThemeProvider.js.map +0 -1
  25. package/dist/base/alerts.js +0 -128
  26. package/dist/base/alerts.js.map +0 -1
  27. package/dist/base/baseTheme.js +0 -93
  28. package/dist/base/baseTheme.js.map +0 -1
  29. package/dist/base/buttons.js +0 -294
  30. package/dist/base/buttons.js.map +0 -1
  31. package/dist/base/colors/components.js +0 -202
  32. package/dist/base/colors/components.js.map +0 -1
  33. package/dist/base/colors/defaultPalette.js +0 -84
  34. package/dist/base/colors/defaultPalette.js.map +0 -1
  35. package/dist/base/colors/index.js +0 -465
  36. package/dist/base/colors/index.js.map +0 -1
  37. package/dist/base/colors/schemas.js +0 -15
  38. package/dist/base/colors/schemas.js.map +0 -1
  39. package/dist/base/colors/types.d.ts +0 -154
  40. package/dist/base/colors/types.d.ts.map +0 -1
  41. package/dist/base/colors/types.js +0 -6
  42. package/dist/base/colors/types.js.map +0 -1
  43. package/dist/base/colors/util/applyStates.js +0 -35
  44. package/dist/base/colors/util/applyStates.js.map +0 -1
  45. package/dist/base/colors/util/applyStatesGetColor.d.ts +0 -11
  46. package/dist/base/colors/util/applyStatesGetColor.d.ts.map +0 -1
  47. package/dist/base/colors/util/applyStatesGetColor.js +0 -31
  48. package/dist/base/colors/util/applyStatesGetColor.js.map +0 -1
  49. package/dist/base/colors/util/buildColorsObject.js +0 -14
  50. package/dist/base/colors/util/buildColorsObject.js.map +0 -1
  51. package/dist/base/colors/util/buildStateObject.js +0 -60
  52. package/dist/base/colors/util/buildStateObject.js.map +0 -1
  53. package/dist/base/colors/util/getColorState.d.ts +0 -17
  54. package/dist/base/colors/util/getColorState.d.ts.map +0 -1
  55. package/dist/base/colors/util/getColorState.js +0 -52
  56. package/dist/base/colors/util/getColorState.js.map +0 -1
  57. package/dist/base/colors/util/getColorStates.d.ts +0 -11
  58. package/dist/base/colors/util/getColorStates.d.ts.map +0 -1
  59. package/dist/base/colors/util/getColorStates.js +0 -30
  60. package/dist/base/colors/util/getColorStates.js.map +0 -1
  61. package/dist/base/colors/util/getColorsAndStatesByDefinition.d.ts +0 -12
  62. package/dist/base/colors/util/getColorsAndStatesByDefinition.d.ts.map +0 -1
  63. package/dist/base/colors/util/getColorsAndStatesByDefinition.js +0 -28
  64. package/dist/base/colors/util/getColorsAndStatesByDefinition.js.map +0 -1
  65. package/dist/base/colors/util/getColorsAndStatesByPath.d.ts +0 -25
  66. package/dist/base/colors/util/getColorsAndStatesByPath.d.ts.map +0 -1
  67. package/dist/base/colors/util/getColorsAndStatesByPath.js +0 -36
  68. package/dist/base/colors/util/getColorsAndStatesByPath.js.map +0 -1
  69. package/dist/base/colors/util/getColorsByDefinition.d.ts +0 -24
  70. package/dist/base/colors/util/getColorsByDefinition.d.ts.map +0 -1
  71. package/dist/base/colors/util/getColorsByDefinition.js +0 -18
  72. package/dist/base/colors/util/getColorsByDefinition.js.map +0 -1
  73. package/dist/base/colors/util/getColorsByPath.d.ts +0 -17
  74. package/dist/base/colors/util/getColorsByPath.d.ts.map +0 -1
  75. package/dist/base/colors/util/getColorsByPath.js +0 -16
  76. package/dist/base/colors/util/getColorsByPath.js.map +0 -1
  77. package/dist/base/colors/util/getOneColorState.d.ts +0 -15
  78. package/dist/base/colors/util/getOneColorState.d.ts.map +0 -1
  79. package/dist/base/colors/util/getOneColorState.js +0 -18
  80. package/dist/base/colors/util/getOneColorState.js.map +0 -1
  81. package/dist/base/colors/util/parsePalette.d.ts +0 -6
  82. package/dist/base/colors/util/parsePalette.d.ts.map +0 -1
  83. package/dist/base/colors/util/parsePalette.js +0 -124
  84. package/dist/base/colors/util/parsePalette.js.map +0 -1
  85. package/dist/base/colors/util.js +0 -31
  86. package/dist/base/colors/util.js.map +0 -1
  87. package/dist/base/forms/checkbox.js +0 -59
  88. package/dist/base/forms/checkbox.js.map +0 -1
  89. package/dist/base/forms/customCheckbox.js +0 -30
  90. package/dist/base/forms/customCheckbox.js.map +0 -1
  91. package/dist/base/forms/dateInput.js +0 -60
  92. package/dist/base/forms/dateInput.js.map +0 -1
  93. package/dist/base/forms/deletableInput.js +0 -65
  94. package/dist/base/forms/deletableInput.js.map +0 -1
  95. package/dist/base/forms/iconInput.js +0 -28
  96. package/dist/base/forms/iconInput.js.map +0 -1
  97. package/dist/base/forms/index.js +0 -36
  98. package/dist/base/forms/index.js.map +0 -1
  99. package/dist/base/forms/input.js +0 -52
  100. package/dist/base/forms/input.js.map +0 -1
  101. package/dist/base/forms/label.js +0 -31
  102. package/dist/base/forms/label.js.map +0 -1
  103. package/dist/base/forms/radio.js +0 -17
  104. package/dist/base/forms/radio.js.map +0 -1
  105. package/dist/base/forms/select.js +0 -27
  106. package/dist/base/forms/select.js.map +0 -1
  107. package/dist/base/forms/selectMultiple.js +0 -40
  108. package/dist/base/forms/selectMultiple.js.map +0 -1
  109. package/dist/base/forms/switch.js +0 -12
  110. package/dist/base/forms/switch.js.map +0 -1
  111. package/dist/base/forms/textarea.js +0 -14
  112. package/dist/base/forms/textarea.js.map +0 -1
  113. package/dist/base/layout/common/components/accordion.js +0 -124
  114. package/dist/base/layout/common/components/accordion.js.map +0 -1
  115. package/dist/base/layout/common/components/chat.js +0 -98
  116. package/dist/base/layout/common/components/chat.js.map +0 -1
  117. package/dist/base/layout/common/components/index.js +0 -15
  118. package/dist/base/layout/common/components/index.js.map +0 -1
  119. package/dist/base/layout/common/components/pagination/common.js +0 -135
  120. package/dist/base/layout/common/components/pagination/common.js.map +0 -1
  121. package/dist/base/layout/common/components/pagination/datagrid.js +0 -9
  122. package/dist/base/layout/common/components/pagination/datagrid.js.map +0 -1
  123. package/dist/base/layout/common/components/pagination/index.js +0 -13
  124. package/dist/base/layout/common/components/pagination/index.js.map +0 -1
  125. package/dist/base/layout/common/components/pagination/primary.js +0 -9
  126. package/dist/base/layout/common/components/pagination/primary.js.map +0 -1
  127. package/dist/base/layout/common/components/pagination/secondary.js +0 -9
  128. package/dist/base/layout/common/components/pagination/secondary.js.map +0 -1
  129. package/dist/base/layout/common/components/toolbar.js +0 -84
  130. package/dist/base/layout/common/components/toolbar.js.map +0 -1
  131. package/dist/base/layout/common/forms/captcha.js +0 -42
  132. package/dist/base/layout/common/forms/captcha.js.map +0 -1
  133. package/dist/base/layout/common/forms/index.js +0 -9
  134. package/dist/base/layout/common/forms/index.js.map +0 -1
  135. package/dist/base/layout/common/index.js +0 -21
  136. package/dist/base/layout/common/index.js.map +0 -1
  137. package/dist/base/layout/common/modals/apiaApi.js +0 -86
  138. package/dist/base/layout/common/modals/apiaApi.js.map +0 -1
  139. package/dist/base/layout/common/modals/buttonsBar.js +0 -13
  140. package/dist/base/layout/common/modals/buttonsBar.js.map +0 -1
  141. package/dist/base/layout/common/modals/confirm.js +0 -35
  142. package/dist/base/layout/common/modals/confirm.js.map +0 -1
  143. package/dist/base/layout/common/modals/index.js +0 -166
  144. package/dist/base/layout/common/modals/index.js.map +0 -1
  145. package/dist/base/layout/common/modals/overlay.js +0 -29
  146. package/dist/base/layout/common/modals/overlay.js.map +0 -1
  147. package/dist/base/layout/common/tables/accordion.js +0 -66
  148. package/dist/base/layout/common/tables/accordion.js.map +0 -1
  149. package/dist/base/layout/common/tables/clean.js +0 -285
  150. package/dist/base/layout/common/tables/clean.js.map +0 -1
  151. package/dist/base/layout/common/tables/getSelectionStyles.js +0 -39
  152. package/dist/base/layout/common/tables/getSelectionStyles.js.map +0 -1
  153. package/dist/base/layout/common/tables/index.js +0 -23
  154. package/dist/base/layout/common/tables/index.js.map +0 -1
  155. package/dist/base/layout/common/tables/information.js +0 -41
  156. package/dist/base/layout/common/tables/information.js.map +0 -1
  157. package/dist/base/layout/common/tables/primary.js +0 -236
  158. package/dist/base/layout/common/tables/primary.js.map +0 -1
  159. package/dist/base/layout/common/tables/print.js +0 -11
  160. package/dist/base/layout/common/tables/print.js.map +0 -1
  161. package/dist/base/layout/common/tables/responsive.js +0 -41
  162. package/dist/base/layout/common/tables/responsive.js.map +0 -1
  163. package/dist/base/layout/common/tables/secondary.js +0 -46
  164. package/dist/base/layout/common/tables/secondary.js.map +0 -1
  165. package/dist/base/layout/common/tooltips/index.js +0 -9
  166. package/dist/base/layout/common/tooltips/index.js.map +0 -1
  167. package/dist/base/layout/common/tooltips/primary.js +0 -10
  168. package/dist/base/layout/common/tooltips/primary.js.map +0 -1
  169. package/dist/base/layout/common/trees/index.js +0 -8
  170. package/dist/base/layout/common/trees/index.js.map +0 -1
  171. package/dist/base/layout/common/trees/primary.js +0 -122
  172. package/dist/base/layout/common/trees/primary.js.map +0 -1
  173. package/dist/base/layout/index.js +0 -13
  174. package/dist/base/layout/index.js.map +0 -1
  175. package/dist/base/layout/util/collector.js +0 -30
  176. package/dist/base/layout/util/collector.js.map +0 -1
  177. package/dist/base/layout/util/index.js +0 -9
  178. package/dist/base/layout/util/index.js.map +0 -1
  179. package/dist/base/rootStyles/menu.js +0 -122
  180. package/dist/base/rootStyles/menu.js.map +0 -1
  181. package/dist/base/rootStyles/rootStyles.js +0 -152
  182. package/dist/base/rootStyles/rootStyles.js.map +0 -1
  183. package/dist/base/rootStyles/transitions.js +0 -88
  184. package/dist/base/rootStyles/transitions.js.map +0 -1
  185. package/dist/base/text.js +0 -24
  186. package/dist/base/text.js.map +0 -1
  187. package/dist/markdown/builder/MarkdownBuilder.d.ts +0 -40
  188. package/dist/markdown/builder/MarkdownBuilder.d.ts.map +0 -1
  189. package/dist/markdown/builder/MarkdownBuilder.js +0 -108
  190. package/dist/markdown/builder/MarkdownBuilder.js.map +0 -1
  191. package/dist/markdown/builder/elements/MarkdownBlock.d.ts +0 -9
  192. package/dist/markdown/builder/elements/MarkdownBlock.d.ts.map +0 -1
  193. package/dist/markdown/builder/elements/MarkdownBlock.js +0 -5
  194. package/dist/markdown/builder/elements/MarkdownBlock.js.map +0 -1
  195. package/dist/markdown/builder/elements/dialogBox.d.ts +0 -11
  196. package/dist/markdown/builder/elements/dialogBox.d.ts.map +0 -1
  197. package/dist/markdown/builder/elements/dialogBox.js +0 -23
  198. package/dist/markdown/builder/elements/dialogBox.js.map +0 -1
  199. package/dist/markdown/builder/elements/header.d.ts +0 -11
  200. package/dist/markdown/builder/elements/header.d.ts.map +0 -1
  201. package/dist/markdown/builder/elements/header.js +0 -15
  202. package/dist/markdown/builder/elements/header.js.map +0 -1
  203. package/dist/markdown/builder/elements/list.d.ts +0 -19
  204. package/dist/markdown/builder/elements/list.d.ts.map +0 -1
  205. package/dist/markdown/builder/elements/list.js +0 -55
  206. package/dist/markdown/builder/elements/list.js.map +0 -1
  207. package/dist/markdown/builder/elements/paragraph.d.ts +0 -10
  208. package/dist/markdown/builder/elements/paragraph.d.ts.map +0 -1
  209. package/dist/markdown/builder/elements/paragraph.js +0 -14
  210. package/dist/markdown/builder/elements/paragraph.js.map +0 -1
  211. package/dist/markdown/builder/elements/table.d.ts +0 -27
  212. package/dist/markdown/builder/elements/table.d.ts.map +0 -1
  213. package/dist/markdown/builder/elements/table.js +0 -156
  214. package/dist/markdown/builder/elements/table.js.map +0 -1
  215. package/dist/markdown/builder/elements/tableOfContents.d.ts +0 -32
  216. package/dist/markdown/builder/elements/tableOfContents.d.ts.map +0 -1
  217. package/dist/markdown/builder/elements/tableOfContents.js +0 -96
  218. package/dist/markdown/builder/elements/tableOfContents.js.map +0 -1
  219. package/dist/markdown/extensions/error.js +0 -38
  220. package/dist/markdown/extensions/error.js.map +0 -1
  221. package/dist/markdown/extensions/header.js +0 -45
  222. package/dist/markdown/extensions/header.js.map +0 -1
  223. package/dist/markdown/extensions/index.js +0 -16
  224. package/dist/markdown/extensions/index.js.map +0 -1
  225. package/dist/markdown/extensions/success.js +0 -38
  226. package/dist/markdown/extensions/success.js.map +0 -1
  227. package/dist/markdown/extensions/table/index.js +0 -227
  228. package/dist/markdown/extensions/table/index.js.map +0 -1
  229. package/dist/markdown/extensions/table/types.d.ts +0 -20
  230. package/dist/markdown/extensions/table/types.d.ts.map +0 -1
  231. package/dist/markdown/extensions/warning.js +0 -38
  232. package/dist/markdown/extensions/warning.js.map +0 -1
  233. package/dist/markdown/getRemarkable.js +0 -28
  234. package/dist/markdown/getRemarkable.js.map +0 -1
  235. package/dist/markdown/help.js +0 -28
  236. package/dist/markdown/help.js.map +0 -1
  237. package/dist/markdown/html.js.map +0 -1
  238. package/dist/markdown/parseMarkdown.d.ts +0 -10
  239. package/dist/markdown/parseMarkdown.d.ts.map +0 -1
  240. package/dist/markdown/parseMarkdown.js +0 -31
  241. package/dist/markdown/parseMarkdown.js.map +0 -1
  242. package/dist/markdown/styles.js +0 -55
  243. package/dist/markdown/styles.js.map +0 -1
  244. package/dist/markdown/theme/markdownTheme.js.map +0 -1
  245. package/dist/markdown/types.d.ts +0 -56
  246. package/dist/markdown/types.d.ts.map +0 -1
  247. package/dist/markdown/types.js +0 -5
  248. package/dist/markdown/types.js.map +0 -1
  249. package/dist/methods/CustomThemeProvider.js +0 -14
  250. package/dist/methods/CustomThemeProvider.js.map +0 -1
  251. package/dist/methods/getMainTheme.js +0 -30
  252. package/dist/methods/getMainTheme.js.map +0 -1
  253. package/dist/methods/injectStyles.d.ts +0 -34
  254. package/dist/methods/injectStyles.d.ts.map +0 -1
  255. package/dist/methods/injectStyles.js +0 -10
  256. package/dist/methods/injectStyles.js.map +0 -1
  257. package/dist/methods/makeStyledComponent.d.ts +0 -29
  258. package/dist/methods/makeStyledComponent.d.ts.map +0 -1
  259. package/dist/methods/makeStyledComponent.js +0 -39
  260. package/dist/methods/makeStyledComponent.js.map +0 -1
  261. package/dist/methods/spacingLayout/index.d.ts +0 -23
  262. package/dist/methods/spacingLayout/index.d.ts.map +0 -1
  263. package/dist/methods/spacingLayout/index.js +0 -29
  264. package/dist/methods/spacingLayout/index.js.map +0 -1
  265. package/dist/methods/useMainTheme.d.ts +0 -8
  266. package/dist/methods/useMainTheme.d.ts.map +0 -1
  267. package/dist/methods/useMainTheme.js +0 -45
  268. package/dist/methods/useMainTheme.js.map +0 -1
  269. package/dist/themeuiExports.d.ts +0 -7
  270. package/dist/themeuiExports.d.ts.map +0 -1
  271. package/dist/util/getVariant.d.ts +0 -7
  272. package/dist/util/getVariant.d.ts.map +0 -1
  273. package/dist/util/getVariant.js +0 -6
  274. package/dist/util/getVariant.js.map +0 -1
  275. package/dist/util.d.ts +0 -43
  276. package/dist/util.d.ts.map +0 -1
  277. package/dist/util.js +0 -34
  278. package/dist/util.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"styles.js","sources":["../../src/markdown/styles.ts"],"sourcesContent":["import { IMarkdownStylesAggregator, RemarkableExtension } from './types';\nimport { markdownTheme } from './theme/markdownTheme';\nimport { markdownExtensions } from './extensions';\n\nconst printStyles: IMarkdownStylesAggregator = () => `\n@media print {\n body {\n background: white;\n }\n\n #Container {\n border: none;\n margin: 0;\n width: auto;\n padding: 0;\n }\n}\n`;\n\nconst styles = (\n additionalStyles?: IMarkdownStylesAggregator,\n extensions?: RemarkableExtension[],\n) => {\n const generated = `\n${markdownTheme}\n\n#Container {\n display: flex;\n flex-direction: column;\n gap: var(--space-6);\n margin: var(--space-6) auto;\n width: 920px;\n\n & > * {\n margin: 0;\n }\n\n h1, h2, h3, h4, h5, h6 {\n margin: 0;\n }\n\n li > *:not(:first-child) {\n margin-top: var(--space-5);\n margin-bottom: var(--space-5);\n }\n}\n${printStyles()}\n\n${[...(extensions ?? []), ...markdownExtensions]\n .map((current) => current.styles())\n .join('\\n\\n')}\n\n${additionalStyles?.() ?? ''}\n`;\n\n return generated;\n};\n\nexport const markdownParserStyles = (\n additionalStyles?: IMarkdownStylesAggregator,\n extensions?: RemarkableExtension[],\n) => {\n return styles(additionalStyles, extensions);\n};\n"],"names":[],"mappings":";;;AAIA,MAAM,cAAyC,MAAM,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,CAAA,CAAA;AAerD,MAAM,MAAA,GAAS,CACb,gBAAA,EACA,UACG,KAAA;AACH,EAAA,MAAM,SAAY,GAAA,CAAA;AAAA,EAClB,aAAa,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAsBb,aAAa,CAAA;AAAA;AAAA,EAEb,CAAC,GAAI,UAAA,IAAc,EAAC,EAAI,GAAG,kBAAkB,CAAA,CAC5C,GAAI,CAAA,CAAC,YAAY,OAAQ,CAAA,MAAA,EAAQ,CACjC,CAAA,IAAA,CAAK,MAAM,CAAC,CAAA;AAAA;AAAA,EAEb,gBAAA,QAAwB,EAAE,CAAA;AAAA,CAAA,CAAA;AAG1B,EAAO,OAAA,SAAA,CAAA;AACT,CAAA,CAAA;AAEa,MAAA,oBAAA,GAAuB,CAClC,gBAAA,EACA,UACG,KAAA;AACH,EAAO,OAAA,MAAA,CAAO,kBAAkB,UAAU,CAAA,CAAA;AAC5C;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"markdownTheme.js","sources":["../../../src/markdown/theme/markdownTheme.ts"],"sourcesContent":["export const markdownTheme = `:root {\n --color-error-back: #fff2f4;\n --color-error-border: rgb(115, 7, 9);\n --color-error-text: var(--color-text-default);\n --color-warning-back: #fffdd9;\n --color-warning-border: rgb(244, 239, 64);\n --color-warning-text: var(--color-text-default);\n --color-success-back: #e7ffd9;\n --color-success-border: rgb(79, 205, 79);\n --color-success-text: var(--color-text-default);\n --color-primary: rgb(0, 73, 108);\n --color-primary-light: #f8fdff;\n --color-primary-contrast: white;\n --color-back-paper: white;\n --color-back-default: white;\n --color-border-field: #aaa;\n --color-border-section: #ddd;\n --color-text-default: #333;\n --color-text-disabled: #aaa;\n --color-text-heading: var(--color-primary);\n --font-size-h1: 32px;\n --font-size-h2: 28px;\n --font-size-h3: 25px;\n --font-size-h4: 21px;\n --font-size-h5: 18px;\n --font-size-h6: 16px;\n --font-size-default: 16px;\n --font-family-heading: Inter, system-ui, \"Segoe UI\", \"Helvetica Neue\", sans-serif, Roboto;\n --font-family-default: Inter, system-ui, \"Segoe UI\", \"Helvetica Neue\", sans-serif, Roboto;\n --font-family-monospace: monospace;\n --table-head-color-background: var(--color-primary);\n --table-head-color-text: var(--color-primary-contrast);\n --table-head-color-border: var(--color-primary);\n --table-head-border: 1px solid var(--table-head-color-border);\n --table-head-cell-padding: var(--space-4);\n --table-head-font-weight: bold;\n --table-head-text-align: center;\n --table-body-color-background: transparent;\n --table-body-color-background-odd: var(--color-primary-light);\n --table-body-color-text: inherit;\n --table-body-color-border: var(--color-border-section);\n --table-body-border: 1px solid var(--table-body-color-border);\n --table-body-cell-padding: var(--space-4);\n --table-color-background: var(--color-back-paper);\n --table-color-border: var(--color-border-section);\n --table-border: 1px solid var(--table-color-border);\n --table-border-collapse: collapse;\n --shadow-sheet: rgba(50, 50, 105, 0.15) 0px 2px 5px 0px, rgba(0, 0, 0, 0.05) 0px 1px 1px 0px;\n --space-0: 0;\n --space-1: 2px;\n --space-2: 4px;\n --space-3: 8px;\n --space-4: 12px;\n --space-5: 16px;\n --space-6: 24px;\n}\n\nhtml {\n margin: 0;\n font-size: var(--font-size-default);\n font-family: var(--font-family-default);\n color: var(--color-text-default);\n}\n\nbody {\n background: var(--color-back-default);\n margin: 0;\n}\n\npre, code {\n font-family: var(--font-family-monospace);\n}\n\nh1, h2, h3, h4, h5, h6 {\n font-family: var(--font-family-heading);\n color: var(--color-text-heading);\n}\n\nh1 {\n font-size: var(--font-size-h1);\n}\nh1:first-of-type {\n margin-top: 0;\n}\n\nh2 {\n font-size: var(--font-size-h2);\n}\n\nh3 {\n font-size: var(--font-size-h3);\n}\n\nh4 {\n font-size: var(--font-size-h4);\n}\n\nh5 {\n font-size: var(--font-size-h5);\n}\n\nh6 {\n font-size: var(--font-size-h6);\n}\n\na {\n color: var(--color-text-default);\n}\n\na:visited {\n color: var(--color-primary);\n}\n\ntable {\n border-collapse: var(--table-border-collapse);\n border: var(--table-border);\n width: 100%;\n}\ntable thead th, table thead td.heading, table tbody th, table tbody td.heading {\n background: var(--table-head-color-background);\n color: var(--table-head-color-text);\n border: var(--table-head-border);\n padding: var(--table-head-cell-padding);\n font-weight: var(--table-head-font-weight);\n text-align: var(--table-head-text-align);\n text-wrap: nowrap;\n}\ntable tbody td {\n background: var(--table-body-color-background);\n color: var(--table-body-color-text);\n border: var(--table-body-border);\n padding: var(--table-body-cell-padding);\n}\ntable tbody tr:nth-child(2n) td:not(.heading) {\n background: var(--table-body-color-background-odd);\n}\n\nimg {\n max-width: 100%;\n}`;\n"],"names":[],"mappings":"AAAO,MAAM,aAAgB,GAAA,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,CAAA;;;;"}
@@ -1,56 +0,0 @@
1
- import { StateInline, TagToken, StateBlock } from 'remarkable/lib';
2
- import { Remarkable } from 'remarkable';
3
-
4
- type IMarkdownHtml = (title: string, css: string, body: string) => string;
5
- type IMarkdownParser = (options: IMarkdownConfiguration) => Promise<string>;
6
- interface IMarkdownConfiguration {
7
- /**
8
- * Cadena de caracteres de CSS
9
- */
10
- additionalStyles?: IMarkdownStylesAggregator;
11
- /**
12
- * Permite agregar contenido al body del html generado.
13
- */
14
- additionalBodyContent?: Partial<{
15
- before: string;
16
- after: string;
17
- }>;
18
- /**
19
- * Contenido markdown
20
- */
21
- content: string;
22
- /**
23
- * Permite el pasaje de extensiones adicionales
24
- */
25
- extensions?: RemarkableExtension[];
26
- /**
27
- * Si el template html por defecto no es suficiente, se puede optar por un
28
- * template a medida.
29
- */
30
- htmlTemplate?: IMarkdownHtml;
31
- /**
32
- * If passed, will print the table of contents with the indicated title.
33
- */
34
- tableOfContentsTitle?: string;
35
- /**
36
- * Título que se mostrará en el html
37
- */
38
- title: string;
39
- }
40
- interface IRemarkableInlineExtension {
41
- name: string;
42
- parser: (state: StateInline, checkMode: boolean) => boolean;
43
- replacer: (md: Remarkable) => (tokens: TagToken[], idx: number) => string;
44
- styles: () => string;
45
- }
46
- interface IRemarkableBlockExtension {
47
- name: string;
48
- parser: (state: StateBlock, startLine: number, endLine: number, checkMode: boolean) => boolean;
49
- replacer: (md: Remarkable) => (tokens: TagToken[], idx: number) => string;
50
- styles: () => string;
51
- }
52
- type RemarkableExtension = IRemarkableInlineExtension | IRemarkableBlockExtension;
53
- type IMarkdownStylesAggregator = () => string;
54
-
55
- export type { IMarkdownConfiguration, IMarkdownHtml, IMarkdownParser, IMarkdownStylesAggregator, IRemarkableBlockExtension, IRemarkableInlineExtension, RemarkableExtension };
56
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,5 +0,0 @@
1
- class ErrorImporting {
2
- }
3
-
4
- export { ErrorImporting };
5
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sources":["../../src/markdown/types.ts"],"sourcesContent":["import type { StateBlock, StateInline, TagToken } from 'remarkable/lib';\nimport type { Remarkable } from 'remarkable';\n\n// eslint-disable-next-line @typescript-eslint/no-extraneous-class\nexport class ErrorImporting {}\n\nexport type IMarkdownHtml = (\n title: string,\n css: string,\n body: string,\n) => string;\n\nexport type IMarkdownParser = (\n options: IMarkdownConfiguration,\n) => Promise<string>;\n\nexport interface IMarkdownConfiguration {\n /**\n * Cadena de caracteres de CSS\n */\n additionalStyles?: IMarkdownStylesAggregator;\n /**\n * Permite agregar contenido al body del html generado.\n */\n additionalBodyContent?: Partial<{ before: string; after: string }>;\n /**\n * Contenido markdown\n */\n content: string;\n /**\n * Permite el pasaje de extensiones adicionales\n */\n extensions?: RemarkableExtension[];\n /**\n * Si el template html por defecto no es suficiente, se puede optar por un\n * template a medida.\n */\n htmlTemplate?: IMarkdownHtml;\n /**\n * If passed, will print the table of contents with the indicated title.\n */\n tableOfContentsTitle?: string;\n /**\n * Título que se mostrará en el html\n */\n title: string;\n}\n\nexport interface IRemarkableInlineExtension {\n name: string;\n parser: (state: StateInline, checkMode: boolean) => boolean;\n replacer: (md: Remarkable) => (tokens: TagToken[], idx: number) => string;\n styles: () => string;\n}\n\nexport interface IRemarkableBlockExtension {\n name: string;\n parser: (\n state: StateBlock,\n startLine: number,\n endLine: number,\n checkMode: boolean,\n ) => boolean;\n replacer: (md: Remarkable) => (tokens: TagToken[], idx: number) => string;\n styles: () => string;\n}\n\nexport type RemarkableExtension =\n | IRemarkableInlineExtension\n | IRemarkableBlockExtension;\n\nexport type IMarkdownStylesAggregator = () => string;\n"],"names":[],"mappings":"AAIO,MAAM,cAAe,CAAA;AAAC;;;;"}
@@ -1,14 +0,0 @@
1
- import { jsx } from 'theme-ui/jsx-runtime';
2
- import { ThemeUIProvider } from 'theme-ui';
3
- import { getMainTheme } from './getMainTheme.js';
4
-
5
- const CustomThemeProvider = ({
6
- children,
7
- customTheme
8
- }) => {
9
- const theme = getMainTheme(customTheme);
10
- return /* @__PURE__ */ jsx(ThemeUIProvider, { theme, children });
11
- };
12
-
13
- export { CustomThemeProvider };
14
- //# sourceMappingURL=CustomThemeProvider.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CustomThemeProvider.js","sources":["../../src/methods/CustomThemeProvider.tsx"],"sourcesContent":["import { ThemeUIProvider, Theme } from 'theme-ui';\nimport { ReactNode } from 'react';\nimport { getMainTheme } from './getMainTheme';\n\ninterface TThemeProvider {\n children: ReactNode;\n customTheme?: () => Theme;\n}\n\nexport const CustomThemeProvider = ({\n children,\n customTheme,\n}: TThemeProvider) => {\n const theme: Theme = getMainTheme(customTheme);\n\n return <ThemeUIProvider theme={theme}>{children}</ThemeUIProvider>;\n};\n"],"names":[],"mappings":";;;;AASO,MAAM,sBAAsB,CAAC;AAAA,EAClC,QAAA;AAAA,EACA,WAAA;AACF,CAAsB,KAAA;AACpB,EAAM,MAAA,KAAA,GAAe,aAAa,WAAW,CAAA,CAAA;AAE7C,EAAO,uBAAA,GAAA,CAAC,eAAgB,EAAA,EAAA,KAAA,EAAe,QAAS,EAAA,CAAA,CAAA;AAClD;;;;"}
@@ -1,30 +0,0 @@
1
- import merge from 'lodash-es/merge';
2
- import { baseTheme } from '../base/baseTheme.js';
3
- import { getThemeColorsObject } from '../base/colors/index.js';
4
- import defaultPalette from '../base/colors/defaultPalette.js';
5
- import forms from '../base/forms/index.js';
6
- import { layout } from '../base/layout/index.js';
7
- import parsePalette from '../base/colors/util/parsePalette.js';
8
-
9
- const makeTheme = (t) => {
10
- return t;
11
- };
12
- let declaredStyles = {};
13
- function getMainTheme(customTheme, customPalette, themeModifier) {
14
- const palette = parsePalette(merge({}, defaultPalette, customPalette));
15
- window.currentPalette = palette;
16
- const theme = makeTheme(
17
- merge(baseTheme(), { layout: declaredStyles }, customTheme?.() ?? {}, {
18
- palette: {}
19
- })
20
- );
21
- theme.palette = palette;
22
- theme.colors = getThemeColorsObject(theme);
23
- theme.forms = forms(theme);
24
- theme.layout = merge(layout(theme), theme.layout);
25
- theme.styles = merge({}, customTheme?.().styles, { root: theme.layout.root });
26
- return themeModifier?.(theme) ?? theme;
27
- }
28
-
29
- export { getMainTheme };
30
- //# sourceMappingURL=getMainTheme.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getMainTheme.js","sources":["../../src/methods/getMainTheme.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable @typescript-eslint/no-unsafe-argument */\nimport {\n ColorModesScale,\n Theme,\n ThemeUICSSObject,\n ThemeUIStyleObject,\n} from 'theme-ui';\nimport merge from 'lodash-es/merge';\nimport { setValueByPath } from '@apia/util';\nimport { baseTheme } from '../base/baseTheme';\nimport {\n TCustomPalette,\n TParsedPalette,\n TThemeModifier,\n} from '../base/colors/types';\nimport { getThemeColorsObject, parsePalette } from '../base/colors';\nimport defaultPalette from '../base/colors/defaultPalette';\nimport forms from '../base/forms';\nimport { layout } from '../base/layout';\n\nconst makeTheme = <T extends Theme>(t: T) => {\n return t;\n};\n\nlet declaredStyles: ThemeUICSSObject = {};\n\nexport function declareStyles(\n path: string,\n styles: ThemeUICSSObject | Record<string, ThemeUICSSObject>,\n) {\n const newStyles = {};\n setValueByPath(newStyles, path, styles);\n declaredStyles = merge(declaredStyles, newStyles);\n}\n\nexport function getMainTheme(\n customTheme?: () => Omit<Theme, 'palette'>,\n customPalette?: TCustomPalette,\n\n themeModifier?: TThemeModifier,\n) {\n const palette = parsePalette(merge({}, defaultPalette, customPalette));\n window.currentPalette = palette;\n\n const theme = makeTheme(\n merge(baseTheme(), { layout: declaredStyles }, customTheme?.() ?? {}, {\n palette: {} as TParsedPalette,\n }),\n );\n\n theme.palette = palette;\n\n theme.colors = getThemeColorsObject(theme) as unknown as ColorModesScale;\n theme.forms = forms(theme) as Record<string, ThemeUIStyleObject>;\n theme.layout = merge(layout(theme), theme.layout);\n\n theme.styles = merge({}, customTheme?.().styles, { root: theme.layout.root });\n\n return themeModifier?.(theme) ?? theme;\n}\n"],"names":[],"mappings":";;;;;;;;AAqBA,MAAM,SAAA,GAAY,CAAkB,CAAS,KAAA;AAC3C,EAAO,OAAA,CAAA,CAAA;AACT,CAAA,CAAA;AAEA,IAAI,iBAAmC,EAAC,CAAA;AAWxB,SAAA,YAAA,CACd,WACA,EAAA,aAAA,EAEA,aACA,EAAA;AACA,EAAA,MAAM,UAAU,YAAa,CAAA,KAAA,CAAM,EAAI,EAAA,cAAA,EAAgB,aAAa,CAAC,CAAA,CAAA;AACrE,EAAA,MAAA,CAAO,cAAiB,GAAA,OAAA,CAAA;AAExB,EAAA,MAAM,KAAQ,GAAA,SAAA;AAAA,IACZ,KAAA,CAAM,SAAU,EAAA,EAAG,EAAE,MAAA,EAAQ,gBAAkB,EAAA,WAAA,IAAmB,IAAA,EAAI,EAAA;AAAA,MACpE,SAAS,EAAC;AAAA,KACX,CAAA;AAAA,GACH,CAAA;AAEA,EAAA,KAAA,CAAM,OAAU,GAAA,OAAA,CAAA;AAEhB,EAAM,KAAA,CAAA,MAAA,GAAS,qBAAqB,KAAK,CAAA,CAAA;AACzC,EAAM,KAAA,CAAA,KAAA,GAAQ,MAAM,KAAK,CAAA,CAAA;AACzB,EAAA,KAAA,CAAM,SAAS,KAAM,CAAA,MAAA,CAAO,KAAK,CAAA,EAAG,MAAM,MAAM,CAAA,CAAA;AAEhD,EAAA,KAAA,CAAM,MAAS,GAAA,KAAA,CAAM,EAAC,EAAG,WAAc,IAAA,CAAE,MAAQ,EAAA,EAAE,IAAM,EAAA,KAAA,CAAM,MAAO,CAAA,IAAA,EAAM,CAAA,CAAA;AAE5E,EAAO,OAAA,aAAA,GAAgB,KAAK,CAAK,IAAA,KAAA,CAAA;AACnC;;;;"}
@@ -1,34 +0,0 @@
1
- import { ThemeUICSSObject } from 'theme-ui';
2
-
3
- /**
4
- * Esta función permite agregar estilos al tema principal de la aplicación, de
5
- * modo que estén disponibles para cualquier componente que lo requirea.
6
- *
7
- * @example
8
- *
9
- * injectStyles('buttons.myRedButton', {
10
- * variant: 'buttons.primary',
11
- * backgroundColor: 'red',
12
- * })
13
- */
14
- declare function injectStyles(path: string, styles: ThemeUICSSObject): void;
15
- /**
16
- * Esta función permite agregar estilos al tema principal de la aplicación, de
17
- * modo que estén disponibles para cualquier componente que lo requirea.
18
- *
19
- * @example
20
- *
21
- * injectStyles({
22
- * layout: {
23
- * panels: {
24
- * myPanel: {
25
- * ...
26
- * }
27
- * }
28
- * }
29
- * })
30
- */
31
- declare function injectStyles(styles: ThemeUICSSObject): void;
32
-
33
- export { injectStyles };
34
- //# sourceMappingURL=injectStyles.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"injectStyles.d.ts","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,10 +0,0 @@
1
- import { mainThemeEmitter } from './useMainTheme.js';
2
-
3
- function injectStyles(par1, par2) {
4
- const path = typeof par1 === "string" ? par1 : "";
5
- const styles = typeof par1 === "string" ? par2 : par1;
6
- mainThemeEmitter.emit("newStyles", { path, styles });
7
- }
8
-
9
- export { injectStyles };
10
- //# sourceMappingURL=injectStyles.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"injectStyles.js","sources":["../../src/methods/injectStyles.ts"],"sourcesContent":["import { ThemeUICSSObject } from 'theme-ui';\nimport { mainThemeEmitter } from './useMainTheme';\n\n/**\n * Esta función permite agregar estilos al tema principal de la aplicación, de\n * modo que estén disponibles para cualquier componente que lo requirea.\n *\n * @example\n *\n * injectStyles('buttons.myRedButton', {\n * variant: 'buttons.primary',\n * backgroundColor: 'red',\n * })\n */\nexport function injectStyles(path: string, styles: ThemeUICSSObject): void;\n\n/**\n * Esta función permite agregar estilos al tema principal de la aplicación, de\n * modo que estén disponibles para cualquier componente que lo requirea.\n *\n * @example\n *\n * injectStyles({\n * layout: {\n * panels: {\n * myPanel: {\n * ...\n * }\n * }\n * }\n * })\n */\nexport function injectStyles(styles: ThemeUICSSObject): void;\n\nexport function injectStyles(\n par1: string | ThemeUICSSObject,\n par2?: ThemeUICSSObject,\n) {\n const path = typeof par1 === 'string' ? par1 : '';\n const styles = typeof par1 === 'string' ? (par2 as ThemeUICSSObject) : par1;\n\n mainThemeEmitter.emit('newStyles', { path, styles });\n}\n"],"names":[],"mappings":";;AAkCgB,SAAA,YAAA,CACd,MACA,IACA,EAAA;AACA,EAAA,MAAM,IAAO,GAAA,OAAO,IAAS,KAAA,QAAA,GAAW,IAAO,GAAA,EAAA,CAAA;AAC/C,EAAA,MAAM,MAAS,GAAA,OAAO,IAAS,KAAA,QAAA,GAAY,IAA4B,GAAA,IAAA,CAAA;AAEvE,EAAA,gBAAA,CAAiB,IAAK,CAAA,WAAA,EAAa,EAAE,IAAA,EAAM,QAAQ,CAAA,CAAA;AACrD;;;;"}
@@ -1,29 +0,0 @@
1
- import * as react from 'react';
2
- import { FC } from 'react';
3
- import { ThemeUICSSObject } from 'theme-ui';
4
-
5
- /**
6
- * Permite crear un componente cuyos estilos pueden ser redefinidos por un
7
- * usuario final.
8
- *
9
- * Esto es así puesto que los estilos definidos serán agregados a un árbol que
10
- * el usuario puede consultar y sobreescribir. De esta manera los estilos
11
- * finales del componente serán aquellos definidos en este método pero
12
- * sobreescritos por los definidos por el usuario si es que existen.
13
- *
14
- * **Importante** Para aplicar la variante, se aplica un box alrededor del
15
- * componente que se está renderizando, con className="variant__holder". En caso
16
- * de que se quisiera evitar este comportamiento, se debe pasar unwraped = true
17
- *
18
- * @param displayName Este parámetro es importante para el debugger de React.
19
- * @param stylesPath La ruta donde se aplicarán los estilos, es importante asegurarse de que esa ruta ya no está siendo utilizada por otro componente.
20
- * @param styles Un objeto de estilos de ThemeUI
21
- * @param Component La definición del componente.
22
- * @returns Un componente reutilizable y exportable que tiene estilos aplicados.
23
- */
24
- declare function makeStyledComponent<T extends object>(displayName: string, stylesPath: string, styles: ThemeUICSSObject, Component: FC<T>, unwraped?: boolean): ((props: T) => react.JSX.Element) & {
25
- displayName: string;
26
- };
27
-
28
- export { makeStyledComponent };
29
- //# sourceMappingURL=makeStyledComponent.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"makeStyledComponent.d.ts","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,39 +0,0 @@
1
- import { jsx, Fragment } from 'theme-ui/jsx-runtime';
2
- import { setValueByPath } from '@apia/util';
3
- import { useRef, useMemo, Suspense } from 'react';
4
- import { useThemeUI, Box } from 'theme-ui';
5
- import { getVariant } from '../util/getVariant.js';
6
- import { CustomThemeProvider } from './CustomThemeProvider.js';
7
-
8
- function makeStyledComponent(displayName, stylesPath, styles, Component, unwraped = false) {
9
- return Object.assign(
10
- (props) => {
11
- const avoidFirstRender = useRef(0);
12
- const { theme: tuiTheme } = useThemeUI();
13
- const theme = useMemo(
14
- () => () => ({
15
- ...tuiTheme,
16
- ...setValueByPath({}, stylesPath, styles)
17
- }),
18
- [tuiTheme]
19
- );
20
- if (unwraped) {
21
- return /* @__PURE__ */ jsx(CustomThemeProvider, { customTheme: theme, children: /* @__PURE__ */ jsx(NoThemePrevent, { avoidFirstRender, children: /* @__PURE__ */ jsx(Suspense, { children: /* @__PURE__ */ jsx(Component, { ...props }) }) }) });
22
- }
23
- return /* @__PURE__ */ jsx(CustomThemeProvider, { customTheme: theme, children: /* @__PURE__ */ jsx(NoThemePrevent, { avoidFirstRender, children: /* @__PURE__ */ jsx(Box, { className: "variant__holder", ...getVariant(stylesPath), children: /* @__PURE__ */ jsx(Suspense, { children: /* @__PURE__ */ jsx(Component, { ...props }) }) }) }) });
24
- },
25
- { displayName }
26
- );
27
- }
28
- const NoThemePrevent = ({
29
- avoidFirstRender,
30
- children
31
- }) => {
32
- avoidFirstRender.current++;
33
- if (avoidFirstRender.current <= 1)
34
- return null;
35
- return /* @__PURE__ */ jsx(Fragment, { children });
36
- };
37
-
38
- export { makeStyledComponent };
39
- //# sourceMappingURL=makeStyledComponent.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"makeStyledComponent.js","sources":["../../src/methods/makeStyledComponent.tsx"],"sourcesContent":["import { setValueByPath } from '@apia/util';\nimport {\n FC,\n MutableRefObject,\n ReactNode,\n Suspense,\n useMemo,\n useRef,\n} from 'react';\nimport { ThemeUICSSObject, Box, useThemeUI } from 'theme-ui';\nimport { getVariant } from '../util/getVariant';\nimport { CustomThemeProvider } from './CustomThemeProvider';\n\n/**\n * Permite crear un componente cuyos estilos pueden ser redefinidos por un\n * usuario final.\n *\n * Esto es así puesto que los estilos definidos serán agregados a un árbol que\n * el usuario puede consultar y sobreescribir. De esta manera los estilos\n * finales del componente serán aquellos definidos en este método pero\n * sobreescritos por los definidos por el usuario si es que existen.\n *\n * **Importante** Para aplicar la variante, se aplica un box alrededor del\n * componente que se está renderizando, con className=\"variant__holder\". En caso\n * de que se quisiera evitar este comportamiento, se debe pasar unwraped = true\n *\n * @param displayName Este parámetro es importante para el debugger de React.\n * @param stylesPath La ruta donde se aplicarán los estilos, es importante asegurarse de que esa ruta ya no está siendo utilizada por otro componente.\n * @param styles Un objeto de estilos de ThemeUI\n * @param Component La definición del componente.\n * @returns Un componente reutilizable y exportable que tiene estilos aplicados.\n */\nexport function makeStyledComponent<T extends object>(\n displayName: string,\n stylesPath: string,\n styles: ThemeUICSSObject,\n Component: FC<T>,\n unwraped = false,\n) {\n return Object.assign(\n (props: T) => {\n const avoidFirstRender = useRef(0);\n const { theme: tuiTheme } = useThemeUI();\n const theme = useMemo(\n () => () => ({\n ...tuiTheme,\n ...setValueByPath({}, stylesPath, styles),\n }),\n [tuiTheme],\n );\n\n if (unwraped) {\n return (\n <CustomThemeProvider customTheme={theme}>\n <NoThemePrevent avoidFirstRender={avoidFirstRender}>\n <Suspense>\n <Component {...props} />\n </Suspense>\n </NoThemePrevent>\n </CustomThemeProvider>\n );\n }\n return (\n <CustomThemeProvider customTheme={theme}>\n <NoThemePrevent avoidFirstRender={avoidFirstRender}>\n <Box className=\"variant__holder\" {...getVariant(stylesPath)}>\n <Suspense>\n <Component {...props} />\n </Suspense>\n </Box>\n </NoThemePrevent>\n </CustomThemeProvider>\n );\n },\n { displayName },\n );\n}\n\nconst NoThemePrevent = ({\n avoidFirstRender,\n children,\n}: {\n avoidFirstRender: MutableRefObject<number>;\n children: ReactNode;\n}) => {\n // eslint-disable-next-line no-param-reassign\n avoidFirstRender.current++;\n\n if (avoidFirstRender.current <= 1) return null;\n\n return <>{children}</>;\n};\n"],"names":[],"mappings":";;;;;;;AAgCO,SAAS,oBACd,WACA,EAAA,UAAA,EACA,MACA,EAAA,SAAA,EACA,WAAW,KACX,EAAA;AACA,EAAA,OAAO,MAAO,CAAA,MAAA;AAAA,IACZ,CAAC,KAAa,KAAA;AACZ,MAAM,MAAA,gBAAA,GAAmB,OAAO,CAAC,CAAA,CAAA;AACjC,MAAA,MAAM,EAAE,KAAA,EAAO,QAAS,EAAA,GAAI,UAAW,EAAA,CAAA;AACvC,MAAA,MAAM,KAAQ,GAAA,OAAA;AAAA,QACZ,MAAM,OAAO;AAAA,UACX,GAAG,QAAA;AAAA,UACH,GAAG,cAAA,CAAe,EAAC,EAAG,YAAY,MAAM,CAAA;AAAA,SAC1C,CAAA;AAAA,QACA,CAAC,QAAQ,CAAA;AAAA,OACX,CAAA;AAEA,MAAA,IAAI,QAAU,EAAA;AACZ,QAAA,uBACG,GAAA,CAAA,mBAAA,EAAA,EAAoB,WAAa,EAAA,KAAA,EAChC,8BAAC,cAAe,EAAA,EAAA,gBAAA,EACd,QAAC,kBAAA,GAAA,CAAA,QAAA,EAAA,EACC,8BAAC,SAAW,EAAA,EAAA,GAAG,KAAO,EAAA,CAAA,EACxB,GACF,CACF,EAAA,CAAA,CAAA;AAAA,OAEJ;AACA,MACE,uBAAA,GAAA,CAAC,mBAAoB,EAAA,EAAA,WAAA,EAAa,KAChC,EAAA,QAAA,kBAAA,GAAA,CAAC,kBAAe,gBACd,EAAA,QAAA,kBAAA,GAAA,CAAC,GAAI,EAAA,EAAA,SAAA,EAAU,iBAAmB,EAAA,GAAG,WAAW,UAAU,CAAA,EACxD,QAAC,kBAAA,GAAA,CAAA,QAAA,EAAA,EACC,QAAC,kBAAA,GAAA,CAAA,SAAA,EAAA,EAAW,GAAG,KAAO,EAAA,CAAA,EACxB,CACF,EAAA,CAAA,EACF,CACF,EAAA,CAAA,CAAA;AAAA,KAEJ;AAAA,IACA,EAAE,WAAY,EAAA;AAAA,GAChB,CAAA;AACF,CAAA;AAEA,MAAM,iBAAiB,CAAC;AAAA,EACtB,gBAAA;AAAA,EACA,QAAA;AACF,CAGM,KAAA;AAEJ,EAAiB,gBAAA,CAAA,OAAA,EAAA,CAAA;AAEjB,EAAA,IAAI,iBAAiB,OAAW,IAAA,CAAA;AAAG,IAAO,OAAA,IAAA,CAAA;AAE1C,EAAA,uCAAU,QAAS,EAAA,CAAA,CAAA;AACrB,CAAA;;;;"}
@@ -1,23 +0,0 @@
1
- declare const spacingLayouts: readonly ["dense", "clever", "vertical__clever", "horizontal__clever"];
2
- type TSpacingLayout = (typeof spacingLayouts)[number];
3
- declare function getSpacingLayouts(): {
4
- '&.dense': {
5
- px: number;
6
- py: number;
7
- };
8
- '&.horizontal__clever': {
9
- px: number;
10
- py: number;
11
- };
12
- '&.vertical__clever': {
13
- px: number;
14
- py: number;
15
- };
16
- '&.clever': {
17
- px: number;
18
- py: number;
19
- };
20
- };
21
-
22
- export { type TSpacingLayout, getSpacingLayouts, spacingLayouts };
23
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,29 +0,0 @@
1
- const spacingLayouts = [
2
- "dense",
3
- "clever",
4
- "vertical__clever",
5
- "horizontal__clever"
6
- ];
7
- function getSpacingLayouts() {
8
- return {
9
- "&.dense": {
10
- px: 0,
11
- py: 0
12
- },
13
- "&.horizontal__clever": {
14
- px: 4,
15
- py: 0
16
- },
17
- "&.vertical__clever": {
18
- px: 0,
19
- py: 4
20
- },
21
- "&.clever": {
22
- px: 4,
23
- py: 4
24
- }
25
- };
26
- }
27
-
28
- export { getSpacingLayouts, spacingLayouts };
29
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/methods/spacingLayout/index.ts"],"sourcesContent":["export const spacingLayouts = [\n 'dense',\n 'clever',\n 'vertical__clever',\n 'horizontal__clever',\n] as const;\n\nexport type TSpacingLayout = (typeof spacingLayouts)[number];\n\nexport function getSpacingLayouts() {\n return {\n '&.dense': {\n px: 0,\n py: 0,\n },\n '&.horizontal__clever': {\n px: 4,\n py: 0,\n },\n '&.vertical__clever': {\n px: 0,\n py: 4,\n },\n '&.clever': {\n px: 4,\n py: 4,\n },\n };\n}\n"],"names":[],"mappings":"AAAO,MAAM,cAAiB,GAAA;AAAA,EAC5B,OAAA;AAAA,EACA,QAAA;AAAA,EACA,kBAAA;AAAA,EACA,oBAAA;AACF,EAAA;AAIO,SAAS,iBAAoB,GAAA;AAClC,EAAO,OAAA;AAAA,IACL,SAAW,EAAA;AAAA,MACT,EAAI,EAAA,CAAA;AAAA,MACJ,EAAI,EAAA,CAAA;AAAA,KACN;AAAA,IACA,sBAAwB,EAAA;AAAA,MACtB,EAAI,EAAA,CAAA;AAAA,MACJ,EAAI,EAAA,CAAA;AAAA,KACN;AAAA,IACA,oBAAsB,EAAA;AAAA,MACpB,EAAI,EAAA,CAAA;AAAA,MACJ,EAAI,EAAA,CAAA;AAAA,KACN;AAAA,IACA,UAAY,EAAA;AAAA,MACV,EAAI,EAAA,CAAA;AAAA,MACJ,EAAI,EAAA,CAAA;AAAA,KACN;AAAA,GACF,CAAA;AACF;;;;"}
@@ -1,8 +0,0 @@
1
- import * as _theme_ui_css from '@theme-ui/css';
2
- import { CustomTheme } from '../themeuiExports.js';
3
- import { TCustomPalette, TThemeModifier } from '../base/colors/types.js';
4
-
5
- declare function useMainTheme(customTheme?: () => CustomTheme, customPalette?: TCustomPalette, themeModifier?: TThemeModifier): _theme_ui_css.Theme<{}>;
6
-
7
- export { useMainTheme };
8
- //# sourceMappingURL=useMainTheme.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useMainTheme.d.ts","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,45 +0,0 @@
1
- import merge from 'lodash-es/merge';
2
- import { useMount, setValueByPath, EventEmitter } from '@apia/util';
3
- import { useState, useRef } from 'react';
4
- import { getMainTheme } from './getMainTheme.js';
5
-
6
- const injectedStyles = {};
7
- class MainThemeEmitter extends EventEmitter {
8
- }
9
- const mainThemeEmitter = new MainThemeEmitter();
10
- function handleNewStyles(ev) {
11
- injectedStyles[ev.path] = ev.styles;
12
- }
13
- const unSubscribe = mainThemeEmitter.on("newStyles", handleNewStyles);
14
- function useMainTheme(customTheme, customPalette, themeModifier) {
15
- const [theme, setTheme] = useState(
16
- getMainTheme(customTheme, customPalette, themeModifier)
17
- );
18
- const previousTheme = useRef(customTheme);
19
- const previousPalette = useRef(customPalette);
20
- if (previousTheme.current !== customTheme)
21
- setTheme(getMainTheme(customTheme));
22
- previousTheme.current = customTheme;
23
- if (previousPalette.current !== customPalette)
24
- setTheme(getMainTheme(customTheme, customPalette));
25
- previousPalette.current = customPalette;
26
- useMount(() => {
27
- setTheme((current) => {
28
- unSubscribe();
29
- let initialTheme = { ...current };
30
- Object.entries(injectedStyles).forEach(([path, styles]) => {
31
- const newStyles = setValueByPath({}, path, styles);
32
- initialTheme = merge(initialTheme, newStyles);
33
- });
34
- return initialTheme;
35
- });
36
- return mainThemeEmitter.on("newStyles", (ev) => {
37
- const newStyles = setValueByPath({}, ev.path, ev.styles);
38
- setTheme((current) => merge({ ...current }, newStyles));
39
- });
40
- });
41
- return theme;
42
- }
43
-
44
- export { mainThemeEmitter, useMainTheme };
45
- //# sourceMappingURL=useMainTheme.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useMainTheme.js","sources":["../../src/methods/useMainTheme.ts"],"sourcesContent":["import { Theme, ThemeUICSSObject } from 'theme-ui';\nimport merge from 'lodash-es/merge';\nimport { EventEmitter, setValueByPath, useMount } from '@apia/util';\nimport { useRef, useState } from 'react';\nimport { getMainTheme } from './getMainTheme';\nimport { CustomTheme } from '../themeuiExports';\nimport { TCustomPalette, TThemeModifier } from '../base/colors/types';\n\nlet declaredStyles: ThemeUICSSObject = {};\n\nexport function getInjectedStyles() {\n return injectedStyles;\n}\n\nconst injectedStyles: Record<string, ThemeUICSSObject> = {};\n\nclass MainThemeEmitter extends EventEmitter<{\n newStyles: {\n path: string;\n styles: ThemeUICSSObject;\n };\n}> {}\n\nexport const mainThemeEmitter = new MainThemeEmitter();\n\nfunction handleNewStyles(ev: { path: string; styles: ThemeUICSSObject }) {\n injectedStyles[ev.path] = ev.styles;\n}\n\nconst unSubscribe = mainThemeEmitter.on('newStyles', handleNewStyles);\n\nexport function declareStyles(\n path: string,\n styles: ThemeUICSSObject | Record<string, ThemeUICSSObject>,\n) {\n const newStyles = {};\n setValueByPath(newStyles, path, styles);\n declaredStyles = merge(declaredStyles, newStyles);\n}\n\nexport function useMainTheme(\n customTheme?: () => CustomTheme,\n customPalette?: TCustomPalette,\n themeModifier?: TThemeModifier,\n) {\n const [theme, setTheme] = useState<Theme>(\n getMainTheme(customTheme, customPalette, themeModifier),\n );\n\n const previousTheme = useRef<(() => CustomTheme) | undefined>(customTheme);\n const previousPalette = useRef<TCustomPalette | undefined>(customPalette);\n\n if (previousTheme.current !== customTheme)\n setTheme(getMainTheme(customTheme));\n\n previousTheme.current = customTheme;\n\n if (previousPalette.current !== customPalette)\n setTheme(getMainTheme(customTheme, customPalette));\n\n previousPalette.current = customPalette;\n\n useMount(() => {\n setTheme((current) => {\n unSubscribe();\n let initialTheme = { ...current };\n Object.entries(injectedStyles).forEach(([path, styles]) => {\n const newStyles = setValueByPath({}, path, styles);\n initialTheme = merge(initialTheme, newStyles);\n });\n return initialTheme;\n });\n return mainThemeEmitter.on('newStyles', (ev) => {\n const newStyles = setValueByPath({}, ev.path, ev.styles);\n setTheme((current) => merge({ ...current }, newStyles));\n });\n });\n\n return theme;\n}\n"],"names":[],"mappings":";;;;;AAcA,MAAM,iBAAmD,EAAC,CAAA;AAE1D,MAAM,yBAAyB,YAK5B,CAAA;AAAC,CAAA;AAES,MAAA,gBAAA,GAAmB,IAAI,gBAAiB,GAAA;AAErD,SAAS,gBAAgB,EAAgD,EAAA;AACvE,EAAe,cAAA,CAAA,EAAA,CAAG,IAAI,CAAA,GAAI,EAAG,CAAA,MAAA,CAAA;AAC/B,CAAA;AAEA,MAAM,WAAc,GAAA,gBAAA,CAAiB,EAAG,CAAA,WAAA,EAAa,eAAe,CAAA,CAAA;AAWpD,SAAA,YAAA,CACd,WACA,EAAA,aAAA,EACA,aACA,EAAA;AACA,EAAM,MAAA,CAAC,KAAO,EAAA,QAAQ,CAAI,GAAA,QAAA;AAAA,IACxB,YAAA,CAAa,WAAa,EAAA,aAAA,EAAe,aAAa,CAAA;AAAA,GACxD,CAAA;AAEA,EAAM,MAAA,aAAA,GAAgB,OAAwC,WAAW,CAAA,CAAA;AACzE,EAAM,MAAA,eAAA,GAAkB,OAAmC,aAAa,CAAA,CAAA;AAExE,EAAA,IAAI,cAAc,OAAY,KAAA,WAAA;AAC5B,IAAS,QAAA,CAAA,YAAA,CAAa,WAAW,CAAC,CAAA,CAAA;AAEpC,EAAA,aAAA,CAAc,OAAU,GAAA,WAAA,CAAA;AAExB,EAAA,IAAI,gBAAgB,OAAY,KAAA,aAAA;AAC9B,IAAS,QAAA,CAAA,YAAA,CAAa,WAAa,EAAA,aAAa,CAAC,CAAA,CAAA;AAEnD,EAAA,eAAA,CAAgB,OAAU,GAAA,aAAA,CAAA;AAE1B,EAAA,QAAA,CAAS,MAAM;AACb,IAAA,QAAA,CAAS,CAAC,OAAY,KAAA;AACpB,MAAY,WAAA,EAAA,CAAA;AACZ,MAAI,IAAA,YAAA,GAAe,EAAE,GAAG,OAAQ,EAAA,CAAA;AAChC,MAAO,MAAA,CAAA,OAAA,CAAQ,cAAc,CAAE,CAAA,OAAA,CAAQ,CAAC,CAAC,IAAA,EAAM,MAAM,CAAM,KAAA;AACzD,QAAA,MAAM,SAAY,GAAA,cAAA,CAAe,EAAC,EAAG,MAAM,MAAM,CAAA,CAAA;AACjD,QAAe,YAAA,GAAA,KAAA,CAAM,cAAc,SAAS,CAAA,CAAA;AAAA,OAC7C,CAAA,CAAA;AACD,MAAO,OAAA,YAAA,CAAA;AAAA,KACR,CAAA,CAAA;AACD,IAAA,OAAO,gBAAiB,CAAA,EAAA,CAAG,WAAa,EAAA,CAAC,EAAO,KAAA;AAC9C,MAAA,MAAM,YAAY,cAAe,CAAA,IAAI,EAAG,CAAA,IAAA,EAAM,GAAG,MAAM,CAAA,CAAA;AACvD,MAAS,QAAA,CAAA,CAAC,YAAY,KAAM,CAAA,EAAE,GAAG,OAAQ,EAAA,EAAG,SAAS,CAAC,CAAA,CAAA;AAAA,KACvD,CAAA,CAAA;AAAA,GACF,CAAA,CAAA;AAED,EAAO,OAAA,KAAA,CAAA;AACT;;;;"}
@@ -1,7 +0,0 @@
1
- import { Theme } from 'theme-ui';
2
- export { Alert, AlertProps, AspectImage, AspectImageProps, AspectRatio, AspectRatioProps, Avatar, AvatarProps, Badge, BadgeProps, BaseStyles, Box, BoxOwnProps, BoxProps, Button, ButtonProps, CSSObject, CSSProperties, CSSPseudoSelectorProps, Card, CardProps, Checkbox, CheckboxProps, Close, CloseIcon, CloseProps, ColorMode, ColorModesScale, Container, ContainerProps, Divider, DividerProps, Donut, DonutProps, Embed, EmbedProps, Field, FieldOwnProps, FieldProps, Flex, FlexOwnProps, FlexProps, Global, Grid, GridProps, Heading, HeadingProps, IconButton, IconButtonProps, Image, ImageProps, InitializeColorMode, Input, InputProps, Label, LabelProps, Link, LinkProps, MenuButton, MenuButtonProps, MenuIcon, Message, MessageProps, NavLink, NavLinkProps, Paragraph, ParagraphProps, Progress, ProgressProps, Radio, RadioProps, ResponsiveStyleValue, Select, SelectProps, Slider, SliderProps, Spinner, SpinnerProps, StylePropertyValue, Switch, SwitchProps, SxProp, TLengthStyledSystem, Text, TextProps, Textarea, TextareaProps, Theme, ThemeStyles, ThemeUICSSObject, ThemeUICSSProperties, ThemeUIContextValue, ThemeUIStyleObject, createElement, css, get, merge, useColorMode, useThemeUI } from 'theme-ui';
3
-
4
- type CustomTheme = Omit<Theme, 'palette'>;
5
-
6
- export type { CustomTheme };
7
- //# sourceMappingURL=themeuiExports.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"themeuiExports.d.ts","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,7 +0,0 @@
1
- declare function getVariant(variant: string): {
2
- variant: string;
3
- 'data-variant': string;
4
- };
5
-
6
- export { getVariant };
7
- //# sourceMappingURL=getVariant.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getVariant.d.ts","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,6 +0,0 @@
1
- function getVariant(variant) {
2
- return { variant, "data-variant": variant };
3
- }
4
-
5
- export { getVariant };
6
- //# sourceMappingURL=getVariant.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getVariant.js","sources":["../../src/util/getVariant.ts"],"sourcesContent":["export function getVariant(variant: string) {\r\n return { variant, 'data-variant': variant };\r\n}\r\n"],"names":[],"mappings":"AAAO,SAAS,WAAW,OAAiB,EAAA;AAC1C,EAAO,OAAA,EAAE,OAAS,EAAA,cAAA,EAAgB,OAAQ,EAAA,CAAA;AAC5C;;;;"}
package/dist/util.d.ts DELETED
@@ -1,43 +0,0 @@
1
- import { ResponsiveStyleValue, ThemeUICSSObject } from 'theme-ui';
2
-
3
- /**
4
- * Esta función devuelve un array de valores para los distintos breakpoints.
5
- *
6
- * **Importante** Debido a un issue con ThemeUI, es necesario agregar un
7
- * breakpoint inicial de 0px para las vistas de impresión. El comportamiento por
8
- * defecto será, si se pasa un valor para el índice 4, esta será tomada como
9
- * vista de impresión, sino se tomará el valor de mayor índice menor que 4.
10
- *
11
- * @example
12
- *
13
- * display: responsive({0: 'none', 3: 'block'}) // display: ['block', 'none', null, null, 'block'];
14
- */
15
- declare function responsive<T>(values: {
16
- print?: T;
17
- [key: number]: undefined | T;
18
- }): ResponsiveStyleValue<T>;
19
- /**
20
- * Este método permite aplicar espacios (gaps, márgenes y paddings) que se
21
- * tendrán un comportamiento responsivo por defecto. Esto es, cuando tenemos un
22
- * padding en una vista de escritorio, probablemente sea demasiado grande al
23
- * llevarlo a celular. Con esta función se elimina el problema de calcular para
24
- * cada elemento en forma individual y el problema se convierte en encontrar
25
- * una única fórmula que quede correcta para todos los breakpoints.
26
- *
27
- * @example
28
- *
29
- * '.wellPaddedElement': {
30
- * p: spacing(6),
31
- * pt: spacing(8)
32
- * }
33
- */
34
- declare function spacing(index: number): ResponsiveStyleValue<number>;
35
- declare const smallButton: {
36
- py: number;
37
- px: number;
38
- fontSize: string;
39
- };
40
- declare const focusOutline: ThemeUICSSObject;
41
-
42
- export { focusOutline, responsive, smallButton, spacing };
43
- //# sourceMappingURL=util.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"util.d.ts","sources":[],"sourcesContent":[],"names":[],"mappings":""}
package/dist/util.js DELETED
@@ -1,34 +0,0 @@
1
- import defaultPalette from './base/colors/defaultPalette.js';
2
-
3
- function responsive(values) {
4
- const returnArray = [];
5
- const max = 6;
6
- for (let i = 0; i <= max; i++)
7
- returnArray[i + 1] = values[i] ?? null;
8
- if (values.print)
9
- returnArray[0] = values.print;
10
- else {
11
- for (let i = 5; i >= 0; i--) {
12
- if (values[i] !== void 0)
13
- returnArray[0] = values[i];
14
- }
15
- }
16
- return returnArray;
17
- }
18
- function spacing(index) {
19
- return defaultPalette.spacing(index) ?? index;
20
- }
21
- const smallButton = {
22
- py: 2,
23
- px: 4,
24
- fontSize: "0.9em"
25
- };
26
- const focusOutline = {
27
- outlineColor: "outlineColor",
28
- outlineWidth: "3px",
29
- outlineStyle: "solid",
30
- outlineOffset: "-3px"
31
- };
32
-
33
- export { focusOutline, responsive, smallButton, spacing };
34
- //# sourceMappingURL=util.js.map
package/dist/util.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"util.js","sources":["../src/util.ts"],"sourcesContent":["import { ResponsiveStyleValue, ThemeUICSSObject } from 'theme-ui';\nimport defaultPalette from './base/colors/defaultPalette';\n\n/**\n * Esta función devuelve un array de valores para los distintos breakpoints.\n *\n * **Importante** Debido a un issue con ThemeUI, es necesario agregar un\n * breakpoint inicial de 0px para las vistas de impresión. El comportamiento por\n * defecto será, si se pasa un valor para el índice 4, esta será tomada como\n * vista de impresión, sino se tomará el valor de mayor índice menor que 4.\n *\n * @example\n *\n * display: responsive({0: 'none', 3: 'block'}) // display: ['block', 'none', null, null, 'block'];\n */\n\nexport function responsive<T>(values: {\n print?: T;\n [key: number]: undefined | T;\n}): ResponsiveStyleValue<T> {\n const returnArray = [];\n const max = 6;\n for (let i = 0; i <= max; i++) returnArray[i + 1] = values[i] ?? null;\n\n if (values.print) returnArray[0] = values.print;\n else {\n for (let i = 5; i >= 0; i--) {\n if (values[i] !== undefined) returnArray[0] = values[i];\n }\n }\n\n return returnArray;\n}\n\n/**\n * Este método permite aplicar espacios (gaps, márgenes y paddings) que se\n * tendrán un comportamiento responsivo por defecto. Esto es, cuando tenemos un\n * padding en una vista de escritorio, probablemente sea demasiado grande al\n * llevarlo a celular. Con esta función se elimina el problema de calcular para\n * cada elemento en forma individual y el problema se convierte en encontrar\n * una única fórmula que quede correcta para todos los breakpoints.\n *\n * @example\n *\n * '.wellPaddedElement': {\n * p: spacing(6),\n * pt: spacing(8)\n * }\n */\nexport function spacing(index: number): ResponsiveStyleValue<number> {\n return defaultPalette.spacing(index) ?? index;\n}\n\nexport const smallButton = {\n py: 2,\n px: 4,\n fontSize: '0.9em',\n};\n\nexport const focusOutline: ThemeUICSSObject = {\n outlineColor: 'outlineColor',\n outlineWidth: '3px',\n outlineStyle: 'solid',\n outlineOffset: '-3px',\n};\n"],"names":[],"mappings":";;AAgBO,SAAS,WAAc,MAGF,EAAA;AAC1B,EAAA,MAAM,cAAc,EAAC,CAAA;AACrB,EAAA,MAAM,GAAM,GAAA,CAAA,CAAA;AACZ,EAAS,KAAA,IAAA,CAAA,GAAI,CAAG,EAAA,CAAA,IAAK,GAAK,EAAA,CAAA,EAAA;AAAK,IAAA,WAAA,CAAY,CAAI,GAAA,CAAC,CAAI,GAAA,MAAA,CAAO,CAAC,CAAK,IAAA,IAAA,CAAA;AAEjE,EAAA,IAAI,MAAO,CAAA,KAAA;AAAO,IAAY,WAAA,CAAA,CAAC,IAAI,MAAO,CAAA,KAAA,CAAA;AAAA,OACrC;AACH,IAAA,KAAA,IAAS,CAAI,GAAA,CAAA,EAAG,CAAK,IAAA,CAAA,EAAG,CAAK,EAAA,EAAA;AAC3B,MAAI,IAAA,MAAA,CAAO,CAAC,CAAM,KAAA,KAAA,CAAA;AAAW,QAAY,WAAA,CAAA,CAAC,CAAI,GAAA,MAAA,CAAO,CAAC,CAAA,CAAA;AAAA,KACxD;AAAA,GACF;AAEA,EAAO,OAAA,WAAA,CAAA;AACT,CAAA;AAiBO,SAAS,QAAQ,KAA6C,EAAA;AACnE,EAAO,OAAA,cAAA,CAAe,OAAQ,CAAA,KAAK,CAAK,IAAA,KAAA,CAAA;AAC1C,CAAA;AAEO,MAAM,WAAc,GAAA;AAAA,EACzB,EAAI,EAAA,CAAA;AAAA,EACJ,EAAI,EAAA,CAAA;AAAA,EACJ,QAAU,EAAA,OAAA;AACZ,EAAA;AAEO,MAAM,YAAiC,GAAA;AAAA,EAC5C,YAAc,EAAA,cAAA;AAAA,EACd,YAAc,EAAA,KAAA;AAAA,EACd,YAAc,EAAA,OAAA;AAAA,EACd,aAAe,EAAA,MAAA;AACjB;;;;"}