@yourdash/uikit 0.1.7 → 0.1.9
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/dist/lib/core/toasts/toast.d.ts +1 -1
- package/dist/lib/core/toasts/toastContext.d.ts +2 -2
- package/dist/lib/core/toasts/useToast.d.ts +3 -3
- package/dist/lib/core/utils.d.ts +4 -0
- package/dist/src/index.d.ts +8 -0
- package/dist/uikit/lib/components/contextMenu/contextMenuRoot.mjs +68 -0
- package/dist/uikit/lib/components/contextMenu/contextMenuRoot.mjs.map +1 -0
- package/dist/uikit/lib/components/contextMenu/contextMenuRoot.module.css +7 -0
- package/dist/uikit/lib/components/contextMenu/contextMenuRoot.module.scss.mjs +10 -0
- package/dist/uikit/lib/components/contextMenu/contextMenuRoot.module.scss.mjs.map +1 -0
- package/dist/uikit/lib/components/tag/tag.module.scss.mjs +1 -1
- package/dist/uikit/lib/components/text/text.module.scss.mjs +1 -1
- package/dist/uikit/lib/core/isPhone.mjs +14 -0
- package/dist/uikit/lib/core/isPhone.mjs.map +1 -0
- package/dist/uikit/lib/core/remToPx.mjs +7 -0
- package/dist/uikit/lib/core/remToPx.mjs.map +1 -0
- package/dist/uikit/lib/core/root.mjs +19 -0
- package/dist/uikit/lib/core/root.mjs.map +1 -0
- package/dist/uikit/lib/core/toasts/toast.module.css +4 -0
- package/dist/uikit/lib/core/toasts/toast.module.scss.mjs +24 -0
- package/dist/uikit/lib/core/toasts/toast.module.scss.mjs.map +1 -0
- package/dist/uikit/lib/core/toasts/toastContext.mjs +10 -0
- package/dist/uikit/lib/core/toasts/toastContext.mjs.map +1 -0
- package/dist/uikit/lib/core/toasts/toasts.mjs +60 -0
- package/dist/uikit/lib/core/toasts/toasts.mjs.map +1 -0
- package/dist/uikit/lib/core/toasts/useToast.mjs +16 -0
- package/dist/uikit/lib/core/toasts/useToast.mjs.map +1 -0
- package/dist/uikit/lib/core/utils.mjs +11 -0
- package/dist/uikit/lib/core/utils.mjs.map +1 -0
- package/dist/uikit/lib/core/uuid.mjs +10 -0
- package/dist/uikit/lib/core/uuid.mjs.map +1 -0
- package/dist/uikit/src/index.mjs +90 -78
- package/dist/uikit/src/index.mjs.map +1 -1
- package/lib/core/toasts/toast.ts +1 -1
- package/lib/core/toasts/toastContext.ts +2 -2
- package/lib/core/toasts/useToast.ts +3 -3
- package/lib/core/utils.ts +4 -0
- package/package.json +2 -2
- /package/dist/uikit/lib/components/{tag/tag.module.css → text/text.module.css} +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
import { default as React } from 'react';
|
2
|
-
import { default as
|
2
|
+
import { default as IToast } from './toast.ts';
|
3
3
|
declare const ToastContext: React.Context<{
|
4
|
-
showToast: (data:
|
4
|
+
showToast: (data: IToast) => void;
|
5
5
|
}>;
|
6
6
|
export default ToastContext;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { default as
|
2
|
-
export default function
|
3
|
-
create(data:
|
1
|
+
import { default as IToast } from './toast.ts';
|
2
|
+
export default function useToasts(): {
|
3
|
+
create(data: IToast): void;
|
4
4
|
};
|
package/dist/src/index.d.ts
CHANGED
@@ -1,3 +1,11 @@
|
|
1
|
+
export { default as UIKitRoot } from '../lib/core/root.js';
|
2
|
+
export { default as clippy } from '../lib/core/clippy.js';
|
3
|
+
export { default as useToasts } from '../lib/core/toasts/useToast.js';
|
4
|
+
export type { default as IToastAction } from '../lib/core/toasts/toastAction.js';
|
5
|
+
export type { default as IToast } from '../lib/core/toasts/toast.js';
|
6
|
+
export { default as UKDecrementLevel } from '../lib/core/decrementLevel.js';
|
7
|
+
export { default as UKIncrementLevel } from '../lib/core/incrementLevel.js';
|
8
|
+
export * as utils from '../lib/core/utils.js';
|
1
9
|
export { UKIcons } from '../lib/core/iconDictionary.js';
|
2
10
|
export type { UKIconType } from '../lib/core/iconDictionary.js';
|
3
11
|
export { default as UKBox } from '../lib/components/box/UKBox.js';
|
@@ -0,0 +1,68 @@
|
|
1
|
+
import { jsx as H, jsxs as k } from "react/jsx-runtime";
|
2
|
+
import { c as P } from "../../../../_virtual/compiler-runtime.mjs";
|
3
|
+
import y, { useRef as T, useEffect as z } from "react";
|
4
|
+
import D from "../button/UKButton.mjs";
|
5
|
+
import G from "./contextMenuRootContext.mjs";
|
6
|
+
import N from "./contextMenuRoot.module.scss.mjs";
|
7
|
+
const A = (l) => {
|
8
|
+
const e = P.c(17), {
|
9
|
+
children: u
|
10
|
+
} = l;
|
11
|
+
let i;
|
12
|
+
e[0] === Symbol.for("react.memo_cache_sentinel") ? (i = {
|
13
|
+
x: 0,
|
14
|
+
y: 0
|
15
|
+
}, e[0] = i) : i = e[0];
|
16
|
+
const [t, B] = y.useState(i), [I, d] = y.useState(!1);
|
17
|
+
let r;
|
18
|
+
e[1] === Symbol.for("react.memo_cache_sentinel") ? (r = [], e[1] = r) : r = e[1];
|
19
|
+
const [p, U] = y.useState(r), x = T(null);
|
20
|
+
let c, f;
|
21
|
+
e[2] === Symbol.for("react.memo_cache_sentinel") ? (c = () => {
|
22
|
+
window.addEventListener("resize", () => {
|
23
|
+
d(!1);
|
24
|
+
});
|
25
|
+
}, f = [], e[2] = c, e[3] = f) : (c = e[2], f = e[3]), z(c, f);
|
26
|
+
let m;
|
27
|
+
e[4] === Symbol.for("react.memo_cache_sentinel") ? (m = {
|
28
|
+
createMenu: (W) => {
|
29
|
+
var M, v;
|
30
|
+
const {
|
31
|
+
x: _,
|
32
|
+
y: b,
|
33
|
+
items: j
|
34
|
+
} = W, g = window.innerWidth, w = window.innerHeight, R = ((M = x.current) == null ? void 0 : M.getBoundingClientRect().width) || 200, S = ((v = x.current) == null ? void 0 : v.getBoundingClientRect().height) || 200;
|
35
|
+
let C = _, E = b;
|
36
|
+
_ + R >= g && (C = g - R), b + S >= w && (E = w - S), B({
|
37
|
+
x: C,
|
38
|
+
y: E
|
39
|
+
}), U(j), d(!0);
|
40
|
+
},
|
41
|
+
destroyMenu: () => {
|
42
|
+
d(!1);
|
43
|
+
}
|
44
|
+
}, e[4] = m) : m = e[4];
|
45
|
+
const h = I ? "flex" : "none";
|
46
|
+
let o;
|
47
|
+
e[5] !== t.x || e[6] !== t.y || e[7] !== h ? (o = {
|
48
|
+
display: h,
|
49
|
+
left: t.x,
|
50
|
+
top: t.y
|
51
|
+
}, e[5] = t.x, e[6] = t.y, e[7] = h, e[8] = o) : o = e[8];
|
52
|
+
let n;
|
53
|
+
e[9] !== p ? (n = p.map(K), e[9] = p, e[10] = n) : n = e[10];
|
54
|
+
let s;
|
55
|
+
e[11] !== o || e[12] !== n ? (s = /* @__PURE__ */ H("div", { ref: x, style: o, className: N.component, children: n }), e[11] = o, e[12] = n, e[13] = s) : s = e[13];
|
56
|
+
let a;
|
57
|
+
return e[14] !== u || e[15] !== s ? (a = /* @__PURE__ */ k(G.Provider, { value: m, children: [
|
58
|
+
s,
|
59
|
+
u
|
60
|
+
] }), e[14] = u, e[15] = s, e[16] = a) : a = e[16], a;
|
61
|
+
};
|
62
|
+
function K(l) {
|
63
|
+
return /* @__PURE__ */ H(D, { className: N.button, text: l.label, onClick: l.onClick }, l.label);
|
64
|
+
}
|
65
|
+
export {
|
66
|
+
A as default
|
67
|
+
};
|
68
|
+
//# sourceMappingURL=contextMenuRoot.mjs.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"contextMenuRoot.mjs","sources":["../../../../../lib/components/contextMenu/contextMenuRoot.tsx"],"sourcesContent":["/*\r\n * Copyright ©2025 Ewsgit<https://github.com/ewsgit> and YourDash<https://github.com/yourdash> contributors.\r\n * YourDash is licensed under the MIT License. (https://ewsgit.mit-license.org)\r\n */\r\n\r\nimport React from \"react\";\r\nimport { FC, useEffect, useRef } from \"react\";\r\nimport UKButton from \"../button/UKButton.tsx\";\r\nimport ContextMenuRootContext from \"./contextMenuRootContext.tsx\";\r\nimport styles from \"./contextMenuRoot.module.scss\";\r\n\r\nconst ContextMenuRoot: FC<{ children: React.ReactNode | React.ReactNode[] }> = ({ children }) => {\r\n const [position, setPosition] = React.useState({ x: 0, y: 0 });\r\n const [visible, setVisible] = React.useState(false);\r\n const [items, setItems] = React.useState([] as { label: string; onClick: () => void }[]);\r\n const ref = useRef<HTMLDivElement>(null);\r\n\r\n useEffect(() => {\r\n window.addEventListener(\"resize\", () => {\r\n setVisible(false);\r\n });\r\n }, []);\r\n\r\n return (\r\n <ContextMenuRootContext.Provider\r\n value={{\r\n createMenu: ({ x, y, width, height, items: i }) => {\r\n const screenWidth = window.innerWidth;\r\n const screenHeight = window.innerHeight;\r\n\r\n const MENU_WIDTH = ref.current?.getBoundingClientRect().width || 200;\r\n const MENU_HEIGHT = ref.current?.getBoundingClientRect().height || 200;\r\n\r\n let resultX = x;\r\n let resultY = y;\r\n\r\n if (x + MENU_WIDTH >= screenWidth) {\r\n resultX = screenWidth - MENU_WIDTH;\r\n }\r\n\r\n if (y + MENU_HEIGHT >= screenHeight) {\r\n resultY = screenHeight - MENU_HEIGHT;\r\n }\r\n\r\n setPosition({\r\n x: resultX,\r\n y: resultY,\r\n });\r\n\r\n setItems(i);\r\n setVisible(true);\r\n },\r\n destroyMenu: () => {\r\n setVisible(false);\r\n },\r\n }}\r\n >\r\n <div\r\n ref={ref}\r\n style={{\r\n display: visible ? \"flex\" : \"none\",\r\n left: position.x,\r\n top: position.y,\r\n }}\r\n className={styles.component}\r\n >\r\n {items.map((item) => {\r\n return (\r\n <UKButton\r\n className={styles.button}\r\n text={item.label}\r\n onClick={item.onClick}\r\n key={item.label}\r\n />\r\n );\r\n })}\r\n </div>\r\n {children}\r\n </ContextMenuRootContext.Provider>\r\n );\r\n};\r\n\r\nexport default ContextMenuRoot;\r\n"],"names":["ContextMenuRoot","t0","$","_c","children","t1","Symbol","for","x","y","position","setPosition","React","useState","visible","setVisible","t2","items","setItems","ref","useRef","t3","t4","addEventListener","useEffect","t5","createMenu","t6","i","screenWidth","window","innerWidth","screenHeight","innerHeight","MENU_WIDTH","current","getBoundingClientRect","width","MENU_HEIGHT","height","resultX","resultY","destroyMenu","t7","display","left","top","t8","map","_temp","t9","jsx","styles","component","t10","jsxs","ContextMenuRootContext","item","UKButton","button","label","onClick"],"mappings":"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"}
|
@@ -0,0 +1,7 @@
|
|
1
|
+
@charset "UTF-8";/*!
|
2
|
+
* Copyright ©2025 Ewsgit<https://github.com/ewsgit> and YourDash<https://github.com/yourdash> contributors.
|
3
|
+
* YourDash is licensed under the MIT License. (https://ewsgit.mit-license.org)
|
4
|
+
*//*!
|
5
|
+
* Copyright ©2025 Ewsgit <https://ewsgit.uk> and YourDash <https://yourdash.ewsgit.uk> contributors.
|
6
|
+
* YourDash is licensed under the MIT License. (https://mit.ewsgit.uk)
|
7
|
+
*/._component_p0do9_10{position:fixed;z-index:10000000;overflow:hidden;flex-direction:column;width:200px;box-shadow:0 0 .5rem #0008;box-sizing:border-box;display:flex;font-weight:var(--utfontwgt);font-size:var(--utfontsize);font-family:var(--utfontfam);background:rgb(var(--utbgn));color:rgb(var(--utcol));border:var(--utbrd);border-radius:var(--utrad);gap:calc(var(--utgap) / 2);padding:.5rem}._component_p0do9_10 ._button_p0do9_29{min-width:100%;text-align:start}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"contextMenuRoot.module.scss.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|
@@ -0,0 +1,14 @@
|
|
1
|
+
function i() {
|
2
|
+
const e = window.navigator;
|
3
|
+
if (new URLSearchParams(window.location.search).has("ukmobile")) return !0;
|
4
|
+
if (e != null && e.userAgentData)
|
5
|
+
return e.userAgentData.mobile || !1;
|
6
|
+
{
|
7
|
+
const a = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i;
|
8
|
+
return navigator.userAgent.match(a) !== null;
|
9
|
+
}
|
10
|
+
}
|
11
|
+
export {
|
12
|
+
i as default
|
13
|
+
};
|
14
|
+
//# sourceMappingURL=isPhone.mjs.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"isPhone.mjs","sources":["../../../../lib/core/isPhone.ts"],"sourcesContent":["/*\r\n * Copyright ©2025 Ewsgit<https://github.com/ewsgit> and YourDash<https://github.com/yourdash> contributors.\r\n * YourDash is licensed under the MIT License. (https://ewsgit.mit-license.org)\r\n */\r\n\r\ninterface NavigatorExtended extends Navigator {\r\n userAgentData?: {\r\n brands: { brand: string; version: string }[];\r\n mobile: boolean;\r\n platform: string;\r\n };\r\n}\r\n\r\nexport default function isMobileDevice(): boolean {\r\n const nav: NavigatorExtended = window.navigator;\r\n\r\n const searchParams = new URLSearchParams(window.location.search);\r\n if (searchParams.has(\"ukmobile\")) return true;\r\n\r\n // Check if UA Client Hints are supported\r\n if (nav?.userAgentData) {\r\n return nav.userAgentData.mobile || false;\r\n } else {\r\n const mobileDeviceRegex = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i;\r\n\r\n // Check if UA matches the regex of mobile devices\r\n // noinspection PlatformDetectionJS\r\n return navigator.userAgent.match(mobileDeviceRegex) !== null;\r\n }\r\n}\r\n"],"names":["isMobileDevice","nav","window","navigator","URLSearchParams","location","search","has","userAgentData","mobile","mobileDeviceRegex","userAgent","match"],"mappings":"AAaA,SAAwBA,IAA0B;AAChD,QAAMC,IAAyBC,OAAOC;AAGtC,MADqB,IAAIC,gBAAgBF,OAAOG,SAASC,MAAM,EAC9CC,IAAI,UAAU,EAAU,QAAA;AAGzC,MAAIN,KAAAA,QAAAA,EAAKO;AACAP,WAAAA,EAAIO,cAAcC,UAAU;AAC9B;AACL,UAAMC,IAAoB;AAI1B,WAAOP,UAAUQ,UAAUC,MAAMF,CAAiB,MAAM;AAAA,EAAA;AAE5D;"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"remToPx.mjs","sources":["../../../../lib/core/remToPx.ts"],"sourcesContent":["/*\r\n * Copyright ©2025 Ewsgit <https://ewsgit.uk> and YourDash <https://yourdash.ewsgit.uk> contributors.\r\n * YourDash is licensed under the MIT License. (https://mit.ewsgit.uk)\r\n */\r\n\r\nexport default function remToPx(rem: number) {\r\n return rem * parseFloat(getComputedStyle(document.documentElement).fontSize);\r\n}\r\n"],"names":["remToPx","rem","parseFloat","getComputedStyle","document","documentElement","fontSize"],"mappings":"AAKA,SAAwBA,EAAQC,GAAa;AAC3C,SAAOA,IAAMC,WAAWC,iBAAiBC,SAASC,eAAe,EAAEC,QAAQ;AAC7E;"}
|
@@ -0,0 +1,19 @@
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
2
|
+
import { c as m } from "../../../_virtual/compiler-runtime.mjs";
|
3
|
+
import c from "../components/contextMenu/contextMenuRoot.mjs";
|
4
|
+
import n from "./clippy.mjs";
|
5
|
+
import s from "./isPhone.mjs";
|
6
|
+
import f from "./toasts/toasts.mjs";
|
7
|
+
import l from "../theme/defaultTheme.module.scss.mjs";
|
8
|
+
import d from "./level.mjs";
|
9
|
+
const R = (i) => {
|
10
|
+
const e = m.c(3);
|
11
|
+
let o;
|
12
|
+
e[0] === Symbol.for("react.memo_cache_sentinel") ? (o = n(l.theme, l.level0, s() && l.mobile), e[0] = o) : o = e[0];
|
13
|
+
let t;
|
14
|
+
return e[1] !== i.children ? (t = /* @__PURE__ */ r("div", { className: o, children: /* @__PURE__ */ r(c, { children: /* @__PURE__ */ r(f, { children: /* @__PURE__ */ r(d.Provider, { value: 0, children: i.children }) }) }) }), e[1] = i.children, e[2] = t) : t = e[2], t;
|
15
|
+
};
|
16
|
+
export {
|
17
|
+
R as default
|
18
|
+
};
|
19
|
+
//# sourceMappingURL=root.mjs.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"root.mjs","sources":["../../../../lib/core/root.tsx"],"sourcesContent":["/*\r\n * Copyright ©2025 Ewsgit<https://ewsgit.uk> and YourDash<https://yourdash.ewsgit.uk> contributors.\r\n * YourDash is licensed under the MIT License. (https://mit.ewsgit.uk)\r\n */\r\n\r\nimport ContextMenuRoot from \"../components/contextMenu/contextMenuRoot.jsx\";\r\nimport clippy from \"./clippy.js\";\r\nimport isMobileDevice from \"./isPhone.js\";\r\nimport Toasts from \"./toasts/toasts.jsx\";\r\nimport styles from \"../theme/defaultTheme.module.scss\";\r\nimport React from \"react\";\r\nimport LevelContext from \"./level.jsx\";\r\n\r\nconst UIKitRoot: React.FC<{ children: React.ReactNode | React.ReactNode[] }> = (props) => {\r\n return (\r\n <div className={clippy(styles.theme, styles.level0, isMobileDevice() && styles.mobile)}>\r\n <ContextMenuRoot>\r\n <Toasts>\r\n <LevelContext.Provider value={0}>{props.children}</LevelContext.Provider>\r\n </Toasts>\r\n </ContextMenuRoot>\r\n </div>\r\n );\r\n};\r\n\r\nexport default UIKitRoot;\r\n"],"names":["UIKitRoot","props","$","_c","t0","Symbol","for","clippy","styles","theme","level0","isMobileDevice","mobile","t1","children","jsx","ContextMenuRoot","Toasts","LevelContext"],"mappings":";;;;;;;;AAaA,MAAMA,IAAyEC,CAAAA,MAAA;AAAAC,QAAAA,IAAAC,IAAA,CAAA;AAAAC,MAAAA;AAAA,EAAAF,EAAA,CAAA,MAAAG,OAAAC,IAAA,2BAAA,KAE3DC,IAAAA,EAAAC,EAAAC,OAAAD,EAAAE,QAAoCC,EAAe,KAACH,EAAAI,MAAiB,GAACV,OAAAE,KAAAA,IAAAF,EAAA,CAAA;AAAAW,MAAAA;AAAA,SAAAX,EAAA,CAAA,MAAAD,EAAAa,YAAtFD,sBAMM,OANU,EAAA,WAAAT,GACd,UAAC,gBAAAW,EAAAC,GAAA,EACC,4BAACC,GACC,EAAA,UAAA,gBAAAF,EAA8BG,EAAA,UAAA,EAAA,OAAA,GAAIjB,YAAKa,SAAU,CAAA,GACnD,GACF,EACF,CAAA,GAAMZ,EAAA,CAAA,IAAAD,EAAAa,UAAAZ,OAAAW,KAAAA,IAAAX,EAAA,CAAA,GANNW;AAMM;"}
|
@@ -0,0 +1,4 @@
|
|
1
|
+
@charset "UTF-8";/*!
|
2
|
+
* Copyright ©2025 Ewsgit<https://ewsgit.uk> and YourDash<https://yourdash.ewsgit.uk> contributors.
|
3
|
+
* YourDash is licensed under the MIT License. (https://mit.ewsgit.uk)
|
4
|
+
*/._container_1wk2b_6{position:fixed;top:0;right:0;z-index:10000;text-align:start;opacity:.75;overflow:hidden;pointer-events:none;gap:.25rem;display:flex;flex-direction:column}._component_1wk2b_20{border-radius:.5rem;display:flex;flex-direction:column;gap:1rem;pointer-events:none;-webkit-backdrop-filter:blur(1rem);backdrop-filter:blur(1rem);max-width:32rem;margin-right:.5rem}._component_1wk2b_20:first-child{margin-top:.5rem}._cardContent_1wk2b_34{gap:0;padding:.25rem .5rem;margin-right:-.5rem}._success_1wk2b_42{border-right:.5rem solid #2ea967}._error_1wk2b_46{border-right:.5rem solid #ff4500}._warning_1wk2b_50{border-right:.5rem solid #daa520}._info_1wk2b_54{border-right:.5rem solid #00b8ff}._heading_1wk2b_58{text-align:left;line-height:1;padding-top:.25rem}._pointerEvents_1wk2b_64{pointer-events:all}
|
@@ -0,0 +1,24 @@
|
|
1
|
+
import './toast.module.css';const n = "_container_1wk2b_6", o = "_component_1wk2b_20", t = "_cardContent_1wk2b_34", e = "_success_1wk2b_42", _ = "_error_1wk2b_46", c = "_warning_1wk2b_50", s = "_info_1wk2b_54", r = "_heading_1wk2b_58", i = "_pointerEvents_1wk2b_64", a = {
|
2
|
+
container: n,
|
3
|
+
component: o,
|
4
|
+
cardContent: t,
|
5
|
+
success: e,
|
6
|
+
error: _,
|
7
|
+
warning: c,
|
8
|
+
info: s,
|
9
|
+
heading: r,
|
10
|
+
pointerEvents: i
|
11
|
+
};
|
12
|
+
export {
|
13
|
+
t as cardContent,
|
14
|
+
o as component,
|
15
|
+
n as container,
|
16
|
+
a as default,
|
17
|
+
_ as error,
|
18
|
+
r as heading,
|
19
|
+
s as info,
|
20
|
+
i as pointerEvents,
|
21
|
+
e as success,
|
22
|
+
c as warning
|
23
|
+
};
|
24
|
+
//# sourceMappingURL=toast.module.scss.mjs.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"toast.module.scss.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"toastContext.mjs","sources":["../../../../../lib/core/toasts/toastContext.ts"],"sourcesContent":["/*\r\n * Copyright ©2025 Ewsgit<https://ewsgit.uk> and YourDash<https://yourdash.ewsgit.uk> contributors.\r\n * YourDash is licensed under the MIT License. (https://mit.ewsgit.uk)\r\n */\r\n\r\nimport React from \"react\";\r\nimport IToast from \"./toast.ts\";\r\n\r\nconst ToastContext = React.createContext({\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n showToast: (data: IToast) => {\r\n /* empty */\r\n },\r\n});\r\n\r\nexport default ToastContext;\r\n"],"names":["ToastContext","React","createContext","showToast","data"],"mappings":";AAQMA,MAAAA,IAAeC,EAAMC,cAAc;AAAA;AAAA,EAEvCC,WAAWA,CAACC,MAAiB;AAAA,EAAA;AAG/B,CAAC;"}
|
@@ -0,0 +1,60 @@
|
|
1
|
+
import { jsxs as h, jsx as m } from "react/jsx-runtime";
|
2
|
+
import { c as x } from "../../../../_virtual/compiler-runtime.mjs";
|
3
|
+
import U from "../../components/heading/UKHeading.mjs";
|
4
|
+
import _ from "../../components/separator/UKSeparator.mjs";
|
5
|
+
import T from "../clippy.mjs";
|
6
|
+
import { useState as b } from "react";
|
7
|
+
import S from "../../components/card/UKCard.mjs";
|
8
|
+
import { UKIcons as C } from "../iconDictionary.mjs";
|
9
|
+
import I from "../../components/iconButton/UKIconButton.mjs";
|
10
|
+
import K from "../../components/text/UKText.mjs";
|
11
|
+
import v from "./toastContext.mjs";
|
12
|
+
import n from "./toast.module.scss.mjs";
|
13
|
+
import N from "../uuid.mjs";
|
14
|
+
const y = 5e3, X = (g) => {
|
15
|
+
const e = x.c(10), {
|
16
|
+
children: p
|
17
|
+
} = g;
|
18
|
+
let l;
|
19
|
+
e[0] === Symbol.for("react.memo_cache_sentinel") ? (l = [], e[0] = l) : l = e[0];
|
20
|
+
const [d, c] = b(l);
|
21
|
+
let f;
|
22
|
+
e[1] === Symbol.for("react.memo_cache_sentinel") ? (f = {
|
23
|
+
showToast: (o) => {
|
24
|
+
const t = N();
|
25
|
+
c((i) => [...i, {
|
26
|
+
...o,
|
27
|
+
uuid: t,
|
28
|
+
animatingOut: !1
|
29
|
+
}]), o.persist || (setTimeout(() => {
|
30
|
+
c((i) => i.map((r) => t === r.uuid ? {
|
31
|
+
...r,
|
32
|
+
animatingOut: !0
|
33
|
+
} : r));
|
34
|
+
}, y - 500), setTimeout(() => {
|
35
|
+
c((i) => i.filter((r) => r.uuid !== t));
|
36
|
+
}, y));
|
37
|
+
}
|
38
|
+
}, e[1] = f) : f = e[1];
|
39
|
+
let s;
|
40
|
+
if (e[2] !== d) {
|
41
|
+
let o;
|
42
|
+
e[4] === Symbol.for("react.memo_cache_sentinel") ? (o = (t) => /* @__PURE__ */ h(S, { actions: t.persist ? /* @__PURE__ */ m(I, { accessibleLabel: "Close toasts", icon: C.X, onClick: () => c((i) => i.filter((r) => r.uuid !== t.uuid)) }) : null, className: T(n.cardContent, t.type && n[t.type]), containerClassName: T(n.component, t.persist && n.pointerEvents, t.animatingOut ? "animate__animated animate__fadeOutRightBig" : "animate__animated animate__fadeInDown"), children: [
|
43
|
+
/* @__PURE__ */ m(U, { className: n.heading, level: 3, text: t.content.title }),
|
44
|
+
/* @__PURE__ */ m(_, { direction: "column" }),
|
45
|
+
/* @__PURE__ */ m(K, { className: n.body, text: t.content.body })
|
46
|
+
] }, t.uuid), e[4] = o) : o = e[4], s = d.map(o), e[2] = d, e[3] = s;
|
47
|
+
} else
|
48
|
+
s = e[3];
|
49
|
+
let a;
|
50
|
+
e[5] !== s ? (a = /* @__PURE__ */ m("div", { className: n.container, children: s }), e[5] = s, e[6] = a) : a = e[6];
|
51
|
+
let u;
|
52
|
+
return e[7] !== p || e[8] !== a ? (u = /* @__PURE__ */ h(v.Provider, { value: f, children: [
|
53
|
+
a,
|
54
|
+
p
|
55
|
+
] }), e[7] = p, e[8] = a, e[9] = u) : u = e[9], u;
|
56
|
+
};
|
57
|
+
export {
|
58
|
+
X as default
|
59
|
+
};
|
60
|
+
//# sourceMappingURL=toasts.mjs.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"toasts.mjs","sources":["../../../../../lib/core/toasts/toasts.tsx"],"sourcesContent":["/*\r\n * Copyright ©2025 Ewsgit<https://ewsgit.uk> and YourDash<https://yourdash.ewsgit.uk> contributors.\r\n * YourDash is licensed under the MIT License. (https://mit.ewsgit.uk)\r\n */\r\n\r\nimport UKHeading from \"../../components/heading/UKHeading.tsx\";\r\nimport UKSeparator from \"../../components/separator/UKSeparator.tsx\";\r\nimport type ToastInterface from \"./toast.ts\";\r\nimport clippy from \"../../core/clippy.ts\";\r\nimport { FC, useState } from \"react\";\r\nimport UKCard from \"../../components/card/UKCard.tsx\";\r\nimport { UKIcons } from \"../iconDictionary.ts\";\r\nimport UKIconButton from \"../../components/iconButton/UKIconButton.tsx\";\r\nimport UKText from \"../../components/text/UKText.tsx\";\r\nimport ToastContext from \"./toastContext.ts\";\r\nimport * as React from \"react\";\r\nimport styles from \"./toast.module.scss\";\r\nimport generateUUID from \"../uuid.ts\";\r\n\r\nconst TOAST_DISPLAY_TIME = 5000;\r\n\r\nconst Toasts: FC<{ children: React.ReactNode | React.ReactNode[] }> = ({ children }) => {\r\n const [toasts, setToasts] = useState<(ToastInterface & { uuid: string; animatingOut: boolean })[]>([]);\r\n\r\n return (\r\n <ToastContext.Provider\r\n value={{\r\n showToast: (data: ToastInterface) => {\r\n const uuid = generateUUID();\r\n\r\n setToasts((t) => [...t, { ...data, uuid: uuid, animatingOut: false }]);\r\n\r\n if (!data.persist) {\r\n setTimeout(() => {\r\n setToasts((t) =>\r\n t.map((toast) => {\r\n if (uuid === toast.uuid) {\r\n return {\r\n ...toast,\r\n animatingOut: true,\r\n };\r\n }\r\n\r\n return toast;\r\n }),\r\n );\r\n }, TOAST_DISPLAY_TIME - 500);\r\n\r\n setTimeout(() => {\r\n setToasts((t) => t.filter((toast) => toast.uuid !== uuid));\r\n }, TOAST_DISPLAY_TIME);\r\n }\r\n },\r\n }}\r\n >\r\n <div className={styles.container}>\r\n {toasts.map((t) => {\r\n return (\r\n <UKCard\r\n key={t.uuid}\r\n actions={\r\n t.persist ? (\r\n <UKIconButton\r\n accessibleLabel={\"Close toasts\"}\r\n icon={UKIcons.X}\r\n onClick={() => setToasts((toasts) => toasts.filter((x) => x.uuid !== t.uuid))}\r\n />\r\n ) : null\r\n }\r\n className={clippy(styles.cardContent, t.type && styles[t.type])}\r\n containerClassName={clippy(\r\n styles.component,\r\n t.persist && styles.pointerEvents,\r\n t.animatingOut ? \"animate__animated animate__fadeOutRightBig\" : \"animate__animated animate__fadeInDown\",\r\n )}\r\n >\r\n <UKHeading\r\n className={styles.heading}\r\n level={3}\r\n text={t.content.title}\r\n />\r\n <UKSeparator direction={\"column\"} />\r\n <UKText\r\n className={styles.body}\r\n text={t.content.body}\r\n />\r\n </UKCard>\r\n );\r\n })}\r\n </div>\r\n {children}\r\n </ToastContext.Provider>\r\n );\r\n};\r\n\r\nexport default Toasts;\r\n"],"names":["TOAST_DISPLAY_TIME","Toasts","t0","$","_c","children","t1","Symbol","for","toasts","setToasts","useState","t2","showToast","data","uuid","generateUUID","t","animatingOut","persist","setTimeout","t_0","map","toast","t_1","filter","toast_0","t3","t4","t_2","jsxs","UKCard","jsx","UKIconButton","UKIcons","X","toasts_0","x","clippy","styles","cardContent","type","component","pointerEvents","UKHeading","heading","content","title","UKSeparator","UKText","body","container","t5","ToastContext"],"mappings":"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"}
|
@@ -0,0 +1,16 @@
|
|
1
|
+
import { c as r } from "../../../../_virtual/compiler-runtime.mjs";
|
2
|
+
import a from "react";
|
3
|
+
import c from "./toastContext.mjs";
|
4
|
+
function i() {
|
5
|
+
const t = r.c(2), e = a.useContext(c);
|
6
|
+
let o;
|
7
|
+
return t[0] !== e ? (o = {
|
8
|
+
create(s) {
|
9
|
+
e.showToast(s);
|
10
|
+
}
|
11
|
+
}, t[0] = e, t[1] = o) : o = t[1], o;
|
12
|
+
}
|
13
|
+
export {
|
14
|
+
i as default
|
15
|
+
};
|
16
|
+
//# sourceMappingURL=useToast.mjs.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"useToast.mjs","sources":["../../../../../lib/core/toasts/useToast.ts"],"sourcesContent":["/*\r\n * Copyright ©2025 Ewsgit <https://ewsgit.uk> and YourDash <https://yourdash.ewsgit.uk> contributors.\r\n * YourDash is licensed under the MIT License. (https://mit.ewsgit.uk)\r\n */\r\n\r\nimport React from \"react\";\r\nimport IToast from \"./toast.ts\";\r\nimport ToastContext from \"./toastContext.ts\";\r\n\r\nexport default function useToasts() {\r\n const toastCtx = React.useContext(ToastContext);\r\n\r\n return {\r\n create(data: IToast) {\r\n toastCtx.showToast(data);\r\n },\r\n };\r\n}\r\n"],"names":["useToasts","$","_c","toastCtx","React","useContext","ToastContext","t0","create","data","showToast"],"mappings":";;;AASA,SAAeA,IAAA;AAAAC,QAAAA,IAAAC,IAAA,CAAA,GACbC,IAAiBC,EAAAC,WAAAC,CAA6B;AAAEC,MAAAA;AAAAN,SAAAA,SAAAE,KAEzCI,IAAA;AAAA,IAAAC,OAAAC,GAAA;AAEHN,MAAAA,EAAQO,UAAWD,CAAI;AAAA,IAAA;AAAA,EAAC,GAE3BR,OAAAE,GAAAF,OAAAM,KAAAA,IAAAN,EAAA,CAAA,GAJMM;AAIN;"}
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import { default as r } from "./uuid.mjs";
|
2
|
+
import { default as t } from "./isPhone.mjs";
|
3
|
+
import { default as p } from "./remToPx.mjs";
|
4
|
+
import { default as m } from "./clippy.mjs";
|
5
|
+
export {
|
6
|
+
m as clippy,
|
7
|
+
r as generateUUID,
|
8
|
+
t as isPhone,
|
9
|
+
p as remToPx
|
10
|
+
};
|
11
|
+
//# sourceMappingURL=utils.mjs.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"utils.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"uuid.mjs","sources":["../../../../lib/core/uuid.ts"],"sourcesContent":["/*\r\n * Copyright ©2025 @Ewsgit and YourDash contributors.\r\n * YourDash is licensed under the MIT License. (https://ewsgit.mit-license.org)\r\n */\r\n\r\nexport default function generateUUID(): `${string}-${string}-${string}-${string}-${string}` {\r\n return \"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx\".replace(/[xy]/g, function (c) {\r\n const r = (Math.random() * 16) | 0,\r\n v = c == \"x\" ? r : (r & 0x3) | 0x8;\r\n return v.toString(16);\r\n }) as `${string}-${string}-${string}-${string}-${string}`;\r\n}\r\n"],"names":["generateUUID","replace","c","r","Math","random","v","toString"],"mappings":"AAKA,SAAwBA,IAAoE;AAC1F,SAAO,uCAAuCC,QAAQ,SAAS,SAAUC,GAAG;AACpEC,UAAAA,IAAKC,KAAKC,OAAW,IAAA,KAAM;AAE1BC,YADDJ,KAAK,MAAMC,IAAKA,IAAI,IAAO,GACxBI,SAAS,EAAE;AAAA,EAAA,CACrB;AACH;"}
|
package/dist/uikit/src/index.mjs
CHANGED
@@ -1,81 +1,93 @@
|
|
1
|
-
import {
|
2
|
-
import { default as
|
3
|
-
import { default as
|
4
|
-
import { default as
|
5
|
-
import { default as m } from "../lib/
|
6
|
-
import
|
7
|
-
import {
|
8
|
-
import { default as
|
9
|
-
import { default as
|
10
|
-
import { default as
|
11
|
-
import { default as
|
12
|
-
import { default as
|
13
|
-
import { default as
|
14
|
-
import { default as
|
15
|
-
import { default as
|
16
|
-
import { default as
|
17
|
-
import { default as
|
18
|
-
import { default as
|
19
|
-
import { default as
|
20
|
-
import { default as
|
21
|
-
import { default as
|
22
|
-
import { default as
|
23
|
-
import { default as
|
24
|
-
import { default as
|
25
|
-
import { default as
|
26
|
-
import { default as
|
27
|
-
import { default as
|
28
|
-
import { default as
|
29
|
-
import { default as
|
30
|
-
import { default as
|
31
|
-
import { default as
|
32
|
-
import { default as
|
33
|
-
import { default as
|
34
|
-
import { default as
|
35
|
-
import { default as
|
36
|
-
import { default as
|
37
|
-
import { default as
|
38
|
-
import { default as
|
39
|
-
import { default as
|
1
|
+
import { default as a } from "../lib/core/root.mjs";
|
2
|
+
import { default as f } from "../lib/core/clippy.mjs";
|
3
|
+
import { default as l } from "../lib/core/toasts/useToast.mjs";
|
4
|
+
import { default as d } from "../lib/core/decrementLevel.mjs";
|
5
|
+
import { default as m } from "../lib/core/incrementLevel.mjs";
|
6
|
+
import * as e from "../lib/core/utils.mjs";
|
7
|
+
import { UKIcons as K } from "../lib/core/iconDictionary.mjs";
|
8
|
+
import { default as n } from "../lib/components/box/UKBox.mjs";
|
9
|
+
import { default as B } from "../lib/components/button/UKButton.mjs";
|
10
|
+
import { default as g } from "../lib/components/buttonCombo/UKButtonCombo.mjs";
|
11
|
+
import { default as S } from "../lib/components/buttonLink/UKButtonLink.mjs";
|
12
|
+
import { default as C } from "../lib/components/buttonWithIcon/UKButtonWithIcon.mjs";
|
13
|
+
import { default as v } from "../lib/components/card/UKCard.mjs";
|
14
|
+
import { default as H } from "../lib/components/container/UKContainer.mjs";
|
15
|
+
import { default as P } from "../lib/components/contextMenu/UKContextMenu.mjs";
|
16
|
+
import { default as k } from "../lib/components/flex/UKFlex.mjs";
|
17
|
+
import { default as D } from "../lib/components/heading/UKHeading.mjs";
|
18
|
+
import { default as R } from "../lib/components/icon/UKIcon.mjs";
|
19
|
+
import { default as A } from "../lib/components/iconButton/UKIconButton.mjs";
|
20
|
+
import { default as M } from "../lib/components/image/UKImage.mjs";
|
21
|
+
import { default as W } from "../lib/components/link/UKLink.mjs";
|
22
|
+
import { default as $ } from "../lib/components/progressBar/UKProgressBar.mjs";
|
23
|
+
import { default as q } from "../lib/components/redirect/UKRedirect.mjs";
|
24
|
+
import { default as E } from "../lib/components/separator/UKSeparator.mjs";
|
25
|
+
import { default as J } from "../lib/components/spinner/UKSpinner.mjs";
|
26
|
+
import { default as X } from "../lib/components/subtext/UKSubtext.mjs";
|
27
|
+
import { default as _ } from "../lib/components/tag/UKTag.mjs";
|
28
|
+
import { default as te } from "../lib/components/text/UKText.mjs";
|
29
|
+
import { default as ae } from "../lib/components/textButton/UKTextButton.mjs";
|
30
|
+
import { default as fe } from "../lib/components/textInput/UKTextInput.mjs";
|
31
|
+
import { default as le } from "../lib/utilityComponent/hasBeenShown/hasBeenShown.mjs";
|
32
|
+
import { default as de } from "../lib/utilityComponent/onInView/onInView.mjs";
|
33
|
+
import { default as me } from "../lib/views/carousel/UKCarousel.mjs";
|
34
|
+
import { default as Ke } from "../lib/views/dialog/UKDialog.mjs";
|
35
|
+
import { default as ne } from "../lib/views/pageHeader/UKPageHeader.mjs";
|
36
|
+
import { default as Be } from "../lib/views/panAndZoom/UKPanAndZoom.mjs";
|
37
|
+
import { default as ge } from "../lib/views/infiniteScroll/UKInfiniteScroll.mjs";
|
38
|
+
import { default as Se } from "../lib/views/navBar/UKNavBar.mjs";
|
39
|
+
import { default as Ce } from "../lib/views/navBar/components/navImage/UKNavbarNavImage.mjs";
|
40
|
+
import { default as ve } from "../lib/views/navBar/components/navTitle/UKNavbarNavTitle.mjs";
|
41
|
+
import { default as He } from "../lib/views/onBoarding/UKOnBoarding.mjs";
|
42
|
+
import { default as Pe } from "../lib/views/sidebar/UKSidebar.mjs";
|
43
|
+
import { default as ke } from "../lib/views/sidebar/UKSidebarContainer.mjs";
|
44
|
+
import { default as De } from "../lib/views/sidebar/UKSidebarContext.mjs";
|
45
|
+
import { default as Re } from "../lib/views/sidebar/UKSidebarToggleButton.mjs";
|
40
46
|
export {
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
47
|
+
le as HasBeenShown,
|
48
|
+
de as OnInView,
|
49
|
+
a as UIKitRoot,
|
50
|
+
n as UKBox,
|
51
|
+
B as UKButton,
|
52
|
+
g as UKButtonCombo,
|
53
|
+
S as UKButtonLink,
|
54
|
+
C as UKButtonWithIcon,
|
55
|
+
v as UKCard,
|
56
|
+
me as UKCarousel,
|
57
|
+
H as UKContainer,
|
58
|
+
P as UKContextMenu,
|
59
|
+
d as UKDecrementLevel,
|
60
|
+
Ke as UKDialog,
|
61
|
+
k as UKFlex,
|
62
|
+
D as UKHeading,
|
63
|
+
R as UKIcon,
|
64
|
+
A as UKIconButton,
|
65
|
+
K as UKIcons,
|
66
|
+
M as UKImage,
|
67
|
+
m as UKIncrementLevel,
|
68
|
+
ge as UKInfiniteScroll,
|
69
|
+
W as UKLink,
|
70
|
+
Se as UKNavBar,
|
71
|
+
Ce as UKNavBarImage,
|
72
|
+
ve as UKNavBarTitle,
|
73
|
+
He as UKOnBoarding,
|
74
|
+
ne as UKPageHeader,
|
75
|
+
Be as UKPanAndZoom,
|
76
|
+
$ as UKProgressBar,
|
77
|
+
q as UKRedirect,
|
78
|
+
E as UKSeparator,
|
79
|
+
Pe as UKSidebar,
|
80
|
+
ke as UKSidebarContainer,
|
81
|
+
De as UKSidebarContext,
|
82
|
+
Re as UKSidebarToggleButton,
|
83
|
+
J as UKSpinner,
|
84
|
+
X as UKSubText,
|
85
|
+
_ as UKTag,
|
86
|
+
te as UKText,
|
87
|
+
ae as UKTextButton,
|
88
|
+
fe as UKTextInput,
|
89
|
+
f as clippy,
|
90
|
+
l as useToasts,
|
91
|
+
e as utils
|
80
92
|
};
|
81
93
|
//# sourceMappingURL=index.mjs.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/lib/core/toasts/toast.ts
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
import type IToastAction from "./toastAction.ts";
|
7
7
|
|
8
|
-
export default interface
|
8
|
+
export default interface IToast {
|
9
9
|
type: "success" | "error" | "warning" | "info" | "debug";
|
10
10
|
content: { title: string; body: string; actions?: IToastAction[] };
|
11
11
|
persist?: boolean;
|
@@ -4,11 +4,11 @@
|
|
4
4
|
*/
|
5
5
|
|
6
6
|
import React from "react";
|
7
|
-
import
|
7
|
+
import IToast from "./toast.ts";
|
8
8
|
|
9
9
|
const ToastContext = React.createContext({
|
10
10
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
11
|
-
showToast: (data:
|
11
|
+
showToast: (data: IToast) => {
|
12
12
|
/* empty */
|
13
13
|
},
|
14
14
|
});
|
@@ -4,14 +4,14 @@
|
|
4
4
|
*/
|
5
5
|
|
6
6
|
import React from "react";
|
7
|
-
import
|
7
|
+
import IToast from "./toast.ts";
|
8
8
|
import ToastContext from "./toastContext.ts";
|
9
9
|
|
10
|
-
export default function
|
10
|
+
export default function useToasts() {
|
11
11
|
const toastCtx = React.useContext(ToastContext);
|
12
12
|
|
13
13
|
return {
|
14
|
-
create(data:
|
14
|
+
create(data: IToast) {
|
15
15
|
toastCtx.showToast(data);
|
16
16
|
},
|
17
17
|
};
|
package/package.json
CHANGED
File without changes
|