@xanui/core 1.2.31 → 1.2.32

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 (115) hide show
  1. package/AppRoot/Renderar.js +11 -2
  2. package/AppRoot/Renderar.js.map +1 -1
  3. package/AppRoot/Renderar.mjs +8 -2
  4. package/AppRoot/Renderar.mjs.map +1 -1
  5. package/AppRoot/index.js +22 -3
  6. package/AppRoot/index.js.map +1 -1
  7. package/AppRoot/index.mjs +16 -2
  8. package/AppRoot/index.mjs.map +1 -1
  9. package/Tag/ServerStyleTag.js +9 -2
  10. package/Tag/ServerStyleTag.js.map +1 -1
  11. package/Tag/ServerStyleTag.mjs +7 -2
  12. package/Tag/ServerStyleTag.mjs.map +1 -1
  13. package/Tag/cssPropList.js +7 -2
  14. package/Tag/cssPropList.js.map +1 -1
  15. package/Tag/cssPropList.mjs +4 -1
  16. package/Tag/cssPropList.mjs.map +1 -1
  17. package/Tag/index.js +34 -4
  18. package/Tag/index.js.map +1 -1
  19. package/Tag/index.mjs +11 -2
  20. package/Tag/index.mjs.map +1 -1
  21. package/Tag/useTagProps.js +13 -3
  22. package/Tag/useTagProps.js.map +1 -1
  23. package/Tag/useTagProps.mjs +10 -2
  24. package/Tag/useTagProps.mjs.map +1 -1
  25. package/Transition/index.js +13 -3
  26. package/Transition/index.js.map +1 -1
  27. package/Transition/index.mjs +10 -2
  28. package/Transition/index.mjs.map +1 -1
  29. package/breakpoint/BreakpointProvider.js +12 -2
  30. package/breakpoint/BreakpointProvider.js.map +1 -1
  31. package/breakpoint/BreakpointProvider.mjs +9 -2
  32. package/breakpoint/BreakpointProvider.mjs.map +1 -1
  33. package/breakpoint/useBreakpoint.js +11 -2
  34. package/breakpoint/useBreakpoint.js.map +1 -1
  35. package/breakpoint/useBreakpoint.mjs +9 -2
  36. package/breakpoint/useBreakpoint.mjs.map +1 -1
  37. package/breakpoint/useBreakpointProps.js +11 -3
  38. package/breakpoint/useBreakpointProps.js.map +1 -1
  39. package/breakpoint/useBreakpointProps.mjs +8 -2
  40. package/breakpoint/useBreakpointProps.mjs.map +1 -1
  41. package/css/aliases.js +7 -2
  42. package/css/aliases.js.map +1 -1
  43. package/css/aliases.mjs +4 -1
  44. package/css/aliases.mjs.map +1 -1
  45. package/css/getProps.js +7 -2
  46. package/css/getProps.js.map +1 -1
  47. package/css/getProps.mjs +4 -1
  48. package/css/getProps.mjs.map +1 -1
  49. package/css/getValue.js +7 -2
  50. package/css/getValue.js.map +1 -1
  51. package/css/getValue.mjs +4 -1
  52. package/css/getValue.mjs.map +1 -1
  53. package/css/index.js +21 -5
  54. package/css/index.js.map +1 -1
  55. package/css/index.mjs +10 -2
  56. package/css/index.mjs.map +1 -1
  57. package/hooks/useAnimation.js +13 -9
  58. package/hooks/useAnimation.js.map +1 -1
  59. package/hooks/useAnimation.mjs +8 -9
  60. package/hooks/useAnimation.mjs.map +1 -1
  61. package/hooks/useColorTemplate.js +8 -2
  62. package/hooks/useColorTemplate.js.map +1 -1
  63. package/hooks/useColorTemplate.mjs +5 -1
  64. package/hooks/useColorTemplate.mjs.map +1 -1
  65. package/hooks/useInterface.js +13 -2
  66. package/hooks/useInterface.js.map +1 -1
  67. package/hooks/useInterface.mjs +11 -2
  68. package/hooks/useInterface.mjs.map +1 -1
  69. package/hooks/usePortal.js +22 -3
  70. package/hooks/usePortal.js.map +1 -1
  71. package/hooks/usePortal.mjs +16 -2
  72. package/hooks/usePortal.mjs.map +1 -1
  73. package/hooks/useTransition/index.js +15 -2
  74. package/hooks/useTransition/index.js.map +1 -1
  75. package/hooks/useTransition/index.mjs +13 -2
  76. package/hooks/useTransition/index.mjs.map +1 -1
  77. package/hooks/useTransition/variants.js +20 -2
  78. package/hooks/useTransition/variants.js.map +1 -1
  79. package/hooks/useTransition/variants.mjs +4 -1
  80. package/hooks/useTransition/variants.mjs.map +1 -1
  81. package/index.js +53 -1
  82. package/index.js.map +1 -1
  83. package/index.mjs +21 -1
  84. package/index.mjs.map +1 -1
  85. package/package.json +2 -8
  86. package/readme.md +109 -109
  87. package/theme/ThemeCssVars.js +7 -2
  88. package/theme/ThemeCssVars.js.map +1 -1
  89. package/theme/ThemeCssVars.mjs +4 -1
  90. package/theme/ThemeCssVars.mjs.map +1 -1
  91. package/theme/ThemeDefaultOptions.js +13 -2
  92. package/theme/ThemeDefaultOptions.js.map +1 -1
  93. package/theme/ThemeDefaultOptions.mjs +7 -2
  94. package/theme/ThemeDefaultOptions.mjs.map +1 -1
  95. package/theme/ThemeProvider.js +39 -4
  96. package/theme/ThemeProvider.js.map +1 -1
  97. package/theme/ThemeProvider.mjs +16 -2
  98. package/theme/ThemeProvider.mjs.map +1 -1
  99. package/theme/core.js +13 -2
  100. package/theme/core.js.map +1 -1
  101. package/theme/core.mjs +7 -2
  102. package/theme/core.mjs.map +1 -1
  103. package/theme/createTheme.js +11 -2
  104. package/theme/createTheme.js.map +1 -1
  105. package/theme/createTheme.mjs +9 -2
  106. package/theme/createTheme.mjs.map +1 -1
  107. package/theme/createThemeSwitcher.d.ts +1 -1
  108. package/theme/createThemeSwitcher.js +11 -2
  109. package/theme/createThemeSwitcher.js.map +1 -1
  110. package/theme/createThemeSwitcher.mjs +9 -2
  111. package/theme/createThemeSwitcher.mjs.map +1 -1
  112. package/theme/index.js +15 -1
  113. package/theme/index.js.map +1 -1
  114. package/theme/index.mjs +10 -1
  115. package/theme/index.mjs.map +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":["../../../src/hooks/useTransition/index.ts"],"sourcesContent":["import { useState, useEffect, useId } from 'react';\nimport { animationEases } from '../useAnimation';\nimport { css } from '../../css';\nimport { formatCSSProp } from 'oncss';\nimport { CSSProps } from '../../css/types';\nimport * as variants from './variants'\n\nexport type UseTransitionVariantTypes = keyof typeof variants\nexport type UseTransitionState = \"open\" | \"opened\" | \"close\" | \"closed\"\n\nexport type UseTransitionVariant = (rect: DOMRect) => ({ from: CSSProps, to: CSSProps })\n\nexport type UseTransitionProps = {\n open: boolean;\n variant: UseTransitionVariant | UseTransitionVariantTypes;\n ease?: string;\n easing?: keyof typeof animationEases;\n duration?: number;\n delay?: number;\n disableInitialTransition?: boolean;\n exitOnUnmount?: boolean;\n onOpen?: () => void;\n onOpened?: () => void;\n onClose?: () => void;\n onClosed?: () => void;\n onState?: (state: UseTransitionState) => void;\n}\n\n\nconst style = (obj?: any) => {\n return css(obj || {}, { selector: \"#\" }).classname;\n}\n\nconst getVariant = (rect: DOMRect | null, variant: UseTransitionProps['variant']) => {\n let fn = typeof variant === 'string' ? variants[variant] : variant\n if (!fn) throw new Error(`Transition variant \"${variant}\" not found.`)\n return fn(rect as DOMRect);\n}\n\nconst useTransition = ({ open, ...props }: UseTransitionProps) => {\n let {\n disableInitialTransition = false,\n variant = \"fade\",\n duration = 400,\n delay,\n ease,\n easing,\n exitOnUnmount = false,\n onOpen,\n onOpened,\n onClose,\n onClosed,\n onState\n } = props\n let _ease = ease || (animationEases as any)[easing as any] || animationEases.bounce\n const id = \"xui-transition-\" + useId()\n const [state, setState] = useState({\n initial: false,\n classname: style({ visibility: \"hidden\" }),\n variant: variant,\n rect: null as DOMRect | null,\n stage: open ? \"open\" : \"closed\",\n unmounted: false,\n })\n\n const getEle = () => document.querySelector(`[data-transition=\"${id}\"]`) as HTMLElement;\n const getBoundary = () => state.rect || getEle()?.getBoundingClientRect() || new DOMRect(0, 0, 0, 0);\n\n useEffect(() => {\n if (exitOnUnmount && state.stage === 'closed') {\n if (!open) {\n setState(s => ({\n ...s,\n initial: false,\n classname: \"\",\n unmounted: true,\n variant: variant,\n }))\n } else {\n setState(s => ({\n ...s,\n variant: variant,\n classname: style({ visibility: \"hidden\" }),\n stage: \"open\",\n }))\n }\n }\n }, [open, state.stage, exitOnUnmount, variant])\n\n // initial effect\n useEffect(() => {\n const ele = getEle()\n if (!ele) return\n if (exitOnUnmount && state.stage === 'closed') return\n\n const rect = getBoundary();\n let { from } = getVariant(rect, state.variant)\n if (open && !state.initial) {\n setState(s => ({\n ...s,\n classname: (!disableInitialTransition || state.unmounted) ? style(from) : \"\",\n initial: true,\n rect: rect,\n }))\n let stimer: any = null\n let etimer: any = null\n ele.ontransitionstart = () => {\n clearTimeout(stimer)\n stimer = setTimeout(() => {\n const isOpen = ele.getAttribute('data-transition-state') === 'open';\n (onOpen && isOpen) && onOpen();\n (onClose && !isOpen) && onClose()\n onState && onState(isOpen ? \"open\" : \"close\")\n setState(s => ({\n ...s,\n stage: isOpen ? \"open\" : \"close\"\n }))\n }, 1)\n }\n\n ele.ontransitionend = () => {\n clearTimeout(etimer)\n etimer = setTimeout(() => {\n const isOpen = ele.getAttribute('data-transition-state') === 'open';\n (onOpened && isOpen) && onOpened();\n (onClosed && !isOpen) && onClosed();\n onState && onState(isOpen ? \"opened\" : \"closed\")\n setState(s => ({\n ...s,\n stage: isOpen ? \"opened\" : \"closed\"\n }))\n }, 1)\n }\n } else if (!state.initial) {\n setState(s => ({\n ...s,\n classname: style(from),\n rect: rect,\n }))\n }\n }, [open, state.initial, state.stage, exitOnUnmount])\n\n\n useEffect(() => {\n if (state.initial) {\n let _variant = state.variant !== variant ? variant : state.variant\n const { from, to } = getVariant(state.rect, _variant)\n let _css: CSSProps = open ? to : from\n let trans = ` ${duration}ms ${_ease} ${delay || 0}ms`\n let _ = {\n ..._css,\n transition: Object.keys(_css || {}).map(k => formatCSSProp(k)).join(trans + \", \") + trans,\n }\n setState(s => ({\n ...s,\n classname: style(_),\n variant: _variant\n }))\n }\n }, [open, state.initial, variant])\n\n return {\n exited: exitOnUnmount && state.stage === 'closed',\n props: {\n 'id': state.classname,\n 'data-transition': id,\n 'data-transition-state': open ? 'open' : 'close',\n }\n }\n}\n\n\nexport default useTransition"],"names":[],"mappings":"yOA6BA,MAAM,KAAK,GAAG,CAAC,GAAS,KAAI;AACzB,IAAA,OAAO,GAAG,CAAC,GAAG,IAAI,EAAE,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,CAAC,SAAS;AACrD,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MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EACC,IAAI,CAAA,EAAA,EACP,UAAU,EAAE,MAAM,CAAC,IAAI,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,GAAG,KAAK,GAC3F;YACD,QAAQ,CAAC,CAAC,KAAI,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EACR,CAAC,KACJ,SAAS,EAAE,KAAK,CAAC,CAAC,CAAC,EACnB,OAAO,EAAE,QAAQ,EAAA,CAAA,CAClB,CAAC;QACN;IACH,CAAC,EAAE,CAAC,IAAI,EAAE,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAElC,OAAO;AACJ,QAAA,MAAM,EAAE,aAAa,IAAI,KAAK,CAAC,KAAK,KAAK,QAAQ;AACjD,QAAA,KAAK,EAAE;YACJ,IAAI,EAAE,KAAK,CAAC,SAAS;AACrB,YAAA,iBAAiB,EAAE,EAAE;YACrB,uBAAuB,EAAE,IAAI,GAAG,MAAM,GAAG,OAAO;AAClD;KACH;AACJ"}
1
+ {"version":3,"file":"index.mjs","sources":["../../../src/hooks/useTransition/index.ts"],"sourcesContent":["\"use client\";\r\nimport { useState, useEffect, useId } from 'react';\r\nimport { animationEases } from '../useAnimation';\r\nimport { css } from '../../css';\r\nimport { formatCSSProp } from 'oncss';\r\nimport { CSSProps } from '../../css/types';\r\nimport * as variants from './variants'\r\n\r\nexport type UseTransitionVariantTypes = keyof typeof variants\r\nexport type UseTransitionState = \"open\" | \"opened\" | \"close\" | \"closed\"\r\n\r\nexport type UseTransitionVariant = (rect: DOMRect) => ({ from: CSSProps, to: CSSProps })\r\n\r\nexport type UseTransitionProps = {\r\n open: boolean;\r\n variant: UseTransitionVariant | UseTransitionVariantTypes;\r\n ease?: string;\r\n easing?: keyof typeof animationEases;\r\n duration?: number;\r\n delay?: number;\r\n disableInitialTransition?: boolean;\r\n exitOnUnmount?: boolean;\r\n onOpen?: () => void;\r\n onOpened?: () => void;\r\n onClose?: () => void;\r\n onClosed?: () => void;\r\n onState?: (state: UseTransitionState) => void;\r\n}\r\n\r\n\r\nconst style = (obj?: any) => {\r\n return css(obj || {}, { selector: \"#\" }).classname;\r\n}\r\n\r\nconst getVariant = (rect: DOMRect | null, variant: UseTransitionProps['variant']) => {\r\n let fn = typeof variant === 'string' ? variants[variant] : variant\r\n if (!fn) throw new Error(`Transition variant \"${variant}\" not found.`)\r\n return fn(rect as DOMRect);\r\n}\r\n\r\nconst useTransition = ({ open, ...props }: UseTransitionProps) => {\r\n let {\r\n disableInitialTransition = false,\r\n variant = \"fade\",\r\n duration = 400,\r\n delay,\r\n ease,\r\n easing,\r\n exitOnUnmount = false,\r\n onOpen,\r\n onOpened,\r\n onClose,\r\n onClosed,\r\n onState\r\n } = props\r\n let _ease = ease || (animationEases as any)[easing as any] || animationEases.bounce\r\n const id = \"xui-transition-\" + useId()\r\n const [state, setState] = useState({\r\n initial: false,\r\n classname: style({ visibility: \"hidden\" }),\r\n variant: variant,\r\n rect: null as DOMRect | null,\r\n stage: open ? \"open\" : \"closed\",\r\n unmounted: false,\r\n })\r\n\r\n const getEle = () => document.querySelector(`[data-transition=\"${id}\"]`) as HTMLElement;\r\n const getBoundary = () => state.rect || getEle()?.getBoundingClientRect() || new DOMRect(0, 0, 0, 0);\r\n\r\n useEffect(() => {\r\n if (exitOnUnmount && state.stage === 'closed') {\r\n if (!open) {\r\n setState(s => ({\r\n ...s,\r\n initial: false,\r\n classname: \"\",\r\n unmounted: true,\r\n variant: variant,\r\n }))\r\n } else {\r\n setState(s => ({\r\n ...s,\r\n variant: variant,\r\n classname: style({ visibility: \"hidden\" }),\r\n stage: \"open\",\r\n }))\r\n }\r\n }\r\n }, [open, state.stage, exitOnUnmount, variant])\r\n\r\n // initial effect\r\n useEffect(() => {\r\n const ele = getEle()\r\n if (!ele) return\r\n if (exitOnUnmount && state.stage === 'closed') return\r\n\r\n const rect = getBoundary();\r\n let { from } = getVariant(rect, state.variant)\r\n if (open && !state.initial) {\r\n setState(s => ({\r\n ...s,\r\n classname: (!disableInitialTransition || state.unmounted) ? style(from) : \"\",\r\n initial: true,\r\n rect: rect,\r\n }))\r\n let stimer: any = null\r\n let etimer: any = null\r\n ele.ontransitionstart = () => {\r\n clearTimeout(stimer)\r\n stimer = setTimeout(() => {\r\n const isOpen = ele.getAttribute('data-transition-state') === 'open';\r\n (onOpen && isOpen) && onOpen();\r\n (onClose && !isOpen) && onClose()\r\n onState && onState(isOpen ? \"open\" : \"close\")\r\n setState(s => ({\r\n ...s,\r\n stage: isOpen ? \"open\" : \"close\"\r\n }))\r\n }, 1)\r\n }\r\n\r\n ele.ontransitionend = () => {\r\n clearTimeout(etimer)\r\n etimer = setTimeout(() => {\r\n const isOpen = ele.getAttribute('data-transition-state') === 'open';\r\n (onOpened && isOpen) && onOpened();\r\n (onClosed && !isOpen) && onClosed();\r\n onState && onState(isOpen ? \"opened\" : \"closed\")\r\n setState(s => ({\r\n ...s,\r\n stage: isOpen ? \"opened\" : \"closed\"\r\n }))\r\n }, 1)\r\n }\r\n } else if (!state.initial) {\r\n setState(s => ({\r\n ...s,\r\n classname: style(from),\r\n rect: rect,\r\n }))\r\n }\r\n }, [open, state.initial, state.stage, exitOnUnmount])\r\n\r\n\r\n useEffect(() => {\r\n if (state.initial) {\r\n let _variant = state.variant !== variant ? variant : state.variant\r\n const { from, to } = getVariant(state.rect, _variant)\r\n let _css: CSSProps = open ? to : from\r\n let trans = ` ${duration}ms ${_ease} ${delay || 0}ms`\r\n let _ = {\r\n ..._css,\r\n transition: Object.keys(_css || {}).map(k => formatCSSProp(k)).join(trans + \", \") + trans,\r\n }\r\n setState(s => ({\r\n ...s,\r\n classname: style(_),\r\n variant: _variant\r\n }))\r\n }\r\n }, [open, state.initial, variant])\r\n\r\n return {\r\n exited: exitOnUnmount && state.stage === 'closed',\r\n props: {\r\n 'id': state.classname,\r\n 'data-transition': id,\r\n 'data-transition-state': open ? 'open' : 'close',\r\n }\r\n }\r\n}\r\n\r\n\r\nexport default useTransition"],"names":[],"mappings":";;;;;;;;AA8BA;AACG;AACH;AAEA;AACG;AACA;AAAS;AACT;AACH;AAEA;AAAuB;AACpB;AAcA;AACA;AACA;AACG;;AAEA;AACA;;AAEA;AACF;AAED;AACA;;;;;;;AAaS;;;AAQT;;;AAIG;AACA;;AACA;;AAEA;AACA;AACA;AACG;;;AAQA;;AAEG;;AAEG;;AAEA;;;AAMN;AAEA;;AAEG;;AAEG;;AAEA;;;AAMN;;AACI;;;AAOV;;AAIG;AACG;AACA;;;AAGA;;;;;AAaH;AACA;;AAEG;;AAEF;;AAEP;;"}
@@ -1,4 +1,6 @@
1
- 'use strict';Object.defineProperty(exports,'__esModule',{value:true});const slideDown = (rect) => {
1
+ 'use strict';
2
+
3
+ const slideDown = (rect) => {
2
4
  return {
3
5
  from: {
4
6
  transform: `translateY(-${rect.height}px)`,
@@ -155,4 +157,20 @@ const collapseHorizontal = (rect) => {
155
157
  overflow: "hidden"
156
158
  }
157
159
  };
158
- };exports.collapseHorizontal=collapseHorizontal;exports.collapseVertical=collapseVertical;exports.fade=fade;exports.fadeDown=fadeDown;exports.fadeLeft=fadeLeft;exports.fadeRight=fadeRight;exports.fadeUp=fadeUp;exports.grow=grow;exports.slideDown=slideDown;exports.slideLeft=slideLeft;exports.slideRight=slideRight;exports.slideUp=slideUp;exports.zoom=zoom;exports.zoomOver=zoomOver;//# sourceMappingURL=variants.js.map
160
+ };
161
+
162
+ exports.collapseHorizontal = collapseHorizontal;
163
+ exports.collapseVertical = collapseVertical;
164
+ exports.fade = fade;
165
+ exports.fadeDown = fadeDown;
166
+ exports.fadeLeft = fadeLeft;
167
+ exports.fadeRight = fadeRight;
168
+ exports.fadeUp = fadeUp;
169
+ exports.grow = grow;
170
+ exports.slideDown = slideDown;
171
+ exports.slideLeft = slideLeft;
172
+ exports.slideRight = slideRight;
173
+ exports.slideUp = slideUp;
174
+ exports.zoom = zoom;
175
+ exports.zoomOver = zoomOver;
176
+ //# sourceMappingURL=variants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"variants.js","sources":["../../../src/hooks/useTransition/variants.ts"],"sourcesContent":["\nexport const slideDown = (rect: DOMRect) => {\n\n return {\n from: {\n transform: `translateY(-${rect.height}px)`,\n },\n to: {\n transform: `translateY(0)`,\n }\n }\n}\n\nexport const slideUp = (rect: DOMRect) => {\n return {\n from: {\n transform: `translateY(${rect.height}px)`,\n },\n to: {\n transform: `translateY(0)`,\n }\n }\n}\n\nexport const slideRight = (rect: DOMRect) => {\n return {\n from: {\n transform: `translateX(-${rect.width}px)`,\n },\n to: {\n transform: `translateX(0)`,\n }\n }\n}\n\nexport const slideLeft = (rect: DOMRect) => {\n return {\n from: {\n transform: `translateX(${rect.width}px)`,\n },\n to: {\n transform: `translateX(0)`,\n }\n }\n}\n\nexport const fade = () => {\n return {\n from: {\n opacity: 0\n },\n to: {\n opacity: 1\n }\n }\n}\n\nexport const fadeDown = () => {\n return {\n from: {\n transform: `translateY(-30px)`,\n opacity: 0\n },\n to: {\n transform: `translateY(0)`,\n opacity: 1\n }\n }\n}\n\nexport const fadeUp = () => {\n return {\n from: {\n transform: `translateY(30px)`,\n opacity: 0\n },\n to: {\n transform: `translateY(0)`,\n opacity: 1\n }\n }\n}\n\nexport const fadeRight = () => {\n return {\n from: {\n transform: `translateX(-30px)`,\n opacity: 0\n },\n to: {\n transform: `translateX(0)`,\n opacity: 1\n }\n }\n}\n\nexport const fadeLeft = () => {\n return {\n from: {\n transform: `translateX(30px)`,\n opacity: 0\n },\n to: {\n transform: `translateX(0)`,\n opacity: 1\n }\n }\n}\n\nexport const grow = () => {\n return {\n from: {\n transform: \"scale(.8, .6)\",\n opacity: 0\n },\n to: {\n transform: \"scale(1)\",\n opacity: 1\n }\n }\n}\n\nexport const zoom = () => {\n return {\n from: {\n transform: \"scale(.8)\",\n opacity: 0\n },\n to: {\n transform: \"scale(1)\",\n opacity: 1\n }\n }\n}\n\nexport const zoomOver = () => {\n return {\n from: {\n transform: \"scale(1.2)\",\n opacity: 0\n },\n to: {\n transform: \"scale(1)\",\n opacity: 1\n }\n }\n}\n\nexport const collapseVertical = (rect: DOMRect) => {\n\n return {\n from: {\n maxHeight: 0 + \"px\",\n overflow: \"hidden\"\n },\n to: {\n maxHeight: rect.height,\n overflow: \"hidden\"\n }\n }\n}\n\n\nexport const collapseHorizontal = (rect: DOMRect) => {\n return {\n from: {\n width: 0 + \"px\",\n overflow: \"hidden\"\n },\n to: {\n width: rect?.width ? rect?.width + \"px\" : \"auto\",\n overflow: \"hidden\"\n }\n }\n}\n\n\n\n\n"],"names":[],"mappings":"sEACO,MAAM,SAAS,GAAG,CAAC,IAAa,KAAI;IAEvC,OAAO;AACH,QAAA,IAAI,EAAE;AACF,YAAA,SAAS,EAAE,CAAA,YAAA,EAAe,IAAI,CAAC,MAAM,CAAA,GAAA,CAAK;AAC7C,SAAA;AACD,QAAA,EAAE,EAAE;AACA,YAAA,SAAS,EAAE,CAAA,aAAA,CAAe;AAC7B;KACJ;AACL;AAEO,MAAM,OAAO,GAAG,CAAC,IAAa,KAAI;IACrC,OAAO;AACH,QAAA,IAAI,EAAE;AACF,YAAA,SAAS,EAAE,CAAA,WAAA,EAAc,IAAI,CAAC,MAAM,CAAA,GAAA,CAAK;AAC5C,SAAA;AACD,QAAA,EAAE,EAAE;AACA,YAAA,SAAS,EAAE,CAAA,aAAA,CAAe;AAC7B;KACJ;AACL;AAEO,MAAM,UAAU,GAAG,CAAC,IAAa,KAAI;IACxC,OAAO;AACH,QAAA,IAAI,EAAE;AACF,YAAA,SAAS,EAAE,CAAA,YAAA,EAAe,IAAI,CAAC,KAAK,CAAA,GAAA,CAAK;AAC5C,SAAA;AACD,QAAA,EAAE,EAAE;AACA,YAAA,SAAS,EAAE,CAAA,aAAA,CAAe;AAC7B;K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;AACf,YAAA,QAAQ,EAAE;AACb,SAAA;AACD,QAAA,EAAE,EAAE;YACA,KAAK,EAAE,CAAA,IAAI,KAAA,IAAA,IAAJ,IAAI,uBAAJ,IAAI,CAAE,KAAK,IAAG,CAAA,IAAI,KAAA,IAAA,IAAJ,IAAI,KAAA,MAAA,GAAA,MAAA,GAAJ,IAAI,CAAE,KAAK,IAAG,IAAI,GAAG,MAAM;AAChD,YAAA,QAAQ,EAAE;AACb;KACJ;AACL"}
1
+ {"version":3,"file":"variants.js","sources":["../../../src/hooks/useTransition/variants.ts"],"sourcesContent":["\r\nexport const slideDown = (rect: DOMRect) => {\r\n\r\n return {\r\n from: {\r\n transform: `translateY(-${rect.height}px)`,\r\n },\r\n to: {\r\n transform: `translateY(0)`,\r\n }\r\n }\r\n}\r\n\r\nexport const slideUp = (rect: DOMRect) => {\r\n return {\r\n from: {\r\n transform: `translateY(${rect.height}px)`,\r\n },\r\n to: {\r\n transform: `translateY(0)`,\r\n }\r\n }\r\n}\r\n\r\nexport const slideRight = (rect: DOMRect) => {\r\n return {\r\n from: {\r\n transform: `translateX(-${rect.width}px)`,\r\n },\r\n to: {\r\n transform: `translateX(0)`,\r\n }\r\n }\r\n}\r\n\r\nexport const slideLeft = (rect: DOMRect) => {\r\n return {\r\n from: {\r\n transform: `translateX(${rect.width}px)`,\r\n },\r\n to: {\r\n transform: `translateX(0)`,\r\n }\r\n }\r\n}\r\n\r\nexport const fade = () => {\r\n return {\r\n from: {\r\n opacity: 0\r\n },\r\n to: {\r\n opacity: 1\r\n }\r\n }\r\n}\r\n\r\nexport const fadeDown = () => {\r\n return {\r\n from: {\r\n transform: `translateY(-30px)`,\r\n opacity: 0\r\n },\r\n to: {\r\n transform: `translateY(0)`,\r\n opacity: 1\r\n }\r\n }\r\n}\r\n\r\nexport const fadeUp = () => {\r\n return {\r\n from: {\r\n transform: `translateY(30px)`,\r\n opacity: 0\r\n },\r\n to: {\r\n transform: `translateY(0)`,\r\n opacity: 1\r\n }\r\n }\r\n}\r\n\r\nexport const fadeRight = () => {\r\n return {\r\n from: {\r\n transform: `translateX(-30px)`,\r\n opacity: 0\r\n },\r\n to: {\r\n transform: `translateX(0)`,\r\n opacity: 1\r\n }\r\n }\r\n}\r\n\r\nexport const fadeLeft = () => {\r\n return {\r\n from: {\r\n transform: `translateX(30px)`,\r\n opacity: 0\r\n },\r\n to: {\r\n transform: `translateX(0)`,\r\n opacity: 1\r\n }\r\n }\r\n}\r\n\r\nexport const grow = () => {\r\n return {\r\n from: {\r\n transform: \"scale(.8, .6)\",\r\n opacity: 0\r\n },\r\n to: {\r\n transform: \"scale(1)\",\r\n opacity: 1\r\n }\r\n }\r\n}\r\n\r\nexport const zoom = () => {\r\n return {\r\n from: {\r\n transform: \"scale(.8)\",\r\n opacity: 0\r\n },\r\n to: {\r\n transform: \"scale(1)\",\r\n opacity: 1\r\n }\r\n }\r\n}\r\n\r\nexport const zoomOver = () => {\r\n return {\r\n from: {\r\n transform: \"scale(1.2)\",\r\n opacity: 0\r\n },\r\n to: {\r\n transform: \"scale(1)\",\r\n opacity: 1\r\n }\r\n }\r\n}\r\n\r\nexport const collapseVertical = (rect: DOMRect) => {\r\n\r\n return {\r\n from: {\r\n maxHeight: 0 + \"px\",\r\n overflow: \"hidden\"\r\n },\r\n to: {\r\n maxHeight: rect.height,\r\n overflow: \"hidden\"\r\n }\r\n }\r\n}\r\n\r\n\r\nexport const collapseHorizontal = (rect: DOMRect) => {\r\n return {\r\n from: {\r\n width: 0 + \"px\",\r\n overflow: \"hidden\"\r\n },\r\n to: {\r\n width: rect?.width ? rect?.width + \"px\" : \"auto\",\r\n overflow: \"hidden\"\r\n }\r\n }\r\n}\r\n\r\n\r\n\r\n\r\n"],"names":[],"mappings":";;AACO,MAAM,SAAS,GAAG,CAAC,IAAa,KAAI;IAEvC,OAAO;AACH,QAAA,IAAI,EAAE;AACF,YAAA,SAAS,EAAE,CAAA,YAAA,EAAe,IAAI,CAAC,MAAM,CAAA,GAAA,CA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AAEO,MAAM,QAAQ,GAAG,MAAK;IACzB,OAAO;AACH,QAAA,IAAI,EAAE;AACF,YAAA,SAAS,EAAE,YAAY;AACvB,YAAA,OAAO,EAAE;AACZ,SAAA;AACD,QAAA,EAAE,EAAE;AACA,YAAA,SAAS,EAAE,UAAU;AACrB,YAAA,OAAO,EAAE;AACZ;KACJ;AACL;AAEO,MAAM,gBAAgB,GAAG,CAAC,IAAa,KAAI;IAE9C,OAAO;AACH,QAAA,IAAI,EAAE;YACF,SAAS,EAAE,CAAC,GAAG,IAAI;AACnB,YAAA,QAAQ,EAAE;AACb,SAAA;AACD,QAAA,EAAE,EAAE;YACA,SAAS,EAAE,IAAI,CAAC,MAAM;AACtB,YAAA,QAAQ,EAAE;AACb;KACJ;AACL;AAGO,MAAM,kBAAkB,GAAG,CAAC,IAAa,KAAI;IAChD,OAAO;AACH,QAAA,IAAI,EAAE;YACF,KAAK,EAAE,CAAC,GAAG,IAAI;AACf,YAAA,QAAQ,EAAE;AACb,SAAA;AACD,QAAA,EAAE,EAAE;YACA,KAAK,EAAE,CAAA,IAAI,KAAA,IAAA,IAAJ,IAAI,uBAAJ,IAAI,CAAE,KAAK,IAAG,CAAA,IAAI,KAAA,IAAA,IAAJ,IAAI,KAAA,MAAA,GAAA,MAAA,GAAJ,IAAI,CAAE,KAAK,IAAG,IAAI,GAAG,MAAM;AAChD,YAAA,QAAQ,EAAE;AACb;KACJ;AACL;;;;;;;;;;;;;;;;;"}
@@ -155,4 +155,7 @@ const collapseHorizontal = (rect) => {
155
155
  overflow: "hidden"
156
156
  }
157
157
  };
158
- };export{collapseHorizontal,collapseVertical,fade,fadeDown,fadeLeft,fadeRight,fadeUp,grow,slideDown,slideLeft,slideRight,slideUp,zoom,zoomOver};//# sourceMappingURL=variants.mjs.map
158
+ };
159
+
160
+ export { collapseHorizontal, collapseVertical, fade, fadeDown, fadeLeft, fadeRight, fadeUp, grow, slideDown, slideLeft, slideRight, slideUp, zoom, zoomOver };
161
+ //# sourceMappingURL=variants.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"variants.mjs","sources":["../../../src/hooks/useTransition/variants.ts"],"sourcesContent":["\nexport const slideDown = (rect: DOMRect) => {\n\n return {\n from: {\n transform: `translateY(-${rect.height}px)`,\n },\n to: {\n transform: `translateY(0)`,\n }\n }\n}\n\nexport const slideUp = (rect: DOMRect) => {\n return {\n from: {\n transform: `translateY(${rect.height}px)`,\n },\n to: {\n transform: `translateY(0)`,\n }\n }\n}\n\nexport const slideRight = (rect: DOMRect) => {\n return {\n from: {\n transform: `translateX(-${rect.width}px)`,\n },\n to: {\n transform: `translateX(0)`,\n }\n }\n}\n\nexport const slideLeft = (rect: DOMRect) => {\n return {\n from: {\n transform: `translateX(${rect.width}px)`,\n },\n to: {\n transform: `translateX(0)`,\n }\n }\n}\n\nexport const fade = () => {\n return {\n from: {\n opacity: 0\n },\n to: {\n opacity: 1\n }\n }\n}\n\nexport const fadeDown = () => {\n return {\n from: {\n transform: `translateY(-30px)`,\n opacity: 0\n },\n to: {\n transform: `translateY(0)`,\n opacity: 1\n }\n }\n}\n\nexport const fadeUp = () => {\n return {\n from: {\n transform: `translateY(30px)`,\n opacity: 0\n },\n to: {\n transform: `translateY(0)`,\n opacity: 1\n }\n }\n}\n\nexport const fadeRight = () => {\n return {\n from: {\n transform: `translateX(-30px)`,\n opacity: 0\n },\n to: {\n transform: `translateX(0)`,\n opacity: 1\n }\n }\n}\n\nexport const fadeLeft = () => {\n return {\n from: {\n transform: `translateX(30px)`,\n opacity: 0\n },\n to: {\n transform: `translateX(0)`,\n opacity: 1\n }\n }\n}\n\nexport const grow = () => {\n return {\n from: {\n transform: \"scale(.8, .6)\",\n opacity: 0\n },\n to: {\n transform: \"scale(1)\",\n opacity: 1\n }\n }\n}\n\nexport const zoom = () => {\n return {\n from: {\n transform: \"scale(.8)\",\n opacity: 0\n },\n to: {\n transform: \"scale(1)\",\n opacity: 1\n }\n }\n}\n\nexport const zoomOver = () => {\n return {\n from: {\n transform: \"scale(1.2)\",\n opacity: 0\n },\n to: {\n transform: \"scale(1)\",\n opacity: 1\n }\n }\n}\n\nexport const collapseVertical = (rect: DOMRect) => {\n\n return {\n from: {\n maxHeight: 0 + \"px\",\n overflow: \"hidden\"\n },\n to: {\n maxHeight: rect.height,\n overflow: \"hidden\"\n }\n }\n}\n\n\nexport const collapseHorizontal = (rect: DOMRect) => {\n return {\n from: {\n width: 0 + \"px\",\n overflow: \"hidden\"\n },\n to: {\n width: rect?.width ? rect?.width + \"px\" : \"auto\",\n overflow: \"hidden\"\n }\n }\n}\n\n\n\n\n"],"names":[],"mappings":"AACO,MAAM,SAAS,GAAG,CAAC,IAAa,KAAI;IAEvC,OAAO;AACH,QAAA,IAAI,EAAE;AACF,YAAA,SAAS,EAAE,CAAA,YAAA,EAAe,IAAI,CAAC,MAAM,CAAA,GAAA,CAAK;AAC7C,SAAA;AACD,QAAA,EAAE,EAAE;AACA,YAAA,SAAS,EAAE,CAAA,aAAA,CAAe;AAC7B;KACJ;AACL;AAEO,MAAM,OAAO,GAAG,CAAC,IAAa,KAAI;IACrC,OAAO;AACH,QAAA,IAAI,EAAE;AACF,YAAA,SAAS,EAAE,CAAA,WAAA,EAAc,IAAI,CAAC,MAAM,CAAA,GAAA,CAAK;AAC5C,SAAA;AACD,QAAA,EAAE,EAAE;AACA,YAAA,SAAS,EAAE,CAAA,aAAA,CAAe;AAC7B;KACJ;AACL;AAEO,MAAM,UAAU,GAAG,CAAC,IAAa,KAAI;IACxC,OAAO;AACH,QAAA,IAAI,EAAE;AACF,YAAA,SAAS,EAAE,CAAA,YAAA,EAAe,IAAI,CAAC,KAAK,CAAA,GAAA,CAAK;AAC5C,SAAA;AACD,QAAA,EAAE,EAAE;AACA,YAAA,SAAS,EAAE,CAAA,aAAA,CAAe;AAC7B;KACJ;AACL;AAEO,MAAM,SAAS,GAAG,CAAC,IAAa,KAAI;IACvC,OAAO;AACH,QAAA,IAAI,EAAE;AACF,YAAA,SAAS,EAAE,C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I,uBAAJ,IAAI,CAAE,KAAK,IAAG,CAAA,IAAI,KAAA,IAAA,IAAJ,IAAI,KAAA,MAAA,GAAA,MAAA,GAAJ,IAAI,CAAE,KAAK,IAAG,IAAI,GAAG,MAAM;AAChD,YAAA,QAAQ,EAAE;AACb;KACJ;AACL"}
1
+ {"version":3,"file":"variants.mjs","sources":["../../../src/hooks/useTransition/variants.ts"],"sourcesContent":["\r\nexport const slideDown = (rect: DOMRect) => {\r\n\r\n return {\r\n from: {\r\n transform: `translateY(-${rect.height}px)`,\r\n },\r\n to: {\r\n transform: `translateY(0)`,\r\n }\r\n }\r\n}\r\n\r\nexport const slideUp = (rect: DOMRect) => {\r\n return {\r\n from: {\r\n transform: `translateY(${rect.height}px)`,\r\n },\r\n to: {\r\n transform: `translateY(0)`,\r\n }\r\n }\r\n}\r\n\r\nexport const slideRight = (rect: DOMRect) => {\r\n return {\r\n from: {\r\n transform: `translateX(-${rect.width}px)`,\r\n },\r\n to: {\r\n transform: `translateX(0)`,\r\n }\r\n }\r\n}\r\n\r\nexport const slideLeft = (rect: DOMRect) => {\r\n return {\r\n from: {\r\n transform: `translateX(${rect.width}px)`,\r\n },\r\n to: {\r\n transform: `translateX(0)`,\r\n }\r\n }\r\n}\r\n\r\nexport const fade = () => {\r\n return {\r\n from: {\r\n opacity: 0\r\n },\r\n to: {\r\n opacity: 1\r\n }\r\n }\r\n}\r\n\r\nexport const fadeDown = () => {\r\n return {\r\n from: {\r\n transform: `translateY(-30px)`,\r\n opacity: 0\r\n },\r\n to: {\r\n transform: `translateY(0)`,\r\n opacity: 1\r\n }\r\n }\r\n}\r\n\r\nexport const fadeUp = () => {\r\n return {\r\n from: {\r\n transform: `translateY(30px)`,\r\n opacity: 0\r\n },\r\n to: {\r\n transform: `translateY(0)`,\r\n opacity: 1\r\n }\r\n }\r\n}\r\n\r\nexport const fadeRight = () => {\r\n return {\r\n from: {\r\n transform: `translateX(-30px)`,\r\n opacity: 0\r\n },\r\n to: {\r\n transform: `translateX(0)`,\r\n opacity: 1\r\n }\r\n }\r\n}\r\n\r\nexport const fadeLeft = () => {\r\n return {\r\n from: {\r\n transform: `translateX(30px)`,\r\n opacity: 0\r\n },\r\n to: {\r\n transform: `translateX(0)`,\r\n opacity: 1\r\n }\r\n }\r\n}\r\n\r\nexport const grow = () => {\r\n return {\r\n from: {\r\n transform: \"scale(.8, .6)\",\r\n opacity: 0\r\n },\r\n to: {\r\n transform: \"scale(1)\",\r\n opacity: 1\r\n }\r\n }\r\n}\r\n\r\nexport const zoom = () => {\r\n return {\r\n from: {\r\n transform: \"scale(.8)\",\r\n opacity: 0\r\n },\r\n to: {\r\n transform: \"scale(1)\",\r\n opacity: 1\r\n }\r\n }\r\n}\r\n\r\nexport const zoomOver = () => {\r\n return {\r\n from: {\r\n transform: \"scale(1.2)\",\r\n opacity: 0\r\n },\r\n to: {\r\n transform: \"scale(1)\",\r\n opacity: 1\r\n }\r\n }\r\n}\r\n\r\nexport const collapseVertical = (rect: DOMRect) => {\r\n\r\n return {\r\n from: {\r\n maxHeight: 0 + \"px\",\r\n overflow: \"hidden\"\r\n },\r\n to: {\r\n maxHeight: rect.height,\r\n overflow: \"hidden\"\r\n }\r\n }\r\n}\r\n\r\n\r\nexport const collapseHorizontal = (rect: DOMRect) => {\r\n return {\r\n from: {\r\n width: 0 + \"px\",\r\n overflow: \"hidden\"\r\n },\r\n to: {\r\n width: rect?.width ? rect?.width + \"px\" : \"auto\",\r\n overflow: \"hidden\"\r\n }\r\n }\r\n}\r\n\r\n\r\n\r\n\r\n"],"names":[],"mappings":"AACO,MAAM,SAAS,GAAG,CAAC,IAAa,KAAI;IAEvC,OAAO;AACH,QAAA,IAAI,EAAE;AACF,YAAA,SAAS,EAAE,CAAA,YAAA,EAAe,IAAI,CAAC,MAAM,CAAA,GAAA,CAAK;AAC7C,SAAA;AACD,QAAA,EAAE,EAAE;AACA,YAAA,SAAS,EAAE,CAAA,aAAA,CAAe;AAC7B;KACJ;AACL;AAEO,MAAM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AO,EAAE;AACZ,SAAA;AACD,QAAA,EAAE,EAAE;AACA,YAAA,SAAS,EAAE,UAAU;AACrB,YAAA,OAAO,EAAE;AACZ;KACJ;AACL;AAEO,MAAM,gBAAgB,GAAG,CAAC,IAAa,KAAI;IAE9C,OAAO;AACH,QAAA,IAAI,EAAE;YACF,SAAS,EAAE,CAAC,GAAG,IAAI;AACnB,YAAA,QAAQ,EAAE;AACb,SAAA;AACD,QAAA,EAAE,EAAE;YACA,SAAS,EAAE,IAAI,CAAC,MAAM;AACtB,YAAA,QAAQ,EAAE;AACb;KACJ;AACL;AAGO,MAAM,kBAAkB,GAAG,CAAC,IAAa,KAAI;IAChD,OAAO;AACH,QAAA,IAAI,EAAE;YACF,KAAK,EAAE,CAAC,GAAG,IAAI;AACf,YAAA,QAAQ,EAAE;AACb,SAAA;AACD,QAAA,EAAE,EAAE;YACA,KAAK,EAAE,CAAA,IAAI,KAAA,IAAA,IAAJ,IAAI,uBAAJ,IAAI,CAAE,KAAK,IAAG,CAAA,IAAI,KAAA,IAAA,IAAJ,IAAI,KAAA,MAAA,GAAA,MAAA,GAAJ,IAAI,CAAE,KAAK,IAAG,IAAI,GAAG,MAAM;AAChD,YAAA,QAAQ,EAAE;AACb;KACJ;AACL;;;;"}
package/index.js CHANGED
@@ -1 +1,53 @@
1
- 'use strict';Object.defineProperty(exports,'__esModule',{value:true});var index$1=require('./Tag/index.js'),useTagProps=require('./Tag/useTagProps.js'),useAnimation=require('./hooks/useAnimation.js'),useColorTemplate=require('./hooks/useColorTemplate.js'),useBreakpoint=require('./breakpoint/useBreakpoint.js'),useBreakpointProps=require('./breakpoint/useBreakpointProps.js'),useInterface=require('./hooks/useInterface.js'),index$3=require('./hooks/useTransition/index.js'),index$2=require('./Transition/index.js'),index=require('./AppRoot/index.js'),usePortal=require('./hooks/usePortal.js'),Renderar=require('./AppRoot/Renderar.js'),index$4=require('./css/index.js'),index$5=require('./theme/index.js'),getValue=require('./css/getValue.js'),getProps=require('./css/getProps.js'),ThemeProvider=require('./theme/ThemeProvider.js'),createThemeSwitcher=require('./theme/createThemeSwitcher.js'),createTheme=require('./theme/createTheme.js'),core=require('./theme/core.js');exports.Tag=index$1.default;exports.useTagProps=useTagProps.default;exports.animationEases=useAnimation.animationEases;exports.useAnimation=useAnimation.default;exports.useColorTemplate=useColorTemplate.default;exports.useBreakpoint=useBreakpoint.default;exports.useBreakpointProps=useBreakpointProps.default;exports.useInterface=useInterface.default;exports.useTransition=index$3.default;exports.Transition=index$2.default;exports.AppRoot=index.default;exports.appRootElement=index.appRootElement;exports.usePortal=usePortal.usePortal;exports.Renderar=Renderar.Renderar;exports.adjustColor=index$4.adjustColor;exports.adjustTextContrast=index$4.adjustTextContrast;exports.alpha=index$4.alpha;exports.breakpoints=index$4.breakpoints;exports.css=index$4.css;exports.themeRootClass=index$5.themeRootClass;exports.getValue=getValue.default;exports.getProps=getProps.default;exports.ThemeProvider=ThemeProvider.default;exports.createThemeSwitcher=createThemeSwitcher.default;exports.createTheme=createTheme.createTheme;exports.getTheme=core.getTheme;exports.useTheme=core.useTheme;//# sourceMappingURL=index.js.map
1
+ 'use strict';
2
+
3
+ var index$1 = require('./Tag/index.js');
4
+ var useTagProps = require('./Tag/useTagProps.js');
5
+ var useAnimation = require('./hooks/useAnimation.js');
6
+ var useColorTemplate = require('./hooks/useColorTemplate.js');
7
+ var useBreakpoint = require('./breakpoint/useBreakpoint.js');
8
+ var useBreakpointProps = require('./breakpoint/useBreakpointProps.js');
9
+ var useInterface = require('./hooks/useInterface.js');
10
+ var index$3 = require('./hooks/useTransition/index.js');
11
+ var index$2 = require('./Transition/index.js');
12
+ var index = require('./AppRoot/index.js');
13
+ var usePortal = require('./hooks/usePortal.js');
14
+ var Renderar = require('./AppRoot/Renderar.js');
15
+ var index$4 = require('./css/index.js');
16
+ var index$5 = require('./theme/index.js');
17
+ var getValue = require('./css/getValue.js');
18
+ var getProps = require('./css/getProps.js');
19
+ var ThemeProvider = require('./theme/ThemeProvider.js');
20
+ var createThemeSwitcher = require('./theme/createThemeSwitcher.js');
21
+ var createTheme = require('./theme/createTheme.js');
22
+ var core = require('./theme/core.js');
23
+
24
+
25
+
26
+ exports.Tag = index$1;
27
+ exports.useTagProps = useTagProps;
28
+ exports.animationEases = useAnimation.animationEases;
29
+ exports.useAnimation = useAnimation.default;
30
+ exports.useColorTemplate = useColorTemplate;
31
+ exports.useBreakpoint = useBreakpoint;
32
+ exports.useBreakpointProps = useBreakpointProps;
33
+ exports.useInterface = useInterface;
34
+ exports.useTransition = index$3;
35
+ exports.Transition = index$2;
36
+ exports.AppRoot = index.default;
37
+ exports.appRootElement = index.appRootElement;
38
+ exports.usePortal = usePortal.usePortal;
39
+ exports.Renderar = Renderar.Renderar;
40
+ exports.adjustColor = index$4.adjustColor;
41
+ exports.adjustTextContrast = index$4.adjustTextContrast;
42
+ exports.alpha = index$4.alpha;
43
+ exports.breakpoints = index$4.breakpoints;
44
+ exports.css = index$4.css;
45
+ exports.themeRootClass = index$5.themeRootClass;
46
+ exports.getValue = getValue;
47
+ exports.getProps = getProps;
48
+ exports.ThemeProvider = ThemeProvider;
49
+ exports.createThemeSwitcher = createThemeSwitcher;
50
+ exports.createTheme = createTheme.createTheme;
51
+ exports.getTheme = core.getTheme;
52
+ exports.useTheme = core.useTheme;
53
+ //# sourceMappingURL=index.js.map
package/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
package/index.mjs CHANGED
@@ -1 +1,21 @@
1
- export{default as Tag}from'./Tag/index.mjs';export{default as useTagProps}from'./Tag/useTagProps.mjs';export{animationEases,default as useAnimation}from'./hooks/useAnimation.mjs';export{default as useColorTemplate}from'./hooks/useColorTemplate.mjs';export{default as useBreakpoint}from'./breakpoint/useBreakpoint.mjs';export{default as useBreakpointProps}from'./breakpoint/useBreakpointProps.mjs';export{default as useInterface}from'./hooks/useInterface.mjs';export{default as useTransition}from'./hooks/useTransition/index.mjs';export{default as Transition}from'./Transition/index.mjs';export{default as AppRoot,appRootElement}from'./AppRoot/index.mjs';export{usePortal}from'./hooks/usePortal.mjs';export{Renderar}from'./AppRoot/Renderar.mjs';export{adjustColor,adjustTextContrast,alpha,breakpoints,css}from'./css/index.mjs';export{themeRootClass}from'./theme/index.mjs';export{default as getValue}from'./css/getValue.mjs';export{default as getProps}from'./css/getProps.mjs';export{default as ThemeProvider}from'./theme/ThemeProvider.mjs';export{default as createThemeSwitcher}from'./theme/createThemeSwitcher.mjs';export{createTheme}from'./theme/createTheme.mjs';export{getTheme,useTheme}from'./theme/core.mjs';//# sourceMappingURL=index.mjs.map
1
+ export { default as Tag } from './Tag/index.mjs';
2
+ export { default as useTagProps } from './Tag/useTagProps.mjs';
3
+ export { animationEases, default as useAnimation } from './hooks/useAnimation.mjs';
4
+ export { default as useColorTemplate } from './hooks/useColorTemplate.mjs';
5
+ export { default as useBreakpoint } from './breakpoint/useBreakpoint.mjs';
6
+ export { default as useBreakpointProps } from './breakpoint/useBreakpointProps.mjs';
7
+ export { default as useInterface } from './hooks/useInterface.mjs';
8
+ export { default as useTransition } from './hooks/useTransition/index.mjs';
9
+ export { default as Transition } from './Transition/index.mjs';
10
+ export { default as AppRoot, appRootElement } from './AppRoot/index.mjs';
11
+ export { usePortal } from './hooks/usePortal.mjs';
12
+ export { Renderar } from './AppRoot/Renderar.mjs';
13
+ export { adjustColor, adjustTextContrast, alpha, breakpoints, css } from './css/index.mjs';
14
+ export { themeRootClass } from './theme/index.mjs';
15
+ export { default as getValue } from './css/getValue.mjs';
16
+ export { default as getProps } from './css/getProps.mjs';
17
+ export { default as ThemeProvider } from './theme/ThemeProvider.mjs';
18
+ export { default as createThemeSwitcher } from './theme/createThemeSwitcher.mjs';
19
+ export { createTheme } from './theme/createTheme.mjs';
20
+ export { getTheme, useTheme } from './theme/core.mjs';
21
+ //# sourceMappingURL=index.mjs.map
package/index.mjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
1
+ {"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xanui/core",
3
- "version": "1.2.31",
3
+ "version": "1.2.32",
4
4
  "description": "Xanui Core Library",
5
5
  "private": false,
6
6
  "main": "./index.js",
@@ -12,12 +12,6 @@
12
12
  "pretty-class": "^1.0.8",
13
13
  "react-state-bucket": "^1.2.11"
14
14
  },
15
- "devDependencies": {
16
- "@types/react": "^19.2.7",
17
- "@types/react-dom": "^19.2.3",
18
- "makepack": "^1.7.15",
19
- "typescript": "^5.9.3"
20
- },
21
15
  "keywords": [],
22
16
  "exports": {
23
17
  ".": {
@@ -26,4 +20,4 @@
26
20
  "types": "./index.d.ts"
27
21
  }
28
22
  }
29
- }
23
+ }
package/readme.md CHANGED
@@ -1,109 +1,109 @@
1
- # Xanui Core
2
-
3
- Xanui Core is a lightweight styling and theming toolkit for React. It bundles a constraint-based CSS generator, a TypeScript-friendly `<Tag>` primitive, responsive helpers, and an opinionated theme engine so that design tokens, animations, and layout logic stay consistent across your application.
4
-
5
- ## Highlights
6
-
7
- - Build any element with `<Tag>` and the ergonomic `sx`/alias props while still passing native attributes.
8
- - Author design tokens once via `createTheme`, ship them with `ThemeProvider`, and switch them at runtime with `createThemeSwitcher`.
9
- - Drive responsive layouts using `BreakpointProvider`, `useBreakpoint`, and `useBreakpointProps` without bespoke media queries.
10
- - Compose micro-animations through `useAnimation`, ready-made `Transition` variants, and reusable CSS utilities.
11
- - Support SSR portals by rehydrating critical styles with `RenderServerStyles`.
12
-
13
- ## Installation
14
-
15
- ```bash
16
- npm install @xanui/core
17
- ```
18
-
19
- ## Quick Start
20
-
21
- ```tsx
22
- import { ThemeProvider, Tag, createTheme, createThemeSwitcher } from '@xanui/core'
23
-
24
- // Register a custom theme once at startup
25
- createTheme('brand', {
26
- colors: {
27
- brand: { primary: '#7C3AED', secondary: '#5B21B6' },
28
- },
29
- })
30
-
31
- const useThemeSwitcher = createThemeSwitcher('brand', ThemeSwitcherOption)
32
-
33
- export const App = () => {
34
- const { name, change } = useThemeSwitcher()
35
-
36
- return (
37
- <ThemeProvider theme={name} isRootProvider>
38
- <Tag
39
- component="main"
40
- px={24}
41
- py={32}
42
- bgcolor="background"
43
- color="text.primary"
44
- gap={24}
45
- >
46
- <Tag component="h1" fontSize="h2">
47
- Xanui Core
48
- </Tag>
49
-
50
- <button onClick={() => change(name === 'brand' ? 'dark' : 'brand')}>
51
- Toggle Theme
52
- </button>
53
- </Tag>
54
- </ThemeProvider>
55
- )
56
- }
57
- ```
58
-
59
- ## Core Concepts
60
-
61
- - **Design Tokens** – `createTheme` merges your overrides with defaults and exposes typed references like `brand.primary` or typography presets.
62
- - **Adaptive Layout** – Wrap your app with `BreakpointProvider` (automatically included by `ThemeProvider` when `isRootProvider` is `true`) to consume breakpoint helpers throughout the tree.
63
- - **Composable Styles** – `css`, `getValue`, and `getProps` transform alias props, breakpoints, and pseudo selectors into atomic class names. Use them directly for utilities such as scrollbars or keyframes.
64
- - **Animation Primitives** – `useAnimation` builds scoped keyframes on the fly; `Transition` controls mount/unmount sequences with variants such as `fade`, `slideDown`, or `collapseVertical`.
65
-
66
- ## Server-Side Rendering
67
-
68
- When rendering on the server, collect the emitted styles:
69
-
70
- ```tsx
71
- import RenderServerStyles from '@xanui/core/RenderServerStyles'
72
-
73
- export const Document = () => (
74
- <html>
75
- <head>
76
- <RenderServerStyles />
77
- </head>
78
- <body>{/* app */}</body>
79
- </html>
80
- )
81
- ```
82
-
83
- ## Documentation
84
-
85
- Detailed API docs (props tables, option summaries, and usage examples) live inside the `docs/` directory. Each API/component has its own `README.md` for fast reference:
86
-
87
- - `docs/tag/README.md`
88
- - `docs/theme-provider/README.md`
89
- - `docs/transition/README.md`
90
- - `docs/use-animation/README.md`
91
- - `docs/use-color-template/README.md`
92
- - `docs/use-interface/README.md`
93
- - `docs/use-breakpoint/README.md`
94
- - `docs/use-breakpoint-props/README.md`
95
- - `docs/use-scrollbar/README.md`
96
- - `docs/render-server-styles/README.md`
97
- - `docs/css/README.md`
98
- - `docs/create-theme/README.md`
99
-
100
- ## Contributing
101
-
102
- 1. Fork and clone the repo.
103
- 2. Run `npm install`.
104
- 3. Use `npm run build` to verify type safety.
105
- 4. Submit a pull request that focuses on one improvement at a time.
106
-
107
- ---
108
-
109
- Need another integration example or a new preset? Open an issue so we can keep the primitives lean and discoverable.
1
+ # Xanui Core
2
+
3
+ Xanui Core is a lightweight styling and theming toolkit for React. It bundles a constraint-based CSS generator, a TypeScript-friendly `<Tag>` primitive, responsive helpers, and an opinionated theme engine so that design tokens, animations, and layout logic stay consistent across your application.
4
+
5
+ ## Highlights
6
+
7
+ - Build any element with `<Tag>` and the ergonomic `sx`/alias props while still passing native attributes.
8
+ - Author design tokens once via `createTheme`, ship them with `ThemeProvider`, and switch them at runtime with `createThemeSwitcher`.
9
+ - Drive responsive layouts using `BreakpointProvider`, `useBreakpoint`, and `useBreakpointProps` without bespoke media queries.
10
+ - Compose micro-animations through `useAnimation`, ready-made `Transition` variants, and reusable CSS utilities.
11
+ - Support SSR portals by rehydrating critical styles with `RenderServerStyles`.
12
+
13
+ ## Installation
14
+
15
+ ```bash
16
+ npm install @xanui/core
17
+ ```
18
+
19
+ ## Quick Start
20
+
21
+ ```tsx
22
+ import { ThemeProvider, Tag, createTheme, createThemeSwitcher } from '@xanui/core'
23
+
24
+ // Register a custom theme once at startup
25
+ createTheme('brand', {
26
+ colors: {
27
+ brand: { primary: '#7C3AED', secondary: '#5B21B6' },
28
+ },
29
+ })
30
+
31
+ const useThemeSwitcher = createThemeSwitcher('brand', ThemeSwitcherOption)
32
+
33
+ export const App = () => {
34
+ const { name, change } = useThemeSwitcher()
35
+
36
+ return (
37
+ <ThemeProvider theme={name} isRootProvider>
38
+ <Tag
39
+ component="main"
40
+ px={24}
41
+ py={32}
42
+ bgcolor="background"
43
+ color="text.primary"
44
+ gap={24}
45
+ >
46
+ <Tag component="h1" fontSize="h2">
47
+ Xanui Core
48
+ </Tag>
49
+
50
+ <button onClick={() => change(name === 'brand' ? 'dark' : 'brand')}>
51
+ Toggle Theme
52
+ </button>
53
+ </Tag>
54
+ </ThemeProvider>
55
+ )
56
+ }
57
+ ```
58
+
59
+ ## Core Concepts
60
+
61
+ - **Design Tokens** – `createTheme` merges your overrides with defaults and exposes typed references like `brand.primary` or typography presets.
62
+ - **Adaptive Layout** – Wrap your app with `BreakpointProvider` (automatically included by `ThemeProvider` when `isRootProvider` is `true`) to consume breakpoint helpers throughout the tree.
63
+ - **Composable Styles** – `css`, `getValue`, and `getProps` transform alias props, breakpoints, and pseudo selectors into atomic class names. Use them directly for utilities such as scrollbars or keyframes.
64
+ - **Animation Primitives** – `useAnimation` builds scoped keyframes on the fly; `Transition` controls mount/unmount sequences with variants such as `fade`, `slideDown`, or `collapseVertical`.
65
+
66
+ ## Server-Side Rendering
67
+
68
+ When rendering on the server, collect the emitted styles:
69
+
70
+ ```tsx
71
+ import RenderServerStyles from '@xanui/core/RenderServerStyles'
72
+
73
+ export const Document = () => (
74
+ <html>
75
+ <head>
76
+ <RenderServerStyles />
77
+ </head>
78
+ <body>{/* app */}</body>
79
+ </html>
80
+ )
81
+ ```
82
+
83
+ ## Documentation
84
+
85
+ Detailed API docs (props tables, option summaries, and usage examples) live inside the `docs/` directory. Each API/component has its own `README.md` for fast reference:
86
+
87
+ - `docs/tag/README.md`
88
+ - `docs/theme-provider/README.md`
89
+ - `docs/transition/README.md`
90
+ - `docs/use-animation/README.md`
91
+ - `docs/use-color-template/README.md`
92
+ - `docs/use-interface/README.md`
93
+ - `docs/use-breakpoint/README.md`
94
+ - `docs/use-breakpoint-props/README.md`
95
+ - `docs/use-scrollbar/README.md`
96
+ - `docs/render-server-styles/README.md`
97
+ - `docs/css/README.md`
98
+ - `docs/create-theme/README.md`
99
+
100
+ ## Contributing
101
+
102
+ 1. Fork and clone the repo.
103
+ 2. Run `npm install`.
104
+ 3. Use `npm run build` to verify type safety.
105
+ 4. Submit a pull request that focuses on one improvement at a time.
106
+
107
+ ---
108
+
109
+ Need another integration example or a new preset? Open an issue so we can keep the primitives lean and discoverable.
@@ -1,5 +1,10 @@
1
- 'use strict';Object.defineProperty(exports,'__esModule',{value:true});const ThemeCssVars = (theme) => {
1
+ 'use strict';
2
+
3
+ const ThemeCssVars = (theme) => {
2
4
  const shadows = {};
3
5
  theme.shadow.forEach((s, i) => shadows[`--shadow-${i}`] = s);
4
6
  return Object.assign({ "--bp-xs": theme.breakpoints.xs, "--bp-sm": theme.breakpoints.sm, "--bp-md": theme.breakpoints.md, "--bp-lg": theme.breakpoints.lg, "--bp-xl": theme.breakpoints.xl, "--font-h1": `${theme.typography.h1.fontWeight} ${theme.typography.h1.fontSize}px/${theme.typography.h1.lineHeight} inherit`, "--font-h2": `${theme.typography.h2.fontWeight} ${theme.typography.h2.fontSize}px/${theme.typography.h2.lineHeight} inherit`, "--font-h3": `${theme.typography.h3.fontWeight} ${theme.typography.h3.fontSize}px/${theme.typography.h3.lineHeight} inherit`, "--font-h4": `${theme.typography.h4.fontWeight} ${theme.typography.h4.fontSize}px/${theme.typography.h4.lineHeight} inherit`, "--font-h5": `${theme.typography.h5.fontWeight} ${theme.typography.h5.fontSize}px/${theme.typography.h5.lineHeight} inherit`, "--font-h6": `${theme.typography.h6.fontWeight} ${theme.typography.h6.fontSize}px/${theme.typography.h6.lineHeight} inherit`, "--font-big": `${theme.typography.big.fontWeight} ${theme.typography.text.fontSize}px/${theme.typography.text.lineHeight} inherit`, "--font-text": `${theme.typography.text.fontWeight} ${theme.typography.text.fontSize}px/${theme.typography.text.lineHeight} inherit`, "--font-button": `${theme.typography.button.fontWeight} ${theme.typography.button.fontSize}px/${theme.typography.button.lineHeight} inherit`, "--font-small": `${theme.typography.small.fontWeight} ${theme.typography.small.fontSize}px/${theme.typography.small.lineHeight} inherit`, "--fontsize-h1": `${theme.typography.h1.fontSize}px`, "--fontsize-h2": `${theme.typography.h2.fontSize}px`, "--fontsize-h3": `${theme.typography.h3.fontSize}px`, "--fontsize-h4": `${theme.typography.h4.fontSize}px`, "--fontsize-h5": `${theme.typography.h5.fontSize}px`, "--fontsize-h6": `${theme.typography.h6.fontSize}px`, "--fontsize-big": `${theme.typography.big.fontSize}px`, "--fontsize-text": `${theme.typography.text.fontSize}px`, "--fontsize-button": `${theme.typography.button.fontSize}px`, "--fontsize-small": `${theme.typography.small.fontSize}px`, "--fontweight-h1": theme.typography.h1.fontWeight + "", "--fontweight-h2": theme.typography.h2.fontWeight + "", "--fontweight-h3": theme.typography.h3.fontWeight + "", "--fontweight-h4": theme.typography.h4.fontWeight + "", "--fontweight-h5": theme.typography.h5.fontWeight + "", "--fontweight-h6": theme.typography.h6.fontWeight + "", "--fontweight-big": theme.typography.big.fontWeight + "", "--fontweight-text": theme.typography.text.fontWeight + "", "--fontweight-button": theme.typography.button.fontWeight + "", "--fontweight-small": theme.typography.small.fontWeight + "", "--lineheight-h1": theme.typography.h1.lineHeight + "", "--lineheight-h2": theme.typography.h2.lineHeight + "", "--lineheight-h3": theme.typography.h3.lineHeight + "", "--lineheight-h4": theme.typography.h4.lineHeight + "", "--lineheight-h5": theme.typography.h5.lineHeight + "", "--lineheight-h6": theme.typography.h6.lineHeight + "", "--lineheight-big": theme.typography.big.lineHeight + "", "--lineheight-text": theme.typography.text.lineHeight + "", "--lineheight-button": theme.typography.button.lineHeight + "", "--lineheight-small": theme.typography.small.lineHeight + "", "--color-background-primary": theme.colors.background.primary, "--color-background-secondary": theme.colors.background.secondary, "--color-text-primary": theme.colors.text.primary, "--color-text-secondary": theme.colors.text.secondary, "--color-divider-primary": theme.colors.divider.primary, "--color-divider-secondary": theme.colors.divider.secondary, "--color-divider-soft-primary": theme.colors.divider.soft.primary, "--color-divider-soft-secondary": theme.colors.divider.soft.secondary, "--color-brand-primary": theme.colors.brand.primary, "--color-brand-secondary": theme.colors.brand.secondary, "--color-brand-text": theme.colors.brand.text, "--color-brand-soft-primary": theme.colors.brand.soft.primary, "--color-brand-soft-secondary": theme.colors.brand.soft.secondary, "--color-accent-primary": theme.colors.accent.primary, "--color-accent-secondary": theme.colors.accent.secondary, "--color-accent-text": theme.colors.accent.text, "--color-accent-soft-primary": theme.colors.accent.soft.primary, "--color-accent-soft-secondary": theme.colors.accent.soft.secondary, "--color-info-primary": theme.colors.info.primary, "--color-info-secondary": theme.colors.info.secondary, "--color-info-text": theme.colors.info.text, "--color-info-soft-primary": theme.colors.info.soft.primary, "--color-info-soft-secondary": theme.colors.info.soft.secondary, "--color-success-primary": theme.colors.success.primary, "--color-success-secondary": theme.colors.success.secondary, "--color-success-text": theme.colors.success.text, "--color-success-soft-primary": theme.colors.success.soft.primary, "--color-success-soft-secondary": theme.colors.success.soft.secondary, "--color-warning-primary": theme.colors.warning.primary, "--color-warning-secondary": theme.colors.warning.secondary, "--color-warning-text": theme.colors.warning.text, "--color-warning-soft-primary": theme.colors.warning.soft.primary, "--color-warning-soft-secondary": theme.colors.warning.soft.secondary, "--color-danger-primary": theme.colors.danger.primary, "--color-danger-secondary": theme.colors.danger.secondary, "--color-danger-text": theme.colors.danger.text, "--color-danger-soft-primary": theme.colors.danger.soft.primary, "--color-danger-soft-secondary": theme.colors.danger.soft.secondary }, shadows);
5
- };exports.default=ThemeCssVars;//# sourceMappingURL=ThemeCssVars.js.map
7
+ };
8
+
9
+ module.exports = ThemeCssVars;
10
+ //# sourceMappingURL=ThemeCssVars.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ThemeCssVars.js","sources":["../../src/theme/ThemeCssVars.ts"],"sourcesContent":["import { ThemeOptions } from \"./types\";\n\nconst ThemeCssVars = (theme: ThemeOptions) => {\n\n const shadows: any = {}\n theme.shadow.forEach((s, i) => shadows[`--shadow-${i}`] = s)\n\n return {\n \"--bp-xs\": theme.breakpoints.xs,\n \"--bp-sm\": theme.breakpoints.sm,\n \"--bp-md\": theme.breakpoints.md,\n \"--bp-lg\": theme.breakpoints.lg,\n \"--bp-xl\": theme.breakpoints.xl,\n\n \"--font-h1\": `${theme.typography.h1.fontWeight} ${theme.typography.h1.fontSize}px/${theme.typography.h1.lineHeight} inherit`,\n \"--font-h2\": `${theme.typography.h2.fontWeight} ${theme.typography.h2.fontSize}px/${theme.typography.h2.lineHeight} inherit`,\n \"--font-h3\": `${theme.typography.h3.fontWeight} ${theme.typography.h3.fontSize}px/${theme.typography.h3.lineHeight} inherit`,\n \"--font-h4\": `${theme.typography.h4.fontWeight} ${theme.typography.h4.fontSize}px/${theme.typography.h4.lineHeight} inherit`,\n \"--font-h5\": `${theme.typography.h5.fontWeight} ${theme.typography.h5.fontSize}px/${theme.typography.h5.lineHeight} inherit`,\n \"--font-h6\": `${theme.typography.h6.fontWeight} ${theme.typography.h6.fontSize}px/${theme.typography.h6.lineHeight} inherit`,\n \"--font-big\": `${theme.typography.big.fontWeight} ${theme.typography.text.fontSize}px/${theme.typography.text.lineHeight} inherit`,\n \"--font-text\": `${theme.typography.text.fontWeight} ${theme.typography.text.fontSize}px/${theme.typography.text.lineHeight} inherit`,\n \"--font-button\": `${theme.typography.button.fontWeight} ${theme.typography.button.fontSize}px/${theme.typography.button.lineHeight} inherit`,\n \"--font-small\": `${theme.typography.small.fontWeight} ${theme.typography.small.fontSize}px/${theme.typography.small.lineHeight} inherit`,\n\n \"--fontsize-h1\": `${theme.typography.h1.fontSize}px`,\n \"--fontsize-h2\": `${theme.typography.h2.fontSize}px`,\n \"--fontsize-h3\": `${theme.typography.h3.fontSize}px`,\n \"--fontsize-h4\": `${theme.typography.h4.fontSize}px`,\n \"--fontsize-h5\": `${theme.typography.h5.fontSize}px`,\n \"--fontsize-h6\": `${theme.typography.h6.fontSize}px`,\n \"--fontsize-big\": `${theme.typography.big.fontSize}px`,\n \"--fontsize-text\": `${theme.typography.text.fontSize}px`,\n \"--fontsize-button\": `${theme.typography.button.fontSize}px`,\n \"--fontsize-small\": `${theme.typography.small.fontSize}px`,\n\n \"--fontweight-h1\": theme.typography.h1.fontWeight + \"\",\n \"--fontweight-h2\": theme.typography.h2.fontWeight + \"\",\n \"--fontweight-h3\": theme.typography.h3.fontWeight + \"\",\n \"--fontweight-h4\": theme.typography.h4.fontWeight + \"\",\n \"--fontweight-h5\": theme.typography.h5.fontWeight + \"\",\n \"--fontweight-h6\": theme.typography.h6.fontWeight + \"\",\n \"--fontweight-big\": theme.typography.big.fontWeight + \"\",\n \"--fontweight-text\": theme.typography.text.fontWeight + \"\",\n \"--fontweight-button\": theme.typography.button.fontWeight + \"\",\n \"--fontweight-small\": theme.typography.small.fontWeight + \"\",\n\n \"--lineheight-h1\": theme.typography.h1.lineHeight + \"\",\n \"--lineheight-h2\": theme.typography.h2.lineHeight + \"\",\n \"--lineheight-h3\": theme.typography.h3.lineHeight + \"\",\n \"--lineheight-h4\": theme.typography.h4.lineHeight + \"\",\n \"--lineheight-h5\": theme.typography.h5.lineHeight + \"\",\n \"--lineheight-h6\": theme.typography.h6.lineHeight + \"\",\n \"--lineheight-big\": theme.typography.big.lineHeight + \"\",\n \"--lineheight-text\": theme.typography.text.lineHeight + \"\",\n \"--lineheight-button\": theme.typography.button.lineHeight + \"\",\n \"--lineheight-small\": theme.typography.small.lineHeight + \"\",\n\n \"--color-background-primary\": theme.colors.background.primary,\n \"--color-background-secondary\": theme.colors.background.secondary,\n\n \"--color-text-primary\": theme.colors.text.primary,\n \"--color-text-secondary\": theme.colors.text.secondary,\n\n \"--color-divider-primary\": theme.colors.divider.primary,\n \"--color-divider-secondary\": theme.colors.divider.secondary,\n \"--color-divider-soft-primary\": theme.colors.divider.soft.primary,\n \"--color-divider-soft-secondary\": theme.colors.divider.soft.secondary,\n\n \"--color-brand-primary\": theme.colors.brand.primary,\n \"--color-brand-secondary\": theme.colors.brand.secondary,\n \"--color-brand-text\": theme.colors.brand.text,\n \"--color-brand-soft-primary\": theme.colors.brand.soft.primary,\n \"--color-brand-soft-secondary\": theme.colors.brand.soft.secondary,\n\n \"--color-accent-primary\": theme.colors.accent.primary,\n \"--color-accent-secondary\": theme.colors.accent.secondary,\n \"--color-accent-text\": theme.colors.accent.text,\n \"--color-accent-soft-primary\": theme.colors.accent.soft.primary,\n \"--color-accent-soft-secondary\": theme.colors.accent.soft.secondary,\n\n \"--color-info-primary\": theme.colors.info.primary,\n \"--color-info-secondary\": theme.colors.info.secondary,\n \"--color-info-text\": theme.colors.info.text,\n \"--color-info-soft-primary\": theme.colors.info.soft.primary,\n \"--color-info-soft-secondary\": theme.colors.info.soft.secondary,\n\n \"--color-success-primary\": theme.colors.success.primary,\n \"--color-success-secondary\": theme.colors.success.secondary,\n \"--color-success-text\": theme.colors.success.text,\n \"--color-success-soft-primary\": theme.colors.success.soft.primary,\n \"--color-success-soft-secondary\": theme.colors.success.soft.secondary,\n\n \"--color-warning-primary\": theme.colors.warning.primary,\n \"--color-warning-secondary\": theme.colors.warning.secondary,\n \"--color-warning-text\": theme.colors.warning.text,\n \"--color-warning-soft-primary\": theme.colors.warning.soft.primary,\n \"--color-warning-soft-secondary\": theme.colors.warning.soft.secondary,\n\n \"--color-danger-primary\": theme.colors.danger.primary,\n \"--color-danger-secondary\": theme.colors.danger.secondary,\n \"--color-danger-text\": theme.colors.danger.text,\n \"--color-danger-soft-primary\": theme.colors.danger.soft.primary,\n \"--color-danger-soft-secondary\": theme.colors.danger.soft.secondary,\n\n\n ...shadows,\n }\n}\n\n\nexport default ThemeCssVars"],"names":[],"mappings":"sEAEA,MAAM,YAAY,GAAG,CAAC,KAAmB,KAAI;IAEzC,MAAM,OAAO,GAAQ,EAAE;IACvB,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,OAAO,CAAC,CAAA,SAAA,EAAY,CAAC,EAAE,CAAC,GAAG,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A;AAElB"}
1
+ {"version":3,"file":"ThemeCssVars.js","sources":["../../src/theme/ThemeCssVars.ts"],"sourcesContent":["import { ThemeOptions } from \"./types\";\r\n\r\nconst ThemeCssVars = (theme: ThemeOptions) => {\r\n\r\n const shadows: any = {}\r\n theme.shadow.forEach((s, i) => shadows[`--shadow-${i}`] = s)\r\n\r\n return {\r\n \"--bp-xs\": theme.breakpoints.xs,\r\n \"--bp-sm\": theme.breakpoints.sm,\r\n \"--bp-md\": theme.breakpoints.md,\r\n \"--bp-lg\": theme.breakpoints.lg,\r\n \"--bp-xl\": theme.breakpoints.xl,\r\n\r\n \"--font-h1\": `${theme.typography.h1.fontWeight} ${theme.typography.h1.fontSize}px/${theme.typography.h1.lineHeight} inherit`,\r\n \"--font-h2\": `${theme.typography.h2.fontWeight} ${theme.typography.h2.fontSize}px/${theme.typography.h2.lineHeight} inherit`,\r\n \"--font-h3\": `${theme.typography.h3.fontWeight} ${theme.typography.h3.fontSize}px/${theme.typography.h3.lineHeight} inherit`,\r\n \"--font-h4\": `${theme.typography.h4.fontWeight} ${theme.typography.h4.fontSize}px/${theme.typography.h4.lineHeight} inherit`,\r\n \"--font-h5\": `${theme.typography.h5.fontWeight} ${theme.typography.h5.fontSize}px/${theme.typography.h5.lineHeight} inherit`,\r\n \"--font-h6\": `${theme.typography.h6.fontWeight} ${theme.typography.h6.fontSize}px/${theme.typography.h6.lineHeight} inherit`,\r\n \"--font-big\": `${theme.typography.big.fontWeight} ${theme.typography.text.fontSize}px/${theme.typography.text.lineHeight} inherit`,\r\n \"--font-text\": `${theme.typography.text.fontWeight} ${theme.typography.text.fontSize}px/${theme.typography.text.lineHeight} inherit`,\r\n \"--font-button\": `${theme.typography.button.fontWeight} ${theme.typography.button.fontSize}px/${theme.typography.button.lineHeight} inherit`,\r\n \"--font-small\": `${theme.typography.small.fontWeight} ${theme.typography.small.fontSize}px/${theme.typography.small.lineHeight} inherit`,\r\n\r\n \"--fontsize-h1\": `${theme.typography.h1.fontSize}px`,\r\n \"--fontsize-h2\": `${theme.typography.h2.fontSize}px`,\r\n \"--fontsize-h3\": `${theme.typography.h3.fontSize}px`,\r\n \"--fontsize-h4\": `${theme.typography.h4.fontSize}px`,\r\n \"--fontsize-h5\": `${theme.typography.h5.fontSize}px`,\r\n \"--fontsize-h6\": `${theme.typography.h6.fontSize}px`,\r\n \"--fontsize-big\": `${theme.typography.big.fontSize}px`,\r\n \"--fontsize-text\": `${theme.typography.text.fontSize}px`,\r\n \"--fontsize-button\": `${theme.typography.button.fontSize}px`,\r\n \"--fontsize-small\": `${theme.typography.small.fontSize}px`,\r\n\r\n \"--fontweight-h1\": theme.typography.h1.fontWeight + \"\",\r\n \"--fontweight-h2\": theme.typography.h2.fontWeight + \"\",\r\n \"--fontweight-h3\": theme.typography.h3.fontWeight + \"\",\r\n \"--fontweight-h4\": theme.typography.h4.fontWeight + \"\",\r\n \"--fontweight-h5\": theme.typography.h5.fontWeight + \"\",\r\n \"--fontweight-h6\": theme.typography.h6.fontWeight + \"\",\r\n \"--fontweight-big\": theme.typography.big.fontWeight + \"\",\r\n \"--fontweight-text\": theme.typography.text.fontWeight + \"\",\r\n \"--fontweight-button\": theme.typography.button.fontWeight + \"\",\r\n \"--fontweight-small\": theme.typography.small.fontWeight + \"\",\r\n\r\n \"--lineheight-h1\": theme.typography.h1.lineHeight + \"\",\r\n \"--lineheight-h2\": theme.typography.h2.lineHeight + \"\",\r\n \"--lineheight-h3\": theme.typography.h3.lineHeight + \"\",\r\n \"--lineheight-h4\": theme.typography.h4.lineHeight + \"\",\r\n \"--lineheight-h5\": theme.typography.h5.lineHeight + \"\",\r\n \"--lineheight-h6\": theme.typography.h6.lineHeight + \"\",\r\n \"--lineheight-big\": theme.typography.big.lineHeight + \"\",\r\n \"--lineheight-text\": theme.typography.text.lineHeight + \"\",\r\n \"--lineheight-button\": theme.typography.button.lineHeight + \"\",\r\n \"--lineheight-small\": theme.typography.small.lineHeight + \"\",\r\n\r\n \"--color-background-primary\": theme.colors.background.primary,\r\n \"--color-background-secondary\": theme.colors.background.secondary,\r\n\r\n \"--color-text-primary\": theme.colors.text.primary,\r\n \"--color-text-secondary\": theme.colors.text.secondary,\r\n\r\n \"--color-divider-primary\": theme.colors.divider.primary,\r\n \"--color-divider-secondary\": theme.colors.divider.secondary,\r\n \"--color-divider-soft-primary\": theme.colors.divider.soft.primary,\r\n \"--color-divider-soft-secondary\": theme.colors.divider.soft.secondary,\r\n\r\n \"--color-brand-primary\": theme.colors.brand.primary,\r\n \"--color-brand-secondary\": theme.colors.brand.secondary,\r\n \"--color-brand-text\": theme.colors.brand.text,\r\n \"--color-brand-soft-primary\": theme.colors.brand.soft.primary,\r\n \"--color-brand-soft-secondary\": theme.colors.brand.soft.secondary,\r\n\r\n \"--color-accent-primary\": theme.colors.accent.primary,\r\n \"--color-accent-secondary\": theme.colors.accent.secondary,\r\n \"--color-accent-text\": theme.colors.accent.text,\r\n \"--color-accent-soft-primary\": theme.colors.accent.soft.primary,\r\n \"--color-accent-soft-secondary\": theme.colors.accent.soft.secondary,\r\n\r\n \"--color-info-primary\": theme.colors.info.primary,\r\n \"--color-info-secondary\": theme.colors.info.secondary,\r\n \"--color-info-text\": theme.colors.info.text,\r\n \"--color-info-soft-primary\": theme.colors.info.soft.primary,\r\n \"--color-info-soft-secondary\": theme.colors.info.soft.secondary,\r\n\r\n \"--color-success-primary\": theme.colors.success.primary,\r\n \"--color-success-secondary\": theme.colors.success.secondary,\r\n \"--color-success-text\": theme.colors.success.text,\r\n \"--color-success-soft-primary\": theme.colors.success.soft.primary,\r\n \"--color-success-soft-secondary\": theme.colors.success.soft.secondary,\r\n\r\n \"--color-warning-primary\": theme.colors.warning.primary,\r\n \"--color-warning-secondary\": theme.colors.warning.secondary,\r\n \"--color-warning-text\": theme.colors.warning.text,\r\n \"--color-warning-soft-primary\": theme.colors.warning.soft.primary,\r\n \"--color-warning-soft-secondary\": theme.colors.warning.soft.secondary,\r\n\r\n \"--color-danger-primary\": theme.colors.danger.primary,\r\n \"--color-danger-secondary\": theme.colors.danger.secondary,\r\n \"--color-danger-text\": theme.colors.danger.text,\r\n \"--color-danger-soft-primary\": theme.colors.danger.soft.primary,\r\n \"--color-danger-soft-secondary\": theme.colors.danger.soft.secondary,\r\n\r\n\r\n ...shadows,\r\n }\r\n}\r\n\r\n\r\nexport default ThemeCssVars"],"names":[],"mappings":";;AAEA,MAAM,YAAY,GAAG,CAAC,KAAmB,KAAI;IAEzC,MAAM,OAAO,GAAQ,EAAE;IACvB,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,OAAO,CAAC,CAAA,SAAA,EAAY,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;AAE5D,IAAA,OAAA,MAAA,CAAA,MAAA,CAAA,EACI,SAAS,EAAE,KAAK,CAAC,WAAW,CAAC,EAAE,EAC/B,SAAS,EAAE,KAAK,CAAC,WAAW,CAAC,EAAE,EAC/B,SAAS,EAAE,KAAK,CAAC,WAAW,CAAC,EAAE,EAC/B,SAAS,EAAE,KAAK,CAAC,WAAW,CAAC,EAAE,EAC/B,SAAS,EAAE,KAAK,CAAC,WAAW,CAAC,EAAE,EAE/B,WAAW,EAAE,CAAA,EAAG,KAAK,CAAC,UAAU,CAAC,EAAE,CAAC,UAAU,CAAA,CAAA,EAAI,KAAK,CAAC,UAAU,CAAC,EAAE,CAAC,QAAQ,CAAA,GAAA,EAAM,KAAK,CAAC,UAAU,CAAC,EAAE,CAAC,UAAU,CAAA,QAAA,CAAU,EAC5H,WAAW,EAAE,CAAA,EAAG,KAAK,CAAC,UAAU,CAAC,EAAE,CAAC,UAAU,CAAA,CAAA,EAAI,KAAK,CAAC,UAAU,CAAC,EAAE,CAAC,QAAQ,CAAA,GAAA,EAAM,KAAK,CAAC,UAAU,CAAC,EAAE,CAAC,UAAU,CAAA,QAAA,CAAU,EAC5H,WAAW,EAAE,CAAA,EAAG,KAAK,CAAC,UAAU,CAAC,EAAE,CAAC,UA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