@solibo/solibo-ui 2.0.2 → 2.1.0

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 (150) hide show
  1. package/dist/assets/index.css +1 -1
  2. package/dist/assets/index13.css +1 -1
  3. package/dist/assets/index16.css +1 -1
  4. package/dist/assets/index18.css +1 -1
  5. package/dist/assets/index19.css +1 -1
  6. package/dist/assets/index2.css +1 -1
  7. package/dist/assets/index21.css +1 -1
  8. package/dist/assets/index28.css +1 -1
  9. package/dist/assets/index35.css +1 -1
  10. package/dist/assets/index36.css +1 -1
  11. package/dist/assets/index37.css +1 -1
  12. package/dist/assets/index38.css +1 -1
  13. package/dist/assets/index39.css +1 -1
  14. package/dist/assets/index40.css +1 -1
  15. package/dist/assets/index41.css +1 -1
  16. package/dist/assets/index42.css +1 -1
  17. package/dist/assets/index43.css +1 -1
  18. package/dist/assets/index44.css +1 -1
  19. package/dist/assets/index45.css +1 -1
  20. package/dist/assets/index46.css +1 -1
  21. package/dist/assets/index47.css +1 -1
  22. package/dist/assets/index48.css +1 -1
  23. package/dist/assets/index49.css +1 -1
  24. package/dist/assets/index50.css +1 -1
  25. package/dist/assets/index51.css +1 -1
  26. package/dist/assets/index52.css +1 -1
  27. package/dist/assets/index53.css +1 -1
  28. package/dist/assets/index54.css +1 -1
  29. package/dist/assets/index55.css +1 -0
  30. package/dist/assets/index6.css +1 -1
  31. package/dist/components/badge/index.cjs +1 -1
  32. package/dist/components/badge/index.js +38 -38
  33. package/dist/components/checkbox/index.cjs +1 -1
  34. package/dist/components/checkbox/index.js +1 -1
  35. package/dist/components/clipboard/index.cjs +2 -0
  36. package/dist/components/clipboard/index.cjs.map +1 -0
  37. package/dist/components/clipboard/index.js +29 -0
  38. package/dist/components/clipboard/index.js.map +1 -0
  39. package/dist/components/collapsible/index.cjs +1 -1
  40. package/dist/components/collapsible/index.js +1 -1
  41. package/dist/components/controls/index.cjs +1 -1
  42. package/dist/components/controls/index.js +2 -2
  43. package/dist/components/croppable/index.cjs +1 -1
  44. package/dist/components/croppable/index.js +1 -1
  45. package/dist/components/dialog/index.cjs +1 -1
  46. package/dist/components/dialog/index.js +35 -35
  47. package/dist/components/divider/index.cjs +1 -1
  48. package/dist/components/divider/index.js +3 -3
  49. package/dist/components/dropdown/index.cjs +1 -1
  50. package/dist/components/dropdown/index.js +4 -4
  51. package/dist/components/dropzone/index.cjs +1 -1
  52. package/dist/components/dropzone/index.js +1 -1
  53. package/dist/components/editor/index.cjs +1 -1
  54. package/dist/components/editor/index.js +2 -2
  55. package/dist/components/empty-state/index.cjs +1 -1
  56. package/dist/components/empty-state/index.cjs.map +1 -1
  57. package/dist/components/empty-state/index.js +16 -11
  58. package/dist/components/empty-state/index.js.map +1 -1
  59. package/dist/components/fieldset/index.cjs +1 -1
  60. package/dist/components/fieldset/index.js +1 -1
  61. package/dist/components/figure/index.cjs +1 -1
  62. package/dist/components/figure/index.js +1 -1
  63. package/dist/components/file/index.cjs +1 -1
  64. package/dist/components/file/index.js +1 -1
  65. package/dist/components/graph/index.cjs +1 -1
  66. package/dist/components/graph/index.js +26 -26
  67. package/dist/components/group/index.cjs +1 -1
  68. package/dist/components/group/index.js +3 -3
  69. package/dist/components/header/index.cjs +1 -1
  70. package/dist/components/header/index.cjs.map +1 -1
  71. package/dist/components/header/index.js +22 -22
  72. package/dist/components/icon/index.cjs +1 -1
  73. package/dist/components/icon/index.cjs.map +1 -1
  74. package/dist/components/icon/index.js +28 -26
  75. package/dist/components/icon/index.js.map +1 -1
  76. package/dist/components/iframe/index.cjs +1 -1
  77. package/dist/components/iframe/index.cjs.map +1 -1
  78. package/dist/components/iframe/index.js +45 -44
  79. package/dist/components/iframe/index.js.map +1 -1
  80. package/dist/components/input/index.cjs +1 -1
  81. package/dist/components/input/index.js +2 -2
  82. package/dist/components/link/index.cjs +1 -1
  83. package/dist/components/link/index.js +1 -1
  84. package/dist/components/list/index.cjs +1 -1
  85. package/dist/components/list/index.cjs.map +1 -1
  86. package/dist/components/list/index.js +72 -44
  87. package/dist/components/list/index.js.map +1 -1
  88. package/dist/components/loading/index.cjs +1 -1
  89. package/dist/components/loading/index.js +1 -1
  90. package/dist/components/menu/index.cjs +1 -1
  91. package/dist/components/menu/index.cjs.map +1 -1
  92. package/dist/components/menu/index.js +23 -22
  93. package/dist/components/menu/index.js.map +1 -1
  94. package/dist/components/message/index.cjs +1 -1
  95. package/dist/components/message/index.cjs.map +1 -1
  96. package/dist/components/message/index.js +33 -33
  97. package/dist/components/message/index.js.map +1 -1
  98. package/dist/components/nav/index.cjs +1 -1
  99. package/dist/components/nav/index.js +30 -30
  100. package/dist/components/popover/index.cjs +1 -1
  101. package/dist/components/popover/index.cjs.map +1 -1
  102. package/dist/components/popover/index.js +81 -69
  103. package/dist/components/popover/index.js.map +1 -1
  104. package/dist/components/search/index.cjs +1 -1
  105. package/dist/components/search/index.js +1 -1
  106. package/dist/components/select/index.cjs +1 -1
  107. package/dist/components/select/index.js +2 -2
  108. package/dist/components/sortable/index.cjs.map +1 -1
  109. package/dist/components/sortable/index.js.map +1 -1
  110. package/dist/components/table/index.cjs.map +1 -1
  111. package/dist/components/table/index.js.map +1 -1
  112. package/dist/components/textarea/index.cjs +1 -1
  113. package/dist/components/textarea/index.js +12 -12
  114. package/dist/components/toolbar/index.cjs +1 -1
  115. package/dist/components/toolbar/index.js +1 -1
  116. package/dist/components/widget/index.cjs +1 -1
  117. package/dist/components/widget/index.cjs.map +1 -1
  118. package/dist/components/widget/index.js +13 -8
  119. package/dist/components/widget/index.js.map +1 -1
  120. package/dist/icons-BTif0nDb.cjs +2 -0
  121. package/dist/icons-BTif0nDb.cjs.map +1 -0
  122. package/dist/{icons-dUP7sKyt.js → icons-CBbpxsJF.js} +32 -5
  123. package/dist/icons-CBbpxsJF.js.map +1 -0
  124. package/dist/{index-Bt7vnwji.cjs → index-5qUTKX7P.cjs} +2 -2
  125. package/dist/{index-Bt7vnwji.cjs.map → index-5qUTKX7P.cjs.map} +1 -1
  126. package/dist/{index-BLb3JiCr.js → index-BuSfz4qx.js} +3 -3
  127. package/dist/{index-BLb3JiCr.js.map → index-BuSfz4qx.js.map} +1 -1
  128. package/dist/index-CeHwRKAg.cjs +2 -0
  129. package/dist/{index-CQlMdqOp.cjs.map → index-CeHwRKAg.cjs.map} +1 -1
  130. package/dist/index-DBWgRXp9.js +83 -0
  131. package/dist/{index-CbJ2-IPc.js.map → index-DBWgRXp9.js.map} +1 -1
  132. package/dist/index.cjs +1 -1
  133. package/dist/index.d.ts +45 -7
  134. package/dist/index.js +97 -95
  135. package/dist/index.js.map +1 -1
  136. package/dist/menu-popover-CdhAgSQb.cjs +2 -0
  137. package/dist/menu-popover-CdhAgSQb.cjs.map +1 -0
  138. package/dist/menu-popover-D-Ax5zzy.js +77 -0
  139. package/dist/menu-popover-D-Ax5zzy.js.map +1 -0
  140. package/dist/tokens.json +1 -1
  141. package/package.json +1 -1
  142. package/dist/icons-Dv_p0bUF.cjs +0 -2
  143. package/dist/icons-Dv_p0bUF.cjs.map +0 -1
  144. package/dist/icons-dUP7sKyt.js.map +0 -1
  145. package/dist/index-CQlMdqOp.cjs +0 -2
  146. package/dist/index-CbJ2-IPc.js +0 -83
  147. package/dist/menu-popover-CM3v5s-5.cjs +0 -2
  148. package/dist/menu-popover-CM3v5s-5.cjs.map +0 -1
  149. package/dist/menu-popover-DOkciab5.js +0 -74
  150. package/dist/menu-popover-DOkciab5.js.map +0 -1
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index44.css');const s=require("react/jsx-runtime"),i=require("../../classix-5H4IWnMA.cjs"),l="_fieldset_f5vpp_1",d={fieldset:l},o=({className:e,...t})=>s.jsx("fieldset",{className:i.t(d.fieldset,e),...t,"data-component":"fieldset"});exports.Fieldset=o;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index45.css');const s=require("react/jsx-runtime"),i=require("../../classix-5H4IWnMA.cjs"),l="_fieldset_f5vpp_1",d={fieldset:l},o=({className:e,...t})=>s.jsx("fieldset",{className:i.t(d.fieldset,e),...t,"data-component":"fieldset"});exports.Fieldset=o;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1,6 +1,6 @@
1
1
  import { jsx as s } from "react/jsx-runtime";
2
2
  import { t as o } from "../../classix-DG18itHa.js";
3
- import '../../assets/index44.css';const f = "_fieldset_f5vpp_1", i = {
3
+ import '../../assets/index45.css';const f = "_fieldset_f5vpp_1", i = {
4
4
  fieldset: f
5
5
  }, m = ({
6
6
  className: e,
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index45.css');const r=require("react/jsx-runtime"),s=require("../../classix-5H4IWnMA.cjs"),n="_figure_spygr_1",u={figure:n},c=({accessibleLabel:e,children:t,className:i})=>r.jsxs("figure",{className:s.t(u.figure,i),"data-component":"figure",children:[t,e&&r.jsx("figcaption",{"data-content":"screen-reader",children:e})]});exports.Figure=c;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index46.css');const r=require("react/jsx-runtime"),s=require("../../classix-5H4IWnMA.cjs"),n="_figure_spygr_1",u={figure:n},c=({accessibleLabel:e,children:t,className:i})=>r.jsxs("figure",{className:s.t(u.figure,i),"data-component":"figure",children:[t,e&&r.jsx("figcaption",{"data-content":"screen-reader",children:e})]});exports.Figure=c;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1,6 +1,6 @@
1
1
  import { jsxs as i, jsx as o } from "react/jsx-runtime";
2
2
  import { t as n } from "../../classix-DG18itHa.js";
3
- import '../../assets/index45.css';const s = "_figure_spygr_1", f = {
3
+ import '../../assets/index46.css';const s = "_figure_spygr_1", f = {
4
4
  figure: s
5
5
  }, u = ({
6
6
  accessibleLabel: r,
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index46.css');const e=require("react/jsx-runtime"),j=require("../figure/index.cjs"),x=require("../icon/index.cjs"),f=require("../button/index.cjs"),N="_file_1uuq9_1",q="_action_1uuq9_14",F="_details_1uuq9_61",b="_name_1uuq9_68",g="_extension_1uuq9_80",I="_subtitle_1uuq9_90",t={file:N,action:q,delete:"_delete_1uuq9_15",details:F,"name-line":"_name-line_1uuq9_68",name:b,extension:g,subtitle:I},P={".doc":"FileDoc",".docx":"FileDoc",".pdf":"FilePdf",".ppt":"FilePpt",".pptx":"FilePpt",".xls":"FileXls",".xlsx":"FileXls"},y=({deleteAccessibleLabel:_,name:s,onClick:n,onDelete:a,ref:m,subtitle:r,url:u})=>{const i=s.lastIndexOf("."),d=i>0&&i<s.length-1,p=d?s.slice(0,i):s,c=d?s.slice(i):"",h=P[c.toLowerCase()]??"FileText",o=e.jsxs(e.Fragment,{children:[e.jsx(j.Figure,{children:e.jsx(x.Icon,{name:h})}),e.jsxs("span",{className:t.details,children:[e.jsxs("span",{className:t["name-line"],children:[e.jsx("span",{className:t.name,children:p}),c&&e.jsx("span",{className:t.extension,children:c})]}),r&&e.jsx("span",{className:t.subtitle,children:r})]})]});return e.jsxs("div",{className:t.file,ref:m,"data-component":"file",children:[u?e.jsx("a",{className:t.action,href:u,onClick:l=>{l.stopPropagation(),n&&(l.preventDefault(),n())},title:s,children:o}):n?e.jsx("button",{"aria-label":s,className:t.action,"data-actionable":"true",onClick:l=>{l.stopPropagation(),n()},title:s,type:"button",children:o}):e.jsx("div",{className:t.action,title:s,children:o}),a&&e.jsx(f.Button,{"aria-label":_??`Delete ${s}`,className:t.delete,onClick:()=>a(),variant:"tertiary",children:e.jsx(x.Icon,{name:"Trash",size:"small"})})]})};exports.File=y;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index47.css');const e=require("react/jsx-runtime"),j=require("../figure/index.cjs"),x=require("../icon/index.cjs"),f=require("../button/index.cjs"),N="_file_1uuq9_1",q="_action_1uuq9_14",F="_details_1uuq9_61",b="_name_1uuq9_68",g="_extension_1uuq9_80",I="_subtitle_1uuq9_90",t={file:N,action:q,delete:"_delete_1uuq9_15",details:F,"name-line":"_name-line_1uuq9_68",name:b,extension:g,subtitle:I},P={".doc":"FileDoc",".docx":"FileDoc",".pdf":"FilePdf",".ppt":"FilePpt",".pptx":"FilePpt",".xls":"FileXls",".xlsx":"FileXls"},y=({deleteAccessibleLabel:_,name:s,onClick:n,onDelete:a,ref:m,subtitle:r,url:u})=>{const i=s.lastIndexOf("."),d=i>0&&i<s.length-1,p=d?s.slice(0,i):s,c=d?s.slice(i):"",h=P[c.toLowerCase()]??"FileText",o=e.jsxs(e.Fragment,{children:[e.jsx(j.Figure,{children:e.jsx(x.Icon,{name:h})}),e.jsxs("span",{className:t.details,children:[e.jsxs("span",{className:t["name-line"],children:[e.jsx("span",{className:t.name,children:p}),c&&e.jsx("span",{className:t.extension,children:c})]}),r&&e.jsx("span",{className:t.subtitle,children:r})]})]});return e.jsxs("div",{className:t.file,ref:m,"data-component":"file",children:[u?e.jsx("a",{className:t.action,href:u,onClick:l=>{l.stopPropagation(),n&&(l.preventDefault(),n())},title:s,children:o}):n?e.jsx("button",{"aria-label":s,className:t.action,"data-actionable":"true",onClick:l=>{l.stopPropagation(),n()},title:s,type:"button",children:o}):e.jsx("div",{className:t.action,title:s,children:o}),a&&e.jsx(f.Button,{"aria-label":_??`Delete ${s}`,className:t.delete,onClick:()=>a(),variant:"tertiary",children:e.jsx(x.Icon,{name:"Trash",size:"small"})})]})};exports.File=y;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -2,7 +2,7 @@ import { jsxs as a, jsx as t, Fragment as N } from "react/jsx-runtime";
2
2
  import { Figure as F } from "../figure/index.js";
3
3
  import { Icon as p } from "../icon/index.js";
4
4
  import { Button as b } from "../button/index.js";
5
- import '../../assets/index46.css';const q = "_file_1uuq9_1", g = "_action_1uuq9_14", I = "_details_1uuq9_61", P = "_name_1uuq9_68", v = "_extension_1uuq9_80", y = "_subtitle_1uuq9_90", n = {
5
+ import '../../assets/index47.css';const q = "_file_1uuq9_1", g = "_action_1uuq9_14", I = "_details_1uuq9_61", P = "_name_1uuq9_68", v = "_extension_1uuq9_80", y = "_subtitle_1uuq9_90", n = {
6
6
  file: q,
7
7
  action: g,
8
8
  delete: "_delete_1uuq9_15",
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index21.css');const a=require("react/jsx-runtime"),x=require("../../classix-5H4IWnMA.cjs"),j=require("../loading/index.cjs"),w="_graph_1web1_11",v="_plot_1web1_20",N="_item_1web1_34",y="_column_1web1_40",f="_value_1web1_48",k="_track_1web1_58",M="_bar_1web1_65",V="_label_1web1_87",e={graph:w,plot:v,item:N,column:y,value:f,track:k,bar:M,label:V,"is-loading":"_is-loading_1web1_96"},i=l=>Number.isFinite(l)?Math.max(0,l):0,S=({accessibleLabel:l,className:h,height:r,items:n=[],style:u,valueFormatter:_=t=>t.toLocaleString(),...p})=>{const t=n.reduce((s,c)=>Math.max(s,i(c.value)),0),b={...u,"--graph-columns":Math.max(n.length,1),"--graph-height":r||"calc(var(--utils-tokens-unit) * 16)"};return a.jsxs("figure",{className:x.t(e.graph,h),style:b,...p,"data-component":"graph",children:[l&&a.jsx("figcaption",{"data-content":"screen-reader",children:l}),n.length>0?a.jsx("ul",{className:e.plot,children:n.map((s,c)=>{const o=i(s.value),d=t>0?o/t*100:0,m=o>0?Math.max(d,6):0,g={"--bar-color":s.color,"--bar-delay":c*50+"ms","--bar-height":m+"%"};return a.jsxs("li",{className:e.item,"data-component":"graph",children:[a.jsxs("div",{className:e.column,children:[a.jsx("span",{className:e.value,children:_(s.value)}),a.jsx("span",{className:e.track,children:a.jsx("span",{className:e.bar,style:g})})]}),a.jsx("span",{className:e.label,title:s.label,children:s.label})]},s.label+c)})}):a.jsx("div",{className:e["is-loading"],children:a.jsx(j.Loading,{})})]})};exports.Graph=S;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index21.css');const a=require("react/jsx-runtime"),b=require("../../classix-5H4IWnMA.cjs"),j=require("../loading/index.cjs"),q="_graph_plhqd_11",v="_plot_plhqd_20",N="_item_plhqd_34",y="_column_plhqd_40",f="_value_plhqd_48",k="_track_plhqd_58",M="_bar_plhqd_65",V="_label_plhqd_87",l={graph:q,plot:v,item:N,column:y,value:f,track:k,bar:M,label:V,"is-loading":"_is-loading_plhqd_96"},h=e=>Number.isFinite(e)?Math.max(0,e):0,S=({accessibleLabel:e,className:i,height:r,items:n=[],style:p,valueFormatter:d=t=>t.toLocaleString(),...u})=>{const t=n.reduce((s,c)=>Math.max(s,h(c.value)),0),_={...p,"--graph-columns":Math.max(n.length,1),"--graph-height":r||"calc(var(--utils-tokens-unit) * 16)"};return a.jsxs("figure",{className:b.t(l.graph,i),style:_,...u,"data-component":"graph",children:[e&&a.jsx("figcaption",{"data-content":"screen-reader",children:e}),n.length>0?a.jsx("ul",{className:l.plot,children:n.map((s,c)=>{const o=h(s.value),m=t>0?o/t*100:0,g=o>0?Math.max(m,6):0,x={"--bar-color":s.color,"--bar-delay":c*50+"ms","--bar-height":g+"%"};return a.jsxs("li",{className:l.item,"data-component":"graph",children:[a.jsxs("div",{className:l.column,children:[a.jsx("span",{className:l.value,children:d(s.value)}),a.jsx("span",{className:l.track,children:a.jsx("span",{className:l.bar,style:x})})]}),a.jsx("span",{className:l.label,title:s.label,children:s.label})]},s.label+c)})}):a.jsx("div",{className:l["is-loading"],children:a.jsx(j.Loading,{})})]})};exports.Graph=S;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1,49 +1,49 @@
1
- import { jsxs as s, jsx as l } from "react/jsx-runtime";
2
- import { t as N } from "../../classix-DG18itHa.js";
1
+ import { jsxs as s, jsx as t } from "react/jsx-runtime";
2
+ import { t as q } from "../../classix-DG18itHa.js";
3
3
  import { Loading as v } from "../loading/index.js";
4
- import '../../assets/index21.css';const f = "_graph_1web1_11", x = "_plot_1web1_20", k = "_item_1web1_34", V = "_column_1web1_40", y = "_value_1web1_48", M = "_track_1web1_58", j = "_bar_1web1_65", S = "_label_1web1_87", a = {
4
+ import '../../assets/index21.css';const f = "_graph_plhqd_11", x = "_plot_plhqd_20", k = "_item_plhqd_34", V = "_column_plhqd_40", y = "_value_plhqd_48", M = "_track_plhqd_58", w = "_bar_plhqd_65", j = "_label_plhqd_87", a = {
5
5
  graph: f,
6
6
  plot: x,
7
7
  item: k,
8
8
  column: V,
9
9
  value: y,
10
10
  track: M,
11
- bar: j,
12
- label: S,
13
- "is-loading": "_is-loading_1web1_96"
14
- }, h = (t) => Number.isFinite(t) ? Math.max(0, t) : 0, L = ({
15
- accessibleLabel: t,
16
- className: _,
11
+ bar: w,
12
+ label: j,
13
+ "is-loading": "_is-loading_plhqd_96"
14
+ }, p = (e) => Number.isFinite(e) ? Math.max(0, e) : 0, G = ({
15
+ accessibleLabel: e,
16
+ className: d,
17
17
  height: o,
18
18
  items: n = [],
19
- style: m,
20
- valueFormatter: p = (r) => r.toLocaleString(),
21
- ...b
19
+ style: i,
20
+ valueFormatter: _ = (r) => r.toLocaleString(),
21
+ ...m
22
22
  }) => {
23
- const r = n.reduce((e, c) => Math.max(e, h(c.value)), 0), u = {
24
- ...m,
23
+ const r = n.reduce((l, c) => Math.max(l, p(c.value)), 0), u = {
24
+ ...i,
25
25
  "--graph-columns": Math.max(n.length, 1),
26
26
  "--graph-height": o || "calc(var(--utils-tokens-unit) * 16)"
27
27
  };
28
- return /* @__PURE__ */ s("figure", { className: N(a.graph, _), style: u, ...b, "data-component": "graph", children: [
29
- t && /* @__PURE__ */ l("figcaption", { "data-content": "screen-reader", children: t }),
30
- n.length > 0 ? /* @__PURE__ */ l("ul", { className: a.plot, children: n.map((e, c) => {
31
- const i = h(e.value), d = r > 0 ? i / r * 100 : 0, g = i > 0 ? Math.max(d, 6) : 0, w = {
32
- "--bar-color": e.color,
28
+ return /* @__PURE__ */ s("figure", { className: q(a.graph, d), style: u, ...m, "data-component": "graph", children: [
29
+ e && /* @__PURE__ */ t("figcaption", { "data-content": "screen-reader", children: e }),
30
+ n.length > 0 ? /* @__PURE__ */ t("ul", { className: a.plot, children: n.map((l, c) => {
31
+ const h = p(l.value), g = r > 0 ? h / r * 100 : 0, b = h > 0 ? Math.max(g, 6) : 0, N = {
32
+ "--bar-color": l.color,
33
33
  "--bar-delay": c * 50 + "ms",
34
- "--bar-height": g + "%"
34
+ "--bar-height": b + "%"
35
35
  };
36
36
  return /* @__PURE__ */ s("li", { className: a.item, "data-component": "graph", children: [
37
37
  /* @__PURE__ */ s("div", { className: a.column, children: [
38
- /* @__PURE__ */ l("span", { className: a.value, children: p(e.value) }),
39
- /* @__PURE__ */ l("span", { className: a.track, children: /* @__PURE__ */ l("span", { className: a.bar, style: w }) })
38
+ /* @__PURE__ */ t("span", { className: a.value, children: _(l.value) }),
39
+ /* @__PURE__ */ t("span", { className: a.track, children: /* @__PURE__ */ t("span", { className: a.bar, style: N }) })
40
40
  ] }),
41
- /* @__PURE__ */ l("span", { className: a.label, title: e.label, children: e.label })
42
- ] }, e.label + c);
43
- }) }) : /* @__PURE__ */ l("div", { className: a["is-loading"], children: /* @__PURE__ */ l(v, {}) })
41
+ /* @__PURE__ */ t("span", { className: a.label, title: l.label, children: l.label })
42
+ ] }, l.label + c);
43
+ }) }) : /* @__PURE__ */ t("div", { className: a["is-loading"], children: /* @__PURE__ */ t(v, {}) })
44
44
  ] });
45
45
  };
46
46
  export {
47
- L as Graph
47
+ G as Graph
48
48
  };
49
49
  //# sourceMappingURL=index.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index20.css');const s=require("react/jsx-runtime"),u=require("../../classix-5H4IWnMA.cjs"),a="_group_1j6jh_1",n={group:a},p=({animation:t,children:r,className:o,...e})=>s.jsx("div",{className:u.t(o,n.group),"data-animation":t,"data-wrapper":!0,...e,"data-component":"group",children:r});exports.Group=p;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index20.css');const s=require("react/jsx-runtime"),u=require("../../classix-5H4IWnMA.cjs"),a="_group_8bgfi_1",n={group:a},i=({animation:t,children:r,className:o,...e})=>s.jsx("div",{className:u.t(o,n.group),"data-animation":t,"data-wrapper":!0,...e,"data-component":"group",children:r});exports.Group=i;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1,14 +1,14 @@
1
1
  import { jsx as a } from "react/jsx-runtime";
2
2
  import { t as n } from "../../classix-DG18itHa.js";
3
- import '../../assets/index20.css';const s = "_group_1j6jh_1", u = {
3
+ import '../../assets/index20.css';const s = "_group_8bgfi_1", u = {
4
4
  group: s
5
- }, c = ({
5
+ }, g = ({
6
6
  animation: o,
7
7
  children: r,
8
8
  className: t,
9
9
  ...p
10
10
  }) => /* @__PURE__ */ a("div", { className: n(t, u.group), "data-animation": o, "data-wrapper": !0, ...p, "data-component": "group", children: r });
11
11
  export {
12
- c as Group
12
+ g as Group
13
13
  };
14
14
  //# sourceMappingURL=index.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index19.css');const t=require("react/jsx-runtime"),u=require("../../classix-5H4IWnMA.cjs"),_="_header_grfw1_1",m="_controls_grfw1_68",j="_cta_grfw1_95",f="_jumbo_grfw1_145",e={header:_,controls:m,cta:j,"header-content":"_header-content_grfw1_107",jumbo:f},b={default:e.default,jumbo:e.jumbo},g=({backButton:n,capitalize:o=!1,children:d,controls:s,cta:a,header:l,subHeader:i,variant:h="default"})=>{const r=t.jsxs("div",{className:e["header-content"],children:[n,l,i]}),c=s?t.jsxs("div",{className:e.controls,children:[r,s]}):r;return t.jsxs("header",{className:u.t(e.header,b[h],o&&e.capitalize),"data-component":"header",children:[a?t.jsxs("div",{className:e.cta,children:[c,a]}):c,d]})};exports.Header=g;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index19.css');const t=require("react/jsx-runtime"),u=require("../../classix-5H4IWnMA.cjs"),_="_header_1p43o_1",m="_controls_1p43o_58",j="_cta_1p43o_85",p="_jumbo_1p43o_135",e={header:_,controls:m,cta:j,"header-content":"_header-content_1p43o_97",jumbo:p},b={default:e.default,jumbo:e.jumbo},x=({backButton:n,capitalize:r=!1,children:d,controls:s,cta:o,header:l,subHeader:i,variant:h="default"})=>{const a=t.jsxs("div",{className:e["header-content"],children:[n,l,i]}),c=s?t.jsxs("div",{className:e.controls,children:[a,s]}):a;return t.jsxs("header",{className:u.t(e.header,b[h],r&&e.capitalize),"data-component":"header",children:[o?t.jsxs("div",{className:e.cta,children:[c,o]}):c,d]})};exports.Header=x;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sources":["../../../src/components/header/index.tsx"],"sourcesContent":["import cx from 'classix';\n\nimport styles from './styles.module.css';\n\nconst variants = {\n default: styles.default,\n jumbo: styles.jumbo,\n};\n\nexport type HeaderProps = {\n backButton?: React.ReactNode;\n capitalize?: boolean;\n children?: React.ReactNode;\n controls?: React.ReactNode;\n cta?: React.ReactNode;\n header?: React.ReactNode;\n subHeader?: React.ReactNode;\n variant?: keyof typeof variants;\n};\n\nexport const Header = ({\n backButton,\n capitalize = false,\n children,\n controls,\n cta,\n header,\n subHeader,\n variant = 'default',\n}: HeaderProps) => {\n const headerElement = (\n <div className={styles['header-content']}>\n {backButton}\n {header}\n {subHeader}\n </div>\n );\n\n const headerWithControls = controls ? (\n <div className={styles.controls}>\n {headerElement}\n {controls}\n </div>\n ) : (\n headerElement\n );\n\n return (\n <header className={cx(styles.header, variants[variant], capitalize && styles.capitalize)}>\n {cta ? (\n <div className={styles.cta}>\n {headerWithControls}\n {cta}\n </div>\n ) : (\n headerWithControls\n )}\n {children}\n </header>\n );\n};\n"],"names":["variants","default","styles","jumbo","Header","backButton","capitalize","children","controls","cta","header","subHeader","variant","headerElement","jsxs","headerWithControls","cx"],"mappings":"kUAIMA,EAAW,CACfC,QAASC,EAAOD,QAChBE,MAAOD,EAAOC,KAChB,EAaaC,EAASA,CAAC,CACrBC,WAAAA,EACAC,WAAAA,EAAa,GACbC,SAAAA,EACAC,SAAAA,EACAC,IAAAA,EACAC,OAAAA,EACAC,UAAAA,EACAC,QAAAA,EAAU,SACC,IAAM,CACjB,MAAMC,EACJC,EAAAA,KAAC,MAAA,CAAI,UAAWZ,EAAO,gBAAgB,EACpCG,SAAAA,CAAAA,EACAK,EACAC,CAAAA,EACH,EAGII,EAAqBP,EACzBM,OAAC,MAAA,CAAI,UAAWZ,EAAOM,SACpBK,SAAAA,CAAAA,EACAL,CAAAA,CAAAA,CACH,EAEAK,EAGF,OACEC,EAAAA,KAAC,SAAA,CAAO,UAAWE,EAAAA,EAAGd,EAAOQ,OAAQV,EAASY,CAAO,EAAGN,GAAcJ,EAAOI,UAAU,EAAE,iBAAA,SACtFG,SAAAA,CAAAA,EACCK,EAAAA,KAAC,MAAA,CAAI,UAAWZ,EAAOO,IACpBM,SAAAA,CAAAA,EACAN,CAAAA,CAAAA,CACH,EAEAM,EAEDR,CAAAA,EACH,CAEJ"}
1
+ {"version":3,"file":"index.cjs","sources":["../../../src/components/header/index.tsx"],"sourcesContent":["import cx from 'classix';\n\nimport styles from './styles.module.css';\n\nconst variants = {\n default: styles.default,\n jumbo: styles.jumbo,\n};\n\nexport type HeaderProps = {\n backButton?: React.ReactNode;\n capitalize?: boolean;\n children?: React.ReactNode;\n controls?: React.ReactNode;\n cta?: React.ReactNode;\n header?: React.ReactNode;\n subHeader?: React.ReactNode;\n variant?: keyof typeof variants;\n};\n\nexport const Header = ({\n backButton,\n capitalize = false,\n children,\n controls,\n cta,\n header,\n subHeader,\n variant = 'default',\n}: HeaderProps) => {\n const headerElement = (\n <div className={styles['header-content']}>\n {backButton}\n {header}\n {subHeader}\n </div>\n );\n\n const headerWithControls = controls ? (\n <div className={styles.controls}>\n {headerElement}\n {controls}\n </div>\n ) : (\n headerElement\n );\n\n return (\n <header className={cx(styles.header, variants[variant], capitalize && styles.capitalize)}>\n {cta ? (\n <div className={styles.cta}>\n {headerWithControls}\n {cta}\n </div>\n ) : (\n headerWithControls\n )}\n {children}\n </header>\n );\n};\n"],"names":["variants","default","styles","jumbo","Header","backButton","capitalize","children","controls","cta","header","subHeader","variant","headerElement","jsxs","headerWithControls","cx"],"mappings":"iUAIMA,EAAW,CACfC,QAASC,EAAOD,QAChBE,MAAOD,EAAOC,KAChB,EAaaC,EAASA,CAAC,CACrBC,WAAAA,EACAC,WAAAA,EAAa,GACbC,SAAAA,EACAC,SAAAA,EACAC,IAAAA,EACAC,OAAAA,EACAC,UAAAA,EACAC,QAAAA,EAAU,SACC,IAAM,CACjB,MAAMC,EACJC,EAAAA,KAAC,MAAA,CAAI,UAAWZ,EAAO,gBAAgB,EACpCG,SAAAA,CAAAA,EACAK,EACAC,CAAAA,EACH,EAGII,EAAqBP,EACzBM,OAAC,MAAA,CAAI,UAAWZ,EAAOM,SACpBK,SAAAA,CAAAA,EACAL,CAAAA,CAAAA,CACH,EAEAK,EAGF,OACEC,EAAAA,KAAC,SAAA,CAAO,UAAWE,EAAAA,EAAGd,EAAOQ,OAAQV,EAASY,CAAO,EAAGN,GAAcJ,EAAOI,UAAU,EAAE,iBAAA,SACtFG,SAAAA,CAAAA,EACCK,EAAAA,KAAC,MAAA,CAAI,UAAWZ,EAAOO,IACpBM,SAAAA,CAAAA,EACAN,CAAAA,CAAAA,CACH,EAEAM,EAEDR,CAAAA,EACH,CAEJ"}
@@ -1,41 +1,41 @@
1
- import { jsxs as t } from "react/jsx-runtime";
1
+ import { jsxs as o } from "react/jsx-runtime";
2
2
  import { t as _ } from "../../classix-DG18itHa.js";
3
- import '../../assets/index19.css';const i = "_header_grfw1_1", f = "_controls_grfw1_68", u = "_cta_grfw1_95", j = "_jumbo_grfw1_145", e = {
3
+ import '../../assets/index19.css';const i = "_header_1p43o_1", p = "_controls_1p43o_58", u = "_cta_1p43o_85", f = "_jumbo_1p43o_135", e = {
4
4
  header: i,
5
- controls: f,
5
+ controls: p,
6
6
  cta: u,
7
- "header-content": "_header-content_grfw1_107",
8
- jumbo: j
9
- }, b = {
7
+ "header-content": "_header-content_1p43o_97",
8
+ jumbo: f
9
+ }, j = {
10
10
  default: e.default,
11
11
  jumbo: e.jumbo
12
- }, w = ({
13
- backButton: n,
12
+ }, N = ({
13
+ backButton: r,
14
14
  capitalize: s = !1,
15
15
  children: d,
16
- controls: a,
17
- cta: r,
16
+ controls: t,
17
+ cta: a,
18
18
  header: l,
19
19
  subHeader: h,
20
20
  variant: m = "default"
21
21
  }) => {
22
- const o = /* @__PURE__ */ t("div", { className: e["header-content"], children: [
23
- n,
22
+ const c = /* @__PURE__ */ o("div", { className: e["header-content"], children: [
23
+ r,
24
24
  l,
25
25
  h
26
- ] }), c = a ? /* @__PURE__ */ t("div", { className: e.controls, children: [
27
- o,
28
- a
29
- ] }) : o;
30
- return /* @__PURE__ */ t("header", { className: _(e.header, b[m], s && e.capitalize), "data-component": "header", children: [
31
- r ? /* @__PURE__ */ t("div", { className: e.cta, children: [
32
- c,
33
- r
34
- ] }) : c,
26
+ ] }), n = t ? /* @__PURE__ */ o("div", { className: e.controls, children: [
27
+ c,
28
+ t
29
+ ] }) : c;
30
+ return /* @__PURE__ */ o("header", { className: _(e.header, j[m], s && e.capitalize), "data-component": "header", children: [
31
+ a ? /* @__PURE__ */ o("div", { className: e.cta, children: [
32
+ n,
33
+ a
34
+ ] }) : n,
35
35
  d
36
36
  ] });
37
37
  };
38
38
  export {
39
- w as Header
39
+ N as Header
40
40
  };
41
41
  //# sourceMappingURL=index.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index47.css');const i=require("react/jsx-runtime"),g=require("../../classix-5H4IWnMA.cjs"),r=require("../../icons-Dv_p0bUF.cjs"),l="_icon_1dkgk_1",d="_small_1dkgk_10",m="_medium_1dkgk_15",_="_large_1dkgk_20",k="_danger_1dkgk_25",e={icon:l,small:d,medium:m,large:_,danger:k,"gap-right":"_gap-right_1dkgk_29","gap-left":"_gap-left_1dkgk_33"},u={large:e.large,medium:e.medium,small:e.small},p={danger:e.danger},y=({gap:n="none",name:o,size:t="medium",variant:s,weight:a})=>{const c={maskImage:r.iconSVG(o,void 0,a)};return i.jsx("span",{"aria-hidden":"true",className:g.t(n!=="none"&&e[`gap-${n}`],u[t],e.icon,s&&p[s]),style:c,"data-component":"icon"})};exports.Icon=y;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index48.css');const c=require("react/jsx-runtime"),r=require("../../classix-5H4IWnMA.cjs"),l=require("../../icons-BTif0nDb.cjs"),_="_icon_23h6o_1",m="_large_23h6o_10",g="_medium_23h6o_15",d="_small_23h6o_20",u="_tiny_23h6o_25",h="_danger_23h6o_30",n={icon:_,large:m,medium:g,small:d,tiny:u,danger:h,"gap-right":"_gap-right_23h6o_34","gap-left":"_gap-left_23h6o_38"},y={large:n.large,medium:n.medium,small:n.small,tiny:n.tiny},p={danger:n.danger},S=({gap:e="none",name:t,size:s="medium",variant:o,weight:i})=>{const a={maskImage:l.iconSVG(t,void 0,i)};return c.jsx("span",{"aria-hidden":"true",className:r.t(e!=="none"&&n[`gap-${e}`],y[s],n.icon,o&&p[o]),style:a,"data-component":"icon"})};exports.Icon=S;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sources":["../../../src/components/icon/index.tsx"],"sourcesContent":["import cx from 'classix';\n\nimport { type IconName, iconSVG, type IconWeight } from './icons';\nimport styles from './styles.module.css';\n\nexport type { IconName, IconWeight } from './icons';\n\nconst sizes = {\n large: styles.large,\n medium: styles.medium,\n small: styles.small,\n};\n\nconst variants = {\n danger: styles.danger,\n};\n\nexport type IconProps = {\n gap?: 'left' | 'none' | 'right';\n name: IconName;\n size?: keyof typeof sizes;\n variant?: keyof typeof variants;\n weight?: IconWeight;\n};\n\nexport const Icon = ({ gap = 'none', name, size = 'medium', variant, weight }: IconProps) => {\n const iconStyle = {\n maskImage: iconSVG(name, undefined, weight),\n } as React.CSSProperties;\n\n return (\n <span\n aria-hidden='true'\n className={cx(\n gap !== 'none' && styles[`gap-${gap}`],\n sizes[size],\n styles.icon,\n variant && variants[variant]\n )}\n style={iconStyle}\n />\n );\n};\n"],"names":["sizes","large","styles","medium","small","variants","danger","Icon","gap","name","size","variant","weight","iconStyle","maskImage","iconSVG","undefined","jsx","cx","icon"],"mappings":"sZAOMA,EAAQ,CACZC,MAAOC,EAAOD,MACdE,OAAQD,EAAOC,OACfC,MAAOF,EAAOE,KAChB,EAEMC,EAAW,CACfC,OAAQJ,EAAOI,MACjB,EAUaC,EAAOA,CAAC,CAAEC,IAAAA,EAAM,OAAQC,KAAAA,EAAMC,KAAAA,EAAO,SAAUC,QAAAA,EAASC,OAAAA,CAAkB,IAAM,CAC3F,MAAMC,EAAY,CAChBC,UAAWC,EAAAA,QAAQN,EAAMO,OAAWJ,CAAM,CAAA,EAG5C,OACEK,EAAAA,IAAC,OAAA,CACC,cAAY,OACZ,UAAWC,IACTV,IAAQ,QAAUN,EAAO,OAAOM,CAAG,EAAE,EACrCR,EAAMU,CAAI,EACVR,EAAOiB,KACPR,GAAWN,EAASM,CAAO,CAC7B,EACA,MAAOE,EAAU,iBAAA,MAAA,CAAA,CAGvB"}
1
+ {"version":3,"file":"index.cjs","sources":["../../../src/components/icon/index.tsx"],"sourcesContent":["import cx from 'classix';\n\nimport { type IconName, iconSVG, type IconWeight } from './icons';\nimport styles from './styles.module.css';\n\nexport type { IconName, IconWeight } from './icons';\n\nconst sizes = {\n large: styles.large,\n medium: styles.medium,\n small: styles.small,\n tiny: styles.tiny,\n};\n\nconst variants = {\n danger: styles.danger,\n};\n\nexport type IconProps = {\n gap?: 'left' | 'none' | 'right';\n name: IconName;\n size?: keyof typeof sizes;\n variant?: keyof typeof variants;\n weight?: IconWeight;\n};\n\nexport const Icon = ({ gap = 'none', name, size = 'medium', variant, weight }: IconProps) => {\n const iconStyle = {\n maskImage: iconSVG(name, undefined, weight),\n } as React.CSSProperties;\n\n return (\n <span\n aria-hidden='true'\n className={cx(\n gap !== 'none' && styles[`gap-${gap}`],\n sizes[size],\n styles.icon,\n variant && variants[variant]\n )}\n style={iconStyle}\n />\n );\n};\n"],"names":["sizes","large","styles","medium","small","tiny","variants","danger","Icon","gap","name","size","variant","weight","iconStyle","maskImage","iconSVG","undefined","jsx","cx","icon"],"mappings":"gbAOMA,EAAQ,CACZC,MAAOC,EAAOD,MACdE,OAAQD,EAAOC,OACfC,MAAOF,EAAOE,MACdC,KAAMH,EAAOG,IACf,EAEMC,EAAW,CACfC,OAAQL,EAAOK,MACjB,EAUaC,EAAOA,CAAC,CAAEC,IAAAA,EAAM,OAAQC,KAAAA,EAAMC,KAAAA,EAAO,SAAUC,QAAAA,EAASC,OAAAA,CAAkB,IAAM,CAC3F,MAAMC,EAAY,CAChBC,UAAWC,EAAAA,QAAQN,EAAMO,OAAWJ,CAAM,CAAA,EAG5C,OACEK,EAAAA,IAAC,OAAA,CACC,cAAY,OACZ,UAAWC,IACTV,IAAQ,QAAUP,EAAO,OAAOO,CAAG,EAAE,EACrCT,EAAMW,CAAI,EACVT,EAAOkB,KACPR,GAAWN,EAASM,CAAO,CAC7B,EACA,MAAOE,EAAU,iBAAA,MAAA,CAAA,CAGvB"}
@@ -1,33 +1,35 @@
1
- import { jsx as g } from "react/jsx-runtime";
2
- import { t as i } from "../../classix-DG18itHa.js";
3
- import { i as r } from "../../icons-dUP7sKyt.js";
4
- import '../../assets/index47.css';const d = "_icon_1dkgk_1", l = "_small_1dkgk_10", _ = "_medium_1dkgk_15", c = "_large_1dkgk_20", k = "_danger_1dkgk_25", n = {
5
- icon: d,
6
- small: l,
7
- medium: _,
8
- large: c,
9
- danger: k,
10
- "gap-right": "_gap-right_1dkgk_29",
11
- "gap-left": "_gap-left_1dkgk_33"
12
- }, p = {
13
- large: n.large,
14
- medium: n.medium,
15
- small: n.small
1
+ import { jsx as m } from "react/jsx-runtime";
2
+ import { t as _ } from "../../classix-DG18itHa.js";
3
+ import { i as r } from "../../icons-CBbpxsJF.js";
4
+ import '../../assets/index48.css';const c = "_icon_23h6o_1", l = "_large_23h6o_10", g = "_medium_23h6o_15", d = "_small_23h6o_20", h = "_tiny_23h6o_25", p = "_danger_23h6o_30", o = {
5
+ icon: c,
6
+ large: l,
7
+ medium: g,
8
+ small: d,
9
+ tiny: h,
10
+ danger: p,
11
+ "gap-right": "_gap-right_23h6o_34",
12
+ "gap-left": "_gap-left_23h6o_38"
16
13
  }, u = {
17
- danger: n.danger
18
- }, x = ({
19
- gap: e = "none",
20
- name: a,
21
- size: m = "medium",
22
- variant: o,
23
- weight: s
14
+ large: o.large,
15
+ medium: o.medium,
16
+ small: o.small,
17
+ tiny: o.tiny
18
+ }, y = {
19
+ danger: o.danger
20
+ }, S = ({
21
+ gap: n = "none",
22
+ name: e,
23
+ size: a = "medium",
24
+ variant: t,
25
+ weight: i
24
26
  }) => {
25
- const t = {
26
- maskImage: r(a, void 0, s)
27
+ const s = {
28
+ maskImage: r(e, void 0, i)
27
29
  };
28
- return /* @__PURE__ */ g("span", { "aria-hidden": "true", className: i(e !== "none" && n[`gap-${e}`], p[m], n.icon, o && u[o]), style: t, "data-component": "icon" });
30
+ return /* @__PURE__ */ m("span", { "aria-hidden": "true", className: _(n !== "none" && o[`gap-${n}`], u[a], o.icon, t && y[t]), style: s, "data-component": "icon" });
29
31
  };
30
32
  export {
31
- x as Icon
33
+ S as Icon
32
34
  };
33
35
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/components/icon/index.tsx"],"sourcesContent":["import cx from 'classix';\n\nimport { type IconName, iconSVG, type IconWeight } from './icons';\nimport styles from './styles.module.css';\n\nexport type { IconName, IconWeight } from './icons';\n\nconst sizes = {\n large: styles.large,\n medium: styles.medium,\n small: styles.small,\n};\n\nconst variants = {\n danger: styles.danger,\n};\n\nexport type IconProps = {\n gap?: 'left' | 'none' | 'right';\n name: IconName;\n size?: keyof typeof sizes;\n variant?: keyof typeof variants;\n weight?: IconWeight;\n};\n\nexport const Icon = ({ gap = 'none', name, size = 'medium', variant, weight }: IconProps) => {\n const iconStyle = {\n maskImage: iconSVG(name, undefined, weight),\n } as React.CSSProperties;\n\n return (\n <span\n aria-hidden='true'\n className={cx(\n gap !== 'none' && styles[`gap-${gap}`],\n sizes[size],\n styles.icon,\n variant && variants[variant]\n )}\n style={iconStyle}\n />\n );\n};\n"],"names":["sizes","large","styles","medium","small","variants","danger","Icon","gap","name","size","variant","weight","iconStyle","maskImage","iconSVG","undefined","jsx","cx","icon"],"mappings":";;;;;;;;;;;GAOMA,IAAQ;AAAA,EACZC,OAAOC,EAAOD;AAAAA,EACdE,QAAQD,EAAOC;AAAAA,EACfC,OAAOF,EAAOE;AAChB,GAEMC,IAAW;AAAA,EACfC,QAAQJ,EAAOI;AACjB,GAUaC,IAAOA,CAAC;AAAA,EAAEC,KAAAA,IAAM;AAAA,EAAQC,MAAAA;AAAAA,EAAMC,MAAAA,IAAO;AAAA,EAAUC,SAAAA;AAAAA,EAASC,QAAAA;AAAkB,MAAM;AAC3F,QAAMC,IAAY;AAAA,IAChBC,WAAWC,EAAQN,GAAMO,QAAWJ,CAAM;AAAA,EAAA;AAG5C,SACE,gBAAAK,EAAC,QAAA,EACC,eAAY,QACZ,WAAWC,EACTV,MAAQ,UAAUN,EAAO,OAAOM,CAAG,EAAE,GACrCR,EAAMU,CAAI,GACVR,EAAOiB,MACPR,KAAWN,EAASM,CAAO,CAC7B,GACA,OAAOE,GAAU,kBAAA,OAAA,CAAA;AAGvB;"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/components/icon/index.tsx"],"sourcesContent":["import cx from 'classix';\n\nimport { type IconName, iconSVG, type IconWeight } from './icons';\nimport styles from './styles.module.css';\n\nexport type { IconName, IconWeight } from './icons';\n\nconst sizes = {\n large: styles.large,\n medium: styles.medium,\n small: styles.small,\n tiny: styles.tiny,\n};\n\nconst variants = {\n danger: styles.danger,\n};\n\nexport type IconProps = {\n gap?: 'left' | 'none' | 'right';\n name: IconName;\n size?: keyof typeof sizes;\n variant?: keyof typeof variants;\n weight?: IconWeight;\n};\n\nexport const Icon = ({ gap = 'none', name, size = 'medium', variant, weight }: IconProps) => {\n const iconStyle = {\n maskImage: iconSVG(name, undefined, weight),\n } as React.CSSProperties;\n\n return (\n <span\n aria-hidden='true'\n className={cx(\n gap !== 'none' && styles[`gap-${gap}`],\n sizes[size],\n styles.icon,\n variant && variants[variant]\n )}\n style={iconStyle}\n />\n );\n};\n"],"names":["sizes","large","styles","medium","small","tiny","variants","danger","Icon","gap","name","size","variant","weight","iconStyle","maskImage","iconSVG","undefined","jsx","cx","icon"],"mappings":";;;;;;;;;;;;GAOMA,IAAQ;AAAA,EACZC,OAAOC,EAAOD;AAAAA,EACdE,QAAQD,EAAOC;AAAAA,EACfC,OAAOF,EAAOE;AAAAA,EACdC,MAAMH,EAAOG;AACf,GAEMC,IAAW;AAAA,EACfC,QAAQL,EAAOK;AACjB,GAUaC,IAAOA,CAAC;AAAA,EAAEC,KAAAA,IAAM;AAAA,EAAQC,MAAAA;AAAAA,EAAMC,MAAAA,IAAO;AAAA,EAAUC,SAAAA;AAAAA,EAASC,QAAAA;AAAkB,MAAM;AAC3F,QAAMC,IAAY;AAAA,IAChBC,WAAWC,EAAQN,GAAMO,QAAWJ,CAAM;AAAA,EAAA;AAG5C,SACE,gBAAAK,EAAC,QAAA,EACC,eAAY,QACZ,WAAWC,EACTV,MAAQ,UAAUP,EAAO,OAAOO,CAAG,EAAE,GACrCT,EAAMW,CAAI,GACVT,EAAOkB,MACPR,KAAWN,EAASM,CAAO,CAC7B,GACA,OAAOE,GAAU,kBAAA,OAAA,CAAA;AAGvB;"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index18.css');const r=require("react/jsx-runtime"),S=require("../../classix-5H4IWnMA.cjs"),s=require("react"),A=require("../button/index.cjs"),N=require("../controls/index.cjs"),z=require("../dialog/index.cjs"),G=require("../header/index.cjs"),R="_wrapper_29z62_1",V="_toolbar_29z62_6",$="_iframe_29z62_12",a={wrapper:R,toolbar:V,iframe:$,"fullscreen-iframe":"_fullscreen-iframe_29z62_18"},d=120,L=12e3,X=8,J=({accessibleLabel:f,autoResize:l=!1,className:v,closeFullscreenLabel:F="Close fullscreen",fullscreenLabel:I="View in fullscreen",hasFullscreenView:O=!0,loading:b="lazy",onLoad:h,referrerPolicy:H="no-referrer",sandbox:y="",srcDoc:w,style:E,...j})=>{const _=s.useRef(null),c=s.useRef(null),i=s.useRef(null),[k,M]=s.useState(d),[T,p]=s.useState(!1),g=s.useCallback(()=>{c.current!==null&&(window.cancelAnimationFrame(c.current),c.current=null),i.current!==null&&(window.clearTimeout(i.current),i.current=null)},[]),x=s.useCallback(()=>{if(!l)return;const t=_.current,e=t==null?void 0:t.contentDocument;if(!t||!e)return;const m=t.style.height;try{t.style.height=`${d}px`;const o=e.querySelector("[data-iframe-content]")??e.body,u=o.getBoundingClientRect(),{body:q,documentElement:C}=e,B=Math.min(Math.max(Math.ceil(Math.max(o.scrollHeight,o.offsetHeight,u.height,q.scrollHeight,q.offsetHeight,C.scrollHeight,C.offsetHeight)+X),d),L);M(B)}catch{}finally{t.style.height=m}},[l]),n=s.useCallback(()=>{!l||c.current!==null||(c.current=window.requestAnimationFrame(()=>{c.current=null,x(),i.current!==null&&window.clearTimeout(i.current),i.current=window.setTimeout(()=>{i.current=null,x()},250)}))},[l,x]),U=t=>{var m,o;n();const e=(m=_.current)==null?void 0:m.contentDocument;Array.from((e==null?void 0:e.images)??[]).forEach(u=>{u.complete||(u.addEventListener("load",n,{once:!0}),u.addEventListener("error",n,{once:!0}))}),(o=e==null?void 0:e.fonts)==null||o.ready.then(n).catch(()=>{}),h==null||h(t)};return s.useEffect(()=>{if(l)return g(),M(d),n(),g},[l,g,n,w]),s.useEffect(()=>{var t;if(l)return window.addEventListener("resize",n),(t=window.visualViewport)==null||t.addEventListener("resize",n),()=>{var e;window.removeEventListener("resize",n),(e=window.visualViewport)==null||e.removeEventListener("resize",n)}},[l,n]),r.jsxs("div",{className:a.wrapper,"data-component":"iframe",children:[O&&r.jsx("div",{className:a.toolbar,children:r.jsx(A.Button,{"aria-expanded":T,"aria-haspopup":"dialog",onClick:()=>p(!0),variant:"tertiary",children:I})}),r.jsx("iframe",{...j,className:S.t(a.iframe,v),loading:b,onLoad:U,ref:_,referrerPolicy:H,sandbox:y,srcDoc:w,style:l?{...E,height:k,minHeight:d}:E,title:f}),T&&r.jsx(z.Dialog,{"aria-label":`${f} fullscreen`,controls:r.jsx(N.Controls,{children:r.jsx(A.Button,{onClick:()=>p(!1),children:F})}),fullscreen:!0,header:r.jsx(G.Header,{children:r.jsx("h2",{children:f})}),open:!0,setOpen:p,children:r.jsx("iframe",{...j,className:S.t(a.iframe,a["fullscreen-iframe"],v),loading:"eager",referrerPolicy:H,sandbox:y,srcDoc:w,title:`${f} fullscreen`})})]})};exports.Iframe=J;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index18.css');const l=require("react/jsx-runtime"),C=require("../../classix-5H4IWnMA.cjs"),s=require("react"),S=require("../button/index.cjs"),N=require("../controls/index.cjs"),G=require("../dialog/index.cjs"),V=require("../header/index.cjs"),$="_wrapper_s1xgg_3",R="_toolbar_s1xgg_8",L="_iframe_s1xgg_14",X="_scrollable_s1xgg_25",o={wrapper:$,toolbar:R,iframe:L,"fullscreen-iframe":"_fullscreen-iframe_s1xgg_20",scrollable:X},d=120,J=12e3,K=8,P=({accessibleLabel:f,autoResize:n=!1,className:v,closeFullscreenLabel:A="Close fullscreen",fullscreenLabel:F="View in fullscreen",hasFullscreenView:I=!0,loading:O="lazy",onLoad:h,referrerPolicy:H="no-referrer",sandbox:y="",srcDoc:g,style:E,...j})=>{const _=s.useRef(null),i=s.useRef(null),c=s.useRef(null),[k,b]=s.useState(d),[M,w]=s.useState(!1),p=s.useCallback(()=>{i.current!==null&&(window.cancelAnimationFrame(i.current),i.current=null),c.current!==null&&(window.clearTimeout(c.current),c.current=null)},[]),x=s.useCallback(()=>{if(!n)return;const t=_.current,e=t==null?void 0:t.contentDocument;if(!t||!e)return;const m=t.style.height;try{t.style.height=`${d}px`;const a=e.querySelector("[data-iframe-content]")??e.body,u=a.getBoundingClientRect(),{body:T,documentElement:q}=e,B=Math.min(Math.max(Math.ceil(Math.max(a.scrollHeight,a.offsetHeight,u.height,T.scrollHeight,T.offsetHeight,q.scrollHeight,q.offsetHeight)+K),d),J);b(B)}catch{}finally{t.style.height=m}},[n]),r=s.useCallback(()=>{!n||i.current!==null||(i.current=window.requestAnimationFrame(()=>{i.current=null,x(),c.current!==null&&window.clearTimeout(c.current),c.current=window.setTimeout(()=>{c.current=null,x()},250)}))},[n,x]),U=t=>{var m,a;r();const e=(m=_.current)==null?void 0:m.contentDocument;Array.from((e==null?void 0:e.images)??[]).forEach(u=>{u.complete||(u.addEventListener("load",r,{once:!0}),u.addEventListener("error",r,{once:!0}))}),(a=e==null?void 0:e.fonts)==null||a.ready.then(r).catch(()=>{}),h==null||h(t)};return s.useEffect(()=>{if(n)return p(),b(d),r(),p},[n,p,r,g]),s.useEffect(()=>{var t;if(n)return window.addEventListener("resize",r),(t=window.visualViewport)==null||t.addEventListener("resize",r),()=>{var e;window.removeEventListener("resize",r),(e=window.visualViewport)==null||e.removeEventListener("resize",r)}},[n,r]),l.jsxs("div",{className:o.wrapper,"data-component":"iframe",children:[I&&l.jsx("div",{className:o.toolbar,children:l.jsx(S.Button,{"aria-expanded":M,"aria-haspopup":"dialog",onClick:()=>w(!0),variant:"tertiary",children:F})}),l.jsx("iframe",{...j,className:C.t(o.iframe,!n&&o.scrollable,v),loading:O,onLoad:U,ref:_,referrerPolicy:H,sandbox:y,srcDoc:g,style:n?{...E,height:k,minHeight:d}:E,title:f}),M&&l.jsx(G.Dialog,{"aria-label":`${f} fullscreen`,controls:l.jsx(N.Controls,{children:l.jsx(S.Button,{onClick:()=>w(!1),children:A})}),fullscreen:!0,header:l.jsx(V.Header,{children:l.jsx("h2",{children:f})}),open:!0,setOpen:w,children:l.jsx("iframe",{...j,className:C.t(o.iframe,o["fullscreen-iframe"],o.scrollable,v),loading:"eager",referrerPolicy:H,sandbox:y,srcDoc:g,title:`${f} fullscreen`})})]})};exports.Iframe=P;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sources":["../../../src/components/iframe/index.tsx"],"sourcesContent":["import cx from 'classix';\nimport { type ComponentPropsWithoutRef, useCallback, useEffect, useRef, useState } from 'react';\n\nimport { Button } from '../button';\nimport { Controls } from '../controls';\nimport { Dialog } from '../dialog';\nimport { Header } from '../header';\nimport styles from './styles.module.css';\n\nconst MIN_AUTO_HEIGHT = 120;\nconst MAX_AUTO_HEIGHT = 12000;\nconst AUTO_HEIGHT_BUFFER = 8;\n\nexport type IframeProps = Omit<ComponentPropsWithoutRef<'iframe'>, 'src' | 'srcDoc' | 'title'> & {\n accessibleLabel: string;\n autoResize?: boolean;\n closeFullscreenLabel?: string;\n fullscreenLabel?: string;\n hasFullscreenView?: boolean;\n srcDoc: string;\n};\n\nexport const Iframe = ({\n accessibleLabel,\n autoResize = false,\n className,\n closeFullscreenLabel = 'Close fullscreen',\n fullscreenLabel = 'View in fullscreen',\n hasFullscreenView = true,\n loading = 'lazy',\n onLoad,\n referrerPolicy = 'no-referrer',\n sandbox = '',\n srcDoc,\n style,\n ...props\n}: IframeProps) => {\n const iframeRef = useRef<HTMLIFrameElement>(null);\n const measurementFrameRef = useRef<number | null>(null);\n const followUpMeasurementTimeoutRef = useRef<number | null>(null);\n const [measuredHeight, setMeasuredHeight] = useState(MIN_AUTO_HEIGHT);\n const [isFullscreenOpen, setIsFullscreenOpen] = useState(false);\n\n const clearScheduledMeasurements = useCallback(() => {\n if (measurementFrameRef.current !== null) {\n window.cancelAnimationFrame(measurementFrameRef.current);\n measurementFrameRef.current = null;\n }\n\n if (followUpMeasurementTimeoutRef.current !== null) {\n window.clearTimeout(followUpMeasurementTimeoutRef.current);\n followUpMeasurementTimeoutRef.current = null;\n }\n }, []);\n\n const measureSize = useCallback(() => {\n if (!autoResize) return;\n\n const iframe = iframeRef.current;\n const iframeDocument = iframe?.contentDocument;\n if (!iframe || !iframeDocument) return;\n\n const renderedHeight = iframe.style.height;\n\n try {\n // measure from a stable viewport height so content sized with percentages or\n // viewport units cannot feed the iframe's previous height back into itself\n iframe.style.height = `${MIN_AUTO_HEIGHT}px`;\n\n const content =\n iframeDocument.querySelector<HTMLElement>('[data-iframe-content]') ?? iframeDocument.body;\n const contentRect = content.getBoundingClientRect();\n const { body, documentElement } = iframeDocument;\n const height = Math.min(\n Math.max(\n Math.ceil(\n Math.max(\n content.scrollHeight,\n content.offsetHeight,\n contentRect.height,\n body.scrollHeight,\n body.offsetHeight,\n documentElement.scrollHeight,\n documentElement.offsetHeight\n ) + AUTO_HEIGHT_BUFFER\n ),\n MIN_AUTO_HEIGHT\n ),\n MAX_AUTO_HEIGHT\n );\n\n setMeasuredHeight(height);\n } catch {\n // cross-origin iframe content cannot be measured; retain minimum height\n } finally {\n iframe.style.height = renderedHeight;\n }\n }, [autoResize]);\n\n const scheduleSizeMeasurement = useCallback(() => {\n if (!autoResize || measurementFrameRef.current !== null) return;\n\n measurementFrameRef.current = window.requestAnimationFrame(() => {\n measurementFrameRef.current = null;\n measureSize();\n\n if (followUpMeasurementTimeoutRef.current !== null) {\n window.clearTimeout(followUpMeasurementTimeoutRef.current);\n }\n\n followUpMeasurementTimeoutRef.current = window.setTimeout(() => {\n followUpMeasurementTimeoutRef.current = null;\n measureSize();\n }, 250);\n });\n }, [autoResize, measureSize]);\n\n const handleLoad: NonNullable<IframeProps['onLoad']> = (event) => {\n scheduleSizeMeasurement();\n\n const iframeDocument = iframeRef.current?.contentDocument;\n Array.from(iframeDocument?.images ?? []).forEach((image) => {\n if (image.complete) return;\n image.addEventListener('load', scheduleSizeMeasurement, { once: true });\n image.addEventListener('error', scheduleSizeMeasurement, { once: true });\n });\n iframeDocument?.fonts?.ready.then(scheduleSizeMeasurement).catch(() => undefined);\n\n onLoad?.(event);\n };\n\n useEffect(() => {\n if (!autoResize) return undefined;\n\n clearScheduledMeasurements();\n setMeasuredHeight(MIN_AUTO_HEIGHT);\n scheduleSizeMeasurement();\n\n return clearScheduledMeasurements;\n }, [autoResize, clearScheduledMeasurements, scheduleSizeMeasurement, srcDoc]);\n\n useEffect(() => {\n if (!autoResize) return undefined;\n\n window.addEventListener('resize', scheduleSizeMeasurement);\n window.visualViewport?.addEventListener('resize', scheduleSizeMeasurement);\n\n return () => {\n window.removeEventListener('resize', scheduleSizeMeasurement);\n window.visualViewport?.removeEventListener('resize', scheduleSizeMeasurement);\n };\n }, [autoResize, scheduleSizeMeasurement]);\n\n return (\n <div className={styles.wrapper}>\n {hasFullscreenView && (\n <div className={styles.toolbar}>\n <Button\n aria-expanded={isFullscreenOpen}\n aria-haspopup='dialog'\n onClick={() => setIsFullscreenOpen(true)}\n variant='tertiary'\n >\n {fullscreenLabel}\n </Button>\n </div>\n )}\n <iframe\n {...props}\n className={cx(styles.iframe, className)}\n loading={loading}\n onLoad={handleLoad}\n ref={iframeRef}\n referrerPolicy={referrerPolicy}\n sandbox={sandbox}\n srcDoc={srcDoc}\n style={\n autoResize\n ? {\n ...style,\n height: measuredHeight,\n minHeight: MIN_AUTO_HEIGHT,\n }\n : style\n }\n title={accessibleLabel}\n />\n {isFullscreenOpen && (\n <Dialog\n aria-label={`${accessibleLabel} fullscreen`}\n controls={\n <Controls>\n <Button onClick={() => setIsFullscreenOpen(false)}>{closeFullscreenLabel}</Button>\n </Controls>\n }\n fullscreen\n header={\n <Header>\n <h2>{accessibleLabel}</h2>\n </Header>\n }\n open\n setOpen={setIsFullscreenOpen}\n >\n <iframe\n {...props}\n className={cx(styles.iframe, styles['fullscreen-iframe'], className)}\n loading='eager'\n referrerPolicy={referrerPolicy}\n sandbox={sandbox}\n srcDoc={srcDoc}\n title={`${accessibleLabel} fullscreen`}\n />\n </Dialog>\n )}\n </div>\n );\n};\n"],"names":["MIN_AUTO_HEIGHT","MAX_AUTO_HEIGHT","AUTO_HEIGHT_BUFFER","Iframe","accessibleLabel","autoResize","className","closeFullscreenLabel","fullscreenLabel","hasFullscreenView","loading","onLoad","referrerPolicy","sandbox","srcDoc","style","props","iframeRef","useRef","measurementFrameRef","followUpMeasurementTimeoutRef","measuredHeight","setMeasuredHeight","useState","isFullscreenOpen","setIsFullscreenOpen","clearScheduledMeasurements","useCallback","current","window","cancelAnimationFrame","clearTimeout","measureSize","iframe","iframeDocument","contentDocument","renderedHeight","height","content","querySelector","body","contentRect","getBoundingClientRect","documentElement","Math","min","max","ceil","scrollHeight","offsetHeight","scheduleSizeMeasurement","requestAnimationFrame","setTimeout","handleLoad","event","Array","from","images","forEach","image","complete","addEventListener","once","fonts","ready","then","catch","useEffect","visualViewport","removeEventListener","styles","wrapper","toolbar","jsx","Button","cx","minHeight","Dialog","Controls","Header"],"mappings":"wcASMA,EAAkB,IAClBC,EAAkB,KAClBC,EAAqB,EAWdC,EAASA,CAAC,CACrBC,gBAAAA,EACAC,WAAAA,EAAa,GACbC,UAAAA,EACAC,qBAAAA,EAAuB,mBACvBC,gBAAAA,EAAkB,qBAClBC,kBAAAA,EAAoB,GACpBC,QAAAA,EAAU,OACVC,OAAAA,EACAC,eAAAA,EAAiB,cACjBC,QAAAA,EAAU,GACVC,OAAAA,EACAC,MAAAA,EACA,GAAGC,CACQ,IAAM,CACjB,MAAMC,EAAYC,EAAAA,OAA0B,IAAI,EAC1CC,EAAsBD,EAAAA,OAAsB,IAAI,EAChDE,EAAgCF,EAAAA,OAAsB,IAAI,EAC1D,CAACG,EAAgBC,CAAiB,EAAIC,EAAAA,SAASvB,CAAe,EAC9D,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IAACC,EAAAA,QACC,gBAAelD,EACf,gBAAc,SACd,QAAS,IAAMC,EAAoB,EAAI,EACvC,QAAQ,WAEPjB,WACH,CAAA,CACF,QAED,SAAA,CACC,GAAIQ,EACJ,UAAW2D,IAAGL,EAAOrC,OAAQ3B,CAAS,EACtC,QAAAI,EACA,OAAQ2C,EACR,IAAKpC,EACL,eAAAL,EACA,QAAAC,EACA,OAAAC,EACA,MACET,EACI,CACE,GAAGU,EACHsB,OAAQhB,EACRuD,UAAW5E,CAAAA,EAEbe,EAEN,MAAOX,EAAgB,EAExBoB,GACCiD,EAAAA,IAACI,EAAAA,OAAA,CACC,aAAY,GAAGzE,CAAe,cAC9B,SACEqE,EAAAA,IAACK,EAAAA,SAAA,CACC,SAAAL,EAAAA,IAACC,EAAAA,OAAA,CAAO,QAAS,IAAMjD,EAAoB,EAAK,EAAIlB,SAAAA,CAAAA,CAAqB,CAAA,CAC3E,EAEF,WAAU,GACV,OACEkE,EAAAA,IAACM,EAAAA,OAAA,CACC,SAAAN,EAAAA,IAAC,KAAA,CAAIrE,SAAAA,CAAAA,CAAgB,EACvB,EAEF,KAAI,GACJ,QAASqB,EAET,SAAAgD,EAAAA,IAAC,SAAA,CACC,GAAIzD,EACJ,UAAW2D,EAAAA,EAAGL,EAAOrC,OAAQqC,EAAO,mBAAmB,EAAGhE,CAAS,EACnE,QAAQ,QACR,eAAAM,EACA,QAAAC,EACA,OAAAC,EACA,MAAO,GAAGV,CAAe,aAAA,CAAc,CAAA,CAE3C,CAAA,EAEJ,CAEJ"}
1
+ {"version":3,"file":"index.cjs","sources":["../../../src/components/iframe/index.tsx"],"sourcesContent":["import cx from 'classix';\nimport { type ComponentPropsWithoutRef, useCallback, useEffect, useRef, useState } from 'react';\n\nimport { Button } from '../button';\nimport { Controls } from '../controls';\nimport { Dialog } from '../dialog';\nimport { Header } from '../header';\nimport styles from './styles.module.css';\n\nconst MIN_AUTO_HEIGHT = 120;\nconst MAX_AUTO_HEIGHT = 12000;\nconst AUTO_HEIGHT_BUFFER = 8;\n\nexport type IframeProps = Omit<ComponentPropsWithoutRef<'iframe'>, 'src' | 'srcDoc' | 'title'> & {\n accessibleLabel: string;\n autoResize?: boolean;\n closeFullscreenLabel?: string;\n fullscreenLabel?: string;\n hasFullscreenView?: boolean;\n srcDoc: string;\n};\n\nexport const Iframe = ({\n accessibleLabel,\n autoResize = false,\n className,\n closeFullscreenLabel = 'Close fullscreen',\n fullscreenLabel = 'View in fullscreen',\n hasFullscreenView = true,\n loading = 'lazy',\n onLoad,\n referrerPolicy = 'no-referrer',\n sandbox = '',\n srcDoc,\n style,\n ...props\n}: IframeProps) => {\n const iframeRef = useRef<HTMLIFrameElement>(null);\n const measurementFrameRef = useRef<number | null>(null);\n const followUpMeasurementTimeoutRef = useRef<number | null>(null);\n const [measuredHeight, setMeasuredHeight] = useState(MIN_AUTO_HEIGHT);\n const [isFullscreenOpen, setIsFullscreenOpen] = useState(false);\n\n const clearScheduledMeasurements = useCallback(() => {\n if (measurementFrameRef.current !== null) {\n window.cancelAnimationFrame(measurementFrameRef.current);\n measurementFrameRef.current = null;\n }\n\n if (followUpMeasurementTimeoutRef.current !== null) {\n window.clearTimeout(followUpMeasurementTimeoutRef.current);\n followUpMeasurementTimeoutRef.current = null;\n }\n }, []);\n\n const measureSize = useCallback(() => {\n if (!autoResize) return;\n\n const iframe = iframeRef.current;\n const iframeDocument = iframe?.contentDocument;\n if (!iframe || !iframeDocument) return;\n\n const renderedHeight = iframe.style.height;\n\n try {\n iframe.style.height = `${MIN_AUTO_HEIGHT}px`;\n\n const content =\n iframeDocument.querySelector<HTMLElement>('[data-iframe-content]') ?? iframeDocument.body;\n const contentRect = content.getBoundingClientRect();\n const { body, documentElement } = iframeDocument;\n const height = Math.min(\n Math.max(\n Math.ceil(\n Math.max(\n content.scrollHeight,\n content.offsetHeight,\n contentRect.height,\n body.scrollHeight,\n body.offsetHeight,\n documentElement.scrollHeight,\n documentElement.offsetHeight\n ) + AUTO_HEIGHT_BUFFER\n ),\n MIN_AUTO_HEIGHT\n ),\n MAX_AUTO_HEIGHT\n );\n\n setMeasuredHeight(height);\n } catch {\n /* 🌝 */\n } finally {\n iframe.style.height = renderedHeight;\n }\n }, [autoResize]);\n\n const scheduleSizeMeasurement = useCallback(() => {\n if (!autoResize || measurementFrameRef.current !== null) return;\n\n measurementFrameRef.current = window.requestAnimationFrame(() => {\n measurementFrameRef.current = null;\n measureSize();\n\n if (followUpMeasurementTimeoutRef.current !== null) {\n window.clearTimeout(followUpMeasurementTimeoutRef.current);\n }\n\n followUpMeasurementTimeoutRef.current = window.setTimeout(() => {\n followUpMeasurementTimeoutRef.current = null;\n measureSize();\n }, 250);\n });\n }, [autoResize, measureSize]);\n\n const handleLoad: NonNullable<IframeProps['onLoad']> = (event) => {\n scheduleSizeMeasurement();\n\n const iframeDocument = iframeRef.current?.contentDocument;\n Array.from(iframeDocument?.images ?? []).forEach((image) => {\n if (image.complete) return;\n image.addEventListener('load', scheduleSizeMeasurement, { once: true });\n image.addEventListener('error', scheduleSizeMeasurement, { once: true });\n });\n iframeDocument?.fonts?.ready.then(scheduleSizeMeasurement).catch(() => undefined);\n\n onLoad?.(event);\n };\n\n useEffect(() => {\n if (!autoResize) return undefined;\n\n clearScheduledMeasurements();\n setMeasuredHeight(MIN_AUTO_HEIGHT);\n scheduleSizeMeasurement();\n\n return clearScheduledMeasurements;\n }, [autoResize, clearScheduledMeasurements, scheduleSizeMeasurement, srcDoc]);\n\n useEffect(() => {\n if (!autoResize) return undefined;\n\n window.addEventListener('resize', scheduleSizeMeasurement);\n window.visualViewport?.addEventListener('resize', scheduleSizeMeasurement);\n\n return () => {\n window.removeEventListener('resize', scheduleSizeMeasurement);\n window.visualViewport?.removeEventListener('resize', scheduleSizeMeasurement);\n };\n }, [autoResize, scheduleSizeMeasurement]);\n\n return (\n <div className={styles.wrapper}>\n {hasFullscreenView && (\n <div className={styles.toolbar}>\n <Button\n aria-expanded={isFullscreenOpen}\n aria-haspopup='dialog'\n onClick={() => setIsFullscreenOpen(true)}\n variant='tertiary'\n >\n {fullscreenLabel}\n </Button>\n </div>\n )}\n <iframe\n {...props}\n className={cx(styles.iframe, !autoResize && styles.scrollable, className)}\n loading={loading}\n onLoad={handleLoad}\n ref={iframeRef}\n referrerPolicy={referrerPolicy}\n sandbox={sandbox}\n srcDoc={srcDoc}\n style={\n autoResize\n ? {\n ...style,\n height: measuredHeight,\n minHeight: MIN_AUTO_HEIGHT,\n }\n : style\n }\n title={accessibleLabel}\n />\n {isFullscreenOpen && (\n <Dialog\n aria-label={`${accessibleLabel} fullscreen`}\n controls={\n <Controls>\n <Button onClick={() => setIsFullscreenOpen(false)}>{closeFullscreenLabel}</Button>\n </Controls>\n }\n fullscreen\n header={\n <Header>\n <h2>{accessibleLabel}</h2>\n </Header>\n }\n open\n setOpen={setIsFullscreenOpen}\n >\n <iframe\n {...props}\n className={cx(styles.iframe, styles['fullscreen-iframe'], styles.scrollable, className)}\n loading='eager'\n referrerPolicy={referrerPolicy}\n sandbox={sandbox}\n srcDoc={srcDoc}\n title={`${accessibleLabel} fullscreen`}\n />\n </Dialog>\n )}\n </div>\n );\n};\n"],"names":["MIN_AUTO_HEIGHT","MAX_AUTO_HEIGHT","AUTO_HEIGHT_BUFFER","Iframe","accessibleLabel","autoResize","className","closeFullscreenLabel","fullscreenLabel","hasFullscreenView","loading","onLoad","referrerPolicy","sandbox","srcDoc","style","props","iframeRef","useRef","measurementFrameRef","followUpMeasurementTimeoutRef","measuredHeight","setMeasuredHeight","useState","isFullscreenOpen","setIsFullscreenOpen","clearScheduledMeasurements","useCallback","current","window","cancelAnimationFrame","clearTimeout","measureSize","iframe","iframeDocument","contentDocument","renderedHeight","height","content","querySelector","body","contentRect","getBoundingClientRect","documentElement","Math","min","max","ceil","scrollHeight","offsetHeight","scheduleSizeMeasurement","requestAnimationFrame","setTimeout","handleLoad","event","Array","from","images","forEach","image","complete","addEventListener","once","fonts","ready","then","catch","useEffect","visualViewport","removeEventListener","sty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AA,CAAIrE,SAAAA,CAAAA,CAAgB,CAAA,CACvB,EAEF,KAAI,GACJ,QAASqB,EAET,SAAAgD,EAAAA,IAAC,SAAA,CACC,GAAIzD,EACJ,UAAW2D,EAAAA,EAAGL,EAAOrC,OAAQqC,EAAO,mBAAmB,EAAGA,EAAOM,WAAYtE,CAAS,EACtF,QAAQ,QACR,eAAAM,EACA,QAAAC,EACA,OAAAC,EACA,MAAO,GAAGV,CAAe,aAAA,CAAc,CAAA,CAE3C,CAAA,EAEJ,CAEJ"}
@@ -1,88 +1,89 @@
1
1
  import { jsxs as q, jsx as l } from "react/jsx-runtime";
2
- import { t as O } from "../../classix-DG18itHa.js";
3
- import { useRef as H, useState as S, useCallback as v, useEffect as U } from "react";
4
- import { Button as N } from "../button/index.js";
5
- import { Controls as b } from "../controls/index.js";
6
- import { Dialog as L } from "../dialog/index.js";
7
- import { Header as X } from "../header/index.js";
8
- import '../../assets/index18.css';const J = "_wrapper_29z62_1", K = "_toolbar_29z62_6", Q = "_iframe_29z62_12", a = {
9
- wrapper: J,
10
- toolbar: K,
11
- iframe: Q,
12
- "fullscreen-iframe": "_fullscreen-iframe_29z62_18"
13
- }, u = 120, W = 12e3, Y = 8, ne = ({
2
+ import { t as I } from "../../classix-DG18itHa.js";
3
+ import { useRef as H, useState as O, useCallback as v, useEffect as S } from "react";
4
+ import { Button as U } from "../button/index.js";
5
+ import { Controls as L } from "../controls/index.js";
6
+ import { Dialog as X } from "../dialog/index.js";
7
+ import { Header as J } from "../header/index.js";
8
+ import '../../assets/index18.css';const K = "_wrapper_s1xgg_3", Q = "_toolbar_s1xgg_8", W = "_iframe_s1xgg_14", Y = "_scrollable_s1xgg_25", i = {
9
+ wrapper: K,
10
+ toolbar: Q,
11
+ iframe: W,
12
+ "fullscreen-iframe": "_fullscreen-iframe_s1xgg_20",
13
+ scrollable: Y
14
+ }, u = 120, Z = 12e3, D = 8, le = ({
14
15
  accessibleLabel: f,
15
16
  autoResize: n = !1,
16
17
  className: E,
17
- closeFullscreenLabel: k = "Close fullscreen",
18
- fullscreenLabel: z = "View in fullscreen",
18
+ closeFullscreenLabel: N = "Close fullscreen",
19
+ fullscreenLabel: k = "View in fullscreen",
19
20
  hasFullscreenView: B = !0,
20
21
  loading: G = "lazy",
21
22
  onLoad: d,
22
23
  referrerPolicy: y = "no-referrer",
23
- sandbox: M = "",
24
+ sandbox: x = "",
24
25
  srcDoc: h,
25
- style: T,
26
- ...A
26
+ style: M,
27
+ ...T
27
28
  }) => {
28
- const p = H(null), o = H(null), i = H(null), [V, F] = S(u), [x, w] = S(!1), g = v(() => {
29
- o.current !== null && (window.cancelAnimationFrame(o.current), o.current = null), i.current !== null && (window.clearTimeout(i.current), i.current = null);
29
+ const g = H(null), c = H(null), o = H(null), [V, A] = O(u), [F, p] = O(!1), w = v(() => {
30
+ c.current !== null && (window.cancelAnimationFrame(c.current), c.current = null), o.current !== null && (window.clearTimeout(o.current), o.current = null);
30
31
  }, []), _ = v(() => {
31
32
  if (!n) return;
32
- const r = p.current, e = r == null ? void 0 : r.contentDocument;
33
+ const r = g.current, e = r == null ? void 0 : r.contentDocument;
33
34
  if (!r || !e) return;
34
35
  const m = r.style.height;
35
36
  try {
36
37
  r.style.height = `${u}px`;
37
- const c = e.querySelector("[data-iframe-content]") ?? e.body, s = c.getBoundingClientRect(), {
38
- body: C,
39
- documentElement: I
40
- } = e, j = Math.min(Math.max(Math.ceil(Math.max(c.scrollHeight, c.offsetHeight, s.height, C.scrollHeight, C.offsetHeight, I.scrollHeight, I.offsetHeight) + Y), u), W);
41
- F(j);
38
+ const s = e.querySelector("[data-iframe-content]") ?? e.body, a = s.getBoundingClientRect(), {
39
+ body: b,
40
+ documentElement: C
41
+ } = e, j = Math.min(Math.max(Math.ceil(Math.max(s.scrollHeight, s.offsetHeight, a.height, b.scrollHeight, b.offsetHeight, C.scrollHeight, C.offsetHeight) + D), u), Z);
42
+ A(j);
42
43
  } catch {
43
44
  } finally {
44
45
  r.style.height = m;
45
46
  }
46
47
  }, [n]), t = v(() => {
47
- !n || o.current !== null || (o.current = window.requestAnimationFrame(() => {
48
- o.current = null, _(), i.current !== null && window.clearTimeout(i.current), i.current = window.setTimeout(() => {
49
- i.current = null, _();
48
+ !n || c.current !== null || (c.current = window.requestAnimationFrame(() => {
49
+ c.current = null, _(), o.current !== null && window.clearTimeout(o.current), o.current = window.setTimeout(() => {
50
+ o.current = null, _();
50
51
  }, 250);
51
52
  }));
52
53
  }, [n, _]), $ = (r) => {
53
- var m, c;
54
+ var m, s;
54
55
  t();
55
- const e = (m = p.current) == null ? void 0 : m.contentDocument;
56
- Array.from((e == null ? void 0 : e.images) ?? []).forEach((s) => {
57
- s.complete || (s.addEventListener("load", t, {
56
+ const e = (m = g.current) == null ? void 0 : m.contentDocument;
57
+ Array.from((e == null ? void 0 : e.images) ?? []).forEach((a) => {
58
+ a.complete || (a.addEventListener("load", t, {
58
59
  once: !0
59
- }), s.addEventListener("error", t, {
60
+ }), a.addEventListener("error", t, {
60
61
  once: !0
61
62
  }));
62
- }), (c = e == null ? void 0 : e.fonts) == null || c.ready.then(t).catch(() => {
63
+ }), (s = e == null ? void 0 : e.fonts) == null || s.ready.then(t).catch(() => {
63
64
  }), d == null || d(r);
64
65
  };
65
- return U(() => {
66
+ return S(() => {
66
67
  if (n)
67
- return g(), F(u), t(), g;
68
- }, [n, g, t, h]), U(() => {
68
+ return w(), A(u), t(), w;
69
+ }, [n, w, t, h]), S(() => {
69
70
  var r;
70
71
  if (n)
71
72
  return window.addEventListener("resize", t), (r = window.visualViewport) == null || r.addEventListener("resize", t), () => {
72
73
  var e;
73
74
  window.removeEventListener("resize", t), (e = window.visualViewport) == null || e.removeEventListener("resize", t);
74
75
  };
75
- }, [n, t]), /* @__PURE__ */ q("div", { className: a.wrapper, "data-component": "iframe", children: [
76
- B && /* @__PURE__ */ l("div", { className: a.toolbar, children: /* @__PURE__ */ l(N, { "aria-expanded": x, "aria-haspopup": "dialog", onClick: () => w(!0), variant: "tertiary", children: z }) }),
77
- /* @__PURE__ */ l("iframe", { ...A, className: O(a.iframe, E), loading: G, onLoad: $, ref: p, referrerPolicy: y, sandbox: M, srcDoc: h, style: n ? {
78
- ...T,
76
+ }, [n, t]), /* @__PURE__ */ q("div", { className: i.wrapper, "data-component": "iframe", children: [
77
+ B && /* @__PURE__ */ l("div", { className: i.toolbar, children: /* @__PURE__ */ l(U, { "aria-expanded": F, "aria-haspopup": "dialog", onClick: () => p(!0), variant: "tertiary", children: k }) }),
78
+ /* @__PURE__ */ l("iframe", { ...T, className: I(i.iframe, !n && i.scrollable, E), loading: G, onLoad: $, ref: g, referrerPolicy: y, sandbox: x, srcDoc: h, style: n ? {
79
+ ...M,
79
80
  height: V,
80
81
  minHeight: u
81
- } : T, title: f }),
82
- x && /* @__PURE__ */ l(L, { "aria-label": `${f} fullscreen`, controls: /* @__PURE__ */ l(b, { children: /* @__PURE__ */ l(N, { onClick: () => w(!1), children: k }) }), fullscreen: !0, header: /* @__PURE__ */ l(X, { children: /* @__PURE__ */ l("h2", { children: f }) }), open: !0, setOpen: w, children: /* @__PURE__ */ l("iframe", { ...A, className: O(a.iframe, a["fullscreen-iframe"], E), loading: "eager", referrerPolicy: y, sandbox: M, srcDoc: h, title: `${f} fullscreen` }) })
82
+ } : M, title: f }),
83
+ F && /* @__PURE__ */ l(X, { "aria-label": `${f} fullscreen`, controls: /* @__PURE__ */ l(L, { children: /* @__PURE__ */ l(U, { onClick: () => p(!1), children: N }) }), fullscreen: !0, header: /* @__PURE__ */ l(J, { children: /* @__PURE__ */ l("h2", { children: f }) }), open: !0, setOpen: p, children: /* @__PURE__ */ l("iframe", { ...T, className: I(i.iframe, i["fullscreen-iframe"], i.scrollable, E), loading: "eager", referrerPolicy: y, sandbox: x, srcDoc: h, title: `${f} fullscreen` }) })
83
84
  ] });
84
85
  };
85
86
  export {
86
- ne as Iframe
87
+ le as Iframe
87
88
  };
88
89
  //# sourceMappingURL=index.js.map