streamlit-nightly 1.42.2.dev20250218__py2.py3-none-any.whl → 1.42.3.dev20250220__py2.py3-none-any.whl

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 (80) hide show
  1. streamlit/column_config.py +2 -0
  2. streamlit/commands/navigation.py +134 -129
  3. streamlit/elements/lib/column_types.py +88 -0
  4. streamlit/navigation/page.py +1 -1
  5. streamlit/static/index.html +1 -1
  6. streamlit/static/static/js/{FileDownload.esm.DU-1rCSB.js → FileDownload.esm.CSCu_FQk.js} +1 -1
  7. streamlit/static/static/js/{FileDropzone.BI3MGDdT.js → FileDropzone.xME_qwl7.js} +1 -1
  8. streamlit/static/static/js/{FormClearHelper.DzU-mNjk.js → FormClearHelper.D7FpzEHQ.js} +1 -1
  9. streamlit/static/static/js/{Hooks.qUbVZL-A.js → Hooks.Ofd2jLSe.js} +1 -1
  10. streamlit/static/static/js/{InputInstructions.CpNPMMpX.js → InputInstructions.C5AiI5fd.js} +1 -1
  11. streamlit/static/static/js/{ProgressBar.4yIafGOA.js → ProgressBar.St3jxlFz.js} +2 -2
  12. streamlit/static/static/js/{RenderInPortalIfExists.31NYBozH.js → RenderInPortalIfExists.JQTUbdhz.js} +1 -1
  13. streamlit/static/static/js/{Toolbar.lnT7wtEH.js → Toolbar.mIL79bYR.js} +1 -1
  14. streamlit/static/static/js/{base-input.DYDwDBVN.js → base-input.CoahMH6I.js} +4 -4
  15. streamlit/static/static/js/{createSuper.CP_bqXkl.js → createSuper.DJC0972y.js} +1 -1
  16. streamlit/static/static/js/{data-grid-overlay-editor.Bw6S-08j.js → data-grid-overlay-editor.C9j6qKVt.js} +1 -1
  17. streamlit/static/static/js/{downloader.DZpOwdni.js → downloader.BmN5QG23.js} +1 -1
  18. streamlit/static/static/js/{es6.D670kkuw.js → es6.CkTV0_PT.js} +2 -2
  19. streamlit/static/static/js/{iframeResizer.contentWindow.CBWvp4oS.js → iframeResizer.contentWindow.GG3aQxlr.js} +1 -1
  20. streamlit/static/static/js/{index.8M0nMTyK.js → index.40cNUDYj.js} +1 -1
  21. streamlit/static/static/js/{index.DS38XxzV.js → index.B0fq3djO.js} +1 -1
  22. streamlit/static/static/js/index.B6DhU6bS.js +1 -0
  23. streamlit/static/static/js/{index.D3VdaBwP.js → index.BFMT7m5S.js} +1 -1
  24. streamlit/static/static/js/{index.DNEGP5ih.js → index.BIMiZM1d.js} +1 -1
  25. streamlit/static/static/js/{index.DsvnAu-2.js → index.BIb_Q_t2.js} +1 -1
  26. streamlit/static/static/js/{index.CA6bEd5D.js → index.BWRgNHzG.js} +1 -1
  27. streamlit/static/static/js/{index.CD53GuKN.js → index.BgviuYiK.js} +2 -2
  28. streamlit/static/static/js/{index.Du4f6P1i.js → index.Bhh-YA7-.js} +1 -1
  29. streamlit/static/static/js/{index.Ch1c3KR1.js → index.BtEGgjQs.js} +1 -1
  30. streamlit/static/static/js/{index.BhTUDBBK.js → index.C2RhGRpZ.js} +1 -1
  31. streamlit/static/static/js/{index.BkURA4Nq.js → index.C6YhHXiT.js} +2 -2
  32. streamlit/static/static/js/{index.Byj6qntv.js → index.C_y3GDl0.js} +1 -1
  33. streamlit/static/static/js/{index.D8aCPmhr.js → index.CcxxDrWU.js} +1 -1
  34. streamlit/static/static/js/{index.CKT6gwZG.js → index.CmKQs94B.js} +2 -2
  35. streamlit/static/static/js/index.Cu1SST0o.js +197 -0
  36. streamlit/static/static/js/index.D6v0tURe.js +1 -0
  37. streamlit/static/static/js/{index.B-Bz2NGO.js → index.D8VHOaj4.js} +1 -1
  38. streamlit/static/static/js/{index.DRJutLeV.js → index.DGCNoFUa.js} +1 -1
  39. streamlit/static/static/js/{index.D6UL3iMZ.js → index.DGtuJLSc.js} +1 -1
  40. streamlit/static/static/js/{index.CrYKK91g.js → index.DLmg74_p.js} +132 -132
  41. streamlit/static/static/js/{index.BCorV1AX.js → index.DMRnVKOx.js} +1 -1
  42. streamlit/static/static/js/{index.-wGNsvT9.js → index.DX8V4iLG.js} +1 -1
  43. streamlit/static/static/js/{index.ChIZFRw0.js → index.DgheNneH.js} +1 -1
  44. streamlit/static/static/js/index.DlpiXPka.js +1 -0
  45. streamlit/static/static/js/{index.Bif_gpeX.js → index.DpMH9Ich.js} +1 -1
  46. streamlit/static/static/js/{index.B9mk7o4G.js → index.DtOoKZuY.js} +3 -3
  47. streamlit/static/static/js/{index.0jzSLI-x.js → index.DvpzuDf3.js} +2 -2
  48. streamlit/static/static/js/{index.De5HitMn.js → index.DxseZbLQ.js} +1 -1
  49. streamlit/static/static/js/{index.C5VAa8DZ.js → index.F-Swvxpp.js} +1 -1
  50. streamlit/static/static/js/{index.DdeHhk74.js → index.GL3uWznV.js} +1 -1
  51. streamlit/static/static/js/{index.XAUdgEdp.js → index.GumFavEm.js} +1 -1
  52. streamlit/static/static/js/{index.HCbHLWBq.js → index.LvS7giIF.js} +1 -1
  53. streamlit/static/static/js/{index.DHBu5iL6.js → index.c4SbAEld.js} +1 -1
  54. streamlit/static/static/js/{index.BMlBBPxY.js → index.euIqXpX7.js} +3 -3
  55. streamlit/static/static/js/{index.CLsHMaqe.js → index.od8XlC_e.js} +10 -10
  56. streamlit/static/static/js/{index.B6KnC7nW.js → index.zss4f62G.js} +1 -1
  57. streamlit/static/static/js/{input.e-37_Dj1.js → input.DQUrmNKe.js} +2 -2
  58. streamlit/static/static/js/{memory.B5p-2jga.js → memory.Bc-1m0Hw.js} +1 -1
  59. streamlit/static/static/js/{mergeWith.D8nk5iJa.js → mergeWith.DrVjJq9_.js} +1 -1
  60. streamlit/static/static/js/{number-overlay-editor.DLD5-9zx.js → number-overlay-editor.sGSz7Cjz.js} +1 -1
  61. streamlit/static/static/js/{possibleConstructorReturn.eeV6HB6T.js → possibleConstructorReturn.DB_ioxa8.js} +1 -1
  62. streamlit/static/static/js/{sandbox.ChKquq8J.js → sandbox.Df3tB-gk.js} +1 -1
  63. streamlit/static/static/js/{textarea.ZI_0MUsX.js → textarea.COkOU68B.js} +2 -2
  64. streamlit/static/static/js/{timepicker.C8N66VUc.js → timepicker.DHf9u4bk.js} +1 -1
  65. streamlit/static/static/js/{toConsumableArray.DKg00cRh.js → toConsumableArray.B-S6rpdU.js} +1 -1
  66. streamlit/static/static/js/{uniqueId.fc9w8X88.js → uniqueId.BfMGEPML.js} +1 -1
  67. streamlit/static/static/js/{useBasicWidgetState.CySX_BlM.js → useBasicWidgetState.B8dRKvrk.js} +1 -1
  68. streamlit/static/static/js/{useOnInputChange.BF6Trlh5.js → useOnInputChange.Bntao_G6.js} +1 -1
  69. streamlit/static/static/js/{withFullScreenWrapper.x2WsM7iA.js → withFullScreenWrapper.CS8vg4vY.js} +1 -1
  70. streamlit/web/bootstrap.py +10 -6
  71. {streamlit_nightly-1.42.2.dev20250218.dist-info → streamlit_nightly-1.42.3.dev20250220.dist-info}/METADATA +1 -1
  72. {streamlit_nightly-1.42.2.dev20250218.dist-info → streamlit_nightly-1.42.3.dev20250220.dist-info}/RECORD +76 -76
  73. streamlit/static/static/js/index.C0O8ISw8.js +0 -1
  74. streamlit/static/static/js/index.Cvgj5_qB.js +0 -1
  75. streamlit/static/static/js/index.DJF89pFO.js +0 -1
  76. streamlit/static/static/js/index.edlGQJ3v.js +0 -197
  77. {streamlit_nightly-1.42.2.dev20250218.data → streamlit_nightly-1.42.3.dev20250220.data}/scripts/streamlit.cmd +0 -0
  78. {streamlit_nightly-1.42.2.dev20250218.dist-info → streamlit_nightly-1.42.3.dev20250220.dist-info}/WHEEL +0 -0
  79. {streamlit_nightly-1.42.2.dev20250218.dist-info → streamlit_nightly-1.42.3.dev20250220.dist-info}/entry_points.txt +0 -0
  80. {streamlit_nightly-1.42.2.dev20250218.dist-info → streamlit_nightly-1.42.3.dev20250220.dist-info}/top_level.txt +0 -0
@@ -1,9 +1,9 @@
1
- import{bt as w,bG as ae,bH as T,r as f,bI as x,y as le,D as ce,j as R,C as se,bp as ue,ay as de,bx as fe,bq as ge,b7 as he,bJ as be,at as me,bK as ve,bL as pe}from"./index.CLsHMaqe.js";import{a as ye}from"./useBasicWidgetState.CySX_BlM.js";import"./FormClearHelper.DzU-mNjk.js";var S=Object.freeze({default:"default",toggle:"toggle",toggle_round:"toggle"}),$e=Object.freeze({top:"top",right:"right",bottom:"bottom",left:"left"});function q(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),o.push.apply(o,r)}return o}function P(e){for(var t=1;t<arguments.length;t++){var o=arguments[t]!=null?arguments[t]:{};t%2?q(Object(o),!0).forEach(function(r){G(e,r,o[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):q(Object(o)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(o,r))})}return e}function G(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}function ke(e){var t=e.$disabled,o=e.$checked,r=e.$error,i=e.$isIndeterminate,c=e.$theme,a=e.$isFocusVisible,n=c.colors;return t?n.tickFillDisabled:o||i?"transparent":r?n.borderNegative:a?n.borderSelected:n.tickBorder}function Te(e){var t=e.$labelPlacement,o=t===void 0?"":t,r=e.$theme,i=r.sizing,c=i.scale300,a;switch(o){case"top":a="Bottom";break;case"bottom":a="Top";break;case"left":a="Right";break;default:case"right":a="Left";break}return r.direction==="rtl"&&a==="Left"?a="Right":r.direction==="rtl"&&a==="Right"&&(a="Left"),G({},"padding".concat(a),c)}function xe(e){var t=e.$disabled,o=e.$checked,r=e.$isIndeterminate,i=e.$error,c=e.$isHovered,a=e.$isActive,n=e.$theme,l=n.colors;return t?o||r?l.tickFillDisabled:l.tickFill:i&&(r||o)?a?l.tickFillErrorSelectedHoverActive:c?l.tickFillErrorSelectedHover:l.tickFillErrorSelected:i?a?l.tickFillErrorHoverActive:c?l.tickFillErrorHover:l.tickFillError:r||o?a?l.tickFillSelectedHoverActive:c?l.tickFillSelectedHover:l.tickFillSelected:a?l.tickFillActive:c?l.tickFillHover:l.tickFill}function we(e){var t=e.$disabled,o=e.$theme,r=o.colors;return t?r.contentSecondary:r.contentPrimary}var M=w("label",function(e){var t=e.$disabled,o=e.$labelPlacement;return{flexDirection:o==="top"||o==="bottom"?"column":"row",display:"flex",alignItems:o==="top"||o==="bottom"?"center":"flex-start",cursor:t?"not-allowed":"pointer",userSelect:"none"}});M.displayName="Root";M.displayName="Root";var _=w("span",function(e){var t=e.$checked,o=e.$disabled,r=e.$error,i=e.$isIndeterminate,c=e.$theme,a=e.$isFocusVisible,n=c.sizing,l=c.animation,u=o?c.colors.tickMarkFillDisabled:r?c.colors.tickMarkFillError:c.colors.tickMarkFill,s=encodeURIComponent(`
1
+ import{bv as x,bI as ae,bJ as T,r as f,bK as w,y as le,D as ce,j as R,C as se,br as ue,aB as de,bz as fe,bs as ge,b9 as he,bL as be,aw as me,bM as ve,bN as pe}from"./index.od8XlC_e.js";import{a as $e}from"./useBasicWidgetState.B8dRKvrk.js";import"./FormClearHelper.D7FpzEHQ.js";var S=Object.freeze({default:"default",toggle:"toggle",toggle_round:"toggle"}),ye=Object.freeze({top:"top",right:"right",bottom:"bottom",left:"left"});function q(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),o.push.apply(o,r)}return o}function P(e){for(var t=1;t<arguments.length;t++){var o=arguments[t]!=null?arguments[t]:{};t%2?q(Object(o),!0).forEach(function(r){G(e,r,o[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):q(Object(o)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(o,r))})}return e}function G(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}function ke(e){var t=e.$disabled,o=e.$checked,r=e.$error,i=e.$isIndeterminate,c=e.$theme,a=e.$isFocusVisible,n=c.colors;return t?n.tickFillDisabled:o||i?"transparent":r?n.borderNegative:a?n.borderSelected:n.tickBorder}function Te(e){var t=e.$labelPlacement,o=t===void 0?"":t,r=e.$theme,i=r.sizing,c=i.scale300,a;switch(o){case"top":a="Bottom";break;case"bottom":a="Top";break;case"left":a="Right";break;default:case"right":a="Left";break}return r.direction==="rtl"&&a==="Left"?a="Right":r.direction==="rtl"&&a==="Right"&&(a="Left"),G({},"padding".concat(a),c)}function we(e){var t=e.$disabled,o=e.$checked,r=e.$isIndeterminate,i=e.$error,c=e.$isHovered,a=e.$isActive,n=e.$theme,l=n.colors;return t?o||r?l.tickFillDisabled:l.tickFill:i&&(r||o)?a?l.tickFillErrorSelectedHoverActive:c?l.tickFillErrorSelectedHover:l.tickFillErrorSelected:i?a?l.tickFillErrorHoverActive:c?l.tickFillErrorHover:l.tickFillError:r||o?a?l.tickFillSelectedHoverActive:c?l.tickFillSelectedHover:l.tickFillSelected:a?l.tickFillActive:c?l.tickFillHover:l.tickFill}function xe(e){var t=e.$disabled,o=e.$theme,r=o.colors;return t?r.contentSecondary:r.contentPrimary}var M=x("label",function(e){var t=e.$disabled,o=e.$labelPlacement;return{flexDirection:o==="top"||o==="bottom"?"column":"row",display:"flex",alignItems:o==="top"||o==="bottom"?"center":"flex-start",cursor:t?"not-allowed":"pointer",userSelect:"none"}});M.displayName="Root";M.displayName="Root";var _=x("span",function(e){var t=e.$checked,o=e.$disabled,r=e.$error,i=e.$isIndeterminate,c=e.$theme,a=e.$isFocusVisible,n=c.sizing,l=c.animation,u=o?c.colors.tickMarkFillDisabled:r?c.colors.tickMarkFillError:c.colors.tickMarkFill,s=encodeURIComponent(`
2
2
  <svg width="14" height="4" viewBox="0 0 14 4" fill="none" xmlns="http://www.w3.org/2000/svg">
3
3
  <path d="M14 0.5H0V3.5H14V0.5Z" fill="`.concat(u,`"/>
4
4
  </svg>
5
- `)),$=encodeURIComponent(`
5
+ `)),y=encodeURIComponent(`
6
6
  <svg width="17" height="13" viewBox="0 0 17 13" fill="none" xmlns="http://www.w3.org/2000/svg">
7
7
  <path d="M6.50002 12.6L0.400024 6.60002L2.60002 4.40002L6.50002 8.40002L13.9 0.900024L16.1 3.10002L6.50002 12.6Z" fill="`.concat(u,`"/>
8
8
  </svg>
9
- `)),g=c.borders.checkboxBorderRadius,h=ke(e);return{flex:"0 0 auto",transitionDuration:l.timing200,transitionTimingFunction:l.easeOutCurve,transitionProperty:"background-image, border-color, background-color",width:n.scale700,height:n.scale700,left:"4px",top:"4px",boxSizing:"border-box",borderLeftStyle:"solid",borderRightStyle:"solid",borderTopStyle:"solid",borderBottomStyle:"solid",borderLeftWidth:"3px",borderRightWidth:"3px",borderTopWidth:"3px",borderBottomWidth:"3px",borderLeftColor:h,borderRightColor:h,borderTopColor:h,borderBottomColor:h,borderTopLeftRadius:g,borderTopRightRadius:g,borderBottomRightRadius:g,borderBottomLeftRadius:g,outline:a&&t?"3px solid ".concat(c.colors.accent):"none",display:"inline-block",verticalAlign:"middle",backgroundImage:i?"url('data:image/svg+xml,".concat(s,"');"):t?"url('data:image/svg+xml,".concat($,"');"):null,backgroundColor:xe(e),backgroundRepeat:"no-repeat",backgroundPosition:"center",backgroundSize:"contain",marginTop:c.sizing.scale0,marginBottom:c.sizing.scale0,marginLeft:c.sizing.scale0,marginRight:c.sizing.scale0}});_.displayName="Checkmark";_.displayName="Checkmark";var I=w("div",function(e){var t=e.$theme,o=t.typography;return P(P(P({verticalAlign:"middle"},Te(e)),{},{color:we(e)},o.LabelMedium),{},{lineHeight:"24px"})});I.displayName="Label";I.displayName="Label";var H=w("input",{opacity:0,width:0,height:0,overflow:"hidden",margin:0,padding:0,position:"absolute"});H.displayName="Input";H.displayName="Input";var D=w("div",function(e){var t=e.$theme.colors.toggleFill;return e.$disabled?t=e.$theme.colors.toggleFillDisabled:e.$checked&&e.$error?t=e.$theme.colors.tickFillErrorSelected:e.$checked&&(t=e.$theme.colors.toggleFillChecked),{backgroundColor:t,borderTopLeftRadius:"50%",borderTopRightRadius:"50%",borderBottomRightRadius:"50%",borderBottomLeftRadius:"50%",boxShadow:e.$isFocusVisible?"0 0 0 3px ".concat(e.$theme.colors.accent):e.$isHovered&&!e.$disabled?e.$theme.lighting.shadow500:e.$theme.lighting.shadow400,outline:"none",height:e.$theme.sizing.scale700,width:e.$theme.sizing.scale700,transform:e.$checked?"translateX(".concat(e.$theme.direction==="rtl"?"-100%":"100%",")"):null,transition:"transform ".concat(e.$theme.animation.timing200)}});D.displayName="Toggle";D.displayName="Toggle";var z=w("div",function(e){var t=e.$theme.colors.toggleTrackFill;return e.$disabled?t=e.$theme.colors.toggleTrackFillDisabled:e.$error&&e.$checked&&(t=e.$theme.colors.tickFillError),{alignItems:"center",backgroundColor:t,borderTopLeftRadius:"7px",borderTopRightRadius:"7px",borderBottomRightRadius:"7px",borderBottomLeftRadius:"7px",display:"flex",height:e.$theme.sizing.scale550,marginTop:e.$theme.sizing.scale200,marginBottom:e.$theme.sizing.scale100,marginLeft:e.$theme.sizing.scale200,marginRight:e.$theme.sizing.scale100,width:e.$theme.sizing.scale1000}});z.displayName="ToggleTrack";z.displayName="ToggleTrack";function E(e){"@babel/helpers - typeof";return E=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},E(e)}function y(){return y=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var r in o)Object.prototype.hasOwnProperty.call(o,r)&&(e[r]=o[r])}return e},y.apply(this,arguments)}function Re(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Se(e,t){for(var o=0;o<t.length;o++){var r=t[o];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Le(e,t,o){return t&&Se(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ce(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&B(e,t)}function B(e,t){return B=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},B(e,t)}function Fe(e){var t=Pe();return function(){var r=L(e),i;if(t){var c=L(this).constructor;i=Reflect.construct(r,arguments,c)}else i=r.apply(this,arguments);return Oe(this,i)}}function Oe(e,t){if(t&&(E(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return v(e)}function v(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Pe(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function L(e){return L=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(o){return o.__proto__||Object.getPrototypeOf(o)},L(e)}function p(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}var Ee=function(t){return t.stopPropagation()},K=function(e){Ce(o,e);var t=Fe(o);function o(){var r;Re(this,o);for(var i=arguments.length,c=new Array(i),a=0;a<i;a++)c[a]=arguments[a];return r=t.call.apply(t,[this].concat(c)),p(v(r),"state",{isFocused:r.props.autoFocus||!1,isFocusVisible:!1,isHovered:!1,isActive:!1}),p(v(r),"onMouseEnter",function(n){r.setState({isHovered:!0}),r.props.onMouseEnter(n)}),p(v(r),"onMouseLeave",function(n){r.setState({isHovered:!1,isActive:!1}),r.props.onMouseLeave(n)}),p(v(r),"onMouseDown",function(n){r.setState({isActive:!0}),r.props.onMouseDown(n)}),p(v(r),"onMouseUp",function(n){r.setState({isActive:!1}),r.props.onMouseUp(n)}),p(v(r),"onFocus",function(n){r.setState({isFocused:!0}),r.props.onFocus(n),ae(n)&&r.setState({isFocusVisible:!0})}),p(v(r),"onBlur",function(n){r.setState({isFocused:!1}),r.props.onBlur(n),r.state.isFocusVisible!==!1&&r.setState({isFocusVisible:!1})}),r}return Le(o,[{key:"componentDidMount",value:function(){var i=this.props,c=i.autoFocus,a=i.inputRef;c&&a.current&&a.current.focus()}},{key:"render",value:function(){var i=this.props,c=i.overrides,a=c===void 0?{}:c,n=i.onChange,l=i.labelPlacement,u=l===void 0?this.props.checkmarkType===S.toggle?"left":"right":l,s=i.inputRef,$=i.isIndeterminate,g=i.error,h=i.disabled,d=i.value,m=i.name,b=i.type,C=i.checked,F=i.children,O=i.required,Y=i.title,j=a.Root,V=a.Checkmark,W=a.Label,A=a.Input,N=a.Toggle,U=a.ToggleTrack,Z=T(j)||M,J=T(V)||_,Q=T(W)||I,ee=T(A)||H,te=T(N)||D,re=T(U)||z,oe={onChange:n,onFocus:this.onFocus,onBlur:this.onBlur},ie={onMouseEnter:this.onMouseEnter,onMouseLeave:this.onMouseLeave,onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp},k={$isFocused:this.state.isFocused,$isFocusVisible:this.state.isFocusVisible,$isHovered:this.state.isHovered,$isActive:this.state.isActive,$error:g,$checked:C,$isIndeterminate:$,$required:O,$disabled:h,$value:d},X=F&&f.createElement(Q,y({$labelPlacement:u},k,x(W)),this.props.containsInteractiveElement?f.createElement("div",{onClick:function(ne){return ne.preventDefault()}},F):F);return f.createElement(Z,y({"data-baseweb":"checkbox",title:Y||null,$labelPlacement:u},k,ie,x(j)),(u==="top"||u==="left")&&X,this.props.checkmarkType===S.toggle?f.createElement(re,y({},k,x(U)),f.createElement(te,y({},k,x(N)))):f.createElement(J,y({},k,x(V))),f.createElement(ee,y({value:d,name:m,checked:C,required:O,"aria-label":this.props["aria-label"]||this.props.ariaLabel,"aria-checked":$?"mixed":C,"aria-describedby":this.props["aria-describedby"],"aria-errormessage":this.props["aria-errormessage"],"aria-invalid":g||null,"aria-required":O||null,disabled:h,type:b,ref:s,onClick:Ee},k,oe,x(A))),(u==="bottom"||u==="right")&&X)}}]),o}(f.Component);p(K,"defaultProps",{overrides:{},checked:!1,containsInteractiveElement:!1,disabled:!1,autoFocus:!1,isIndeterminate:!1,inputRef:f.createRef(),error:!1,type:"checkbox",checkmarkType:S.default,onChange:function(){},onMouseEnter:function(){},onMouseLeave:function(){},onMouseDown:function(){},onMouseUp:function(){},onFocus:function(){},onBlur:function(){}});function Be({element:e,disabled:t,widgetMgr:o,fragmentId:r}){var h;const[i,c]=ye({getStateFromWidgetMgr:Me,getDefaultStateFromProto:_e,getCurrStateFromProto:Ie,updateWidgetMgrState:He,element:e,widgetMgr:o,fragmentId:r}),a=f.useCallback(d=>{c({value:d.target.checked,fromUi:!0})},[c]),n=le(),{colors:l,spacing:u,sizes:s}=n,$=ce(n),g=t?l.fadedText40:l.bodyText;return R(pe,{className:"row-widget stCheckbox","data-testid":"stCheckbox",children:R(K,{checked:i,disabled:t,onChange:a,"aria-label":e.label,checkmarkType:e.type===ve.StyleType.TOGGLE?S.toggle:S.default,labelPlacement:$e.right,overrides:{Root:{style:({$isFocusVisible:d})=>({marginBottom:u.none,marginTop:u.none,backgroundColor:d?l.darkenedBgMix25:"",display:"flex",alignItems:"start"})},Toggle:{style:({$checked:d})=>{let m=$?l.bgColor:l.bodyText;return t&&(m=$?l.gray70:l.gray90),{width:`calc(${s.checkbox} - ${n.spacing.twoXS})`,height:`calc(${s.checkbox} - ${n.spacing.twoXS})`,transform:d?`translateX(${s.checkbox})`:"",backgroundColor:m,boxShadow:""}}},ToggleTrack:{style:({$checked:d,$isHovered:m})=>{let b=l.fadedText40;return m&&!t&&(b=l.fadedText20),d&&!t&&(b=l.primary),{marginRight:0,marginLeft:0,marginBottom:0,marginTop:n.spacing.twoXS,paddingLeft:n.spacing.threeXS,paddingRight:n.spacing.threeXS,width:`calc(2 * ${s.checkbox})`,minWidth:`calc(2 * ${s.checkbox})`,height:s.checkbox,minHeight:s.checkbox,borderBottomLeftRadius:n.radii.full,borderTopLeftRadius:n.radii.full,borderBottomRightRadius:n.radii.full,borderTopRightRadius:n.radii.full,backgroundColor:b}}},Checkmark:{style:({$isFocusVisible:d,$checked:m})=>{const b=m&&!t?l.primary:l.fadedText40;return{outline:0,width:s.checkbox,height:s.checkbox,marginTop:n.spacing.twoXS,marginLeft:0,marginBottom:0,boxShadow:d&&m?`0 0 0 0.2rem ${me(l.primary,.5)}`:"",borderLeftWidth:s.borderWidth,borderRightWidth:s.borderWidth,borderTopWidth:s.borderWidth,borderBottomWidth:s.borderWidth,borderLeftColor:b,borderRightColor:b,borderTopColor:b,borderBottomColor:b}}},Label:{style:{lineHeight:n.lineHeights.small,paddingLeft:n.spacing.sm,position:"relative",color:g}}},children:se(be,{visibility:ue((h=e.labelVisibility)==null?void 0:h.value),"data-testid":"stWidgetLabel",children:[R(de,{source:e.label,allowHTML:!1,isLabel:!0,largerLabel:!0}),e.help&&R(fe,{color:g,children:R(ge,{content:e.help,placement:he.TOP_RIGHT})})]})})})}function Me(e,t){return e.getBoolValue(t)}function _e(e){return e.default??null}function Ie(e){return e.value??null}function He(e,t,o,r){t.setBoolValue(e,o.value,{fromUi:o.fromUi},r)}const We=f.memo(Be);export{We as default};
9
+ `)),g=c.borders.checkboxBorderRadius,h=ke(e);return{flex:"0 0 auto",transitionDuration:l.timing200,transitionTimingFunction:l.easeOutCurve,transitionProperty:"background-image, border-color, background-color",width:n.scale700,height:n.scale700,left:"4px",top:"4px",boxSizing:"border-box",borderLeftStyle:"solid",borderRightStyle:"solid",borderTopStyle:"solid",borderBottomStyle:"solid",borderLeftWidth:"3px",borderRightWidth:"3px",borderTopWidth:"3px",borderBottomWidth:"3px",borderLeftColor:h,borderRightColor:h,borderTopColor:h,borderBottomColor:h,borderTopLeftRadius:g,borderTopRightRadius:g,borderBottomRightRadius:g,borderBottomLeftRadius:g,outline:a&&t?"3px solid ".concat(c.colors.accent):"none",display:"inline-block",verticalAlign:"middle",backgroundImage:i?"url('data:image/svg+xml,".concat(s,"');"):t?"url('data:image/svg+xml,".concat(y,"');"):null,backgroundColor:we(e),backgroundRepeat:"no-repeat",backgroundPosition:"center",backgroundSize:"contain",marginTop:c.sizing.scale0,marginBottom:c.sizing.scale0,marginLeft:c.sizing.scale0,marginRight:c.sizing.scale0}});_.displayName="Checkmark";_.displayName="Checkmark";var I=x("div",function(e){var t=e.$theme,o=t.typography;return P(P(P({verticalAlign:"middle"},Te(e)),{},{color:xe(e)},o.LabelMedium),{},{lineHeight:"24px"})});I.displayName="Label";I.displayName="Label";var z=x("input",{opacity:0,width:0,height:0,overflow:"hidden",margin:0,padding:0,position:"absolute"});z.displayName="Input";z.displayName="Input";var D=x("div",function(e){var t=e.$theme.colors.toggleFill;return e.$disabled?t=e.$theme.colors.toggleFillDisabled:e.$checked&&e.$error?t=e.$theme.colors.tickFillErrorSelected:e.$checked&&(t=e.$theme.colors.toggleFillChecked),{backgroundColor:t,borderTopLeftRadius:"50%",borderTopRightRadius:"50%",borderBottomRightRadius:"50%",borderBottomLeftRadius:"50%",boxShadow:e.$isFocusVisible?"0 0 0 3px ".concat(e.$theme.colors.accent):e.$isHovered&&!e.$disabled?e.$theme.lighting.shadow500:e.$theme.lighting.shadow400,outline:"none",height:e.$theme.sizing.scale700,width:e.$theme.sizing.scale700,transform:e.$checked?"translateX(".concat(e.$theme.direction==="rtl"?"-100%":"100%",")"):null,transition:"transform ".concat(e.$theme.animation.timing200)}});D.displayName="Toggle";D.displayName="Toggle";var H=x("div",function(e){var t=e.$theme.colors.toggleTrackFill;return e.$disabled?t=e.$theme.colors.toggleTrackFillDisabled:e.$error&&e.$checked&&(t=e.$theme.colors.tickFillError),{alignItems:"center",backgroundColor:t,borderTopLeftRadius:"7px",borderTopRightRadius:"7px",borderBottomRightRadius:"7px",borderBottomLeftRadius:"7px",display:"flex",height:e.$theme.sizing.scale550,marginTop:e.$theme.sizing.scale200,marginBottom:e.$theme.sizing.scale100,marginLeft:e.$theme.sizing.scale200,marginRight:e.$theme.sizing.scale100,width:e.$theme.sizing.scale1000}});H.displayName="ToggleTrack";H.displayName="ToggleTrack";function B(e){"@babel/helpers - typeof";return B=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},B(e)}function $(){return $=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var r in o)Object.prototype.hasOwnProperty.call(o,r)&&(e[r]=o[r])}return e},$.apply(this,arguments)}function Re(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Se(e,t){for(var o=0;o<t.length;o++){var r=t[o];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Le(e,t,o){return t&&Se(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ce(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&E(e,t)}function E(e,t){return E=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},E(e,t)}function Fe(e){var t=Pe();return function(){var r=L(e),i;if(t){var c=L(this).constructor;i=Reflect.construct(r,arguments,c)}else i=r.apply(this,arguments);return Oe(this,i)}}function Oe(e,t){if(t&&(B(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return v(e)}function v(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Pe(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function L(e){return L=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(o){return o.__proto__||Object.getPrototypeOf(o)},L(e)}function p(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}var Be=function(t){return t.stopPropagation()},K=function(e){Ce(o,e);var t=Fe(o);function o(){var r;Re(this,o);for(var i=arguments.length,c=new Array(i),a=0;a<i;a++)c[a]=arguments[a];return r=t.call.apply(t,[this].concat(c)),p(v(r),"state",{isFocused:r.props.autoFocus||!1,isFocusVisible:!1,isHovered:!1,isActive:!1}),p(v(r),"onMouseEnter",function(n){r.setState({isHovered:!0}),r.props.onMouseEnter(n)}),p(v(r),"onMouseLeave",function(n){r.setState({isHovered:!1,isActive:!1}),r.props.onMouseLeave(n)}),p(v(r),"onMouseDown",function(n){r.setState({isActive:!0}),r.props.onMouseDown(n)}),p(v(r),"onMouseUp",function(n){r.setState({isActive:!1}),r.props.onMouseUp(n)}),p(v(r),"onFocus",function(n){r.setState({isFocused:!0}),r.props.onFocus(n),ae(n)&&r.setState({isFocusVisible:!0})}),p(v(r),"onBlur",function(n){r.setState({isFocused:!1}),r.props.onBlur(n),r.state.isFocusVisible!==!1&&r.setState({isFocusVisible:!1})}),r}return Le(o,[{key:"componentDidMount",value:function(){var i=this.props,c=i.autoFocus,a=i.inputRef;c&&a.current&&a.current.focus()}},{key:"render",value:function(){var i=this.props,c=i.overrides,a=c===void 0?{}:c,n=i.onChange,l=i.labelPlacement,u=l===void 0?this.props.checkmarkType===S.toggle?"left":"right":l,s=i.inputRef,y=i.isIndeterminate,g=i.error,h=i.disabled,d=i.value,m=i.name,b=i.type,C=i.checked,F=i.children,O=i.required,Y=i.title,j=a.Root,V=a.Checkmark,W=a.Label,N=a.Input,A=a.Toggle,U=a.ToggleTrack,Z=T(j)||M,J=T(V)||_,Q=T(W)||I,ee=T(N)||z,te=T(A)||D,re=T(U)||H,oe={onChange:n,onFocus:this.onFocus,onBlur:this.onBlur},ie={onMouseEnter:this.onMouseEnter,onMouseLeave:this.onMouseLeave,onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp},k={$isFocused:this.state.isFocused,$isFocusVisible:this.state.isFocusVisible,$isHovered:this.state.isHovered,$isActive:this.state.isActive,$error:g,$checked:C,$isIndeterminate:y,$required:O,$disabled:h,$value:d},X=F&&f.createElement(Q,$({$labelPlacement:u},k,w(W)),this.props.containsInteractiveElement?f.createElement("div",{onClick:function(ne){return ne.preventDefault()}},F):F);return f.createElement(Z,$({"data-baseweb":"checkbox",title:Y||null,$labelPlacement:u},k,ie,w(j)),(u==="top"||u==="left")&&X,this.props.checkmarkType===S.toggle?f.createElement(re,$({},k,w(U)),f.createElement(te,$({},k,w(A)))):f.createElement(J,$({},k,w(V))),f.createElement(ee,$({value:d,name:m,checked:C,required:O,"aria-label":this.props["aria-label"]||this.props.ariaLabel,"aria-checked":y?"mixed":C,"aria-describedby":this.props["aria-describedby"],"aria-errormessage":this.props["aria-errormessage"],"aria-invalid":g||null,"aria-required":O||null,disabled:h,type:b,ref:s,onClick:Be},k,oe,w(N))),(u==="bottom"||u==="right")&&X)}}]),o}(f.Component);p(K,"defaultProps",{overrides:{},checked:!1,containsInteractiveElement:!1,disabled:!1,autoFocus:!1,isIndeterminate:!1,inputRef:f.createRef(),error:!1,type:"checkbox",checkmarkType:S.default,onChange:function(){},onMouseEnter:function(){},onMouseLeave:function(){},onMouseDown:function(){},onMouseUp:function(){},onFocus:function(){},onBlur:function(){}});function Ee({element:e,disabled:t,widgetMgr:o,fragmentId:r}){var h;const[i,c]=$e({getStateFromWidgetMgr:Me,getDefaultStateFromProto:_e,getCurrStateFromProto:Ie,updateWidgetMgrState:ze,element:e,widgetMgr:o,fragmentId:r}),a=f.useCallback(d=>{c({value:d.target.checked,fromUi:!0})},[c]),n=le(),{colors:l,spacing:u,sizes:s}=n,y=ce(n),g=t?l.fadedText40:l.bodyText;return R(pe,{className:"row-widget stCheckbox","data-testid":"stCheckbox",children:R(K,{checked:i,disabled:t,onChange:a,"aria-label":e.label,checkmarkType:e.type===ve.StyleType.TOGGLE?S.toggle:S.default,labelPlacement:ye.right,overrides:{Root:{style:({$isFocusVisible:d})=>({marginBottom:u.none,marginTop:u.none,backgroundColor:d?l.darkenedBgMix25:"",display:"flex",alignItems:"start"})},Toggle:{style:({$checked:d})=>{let m=y?l.bgColor:l.bodyText;return t&&(m=y?l.gray70:l.gray90),{width:`calc(${s.checkbox} - ${n.spacing.twoXS})`,height:`calc(${s.checkbox} - ${n.spacing.twoXS})`,transform:d?`translateX(${s.checkbox})`:"",backgroundColor:m,boxShadow:""}}},ToggleTrack:{style:({$checked:d,$isHovered:m})=>{let b=l.fadedText40;return m&&!t&&(b=l.fadedText20),d&&!t&&(b=l.primary),{marginRight:0,marginLeft:0,marginBottom:0,marginTop:n.spacing.twoXS,paddingLeft:n.spacing.threeXS,paddingRight:n.spacing.threeXS,width:`calc(2 * ${s.checkbox})`,minWidth:`calc(2 * ${s.checkbox})`,height:s.checkbox,minHeight:s.checkbox,borderBottomLeftRadius:n.radii.full,borderTopLeftRadius:n.radii.full,borderBottomRightRadius:n.radii.full,borderTopRightRadius:n.radii.full,backgroundColor:b}}},Checkmark:{style:({$isFocusVisible:d,$checked:m})=>{const b=m&&!t?l.primary:l.fadedText40;return{outline:0,width:s.checkbox,height:s.checkbox,marginTop:n.spacing.twoXS,marginLeft:0,marginBottom:0,boxShadow:d&&m?`0 0 0 0.2rem ${me(l.primary,.5)}`:"",borderLeftWidth:s.borderWidth,borderRightWidth:s.borderWidth,borderTopWidth:s.borderWidth,borderBottomWidth:s.borderWidth,borderLeftColor:b,borderRightColor:b,borderTopColor:b,borderBottomColor:b}}},Label:{style:{lineHeight:n.lineHeights.small,paddingLeft:n.spacing.sm,position:"relative",color:g}}},children:se(be,{visibility:ue((h=e.labelVisibility)==null?void 0:h.value),"data-testid":"stWidgetLabel",children:[R(de,{source:e.label,allowHTML:!1,isLabel:!0,largerLabel:!0}),e.help&&R(fe,{color:g,children:R(ge,{content:e.help,placement:he.TOP_RIGHT})})]})})})}function Me(e,t){return e.getBoolValue(t)}function _e(e){return e.default??null}function Ie(e){return e.value??null}function ze(e,t,o,r){t.setBoolValue(e,o.value,{fromUi:o.fromUi},r)}const We=f.memo(Ee);export{We as default};