@xanui/core 1.3.8 → 1.3.10

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/AppRoot/index.cjs +5 -4
  2. package/AppRoot/index.cjs.map +1 -1
  3. package/AppRoot/index.d.ts +2 -1
  4. package/AppRoot/index.js +5 -4
  5. package/AppRoot/index.js.map +1 -1
  6. package/Iframe/index.cjs +1 -0
  7. package/Iframe/index.cjs.map +1 -1
  8. package/Iframe/index.js +1 -0
  9. package/Iframe/index.js.map +1 -1
  10. package/Tag/types.d.ts +1 -1
  11. package/Tag/useTagProps.cjs +5 -1
  12. package/Tag/useTagProps.cjs.map +1 -1
  13. package/Tag/useTagProps.js +5 -1
  14. package/Tag/useTagProps.js.map +1 -1
  15. package/Transition/index.cjs +1 -1
  16. package/Transition/index.cjs.map +1 -1
  17. package/Transition/index.d.ts +7 -2
  18. package/Transition/index.js +1 -1
  19. package/Transition/index.js.map +1 -1
  20. package/css/getProps.cjs +5 -8
  21. package/css/getProps.cjs.map +1 -1
  22. package/css/getProps.js +5 -8
  23. package/css/getProps.js.map +1 -1
  24. package/css/getValue.cjs +12 -10
  25. package/css/getValue.cjs.map +1 -1
  26. package/css/getValue.js +12 -10
  27. package/css/getValue.js.map +1 -1
  28. package/css/index.cjs +0 -32
  29. package/css/index.cjs.map +1 -1
  30. package/css/index.d.ts +1 -4
  31. package/css/index.js +1 -30
  32. package/css/index.js.map +1 -1
  33. package/hooks/useColorTemplate.cjs +28 -31
  34. package/hooks/useColorTemplate.cjs.map +1 -1
  35. package/hooks/useColorTemplate.d.ts +8 -6
  36. package/hooks/useColorTemplate.js +28 -31
  37. package/hooks/useColorTemplate.js.map +1 -1
  38. package/hooks/useInterface.cjs +1 -0
  39. package/hooks/useInterface.cjs.map +1 -1
  40. package/hooks/useInterface.d.ts +1 -3
  41. package/hooks/useInterface.js +1 -0
  42. package/hooks/useInterface.js.map +1 -1
  43. package/index.cjs +0 -3
  44. package/index.cjs.map +1 -1
  45. package/index.d.ts +3 -3
  46. package/index.js +1 -1
  47. package/package.json +1 -1
  48. package/readme.md +2 -2
  49. package/theme/ThemeCssVars.cjs +36 -147
  50. package/theme/ThemeCssVars.cjs.map +1 -1
  51. package/theme/ThemeCssVars.js +36 -147
  52. package/theme/ThemeCssVars.js.map +1 -1
  53. package/theme/ThemeDefaultOptions.cjs +20 -86
  54. package/theme/ThemeDefaultOptions.cjs.map +1 -1
  55. package/theme/ThemeDefaultOptions.js +20 -86
  56. package/theme/ThemeDefaultOptions.js.map +1 -1
  57. package/theme/ThemeProvider.cjs +7 -8
  58. package/theme/ThemeProvider.cjs.map +1 -1
  59. package/theme/ThemeProvider.d.ts +6 -1
  60. package/theme/ThemeProvider.js +7 -8
  61. package/theme/ThemeProvider.js.map +1 -1
  62. package/theme/core.cjs +14 -9
  63. package/theme/core.cjs.map +1 -1
  64. package/theme/core.js +15 -10
  65. package/theme/core.js.map +1 -1
  66. package/theme/index.cjs +3 -0
  67. package/theme/index.cjs.map +1 -1
  68. package/theme/index.js +1 -0
  69. package/theme/index.js.map +1 -1
  70. package/theme/oklch.cjs +246 -0
  71. package/theme/oklch.cjs.map +1 -0
  72. package/theme/oklch.js +241 -0
  73. package/theme/oklch.js.map +1 -0
  74. package/theme/types.d.ts +26 -72
package/AppRoot/index.cjs CHANGED
@@ -6,6 +6,7 @@ var jsxRuntime = require('react/jsx-runtime');
6
6
  var React = require('react');
7
7
  var ThemeProvider = require('../theme/ThemeProvider.cjs');
8
8
  require('../theme/core.cjs');
9
+ require('../theme/ThemeDefaultOptions.cjs');
9
10
  var BreakpointProvider = require('../breakpoint/BreakpointProvider.cjs');
10
11
  require('../css/getValue.cjs');
11
12
  require('oncss');
@@ -19,7 +20,7 @@ var cookie = require('../cookie.cjs');
19
20
  const AppRoot = React.forwardRef((_a, ref) => {
20
21
  var { children, defaultBreakpoint, noScrollbarCss, CSSCacheId, theme, onThemeChange, disableRenderar, selectionColor, document: _document } = _a, props = tslib.__rest(_a, ["children", "defaultBreakpoint", "noScrollbarCss", "CSSCacheId", "theme", "onThemeChange", "disableRenderar", "selectionColor", "document"]);
21
22
  noScrollbarCss !== null && noScrollbarCss !== void 0 ? noScrollbarCss : (noScrollbarCss = false);
22
- selectionColor !== null && selectionColor !== void 0 ? selectionColor : (selectionColor = "brand");
23
+ selectionColor !== null && selectionColor !== void 0 ? selectionColor : (selectionColor = "primary");
23
24
  if (typeof window !== "undefined") {
24
25
  _document !== null && _document !== void 0 ? _document : (_document = document);
25
26
  }
@@ -45,11 +46,11 @@ const AppRoot = React.forwardRef((_a, ref) => {
45
46
  });
46
47
  }, []);
47
48
  let selection = {};
48
- if (selectionColor && selectionColor !== 'default') {
49
+ if (selectionColor && selectionColor !== 'surface') {
49
50
  selection = {
50
51
  "&::selection": {
51
- bgcolor: `${selectionColor}.primary`,
52
- color: `${selectionColor}.text`
52
+ bgcolor: `${selectionColor}.light`,
53
+ color: `${selectionColor}.contrast`
53
54
  }
54
55
  };
55
56
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sources":["../../src/AppRoot/index.tsx"],"sourcesContent":["\"use client\";\nimport React, { useEffect, useId, useLayoutEffect, useRef } from 'react';\nimport { TagComponentType } from '../Tag/types';\nimport { ThemeProvider, ThemeProviderProps } from '../theme';\nimport { BreakpointProvider } from '../breakpoint';\nimport { RenderRenderar } from './Renderar';\nimport { DocumentProvider } from '../Document';\nimport { AppRootProvider } from './AppRootProvider';\nimport useMergeRefs from '../hooks/useMergeRefs';\nimport { CSSCacheProvider } from '../css/CSSCacheProvider';\nimport { BreakpointKeys } from '../css/types';\nimport Cookie from '../cookie';\n\nexport type AppRootProps<T extends TagComponentType = \"div\"> = ThemeProviderProps<T> & {\n noScrollbarCss?: boolean;\n document?: Document;\n CSSCacheId?: string;\n disableRenderar?: boolean;\n defaultBreakpoint?: BreakpointKeys\n selectionColor?: \"default\" | \"brand\" | \"accent\" | \"success\" | \"info\" | \"warning\" | \"danger\";\n}\n\nconst AppRoot = React.forwardRef(<T extends TagComponentType = \"div\">({ children, defaultBreakpoint, noScrollbarCss, CSSCacheId, theme, onThemeChange, disableRenderar, selectionColor, document: _document, ...props }: AppRootProps<T>, ref: React.Ref<any>) => {\n\n noScrollbarCss ??= false\n selectionColor ??= \"brand\"\n if (typeof window !== \"undefined\") {\n _document ??= document\n }\n disableRenderar ??= false\n const docid = useId()\n const csscacheId = useId()\n CSSCacheId ??= csscacheId\n\n const [visibility, setVisibility] = React.useState<string>(!defaultBreakpoint ? \"hidden\" : \"\");\n const rootRef = useRef(null)\n const mergeRef = useMergeRefs(rootRef, ref)\n\n useLayoutEffect(() => {\n !defaultBreakpoint && setVisibility(\"\");\n }, [])\n\n useEffect(() => {\n if (typeof _document === 'undefined') return;\n if (!Cookie.exists(\"xuitm\") && theme.name) {\n Cookie.set(\"xuitm\", theme.name)\n }\n const styles = Array.from(_document.querySelectorAll('body style[data-oncss]'));\n styles.forEach((style) => {\n _document.head.appendChild(style);\n });\n }, [])\n\n let selection: any = {}\n if (selectionColor && selectionColor !== 'default') {\n selection = {\n \"&::selection\": {\n bgcolor: `${selectionColor}.primary`,\n color: `${selectionColor}.text`\n }\n }\n }\n\n return (\n <DocumentProvider value={_document ? { document: _document, id: docid } : undefined}>\n <CSSCacheProvider cacheId={CSSCacheId}>\n <AppRootProvider element={() => rootRef.current}>\n <ThemeProvider\n theme={theme}\n onThemeChange={(t) => {\n onThemeChange && onThemeChange(t)\n Cookie.set(\"xuitm\", t.name)\n }}\n {...props}\n ref={mergeRef}\n isRoot\n sx={{\n ...props.sx,\n ...(visibility === \"hidden\" ? { visibility: \"hidden\" } : {}),\n ...selection\n }}\n >\n <BreakpointProvider defaultKey={defaultBreakpoint ?? \"xl\"}>\n {children}\n {!disableRenderar && <RenderRenderar />}\n </BreakpointProvider>\n </ThemeProvider>\n </AppRootProvider>\n </CSSCacheProvider>\n </DocumentProvider>\n )\n})\n\nexport default AppRoot\n\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAsBA;;;;AAIG;;;;AAIA;AACA;;;AAIA;;;AAIG;;;;;AAKA;;;AAGA;AACA;AACG;AACH;;;AAIH;AACG;AACG;;;AAGC;;;;AAWW;;AAEH;AAmBlB;;"}
1
+ {"version":3,"file":"index.cjs","sources":["../../src/AppRoot/index.tsx"],"sourcesContent":["\"use client\";\nimport React, { useEffect, useId, useLayoutEffect, useRef } from 'react';\nimport { TagComponentType } from '../Tag/types';\nimport { ThemeProvider, ThemeProviderProps } from '../theme';\nimport { BreakpointProvider } from '../breakpoint';\nimport { RenderRenderar } from './Renderar';\nimport { DocumentProvider } from '../Document';\nimport { AppRootProvider } from './AppRootProvider';\nimport useMergeRefs from '../hooks/useMergeRefs';\nimport { CSSCacheProvider } from '../css/CSSCacheProvider';\nimport { BreakpointKeys } from '../css/types';\nimport Cookie from '../cookie';\nimport { ThemeColorKeys } from '../theme/types';\n\nexport type AppRootProps<T extends TagComponentType = \"div\"> = ThemeProviderProps<T> & {\n noScrollbarCss?: boolean;\n document?: Document;\n CSSCacheId?: string;\n disableRenderar?: boolean;\n defaultBreakpoint?: BreakpointKeys\n selectionColor?: ThemeColorKeys\n}\n\nconst AppRoot = React.forwardRef(<T extends TagComponentType = \"div\">({ children, defaultBreakpoint, noScrollbarCss, CSSCacheId, theme, onThemeChange, disableRenderar, selectionColor, document: _document, ...props }: AppRootProps<T>, ref: React.Ref<any>) => {\n\n noScrollbarCss ??= false\n selectionColor ??= \"primary\"\n if (typeof window !== \"undefined\") {\n _document ??= document\n }\n disableRenderar ??= false\n const docid = useId()\n const csscacheId = useId()\n CSSCacheId ??= csscacheId\n\n const [visibility, setVisibility] = React.useState<string>(!defaultBreakpoint ? \"hidden\" : \"\");\n const rootRef = useRef(null)\n const mergeRef = useMergeRefs(rootRef, ref)\n\n useLayoutEffect(() => {\n !defaultBreakpoint && setVisibility(\"\");\n }, [])\n\n useEffect(() => {\n if (typeof _document === 'undefined') return;\n if (!Cookie.exists(\"xuitm\") && theme.name) {\n Cookie.set(\"xuitm\", theme.name)\n }\n const styles = Array.from(_document.querySelectorAll('body style[data-oncss]'));\n styles.forEach((style) => {\n _document.head.appendChild(style);\n });\n }, [])\n\n let selection: any = {}\n if (selectionColor && selectionColor !== 'surface') {\n selection = {\n \"&::selection\": {\n bgcolor: `${selectionColor}.light`,\n color: `${selectionColor}.contrast`\n }\n }\n }\n\n return (\n <DocumentProvider value={_document ? { document: _document, id: docid } : undefined}>\n <CSSCacheProvider cacheId={CSSCacheId}>\n <AppRootProvider element={() => rootRef.current}>\n <ThemeProvider\n theme={theme}\n onThemeChange={(t) => {\n onThemeChange && onThemeChange(t)\n Cookie.set(\"xuitm\", t.name)\n }}\n {...props}\n ref={mergeRef}\n isRoot\n sx={{\n ...props.sx,\n ...(visibility === \"hidden\" ? { visibility: \"hidden\" } : {}),\n ...selection\n }}\n >\n <BreakpointProvider defaultKey={defaultBreakpoint ?? \"xl\"}>\n {children}\n {!disableRenderar && <RenderRenderar />}\n </BreakpointProvider>\n </ThemeProvider>\n </AppRootProvider>\n </CSSCacheProvider>\n </DocumentProvider>\n )\n})\n\nexport default AppRoot\n\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAuBA;;;;AAIG;;;;AAIA;AACA;;;AAIA;;;AAIG;;;;;AAKA;;;AAGA;AACA;AACG;AACH;;;AAIH;AACG;AACG;;;AAGC;;;;AAWW;;AAEH;AAmBlB;;"}
@@ -1,6 +1,7 @@
1
1
  import React__default from 'react';
2
2
  import { TagComponentType } from '../Tag/types.js';
3
3
  import { ThemeProviderProps } from '../theme/ThemeProvider.js';
4
+ import { ThemeColorKeys } from '../theme/types.js';
4
5
  import { BreakpointKeys } from '../css/types.js';
5
6
 
6
7
  type AppRootProps<T extends TagComponentType = "div"> = ThemeProviderProps<T> & {
@@ -9,7 +10,7 @@ type AppRootProps<T extends TagComponentType = "div"> = ThemeProviderProps<T> &
9
10
  CSSCacheId?: string;
10
11
  disableRenderar?: boolean;
11
12
  defaultBreakpoint?: BreakpointKeys;
12
- selectionColor?: "default" | "brand" | "accent" | "success" | "info" | "warning" | "danger";
13
+ selectionColor?: ThemeColorKeys;
13
14
  };
14
15
  declare const AppRoot: React__default.ForwardRefExoticComponent<Omit<AppRootProps<TagComponentType>, "ref"> & React__default.RefAttributes<any>>;
15
16
 
package/AppRoot/index.js CHANGED
@@ -4,6 +4,7 @@ import { jsx, jsxs } from 'react/jsx-runtime';
4
4
  import React__default, { useId, useRef, useLayoutEffect, useEffect } from 'react';
5
5
  import ThemeProvider from '../theme/ThemeProvider.js';
6
6
  import '../theme/core.js';
7
+ import '../theme/ThemeDefaultOptions.js';
7
8
  import { BreakpointProvider } from '../breakpoint/BreakpointProvider.js';
8
9
  import '../css/getValue.js';
9
10
  import 'oncss';
@@ -17,7 +18,7 @@ import Cookie from '../cookie.js';
17
18
  const AppRoot = React__default.forwardRef((_a, ref) => {
18
19
  var { children, defaultBreakpoint, noScrollbarCss, CSSCacheId, theme, onThemeChange, disableRenderar, selectionColor, document: _document } = _a, props = __rest(_a, ["children", "defaultBreakpoint", "noScrollbarCss", "CSSCacheId", "theme", "onThemeChange", "disableRenderar", "selectionColor", "document"]);
19
20
  noScrollbarCss !== null && noScrollbarCss !== void 0 ? noScrollbarCss : (noScrollbarCss = false);
20
- selectionColor !== null && selectionColor !== void 0 ? selectionColor : (selectionColor = "brand");
21
+ selectionColor !== null && selectionColor !== void 0 ? selectionColor : (selectionColor = "primary");
21
22
  if (typeof window !== "undefined") {
22
23
  _document !== null && _document !== void 0 ? _document : (_document = document);
23
24
  }
@@ -43,11 +44,11 @@ const AppRoot = React__default.forwardRef((_a, ref) => {
43
44
  });
44
45
  }, []);
45
46
  let selection = {};
46
- if (selectionColor && selectionColor !== 'default') {
47
+ if (selectionColor && selectionColor !== 'surface') {
47
48
  selection = {
48
49
  "&::selection": {
49
- bgcolor: `${selectionColor}.primary`,
50
- color: `${selectionColor}.text`
50
+ bgcolor: `${selectionColor}.light`,
51
+ color: `${selectionColor}.contrast`
51
52
  }
52
53
  };
53
54
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../src/AppRoot/index.tsx"],"sourcesContent":["\"use client\";\nimport React, { useEffect, useId, useLayoutEffect, useRef } from 'react';\nimport { TagComponentType } from '../Tag/types';\nimport { ThemeProvider, ThemeProviderProps } from '../theme';\nimport { BreakpointProvider } from '../breakpoint';\nimport { RenderRenderar } from './Renderar';\nimport { DocumentProvider } from '../Document';\nimport { AppRootProvider } from './AppRootProvider';\nimport useMergeRefs from '../hooks/useMergeRefs';\nimport { CSSCacheProvider } from '../css/CSSCacheProvider';\nimport { BreakpointKeys } from '../css/types';\nimport Cookie from '../cookie';\n\nexport type AppRootProps<T extends TagComponentType = \"div\"> = ThemeProviderProps<T> & {\n noScrollbarCss?: boolean;\n document?: Document;\n CSSCacheId?: string;\n disableRenderar?: boolean;\n defaultBreakpoint?: BreakpointKeys\n selectionColor?: \"default\" | \"brand\" | \"accent\" | \"success\" | \"info\" | \"warning\" | \"danger\";\n}\n\nconst AppRoot = React.forwardRef(<T extends TagComponentType = \"div\">({ children, defaultBreakpoint, noScrollbarCss, CSSCacheId, theme, onThemeChange, disableRenderar, selectionColor, document: _document, ...props }: AppRootProps<T>, ref: React.Ref<any>) => {\n\n noScrollbarCss ??= false\n selectionColor ??= \"brand\"\n if (typeof window !== \"undefined\") {\n _document ??= document\n }\n disableRenderar ??= false\n const docid = useId()\n const csscacheId = useId()\n CSSCacheId ??= csscacheId\n\n const [visibility, setVisibility] = React.useState<string>(!defaultBreakpoint ? \"hidden\" : \"\");\n const rootRef = useRef(null)\n const mergeRef = useMergeRefs(rootRef, ref)\n\n useLayoutEffect(() => {\n !defaultBreakpoint && setVisibility(\"\");\n }, [])\n\n useEffect(() => {\n if (typeof _document === 'undefined') return;\n if (!Cookie.exists(\"xuitm\") && theme.name) {\n Cookie.set(\"xuitm\", theme.name)\n }\n const styles = Array.from(_document.querySelectorAll('body style[data-oncss]'));\n styles.forEach((style) => {\n _document.head.appendChild(style);\n });\n }, [])\n\n let selection: any = {}\n if (selectionColor && selectionColor !== 'default') {\n selection = {\n \"&::selection\": {\n bgcolor: `${selectionColor}.primary`,\n color: `${selectionColor}.text`\n }\n }\n }\n\n return (\n <DocumentProvider value={_document ? { document: _document, id: docid } : undefined}>\n <CSSCacheProvider cacheId={CSSCacheId}>\n <AppRootProvider element={() => rootRef.current}>\n <ThemeProvider\n theme={theme}\n onThemeChange={(t) => {\n onThemeChange && onThemeChange(t)\n Cookie.set(\"xuitm\", t.name)\n }}\n {...props}\n ref={mergeRef}\n isRoot\n sx={{\n ...props.sx,\n ...(visibility === \"hidden\" ? { visibility: \"hidden\" } : {}),\n ...selection\n }}\n >\n <BreakpointProvider defaultKey={defaultBreakpoint ?? \"xl\"}>\n {children}\n {!disableRenderar && <RenderRenderar />}\n </BreakpointProvider>\n </ThemeProvider>\n </AppRootProvider>\n </CSSCacheProvider>\n </DocumentProvider>\n )\n})\n\nexport default AppRoot\n\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAsBA;;;;AAIG;;;;AAIA;AACA;;;AAIA;;;AAIG;;;;;AAKA;;;AAGA;AACA;AACG;AACH;;;AAIH;AACG;AACG;;;AAGC;;;;AAWW;;AAEH;AAmBlB;;"}
1
+ {"version":3,"file":"index.js","sources":["../../src/AppRoot/index.tsx"],"sourcesContent":["\"use client\";\nimport React, { useEffect, useId, useLayoutEffect, useRef } from 'react';\nimport { TagComponentType } from '../Tag/types';\nimport { ThemeProvider, ThemeProviderProps } from '../theme';\nimport { BreakpointProvider } from '../breakpoint';\nimport { RenderRenderar } from './Renderar';\nimport { DocumentProvider } from '../Document';\nimport { AppRootProvider } from './AppRootProvider';\nimport useMergeRefs from '../hooks/useMergeRefs';\nimport { CSSCacheProvider } from '../css/CSSCacheProvider';\nimport { BreakpointKeys } from '../css/types';\nimport Cookie from '../cookie';\nimport { ThemeColorKeys } from '../theme/types';\n\nexport type AppRootProps<T extends TagComponentType = \"div\"> = ThemeProviderProps<T> & {\n noScrollbarCss?: boolean;\n document?: Document;\n CSSCacheId?: string;\n disableRenderar?: boolean;\n defaultBreakpoint?: BreakpointKeys\n selectionColor?: ThemeColorKeys\n}\n\nconst AppRoot = React.forwardRef(<T extends TagComponentType = \"div\">({ children, defaultBreakpoint, noScrollbarCss, CSSCacheId, theme, onThemeChange, disableRenderar, selectionColor, document: _document, ...props }: AppRootProps<T>, ref: React.Ref<any>) => {\n\n noScrollbarCss ??= false\n selectionColor ??= \"primary\"\n if (typeof window !== \"undefined\") {\n _document ??= document\n }\n disableRenderar ??= false\n const docid = useId()\n const csscacheId = useId()\n CSSCacheId ??= csscacheId\n\n const [visibility, setVisibility] = React.useState<string>(!defaultBreakpoint ? \"hidden\" : \"\");\n const rootRef = useRef(null)\n const mergeRef = useMergeRefs(rootRef, ref)\n\n useLayoutEffect(() => {\n !defaultBreakpoint && setVisibility(\"\");\n }, [])\n\n useEffect(() => {\n if (typeof _document === 'undefined') return;\n if (!Cookie.exists(\"xuitm\") && theme.name) {\n Cookie.set(\"xuitm\", theme.name)\n }\n const styles = Array.from(_document.querySelectorAll('body style[data-oncss]'));\n styles.forEach((style) => {\n _document.head.appendChild(style);\n });\n }, [])\n\n let selection: any = {}\n if (selectionColor && selectionColor !== 'surface') {\n selection = {\n \"&::selection\": {\n bgcolor: `${selectionColor}.light`,\n color: `${selectionColor}.contrast`\n }\n }\n }\n\n return (\n <DocumentProvider value={_document ? { document: _document, id: docid } : undefined}>\n <CSSCacheProvider cacheId={CSSCacheId}>\n <AppRootProvider element={() => rootRef.current}>\n <ThemeProvider\n theme={theme}\n onThemeChange={(t) => {\n onThemeChange && onThemeChange(t)\n Cookie.set(\"xuitm\", t.name)\n }}\n {...props}\n ref={mergeRef}\n isRoot\n sx={{\n ...props.sx,\n ...(visibility === \"hidden\" ? { visibility: \"hidden\" } : {}),\n ...selection\n }}\n >\n <BreakpointProvider defaultKey={defaultBreakpoint ?? \"xl\"}>\n {children}\n {!disableRenderar && <RenderRenderar />}\n </BreakpointProvider>\n </ThemeProvider>\n </AppRootProvider>\n </CSSCacheProvider>\n </DocumentProvider>\n )\n})\n\nexport default AppRoot\n\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAuBA;;;;AAIG;;;;AAIA;AACA;;;AAIA;;;AAIG;;;;;AAKA;;;AAGA;AACA;AACG;AACH;;;AAIH;AACG;AACG;;;AAGC;;;;AAWW;;AAEH;AAmBlB;;"}
package/Iframe/index.cjs CHANGED
@@ -10,6 +10,7 @@ require('../css/getValue.cjs');
10
10
  require('oncss');
11
11
  require('../Document/index.cjs');
12
12
  require('../css/CSSCacheProvider.cjs');
13
+ require('../theme/ThemeDefaultOptions.cjs');
13
14
  var reactDom = require('react-dom');
14
15
  var index$2 = require('../AppRoot/index.cjs');
15
16
  var useMergeRefs = require('../hooks/useMergeRefs.cjs');
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sources":["../../src/Iframe/index.tsx"],"sourcesContent":["'use client'\nimport React, { createContext, useEffect, useRef, useState } from \"react\";\nimport { useTheme } from \"../theme\";\nimport Tag from \"../Tag\";\nimport { createPortal } from \"react-dom\";\nimport AppRoot from \"../AppRoot\";\nimport { TagPropsRoot } from \"../Tag/types\";\nimport useMergeRefs from \"../hooks/useMergeRefs\";\nimport { ThemeOptions } from \"../theme/types\";\n\nconst IframeContext = createContext<{ document: Document | null; window: Window | null; }>({\n document: null,\n window: null,\n});\n\n\nexport type IframeProps = Omit<TagPropsRoot<\"iframe\">, \"component\"> & {\n theme?: ThemeOptions;\n CSSCacheId?: string;\n}\n\nconst Iframe = ({ children, sxr, theme, CSSCacheId, ...props }: IframeProps, ref: React.Ref<HTMLIFrameElement>) => {\n const [doc, setDoc] = useState<Document | null>(null);\n const iframeRef = useRef<HTMLIFrameElement>(null);\n const _ref = useMergeRefs(iframeRef, ref)\n const parentTheme = useTheme()\n\n\n useEffect(() => {\n if (!iframeRef.current) return;\n const iframe = iframeRef.current;\n const onLoad = () => setDoc(iframe.contentDocument);\n iframe.addEventListener(\"load\", onLoad);\n return () => iframe.removeEventListener(\"load\", onLoad);\n }, []);\n\n return (\n <>\n <Tag\n {...props}\n component={\"iframe\"}\n sxr={{\n border: 'none',\n width: \"100%\",\n height: \"100%\",\n p: 0,\n m: 0,\n ...sxr\n }}\n ref={_ref}\n srcDoc={\"<!DOCTYPE html><html><head></head><body></body></html>\"}\n />\n {doc &&\n createPortal(\n <IframeContext.Provider\n value={{\n document: doc,\n window: doc.defaultView,\n }}\n >\n <AppRoot disableRenderar theme={parentTheme} document={doc as Document} CSSCacheId={CSSCacheId}>\n {children}\n </AppRoot>\n </IframeContext.Provider>,\n doc.body\n )}\n </>\n );\n}\n\nexport default React.forwardRef(Iframe)"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAUA;AACG;AACA;AACF;AAQD;AAAgB;;AAEb;;AAEA;;;;AAKG;;AAEA;;;;AAqBM;AAGS;;;AAYrB;AAEA;;"}
1
+ {"version":3,"file":"index.cjs","sources":["../../src/Iframe/index.tsx"],"sourcesContent":["'use client'\nimport React, { createContext, useEffect, useRef, useState } from \"react\";\nimport { useTheme } from \"../theme\";\nimport Tag from \"../Tag\";\nimport { createPortal } from \"react-dom\";\nimport AppRoot from \"../AppRoot\";\nimport { TagPropsRoot } from \"../Tag/types\";\nimport useMergeRefs from \"../hooks/useMergeRefs\";\nimport { ThemeOptions } from \"../theme/types\";\n\nconst IframeContext = createContext<{ document: Document | null; window: Window | null; }>({\n document: null,\n window: null,\n});\n\n\nexport type IframeProps = Omit<TagPropsRoot<\"iframe\">, \"component\"> & {\n theme?: ThemeOptions;\n CSSCacheId?: string;\n}\n\nconst Iframe = ({ children, sxr, theme, CSSCacheId, ...props }: IframeProps, ref: React.Ref<HTMLIFrameElement>) => {\n const [doc, setDoc] = useState<Document | null>(null);\n const iframeRef = useRef<HTMLIFrameElement>(null);\n const _ref = useMergeRefs(iframeRef, ref)\n const parentTheme = useTheme()\n\n\n useEffect(() => {\n if (!iframeRef.current) return;\n const iframe = iframeRef.current;\n const onLoad = () => setDoc(iframe.contentDocument);\n iframe.addEventListener(\"load\", onLoad);\n return () => iframe.removeEventListener(\"load\", onLoad);\n }, []);\n\n return (\n <>\n <Tag\n {...props}\n component={\"iframe\"}\n sxr={{\n border: 'none',\n width: \"100%\",\n height: \"100%\",\n p: 0,\n m: 0,\n ...sxr\n }}\n ref={_ref}\n srcDoc={\"<!DOCTYPE html><html><head></head><body></body></html>\"}\n />\n {doc &&\n createPortal(\n <IframeContext.Provider\n value={{\n document: doc,\n window: doc.defaultView,\n }}\n >\n <AppRoot disableRenderar theme={parentTheme} document={doc as Document} CSSCacheId={CSSCacheId}>\n {children}\n </AppRoot>\n </IframeContext.Provider>,\n doc.body\n )}\n </>\n );\n}\n\nexport default React.forwardRef(Iframe)"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAUA;AACG;AACA;AACF;AAQD;AAAgB;;AAEb;;AAEA;;;;AAKG;;AAEA;;;;AAqBM;AAGS;;;AAYrB;AAEA;;"}
package/Iframe/index.js CHANGED
@@ -8,6 +8,7 @@ import '../css/getValue.js';
8
8
  import 'oncss';
9
9
  import '../Document/index.js';
10
10
  import '../css/CSSCacheProvider.js';
11
+ import '../theme/ThemeDefaultOptions.js';
11
12
  import { createPortal } from 'react-dom';
12
13
  import AppRoot from '../AppRoot/index.js';
13
14
  import useMergeRefs from '../hooks/useMergeRefs.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../src/Iframe/index.tsx"],"sourcesContent":["'use client'\nimport React, { createContext, useEffect, useRef, useState } from \"react\";\nimport { useTheme } from \"../theme\";\nimport Tag from \"../Tag\";\nimport { createPortal } from \"react-dom\";\nimport AppRoot from \"../AppRoot\";\nimport { TagPropsRoot } from \"../Tag/types\";\nimport useMergeRefs from \"../hooks/useMergeRefs\";\nimport { ThemeOptions } from \"../theme/types\";\n\nconst IframeContext = createContext<{ document: Document | null; window: Window | null; }>({\n document: null,\n window: null,\n});\n\n\nexport type IframeProps = Omit<TagPropsRoot<\"iframe\">, \"component\"> & {\n theme?: ThemeOptions;\n CSSCacheId?: string;\n}\n\nconst Iframe = ({ children, sxr, theme, CSSCacheId, ...props }: IframeProps, ref: React.Ref<HTMLIFrameElement>) => {\n const [doc, setDoc] = useState<Document | null>(null);\n const iframeRef = useRef<HTMLIFrameElement>(null);\n const _ref = useMergeRefs(iframeRef, ref)\n const parentTheme = useTheme()\n\n\n useEffect(() => {\n if (!iframeRef.current) return;\n const iframe = iframeRef.current;\n const onLoad = () => setDoc(iframe.contentDocument);\n iframe.addEventListener(\"load\", onLoad);\n return () => iframe.removeEventListener(\"load\", onLoad);\n }, []);\n\n return (\n <>\n <Tag\n {...props}\n component={\"iframe\"}\n sxr={{\n border: 'none',\n width: \"100%\",\n height: \"100%\",\n p: 0,\n m: 0,\n ...sxr\n }}\n ref={_ref}\n srcDoc={\"<!DOCTYPE html><html><head></head><body></body></html>\"}\n />\n {doc &&\n createPortal(\n <IframeContext.Provider\n value={{\n document: doc,\n window: doc.defaultView,\n }}\n >\n <AppRoot disableRenderar theme={parentTheme} document={doc as Document} CSSCacheId={CSSCacheId}>\n {children}\n </AppRoot>\n </IframeContext.Provider>,\n doc.body\n )}\n </>\n );\n}\n\nexport default React.forwardRef(Iframe)"],"names":[],"mappings":";;;;;;;;;;;;;;AAUA;AACG;AACA;AACF;AAQD;AAAgB;;AAEb;;AAEA;;;;AAKG;;AAEA;;;;AAqBM;AAGS;;;AAYrB;AAEA;;"}
1
+ {"version":3,"file":"index.js","sources":["../../src/Iframe/index.tsx"],"sourcesContent":["'use client'\nimport React, { createContext, useEffect, useRef, useState } from \"react\";\nimport { useTheme } from \"../theme\";\nimport Tag from \"../Tag\";\nimport { createPortal } from \"react-dom\";\nimport AppRoot from \"../AppRoot\";\nimport { TagPropsRoot } from \"../Tag/types\";\nimport useMergeRefs from \"../hooks/useMergeRefs\";\nimport { ThemeOptions } from \"../theme/types\";\n\nconst IframeContext = createContext<{ document: Document | null; window: Window | null; }>({\n document: null,\n window: null,\n});\n\n\nexport type IframeProps = Omit<TagPropsRoot<\"iframe\">, \"component\"> & {\n theme?: ThemeOptions;\n CSSCacheId?: string;\n}\n\nconst Iframe = ({ children, sxr, theme, CSSCacheId, ...props }: IframeProps, ref: React.Ref<HTMLIFrameElement>) => {\n const [doc, setDoc] = useState<Document | null>(null);\n const iframeRef = useRef<HTMLIFrameElement>(null);\n const _ref = useMergeRefs(iframeRef, ref)\n const parentTheme = useTheme()\n\n\n useEffect(() => {\n if (!iframeRef.current) return;\n const iframe = iframeRef.current;\n const onLoad = () => setDoc(iframe.contentDocument);\n iframe.addEventListener(\"load\", onLoad);\n return () => iframe.removeEventListener(\"load\", onLoad);\n }, []);\n\n return (\n <>\n <Tag\n {...props}\n component={\"iframe\"}\n sxr={{\n border: 'none',\n width: \"100%\",\n height: \"100%\",\n p: 0,\n m: 0,\n ...sxr\n }}\n ref={_ref}\n srcDoc={\"<!DOCTYPE html><html><head></head><body></body></html>\"}\n />\n {doc &&\n createPortal(\n <IframeContext.Provider\n value={{\n document: doc,\n window: doc.defaultView,\n }}\n >\n <AppRoot disableRenderar theme={parentTheme} document={doc as Document} CSSCacheId={CSSCacheId}>\n {children}\n </AppRoot>\n </IframeContext.Provider>,\n doc.body\n )}\n </>\n );\n}\n\nexport default React.forwardRef(Iframe)"],"names":[],"mappings":";;;;;;;;;;;;;;;AAUA;AACG;AACA;AACF;AAQD;AAAgB;;AAEb;;AAEA;;;;AAKG;;AAEA;;;;AAqBM;AAGS;;;AAYrB;AAEA;;"}
package/Tag/types.d.ts CHANGED
@@ -78,7 +78,7 @@ interface TagCSSProperties {
78
78
  fontSize: CSSValueType<"fontSize"> | TypographyRefTypes;
79
79
  fontStyle: CSSValueType<"fontStyle">;
80
80
  fontWeight: CSSValueType<"fontWeight"> | TypographyRefTypes;
81
- font: CSSValueType<"font"> | TypographyRefTypes;
81
+ font: CSSValueType<"font">;
82
82
  gap: CSSValueType<"gap">;
83
83
  grid: CSSValueType<"grid">;
84
84
  gridArea: CSSValueType<"gridArea">;
@@ -9,6 +9,10 @@ var prettyClass = require('pretty-class');
9
9
  var index = require('../Document/index.cjs');
10
10
  var CSSCacheProvider = require('../css/CSSCacheProvider.cjs');
11
11
  var ThemeCssVars = require('../theme/ThemeCssVars.cjs');
12
+ require('react/jsx-runtime');
13
+ require('./index.cjs');
14
+ var core = require('../theme/core.cjs');
15
+ require('../theme/ThemeDefaultOptions.cjs');
12
16
 
13
17
  const useTagProps = (props) => {
14
18
  const doc = index.useDocument();
@@ -48,7 +52,7 @@ const useTagProps = (props) => {
48
52
  if (theme) {
49
53
  themeStyle = index$1.css({
50
54
  "@global": {
51
- [`.${cls.classname}`]: ThemeCssVars(theme)
55
+ [`.${cls.classname}`]: ThemeCssVars(core.createTheme(theme))
52
56
  }
53
57
  }, {
54
58
  injectStyle: typeof window !== "undefined",
@@ -1 +1 @@
1
- {"version":3,"file":"useTagProps.cjs","sources":["../../src/Tag/useTagProps.ts"],"sourcesContent":["\"use client\"\nimport { useMemo } from \"react\";\nimport { TagComponentType, TagProps, TagPropsRoot } from \"./types\";\nimport cssPropList from \"./cssPropList\";\nimport { css } from \"../css\";\nimport { classNames } from \"pretty-class\";\nimport { CSSFactoryType } from \"oncss\";\nimport { useDocument } from \"../Document\";\nimport { useCSSCacheId } from \"../css/CSSCacheProvider\";\nimport ThemeCssVars from \"../theme/ThemeCssVars\";\nimport { createTheme } from \"../theme\";\n\nexport type useTagPropsReturn<T extends TagComponentType = \"div\"> = {\n props: TagProps<T>;\n style: CSSFactoryType;\n themeStyle?: CSSFactoryType;\n};\n\nconst useTagProps = <T extends TagComponentType = \"div\">(props: TagPropsRoot<T>): useTagPropsReturn<T> => {\n const doc = useDocument();\n const cacheId = useCSSCacheId();\n\n // Extract known styling-related props\n const {\n sx,\n sxr,\n style,\n hover,\n className,\n classNames: clsNames,\n baseClass,\n theme,\n ...rest\n } = props;\n\n /**\n * Split DOM props vs CSS props\n */\n const { domProps, cssProps } = useMemo(() => {\n const _dom: any = {};\n const _css: any = {};\n\n for (const key in rest) {\n const val = (rest as any)[key];\n if (cssPropList[key]) {\n _css[key] = val;\n } else {\n _dom[key] = val;\n }\n }\n\n return { domProps: _dom, cssProps: _css };\n }, [rest]);\n\n /**\n * Generate styles\n */\n const { styles, themeStyle } = useMemo(() => {\n const hoverStyles =\n hover && Object.keys(hover).length > 0\n ? { \"&:hover\": hover }\n : undefined;\n\n const cls = css(\n {\n ...sxr,\n ...cssProps,\n ...sx,\n ...style,\n ...hoverStyles,\n },\n {\n injectStyle: typeof window !== \"undefined\",\n container: doc?.document,\n cacheId,\n }\n );\n\n let themeStyle\n if (theme) {\n themeStyle = css({\n \"@global\": {\n [`.${cls.classname}`]: ThemeCssVars(theme as any)\n }\n },\n {\n injectStyle: typeof window !== \"undefined\",\n container: doc?.document,\n cacheId,\n }\n );\n }\n\n return { styles: cls, themeStyle }\n }, [sx, sxr, style, hover, cssProps, doc, cacheId, theme]);\n\n\n /**\n * Compose className\n */\n const finalClassName = useMemo(() => {\n return classNames(\n baseClass ? \"xui-\" + baseClass : undefined,\n clsNames,\n className,\n styles.classname\n );\n }, [baseClass, clsNames, className, styles.classname]);\n\n /**\n * Final props\n */\n const finalProps = useMemo(() => {\n return {\n ...domProps,\n className: finalClassName,\n };\n }, [domProps, finalClassName]);\n\n return {\n props: finalProps,\n style: styles,\n themeStyle\n };\n};\n\nexport default useTagProps;"],"names":[],"mappings":";;;;;;;;;;;;AAkBA;AACG;AACA;;;AAeA;;AAEG;;;;AAKA;AACG;AACA;AACG;;;AAEA;;;;AAKT;AAEA;;AAEG;;AAEA;AAEM;;AAGN;AASM;AACA;;AAEF;AAGJ;;;AAGM;;AAEC;;AAGE;AACA;;AAEF;;AAIP;AACH;AAGA;;AAEG;AACH;;AAOA;AAEA;;AAEG;AACH;AACG;AAIH;;AAGG;AACA;;;AAGN;;"}
1
+ {"version":3,"file":"useTagProps.cjs","sources":["../../src/Tag/useTagProps.ts"],"sourcesContent":["\"use client\"\nimport { useMemo } from \"react\";\nimport { TagComponentType, TagProps, TagPropsRoot } from \"./types\";\nimport cssPropList from \"./cssPropList\";\nimport { css } from \"../css\";\nimport { classNames } from \"pretty-class\";\nimport { CSSFactoryType } from \"oncss\";\nimport { useDocument } from \"../Document\";\nimport { useCSSCacheId } from \"../css/CSSCacheProvider\";\nimport ThemeCssVars from \"../theme/ThemeCssVars\";\nimport { createTheme } from \"../theme\";\n\nexport type useTagPropsReturn<T extends TagComponentType = \"div\"> = {\n props: TagProps<T>;\n style: CSSFactoryType;\n themeStyle?: CSSFactoryType;\n};\n\nconst useTagProps = <T extends TagComponentType = \"div\">(props: TagPropsRoot<T>): useTagPropsReturn<T> => {\n const doc = useDocument();\n const cacheId = useCSSCacheId();\n\n // Extract known styling-related props\n const {\n sx,\n sxr,\n style,\n hover,\n className,\n classNames: clsNames,\n baseClass,\n theme,\n ...rest\n } = props;\n\n /**\n * Split DOM props vs CSS props\n */\n const { domProps, cssProps } = useMemo(() => {\n const _dom: any = {};\n const _css: any = {};\n\n for (const key in rest) {\n const val = (rest as any)[key];\n if (cssPropList[key]) {\n _css[key] = val;\n } else {\n _dom[key] = val;\n }\n }\n\n return { domProps: _dom, cssProps: _css };\n }, [rest]);\n\n /**\n * Generate styles\n */\n const { styles, themeStyle } = useMemo(() => {\n const hoverStyles =\n hover && Object.keys(hover).length > 0\n ? { \"&:hover\": hover }\n : undefined;\n\n const cls = css(\n {\n ...sxr,\n ...cssProps,\n ...sx,\n ...style,\n ...hoverStyles,\n },\n {\n injectStyle: typeof window !== \"undefined\",\n container: doc?.document,\n cacheId,\n }\n );\n\n let themeStyle\n if (theme) {\n themeStyle = css({\n \"@global\": {\n [`.${cls.classname}`]: ThemeCssVars(createTheme(theme) as any)\n }\n },\n {\n injectStyle: typeof window !== \"undefined\",\n container: doc?.document,\n cacheId,\n }\n );\n }\n\n return { styles: cls, themeStyle }\n }, [sx, sxr, style, hover, cssProps, doc, cacheId, theme]);\n\n\n /**\n * Compose className\n */\n const finalClassName = useMemo(() => {\n return classNames(\n baseClass ? \"xui-\" + baseClass : undefined,\n clsNames,\n className,\n styles.classname\n );\n }, [baseClass, clsNames, className, styles.classname]);\n\n /**\n * Final props\n */\n const finalProps = useMemo(() => {\n return {\n ...domProps,\n className: finalClassName,\n };\n }, [domProps, finalClassName]);\n\n return {\n props: finalProps,\n style: styles,\n themeStyle\n };\n};\n\nexport default useTagProps;"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAkBA;AACG;AACA;;;AAeA;;AAEG;;;;AAKA;AACG;AACA;AACG;;;AAEA;;;;AAKT;AAEA;;AAEG;;AAEA;AAEM;;AAGN;AASM;AACA;;AAEF;AAGJ;;;AAGM;AACG;AACF;;AAGE;AACA;;AAEF;;AAIP;AACH;AAGA;;AAEG;AACH;;AAOA;AAEA;;AAEG;AACH;AACG;AAIH;;AAGG;AACA;;;AAGN;;"}
@@ -7,6 +7,10 @@ import { classNames } from 'pretty-class';
7
7
  import { useDocument } from '../Document/index.js';
8
8
  import { useCSSCacheId } from '../css/CSSCacheProvider.js';
9
9
  import ThemeCssVars from '../theme/ThemeCssVars.js';
10
+ import 'react/jsx-runtime';
11
+ import './index.js';
12
+ import { createTheme } from '../theme/core.js';
13
+ import '../theme/ThemeDefaultOptions.js';
10
14
 
11
15
  const useTagProps = (props) => {
12
16
  const doc = useDocument();
@@ -46,7 +50,7 @@ const useTagProps = (props) => {
46
50
  if (theme) {
47
51
  themeStyle = css({
48
52
  "@global": {
49
- [`.${cls.classname}`]: ThemeCssVars(theme)
53
+ [`.${cls.classname}`]: ThemeCssVars(createTheme(theme))
50
54
  }
51
55
  }, {
52
56
  injectStyle: typeof window !== "undefined",
@@ -1 +1 @@
1
- {"version":3,"file":"useTagProps.js","sources":["../../src/Tag/useTagProps.ts"],"sourcesContent":["\"use client\"\nimport { useMemo } from \"react\";\nimport { TagComponentType, TagProps, TagPropsRoot } from \"./types\";\nimport cssPropList from \"./cssPropList\";\nimport { css } from \"../css\";\nimport { classNames } from \"pretty-class\";\nimport { CSSFactoryType } from \"oncss\";\nimport { useDocument } from \"../Document\";\nimport { useCSSCacheId } from \"../css/CSSCacheProvider\";\nimport ThemeCssVars from \"../theme/ThemeCssVars\";\nimport { createTheme } from \"../theme\";\n\nexport type useTagPropsReturn<T extends TagComponentType = \"div\"> = {\n props: TagProps<T>;\n style: CSSFactoryType;\n themeStyle?: CSSFactoryType;\n};\n\nconst useTagProps = <T extends TagComponentType = \"div\">(props: TagPropsRoot<T>): useTagPropsReturn<T> => {\n const doc = useDocument();\n const cacheId = useCSSCacheId();\n\n // Extract known styling-related props\n const {\n sx,\n sxr,\n style,\n hover,\n className,\n classNames: clsNames,\n baseClass,\n theme,\n ...rest\n } = props;\n\n /**\n * Split DOM props vs CSS props\n */\n const { domProps, cssProps } = useMemo(() => {\n const _dom: any = {};\n const _css: any = {};\n\n for (const key in rest) {\n const val = (rest as any)[key];\n if (cssPropList[key]) {\n _css[key] = val;\n } else {\n _dom[key] = val;\n }\n }\n\n return { domProps: _dom, cssProps: _css };\n }, [rest]);\n\n /**\n * Generate styles\n */\n const { styles, themeStyle } = useMemo(() => {\n const hoverStyles =\n hover && Object.keys(hover).length > 0\n ? { \"&:hover\": hover }\n : undefined;\n\n const cls = css(\n {\n ...sxr,\n ...cssProps,\n ...sx,\n ...style,\n ...hoverStyles,\n },\n {\n injectStyle: typeof window !== \"undefined\",\n container: doc?.document,\n cacheId,\n }\n );\n\n let themeStyle\n if (theme) {\n themeStyle = css({\n \"@global\": {\n [`.${cls.classname}`]: ThemeCssVars(theme as any)\n }\n },\n {\n injectStyle: typeof window !== \"undefined\",\n container: doc?.document,\n cacheId,\n }\n );\n }\n\n return { styles: cls, themeStyle }\n }, [sx, sxr, style, hover, cssProps, doc, cacheId, theme]);\n\n\n /**\n * Compose className\n */\n const finalClassName = useMemo(() => {\n return classNames(\n baseClass ? \"xui-\" + baseClass : undefined,\n clsNames,\n className,\n styles.classname\n );\n }, [baseClass, clsNames, className, styles.classname]);\n\n /**\n * Final props\n */\n const finalProps = useMemo(() => {\n return {\n ...domProps,\n className: finalClassName,\n };\n }, [domProps, finalClassName]);\n\n return {\n props: finalProps,\n style: styles,\n themeStyle\n };\n};\n\nexport default useTagProps;"],"names":[],"mappings":";;;;;;;;;;AAkBA;AACG;AACA;;;AAeA;;AAEG;;;;AAKA;AACG;AACA;AACG;;;AAEA;;;;AAKT;AAEA;;AAEG;;AAEA;AAEM;;AAGN;AASM;AACA;;AAEF;AAGJ;;;AAGM;;AAEC;;AAGE;AACA;;AAEF;;AAIP;AACH;AAGA;;AAEG;AACH;;AAOA;AAEA;;AAEG;AACH;AACG;AAIH;;AAGG;AACA;;;AAGN;;"}
1
+ {"version":3,"file":"useTagProps.js","sources":["../../src/Tag/useTagProps.ts"],"sourcesContent":["\"use client\"\nimport { useMemo } from \"react\";\nimport { TagComponentType, TagProps, TagPropsRoot } from \"./types\";\nimport cssPropList from \"./cssPropList\";\nimport { css } from \"../css\";\nimport { classNames } from \"pretty-class\";\nimport { CSSFactoryType } from \"oncss\";\nimport { useDocument } from \"../Document\";\nimport { useCSSCacheId } from \"../css/CSSCacheProvider\";\nimport ThemeCssVars from \"../theme/ThemeCssVars\";\nimport { createTheme } from \"../theme\";\n\nexport type useTagPropsReturn<T extends TagComponentType = \"div\"> = {\n props: TagProps<T>;\n style: CSSFactoryType;\n themeStyle?: CSSFactoryType;\n};\n\nconst useTagProps = <T extends TagComponentType = \"div\">(props: TagPropsRoot<T>): useTagPropsReturn<T> => {\n const doc = useDocument();\n const cacheId = useCSSCacheId();\n\n // Extract known styling-related props\n const {\n sx,\n sxr,\n style,\n hover,\n className,\n classNames: clsNames,\n baseClass,\n theme,\n ...rest\n } = props;\n\n /**\n * Split DOM props vs CSS props\n */\n const { domProps, cssProps } = useMemo(() => {\n const _dom: any = {};\n const _css: any = {};\n\n for (const key in rest) {\n const val = (rest as any)[key];\n if (cssPropList[key]) {\n _css[key] = val;\n } else {\n _dom[key] = val;\n }\n }\n\n return { domProps: _dom, cssProps: _css };\n }, [rest]);\n\n /**\n * Generate styles\n */\n const { styles, themeStyle } = useMemo(() => {\n const hoverStyles =\n hover && Object.keys(hover).length > 0\n ? { \"&:hover\": hover }\n : undefined;\n\n const cls = css(\n {\n ...sxr,\n ...cssProps,\n ...sx,\n ...style,\n ...hoverStyles,\n },\n {\n injectStyle: typeof window !== \"undefined\",\n container: doc?.document,\n cacheId,\n }\n );\n\n let themeStyle\n if (theme) {\n themeStyle = css({\n \"@global\": {\n [`.${cls.classname}`]: ThemeCssVars(createTheme(theme) as any)\n }\n },\n {\n injectStyle: typeof window !== \"undefined\",\n container: doc?.document,\n cacheId,\n }\n );\n }\n\n return { styles: cls, themeStyle }\n }, [sx, sxr, style, hover, cssProps, doc, cacheId, theme]);\n\n\n /**\n * Compose className\n */\n const finalClassName = useMemo(() => {\n return classNames(\n baseClass ? \"xui-\" + baseClass : undefined,\n clsNames,\n className,\n styles.classname\n );\n }, [baseClass, clsNames, className, styles.classname]);\n\n /**\n * Final props\n */\n const finalProps = useMemo(() => {\n return {\n ...domProps,\n className: finalClassName,\n };\n }, [domProps, finalClassName]);\n\n return {\n props: finalProps,\n style: styles,\n themeStyle\n };\n};\n\nexport default useTagProps;"],"names":[],"mappings":";;;;;;;;;;;;;;AAkBA;AACG;AACA;;;AAeA;;AAEG;;;;AAKA;AACG;AACA;AACG;;;AAEA;;;;AAKT;AAEA;;AAEG;;AAEA;AAEM;;AAGN;AASM;AACA;;AAEF;AAGJ;;;AAGM;AACG;AACF;;AAGE;AACA;;AAEF;;AAIP;AACH;AAGA;;AAEG;AACH;;AAOA;AAEA;;AAEG;AACH;AACG;AAIH;;AAGG;AACA;;;AAGN;;"}
@@ -12,7 +12,7 @@ function TransitionBase(_a) {
12
12
  var { children } = _a, options = tslib.__rest(_a, ["children"]);
13
13
  let { open, variant = "fade", duration = 450, delay, easing: easing$1, exitOnUnmount = false, initialTransition = true, onEnter, onEntered, onExit, onExited, onUpdate, onDone, } = options;
14
14
  easing$1 !== null && easing$1 !== void 0 ? easing$1 : (easing$1 = "default");
15
- const variantCb = variants[variant];
15
+ const variantCb = typeof variant === 'function' ? variant : variants[variant];
16
16
  const ref = React.useRef(null);
17
17
  const init = React.useRef(false);
18
18
  const rect = React.useRef(null);
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sources":["../../src/Transition/index.tsx"],"sourcesContent":["\"use client\";\nimport React, { cloneElement, Children, useRef, isValidElement, useLayoutEffect, useEffect } from 'react';\nimport * as variants from './variants'\nimport { Easing } from '../animate';\nimport useTransition from '../hooks/useTransition';\n\nexport type TransitionVariantTypes = keyof typeof variants\nexport type TransitionProps = {\n children: React.ReactElement;\n open: boolean;\n variant: TransitionVariantTypes\n easing?: keyof typeof Easing\n duration?: number;\n delay?: number;\n initialTransition?: boolean;\n\n exitOnUnmount?: boolean;\n\n onEnter?: () => void\n onEntered?: () => void\n onExit?: () => void\n onExited?: () => void\n onUpdate?: (value: Record<string, number>, progress: number) => void;\n onDone?: () => void;\n}\n\n\nfunction TransitionBase({ children, ...options }: TransitionProps) {\n let {\n open,\n variant = \"fade\",\n duration = 450,\n delay,\n easing,\n exitOnUnmount = false,\n initialTransition = true,\n onEnter,\n onEntered,\n onExit,\n onExited,\n onUpdate,\n onDone,\n\n } = options\n\n easing ??= \"default\"\n\n const variantCb = variants[variant]\n const ref = useRef<HTMLElement>(null)\n const init = useRef(false)\n const rect = useRef<DOMRect>(null)\n\n const trans = useTransition({\n delay,\n duration,\n easing: Easing[easing],\n onEnter,\n onEntered,\n onExit,\n onExited,\n onDone,\n from: () => {\n if (!rect.current) {\n rect.current = ref.current?.getBoundingClientRect() as DOMRect\n }\n const v = variantCb(ref.current as HTMLElement, rect.current)\n return v.from\n },\n to: () => {\n if (!rect.current) {\n rect.current = ref.current?.getBoundingClientRect() as DOMRect\n }\n const v = variantCb(ref.current as HTMLElement, rect.current)\n return v.to\n },\n onUpdate: (val, prograss) => {\n if (!ref.current || !rect.current) return\n const vc = variantCb(ref.current, rect.current)\n onUpdate?.(val, prograss)\n return vc.onUpdate(val)\n },\n })\n\n\n useLayoutEffect(() => {\n const isnot = !init.current && !initialTransition\n init.current = true\n if (open) {\n trans.enter(isnot ? false : true)\n } else {\n trans.exit(isnot ? false : true)\n }\n }, [open])\n\n\n if (exitOnUnmount && trans.status === \"exited\") return\n\n const childs = Children.toArray(children)\n if (childs.length !== 1) {\n throw new Error(\"Transition expects exactly one child.\");\n }\n const child = childs[0]\n if (!isValidElement(child)) {\n throw new Error(\"Transition expects a valid React element.\");\n }\n\n return cloneElement(child, {\n ref: (node: HTMLElement) => {\n ref.current = node;\n\n const childRef = (child as any).ref;\n if (typeof childRef === \"function\") {\n childRef(node);\n } else if (childRef) {\n childRef.current = node;\n }\n }\n } as any);\n}\n\n\nconst Transition = (props: any) => {\n return (\n <TransitionBase\n key={props.variant}\n {...props}\n />\n )\n}\nexport default Transition"],"names":[],"mappings":";;;;;;;;;;AA2BA;AAAwB;AACpB;;AAmBA;AACA;AACA;AACA;;;;AAKI;;;;;;;;AAOI;;;AAGA;;;;;AAIA;;;AAGA;;;AAGJ;;;AAEI;;AAEA;;AAEP;;;AAKG;;AAEI;;;AAEA;;AAER;AAGA;;;AAGA;AACI;;AAEJ;AACA;AACI;;;AAIA;AACI;AAEA;AACA;;;;AAGI;;;AAGJ;AACZ;AAGA;;AAOA;;"}
1
+ {"version":3,"file":"index.cjs","sources":["../../src/Transition/index.tsx"],"sourcesContent":["\"use client\";\nimport React, { cloneElement, Children, useRef, isValidElement, useLayoutEffect, useEffect } from 'react';\nimport * as variants from './variants'\nimport { Easing } from '../animate';\nimport useTransition from '../hooks/useTransition';\n\nexport type TransitionVariantCallback = <T extends Record<string, number>>(el: HTMLElement, rect: DOMRect) => ({\n from: T,\n to: T,\n onUpdate: (props: T) => void\n})\n\nexport type TransitionVariantTypes = keyof typeof variants | TransitionVariantCallback\n\nexport type TransitionProps = {\n children: React.ReactElement;\n open: boolean;\n variant: TransitionVariantTypes\n easing?: keyof typeof Easing\n duration?: number;\n delay?: number;\n initialTransition?: boolean;\n\n exitOnUnmount?: boolean;\n\n onEnter?: () => void\n onEntered?: () => void\n onExit?: () => void\n onExited?: () => void\n onUpdate?: (value: Record<string, number>, progress: number) => void;\n onDone?: () => void;\n}\n\n\nfunction TransitionBase({ children, ...options }: TransitionProps) {\n let {\n open,\n variant = \"fade\",\n duration = 450,\n delay,\n easing,\n exitOnUnmount = false,\n initialTransition = true,\n onEnter,\n onEntered,\n onExit,\n onExited,\n onUpdate,\n onDone,\n\n } = options\n\n easing ??= \"default\"\n\n const variantCb = typeof variant === 'function' ? variant : variants[variant]\n const ref = useRef<HTMLElement>(null)\n const init = useRef(false)\n const rect = useRef<DOMRect>(null)\n\n const trans = useTransition({\n delay,\n duration,\n easing: Easing[easing],\n onEnter,\n onEntered,\n onExit,\n onExited,\n onDone,\n from: () => {\n if (!rect.current) {\n rect.current = ref.current?.getBoundingClientRect() as DOMRect\n }\n const v = variantCb(ref.current as HTMLElement, rect.current)\n return v.from\n },\n to: () => {\n if (!rect.current) {\n rect.current = ref.current?.getBoundingClientRect() as DOMRect\n }\n const v = variantCb(ref.current as HTMLElement, rect.current)\n return v.to\n },\n onUpdate: (val, prograss) => {\n if (!ref.current || !rect.current) return\n const vc = variantCb(ref.current, rect.current)\n onUpdate?.(val, prograss)\n return vc.onUpdate(val)\n },\n })\n\n\n useLayoutEffect(() => {\n const isnot = !init.current && !initialTransition\n init.current = true\n if (open) {\n trans.enter(isnot ? false : true)\n } else {\n trans.exit(isnot ? false : true)\n }\n }, [open])\n\n\n if (exitOnUnmount && trans.status === \"exited\") return\n\n const childs = Children.toArray(children)\n if (childs.length !== 1) {\n throw new Error(\"Transition expects exactly one child.\");\n }\n const child = childs[0]\n if (!isValidElement(child)) {\n throw new Error(\"Transition expects a valid React element.\");\n }\n\n return cloneElement(child, {\n ref: (node: HTMLElement) => {\n ref.current = node;\n\n const childRef = (child as any).ref;\n if (typeof childRef === \"function\") {\n childRef(node);\n } else if (childRef) {\n childRef.current = node;\n }\n }\n } as any);\n}\n\n\nconst Transition = (props: any) => {\n return (\n <TransitionBase\n key={props.variant}\n {...props}\n />\n )\n}\nexport default Transition"],"names":[],"mappings":";;;;;;;;;;AAkCA;AAAwB;AACpB;;AAmBA;AACA;AACA;AACA;;;;AAKI;;;;;;;;AAOI;;;AAGA;;;;;AAIA;;;AAGA;;;AAGJ;;;AAEI;;AAEA;;AAEP;;;AAKG;;AAEI;;;AAEA;;AAER;AAGA;;;AAGA;AACI;;AAEJ;AACA;AACI;;;AAIA;AACI;AAEA;AACA;;;;AAGI;;;AAGJ;AACZ;AAGA;;AAOA;;"}
@@ -2,7 +2,12 @@ import React__default from 'react';
2
2
  import * as variants from './variants.js';
3
3
  import Easing from '../animate/easing.js';
4
4
 
5
- type TransitionVariantTypes = keyof typeof variants;
5
+ type TransitionVariantCallback = <T extends Record<string, number>>(el: HTMLElement, rect: DOMRect) => ({
6
+ from: T;
7
+ to: T;
8
+ onUpdate: (props: T) => void;
9
+ });
10
+ type TransitionVariantTypes = keyof typeof variants | TransitionVariantCallback;
6
11
  type TransitionProps = {
7
12
  children: React__default.ReactElement;
8
13
  open: boolean;
@@ -22,4 +27,4 @@ type TransitionProps = {
22
27
  declare const Transition: (props: any) => React__default.JSX.Element;
23
28
 
24
29
  export { Transition as default };
25
- export type { TransitionProps, TransitionVariantTypes };
30
+ export type { TransitionProps, TransitionVariantCallback, TransitionVariantTypes };
@@ -10,7 +10,7 @@ function TransitionBase(_a) {
10
10
  var { children } = _a, options = __rest(_a, ["children"]);
11
11
  let { open, variant = "fade", duration = 450, delay, easing, exitOnUnmount = false, initialTransition = true, onEnter, onEntered, onExit, onExited, onUpdate, onDone, } = options;
12
12
  easing !== null && easing !== void 0 ? easing : (easing = "default");
13
- const variantCb = variants[variant];
13
+ const variantCb = typeof variant === 'function' ? variant : variants[variant];
14
14
  const ref = useRef(null);
15
15
  const init = useRef(false);
16
16
  const rect = useRef(null);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../src/Transition/index.tsx"],"sourcesContent":["\"use client\";\nimport React, { cloneElement, Children, useRef, isValidElement, useLayoutEffect, useEffect } from 'react';\nimport * as variants from './variants'\nimport { Easing } from '../animate';\nimport useTransition from '../hooks/useTransition';\n\nexport type TransitionVariantTypes = keyof typeof variants\nexport type TransitionProps = {\n children: React.ReactElement;\n open: boolean;\n variant: TransitionVariantTypes\n easing?: keyof typeof Easing\n duration?: number;\n delay?: number;\n initialTransition?: boolean;\n\n exitOnUnmount?: boolean;\n\n onEnter?: () => void\n onEntered?: () => void\n onExit?: () => void\n onExited?: () => void\n onUpdate?: (value: Record<string, number>, progress: number) => void;\n onDone?: () => void;\n}\n\n\nfunction TransitionBase({ children, ...options }: TransitionProps) {\n let {\n open,\n variant = \"fade\",\n duration = 450,\n delay,\n easing,\n exitOnUnmount = false,\n initialTransition = true,\n onEnter,\n onEntered,\n onExit,\n onExited,\n onUpdate,\n onDone,\n\n } = options\n\n easing ??= \"default\"\n\n const variantCb = variants[variant]\n const ref = useRef<HTMLElement>(null)\n const init = useRef(false)\n const rect = useRef<DOMRect>(null)\n\n const trans = useTransition({\n delay,\n duration,\n easing: Easing[easing],\n onEnter,\n onEntered,\n onExit,\n onExited,\n onDone,\n from: () => {\n if (!rect.current) {\n rect.current = ref.current?.getBoundingClientRect() as DOMRect\n }\n const v = variantCb(ref.current as HTMLElement, rect.current)\n return v.from\n },\n to: () => {\n if (!rect.current) {\n rect.current = ref.current?.getBoundingClientRect() as DOMRect\n }\n const v = variantCb(ref.current as HTMLElement, rect.current)\n return v.to\n },\n onUpdate: (val, prograss) => {\n if (!ref.current || !rect.current) return\n const vc = variantCb(ref.current, rect.current)\n onUpdate?.(val, prograss)\n return vc.onUpdate(val)\n },\n })\n\n\n useLayoutEffect(() => {\n const isnot = !init.current && !initialTransition\n init.current = true\n if (open) {\n trans.enter(isnot ? false : true)\n } else {\n trans.exit(isnot ? false : true)\n }\n }, [open])\n\n\n if (exitOnUnmount && trans.status === \"exited\") return\n\n const childs = Children.toArray(children)\n if (childs.length !== 1) {\n throw new Error(\"Transition expects exactly one child.\");\n }\n const child = childs[0]\n if (!isValidElement(child)) {\n throw new Error(\"Transition expects a valid React element.\");\n }\n\n return cloneElement(child, {\n ref: (node: HTMLElement) => {\n ref.current = node;\n\n const childRef = (child as any).ref;\n if (typeof childRef === \"function\") {\n childRef(node);\n } else if (childRef) {\n childRef.current = node;\n }\n }\n } as any);\n}\n\n\nconst Transition = (props: any) => {\n return (\n <TransitionBase\n key={props.variant}\n {...props}\n />\n )\n}\nexport default Transition"],"names":[],"mappings":";;;;;;;;AA2BA;AAAwB;AACpB;;AAmBA;AACA;AACA;AACA;;;;AAKI;;;;;;;;AAOI;;;AAGA;;;;;AAIA;;;AAGA;;;AAGJ;;;AAEI;;AAEA;;AAEP;;;AAKG;;AAEI;;;AAEA;;AAER;AAGA;;;AAGA;AACI;;AAEJ;AACA;AACI;;;AAIA;AACI;AAEA;AACA;;;;AAGI;;;AAGJ;AACZ;AAGA;;AAOA;;"}
1
+ {"version":3,"file":"index.js","sources":["../../src/Transition/index.tsx"],"sourcesContent":["\"use client\";\nimport React, { cloneElement, Children, useRef, isValidElement, useLayoutEffect, useEffect } from 'react';\nimport * as variants from './variants'\nimport { Easing } from '../animate';\nimport useTransition from '../hooks/useTransition';\n\nexport type TransitionVariantCallback = <T extends Record<string, number>>(el: HTMLElement, rect: DOMRect) => ({\n from: T,\n to: T,\n onUpdate: (props: T) => void\n})\n\nexport type TransitionVariantTypes = keyof typeof variants | TransitionVariantCallback\n\nexport type TransitionProps = {\n children: React.ReactElement;\n open: boolean;\n variant: TransitionVariantTypes\n easing?: keyof typeof Easing\n duration?: number;\n delay?: number;\n initialTransition?: boolean;\n\n exitOnUnmount?: boolean;\n\n onEnter?: () => void\n onEntered?: () => void\n onExit?: () => void\n onExited?: () => void\n onUpdate?: (value: Record<string, number>, progress: number) => void;\n onDone?: () => void;\n}\n\n\nfunction TransitionBase({ children, ...options }: TransitionProps) {\n let {\n open,\n variant = \"fade\",\n duration = 450,\n delay,\n easing,\n exitOnUnmount = false,\n initialTransition = true,\n onEnter,\n onEntered,\n onExit,\n onExited,\n onUpdate,\n onDone,\n\n } = options\n\n easing ??= \"default\"\n\n const variantCb = typeof variant === 'function' ? variant : variants[variant]\n const ref = useRef<HTMLElement>(null)\n const init = useRef(false)\n const rect = useRef<DOMRect>(null)\n\n const trans = useTransition({\n delay,\n duration,\n easing: Easing[easing],\n onEnter,\n onEntered,\n onExit,\n onExited,\n onDone,\n from: () => {\n if (!rect.current) {\n rect.current = ref.current?.getBoundingClientRect() as DOMRect\n }\n const v = variantCb(ref.current as HTMLElement, rect.current)\n return v.from\n },\n to: () => {\n if (!rect.current) {\n rect.current = ref.current?.getBoundingClientRect() as DOMRect\n }\n const v = variantCb(ref.current as HTMLElement, rect.current)\n return v.to\n },\n onUpdate: (val, prograss) => {\n if (!ref.current || !rect.current) return\n const vc = variantCb(ref.current, rect.current)\n onUpdate?.(val, prograss)\n return vc.onUpdate(val)\n },\n })\n\n\n useLayoutEffect(() => {\n const isnot = !init.current && !initialTransition\n init.current = true\n if (open) {\n trans.enter(isnot ? false : true)\n } else {\n trans.exit(isnot ? false : true)\n }\n }, [open])\n\n\n if (exitOnUnmount && trans.status === \"exited\") return\n\n const childs = Children.toArray(children)\n if (childs.length !== 1) {\n throw new Error(\"Transition expects exactly one child.\");\n }\n const child = childs[0]\n if (!isValidElement(child)) {\n throw new Error(\"Transition expects a valid React element.\");\n }\n\n return cloneElement(child, {\n ref: (node: HTMLElement) => {\n ref.current = node;\n\n const childRef = (child as any).ref;\n if (typeof childRef === \"function\") {\n childRef(node);\n } else if (childRef) {\n childRef.current = node;\n }\n }\n } as any);\n}\n\n\nconst Transition = (props: any) => {\n return (\n <TransitionBase\n key={props.variant}\n {...props}\n />\n )\n}\nexport default Transition"],"names":[],"mappings":";;;;;;;;AAkCA;AAAwB;AACpB;;AAmBA;AACA;AACA;AACA;;;;AAKI;;;;;;;;AAOI;;;AAGA;;;;;AAIA;;;AAGA;;;AAGJ;;;AAEI;;AAEA;;AAEP;;;AAKG;;AAEI;;;AAEA;;AAER;AAGA;;;AAGA;AACI;;AAEJ;AACA;AACI;;;AAIA;AACI;AAEA;AACA;;;;AAGI;;;AAGJ;AACZ;AAGA;;AAOA;;"}
package/css/getProps.cjs CHANGED
@@ -10,15 +10,12 @@ const getProps = (prop, value, _css) => {
10
10
  if (value === true) {
11
11
  let c = {
12
12
  pointerEvents: "none!important",
13
- cursor: "default!important",
13
+ cursor: "not-allowed!important",
14
14
  userSelect: "none!important",
15
- opacity: "0.5!important",
16
- color: `text.primary!important`,
17
- borderColor: `divider.secondary!important`,
15
+ opacity: "0.6!important",
16
+ transition: "none",
17
+ boxShadow: "none",
18
18
  };
19
- if (_css.bgcolor && _css.bgcolor !== 'transparent') {
20
- c.bgcolor = `divider.primary!important`;
21
- }
22
19
  return c;
23
20
  }
24
21
  return {};
@@ -43,7 +40,7 @@ const getProps = (prop, value, _css) => {
43
40
  // [`${prop}Width`]: value + 'px' + (important || ""),
44
41
  // }
45
42
  // // if (!keys.includes(`${prop}Color`)) {
46
- // // p[`${prop}Color`] = "divider.primary"
43
+ // // p[`${prop}Color`] = "surface.divider"
47
44
  // // }
48
45
  // if (!keys.includes(`${prop}Style`)) {
49
46
  // p[`${prop}Style`] = "solid"
@@ -1 +1 @@
1
- {"version":3,"file":"getProps.cjs","sources":["../../src/css/getProps.ts"],"sourcesContent":["import { CSSProps } from \"./types\";\n\nconst getProps = (prop: string, value: string, _css: CSSProps) => {\n let important;\n if (typeof value === 'string') {\n const split = value.split(\"!\")\n important = split[1] ? \"!important\" : \"\"\n value = split[0]\n }\n\n if (prop === 'disabled') {\n if ((value as any) === true) {\n let c: any = {\n pointerEvents: \"none!important\",\n cursor: \"default!important\",\n userSelect: \"none!important\",\n opacity: \"0.5!important\",\n color: `text.primary!important`,\n borderColor: `divider.secondary!important`,\n }\n\n if ((_css as any).bgcolor && (_css as any).bgcolor !== 'transparent') {\n c.bgcolor = `divider.primary!important`\n }\n return c\n }\n return {}\n }\n\n\n if (prop === \"spacing\" && typeof value === \"number\") {\n const val = value * 8;\n const hasWidth = \"width\" in _css;\n const width = `calc(${hasWidth ? _css.width : \"100%\"} + ${val}px)`;\n return {\n marginLeft: `-${val}px`,\n marginTop: `-${val}px`,\n width: width,\n\n \"& > *\": {\n paddingLeft: `${val}px`,\n paddingTop: `${val}px`,\n },\n } as any;\n }\n\n\n\n // if (value && typeof value === \"number\" && [\"border\", \"borderRight\", \"borderLeft\", \"borderTop\", \"borderBottom\"].includes(prop as any)) {\n // const keys: any = Object.keys(_css)\n // let p: any = {\n // [`${prop}Width`]: value + 'px' + (important || \"\"),\n // }\n // // if (!keys.includes(`${prop}Color`)) {\n // // p[`${prop}Color`] = \"divider.primary\"\n // // }\n // if (!keys.includes(`${prop}Style`)) {\n // p[`${prop}Style`] = \"solid\"\n // }\n // return p\n // }\n}\n\nexport default getProps"],"names":[],"mappings":";;AAEA,MAAM,QAAQ,GAAG,CAAC,IAAY,EAAE,KAAa,EAAE,IAAc,KAAI;AAE7D,IAAA,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;QAC3B,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC;AAC9B,QAAY,KAAK,CAAC,CAAC,CAAC,GAAG,YAAY,GAAG,EAAE;AACxC,QAAA,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC;IACpB;AAEA,IAAA,IAAI,IAAI,KAAK,UAAU,EAAE;AACrB,QAAA,IAAK,KAAa,KAAK,IAAI,EAAE;AACzB,YAAA,IAAI,CAAC,GAAQ;AACT,gBAAA,aAAa,EAAE,gBAAgB;AAC/B,gBAAA,MAAM,EAAE,mBAAmB;AAC3B,gBAAA,UAAU,EAAE,gBAAgB;AAC5B,gBAAA,OAAO,EAAE,eAAe;AACxB,gBAAA,KAAK,EAAE,CAAA,sBAAA,CAAwB;AAC/B,gBAAA,WAAW,EAAE,CAAA,2BAAA,CAA6B;aAC7C;YAED,IAAK,IAAY,CAAC,OAAO,IAAK,IAAY,CAAC,OAAO,KAAK,aAAa,EAAE;AAClE,gBAAA,CAAC,CAAC,OAAO,GAAG,CAAA,yBAAA,CAA2B;YAC3C;AACA,YAAA,OAAO,CAAC;QACZ;AACA,QAAA,OAAO,EAAE;IACb;IAGA,IAAI,IAAI,KAAK,SAAS,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;AACjD,QAAA,MAAM,GAAG,GAAG,KAAK,GAAG,CAAC;AACrB,QAAA,MAAM,QAAQ,GAAG,OAAO,IAAI,IAAI;AAChC,QAAA,MAAM,KAAK,GAAG,CAAA,KAAA,EAAQ,QAAQ,GAAG,IAAI,CAAC,KAAK,GAAG,MAAM,CAAA,GAAA,EAAM,GAAG,KAAK;QAClE,OAAO;YACH,UAAU,EAAE,CAAA,CAAA,EAAI,GAAG,CAAA,EAAA,CAAI;YACvB,SAAS,EAAE,CAAA,CAAA,EAAI,GAAG,CAAA,EAAA,CAAI;AACtB,YAAA,KAAK,EAAE,KAAK;AAEZ,YAAA,OAAO,EAAE;gBACL,WAAW,EAAE,CAAA,EAAG,GAAG,CAAA,EAAA,CAAI;gBACvB,UAAU,EAAE,CAAA,EAAG,GAAG,CAAA,EAAA,CAAI;AACzB,aAAA;SACG;IACZ;;;;;;;;;;;;;;AAiBJ;;;;"}
1
+ {"version":3,"file":"getProps.cjs","sources":["../../src/css/getProps.ts"],"sourcesContent":["import { CSSProps } from \"./types\";\n\nconst getProps = (prop: string, value: string, _css: CSSProps) => {\n let important;\n if (typeof value === 'string') {\n const split = value.split(\"!\")\n important = split[1] ? \"!important\" : \"\"\n value = split[0]\n }\n\n if (prop === 'disabled') {\n if ((value as any) === true) {\n let c: any = {\n pointerEvents: \"none!important\",\n cursor: \"not-allowed!important\",\n userSelect: \"none!important\",\n opacity: \"0.6!important\",\n transition: \"none\",\n boxShadow: \"none\",\n }\n return c\n }\n return {}\n }\n\n\n if (prop === \"spacing\" && typeof value === \"number\") {\n const val = value * 8;\n const hasWidth = \"width\" in _css;\n const width = `calc(${hasWidth ? _css.width : \"100%\"} + ${val}px)`;\n return {\n marginLeft: `-${val}px`,\n marginTop: `-${val}px`,\n width: width,\n\n \"& > *\": {\n paddingLeft: `${val}px`,\n paddingTop: `${val}px`,\n },\n } as any;\n }\n\n\n\n // if (value && typeof value === \"number\" && [\"border\", \"borderRight\", \"borderLeft\", \"borderTop\", \"borderBottom\"].includes(prop as any)) {\n // const keys: any = Object.keys(_css)\n // let p: any = {\n // [`${prop}Width`]: value + 'px' + (important || \"\"),\n // }\n // // if (!keys.includes(`${prop}Color`)) {\n // // p[`${prop}Color`] = \"surface.divider\"\n // // }\n // if (!keys.includes(`${prop}Style`)) {\n // p[`${prop}Style`] = \"solid\"\n // }\n // return p\n // }\n}\n\nexport default getProps"],"names":[],"mappings":";;AAEA,MAAM,QAAQ,GAAG,CAAC,IAAY,EAAE,KAAa,EAAE,IAAc,KAAI;AAE7D,IAAA,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;QAC3B,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC;AAC9B,QAAY,KAAK,CAAC,CAAC,CAAC,GAAG,YAAY,GAAG,EAAE;AACxC,QAAA,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC;IACpB;AAEA,IAAA,IAAI,IAAI,KAAK,UAAU,EAAE;AACrB,QAAA,IAAK,KAAa,KAAK,IAAI,EAAE;AACzB,YAAA,IAAI,CAAC,GAAQ;AACT,gBAAA,aAAa,EAAE,gBAAgB;AAC/B,gBAAA,MAAM,EAAE,uBAAuB;AAC/B,gBAAA,UAAU,EAAE,gBAAgB;AAC5B,gBAAA,OAAO,EAAE,eAAe;AACxB,gBAAA,UAAU,EAAE,MAAM;AAClB,gBAAA,SAAS,EAAE,MAAM;aACpB;AACD,YAAA,OAAO,CAAC;QACZ;AACA,QAAA,OAAO,EAAE;IACb;IAGA,IAAI,IAAI,KAAK,SAAS,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;AACjD,QAAA,MAAM,GAAG,GAAG,KAAK,GAAG,CAAC;AACrB,QAAA,MAAM,QAAQ,GAAG,OAAO,IAAI,IAAI;AAChC,QAAA,MAAM,KAAK,GAAG,CAAA,KAAA,EAAQ,QAAQ,GAAG,IAAI,CAAC,KAAK,GAAG,MAAM,CAAA,GAAA,EAAM,GAAG,KAAK;QAClE,OAAO;YACH,UAAU,EAAE,CAAA,CAAA,EAAI,GAAG,CAAA,EAAA,CAAI;YACvB,SAAS,EAAE,CAAA,CAAA,EAAI,GAAG,CAAA,EAAA,CAAI;AACtB,YAAA,KAAK,EAAE,KAAK;AAEZ,YAAA,OAAO,EAAE;gBACL,WAAW,EAAE,CAAA,EAAG,GAAG,CAAA,EAAA,CAAI;gBACvB,UAAU,EAAE,CAAA,EAAG,GAAG,CAAA,EAAA,CAAI;AACzB,aAAA;SACG;IACZ;;;;;;;;;;;;;;AAiBJ;;;;"}
package/css/getProps.js CHANGED
@@ -8,15 +8,12 @@ const getProps = (prop, value, _css) => {
8
8
  if (value === true) {
9
9
  let c = {
10
10
  pointerEvents: "none!important",
11
- cursor: "default!important",
11
+ cursor: "not-allowed!important",
12
12
  userSelect: "none!important",
13
- opacity: "0.5!important",
14
- color: `text.primary!important`,
15
- borderColor: `divider.secondary!important`,
13
+ opacity: "0.6!important",
14
+ transition: "none",
15
+ boxShadow: "none",
16
16
  };
17
- if (_css.bgcolor && _css.bgcolor !== 'transparent') {
18
- c.bgcolor = `divider.primary!important`;
19
- }
20
17
  return c;
21
18
  }
22
19
  return {};
@@ -41,7 +38,7 @@ const getProps = (prop, value, _css) => {
41
38
  // [`${prop}Width`]: value + 'px' + (important || ""),
42
39
  // }
43
40
  // // if (!keys.includes(`${prop}Color`)) {
44
- // // p[`${prop}Color`] = "divider.primary"
41
+ // // p[`${prop}Color`] = "surface.divider"
45
42
  // // }
46
43
  // if (!keys.includes(`${prop}Style`)) {
47
44
  // p[`${prop}Style`] = "solid"
@@ -1 +1 @@
1
- {"version":3,"file":"getProps.js","sources":["../../src/css/getProps.ts"],"sourcesContent":["import { CSSProps } from \"./types\";\n\nconst getProps = (prop: string, value: string, _css: CSSProps) => {\n let important;\n if (typeof value === 'string') {\n const split = value.split(\"!\")\n important = split[1] ? \"!important\" : \"\"\n value = split[0]\n }\n\n if (prop === 'disabled') {\n if ((value as any) === true) {\n let c: any = {\n pointerEvents: \"none!important\",\n cursor: \"default!important\",\n userSelect: \"none!important\",\n opacity: \"0.5!important\",\n color: `text.primary!important`,\n borderColor: `divider.secondary!important`,\n }\n\n if ((_css as any).bgcolor && (_css as any).bgcolor !== 'transparent') {\n c.bgcolor = `divider.primary!important`\n }\n return c\n }\n return {}\n }\n\n\n if (prop === \"spacing\" && typeof value === \"number\") {\n const val = value * 8;\n const hasWidth = \"width\" in _css;\n const width = `calc(${hasWidth ? _css.width : \"100%\"} + ${val}px)`;\n return {\n marginLeft: `-${val}px`,\n marginTop: `-${val}px`,\n width: width,\n\n \"& > *\": {\n paddingLeft: `${val}px`,\n paddingTop: `${val}px`,\n },\n } as any;\n }\n\n\n\n // if (value && typeof value === \"number\" && [\"border\", \"borderRight\", \"borderLeft\", \"borderTop\", \"borderBottom\"].includes(prop as any)) {\n // const keys: any = Object.keys(_css)\n // let p: any = {\n // [`${prop}Width`]: value + 'px' + (important || \"\"),\n // }\n // // if (!keys.includes(`${prop}Color`)) {\n // // p[`${prop}Color`] = \"divider.primary\"\n // // }\n // if (!keys.includes(`${prop}Style`)) {\n // p[`${prop}Style`] = \"solid\"\n // }\n // return p\n // }\n}\n\nexport default getProps"],"names":[],"mappings":"AAEA,MAAM,QAAQ,GAAG,CAAC,IAAY,EAAE,KAAa,EAAE,IAAc,KAAI;AAE7D,IAAA,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;QAC3B,MAAM,KAAK,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vB,UAAU,EAAE,CAAA,EAAG,GAAG,CAAA,EAAA,CAAI;AACzB,aAAA;SACG;IACZ;;;;;;;;;;;;;;AAiBJ;;;;"}
1
+ {"version":3,"file":"getProps.js","sources":["../../src/css/getProps.ts"],"sourcesContent":["import { CSSProps } from \"./types\";\n\nconst getProps = (prop: string, value: string, _css: CSSProps) => {\n let important;\n if (typeof value === 'string') {\n const split = value.split(\"!\")\n important = split[1] ? \"!important\" : \"\"\n value = split[0]\n }\n\n if (prop === 'disabled') {\n if ((value as any) === true) {\n let c: any = {\n pointerEvents: \"none!important\",\n cursor: \"not-allowed!important\",\n userSelect: \"none!important\",\n opacity: \"0.6!important\",\n transition: \"none\",\n boxShadow: \"none\",\n }\n return c\n }\n return {}\n }\n\n\n if (prop === \"spacing\" && typeof value === \"number\") {\n const val = value * 8;\n const hasWidth = \"width\" in _css;\n const width = `calc(${hasWidth ? _css.width : \"100%\"} + ${val}px)`;\n return {\n marginLeft: `-${val}px`,\n marginTop: `-${val}px`,\n width: width,\n\n \"& > *\": {\n paddingLeft: `${val}px`,\n paddingTop: `${val}px`,\n },\n } as any;\n }\n\n\n\n // if (value && typeof value === \"number\" && [\"border\", \"borderRight\", \"borderLeft\", \"borderTop\", \"borderBottom\"].includes(prop as any)) {\n // const keys: any = Object.keys(_css)\n // let p: any = {\n // [`${prop}Width`]: value + 'px' + (important || \"\"),\n // }\n // // if (!keys.includes(`${prop}Color`)) {\n // // p[`${prop}Color`] = \"surface.divider\"\n // // }\n // if (!keys.includes(`${prop}Style`)) {\n // p[`${prop}Style`] = \"solid\"\n // }\n // return p\n // }\n}\n\nexport default getProps"],"names":[],"mappings":"AAEA,MAAM,QAAQ,GAAG,CAAC,IAAY,EAAE,KAAa,EAAE,IAAc,KAAI;AAE7D,IAAA,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;QAC3B,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC;AAC9B,QAAY,KAAK,CAAC,CAAC,CAAC,GAAG,YAAY,GAAG,EAAE;AACxC,QAAA,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC;IACpB;AAEA,IAAA,IAAI,IAAI,KAAK,UAAU,EAAE;AACrB,QAAA,IAAK,KAAa,KAAK,IAAI,EAAE;AACzB,YAAA,IAAI,CAAC,GAAQ;AACT,gBAAA,aAAa,EAAE,gBAAgB;AAC/B,gBAAA,MAAM,EAAE,uBAAuB;AAC/B,gBAAA,UAAU,EAAE,gBAAgB;AAC5B,gBAAA,OAAO,EAAE,eAAe;AACxB,gBAAA,UAAU,EAAE,MAAM;AAClB,gBAAA,SAAS,EAAE,MAAM;aACpB;AACD,YAAA,OAAO,CAAC;QACZ;AACA,QAAA,OAAO,EAAE;IACb;IAGA,IAAI,IAAI,KAAK,SAAS,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;AACjD,QAAA,MAAM,GAAG,GAAG,KAAK,GAAG,CAAC;AACrB,QAAA,MAAM,QAAQ,GAAG,OAAO,IAAI,IAAI;AAChC,QAAA,MAAM,KAAK,GAAG,CAAA,KAAA,EAAQ,QAAQ,GAAG,IAAI,CAAC,KAAK,GAAG,MAAM,CAAA,GAAA,EAAM,GAAG,KAAK;QAClE,OAAO;YACH,UAAU,EAAE,CAAA,CAAA,EAAI,GAAG,CAAA,EAAA,CAAI;YACvB,SAAS,EAAE,CAAA,CAAA,EAAI,GAAG,CAAA,EAAA,CAAI;AACtB,YAAA,KAAK,EAAE,KAAK;AAEZ,YAAA,OAAO,EAAE;gBACL,WAAW,EAAE,CAAA,EAAG,GAAG,CAAA,EAAA,CAAI;gBACvB,UAAU,EAAE,CAAA,EAAG,GAAG,CAAA,EAAA,CAAI;AACzB,aAAA;SACG;IACZ;;;;;;;;;;;;;;AAiBJ;;;;"}
package/css/getValue.cjs CHANGED
@@ -1,20 +1,22 @@
1
1
  'use strict';
2
2
 
3
- const getColor = (color, hasText = true) => {
3
+ const getColor = (color) => {
4
4
  const i = {
5
- [`${color}`]: `var(--color-${color}-primary)`,
6
- [`${color}.primary`]: `var(--color-${color}-primary)`,
7
- [`${color}.secondary`]: `var(--color-${color}-secondary)`,
8
- [`${color}.soft.primary`]: `var(--color-${color}-soft-primary)`,
9
- [`${color}.soft.secondary`]: `var(--color-${color}-soft-secondary)`,
5
+ [`${color}`]: `var(--color-${color}-main)`,
6
+ [`${color}.main`]: `var(--color-${color}-main)`,
7
+ [`${color}.light`]: `var(--color-${color}-light)`,
8
+ [`${color}.lighter`]: `var(--color-${color}-lighter)`,
9
+ [`${color}.dark`]: `var(--color-${color}-dark)`,
10
+ [`${color}.darker`]: `var(--color-${color}-darker)`,
11
+ [`${color}.contrast`]: `var(--color-${color}-contrast)`,
12
+ [`${color}.muted`]: `var(--color-${color}-muted)`,
13
+ [`${color}.divider`]: `var(--color-${color}-divider)`,
14
+ [`${color}.ghost`]: `var(--color-${color}-ghost)`,
10
15
  };
11
- if (hasText) {
12
- i[`${color}.text`] = `var(--color-${color}-text)`;
13
- }
14
16
  return i;
15
17
  };
16
18
  const withImportant = (important, value) => important ? value + important : value;
17
- const colors = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, getColor("background", false)), getColor("text", false)), getColor("divider", false)), getColor("brand")), getColor("accent")), getColor("info")), getColor("success")), getColor("warning")), getColor("danger"));
19
+ const colors = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, getColor("surface")), getColor("primary")), getColor("accent")), getColor("info")), getColor("success")), getColor("warning")), getColor("danger"));
18
20
  const breakpoints = {
19
21
  "xs": "var(--bp-xs)",
20
22
  "sm": "var(--bp-sm)",
@@ -1 +1 @@
1
- {"version":3,"file":"getValue.cjs","sources":["../../src/css/getValue.ts"],"sourcesContent":["import { CSSProps } from \"./types\"\n\nconst getColor = (color: string, hasText = true) => {\n const i = {\n [`${color}`]: `var(--color-${color}-primary)`,\n [`${color}.primary`]: `var(--color-${color}-primary)`,\n [`${color}.secondary`]: `var(--color-${color}-secondary)`,\n [`${color}.soft.primary`]: `var(--color-${color}-soft-primary)`,\n [`${color}.soft.secondary`]: `var(--color-${color}-soft-secondary)`,\n }\n if (hasText) {\n i[`${color}.text`] = `var(--color-${color}-text)`\n }\n\n return i\n}\n\nconst withImportant = (important: any, value: any) => important ? value + important : value\nconst colors: any = {\n ...getColor(\"background\", false),\n ...getColor(\"text\", false),\n ...getColor(\"divider\", false),\n ...getColor(\"brand\"),\n ...getColor(\"accent\"),\n ...getColor(\"info\"),\n ...getColor(\"success\"),\n ...getColor(\"warning\"),\n ...getColor(\"danger\"),\n}\n\nconst breakpoints: any = {\n \"xs\": \"var(--bp-xs)\",\n \"sm\": \"var(--bp-sm)\",\n \"md\": \"var(--bp-md)\",\n \"lg\": \"var(--bp-lg)\",\n \"xl\": \"var(--bp-xl)\"\n}\n\nlet fontsizes: any = {\n \"h1\": \"var(--fontsize-h1)\",\n \"h2\": \"var(--fontsize-h2)\",\n \"h3\": \"var(--fontsize-h3)\",\n \"h4\": \"var(--fontsize-h4)\",\n \"h5\": \"var(--fontsize-h5)\",\n \"h6\": \"var(--fontsize-h6)\",\n \"big\": \"var(--fontsize-big)\",\n \"text\": \"var(--fontsize-text)\",\n \"button\": \"var(--fontsize-button)\",\n \"small\": \"var(--fontsize-small)\"\n}\n\nlet lineHeights: any = {\n \"h1\": \"var(--lineheight-h1)\",\n \"h2\": \"var(--lineheight-h2)\",\n \"h3\": \"var(--lineheight-h3)\",\n \"h4\": \"var(--lineheight-h4)\",\n \"h5\": \"var(--lineheight-h5)\",\n \"h6\": \"var(--lineheight-h6)\",\n \"big\": \"var(--lineheight-big)\",\n \"text\": \"var(--lineheight-text)\",\n \"button\": \"var(--lineheight-button)\",\n \"small\": \"var(--lineheight-small)\"\n}\n\nlet fontWeights: any = {\n \"h1\": \"var(--fontweight-h1)\",\n \"h2\": \"var(--fontweight-h2)\",\n \"h3\": \"var(--fontweight-h3)\",\n \"h4\": \"var(--fontweight-h4)\",\n \"h5\": \"var(--fontweight-h5)\",\n \"h6\": \"var(--fontweight-h6)\",\n \"big\": \"var(--fontweight-big)\",\n \"text\": \"var(--fontweight-text)\",\n \"button\": \"var(--fontweight-button)\",\n \"small\": \"var(--fontweight-small)\"\n}\n\nlet font: any = {\n \"h1\": \"var(--font-h1)\",\n \"h2\": \"var(--font-h2)\",\n \"h3\": \"var(--font-h3)\",\n \"h4\": \"var(--font-h4)\",\n \"h5\": \"var(--font-h5)\",\n \"h6\": \"var(--font-h6)\",\n \"big\": \"var(--font-big)\",\n \"text\": \"var(--font-text)\",\n \"button\": \"var(--font-button)\",\n \"small\": \"var(--font-small)\"\n}\n\nconst getValue = (prop: any, value: string | number, _css: CSSProps): any => {\n let important;\n\n if (typeof value === 'string') {\n const split = value.split(\"!\")\n important = split[1] ? \"!important\" : \"\"\n value = split[0]\n }\n\n\n if (['width', 'maxWidth', 'minWidth', 'max-width', 'min-width'].includes(prop)) {\n return withImportant(important, breakpoints[value] || value)\n } else if (prop === 'font' && typeof value === \"string\" && ['h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'text', 'button', 'small'].includes(value)) {\n return withImportant(important, font[value] || value)\n } else if (['fontWeight', 'font-weight'].includes(prop) && typeof value === 'string' && ['h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'text', 'button', 'small'].includes(value)) {\n return withImportant(important, fontWeights[value] || value)\n } else if (['lineHeight', 'line-height'].includes(prop) && typeof value === 'string' && ['h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'text', 'button', 'small'].includes(value)) {\n return withImportant(important, lineHeights[value] || value)\n } else if (['fontSize', 'font-size'].includes(prop) && typeof value === 'string') {\n return withImportant(important, fontsizes[value] || value)\n } else if (typeof value === \"number\" && [\"shadow\", \"boxShadow\"].includes(prop)) {\n return withImportant(important, `var(--shadow-${value})`)\n }\n\n return withImportant(important, colors[value] || value)\n}\n\nexport default getValue"],"names":[],"mappings":";;AAEA,MAAM,QAAQ,GAAG,CAAC,KAAa,EAAE,OAAO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,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.cjs","sources":["../../src/css/getValue.ts"],"sourcesContent":["import { CSSProps } from \"./types\"\n\nconst getColor = (color: string) => {\n const i = {\n [`${color}`]: `var(--color-${color}-main)`,\n [`${color}.main`]: `var(--color-${color}-main)`,\n [`${color}.light`]: `var(--color-${color}-light)`,\n [`${color}.lighter`]: `var(--color-${color}-lighter)`,\n [`${color}.dark`]: `var(--color-${color}-dark)`,\n [`${color}.darker`]: `var(--color-${color}-darker)`,\n [`${color}.contrast`]: `var(--color-${color}-contrast)`,\n [`${color}.muted`]: `var(--color-${color}-muted)`,\n [`${color}.divider`]: `var(--color-${color}-divider)`,\n [`${color}.ghost`]: `var(--color-${color}-ghost)`,\n }\n\n return i\n}\n\nconst withImportant = (important: any, value: any) => important ? value + important : value\nconst colors: any = {\n ...getColor(\"surface\"),\n ...getColor(\"primary\"),\n ...getColor(\"accent\"),\n ...getColor(\"info\"),\n ...getColor(\"success\"),\n ...getColor(\"warning\"),\n ...getColor(\"danger\"),\n}\n\nconst breakpoints: any = {\n \"xs\": \"var(--bp-xs)\",\n \"sm\": \"var(--bp-sm)\",\n \"md\": \"var(--bp-md)\",\n \"lg\": \"var(--bp-lg)\",\n \"xl\": \"var(--bp-xl)\"\n}\n\nlet fontsizes: any = {\n \"h1\": \"var(--fontsize-h1)\",\n \"h2\": \"var(--fontsize-h2)\",\n \"h3\": \"var(--fontsize-h3)\",\n \"h4\": \"var(--fontsize-h4)\",\n \"h5\": \"var(--fontsize-h5)\",\n \"h6\": \"var(--fontsize-h6)\",\n \"big\": \"var(--fontsize-big)\",\n \"text\": \"var(--fontsize-text)\",\n \"button\": \"var(--fontsize-button)\",\n \"small\": \"var(--fontsize-small)\"\n}\n\nlet lineHeights: any = {\n \"h1\": \"var(--lineheight-h1)\",\n \"h2\": \"var(--lineheight-h2)\",\n \"h3\": \"var(--lineheight-h3)\",\n \"h4\": \"var(--lineheight-h4)\",\n \"h5\": \"var(--lineheight-h5)\",\n \"h6\": \"var(--lineheight-h6)\",\n \"big\": \"var(--lineheight-big)\",\n \"text\": \"var(--lineheight-text)\",\n \"button\": \"var(--lineheight-button)\",\n \"small\": \"var(--lineheight-small)\"\n}\n\nlet fontWeights: any = {\n \"h1\": \"var(--fontweight-h1)\",\n \"h2\": \"var(--fontweight-h2)\",\n \"h3\": \"var(--fontweight-h3)\",\n \"h4\": \"var(--fontweight-h4)\",\n \"h5\": \"var(--fontweight-h5)\",\n \"h6\": \"var(--fontweight-h6)\",\n \"big\": \"var(--fontweight-big)\",\n \"text\": \"var(--fontweight-text)\",\n \"button\": \"var(--fontweight-button)\",\n \"small\": \"var(--fontweight-small)\"\n}\n\nlet font: any = {\n \"h1\": \"var(--font-h1)\",\n \"h2\": \"var(--font-h2)\",\n \"h3\": \"var(--font-h3)\",\n \"h4\": \"var(--font-h4)\",\n \"h5\": \"var(--font-h5)\",\n \"h6\": \"var(--font-h6)\",\n \"big\": \"var(--font-big)\",\n \"text\": \"var(--font-text)\",\n \"button\": \"var(--font-button)\",\n \"small\": \"var(--font-small)\"\n}\n\nconst getValue = (prop: any, value: string | number, _css: CSSProps): any => {\n let important;\n\n if (typeof value === 'string') {\n const split = value.split(\"!\")\n important = split[1] ? \"!important\" : \"\"\n value = split[0]\n }\n\n if (['width', 'maxWidth', 'minWidth', 'max-width', 'min-width'].includes(prop)) {\n return withImportant(important, breakpoints[value] || value)\n } else if (prop === 'font' && typeof value === \"string\" && ['h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'text', 'button', 'small'].includes(value)) {\n return withImportant(important, font[value] || value)\n } else if (['fontWeight', 'font-weight'].includes(prop) && typeof value === 'string' && ['h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'text', 'button', 'small'].includes(value)) {\n return withImportant(important, fontWeights[value] || value)\n } else if (['lineHeight', 'line-height'].includes(prop) && typeof value === 'string' && ['h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'text', 'button', 'small'].includes(value)) {\n return withImportant(important, lineHeights[value] || value)\n } else if (['fontSize', 'font-size'].includes(prop) && typeof value === 'string') {\n return withImportant(important, fontsizes[value] || value)\n } else if (typeof value === \"number\" && [\"shadow\", \"boxShadow\"].includes(prop)) {\n return withImportant(important, `var(--shadow-${value})`)\n }\n\n return withImportant(important, colors[value] || value)\n}\n\nexport default getValue"],"names":[],"mappings":";;AAEA,MAAM,QAAQ,GAAG,CAAC,KAAa,KAAI;AAC/B,IAAA,MAAM,CAAC,GAAG;AACN,QAAA,CAAC,GAAG,KAAK,CAAA,CAAE,GAAG,CAAA,YAAA,EAAe,KAAK,CAAA,MAAA,CAAQ;AAC1C,QAAA,CAAC,GAAG,KAAK,CAAA,KAAA,CAAO,GAAG,CAAA,YAAA,EAAe,KAAK,CAAA,MAAA,CAAQ;AAC/C,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,KAAA,CAAO,GAAG,CAAA,YAAA,EAAe,KAAK,CAAA,MAAA,CAAQ;AAC/C,QAAA,CAAC,GAAG,KAAK,CAAA,OAAA,CAAS,GAAG,CAAA,YAAA,EAAe,KAAK,CAAA,QAAA,CAAU;AACnD,QAAA,CAAC,GAAG,KAAK,CAAA,SAAA,CAAW,GAAG,CAAA,YAAA,EAAe,KAAK,CAAA,UAAA,CAAY;AACvD,QAAA,CAAC,GAAG,KAAK,CAAA,MAAA,CAAQ,GAAG,CAAA,YAAA,EAAe,KAAK,CAAA,OAAA,CAAS;AACjD,QAAA,CAAC,GAAG,KAAK,CAAA,QAAA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,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;;;;"}
package/css/getValue.js CHANGED
@@ -1,18 +1,20 @@
1
- const getColor = (color, hasText = true) => {
1
+ const getColor = (color) => {
2
2
  const i = {
3
- [`${color}`]: `var(--color-${color}-primary)`,
4
- [`${color}.primary`]: `var(--color-${color}-primary)`,
5
- [`${color}.secondary`]: `var(--color-${color}-secondary)`,
6
- [`${color}.soft.primary`]: `var(--color-${color}-soft-primary)`,
7
- [`${color}.soft.secondary`]: `var(--color-${color}-soft-secondary)`,
3
+ [`${color}`]: `var(--color-${color}-main)`,
4
+ [`${color}.main`]: `var(--color-${color}-main)`,
5
+ [`${color}.light`]: `var(--color-${color}-light)`,
6
+ [`${color}.lighter`]: `var(--color-${color}-lighter)`,
7
+ [`${color}.dark`]: `var(--color-${color}-dark)`,
8
+ [`${color}.darker`]: `var(--color-${color}-darker)`,
9
+ [`${color}.contrast`]: `var(--color-${color}-contrast)`,
10
+ [`${color}.muted`]: `var(--color-${color}-muted)`,
11
+ [`${color}.divider`]: `var(--color-${color}-divider)`,
12
+ [`${color}.ghost`]: `var(--color-${color}-ghost)`,
8
13
  };
9
- if (hasText) {
10
- i[`${color}.text`] = `var(--color-${color}-text)`;
11
- }
12
14
  return i;
13
15
  };
14
16
  const withImportant = (important, value) => important ? value + important : value;
15
- const colors = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, getColor("background", false)), getColor("text", false)), getColor("divider", false)), getColor("brand")), getColor("accent")), getColor("info")), getColor("success")), getColor("warning")), getColor("danger"));
17
+ const colors = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, getColor("surface")), getColor("primary")), getColor("accent")), getColor("info")), getColor("success")), getColor("warning")), getColor("danger"));
16
18
  const breakpoints = {
17
19
  "xs": "var(--bp-xs)",
18
20
  "sm": "var(--bp-sm)",