@mieweb/ui 0.7.3-dev.25 → 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.
Files changed (37) hide show
  1. package/dist/brands/index.cjs +12 -12
  2. package/dist/brands/index.js +3 -3
  3. package/dist/chunk-5QZ73PZC.js +62 -0
  4. package/dist/chunk-5QZ73PZC.js.map +1 -0
  5. package/dist/{chunk-GEG6G7OF.js → chunk-IYXCFIMP.js} +3 -3
  6. package/dist/{chunk-GEG6G7OF.js.map → chunk-IYXCFIMP.js.map} +1 -1
  7. package/dist/{chunk-B57MGVGR.cjs → chunk-JDHIBJ5K.cjs} +2 -2
  8. package/dist/{chunk-B57MGVGR.cjs.map → chunk-JDHIBJ5K.cjs.map} +1 -1
  9. package/dist/{chunk-TPGX25WD.js → chunk-MO65V64I.js} +2 -2
  10. package/dist/{chunk-TPGX25WD.js.map → chunk-MO65V64I.js.map} +1 -1
  11. package/dist/chunk-NGSDBWKA.cjs +84 -0
  12. package/dist/chunk-NGSDBWKA.cjs.map +1 -0
  13. package/dist/{chunk-WALAUOQB.cjs → chunk-SK7H3Z67.cjs} +3 -3
  14. package/dist/{chunk-WALAUOQB.cjs.map → chunk-SK7H3Z67.cjs.map} +1 -1
  15. package/dist/{chunk-FC4EG7YP.cjs → chunk-YQTHQSAS.cjs} +4 -2
  16. package/dist/chunk-YQTHQSAS.cjs.map +1 -0
  17. package/dist/{chunk-F4SIY7JS.js → chunk-ZVBU64U6.js} +4 -2
  18. package/dist/chunk-ZVBU64U6.js.map +1 -0
  19. package/dist/components/CopyButton/index.cjs +13 -0
  20. package/dist/components/CopyButton/index.cjs.map +1 -0
  21. package/dist/components/CopyButton/index.d.cts +29 -0
  22. package/dist/components/CopyButton/index.d.ts +29 -0
  23. package/dist/components/CopyButton/index.js +4 -0
  24. package/dist/components/CopyButton/index.js.map +1 -0
  25. package/dist/esheet.cjs +5 -5
  26. package/dist/esheet.js +2 -2
  27. package/dist/index.cjs +191 -186
  28. package/dist/index.cjs.map +1 -1
  29. package/dist/index.d.cts +1 -0
  30. package/dist/index.d.ts +1 -0
  31. package/dist/index.js +17 -16
  32. package/dist/index.js.map +1 -1
  33. package/dist/tailwind-preset.cjs +4 -4
  34. package/dist/tailwind-preset.js +1 -1
  35. package/package.json +1 -1
  36. package/dist/chunk-F4SIY7JS.js.map +0 -1
  37. package/dist/chunk-FC4EG7YP.cjs.map +0 -1
@@ -13,5 +13,5 @@ var brands = {
13
13
  };
14
14
 
15
15
  exports.brands = brands;
16
- //# sourceMappingURL=chunk-B57MGVGR.cjs.map
17
- //# sourceMappingURL=chunk-B57MGVGR.cjs.map
16
+ //# sourceMappingURL=chunk-JDHIBJ5K.cjs.map
17
+ //# sourceMappingURL=chunk-JDHIBJ5K.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/brands/index.ts"],"names":[],"mappings":";;;AAkCO,IAAM,MAAA,GAAS;AAAA,EACpB,QAAA,EAAU,MAAM,OAAO,uBAAY,EAAE,IAAA,CAAK,CAAC,CAAA,KAAM,CAAA,CAAE,aAAa,CAAA;AAAA,EAChE,IAAA,EAAM,MAAM,OAAO,mBAAQ,EAAE,IAAA,CAAK,CAAC,CAAA,KAAM,CAAA,CAAE,SAAS,CAAA;AAAA,EACpD,OAAA,EAAS,MAAM,OAAO,wBAAW,EAAE,IAAA,CAAK,CAAC,CAAA,KAAM,CAAA,CAAE,YAAY,CAAA;AAAA,EAC7D,mBAAA,EAAqB,MACnB,OAAO,kCAAqB,EAAE,IAAA,CAAK,CAAC,CAAA,KAAM,CAAA,CAAE,qBAAqB,CAAA;AAAA,EACnE,MAAA,EAAQ,MAAM,OAAO,uBAAU,EAAE,IAAA,CAAK,CAAC,CAAA,KAAM,CAAA,CAAE,WAAW,CAAA;AAAA,EAC1D,MAAA,EAAQ,MAAM,OAAO,qBAAU,EAAE,IAAA,CAAK,CAAC,CAAA,KAAM,CAAA,CAAE,WAAW,CAAA;AAAA,EAC1D,UAAA,EAAY,MAAM,OAAO,2BAAc,EAAE,IAAA,CAAK,CAAC,CAAA,KAAM,CAAA,CAAE,eAAe,CAAA;AAAA,EACtE,QAAA,EAAU,MAAM,OAAO,yBAAY,EAAE,IAAA,CAAK,CAAC,CAAA,KAAM,CAAA,CAAE,aAAa;AAClE","file":"chunk-B57MGVGR.cjs","sourcesContent":["/**\n * @mieweb/ui Brand System\n *\n * Export all brand-related types, utilities, and configurations.\n */\n\n// Types and utilities\nexport type {\n BrandConfig,\n BrandColors,\n BrandTypography,\n BrandBorderRadius,\n BrandBoxShadow,\n ColorScale,\n SemanticColors,\n} from './types';\n\nexport {\n generateBrandCSS,\n generateTailwindTheme,\n createBrandPreset,\n} from './types';\n\n// Brand configurations\nexport { bluehiveBrand } from './bluehive';\nexport { ccmeBrand } from './ccme';\nexport { defaultBrand } from './default';\nexport { enterpriseHealthBrand } from './enterprise-health';\nexport { miewebBrand } from './mieweb';\nexport { ozwellBrand } from './ozwell';\nexport { wagglelineBrand } from './waggleline';\nexport { webchartBrand } from './webchart';\n\n// All brands for iteration\nexport const brands = {\n bluehive: () => import('./bluehive').then((m) => m.bluehiveBrand),\n ccme: () => import('./ccme').then((m) => m.ccmeBrand),\n default: () => import('./default').then((m) => m.defaultBrand),\n 'enterprise-health': () =>\n import('./enterprise-health').then((m) => m.enterpriseHealthBrand),\n mieweb: () => import('./mieweb').then((m) => m.miewebBrand),\n ozwell: () => import('./ozwell').then((m) => m.ozwellBrand),\n waggleline: () => import('./waggleline').then((m) => m.wagglelineBrand),\n webchart: () => import('./webchart').then((m) => m.webchartBrand),\n} as const;\n"]}
1
+ {"version":3,"sources":["../src/brands/index.ts"],"names":[],"mappings":";;;AAkCO,IAAM,MAAA,GAAS;AAAA,EACpB,QAAA,EAAU,MAAM,OAAO,uBAAY,EAAE,IAAA,CAAK,CAAC,CAAA,KAAM,CAAA,CAAE,aAAa,CAAA;AAAA,EAChE,IAAA,EAAM,MAAM,OAAO,mBAAQ,EAAE,IAAA,CAAK,CAAC,CAAA,KAAM,CAAA,CAAE,SAAS,CAAA;AAAA,EACpD,OAAA,EAAS,MAAM,OAAO,wBAAW,EAAE,IAAA,CAAK,CAAC,CAAA,KAAM,CAAA,CAAE,YAAY,CAAA;AAAA,EAC7D,mBAAA,EAAqB,MACnB,OAAO,kCAAqB,EAAE,IAAA,CAAK,CAAC,CAAA,KAAM,CAAA,CAAE,qBAAqB,CAAA;AAAA,EACnE,MAAA,EAAQ,MAAM,OAAO,uBAAU,EAAE,IAAA,CAAK,CAAC,CAAA,KAAM,CAAA,CAAE,WAAW,CAAA;AAAA,EAC1D,MAAA,EAAQ,MAAM,OAAO,qBAAU,EAAE,IAAA,CAAK,CAAC,CAAA,KAAM,CAAA,CAAE,WAAW,CAAA;AAAA,EAC1D,UAAA,EAAY,MAAM,OAAO,2BAAc,EAAE,IAAA,CAAK,CAAC,CAAA,KAAM,CAAA,CAAE,eAAe,CAAA;AAAA,EACtE,QAAA,EAAU,MAAM,OAAO,yBAAY,EAAE,IAAA,CAAK,CAAC,CAAA,KAAM,CAAA,CAAE,aAAa;AAClE","file":"chunk-JDHIBJ5K.cjs","sourcesContent":["/**\n * @mieweb/ui Brand System\n *\n * Export all brand-related types, utilities, and configurations.\n */\n\n// Types and utilities\nexport type {\n BrandConfig,\n BrandColors,\n BrandTypography,\n BrandBorderRadius,\n BrandBoxShadow,\n ColorScale,\n SemanticColors,\n} from './types';\n\nexport {\n generateBrandCSS,\n generateTailwindTheme,\n createBrandPreset,\n} from './types';\n\n// Brand configurations\nexport { bluehiveBrand } from './bluehive';\nexport { ccmeBrand } from './ccme';\nexport { defaultBrand } from './default';\nexport { enterpriseHealthBrand } from './enterprise-health';\nexport { miewebBrand } from './mieweb';\nexport { ozwellBrand } from './ozwell';\nexport { wagglelineBrand } from './waggleline';\nexport { webchartBrand } from './webchart';\n\n// All brands for iteration\nexport const brands = {\n bluehive: () => import('./bluehive').then((m) => m.bluehiveBrand),\n ccme: () => import('./ccme').then((m) => m.ccmeBrand),\n default: () => import('./default').then((m) => m.defaultBrand),\n 'enterprise-health': () =>\n import('./enterprise-health').then((m) => m.enterpriseHealthBrand),\n mieweb: () => import('./mieweb').then((m) => m.miewebBrand),\n ozwell: () => import('./ozwell').then((m) => m.ozwellBrand),\n waggleline: () => import('./waggleline').then((m) => m.wagglelineBrand),\n webchart: () => import('./webchart').then((m) => m.webchartBrand),\n} as const;\n"]}
@@ -11,5 +11,5 @@ var brands = {
11
11
  };
12
12
 
13
13
  export { brands };
14
- //# sourceMappingURL=chunk-TPGX25WD.js.map
15
- //# sourceMappingURL=chunk-TPGX25WD.js.map
14
+ //# sourceMappingURL=chunk-MO65V64I.js.map
15
+ //# sourceMappingURL=chunk-MO65V64I.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/brands/index.ts"],"names":[],"mappings":";AAkCO,IAAM,MAAA,GAAS;AAAA,EACpB,QAAA,EAAU,MAAM,OAAO,sBAAY,EAAE,IAAA,CAAK,CAAC,CAAA,KAAM,CAAA,CAAE,aAAa,CAAA;AAAA,EAChE,IAAA,EAAM,MAAM,OAAO,kBAAQ,EAAE,IAAA,CAAK,CAAC,CAAA,KAAM,CAAA,CAAE,SAAS,CAAA;AAAA,EACpD,OAAA,EAAS,MAAM,OAAO,uBAAW,EAAE,IAAA,CAAK,CAAC,CAAA,KAAM,CAAA,CAAE,YAAY,CAAA;AAAA,EAC7D,mBAAA,EAAqB,MACnB,OAAO,iCAAqB,EAAE,IAAA,CAAK,CAAC,CAAA,KAAM,CAAA,CAAE,qBAAqB,CAAA;AAAA,EACnE,MAAA,EAAQ,MAAM,OAAO,sBAAU,EAAE,IAAA,CAAK,CAAC,CAAA,KAAM,CAAA,CAAE,WAAW,CAAA;AAAA,EAC1D,MAAA,EAAQ,MAAM,OAAO,oBAAU,EAAE,IAAA,CAAK,CAAC,CAAA,KAAM,CAAA,CAAE,WAAW,CAAA;AAAA,EAC1D,UAAA,EAAY,MAAM,OAAO,0BAAc,EAAE,IAAA,CAAK,CAAC,CAAA,KAAM,CAAA,CAAE,eAAe,CAAA;AAAA,EACtE,QAAA,EAAU,MAAM,OAAO,wBAAY,EAAE,IAAA,CAAK,CAAC,CAAA,KAAM,CAAA,CAAE,aAAa;AAClE","file":"chunk-TPGX25WD.js","sourcesContent":["/**\n * @mieweb/ui Brand System\n *\n * Export all brand-related types, utilities, and configurations.\n */\n\n// Types and utilities\nexport type {\n BrandConfig,\n BrandColors,\n BrandTypography,\n BrandBorderRadius,\n BrandBoxShadow,\n ColorScale,\n SemanticColors,\n} from './types';\n\nexport {\n generateBrandCSS,\n generateTailwindTheme,\n createBrandPreset,\n} from './types';\n\n// Brand configurations\nexport { bluehiveBrand } from './bluehive';\nexport { ccmeBrand } from './ccme';\nexport { defaultBrand } from './default';\nexport { enterpriseHealthBrand } from './enterprise-health';\nexport { miewebBrand } from './mieweb';\nexport { ozwellBrand } from './ozwell';\nexport { wagglelineBrand } from './waggleline';\nexport { webchartBrand } from './webchart';\n\n// All brands for iteration\nexport const brands = {\n bluehive: () => import('./bluehive').then((m) => m.bluehiveBrand),\n ccme: () => import('./ccme').then((m) => m.ccmeBrand),\n default: () => import('./default').then((m) => m.defaultBrand),\n 'enterprise-health': () =>\n import('./enterprise-health').then((m) => m.enterpriseHealthBrand),\n mieweb: () => import('./mieweb').then((m) => m.miewebBrand),\n ozwell: () => import('./ozwell').then((m) => m.ozwellBrand),\n waggleline: () => import('./waggleline').then((m) => m.wagglelineBrand),\n webchart: () => import('./webchart').then((m) => m.webchartBrand),\n} as const;\n"]}
1
+ {"version":3,"sources":["../src/brands/index.ts"],"names":[],"mappings":";AAkCO,IAAM,MAAA,GAAS;AAAA,EACpB,QAAA,EAAU,MAAM,OAAO,sBAAY,EAAE,IAAA,CAAK,CAAC,CAAA,KAAM,CAAA,CAAE,aAAa,CAAA;AAAA,EAChE,IAAA,EAAM,MAAM,OAAO,kBAAQ,EAAE,IAAA,CAAK,CAAC,CAAA,KAAM,CAAA,CAAE,SAAS,CAAA;AAAA,EACpD,OAAA,EAAS,MAAM,OAAO,uBAAW,EAAE,IAAA,CAAK,CAAC,CAAA,KAAM,CAAA,CAAE,YAAY,CAAA;AAAA,EAC7D,mBAAA,EAAqB,MACnB,OAAO,iCAAqB,EAAE,IAAA,CAAK,CAAC,CAAA,KAAM,CAAA,CAAE,qBAAqB,CAAA;AAAA,EACnE,MAAA,EAAQ,MAAM,OAAO,sBAAU,EAAE,IAAA,CAAK,CAAC,CAAA,KAAM,CAAA,CAAE,WAAW,CAAA;AAAA,EAC1D,MAAA,EAAQ,MAAM,OAAO,oBAAU,EAAE,IAAA,CAAK,CAAC,CAAA,KAAM,CAAA,CAAE,WAAW,CAAA;AAAA,EAC1D,UAAA,EAAY,MAAM,OAAO,0BAAc,EAAE,IAAA,CAAK,CAAC,CAAA,KAAM,CAAA,CAAE,eAAe,CAAA;AAAA,EACtE,QAAA,EAAU,MAAM,OAAO,wBAAY,EAAE,IAAA,CAAK,CAAC,CAAA,KAAM,CAAA,CAAE,aAAa;AAClE","file":"chunk-MO65V64I.js","sourcesContent":["/**\n * @mieweb/ui Brand System\n *\n * Export all brand-related types, utilities, and configurations.\n */\n\n// Types and utilities\nexport type {\n BrandConfig,\n BrandColors,\n BrandTypography,\n BrandBorderRadius,\n BrandBoxShadow,\n ColorScale,\n SemanticColors,\n} from './types';\n\nexport {\n generateBrandCSS,\n generateTailwindTheme,\n createBrandPreset,\n} from './types';\n\n// Brand configurations\nexport { bluehiveBrand } from './bluehive';\nexport { ccmeBrand } from './ccme';\nexport { defaultBrand } from './default';\nexport { enterpriseHealthBrand } from './enterprise-health';\nexport { miewebBrand } from './mieweb';\nexport { ozwellBrand } from './ozwell';\nexport { wagglelineBrand } from './waggleline';\nexport { webchartBrand } from './webchart';\n\n// All brands for iteration\nexport const brands = {\n bluehive: () => import('./bluehive').then((m) => m.bluehiveBrand),\n ccme: () => import('./ccme').then((m) => m.ccmeBrand),\n default: () => import('./default').then((m) => m.defaultBrand),\n 'enterprise-health': () =>\n import('./enterprise-health').then((m) => m.enterpriseHealthBrand),\n mieweb: () => import('./mieweb').then((m) => m.miewebBrand),\n ozwell: () => import('./ozwell').then((m) => m.ozwellBrand),\n waggleline: () => import('./waggleline').then((m) => m.wagglelineBrand),\n webchart: () => import('./webchart').then((m) => m.webchartBrand),\n} as const;\n"]}
@@ -0,0 +1,84 @@
1
+ 'use strict';
2
+
3
+ var chunkS5RVSXDV_cjs = require('./chunk-S5RVSXDV.cjs');
4
+ var React = require('react');
5
+ var lucideReact = require('lucide-react');
6
+ var jsxRuntime = require('react/jsx-runtime');
7
+
8
+ function _interopNamespace(e) {
9
+ if (e && e.__esModule) return e;
10
+ var n = Object.create(null);
11
+ if (e) {
12
+ Object.keys(e).forEach(function (k) {
13
+ if (k !== 'default') {
14
+ var d = Object.getOwnPropertyDescriptor(e, k);
15
+ Object.defineProperty(n, k, d.get ? d : {
16
+ enumerable: true,
17
+ get: function () { return e[k]; }
18
+ });
19
+ }
20
+ });
21
+ }
22
+ n.default = e;
23
+ return Object.freeze(n);
24
+ }
25
+
26
+ var React__namespace = /*#__PURE__*/_interopNamespace(React);
27
+
28
+ var CopyButton = React__namespace.forwardRef(
29
+ function CopyButton2({
30
+ value,
31
+ label = "Copy",
32
+ copiedLabel = "Copied",
33
+ timeout = 1200,
34
+ onCopied,
35
+ className,
36
+ onClick,
37
+ ...props
38
+ }, ref) {
39
+ const [copied, setCopied] = React__namespace.useState(false);
40
+ const timer = React__namespace.useRef(null);
41
+ React__namespace.useEffect(
42
+ () => () => {
43
+ if (timer.current) clearTimeout(timer.current);
44
+ },
45
+ []
46
+ );
47
+ const handleClick = async (e) => {
48
+ e.stopPropagation();
49
+ e.preventDefault();
50
+ onClick?.(e);
51
+ try {
52
+ await navigator.clipboard.writeText(value);
53
+ setCopied(true);
54
+ onCopied?.(value);
55
+ if (timer.current) clearTimeout(timer.current);
56
+ timer.current = setTimeout(() => setCopied(false), timeout);
57
+ } catch {
58
+ }
59
+ };
60
+ return /* @__PURE__ */ jsxRuntime.jsx(
61
+ "button",
62
+ {
63
+ ref,
64
+ type: "button",
65
+ onClick: handleClick,
66
+ title: copied ? copiedLabel : label,
67
+ "aria-label": copied ? copiedLabel : label,
68
+ className: chunkS5RVSXDV_cjs.cn(
69
+ "inline-flex shrink-0 items-center justify-center rounded p-1 transition-colors",
70
+ "focus-visible:ring-ring focus-visible:ring-2 focus-visible:outline-none",
71
+ copied ? "text-success" : "text-muted-foreground hover:bg-muted hover:text-foreground",
72
+ className
73
+ ),
74
+ ...props,
75
+ children: copied ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Check, { "aria-hidden": "true", className: "h-3.5 w-3.5" }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Copy, { "aria-hidden": "true", className: "h-3.5 w-3.5" })
76
+ }
77
+ );
78
+ }
79
+ );
80
+ CopyButton.displayName = "CopyButton";
81
+
82
+ exports.CopyButton = CopyButton;
83
+ //# sourceMappingURL=chunk-NGSDBWKA.cjs.map
84
+ //# sourceMappingURL=chunk-NGSDBWKA.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/CopyButton/CopyButton.tsx"],"names":["React","CopyButton","jsx","cn","Check","Copy"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCO,IAAM,UAAA,GAAmBA,gBAAA,CAAA,UAAA;AAAA,EAC9B,SAASC,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,GAAUD,0BAAS,KAAK,CAAA;AAChD,IAAA,MAAM,KAAA,GAAcA,wBAA6C,IAAI,CAAA;AAErE,IAAMA,gBAAA,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,uBACEE,cAAA;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,EAAWC,oBAAA;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,mBACCD,cAAA,CAACE,iBAAA,EAAA,EAAM,aAAA,EAAY,MAAA,EAAO,SAAA,EAAU,aAAA,EAAc,CAAA,mBAElDF,cAAA,CAACG,gBAAA,EAAA,EAAK,aAAA,EAAY,MAAA,EAAO,WAAU,aAAA,EAAc;AAAA;AAAA,KAErD;AAAA,EAEJ;AACF;AAEA,UAAA,CAAW,WAAA,GAAc,YAAA","file":"chunk-NGSDBWKA.cjs","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"]}
@@ -3,9 +3,9 @@
3
3
  var chunkBSDBI6H7_cjs = require('./chunk-BSDBI6H7.cjs');
4
4
  var chunkWWJIW2IH_cjs = require('./chunk-WWJIW2IH.cjs');
5
5
  var chunkG7EQ3JPX_cjs = require('./chunk-G7EQ3JPX.cjs');
6
+ var chunkAIJAFPGJ_cjs = require('./chunk-AIJAFPGJ.cjs');
6
7
  var chunk56QJHQ5C_cjs = require('./chunk-56QJHQ5C.cjs');
7
8
  var chunkU5TTXN45_cjs = require('./chunk-U5TTXN45.cjs');
8
- var chunkAIJAFPGJ_cjs = require('./chunk-AIJAFPGJ.cjs');
9
9
  var chunkMJWFNV3L_cjs = require('./chunk-MJWFNV3L.cjs');
10
10
  var chunkP2VTQ5AR_cjs = require('./chunk-P2VTQ5AR.cjs');
11
11
  var chunkZ5S5JEJD_cjs = require('./chunk-Z5S5JEJD.cjs');
@@ -1602,5 +1602,5 @@ exports.parseMedicationLabel = parseMedicationLabel;
1602
1602
  exports.parseSig = parseSig;
1603
1603
  exports.toolbarKeyNav = toolbarKeyNav;
1604
1604
  exports.useCodeLookupConfig = useCodeLookupConfig;
1605
- //# sourceMappingURL=chunk-WALAUOQB.cjs.map
1606
- //# sourceMappingURL=chunk-WALAUOQB.cjs.map
1605
+ //# sourceMappingURL=chunk-SK7H3Z67.cjs.map
1606
+ //# sourceMappingURL=chunk-SK7H3Z67.cjs.map