@commercetools/nimbus 0.0.12-rc2 → 0.0.12-rc3

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 (102) hide show
  1. package/dist/chunks/{alert-DF3J6Yj7.cjs.js → alert-CsJON6h-.cjs.js} +2 -2
  2. package/dist/chunks/{alert-DF3J6Yj7.cjs.js.map → alert-CsJON6h-.cjs.js.map} +1 -1
  3. package/dist/chunks/{button-BfmWlfwH.cjs.js → button-CihUSHJo.cjs.js} +2 -2
  4. package/dist/chunks/{button-BfmWlfwH.cjs.js.map → button-CihUSHJo.cjs.js.map} +1 -1
  5. package/dist/chunks/{calendar-BgHBd6Dh.cjs.js → calendar-C-YasyPe.cjs.js} +2 -2
  6. package/dist/chunks/{calendar-BgHBd6Dh.cjs.js.map → calendar-C-YasyPe.cjs.js.map} +1 -1
  7. package/dist/chunks/{checkbox-BbdENF1i.cjs.js → checkbox-6DkVAh4W.cjs.js} +2 -2
  8. package/dist/chunks/{checkbox-BbdENF1i.cjs.js.map → checkbox-6DkVAh4W.cjs.js.map} +1 -1
  9. package/dist/chunks/{combobox-DIKvq4tw.cjs.js → combobox-CLGVlx_7.cjs.js} +2 -2
  10. package/dist/chunks/{combobox-DIKvq4tw.cjs.js.map → combobox-CLGVlx_7.cjs.js.map} +1 -1
  11. package/dist/chunks/{data-table-Cenvhz5D.cjs.js → data-table-B8hn0UVI.cjs.js} +2 -2
  12. package/dist/chunks/{data-table-Cenvhz5D.cjs.js.map → data-table-B8hn0UVI.cjs.js.map} +1 -1
  13. package/dist/chunks/{data-table-CWSmm1Cq.es.js → data-table-BmhYF5gH.es.js} +1 -2
  14. package/dist/chunks/{data-table-CWSmm1Cq.es.js.map → data-table-BmhYF5gH.es.js.map} +1 -1
  15. package/dist/chunks/{date-input-CKu2_a2x.cjs.js → date-input-VXO92NPV.cjs.js} +2 -2
  16. package/dist/chunks/{date-input-CKu2_a2x.cjs.js.map → date-input-VXO92NPV.cjs.js.map} +1 -1
  17. package/dist/chunks/{date-picker-DQ6_2mzc.cjs.js → date-picker-DNaxpmgh.cjs.js} +2 -2
  18. package/dist/chunks/{date-picker-DQ6_2mzc.cjs.js.map → date-picker-DNaxpmgh.cjs.js.map} +1 -1
  19. package/dist/chunks/{date-range-picker-i33UHqUE.cjs.js → date-range-picker-B5s-AFSY.cjs.js} +2 -2
  20. package/dist/chunks/{date-range-picker-i33UHqUE.cjs.js.map → date-range-picker-B5s-AFSY.cjs.js.map} +1 -1
  21. package/dist/chunks/{extractStyleProps-BFdEZDYW.cjs.js → extractStyleProps-BsLft3q1.cjs.js} +2 -2
  22. package/dist/chunks/{extractStyleProps-BFdEZDYW.cjs.js.map → extractStyleProps-BsLft3q1.cjs.js.map} +1 -1
  23. package/dist/chunks/{form-field-SFG0Jvp7.cjs.js → form-field-BjT4m4AE.cjs.js} +2 -2
  24. package/dist/chunks/{form-field-SFG0Jvp7.cjs.js.map → form-field-BjT4m4AE.cjs.js.map} +1 -1
  25. package/dist/chunks/{icon-button-D0NyGafI.cjs.js → icon-button-DOo2GUqd.cjs.js} +2 -2
  26. package/dist/chunks/{icon-button-D0NyGafI.cjs.js.map → icon-button-DOo2GUqd.cjs.js.map} +1 -1
  27. package/dist/chunks/{icon-toggle-button-yeQuEUBY.cjs.js → icon-toggle-button-DmYB27yi.cjs.js} +2 -2
  28. package/dist/chunks/{icon-toggle-button-yeQuEUBY.cjs.js.map → icon-toggle-button-DmYB27yi.cjs.js.map} +1 -1
  29. package/dist/chunks/{index-sFOzzmTG.cjs.js → index-BsmdMT4w.cjs.js} +2 -2
  30. package/dist/chunks/{index-sFOzzmTG.cjs.js.map → index-BsmdMT4w.cjs.js.map} +1 -1
  31. package/dist/chunks/index-Dvel3Oj5.es.js.map +1 -1
  32. package/dist/chunks/{menu-CImIQ6uJ.cjs.js → menu-C8il9--K.cjs.js} +2 -2
  33. package/dist/chunks/{menu-CImIQ6uJ.cjs.js.map → menu-C8il9--K.cjs.js.map} +1 -1
  34. package/dist/chunks/{multiline-text-input-jdvlKAq1.cjs.js → multiline-text-input-D28clI-o.cjs.js} +2 -2
  35. package/dist/chunks/{multiline-text-input-jdvlKAq1.cjs.js.map → multiline-text-input-D28clI-o.cjs.js.map} +1 -1
  36. package/dist/chunks/{nimbus-provider-CBZCiFEH.cjs.js → nimbus-provider-BlfO5_bi.cjs.js} +2 -2
  37. package/dist/chunks/{nimbus-provider-CBZCiFEH.cjs.js.map → nimbus-provider-BlfO5_bi.cjs.js.map} +1 -1
  38. package/dist/chunks/{number-input-CnOvkmap.cjs.js → number-input-CCEiz-4P.cjs.js} +2 -2
  39. package/dist/chunks/{number-input-CnOvkmap.cjs.js.map → number-input-CCEiz-4P.cjs.js.map} +1 -1
  40. package/dist/chunks/{password-input-DSeCpNT-.cjs.js → password-input-DY4slQHQ.cjs.js} +2 -2
  41. package/dist/chunks/{password-input-DSeCpNT-.cjs.js.map → password-input-DY4slQHQ.cjs.js.map} +1 -1
  42. package/dist/chunks/{progress-bar-CByPgKbP.cjs.js → progress-bar-0RRIR4ef.cjs.js} +2 -2
  43. package/dist/chunks/{progress-bar-CByPgKbP.cjs.js.map → progress-bar-0RRIR4ef.cjs.js.map} +1 -1
  44. package/dist/chunks/{radio-input-VMfD6a_K.cjs.js → radio-input-B40xSi6r.cjs.js} +2 -2
  45. package/dist/chunks/{radio-input-VMfD6a_K.cjs.js.map → radio-input-B40xSi6r.cjs.js.map} +1 -1
  46. package/dist/chunks/{range-calendar-CnaQY0pH.cjs.js → range-calendar-BiNek1C7.cjs.js} +2 -2
  47. package/dist/chunks/{range-calendar-CnaQY0pH.cjs.js.map → range-calendar-BiNek1C7.cjs.js.map} +1 -1
  48. package/dist/chunks/{rich-text-input-DmwKaXzi.cjs.js → rich-text-input-gNWvLb4m.cjs.js} +2 -2
  49. package/dist/chunks/{rich-text-input-DmwKaXzi.cjs.js.map → rich-text-input-gNWvLb4m.cjs.js.map} +1 -1
  50. package/dist/chunks/{select-DT9EbJgb.cjs.js → select-BuXA5VgT.cjs.js} +2 -2
  51. package/dist/chunks/{select-DT9EbJgb.cjs.js.map → select-BuXA5VgT.cjs.js.map} +1 -1
  52. package/dist/chunks/{split-button-i2Ezbf3P.cjs.js → split-button-CgQYMeH7.cjs.js} +2 -2
  53. package/dist/chunks/{split-button-i2Ezbf3P.cjs.js.map → split-button-CgQYMeH7.cjs.js.map} +1 -1
  54. package/dist/chunks/{switch-kNksAQM3.cjs.js → switch-BQXiI02l.cjs.js} +2 -2
  55. package/dist/chunks/{switch-kNksAQM3.cjs.js.map → switch-BQXiI02l.cjs.js.map} +1 -1
  56. package/dist/chunks/{tag-group-iRBYcxt6.cjs.js → tag-group-DwTq8DeA.cjs.js} +2 -2
  57. package/dist/chunks/{tag-group-iRBYcxt6.cjs.js.map → tag-group-DwTq8DeA.cjs.js.map} +1 -1
  58. package/dist/chunks/{text-input-D7SdSWpG.cjs.js → text-input-DJUpcp3k.cjs.js} +2 -2
  59. package/dist/chunks/{text-input-D7SdSWpG.cjs.js.map → text-input-DJUpcp3k.cjs.js.map} +1 -1
  60. package/dist/chunks/{time-input-BqTsxXMD.cjs.js → time-input-B5oRiIpu.cjs.js} +2 -2
  61. package/dist/chunks/{time-input-BqTsxXMD.cjs.js.map → time-input-B5oRiIpu.cjs.js.map} +1 -1
  62. package/dist/chunks/{toggle-button-CsVyAh8N.cjs.js → toggle-button-C_7Evcn3.cjs.js} +2 -2
  63. package/dist/chunks/{toggle-button-CsVyAh8N.cjs.js.map → toggle-button-C_7Evcn3.cjs.js.map} +1 -1
  64. package/dist/chunks/{toolbar-DcUEC_uE.cjs.js → toolbar-BUYkQMPz.cjs.js} +2 -2
  65. package/dist/chunks/{toolbar-DcUEC_uE.cjs.js.map → toolbar-BUYkQMPz.cjs.js.map} +1 -1
  66. package/dist/components/alert.cjs +1 -1
  67. package/dist/components/button.cjs +1 -1
  68. package/dist/components/calendar.cjs +1 -1
  69. package/dist/components/checkbox.cjs +1 -1
  70. package/dist/components/combobox.cjs +1 -1
  71. package/dist/components/components.cjs +1 -1
  72. package/dist/components/components.es.js +1 -1
  73. package/dist/components/data-table.cjs +1 -1
  74. package/dist/components/data-table.es.js +1 -1
  75. package/dist/components/date-input.cjs +1 -1
  76. package/dist/components/date-picker.cjs +1 -1
  77. package/dist/components/date-range-picker.cjs +1 -1
  78. package/dist/components/form-field.cjs +1 -1
  79. package/dist/components/icon-button.cjs +1 -1
  80. package/dist/components/icon-toggle-button.cjs +1 -1
  81. package/dist/components/multiline-text-input.cjs +1 -1
  82. package/dist/components/nimbus-provider.cjs +1 -1
  83. package/dist/components/number-input.cjs +1 -1
  84. package/dist/components/password-input.cjs +1 -1
  85. package/dist/components/progress-bar.cjs +1 -1
  86. package/dist/components/radio-input.cjs +1 -1
  87. package/dist/components/range-calendar.cjs +1 -1
  88. package/dist/components/rich-text-input.cjs +1 -1
  89. package/dist/components/select.cjs +1 -1
  90. package/dist/components/split-button.cjs +1 -1
  91. package/dist/components/switch.cjs +1 -1
  92. package/dist/components/tag-group.cjs +1 -1
  93. package/dist/components/text-input.cjs +1 -1
  94. package/dist/components/time-input.cjs +1 -1
  95. package/dist/components/toggle-button.cjs +1 -1
  96. package/dist/components/toolbar.cjs +1 -1
  97. package/dist/components.d.ts +35 -35
  98. package/dist/data-table.d.ts +35 -35
  99. package/dist/index.cjs +1 -1
  100. package/dist/index.d.ts +35 -35
  101. package/dist/index.es.js +1 -1
  102. package/package.json +3 -3
@@ -1,2 +1,2 @@
1
- "use strict";const I=require("react/jsx-runtime"),z=require("./index-sFOzzmTG.cjs.js"),h=require("./utils-BHdR5Nww.cjs.js"),J=require("./FieldError-DyGFfqST.cjs.js"),Q=require("./Form-BuOomA4T.cjs.js"),X=require("./Label-BgrYyYXn.cjs.js"),Y=require("./Text-BWSfeB9p.cjs.js"),m=require("./mergeProps-BA5Cwf5w.cjs.js"),F=require("./filterDOMProps-WUskt27c.cjs.js"),Z=require("./useObjectRef-dXOJdONs.cjs.js"),n=require("react"),ee=require("./useFormReset--wPlnEOl.cjs.js"),w=require("./usePress-C8-hLXJw.cjs.js"),ae=require("./useFocusable-DCgmQxS1.cjs.js"),L=require("./useFormValidation-BEaCuNx1.cjs.js"),ie=require("./utils-BGHwK7fd.cjs.js"),re=require("./FocusScope-DPn5XtSy.cjs.js"),de=require("./useFocusWithin-BDSWp3rw.cjs.js"),te=require("./useField-DmqO9k7a.cjs.js"),oe=require("./context-OoV8SSWX.cjs.js"),N=require("./useFocusRing-CzFer4bD.cjs.js"),le=require("./useHover-CiP9jMFy.cjs.js"),ne=require("./VisuallyHidden-Bv_AJXZ7.cjs.js"),se=require("./useControlledState-D0L6S_5r.cjs.js"),j=require("./extractStyleProps-BFdEZDYW.cjs.js"),T=require("./create-slot-recipe-context-CimocFDH.cjs.js"),_=require("@commercetools/nimbus-icons"),W=new WeakMap;function ce(a,e,r){let{value:d,children:o,"aria-label":t,"aria-labelledby":u,onPressStart:i,onPressEnd:s,onPressChange:$,onPress:l,onPressUp:c,onClick:p}=a;const b=a.isDisabled||e.isDisabled;let V=o!=null,x=t!=null||u!=null;!V&&!x&&process.env.NODE_ENV!=="production"&&console.warn("If you do not provide children, you must specify an aria-label for accessibility");let R=e.selectedValue===d,S=C=>{C.stopPropagation(),e.setSelectedValue(d)},{pressProps:D,isPressed:g}=w.$f6c31cce2adf654f$export$45712eceda6fad21({onPressStart:i,onPressEnd:s,onPressChange:$,onPress:l,onPressUp:c,onClick:p,isDisabled:b}),{pressProps:O,isPressed:P}=w.$f6c31cce2adf654f$export$45712eceda6fad21({onPressStart:i,onPressEnd:s,onPressChange:$,onPressUp:c,onClick:p,isDisabled:b,onPress(C){var M;l?.(C),e.setSelectedValue(d),(M=r.current)===null||M===void 0||M.focus()}}),{focusableProps:f}=ae.$f645667febf57a63$export$4c014de7c8940b4c(m.$3ef42575df84b30b$export$9d1611c77c2fe928(a,{onFocus:()=>e.setLastFocusedValue(d)}),r),y=m.$3ef42575df84b30b$export$9d1611c77c2fe928(D,f),v=F.$65484d02dcb7eb3e$export$457c3d6518dd4c6f(a,{labelable:!0}),q=-1;e.selectedValue!=null?e.selectedValue===d&&(q=0):(e.lastFocusedValue===d||e.lastFocusedValue==null)&&(q=0),b&&(q=void 0);let{name:U,form:A,descriptionId:G,errorMessageId:K,validationBehavior:E}=W.get(e);return ee.$99facab73266f662$export$5add1d006293d136(r,e.defaultSelectedValue,e.setSelectedValue),L.$e93e671b31057976$export$b8473d3665f3a75a({validationBehavior:E},e,r),{labelProps:m.$3ef42575df84b30b$export$9d1611c77c2fe928(O,{onClick:C=>C.preventDefault()}),inputProps:m.$3ef42575df84b30b$export$9d1611c77c2fe928(v,{...y,type:"radio",name:U,form:A,tabIndex:q,disabled:b,required:e.isRequired&&E==="native",checked:R,value:d,onChange:S,"aria-describedby":[a["aria-describedby"],e.isInvalid?K:null,G].filter(Boolean).join(" ")||void 0}),isDisabled:b,isSelected:R,isPressed:g||P}}function ue(a,e){let{name:r,form:d,isReadOnly:o,isRequired:t,isDisabled:u,orientation:i="vertical",validationBehavior:s="aria"}=a,{direction:$}=oe.$18f2051aff69b9bf$export$43bb16f9c6d9e3f7(),{isInvalid:l,validationErrors:c,validationDetails:p}=e.displayValidation,{labelProps:b,fieldProps:V,descriptionProps:x,errorMessageProps:R}=te.$2baaea4c71418dea$export$294aa081a6c6f55d({...a,labelElementType:"span",isInvalid:e.isInvalid,errorMessage:a.errorMessage||c}),S=F.$65484d02dcb7eb3e$export$457c3d6518dd4c6f(a,{labelable:!0}),{focusWithinProps:D}=de.$9ab94262bd0047c7$export$420e68273165f4ec({onBlurWithin(P){var f;(f=a.onBlur)===null||f===void 0||f.call(a,P),e.selectedValue||e.setLastFocusedValue(null)},onFocusWithin:a.onFocus,onFocusWithinChange:a.onFocusChange}),g=P=>{let f;switch(P.key){case"ArrowRight":$==="rtl"&&i!=="vertical"?f="prev":f="next";break;case"ArrowLeft":$==="rtl"&&i!=="vertical"?f="next":f="prev";break;case"ArrowDown":f="next";break;case"ArrowUp":f="prev";break;default:return}P.preventDefault();let y=re.$9bf71ea28793e738$export$2d6ec8fc375ceafa(P.currentTarget,{from:P.target,accept:q=>q instanceof ie.$431fbd86ca7dc216$export$f21a1ffae260145a(q).HTMLInputElement&&q.type==="radio"}),v;f==="next"?(v=y.nextNode(),v||(y.currentNode=P.currentTarget,v=y.firstChild())):(v=y.previousNode(),v||(y.currentNode=P.currentTarget,v=y.lastChild())),v&&(v.focus(),e.setSelectedValue(v.value))},O=m.$bdb11010cef70236$export$f680877a34711e37(r);return W.set(e,{name:O,form:d,descriptionId:x.id,errorMessageId:R.id,validationBehavior:s}),{radioGroupProps:m.$3ef42575df84b30b$export$9d1611c77c2fe928(S,{role:"radiogroup",onKeyDown:g,"aria-invalid":e.isInvalid||void 0,"aria-errormessage":a["aria-errormessage"],"aria-readonly":o||void 0,"aria-required":t||void 0,"aria-disabled":u||void 0,"aria-orientation":i,...V,...D}),labelProps:b,descriptionProps:x,errorMessageProps:R,isInvalid:l,validationErrors:c,validationDetails:p}}let fe=Math.round(Math.random()*1e10),$e=0;function be(a){let e=n.useMemo(()=>a.name||`radio-group-${fe}-${++$e}`,[a.name]);var r;let[d,o]=se.$458b0a5536c1a7cf$export$40bfa8c7b0832715(a.value,(r=a.defaultValue)!==null&&r!==void 0?r:null,a.onChange),[t]=n.useState(d),[u,i]=n.useState(null),s=L.$e5be200c675c3b3a$export$fc1a364ae1f3ff10({...a,value:d}),$=p=>{!a.isReadOnly&&!a.isDisabled&&(o(p),s.commitValidation())},l=s.displayValidation.isInvalid;var c;return{...s,name:e,selectedValue:d,defaultSelectedValue:a.value!==void 0?t:(c=a.defaultValue)!==null&&c!==void 0?c:null,setSelectedValue:$,lastFocusedValue:u,setLastFocusedValue:i,isDisabled:a.isDisabled||!1,isReadOnly:a.isReadOnly||!1,isRequired:a.isRequired||!1,validationState:a.validationState||(l?"invalid":null),isInvalid:l}}const pe=n.createContext(null),ve=n.createContext(null),H=n.createContext(null),Pe=n.forwardRef(function(e,r){[e,r]=h.$64fa3d84918910a7$export$29f1550f4b0d4415(e,r,pe);let{validationBehavior:d}=h.$64fa3d84918910a7$export$fabf2dc03a41866e(Q.$d3e0e05bdfcf66bd$export$c24727297075ec6a)||{};var o,t;let u=(t=(o=e.validationBehavior)!==null&&o!==void 0?o:d)!==null&&t!==void 0?t:"native",i=be({...e,validationBehavior:u}),[s,$]=h.$64fa3d84918910a7$export$9d4c57ee4c6ffdd8(!e["aria-label"]&&!e["aria-labelledby"]),{radioGroupProps:l,labelProps:c,descriptionProps:p,errorMessageProps:b,...V}=ue({...e,label:$,validationBehavior:u},i),x=h.$64fa3d84918910a7$export$4d86445c2cf5e3({...e,values:{orientation:e.orientation||"vertical",isDisabled:i.isDisabled,isReadOnly:i.isReadOnly,isRequired:i.isRequired,isInvalid:i.isInvalid,state:i},defaultClassName:"react-aria-RadioGroup"}),R=F.$65484d02dcb7eb3e$export$457c3d6518dd4c6f(e,{global:!0});return n.createElement("div",{...m.$3ef42575df84b30b$export$9d1611c77c2fe928(R,x,l),ref:r,slot:e.slot||void 0,"data-orientation":e.orientation||"vertical","data-invalid":i.isInvalid||void 0,"data-disabled":i.isDisabled||void 0,"data-readonly":i.isReadOnly||void 0,"data-required":i.isRequired||void 0},n.createElement(h.$64fa3d84918910a7$export$2881499e37b75b9a,{values:[[H,i],[X.$01b77f81d0f07f68$export$75b6ee27786ba447,{...c,ref:s,elementType:"span"}],[Y.$514c0188e459b4c0$export$9afb8bc826b033ea,{slots:{description:p,errorMessage:b}}],[J.$ee014567cb39d3f0$export$ff05c3ac10437e03,V]]},x.children))}),xe=n.forwardRef(function(e,r){let{inputRef:d=null,...o}=e;[e,r]=h.$64fa3d84918910a7$export$29f1550f4b0d4415(o,r,ve);let t=n.useContext(H),u=Z.$df56164dff5785e2$export$4338b53315abf666(n.useMemo(()=>h.$5dc95899b306f630$export$c9058316764c140e(d,e.inputRef!==void 0?e.inputRef:null),[d,e.inputRef])),{labelProps:i,inputProps:s,isSelected:$,isDisabled:l,isPressed:c}=ce({...h.$64fa3d84918910a7$export$ef03459518577ad4(e),children:typeof e.children=="function"?!0:e.children},t,u),{isFocused:p,isFocusVisible:b,focusProps:V}=N.$f7dceffc5ad7768b$export$4e328f61c538687f(),x=l||t.isReadOnly,{hoverProps:R,isHovered:S}=le.$6179b936705e76d3$export$ae780daf29e6d456({...e,isDisabled:x}),D=h.$64fa3d84918910a7$export$4d86445c2cf5e3({...e,defaultClassName:"react-aria-Radio",values:{isSelected:$,isPressed:c,isHovered:S,isFocused:p,isFocusVisible:b,isDisabled:l,isReadOnly:t.isReadOnly,isInvalid:t.isInvalid,isRequired:t.isRequired}}),g=F.$65484d02dcb7eb3e$export$457c3d6518dd4c6f(e,{global:!0});return delete g.id,delete g.onClick,n.createElement("label",{...m.$3ef42575df84b30b$export$9d1611c77c2fe928(g,i,R,D),ref:r,"data-selected":$||void 0,"data-pressed":c||void 0,"data-hovered":S||void 0,"data-focused":p||void 0,"data-focus-visible":b||void 0,"data-disabled":l||void 0,"data-readonly":t.isReadOnly||void 0,"data-invalid":t.isInvalid||void 0,"data-required":t.isRequired||void 0},n.createElement(ne.$5c3e21d68f1c4674$export$439d29a4e110a164,{elementType:"span"},n.createElement("input",{...m.$3ef42575df84b30b$export$9d1611c77c2fe928(s,V),ref:u})),D.children)}),{withProvider:Re,withContext:he}=T.createSlotRecipeContext({key:"radioInput"}),me=Re("div","root"),ye=he("span","option"),B=a=>{const e=T.useSlotRecipe({recipe:z.radioInputSlotRecipe}),[r,d]=e.splitVariantProps(a),[o,t]=j.extractStyleProps(d);return I.jsx(me,{...r,...o,asChild:!0,children:I.jsx(Pe,{...t,children:a.children})})};B.displayName="RadioInputRoot";const k=({children:a,value:e,...r})=>{const[d,o]=j.extractStyleProps(r),{isFocused:t,focusProps:u}=N.$f7dceffc5ad7768b$export$4e328f61c538687f();return I.jsx(ye,{...d,...u,"data-focus":t||void 0,asChild:!0,children:I.jsx(xe,{value:e,...o,children:i=>{const s=typeof a=="function"?a({...i}):a;return I.jsxs(I.Fragment,{children:[i.isSelected?I.jsx(_.RadioButtonChecked,{}):I.jsx(_.RadioButtonUnchecked,{}),s]})}})})};k.displayName="RadioInputOption";const qe={Root:B,Option:k};exports.RadioInput=qe;exports.RadioInputOption=k;exports.RadioInputRoot=B;
2
- //# sourceMappingURL=radio-input-VMfD6a_K.cjs.js.map
1
+ "use strict";const I=require("react/jsx-runtime"),z=require("./index-BsmdMT4w.cjs.js"),h=require("./utils-BHdR5Nww.cjs.js"),J=require("./FieldError-DyGFfqST.cjs.js"),Q=require("./Form-BuOomA4T.cjs.js"),X=require("./Label-BgrYyYXn.cjs.js"),Y=require("./Text-BWSfeB9p.cjs.js"),m=require("./mergeProps-BA5Cwf5w.cjs.js"),F=require("./filterDOMProps-WUskt27c.cjs.js"),Z=require("./useObjectRef-dXOJdONs.cjs.js"),n=require("react"),ee=require("./useFormReset--wPlnEOl.cjs.js"),w=require("./usePress-C8-hLXJw.cjs.js"),ae=require("./useFocusable-DCgmQxS1.cjs.js"),L=require("./useFormValidation-BEaCuNx1.cjs.js"),ie=require("./utils-BGHwK7fd.cjs.js"),re=require("./FocusScope-DPn5XtSy.cjs.js"),de=require("./useFocusWithin-BDSWp3rw.cjs.js"),te=require("./useField-DmqO9k7a.cjs.js"),oe=require("./context-OoV8SSWX.cjs.js"),N=require("./useFocusRing-CzFer4bD.cjs.js"),le=require("./useHover-CiP9jMFy.cjs.js"),ne=require("./VisuallyHidden-Bv_AJXZ7.cjs.js"),se=require("./useControlledState-D0L6S_5r.cjs.js"),j=require("./extractStyleProps-BsLft3q1.cjs.js"),T=require("./create-slot-recipe-context-CimocFDH.cjs.js"),_=require("@commercetools/nimbus-icons"),W=new WeakMap;function ce(a,e,r){let{value:d,children:o,"aria-label":t,"aria-labelledby":u,onPressStart:i,onPressEnd:s,onPressChange:$,onPress:l,onPressUp:c,onClick:p}=a;const b=a.isDisabled||e.isDisabled;let V=o!=null,x=t!=null||u!=null;!V&&!x&&process.env.NODE_ENV!=="production"&&console.warn("If you do not provide children, you must specify an aria-label for accessibility");let R=e.selectedValue===d,S=C=>{C.stopPropagation(),e.setSelectedValue(d)},{pressProps:D,isPressed:g}=w.$f6c31cce2adf654f$export$45712eceda6fad21({onPressStart:i,onPressEnd:s,onPressChange:$,onPress:l,onPressUp:c,onClick:p,isDisabled:b}),{pressProps:O,isPressed:P}=w.$f6c31cce2adf654f$export$45712eceda6fad21({onPressStart:i,onPressEnd:s,onPressChange:$,onPressUp:c,onClick:p,isDisabled:b,onPress(C){var M;l?.(C),e.setSelectedValue(d),(M=r.current)===null||M===void 0||M.focus()}}),{focusableProps:f}=ae.$f645667febf57a63$export$4c014de7c8940b4c(m.$3ef42575df84b30b$export$9d1611c77c2fe928(a,{onFocus:()=>e.setLastFocusedValue(d)}),r),y=m.$3ef42575df84b30b$export$9d1611c77c2fe928(D,f),v=F.$65484d02dcb7eb3e$export$457c3d6518dd4c6f(a,{labelable:!0}),q=-1;e.selectedValue!=null?e.selectedValue===d&&(q=0):(e.lastFocusedValue===d||e.lastFocusedValue==null)&&(q=0),b&&(q=void 0);let{name:U,form:A,descriptionId:G,errorMessageId:K,validationBehavior:E}=W.get(e);return ee.$99facab73266f662$export$5add1d006293d136(r,e.defaultSelectedValue,e.setSelectedValue),L.$e93e671b31057976$export$b8473d3665f3a75a({validationBehavior:E},e,r),{labelProps:m.$3ef42575df84b30b$export$9d1611c77c2fe928(O,{onClick:C=>C.preventDefault()}),inputProps:m.$3ef42575df84b30b$export$9d1611c77c2fe928(v,{...y,type:"radio",name:U,form:A,tabIndex:q,disabled:b,required:e.isRequired&&E==="native",checked:R,value:d,onChange:S,"aria-describedby":[a["aria-describedby"],e.isInvalid?K:null,G].filter(Boolean).join(" ")||void 0}),isDisabled:b,isSelected:R,isPressed:g||P}}function ue(a,e){let{name:r,form:d,isReadOnly:o,isRequired:t,isDisabled:u,orientation:i="vertical",validationBehavior:s="aria"}=a,{direction:$}=oe.$18f2051aff69b9bf$export$43bb16f9c6d9e3f7(),{isInvalid:l,validationErrors:c,validationDetails:p}=e.displayValidation,{labelProps:b,fieldProps:V,descriptionProps:x,errorMessageProps:R}=te.$2baaea4c71418dea$export$294aa081a6c6f55d({...a,labelElementType:"span",isInvalid:e.isInvalid,errorMessage:a.errorMessage||c}),S=F.$65484d02dcb7eb3e$export$457c3d6518dd4c6f(a,{labelable:!0}),{focusWithinProps:D}=de.$9ab94262bd0047c7$export$420e68273165f4ec({onBlurWithin(P){var f;(f=a.onBlur)===null||f===void 0||f.call(a,P),e.selectedValue||e.setLastFocusedValue(null)},onFocusWithin:a.onFocus,onFocusWithinChange:a.onFocusChange}),g=P=>{let f;switch(P.key){case"ArrowRight":$==="rtl"&&i!=="vertical"?f="prev":f="next";break;case"ArrowLeft":$==="rtl"&&i!=="vertical"?f="next":f="prev";break;case"ArrowDown":f="next";break;case"ArrowUp":f="prev";break;default:return}P.preventDefault();let y=re.$9bf71ea28793e738$export$2d6ec8fc375ceafa(P.currentTarget,{from:P.target,accept:q=>q instanceof ie.$431fbd86ca7dc216$export$f21a1ffae260145a(q).HTMLInputElement&&q.type==="radio"}),v;f==="next"?(v=y.nextNode(),v||(y.currentNode=P.currentTarget,v=y.firstChild())):(v=y.previousNode(),v||(y.currentNode=P.currentTarget,v=y.lastChild())),v&&(v.focus(),e.setSelectedValue(v.value))},O=m.$bdb11010cef70236$export$f680877a34711e37(r);return W.set(e,{name:O,form:d,descriptionId:x.id,errorMessageId:R.id,validationBehavior:s}),{radioGroupProps:m.$3ef42575df84b30b$export$9d1611c77c2fe928(S,{role:"radiogroup",onKeyDown:g,"aria-invalid":e.isInvalid||void 0,"aria-errormessage":a["aria-errormessage"],"aria-readonly":o||void 0,"aria-required":t||void 0,"aria-disabled":u||void 0,"aria-orientation":i,...V,...D}),labelProps:b,descriptionProps:x,errorMessageProps:R,isInvalid:l,validationErrors:c,validationDetails:p}}let fe=Math.round(Math.random()*1e10),$e=0;function be(a){let e=n.useMemo(()=>a.name||`radio-group-${fe}-${++$e}`,[a.name]);var r;let[d,o]=se.$458b0a5536c1a7cf$export$40bfa8c7b0832715(a.value,(r=a.defaultValue)!==null&&r!==void 0?r:null,a.onChange),[t]=n.useState(d),[u,i]=n.useState(null),s=L.$e5be200c675c3b3a$export$fc1a364ae1f3ff10({...a,value:d}),$=p=>{!a.isReadOnly&&!a.isDisabled&&(o(p),s.commitValidation())},l=s.displayValidation.isInvalid;var c;return{...s,name:e,selectedValue:d,defaultSelectedValue:a.value!==void 0?t:(c=a.defaultValue)!==null&&c!==void 0?c:null,setSelectedValue:$,lastFocusedValue:u,setLastFocusedValue:i,isDisabled:a.isDisabled||!1,isReadOnly:a.isReadOnly||!1,isRequired:a.isRequired||!1,validationState:a.validationState||(l?"invalid":null),isInvalid:l}}const pe=n.createContext(null),ve=n.createContext(null),H=n.createContext(null),Pe=n.forwardRef(function(e,r){[e,r]=h.$64fa3d84918910a7$export$29f1550f4b0d4415(e,r,pe);let{validationBehavior:d}=h.$64fa3d84918910a7$export$fabf2dc03a41866e(Q.$d3e0e05bdfcf66bd$export$c24727297075ec6a)||{};var o,t;let u=(t=(o=e.validationBehavior)!==null&&o!==void 0?o:d)!==null&&t!==void 0?t:"native",i=be({...e,validationBehavior:u}),[s,$]=h.$64fa3d84918910a7$export$9d4c57ee4c6ffdd8(!e["aria-label"]&&!e["aria-labelledby"]),{radioGroupProps:l,labelProps:c,descriptionProps:p,errorMessageProps:b,...V}=ue({...e,label:$,validationBehavior:u},i),x=h.$64fa3d84918910a7$export$4d86445c2cf5e3({...e,values:{orientation:e.orientation||"vertical",isDisabled:i.isDisabled,isReadOnly:i.isReadOnly,isRequired:i.isRequired,isInvalid:i.isInvalid,state:i},defaultClassName:"react-aria-RadioGroup"}),R=F.$65484d02dcb7eb3e$export$457c3d6518dd4c6f(e,{global:!0});return n.createElement("div",{...m.$3ef42575df84b30b$export$9d1611c77c2fe928(R,x,l),ref:r,slot:e.slot||void 0,"data-orientation":e.orientation||"vertical","data-invalid":i.isInvalid||void 0,"data-disabled":i.isDisabled||void 0,"data-readonly":i.isReadOnly||void 0,"data-required":i.isRequired||void 0},n.createElement(h.$64fa3d84918910a7$export$2881499e37b75b9a,{values:[[H,i],[X.$01b77f81d0f07f68$export$75b6ee27786ba447,{...c,ref:s,elementType:"span"}],[Y.$514c0188e459b4c0$export$9afb8bc826b033ea,{slots:{description:p,errorMessage:b}}],[J.$ee014567cb39d3f0$export$ff05c3ac10437e03,V]]},x.children))}),xe=n.forwardRef(function(e,r){let{inputRef:d=null,...o}=e;[e,r]=h.$64fa3d84918910a7$export$29f1550f4b0d4415(o,r,ve);let t=n.useContext(H),u=Z.$df56164dff5785e2$export$4338b53315abf666(n.useMemo(()=>h.$5dc95899b306f630$export$c9058316764c140e(d,e.inputRef!==void 0?e.inputRef:null),[d,e.inputRef])),{labelProps:i,inputProps:s,isSelected:$,isDisabled:l,isPressed:c}=ce({...h.$64fa3d84918910a7$export$ef03459518577ad4(e),children:typeof e.children=="function"?!0:e.children},t,u),{isFocused:p,isFocusVisible:b,focusProps:V}=N.$f7dceffc5ad7768b$export$4e328f61c538687f(),x=l||t.isReadOnly,{hoverProps:R,isHovered:S}=le.$6179b936705e76d3$export$ae780daf29e6d456({...e,isDisabled:x}),D=h.$64fa3d84918910a7$export$4d86445c2cf5e3({...e,defaultClassName:"react-aria-Radio",values:{isSelected:$,isPressed:c,isHovered:S,isFocused:p,isFocusVisible:b,isDisabled:l,isReadOnly:t.isReadOnly,isInvalid:t.isInvalid,isRequired:t.isRequired}}),g=F.$65484d02dcb7eb3e$export$457c3d6518dd4c6f(e,{global:!0});return delete g.id,delete g.onClick,n.createElement("label",{...m.$3ef42575df84b30b$export$9d1611c77c2fe928(g,i,R,D),ref:r,"data-selected":$||void 0,"data-pressed":c||void 0,"data-hovered":S||void 0,"data-focused":p||void 0,"data-focus-visible":b||void 0,"data-disabled":l||void 0,"data-readonly":t.isReadOnly||void 0,"data-invalid":t.isInvalid||void 0,"data-required":t.isRequired||void 0},n.createElement(ne.$5c3e21d68f1c4674$export$439d29a4e110a164,{elementType:"span"},n.createElement("input",{...m.$3ef42575df84b30b$export$9d1611c77c2fe928(s,V),ref:u})),D.children)}),{withProvider:Re,withContext:he}=T.createSlotRecipeContext({key:"radioInput"}),me=Re("div","root"),ye=he("span","option"),B=a=>{const e=T.useSlotRecipe({recipe:z.radioInputSlotRecipe}),[r,d]=e.splitVariantProps(a),[o,t]=j.extractStyleProps(d);return I.jsx(me,{...r,...o,asChild:!0,children:I.jsx(Pe,{...t,children:a.children})})};B.displayName="RadioInputRoot";const k=({children:a,value:e,...r})=>{const[d,o]=j.extractStyleProps(r),{isFocused:t,focusProps:u}=N.$f7dceffc5ad7768b$export$4e328f61c538687f();return I.jsx(ye,{...d,...u,"data-focus":t||void 0,asChild:!0,children:I.jsx(xe,{value:e,...o,children:i=>{const s=typeof a=="function"?a({...i}):a;return I.jsxs(I.Fragment,{children:[i.isSelected?I.jsx(_.RadioButtonChecked,{}):I.jsx(_.RadioButtonUnchecked,{}),s]})}})})};k.displayName="RadioInputOption";const qe={Root:B,Option:k};exports.RadioInput=qe;exports.RadioInputOption=k;exports.RadioInputRoot=B;
2
+ //# sourceMappingURL=radio-input-B40xSi6r.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"radio-input-VMfD6a_K.cjs.js","sources":["../../../../node_modules/.pnpm/@react-aria+radio@3.12.1_react-dom@19.1.1_react@19.1.1__react@19.1.1/node_modules/@react-aria/radio/dist/utils.mjs","../../../../node_modules/.pnpm/@react-aria+radio@3.12.1_react-dom@19.1.1_react@19.1.1__react@19.1.1/node_modules/@react-aria/radio/dist/useRadio.mjs","../../../../node_modules/.pnpm/@react-aria+radio@3.12.1_react-dom@19.1.1_react@19.1.1__react@19.1.1/node_modules/@react-aria/radio/dist/useRadioGroup.mjs","../../../../node_modules/.pnpm/@react-stately+radio@3.11.1_react@19.1.1/node_modules/@react-stately/radio/dist/useRadioGroupState.mjs","../../../../node_modules/.pnpm/react-aria-components@1.12.1_react-dom@19.1.1_react@19.1.1__react@19.1.1/node_modules/react-aria-components/dist/RadioGroup.mjs","../../src/components/radio-input/radio-input.slots.tsx","../../src/components/radio-input/components/radio-input.root.tsx","../../src/components/radio-input/components/radio-input.option.tsx","../../src/components/radio-input/radio-input.tsx"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */ const $884aeceb3d67f00f$export$37b65e5b5444d35c = new WeakMap();\n\n\nexport {$884aeceb3d67f00f$export$37b65e5b5444d35c as radioGroupData};\n//# sourceMappingURL=utils.module.js.map\n","import {radioGroupData as $884aeceb3d67f00f$export$37b65e5b5444d35c} from \"./utils.mjs\";\nimport {mergeProps as $5jJ3f$mergeProps, filterDOMProps as $5jJ3f$filterDOMProps, useFormReset as $5jJ3f$useFormReset} from \"@react-aria/utils\";\nimport {usePress as $5jJ3f$usePress, useFocusable as $5jJ3f$useFocusable} from \"@react-aria/interactions\";\nimport {useFormValidation as $5jJ3f$useFormValidation} from \"@react-aria/form\";\n\n/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */ \n\n\n\nfunction $0d5c49892c1215da$export$37b0961d2f4751e2(props, state, ref) {\n let { value: value, children: children, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledby, onPressStart: onPressStart, onPressEnd: onPressEnd, onPressChange: onPressChange, onPress: onPress, onPressUp: onPressUp, onClick: onClick } = props;\n const isDisabled = props.isDisabled || state.isDisabled;\n let hasChildren = children != null;\n let hasAriaLabel = ariaLabel != null || ariaLabelledby != null;\n if (!hasChildren && !hasAriaLabel && process.env.NODE_ENV !== 'production') console.warn('If you do not provide children, you must specify an aria-label for accessibility');\n let checked = state.selectedValue === value;\n let onChange = (e)=>{\n e.stopPropagation();\n state.setSelectedValue(value);\n };\n // Handle press state for keyboard interactions and cases where labelProps is not used.\n let { pressProps: pressProps, isPressed: isPressed } = (0, $5jJ3f$usePress)({\n onPressStart: onPressStart,\n onPressEnd: onPressEnd,\n onPressChange: onPressChange,\n onPress: onPress,\n onPressUp: onPressUp,\n onClick: onClick,\n isDisabled: isDisabled\n });\n // Handle press state on the label.\n let { pressProps: labelProps, isPressed: isLabelPressed } = (0, $5jJ3f$usePress)({\n onPressStart: onPressStart,\n onPressEnd: onPressEnd,\n onPressChange: onPressChange,\n onPressUp: onPressUp,\n onClick: onClick,\n isDisabled: isDisabled,\n onPress (e) {\n var _ref_current;\n onPress === null || onPress === void 0 ? void 0 : onPress(e);\n state.setSelectedValue(value);\n (_ref_current = ref.current) === null || _ref_current === void 0 ? void 0 : _ref_current.focus();\n }\n });\n let { focusableProps: focusableProps } = (0, $5jJ3f$useFocusable)((0, $5jJ3f$mergeProps)(props, {\n onFocus: ()=>state.setLastFocusedValue(value)\n }), ref);\n let interactions = (0, $5jJ3f$mergeProps)(pressProps, focusableProps);\n let domProps = (0, $5jJ3f$filterDOMProps)(props, {\n labelable: true\n });\n let tabIndex = -1;\n if (state.selectedValue != null) {\n if (state.selectedValue === value) tabIndex = 0;\n } else if (state.lastFocusedValue === value || state.lastFocusedValue == null) tabIndex = 0;\n if (isDisabled) tabIndex = undefined;\n let { name: name, form: form, descriptionId: descriptionId, errorMessageId: errorMessageId, validationBehavior: validationBehavior } = (0, $884aeceb3d67f00f$export$37b65e5b5444d35c).get(state);\n (0, $5jJ3f$useFormReset)(ref, state.defaultSelectedValue, state.setSelectedValue);\n (0, $5jJ3f$useFormValidation)({\n validationBehavior: validationBehavior\n }, state, ref);\n return {\n labelProps: (0, $5jJ3f$mergeProps)(labelProps, {\n onClick: (e)=>e.preventDefault()\n }),\n inputProps: (0, $5jJ3f$mergeProps)(domProps, {\n ...interactions,\n type: 'radio',\n name: name,\n form: form,\n tabIndex: tabIndex,\n disabled: isDisabled,\n required: state.isRequired && validationBehavior === 'native',\n checked: checked,\n value: value,\n onChange: onChange,\n 'aria-describedby': [\n props['aria-describedby'],\n state.isInvalid ? errorMessageId : null,\n descriptionId\n ].filter(Boolean).join(' ') || undefined\n }),\n isDisabled: isDisabled,\n isSelected: checked,\n isPressed: isPressed || isLabelPressed\n };\n}\n\n\nexport {$0d5c49892c1215da$export$37b0961d2f4751e2 as useRadio};\n//# sourceMappingURL=useRadio.module.js.map\n","import {radioGroupData as $884aeceb3d67f00f$export$37b65e5b5444d35c} from \"./utils.mjs\";\nimport {filterDOMProps as $czmJy$filterDOMProps, getOwnerWindow as $czmJy$getOwnerWindow, useId as $czmJy$useId, mergeProps as $czmJy$mergeProps} from \"@react-aria/utils\";\nimport {getFocusableTreeWalker as $czmJy$getFocusableTreeWalker} from \"@react-aria/focus\";\nimport {useField as $czmJy$useField} from \"@react-aria/label\";\nimport {useFocusWithin as $czmJy$useFocusWithin} from \"@react-aria/interactions\";\nimport {useLocale as $czmJy$useLocale} from \"@react-aria/i18n\";\n\n/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */ \n\n\n\n\n\nfunction $430f30ed08ec25fa$export$62b9571f283ff5c2(props, state) {\n let { name: name, form: form, isReadOnly: isReadOnly, isRequired: isRequired, isDisabled: isDisabled, orientation: orientation = 'vertical', validationBehavior: validationBehavior = 'aria' } = props;\n let { direction: direction } = (0, $czmJy$useLocale)();\n let { isInvalid: isInvalid, validationErrors: validationErrors, validationDetails: validationDetails } = state.displayValidation;\n let { labelProps: labelProps, fieldProps: fieldProps, descriptionProps: descriptionProps, errorMessageProps: errorMessageProps } = (0, $czmJy$useField)({\n ...props,\n // Radio group is not an HTML input element so it\n // shouldn't be labeled by a <label> element.\n labelElementType: 'span',\n isInvalid: state.isInvalid,\n errorMessage: props.errorMessage || validationErrors\n });\n let domProps = (0, $czmJy$filterDOMProps)(props, {\n labelable: true\n });\n // When the radio group loses focus, reset the focusable radio to null if\n // there is no selection. This allows tabbing into the group from either\n // direction to go to the first or last radio.\n let { focusWithinProps: focusWithinProps } = (0, $czmJy$useFocusWithin)({\n onBlurWithin (e) {\n var _props_onBlur;\n (_props_onBlur = props.onBlur) === null || _props_onBlur === void 0 ? void 0 : _props_onBlur.call(props, e);\n if (!state.selectedValue) state.setLastFocusedValue(null);\n },\n onFocusWithin: props.onFocus,\n onFocusWithinChange: props.onFocusChange\n });\n let onKeyDown = (e)=>{\n let nextDir;\n switch(e.key){\n case 'ArrowRight':\n if (direction === 'rtl' && orientation !== 'vertical') nextDir = 'prev';\n else nextDir = 'next';\n break;\n case 'ArrowLeft':\n if (direction === 'rtl' && orientation !== 'vertical') nextDir = 'next';\n else nextDir = 'prev';\n break;\n case 'ArrowDown':\n nextDir = 'next';\n break;\n case 'ArrowUp':\n nextDir = 'prev';\n break;\n default:\n return;\n }\n e.preventDefault();\n let walker = (0, $czmJy$getFocusableTreeWalker)(e.currentTarget, {\n from: e.target,\n accept: (node)=>node instanceof (0, $czmJy$getOwnerWindow)(node).HTMLInputElement && node.type === 'radio'\n });\n let nextElem;\n if (nextDir === 'next') {\n nextElem = walker.nextNode();\n if (!nextElem) {\n walker.currentNode = e.currentTarget;\n nextElem = walker.firstChild();\n }\n } else {\n nextElem = walker.previousNode();\n if (!nextElem) {\n walker.currentNode = e.currentTarget;\n nextElem = walker.lastChild();\n }\n }\n if (nextElem) {\n // Call focus on nextElem so that keyboard navigation scrolls the radio into view\n nextElem.focus();\n state.setSelectedValue(nextElem.value);\n }\n };\n let groupName = (0, $czmJy$useId)(name);\n (0, $884aeceb3d67f00f$export$37b65e5b5444d35c).set(state, {\n name: groupName,\n form: form,\n descriptionId: descriptionProps.id,\n errorMessageId: errorMessageProps.id,\n validationBehavior: validationBehavior\n });\n return {\n radioGroupProps: (0, $czmJy$mergeProps)(domProps, {\n // https://www.w3.org/TR/wai-aria-1.2/#radiogroup\n role: 'radiogroup',\n onKeyDown: onKeyDown,\n 'aria-invalid': state.isInvalid || undefined,\n 'aria-errormessage': props['aria-errormessage'],\n 'aria-readonly': isReadOnly || undefined,\n 'aria-required': isRequired || undefined,\n 'aria-disabled': isDisabled || undefined,\n 'aria-orientation': orientation,\n ...fieldProps,\n ...focusWithinProps\n }),\n labelProps: labelProps,\n descriptionProps: descriptionProps,\n errorMessageProps: errorMessageProps,\n isInvalid: isInvalid,\n validationErrors: validationErrors,\n validationDetails: validationDetails\n };\n}\n\n\nexport {$430f30ed08ec25fa$export$62b9571f283ff5c2 as useRadioGroup};\n//# sourceMappingURL=useRadioGroup.module.js.map\n","import {useFormValidationState as $l55kx$useFormValidationState} from \"@react-stately/form\";\nimport {useControlledState as $l55kx$useControlledState} from \"@react-stately/utils\";\nimport {useMemo as $l55kx$useMemo, useState as $l55kx$useState} from \"react\";\n\n/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */ \n\n\nlet $a54cdc5c1942b639$var$instance = Math.round(Math.random() * 10000000000);\nlet $a54cdc5c1942b639$var$i = 0;\nfunction $a54cdc5c1942b639$export$bca9d026f8e704eb(props) {\n // Preserved here for backward compatibility. React Aria now generates the name instead of stately.\n let name = (0, $l55kx$useMemo)(()=>props.name || `radio-group-${$a54cdc5c1942b639$var$instance}-${++$a54cdc5c1942b639$var$i}`, [\n props.name\n ]);\n var _props_defaultValue;\n let [selectedValue, setSelected] = (0, $l55kx$useControlledState)(props.value, (_props_defaultValue = props.defaultValue) !== null && _props_defaultValue !== void 0 ? _props_defaultValue : null, props.onChange);\n let [initialValue] = (0, $l55kx$useState)(selectedValue);\n let [lastFocusedValue, setLastFocusedValue] = (0, $l55kx$useState)(null);\n let validation = (0, $l55kx$useFormValidationState)({\n ...props,\n value: selectedValue\n });\n let setSelectedValue = (value)=>{\n if (!props.isReadOnly && !props.isDisabled) {\n setSelected(value);\n validation.commitValidation();\n }\n };\n let isInvalid = validation.displayValidation.isInvalid;\n var _props_defaultValue1;\n return {\n ...validation,\n name: name,\n selectedValue: selectedValue,\n defaultSelectedValue: props.value !== undefined ? initialValue : (_props_defaultValue1 = props.defaultValue) !== null && _props_defaultValue1 !== void 0 ? _props_defaultValue1 : null,\n setSelectedValue: setSelectedValue,\n lastFocusedValue: lastFocusedValue,\n setLastFocusedValue: setLastFocusedValue,\n isDisabled: props.isDisabled || false,\n isReadOnly: props.isReadOnly || false,\n isRequired: props.isRequired || false,\n validationState: props.validationState || (isInvalid ? 'invalid' : null),\n isInvalid: isInvalid\n };\n}\n\n\nexport {$a54cdc5c1942b639$export$bca9d026f8e704eb as useRadioGroupState};\n//# sourceMappingURL=useRadioGroupState.module.js.map\n","import {Provider as $64fa3d84918910a7$export$2881499e37b75b9a, removeDataAttributes as $64fa3d84918910a7$export$ef03459518577ad4, useContextProps as $64fa3d84918910a7$export$29f1550f4b0d4415, useRenderProps as $64fa3d84918910a7$export$4d86445c2cf5e3, useSlot as $64fa3d84918910a7$export$9d4c57ee4c6ffdd8, useSlottedContext as $64fa3d84918910a7$export$fabf2dc03a41866e} from \"./utils.mjs\";\nimport {FieldErrorContext as $ee014567cb39d3f0$export$ff05c3ac10437e03} from \"./FieldError.mjs\";\nimport {FormContext as $d3e0e05bdfcf66bd$export$c24727297075ec6a} from \"./Form.mjs\";\nimport {LabelContext as $01b77f81d0f07f68$export$75b6ee27786ba447} from \"./Label.mjs\";\nimport {TextContext as $514c0188e459b4c0$export$9afb8bc826b033ea} from \"./Text.mjs\";\nimport {useRadioGroup as $3sixo$useRadioGroup, useRadio as $3sixo$useRadio, useFocusRing as $3sixo$useFocusRing, useHover as $3sixo$useHover, VisuallyHidden as $3sixo$VisuallyHidden} from \"react-aria\";\nimport {filterDOMProps as $3sixo$filterDOMProps, mergeProps as $3sixo$mergeProps, useObjectRef as $3sixo$useObjectRef, mergeRefs as $3sixo$mergeRefs} from \"@react-aria/utils\";\nimport {useRadioGroupState as $3sixo$useRadioGroupState} from \"react-stately\";\nimport $3sixo$react, {createContext as $3sixo$createContext, forwardRef as $3sixo$forwardRef, useMemo as $3sixo$useMemo} from \"react\";\n\n/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */ \n\n\n\n\n\n\n\n\nconst $b6c3ddc6086f204d$export$a79eda4ff50e30b6 = /*#__PURE__*/ (0, $3sixo$createContext)(null);\nconst $b6c3ddc6086f204d$export$b118023277d4a5c3 = /*#__PURE__*/ (0, $3sixo$createContext)(null);\nconst $b6c3ddc6086f204d$export$29d84393af70866c = /*#__PURE__*/ (0, $3sixo$createContext)(null);\nconst $b6c3ddc6086f204d$export$a98f0dcb43a68a25 = /*#__PURE__*/ (0, $3sixo$forwardRef)(function RadioGroup(props, ref) {\n [props, ref] = (0, $64fa3d84918910a7$export$29f1550f4b0d4415)(props, ref, $b6c3ddc6086f204d$export$a79eda4ff50e30b6);\n let { validationBehavior: formValidationBehavior } = (0, $64fa3d84918910a7$export$fabf2dc03a41866e)((0, $d3e0e05bdfcf66bd$export$c24727297075ec6a)) || {};\n var _props_validationBehavior, _ref;\n let validationBehavior = (_ref = (_props_validationBehavior = props.validationBehavior) !== null && _props_validationBehavior !== void 0 ? _props_validationBehavior : formValidationBehavior) !== null && _ref !== void 0 ? _ref : 'native';\n let state = (0, $3sixo$useRadioGroupState)({\n ...props,\n validationBehavior: validationBehavior\n });\n let [labelRef, label] = (0, $64fa3d84918910a7$export$9d4c57ee4c6ffdd8)(!props['aria-label'] && !props['aria-labelledby']);\n let { radioGroupProps: radioGroupProps, labelProps: labelProps, descriptionProps: descriptionProps, errorMessageProps: errorMessageProps, ...validation } = (0, $3sixo$useRadioGroup)({\n ...props,\n label: label,\n validationBehavior: validationBehavior\n }, state);\n let renderProps = (0, $64fa3d84918910a7$export$4d86445c2cf5e3)({\n ...props,\n values: {\n orientation: props.orientation || 'vertical',\n isDisabled: state.isDisabled,\n isReadOnly: state.isReadOnly,\n isRequired: state.isRequired,\n isInvalid: state.isInvalid,\n state: state\n },\n defaultClassName: 'react-aria-RadioGroup'\n });\n let DOMProps = (0, $3sixo$filterDOMProps)(props, {\n global: true\n });\n return /*#__PURE__*/ (0, $3sixo$react).createElement(\"div\", {\n ...(0, $3sixo$mergeProps)(DOMProps, renderProps, radioGroupProps),\n ref: ref,\n slot: props.slot || undefined,\n \"data-orientation\": props.orientation || 'vertical',\n \"data-invalid\": state.isInvalid || undefined,\n \"data-disabled\": state.isDisabled || undefined,\n \"data-readonly\": state.isReadOnly || undefined,\n \"data-required\": state.isRequired || undefined\n }, /*#__PURE__*/ (0, $3sixo$react).createElement((0, $64fa3d84918910a7$export$2881499e37b75b9a), {\n values: [\n [\n $b6c3ddc6086f204d$export$29d84393af70866c,\n state\n ],\n [\n (0, $01b77f81d0f07f68$export$75b6ee27786ba447),\n {\n ...labelProps,\n ref: labelRef,\n elementType: 'span'\n }\n ],\n [\n (0, $514c0188e459b4c0$export$9afb8bc826b033ea),\n {\n slots: {\n description: descriptionProps,\n errorMessage: errorMessageProps\n }\n }\n ],\n [\n (0, $ee014567cb39d3f0$export$ff05c3ac10437e03),\n validation\n ]\n ]\n }, renderProps.children));\n});\nconst $b6c3ddc6086f204d$export$d7b12c4107be0d61 = /*#__PURE__*/ (0, $3sixo$forwardRef)(function Radio(props, ref) {\n let { inputRef: userProvidedInputRef = null, ...otherProps } = props;\n [props, ref] = (0, $64fa3d84918910a7$export$29f1550f4b0d4415)(otherProps, ref, $b6c3ddc6086f204d$export$b118023277d4a5c3);\n let state = (0, $3sixo$react).useContext($b6c3ddc6086f204d$export$29d84393af70866c);\n let inputRef = (0, $3sixo$useObjectRef)((0, $3sixo$useMemo)(()=>(0, $3sixo$mergeRefs)(userProvidedInputRef, props.inputRef !== undefined ? props.inputRef : null), [\n userProvidedInputRef,\n props.inputRef\n ]));\n let { labelProps: labelProps, inputProps: inputProps, isSelected: isSelected, isDisabled: isDisabled, isPressed: isPressed } = (0, $3sixo$useRadio)({\n ...(0, $64fa3d84918910a7$export$ef03459518577ad4)(props),\n // ReactNode type doesn't allow function children.\n children: typeof props.children === 'function' ? true : props.children\n }, state, inputRef);\n let { isFocused: isFocused, isFocusVisible: isFocusVisible, focusProps: focusProps } = (0, $3sixo$useFocusRing)();\n let interactionDisabled = isDisabled || state.isReadOnly;\n let { hoverProps: hoverProps, isHovered: isHovered } = (0, $3sixo$useHover)({\n ...props,\n isDisabled: interactionDisabled\n });\n let renderProps = (0, $64fa3d84918910a7$export$4d86445c2cf5e3)({\n ...props,\n defaultClassName: 'react-aria-Radio',\n values: {\n isSelected: isSelected,\n isPressed: isPressed,\n isHovered: isHovered,\n isFocused: isFocused,\n isFocusVisible: isFocusVisible,\n isDisabled: isDisabled,\n isReadOnly: state.isReadOnly,\n isInvalid: state.isInvalid,\n isRequired: state.isRequired\n }\n });\n let DOMProps = (0, $3sixo$filterDOMProps)(props, {\n global: true\n });\n delete DOMProps.id;\n delete DOMProps.onClick;\n return /*#__PURE__*/ (0, $3sixo$react).createElement(\"label\", {\n ...(0, $3sixo$mergeProps)(DOMProps, labelProps, hoverProps, renderProps),\n ref: ref,\n \"data-selected\": isSelected || undefined,\n \"data-pressed\": isPressed || undefined,\n \"data-hovered\": isHovered || undefined,\n \"data-focused\": isFocused || undefined,\n \"data-focus-visible\": isFocusVisible || undefined,\n \"data-disabled\": isDisabled || undefined,\n \"data-readonly\": state.isReadOnly || undefined,\n \"data-invalid\": state.isInvalid || undefined,\n \"data-required\": state.isRequired || undefined\n }, /*#__PURE__*/ (0, $3sixo$react).createElement((0, $3sixo$VisuallyHidden), {\n elementType: \"span\"\n }, /*#__PURE__*/ (0, $3sixo$react).createElement(\"input\", {\n ...(0, $3sixo$mergeProps)(inputProps, focusProps),\n ref: inputRef\n })), renderProps.children);\n});\n\n\nexport {$b6c3ddc6086f204d$export$a79eda4ff50e30b6 as RadioGroupContext, $b6c3ddc6086f204d$export$b118023277d4a5c3 as RadioContext, $b6c3ddc6086f204d$export$29d84393af70866c as RadioGroupStateContext, $b6c3ddc6086f204d$export$a98f0dcb43a68a25 as RadioGroup, $b6c3ddc6086f204d$export$d7b12c4107be0d61 as Radio};\n//# sourceMappingURL=RadioGroup.module.js.map\n","/* eslint-disable @typescript-eslint/no-empty-object-type */\nimport { createSlotRecipeContext } from \"@chakra-ui/react/styled-system\";\nimport type {\n RadioInputOptionSlotProps,\n RadioInputRootSlotProps,\n} from \"./radio-input.types\";\n\nconst { withProvider, withContext } = createSlotRecipeContext({\n key: \"radioInput\",\n});\n\nexport const RadioInputRootSlot = withProvider<\n HTMLDivElement,\n RadioInputRootSlotProps\n>(\"div\", \"root\");\n\nexport const RadioInputOptionSlot = withContext<\n HTMLSpanElement,\n RadioInputOptionSlotProps\n>(\"span\", \"option\");\n","import { useSlotRecipe } from \"@chakra-ui/react/styled-system\";\nimport { radioInputSlotRecipe } from \"../radio-input.recipe\";\nimport { RadioGroup as RaRadioGroup } from \"react-aria-components\";\nimport { extractStyleProps } from \"@/utils/extractStyleProps\";\nimport type { RadioInputRootProps } from \"../radio-input.types\";\nimport { RadioInputRootSlot } from \"../radio-input.slots\";\n\n/**\n * # RadioInput\n *\n * A set of closely related, mutually exclusive or complementary actions that are important enough to be displayed directly in the interface for quick access.\n *\n * @see {@link https://nimbus-documentation.vercel.app/components/inputs/radio-input}\n */\nexport const RadioInputRoot = (props: RadioInputRootProps) => {\n const recipe = useSlotRecipe({ recipe: radioInputSlotRecipe });\n const [recipeProps, restRecipeProps] = recipe.splitVariantProps(props);\n const [styleProps, restProps] = extractStyleProps(restRecipeProps);\n\n return (\n <RadioInputRootSlot {...recipeProps} {...styleProps} asChild>\n <RaRadioGroup {...restProps}>{props.children}</RaRadioGroup>\n </RadioInputRootSlot>\n );\n};\n\nRadioInputRoot.displayName = \"RadioInputRoot\";\n","import { Radio as RaRadio } from \"react-aria-components\";\nimport {\n RadioButtonChecked,\n RadioButtonUnchecked,\n} from \"@commercetools/nimbus-icons\";\nimport { extractStyleProps } from \"@/utils/extractStyleProps\";\nimport type { RadioInputOptionProps } from \"../radio-input.types\";\nimport { RadioInputOptionSlot } from \"../radio-input.slots\";\nimport { useFocusRing } from \"react-aria\";\n\nexport const RadioInputOption = ({\n children,\n value,\n ...rest\n}: RadioInputOptionProps) => {\n const [styleProps, restProps] = extractStyleProps(rest);\n const { isFocused, focusProps } = useFocusRing();\n\n return (\n <RadioInputOptionSlot\n {...styleProps}\n {...focusProps}\n data-focus={isFocused || undefined}\n asChild\n >\n <RaRadio value={value} {...restProps}>\n {(renderProps) => {\n const content =\n typeof children === \"function\"\n ? children({\n ...renderProps,\n })\n : children;\n return (\n <>\n {renderProps.isSelected ? (\n <RadioButtonChecked />\n ) : (\n <RadioButtonUnchecked />\n )}\n {content}\n </>\n );\n }}\n </RaRadio>\n </RadioInputOptionSlot>\n );\n};\n\nRadioInputOption.displayName = \"RadioInputOption\";\n","import { RadioInputRoot as _RadioInputRoot } from \"./components/radio-input.root\";\nimport { RadioInputOption as _RadioInputOption } from \"./components/radio-input.option\";\n\nexport const RadioInput = {\n Root: _RadioInputRoot,\n Option: _RadioInputOption,\n};\n\nexport { _RadioInputRoot, _RadioInputOption };\n"],"names":["$884aeceb3d67f00f$export$37b65e5b5444d35c","$0d5c49892c1215da$export$37b0961d2f4751e2","props","state","ref","value","children","ariaLabel","ariaLabelledby","onPressStart","onPressEnd","onPressChange","onPress","onPressUp","onClick","isDisabled","hasChildren","hasAriaLabel","checked","onChange","e","pressProps","isPressed","$5jJ3f$usePress","labelProps","isLabelPressed","_ref_current","focusableProps","$5jJ3f$useFocusable","$5jJ3f$mergeProps","interactions","domProps","$5jJ3f$filterDOMProps","tabIndex","name","form","descriptionId","errorMessageId","validationBehavior","$5jJ3f$useFormReset","$5jJ3f$useFormValidation","$430f30ed08ec25fa$export$62b9571f283ff5c2","isReadOnly","isRequired","orientation","direction","$czmJy$useLocale","isInvalid","validationErrors","validationDetails","fieldProps","descriptionProps","errorMessageProps","$czmJy$useField","$czmJy$filterDOMProps","focusWithinProps","$czmJy$useFocusWithin","_props_onBlur","onKeyDown","nextDir","walker","$czmJy$getFocusableTreeWalker","node","$czmJy$getOwnerWindow","nextElem","groupName","$czmJy$useId","$czmJy$mergeProps","$a54cdc5c1942b639$var$instance","$a54cdc5c1942b639$var$i","$a54cdc5c1942b639$export$bca9d026f8e704eb","$l55kx$useMemo","_props_defaultValue","selectedValue","setSelected","$l55kx$useControlledState","initialValue","$l55kx$useState","lastFocusedValue","setLastFocusedValue","validation","$l55kx$useFormValidationState","setSelectedValue","_props_defaultValue1","$b6c3ddc6086f204d$export$a79eda4ff50e30b6","$3sixo$createContext","$b6c3ddc6086f204d$export$b118023277d4a5c3","$b6c3ddc6086f204d$export$29d84393af70866c","$b6c3ddc6086f204d$export$a98f0dcb43a68a25","$3sixo$forwardRef","$64fa3d84918910a7$export$29f1550f4b0d4415","formValidationBehavior","$64fa3d84918910a7$export$fabf2dc03a41866e","$d3e0e05bdfcf66bd$export$c24727297075ec6a","_props_validationBehavior","_ref","$3sixo$useRadioGroupState","labelRef","label","$64fa3d84918910a7$export$9d4c57ee4c6ffdd8","radioGroupProps","$3sixo$useRadioGroup","renderProps","$64fa3d84918910a7$export$4d86445c2cf5e3","DOMProps","$3sixo$filterDOMProps","$3sixo$react","$3sixo$mergeProps","$64fa3d84918910a7$export$2881499e37b75b9a","$01b77f81d0f07f68$export$75b6ee27786ba447","$514c0188e459b4c0$export$9afb8bc826b033ea","$ee014567cb39d3f0$export$ff05c3ac10437e03","$b6c3ddc6086f204d$export$d7b12c4107be0d61","userProvidedInputRef","otherProps","inputRef","$3sixo$useObjectRef","$3sixo$useMemo","$3sixo$mergeRefs","inputProps","isSelected","$3sixo$useRadio","$64fa3d84918910a7$export$ef03459518577ad4","isFocused","isFocusVisible","focusProps","$3sixo$useFocusRing","interactionDisabled","hoverProps","isHovered","$3sixo$useHover","$3sixo$VisuallyHidden","withProvider","withContext","createSlotRecipeContext","RadioInputRootSlot","RadioInputOptionSlot","RadioInputRoot","recipe","useSlotRecipe","radioInputSlotRecipe","recipeProps","restRecipeProps","styleProps","restProps","extractStyleProps","jsx","RaRadioGroup","RadioInputOption","rest","useFocusRing","RaRadio","content","jsxs","Fragment","RadioButtonChecked","RadioButtonUnchecked","RadioInput","_RadioInputRoot","_RadioInputOption"],"mappings":"ynCAUUA,EAA4C,IAAI,QCS1D,SAASC,GAA0CC,EAAOC,EAAOC,EAAK,CAClE,GAAI,CAAE,MAAOC,EAAO,SAAUC,EAAU,aAAcC,EA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D,CAACC,EAAaC,CAAe,EAAIJ,EAAO,kBAAkBxI,CAAK,EAC/D,CAAC6I,EAAYC,CAAS,EAAIC,EAAAA,kBAAkBH,CAAe,EAEjE,OACEI,EAAAA,IAACX,GAAA,CAAoB,GAAGM,EAAc,GAAGE,EAAY,QAAO,GAC1D,SAAAG,EAAAA,IAACC,GAAA,CAAc,GAAGH,EAAY,SAAA9I,EAAM,SAAS,EAC/C,CAEJ,EAEAuI,EAAe,YAAc,iBChBtB,MAAMW,EAAmB,CAAC,CAC/B,SAAA9I,EACA,MAAAD,EACA,GAAGgJ,CACL,IAA6B,CAC3B,KAAM,CAACN,EAAYC,CAAS,EAAIC,EAAAA,kBAAkBI,CAAI,EAChD,CAAE,UAAA1B,EAAW,WAAAE,CAAA,EAAeyB,4CAAA,EAElC,OACEJ,EAAAA,IAACV,GAAA,CACE,GAAGO,EACH,GAAGlB,EACJ,aAAYF,GAAa,OACzB,QAAO,GAEP,eAAC4B,GAAA,CAAQ,MAAAlJ,EAAe,GAAG2I,EACxB,SAAC1C,GAAgB,CAChB,MAAMkD,EACJ,OAAOlJ,GAAa,WAChBA,EAAS,CACP,GAAGgG,CAAA,CACJ,EACDhG,EACN,OACEmJ,EAAAA,KAAAC,WAAA,CACG,SAAA,CAAApD,EAAY,WACX4C,EAAAA,IAACS,EAAAA,mBAAA,CAAA,CAAmB,QAEnBC,EAAAA,qBAAA,EAAqB,EAEvBJ,CAAA,EACH,CAEJ,CAAA,CACF,CAAA,CAAA,CAGN,EAEAJ,EAAiB,YAAc,mBC9CxB,MAAMS,GAAa,CACxB,KAAMC,EACN,OAAQC,CACV","x_google_ignoreList":[0,1,2,3,4]}
1
+ {"version":3,"file":"radio-input-B40xSi6r.cjs.js","sources":["../../../../node_modules/.pnpm/@react-aria+radio@3.12.1_react-dom@19.1.1_react@19.1.1__react@19.1.1/node_modules/@react-aria/radio/dist/utils.mjs","../../../../node_modules/.pnpm/@react-aria+radio@3.12.1_react-dom@19.1.1_react@19.1.1__react@19.1.1/node_modules/@react-aria/radio/dist/useRadio.mjs","../../../../node_modules/.pnpm/@react-aria+radio@3.12.1_react-dom@19.1.1_react@19.1.1__react@19.1.1/node_modules/@react-aria/radio/dist/useRadioGroup.mjs","../../../../node_modules/.pnpm/@react-stately+radio@3.11.1_react@19.1.1/node_modules/@react-stately/radio/dist/useRadioGroupState.mjs","../../../../node_modules/.pnpm/react-aria-components@1.12.1_react-dom@19.1.1_react@19.1.1__react@19.1.1/node_modules/react-aria-components/dist/RadioGroup.mjs","../../src/components/radio-input/radio-input.slots.tsx","../../src/components/radio-input/components/radio-input.root.tsx","../../src/components/radio-input/components/radio-input.option.tsx","../../src/components/radio-input/radio-input.tsx"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */ const $884aeceb3d67f00f$export$37b65e5b5444d35c = new WeakMap();\n\n\nexport {$884aeceb3d67f00f$export$37b65e5b5444d35c as radioGroupData};\n//# sourceMappingURL=utils.module.js.map\n","import {radioGroupData as $884aeceb3d67f00f$export$37b65e5b5444d35c} from \"./utils.mjs\";\nimport {mergeProps as $5jJ3f$mergeProps, filterDOMProps as $5jJ3f$filterDOMProps, useFormReset as $5jJ3f$useFormReset} from \"@react-aria/utils\";\nimport {usePress as $5jJ3f$usePress, useFocusable as $5jJ3f$useFocusable} from \"@react-aria/interactions\";\nimport {useFormValidation as $5jJ3f$useFormValidation} from \"@react-aria/form\";\n\n/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */ \n\n\n\nfunction $0d5c49892c1215da$export$37b0961d2f4751e2(props, state, ref) {\n let { value: value, children: children, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledby, onPressStart: onPressStart, onPressEnd: onPressEnd, onPressChange: onPressChange, onPress: onPress, onPressUp: onPressUp, onClick: onClick } = props;\n const isDisabled = props.isDisabled || state.isDisabled;\n let hasChildren = children != null;\n let hasAriaLabel = ariaLabel != null || ariaLabelledby != null;\n if (!hasChildren && !hasAriaLabel && process.env.NODE_ENV !== 'production') console.warn('If you do not provide children, you must specify an aria-label for accessibility');\n let checked = state.selectedValue === value;\n let onChange = (e)=>{\n e.stopPropagation();\n state.setSelectedValue(value);\n };\n // Handle press state for keyboard interactions and cases where labelProps is not used.\n let { pressProps: pressProps, isPressed: isPressed } = (0, $5jJ3f$usePress)({\n onPressStart: onPressStart,\n onPressEnd: onPressEnd,\n onPressChange: onPressChange,\n onPress: onPress,\n onPressUp: onPressUp,\n onClick: onClick,\n isDisabled: isDisabled\n });\n // Handle press state on the label.\n let { pressProps: labelProps, isPressed: isLabelPressed } = (0, $5jJ3f$usePress)({\n onPressStart: onPressStart,\n onPressEnd: onPressEnd,\n onPressChange: onPressChange,\n onPressUp: onPressUp,\n onClick: onClick,\n isDisabled: isDisabled,\n onPress (e) {\n var _ref_current;\n onPress === null || onPress === void 0 ? void 0 : onPress(e);\n state.setSelectedValue(value);\n (_ref_current = ref.current) === null || _ref_current === void 0 ? void 0 : _ref_current.focus();\n }\n });\n let { focusableProps: focusableProps } = (0, $5jJ3f$useFocusable)((0, $5jJ3f$mergeProps)(props, {\n onFocus: ()=>state.setLastFocusedValue(value)\n }), ref);\n let interactions = (0, $5jJ3f$mergeProps)(pressProps, focusableProps);\n let domProps = (0, $5jJ3f$filterDOMProps)(props, {\n labelable: true\n });\n let tabIndex = -1;\n if (state.selectedValue != null) {\n if (state.selectedValue === value) tabIndex = 0;\n } else if (state.lastFocusedValue === value || state.lastFocusedValue == null) tabIndex = 0;\n if (isDisabled) tabIndex = undefined;\n let { name: name, form: form, descriptionId: descriptionId, errorMessageId: errorMessageId, validationBehavior: validationBehavior } = (0, $884aeceb3d67f00f$export$37b65e5b5444d35c).get(state);\n (0, $5jJ3f$useFormReset)(ref, state.defaultSelectedValue, state.setSelectedValue);\n (0, $5jJ3f$useFormValidation)({\n validationBehavior: validationBehavior\n }, state, ref);\n return {\n labelProps: (0, $5jJ3f$mergeProps)(labelProps, {\n onClick: (e)=>e.preventDefault()\n }),\n inputProps: (0, $5jJ3f$mergeProps)(domProps, {\n ...interactions,\n type: 'radio',\n name: name,\n form: form,\n tabIndex: tabIndex,\n disabled: isDisabled,\n required: state.isRequired && validationBehavior === 'native',\n checked: checked,\n value: value,\n onChange: onChange,\n 'aria-describedby': [\n props['aria-describedby'],\n state.isInvalid ? errorMessageId : null,\n descriptionId\n ].filter(Boolean).join(' ') || undefined\n }),\n isDisabled: isDisabled,\n isSelected: checked,\n isPressed: isPressed || isLabelPressed\n };\n}\n\n\nexport {$0d5c49892c1215da$export$37b0961d2f4751e2 as useRadio};\n//# sourceMappingURL=useRadio.module.js.map\n","import {radioGroupData as $884aeceb3d67f00f$export$37b65e5b5444d35c} from \"./utils.mjs\";\nimport {filterDOMProps as $czmJy$filterDOMProps, getOwnerWindow as $czmJy$getOwnerWindow, useId as $czmJy$useId, mergeProps as $czmJy$mergeProps} from \"@react-aria/utils\";\nimport {getFocusableTreeWalker as $czmJy$getFocusableTreeWalker} from \"@react-aria/focus\";\nimport {useField as $czmJy$useField} from \"@react-aria/label\";\nimport {useFocusWithin as $czmJy$useFocusWithin} from \"@react-aria/interactions\";\nimport {useLocale as $czmJy$useLocale} from \"@react-aria/i18n\";\n\n/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */ \n\n\n\n\n\nfunction $430f30ed08ec25fa$export$62b9571f283ff5c2(props, state) {\n let { name: name, form: form, isReadOnly: isReadOnly, isRequired: isRequired, isDisabled: isDisabled, orientation: orientation = 'vertical', validationBehavior: validationBehavior = 'aria' } = props;\n let { direction: direction } = (0, $czmJy$useLocale)();\n let { isInvalid: isInvalid, validationErrors: validationErrors, validationDetails: validationDetails } = state.displayValidation;\n let { labelProps: labelProps, fieldProps: fieldProps, descriptionProps: descriptionProps, errorMessageProps: errorMessageProps } = (0, $czmJy$useField)({\n ...props,\n // Radio group is not an HTML input element so it\n // shouldn't be labeled by a <label> element.\n labelElementType: 'span',\n isInvalid: state.isInvalid,\n errorMessage: props.errorMessage || validationErrors\n });\n let domProps = (0, $czmJy$filterDOMProps)(props, {\n labelable: true\n });\n // When the radio group loses focus, reset the focusable radio to null if\n // there is no selection. This allows tabbing into the group from either\n // direction to go to the first or last radio.\n let { focusWithinProps: focusWithinProps } = (0, $czmJy$useFocusWithin)({\n onBlurWithin (e) {\n var _props_onBlur;\n (_props_onBlur = props.onBlur) === null || _props_onBlur === void 0 ? void 0 : _props_onBlur.call(props, e);\n if (!state.selectedValue) state.setLastFocusedValue(null);\n },\n onFocusWithin: props.onFocus,\n onFocusWithinChange: props.onFocusChange\n });\n let onKeyDown = (e)=>{\n let nextDir;\n switch(e.key){\n case 'ArrowRight':\n if (direction === 'rtl' && orientation !== 'vertical') nextDir = 'prev';\n else nextDir = 'next';\n break;\n case 'ArrowLeft':\n if (direction === 'rtl' && orientation !== 'vertical') nextDir = 'next';\n else nextDir = 'prev';\n break;\n case 'ArrowDown':\n nextDir = 'next';\n break;\n case 'ArrowUp':\n nextDir = 'prev';\n break;\n default:\n return;\n }\n e.preventDefault();\n let walker = (0, $czmJy$getFocusableTreeWalker)(e.currentTarget, {\n from: e.target,\n accept: (node)=>node instanceof (0, $czmJy$getOwnerWindow)(node).HTMLInputElement && node.type === 'radio'\n });\n let nextElem;\n if (nextDir === 'next') {\n nextElem = walker.nextNode();\n if (!nextElem) {\n walker.currentNode = e.currentTarget;\n nextElem = walker.firstChild();\n }\n } else {\n nextElem = walker.previousNode();\n if (!nextElem) {\n walker.currentNode = e.currentTarget;\n nextElem = walker.lastChild();\n }\n }\n if (nextElem) {\n // Call focus on nextElem so that keyboard navigation scrolls the radio into view\n nextElem.focus();\n state.setSelectedValue(nextElem.value);\n }\n };\n let groupName = (0, $czmJy$useId)(name);\n (0, $884aeceb3d67f00f$export$37b65e5b5444d35c).set(state, {\n name: groupName,\n form: form,\n descriptionId: descriptionProps.id,\n errorMessageId: errorMessageProps.id,\n validationBehavior: validationBehavior\n });\n return {\n radioGroupProps: (0, $czmJy$mergeProps)(domProps, {\n // https://www.w3.org/TR/wai-aria-1.2/#radiogroup\n role: 'radiogroup',\n onKeyDown: onKeyDown,\n 'aria-invalid': state.isInvalid || undefined,\n 'aria-errormessage': props['aria-errormessage'],\n 'aria-readonly': isReadOnly || undefined,\n 'aria-required': isRequired || undefined,\n 'aria-disabled': isDisabled || undefined,\n 'aria-orientation': orientation,\n ...fieldProps,\n ...focusWithinProps\n }),\n labelProps: labelProps,\n descriptionProps: descriptionProps,\n errorMessageProps: errorMessageProps,\n isInvalid: isInvalid,\n validationErrors: validationErrors,\n validationDetails: validationDetails\n };\n}\n\n\nexport {$430f30ed08ec25fa$export$62b9571f283ff5c2 as useRadioGroup};\n//# sourceMappingURL=useRadioGroup.module.js.map\n","import {useFormValidationState as $l55kx$useFormValidationState} from \"@react-stately/form\";\nimport {useControlledState as $l55kx$useControlledState} from \"@react-stately/utils\";\nimport {useMemo as $l55kx$useMemo, useState as $l55kx$useState} from \"react\";\n\n/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */ \n\n\nlet $a54cdc5c1942b639$var$instance = Math.round(Math.random() * 10000000000);\nlet $a54cdc5c1942b639$var$i = 0;\nfunction $a54cdc5c1942b639$export$bca9d026f8e704eb(props) {\n // Preserved here for backward compatibility. React Aria now generates the name instead of stately.\n let name = (0, $l55kx$useMemo)(()=>props.name || `radio-group-${$a54cdc5c1942b639$var$instance}-${++$a54cdc5c1942b639$var$i}`, [\n props.name\n ]);\n var _props_defaultValue;\n let [selectedValue, setSelected] = (0, $l55kx$useControlledState)(props.value, (_props_defaultValue = props.defaultValue) !== null && _props_defaultValue !== void 0 ? _props_defaultValue : null, props.onChange);\n let [initialValue] = (0, $l55kx$useState)(selectedValue);\n let [lastFocusedValue, setLastFocusedValue] = (0, $l55kx$useState)(null);\n let validation = (0, $l55kx$useFormValidationState)({\n ...props,\n value: selectedValue\n });\n let setSelectedValue = (value)=>{\n if (!props.isReadOnly && !props.isDisabled) {\n setSelected(value);\n validation.commitValidation();\n }\n };\n let isInvalid = validation.displayValidation.isInvalid;\n var _props_defaultValue1;\n return {\n ...validation,\n name: name,\n selectedValue: selectedValue,\n defaultSelectedValue: props.value !== undefined ? initialValue : (_props_defaultValue1 = props.defaultValue) !== null && _props_defaultValue1 !== void 0 ? _props_defaultValue1 : null,\n setSelectedValue: setSelectedValue,\n lastFocusedValue: lastFocusedValue,\n setLastFocusedValue: setLastFocusedValue,\n isDisabled: props.isDisabled || false,\n isReadOnly: props.isReadOnly || false,\n isRequired: props.isRequired || false,\n validationState: props.validationState || (isInvalid ? 'invalid' : null),\n isInvalid: isInvalid\n };\n}\n\n\nexport {$a54cdc5c1942b639$export$bca9d026f8e704eb as useRadioGroupState};\n//# sourceMappingURL=useRadioGroupState.module.js.map\n","import {Provider as $64fa3d84918910a7$export$2881499e37b75b9a, removeDataAttributes as $64fa3d84918910a7$export$ef03459518577ad4, useContextProps as $64fa3d84918910a7$export$29f1550f4b0d4415, useRenderProps as $64fa3d84918910a7$export$4d86445c2cf5e3, useSlot as $64fa3d84918910a7$export$9d4c57ee4c6ffdd8, useSlottedContext as $64fa3d84918910a7$export$fabf2dc03a41866e} from \"./utils.mjs\";\nimport {FieldErrorContext as $ee014567cb39d3f0$export$ff05c3ac10437e03} from \"./FieldError.mjs\";\nimport {FormContext as $d3e0e05bdfcf66bd$export$c24727297075ec6a} from \"./Form.mjs\";\nimport {LabelContext as $01b77f81d0f07f68$export$75b6ee27786ba447} from \"./Label.mjs\";\nimport {TextContext as $514c0188e459b4c0$export$9afb8bc826b033ea} from \"./Text.mjs\";\nimport {useRadioGroup as $3sixo$useRadioGroup, useRadio as $3sixo$useRadio, useFocusRing as $3sixo$useFocusRing, useHover as $3sixo$useHover, VisuallyHidden as $3sixo$VisuallyHidden} from \"react-aria\";\nimport {filterDOMProps as $3sixo$filterDOMProps, mergeProps as $3sixo$mergeProps, useObjectRef as $3sixo$useObjectRef, mergeRefs as $3sixo$mergeRefs} from \"@react-aria/utils\";\nimport {useRadioGroupState as $3sixo$useRadioGroupState} from \"react-stately\";\nimport $3sixo$react, {createContext as $3sixo$createContext, forwardRef as $3sixo$forwardRef, useMemo as $3sixo$useMemo} from \"react\";\n\n/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */ \n\n\n\n\n\n\n\n\nconst $b6c3ddc6086f204d$export$a79eda4ff50e30b6 = /*#__PURE__*/ (0, $3sixo$createContext)(null);\nconst $b6c3ddc6086f204d$export$b118023277d4a5c3 = /*#__PURE__*/ (0, $3sixo$createContext)(null);\nconst $b6c3ddc6086f204d$export$29d84393af70866c = /*#__PURE__*/ (0, $3sixo$createContext)(null);\nconst $b6c3ddc6086f204d$export$a98f0dcb43a68a25 = /*#__PURE__*/ (0, $3sixo$forwardRef)(function RadioGroup(props, ref) {\n [props, ref] = (0, $64fa3d84918910a7$export$29f1550f4b0d4415)(props, ref, $b6c3ddc6086f204d$export$a79eda4ff50e30b6);\n let { validationBehavior: formValidationBehavior } = (0, $64fa3d84918910a7$export$fabf2dc03a41866e)((0, $d3e0e05bdfcf66bd$export$c24727297075ec6a)) || {};\n var _props_validationBehavior, _ref;\n let validationBehavior = (_ref = (_props_validationBehavior = props.validationBehavior) !== null && _props_validationBehavior !== void 0 ? _props_validationBehavior : formValidationBehavior) !== null && _ref !== void 0 ? _ref : 'native';\n let state = (0, $3sixo$useRadioGroupState)({\n ...props,\n validationBehavior: validationBehavior\n });\n let [labelRef, label] = (0, $64fa3d84918910a7$export$9d4c57ee4c6ffdd8)(!props['aria-label'] && !props['aria-labelledby']);\n let { radioGroupProps: radioGroupProps, labelProps: labelProps, descriptionProps: descriptionProps, errorMessageProps: errorMessageProps, ...validation } = (0, $3sixo$useRadioGroup)({\n ...props,\n label: label,\n validationBehavior: validationBehavior\n }, state);\n let renderProps = (0, $64fa3d84918910a7$export$4d86445c2cf5e3)({\n ...props,\n values: {\n orientation: props.orientation || 'vertical',\n isDisabled: state.isDisabled,\n isReadOnly: state.isReadOnly,\n isRequired: state.isRequired,\n isInvalid: state.isInvalid,\n state: state\n },\n defaultClassName: 'react-aria-RadioGroup'\n });\n let DOMProps = (0, $3sixo$filterDOMProps)(props, {\n global: true\n });\n return /*#__PURE__*/ (0, $3sixo$react).createElement(\"div\", {\n ...(0, $3sixo$mergeProps)(DOMProps, renderProps, radioGroupProps),\n ref: ref,\n slot: props.slot || undefined,\n \"data-orientation\": props.orientation || 'vertical',\n \"data-invalid\": state.isInvalid || undefined,\n \"data-disabled\": state.isDisabled || undefined,\n \"data-readonly\": state.isReadOnly || undefined,\n \"data-required\": state.isRequired || undefined\n }, /*#__PURE__*/ (0, $3sixo$react).createElement((0, $64fa3d84918910a7$export$2881499e37b75b9a), {\n values: [\n [\n $b6c3ddc6086f204d$export$29d84393af70866c,\n state\n ],\n [\n (0, $01b77f81d0f07f68$export$75b6ee27786ba447),\n {\n ...labelProps,\n ref: labelRef,\n elementType: 'span'\n }\n ],\n [\n (0, $514c0188e459b4c0$export$9afb8bc826b033ea),\n {\n slots: {\n description: descriptionProps,\n errorMessage: errorMessageProps\n }\n }\n ],\n [\n (0, $ee014567cb39d3f0$export$ff05c3ac10437e03),\n validation\n ]\n ]\n }, renderProps.children));\n});\nconst $b6c3ddc6086f204d$export$d7b12c4107be0d61 = /*#__PURE__*/ (0, $3sixo$forwardRef)(function Radio(props, ref) {\n let { inputRef: userProvidedInputRef = null, ...otherProps } = props;\n [props, ref] = (0, $64fa3d84918910a7$export$29f1550f4b0d4415)(otherProps, ref, $b6c3ddc6086f204d$export$b118023277d4a5c3);\n let state = (0, $3sixo$react).useContext($b6c3ddc6086f204d$export$29d84393af70866c);\n let inputRef = (0, $3sixo$useObjectRef)((0, $3sixo$useMemo)(()=>(0, $3sixo$mergeRefs)(userProvidedInputRef, props.inputRef !== undefined ? props.inputRef : null), [\n userProvidedInputRef,\n props.inputRef\n ]));\n let { labelProps: labelProps, inputProps: inputProps, isSelected: isSelected, isDisabled: isDisabled, isPressed: isPressed } = (0, $3sixo$useRadio)({\n ...(0, $64fa3d84918910a7$export$ef03459518577ad4)(props),\n // ReactNode type doesn't allow function children.\n children: typeof props.children === 'function' ? true : props.children\n }, state, inputRef);\n let { isFocused: isFocused, isFocusVisible: isFocusVisible, focusProps: focusProps } = (0, $3sixo$useFocusRing)();\n let interactionDisabled = isDisabled || state.isReadOnly;\n let { hoverProps: hoverProps, isHovered: isHovered } = (0, $3sixo$useHover)({\n ...props,\n isDisabled: interactionDisabled\n });\n let renderProps = (0, $64fa3d84918910a7$export$4d86445c2cf5e3)({\n ...props,\n defaultClassName: 'react-aria-Radio',\n values: {\n isSelected: isSelected,\n isPressed: isPressed,\n isHovered: isHovered,\n isFocused: isFocused,\n isFocusVisible: isFocusVisible,\n isDisabled: isDisabled,\n isReadOnly: state.isReadOnly,\n isInvalid: state.isInvalid,\n isRequired: state.isRequired\n }\n });\n let DOMProps = (0, $3sixo$filterDOMProps)(props, {\n global: true\n });\n delete DOMProps.id;\n delete DOMProps.onClick;\n return /*#__PURE__*/ (0, $3sixo$react).createElement(\"label\", {\n ...(0, $3sixo$mergeProps)(DOMProps, labelProps, hoverProps, renderProps),\n ref: ref,\n \"data-selected\": isSelected || undefined,\n \"data-pressed\": isPressed || undefined,\n \"data-hovered\": isHovered || undefined,\n \"data-focused\": isFocused || undefined,\n \"data-focus-visible\": isFocusVisible || undefined,\n \"data-disabled\": isDisabled || undefined,\n \"data-readonly\": state.isReadOnly || undefined,\n \"data-invalid\": state.isInvalid || undefined,\n \"data-required\": state.isRequired || undefined\n }, /*#__PURE__*/ (0, $3sixo$react).createElement((0, $3sixo$VisuallyHidden), {\n elementType: \"span\"\n }, /*#__PURE__*/ (0, $3sixo$react).createElement(\"input\", {\n ...(0, $3sixo$mergeProps)(inputProps, focusProps),\n ref: inputRef\n })), renderProps.children);\n});\n\n\nexport {$b6c3ddc6086f204d$export$a79eda4ff50e30b6 as RadioGroupContext, $b6c3ddc6086f204d$export$b118023277d4a5c3 as RadioContext, $b6c3ddc6086f204d$export$29d84393af70866c as RadioGroupStateContext, $b6c3ddc6086f204d$export$a98f0dcb43a68a25 as RadioGroup, $b6c3ddc6086f204d$export$d7b12c4107be0d61 as Radio};\n//# sourceMappingURL=RadioGroup.module.js.map\n","/* eslint-disable @typescript-eslint/no-empty-object-type */\nimport { createSlotRecipeContext } from \"@chakra-ui/react/styled-system\";\nimport type {\n RadioInputOptionSlotProps,\n RadioInputRootSlotProps,\n} from \"./radio-input.types\";\n\nconst { withProvider, withContext } = createSlotRecipeContext({\n key: \"radioInput\",\n});\n\nexport const RadioInputRootSlot = withProvider<\n HTMLDivElement,\n RadioInputRootSlotProps\n>(\"div\", \"root\");\n\nexport const RadioInputOptionSlot = withContext<\n HTMLSpanElement,\n RadioInputOptionSlotProps\n>(\"span\", \"option\");\n","import { useSlotRecipe } from \"@chakra-ui/react/styled-system\";\nimport { radioInputSlotRecipe } from \"../radio-input.recipe\";\nimport { RadioGroup as RaRadioGroup } from \"react-aria-components\";\nimport { extractStyleProps } from \"@/utils/extractStyleProps\";\nimport type { RadioInputRootProps } from \"../radio-input.types\";\nimport { RadioInputRootSlot } from \"../radio-input.slots\";\n\n/**\n * # RadioInput\n *\n * A set of closely related, mutually exclusive or complementary actions that are important enough to be displayed directly in the interface for quick access.\n *\n * @see {@link https://nimbus-documentation.vercel.app/components/inputs/radio-input}\n */\nexport const RadioInputRoot = (props: RadioInputRootProps) => {\n const recipe = useSlotRecipe({ recipe: radioInputSlotRecipe });\n const [recipeProps, restRecipeProps] = recipe.splitVariantProps(props);\n const [styleProps, restProps] = extractStyleProps(restRecipeProps);\n\n return (\n <RadioInputRootSlot {...recipeProps} {...styleProps} asChild>\n <RaRadioGroup {...restProps}>{props.children}</RaRadioGroup>\n </RadioInputRootSlot>\n );\n};\n\nRadioInputRoot.displayName = \"RadioInputRoot\";\n","import { Radio as RaRadio } from \"react-aria-components\";\nimport {\n RadioButtonChecked,\n RadioButtonUnchecked,\n} from \"@commercetools/nimbus-icons\";\nimport { extractStyleProps } from \"@/utils/extractStyleProps\";\nimport type { RadioInputOptionProps } from \"../radio-input.types\";\nimport { RadioInputOptionSlot } from \"../radio-input.slots\";\nimport { useFocusRing } from \"react-aria\";\n\nexport const RadioInputOption = ({\n children,\n value,\n ...rest\n}: RadioInputOptionProps) => {\n const [styleProps, restProps] = extractStyleProps(rest);\n const { isFocused, focusProps } = useFocusRing();\n\n return (\n <RadioInputOptionSlot\n {...styleProps}\n {...focusProps}\n data-focus={isFocused || undefined}\n asChild\n >\n <RaRadio value={value} {...restProps}>\n {(renderProps) => {\n const content =\n typeof children === \"function\"\n ? children({\n ...renderProps,\n })\n : children;\n return (\n <>\n {renderProps.isSelected ? (\n <RadioButtonChecked />\n ) : (\n <RadioButtonUnchecked />\n )}\n {content}\n </>\n );\n }}\n </RaRadio>\n </RadioInputOptionSlot>\n );\n};\n\nRadioInputOption.displayName = \"RadioInputOption\";\n","import { RadioInputRoot as _RadioInputRoot } from \"./components/radio-input.root\";\nimport { RadioInputOption as _RadioInputOption } from \"./components/radio-input.option\";\n\nexport const RadioInput = {\n Root: _RadioInputRoot,\n Option: _RadioInputOption,\n};\n\nexport { _RadioInputRoot, _RadioInputOption };\n"],"names":["$884aeceb3d67f00f$export$37b65e5b5444d35c","$0d5c49892c1215da$export$37b0961d2f4751e2","props","state","ref","value","children","ariaLabel","ariaLabelledby","onPressStart","onPressEnd","onPressChange","onPress","onPressUp","onClick","isDisabled","hasChildren","hasAriaLabel","checked","onChange","e","pressProps","isPressed","$5jJ3f$usePress","labelProps","isLabelPressed","_ref_current","focusableProps","$5jJ3f$useFocusable","$5jJ3f$mergeProps","interactions","domProps","$5jJ3f$filterDOMProps","tabIndex","name","form","descriptionId","errorMessageId","validationBehavior","$5jJ3f$useFormReset","$5jJ3f$useFormValidation","$430f30ed08ec25fa$export$62b9571f283ff5c2","isReadOnly","isRequired","orientation","direction","$czmJy$useLocale","isInvalid","validationErrors","validationDetails","fieldProps","descriptionProps","errorMessageProps","$czmJy$useField","$czmJy$filterDOMProps","focusWithinProps","$czmJy$useFocusWithin","_props_onBlur","onKeyDown","nextDir","walker","$czmJy$getFocusableTreeWalker","node","$czmJy$getOwnerWindow","nextElem","groupName","$czmJy$useId","$czmJy$mergeProps","$a54cdc5c1942b639$var$instance","$a54cdc5c1942b639$var$i","$a54cdc5c1942b639$export$bca9d026f8e704eb","$l55kx$useMemo","_props_defaultValue","selectedValue","setSelected","$l55kx$useControlledState","initialValue","$l55kx$useState","lastFocusedValue","setLastFocusedValue","validation","$l55kx$useFormValidationState","setSelectedValue","_props_defaultValue1","$b6c3ddc6086f204d$export$a79eda4ff50e30b6","$3sixo$createContext","$b6c3ddc6086f204d$export$b118023277d4a5c3","$b6c3ddc6086f204d$export$29d84393af70866c","$b6c3ddc6086f204d$export$a98f0dcb43a68a25","$3sixo$forwardRef","$64fa3d84918910a7$export$29f1550f4b0d4415","formValidationBehavior","$64fa3d84918910a7$export$fabf2dc03a41866e","$d3e0e05bdfcf66bd$export$c24727297075ec6a","_props_validationBehavior","_ref","$3sixo$useRadioGroupState","labelRef","label","$64fa3d84918910a7$export$9d4c57ee4c6ffdd8","radioGroupProps","$3sixo$useRadioGroup","renderProps","$64fa3d84918910a7$export$4d86445c2cf5e3","DOMProps","$3sixo$filterDOMProps","$3sixo$react","$3sixo$mergeProps","$64fa3d84918910a7$export$2881499e37b75b9a","$01b77f81d0f07f68$export$75b6ee27786ba447","$514c0188e459b4c0$export$9afb8bc826b033ea","$ee014567cb39d3f0$export$ff05c3ac10437e03","$b6c3ddc6086f204d$export$d7b12c4107be0d61","userProvidedInputRef","otherProps","inputRef","$3sixo$useObjectRef","$3sixo$useMemo","$3sixo$mergeRefs","inputProps","isSelected","$3sixo$useRadio","$64fa3d84918910a7$export$ef03459518577ad4","isFocused","isFocusVisible","focusProps","$3sixo$useFocusRing","interactionDisabled","hoverProps","isHovered","$3sixo$useHover","$3sixo$VisuallyHidden","withProvider","withContext","createSlotRecipeContext","RadioInputRootSlot","RadioInputOptionSlot","RadioInputRoot","recipe","useSlotRecipe","radioInputSlotRecipe","recipeProps","restRecipeProps","styleProps","restProps","extractStyleProps","jsx","RaRadioGroup","RadioInputOption","rest","useFocusRing","RaRadio","content","jsxs","Fragment","RadioButtonChecked","RadioButtonUnchecked","RadioInput","_RadioInputRoot","_RadioInputOption"],"mappings":"ynCAUUA,EAA4C,IAAI,QCS1D,SAASC,GAA0CC,EAAOC,EAAOC,EAAK,CAClE,GAAI,CAAE,MAAOC,EAAO,SAAUC,EAAU,aAAcC,EAAW,kBAAmBC,EAAgB,aAAcC,EAAc,WAAYC,EAAY,cAAeC,EAAe,QAASC,EAAS,UAAWC,EAAW,QAASC,CAAO,EAAKZ,EACnP,MAAMa,EAAab,EAAM,YAAcC,EAAM,WAC7C,IAAIa,EAAcV,GAAY,KAC1BW,EAAeV,GAAa,MAAQC,GAAkB,KACtD,CAACQ,GAAe,CAACC,GAAgB,QAAQ,IAAI,WAAa,cAAc,QAAQ,KAAK,kFAAkF,EAC3K,IAAIC,EAAUf,EAAM,gBAAkBE,EAClCc,EAAYC,GAAI,CAChBA,EAAE,gBAAe,EACjBjB,EAAM,iBAAiBE,CAAK,CAChC,EAEI,CAAE,WAAYgB,EAAY,UAAWC,CAAS,EAASC,4CAAiB,CACxE,aAAcd,EACd,WAAYC,EACZ,cAAeC,EACf,QAASC,EACT,UAAWC,EACX,QAASC,EACT,WAAYC,CACpB,CAAK,EAEG,CAAE,WAAYS,EAAY,UAAWC,CAAc,EAASF,4CAAiB,CAC7E,aAAcd,EACd,WAAYC,EACZ,cAAeC,EACf,UAAWE,EACX,QAASC,EACT,WAAYC,EACZ,QAASK,EAAG,CACR,IAAIM,EAC8Cd,IAAQQ,CAAC,EAC3DjB,EAAM,iBAAiBE,CAAK,GAC3BqB,EAAetB,EAAI,WAAa,MAAQsB,IAAiB,QAAkBA,EAAa,MAAK,CAClG,CACR,CAAK,EACG,CAAE,eAAgBC,CAAc,EAASC,GAAAA,0CAAyBC,EAAAA,0CAAmB3B,EAAO,CAC5F,QAAS,IAAIC,EAAM,oBAAoBE,CAAK,CACpD,CAAK,E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CACxB,KAAMC,EACN,OAAQC,CACV","x_google_ignoreList":[0,1,2,3,4]}
@@ -1,2 +1,2 @@
1
- "use strict";const e=require("react/jsx-runtime"),a=require("./Heading-BaW6t55l.cjs.js"),w=require("./create-slot-recipe-context-CimocFDH.cjs.js"),$=require("react"),c=require("./useDateFormatter-CS19Cch2.cjs.js"),p=require("./utils-BHdR5Nww.cjs.js"),R=require("./box-BwCVnAwb.cjs.js"),v=require("./context-OoV8SSWX.cjs.js"),h=require("./icon-button-D0NyGafI.cjs.js"),g=require("./text-Dg1sFCuC.cjs.js"),j=require("./stack-BG0j9HvT.cjs.js"),q=require("./visually-hidden-Bh-G5QHv.cjs.js"),u=require("@commercetools/nimbus-icons"),D=require("./flex-yqydM5z_.cjs.js"),P=require("./index-sFOzzmTG.cjs.js"),I=require("./extractStyleProps-BFdEZDYW.cjs.js"),C=require("./Button-BtJHe9xY.cjs.js"),y=require("./Text-BWSfeB9p.cjs.js"),T=require("./use-recipe-pbWWLWIq.cjs.js"),{withProvider:B,withContext:s}=w.createSlotRecipeContext({key:"rangeCalendar"}),H=B("div","root"),A=s("div","header"),F=s("div","grids"),G=s("div","monthTitle"),L=s("table","grid"),k=s("thead","gridHeader"),M=s("th","headerCell"),N=s("tbody","gridBody"),z=s("td","bodyCell"),K=()=>{const{locale:d}=v.$18f2051aff69b9bf$export$43bb16f9c6d9e3f7(),n=p.$64fa3d84918910a7$export$fabf2dc03a41866e(a.$dfd62f934fc76fed$export$233dd9682e1ad64b),t=$.useContext(a.$dfd62f934fc76fed$export$5e0fc348c00f87a0),r=n?.visibleDuration?.months||1,o=c.$14e0f24ef4ac5c92$export$d0bdf45af03a6ea3(c.$14e0f24ef4ac5c92$export$aa8b41735afcabd2()),i=r>1;return e.jsx(F,{children:Array.from({length:r},(m,l)=>{const b=t.visibleRange.start.add({months:l}),f=new Intl.DateTimeFormat(d,{month:"long"}).format(b.toDate(c.$14e0f24ef4ac5c92$export$aa8b41735afcabd2()));return e.jsxs(R.Box,{width:r==1?"full":"auto",children:[i&&e.jsx(G,{children:f}),e.jsx(L,{asChild:!0,children:e.jsxs(a.$dfd62f934fc76fed$export$5bd780d491cfc46c,{offset:{months:l},weekdayStyle:"short",children:[e.jsx(k,{asChild:!0,children:e.jsx(a.$dfd62f934fc76fed$export$22e2d15eaa4d2377,{children:x=>e.jsx(M,{asChild:!0,children:e.jsx(a.$dfd62f934fc76fed$export$ad2135cac3a11b3d,{children:x})})})}),e.jsx(N,{asChild:!0,children:e.jsx(a.$dfd62f934fc76fed$export$e11f8ba65d857bff,{children:x=>{const S=x.compare(o)===0;return e.jsx(z,{asChild:!0,"data-today":S,children:e.jsx(a.$dfd62f934fc76fed$export$5d847498420df57b,{date:x})})}})})]})})]},f)})})},V=()=>{const t=(p.$64fa3d84918910a7$export$fabf2dc03a41866e(a.$dfd62f934fc76fed$export$233dd9682e1ad64b)?.visibleDuration?.months||1)>1;return e.jsx(A,{children:e.jsxs(D.Flex,{children:[e.jsxs(j.Stack,{direction:"row",alignItems:"center",children:[e.jsx(q.VisuallyHidden,{children:e.jsx(a.$5cb03073d3f54797$export$a8a3e93435678ff9,{})}),e.jsx(h.IconButton,{slot:t?"previous":"previous-month",size:"xs",variant:"ghost",tone:"primary",children:e.jsx(u.KeyboardArrowLeft,{})}),e.jsx(g.Text,{textStyle:"sm",fontWeight:"500",color:"neutral.11",width:t?"4000":"2000",textAlign:"center","aria-hidden":"true",slot:t?"monthRange":"month"}),e.jsx(h.IconButton,{slot:t?"next":"next-month",size:"xs",variant:"ghost",tone:"primary",children:e.jsx(u.KeyboardArrowRight,{})})]}),e.jsx(R.Box,{flexGrow:"1"}),e.jsxs(j.Stack,{direction:"row",alignItems:"center",children:[e.jsx(h.IconButton,{slot:"previous-year",size:"xs",variant:"ghost",tone:"primary",children:e.jsx(u.KeyboardArrowLeft,{})}),e.jsx(g.Text,{textStyle:"sm",fontWeight:"500",color:"neutral.11",width:"1400",textAlign:"center","aria-hidden":"true",slot:"year"}),e.jsx(h.IconButton,{slot:"next-year",size:"xs",variant:"ghost",tone:"primary",children:e.jsx(u.KeyboardArrowRight,{})})]})]})})},W=({children:d})=>{const{locale:n}=v.$18f2051aff69b9bf$export$43bb16f9c6d9e3f7(),t=$.useContext(C.$d2b4bc8c273e7be6$export$24d547caef80ccd1),r=$.useContext(y.$514c0188e459b4c0$export$9afb8bc826b033ea),o=$.useContext(a.$dfd62f934fc76fed$export$5e0fc348c00f87a0),i={"next-month":{onPress:()=>o.focusNextSection(),"aria-label":"Next month"},"previous-month":{onPress:()=>o.focusPreviousSection(),"aria-label":"Previous month"},"next-year":{onPress:()=>o.focusNextSection(!0),"aria-label":"Next year"},"previous-year":{onPress:()=>o.focusPreviousSection(!0),"aria-label":"Previous year"}},m=new Intl.DateTimeFormat(n,{month:"long"}).format(o.focusedDate.toDate(c.$14e0f24ef4ac5c92$export$aa8b41735afcabd2())),l=[new Intl.DateTimeFormat(n,{month:"long"}).format(o.visibleRange.start.toDate(c.$14e0f24ef4ac5c92$export$aa8b41735afcabd2())),new Intl.DateTimeFormat(n,{month:"long"}).format(o.visibleRange.end.toDate(c.$14e0f24ef4ac5c92$export$aa8b41735afcabd2()))].join(" - "),b=new Intl.DateTimeFormat(n,{year:"numeric"}).format(o.focusedDate.toDate(c.$14e0f24ef4ac5c92$export$aa8b41735afcabd2())),f={month:{children:m},monthRange:{children:l},year:{children:b}};return e.jsx(p.$64fa3d84918910a7$export$2881499e37b75b9a,{values:[[C.$d2b4bc8c273e7be6$export$24d547caef80ccd1,{...t,slots:{...t&&typeof t=="object"&&"slots"in t?t.slots:{},...i}}],[y.$514c0188e459b4c0$export$9afb8bc826b033ea,{...r,slots:{...r&&typeof r=="object"&&"slots"in r?r.slots:{},...f}}]],children:d})},_=d=>{const n=T.useRecipe({recipe:P.rangeCalendarSlotRecipe}),[t,r]=n.splitVariantProps(d),[o,i]=I.extractStyleProps(r);return e.jsx(H,{...t,...o,asChild:!0,children:e.jsx(a.$dfd62f934fc76fed$export$a4f5c8b89d277a8d,{...i,children:e.jsxs(W,{children:[e.jsx(V,{}),e.jsx(K,{})]})})})};exports.RangeCalendar=_;
2
- //# sourceMappingURL=range-calendar-CnaQY0pH.cjs.js.map
1
+ "use strict";const e=require("react/jsx-runtime"),a=require("./Heading-BaW6t55l.cjs.js"),w=require("./create-slot-recipe-context-CimocFDH.cjs.js"),$=require("react"),c=require("./useDateFormatter-CS19Cch2.cjs.js"),p=require("./utils-BHdR5Nww.cjs.js"),R=require("./box-BwCVnAwb.cjs.js"),v=require("./context-OoV8SSWX.cjs.js"),h=require("./icon-button-DOo2GUqd.cjs.js"),g=require("./text-Dg1sFCuC.cjs.js"),j=require("./stack-BG0j9HvT.cjs.js"),q=require("./visually-hidden-Bh-G5QHv.cjs.js"),u=require("@commercetools/nimbus-icons"),D=require("./flex-yqydM5z_.cjs.js"),P=require("./index-BsmdMT4w.cjs.js"),I=require("./extractStyleProps-BsLft3q1.cjs.js"),C=require("./Button-BtJHe9xY.cjs.js"),y=require("./Text-BWSfeB9p.cjs.js"),T=require("./use-recipe-pbWWLWIq.cjs.js"),{withProvider:B,withContext:s}=w.createSlotRecipeContext({key:"rangeCalendar"}),H=B("div","root"),A=s("div","header"),F=s("div","grids"),G=s("div","monthTitle"),L=s("table","grid"),k=s("thead","gridHeader"),M=s("th","headerCell"),N=s("tbody","gridBody"),z=s("td","bodyCell"),K=()=>{const{locale:d}=v.$18f2051aff69b9bf$export$43bb16f9c6d9e3f7(),n=p.$64fa3d84918910a7$export$fabf2dc03a41866e(a.$dfd62f934fc76fed$export$233dd9682e1ad64b),t=$.useContext(a.$dfd62f934fc76fed$export$5e0fc348c00f87a0),r=n?.visibleDuration?.months||1,o=c.$14e0f24ef4ac5c92$export$d0bdf45af03a6ea3(c.$14e0f24ef4ac5c92$export$aa8b41735afcabd2()),i=r>1;return e.jsx(F,{children:Array.from({length:r},(m,l)=>{const b=t.visibleRange.start.add({months:l}),f=new Intl.DateTimeFormat(d,{month:"long"}).format(b.toDate(c.$14e0f24ef4ac5c92$export$aa8b41735afcabd2()));return e.jsxs(R.Box,{width:r==1?"full":"auto",children:[i&&e.jsx(G,{children:f}),e.jsx(L,{asChild:!0,children:e.jsxs(a.$dfd62f934fc76fed$export$5bd780d491cfc46c,{offset:{months:l},weekdayStyle:"short",children:[e.jsx(k,{asChild:!0,children:e.jsx(a.$dfd62f934fc76fed$export$22e2d15eaa4d2377,{children:x=>e.jsx(M,{asChild:!0,children:e.jsx(a.$dfd62f934fc76fed$export$ad2135cac3a11b3d,{children:x})})})}),e.jsx(N,{asChild:!0,children:e.jsx(a.$dfd62f934fc76fed$export$e11f8ba65d857bff,{children:x=>{const S=x.compare(o)===0;return e.jsx(z,{asChild:!0,"data-today":S,children:e.jsx(a.$dfd62f934fc76fed$export$5d847498420df57b,{date:x})})}})})]})})]},f)})})},V=()=>{const t=(p.$64fa3d84918910a7$export$fabf2dc03a41866e(a.$dfd62f934fc76fed$export$233dd9682e1ad64b)?.visibleDuration?.months||1)>1;return e.jsx(A,{children:e.jsxs(D.Flex,{children:[e.jsxs(j.Stack,{direction:"row",alignItems:"center",children:[e.jsx(q.VisuallyHidden,{children:e.jsx(a.$5cb03073d3f54797$export$a8a3e93435678ff9,{})}),e.jsx(h.IconButton,{slot:t?"previous":"previous-month",size:"xs",variant:"ghost",tone:"primary",children:e.jsx(u.KeyboardArrowLeft,{})}),e.jsx(g.Text,{textStyle:"sm",fontWeight:"500",color:"neutral.11",width:t?"4000":"2000",textAlign:"center","aria-hidden":"true",slot:t?"monthRange":"month"}),e.jsx(h.IconButton,{slot:t?"next":"next-month",size:"xs",variant:"ghost",tone:"primary",children:e.jsx(u.KeyboardArrowRight,{})})]}),e.jsx(R.Box,{flexGrow:"1"}),e.jsxs(j.Stack,{direction:"row",alignItems:"center",children:[e.jsx(h.IconButton,{slot:"previous-year",size:"xs",variant:"ghost",tone:"primary",children:e.jsx(u.KeyboardArrowLeft,{})}),e.jsx(g.Text,{textStyle:"sm",fontWeight:"500",color:"neutral.11",width:"1400",textAlign:"center","aria-hidden":"true",slot:"year"}),e.jsx(h.IconButton,{slot:"next-year",size:"xs",variant:"ghost",tone:"primary",children:e.jsx(u.KeyboardArrowRight,{})})]})]})})},W=({children:d})=>{const{locale:n}=v.$18f2051aff69b9bf$export$43bb16f9c6d9e3f7(),t=$.useContext(C.$d2b4bc8c273e7be6$export$24d547caef80ccd1),r=$.useContext(y.$514c0188e459b4c0$export$9afb8bc826b033ea),o=$.useContext(a.$dfd62f934fc76fed$export$5e0fc348c00f87a0),i={"next-month":{onPress:()=>o.focusNextSection(),"aria-label":"Next month"},"previous-month":{onPress:()=>o.focusPreviousSection(),"aria-label":"Previous month"},"next-year":{onPress:()=>o.focusNextSection(!0),"aria-label":"Next year"},"previous-year":{onPress:()=>o.focusPreviousSection(!0),"aria-label":"Previous year"}},m=new Intl.DateTimeFormat(n,{month:"long"}).format(o.focusedDate.toDate(c.$14e0f24ef4ac5c92$export$aa8b41735afcabd2())),l=[new Intl.DateTimeFormat(n,{month:"long"}).format(o.visibleRange.start.toDate(c.$14e0f24ef4ac5c92$export$aa8b41735afcabd2())),new Intl.DateTimeFormat(n,{month:"long"}).format(o.visibleRange.end.toDate(c.$14e0f24ef4ac5c92$export$aa8b41735afcabd2()))].join(" - "),b=new Intl.DateTimeFormat(n,{year:"numeric"}).format(o.focusedDate.toDate(c.$14e0f24ef4ac5c92$export$aa8b41735afcabd2())),f={month:{children:m},monthRange:{children:l},year:{children:b}};return e.jsx(p.$64fa3d84918910a7$export$2881499e37b75b9a,{values:[[C.$d2b4bc8c273e7be6$export$24d547caef80ccd1,{...t,slots:{...t&&typeof t=="object"&&"slots"in t?t.slots:{},...i}}],[y.$514c0188e459b4c0$export$9afb8bc826b033ea,{...r,slots:{...r&&typeof r=="object"&&"slots"in r?r.slots:{},...f}}]],children:d})},_=d=>{const n=T.useRecipe({recipe:P.rangeCalendarSlotRecipe}),[t,r]=n.splitVariantProps(d),[o,i]=I.extractStyleProps(r);return e.jsx(H,{...t,...o,asChild:!0,children:e.jsx(a.$dfd62f934fc76fed$export$a4f5c8b89d277a8d,{...i,children:e.jsxs(W,{children:[e.jsx(V,{}),e.jsx(K,{})]})})})};exports.RangeCalendar=_;
2
+ //# sourceMappingURL=range-calendar-BiNek1C7.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"range-calendar-CnaQY0pH.cjs.js","sources":["../../src/components/range-calendar/range-calendar.slots.tsx","../../src/components/range-calendar/components/range-calendar.grids.tsx","../../src/components/range-calendar/components/range-calendar.header.tsx","../../src/components/range-calendar/components/range-calendar.custom-context.tsx","../../src/components/range-calendar/range-calendar.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-empty-object-type */\nimport {\n createSlotRecipeContext,\n type HTMLChakraProps,\n type RecipeVariantProps,\n} from \"@chakra-ui/react/styled-system\";\nimport { rangeCalendarSlotRecipe } from \"./range-calendar.recipe\";\nimport type { RangeCalendarProps } from \"react-aria-components\";\nimport type { DateValue } from \"@internationalized/date\";\n\nconst { withProvider, withContext } = createSlotRecipeContext({\n key: \"rangeCalendar\",\n});\n\nexport interface RangeCalendarRootSlotProps\n extends HTMLChakraProps<\n \"div\",\n RecipeVariantProps<typeof rangeCalendarSlotRecipe> &\n RangeCalendarProps<DateValue>\n > {}\nexport const RangeCalendarRootSlot = withProvider<\n HTMLDivElement,\n RangeCalendarRootSlotProps\n>(\"div\", \"root\");\n\nexport interface RangeCalendarHeaderSlotProps extends HTMLChakraProps<\"div\"> {}\nexport const RangeCalendarHeaderSlot = withContext<\n HTMLDivElement,\n RangeCalendarHeaderSlotProps\n>(\"div\", \"header\");\n\nexport interface RangeCalendarGridsSlotProps extends HTMLChakraProps<\"div\"> {}\nexport const RangeCalendarGridsSlot = withContext<\n HTMLDivElement,\n RangeCalendarGridsSlotProps\n>(\"div\", \"grids\");\n\nexport interface RangeCalendarMonthTitleSlotProps\n extends HTMLChakraProps<\"div\"> {}\nexport const RangeCalendarMonthTitleSlot = withContext<\n HTMLDivElement,\n RangeCalendarMonthTitleSlotProps\n>(\"div\", \"monthTitle\");\n\nexport interface RangeCalendarGridSlotProps extends HTMLChakraProps<\"table\"> {}\nexport const RangeCalendarGridSlot = withContext<\n HTMLTableElement,\n RangeCalendarGridSlotProps\n>(\"table\", \"grid\");\n\nexport interface RangeCalendarGridHeaderSlotProps\n extends HTMLChakraProps<\"thead\"> {}\nexport const RangeCalendarGridHeaderSlot = withContext<\n HTMLTableSectionElement,\n RangeCalendarGridHeaderSlotProps\n>(\"thead\", \"gridHeader\");\n\nexport interface RangeCalendarHeaderCellSlotProps\n extends HTMLChakraProps<\"th\"> {}\nexport const RangeCalendarHeaderCellSlot = withContext<\n HTMLTableCellElement,\n RangeCalendarHeaderCellSlotProps\n>(\"th\", \"headerCell\");\n\nexport interface RangeCalendarGridBodySlotProps\n extends HTMLChakraProps<\"tbody\"> {}\nexport const RangeCalendarGridBodySlot = withContext<\n HTMLTableSectionElement,\n RangeCalendarGridBodySlotProps\n>(\"tbody\", \"gridBody\");\n\nexport interface RangeCalendarCellSlotProps extends HTMLChakraProps<\"td\"> {}\nexport const RangeCalendarCellSlot = withContext<\n HTMLTableCellElement,\n RangeCalendarCellSlotProps\n>(\"td\", \"bodyCell\");\n","import { useContext } from \"react\";\nimport { today, getLocalTimeZone } from \"@internationalized/date\";\nimport {\n CalendarGrid as RaCalendarGrid,\n CalendarGridBody as RaCalendarGridBody,\n CalendarGridHeader as RaCalendarGridHeader,\n CalendarHeaderCell as RaCalendarHeaderCell,\n CalendarCell as RaCalendarCell,\n useSlottedContext,\n RangeCalendarContext,\n RangeCalendarStateContext,\n useLocale,\n} from \"react-aria-components\";\nimport { Box } from \"@/components\";\n\nimport {\n RangeCalendarCellSlot,\n RangeCalendarGridBodySlot,\n RangeCalendarGridHeaderSlot,\n RangeCalendarGridsSlot,\n RangeCalendarGridSlot,\n RangeCalendarHeaderCellSlot,\n RangeCalendarMonthTitleSlot,\n} from \"../range-calendar.slots\";\n\nexport const RangeCalendarGrids = () => {\n const { locale } = useLocale();\n const context = useSlottedContext(RangeCalendarContext);\n\n const calendarState = useContext(RangeCalendarStateContext)!;\n const visibleMonthsCount = context?.visibleDuration?.months || 1;\n const todayDate = today(getLocalTimeZone());\n const showMonthTitles = visibleMonthsCount > 1;\n\n return (\n <RangeCalendarGridsSlot>\n {Array.from({ length: visibleMonthsCount }, (_, index) => {\n const gridDate = calendarState.visibleRange.start.add({\n months: index,\n });\n const monthName = new Intl.DateTimeFormat(locale, {\n month: \"long\",\n }).format(gridDate.toDate(getLocalTimeZone()));\n\n return (\n <Box\n key={monthName}\n width={visibleMonthsCount == 1 ? \"full\" : \"auto\"}\n >\n {showMonthTitles && (\n <RangeCalendarMonthTitleSlot>\n {monthName}\n </RangeCalendarMonthTitleSlot>\n )}\n <RangeCalendarGridSlot asChild>\n <RaCalendarGrid offset={{ months: index }} weekdayStyle=\"short\">\n <RangeCalendarGridHeaderSlot asChild>\n <RaCalendarGridHeader>\n {(day) => (\n <RangeCalendarHeaderCellSlot asChild>\n <RaCalendarHeaderCell>{day}</RaCalendarHeaderCell>\n </RangeCalendarHeaderCellSlot>\n )}\n </RaCalendarGridHeader>\n </RangeCalendarGridHeaderSlot>\n <RangeCalendarGridBodySlot asChild>\n <RaCalendarGridBody>\n {(date) => {\n const isToday = date.compare(todayDate) === 0;\n return (\n <RangeCalendarCellSlot asChild data-today={isToday}>\n <RaCalendarCell date={date} />\n </RangeCalendarCellSlot>\n );\n }}\n </RaCalendarGridBody>\n </RangeCalendarGridBodySlot>\n </RaCalendarGrid>\n </RangeCalendarGridSlot>\n </Box>\n );\n })}\n </RangeCalendarGridsSlot>\n );\n};\n","import {\n RangeCalendarContext,\n Heading,\n useSlottedContext,\n} from \"react-aria-components\";\nimport {\n Box,\n Flex,\n IconButton,\n Stack,\n Text,\n VisuallyHidden,\n} from \"@/components\";\nimport {\n KeyboardArrowLeft,\n KeyboardArrowRight,\n} from \"@commercetools/nimbus-icons\";\nimport { RangeCalendarHeaderSlot } from \"../range-calendar.slots\";\n\nexport const RangeCalendarHeader = () => {\n const rangeCalendarProps = useSlottedContext(RangeCalendarContext);\n\n // Needed to decide whether to show a single month or a range\n const visibleDurationMonths =\n rangeCalendarProps?.visibleDuration?.months || 1;\n const showRangeLabel = visibleDurationMonths > 1;\n\n return (\n <RangeCalendarHeaderSlot>\n <Flex>\n <Stack direction=\"row\" alignItems=\"center\">\n {/** solely for screen readers, if not present, a11y issues are raised */}\n <VisuallyHidden>\n <Heading />\n </VisuallyHidden>\n {/* @ts-expect-error - custom-context will add aria-label via the \"slot\" prop */}\n <IconButton\n slot={showRangeLabel ? \"previous\" : \"previous-month\"}\n size=\"xs\"\n variant=\"ghost\"\n tone=\"primary\"\n >\n <KeyboardArrowLeft />\n </IconButton>\n <Text\n textStyle=\"sm\"\n fontWeight=\"500\"\n color=\"neutral.11\"\n width={showRangeLabel ? \"4000\" : \"2000\"}\n textAlign=\"center\"\n aria-hidden=\"true\"\n slot={showRangeLabel ? \"monthRange\" : \"month\"}\n />\n {/* @ts-expect-error - custom-context will add aria-label via the \"slot\" prop */}\n <IconButton\n slot={showRangeLabel ? \"next\" : \"next-month\"}\n size=\"xs\"\n variant=\"ghost\"\n tone=\"primary\"\n >\n <KeyboardArrowRight />\n </IconButton>\n </Stack>\n <Box flexGrow=\"1\" />\n <Stack direction=\"row\" alignItems=\"center\">\n {/* @ts-expect-error - custom-context will add aria-label via the \"slot\" prop */}\n <IconButton\n slot=\"previous-year\"\n size=\"xs\"\n variant=\"ghost\"\n tone=\"primary\"\n >\n <KeyboardArrowLeft />\n </IconButton>\n <Text\n textStyle=\"sm\"\n fontWeight=\"500\"\n color=\"neutral.11\"\n width=\"1400\"\n textAlign=\"center\"\n aria-hidden=\"true\"\n slot=\"year\"\n />\n {/* @ts-expect-error - custom-context will add aria-label via the \"slot\" prop */}\n <IconButton slot=\"next-year\" size=\"xs\" variant=\"ghost\" tone=\"primary\">\n <KeyboardArrowRight />\n </IconButton>\n </Stack>\n </Flex>\n </RangeCalendarHeaderSlot>\n );\n};\n","import { getLocalTimeZone } from \"@internationalized/date\";\nimport { useContext } from \"react\";\nimport {\n Provider,\n ButtonContext,\n RangeCalendarStateContext,\n TextContext,\n useLocale,\n} from \"react-aria-components\";\n\nexport const RangeCalendarCustomContext = ({\n children,\n}: {\n children: React.ReactNode;\n}) => {\n const { locale } = useLocale();\n const buttonContext = useContext(ButtonContext)!;\n const textContext = useContext(TextContext)!;\n const calendarState = useContext(RangeCalendarStateContext)!;\n\n /**\n * Button slots\n * ================================\n */\n const buttonSlots = {\n \"next-month\": {\n onPress: () => calendarState.focusNextSection(),\n \"aria-label\": \"Next month\",\n },\n \"previous-month\": {\n onPress: () => calendarState.focusPreviousSection(),\n \"aria-label\": \"Previous month\",\n },\n \"next-year\": {\n onPress: () => calendarState.focusNextSection(true),\n \"aria-label\": \"Next year\",\n },\n \"previous-year\": {\n onPress: () => calendarState.focusPreviousSection(true),\n \"aria-label\": \"Previous year\",\n },\n };\n\n /**\n * Text slots\n * ================================\n */\n const monthLabel = new Intl.DateTimeFormat(locale, {\n month: \"long\",\n }).format(calendarState.focusedDate.toDate(getLocalTimeZone()));\n\n const monthRangeLabel = [\n new Intl.DateTimeFormat(locale, {\n month: \"long\",\n }).format(calendarState.visibleRange.start.toDate(getLocalTimeZone())),\n new Intl.DateTimeFormat(locale, {\n month: \"long\",\n }).format(calendarState.visibleRange.end.toDate(getLocalTimeZone())),\n ].join(\" - \");\n\n const yearLabel = new Intl.DateTimeFormat(locale, {\n year: \"numeric\",\n }).format(calendarState.focusedDate.toDate(getLocalTimeZone()));\n\n const textSlots = {\n month: { children: monthLabel },\n monthRange: { children: monthRangeLabel },\n year: { children: yearLabel },\n };\n\n return (\n <Provider\n values={[\n [\n ButtonContext,\n {\n ...buttonContext,\n slots: {\n ...(buttonContext &&\n typeof buttonContext === \"object\" &&\n \"slots\" in buttonContext\n ? buttonContext.slots\n : {}),\n ...buttonSlots,\n },\n },\n ],\n [\n TextContext,\n {\n ...textContext,\n slots: {\n ...(textContext &&\n typeof textContext === \"object\" &&\n \"slots\" in textContext\n ? textContext.slots\n : {}),\n ...textSlots,\n },\n },\n ],\n ]}\n >\n {children}\n </Provider>\n );\n};\n","import type { RangeCalendarProps } from \"./range-calendar.types\";\nimport type { DateValue } from \"@internationalized/date\";\n\nimport { RangeCalendar as RaRangeCalendar } from \"react-aria-components\";\n\nimport { RangeCalendarRootSlot } from \"./range-calendar.slots\";\nimport { RangeCalendarGrids } from \"./components/range-calendar.grids\";\nimport { RangeCalendarHeader } from \"./components/range-calendar.header\";\nimport { rangeCalendarSlotRecipe } from \"./range-calendar.recipe\";\nimport { useRecipe } from \"@chakra-ui/react/styled-system\";\nimport { extractStyleProps } from \"@/utils/extractStyleProps\";\nimport { RangeCalendarCustomContext } from \"./components/range-calendar.custom-context\";\n\nexport const RangeCalendar = (props: RangeCalendarProps<DateValue>) => {\n const recipe = useRecipe({ recipe: rangeCalendarSlotRecipe });\n const [recipeProps, remainingProps] = recipe.splitVariantProps(props);\n const [styleProps, otherProps] = extractStyleProps(remainingProps);\n\n return (\n <RangeCalendarRootSlot {...recipeProps} {...styleProps} asChild>\n <RaRangeCalendar {...otherProps}>\n <RangeCalendarCustomContext>\n <RangeCalendarHeader />\n <RangeCalendarGrids />\n </RangeCalendarCustomContext>\n </RaRangeCalendar>\n </RangeCalendarRootSlot>\n );\n};\n"],"names":["withProvider","withContext","createSlotRecipeContext","RangeCalendarRootSlot","RangeCalendarHeaderSlot","RangeCalendarGridsSlot","RangeCalendarMonthTitleSlot","RangeCalendarGridSlot","RangeCalendarGridHeaderSlot","RangeCalendarHeaderCellSlot","RangeCalendarGridBodySlot","RangeCalendarCellSlot","RangeCalendarGrids","locale","useLocale","context","useSlottedContext","RangeCalendarContext","calendarState","useContext","RangeCalendarStateContext","visibleMonthsCount","todayDate","today","getLocalTimeZone","showMonthTitles","jsx","_","index","gridDate","monthName","jsxs","Box","RaCalendarGrid","RaCalendarGridHeader","day","RaCalendarHeaderCell","RaCalendarGridBody","date","isToday","RaCalendarCell","RangeCalendarHeader","showRangeLabel","Flex","Stack","VisuallyHidden","Heading","IconButton","KeyboardArrowLeft","Text","KeyboardArrowRight","RangeCalendarCustomContext","children","buttonContext","ButtonContext","textContext","TextContext","buttonSlots","monthLabel","monthRangeLabel","yearLabel","textSlots","Provider","RangeCalendar","props","recipe","useRecipe","rangeCalendarSlotRecipe","recipeProps","remainingProps","styleProps","otherProps","extractStyleProps","RaRangeCalendar"],"mappings":"+vBAUM,CAAE,aAAAA,EAAc,YAAAC,CAAA,EAAgBC,0BAAwB,CAC5D,IAAK,eACP,CAAC,EAQYC,EAAwBH,EAGnC,MAAO,MAAM,EAGFI,EAA0BH,EAGrC,MAAO,QAAQ,EAGJI,EAAyBJ,EAGpC,MAAO,OAAO,EAIHK,EAA8BL,EAGzC,MAAO,YAAY,EAGRM,EAAwBN,EAGnC,QAAS,MAAM,EAIJO,EAA8BP,EAGzC,QAAS,YAAY,EAIVQ,EAA8BR,EAGzC,KAAM,YAAY,EAIPS,EAA4BT,EAGvC,QAAS,UAAU,EAGRU,EAAwBV,EAGnC,KAAM,UAAU,EClDLW,EAAqB,IAAM,CACtC,KAAM,CAAE,OAAAC,CAAA,EAAWC,4CAAA,EACbC,EAAUC,EAAAA,0CAAkBC,2CAAoB,EAEhDC,EAAgBC,EAAAA,WAAWC,2CAAyB,EACpDC,EAAqBN,GAAS,iBAAiB,QAAU,EACzDO,EAAYC,4CAAMC,EAAAA,2CAAkB,EACpCC,EAAkBJ,EAAqB,EAE7C,OACEK,MAACrB,EAAA,CACE,SAAA,MAAM,KAAK,CAAE,OAAQgB,CAAA,EAAsB,CAACM,EAAGC,IAAU,CACxD,MAAMC,EAAWX,EAAc,aAAa,MAAM,IAAI,CACpD,OAAQU,CAAA,CACT,EACKE,EAAY,IAAI,KAAK,eAAejB,EAAQ,CAChD,MAAO,MAAA,CACR,EAAE,OAAOgB,EAAS,OAAOL,EAAAA,0CAAA,CAA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AgB,UACvB,UAAWA,EACPA,EAAY,MACZ,CAAA,EACJ,GAAGM,CAAA,CACL,CACF,CACF,EAGD,SAAAT,CAAA,CAAA,CAGP,EC7FaW,EAAiBC,GAAyC,CACrE,MAAMC,EAASC,EAAAA,UAAU,CAAE,OAAQC,EAAAA,wBAAyB,EACtD,CAACC,EAAaC,CAAc,EAAIJ,EAAO,kBAAkBD,CAAK,EAC9D,CAACM,EAAYC,CAAU,EAAIC,EAAAA,kBAAkBH,CAAc,EAEjE,OACE3C,EAAAA,IAACvB,EAAA,CAAuB,GAAGiE,EAAc,GAAGE,EAAY,QAAO,GAC7D,SAAA5C,EAAAA,IAAC+C,EAAAA,0CAAA,CAAiB,GAAGF,EACnB,gBAACpB,EAAA,CACC,SAAA,CAAAzB,EAAAA,IAACe,EAAA,EAAoB,QACpB7B,EAAA,CAAA,CAAmB,CAAA,CAAA,CACtB,EACF,EACF,CAEJ"}
1
+ {"version":3,"file":"range-calendar-BiNek1C7.cjs.js","sources":["../../src/components/range-calendar/range-calendar.slots.tsx","../../src/components/range-calendar/components/range-calendar.grids.tsx","../../src/components/range-calendar/components/range-calendar.header.tsx","../../src/components/range-calendar/components/range-calendar.custom-context.tsx","../../src/components/range-calendar/range-calendar.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-empty-object-type */\nimport {\n createSlotRecipeContext,\n type HTMLChakraProps,\n type RecipeVariantProps,\n} from \"@chakra-ui/react/styled-system\";\nimport { rangeCalendarSlotRecipe } from \"./range-calendar.recipe\";\nimport type { RangeCalendarProps } from \"react-aria-components\";\nimport type { DateValue } from \"@internationalized/date\";\n\nconst { withProvider, withContext } = createSlotRecipeContext({\n key: \"rangeCalendar\",\n});\n\nexport interface RangeCalendarRootSlotProps\n extends HTMLChakraProps<\n \"div\",\n RecipeVariantProps<typeof rangeCalendarSlotRecipe> &\n RangeCalendarProps<DateValue>\n > {}\nexport const RangeCalendarRootSlot = withProvider<\n HTMLDivElement,\n RangeCalendarRootSlotProps\n>(\"div\", \"root\");\n\nexport interface RangeCalendarHeaderSlotProps extends HTMLChakraProps<\"div\"> {}\nexport const RangeCalendarHeaderSlot = withContext<\n HTMLDivElement,\n RangeCalendarHeaderSlotProps\n>(\"div\", \"header\");\n\nexport interface RangeCalendarGridsSlotProps extends HTMLChakraProps<\"div\"> {}\nexport const RangeCalendarGridsSlot = withContext<\n HTMLDivElement,\n RangeCalendarGridsSlotProps\n>(\"div\", \"grids\");\n\nexport interface RangeCalendarMonthTitleSlotProps\n extends HTMLChakraProps<\"div\"> {}\nexport const RangeCalendarMonthTitleSlot = withContext<\n HTMLDivElement,\n RangeCalendarMonthTitleSlotProps\n>(\"div\", \"monthTitle\");\n\nexport interface RangeCalendarGridSlotProps extends HTMLChakraProps<\"table\"> {}\nexport const RangeCalendarGridSlot = withContext<\n HTMLTableElement,\n RangeCalendarGridSlotProps\n>(\"table\", \"grid\");\n\nexport interface RangeCalendarGridHeaderSlotProps\n extends HTMLChakraProps<\"thead\"> {}\nexport const RangeCalendarGridHeaderSlot = withContext<\n HTMLTableSectionElement,\n RangeCalendarGridHeaderSlotProps\n>(\"thead\", \"gridHeader\");\n\nexport interface RangeCalendarHeaderCellSlotProps\n extends HTMLChakraProps<\"th\"> {}\nexport const RangeCalendarHeaderCellSlot = withContext<\n HTMLTableCellElement,\n RangeCalendarHeaderCellSlotProps\n>(\"th\", \"headerCell\");\n\nexport interface RangeCalendarGridBodySlotProps\n extends HTMLChakraProps<\"tbody\"> {}\nexport const RangeCalendarGridBodySlot = withContext<\n HTMLTableSectionElement,\n RangeCalendarGridBodySlotProps\n>(\"tbody\", \"gridBody\");\n\nexport interface RangeCalendarCellSlotProps extends HTMLChakraProps<\"td\"> {}\nexport const RangeCalendarCellSlot = withContext<\n HTMLTableCellElement,\n RangeCalendarCellSlotProps\n>(\"td\", \"bodyCell\");\n","import { useContext } from \"react\";\nimport { today, getLocalTimeZone } from \"@internationalized/date\";\nimport {\n CalendarGrid as RaCalendarGrid,\n CalendarGridBody as RaCalendarGridBody,\n CalendarGridHeader as RaCalendarGridHeader,\n CalendarHeaderCell as RaCalendarHeaderCell,\n CalendarCell as RaCalendarCell,\n useSlottedContext,\n RangeCalendarContext,\n RangeCalendarStateContext,\n useLocale,\n} from \"react-aria-components\";\nimport { Box } from \"@/components\";\n\nimport {\n RangeCalendarCellSlot,\n RangeCalendarGridBodySlot,\n RangeCalendarGridHeaderSlot,\n RangeCalendarGridsSlot,\n RangeCalendarGridSlot,\n RangeCalendarHeaderCellSlot,\n RangeCalendarMonthTitleSlot,\n} from \"../range-calendar.slots\";\n\nexport const RangeCalendarGrids = () => {\n const { locale } = useLocale();\n const context = useSlottedContext(RangeCalendarContext);\n\n const calendarState = useContext(RangeCalendarStateContext)!;\n const visibleMonthsCount = context?.visibleDuration?.months || 1;\n const todayDate = today(getLocalTimeZone());\n const showMonthTitles = visibleMonthsCount > 1;\n\n return (\n <RangeCalendarGridsSlot>\n {Array.from({ length: visibleMonthsCount }, (_, index) => {\n const gridDate = calendarState.visibleRange.start.add({\n months: index,\n });\n const monthName = new Intl.DateTimeFormat(locale, {\n month: \"long\",\n }).format(gridDate.toDate(getLocalTimeZone()));\n\n return (\n <Box\n key={monthName}\n width={visibleMonthsCount == 1 ? \"full\" : \"auto\"}\n >\n {showMonthTitles && (\n <RangeCalendarMonthTitleSlot>\n {monthName}\n </RangeCalendarMonthTitleSlot>\n )}\n <RangeCalendarGridSlot asChild>\n <RaCalendarGrid offset={{ months: index }} weekdayStyle=\"short\">\n <RangeCalendarGridHeaderSlot asChild>\n <RaCalendarGridHeader>\n {(day) => (\n <RangeCalendarHeaderCellSlot asChild>\n <RaCalendarHeaderCell>{day}</RaCalendarHeaderCell>\n </RangeCalendarHeaderCellSlot>\n )}\n </RaCalendarGridHeader>\n </RangeCalendarGridHeaderSlot>\n <RangeCalendarGridBodySlot asChild>\n <RaCalendarGridBody>\n {(date) => {\n const isToday = date.compare(todayDate) === 0;\n return (\n <RangeCalendarCellSlot asChild data-today={isToday}>\n <RaCalendarCell date={date} />\n </RangeCalendarCellSlot>\n );\n }}\n </RaCalendarGridBody>\n </RangeCalendarGridBodySlot>\n </RaCalendarGrid>\n </RangeCalendarGridSlot>\n </Box>\n );\n })}\n </RangeCalendarGridsSlot>\n );\n};\n","import {\n RangeCalendarContext,\n Heading,\n useSlottedContext,\n} from \"react-aria-components\";\nimport {\n Box,\n Flex,\n IconButton,\n Stack,\n Text,\n VisuallyHidden,\n} from \"@/components\";\nimport {\n KeyboardArrowLeft,\n KeyboardArrowRight,\n} from \"@commercetools/nimbus-icons\";\nimport { RangeCalendarHeaderSlot } from \"../range-calendar.slots\";\n\nexport const RangeCalendarHeader = () => {\n const rangeCalendarProps = useSlottedContext(RangeCalendarContext);\n\n // Needed to decide whether to show a single month or a range\n const visibleDurationMonths =\n rangeCalendarProps?.visibleDuration?.months || 1;\n const showRangeLabel = visibleDurationMonths > 1;\n\n return (\n <RangeCalendarHeaderSlot>\n <Flex>\n <Stack direction=\"row\" alignItems=\"center\">\n {/** solely for screen readers, if not present, a11y issues are raised */}\n <VisuallyHidden>\n <Heading />\n </VisuallyHidden>\n {/* @ts-expect-error - custom-context will add aria-label via the \"slot\" prop */}\n <IconButton\n slot={showRangeLabel ? \"previous\" : \"previous-month\"}\n size=\"xs\"\n variant=\"ghost\"\n tone=\"primary\"\n >\n <KeyboardArrowLeft />\n </IconButton>\n <Text\n textStyle=\"sm\"\n fontWeight=\"500\"\n color=\"neutral.11\"\n width={showRangeLabel ? \"4000\" : \"2000\"}\n textAlign=\"center\"\n aria-hidden=\"true\"\n slot={showRangeLabel ? \"monthRange\" : \"month\"}\n />\n {/* @ts-expect-error - custom-context will add aria-label via the \"slot\" prop */}\n <IconButton\n slot={showRangeLabel ? \"next\" : \"next-month\"}\n size=\"xs\"\n variant=\"ghost\"\n tone=\"primary\"\n >\n <KeyboardArrowRight />\n </IconButton>\n </Stack>\n <Box flexGrow=\"1\" />\n <Stack direction=\"row\" alignItems=\"center\">\n {/* @ts-expect-error - custom-context will add aria-label via the \"slot\" prop */}\n <IconButton\n slot=\"previous-year\"\n size=\"xs\"\n variant=\"ghost\"\n tone=\"primary\"\n >\n <KeyboardArrowLeft />\n </IconButton>\n <Text\n textStyle=\"sm\"\n fontWeight=\"500\"\n color=\"neutral.11\"\n width=\"1400\"\n textAlign=\"center\"\n aria-hidden=\"true\"\n slot=\"year\"\n />\n {/* @ts-expect-error - custom-context will add aria-label via the \"slot\" prop */}\n <IconButton slot=\"next-year\" size=\"xs\" variant=\"ghost\" tone=\"primary\">\n <KeyboardArrowRight />\n </IconButton>\n </Stack>\n </Flex>\n </RangeCalendarHeaderSlot>\n );\n};\n","import { getLocalTimeZone } from \"@internationalized/date\";\nimport { useContext } from \"react\";\nimport {\n Provider,\n ButtonContext,\n RangeCalendarStateContext,\n TextContext,\n useLocale,\n} from \"react-aria-components\";\n\nexport const RangeCalendarCustomContext = ({\n children,\n}: {\n children: React.ReactNode;\n}) => {\n const { locale } = useLocale();\n const buttonContext = useContext(ButtonContext)!;\n const textContext = useContext(TextContext)!;\n const calendarState = useContext(RangeCalendarStateContext)!;\n\n /**\n * Button slots\n * ================================\n */\n const buttonSlots = {\n \"next-month\": {\n onPress: () => calendarState.focusNextSection(),\n \"aria-label\": \"Next month\",\n },\n \"previous-month\": {\n onPress: () => calendarState.focusPreviousSection(),\n \"aria-label\": \"Previous month\",\n },\n \"next-year\": {\n onPress: () => calendarState.focusNextSection(true),\n \"aria-label\": \"Next year\",\n },\n \"previous-year\": {\n onPress: () => calendarState.focusPreviousSection(true),\n \"aria-label\": \"Previous year\",\n },\n };\n\n /**\n * Text slots\n * ================================\n */\n const monthLabel = new Intl.DateTimeFormat(locale, {\n month: \"long\",\n }).format(calendarState.focusedDate.toDate(getLocalTimeZone()));\n\n const monthRangeLabel = [\n new Intl.DateTimeFormat(locale, {\n month: \"long\",\n }).format(calendarState.visibleRange.start.toDate(getLocalTimeZone())),\n new Intl.DateTimeFormat(locale, {\n month: \"long\",\n }).format(calendarState.visibleRange.end.toDate(getLocalTimeZone())),\n ].join(\" - \");\n\n const yearLabel = new Intl.DateTimeFormat(locale, {\n year: \"numeric\",\n }).format(calendarState.focusedDate.toDate(getLocalTimeZone()));\n\n const textSlots = {\n month: { children: monthLabel },\n monthRange: { children: monthRangeLabel },\n year: { children: yearLabel },\n };\n\n return (\n <Provider\n values={[\n [\n ButtonContext,\n {\n ...buttonContext,\n slots: {\n ...(buttonContext &&\n typeof buttonContext === \"object\" &&\n \"slots\" in buttonContext\n ? buttonContext.slots\n : {}),\n ...buttonSlots,\n },\n },\n ],\n [\n TextContext,\n {\n ...textContext,\n slots: {\n ...(textContext &&\n typeof textContext === \"object\" &&\n \"slots\" in textContext\n ? textContext.slots\n : {}),\n ...textSlots,\n },\n },\n ],\n ]}\n >\n {children}\n </Provider>\n );\n};\n","import type { RangeCalendarProps } from \"./range-calendar.types\";\nimport type { DateValue } from \"@internationalized/date\";\n\nimport { RangeCalendar as RaRangeCalendar } from \"react-aria-components\";\n\nimport { RangeCalendarRootSlot } from \"./range-calendar.slots\";\nimport { RangeCalendarGrids } from \"./components/range-calendar.grids\";\nimport { RangeCalendarHeader } from \"./components/range-calendar.header\";\nimport { rangeCalendarSlotRecipe } from \"./range-calendar.recipe\";\nimport { useRecipe } from \"@chakra-ui/react/styled-system\";\nimport { extractStyleProps } from \"@/utils/extractStyleProps\";\nimport { RangeCalendarCustomContext } from \"./components/range-calendar.custom-context\";\n\nexport const RangeCalendar = (props: RangeCalendarProps<DateValue>) => {\n const recipe = useRecipe({ recipe: rangeCalendarSlotRecipe });\n const [recipeProps, remainingProps] = recipe.splitVariantProps(props);\n const [styleProps, otherProps] = extractStyleProps(remainingProps);\n\n return (\n <RangeCalendarRootSlot {...recipeProps} {...styleProps} asChild>\n <RaRangeCalendar {...otherProps}>\n <RangeCalendarCustomContext>\n <RangeCalendarHeader />\n <RangeCalendarGrids />\n </RangeCalendarCustomContext>\n </RaRangeCalendar>\n </RangeCalendarRootSlot>\n );\n};\n"],"names":["withProvider","withContext","createSlotRecipeContext","RangeCalendarRootSlot","RangeCalendarHeaderSlot","RangeCalendarGridsSlot","RangeCalendarMonthTitleSlot","RangeCalendarGridSlot","RangeCalendarGridHeaderSlot","RangeCalendarHeaderCellSlot","RangeCalendarGridBodySlot","RangeCalendarCellSlot","RangeCalendarGrids","locale","useLocale","context","useSlottedContext","RangeCalendarContext","calendarState","useContext","RangeCalendarStateContext","visibleMonthsCount","todayDate","today","getLocalTimeZone","showMonthTitles","jsx","_","index","gridDate","monthName","jsxs","Box","RaCalendarGrid","RaCalendarGridHeader","day","RaCalendarHeaderCell","RaCalendarGridBody","date","isToday","RaCalendarCell","RangeCalendarHeader","showRangeLabel","Flex","Stack","VisuallyHidden","Heading","IconButton","KeyboardArrowLeft","Text","KeyboardArrowRight","RangeCalendarCustomContext","children","buttonContext","ButtonContext","textContext","TextContext","buttonSlots","monthLabel","monthRangeLabel","yearLabel","textSlots","Provider","RangeCalendar","props","recipe","useRecipe","rangeCalendarSlotRecipe","recipeProps","remainingProps","styleProps","otherProps","extractStyleProps","RaRangeCalendar"],"mappings":"+vBAUM,CAAE,aAAAA,EAAc,YAAAC,CAAA,EAAgBC,0BAAwB,CAC5D,IAAK,eACP,CAAC,EAQYC,EAAwBH,EAGnC,MAAO,MAAM,EAGFI,EAA0BH,EAGrC,MAAO,QAAQ,EAGJI,EAAyBJ,EAGpC,MAAO,OAAO,EAIHK,EAA8BL,EAGzC,MAAO,YAAY,EAGRM,EAAwBN,EAGnC,QAAS,MAAM,EAIJO,EAA8BP,EAGzC,QAAS,YAAY,EAIVQ,EAA8BR,EAGzC,KAAM,YAAY,EAIPS,EAA4BT,EAGvC,QAAS,UAAU,EAGRU,EAAwBV,EAGnC,KAAM,UAAU,EClDLW,EAAqB,IAAM,CACtC,KAAM,CAAE,OAAAC,CAAA,EAAWC,4CAAA,EACbC,EAAUC,EAAAA,0CAAkBC,2CAAoB,EAEhDC,EAAgBC,EAAAA,WAAWC,2CA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AY,CAChB,MAAO,CAAE,SAAUH,CAAA,EACnB,WAAY,CAAE,SAAUC,CAAA,EACxB,KAAM,CAAE,SAAUC,CAAA,CAAU,EAG9B,OACElC,EAAAA,IAACoC,EAAAA,0CAAA,CACC,OAAQ,CACN,CACER,EAAAA,0CACA,CACE,GAAGD,EACH,MAAO,CACL,GAAIA,GACJ,OAAOA,GAAkB,UACzB,UAAWA,EACPA,EAAc,MACd,CAAA,EACJ,GAAGI,CAAA,CACL,CACF,EAEF,CACED,EAAAA,0CACA,CACE,GAAGD,EACH,MAAO,CACL,GAAIA,GACJ,OAAOA,GAAgB,UACvB,UAAWA,EACPA,EAAY,MACZ,CAAA,EACJ,GAAGM,CAAA,CACL,CACF,CACF,EAGD,SAAAT,CAAA,CAAA,CAGP,EC7FaW,EAAiBC,GAAyC,CACrE,MAAMC,EAASC,EAAAA,UAAU,CAAE,OAAQC,EAAAA,wBAAyB,EACtD,CAACC,EAAaC,CAAc,EAAIJ,EAAO,kBAAkBD,CAAK,EAC9D,CAACM,EAAYC,CAAU,EAAIC,EAAAA,kBAAkBH,CAAc,EAEjE,OACE3C,EAAAA,IAACvB,EAAA,CAAuB,GAAGiE,EAAc,GAAGE,EAAY,QAAO,GAC7D,SAAA5C,EAAAA,IAAC+C,EAAAA,0CAAA,CAAiB,GAAGF,EACnB,gBAACpB,EAAA,CACC,SAAA,CAAAzB,EAAAA,IAACe,EAAA,EAAoB,QACpB7B,EAAA,CAAA,CAAmB,CAAA,CAAA,CACtB,EACF,EACF,CAEJ"}
@@ -1,2 +1,2 @@
1
- "use strict";const e=require("react/jsx-runtime"),p=require("react"),k=require("@chakra-ui/react"),oe=require("./extractStyleProps-BFdEZDYW.cjs.js"),n=require("./slate-helpers-BN_9Hky2.cjs.js"),D=require("./use-formatting-state-DVcnyVBl.cjs.js"),I=require("../components/constants.cjs"),b=require("./box-BwCVnAwb.cjs.js"),N=require("./divider-DU351gdE.cjs.js"),U=require("./group-Buy-O6Mr.cjs.js"),O=require("./icon-button-D0NyGafI.cjs.js"),w=require("./icon-toggle-button-yeQuEUBY.cjs.js"),v=require("./text-Dg1sFCuC.cjs.js"),d=require("./tooltip-CIAEV4_B.cjs.js"),M=require("./visually-hidden-Bh-G5QHv.cjs.js"),_=require("./toggle-button-group-LddoXszz.cjs.js"),re=require("./toolbar-DcUEC_uE.cjs.js"),f=require("@commercetools/nimbus-icons"),y=require("./menu-CImIQ6uJ.cjs.js"),G=k.defineSlotRecipe({slots:["root","toolbar","editable"],className:"nimbus-rich-text-input",base:{root:{display:"flex",flexDirection:"column",position:"relative",width:"full",borderRadius:"200",borderWidth:"{sizes.25}",colorPalette:"slate",borderColor:"colorPalette.7",backgroundColor:"colorPalette.contrast","&[data-invalid='true']":{borderWidth:"{sizes.50}",borderColor:"critical.7"}},toolbar:{boxShadow:"1","[data-disabled='true'] &":{opacity:"0.5"}},editable:{padding:"400",minHeight:"inherit",outline:"none","[data-disabled='true'] &":{cursor:"not-allowed",opacity:"0.5"},"& p":{textStyle:"md",fontWeight:"500"},"& h1":{textStyle:"2xl",fontWeight:"500"},"& h2":{textStyle:"xl",fontWeight:"500"},"& h3":{textStyle:"lg",fontWeight:"500"},"& h4":{textStyle:"md",fontWeight:"500"},"& h5":{textStyle:"xs",fontWeight:"500"},"& blockquote":{textStyle:"md",fontWeight:"400",borderLeftWidth:"{sizes.100}",paddingLeft:"400"},"& ul":{paddingLeft:"600",listStyleType:"disc"},"& ol":{paddingLeft:"600",listStyleType:"decimal"},"& code":{padding:"100",fontFamily:"mono"},"& pre":{padding:"300",borderRadius:"200",overflow:"auto","& code":{padding:"0"}},"& a":{color:"primary.11",textDecoration:"underline",cursor:"pointer",_hover:{textDecoration:"none"}},"& strong":{fontWeight:"700"},"& em":{fontStyle:"italic"},"& u":{textDecoration:"underline"},"& del":{textDecoration:"line-through"},"& sup":{fontSize:"75%",verticalAlign:"super",lineHeight:"0"},"& sub":{fontSize:"75%",verticalAlign:"sub",lineHeight:"0"}}},variants:{}}),{withProvider:ne,withContext:K}=k.createSlotRecipeContext({recipe:G}),ie=ne("div","root"),se=K("div","toolbar"),le=K("div","editable");var ae={isHistory(t){return n.isPlainObject(t)&&Array.isArray(t.redos)&&Array.isArray(t.undos)&&(t.redos.length===0||n.Operation.isOperationList(t.redos[0].operations))&&(t.undos.length===0||n.Operation.isOperationList(t.undos[0].operations))}},z=new WeakMap,S=new WeakMap,C=new WeakMap,m={isHistoryEditor(t){return ae.isHistory(t.history)&&n.Editor.isEditor(t)},isMerging(t){return S.get(t)},isSplittingOnce(t){return C.get(t)},setSplittingOnce(t,o){C.set(t,o)},isSaving(t){return z.get(t)},redo(t){t.redo()},undo(t){t.undo()},withMerging(t,o){var i=m.isMerging(t);S.set(t,!0),o(),S.set(t,i)},withNewBatch(t,o){var i=m.isMerging(t);S.set(t,!0),C.set(t,!0),o(),S.set(t,i),C.delete(t)},withoutMerging(t,o){var i=m.isMerging(t);S.set(t,!1),o(),S.set(t,i)},withoutSaving(t,o){var i=m.isSaving(t);z.set(t,!1);try{o()}finally{z.set(t,i)}}},de=t=>{var o=t,{apply:i}=o;return o.history={undos:[],redos:[]},o.redo=()=>{var{history:l}=o,{redos:s}=l;if(s.length>0){var a=s[s.length-1];a.selectionBefore&&n.Transforms.setSelection(o,a.selectionBefore),m.withoutSaving(o,()=>{n.Editor.withoutNormalizing(o,()=>{for(var c of a.operations)o.apply(c)})}),l.redos.pop(),o.writeHistory("undos",a)}},o.undo=()=>{var{history:l}=o,{undos:s}=l;if(s.length>0){var a=s[s.length-1];m.withoutSaving(o,()=>{n.Editor.withoutNormalizing(o,()=>{var c=a.operations.map(n.Operation.inverse).reverse();for(var u of c)o.apply(u);a.selectionBefore&&n.Transforms.setSelection(o,a.selectionBefore)})}),o.writeHistory("redos",a),l.undos.pop()}},o.apply=l=>{var{operations:s,history:a}=o,{undos:c}=a,u=c[c.length-1],j=u&&u.operations[u.operations.length-1],g=m.isSaving(o),h=m.isMerging(o);if(g==null&&(g=ue(l)),g){if(h==null&&(u==null?h=!1:s.length!==0?h=!0:h=ce(l,j)),m.isSplittingOnce(o)&&(h=!1,m.setSplittingOnce(o,void 0)),u&&h)u.operations.push(l);else{var r={operations:[l],selectionBefore:o.selection};o.writeHistory("undos",r)}for(;c.length>100;)c.shift();a.redos=[]}i(l)},o.writeHistory=(l,s)=>{o.history[l].push(s)},o},ce=(t,o)=>!!(o&&t.type==="insert_text"&&o.type==="insert_text"&&t.offset===o.offset+o.text.length&&n.Path.equals(t.path,o.path)||o&&t.type==="remove_text"&&o.type==="remove_text"&&t.offset+t.text.length===o.offset&&n.Path.equals(t.path,o.path)),ue=(t,o)=>t.type!=="set_selection";const X=p.forwardRef((t,o)=>{const{value:i,onChange:l,onFocus:s,onBlur:a,placeholder:c=I.EDITOR_DEFAULTS.placeholder,isDisabled:u=I.EDITOR_DEFAULTS.isDisabled,isReadOnly:j=I.EDITOR_DEFAULTS.isReadOnly,autoFocus:g=I.EDITOR_DEFAULTS.autoFocus,toolbar:h}=t,r=p.useMemo(()=>{const x=n.createEditor();return n.withLinks(de(n.withReact(x)))},[]),{handleKeyDown:E}=D.useKeyboardShortcuts({editor:r}),H=p.useCallback(x=>{s&&s(x)},[s]),L=p.useCallback(x=>{a&&a(x)},[a]);p.useImperativeHandle(o,()=>({focus:()=>n.focusEditor(r),resetValue:x=>n.resetEditor(r,x)}),[r]);const P=p.useCallback(x=>e.jsx(n.Element$1,{...x}),[]),F=p.useCallback(x=>e.jsx(n.Leaf,{...x}),[]),q=n.createEmptyValue(),V=Array.isArray(i)&&i.length>0?i:q;return e.jsxs(n.Slate,{editor:r,value:V,onChange:l,children:[h&&e.jsx(se,{children:h}),e.jsx(le,{asChild:!0,children:e.jsx(n.Editable,{renderElement:P,renderLeaf:F,placeholder:c,autoFocus:g,readOnly:j||u,onKeyDown:E,onFocus:H,onBlur:L,"aria-label":"Rich text editor",role:"textbox","aria-multiline":"true"})})]})});X.displayName="RichTextEditor";const he=({isDisabled:t=!1})=>{const o=n.useSlate(),i=D.usePreservedSelection(o),{allSelectedKeys:l,handleAllSelectionChange:s}=D.useFormattingState({withPreservedSelection:i});return e.jsxs(y.Menu.Root,{selectionMode:"multiple",selectedKeys:l,onSelectionChange:s,children:[e.jsxs(d.Tooltip.Root,{delay:0,closeDelay:0,children:[e.jsx(y.Menu.Trigger,{asChild:!0,children:e.jsx(O.IconButton,{size:"xs",variant:"ghost","aria-label":"More formatting options",isDisabled:t,onMouseDown:a=>a.preventDefault(),children:e.jsx(f.MoreHoriz,{})})}),e.jsx(d.Tooltip.Content,{placement:"top",children:"More styles"})]}),e.jsxs(y.Menu.Content,{children:[e.jsx(y.Menu.Item,{id:"strikethrough",children:e.jsxs(b.Box,{slot:"label",display:"flex",alignItems:"center",gap:"200",children:[e.jsx(f.FormatStrikethrough,{}),e.jsx(v.Text,{textStyle:"sm",children:"Strikethrough"})]})}),e.jsx(y.Menu.Item,{id:"code",children:e.jsxs(b.Box,{slot:"label",display:"flex",alignItems:"center",gap:"200",children:[e.jsx(f.Code,{}),e.jsx(v.Text,{textStyle:"sm",children:"Code"})]})}),e.jsx(y.Menu.Item,{id:"superscript",children:e.jsxs(b.Box,{slot:"label",display:"flex",alignItems:"center",gap:"200",children:[e.jsx(v.Text,{children:"X²"}),e.jsx(v.Text,{textStyle:"sm",children:"Superscript"})]})}),e.jsx(y.Menu.Item,{id:"subscript",children:e.jsxs(b.Box,{slot:"label",display:"flex",alignItems:"center",gap:"200",children:[e.jsx(v.Text,{children:"X₂"}),e.jsx(v.Text,{textStyle:"sm",children:"Subscript"})]})})]})]})},$=({isDisabled:t=!1})=>{const o=n.useSlate(),i=D.usePreservedSelection(o),{currentTextStyle:l,selectedTextStyleLabel:s,handleTextStyleChange:a,handleListToggle:c,selectedFormatKeys:u,selectedListKeys:j,hasUndos:g,hasRedos:h}=D.useToolbarState({withPreservedSelection:i});return e.jsxs(re.Toolbar,{orientation:"horizontal","aria-label":"Text formatting",width:"full",overflow:"hidden",size:"xs",children:[e.jsx(U.Group,{children:e.jsxs(y.Menu.Root,{onAction:r=>a(String(r)),children:[e.jsxs(d.Tooltip.Root,{delay:0,closeDelay:0,children:[e.jsx(y.Menu.Trigger,{height:"800",width:"4000",bg:"primary.1",borderRadius:"200",_hover:{bg:"primary.2"},isDisabled:t,onMouseDown:r=>r.preventDefault(),"aria-label":"Text style menu",children:e.jsxs(b.Box,{display:"flex",alignItems:"center",gap:"200",px:"200",children:[e.jsx(b.Box,{display:"flex",alignItems:"center",gap:"200",flexGrow:"1",children:e.jsx(v.Text,{my:"auto",textStyle:"sm",fontWeight:"500",children:s})}),e.jsx(f.KeyboardArrowDown,{})]})}),e.jsx(d.Tooltip.Content,{placement:"top",children:"Text style"})]}),e.jsx(y.Menu.Content,{children:I.textStyles.map(r=>e.jsx(y.Menu.Item,{id:r.id,...l===r.id&&{"data-state":"checked"},children:e.jsx(v.Text,{...r.props,children:r.label})},r.id))})]})}),e.jsx(N.Divider,{orientation:"vertical"}),e.jsxs(_.ToggleButtonGroup.Root,{selectionMode:"multiple",selectedKeys:u,isDisabled:t,children:[e.jsxs(d.Tooltip.Root,{delay:0,closeDelay:0,children:[e.jsxs(w.IconToggleButton,{id:"bold",size:"xs",variant:"ghost","aria-label":"Bold",isDisabled:t,onMouseDown:r=>r.preventDefault(),onPress:i(()=>n.toggleMark(o,"bold")),children:[e.jsx(f.FormatBold,{}),e.jsx(M.VisuallyHidden,{children:"Bold"})]}),e.jsx(d.Tooltip.Content,{placement:"top",children:"Bold"})]}),e.jsxs(d.Tooltip.Root,{delay:0,closeDelay:0,children:[e.jsxs(w.IconToggleButton,{id:"italic",size:"xs",variant:"ghost","aria-label":"Italic",isDisabled:t,onMouseDown:r=>r.preventDefault(),onPress:i(()=>n.toggleMark(o,"italic")),children:[e.jsx(f.FormatItalic,{}),e.jsx(M.VisuallyHidden,{children:"Italic"})]}),e.jsx(d.Tooltip.Content,{placement:"top",children:"Italic"})]}),e.jsxs(d.Tooltip.Root,{delay:0,closeDelay:0,children:[e.jsxs(w.IconToggleButton,{id:"underline",size:"xs",variant:"ghost","aria-label":"Underline",isDisabled:t,onMouseDown:r=>r.preventDefault(),onPress:i(()=>n.toggleMark(o,"underline")),children:[e.jsx(f.FormatUnderlined,{}),e.jsx(M.VisuallyHidden,{children:"Underline"})]}),e.jsx(d.Tooltip.Content,{placement:"top",children:"Underline"})]})]}),e.jsx(he,{isDisabled:t}),e.jsx(N.Divider,{orientation:"vertical"}),e.jsxs(_.ToggleButtonGroup.Root,{selectionMode:"single",selectedKeys:j,onSelectionChange:c,"aria-label":"List formatting",isDisabled:t,children:[e.jsxs(d.Tooltip.Root,{delay:0,closeDelay:0,children:[e.jsx(w.IconToggleButton,{id:"bulleted-list",size:"xs",variant:"ghost","aria-label":"Bulleted List",isDisabled:t,onMouseDown:r=>r.preventDefault(),children:e.jsx(f.FormatListBulleted,{})}),e.jsx(d.Tooltip.Content,{placement:"top",children:"Bulleted list"})]}),e.jsxs(d.Tooltip.Root,{delay:0,closeDelay:0,children:[e.jsx(w.IconToggleButton,{id:"numbered-list",size:"xs",variant:"ghost","aria-label":"Numbered List",isDisabled:t,onMouseDown:r=>r.preventDefault(),children:e.jsx(f.FormatListNumbered,{})}),e.jsx(d.Tooltip.Content,{placement:"top",children:"Numbered list"})]})]}),e.jsx(b.Box,{flexGrow:"1"}),e.jsxs(U.Group,{children:[e.jsxs(d.Tooltip.Root,{delay:0,closeDelay:0,children:[e.jsxs(O.IconButton,{size:"xs",variant:"ghost","aria-label":"Undo",isDisabled:!g||t,onPress:i(()=>o.undo()),onMouseDown:r=>r.preventDefault(),children:[e.jsx(f.Undo,{}),e.jsx(M.VisuallyHidden,{children:"Undo"})]}),e.jsx(d.Tooltip.Content,{placement:"top",children:"Undo"})]}),e.jsxs(d.Tooltip.Root,{delay:0,closeDelay:0,children:[e.jsxs(O.IconButton,{size:"xs",variant:"ghost","aria-label":"Redo",isDisabled:!h||t,onPress:i(()=>o.redo()),onMouseDown:r=>r.preventDefault(),children:[e.jsx(f.Redo,{}),e.jsx(M.VisuallyHidden,{children:"Redo"})]}),e.jsx(d.Tooltip.Content,{placement:"top",children:"Redo"})]})]})]})};$.displayName="RichTextToolbar";const J=t=>{const{ref:o,value:i,defaultValue:l,onChange:s,onFocus:a,onBlur:c,placeholder:u="",isDisabled:j=!1,isReadOnly:g=!1,isInvalid:h=!1,autoFocus:r=!1,...E}=t,H=k.useSlotRecipe({recipe:G}),[L,P]=H.splitVariantProps({...E}),[F,q]=oe.extractStyleProps(P),V={"data-disabled":j?"true":void 0,"data-invalid":h?"true":void 0,"data-readonly":g?"true":void 0},[x,A]=p.useState(()=>{const T=i??l??"";try{return T?n.fromHTML(T):n.createEmptyValue()}catch(R){return console.warn("Failed to parse initial HTML, using empty value:",R),n.createEmptyValue()}}),[B,W]=p.useState(()=>i??l??""),Q=p.useRef(null);p.useEffect(()=>{if(i!==void 0&&i!==B){const T=i?n.fromHTML(i):n.createEmptyValue();A(T),W(i)}},[i,B]);const Y=p.useCallback(T=>{const R=n.toHTML(T),te=R!==B;A(T),W(R),te&&s&&s(R)},[B,s]),Z=x,ee=n.validSlateStateAdapter(Z);return e.jsx(ie,{...L,...F,...q,...V,ref:o,children:e.jsx(X,{ref:Q,value:ee,onChange:Y,onFocus:a,onBlur:c,placeholder:u,isDisabled:j,isReadOnly:g,autoFocus:r,toolbar:g?null:e.jsx($,{isDisabled:j})})})};J.displayName="RichTextInput";exports.RichTextInput=J;
2
- //# sourceMappingURL=rich-text-input-DmwKaXzi.cjs.js.map
1
+ "use strict";const e=require("react/jsx-runtime"),p=require("react"),k=require("@chakra-ui/react"),oe=require("./extractStyleProps-BsLft3q1.cjs.js"),n=require("./slate-helpers-BN_9Hky2.cjs.js"),D=require("./use-formatting-state-DVcnyVBl.cjs.js"),I=require("../components/constants.cjs"),b=require("./box-BwCVnAwb.cjs.js"),N=require("./divider-DU351gdE.cjs.js"),U=require("./group-Buy-O6Mr.cjs.js"),O=require("./icon-button-DOo2GUqd.cjs.js"),w=require("./icon-toggle-button-DmYB27yi.cjs.js"),v=require("./text-Dg1sFCuC.cjs.js"),d=require("./tooltip-CIAEV4_B.cjs.js"),M=require("./visually-hidden-Bh-G5QHv.cjs.js"),_=require("./toggle-button-group-LddoXszz.cjs.js"),re=require("./toolbar-BUYkQMPz.cjs.js"),f=require("@commercetools/nimbus-icons"),y=require("./menu-C8il9--K.cjs.js"),G=k.defineSlotRecipe({slots:["root","toolbar","editable"],className:"nimbus-rich-text-input",base:{root:{display:"flex",flexDirection:"column",position:"relative",width:"full",borderRadius:"200",borderWidth:"{sizes.25}",colorPalette:"slate",borderColor:"colorPalette.7",backgroundColor:"colorPalette.contrast","&[data-invalid='true']":{borderWidth:"{sizes.50}",borderColor:"critical.7"}},toolbar:{boxShadow:"1","[data-disabled='true'] &":{opacity:"0.5"}},editable:{padding:"400",minHeight:"inherit",outline:"none","[data-disabled='true'] &":{cursor:"not-allowed",opacity:"0.5"},"& p":{textStyle:"md",fontWeight:"500"},"& h1":{textStyle:"2xl",fontWeight:"500"},"& h2":{textStyle:"xl",fontWeight:"500"},"& h3":{textStyle:"lg",fontWeight:"500"},"& h4":{textStyle:"md",fontWeight:"500"},"& h5":{textStyle:"xs",fontWeight:"500"},"& blockquote":{textStyle:"md",fontWeight:"400",borderLeftWidth:"{sizes.100}",paddingLeft:"400"},"& ul":{paddingLeft:"600",listStyleType:"disc"},"& ol":{paddingLeft:"600",listStyleType:"decimal"},"& code":{padding:"100",fontFamily:"mono"},"& pre":{padding:"300",borderRadius:"200",overflow:"auto","& code":{padding:"0"}},"& a":{color:"primary.11",textDecoration:"underline",cursor:"pointer",_hover:{textDecoration:"none"}},"& strong":{fontWeight:"700"},"& em":{fontStyle:"italic"},"& u":{textDecoration:"underline"},"& del":{textDecoration:"line-through"},"& sup":{fontSize:"75%",verticalAlign:"super",lineHeight:"0"},"& sub":{fontSize:"75%",verticalAlign:"sub",lineHeight:"0"}}},variants:{}}),{withProvider:ne,withContext:K}=k.createSlotRecipeContext({recipe:G}),ie=ne("div","root"),se=K("div","toolbar"),le=K("div","editable");var ae={isHistory(t){return n.isPlainObject(t)&&Array.isArray(t.redos)&&Array.isArray(t.undos)&&(t.redos.length===0||n.Operation.isOperationList(t.redos[0].operations))&&(t.undos.length===0||n.Operation.isOperationList(t.undos[0].operations))}},z=new WeakMap,S=new WeakMap,C=new WeakMap,m={isHistoryEditor(t){return ae.isHistory(t.history)&&n.Editor.isEditor(t)},isMerging(t){return S.get(t)},isSplittingOnce(t){return C.get(t)},setSplittingOnce(t,o){C.set(t,o)},isSaving(t){return z.get(t)},redo(t){t.redo()},undo(t){t.undo()},withMerging(t,o){var i=m.isMerging(t);S.set(t,!0),o(),S.set(t,i)},withNewBatch(t,o){var i=m.isMerging(t);S.set(t,!0),C.set(t,!0),o(),S.set(t,i),C.delete(t)},withoutMerging(t,o){var i=m.isMerging(t);S.set(t,!1),o(),S.set(t,i)},withoutSaving(t,o){var i=m.isSaving(t);z.set(t,!1);try{o()}finally{z.set(t,i)}}},de=t=>{var o=t,{apply:i}=o;return o.history={undos:[],redos:[]},o.redo=()=>{var{history:l}=o,{redos:s}=l;if(s.length>0){var a=s[s.length-1];a.selectionBefore&&n.Transforms.setSelection(o,a.selectionBefore),m.withoutSaving(o,()=>{n.Editor.withoutNormalizing(o,()=>{for(var c of a.operations)o.apply(c)})}),l.redos.pop(),o.writeHistory("undos",a)}},o.undo=()=>{var{history:l}=o,{undos:s}=l;if(s.length>0){var a=s[s.length-1];m.withoutSaving(o,()=>{n.Editor.withoutNormalizing(o,()=>{var c=a.operations.map(n.Operation.inverse).reverse();for(var u of c)o.apply(u);a.selectionBefore&&n.Transforms.setSelection(o,a.selectionBefore)})}),o.writeHistory("redos",a),l.undos.pop()}},o.apply=l=>{var{operations:s,history:a}=o,{undos:c}=a,u=c[c.length-1],j=u&&u.operations[u.operations.length-1],g=m.isSaving(o),h=m.isMerging(o);if(g==null&&(g=ue(l)),g){if(h==null&&(u==null?h=!1:s.length!==0?h=!0:h=ce(l,j)),m.isSplittingOnce(o)&&(h=!1,m.setSplittingOnce(o,void 0)),u&&h)u.operations.push(l);else{var r={operations:[l],selectionBefore:o.selection};o.writeHistory("undos",r)}for(;c.length>100;)c.shift();a.redos=[]}i(l)},o.writeHistory=(l,s)=>{o.history[l].push(s)},o},ce=(t,o)=>!!(o&&t.type==="insert_text"&&o.type==="insert_text"&&t.offset===o.offset+o.text.length&&n.Path.equals(t.path,o.path)||o&&t.type==="remove_text"&&o.type==="remove_text"&&t.offset+t.text.length===o.offset&&n.Path.equals(t.path,o.path)),ue=(t,o)=>t.type!=="set_selection";const X=p.forwardRef((t,o)=>{const{value:i,onChange:l,onFocus:s,onBlur:a,placeholder:c=I.EDITOR_DEFAULTS.placeholder,isDisabled:u=I.EDITOR_DEFAULTS.isDisabled,isReadOnly:j=I.EDITOR_DEFAULTS.isReadOnly,autoFocus:g=I.EDITOR_DEFAULTS.autoFocus,toolbar:h}=t,r=p.useMemo(()=>{const x=n.createEditor();return n.withLinks(de(n.withReact(x)))},[]),{handleKeyDown:E}=D.useKeyboardShortcuts({editor:r}),H=p.useCallback(x=>{s&&s(x)},[s]),L=p.useCallback(x=>{a&&a(x)},[a]);p.useImperativeHandle(o,()=>({focus:()=>n.focusEditor(r),resetValue:x=>n.resetEditor(r,x)}),[r]);const P=p.useCallback(x=>e.jsx(n.Element$1,{...x}),[]),F=p.useCallback(x=>e.jsx(n.Leaf,{...x}),[]),q=n.createEmptyValue(),V=Array.isArray(i)&&i.length>0?i:q;return e.jsxs(n.Slate,{editor:r,value:V,onChange:l,children:[h&&e.jsx(se,{children:h}),e.jsx(le,{asChild:!0,children:e.jsx(n.Editable,{renderElement:P,renderLeaf:F,placeholder:c,autoFocus:g,readOnly:j||u,onKeyDown:E,onFocus:H,onBlur:L,"aria-label":"Rich text editor",role:"textbox","aria-multiline":"true"})})]})});X.displayName="RichTextEditor";const he=({isDisabled:t=!1})=>{const o=n.useSlate(),i=D.usePreservedSelection(o),{allSelectedKeys:l,handleAllSelectionChange:s}=D.useFormattingState({withPreservedSelection:i});return e.jsxs(y.Menu.Root,{selectionMode:"multiple",selectedKeys:l,onSelectionChange:s,children:[e.jsxs(d.Tooltip.Root,{delay:0,closeDelay:0,children:[e.jsx(y.Menu.Trigger,{asChild:!0,children:e.jsx(O.IconButton,{size:"xs",variant:"ghost","aria-label":"More formatting options",isDisabled:t,onMouseDown:a=>a.preventDefault(),children:e.jsx(f.MoreHoriz,{})})}),e.jsx(d.Tooltip.Content,{placement:"top",children:"More styles"})]}),e.jsxs(y.Menu.Content,{children:[e.jsx(y.Menu.Item,{id:"strikethrough",children:e.jsxs(b.Box,{slot:"label",display:"flex",alignItems:"center",gap:"200",children:[e.jsx(f.FormatStrikethrough,{}),e.jsx(v.Text,{textStyle:"sm",children:"Strikethrough"})]})}),e.jsx(y.Menu.Item,{id:"code",children:e.jsxs(b.Box,{slot:"label",display:"flex",alignItems:"center",gap:"200",children:[e.jsx(f.Code,{}),e.jsx(v.Text,{textStyle:"sm",children:"Code"})]})}),e.jsx(y.Menu.Item,{id:"superscript",children:e.jsxs(b.Box,{slot:"label",display:"flex",alignItems:"center",gap:"200",children:[e.jsx(v.Text,{children:"X²"}),e.jsx(v.Text,{textStyle:"sm",children:"Superscript"})]})}),e.jsx(y.Menu.Item,{id:"subscript",children:e.jsxs(b.Box,{slot:"label",display:"flex",alignItems:"center",gap:"200",children:[e.jsx(v.Text,{children:"X₂"}),e.jsx(v.Text,{textStyle:"sm",children:"Subscript"})]})})]})]})},$=({isDisabled:t=!1})=>{const o=n.useSlate(),i=D.usePreservedSelection(o),{currentTextStyle:l,selectedTextStyleLabel:s,handleTextStyleChange:a,handleListToggle:c,selectedFormatKeys:u,selectedListKeys:j,hasUndos:g,hasRedos:h}=D.useToolbarState({withPreservedSelection:i});return e.jsxs(re.Toolbar,{orientation:"horizontal","aria-label":"Text formatting",width:"full",overflow:"hidden",size:"xs",children:[e.jsx(U.Group,{children:e.jsxs(y.Menu.Root,{onAction:r=>a(String(r)),children:[e.jsxs(d.Tooltip.Root,{delay:0,closeDelay:0,children:[e.jsx(y.Menu.Trigger,{height:"800",width:"4000",bg:"primary.1",borderRadius:"200",_hover:{bg:"primary.2"},isDisabled:t,onMouseDown:r=>r.preventDefault(),"aria-label":"Text style menu",children:e.jsxs(b.Box,{display:"flex",alignItems:"center",gap:"200",px:"200",children:[e.jsx(b.Box,{display:"flex",alignItems:"center",gap:"200",flexGrow:"1",children:e.jsx(v.Text,{my:"auto",textStyle:"sm",fontWeight:"500",children:s})}),e.jsx(f.KeyboardArrowDown,{})]})}),e.jsx(d.Tooltip.Content,{placement:"top",children:"Text style"})]}),e.jsx(y.Menu.Content,{children:I.textStyles.map(r=>e.jsx(y.Menu.Item,{id:r.id,...l===r.id&&{"data-state":"checked"},children:e.jsx(v.Text,{...r.props,children:r.label})},r.id))})]})}),e.jsx(N.Divider,{orientation:"vertical"}),e.jsxs(_.ToggleButtonGroup.Root,{selectionMode:"multiple",selectedKeys:u,isDisabled:t,children:[e.jsxs(d.Tooltip.Root,{delay:0,closeDelay:0,children:[e.jsxs(w.IconToggleButton,{id:"bold",size:"xs",variant:"ghost","aria-label":"Bold",isDisabled:t,onMouseDown:r=>r.preventDefault(),onPress:i(()=>n.toggleMark(o,"bold")),children:[e.jsx(f.FormatBold,{}),e.jsx(M.VisuallyHidden,{children:"Bold"})]}),e.jsx(d.Tooltip.Content,{placement:"top",children:"Bold"})]}),e.jsxs(d.Tooltip.Root,{delay:0,closeDelay:0,children:[e.jsxs(w.IconToggleButton,{id:"italic",size:"xs",variant:"ghost","aria-label":"Italic",isDisabled:t,onMouseDown:r=>r.preventDefault(),onPress:i(()=>n.toggleMark(o,"italic")),children:[e.jsx(f.FormatItalic,{}),e.jsx(M.VisuallyHidden,{children:"Italic"})]}),e.jsx(d.Tooltip.Content,{placement:"top",children:"Italic"})]}),e.jsxs(d.Tooltip.Root,{delay:0,closeDelay:0,children:[e.jsxs(w.IconToggleButton,{id:"underline",size:"xs",variant:"ghost","aria-label":"Underline",isDisabled:t,onMouseDown:r=>r.preventDefault(),onPress:i(()=>n.toggleMark(o,"underline")),children:[e.jsx(f.FormatUnderlined,{}),e.jsx(M.VisuallyHidden,{children:"Underline"})]}),e.jsx(d.Tooltip.Content,{placement:"top",children:"Underline"})]})]}),e.jsx(he,{isDisabled:t}),e.jsx(N.Divider,{orientation:"vertical"}),e.jsxs(_.ToggleButtonGroup.Root,{selectionMode:"single",selectedKeys:j,onSelectionChange:c,"aria-label":"List formatting",isDisabled:t,children:[e.jsxs(d.Tooltip.Root,{delay:0,closeDelay:0,children:[e.jsx(w.IconToggleButton,{id:"bulleted-list",size:"xs",variant:"ghost","aria-label":"Bulleted List",isDisabled:t,onMouseDown:r=>r.preventDefault(),children:e.jsx(f.FormatListBulleted,{})}),e.jsx(d.Tooltip.Content,{placement:"top",children:"Bulleted list"})]}),e.jsxs(d.Tooltip.Root,{delay:0,closeDelay:0,children:[e.jsx(w.IconToggleButton,{id:"numbered-list",size:"xs",variant:"ghost","aria-label":"Numbered List",isDisabled:t,onMouseDown:r=>r.preventDefault(),children:e.jsx(f.FormatListNumbered,{})}),e.jsx(d.Tooltip.Content,{placement:"top",children:"Numbered list"})]})]}),e.jsx(b.Box,{flexGrow:"1"}),e.jsxs(U.Group,{children:[e.jsxs(d.Tooltip.Root,{delay:0,closeDelay:0,children:[e.jsxs(O.IconButton,{size:"xs",variant:"ghost","aria-label":"Undo",isDisabled:!g||t,onPress:i(()=>o.undo()),onMouseDown:r=>r.preventDefault(),children:[e.jsx(f.Undo,{}),e.jsx(M.VisuallyHidden,{children:"Undo"})]}),e.jsx(d.Tooltip.Content,{placement:"top",children:"Undo"})]}),e.jsxs(d.Tooltip.Root,{delay:0,closeDelay:0,children:[e.jsxs(O.IconButton,{size:"xs",variant:"ghost","aria-label":"Redo",isDisabled:!h||t,onPress:i(()=>o.redo()),onMouseDown:r=>r.preventDefault(),children:[e.jsx(f.Redo,{}),e.jsx(M.VisuallyHidden,{children:"Redo"})]}),e.jsx(d.Tooltip.Content,{placement:"top",children:"Redo"})]})]})]})};$.displayName="RichTextToolbar";const J=t=>{const{ref:o,value:i,defaultValue:l,onChange:s,onFocus:a,onBlur:c,placeholder:u="",isDisabled:j=!1,isReadOnly:g=!1,isInvalid:h=!1,autoFocus:r=!1,...E}=t,H=k.useSlotRecipe({recipe:G}),[L,P]=H.splitVariantProps({...E}),[F,q]=oe.extractStyleProps(P),V={"data-disabled":j?"true":void 0,"data-invalid":h?"true":void 0,"data-readonly":g?"true":void 0},[x,A]=p.useState(()=>{const T=i??l??"";try{return T?n.fromHTML(T):n.createEmptyValue()}catch(R){return console.warn("Failed to parse initial HTML, using empty value:",R),n.createEmptyValue()}}),[B,W]=p.useState(()=>i??l??""),Q=p.useRef(null);p.useEffect(()=>{if(i!==void 0&&i!==B){const T=i?n.fromHTML(i):n.createEmptyValue();A(T),W(i)}},[i,B]);const Y=p.useCallback(T=>{const R=n.toHTML(T),te=R!==B;A(T),W(R),te&&s&&s(R)},[B,s]),Z=x,ee=n.validSlateStateAdapter(Z);return e.jsx(ie,{...L,...F,...q,...V,ref:o,children:e.jsx(X,{ref:Q,value:ee,onChange:Y,onFocus:a,onBlur:c,placeholder:u,isDisabled:j,isReadOnly:g,autoFocus:r,toolbar:g?null:e.jsx($,{isDisabled:j})})})};J.displayName="RichTextInput";exports.RichTextInput=J;
2
+ //# sourceMappingURL=rich-text-input-gNWvLb4m.cjs.js.map