@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.
- package/dist/chunks/{alert-DF3J6Yj7.cjs.js → alert-CsJON6h-.cjs.js} +2 -2
- package/dist/chunks/{alert-DF3J6Yj7.cjs.js.map → alert-CsJON6h-.cjs.js.map} +1 -1
- package/dist/chunks/{button-BfmWlfwH.cjs.js → button-CihUSHJo.cjs.js} +2 -2
- package/dist/chunks/{button-BfmWlfwH.cjs.js.map → button-CihUSHJo.cjs.js.map} +1 -1
- package/dist/chunks/{calendar-BgHBd6Dh.cjs.js → calendar-C-YasyPe.cjs.js} +2 -2
- package/dist/chunks/{calendar-BgHBd6Dh.cjs.js.map → calendar-C-YasyPe.cjs.js.map} +1 -1
- package/dist/chunks/{checkbox-BbdENF1i.cjs.js → checkbox-6DkVAh4W.cjs.js} +2 -2
- package/dist/chunks/{checkbox-BbdENF1i.cjs.js.map → checkbox-6DkVAh4W.cjs.js.map} +1 -1
- package/dist/chunks/{combobox-DIKvq4tw.cjs.js → combobox-CLGVlx_7.cjs.js} +2 -2
- package/dist/chunks/{combobox-DIKvq4tw.cjs.js.map → combobox-CLGVlx_7.cjs.js.map} +1 -1
- package/dist/chunks/{data-table-Cenvhz5D.cjs.js → data-table-B8hn0UVI.cjs.js} +2 -2
- package/dist/chunks/{data-table-Cenvhz5D.cjs.js.map → data-table-B8hn0UVI.cjs.js.map} +1 -1
- package/dist/chunks/{data-table-CWSmm1Cq.es.js → data-table-BmhYF5gH.es.js} +1 -2
- package/dist/chunks/{data-table-CWSmm1Cq.es.js.map → data-table-BmhYF5gH.es.js.map} +1 -1
- package/dist/chunks/{date-input-CKu2_a2x.cjs.js → date-input-VXO92NPV.cjs.js} +2 -2
- package/dist/chunks/{date-input-CKu2_a2x.cjs.js.map → date-input-VXO92NPV.cjs.js.map} +1 -1
- package/dist/chunks/{date-picker-DQ6_2mzc.cjs.js → date-picker-DNaxpmgh.cjs.js} +2 -2
- package/dist/chunks/{date-picker-DQ6_2mzc.cjs.js.map → date-picker-DNaxpmgh.cjs.js.map} +1 -1
- package/dist/chunks/{date-range-picker-i33UHqUE.cjs.js → date-range-picker-B5s-AFSY.cjs.js} +2 -2
- package/dist/chunks/{date-range-picker-i33UHqUE.cjs.js.map → date-range-picker-B5s-AFSY.cjs.js.map} +1 -1
- package/dist/chunks/{extractStyleProps-BFdEZDYW.cjs.js → extractStyleProps-BsLft3q1.cjs.js} +2 -2
- package/dist/chunks/{extractStyleProps-BFdEZDYW.cjs.js.map → extractStyleProps-BsLft3q1.cjs.js.map} +1 -1
- package/dist/chunks/{form-field-SFG0Jvp7.cjs.js → form-field-BjT4m4AE.cjs.js} +2 -2
- package/dist/chunks/{form-field-SFG0Jvp7.cjs.js.map → form-field-BjT4m4AE.cjs.js.map} +1 -1
- package/dist/chunks/{icon-button-D0NyGafI.cjs.js → icon-button-DOo2GUqd.cjs.js} +2 -2
- package/dist/chunks/{icon-button-D0NyGafI.cjs.js.map → icon-button-DOo2GUqd.cjs.js.map} +1 -1
- package/dist/chunks/{icon-toggle-button-yeQuEUBY.cjs.js → icon-toggle-button-DmYB27yi.cjs.js} +2 -2
- package/dist/chunks/{icon-toggle-button-yeQuEUBY.cjs.js.map → icon-toggle-button-DmYB27yi.cjs.js.map} +1 -1
- package/dist/chunks/{index-sFOzzmTG.cjs.js → index-BsmdMT4w.cjs.js} +2 -2
- package/dist/chunks/{index-sFOzzmTG.cjs.js.map → index-BsmdMT4w.cjs.js.map} +1 -1
- package/dist/chunks/index-Dvel3Oj5.es.js.map +1 -1
- package/dist/chunks/{menu-CImIQ6uJ.cjs.js → menu-C8il9--K.cjs.js} +2 -2
- package/dist/chunks/{menu-CImIQ6uJ.cjs.js.map → menu-C8il9--K.cjs.js.map} +1 -1
- package/dist/chunks/{multiline-text-input-jdvlKAq1.cjs.js → multiline-text-input-D28clI-o.cjs.js} +2 -2
- package/dist/chunks/{multiline-text-input-jdvlKAq1.cjs.js.map → multiline-text-input-D28clI-o.cjs.js.map} +1 -1
- package/dist/chunks/{nimbus-provider-CBZCiFEH.cjs.js → nimbus-provider-BlfO5_bi.cjs.js} +2 -2
- package/dist/chunks/{nimbus-provider-CBZCiFEH.cjs.js.map → nimbus-provider-BlfO5_bi.cjs.js.map} +1 -1
- package/dist/chunks/{number-input-CnOvkmap.cjs.js → number-input-CCEiz-4P.cjs.js} +2 -2
- package/dist/chunks/{number-input-CnOvkmap.cjs.js.map → number-input-CCEiz-4P.cjs.js.map} +1 -1
- package/dist/chunks/{password-input-DSeCpNT-.cjs.js → password-input-DY4slQHQ.cjs.js} +2 -2
- package/dist/chunks/{password-input-DSeCpNT-.cjs.js.map → password-input-DY4slQHQ.cjs.js.map} +1 -1
- package/dist/chunks/{progress-bar-CByPgKbP.cjs.js → progress-bar-0RRIR4ef.cjs.js} +2 -2
- package/dist/chunks/{progress-bar-CByPgKbP.cjs.js.map → progress-bar-0RRIR4ef.cjs.js.map} +1 -1
- package/dist/chunks/{radio-input-VMfD6a_K.cjs.js → radio-input-B40xSi6r.cjs.js} +2 -2
- package/dist/chunks/{radio-input-VMfD6a_K.cjs.js.map → radio-input-B40xSi6r.cjs.js.map} +1 -1
- package/dist/chunks/{range-calendar-CnaQY0pH.cjs.js → range-calendar-BiNek1C7.cjs.js} +2 -2
- package/dist/chunks/{range-calendar-CnaQY0pH.cjs.js.map → range-calendar-BiNek1C7.cjs.js.map} +1 -1
- package/dist/chunks/{rich-text-input-DmwKaXzi.cjs.js → rich-text-input-gNWvLb4m.cjs.js} +2 -2
- package/dist/chunks/{rich-text-input-DmwKaXzi.cjs.js.map → rich-text-input-gNWvLb4m.cjs.js.map} +1 -1
- package/dist/chunks/{select-DT9EbJgb.cjs.js → select-BuXA5VgT.cjs.js} +2 -2
- package/dist/chunks/{select-DT9EbJgb.cjs.js.map → select-BuXA5VgT.cjs.js.map} +1 -1
- package/dist/chunks/{split-button-i2Ezbf3P.cjs.js → split-button-CgQYMeH7.cjs.js} +2 -2
- package/dist/chunks/{split-button-i2Ezbf3P.cjs.js.map → split-button-CgQYMeH7.cjs.js.map} +1 -1
- package/dist/chunks/{switch-kNksAQM3.cjs.js → switch-BQXiI02l.cjs.js} +2 -2
- package/dist/chunks/{switch-kNksAQM3.cjs.js.map → switch-BQXiI02l.cjs.js.map} +1 -1
- package/dist/chunks/{tag-group-iRBYcxt6.cjs.js → tag-group-DwTq8DeA.cjs.js} +2 -2
- package/dist/chunks/{tag-group-iRBYcxt6.cjs.js.map → tag-group-DwTq8DeA.cjs.js.map} +1 -1
- package/dist/chunks/{text-input-D7SdSWpG.cjs.js → text-input-DJUpcp3k.cjs.js} +2 -2
- package/dist/chunks/{text-input-D7SdSWpG.cjs.js.map → text-input-DJUpcp3k.cjs.js.map} +1 -1
- package/dist/chunks/{time-input-BqTsxXMD.cjs.js → time-input-B5oRiIpu.cjs.js} +2 -2
- package/dist/chunks/{time-input-BqTsxXMD.cjs.js.map → time-input-B5oRiIpu.cjs.js.map} +1 -1
- package/dist/chunks/{toggle-button-CsVyAh8N.cjs.js → toggle-button-C_7Evcn3.cjs.js} +2 -2
- package/dist/chunks/{toggle-button-CsVyAh8N.cjs.js.map → toggle-button-C_7Evcn3.cjs.js.map} +1 -1
- package/dist/chunks/{toolbar-DcUEC_uE.cjs.js → toolbar-BUYkQMPz.cjs.js} +2 -2
- package/dist/chunks/{toolbar-DcUEC_uE.cjs.js.map → toolbar-BUYkQMPz.cjs.js.map} +1 -1
- package/dist/components/alert.cjs +1 -1
- package/dist/components/button.cjs +1 -1
- package/dist/components/calendar.cjs +1 -1
- package/dist/components/checkbox.cjs +1 -1
- package/dist/components/combobox.cjs +1 -1
- package/dist/components/components.cjs +1 -1
- package/dist/components/components.es.js +1 -1
- package/dist/components/data-table.cjs +1 -1
- package/dist/components/data-table.es.js +1 -1
- package/dist/components/date-input.cjs +1 -1
- package/dist/components/date-picker.cjs +1 -1
- package/dist/components/date-range-picker.cjs +1 -1
- package/dist/components/form-field.cjs +1 -1
- package/dist/components/icon-button.cjs +1 -1
- package/dist/components/icon-toggle-button.cjs +1 -1
- package/dist/components/multiline-text-input.cjs +1 -1
- package/dist/components/nimbus-provider.cjs +1 -1
- package/dist/components/number-input.cjs +1 -1
- package/dist/components/password-input.cjs +1 -1
- package/dist/components/progress-bar.cjs +1 -1
- package/dist/components/radio-input.cjs +1 -1
- package/dist/components/range-calendar.cjs +1 -1
- package/dist/components/rich-text-input.cjs +1 -1
- package/dist/components/select.cjs +1 -1
- package/dist/components/split-button.cjs +1 -1
- package/dist/components/switch.cjs +1 -1
- package/dist/components/tag-group.cjs +1 -1
- package/dist/components/text-input.cjs +1 -1
- package/dist/components/time-input.cjs +1 -1
- package/dist/components/toggle-button.cjs +1 -1
- package/dist/components/toolbar.cjs +1 -1
- package/dist/components.d.ts +35 -35
- package/dist/data-table.d.ts +35 -35
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +35 -35
- package/dist/index.es.js +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select-DT9EbJgb.cjs.js","sources":["../../../../node_modules/.pnpm/@react-aria+select@3.16.2_react-dom@19.1.1_react@19.1.1__react@19.1.1/node_modules/@react-aria/select/dist/useSelect.mjs","../../../../node_modules/.pnpm/@react-aria+select@3.16.2_react-dom@19.1.1_react@19.1.1__react@19.1.1/node_modules/@react-aria/select/dist/HiddenSelect.mjs","../../../../node_modules/.pnpm/@react-stately+select@3.7.1_react@19.1.1/node_modules/@react-stately/select/dist/useSelectState.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/Select.mjs","../../src/components/select/select.slots.tsx","../../src/components/select/components/select.clear-button.tsx","../../src/components/select/components/select.root.tsx","../../src/components/select/components/select.options.tsx","../../src/components/select/components/select.option.tsx","../../src/components/select/components/select.option-group.tsx","../../src/components/select/select.tsx"],"sourcesContent":["import {filterDOMProps as $aUnai$filterDOMProps, mergeProps as $aUnai$mergeProps, useId as $aUnai$useId, chain as $aUnai$chain} from \"@react-aria/utils\";\nimport {useMemo as $aUnai$useMemo} from \"react\";\nimport {ListKeyboardDelegate as $aUnai$ListKeyboardDelegate, useTypeSelect as $aUnai$useTypeSelect} from \"@react-aria/selection\";\nimport {setInteractionModality as $aUnai$setInteractionModality} from \"@react-aria/interactions\";\nimport {useCollator as $aUnai$useCollator} from \"@react-aria/i18n\";\nimport {useField as $aUnai$useField} from \"@react-aria/label\";\nimport {useMenuTrigger as $aUnai$useMenuTrigger} from \"@react-aria/menu\";\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\n\nconst $58aed456727eb0f3$export$703601b7e90536f8 = new WeakMap();\nfunction $58aed456727eb0f3$export$e64b2f635402ca43(props, state, ref) {\n let { keyboardDelegate: keyboardDelegate, isDisabled: isDisabled, isRequired: isRequired, name: name, form: form, validationBehavior: validationBehavior = 'aria' } = props;\n // By default, a KeyboardDelegate is provided which uses the DOM to query layout information (e.g. for page up/page down).\n // When virtualized, the layout object will be passed in as a prop and override this.\n let collator = (0, $aUnai$useCollator)({\n usage: 'search',\n sensitivity: 'base'\n });\n let delegate = (0, $aUnai$useMemo)(()=>keyboardDelegate || new (0, $aUnai$ListKeyboardDelegate)(state.collection, state.disabledKeys, ref, collator), [\n keyboardDelegate,\n state.collection,\n state.disabledKeys,\n collator,\n ref\n ]);\n let { menuTriggerProps: menuTriggerProps, menuProps: menuProps } = (0, $aUnai$useMenuTrigger)({\n isDisabled: isDisabled,\n type: 'listbox'\n }, state, ref);\n let onKeyDown = (e)=>{\n switch(e.key){\n case 'ArrowLeft':\n {\n var _delegate_getKeyAbove, _delegate_getFirstKey;\n // prevent scrolling containers\n e.preventDefault();\n let key = state.selectedKey != null ? (_delegate_getKeyAbove = delegate.getKeyAbove) === null || _delegate_getKeyAbove === void 0 ? void 0 : _delegate_getKeyAbove.call(delegate, state.selectedKey) : (_delegate_getFirstKey = delegate.getFirstKey) === null || _delegate_getFirstKey === void 0 ? void 0 : _delegate_getFirstKey.call(delegate);\n if (key) state.setSelectedKey(key);\n break;\n }\n case 'ArrowRight':\n {\n var _delegate_getKeyBelow, _delegate_getFirstKey1;\n // prevent scrolling containers\n e.preventDefault();\n let key = state.selectedKey != null ? (_delegate_getKeyBelow = delegate.getKeyBelow) === null || _delegate_getKeyBelow === void 0 ? void 0 : _delegate_getKeyBelow.call(delegate, state.selectedKey) : (_delegate_getFirstKey1 = delegate.getFirstKey) === null || _delegate_getFirstKey1 === void 0 ? void 0 : _delegate_getFirstKey1.call(delegate);\n if (key) state.setSelectedKey(key);\n break;\n }\n }\n };\n let { typeSelectProps: typeSelectProps } = (0, $aUnai$useTypeSelect)({\n keyboardDelegate: delegate,\n selectionManager: state.selectionManager,\n onTypeSelect (key) {\n state.setSelectedKey(key);\n }\n });\n let { isInvalid: isInvalid, validationErrors: validationErrors, validationDetails: validationDetails } = state.displayValidation;\n let { labelProps: labelProps, fieldProps: fieldProps, descriptionProps: descriptionProps, errorMessageProps: errorMessageProps } = (0, $aUnai$useField)({\n ...props,\n labelElementType: 'span',\n isInvalid: isInvalid,\n errorMessage: props.errorMessage || validationErrors\n });\n typeSelectProps.onKeyDown = typeSelectProps.onKeyDownCapture;\n delete typeSelectProps.onKeyDownCapture;\n let domProps = (0, $aUnai$filterDOMProps)(props, {\n labelable: true\n });\n let triggerProps = (0, $aUnai$mergeProps)(typeSelectProps, menuTriggerProps, fieldProps);\n let valueId = (0, $aUnai$useId)();\n $58aed456727eb0f3$export$703601b7e90536f8.set(state, {\n isDisabled: isDisabled,\n isRequired: isRequired,\n name: name,\n form: form,\n validationBehavior: validationBehavior\n });\n return {\n labelProps: {\n ...labelProps,\n onClick: ()=>{\n if (!props.isDisabled) {\n var _ref_current;\n (_ref_current = ref.current) === null || _ref_current === void 0 ? void 0 : _ref_current.focus();\n // Show the focus ring so the user knows where focus went\n (0, $aUnai$setInteractionModality)('keyboard');\n }\n }\n },\n triggerProps: (0, $aUnai$mergeProps)(domProps, {\n ...triggerProps,\n isDisabled: isDisabled,\n onKeyDown: (0, $aUnai$chain)(triggerProps.onKeyDown, onKeyDown, props.onKeyDown),\n onKeyUp: props.onKeyUp,\n 'aria-labelledby': [\n valueId,\n triggerProps['aria-labelledby'],\n triggerProps['aria-label'] && !triggerProps['aria-labelledby'] ? triggerProps.id : null\n ].filter(Boolean).join(' '),\n onFocus (e) {\n if (state.isFocused) return;\n if (props.onFocus) props.onFocus(e);\n if (props.onFocusChange) props.onFocusChange(true);\n state.setFocused(true);\n },\n onBlur (e) {\n if (state.isOpen) return;\n if (props.onBlur) props.onBlur(e);\n if (props.onFocusChange) props.onFocusChange(false);\n state.setFocused(false);\n }\n }),\n valueProps: {\n id: valueId\n },\n menuProps: {\n ...menuProps,\n autoFocus: state.focusStrategy || true,\n shouldSelectOnPressUp: true,\n shouldFocusOnHover: true,\n disallowEmptySelection: true,\n linkBehavior: 'selection',\n onBlur: (e)=>{\n if (e.currentTarget.contains(e.relatedTarget)) return;\n if (props.onBlur) props.onBlur(e);\n if (props.onFocusChange) props.onFocusChange(false);\n state.setFocused(false);\n },\n 'aria-labelledby': [\n fieldProps['aria-labelledby'],\n triggerProps['aria-label'] && !fieldProps['aria-labelledby'] ? triggerProps.id : null\n ].filter(Boolean).join(' ')\n },\n descriptionProps: descriptionProps,\n errorMessageProps: errorMessageProps,\n isInvalid: isInvalid,\n validationErrors: validationErrors,\n validationDetails: validationDetails,\n hiddenSelectProps: {\n isDisabled: isDisabled,\n name: name,\n label: props.label,\n state: state,\n triggerRef: ref,\n form: form\n }\n };\n}\n\n\nexport {$58aed456727eb0f3$export$703601b7e90536f8 as selectData, $58aed456727eb0f3$export$e64b2f635402ca43 as useSelect};\n//# sourceMappingURL=useSelect.module.js.map\n","import {selectData as $58aed456727eb0f3$export$703601b7e90536f8} from \"./useSelect.mjs\";\nimport $8BE50$react, {useCallback as $8BE50$useCallback, useRef as $8BE50$useRef} from \"react\";\nimport {useFormReset as $8BE50$useFormReset} from \"@react-aria/utils\";\nimport {useFormValidation as $8BE50$useFormValidation} from \"@react-aria/form\";\nimport {useVisuallyHidden as $8BE50$useVisuallyHidden} from \"@react-aria/visually-hidden\";\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\nfunction $bdd25dc72710631f$export$f809e80f58e251d1(props, state, triggerRef) {\n let data = (0, $58aed456727eb0f3$export$703601b7e90536f8).get(state) || {};\n let { autoComplete: autoComplete, name: name = data.name, form: form = data.form, isDisabled: isDisabled = data.isDisabled } = props;\n let { validationBehavior: validationBehavior, isRequired: isRequired } = data;\n let { visuallyHiddenProps: visuallyHiddenProps } = (0, $8BE50$useVisuallyHidden)({\n style: {\n // Prevent page scrolling.\n position: 'fixed',\n top: 0,\n left: 0\n }\n });\n (0, $8BE50$useFormReset)(props.selectRef, state.defaultSelectedKey, state.setSelectedKey);\n (0, $8BE50$useFormValidation)({\n validationBehavior: validationBehavior,\n focus: ()=>{\n var _triggerRef_current;\n return (_triggerRef_current = triggerRef.current) === null || _triggerRef_current === void 0 ? void 0 : _triggerRef_current.focus();\n }\n }, state, props.selectRef);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n let onChange = (0, $8BE50$useCallback)((e)=>state.setSelectedKey(e.currentTarget.value), [\n state.setSelectedKey\n ]);\n var _state_selectedKey;\n // In Safari, the <select> cannot have `display: none` or `hidden` for autofill to work.\n // In Firefox, there must be a <label> to identify the <select> whereas other browsers\n // seem to identify it just by surrounding text.\n // The solution is to use <VisuallyHidden> to hide the elements, which clips the elements to a\n // 1px rectangle. In addition, we hide from screen readers with aria-hidden, and make the <select>\n // non tabbable with tabIndex={-1}.\n return {\n containerProps: {\n ...visuallyHiddenProps,\n 'aria-hidden': true,\n // @ts-ignore\n ['data-react-aria-prevent-focus']: true,\n // @ts-ignore\n ['data-a11y-ignore']: 'aria-hidden-focus'\n },\n inputProps: {\n style: {\n display: 'none'\n }\n },\n selectProps: {\n tabIndex: -1,\n autoComplete: autoComplete,\n disabled: isDisabled,\n required: validationBehavior === 'native' && isRequired,\n name: name,\n form: form,\n value: (_state_selectedKey = state.selectedKey) !== null && _state_selectedKey !== void 0 ? _state_selectedKey : '',\n onChange: onChange,\n onInput: onChange\n }\n };\n}\nfunction $bdd25dc72710631f$export$cbd84cdb2e668835(props) {\n let { state: state, triggerRef: triggerRef, label: label, name: name, form: form, isDisabled: isDisabled } = props;\n let selectRef = (0, $8BE50$useRef)(null);\n let inputRef = (0, $8BE50$useRef)(null);\n let { containerProps: containerProps, selectProps: selectProps } = $bdd25dc72710631f$export$f809e80f58e251d1({\n ...props,\n selectRef: state.collection.size <= 300 ? selectRef : inputRef\n }, state, triggerRef);\n // If used in a <form>, use a hidden input so the value can be submitted to a server.\n // If the collection isn't too big, use a hidden <select> element for this so that browser\n // autofill will work. Otherwise, use an <input type=\"hidden\">.\n if (state.collection.size <= 300) return /*#__PURE__*/ (0, $8BE50$react).createElement(\"div\", {\n ...containerProps,\n \"data-testid\": \"hidden-select-container\"\n }, /*#__PURE__*/ (0, $8BE50$react).createElement(\"label\", null, label, /*#__PURE__*/ (0, $8BE50$react).createElement(\"select\", {\n ...selectProps,\n ref: selectRef\n }, /*#__PURE__*/ (0, $8BE50$react).createElement(\"option\", null), [\n ...state.collection.getKeys()\n ].map((key)=>{\n let item = state.collection.getItem(key);\n if (item && item.type === 'item') return /*#__PURE__*/ (0, $8BE50$react).createElement(\"option\", {\n key: item.key,\n value: item.key\n }, item.textValue);\n }))));\n else if (name) {\n let data = (0, $58aed456727eb0f3$export$703601b7e90536f8).get(state) || {};\n let { validationBehavior: validationBehavior } = data;\n var _state_selectedKey;\n let inputProps = {\n type: 'hidden',\n autoComplete: selectProps.autoComplete,\n name: name,\n form: form,\n disabled: isDisabled,\n value: (_state_selectedKey = state.selectedKey) !== null && _state_selectedKey !== void 0 ? _state_selectedKey : ''\n };\n if (validationBehavior === 'native') // Use a hidden <input type=\"text\"> rather than <input type=\"hidden\">\n // so that an empty value blocks HTML form submission when the field is required.\n return /*#__PURE__*/ (0, $8BE50$react).createElement(\"input\", {\n ...inputProps,\n ref: inputRef,\n style: {\n display: 'none'\n },\n type: \"text\",\n required: selectProps.required,\n onChange: ()=>{}\n });\n return /*#__PURE__*/ (0, $8BE50$react).createElement(\"input\", {\n ...inputProps,\n ref: inputRef\n });\n }\n return null;\n}\n\n\nexport {$bdd25dc72710631f$export$f809e80f58e251d1 as useHiddenSelect, $bdd25dc72710631f$export$cbd84cdb2e668835 as HiddenSelect};\n//# sourceMappingURL=HiddenSelect.module.js.map\n","import {useFormValidationState as $6FfNf$useFormValidationState} from \"@react-stately/form\";\nimport {useOverlayTriggerState as $6FfNf$useOverlayTriggerState} from \"@react-stately/overlays\";\nimport {useSingleSelectListState as $6FfNf$useSingleSelectListState} from \"@react-stately/list\";\nimport {useState as $6FfNf$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\n\nfunction $2bc3a590c5373a4e$export$5159ec8b34d4ec12(props) {\n let triggerState = (0, $6FfNf$useOverlayTriggerState)(props);\n let [focusStrategy, setFocusStrategy] = (0, $6FfNf$useState)(null);\n let listState = (0, $6FfNf$useSingleSelectListState)({\n ...props,\n onSelectionChange: (key)=>{\n if (props.onSelectionChange != null) props.onSelectionChange(key);\n triggerState.close();\n validationState.commitValidation();\n }\n });\n let validationState = (0, $6FfNf$useFormValidationState)({\n ...props,\n value: listState.selectedKey\n });\n let [isFocused, setFocused] = (0, $6FfNf$useState)(false);\n let [initialSelectedKey] = (0, $6FfNf$useState)(listState.selectedKey);\n var _props_defaultSelectedKey;\n return {\n ...validationState,\n ...listState,\n ...triggerState,\n defaultSelectedKey: (_props_defaultSelectedKey = props.defaultSelectedKey) !== null && _props_defaultSelectedKey !== void 0 ? _props_defaultSelectedKey : initialSelectedKey,\n focusStrategy: focusStrategy,\n open (focusStrategy = null) {\n // Don't open if the collection is empty.\n if (listState.collection.size !== 0) {\n setFocusStrategy(focusStrategy);\n triggerState.open();\n }\n },\n toggle (focusStrategy = null) {\n if (listState.collection.size !== 0) {\n setFocusStrategy(focusStrategy);\n triggerState.toggle();\n }\n },\n isFocused: isFocused,\n setFocused: setFocused\n };\n}\n\n\nexport {$2bc3a590c5373a4e$export$5159ec8b34d4ec12 as useSelectState};\n//# sourceMappingURL=useSelectState.module.js.map\n","import {ButtonContext as $d2b4bc8c273e7be6$export$24d547caef80ccd1} from \"./Button.mjs\";\nimport {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 $akiWb$intlStringsmodulejs from \"./intlStrings.mjs\";\nimport {LabelContext as $01b77f81d0f07f68$export$75b6ee27786ba447} from \"./Label.mjs\";\nimport {ListBoxContext as $eed445e0843c11d0$export$7ff8f37d2d81a48d, ListStateContext as $eed445e0843c11d0$export$7c5906fe4f1f2af2} from \"./ListBox.mjs\";\nimport {OverlayTriggerStateContext as $de32f1b87079253c$export$d2f961adcb0afbe} from \"./Dialog.mjs\";\nimport {PopoverContext as $07b14b47974efb58$export$9b9a0cd73afb7ca4} from \"./Popover.mjs\";\nimport {TextContext as $514c0188e459b4c0$export$9afb8bc826b033ea} from \"./Text.mjs\";\nimport {useFocusRing as $akiWb$useFocusRing, useSelect as $akiWb$useSelect, HiddenSelect as $akiWb$HiddenSelect, useLocalizedStringFormatter as $akiWb$useLocalizedStringFormatter} from \"react-aria\";\nimport {useSelectState as $akiWb$useSelectState} from \"react-stately\";\nimport {CollectionBuilder as $akiWb$CollectionBuilder} from \"@react-aria/collections\";\nimport {useResizeObserver as $akiWb$useResizeObserver, filterDOMProps as $akiWb$filterDOMProps, mergeProps as $akiWb$mergeProps} from \"@react-aria/utils\";\nimport $akiWb$react, {createContext as $akiWb$createContext, forwardRef as $akiWb$forwardRef, useMemo as $akiWb$useMemo, useRef as $akiWb$useRef, useState as $akiWb$useState, useCallback as $akiWb$useCallback, useContext as $akiWb$useContext} from \"react\";\n\n\nfunction $parcel$interopDefault(a) {\n return a && a.__esModule ? a.default : a;\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\n\n\n\n\n\n\nconst $82d7e5349645de74$export$7540cee5be7dc19b = /*#__PURE__*/ (0, $akiWb$createContext)(null);\nconst $82d7e5349645de74$export$ef445b55be0601bd = /*#__PURE__*/ (0, $akiWb$createContext)(null);\nconst $82d7e5349645de74$export$ef9b1a59e592288f = /*#__PURE__*/ (0, $akiWb$forwardRef)(function Select(props, ref) {\n [props, ref] = (0, $64fa3d84918910a7$export$29f1550f4b0d4415)(props, ref, $82d7e5349645de74$export$7540cee5be7dc19b);\n let { children: children, isDisabled: isDisabled = false, isInvalid: isInvalid = false, isRequired: isRequired = false } = props;\n let content = (0, $akiWb$useMemo)(()=>typeof children === 'function' ? children({\n isOpen: false,\n isDisabled: isDisabled,\n isInvalid: isInvalid,\n isRequired: isRequired,\n isFocused: false,\n isFocusVisible: false,\n defaultChildren: null\n }) : children, [\n children,\n isDisabled,\n isInvalid,\n isRequired\n ]);\n return /*#__PURE__*/ (0, $akiWb$react).createElement((0, $akiWb$CollectionBuilder), {\n content: content\n }, (collection)=>/*#__PURE__*/ (0, $akiWb$react).createElement($82d7e5349645de74$var$SelectInner, {\n props: props,\n collection: collection,\n selectRef: ref\n }));\n});\n// Contexts to clear inside the popover.\nconst $82d7e5349645de74$var$CLEAR_CONTEXTS = [\n (0, $01b77f81d0f07f68$export$75b6ee27786ba447),\n (0, $d2b4bc8c273e7be6$export$24d547caef80ccd1),\n (0, $514c0188e459b4c0$export$9afb8bc826b033ea)\n];\nfunction $82d7e5349645de74$var$SelectInner({ props: props, selectRef: ref, collection: collection }) {\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, $akiWb$useSelectState)({\n ...props,\n collection: collection,\n children: undefined,\n validationBehavior: validationBehavior\n });\n let { isFocusVisible: isFocusVisible, focusProps: focusProps } = (0, $akiWb$useFocusRing)({\n within: true\n });\n // Get props for child elements from useSelect\n let buttonRef = (0, $akiWb$useRef)(null);\n let [labelRef, label] = (0, $64fa3d84918910a7$export$9d4c57ee4c6ffdd8)(!props['aria-label'] && !props['aria-labelledby']);\n let { labelProps: labelProps, triggerProps: triggerProps, valueProps: valueProps, menuProps: menuProps, descriptionProps: descriptionProps, errorMessageProps: errorMessageProps, hiddenSelectProps: hiddenSelectProps, ...validation } = (0, $akiWb$useSelect)({\n ...(0, $64fa3d84918910a7$export$ef03459518577ad4)(props),\n label: label,\n validationBehavior: validationBehavior\n }, state, buttonRef);\n // Make menu width match input + button\n let [buttonWidth, setButtonWidth] = (0, $akiWb$useState)(null);\n let onResize = (0, $akiWb$useCallback)(()=>{\n if (buttonRef.current) setButtonWidth(buttonRef.current.offsetWidth + 'px');\n }, [\n buttonRef\n ]);\n (0, $akiWb$useResizeObserver)({\n ref: buttonRef,\n onResize: onResize\n });\n // Only expose a subset of state to renderProps function to avoid infinite render loop\n let renderPropsState = (0, $akiWb$useMemo)(()=>({\n isOpen: state.isOpen,\n isFocused: state.isFocused,\n isFocusVisible: isFocusVisible,\n isDisabled: props.isDisabled || false,\n isInvalid: validation.isInvalid || false,\n isRequired: props.isRequired || false\n }), [\n state.isOpen,\n state.isFocused,\n isFocusVisible,\n props.isDisabled,\n validation.isInvalid,\n props.isRequired\n ]);\n let renderProps = (0, $64fa3d84918910a7$export$4d86445c2cf5e3)({\n ...props,\n values: renderPropsState,\n defaultClassName: 'react-aria-Select'\n });\n let DOMProps = (0, $akiWb$filterDOMProps)(props, {\n global: true\n });\n delete DOMProps.id;\n let scrollRef = (0, $akiWb$useRef)(null);\n return /*#__PURE__*/ (0, $akiWb$react).createElement((0, $64fa3d84918910a7$export$2881499e37b75b9a), {\n values: [\n [\n $82d7e5349645de74$export$7540cee5be7dc19b,\n props\n ],\n [\n $82d7e5349645de74$export$ef445b55be0601bd,\n state\n ],\n [\n $82d7e5349645de74$export$f8f745c04421623f,\n valueProps\n ],\n [\n (0, $01b77f81d0f07f68$export$75b6ee27786ba447),\n {\n ...labelProps,\n ref: labelRef,\n elementType: 'span'\n }\n ],\n [\n (0, $d2b4bc8c273e7be6$export$24d547caef80ccd1),\n {\n ...triggerProps,\n ref: buttonRef,\n isPressed: state.isOpen,\n autoFocus: props.autoFocus\n }\n ],\n [\n (0, $de32f1b87079253c$export$d2f961adcb0afbe),\n state\n ],\n [\n (0, $07b14b47974efb58$export$9b9a0cd73afb7ca4),\n {\n trigger: 'Select',\n triggerRef: buttonRef,\n scrollRef: scrollRef,\n placement: 'bottom start',\n style: {\n '--trigger-width': buttonWidth\n },\n 'aria-labelledby': menuProps['aria-labelledby'],\n clearContexts: $82d7e5349645de74$var$CLEAR_CONTEXTS\n }\n ],\n [\n (0, $eed445e0843c11d0$export$7ff8f37d2d81a48d),\n {\n ...menuProps,\n ref: scrollRef\n }\n ],\n [\n (0, $eed445e0843c11d0$export$7c5906fe4f1f2af2),\n state\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 }, /*#__PURE__*/ (0, $akiWb$react).createElement(\"div\", {\n ...(0, $akiWb$mergeProps)(DOMProps, renderProps, focusProps),\n ref: ref,\n slot: props.slot || undefined,\n \"data-focused\": state.isFocused || undefined,\n \"data-focus-visible\": isFocusVisible || undefined,\n \"data-open\": state.isOpen || undefined,\n \"data-disabled\": props.isDisabled || undefined,\n \"data-invalid\": validation.isInvalid || undefined,\n \"data-required\": props.isRequired || undefined\n }, renderProps.children, /*#__PURE__*/ (0, $akiWb$react).createElement((0, $akiWb$HiddenSelect), {\n ...hiddenSelectProps,\n autoComplete: props.autoComplete\n })));\n}\nconst $82d7e5349645de74$export$f8f745c04421623f = /*#__PURE__*/ (0, $akiWb$createContext)(null);\nconst $82d7e5349645de74$export$e288731fd71264f0 = /*#__PURE__*/ (0, $akiWb$forwardRef)(function SelectValue(props, ref) {\n var _state_selectedItem, _state_selectedItem1;\n [props, ref] = (0, $64fa3d84918910a7$export$29f1550f4b0d4415)(props, ref, $82d7e5349645de74$export$f8f745c04421623f);\n let state = (0, $akiWb$useContext)($82d7e5349645de74$export$ef445b55be0601bd);\n let { placeholder: placeholder } = (0, $64fa3d84918910a7$export$fabf2dc03a41866e)($82d7e5349645de74$export$7540cee5be7dc19b);\n let selectedItem = state.selectedKey != null ? state.collection.getItem(state.selectedKey) : null;\n let rendered = selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.props.children;\n if (typeof rendered === 'function') {\n // If the selected item has a function as a child, we need to call it to render to React.JSX.\n let fn = rendered;\n rendered = fn({\n isHovered: false,\n isPressed: false,\n isSelected: false,\n isFocused: false,\n isFocusVisible: false,\n isDisabled: false,\n selectionMode: 'single',\n selectionBehavior: 'toggle'\n });\n }\n let stringFormatter = (0, $akiWb$useLocalizedStringFormatter)((0, ($parcel$interopDefault($akiWb$intlStringsmodulejs))), 'react-aria-components');\n var _ref, _state_selectedItem_value, _state_selectedItem_textValue;\n let renderProps = (0, $64fa3d84918910a7$export$4d86445c2cf5e3)({\n ...props,\n defaultChildren: (_ref = rendered !== null && rendered !== void 0 ? rendered : placeholder) !== null && _ref !== void 0 ? _ref : stringFormatter.format('selectPlaceholder'),\n defaultClassName: 'react-aria-SelectValue',\n values: {\n selectedItem: (_state_selectedItem_value = (_state_selectedItem = state.selectedItem) === null || _state_selectedItem === void 0 ? void 0 : _state_selectedItem.value) !== null && _state_selectedItem_value !== void 0 ? _state_selectedItem_value : null,\n selectedText: (_state_selectedItem_textValue = (_state_selectedItem1 = state.selectedItem) === null || _state_selectedItem1 === void 0 ? void 0 : _state_selectedItem1.textValue) !== null && _state_selectedItem_textValue !== void 0 ? _state_selectedItem_textValue : null,\n isPlaceholder: !selectedItem\n }\n });\n let DOMProps = (0, $akiWb$filterDOMProps)(props, {\n global: true\n });\n return /*#__PURE__*/ (0, $akiWb$react).createElement(\"span\", {\n ref: ref,\n ...DOMProps,\n ...renderProps,\n \"data-placeholder\": !selectedItem || undefined\n }, /*#__PURE__*/ (0, $akiWb$react).createElement((0, $514c0188e459b4c0$export$9afb8bc826b033ea).Provider, {\n value: undefined\n }, renderProps.children));\n});\n\n\nexport {$82d7e5349645de74$export$7540cee5be7dc19b as SelectContext, $82d7e5349645de74$export$ef445b55be0601bd as SelectStateContext, $82d7e5349645de74$export$ef9b1a59e592288f as Select, $82d7e5349645de74$export$f8f745c04421623f as SelectValueContext, $82d7e5349645de74$export$e288731fd71264f0 as SelectValue};\n//# sourceMappingURL=Select.module.js.map\n","/* 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 { selectSlotRecipe } from \"./select.recipe\";\nimport { type SelectProps as RaSelectProps } from \"react-aria-components\";\n\nconst { withProvider, withContext } = createSlotRecipeContext({\n key: \"select\",\n});\n\n// Select\nexport interface SelectRootSlotProps\n extends HTMLChakraProps<\n \"div\",\n RecipeVariantProps<typeof selectSlotRecipe> & RaSelectProps<object>\n > {}\nexport const SelectRootSlot = withProvider<HTMLDivElement, SelectRootSlotProps>(\n \"div\",\n \"root\"\n);\n\n// Trigger Button\nexport interface SelectTriggerSlotProps extends HTMLChakraProps<\"button\"> {}\nexport const SelectTriggerSlot = withContext<\n HTMLButtonElement,\n SelectTriggerSlotProps\n>(\"button\", \"trigger\");\n\n// Trigger Button Label\nexport interface SelectTriggerLabelSlotProps extends HTMLChakraProps<\"span\"> {}\nexport const SelectTriggerLabelSlot = withContext<\n HTMLButtonElement,\n SelectTriggerLabelSlotProps\n>(\"span\", \"triggerLabel\");\n\n// ListBox\nexport interface SelectOptionsSlotProps extends HTMLChakraProps<\"div\"> {}\nexport const SelectOptionsSlot = withContext<\n HTMLDivElement,\n SelectOptionsSlotProps\n>(\"div\", \"options\");\n\n// ListBoxItem\nexport interface SelectOptionSlotProps extends HTMLChakraProps<\"div\"> {}\nexport const SelectOptionSlot = withContext<\n HTMLDivElement,\n SelectOptionSlotProps\n>(\"div\", \"option\");\n\n// OptionGroup\nexport interface SelectOptionGroupSlotProps extends HTMLChakraProps<\"div\"> {}\nexport const SelectOptionGroupSlot = withContext<\n HTMLDivElement,\n SelectOptionGroupSlotProps\n>(\"div\", \"optionGroup\");\n","import { useContext } from \"react\";\nimport { Close as CloseIcon } from \"@commercetools/nimbus-icons\";\nimport { IconButton } from \"@/components\";\nimport { SelectStateContext } from \"react-aria-components\";\nimport { ClearPressResponder } from \"@react-aria/interactions\";\n\nexport const SelectClearButton = () => {\n const state = useContext(SelectStateContext);\n\n if (!state?.selectedKey) {\n return null;\n }\n\n const onPressRequest = () => {\n state?.setSelectedKey(null);\n };\n\n return (\n <ClearPressResponder>\n <IconButton\n pointerEvents=\"all\"\n size=\"2xs\"\n variant=\"ghost\"\n tone=\"primary\"\n aria-label=\"Clear Selection\"\n onPress={onPressRequest}\n >\n <CloseIcon />\n </IconButton>\n </ClearPressResponder>\n );\n};\n\nSelectClearButton.displayName = \"Select.ClearButton\";\n","import { forwardRef } from \"react\";\nimport { chakra, useSlotRecipe } from \"@chakra-ui/react/styled-system\";\n\nimport {\n KeyboardArrowDown as DropdownIndicatorIcon,\n Loop as SpinnerIcon,\n} from \"@commercetools/nimbus-icons\";\n\nimport { Flex, Box } from \"@/components\";\nimport {\n Button as RaButton,\n Popover as RaPopover,\n Select as RaSelect,\n SelectValue as RaSelectValue,\n} from \"react-aria-components\";\nimport {\n SelectRootSlot,\n SelectTriggerSlot,\n SelectTriggerLabelSlot,\n} from \"./../select.slots\";\nimport { SelectClearButton } from \"./select.clear-button\";\nimport { type SelectRootProps } from \"./../select.types\";\nimport { selectSlotRecipe } from \"../select.recipe\";\nimport { extractStyleProps } from \"@/utils/extractStyleProps\";\n\n/**\n * # Select\n *\n * displays a collapsible list of options and allows a user to select one of them.\n *\n * @see {@link https://nimbus-documentation.vercel.app/components/inputs/select}\n */\nexport const SelectRoot = forwardRef<HTMLDivElement, SelectRootProps>(\n ({ children, isLoading, isDisabled, ...props }, ref) => {\n const recipe = useSlotRecipe({ recipe: selectSlotRecipe });\n const [recipeProps, restRecipeProps] = recipe.splitVariantProps(props);\n const [styleProps, restProps] = extractStyleProps(restRecipeProps);\n\n const raSelectProps = {\n ...restProps,\n isDisabled: isLoading || isDisabled,\n };\n\n return (\n <SelectRootSlot asChild ref={ref} {...recipeProps} {...styleProps}>\n <RaSelect {...raSelectProps}>\n <chakra.div position=\"relative\">\n <SelectTriggerSlot zIndex={0} asChild>\n <RaButton>\n <SelectTriggerLabelSlot asChild>\n <RaSelectValue />\n </SelectTriggerLabelSlot>\n </RaButton>\n </SelectTriggerSlot>\n <Flex\n position=\"absolute\"\n top=\"0\"\n bottom=\"0\"\n zIndex={1}\n right=\"400\"\n pointerEvents=\"none\"\n >\n <Flex width=\"600\" my=\"auto\">\n <SelectClearButton />\n </Flex>\n\n <Flex my=\"auto\" w=\"600\" h=\"600\" pointerEvents=\"none\">\n <Box color=\"neutral.9\" asChild m=\"auto\" w=\"400\" h=\"400\">\n {isLoading ? (\n <Box asChild animation=\"spin\" animationDuration=\"slowest\">\n <SpinnerIcon />\n </Box>\n ) : (\n <DropdownIndicatorIcon />\n )}\n </Box>\n </Flex>\n </Flex>\n </chakra.div>\n\n <RaPopover>{children}</RaPopover>\n </RaSelect>\n </SelectRootSlot>\n );\n }\n);\n\nSelectRoot.displayName = \"Select.Root\";\n","import { ListBox as RaListBox } from \"react-aria-components\";\nimport { SelectOptionsSlot } from \"./../select.slots\";\nimport type { SelectOptionsProps } from \"../select.types\";\nimport { extractStyleProps } from \"@/utils/extractStyleProps\";\n\nexport const SelectOptions = <T extends object>(\n props: SelectOptionsProps<T> & { ref?: React.Ref<HTMLDivElement> }\n) => {\n const { ref, ...restProps } = props;\n const [styleProps, rest] = extractStyleProps(restProps);\n return (\n <SelectOptionsSlot asChild {...styleProps}>\n <RaListBox ref={ref} {...rest} />\n </SelectOptionsSlot>\n );\n};\n\nSelectOptions.displayName = \"Select.Options\";\n","import { ListBoxItem as RaListBoxItem } from \"react-aria-components\";\nimport { SelectOptionSlot } from \"./../select.slots\";\nimport type { SelectOptionProps } from \"../select.types\";\n\nexport const SelectOption = <T extends object>({\n ref,\n ...restProps\n}: SelectOptionProps<T> & { ref?: React.Ref<HTMLDivElement> }) => {\n return (\n <SelectOptionSlot asChild ref={ref}>\n <RaListBoxItem {...restProps} />\n </SelectOptionSlot>\n );\n};\n\nSelectOption.displayName = \"Select.Option\";\n","import { type ReactNode } from \"react\";\n\nimport {\n ListBoxSection as RaListBoxSection,\n Header as RaHeader,\n Collection,\n} from \"react-aria-components\";\nimport { SelectOptionGroupSlot } from \"./../select.slots\";\nimport type { SelectOptionGroupProps } from \"../select.types\";\n\nexport const SelectOptionGroup = <T extends object>(\n props: SelectOptionGroupProps<T> & { ref?: React.Ref<HTMLDivElement> }\n) => {\n const { ref, label, items, children, ...restProps } = props;\n\n // Validate that children is a function when items is provided\n if (items && typeof children !== \"function\") {\n throw new Error(\n 'SelectOptionGroup: When \"items\" is provided, \"children\" must be a function'\n );\n }\n\n return (\n <RaListBoxSection ref={ref} {...restProps}>\n <SelectOptionGroupSlot asChild>\n <RaHeader>{label}</RaHeader>\n </SelectOptionGroupSlot>\n\n {items ? (\n <Collection items={items}>\n {(item: T) => {\n if (typeof children === \"function\") {\n return children(item);\n }\n return null;\n }}\n </Collection>\n ) : (\n (children as ReactNode)\n )}\n </RaListBoxSection>\n );\n};\n\nSelectOptionGroup.displayName = \"Select.OptionGroup\";\n","import { SelectRoot as _SelectRoot } from \"./components/select.root\";\nimport { SelectOptions as _SelectOptions } from \"./components/select.options\";\nimport { SelectOption as _SelectOption } from \"./components/select.option\";\nimport { SelectOptionGroup as _SelectOptionGroup } from \"./components/select.option-group\";\n\nexport const Select = {\n Root: _SelectRoot,\n Options: _SelectOptions,\n Option: _SelectOption,\n OptionGroup: _SelectOptionGroup,\n};\n\n/**\n * todo: get rid of this, this is needed for the react-docgen-typescript script\n * that is parsing the typescript types for our documentation. The _ underscores\n * serve as a reminder that this exports are awkward and should not be used.\n */\nexport { _SelectRoot, _SelectOptions, _SelectOption, _SelectOptionGroup };\n"],"names":["$58aed456727eb0f3$export$703601b7e90536f8","$58aed456727eb0f3$export$e64b2f635402ca43","props","state","ref","keyboardDelegate","isDisabled","isRequired","name","form","validationBehavior","collator","$aUnai$useCollator","delegate","$aUnai$useMemo","$aUnai$ListKeyboardDelegate","menuTriggerProps","menuProps","$aUnai$useMenuTrigger","onKeyDown","e","_delegate_getKeyAbove","_delegate_getFirstKey","key","_delegate_getKeyBelow","_delegate_getFirstKey1","typeSelectProps","$aUnai$useTypeSelect","isInvalid","validationErrors","validationDetails","labelProps","fieldProps","descriptionProps","errorMessageProps","$aUnai$useField","domProps","$aUnai$filterDOMProps","triggerProps","$aUnai$mergeProps","valueId","$aUnai$useId","_ref_current","$aUnai$setInteractionModality","$aUnai$chain","$bdd25dc72710631f$export$f809e80f58e251d1","triggerRef","data","autoComplete","visuallyHiddenProps","$8BE50$useVisuallyHidden","$8BE50$useFormReset","$8BE50$useFormValidation","_triggerRef_current","onChange","$8BE50$useCallback","_state_selectedKey","$bdd25dc72710631f$export$cbd84cdb2e668835","label","selectRef","$8BE50$useRef","inputRef","containerProps","selectProps","$8BE50$react","item","inputProps","$2bc3a590c5373a4e$export$5159ec8b34d4ec12","triggerState","$6FfNf$useOverlayTriggerState","focusStrategy","setFocusStrategy","$6FfNf$useState","listState","$6FfNf$useSingleSelectListState","validationState","$6FfNf$useFormValidationState","isFocused","setFocused","initialSelectedKey","_props_defaultSelectedKey","$parcel$interopDefault","a","$82d7e5349645de74$export$7540cee5be7dc19b","$akiWb$createContext","$82d7e5349645de74$export$ef445b55be0601bd","$82d7e5349645de74$export$ef9b1a59e592288f","$akiWb$forwardRef","$64fa3d84918910a7$export$29f1550f4b0d4415","children","content","$akiWb$useMemo","$akiWb$react","$akiWb$CollectionBuilder","collection","$82d7e5349645de74$var$SelectInner","$82d7e5349645de74$var$CLEAR_CONTEXTS","$01b77f81d0f07f68$export$75b6ee27786ba447","$d2b4bc8c273e7be6$export$24d547caef80ccd1","$514c0188e459b4c0$export$9afb8bc826b033ea","formValidationBehavior","$64fa3d84918910a7$export$fabf2dc03a41866e","$d3e0e05bdfcf66bd$export$c24727297075ec6a","_props_validationBehavior","_ref","$akiWb$useSelectState","isFocusVisible","focusProps","$akiWb$useFocusRing","buttonRef","$akiWb$useRef","labelRef","$64fa3d84918910a7$export$9d4c57ee4c6ffdd8","valueProps","hiddenSelectProps","validation","$akiWb$useSelect","$64fa3d84918910a7$export$ef03459518577ad4","buttonWidth","setButtonWidth","$akiWb$useState","onResize","$akiWb$useCallback","$akiWb$useResizeObserver","renderPropsState","renderProps","$64fa3d84918910a7$export$4d86445c2cf5e3","DOMProps","$akiWb$filterDOMProps","scrollRef","$64fa3d84918910a7$export$2881499e37b75b9a","$82d7e5349645de74$export$f8f745c04421623f","$de32f1b87079253c$export$d2f961adcb0afbe","$07b14b47974efb58$export$9b9a0cd73afb7ca4","$eed445e0843c11d0$export$7ff8f37d2d81a48d","$eed445e0843c11d0$export$7c5906fe4f1f2af2","$ee014567cb39d3f0$export$ff05c3ac10437e03","$akiWb$mergeProps","$akiWb$HiddenSelect","$82d7e5349645de74$export$e288731fd71264f0","_state_selectedItem","_state_selectedItem1","$akiWb$useContext","placeholder","selectedItem","rendered","stringFormatter","$akiWb$useLocalizedStringFormatter","$akiWb$intlStringsmodulejs","_state_selectedItem_value","_state_selectedItem_textValue","withProvider","withContext","createSlotRecipeContext","SelectRootSlot","SelectTriggerSlot","SelectTriggerLabelSlot","SelectOptionsSlot","SelectOptionSlot","SelectOptionGroupSlot","SelectClearButton","useContext","SelectStateContext","onPressRequest","ClearPressResponder","jsx","IconButton","CloseIcon","SelectRoot","forwardRef","isLoading","recipe","useSlotRecipe","selectSlotRecipe","recipeProps","restRecipeProps","styleProps","restProps","extractStyleProps","raSelectProps","jsxs","RaSelect","chakra","RaButton","RaSelectValue","Flex","Box","SpinnerIcon","DropdownIndicatorIcon","RaPopover","SelectOptions","rest","RaListBox","SelectOption","RaListBoxItem","SelectOptionGroup","items","RaListBoxSection","RaHeader","Collection","Select","_SelectRoot","_SelectOptions","_SelectOption","_SelectOptionGroup"],"mappings":"44CAyBMA,EAA4C,IAAI,QACtD,SAASC,GAA0CC,EAAOC,EAAOC,EAAK,CAClE,GAAI,CAAE,iBAAkBC,EAAkB,WAAYC,EAAY,WAAYC,EAAY,KAAMC,EAAM,KAAMC,EAAM,mBAAoBC,EAAqB,MAAM,EAAKR,EAGlKS,EAAeC,6CAAoB,CACnC,MAAO,SACP,YAAa,MACrB,CAAK,EACGC,EAAeC,EAAAA,QAAgB,IAAIT,GAAoB,IAAQU,EAAAA,0CAA6BZ,EAAM,WAAYA,EAAM,aAAcC,EAAKO,CAAQ,EAAG,CAClJN,EACAF,EAAM,WACNA,EAAM,aACNQ,EACAP,CACR,CAAK,EACG,CAAE,iBAAkBY,EAAkB,UAAWC,CAAS,EAASC,4CAAuB,CAC1F,WAAYZ,EACZ,KAAM,SACd,EAAOH,EAAOC,CAAG,EACTe,EAAaC,GAAI,CACjB,OAAOA,EAAE,IAAG,CACR,IAAK,YACD,CACI,IAAIC,EAAuBC,EAE3BF,EAAE,eAAc,EAChB,IAAIG,EAAMpB,EAAM,aAAe,MAAQkB,EAAwBR,EAAS,eAAiB,MAAQQ,IAA0B,OAAS,OA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ACG,CACH,KAAM,CAAE,IAAAE,EAAK,MAAAsD,EAAO,MAAA0I,EAAO,SAAA3G,EAAU,GAAGwF,GAAc/K,EAGtD,GAAIkM,GAAS,OAAO3G,GAAa,WAC/B,MAAM,IAAI,MACR,4EAAA,EAIJ,OACE2F,EAAAA,KAACiB,EAAAA,yCAAA,CAAiB,IAAAjM,EAAW,GAAG6K,EAC9B,SAAA,CAAAZ,EAAAA,IAACN,IAAsB,QAAO,GAC5B,SAAAM,MAACiC,GAAAA,0CAAA,CAAU,WAAM,CAAA,CACnB,EAECF,EACC/B,EAAAA,IAACkC,EAAAA,0CAAA,CAAW,MAAAH,EACT,SAACnI,GACI,OAAOwB,GAAa,WACfA,EAASxB,CAAI,EAEf,KAEX,EAECwB,CAAA,EAEL,CAEJ,EAEA0G,EAAkB,YAAc,qBCvCzB,MAAMK,GAAS,CACpB,KAAMC,EACN,QAASC,EACT,OAAQC,EACR,YAAaC,CACf","x_google_ignoreList":[0,1,2,3]}
|
|
1
|
+
{"version":3,"file":"select-BuXA5VgT.cjs.js","sources":["../../../../node_modules/.pnpm/@react-aria+select@3.16.2_react-dom@19.1.1_react@19.1.1__react@19.1.1/node_modules/@react-aria/select/dist/useSelect.mjs","../../../../node_modules/.pnpm/@react-aria+select@3.16.2_react-dom@19.1.1_react@19.1.1__react@19.1.1/node_modules/@react-aria/select/dist/HiddenSelect.mjs","../../../../node_modules/.pnpm/@react-stately+select@3.7.1_react@19.1.1/node_modules/@react-stately/select/dist/useSelectState.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/Select.mjs","../../src/components/select/select.slots.tsx","../../src/components/select/components/select.clear-button.tsx","../../src/components/select/components/select.root.tsx","../../src/components/select/components/select.options.tsx","../../src/components/select/components/select.option.tsx","../../src/components/select/components/select.option-group.tsx","../../src/components/select/select.tsx"],"sourcesContent":["import {filterDOMProps as $aUnai$filterDOMProps, mergeProps as $aUnai$mergeProps, useId as $aUnai$useId, chain as $aUnai$chain} from \"@react-aria/utils\";\nimport {useMemo as $aUnai$useMemo} from \"react\";\nimport {ListKeyboardDelegate as $aUnai$ListKeyboardDelegate, useTypeSelect as $aUnai$useTypeSelect} from \"@react-aria/selection\";\nimport {setInteractionModality as $aUnai$setInteractionModality} from \"@react-aria/interactions\";\nimport {useCollator as $aUnai$useCollator} from \"@react-aria/i18n\";\nimport {useField as $aUnai$useField} from \"@react-aria/label\";\nimport {useMenuTrigger as $aUnai$useMenuTrigger} from \"@react-aria/menu\";\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\n\nconst $58aed456727eb0f3$export$703601b7e90536f8 = new WeakMap();\nfunction $58aed456727eb0f3$export$e64b2f635402ca43(props, state, ref) {\n let { keyboardDelegate: keyboardDelegate, isDisabled: isDisabled, isRequired: isRequired, name: name, form: form, validationBehavior: validationBehavior = 'aria' } = props;\n // By default, a KeyboardDelegate is provided which uses the DOM to query layout information (e.g. for page up/page down).\n // When virtualized, the layout object will be passed in as a prop and override this.\n let collator = (0, $aUnai$useCollator)({\n usage: 'search',\n sensitivity: 'base'\n });\n let delegate = (0, $aUnai$useMemo)(()=>keyboardDelegate || new (0, $aUnai$ListKeyboardDelegate)(state.collection, state.disabledKeys, ref, collator), [\n keyboardDelegate,\n state.collection,\n state.disabledKeys,\n collator,\n ref\n ]);\n let { menuTriggerProps: menuTriggerProps, menuProps: menuProps } = (0, $aUnai$useMenuTrigger)({\n isDisabled: isDisabled,\n type: 'listbox'\n }, state, ref);\n let onKeyDown = (e)=>{\n switch(e.key){\n case 'ArrowLeft':\n {\n var _delegate_getKeyAbove, _delegate_getFirstKey;\n // prevent scrolling containers\n e.preventDefault();\n let key = state.selectedKey != null ? (_delegate_getKeyAbove = delegate.getKeyAbove) === null || _delegate_getKeyAbove === void 0 ? void 0 : _delegate_getKeyAbove.call(delegate, state.selectedKey) : (_delegate_getFirstKey = delegate.getFirstKey) === null || _delegate_getFirstKey === void 0 ? void 0 : _delegate_getFirstKey.call(delegate);\n if (key) state.setSelectedKey(key);\n break;\n }\n case 'ArrowRight':\n {\n var _delegate_getKeyBelow, _delegate_getFirstKey1;\n // prevent scrolling containers\n e.preventDefault();\n let key = state.selectedKey != null ? (_delegate_getKeyBelow = delegate.getKeyBelow) === null || _delegate_getKeyBelow === void 0 ? void 0 : _delegate_getKeyBelow.call(delegate, state.selectedKey) : (_delegate_getFirstKey1 = delegate.getFirstKey) === null || _delegate_getFirstKey1 === void 0 ? void 0 : _delegate_getFirstKey1.call(delegate);\n if (key) state.setSelectedKey(key);\n break;\n }\n }\n };\n let { typeSelectProps: typeSelectProps } = (0, $aUnai$useTypeSelect)({\n keyboardDelegate: delegate,\n selectionManager: state.selectionManager,\n onTypeSelect (key) {\n state.setSelectedKey(key);\n }\n });\n let { isInvalid: isInvalid, validationErrors: validationErrors, validationDetails: validationDetails } = state.displayValidation;\n let { labelProps: labelProps, fieldProps: fieldProps, descriptionProps: descriptionProps, errorMessageProps: errorMessageProps } = (0, $aUnai$useField)({\n ...props,\n labelElementType: 'span',\n isInvalid: isInvalid,\n errorMessage: props.errorMessage || validationErrors\n });\n typeSelectProps.onKeyDown = typeSelectProps.onKeyDownCapture;\n delete typeSelectProps.onKeyDownCapture;\n let domProps = (0, $aUnai$filterDOMProps)(props, {\n labelable: true\n });\n let triggerProps = (0, $aUnai$mergeProps)(typeSelectProps, menuTriggerProps, fieldProps);\n let valueId = (0, $aUnai$useId)();\n $58aed456727eb0f3$export$703601b7e90536f8.set(state, {\n isDisabled: isDisabled,\n isRequired: isRequired,\n name: name,\n form: form,\n validationBehavior: validationBehavior\n });\n return {\n labelProps: {\n ...labelProps,\n onClick: ()=>{\n if (!props.isDisabled) {\n var _ref_current;\n (_ref_current = ref.current) === null || _ref_current === void 0 ? void 0 : _ref_current.focus();\n // Show the focus ring so the user knows where focus went\n (0, $aUnai$setInteractionModality)('keyboard');\n }\n }\n },\n triggerProps: (0, $aUnai$mergeProps)(domProps, {\n ...triggerProps,\n isDisabled: isDisabled,\n onKeyDown: (0, $aUnai$chain)(triggerProps.onKeyDown, onKeyDown, props.onKeyDown),\n onKeyUp: props.onKeyUp,\n 'aria-labelledby': [\n valueId,\n triggerProps['aria-labelledby'],\n triggerProps['aria-label'] && !triggerProps['aria-labelledby'] ? triggerProps.id : null\n ].filter(Boolean).join(' '),\n onFocus (e) {\n if (state.isFocused) return;\n if (props.onFocus) props.onFocus(e);\n if (props.onFocusChange) props.onFocusChange(true);\n state.setFocused(true);\n },\n onBlur (e) {\n if (state.isOpen) return;\n if (props.onBlur) props.onBlur(e);\n if (props.onFocusChange) props.onFocusChange(false);\n state.setFocused(false);\n }\n }),\n valueProps: {\n id: valueId\n },\n menuProps: {\n ...menuProps,\n autoFocus: state.focusStrategy || true,\n shouldSelectOnPressUp: true,\n shouldFocusOnHover: true,\n disallowEmptySelection: true,\n linkBehavior: 'selection',\n onBlur: (e)=>{\n if (e.currentTarget.contains(e.relatedTarget)) return;\n if (props.onBlur) props.onBlur(e);\n if (props.onFocusChange) props.onFocusChange(false);\n state.setFocused(false);\n },\n 'aria-labelledby': [\n fieldProps['aria-labelledby'],\n triggerProps['aria-label'] && !fieldProps['aria-labelledby'] ? triggerProps.id : null\n ].filter(Boolean).join(' ')\n },\n descriptionProps: descriptionProps,\n errorMessageProps: errorMessageProps,\n isInvalid: isInvalid,\n validationErrors: validationErrors,\n validationDetails: validationDetails,\n hiddenSelectProps: {\n isDisabled: isDisabled,\n name: name,\n label: props.label,\n state: state,\n triggerRef: ref,\n form: form\n }\n };\n}\n\n\nexport {$58aed456727eb0f3$export$703601b7e90536f8 as selectData, $58aed456727eb0f3$export$e64b2f635402ca43 as useSelect};\n//# sourceMappingURL=useSelect.module.js.map\n","import {selectData as $58aed456727eb0f3$export$703601b7e90536f8} from \"./useSelect.mjs\";\nimport $8BE50$react, {useCallback as $8BE50$useCallback, useRef as $8BE50$useRef} from \"react\";\nimport {useFormReset as $8BE50$useFormReset} from \"@react-aria/utils\";\nimport {useFormValidation as $8BE50$useFormValidation} from \"@react-aria/form\";\nimport {useVisuallyHidden as $8BE50$useVisuallyHidden} from \"@react-aria/visually-hidden\";\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\nfunction $bdd25dc72710631f$export$f809e80f58e251d1(props, state, triggerRef) {\n let data = (0, $58aed456727eb0f3$export$703601b7e90536f8).get(state) || {};\n let { autoComplete: autoComplete, name: name = data.name, form: form = data.form, isDisabled: isDisabled = data.isDisabled } = props;\n let { validationBehavior: validationBehavior, isRequired: isRequired } = data;\n let { visuallyHiddenProps: visuallyHiddenProps } = (0, $8BE50$useVisuallyHidden)({\n style: {\n // Prevent page scrolling.\n position: 'fixed',\n top: 0,\n left: 0\n }\n });\n (0, $8BE50$useFormReset)(props.selectRef, state.defaultSelectedKey, state.setSelectedKey);\n (0, $8BE50$useFormValidation)({\n validationBehavior: validationBehavior,\n focus: ()=>{\n var _triggerRef_current;\n return (_triggerRef_current = triggerRef.current) === null || _triggerRef_current === void 0 ? void 0 : _triggerRef_current.focus();\n }\n }, state, props.selectRef);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n let onChange = (0, $8BE50$useCallback)((e)=>state.setSelectedKey(e.currentTarget.value), [\n state.setSelectedKey\n ]);\n var _state_selectedKey;\n // In Safari, the <select> cannot have `display: none` or `hidden` for autofill to work.\n // In Firefox, there must be a <label> to identify the <select> whereas other browsers\n // seem to identify it just by surrounding text.\n // The solution is to use <VisuallyHidden> to hide the elements, which clips the elements to a\n // 1px rectangle. In addition, we hide from screen readers with aria-hidden, and make the <select>\n // non tabbable with tabIndex={-1}.\n return {\n containerProps: {\n ...visuallyHiddenProps,\n 'aria-hidden': true,\n // @ts-ignore\n ['data-react-aria-prevent-focus']: true,\n // @ts-ignore\n ['data-a11y-ignore']: 'aria-hidden-focus'\n },\n inputProps: {\n style: {\n display: 'none'\n }\n },\n selectProps: {\n tabIndex: -1,\n autoComplete: autoComplete,\n disabled: isDisabled,\n required: validationBehavior === 'native' && isRequired,\n name: name,\n form: form,\n value: (_state_selectedKey = state.selectedKey) !== null && _state_selectedKey !== void 0 ? _state_selectedKey : '',\n onChange: onChange,\n onInput: onChange\n }\n };\n}\nfunction $bdd25dc72710631f$export$cbd84cdb2e668835(props) {\n let { state: state, triggerRef: triggerRef, label: label, name: name, form: form, isDisabled: isDisabled } = props;\n let selectRef = (0, $8BE50$useRef)(null);\n let inputRef = (0, $8BE50$useRef)(null);\n let { containerProps: containerProps, selectProps: selectProps } = $bdd25dc72710631f$export$f809e80f58e251d1({\n ...props,\n selectRef: state.collection.size <= 300 ? selectRef : inputRef\n }, state, triggerRef);\n // If used in a <form>, use a hidden input so the value can be submitted to a server.\n // If the collection isn't too big, use a hidden <select> element for this so that browser\n // autofill will work. Otherwise, use an <input type=\"hidden\">.\n if (state.collection.size <= 300) return /*#__PURE__*/ (0, $8BE50$react).createElement(\"div\", {\n ...containerProps,\n \"data-testid\": \"hidden-select-container\"\n }, /*#__PURE__*/ (0, $8BE50$react).createElement(\"label\", null, label, /*#__PURE__*/ (0, $8BE50$react).createElement(\"select\", {\n ...selectProps,\n ref: selectRef\n }, /*#__PURE__*/ (0, $8BE50$react).createElement(\"option\", null), [\n ...state.collection.getKeys()\n ].map((key)=>{\n let item = state.collection.getItem(key);\n if (item && item.type === 'item') return /*#__PURE__*/ (0, $8BE50$react).createElement(\"option\", {\n key: item.key,\n value: item.key\n }, item.textValue);\n }))));\n else if (name) {\n let data = (0, $58aed456727eb0f3$export$703601b7e90536f8).get(state) || {};\n let { validationBehavior: validationBehavior } = data;\n var _state_selectedKey;\n let inputProps = {\n type: 'hidden',\n autoComplete: selectProps.autoComplete,\n name: name,\n form: form,\n disabled: isDisabled,\n value: (_state_selectedKey = state.selectedKey) !== null && _state_selectedKey !== void 0 ? _state_selectedKey : ''\n };\n if (validationBehavior === 'native') // Use a hidden <input type=\"text\"> rather than <input type=\"hidden\">\n // so that an empty value blocks HTML form submission when the field is required.\n return /*#__PURE__*/ (0, $8BE50$react).createElement(\"input\", {\n ...inputProps,\n ref: inputRef,\n style: {\n display: 'none'\n },\n type: \"text\",\n required: selectProps.required,\n onChange: ()=>{}\n });\n return /*#__PURE__*/ (0, $8BE50$react).createElement(\"input\", {\n ...inputProps,\n ref: inputRef\n });\n }\n return null;\n}\n\n\nexport {$bdd25dc72710631f$export$f809e80f58e251d1 as useHiddenSelect, $bdd25dc72710631f$export$cbd84cdb2e668835 as HiddenSelect};\n//# sourceMappingURL=HiddenSelect.module.js.map\n","import {useFormValidationState as $6FfNf$useFormValidationState} from \"@react-stately/form\";\nimport {useOverlayTriggerState as $6FfNf$useOverlayTriggerState} from \"@react-stately/overlays\";\nimport {useSingleSelectListState as $6FfNf$useSingleSelectListState} from \"@react-stately/list\";\nimport {useState as $6FfNf$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\n\nfunction $2bc3a590c5373a4e$export$5159ec8b34d4ec12(props) {\n let triggerState = (0, $6FfNf$useOverlayTriggerState)(props);\n let [focusStrategy, setFocusStrategy] = (0, $6FfNf$useState)(null);\n let listState = (0, $6FfNf$useSingleSelectListState)({\n ...props,\n onSelectionChange: (key)=>{\n if (props.onSelectionChange != null) props.onSelectionChange(key);\n triggerState.close();\n validationState.commitValidation();\n }\n });\n let validationState = (0, $6FfNf$useFormValidationState)({\n ...props,\n value: listState.selectedKey\n });\n let [isFocused, setFocused] = (0, $6FfNf$useState)(false);\n let [initialSelectedKey] = (0, $6FfNf$useState)(listState.selectedKey);\n var _props_defaultSelectedKey;\n return {\n ...validationState,\n ...listState,\n ...triggerState,\n defaultSelectedKey: (_props_defaultSelectedKey = props.defaultSelectedKey) !== null && _props_defaultSelectedKey !== void 0 ? _props_defaultSelectedKey : initialSelectedKey,\n focusStrategy: focusStrategy,\n open (focusStrategy = null) {\n // Don't open if the collection is empty.\n if (listState.collection.size !== 0) {\n setFocusStrategy(focusStrategy);\n triggerState.open();\n }\n },\n toggle (focusStrategy = null) {\n if (listState.collection.size !== 0) {\n setFocusStrategy(focusStrategy);\n triggerState.toggle();\n }\n },\n isFocused: isFocused,\n setFocused: setFocused\n };\n}\n\n\nexport {$2bc3a590c5373a4e$export$5159ec8b34d4ec12 as useSelectState};\n//# sourceMappingURL=useSelectState.module.js.map\n","import {ButtonContext as $d2b4bc8c273e7be6$export$24d547caef80ccd1} from \"./Button.mjs\";\nimport {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 $akiWb$intlStringsmodulejs from \"./intlStrings.mjs\";\nimport {LabelContext as $01b77f81d0f07f68$export$75b6ee27786ba447} from \"./Label.mjs\";\nimport {ListBoxContext as $eed445e0843c11d0$export$7ff8f37d2d81a48d, ListStateContext as $eed445e0843c11d0$export$7c5906fe4f1f2af2} from \"./ListBox.mjs\";\nimport {OverlayTriggerStateContext as $de32f1b87079253c$export$d2f961adcb0afbe} from \"./Dialog.mjs\";\nimport {PopoverContext as $07b14b47974efb58$export$9b9a0cd73afb7ca4} from \"./Popover.mjs\";\nimport {TextContext as $514c0188e459b4c0$export$9afb8bc826b033ea} from \"./Text.mjs\";\nimport {useFocusRing as $akiWb$useFocusRing, useSelect as $akiWb$useSelect, HiddenSelect as $akiWb$HiddenSelect, useLocalizedStringFormatter as $akiWb$useLocalizedStringFormatter} from \"react-aria\";\nimport {useSelectState as $akiWb$useSelectState} from \"react-stately\";\nimport {CollectionBuilder as $akiWb$CollectionBuilder} from \"@react-aria/collections\";\nimport {useResizeObserver as $akiWb$useResizeObserver, filterDOMProps as $akiWb$filterDOMProps, mergeProps as $akiWb$mergeProps} from \"@react-aria/utils\";\nimport $akiWb$react, {createContext as $akiWb$createContext, forwardRef as $akiWb$forwardRef, useMemo as $akiWb$useMemo, useRef as $akiWb$useRef, useState as $akiWb$useState, useCallback as $akiWb$useCallback, useContext as $akiWb$useContext} from \"react\";\n\n\nfunction $parcel$interopDefault(a) {\n return a && a.__esModule ? a.default : a;\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\n\n\n\n\n\n\nconst $82d7e5349645de74$export$7540cee5be7dc19b = /*#__PURE__*/ (0, $akiWb$createContext)(null);\nconst $82d7e5349645de74$export$ef445b55be0601bd = /*#__PURE__*/ (0, $akiWb$createContext)(null);\nconst $82d7e5349645de74$export$ef9b1a59e592288f = /*#__PURE__*/ (0, $akiWb$forwardRef)(function Select(props, ref) {\n [props, ref] = (0, $64fa3d84918910a7$export$29f1550f4b0d4415)(props, ref, $82d7e5349645de74$export$7540cee5be7dc19b);\n let { children: children, isDisabled: isDisabled = false, isInvalid: isInvalid = false, isRequired: isRequired = false } = props;\n let content = (0, $akiWb$useMemo)(()=>typeof children === 'function' ? children({\n isOpen: false,\n isDisabled: isDisabled,\n isInvalid: isInvalid,\n isRequired: isRequired,\n isFocused: false,\n isFocusVisible: false,\n defaultChildren: null\n }) : children, [\n children,\n isDisabled,\n isInvalid,\n isRequired\n ]);\n return /*#__PURE__*/ (0, $akiWb$react).createElement((0, $akiWb$CollectionBuilder), {\n content: content\n }, (collection)=>/*#__PURE__*/ (0, $akiWb$react).createElement($82d7e5349645de74$var$SelectInner, {\n props: props,\n collection: collection,\n selectRef: ref\n }));\n});\n// Contexts to clear inside the popover.\nconst $82d7e5349645de74$var$CLEAR_CONTEXTS = [\n (0, $01b77f81d0f07f68$export$75b6ee27786ba447),\n (0, $d2b4bc8c273e7be6$export$24d547caef80ccd1),\n (0, $514c0188e459b4c0$export$9afb8bc826b033ea)\n];\nfunction $82d7e5349645de74$var$SelectInner({ props: props, selectRef: ref, collection: collection }) {\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, $akiWb$useSelectState)({\n ...props,\n collection: collection,\n children: undefined,\n validationBehavior: validationBehavior\n });\n let { isFocusVisible: isFocusVisible, focusProps: focusProps } = (0, $akiWb$useFocusRing)({\n within: true\n });\n // Get props for child elements from useSelect\n let buttonRef = (0, $akiWb$useRef)(null);\n let [labelRef, label] = (0, $64fa3d84918910a7$export$9d4c57ee4c6ffdd8)(!props['aria-label'] && !props['aria-labelledby']);\n let { labelProps: labelProps, triggerProps: triggerProps, valueProps: valueProps, menuProps: menuProps, descriptionProps: descriptionProps, errorMessageProps: errorMessageProps, hiddenSelectProps: hiddenSelectProps, ...validation } = (0, $akiWb$useSelect)({\n ...(0, $64fa3d84918910a7$export$ef03459518577ad4)(props),\n label: label,\n validationBehavior: validationBehavior\n }, state, buttonRef);\n // Make menu width match input + button\n let [buttonWidth, setButtonWidth] = (0, $akiWb$useState)(null);\n let onResize = (0, $akiWb$useCallback)(()=>{\n if (buttonRef.current) setButtonWidth(buttonRef.current.offsetWidth + 'px');\n }, [\n buttonRef\n ]);\n (0, $akiWb$useResizeObserver)({\n ref: buttonRef,\n onResize: onResize\n });\n // Only expose a subset of state to renderProps function to avoid infinite render loop\n let renderPropsState = (0, $akiWb$useMemo)(()=>({\n isOpen: state.isOpen,\n isFocused: state.isFocused,\n isFocusVisible: isFocusVisible,\n isDisabled: props.isDisabled || false,\n isInvalid: validation.isInvalid || false,\n isRequired: props.isRequired || false\n }), [\n state.isOpen,\n state.isFocused,\n isFocusVisible,\n props.isDisabled,\n validation.isInvalid,\n props.isRequired\n ]);\n let renderProps = (0, $64fa3d84918910a7$export$4d86445c2cf5e3)({\n ...props,\n values: renderPropsState,\n defaultClassName: 'react-aria-Select'\n });\n let DOMProps = (0, $akiWb$filterDOMProps)(props, {\n global: true\n });\n delete DOMProps.id;\n let scrollRef = (0, $akiWb$useRef)(null);\n return /*#__PURE__*/ (0, $akiWb$react).createElement((0, $64fa3d84918910a7$export$2881499e37b75b9a), {\n values: [\n [\n $82d7e5349645de74$export$7540cee5be7dc19b,\n props\n ],\n [\n $82d7e5349645de74$export$ef445b55be0601bd,\n state\n ],\n [\n $82d7e5349645de74$export$f8f745c04421623f,\n valueProps\n ],\n [\n (0, $01b77f81d0f07f68$export$75b6ee27786ba447),\n {\n ...labelProps,\n ref: labelRef,\n elementType: 'span'\n }\n ],\n [\n (0, $d2b4bc8c273e7be6$export$24d547caef80ccd1),\n {\n ...triggerProps,\n ref: buttonRef,\n isPressed: state.isOpen,\n autoFocus: props.autoFocus\n }\n ],\n [\n (0, $de32f1b87079253c$export$d2f961adcb0afbe),\n state\n ],\n [\n (0, $07b14b47974efb58$export$9b9a0cd73afb7ca4),\n {\n trigger: 'Select',\n triggerRef: buttonRef,\n scrollRef: scrollRef,\n placement: 'bottom start',\n style: {\n '--trigger-width': buttonWidth\n },\n 'aria-labelledby': menuProps['aria-labelledby'],\n clearContexts: $82d7e5349645de74$var$CLEAR_CONTEXTS\n }\n ],\n [\n (0, $eed445e0843c11d0$export$7ff8f37d2d81a48d),\n {\n ...menuProps,\n ref: scrollRef\n }\n ],\n [\n (0, $eed445e0843c11d0$export$7c5906fe4f1f2af2),\n state\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 }, /*#__PURE__*/ (0, $akiWb$react).createElement(\"div\", {\n ...(0, $akiWb$mergeProps)(DOMProps, renderProps, focusProps),\n ref: ref,\n slot: props.slot || undefined,\n \"data-focused\": state.isFocused || undefined,\n \"data-focus-visible\": isFocusVisible || undefined,\n \"data-open\": state.isOpen || undefined,\n \"data-disabled\": props.isDisabled || undefined,\n \"data-invalid\": validation.isInvalid || undefined,\n \"data-required\": props.isRequired || undefined\n }, renderProps.children, /*#__PURE__*/ (0, $akiWb$react).createElement((0, $akiWb$HiddenSelect), {\n ...hiddenSelectProps,\n autoComplete: props.autoComplete\n })));\n}\nconst $82d7e5349645de74$export$f8f745c04421623f = /*#__PURE__*/ (0, $akiWb$createContext)(null);\nconst $82d7e5349645de74$export$e288731fd71264f0 = /*#__PURE__*/ (0, $akiWb$forwardRef)(function SelectValue(props, ref) {\n var _state_selectedItem, _state_selectedItem1;\n [props, ref] = (0, $64fa3d84918910a7$export$29f1550f4b0d4415)(props, ref, $82d7e5349645de74$export$f8f745c04421623f);\n let state = (0, $akiWb$useContext)($82d7e5349645de74$export$ef445b55be0601bd);\n let { placeholder: placeholder } = (0, $64fa3d84918910a7$export$fabf2dc03a41866e)($82d7e5349645de74$export$7540cee5be7dc19b);\n let selectedItem = state.selectedKey != null ? state.collection.getItem(state.selectedKey) : null;\n let rendered = selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.props.children;\n if (typeof rendered === 'function') {\n // If the selected item has a function as a child, we need to call it to render to React.JSX.\n let fn = rendered;\n rendered = fn({\n isHovered: false,\n isPressed: false,\n isSelected: false,\n isFocused: false,\n isFocusVisible: false,\n isDisabled: false,\n selectionMode: 'single',\n selectionBehavior: 'toggle'\n });\n }\n let stringFormatter = (0, $akiWb$useLocalizedStringFormatter)((0, ($parcel$interopDefault($akiWb$intlStringsmodulejs))), 'react-aria-components');\n var _ref, _state_selectedItem_value, _state_selectedItem_textValue;\n let renderProps = (0, $64fa3d84918910a7$export$4d86445c2cf5e3)({\n ...props,\n defaultChildren: (_ref = rendered !== null && rendered !== void 0 ? rendered : placeholder) !== null && _ref !== void 0 ? _ref : stringFormatter.format('selectPlaceholder'),\n defaultClassName: 'react-aria-SelectValue',\n values: {\n selectedItem: (_state_selectedItem_value = (_state_selectedItem = state.selectedItem) === null || _state_selectedItem === void 0 ? void 0 : _state_selectedItem.value) !== null && _state_selectedItem_value !== void 0 ? _state_selectedItem_value : null,\n selectedText: (_state_selectedItem_textValue = (_state_selectedItem1 = state.selectedItem) === null || _state_selectedItem1 === void 0 ? void 0 : _state_selectedItem1.textValue) !== null && _state_selectedItem_textValue !== void 0 ? _state_selectedItem_textValue : null,\n isPlaceholder: !selectedItem\n }\n });\n let DOMProps = (0, $akiWb$filterDOMProps)(props, {\n global: true\n });\n return /*#__PURE__*/ (0, $akiWb$react).createElement(\"span\", {\n ref: ref,\n ...DOMProps,\n ...renderProps,\n \"data-placeholder\": !selectedItem || undefined\n }, /*#__PURE__*/ (0, $akiWb$react).createElement((0, $514c0188e459b4c0$export$9afb8bc826b033ea).Provider, {\n value: undefined\n }, renderProps.children));\n});\n\n\nexport {$82d7e5349645de74$export$7540cee5be7dc19b as SelectContext, $82d7e5349645de74$export$ef445b55be0601bd as SelectStateContext, $82d7e5349645de74$export$ef9b1a59e592288f as Select, $82d7e5349645de74$export$f8f745c04421623f as SelectValueContext, $82d7e5349645de74$export$e288731fd71264f0 as SelectValue};\n//# sourceMappingURL=Select.module.js.map\n","/* 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 { selectSlotRecipe } from \"./select.recipe\";\nimport { type SelectProps as RaSelectProps } from \"react-aria-components\";\n\nconst { withProvider, withContext } = createSlotRecipeContext({\n key: \"select\",\n});\n\n// Select\nexport interface SelectRootSlotProps\n extends HTMLChakraProps<\n \"div\",\n RecipeVariantProps<typeof selectSlotRecipe> & RaSelectProps<object>\n > {}\nexport const SelectRootSlot = withProvider<HTMLDivElement, SelectRootSlotProps>(\n \"div\",\n \"root\"\n);\n\n// Trigger Button\nexport interface SelectTriggerSlotProps extends HTMLChakraProps<\"button\"> {}\nexport const SelectTriggerSlot = withContext<\n HTMLButtonElement,\n SelectTriggerSlotProps\n>(\"button\", \"trigger\");\n\n// Trigger Button Label\nexport interface SelectTriggerLabelSlotProps extends HTMLChakraProps<\"span\"> {}\nexport const SelectTriggerLabelSlot = withContext<\n HTMLButtonElement,\n SelectTriggerLabelSlotProps\n>(\"span\", \"triggerLabel\");\n\n// ListBox\nexport interface SelectOptionsSlotProps extends HTMLChakraProps<\"div\"> {}\nexport const SelectOptionsSlot = withContext<\n HTMLDivElement,\n SelectOptionsSlotProps\n>(\"div\", \"options\");\n\n// ListBoxItem\nexport interface SelectOptionSlotProps extends HTMLChakraProps<\"div\"> {}\nexport const SelectOptionSlot = withContext<\n HTMLDivElement,\n SelectOptionSlotProps\n>(\"div\", \"option\");\n\n// OptionGroup\nexport interface SelectOptionGroupSlotProps extends HTMLChakraProps<\"div\"> {}\nexport const SelectOptionGroupSlot = withContext<\n HTMLDivElement,\n SelectOptionGroupSlotProps\n>(\"div\", \"optionGroup\");\n","import { useContext } from \"react\";\nimport { Close as CloseIcon } from \"@commercetools/nimbus-icons\";\nimport { IconButton } from \"@/components\";\nimport { SelectStateContext } from \"react-aria-components\";\nimport { ClearPressResponder } from \"@react-aria/interactions\";\n\nexport const SelectClearButton = () => {\n const state = useContext(SelectStateContext);\n\n if (!state?.selectedKey) {\n return null;\n }\n\n const onPressRequest = () => {\n state?.setSelectedKey(null);\n };\n\n return (\n <ClearPressResponder>\n <IconButton\n pointerEvents=\"all\"\n size=\"2xs\"\n variant=\"ghost\"\n tone=\"primary\"\n aria-label=\"Clear Selection\"\n onPress={onPressRequest}\n >\n <CloseIcon />\n </IconButton>\n </ClearPressResponder>\n );\n};\n\nSelectClearButton.displayName = \"Select.ClearButton\";\n","import { forwardRef } from \"react\";\nimport { chakra, useSlotRecipe } from \"@chakra-ui/react/styled-system\";\n\nimport {\n KeyboardArrowDown as DropdownIndicatorIcon,\n Loop as SpinnerIcon,\n} from \"@commercetools/nimbus-icons\";\n\nimport { Flex, Box } from \"@/components\";\nimport {\n Button as RaButton,\n Popover as RaPopover,\n Select as RaSelect,\n SelectValue as RaSelectValue,\n} from \"react-aria-components\";\nimport {\n SelectRootSlot,\n SelectTriggerSlot,\n SelectTriggerLabelSlot,\n} from \"./../select.slots\";\nimport { SelectClearButton } from \"./select.clear-button\";\nimport { type SelectRootProps } from \"./../select.types\";\nimport { selectSlotRecipe } from \"../select.recipe\";\nimport { extractStyleProps } from \"@/utils/extractStyleProps\";\n\n/**\n * # Select\n *\n * displays a collapsible list of options and allows a user to select one of them.\n *\n * @see {@link https://nimbus-documentation.vercel.app/components/inputs/select}\n */\nexport const SelectRoot = forwardRef<HTMLDivElement, SelectRootProps>(\n ({ children, isLoading, isDisabled, ...props }, ref) => {\n const recipe = useSlotRecipe({ recipe: selectSlotRecipe });\n const [recipeProps, restRecipeProps] = recipe.splitVariantProps(props);\n const [styleProps, restProps] = extractStyleProps(restRecipeProps);\n\n const raSelectProps = {\n ...restProps,\n isDisabled: isLoading || isDisabled,\n };\n\n return (\n <SelectRootSlot asChild ref={ref} {...recipeProps} {...styleProps}>\n <RaSelect {...raSelectProps}>\n <chakra.div position=\"relative\">\n <SelectTriggerSlot zIndex={0} asChild>\n <RaButton>\n <SelectTriggerLabelSlot asChild>\n <RaSelectValue />\n </SelectTriggerLabelSlot>\n </RaButton>\n </SelectTriggerSlot>\n <Flex\n position=\"absolute\"\n top=\"0\"\n bottom=\"0\"\n zIndex={1}\n right=\"400\"\n pointerEvents=\"none\"\n >\n <Flex width=\"600\" my=\"auto\">\n <SelectClearButton />\n </Flex>\n\n <Flex my=\"auto\" w=\"600\" h=\"600\" pointerEvents=\"none\">\n <Box color=\"neutral.9\" asChild m=\"auto\" w=\"400\" h=\"400\">\n {isLoading ? (\n <Box asChild animation=\"spin\" animationDuration=\"slowest\">\n <SpinnerIcon />\n </Box>\n ) : (\n <DropdownIndicatorIcon />\n )}\n </Box>\n </Flex>\n </Flex>\n </chakra.div>\n\n <RaPopover>{children}</RaPopover>\n </RaSelect>\n </SelectRootSlot>\n );\n }\n);\n\nSelectRoot.displayName = \"Select.Root\";\n","import { ListBox as RaListBox } from \"react-aria-components\";\nimport { SelectOptionsSlot } from \"./../select.slots\";\nimport type { SelectOptionsProps } from \"../select.types\";\nimport { extractStyleProps } from \"@/utils/extractStyleProps\";\n\nexport const SelectOptions = <T extends object>(\n props: SelectOptionsProps<T> & { ref?: React.Ref<HTMLDivElement> }\n) => {\n const { ref, ...restProps } = props;\n const [styleProps, rest] = extractStyleProps(restProps);\n return (\n <SelectOptionsSlot asChild {...styleProps}>\n <RaListBox ref={ref} {...rest} />\n </SelectOptionsSlot>\n );\n};\n\nSelectOptions.displayName = \"Select.Options\";\n","import { ListBoxItem as RaListBoxItem } from \"react-aria-components\";\nimport { SelectOptionSlot } from \"./../select.slots\";\nimport type { SelectOptionProps } from \"../select.types\";\n\nexport const SelectOption = <T extends object>({\n ref,\n ...restProps\n}: SelectOptionProps<T> & { ref?: React.Ref<HTMLDivElement> }) => {\n return (\n <SelectOptionSlot asChild ref={ref}>\n <RaListBoxItem {...restProps} />\n </SelectOptionSlot>\n );\n};\n\nSelectOption.displayName = \"Select.Option\";\n","import { type ReactNode } from \"react\";\n\nimport {\n ListBoxSection as RaListBoxSection,\n Header as RaHeader,\n Collection,\n} from \"react-aria-components\";\nimport { SelectOptionGroupSlot } from \"./../select.slots\";\nimport type { SelectOptionGroupProps } from \"../select.types\";\n\nexport const SelectOptionGroup = <T extends object>(\n props: SelectOptionGroupProps<T> & { ref?: React.Ref<HTMLDivElement> }\n) => {\n const { ref, label, items, children, ...restProps } = props;\n\n // Validate that children is a function when items is provided\n if (items && typeof children !== \"function\") {\n throw new Error(\n 'SelectOptionGroup: When \"items\" is provided, \"children\" must be a function'\n );\n }\n\n return (\n <RaListBoxSection ref={ref} {...restProps}>\n <SelectOptionGroupSlot asChild>\n <RaHeader>{label}</RaHeader>\n </SelectOptionGroupSlot>\n\n {items ? (\n <Collection items={items}>\n {(item: T) => {\n if (typeof children === \"function\") {\n return children(item);\n }\n return null;\n }}\n </Collection>\n ) : (\n (children as ReactNode)\n )}\n </RaListBoxSection>\n );\n};\n\nSelectOptionGroup.displayName = \"Select.OptionGroup\";\n","import { SelectRoot as _SelectRoot } from \"./components/select.root\";\nimport { SelectOptions as _SelectOptions } from \"./components/select.options\";\nimport { SelectOption as _SelectOption } from \"./components/select.option\";\nimport { SelectOptionGroup as _SelectOptionGroup } from \"./components/select.option-group\";\n\nexport const Select = {\n Root: _SelectRoot,\n Options: _SelectOptions,\n Option: _SelectOption,\n OptionGroup: _SelectOptionGroup,\n};\n\n/**\n * todo: get rid of this, this is needed for the react-docgen-typescript script\n * that is parsing the typescript types for our documentation. The _ underscores\n * serve as a reminder that this exports are awkward and should not be used.\n */\nexport { _SelectRoot, _SelectOptions, _SelectOption, _SelectOptionGroup };\n"],"names":["$58aed456727eb0f3$export$703601b7e90536f8","$58aed456727eb0f3$export$e64b2f635402ca43","props","state","ref","keyboardDelegate","isDisabled","isRequired","name","form","validationBehavior","collator","$aUnai$useCollator","delegate","$aUnai$useMemo","$aUnai$ListKeyboardDelegate","menuTriggerProps","menuProps","$aUnai$useMenuTrigger","onKeyDown","e","_delegate_getKeyAbove","_delegate_getFirstKey","key","_delegate_getKeyBelow","_delegate_getFirstKey1","typeSelectProps","$aUnai$useTypeSelect","isInvalid","validationErrors","validationDetails","labelProps","fieldProps","descriptionProps","errorMessageProps","$aUnai$useField","domProps","$aUnai$filterDOMProps","triggerProps","$aUnai$mergeProps","valueId","$aUnai$useId","_ref_current","$aUnai$setInteractionModality","$aUnai$chain","$bdd25dc72710631f$export$f809e80f58e251d1","triggerRef","data","autoComplete","visuallyHiddenProps","$8BE50$useVisuallyHidden","$8BE50$useFormReset","$8BE50$useFormValidation","_triggerRef_current","onChange","$8BE50$useCallback","_state_selectedKey","$bdd25dc72710631f$export$cbd84cdb2e668835","label","selectRef","$8BE50$useRef","inputRef","containerProps","selectProps","$8BE50$react","item","inputProps","$2bc3a590c5373a4e$export$5159ec8b34d4ec12","triggerState","$6FfNf$useOverlayTriggerState","focusStrategy","setFocusStrategy","$6FfNf$useState","listState","$6FfNf$useSingleSelectListState","validationState","$6FfNf$useFormValidationState","isFocused","setFocused","initialSelectedKey","_props_defaultSelectedKey","$parcel$interopDefault","a","$82d7e5349645de74$export$7540cee5be7dc19b","$akiWb$createContext","$82d7e5349645de74$export$ef445b55be0601bd","$82d7e5349645de74$export$ef9b1a59e592288f","$akiWb$forwardRef","$64fa3d84918910a7$export$29f1550f4b0d4415","children","content","$akiWb$useMemo","$akiWb$react","$akiWb$CollectionBuilder","collection","$82d7e5349645de74$var$SelectInner","$82d7e5349645de74$var$CLEAR_CONTEXTS","$01b77f81d0f07f68$export$75b6ee27786ba447","$d2b4bc8c273e7be6$export$24d547caef80ccd1","$514c0188e459b4c0$export$9afb8bc826b033ea","formValidationBehavior","$64fa3d84918910a7$export$fabf2dc03a41866e","$d3e0e05bdfcf66bd$export$c24727297075ec6a","_props_validationBehavior","_ref","$akiWb$useSelectState","isFocusVisible","focusProps","$akiWb$useFocusRing","buttonRef","$akiWb$useRef","labelRef","$64fa3d84918910a7$export$9d4c57ee4c6ffdd8","valueProps","hiddenSelectProps","validation","$akiWb$useSelect","$64fa3d84918910a7$export$ef03459518577ad4","buttonWidth","setButtonWidth","$akiWb$useState","onResize","$akiWb$useCallback","$akiWb$useResizeObserver","renderPropsState","renderProps","$64fa3d84918910a7$export$4d86445c2cf5e3","DOMProps","$akiWb$filterDOMProps","scrollRef","$64fa3d84918910a7$export$2881499e37b75b9a","$82d7e5349645de74$export$f8f745c04421623f","$de32f1b87079253c$export$d2f961adcb0afbe","$07b14b47974efb58$export$9b9a0cd73afb7ca4","$eed445e0843c11d0$export$7ff8f37d2d81a48d","$eed445e0843c11d0$export$7c5906fe4f1f2af2","$ee014567cb39d3f0$export$ff05c3ac10437e03","$akiWb$mergeProps","$akiWb$HiddenSelect","$82d7e5349645de74$export$e288731fd71264f0","_state_selectedItem","_state_selectedItem1","$akiWb$useContext","placeholder","selectedItem","rendered","stringFormatter","$akiWb$useLocalizedStringFormatter","$akiWb$intlStringsmodulejs","_state_selectedItem_value","_state_selectedItem_textValue","withProvider","withContext","createSlotRecipeContext","SelectRootSlot","SelectTriggerSlot","SelectTriggerLabelSlot","SelectOptionsSlot","SelectOptionSlot","SelectOptionGroupSlot","SelectClearButton","useContext","SelectStateContext","onPressRequest","ClearPressResponder","jsx","IconButton","CloseIcon","SelectRoot","forwardRef","isLoading","recipe","useSlotRecipe","selectSlotRecipe","recipeProps","restRecipeProps","styleProps","restProps","extractStyleProps","raSelectProps","jsxs","RaSelect","chakra","RaButton","RaSelectValue","Flex","Box","SpinnerIcon","DropdownIndicatorIcon","RaPopover","SelectOptions","rest","RaListBox","SelectOption","RaListBoxItem","SelectOptionGroup","items","RaListBoxSection","RaHeader","Collection","Select","_SelectRoot","_SelectOptions","_SelectOption","_SelectOptionGroup"],"mappings":"44CAyBMA,EAA4C,IAAI,QACtD,SAASC,GAA0CC,EAAOC,EAAOC,EAAK,CAClE,GAAI,CAAE,iBAAkBC,EAAkB,WAAYC,EAAY,WAAYC,EAAY,KAAMC,EAAM,KAAMC,EAAM,mBAAoBC,EAAqB,MAAM,EAAKR,EAGlKS,EAAeC,6CAAoB,CACnC,MAAO,SACP,YAAa,MACrB,CAAK,EACGC,EAAeC,EAAAA,QAAgB,IAAIT,GAAoB,IAAQU,EAAAA,0CAA6BZ,EAAM,WAAYA,EAAM,aAAcC,EAAKO,CAAQ,EAAG,CAClJN,EACAF,EAAM,WACNA,EAAM,aACNQ,EACAP,CACR,CAAK,EACG,CAAE,iBAAkBY,EAAkB,UAAWC,CAAS,EAASC,4CAAuB,CAC1F,WAAYZ,EACZ,KAAM,SACd,EAAOH,EAAOC,CAAG,EACTe,EAAaC,GAAI,CACjB,OAAOA,EAAE,IAAG,CACR,IAAK,YACD,CACI,IAAIC,EAAuBC,EAE3BF,EAAE,eAAc,EAChB,IAAIG,EAAMpB,EAAM,aAAe,MAAQkB,EAAwBR,EAAS,eAAiB,MAAQQ,IAA0B,OAAS,OAASA,EAAsB,KAAKR,EAAUV,EAAM,WAAW,GAAKmB,EAAw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AA0I,EAAO,SAAA3G,EAAU,GAAGwF,GAAc/K,EAGtD,GAAIkM,GAAS,OAAO3G,GAAa,WAC/B,MAAM,IAAI,MACR,4EAAA,EAIJ,OACE2F,EAAAA,KAACiB,EAAAA,yCAAA,CAAiB,IAAAjM,EAAW,GAAG6K,EAC9B,SAAA,CAAAZ,EAAAA,IAACN,IAAsB,QAAO,GAC5B,SAAAM,MAACiC,GAAAA,0CAAA,CAAU,WAAM,CAAA,CACnB,EAECF,EACC/B,EAAAA,IAACkC,EAAAA,0CAAA,CAAW,MAAAH,EACT,SAACnI,GACI,OAAOwB,GAAa,WACfA,EAASxB,CAAI,EAEf,KAEX,EAECwB,CAAA,EAEL,CAEJ,EAEA0G,EAAkB,YAAc,qBCvCzB,MAAMK,GAAS,CACpB,KAAMC,EACN,QAASC,EACT,OAAQC,EACR,YAAaC,CACf","x_google_ignoreList":[0,1,2,3]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const e=require("react/jsx-runtime"),o=require("react"),R=require("./button-
|
|
2
|
-
//# sourceMappingURL=split-button-
|
|
1
|
+
"use strict";const e=require("react/jsx-runtime"),o=require("react"),R=require("./button-CihUSHJo.cjs.js"),T=require("./icon-button-DOo2GUqd.cjs.js"),V=require("@chakra-ui/react"),O=require("./index-BsmdMT4w.cjs.js"),G=require("@commercetools/nimbus-icons"),u=require("./menu-C8il9--K.cjs.js"),{withProvider:N,withContext:d}=V.createSlotRecipeContext({recipe:O.splitButtonSlotRecipe}),z=N("div","root"),K=d("div","buttonGroup"),L=d("button","primaryButton"),W=d("button","dropdownTrigger"),D=p=>{const{size:S="md",variant:b="solid",tone:g,isDisabled:m=!1,"aria-label":y,onAction:l,isOpen:C,defaultOpen:j,onOpenChange:M}=p,h={size:S,variant:b,tone:g},f=t=>{if(!o.isValidElement(t)||!t.props)return!1;const n=t.props;return"id"in n&&typeof n.id=="string"},I=t=>!o.isValidElement(t)||!t.props?!1:"children"in t.props,x=o.Children.toArray(p.children),A=x.find(t=>o.isValidElement(t)&&t.props?.slot==="icon"),a=x.filter(t=>!o.isValidElement(t)||t.props?.slot!=="icon"),B=t=>{let n=!1;return o.Children.forEach(t,r=>{if(!n){if(f(r)&&!r.props.isDisabled){n=!0;return}I(r)&&(n=B(r.props.children))}}),n},q=()=>{const t=[],n=c=>{o.Children.forEach(c,i=>{f(i)&&t.push({content:i.props.children,isDisabled:i.props.isDisabled||!1,actionId:i.props.id}),I(i)&&n(i.props.children)})};return n(a),t.find(c=>!c.isDisabled)||t[0]||{content:"No actions available",isDisabled:!0,actionId:null}},E=B(a),s=q(),P=()=>{!s.isDisabled&&s.actionId&&l&&l(s.actionId)},v=m||s.isDisabled,w=m||!E;return e.jsx(z,{variant:b,"data-mode":"split",children:e.jsxs(K,{children:[e.jsx(L,{asChild:!0,children:e.jsxs(R.Button,{...h,isDisabled:v,onPress:P,children:[A,s.content]})}),e.jsxs(u.Menu.Root,{trigger:"press",isOpen:C,defaultOpen:j,onOpenChange:M,placement:"bottom end",selectionMode:"none",onAction:l?t=>l(String(t)):void 0,children:[e.jsx(u.Menu.Trigger,{asChild:!0,children:e.jsx(W,{asChild:!0,children:e.jsx(T.IconButton,{...h,"aria-label":y,isDisabled:w,children:e.jsx(G.KeyboardArrowDown,{})})})}),e.jsx(u.Menu.Content,{children:a})]})]})})};D.displayName="SplitButton";exports.SplitButton=D;
|
|
2
|
+
//# sourceMappingURL=split-button-CgQYMeH7.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"split-button-i2Ezbf3P.cjs.js","sources":["../../src/components/split-button/split-button.slots.tsx","../../src/components/split-button/split-button.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-empty-object-type */\nimport {\n createSlotRecipeContext,\n type HTMLChakraProps,\n type RecipeVariantProps,\n} from \"@chakra-ui/react\";\nimport { splitButtonSlotRecipe } from \"./split-button.recipe\";\n\nconst { withProvider, withContext } = createSlotRecipeContext({\n recipe: splitButtonSlotRecipe,\n});\n\n// Root Container\nexport interface SplitButtonRootSlotProps\n extends HTMLChakraProps<\n \"div\",\n RecipeVariantProps<typeof splitButtonSlotRecipe>\n > {}\nexport const SplitButtonRootSlot = withProvider<\n HTMLDivElement,\n SplitButtonRootSlotProps\n>(\"div\", \"root\");\n\n// Button Group Container\nexport interface SplitButtonButtonGroupSlotProps\n extends HTMLChakraProps<\"div\"> {}\nexport const SplitButtonButtonGroupSlot = withContext<\n HTMLDivElement,\n SplitButtonButtonGroupSlotProps\n>(\"div\", \"buttonGroup\");\n\n// Primary Action Button\nexport interface SplitButtonPrimaryButtonSlotProps\n extends HTMLChakraProps<\"button\"> {}\nexport const SplitButtonPrimaryButtonSlot = withContext<\n HTMLButtonElement,\n SplitButtonPrimaryButtonSlotProps\n>(\"button\", \"primaryButton\");\n\n// Dropdown Trigger Button\nexport interface SplitButtonTriggerSlotProps\n extends HTMLChakraProps<\"button\"> {}\nexport const SplitButtonTriggerSlot = withContext<\n HTMLButtonElement,\n SplitButtonTriggerSlotProps\n>(\"button\", \"dropdownTrigger\");\n","import React from \"react\";\nimport { Button } from \"@/components/button\";\nimport { IconButton } from \"@/components/icon-button\";\nimport { Menu } from \"@/components/menu\";\nimport type { SplitButtonProps } from \"./split-button.types\";\nimport {\n SplitButtonRootSlot,\n SplitButtonButtonGroupSlot,\n SplitButtonPrimaryButtonSlot,\n SplitButtonTriggerSlot,\n} from \"./split-button.slots\";\nimport { KeyboardArrowDown } from \"@commercetools/nimbus-icons\";\n\n// Re-export types\nexport type * from \"./split-button.types\";\n\n/**\n * # SplitButton\n *\n * A split-button component that combines a primary action button with a dropdown menu.\n *\n * Shows a primary action button + dropdown trigger. The primary button automatically\n * executes the first enabled Menu.Item action, while the dropdown trigger opens a menu\n * with all available options.\n *\n * Use with Menu.Item, Menu.Section, and Menu.Separator components for content.\n */\nexport const SplitButton = (props: SplitButtonProps) => {\n const {\n size = \"md\",\n variant = \"solid\",\n tone,\n isDisabled = false,\n \"aria-label\": ariaLabel,\n onAction,\n isOpen,\n defaultOpen,\n onOpenChange,\n } = props;\n\n const buttonProps = { size, variant, tone };\n\n /**\n * CORE CONCEPT: In split button mode, we need to populate the primary button\n * with content from a Menu.Item (specified by defaultAction prop).\n *\n * Why this complexity exists:\n * - Users define actions as <Menu.Item id=\"save\">Save Document</Menu.Item>\n * - We need to extract \"Save Document\" text to show on the primary button\n * - Menu.Items can be nested inside Menu.Section components\n * - We need to handle disabled states and fallbacks\n */\n\n // Type guards for safe prop access\n interface MenuItemProps {\n id: string;\n children: React.ReactNode;\n isDisabled?: boolean;\n isCritical?: boolean;\n }\n\n interface ComponentWithChildren {\n children: React.ReactNode;\n }\n\n // Check if element is a Menu.Item with required props\n const isMenuItemWithId = (\n element: React.ReactNode\n ): element is React.ReactElement<MenuItemProps> => {\n if (!React.isValidElement(element) || !element.props) return false;\n const props = element.props as Record<string, unknown>;\n return \"id\" in props && typeof props.id === \"string\";\n };\n\n // Check if element has children prop\n const hasChildren = (\n element: React.ReactNode\n ): element is React.ReactElement<ComponentWithChildren> => {\n if (!React.isValidElement(element) || !element.props) return false;\n const props = element.props as Record<string, unknown>;\n return \"children\" in props;\n };\n\n // Separate Icon slots from Menu items\n const childArray = React.Children.toArray(props.children);\n const iconElement = childArray.find(\n (child): child is React.ReactElement =>\n React.isValidElement(child) &&\n (child.props as { slot?: string })?.slot === \"icon\"\n );\n const menuItems = childArray.filter(\n (child) =>\n !React.isValidElement(child) ||\n (child.props as { slot?: string })?.slot !== \"icon\"\n );\n\n /**\n * Check if there are any actionable (enabled) Menu.Items in the children.\n * This is used to determine if the dropdown trigger should be disabled.\n */\n const hasActionableMenuItems = (children: React.ReactNode): boolean => {\n let hasActionable = false;\n\n React.Children.forEach(children, (child) => {\n if (hasActionable) return;\n\n // Check if this is an enabled Menu.Item\n if (isMenuItemWithId(child) && !child.props.isDisabled) {\n hasActionable = true;\n return;\n }\n\n // Recurse into Menu.Section or any component with children\n if (hasChildren(child)) {\n hasActionable = hasActionableMenuItems(child.props.children);\n }\n });\n\n return hasActionable;\n };\n\n /**\n * Find the primary Menu.Item using the same logic as the original PrimaryActionDropdown.\n * Selects the first enabled Menu.Item, or falls back to the first Menu.Item if all are disabled.\n */\n const findPrimaryMenuItem = () => {\n const allMenuItems: Array<{\n content: React.ReactNode;\n isDisabled: boolean;\n actionId: string | null;\n }> = [];\n\n // Recursively collect all Menu.Items from children (including nested ones)\n const collectMenuItems = (children: React.ReactNode): void => {\n React.Children.forEach(children, (child) => {\n if (isMenuItemWithId(child)) {\n allMenuItems.push({\n content: child.props.children,\n isDisabled: child.props.isDisabled || false,\n actionId: child.props.id,\n });\n }\n\n // Recurse into Menu.Section or any component with children\n if (hasChildren(child)) {\n collectMenuItems(child.props.children);\n }\n });\n };\n\n collectMenuItems(menuItems);\n\n // Find first enabled Menu.Item, or fallback to first Menu.Item\n const primaryMenuItem =\n allMenuItems.find((item) => !item.isDisabled) || allMenuItems[0];\n\n return (\n primaryMenuItem || {\n // TODO: Localize this\n content: \"No actions available\",\n isDisabled: true,\n actionId: null,\n }\n );\n };\n\n // Check if there are any actionable menu items for dropdown functionality\n const hasActionableItems = hasActionableMenuItems(menuItems);\n\n // Get the primary button content using smart selection\n const buttonContent = findPrimaryMenuItem();\n\n const executePrimaryAction = () => {\n if (!buttonContent.isDisabled && buttonContent.actionId && onAction) {\n onAction(buttonContent.actionId);\n }\n };\n\n const isPrimaryDisabled = isDisabled || buttonContent.isDisabled;\n const isDropdownTriggerDisabled = isDisabled || !hasActionableItems;\n\n return (\n <SplitButtonRootSlot variant={variant} data-mode=\"split\">\n <SplitButtonButtonGroupSlot>\n {/* Primary Action Button */}\n <SplitButtonPrimaryButtonSlot asChild>\n <Button\n {...buttonProps}\n isDisabled={isPrimaryDisabled}\n onPress={executePrimaryAction}\n >\n {iconElement}\n {buttonContent.content}\n </Button>\n </SplitButtonPrimaryButtonSlot>\n\n {/* Menu Trigger and Dropdown */}\n <Menu.Root\n trigger=\"press\"\n isOpen={isOpen}\n defaultOpen={defaultOpen}\n onOpenChange={onOpenChange}\n placement=\"bottom end\"\n selectionMode=\"none\"\n onAction={onAction ? (key) => onAction(String(key)) : undefined}\n >\n <Menu.Trigger asChild>\n <SplitButtonTriggerSlot asChild>\n <IconButton\n {...buttonProps}\n aria-label={ariaLabel}\n isDisabled={isDropdownTriggerDisabled}\n >\n <KeyboardArrowDown />\n </IconButton>\n </SplitButtonTriggerSlot>\n </Menu.Trigger>\n\n <Menu.Content>{menuItems}</Menu.Content>\n </Menu.Root>\n </SplitButtonButtonGroupSlot>\n </SplitButtonRootSlot>\n );\n};\n\nSplitButton.displayName = \"SplitButton\";\n\n// Export for internal use by react-docgen\nexport { SplitButton as _SplitButton };\n"],"names":["withProvider","withContext","createSlotRecipeContext","splitButtonSlotRecipe","SplitButtonRootSlot","SplitButtonButtonGroupSlot","SplitButtonPrimaryButtonSlot","SplitButtonTriggerSlot","SplitButton","props","size","variant","tone","isDisabled","ariaLabel","onAction","isOpen","defaultOpen","onOpenChange","buttonProps","isMenuItemWithId","element","React","hasChildren","childArray","iconElement","child","menuItems","hasActionableMenuItems","children","hasActionable","findPrimaryMenuItem","allMenuItems","collectMenuItems","item","hasActionableItems","buttonContent","executePrimaryAction","isPrimaryDisabled","isDropdownTriggerDisabled","jsx","jsxs","Button","Menu","key","IconButton","KeyboardArrowDown"],"mappings":"sSAQM,CAAE,aAAAA,EAAc,YAAAC,CAAA,EAAgBC,0BAAwB,CAC5D,OAAQC,EAAAA,qBACV,CAAC,EAQYC,EAAsBJ,EAGjC,MAAO,MAAM,EAKFK,EAA6BJ,EAGxC,MAAO,aAAa,EAKTK,EAA+BL,EAG1C,SAAU,eAAe,EAKdM,EAAyBN,EAGpC,SAAU,iBAAiB,EClBhBO,EAAeC,GAA4B,CACtD,KAAM,CACJ,KAAAC,EAAO,KACP,QAAAC,EAAU,QACV,KAAAC,EACA,WAAAC,EAAa,GACb,aAAcC,EACd,SAAAC,EACA,OAAAC,EACA,YAAAC,EACA,aAAA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AK,UAAU,GAAKF,EAAa,CAAC,GAG5C,CAEjB,QAAS,uBACT,WAAY,GACZ,SAAU,IAAA,CAGhB,EAGMG,EAAqBP,EAAuBD,CAAS,EAGrDS,EAAgBL,EAAA,EAEhBM,EAAuB,IAAM,CAC7B,CAACD,EAAc,YAAcA,EAAc,UAAYrB,GACzDA,EAASqB,EAAc,QAAQ,CAEnC,EAEME,EAAoBzB,GAAcuB,EAAc,WAChDG,EAA4B1B,GAAc,CAACsB,EAEjD,aACG/B,EAAA,CAAoB,QAAAO,EAAkB,YAAU,QAC/C,gBAACN,EAAA,CAEC,SAAA,CAAAmC,EAAAA,IAAClC,EAAA,CAA6B,QAAO,GACnC,SAAAmC,EAAAA,KAACC,EAAAA,OAAA,CACE,GAAGvB,EACJ,WAAYmB,EACZ,QAASD,EAER,SAAA,CAAAZ,EACAW,EAAc,OAAA,CAAA,CAAA,EAEnB,EAGAK,EAAAA,KAACE,EAAAA,KAAK,KAAL,CACC,QAAQ,QACR,OAAA3B,EACA,YAAAC,EACA,aAAAC,EACA,UAAU,aACV,cAAc,OACd,SAAUH,EAAY6B,GAAQ7B,EAAS,OAAO6B,CAAG,CAAC,EAAI,OAEtD,SAAA,CAAAJ,EAAAA,IAACG,EAAAA,KAAK,QAAL,CAAa,QAAO,GACnB,SAAAH,EAAAA,IAACjC,EAAA,CAAuB,QAAO,GAC7B,SAAAiC,EAAAA,IAACK,EAAAA,WAAA,CACE,GAAG1B,EACJ,aAAYL,EACZ,WAAYyB,EAEZ,eAACO,EAAAA,kBAAA,CAAA,CAAkB,CAAA,CAAA,EAEvB,CAAA,CACF,EAEAN,EAAAA,IAACG,EAAAA,KAAK,QAAL,CAAc,SAAAhB,CAAA,CAAU,CAAA,CAAA,CAAA,CAC3B,CAAA,CACF,CAAA,CACF,CAEJ,EAEAnB,EAAY,YAAc"}
|
|
1
|
+
{"version":3,"file":"split-button-CgQYMeH7.cjs.js","sources":["../../src/components/split-button/split-button.slots.tsx","../../src/components/split-button/split-button.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-empty-object-type */\nimport {\n createSlotRecipeContext,\n type HTMLChakraProps,\n type RecipeVariantProps,\n} from \"@chakra-ui/react\";\nimport { splitButtonSlotRecipe } from \"./split-button.recipe\";\n\nconst { withProvider, withContext } = createSlotRecipeContext({\n recipe: splitButtonSlotRecipe,\n});\n\n// Root Container\nexport interface SplitButtonRootSlotProps\n extends HTMLChakraProps<\n \"div\",\n RecipeVariantProps<typeof splitButtonSlotRecipe>\n > {}\nexport const SplitButtonRootSlot = withProvider<\n HTMLDivElement,\n SplitButtonRootSlotProps\n>(\"div\", \"root\");\n\n// Button Group Container\nexport interface SplitButtonButtonGroupSlotProps\n extends HTMLChakraProps<\"div\"> {}\nexport const SplitButtonButtonGroupSlot = withContext<\n HTMLDivElement,\n SplitButtonButtonGroupSlotProps\n>(\"div\", \"buttonGroup\");\n\n// Primary Action Button\nexport interface SplitButtonPrimaryButtonSlotProps\n extends HTMLChakraProps<\"button\"> {}\nexport const SplitButtonPrimaryButtonSlot = withContext<\n HTMLButtonElement,\n SplitButtonPrimaryButtonSlotProps\n>(\"button\", \"primaryButton\");\n\n// Dropdown Trigger Button\nexport interface SplitButtonTriggerSlotProps\n extends HTMLChakraProps<\"button\"> {}\nexport const SplitButtonTriggerSlot = withContext<\n HTMLButtonElement,\n SplitButtonTriggerSlotProps\n>(\"button\", \"dropdownTrigger\");\n","import React from \"react\";\nimport { Button } from \"@/components/button\";\nimport { IconButton } from \"@/components/icon-button\";\nimport { Menu } from \"@/components/menu\";\nimport type { SplitButtonProps } from \"./split-button.types\";\nimport {\n SplitButtonRootSlot,\n SplitButtonButtonGroupSlot,\n SplitButtonPrimaryButtonSlot,\n SplitButtonTriggerSlot,\n} from \"./split-button.slots\";\nimport { KeyboardArrowDown } from \"@commercetools/nimbus-icons\";\n\n// Re-export types\nexport type * from \"./split-button.types\";\n\n/**\n * # SplitButton\n *\n * A split-button component that combines a primary action button with a dropdown menu.\n *\n * Shows a primary action button + dropdown trigger. The primary button automatically\n * executes the first enabled Menu.Item action, while the dropdown trigger opens a menu\n * with all available options.\n *\n * Use with Menu.Item, Menu.Section, and Menu.Separator components for content.\n */\nexport const SplitButton = (props: SplitButtonProps) => {\n const {\n size = \"md\",\n variant = \"solid\",\n tone,\n isDisabled = false,\n \"aria-label\": ariaLabel,\n onAction,\n isOpen,\n defaultOpen,\n onOpenChange,\n } = props;\n\n const buttonProps = { size, variant, tone };\n\n /**\n * CORE CONCEPT: In split button mode, we need to populate the primary button\n * with content from a Menu.Item (specified by defaultAction prop).\n *\n * Why this complexity exists:\n * - Users define actions as <Menu.Item id=\"save\">Save Document</Menu.Item>\n * - We need to extract \"Save Document\" text to show on the primary button\n * - Menu.Items can be nested inside Menu.Section components\n * - We need to handle disabled states and fallbacks\n */\n\n // Type guards for safe prop access\n interface MenuItemProps {\n id: string;\n children: React.ReactNode;\n isDisabled?: boolean;\n isCritical?: boolean;\n }\n\n interface ComponentWithChildren {\n children: React.ReactNode;\n }\n\n // Check if element is a Menu.Item with required props\n const isMenuItemWithId = (\n element: React.ReactNode\n ): element is React.ReactElement<MenuItemProps> => {\n if (!React.isValidElement(element) || !element.props) return false;\n const props = element.props as Record<string, unknown>;\n return \"id\" in props && typeof props.id === \"string\";\n };\n\n // Check if element has children prop\n const hasChildren = (\n element: React.ReactNode\n ): element is React.ReactElement<ComponentWithChildren> => {\n if (!React.isValidElement(element) || !element.props) return false;\n const props = element.props as Record<string, unknown>;\n return \"children\" in props;\n };\n\n // Separate Icon slots from Menu items\n const childArray = React.Children.toArray(props.children);\n const iconElement = childArray.find(\n (child): child is React.ReactElement =>\n React.isValidElement(child) &&\n (child.props as { slot?: string })?.slot === \"icon\"\n );\n const menuItems = childArray.filter(\n (child) =>\n !React.isValidElement(child) ||\n (child.props as { slot?: string })?.slot !== \"icon\"\n );\n\n /**\n * Check if there are any actionable (enabled) Menu.Items in the children.\n * This is used to determine if the dropdown trigger should be disabled.\n */\n const hasActionableMenuItems = (children: React.ReactNode): boolean => {\n let hasActionable = false;\n\n React.Children.forEach(children, (child) => {\n if (hasActionable) return;\n\n // Check if this is an enabled Menu.Item\n if (isMenuItemWithId(child) && !child.props.isDisabled) {\n hasActionable = true;\n return;\n }\n\n // Recurse into Menu.Section or any component with children\n if (hasChildren(child)) {\n hasActionable = hasActionableMenuItems(child.props.children);\n }\n });\n\n return hasActionable;\n };\n\n /**\n * Find the primary Menu.Item using the same logic as the original PrimaryActionDropdown.\n * Selects the first enabled Menu.Item, or falls back to the first Menu.Item if all are disabled.\n */\n const findPrimaryMenuItem = () => {\n const allMenuItems: Array<{\n content: React.ReactNode;\n isDisabled: boolean;\n actionId: string | null;\n }> = [];\n\n // Recursively collect all Menu.Items from children (including nested ones)\n const collectMenuItems = (children: React.ReactNode): void => {\n React.Children.forEach(children, (child) => {\n if (isMenuItemWithId(child)) {\n allMenuItems.push({\n content: child.props.children,\n isDisabled: child.props.isDisabled || false,\n actionId: child.props.id,\n });\n }\n\n // Recurse into Menu.Section or any component with children\n if (hasChildren(child)) {\n collectMenuItems(child.props.children);\n }\n });\n };\n\n collectMenuItems(menuItems);\n\n // Find first enabled Menu.Item, or fallback to first Menu.Item\n const primaryMenuItem =\n allMenuItems.find((item) => !item.isDisabled) || allMenuItems[0];\n\n return (\n primaryMenuItem || {\n // TODO: Localize this\n content: \"No actions available\",\n isDisabled: true,\n actionId: null,\n }\n );\n };\n\n // Check if there are any actionable menu items for dropdown functionality\n const hasActionableItems = hasActionableMenuItems(menuItems);\n\n // Get the primary button content using smart selection\n const buttonContent = findPrimaryMenuItem();\n\n const executePrimaryAction = () => {\n if (!buttonContent.isDisabled && buttonContent.actionId && onAction) {\n onAction(buttonContent.actionId);\n }\n };\n\n const isPrimaryDisabled = isDisabled || buttonContent.isDisabled;\n const isDropdownTriggerDisabled = isDisabled || !hasActionableItems;\n\n return (\n <SplitButtonRootSlot variant={variant} data-mode=\"split\">\n <SplitButtonButtonGroupSlot>\n {/* Primary Action Button */}\n <SplitButtonPrimaryButtonSlot asChild>\n <Button\n {...buttonProps}\n isDisabled={isPrimaryDisabled}\n onPress={executePrimaryAction}\n >\n {iconElement}\n {buttonContent.content}\n </Button>\n </SplitButtonPrimaryButtonSlot>\n\n {/* Menu Trigger and Dropdown */}\n <Menu.Root\n trigger=\"press\"\n isOpen={isOpen}\n defaultOpen={defaultOpen}\n onOpenChange={onOpenChange}\n placement=\"bottom end\"\n selectionMode=\"none\"\n onAction={onAction ? (key) => onAction(String(key)) : undefined}\n >\n <Menu.Trigger asChild>\n <SplitButtonTriggerSlot asChild>\n <IconButton\n {...buttonProps}\n aria-label={ariaLabel}\n isDisabled={isDropdownTriggerDisabled}\n >\n <KeyboardArrowDown />\n </IconButton>\n </SplitButtonTriggerSlot>\n </Menu.Trigger>\n\n <Menu.Content>{menuItems}</Menu.Content>\n </Menu.Root>\n </SplitButtonButtonGroupSlot>\n </SplitButtonRootSlot>\n );\n};\n\nSplitButton.displayName = \"SplitButton\";\n\n// Export for internal use by react-docgen\nexport { SplitButton as _SplitButton };\n"],"names":["withProvider","withContext","createSlotRecipeContext","splitButtonSlotRecipe","SplitButtonRootSlot","SplitButtonButtonGroupSlot","SplitButtonPrimaryButtonSlot","SplitButtonTriggerSlot","SplitButton","props","size","variant","tone","isDisabled","ariaLabel","onAction","isOpen","defaultOpen","onOpenChange","buttonProps","isMenuItemWithId","element","React","hasChildren","childArray","iconElement","child","menuItems","hasActionableMenuItems","children","hasActionable","findPrimaryMenuItem","allMenuItems","collectMenuItems","item","hasActionableItems","buttonContent","executePrimaryAction","isPrimaryDisabled","isDropdownTriggerDisabled","jsx","jsxs","Button","Menu","key","IconButton","KeyboardArrowDown"],"mappings":"sSAQM,CAAE,aAAAA,EAAc,YAAAC,CAAA,EAAgBC,0BAAwB,CAC5D,OAAQC,EAAAA,qBACV,CAAC,EAQYC,EAAsBJ,EAGjC,MAAO,MAAM,EAKFK,EAA6BJ,EAGxC,MAAO,aAAa,EAKTK,EAA+BL,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G,EAAAA,KAAK,QAAL,CAAc,SAAAhB,CAAA,CAAU,CAAA,CAAA,CAAA,CAC3B,CAAA,CACF,CAAA,CACF,CAEJ,EAEAnB,EAAY,YAAc"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const t=require("react/jsx-runtime"),x=require("react"),$=require("@chakra-ui/react"),R=require("./visually-hidden-Bh-G5QHv.cjs.js"),q=require("./extractStyleProps-
|
|
2
|
-
//# sourceMappingURL=switch-
|
|
1
|
+
"use strict";const t=require("react/jsx-runtime"),x=require("react"),$=require("@chakra-ui/react"),R=require("./visually-hidden-Bh-G5QHv.cjs.js"),q=require("./extractStyleProps-BsLft3q1.cjs.js"),f=require("./create-slot-recipe-context-CimocFDH.cjs.js"),w=require("./index-BsmdMT4w.cjs.js"),y=require("./useObjectRef-dXOJdONs.cjs.js"),j=require("./mergeProps-BA5Cwf5w.cjs.js"),g=require("./useToggleState-Dl-o05wQ.cjs.js"),m=require("./useToggle-VJWgbeCC.cjs.js"),k=require("./useFocusRing-CzFer4bD.cjs.js");function v(s,e,c){let{labelProps:i,inputProps:l,isSelected:o,isPressed:a,isDisabled:n,isReadOnly:d}=m.$d2c8e2b0480f3f34$export$cbe85ee05b554577(s,e,c);return{labelProps:i,inputProps:{...l,role:"switch",checked:o},isSelected:o,isPressed:a,isDisabled:n,isReadOnly:d}}const{withProvider:D,withContext:u}=f.createSlotRecipeContext({key:"switch"}),O=D("label","root"),T=u("span","label"),C=u("span","track"),F=u("span","thumb"),b=({ref:s,...e})=>{const c=x.useRef(null),i=y.$df56164dff5785e2$export$4338b53315abf666(s?$.mergeRefs(c,s):c),l=f.useSlotRecipe({recipe:w.switchSlotRecipe}),[o,a]=l.splitVariantProps(e),[n,d]=q.extractStyleProps(a),p=g.$3017fa7ffdddec74$export$8042c6c013fd5226(e),{inputProps:h}=v(d,p,i),{isFocused:S,focusProps:P}=k.$f7dceffc5ad7768b$export$4e328f61c538687f(),r={"data-selected":p.isSelected,"data-invalid":e.isInvalid,"data-disabled":e.isDisabled,"data-focus":S||void 0};return t.jsxs(O,{"data-slot":"root",...o,...r,...n,children:[t.jsxs(C,{"data-slot":"track",...r,children:[t.jsx(F,{"data-slot":"thumb",...r}),t.jsx(R.VisuallyHidden,{as:"span",children:t.jsx("input",{"data-slot":"input",...j.$3ef42575df84b30b$export$9d1611c77c2fe928(h,P),ref:i})})]}),e.children&&t.jsx(T,{"data-slot":"label",...r,children:e.children})]})};b.displayName="Switch";exports.Switch=b;
|
|
2
|
+
//# sourceMappingURL=switch-BQXiI02l.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"switch-
|
|
1
|
+
{"version":3,"file":"switch-BQXiI02l.cjs.js","sources":["../../../../node_modules/.pnpm/@react-aria+switch@3.7.7_react-dom@19.1.1_react@19.1.1__react@19.1.1/node_modules/@react-aria/switch/dist/useSwitch.mjs","../../src/components/switch/switch.slots.tsx","../../src/components/switch/switch.tsx"],"sourcesContent":["import {useToggle as $ifSyJ$useToggle} from \"@react-aria/toggle\";\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 */ \nfunction $b418ec0c85c52f27$export$d853f7095ae95f88(props, state, ref) {\n let { labelProps: labelProps, inputProps: inputProps, isSelected: isSelected, isPressed: isPressed, isDisabled: isDisabled, isReadOnly: isReadOnly } = (0, $ifSyJ$useToggle)(props, state, ref);\n return {\n labelProps: labelProps,\n inputProps: {\n ...inputProps,\n role: 'switch',\n checked: isSelected\n },\n isSelected: isSelected,\n isPressed: isPressed,\n isDisabled: isDisabled,\n isReadOnly: isReadOnly\n };\n}\n\n\nexport {$b418ec0c85c52f27$export$d853f7095ae95f88 as useSwitch};\n//# sourceMappingURL=useSwitch.module.js.map\n","/* 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 { switchSlotRecipe } from \"./switch.recipe\";\n\nconst { withProvider, withContext } = createSlotRecipeContext({\n key: \"switch\",\n});\n\nexport interface SwitchRootProps\n extends HTMLChakraProps<\n \"label\",\n RecipeVariantProps<typeof switchSlotRecipe>\n > {}\nexport const SwitchRootSlot = withProvider<HTMLLabelElement, SwitchRootProps>(\n \"label\",\n \"root\"\n);\n\ninterface SwitchLabelProps extends HTMLChakraProps<\"span\"> {}\nexport const SwitchLabelSlot = withContext<HTMLSpanElement, SwitchLabelProps>(\n \"span\",\n \"label\"\n);\n\ninterface SwitchTrackProps extends HTMLChakraProps<\"span\"> {}\nexport const SwitchTrackSlot = withContext<HTMLSpanElement, SwitchTrackProps>(\n \"span\",\n \"track\"\n);\n\ninterface SwitchThumbProps extends HTMLChakraProps<\"span\"> {}\nexport const SwitchThumbSlot = withContext<HTMLSpanElement, SwitchThumbProps>(\n \"span\",\n \"thumb\"\n);\n","import { useRef } from \"react\";\nimport { useToggleState } from \"react-stately\";\nimport { useFocusRing, useSwitch, useObjectRef, mergeProps } from \"react-aria\";\nimport { mergeRefs } from \"@chakra-ui/react\";\nimport { useSlotRecipe } from \"@chakra-ui/react/styled-system\";\nimport { VisuallyHidden } from \"@/components\";\nimport { extractStyleProps } from \"@/utils/extractStyleProps\";\nimport type { SwitchProps } from \"./switch.types\";\nimport {\n SwitchRootSlot,\n SwitchTrackSlot,\n SwitchThumbSlot,\n SwitchLabelSlot,\n} from \"./switch.slots\";\nimport { switchSlotRecipe } from \"./switch.recipe\";\n\n/**\n * # Switch\n *\n * A clear, visual toggle, allowing users to activate or deactivate a setting quickly.\n *\n * @see {@link https://nimbus-documentation.vercel.app/components/inputs/switch}\n */\nexport const Switch = ({ ref: externalRef, ...props }: SwitchProps) => {\n const localRef = useRef<HTMLInputElement>(null);\n const ref = useObjectRef(\n externalRef ? mergeRefs(localRef, externalRef) : localRef\n );\n\n const recipe = useSlotRecipe({ recipe: switchSlotRecipe });\n\n const [recipeProps, recipeLessProps] = recipe.splitVariantProps(props);\n const [styleProps, functionalProps] = extractStyleProps(recipeLessProps);\n\n const state = useToggleState(props);\n const { inputProps } = useSwitch(functionalProps, state, ref);\n\n const { isFocused, focusProps } = useFocusRing();\n\n const stateProps = {\n \"data-selected\": state.isSelected,\n \"data-invalid\": props.isInvalid,\n \"data-disabled\": props.isDisabled,\n \"data-focus\": isFocused || undefined,\n };\n return (\n <SwitchRootSlot\n data-slot=\"root\"\n {...recipeProps}\n {...stateProps}\n {...styleProps}\n >\n <SwitchTrackSlot data-slot=\"track\" {...stateProps}>\n <SwitchThumbSlot data-slot=\"thumb\" {...stateProps} />\n <VisuallyHidden as=\"span\">\n <input\n data-slot=\"input\"\n {...mergeProps(inputProps, focusProps)}\n ref={ref}\n />\n </VisuallyHidden>\n </SwitchTrackSlot>\n\n {props.children && (\n <SwitchLabelSlot data-slot=\"label\" {...stateProps}>\n {props.children}\n </SwitchLabelSlot>\n )}\n </SwitchRootSlot>\n );\n};\nSwitch.displayName = \"Switch\";\n"],"names":["$b418ec0c85c52f27$export$d853f7095ae95f88","props","state","ref","labelProps","inputProps","isSelected","isPressed","isDisabled","isReadOnly","$ifSyJ$useToggle","withProvider","withContext","createSlotRecipeContext","SwitchRootSlot","SwitchLabelSlot","SwitchTrackSlot","SwitchThumbSlot","Switch","externalRef","localRef","useRef","useObjectRef","mergeRefs","recipe","useSlotRecipe","switchSlotRecipe","recipeProps","recipeLessProps","styleProps","functionalProps","extractStyleProps","useToggleState","useSwitch","isFocused","focusProps","useFocusRing","stateProps","jsxs","jsx","VisuallyHidden","mergeProps"],"mappings":"2fAaA,SAASA,EAA0CC,EAAOC,EAAOC,EAAK,CA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CAAgB,YAAU,QAAS,GAAGqB,EACrC,SAAA,CAAAE,EAAAA,IAACtB,EAAA,CAAgB,YAAU,QAAS,GAAGoB,CAAA,CAAY,EACnDE,EAAAA,IAACC,EAAAA,eAAA,CAAe,GAAG,OACjB,SAAAD,EAAAA,IAAC,QAAA,CACC,YAAU,QACT,GAAGE,EAAAA,0CAAWpC,EAAY8B,CAAU,EACrC,IAAAhC,CAAA,CAAA,CACF,CACF,CAAA,EACF,EAECF,EAAM,UACLsC,MAACxB,EAAA,CAAgB,YAAU,QAAS,GAAGsB,EACpC,SAAApC,EAAM,QAAA,CACT,CAAA,CAAA,CAAA,CAIR,EACAiB,EAAO,YAAc","x_google_ignoreList":[0]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const w=require("react/jsx-runtime"),Ie=require("./Button-BtJHe9xY.cjs.js"),P=require("./SelectionManager-Mrwf4SFv.cjs.js"),L=require("./utils-BHdR5Nww.cjs.js"),Ge=require("./Label-BgrYyYXn.cjs.js"),R=require("./ListBox-CikEmFBx.cjs.js"),Ue=require("./Text-BWSfeB9p.cjs.js"),B=require("./mergeProps-BA5Cwf5w.cjs.js"),K=require("./filterDOMProps-WUskt27c.cjs.js"),We=require("./useObjectRef-dXOJdONs.cjs.js"),l=require("react"),U=require("./useFocusRing-CzFer4bD.cjs.js"),He=require("./useHover-CiP9jMFy.cjs.js"),z=require("./useHighlightSelectionDescription-CpDw-Mgj.cjs.js"),Je=require("./Separator-CAOg-vqY.cjs.js"),Qe=require("./useField-DmqO9k7a.cjs.js"),Xe=require("./useFocusWithin-BDSWp3rw.cjs.js"),W=require("./context-OoV8SSWX.cjs.js"),H=require("./openLink-DkCJYbzq.cjs.js"),y=require("./scrollIntoView-BzIqpHLO.cjs.js"),J=require("./useFocusVisible-Co0C61s7.cjs.js"),Ye=require("./useFocusable-DCgmQxS1.cjs.js"),j=require("./FocusScope-DPn5XtSy.cjs.js"),S=require("./focusSafely-jDMW9aEx.cjs.js"),Ze=require("./useLocalizedStringFormatter-sB0mFYtL.cjs.js"),_e=require("./create-slot-recipe-context-CimocFDH.cjs.js"),eo=require("@commercetools/nimbus-icons"),oo=require("./icon-button-D0NyGafI.cjs.js"),q=new WeakMap;function O(t,e){var o;let{id:a}=(o=q.get(t))!==null&&o!==void 0?o:{};if(!a)throw new Error("Unknown list");return`${a}-${to(e)}`}function to(t){return typeof t=="string"?t.replace(/\s*/g,""):""+t}function ro(t,e,o){let{isVirtualized:a,keyboardDelegate:c,layoutDelegate:r,onAction:n,disallowTypeAhead:d,linkBehavior:s="action",keyboardNavigationBehavior:x="arrow",escapeKeyBehavior:u="clearSelection",shouldSelectOnPressUp:g}=t;!t["aria-label"]&&!t["aria-labelledby"]&&console.warn("An aria-label or aria-labelledby prop is required for accessibility.");let{listProps:f}=Je.$982254629710d113$export$b95089534ab7c1fd({selectionManager:e.selectionManager,collection:e.collection,disabledKeys:e.disabledKeys,ref:o,keyboardDelegate:c,layoutDelegate:r,isVirtualized:a,selectOnFocus:e.selectionManager.selectionBehavior==="replace",shouldFocusWrap:t.shouldFocusWrap,linkBehavior:s,disallowTypeAhead:d,autoFocus:t.autoFocus,escapeKeyBehavior:u}),v=B.$bdb11010cef70236$export$f680877a34711e37(t.id);q.set(e,{id:v,onAction:n,linkBehavior:s,keyboardNavigationBehavior:x,shouldSelectOnPressUp:g});let b=z.$5b9b5b5723db6ae1$export$be42ebdab07ae4c2({selectionManager:e.selectionManager,hasItemActions:!!n}),E=z.$83013635b024ae3d$export$eac1895992b9f3d6(o,{isDisabled:e.collection.size!==0}),D=K.$65484d02dcb7eb3e$export$457c3d6518dd4c6f(t,{labelable:!0}),h=B.$3ef42575df84b30b$export$9d1611c77c2fe928(D,{role:"grid",id:v,"aria-multiselectable":e.selectionManager.selectionMode==="multiple"?"true":void 0},e.collection.size===0?{tabIndex:E?-1:0}:f,b);return a&&(h["aria-rowcount"]=e.collection.size,h["aria-colcount"]=1),z.$92599c3fd427b763$export$137e594ef3218a10({},e),{gridProps:h}}const I={expand:{ltr:"ArrowRight",rtl:"ArrowLeft"},collapse:{ltr:"ArrowLeft",rtl:"ArrowRight"}};function ao(t,e,o){var a,c;let{node:r,isVirtualized:n}=t,{direction:d}=W.$18f2051aff69b9bf$export$43bb16f9c6d9e3f7(),{onAction:s,linkBehavior:x,keyboardNavigationBehavior:u,shouldSelectOnPressUp:g}=q.get(e),f=B.$bdb11010cef70236$export$b4cc09c592e8fdb8(),v=l.useRef(null),b=()=>{var i;o.current!==null&&(v.current!=null&&r.key!==v.current||!(!((i=o.current)===null||i===void 0)&&i.contains(document.activeElement)))&&S.$3ad3f6e1647bc98d$export$80f3e147d781571c(o.current)},E={},D=t.hasChildItems,h=e.selectionManager.isLink(r.key);if(r!=null&&"expandedKeys"in e){var A,T;let i=(A=(T=e.collection).getChildren)===null||A===void 0?void 0:A.call(T,r.key);D=D||[...i??[]].length>1,s==null&&!h&&e.selectionManager.selectionMode==="none"&&D&&(s=()=>e.toggleKey(r.key));let p=D?e.expandedKeys.has(r.key):void 0,m=1;if(r.level>0&&r?.parentKey!=null){let $=e.collection.getItem(r.parentKey);if($){var k,F;m=[...(k=(F=e.collection).getChildren)===null||k===void 0?void 0:k.call(F,$.key)].filter(Oe=>Oe.type==="item").length}}else m=[...e.collection].filter($=>$.level===0&&$.type==="item").length;E={"aria-expanded":p,"aria-level":r.level+1,"aria-posinset":r?.index+1,"aria-setsize":m}}let{itemProps:N,...M}=P.$880e95eb8b93ba9a$export$ecf600387e221c37({selectionManager:e.selectionManager,key:r.key,ref:o,isVirtualized:n,shouldSelectOnPressUp:t.shouldSelectOnPressUp||g,onAction:s||!((a=r.props)===null||a===void 0)&&a.onAction?B.$ff5963eb1fccf552$export$e08e3b67e392101e((c=r.props)===null||c===void 0?void 0:c.onAction,s?()=>s(r.key):void 0):void 0,focus:b,linkBehavior:x}),Ke=i=>{if(!i.currentTarget.contains(i.target)||!o.current||!document.activeElement)return;let p=j.$9bf71ea28793e738$export$2d6ec8fc375ceafa(o.current);if(p.currentNode=document.activeElement,"expandedKeys"in e&&document.activeElement===o.current){if(i.key===I.expand[d]&&e.selectionManager.focusedKey===r.key&&D&&!e.expandedKeys.has(r.key)){e.toggleKey(r.key),i.stopPropagation();return}else if(i.key===I.collapse[d]&&e.selectionManager.focusedKey===r.key&&D&&e.expandedKeys.has(r.key)){e.toggleKey(r.key),i.stopPropagation();return}}switch(i.key){case"ArrowLeft":if(u==="arrow"){let $=d==="rtl"?p.nextNode():p.previousNode();if($)i.preventDefault(),i.stopPropagation(),S.$3ad3f6e1647bc98d$export$80f3e147d781571c($),y.$2f04cbc44ee30ce0$export$c826860796309d1b($,{containingElement:y.$62d8ded9296f3872$export$cfa2225e87938781(o.current)});else if(i.preventDefault(),i.stopPropagation(),d==="rtl")S.$3ad3f6e1647bc98d$export$80f3e147d781571c(o.current),y.$2f04cbc44ee30ce0$export$c826860796309d1b(o.current,{containingElement:y.$62d8ded9296f3872$export$cfa2225e87938781(o.current)});else{p.currentNode=o.current;let C=G(p);C&&(S.$3ad3f6e1647bc98d$export$80f3e147d781571c(C),y.$2f04cbc44ee30ce0$export$c826860796309d1b(C,{containingElement:y.$62d8ded9296f3872$export$cfa2225e87938781(o.current)}))}}break;case"ArrowRight":if(u==="arrow"){let $=d==="rtl"?p.previousNode():p.nextNode();if($)i.preventDefault(),i.stopPropagation(),S.$3ad3f6e1647bc98d$export$80f3e147d781571c($),y.$2f04cbc44ee30ce0$export$c826860796309d1b($,{containingElement:y.$62d8ded9296f3872$export$cfa2225e87938781(o.current)});else if(i.preventDefault(),i.stopPropagation(),d==="ltr")S.$3ad3f6e1647bc98d$export$80f3e147d781571c(o.current),y.$2f04cbc44ee30ce0$export$c826860796309d1b(o.current,{containingElement:y.$62d8ded9296f3872$export$cfa2225e87938781(o.current)});else{p.currentNode=o.current;let C=G(p);C&&(S.$3ad3f6e1647bc98d$export$80f3e147d781571c(C),y.$2f04cbc44ee30ce0$export$c826860796309d1b(C,{containingElement:y.$62d8ded9296f3872$export$cfa2225e87938781(o.current)}))}}break;case"ArrowUp":case"ArrowDown":if(!i.altKey&&o.current.contains(i.target)){var m;i.stopPropagation(),i.preventDefault(),(m=o.current.parentElement)===null||m===void 0||m.dispatchEvent(new KeyboardEvent(i.nativeEvent.type,i.nativeEvent))}break}},Ne=i=>{if(v.current=r.key,i.target!==o.current){J.$507fabe10e71c6fb$export$b9b3dfddab17db27()||e.selectionManager.setFocusedKey(r.key);return}},ze=i=>{if(!(!i.currentTarget.contains(i.target)||!o.current||!document.activeElement))switch(i.key){case"Tab":if(u==="tab"){let p=j.$9bf71ea28793e738$export$2d6ec8fc375ceafa(o.current,{tabbable:!0});p.currentNode=document.activeElement,(i.shiftKey?p.previousNode():p.nextNode())&&i.stopPropagation()}}},qe=H.$ea8dcbcb9ea1b556$export$bdc77b0c0a3a85d6(r.props),Ve=M.hasAction?qe:{},V=B.$3ef42575df84b30b$export$9d1611c77c2fe928(N,Ve,{role:"row",onKeyDownCapture:Ke,onKeyDown:ze,onFocus:Ne,"aria-label":r.textValue||void 0,"aria-selected":e.selectionManager.canSelectItem(r.key)?e.selectionManager.isSelected(r.key):void 0,"aria-disabled":e.selectionManager.isDisabled(r.key)||void 0,"aria-labelledby":f&&r.textValue?`${O(e,r.key)} ${f}`:void 0,id:O(e,r.key)});if(n){let{collection:i}=e,p=[...i];V["aria-rowindex"]=p.find(m=>m.type==="section")?[...i.getKeys()].filter(m=>{var $;return(($=i.getItem(m))===null||$===void 0?void 0:$.type)!=="section"}).findIndex(m=>m===r.key)+1:r.index+1}let je={role:"gridcell","aria-colindex":1};return{rowProps:{...B.$3ef42575df84b30b$export$9d1611c77c2fe928(V,E)},gridCellProps:je,descriptionProps:{id:f},...M}}function G(t){let e=null,o=null;do o=t.lastChild(),o&&(e=o);while(o);return e}const Q=new WeakMap;function io(t,e,o){let{direction:a}=W.$18f2051aff69b9bf$export$43bb16f9c6d9e3f7(),c=t.keyboardDelegate||new P.$2a25aae57d74318e$export$a05409b8bb224a5a({collection:e.collection,ref:o,orientation:"horizontal",direction:a,disabledKeys:e.disabledKeys,disabledBehavior:e.selectionManager.disabledBehavior}),{labelProps:r,fieldProps:n,descriptionProps:d,errorMessageProps:s}=Qe.$2baaea4c71418dea$export$294aa081a6c6f55d({...t,labelElementType:"span"}),{gridProps:x}=ro({...t,...n,keyboardDelegate:c,shouldFocusWrap:!0,linkBehavior:"override",keyboardNavigationBehavior:"tab"},e,o),[u,g]=l.useState(!1),{focusWithinProps:f}=Xe.$9ab94262bd0047c7$export$420e68273165f4ec({onFocusWithinChange:g}),v=K.$65484d02dcb7eb3e$export$457c3d6518dd4c6f(t),b=l.useRef(e.collection.size);return l.useEffect(()=>{o.current&&b.current>0&&e.collection.size===0&&u&&o.current.focus(),b.current=e.collection.size},[e.collection.size,u,o]),Q.set(e,{onRemove:t.onRemove}),{gridProps:B.$3ef42575df84b30b$export$9d1611c77c2fe928(x,v,{role:e.collection.size?"grid":"group","aria-atomic":!1,"aria-relevant":"additions","aria-live":u?"polite":"off",...f,...n}),labelProps:r,descriptionProps:d,errorMessageProps:s}}var X={};X={removeButtonLabel:"إزالة",removeDescription:"اضغط على مفتاح DELETE لإزالة علامة."};var Y={};Y={removeButtonLabel:"Премахване",removeDescription:"Натиснете Delete, за да премахнете маркера."};var Z={};Z={removeButtonLabel:"Odebrat",removeDescription:"Stisknutím klávesy Delete odeberete značku."};var _={};_={removeButtonLabel:"Fjern",removeDescription:"Tryk på Slet for at fjerne tag."};var ee={};ee={removeButtonLabel:"Entfernen",removeDescription:"Auf „Löschen“ drücken, um das Tag zu entfernen."};var oe={};oe={removeButtonLabel:"Κατάργηση",removeDescription:"Πατήστε Διαγραφή για να καταργήσετε την ετικέτα."};var te={};te={removeDescription:"Press Delete to remove tag.",removeButtonLabel:"Remove"};var re={};re={removeButtonLabel:"Quitar",removeDescription:"Pulse Eliminar para quitar la etiqueta."};var ae={};ae={removeButtonLabel:"Eemalda",removeDescription:"Sildi eemaldamiseks vajutage kustutusklahvi Delete."};var ie={};ie={removeButtonLabel:"Poista",removeDescription:"Poista tunniste painamalla Poista-painiketta."};var ne={};ne={removeButtonLabel:"Supprimer",removeDescription:"Appuyez sur Supprimer pour supprimer l’étiquette."};var le={};le={removeButtonLabel:"הסר",removeDescription:"לחץ על מחק כדי להסיר תג."};var ue={};ue={removeButtonLabel:"Ukloni",removeDescription:"Pritisnite Delete za uklanjanje oznake."};var ce={};ce={removeButtonLabel:"Eltávolítás",removeDescription:"Nyomja meg a Delete billentyűt a címke eltávolításához."};var de={};de={removeButtonLabel:"Rimuovi",removeDescription:"Premi Elimina per rimuovere il tag."};var se={};se={removeButtonLabel:"削除",removeDescription:"タグを削除するには、Delete キーを押します。"};var fe={};fe={removeButtonLabel:"제거",removeDescription:"태그를 제거하려면 Delete 키를 누르십시오."};var be={};be={removeButtonLabel:"Pašalinti",removeDescription:"Norėdami pašalinti žymą, paspauskite „Delete“ klavišą."};var pe={};pe={removeButtonLabel:"Noņemt",removeDescription:"Nospiediet Delete [Dzēst], lai noņemtu tagu."};var $e={};$e={removeButtonLabel:"Fjern",removeDescription:"Trykk på Slett for å fjerne taggen."};var ve={};ve={removeButtonLabel:"Verwijderen",removeDescription:"Druk op Verwijderen om de tag te verwijderen."};var xe={};xe={removeButtonLabel:"Usuń",removeDescription:"Naciśnij Usuń, aby usunąć znacznik."};var me={};me={removeButtonLabel:"Remover",removeDescription:"Pressione Delete para remover a tag."};var ge={};ge={removeButtonLabel:"Eliminar",removeDescription:"Prima Delete para eliminar a tag."};var ye={};ye={removeButtonLabel:"Îndepărtaţi",removeDescription:"Apăsați pe Delete (Ștergere) pentru a elimina eticheta."};var De={};De={removeButtonLabel:"Удалить",removeDescription:"Нажмите DELETE, чтобы удалить тег."};var Be={};Be={removeButtonLabel:"Odstrániť",removeDescription:"Ak chcete odstrániť značku, stlačte kláves Delete."};var Pe={};Pe={removeButtonLabel:"Odstrani",removeDescription:"Pritisnite Delete, da odstranite oznako."};var he={};he={removeButtonLabel:"Ukloni",removeDescription:"Pritisnite Obriši da biste uklonili oznaku."};var ke={};ke={removeButtonLabel:"Ta bort",removeDescription:"Tryck på Radera för att ta bort taggen."};var Ee={};Ee={removeButtonLabel:"Kaldır",removeDescription:"Etiketi kaldırmak için Sil tuşuna basın."};var Ce={};Ce={removeButtonLabel:"Вилучити",removeDescription:"Натисніть Delete, щоб вилучити тег."};var we={};we={removeButtonLabel:"删除",removeDescription:"按下“删除”以删除标记。"};var Le={};Le={removeButtonLabel:"移除",removeDescription:"按 Delete 鍵以移除標記。"};var Ae={};Ae={"ar-AE":X,"bg-BG":Y,"cs-CZ":Z,"da-DK":_,"de-DE":ee,"el-GR":oe,"en-US":te,"es-ES":re,"et-EE":ae,"fi-FI":ie,"fr-FR":ne,"he-IL":le,"hr-HR":ue,"hu-HU":ce,"it-IT":de,"ja-JP":se,"ko-KR":fe,"lt-LT":be,"lv-LV":pe,"nb-NO":$e,"nl-NL":ve,"pl-PL":xe,"pt-BR":me,"pt-PT":ge,"ro-RO":ye,"ru-RU":De,"sk-SK":Be,"sl-SI":Pe,"sr-SP":he,"sv-SE":ke,"tr-TR":Ee,"uk-UA":Ce,"zh-CN":we,"zh-TW":Le};function no(t){return t&&t.__esModule?t.default:t}function lo(t,e,o){let{item:a}=t,c=Ze.$fca6afa0e843324b$export$f12b703ca79dfbb1(no(Ae),"@react-aria/tag"),r=B.$bdb11010cef70236$export$f680877a34711e37(),{onRemove:n}=Q.get(e)||{},{rowProps:d,gridCellProps:s,...x}=ao({node:a},e,o),{descriptionProps:u,...g}=x,f=e.disabledKeys.has(a.key)||a.props.isDisabled,v=M=>{if(M.key==="Delete"||M.key==="Backspace"){if(f)return;M.preventDefault(),e.selectionManager.isSelected(a.key)?n?.(new Set(e.selectionManager.selectedKeys)):n?.(new Set([a.key]))}},b=J.$507fabe10e71c6fb$export$98e20ec92f614cfe();b==="virtual"&&typeof window<"u"&&"ontouchstart"in window&&(b="pointer");let E=n&&(b==="keyboard"||b==="virtual")?c.format("removeDescription"):"",D=y.$ef06256079686ba0$export$f8aeda7b10753fa1(E),h=a.key===e.selectionManager.focusedKey,A=e.selectionManager.focusedKey!=null,T=-1;!f&&(h||!A)&&(T=0);let k=K.$65484d02dcb7eb3e$export$457c3d6518dd4c6f(a.props),F=H.$ea8dcbcb9ea1b556$export$bdc77b0c0a3a85d6(a.props),{focusableProps:N}=Ye.$f645667febf57a63$export$4c014de7c8940b4c({isDisabled:f},o);return{removeButtonProps:{"aria-label":c.format("removeButtonLabel"),"aria-labelledby":`${r} ${d.id}`,isDisabled:f,id:r,onPress:()=>n?n(new Set([a.key])):null},rowProps:B.$3ef42575df84b30b$export$9d1611c77c2fe928(N,d,k,F,{tabIndex:T,onKeyDown:n?v:void 0,"aria-describedby":D["aria-describedby"]}),gridCellProps:B.$3ef42575df84b30b$export$9d1611c77c2fe928(s,{"aria-errormessage":t["aria-errormessage"],"aria-label":t["aria-label"]}),...g,allowsRemoving:!!n}}const uo=l.createContext(null),Te=l.createContext(null),co=l.forwardRef(function(e,o){return[e,o]=L.$64fa3d84918910a7$export$29f1550f4b0d4415(e,o,uo),l.createElement(P.$e1995378a142960e$export$bf788dd355e3a401,{content:e.children},a=>l.createElement(so,{props:e,forwardedRef:o,collection:a}))});function so({props:t,forwardedRef:e,collection:o}){let a;[a]=L.$64fa3d84918910a7$export$29f1550f4b0d4415({},null,P.$8e6cc465cc68f603$export$b0d3ecf7112093a7);let{filter:c,...r}=a,{shouldUseVirtualFocus:n,disallowTypeAhead:d,...s}=r||{},x=l.useRef(null),[u,g]=L.$64fa3d84918910a7$export$9d4c57ee4c6ffdd8(!t["aria-label"]&&!t["aria-labelledby"]),f=R.$e72dd72e1c76a225$export$2f645645f7bca764({...t,children:void 0,collection:o}),v=R.$e72dd72e1c76a225$export$ba9d38c0f1bf2b36(f,c),b=K.$65484d02dcb7eb3e$export$457c3d6518dd4c6f(t,{global:!0}),E=Object.fromEntries(Object.entries(b).map(([F])=>[F,void 0])),{gridProps:D,labelProps:h,descriptionProps:A,errorMessageProps:T}=io({...t,...E,...s,label:g},v,x);var k;return l.createElement("div",{...b,ref:e,slot:t.slot||void 0,className:(k=t.className)!==null&&k!==void 0?k:"react-aria-TagGroup",style:t.style},l.createElement(L.$64fa3d84918910a7$export$2881499e37b75b9a,{values:[[Ge.$01b77f81d0f07f68$export$75b6ee27786ba447,{...h,elementType:"span",ref:u}],[Te,{...D,ref:x}],[R.$eed445e0843c11d0$export$7c5906fe4f1f2af2,v],[Ue.$514c0188e459b4c0$export$9afb8bc826b033ea,{slots:{description:A,errorMessage:T}}]]},t.children))}const fo=l.forwardRef(function(e,o){return l.useContext(R.$eed445e0843c11d0$export$7c5906fe4f1f2af2)?l.createElement(bo,{props:e,forwardedRef:o}):l.createElement(P.$e1995378a142960e$export$fb8073518f34e6ec,e)});function bo({props:t,forwardedRef:e}){let o=l.useContext(R.$eed445e0843c11d0$export$7c5906fe4f1f2af2),{CollectionRoot:a}=l.useContext(P.$7135fc7d473fd974$export$4feb769f8ddf26c5),[c,r]=L.$64fa3d84918910a7$export$29f1550f4b0d4415({},e,Te),{focusProps:n,isFocused:d,isFocusVisible:s}=U.$f7dceffc5ad7768b$export$4e328f61c538687f(),x={isEmpty:o.collection.size===0,isFocused:d,isFocusVisible:s,state:o},u=L.$64fa3d84918910a7$export$4d86445c2cf5e3({className:t.className,style:t.style,defaultClassName:"react-aria-TagList",values:x}),g=P.$7135fc7d473fd974$export$90e00781bc59d8f9(o.selectionManager.focusedKey),f=K.$65484d02dcb7eb3e$export$457c3d6518dd4c6f(t,{global:!0});return l.createElement("div",{...B.$3ef42575df84b30b$export$9d1611c77c2fe928(f,u,c,n),ref:r,"data-empty":o.collection.size===0||void 0,"data-focused":d||void 0,"data-focus-visible":s||void 0},o.collection.size===0&&t.renderEmptyState?t.renderEmptyState(x):l.createElement(a,{collection:o.collection,persistedKeys:g}))}const po=P.$e1995378a142960e$export$18af5c7a9e9b3664(P.$23b9f4fcf0fe224b$export$fd11f34e1d07f134,(t,e,o)=>{let a=l.useContext(R.$eed445e0843c11d0$export$7c5906fe4f1f2af2),c=We.$df56164dff5785e2$export$4338b53315abf666(e),{focusProps:r,isFocusVisible:n}=U.$f7dceffc5ad7768b$export$4e328f61c538687f({within:!1}),{rowProps:d,gridCellProps:s,removeButtonProps:x,...u}=lo({item:o},a,c),{hoverProps:g,isHovered:f}=He.$6179b936705e76d3$export$ae780daf29e6d456({isDisabled:!u.allowsSelection,onHoverStart:o.props.onHoverStart,onHoverChange:o.props.onHoverChange,onHoverEnd:o.props.onHoverEnd}),v=L.$64fa3d84918910a7$export$4d86445c2cf5e3({...t,id:void 0,children:o.rendered,defaultClassName:"react-aria-Tag",values:{...u,isFocusVisible:n,isHovered:f,selectionMode:a.selectionManager.selectionMode,selectionBehavior:a.selectionManager.selectionBehavior}});l.useEffect(()=>{!o.textValue&&process.env.NODE_ENV!=="production"&&console.warn("A `textValue` prop is required for <Tag> elements with non-plain text children for accessibility.")},[o.textValue]);let b=K.$65484d02dcb7eb3e$export$457c3d6518dd4c6f(t,{global:!0});return delete b.id,delete b.onClick,l.createElement("div",{ref:c,...B.$3ef42575df84b30b$export$9d1611c77c2fe928(b,v,d,r,g),"data-selected":u.isSelected||void 0,"data-disabled":u.isDisabled||void 0,"data-hovered":f||void 0,"data-focused":u.isFocused||void 0,"data-focus-visible":n||void 0,"data-pressed":u.isPressed||void 0,"data-allows-removing":u.allowsRemoving||void 0,"data-selection-mode":a.selectionManager.selectionMode==="none"?void 0:a.selectionManager.selectionMode},l.createElement("div",{...s,style:{display:"contents"}},l.createElement(L.$64fa3d84918910a7$export$2881499e37b75b9a,{values:[[Ie.$d2b4bc8c273e7be6$export$24d547caef80ccd1,{slots:{remove:x}}],[P.$7135fc7d473fd974$export$4feb769f8ddf26c5,P.$7135fc7d473fd974$export$a164736487e3f0ae]]},v.children)))}),{withProvider:$o,withContext:Se}=_e.createSlotRecipeContext({key:"taggroup"}),vo=$o(co,"root"),xo=t=>{const{ref:e,...o}=t,a=Se(fo,"tagList");return w.jsx(a,{...o,ref:e})},mo=Se(po,"tag"),Fe=({children:t,onRemove:e,selectionMode:o,ref:a,...c})=>(e&&(o==="multiple"||o==="single")&&console.warn('Nimbus TagGroup: when "selectionMode" is "single" or "mutiple", Tags cannot be removed'),w.jsx(vo,{ref:a,onRemove:e,selectionMode:o,...c,children:t}));Fe.displayName="TagGroup.Root";const Me=({children:t,ref:e,...o})=>w.jsx(xo,{ref:e,...o,children:t});Me.displayName="TagGroup.TagList";const Re=({children:t,ref:e,...o})=>{const a=typeof t=="string"?t:void 0;return w.jsx(mo,{ref:e,textValue:a,...o,children:({allowsRemoving:c,isSelected:r,selectionMode:n})=>w.jsxs(w.Fragment,{children:[t,c&&n!=="multiple"&&n!=="single"&&w.jsx(oo.IconButton,{size:"2xs",variant:r?"solid":"ghost",slot:"remove",tone:r?void 0:"neutral",children:w.jsx(eo.Close,{})})]})})};Re.displayName="TagGroup.Tag";const go={Root:Fe,TagList:Me,Tag:Re};exports.TagGroup=go;
|
|
2
|
-
//# sourceMappingURL=tag-group-
|
|
1
|
+
"use strict";const w=require("react/jsx-runtime"),Ie=require("./Button-BtJHe9xY.cjs.js"),P=require("./SelectionManager-Mrwf4SFv.cjs.js"),L=require("./utils-BHdR5Nww.cjs.js"),Ge=require("./Label-BgrYyYXn.cjs.js"),R=require("./ListBox-CikEmFBx.cjs.js"),Ue=require("./Text-BWSfeB9p.cjs.js"),B=require("./mergeProps-BA5Cwf5w.cjs.js"),K=require("./filterDOMProps-WUskt27c.cjs.js"),We=require("./useObjectRef-dXOJdONs.cjs.js"),l=require("react"),U=require("./useFocusRing-CzFer4bD.cjs.js"),He=require("./useHover-CiP9jMFy.cjs.js"),z=require("./useHighlightSelectionDescription-CpDw-Mgj.cjs.js"),Je=require("./Separator-CAOg-vqY.cjs.js"),Qe=require("./useField-DmqO9k7a.cjs.js"),Xe=require("./useFocusWithin-BDSWp3rw.cjs.js"),W=require("./context-OoV8SSWX.cjs.js"),H=require("./openLink-DkCJYbzq.cjs.js"),y=require("./scrollIntoView-BzIqpHLO.cjs.js"),J=require("./useFocusVisible-Co0C61s7.cjs.js"),Ye=require("./useFocusable-DCgmQxS1.cjs.js"),j=require("./FocusScope-DPn5XtSy.cjs.js"),S=require("./focusSafely-jDMW9aEx.cjs.js"),Ze=require("./useLocalizedStringFormatter-sB0mFYtL.cjs.js"),_e=require("./create-slot-recipe-context-CimocFDH.cjs.js"),eo=require("@commercetools/nimbus-icons"),oo=require("./icon-button-DOo2GUqd.cjs.js"),q=new WeakMap;function O(t,e){var o;let{id:a}=(o=q.get(t))!==null&&o!==void 0?o:{};if(!a)throw new Error("Unknown list");return`${a}-${to(e)}`}function to(t){return typeof t=="string"?t.replace(/\s*/g,""):""+t}function ro(t,e,o){let{isVirtualized:a,keyboardDelegate:c,layoutDelegate:r,onAction:n,disallowTypeAhead:d,linkBehavior:s="action",keyboardNavigationBehavior:x="arrow",escapeKeyBehavior:u="clearSelection",shouldSelectOnPressUp:g}=t;!t["aria-label"]&&!t["aria-labelledby"]&&console.warn("An aria-label or aria-labelledby prop is required for accessibility.");let{listProps:f}=Je.$982254629710d113$export$b95089534ab7c1fd({selectionManager:e.selectionManager,collection:e.collection,disabledKeys:e.disabledKeys,ref:o,keyboardDelegate:c,layoutDelegate:r,isVirtualized:a,selectOnFocus:e.selectionManager.selectionBehavior==="replace",shouldFocusWrap:t.shouldFocusWrap,linkBehavior:s,disallowTypeAhead:d,autoFocus:t.autoFocus,escapeKeyBehavior:u}),v=B.$bdb11010cef70236$export$f680877a34711e37(t.id);q.set(e,{id:v,onAction:n,linkBehavior:s,keyboardNavigationBehavior:x,shouldSelectOnPressUp:g});let b=z.$5b9b5b5723db6ae1$export$be42ebdab07ae4c2({selectionManager:e.selectionManager,hasItemActions:!!n}),E=z.$83013635b024ae3d$export$eac1895992b9f3d6(o,{isDisabled:e.collection.size!==0}),D=K.$65484d02dcb7eb3e$export$457c3d6518dd4c6f(t,{labelable:!0}),h=B.$3ef42575df84b30b$export$9d1611c77c2fe928(D,{role:"grid",id:v,"aria-multiselectable":e.selectionManager.selectionMode==="multiple"?"true":void 0},e.collection.size===0?{tabIndex:E?-1:0}:f,b);return a&&(h["aria-rowcount"]=e.collection.size,h["aria-colcount"]=1),z.$92599c3fd427b763$export$137e594ef3218a10({},e),{gridProps:h}}const I={expand:{ltr:"ArrowRight",rtl:"ArrowLeft"},collapse:{ltr:"ArrowLeft",rtl:"ArrowRight"}};function ao(t,e,o){var a,c;let{node:r,isVirtualized:n}=t,{direction:d}=W.$18f2051aff69b9bf$export$43bb16f9c6d9e3f7(),{onAction:s,linkBehavior:x,keyboardNavigationBehavior:u,shouldSelectOnPressUp:g}=q.get(e),f=B.$bdb11010cef70236$export$b4cc09c592e8fdb8(),v=l.useRef(null),b=()=>{var i;o.current!==null&&(v.current!=null&&r.key!==v.current||!(!((i=o.current)===null||i===void 0)&&i.contains(document.activeElement)))&&S.$3ad3f6e1647bc98d$export$80f3e147d781571c(o.current)},E={},D=t.hasChildItems,h=e.selectionManager.isLink(r.key);if(r!=null&&"expandedKeys"in e){var A,T;let i=(A=(T=e.collection).getChildren)===null||A===void 0?void 0:A.call(T,r.key);D=D||[...i??[]].length>1,s==null&&!h&&e.selectionManager.selectionMode==="none"&&D&&(s=()=>e.toggleKey(r.key));let p=D?e.expandedKeys.has(r.key):void 0,m=1;if(r.level>0&&r?.parentKey!=null){let $=e.collection.getItem(r.parentKey);if($){var k,F;m=[...(k=(F=e.collection).getChildren)===null||k===void 0?void 0:k.call(F,$.key)].filter(Oe=>Oe.type==="item").length}}else m=[...e.collection].filter($=>$.level===0&&$.type==="item").length;E={"aria-expanded":p,"aria-level":r.level+1,"aria-posinset":r?.index+1,"aria-setsize":m}}let{itemProps:N,...M}=P.$880e95eb8b93ba9a$export$ecf600387e221c37({selectionManager:e.selectionManager,key:r.key,ref:o,isVirtualized:n,shouldSelectOnPressUp:t.shouldSelectOnPressUp||g,onAction:s||!((a=r.props)===null||a===void 0)&&a.onAction?B.$ff5963eb1fccf552$export$e08e3b67e392101e((c=r.props)===null||c===void 0?void 0:c.onAction,s?()=>s(r.key):void 0):void 0,focus:b,linkBehavior:x}),Ke=i=>{if(!i.currentTarget.contains(i.target)||!o.current||!document.activeElement)return;let p=j.$9bf71ea28793e738$export$2d6ec8fc375ceafa(o.current);if(p.currentNode=document.activeElement,"expandedKeys"in e&&document.activeElement===o.current){if(i.key===I.expand[d]&&e.selectionManager.focusedKey===r.key&&D&&!e.expandedKeys.has(r.key)){e.toggleKey(r.key),i.stopPropagation();return}else if(i.key===I.collapse[d]&&e.selectionManager.focusedKey===r.key&&D&&e.expandedKeys.has(r.key)){e.toggleKey(r.key),i.stopPropagation();return}}switch(i.key){case"ArrowLeft":if(u==="arrow"){let $=d==="rtl"?p.nextNode():p.previousNode();if($)i.preventDefault(),i.stopPropagation(),S.$3ad3f6e1647bc98d$export$80f3e147d781571c($),y.$2f04cbc44ee30ce0$export$c826860796309d1b($,{containingElement:y.$62d8ded9296f3872$export$cfa2225e87938781(o.current)});else if(i.preventDefault(),i.stopPropagation(),d==="rtl")S.$3ad3f6e1647bc98d$export$80f3e147d781571c(o.current),y.$2f04cbc44ee30ce0$export$c826860796309d1b(o.current,{containingElement:y.$62d8ded9296f3872$export$cfa2225e87938781(o.current)});else{p.currentNode=o.current;let C=G(p);C&&(S.$3ad3f6e1647bc98d$export$80f3e147d781571c(C),y.$2f04cbc44ee30ce0$export$c826860796309d1b(C,{containingElement:y.$62d8ded9296f3872$export$cfa2225e87938781(o.current)}))}}break;case"ArrowRight":if(u==="arrow"){let $=d==="rtl"?p.previousNode():p.nextNode();if($)i.preventDefault(),i.stopPropagation(),S.$3ad3f6e1647bc98d$export$80f3e147d781571c($),y.$2f04cbc44ee30ce0$export$c826860796309d1b($,{containingElement:y.$62d8ded9296f3872$export$cfa2225e87938781(o.current)});else if(i.preventDefault(),i.stopPropagation(),d==="ltr")S.$3ad3f6e1647bc98d$export$80f3e147d781571c(o.current),y.$2f04cbc44ee30ce0$export$c826860796309d1b(o.current,{containingElement:y.$62d8ded9296f3872$export$cfa2225e87938781(o.current)});else{p.currentNode=o.current;let C=G(p);C&&(S.$3ad3f6e1647bc98d$export$80f3e147d781571c(C),y.$2f04cbc44ee30ce0$export$c826860796309d1b(C,{containingElement:y.$62d8ded9296f3872$export$cfa2225e87938781(o.current)}))}}break;case"ArrowUp":case"ArrowDown":if(!i.altKey&&o.current.contains(i.target)){var m;i.stopPropagation(),i.preventDefault(),(m=o.current.parentElement)===null||m===void 0||m.dispatchEvent(new KeyboardEvent(i.nativeEvent.type,i.nativeEvent))}break}},Ne=i=>{if(v.current=r.key,i.target!==o.current){J.$507fabe10e71c6fb$export$b9b3dfddab17db27()||e.selectionManager.setFocusedKey(r.key);return}},ze=i=>{if(!(!i.currentTarget.contains(i.target)||!o.current||!document.activeElement))switch(i.key){case"Tab":if(u==="tab"){let p=j.$9bf71ea28793e738$export$2d6ec8fc375ceafa(o.current,{tabbable:!0});p.currentNode=document.activeElement,(i.shiftKey?p.previousNode():p.nextNode())&&i.stopPropagation()}}},qe=H.$ea8dcbcb9ea1b556$export$bdc77b0c0a3a85d6(r.props),Ve=M.hasAction?qe:{},V=B.$3ef42575df84b30b$export$9d1611c77c2fe928(N,Ve,{role:"row",onKeyDownCapture:Ke,onKeyDown:ze,onFocus:Ne,"aria-label":r.textValue||void 0,"aria-selected":e.selectionManager.canSelectItem(r.key)?e.selectionManager.isSelected(r.key):void 0,"aria-disabled":e.selectionManager.isDisabled(r.key)||void 0,"aria-labelledby":f&&r.textValue?`${O(e,r.key)} ${f}`:void 0,id:O(e,r.key)});if(n){let{collection:i}=e,p=[...i];V["aria-rowindex"]=p.find(m=>m.type==="section")?[...i.getKeys()].filter(m=>{var $;return(($=i.getItem(m))===null||$===void 0?void 0:$.type)!=="section"}).findIndex(m=>m===r.key)+1:r.index+1}let je={role:"gridcell","aria-colindex":1};return{rowProps:{...B.$3ef42575df84b30b$export$9d1611c77c2fe928(V,E)},gridCellProps:je,descriptionProps:{id:f},...M}}function G(t){let e=null,o=null;do o=t.lastChild(),o&&(e=o);while(o);return e}const Q=new WeakMap;function io(t,e,o){let{direction:a}=W.$18f2051aff69b9bf$export$43bb16f9c6d9e3f7(),c=t.keyboardDelegate||new P.$2a25aae57d74318e$export$a05409b8bb224a5a({collection:e.collection,ref:o,orientation:"horizontal",direction:a,disabledKeys:e.disabledKeys,disabledBehavior:e.selectionManager.disabledBehavior}),{labelProps:r,fieldProps:n,descriptionProps:d,errorMessageProps:s}=Qe.$2baaea4c71418dea$export$294aa081a6c6f55d({...t,labelElementType:"span"}),{gridProps:x}=ro({...t,...n,keyboardDelegate:c,shouldFocusWrap:!0,linkBehavior:"override",keyboardNavigationBehavior:"tab"},e,o),[u,g]=l.useState(!1),{focusWithinProps:f}=Xe.$9ab94262bd0047c7$export$420e68273165f4ec({onFocusWithinChange:g}),v=K.$65484d02dcb7eb3e$export$457c3d6518dd4c6f(t),b=l.useRef(e.collection.size);return l.useEffect(()=>{o.current&&b.current>0&&e.collection.size===0&&u&&o.current.focus(),b.current=e.collection.size},[e.collection.size,u,o]),Q.set(e,{onRemove:t.onRemove}),{gridProps:B.$3ef42575df84b30b$export$9d1611c77c2fe928(x,v,{role:e.collection.size?"grid":"group","aria-atomic":!1,"aria-relevant":"additions","aria-live":u?"polite":"off",...f,...n}),labelProps:r,descriptionProps:d,errorMessageProps:s}}var X={};X={removeButtonLabel:"إزالة",removeDescription:"اضغط على مفتاح DELETE لإزالة علامة."};var Y={};Y={removeButtonLabel:"Премахване",removeDescription:"Натиснете Delete, за да премахнете маркера."};var Z={};Z={removeButtonLabel:"Odebrat",removeDescription:"Stisknutím klávesy Delete odeberete značku."};var _={};_={removeButtonLabel:"Fjern",removeDescription:"Tryk på Slet for at fjerne tag."};var ee={};ee={removeButtonLabel:"Entfernen",removeDescription:"Auf „Löschen“ drücken, um das Tag zu entfernen."};var oe={};oe={removeButtonLabel:"Κατάργηση",removeDescription:"Πατήστε Διαγραφή για να καταργήσετε την ετικέτα."};var te={};te={removeDescription:"Press Delete to remove tag.",removeButtonLabel:"Remove"};var re={};re={removeButtonLabel:"Quitar",removeDescription:"Pulse Eliminar para quitar la etiqueta."};var ae={};ae={removeButtonLabel:"Eemalda",removeDescription:"Sildi eemaldamiseks vajutage kustutusklahvi Delete."};var ie={};ie={removeButtonLabel:"Poista",removeDescription:"Poista tunniste painamalla Poista-painiketta."};var ne={};ne={removeButtonLabel:"Supprimer",removeDescription:"Appuyez sur Supprimer pour supprimer l’étiquette."};var le={};le={removeButtonLabel:"הסר",removeDescription:"לחץ על מחק כדי להסיר תג."};var ue={};ue={removeButtonLabel:"Ukloni",removeDescription:"Pritisnite Delete za uklanjanje oznake."};var ce={};ce={removeButtonLabel:"Eltávolítás",removeDescription:"Nyomja meg a Delete billentyűt a címke eltávolításához."};var de={};de={removeButtonLabel:"Rimuovi",removeDescription:"Premi Elimina per rimuovere il tag."};var se={};se={removeButtonLabel:"削除",removeDescription:"タグを削除するには、Delete キーを押します。"};var fe={};fe={removeButtonLabel:"제거",removeDescription:"태그를 제거하려면 Delete 키를 누르십시오."};var be={};be={removeButtonLabel:"Pašalinti",removeDescription:"Norėdami pašalinti žymą, paspauskite „Delete“ klavišą."};var pe={};pe={removeButtonLabel:"Noņemt",removeDescription:"Nospiediet Delete [Dzēst], lai noņemtu tagu."};var $e={};$e={removeButtonLabel:"Fjern",removeDescription:"Trykk på Slett for å fjerne taggen."};var ve={};ve={removeButtonLabel:"Verwijderen",removeDescription:"Druk op Verwijderen om de tag te verwijderen."};var xe={};xe={removeButtonLabel:"Usuń",removeDescription:"Naciśnij Usuń, aby usunąć znacznik."};var me={};me={removeButtonLabel:"Remover",removeDescription:"Pressione Delete para remover a tag."};var ge={};ge={removeButtonLabel:"Eliminar",removeDescription:"Prima Delete para eliminar a tag."};var ye={};ye={removeButtonLabel:"Îndepărtaţi",removeDescription:"Apăsați pe Delete (Ștergere) pentru a elimina eticheta."};var De={};De={removeButtonLabel:"Удалить",removeDescription:"Нажмите DELETE, чтобы удалить тег."};var Be={};Be={removeButtonLabel:"Odstrániť",removeDescription:"Ak chcete odstrániť značku, stlačte kláves Delete."};var Pe={};Pe={removeButtonLabel:"Odstrani",removeDescription:"Pritisnite Delete, da odstranite oznako."};var he={};he={removeButtonLabel:"Ukloni",removeDescription:"Pritisnite Obriši da biste uklonili oznaku."};var ke={};ke={removeButtonLabel:"Ta bort",removeDescription:"Tryck på Radera för att ta bort taggen."};var Ee={};Ee={removeButtonLabel:"Kaldır",removeDescription:"Etiketi kaldırmak için Sil tuşuna basın."};var Ce={};Ce={removeButtonLabel:"Вилучити",removeDescription:"Натисніть Delete, щоб вилучити тег."};var we={};we={removeButtonLabel:"删除",removeDescription:"按下“删除”以删除标记。"};var Le={};Le={removeButtonLabel:"移除",removeDescription:"按 Delete 鍵以移除標記。"};var Ae={};Ae={"ar-AE":X,"bg-BG":Y,"cs-CZ":Z,"da-DK":_,"de-DE":ee,"el-GR":oe,"en-US":te,"es-ES":re,"et-EE":ae,"fi-FI":ie,"fr-FR":ne,"he-IL":le,"hr-HR":ue,"hu-HU":ce,"it-IT":de,"ja-JP":se,"ko-KR":fe,"lt-LT":be,"lv-LV":pe,"nb-NO":$e,"nl-NL":ve,"pl-PL":xe,"pt-BR":me,"pt-PT":ge,"ro-RO":ye,"ru-RU":De,"sk-SK":Be,"sl-SI":Pe,"sr-SP":he,"sv-SE":ke,"tr-TR":Ee,"uk-UA":Ce,"zh-CN":we,"zh-TW":Le};function no(t){return t&&t.__esModule?t.default:t}function lo(t,e,o){let{item:a}=t,c=Ze.$fca6afa0e843324b$export$f12b703ca79dfbb1(no(Ae),"@react-aria/tag"),r=B.$bdb11010cef70236$export$f680877a34711e37(),{onRemove:n}=Q.get(e)||{},{rowProps:d,gridCellProps:s,...x}=ao({node:a},e,o),{descriptionProps:u,...g}=x,f=e.disabledKeys.has(a.key)||a.props.isDisabled,v=M=>{if(M.key==="Delete"||M.key==="Backspace"){if(f)return;M.preventDefault(),e.selectionManager.isSelected(a.key)?n?.(new Set(e.selectionManager.selectedKeys)):n?.(new Set([a.key]))}},b=J.$507fabe10e71c6fb$export$98e20ec92f614cfe();b==="virtual"&&typeof window<"u"&&"ontouchstart"in window&&(b="pointer");let E=n&&(b==="keyboard"||b==="virtual")?c.format("removeDescription"):"",D=y.$ef06256079686ba0$export$f8aeda7b10753fa1(E),h=a.key===e.selectionManager.focusedKey,A=e.selectionManager.focusedKey!=null,T=-1;!f&&(h||!A)&&(T=0);let k=K.$65484d02dcb7eb3e$export$457c3d6518dd4c6f(a.props),F=H.$ea8dcbcb9ea1b556$export$bdc77b0c0a3a85d6(a.props),{focusableProps:N}=Ye.$f645667febf57a63$export$4c014de7c8940b4c({isDisabled:f},o);return{removeButtonProps:{"aria-label":c.format("removeButtonLabel"),"aria-labelledby":`${r} ${d.id}`,isDisabled:f,id:r,onPress:()=>n?n(new Set([a.key])):null},rowProps:B.$3ef42575df84b30b$export$9d1611c77c2fe928(N,d,k,F,{tabIndex:T,onKeyDown:n?v:void 0,"aria-describedby":D["aria-describedby"]}),gridCellProps:B.$3ef42575df84b30b$export$9d1611c77c2fe928(s,{"aria-errormessage":t["aria-errormessage"],"aria-label":t["aria-label"]}),...g,allowsRemoving:!!n}}const uo=l.createContext(null),Te=l.createContext(null),co=l.forwardRef(function(e,o){return[e,o]=L.$64fa3d84918910a7$export$29f1550f4b0d4415(e,o,uo),l.createElement(P.$e1995378a142960e$export$bf788dd355e3a401,{content:e.children},a=>l.createElement(so,{props:e,forwardedRef:o,collection:a}))});function so({props:t,forwardedRef:e,collection:o}){let a;[a]=L.$64fa3d84918910a7$export$29f1550f4b0d4415({},null,P.$8e6cc465cc68f603$export$b0d3ecf7112093a7);let{filter:c,...r}=a,{shouldUseVirtualFocus:n,disallowTypeAhead:d,...s}=r||{},x=l.useRef(null),[u,g]=L.$64fa3d84918910a7$export$9d4c57ee4c6ffdd8(!t["aria-label"]&&!t["aria-labelledby"]),f=R.$e72dd72e1c76a225$export$2f645645f7bca764({...t,children:void 0,collection:o}),v=R.$e72dd72e1c76a225$export$ba9d38c0f1bf2b36(f,c),b=K.$65484d02dcb7eb3e$export$457c3d6518dd4c6f(t,{global:!0}),E=Object.fromEntries(Object.entries(b).map(([F])=>[F,void 0])),{gridProps:D,labelProps:h,descriptionProps:A,errorMessageProps:T}=io({...t,...E,...s,label:g},v,x);var k;return l.createElement("div",{...b,ref:e,slot:t.slot||void 0,className:(k=t.className)!==null&&k!==void 0?k:"react-aria-TagGroup",style:t.style},l.createElement(L.$64fa3d84918910a7$export$2881499e37b75b9a,{values:[[Ge.$01b77f81d0f07f68$export$75b6ee27786ba447,{...h,elementType:"span",ref:u}],[Te,{...D,ref:x}],[R.$eed445e0843c11d0$export$7c5906fe4f1f2af2,v],[Ue.$514c0188e459b4c0$export$9afb8bc826b033ea,{slots:{description:A,errorMessage:T}}]]},t.children))}const fo=l.forwardRef(function(e,o){return l.useContext(R.$eed445e0843c11d0$export$7c5906fe4f1f2af2)?l.createElement(bo,{props:e,forwardedRef:o}):l.createElement(P.$e1995378a142960e$export$fb8073518f34e6ec,e)});function bo({props:t,forwardedRef:e}){let o=l.useContext(R.$eed445e0843c11d0$export$7c5906fe4f1f2af2),{CollectionRoot:a}=l.useContext(P.$7135fc7d473fd974$export$4feb769f8ddf26c5),[c,r]=L.$64fa3d84918910a7$export$29f1550f4b0d4415({},e,Te),{focusProps:n,isFocused:d,isFocusVisible:s}=U.$f7dceffc5ad7768b$export$4e328f61c538687f(),x={isEmpty:o.collection.size===0,isFocused:d,isFocusVisible:s,state:o},u=L.$64fa3d84918910a7$export$4d86445c2cf5e3({className:t.className,style:t.style,defaultClassName:"react-aria-TagList",values:x}),g=P.$7135fc7d473fd974$export$90e00781bc59d8f9(o.selectionManager.focusedKey),f=K.$65484d02dcb7eb3e$export$457c3d6518dd4c6f(t,{global:!0});return l.createElement("div",{...B.$3ef42575df84b30b$export$9d1611c77c2fe928(f,u,c,n),ref:r,"data-empty":o.collection.size===0||void 0,"data-focused":d||void 0,"data-focus-visible":s||void 0},o.collection.size===0&&t.renderEmptyState?t.renderEmptyState(x):l.createElement(a,{collection:o.collection,persistedKeys:g}))}const po=P.$e1995378a142960e$export$18af5c7a9e9b3664(P.$23b9f4fcf0fe224b$export$fd11f34e1d07f134,(t,e,o)=>{let a=l.useContext(R.$eed445e0843c11d0$export$7c5906fe4f1f2af2),c=We.$df56164dff5785e2$export$4338b53315abf666(e),{focusProps:r,isFocusVisible:n}=U.$f7dceffc5ad7768b$export$4e328f61c538687f({within:!1}),{rowProps:d,gridCellProps:s,removeButtonProps:x,...u}=lo({item:o},a,c),{hoverProps:g,isHovered:f}=He.$6179b936705e76d3$export$ae780daf29e6d456({isDisabled:!u.allowsSelection,onHoverStart:o.props.onHoverStart,onHoverChange:o.props.onHoverChange,onHoverEnd:o.props.onHoverEnd}),v=L.$64fa3d84918910a7$export$4d86445c2cf5e3({...t,id:void 0,children:o.rendered,defaultClassName:"react-aria-Tag",values:{...u,isFocusVisible:n,isHovered:f,selectionMode:a.selectionManager.selectionMode,selectionBehavior:a.selectionManager.selectionBehavior}});l.useEffect(()=>{!o.textValue&&process.env.NODE_ENV!=="production"&&console.warn("A `textValue` prop is required for <Tag> elements with non-plain text children for accessibility.")},[o.textValue]);let b=K.$65484d02dcb7eb3e$export$457c3d6518dd4c6f(t,{global:!0});return delete b.id,delete b.onClick,l.createElement("div",{ref:c,...B.$3ef42575df84b30b$export$9d1611c77c2fe928(b,v,d,r,g),"data-selected":u.isSelected||void 0,"data-disabled":u.isDisabled||void 0,"data-hovered":f||void 0,"data-focused":u.isFocused||void 0,"data-focus-visible":n||void 0,"data-pressed":u.isPressed||void 0,"data-allows-removing":u.allowsRemoving||void 0,"data-selection-mode":a.selectionManager.selectionMode==="none"?void 0:a.selectionManager.selectionMode},l.createElement("div",{...s,style:{display:"contents"}},l.createElement(L.$64fa3d84918910a7$export$2881499e37b75b9a,{values:[[Ie.$d2b4bc8c273e7be6$export$24d547caef80ccd1,{slots:{remove:x}}],[P.$7135fc7d473fd974$export$4feb769f8ddf26c5,P.$7135fc7d473fd974$export$a164736487e3f0ae]]},v.children)))}),{withProvider:$o,withContext:Se}=_e.createSlotRecipeContext({key:"taggroup"}),vo=$o(co,"root"),xo=t=>{const{ref:e,...o}=t,a=Se(fo,"tagList");return w.jsx(a,{...o,ref:e})},mo=Se(po,"tag"),Fe=({children:t,onRemove:e,selectionMode:o,ref:a,...c})=>(e&&(o==="multiple"||o==="single")&&console.warn('Nimbus TagGroup: when "selectionMode" is "single" or "mutiple", Tags cannot be removed'),w.jsx(vo,{ref:a,onRemove:e,selectionMode:o,...c,children:t}));Fe.displayName="TagGroup.Root";const Me=({children:t,ref:e,...o})=>w.jsx(xo,{ref:e,...o,children:t});Me.displayName="TagGroup.TagList";const Re=({children:t,ref:e,...o})=>{const a=typeof t=="string"?t:void 0;return w.jsx(mo,{ref:e,textValue:a,...o,children:({allowsRemoving:c,isSelected:r,selectionMode:n})=>w.jsxs(w.Fragment,{children:[t,c&&n!=="multiple"&&n!=="single"&&w.jsx(oo.IconButton,{size:"2xs",variant:r?"solid":"ghost",slot:"remove",tone:r?void 0:"neutral",children:w.jsx(eo.Close,{})})]})})};Re.displayName="TagGroup.Tag";const go={Root:Fe,TagList:Me,Tag:Re};exports.TagGroup=go;
|
|
2
|
+
//# sourceMappingURL=tag-group-DwTq8DeA.cjs.js.map
|