streamlit-nightly 1.53.2.dev20260131__py3-none-any.whl → 1.53.2.dev20260203__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 (205) hide show
  1. streamlit/commands/execution_control.py +2 -2
  2. streamlit/commands/logo.py +6 -10
  3. streamlit/components/v2/component_path_utils.py +17 -29
  4. streamlit/config.py +4 -2
  5. streamlit/delta_generator.py +2 -0
  6. streamlit/elements/lib/column_types.py +6 -2
  7. streamlit/elements/lib/utils.py +6 -6
  8. streamlit/elements/markdown.py +0 -1
  9. streamlit/elements/metric.py +2 -1
  10. streamlit/elements/widgets/button_group.py +6 -276
  11. streamlit/elements/widgets/feedback.py +322 -0
  12. streamlit/elements/widgets/number_input.py +2 -1
  13. streamlit/elements/widgets/slider.py +2 -1
  14. streamlit/material_icon_names.py +1 -1
  15. streamlit/path_security.py +98 -0
  16. streamlit/proto/AudioInput_pb2.py +4 -4
  17. streamlit/proto/AudioInput_pb2.pyi +3 -3
  18. streamlit/proto/Audio_pb2.py +2 -2
  19. streamlit/proto/BackMsg_pb2.pyi +2 -10
  20. streamlit/proto/Balloons_pb2.pyi +0 -2
  21. streamlit/proto/Block_pb2.py +35 -35
  22. streamlit/proto/ButtonGroup_pb2.py +10 -12
  23. streamlit/proto/ButtonGroup_pb2.pyi +6 -41
  24. streamlit/proto/Button_pb2.py +2 -2
  25. streamlit/proto/CameraInput_pb2.py +4 -4
  26. streamlit/proto/CameraInput_pb2.pyi +3 -3
  27. streamlit/proto/ChatInput_pb2.py +2 -2
  28. streamlit/proto/Checkbox_pb2.py +6 -6
  29. streamlit/proto/Checkbox_pb2.pyi +3 -3
  30. streamlit/proto/Code_pb2.py +2 -2
  31. streamlit/proto/ColorPicker_pb2.py +4 -4
  32. streamlit/proto/ColorPicker_pb2.pyi +3 -3
  33. streamlit/proto/Common_pb2.py +6 -6
  34. streamlit/proto/DateInput_pb2.py +4 -4
  35. streamlit/proto/DateInput_pb2.pyi +3 -3
  36. streamlit/proto/DateTimeInput_pb2.py +4 -4
  37. streamlit/proto/DateTimeInput_pb2.pyi +3 -3
  38. streamlit/proto/DeckGlJsonChart_pb2.py +2 -2
  39. streamlit/proto/Delta_pb2.py +2 -2
  40. streamlit/proto/DocString_pb2.py +1 -1
  41. streamlit/proto/Element_pb2.py +4 -4
  42. streamlit/proto/Element_pb2.pyi +9 -9
  43. streamlit/proto/Feedback_pb2.py +28 -0
  44. streamlit/proto/Feedback_pb2.pyi +93 -0
  45. streamlit/proto/FileUploader_pb2.py +4 -4
  46. streamlit/proto/FileUploader_pb2.pyi +3 -3
  47. streamlit/proto/ForwardMsg_pb2.py +8 -8
  48. streamlit/proto/GraphVizChart_pb2.py +2 -2
  49. streamlit/proto/IFrame_pb2.py +3 -3
  50. streamlit/proto/Image_pb2.py +4 -4
  51. streamlit/proto/Image_pb2.pyi +1 -7
  52. streamlit/proto/{BokehChart_pb2.py → LabelVisibility_pb2.py} +7 -5
  53. streamlit/proto/{LabelVisibilityMessage_pb2.pyi → LabelVisibility_pb2.pyi} +14 -14
  54. streamlit/proto/Markdown_pb2.py +4 -4
  55. streamlit/proto/Markdown_pb2.pyi +1 -5
  56. streamlit/proto/Metric_pb2.py +10 -10
  57. streamlit/proto/Metric_pb2.pyi +3 -3
  58. streamlit/proto/MultiSelect_pb2.py +4 -4
  59. streamlit/proto/MultiSelect_pb2.pyi +3 -3
  60. streamlit/proto/NewSession_pb2.py +38 -26
  61. streamlit/proto/NewSession_pb2.pyi +42 -8
  62. streamlit/proto/NumberInput_pb2.py +6 -6
  63. streamlit/proto/NumberInput_pb2.pyi +3 -3
  64. streamlit/proto/PlotlyChart_pb2.py +2 -2
  65. streamlit/proto/Radio_pb2.py +4 -4
  66. streamlit/proto/Radio_pb2.pyi +3 -3
  67. streamlit/proto/Selectbox_pb2.py +4 -4
  68. streamlit/proto/Selectbox_pb2.pyi +3 -6
  69. streamlit/proto/Slider_pb2.py +8 -8
  70. streamlit/proto/Slider_pb2.pyi +3 -3
  71. streamlit/proto/Snow_pb2.pyi +0 -2
  72. streamlit/proto/TextArea_pb2.py +4 -4
  73. streamlit/proto/TextArea_pb2.pyi +3 -3
  74. streamlit/proto/TextInput_pb2.py +6 -6
  75. streamlit/proto/TextInput_pb2.pyi +3 -3
  76. streamlit/proto/TimeInput_pb2.py +4 -4
  77. streamlit/proto/TimeInput_pb2.pyi +3 -3
  78. streamlit/proto/Video_pb2.py +2 -2
  79. streamlit/runtime/app_session.py +9 -1
  80. streamlit/static/index.html +2 -2
  81. streamlit/static/manifest.json +325 -310
  82. streamlit/static/static/css/{index.BUP6fTcR.css → index.C8MrxwGF.css} +1 -1
  83. streamlit/static/static/js/{ErrorOutline.esm.DC6KVDKK.js → ErrorOutline.esm.C9uHPmIj.js} +1 -1
  84. streamlit/static/static/js/{FileDownload.esm.Z9hRQIHi.js → FileDownload.esm.D-YPxF3t.js} +1 -1
  85. streamlit/static/static/js/{FileHelper.DqvW90pm.js → FileHelper.DQSH0zYW.js} +1 -1
  86. streamlit/static/static/js/{FormClearHelper.DTFnX0js.js → FormClearHelper.DQoXcOWo.js} +1 -1
  87. streamlit/static/static/js/{InputInstructions.CdzsN_Va.js → InputInstructions.C7VMyGT7.js} +1 -1
  88. streamlit/static/static/js/{Particles.12xFSjcn.js → Particles.BdQSRZde.js} +1 -1
  89. streamlit/static/static/js/{ProgressBar.Dg-oMbWg.js → ProgressBar.DNF_pWKr.js} +2 -2
  90. streamlit/static/static/js/{StreamlitSyntaxHighlighter.rbzmcipw.js → StreamlitSyntaxHighlighter.Cys9Bt18.js} +2 -2
  91. streamlit/static/static/js/{TableChart.esm.CzJtGIR-.js → TableChart.esm.B9SMgSK4.js} +1 -1
  92. streamlit/static/static/js/{Toolbar.COH7NaOE.js → Toolbar.BXfC9Z-W.js} +1 -1
  93. streamlit/static/static/js/{WidgetLabelHelpIconInline.Dlc8f0Ji.js → WidgetLabelHelpIconInline.gkreC55g.js} +1 -1
  94. streamlit/static/static/js/{base-input.Q-zJLgRK.js → base-input.iB32RS3w.js} +4 -4
  95. streamlit/static/static/js/{checkbox.BKgWNdeI.js → checkbox.Bqz68SYq.js} +1 -1
  96. streamlit/static/static/js/{createDownloadLinkElement.6oO-YlYv.js → createDownloadLinkElement.YxVC9Qur.js} +1 -1
  97. streamlit/static/static/js/data-grid-overlay-editor.sBsdk5Xg.js +1 -0
  98. streamlit/static/static/js/{downloader.BBXcXdX1.js → downloader.Bzxqt3AW.js} +1 -1
  99. streamlit/static/static/js/{embed.CJzOXYBF.js → embed.CDzakah3.js} +1 -1
  100. streamlit/static/static/js/{es6.CdxPQzwJ.js → es6.CxCc4bfn.js} +2 -2
  101. streamlit/static/static/js/formatNumber.L8T7D36k.js +1 -0
  102. streamlit/static/static/js/{iconPosition.BVScIr6G.js → iconPosition.C47DkA-1.js} +1 -1
  103. streamlit/static/static/js/{iframeResizer.contentWindow.D_QHVqPM.js → iframeResizer.contentWindow.uEFLXEg3.js} +1 -1
  104. streamlit/static/static/js/{index.CvtybR-u.js → index.B3zULhHv.js} +1 -1
  105. streamlit/static/static/js/{index.DAyGxxdm.js → index.B60AZFRh.js} +3 -3
  106. streamlit/static/static/js/{index.BED2_zc7.js → index.BG4RxMOI.js} +1 -1
  107. streamlit/static/static/js/{index.CPc_uZux.js → index.BHyzKS4e.js} +45 -45
  108. streamlit/static/static/js/{index.Dud7RRHc.js → index.BVTW_o-a.js} +1 -1
  109. streamlit/static/static/js/{index.BQnLeHnr.js → index.BV_YgIHe.js} +3 -3
  110. streamlit/static/static/js/index.B_LfkwqU.js +2 -0
  111. streamlit/static/static/js/{index.DCe7fo-m.js → index.Ba8L-ulI.js} +1 -1
  112. streamlit/static/static/js/{index.DAfIQKfP.js → index.Bh5BZaHG.js} +2 -2
  113. streamlit/static/static/js/{index.DU68jVpM.js → index.Bnwh8oZr.js} +16 -16
  114. streamlit/static/static/js/index.BrZtYm2A.js +2 -0
  115. streamlit/static/static/js/index.BsrhCS7f.js +1 -0
  116. streamlit/static/static/js/{index.CxoREvnF.js → index.BuJPJSD7.js} +2 -2
  117. streamlit/static/static/js/{index.6DFY6LUF.js → index.BvHsyiyy.js} +1 -1
  118. streamlit/static/static/js/{index.Biyf9aUg.js → index.BwTkGOAy.js} +2 -2
  119. streamlit/static/static/js/{index.DNfyKqhQ.js → index.BwvxzVOo.js} +1 -1
  120. streamlit/static/static/js/{index.iXh5nbLZ.js → index.BzdcdLDK.js} +1 -1
  121. streamlit/static/static/js/{index.YULCxEtm.js → index.C1d2QjTR.js} +1 -1
  122. streamlit/static/static/js/index.C1uZrWog.js +1 -0
  123. streamlit/static/static/js/{index.C5oqIM3a.js → index.C5-TpWis.js} +1 -1
  124. streamlit/static/static/js/{index.D6OexhdL.js → index.C6dhwBSe.js} +1 -1
  125. streamlit/static/static/js/{index.y-pa6LIX.js → index.CAbQaUvi.js} +1 -1
  126. streamlit/static/static/js/{index.BSpYHDvk.js → index.CAbafj7s.js} +1 -1
  127. streamlit/static/static/js/{index.BDtN2n7T.js → index.CCLteRW6.js} +1 -1
  128. streamlit/static/static/js/{index.mSdC1FV6.js → index.CQ713nQM.js} +1 -1
  129. streamlit/static/static/js/index.CcBYyLfq.js +2 -0
  130. streamlit/static/static/js/{index.CBE2cIbj.js → index.CjBDVb1a.js} +1 -1
  131. streamlit/static/static/js/{index.BxQxTpWl.js → index.Ck0ZkOfK.js} +1 -1
  132. streamlit/static/static/js/{index.B80gSxrS.js → index.CzwJzgQs.js} +1 -1
  133. streamlit/static/static/js/{index.DyfvmNCy.js → index.D-9VyyiA.js} +1 -1
  134. streamlit/static/static/js/{index.nL1fkE1D.js → index.D2R3Co5f.js} +1 -1
  135. streamlit/static/static/js/{index.DZmBuE3z.js → index.D7L9gHlE.js} +3 -3
  136. streamlit/static/static/js/{index.BqxwnMem.js → index.DEKnCsY-.js} +2 -2
  137. streamlit/static/static/js/{index.D9v2Y8Gk.js → index.DHrByikW.js} +1 -1
  138. streamlit/static/static/js/index.DN_oudQl.js +1 -0
  139. streamlit/static/static/js/{index.DrcbvB2t.js → index.DO55kRo5.js} +1 -1
  140. streamlit/static/static/js/{index.BqbKiDp2.js → index.D_cvtSlg.js} +1 -1
  141. streamlit/static/static/js/{index.CrY1BsL3.js → index.DgqmsDCJ.js} +1 -1
  142. streamlit/static/static/js/{index.BtOoVQt7.js → index.DjgdCvlK.js} +1 -1
  143. streamlit/static/static/js/{index.BxMkW82k.js → index.DqhZqWYB.js} +1 -1
  144. streamlit/static/static/js/{index.bQJYmJ2T.js → index.Dtbj_oyb.js} +1 -1
  145. streamlit/static/static/js/{index.CUYi3FrD.js → index.QXukCzoh.js} +1 -1
  146. streamlit/static/static/js/{index.BiCbrx53.js → index.XJY9qZ6a.js} +1 -1
  147. streamlit/static/static/js/{index.GieKl4BG.js → index.aZRhdEuX.js} +1 -1
  148. streamlit/static/static/js/{index._1zqETQ9.js → index.fUsWkW8E.js} +1 -1
  149. streamlit/static/static/js/index.h2N-W51I.js +11 -0
  150. streamlit/static/static/js/index.iUHLeAvv.js +1 -0
  151. streamlit/static/static/js/{index.DRoJNzFX.js → index.kBgXO7Vv.js} +1 -1
  152. streamlit/static/static/js/{index.BSYebegS.js → index.kEL0HsUR.js} +1 -1
  153. streamlit/static/static/js/index.w7yKy9fh.js +6 -0
  154. streamlit/static/static/js/{input.BcC6sPE_.js → input.BCHJn1Cw.js} +1 -1
  155. streamlit/static/static/js/{main.TU5_aabd.js → main.23ZP6f1E.js} +1 -1
  156. streamlit/static/static/js/{memory.By_OTlI4.js → memory.D8f8Q4mO.js} +1 -1
  157. streamlit/static/static/js/number-overlay-editor.ZWvSpjJ5.js +9 -0
  158. streamlit/static/static/js/{pandasStylerUtils.3IiIKU9-.js → pandasStylerUtils.DlZ2GBs_.js} +1 -1
  159. streamlit/static/static/js/{sandbox.DnxTbWzV.js → sandbox.BH6D3KL9.js} +1 -1
  160. streamlit/static/static/js/sprintfjs.CtrdaGLQ.js +1 -0
  161. streamlit/static/static/js/{styled-components.BeEcZ0vW.js → styled-components.iD1HRMLc.js} +1 -1
  162. streamlit/static/static/js/{throttle.emUyC44c.js → throttle.DR7d9vp_.js} +1 -1
  163. streamlit/static/static/js/{timepicker.DZ_ZufYF.js → timepicker.Bd34xjcG.js} +4 -4
  164. streamlit/static/static/js/{toConsumableArray.DDV1bN1-.js → toConsumableArray.BDTTq1c5.js} +2 -2
  165. streamlit/static/static/js/uniqueId.Bd_Iuzvc.js +1 -0
  166. streamlit/static/static/js/useBasicWidgetState.BXKaD8DQ.js +1 -0
  167. streamlit/static/static/js/{useIntlLocale.BBDLbTq9.js → useIntlLocale.CysOvegI.js} +1 -1
  168. streamlit/static/static/js/{useTextInputAutoExpand.BIApLJKn.js → useTextInputAutoExpand.CVd5Hf2S.js} +1 -1
  169. streamlit/static/static/js/{useUpdateUiValue.DQ4RuJNC.js → useUpdateUiValue.CIUgfO8X.js} +1 -1
  170. streamlit/static/static/js/{useWaveformController.B0olyXLQ.js → useWaveformController.CDLqlnLv.js} +1 -1
  171. streamlit/static/static/js/{withCalculatedWidth.DYeqePuh.js → withCalculatedWidth.Ce1Zblb2.js} +1 -1
  172. streamlit/static/static/js/{withFullScreenWrapper.DtkUCO_d.js → withFullScreenWrapper.DBm7N75M.js} +1 -1
  173. streamlit/static/static/media/MaterialSymbols-Rounded.CnH1S47a.woff2 +0 -0
  174. streamlit/testing/v1/app_test.py +21 -5
  175. streamlit/testing/v1/element_tree.py +65 -2
  176. streamlit/web/server/app_static_file_handler.py +9 -0
  177. streamlit/web/server/bidi_component_request_handler.py +4 -4
  178. streamlit/web/server/component_file_utils.py +14 -6
  179. streamlit/web/server/component_request_handler.py +2 -2
  180. streamlit/web/server/starlette/starlette_app.py +7 -1
  181. streamlit/web/server/starlette/starlette_path_security_middleware.py +97 -0
  182. streamlit/web/server/starlette/starlette_routes.py +6 -3
  183. streamlit/web/server/starlette/starlette_static_routes.py +14 -4
  184. {streamlit_nightly-1.53.2.dev20260131.dist-info → streamlit_nightly-1.53.2.dev20260203.dist-info}/METADATA +1 -1
  185. {streamlit_nightly-1.53.2.dev20260131.dist-info → streamlit_nightly-1.53.2.dev20260203.dist-info}/RECORD +188 -184
  186. streamlit/proto/BokehChart_pb2.pyi +0 -56
  187. streamlit/proto/LabelVisibilityMessage_pb2.py +0 -28
  188. streamlit/static/static/js/data-grid-overlay-editor.CO0xdNiG.js +0 -1
  189. streamlit/static/static/js/formatNumber.DB5irY8c.js +0 -1
  190. streamlit/static/static/js/index.BBTKOM0z.js +0 -6
  191. streamlit/static/static/js/index.CE2WIFD1.js +0 -2
  192. streamlit/static/static/js/index.Cpu2p5bH.js +0 -1
  193. streamlit/static/static/js/index.CtbETWQK.js +0 -2
  194. streamlit/static/static/js/index.DAnczAW2.js +0 -2
  195. streamlit/static/static/js/index.DhRAGiPR.js +0 -1
  196. streamlit/static/static/js/index.DyXcT2tD.js +0 -11
  197. streamlit/static/static/js/index.tuFFlbxa.js +0 -1
  198. streamlit/static/static/js/number-overlay-editor.FSRaRpbU.js +0 -9
  199. streamlit/static/static/js/sprintf.DpPCfzXw.js +0 -1
  200. streamlit/static/static/js/uniqueId.DTwvAE-J.js +0 -1
  201. streamlit/static/static/js/useBasicWidgetState.DvpdEDYZ.js +0 -1
  202. streamlit/static/static/media/MaterialSymbols-Rounded.C7IFxh57.woff2 +0 -0
  203. {streamlit_nightly-1.53.2.dev20260131.dist-info → streamlit_nightly-1.53.2.dev20260203.dist-info}/WHEEL +0 -0
  204. {streamlit_nightly-1.53.2.dev20260131.dist-info → streamlit_nightly-1.53.2.dev20260203.dist-info}/entry_points.txt +0 -0
  205. {streamlit_nightly-1.53.2.dev20260131.dist-info → streamlit_nightly-1.53.2.dev20260203.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,2 @@
1
+ import{ao as Z,w as q,r as c,bg as J,l as Q,a6 as Y,bh as v,j as _,o as ee,p as te,P as re,bi as ne,ae as oe,bj as ie,b as ae,B as U,c as ue,D as le}from"./index.BHyzKS4e.js";import{W as ce}from"./WidgetLabelHelpIconInline.gkreC55g.js";import{u as se}from"./useBasicWidgetState.BXKaD8DQ.js";import"./FormClearHelper.DQoXcOWo.js";var fe={secondary:"secondary"},G={default:"default"},pe={default:"default"},k=Object.freeze({radio:"radio",checkbox:"checkbox"}),z=Z("div",function(e){var t=e.$shape,r=e.$length,n=e.$theme,o=r===1?void 0:t!==G.default?"-".concat(n.sizing.scale100):"-0.5px";return{display:"flex",marginLeft:o,marginRight:o}});z.displayName="StyledRoot";z.displayName="StyledRoot";function $(e){"@babel/helpers - typeof";return $=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)}function D(){return D=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},D.apply(this,arguments)}function x(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function de(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?x(Object(r),!0).forEach(function(n){N(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):x(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function ye(e,t){return ge(e)||he(e,t)||me(e,t)||be()}function be(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
2
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function me(e,t){if(e){if(typeof e=="string")return K(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return K(e,t)}}function K(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function he(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],o=!0,i=!1,a,p;try{for(r=r.call(e);!(o=(a=r.next()).done)&&(n.push(a.value),!(t&&n.length===t));o=!0);}catch(s){i=!0,p=s}finally{try{!o&&r.return!=null&&r.return()}finally{if(i)throw p}}return n}}function ge(e){if(Array.isArray(e))return e}function ve(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Se(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Oe(e,t,r){return t&&Se(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _e(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&&M(e,t)}function M(e,t){return M=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},M(e,t)}function we(e){var t=Ee();return function(){var n=C(e),o;if(t){var i=C(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return Pe(this,o)}}function Pe(e,t){if(t&&($(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return F(e)}function F(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ee(){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 C(e){return C=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},C(e)}function N(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Le(e,t){return!Array.isArray(e)&&typeof e!="number"?!1:Array.isArray(e)?e.includes(t):e===t}var H=(function(e){_e(r,e);var t=we(r);function r(){var n;ve(this,r);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return n=t.call.apply(t,[this].concat(i)),N(F(n),"childRefs",{}),n}return Oe(r,[{key:"render",value:function(){var o=this,i=this.props,a=i.overrides,p=a===void 0?{}:a,s=i.mode,S=s===void 0?k.checkbox:s,y=i.children,f=i.selected,m=i.disabled,l=i.onClick,j=i.kind,d=i.shape,A=i.size,w=q(p.Root,z),R=ye(w,2),P=R[0],O=R[1],E=this.props["aria-label"]||this.props.ariaLabel,h=S===k.radio,W=c.Children.count(y);return c.createElement(J.Consumer,null,function(X){return c.createElement(P,D({"aria-label":E||X.buttongroup.ariaLabel,"data-baseweb":"button-group",role:h?"radiogroup":"group",$shape:d,$length:y.length},O),c.Children.map(y,function(b,L){if(!c.isValidElement(b))return null;var B=b.props.isSelected?b.props.isSelected:Le(f,L);return h&&(o.childRefs[L]=c.createRef()),c.cloneElement(b,{disabled:m||b.props.disabled,isSelected:B,ref:h?o.childRefs[L]:void 0,tabIndex:!h||B||h&&(!f||f===-1)&&L===0?0:-1,onKeyDown:function(u){if(h){var g=Number(f)?Number(f):0;if(u.key==="ArrowUp"||u.key==="ArrowLeft"){u.preventDefault&&u.preventDefault();var I=g-1<0?W-1:g-1;l&&l(u,I),o.childRefs[I].current&&o.childRefs[I].current.focus()}if(u.key==="ArrowDown"||u.key==="ArrowRight"){u.preventDefault&&u.preventDefault();var T=g+1>W-1?0:g+1;l&&l(u,T),o.childRefs[T].current&&o.childRefs[T].current.focus()}}},kind:j,onClick:function(u){m||(b.props.onClick&&b.props.onClick(u),l&&l(u,L))},shape:d,size:A,overrides:de({BaseButton:{style:function(u){var g=u.$theme;return y.length===1?{}:d!==G.default?{marginLeft:g.sizing.scale100,marginRight:g.sizing.scale100}:{marginLeft:"0.5px",marginRight:"0.5px"}},props:{"aria-checked":B,role:h?"radio":"checkbox"}}},b.props.overrides)})}))})}}]),r})(c.Component);N(H,"defaultProps",{disabled:!1,onClick:function(){},shape:G.default,size:pe.default,kind:fe.secondary});function Re(e,t){return t.includes(e)?t.filter(r=>r!==e):[...t,e]}function ke(e,t,r){return e===v.ClickMode.MULTI_SELECT?Re(t,r??[]):r?.includes(t)?[]:[t]}function Ce(e){return e.length===0?-1:e[0]}function je(e,t,r,n){t.setIntArrayValue(e,r.value,{fromUi:r.fromUi},n)}function Ae(e,t,r){const n=r===v.Style.PILLS?U.PILLS:U.SEGMENTED_CONTROL,o=ue.MEDIUM;return{element:_(le,{icon:t,label:e,iconSize:"base",useSmallerFont:!0}),kind:n,size:o}}function Be(e,t){return e&&(t=`${t}Active`),t}function Ie(e,t,r){const n={flexWrap:"wrap",maxWidth:r?"100%":"fit-content",margin:"0 0"},o=r?"100%":"auto";switch(e){case v.Style.PILLS:return{...n,columnGap:t.twoXS,rowGap:t.twoXS,width:o};case v.Style.SEGMENTED_CONTROL:return{...n,columnGap:t.none,rowGap:t.twoXS,width:o};default:return n}}function Te(e,t,r,n,o){const i=r.includes(t);return c.forwardRef(function(p,s){const{element:S,kind:y,size:f}=Ae(e.content??"",e.contentIcon??void 0,n),m=Be(i,y);return _(ae,{...p,size:f,kind:m,containerWidth:o,children:S})})}function $e(e,t){return e.getIntArrayValue(t)}function De(e){return e.default??[]}function Me(e){return e.value??[]}function Ge(e){const{disabled:t,element:r,fragmentId:n,widgetMgr:o,widthConfig:i}=e,{clickMode:a,options:p,style:s,label:S,labelVisibility:y,help:f}=r,m=Q(),[l,j]=se({getStateFromWidgetMgr:$e,getDefaultStateFromProto:De,getCurrStateFromProto:Me,updateWidgetMgrState:je,element:r,widgetMgr:o,fragmentId:n}),d=Y(i),A=(P,O)=>{const E=ke(a,O,l);j({value:E,fromUi:!0})};let w;a===v.ClickMode.SINGLE_SELECT?w=k.radio:a===v.ClickMode.MULTI_SELECT&&(w=k.checkbox);const R=c.useMemo(()=>p.map((P,O)=>{const E=Te(P,O,l,s,d);return _(E,{},`${P.content}-${O}`)}),[p,s,l,d]);return ee(ie,{className:"stButtonGroup","data-testid":"stButtonGroup",containerWidth:d,children:[_(oe,{label:S,disabled:t,labelVisibility:te(y?.value??ne.LabelVisibilityOptions.COLLAPSED),children:f&&_(ce,{content:f,placement:re.TOP,label:S})}),_(H,{disabled:t,mode:w,onClick:A,selected:a===v.ClickMode.MULTI_SELECT?l:Ce(l),overrides:{Root:{style:c.useCallback(()=>Ie(s,m.spacing,d),[s,m.spacing,d])}},children:R})]})}const Ue=c.memo(Ge);export{Ue as default};
@@ -0,0 +1 @@
1
+ import{z as k,r as l,a6 as C,j as d,Y as _,a7 as c}from"./index.BHyzKS4e.js";import{u as R}from"./useBasicWidgetState.BXKaD8DQ.js";import"./FormClearHelper.DQoXcOWo.js";const x=k("div",{target:"e1xqjt520"})(({containerWidth:e})=>({width:e?"100%":"auto",minWidth:"fit-content"})),I=k("div",{target:"e1xqjt521"})(({theme:e})=>({display:"flex",flexWrap:"nowrap",gap:e.spacing.threeXS,minWidth:"fit-content"})),D=k("button",{target:"e1xqjt522"})(({theme:e,isSelected:t})=>({display:"inline-flex",alignItems:"center",justifyContent:"center",padding:e.spacing.threeXS,margin:e.spacing.none,backgroundColor:e.colors.transparent,color:t?e.colors.bodyText:e.colors.fadedText60,border:"none",borderRadius:e.radii.button,cursor:"pointer",userSelect:"none",minHeight:"unset",flex:"0 0 fit-content","&:focus":{boxShadow:"none",outline:"none"},"&:focus-visible":{boxShadow:e.shadows.focusRing},"&:hover:not(:disabled)":{color:e.colors.bodyText},"&:disabled":{color:t?e.colors.fadedText40:e.colors.fadedText10,cursor:"not-allowed",img:{opacity:.4}}})),f=[":material/thumb_up:",":material/thumb_down:"],B=[":material/sentiment_sad:",":material/sentiment_dissatisfied:",":material/sentiment_neutral:",":material/sentiment_satisfied:",":material/sentiment_very_satisfied:"],M=":material/star:",N=":material/star_filled:",F=5;function U(e){switch(e){case c.FeedbackType.FACES:return B.map((t,a)=>({icon:t,selectedIcon:t,value:a}));case c.FeedbackType.STARS:return Array.from({length:F},(t,a)=>({icon:M,selectedIcon:N,value:a}));default:return[{icon:f[0],selectedIcon:f[0],value:1},{icon:f[1],selectedIcon:f[1],value:0}]}}function W(e,t){switch(t){case c.FeedbackType.THUMBS:return e===1?"Thumbs up":"Thumbs down";case c.FeedbackType.FACES:return["Very dissatisfied","Dissatisfied","Neutral","Satisfied","Very satisfied"][e]??`Rating ${e+1}`;case c.FeedbackType.STARS:return`${e+1} out of ${F} stars`;default:return`Rating ${e+1}`}}function j(e,t,a){return t===null?!1:a===c.FeedbackType.STARS?e<=t:e===t}function E(e,t){const a=e.getStringValue(t);if(a!==void 0)return a===""?null:parseInt(a,10)}function L(e){return e.default??null}function O(e){return e.value??null}function $(e,t,a,b){const g=a.value===null?"":String(a.value);t.setStringValue(e,g,{fromUi:a.fromUi},b)}function q(e){const{disabled:t,element:a,fragmentId:b,widgetMgr:g,widthConfig:h}=e,{type:u}=a,[v,p]=R({getStateFromWidgetMgr:E,getDefaultStateFromProto:L,getCurrStateFromProto:O,updateWidgetMgrState:$,element:a,widgetMgr:g,fragmentId:b}),o=a.value??v,w=C(h),i=l.useMemo(()=>U(u),[u]),y=l.useRef([]),m=l.useCallback(n=>{p({value:o===n?null:n,fromUi:!0})},[o,p]),T=l.useCallback((n,r)=>{let s;switch(n.key){case"ArrowLeft":case"ArrowUp":n.preventDefault(),s=r>0?r-1:i.length-1;break;case"ArrowRight":case"ArrowDown":n.preventDefault(),s=r<i.length-1?r+1:0;break;case" ":case"Enter":n.preventDefault(),m(i[r].value);return;default:return}y.current[s]?.focus()},[i,m]);return d(x,{className:"stFeedback","data-testid":"stFeedback",containerWidth:w,children:d(I,{role:"radiogroup","aria-label":"Feedback rating",children:i.map((n,r)=>{const s=j(n.value,o,u),A=s?n.selectedIcon:n.icon;return d(D,{ref:S=>{y.current[r]=S},type:"button",role:"radio","aria-checked":o===n.value,"aria-label":W(n.value,u),tabIndex:o===n.value||o===null&&r===0?0:-1,disabled:t,isSelected:s,onClick:()=>m(n.value),onKeyDown:S=>T(S,r),"data-testid":s?"stFeedbackButtonActive":"stFeedbackButton",children:d(_,{iconValue:A,size:"lg"})},n.value)})})})}const K=l.memo(q);export{K as default};