@solibo/solibo-ui 0.3.27 → 0.3.30

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 (111) hide show
  1. package/README.md +53 -8
  2. package/dist/assets/index.css +1 -1
  3. package/dist/assets/index12.css +1 -1
  4. package/dist/assets/index13.css +1 -1
  5. package/dist/assets/index14.css +1 -1
  6. package/dist/assets/index19.css +1 -1
  7. package/dist/assets/index20.css +1 -1
  8. package/dist/assets/index21.css +1 -1
  9. package/dist/assets/index22.css +1 -1
  10. package/dist/assets/index23.css +1 -1
  11. package/dist/assets/index24.css +1 -1
  12. package/dist/assets/index25.css +1 -1
  13. package/dist/assets/index26.css +1 -1
  14. package/dist/assets/index27.css +1 -1
  15. package/dist/assets/index28.css +1 -1
  16. package/dist/assets/index29.css +1 -1
  17. package/dist/assets/index30.css +1 -1
  18. package/dist/assets/index31.css +1 -1
  19. package/dist/assets/index33.css +1 -1
  20. package/dist/assets/index35.css +1 -1
  21. package/dist/assets/index38.css +1 -1
  22. package/dist/assets/index40.css +1 -1
  23. package/dist/assets/index41.css +1 -1
  24. package/dist/assets/index42.css +1 -1
  25. package/dist/assets/index43.css +1 -0
  26. package/dist/assets/index5.css +1 -1
  27. package/dist/assets/index7.css +1 -1
  28. package/dist/assets/styles.css +1 -1
  29. package/dist/components/_avatar/index.cjs +1 -1
  30. package/dist/components/_avatar/index.js +1 -1
  31. package/dist/components/_card/index.cjs +1 -1
  32. package/dist/components/_card/index.js +11 -11
  33. package/dist/components/_collapsible/index.cjs +1 -1
  34. package/dist/components/_collapsible/index.cjs.map +1 -1
  35. package/dist/components/_collapsible/index.js +3 -3
  36. package/dist/components/_collapsible/index.js.map +1 -1
  37. package/dist/components/_croppable/index.cjs +1 -1
  38. package/dist/components/_croppable/index.cjs.map +1 -1
  39. package/dist/components/_croppable/index.js +238 -159
  40. package/dist/components/_croppable/index.js.map +1 -1
  41. package/dist/components/_dropzone/index.cjs +1 -1
  42. package/dist/components/_dropzone/index.js +1 -1
  43. package/dist/components/_editor/index.cjs +25 -25
  44. package/dist/components/_editor/index.cjs.map +1 -1
  45. package/dist/components/_editor/index.js +1783 -1784
  46. package/dist/components/_editor/index.js.map +1 -1
  47. package/dist/components/_messages/index.cjs +1 -1
  48. package/dist/components/_messages/index.js +1 -1
  49. package/dist/components/_portal/index.cjs +1 -1
  50. package/dist/components/_portal/index.js +5 -5
  51. package/dist/components/_sortable/index.cjs +1 -1
  52. package/dist/components/_sortable/index.js +1 -1
  53. package/dist/components/_toasts/index.cjs +1 -1
  54. package/dist/components/_toasts/index.js +9 -9
  55. package/dist/components/_widget/index.cjs +1 -1
  56. package/dist/components/_widget/index.js +1 -1
  57. package/dist/components/accordion/index.cjs +1 -1
  58. package/dist/components/accordion/index.js +1 -1
  59. package/dist/components/aside/index.cjs +1 -1
  60. package/dist/components/aside/index.js +3 -3
  61. package/dist/components/button/index.cjs +1 -1
  62. package/dist/components/button/index.js +15 -15
  63. package/dist/components/checkbox/index.cjs +1 -1
  64. package/dist/components/checkbox/index.js +6 -6
  65. package/dist/components/controls/index.cjs +1 -1
  66. package/dist/components/controls/index.cjs.map +1 -1
  67. package/dist/components/controls/index.js +8 -8
  68. package/dist/components/controls/index.js.map +1 -1
  69. package/dist/components/dialog/index.cjs +1 -1
  70. package/dist/components/dialog/index.js +7 -7
  71. package/dist/components/form/index.cjs +1 -1
  72. package/dist/components/form/index.js +4 -4
  73. package/dist/components/header/index.cjs +1 -1
  74. package/dist/components/header/index.js +3 -3
  75. package/dist/components/input/index.cjs +1 -1
  76. package/dist/components/input/index.js +1 -1
  77. package/dist/components/layout/index.cjs +1 -1
  78. package/dist/components/layout/index.js +10 -10
  79. package/dist/components/list/index.cjs +1 -1
  80. package/dist/components/list/index.js +11 -11
  81. package/dist/components/nav/index.cjs +1 -1
  82. package/dist/components/nav/index.cjs.map +1 -1
  83. package/dist/components/nav/index.js +35 -20
  84. package/dist/components/nav/index.js.map +1 -1
  85. package/dist/components/textarea/index.cjs +1 -1
  86. package/dist/components/textarea/index.js +14 -14
  87. package/dist/components/toast/index.cjs +1 -1
  88. package/dist/components/toast/index.js +20 -20
  89. package/dist/components/toggle/index.cjs +1 -1
  90. package/dist/components/toggle/index.cjs.map +1 -1
  91. package/dist/components/toggle/index.js +9 -9
  92. package/dist/components/toggle/index.js.map +1 -1
  93. package/dist/components/toolbar/index.cjs +2 -0
  94. package/dist/components/toolbar/index.cjs.map +1 -0
  95. package/dist/components/toolbar/index.js +14 -0
  96. package/dist/components/toolbar/index.js.map +1 -0
  97. package/dist/index.cjs +1 -1
  98. package/dist/index.d.ts +13 -1
  99. package/dist/index.js +16 -14
  100. package/dist/index.js.map +1 -1
  101. package/dist/styles.module-BuPl_9yN.cjs +2 -0
  102. package/dist/styles.module-BuPl_9yN.cjs.map +1 -0
  103. package/dist/styles.module-ZrsD4xw8.js +10 -0
  104. package/dist/styles.module-ZrsD4xw8.js.map +1 -0
  105. package/dist/utils-DXIJVVzz.js.map +1 -1
  106. package/dist/utils-D_TJ8wDc.cjs.map +1 -1
  107. package/package.json +2 -3
  108. package/dist/styles.module--qoz6wR5.cjs +0 -2
  109. package/dist/styles.module--qoz6wR5.cjs.map +0 -1
  110. package/dist/styles.module-y5zmJBcz.js +0 -10
  111. package/dist/styles.module-y5zmJBcz.js.map +0 -1
@@ -1 +1 @@
1
- ._dialog_1gvg4_1{background-color:var(--color-white);border-radius:var(--border-radius);border:none;box-shadow:var(--shadow-big);justify-self:center;max-height:90vh;max-width:75vw;min-width:25vw;opacity:0;overflow-y:auto;text-align:center;transition:opacity var(--transition-duration) var(--transition-timing-function) var(--transition-delay),visibility var(--transition-duration) var(--transition-timing-function) var(--transition-delay);visibility:hidden}._dialog_1gvg4_1[open]{opacity:1;visibility:visible}._dialog_1gvg4_1 button{margin:var(--unit)}._wrapper_1gvg4_28{align-items:center;-webkit-backdrop-filter:blur(var(--unit));backdrop-filter:blur(var(--unit));display:flex;height:100%;left:0;opacity:0;position:fixed;top:0;transition:opacity var(--transition-duration) var(--transition-timing-function) var(--transition-delay),visibility var(--transition-duration) var(--transition-timing-function) var(--transition-delay),-webkit-backdrop-filter var(--transition-duration) var(--transition-timing-function);transition:backdrop-filter var(--transition-duration) var(--transition-timing-function),opacity var(--transition-duration) var(--transition-timing-function) var(--transition-delay),visibility var(--transition-duration) var(--transition-timing-function) var(--transition-delay);transition:backdrop-filter var(--transition-duration) var(--transition-timing-function),opacity var(--transition-duration) var(--transition-timing-function) var(--transition-delay),visibility var(--transition-duration) var(--transition-timing-function) var(--transition-delay),-webkit-backdrop-filter var(--transition-duration) var(--transition-timing-function);visibility:hidden;width:100%;z-index:3}._wrapper_1gvg4_28:has(dialog[open]){opacity:1;visibility:visible}@media (width <= 960px){._dialog_1gvg4_1{max-width:90vw}}
1
+ ._dialog_19p8b_1{background-color:var(--color-white);border-radius:var(--border-radius);border:none;box-shadow:var(--shadow-big);justify-self:center;max-height:90vh;max-width:75vw;min-width:25vw;opacity:0;overflow-y:auto;text-align:center;transition:opacity var(--transition-duration) var(--transition-timing-function) var(--transition-delay),visibility var(--transition-duration) var(--transition-timing-function) var(--transition-delay);visibility:hidden}._dialog_19p8b_1[open]{opacity:1;visibility:visible}._dialog_19p8b_1 button{margin-right:var(--unit)}._dialog_19p8b_1 button:last-child{margin-right:0}._wrapper_19p8b_32{align-items:center;-webkit-backdrop-filter:blur(var(--unit-tiny));backdrop-filter:blur(var(--unit-tiny));display:flex;height:100%;left:0;opacity:0;position:fixed;top:0;transition:opacity var(--transition-duration) var(--transition-timing-function) var(--transition-delay),visibility var(--transition-duration) var(--transition-timing-function) var(--transition-delay),-webkit-backdrop-filter var(--transition-duration) var(--transition-timing-function);transition:backdrop-filter var(--transition-duration) var(--transition-timing-function),opacity var(--transition-duration) var(--transition-timing-function) var(--transition-delay),visibility var(--transition-duration) var(--transition-timing-function) var(--transition-delay);transition:backdrop-filter var(--transition-duration) var(--transition-timing-function),opacity var(--transition-duration) var(--transition-timing-function) var(--transition-delay),visibility var(--transition-duration) var(--transition-timing-function) var(--transition-delay),-webkit-backdrop-filter var(--transition-duration) var(--transition-timing-function);visibility:hidden;width:100%;z-index:5}._wrapper_19p8b_32:has(dialog[open]){opacity:1;visibility:visible}@media (width <= 960px){._dialog_19p8b_1{max-width:90vw}}
@@ -1 +1 @@
1
- @keyframes _reveal_yojud_1{0%{-webkit-backdrop-filter:blur(0);backdrop-filter:blur(0);opacity:0;transform:translateY(100%)}to{-webkit-backdrop-filter:blur(var(--unit));backdrop-filter:blur(var(--unit));opacity:1;transform:translateY(0)}}._controls_yojud_15 menu{align-items:center;display:flex;gap:var(--unit);list-style:none;margin:inherit 0;padding:0}._wrapper_yojud_26{animation:_reveal_yojud_1 var(--transition-duration-long) var(--transition-timing-function) var(--transition-delay) both;bottom:0;contain:paint;display:flex;justify-content:center;left:0;-webkit-mask:linear-gradient(transparent,black);mask:linear-gradient(transparent,black);padding-top:calc(var(--unit) * 4);position:fixed;right:0;will-change:filter,mask,opacity,transform;z-index:4}
1
+ @keyframes _reveal_u02jm_1{0%{-webkit-backdrop-filter:blur(0);backdrop-filter:blur(0);opacity:0;transform:translateY(100%)}to{-webkit-backdrop-filter:blur(var(--unit-tiny));backdrop-filter:blur(var(--unit-tiny));opacity:1;transform:translateY(0)}}._controls_u02jm_15{display:flex;justify-content:center}._controls_u02jm_15 menu{align-items:center;display:flex;gap:var(--unit);list-style:none;margin:0;padding:0}._wrapper_u02jm_29{animation:_reveal_u02jm_1 var(--transition-duration-long) var(--transition-timing-function) var(--transition-delay) both;bottom:0;left:0;-webkit-mask:linear-gradient(transparent,black var(--unit));mask:linear-gradient(transparent,black var(--unit));position:fixed;right:0;will-change:filter,mask,opacity,transform;z-index:4}
@@ -1 +1 @@
1
- ._checkbox_19svo_1{align-items:center;cursor:pointer;display:inline-flex;gap:var(--unit-small)}._checkbox_19svo_1 input[type=checkbox]{-webkit-appearance:none;-moz-appearance:none;appearance:none;border:solid 1px var(--color-neutral);border-radius:calc(var(--border-radius) / 2);height:calc(var(--unit) * 1.25);width:calc(var(--unit) * 1.25)}._checkbox_19svo_1 input[type=checkbox]:checked{background-color:var(--color-primary)}._checkbox_19svo_1 input[type=checkbox]:checked:after{background-color:var(--color-white);content:"";display:block;height:100%;-webkit-mask-image:var(--icon-svg);mask-image:var(--icon-svg);width:100%}._checkbox_19svo_1 input[type=checkbox]:disabled{background-color:var(--color-neutral);cursor:not-allowed}._checkbox_19svo_1 input[type=checkbox]:disabled:after{background-color:var(--color-icon)}
1
+ ._checkbox_1e3mw_1{align-items:center;cursor:pointer;display:inline-flex;gap:var(--unit)}._checkbox_1e3mw_1 input[type=checkbox]{-webkit-appearance:none;-moz-appearance:none;appearance:none;border:solid 1px var(--color-neutral);border-radius:calc(var(--border-radius) / 2);height:calc(var(--unit) * 1.25);width:calc(var(--unit) * 1.25)}._checkbox_1e3mw_1 input[type=checkbox]:checked{background-color:var(--color-primary)}._checkbox_1e3mw_1 input[type=checkbox]:checked:after{background-color:var(--color-white);content:"";display:block;height:100%;-webkit-mask-image:var(--icon-svg);mask-image:var(--icon-svg);width:100%}._checkbox_1e3mw_1 input[type=checkbox]:disabled{background-color:var(--color-neutral);cursor:not-allowed}._checkbox_1e3mw_1 input[type=checkbox]:disabled:after{background-color:var(--color-icon)}
@@ -1 +1 @@
1
- ._accordion_8spz8_1 summary{cursor:pointer;list-style:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}
1
+ :root{--size: calc(var(--unit) * 2)}._avatar_2x0un_5{background-color:var(--color-fallback);border-radius:var(--size);display:inline-block;margin:0 var(--unit-tiny);overflow:hidden;height:var(--size);width:var(--size)}._avatar_2x0un_5 span{margin:var(--unit-tiny)}
@@ -1 +1 @@
1
- :root{--size: calc(var(--unit) * 2)}._avatar_2x0un_5{background-color:var(--color-fallback);border-radius:var(--size);display:inline-block;margin:0 var(--unit-tiny);overflow:hidden;height:var(--size);width:var(--size)}._avatar_2x0un_5 span{margin:var(--unit-tiny)}
1
+ ._card_gtmcl_1{background-color:var(--color-white);border:var(--border-width) solid var(--color-border-primary);border-radius:var(--border-radius);cursor:pointer;box-shadow:var(--shadow-big);max-width:100%!important;overflow:hidden!important;padding:var(--padding-box);position:relative;text-overflow:ellipsis;transition:width var(--transition-duration) var(--transition-timing-function)}._card_gtmcl_1._draft_gtmcl_14{background-color:var(--color-draft)}._card_gtmcl_1._scheduled_gtmcl_18{opacity:.5}._card_gtmcl_1 ._image_gtmcl_22{margin:0 var(--negative-unit);width:100%}._card_gtmcl_1 ._image_gtmcl_22 img{height:calc(12 * var(--unit));width:calc(100% + calc(2 * var(--unit)))}._card_gtmcl_1 ._image_gtmcl_22>*{border-bottom-left-radius:0;border-bottom-right-radius:0}._card_gtmcl_1 [data-component=croppable]{margin:var(--negative-unit);width:calc(100% + calc(2 * var(--unit)))}
@@ -1 +1 @@
1
- ._card_mj7yt_1{background-color:var(--color-white);border:var(--border-width) solid var(--color-border-primary);border-radius:var(--border-radius);box-shadow:var(--shadow-big);max-width:100%!important;overflow:hidden!important;padding:var(--padding-box);text-overflow:ellipsis;transition:width var(--transition-duration) var(--transition-timing-function)}._card_mj7yt_1._draft_mj7yt_12{background-color:var(--color-draft)}._card_mj7yt_1._scheduled_mj7yt_16{opacity:.5}._card_mj7yt_1 ._image_mj7yt_20{margin:0 var(--negative-unit);width:100%}._card_mj7yt_1 ._image_mj7yt_20 img{height:calc(12 * var(--unit));width:calc(100% + calc(2 * var(--unit)))}._card_mj7yt_1 ._image_mj7yt_20>*{border-bottom-left-radius:0;border-bottom-right-radius:0}._card_mj7yt_1 [data-component=croppable]{margin:var(--negative-unit);width:calc(100% + calc(2 * var(--unit)))}
1
+ ._collapsible_11zqc_1 summary{color:var(--color-primary);cursor:pointer;list-style:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}._collapsible_11zqc_1 summary span{float:right;transition:transform var(--transition-duration) var(--transition-timing-function);vertical-align:inherit}._collapsible_11zqc_1[open]>summary span{transform:rotateX(180deg)}
@@ -1 +1 @@
1
- ._collapsible_x7hng_1 summary{color:var(--color-primary);cursor:pointer;list-style:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}._collapsible_x7hng_1 summary span{transition:transform var(--transition-duration) var(--transition-timing-function);vertical-align:inherit}._collapsible_x7hng_1[open]>summary span{transform:rotateX(180deg)}
1
+ ._croppable_1ykk4_1{align-items:center;background-color:var(--color-neutral);display:flex;justify-content:center;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:100%}._croppable_1ykk4_1 input[type=file]{display:none}._empty_1ykk4_14{align-items:center;display:flex;flex-direction:column;gap:var(--unit);text-align:center}._media_1ykk4_22{align-items:center;display:flex;height:100%;top:0;right:0;bottom:0;left:0;justify-content:center;position:absolute;transform:translate(var(--croppable-x, 0),var(--croppable-y, 0));width:100%}._overlay_1ykk4_33{align-items:center;display:flex;top:0;right:0;bottom:0;left:0;justify-content:center;position:absolute}._viewport_1ykk4_41{align-items:center;display:flex;height:var(--croppable-height, calc(12 * var(--unit)));justify-content:center;overflow:hidden;overscroll-behavior:none;position:relative;touch-action:none;width:100%}._draggable_1ykk4_53{cursor:grab}._dragging_1ykk4_57{cursor:grabbing}._inner_1ykk4_61{height:var(--croppable-image-height, 100%);transform:scale(var(--croppable-zoom, 1));transform-origin:center;width:var(--croppable-image-width, 100%)}._inner_1ykk4_61 img,._inner_1ykk4_61 picture,._inner_1ykk4_61 video{height:100%;user-drag:none;width:100%;-webkit-user-drag:none}._standalone_1ykk4_77{border-radius:var(--border-radius)}
@@ -1 +1 @@
1
- ._croppable_1mlwb_1{align-items:center;background-color:var(--color-neutral);display:flex;justify-content:center;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:100%}._croppable_1mlwb_1 input[type=file]{display:none}._croppable_1mlwb_1 figure>span{background-color:var(--color-fallback);font-size:var(--font-size-small)}._viewport_1mlwb_21{align-items:center;border-radius:var(--radius);display:flex;height:var(--croppable-height, calc(12 * var(--unit)));justify-content:center;overflow:hidden;overscroll-behavior:none;position:relative;touch-action:none;width:100%}._media_1mlwb_34{align-items:center;display:flex;height:100%;top:0;right:0;bottom:0;left:0;justify-content:center;position:absolute;transform:translate(var(--croppable-x, 0),var(--croppable-y, 0));width:100%}._draggable_1mlwb_45{cursor:grab}._dragging_1mlwb_49{cursor:grabbing}._inner_1mlwb_53{height:var(--croppable-image-height, 100%);transform:scale(var(--croppable-zoom, 1));transform-origin:center;width:var(--croppable-image-width, 100%)}._inner_1mlwb_53 img,._inner_1mlwb_53 picture,._inner_1mlwb_53 video{height:100%;user-drag:none;width:100%;-webkit-user-drag:none}
1
+ ._dropzone_1c44i_1{background-color:var(--color-white);border:1px dashed var(--color-border);border-radius:var(--border-radius);color:var(--color-primary);padding:var(--unit);text-align:center;transition:background-color var(--transition-duration) var(--transition-timing-function)}._dropzone_1c44i_1 label{cursor:pointer}._dropzone_1c44i_1 [data-component=icon]{margin-bottom:var(--unit)}._dropzone_1c44i_1._dragging_1c44i_18{background-color:var(--color-purple-light)}._dropzone_1c44i_1._minimal_1c44i_22{background-color:transparent;border:none;border-radius:0;cursor:pointer;padding:calc(var(--unit) - 2px);width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}._dropzone_1c44i_1._minimal_1c44i_22:hover{background-color:var(--color-surface-active)}._dropzone_1c44i_1._minimal_1c44i_22 [data-component=icon]{margin-bottom:0}
@@ -1 +1 @@
1
- ._dropzone_1737c_1{background-color:var(--color-white);border:1px dashed var(--color-border);border-radius:var(--border-radius);color:var(--color-primary);padding:var(--unit);text-align:center;transition:background-color var(--transition-duration) var(--transition-timing-function)}._dropzone_1737c_1 label{cursor:pointer}._dropzone_1737c_1 [data-component=icon]{margin-bottom:var(--unit)}._dropzone_1737c_1._dragging_1737c_18{background-color:var(--color-purple-light)}._dropzone_1737c_1._minimal_1737c_22{background-color:transparent;border:none;border-radius:0;cursor:pointer;opacity:var(--opacity-minimal);padding:calc(var(--unit) - 2px);transition:opacity var(--transition-duration) var(--transition-timing-function);width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}._dropzone_1737c_1._minimal_1737c_22:hover{background-color:var(--color-neutral-light);opacity:1}._dropzone_1737c_1._minimal_1737c_22 [data-component=icon]{margin-bottom:0}
1
+ ._editor_1gye0_1{background-color:var(--color-white);border:var(--border);border-radius:var(--border-radius);box-shadow:var(--shadow)}._editor_1gye0_1 [role=textbox]{border-radius:0 0 var(--border-radius) var(--border-radius);padding:var(--unit-small) var(--unit)}._editor_1gye0_1 img{max-width:100%}._meta_1gye0_17{align-items:center;display:grid;grid-template-columns:1fr auto auto;opacity:0;transition:all var(--transition-duration) var(--transition-timing-function)}._meta_1gye0_17._active_1gye0_24{border-top:var(--border);height:auto;opacity:1}._meta_1gye0_17 input{border-radius:0;width:100%}._bold_1gye0_36{font-weight:700}._italic_1gye0_40{font-style:italic}._link_1gye0_44{color:var(--color-primary);cursor:pointer;text-decoration:underline}._list_1gye0_50,._paragraph_1gye0_51{margin:var(--unit-small) 0}._list_1gye0_50{list-style-type:disc!important;padding-left:var(--unit-large)!important}
@@ -1 +1 @@
1
- ._editor_1vazb_1{background-color:var(--color-white);border:var(--border);border-radius:var(--border-radius);box-shadow:var(--shadow)}._editor_1vazb_1 [role=textbox]{border-radius:0 0 var(--border-radius) var(--border-radius);padding:var(--unit-small) var(--unit)}._editor_1vazb_1 img{max-width:100%}._meta_1vazb_17{align-items:center;border-top:var(--border);display:grid;grid-template-columns:1fr auto auto;opacity:0;transition:all var(--transition-duration) var(--transition-timing-function)}._meta_1vazb_17._active_1vazb_25{height:auto;opacity:1}._meta_1vazb_17 input{border-radius:0;width:100%}._toolbar_1vazb_36{background-color:var(--color-neutral-light);border-radius:var(--border-radius) var(--border-radius) 0 0;border-bottom:var(--border)}._toolbar_1vazb_36 button{border-left:var(--border);display:inline-block}._toolbar_1vazb_36 button:first-child{border-left:none}._toolbar_1vazb_36 button._active_1vazb_25{opacity:1}._bold_1vazb_55{font-weight:700}._italic_1vazb_59{font-style:italic}._link_1vazb_63{color:var(--color-primary);cursor:pointer;text-decoration:underline}._list_1vazb_69,._paragraph_1vazb_70{margin:var(--unit-small) 0}._list_1vazb_69{list-style-type:disc!important;padding-left:var(--unit-large)!important}
1
+ ._messages_17m85_1 ul{padding:var(--unit) 0;border-top:var(--border);border-bottom:var(--border);margin-bottom:0!important}._messages_17m85_1 form{background-color:var(--color-neutral-light);gap:0;flex-direction:row}._messages_17m85_1 form label{font-size:0}._messages_17m85_1 form textarea{border-radius:0 0 0 var(--border-radius);height:100%}._messages_17m85_1 form ._controls_17m85_23{align-self:end;height:-webkit-min-content;height:-moz-min-content;height:min-content}._messages_17m85_1 form ._controls_17m85_23 [data-component=dropzone]{border-top:var(--border)}._messages_17m85_1 form ._controls_17m85_23 button[type=submit]{border-top:var(--border);border-radius:0;border-bottom-right-radius:var(--border-radius);margin:0}
@@ -1 +1 @@
1
- ._messages_17m85_1 ul{padding:var(--unit) 0;border-top:var(--border);border-bottom:var(--border);margin-bottom:0!important}._messages_17m85_1 form{background-color:var(--color-neutral-light);gap:0;flex-direction:row}._messages_17m85_1 form label{font-size:0}._messages_17m85_1 form textarea{border-radius:0 0 0 var(--border-radius);height:100%}._messages_17m85_1 form ._controls_17m85_23{align-self:end;height:-webkit-min-content;height:-moz-min-content;height:min-content}._messages_17m85_1 form ._controls_17m85_23 [data-component=dropzone]{border-top:var(--border)}._messages_17m85_1 form ._controls_17m85_23 button[type=submit]{border-top:var(--border);border-radius:0;border-bottom-right-radius:var(--border-radius);margin:0}
1
+ @keyframes _reveal_dr33h_1{0%{opacity:0}to{opacity:1}}@property --portal-left{syntax: "<color>"; inherits: true; initial-value: white;}@property --portal-middle{syntax: "<color>"; inherits: true; initial-value: white;}@property --portal-right{syntax: "<color>"; inherits: true; initial-value: white;}._menu_dr33h_29{height:calc(100vh - var(--unit) * 2);padding:var(--unit);position:-webkit-sticky;position:sticky;top:0;-webkit-user-select:none;-moz-user-select:none;user-select:none;z-index:1}._menu_dr33h_29>summary{cursor:pointer;left:var(--unit-large);list-style:none;position:absolute;top:var(--unit-large);transition:all var(--transition-duration) var(--transition-timing-function);z-index:2}._menu_dr33h_29[open]>summary>span{background-color:#fff}._portal_dr33h_54{--portal-left: #073345;--portal-middle: #015e78;--portal-right: #073345;background:linear-gradient(180deg,var(--portal-left),var(--portal-middle),var(--portal-right));animation:_reveal_dr33h_1 var(--transition-duration) var(--transition-timing-function);border-radius:var(--border-radius);color:#fff;height:calc(100vh - var(--unit) * 2);padding:var(--unit);padding-top:var(--unit-large);transition:border-radius var(--transition-duration) var(--transition-timing-function),height var(--transition-duration) var(--transition-timing-function),margin var(--transition-duration) var(--transition-timing-function),--portal-left var(--transition-duration-long) var(--transition-timing-function),--portal-middle var(--transition-duration-long) var(--transition-timing-function),--portal-right var(--transition-duration-long) var(--transition-timing-function);width:calc(var(--unit) * 16)}._portal_dr33h_54:has(nav [data-portal=blue][data-active]),._portal_dr33h_54:has(nav [data-portal=blue][aria-current=page]){--portal-left: #073345;--portal-middle: #015e78;--portal-right: #073345}._portal_dr33h_54:has(nav [data-portal=green][data-active]),._portal_dr33h_54:has(nav [data-portal=green][aria-current=page]){--portal-left: #022c22;--portal-middle: #064e3b;--portal-right: #022c22}._portal_dr33h_54:has(nav [data-portal=red][data-active]),._portal_dr33h_54:has(nav [data-portal=red][aria-current=page]){--portal-left: #431407;--portal-middle: #7c2d12;--portal-right: #431407}._portal_dr33h_54 figure{display:flex;justify-self:center}._portal_dr33h_54 figure figcaption{display:none}._portal_dr33h_54 nav{flex:1 1 auto}._portal_dr33h_54 nav a,._portal_dr33h_54 nav summary{color:var(--color-white);padding:var(--unit-small) 0;text-decoration:none;font-weight:var(--font-weight-normal)}._portal_dr33h_54 nav a span,._portal_dr33h_54 nav summary span{background-color:var(--color-white);margin-bottom:var(--unit-tiny);margin-right:var(--unit-small)}._portal_dr33h_54 nav a[aria-current=page],._portal_dr33h_54 nav summary[aria-current=page]{font-weight:var(--font-weight-bold)}._portal_dr33h_54 nav details a{margin-left:var(--unit);padding-left:var(--unit);position:relative;width:100%}._portal_dr33h_54 nav details a:before{background-color:var(--color-white);border-radius:4px;content:"​";display:inline-block;height:100%;left:calc(-1 * var(--unit-tiny) - 1px);position:absolute;top:0;transition:width var(--transition-duration);width:2px}._portal_dr33h_54 nav details a[aria-current=page]:before{left:calc(-1 * var(--unit-tiny) - 2px);width:4px}._portal_dr33h_54 nav details a:hover{color:var(--color-white)}._portal_dr33h_54 nav details a:last-child{margin-bottom:var(--unit)}._portal_dr33h_54 nav[data-orientation=horizontal]{align-items:center;display:flex;justify-self:center;padding-bottom:var(--unit)}._portal_dr33h_54 nav[data-orientation=horizontal] a{font-size:var(--font-size-small);padding:var(--unit-small);transition:all}._portal_dr33h_54 nav[data-orientation=horizontal] a[data-active]{border-bottom:solid 2px var(--color-white);font-size:var(--font-size)}._portal_dr33h_54 nav[data-orientation=horizontal] a:hover{color:var(--color-white);text-decoration:none}._portal_dr33h_54 select{background-color:#ffffff1a;border:none;box-shadow:none;filter:invert(1);margin-bottom:var(--unit);padding-bottom:var(--unit-small);padding-top:var(--unit-small);width:100%}._portal_dr33h_54 select:active,._portal_dr33h_54 select:focus{outline:none}@media (width <= 960px){._menu_dr33h_29{padding:0}._menu_dr33h_29>summary{left:var(--unit);top:var(--unit)}._portal_dr33h_54{border-radius:0;margin:0;height:100vh;position:fixed;top:0}._portal_dr33h_54 footer{bottom:var(--unit)}}
@@ -1 +1 @@
1
- @keyframes _reveal_v7gyu_1{0%{opacity:0}to{opacity:1}}@property --portal-left{syntax: "<color>"; inherits: true; initial-value: white;}@property --portal-middle{syntax: "<color>"; inherits: true; initial-value: white;}@property --portal-right{syntax: "<color>"; inherits: true; initial-value: white;}._menu_v7gyu_29{height:calc(100vh - var(--unit) * 2);padding:var(--unit);position:-webkit-sticky;position:sticky;top:0;-webkit-user-select:none;-moz-user-select:none;user-select:none;z-index:1}._menu_v7gyu_29>summary{cursor:pointer;left:var(--unit-large);list-style:none;position:absolute;top:var(--unit-large);transition:all var(--transition-duration) var(--transition-timing-function);z-index:2}._menu_v7gyu_29[open]>summary>span{background-color:#fff}._portal_v7gyu_54{--portal-left: #073345;--portal-middle: #015e78;--portal-right: #073345;background:linear-gradient(180deg,var(--portal-left),var(--portal-middle),var(--portal-right));animation:_reveal_v7gyu_1 var(--transition-duration) var(--transition-timing-function);border-radius:var(--border-radius);color:#fff;height:calc(100vh - var(--unit) * 2);padding:var(--unit);padding-top:var(--unit-large);transition:border-radius var(--transition-duration) var(--transition-timing-function),height var(--transition-duration) var(--transition-timing-function),margin var(--transition-duration) var(--transition-timing-function),--portal-left var(--transition-duration-long) var(--transition-timing-function),--portal-middle var(--transition-duration-long) var(--transition-timing-function),--portal-right var(--transition-duration-long) var(--transition-timing-function);width:calc(var(--unit) * 16)}._portal_v7gyu_54:has(nav [data-portal=blue][data-active]),._portal_v7gyu_54:has(nav [data-portal=blue][aria-current=page]){--portal-left: #073345;--portal-middle: #015e78;--portal-right: #073345}._portal_v7gyu_54:has(nav [data-portal=green][data-active]),._portal_v7gyu_54:has(nav [data-portal=green][aria-current=page]){--portal-left: #022c22;--portal-middle: #064e3b;--portal-right: #022c22}._portal_v7gyu_54:has(nav [data-portal=red][data-active]),._portal_v7gyu_54:has(nav [data-portal=red][aria-current=page]){--portal-left: #431407;--portal-middle: #7c2d12;--portal-right: #431407}._portal_v7gyu_54 figure{display:flex;justify-self:center}._portal_v7gyu_54 figure figcaption{display:none}._portal_v7gyu_54 footer{bottom:var(--unit-large);position:fixed;transition:all var(--transition-duration) var(--transition-timing-function)}._portal_v7gyu_54 nav{flex:1 1 auto}._portal_v7gyu_54 nav a,._portal_v7gyu_54 nav summary{color:var(--color-white);padding:var(--unit-small) 0;text-decoration:none;font-weight:var(--font-weight-normal)}._portal_v7gyu_54 nav a span,._portal_v7gyu_54 nav summary span{background-color:var(--color-white);margin-bottom:var(--unit-tiny);margin-right:var(--unit-small)}._portal_v7gyu_54 nav a[aria-current=page],._portal_v7gyu_54 nav summary[aria-current=page]{font-weight:var(--font-weight-bold)}._portal_v7gyu_54 nav details a{margin-left:var(--unit);padding-left:var(--unit);position:relative;width:100%}._portal_v7gyu_54 nav details a:before{background-color:var(--color-white);border-radius:4px;content:"​";display:inline-block;height:100%;left:calc(-1 * var(--unit-tiny) - 1px);position:absolute;top:0;transition:width var(--transition-duration);width:2px}._portal_v7gyu_54 nav details a[aria-current=page]:before{left:calc(-1 * var(--unit-tiny) - 2px);width:4px}._portal_v7gyu_54 nav details a:hover{color:var(--color-white)}._portal_v7gyu_54 nav details a:last-child{margin-bottom:var(--unit)}._portal_v7gyu_54 nav[data-orientation=horizontal]{align-items:center;display:flex;justify-self:center;padding-bottom:var(--unit)}._portal_v7gyu_54 nav[data-orientation=horizontal] a{font-size:var(--font-size-small);padding:var(--unit-small);transition:all}._portal_v7gyu_54 nav[data-orientation=horizontal] a[data-active]{border-bottom:solid 2px var(--color-white);font-size:var(--font-size)}._portal_v7gyu_54 nav[data-orientation=horizontal] a:hover{color:var(--color-white);text-decoration:none}._portal_v7gyu_54 select{background-color:#ffffff1a;border:none;box-shadow:none;filter:invert(1);margin-bottom:var(--unit);padding-bottom:var(--unit-small);padding-top:var(--unit-small);width:100%}._portal_v7gyu_54 select:active,._portal_v7gyu_54 select:focus{outline:none}@media (width <= 960px){._menu_v7gyu_29{padding:0}._menu_v7gyu_29>summary{left:var(--unit);top:var(--unit)}._portal_v7gyu_54{border-radius:0;margin:0;height:100vh;position:fixed;top:0}._portal_v7gyu_54 footer{bottom:var(--unit)}}
1
+ ._sortable_178uo_1 li{cursor:grab}
@@ -1 +1 @@
1
- ._sortable_178uo_1 li{cursor:grab}
1
+ ._toasts_19qwq_1{align-items:right;display:flex;flex-direction:column;justify-content:space-around;pointer-events:none;position:fixed;top:0;right:0;z-index:3}._toasts_19qwq_1>*{pointer-events:auto}
@@ -1 +1 @@
1
- ._toasts_m9a8k_1{bottom:0;display:flex;flex-direction:column;left:50%;pointer-events:none;position:fixed;transform:translate(-50%);z-index:3}._toasts_m9a8k_1>*{pointer-events:auto}
1
+ ._widget_1dptd_1 ol,._widget_1dptd_1 ul{max-height:80vh;overflow-y:auto;padding:0 var(--unit-small);scrollbar-track-color:rgba(0 0 0 / 0%);scrollbar-width:thin}
@@ -1 +1 @@
1
- ._widget_1dptd_1 ol,._widget_1dptd_1 ul{max-height:80vh;overflow-y:auto;padding:0 var(--unit-small);scrollbar-track-color:rgba(0 0 0 / 0%);scrollbar-width:thin}
1
+ ._accordion_8spz8_1 summary{cursor:pointer;list-style:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}
@@ -1 +1 @@
1
- ._aside_62bt8_1{background-color:var(--color-white)}._aside_62bt8_1 footer{position:absolute;bottom:0}._aside_62bt8_1 section{padding:var(--unit) 0}._meta_62bt8_14{min-height:100vh;padding:var(--unit)}._meta_62bt8_14 [data-component=croppable]{margin:var(--negative-unit);margin-bottom:var(--unit);width:calc(100% + calc(2 * var(--unit)))}._meta_62bt8_14 a{text-decoration:none}._meta_62bt8_14 a:hover,._meta_62bt8_14 a:focus{text-decoration:underline}._meta_62bt8_14 section:has(+section){border-bottom:var(--border-width) solid var(--color-border-primary)}._sticky_62bt8_38{position:-webkit-sticky;position:sticky;top:0}
1
+ ._aside_tkb2t_1{background-color:var(--color-white)}._aside_tkb2t_1 footer{position:absolute;bottom:0}._aside_tkb2t_1 section{padding:var(--unit) 0}._meta_tkb2t_14{min-height:100vh;padding:var(--unit)}._meta_tkb2t_14 [data-component=croppable]{border-radius:var(--unit);margin-top:calc(var(--unit) * 4)}._meta_tkb2t_14 [data-component=croppable] div{border-radius:var(--unit)}._meta_tkb2t_14 a{text-decoration:none}._meta_tkb2t_14 a:hover,._meta_tkb2t_14 a:focus{text-decoration:underline}._meta_tkb2t_14 section:has(+section){border-bottom:var(--border-width) solid var(--color-border-primary)}._sticky_tkb2t_41{position:-webkit-sticky;position:sticky;top:0}
@@ -1 +1 @@
1
- ._button_1rij4_1{align-items:center;background-color:var(--color-neutral);border-radius:var(--border-radius);border:none;box-shadow:var(--shadow);color:var(--color-outer-space);display:inline;font-weight:var(--font-weight-semibold);padding:calc(var(--unit) - 2px);transition:all var(--transition-duration) var(--transition-timing-function)}._button_1rij4_1:disabled{cursor:not-allowed;opacity:.5}._button_1rij4_1:not([disabled]):hover{background-color:var(--color-neutral-light)}._danger_1rij4_23{background-color:var(--color-red);color:var(--color-white)}._danger_1rij4_23:not([disabled]):hover{background-color:var(--color-mahogany)}._danger_1rij4_23 span{margin-left:var(--unit-small)}._minimal_1rij4_36{background:none;border-radius:0;border:none;box-shadow:none;opacity:var(--opacity-minimal)}._minimal_1rij4_36:not([disabled]):hover{opacity:1}._primary_1rij4_48{background-color:var(--color-primary);color:var(--color-white)}._primary_1rij4_48:not([disabled]):hover{background-color:var(--color-primary-dark)}
1
+ ._button_18c17_1{align-items:center;background-color:var(--color-neutral-light);border-radius:var(--border-radius);border:none;box-shadow:var(--shadow);color:var(--color-outer-space);display:inline;font-weight:var(--font-weight-semibold);padding:calc(var(--unit) - 2px);transition:all var(--transition-duration) var(--transition-timing-function)}._button_18c17_1:disabled{cursor:not-allowed;opacity:.5}._danger_18c17_19{background-color:var(--color-red);color:var(--color-white)}._danger_18c17_19:not([disabled]):hover{background-color:var(--color-mahogany)}._danger_18c17_19 span{margin-left:var(--unit-small)}._minimal_18c17_32{background-color:transparent;border-radius:0;border:none;box-shadow:none}._primary_18c17_39{background-color:var(--color-primary);color:var(--color-white)}._primary_18c17_39:not([disabled]):hover{background-color:var(--color-primary-dark)}
@@ -1 +1 @@
1
- ._form_1by0q_1{display:flex;flex-direction:column;gap:var(--unit)}._form_1by0q_1 input,._form_1by0q_1 select,._form_1by0q_1 label{width:100%}._form_1by0q_1 label span{margin-bottom:var(--unit-small)}._inline_1by0q_17 input,._inline_1by0q_17 textarea{border:none;border-radius:inherit;box-shadow:none;font-size:inherit;font-weight:inherit;line-height:inherit;margin:0;outline:0;padding:0}
1
+ ._form_zvyrv_1{display:flex;flex-direction:column;gap:var(--unit)}._form_zvyrv_1 input,._form_zvyrv_1 select,._form_zvyrv_1 label{width:100%}._form_zvyrv_1 label span{margin-bottom:var(--unit-small)}._form_zvyrv_1 section{margin:var(--unit) 0}._inline_zvyrv_21 input,._inline_zvyrv_21 textarea{border:none;border-radius:inherit;box-shadow:none;font-size:inherit;font-weight:inherit;line-height:inherit;margin:0;outline:0;padding:0}
@@ -1 +1 @@
1
- ._list_kllf6_1{display:grid;gap:var(--unit);list-style-type:none;-webkit-margin-before:0;margin-block-start:0}._list_kllf6_1 li{list-style:none;padding-left:0}._list_kllf6_1 li li{margin-left:var(--unit)}._list_kllf6_1 li>section{border-bottom:var(--border-width) solid var(--color-border-primary)}._list_kllf6_1 li>section:first-child{border-top:var(--border-width) solid var(--color-border-primary)}._list_kllf6_1 li>section:last-of-type{border-bottom:none}._columns_kllf6_29{-moz-column-gap:var(--unit);column-gap:var(--unit);display:grid;grid-template-columns:repeat(var(--list-columns, 2),minmax(0,1fr))}._horizontal_kllf6_35{display:block;max-width:100%}._horizontal_kllf6_35 li{display:inline-block;margin:0 var(--unit) var(--unit) 0;max-width:100%}@media (width <= 960px){._columns_kllf6_29{grid-template-columns:1fr}}
1
+ ._horizontal_1459r_1{display:block;max-width:100%}._horizontal_1459r_1 li{display:inline-block;margin:0 var(--unit) var(--unit) 0;max-width:100%}._list_1459r_12{display:grid;gap:var(--unit);list-style-type:none;-webkit-margin-before:0;margin-block-start:0}._list_1459r_12 li{list-style:none;padding-left:0}._list_1459r_12 li>li,._list_1459r_12 li>details li{margin-left:var(--unit)}._list_1459r_12 li>section{border-bottom:var(--border-width) solid var(--color-border-primary)}._list_1459r_12 li>section:first-child{border-top:var(--border-width) solid var(--color-border-primary)}._list_1459r_12 li>section:last-of-type{border-bottom:none}._columns_1459r_41{-moz-column-gap:var(--unit);column-gap:var(--unit);display:grid;grid-template-columns:repeat(var(--list-columns, 2),minmax(0,1fr))}@media (width <= 960px){._columns_1459r_41{grid-template-columns:1fr}}
@@ -1 +1 @@
1
- ._nav_1g1sp_1 a{display:block}._horizontal_1g1sp_7 a,._horizontal_1g1sp_7 li{display:inline-block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}._tabs_1g1sp_17{@extend .horizontal;border-bottom:var(--border-width) solid var(--color-border-primary);display:flex;gap:var(--unit)}._tabs_1g1sp_17 a,._tabs_1g1sp_17 li{color:var(--color-outer-space);font-weight:var(--font-weight-semibold);padding:var(--unit-tiny) var(--unit-micro) var(--unit-small) var(--unit-micro);text-decoration:none}._tabs_1g1sp_17 a[aria-current=page],._tabs_1g1sp_17 li[aria-current=page]{color:var(--color-electric-violet);border-bottom:var(--border-width) solid var(--color-electric-violet)}._pills_1g1sp_38{@extend .horizontal;background-color:var(--color-translucent);-webkit-backdrop-filter:blur(var(--unit-small));backdrop-filter:blur(var(--unit-small));border-radius:var(--border-radius-large);border:var(--border-width-heavy) solid var(--color-white);box-shadow:var(--shadow-big);display:flex;margin:0 auto;position:-webkit-sticky;position:sticky;top:var(--unit);width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;z-index:1}._pills_1g1sp_38:before{content:"";background:var(--color-electric-violet);border-radius:var(--border-radius-large);inset-block:0;left:anchor(left);position-anchor:--current;position:absolute;transition:left var(--transition-duration) var(--transition-timing-function),width var(--transition-duration) var(--transition-timing-function);width:anchor-size(width);z-index:0}._pills_1g1sp_38 a{border-radius:var(--unit);color:var(--color-primary);display:inline-block;font-weight:var(--font-weight-bold);padding:var(--unit);position:relative;text-decoration:none;text-overflow:ellipsis;transition:color var(--transition-duration) var(--transition-timing-function),padding var(--transition-duration) var(--transition-timing-function);white-space:nowrap;z-index:2}._pills_1g1sp_38 a[aria-current=page]{anchor-name:--current;color:var(--color-white)}._pills_1g1sp_38 a[aria-current=page]:hover{color:var(--color-white)}@supports not (position-anchor: --x){._pills_1g1sp_38:before{content:""}._pills_1g1sp_38 [aria-current=page]:before{background:var(--color-electric-violet);content:"";position:absolute;transition:all var(--transition-duration) linear;z-index:-1}}@media (width <= 1024px){._pills_1g1sp_38 a{padding:var(--unit-small)}}
1
+ ._nav_6dj6b_1 a{display:block}._horizontal_6dj6b_7 a,._horizontal_6dj6b_7 li{display:inline-block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}._tabs_6dj6b_17{@extend .horizontal;border-bottom:var(--border-width) solid var(--color-border-primary);display:flex;gap:var(--unit)}._tabs_6dj6b_17 a,._tabs_6dj6b_17 li{color:var(--color-outer-space);font-weight:var(--font-weight-semibold);padding:var(--unit-tiny) var(--unit-micro) var(--unit-small) var(--unit-micro);text-decoration:none}._tabs_6dj6b_17 a[aria-current=page],._tabs_6dj6b_17 li[aria-current=page]{color:var(--color-electric-violet);border-bottom:var(--border-width) solid var(--color-electric-violet)}._pills_6dj6b_38{background-color:var(--color-translucent);-webkit-backdrop-filter:blur(var(--unit-small));backdrop-filter:blur(var(--unit-small));border-radius:var(--border-radius-large);border:var(--border-width-heavy) solid var(--color-white);box-shadow:var(--shadow-big);display:flex;margin:0 auto;position:-webkit-sticky;position:sticky;top:var(--unit);width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;z-index:1}._pills_6dj6b_38:has(>:only-child){display:none}._pills_6dj6b_38:before{content:"";background:var(--color-electric-violet);border-radius:var(--border-radius-large);inset-block:0;left:anchor(left);position-anchor:--current;position:absolute;transition:left var(--transition-duration) var(--transition-timing-function),top var(--transition-duration) var(--transition-timing-function),width var(--transition-duration) var(--transition-timing-function);width:anchor-size(width);z-index:0}._pills_6dj6b_38 a{border-radius:var(--unit);color:var(--color-primary);display:inline-block;font-weight:var(--font-weight-bold);padding:var(--unit);position:relative;text-decoration:none;text-overflow:ellipsis;transition:color var(--transition-duration) var(--transition-timing-function),padding var(--transition-duration) var(--transition-timing-function);white-space:nowrap;z-index:2}._pills_6dj6b_38 a[aria-current=page]{anchor-name:--current;color:var(--color-white)}._pills_6dj6b_38 a[aria-current=page]:hover{color:var(--color-white)}@media (width <= 960px){._pills_6dj6b_38{flex-direction:column}._pills_6dj6b_38 a:not([aria-current=page]){display:none}._pills_6dj6b_38 a[aria-current=page]:after{background-color:var(--color-white);content:"";display:inline-block;height:var(--unit);margin-left:var(--unit-small);-webkit-mask-image:var(--icon-svg);mask-image:var(--icon-svg);-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:contain;mask-size:contain;transition:transform var(--transition-duration) var(--transition-timing-function);vertical-align:middle;width:var(--unit)}._pills_6dj6b_38:before{top:anchor(top);bottom:anchor(bottom);min-height:calc(var(--unit) * 2)}._pills_6dj6b_38:focus-within a{display:block}._pills_6dj6b_38:focus-within a[aria-current=page]:after{transform:rotateX(180deg)}}@supports not (position-anchor: --x){._pills_6dj6b_38:before{content:""}._pills_6dj6b_38 [aria-current=page]:before{background:var(--color-electric-violet);content:"";position:absolute;transition:all var(--transition-duration) linear;z-index:-1}}
@@ -1 +1 @@
1
- ._label_ec2gr_1{display:block}._textarea_ec2gr_5{field-sizing:content;font-size:var(--font-size);height:auto;min-height:calc((var(--min-rows) * var(--unit) * 1.25) + (2 * var(--unit)));max-height:calc((var(--max-rows) * var(--unit) * 1.25) + (2 * var(--unit)));overflow-y:auto;overscroll-behavior:contain;resize:none;transition:height var(--transition-duration) var(--transition-timing-function);width:100%;word-break:break-word}
1
+ ._label_b5yys_1{display:block}._textarea_b5yys_5{field-sizing:content;font-size:var(--font-size);height:auto;min-height:calc((var(--min-rows) * var(--unit) * 1.25) + (2 * var(--unit)));max-height:calc((var(--max-rows) * var(--unit) * 1.25) + (2 * var(--unit)));overflow-y:auto;resize:none;transition:height var(--transition-duration) var(--transition-timing-function);width:100%;word-break:break-word}
@@ -1 +1 @@
1
- ._toast_h2jok_1{align-items:center;border-radius:var(--border-radius);box-shadow:var(--shadow);cursor:pointer;display:flex;gap:var(--unit);margin:var(--unit);margin-top:0;opacity:0;overflow:hidden;padding:var(--unit);transform:translateY(var(--unit-large));transition:all var(--transition-duration-long) var(--transition-timing-function);-webkit-user-select:none;-moz-user-select:none;user-select:none}._active_h2jok_18{opacity:1;padding:var(--unit);transform:translateY(0)}._error_h2jok_24{background-color:var(--color-red)}._info_h2jok_28{background-color:var(--color-neutral);color:var(--color-text-secondary)}._success_h2jok_33{background-color:var(--color-green)}._error_h2jok_24,._success_h2jok_33{color:var(--color-white)}._error_h2jok_24>span,._success_h2jok_33>span{background-color:var(--color-white)}
1
+ ._toast_tav58_1{align-items:center;border-radius:var(--border-radius);box-shadow:var(--shadow);cursor:pointer;display:flex;gap:var(--unit);margin:var(--unit);margin-bottom:0;opacity:0;overflow:hidden;padding:var(--unit);transform:translateY(var(--negative-unit-large));transition:all var(--transition-duration-long) var(--transition-timing-function);-webkit-user-select:none;-moz-user-select:none;user-select:none}._active_tav58_18{opacity:1;padding:var(--unit);transform:translateY(0)}._error_tav58_24{background-color:var(--color-red)}._info_tav58_28{background-color:var(--color-neutral);color:var(--color-text-secondary)}._success_tav58_33{background-color:var(--color-green)}._error_tav58_24,._success_tav58_33{color:var(--color-white)}._error_tav58_24>span,._success_tav58_33>span{background-color:var(--color-white)}
@@ -0,0 +1 @@
1
+ ._toolbar_104fz_1{-webkit-backdrop-filter:blur(var(--unit-tiny));backdrop-filter:blur(var(--unit-tiny));background-color:var(--color-translucent);border:var(--border-width) solid var(--color-border);border-radius:var(--border-radius);position:absolute;right:var(--unit-tiny);top:var(--unit-tiny)}._toolbar_104fz_1 [data-component=button][data-active=true]{background-color:var(--color-surface-active);box-shadow:inset 0 0 2px var(--color-primary-dark)}._toolbar_104fz_1 [data-component=button][data-active=true] [data-component=icon]{background-color:var(--color-primary-dark)}._toolbar_104fz_1 [data-component=button]:not([disabled]):hover{background-color:var(--color-surface-active)}._default_104fz_26 button{border-radius:var(--border-radius);display:inline-block}._editor_104fz_33{background-color:var(--color-neutral-light);border:none;border-bottom:var(--border-width) solid var(--color-border);border-radius:var(--border-radius) var(--border-radius) 0 0;overflow:hidden;position:initial;right:0;top:0}._editor_104fz_33 button{display:inline-block}._editor_104fz_33 button:first-child{border-top-left-radius:var(--border-radius)}
@@ -1 +1 @@
1
- @view-transition{navigation: auto;}body,html{background-color:var(--color-wild-sand);box-sizing:border-box;align-items:center;margin:0;scroll-behavior:smooth;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}._layout_erqhv_16{margin:0 auto;opacity:1;transition:opacity var(--transition-duration) var(--transition-timing-function),width var(--transition-duration) var(--transition-timing-function);width:100%}@media (width >= 960px){._layout_erqhv_16[data-public]{padding:0 0 0 var(--unit-large)}}._layout_erqhv_16._dashboard_erqhv_30{padding-right:var(--unit)}._layout_erqhv_16._home_erqhv_34{-moz-column-gap:var(--unit-large);column-gap:var(--unit-large);display:grid;grid-template-columns:1fr calc(20 * var(--unit));position:relative;width:calc(64 * var(--unit));z-index:0}._layout_erqhv_16._home_erqhv_34:after{background:#fff;bottom:0;content:"";pointer-events:none;position:fixed;right:0;top:0;width:max(0px,calc((100vw - calc(64 * var(--unit))) / 2));z-index:-1}._layout_erqhv_16._home_erqhv_34>div{width:100%}._layout_erqhv_16._home_erqhv_34>div>article{margin:calc(3 * var(--unit)) auto;max-width:calc(40 * var(--unit));width:100%}._layout_erqhv_16._home_erqhv_34>div>article nav{margin:var(--unit) 0}._layout_erqhv_16 form{max-width:calc(40 * var(--unit))}@media (width > 1280px){._layout_erqhv_16._home_erqhv_34{-moz-column-gap:calc(4 * var(--unit));column-gap:calc(4 * var(--unit))}}@media (width <= 960px){body{background:var(--color-wild-sand)}._layout_erqhv_16{padding-left:var(--unit);padding-right:var(--unit);padding-top:calc(var(--unit) * 4)}._layout_erqhv_16._home_erqhv_34{grid-template-columns:1fr;grid-template-rows:auto auto;row-gap:var(--unit)}._layout_erqhv_16._home_erqhv_34>aside{background-color:transparent;min-height:auto;padding-top:0}._layout_erqhv_16._home_erqhv_34>aside figure{display:none}._layout_erqhv_16._home_erqhv_34>article{margin-bottom:calc(var(--unit) * 3);margin-top:calc(var(--unit) * 3);max-width:100vw}}
1
+ @view-transition{navigation: auto;}body,html{background-color:var(--color-wild-sand);box-sizing:border-box;align-items:center;margin:0;scroll-behavior:smooth;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}._layout_pbwv9_16{margin:0 auto;opacity:1;transition:opacity var(--transition-duration) var(--transition-timing-function),width var(--transition-duration) var(--transition-timing-function);width:100%}@media (width >= 960px){._layout_pbwv9_16[data-public]{padding:0 0 0 var(--unit-large)}}._layout_pbwv9_16._dashboard_pbwv9_30{padding-right:var(--unit)}._layout_pbwv9_16._home_pbwv9_34{-moz-column-gap:var(--unit-large);column-gap:var(--unit-large);display:grid;grid-template-columns:1fr calc(20 * var(--unit));position:relative;width:calc(96 * var(--unit));z-index:0}._layout_pbwv9_16._home_pbwv9_34:after{background:#fff;bottom:0;content:"";pointer-events:none;position:fixed;right:0;top:0;width:max(0px,calc((100vw - calc(96 * var(--unit))) / 2));z-index:-1}._layout_pbwv9_16._home_pbwv9_34>div{width:100%}._layout_pbwv9_16._home_pbwv9_34>div>article{margin:calc(3 * var(--unit)) auto;max-width:calc(40 * var(--unit));width:100%}._layout_pbwv9_16._home_pbwv9_34>div>article nav{margin:var(--unit) 0}._layout_pbwv9_16 form{max-width:calc(40 * var(--unit))}@media (width > 1280px){._layout_pbwv9_16._home_pbwv9_34{-moz-column-gap:calc(4 * var(--unit));column-gap:calc(4 * var(--unit))}}@media (width <= 960px){body{background:var(--color-wild-sand)}._layout_pbwv9_16{padding-left:var(--unit);padding-right:var(--unit);padding-top:calc(var(--unit) * 4)}._layout_pbwv9_16._home_pbwv9_34{grid-template-columns:1fr;grid-template-rows:auto auto;row-gap:var(--unit)}._layout_pbwv9_16._home_pbwv9_34>aside{background-color:transparent;margin-top:calc(-1 * calc(var(--unit) * 3));min-height:auto;padding-top:0;padding-bottom:calc(6 * var(--unit))}._layout_pbwv9_16._home_pbwv9_34>aside figure{display:none}._layout_pbwv9_16._home_pbwv9_34>article{margin-bottom:calc(var(--unit) * 3);margin-top:calc(var(--unit) * 3);max-width:100vw}}
@@ -1 +1 @@
1
- ._header_fh66b_1{color:var(--color-text-primary);font-weight:var(--font-weight-bold)}._header_fh66b_1>*{display:block}._header_fh66b_1 h1{font-size:var(--font-size-h1);letter-spacing:-1.2px}._header_fh66b_1 h2,._header_fh66b_1 sup{font-size:var(--font-size-h2)}._header_fh66b_1 h3{font-size:var(--font-size-h3)}._header_fh66b_1 sub{font-weight:var(--font-weight-normal);margin-top:var(--negative-unit)}._header_fh66b_1 sup{margin-bottom:var(--negative-unit)}._header_fh66b_1 sub,._header_fh66b_1 sup{color:var(--color-text-secondary)}._header_fh66b_1 [data-component=badge]{float:right;font-size:var(--font-size);font-weight:var(--font-weight-normal);margin:0}@media (width >= 960px){._jumbo_fh66b_46{margin:calc(var(--unit) * 3) 0}._jumbo_fh66b_46 h1{font-size:calc(var(--unit) * 4);letter-spacing:-2.4px;line-height:1.2em}}
1
+ ._header_kd9kp_1{color:var(--color-text-primary);font-weight:var(--font-weight-bold)}._header_kd9kp_1>*{display:block}._header_kd9kp_1 h1{font-size:var(--font-size-h1);letter-spacing:-1.2px}._header_kd9kp_1 h2,._header_kd9kp_1 sup{font-size:var(--font-size-h2)}._header_kd9kp_1 h3{font-size:var(--font-size-h3)}._header_kd9kp_1 sub{font-weight:var(--font-weight-normal);margin-top:var(--negative-unit)}._header_kd9kp_1 sup{margin-bottom:var(--negative-unit)}._header_kd9kp_1 sub,._header_kd9kp_1 sup{color:var(--color-text-secondary)}._header_kd9kp_1 [data-component=badge]{float:right;font-size:var(--font-size);font-weight:var(--font-weight-normal);margin:0}._header_kd9kp_1 [data-component=toggle]{float:right}@media (width >= 960px){._jumbo_kd9kp_50{margin:calc(var(--unit) * 3) 0}._jumbo_kd9kp_50 h1{font-size:calc(var(--unit) * 4);letter-spacing:-2.4px;line-height:1.2em}}
@@ -1 +1 @@
1
- ._container_1qx20_1:has(input[type=radio]),._container_1qx20_1:has(input[type=checkbox]){align-items:center;display:flex;flex-direction:row-reverse;gap:var(--unit);justify-content:start}._input_1qx20_10{border:var(--border);border-radius:var(--border-radius);box-shadow:var(--shadow);color:var(--color-text-primary);font-size:var(--font-size);padding:var(--unit);padding-top:calc(var(--unit) - 1px);transition:border var(--transition-duration) var(--transition-timing-function)}._input_1qx20_10::-moz-placeholder{color:var(--color-placeholder-text)}._input_1qx20_10::placeholder{color:var(--color-placeholder-text)}._input_1qx20_10[type=datetime-local]{border:var(--border);border-radius:var(--border-radius);padding:var(--unit)}._input_1qx20_10[type=radio]{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:var(--color-dark);border:solid var(--unit-tiny) var(--color-dark);padding:0;height:var(--unit);width:var(--unit)}._input_1qx20_10[type=radio]:checked{background-color:var(--color-white);border-color:var(--color-electric-violet)}._label_1qx20_45{display:block}._required_1qx20_49:after{content:"*";color:var(--color-mahogany);font-size:calc(var(--unit) * 1.5);position:relative;left:var(--unit-tiny);top:var(--unit-tiny)}input[type=text][placeholder="+47"]{margin-right:var(--unit-small);width:calc(5 * var(--unit))}input[type=text][placeholder="+47"]+input[type=tel]{width:calc(100% - (5 * var(--unit) + var(--unit-small)))}
1
+ ._container_11w26_1:has(input[type=radio]),._container_11w26_1:has(input[type=checkbox]){align-items:center;display:flex;flex-direction:row-reverse;gap:var(--unit);justify-content:start}._input_11w26_10{border:var(--border);border-radius:var(--border-radius);box-shadow:var(--shadow);color:var(--color-text-primary);font-size:var(--font-size);padding:var(--unit);padding-top:calc(var(--unit) - 1px);transition:border var(--transition-duration) var(--transition-timing-function)}._input_11w26_10::-moz-placeholder{color:var(--color-placeholder-text)}._input_11w26_10::placeholder{color:var(--color-placeholder-text)}._input_11w26_10[type=datetime-local]{border:var(--border);border-radius:var(--border-radius);padding:var(--unit);width:100%}._input_11w26_10[type=radio]{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:var(--color-white);border:var(--border);box-shadow:none;padding:0;height:calc(var(--unit) * 1.25);width:calc(var(--unit) * 1.25)}._input_11w26_10[type=radio]:checked{border-color:var(--color-electric-violet);border-width:var(--unit-tiny)}._label_11w26_47{display:block}._required_11w26_51:after{content:"*";color:var(--color-mahogany);font-size:calc(var(--unit) * 1.5);position:relative;left:var(--unit-tiny);top:var(--unit-tiny)}input[type=text][placeholder="+47"]{margin-right:var(--unit-small);width:calc(5 * var(--unit))}input[type=text][placeholder="+47"]+input[type=tel]{width:calc(100% - (5 * var(--unit) + var(--unit-small)))}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index20.css');const a=require("react/jsx-runtime"),o=require("../figure/index.cjs"),c=require("../icon/index.cjs"),i=require("../link/index.cjs"),u="_avatar_2x0un_5",v={avatar:u},l=({imageUrl:t,label:s,link:e})=>{const n=s||"User Avatar",r=a.jsx("span",{className:v.avatar,children:a.jsx(o.Figure,{label:n,children:t?a.jsx("img",{src:t,alt:n}):a.jsx(c.Icon,{name:"user",variant:e?"white":"default"})})});return e?a.jsx(i.Link,{to:e,"data-component":"avatar",children:r}):r};exports.Avatar=l;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index19.css');const a=require("react/jsx-runtime"),o=require("../figure/index.cjs"),c=require("../icon/index.cjs"),i=require("../link/index.cjs"),u="_avatar_2x0un_5",v={avatar:u},l=({imageUrl:t,label:s,link:e})=>{const n=s||"User Avatar",r=a.jsx("span",{className:v.avatar,children:a.jsx(o.Figure,{label:n,children:t?a.jsx("img",{src:t,alt:n}):a.jsx(c.Icon,{name:"user",variant:e?"white":"default"})})});return e?a.jsx(i.Link,{to:e,"data-component":"avatar",children:r}):r};exports.Avatar=l;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -2,7 +2,7 @@ import { jsx as a } from "react/jsx-runtime";
2
2
  import { Figure as s } from "../figure/index.js";
3
3
  import { Icon as c } from "../icon/index.js";
4
4
  import { Link as m } from "../link/index.js";
5
- import '../../assets/index20.css';const i = "_avatar_2x0un_5", v = {
5
+ import '../../assets/index19.css';const i = "_avatar_2x0un_5", v = {
6
6
  avatar: i
7
7
  }, f = ({
8
8
  imageUrl: t,
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index21.css');const c=require("react/jsx-runtime"),n=require("../../classix-5H4IWnMA.cjs"),i=require("../figure/index.cjs"),o="_card_mj7yt_1",l="_draft_mj7yt_12",u="_scheduled_mj7yt_16",_="_image_mj7yt_20",e={card:o,draft:l,scheduled:u,image:_},m=({children:r,draft:s,image:t,onClick:d,scheduled:a})=>c.jsxs("article",{className:n.t(e.card,s&&e.draft,a&&e.scheduled),onClick:d,"data-component":"card",children:[t&&c.jsx(i.Figure,{className:e.image,children:t}),r]});exports.Card=m;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index20.css');const t=require("react/jsx-runtime"),n=require("../../classix-5H4IWnMA.cjs"),l=require("../figure/index.cjs"),i="_card_gtmcl_1",o="_draft_gtmcl_14",u="_scheduled_gtmcl_18",_="_image_gtmcl_22",e={card:i,draft:o,scheduled:u,image:_},m=({children:r,draft:s,image:c,onClick:d,scheduled:a})=>t.jsxs("article",{className:n.t(e.card,s&&e.draft,a&&e.scheduled),onClick:d,"data-component":"card",children:[c&&t.jsx(l.Figure,{className:e.image,children:c}),r]});exports.Card=m;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1,20 +1,20 @@
1
1
  import { jsxs as s, jsx as m } from "react/jsx-runtime";
2
2
  import { t as o } from "../../classix-DG18itHa.js";
3
- import { Figure as _ } from "../figure/index.js";
4
- import '../../assets/index21.css';const n = "_card_mj7yt_1", i = "_draft_mj7yt_12", l = "_scheduled_mj7yt_16", f = "_image_mj7yt_20", t = {
5
- card: n,
6
- draft: i,
7
- scheduled: l,
8
- image: f
3
+ import { Figure as l } from "../figure/index.js";
4
+ import '../../assets/index20.css';const _ = "_card_gtmcl_1", n = "_draft_gtmcl_14", i = "_scheduled_gtmcl_18", g = "_image_gtmcl_22", c = {
5
+ card: _,
6
+ draft: n,
7
+ scheduled: i,
8
+ image: g
9
9
  }, p = ({
10
- children: c,
10
+ children: r,
11
11
  draft: d,
12
- image: r,
12
+ image: t,
13
13
  onClick: e,
14
14
  scheduled: a
15
- }) => /* @__PURE__ */ s("article", { className: o(t.card, d && t.draft, a && t.scheduled), onClick: e, "data-component": "card", children: [
16
- r && /* @__PURE__ */ m(_, { className: t.image, children: r }),
17
- c
15
+ }) => /* @__PURE__ */ s("article", { className: o(c.card, d && c.draft, a && c.scheduled), onClick: e, "data-component": "card", children: [
16
+ t && /* @__PURE__ */ m(l, { className: c.image, children: t }),
17
+ r
18
18
  ] });
19
19
  export {
20
20
  p as Card
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index22.css');const e=require("react/jsx-runtime"),n=require("../icon/index.cjs"),c="_collapsible_x7hng_1",i={collapsible:c},t=({children:o,disabled:l,label:s})=>e.jsxs("details",{className:i.collapsible,open:l||void 0,"data-component":"collapsible",children:[e.jsxs("summary",{children:[s&&s,!l&&e.jsx(n.Icon,{gap:"left",name:"chevron",variant:"primary"})]}),o]});exports.Collapsible=t;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index21.css');const e=require("react/jsx-runtime"),n=require("../icon/index.cjs"),c="_collapsible_11zqc_1",i={collapsible:c},t=({children:o,disabled:l,label:s})=>e.jsxs("details",{className:i.collapsible,open:l||void 0,"data-component":"collapsible",children:[e.jsxs("summary",{children:[s&&s,!l&&e.jsx(n.Icon,{gap:"left",name:"chevron",size:"small",variant:"primary"})]}),o]});exports.Collapsible=t;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sources":["../../../src/components/_collapsible/index.tsx"],"sourcesContent":["import React from 'react';\n\nimport { Icon } from '@/components/icon';\n\nimport styles from './styles.module.css';\n\nexport type CollapsibleProps = {\n children: React.ReactNode;\n disabled?: boolean;\n label?: React.ReactNode;\n};\n\nexport const Collapsible = ({ children, disabled, label }: CollapsibleProps) => {\n return (\n <details\n className={styles.collapsible}\n open={disabled || undefined}\n >\n <summary>\n {label && label}\n {!disabled && (\n <Icon\n gap='left'\n name='chevron'\n variant='primary'\n />\n )}\n </summary>\n\n {children}\n </details>\n );\n};\n"],"names":["Collapsible","children","disabled","label","jsxs","styles","collapsible","undefined","jsx","Icon"],"mappings":"+LAYaA,EAAcA,CAAC,CAAEC,SAAAA,EAAUC,SAAAA,EAAUC,MAAAA,CAAwB,IAEtEC,OAAC,WACC,UAAWC,EAAOC,YAClB,KAAMJ,GAAYK,OAAU,iBAAA,cAE5B,SAAA,CAAAH,OAAC,UAAA,CACED,SAAAA,CAAAA,GAASA,EACT,CAACD,GACAM,MAACC,EAAAA,KAAA,CACC,IAAI,OACJ,KAAK,UACL,QAAQ,SAAA,CAAS,CAAA,EAGvB,EAECR,CAAAA,EACH"}
1
+ {"version":3,"file":"index.cjs","sources":["../../../src/components/_collapsible/index.tsx"],"sourcesContent":["import React from 'react';\n\nimport { Icon } from '@/components/icon';\n\nimport styles from './styles.module.css';\n\nexport type CollapsibleProps = {\n children: React.ReactNode;\n disabled?: boolean;\n label?: React.ReactNode;\n};\n\nexport const Collapsible = ({ children, disabled, label }: CollapsibleProps) => {\n return (\n <details\n className={styles.collapsible}\n open={disabled || undefined}\n >\n <summary>\n {label && label}\n {!disabled && (\n <Icon\n gap='left'\n name='chevron'\n size='small'\n variant='primary'\n />\n )}\n </summary>\n\n {children}\n </details>\n );\n};\n"],"names":["Collapsible","children","disabled","label","jsxs","styles","collapsible","undefined","jsx","Icon"],"mappings":"+LAYaA,EAAcA,CAAC,CAAEC,SAAAA,EAAUC,SAAAA,EAAUC,MAAAA,CAAwB,IAEtEC,OAAC,WACC,UAAWC,EAAOC,YAClB,KAAMJ,GAAYK,OAAU,iBAAA,cAE5B,SAAA,CAAAH,OAAC,UAAA,CACED,SAAAA,CAAAA,GAASA,EACT,CAACD,GACAM,EAAAA,IAACC,EAAAA,KAAA,CACC,IAAI,OACJ,KAAK,UACL,KAAK,QACL,QAAQ,SAAA,CAAS,CAAA,EAGvB,EAECR,CAAAA,EACH"}
@@ -1,7 +1,7 @@
1
1
  import { jsxs as s, jsx as a } from "react/jsx-runtime";
2
2
  import { Icon as c } from "../icon/index.js";
3
- import '../../assets/index22.css';const n = "_collapsible_x7hng_1", r = {
4
- collapsible: n
3
+ import '../../assets/index21.css';const i = "_collapsible_11zqc_1", r = {
4
+ collapsible: i
5
5
  }, t = ({
6
6
  children: e,
7
7
  disabled: l,
@@ -9,7 +9,7 @@ import '../../assets/index22.css';const n = "_collapsible_x7hng_1", r = {
9
9
  }) => /* @__PURE__ */ s("details", { className: r.collapsible, open: l || void 0, "data-component": "collapsible", children: [
10
10
  /* @__PURE__ */ s("summary", { children: [
11
11
  o && o,
12
- !l && /* @__PURE__ */ a(c, { gap: "left", name: "chevron", variant: "primary" })
12
+ !l && /* @__PURE__ */ a(c, { gap: "left", name: "chevron", size: "small", variant: "primary" })
13
13
  ] }),
14
14
  e
15
15
  ] });
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/components/_collapsible/index.tsx"],"sourcesContent":["import React from 'react';\n\nimport { Icon } from '@/components/icon';\n\nimport styles from './styles.module.css';\n\nexport type CollapsibleProps = {\n children: React.ReactNode;\n disabled?: boolean;\n label?: React.ReactNode;\n};\n\nexport const Collapsible = ({ children, disabled, label }: CollapsibleProps) => {\n return (\n <details\n className={styles.collapsible}\n open={disabled || undefined}\n >\n <summary>\n {label && label}\n {!disabled && (\n <Icon\n gap='left'\n name='chevron'\n variant='primary'\n />\n )}\n </summary>\n\n {children}\n </details>\n );\n};\n"],"names":["Collapsible","children","disabled","label","jsxs","styles","collapsible","undefined","jsx","Icon"],"mappings":";;;;GAYaA,IAAcA,CAAC;AAAA,EAAEC,UAAAA;AAAAA,EAAUC,UAAAA;AAAAA,EAAUC,OAAAA;AAAwB,MAEtE,gBAAAC,EAAC,aACC,WAAWC,EAAOC,aAClB,MAAMJ,KAAYK,QAAU,kBAAA,eAE5B,UAAA;AAAA,EAAA,gBAAAH,EAAC,WAAA,EACED,UAAAA;AAAAA,IAAAA,KAASA;AAAAA,IACT,CAACD,KACA,gBAAAM,EAACC,GAAA,EACC,KAAI,QACJ,MAAK,WACL,SAAQ,UAAA,CAAS;AAAA,EAAA,GAGvB;AAAA,EAECR;AAAAA,GACH;"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/components/_collapsible/index.tsx"],"sourcesContent":["import React from 'react';\n\nimport { Icon } from '@/components/icon';\n\nimport styles from './styles.module.css';\n\nexport type CollapsibleProps = {\n children: React.ReactNode;\n disabled?: boolean;\n label?: React.ReactNode;\n};\n\nexport const Collapsible = ({ children, disabled, label }: CollapsibleProps) => {\n return (\n <details\n className={styles.collapsible}\n open={disabled || undefined}\n >\n <summary>\n {label && label}\n {!disabled && (\n <Icon\n gap='left'\n name='chevron'\n size='small'\n variant='primary'\n />\n )}\n </summary>\n\n {children}\n </details>\n );\n};\n"],"names":["Collapsible","children","disabled","label","jsxs","styles","collapsible","undefined","jsx","Icon"],"mappings":";;;;GAYaA,IAAcA,CAAC;AAAA,EAAEC,UAAAA;AAAAA,EAAUC,UAAAA;AAAAA,EAAUC,OAAAA;AAAwB,MAEtE,gBAAAC,EAAC,aACC,WAAWC,EAAOC,aAClB,MAAMJ,KAAYK,QAAU,kBAAA,eAE5B,UAAA;AAAA,EAAA,gBAAAH,EAAC,WAAA,EACED,UAAAA;AAAAA,IAAAA,KAASA;AAAAA,IACT,CAACD,KACA,gBAAAM,EAACC,GAAA,EACC,KAAI,QACJ,MAAK,WACL,MAAK,SACL,SAAQ,UAAA,CAAS;AAAA,EAAA,GAGvB;AAAA,EAECR;AAAAA,GACH;"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index23.css');const d=require("react/jsx-runtime"),et=require("../../classix-5H4IWnMA.cjs"),s=require("react"),mt=require("../figure/index.cjs"),pt=require("../icon/index.cjs"),gt="_croppable_1mlwb_1",xt="_viewport_1mlwb_21",wt="_media_1mlwb_34",yt="_draggable_1mlwb_45",bt="_dragging_1mlwb_49",zt="_inner_1mlwb_53",z={croppable:gt,viewport:xt,media:wt,draggable:yt,dragging:bt,inner:zt},Rt=192,j={offset:{x:0,y:0},zoom:1},R=10,B=.1,h=(X,E,Y)=>Math.min(Y,Math.max(E,X)),_t=({children:X,fill:E="none",height:Y,onCroppableChange:T,onFileChange:g,onTransformChange:v,transform:m})=>{const _=s.useRef(null),x=s.useRef(null),a=s.useRef(null),N=s.useRef(null),w=s.useRef(null),D=s.useRef(null),M=s.useRef(null),L=s.useRef(new Map),i=s.useRef(j),U=s.useRef(null),[l,H]=s.useState(null),[W,$]=s.useState(null),[k,P]=s.useState(!1),[nt,G]=s.useState(j),[f,rt]=s.useState({width:0,height:0}),I=(()=>{const t=f.width,e=f.height;if(!t||!e)return{width:0,height:0,minZoom:B};if(!l)return{width:t,height:e,minZoom:B};const r=t/l.width,n=e/l.height,o=Math.max(r,n),c=E==="width"?r/o:E==="height"?n/o:0;return{width:l.width*o,height:l.height*o,minZoom:Math.max(B,c)}})(),y=I.minZoom,Z=m??nt,O=h(Z.zoom,y,R),K=X??(W?d.jsx("img",{draggable:!1,onLoad:t=>{const e=t.currentTarget;e.naturalWidth&&e.naturalHeight&&H({width:e.naturalWidth,height:e.naturalHeight})},src:W}):null),b=K==null,A=(t,e)=>{const{maxX:r,maxY:n}=J(e);return{x:h(t.x,-r,r),y:h(t.y,-n,n)}},V=(t,e)=>{const r=U.current;if(!r)return null;const n=r.getBoundingClientRect(),o=t-n.left-n.width/2,c=e-n.top-n.height/2;return{x:o,y:c}},ot=(t,e,r,n)=>{const o=h(e,y,R),c=h(r,y,R);if(o===0)return t;const u=c/o;return{x:(1-u)*n.x+u*t.x,y:(1-u)*n.y+u*t.y}},ct=(t,e,r)=>{const n=i.current.zoom,o=h(t,y,R),c=i.current.offset,u=r?ot(c,n,o,r):e,p=A(u,o);i.current={zoom:o,offset:p},m||G({zoom:o,offset:p}),v==null||v({zoom:o,offset:p})},S=(t,e,r)=>{D.current={zoom:t,offset:e,anchor:r??null},x.current==null&&(x.current=window.requestAnimationFrame(()=>{x.current=null;const n=D.current;D.current=null;const o=(n==null?void 0:n.zoom)??i.current.zoom,c=(n==null?void 0:n.offset)??i.current.offset,u=(n==null?void 0:n.anchor)??null;ct(o,c,u)}))},st=t=>{if(b)return;const e=t.ctrlKey?.001:25e-5,r=i.current.zoom*Math.exp(-t.deltaY*e),n=V(t.clientX,t.clientY);S(r,i.current.offset,n)},J=t=>{const e=f.width,r=f.height;if(!e||!r)return{maxX:0,maxY:0};const n=h(t,y,R),o=I.width*n,c=I.height*n,u=Math.max(0,(o-e)/2),p=Math.max(0,(c-r)/2);return{maxX:u,maxY:p}},it=t=>{var o;const e=t.target,r=((o=e.files)==null?void 0:o[0])??null;if(w.current&&(URL.revokeObjectURL(w.current),w.current=null),!r){$(null),g==null||g(null),e.value="";return}const n=URL.createObjectURL(r);w.current=n,$(n),H(null),S(j.zoom,j.offset),i.current=j,g==null||g(r),e.value=""},ut=t=>{if(!(b||t.pointerType==="mouse"&&t.button!==0)){if(t.currentTarget.setPointerCapture(t.pointerId),t.pointerType==="touch"){const e=L.current;if(e.set(t.pointerId,{x:t.clientX,y:t.clientY}),e.size===2){a.current=null,_.current=null,P(!1);const[r,n]=Array.from(e.values());M.current=Math.hypot(r.x-n.x,r.y-n.y);return}}_.current=t.pointerId,a.current={x:t.clientX,y:t.clientY,originX:i.current.offset.x,originY:i.current.offset.y}}},lt=t=>{if(b)return;if(t.pointerType==="touch"){const o=L.current;if(!o.has(t.pointerId))return;if(o.set(t.pointerId,{x:t.clientX,y:t.clientY}),o.size===2){const[c,u]=Array.from(o.values()),p=c.x-u.x,at=c.y-u.y,C=Math.hypot(p,at),tt={x:(c.x+u.x)/2,y:(c.y+u.y)/2};if(M.current){const ft=C/M.current,dt=i.current.zoom*ft,ht=V(tt.x,tt.y);S(dt,i.current.offset,ht)}M.current=C;return}}if(_.current!==t.pointerId||!a.current||!q)return;const e=t.clientX-a.current.x,r=t.clientY-a.current.y,n=Math.abs(e)+Math.abs(r);!k&&n>2&&P(!0),!(n<=1)&&S(i.current.zoom,{x:a.current.originX+e,y:a.current.originY+r})},Q=t=>{t.pointerType==="touch"&&(L.current.delete(t.pointerId),L.current.size<2&&(M.current=null)),_.current===t.pointerId&&(_.current=null,a.current=null,P(!1))};s.useEffect(()=>{if(!m)return;const t=h(m.zoom,y,R);i.current={zoom:t,offset:A(m.offset,t)}},[m,f.width,f.height,l==null?void 0:l.width,l==null?void 0:l.height]),s.useEffect(()=>()=>{w.current&&URL.revokeObjectURL(w.current)},[]),s.useEffect(()=>{const t=U.current;if(!t)return;const e=()=>{const o=t.getBoundingClientRect();rt(c=>c.width===o.width&&c.height===o.height?c:{width:o.width,height:o.height}),T&&T(o)};e();const r=()=>e();if(window.addEventListener("scroll",r,!0),typeof ResizeObserver>"u"){const o=()=>e();return window.addEventListener("resize",o),()=>{window.removeEventListener("resize",o),window.removeEventListener("scroll",r,!0)}}const n=new ResizeObserver(()=>e());return n.observe(t),()=>{n.disconnect(),window.removeEventListener("scroll",r,!0)}},[T]),s.useEffect(()=>{if(m)return;const t=i.current.offset,e=A(t,O);t.x===e.x&&t.y===e.y||(i.current={zoom:i.current.zoom,offset:e},G(r=>({...r,offset:e})))},[O,l,f.width,f.height]),s.useEffect(()=>()=>{x.current!=null&&(window.cancelAnimationFrame(x.current),x.current=null)},[]);const F=J(O),q=!b&&(F.maxX>0||F.maxY>0);return d.jsxs("div",{className:z.croppable,onClick:()=>{var t;b&&((t=N.current)==null||t.click())},"data-component":"croppable",children:[d.jsx("input",{accept:"image/*",onChange:it,ref:N,type:"file"}),d.jsx("div",{className:z.viewport,ref:U,onDragStart:t=>t.preventDefault(),onPointerDown:ut,onPointerMove:lt,onPointerUp:Q,onPointerCancel:Q,onWheel:st,style:{"--croppable-height":`${Y??Rt}px`,"--croppable-zoom":O,"--croppable-x":`${Z.offset.x}px`,"--croppable-y":`${Z.offset.y}px`,...l?{"--croppable-image-width":`${I.width}px`,"--croppable-image-height":`${I.height}px`}:null},children:b?d.jsx(mt.Figure,{children:d.jsx(pt.Icon,{name:"image"})}):d.jsx("div",{className:et.t(z.media,q&&z.draggable,q&&k&&z.dragging),children:d.jsx("div",{className:et.t(z.inner),children:K})})})]})};exports.Croppable=_t;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index22.css');const d=require("react/jsx-runtime"),tt=require("../../classix-5H4IWnMA.cjs"),c=require("react"),mt=require("../button/index.cjs"),pt=require("../figure/index.cjs"),gt=require("../icon/index.cjs"),vt="_croppable_1ykk4_1",Ot="_empty_1ykk4_14",St="_media_1ykk4_22",Ut="_overlay_1ykk4_33",It="_viewport_1ykk4_41",Pt="_draggable_1ykk4_53",Yt="_dragging_1ykk4_57",Xt="_inner_1ykk4_61",At="_standalone_1ykk4_77",z={croppable:vt,empty:Ot,media:St,overlay:Ut,viewport:It,draggable:Pt,dragging:Yt,inner:Xt,standalone:At},Dt=192,B={offset:{x:0,y:0},zoom:1},xt="Select image",O=10,D=.1,Wt=.92,m=(h,x,R)=>Math.min(R,Math.max(x,h)),Ht=h=>new Promise((x,R)=>{const f=URL.createObjectURL(h),a=new globalThis.Image;a.onload=()=>{URL.revokeObjectURL(f),x(a)},a.onerror=()=>{URL.revokeObjectURL(f),R(new Error("croppable-image-load-failed"))},a.src=f}),Zt=async({file:h,fill:x,transform:R,viewport:f})=>{const a=await Ht(h),S=f.width/a.naturalWidth,M=f.height/a.naturalHeight,y=Math.max(S,M),W=a.naturalWidth*y,k=a.naturalHeight*y,Q=x==="width"?Math.max(D,S/y):x==="height"?Math.max(D,M/y):D,E=m(R.zoom,Q,O),w=y*E,b=W*E,N=k*E,p=(f.width-b)/2+R.offset.x,j=(f.height-N)/2+R.offset.y,U=m((0-p)/w,0,a.naturalWidth),L=m((0-j)/w,0,a.naturalHeight),T=m(f.width/w,1,Math.max(1,a.naturalWidth-U)),s=m(f.height/w,1,Math.max(1,a.naturalHeight-L)),_=document.createElement("canvas"),u=_.getContext("2d");if(!u)throw new Error("croppable-image-context-missing");_.width=Math.max(1,Math.round(T)),_.height=Math.max(1,Math.round(s)),u.drawImage(a,U,L,T,s,0,0,_.width,_.height);const I=h.type.startsWith("image/")?h.type:"image/jpeg",P=await new Promise(q=>{_.toBlob(q,I,Wt)});if(!P)throw new Error("croppable-image-export-failed");return new globalThis.File([P],h.name,{lastModified:Date.now(),type:P.type||I})},Bt=({children:h,fill:x="none",height:R,image:f,label:a,onCroppableChange:S,onFileChange:M,onImageChange:y,onTransformChange:W,transform:k,standalone:Q})=>{const E=c.useRef(null),w=c.useRef(null),b=c.useRef(null),N=c.useRef(null),p=c.useRef(y),j=c.useRef(null),U=c.useRef(null),L=c.useRef(null),T=c.useRef(new Map),s=c.useRef(B),_=c.useRef(null),[u,I]=c.useState(null),[P,q]=c.useState(null),[et,V]=c.useState(!1),[wt,nt]=c.useState(B),[F,rt]=c.useState(null),[g,yt]=c.useState({width:0,height:0}),H=(()=>{const t=g.width,n=g.height;if(!t||!n)return{width:0,height:0,minZoom:D};if(!u)return{width:t,height:n,minZoom:D};const r=t/u.width,e=n/u.height,o=Math.max(r,e),i=x==="width"?r/o:x==="height"?e/o:0;return{width:u.width*o,height:u.height*o,minZoom:Math.max(D,i)}})(),Y=H.minZoom,Z=k??wt,X=m(Z.zoom,Y,O),$=P??f??null,ot=!h&&!!f&&!P&&!F,G=!ot,ct=h??($?d.jsx("img",{alt:"",draggable:!1,onLoad:t=>{const n=t.currentTarget;n.naturalWidth&&n.naturalHeight&&I({width:n.naturalWidth,height:n.naturalHeight})},src:$}):null),A=ct==null,J=(t,n)=>{const{maxX:r,maxY:e}=it(n);return{x:m(t.x,-r,r),y:m(t.y,-e,e)}},st=(t,n)=>{const r=_.current;if(!r)return null;const e=r.getBoundingClientRect(),o=t-e.left-e.width/2,i=n-e.top-e.height/2;return{x:o,y:i}},bt=(t,n,r,e)=>{const o=m(n,Y,O),i=m(r,Y,O);if(o===0)return t;const l=i/o;return{x:(1-l)*e.x+l*t.x,y:(1-l)*e.y+l*t.y}},_t=(t,n,r)=>{const e=s.current.zoom,o=m(t,Y,O),i=s.current.offset,l=r?bt(i,e,o,r):n,v=J(l,o);s.current={zoom:o,offset:v},k||nt({zoom:o,offset:v}),W==null||W({zoom:o,offset:v})},K=(t,n,r)=>{U.current={zoom:t,offset:n,anchor:r??null},w.current==null&&(w.current=window.requestAnimationFrame(()=>{w.current=null;const e=U.current;U.current=null;const o=(e==null?void 0:e.zoom)??s.current.zoom,i=(e==null?void 0:e.offset)??s.current.offset,l=(e==null?void 0:e.anchor)??null;_t(o,i,l)}))},zt=t=>{if(A||!G)return;const n=t.ctrlKey?.001:25e-5,r=s.current.zoom*Math.exp(-t.deltaY*n),e=st(t.clientX,t.clientY);K(r,s.current.offset,e)},it=t=>{const n=g.width,r=g.height;if(!n||!r)return{maxX:0,maxY:0};const e=m(t,Y,O),o=H.width*e,i=H.height*e,l=Math.max(0,(o-n)/2),v=Math.max(0,(i-r)/2);return{maxX:l,maxY:v}},Rt=t=>{var o;const n=t.target,r=((o=n.files)==null?void 0:o[0])??null;if(j.current&&(URL.revokeObjectURL(j.current),j.current=null),!r){q(null),rt(null),M==null||M(null),n.value="";return}const e=URL.createObjectURL(r);j.current=e,q(e),I(null),rt(r),K(B.zoom,B.offset),s.current=B,M==null||M(r),n.value=""},Mt=t=>{if(!(A||!G||t.pointerType==="mouse"&&t.button!==0)){if(t.currentTarget.setPointerCapture(t.pointerId),t.pointerType==="touch"){const n=T.current;if(n.set(t.pointerId,{x:t.clientX,y:t.clientY}),n.size===2){b.current=null,E.current=null,V(!1);const[r,e]=Array.from(n.values());L.current=Math.hypot(r.x-e.x,r.y-e.y);return}}E.current=t.pointerId,b.current={x:t.clientX,y:t.clientY,originX:s.current.offset.x,originY:s.current.offset.y}}},kt=t=>{if(A||!G)return;if(t.pointerType==="touch"){const o=T.current;if(!o.has(t.pointerId))return;if(o.set(t.pointerId,{x:t.clientX,y:t.clientY}),o.size===2){const[i,l]=Array.from(o.values()),v=i.x-l.x,Et=i.y-l.y,ht=Math.hypot(v,Et),ft={x:(i.x+l.x)/2,y:(i.y+l.y)/2};if(L.current){const jt=ht/L.current,Lt=s.current.zoom*jt,Tt=st(ft.x,ft.y);K(Lt,s.current.offset,Tt)}L.current=ht;return}}if(E.current!==t.pointerId||!b.current||!C)return;const n=t.clientX-b.current.x,r=t.clientY-b.current.y,e=Math.abs(n)+Math.abs(r);!et&&e>2&&V(!0),!(e<=1)&&K(s.current.zoom,{x:b.current.originX+n,y:b.current.originY+r})},at=t=>{t.pointerType==="touch"&&(T.current.delete(t.pointerId),T.current.size<2&&(L.current=null)),E.current===t.pointerId&&(E.current=null,b.current=null,V(!1))};c.useEffect(()=>{if(!k)return;const t=m(k.zoom,Y,O);s.current={zoom:t,offset:J(k.offset,t)}},[k,g.width,g.height,u==null?void 0:u.width,u==null?void 0:u.height]),c.useEffect(()=>()=>{j.current&&URL.revokeObjectURL(j.current)},[]),c.useEffect(()=>{const t=_.current;if(!t)return;const n=()=>{const o=t.getBoundingClientRect();yt(i=>i.width===o.width&&i.height===o.height?i:{width:o.width,height:o.height}),S&&S(o)};n();const r=()=>n();if(window.addEventListener("scroll",r,!0),typeof ResizeObserver>"u"){const o=()=>n();return window.addEventListener("resize",o),()=>{window.removeEventListener("resize",o),window.removeEventListener("scroll",r,!0)}}const e=new ResizeObserver(()=>n());return e.observe(t),()=>{e.disconnect(),window.removeEventListener("scroll",r,!0)}},[S]),c.useEffect(()=>{if(k)return;const t=s.current.offset,n=J(t,X);t.x===n.x&&t.y===n.y||(s.current={zoom:s.current.zoom,offset:n},nt(r=>({...r,offset:n})))},[X,u,g.width,g.height]),c.useEffect(()=>{$||I(null)},[$]),c.useEffect(()=>{p.current=y},[y]),c.useEffect(()=>{var r;if(!y)return;if(!F||!g.width||!g.height||h){(r=p.current)==null||r.call(p,null);return}let t=!0;const n=window.setTimeout(()=>{Zt({file:F,fill:x,transform:{zoom:X,offset:Z.offset},viewport:g}).then(e=>{var o;t&&((o=p.current)==null||o.call(p,e))}).catch(()=>{var e;t&&((e=p.current)==null||e.call(p,null))})},75);return()=>{t=!1,window.clearTimeout(n)}},[h,X,Z.offset,x,F,g]),c.useEffect(()=>()=>{w.current!=null&&(window.cancelAnimationFrame(w.current),w.current=null)},[]);const ut=it(X),C=!A&&G&&(ut.maxX>0||ut.maxY>0),lt=()=>{var t;return(t=N.current)==null?void 0:t.click()},dt=t=>{t.preventDefault(),t.stopPropagation(),lt()};return d.jsxs("div",{className:tt.t(z.croppable,Q&&z.standalone),onClick:()=>{A&&lt()},"data-component":"croppable",children:[d.jsx("input",{accept:"image/*",onChange:Rt,ref:N,type:"file"}),d.jsx("div",{className:z.viewport,ref:_,onDragStart:t=>t.preventDefault(),onPointerDown:Mt,onPointerMove:kt,onPointerUp:at,onPointerCancel:at,onWheel:zt,style:{"--croppable-height":`${R??Dt}px`,"--croppable-zoom":X,"--croppable-x":`${Z.offset.x}px`,"--croppable-y":`${Z.offset.y}px`,...u?{"--croppable-image-width":`${H.width}px`,"--croppable-image-height":`${H.height}px`}:null},children:A?d.jsxs("div",{className:z.empty,children:[d.jsx(pt.Figure,{children:d.jsx(gt.Icon,{name:"image",size:"large"})}),d.jsx(mt.Button,{onClick:dt,children:a??xt})]}):d.jsxs("div",{className:tt.t(z.media,C&&z.draggable,C&&et&&z.dragging),children:[d.jsx("div",{className:tt.t(z.inner),children:ct}),ot&&d.jsx("div",{className:z.overlay,children:d.jsxs("div",{className:z.empty,children:[d.jsx(pt.Figure,{children:d.jsx(gt.Icon,{name:"image",size:"large"})}),d.jsx(mt.Button,{onClick:dt,children:a??xt})]})})]})})]})};exports.Croppable=Bt;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sources":["../../../src/components/_croppable/index.tsx"],"sourcesContent":["import cx from 'classix';\nimport React, { useEffect, useRef, useState } from 'react';\n\nimport { Figure } from '../figure';\nimport { Icon } from '../icon';\nimport styles from './styles.module.css';\n\nexport type CroppableTransform = {\n offset: { x: number; y: number };\n zoom: number;\n};\n\nexport type CroppableProps = {\n children?: React.ReactNode;\n fill?: 'width' | 'height' | 'none';\n height?: number;\n onCroppableChange?: (rect: DOMRect) => void;\n onFileChange?: (file: File | null) => void;\n onTransformChange?: (transform: CroppableTransform) => void;\n transform?: CroppableTransform;\n};\n\nconst DEFAULT_HEIGHT = 192;\nconst DEFAULT_TRANSFORM: CroppableTransform = { offset: { x: 0, y: 0 }, zoom: 1 };\nconst MAX_ZOOM = 10;\nconst MIN_ZOOM = 0.1;\n\nconst clamp = (value: number, min: number, max: number) => Math.min(max, Math.max(min, value));\n\nexport const Croppable = ({\n children,\n fill = 'none',\n height,\n onCroppableChange,\n onFileChange,\n onTransformChange,\n transform,\n}: CroppableProps) => {\n const activePointerId = useRef<number | null>(null);\n const animationFrameRef = useRef<number | null>(null);\n const dragStartRef = useRef<{ x: number; y: number; originX: number; originY: number } | null>(\n null\n );\n const inputRef = useRef<HTMLInputElement>(null);\n const objectUrlRef = useRef<string | null>(null);\n const pendingRef = useRef<{\n zoom: number;\n offset: { x: number; y: number };\n anchor: { x: number; y: number } | null;\n } | null>(null);\n const pinchDistance = useRef<number | null>(null);\n const pointers = useRef<Map<number, { x: number; y: number }>>(new Map());\n const transformRef = useRef<CroppableTransform>(DEFAULT_TRANSFORM);\n const viewportRef = useRef<HTMLDivElement>(null);\n\n const [imageSize, setImageSize] = useState<{ width: number; height: number } | null>(null);\n const [imageSrc, setImageSrc] = useState<string | null>(null);\n const [isDragging, setIsDragging] = useState(false);\n const [draftTransform, setDraftTransform] = useState<CroppableTransform>(DEFAULT_TRANSFORM);\n const [viewportSize, setViewportSize] = useState({ width: 0, height: 0 });\n\n const getBaseMetrics = () => {\n const width = viewportSize.width;\n const height = viewportSize.height;\n\n if (!width || !height) return { width: 0, height: 0, minZoom: MIN_ZOOM };\n if (!imageSize) return { width, height, minZoom: MIN_ZOOM };\n\n const scaleX = width / imageSize.width;\n const scaleY = height / imageSize.height;\n const cover = Math.max(scaleX, scaleY);\n\n const rawMinZoom = fill === 'width' ? scaleX / cover : fill === 'height' ? scaleY / cover : 0;\n\n return {\n width: imageSize.width * cover,\n height: imageSize.height * cover,\n minZoom: Math.max(MIN_ZOOM, rawMinZoom),\n };\n };\n\n const baseMetrics = getBaseMetrics();\n const minZoom = baseMetrics.minZoom;\n\n const currentTransform = transform ?? draftTransform;\n const clampedZoom = clamp(currentTransform.zoom, minZoom, MAX_ZOOM);\n const content =\n children ??\n (imageSrc ? (\n <img\n draggable={false}\n onLoad={(event) => {\n const img = event.currentTarget;\n if (img.naturalWidth && img.naturalHeight) {\n setImageSize({ width: img.naturalWidth, height: img.naturalHeight });\n }\n }}\n src={imageSrc}\n />\n ) : null);\n const isEmpty = content == null;\n\n const clampOffset = (next: { x: number; y: number }, zoomToUse: number) => {\n const { maxX, maxY } = getClampBounds(zoomToUse);\n return {\n x: clamp(next.x, -maxX, maxX),\n y: clamp(next.y, -maxY, maxY),\n };\n };\n\n const getViewportVectorFromClient = (clientX: number, clientY: number) => {\n const node = viewportRef.current;\n if (!node) return null;\n const rect = node.getBoundingClientRect();\n const x = clientX - rect.left - rect.width / 2;\n const y = clientY - rect.top - rect.height / 2;\n return { x, y };\n };\n\n const computeAnchoredOffset = (\n currentOffset: { x: number; y: number },\n currentZoom: number,\n nextZoom: number,\n anchorVec: { x: number; y: number }\n ) => {\n const z0 = clamp(currentZoom, minZoom, MAX_ZOOM);\n const z1 = clamp(nextZoom, minZoom, MAX_ZOOM);\n if (z0 === 0) return currentOffset;\n const r = z1 / z0;\n return {\n x: (1 - r) * anchorVec.x + r * currentOffset.x,\n y: (1 - r) * anchorVec.y + r * currentOffset.y,\n };\n };\n\n const commitTransform = (\n nextZoom: number,\n nextOffset: { x: number; y: number },\n anchorVec?: { x: number; y: number } | null\n ) => {\n const z0 = transformRef.current.zoom;\n const z1 = clamp(nextZoom, minZoom, MAX_ZOOM);\n const currentOffset = transformRef.current.offset;\n const anchoredOffset = anchorVec\n ? computeAnchoredOffset(currentOffset, z0, z1, anchorVec)\n : nextOffset;\n const clampedOffset = clampOffset(anchoredOffset, z1);\n transformRef.current = { zoom: z1, offset: clampedOffset };\n\n if (!transform) {\n setDraftTransform({ zoom: z1, offset: clampedOffset });\n }\n onTransformChange?.({ zoom: z1, offset: clampedOffset });\n };\n\n const scheduleTransform = (\n nextZoom: number,\n nextOffset: { x: number; y: number },\n anchorVec?: { x: number; y: number } | null\n ) => {\n pendingRef.current = {\n zoom: nextZoom,\n offset: nextOffset,\n anchor: anchorVec ?? null,\n };\n\n if (animationFrameRef.current != null) return;\n\n animationFrameRef.current = window.requestAnimationFrame(() => {\n animationFrameRef.current = null;\n\n const pending = pendingRef.current;\n pendingRef.current = null;\n\n const z = pending?.zoom ?? transformRef.current.zoom;\n const o = pending?.offset ?? transformRef.current.offset;\n const a = pending?.anchor ?? null;\n\n commitTransform(z, o, a);\n });\n };\n\n const handleWheel: React.WheelEventHandler<HTMLDivElement> = (event) => {\n if (isEmpty) return;\n\n const sensitivity = event.ctrlKey ? 0.001 : 0.00025;\n const next = transformRef.current.zoom * Math.exp(-event.deltaY * sensitivity);\n\n const anchor = getViewportVectorFromClient(event.clientX, event.clientY);\n scheduleTransform(next, transformRef.current.offset, anchor);\n };\n\n const getClampBounds = (zoomToUse: number) => {\n const width = viewportSize.width;\n const height = viewportSize.height;\n if (!width || !height) return { maxX: 0, maxY: 0 };\n const z = clamp(zoomToUse, minZoom, MAX_ZOOM);\n const scaledWidth = baseMetrics.width * z;\n const scaledHeight = baseMetrics.height * z;\n const maxX = Math.max(0, (scaledWidth - width) / 2);\n const maxY = Math.max(0, (scaledHeight - height) / 2);\n return { maxX, maxY };\n };\n\n const handleInputChange: React.ChangeEventHandler<HTMLInputElement> = (event) => {\n const input = event.target;\n const file = input.files?.[0] ?? null;\n\n if (objectUrlRef.current) {\n URL.revokeObjectURL(objectUrlRef.current);\n objectUrlRef.current = null;\n }\n\n if (!file) {\n setImageSrc(null);\n onFileChange?.(null);\n input.value = '';\n return;\n }\n\n const url = URL.createObjectURL(file);\n objectUrlRef.current = url;\n setImageSrc(url);\n setImageSize(null);\n scheduleTransform(DEFAULT_TRANSFORM.zoom, DEFAULT_TRANSFORM.offset);\n transformRef.current = DEFAULT_TRANSFORM;\n onFileChange?.(file);\n input.value = '';\n };\n\n const handlePointerDown: React.PointerEventHandler<HTMLDivElement> = (event) => {\n if (isEmpty || (event.pointerType === 'mouse' && event.button !== 0)) return;\n\n event.currentTarget.setPointerCapture(event.pointerId);\n\n if (event.pointerType === 'touch') {\n const points = pointers.current;\n points.set(event.pointerId, { x: event.clientX, y: event.clientY });\n if (points.size === 2) {\n dragStartRef.current = null;\n activePointerId.current = null;\n setIsDragging(false);\n const [first, second] = Array.from(points.values());\n pinchDistance.current = Math.hypot(first.x - second.x, first.y - second.y);\n return;\n }\n }\n\n activePointerId.current = event.pointerId;\n dragStartRef.current = {\n x: event.clientX,\n y: event.clientY,\n originX: transformRef.current.offset.x,\n originY: transformRef.current.offset.y,\n };\n };\n\n const handlePointerMove: React.PointerEventHandler<HTMLDivElement> = (event) => {\n if (isEmpty) return;\n\n if (event.pointerType === 'touch') {\n const points = pointers.current;\n if (!points.has(event.pointerId)) return;\n points.set(event.pointerId, { x: event.clientX, y: event.clientY });\n if (points.size === 2) {\n const [first, second] = Array.from(points.values());\n const dx = first.x - second.x;\n const dy = first.y - second.y;\n const distance = Math.hypot(dx, dy);\n const center = { x: (first.x + second.x) / 2, y: (first.y + second.y) / 2 };\n if (pinchDistance.current) {\n const ratio = distance / pinchDistance.current;\n const nextZoom = transformRef.current.zoom * ratio;\n const anchor = getViewportVectorFromClient(center.x, center.y);\n scheduleTransform(nextZoom, transformRef.current.offset, anchor);\n }\n pinchDistance.current = distance;\n return;\n }\n }\n\n if (activePointerId.current !== event.pointerId || !dragStartRef.current || !canDrag) return;\n const dx = event.clientX - dragStartRef.current.x;\n const dy = event.clientY - dragStartRef.current.y;\n const distance = Math.abs(dx) + Math.abs(dy);\n if (!isDragging && distance > 2) setIsDragging(true);\n if (distance <= 1) return;\n scheduleTransform(transformRef.current.zoom, {\n x: dragStartRef.current.originX + dx,\n y: dragStartRef.current.originY + dy,\n });\n };\n\n const handlePointerUp: React.PointerEventHandler<HTMLDivElement> = (event) => {\n if (event.pointerType === 'touch') {\n pointers.current.delete(event.pointerId);\n if (pointers.current.size < 2) pinchDistance.current = null;\n }\n\n if (activePointerId.current === event.pointerId) {\n activePointerId.current = null;\n dragStartRef.current = null;\n setIsDragging(false);\n }\n };\n\n useEffect(() => {\n if (!transform) return;\n\n const z = clamp(transform.zoom, minZoom, MAX_ZOOM);\n transformRef.current = { zoom: z, offset: clampOffset(transform.offset, z) };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [transform, viewportSize.width, viewportSize.height, imageSize?.width, imageSize?.height]);\n\n useEffect(() => {\n return () => {\n if (objectUrlRef.current) URL.revokeObjectURL(objectUrlRef.current);\n };\n }, []);\n\n useEffect(() => {\n const node = viewportRef.current;\n if (!node) return;\n\n const update = () => {\n const rect = node.getBoundingClientRect();\n setViewportSize((prev) =>\n prev.width === rect.width && prev.height === rect.height\n ? prev\n : { width: rect.width, height: rect.height }\n );\n if (onCroppableChange) onCroppableChange(rect);\n };\n\n update();\n\n const handleScroll = () => update();\n window.addEventListener('scroll', handleScroll, true);\n\n if (typeof ResizeObserver === 'undefined') {\n const handleResize = () => update();\n window.addEventListener('resize', handleResize);\n return () => {\n window.removeEventListener('resize', handleResize);\n window.removeEventListener('scroll', handleScroll, true);\n };\n }\n\n const observer = new ResizeObserver(() => update());\n observer.observe(node);\n return () => {\n observer.disconnect();\n window.removeEventListener('scroll', handleScroll, true);\n };\n }, [onCroppableChange]);\n\n useEffect(() => {\n if (transform) return;\n\n const current = transformRef.current.offset;\n const clamped = clampOffset(current, clampedZoom);\n\n if (current.x === clamped.x && current.y === clamped.y) return;\n\n transformRef.current = { zoom: transformRef.current.zoom, offset: clamped };\n setDraftTransform((prev) => ({ ...prev, offset: clamped }));\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [clampedZoom, imageSize, viewportSize.width, viewportSize.height]);\n\n useEffect(() => {\n return () => {\n if (animationFrameRef.current != null) {\n window.cancelAnimationFrame(animationFrameRef.current);\n animationFrameRef.current = null;\n }\n };\n }, []);\n\n const clampBounds = getClampBounds(clampedZoom);\n const canDrag = !isEmpty && (clampBounds.maxX > 0 || clampBounds.maxY > 0);\n\n return (\n <div\n className={styles.croppable}\n onClick={() => {\n if (isEmpty) inputRef.current?.click();\n }}\n >\n <input\n accept='image/*'\n onChange={handleInputChange}\n ref={inputRef}\n type='file'\n />\n <div\n className={styles.viewport}\n ref={viewportRef}\n onDragStart={(event) => event.preventDefault()}\n onPointerDown={handlePointerDown}\n onPointerMove={handlePointerMove}\n onPointerUp={handlePointerUp}\n onPointerCancel={handlePointerUp}\n onWheel={handleWheel}\n style={\n {\n '--croppable-height': `${height ?? DEFAULT_HEIGHT}px`,\n '--croppable-zoom': clampedZoom,\n '--croppable-x': `${currentTransform.offset.x}px`,\n '--croppable-y': `${currentTransform.offset.y}px`,\n ...(imageSize\n ? {\n '--croppable-image-width': `${baseMetrics.width}px`,\n '--croppable-image-height': `${baseMetrics.height}px`,\n }\n : null),\n } as React.CSSProperties\n }\n >\n {isEmpty ? (\n <Figure>\n <Icon name='image' />\n </Figure>\n ) : (\n <div\n className={cx(\n styles.media,\n canDrag && styles.draggable,\n canDrag && isDragging && styles.dragging\n )}\n >\n <div className={cx(styles.inner)}>{content}</div>\n </div>\n )}\n </div>\n </div>\n );\n};\n"],"names":["DEFAULT_HEIGHT","DEFAULT_TRANSFORM","offset","x","y","zoom","MAX_ZOOM","MIN_ZOOM","clamp","value","min","max","Math","Croppable","children","fill","height","onCroppableChange","onFileChange","onTransformChange","transform","activePointerId","useRef","animationFrameRef","dragStartRef","inputRef","objectUrlRef","pendingRef","pinchDistance","pointers","Map","transformRef","viewportRef","imageSize","setImageSize","useState","imageSrc","setImageSrc","isDragging","setIsDragging","draftTransform","setDraftTransform","viewportSize","setViewportSize","width","baseMetrics","getBaseMetrics","minZoom","scaleX","scaleY","cover","rawMinZoom","currentTransform","clampedZoom","content","jsx","event","img","currentTarget","naturalWidth","naturalHeight","isEmpty","clampOffset","next","zoomToUse","maxX","maxY","getClampBounds","getViewportVectorFromClient","clientX","clientY","node","current","rect","getBoundingClientRect","left","top","computeAnchoredOffset","currentOffset","currentZoom","nextZoom","anchorVec","z0","z1","r","commitTransform","nextOffset","anchoredOffset","clampedOffset","scheduleTransform","anchor","window","requestAnimationFrame","pending","z","o","a","handleWheel","sensitivity","ctrlKey","exp","deltaY","scaledWidth","scaledHeight","handleInputChange","input","target","file","files","URL","revokeObjectURL","url","createObjectURL","handlePointerDown","pointerType","button","setPointerCapture","pointerId","points","set","size","first","second","Array","from","values","hypot","originX","originY","handlePointerMove","has","dx","dy","distance","center","ratio","canDrag","abs","handlePointerUp","delete","useEffect","update","prev","handleScroll","addEventListener","ResizeObserver","handleResize","removeEventListener","observer","observe","disconnect","clamped","cancelAnimationFrame","clampBounds","styles","croppable","click","viewport","preventDefault","Figure","Icon","cx","media","draggable","dragging","inner"],"mappings":"scAsBMA,GAAiB,IACjBC,EAAwC,CAAEC,OAAQ,CAAEC,EAAG,EAAGC,EAAG,CAAA,EAAKC,KAAM,CAAE,EAC1EC,EAAW,GACXC,EAAW,GAEXC,EAAQA,CAACC,EAAeC,EAAaC,IAAgBC,KAAKF,IAAIC,EAAKC,KAAKD,IAAID,EAAKD,CAAK,CAAC,EAEhFI,GAAYA,CAAC,CACxBC,SAAAA,EACAC,KAAAA,EAAO,OACPC,OAAAA,EACAC,kBAAAA,EACAC,aAAAA,EACAC,kBAAAA,EACAC,UAAAA,CACc,IAAM,CACpB,MAAMC,EAAkBC,EAAAA,OAAsB,I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,EAAOQ,MACP1B,GAAWkB,EAAOS,UAClB3B,GAAWlG,GAAcoH,EAAOU,QAClC,EAEA,SAAA7G,MAAC,MAAA,CAAI,UAAW0G,GAAAA,EAAGP,EAAOW,KAAK,EAAI/G,SAAAA,CAAAA,CAAQ,EAC7C,CAAA,CAEJ,CAAA,EACF,CAEJ"}
1
+ {"version":3,"file":"index.cjs","sources":["../../../src/components/_croppable/index.tsx"],"sourcesContent":["import cx from 'classix';\nimport React, { useEffect, useRef, useState } from 'react';\n\nimport { Button } from '../button';\nimport { Figure } from '../figure';\nimport { Icon } from '../icon';\nimport styles from './styles.module.css';\n\nexport type CroppableTransform = {\n offset: { x: number; y: number };\n zoom: number;\n};\n\nexport type CroppableProps = {\n children?: React.ReactNode;\n fill?: 'width' | 'height' | 'none';\n height?: number;\n image?: string | null;\n label?: string;\n onCroppableChange?: (rect: DOMRect) => void;\n onFileChange?: (file: File | null) => void;\n onImageChange?: (file: File | null) => void;\n onTransformChange?: (transform: CroppableTransform) => void;\n standalone?: boolean;\n transform?: CroppableTransform;\n};\n\nconst DEFAULT_HEIGHT = 192;\nconst DEFAULT_TRANSFORM: CroppableTransform = { offset: { x: 0, y: 0 }, zoom: 1 };\nconst EMPTY_STATE_LABEL = 'Select image';\nconst MAX_ZOOM = 10;\nconst MIN_ZOOM = 0.1;\nconst IMAGE_EXPORT_QUALITY = 0.92;\n\nconst clamp = (value: number, min: number, max: number) => Math.min(max, Math.max(min, value));\n\nconst loadImage = (file: File) =>\n new Promise<HTMLImageElement>((resolve, reject) => {\n const url = URL.createObjectURL(file);\n const image = new globalThis.Image();\n\n image.onload = () => {\n URL.revokeObjectURL(url);\n resolve(image);\n };\n image.onerror = () => {\n URL.revokeObjectURL(url);\n reject(new Error('croppable-image-load-failed'));\n };\n\n image.src = url;\n });\n\nconst createCroppedFile = async ({\n file,\n fill,\n transform,\n viewport,\n}: {\n file: File;\n fill: 'width' | 'height' | 'none';\n transform: CroppableTransform;\n viewport: { width: number; height: number };\n}) => {\n const image = await loadImage(file);\n const widthRatio = viewport.width / image.naturalWidth;\n const heightRatio = viewport.height / image.naturalHeight;\n const coverRatio = Math.max(widthRatio, heightRatio);\n const baseWidth = image.naturalWidth * coverRatio;\n const baseHeight = image.naturalHeight * coverRatio;\n const minZoom =\n fill === 'width'\n ? Math.max(MIN_ZOOM, widthRatio / coverRatio)\n : fill === 'height'\n ? Math.max(MIN_ZOOM, heightRatio / coverRatio)\n : MIN_ZOOM;\n const zoom = clamp(transform.zoom, minZoom, MAX_ZOOM);\n const scale = coverRatio * zoom;\n const renderedWidth = baseWidth * zoom;\n const renderedHeight = baseHeight * zoom;\n const left = (viewport.width - renderedWidth) / 2 + transform.offset.x;\n const top = (viewport.height - renderedHeight) / 2 + transform.offset.y;\n const sourceX = clamp((0 - left) / scale, 0, image.naturalWidth);\n const sourceY = clamp((0 - top) / scale, 0, image.naturalHeight);\n const sourceWidth = clamp(viewport.width / scale, 1, Math.max(1, image.naturalWidth - sourceX));\n const sourceHeight = clamp(\n viewport.height / scale,\n 1,\n Math.max(1, image.naturalHeight - sourceY)\n );\n const canvas = document.createElement('canvas');\n const context = canvas.getContext('2d');\n\n if (!context) {\n throw new Error('croppable-image-context-missing');\n }\n\n canvas.width = Math.max(1, Math.round(sourceWidth));\n canvas.height = Math.max(1, Math.round(sourceHeight));\n context.drawImage(\n image,\n sourceX,\n sourceY,\n sourceWidth,\n sourceHeight,\n 0,\n 0,\n canvas.width,\n canvas.height\n );\n\n const outputType = file.type.startsWith('image/') ? file.type : 'image/jpeg';\n const blob = await new Promise<Blob | null>((resolve) => {\n canvas.toBlob(resolve, outputType, IMAGE_EXPORT_QUALITY);\n });\n\n if (!blob) {\n throw new Error('croppable-image-export-failed');\n }\n\n return new globalThis.File([blob], file.name, {\n lastModified: Date.now(),\n type: blob.type || outputType,\n });\n};\n\nexport const Croppable = ({\n children,\n fill = 'none',\n height,\n image,\n label,\n onCroppableChange,\n onFileChange,\n onImageChange,\n onTransformChange,\n transform,\n standalone,\n}: CroppableProps) => {\n const activePointerId = useRef<number | null>(null);\n const animationFrameRef = useRef<number | null>(null);\n const dragStartRef = useRef<{ x: number; y: number; originX: number; originY: number } | null>(\n null\n );\n const inputRef = useRef<HTMLInputElement>(null);\n const onImageChangeRef = useRef(onImageChange);\n const objectUrlRef = useRef<string | null>(null);\n const pendingRef = useRef<{\n zoom: number;\n offset: { x: number; y: number };\n anchor: { x: number; y: number } | null;\n } | null>(null);\n const pinchDistance = useRef<number | null>(null);\n const pointers = useRef<Map<number, { x: number; y: number }>>(new Map());\n const transformRef = useRef<CroppableTransform>(DEFAULT_TRANSFORM);\n const viewportRef = useRef<HTMLDivElement>(null);\n\n const [imageSize, setImageSize] = useState<{ width: number; height: number } | null>(null);\n const [imageSrc, setImageSrc] = useState<string | null>(null);\n const [isDragging, setIsDragging] = useState(false);\n const [draftTransform, setDraftTransform] = useState<CroppableTransform>(DEFAULT_TRANSFORM);\n const [sourceFile, setSourceFile] = useState<File | null>(null);\n const [viewportSize, setViewportSize] = useState({ width: 0, height: 0 });\n\n const getBaseMetrics = () => {\n const width = viewportSize.width;\n const height = viewportSize.height;\n\n if (!width || !height) return { width: 0, height: 0, minZoom: MIN_ZOOM };\n if (!imageSize) return { width, height, minZoom: MIN_ZOOM };\n\n const scaleX = width / imageSize.width;\n const scaleY = height / imageSize.height;\n const cover = Math.max(scaleX, scaleY);\n\n const rawMinZoom = fill === 'width' ? scaleX / cover : fill === 'height' ? scaleY / cover : 0;\n\n return {\n width: imageSize.width * cover,\n height: imageSize.height * cover,\n minZoom: Math.max(MIN_ZOOM, rawMinZoom),\n };\n };\n\n const baseMetrics = getBaseMetrics();\n const minZoom = baseMetrics.minZoom;\n\n const currentTransform = transform ?? draftTransform;\n const clampedZoom = clamp(currentTransform.zoom, minZoom, MAX_ZOOM);\n const displayImage = imageSrc ?? image ?? null;\n const hasPresetImage = !children && !!image && !imageSrc && !sourceFile;\n const canTransform = !hasPresetImage;\n const content =\n children ??\n (displayImage ? (\n <img\n alt=''\n draggable={false}\n onLoad={(event) => {\n const img = event.currentTarget;\n if (img.naturalWidth && img.naturalHeight) {\n setImageSize({ width: img.naturalWidth, height: img.naturalHeight });\n }\n }}\n src={displayImage}\n />\n ) : null);\n const isEmpty = content == null;\n\n const clampOffset = (next: { x: number; y: number }, zoomToUse: number) => {\n const { maxX, maxY } = getClampBounds(zoomToUse);\n return {\n x: clamp(next.x, -maxX, maxX),\n y: clamp(next.y, -maxY, maxY),\n };\n };\n\n const getViewportVectorFromClient = (clientX: number, clientY: number) => {\n const node = viewportRef.current;\n if (!node) return null;\n const rect = node.getBoundingClientRect();\n const x = clientX - rect.left - rect.width / 2;\n const y = clientY - rect.top - rect.height / 2;\n return { x, y };\n };\n\n const computeAnchoredOffset = (\n currentOffset: { x: number; y: number },\n currentZoom: number,\n nextZoom: number,\n anchorVec: { x: number; y: number }\n ) => {\n const z0 = clamp(currentZoom, minZoom, MAX_ZOOM);\n const z1 = clamp(nextZoom, minZoom, MAX_ZOOM);\n if (z0 === 0) return currentOffset;\n const r = z1 / z0;\n return {\n x: (1 - r) * anchorVec.x + r * currentOffset.x,\n y: (1 - r) * anchorVec.y + r * currentOffset.y,\n };\n };\n\n const commitTransform = (\n nextZoom: number,\n nextOffset: { x: number; y: number },\n anchorVec?: { x: number; y: number } | null\n ) => {\n const z0 = transformRef.current.zoom;\n const z1 = clamp(nextZoom, minZoom, MAX_ZOOM);\n const currentOffset = transformRef.current.offset;\n const anchoredOffset = anchorVec\n ? computeAnchoredOffset(currentOffset, z0, z1, anchorVec)\n : nextOffset;\n const clampedOffset = clampOffset(anchoredOffset, z1);\n transformRef.current = { zoom: z1, offset: clampedOffset };\n\n if (!transform) {\n setDraftTransform({ zoom: z1, offset: clampedOffset });\n }\n onTransformChange?.({ zoom: z1, offset: clampedOffset });\n };\n\n const scheduleTransform = (\n nextZoom: number,\n nextOffset: { x: number; y: number },\n anchorVec?: { x: number; y: number } | null\n ) => {\n pendingRef.current = {\n zoom: nextZoom,\n offset: nextOffset,\n anchor: anchorVec ?? null,\n };\n\n if (animationFrameRef.current != null) return;\n\n animationFrameRef.current = window.requestAnimationFrame(() => {\n animationFrameRef.current = null;\n\n const pending = pendingRef.current;\n pendingRef.current = null;\n\n const z = pending?.zoom ?? transformRef.current.zoom;\n const o = pending?.offset ?? transformRef.current.offset;\n const a = pending?.anchor ?? null;\n\n commitTransform(z, o, a);\n });\n };\n\n const handleWheel: React.WheelEventHandler<HTMLDivElement> = (event) => {\n if (isEmpty || !canTransform) return;\n\n const sensitivity = event.ctrlKey ? 0.001 : 0.00025;\n const next = transformRef.current.zoom * Math.exp(-event.deltaY * sensitivity);\n\n const anchor = getViewportVectorFromClient(event.clientX, event.clientY);\n scheduleTransform(next, transformRef.current.offset, anchor);\n };\n\n const getClampBounds = (zoomToUse: number) => {\n const width = viewportSize.width;\n const height = viewportSize.height;\n if (!width || !height) return { maxX: 0, maxY: 0 };\n const z = clamp(zoomToUse, minZoom, MAX_ZOOM);\n const scaledWidth = baseMetrics.width * z;\n const scaledHeight = baseMetrics.height * z;\n const maxX = Math.max(0, (scaledWidth - width) / 2);\n const maxY = Math.max(0, (scaledHeight - height) / 2);\n return { maxX, maxY };\n };\n\n const handleInputChange: React.ChangeEventHandler<HTMLInputElement> = (event) => {\n const input = event.target;\n const file = input.files?.[0] ?? null;\n\n if (objectUrlRef.current) {\n URL.revokeObjectURL(objectUrlRef.current);\n objectUrlRef.current = null;\n }\n\n if (!file) {\n setImageSrc(null);\n setSourceFile(null);\n onFileChange?.(null);\n input.value = '';\n return;\n }\n\n const url = URL.createObjectURL(file);\n objectUrlRef.current = url;\n setImageSrc(url);\n setImageSize(null);\n setSourceFile(file);\n scheduleTransform(DEFAULT_TRANSFORM.zoom, DEFAULT_TRANSFORM.offset);\n transformRef.current = DEFAULT_TRANSFORM;\n onFileChange?.(file);\n input.value = '';\n };\n\n const handlePointerDown: React.PointerEventHandler<HTMLDivElement> = (event) => {\n if (isEmpty || !canTransform || (event.pointerType === 'mouse' && event.button !== 0)) return;\n\n event.currentTarget.setPointerCapture(event.pointerId);\n\n if (event.pointerType === 'touch') {\n const points = pointers.current;\n points.set(event.pointerId, { x: event.clientX, y: event.clientY });\n if (points.size === 2) {\n dragStartRef.current = null;\n activePointerId.current = null;\n setIsDragging(false);\n const [first, second] = Array.from(points.values());\n pinchDistance.current = Math.hypot(first.x - second.x, first.y - second.y);\n return;\n }\n }\n\n activePointerId.current = event.pointerId;\n dragStartRef.current = {\n x: event.clientX,\n y: event.clientY,\n originX: transformRef.current.offset.x,\n originY: transformRef.current.offset.y,\n };\n };\n\n const handlePointerMove: React.PointerEventHandler<HTMLDivElement> = (event) => {\n if (isEmpty || !canTransform) return;\n\n if (event.pointerType === 'touch') {\n const points = pointers.current;\n if (!points.has(event.pointerId)) return;\n points.set(event.pointerId, { x: event.clientX, y: event.clientY });\n if (points.size === 2) {\n const [first, second] = Array.from(points.values());\n const dx = first.x - second.x;\n const dy = first.y - second.y;\n const distance = Math.hypot(dx, dy);\n const center = { x: (first.x + second.x) / 2, y: (first.y + second.y) / 2 };\n if (pinchDistance.current) {\n const ratio = distance / pinchDistance.current;\n const nextZoom = transformRef.current.zoom * ratio;\n const anchor = getViewportVectorFromClient(center.x, center.y);\n scheduleTransform(nextZoom, transformRef.current.offset, anchor);\n }\n pinchDistance.current = distance;\n return;\n }\n }\n\n if (activePointerId.current !== event.pointerId || !dragStartRef.current || !canDrag) return;\n const dx = event.clientX - dragStartRef.current.x;\n const dy = event.clientY - dragStartRef.current.y;\n const distance = Math.abs(dx) + Math.abs(dy);\n if (!isDragging && distance > 2) setIsDragging(true);\n if (distance <= 1) return;\n scheduleTransform(transformRef.current.zoom, {\n x: dragStartRef.current.originX + dx,\n y: dragStartRef.current.originY + dy,\n });\n };\n\n const handlePointerUp: React.PointerEventHandler<HTMLDivElement> = (event) => {\n if (event.pointerType === 'touch') {\n pointers.current.delete(event.pointerId);\n if (pointers.current.size < 2) pinchDistance.current = null;\n }\n\n if (activePointerId.current === event.pointerId) {\n activePointerId.current = null;\n dragStartRef.current = null;\n setIsDragging(false);\n }\n };\n\n useEffect(() => {\n if (!transform) return;\n\n const z = clamp(transform.zoom, minZoom, MAX_ZOOM);\n transformRef.current = { zoom: z, offset: clampOffset(transform.offset, z) };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [transform, viewportSize.width, viewportSize.height, imageSize?.width, imageSize?.height]);\n\n useEffect(() => {\n return () => {\n if (objectUrlRef.current) URL.revokeObjectURL(objectUrlRef.current);\n };\n }, []);\n\n useEffect(() => {\n const node = viewportRef.current;\n if (!node) return;\n\n const update = () => {\n const rect = node.getBoundingClientRect();\n setViewportSize((prev) =>\n prev.width === rect.width && prev.height === rect.height\n ? prev\n : { width: rect.width, height: rect.height }\n );\n if (onCroppableChange) onCroppableChange(rect);\n };\n\n update();\n\n const handleScroll = () => update();\n window.addEventListener('scroll', handleScroll, true);\n\n if (typeof ResizeObserver === 'undefined') {\n const handleResize = () => update();\n window.addEventListener('resize', handleResize);\n return () => {\n window.removeEventListener('resize', handleResize);\n window.removeEventListener('scroll', handleScroll, true);\n };\n }\n\n const observer = new ResizeObserver(() => update());\n observer.observe(node);\n return () => {\n observer.disconnect();\n window.removeEventListener('scroll', handleScroll, true);\n };\n }, [onCroppableChange]);\n\n useEffect(() => {\n if (transform) return;\n\n const current = transformRef.current.offset;\n const clamped = clampOffset(current, clampedZoom);\n\n if (current.x === clamped.x && current.y === clamped.y) return;\n\n transformRef.current = { zoom: transformRef.current.zoom, offset: clamped };\n setDraftTransform((prev) => ({ ...prev, offset: clamped }));\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [clampedZoom, imageSize, viewportSize.width, viewportSize.height]);\n\n useEffect(() => {\n if (!displayImage) {\n setImageSize(null);\n }\n }, [displayImage]);\n\n useEffect(() => {\n onImageChangeRef.current = onImageChange;\n }, [onImageChange]);\n\n useEffect(() => {\n if (!onImageChange) return;\n\n if (!sourceFile || !viewportSize.width || !viewportSize.height || children) {\n onImageChangeRef.current?.(null);\n return;\n }\n\n let isActive = true;\n const timeout = window.setTimeout(() => {\n createCroppedFile({\n file: sourceFile,\n fill,\n transform: {\n zoom: clampedZoom,\n offset: currentTransform.offset,\n },\n viewport: viewportSize,\n })\n .then((nextFile) => {\n if (isActive) {\n onImageChangeRef.current?.(nextFile);\n }\n })\n .catch(() => {\n if (isActive) {\n onImageChangeRef.current?.(null);\n }\n });\n }, 75);\n\n return () => {\n isActive = false;\n window.clearTimeout(timeout);\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [\n children,\n clampedZoom,\n currentTransform.offset,\n fill,\n sourceFile,\n viewportSize,\n ]);\n\n useEffect(() => {\n return () => {\n if (animationFrameRef.current != null) {\n window.cancelAnimationFrame(animationFrameRef.current);\n animationFrameRef.current = null;\n }\n };\n }, []);\n\n const clampBounds = getClampBounds(clampedZoom);\n const canDrag = !isEmpty && canTransform && (clampBounds.maxX > 0 || clampBounds.maxY > 0);\n const openFilePicker = () => inputRef.current?.click();\n const handleSelectImageClick: React.MouseEventHandler<HTMLButtonElement> = (event) => {\n event.preventDefault();\n event.stopPropagation();\n openFilePicker();\n };\n\n return (\n <div\n className={cx(styles.croppable, standalone && styles.standalone)}\n onClick={() => {\n if (isEmpty) openFilePicker();\n }}\n >\n <input\n accept='image/*'\n onChange={handleInputChange}\n ref={inputRef}\n type='file'\n />\n <div\n className={styles.viewport}\n ref={viewportRef}\n onDragStart={(event) => event.preventDefault()}\n onPointerDown={handlePointerDown}\n onPointerMove={handlePointerMove}\n onPointerUp={handlePointerUp}\n onPointerCancel={handlePointerUp}\n onWheel={handleWheel}\n style={\n {\n '--croppable-height': `${height ?? DEFAULT_HEIGHT}px`,\n '--croppable-zoom': clampedZoom,\n '--croppable-x': `${currentTransform.offset.x}px`,\n '--croppable-y': `${currentTransform.offset.y}px`,\n ...(imageSize\n ? {\n '--croppable-image-width': `${baseMetrics.width}px`,\n '--croppable-image-height': `${baseMetrics.height}px`,\n }\n : null),\n } as React.CSSProperties\n }\n >\n {isEmpty ? (\n <div className={styles.empty}>\n <Figure>\n <Icon\n name='image'\n size='large'\n />\n </Figure>\n <Button\n onClick={handleSelectImageClick}\n >\n {label ?? EMPTY_STATE_LABEL}\n </Button>\n </div>\n ) : (\n <div\n className={cx(\n styles.media,\n canDrag && styles.draggable,\n canDrag && isDragging && styles.dragging\n )}\n >\n <div className={cx(styles.inner)}>{content}</div>\n {hasPresetImage && (\n <div className={styles.overlay}>\n <div className={styles.empty}>\n <Figure>\n <Icon\n name='image'\n size='large'\n />\n </Figure>\n <Button\n onClick={handleSelectImageClick}\n >\n {label ?? EMPTY_STATE_LABEL}\n </Button>\n </div>\n </div>\n )}\n </div>\n )}\n </div>\n </div>\n );\n};\n"],"names":["DEFAULT_HEIGHT","DEFAULT_TRANSFORM","offset","x","y","zoom","EMPTY_STATE_LABEL","MAX_ZOOM","MIN_ZOOM","IMAGE_EXPORT_QUALITY","clamp","value","min","max","Math","loadImage","file","Promise","resolve","reject","url","URL","createObjectURL","image","globalThis","Image","onload","revokeObjectURL","onerror","Error","src","createCroppedFile","fill","transform","viewport","widthRatio","width","naturalWidth","heightRatio","height","naturalHeight","coverRatio","baseWidth","baseHeight","minZoom","scale","renderedWidth","renderedHeight","left","top","sourceX","sourceY","sourceWidth","sourceHeight","canvas","document","createElement","context","getContext","round","drawImage","outputType","type","startsWith","blob","toBlob","File","name","lastModified","Date","now","Croppable","children","label","onCroppableChange","onFileChange","onImageChange","onTransformChange","standalone","activePointerId","useRef","animationFrameRef","dragStartRef","inputRef","onImageChangeRef","objectUrlRef","pendingRef","pinchDistance","pointers","Map","transformRef","viewportRef","imageSize","setImageSize","useState","imageSrc","setImageSrc","isDragging","setIsDragging","draftTransform","setDraftTransform","sourceFile","setSourceFile","viewportSize","setViewportSize","baseMetrics","getBaseMetrics","scaleX","scaleY","cover","rawMinZoom","currentTransform","clampedZoom","displayImage","hasPresetImage","canTransform","content","jsx","event","img","currentTarget","isEmpty","clampOffset","next","zoomToUse","maxX","maxY","getClampBounds","getViewportVectorFromClient","clientX","clientY","node","current","rect","getBoundingClientRect","computeAnchoredOffset","currentOffset","currentZoom","nextZoom","anchorVec","z0","z1","r","commitTransform","nextOffset","anchoredOffset","clampedOffset","scheduleTransform","anchor","window","requestAnimationFrame","pending","z","o","a","handleWheel","sensitivity","ctrlKey","exp","deltaY","scaledWidth","scaledHeight","handleInputChange","input","target","files","handlePointerDown","pointerType","button","setPointerCapture","pointerId","points","set","size","first","second","Array","from","values","hypot","originX","originY","handlePointerMove","has","dx","dy","distance","center","ratio","canDrag","abs","handlePointerUp","delete","useEffect","update","prev","handleScroll","addEventListener","ResizeObserver","handleResize","removeEventListener","observer","observe","disconnect","clamped","isActive","timeout","setTimeout","then","nextFile","catch","clearTimeout","cancelAnimationFrame","clampBounds","openFilePicker","click","handleSelectImageClick","preventDefault","stopPropagation","jsxs","cx","styles","croppable","empty","Figure","Icon","Button","media","draggable","dragging","inner","overlay"],"mappings":"glBA2BMA,GAAiB,IACjBC,EAAwC,CAAEC,OAAQ,CAAEC,EAAG,EAAGC,EAAG,CAAA,EAAKC,KAAM,CAAE,EAC1EC,GAAoB,eACpBC,EAAW,GACXC,EAAW,GACXC,GAAuB,IAEvBC,EAAQA,CAACC,EAAeC,EAAaC,IAAgBC,KAAKF,IAAIC,EAAKC,KAAKD,IAAID,EAAKD,CAAK,CAAC,EAEvFI,GAAaC,GACjB,IAAIC,QAA0B,CAACC,EAASC,IAAW,CACjD,MAAMC,EAAMC,IAAIC,gBAAgBN,CAAI,EAC9BO,EAAQ,IAAIC,WAAWC,MAE7BF,EAAMG,OAAS,IAAM,CACnBL,IAAIM,gBAAgBP,CAAG,EACvBF,EAAQK,CAAK,CACf,EACAA,EAAMK,QAAU,IAAM,CACpBP,IAAIM,gBAAgBP,CAAG,EACvBD,EAAO,IAAIU,MAAM,6BAA6B,CAAC,CACjD,EAEAN,EAAMO,IAAMV,CACd,CAAC,EAEGW,GAAoB,MAAO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