@cerberus-design/react 0.10.2 → 0.10.3
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/build/legacy/_tsup-dts-rollup.d.cts +1 -7
- package/build/legacy/components/CircularProgress.cjs +21 -30
- package/build/legacy/components/CircularProgress.cjs.map +1 -1
- package/build/legacy/components/FileStatus.cjs +0 -2
- package/build/legacy/components/FileStatus.cjs.map +1 -1
- package/build/legacy/components/IconButton.cjs +0 -2
- package/build/legacy/components/IconButton.cjs.map +1 -1
- package/build/legacy/components/Portal.cjs +5 -3
- package/build/legacy/components/Portal.cjs.map +1 -1
- package/build/legacy/context/confirm-modal.cjs +5 -2
- package/build/legacy/context/confirm-modal.cjs.map +1 -1
- package/build/legacy/context/notification-center.cjs +5 -2
- package/build/legacy/context/notification-center.cjs.map +1 -1
- package/build/legacy/context/prompt-modal.cjs +5 -2
- package/build/legacy/context/prompt-modal.cjs.map +1 -1
- package/build/legacy/index.cjs +26 -34
- package/build/legacy/index.cjs.map +1 -1
- package/build/modern/_tsup-dts-rollup.d.ts +1 -7
- package/build/modern/{chunk-VYDHM3XL.js → chunk-6YUB3ITX.js} +2 -2
- package/build/modern/{chunk-UBJBMOG7.js → chunk-APD6IX5R.js} +1 -3
- package/build/modern/chunk-APD6IX5R.js.map +1 -0
- package/build/modern/chunk-GLY7GU5S.js +14 -0
- package/build/modern/chunk-GLY7GU5S.js.map +1 -0
- package/build/modern/{chunk-KDFCISMF.js → chunk-LKFXUM3Z.js} +2 -2
- package/build/modern/{chunk-3O6UTN3J.js → chunk-SEK6HENF.js} +22 -31
- package/build/modern/chunk-SEK6HENF.js.map +1 -0
- package/build/modern/{chunk-6GAIXCCO.js → chunk-VV27XB6X.js} +2 -2
- package/build/modern/{chunk-2RPWSVRX.js → chunk-XOKHIEDT.js} +2 -2
- package/build/modern/components/CircularProgress.js +1 -1
- package/build/modern/components/FileStatus.js +2 -2
- package/build/modern/components/IconButton.js +1 -1
- package/build/modern/components/Portal.js +1 -2
- package/build/modern/context/confirm-modal.js +2 -2
- package/build/modern/context/notification-center.js +2 -2
- package/build/modern/context/prompt-modal.js +2 -2
- package/build/modern/index.js +7 -7
- package/package.json +2 -2
- package/src/components/CircularProgress.tsx +24 -40
- package/src/components/IconButton.tsx +0 -9
- package/src/components/Portal.tsx +6 -4
- package/build/modern/chunk-3O6UTN3J.js.map +0 -1
- package/build/modern/chunk-5IVINNV2.js +0 -11
- package/build/modern/chunk-5IVINNV2.js.map +0 -1
- package/build/modern/chunk-UBJBMOG7.js.map +0 -1
- /package/build/modern/{chunk-VYDHM3XL.js.map → chunk-6YUB3ITX.js.map} +0 -0
- /package/build/modern/{chunk-KDFCISMF.js.map → chunk-LKFXUM3Z.js.map} +0 -0
- /package/build/modern/{chunk-6GAIXCCO.js.map → chunk-VV27XB6X.js.map} +0 -0
- /package/build/modern/{chunk-2RPWSVRX.js.map → chunk-XOKHIEDT.js.map} +0 -0
|
@@ -827,12 +827,6 @@ declare interface IconButtonRawProps extends ButtonHTMLAttributes<HTMLButtonElem
|
|
|
827
827
|
* The aria-label attribute for the icon button.
|
|
828
828
|
*/
|
|
829
829
|
ariaLabel: string;
|
|
830
|
-
/**
|
|
831
|
-
* The position of the tooltip relative to the icon button.
|
|
832
|
-
* @example 'top' | 'right' | 'bottom' | 'left'
|
|
833
|
-
* @default 'top'
|
|
834
|
-
*/
|
|
835
|
-
tooltipPosition?: Positions;
|
|
836
830
|
}
|
|
837
831
|
export { IconButtonRawProps }
|
|
838
832
|
export { IconButtonRawProps as IconButtonRawProps_alias_1 }
|
|
@@ -1391,7 +1385,7 @@ export { pointerWithin }
|
|
|
1391
1385
|
* @see https://cerberus.digitalu.design/react/portal
|
|
1392
1386
|
* @definition [React Portal Docs](https://react.dev/reference/react-dom/createPortal)
|
|
1393
1387
|
*/
|
|
1394
|
-
declare function Portal(props: PropsWithChildren<PortalProps>): ReactPortal;
|
|
1388
|
+
declare function Portal(props: PropsWithChildren<PortalProps>): ReactPortal | null;
|
|
1395
1389
|
export { Portal }
|
|
1396
1390
|
export { Portal as Portal_alias_1 }
|
|
1397
1391
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Portal
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-GLY7GU5S.js";
|
|
4
4
|
import {
|
|
5
5
|
ModalHeader
|
|
6
6
|
} from "./chunk-WLEX22KS.js";
|
|
@@ -176,4 +176,4 @@ export {
|
|
|
176
176
|
ConfirmModal,
|
|
177
177
|
useConfirmModal
|
|
178
178
|
};
|
|
179
|
-
//# sourceMappingURL=chunk-
|
|
179
|
+
//# sourceMappingURL=chunk-6YUB3ITX.js.map
|
|
@@ -10,8 +10,6 @@ function IconButton(props) {
|
|
|
10
10
|
"button",
|
|
11
11
|
{
|
|
12
12
|
...nativeProps,
|
|
13
|
-
"data-tooltip": true,
|
|
14
|
-
"data-position": props.tooltipPosition ?? "top",
|
|
15
13
|
"aria-label": ariaLabel ?? "Icon Button",
|
|
16
14
|
className: cx(
|
|
17
15
|
nativeProps.className,
|
|
@@ -28,4 +26,4 @@ function IconButton(props) {
|
|
|
28
26
|
export {
|
|
29
27
|
IconButton
|
|
30
28
|
};
|
|
31
|
-
//# sourceMappingURL=chunk-
|
|
29
|
+
//# sourceMappingURL=chunk-APD6IX5R.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/IconButton.tsx"],"sourcesContent":["import type { ButtonHTMLAttributes } from 'react'\nimport { cx } from '@cerberus/styled-system/css'\nimport {\n iconButton,\n type IconButtonVariantProps,\n} from '@cerberus/styled-system/recipes'\n\n/**\n * This module contains the Icon Button component.\n * @module\n */\n\nexport interface IconButtonRawProps\n extends ButtonHTMLAttributes<HTMLButtonElement> {\n /**\n * The aria-label attribute for the icon button.\n */\n ariaLabel: string\n}\nexport type IconButtonProps = IconButtonRawProps & IconButtonVariantProps\n\n/**\n * A component that allows the user to perform actions using an icon\n * @see https://cerberus.digitalu.design/react/icon-button\n */\nexport function IconButton(props: IconButtonProps): JSX.Element {\n const { ariaLabel, palette, usage, size, ...nativeProps } = props\n return (\n <button\n {...nativeProps}\n aria-label={ariaLabel ?? 'Icon Button'}\n className={cx(\n nativeProps.className,\n iconButton({\n palette,\n usage,\n size,\n }),\n )}\n />\n )\n}\n"],"mappings":";AACA,SAAS,UAAU;AACnB;AAAA,EACE;AAAA,OAEK;AAuBH;AAHG,SAAS,WAAW,OAAqC;AAC9D,QAAM,EAAE,WAAW,SAAS,OAAO,MAAM,GAAG,YAAY,IAAI;AAC5D,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ,cAAY,aAAa;AAAA,MACzB,WAAW;AAAA,QACT,YAAY;AAAA,QACZ,WAAW;AAAA,UACT;AAAA,UACA;AAAA,UACA;AAAA,QACF,CAAC;AAAA,MACH;AAAA;AAAA,EACF;AAEJ;","names":[]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// src/components/Portal.tsx
|
|
2
|
+
import { createPortal } from "react-dom";
|
|
3
|
+
function Portal(props) {
|
|
4
|
+
if (typeof window !== "undefined") {
|
|
5
|
+
const container = props.container || document.body;
|
|
6
|
+
return createPortal(props.children, container, props.key);
|
|
7
|
+
}
|
|
8
|
+
return null;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export {
|
|
12
|
+
Portal
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=chunk-GLY7GU5S.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/Portal.tsx"],"sourcesContent":["import type { PropsWithChildren } from 'react'\nimport { createPortal } from 'react-dom'\n\n/**\n * This module is the Portal component.\n * @module\n */\n\nexport interface PortalProps {\n /**\n * The root container to render the children into.\n * @default document.body\n */\n container?: Element | DocumentFragment\n /**\n * An optional key to use for the Portal component.\n */\n key?: null | string\n}\n\n/**\n * The Portal component is used to render children into a DOM node that exists outside the DOM hierarchy of the parent component.\n * @see https://cerberus.digitalu.design/react/portal\n * @definition [React Portal Docs](https://react.dev/reference/react-dom/createPortal)\n */\nexport function Portal(props: PropsWithChildren<PortalProps>) {\n if (typeof window !== 'undefined') {\n const container = props.container || document.body\n return createPortal(props.children, container, props.key)\n }\n\n return null\n}\n"],"mappings":";AACA,SAAS,oBAAoB;AAwBtB,SAAS,OAAO,OAAuC;AAC5D,MAAI,OAAO,WAAW,aAAa;AACjC,UAAM,YAAY,MAAM,aAAa,SAAS;AAC9C,WAAO,aAAa,MAAM,UAAU,WAAW,MAAM,GAAG;AAAA,EAC1D;AAEA,SAAO;AACT;","names":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Portal
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-GLY7GU5S.js";
|
|
4
4
|
import {
|
|
5
5
|
ModalHeader
|
|
6
6
|
} from "./chunk-WLEX22KS.js";
|
|
@@ -229,4 +229,4 @@ export {
|
|
|
229
229
|
PromptModal,
|
|
230
230
|
usePromptModal
|
|
231
231
|
};
|
|
232
|
-
//# sourceMappingURL=chunk-
|
|
232
|
+
//# sourceMappingURL=chunk-LKFXUM3Z.js.map
|
|
@@ -37,37 +37,22 @@ function CircularProgress(props) {
|
|
|
37
37
|
children: [
|
|
38
38
|
/* @__PURE__ */ jsx("title", { children: props.title }),
|
|
39
39
|
/* @__PURE__ */ jsx("desc", { children: `${now}% ${status}` }),
|
|
40
|
-
/* @__PURE__ */ jsxs("
|
|
41
|
-
/* @__PURE__ */ jsx("rect", { fill: "white", width: "100%", height: "100%" }),
|
|
40
|
+
/* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsxs("linearGradient", { id: "gradient", children: [
|
|
42
41
|
/* @__PURE__ */ jsx(
|
|
43
|
-
"
|
|
42
|
+
"stop",
|
|
44
43
|
{
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
}),
|
|
48
|
-
cx: "50%",
|
|
49
|
-
cy: "50%",
|
|
50
|
-
r: radius,
|
|
51
|
-
pathLength: "100"
|
|
44
|
+
offset: "0%",
|
|
45
|
+
stopColor: "var(--cerberus-colors-action-bg-initial)"
|
|
52
46
|
}
|
|
53
47
|
),
|
|
54
48
|
/* @__PURE__ */ jsx(
|
|
55
|
-
"
|
|
49
|
+
"stop",
|
|
56
50
|
{
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
}),
|
|
60
|
-
cx: "50%",
|
|
61
|
-
cy: "50%",
|
|
62
|
-
r: radius,
|
|
63
|
-
pathLength: "100",
|
|
64
|
-
stroke: "black",
|
|
65
|
-
strokeDasharray: "100",
|
|
66
|
-
strokeDashoffset: 100 - now,
|
|
67
|
-
transform: "rotate(-90 50 50)"
|
|
51
|
+
offset: "100%",
|
|
52
|
+
stopColor: "var(--cerberus-colors-action-bg-active)"
|
|
68
53
|
}
|
|
69
54
|
)
|
|
70
|
-
] }),
|
|
55
|
+
] }) }),
|
|
71
56
|
/* @__PURE__ */ jsx(
|
|
72
57
|
"circle",
|
|
73
58
|
{
|
|
@@ -97,14 +82,15 @@ function CircularProgress(props) {
|
|
|
97
82
|
{
|
|
98
83
|
"data-complete": now === 100,
|
|
99
84
|
className: css({
|
|
100
|
-
stroke: "
|
|
101
|
-
transition: "stroke-dashoffset 0.5s ease",
|
|
85
|
+
stroke: "url(#gradient)",
|
|
86
|
+
transition: "stroke-dashoffset, stroke 0.5s ease",
|
|
102
87
|
"&:is([data-complete=true])": {
|
|
103
88
|
stroke: "success.bg.initial"
|
|
104
89
|
}
|
|
105
90
|
}),
|
|
106
91
|
cx: "50%",
|
|
107
92
|
cy: "50%",
|
|
93
|
+
fill: "none",
|
|
108
94
|
r: radius,
|
|
109
95
|
pathLength: "100",
|
|
110
96
|
strokeDasharray: "100",
|
|
@@ -121,8 +107,10 @@ function CircularProgress(props) {
|
|
|
121
107
|
fontFamily: "mono",
|
|
122
108
|
textStyle: "1.25rem"
|
|
123
109
|
}),
|
|
124
|
-
x: "
|
|
125
|
-
y: "
|
|
110
|
+
x: "50%",
|
|
111
|
+
y: "47%",
|
|
112
|
+
dominantBaseline: "middle",
|
|
113
|
+
textAnchor: "middle",
|
|
126
114
|
children: [
|
|
127
115
|
now,
|
|
128
116
|
"%"
|
|
@@ -134,10 +122,13 @@ function CircularProgress(props) {
|
|
|
134
122
|
{
|
|
135
123
|
className: css({
|
|
136
124
|
fill: "page.text.100",
|
|
137
|
-
fontSize: "0.5rem"
|
|
125
|
+
fontSize: "0.5rem",
|
|
126
|
+
fontWeight: 600
|
|
138
127
|
}),
|
|
139
|
-
x: "
|
|
140
|
-
y: "
|
|
128
|
+
x: "50%",
|
|
129
|
+
y: "59%",
|
|
130
|
+
dominantBaseline: "middle",
|
|
131
|
+
textAnchor: "middle",
|
|
141
132
|
children: status
|
|
142
133
|
}
|
|
143
134
|
)
|
|
@@ -152,4 +143,4 @@ function CircularProgress(props) {
|
|
|
152
143
|
export {
|
|
153
144
|
CircularProgress
|
|
154
145
|
};
|
|
155
|
-
//# sourceMappingURL=chunk-
|
|
146
|
+
//# sourceMappingURL=chunk-SEK6HENF.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/CircularProgress.tsx"],"sourcesContent":["'use client'\n\nimport { cq } from '@cerberus/styled-system/patterns'\nimport { css } from '@cerberus/styled-system/css'\nimport type { SVGProps } from 'react'\n\n/**\n * This module contains the CircularProgress component.\n * @module\n */\n\nexport interface CircularProgressProps extends SVGProps<SVGSVGElement> {\n /**\n * The current value of the CircularProgress\n */\n now: number\n /**\n * The title of the CircularProgress for a11y\n */\n title: string\n /**\n * What is shown below the now value (default: 'Done')\n */\n label?: string\n}\n\n/**\n * The CircularProgress component is used to display a loading indicator.\n * @param props - SVG element attributes\n * @param props.now - The current value of the CircularProgress\n * @param props.title - The title of the CircularProgress for a11y\n * @param props.label - What is shown below the now value (default: 'Done')\n * @see https://cerberus.digitalu.design/react/progress-indicators\n * @example\n * ```tsx\n * <CircularProgress now={24} title=\"Course completion\" label=\"done\" />\n * ```\n */\nexport function CircularProgress(props: CircularProgressProps) {\n const strokeW: number = 14\n const radius = `calc(50% * (1 - ${strokeW}/100))`\n const status: string = props.label ?? 'Done'\n const now: number = props.now >= 100 ? 100 : props.now\n\n return (\n <div\n aria-valuemin={0}\n aria-valuemax={100}\n aria-valuenow={now}\n className={cq({\n alignSelf: 'stretch',\n flex: 1,\n m: '4px',\n position: 'relative',\n })}\n role=\"progressbar\"\n >\n <svg\n data-complete={now === 100}\n className={css({\n display: 'block',\n rounded: 'full',\n transition: 'all 0.5s ease',\n })}\n fill=\"none\"\n strokeLinecap=\"round\"\n strokeWidth={strokeW}\n viewBox=\"0 0 100 100\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <title>{props.title}</title>\n <desc>{`${now}% ${status}`}</desc>\n <defs>\n <linearGradient id=\"gradient\">\n <stop\n offset=\"0%\"\n stopColor=\"var(--cerberus-colors-action-bg-initial)\"\n />\n <stop\n offset=\"100%\"\n stopColor=\"var(--cerberus-colors-action-bg-active)\"\n />\n </linearGradient>\n </defs>\n\n <circle\n className={css({\n fill: 'page.surface.initial',\n })}\n cx=\"50%\"\n cy=\"50%\"\n r={`calc(50% * (1 - ${strokeW}/100))`}\n pathLength=\"100\"\n />\n <circle\n className={css({\n stroke: 'page.bg.100',\n })}\n cx=\"50%\"\n cy=\"50%\"\n r={radius}\n pathLength=\"100\"\n />\n <circle\n data-complete={now === 100}\n className={css({\n stroke: 'url(#gradient)',\n transition: 'stroke-dashoffset, stroke 0.5s ease',\n '&:is([data-complete=true])': {\n stroke: 'success.bg.initial',\n },\n })}\n cx=\"50%\"\n cy=\"50%\"\n fill=\"none\"\n r={radius}\n pathLength=\"100\"\n strokeDasharray=\"100\"\n strokeDashoffset={100 - now}\n transform=\"rotate(-90 50 50)\"\n />\n\n <g>\n <text\n className={css({\n fill: 'page.text.initial',\n fontFamily: 'mono',\n textStyle: '1.25rem',\n })}\n x=\"50%\"\n y=\"47%\"\n dominantBaseline=\"middle\"\n textAnchor=\"middle\"\n >\n {now}%\n </text>\n <text\n className={css({\n fill: 'page.text.100',\n fontSize: '0.5rem',\n fontWeight: 600,\n })}\n x=\"50%\"\n y=\"59%\"\n dominantBaseline=\"middle\"\n textAnchor=\"middle\"\n >\n {status}\n </text>\n </g>\n </svg>\n </div>\n )\n}\n"],"mappings":";AAEA,SAAS,UAAU;AACnB,SAAS,WAAW;AAmEZ,cAGE,YAHF;AAhCD,SAAS,iBAAiB,OAA8B;AAC7D,QAAM,UAAkB;AACxB,QAAM,SAAS,mBAAmB,OAAO;AACzC,QAAM,SAAiB,MAAM,SAAS;AACtC,QAAM,MAAc,MAAM,OAAO,MAAM,MAAM,MAAM;AAEnD,SACE;AAAA,IAAC;AAAA;AAAA,MACC,iBAAe;AAAA,MACf,iBAAe;AAAA,MACf,iBAAe;AAAA,MACf,WAAW,GAAG;AAAA,QACZ,WAAW;AAAA,QACX,MAAM;AAAA,QACN,GAAG;AAAA,QACH,UAAU;AAAA,MACZ,CAAC;AAAA,MACD,MAAK;AAAA,MAEL;AAAA,QAAC;AAAA;AAAA,UACC,iBAAe,QAAQ;AAAA,UACvB,WAAW,IAAI;AAAA,YACb,SAAS;AAAA,YACT,SAAS;AAAA,YACT,YAAY;AAAA,UACd,CAAC;AAAA,UACD,MAAK;AAAA,UACL,eAAc;AAAA,UACd,aAAa;AAAA,UACb,SAAQ;AAAA,UACR,OAAM;AAAA,UAEN;AAAA,gCAAC,WAAO,gBAAM,OAAM;AAAA,YACpB,oBAAC,UAAM,aAAG,GAAG,KAAK,MAAM,IAAG;AAAA,YAC3B,oBAAC,UACC,+BAAC,oBAAe,IAAG,YACjB;AAAA;AAAA,gBAAC;AAAA;AAAA,kBACC,QAAO;AAAA,kBACP,WAAU;AAAA;AAAA,cACZ;AAAA,cACA;AAAA,gBAAC;AAAA;AAAA,kBACC,QAAO;AAAA,kBACP,WAAU;AAAA;AAAA,cACZ;AAAA,eACF,GACF;AAAA,YAEA;AAAA,cAAC;AAAA;AAAA,gBACC,WAAW,IAAI;AAAA,kBACb,MAAM;AAAA,gBACR,CAAC;AAAA,gBACD,IAAG;AAAA,gBACH,IAAG;AAAA,gBACH,GAAG,mBAAmB,OAAO;AAAA,gBAC7B,YAAW;AAAA;AAAA,YACb;AAAA,YACA;AAAA,cAAC;AAAA;AAAA,gBACC,WAAW,IAAI;AAAA,kBACb,QAAQ;AAAA,gBACV,CAAC;AAAA,gBACD,IAAG;AAAA,gBACH,IAAG;AAAA,gBACH,GAAG;AAAA,gBACH,YAAW;AAAA;AAAA,YACb;AAAA,YACA;AAAA,cAAC;AAAA;AAAA,gBACC,iBAAe,QAAQ;AAAA,gBACvB,WAAW,IAAI;AAAA,kBACb,QAAQ;AAAA,kBACR,YAAY;AAAA,kBACZ,8BAA8B;AAAA,oBAC5B,QAAQ;AAAA,kBACV;AAAA,gBACF,CAAC;AAAA,gBACD,IAAG;AAAA,gBACH,IAAG;AAAA,gBACH,MAAK;AAAA,gBACL,GAAG;AAAA,gBACH,YAAW;AAAA,gBACX,iBAAgB;AAAA,gBAChB,kBAAkB,MAAM;AAAA,gBACxB,WAAU;AAAA;AAAA,YACZ;AAAA,YAEA,qBAAC,OACC;AAAA;AAAA,gBAAC;AAAA;AAAA,kBACC,WAAW,IAAI;AAAA,oBACb,MAAM;AAAA,oBACN,YAAY;AAAA,oBACZ,WAAW;AAAA,kBACb,CAAC;AAAA,kBACD,GAAE;AAAA,kBACF,GAAE;AAAA,kBACF,kBAAiB;AAAA,kBACjB,YAAW;AAAA,kBAEV;AAAA;AAAA,oBAAI;AAAA;AAAA;AAAA,cACP;AAAA,cACA;AAAA,gBAAC;AAAA;AAAA,kBACC,WAAW,IAAI;AAAA,oBACb,MAAM;AAAA,oBACN,UAAU;AAAA,oBACV,YAAY;AAAA,kBACd,CAAC;AAAA,kBACD,GAAE;AAAA,kBACF,GAAE;AAAA,kBACF,kBAAiB;AAAA,kBACjB,YAAW;AAAA,kBAEV;AAAA;AAAA,cACH;AAAA,eACF;AAAA;AAAA;AAAA,MACF;AAAA;AAAA,EACF;AAEJ;","names":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Portal
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-GLY7GU5S.js";
|
|
4
4
|
import {
|
|
5
5
|
Notification
|
|
6
6
|
} from "./chunk-VG46RHBJ.js";
|
|
@@ -159,4 +159,4 @@ export {
|
|
|
159
159
|
NotificationCenter,
|
|
160
160
|
useNotificationCenter
|
|
161
161
|
};
|
|
162
|
-
//# sourceMappingURL=chunk-
|
|
162
|
+
//# sourceMappingURL=chunk-VV27XB6X.js.map
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
} from "./chunk-JWIJHSI6.js";
|
|
7
7
|
import {
|
|
8
8
|
IconButton
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-APD6IX5R.js";
|
|
10
10
|
import {
|
|
11
11
|
Avatar
|
|
12
12
|
} from "./chunk-477G5ZEL.js";
|
|
@@ -215,4 +215,4 @@ export {
|
|
|
215
215
|
processStatus,
|
|
216
216
|
FileStatus
|
|
217
217
|
};
|
|
218
|
-
//# sourceMappingURL=chunk-
|
|
218
|
+
//# sourceMappingURL=chunk-XOKHIEDT.js.map
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
import {
|
|
3
3
|
FileStatus,
|
|
4
4
|
processStatus
|
|
5
|
-
} from "../chunk-
|
|
5
|
+
} from "../chunk-XOKHIEDT.js";
|
|
6
6
|
import "../chunk-ZFK33MVD.js";
|
|
7
7
|
import "../chunk-JWIJHSI6.js";
|
|
8
|
-
import "../chunk-
|
|
8
|
+
import "../chunk-APD6IX5R.js";
|
|
9
9
|
import "../chunk-477G5ZEL.js";
|
|
10
10
|
import "../chunk-UZDVOIW5.js";
|
|
11
11
|
import "../chunk-BUVVRQLZ.js";
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
import {
|
|
3
3
|
ConfirmModal,
|
|
4
4
|
useConfirmModal
|
|
5
|
-
} from "../chunk-
|
|
6
|
-
import "../chunk-
|
|
5
|
+
} from "../chunk-6YUB3ITX.js";
|
|
6
|
+
import "../chunk-GLY7GU5S.js";
|
|
7
7
|
import "../chunk-WLEX22KS.js";
|
|
8
8
|
import "../chunk-2UXE5PDG.js";
|
|
9
9
|
import "../chunk-BE4EOU2P.js";
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
import {
|
|
3
3
|
NotificationCenter,
|
|
4
4
|
useNotificationCenter
|
|
5
|
-
} from "../chunk-
|
|
6
|
-
import "../chunk-
|
|
5
|
+
} from "../chunk-VV27XB6X.js";
|
|
6
|
+
import "../chunk-GLY7GU5S.js";
|
|
7
7
|
import "../chunk-VG46RHBJ.js";
|
|
8
8
|
import "../chunk-XEW6TJJ4.js";
|
|
9
9
|
import "../chunk-SXIXDXG3.js";
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
import {
|
|
3
3
|
PromptModal,
|
|
4
4
|
usePromptModal
|
|
5
|
-
} from "../chunk-
|
|
6
|
-
import "../chunk-
|
|
5
|
+
} from "../chunk-LKFXUM3Z.js";
|
|
6
|
+
import "../chunk-GLY7GU5S.js";
|
|
7
7
|
import "../chunk-WLEX22KS.js";
|
|
8
8
|
import "../chunk-2UXE5PDG.js";
|
|
9
9
|
import "../chunk-WZOYPFUU.js";
|
package/build/modern/index.js
CHANGED
|
@@ -8,15 +8,15 @@ import {
|
|
|
8
8
|
import {
|
|
9
9
|
ConfirmModal,
|
|
10
10
|
useConfirmModal
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-6YUB3ITX.js";
|
|
12
12
|
import {
|
|
13
13
|
NotificationCenter,
|
|
14
14
|
useNotificationCenter
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-VV27XB6X.js";
|
|
16
16
|
import {
|
|
17
17
|
PromptModal,
|
|
18
18
|
usePromptModal
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-LKFXUM3Z.js";
|
|
20
20
|
import {
|
|
21
21
|
TabPanel
|
|
22
22
|
} from "./chunk-HHVQ6LCA.js";
|
|
@@ -44,7 +44,7 @@ import {
|
|
|
44
44
|
} from "./chunk-PKY46RRA.js";
|
|
45
45
|
import {
|
|
46
46
|
Portal
|
|
47
|
-
} from "./chunk-
|
|
47
|
+
} from "./chunk-GLY7GU5S.js";
|
|
48
48
|
import {
|
|
49
49
|
Radio
|
|
50
50
|
} from "./chunk-LJYCFFX7.js";
|
|
@@ -93,7 +93,7 @@ import {
|
|
|
93
93
|
import {
|
|
94
94
|
FileStatus,
|
|
95
95
|
processStatus
|
|
96
|
-
} from "./chunk-
|
|
96
|
+
} from "./chunk-XOKHIEDT.js";
|
|
97
97
|
import {
|
|
98
98
|
ProgressBar
|
|
99
99
|
} from "./chunk-ZFK33MVD.js";
|
|
@@ -105,7 +105,7 @@ import {
|
|
|
105
105
|
} from "./chunk-JCGWTIR4.js";
|
|
106
106
|
import {
|
|
107
107
|
IconButton
|
|
108
|
-
} from "./chunk-
|
|
108
|
+
} from "./chunk-APD6IX5R.js";
|
|
109
109
|
import {
|
|
110
110
|
Input
|
|
111
111
|
} from "./chunk-WZOYPFUU.js";
|
|
@@ -141,7 +141,7 @@ import {
|
|
|
141
141
|
} from "./chunk-UZDVOIW5.js";
|
|
142
142
|
import {
|
|
143
143
|
CircularProgress
|
|
144
|
-
} from "./chunk-
|
|
144
|
+
} from "./chunk-SEK6HENF.js";
|
|
145
145
|
import {
|
|
146
146
|
Droppable
|
|
147
147
|
} from "./chunk-TKI2CKHH.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cerberus-design/react",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.3",
|
|
4
4
|
"description": "The Cerberus Design React component library.",
|
|
5
5
|
"browserslist": "> 0.25%, not dead",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"react-dom": "^18",
|
|
27
27
|
"tsup": "^8.1.0",
|
|
28
28
|
"@cerberus-design/configs": "0.0.0",
|
|
29
|
-
"@cerberus-design/styled-system": "0.10.
|
|
29
|
+
"@cerberus-design/styled-system": "0.10.3"
|
|
30
30
|
},
|
|
31
31
|
"publishConfig": {
|
|
32
32
|
"access": "public"
|
|
@@ -70,40 +70,18 @@ export function CircularProgress(props: CircularProgressProps) {
|
|
|
70
70
|
>
|
|
71
71
|
<title>{props.title}</title>
|
|
72
72
|
<desc>{`${now}% ${status}`}</desc>
|
|
73
|
-
<
|
|
74
|
-
<
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
className={css({
|
|
86
|
-
transition: 'stroke-dashoffset 0.5s ease',
|
|
87
|
-
})}
|
|
88
|
-
cx="50%"
|
|
89
|
-
cy="50%"
|
|
90
|
-
r={radius}
|
|
91
|
-
pathLength="100"
|
|
92
|
-
stroke="black"
|
|
93
|
-
strokeDasharray="100"
|
|
94
|
-
strokeDashoffset={100 - now}
|
|
95
|
-
transform="rotate(-90 50 50)"
|
|
96
|
-
/>
|
|
97
|
-
</mask>
|
|
98
|
-
|
|
99
|
-
{/* <circle
|
|
100
|
-
fill="var(--cerberus-colors-page-surface-initial)"
|
|
101
|
-
cx="50%"
|
|
102
|
-
cy="50%"
|
|
103
|
-
r={`calc(50% * (1.15 - ${strokeW}/100))`}
|
|
104
|
-
pathLength="100"
|
|
105
|
-
mask="url(#progMask)"
|
|
106
|
-
/> */}
|
|
73
|
+
<defs>
|
|
74
|
+
<linearGradient id="gradient">
|
|
75
|
+
<stop
|
|
76
|
+
offset="0%"
|
|
77
|
+
stopColor="var(--cerberus-colors-action-bg-initial)"
|
|
78
|
+
/>
|
|
79
|
+
<stop
|
|
80
|
+
offset="100%"
|
|
81
|
+
stopColor="var(--cerberus-colors-action-bg-active)"
|
|
82
|
+
/>
|
|
83
|
+
</linearGradient>
|
|
84
|
+
</defs>
|
|
107
85
|
|
|
108
86
|
<circle
|
|
109
87
|
className={css({
|
|
@@ -126,14 +104,15 @@ export function CircularProgress(props: CircularProgressProps) {
|
|
|
126
104
|
<circle
|
|
127
105
|
data-complete={now === 100}
|
|
128
106
|
className={css({
|
|
129
|
-
stroke: '
|
|
130
|
-
transition: 'stroke-dashoffset 0.5s ease',
|
|
107
|
+
stroke: 'url(#gradient)',
|
|
108
|
+
transition: 'stroke-dashoffset, stroke 0.5s ease',
|
|
131
109
|
'&:is([data-complete=true])': {
|
|
132
110
|
stroke: 'success.bg.initial',
|
|
133
111
|
},
|
|
134
112
|
})}
|
|
135
113
|
cx="50%"
|
|
136
114
|
cy="50%"
|
|
115
|
+
fill="none"
|
|
137
116
|
r={radius}
|
|
138
117
|
pathLength="100"
|
|
139
118
|
strokeDasharray="100"
|
|
@@ -148,8 +127,10 @@ export function CircularProgress(props: CircularProgressProps) {
|
|
|
148
127
|
fontFamily: 'mono',
|
|
149
128
|
textStyle: '1.25rem',
|
|
150
129
|
})}
|
|
151
|
-
x="
|
|
152
|
-
y="
|
|
130
|
+
x="50%"
|
|
131
|
+
y="47%"
|
|
132
|
+
dominantBaseline="middle"
|
|
133
|
+
textAnchor="middle"
|
|
153
134
|
>
|
|
154
135
|
{now}%
|
|
155
136
|
</text>
|
|
@@ -157,9 +138,12 @@ export function CircularProgress(props: CircularProgressProps) {
|
|
|
157
138
|
className={css({
|
|
158
139
|
fill: 'page.text.100',
|
|
159
140
|
fontSize: '0.5rem',
|
|
141
|
+
fontWeight: 600,
|
|
160
142
|
})}
|
|
161
|
-
x="
|
|
162
|
-
y="
|
|
143
|
+
x="50%"
|
|
144
|
+
y="59%"
|
|
145
|
+
dominantBaseline="middle"
|
|
146
|
+
textAnchor="middle"
|
|
163
147
|
>
|
|
164
148
|
{status}
|
|
165
149
|
</text>
|
|
@@ -4,7 +4,6 @@ import {
|
|
|
4
4
|
iconButton,
|
|
5
5
|
type IconButtonVariantProps,
|
|
6
6
|
} from '@cerberus/styled-system/recipes'
|
|
7
|
-
import type { Positions } from '../types'
|
|
8
7
|
|
|
9
8
|
/**
|
|
10
9
|
* This module contains the Icon Button component.
|
|
@@ -17,12 +16,6 @@ export interface IconButtonRawProps
|
|
|
17
16
|
* The aria-label attribute for the icon button.
|
|
18
17
|
*/
|
|
19
18
|
ariaLabel: string
|
|
20
|
-
/**
|
|
21
|
-
* The position of the tooltip relative to the icon button.
|
|
22
|
-
* @example 'top' | 'right' | 'bottom' | 'left'
|
|
23
|
-
* @default 'top'
|
|
24
|
-
*/
|
|
25
|
-
tooltipPosition?: Positions
|
|
26
19
|
}
|
|
27
20
|
export type IconButtonProps = IconButtonRawProps & IconButtonVariantProps
|
|
28
21
|
|
|
@@ -35,8 +28,6 @@ export function IconButton(props: IconButtonProps): JSX.Element {
|
|
|
35
28
|
return (
|
|
36
29
|
<button
|
|
37
30
|
{...nativeProps}
|
|
38
|
-
data-tooltip
|
|
39
|
-
data-position={props.tooltipPosition ?? 'top'}
|
|
40
31
|
aria-label={ariaLabel ?? 'Icon Button'}
|
|
41
32
|
className={cx(
|
|
42
33
|
nativeProps.className,
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
'use client'
|
|
2
|
-
|
|
3
1
|
import type { PropsWithChildren } from 'react'
|
|
4
2
|
import { createPortal } from 'react-dom'
|
|
5
3
|
|
|
@@ -26,6 +24,10 @@ export interface PortalProps {
|
|
|
26
24
|
* @definition [React Portal Docs](https://react.dev/reference/react-dom/createPortal)
|
|
27
25
|
*/
|
|
28
26
|
export function Portal(props: PropsWithChildren<PortalProps>) {
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
if (typeof window !== 'undefined') {
|
|
28
|
+
const container = props.container || document.body
|
|
29
|
+
return createPortal(props.children, container, props.key)
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
return null
|
|
31
33
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/CircularProgress.tsx"],"sourcesContent":["'use client'\n\nimport { cq } from '@cerberus/styled-system/patterns'\nimport { css } from '@cerberus/styled-system/css'\nimport type { SVGProps } from 'react'\n\n/**\n * This module contains the CircularProgress component.\n * @module\n */\n\nexport interface CircularProgressProps extends SVGProps<SVGSVGElement> {\n /**\n * The current value of the CircularProgress\n */\n now: number\n /**\n * The title of the CircularProgress for a11y\n */\n title: string\n /**\n * What is shown below the now value (default: 'Done')\n */\n label?: string\n}\n\n/**\n * The CircularProgress component is used to display a loading indicator.\n * @param props - SVG element attributes\n * @param props.now - The current value of the CircularProgress\n * @param props.title - The title of the CircularProgress for a11y\n * @param props.label - What is shown below the now value (default: 'Done')\n * @see https://cerberus.digitalu.design/react/progress-indicators\n * @example\n * ```tsx\n * <CircularProgress now={24} title=\"Course completion\" label=\"done\" />\n * ```\n */\nexport function CircularProgress(props: CircularProgressProps) {\n const strokeW: number = 14\n const radius = `calc(50% * (1 - ${strokeW}/100))`\n const status: string = props.label ?? 'Done'\n const now: number = props.now >= 100 ? 100 : props.now\n\n return (\n <div\n aria-valuemin={0}\n aria-valuemax={100}\n aria-valuenow={now}\n className={cq({\n alignSelf: 'stretch',\n flex: 1,\n m: '4px',\n position: 'relative',\n })}\n role=\"progressbar\"\n >\n <svg\n data-complete={now === 100}\n className={css({\n display: 'block',\n rounded: 'full',\n transition: 'all 0.5s ease',\n })}\n fill=\"none\"\n strokeLinecap=\"round\"\n strokeWidth={strokeW}\n viewBox=\"0 0 100 100\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <title>{props.title}</title>\n <desc>{`${now}% ${status}`}</desc>\n <mask id=\"progMask\">\n <rect fill=\"white\" width=\"100%\" height=\"100%\" />\n <circle\n className={css({\n stroke: 'page.bg.100',\n })}\n cx=\"50%\"\n cy=\"50%\"\n r={radius}\n pathLength=\"100\"\n />\n <circle\n className={css({\n transition: 'stroke-dashoffset 0.5s ease',\n })}\n cx=\"50%\"\n cy=\"50%\"\n r={radius}\n pathLength=\"100\"\n stroke=\"black\"\n strokeDasharray=\"100\"\n strokeDashoffset={100 - now}\n transform=\"rotate(-90 50 50)\"\n />\n </mask>\n\n {/* <circle\n fill=\"var(--cerberus-colors-page-surface-initial)\"\n cx=\"50%\"\n cy=\"50%\"\n r={`calc(50% * (1.15 - ${strokeW}/100))`}\n pathLength=\"100\"\n mask=\"url(#progMask)\"\n /> */}\n\n <circle\n className={css({\n fill: 'page.surface.initial',\n })}\n cx=\"50%\"\n cy=\"50%\"\n r={`calc(50% * (1 - ${strokeW}/100))`}\n pathLength=\"100\"\n />\n <circle\n className={css({\n stroke: 'page.bg.100',\n })}\n cx=\"50%\"\n cy=\"50%\"\n r={radius}\n pathLength=\"100\"\n />\n <circle\n data-complete={now === 100}\n className={css({\n stroke: 'action.bg.initial',\n transition: 'stroke-dashoffset 0.5s ease',\n '&:is([data-complete=true])': {\n stroke: 'success.bg.initial',\n },\n })}\n cx=\"50%\"\n cy=\"50%\"\n r={radius}\n pathLength=\"100\"\n strokeDasharray=\"100\"\n strokeDashoffset={100 - now}\n transform=\"rotate(-90 50 50)\"\n />\n\n <g>\n <text\n className={css({\n fill: 'page.text.initial',\n fontFamily: 'mono',\n textStyle: '1.25rem',\n })}\n x=\"35%\"\n y=\"50%\"\n >\n {now}%\n </text>\n <text\n className={css({\n fill: 'page.text.100',\n fontSize: '0.5rem',\n })}\n x=\"39%\"\n y=\"60%\"\n >\n {status}\n </text>\n </g>\n </svg>\n </div>\n )\n}\n"],"mappings":";AAEA,SAAS,UAAU;AACnB,SAAS,WAAW;AAmEZ,cAEA,YAFA;AAhCD,SAAS,iBAAiB,OAA8B;AAC7D,QAAM,UAAkB;AACxB,QAAM,SAAS,mBAAmB,OAAO;AACzC,QAAM,SAAiB,MAAM,SAAS;AACtC,QAAM,MAAc,MAAM,OAAO,MAAM,MAAM,MAAM;AAEnD,SACE;AAAA,IAAC;AAAA;AAAA,MACC,iBAAe;AAAA,MACf,iBAAe;AAAA,MACf,iBAAe;AAAA,MACf,WAAW,GAAG;AAAA,QACZ,WAAW;AAAA,QACX,MAAM;AAAA,QACN,GAAG;AAAA,QACH,UAAU;AAAA,MACZ,CAAC;AAAA,MACD,MAAK;AAAA,MAEL;AAAA,QAAC;AAAA;AAAA,UACC,iBAAe,QAAQ;AAAA,UACvB,WAAW,IAAI;AAAA,YACb,SAAS;AAAA,YACT,SAAS;AAAA,YACT,YAAY;AAAA,UACd,CAAC;AAAA,UACD,MAAK;AAAA,UACL,eAAc;AAAA,UACd,aAAa;AAAA,UACb,SAAQ;AAAA,UACR,OAAM;AAAA,UAEN;AAAA,gCAAC,WAAO,gBAAM,OAAM;AAAA,YACpB,oBAAC,UAAM,aAAG,GAAG,KAAK,MAAM,IAAG;AAAA,YAC3B,qBAAC,UAAK,IAAG,YACP;AAAA,kCAAC,UAAK,MAAK,SAAQ,OAAM,QAAO,QAAO,QAAO;AAAA,cAC9C;AAAA,gBAAC;AAAA;AAAA,kBACC,WAAW,IAAI;AAAA,oBACb,QAAQ;AAAA,kBACV,CAAC;AAAA,kBACD,IAAG;AAAA,kBACH,IAAG;AAAA,kBACH,GAAG;AAAA,kBACH,YAAW;AAAA;AAAA,cACb;AAAA,cACA;AAAA,gBAAC;AAAA;AAAA,kBACC,WAAW,IAAI;AAAA,oBACb,YAAY;AAAA,kBACd,CAAC;AAAA,kBACD,IAAG;AAAA,kBACH,IAAG;AAAA,kBACH,GAAG;AAAA,kBACH,YAAW;AAAA,kBACX,QAAO;AAAA,kBACP,iBAAgB;AAAA,kBAChB,kBAAkB,MAAM;AAAA,kBACxB,WAAU;AAAA;AAAA,cACZ;AAAA,eACF;AAAA,YAWA;AAAA,cAAC;AAAA;AAAA,gBACC,WAAW,IAAI;AAAA,kBACb,MAAM;AAAA,gBACR,CAAC;AAAA,gBACD,IAAG;AAAA,gBACH,IAAG;AAAA,gBACH,GAAG,mBAAmB,OAAO;AAAA,gBAC7B,YAAW;AAAA;AAAA,YACb;AAAA,YACA;AAAA,cAAC;AAAA;AAAA,gBACC,WAAW,IAAI;AAAA,kBACb,QAAQ;AAAA,gBACV,CAAC;AAAA,gBACD,IAAG;AAAA,gBACH,IAAG;AAAA,gBACH,GAAG;AAAA,gBACH,YAAW;AAAA;AAAA,YACb;AAAA,YACA;AAAA,cAAC;AAAA;AAAA,gBACC,iBAAe,QAAQ;AAAA,gBACvB,WAAW,IAAI;AAAA,kBACb,QAAQ;AAAA,kBACR,YAAY;AAAA,kBACZ,8BAA8B;AAAA,oBAC5B,QAAQ;AAAA,kBACV;AAAA,gBACF,CAAC;AAAA,gBACD,IAAG;AAAA,gBACH,IAAG;AAAA,gBACH,GAAG;AAAA,gBACH,YAAW;AAAA,gBACX,iBAAgB;AAAA,gBAChB,kBAAkB,MAAM;AAAA,gBACxB,WAAU;AAAA;AAAA,YACZ;AAAA,YAEA,qBAAC,OACC;AAAA;AAAA,gBAAC;AAAA;AAAA,kBACC,WAAW,IAAI;AAAA,oBACb,MAAM;AAAA,oBACN,YAAY;AAAA,oBACZ,WAAW;AAAA,kBACb,CAAC;AAAA,kBACD,GAAE;AAAA,kBACF,GAAE;AAAA,kBAED;AAAA;AAAA,oBAAI;AAAA;AAAA;AAAA,cACP;AAAA,cACA;AAAA,gBAAC;AAAA;AAAA,kBACC,WAAW,IAAI;AAAA,oBACb,MAAM;AAAA,oBACN,UAAU;AAAA,kBACZ,CAAC;AAAA,kBACD,GAAE;AAAA,kBACF,GAAE;AAAA,kBAED;AAAA;AAAA,cACH;AAAA,eACF;AAAA;AAAA;AAAA,MACF;AAAA;AAAA,EACF;AAEJ;","names":[]}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
// src/components/Portal.tsx
|
|
2
|
-
import { createPortal } from "react-dom";
|
|
3
|
-
function Portal(props) {
|
|
4
|
-
const container = props.container || document.body;
|
|
5
|
-
return createPortal(props.children, container, props.key);
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export {
|
|
9
|
-
Portal
|
|
10
|
-
};
|
|
11
|
-
//# sourceMappingURL=chunk-5IVINNV2.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/Portal.tsx"],"sourcesContent":["'use client'\n\nimport type { PropsWithChildren } from 'react'\nimport { createPortal } from 'react-dom'\n\n/**\n * This module is the Portal component.\n * @module\n */\n\nexport interface PortalProps {\n /**\n * The root container to render the children into.\n * @default document.body\n */\n container?: Element | DocumentFragment\n /**\n * An optional key to use for the Portal component.\n */\n key?: null | string\n}\n\n/**\n * The Portal component is used to render children into a DOM node that exists outside the DOM hierarchy of the parent component.\n * @see https://cerberus.digitalu.design/react/portal\n * @definition [React Portal Docs](https://react.dev/reference/react-dom/createPortal)\n */\nexport function Portal(props: PropsWithChildren<PortalProps>) {\n const container = props.container || document.body\n return createPortal(props.children, container, props.key)\n}\n"],"mappings":";AAGA,SAAS,oBAAoB;AAwBtB,SAAS,OAAO,OAAuC;AAC5D,QAAM,YAAY,MAAM,aAAa,SAAS;AAC9C,SAAO,aAAa,MAAM,UAAU,WAAW,MAAM,GAAG;AAC1D;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/IconButton.tsx"],"sourcesContent":["import type { ButtonHTMLAttributes } from 'react'\nimport { cx } from '@cerberus/styled-system/css'\nimport {\n iconButton,\n type IconButtonVariantProps,\n} from '@cerberus/styled-system/recipes'\nimport type { Positions } from '../types'\n\n/**\n * This module contains the Icon Button component.\n * @module\n */\n\nexport interface IconButtonRawProps\n extends ButtonHTMLAttributes<HTMLButtonElement> {\n /**\n * The aria-label attribute for the icon button.\n */\n ariaLabel: string\n /**\n * The position of the tooltip relative to the icon button.\n * @example 'top' | 'right' | 'bottom' | 'left'\n * @default 'top'\n */\n tooltipPosition?: Positions\n}\nexport type IconButtonProps = IconButtonRawProps & IconButtonVariantProps\n\n/**\n * A component that allows the user to perform actions using an icon\n * @see https://cerberus.digitalu.design/react/icon-button\n */\nexport function IconButton(props: IconButtonProps): JSX.Element {\n const { ariaLabel, palette, usage, size, ...nativeProps } = props\n return (\n <button\n {...nativeProps}\n data-tooltip\n data-position={props.tooltipPosition ?? 'top'}\n aria-label={ariaLabel ?? 'Icon Button'}\n className={cx(\n nativeProps.className,\n iconButton({\n palette,\n usage,\n size,\n }),\n )}\n />\n )\n}\n"],"mappings":";AACA,SAAS,UAAU;AACnB;AAAA,EACE;AAAA,OAEK;AA8BH;AAHG,SAAS,WAAW,OAAqC;AAC9D,QAAM,EAAE,WAAW,SAAS,OAAO,MAAM,GAAG,YAAY,IAAI;AAC5D,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ,gBAAY;AAAA,MACZ,iBAAe,MAAM,mBAAmB;AAAA,MACxC,cAAY,aAAa;AAAA,MACzB,WAAW;AAAA,QACT,YAAY;AAAA,QACZ,WAAW;AAAA,UACT;AAAA,UACA;AAAA,UACA;AAAA,QACF,CAAC;AAAA,MACH;AAAA;AAAA,EACF;AAEJ;","names":[]}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|