@mieweb/ui 0.7.3-dev.24 → 0.7.3-dev.26
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/brands/index.cjs +17 -17
- package/dist/brands/index.js +4 -4
- package/dist/chunk-5MXO6PEV.cjs +78 -0
- package/dist/chunk-5MXO6PEV.cjs.map +1 -0
- package/dist/chunk-5QZ73PZC.js +62 -0
- package/dist/chunk-5QZ73PZC.js.map +1 -0
- package/dist/{chunk-GEG6G7OF.js → chunk-IYXCFIMP.js} +3 -3
- package/dist/{chunk-GEG6G7OF.js.map → chunk-IYXCFIMP.js.map} +1 -1
- package/dist/{chunk-VA7QN4DX.cjs → chunk-JDHIBJ5K.cjs} +2 -2
- package/dist/{chunk-VA7QN4DX.cjs.map → chunk-JDHIBJ5K.cjs.map} +1 -1
- package/dist/{chunk-BCJFOSZX.js → chunk-MO65V64I.js} +2 -2
- package/dist/{chunk-BCJFOSZX.js.map → chunk-MO65V64I.js.map} +1 -1
- package/dist/chunk-NGSDBWKA.cjs +84 -0
- package/dist/chunk-NGSDBWKA.cjs.map +1 -0
- package/dist/{chunk-WALAUOQB.cjs → chunk-SK7H3Z67.cjs} +3 -3
- package/dist/{chunk-WALAUOQB.cjs.map → chunk-SK7H3Z67.cjs.map} +1 -1
- package/dist/chunk-WKSUL2ZN.js +56 -0
- package/dist/chunk-WKSUL2ZN.js.map +1 -0
- package/dist/{chunk-NA2JKM2W.cjs → chunk-YQTHQSAS.cjs} +9 -2
- package/dist/chunk-YQTHQSAS.cjs.map +1 -0
- package/dist/{chunk-HN7AIGT6.js → chunk-ZVBU64U6.js} +9 -2
- package/dist/chunk-ZVBU64U6.js.map +1 -0
- package/dist/components/CopyButton/index.cjs +13 -0
- package/dist/components/CopyButton/index.cjs.map +1 -0
- package/dist/components/CopyButton/index.d.cts +29 -0
- package/dist/components/CopyButton/index.d.ts +29 -0
- package/dist/components/CopyButton/index.js +4 -0
- package/dist/components/CopyButton/index.js.map +1 -0
- package/dist/components/ReadingProgressBar/index.cjs +13 -0
- package/dist/components/ReadingProgressBar/index.cjs.map +1 -0
- package/dist/components/ReadingProgressBar/index.d.cts +20 -0
- package/dist/components/ReadingProgressBar/index.d.ts +20 -0
- package/dist/components/ReadingProgressBar/index.js +4 -0
- package/dist/components/ReadingProgressBar/index.js.map +1 -0
- package/dist/esheet.cjs +5 -5
- package/dist/esheet.js +2 -2
- package/dist/index.cjs +231 -221
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +22 -20
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/tailwind-preset.cjs +4 -4
- package/dist/tailwind-preset.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-HN7AIGT6.js.map +0 -1
- package/dist/chunk-NA2JKM2W.cjs.map +0 -1
package/dist/brands/index.cjs
CHANGED
|
@@ -1,21 +1,29 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkJDHIBJ5K_cjs = require('../chunk-JDHIBJ5K.cjs');
|
|
4
|
+
var chunkP52GA3GJ_cjs = require('../chunk-P52GA3GJ.cjs');
|
|
5
|
+
var chunkLCQGAOAZ_cjs = require('../chunk-LCQGAOAZ.cjs');
|
|
4
6
|
var chunkZ5J4NTPL_cjs = require('../chunk-Z5J4NTPL.cjs');
|
|
5
7
|
var chunkU7VQUOLS_cjs = require('../chunk-U7VQUOLS.cjs');
|
|
8
|
+
var chunkRR2MJBGV_cjs = require('../chunk-RR2MJBGV.cjs');
|
|
6
9
|
var chunkX7S76WB7_cjs = require('../chunk-X7S76WB7.cjs');
|
|
7
|
-
var chunkP52GA3GJ_cjs = require('../chunk-P52GA3GJ.cjs');
|
|
8
|
-
var chunkLCQGAOAZ_cjs = require('../chunk-LCQGAOAZ.cjs');
|
|
9
10
|
var chunkJ644FU54_cjs = require('../chunk-J644FU54.cjs');
|
|
10
11
|
var chunkWNJRS7Y7_cjs = require('../chunk-WNJRS7Y7.cjs');
|
|
11
12
|
var chunkUCGUA3QV_cjs = require('../chunk-UCGUA3QV.cjs');
|
|
12
|
-
var chunkRR2MJBGV_cjs = require('../chunk-RR2MJBGV.cjs');
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
Object.defineProperty(exports, "brands", {
|
|
17
17
|
enumerable: true,
|
|
18
|
-
get: function () { return
|
|
18
|
+
get: function () { return chunkJDHIBJ5K_cjs.brands; }
|
|
19
|
+
});
|
|
20
|
+
Object.defineProperty(exports, "enterpriseHealthBrand", {
|
|
21
|
+
enumerable: true,
|
|
22
|
+
get: function () { return chunkP52GA3GJ_cjs.enterpriseHealthBrand; }
|
|
23
|
+
});
|
|
24
|
+
Object.defineProperty(exports, "miewebBrand", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function () { return chunkLCQGAOAZ_cjs.miewebBrand; }
|
|
19
27
|
});
|
|
20
28
|
Object.defineProperty(exports, "wagglelineBrand", {
|
|
21
29
|
enumerable: true,
|
|
@@ -25,17 +33,13 @@ Object.defineProperty(exports, "webchartBrand", {
|
|
|
25
33
|
enumerable: true,
|
|
26
34
|
get: function () { return chunkU7VQUOLS_cjs.webchartBrand; }
|
|
27
35
|
});
|
|
28
|
-
Object.defineProperty(exports, "
|
|
29
|
-
enumerable: true,
|
|
30
|
-
get: function () { return chunkX7S76WB7_cjs.defaultBrand; }
|
|
31
|
-
});
|
|
32
|
-
Object.defineProperty(exports, "enterpriseHealthBrand", {
|
|
36
|
+
Object.defineProperty(exports, "ozwellBrand", {
|
|
33
37
|
enumerable: true,
|
|
34
|
-
get: function () { return
|
|
38
|
+
get: function () { return chunkRR2MJBGV_cjs.ozwellBrand; }
|
|
35
39
|
});
|
|
36
|
-
Object.defineProperty(exports, "
|
|
40
|
+
Object.defineProperty(exports, "defaultBrand", {
|
|
37
41
|
enumerable: true,
|
|
38
|
-
get: function () { return
|
|
42
|
+
get: function () { return chunkX7S76WB7_cjs.defaultBrand; }
|
|
39
43
|
});
|
|
40
44
|
Object.defineProperty(exports, "createBrandPreset", {
|
|
41
45
|
enumerable: true,
|
|
@@ -57,9 +61,5 @@ Object.defineProperty(exports, "ccmeBrand", {
|
|
|
57
61
|
enumerable: true,
|
|
58
62
|
get: function () { return chunkUCGUA3QV_cjs.ccmeBrand; }
|
|
59
63
|
});
|
|
60
|
-
Object.defineProperty(exports, "ozwellBrand", {
|
|
61
|
-
enumerable: true,
|
|
62
|
-
get: function () { return chunkRR2MJBGV_cjs.ozwellBrand; }
|
|
63
|
-
});
|
|
64
64
|
//# sourceMappingURL=index.cjs.map
|
|
65
65
|
//# sourceMappingURL=index.cjs.map
|
package/dist/brands/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
export { brands } from '../chunk-
|
|
1
|
+
export { brands } from '../chunk-MO65V64I.js';
|
|
2
|
+
export { enterpriseHealthBrand } from '../chunk-MTZPVOP6.js';
|
|
3
|
+
export { miewebBrand } from '../chunk-NERS5ZT6.js';
|
|
2
4
|
export { wagglelineBrand } from '../chunk-2NTYAALC.js';
|
|
3
5
|
export { webchartBrand } from '../chunk-CW66SO5O.js';
|
|
6
|
+
export { ozwellBrand } from '../chunk-5YUBQIC7.js';
|
|
4
7
|
export { defaultBrand } from '../chunk-PSTGFXQG.js';
|
|
5
|
-
export { enterpriseHealthBrand } from '../chunk-MTZPVOP6.js';
|
|
6
|
-
export { miewebBrand } from '../chunk-NERS5ZT6.js';
|
|
7
8
|
export { createBrandPreset, generateBrandCSS, generateTailwindTheme } from '../chunk-WOYUQ4AT.js';
|
|
8
9
|
export { bluehiveBrand } from '../chunk-3T7QGLNB.js';
|
|
9
10
|
export { ccmeBrand } from '../chunk-SCQRJPSV.js';
|
|
10
|
-
export { ozwellBrand } from '../chunk-5YUBQIC7.js';
|
|
11
11
|
//# sourceMappingURL=index.js.map
|
|
12
12
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkS5RVSXDV_cjs = require('./chunk-S5RVSXDV.cjs');
|
|
4
|
+
var React = require('react');
|
|
5
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
6
|
+
|
|
7
|
+
function _interopNamespace(e) {
|
|
8
|
+
if (e && e.__esModule) return e;
|
|
9
|
+
var n = Object.create(null);
|
|
10
|
+
if (e) {
|
|
11
|
+
Object.keys(e).forEach(function (k) {
|
|
12
|
+
if (k !== 'default') {
|
|
13
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
14
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
15
|
+
enumerable: true,
|
|
16
|
+
get: function () { return e[k]; }
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
n.default = e;
|
|
22
|
+
return Object.freeze(n);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
26
|
+
|
|
27
|
+
var ReadingProgressBar = React__namespace.forwardRef(function ReadingProgressBar2({ className, barClassName, ...props }, ref) {
|
|
28
|
+
const [pct, setPct] = React__namespace.useState(0);
|
|
29
|
+
React__namespace.useEffect(() => {
|
|
30
|
+
let rafId = 0;
|
|
31
|
+
const update = () => {
|
|
32
|
+
const el = document.documentElement;
|
|
33
|
+
const max = el.scrollHeight - el.clientHeight;
|
|
34
|
+
setPct(
|
|
35
|
+
max > 0 ? Math.min(100, Math.max(0, el.scrollTop / max * 100)) : 0
|
|
36
|
+
);
|
|
37
|
+
};
|
|
38
|
+
const schedule = () => {
|
|
39
|
+
cancelAnimationFrame(rafId);
|
|
40
|
+
rafId = requestAnimationFrame(update);
|
|
41
|
+
};
|
|
42
|
+
update();
|
|
43
|
+
window.addEventListener("scroll", schedule, { passive: true });
|
|
44
|
+
window.addEventListener("resize", schedule);
|
|
45
|
+
return () => {
|
|
46
|
+
cancelAnimationFrame(rafId);
|
|
47
|
+
window.removeEventListener("scroll", schedule);
|
|
48
|
+
window.removeEventListener("resize", schedule);
|
|
49
|
+
};
|
|
50
|
+
}, []);
|
|
51
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
52
|
+
"div",
|
|
53
|
+
{
|
|
54
|
+
ref,
|
|
55
|
+
...props,
|
|
56
|
+
"aria-hidden": "true",
|
|
57
|
+
className: chunkS5RVSXDV_cjs.cn(
|
|
58
|
+
"pointer-events-none fixed inset-x-0 top-0 z-50 h-1 bg-transparent",
|
|
59
|
+
className
|
|
60
|
+
),
|
|
61
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
62
|
+
"div",
|
|
63
|
+
{
|
|
64
|
+
"data-slot": "reading-progress-fill",
|
|
65
|
+
className: chunkS5RVSXDV_cjs.cn(
|
|
66
|
+
"h-full transition-[width] duration-150",
|
|
67
|
+
barClassName ?? "bg-primary-500"
|
|
68
|
+
),
|
|
69
|
+
style: { width: `${pct}%` }
|
|
70
|
+
}
|
|
71
|
+
)
|
|
72
|
+
}
|
|
73
|
+
);
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
exports.ReadingProgressBar = ReadingProgressBar;
|
|
77
|
+
//# sourceMappingURL=chunk-5MXO6PEV.cjs.map
|
|
78
|
+
//# sourceMappingURL=chunk-5MXO6PEV.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/ReadingProgressBar/ReadingProgressBar.tsx"],"names":["React","ReadingProgressBar","jsx","cn"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAwBO,IAAM,kBAAA,GAA2BA,gBAAA,CAAA,UAAA,CAGtC,SAASC,mBAAAA,CAAmB,EAAE,WAAW,YAAA,EAAc,GAAG,KAAA,EAAM,EAAG,GAAA,EAAK;AACxE,EAAA,MAAM,CAAC,GAAA,EAAK,MAAM,CAAA,GAAUD,0BAAS,CAAC,CAAA;AAEtC,EAAMA,2BAAU,MAAM;AACpB,IAAA,IAAI,KAAA,GAAQ,CAAA;AAEZ,IAAA,MAAM,SAAS,MAAM;AACnB,MAAA,MAAM,KAAK,QAAA,CAAS,eAAA;AACpB,MAAA,MAAM,GAAA,GAAM,EAAA,CAAG,YAAA,GAAe,EAAA,CAAG,YAAA;AACjC,MAAA,MAAA;AAAA,QACE,GAAA,GAAM,CAAA,GAAI,IAAA,CAAK,GAAA,CAAI,GAAA,EAAK,IAAA,CAAK,GAAA,CAAI,CAAA,EAAI,EAAA,CAAG,SAAA,GAAY,GAAA,GAAO,GAAG,CAAC,CAAA,GAAI;AAAA,OACrE;AAAA,IACF,CAAA;AAGA,IAAA,MAAM,WAAW,MAAM;AACrB,MAAA,oBAAA,CAAqB,KAAK,CAAA;AAC1B,MAAA,KAAA,GAAQ,sBAAsB,MAAM,CAAA;AAAA,IACtC,CAAA;AAEA,IAAA,MAAA,EAAO;AACP,IAAA,MAAA,CAAO,iBAAiB,QAAA,EAAU,QAAA,EAAU,EAAE,OAAA,EAAS,MAAM,CAAA;AAC7D,IAAA,MAAA,CAAO,gBAAA,CAAiB,UAAU,QAAQ,CAAA;AAC1C,IAAA,OAAO,MAAM;AACX,MAAA,oBAAA,CAAqB,KAAK,CAAA;AAC1B,MAAA,MAAA,CAAO,mBAAA,CAAoB,UAAU,QAAQ,CAAA;AAC7C,MAAA,MAAA,CAAO,mBAAA,CAAoB,UAAU,QAAQ,CAAA;AAAA,IAC/C,CAAA;AAAA,EACF,CAAA,EAAG,EAAE,CAAA;AAEL,EAAA,uBACEE,cAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,GAAA;AAAA,MACC,GAAG,KAAA;AAAA,MACJ,aAAA,EAAY,MAAA;AAAA,MACZ,SAAA,EAAWC,oBAAA;AAAA,QACT,mEAAA;AAAA,QACA;AAAA,OACF;AAAA,MAEA,QAAA,kBAAAD,cAAA;AAAA,QAAC,KAAA;AAAA,QAAA;AAAA,UACC,WAAA,EAAU,uBAAA;AAAA,UACV,SAAA,EAAWC,oBAAA;AAAA,YACT,wCAAA;AAAA,YACA,YAAA,IAAgB;AAAA,WAClB;AAAA,UACA,KAAA,EAAO,EAAE,KAAA,EAAO,CAAA,EAAG,GAAG,CAAA,CAAA,CAAA;AAAI;AAAA;AAC5B;AAAA,GACF;AAEJ,CAAC","file":"chunk-5MXO6PEV.cjs","sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { cn } from '../../utils/cn';\n\nexport interface ReadingProgressBarProps extends Omit<\n React.HTMLAttributes<HTMLDivElement>,\n 'children'\n> {\n /** Class for the filled bar (default `bg-primary-500`). */\n barClassName?: string;\n}\n\n/**\n * A thin progress bar pinned to the top of the viewport, tracking how far\n * the reader has scrolled through the document. Purely decorative\n * (`aria-hidden`) — long-form articles, guides, reports.\n *\n * @example\n * ```tsx\n * <ReadingProgressBar />\n * <ReadingProgressBar barClassName=\"bg-warning\" className=\"h-0.5\" />\n * ```\n */\nexport const ReadingProgressBar = React.forwardRef<\n HTMLDivElement,\n ReadingProgressBarProps\n>(function ReadingProgressBar({ className, barClassName, ...props }, ref) {\n const [pct, setPct] = React.useState(0);\n\n React.useEffect(() => {\n let rafId = 0;\n\n const update = () => {\n const el = document.documentElement;\n const max = el.scrollHeight - el.clientHeight;\n setPct(\n max > 0 ? Math.min(100, Math.max(0, (el.scrollTop / max) * 100)) : 0\n );\n };\n\n // Coalesce bursty scroll events to one state update per frame\n const schedule = () => {\n cancelAnimationFrame(rafId);\n rafId = requestAnimationFrame(update);\n };\n\n update();\n window.addEventListener('scroll', schedule, { passive: true });\n window.addEventListener('resize', schedule);\n return () => {\n cancelAnimationFrame(rafId);\n window.removeEventListener('scroll', schedule);\n window.removeEventListener('resize', schedule);\n };\n }, []);\n\n return (\n <div\n ref={ref}\n {...props}\n aria-hidden=\"true\"\n className={cn(\n 'pointer-events-none fixed inset-x-0 top-0 z-50 h-1 bg-transparent',\n className\n )}\n >\n <div\n data-slot=\"reading-progress-fill\"\n className={cn(\n 'h-full transition-[width] duration-150',\n barClassName ?? 'bg-primary-500'\n )}\n style={{ width: `${pct}%` }}\n />\n </div>\n );\n});\n"]}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { cn } from './chunk-TQONQSJO.js';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { Check, Copy } from 'lucide-react';
|
|
4
|
+
import { jsx } from 'react/jsx-runtime';
|
|
5
|
+
|
|
6
|
+
var CopyButton = React.forwardRef(
|
|
7
|
+
function CopyButton2({
|
|
8
|
+
value,
|
|
9
|
+
label = "Copy",
|
|
10
|
+
copiedLabel = "Copied",
|
|
11
|
+
timeout = 1200,
|
|
12
|
+
onCopied,
|
|
13
|
+
className,
|
|
14
|
+
onClick,
|
|
15
|
+
...props
|
|
16
|
+
}, ref) {
|
|
17
|
+
const [copied, setCopied] = React.useState(false);
|
|
18
|
+
const timer = React.useRef(null);
|
|
19
|
+
React.useEffect(
|
|
20
|
+
() => () => {
|
|
21
|
+
if (timer.current) clearTimeout(timer.current);
|
|
22
|
+
},
|
|
23
|
+
[]
|
|
24
|
+
);
|
|
25
|
+
const handleClick = async (e) => {
|
|
26
|
+
e.stopPropagation();
|
|
27
|
+
e.preventDefault();
|
|
28
|
+
onClick?.(e);
|
|
29
|
+
try {
|
|
30
|
+
await navigator.clipboard.writeText(value);
|
|
31
|
+
setCopied(true);
|
|
32
|
+
onCopied?.(value);
|
|
33
|
+
if (timer.current) clearTimeout(timer.current);
|
|
34
|
+
timer.current = setTimeout(() => setCopied(false), timeout);
|
|
35
|
+
} catch {
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
return /* @__PURE__ */ jsx(
|
|
39
|
+
"button",
|
|
40
|
+
{
|
|
41
|
+
ref,
|
|
42
|
+
type: "button",
|
|
43
|
+
onClick: handleClick,
|
|
44
|
+
title: copied ? copiedLabel : label,
|
|
45
|
+
"aria-label": copied ? copiedLabel : label,
|
|
46
|
+
className: cn(
|
|
47
|
+
"inline-flex shrink-0 items-center justify-center rounded p-1 transition-colors",
|
|
48
|
+
"focus-visible:ring-ring focus-visible:ring-2 focus-visible:outline-none",
|
|
49
|
+
copied ? "text-success" : "text-muted-foreground hover:bg-muted hover:text-foreground",
|
|
50
|
+
className
|
|
51
|
+
),
|
|
52
|
+
...props,
|
|
53
|
+
children: copied ? /* @__PURE__ */ jsx(Check, { "aria-hidden": "true", className: "h-3.5 w-3.5" }) : /* @__PURE__ */ jsx(Copy, { "aria-hidden": "true", className: "h-3.5 w-3.5" })
|
|
54
|
+
}
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
);
|
|
58
|
+
CopyButton.displayName = "CopyButton";
|
|
59
|
+
|
|
60
|
+
export { CopyButton };
|
|
61
|
+
//# sourceMappingURL=chunk-5QZ73PZC.js.map
|
|
62
|
+
//# sourceMappingURL=chunk-5QZ73PZC.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/CopyButton/CopyButton.tsx"],"names":["CopyButton"],"mappings":";;;;;AAkCO,IAAM,UAAA,GAAmB,KAAA,CAAA,UAAA;AAAA,EAC9B,SAASA,WAAAA,CACP;AAAA,IACE,KAAA;AAAA,IACA,KAAA,GAAQ,MAAA;AAAA,IACR,WAAA,GAAc,QAAA;AAAA,IACd,OAAA,GAAU,IAAA;AAAA,IACV,QAAA;AAAA,IACA,SAAA;AAAA,IACA,OAAA;AAAA,IACA,GAAG;AAAA,KAEL,GAAA,EACA;AACA,IAAA,MAAM,CAAC,MAAA,EAAQ,SAAS,CAAA,GAAU,eAAS,KAAK,CAAA;AAChD,IAAA,MAAM,KAAA,GAAc,aAA6C,IAAI,CAAA;AAErE,IAAM,KAAA,CAAA,SAAA;AAAA,MACJ,MAAM,MAAM;AACV,QAAA,IAAI,KAAA,CAAM,OAAA,EAAS,YAAA,CAAa,KAAA,CAAM,OAAO,CAAA;AAAA,MAC/C,CAAA;AAAA,MACA;AAAC,KACH;AAEA,IAAA,MAAM,WAAA,GAAc,OAAO,CAAA,KAA2C;AAEpE,MAAA,CAAA,CAAE,eAAA,EAAgB;AAClB,MAAA,CAAA,CAAE,cAAA,EAAe;AACjB,MAAA,OAAA,GAAU,CAAC,CAAA;AACX,MAAA,IAAI;AACF,QAAA,MAAM,SAAA,CAAU,SAAA,CAAU,SAAA,CAAU,KAAK,CAAA;AACzC,QAAA,SAAA,CAAU,IAAI,CAAA;AACd,QAAA,QAAA,GAAW,KAAK,CAAA;AAChB,QAAA,IAAI,KAAA,CAAM,OAAA,EAAS,YAAA,CAAa,KAAA,CAAM,OAAO,CAAA;AAC7C,QAAA,KAAA,CAAM,UAAU,UAAA,CAAW,MAAM,SAAA,CAAU,KAAK,GAAG,OAAO,CAAA;AAAA,MAC5D,CAAA,CAAA,MAAQ;AAAA,MAER;AAAA,IACF,CAAA;AAEA,IAAA,uBACE,GAAA;AAAA,MAAC,QAAA;AAAA,MAAA;AAAA,QACC,GAAA;AAAA,QACA,IAAA,EAAK,QAAA;AAAA,QACL,OAAA,EAAS,WAAA;AAAA,QACT,KAAA,EAAO,SAAS,WAAA,GAAc,KAAA;AAAA,QAC9B,YAAA,EAAY,SAAS,WAAA,GAAc,KAAA;AAAA,QACnC,SAAA,EAAW,EAAA;AAAA,UACT,gFAAA;AAAA,UACA,yEAAA;AAAA,UACA,SACI,cAAA,GACA,4DAAA;AAAA,UACJ;AAAA,SACF;AAAA,QACC,GAAG,KAAA;AAAA,QAEH,QAAA,EAAA,MAAA,mBACC,GAAA,CAAC,KAAA,EAAA,EAAM,aAAA,EAAY,MAAA,EAAO,SAAA,EAAU,aAAA,EAAc,CAAA,mBAElD,GAAA,CAAC,IAAA,EAAA,EAAK,aAAA,EAAY,MAAA,EAAO,WAAU,aAAA,EAAc;AAAA;AAAA,KAErD;AAAA,EAEJ;AACF;AAEA,UAAA,CAAW,WAAA,GAAc,YAAA","file":"chunk-5QZ73PZC.js","sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { Check, Copy } from 'lucide-react';\nimport { cn } from '../../utils/cn';\n\nexport interface CopyButtonProps extends Omit<\n React.ButtonHTMLAttributes<HTMLButtonElement>,\n 'value'\n> {\n /** Text written to the clipboard. */\n value: string;\n /** Accessible label / tooltip (default \"Copy\"). */\n label?: string;\n /** Label while the copied state shows (default \"Copied\"). */\n copiedLabel?: string;\n /** How long the copied state shows, in ms (default 1200). */\n timeout?: number;\n /** Called after a successful copy. */\n onCopied?: (value: string) => void;\n}\n\n/**\n * An inline copy-to-clipboard icon button with a brief success check.\n * Copied state is isolated per instance — safe to drop into table rows,\n * ID chips, and detail fields.\n *\n * @example\n * ```tsx\n * <span className=\"flex items-center gap-1\">\n * MRN WC-10382 <CopyButton value=\"WC-10382\" label=\"Copy MRN\" />\n * </span>\n * ```\n */\nexport const CopyButton = React.forwardRef<HTMLButtonElement, CopyButtonProps>(\n function CopyButton(\n {\n value,\n label = 'Copy',\n copiedLabel = 'Copied',\n timeout = 1200,\n onCopied,\n className,\n onClick,\n ...props\n },\n ref\n ) {\n const [copied, setCopied] = React.useState(false);\n const timer = React.useRef<ReturnType<typeof setTimeout> | null>(null);\n\n React.useEffect(\n () => () => {\n if (timer.current) clearTimeout(timer.current);\n },\n []\n );\n\n const handleClick = async (e: React.MouseEvent<HTMLButtonElement>) => {\n // Inside clickable rows/links the copy must not trigger the row action\n e.stopPropagation();\n e.preventDefault();\n onClick?.(e);\n try {\n await navigator.clipboard.writeText(value);\n setCopied(true);\n onCopied?.(value);\n if (timer.current) clearTimeout(timer.current);\n timer.current = setTimeout(() => setCopied(false), timeout);\n } catch {\n /* clipboard access denied — silent */\n }\n };\n\n return (\n <button\n ref={ref}\n type=\"button\"\n onClick={handleClick}\n title={copied ? copiedLabel : label}\n aria-label={copied ? copiedLabel : label}\n className={cn(\n 'inline-flex shrink-0 items-center justify-center rounded p-1 transition-colors',\n 'focus-visible:ring-ring focus-visible:ring-2 focus-visible:outline-none',\n copied\n ? 'text-success'\n : 'text-muted-foreground hover:bg-muted hover:text-foreground',\n className\n )}\n {...props}\n >\n {copied ? (\n <Check aria-hidden=\"true\" className=\"h-3.5 w-3.5\" />\n ) : (\n <Copy aria-hidden=\"true\" className=\"h-3.5 w-3.5\" />\n )}\n </button>\n );\n }\n);\n\nCopyButton.displayName = 'CopyButton';\n"]}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Textarea } from './chunk-H3YO5GBM.js';
|
|
2
2
|
import { Tooltip } from './chunk-FJ7YPVKV.js';
|
|
3
3
|
import { RadioGroup, Radio } from './chunk-EPSB4WTL.js';
|
|
4
|
+
import { Label } from './chunk-I3WGZPI6.js';
|
|
4
5
|
import { Select } from './chunk-XBKOZRDO.js';
|
|
5
6
|
import { DateInput } from './chunk-IILJGFI5.js';
|
|
6
|
-
import { Label } from './chunk-I3WGZPI6.js';
|
|
7
7
|
import { Card, CardHeader, CardContent } from './chunk-QYSUYB3S.js';
|
|
8
8
|
import { Modal, ModalHeader, ModalTitle, ModalClose, ModalBody, ModalFooter } from './chunk-XMCIXHGH.js';
|
|
9
9
|
import { Input } from './chunk-3IMM2PM4.js';
|
|
@@ -1565,5 +1565,5 @@ function MedicationReconciliation({
|
|
|
1565
1565
|
}
|
|
1566
1566
|
|
|
1567
1567
|
export { ALLERGY_TYPE_LABELS, AllergyList, AllergyManager, CodeLookupProvider, MEDICATION_STATUS_LABELS, MedicationEditor, MedicationList, MedicationReconciliation, RowActionToolbar, RowIconButton, labelToMedicationFields, lookupToMedicationFields, parseMedicationLabel, parseSig, toolbarKeyNav, useCodeLookupConfig };
|
|
1568
|
-
//# sourceMappingURL=chunk-
|
|
1569
|
-
//# sourceMappingURL=chunk-
|
|
1568
|
+
//# sourceMappingURL=chunk-IYXCFIMP.js.map
|
|
1569
|
+
//# sourceMappingURL=chunk-IYXCFIMP.js.map
|