@xanui/core 1.1.3 → 1.1.6

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 (200) hide show
  1. package/ServerStyleTags.d.ts +3 -1
  2. package/ServerStyleTags.js +3 -2
  3. package/ServerStyleTags.js.map +1 -7
  4. package/ServerStyleTags.mjs +3 -0
  5. package/ServerStyleTags.mjs.map +1 -0
  6. package/Tag/cssPropList.js +186 -2
  7. package/Tag/cssPropList.js.map +1 -7
  8. package/Tag/cssPropList.mjs +186 -0
  9. package/Tag/cssPropList.mjs.map +1 -0
  10. package/Tag/index.d.ts +4 -2
  11. package/Tag/index.js +6 -2
  12. package/Tag/index.js.map +1 -7
  13. package/Tag/index.mjs +6 -0
  14. package/Tag/index.mjs.map +1 -0
  15. package/Tag/types.d.ts +9 -7
  16. package/Tag/useTagProps.d.ts +4 -2
  17. package/Tag/useTagProps.js +21 -2
  18. package/Tag/useTagProps.js.map +1 -7
  19. package/Tag/useTagProps.mjs +21 -0
  20. package/Tag/useTagProps.mjs.map +1 -0
  21. package/Transition/index.d.ts +13 -10
  22. package/Transition/index.js +93 -2
  23. package/Transition/index.js.map +1 -7
  24. package/Transition/index.mjs +93 -0
  25. package/Transition/index.mjs.map +1 -0
  26. package/Transition/variants.d.ts +18 -15
  27. package/Transition/variants.js +158 -2
  28. package/Transition/variants.js.map +1 -7
  29. package/Transition/variants.mjs +158 -0
  30. package/Transition/variants.mjs.map +1 -0
  31. package/breakpoint/BreakpointProvider.js +43 -0
  32. package/breakpoint/BreakpointProvider.js.map +1 -0
  33. package/breakpoint/BreakpointProvider.mjs +43 -0
  34. package/breakpoint/BreakpointProvider.mjs.map +1 -0
  35. package/breakpoint/useBreakpoint.d.ts +4 -2
  36. package/breakpoint/useBreakpoint.js +23 -2
  37. package/breakpoint/useBreakpoint.js.map +1 -7
  38. package/breakpoint/useBreakpoint.mjs +23 -0
  39. package/breakpoint/useBreakpoint.mjs.map +1 -0
  40. package/breakpoint/useBreakpointProps.d.ts +6 -3
  41. package/breakpoint/useBreakpointProps.js +42 -2
  42. package/breakpoint/useBreakpointProps.js.map +1 -7
  43. package/breakpoint/useBreakpointProps.mjs +42 -0
  44. package/breakpoint/useBreakpointProps.mjs.map +1 -0
  45. package/css/aliases.js +29 -2
  46. package/css/aliases.js.map +1 -7
  47. package/css/aliases.mjs +29 -0
  48. package/css/aliases.mjs.map +1 -0
  49. package/css/getProps.d.ts +4 -2
  50. package/css/getProps.js +32 -2
  51. package/css/getProps.js.map +1 -7
  52. package/css/getProps.mjs +32 -0
  53. package/css/getProps.mjs.map +1 -0
  54. package/css/getValue.d.ts +4 -2
  55. package/css/getValue.js +92 -2
  56. package/css/getValue.js.map +1 -7
  57. package/css/getValue.mjs +92 -0
  58. package/css/getValue.mjs.map +1 -0
  59. package/css/index.d.ts +10 -9
  60. package/css/index.js +55 -2
  61. package/css/index.js.map +1 -7
  62. package/css/index.mjs +55 -0
  63. package/css/index.mjs.map +1 -0
  64. package/css/types.d.ts +12 -9
  65. package/index.d.ts +19 -21
  66. package/index.js +1 -2
  67. package/index.js.map +1 -7
  68. package/index.mjs +1 -0
  69. package/index.mjs.map +1 -0
  70. package/isWindow.d.ts +2 -1
  71. package/isWindow.js +1 -2
  72. package/isWindow.js.map +1 -7
  73. package/isWindow.mjs +1 -0
  74. package/isWindow.mjs.map +1 -0
  75. package/package.json +28 -24
  76. package/theme/ThemeCssVars.js +5 -2
  77. package/theme/ThemeCssVars.js.map +1 -7
  78. package/theme/ThemeCssVars.mjs +5 -0
  79. package/theme/ThemeCssVars.mjs.map +1 -0
  80. package/theme/ThemeDefaultOptions.js +131 -2
  81. package/theme/ThemeDefaultOptions.js.map +1 -7
  82. package/theme/ThemeDefaultOptions.mjs +131 -0
  83. package/theme/ThemeDefaultOptions.mjs.map +1 -0
  84. package/theme/ThemeProvider.d.ts +7 -4
  85. package/theme/ThemeProvider.js +88 -2
  86. package/theme/ThemeProvider.js.map +1 -7
  87. package/theme/ThemeProvider.mjs +88 -0
  88. package/theme/ThemeProvider.mjs.map +1 -0
  89. package/theme/core.d.ts +6 -7
  90. package/theme/core.js +18 -2
  91. package/theme/core.js.map +1 -7
  92. package/theme/core.mjs +18 -0
  93. package/theme/core.mjs.map +1 -0
  94. package/theme/createColor.js +46 -2
  95. package/theme/createColor.js.map +1 -7
  96. package/theme/createColor.mjs +46 -0
  97. package/theme/createColor.mjs.map +1 -0
  98. package/theme/createTheme.js +21 -2
  99. package/theme/createTheme.js.map +1 -7
  100. package/theme/createTheme.mjs +21 -0
  101. package/theme/createTheme.mjs.map +1 -0
  102. package/theme/createThemeSwitcher.d.ts +5 -2
  103. package/theme/createThemeSwitcher.js +12 -2
  104. package/theme/createThemeSwitcher.js.map +1 -7
  105. package/theme/createThemeSwitcher.mjs +12 -0
  106. package/theme/createThemeSwitcher.mjs.map +1 -0
  107. package/theme/index.js +2 -2
  108. package/theme/index.js.map +1 -7
  109. package/theme/index.mjs +2 -0
  110. package/theme/index.mjs.map +1 -0
  111. package/theme/types.d.ts +17 -14
  112. package/useAnimation.d.ts +7 -4
  113. package/useAnimation.js +25 -2
  114. package/useAnimation.js.map +1 -7
  115. package/useAnimation.mjs +25 -0
  116. package/useAnimation.mjs.map +1 -0
  117. package/useColorTemplate.d.ts +5 -3
  118. package/useColorTemplate.js +6 -2
  119. package/useColorTemplate.js.map +1 -7
  120. package/useColorTemplate.mjs +6 -0
  121. package/useColorTemplate.mjs.map +1 -0
  122. package/useInterface.d.ts +5 -2
  123. package/useInterface.js +8 -2
  124. package/useInterface.js.map +1 -7
  125. package/useInterface.mjs +8 -0
  126. package/useInterface.mjs.map +1 -0
  127. package/Tag/cssPropList.d.ts +0 -2
  128. package/Tag/types.js +0 -1
  129. package/Tag/types.js.map +0 -7
  130. package/breakpoint/index.d.ts +0 -6
  131. package/breakpoint/index.js +0 -2
  132. package/breakpoint/index.js.map +0 -7
  133. package/cjs/ServerStyleTags.js +0 -2
  134. package/cjs/ServerStyleTags.js.map +0 -7
  135. package/cjs/Tag/cssPropList.js +0 -2
  136. package/cjs/Tag/cssPropList.js.map +0 -7
  137. package/cjs/Tag/index.js +0 -2
  138. package/cjs/Tag/index.js.map +0 -7
  139. package/cjs/Tag/types.js +0 -2
  140. package/cjs/Tag/types.js.map +0 -7
  141. package/cjs/Tag/useTagProps.js +0 -2
  142. package/cjs/Tag/useTagProps.js.map +0 -7
  143. package/cjs/Transition/index.js +0 -2
  144. package/cjs/Transition/index.js.map +0 -7
  145. package/cjs/Transition/variants.js +0 -2
  146. package/cjs/Transition/variants.js.map +0 -7
  147. package/cjs/breakpoint/index.js +0 -2
  148. package/cjs/breakpoint/index.js.map +0 -7
  149. package/cjs/breakpoint/useBreakpoint.js +0 -2
  150. package/cjs/breakpoint/useBreakpoint.js.map +0 -7
  151. package/cjs/breakpoint/useBreakpointProps.js +0 -2
  152. package/cjs/breakpoint/useBreakpointProps.js.map +0 -7
  153. package/cjs/css/aliases.js +0 -2
  154. package/cjs/css/aliases.js.map +0 -7
  155. package/cjs/css/getProps.js +0 -2
  156. package/cjs/css/getProps.js.map +0 -7
  157. package/cjs/css/getValue.js +0 -2
  158. package/cjs/css/getValue.js.map +0 -7
  159. package/cjs/css/index.js +0 -2
  160. package/cjs/css/index.js.map +0 -7
  161. package/cjs/css/types.js +0 -2
  162. package/cjs/css/types.js.map +0 -7
  163. package/cjs/index.js +0 -2
  164. package/cjs/index.js.map +0 -7
  165. package/cjs/isWindow.js +0 -2
  166. package/cjs/isWindow.js.map +0 -7
  167. package/cjs/theme/ThemeCssVars.js +0 -2
  168. package/cjs/theme/ThemeCssVars.js.map +0 -7
  169. package/cjs/theme/ThemeDefaultOptions.js +0 -2
  170. package/cjs/theme/ThemeDefaultOptions.js.map +0 -7
  171. package/cjs/theme/ThemeProvider.js +0 -2
  172. package/cjs/theme/ThemeProvider.js.map +0 -7
  173. package/cjs/theme/core.js +0 -2
  174. package/cjs/theme/core.js.map +0 -7
  175. package/cjs/theme/createColor.js +0 -2
  176. package/cjs/theme/createColor.js.map +0 -7
  177. package/cjs/theme/createTheme.js +0 -2
  178. package/cjs/theme/createTheme.js.map +0 -7
  179. package/cjs/theme/createThemeSwitcher.js +0 -2
  180. package/cjs/theme/createThemeSwitcher.js.map +0 -7
  181. package/cjs/theme/index.js +0 -2
  182. package/cjs/theme/index.js.map +0 -7
  183. package/cjs/theme/types.js +0 -2
  184. package/cjs/theme/types.js.map +0 -7
  185. package/cjs/useAnimation.js +0 -2
  186. package/cjs/useAnimation.js.map +0 -7
  187. package/cjs/useColorTemplate.js +0 -2
  188. package/cjs/useColorTemplate.js.map +0 -7
  189. package/cjs/useInterface.js +0 -2
  190. package/cjs/useInterface.js.map +0 -7
  191. package/css/aliases.d.ts +0 -4
  192. package/css/types.js +0 -1
  193. package/css/types.js.map +0 -7
  194. package/theme/ThemeCssVars.d.ts +0 -3
  195. package/theme/ThemeDefaultOptions.d.ts +0 -68
  196. package/theme/createColor.d.ts +0 -41
  197. package/theme/createTheme.d.ts +0 -2
  198. package/theme/index.d.ts +0 -5
  199. package/theme/types.js +0 -1
  200. package/theme/types.js.map +0 -7
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createColor.mjs","sources":["../../src/theme/createColor.ts"],"sourcesContent":["import { ThemeOptions, ThemeColor } from \"./types\"\nimport { alpha } from \"../css\"\n\nconst createColor = (theme: ThemeOptions, name: keyof ThemeColor) => {\n let color = theme.colors[name]\n let { primary, secondary } = color as any\n let text = (color as any).text || theme.colors.text.primary\n let _alpha = alpha(primary, .1)\n\n const isBag = (a: any, b: any) => name === \"background\" ? a : b\n\n return {\n alpha: _alpha,\n template: {\n outline: {\n bgcolor: \"transparent\",\n color: isBag(text, primary),\n border: 1,\n borderColor: isBag(\"divider\", alpha(primary, .4)),\n hover: {\n color: isBag(text, primary),\n borderColor: isBag(\"divider\", alpha(primary, .8)),\n }\n },\n fill: {\n bgcolor: isBag(secondary, primary),\n color: text,\n hover: {\n bgcolor: isBag(alpha(secondary, .6), secondary),\n color: text,\n }\n },\n text: {\n bgcolor: \"transparent\",\n color: isBag(text, primary),\n hover: {\n bgcolor: isBag(alpha(secondary, .6), alpha(primary, .1)),\n color: isBag(text, primary),\n }\n },\n alpha: {\n bgcolor: isBag(alpha(secondary, .5), alpha(primary, .1)),\n color: isBag(text, primary),\n hover: {\n bgcolor: isBag(alpha(secondary, .8), alpha(primary, .15)),\n color: isBag(text, primary),\n }\n }\n }\n }\n}\n\nexport default createColor"],"names":[],"mappings":"qCAGA,MAAM,WAAW,GAAG,CAAC,KAAmB,EAAE,IAAsB,KAAI;IACjE,IAAI,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC;AAC9B,IAAA,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,GAAG,KAAY;AACzC,IAAA,IAAI,IAAI,GAAI,KAAa,CAAC,IAAI,IAAI,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO;IAC3D,IAAI,MAAM,GAAG,KAAK,CAAC,OAAO,EAAE,EAAE,CAAC;IAE/B,MAAM,KAAK,GAAG,CAAC,CAAM,EAAE,CAAM,KAAK,IAAI,KAAK,YAAY,GAAG,CAAC,GAAG,CAAC;IAE/D,OAAO;AACJ,QAAA,KAAK,EAAE,MAAM;AACb,QAAA,QAAQ,EAAE;AACP,YAAA,OAAO,EAAE;AACN,gBAAA,OAAO,EAAE,aAAa;AACtB,gBAAA,KAAK,EAAE,KAAK,CAAC,IAAI,EAAE,OAAO,CAAC;AAC3B,gBAAA,MAAM,EAAE,CAAC;gBACT,WAAW,EAAE,KAAK,CAAC,SAAS,EAAE,KAAK,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;AACjD,gBAAA,KAAK,EAAE;AACJ,oBAAA,KAAK,EAAE,KAAK,CAAC,IAAI,EAAE,OAAO,CAAC;oBAC3B,WAAW,EAAE,KAAK,CAAC,SAAS,EAAE,KAAK,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;AACnD;AACH,aAAA;AACD,YAAA,IAAI,EAAE;AACH,gBAAA,OAAO,EAAE,KAAK,CAAC,SAAS,EAAE,OAAO,CAAC;AAClC,gBAAA,KAAK,EAAE,IAAI;AACX,gBAAA,KAAK,EAAE;oBACJ,OAAO,EAAE,KAAK,CAAC,KAAK,CAAC,SAAS,EAAE,EAAE,CAAC,EAAE,SAAS,CAAC;AAC/C,oBAAA,KAAK,EAAE,IAAI;AACb;AACH,aAAA;AACD,YAAA,IAAI,EAAE;AACH,gBAAA,OAAO,EAAE,aAAa;AACtB,gBAAA,KAAK,EAAE,KAAK,CAAC,IAAI,EAAE,OAAO,CAAC;AAC3B,gBAAA,KAAK,EAAE;AACJ,oBAAA,OAAO,EAAE,KAAK,CAAC,KAAK,CAAC,SAAS,EAAE,EAAE,CAAC,EAAE,KAAK,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;AACxD,oBAAA,KAAK,EAAE,KAAK,CAAC,IAAI,EAAE,OAAO,CAAC;AAC7B;AACH,aAAA;AACD,YAAA,KAAK,EAAE;AACJ,gBAAA,OAAO,EAAE,KAAK,CAAC,KAAK,CAAC,SAAS,EAAE,EAAE,CAAC,EAAE,KAAK,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;AACxD,gBAAA,KAAK,EAAE,KAAK,CAAC,IAAI,EAAE,OAAO,CAAC;AAC3B,gBAAA,KAAK,EAAE;AACJ,oBAAA,OAAO,EAAE,KAAK,CAAC,KAAK,CAAC,SAAS,EAAE,EAAE,CAAC,EAAE,KAAK,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;AACzD,oBAAA,KAAK,EAAE,KAAK,CAAC,IAAI,EAAE,OAAO,CAAC;AAC7B;AACH;AACH;KACH;AACJ"}
@@ -1,2 +1,21 @@
1
- import s,{darkColorPallete as m}from"./ThemeDefaultOptions";import{mergeObject as n,ThemeFactory as t}from"./core";import r from"./createColor";import{breakpoints as c}from"../css";const u=(o,a,i)=>{if(t.has(o))throw new Error(`theme "${o}" already exists!`);{let e=n(s,{...i?m:{},...a,name:o,breakpoints:c});e=n(e,{colors:{background:r(e,"background"),brand:r(e,"brand"),accent:r(e,"accent"),info:r(e,"info"),success:r(e,"success"),warning:r(e,"warning"),danger:r(e,"danger")}}),t.set(o,e)}return t.get(o)};export{u as createTheme};
2
- //# sourceMappingURL=createTheme.js.map
1
+ 'use strict';Object.defineProperty(exports,'__esModule',{value:true});var ThemeDefaultOptions=require('./ThemeDefaultOptions.js'),core=require('./core.js'),createColor=require('./createColor.js'),index=require('../css/index.js');const createTheme = (name, options, darkMode) => {
2
+ if (!core.ThemeFactory.has(name)) {
3
+ let theme = core.mergeObject(ThemeDefaultOptions.default, Object.assign(Object.assign(Object.assign({}, ({})), options), { name, breakpoints: index.breakpoints }));
4
+ theme = core.mergeObject(theme, {
5
+ colors: {
6
+ background: createColor(theme, "background"),
7
+ brand: createColor(theme, "brand"),
8
+ accent: createColor(theme, "accent"),
9
+ info: createColor(theme, "info"),
10
+ success: createColor(theme, "success"),
11
+ warning: createColor(theme, "warning"),
12
+ danger: createColor(theme, "danger")
13
+ }
14
+ });
15
+ core.ThemeFactory.set(name, theme);
16
+ }
17
+ else {
18
+ throw new Error(`theme "${name}" already exists!`);
19
+ }
20
+ return core.ThemeFactory.get(name);
21
+ };exports.createTheme=createTheme;//# sourceMappingURL=createTheme.js.map
@@ -1,7 +1 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/theme/createTheme.ts"],
4
- "sourcesContent": ["import { ThemeOptions, ThemeOptionInput } from \"./types\"\nimport defaultThemeOption, { darkColorPallete } from './ThemeDefaultOptions'\nimport { mergeObject, ThemeFactory } from \"./core\"\nimport createColor from \"./createColor\"\nimport { breakpoints } from \"../css\"\n\nexport const createTheme = (name: string, options: ThemeOptionInput, darkMode?: boolean): ThemeOptions => {\n if (!ThemeFactory.has(name)) {\n let theme: any = mergeObject(defaultThemeOption, {\n ...(darkMode ? darkColorPallete : {}),\n ...options,\n name,\n breakpoints: breakpoints\n })\n\n theme = mergeObject(theme, {\n colors: {\n background: createColor(theme, \"background\"),\n brand: createColor(theme, \"brand\"),\n accent: createColor(theme, \"accent\"),\n info: createColor(theme, \"info\"),\n success: createColor(theme, \"success\"),\n warning: createColor(theme, \"warning\"),\n danger: createColor(theme, \"danger\")\n }\n })\n ThemeFactory.set(name, theme)\n } else {\n throw new Error(`theme \"${name}\" already exists!`);\n }\n\n return ThemeFactory.get(name) as ThemeOptions\n}\n"],
5
- "mappings": "AACA,OAAOA,GAAsB,oBAAAC,MAAwB,wBACrD,OAAS,eAAAC,EAAa,gBAAAC,MAAoB,SAC1C,OAAOC,MAAiB,gBACxB,OAAS,eAAAC,MAAmB,SAErB,MAAMC,EAAc,CAACC,EAAcC,EAA2BC,IAAqC,CACvG,GAAKN,EAAa,IAAII,CAAI,EAqBvB,MAAM,IAAI,MAAM,UAAUA,CAAI,mBAAmB,EArBvB,CAC1B,IAAIG,EAAaR,EAAYF,EAAoB,CAC9C,GAAIS,EAAWR,EAAmB,CAAC,EACnC,GAAGO,EACH,KAAAD,EACA,YAAaF,CAChB,CAAC,EAEDK,EAAQR,EAAYQ,EAAO,CACxB,OAAQ,CACL,WAAYN,EAAYM,EAAO,YAAY,EAC3C,MAAON,EAAYM,EAAO,OAAO,EACjC,OAAQN,EAAYM,EAAO,QAAQ,EACnC,KAAMN,EAAYM,EAAO,MAAM,EAC/B,QAASN,EAAYM,EAAO,SAAS,EACrC,QAASN,EAAYM,EAAO,SAAS,EACrC,OAAQN,EAAYM,EAAO,QAAQ,CACtC,CACH,CAAC,EACDP,EAAa,IAAII,EAAMG,CAAK,CAC/B,CAIA,OAAOP,EAAa,IAAII,CAAI,CAC/B",
6
- "names": ["defaultThemeOption", "darkColorPallete", "mergeObject", "ThemeFactory", "createColor", "breakpoints", "createTheme", "name", "options", "darkMode", "theme"]
7
- }
1
+ {"version":3,"file":"createTheme.js","sources":["../../src/theme/createTheme.ts"],"sourcesContent":["import { ThemeOptions, ThemeOptionInput } from \"./types\"\nimport defaultThemeOption, { darkColorPallete } from './ThemeDefaultOptions'\nimport { mergeObject, ThemeFactory } from \"./core\"\nimport createColor from \"./createColor\"\nimport { breakpoints } from \"../css\"\n\nexport const createTheme = (name: string, options: ThemeOptionInput, darkMode?: boolean): ThemeOptions => {\n if (!ThemeFactory.has(name)) {\n let theme: any = mergeObject(defaultThemeOption, {\n ...(darkMode ? darkColorPallete : {}),\n ...options,\n name,\n breakpoints: breakpoints\n })\n\n theme = mergeObject(theme, {\n colors: {\n background: createColor(theme, \"background\"),\n brand: createColor(theme, \"brand\"),\n accent: createColor(theme, \"accent\"),\n info: createColor(theme, \"info\"),\n success: createColor(theme, \"success\"),\n warning: createColor(theme, \"warning\"),\n danger: createColor(theme, \"danger\")\n }\n })\n ThemeFactory.set(name, theme)\n } else {\n throw new Error(`theme \"${name}\" already exists!`);\n }\n\n return ThemeFactory.get(name) as ThemeOptions\n}\n"],"names":["ThemeFactory","mergeObject","defaultThemeOption","breakpoints"],"mappings":"qOAMa,MAAA,WAAW,GAAG,CAAC,IAAY,EAAE,OAAyB,EAAE,QAAkB,KAAkB;AACtG,IAAA,IAAI,CAACA,iBAAY,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;QAC1B,IAAI,KAAK,GAAQC,gBAAW,CAACC,2BAAkB,EACzC,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,EAAA,GAA+B,EAAE,EAAC,EAClC,OAAO,CAAA,EAAA,EACV,IAAI,EACJ,WAAW,EAAEC,iBAAW,EAAA,CAAA,CACzB;AAEF,QAAA,KAAK,GAAGF,gBAAW,CAAC,KAAK,EAAE;AACxB,YAAA,MAAM,EAAE;AACL,gBAAA,UAAU,EAAE,WAAW,CAAC,KAAK,EAAE,YAAY,CAAC;AAC5C,gBAAA,KAAK,EAAE,WAAW,CAAC,KAAK,EAAE,OAAO,CAAC;AAClC,gBAAA,MAAM,EAAE,WAAW,CAAC,KAAK,EAAE,QAAQ,CAAC;AACpC,gBAAA,IAAI,EAAE,WAAW,CAAC,KAAK,EAAE,MAAM,CAAC;AAChC,gBAAA,OAAO,EAAE,WAAW,CAAC,KAAK,EAAE,SAAS,CAAC;AACtC,gBAAA,OAAO,EAAE,WAAW,CAAC,KAAK,EAAE,SAAS,CAAC;AACtC,gBAAA,MAAM,EAAE,WAAW,CAAC,KAAK,EAAE,QAAQ;AACrC;AACH,SAAA,CAAC;AACF,QAAAD,iBAAY,CAAC,GAAG,CAAC,IAAI,EAAE,KAAK,CAAC;AAC/B;AAAM,SAAA;AACJ,QAAA,MAAM,IAAI,KAAK,CAAC,UAAU,IAAI,CAAA,iBAAA,CAAmB,CAAC;AACpD;AAED,IAAA,OAAOA,iBAAY,CAAC,GAAG,CAAC,IAAI,CAAiB;AAChD"}
@@ -0,0 +1,21 @@
1
+ import defaultThemeOption from'./ThemeDefaultOptions.mjs';import {ThemeFactory,mergeObject}from'./core.mjs';import createColor from'./createColor.mjs';import {breakpoints}from'../css/index.mjs';const createTheme = (name, options, darkMode) => {
2
+ if (!ThemeFactory.has(name)) {
3
+ let theme = mergeObject(defaultThemeOption, Object.assign(Object.assign(Object.assign({}, ({})), options), { name, breakpoints: breakpoints }));
4
+ theme = mergeObject(theme, {
5
+ colors: {
6
+ background: createColor(theme, "background"),
7
+ brand: createColor(theme, "brand"),
8
+ accent: createColor(theme, "accent"),
9
+ info: createColor(theme, "info"),
10
+ success: createColor(theme, "success"),
11
+ warning: createColor(theme, "warning"),
12
+ danger: createColor(theme, "danger")
13
+ }
14
+ });
15
+ ThemeFactory.set(name, theme);
16
+ }
17
+ else {
18
+ throw new Error(`theme "${name}" already exists!`);
19
+ }
20
+ return ThemeFactory.get(name);
21
+ };export{createTheme};//# sourceMappingURL=createTheme.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createTheme.mjs","sources":["../../src/theme/createTheme.ts"],"sourcesContent":["import { ThemeOptions, ThemeOptionInput } from \"./types\"\nimport defaultThemeOption, { darkColorPallete } from './ThemeDefaultOptions'\nimport { mergeObject, ThemeFactory } from \"./core\"\nimport createColor from \"./createColor\"\nimport { breakpoints } from \"../css\"\n\nexport const createTheme = (name: string, options: ThemeOptionInput, darkMode?: boolean): ThemeOptions => {\n if (!ThemeFactory.has(name)) {\n let theme: any = mergeObject(defaultThemeOption, {\n ...(darkMode ? darkColorPallete : {}),\n ...options,\n name,\n breakpoints: breakpoints\n })\n\n theme = mergeObject(theme, {\n colors: {\n background: createColor(theme, \"background\"),\n brand: createColor(theme, \"brand\"),\n accent: createColor(theme, \"accent\"),\n info: createColor(theme, \"info\"),\n success: createColor(theme, \"success\"),\n warning: createColor(theme, \"warning\"),\n danger: createColor(theme, \"danger\")\n }\n })\n ThemeFactory.set(name, theme)\n } else {\n throw new Error(`theme \"${name}\" already exists!`);\n }\n\n return ThemeFactory.get(name) as ThemeOptions\n}\n"],"names":[],"mappings":"kMAMa,MAAA,WAAW,GAAG,CAAC,IAAY,EAAE,OAAyB,EAAE,QAAkB,KAAkB;AACtG,IAAA,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;QAC1B,IAAI,KAAK,GAAQ,WAAW,CAAC,kBAAkB,EACzC,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,EAAA,GAA+B,EAAE,EAAC,EAClC,OAAO,CAAA,EAAA,EACV,IAAI,EACJ,WAAW,EAAE,WAAW,EAAA,CAAA,CACzB;AAEF,QAAA,KAAK,GAAG,WAAW,CAAC,KAAK,EAAE;AACxB,YAAA,MAAM,EAAE;AACL,gBAAA,UAAU,EAAE,WAAW,CAAC,KAAK,EAAE,YAAY,CAAC;AAC5C,gBAAA,KAAK,EAAE,WAAW,CAAC,KAAK,EAAE,OAAO,CAAC;AAClC,gBAAA,MAAM,EAAE,WAAW,CAAC,KAAK,EAAE,QAAQ,CAAC;AACpC,gBAAA,IAAI,EAAE,WAAW,CAAC,KAAK,EAAE,MAAM,CAAC;AAChC,gBAAA,OAAO,EAAE,WAAW,CAAC,KAAK,EAAE,SAAS,CAAC;AACtC,gBAAA,OAAO,EAAE,WAAW,CAAC,KAAK,EAAE,SAAS,CAAC;AACtC,gBAAA,MAAM,EAAE,WAAW,CAAC,KAAK,EAAE,QAAQ;AACrC;AACH,SAAA,CAAC;AACF,QAAA,YAAY,CAAC,GAAG,CAAC,IAAI,EAAE,KAAK,CAAC;AAC/B;AAAM,SAAA;AACJ,QAAA,MAAM,IAAI,KAAK,CAAC,UAAU,IAAI,CAAA,iBAAA,CAAmB,CAAC;AACpD;AAED,IAAA,OAAO,YAAY,CAAC,GAAG,CAAC,IAAI,CAAiB;AAChD"}
@@ -1,6 +1,9 @@
1
+ import { ThemeOptions } from './types.js';
2
+
1
3
  declare const createThemeSwitcher: (defaultTheme: string, store?: "session" | "local") => () => {
2
4
  name: string;
3
- theme: import("./types").ThemeOptions | undefined;
5
+ theme: ThemeOptions | undefined;
4
6
  change: (theme: string) => void;
5
7
  };
6
- export default createThemeSwitcher;
8
+
9
+ export { createThemeSwitcher as default };
@@ -1,2 +1,12 @@
1
- import{createBucket as s}from"react-state-bucket";import{getTheme as a}from"./core";const c=(t,r)=>{const m=s({name:t},{store:r});return()=>{const e=m();return{name:e.get("name"),theme:a(e.get("name")),change:n=>e.set("name",n)}}};var u=c;export{u as default};
2
- //# sourceMappingURL=createThemeSwitcher.js.map
1
+ 'use strict';var reactStateBucket=require('react-state-bucket'),core=require('./core.js');const createThemeSwitcher = (defaultTheme, store) => {
2
+ const useThemeState = reactStateBucket.createBucket({ name: defaultTheme }, { store });
3
+ const useThemeSwitcher = () => {
4
+ const state = useThemeState();
5
+ return {
6
+ name: state.get("name"),
7
+ theme: core.getTheme(state.get("name")),
8
+ change: (theme) => state.set("name", theme)
9
+ };
10
+ };
11
+ return useThemeSwitcher;
12
+ };module.exports=createThemeSwitcher;//# sourceMappingURL=createThemeSwitcher.js.map
@@ -1,7 +1 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/theme/createThemeSwitcher.ts"],
4
- "sourcesContent": ["import { createBucket } from \"react-state-bucket\"\nimport { getTheme } from \"./core\"\n\nconst createThemeSwitcher = (defaultTheme: string, store?: \"session\" | \"local\") => {\n const useThemeState = createBucket({ name: defaultTheme }, { store })\n const useThemeSwitcher = () => {\n const state = useThemeState()\n return {\n name: state.get(\"name\"),\n theme: getTheme(state.get(\"name\")),\n change: (theme: string) => state.set(\"name\", theme)\n }\n }\n return useThemeSwitcher\n}\n\n\nexport default createThemeSwitcher"],
5
- "mappings": "AAAA,OAAS,gBAAAA,MAAoB,qBAC7B,OAAS,YAAAC,MAAgB,SAEzB,MAAMC,EAAsB,CAACC,EAAsBC,IAAgC,CAChF,MAAMC,EAAgBL,EAAa,CAAE,KAAMG,CAAa,EAAG,CAAE,MAAAC,CAAM,CAAC,EASpE,MARyB,IAAM,CAC5B,MAAME,EAAQD,EAAc,EAC5B,MAAO,CACJ,KAAMC,EAAM,IAAI,MAAM,EACtB,MAAOL,EAASK,EAAM,IAAI,MAAM,CAAC,EACjC,OAASC,GAAkBD,EAAM,IAAI,OAAQC,CAAK,CACrD,CACH,CAEH,EAGA,IAAOC,EAAQN",
6
- "names": ["createBucket", "getTheme", "createThemeSwitcher", "defaultTheme", "store", "useThemeState", "state", "theme", "createThemeSwitcher_default"]
7
- }
1
+ {"version":3,"file":"createThemeSwitcher.js","sources":["../../src/theme/createThemeSwitcher.ts"],"sourcesContent":["import { createBucket } from \"react-state-bucket\"\nimport { getTheme } from \"./core\"\n\nconst createThemeSwitcher = (defaultTheme: string, store?: \"session\" | \"local\") => {\n const useThemeState = createBucket({ name: defaultTheme }, { store })\n const useThemeSwitcher = () => {\n const state = useThemeState()\n return {\n name: state.get(\"name\"),\n theme: getTheme(state.get(\"name\")),\n change: (theme: string) => state.set(\"name\", theme)\n }\n }\n return useThemeSwitcher\n}\n\n\nexport default createThemeSwitcher"],"names":["createBucket","getTheme"],"mappings":"0FAGA,MAAM,mBAAmB,GAAG,CAAC,YAAoB,EAAE,KAA2B,KAAI;AAC/E,IAAA,MAAM,aAAa,GAAGA,6BAAY,CAAC,EAAE,IAAI,EAAE,YAAY,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC;IACrE,MAAM,gBAAgB,GAAG,MAAK;AAC3B,QAAA,MAAM,KAAK,GAAG,aAAa,EAAE;QAC7B,OAAO;AACJ,YAAA,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC;YACvB,KAAK,EAAEC,aAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AAClC,YAAA,MAAM,EAAE,CAAC,KAAa,KAAK,KAAK,CAAC,GAAG,CAAC,MAAM,EAAE,KAAK;SACpD;AACJ,KAAC;AACD,IAAA,OAAO,gBAAgB;AAC1B"}
@@ -0,0 +1,12 @@
1
+ import {createBucket}from'react-state-bucket';import {getTheme}from'./core.mjs';const createThemeSwitcher = (defaultTheme, store) => {
2
+ const useThemeState = createBucket({ name: defaultTheme }, { store });
3
+ const useThemeSwitcher = () => {
4
+ const state = useThemeState();
5
+ return {
6
+ name: state.get("name"),
7
+ theme: getTheme(state.get("name")),
8
+ change: (theme) => state.set("name", theme)
9
+ };
10
+ };
11
+ return useThemeSwitcher;
12
+ };export{createThemeSwitcher as default};//# sourceMappingURL=createThemeSwitcher.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createThemeSwitcher.mjs","sources":["../../src/theme/createThemeSwitcher.ts"],"sourcesContent":["import { createBucket } from \"react-state-bucket\"\nimport { getTheme } from \"./core\"\n\nconst createThemeSwitcher = (defaultTheme: string, store?: \"session\" | \"local\") => {\n const useThemeState = createBucket({ name: defaultTheme }, { store })\n const useThemeSwitcher = () => {\n const state = useThemeState()\n return {\n name: state.get(\"name\"),\n theme: getTheme(state.get(\"name\")),\n change: (theme: string) => state.set(\"name\", theme)\n }\n }\n return useThemeSwitcher\n}\n\n\nexport default createThemeSwitcher"],"names":[],"mappings":"gFAGA,MAAM,mBAAmB,GAAG,CAAC,YAAoB,EAAE,KAA2B,KAAI;AAC/E,IAAA,MAAM,aAAa,GAAG,YAAY,CAAC,EAAE,IAAI,EAAE,YAAY,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC;IACrE,MAAM,gBAAgB,GAAG,MAAK;AAC3B,QAAA,MAAM,KAAK,GAAG,aAAa,EAAE;QAC7B,OAAO;AACJ,YAAA,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC;YACvB,KAAK,EAAE,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AAClC,YAAA,MAAM,EAAE,CAAC,KAAa,KAAK,KAAK,CAAC,GAAG,CAAC,MAAM,EAAE,KAAK;SACpD;AACJ,KAAC;AACD,IAAA,OAAO,gBAAgB;AAC1B"}
package/theme/index.js CHANGED
@@ -1,2 +1,2 @@
1
- import{lightColorPallete as r,darkColorPallete as o}from"./ThemeDefaultOptions";import{createTheme as e}from"./createTheme";import m from"./ThemeProvider";import t from"./createThemeSwitcher";import{getTheme as i,useTheme as h}from"./core";e("light",{colors:r}),e("dark",{colors:o});export{m as ThemeProvider,t as createThemeSwitcher,i as getTheme,h as useTheme};
2
- //# sourceMappingURL=index.js.map
1
+ 'use strict';Object.defineProperty(exports,'__esModule',{value:true});var ThemeDefaultOptions=require('./ThemeDefaultOptions.js'),createTheme=require('./createTheme.js');require('tslib'),require('react'),require('../Tag/index.js'),require('../breakpoint/BreakpointProvider.js'),require('../css/getValue.js'),require('oncss');var core=require('./core.js');require('react-state-bucket');createTheme.createTheme("light", { colors: ThemeDefaultOptions.lightColorPallete });
2
+ createTheme.createTheme("dark", { colors: ThemeDefaultOptions.darkColorPallete });exports.getTheme=core.getTheme;exports.useTheme=core.useTheme;//# sourceMappingURL=index.js.map
@@ -1,7 +1 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/theme/index.tsx"],
4
- "sourcesContent": ["import { lightColorPallete, darkColorPallete } from './ThemeDefaultOptions'\nimport { createTheme } from \"./createTheme\"\nimport ThemeProvider from './ThemeProvider'\nimport createThemeSwitcher from './createThemeSwitcher'\nimport { getTheme, useTheme } from './core'\nexport type { ThemeProviderProps } from './ThemeProvider'\n\nexport {\n ThemeProvider,\n createThemeSwitcher,\n getTheme,\n useTheme\n}\n\ncreateTheme(\"light\", { colors: lightColorPallete })\ncreateTheme(\"dark\", { colors: darkColorPallete })\n\n"],
5
- "mappings": "AAAA,OAAS,qBAAAA,EAAmB,oBAAAC,MAAwB,wBACpD,OAAS,eAAAC,MAAmB,gBAC5B,OAAOC,MAAmB,kBAC1B,OAAOC,MAAyB,wBAChC,OAAS,YAAAC,EAAU,YAAAC,MAAgB,SAUnCJ,EAAY,QAAS,CAAE,OAAQF,CAAkB,CAAC,EAClDE,EAAY,OAAQ,CAAE,OAAQD,CAAiB,CAAC",
6
- "names": ["lightColorPallete", "darkColorPallete", "createTheme", "ThemeProvider", "createThemeSwitcher", "getTheme", "useTheme"]
7
- }
1
+ {"version":3,"file":"index.js","sources":["../../src/theme/index.tsx"],"sourcesContent":["import { lightColorPallete, darkColorPallete } from './ThemeDefaultOptions'\nimport { createTheme } from \"./createTheme\"\nimport ThemeProvider from './ThemeProvider'\nimport createThemeSwitcher from './createThemeSwitcher'\nimport { getTheme, useTheme } from './core'\nexport type { ThemeProviderProps } from './ThemeProvider'\n\nexport {\n ThemeProvider,\n createThemeSwitcher,\n getTheme,\n useTheme\n}\n\ncreateTheme(\"light\", { colors: lightColorPallete })\ncreateTheme(\"dark\", { colors: darkColorPallete })\n\n"],"names":["createTheme","lightColorPallete","darkColorPallete"],"mappings":"iYAcAA,uBAAW,CAAC,OAAO,EAAE,EAAE,MAAM,EAAEC,qCAAiB,EAAE,CAAC;AACnDD,uBAAW,CAAC,MAAM,EAAE,EAAE,MAAM,EAAEE,oCAAgB,EAAE,CAAC"}
@@ -0,0 +1,2 @@
1
+ import {lightColorPallete,darkColorPallete}from'./ThemeDefaultOptions.mjs';import {createTheme}from'./createTheme.mjs';import'tslib';import'react';import'../Tag/index.mjs';import'../breakpoint/BreakpointProvider.mjs';import'../css/getValue.mjs';import'oncss';export{getTheme,useTheme}from'./core.mjs';import'react-state-bucket';createTheme("light", { colors: lightColorPallete });
2
+ createTheme("dark", { colors: darkColorPallete });//# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","sources":["../../src/theme/index.tsx"],"sourcesContent":["import { lightColorPallete, darkColorPallete } from './ThemeDefaultOptions'\nimport { createTheme } from \"./createTheme\"\nimport ThemeProvider from './ThemeProvider'\nimport createThemeSwitcher from './createThemeSwitcher'\nimport { getTheme, useTheme } from './core'\nexport type { ThemeProviderProps } from './ThemeProvider'\n\nexport {\n ThemeProvider,\n createThemeSwitcher,\n getTheme,\n useTheme\n}\n\ncreateTheme(\"light\", { colors: lightColorPallete })\ncreateTheme(\"dark\", { colors: darkColorPallete })\n\n"],"names":[],"mappings":"wUAcA,WAAW,CAAC,OAAO,EAAE,EAAE,MAAM,EAAE,iBAAiB,EAAE,CAAC;AACnD,WAAW,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,gBAAgB,EAAE,CAAC"}
package/theme/types.d.ts CHANGED
@@ -1,8 +1,9 @@
1
- import { BreakpointKeys, GlobalCSS } from "../css/types";
2
- export type ObjectType = {
1
+ import { GlobalCSS, BreakpointKeys } from '../css/types.js';
2
+
3
+ type ObjectType = {
3
4
  [key: string]: any;
4
5
  };
5
- export type ThemeColorItem = {
6
+ type ThemeColorItem = {
6
7
  primary: string;
7
8
  secondary: string;
8
9
  text: string;
@@ -44,12 +45,12 @@ export type ThemeColorItem = {
44
45
  };
45
46
  };
46
47
  };
47
- export type ThemeTypographyItem = {
48
+ type ThemeTypographyItem = {
48
49
  fontSize: number;
49
50
  lineHeight: number;
50
51
  fontWeight: number;
51
52
  };
52
- export type ThemeColor = {
53
+ type ThemeColor = {
53
54
  background: Omit<ThemeColorItem, "text">;
54
55
  text: Omit<ThemeColorItem, "text" | "alpha" | "template">;
55
56
  divider: string;
@@ -60,7 +61,7 @@ export type ThemeColor = {
60
61
  warning: ThemeColorItem;
61
62
  danger: ThemeColorItem;
62
63
  };
63
- export type ThemeTypographyType = {
64
+ type ThemeTypographyType = {
64
65
  fontFamily: string;
65
66
  h1: ThemeTypographyItem;
66
67
  h2: ThemeTypographyItem;
@@ -72,7 +73,7 @@ export type ThemeTypographyType = {
72
73
  button: ThemeTypographyItem;
73
74
  small: ThemeTypographyItem;
74
75
  };
75
- export interface ThemeOptions {
76
+ interface ThemeOptions {
76
77
  name: string;
77
78
  rtl: boolean;
78
79
  globalStyle: GlobalCSS;
@@ -86,9 +87,9 @@ export interface ThemeOptions {
86
87
  colors: ThemeColor;
87
88
  typography: ThemeTypographyType;
88
89
  }
89
- export type ThemeColorItemInput = Partial<Omit<ThemeColorItem, "alpha">>;
90
- export type ThemeTypographyItemInput = Partial<ThemeTypographyItem>;
91
- export type ThemeColorInput = {
90
+ type ThemeColorItemInput = Partial<Omit<ThemeColorItem, "alpha">>;
91
+ type ThemeTypographyItemInput = Partial<ThemeTypographyItem>;
92
+ type ThemeColorInput = {
92
93
  background?: Omit<ThemeColorItemInput, "text">;
93
94
  text?: Omit<ThemeColorItemInput, "text">;
94
95
  divider?: string;
@@ -99,7 +100,7 @@ export type ThemeColorInput = {
99
100
  warning?: ThemeColorItemInput;
100
101
  danger?: ThemeColorItemInput;
101
102
  };
102
- export type ThemeTypographyInputType = {
103
+ type ThemeTypographyInputType = {
103
104
  fontFamily?: string;
104
105
  h1?: ThemeTypographyItemInput;
105
106
  h2?: ThemeTypographyItemInput;
@@ -111,7 +112,7 @@ export type ThemeTypographyInputType = {
111
112
  button?: ThemeTypographyItemInput;
112
113
  small?: ThemeTypographyItemInput;
113
114
  };
114
- export interface ThemeOptionInput {
115
+ interface ThemeOptionInput {
115
116
  rtl?: boolean;
116
117
  globalStyle?: GlobalCSS;
117
118
  interfaces?: {
@@ -120,5 +121,7 @@ export interface ThemeOptionInput {
120
121
  colors?: ThemeColorInput;
121
122
  typography?: ThemeTypographyInputType;
122
123
  }
123
- export type TypographyRefTypes = "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "text" | "button" | "small";
124
- export type ColorsRefTypes = "text" | "text.primary" | "text.secondary" | "background" | "background.primary" | "background.secondary" | "background.alpha" | "brand" | "brand.primary" | "brand.secondary" | "brand.alpha" | "brand.text" | "accent" | "accent.primary" | "accent.secondary" | "accent.alpha" | "accent.text" | "info" | "info.primary" | "info.secondary" | "info.alpha" | "info.text" | "success" | "success.primary" | "success.secondary" | "success.alpha" | "success.text" | "warning" | "warning.primary" | "warning.secondary" | "warning.alpha" | "warning.text" | "danger" | "danger.primary" | "danger.secondary" | "danger.alpha" | "danger.text";
124
+ type TypographyRefTypes = "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "text" | "button" | "small";
125
+ type ColorsRefTypes = "text" | "text.primary" | "text.secondary" | "background" | "background.primary" | "background.secondary" | "background.alpha" | "brand" | "brand.primary" | "brand.secondary" | "brand.alpha" | "brand.text" | "accent" | "accent.primary" | "accent.secondary" | "accent.alpha" | "accent.text" | "info" | "info.primary" | "info.secondary" | "info.alpha" | "info.text" | "success" | "success.primary" | "success.secondary" | "success.alpha" | "success.text" | "warning" | "warning.primary" | "warning.secondary" | "warning.alpha" | "warning.text" | "danger" | "danger.primary" | "danger.secondary" | "danger.alpha" | "danger.text";
126
+
127
+ export type { ColorsRefTypes, ObjectType, ThemeColor, ThemeColorInput, ThemeColorItem, ThemeColorItemInput, ThemeOptionInput, ThemeOptions, ThemeTypographyInputType, ThemeTypographyItem, ThemeTypographyItemInput, ThemeTypographyType, TypographyRefTypes };
package/useAnimation.d.ts CHANGED
@@ -1,5 +1,6 @@
1
- import { CSSProps } from './css/types';
2
- export declare const animationEases: {
1
+ import { CSSProps } from './css/types.js';
2
+
3
+ declare const animationEases: {
3
4
  easeInOut: string;
4
5
  easeOut: string;
5
6
  easeIn: string;
@@ -7,7 +8,7 @@ export declare const animationEases: {
7
8
  linear: string;
8
9
  easeBounceOut: string;
9
10
  };
10
- export interface UseAnimationProps {
11
+ interface UseAnimationProps {
11
12
  delay?: number;
12
13
  duration?: number;
13
14
  from: CSSProps;
@@ -15,4 +16,6 @@ export interface UseAnimationProps {
15
16
  ease?: keyof typeof animationEases;
16
17
  }
17
18
  declare const useAnimation: ({ from, to, delay, ease, duration }: UseAnimationProps) => string;
18
- export default useAnimation;
19
+
20
+ export { animationEases, useAnimation as default };
21
+ export type { UseAnimationProps };
package/useAnimation.js CHANGED
@@ -1,2 +1,25 @@
1
- import{css as u}from"./css";import{useId as b}from"react";const a={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)",linear:"cubic-bezier(0, 0, 1, 1)",easeBounceOut:"cubic-bezier(0.68, -0.55, 0.265, 1.55)"},p=({from:i,to:n,delay:o,ease:t,duration:s})=>{let r=o||0,m=s||600,c=t||"easeBounceOut";const e="anim"+b().replace(/:/g,"");return u({animationName:e,animationDelay:r+"ms",animationDuration:m+"ms",animationTimingFunction:a[c]||a.easeBounceOut,[`@keyframes ${e}`]:{from:i,to:n}}).classname};var S=p;export{a as animationEases,S as default};
2
- //# sourceMappingURL=useAnimation.js.map
1
+ 'use strict';Object.defineProperty(exports,'__esModule',{value:true});var index=require('./css/index.js'),React=require('react');const animationEases = {
2
+ easeInOut: "cubic-bezier(0.4, 0, 0.2, 1)",
3
+ easeOut: "cubic-bezier(0.0, 0, 0.2, 1)",
4
+ easeIn: "cubic-bezier(0.4, 0, 1, 1)",
5
+ sharp: "cubic-bezier(0.4, 0, 0.6, 1)",
6
+ linear: "cubic-bezier(0, 0, 1, 1)",
7
+ easeBounceOut: "cubic-bezier(0.68, -0.55, 0.265, 1.55)"
8
+ };
9
+ const useAnimation = ({ from, to, delay, ease, duration }) => {
10
+ let _delay = delay || 0;
11
+ let _duration = duration || 600;
12
+ let _ease = ease || "easeBounceOut";
13
+ const id = "anim" + React.useId().replace(/:/g, "");
14
+ const anim = index.css({
15
+ animationName: id,
16
+ animationDelay: _delay + "ms",
17
+ animationDuration: _duration + "ms",
18
+ animationTimingFunction: animationEases[_ease] || animationEases.easeBounceOut,
19
+ [`@keyframes ${id}`]: {
20
+ from: from,
21
+ to: to
22
+ }
23
+ });
24
+ return anim.classname;
25
+ };exports.animationEases=animationEases;exports.default=useAnimation;//# sourceMappingURL=useAnimation.js.map
@@ -1,7 +1 @@
1
- {
2
- "version": 3,
3
- "sources": ["../src/useAnimation.ts"],
4
- "sourcesContent": ["import { css } from './css'\nimport { useId } from 'react'\nimport { CSSProps } from './css/types'\n\nexport const animationEases = {\n easeInOut: \"cubic-bezier(0.4, 0, 0.2, 1)\",\n easeOut: \"cubic-bezier(0.0, 0, 0.2, 1)\",\n easeIn: \"cubic-bezier(0.4, 0, 1, 1)\",\n sharp: \"cubic-bezier(0.4, 0, 0.6, 1)\",\n linear: \"cubic-bezier(0, 0, 1, 1)\",\n easeBounceOut: \"cubic-bezier(0.68, -0.55, 0.265, 1.55)\"\n}\n\nexport interface UseAnimationProps {\n delay?: number;\n duration?: number;\n from: CSSProps;\n to: CSSProps;\n ease?: keyof typeof animationEases;\n}\n\nconst useAnimation = ({ from, to, delay, ease, duration }: UseAnimationProps) => {\n let _delay = delay || 0;\n let _duration = duration || 600;\n let _ease = ease || \"easeBounceOut\"\n const id = \"anim\" + useId().replace(/:/g, \"\")\n const anim = css({\n animationName: id,\n animationDelay: _delay + \"ms\",\n animationDuration: _duration + \"ms\",\n animationTimingFunction: animationEases[_ease] || animationEases.easeBounceOut,\n [`@keyframes ${id}`]: {\n from: from as any,\n to: to as any\n }\n })\n return anim.classname\n}\n\nexport default useAnimation"],
5
- "mappings": "AAAA,OAAS,OAAAA,MAAW,QACpB,OAAS,SAAAC,MAAa,QAGf,MAAMC,EAAiB,CAC1B,UAAW,+BACX,QAAS,+BACT,OAAQ,6BACR,MAAO,+BACP,OAAQ,2BACR,cAAe,wCACnB,EAUMC,EAAe,CAAC,CAAE,KAAAC,EAAM,GAAAC,EAAI,MAAAC,EAAO,KAAAC,EAAM,SAAAC,CAAS,IAAyB,CAC7E,IAAIC,EAASH,GAAS,EAClBI,EAAYF,GAAY,IACxBG,EAAQJ,GAAQ,gBACpB,MAAMK,EAAK,OAASX,EAAM,EAAE,QAAQ,KAAM,EAAE,EAW5C,OAVaD,EAAI,CACb,cAAeY,EACf,eAAgBH,EAAS,KACzB,kBAAmBC,EAAY,KAC/B,wBAAyBR,EAAeS,CAAK,GAAKT,EAAe,cACjE,CAAC,cAAcU,CAAE,EAAE,EAAG,CAClB,KAAMR,EACN,GAAIC,CACR,CACJ,CAAC,EACW,SAChB,EAEA,IAAOQ,EAAQV",
6
- "names": ["css", "useId", "animationEases", "useAnimation", "from", "to", "delay", "ease", "duration", "_delay", "_duration", "_ease", "id", "useAnimation_default"]
7
- }
1
+ {"version":3,"file":"useAnimation.js","sources":["../src/useAnimation.ts"],"sourcesContent":["import { css } from './css'\nimport { useId } from 'react'\nimport { CSSProps } from './css/types'\n\nexport const animationEases = {\n easeInOut: \"cubic-bezier(0.4, 0, 0.2, 1)\",\n easeOut: \"cubic-bezier(0.0, 0, 0.2, 1)\",\n easeIn: \"cubic-bezier(0.4, 0, 1, 1)\",\n sharp: \"cubic-bezier(0.4, 0, 0.6, 1)\",\n linear: \"cubic-bezier(0, 0, 1, 1)\",\n easeBounceOut: \"cubic-bezier(0.68, -0.55, 0.265, 1.55)\"\n}\n\nexport interface UseAnimationProps {\n delay?: number;\n duration?: number;\n from: CSSProps;\n to: CSSProps;\n ease?: keyof typeof animationEases;\n}\n\nconst useAnimation = ({ from, to, delay, ease, duration }: UseAnimationProps) => {\n let _delay = delay || 0;\n let _duration = duration || 600;\n let _ease = ease || \"easeBounceOut\"\n const id = \"anim\" + useId().replace(/:/g, \"\")\n const anim = css({\n animationName: id,\n animationDelay: _delay + \"ms\",\n animationDuration: _duration + \"ms\",\n animationTimingFunction: animationEases[_ease] || animationEases.easeBounceOut,\n [`@keyframes ${id}`]: {\n from: from as any,\n to: to as any\n }\n })\n return anim.classname\n}\n\nexport default useAnimation"],"names":["useId","css"],"mappings":"iIAIa,MAAA,cAAc,GAAG;AAC1B,IAAA,SAAS,EAAE,8BAA8B;AACzC,IAAA,OAAO,EAAE,8BAA8B;AACvC,IAAA,MAAM,EAAE,4BAA4B;AACpC,IAAA,KAAK,EAAE,8BAA8B;AACrC,IAAA,MAAM,EAAE,0BAA0B;AAClC,IAAA,aAAa,EAAE;;AAWnB,MAAM,YAAY,GAAG,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAqB,KAAI;AAC5E,IAAA,IAAI,MAAM,GAAG,KAAK,IAAI,CAAC;AACvB,IAAA,IAAI,SAAS,GAAG,QAAQ,IAAI,GAAG;AAC/B,IAAA,IAAI,KAAK,GAAG,IAAI,IAAI,eAAe;AACnC,IAAA,MAAM,EAAE,GAAG,MAAM,GAAGA,WAAK,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC;IAC7C,MAAM,IAAI,GAAGC,SAAG,CAAC;AACb,QAAA,aAAa,EAAE,EAAE;QACjB,cAAc,EAAE,MAAM,GAAG,IAAI;QAC7B,iBAAiB,EAAE,SAAS,GAAG,IAAI;QACnC,uBAAuB,EAAE,cAAc,CAAC,KAAK,CAAC,IAAI,cAAc,CAAC,aAAa;AAC9E,QAAA,CAAC,CAAc,WAAA,EAAA,EAAE,CAAE,CAAA,GAAG;AAClB,YAAA,IAAI,EAAE,IAAW;AACjB,YAAA,EAAE,EAAE;AACP;AACJ,KAAA,CAAC;IACF,OAAO,IAAI,CAAC,SAAS;AACzB"}
@@ -0,0 +1,25 @@
1
+ import {css}from'./css/index.mjs';import {useId}from'react';const animationEases = {
2
+ easeInOut: "cubic-bezier(0.4, 0, 0.2, 1)",
3
+ easeOut: "cubic-bezier(0.0, 0, 0.2, 1)",
4
+ easeIn: "cubic-bezier(0.4, 0, 1, 1)",
5
+ sharp: "cubic-bezier(0.4, 0, 0.6, 1)",
6
+ linear: "cubic-bezier(0, 0, 1, 1)",
7
+ easeBounceOut: "cubic-bezier(0.68, -0.55, 0.265, 1.55)"
8
+ };
9
+ const useAnimation = ({ from, to, delay, ease, duration }) => {
10
+ let _delay = delay || 0;
11
+ let _duration = duration || 600;
12
+ let _ease = ease || "easeBounceOut";
13
+ const id = "anim" + useId().replace(/:/g, "");
14
+ const anim = css({
15
+ animationName: id,
16
+ animationDelay: _delay + "ms",
17
+ animationDuration: _duration + "ms",
18
+ animationTimingFunction: animationEases[_ease] || animationEases.easeBounceOut,
19
+ [`@keyframes ${id}`]: {
20
+ from: from,
21
+ to: to
22
+ }
23
+ });
24
+ return anim.classname;
25
+ };export{animationEases,useAnimation as default};//# sourceMappingURL=useAnimation.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useAnimation.mjs","sources":["../src/useAnimation.ts"],"sourcesContent":["import { css } from './css'\nimport { useId } from 'react'\nimport { CSSProps } from './css/types'\n\nexport const animationEases = {\n easeInOut: \"cubic-bezier(0.4, 0, 0.2, 1)\",\n easeOut: \"cubic-bezier(0.0, 0, 0.2, 1)\",\n easeIn: \"cubic-bezier(0.4, 0, 1, 1)\",\n sharp: \"cubic-bezier(0.4, 0, 0.6, 1)\",\n linear: \"cubic-bezier(0, 0, 1, 1)\",\n easeBounceOut: \"cubic-bezier(0.68, -0.55, 0.265, 1.55)\"\n}\n\nexport interface UseAnimationProps {\n delay?: number;\n duration?: number;\n from: CSSProps;\n to: CSSProps;\n ease?: keyof typeof animationEases;\n}\n\nconst useAnimation = ({ from, to, delay, ease, duration }: UseAnimationProps) => {\n let _delay = delay || 0;\n let _duration = duration || 600;\n let _ease = ease || \"easeBounceOut\"\n const id = \"anim\" + useId().replace(/:/g, \"\")\n const anim = css({\n animationName: id,\n animationDelay: _delay + \"ms\",\n animationDuration: _duration + \"ms\",\n animationTimingFunction: animationEases[_ease] || animationEases.easeBounceOut,\n [`@keyframes ${id}`]: {\n from: from as any,\n to: to as any\n }\n })\n return anim.classname\n}\n\nexport default useAnimation"],"names":[],"mappings":"4DAIa,MAAA,cAAc,GAAG;AAC1B,IAAA,SAAS,EAAE,8BAA8B;AACzC,IAAA,OAAO,EAAE,8BAA8B;AACvC,IAAA,MAAM,EAAE,4BAA4B;AACpC,IAAA,KAAK,EAAE,8BAA8B;AACrC,IAAA,MAAM,EAAE,0BAA0B;AAClC,IAAA,aAAa,EAAE;;AAWnB,MAAM,YAAY,GAAG,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAqB,KAAI;AAC5E,IAAA,IAAI,MAAM,GAAG,KAAK,IAAI,CAAC;AACvB,IAAA,IAAI,SAAS,GAAG,QAAQ,IAAI,GAAG;AAC/B,IAAA,IAAI,KAAK,GAAG,IAAI,IAAI,eAAe;AACnC,IAAA,MAAM,EAAE,GAAG,MAAM,GAAG,KAAK,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC;IAC7C,MAAM,IAAI,GAAG,GAAG,CAAC;AACb,QAAA,aAAa,EAAE,EAAE;QACjB,cAAc,EAAE,MAAM,GAAG,IAAI;QAC7B,iBAAiB,EAAE,SAAS,GAAG,IAAI;QACnC,uBAAuB,EAAE,cAAc,CAAC,KAAK,CAAC,IAAI,cAAc,CAAC,aAAa;AAC9E,QAAA,CAAC,CAAc,WAAA,EAAA,EAAE,CAAE,CAAA,GAAG;AAClB,YAAA,IAAI,EAAE,IAAW;AACjB,YAAA,EAAE,EAAE;AACP;AACJ,KAAA,CAAC;IACF,OAAO,IAAI,CAAC,SAAS;AACzB"}
@@ -1,4 +1,6 @@
1
- export type ColorTemplateColors = "default" | "brand" | "accent" | "info" | "success" | "warning" | "danger";
2
- export type ColorTemplateType = "fill" | "outline" | "text" | "alpha";
1
+ type ColorTemplateColors = "default" | "brand" | "accent" | "info" | "success" | "warning" | "danger";
2
+ type ColorTemplateType = "fill" | "outline" | "text" | "alpha";
3
3
  declare const useColorTemplate: (color: ColorTemplateColors, type: ColorTemplateType) => any;
4
- export default useColorTemplate;
4
+
5
+ export { useColorTemplate as default };
6
+ export type { ColorTemplateColors, ColorTemplateType };
@@ -1,2 +1,6 @@
1
- import{useTheme as a}from"./theme";const r=(e,o)=>{const t=a();let l=e==="default"?"background":e;return t.colors[l]?.template[o]};var n=r;export{n as default};
2
- //# sourceMappingURL=useColorTemplate.js.map
1
+ 'use strict';require('./theme/index.js');var core=require('./theme/core.js');const useColorTemplate = (color, type) => {
2
+ var _a;
3
+ const theme = core.useTheme();
4
+ let _color = color === 'default' ? "background" : color;
5
+ return (_a = theme.colors[_color]) === null || _a === void 0 ? void 0 : _a.template[type];
6
+ };module.exports=useColorTemplate;//# sourceMappingURL=useColorTemplate.js.map
@@ -1,7 +1 @@
1
- {
2
- "version": 3,
3
- "sources": ["../src/useColorTemplate.ts"],
4
- "sourcesContent": ["import { useTheme } from \"./theme\"\nexport type ColorTemplateColors = \"default\" | \"brand\" | \"accent\" | \"info\" | \"success\" | \"warning\" | \"danger\"\nexport type ColorTemplateType = \"fill\" | \"outline\" | \"text\" | \"alpha\"\n\nconst useColorTemplate = (color: ColorTemplateColors, type: ColorTemplateType) => {\n const theme: any = useTheme()\n let _color = color === 'default' ? \"background\" : color as any\n return theme.colors[_color]?.template[type]\n}\n\nexport default useColorTemplate"],
5
- "mappings": "AAAA,OAAS,YAAAA,MAAgB,UAIzB,MAAMC,EAAmB,CAACC,EAA4BC,IAA4B,CAC9E,MAAMC,EAAaJ,EAAS,EAC5B,IAAIK,EAASH,IAAU,UAAY,aAAeA,EAClD,OAAOE,EAAM,OAAOC,CAAM,GAAG,SAASF,CAAI,CAC9C,EAEA,IAAOG,EAAQL",
6
- "names": ["useTheme", "useColorTemplate", "color", "type", "theme", "_color", "useColorTemplate_default"]
7
- }
1
+ {"version":3,"file":"useColorTemplate.js","sources":["../src/useColorTemplate.ts"],"sourcesContent":["import { useTheme } from \"./theme\"\nexport type ColorTemplateColors = \"default\" | \"brand\" | \"accent\" | \"info\" | \"success\" | \"warning\" | \"danger\"\nexport type ColorTemplateType = \"fill\" | \"outline\" | \"text\" | \"alpha\"\n\nconst useColorTemplate = (color: ColorTemplateColors, type: ColorTemplateType) => {\n const theme: any = useTheme()\n let _color = color === 'default' ? \"background\" : color as any\n return theme.colors[_color]?.template[type]\n}\n\nexport default useColorTemplate"],"names":["useTheme"],"mappings":"6EAIA,MAAM,gBAAgB,GAAG,CAAC,KAA0B,EAAE,IAAuB,KAAI;;AAC7E,IAAA,MAAM,KAAK,GAAQA,aAAQ,EAAE;AAC7B,IAAA,IAAI,MAAM,GAAG,KAAK,KAAK,SAAS,GAAG,YAAY,GAAG,KAAY;AAC9D,IAAA,OAAO,CAAA,EAAA,GAAA,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,MAAA,IAAA,IAAA,EAAA,KAAA,MAAA,GAAA,MAAA,GAAA,EAAA,CAAE,QAAQ,CAAC,IAAI,CAAC;AAC/C"}
@@ -0,0 +1,6 @@
1
+ import'./theme/index.mjs';import {useTheme}from'./theme/core.mjs';const useColorTemplate = (color, type) => {
2
+ var _a;
3
+ const theme = useTheme();
4
+ let _color = color === 'default' ? "background" : color;
5
+ return (_a = theme.colors[_color]) === null || _a === void 0 ? void 0 : _a.template[type];
6
+ };export{useColorTemplate as default};//# sourceMappingURL=useColorTemplate.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useColorTemplate.mjs","sources":["../src/useColorTemplate.ts"],"sourcesContent":["import { useTheme } from \"./theme\"\nexport type ColorTemplateColors = \"default\" | \"brand\" | \"accent\" | \"info\" | \"success\" | \"warning\" | \"danger\"\nexport type ColorTemplateType = \"fill\" | \"outline\" | \"text\" | \"alpha\"\n\nconst useColorTemplate = (color: ColorTemplateColors, type: ColorTemplateType) => {\n const theme: any = useTheme()\n let _color = color === 'default' ? \"background\" : color as any\n return theme.colors[_color]?.template[type]\n}\n\nexport default useColorTemplate"],"names":[],"mappings":"kEAIA,MAAM,gBAAgB,GAAG,CAAC,KAA0B,EAAE,IAAuB,KAAI;;AAC7E,IAAA,MAAM,KAAK,GAAQ,QAAQ,EAAE;AAC7B,IAAA,IAAI,MAAM,GAAG,KAAK,KAAK,SAAS,GAAG,YAAY,GAAG,KAAY;AAC9D,IAAA,OAAO,CAAA,EAAA,GAAA,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,MAAA,IAAA,IAAA,EAAA,KAAA,MAAA,GAAA,MAAA,GAAA,EAAA,CAAE,QAAQ,CAAC,IAAI,CAAC;AAC/C"}
package/useInterface.d.ts CHANGED
@@ -1,2 +1,5 @@
1
- declare const useInterface: <P extends object>(name: string, userPorps: P, defaultProps: P) => (import(".").ThemeOptions | P)[];
2
- export default useInterface;
1
+ import { ThemeOptions } from './theme/types.js';
2
+
3
+ declare const useInterface: <P extends object>(name: string, userPorps: P, defaultProps: P) => (P | ThemeOptions)[];
4
+
5
+ export { useInterface as default };
package/useInterface.js CHANGED
@@ -1,2 +1,8 @@
1
- import{useTheme as r}from"./theme";const f=(i,n,e)=>{const t=r(),c=t.interfaces[i];return c&&(e=c({...e,...n},t)),[{...e,...n},t]};var o=f;export{o as default};
2
- //# sourceMappingURL=useInterface.js.map
1
+ 'use strict';require('./theme/index.js');var core=require('./theme/core.js');const useInterface = (name, userPorps, defaultProps) => {
2
+ const theme = core.useTheme();
3
+ const _interface = theme.interfaces[name];
4
+ if (_interface) {
5
+ defaultProps = _interface(Object.assign(Object.assign({}, defaultProps), userPorps), theme);
6
+ }
7
+ return [Object.assign(Object.assign({}, defaultProps), userPorps), theme];
8
+ };module.exports=useInterface;//# sourceMappingURL=useInterface.js.map
@@ -1,7 +1 @@
1
- {
2
- "version": 3,
3
- "sources": ["../src/useInterface.ts"],
4
- "sourcesContent": ["import { useTheme } from \"./theme\"\n\nconst useInterface = <P extends object>(name: string, userPorps: P, defaultProps: P) => {\n const theme = useTheme()\n const _interface = theme.interfaces[name]\n\n if (_interface) {\n defaultProps = _interface<P>({ ...defaultProps, ...userPorps }, theme)\n }\n return [{ ...defaultProps, ...userPorps }, theme]\n}\n\nexport default useInterface"],
5
- "mappings": "AAAA,OAAS,YAAAA,MAAgB,UAEzB,MAAMC,EAAe,CAAmBC,EAAcC,EAAcC,IAAoB,CACpF,MAAMC,EAAQL,EAAS,EACjBM,EAAaD,EAAM,WAAWH,CAAI,EAExC,OAAII,IACAF,EAAeE,EAAc,CAAE,GAAGF,EAAc,GAAGD,CAAU,EAAGE,CAAK,GAElE,CAAC,CAAE,GAAGD,EAAc,GAAGD,CAAU,EAAGE,CAAK,CACpD,EAEA,IAAOE,EAAQN",
6
- "names": ["useTheme", "useInterface", "name", "userPorps", "defaultProps", "theme", "_interface", "useInterface_default"]
7
- }
1
+ {"version":3,"file":"useInterface.js","sources":["../src/useInterface.ts"],"sourcesContent":["import { useTheme } from \"./theme\"\n\nconst useInterface = <P extends object>(name: string, userPorps: P, defaultProps: P) => {\n const theme = useTheme()\n const _interface = theme.interfaces[name]\n\n if (_interface) {\n defaultProps = _interface<P>({ ...defaultProps, ...userPorps }, theme)\n }\n return [{ ...defaultProps, ...userPorps }, theme]\n}\n\nexport default useInterface"],"names":["useTheme"],"mappings":"6EAEM,MAAA,YAAY,GAAG,CAAmB,IAAY,EAAE,SAAY,EAAE,YAAe,KAAI;AACnF,IAAA,MAAM,KAAK,GAAGA,aAAQ,EAAE;IACxB,MAAM,UAAU,GAAG,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC;AAEzC,IAAA,IAAI,UAAU,EAAE;QACZ,YAAY,GAAG,UAAU,CAAS,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EAAA,YAAY,GAAK,SAAS,CAAA,EAAI,KAAK,CAAC;AACzE;AACD,IAAA,OAAO,iCAAM,YAAY,CAAA,EAAK,SAAS,CAAI,EAAA,KAAK,CAAC;AACrD"}
@@ -0,0 +1,8 @@
1
+ import'./theme/index.mjs';import {useTheme}from'./theme/core.mjs';const useInterface = (name, userPorps, defaultProps) => {
2
+ const theme = useTheme();
3
+ const _interface = theme.interfaces[name];
4
+ if (_interface) {
5
+ defaultProps = _interface(Object.assign(Object.assign({}, defaultProps), userPorps), theme);
6
+ }
7
+ return [Object.assign(Object.assign({}, defaultProps), userPorps), theme];
8
+ };export{useInterface as default};//# sourceMappingURL=useInterface.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useInterface.mjs","sources":["../src/useInterface.ts"],"sourcesContent":["import { useTheme } from \"./theme\"\n\nconst useInterface = <P extends object>(name: string, userPorps: P, defaultProps: P) => {\n const theme = useTheme()\n const _interface = theme.interfaces[name]\n\n if (_interface) {\n defaultProps = _interface<P>({ ...defaultProps, ...userPorps }, theme)\n }\n return [{ ...defaultProps, ...userPorps }, theme]\n}\n\nexport default useInterface"],"names":[],"mappings":"kEAEM,MAAA,YAAY,GAAG,CAAmB,IAAY,EAAE,SAAY,EAAE,YAAe,KAAI;AACnF,IAAA,MAAM,KAAK,GAAG,QAAQ,EAAE;IACxB,MAAM,UAAU,GAAG,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC;AAEzC,IAAA,IAAI,UAAU,EAAE;QACZ,YAAY,GAAG,UAAU,CAAS,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EAAA,YAAY,GAAK,SAAS,CAAA,EAAI,KAAK,CAAC;AACzE;AACD,IAAA,OAAO,iCAAM,YAAY,CAAA,EAAK,SAAS,CAAI,EAAA,KAAK,CAAC;AACrD"}
@@ -1,2 +0,0 @@
1
- declare const CSS_PROP_LIST: any;
2
- export default CSS_PROP_LIST;
package/Tag/types.js DELETED
@@ -1 +0,0 @@
1
- //# sourceMappingURL=types.js.map
package/Tag/types.js.map DELETED
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": [],
4
- "sourcesContent": [],
5
- "mappings": "",
6
- "names": []
7
- }
@@ -1,6 +0,0 @@
1
- import React, { ReactNode } from "react";
2
- import { BreakpointKeys } from "../css/types";
3
- export declare const BreakpointCtx: React.Context<BreakpointKeys>;
4
- export declare const BreakpointProvider: ({ children }: {
5
- children?: ReactNode;
6
- }) => React.JSX.Element;
@@ -1,2 +0,0 @@
1
- import n,{useState as m}from"react";import a from"../isWindow";import{breakpoints as r}from"../css";const l=n.createContext("xl"),s=()=>{if(a()){const e=window.innerWidth;return e<r.sm?"xs":e>r.xs&&e<r.md?"sm":e>r.sm&&e<r.lg?"md":e>r.md&&e<r.xl?"lg":"xl"}else return"xl"},v=({children:i})=>{const[e,d]=m(s),t=()=>{let o=s();e!==o&&d(o)};return n.useEffect(()=>(window.removeEventListener("resize",t),window.addEventListener("resize",t),t(),()=>{window.removeEventListener("resize",t)}),[e]),n.createElement(l.Provider,{value:e},i)};export{l as BreakpointCtx,v as BreakpointProvider};
2
- //# sourceMappingURL=index.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/breakpoint/index.tsx"],
4
- "sourcesContent": ["import React, { ReactNode, useState } from \"react\";\nimport isWindow from \"../isWindow\";\nimport { breakpoints } from \"../css\";\nimport { BreakpointKeys } from \"../css/types\";\n\nexport const BreakpointCtx = React.createContext<BreakpointKeys>(\"xl\")\n\nconst getKey = (): BreakpointKeys => {\n const isWin = isWindow()\n if (isWin) {\n const width = window.innerWidth\n if (width < breakpoints.sm) {\n return 'xs'\n } else if (width > breakpoints.xs && width < breakpoints.md) {\n return 'sm'\n } else if (width > breakpoints.sm && width < breakpoints.lg) {\n return 'md'\n } else if (width > breakpoints.md && width < breakpoints.xl) {\n return 'lg'\n } else {\n return 'xl'\n }\n } else {\n return 'xl'\n }\n}\n\nexport const BreakpointProvider = ({ children }: { children?: ReactNode }) => {\n const [current, setCurrent] = useState<BreakpointKeys>(getKey)\n\n const handler = () => {\n let c = getKey()\n if (current !== c) {\n setCurrent(c)\n }\n }\n\n React.useEffect(() => {\n window.removeEventListener(\"resize\", handler)\n window.addEventListener(\"resize\", handler)\n handler()\n return () => {\n window.removeEventListener(\"resize\", handler)\n }\n }, [current])\n\n return (\n <BreakpointCtx.Provider value={current}>\n {children}\n </BreakpointCtx.Provider>\n )\n}\n"],
5
- "mappings": "AAAA,OAAOA,GAAoB,YAAAC,MAAgB,QAC3C,OAAOC,MAAc,cACrB,OAAS,eAAAC,MAAmB,SAGrB,MAAMC,EAAgBJ,EAAM,cAA8B,IAAI,EAE/DK,EAAS,IAAsB,CAEjC,GADcH,EAAS,EACZ,CACP,MAAMI,EAAQ,OAAO,WACrB,OAAIA,EAAQH,EAAY,GACb,KACAG,EAAQH,EAAY,IAAMG,EAAQH,EAAY,GAC9C,KACAG,EAAQH,EAAY,IAAMG,EAAQH,EAAY,GAC9C,KACAG,EAAQH,EAAY,IAAMG,EAAQH,EAAY,GAC9C,KAEA,IAEf,KACI,OAAO,IAEf,EAEaI,EAAqB,CAAC,CAAE,SAAAC,CAAS,IAAgC,CAC1E,KAAM,CAACC,EAASC,CAAU,EAAIT,EAAyBI,CAAM,EAEvDM,EAAU,IAAM,CAClB,IAAIC,EAAIP,EAAO,EACXI,IAAYG,GACZF,EAAWE,CAAC,CAEpB,EAEA,OAAAZ,EAAM,UAAU,KACZ,OAAO,oBAAoB,SAAUW,CAAO,EAC5C,OAAO,iBAAiB,SAAUA,CAAO,EACzCA,EAAQ,EACD,IAAM,CACT,OAAO,oBAAoB,SAAUA,CAAO,CAChD,GACD,CAACF,CAAO,CAAC,EAGRT,EAAA,cAACI,EAAc,SAAd,CAAuB,MAAOK,GAC1BD,CACL,CAER",
6
- "names": ["React", "useState", "isWindow", "breakpoints", "BreakpointCtx", "getKey", "width", "BreakpointProvider", "children", "current", "setCurrent", "handler", "c"]
7
- }
@@ -1,2 +0,0 @@
1
- "use strict";var n=Object.create;var t=Object.defineProperty;var y=Object.getOwnPropertyDescriptor;var S=Object.getOwnPropertyNames;var c=Object.getPrototypeOf,f=Object.prototype.hasOwnProperty;var p=(r,a)=>{for(var e in a)t(r,e,{get:a[e],enumerable:!0})},m=(r,a,e,o)=>{if(a&&typeof a=="object"||typeof a=="function")for(let s of S(a))!f.call(r,s)&&s!==e&&t(r,s,{get:()=>a[s],enumerable:!(o=y(a,s))||o.enumerable});return r};var u=(r,a,e)=>(e=r!=null?n(c(r)):{},m(a||!r||!r.__esModule?t(e,"default",{value:r,enumerable:!0}):e,r)),d=r=>m(t({},"__esModule",{value:!0}),r);var T={};p(T,{default:()=>v});module.exports=d(T);var g=u(require("react"),1),l=require("oncss");const i=()=>Array.from(l.CSSFactory.values()).map((r,a)=>g.createElement("style",{key:r.classname+a,"data-oncss":r.classname,dangerouslySetInnerHTML:{__html:r.css}}));var v=i;
2
- //# sourceMappingURL=ServerStyleTags.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/ServerStyleTags.tsx"],
4
- "sourcesContent": ["import * as React from 'react'\nimport { CSSFactory } from 'oncss'\n\nconst ServerStyleTags = () => {\n return Array.from(CSSFactory.values()).map((c, idx) => <style\n key={c.classname + idx}\n data-oncss={c.classname}\n dangerouslySetInnerHTML={{ __html: c.css }}\n />)\n}\n\nexport default ServerStyleTags"],
5
- "mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAuB,sBACvBC,EAA2B,iBAE3B,MAAMC,EAAkB,IACb,MAAM,KAAK,aAAW,OAAO,CAAC,EAAE,IAAI,CAACC,EAAGC,IAAQJ,EAAA,cAAC,SACpD,IAAKG,EAAE,UAAYC,EACnB,aAAYD,EAAE,UACd,wBAAyB,CAAE,OAAQA,EAAE,GAAI,EAC7C,CAAE,EAGN,IAAOL,EAAQI",
6
- "names": ["ServerStyleTags_exports", "__export", "ServerStyleTags_default", "__toCommonJS", "React", "import_oncss", "ServerStyleTags", "c", "idx"]
7
- }
@@ -1,2 +0,0 @@
1
- "use strict";var n=Object.defineProperty;var a=Object.getOwnPropertyDescriptor;var d=Object.getOwnPropertyNames;var g=Object.prototype.hasOwnProperty;var l=(o,i)=>{for(var r in i)n(o,r,{get:i[r],enumerable:!0})},m=(o,i,r,e)=>{if(i&&typeof i=="object"||typeof i=="function")for(let t of d(i))!g.call(o,t)&&t!==r&&n(o,t,{get:()=>i[t],enumerable:!(e=a(i,t))||e.enumerable});return o};var p=o=>m(n({},"__esModule",{value:!0}),o);var f={};l(f,{default:()=>s});module.exports=p(f);const b={typography:1,bgcolor:1,bgimage:1,bg:1,p:1,pt:1,pr:1,pb:1,pl:1,px:1,py:1,m:1,mt:1,mr:1,mb:1,ml:1,mx:1,my:1,radius:1,shadow:1,flexBox:1,flexRow:1,flexColumn:1,flexWraped:1,disabled:1,spacing:1,gradient:1,alignContent:1,alignItems:1,alignSelf:1,animation:1,animationComposition:1,animationDelay:1,animationDirection:1,animationDuration:1,animationFillMode:1,animationIterationCount:1,animationName:1,animationTimingFunction:1,backdropFilter:1,background:1,backgroundAttachment:1,backgroundColor:1,backgroundImage:1,backgroundOrigin:1,backgroundPosition:1,backgroundRepeat:1,backgroundSize:1,border:1,borderBottom:1,borderBottomColor:1,borderBottomStyle:1,borderBottomWidth:1,borderColor:1,borderImage:1,borderLeft:1,borderLeftColor:1,borderLeftStyle:1,borderLeftWidth:1,borderRadius:1,borderRight:1,borderRightColor:1,borderRightStyle:1,borderRightWidth:1,borderStyle:1,borderTop:1,borderTopColor:1,borderTopLeftRadius:1,borderTopRightRadius:1,borderTopStyle:1,borderTopWidth:1,borderWidth:1,bottom:1,boxShadow:1,boxSizing:1,cursor:1,color:1,display:1,direction:1,filter:1,flex:1,flexBasis:1,flexDirection:1,flexFlow:1,flexGrow:1,flexShrink:1,flexWrap:1,float:1,fontFamily:1,fontSize:1,fontStyle:1,fontWeight:1,font:1,gap:1,grid:1,gridArea:1,gridAutoColumns:1,gridAutoFlow:1,gridAutoRows:1,gridColumn:1,gridColumnEnd:1,gridColumnGap:1,gridColumnStart:1,gridGap:1,gridRow:1,gridRowEnd:1,gridRowGap:1,gridRowStart:1,gridTemplate:1,gridTemplateAreas:1,gridTemplateColumns:1,gridTemplateRows:1,height:1,justifyContent:1,justifyItems:1,justifySelf:1,left:1,letterSpacing:1,lineBreak:1,lineHeight:1,listStyle:1,margin:1,marginBlock:1,marginBlockEnd:1,marginBlockStart:1,marginBottom:1,marginInline:1,marginInlineEnd:1,marginInlineStart:1,marginLeft:1,marginRight:1,marginTop:1,maxHeight:1,maxWidth:1,minHeight:1,minWidth:1,objectFit:1,objectPosition:1,opacity:1,order:1,outline:1,overflow:1,overflowX:1,overflowY:1,padding:1,paddingBlock:1,paddingBlockEnd:1,paddingBlockStart:1,paddingBottom:1,paddingInline:1,paddingInlineEnd:1,paddingInlineStart:1,paddingLeft:1,paddingRight:1,paddingTop:1,perspective:1,perspectiveOrigin:1,pointerEvents:1,position:1,resize:1,right:1,textAlign:1,textDecoration:1,textShadow:1,textTransform:1,top:1,transform:1,transformOrigin:1,transformStyle:1,transition:1,transitionDelay:1,transitionDuration:1,transitionProperty:1,transitionTimingFunction:1,userSelect:1,verticalAlign:1,visibility:1,whiteSpace:1,width:1,wordBreak:1,wordSpacing:1,wordWrap:1,zIndex:1};var s=b;
2
- //# sourceMappingURL=cssPropList.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/Tag/cssPropList.ts"],
4
- "sourcesContent": ["\nconst CSS_PROP_LIST: any = {\n typography: 1,\n bgcolor: 1,\n bgimage: 1,\n bg: 1,\n p: 1,\n pt: 1,\n pr: 1,\n pb: 1,\n pl: 1,\n px: 1,\n py: 1,\n m: 1,\n mt: 1,\n mr: 1,\n mb: 1,\n ml: 1,\n mx: 1,\n my: 1,\n radius: 1,\n shadow: 1,\n flexBox: 1,\n flexRow: 1,\n flexColumn: 1,\n flexWraped: 1,\n disabled: 1,\n spacing: 1,\n\n gradient: 1,\n\n // CSS Props\n alignContent: 1,\n alignItems: 1,\n alignSelf: 1,\n animation: 1,\n animationComposition: 1,\n animationDelay: 1,\n animationDirection: 1,\n animationDuration: 1,\n animationFillMode: 1,\n animationIterationCount: 1,\n animationName: 1,\n animationTimingFunction: 1,\n backdropFilter: 1,\n background: 1,\n backgroundAttachment: 1,\n backgroundColor: 1,\n backgroundImage: 1,\n backgroundOrigin: 1,\n backgroundPosition: 1,\n backgroundRepeat: 1,\n backgroundSize: 1,\n border: 1,\n borderBottom: 1,\n borderBottomColor: 1,\n borderBottomStyle: 1,\n borderBottomWidth: 1,\n borderColor: 1,\n borderImage: 1,\n borderLeft: 1,\n borderLeftColor: 1,\n borderLeftStyle: 1,\n borderLeftWidth: 1,\n borderRadius: 1,\n borderRight: 1,\n borderRightColor: 1,\n borderRightStyle: 1,\n borderRightWidth: 1,\n borderStyle: 1,\n borderTop: 1,\n borderTopColor: 1,\n borderTopLeftRadius: 1,\n borderTopRightRadius: 1,\n borderTopStyle: 1,\n borderTopWidth: 1,\n borderWidth: 1,\n bottom: 1,\n boxShadow: 1,\n boxSizing: 1,\n cursor: 1,\n color: 1,\n display: 1,\n direction: 1,\n filter: 1,\n flex: 1,\n flexBasis: 1,\n flexDirection: 1,\n flexFlow: 1,\n flexGrow: 1,\n flexShrink: 1,\n flexWrap: 1,\n float: 1,\n fontFamily: 1,\n fontSize: 1,\n fontStyle: 1,\n fontWeight: 1,\n font: 1,\n gap: 1,\n grid: 1,\n gridArea: 1,\n gridAutoColumns: 1,\n gridAutoFlow: 1,\n gridAutoRows: 1,\n gridColumn: 1,\n gridColumnEnd: 1,\n gridColumnGap: 1,\n gridColumnStart: 1,\n gridGap: 1,\n gridRow: 1,\n gridRowEnd: 1,\n gridRowGap: 1,\n gridRowStart: 1,\n gridTemplate: 1,\n gridTemplateAreas: 1,\n gridTemplateColumns: 1,\n gridTemplateRows: 1,\n height: 1,\n justifyContent: 1,\n justifyItems: 1,\n justifySelf: 1,\n left: 1,\n letterSpacing: 1,\n lineBreak: 1,\n lineHeight: 1,\n listStyle: 1,\n margin: 1,\n marginBlock: 1,\n marginBlockEnd: 1,\n marginBlockStart: 1,\n marginBottom: 1,\n marginInline: 1,\n marginInlineEnd: 1,\n marginInlineStart: 1,\n marginLeft: 1,\n marginRight: 1,\n marginTop: 1,\n maxHeight: 1,\n maxWidth: 1,\n minHeight: 1,\n minWidth: 1,\n objectFit: 1,\n objectPosition: 1,\n opacity: 1,\n order: 1,\n outline: 1,\n overflow: 1,\n overflowX: 1,\n overflowY: 1,\n padding: 1,\n paddingBlock: 1,\n paddingBlockEnd: 1,\n paddingBlockStart: 1,\n paddingBottom: 1,\n paddingInline: 1,\n paddingInlineEnd: 1,\n paddingInlineStart: 1,\n paddingLeft: 1,\n paddingRight: 1,\n paddingTop: 1,\n perspective: 1,\n perspectiveOrigin: 1,\n pointerEvents: 1,\n position: 1,\n resize: 1,\n right: 1,\n textAlign: 1,\n textDecoration: 1,\n textShadow: 1,\n textTransform: 1,\n top: 1,\n transform: 1,\n transformOrigin: 1,\n transformStyle: 1,\n transition: 1,\n transitionDelay: 1,\n transitionDuration: 1,\n transitionProperty: 1,\n transitionTimingFunction: 1,\n userSelect: 1,\n verticalAlign: 1,\n visibility: 1,\n whiteSpace: 1,\n width: 1,\n wordBreak: 1,\n wordSpacing: 1,\n wordWrap: 1,\n zIndex: 1,\n}\n\nexport default CSS_PROP_LIST"],
5
- "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GACA,MAAMI,EAAqB,CACvB,WAAY,EACZ,QAAS,EACT,QAAS,EACT,GAAI,EACJ,EAAG,EACH,GAAI,EACJ,GAAI,EACJ,GAAI,EACJ,GAAI,EACJ,GAAI,EACJ,GAAI,EACJ,EAAG,EACH,GAAI,EACJ,GAAI,EACJ,GAAI,EACJ,GAAI,EACJ,GAAI,EACJ,GAAI,EACJ,OAAQ,EACR,OAAQ,EACR,QAAS,EACT,QAAS,EACT,WAAY,EACZ,WAAY,EACZ,SAAU,EACV,QAAS,EAET,SAAU,EAGV,aAAc,EACd,WAAY,EACZ,UAAW,EACX,UAAW,EACX,qBAAsB,EACtB,eAAgB,EAChB,mBAAoB,EACpB,kBAAmB,EACnB,kBAAmB,EACnB,wBAAyB,EACzB,cAAe,EACf,wBAAyB,EACzB,eAAgB,EAChB,WAAY,EACZ,qBAAsB,EACtB,gBAAiB,EACjB,gBAAiB,EACjB,iBAAkB,EAClB,mBAAoB,EACpB,iBAAkB,EAClB,eAAgB,EAChB,OAAQ,EACR,aAAc,EACd,kBAAmB,EACnB,kBAAmB,EACnB,kBAAmB,EACnB,YAAa,EACb,YAAa,EACb,WAAY,EACZ,gBAAiB,EACjB,gBAAiB,EACjB,gBAAiB,EACjB,aAAc,EACd,YAAa,EACb,iBAAkB,EAClB,iBAAkB,EAClB,iBAAkB,EAClB,YAAa,EACb,UAAW,EACX,eAAgB,EAChB,oBAAqB,EACrB,qBAAsB,EACtB,eAAgB,EAChB,eAAgB,EAChB,YAAa,EACb,OAAQ,EACR,UAAW,EACX,UAAW,EACX,OAAQ,EACR,MAAO,EACP,QAAS,EACT,UAAW,EACX,OAAQ,EACR,KAAM,EACN,UAAW,EACX,cAAe,EACf,SAAU,EACV,SAAU,EACV,WAAY,EACZ,SAAU,EACV,MAAO,EACP,WAAY,EACZ,SAAU,EACV,UAAW,EACX,WAAY,EACZ,KAAM,EACN,IAAK,EACL,KAAM,EACN,SAAU,EACV,gBAAiB,EACjB,aAAc,EACd,aAAc,EACd,WAAY,EACZ,cAAe,EACf,cAAe,EACf,gBAAiB,EACjB,QAAS,EACT,QAAS,EACT,WAAY,EACZ,WAAY,EACZ,aAAc,EACd,aAAc,EACd,kBAAmB,EACnB,oBAAqB,EACrB,iBAAkB,EAClB,OAAQ,EACR,eAAgB,EAChB,aAAc,EACd,YAAa,EACb,KAAM,EACN,cAAe,EACf,UAAW,EACX,WAAY,EACZ,UAAW,EACX,OAAQ,EACR,YAAa,EACb,eAAgB,EAChB,iBAAkB,EAClB,aAAc,EACd,aAAc,EACd,gBAAiB,EACjB,kBAAmB,EACnB,WAAY,EACZ,YAAa,EACb,UAAW,EACX,UAAW,EACX,SAAU,EACV,UAAW,EACX,SAAU,EACV,UAAW,EACX,eAAgB,EAChB,QAAS,EACT,MAAO,EACP,QAAS,EACT,SAAU,EACV,UAAW,EACX,UAAW,EACX,QAAS,EACT,aAAc,EACd,gBAAiB,EACjB,kBAAmB,EACnB,cAAe,EACf,cAAe,EACf,iBAAkB,EAClB,mBAAoB,EACpB,YAAa,EACb,aAAc,EACd,WAAY,EACZ,YAAa,EACb,kBAAmB,EACnB,cAAe,EACf,SAAU,EACV,OAAQ,EACR,MAAO,EACP,UAAW,EACX,eAAgB,EAChB,WAAY,EACZ,cAAe,EACf,IAAK,EACL,UAAW,EACX,gBAAiB,EACjB,eAAgB,EAChB,WAAY,EACZ,gBAAiB,EACjB,mBAAoB,EACpB,mBAAoB,EACpB,yBAA0B,EAC1B,WAAY,EACZ,cAAe,EACf,WAAY,EACZ,WAAY,EACZ,MAAO,EACP,UAAW,EACX,YAAa,EACb,SAAU,EACV,OAAQ,CACZ,EAEA,IAAOF,EAAQE",
6
- "names": ["cssPropList_exports", "__export", "cssPropList_default", "__toCommonJS", "CSS_PROP_LIST"]
7
- }
package/cjs/Tag/index.js DELETED
@@ -1,2 +0,0 @@
1
- "use strict";var f=Object.create;var p=Object.defineProperty;var g=Object.getOwnPropertyDescriptor;var R=Object.getOwnPropertyNames;var c=Object.getPrototypeOf,d=Object.prototype.hasOwnProperty;var i=(o,e)=>{for(var r in e)p(o,r,{get:e[r],enumerable:!0})},n=(o,e,r,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let t of R(e))!d.call(o,t)&&t!==r&&p(o,t,{get:()=>e[t],enumerable:!(a=g(e,t))||a.enumerable});return o};var T=(o,e,r)=>(r=o!=null?f(c(o)):{},n(e||!o||!o.__esModule?p(r,"default",{value:o,enumerable:!0}):r,o)),y=o=>n(p({},"__esModule",{value:!0}),o);var l={};i(l,{default:()=>P});module.exports=y(l);var m=T(require("react"),1),s=T(require("./useTagProps"),1);const u=m.forwardRef(({component:o,children:e,...r},a)=>{const t=(0,s.default)(r);return t.ref=a,m.createElement(o||"div",t,e)});var P=u;
2
- //# sourceMappingURL=index.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/Tag/index.tsx"],
4
- "sourcesContent": ["import * as React from 'react'\nimport { TagComponentType, TagPropsRoot } from './types';\nimport useTagProps from './useTagProps';\n\nconst Tag = React.forwardRef(<T extends TagComponentType = 'div'>({ component, children, ...rest }: TagPropsRoot<T>, ref: React.Ref<any>) => {\n const props: any = useTagProps(rest)\n props.ref = ref\n return React.createElement(component || \"div\", props, children)\n})\n\nexport default Tag"],
5
- "mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAuB,sBAEvBC,EAAwB,8BAExB,MAAMC,EAAMF,EAAM,WAAW,CAAqC,CAAE,UAAAG,EAAW,SAAAC,EAAU,GAAGC,CAAK,EAAoBC,IAAwB,CACzI,MAAMC,KAAa,EAAAC,SAAYH,CAAI,EACnC,OAAAE,EAAM,IAAMD,EACLN,EAAM,cAAcG,GAAa,MAAOI,EAAOH,CAAQ,CAClE,CAAC,EAED,IAAON,EAAQI",
6
- "names": ["Tag_exports", "__export", "Tag_default", "__toCommonJS", "React", "import_useTagProps", "Tag", "component", "children", "rest", "ref", "props", "useTagProps"]
7
- }
package/cjs/Tag/types.js DELETED
@@ -1,2 +0,0 @@
1
- "use strict";var r=Object.defineProperty;var t=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var p=Object.prototype.hasOwnProperty;var n=(a,e,i,S)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of l(e))!p.call(a,o)&&o!==i&&r(a,o,{get:()=>e[o],enumerable:!(S=t(e,o))||S.enumerable});return a};var y=a=>n(r({},"__esModule",{value:!0}),a);var T={};module.exports=y(T);
2
- //# sourceMappingURL=types.js.map