@xanui/core 1.2.2 → 1.2.4

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 (74) hide show
  1. package/Tag/useTagProps.d.ts +1 -1
  2. package/Tag/useTagProps.js +6 -5
  3. package/Tag/useTagProps.js.map +1 -1
  4. package/Tag/useTagProps.mjs +6 -5
  5. package/Tag/useTagProps.mjs.map +1 -1
  6. package/breakpoint/BreakpointProvider.js +2 -3
  7. package/breakpoint/BreakpointProvider.js.map +1 -1
  8. package/breakpoint/BreakpointProvider.mjs +2 -3
  9. package/breakpoint/BreakpointProvider.mjs.map +1 -1
  10. package/breakpoint/useBreakpoint.js +2 -2
  11. package/breakpoint/useBreakpoint.js.map +1 -1
  12. package/breakpoint/useBreakpoint.mjs +2 -2
  13. package/breakpoint/useBreakpoint.mjs.map +1 -1
  14. package/css/getValue.js +5 -3
  15. package/css/getValue.js.map +1 -1
  16. package/css/getValue.mjs +5 -3
  17. package/css/getValue.mjs.map +1 -1
  18. package/hooks/useColorTemplate.d.ts +35 -4
  19. package/hooks/useColorTemplate.js +39 -4
  20. package/hooks/useColorTemplate.js.map +1 -1
  21. package/hooks/useColorTemplate.mjs +39 -4
  22. package/hooks/useColorTemplate.mjs.map +1 -1
  23. package/hooks/useInterface.d.ts +1 -1
  24. package/hooks/useInterface.js +1 -1
  25. package/hooks/useInterface.mjs +1 -1
  26. package/hooks/usePortal.js +1 -1
  27. package/hooks/usePortal.js.map +1 -1
  28. package/hooks/usePortal.mjs +1 -1
  29. package/hooks/useScrollbar.js +3 -3
  30. package/hooks/useScrollbar.js.map +1 -1
  31. package/hooks/useScrollbar.mjs +3 -3
  32. package/hooks/useScrollbar.mjs.map +1 -1
  33. package/index.d.ts +1 -3
  34. package/index.js +1 -1
  35. package/index.mjs +1 -1
  36. package/package.json +2 -2
  37. package/theme/ThemeCssVars.js +1 -1
  38. package/theme/ThemeCssVars.js.map +1 -1
  39. package/theme/ThemeCssVars.mjs +1 -1
  40. package/theme/ThemeCssVars.mjs.map +1 -1
  41. package/theme/ThemeDefaultOptions.js +70 -26
  42. package/theme/ThemeDefaultOptions.js.map +1 -1
  43. package/theme/ThemeDefaultOptions.mjs +70 -26
  44. package/theme/ThemeDefaultOptions.mjs.map +1 -1
  45. package/theme/ThemeProvider.js +2 -3
  46. package/theme/ThemeProvider.js.map +1 -1
  47. package/theme/ThemeProvider.mjs +2 -3
  48. package/theme/ThemeProvider.mjs.map +1 -1
  49. package/theme/createTheme.js +2 -13
  50. package/theme/createTheme.js.map +1 -1
  51. package/theme/createTheme.mjs +2 -13
  52. package/theme/createTheme.mjs.map +1 -1
  53. package/theme/createThemeSwitcher.d.ts +3 -2
  54. package/theme/createThemeSwitcher.js +2 -2
  55. package/theme/createThemeSwitcher.js.map +1 -1
  56. package/theme/createThemeSwitcher.mjs +3 -3
  57. package/theme/createThemeSwitcher.mjs.map +1 -1
  58. package/theme/index.js +1 -1
  59. package/theme/index.mjs +1 -1
  60. package/theme/types.d.ts +9 -46
  61. package/RenderServerStyles.d.ts +0 -5
  62. package/RenderServerStyles.js +0 -3
  63. package/RenderServerStyles.js.map +0 -1
  64. package/RenderServerStyles.mjs +0 -3
  65. package/RenderServerStyles.mjs.map +0 -1
  66. package/isWindow.d.ts +0 -3
  67. package/isWindow.js +0 -1
  68. package/isWindow.js.map +0 -1
  69. package/isWindow.mjs +0 -1
  70. package/isWindow.mjs.map +0 -1
  71. package/theme/createColor.js +0 -46
  72. package/theme/createColor.js.map +0 -1
  73. package/theme/createColor.mjs +0 -46
  74. package/theme/createColor.mjs.map +0 -1
@@ -5,7 +5,7 @@ type useTagPropsReturn<T extends TagComponentType = "div"> = {
5
5
  props: TagProps<T>;
6
6
  style: CSSFactoryType;
7
7
  };
8
- declare const useTagProps: <T extends TagComponentType = "div">({ sxr, sx, baseClass, classNames: clses, hover, ...props }: TagPropsRoot<T>) => useTagPropsReturn<T>;
8
+ declare const useTagProps: <T extends TagComponentType = "div">({ baseClass, classNames: clses, ...props }: TagPropsRoot<T>) => useTagPropsReturn<T>;
9
9
 
10
10
  export { useTagProps as default };
11
11
  export type { useTagPropsReturn };
@@ -1,9 +1,10 @@
1
1
  'use strict';Object.defineProperty(exports,'__esModule',{value:true});var tslib=require('tslib'),cssPropList=require('./cssPropList.js'),index=require('../css/index.js'),prettyClass=require('pretty-class');const useTagProps = (_a) => {
2
- var { sxr, sx, baseClass, classNames: clses, hover } = _a, props = tslib.__rest(_a, ["sxr", "sx", "baseClass", "classNames", "hover"]);
3
- let _css = Object.assign(Object.assign(Object.assign({}, sxr), sx), props);
4
- if (hover)
5
- _css['&:hover'] = hover;
6
- const style = index.css(_css, {
2
+ var { baseClass, classNames: clses } = _a, props = tslib.__rest(_a, ["baseClass", "classNames"]);
3
+ if ('hover' in props) {
4
+ props['&:hover'] = props['hover'];
5
+ delete props['hover'];
6
+ }
7
+ const style = index.css(props, {
7
8
  skipProps: (prop, _val, dept) => dept === 1 && !cssPropList.default[prop],
8
9
  injectStyle: typeof window !== 'undefined',
9
10
  });
@@ -1 +1 @@
1
- {"version":3,"file":"useTagProps.js","sources":["../../src/Tag/useTagProps.ts"],"sourcesContent":["import { TagComponentType, TagProps, TagPropsRoot } from './types';\r\nimport cssPropList from './cssPropList';\r\nimport { css } from '../css';\r\nimport { classNames } from 'pretty-class';\r\nimport { CSSFactoryType } from 'oncss';\r\n\r\nexport type useTagPropsReturn<T extends TagComponentType = \"div\"> = {\r\n props: TagProps<T>,\r\n style: CSSFactoryType\r\n}\r\n\r\nconst useTagProps = <T extends TagComponentType = \"div\">({ sxr, sx, baseClass, classNames: clses, hover, ...props }: TagPropsRoot<T>): useTagPropsReturn<T> => {\r\n let _css: any = { ...sxr, ...sx, ...props }\r\n if (hover) _css['&:hover'] = hover\r\n const style = css(_css, {\r\n skipProps: (prop, _val, dept): any => dept === 1 && !cssPropList[prop],\r\n injectStyle: typeof window !== 'undefined',\r\n })\r\n\r\n let skipProps = style.skiped[style.classname as any] || []\r\n const _props: any = {};\r\n for (let prop of skipProps) {\r\n _props[prop] = (props as any)[prop]\r\n }\r\n _props.className = classNames([\r\n baseClass ? \"xui-\" + baseClass : \"\",\r\n style.classname,\r\n props.className,\r\n ...(clses as any || []),\r\n ])\r\n return { props: _props, style };\r\n}\r\n\r\n\r\nexport default useTagProps"],"names":["__rest","css","cssPropList","classNames"],"mappings":"8MAWA,MAAM,WAAW,GAAG,CAAqC,EAA2E,KAA0B;AAArG,IAAA,IAAA,EAAE,GAAG,EAAE,EAAE,EAAE,SAAS,EAAE,UAAU,EAAE,KAAK,EAAE,KAAK,EAAA,GAAA,EAA6B,EAAxB,KAAK,GAAAA,YAAA,CAAA,EAAA,EAAxD,iDAA0D,CAAF;IAC9G,IAAI,IAAI,iDAAa,GAAG,CAAA,EAAK,EAAE,CAAA,EAAK,KAAK,CAAE;AAC3C,IAAA,IAAI,KAAK;AAAE,QAAA,IAAI,CAAC,SAAS,CAAC,GAAG,KAAK;AAClC,IAAA,MAAM,KAAK,GAAGC,SAAG,CAAC,IAAI,EAAE;AACrB,QAAA,SAAS,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,KAAU,IAAI,KAAK,CAAC,IAAI,CAACC,mBAAW,CAAC,IAAI,CAAC;AACtE,QAAA,WAAW,EAAE,OAAO,MAAM,KAAK,WAAW;AAC5C,KAAA,CAAC;AAEF,IAAA,IAAI,SAAS,GAAG,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,SAAgB,CAAC,IAAI,EAAE;IAC1D,MAAM,MAAM,GAAQ,EAAE;AACtB,IAAA,KAAK,IAAI,IAAI,IAAI,SAAS,EAAE;QACzB,MAAM,CAAC,IAAI,CAAC,GAAI,KAAa,CAAC,IAAI,CAAC;IACtC;AACA,IAAA,MAAM,CAAC,SAAS,GAAGC,sBAAU,CAAC;QAC3B,SAAS,GAAG,MAAM,GAAG,SAAS,GAAG,EAAE;AACnC,QAAA,KAAK,CAAC,SAAS;AACf,QAAA,KAAK,CAAC,SAAS;AACf,QAAA,IAAI,KAAY,IAAI,EAAE,CAAC;AACzB,KAAA,CAAC;AACF,IAAA,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE;AAClC"}
1
+ {"version":3,"file":"useTagProps.js","sources":["../../src/Tag/useTagProps.ts"],"sourcesContent":["import { TagComponentType, TagProps, TagPropsRoot } from './types';\r\nimport cssPropList from './cssPropList';\r\nimport { css } from '../css';\r\nimport { classNames } from 'pretty-class';\r\nimport { CSSFactoryType } from 'oncss';\r\n\r\nexport type useTagPropsReturn<T extends TagComponentType = \"div\"> = {\r\n props: TagProps<T>,\r\n style: CSSFactoryType\r\n}\r\n\r\nconst useTagProps = <T extends TagComponentType = \"div\">({ baseClass, classNames: clses, ...props }: TagPropsRoot<T>): useTagPropsReturn<T> => {\r\n\r\n if ('hover' in props) {\r\n (props as any)['&:hover'] = props['hover'];\r\n delete (props as any)['hover'];\r\n }\r\n\r\n const style = css(props, {\r\n skipProps: (prop, _val, dept): any => dept === 1 && !cssPropList[prop],\r\n injectStyle: typeof window !== 'undefined',\r\n })\r\n\r\n let skipProps = style.skiped[style.classname as any] || []\r\n const _props: any = {};\r\n for (let prop of skipProps) {\r\n _props[prop] = (props as any)[prop]\r\n }\r\n _props.className = classNames([\r\n baseClass ? \"xui-\" + baseClass : \"\",\r\n style.classname,\r\n props.className,\r\n ...(clses as any || []),\r\n ])\r\n return { props: _props, style };\r\n}\r\n\r\n\r\nexport default useTagProps"],"names":["__rest","css","cssPropList","classNames"],"mappings":"8MAWA,MAAM,WAAW,GAAG,CAAqC,EAA2D,KAA0B;QAArF,EAAE,SAAS,EAAE,UAAU,EAAE,KAAK,OAA6B,EAAxB,KAAK,GAAAA,YAAA,CAAA,EAAA,EAAxC,CAAA,WAAA,EAAA,YAAA,CAA0C,CAAF;AAE9F,IAAA,IAAI,OAAO,IAAI,KAAK,EAAE;QAClB,KAAa,CAAC,SAAS,CAAC,GAAG,KAAK,CAAC,OAAO,CAAC;AAC1C,QAAA,OAAQ,KAAa,CAAC,OAAO,CAAC;IACjC;AAEA,IAAA,MAAM,KAAK,GAAGC,SAAG,CAAC,KAAK,EAAE;AACtB,QAAA,SAAS,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,KAAU,IAAI,KAAK,CAAC,IAAI,CAACC,mBAAW,CAAC,IAAI,CAAC;AACtE,QAAA,WAAW,EAAE,OAAO,MAAM,KAAK,WAAW;AAC5C,KAAA,CAAC;AAEF,IAAA,IAAI,SAAS,GAAG,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,SAAgB,CAAC,IAAI,EAAE;IAC1D,MAAM,MAAM,GAAQ,EAAE;AACtB,IAAA,KAAK,IAAI,IAAI,IAAI,SAAS,EAAE;QACzB,MAAM,CAAC,IAAI,CAAC,GAAI,KAAa,CAAC,IAAI,CAAC;IACtC;AACA,IAAA,MAAM,CAAC,SAAS,GAAGC,sBAAU,CAAC;QAC3B,SAAS,GAAG,MAAM,GAAG,SAAS,GAAG,EAAE;AACnC,QAAA,KAAK,CAAC,SAAS;AACf,QAAA,KAAK,CAAC,SAAS;AACf,QAAA,IAAI,KAAY,IAAI,EAAE,CAAC;AACzB,KAAA,CAAC;AACF,IAAA,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE;AAClC"}
@@ -1,9 +1,10 @@
1
1
  import {__rest}from'tslib';import CSS_PROP_LIST from'./cssPropList.mjs';import {css}from'../css/index.mjs';import {classNames}from'pretty-class';const useTagProps = (_a) => {
2
- var { sxr, sx, baseClass, classNames: clses, hover } = _a, props = __rest(_a, ["sxr", "sx", "baseClass", "classNames", "hover"]);
3
- let _css = Object.assign(Object.assign(Object.assign({}, sxr), sx), props);
4
- if (hover)
5
- _css['&:hover'] = hover;
6
- const style = css(_css, {
2
+ var { baseClass, classNames: clses } = _a, props = __rest(_a, ["baseClass", "classNames"]);
3
+ if ('hover' in props) {
4
+ props['&:hover'] = props['hover'];
5
+ delete props['hover'];
6
+ }
7
+ const style = css(props, {
7
8
  skipProps: (prop, _val, dept) => dept === 1 && !CSS_PROP_LIST[prop],
8
9
  injectStyle: typeof window !== 'undefined',
9
10
  });
@@ -1 +1 @@
1
- {"version":3,"file":"useTagProps.mjs","sources":["../../src/Tag/useTagProps.ts"],"sourcesContent":["import { TagComponentType, TagProps, TagPropsRoot } from './types';\r\nimport cssPropList from './cssPropList';\r\nimport { css } from '../css';\r\nimport { classNames } from 'pretty-class';\r\nimport { CSSFactoryType } from 'oncss';\r\n\r\nexport type useTagPropsReturn<T extends TagComponentType = \"div\"> = {\r\n props: TagProps<T>,\r\n style: CSSFactoryType\r\n}\r\n\r\nconst useTagProps = <T extends TagComponentType = \"div\">({ sxr, sx, baseClass, classNames: clses, hover, ...props }: TagPropsRoot<T>): useTagPropsReturn<T> => {\r\n let _css: any = { ...sxr, ...sx, ...props }\r\n if (hover) _css['&:hover'] = hover\r\n const style = css(_css, {\r\n skipProps: (prop, _val, dept): any => dept === 1 && !cssPropList[prop],\r\n injectStyle: typeof window !== 'undefined',\r\n })\r\n\r\n let skipProps = style.skiped[style.classname as any] || []\r\n const _props: any = {};\r\n for (let prop of skipProps) {\r\n _props[prop] = (props as any)[prop]\r\n }\r\n _props.className = classNames([\r\n baseClass ? \"xui-\" + baseClass : \"\",\r\n style.classname,\r\n props.className,\r\n ...(clses as any || []),\r\n ])\r\n return { props: _props, style };\r\n}\r\n\r\n\r\nexport default useTagProps"],"names":["cssPropList"],"mappings":"iJAWA,MAAM,WAAW,GAAG,CAAqC,EAA2E,KAA0B;AAArG,IAAA,IAAA,EAAE,GAAG,EAAE,EAAE,EAAE,SAAS,EAAE,UAAU,EAAE,KAAK,EAAE,KAAK,EAAA,GAAA,EAA6B,EAAxB,KAAK,GAAA,MAAA,CAAA,EAAA,EAAxD,iDAA0D,CAAF;IAC9G,IAAI,IAAI,iDAAa,GAAG,CAAA,EAAK,EAAE,CAAA,EAAK,KAAK,CAAE;AAC3C,IAAA,IAAI,KAAK;AAAE,QAAA,IAAI,CAAC,SAAS,CAAC,GAAG,KAAK;AAClC,IAAA,MAAM,KAAK,GAAG,GAAG,CAAC,IAAI,EAAE;AACrB,QAAA,SAAS,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,KAAU,IAAI,KAAK,CAAC,IAAI,CAACA,aAAW,CAAC,IAAI,CAAC;AACtE,QAAA,WAAW,EAAE,OAAO,MAAM,KAAK,WAAW;AAC5C,KAAA,CAAC;AAEF,IAAA,IAAI,SAAS,GAAG,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,SAAgB,CAAC,IAAI,EAAE;IAC1D,MAAM,MAAM,GAAQ,EAAE;AACtB,IAAA,KAAK,IAAI,IAAI,IAAI,SAAS,EAAE;QACzB,MAAM,CAAC,IAAI,CAAC,GAAI,KAAa,CAAC,IAAI,CAAC;IACtC;AACA,IAAA,MAAM,CAAC,SAAS,GAAG,UAAU,CAAC;QAC3B,SAAS,GAAG,MAAM,GAAG,SAAS,GAAG,EAAE;AACnC,QAAA,KAAK,CAAC,SAAS;AACf,QAAA,KAAK,CAAC,SAAS;AACf,QAAA,IAAI,KAAY,IAAI,EAAE,CAAC;AACzB,KAAA,CAAC;AACF,IAAA,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE;AAClC"}
1
+ {"version":3,"file":"useTagProps.mjs","sources":["../../src/Tag/useTagProps.ts"],"sourcesContent":["import { TagComponentType, TagProps, TagPropsRoot } from './types';\r\nimport cssPropList from './cssPropList';\r\nimport { css } from '../css';\r\nimport { classNames } from 'pretty-class';\r\nimport { CSSFactoryType } from 'oncss';\r\n\r\nexport type useTagPropsReturn<T extends TagComponentType = \"div\"> = {\r\n props: TagProps<T>,\r\n style: CSSFactoryType\r\n}\r\n\r\nconst useTagProps = <T extends TagComponentType = \"div\">({ baseClass, classNames: clses, ...props }: TagPropsRoot<T>): useTagPropsReturn<T> => {\r\n\r\n if ('hover' in props) {\r\n (props as any)['&:hover'] = props['hover'];\r\n delete (props as any)['hover'];\r\n }\r\n\r\n const style = css(props, {\r\n skipProps: (prop, _val, dept): any => dept === 1 && !cssPropList[prop],\r\n injectStyle: typeof window !== 'undefined',\r\n })\r\n\r\n let skipProps = style.skiped[style.classname as any] || []\r\n const _props: any = {};\r\n for (let prop of skipProps) {\r\n _props[prop] = (props as any)[prop]\r\n }\r\n _props.className = classNames([\r\n baseClass ? \"xui-\" + baseClass : \"\",\r\n style.classname,\r\n props.className,\r\n ...(clses as any || []),\r\n ])\r\n return { props: _props, style };\r\n}\r\n\r\n\r\nexport default useTagProps"],"names":["cssPropList"],"mappings":"iJAWA,MAAM,WAAW,GAAG,CAAqC,EAA2D,KAA0B;QAArF,EAAE,SAAS,EAAE,UAAU,EAAE,KAAK,OAA6B,EAAxB,KAAK,GAAA,MAAA,CAAA,EAAA,EAAxC,CAAA,WAAA,EAAA,YAAA,CAA0C,CAAF;AAE9F,IAAA,IAAI,OAAO,IAAI,KAAK,EAAE;QAClB,KAAa,CAAC,SAAS,CAAC,GAAG,KAAK,CAAC,OAAO,CAAC;AAC1C,QAAA,OAAQ,KAAa,CAAC,OAAO,CAAC;IACjC;AAEA,IAAA,MAAM,KAAK,GAAG,GAAG,CAAC,KAAK,EAAE;AACtB,QAAA,SAAS,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,KAAU,IAAI,KAAK,CAAC,IAAI,CAACA,aAAW,CAAC,IAAI,CAAC;AACtE,QAAA,WAAW,EAAE,OAAO,MAAM,KAAK,WAAW;AAC5C,KAAA,CAAC;AAEF,IAAA,IAAI,SAAS,GAAG,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,SAAgB,CAAC,IAAI,EAAE;IAC1D,MAAM,MAAM,GAAQ,EAAE;AACtB,IAAA,KAAK,IAAI,IAAI,IAAI,SAAS,EAAE;QACzB,MAAM,CAAC,IAAI,CAAC,GAAI,KAAa,CAAC,IAAI,CAAC;IACtC;AACA,IAAA,MAAM,CAAC,SAAS,GAAG,UAAU,CAAC;QAC3B,SAAS,GAAG,MAAM,GAAG,SAAS,GAAG,EAAE;AACnC,QAAA,KAAK,CAAC,SAAS;AACf,QAAA,KAAK,CAAC,SAAS;AACf,QAAA,IAAI,KAAY,IAAI,EAAE,CAAC;AACzB,KAAA,CAAC;AACF,IAAA,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE;AAClC"}
@@ -1,10 +1,9 @@
1
- 'use strict';Object.defineProperty(exports,'__esModule',{value:true});var jsxRuntime=require('react/jsx-runtime'),React=require('react'),isWindow=require('../isWindow.js'),index=require('../css/index.js');const BreakpointCtx = React.createContext("xs");
1
+ 'use strict';Object.defineProperty(exports,'__esModule',{value:true});var jsxRuntime=require('react/jsx-runtime'),React=require('react'),index=require('../css/index.js');const BreakpointCtx = React.createContext("xs");
2
2
  /**
3
3
  * SSR-safe breakpoint detection
4
4
  */
5
5
  const getKey = () => {
6
- if (!isWindow.default()) {
7
- // Server fallback (mobile-first)
6
+ if (typeof window === 'undefined') {
8
7
  return "xs";
9
8
  }
10
9
  const width = window.innerWidth;
@@ -1 +1 @@
1
- {"version":3,"file":"BreakpointProvider.js","sources":["../../src/breakpoint/BreakpointProvider.tsx"],"sourcesContent":["import React, { ReactNode, useState, useCallback } from \"react\";\r\nimport isWindow from \"../isWindow\";\r\nimport { breakpoints } from \"../css\";\r\nimport { BreakpointKeys } from \"../css/types\";\r\n\r\nexport const BreakpointCtx = React.createContext<BreakpointKeys>(\"xs\");\r\n\r\n/**\r\n * SSR-safe breakpoint detection\r\n */\r\nconst getKey = (): BreakpointKeys => {\r\n if (!isWindow()) {\r\n // Server fallback (mobile-first)\r\n return \"xs\";\r\n }\r\n\r\n const width = window.innerWidth;\r\n\r\n if (width < breakpoints.sm) return \"xs\";\r\n if (width < breakpoints.md) return \"sm\";\r\n if (width < breakpoints.lg) return \"md\";\r\n if (width < breakpoints.xl) return \"lg\";\r\n return \"xl\";\r\n};\r\n\r\nexport const BreakpointProvider = ({ children }: { children?: ReactNode }) => {\r\n const [current, setCurrent] = useState<BreakpointKeys>(\"xl\");\r\n\r\n const handler = useCallback(() => {\r\n const newKey = getKey();\r\n setCurrent(prev => (prev === newKey ? prev : newKey));\r\n }, []);\r\n\r\n React.useEffect(() => {\r\n window.addEventListener(\"resize\", handler);\r\n handler(); // detect on mount\r\n return () => window.removeEventListener(\"resize\", handler);\r\n }, [handler]);\r\n\r\n return (\r\n <BreakpointCtx.Provider value={current}>\r\n {children}\r\n </BreakpointCtx.Provider>\r\n );\r\n};\r\n"],"names":["isWindow","breakpoints","useState","useCallback","_jsx"],"mappings":"6MAKO,MAAM,aAAa,GAAG,KAAK,CAAC,aAAa,CAAiB,IAAI;AAErE;;AAEG;AACH,MAAM,MAAM,GAAG,MAAqB;AAChC,IAAA,IAAI,CAACA,gBAAQ,EAAE,EAAE;;AAEb,QAAA,OAAO,IAAI;IACf;AAEA,IAAA,MAAM,KAAK,GAAG,MAAM,CAAC,UAAU;AAE/B,IAAA,IAAI,KAAK,GAAGC,iBAAW,CAAC,EAAE;AAAE,QAAA,OAAO,IAAI;AACvC,IAAA,IAAI,KAAK,GAAGA,iBAAW,CAAC,EAAE;AAAE,QAAA,OAAO,IAAI;AACvC,IAAA,IAAI,KAAK,GAAGA,iBAAW,CAAC,EAAE;AAAE,QAAA,OAAO,IAAI;AACvC,IAAA,IAAI,KAAK,GAAGA,iBAAW,CAAC,EAAE;AAAE,QAAA,OAAO,IAAI;AACvC,IAAA,OAAO,IAAI;AACf,CAAC;MAEY,kBAAkB,GAAG,CAAC,EAAE,QAAQ,EAA4B,KAAI;IACzE,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAGC,cAAQ,CAAiB,IAAI,CAAC;AAE5D,IAAA,MAAM,OAAO,GAAGC,iBAAW,CAAC,MAAK;AAC7B,QAAA,MAAM,MAAM,GAAG,MAAM,EAAE;AACvB,QAAA,UAAU,CAAC,IAAI,KAAK,IAAI,KAAK,MAAM,GAAG,IAAI,GAAG,MAAM,CAAC,CAAC;IACzD,CAAC,EAAE,EAAE,CAAC;AAEN,IAAA,KAAK,CAAC,SAAS,CAAC,MAAK;AACjB,QAAA,MAAM,CAAC,gBAAgB,CAAC,QAAQ,EAAE,OAAO,CAAC;QAC1C,OAAO,EAAE,CAAC;QACV,OAAO,MAAM,MAAM,CAAC,mBAAmB,CAAC,QAAQ,EAAE,OAAO,CAAC;AAC9D,IAAA,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC;AAEb,IAAA,QACIC,cAAA,CAAC,aAAa,CAAC,QAAQ,EAAA,EAAC,KAAK,EAAE,OAAO,EAAA,QAAA,EACjC,QAAQ,EAAA,CACY;AAEjC"}
1
+ {"version":3,"file":"BreakpointProvider.js","sources":["../../src/breakpoint/BreakpointProvider.tsx"],"sourcesContent":["import React, { ReactNode, useState, useCallback } from \"react\";\r\nimport { breakpoints } from \"../css\";\r\nimport { BreakpointKeys } from \"../css/types\";\r\n\r\nexport const BreakpointCtx = React.createContext<BreakpointKeys>(\"xs\");\r\n\r\n/**\r\n * SSR-safe breakpoint detection\r\n */\r\nconst getKey = (): BreakpointKeys => {\r\n if (typeof window === 'undefined') {\r\n return \"xs\";\r\n }\r\n\r\n const width = window.innerWidth;\r\n\r\n if (width < breakpoints.sm) return \"xs\";\r\n if (width < breakpoints.md) return \"sm\";\r\n if (width < breakpoints.lg) return \"md\";\r\n if (width < breakpoints.xl) return \"lg\";\r\n return \"xl\";\r\n};\r\n\r\nexport const BreakpointProvider = ({ children }: { children?: ReactNode }) => {\r\n const [current, setCurrent] = useState<BreakpointKeys>(\"xl\");\r\n\r\n const handler = useCallback(() => {\r\n const newKey = getKey();\r\n setCurrent(prev => (prev === newKey ? prev : newKey));\r\n }, []);\r\n\r\n React.useEffect(() => {\r\n window.addEventListener(\"resize\", handler);\r\n handler(); // detect on mount\r\n return () => window.removeEventListener(\"resize\", handler);\r\n }, [handler]);\r\n\r\n return (\r\n <BreakpointCtx.Provider value={current}>\r\n {children}\r\n </BreakpointCtx.Provider>\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CAAC,aAAa,CAAC,QAAQ,EAAA,EAAC,KAAK,EAAE,OAAO,EAAA,QAAA,EACjC,QAAQ,EAAA,CACY;AAEjC"}
@@ -1,10 +1,9 @@
1
- import {jsx}from'react/jsx-runtime';import React__default,{useState,useCallback}from'react';import isWindow from'../isWindow.mjs';import {breakpoints}from'../css/index.mjs';const BreakpointCtx = React__default.createContext("xs");
1
+ import {jsx}from'react/jsx-runtime';import React__default,{useState,useCallback}from'react';import {breakpoints}from'../css/index.mjs';const BreakpointCtx = React__default.createContext("xs");
2
2
  /**
3
3
  * SSR-safe breakpoint detection
4
4
  */
5
5
  const getKey = () => {
6
- if (!isWindow()) {
7
- // Server fallback (mobile-first)
6
+ if (typeof window === 'undefined') {
8
7
  return "xs";
9
8
  }
10
9
  const width = window.innerWidth;
@@ -1 +1 @@
1
- {"version":3,"file":"BreakpointProvider.mjs","sources":["../../src/breakpoint/BreakpointProvider.tsx"],"sourcesContent":["import React, { ReactNode, useState, useCallback } from \"react\";\r\nimport isWindow from \"../isWindow\";\r\nimport { breakpoints } from \"../css\";\r\nimport { BreakpointKeys } from \"../css/types\";\r\n\r\nexport const BreakpointCtx = React.createContext<BreakpointKeys>(\"xs\");\r\n\r\n/**\r\n * SSR-safe breakpoint detection\r\n */\r\nconst getKey = (): BreakpointKeys => {\r\n if (!isWindow()) {\r\n // Server fallback (mobile-first)\r\n return \"xs\";\r\n }\r\n\r\n const width = window.innerWidth;\r\n\r\n if (width < breakpoints.sm) return \"xs\";\r\n if (width < breakpoints.md) return \"sm\";\r\n if (width < breakpoints.lg) return \"md\";\r\n if (width < breakpoints.xl) return \"lg\";\r\n return \"xl\";\r\n};\r\n\r\nexport const BreakpointProvider = ({ children }: { children?: ReactNode }) => {\r\n const [current, setCurrent] = useState<BreakpointKeys>(\"xl\");\r\n\r\n const handler = useCallback(() => {\r\n const newKey = getKey();\r\n setCurrent(prev => (prev === newKey ? prev : newKey));\r\n }, []);\r\n\r\n React.useEffect(() => {\r\n window.addEventListener(\"resize\", handler);\r\n handler(); // detect on mount\r\n return () => window.removeEventListener(\"resize\", handler);\r\n }, [handler]);\r\n\r\n return (\r\n <BreakpointCtx.Provider value={current}>\r\n {children}\r\n </BreakpointCtx.Provider>\r\n );\r\n};\r\n"],"names":["React","_jsx"],"mappings":"6KAKO,MAAM,aAAa,GAAGA,cAAK,CAAC,aAAa,CAAiB,IAAI;AAErE;;AAEG;AACH,MAAM,MAAM,GAAG,MAAqB;AAChC,IAAA,IAAI,CAAC,QAAQ,EAAE,EAAE;;AAEb,QAAA,OAAO,IAAI;IACf;AAEA,IAAA,MAAM,KAAK,GAAG,MAAM,CAAC,UAAU;AAE/B,IAAA,IAAI,KAAK,GAAG,WAAW,CAAC,EAAE;AAAE,QAAA,OAAO,IAAI;AACvC,IAAA,IAAI,KAAK,GAAG,WAAW,CAAC,EAAE;AAAE,QAAA,OAAO,IAAI;AACvC,IAAA,IAAI,KAAK,GAAG,WAAW,CAAC,EAAE;AAAE,QAAA,OAAO,IAAI;AACvC,IAAA,IAAI,KAAK,GAAG,WAAW,CAAC,EAAE;AAAE,QAAA,OAAO,IAAI;AACvC,IAAA,OAAO,IAAI;AACf,CAAC;MAEY,kBAAkB,GAAG,CAAC,EAAE,QAAQ,EAA4B,KAAI;IACzE,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAiB,IAAI,CAAC;AAE5D,IAAA,MAAM,OAAO,GAAG,WAAW,CAAC,MAAK;AAC7B,QAAA,MAAM,MAAM,GAAG,MAAM,EAAE;AACvB,QAAA,UAAU,CAAC,IAAI,KAAK,IAAI,KAAK,MAAM,GAAG,IAAI,GAAG,MAAM,CAAC,CAAC;IACzD,CAAC,EAAE,EAAE,CAAC;AAEN,IAAAA,cAAK,CAAC,SAAS,CAAC,MAAK;AACjB,QAAA,MAAM,CAAC,gBAAgB,CAAC,QAAQ,EAAE,OAAO,CAAC;QAC1C,OAAO,EAAE,CAAC;QACV,OAAO,MAAM,MAAM,CAAC,mBAAmB,CAAC,QAAQ,EAAE,OAAO,CAAC;AAC9D,IAAA,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC;AAEb,IAAA,QACIC,GAAA,CAAC,aAAa,CAAC,QAAQ,EAAA,EAAC,KAAK,EAAE,OAAO,EAAA,QAAA,EACjC,QAAQ,EAAA,CACY;AAEjC"}
1
+ {"version":3,"file":"BreakpointProvider.mjs","sources":["../../src/breakpoint/BreakpointProvider.tsx"],"sourcesContent":["import React, { ReactNode, useState, useCallback } from \"react\";\r\nimport { breakpoints } from \"../css\";\r\nimport { BreakpointKeys } from \"../css/types\";\r\n\r\nexport const BreakpointCtx = React.createContext<BreakpointKeys>(\"xs\");\r\n\r\n/**\r\n * SSR-safe breakpoint detection\r\n */\r\nconst getKey = (): BreakpointKeys => {\r\n if (typeof window === 'undefined') {\r\n return \"xs\";\r\n }\r\n\r\n const width = window.innerWidth;\r\n\r\n if (width < breakpoints.sm) return \"xs\";\r\n if (width < breakpoints.md) return \"sm\";\r\n if (width < breakpoints.lg) return \"md\";\r\n if (width < breakpoints.xl) return \"lg\";\r\n return \"xl\";\r\n};\r\n\r\nexport const BreakpointProvider = ({ children }: { children?: ReactNode }) => {\r\n const [current, setCurrent] = useState<BreakpointKeys>(\"xl\");\r\n\r\n const handler = useCallback(() => {\r\n const newKey = getKey();\r\n setCurrent(prev => (prev === newKey ? prev : newKey));\r\n }, []);\r\n\r\n React.useEffect(() => {\r\n window.addEventListener(\"resize\", handler);\r\n handler(); // detect on mount\r\n return () => window.removeEventListener(\"resize\", handler);\r\n }, [handler]);\r\n\r\n return (\r\n <BreakpointCtx.Provider value={current}>\r\n {children}\r\n </BreakpointCtx.Provider>\r\n );\r\n};\r\n"],"names":["React","_jsx"],"mappings":"uIAIO,MAAM,aAAa,GAAGA,cAAK,CAAC,aAAa,CAAiB,IAAI;AAErE;;AAEG;AACH,MAAM,MAAM,GAAG,MAAqB;AAChC,IAAA,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;AAC/B,QAAA,OAAO,IAAI;IACf;AAEA,IAAA,MAAM,KAAK,GAAG,MAAM,CAAC,UAAU;AAE/B,IAAA,IAAI,KAAK,GAAG,WAAW,CAAC,EAAE;AAAE,QAAA,OAAO,IAAI;AACvC,IAAA,IAAI,KAAK,GAAG,WAAW,CAAC,EAAE;AAAE,QAAA,OAAO,IAAI;AACvC,IAAA,IAAI,KAAK,GAAG,WAAW,CAAC,EAAE;AAAE,QAAA,OAAO,IAAI;AACvC,IAAA,IAAI,KAAK,GAAG,WAAW,CAAC,EAAE;AAAE,QAAA,OAAO,IAAI;AACvC,IAAA,OAAO,IAAI;AACf,CAAC;MAEY,kBAAkB,GAAG,CAAC,EAAE,QAAQ,EAA4B,KAAI;IACzE,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAiB,IAAI,CAAC;AAE5D,IAAA,MAAM,OAAO,GAAG,WAAW,CAAC,MAAK;AAC7B,QAAA,MAAM,MAAM,GAAG,MAAM,EAAE;AACvB,QAAA,UAAU,CAAC,IAAI,KAAK,IAAI,KAAK,MAAM,GAAG,IAAI,GAAG,MAAM,CAAC,CAAC;IACzD,CAAC,EAAE,EAAE,CAAC;AAEN,IAAAA,cAAK,CAAC,SAAS,CAAC,MAAK;AACjB,QAAA,MAAM,CAAC,gBAAgB,CAAC,QAAQ,EAAE,OAAO,CAAC;QAC1C,OAAO,EAAE,CAAC;QACV,OAAO,MAAM,MAAM,CAAC,mBAAmB,CAAC,QAAQ,EAAE,OAAO,CAAC;AAC9D,IAAA,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC;AAEb,IAAA,QACIC,GAAA,CAAC,aAAa,CAAC,QAAQ,EAAA,EAAC,KAAK,EAAE,OAAO,EAAA,QAAA,EACjC,QAAQ,EAAA,CACY;AAEjC"}
@@ -1,6 +1,6 @@
1
- 'use strict';Object.defineProperty(exports,'__esModule',{value:true});var React=require('react'),BreakpointProvider=require('./BreakpointProvider.js'),isWindow=require('../isWindow.js'),index=require('../css/index.js');const useBreakpoint = () => {
1
+ 'use strict';Object.defineProperty(exports,'__esModule',{value:true});var React=require('react'),BreakpointProvider=require('./BreakpointProvider.js'),index=require('../css/index.js');const useBreakpoint = () => {
2
2
  const value = React.useContext(BreakpointProvider.BreakpointCtx);
3
- const getWidth = () => isWindow.default() ? window.innerWidth : 99999;
3
+ const getWidth = () => typeof window !== 'undefined' ? window.innerWidth : 99999;
4
4
  const is = (key) => value === key;
5
5
  const isUp = (key) => getWidth() >= index.breakpoints[key];
6
6
  const isDown = (key) => getWidth() < index.breakpoints[key];
@@ -1 +1 @@
1
- {"version":3,"file":"useBreakpoint.js","sources":["../../src/breakpoint/useBreakpoint.ts"],"sourcesContent":["import { useContext } from \"react\"\r\nimport { BreakpointCtx } from \"./BreakpointProvider\"\r\nimport isWindow from \"../isWindow\"\r\nimport { breakpoints } from \"../css\"\r\nimport { BreakpointKeys } from \"../css/types\"\r\n\r\nconst useBreakpoint = () => {\r\n const value = useContext(BreakpointCtx)\r\n const getWidth = () => isWindow() ? window.innerWidth : 99999\r\n const is = (key: BreakpointKeys) => value === key\r\n const isUp = (key: BreakpointKeys) => getWidth() >= breakpoints[key]\r\n const isDown = (key: BreakpointKeys) => getWidth() < breakpoints[key]\r\n\r\n return {\r\n value,\r\n is,\r\n isUp,\r\n isDown,\r\n isOrUp: (key: BreakpointKeys) => is(key) || isUp(key),\r\n isOrDown: (key: BreakpointKeys) => is(key) || isDown(key)\r\n }\r\n}\r\n\r\nexport default useBreakpoint\r\n"],"names":["useContext","BreakpointCtx","isWindow","breakpoints"],"mappings":"2NAMA,MAAM,aAAa,GAAG,MAAK;AACxB,IAAA,MAAM,KAAK,GAAGA,gBAAU,CAACC,gCAAa,CAAC;AACvC,IAAA,MAAM,QAAQ,GAAG,MAAMC,gBAAQ,EAAE,GAAG,MAAM,CAAC,UAAU,GAAG,KAAK;IAC7D,MAAM,EAAE,GAAG,CAAC,GAAmB,KAAK,KAAK,KAAK,GAAG;AACjD,IAAA,MAAM,IAAI,GAAG,CAAC,GAAmB,KAAK,QAAQ,EAAE,IAAIC,iBAAW,CAAC,GAAG,CAAC;AACpE,IAAA,MAAM,MAAM,GAAG,CAAC,GAAmB,KAAK,QAAQ,EAAE,GAAGA,iBAAW,CAAC,GAAG,CAAC;IAErE,OAAO;QACJ,KAAK;QACL,EAAE;QACF,IAAI;QACJ,MAAM;AACN,QAAA,MAAM,EAAE,CAAC,GAAmB,KAAK,EAAE,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,GAAG,CAAC;AACrD,QAAA,QAAQ,EAAE,CAAC,GAAmB,KAAK,EAAE,CAAC,GAAG,CAAC,IAAI,MAAM,CAAC,GAAG;KAC1D;AACJ"}
1
+ {"version":3,"file":"useBreakpoint.js","sources":["../../src/breakpoint/useBreakpoint.ts"],"sourcesContent":["import { useContext } from \"react\"\r\nimport { BreakpointCtx } from \"./BreakpointProvider\"\r\nimport { breakpoints } from \"../css\"\r\nimport { BreakpointKeys } from \"../css/types\"\r\n\r\nconst useBreakpoint = () => {\r\n const value = useContext(BreakpointCtx)\r\n const getWidth = () => typeof window !== 'undefined' ? window.innerWidth : 99999\r\n const is = (key: BreakpointKeys) => value === key\r\n const isUp = (key: BreakpointKeys) => getWidth() >= breakpoints[key]\r\n const isDown = (key: BreakpointKeys) => getWidth() < breakpoints[key]\r\n\r\n return {\r\n value,\r\n is,\r\n isUp,\r\n isDown,\r\n isOrUp: (key: BreakpointKeys) => is(key) || isUp(key),\r\n isOrDown: (key: BreakpointKeys) => is(key) || isDown(key)\r\n }\r\n}\r\n\r\nexport default useBreakpoint\r\n"],"names":["useContext","BreakpointCtx","breakpoints"],"mappings":"wLAKA,MAAM,aAAa,GAAG,MAAK;AACxB,IAAA,MAAM,KAAK,GAAGA,gBAAU,CAACC,gCAAa,CAAC;AACvC,IAAA,MAAM,QAAQ,GAAG,MAAM,OAAO,MAAM,KAAK,WAAW,GAAG,MAAM,CAAC,UAAU,GAAG,KAAK;IAChF,MAAM,EAAE,GAAG,CAAC,GAAmB,KAAK,KAAK,KAAK,GAAG;AACjD,IAAA,MAAM,IAAI,GAAG,CAAC,GAAmB,KAAK,QAAQ,EAAE,IAAIC,iBAAW,CAAC,GAAG,CAAC;AACpE,IAAA,MAAM,MAAM,GAAG,CAAC,GAAmB,KAAK,QAAQ,EAAE,GAAGA,iBAAW,CAAC,GAAG,CAAC;IAErE,OAAO;QACJ,KAAK;QACL,EAAE;QACF,IAAI;QACJ,MAAM;AACN,QAAA,MAAM,EAAE,CAAC,GAAmB,KAAK,EAAE,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,GAAG,CAAC;AACrD,QAAA,QAAQ,EAAE,CAAC,GAAmB,KAAK,EAAE,CAAC,GAAG,CAAC,IAAI,MAAM,CAAC,GAAG;KAC1D;AACJ"}
@@ -1,6 +1,6 @@
1
- import {useContext}from'react';import {BreakpointCtx}from'./BreakpointProvider.mjs';import isWindow from'../isWindow.mjs';import {breakpoints}from'../css/index.mjs';const useBreakpoint = () => {
1
+ import {useContext}from'react';import {BreakpointCtx}from'./BreakpointProvider.mjs';import {breakpoints}from'../css/index.mjs';const useBreakpoint = () => {
2
2
  const value = useContext(BreakpointCtx);
3
- const getWidth = () => isWindow() ? window.innerWidth : 99999;
3
+ const getWidth = () => typeof window !== 'undefined' ? window.innerWidth : 99999;
4
4
  const is = (key) => value === key;
5
5
  const isUp = (key) => getWidth() >= breakpoints[key];
6
6
  const isDown = (key) => getWidth() < breakpoints[key];
@@ -1 +1 @@
1
- {"version":3,"file":"useBreakpoint.mjs","sources":["../../src/breakpoint/useBreakpoint.ts"],"sourcesContent":["import { useContext } from \"react\"\r\nimport { BreakpointCtx } from \"./BreakpointProvider\"\r\nimport isWindow from \"../isWindow\"\r\nimport { breakpoints } from \"../css\"\r\nimport { BreakpointKeys } from \"../css/types\"\r\n\r\nconst useBreakpoint = () => {\r\n const value = useContext(BreakpointCtx)\r\n const getWidth = () => isWindow() ? window.innerWidth : 99999\r\n const is = (key: BreakpointKeys) => value === key\r\n const isUp = (key: BreakpointKeys) => getWidth() >= breakpoints[key]\r\n const isDown = (key: BreakpointKeys) => getWidth() < breakpoints[key]\r\n\r\n return {\r\n value,\r\n is,\r\n isUp,\r\n isDown,\r\n isOrUp: (key: BreakpointKeys) => is(key) || isUp(key),\r\n isOrDown: (key: BreakpointKeys) => is(key) || isDown(key)\r\n }\r\n}\r\n\r\nexport default useBreakpoint\r\n"],"names":[],"mappings":"qKAMA,MAAM,aAAa,GAAG,MAAK;AACxB,IAAA,MAAM,KAAK,GAAG,UAAU,CAAC,aAAa,CAAC;AACvC,IAAA,MAAM,QAAQ,GAAG,MAAM,QAAQ,EAAE,GAAG,MAAM,CAAC,UAAU,GAAG,KAAK;IAC7D,MAAM,EAAE,GAAG,CAAC,GAAmB,KAAK,KAAK,KAAK,GAAG;AACjD,IAAA,MAAM,IAAI,GAAG,CAAC,GAAmB,KAAK,QAAQ,EAAE,IAAI,WAAW,CAAC,GAAG,CAAC;AACpE,IAAA,MAAM,MAAM,GAAG,CAAC,GAAmB,KAAK,QAAQ,EAAE,GAAG,WAAW,CAAC,GAAG,CAAC;IAErE,OAAO;QACJ,KAAK;QACL,EAAE;QACF,IAAI;QACJ,MAAM;AACN,QAAA,MAAM,EAAE,CAAC,GAAmB,KAAK,EAAE,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,GAAG,CAAC;AACrD,QAAA,QAAQ,EAAE,CAAC,GAAmB,KAAK,EAAE,CAAC,GAAG,CAAC,IAAI,MAAM,CAAC,GAAG;KAC1D;AACJ"}
1
+ {"version":3,"file":"useBreakpoint.mjs","sources":["../../src/breakpoint/useBreakpoint.ts"],"sourcesContent":["import { useContext } from \"react\"\r\nimport { BreakpointCtx } from \"./BreakpointProvider\"\r\nimport { breakpoints } from \"../css\"\r\nimport { BreakpointKeys } from \"../css/types\"\r\n\r\nconst useBreakpoint = () => {\r\n const value = useContext(BreakpointCtx)\r\n const getWidth = () => typeof window !== 'undefined' ? window.innerWidth : 99999\r\n const is = (key: BreakpointKeys) => value === key\r\n const isUp = (key: BreakpointKeys) => getWidth() >= breakpoints[key]\r\n const isDown = (key: BreakpointKeys) => getWidth() < breakpoints[key]\r\n\r\n return {\r\n value,\r\n is,\r\n isUp,\r\n isDown,\r\n isOrUp: (key: BreakpointKeys) => is(key) || isUp(key),\r\n isOrDown: (key: BreakpointKeys) => is(key) || isDown(key)\r\n }\r\n}\r\n\r\nexport default useBreakpoint\r\n"],"names":[],"mappings":"+HAKA,MAAM,aAAa,GAAG,MAAK;AACxB,IAAA,MAAM,KAAK,GAAG,UAAU,CAAC,aAAa,CAAC;AACvC,IAAA,MAAM,QAAQ,GAAG,MAAM,OAAO,MAAM,KAAK,WAAW,GAAG,MAAM,CAAC,UAAU,GAAG,KAAK;IAChF,MAAM,EAAE,GAAG,CAAC,GAAmB,KAAK,KAAK,KAAK,GAAG;AACjD,IAAA,MAAM,IAAI,GAAG,CAAC,GAAmB,KAAK,QAAQ,EAAE,IAAI,WAAW,CAAC,GAAG,CAAC;AACpE,IAAA,MAAM,MAAM,GAAG,CAAC,GAAmB,KAAK,QAAQ,EAAE,GAAG,WAAW,CAAC,GAAG,CAAC;IAErE,OAAO;QACJ,KAAK;QACL,EAAE;QACF,IAAI;QACJ,MAAM;AACN,QAAA,MAAM,EAAE,CAAC,GAAmB,KAAK,EAAE,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,GAAG,CAAC;AACrD,QAAA,QAAQ,EAAE,CAAC,GAAmB,KAAK,EAAE,CAAC,GAAG,CAAC,IAAI,MAAM,CAAC,GAAG;KAC1D;AACJ"}
package/css/getValue.js CHANGED
@@ -3,12 +3,14 @@
3
3
  [`${color}`]: `var(--color-${color}-primary)`,
4
4
  [`${color}.primary`]: `var(--color-${color}-primary)`,
5
5
  [`${color}.secondary`]: `var(--color-${color}-secondary)`,
6
- [`${color}.text`]: `var(--color-${color}-text)`,
7
- [`${color}.alpha`]: `var(--color-${color}-alpha)`
6
+ [`${color}.alpha`]: `var(--color-${color}-alpha)`,
7
+ [`${color}.divider`]: `var(--color-${color}-divider)`,
8
+ [`${color}.text.primary`]: `var(--color-${color}-text-primary)`,
9
+ [`${color}.text.secondary`]: `var(--color-${color}-text-secondary)`,
8
10
  };
9
11
  };
10
12
  const withImportant = (important, value) => important ? value + important : value;
11
- const colors = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ "text": `var(--color-text-primary)`, "text.primary": `var(--color-text-primary)`, "text.secondary": `var(--color-text-secondary)`, "background": `var(--color-background-primary)`, "background.primary": `var(--color-background-primary)`, "background.secondary": `var(--color-background-secondary)`, "background.alpha": `var(--color-background-alpha)`, "divider": `var(--color-divider)` }, getColor("surface")), getColor("brand")), getColor("accent")), getColor("info")), getColor("success")), getColor("warning")), getColor("danger"));
13
+ const colors = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, getColor("common")), getColor("surface")), getColor("brand")), getColor("accent")), getColor("info")), getColor("success")), getColor("warning")), getColor("danger"));
12
14
  const breakpoints = {
13
15
  "xs": "var(--bp-xs)",
14
16
  "sm": "var(--bp-sm)",
@@ -1 +1 @@
1
- {"version":3,"file":"getValue.js","sources":["../../src/css/getValue.ts"],"sourcesContent":["import { CSSProps } from \"./types\"\r\n\r\nconst getColor = (color: string) => {\r\n return {\r\n [`${color}`]: `var(--color-${color}-primary)`,\r\n [`${color}.primary`]: `var(--color-${color}-primary)`,\r\n [`${color}.secondary`]: `var(--color-${color}-secondary)`,\r\n [`${color}.text`]: `var(--color-${color}-text)`,\r\n [`${color}.alpha`]: `var(--color-${color}-alpha)`\r\n }\r\n}\r\n\r\nconst withImportant = (important: any, value: any) => important ? value + important : value\r\nconst colors: any = {\r\n \"text\": `var(--color-text-primary)`,\r\n \"text.primary\": `var(--color-text-primary)`,\r\n \"text.secondary\": `var(--color-text-secondary)`,\r\n\r\n \"background\": `var(--color-background-primary)`,\r\n \"background.primary\": `var(--color-background-primary)`,\r\n \"background.secondary\": `var(--color-background-secondary)`,\r\n \"background.alpha\": `var(--color-background-alpha)`,\r\n \"divider\": `var(--color-divider)`,\r\n\r\n ...getColor(\"surface\"),\r\n ...getColor(\"brand\"),\r\n ...getColor(\"accent\"),\r\n ...getColor(\"info\"),\r\n ...getColor(\"success\"),\r\n ...getColor(\"warning\"),\r\n ...getColor(\"danger\"),\r\n}\r\n\r\nconst breakpoints: any = {\r\n \"xs\": \"var(--bp-xs)\",\r\n \"sm\": \"var(--bp-sm)\",\r\n \"md\": \"var(--bp-md)\",\r\n \"lg\": \"var(--bp-lg)\",\r\n \"xl\": \"var(--bp-xl)\"\r\n}\r\n\r\nlet fontsizes: any = {\r\n \"h1\": \"var(--fontsize-h1)\",\r\n \"h2\": \"var(--fontsize-h2)\",\r\n \"h3\": \"var(--fontsize-h3)\",\r\n \"h4\": \"var(--fontsize-h4)\",\r\n \"h5\": \"var(--fontsize-h5)\",\r\n \"h6\": \"var(--fontsize-h6)\",\r\n \"big\": \"var(--fontsize-big)\",\r\n \"text\": \"var(--fontsize-text)\",\r\n \"button\": \"var(--fontsize-button)\",\r\n \"small\": \"var(--fontsize-small)\"\r\n}\r\n\r\nlet lineHeights: any = {\r\n \"h1\": \"var(--lineheight-h1)\",\r\n \"h2\": \"var(--lineheight-h2)\",\r\n \"h3\": \"var(--lineheight-h3)\",\r\n \"h4\": \"var(--lineheight-h4)\",\r\n \"h5\": \"var(--lineheight-h5)\",\r\n \"h6\": \"var(--lineheight-h6)\",\r\n \"big\": \"var(--lineheight-big)\",\r\n \"text\": \"var(--lineheight-text)\",\r\n \"button\": \"var(--lineheight-button)\",\r\n \"small\": \"var(--lineheight-small)\"\r\n}\r\n\r\nlet fontWeights: any = {\r\n \"h1\": \"var(--fontweight-h1)\",\r\n \"h2\": \"var(--fontweight-h2)\",\r\n \"h3\": \"var(--fontweight-h3)\",\r\n \"h4\": \"var(--fontweight-h4)\",\r\n \"h5\": \"var(--fontweight-h5)\",\r\n \"h6\": \"var(--fontweight-h6)\",\r\n \"big\": \"var(--fontweight-big)\",\r\n \"text\": \"var(--fontweight-text)\",\r\n \"button\": \"var(--fontweight-button)\",\r\n \"small\": \"var(--fontweight-small)\"\r\n}\r\n\r\nlet font: any = {\r\n \"h1\": \"var(--font-h1)\",\r\n \"h2\": \"var(--font-h2)\",\r\n \"h3\": \"var(--font-h3)\",\r\n \"h4\": \"var(--font-h4)\",\r\n \"h5\": \"var(--font-h5)\",\r\n \"h6\": \"var(--font-h6)\",\r\n \"big\": \"var(--font-big)\",\r\n \"text\": \"var(--font-text)\",\r\n \"button\": \"var(--font-button)\",\r\n \"small\": \"var(--font-small)\"\r\n}\r\n\r\nconst getValue = (prop: any, value: string | number, _css: CSSProps): any => {\r\n let important;\r\n\r\n if (typeof value === 'string') {\r\n const split = value.split(\"!\")\r\n important = split[1] ? \"!important\" : \"\"\r\n value = split[0]\r\n }\r\n\r\n\r\n if (['width', 'maxWidth', 'minWidth', 'max-width', 'min-width'].includes(prop)) {\r\n return withImportant(important, breakpoints[value] || value)\r\n } else if (prop === 'font' && typeof value === \"string\" && ['h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'text', 'button', 'small'].includes(value)) {\r\n return withImportant(important, font[value] || value)\r\n } else if (['fontWeight', 'font-weight'].includes(prop) && typeof value === 'string' && ['h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'text', 'button', 'small'].includes(value)) {\r\n return withImportant(important, fontWeights[value] || value)\r\n } else if (['lineHeight', 'line-height'].includes(prop) && typeof value === 'string' && ['h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'text', 'button', 'small'].includes(value)) {\r\n return withImportant(important, lineHeights[value] || value)\r\n } else if (['fontSize', 'font-size'].includes(prop) && typeof value === 'string') {\r\n return withImportant(important, fontsizes[value] || value)\r\n } else if (typeof value === \"number\" && [\"shadow\", \"boxShadow\"].includes(prop)) {\r\n return withImportant(important, `var(--shadow-${value})`)\r\n }\r\n\r\n return withImportant(important, colors[value] || value)\r\n}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AC,SAAS,EAAE,gBAAgB,KAAK,CAAA,CAAA,CAAG,CAAC;IAC7D;IAEA,OAAO,aAAa,CAAC,SAAS,EAAE,MAAM,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC;AAC3D"}
1
+ {"version":3,"file":"getValue.js","sources":["../../src/css/getValue.ts"],"sourcesContent":["import { CSSProps } from \"./types\"\r\n\r\nconst getColor = (color: string) => {\r\n return {\r\n [`${color}`]: `var(--color-${color}-primary)`,\r\n [`${color}.primary`]: `var(--color-${color}-primary)`,\r\n [`${color}.secondary`]: `var(--color-${color}-secondary)`,\r\n [`${color}.alpha`]: `var(--color-${color}-alpha)`,\r\n [`${color}.divider`]: `var(--color-${color}-divider)`,\r\n [`${color}.text.primary`]: `var(--color-${color}-text-primary)`,\r\n [`${color}.text.secondary`]: `var(--color-${color}-text-secondary)`,\r\n }\r\n}\r\n\r\nconst withImportant = (important: any, value: any) => important ? value + important : value\r\nconst colors: any = {\r\n ...getColor(\"common\"),\r\n ...getColor(\"surface\"),\r\n ...getColor(\"brand\"),\r\n ...getColor(\"accent\"),\r\n ...getColor(\"info\"),\r\n ...getColor(\"success\"),\r\n ...getColor(\"warning\"),\r\n ...getColor(\"danger\"),\r\n}\r\n\r\nconst breakpoints: any = {\r\n \"xs\": \"var(--bp-xs)\",\r\n \"sm\": \"var(--bp-sm)\",\r\n \"md\": \"var(--bp-md)\",\r\n \"lg\": \"var(--bp-lg)\",\r\n \"xl\": \"var(--bp-xl)\"\r\n}\r\n\r\nlet fontsizes: any = {\r\n \"h1\": \"var(--fontsize-h1)\",\r\n \"h2\": \"var(--fontsize-h2)\",\r\n \"h3\": \"var(--fontsize-h3)\",\r\n \"h4\": \"var(--fontsize-h4)\",\r\n \"h5\": \"var(--fontsize-h5)\",\r\n \"h6\": \"var(--fontsize-h6)\",\r\n \"big\": \"var(--fontsize-big)\",\r\n \"text\": \"var(--fontsize-text)\",\r\n \"button\": \"var(--fontsize-button)\",\r\n \"small\": \"var(--fontsize-small)\"\r\n}\r\n\r\nlet lineHeights: any = {\r\n \"h1\": \"var(--lineheight-h1)\",\r\n \"h2\": \"var(--lineheight-h2)\",\r\n \"h3\": \"var(--lineheight-h3)\",\r\n \"h4\": \"var(--lineheight-h4)\",\r\n \"h5\": \"var(--lineheight-h5)\",\r\n \"h6\": \"var(--lineheight-h6)\",\r\n \"big\": \"var(--lineheight-big)\",\r\n \"text\": \"var(--lineheight-text)\",\r\n \"button\": \"var(--lineheight-button)\",\r\n \"small\": \"var(--lineheight-small)\"\r\n}\r\n\r\nlet fontWeights: any = {\r\n \"h1\": \"var(--fontweight-h1)\",\r\n \"h2\": \"var(--fontweight-h2)\",\r\n \"h3\": \"var(--fontweight-h3)\",\r\n \"h4\": \"var(--fontweight-h4)\",\r\n \"h5\": \"var(--fontweight-h5)\",\r\n \"h6\": \"var(--fontweight-h6)\",\r\n \"big\": \"var(--fontweight-big)\",\r\n \"text\": \"var(--fontweight-text)\",\r\n \"button\": \"var(--fontweight-button)\",\r\n \"small\": \"var(--fontweight-small)\"\r\n}\r\n\r\nlet font: any = {\r\n \"h1\": \"var(--font-h1)\",\r\n \"h2\": \"var(--font-h2)\",\r\n \"h3\": \"var(--font-h3)\",\r\n \"h4\": \"var(--font-h4)\",\r\n \"h5\": \"var(--font-h5)\",\r\n \"h6\": \"var(--font-h6)\",\r\n \"big\": \"var(--font-big)\",\r\n \"text\": \"var(--font-text)\",\r\n \"button\": \"var(--font-button)\",\r\n \"small\": \"var(--font-small)\"\r\n}\r\n\r\nconst getValue = (prop: any, value: string | number, _css: CSSProps): any => {\r\n let important;\r\n\r\n if (typeof value === 'string') {\r\n const split = value.split(\"!\")\r\n important = split[1] ? \"!important\" : \"\"\r\n value = split[0]\r\n }\r\n\r\n\r\n if (['width', 'maxWidth', 'minWidth', 'max-width', 'min-width'].includes(prop)) {\r\n return withImportant(important, breakpoints[value] || value)\r\n } else if (prop === 'font' && typeof value === \"string\" && ['h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'text', 'button', 'small'].includes(value)) {\r\n return withImportant(important, font[value] || value)\r\n } else if (['fontWeight', 'font-weight'].includes(prop) && typeof value === 'string' && ['h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'text', 'button', 'small'].includes(value)) {\r\n return withImportant(important, fontWeights[value] || value)\r\n } else if (['lineHeight', 'line-height'].includes(prop) && typeof value === 'string' && ['h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'text', 'button', 'small'].includes(value)) {\r\n return withImportant(important, lineHeights[value] || value)\r\n } else if (['fontSize', 'font-size'].includes(prop) && typeof value === 'string') {\r\n return withImportant(important, fontsizes[value] || value)\r\n } else if (typeof value === \"number\" && [\"shadow\", \"boxShadow\"].includes(prop)) {\r\n return withImportant(important, `var(--shadow-${value})`)\r\n }\r\n\r\n return withImportant(important, colors[value] || value)\r\n}\r\n\r\nexport default getValue"],"names":[],"mappings":"sEAEA,MAAM,QAAQ,GAAG,CAAC,KAAa,KAAI;IAC/B,OAAO;AACH,QAAA,CAAC,GAAG,KAAK,CAAA,CAAE,GAAG,CAAA,YAAA,EAAe,KAAK,CAAA,SAAA,CAAW;AAC7C,QAAA,CAAC,GAAG,KAAK,CAAA,QAAA,CAAU,GAAG,CAAA,YAAA,EAAe,KAAK,CAAA,SAAA,CAAW;AACrD,QAAA,CAAC,GAAG,KAAK,CAAA,UAAA,CAAY,GAAG,CAAA,YAAA,EAAe,KAAK,CAAA,WAAA,CAAa;AACzD,QAAA,CAAC,GAAG,KAAK,CAAA,MAAA,CAAQ,GAAG,CAAA,YAAA,EAAe,KAAK,CAAA,OAAA,CAAS;AACjD,QAAA,CAAC,GAAG,KAAK,CAAA,QAAA,CAAU,GAAG,CAAA,YAAA,EAAe,KAAK,CAAA,SAAA,CAAW;AACrD,QAAA,CAAC,GAAG,KAAK,CAAA,aAAA,CAAe,GAAG,CAAA,YAAA,EAAe,KAAK,CAAA,cAAA,CAAgB;AAC/D,QAAA,CAAC,GAAG,KAAK,CAAA,eAAA,CAAiB,GAA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,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE;QACrK,OAAO,aAAa,CAAC,SAAS,EAAE,WAAW,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC;IAChE;AAAO,SAAA,IAAI,CAAC,UAAU,EAAE,WAAW,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;QAC9E,OAAO,aAAa,CAAC,SAAS,EAAE,SAAS,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC;IAC9D;AAAO,SAAA,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE;QAC5E,OAAO,aAAa,CAAC,SAAS,EAAE,gBAAgB,KAAK,CAAA,CAAA,CAAG,CAAC;IAC7D;IAEA,OAAO,aAAa,CAAC,SAAS,EAAE,MAAM,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC;AAC3D"}
package/css/getValue.mjs CHANGED
@@ -3,12 +3,14 @@ const getColor = (color) => {
3
3
  [`${color}`]: `var(--color-${color}-primary)`,
4
4
  [`${color}.primary`]: `var(--color-${color}-primary)`,
5
5
  [`${color}.secondary`]: `var(--color-${color}-secondary)`,
6
- [`${color}.text`]: `var(--color-${color}-text)`,
7
- [`${color}.alpha`]: `var(--color-${color}-alpha)`
6
+ [`${color}.alpha`]: `var(--color-${color}-alpha)`,
7
+ [`${color}.divider`]: `var(--color-${color}-divider)`,
8
+ [`${color}.text.primary`]: `var(--color-${color}-text-primary)`,
9
+ [`${color}.text.secondary`]: `var(--color-${color}-text-secondary)`,
8
10
  };
9
11
  };
10
12
  const withImportant = (important, value) => important ? value + important : value;
11
- const colors = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ "text": `var(--color-text-primary)`, "text.primary": `var(--color-text-primary)`, "text.secondary": `var(--color-text-secondary)`, "background": `var(--color-background-primary)`, "background.primary": `var(--color-background-primary)`, "background.secondary": `var(--color-background-secondary)`, "background.alpha": `var(--color-background-alpha)`, "divider": `var(--color-divider)` }, getColor("surface")), getColor("brand")), getColor("accent")), getColor("info")), getColor("success")), getColor("warning")), getColor("danger"));
13
+ const colors = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, getColor("common")), getColor("surface")), getColor("brand")), getColor("accent")), getColor("info")), getColor("success")), getColor("warning")), getColor("danger"));
12
14
  const breakpoints = {
13
15
  "xs": "var(--bp-xs)",
14
16
  "sm": "var(--bp-sm)",
@@ -1 +1 @@
1
- {"version":3,"file":"getValue.mjs","sources":["../../src/css/getValue.ts"],"sourcesContent":["import { CSSProps } from \"./types\"\r\n\r\nconst getColor = (color: string) => {\r\n return {\r\n [`${color}`]: `var(--color-${color}-primary)`,\r\n [`${color}.primary`]: `var(--color-${color}-primary)`,\r\n [`${color}.secondary`]: `var(--color-${color}-secondary)`,\r\n [`${color}.text`]: `var(--color-${color}-text)`,\r\n [`${color}.alpha`]: `var(--color-${color}-alpha)`\r\n }\r\n}\r\n\r\nconst withImportant = (important: any, value: any) => important ? value + important : value\r\nconst colors: any = {\r\n \"text\": `var(--color-text-primary)`,\r\n \"text.primary\": `var(--color-text-primary)`,\r\n \"text.secondary\": `var(--color-text-secondary)`,\r\n\r\n \"background\": `var(--color-background-primary)`,\r\n \"background.primary\": `var(--color-background-primary)`,\r\n \"background.secondary\": `var(--color-background-secondary)`,\r\n \"background.alpha\": `var(--color-background-alpha)`,\r\n \"divider\": `var(--color-divider)`,\r\n\r\n ...getColor(\"surface\"),\r\n ...getColor(\"brand\"),\r\n ...getColor(\"accent\"),\r\n ...getColor(\"info\"),\r\n ...getColor(\"success\"),\r\n ...getColor(\"warning\"),\r\n ...getColor(\"danger\"),\r\n}\r\n\r\nconst breakpoints: any = {\r\n \"xs\": \"var(--bp-xs)\",\r\n \"sm\": \"var(--bp-sm)\",\r\n \"md\": \"var(--bp-md)\",\r\n \"lg\": \"var(--bp-lg)\",\r\n \"xl\": \"var(--bp-xl)\"\r\n}\r\n\r\nlet fontsizes: any = {\r\n \"h1\": \"var(--fontsize-h1)\",\r\n \"h2\": \"var(--fontsize-h2)\",\r\n \"h3\": \"var(--fontsize-h3)\",\r\n \"h4\": \"var(--fontsize-h4)\",\r\n \"h5\": \"var(--fontsize-h5)\",\r\n \"h6\": \"var(--fontsize-h6)\",\r\n \"big\": \"var(--fontsize-big)\",\r\n \"text\": \"var(--fontsize-text)\",\r\n \"button\": \"var(--fontsize-button)\",\r\n \"small\": \"var(--fontsize-small)\"\r\n}\r\n\r\nlet lineHeights: any = {\r\n \"h1\": \"var(--lineheight-h1)\",\r\n \"h2\": \"var(--lineheight-h2)\",\r\n \"h3\": \"var(--lineheight-h3)\",\r\n \"h4\": \"var(--lineheight-h4)\",\r\n \"h5\": \"var(--lineheight-h5)\",\r\n \"h6\": \"var(--lineheight-h6)\",\r\n \"big\": \"var(--lineheight-big)\",\r\n \"text\": \"var(--lineheight-text)\",\r\n \"button\": \"var(--lineheight-button)\",\r\n \"small\": \"var(--lineheight-small)\"\r\n}\r\n\r\nlet fontWeights: any = {\r\n \"h1\": \"var(--fontweight-h1)\",\r\n \"h2\": \"var(--fontweight-h2)\",\r\n \"h3\": \"var(--fontweight-h3)\",\r\n \"h4\": \"var(--fontweight-h4)\",\r\n \"h5\": \"var(--fontweight-h5)\",\r\n \"h6\": \"var(--fontweight-h6)\",\r\n \"big\": \"var(--fontweight-big)\",\r\n \"text\": \"var(--fontweight-text)\",\r\n \"button\": \"var(--fontweight-button)\",\r\n \"small\": \"var(--fontweight-small)\"\r\n}\r\n\r\nlet font: any = {\r\n \"h1\": \"var(--font-h1)\",\r\n \"h2\": \"var(--font-h2)\",\r\n \"h3\": \"var(--font-h3)\",\r\n \"h4\": \"var(--font-h4)\",\r\n \"h5\": \"var(--font-h5)\",\r\n \"h6\": \"var(--font-h6)\",\r\n \"big\": \"var(--font-big)\",\r\n \"text\": \"var(--font-text)\",\r\n \"button\": \"var(--font-button)\",\r\n \"small\": \"var(--font-small)\"\r\n}\r\n\r\nconst getValue = (prop: any, value: string | number, _css: CSSProps): any => {\r\n let important;\r\n\r\n if (typeof value === 'string') {\r\n const split = value.split(\"!\")\r\n important = split[1] ? \"!important\" : \"\"\r\n value = split[0]\r\n }\r\n\r\n\r\n if (['width', 'maxWidth', 'minWidth', 'max-width', 'min-width'].includes(prop)) {\r\n return withImportant(important, breakpoints[value] || value)\r\n } else if (prop === 'font' && typeof value === \"string\" && ['h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'text', 'button', 'small'].includes(value)) {\r\n return withImportant(important, font[value] || value)\r\n } else if (['fontWeight', 'font-weight'].includes(prop) && typeof value === 'string' && ['h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'text', 'button', 'small'].includes(value)) {\r\n return withImportant(important, fontWeights[value] || value)\r\n } else if (['lineHeight', 'line-height'].includes(prop) && typeof value === 'string' && ['h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'text', 'button', 'small'].includes(value)) {\r\n return withImportant(important, lineHeights[value] || value)\r\n } else if (['fontSize', 'font-size'].includes(prop) && typeof value === 'string') {\r\n return withImportant(important, fontsizes[value] || value)\r\n } else if (typeof value === \"number\" && [\"shadow\", \"boxShadow\"].includes(prop)) {\r\n return withImportant(important, `var(--shadow-${value})`)\r\n }\r\n\r\n return withImportant(important, colors[value] || value)\r\n}\r\n\r\nexport default getValue"],"names":[],"mappings":"AAEA,MAAM,QAAQ,GAAG,CAAC,KAAa,KAAI;IAC/B,OAAO;AACH,QAAA,CAAC,GAAG,KAAK,CAAA,CAAE,GAAG,CAAA,YAAA,EAAe,KAAK,CAAA,SAAA,CAAW;AAC7C,QAAA,CAAC,GAAG,KAAK,CAAA,QAAA,CAAU,GAAG,CAAA,YAAA,EAAe,KAAK,CAAA,SAAA,CAAW;AACrD,QAAA,CAAC,GAAG,KAAK,CAAA,UAAA,CAAY,GAAG,CAAA,YAAA,EAAe,KAAK,CAAA,WA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,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE;QACrK,OAAO,aAAa,CAAC,SAAS,EAAE,WAAW,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC;IAChE;AAAO,SAAA,IAAI,CAAC,YAAY,EAAE,aAAa,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE;QACrK,OAAO,aAAa,CAAC,SAAS,EAAE,WAAW,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC;IAChE;AAAO,SAAA,IAAI,CAAC,UAAU,EAAE,WAAW,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;QAC9E,OAAO,aAAa,CAAC,SAAS,EAAE,SAAS,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC;IAC9D;AAAO,SAAA,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE;QAC5E,OAAO,aAAa,CAAC,SAAS,EAAE,gBAAgB,KAAK,CAAA,CAAA,CAAG,CAAC;IAC7D;IAEA,OAAO,aAAa,CAAC,SAAS,EAAE,MAAM,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC;AAC3D"}
1
+ {"version":3,"file":"getValue.mjs","sources":["../../src/css/getValue.ts"],"sourcesContent":["import { CSSProps } from \"./types\"\r\n\r\nconst getColor = (color: string) => {\r\n return {\r\n [`${color}`]: `var(--color-${color}-primary)`,\r\n [`${color}.primary`]: `var(--color-${color}-primary)`,\r\n [`${color}.secondary`]: `var(--color-${color}-secondary)`,\r\n [`${color}.alpha`]: `var(--color-${color}-alpha)`,\r\n [`${color}.divider`]: `var(--color-${color}-divider)`,\r\n [`${color}.text.primary`]: `var(--color-${color}-text-primary)`,\r\n [`${color}.text.secondary`]: `var(--color-${color}-text-secondary)`,\r\n }\r\n}\r\n\r\nconst withImportant = (important: any, value: any) => important ? value + important : value\r\nconst colors: any = {\r\n ...getColor(\"common\"),\r\n ...getColor(\"surface\"),\r\n ...getColor(\"brand\"),\r\n ...getColor(\"accent\"),\r\n ...getColor(\"info\"),\r\n ...getColor(\"success\"),\r\n ...getColor(\"warning\"),\r\n ...getColor(\"danger\"),\r\n}\r\n\r\nconst breakpoints: any = {\r\n \"xs\": \"var(--bp-xs)\",\r\n \"sm\": \"var(--bp-sm)\",\r\n \"md\": \"var(--bp-md)\",\r\n \"lg\": \"var(--bp-lg)\",\r\n \"xl\": \"var(--bp-xl)\"\r\n}\r\n\r\nlet fontsizes: any = {\r\n \"h1\": \"var(--fontsize-h1)\",\r\n \"h2\": \"var(--fontsize-h2)\",\r\n \"h3\": \"var(--fontsize-h3)\",\r\n \"h4\": \"var(--fontsize-h4)\",\r\n \"h5\": \"var(--fontsize-h5)\",\r\n \"h6\": \"var(--fontsize-h6)\",\r\n \"big\": \"var(--fontsize-big)\",\r\n \"text\": \"var(--fontsize-text)\",\r\n \"button\": \"var(--fontsize-button)\",\r\n \"small\": \"var(--fontsize-small)\"\r\n}\r\n\r\nlet lineHeights: any = {\r\n \"h1\": \"var(--lineheight-h1)\",\r\n \"h2\": \"var(--lineheight-h2)\",\r\n \"h3\": \"var(--lineheight-h3)\",\r\n \"h4\": \"var(--lineheight-h4)\",\r\n \"h5\": \"var(--lineheight-h5)\",\r\n \"h6\": \"var(--lineheight-h6)\",\r\n \"big\": \"var(--lineheight-big)\",\r\n \"text\": \"var(--lineheight-text)\",\r\n \"button\": \"var(--lineheight-button)\",\r\n \"small\": \"var(--lineheight-small)\"\r\n}\r\n\r\nlet fontWeights: any = {\r\n \"h1\": \"var(--fontweight-h1)\",\r\n \"h2\": \"var(--fontweight-h2)\",\r\n \"h3\": \"var(--fontweight-h3)\",\r\n \"h4\": \"var(--fontweight-h4)\",\r\n \"h5\": \"var(--fontweight-h5)\",\r\n \"h6\": \"var(--fontweight-h6)\",\r\n \"big\": \"var(--fontweight-big)\",\r\n \"text\": \"var(--fontweight-text)\",\r\n \"button\": \"var(--fontweight-button)\",\r\n \"small\": \"var(--fontweight-small)\"\r\n}\r\n\r\nlet font: any = {\r\n \"h1\": \"var(--font-h1)\",\r\n \"h2\": \"var(--font-h2)\",\r\n \"h3\": \"var(--font-h3)\",\r\n \"h4\": \"var(--font-h4)\",\r\n \"h5\": \"var(--font-h5)\",\r\n \"h6\": \"var(--font-h6)\",\r\n \"big\": \"var(--font-big)\",\r\n \"text\": \"var(--font-text)\",\r\n \"button\": \"var(--font-button)\",\r\n \"small\": \"var(--font-small)\"\r\n}\r\n\r\nconst getValue = (prop: any, value: string | number, _css: CSSProps): any => {\r\n let important;\r\n\r\n if (typeof value === 'string') {\r\n const split = value.split(\"!\")\r\n important = split[1] ? \"!important\" : \"\"\r\n value = split[0]\r\n }\r\n\r\n\r\n if (['width', 'maxWidth', 'minWidth', 'max-width', 'min-width'].includes(prop)) {\r\n return withImportant(important, breakpoints[value] || value)\r\n } else if (prop === 'font' && typeof value === \"string\" && ['h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'text', 'button', 'small'].includes(value)) {\r\n return withImportant(important, font[value] || value)\r\n } else if (['fontWeight', 'font-weight'].includes(prop) && typeof value === 'string' && ['h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'text', 'button', 'small'].includes(value)) {\r\n return withImportant(important, fontWeights[value] || value)\r\n } else if (['lineHeight', 'line-height'].includes(prop) && typeof value === 'string' && ['h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'text', 'button', 'small'].includes(value)) {\r\n return withImportant(important, lineHeights[value] || value)\r\n } else if (['fontSize', 'font-size'].includes(prop) && typeof value === 'string') {\r\n return withImportant(important, fontsizes[value] || value)\r\n } else if (typeof value === \"number\" && [\"shadow\", \"boxShadow\"].includes(prop)) {\r\n return withImportant(important, `var(--shadow-${value})`)\r\n }\r\n\r\n return withImportant(important, colors[value] || value)\r\n}\r\n\r\nexport default getValue"],"names":[],"mappings":"AAEA,MAAM,QAAQ,GAAG,CAAC,KAAa,KAAI;IAC/B,OAAO;AACH,QAAA,CAAC,GAAG,KAAK,CAAA,CAAE,GAAG,CAAA,YAAA,EAAe,KAAK,CAAA,SAAA,CAAW;AAC7C,QAAA,CAAC,GAAG,KAAK,CAAA,QAAA,CAAU,GAAG,CAAA,YAAA,EAAe,KAAK,CAAA,SAAA,CAAW;AACrD,QAAA,CAAC,GAAG,KAAK,CAAA,UAAA,CAAY,GAAG,CAAA,YAAA,EAAe,KAAK,CAAA,WAAA,CAAa;AACzD,QAAA,CAAC,GAAG,KAAK,CAAA,MAAA,CAAQ,GAAG,CAAA,YAAA,EAAe,KAAK,CAAA,OAAA,CAAS;AACjD,QAAA,CAAC,GAAG,KAAK,CAAA,QAAA,CAAU,GAAG,CAAA,YAAA,EAAe,KAAK,CAAA,SAAA,CAAW;AACrD,QAAA,CAAC,GAAG,KAAK,CAAA,aAAA,CAAe,GAAG,CAAA,YAAA,EAAe,KAAK,CAAA,cAAA,CAAgB;AAC/D,QAAA,CAAC,GAAG,KAAK,CAAA,eAAA,CAAiB,GAAG,CAAA,YAAA,EAAe,KAAK,CAAA,gBAAA,CAAkB;KACtE;AACL,CAAC;AAED,MAAM,aAAa,GAAG,CAAC,SAAc,EAAE,KAAU,KAAK,SAAS,GAAG,KAAK,GAAG,SAAS,GAAG,KAAK;AAC3F,MAAM,MAAM,GAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAA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QAAQ,IAAI,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE;QAC5E,OAAO,aAAa,CAAC,SAAS,EAAE,gBAAgB,KAAK,CAAA,CAAA,CAAG,CAAC;IAC7D;IAEA,OAAO,aAAa,CAAC,SAAS,EAAE,MAAM,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC;AAC3D"}
@@ -1,6 +1,37 @@
1
- type ColorTemplateColors = "default" | "brand" | "accent" | "info" | "success" | "warning" | "danger";
2
- type ColorTemplateType = "fill" | "outline" | "text" | "alpha";
3
- declare const useColorTemplate: (color: ColorTemplateColors, type: ColorTemplateType) => any;
1
+ import { ThemeColor } from '../theme/types.js';
2
+
3
+ type UseColorTemplateType = "fill" | "outline" | "text" | "alpha";
4
+ declare const useColorTemplate: (name: keyof ThemeColor, type: UseColorTemplateType) => {
5
+ bgcolor: string;
6
+ color: string;
7
+ border: number;
8
+ borderColor: string;
9
+ hover: {
10
+ color: string;
11
+ borderColor: string;
12
+ };
13
+ } | {
14
+ bgcolor: string;
15
+ color: string;
16
+ hover: {
17
+ bgcolor: string;
18
+ color: string;
19
+ };
20
+ } | {
21
+ bgcolor: string;
22
+ color: string;
23
+ hover: {
24
+ bgcolor: string;
25
+ color: string;
26
+ };
27
+ } | {
28
+ bgcolor: string;
29
+ color: string;
30
+ hover: {
31
+ bgcolor: string;
32
+ color: string;
33
+ };
34
+ };
4
35
 
5
36
  export { useColorTemplate as default };
6
- export type { ColorTemplateColors, ColorTemplateType };
37
+ export type { UseColorTemplateType };
@@ -1,6 +1,41 @@
1
- 'use strict';Object.defineProperty(exports,'__esModule',{value:true});require('../theme/ThemeDefaultOptions.js');var core=require('../theme/core.js');require('../css/getValue.js'),require('oncss'),require('../theme/ThemeProvider.js'),require('react-state-bucket');const useColorTemplate = (color, type) => {
2
- var _a;
1
+ 'use strict';Object.defineProperty(exports,'__esModule',{value:true});var core=require('../theme/core.js');require('../css/getValue.js'),require('oncss'),require('../theme/ThemeDefaultOptions.js'),require('../theme/ThemeProvider.js'),require('react-state-bucket');const useColorTemplate = (name, type) => {
3
2
  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];
3
+ let color = theme.colors[name];
4
+ let template = {
5
+ outline: {
6
+ bgcolor: "transparent",
7
+ color: color.text.primary,
8
+ border: 1,
9
+ borderColor: color.divider,
10
+ hover: {
11
+ color: color.text.primary,
12
+ borderColor: color.divider,
13
+ }
14
+ },
15
+ fill: {
16
+ bgcolor: color.primary,
17
+ color: color.text.primary,
18
+ hover: {
19
+ bgcolor: color.secondary,
20
+ color: color.text.primary,
21
+ }
22
+ },
23
+ text: {
24
+ bgcolor: "transparent",
25
+ color: color.primary,
26
+ hover: {
27
+ bgcolor: color.alpha,
28
+ color: color.primary,
29
+ }
30
+ },
31
+ alpha: {
32
+ bgcolor: color.alpha,
33
+ color: color.primary,
34
+ hover: {
35
+ bgcolor: color.alpha,
36
+ color: color.primary,
37
+ }
38
+ }
39
+ };
40
+ return template[type];
6
41
  };exports.default=useColorTemplate;//# sourceMappingURL=useColorTemplate.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useColorTemplate.js","sources":["../../src/hooks/useColorTemplate.ts"],"sourcesContent":["import { useTheme } from \"../theme\"\r\nexport type ColorTemplateColors = \"default\" | \"brand\" | \"accent\" | \"info\" | \"success\" | \"warning\" | \"danger\"\r\nexport type ColorTemplateType = \"fill\" | \"outline\" | \"text\" | \"alpha\"\r\n\r\nconst useColorTemplate = (color: ColorTemplateColors, type: ColorTemplateType) => {\r\n const theme: any = useTheme()\r\n let _color = color === 'default' ? \"background\" : color as any\r\n return theme.colors[_color]?.template[type]\r\n}\r\n\r\nexport default useColorTemplate"],"names":["useTheme"],"mappings":"wQAIA,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"}
1
+ {"version":3,"file":"useColorTemplate.js","sources":["../../src/hooks/useColorTemplate.ts"],"sourcesContent":["import { useTheme } from \"../theme\"\r\nimport { ThemeColor } from \"../theme/types\"\r\n\r\nexport type UseColorTemplateType = \"fill\" | \"outline\" | \"text\" | \"alpha\"\r\n\r\nconst useColorTemplate = (name: keyof ThemeColor, type: UseColorTemplateType) => {\r\n const theme = useTheme()\r\n let color = theme.colors[name]\r\n\r\n let template = {\r\n outline: {\r\n bgcolor: \"transparent\",\r\n color: color.text.primary,\r\n border: 1,\r\n borderColor: color.divider,\r\n hover: {\r\n color: color.text.primary,\r\n borderColor: color.divider,\r\n }\r\n },\r\n fill: {\r\n bgcolor: color.primary,\r\n color: color.text.primary,\r\n hover: {\r\n bgcolor: color.secondary,\r\n color: color.text.primary,\r\n }\r\n },\r\n text: {\r\n bgcolor: \"transparent\",\r\n color: color.primary,\r\n hover: {\r\n bgcolor: color.alpha,\r\n color: color.primary,\r\n }\r\n },\r\n alpha: {\r\n bgcolor: color.alpha,\r\n color: color.primary,\r\n hover: {\r\n bgcolor: color.alpha,\r\n color: color.primary,\r\n }\r\n }\r\n }\r\n return template[type]\r\n}\r\n\r\nexport default useColorTemplate"],"names":["useTheme"],"mappings":"wQAKA,MAAM,gBAAgB,GAAG,CAAC,IAAsB,EAAE,IAA0B,KAAI;AAC5E,IAAA,MAAM,KAAK,GAAGA,aAAQ,EAAE;IACxB,IAAI,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC;AAE9B,IAAA,IAAI,QAAQ,GAAG;AACX,QAAA,OAAO,EAAE;AACL,YAAA,OAAO,EAAE,aAAa;AACtB,YAAA,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC,OAAO;AACzB,YAAA,MAAM,EAAE,CAAC;YACT,WAAW,EAAE,KAAK,CAAC,OAAO;AAC1B,YAAA,KAAK,EAAE;AACH,gBAAA,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC,OAAO;gBACzB,WAAW,EAAE,KAAK,CAAC,OAAO;AAC7B;AACJ,SAAA;AACD,QAAA,IAAI,EAAE;YACF,OAAO,EAAE,KAAK,CAAC,OAAO;AACtB,YAAA,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC,OAAO;AACzB,YAAA,KAAK,EAAE;gBACH,OAAO,EAAE,KAAK,CAAC,SAAS;AACxB,gBAAA,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC,OAAO;AAC5B;AACJ,SAAA;AACD,QAAA,IAAI,EAAE;AACF,YAAA,OAAO,EAAE,aAAa;YACtB,KAAK,EAAE,KAAK,CAAC,OAAO;AACpB,YAAA,KAAK,EAAE;gBACH,OAAO,EAAE,KAAK,CAAC,KAAK;gBACpB,KAAK,EAAE,KAAK,CAAC,OAAO;AACvB;AACJ,SAAA;AACD,QAAA,KAAK,EAAE;YACH,OAAO,EAAE,KAAK,CAAC,KAAK;YACpB,KAAK,EAAE,KAAK,CAAC,OAAO;AACpB,YAAA,KAAK,EAAE;gBACH,OAAO,EAAE,KAAK,CAAC,KAAK;gBACpB,KAAK,EAAE,KAAK,CAAC,OAAO;AACvB;AACJ;KACJ;AACD,IAAA,OAAO,QAAQ,CAAC,IAAI,CAAC;AACzB"}
@@ -1,6 +1,41 @@
1
- import'../theme/ThemeDefaultOptions.mjs';import {useTheme}from'../theme/core.mjs';import'../css/getValue.mjs';import'oncss';import'../theme/ThemeProvider.mjs';import'react-state-bucket';const useColorTemplate = (color, type) => {
2
- var _a;
1
+ import {useTheme}from'../theme/core.mjs';import'../css/getValue.mjs';import'oncss';import'../theme/ThemeDefaultOptions.mjs';import'../theme/ThemeProvider.mjs';import'react-state-bucket';const useColorTemplate = (name, type) => {
3
2
  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];
3
+ let color = theme.colors[name];
4
+ let template = {
5
+ outline: {
6
+ bgcolor: "transparent",
7
+ color: color.text.primary,
8
+ border: 1,
9
+ borderColor: color.divider,
10
+ hover: {
11
+ color: color.text.primary,
12
+ borderColor: color.divider,
13
+ }
14
+ },
15
+ fill: {
16
+ bgcolor: color.primary,
17
+ color: color.text.primary,
18
+ hover: {
19
+ bgcolor: color.secondary,
20
+ color: color.text.primary,
21
+ }
22
+ },
23
+ text: {
24
+ bgcolor: "transparent",
25
+ color: color.primary,
26
+ hover: {
27
+ bgcolor: color.alpha,
28
+ color: color.primary,
29
+ }
30
+ },
31
+ alpha: {
32
+ bgcolor: color.alpha,
33
+ color: color.primary,
34
+ hover: {
35
+ bgcolor: color.alpha,
36
+ color: color.primary,
37
+ }
38
+ }
39
+ };
40
+ return template[type];
6
41
  };export{useColorTemplate as default};//# sourceMappingURL=useColorTemplate.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"useColorTemplate.mjs","sources":["../../src/hooks/useColorTemplate.ts"],"sourcesContent":["import { useTheme } from \"../theme\"\r\nexport type ColorTemplateColors = \"default\" | \"brand\" | \"accent\" | \"info\" | \"success\" | \"warning\" | \"danger\"\r\nexport type ColorTemplateType = \"fill\" | \"outline\" | \"text\" | \"alpha\"\r\n\r\nconst useColorTemplate = (color: ColorTemplateColors, type: ColorTemplateType) => {\r\n const theme: any = useTheme()\r\n let _color = color === 'default' ? \"background\" : color as any\r\n return theme.colors[_color]?.template[type]\r\n}\r\n\r\nexport default useColorTemplate"],"names":[],"mappings":"0LAIA,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"}
1
+ {"version":3,"file":"useColorTemplate.mjs","sources":["../../src/hooks/useColorTemplate.ts"],"sourcesContent":["import { useTheme } from \"../theme\"\r\nimport { ThemeColor } from \"../theme/types\"\r\n\r\nexport type UseColorTemplateType = \"fill\" | \"outline\" | \"text\" | \"alpha\"\r\n\r\nconst useColorTemplate = (name: keyof ThemeColor, type: UseColorTemplateType) => {\r\n const theme = useTheme()\r\n let color = theme.colors[name]\r\n\r\n let template = {\r\n outline: {\r\n bgcolor: \"transparent\",\r\n color: color.text.primary,\r\n border: 1,\r\n borderColor: color.divider,\r\n hover: {\r\n color: color.text.primary,\r\n borderColor: color.divider,\r\n }\r\n },\r\n fill: {\r\n bgcolor: color.primary,\r\n color: color.text.primary,\r\n hover: {\r\n bgcolor: color.secondary,\r\n color: color.text.primary,\r\n }\r\n },\r\n text: {\r\n bgcolor: \"transparent\",\r\n color: color.primary,\r\n hover: {\r\n bgcolor: color.alpha,\r\n color: color.primary,\r\n }\r\n },\r\n alpha: {\r\n bgcolor: color.alpha,\r\n color: color.primary,\r\n hover: {\r\n bgcolor: color.alpha,\r\n color: color.primary,\r\n }\r\n }\r\n }\r\n return template[type]\r\n}\r\n\r\nexport default useColorTemplate"],"names":[],"mappings":"0LAKA,MAAM,gBAAgB,GAAG,CAAC,IAAsB,EAAE,IAA0B,KAAI;AAC5E,IAAA,MAAM,KAAK,GAAG,QAAQ,EAAE;IACxB,IAAI,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC;AAE9B,IAAA,IAAI,QAAQ,GAAG;AACX,QAAA,OAAO,EAAE;AACL,YAAA,OAAO,EAAE,aAAa;AACtB,YAAA,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC,OAAO;AACzB,YAAA,MAAM,EAAE,CAAC;YACT,WAAW,EAAE,KAAK,CAAC,OAAO;AAC1B,YAAA,KAAK,EAAE;AACH,gBAAA,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC,OAAO;gBACzB,WAAW,EAAE,KAAK,CAAC,OAAO;AAC7B;AACJ,SAAA;AACD,QAAA,IAAI,EAAE;YACF,OAAO,EAAE,KAAK,CAAC,OAAO;AACtB,YAAA,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC,OAAO;AACzB,YAAA,KAAK,EAAE;gBACH,OAAO,EAAE,KAAK,CAAC,SAAS;AACxB,gBAAA,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC,OAAO;AAC5B;AACJ,SAAA;AACD,QAAA,IAAI,EAAE;AACF,YAAA,OAAO,EAAE,aAAa;YACtB,KAAK,EAAE,KAAK,CAAC,OAAO;AACpB,YAAA,KAAK,EAAE;gBACH,OAAO,EAAE,KAAK,CAAC,KAAK;gBACpB,KAAK,EAAE,KAAK,CAAC,OAAO;AACvB;AACJ,SAAA;AACD,QAAA,KAAK,EAAE;YACH,OAAO,EAAE,KAAK,CAAC,KAAK;YACpB,KAAK,EAAE,KAAK,CAAC,OAAO;AACpB,YAAA,KAAK,EAAE;gBACH,OAAO,EAAE,KAAK,CAAC,KAAK;gBACpB,KAAK,EAAE,KAAK,CAAC,OAAO;AACvB;AACJ;KACJ;AACD,IAAA,OAAO,QAAQ,CAAC,IAAI,CAAC;AACzB"}
@@ -1,5 +1,5 @@
1
1
  import { ThemeOptions } from '../theme/types.js';
2
2
 
3
- declare const useInterface: <P extends object>(name: string, userPorps: P, defaultProps: P) => (P | ThemeOptions)[];
3
+ declare const useInterface: <P extends object>(name: string, userPorps: P, defaultProps: P) => (ThemeOptions | P)[];
4
4
 
5
5
  export { useInterface as default };
@@ -1,4 +1,4 @@
1
- 'use strict';Object.defineProperty(exports,'__esModule',{value:true});require('../theme/ThemeDefaultOptions.js');var core=require('../theme/core.js');require('../css/getValue.js'),require('oncss'),require('../theme/ThemeProvider.js'),require('react-state-bucket');const useInterface = (name, userPorps, defaultProps) => {
1
+ 'use strict';Object.defineProperty(exports,'__esModule',{value:true});var core=require('../theme/core.js');require('../css/getValue.js'),require('oncss'),require('../theme/ThemeDefaultOptions.js'),require('../theme/ThemeProvider.js'),require('react-state-bucket');const useInterface = (name, userPorps, defaultProps) => {
2
2
  const theme = core.useTheme();
3
3
  const _interface = theme.interfaces[name];
4
4
  if (_interface) {
@@ -1,4 +1,4 @@
1
- import'../theme/ThemeDefaultOptions.mjs';import {useTheme}from'../theme/core.mjs';import'../css/getValue.mjs';import'oncss';import'../theme/ThemeProvider.mjs';import'react-state-bucket';const useInterface = (name, userPorps, defaultProps) => {
1
+ import {useTheme}from'../theme/core.mjs';import'../css/getValue.mjs';import'oncss';import'../theme/ThemeDefaultOptions.mjs';import'../theme/ThemeProvider.mjs';import'react-state-bucket';const useInterface = (name, userPorps, defaultProps) => {
2
2
  const theme = useTheme();
3
3
  const _interface = theme.interfaces[name];
4
4
  if (_interface) {
@@ -1,4 +1,4 @@
1
- 'use strict';Object.defineProperty(exports,'__esModule',{value:true});var jsxRuntime=require('react/jsx-runtime'),React=require('react'),client=require('react-dom/client');require('../theme/ThemeDefaultOptions.js');var core=require('../theme/core.js');require('../css/getValue.js'),require('oncss');var ThemeProvider=require('../theme/ThemeProvider.js');require('react-state-bucket');var index=require('../AppRoot/index.js');function usePortal(children, options) {
1
+ 'use strict';Object.defineProperty(exports,'__esModule',{value:true});var jsxRuntime=require('react/jsx-runtime'),React=require('react'),client=require('react-dom/client'),core=require('../theme/core.js');require('../css/getValue.js'),require('oncss'),require('../theme/ThemeDefaultOptions.js');var ThemeProvider=require('../theme/ThemeProvider.js');require('react-state-bucket');var index=require('../AppRoot/index.js');function usePortal(children, options) {
2
2
  options = options || {};
3
3
  if (options.autoMount === undefined) {
4
4
  options.autoMount = true;
@@ -1 +1 @@
1
- {"version":3,"file":"usePortal.js","sources":["../../src/hooks/usePortal.tsx"],"sourcesContent":["import React, { useEffect, useMemo } from \"react\";\r\nimport { createRoot } from \"react-dom/client\";\r\nimport { ThemeProvider, useTheme } from \"../theme\";\r\nimport { appRootElement } from \"../AppRoot\";\r\n\r\nexport type UsePortalOptions = {\r\n container?: HTMLElement;\r\n autoMount?: boolean;\r\n}\r\n\r\nexport function usePortal(children: React.ReactNode, options?: UsePortalOptions) {\r\n options = options || {};\r\n if (options.autoMount === undefined) {\r\n options.autoMount = true;\r\n }\r\n const [mounted, setMounted] = React.useState(options.autoMount);\r\n const theme = useTheme();\r\n const { el, root } = useMemo(() => {\r\n const el = document.createElement(\"div\");\r\n const root = createRoot(el);\r\n return { el, root };\r\n }, [options.autoMount]);\r\n\r\n const container = () => {\r\n const rootEle = appRootElement();\r\n const container = options?.container || rootEle\r\n if (!container) throw new Error(`Container not found for portal. Please ensure that AppRoot is present in the application tree.`);\r\n return container;\r\n }\r\n\r\n const mount = () => {\r\n const cont = container();\r\n if (!cont.contains(el)) {\r\n cont.appendChild(el);\r\n }\r\n root.render(<ThemeProvider theme={theme.name}>{children}</ThemeProvider>)\r\n }\r\n\r\n const unmount = () => {\r\n root.render(null)\r\n el.remove();\r\n }\r\n\r\n\r\n useEffect(() => {\r\n if (mounted) {\r\n mount()\r\n } else {\r\n unmount()\r\n }\r\n }, [mounted]);\r\n\r\n useEffect(() => {\r\n if (mounted) {\r\n mount()\r\n }\r\n }, [children]);\r\n\r\n useEffect(() => {\r\n return () => {\r\n unmount()\r\n };\r\n }, []);\r\n\r\n return {\r\n isMount: () => mounted,\r\n mount: () => setMounted(true),\r\n unmount: () => setMounted(false)\r\n }\r\n}\r\n\r\n\r\nexport default usePortal;"],"names":["useTheme","useMemo","createRoot","appRootElement","_jsx","ThemeProvider","useEffect"],"mappings":"yaAUM,SAAU,SAAS,CAAC,QAAyB,EAAE,OAA0B,EAAA;AAC5E,IAAA,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AiB,CAAC;AAC5E,IAAA,CAAC;IAED,MAAM,OAAO,GAAG,MAAK;AAClB,QAAA,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;QACjB,EAAE,CAAC,MAAM,EAAE;AACd,IAAA,CAAC;IAGDC,eAAS,CAAC,MAAK;QACZ,IAAI,OAAO,EAAE;AACV,YAAA,KAAK,EAAE;QACV;aAAO;AACJ,YAAA,OAAO,EAAE;QACZ;AACH,IAAA,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC;IAEbA,eAAS,CAAC,MAAK;QACZ,IAAI,OAAO,EAAE;AACV,YAAA,KAAK,EAAE;QACV;AACH,IAAA,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC;IAEdA,eAAS,CAAC,MAAK;AACZ,QAAA,OAAO,MAAK;AACT,YAAA,OAAO,EAAE;AACZ,QAAA,CAAC;IACJ,CAAC,EAAE,EAAE,CAAC;IAEN,OAAO;AACJ,QAAA,OAAO,EAAE,MAAM,OAAO;AACtB,QAAA,KAAK,EAAE,MAAM,UAAU,CAAC,IAAI,CAAC;AAC7B,QAAA,OAAO,EAAE,MAAM,UAAU,CAAC,KAAK;KACjC;AACJ"}
1
+ {"version":3,"file":"usePortal.js","sources":["../../src/hooks/usePortal.tsx"],"sourcesContent":["import React, { useEffect, useMemo } from \"react\";\r\nimport { createRoot } from \"react-dom/client\";\r\nimport { ThemeProvider, useTheme } from \"../theme\";\r\nimport { appRootElement } from \"../AppRoot\";\r\n\r\nexport type UsePortalOptions = {\r\n container?: HTMLElement;\r\n autoMount?: boolean;\r\n}\r\n\r\nexport function usePortal(children: React.ReactNode, options?: UsePortalOptions) {\r\n options = options || {};\r\n if (options.autoMount === undefined) {\r\n options.autoMount = true;\r\n }\r\n const [mounted, setMounted] = React.useState(options.autoMount);\r\n const theme = useTheme();\r\n const { el, root } = useMemo(() => {\r\n const el = document.createElement(\"div\");\r\n const root = createRoot(el);\r\n return { el, root };\r\n }, [options.autoMount]);\r\n\r\n const container = () => {\r\n const rootEle = appRootElement();\r\n const container = options?.container || rootEle\r\n if (!container) throw new Error(`Container not found for portal. Please ensure that AppRoot is present in the application tree.`);\r\n return container;\r\n }\r\n\r\n const mount = () => {\r\n const cont = container();\r\n if (!cont.contains(el)) {\r\n cont.appendChild(el);\r\n }\r\n root.render(<ThemeProvider theme={theme.name}>{children}</ThemeProvider>)\r\n }\r\n\r\n const unmount = () => {\r\n root.render(null)\r\n el.remove();\r\n }\r\n\r\n\r\n useEffect(() => {\r\n if (mounted) {\r\n mount()\r\n } else {\r\n unmount()\r\n }\r\n }, [mounted]);\r\n\r\n useEffect(() => {\r\n if (mounted) {\r\n mount()\r\n }\r\n }, [children]);\r\n\r\n useEffect(() => {\r\n return () => {\r\n unmount()\r\n };\r\n }, []);\r\n\r\n return {\r\n isMount: () => mounted,\r\n mount: () => setMounted(true),\r\n unmount: () => setMounted(false)\r\n }\r\n}\r\n\r\n\r\nexport default usePortal;"],"names":["useTheme","useMemo","createRoot","appRootElement","_jsx","ThemeProvider","useEffect"],"mappings":"qaAUM,SAAU,SAAS,CAAC,QAAyB,EAAE,OAA0B,EAAA;AAC5E,IAAA,OAAO,GAAG,OAAO,IAAI,EAAE;AACvB,IAAA,IAAI,OAAO,CAAC,SAAS,KAAK,SAAS,EAAE;AAClC,QAAA,OAAO,CAAC,SAAS,GAAG,IAAI;IAC3B;AACA,IAAA,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,SAAS,CAAC;AAC/D,IAAA,MAAM,KAAK,GAAGA,aAAQ,EAAE;IACxB,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,GAAGC,aAAO,CAAC,MAAK;QAC/B,MAAM,EAAE,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC;AACxC,QAAA,MAAM,IAAI,GAAGC,iBAAU,CAAC,EAAE,CAAC;AAC3B,QAAA,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE;AACtB,IAA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C;IACJ,CAAC,EAAE,EAAE,CAAC;IAEN,OAAO;AACJ,QAAA,OAAO,EAAE,MAAM,OAAO;AACtB,QAAA,KAAK,EAAE,MAAM,UAAU,CAAC,IAAI,CAAC;AAC7B,QAAA,OAAO,EAAE,MAAM,UAAU,CAAC,KAAK;KACjC;AACJ"}
@@ -1,4 +1,4 @@
1
- import {jsx}from'react/jsx-runtime';import React__default,{useMemo,useEffect}from'react';import {createRoot}from'react-dom/client';import'../theme/ThemeDefaultOptions.mjs';import {useTheme}from'../theme/core.mjs';import'../css/getValue.mjs';import'oncss';import ThemeProvider from'../theme/ThemeProvider.mjs';import'react-state-bucket';import {appRootElement}from'../AppRoot/index.mjs';function usePortal(children, options) {
1
+ import {jsx}from'react/jsx-runtime';import React__default,{useMemo,useEffect}from'react';import {createRoot}from'react-dom/client';import {useTheme}from'../theme/core.mjs';import'../css/getValue.mjs';import'oncss';import'../theme/ThemeDefaultOptions.mjs';import ThemeProvider from'../theme/ThemeProvider.mjs';import'react-state-bucket';import {appRootElement}from'../AppRoot/index.mjs';function usePortal(children, options) {
2
2
  options = options || {};
3
3
  if (options.autoMount === undefined) {
4
4
  options.autoMount = true;
@@ -1,12 +1,12 @@
1
- 'use strict';Object.defineProperty(exports,'__esModule',{value:true});require('../theme/ThemeDefaultOptions.js');var core=require('../theme/core.js'),index=require('../css/index.js');require('../theme/ThemeProvider.js'),require('react-state-bucket');const useScrollbar = ({ themeName, root_cls, thumbSize, thumbColor, trackColor }) => {
1
+ 'use strict';Object.defineProperty(exports,'__esModule',{value:true});var core=require('../theme/core.js'),index=require('../css/index.js');require('../theme/ThemeDefaultOptions.js'),require('../theme/ThemeProvider.js'),require('react-state-bucket');const useScrollbar = ({ themeName, root_cls, thumbSize, thumbColor, trackColor }) => {
2
2
  let theme = core.getTheme(themeName);
3
3
  if (!theme) {
4
4
  console.error(`useScrollbar: The theme '${themeName}' is not defined. Please make sure to use a valid theme name.`);
5
5
  theme = core.getTheme("light");
6
6
  }
7
7
  thumbSize = thumbSize || 10;
8
- thumbColor = thumbColor || theme.colors.text.secondary;
9
- trackColor = trackColor || theme.colors.divider;
8
+ thumbColor = thumbColor || theme.colors.surface.primary;
9
+ trackColor = trackColor || theme.colors.surface.primary;
10
10
  root_cls = root_cls || "";
11
11
  let clss = {
12
12
  "*": root_cls ? `${root_cls} *` : `*`,