@xanui/core 1.2.26 → 1.2.27
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.
- package/AppRoot/Renderar.js.map +1 -1
- package/AppRoot/Renderar.mjs.map +1 -1
- package/AppRoot/index.js.map +1 -1
- package/AppRoot/index.mjs.map +1 -1
- package/Tag/ServerStyleTag.js.map +1 -1
- package/Tag/ServerStyleTag.mjs.map +1 -1
- package/Tag/cssPropList.js.map +1 -1
- package/Tag/cssPropList.mjs.map +1 -1
- package/Tag/index.js.map +1 -1
- package/Tag/index.mjs.map +1 -1
- package/Tag/useTagProps.js +12 -23
- package/Tag/useTagProps.js.map +1 -1
- package/Tag/useTagProps.mjs +12 -23
- package/Tag/useTagProps.mjs.map +1 -1
- package/Transition/index.js.map +1 -1
- package/Transition/index.mjs.map +1 -1
- package/breakpoint/BreakpointProvider.js.map +1 -1
- package/breakpoint/BreakpointProvider.mjs.map +1 -1
- package/breakpoint/useBreakpoint.js.map +1 -1
- package/breakpoint/useBreakpoint.mjs.map +1 -1
- package/breakpoint/useBreakpointProps.d.ts +2 -2
- package/breakpoint/useBreakpointProps.js +34 -35
- package/breakpoint/useBreakpointProps.js.map +1 -1
- package/breakpoint/useBreakpointProps.mjs +34 -35
- package/breakpoint/useBreakpointProps.mjs.map +1 -1
- package/css/aliases.js.map +1 -1
- package/css/aliases.mjs.map +1 -1
- package/css/getProps.js.map +1 -1
- package/css/getProps.mjs.map +1 -1
- package/css/getValue.js.map +1 -1
- package/css/getValue.mjs.map +1 -1
- package/css/index.js.map +1 -1
- package/css/index.mjs.map +1 -1
- package/hooks/useAnimation.js.map +1 -1
- package/hooks/useAnimation.mjs.map +1 -1
- package/hooks/useColorTemplate.js.map +1 -1
- package/hooks/useColorTemplate.mjs.map +1 -1
- package/hooks/useInterface.d.ts +1 -1
- package/hooks/useInterface.js +4 -4
- package/hooks/useInterface.js.map +1 -1
- package/hooks/useInterface.mjs +4 -4
- package/hooks/useInterface.mjs.map +1 -1
- package/hooks/usePortal.js.map +1 -1
- package/hooks/usePortal.mjs.map +1 -1
- package/hooks/useTransition/index.js.map +1 -1
- package/hooks/useTransition/index.mjs.map +1 -1
- package/hooks/useTransition/variants.js.map +1 -1
- package/hooks/useTransition/variants.mjs.map +1 -1
- package/package.json +1 -1
- package/readme.md +109 -109
- package/theme/ThemeCssVars.js.map +1 -1
- package/theme/ThemeCssVars.mjs.map +1 -1
- package/theme/ThemeDefaultOptions.js.map +1 -1
- package/theme/ThemeDefaultOptions.mjs.map +1 -1
- package/theme/ThemeProvider.js.map +1 -1
- package/theme/ThemeProvider.mjs.map +1 -1
- package/theme/core.js.map +1 -1
- package/theme/core.mjs.map +1 -1
- package/theme/createTheme.js.map +1 -1
- package/theme/createTheme.mjs.map +1 -1
- package/theme/createThemeSwitcher.js.map +1 -1
- package/theme/createThemeSwitcher.mjs.map +1 -1
- package/theme/index.js.map +1 -1
- package/theme/index.mjs.map +1 -1
package/hooks/useInterface.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';Object.defineProperty(exports,'__esModule',{value:true});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) => {
|
|
2
2
|
const theme = core.useTheme();
|
|
3
|
-
|
|
4
|
-
if (
|
|
5
|
-
|
|
3
|
+
let _props = Object.assign(Object.assign({}, defaultProps), userPorps);
|
|
4
|
+
if (name in theme.interfaces) {
|
|
5
|
+
return theme.interfaces[name](_props, theme);
|
|
6
6
|
}
|
|
7
|
-
return [
|
|
7
|
+
return [_props, theme];
|
|
8
8
|
};exports.default=useInterface;//# sourceMappingURL=useInterface.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useInterface.js","sources":["../../src/hooks/useInterface.ts"],"sourcesContent":["import { useTheme } from \"../theme\"\n\nconst useInterface = <P extends object>(name: string, userPorps: P, defaultProps: P) => {\n const theme = useTheme()\n
|
|
1
|
+
{"version":3,"file":"useInterface.js","sources":["../../src/hooks/useInterface.ts"],"sourcesContent":["import { useTheme } from \"../theme\"\r\n\r\nconst useInterface = <P extends object>(name: string, userPorps: P, defaultProps: P) => {\r\n const theme = useTheme()\r\n let _props = { ...defaultProps, ...userPorps } as P\r\n if (name in theme.interfaces) {\r\n return theme.interfaces[name](_props, theme)\r\n }\r\n return [_props, theme]\r\n}\r\n\r\nexport default useInterface"],"names":["useTheme"],"mappings":"6NAEA,MAAM,YAAY,GAAG,CAAmB,IAAY,EAAE,SAAY,EAAE,YAAe,KAAI;AACnF,IAAA,MAAM,KAAK,GAAGA,aAAQ,EAAE;AACxB,IAAA,IAAI,MAAM,GAAG,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EAAK,YAAY,CAAA,EAAK,SAAS,CAAO;AACnD,IAAA,IAAI,IAAI,IAAI,KAAK,CAAC,UAAU,EAAE;QAC1B,OAAO,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,KAAK,CAAC;IAChD;AACA,IAAA,OAAO,CAAC,MAAM,EAAE,KAAK,CAAC;AAC1B"}
|
package/hooks/useInterface.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
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) => {
|
|
2
2
|
const theme = useTheme();
|
|
3
|
-
|
|
4
|
-
if (
|
|
5
|
-
|
|
3
|
+
let _props = Object.assign(Object.assign({}, defaultProps), userPorps);
|
|
4
|
+
if (name in theme.interfaces) {
|
|
5
|
+
return theme.interfaces[name](_props, theme);
|
|
6
6
|
}
|
|
7
|
-
return [
|
|
7
|
+
return [_props, theme];
|
|
8
8
|
};export{useInterface as default};//# sourceMappingURL=useInterface.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useInterface.mjs","sources":["../../src/hooks/useInterface.ts"],"sourcesContent":["import { useTheme } from \"../theme\"\n\nconst useInterface = <P extends object>(name: string, userPorps: P, defaultProps: P) => {\n const theme = useTheme()\n
|
|
1
|
+
{"version":3,"file":"useInterface.mjs","sources":["../../src/hooks/useInterface.ts"],"sourcesContent":["import { useTheme } from \"../theme\"\r\n\r\nconst useInterface = <P extends object>(name: string, userPorps: P, defaultProps: P) => {\r\n const theme = useTheme()\r\n let _props = { ...defaultProps, ...userPorps } as P\r\n if (name in theme.interfaces) {\r\n return theme.interfaces[name](_props, theme)\r\n }\r\n return [_props, theme]\r\n}\r\n\r\nexport default useInterface"],"names":[],"mappings":"iJAEA,MAAM,YAAY,GAAG,CAAmB,IAAY,EAAE,SAAY,EAAE,YAAe,KAAI;AACnF,IAAA,MAAM,KAAK,GAAG,QAAQ,EAAE;AACxB,IAAA,IAAI,MAAM,GAAG,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EAAK,YAAY,CAAA,EAAK,SAAS,CAAO;AACnD,IAAA,IAAI,IAAI,IAAI,KAAK,CAAC,UAAU,EAAE;QAC1B,OAAO,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,KAAK,CAAC;IAChD;AACA,IAAA,OAAO,CAAC,MAAM,EAAE,KAAK,CAAC;AAC1B"}
|
package/hooks/usePortal.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usePortal.js","sources":["../../src/hooks/usePortal.tsx"],"sourcesContent":["import React, { useEffect, useMemo } from \"react\";\nimport { createRoot } from \"react-dom/client\";\nimport { ThemeProvider, useTheme } from \"../theme\";\nimport { appRootElement } from \"../AppRoot\";\n\nexport type UsePortalOptions = {\n container?: HTMLElement;\n autoMount?: boolean;\n}\n\nexport function usePortal(children: React.ReactNode, options?: UsePortalOptions) {\n options = options || {};\n if (options.autoMount === undefined) {\n options.autoMount = true;\n }\n const [mounted, setMounted] = React.useState(options.autoMount);\n const theme = useTheme();\n const { el, root } = useMemo(() => {\n const el = document.createElement(\"div\");\n const root = createRoot(el);\n return { el, root };\n }, [options.autoMount]);\n\n const container = () => {\n const rootEle = appRootElement();\n const container = options?.container || rootEle\n if (!container) throw new Error(`Container not found for portal. Please ensure that AppRoot is present in the application tree.`);\n return container;\n }\n\n const mount = () => {\n const cont = container();\n if (!cont.contains(el)) {\n cont.appendChild(el);\n }\n root.render(<ThemeProvider theme={theme.name}>{children}</ThemeProvider>)\n }\n\n const unmount = () => {\n root.render(null)\n el.remove();\n }\n\n\n useEffect(() => {\n if (mounted) {\n mount()\n } else {\n unmount()\n }\n }, [mounted]);\n\n useEffect(() => {\n if (mounted) {\n mount()\n }\n }, [children]);\n\n useEffect(() => {\n return () => {\n unmount()\n };\n }, []);\n\n return {\n isMount: () => mounted,\n mount: () => setMounted(true),\n unmount: () => setMounted(false)\n }\n}\n\n\nexport default usePortal;"],"names":["useTheme","useMemo","createRoot","appRootElement","_jsx","ThemeProvider","useEffect"],"mappings":"0XAUM,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;A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AAA,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":"0XAUM,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,IAAA,CAAC,EAAE,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAEvB,MAAM,SAAS,GAAG,MAAK;AACpB,QAAA,MAAM,OAAO,GAAGC,oBAAc,EAAE;AAChC,QAAA,MAAM,SAAS,GAAG,CAAA,OAAO,KAAA,IAAA,IAAP,OAAO,KAAA,MAAA,GAAA,MAAA,GAAP,OAAO,CAAE,SAAS,KAAI,OAAO;AAC/C,QAAA,IAAI,CAAC,SAAS;AAAE,YAAA,MAAM,IAAI,KAAK,CAAC,CAAA,8FAAA,CAAgG,CAAC;AACjI,QAAA,OAAO,SAAS;AACnB,IAAA,CAAC;IAED,MAAM,KAAK,GAAG,MAAK;AAChB,QAAA,MAAM,IAAI,GAAG,SAAS,EAAE;QACxB,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE;AACrB,YAAA,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC;QACvB;AACA,QAAA,IAAI,CAAC,MAAM,CAACC,cAAA,CAACC,qBAAa,EAAA,EAAC,KAAK,EAAE,KAAK,CAAC,IAAI,EAAA,QAAA,EAAG,QAAQ,EAAA,CAAiB,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"}
|
package/hooks/usePortal.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usePortal.mjs","sources":["../../src/hooks/usePortal.tsx"],"sourcesContent":["import React, { useEffect, useMemo } from \"react\";\nimport { createRoot } from \"react-dom/client\";\nimport { ThemeProvider, useTheme } from \"../theme\";\nimport { appRootElement } from \"../AppRoot\";\n\nexport type UsePortalOptions = {\n container?: HTMLElement;\n autoMount?: boolean;\n}\n\nexport function usePortal(children: React.ReactNode, options?: UsePortalOptions) {\n options = options || {};\n if (options.autoMount === undefined) {\n options.autoMount = true;\n }\n const [mounted, setMounted] = React.useState(options.autoMount);\n const theme = useTheme();\n const { el, root } = useMemo(() => {\n const el = document.createElement(\"div\");\n const root = createRoot(el);\n return { el, root };\n }, [options.autoMount]);\n\n const container = () => {\n const rootEle = appRootElement();\n const container = options?.container || rootEle\n if (!container) throw new Error(`Container not found for portal. Please ensure that AppRoot is present in the application tree.`);\n return container;\n }\n\n const mount = () => {\n const cont = container();\n if (!cont.contains(el)) {\n cont.appendChild(el);\n }\n root.render(<ThemeProvider theme={theme.name}>{children}</ThemeProvider>)\n }\n\n const unmount = () => {\n root.render(null)\n el.remove();\n }\n\n\n useEffect(() => {\n if (mounted) {\n mount()\n } else {\n unmount()\n }\n }, [mounted]);\n\n useEffect(() => {\n if (mounted) {\n mount()\n }\n }, [children]);\n\n useEffect(() => {\n return () => {\n unmount()\n };\n }, []);\n\n return {\n isMount: () => mounted,\n mount: () => setMounted(true),\n unmount: () => setMounted(false)\n }\n}\n\n\nexport default usePortal;"],"names":["React","_jsx"],"mappings":"yVAUM,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,GAAGA,cAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,SAAS,CAAC;AAC/D,IAAA,MAAM,KAAK,GAAG,QAAQ,EAAE;IACxB,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC,MAAK;QAC/B,MAAM,EAAE,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC;AACxC,QAAA,MAAM,IAAI,GAAG,UAAU,CAAC,EAAE,CAAC;AAC3B,QAAA,OAAO,EA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A,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.mjs","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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,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC;QACvB;AACA,QAAA,IAAI,CAAC,MAAM,CAACC,GAAA,CAAC,aAAa,EAAA,EAAC,KAAK,EAAE,KAAK,CAAC,IAAI,EAAA,QAAA,EAAG,QAAQ,EAAA,CAAiB,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;IAGD,SAAS,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;IAEb,SAAS,CAAC,MAAK;QACZ,IAAI,OAAO,EAAE;AACV,YAAA,KAAK,EAAE;QACV;AACH,IAAA,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC;IAEd,SAAS,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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/hooks/useTransition/index.ts"],"sourcesContent":["import { useState, useEffect, useId } from 'react';\nimport { animationEases } from '../useAnimation';\nimport { css } from '../../css';\nimport { formatCSSProp } from 'oncss';\nimport { CSSProps } from '../../css/types';\nimport * as variants from './variants'\n\nexport type UseTransitionVariantTypes = keyof typeof variants\nexport type UseTransitionState = \"open\" | \"opened\" | \"close\" | \"closed\"\n\nexport type UseTransitionVariant = (rect: DOMRect) => ({ from: CSSProps, to: CSSProps })\n\nexport type UseTransitionProps = {\n open: boolean;\n variant: UseTransitionVariant | UseTransitionVariantTypes;\n ease?: string;\n easing?: keyof typeof animationEases;\n duration?: number;\n delay?: number;\n disableInitialTransition?: boolean;\n exitOnUnmount?: boolean;\n onOpen?: () => void;\n onOpened?: () => void;\n onClose?: () => void;\n onClosed?: () => void;\n onState?: (state: UseTransitionState) => void;\n}\n\n\nconst style = (obj?: any) => {\n return css(obj || {}, { selector: \"#\" }).classname;\n}\n\nconst getVariant = (rect: DOMRect | null, variant: UseTransitionProps['variant']) => {\n let fn = typeof variant === 'string' ? variants[variant] : variant\n if (!fn) throw new Error(`Transition variant \"${variant}\" not found.`)\n return fn(rect as DOMRect);\n}\n\nconst useTransition = ({ open, ...props }: UseTransitionProps) => {\n let {\n disableInitialTransition = false,\n variant = \"fade\",\n duration = 400,\n delay,\n ease,\n easing,\n exitOnUnmount = false,\n onOpen,\n onOpened,\n onClose,\n onClosed,\n onState\n } = props\n let _ease = ease || (animationEases as any)[easing as any] || animationEases.bounce\n const id = \"xui-transition-\" + useId()\n const [state, setState] = useState({\n initial: false,\n classname: style({ visibility: \"hidden\" }),\n variant: variant,\n rect: null as DOMRect | null,\n stage: open ? \"open\" : \"closed\",\n unmounted: false,\n })\n\n const getEle = () => document.querySelector(`[data-transition=\"${id}\"]`) as HTMLElement;\n const getBoundary = () => state.rect || getEle()?.getBoundingClientRect() || new DOMRect(0, 0, 0, 0);\n\n useEffect(() => {\n if (exitOnUnmount && state.stage === 'closed') {\n if (!open) {\n setState(s => ({\n ...s,\n initial: false,\n classname: \"\",\n unmounted: true,\n variant: variant,\n }))\n } else {\n setState(s => ({\n ...s,\n variant: variant,\n classname: style({ visibility: \"hidden\" }),\n stage: \"open\",\n }))\n }\n }\n }, [open, state.stage, exitOnUnmount, variant])\n\n // initial effect\n useEffect(() => {\n const ele = getEle()\n if (!ele) return\n if (exitOnUnmount && state.stage === 'closed') return\n\n const rect = getBoundary();\n let { from } = getVariant(rect, state.variant)\n if (open && !state.initial) {\n setState(s => ({\n ...s,\n classname: (!disableInitialTransition || state.unmounted) ? style(from) : \"\",\n initial: true,\n rect: rect,\n }))\n let stimer: any = null\n let etimer: any = null\n ele.ontransitionstart = () => {\n clearTimeout(stimer)\n stimer = setTimeout(() => {\n const isOpen = ele.getAttribute('data-transition-state') === 'open';\n (onOpen && isOpen) && onOpen();\n (onClose && !isOpen) && onClose()\n onState && onState(isOpen ? \"open\" : \"close\")\n setState(s => ({\n ...s,\n stage: isOpen ? \"open\" : \"close\"\n }))\n }, 1)\n }\n\n ele.ontransitionend = () => {\n clearTimeout(etimer)\n etimer = setTimeout(() => {\n const isOpen = ele.getAttribute('data-transition-state') === 'open';\n (onOpened && isOpen) && onOpened();\n (onClosed && !isOpen) && onClosed();\n onState && onState(isOpen ? \"opened\" : \"closed\")\n setState(s => ({\n ...s,\n stage: isOpen ? \"opened\" : \"closed\"\n }))\n }, 1)\n }\n } else if (!state.initial) {\n setState(s => ({\n ...s,\n classname: style(from),\n rect: rect,\n }))\n }\n }, [open, state.initial, state.stage, exitOnUnmount])\n\n\n useEffect(() => {\n if (state.initial) {\n let _variant = state.variant !== variant ? variant : state.variant\n const { from, to } = getVariant(state.rect, _variant)\n let _css: CSSProps = open ? to : from\n let trans = ` ${duration}ms ${_ease} ${delay || 0}ms`\n let _ = {\n ..._css,\n transition: Object.keys(_css || {}).map(k => formatCSSProp(k)).join(trans + \", \") + trans,\n }\n setState(s => ({\n ...s,\n classname: style(_),\n variant: _variant\n }))\n }\n }, [open, state.initial, variant])\n\n return {\n exited: exitOnUnmount && state.stage === 'closed',\n props: {\n 'id': state.classname,\n 'data-transition': id,\n 'data-transition-state': open ? 'open' : 'close',\n }\n }\n}\n\n\nexport default useTransition"],"names":["css","__rest","animationEases","useId","useState","useEffect","formatCSSProp"],"mappings":"gQA6BA,MAAM,KAAK,GAAG,CAAC,GAAS,KAAI;AACzB,IAAA,OAAOA,SAAG,CAAC,GAAG,IAAI,EAAE,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,EAAI,KAAK,IAAI,CAAC,CAAA,EAAA,CAAI;AACrD,YAAA,IAAI,CAAC,GAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EACC,IAAI,CAAA,EAAA,EACP,UAAU,EAAE,MAAM,CAAC,IAAI,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,IAAIC,mBAAa,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,GAAG,KAAK,GAC3F;YACD,QAAQ,CAAC,CAAC,KAAI,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EACR,CAAC,KACJ,SAAS,EAAE,KAAK,CAAC,CAAC,CAAC,EACnB,OAAO,EAAE,QAAQ,EAAA,CAAA,CAClB,CAAC;QACN;IACH,CAAC,EAAE,CAAC,IAAI,EAAE,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAElC,OAAO;AACJ,QAAA,MAAM,EAAE,aAAa,IAAI,KAAK,CAAC,KAAK,KAAK,QAAQ;AACjD,QAAA,KAAK,EAAE;YACJ,IAAI,EAAE,KAAK,CAAC,SAAS;AACrB,YAAA,iBAAiB,EAAE,EAAE;YACrB,uBAAuB,EAAE,IAAI,GAAG,MAAM,GAAG,OAAO;AAClD;KACH;AACJ"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/hooks/useTransition/index.ts"],"sourcesContent":["import { useState, useEffect, useId } from 'react';\r\nimport { animationEases } from '../useAnimation';\r\nimport { css } from '../../css';\r\nimport { formatCSSProp } from 'oncss';\r\nimport { CSSProps } from '../../css/types';\r\nimport * as variants from './variants'\r\n\r\nexport type UseTransitionVariantTypes = keyof typeof variants\r\nexport type UseTransitionState = \"open\" | \"opened\" | \"close\" | \"closed\"\r\n\r\nexport type UseTransitionVariant = (rect: DOMRect) => ({ from: CSSProps, to: CSSProps })\r\n\r\nexport type UseTransitionProps = {\r\n open: boolean;\r\n variant: UseTransitionVariant | UseTransitionVariantTypes;\r\n ease?: string;\r\n easing?: keyof typeof animationEases;\r\n duration?: number;\r\n delay?: number;\r\n disableInitialTransition?: boolean;\r\n exitOnUnmount?: boolean;\r\n onOpen?: () => void;\r\n onOpened?: () => void;\r\n onClose?: () => void;\r\n onClosed?: () => void;\r\n onState?: (state: UseTransitionState) => void;\r\n}\r\n\r\n\r\nconst style = (obj?: any) => {\r\n return css(obj || {}, { selector: \"#\" }).classname;\r\n}\r\n\r\nconst getVariant = (rect: DOMRect | null, variant: UseTransitionProps['variant']) => {\r\n let fn = typeof variant === 'string' ? variants[variant] : variant\r\n if (!fn) throw new Error(`Transition variant \"${variant}\" not found.`)\r\n return fn(rect as DOMRect);\r\n}\r\n\r\nconst useTransition = ({ open, ...props }: UseTransitionProps) => {\r\n let {\r\n disableInitialTransition = false,\r\n variant = \"fade\",\r\n duration = 400,\r\n delay,\r\n ease,\r\n easing,\r\n exitOnUnmount = false,\r\n onOpen,\r\n onOpened,\r\n onClose,\r\n onClosed,\r\n onState\r\n } = props\r\n let _ease = ease || (animationEases as any)[easing as any] || animationEases.bounce\r\n const id = \"xui-transition-\" + useId()\r\n const [state, setState] = useState({\r\n initial: false,\r\n classname: style({ visibility: \"hidden\" }),\r\n variant: variant,\r\n rect: null as DOMRect | null,\r\n stage: open ? \"open\" : \"closed\",\r\n unmounted: false,\r\n })\r\n\r\n const getEle = () => document.querySelector(`[data-transition=\"${id}\"]`) as HTMLElement;\r\n const getBoundary = () => state.rect || getEle()?.getBoundingClientRect() || new DOMRect(0, 0, 0, 0);\r\n\r\n useEffect(() => {\r\n if (exitOnUnmount && state.stage === 'closed') {\r\n if (!open) {\r\n setState(s => ({\r\n ...s,\r\n initial: false,\r\n classname: \"\",\r\n unmounted: true,\r\n variant: variant,\r\n }))\r\n } else {\r\n setState(s => ({\r\n ...s,\r\n variant: variant,\r\n classname: style({ visibility: \"hidden\" }),\r\n stage: \"open\",\r\n }))\r\n }\r\n }\r\n }, [open, state.stage, exitOnUnmount, variant])\r\n\r\n // initial effect\r\n useEffect(() => {\r\n const ele = getEle()\r\n if (!ele) return\r\n if (exitOnUnmount && state.stage === 'closed') return\r\n\r\n const rect = getBoundary();\r\n let { from } = getVariant(rect, state.variant)\r\n if (open && !state.initial) {\r\n setState(s => ({\r\n ...s,\r\n classname: (!disableInitialTransition || state.unmounted) ? style(from) : \"\",\r\n initial: true,\r\n rect: rect,\r\n }))\r\n let stimer: any = null\r\n let etimer: any = null\r\n ele.ontransitionstart = () => {\r\n clearTimeout(stimer)\r\n stimer = setTimeout(() => {\r\n const isOpen = ele.getAttribute('data-transition-state') === 'open';\r\n (onOpen && isOpen) && onOpen();\r\n (onClose && !isOpen) && onClose()\r\n onState && onState(isOpen ? \"open\" : \"close\")\r\n setState(s => ({\r\n ...s,\r\n stage: isOpen ? \"open\" : \"close\"\r\n }))\r\n }, 1)\r\n }\r\n\r\n ele.ontransitionend = () => {\r\n clearTimeout(etimer)\r\n etimer = setTimeout(() => {\r\n const isOpen = ele.getAttribute('data-transition-state') === 'open';\r\n (onOpened && isOpen) && onOpened();\r\n (onClosed && !isOpen) && onClosed();\r\n onState && onState(isOpen ? \"opened\" : \"closed\")\r\n setState(s => ({\r\n ...s,\r\n stage: isOpen ? \"opened\" : \"closed\"\r\n }))\r\n }, 1)\r\n }\r\n } else if (!state.initial) {\r\n setState(s => ({\r\n ...s,\r\n classname: style(from),\r\n rect: rect,\r\n }))\r\n }\r\n }, [open, state.initial, state.stage, exitOnUnmount])\r\n\r\n\r\n useEffect(() => {\r\n if (state.initial) {\r\n let _variant = state.variant !== variant ? variant : state.variant\r\n const { from, to } = getVariant(state.rect, _variant)\r\n let _css: CSSProps = open ? to : from\r\n let trans = ` ${duration}ms ${_ease} ${delay || 0}ms`\r\n let _ = {\r\n ..._css,\r\n transition: Object.keys(_css || {}).map(k => formatCSSProp(k)).join(trans + \", \") + trans,\r\n }\r\n setState(s => ({\r\n ...s,\r\n classname: style(_),\r\n variant: _variant\r\n }))\r\n }\r\n }, [open, state.initial, variant])\r\n\r\n return {\r\n exited: exitOnUnmount && state.stage === 'closed',\r\n props: {\r\n 'id': state.classname,\r\n 'data-transition': id,\r\n 'data-transition-state': open ? 'open' : 'close',\r\n }\r\n }\r\n}\r\n\r\n\r\nexport default useTransition"],"names":["css","__rest","animationEases","useId","useState","useEffect","formatCSSProp"],"mappings":"gQA6BA,MAAM,KAAK,GAAG,CAAC,GAAS,KAAI;AACzB,IAAA,OAAOA,SAAG,CAAC,GAAG,IAAI,EAAE,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,CAAC,SAAS;AACrD,CAAC;AAED,MAAM,UAAU,GAAG,CAAC,IAAoB,EAAE,OAAsC,KAAI;AACjF,IAAA,IAAI,EAAE,GAAG,OAAO,OAAO,KAAK,QAAQ,GAAG,QAAQ,CAAC,OAAO,CAAC,GAAG,OAAO;AAClE,IAAA,IAAI,CAAC,EAAE;AAAE,QAAA,MAAM,IAAI,KAAK,CAAC,uBAAuB,OAAO,CAAA,YAAA,CAAc,CAAC;AACtE,IAAA,OAAO,EAAE,CAAC,IAAe,CAAC;AAC7B,CAAC;AAED,MAAM,aAAa,GAAG,CAAC,EAAsC,KAAI;AAA1C,IAAA,IAAA,EAAE,IAAI,EAAA,GAAA,EAAgC,EAA3B,KAAK,GAAAC,YAAA,CAAA,EAAA,EAAhB,QAAkB,CAAF;AACpC,IAAA,IAAI,EACD,wBAAwB,GAAG,KAAK,EAChC,OAAO,GAAG,MAAM,EAChB,QAAQ,GAAG,GAAG,EACd,KAAK,EACL,IAAI,EACJ,MAAM,EACN,aAAa,GAAG,KAAK,EACrB,MAAM,EACN,QAAQ,EACR,OAAO,EACP,QAAQ,EACR,OAAO,EACT,GAAG,KAAK;AACT,IAAA,IAAI,KAAK,GAAG,IAAI,IAAKC,2BAAsB,CAAC,MAAa,CAAC,IAAIA,2BAAc,CAAC,MAAM;AACnF,IAAA,MAAM,EAAE,GAAG,iB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"version":3,"file":"index.mjs","sources":["../../../src/hooks/useTransition/index.ts"],"sourcesContent":["import { useState, useEffect, useId } from 'react';\nimport { animationEases } from '../useAnimation';\nimport { css } from '../../css';\nimport { formatCSSProp } from 'oncss';\nimport { CSSProps } from '../../css/types';\nimport * as variants from './variants'\n\nexport type UseTransitionVariantTypes = keyof typeof variants\nexport type UseTransitionState = \"open\" | \"opened\" | \"close\" | \"closed\"\n\nexport type UseTransitionVariant = (rect: DOMRect) => ({ from: CSSProps, to: CSSProps })\n\nexport type UseTransitionProps = {\n open: boolean;\n variant: UseTransitionVariant | UseTransitionVariantTypes;\n ease?: string;\n easing?: keyof typeof animationEases;\n duration?: number;\n delay?: number;\n disableInitialTransition?: boolean;\n exitOnUnmount?: boolean;\n onOpen?: () => void;\n onOpened?: () => void;\n onClose?: () => void;\n onClosed?: () => void;\n onState?: (state: UseTransitionState) => void;\n}\n\n\nconst style = (obj?: any) => {\n return css(obj || {}, { selector: \"#\" }).classname;\n}\n\nconst getVariant = (rect: DOMRect | null, variant: UseTransitionProps['variant']) => {\n let fn = typeof variant === 'string' ? variants[variant] : variant\n if (!fn) throw new Error(`Transition variant \"${variant}\" not found.`)\n return fn(rect as DOMRect);\n}\n\nconst useTransition = ({ open, ...props }: UseTransitionProps) => {\n let {\n disableInitialTransition = false,\n variant = \"fade\",\n duration = 400,\n delay,\n ease,\n easing,\n exitOnUnmount = false,\n onOpen,\n onOpened,\n onClose,\n onClosed,\n onState\n } = props\n let _ease = ease || (animationEases as any)[easing as any] || animationEases.bounce\n const id = \"xui-transition-\" + useId()\n const [state, setState] = useState({\n initial: false,\n classname: style({ visibility: \"hidden\" }),\n variant: variant,\n rect: null as DOMRect | null,\n stage: open ? \"open\" : \"closed\",\n unmounted: false,\n })\n\n const getEle = () => document.querySelector(`[data-transition=\"${id}\"]`) as HTMLElement;\n const getBoundary = () => state.rect || getEle()?.getBoundingClientRect() || new DOMRect(0, 0, 0, 0);\n\n useEffect(() => {\n if (exitOnUnmount && state.stage === 'closed') {\n if (!open) {\n setState(s => ({\n ...s,\n initial: false,\n classname: \"\",\n unmounted: true,\n variant: variant,\n }))\n } else {\n setState(s => ({\n ...s,\n variant: variant,\n classname: style({ visibility: \"hidden\" }),\n stage: \"open\",\n }))\n }\n }\n }, [open, state.stage, exitOnUnmount, variant])\n\n // initial effect\n useEffect(() => {\n const ele = getEle()\n if (!ele) return\n if (exitOnUnmount && state.stage === 'closed') return\n\n const rect = getBoundary();\n let { from } = getVariant(rect, state.variant)\n if (open && !state.initial) {\n setState(s => ({\n ...s,\n classname: (!disableInitialTransition || state.unmounted) ? style(from) : \"\",\n initial: true,\n rect: rect,\n }))\n let stimer: any = null\n let etimer: any = null\n ele.ontransitionstart = () => {\n clearTimeout(stimer)\n stimer = setTimeout(() => {\n const isOpen = ele.getAttribute('data-transition-state') === 'open';\n (onOpen && isOpen) && onOpen();\n (onClose && !isOpen) && onClose()\n onState && onState(isOpen ? \"open\" : \"close\")\n setState(s => ({\n ...s,\n stage: isOpen ? \"open\" : \"close\"\n }))\n }, 1)\n }\n\n ele.ontransitionend = () => {\n clearTimeout(etimer)\n etimer = setTimeout(() => {\n const isOpen = ele.getAttribute('data-transition-state') === 'open';\n (onOpened && isOpen) && onOpened();\n (onClosed && !isOpen) && onClosed();\n onState && onState(isOpen ? \"opened\" : \"closed\")\n setState(s => ({\n ...s,\n stage: isOpen ? \"opened\" : \"closed\"\n }))\n }, 1)\n }\n } else if (!state.initial) {\n setState(s => ({\n ...s,\n classname: style(from),\n rect: rect,\n }))\n }\n }, [open, state.initial, state.stage, exitOnUnmount])\n\n\n useEffect(() => {\n if (state.initial) {\n let _variant = state.variant !== variant ? variant : state.variant\n const { from, to } = getVariant(state.rect, _variant)\n let _css: CSSProps = open ? to : from\n let trans = ` ${duration}ms ${_ease} ${delay || 0}ms`\n let _ = {\n ..._css,\n transition: Object.keys(_css || {}).map(k => formatCSSProp(k)).join(trans + \", \") + trans,\n }\n setState(s => ({\n ...s,\n classname: style(_),\n variant: _variant\n }))\n }\n }, [open, state.initial, variant])\n\n return {\n exited: exitOnUnmount && state.stage === 'closed',\n props: {\n 'id': state.classname,\n 'data-transition': id,\n 'data-transition-state': open ? 'open' : 'close',\n }\n }\n}\n\n\nexport default useTransition"],"names":[],"mappings":"yOA6BA,MAAM,KAAK,GAAG,CAAC,GAAS,KAAI;AACzB,IAAA,OAAO,GAAG,CAAC,GAAG,IAAI,EAAE,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,CAAC,SAAS;AACrD,CAAC;AAED,MAAM,UAAU,GAAG,CAAC,IAAoB,EAAE,OAAsC,KAAI;AACjF,IAAA,IAAI,EAAE,GAAG,OAAO,OAAO,KAAK,QAAQ,GAAG,QAAQ,CAAC,OAAO,CAAC,GAAG,OAAO;AAClE,IAAA,IAAI,CAAC,EAAE;AAAE,QAAA,MAAM,IAAI,KAAK,CAAC,uBAAuB,OAAO,CAAA,YAAA,CAAc,CAAC;AACtE,IAAA,OAAO,EAAE,CAAC,IAAe,CAAC;AAC7B,CAAC;AAED,MAAM,aAAa,GAAG,CAAC,EAAsC,KAAI;AAA1C,IAAA,IAAA,EAAE,IAAI,EAAA,GAAA,EAAgC,EAA3B,KAAK,GAAA,MAAA,CAAA,EAAA,EAAhB,QAAkB,CAAF;AACpC,IAAA,IAAI,EACD,wBAAwB,GAAG,KAAK,EAChC,OAAO,GAAG,MAAM,EAChB,QAAQ,GAAG,GAAG,EACd,KAAK,EACL,IAAI,EACJ,MAAM,EACN,aAAa,GAAG,KAAK,EACrB,MAAM,EACN,QAAQ,EACR,OAAO,EACP,QAAQ,EACR,OAAO,EACT,GAAG,KAAK;AACT,IAAA,IAAI,KAAK,GAAG,IAAI,IAAK,cAAsB,CAAC,MAAa,CAAC,IAAI,cAAc,CAAC,MAAM;AACnF,IAAA,MAAM,EAAE,GAAG,iBAAiB,GAAG,KAAK,EAAE;AACtC,IAAA,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ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K,CAAC,OAAO;AAClE,YAAA,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,UAAU,CAAC,KAAK,CAAC,IAAI,EAAE,QAAQ,CAAC;YACrD,IAAI,IAAI,GAAa,IAAI,GAAG,EAAE,GAAG,IAAI;YACrC,IAAI,KAAK,GAAG,CAAA,CAAA,EAAI,QAAQ,CAAA,GAAA,EAAM,KAAK,CAAA,CAAA,EAAI,KAAK,IAAI,CAAC,CAAA,EAAA,CAAI;AACrD,YAAA,IAAI,CAAC,GAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EACC,IAAI,CAAA,EAAA,EACP,UAAU,EAAE,MAAM,CAAC,IAAI,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,GAAG,KAAK,GAC3F;YACD,QAAQ,CAAC,CAAC,KAAI,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EACR,CAAC,KACJ,SAAS,EAAE,KAAK,CAAC,CAAC,CAAC,EACnB,OAAO,EAAE,QAAQ,EAAA,CAAA,CAClB,CAAC;QACN;IACH,CAAC,EAAE,CAAC,IAAI,EAAE,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAElC,OAAO;AACJ,QAAA,MAAM,EAAE,aAAa,IAAI,KAAK,CAAC,KAAK,KAAK,QAAQ;AACjD,QAAA,KAAK,EAAE;YACJ,IAAI,EAAE,KAAK,CAAC,SAAS;AACrB,YAAA,iBAAiB,EAAE,EAAE;YACrB,uBAAuB,EAAE,IAAI,GAAG,MAAM,GAAG,OAAO;AAClD;KACH;AACJ"}
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../src/hooks/useTransition/index.ts"],"sourcesContent":["import { useState, useEffect, useId } from 'react';\r\nimport { animationEases } from '../useAnimation';\r\nimport { css } from '../../css';\r\nimport { formatCSSProp } from 'oncss';\r\nimport { CSSProps } from '../../css/types';\r\nimport * as variants from './variants'\r\n\r\nexport type UseTransitionVariantTypes = keyof typeof variants\r\nexport type UseTransitionState = \"open\" | \"opened\" | \"close\" | \"closed\"\r\n\r\nexport type UseTransitionVariant = (rect: DOMRect) => ({ from: CSSProps, to: CSSProps })\r\n\r\nexport type UseTransitionProps = {\r\n open: boolean;\r\n variant: UseTransitionVariant | UseTransitionVariantTypes;\r\n ease?: string;\r\n easing?: keyof typeof animationEases;\r\n duration?: number;\r\n delay?: number;\r\n disableInitialTransition?: boolean;\r\n exitOnUnmount?: boolean;\r\n onOpen?: () => void;\r\n onOpened?: () => void;\r\n onClose?: () => void;\r\n onClosed?: () => void;\r\n onState?: (state: UseTransitionState) => void;\r\n}\r\n\r\n\r\nconst style = (obj?: any) => {\r\n return css(obj || {}, { selector: \"#\" }).classname;\r\n}\r\n\r\nconst getVariant = (rect: DOMRect | null, variant: UseTransitionProps['variant']) => {\r\n let fn = typeof variant === 'string' ? variants[variant] : variant\r\n if (!fn) throw new Error(`Transition variant \"${variant}\" not found.`)\r\n return fn(rect as DOMRect);\r\n}\r\n\r\nconst useTransition = ({ open, ...props }: UseTransitionProps) => {\r\n let {\r\n disableInitialTransition = false,\r\n variant = \"fade\",\r\n duration = 400,\r\n delay,\r\n ease,\r\n easing,\r\n exitOnUnmount = false,\r\n onOpen,\r\n onOpened,\r\n onClose,\r\n onClosed,\r\n onState\r\n } = props\r\n let _ease = ease || (animationEases as any)[easing as any] || animationEases.bounce\r\n const id = \"xui-transition-\" + useId()\r\n const [state, setState] = useState({\r\n initial: false,\r\n classname: style({ visibility: \"hidden\" }),\r\n variant: variant,\r\n rect: null as DOMRect | null,\r\n stage: open ? \"open\" : \"closed\",\r\n unmounted: false,\r\n })\r\n\r\n const getEle = () => document.querySelector(`[data-transition=\"${id}\"]`) as HTMLElement;\r\n const getBoundary = () => state.rect || getEle()?.getBoundingClientRect() || new DOMRect(0, 0, 0, 0);\r\n\r\n useEffect(() => {\r\n if (exitOnUnmount && state.stage === 'closed') {\r\n if (!open) {\r\n setState(s => ({\r\n ...s,\r\n initial: false,\r\n classname: \"\",\r\n unmounted: true,\r\n variant: variant,\r\n }))\r\n } else {\r\n setState(s => ({\r\n ...s,\r\n variant: variant,\r\n classname: style({ visibility: \"hidden\" }),\r\n stage: \"open\",\r\n }))\r\n }\r\n }\r\n }, [open, state.stage, exitOnUnmount, variant])\r\n\r\n // initial effect\r\n useEffect(() => {\r\n const ele = getEle()\r\n if (!ele) return\r\n if (exitOnUnmount && state.stage === 'closed') return\r\n\r\n const rect = getBoundary();\r\n let { from } = getVariant(rect, state.variant)\r\n if (open && !state.initial) {\r\n setState(s => ({\r\n ...s,\r\n classname: (!disableInitialTransition || state.unmounted) ? style(from) : \"\",\r\n initial: true,\r\n rect: rect,\r\n }))\r\n let stimer: any = null\r\n let etimer: any = null\r\n ele.ontransitionstart = () => {\r\n clearTimeout(stimer)\r\n stimer = setTimeout(() => {\r\n const isOpen = ele.getAttribute('data-transition-state') === 'open';\r\n (onOpen && isOpen) && onOpen();\r\n (onClose && !isOpen) && onClose()\r\n onState && onState(isOpen ? \"open\" : \"close\")\r\n setState(s => ({\r\n ...s,\r\n stage: isOpen ? \"open\" : \"close\"\r\n }))\r\n }, 1)\r\n }\r\n\r\n ele.ontransitionend = () => {\r\n clearTimeout(etimer)\r\n etimer = setTimeout(() => {\r\n const isOpen = ele.getAttribute('data-transition-state') === 'open';\r\n (onOpened && isOpen) && onOpened();\r\n (onClosed && !isOpen) && onClosed();\r\n onState && onState(isOpen ? \"opened\" : \"closed\")\r\n setState(s => ({\r\n ...s,\r\n stage: isOpen ? \"opened\" : \"closed\"\r\n }))\r\n }, 1)\r\n }\r\n } else if (!state.initial) {\r\n setState(s => ({\r\n ...s,\r\n classname: style(from),\r\n rect: rect,\r\n }))\r\n }\r\n }, [open, state.initial, state.stage, exitOnUnmount])\r\n\r\n\r\n useEffect(() => {\r\n if (state.initial) {\r\n let _variant = state.variant !== variant ? variant : state.variant\r\n const { from, to } = getVariant(state.rect, _variant)\r\n let _css: CSSProps = open ? to : from\r\n let trans = ` ${duration}ms ${_ease} ${delay || 0}ms`\r\n let _ = {\r\n ..._css,\r\n transition: Object.keys(_css || {}).map(k => formatCSSProp(k)).join(trans + \", \") + trans,\r\n }\r\n setState(s => ({\r\n ...s,\r\n classname: style(_),\r\n variant: _variant\r\n }))\r\n }\r\n }, [open, state.initial, variant])\r\n\r\n return {\r\n exited: exitOnUnmount && state.stage === 'closed',\r\n props: {\r\n 'id': state.classname,\r\n 'data-transition': id,\r\n 'data-transition-state': open ? 'open' : 'close',\r\n }\r\n }\r\n}\r\n\r\n\r\nexport default useTransition"],"names":[],"mappings":"yOA6BA,MAAM,KAAK,GAAG,CAAC,GAAS,KAAI;AACzB,IAAA,OAAO,GAAG,CAAC,GAAG,IAAI,EAAE,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,CAAC,SAAS;AACrD,CAAC;AAED,MAAM,UAAU,GAAG,CAAC,IAAoB,EAAE,OAAsC,KAAI;AACjF,IAAA,IAAI,EAAE,GAAG,OAAO,OAAO,KAAK,QAAQ,GAAG,QAAQ,CAAC,OAAO,CAAC,GAAG,OAAO;AAClE,IAAA,IAAI,CAAC,EAAE;AAAE,QAAA,MAAM,IAAI,KAAK,CAAC,uBAAuB,OAAO,CAAA,YAAA,CAAc,CAAC;AACtE,IAAA,OAAO,EAAE,CAAC,IAAe,CAAC;AAC7B,CAAC;AAED,MAAM,aAAa,GAAG,CAAC,EAAsC,KAAI;AAA1C,IAAA,IAAA,EAAE,IAAI,EAAA,GAAA,EAAgC,EAA3B,KAAK,GAAA,MAAA,CAAA,EAAA,EAAhB,QAAkB,CAAF;AACpC,IAAA,IAAI,EACD,wBAAwB,GAAG,KAAK,EAChC,OAAO,GAAG,MAAM,EAChB,QAAQ,GAAG,GAAG,EACd,KAAK,EACL,IAAI,EACJ,MAAM,EACN,aA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QAAQ;AACjD,QAAA,KAAK,EAAE;YACJ,IAAI,EAAE,KAAK,CAAC,SAAS;AACrB,YAAA,iBAAiB,EAAE,EAAE;YACrB,uBAAuB,EAAE,IAAI,GAAG,MAAM,GAAG,OAAO;AAClD;KACH;AACJ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"variants.js","sources":["../../../src/hooks/useTransition/variants.ts"],"sourcesContent":["\nexport const slideDown = (rect: DOMRect) => {\n\n return {\n from: {\n transform: `translateY(-${rect.height}px)`,\n },\n to: {\n transform: `translateY(0)`,\n }\n }\n}\n\nexport const slideUp = (rect: DOMRect) => {\n return {\n from: {\n transform: `translateY(${rect.height}px)`,\n },\n to: {\n transform: `translateY(0)`,\n }\n }\n}\n\nexport const slideRight = (rect: DOMRect) => {\n return {\n from: {\n transform: `translateX(-${rect.width}px)`,\n },\n to: {\n transform: `translateX(0)`,\n }\n }\n}\n\nexport const slideLeft = (rect: DOMRect) => {\n return {\n from: {\n transform: `translateX(${rect.width}px)`,\n },\n to: {\n transform: `translateX(0)`,\n }\n }\n}\n\nexport const fade = () => {\n return {\n from: {\n opacity: 0\n },\n to: {\n opacity: 1\n }\n }\n}\n\nexport const fadeDown = () => {\n return {\n from: {\n transform: `translateY(-30px)`,\n opacity: 0\n },\n to: {\n transform: `translateY(0)`,\n opacity: 1\n }\n }\n}\n\nexport const fadeUp = () => {\n return {\n from: {\n transform: `translateY(30px)`,\n opacity: 0\n },\n to: {\n transform: `translateY(0)`,\n opacity: 1\n }\n }\n}\n\nexport const fadeRight = () => {\n return {\n from: {\n transform: `translateX(-30px)`,\n opacity: 0\n },\n to: {\n transform: `translateX(0)`,\n opacity: 1\n }\n }\n}\n\nexport const fadeLeft = () => {\n return {\n from: {\n transform: `translateX(30px)`,\n opacity: 0\n },\n to: {\n transform: `translateX(0)`,\n opacity: 1\n }\n }\n}\n\nexport const grow = () => {\n return {\n from: {\n transform: \"scale(.8, .6)\",\n opacity: 0\n },\n to: {\n transform: \"scale(1)\",\n opacity: 1\n }\n }\n}\n\nexport const zoom = () => {\n return {\n from: {\n transform: \"scale(.8)\",\n opacity: 0\n },\n to: {\n transform: \"scale(1)\",\n opacity: 1\n }\n }\n}\n\nexport const zoomOver = () => {\n return {\n from: {\n transform: \"scale(1.2)\",\n opacity: 0\n },\n to: {\n transform: \"scale(1)\",\n opacity: 1\n }\n }\n}\n\nexport const collapseVertical = (rect: DOMRect) => {\n\n return {\n from: {\n maxHeight: 0 + \"px\",\n overflow: \"hidden\"\n },\n to: {\n maxHeight: rect.height,\n overflow: \"hidden\"\n }\n }\n}\n\n\nexport const collapseHorizontal = (rect: DOMRect) => {\n return {\n from: {\n width: 0 + \"px\",\n overflow: \"hidden\"\n },\n to: {\n width: rect?.width ? rect?.width + \"px\" : \"auto\",\n overflow: \"hidden\"\n }\n }\n}\n\n\n\n\n"],"names":[],"mappings":"sEACO,MAAM,SAAS,GAAG,CAAC,IAAa,KAAI;IAEvC,OAAO;AACH,QAAA,IAAI,EAAE;AACF,YAAA,SAAS,EAAE,CAAA,YAAA,EAAe,IAAI,CAAC,MAAM,CAAA,GAAA,CAAK;AAC7C,SAAA;AACD,QAAA,EAAE,EAAE;AACA,YAAA,SAAS,EAAE,CAAA,aAAA,CAAe;AAC7B;KACJ;AACL;AAEO,MAAM,OAAO,GAAG,CAAC,IAAa,KAAI;IACrC,OAAO;AACH,QAAA,IAAI,EAAE;AACF,YAAA,SAAS,EAAE,CAAA,WAAA,EAAc,IAAI,CAAC,MAAM,CAAA,GAAA,CAAK;AAC5C,SAAA;AACD,QAAA,EAAE,EAAE;AACA,YAAA,SAAS,EAAE,CAAA,aAAA,CAAe;AAC7B;KACJ;AACL;AAEO,MAAM,UAAU,GAAG,CAAC,IAAa,KAAI;IACxC,OAAO;AACH,QAAA,IAAI,EAAE;AACF,YAAA,SAAS,EAAE,CAAA,YAAA,EAAe,IAAI,CAAC,KAAK,CAAA,GAAA,CAAK;AAC5C,SAAA;AACD,QAAA,EAAE,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ACH,QAAA,IAAI,EAAE;YACF,KAAK,EAAE,CAAC,GAAG,IAAI;AACf,YAAA,QAAQ,EAAE;AACb,SAAA;AACD,QAAA,EAAE,EAAE;YACA,KAAK,EAAE,CAAA,IAAI,KAAA,IAAA,IAAJ,IAAI,uBAAJ,IAAI,CAAE,KAAK,IAAG,CAAA,IAAI,KAAA,IAAA,IAAJ,IAAI,KAAA,MAAA,GAAA,MAAA,GAAJ,IAAI,CAAE,KAAK,IAAG,IAAI,GAAG,MAAM;AAChD,YAAA,QAAQ,EAAE;AACb;KACJ;AACL"}
|
|
1
|
+
{"version":3,"file":"variants.js","sources":["../../../src/hooks/useTransition/variants.ts"],"sourcesContent":["\r\nexport const slideDown = (rect: DOMRect) => {\r\n\r\n return {\r\n from: {\r\n transform: `translateY(-${rect.height}px)`,\r\n },\r\n to: {\r\n transform: `translateY(0)`,\r\n }\r\n }\r\n}\r\n\r\nexport const slideUp = (rect: DOMRect) => {\r\n return {\r\n from: {\r\n transform: `translateY(${rect.height}px)`,\r\n },\r\n to: {\r\n transform: `translateY(0)`,\r\n }\r\n }\r\n}\r\n\r\nexport const slideRight = (rect: DOMRect) => {\r\n return {\r\n from: {\r\n transform: `translateX(-${rect.width}px)`,\r\n },\r\n to: {\r\n transform: `translateX(0)`,\r\n }\r\n }\r\n}\r\n\r\nexport const slideLeft = (rect: DOMRect) => {\r\n return {\r\n from: {\r\n transform: `translateX(${rect.width}px)`,\r\n },\r\n to: {\r\n transform: `translateX(0)`,\r\n }\r\n }\r\n}\r\n\r\nexport const fade = () => {\r\n return {\r\n from: {\r\n opacity: 0\r\n },\r\n to: {\r\n opacity: 1\r\n }\r\n }\r\n}\r\n\r\nexport const fadeDown = () => {\r\n return {\r\n from: {\r\n transform: `translateY(-30px)`,\r\n opacity: 0\r\n },\r\n to: {\r\n transform: `translateY(0)`,\r\n opacity: 1\r\n }\r\n }\r\n}\r\n\r\nexport const fadeUp = () => {\r\n return {\r\n from: {\r\n transform: `translateY(30px)`,\r\n opacity: 0\r\n },\r\n to: {\r\n transform: `translateY(0)`,\r\n opacity: 1\r\n }\r\n }\r\n}\r\n\r\nexport const fadeRight = () => {\r\n return {\r\n from: {\r\n transform: `translateX(-30px)`,\r\n opacity: 0\r\n },\r\n to: {\r\n transform: `translateX(0)`,\r\n opacity: 1\r\n }\r\n }\r\n}\r\n\r\nexport const fadeLeft = () => {\r\n return {\r\n from: {\r\n transform: `translateX(30px)`,\r\n opacity: 0\r\n },\r\n to: {\r\n transform: `translateX(0)`,\r\n opacity: 1\r\n }\r\n }\r\n}\r\n\r\nexport const grow = () => {\r\n return {\r\n from: {\r\n transform: \"scale(.8, .6)\",\r\n opacity: 0\r\n },\r\n to: {\r\n transform: \"scale(1)\",\r\n opacity: 1\r\n }\r\n }\r\n}\r\n\r\nexport const zoom = () => {\r\n return {\r\n from: {\r\n transform: \"scale(.8)\",\r\n opacity: 0\r\n },\r\n to: {\r\n transform: \"scale(1)\",\r\n opacity: 1\r\n }\r\n }\r\n}\r\n\r\nexport const zoomOver = () => {\r\n return {\r\n from: {\r\n transform: \"scale(1.2)\",\r\n opacity: 0\r\n },\r\n to: {\r\n transform: \"scale(1)\",\r\n opacity: 1\r\n }\r\n }\r\n}\r\n\r\nexport const collapseVertical = (rect: DOMRect) => {\r\n\r\n return {\r\n from: {\r\n maxHeight: 0 + \"px\",\r\n overflow: \"hidden\"\r\n },\r\n to: {\r\n maxHeight: rect.height,\r\n overflow: \"hidden\"\r\n }\r\n }\r\n}\r\n\r\n\r\nexport const collapseHorizontal = (rect: DOMRect) => {\r\n return {\r\n from: {\r\n width: 0 + \"px\",\r\n overflow: \"hidden\"\r\n },\r\n to: {\r\n width: rect?.width ? rect?.width + \"px\" : \"auto\",\r\n overflow: \"hidden\"\r\n }\r\n }\r\n}\r\n\r\n\r\n\r\n\r\n"],"names":[],"mappings":"sEACO,MAAM,SAAS,GAAG,CAAC,IAAa,KAAI;IAEvC,OAAO;AACH,QAAA,IAAI,EAAE;AACF,YAAA,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AA,SAAS,EAAE,UAAU;AACrB,YAAA,OAAO,EAAE;AACZ;KACJ;AACL;AAEO,MAAM,QAAQ,GAAG,MAAK;IACzB,OAAO;AACH,QAAA,IAAI,EAAE;AACF,YAAA,SAAS,EAAE,YAAY;AACvB,YAAA,OAAO,EAAE;AACZ,SAAA;AACD,QAAA,EAAE,EAAE;AACA,YAAA,SAAS,EAAE,UAAU;AACrB,YAAA,OAAO,EAAE;AACZ;KACJ;AACL;AAEO,MAAM,gBAAgB,GAAG,CAAC,IAAa,KAAI;IAE9C,OAAO;AACH,QAAA,IAAI,EAAE;YACF,SAAS,EAAE,CAAC,GAAG,IAAI;AACnB,YAAA,QAAQ,EAAE;AACb,SAAA;AACD,QAAA,EAAE,EAAE;YACA,SAAS,EAAE,IAAI,CAAC,MAAM;AACtB,YAAA,QAAQ,EAAE;AACb;KACJ;AACL;AAGO,MAAM,kBAAkB,GAAG,CAAC,IAAa,KAAI;IAChD,OAAO;AACH,QAAA,IAAI,EAAE;YACF,KAAK,EAAE,CAAC,GAAG,IAAI;AACf,YAAA,QAAQ,EAAE;AACb,SAAA;AACD,QAAA,EAAE,EAAE;YACA,KAAK,EAAE,CAAA,IAAI,KAAA,IAAA,IAAJ,IAAI,uBAAJ,IAAI,CAAE,KAAK,IAAG,CAAA,IAAI,KAAA,IAAA,IAAJ,IAAI,KAAA,MAAA,GAAA,MAAA,GAAJ,IAAI,CAAE,KAAK,IAAG,IAAI,GAAG,MAAM;AAChD,YAAA,QAAQ,EAAE;AACb;KACJ;AACL"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"variants.mjs","sources":["../../../src/hooks/useTransition/variants.ts"],"sourcesContent":["\nexport const slideDown = (rect: DOMRect) => {\n\n return {\n from: {\n transform: `translateY(-${rect.height}px)`,\n },\n to: {\n transform: `translateY(0)`,\n }\n }\n}\n\nexport const slideUp = (rect: DOMRect) => {\n return {\n from: {\n transform: `translateY(${rect.height}px)`,\n },\n to: {\n transform: `translateY(0)`,\n }\n }\n}\n\nexport const slideRight = (rect: DOMRect) => {\n return {\n from: {\n transform: `translateX(-${rect.width}px)`,\n },\n to: {\n transform: `translateX(0)`,\n }\n }\n}\n\nexport const slideLeft = (rect: DOMRect) => {\n return {\n from: {\n transform: `translateX(${rect.width}px)`,\n },\n to: {\n transform: `translateX(0)`,\n }\n }\n}\n\nexport const fade = () => {\n return {\n from: {\n opacity: 0\n },\n to: {\n opacity: 1\n }\n }\n}\n\nexport const fadeDown = () => {\n return {\n from: {\n transform: `translateY(-30px)`,\n opacity: 0\n },\n to: {\n transform: `translateY(0)`,\n opacity: 1\n }\n }\n}\n\nexport const fadeUp = () => {\n return {\n from: {\n transform: `translateY(30px)`,\n opacity: 0\n },\n to: {\n transform: `translateY(0)`,\n opacity: 1\n }\n }\n}\n\nexport const fadeRight = () => {\n return {\n from: {\n transform: `translateX(-30px)`,\n opacity: 0\n },\n to: {\n transform: `translateX(0)`,\n opacity: 1\n }\n }\n}\n\nexport const fadeLeft = () => {\n return {\n from: {\n transform: `translateX(30px)`,\n opacity: 0\n },\n to: {\n transform: `translateX(0)`,\n opacity: 1\n }\n }\n}\n\nexport const grow = () => {\n return {\n from: {\n transform: \"scale(.8, .6)\",\n opacity: 0\n },\n to: {\n transform: \"scale(1)\",\n opacity: 1\n }\n }\n}\n\nexport const zoom = () => {\n return {\n from: {\n transform: \"scale(.8)\",\n opacity: 0\n },\n to: {\n transform: \"scale(1)\",\n opacity: 1\n }\n }\n}\n\nexport const zoomOver = () => {\n return {\n from: {\n transform: \"scale(1.2)\",\n opacity: 0\n },\n to: {\n transform: \"scale(1)\",\n opacity: 1\n }\n }\n}\n\nexport const collapseVertical = (rect: DOMRect) => {\n\n return {\n from: {\n maxHeight: 0 + \"px\",\n overflow: \"hidden\"\n },\n to: {\n maxHeight: rect.height,\n overflow: \"hidden\"\n }\n }\n}\n\n\nexport const collapseHorizontal = (rect: DOMRect) => {\n return {\n from: {\n width: 0 + \"px\",\n overflow: \"hidden\"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AO,EAAE;AACZ;KACJ;AACL;AAEO,MAAM,IAAI,GAAG,MAAK;IACrB,OAAO;AACH,QAAA,IAAI,EAAE;AACF,YAAA,SAAS,EAAE,WAAW;AACtB,YAAA,OAAO,EAAE;AACZ,SAAA;AACD,QAAA,EAAE,EAAE;AACA,YAAA,SAAS,EAAE,UAAU;AACrB,YAAA,OAAO,EAAE;AACZ;KACJ;AACL;AAEO,MAAM,QAAQ,GAAG,MAAK;IACzB,OAAO;AACH,QAAA,IAAI,EAAE;AACF,YAAA,SAAS,EAAE,YAAY;AACvB,YAAA,OAAO,EAAE;AACZ,SAAA;AACD,QAAA,EAAE,EAAE;AACA,YAAA,SAAS,EAAE,UAAU;AACrB,YAAA,OAAO,EAAE;AACZ;KACJ;AACL;AAEO,MAAM,gBAAgB,GAAG,CAAC,IAAa,KAAI;IAE9C,OAAO;AACH,QAAA,IAAI,EAAE;YACF,SAAS,EAAE,CAAC,GAAG,IAAI;AACnB,YAAA,QAAQ,EAAE;AACb,SAAA;AACD,QAAA,EAAE,EAAE;YACA,SAAS,EAAE,IAAI,CAAC,MAAM;AACtB,YAAA,QAAQ,EAAE;AACb;KACJ;AACL;AAGO,MAAM,kBAAkB,GAAG,CAAC,IAAa,KAAI;IAChD,OAAO;AACH,QAAA,IAAI,EAAE;YACF,KAAK,EAAE,CAAC,GAAG,IAAI;AACf,YAAA,QAAQ,EAAE;AACb,SAAA;AACD,QAAA,EAAE,EAAE;YACA,KAAK,EAAE,CAAA,IAAI,KAAA,IAAA,IAAJ,IAAI,uBAAJ,IAAI,CAAE,KAAK,IAAG,CAAA,IAAI,KAAA,IAAA,IAAJ,IAAI,KAAA,MAAA,GAAA,MAAA,GAAJ,IAAI,CAAE,KAAK,IAAG,IAAI,GAAG,MAAM;AAChD,YAAA,QAAQ,EAAE;AACb;KACJ;AACL"}
|
|
1
|
+
{"version":3,"file":"variants.mjs","sources":["../../../src/hooks/useTransition/variants.ts"],"sourcesContent":["\r\nexport const slideDown = (rect: DOMRect) => {\r\n\r\n return {\r\n from: {\r\n transform: `translateY(-${rect.height}px)`,\r\n },\r\n to: {\r\n transform: `translateY(0)`,\r\n }\r\n }\r\n}\r\n\r\nexport const slideUp = (rect: DOMRect) => {\r\n return {\r\n from: {\r\n transform: `translateY(${rect.height}px)`,\r\n },\r\n to: {\r\n transform: `translateY(0)`,\r\n }\r\n }\r\n}\r\n\r\nexport const slideRight = (rect: DOMRect) => {\r\n return {\r\n from: {\r\n transform: `translateX(-${rect.width}px)`,\r\n },\r\n to: {\r\n transform: `translateX(0)`,\r\n }\r\n }\r\n}\r\n\r\nexport const slideLeft = (rect: DOMRect) => {\r\n return {\r\n from: {\r\n transform: `translateX(${rect.width}px)`,\r\n },\r\n to: {\r\n transform: `translateX(0)`,\r\n }\r\n }\r\n}\r\n\r\nexport const fade = () => {\r\n return {\r\n from: {\r\n opacity: 0\r\n },\r\n to: {\r\n opacity: 1\r\n }\r\n }\r\n}\r\n\r\nexport const fadeDown = () => {\r\n return {\r\n from: {\r\n transform: `translateY(-30px)`,\r\n opacity: 0\r\n },\r\n to: {\r\n transform: `translateY(0)`,\r\n opacity: 1\r\n }\r\n }\r\n}\r\n\r\nexport const fadeUp = () => {\r\n return {\r\n from: {\r\n transform: `translateY(30px)`,\r\n opacity: 0\r\n },\r\n to: {\r\n transform: `translateY(0)`,\r\n opacity: 1\r\n }\r\n }\r\n}\r\n\r\nexport const fadeRight = () => {\r\n return {\r\n from: {\r\n transform: `translateX(-30px)`,\r\n opacity: 0\r\n },\r\n to: {\r\n transform: `translateX(0)`,\r\n opacity: 1\r\n }\r\n }\r\n}\r\n\r\nexport const fadeLeft = () => {\r\n return {\r\n from: {\r\n transform: `translateX(30px)`,\r\n opacity: 0\r\n },\r\n to: {\r\n transform: `translateX(0)`,\r\n opacity: 1\r\n }\r\n }\r\n}\r\n\r\nexport const grow = () => {\r\n return {\r\n from: {\r\n transform: \"scale(.8, .6)\",\r\n opacity: 0\r\n },\r\n to: {\r\n transform: \"scale(1)\",\r\n opacity: 1\r\n }\r\n }\r\n}\r\n\r\nexport const zoom = () => {\r\n return {\r\n from: {\r\n transform: \"scale(.8)\",\r\n opacity: 0\r\n },\r\n to: {\r\n transform: \"scale(1)\",\r\n opacity: 1\r\n }\r\n }\r\n}\r\n\r\nexport const zoomOver = () => {\r\n return {\r\n from: {\r\n transform: \"scale(1.2)\",\r\n opacity: 0\r\n },\r\n to: {\r\n transform: \"scale(1)\",\r\n opacity: 1\r\n }\r\n }\r\n}\r\n\r\nexport const collapseVertical = (rect: DOMRect) => {\r\n\r\n return {\r\n from: {\r\n maxHeight: 0 + \"px\",\r\n overflow: \"hidden\"\r\n },\r\n to: {\r\n maxHeight: rect.height,\r\n overflow: \"hidden\"\r\n }\r\n }\r\n}\r\n\r\n\r\nexport const collapseHorizontal = (rect: DOMRect) => {\r\n return {\r\n from: {\r\n width: 0 + \"px\",\r\n overflow: \"hidden\"\r\n },\r\n to: {\r\n width: rect?.width ? rect?.width + \"px\" : \"auto\",\r\n overflow: \"hidden\"\r\n }\r\n }\r\n}\r\n\r\n\r\n\r\n\r\n"],"names":[],"mappings":"AACO,MAAM,SAAS,GAAG,CAAC,IAAa,KAAI;IAEvC,OAAO;AACH,QAAA,IAAI,EAAE;AACF,YAAA,SAAS,EAAE,CAAA,YAAA,EAAe,IAAI,CAAC,MAAM,CAAA,GAAA,CAAK;AAC7C,SAAA;AACD,QAAA,EAAE,EAAE;AACA,YAAA,SAAS,EAAE,CAAA,aAAA,CAAe;AAC7B;KACJ;AACL;AAEO,MAAM,OAAO,GAAG,CAAC,IAAa,KAAI;IACrC,OAAO;AACH,QAAA,IAAI,EAAE;AACF,YAAA,SAAS,EAAE,CAAA,WAAA,EAAc,IAAI,CAAC,MAAM,CAAA,GAAA,CAAK;AAC5C,SAAA;AACD,QAAA,EAAE,EAAE;AACA,YAAA,SAAS,EAAE,CAAA,aAAA,CAAe;AAC7B;KACJ;AACL;AAEO,MAAM,UAAU,GAAG,CAAC,IAAa,KAA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AAE,EAAE;YACA,SAAS,EAAE,IAAI,CAAC,MAAM;AACtB,YAAA,QAAQ,EAAE;AACb;KACJ;AACL;AAGO,MAAM,kBAAkB,GAAG,CAAC,IAAa,KAAI;IAChD,OAAO;AACH,QAAA,IAAI,EAAE;YACF,KAAK,EAAE,CAAC,GAAG,IAAI;AACf,YAAA,QAAQ,EAAE;AACb,SAAA;AACD,QAAA,EAAE,EAAE;YACA,KAAK,EAAE,CAAA,IAAI,KAAA,IAAA,IAAJ,IAAI,uBAAJ,IAAI,CAAE,KAAK,IAAG,CAAA,IAAI,KAAA,IAAA,IAAJ,IAAI,KAAA,MAAA,GAAA,MAAA,GAAJ,IAAI,CAAE,KAAK,IAAG,IAAI,GAAG,MAAM;AAChD,YAAA,QAAQ,EAAE;AACb;KACJ;AACL"}
|
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -1,109 +1,109 @@
|
|
|
1
|
-
# Xanui Core
|
|
2
|
-
|
|
3
|
-
Xanui Core is a lightweight styling and theming toolkit for React. It bundles a constraint-based CSS generator, a TypeScript-friendly `<Tag>` primitive, responsive helpers, and an opinionated theme engine so that design tokens, animations, and layout logic stay consistent across your application.
|
|
4
|
-
|
|
5
|
-
## Highlights
|
|
6
|
-
|
|
7
|
-
- Build any element with `<Tag>` and the ergonomic `sx`/alias props while still passing native attributes.
|
|
8
|
-
- Author design tokens once via `createTheme`, ship them with `ThemeProvider`, and switch them at runtime with `createThemeSwitcher`.
|
|
9
|
-
- Drive responsive layouts using `BreakpointProvider`, `useBreakpoint`, and `useBreakpointProps` without bespoke media queries.
|
|
10
|
-
- Compose micro-animations through `useAnimation`, ready-made `Transition` variants, and reusable CSS utilities.
|
|
11
|
-
- Support SSR portals by rehydrating critical styles with `RenderServerStyles`.
|
|
12
|
-
|
|
13
|
-
## Installation
|
|
14
|
-
|
|
15
|
-
```bash
|
|
16
|
-
npm install @xanui/core
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
## Quick Start
|
|
20
|
-
|
|
21
|
-
```tsx
|
|
22
|
-
import { ThemeProvider, Tag, createTheme, createThemeSwitcher } from '@xanui/core'
|
|
23
|
-
|
|
24
|
-
// Register a custom theme once at startup
|
|
25
|
-
createTheme('brand', {
|
|
26
|
-
colors: {
|
|
27
|
-
brand: { primary: '#7C3AED', secondary: '#5B21B6' },
|
|
28
|
-
},
|
|
29
|
-
})
|
|
30
|
-
|
|
31
|
-
const useThemeSwitcher = createThemeSwitcher('brand', ThemeSwitcherOption)
|
|
32
|
-
|
|
33
|
-
export const App = () => {
|
|
34
|
-
const { name, change } = useThemeSwitcher()
|
|
35
|
-
|
|
36
|
-
return (
|
|
37
|
-
<ThemeProvider theme={name} isRootProvider>
|
|
38
|
-
<Tag
|
|
39
|
-
component="main"
|
|
40
|
-
px={24}
|
|
41
|
-
py={32}
|
|
42
|
-
bgcolor="background"
|
|
43
|
-
color="text.primary"
|
|
44
|
-
gap={24}
|
|
45
|
-
>
|
|
46
|
-
<Tag component="h1" fontSize="h2">
|
|
47
|
-
Xanui Core
|
|
48
|
-
</Tag>
|
|
49
|
-
|
|
50
|
-
<button onClick={() => change(name === 'brand' ? 'dark' : 'brand')}>
|
|
51
|
-
Toggle Theme
|
|
52
|
-
</button>
|
|
53
|
-
</Tag>
|
|
54
|
-
</ThemeProvider>
|
|
55
|
-
)
|
|
56
|
-
}
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
## Core Concepts
|
|
60
|
-
|
|
61
|
-
- **Design Tokens** – `createTheme` merges your overrides with defaults and exposes typed references like `brand.primary` or typography presets.
|
|
62
|
-
- **Adaptive Layout** – Wrap your app with `BreakpointProvider` (automatically included by `ThemeProvider` when `isRootProvider` is `true`) to consume breakpoint helpers throughout the tree.
|
|
63
|
-
- **Composable Styles** – `css`, `getValue`, and `getProps` transform alias props, breakpoints, and pseudo selectors into atomic class names. Use them directly for utilities such as scrollbars or keyframes.
|
|
64
|
-
- **Animation Primitives** – `useAnimation` builds scoped keyframes on the fly; `Transition` controls mount/unmount sequences with variants such as `fade`, `slideDown`, or `collapseVertical`.
|
|
65
|
-
|
|
66
|
-
## Server-Side Rendering
|
|
67
|
-
|
|
68
|
-
When rendering on the server, collect the emitted styles:
|
|
69
|
-
|
|
70
|
-
```tsx
|
|
71
|
-
import RenderServerStyles from '@xanui/core/RenderServerStyles'
|
|
72
|
-
|
|
73
|
-
export const Document = () => (
|
|
74
|
-
<html>
|
|
75
|
-
<head>
|
|
76
|
-
<RenderServerStyles />
|
|
77
|
-
</head>
|
|
78
|
-
<body>{/* app */}</body>
|
|
79
|
-
</html>
|
|
80
|
-
)
|
|
81
|
-
```
|
|
82
|
-
|
|
83
|
-
## Documentation
|
|
84
|
-
|
|
85
|
-
Detailed API docs (props tables, option summaries, and usage examples) live inside the `docs/` directory. Each API/component has its own `README.md` for fast reference:
|
|
86
|
-
|
|
87
|
-
- `docs/tag/README.md`
|
|
88
|
-
- `docs/theme-provider/README.md`
|
|
89
|
-
- `docs/transition/README.md`
|
|
90
|
-
- `docs/use-animation/README.md`
|
|
91
|
-
- `docs/use-color-template/README.md`
|
|
92
|
-
- `docs/use-interface/README.md`
|
|
93
|
-
- `docs/use-breakpoint/README.md`
|
|
94
|
-
- `docs/use-breakpoint-props/README.md`
|
|
95
|
-
- `docs/use-scrollbar/README.md`
|
|
96
|
-
- `docs/render-server-styles/README.md`
|
|
97
|
-
- `docs/css/README.md`
|
|
98
|
-
- `docs/create-theme/README.md`
|
|
99
|
-
|
|
100
|
-
## Contributing
|
|
101
|
-
|
|
102
|
-
1. Fork and clone the repo.
|
|
103
|
-
2. Run `npm install`.
|
|
104
|
-
3. Use `npm run build` to verify type safety.
|
|
105
|
-
4. Submit a pull request that focuses on one improvement at a time.
|
|
106
|
-
|
|
107
|
-
---
|
|
108
|
-
|
|
109
|
-
Need another integration example or a new preset? Open an issue so we can keep the primitives lean and discoverable.
|
|
1
|
+
# Xanui Core
|
|
2
|
+
|
|
3
|
+
Xanui Core is a lightweight styling and theming toolkit for React. It bundles a constraint-based CSS generator, a TypeScript-friendly `<Tag>` primitive, responsive helpers, and an opinionated theme engine so that design tokens, animations, and layout logic stay consistent across your application.
|
|
4
|
+
|
|
5
|
+
## Highlights
|
|
6
|
+
|
|
7
|
+
- Build any element with `<Tag>` and the ergonomic `sx`/alias props while still passing native attributes.
|
|
8
|
+
- Author design tokens once via `createTheme`, ship them with `ThemeProvider`, and switch them at runtime with `createThemeSwitcher`.
|
|
9
|
+
- Drive responsive layouts using `BreakpointProvider`, `useBreakpoint`, and `useBreakpointProps` without bespoke media queries.
|
|
10
|
+
- Compose micro-animations through `useAnimation`, ready-made `Transition` variants, and reusable CSS utilities.
|
|
11
|
+
- Support SSR portals by rehydrating critical styles with `RenderServerStyles`.
|
|
12
|
+
|
|
13
|
+
## Installation
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm install @xanui/core
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Quick Start
|
|
20
|
+
|
|
21
|
+
```tsx
|
|
22
|
+
import { ThemeProvider, Tag, createTheme, createThemeSwitcher } from '@xanui/core'
|
|
23
|
+
|
|
24
|
+
// Register a custom theme once at startup
|
|
25
|
+
createTheme('brand', {
|
|
26
|
+
colors: {
|
|
27
|
+
brand: { primary: '#7C3AED', secondary: '#5B21B6' },
|
|
28
|
+
},
|
|
29
|
+
})
|
|
30
|
+
|
|
31
|
+
const useThemeSwitcher = createThemeSwitcher('brand', ThemeSwitcherOption)
|
|
32
|
+
|
|
33
|
+
export const App = () => {
|
|
34
|
+
const { name, change } = useThemeSwitcher()
|
|
35
|
+
|
|
36
|
+
return (
|
|
37
|
+
<ThemeProvider theme={name} isRootProvider>
|
|
38
|
+
<Tag
|
|
39
|
+
component="main"
|
|
40
|
+
px={24}
|
|
41
|
+
py={32}
|
|
42
|
+
bgcolor="background"
|
|
43
|
+
color="text.primary"
|
|
44
|
+
gap={24}
|
|
45
|
+
>
|
|
46
|
+
<Tag component="h1" fontSize="h2">
|
|
47
|
+
Xanui Core
|
|
48
|
+
</Tag>
|
|
49
|
+
|
|
50
|
+
<button onClick={() => change(name === 'brand' ? 'dark' : 'brand')}>
|
|
51
|
+
Toggle Theme
|
|
52
|
+
</button>
|
|
53
|
+
</Tag>
|
|
54
|
+
</ThemeProvider>
|
|
55
|
+
)
|
|
56
|
+
}
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Core Concepts
|
|
60
|
+
|
|
61
|
+
- **Design Tokens** – `createTheme` merges your overrides with defaults and exposes typed references like `brand.primary` or typography presets.
|
|
62
|
+
- **Adaptive Layout** – Wrap your app with `BreakpointProvider` (automatically included by `ThemeProvider` when `isRootProvider` is `true`) to consume breakpoint helpers throughout the tree.
|
|
63
|
+
- **Composable Styles** – `css`, `getValue`, and `getProps` transform alias props, breakpoints, and pseudo selectors into atomic class names. Use them directly for utilities such as scrollbars or keyframes.
|
|
64
|
+
- **Animation Primitives** – `useAnimation` builds scoped keyframes on the fly; `Transition` controls mount/unmount sequences with variants such as `fade`, `slideDown`, or `collapseVertical`.
|
|
65
|
+
|
|
66
|
+
## Server-Side Rendering
|
|
67
|
+
|
|
68
|
+
When rendering on the server, collect the emitted styles:
|
|
69
|
+
|
|
70
|
+
```tsx
|
|
71
|
+
import RenderServerStyles from '@xanui/core/RenderServerStyles'
|
|
72
|
+
|
|
73
|
+
export const Document = () => (
|
|
74
|
+
<html>
|
|
75
|
+
<head>
|
|
76
|
+
<RenderServerStyles />
|
|
77
|
+
</head>
|
|
78
|
+
<body>{/* app */}</body>
|
|
79
|
+
</html>
|
|
80
|
+
)
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
## Documentation
|
|
84
|
+
|
|
85
|
+
Detailed API docs (props tables, option summaries, and usage examples) live inside the `docs/` directory. Each API/component has its own `README.md` for fast reference:
|
|
86
|
+
|
|
87
|
+
- `docs/tag/README.md`
|
|
88
|
+
- `docs/theme-provider/README.md`
|
|
89
|
+
- `docs/transition/README.md`
|
|
90
|
+
- `docs/use-animation/README.md`
|
|
91
|
+
- `docs/use-color-template/README.md`
|
|
92
|
+
- `docs/use-interface/README.md`
|
|
93
|
+
- `docs/use-breakpoint/README.md`
|
|
94
|
+
- `docs/use-breakpoint-props/README.md`
|
|
95
|
+
- `docs/use-scrollbar/README.md`
|
|
96
|
+
- `docs/render-server-styles/README.md`
|
|
97
|
+
- `docs/css/README.md`
|
|
98
|
+
- `docs/create-theme/README.md`
|
|
99
|
+
|
|
100
|
+
## Contributing
|
|
101
|
+
|
|
102
|
+
1. Fork and clone the repo.
|
|
103
|
+
2. Run `npm install`.
|
|
104
|
+
3. Use `npm run build` to verify type safety.
|
|
105
|
+
4. Submit a pull request that focuses on one improvement at a time.
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
|
|
109
|
+
Need another integration example or a new preset? Open an issue so we can keep the primitives lean and discoverable.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThemeCssVars.js","sources":["../../src/theme/ThemeCssVars.ts"],"sourcesContent":["import { ThemeOptions } from \"./types\";\n\nconst ThemeCssVars = (theme: ThemeOptions) => {\n\n const shadows: any = {}\n theme.shadow.forEach((s, i) => shadows[`--shadow-${i}`] = s)\n\n return {\n \"--bp-xs\": theme.breakpoints.xs,\n \"--bp-sm\": theme.breakpoints.sm,\n \"--bp-md\": theme.breakpoints.md,\n \"--bp-lg\": theme.breakpoints.lg,\n \"--bp-xl\": theme.breakpoints.xl,\n\n \"--font-h1\": `${theme.typography.h1.fontWeight} ${theme.typography.h1.fontSize}px/${theme.typography.h1.lineHeight} inherit`,\n \"--font-h2\": `${theme.typography.h2.fontWeight} ${theme.typography.h2.fontSize}px/${theme.typography.h2.lineHeight} inherit`,\n \"--font-h3\": `${theme.typography.h3.fontWeight} ${theme.typography.h3.fontSize}px/${theme.typography.h3.lineHeight} inherit`,\n \"--font-h4\": `${theme.typography.h4.fontWeight} ${theme.typography.h4.fontSize}px/${theme.typography.h4.lineHeight} inherit`,\n \"--font-h5\": `${theme.typography.h5.fontWeight} ${theme.typography.h5.fontSize}px/${theme.typography.h5.lineHeight} inherit`,\n \"--font-h6\": `${theme.typography.h6.fontWeight} ${theme.typography.h6.fontSize}px/${theme.typography.h6.lineHeight} inherit`,\n \"--font-big\": `${theme.typography.big.fontWeight} ${theme.typography.text.fontSize}px/${theme.typography.text.lineHeight} inherit`,\n \"--font-text\": `${theme.typography.text.fontWeight} ${theme.typography.text.fontSize}px/${theme.typography.text.lineHeight} inherit`,\n \"--font-button\": `${theme.typography.button.fontWeight} ${theme.typography.button.fontSize}px/${theme.typography.button.lineHeight} inherit`,\n \"--font-small\": `${theme.typography.small.fontWeight} ${theme.typography.small.fontSize}px/${theme.typography.small.lineHeight} inherit`,\n\n \"--fontsize-h1\": `${theme.typography.h1.fontSize}px`,\n \"--fontsize-h2\": `${theme.typography.h2.fontSize}px`,\n \"--fontsize-h3\": `${theme.typography.h3.fontSize}px`,\n \"--fontsize-h4\": `${theme.typography.h4.fontSize}px`,\n \"--fontsize-h5\": `${theme.typography.h5.fontSize}px`,\n \"--fontsize-h6\": `${theme.typography.h6.fontSize}px`,\n \"--fontsize-big\": `${theme.typography.big.fontSize}px`,\n \"--fontsize-text\": `${theme.typography.text.fontSize}px`,\n \"--fontsize-button\": `${theme.typography.button.fontSize}px`,\n \"--fontsize-small\": `${theme.typography.small.fontSize}px`,\n\n \"--fontweight-h1\": theme.typography.h1.fontWeight + \"\",\n \"--fontweight-h2\": theme.typography.h2.fontWeight + \"\",\n \"--fontweight-h3\": theme.typography.h3.fontWeight + \"\",\n \"--fontweight-h4\": theme.typography.h4.fontWeight + \"\",\n \"--fontweight-h5\": theme.typography.h5.fontWeight + \"\",\n \"--fontweight-h6\": theme.typography.h6.fontWeight + \"\",\n \"--fontweight-big\": theme.typography.big.fontWeight + \"\",\n \"--fontweight-text\": theme.typography.text.fontWeight + \"\",\n \"--fontweight-button\": theme.typography.button.fontWeight + \"\",\n \"--fontweight-small\": theme.typography.small.fontWeight + \"\",\n\n \"--lineheight-h1\": theme.typography.h1.lineHeight + \"\",\n \"--lineheight-h2\": theme.typography.h2.lineHeight + \"\",\n \"--lineheight-h3\": theme.typography.h3.lineHeight + \"\",\n \"--lineheight-h4\": theme.typography.h4.lineHeight + \"\",\n \"--lineheight-h5\": theme.typography.h5.lineHeight + \"\",\n \"--lineheight-h6\": theme.typography.h6.lineHeight + \"\",\n \"--lineheight-big\": theme.typography.big.lineHeight + \"\",\n \"--lineheight-text\": theme.typography.text.lineHeight + \"\",\n \"--lineheight-button\": theme.typography.button.lineHeight + \"\",\n \"--lineheight-small\": theme.typography.small.lineHeight + \"\",\n\n \"--color-background-primary\": theme.colors.background.primary,\n \"--color-background-secondary\": theme.colors.background.secondary,\n\n \"--color-text-primary\": theme.colors.text.primary,\n \"--color-text-secondary\": theme.colors.text.secondary,\n\n \"--color-divider-primary\": theme.colors.divider.primary,\n \"--color-divider-secondary\": theme.colors.divider.secondary,\n \"--color-divider-soft-primary\": theme.colors.divider.soft.primary,\n \"--color-divider-soft-secondary\": theme.colors.divider.soft.secondary,\n\n \"--color-brand-primary\": theme.colors.brand.primary,\n \"--color-brand-secondary\": theme.colors.brand.secondary,\n \"--color-brand-text\": theme.colors.brand.text,\n \"--color-brand-soft-primary\": theme.colors.brand.soft.primary,\n \"--color-brand-soft-secondary\": theme.colors.brand.soft.secondary,\n\n \"--color-accent-primary\": theme.colors.accent.primary,\n \"--color-accent-secondary\": theme.colors.accent.secondary,\n \"--color-accent-text\": theme.colors.accent.text,\n \"--color-accent-soft-primary\": theme.colors.accent.soft.primary,\n \"--color-accent-soft-secondary\": theme.colors.accent.soft.secondary,\n\n \"--color-info-primary\": theme.colors.info.primary,\n \"--color-info-secondary\": theme.colors.info.secondary,\n \"--color-info-text\": theme.colors.info.text,\n \"--color-info-soft-primary\": theme.colors.info.soft.primary,\n \"--color-info-soft-secondary\": theme.colors.info.soft.secondary,\n\n \"--color-success-primary\": theme.colors.success.primary,\n \"--color-success-secondary\": theme.colors.success.secondary,\n \"--color-success-text\": theme.colors.success.text,\n \"--color-success-soft-primary\": theme.colors.success.soft.primary,\n \"--color-success-soft-secondary\": theme.colors.success.soft.secondary,\n\n \"--color-warning-primary\": theme.colors.warning.primary,\n \"--color-warning-secondary\": theme.colors.warning.secondary,\n \"--color-warning-text\": theme.colors.warning.text,\n \"--color-warning-soft-primary\": theme.colors.warning.soft.primary,\n \"--color-warning-soft-secondary\": theme.colors.warning.soft.secondary,\n\n \"--color-danger-primary\": theme.colors.danger.primary,\n \"--color-danger-secondary\": theme.colors.danger.secondary,\n \"--color-danger-text\": theme.colors.danger.text,\n \"--color-danger-soft-primary\": theme.colors.danger.soft.primary,\n \"--color-danger-soft-secondary\": theme.colors.danger.soft.secondary,\n\n\n ...shadows,\n }\n}\n\n\nexport default ThemeCssVars"],"names":[],"mappings":"sEAEA,MAAM,YAAY,GAAG,CAAC,KAAmB,KAAI;IAEzC,MAAM,OAAO,GAAQ,EAAE;IACvB,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,OAAO,CAAC,CAAA,SAAA,EAAY,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;AAE5D,IAAA,OAAA,MAAA,CAAA,MAAA,CAAA,EACI,SAAS,EAAE,KAAK,CAAC,WAAW,CAAC,EAAE,EAC/B,SAAS,EAAE,KAAK,CAAC,WAAW,CAAC,EAAE,EAC/B,SAAS,EAAE,KAAK,CAAC,WAAW,CAAC,EAAE,EAC/B,SAAS,EAAE,KAAK,CAAC,WAAW,CAAC,EAAE,EAC/B,SAAS,EAAE,KAAK,CAAC,WAAW,CAAC,EAAE,EAE/B,WAAW,EAAE,CAAA,EAAG,KAAK,CAAC,UAAU,CAAC,EAAE,CAAC,UAAU,CAAA,CAAA,EAAI,KAAK,CAAC,UAAU,CAAC,EAAE,CAAC,QAAQ,CAAA,GAAA,EAAM,KAAK,CAAC,UAAU,CAAC,EAAE,CAAC,UAAU,CAAA,QAAA,CAAU,EAC5H,WAAW,EAA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S,EAErE,yBAAyB,EAAE,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,EACvD,2BAA2B,EAAE,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,SAAS,EAC3D,sBAAsB,EAAE,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,EACjD,8BAA8B,EAAE,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,EACjE,gCAAgC,EAAE,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,EAErE,wBAAwB,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,EACrD,0BAA0B,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,SAAS,EACzD,qBAAqB,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,EAC/C,6BAA6B,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,EAC/D,+BAA+B,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,EAAA,EAGhE,OAAO,CAAA;AAElB"}
|
|
1
|
+
{"version":3,"file":"ThemeCssVars.js","sources":["../../src/theme/ThemeCssVars.ts"],"sourcesContent":["import { ThemeOptions } from \"./types\";\r\n\r\nconst ThemeCssVars = (theme: ThemeOptions) => {\r\n\r\n const shadows: any = {}\r\n theme.shadow.forEach((s, i) => shadows[`--shadow-${i}`] = s)\r\n\r\n return {\r\n \"--bp-xs\": theme.breakpoints.xs,\r\n \"--bp-sm\": theme.breakpoints.sm,\r\n \"--bp-md\": theme.breakpoints.md,\r\n \"--bp-lg\": theme.breakpoints.lg,\r\n \"--bp-xl\": theme.breakpoints.xl,\r\n\r\n \"--font-h1\": `${theme.typography.h1.fontWeight} ${theme.typography.h1.fontSize}px/${theme.typography.h1.lineHeight} inherit`,\r\n \"--font-h2\": `${theme.typography.h2.fontWeight} ${theme.typography.h2.fontSize}px/${theme.typography.h2.lineHeight} inherit`,\r\n \"--font-h3\": `${theme.typography.h3.fontWeight} ${theme.typography.h3.fontSize}px/${theme.typography.h3.lineHeight} inherit`,\r\n \"--font-h4\": `${theme.typography.h4.fontWeight} ${theme.typography.h4.fontSize}px/${theme.typography.h4.lineHeight} inherit`,\r\n \"--font-h5\": `${theme.typography.h5.fontWeight} ${theme.typography.h5.fontSize}px/${theme.typography.h5.lineHeight} inherit`,\r\n \"--font-h6\": `${theme.typography.h6.fontWeight} ${theme.typography.h6.fontSize}px/${theme.typography.h6.lineHeight} inherit`,\r\n \"--font-big\": `${theme.typography.big.fontWeight} ${theme.typography.text.fontSize}px/${theme.typography.text.lineHeight} inherit`,\r\n \"--font-text\": `${theme.typography.text.fontWeight} ${theme.typography.text.fontSize}px/${theme.typography.text.lineHeight} inherit`,\r\n \"--font-button\": `${theme.typography.button.fontWeight} ${theme.typography.button.fontSize}px/${theme.typography.button.lineHeight} inherit`,\r\n \"--font-small\": `${theme.typography.small.fontWeight} ${theme.typography.small.fontSize}px/${theme.typography.small.lineHeight} inherit`,\r\n\r\n \"--fontsize-h1\": `${theme.typography.h1.fontSize}px`,\r\n \"--fontsize-h2\": `${theme.typography.h2.fontSize}px`,\r\n \"--fontsize-h3\": `${theme.typography.h3.fontSize}px`,\r\n \"--fontsize-h4\": `${theme.typography.h4.fontSize}px`,\r\n \"--fontsize-h5\": `${theme.typography.h5.fontSize}px`,\r\n \"--fontsize-h6\": `${theme.typography.h6.fontSize}px`,\r\n \"--fontsize-big\": `${theme.typography.big.fontSize}px`,\r\n \"--fontsize-text\": `${theme.typography.text.fontSize}px`,\r\n \"--fontsize-button\": `${theme.typography.button.fontSize}px`,\r\n \"--fontsize-small\": `${theme.typography.small.fontSize}px`,\r\n\r\n \"--fontweight-h1\": theme.typography.h1.fontWeight + \"\",\r\n \"--fontweight-h2\": theme.typography.h2.fontWeight + \"\",\r\n \"--fontweight-h3\": theme.typography.h3.fontWeight + \"\",\r\n \"--fontweight-h4\": theme.typography.h4.fontWeight + \"\",\r\n \"--fontweight-h5\": theme.typography.h5.fontWeight + \"\",\r\n \"--fontweight-h6\": theme.typography.h6.fontWeight + \"\",\r\n \"--fontweight-big\": theme.typography.big.fontWeight + \"\",\r\n \"--fontweight-text\": theme.typography.text.fontWeight + \"\",\r\n \"--fontweight-button\": theme.typography.button.fontWeight + \"\",\r\n \"--fontweight-small\": theme.typography.small.fontWeight + \"\",\r\n\r\n \"--lineheight-h1\": theme.typography.h1.lineHeight + \"\",\r\n \"--lineheight-h2\": theme.typography.h2.lineHeight + \"\",\r\n \"--lineheight-h3\": theme.typography.h3.lineHeight + \"\",\r\n \"--lineheight-h4\": theme.typography.h4.lineHeight + \"\",\r\n \"--lineheight-h5\": theme.typography.h5.lineHeight + \"\",\r\n \"--lineheight-h6\": theme.typography.h6.lineHeight + \"\",\r\n \"--lineheight-big\": theme.typography.big.lineHeight + \"\",\r\n \"--lineheight-text\": theme.typography.text.lineHeight + \"\",\r\n \"--lineheight-button\": theme.typography.button.lineHeight + \"\",\r\n \"--lineheight-small\": theme.typography.small.lineHeight + \"\",\r\n\r\n \"--color-background-primary\": theme.colors.background.primary,\r\n \"--color-background-secondary\": theme.colors.background.secondary,\r\n\r\n \"--color-text-primary\": theme.colors.text.primary,\r\n \"--color-text-secondary\": theme.colors.text.secondary,\r\n\r\n \"--color-divider-primary\": theme.colors.divider.primary,\r\n \"--color-divider-secondary\": theme.colors.divider.secondary,\r\n \"--color-divider-soft-primary\": theme.colors.divider.soft.primary,\r\n \"--color-divider-soft-secondary\": theme.colors.divider.soft.secondary,\r\n\r\n \"--color-brand-primary\": theme.colors.brand.primary,\r\n \"--color-brand-secondary\": theme.colors.brand.secondary,\r\n \"--color-brand-text\": theme.colors.brand.text,\r\n \"--color-brand-soft-primary\": theme.colors.brand.soft.primary,\r\n \"--color-brand-soft-secondary\": theme.colors.brand.soft.secondary,\r\n\r\n \"--color-accent-primary\": theme.colors.accent.primary,\r\n \"--color-accent-secondary\": theme.colors.accent.secondary,\r\n \"--color-accent-text\": theme.colors.accent.text,\r\n \"--color-accent-soft-primary\": theme.colors.accent.soft.primary,\r\n \"--color-accent-soft-secondary\": theme.colors.accent.soft.secondary,\r\n\r\n \"--color-info-primary\": theme.colors.info.primary,\r\n \"--color-info-secondary\": theme.colors.info.secondary,\r\n \"--color-info-text\": theme.colors.info.text,\r\n \"--color-info-soft-primary\": theme.colors.info.soft.primary,\r\n \"--color-info-soft-secondary\": theme.colors.info.soft.secondary,\r\n\r\n \"--color-success-primary\": theme.colors.success.primary,\r\n \"--color-success-secondary\": theme.colors.success.secondary,\r\n \"--color-success-text\": theme.colors.success.text,\r\n \"--color-success-soft-primary\": theme.colors.success.soft.primary,\r\n \"--color-success-soft-secondary\": theme.colors.success.soft.secondary,\r\n\r\n \"--color-warning-primary\": theme.colors.warning.primary,\r\n \"--color-warning-secondary\": theme.colors.warning.secondary,\r\n \"--color-warning-text\": theme.colors.warning.text,\r\n \"--color-warning-soft-primary\": theme.colors.warning.soft.primary,\r\n \"--color-warning-soft-secondary\": theme.colors.warning.soft.secondary,\r\n\r\n \"--color-danger-primary\": theme.colors.danger.primary,\r\n \"--color-danger-secondary\": theme.colors.danger.secondary,\r\n \"--color-danger-text\": theme.colors.danger.text,\r\n \"--color-danger-soft-primary\": theme.colors.danger.soft.primary,\r\n \"--color-danger-soft-secondary\": theme.colors.danger.soft.secondary,\r\n\r\n\r\n ...shadows,\r\n }\r\n}\r\n\r\n\r\nexport default ThemeCssVars"],"names":[],"mappings":"sEAEA,MAAM,YAAY,GAAG,CAAC,KAAmB,KAAI;IAEzC,MAAM,OAAO,GAAQ,EAAE;IACvB,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,OAAO,CAAC,CAAA,SAAA,EAAY,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;AAE5D,IAAA,OAAA,MAAA,CAAA,MAAA,CAAA,EACI,SAAS,EAAE,KAAK,CAAC,W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