@xanui/core 1.2.55 → 1.2.57
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/Portal/index.cjs +36 -0
- package/Portal/index.cjs.map +1 -0
- package/Portal/index.d.ts +15 -0
- package/Portal/index.js +34 -0
- package/Portal/index.js.map +1 -0
- package/breakpoint/BreakpointProvider.cjs +19 -15
- package/breakpoint/BreakpointProvider.cjs.map +1 -1
- package/breakpoint/BreakpointProvider.js +19 -15
- package/breakpoint/BreakpointProvider.js.map +1 -1
- package/breakpoint/useBreakpoint.cjs +12 -8
- package/breakpoint/useBreakpoint.cjs.map +1 -1
- package/breakpoint/useBreakpoint.d.ts +7 -5
- package/breakpoint/useBreakpoint.js +12 -8
- package/breakpoint/useBreakpoint.js.map +1 -1
- package/css/index.cjs +4 -4
- package/css/index.cjs.map +1 -1
- package/css/index.js +4 -4
- package/css/index.js.map +1 -1
- package/index.cjs +16 -16
- package/index.d.ts +1 -1
- package/index.js +1 -1
- package/package.json +1 -1
- package/theme/ThemeDefaultOptions.cjs +2 -2
- package/theme/ThemeDefaultOptions.cjs.map +1 -1
- package/theme/ThemeDefaultOptions.js +2 -2
- package/theme/ThemeDefaultOptions.js.map +1 -1
- package/hooks/usePortal.cjs +0 -69
- package/hooks/usePortal.cjs.map +0 -1
- package/hooks/usePortal.d.ts +0 -14
- package/hooks/usePortal.js +0 -67
- package/hooks/usePortal.js.map +0 -1
package/Portal/index.cjs
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
var React = require('react');
|
|
5
|
+
var reactDom = require('react-dom');
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* SSR-safe Portal component
|
|
9
|
+
* - container: HTMLElement or querySelector string
|
|
10
|
+
* - if not provided, creates a unique div automatically
|
|
11
|
+
*/
|
|
12
|
+
const Portal = ({ children, container }) => {
|
|
13
|
+
const portalNode = React.useMemo(() => {
|
|
14
|
+
if (typeof document === "undefined")
|
|
15
|
+
return null; // SSR
|
|
16
|
+
// Use container if provided
|
|
17
|
+
if (container instanceof HTMLElement)
|
|
18
|
+
return container;
|
|
19
|
+
if (typeof container === "string") {
|
|
20
|
+
const element = document.querySelector(container);
|
|
21
|
+
if (element)
|
|
22
|
+
return element;
|
|
23
|
+
}
|
|
24
|
+
// Auto-create a unique div
|
|
25
|
+
const element = document.createElement("div");
|
|
26
|
+
element.dataset.portal = Math.random().toString(36).substring(2, 9); // unique id
|
|
27
|
+
document.body.appendChild(element);
|
|
28
|
+
return element;
|
|
29
|
+
}, [container]);
|
|
30
|
+
if (!portalNode)
|
|
31
|
+
return null;
|
|
32
|
+
return reactDom.createPortal(children, portalNode);
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
module.exports = Portal;
|
|
36
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../src/Portal/index.tsx"],"sourcesContent":["\"use client\";\r\n\r\nimport React, { ReactNode, useMemo } from \"react\";\r\nimport { createPortal } from \"react-dom\";\r\n\r\nexport type PortalProps = {\r\n children: ReactNode;\r\n container?: HTMLElement | string; // HTMLElement or querySelector string\r\n}\r\n\r\n/**\r\n * SSR-safe Portal component\r\n * - container: HTMLElement or querySelector string\r\n * - if not provided, creates a unique div automatically\r\n */\r\nconst Portal: React.FC<PortalProps> = ({ children, container }) => {\r\n const portalNode = useMemo<HTMLElement | null>(() => {\r\n if (typeof document === \"undefined\") return null; // SSR\r\n\r\n // Use container if provided\r\n if (container instanceof HTMLElement) return container;\r\n if (typeof container === \"string\") {\r\n const element = document.querySelector<HTMLElement>(container);\r\n if (element) return element;\r\n }\r\n\r\n // Auto-create a unique div\r\n const element = document.createElement(\"div\");\r\n element.dataset.portal = Math.random().toString(36).substring(2, 9); // unique id\r\n document.body.appendChild(element);\r\n\r\n return element;\r\n }, [container]);\r\n\r\n if (!portalNode) return null;\r\n\r\n return createPortal(children, portalNode);\r\n};\r\n\r\nexport default Portal;"],"names":[],"mappings":";;;;;;AAUA;;;;AAIG;AACH;AACG;;;;;AAIyC;AACtC;;AAEG;AAAa;;;;;AAMhB;AAEA;AACH;AAEA;AAAiB;AAEjB;AACH;;"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React__default, { ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
type PortalProps = {
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
container?: HTMLElement | string;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* SSR-safe Portal component
|
|
9
|
+
* - container: HTMLElement or querySelector string
|
|
10
|
+
* - if not provided, creates a unique div automatically
|
|
11
|
+
*/
|
|
12
|
+
declare const Portal: React__default.FC<PortalProps>;
|
|
13
|
+
|
|
14
|
+
export { Portal as default };
|
|
15
|
+
export type { PortalProps };
|
package/Portal/index.js
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useMemo } from 'react';
|
|
3
|
+
import { createPortal } from 'react-dom';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* SSR-safe Portal component
|
|
7
|
+
* - container: HTMLElement or querySelector string
|
|
8
|
+
* - if not provided, creates a unique div automatically
|
|
9
|
+
*/
|
|
10
|
+
const Portal = ({ children, container }) => {
|
|
11
|
+
const portalNode = useMemo(() => {
|
|
12
|
+
if (typeof document === "undefined")
|
|
13
|
+
return null; // SSR
|
|
14
|
+
// Use container if provided
|
|
15
|
+
if (container instanceof HTMLElement)
|
|
16
|
+
return container;
|
|
17
|
+
if (typeof container === "string") {
|
|
18
|
+
const element = document.querySelector(container);
|
|
19
|
+
if (element)
|
|
20
|
+
return element;
|
|
21
|
+
}
|
|
22
|
+
// Auto-create a unique div
|
|
23
|
+
const element = document.createElement("div");
|
|
24
|
+
element.dataset.portal = Math.random().toString(36).substring(2, 9); // unique id
|
|
25
|
+
document.body.appendChild(element);
|
|
26
|
+
return element;
|
|
27
|
+
}, [container]);
|
|
28
|
+
if (!portalNode)
|
|
29
|
+
return null;
|
|
30
|
+
return createPortal(children, portalNode);
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export { Portal as default };
|
|
34
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/Portal/index.tsx"],"sourcesContent":["\"use client\";\r\n\r\nimport React, { ReactNode, useMemo } from \"react\";\r\nimport { createPortal } from \"react-dom\";\r\n\r\nexport type PortalProps = {\r\n children: ReactNode;\r\n container?: HTMLElement | string; // HTMLElement or querySelector string\r\n}\r\n\r\n/**\r\n * SSR-safe Portal component\r\n * - container: HTMLElement or querySelector string\r\n * - if not provided, creates a unique div automatically\r\n */\r\nconst Portal: React.FC<PortalProps> = ({ children, container }) => {\r\n const portalNode = useMemo<HTMLElement | null>(() => {\r\n if (typeof document === \"undefined\") return null; // SSR\r\n\r\n // Use container if provided\r\n if (container instanceof HTMLElement) return container;\r\n if (typeof container === \"string\") {\r\n const element = document.querySelector<HTMLElement>(container);\r\n if (element) return element;\r\n }\r\n\r\n // Auto-create a unique div\r\n const element = document.createElement(\"div\");\r\n element.dataset.portal = Math.random().toString(36).substring(2, 9); // unique id\r\n document.body.appendChild(element);\r\n\r\n return element;\r\n }, [container]);\r\n\r\n if (!portalNode) return null;\r\n\r\n return createPortal(children, portalNode);\r\n};\r\n\r\nexport default Portal;"],"names":[],"mappings":";;;;AAUA;;;;AAIG;AACH;AACG;;;;;AAIyC;AACtC;;AAEG;AAAa;;;;;AAMhB;AAEA;AACH;AAEA;AAAiB;AAEjB;AACH;;"}
|
|
@@ -6,15 +6,14 @@ var React = require('react');
|
|
|
6
6
|
var index$1 = require('../css/index.cjs');
|
|
7
7
|
var index = require('../Document/index.cjs');
|
|
8
8
|
|
|
9
|
-
const BreakpointCtx = React.createContext(
|
|
9
|
+
const BreakpointCtx = React.createContext({
|
|
10
|
+
key: "xl",
|
|
11
|
+
width: 1920,
|
|
12
|
+
});
|
|
10
13
|
/**
|
|
11
14
|
* SSR-safe breakpoint detection
|
|
12
15
|
*/
|
|
13
|
-
const getKey = (
|
|
14
|
-
if (!doc || typeof window === "undefined" || typeof document === "undefined") {
|
|
15
|
-
return "xl";
|
|
16
|
-
}
|
|
17
|
-
const width = doc.documentElement.clientWidth || window.innerWidth;
|
|
16
|
+
const getKey = (width) => {
|
|
18
17
|
if (width < index$1.breakpoints.sm)
|
|
19
18
|
return "xs";
|
|
20
19
|
if (width < index$1.breakpoints.md)
|
|
@@ -26,22 +25,27 @@ const getKey = (doc) => {
|
|
|
26
25
|
return "xl";
|
|
27
26
|
};
|
|
28
27
|
const BreakpointProvider = ({ children }) => {
|
|
29
|
-
// hydrate-safe initial state
|
|
30
28
|
const doc = index.useDocument();
|
|
31
|
-
const
|
|
29
|
+
const getWidth = () => {
|
|
30
|
+
if (!doc)
|
|
31
|
+
return 1920; // SSR fallback
|
|
32
|
+
return doc.document.documentElement.clientWidth || window.innerWidth;
|
|
33
|
+
};
|
|
34
|
+
const [state, setState] = React.useState(() => {
|
|
35
|
+
const width = getWidth();
|
|
36
|
+
return { width, key: getKey(width) };
|
|
37
|
+
});
|
|
32
38
|
const handler = React.useCallback(() => {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}
|
|
39
|
+
const width = getWidth();
|
|
40
|
+
const key = getKey(width);
|
|
41
|
+
setState(prev => (prev.key === key ? prev : { key, width }));
|
|
37
42
|
}, [doc]);
|
|
38
|
-
// useLayoutEffect avoids visual flicker on first paint
|
|
39
43
|
React.useLayoutEffect(() => {
|
|
40
|
-
handler();
|
|
44
|
+
handler(); // set correct initial value
|
|
41
45
|
window.addEventListener("resize", handler, { passive: true });
|
|
42
46
|
return () => window.removeEventListener("resize", handler);
|
|
43
47
|
}, [handler]);
|
|
44
|
-
return
|
|
48
|
+
return jsxRuntime.jsx(BreakpointCtx.Provider, { value: state, children: children });
|
|
45
49
|
};
|
|
46
50
|
|
|
47
51
|
exports.BreakpointCtx = BreakpointCtx;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BreakpointProvider.cjs","sources":["../../src/breakpoint/BreakpointProvider.tsx"],"sourcesContent":["\"use client\";\r\n\r\nimport React, {
|
|
1
|
+
{"version":3,"file":"BreakpointProvider.cjs","sources":["../../src/breakpoint/BreakpointProvider.tsx"],"sourcesContent":["\"use client\";\r\n\r\nimport React, { ReactNode, useState, useCallback, useLayoutEffect } from \"react\";\r\nimport { breakpoints } from \"../css\";\r\nimport { BreakpointKeys } from \"../css/types\";\r\nimport { useDocument } from \"../Document\";\r\n\r\ntype BreakpointCtxType = {\r\n key: BreakpointKeys;\r\n width: number;\r\n};\r\n\r\nexport const BreakpointCtx = React.createContext<BreakpointCtxType>({\r\n key: \"xl\",\r\n width: 1920,\r\n});\r\n\r\n/**\r\n * SSR-safe breakpoint detection\r\n */\r\nconst getKey = (width: number): BreakpointKeys => {\r\n if (width < breakpoints.sm) return \"xs\";\r\n if (width < breakpoints.md) return \"sm\";\r\n if (width < breakpoints.lg) return \"md\";\r\n if (width < breakpoints.xl) return \"lg\";\r\n return \"xl\";\r\n};\r\n\r\nexport const BreakpointProvider = ({ children }: { children?: ReactNode }) => {\r\n const doc = useDocument();\r\n\r\n const getWidth = () => {\r\n if (!doc) return 1920; // SSR fallback\r\n return doc.document.documentElement.clientWidth || window.innerWidth;\r\n };\r\n\r\n const [state, setState] = useState<BreakpointCtxType>(() => {\r\n const width = getWidth();\r\n return { width, key: getKey(width) };\r\n });\r\n\r\n const handler = useCallback(() => {\r\n const width = getWidth();\r\n const key = getKey(width);\r\n\r\n setState(prev => (prev.key === key ? prev : { key, width }));\r\n }, [doc]);\r\n\r\n useLayoutEffect(() => {\r\n handler(); // set correct initial value\r\n window.addEventListener(\"resize\", handler, { passive: true });\r\n return () => window.removeEventListener(\"resize\", handler);\r\n }, [handler]);\r\n\r\n return <BreakpointCtx.Provider value={state}>{children}</BreakpointCtx.Provider>;\r\n};"],"names":[],"mappings":";;;;;;;;AAYO;AACH;AACA;AACH;AAED;;AAEG;AACH;AACI;AAA4B;AAC5B;AAA4B;AAC5B;AAA4B;AAC5B;AAA4B;AAC5B;AACJ;;AAGI;;AAGI;;;AAEJ;;AAGI;;AAEJ;AAEA;AACI;AACA;;AAGJ;;;AAII;;AAEJ;;AAGJ;;;"}
|
|
@@ -4,15 +4,14 @@ import React__default, { useState, useCallback, useLayoutEffect } from 'react';
|
|
|
4
4
|
import { breakpoints } from '../css/index.js';
|
|
5
5
|
import { useDocument } from '../Document/index.js';
|
|
6
6
|
|
|
7
|
-
const BreakpointCtx = React__default.createContext(
|
|
7
|
+
const BreakpointCtx = React__default.createContext({
|
|
8
|
+
key: "xl",
|
|
9
|
+
width: 1920,
|
|
10
|
+
});
|
|
8
11
|
/**
|
|
9
12
|
* SSR-safe breakpoint detection
|
|
10
13
|
*/
|
|
11
|
-
const getKey = (
|
|
12
|
-
if (!doc || typeof window === "undefined" || typeof document === "undefined") {
|
|
13
|
-
return "xl";
|
|
14
|
-
}
|
|
15
|
-
const width = doc.documentElement.clientWidth || window.innerWidth;
|
|
14
|
+
const getKey = (width) => {
|
|
16
15
|
if (width < breakpoints.sm)
|
|
17
16
|
return "xs";
|
|
18
17
|
if (width < breakpoints.md)
|
|
@@ -24,22 +23,27 @@ const getKey = (doc) => {
|
|
|
24
23
|
return "xl";
|
|
25
24
|
};
|
|
26
25
|
const BreakpointProvider = ({ children }) => {
|
|
27
|
-
// hydrate-safe initial state
|
|
28
26
|
const doc = useDocument();
|
|
29
|
-
const
|
|
27
|
+
const getWidth = () => {
|
|
28
|
+
if (!doc)
|
|
29
|
+
return 1920; // SSR fallback
|
|
30
|
+
return doc.document.documentElement.clientWidth || window.innerWidth;
|
|
31
|
+
};
|
|
32
|
+
const [state, setState] = useState(() => {
|
|
33
|
+
const width = getWidth();
|
|
34
|
+
return { width, key: getKey(width) };
|
|
35
|
+
});
|
|
30
36
|
const handler = useCallback(() => {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}
|
|
37
|
+
const width = getWidth();
|
|
38
|
+
const key = getKey(width);
|
|
39
|
+
setState(prev => (prev.key === key ? prev : { key, width }));
|
|
35
40
|
}, [doc]);
|
|
36
|
-
// useLayoutEffect avoids visual flicker on first paint
|
|
37
41
|
useLayoutEffect(() => {
|
|
38
|
-
handler();
|
|
42
|
+
handler(); // set correct initial value
|
|
39
43
|
window.addEventListener("resize", handler, { passive: true });
|
|
40
44
|
return () => window.removeEventListener("resize", handler);
|
|
41
45
|
}, [handler]);
|
|
42
|
-
return
|
|
46
|
+
return jsx(BreakpointCtx.Provider, { value: state, children: children });
|
|
43
47
|
};
|
|
44
48
|
|
|
45
49
|
export { BreakpointCtx, BreakpointProvider };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BreakpointProvider.js","sources":["../../src/breakpoint/BreakpointProvider.tsx"],"sourcesContent":["\"use client\";\r\n\r\nimport React, {
|
|
1
|
+
{"version":3,"file":"BreakpointProvider.js","sources":["../../src/breakpoint/BreakpointProvider.tsx"],"sourcesContent":["\"use client\";\r\n\r\nimport React, { ReactNode, useState, useCallback, useLayoutEffect } from \"react\";\r\nimport { breakpoints } from \"../css\";\r\nimport { BreakpointKeys } from \"../css/types\";\r\nimport { useDocument } from \"../Document\";\r\n\r\ntype BreakpointCtxType = {\r\n key: BreakpointKeys;\r\n width: number;\r\n};\r\n\r\nexport const BreakpointCtx = React.createContext<BreakpointCtxType>({\r\n key: \"xl\",\r\n width: 1920,\r\n});\r\n\r\n/**\r\n * SSR-safe breakpoint detection\r\n */\r\nconst getKey = (width: number): BreakpointKeys => {\r\n if (width < breakpoints.sm) return \"xs\";\r\n if (width < breakpoints.md) return \"sm\";\r\n if (width < breakpoints.lg) return \"md\";\r\n if (width < breakpoints.xl) return \"lg\";\r\n return \"xl\";\r\n};\r\n\r\nexport const BreakpointProvider = ({ children }: { children?: ReactNode }) => {\r\n const doc = useDocument();\r\n\r\n const getWidth = () => {\r\n if (!doc) return 1920; // SSR fallback\r\n return doc.document.documentElement.clientWidth || window.innerWidth;\r\n };\r\n\r\n const [state, setState] = useState<BreakpointCtxType>(() => {\r\n const width = getWidth();\r\n return { width, key: getKey(width) };\r\n });\r\n\r\n const handler = useCallback(() => {\r\n const width = getWidth();\r\n const key = getKey(width);\r\n\r\n setState(prev => (prev.key === key ? prev : { key, width }));\r\n }, [doc]);\r\n\r\n useLayoutEffect(() => {\r\n handler(); // set correct initial value\r\n window.addEventListener(\"resize\", handler, { passive: true });\r\n return () => window.removeEventListener(\"resize\", handler);\r\n }, [handler]);\r\n\r\n return <BreakpointCtx.Provider value={state}>{children}</BreakpointCtx.Provider>;\r\n};"],"names":[],"mappings":";;;;;;AAYO;AACH;AACA;AACH;AAED;;AAEG;AACH;AACI;AAA4B;AAC5B;AAA4B;AAC5B;AAA4B;AAC5B;AAA4B;AAC5B;AACJ;;AAGI;;AAGI;;;AAEJ;;AAGI;;AAEJ;AAEA;AACI;AACA;;AAGJ;;;AAII;;AAEJ;;AAGJ;;"}
|
|
@@ -5,18 +5,22 @@ var BreakpointProvider = require('./BreakpointProvider.cjs');
|
|
|
5
5
|
var index = require('../css/index.cjs');
|
|
6
6
|
|
|
7
7
|
const useBreakpoint = () => {
|
|
8
|
-
const value = React.useContext(BreakpointProvider.BreakpointCtx);
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
const
|
|
8
|
+
const { key: value, width } = React.useContext(BreakpointProvider.BreakpointCtx);
|
|
9
|
+
const is = (k) => value === k;
|
|
10
|
+
const isUp = (k) => width >= index.breakpoints[k];
|
|
11
|
+
const isDown = (k) => width < index.breakpoints[k];
|
|
12
|
+
const isOrUp = (k) => isUp(k) || is(k);
|
|
13
|
+
const isOrDown = (k) => isDown(k) || is(k);
|
|
14
|
+
const isBetween = (start, end) => width >= index.breakpoints[start] && width < index.breakpoints[end];
|
|
13
15
|
return {
|
|
14
|
-
value,
|
|
16
|
+
value, // current breakpoint key
|
|
17
|
+
width, // current width
|
|
15
18
|
is,
|
|
16
19
|
isUp,
|
|
17
20
|
isDown,
|
|
18
|
-
isOrUp
|
|
19
|
-
isOrDown
|
|
21
|
+
isOrUp,
|
|
22
|
+
isOrDown,
|
|
23
|
+
isBetween
|
|
20
24
|
};
|
|
21
25
|
};
|
|
22
26
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useBreakpoint.cjs","sources":["../../src/breakpoint/useBreakpoint.ts"],"sourcesContent":["import { useContext } from \"react\"
|
|
1
|
+
{"version":3,"file":"useBreakpoint.cjs","sources":["../../src/breakpoint/useBreakpoint.ts"],"sourcesContent":["import { useContext } from \"react\";\r\nimport { BreakpointCtx } from \"./BreakpointProvider\";\r\nimport { breakpoints } from \"../css\";\r\nimport { BreakpointKeys } from \"../css/types\";\r\n\r\nconst useBreakpoint = () => {\r\n const { key: value, width } = useContext(BreakpointCtx);\r\n\r\n const is = (k: BreakpointKeys) => value === k;\r\n const isUp = (k: BreakpointKeys) => width >= breakpoints[k];\r\n const isDown = (k: BreakpointKeys) => width < breakpoints[k];\r\n const isOrUp = (k: BreakpointKeys) => isUp(k) || is(k);\r\n const isOrDown = (k: BreakpointKeys) => isDown(k) || is(k);\r\n const isBetween = (start: BreakpointKeys, end: BreakpointKeys) =>\r\n width >= breakpoints[start] && width < breakpoints[end];\r\n\r\n return {\r\n value, // current breakpoint key\r\n width, // current width\r\n is,\r\n isUp,\r\n isDown,\r\n isOrUp,\r\n isOrDown,\r\n isBetween\r\n };\r\n};\r\n\r\nexport default useBreakpoint;"],"names":["useContext","BreakpointCtx","breakpoints"],"mappings":";;;;;;AAKA,MAAM,aAAa,GAAG,MAAK;AACxB,IAAA,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,GAAGA,gBAAU,CAACC,gCAAa,CAAC;IAEvD,MAAM,EAAE,GAAG,CAAC,CAAiB,KAAK,KAAK,KAAK,CAAC;AAC7C,IAAA,MAAM,IAAI,GAAG,CAAC,CAAiB,KAAK,KAAK,IAAIC,iBAAW,CAAC,CAAC,CAAC;AAC3D,IAAA,MAAM,MAAM,GAAG,CAAC,CAAiB,KAAK,KAAK,GAAGA,iBAAW,CAAC,CAAC,CAAC;AAC5D,IAAA,MAAM,MAAM,GAAG,CAAC,CAAiB,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;AACtD,IAAA,MAAM,QAAQ,GAAG,CAAC,CAAiB,KAAK,MAAM,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;IAC1D,MAAM,SAAS,GAAG,CAAC,KAAqB,EAAE,GAAmB,KAC1D,KAAK,IAAIA,iBAAW,CAAC,KAAK,CAAC,IAAI,KAAK,GAAGA,iBAAW,CAAC,GAAG,CAAC;IAE1D,OAAO;AACJ,QAAA,KAAK;AACL,QAAA,KAAK;QACL,EAAE;QACF,IAAI;QACJ,MAAM;QACN,MAAM;QACN,QAAQ;QACR;KACF;AACJ;;;;"}
|
|
@@ -2,11 +2,13 @@ import { BreakpointKeys } from '../css/types.js';
|
|
|
2
2
|
|
|
3
3
|
declare const useBreakpoint: () => {
|
|
4
4
|
value: BreakpointKeys;
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
width: number;
|
|
6
|
+
is: (k: BreakpointKeys) => boolean;
|
|
7
|
+
isUp: (k: BreakpointKeys) => boolean;
|
|
8
|
+
isDown: (k: BreakpointKeys) => boolean;
|
|
9
|
+
isOrUp: (k: BreakpointKeys) => boolean;
|
|
10
|
+
isOrDown: (k: BreakpointKeys) => boolean;
|
|
11
|
+
isBetween: (start: BreakpointKeys, end: BreakpointKeys) => boolean;
|
|
10
12
|
};
|
|
11
13
|
|
|
12
14
|
export { useBreakpoint as default };
|
|
@@ -3,18 +3,22 @@ import { BreakpointCtx } from './BreakpointProvider.js';
|
|
|
3
3
|
import { breakpoints } from '../css/index.js';
|
|
4
4
|
|
|
5
5
|
const useBreakpoint = () => {
|
|
6
|
-
const value = useContext(BreakpointCtx);
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
6
|
+
const { key: value, width } = useContext(BreakpointCtx);
|
|
7
|
+
const is = (k) => value === k;
|
|
8
|
+
const isUp = (k) => width >= breakpoints[k];
|
|
9
|
+
const isDown = (k) => width < breakpoints[k];
|
|
10
|
+
const isOrUp = (k) => isUp(k) || is(k);
|
|
11
|
+
const isOrDown = (k) => isDown(k) || is(k);
|
|
12
|
+
const isBetween = (start, end) => width >= breakpoints[start] && width < breakpoints[end];
|
|
11
13
|
return {
|
|
12
|
-
value,
|
|
14
|
+
value, // current breakpoint key
|
|
15
|
+
width, // current width
|
|
13
16
|
is,
|
|
14
17
|
isUp,
|
|
15
18
|
isDown,
|
|
16
|
-
isOrUp
|
|
17
|
-
isOrDown
|
|
19
|
+
isOrUp,
|
|
20
|
+
isOrDown,
|
|
21
|
+
isBetween
|
|
18
22
|
};
|
|
19
23
|
};
|
|
20
24
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useBreakpoint.js","sources":["../../src/breakpoint/useBreakpoint.ts"],"sourcesContent":["import { useContext } from \"react\"
|
|
1
|
+
{"version":3,"file":"useBreakpoint.js","sources":["../../src/breakpoint/useBreakpoint.ts"],"sourcesContent":["import { useContext } from \"react\";\r\nimport { BreakpointCtx } from \"./BreakpointProvider\";\r\nimport { breakpoints } from \"../css\";\r\nimport { BreakpointKeys } from \"../css/types\";\r\n\r\nconst useBreakpoint = () => {\r\n const { key: value, width } = useContext(BreakpointCtx);\r\n\r\n const is = (k: BreakpointKeys) => value === k;\r\n const isUp = (k: BreakpointKeys) => width >= breakpoints[k];\r\n const isDown = (k: BreakpointKeys) => width < breakpoints[k];\r\n const isOrUp = (k: BreakpointKeys) => isUp(k) || is(k);\r\n const isOrDown = (k: BreakpointKeys) => isDown(k) || is(k);\r\n const isBetween = (start: BreakpointKeys, end: BreakpointKeys) =>\r\n width >= breakpoints[start] && width < breakpoints[end];\r\n\r\n return {\r\n value, // current breakpoint key\r\n width, // current width\r\n is,\r\n isUp,\r\n isDown,\r\n isOrUp,\r\n isOrDown,\r\n isBetween\r\n };\r\n};\r\n\r\nexport default useBreakpoint;"],"names":[],"mappings":";;;;AAKA,MAAM,aAAa,GAAG,MAAK;AACxB,IAAA,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,UAAU,CAAC,aAAa,CAAC;IAEvD,MAAM,EAAE,GAAG,CAAC,CAAiB,KAAK,KAAK,KAAK,CAAC;AAC7C,IAAA,MAAM,IAAI,GAAG,CAAC,CAAiB,KAAK,KAAK,IAAI,WAAW,CAAC,CAAC,CAAC;AAC3D,IAAA,MAAM,MAAM,GAAG,CAAC,CAAiB,KAAK,KAAK,GAAG,WAAW,CAAC,CAAC,CAAC;AAC5D,IAAA,MAAM,MAAM,GAAG,CAAC,CAAiB,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;AACtD,IAAA,MAAM,QAAQ,GAAG,CAAC,CAAiB,KAAK,MAAM,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;IAC1D,MAAM,SAAS,GAAG,CAAC,KAAqB,EAAE,GAAmB,KAC1D,KAAK,IAAI,WAAW,CAAC,KAAK,CAAC,IAAI,KAAK,GAAG,WAAW,CAAC,GAAG,CAAC;IAE1D,OAAO;AACJ,QAAA,KAAK;AACL,QAAA,KAAK;QACL,EAAE;QACF,IAAI;QACJ,MAAM;QACN,MAAM;QACN,QAAQ;QACR;KACF;AACJ;;;;"}
|
package/css/index.cjs
CHANGED
|
@@ -7,10 +7,10 @@ var oncss = require('oncss');
|
|
|
7
7
|
|
|
8
8
|
const breakpoints = {
|
|
9
9
|
xs: 0,
|
|
10
|
-
sm:
|
|
11
|
-
md:
|
|
12
|
-
lg:
|
|
13
|
-
xl:
|
|
10
|
+
sm: 640,
|
|
11
|
+
md: 768,
|
|
12
|
+
lg: 1024,
|
|
13
|
+
xl: 1280,
|
|
14
14
|
};
|
|
15
15
|
const css = (props, options) => {
|
|
16
16
|
const cssOptions = Object.assign(Object.assign({}, options), { breakpoints,
|
package/css/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../src/css/index.ts"],"sourcesContent":["import getValue from \"./getValue\"\r\nimport getProps from \"./getProps\"\r\nimport aliases from \"./aliases\"\r\nimport { Aliases, BreakpointKeys, CSSOptionProps, CSSProps } from './types'\r\nimport { css as _css } from \"oncss\"\r\n\r\nexport {\r\n getValue,\r\n getProps\r\n}\r\n\r\nexport const breakpoints = {\r\n xs: 0,\r\n sm:
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../src/css/index.ts"],"sourcesContent":["import getValue from \"./getValue\"\r\nimport getProps from \"./getProps\"\r\nimport aliases from \"./aliases\"\r\nimport { Aliases, BreakpointKeys, CSSOptionProps, CSSProps } from './types'\r\nimport { css as _css } from \"oncss\"\r\n\r\nexport {\r\n getValue,\r\n getProps\r\n}\r\n\r\nexport const breakpoints = {\r\n xs: 0,\r\n sm: 640,\r\n md: 768,\r\n lg: 1024,\r\n xl: 1280,\r\n}\r\n\r\nexport const css = (props: CSSProps, options?: CSSOptionProps) => {\r\n const cssOptions: CSSOptionProps = {\r\n ...options,\r\n breakpoints,\r\n aliases,\r\n getValue: (p: any, v: any, _c: any, dept) => {\r\n if (options?.getValue) {\r\n let _val = options?.getValue(p, v, _c, dept)\r\n if (_val) return _val\r\n }\r\n return getValue(p, v, _c)\r\n },\r\n getProps: (p: any, v: any, _c: any, dept) => {\r\n if (options?.getProps) {\r\n let _p = options?.getProps(p, v, _c, dept)\r\n if (_p) return _p\r\n }\r\n return getProps(p, v, _c)\r\n },\r\n }\r\n return _css<Aliases, BreakpointKeys>(props, cssOptions)\r\n}\r\n\r\nexport const adjustColor = (hex: string, factor: number) => {\r\n\r\n hex = hex.replace(/^#/, '')\r\n\r\n let r = parseInt(hex.slice(0, 2), 16)\r\n let g = parseInt(hex.slice(2, 4), 16)\r\n let b = parseInt(hex.slice(4, 6), 16)\r\n\r\n r = Math.floor(r * factor)\r\n g = Math.floor(g * factor)\r\n b = Math.floor(b * factor)\r\n\r\n r = Math.min(255, Math.max(0, r))\r\n g = Math.min(255, Math.max(0, g))\r\n b = Math.min(255, Math.max(0, b))\r\n\r\n return `#${r.toString(16).padStart(2, '0')}${g.toString(16).padStart(2, '0')}${b.toString(16).padStart(2, '0')}`;\r\n}\r\n\r\nexport const adjustTextContrast = (color: string) => {\r\n color = color.replace(/^#/, '')\r\n const r = parseInt(color.slice(0, 2), 16);\r\n const g = parseInt(color.slice(2, 4), 16);\r\n const b = parseInt(color.slice(4, 6), 16);\r\n\r\n const luminance = (0.299 * r + 0.587 * g + 0.114 * b) / 255;\r\n return luminance > 0.5 ? '#111111' : '#FFFFFF';\r\n}\r\n\r\nexport const alpha = (color: string, opacity = 1) => {\r\n if (typeof opacity !== 'number') return color\r\n let _opacity = opacity * 100\r\n if (!color.startsWith(\"#\")) throw new Error(`color must be hex`)\r\n return (color + (`0${Math.round((255 / 100) * _opacity).toString(16)}`.slice(-2))).toUpperCase();\r\n};\r\n\r\n"],"names":["_css"],"mappings":";;;;;;;AAWO,MAAM,WAAW,GAAG;AACvB,IAAA,EAAE,EAAE,CAAC;AACL,IAAA,EAAE,EAAE,GAAG;AACP,IAAA,EAAE,EAAE,GAAG;AACP,IAAA,EAAE,EAAE,IAAI;AACR,IAAA,EAAE,EAAE,IAAI;;MAGC,GAAG,GAAG,CAAC,KAAe,EAAE,OAAwB,KAAI;AAC7D,IAAA,MAAM,UAAU,GAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EACT,OAAO,CAAA,EAAA,EACV,WAAW;A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
13
|
const css = (props, options) => {
|
|
14
14
|
const cssOptions = Object.assign(Object.assign({}, options), { breakpoints,
|
package/css/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/css/index.ts"],"sourcesContent":["import getValue from \"./getValue\"\r\nimport getProps from \"./getProps\"\r\nimport aliases from \"./aliases\"\r\nimport { Aliases, BreakpointKeys, CSSOptionProps, CSSProps } from './types'\r\nimport { css as _css } from \"oncss\"\r\n\r\nexport {\r\n getValue,\r\n getProps\r\n}\r\n\r\nexport const breakpoints = {\r\n xs: 0,\r\n sm:
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/css/index.ts"],"sourcesContent":["import getValue from \"./getValue\"\r\nimport getProps from \"./getProps\"\r\nimport aliases from \"./aliases\"\r\nimport { Aliases, BreakpointKeys, CSSOptionProps, CSSProps } from './types'\r\nimport { css as _css } from \"oncss\"\r\n\r\nexport {\r\n getValue,\r\n getProps\r\n}\r\n\r\nexport const breakpoints = {\r\n xs: 0,\r\n sm: 640,\r\n md: 768,\r\n lg: 1024,\r\n xl: 1280,\r\n}\r\n\r\nexport const css = (props: CSSProps, options?: CSSOptionProps) => {\r\n const cssOptions: CSSOptionProps = {\r\n ...options,\r\n breakpoints,\r\n aliases,\r\n getValue: (p: any, v: any, _c: any, dept) => {\r\n if (options?.getValue) {\r\n let _val = options?.getValue(p, v, _c, dept)\r\n if (_val) return _val\r\n }\r\n return getValue(p, v, _c)\r\n },\r\n getProps: (p: any, v: any, _c: any, dept) => {\r\n if (options?.getProps) {\r\n let _p = options?.getProps(p, v, _c, dept)\r\n if (_p) return _p\r\n }\r\n return getProps(p, v, _c)\r\n },\r\n }\r\n return _css<Aliases, BreakpointKeys>(props, cssOptions)\r\n}\r\n\r\nexport const adjustColor = (hex: string, factor: number) => {\r\n\r\n hex = hex.replace(/^#/, '')\r\n\r\n let r = parseInt(hex.slice(0, 2), 16)\r\n let g = parseInt(hex.slice(2, 4), 16)\r\n let b = parseInt(hex.slice(4, 6), 16)\r\n\r\n r = Math.floor(r * factor)\r\n g = Math.floor(g * factor)\r\n b = Math.floor(b * factor)\r\n\r\n r = Math.min(255, Math.max(0, r))\r\n g = Math.min(255, Math.max(0, g))\r\n b = Math.min(255, Math.max(0, b))\r\n\r\n return `#${r.toString(16).padStart(2, '0')}${g.toString(16).padStart(2, '0')}${b.toString(16).padStart(2, '0')}`;\r\n}\r\n\r\nexport const adjustTextContrast = (color: string) => {\r\n color = color.replace(/^#/, '')\r\n const r = parseInt(color.slice(0, 2), 16);\r\n const g = parseInt(color.slice(2, 4), 16);\r\n const b = parseInt(color.slice(4, 6), 16);\r\n\r\n const luminance = (0.299 * r + 0.587 * g + 0.114 * b) / 255;\r\n return luminance > 0.5 ? '#111111' : '#FFFFFF';\r\n}\r\n\r\nexport const alpha = (color: string, opacity = 1) => {\r\n if (typeof opacity !== 'number') return color\r\n let _opacity = opacity * 100\r\n if (!color.startsWith(\"#\")) throw new Error(`color must be hex`)\r\n return (color + (`0${Math.round((255 / 100) * _opacity).toString(16)}`.slice(-2))).toUpperCase();\r\n};\r\n\r\n"],"names":["_css"],"mappings":";;;;;AAWO,MAAM,WAAW,GAAG;AACvB,IAAA,EAAE,EAAE,CAAC;AACL,IAAA,EAAE,EAAE,GAAG;AACP,IAAA,EAAE,EAAE,GAAG;AACP,IAAA,EAAE,EAAE,IAAI;AACR,IAAA,EAAE,EAAE,IAAI;;MAGC,GAAG,GAAG,CAAC,KAAe,EAAE,OAAwB,KAAI;AAC7D,IAAA,MAAM,UAAU,GAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EACT,OAAO,CAAA,EAAA,EACV,WAAW;AACX,QAAA,OAAO,EACP,QAAQ,EAAE,CAAC,CAAM,EAAE,CAAM,EAAE,EAAO,EAAE,IAAI,KAAI;YACxC,IAAI,OAAO,aAAP,OAAO,KAAA,MAAA,GAAA,MAAA,GAAP,OAAO,CAAE,QAAQ,EA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,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC;AAEzC,IAAA,MAAM,SAAS,GAAG,CAAC,KAAK,GAAG,CAAC,GAAG,KAAK,GAAG,CAAC,GAAG,KAAK,GAAG,CAAC,IAAI,GAAG;IAC3D,OAAO,SAAS,GAAG,GAAG,GAAG,SAAS,GAAG,SAAS;AAClD;AAEO,MAAM,KAAK,GAAG,CAAC,KAAa,EAAE,OAAO,GAAG,CAAC,KAAI;IAChD,IAAI,OAAO,OAAO,KAAK,QAAQ;AAAE,QAAA,OAAO,KAAK;AAC7C,IAAA,IAAI,QAAQ,GAAG,OAAO,GAAG,GAAG;AAC5B,IAAA,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC;AAAE,QAAA,MAAM,IAAI,KAAK,CAAC,CAAA,iBAAA,CAAmB,CAAC;AAChE,IAAA,OAAO,CAAC,KAAK,IAAI,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,GAAG,GAAG,IAAI,QAAQ,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAA,CAAE,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,EAAE,WAAW,EAAE;AACpG;;;;"}
|
package/index.cjs
CHANGED
|
@@ -7,18 +7,18 @@ var useColorTemplate = require('./hooks/useColorTemplate.cjs');
|
|
|
7
7
|
var useBreakpoint = require('./breakpoint/useBreakpoint.cjs');
|
|
8
8
|
var useBreakpointProps = require('./breakpoint/useBreakpointProps.cjs');
|
|
9
9
|
var useInterface = require('./hooks/useInterface.cjs');
|
|
10
|
-
var index$
|
|
10
|
+
var index$6 = require('./hooks/useTransition/index.cjs');
|
|
11
11
|
var useMergeRefs = require('./hooks/useMergeRefs.cjs');
|
|
12
|
-
var index$
|
|
12
|
+
var index$5 = require('./Transition/index.cjs');
|
|
13
13
|
var index = require('./AppRoot/index.cjs');
|
|
14
|
-
var
|
|
14
|
+
var index$3 = require('./Portal/index.cjs');
|
|
15
15
|
var Renderar = require('./AppRoot/Renderar.cjs');
|
|
16
|
-
var index$
|
|
16
|
+
var index$4 = require('./Document/index.cjs');
|
|
17
17
|
var AppRootProvider = require('./AppRoot/AppRootProvider.cjs');
|
|
18
18
|
var CSSCacheProvider = require('./css/CSSCacheProvider.cjs');
|
|
19
19
|
var index$1 = require('./Iframe/index.cjs');
|
|
20
|
-
var index$
|
|
21
|
-
var index$
|
|
20
|
+
var index$7 = require('./css/index.cjs');
|
|
21
|
+
var index$8 = require('./theme/index.cjs');
|
|
22
22
|
var getValue = require('./css/getValue.cjs');
|
|
23
23
|
var getProps = require('./css/getProps.cjs');
|
|
24
24
|
var ThemeProvider = require('./theme/ThemeProvider.cjs');
|
|
@@ -36,24 +36,24 @@ exports.useColorTemplate = useColorTemplate;
|
|
|
36
36
|
exports.useBreakpoint = useBreakpoint;
|
|
37
37
|
exports.useBreakpointProps = useBreakpointProps;
|
|
38
38
|
exports.useInterface = useInterface;
|
|
39
|
-
exports.useTransition = index$
|
|
39
|
+
exports.useTransition = index$6;
|
|
40
40
|
exports.useMergeRefs = useMergeRefs;
|
|
41
|
-
exports.Transition = index$
|
|
41
|
+
exports.Transition = index$5;
|
|
42
42
|
exports.AppRoot = index;
|
|
43
|
-
exports.
|
|
43
|
+
exports.Portal = index$3;
|
|
44
44
|
exports.Renderar = Renderar.Renderar;
|
|
45
|
-
exports.useDocument = index$
|
|
45
|
+
exports.useDocument = index$4.useDocument;
|
|
46
46
|
exports.useAppRootElement = AppRootProvider.useAppRootElement;
|
|
47
47
|
exports.getCSSCache = CSSCacheProvider.getCSSCache;
|
|
48
48
|
exports.useCSSCache = CSSCacheProvider.useCSSCache;
|
|
49
49
|
exports.useCSSCacheId = CSSCacheProvider.useCSSCacheId;
|
|
50
50
|
exports.Iframe = index$1;
|
|
51
|
-
exports.adjustColor = index$
|
|
52
|
-
exports.adjustTextContrast = index$
|
|
53
|
-
exports.alpha = index$
|
|
54
|
-
exports.breakpoints = index$
|
|
55
|
-
exports.css = index$
|
|
56
|
-
exports.themeRootClass = index$
|
|
51
|
+
exports.adjustColor = index$7.adjustColor;
|
|
52
|
+
exports.adjustTextContrast = index$7.adjustTextContrast;
|
|
53
|
+
exports.alpha = index$7.alpha;
|
|
54
|
+
exports.breakpoints = index$7.breakpoints;
|
|
55
|
+
exports.css = index$7.css;
|
|
56
|
+
exports.themeRootClass = index$8.themeRootClass;
|
|
57
57
|
exports.getValue = getValue;
|
|
58
58
|
exports.getProps = getProps;
|
|
59
59
|
exports.ThemeProvider = ThemeProvider;
|
package/index.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ export { UseTransitionProps, UseTransitionState, UseTransitionVariant, UseTransi
|
|
|
9
9
|
export { default as useMergeRefs } from './hooks/useMergeRefs.js';
|
|
10
10
|
export { default as Transition, TransitionProps } from './Transition/index.js';
|
|
11
11
|
export { default as AppRoot, AppRootProps } from './AppRoot/index.js';
|
|
12
|
-
export { default as
|
|
12
|
+
export { default as Portal, PortalProps } from './Portal/index.js';
|
|
13
13
|
export { Renderar } from './AppRoot/Renderar.js';
|
|
14
14
|
export { useDocument } from './Document/index.js';
|
|
15
15
|
export { useAppRootElement } from './AppRoot/AppRootProvider.js';
|
package/index.js
CHANGED
|
@@ -9,7 +9,7 @@ export { default as useTransition } from './hooks/useTransition/index.js';
|
|
|
9
9
|
export { default as useMergeRefs } from './hooks/useMergeRefs.js';
|
|
10
10
|
export { default as Transition } from './Transition/index.js';
|
|
11
11
|
export { default as AppRoot } from './AppRoot/index.js';
|
|
12
|
-
export { default as
|
|
12
|
+
export { default as Portal } from './Portal/index.js';
|
|
13
13
|
export { Renderar } from './AppRoot/Renderar.js';
|
|
14
14
|
export { useDocument } from './Document/index.js';
|
|
15
15
|
export { useAppRootElement } from './AppRoot/AppRootProvider.js';
|
package/package.json
CHANGED
|
@@ -82,7 +82,7 @@ const lightThemeOptions = {
|
|
|
82
82
|
secondary: "#D1D5DB", // stronger divider for emphasis
|
|
83
83
|
},
|
|
84
84
|
text: {
|
|
85
|
-
primary: "#
|
|
85
|
+
primary: "#2E2E2E",
|
|
86
86
|
secondary: "#6B7280",
|
|
87
87
|
},
|
|
88
88
|
brand: {
|
|
@@ -133,7 +133,7 @@ const createDefaultThemes = () => {
|
|
|
133
133
|
secondary: "#2E2E2E",
|
|
134
134
|
},
|
|
135
135
|
text: {
|
|
136
|
-
primary: "#
|
|
136
|
+
primary: "#E5E7EB", // main readable text
|
|
137
137
|
secondary: "#9CA3AF", // muted / secondary text
|
|
138
138
|
},
|
|
139
139
|
brand: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThemeDefaultOptions.cjs","sources":["../../src/theme/ThemeDefaultOptions.ts"],"sourcesContent":["import { createTheme } from './createTheme'\r\nimport { ThemeOptionInput, ThemeTypographyType } from './types'\r\n\r\nexport const lightShadows = [\r\n \"none\",\r\n \"0px 2px 1px -1px rgba(0,0,0,0.2),0px 1px 1px 0px rgba(0,0,0,0.14),0px 1px 3px 0px rgba(0,0,0,0.12)\",\r\n \"0px 3px 1px -2px rgba(0,0,0,0.2),0px 2px 2px 0px rgba(0,0,0,0.14),0px 1px 5px 0px rgba(0,0,0,0.12)\",\r\n \"0px 3px 3px -2px rgba(0,0,0,0.2),0px 3px 4px 0px rgba(0,0,0,0.14),0px 1px 8px 0px rgba(0,0,0,0.12)\",\r\n \"0px 2px 4px -1px rgba(0,0,0,0.2),0px 4px 5px 0px rgba(0,0,0,0.14),0px 1px 10px 0px rgba(0,0,0,0.12)\",\r\n \"0px 3px 5px -1px rgba(0,0,0,0.2),0px 5px 8px 0px rgba(0,0,0,0.14),0px 1px 14px 0px rgba(0,0,0,0.12)\",\r\n \"0px 3px 5px -1px rgba(0,0,0,0.2),0px 6px 10px 0px rgba(0,0,0,0.14),0px 1px 18px 0px rgba(0,0,0,0.12)\",\r\n \"0px 4px 5px -2px rgba(0,0,0,0.2),0px 7px 10px 1px rgba(0,0,0,0.14),0px 2px 16px 1px rgba(0,0,0,0.12)\",\r\n \"0px 5px 5px -3px rgba(0,0,0,0.2),0px 8px 10px 1px rgba(0,0,0,0.14),0px 3px 14px 2px rgba(0,0,0,0.12)\",\r\n \"0px 5px 6px -3px rgba(0,0,0,0.2),0px 9px 12px 1px rgba(0,0,0,0.14),0px 3px 16px 2px rgba(0,0,0,0.12)\",\r\n \"0px 6px 6px -3px rgba(0,0,0,0.2),0px 10px 14px 1px rgba(0,0,0,0.14),0px 4px 18px 3px rgba(0,0,0,0.12)\",\r\n \"0px 6px 7px -4px rgba(0,0,0,0.2),0px 11px 15px 1px rgba(0,0,0,0.14),0px 4px 20px 3px rgba(0,0,0,0.12)\",\r\n \"0px 7px 8px -4px rgba(0,0,0,0.2),0px 12px 17px 2px rgba(0,0,0,0.14),0px 5px 22px 4px rgba(0,0,0,0.12)\",\r\n \"0px 7px 8px -4px rgba(0,0,0,0.2),0px 13px 19px 2px rgba(0,0,0,0.14),0px 5px 24px 4px rgba(0,0,0,0.12)\",\r\n \"0px 7px 9px -4px rgba(0,0,0,0.2),0px 14px 21px 2px rgba(0,0,0,0.14),0px 5px 26px 4px rgba(0,0,0,0.12)\",\r\n \"0px 8px 9px -5px rgba(0,0,0,0.2),0px 15px 22px 2px rgba(0,0,0,0.14),0px 6px 28px 5px rgba(0,0,0,0.12)\",\r\n \"0px 8px 10px -5px rgba(0,0,0,0.2),0px 16px 24px 2px rgba(0,0,0,0.14),0px 6px 30px 5px rgba(0,0,0,0.12)\",\r\n \"0px 8px 11px -5px rgba(0,0,0,0.2),0px 17px 26px 2px rgba(0,0,0,0.14),0px 6px 32px 5px rgba(0,0,0,0.12)\",\r\n \"0px 9px 11px -5px rgba(0,0,0,0.2),0px 18px 28px 2px rgba(0,0,0,0.14),0px 7px 34px 6px rgba(0,0,0,0.12)\",\r\n \"0px 9px 12px -6px rgba(0,0,0,0.2),0px 19px 29px 2px rgba(0,0,0,0.14),0px 7px 36px 6px rgba(0,0,0,0.12)\",\r\n \"0px 10px 13px -6px rgba(0,0,0,0.2),0px 20px 31px 3px rgba(0,0,0,0.14),0px 8px 38px 7px rgba(0,0,0,0.12)\",\r\n \"0px 10px 13px -6px rgba(0,0,0,0.2),0px 21px 33px 3px rgba(0,0,0,0.14),0px 8px 40px 7px rgba(0,0,0,0.12)\",\r\n \"0px 10px 14px -6px rgba(0,0,0,0.2),0px 22px 35px 3px rgba(0,0,0,0.14),0px 8px 42px 7px rgba(0,0,0,0.12)\",\r\n \"0px 11px 14px -7px rgba(0,0,0,0.2),0px 23px 36px 3px rgba(0,0,0,0.14),0px 9px 44px 8px rgba(0,0,0,0.12)\",\r\n \"0px 11px 15px -7px rgba(0,0,0,0.2),0px 24px 38px 3px rgba(0,0,0,0.14),0px 9px 46px 8px rgba(0,0,0,0.12)\",\r\n]\r\n\r\nexport const darkShadows = [\r\n \"none\",\r\n\r\n \"0px 1px 2px rgba(0,0,0,0.65), inset 0px 1px 0px rgba(255,255,255,0.04)\",\r\n \"0px 2px 3px rgba(0,0,0,0.68), inset 0px 1px 0px rgba(255,255,255,0.04)\",\r\n \"0px 2px 4px rgba(0,0,0,0.7), inset 0px 1px 0px rgba(255,255,255,0.05)\",\r\n \"0px 3px 5px rgba(0,0,0,0.72), inset 0px 1px 0px rgba(255,255,255,0.05)\",\r\n\r\n \"0px 4px 6px rgba(0,0,0,0.75), inset 0px 1px 0px rgba(255,255,255,0.05)\",\r\n \"0px 5px 8px rgba(0,0,0,0.78), inset 0px 1px 0px rgba(255,255,255,0.06)\",\r\n \"0px 6px 10px rgba(0,0,0,0.8), inset 0px 1px 0px rgba(255,255,255,0.06)\",\r\n \"0px 7px 12px rgba(0,0,0,0.82), inset 0px 1px 0px rgba(255,255,255,0.06)\",\r\n \"0px 8px 14px rgba(0,0,0,0.84), inset 0px 1px 0px rgba(255,255,255,0.06)\",\r\n\r\n \"0px 9px 16px rgba(0,0,0,0.86), inset 0px 1px 0px rgba(255,255,255,0.07)\",\r\n \"0px 10px 18px rgba(0,0,0,0.88), inset 0px 1px 0px rgba(255,255,255,0.07)\",\r\n \"0px 11px 20px rgba(0,0,0,0.89), inset 0px 1px 0px rgba(255,255,255,0.07)\",\r\n \"0px 12px 22px rgba(0,0,0,0.9), inset 0px 1px 0px rgba(255,255,255,0.07)\",\r\n \"0px 13px 24px rgba(0,0,0,0.91), inset 0px 1px 0px rgba(255,255,255,0.07)\",\r\n\r\n \"0px 14px 26px rgba(0,0,0,0.92), inset 0px 1px 0px rgba(255,255,255,0.08)\",\r\n \"0px 15px 28px rgba(0,0,0,0.93), inset 0px 1px 0px rgba(255,255,255,0.08)\",\r\n \"0px 16px 30px rgba(0,0,0,0.94), inset 0px 1px 0px rgba(255,255,255,0.08)\",\r\n \"0px 18px 32px rgba(0,0,0,0.95), inset 0px 1px 0px rgba(255,255,255,0.08)\",\r\n \"0px 20px 34px rgba(0,0,0,0.95), inset 0px 1px 0px rgba(255,255,255,0.08)\",\r\n\r\n \"0px 22px 36px rgba(0,0,0,0.96), inset 0px 1px 0px rgba(255,255,255,0.08)\",\r\n \"0px 24px 38px rgba(0,0,0,0.97), inset 0px 1px 0px rgba(255,255,255,0.09)\",\r\n \"0px 26px 40px rgba(0,0,0,0.98), inset 0px 1px 0px rgba(255,255,255,0.09)\",\r\n \"0px 28px 42px rgba(0,0,0,0.99), inset 0px 1px 0px rgba(255,255,255,0.1)\",\r\n]\r\n\r\n\r\n\r\nexport const ThemeTypography: ThemeTypographyType = {\r\n h1: { fontSize: 48, lineHeight: 1.3, fontWeight: 600 }, // bolder for emphasis\r\n h2: { fontSize: 40, lineHeight: 1.35, fontWeight: 500 },\r\n h3: { fontSize: 34, lineHeight: 1.4, fontWeight: 500 },\r\n h4: { fontSize: 28, lineHeight: 1.45, fontWeight: 500 },\r\n h5: { fontSize: 24, lineHeight: 1.5, fontWeight: 500 },\r\n h6: { fontSize: 20, lineHeight: 1.55, fontWeight: 500 },\r\n big: { fontSize: 18, lineHeight: 1.6, fontWeight: 400 },\r\n text: { fontSize: 16, lineHeight: 1.6, fontWeight: 400 },\r\n button: { fontSize: 14, lineHeight: 1.6, fontWeight: 500 },\r\n small: { fontSize: 12, lineHeight: 1.6, fontWeight: 400 },\r\n}\r\n\r\nexport const lightThemeOptions: ThemeOptionInput = {\r\n name: \"light\",\r\n rtl: false,\r\n shadow: lightShadows,\r\n globalStyle: {},\r\n colors: {\r\n background: {\r\n primary: \"#FFFFFF\", // main app background\r\n secondary: \"#F3F4F6\", // slightly darker surface for sections/cards\r\n },\r\n\r\n divider: {\r\n primary: \"#E5E7EB\", // soft divider, visible on #FFFFFF\r\n secondary: \"#D1D5DB\", // stronger divider for emphasis\r\n },\r\n\r\n text: {\r\n primary: \"#111827\",\r\n secondary: \"#6B7280\",\r\n },\r\n\r\n brand: {\r\n primary: \"#2563EB\",\r\n secondary: \"#1D4ED8\",\r\n text: \"#F9FAFB\",\r\n },\r\n\r\n accent: {\r\n primary: \"#7C3AED\",\r\n secondary: \"#6D28D9\",\r\n text: \"#F9FAFB\",\r\n },\r\n\r\n success: {\r\n primary: \"#16A34A\",\r\n secondary: \"#15803D\",\r\n text: \"#F9FAFB\",\r\n },\r\n\r\n info: {\r\n primary: \"#2563EB\",\r\n secondary: \"#1D4ED8\",\r\n text: \"#F9FAFB\",\r\n },\r\n\r\n warning: {\r\n primary: \"#D97706\",\r\n secondary: \"#B45309\",\r\n text: \"#FFFBEB\",\r\n },\r\n\r\n danger: {\r\n primary: \"#DC2626\",\r\n secondary: \"#B91C1C\",\r\n text: \"#FEF2F2\",\r\n },\r\n },\r\n typography: ThemeTypography,\r\n interfaces: {}\r\n} as ThemeOptionInput\r\n\r\n\r\nexport const createDefaultThemes = () => {\r\n createTheme(\"light\", {})\r\n createTheme(\"dark\", {\r\n shadow: darkShadows,\r\n colors: {\r\n background: {\r\n primary: \"#121212\",\r\n secondary: \"#1E1E1E\",\r\n },\r\n\r\n divider: {\r\n primary: \"#262626\",\r\n secondary: \"#2E2E2E\",\r\n },\r\n\r\n text: {\r\n primary: \"#F3F4F6\", // main readable text\r\n secondary: \"#9CA3AF\", // muted / secondary text\r\n },\r\n\r\n brand: {\r\n primary: \"#1D4ED8\",\r\n secondary: \"#2563EB\",\r\n text: \"#F9FAFB\",\r\n },\r\n\r\n accent: {\r\n primary: \"#6D28D9\",\r\n secondary: \"#7C3AED\",\r\n text: \"#F9FAFB\",\r\n },\r\n\r\n success: {\r\n primary: \"#15803D\",\r\n secondary: \"#16A34A\",\r\n text: \"#F9FAFB\",\r\n },\r\n\r\n info: {\r\n primary: \"#1D4ED8\",\r\n secondary: \"#2563EB\",\r\n text: \"#F9FAFB\",\r\n },\r\n\r\n warning: {\r\n primary: \"#B45309\",\r\n secondary: \"#D97706\",\r\n text: \"#FFFBEB\",\r\n },\r\n\r\n danger: {\r\n primary: \"#B91C1C\",\r\n secondary: \"#DC2626\",\r\n text: \"#FEF2F2\",\r\n },\r\n }\r\n })\r\n}"],"names":["createTheme"],"mappings":";;;;AAGO,MAAM,YAAY,GAAG;IACxB,MAAM;IACN,oGAAoG;IACpG,oGAAoG;IACpG,oGAAoG;IACpG,qGAAqG;IACrG,qGAAqG;IACrG,sGAAsG;IACtG,sGAAsG;IACtG,sGAAsG;IACtG,sGAAsG;IACtG,uGAAuG;IACvG,uGAAuG;IACvG,uGAAuG;IACvG,uGAAuG;IACvG,uGAAuG;IACvG,uGAAuG;IACvG,wGAAwG;IACxG,wGAAwG;IACxG,wGAAwG;IACxG,wGAAwG;IACxG,yGAAyG;IACzG,yGAAyG;IACzG,yGAAyG;IACzG,yGAAyG;IACzG,yGAAyG;;AAGtG,MAAM,WAAW,GAAG;IACvB,MAAM;IAEN,wEAAwE;IACxE,wEAAwE;IACxE,uEAAuE;IACvE,wEAAwE;IAExE,wEAAwE;IACxE,wEAAwE;IACxE,wEAAwE;IACxE,yEAAyE;IACzE,yEAAyE;IAEzE,yEAAyE;IACzE,0EAA0E;IAC1E,0EAA0E;IAC1E,yEAAyE;IACzE,0EAA0E;IAE1E,0EAA0E;IAC1E,0EAA0E;IAC1E,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efaultOptions.cjs","sources":["../../src/theme/ThemeDefaultOptions.ts"],"sourcesContent":["import { createTheme } from './createTheme'\r\nimport { ThemeOptionInput, ThemeTypographyType } from './types'\r\n\r\nexport const lightShadows = [\r\n \"none\",\r\n \"0px 2px 1px -1px rgba(0,0,0,0.2),0px 1px 1px 0px rgba(0,0,0,0.14),0px 1px 3px 0px rgba(0,0,0,0.12)\",\r\n \"0px 3px 1px -2px rgba(0,0,0,0.2),0px 2px 2px 0px rgba(0,0,0,0.14),0px 1px 5px 0px rgba(0,0,0,0.12)\",\r\n \"0px 3px 3px -2px rgba(0,0,0,0.2),0px 3px 4px 0px rgba(0,0,0,0.14),0px 1px 8px 0px rgba(0,0,0,0.12)\",\r\n \"0px 2px 4px -1px rgba(0,0,0,0.2),0px 4px 5px 0px rgba(0,0,0,0.14),0px 1px 10px 0px rgba(0,0,0,0.12)\",\r\n \"0px 3px 5px -1px rgba(0,0,0,0.2),0px 5px 8px 0px rgba(0,0,0,0.14),0px 1px 14px 0px rgba(0,0,0,0.12)\",\r\n \"0px 3px 5px -1px rgba(0,0,0,0.2),0px 6px 10px 0px rgba(0,0,0,0.14),0px 1px 18px 0px rgba(0,0,0,0.12)\",\r\n \"0px 4px 5px -2px rgba(0,0,0,0.2),0px 7px 10px 1px rgba(0,0,0,0.14),0px 2px 16px 1px rgba(0,0,0,0.12)\",\r\n \"0px 5px 5px -3px rgba(0,0,0,0.2),0px 8px 10px 1px rgba(0,0,0,0.14),0px 3px 14px 2px rgba(0,0,0,0.12)\",\r\n \"0px 5px 6px -3px rgba(0,0,0,0.2),0px 9px 12px 1px rgba(0,0,0,0.14),0px 3px 16px 2px rgba(0,0,0,0.12)\",\r\n \"0px 6px 6px -3px rgba(0,0,0,0.2),0px 10px 14px 1px rgba(0,0,0,0.14),0px 4px 18px 3px rgba(0,0,0,0.12)\",\r\n \"0px 6px 7px -4px rgba(0,0,0,0.2),0px 11px 15px 1px rgba(0,0,0,0.14),0px 4px 20px 3px rgba(0,0,0,0.12)\",\r\n \"0px 7px 8px -4px rgba(0,0,0,0.2),0px 12px 17px 2px rgba(0,0,0,0.14),0px 5px 22px 4px rgba(0,0,0,0.12)\",\r\n \"0px 7px 8px -4px rgba(0,0,0,0.2),0px 13px 19px 2px rgba(0,0,0,0.14),0px 5px 24px 4px rgba(0,0,0,0.12)\",\r\n \"0px 7px 9px -4px rgba(0,0,0,0.2),0px 14px 21px 2px rgba(0,0,0,0.14),0px 5px 26px 4px rgba(0,0,0,0.12)\",\r\n \"0px 8px 9px -5px rgba(0,0,0,0.2),0px 15px 22px 2px rgba(0,0,0,0.14),0px 6px 28px 5px rgba(0,0,0,0.12)\",\r\n \"0px 8px 10px -5px rgba(0,0,0,0.2),0px 16px 24px 2px rgba(0,0,0,0.14),0px 6px 30px 5px rgba(0,0,0,0.12)\",\r\n \"0px 8px 11px -5px rgba(0,0,0,0.2),0px 17px 26px 2px rgba(0,0,0,0.14),0px 6px 32px 5px rgba(0,0,0,0.12)\",\r\n \"0px 9px 11px -5px rgba(0,0,0,0.2),0px 18px 28px 2px rgba(0,0,0,0.14),0px 7px 34px 6px rgba(0,0,0,0.12)\",\r\n \"0px 9px 12px -6px rgba(0,0,0,0.2),0px 19px 29px 2px rgba(0,0,0,0.14),0px 7px 36px 6px rgba(0,0,0,0.12)\",\r\n \"0px 10px 13px -6px rgba(0,0,0,0.2),0px 20px 31px 3px rgba(0,0,0,0.14),0px 8px 38px 7px rgba(0,0,0,0.12)\",\r\n \"0px 10px 13px -6px rgba(0,0,0,0.2),0px 21px 33px 3px rgba(0,0,0,0.14),0px 8px 40px 7px rgba(0,0,0,0.12)\",\r\n \"0px 10px 14px -6px rgba(0,0,0,0.2),0px 22px 35px 3px rgba(0,0,0,0.14),0px 8px 42px 7px rgba(0,0,0,0.12)\",\r\n \"0px 11px 14px -7px rgba(0,0,0,0.2),0px 23px 36px 3px rgba(0,0,0,0.14),0px 9px 44px 8px rgba(0,0,0,0.12)\",\r\n \"0px 11px 15px -7px rgba(0,0,0,0.2),0px 24px 38px 3px rgba(0,0,0,0.14),0px 9px 46px 8px rgba(0,0,0,0.12)\",\r\n]\r\n\r\nexport const darkShadows = [\r\n \"none\",\r\n\r\n \"0px 1px 2px rgba(0,0,0,0.65), inset 0px 1px 0px rgba(255,255,255,0.04)\",\r\n \"0px 2px 3px rgba(0,0,0,0.68), inset 0px 1px 0px rgba(255,255,255,0.04)\",\r\n \"0px 2px 4px rgba(0,0,0,0.7), inset 0px 1px 0px rgba(255,255,255,0.05)\",\r\n \"0px 3px 5px rgba(0,0,0,0.72), inset 0px 1px 0px rgba(255,255,255,0.05)\",\r\n\r\n \"0px 4px 6px rgba(0,0,0,0.75), inset 0px 1px 0px rgba(255,255,255,0.05)\",\r\n \"0px 5px 8px rgba(0,0,0,0.78), inset 0px 1px 0px rgba(255,255,255,0.06)\",\r\n \"0px 6px 10px rgba(0,0,0,0.8), inset 0px 1px 0px rgba(255,255,255,0.06)\",\r\n \"0px 7px 12px rgba(0,0,0,0.82), inset 0px 1px 0px rgba(255,255,255,0.06)\",\r\n \"0px 8px 14px rgba(0,0,0,0.84), inset 0px 1px 0px rgba(255,255,255,0.06)\",\r\n\r\n \"0px 9px 16px rgba(0,0,0,0.86), inset 0px 1px 0px rgba(255,255,255,0.07)\",\r\n \"0px 10px 18px rgba(0,0,0,0.88), inset 0px 1px 0px rgba(255,255,255,0.07)\",\r\n \"0px 11px 20px rgba(0,0,0,0.89), inset 0px 1px 0px rgba(255,255,255,0.07)\",\r\n \"0px 12px 22px rgba(0,0,0,0.9), inset 0px 1px 0px rgba(255,255,255,0.07)\",\r\n \"0px 13px 24px rgba(0,0,0,0.91), inset 0px 1px 0px rgba(255,255,255,0.07)\",\r\n\r\n \"0px 14px 26px rgba(0,0,0,0.92), inset 0px 1px 0px rgba(255,255,255,0.08)\",\r\n \"0px 15px 28px rgba(0,0,0,0.93), inset 0px 1px 0px rgba(255,255,255,0.08)\",\r\n \"0px 16px 30px rgba(0,0,0,0.94), inset 0px 1px 0px rgba(255,255,255,0.08)\",\r\n \"0px 18px 32px rgba(0,0,0,0.95), inset 0px 1px 0px rgba(255,255,255,0.08)\",\r\n \"0px 20px 34px rgba(0,0,0,0.95), inset 0px 1px 0px rgba(255,255,255,0.08)\",\r\n\r\n \"0px 22px 36px rgba(0,0,0,0.96), inset 0px 1px 0px rgba(255,255,255,0.08)\",\r\n \"0px 24px 38px rgba(0,0,0,0.97), inset 0px 1px 0px rgba(255,255,255,0.09)\",\r\n \"0px 26px 40px rgba(0,0,0,0.98), inset 0px 1px 0px rgba(255,255,255,0.09)\",\r\n \"0px 28px 42px rgba(0,0,0,0.99), inset 0px 1px 0px rgba(255,255,255,0.1)\",\r\n]\r\n\r\n\r\n\r\nexport const ThemeTypography: ThemeTypographyType = {\r\n h1: { fontSize: 48, lineHeight: 1.3, fontWeight: 600 }, // bolder for emphasis\r\n h2: { fontSize: 40, lineHeight: 1.35, fontWeight: 500 },\r\n h3: { fontSize: 34, lineHeight: 1.4, fontWeight: 500 },\r\n h4: { fontSize: 28, lineHeight: 1.45, fontWeight: 500 },\r\n h5: { fontSize: 24, lineHeight: 1.5, fontWeight: 500 },\r\n h6: { fontSize: 20, lineHeight: 1.55, fontWeight: 500 },\r\n big: { fontSize: 18, lineHeight: 1.6, fontWeight: 400 },\r\n text: { fontSize: 16, lineHeight: 1.6, fontWeight: 400 },\r\n button: { fontSize: 14, lineHeight: 1.6, fontWeight: 500 },\r\n small: { fontSize: 12, lineHeight: 1.6, fontWeight: 400 },\r\n}\r\n\r\nexport const lightThemeOptions: ThemeOptionInput = {\r\n name: \"light\",\r\n rtl: false,\r\n shadow: lightShadows,\r\n globalStyle: {},\r\n colors: {\r\n background: {\r\n primary: \"#FFFFFF\", // main app background\r\n secondary: \"#F3F4F6\", // slightly darker surface for sections/cards\r\n },\r\n\r\n divider: {\r\n primary: \"#E5E7EB\", // soft divider, visible on #FFFFFF\r\n secondary: \"#D1D5DB\", // stronger divider for emphasis\r\n },\r\n\r\n text: {\r\n primary: \"#2E2E2E\",\r\n secondary: \"#6B7280\",\r\n },\r\n\r\n brand: {\r\n primary: \"#2563EB\",\r\n secondary: \"#1D4ED8\",\r\n text: \"#F9FAFB\",\r\n },\r\n\r\n accent: {\r\n primary: \"#7C3AED\",\r\n secondary: \"#6D28D9\",\r\n text: \"#F9FAFB\",\r\n },\r\n\r\n success: {\r\n primary: \"#16A34A\",\r\n secondary: \"#15803D\",\r\n text: \"#F9FAFB\",\r\n },\r\n\r\n info: {\r\n primary: \"#2563EB\",\r\n secondary: \"#1D4ED8\",\r\n text: \"#F9FAFB\",\r\n },\r\n\r\n warning: {\r\n primary: \"#D97706\",\r\n secondary: \"#B45309\",\r\n text: \"#FFFBEB\",\r\n },\r\n\r\n danger: {\r\n primary: \"#DC2626\",\r\n secondary: \"#B91C1C\",\r\n text: \"#FEF2F2\",\r\n },\r\n },\r\n typography: ThemeTypography,\r\n interfaces: {}\r\n} as ThemeOptionInput\r\n\r\n\r\nexport const createDefaultThemes = () => {\r\n createTheme(\"light\", {})\r\n createTheme(\"dark\", {\r\n shadow: darkShadows,\r\n colors: {\r\n background: {\r\n primary: \"#121212\",\r\n secondary: \"#1E1E1E\",\r\n },\r\n\r\n divider: {\r\n primary: \"#262626\",\r\n secondary: \"#2E2E2E\",\r\n },\r\n\r\n text: {\r\n primary: \"#E5E7EB\", // main readable text\r\n secondary: \"#9CA3AF\", // muted / secondary text\r\n },\r\n\r\n brand: {\r\n primary: \"#1D4ED8\",\r\n secondary: \"#2563EB\",\r\n text: \"#F9FAFB\",\r\n },\r\n\r\n accent: {\r\n primary: \"#6D28D9\",\r\n secondary: \"#7C3AED\",\r\n text: \"#F9FAFB\",\r\n },\r\n\r\n success: {\r\n primary: \"#15803D\",\r\n secondary: \"#16A34A\",\r\n text: \"#F9FAFB\",\r\n },\r\n\r\n info: {\r\n primary: \"#1D4ED8\",\r\n secondary: \"#2563EB\",\r\n text: \"#F9FAFB\",\r\n },\r\n\r\n warning: {\r\n primary: \"#B45309\",\r\n secondary: \"#D97706\",\r\n text: \"#FFFBEB\",\r\n },\r\n\r\n danger: {\r\n primary: \"#B91C1C\",\r\n secondary: \"#DC2626\",\r\n text: \"#FEF2F2\",\r\n },\r\n }\r\n })\r\n}"],"names":["createTheme"],"mappings":";;;;AAGO,MAAM,YAAY,GAAG;IACxB,MAAM;IACN,oGAAoG;IACpG,oGAAoG;IACpG,oGAAoG;IACpG,qGAAqG;IACrG,qGAAqG;IACrG,sGAAsG;IACtG,sGAAsG;IACtG,sGAAsG;IACtG,sGAAsG;IACtG,uGAAuG;IACvG,uGAAuG;IACvG,uGAAuG;IACvG,uGAAuG;IACvG,uGAAuG;IACvG,uGAAuG;IACvG,wGAAwG;IACxG,wGAAwG;IACxG,wGAAwG;IACxG,wGAAwG;IACxG,yGAAyG;IACzG,yGAAyG;IACzG,yGAAyG;IACzG,yGAAyG;IACzG,yGAAyG;;AAGtG,MAAM,WAAW,GAAG;IACvB,MAAM;IAEN,wEAAwE;IACxE,wEAAwE;IACxE,uEAAuE;IACvE,wEAAwE;IAExE,wEAAwE;IACxE,wEAAwE;IACxE,wEAAwE;IACxE,yEAAyE;IACzE,yEAAyE;IAEzE,yEAAyE;IACzE,0EAA0E;IAC1E,0EAA0E;IAC1E,yEAAyE;IACzE,0EAA0E;IAE1E,0EAA0E;IAC1E,0EAA0E;IAC1E,0EAA0E;IAC1E,0EAA0E;IAC1E,0EAA0E;IAE1E,0EAA0E;IAC1E,0EAA0E;IAC1E,0EAA0E;IAC1E,yEAAyE;;AAKtE,MAAM,eAAe,GAAwB;AAChD,IAAA,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,UAAU,EAAE,GAAG,EAAE,UAAU,EAAE,GAAG,EAAE;AACtD,IAAA,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,UAAU,EAAE,GAAG,EAAE;AACvD,IAAA,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EA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AAA;AAED,YAAA,KAAK,EAAE;AACH,gBAAA,OAAO,EAAE,SAAS;AAClB,gBAAA,SAAS,EAAE,SAAS;AACpB,gBAAA,IAAI,EAAE,SAAS;AAClB,aAAA;AAED,YAAA,MAAM,EAAE;AACJ,gBAAA,OAAO,EAAE,SAAS;AAClB,gBAAA,SAAS,EAAE,SAAS;AACpB,gBAAA,IAAI,EAAE,SAAS;AAClB,aAAA;AAED,YAAA,OAAO,EAAE;AACL,gBAAA,OAAO,EAAE,SAAS;AAClB,gBAAA,SAAS,EAAE,SAAS;AACpB,gBAAA,IAAI,EAAE,SAAS;AAClB,aAAA;AAED,YAAA,IAAI,EAAE;AACF,gBAAA,OAAO,EAAE,SAAS;AAClB,gBAAA,SAAS,EAAE,SAAS;AACpB,gBAAA,IAAI,EAAE,SAAS;AAClB,aAAA;AAED,YAAA,OAAO,EAAE;AACL,gBAAA,OAAO,EAAE,SAAS;AAClB,gBAAA,SAAS,EAAE,SAAS;AACpB,gBAAA,IAAI,EAAE,SAAS;AAClB,aAAA;AAED,YAAA,MAAM,EAAE;AACJ,gBAAA,OAAO,EAAE,SAAS;AAClB,gBAAA,SAAS,EAAE,SAAS;AACpB,gBAAA,IAAI,EAAE,SAAS;AAClB,aAAA;AACJ;AACJ,KAAA,CAAC;AACN;;;;;;;;"}
|
|
@@ -80,7 +80,7 @@ const lightThemeOptions = {
|
|
|
80
80
|
secondary: "#D1D5DB", // stronger divider for emphasis
|
|
81
81
|
},
|
|
82
82
|
text: {
|
|
83
|
-
primary: "#
|
|
83
|
+
primary: "#2E2E2E",
|
|
84
84
|
secondary: "#6B7280",
|
|
85
85
|
},
|
|
86
86
|
brand: {
|
|
@@ -131,7 +131,7 @@ const createDefaultThemes = () => {
|
|
|
131
131
|
secondary: "#2E2E2E",
|
|
132
132
|
},
|
|
133
133
|
text: {
|
|
134
|
-
primary: "#
|
|
134
|
+
primary: "#E5E7EB", // main readable text
|
|
135
135
|
secondary: "#9CA3AF", // muted / secondary text
|
|
136
136
|
},
|
|
137
137
|
brand: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThemeDefaultOptions.js","sources":["../../src/theme/ThemeDefaultOptions.ts"],"sourcesContent":["import { createTheme } from './createTheme'\r\nimport { ThemeOptionInput, ThemeTypographyType } from './types'\r\n\r\nexport const lightShadows = [\r\n \"none\",\r\n \"0px 2px 1px -1px rgba(0,0,0,0.2),0px 1px 1px 0px rgba(0,0,0,0.14),0px 1px 3px 0px rgba(0,0,0,0.12)\",\r\n \"0px 3px 1px -2px rgba(0,0,0,0.2),0px 2px 2px 0px rgba(0,0,0,0.14),0px 1px 5px 0px rgba(0,0,0,0.12)\",\r\n \"0px 3px 3px -2px rgba(0,0,0,0.2),0px 3px 4px 0px rgba(0,0,0,0.14),0px 1px 8px 0px rgba(0,0,0,0.12)\",\r\n \"0px 2px 4px -1px rgba(0,0,0,0.2),0px 4px 5px 0px rgba(0,0,0,0.14),0px 1px 10px 0px rgba(0,0,0,0.12)\",\r\n \"0px 3px 5px -1px rgba(0,0,0,0.2),0px 5px 8px 0px rgba(0,0,0,0.14),0px 1px 14px 0px rgba(0,0,0,0.12)\",\r\n \"0px 3px 5px -1px rgba(0,0,0,0.2),0px 6px 10px 0px rgba(0,0,0,0.14),0px 1px 18px 0px rgba(0,0,0,0.12)\",\r\n \"0px 4px 5px -2px rgba(0,0,0,0.2),0px 7px 10px 1px rgba(0,0,0,0.14),0px 2px 16px 1px rgba(0,0,0,0.12)\",\r\n \"0px 5px 5px -3px rgba(0,0,0,0.2),0px 8px 10px 1px rgba(0,0,0,0.14),0px 3px 14px 2px rgba(0,0,0,0.12)\",\r\n \"0px 5px 6px -3px rgba(0,0,0,0.2),0px 9px 12px 1px rgba(0,0,0,0.14),0px 3px 16px 2px rgba(0,0,0,0.12)\",\r\n \"0px 6px 6px -3px rgba(0,0,0,0.2),0px 10px 14px 1px rgba(0,0,0,0.14),0px 4px 18px 3px rgba(0,0,0,0.12)\",\r\n \"0px 6px 7px -4px rgba(0,0,0,0.2),0px 11px 15px 1px rgba(0,0,0,0.14),0px 4px 20px 3px rgba(0,0,0,0.12)\",\r\n \"0px 7px 8px -4px rgba(0,0,0,0.2),0px 12px 17px 2px rgba(0,0,0,0.14),0px 5px 22px 4px rgba(0,0,0,0.12)\",\r\n \"0px 7px 8px -4px rgba(0,0,0,0.2),0px 13px 19px 2px rgba(0,0,0,0.14),0px 5px 24px 4px rgba(0,0,0,0.12)\",\r\n \"0px 7px 9px -4px rgba(0,0,0,0.2),0px 14px 21px 2px rgba(0,0,0,0.14),0px 5px 26px 4px rgba(0,0,0,0.12)\",\r\n \"0px 8px 9px -5px rgba(0,0,0,0.2),0px 15px 22px 2px rgba(0,0,0,0.14),0px 6px 28px 5px rgba(0,0,0,0.12)\",\r\n \"0px 8px 10px -5px rgba(0,0,0,0.2),0px 16px 24px 2px rgba(0,0,0,0.14),0px 6px 30px 5px rgba(0,0,0,0.12)\",\r\n \"0px 8px 11px -5px rgba(0,0,0,0.2),0px 17px 26px 2px rgba(0,0,0,0.14),0px 6px 32px 5px rgba(0,0,0,0.12)\",\r\n \"0px 9px 11px -5px rgba(0,0,0,0.2),0px 18px 28px 2px rgba(0,0,0,0.14),0px 7px 34px 6px rgba(0,0,0,0.12)\",\r\n \"0px 9px 12px -6px rgba(0,0,0,0.2),0px 19px 29px 2px rgba(0,0,0,0.14),0px 7px 36px 6px rgba(0,0,0,0.12)\",\r\n \"0px 10px 13px -6px rgba(0,0,0,0.2),0px 20px 31px 3px rgba(0,0,0,0.14),0px 8px 38px 7px rgba(0,0,0,0.12)\",\r\n \"0px 10px 13px -6px rgba(0,0,0,0.2),0px 21px 33px 3px rgba(0,0,0,0.14),0px 8px 40px 7px rgba(0,0,0,0.12)\",\r\n \"0px 10px 14px -6px rgba(0,0,0,0.2),0px 22px 35px 3px rgba(0,0,0,0.14),0px 8px 42px 7px rgba(0,0,0,0.12)\",\r\n \"0px 11px 14px -7px rgba(0,0,0,0.2),0px 23px 36px 3px rgba(0,0,0,0.14),0px 9px 44px 8px rgba(0,0,0,0.12)\",\r\n \"0px 11px 15px -7px rgba(0,0,0,0.2),0px 24px 38px 3px rgba(0,0,0,0.14),0px 9px 46px 8px rgba(0,0,0,0.12)\",\r\n]\r\n\r\nexport const darkShadows = [\r\n \"none\",\r\n\r\n \"0px 1px 2px rgba(0,0,0,0.65), inset 0px 1px 0px rgba(255,255,255,0.04)\",\r\n \"0px 2px 3px rgba(0,0,0,0.68), inset 0px 1px 0px rgba(255,255,255,0.04)\",\r\n \"0px 2px 4px rgba(0,0,0,0.7), inset 0px 1px 0px rgba(255,255,255,0.05)\",\r\n \"0px 3px 5px rgba(0,0,0,0.72), inset 0px 1px 0px rgba(255,255,255,0.05)\",\r\n\r\n \"0px 4px 6px rgba(0,0,0,0.75), inset 0px 1px 0px rgba(255,255,255,0.05)\",\r\n \"0px 5px 8px rgba(0,0,0,0.78), inset 0px 1px 0px rgba(255,255,255,0.06)\",\r\n \"0px 6px 10px rgba(0,0,0,0.8), inset 0px 1px 0px rgba(255,255,255,0.06)\",\r\n \"0px 7px 12px rgba(0,0,0,0.82), inset 0px 1px 0px rgba(255,255,255,0.06)\",\r\n \"0px 8px 14px rgba(0,0,0,0.84), inset 0px 1px 0px rgba(255,255,255,0.06)\",\r\n\r\n \"0px 9px 16px rgba(0,0,0,0.86), inset 0px 1px 0px rgba(255,255,255,0.07)\",\r\n \"0px 10px 18px rgba(0,0,0,0.88), inset 0px 1px 0px rgba(255,255,255,0.07)\",\r\n \"0px 11px 20px rgba(0,0,0,0.89), inset 0px 1px 0px rgba(255,255,255,0.07)\",\r\n \"0px 12px 22px rgba(0,0,0,0.9), inset 0px 1px 0px rgba(255,255,255,0.07)\",\r\n \"0px 13px 24px rgba(0,0,0,0.91), inset 0px 1px 0px rgba(255,255,255,0.07)\",\r\n\r\n \"0px 14px 26px rgba(0,0,0,0.92), inset 0px 1px 0px rgba(255,255,255,0.08)\",\r\n \"0px 15px 28px rgba(0,0,0,0.93), inset 0px 1px 0px rgba(255,255,255,0.08)\",\r\n \"0px 16px 30px rgba(0,0,0,0.94), inset 0px 1px 0px rgba(255,255,255,0.08)\",\r\n \"0px 18px 32px rgba(0,0,0,0.95), inset 0px 1px 0px rgba(255,255,255,0.08)\",\r\n \"0px 20px 34px rgba(0,0,0,0.95), inset 0px 1px 0px rgba(255,255,255,0.08)\",\r\n\r\n \"0px 22px 36px rgba(0,0,0,0.96), inset 0px 1px 0px rgba(255,255,255,0.08)\",\r\n \"0px 24px 38px rgba(0,0,0,0.97), inset 0px 1px 0px rgba(255,255,255,0.09)\",\r\n \"0px 26px 40px rgba(0,0,0,0.98), inset 0px 1px 0px rgba(255,255,255,0.09)\",\r\n \"0px 28px 42px rgba(0,0,0,0.99), inset 0px 1px 0px rgba(255,255,255,0.1)\",\r\n]\r\n\r\n\r\n\r\nexport const ThemeTypography: ThemeTypographyType = {\r\n h1: { fontSize: 48, lineHeight: 1.3, fontWeight: 600 }, // bolder for emphasis\r\n h2: { fontSize: 40, lineHeight: 1.35, fontWeight: 500 },\r\n h3: { fontSize: 34, lineHeight: 1.4, fontWeight: 500 },\r\n h4: { fontSize: 28, lineHeight: 1.45, fontWeight: 500 },\r\n h5: { fontSize: 24, lineHeight: 1.5, fontWeight: 500 },\r\n h6: { fontSize: 20, lineHeight: 1.55, fontWeight: 500 },\r\n big: { fontSize: 18, lineHeight: 1.6, fontWeight: 400 },\r\n text: { fontSize: 16, lineHeight: 1.6, fontWeight: 400 },\r\n button: { fontSize: 14, lineHeight: 1.6, fontWeight: 500 },\r\n small: { fontSize: 12, lineHeight: 1.6, fontWeight: 400 },\r\n}\r\n\r\nexport const lightThemeOptions: ThemeOptionInput = {\r\n name: \"light\",\r\n rtl: false,\r\n shadow: lightShadows,\r\n globalStyle: {},\r\n colors: {\r\n background: {\r\n primary: \"#FFFFFF\", // main app background\r\n secondary: \"#F3F4F6\", // slightly darker surface for sections/cards\r\n },\r\n\r\n divider: {\r\n primary: \"#E5E7EB\", // soft divider, visible on #FFFFFF\r\n secondary: \"#D1D5DB\", // stronger divider for emphasis\r\n },\r\n\r\n text: {\r\n primary: \"#111827\",\r\n secondary: \"#6B7280\",\r\n },\r\n\r\n brand: {\r\n primary: \"#2563EB\",\r\n secondary: \"#1D4ED8\",\r\n text: \"#F9FAFB\",\r\n },\r\n\r\n accent: {\r\n primary: \"#7C3AED\",\r\n secondary: \"#6D28D9\",\r\n text: \"#F9FAFB\",\r\n },\r\n\r\n success: {\r\n primary: \"#16A34A\",\r\n secondary: \"#15803D\",\r\n text: \"#F9FAFB\",\r\n },\r\n\r\n info: {\r\n primary: \"#2563EB\",\r\n secondary: \"#1D4ED8\",\r\n text: \"#F9FAFB\",\r\n },\r\n\r\n warning: {\r\n primary: \"#D97706\",\r\n secondary: \"#B45309\",\r\n text: \"#FFFBEB\",\r\n },\r\n\r\n danger: {\r\n primary: \"#DC2626\",\r\n secondary: \"#B91C1C\",\r\n text: \"#FEF2F2\",\r\n },\r\n },\r\n typography: ThemeTypography,\r\n interfaces: {}\r\n} as ThemeOptionInput\r\n\r\n\r\nexport const createDefaultThemes = () => {\r\n createTheme(\"light\", {})\r\n createTheme(\"dark\", {\r\n shadow: darkShadows,\r\n colors: {\r\n background: {\r\n primary: \"#121212\",\r\n secondary: \"#1E1E1E\",\r\n },\r\n\r\n divider: {\r\n primary: \"#262626\",\r\n secondary: \"#2E2E2E\",\r\n },\r\n\r\n text: {\r\n primary: \"#F3F4F6\", // main readable text\r\n secondary: \"#9CA3AF\", // muted / secondary text\r\n },\r\n\r\n brand: {\r\n primary: \"#1D4ED8\",\r\n secondary: \"#2563EB\",\r\n text: \"#F9FAFB\",\r\n },\r\n\r\n accent: {\r\n primary: \"#6D28D9\",\r\n secondary: \"#7C3AED\",\r\n text: \"#F9FAFB\",\r\n },\r\n\r\n success: {\r\n primary: \"#15803D\",\r\n secondary: \"#16A34A\",\r\n text: \"#F9FAFB\",\r\n },\r\n\r\n info: {\r\n primary: \"#1D4ED8\",\r\n secondary: \"#2563EB\",\r\n text: \"#F9FAFB\",\r\n },\r\n\r\n warning: {\r\n primary: \"#B45309\",\r\n secondary: \"#D97706\",\r\n text: \"#FFFBEB\",\r\n },\r\n\r\n danger: {\r\n primary: \"#B91C1C\",\r\n secondary: \"#DC2626\",\r\n text: \"#FEF2F2\",\r\n },\r\n }\r\n })\r\n}"],"names":[],"mappings":";;AAGO,MAAM,YAAY,GAAG;IACxB,MAAM;IACN,oGAAoG;IACpG,oGAAoG;IACpG,oGAAoG;IACpG,qGAAqG;IACrG,qGAAqG;IACrG,sGAAsG;IACtG,sGAAsG;IACtG,sGAAsG;IACtG,sGAAsG;IACtG,uGAAuG;IACvG,uGAAuG;IACvG,uGAAuG;IACvG,uGAAuG;IACvG,uGAAuG;IACvG,uGAAuG;IACvG,wGAAwG;IACxG,wGAAwG;IACxG,wGAAwG;IACxG,wGAAwG;IACxG,yGAAyG;IACzG,yGAAyG;IACzG,yGAAyG;IACzG,yGAAyG;IACzG,yGAAyG;;AAGtG,MAAM,WAAW,GAAG;IACvB,MAAM;IAEN,wEAAwE;IACxE,wEAAwE;IACxE,uEAAuE;IACvE,wEAAwE;IAExE,wEAAwE;IACxE,wEAAwE;IACxE,wEAAwE;IACxE,yEAAyE;IACzE,yEAAyE;IAEzE,yEAAyE;IACzE,0EAA0E;IAC1E,0EAA0E;IAC1E,yEAAyE;IACzE,0EAA0E;IAE1E,0EAA0E;IAC1E,0EAA0E;IAC1E,0EAA0E;IAC1E,0EAA0E;IAC1E,0EAA0E;IAE1E,0EAA0E;IAC1E,0EAA0E;IAC1E,0EAA0E;IAC1E,yEAAyE;;AAKtE,MAAM,eAAe,GAAwB;AAChD,IAAA,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,UAAU,EAAE,GAAG,EAAE,UAAU,EAAE,GAAG,EAAE;AACtD,IAAA,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,UAAU,EAAE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AE;gBACF,OAAO,EAAE,SAAS;gBAClB,SAAS,EAAE,SAAS;AACvB,aAAA;AAED,YAAA,KAAK,EAAE;AACH,gBAAA,OAAO,EAAE,SAAS;AAClB,gBAAA,SAAS,EAAE,SAAS;AACpB,gBAAA,IAAI,EAAE,SAAS;AAClB,aAAA;AAED,YAAA,MAAM,EAAE;AACJ,gBAAA,OAAO,EAAE,SAAS;AAClB,gBAAA,SAAS,EAAE,SAAS;AACpB,gBAAA,IAAI,EAAE,SAAS;AAClB,aAAA;AAED,YAAA,OAAO,EAAE;AACL,gBAAA,OAAO,EAAE,SAAS;AAClB,gBAAA,SAAS,EAAE,SAAS;AACpB,gBAAA,IAAI,EAAE,SAAS;AAClB,aAAA;AAED,YAAA,IAAI,EAAE;AACF,gBAAA,OAAO,EAAE,SAAS;AAClB,gBAAA,SAAS,EAAE,SAAS;AACpB,gBAAA,IAAI,EAAE,SAAS;AAClB,aAAA;AAED,YAAA,OAAO,EAAE;AACL,gBAAA,OAAO,EAAE,SAAS;AAClB,gBAAA,SAAS,EAAE,SAAS;AACpB,gBAAA,IAAI,EAAE,SAAS;AAClB,aAAA;AAED,YAAA,MAAM,EAAE;AACJ,gBAAA,OAAO,EAAE,SAAS;AAClB,gBAAA,SAAS,EAAE,SAAS;AACpB,gBAAA,IAAI,EAAE,SAAS;AAClB,aAAA;AACJ;AACJ,KAAA,CAAC;AACN;;;;"}
|
|
1
|
+
{"version":3,"file":"ThemeDefaultOptions.js","sources":["../../src/theme/ThemeDefaultOptions.ts"],"sourcesContent":["import { createTheme } from './createTheme'\r\nimport { ThemeOptionInput, ThemeTypographyType } from './types'\r\n\r\nexport const lightShadows = [\r\n \"none\",\r\n \"0px 2px 1px -1px rgba(0,0,0,0.2),0px 1px 1px 0px rgba(0,0,0,0.14),0px 1px 3px 0px rgba(0,0,0,0.12)\",\r\n \"0px 3px 1px -2px rgba(0,0,0,0.2),0px 2px 2px 0px rgba(0,0,0,0.14),0px 1px 5px 0px rgba(0,0,0,0.12)\",\r\n \"0px 3px 3px -2px rgba(0,0,0,0.2),0px 3px 4px 0px rgba(0,0,0,0.14),0px 1px 8px 0px rgba(0,0,0,0.12)\",\r\n \"0px 2px 4px -1px rgba(0,0,0,0.2),0px 4px 5px 0px rgba(0,0,0,0.14),0px 1px 10px 0px rgba(0,0,0,0.12)\",\r\n \"0px 3px 5px -1px rgba(0,0,0,0.2),0px 5px 8px 0px rgba(0,0,0,0.14),0px 1px 14px 0px rgba(0,0,0,0.12)\",\r\n \"0px 3px 5px -1px rgba(0,0,0,0.2),0px 6px 10px 0px rgba(0,0,0,0.14),0px 1px 18px 0px rgba(0,0,0,0.12)\",\r\n \"0px 4px 5px -2px rgba(0,0,0,0.2),0px 7px 10px 1px rgba(0,0,0,0.14),0px 2px 16px 1px rgba(0,0,0,0.12)\",\r\n \"0px 5px 5px -3px rgba(0,0,0,0.2),0px 8px 10px 1px rgba(0,0,0,0.14),0px 3px 14px 2px rgba(0,0,0,0.12)\",\r\n \"0px 5px 6px -3px rgba(0,0,0,0.2),0px 9px 12px 1px rgba(0,0,0,0.14),0px 3px 16px 2px rgba(0,0,0,0.12)\",\r\n \"0px 6px 6px -3px rgba(0,0,0,0.2),0px 10px 14px 1px rgba(0,0,0,0.14),0px 4px 18px 3px rgba(0,0,0,0.12)\",\r\n \"0px 6px 7px -4px rgba(0,0,0,0.2),0px 11px 15px 1px rgba(0,0,0,0.14),0px 4px 20px 3px rgba(0,0,0,0.12)\",\r\n \"0px 7px 8px -4px rgba(0,0,0,0.2),0px 12px 17px 2px rgba(0,0,0,0.14),0px 5px 22px 4px rgba(0,0,0,0.12)\",\r\n \"0px 7px 8px -4px rgba(0,0,0,0.2),0px 13px 19px 2px rgba(0,0,0,0.14),0px 5px 24px 4px rgba(0,0,0,0.12)\",\r\n \"0px 7px 9px -4px rgba(0,0,0,0.2),0px 14px 21px 2px rgba(0,0,0,0.14),0px 5px 26px 4px rgba(0,0,0,0.12)\",\r\n \"0px 8px 9px -5px rgba(0,0,0,0.2),0px 15px 22px 2px rgba(0,0,0,0.14),0px 6px 28px 5px rgba(0,0,0,0.12)\",\r\n \"0px 8px 10px -5px rgba(0,0,0,0.2),0px 16px 24px 2px rgba(0,0,0,0.14),0px 6px 30px 5px rgba(0,0,0,0.12)\",\r\n \"0px 8px 11px -5px rgba(0,0,0,0.2),0px 17px 26px 2px rgba(0,0,0,0.14),0px 6px 32px 5px rgba(0,0,0,0.12)\",\r\n \"0px 9px 11px -5px rgba(0,0,0,0.2),0px 18px 28px 2px rgba(0,0,0,0.14),0px 7px 34px 6px rgba(0,0,0,0.12)\",\r\n \"0px 9px 12px -6px rgba(0,0,0,0.2),0px 19px 29px 2px rgba(0,0,0,0.14),0px 7px 36px 6px rgba(0,0,0,0.12)\",\r\n \"0px 10px 13px -6px rgba(0,0,0,0.2),0px 20px 31px 3px rgba(0,0,0,0.14),0px 8px 38px 7px rgba(0,0,0,0.12)\",\r\n \"0px 10px 13px -6px rgba(0,0,0,0.2),0px 21px 33px 3px rgba(0,0,0,0.14),0px 8px 40px 7px rgba(0,0,0,0.12)\",\r\n \"0px 10px 14px -6px rgba(0,0,0,0.2),0px 22px 35px 3px rgba(0,0,0,0.14),0px 8px 42px 7px rgba(0,0,0,0.12)\",\r\n \"0px 11px 14px -7px rgba(0,0,0,0.2),0px 23px 36px 3px rgba(0,0,0,0.14),0px 9px 44px 8px rgba(0,0,0,0.12)\",\r\n \"0px 11px 15px -7px rgba(0,0,0,0.2),0px 24px 38px 3px rgba(0,0,0,0.14),0px 9px 46px 8px rgba(0,0,0,0.12)\",\r\n]\r\n\r\nexport const darkShadows = [\r\n \"none\",\r\n\r\n \"0px 1px 2px rgba(0,0,0,0.65), inset 0px 1px 0px rgba(255,255,255,0.04)\",\r\n \"0px 2px 3px rgba(0,0,0,0.68), inset 0px 1px 0px rgba(255,255,255,0.04)\",\r\n \"0px 2px 4px rgba(0,0,0,0.7), inset 0px 1px 0px rgba(255,255,255,0.05)\",\r\n \"0px 3px 5px rgba(0,0,0,0.72), inset 0px 1px 0px rgba(255,255,255,0.05)\",\r\n\r\n \"0px 4px 6px rgba(0,0,0,0.75), inset 0px 1px 0px rgba(255,255,255,0.05)\",\r\n \"0px 5px 8px rgba(0,0,0,0.78), inset 0px 1px 0px rgba(255,255,255,0.06)\",\r\n \"0px 6px 10px rgba(0,0,0,0.8), inset 0px 1px 0px rgba(255,255,255,0.06)\",\r\n \"0px 7px 12px rgba(0,0,0,0.82), inset 0px 1px 0px rgba(255,255,255,0.06)\",\r\n \"0px 8px 14px rgba(0,0,0,0.84), inset 0px 1px 0px rgba(255,255,255,0.06)\",\r\n\r\n \"0px 9px 16px rgba(0,0,0,0.86), inset 0px 1px 0px rgba(255,255,255,0.07)\",\r\n \"0px 10px 18px rgba(0,0,0,0.88), inset 0px 1px 0px rgba(255,255,255,0.07)\",\r\n \"0px 11px 20px rgba(0,0,0,0.89), inset 0px 1px 0px rgba(255,255,255,0.07)\",\r\n \"0px 12px 22px rgba(0,0,0,0.9), inset 0px 1px 0px rgba(255,255,255,0.07)\",\r\n \"0px 13px 24px rgba(0,0,0,0.91), inset 0px 1px 0px rgba(255,255,255,0.07)\",\r\n\r\n \"0px 14px 26px rgba(0,0,0,0.92), inset 0px 1px 0px rgba(255,255,255,0.08)\",\r\n \"0px 15px 28px rgba(0,0,0,0.93), inset 0px 1px 0px rgba(255,255,255,0.08)\",\r\n \"0px 16px 30px rgba(0,0,0,0.94), inset 0px 1px 0px rgba(255,255,255,0.08)\",\r\n \"0px 18px 32px rgba(0,0,0,0.95), inset 0px 1px 0px rgba(255,255,255,0.08)\",\r\n \"0px 20px 34px rgba(0,0,0,0.95), inset 0px 1px 0px rgba(255,255,255,0.08)\",\r\n\r\n \"0px 22px 36px rgba(0,0,0,0.96), inset 0px 1px 0px rgba(255,255,255,0.08)\",\r\n \"0px 24px 38px rgba(0,0,0,0.97), inset 0px 1px 0px rgba(255,255,255,0.09)\",\r\n \"0px 26px 40px rgba(0,0,0,0.98), inset 0px 1px 0px rgba(255,255,255,0.09)\",\r\n \"0px 28px 42px rgba(0,0,0,0.99), inset 0px 1px 0px rgba(255,255,255,0.1)\",\r\n]\r\n\r\n\r\n\r\nexport const ThemeTypography: ThemeTypographyType = {\r\n h1: { fontSize: 48, lineHeight: 1.3, fontWeight: 600 }, // bolder for emphasis\r\n h2: { fontSize: 40, lineHeight: 1.35, fontWeight: 500 },\r\n h3: { fontSize: 34, lineHeight: 1.4, fontWeight: 500 },\r\n h4: { fontSize: 28, lineHeight: 1.45, fontWeight: 500 },\r\n h5: { fontSize: 24, lineHeight: 1.5, fontWeight: 500 },\r\n h6: { fontSize: 20, lineHeight: 1.55, fontWeight: 500 },\r\n big: { fontSize: 18, lineHeight: 1.6, fontWeight: 400 },\r\n text: { fontSize: 16, lineHeight: 1.6, fontWeight: 400 },\r\n button: { fontSize: 14, lineHeight: 1.6, fontWeight: 500 },\r\n small: { fontSize: 12, lineHeight: 1.6, fontWeight: 400 },\r\n}\r\n\r\nexport const lightThemeOptions: ThemeOptionInput = {\r\n name: \"light\",\r\n rtl: false,\r\n shadow: lightShadows,\r\n globalStyle: {},\r\n colors: {\r\n background: {\r\n primary: \"#FFFFFF\", // main app background\r\n secondary: \"#F3F4F6\", // slightly darker surface for sections/cards\r\n },\r\n\r\n divider: {\r\n primary: \"#E5E7EB\", // soft divider, visible on #FFFFFF\r\n secondary: \"#D1D5DB\", // stronger divider for emphasis\r\n },\r\n\r\n text: {\r\n primary: \"#2E2E2E\",\r\n secondary: \"#6B7280\",\r\n },\r\n\r\n brand: {\r\n primary: \"#2563EB\",\r\n secondary: \"#1D4ED8\",\r\n text: \"#F9FAFB\",\r\n },\r\n\r\n accent: {\r\n primary: \"#7C3AED\",\r\n secondary: \"#6D28D9\",\r\n text: \"#F9FAFB\",\r\n },\r\n\r\n success: {\r\n primary: \"#16A34A\",\r\n secondary: \"#15803D\",\r\n text: \"#F9FAFB\",\r\n },\r\n\r\n info: {\r\n primary: \"#2563EB\",\r\n secondary: \"#1D4ED8\",\r\n text: \"#F9FAFB\",\r\n },\r\n\r\n warning: {\r\n primary: \"#D97706\",\r\n secondary: \"#B45309\",\r\n text: \"#FFFBEB\",\r\n },\r\n\r\n danger: {\r\n primary: \"#DC2626\",\r\n secondary: \"#B91C1C\",\r\n text: \"#FEF2F2\",\r\n },\r\n },\r\n typography: ThemeTypography,\r\n interfaces: {}\r\n} as ThemeOptionInput\r\n\r\n\r\nexport const createDefaultThemes = () => {\r\n createTheme(\"light\", {})\r\n createTheme(\"dark\", {\r\n shadow: darkShadows,\r\n colors: {\r\n background: {\r\n primary: \"#121212\",\r\n secondary: \"#1E1E1E\",\r\n },\r\n\r\n divider: {\r\n primary: \"#262626\",\r\n secondary: \"#2E2E2E\",\r\n },\r\n\r\n text: {\r\n primary: \"#E5E7EB\", // main readable text\r\n secondary: \"#9CA3AF\", // muted / secondary text\r\n },\r\n\r\n brand: {\r\n primary: \"#1D4ED8\",\r\n secondary: \"#2563EB\",\r\n text: \"#F9FAFB\",\r\n },\r\n\r\n accent: {\r\n primary: \"#6D28D9\",\r\n secondary: \"#7C3AED\",\r\n text: \"#F9FAFB\",\r\n },\r\n\r\n success: {\r\n primary: \"#15803D\",\r\n secondary: \"#16A34A\",\r\n text: \"#F9FAFB\",\r\n },\r\n\r\n info: {\r\n primary: \"#1D4ED8\",\r\n secondary: \"#2563EB\",\r\n text: \"#F9FAFB\",\r\n },\r\n\r\n warning: {\r\n primary: \"#B45309\",\r\n secondary: \"#D97706\",\r\n text: \"#FFFBEB\",\r\n },\r\n\r\n danger: {\r\n primary: \"#B91C1C\",\r\n secondary: \"#DC2626\",\r\n text: \"#FEF2F2\",\r\n },\r\n }\r\n })\r\n}"],"names":[],"mappings":";;AAGO,MAAM,YAAY,GAAG;IACxB,MAAM;IACN,oGAAoG;IACpG,oGAAoG;IACpG,oGAAoG;IACpG,qGAAqG;IACrG,qGAAqG;IACrG,sGAAsG;IACtG,sGAAsG;IACtG,sGAAsG;IACtG,sGAAsG;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B,gBAAA,IAAI,EAAE,SAAS;AAClB,aAAA;AAED,YAAA,IAAI,EAAE;AACF,gBAAA,OAAO,EAAE,SAAS;AAClB,gBAAA,SAAS,EAAE,SAAS;AACpB,gBAAA,IAAI,EAAE,SAAS;AAClB,aAAA;AAED,YAAA,OAAO,EAAE;AACL,gBAAA,OAAO,EAAE,SAAS;AAClB,gBAAA,SAAS,EAAE,SAAS;AACpB,gBAAA,IAAI,EAAE,SAAS;AAClB,aAAA;AAED,YAAA,MAAM,EAAE;AACJ,gBAAA,OAAO,EAAE,SAAS;AAClB,gBAAA,SAAS,EAAE,SAAS;AACpB,gBAAA,IAAI,EAAE,SAAS;AAClB,aAAA;AACJ;AACJ,KAAA,CAAC;AACN;;;;"}
|
package/hooks/usePortal.cjs
DELETED
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
'use strict';
|
|
3
|
-
|
|
4
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
5
|
-
var React = require('react');
|
|
6
|
-
var client = require('react-dom/client');
|
|
7
|
-
var core = require('../theme/core.cjs');
|
|
8
|
-
require('../css/getValue.cjs');
|
|
9
|
-
require('oncss');
|
|
10
|
-
require('../theme/ThemeProvider.cjs');
|
|
11
|
-
require('react-state-bucket');
|
|
12
|
-
var AppRootProvider = require('../AppRoot/AppRootProvider.cjs');
|
|
13
|
-
var index = require('../Document/index.cjs');
|
|
14
|
-
var index$1 = require('../AppRoot/index.cjs');
|
|
15
|
-
var CSSCacheProvider = require('../css/CSSCacheProvider.cjs');
|
|
16
|
-
|
|
17
|
-
function usePortal(children, options) {
|
|
18
|
-
options = options || {};
|
|
19
|
-
if (options.autoMount === undefined) {
|
|
20
|
-
options.autoMount = true;
|
|
21
|
-
}
|
|
22
|
-
const [mounted, setMounted] = React.useState(options.autoMount);
|
|
23
|
-
const theme = core.useTheme();
|
|
24
|
-
const doc = index.useDocument();
|
|
25
|
-
const appRoot = AppRootProvider.useAppRootElement();
|
|
26
|
-
const cacheId = CSSCacheProvider.useCSSCacheId();
|
|
27
|
-
const { el, root } = React.useMemo(() => {
|
|
28
|
-
const el = doc === null || doc === void 0 ? void 0 : doc.document.createElement("div");
|
|
29
|
-
const root = client.createRoot(el);
|
|
30
|
-
return { el, root };
|
|
31
|
-
}, [options.autoMount]);
|
|
32
|
-
const container = () => {
|
|
33
|
-
const container = (options === null || options === void 0 ? void 0 : options.container) || appRoot;
|
|
34
|
-
if (!container)
|
|
35
|
-
throw new Error(`Container not found for portal. Please ensure that AppRoot is present in the application tree.`);
|
|
36
|
-
return container;
|
|
37
|
-
};
|
|
38
|
-
const mount = () => {
|
|
39
|
-
const cont = container();
|
|
40
|
-
if (!cont.contains(el)) {
|
|
41
|
-
cont.appendChild(el);
|
|
42
|
-
}
|
|
43
|
-
root.render(jsxRuntime.jsx(index$1, { disableRenderar: true, theme: theme.name, CSSCacheId: cacheId, document: doc === null || doc === void 0 ? void 0 : doc.document, children: children }));
|
|
44
|
-
};
|
|
45
|
-
const unmount = () => {
|
|
46
|
-
root.render(null);
|
|
47
|
-
el === null || el === void 0 ? void 0 : el.remove();
|
|
48
|
-
};
|
|
49
|
-
React.useEffect(() => {
|
|
50
|
-
(mounted && appRoot) ? mount() : unmount();
|
|
51
|
-
}, [mounted, appRoot]);
|
|
52
|
-
React.useEffect(() => {
|
|
53
|
-
if (mounted && appRoot)
|
|
54
|
-
mount();
|
|
55
|
-
}, [children, appRoot]);
|
|
56
|
-
React.useEffect(() => {
|
|
57
|
-
return () => {
|
|
58
|
-
unmount();
|
|
59
|
-
};
|
|
60
|
-
}, []);
|
|
61
|
-
return {
|
|
62
|
-
isMount: () => mounted,
|
|
63
|
-
mount: () => setMounted(true),
|
|
64
|
-
unmount: () => setMounted(false)
|
|
65
|
-
};
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
module.exports = usePortal;
|
|
69
|
-
//# sourceMappingURL=usePortal.cjs.map
|
package/hooks/usePortal.cjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"usePortal.cjs","sources":["../../src/hooks/usePortal.tsx"],"sourcesContent":["\"use client\";\r\nimport React, { useEffect, useMemo } from \"react\";\r\nimport { createRoot } from \"react-dom/client\";\r\nimport { ThemeProvider, useTheme } from \"../theme\";\r\nimport { useAppRootElement } from \"../AppRoot/AppRootProvider\";\r\nimport { useDocument } from \"../Document\";\r\nimport AppRoot from \"../AppRoot\";\r\nimport { useCSSCacheId } from \"../css/CSSCacheProvider\";\r\n\r\nexport type UsePortalOptions = {\r\n container?: HTMLElement;\r\n autoMount?: boolean;\r\n}\r\n\r\nfunction 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 doc = useDocument()\r\n const appRoot = useAppRootElement();\r\n const cacheId = useCSSCacheId()\r\n\r\n const { el, root } = useMemo(() => {\r\n const el = doc?.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 container = options?.container || appRoot\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(<AppRoot disableRenderar theme={theme.name} CSSCacheId={cacheId} document={doc?.document}>{children}</AppRoot>)\r\n }\r\n\r\n const unmount = () => {\r\n root.render(null)\r\n el?.remove();\r\n }\r\n\r\n useEffect(() => {\r\n (mounted && appRoot) ? mount() : unmount()\r\n }, [mounted, appRoot]);\r\n\r\n useEffect(() => {\r\n if (mounted && appRoot) mount()\r\n }, [children, appRoot]);\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":[],"mappings":";;;;;;;;;;;;;;;;AAcA;AACG;AACA;AACG;;AAEH;AACA;AACA;AACA;AACA;;AAGG;AACA;AACA;AACH;;AAGG;AACA;AAAgB;AAChB;AACH;;AAGG;;AAEG;;AAEH;AACH;;AAGG;AACA;AACH;;AAGG;AACH;;;AAG2B;AAC3B;;AAGG;AACG;AACH;;;AAIA;AACA;AACA;;AAEN;;"}
|
package/hooks/usePortal.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import React__default from 'react';
|
|
2
|
-
|
|
3
|
-
type UsePortalOptions = {
|
|
4
|
-
container?: HTMLElement;
|
|
5
|
-
autoMount?: boolean;
|
|
6
|
-
};
|
|
7
|
-
declare function usePortal(children: React__default.ReactNode, options?: UsePortalOptions): {
|
|
8
|
-
isMount: () => boolean;
|
|
9
|
-
mount: () => void;
|
|
10
|
-
unmount: () => void;
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
export { usePortal as default };
|
|
14
|
-
export type { UsePortalOptions };
|
package/hooks/usePortal.js
DELETED
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx } from 'react/jsx-runtime';
|
|
3
|
-
import React__default, { useMemo, useEffect } from 'react';
|
|
4
|
-
import { createRoot } from 'react-dom/client';
|
|
5
|
-
import { useTheme } from '../theme/core.js';
|
|
6
|
-
import '../css/getValue.js';
|
|
7
|
-
import 'oncss';
|
|
8
|
-
import '../theme/ThemeProvider.js';
|
|
9
|
-
import 'react-state-bucket';
|
|
10
|
-
import { useAppRootElement } from '../AppRoot/AppRootProvider.js';
|
|
11
|
-
import { useDocument } from '../Document/index.js';
|
|
12
|
-
import AppRoot from '../AppRoot/index.js';
|
|
13
|
-
import { useCSSCacheId } from '../css/CSSCacheProvider.js';
|
|
14
|
-
|
|
15
|
-
function usePortal(children, options) {
|
|
16
|
-
options = options || {};
|
|
17
|
-
if (options.autoMount === undefined) {
|
|
18
|
-
options.autoMount = true;
|
|
19
|
-
}
|
|
20
|
-
const [mounted, setMounted] = React__default.useState(options.autoMount);
|
|
21
|
-
const theme = useTheme();
|
|
22
|
-
const doc = useDocument();
|
|
23
|
-
const appRoot = useAppRootElement();
|
|
24
|
-
const cacheId = useCSSCacheId();
|
|
25
|
-
const { el, root } = useMemo(() => {
|
|
26
|
-
const el = doc === null || doc === void 0 ? void 0 : doc.document.createElement("div");
|
|
27
|
-
const root = createRoot(el);
|
|
28
|
-
return { el, root };
|
|
29
|
-
}, [options.autoMount]);
|
|
30
|
-
const container = () => {
|
|
31
|
-
const container = (options === null || options === void 0 ? void 0 : options.container) || appRoot;
|
|
32
|
-
if (!container)
|
|
33
|
-
throw new Error(`Container not found for portal. Please ensure that AppRoot is present in the application tree.`);
|
|
34
|
-
return container;
|
|
35
|
-
};
|
|
36
|
-
const mount = () => {
|
|
37
|
-
const cont = container();
|
|
38
|
-
if (!cont.contains(el)) {
|
|
39
|
-
cont.appendChild(el);
|
|
40
|
-
}
|
|
41
|
-
root.render(jsx(AppRoot, { disableRenderar: true, theme: theme.name, CSSCacheId: cacheId, document: doc === null || doc === void 0 ? void 0 : doc.document, children: children }));
|
|
42
|
-
};
|
|
43
|
-
const unmount = () => {
|
|
44
|
-
root.render(null);
|
|
45
|
-
el === null || el === void 0 ? void 0 : el.remove();
|
|
46
|
-
};
|
|
47
|
-
useEffect(() => {
|
|
48
|
-
(mounted && appRoot) ? mount() : unmount();
|
|
49
|
-
}, [mounted, appRoot]);
|
|
50
|
-
useEffect(() => {
|
|
51
|
-
if (mounted && appRoot)
|
|
52
|
-
mount();
|
|
53
|
-
}, [children, appRoot]);
|
|
54
|
-
useEffect(() => {
|
|
55
|
-
return () => {
|
|
56
|
-
unmount();
|
|
57
|
-
};
|
|
58
|
-
}, []);
|
|
59
|
-
return {
|
|
60
|
-
isMount: () => mounted,
|
|
61
|
-
mount: () => setMounted(true),
|
|
62
|
-
unmount: () => setMounted(false)
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
export { usePortal as default };
|
|
67
|
-
//# sourceMappingURL=usePortal.js.map
|
package/hooks/usePortal.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"usePortal.js","sources":["../../src/hooks/usePortal.tsx"],"sourcesContent":["\"use client\";\r\nimport React, { useEffect, useMemo } from \"react\";\r\nimport { createRoot } from \"react-dom/client\";\r\nimport { ThemeProvider, useTheme } from \"../theme\";\r\nimport { useAppRootElement } from \"../AppRoot/AppRootProvider\";\r\nimport { useDocument } from \"../Document\";\r\nimport AppRoot from \"../AppRoot\";\r\nimport { useCSSCacheId } from \"../css/CSSCacheProvider\";\r\n\r\nexport type UsePortalOptions = {\r\n container?: HTMLElement;\r\n autoMount?: boolean;\r\n}\r\n\r\nfunction 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 doc = useDocument()\r\n const appRoot = useAppRootElement();\r\n const cacheId = useCSSCacheId()\r\n\r\n const { el, root } = useMemo(() => {\r\n const el = doc?.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 container = options?.container || appRoot\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(<AppRoot disableRenderar theme={theme.name} CSSCacheId={cacheId} document={doc?.document}>{children}</AppRoot>)\r\n }\r\n\r\n const unmount = () => {\r\n root.render(null)\r\n el?.remove();\r\n }\r\n\r\n useEffect(() => {\r\n (mounted && appRoot) ? mount() : unmount()\r\n }, [mounted, appRoot]);\r\n\r\n useEffect(() => {\r\n if (mounted && appRoot) mount()\r\n }, [children, appRoot]);\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":[],"mappings":";;;;;;;;;;;;;;AAcA;AACG;AACA;AACG;;AAEH;AACA;AACA;AACA;AACA;;AAGG;AACA;AACA;AACH;;AAGG;AACA;AAAgB;AAChB;AACH;;AAGG;;AAEG;;AAEH;AACH;;AAGG;AACA;AACH;;AAGG;AACH;;;AAG2B;AAC3B;;AAGG;AACG;AACH;;;AAIA;AACA;AACA;;AAEN;;"}
|