@televet/kibble-ui 4.0.0-beta.46 → 4.0.0-beta.48
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/menu.component-CTze16Re.js.map +1 -1
- package/dist/chunks/menu.component-DfMZGgCy.js.map +1 -1
- package/dist/chunks/select.component-CASOsFQJ.js +2 -0
- package/dist/chunks/{select.component-D3FwGf7W.js.map → select.component-CASOsFQJ.js.map} +1 -1
- package/dist/chunks/select.component-CEDzVkE_.js +391 -0
- package/dist/chunks/{select.component-DC_tM1JD.js.map → select.component-CEDzVkE_.js.map} +1 -1
- package/dist/chunks/{theme.provider-CnlvRUbx.js → theme.provider-B9PPowSI.js} +5 -3
- package/dist/chunks/{theme.provider-CnlvRUbx.js.map → theme.provider-B9PPowSI.js.map} +1 -1
- package/dist/chunks/{theme.provider-B8KfvKCf.js → theme.provider-DOj3vPkk.js} +2 -2
- package/dist/chunks/{theme.provider-B8KfvKCf.js.map → theme.provider-DOj3vPkk.js.map} +1 -1
- package/dist/chunks/tooltip.component-C7RpuMiK.js.map +1 -1
- package/dist/chunks/tooltip.component-DYBYGsfe.js.map +1 -1
- package/dist/cjs/components/Select/index.cjs +1 -1
- package/dist/cjs/components/index.cjs +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/theme/index.cjs +1 -1
- package/dist/esm/components/Select/index.js +1 -1
- package/dist/esm/components/index.js +1 -1
- package/dist/esm/index.js +2 -2
- package/dist/esm/theme/index.js +1 -1
- package/dist/types/components/Select/select.component.d.ts +3 -0
- package/package.json +1 -1
- package/dist/chunks/select.component-D3FwGf7W.js +0 -2
- package/dist/chunks/select.component-DC_tM1JD.js +0 -345
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select.component-D3FwGf7W.js","sources":["../../node_modules/@ark-ui/react/dist/components/collection.js","../../node_modules/@ark-ui/react/dist/components/select/use-select-context.js","../../node_modules/@ark-ui/react/dist/components/select/select-clear-trigger.js","../../node_modules/@ark-ui/react/dist/components/select/select-content.js","../../node_modules/@ark-ui/react/dist/components/select/select-control.js","../../node_modules/@ark-ui/react/dist/components/select/select-hidden-select.js","../../node_modules/@ark-ui/react/dist/components/select/select-indicator.js","../../node_modules/@ark-ui/react/dist/components/select/use-select-item-context.js","../../node_modules/@ark-ui/react/dist/components/select/use-select-item-props-context.js","../../node_modules/@ark-ui/react/dist/components/select/select-item.js","../../node_modules/@ark-ui/react/dist/components/select/use-select-item-group-props.js","../../node_modules/@ark-ui/react/dist/components/select/select-item-group.js","../../node_modules/@ark-ui/react/dist/components/select/select-item-group-label.js","../../node_modules/@ark-ui/react/dist/components/select/select-item-indicator.js","../../node_modules/@ark-ui/react/dist/components/select/select-item-text.js","../../node_modules/@ark-ui/react/dist/components/select/select-label.js","../../node_modules/@ark-ui/react/dist/components/select/select-positioner.js","../../node_modules/@ark-ui/react/dist/components/select/use-select.js","../../node_modules/@ark-ui/react/dist/components/select/select-root.js","../../node_modules/@ark-ui/react/dist/components/select/select-root-provider.js","../../node_modules/@ark-ui/react/dist/components/select/select-trigger.js","../../node_modules/@ark-ui/react/dist/components/select/select-value-text.js","../../node_modules/@chakra-ui/react/dist/esm/components/select/select.js","../../src/components/Select/components/SelectItemContent/selectItemContent.component.tsx","../../src/components/Select/components/SelectTrigger/selectTrigger.component.tsx","../../src/components/Select/select.component.tsx"],"sourcesContent":["import { ListCollection, filePathToTree, TreeCollection } from '@zag-js/collection';\n\nconst createListCollection = (options) => new ListCollection(options);\nconst createTreeCollection = (options) => new TreeCollection(options);\nconst createFileTreeCollection = (paths) => filePathToTree(paths);\n\nexport { createFileTreeCollection, createListCollection, createTreeCollection };\n","'use client';\nimport { createContext } from '../../utils/create-context.js';\n\nconst [SelectProvider, useSelectContext] = createContext({\n name: \"SelectContext\",\n hookName: \"useSelectContext\",\n providerName: \"<SelectProvider />\"\n});\n\nexport { SelectProvider, useSelectContext };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { ark } from '../factory.js';\nimport { useSelectContext } from './use-select-context.js';\n\nconst SelectClearTrigger = forwardRef((props, ref) => {\n const select = useSelectContext();\n const mergedProps = mergeProps(select.getClearTriggerProps(), props);\n return /* @__PURE__ */ jsx(ark.button, { ...mergedProps, ref });\n});\nSelectClearTrigger.displayName = \"SelectClearTrigger\";\n\nexport { SelectClearTrigger };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { composeRefs } from '../../utils/compose-refs.js';\nimport { ark } from '../factory.js';\nimport { usePresenceContext } from '../presence/use-presence-context.js';\nimport { useSelectContext } from './use-select-context.js';\n\nconst SelectContent = forwardRef((props, ref) => {\n const select = useSelectContext();\n const presence = usePresenceContext();\n const mergedProps = mergeProps(select.getContentProps(), presence.getPresenceProps(), props);\n if (presence.unmounted) {\n return null;\n }\n return /* @__PURE__ */ jsx(ark.div, { ...mergedProps, ref: composeRefs(presence.ref, ref) });\n});\nSelectContent.displayName = \"SelectContent\";\n\nexport { SelectContent };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { ark } from '../factory.js';\nimport { useSelectContext } from './use-select-context.js';\n\nconst SelectControl = forwardRef((props, ref) => {\n const select = useSelectContext();\n const mergedProps = mergeProps(select.getControlProps(), props);\n return /* @__PURE__ */ jsx(ark.div, { ...mergedProps, ref });\n});\nSelectControl.displayName = \"SelectControl\";\n\nexport { SelectControl };\n","'use client';\nimport { jsxs, jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { ark } from '../factory.js';\nimport { useFieldContext } from '../field/use-field-context.js';\nimport { useSelectContext } from './use-select-context.js';\n\nconst SelectHiddenSelect = forwardRef((props, ref) => {\n const select = useSelectContext();\n const mergedProps = mergeProps(select.getHiddenSelectProps(), props);\n const isValueEmpty = select.value.length === 0;\n const field = useFieldContext();\n return /* @__PURE__ */ jsxs(ark.select, { \"aria-describedby\": field?.ariaDescribedby, ...mergedProps, ref, children: [\n isValueEmpty && /* @__PURE__ */ jsx(\"option\", { value: \"\" }),\n select.collection.items.map((item, index) => /* @__PURE__ */ jsx(\n \"option\",\n {\n value: select.collection.getItemValue(item) ?? \"\",\n disabled: select.collection.getItemDisabled(item),\n children: select.collection.stringifyItem(item)\n },\n index\n ))\n ] });\n});\nSelectHiddenSelect.displayName = \"SelectHiddenSelect\";\n\nexport { SelectHiddenSelect };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { ark } from '../factory.js';\nimport { useSelectContext } from './use-select-context.js';\n\nconst SelectIndicator = forwardRef((props, ref) => {\n const select = useSelectContext();\n const mergedProps = mergeProps(select.getIndicatorProps(), props);\n return /* @__PURE__ */ jsx(ark.div, { ...mergedProps, ref });\n});\nSelectIndicator.displayName = \"SelectIndicator\";\n\nexport { SelectIndicator };\n","'use client';\nimport { createContext } from '../../utils/create-context.js';\n\nconst [SelectItemProvider, useSelectItemContext] = createContext({\n name: \"SelectItemContext\",\n hookName: \"useSelectItemContext\",\n providerName: \"<SelectItemProvider />\"\n});\n\nexport { SelectItemProvider, useSelectItemContext };\n","'use client';\nimport { createContext } from '../../utils/create-context.js';\n\nconst [SelectItemPropsProvider, useSelectItemPropsContext] = createContext({\n name: \"SelectItemPropsContext\",\n hookName: \"useSelectItemPropsContext\",\n providerName: \"<SelectItemPropsProvider />\"\n});\n\nexport { SelectItemPropsProvider, useSelectItemPropsContext };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { createSplitProps } from '../../utils/create-split-props.js';\nimport { ark } from '../factory.js';\nimport { useSelectContext } from './use-select-context.js';\nimport { SelectItemProvider } from './use-select-item-context.js';\nimport { SelectItemPropsProvider } from './use-select-item-props-context.js';\n\nconst SelectItem = forwardRef((props, ref) => {\n const [itemProps, localProps] = createSplitProps()(props, [\"item\", \"persistFocus\"]);\n const select = useSelectContext();\n const mergedProps = mergeProps(select.getItemProps(itemProps), localProps);\n const itemState = select.getItemState(itemProps);\n return /* @__PURE__ */ jsx(SelectItemPropsProvider, { value: itemProps, children: /* @__PURE__ */ jsx(SelectItemProvider, { value: itemState, children: /* @__PURE__ */ jsx(ark.div, { ...mergedProps, ref }) }) });\n});\nSelectItem.displayName = \"SelectItem\";\n\nexport { SelectItem };\n","'use client';\nimport { createContext } from '../../utils/create-context.js';\n\nconst [SelectItemGroupPropsProvider, useSelectItemGroupPropsContext] = createContext({\n name: \"SelectItemGroupPropsContext\",\n hookName: \"useSelectItemGroupPropsContext\",\n providerName: \"<SelectItemGroupPropsProvider />\"\n});\n\nexport { SelectItemGroupPropsProvider, useSelectItemGroupPropsContext };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef, useId } from 'react';\nimport { createSplitProps } from '../../utils/create-split-props.js';\nimport { ark } from '../factory.js';\nimport { useSelectContext } from './use-select-context.js';\nimport { SelectItemGroupPropsProvider } from './use-select-item-group-props.js';\n\nconst SelectItemGroup = forwardRef((props, ref) => {\n const id = useId();\n const [_itemGroupProps, localProps] = createSplitProps()(props, [\"id\"]);\n const itemGroupProps = { id, ..._itemGroupProps };\n const select = useSelectContext();\n const mergedProps = mergeProps(select.getItemGroupProps(itemGroupProps), localProps);\n return /* @__PURE__ */ jsx(SelectItemGroupPropsProvider, { value: itemGroupProps, children: /* @__PURE__ */ jsx(ark.div, { ...mergedProps, ref }) });\n});\nSelectItemGroup.displayName = \"SelectItemGroup\";\n\nexport { SelectItemGroup };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { ark } from '../factory.js';\nimport { useSelectContext } from './use-select-context.js';\nimport { useSelectItemGroupPropsContext } from './use-select-item-group-props.js';\n\nconst SelectItemGroupLabel = forwardRef((props, ref) => {\n const select = useSelectContext();\n const itemGroupProps = useSelectItemGroupPropsContext();\n const mergedProps = mergeProps(select.getItemGroupLabelProps({ htmlFor: itemGroupProps.id }), props);\n return /* @__PURE__ */ jsx(ark.div, { ...mergedProps, ref });\n});\nSelectItemGroupLabel.displayName = \"SelectItemGroupLabel\";\n\nexport { SelectItemGroupLabel };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { ark } from '../factory.js';\nimport { useSelectContext } from './use-select-context.js';\nimport { useSelectItemPropsContext } from './use-select-item-props-context.js';\n\nconst SelectItemIndicator = forwardRef((props, ref) => {\n const select = useSelectContext();\n const itemProps = useSelectItemPropsContext();\n const mergedProps = mergeProps(select.getItemIndicatorProps(itemProps), props);\n return /* @__PURE__ */ jsx(ark.div, { ...mergedProps, ref });\n});\nSelectItemIndicator.displayName = \"SelectItemIndicator\";\n\nexport { SelectItemIndicator };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { ark } from '../factory.js';\nimport { useSelectContext } from './use-select-context.js';\nimport { useSelectItemPropsContext } from './use-select-item-props-context.js';\n\nconst SelectItemText = forwardRef((props, ref) => {\n const select = useSelectContext();\n const itemProps = useSelectItemPropsContext();\n const mergedProps = mergeProps(select.getItemTextProps(itemProps), props);\n return /* @__PURE__ */ jsx(ark.span, { ...mergedProps, ref });\n});\nSelectItemText.displayName = \"SelectItemText\";\n\nexport { SelectItemText };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { ark } from '../factory.js';\nimport { useSelectContext } from './use-select-context.js';\n\nconst SelectLabel = forwardRef((props, ref) => {\n const select = useSelectContext();\n const mergedProps = mergeProps(select.getLabelProps(), props);\n return /* @__PURE__ */ jsx(ark.label, { ...mergedProps, ref });\n});\nSelectLabel.displayName = \"SelectLabel\";\n\nexport { SelectLabel };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { ark } from '../factory.js';\nimport { usePresenceContext } from '../presence/use-presence-context.js';\nimport { useSelectContext } from './use-select-context.js';\n\nconst SelectPositioner = forwardRef((props, ref) => {\n const select = useSelectContext();\n const mergedProps = mergeProps(select.getPositionerProps(), props);\n const presence = usePresenceContext();\n if (presence.unmounted) {\n return null;\n }\n return /* @__PURE__ */ jsx(ark.div, { ...mergedProps, ref });\n});\nSelectPositioner.displayName = \"SelectPositioner\";\n\nexport { SelectPositioner };\n","'use client';\nimport { useMachine, normalizeProps } from '@zag-js/react';\nimport * as select from '@zag-js/select';\nimport { useId } from 'react';\nimport { useEnvironmentContext } from '../../providers/environment/use-environment-context.js';\nimport { useLocaleContext } from '../../providers/locale/use-locale-context.js';\nimport { useFieldContext } from '../field/use-field-context.js';\n\nconst useSelect = (props) => {\n const id = useId();\n const { dir } = useLocaleContext();\n const { getRootNode } = useEnvironmentContext();\n const field = useFieldContext();\n const machineProps = {\n id,\n ids: {\n label: field?.ids.label,\n hiddenSelect: field?.ids.control\n },\n disabled: field?.disabled,\n readOnly: field?.readOnly,\n invalid: field?.invalid,\n required: field?.required,\n dir,\n getRootNode,\n ...props\n };\n const service = useMachine(select.machine, machineProps);\n return select.connect(service, normalizeProps);\n};\n\nexport { useSelect };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { createSplitProps } from '../../utils/create-split-props.js';\nimport { ark } from '../factory.js';\nimport { splitPresenceProps } from '../presence/split-presence-props.js';\nimport { usePresence } from '../presence/use-presence.js';\nimport { PresenceProvider } from '../presence/use-presence-context.js';\nimport { useSelect } from './use-select.js';\nimport { SelectProvider } from './use-select-context.js';\n\nconst SelectImpl = (props, ref) => {\n const [presenceProps, selectProps] = splitPresenceProps(props);\n const [useSelectProps, localProps] = createSplitProps()(selectProps, [\n \"closeOnSelect\",\n \"collection\",\n \"composite\",\n \"defaultHighlightedValue\",\n \"defaultOpen\",\n \"defaultValue\",\n \"deselectable\",\n \"disabled\",\n \"form\",\n \"highlightedValue\",\n \"id\",\n \"ids\",\n \"invalid\",\n \"loopFocus\",\n \"multiple\",\n \"name\",\n \"onFocusOutside\",\n \"onHighlightChange\",\n \"onInteractOutside\",\n \"onOpenChange\",\n \"onPointerDownOutside\",\n \"onValueChange\",\n \"open\",\n \"positioning\",\n \"readOnly\",\n \"required\",\n \"scrollToIndexFn\",\n \"value\"\n ]);\n const select = useSelect(useSelectProps);\n const presence = usePresence(mergeProps({ present: select.open }, presenceProps));\n const mergedProps = mergeProps(select.getRootProps(), localProps);\n return /* @__PURE__ */ jsx(SelectProvider, { value: select, children: /* @__PURE__ */ jsx(PresenceProvider, { value: presence, children: /* @__PURE__ */ jsx(ark.div, { ...mergedProps, ref }) }) });\n};\nconst SelectRoot = forwardRef(SelectImpl);\n\nexport { SelectRoot };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { createSplitProps } from '../../utils/create-split-props.js';\nimport { ark } from '../factory.js';\nimport { splitPresenceProps } from '../presence/split-presence-props.js';\nimport { usePresence } from '../presence/use-presence.js';\nimport { PresenceProvider } from '../presence/use-presence-context.js';\nimport { SelectProvider } from './use-select-context.js';\n\nconst SelectImpl = (props, ref) => {\n const [presenceProps, selectProps] = splitPresenceProps(props);\n const [{ value: select }, localProps] = createSplitProps()(selectProps, [\"value\"]);\n const presence = usePresence(mergeProps({ present: select.open }, presenceProps));\n const mergedProps = mergeProps(select.getRootProps(), localProps);\n return /* @__PURE__ */ jsx(SelectProvider, { value: select, children: /* @__PURE__ */ jsx(PresenceProvider, { value: presence, children: /* @__PURE__ */ jsx(ark.div, { ...mergedProps, ref }) }) });\n};\nconst SelectRootProvider = forwardRef(SelectImpl);\n\nexport { SelectRootProvider };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { ark } from '../factory.js';\nimport { useSelectContext } from './use-select-context.js';\n\nconst SelectTrigger = forwardRef((props, ref) => {\n const select = useSelectContext();\n const mergedProps = mergeProps(select.getTriggerProps(), props);\n return /* @__PURE__ */ jsx(ark.button, { ...mergedProps, ref });\n});\nSelectTrigger.displayName = \"SelectTrigger\";\n\nexport { SelectTrigger };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { ark } from '../factory.js';\nimport { useSelectContext } from './use-select-context.js';\n\nconst SelectValueText = forwardRef((props, ref) => {\n const { children, placeholder, ...localprops } = props;\n const select = useSelectContext();\n const mergedProps = mergeProps(select.getValueTextProps(), localprops);\n return /* @__PURE__ */ jsx(ark.span, { ...mergedProps, ref, children: children || select.valueAsString || placeholder });\n});\nSelectValueText.displayName = \"SelectValueText\";\n\nexport { SelectValueText };\n","\"use strict\";\n\"use client\";\nimport { jsx } from 'react/jsx-runtime';\nimport { Select } from '@ark-ui/react/select';\nimport { createSlotRecipeContext } from '../../styled-system/create-slot-recipe-context.js';\nimport { CloseIcon, CheckIcon, ChevronDownIcon } from '../icons.js';\n\nconst {\n withProvider,\n withContext,\n useStyles: useSelectStyles,\n PropsProvider\n} = createSlotRecipeContext({ key: \"select\" });\nconst SelectRootProvider = withProvider(Select.RootProvider, \"root\", {\n forwardAsChild: true\n});\nconst SelectRoot = withProvider(\n Select.Root,\n \"root\",\n {\n forwardAsChild: true,\n defaultProps: { positioning: { sameWidth: true } }\n }\n);\nconst SelectPropsProvider = PropsProvider;\nconst SelectTrigger = withContext(\n Select.Trigger,\n \"trigger\",\n { forwardAsChild: true }\n);\nconst SelectPositioner = withContext(Select.Positioner, \"positioner\", { forwardAsChild: true });\nconst SelectContent = withContext(\n Select.Content,\n \"content\",\n { forwardAsChild: true }\n);\nconst SelectValueText = withContext(Select.ValueText, \"valueText\", { forwardAsChild: true });\nconst SelectClearTrigger = withContext(Select.ClearTrigger, \"clearTrigger\", {\n forwardAsChild: true,\n defaultProps: { children: /* @__PURE__ */ jsx(CloseIcon, { boxSize: \"1em\" }) }\n});\nconst SelectItemGroup = withContext(Select.ItemGroup, \"itemGroup\", { forwardAsChild: true });\nconst SelectItemGroupLabel = withContext(Select.ItemGroupLabel, \"itemGroupLabel\", { forwardAsChild: true });\nconst SelectItem = withContext(\n Select.Item,\n \"item\",\n { forwardAsChild: true }\n);\nconst SelectItemText = withContext(\n Select.ItemText,\n \"itemText\",\n { forwardAsChild: true }\n);\nconst SelectItemIndicator = withContext(Select.ItemIndicator, \"itemIndicator\", {\n forwardAsChild: true,\n defaultProps: {\n children: /* @__PURE__ */ jsx(CheckIcon, {})\n }\n});\nconst SelectIndicatorGroup = withContext(\"div\", \"indicatorGroup\");\nconst SelectIndicator = withContext(Select.Indicator, \"indicator\", {\n forwardAsChild: true,\n defaultProps: {\n children: /* @__PURE__ */ jsx(ChevronDownIcon, {})\n }\n});\nconst SelectControl = withContext(\n Select.Control,\n \"control\",\n { forwardAsChild: true }\n);\nconst SelectLabel = withContext(\n Select.Label,\n \"label\",\n { forwardAsChild: true }\n);\nconst SelectContext = Select.Context;\nconst SelectHiddenSelect = Select.HiddenSelect;\nconst SelectItemContext = Select.ItemContext;\n\nexport { SelectClearTrigger, SelectContent, SelectContext, SelectControl, SelectHiddenSelect, SelectIndicator, SelectIndicatorGroup, SelectItem, SelectItemContext, SelectItemGroup, SelectItemGroupLabel, SelectItemIndicator, SelectItemText, SelectLabel, SelectPositioner, SelectPropsProvider, SelectRoot, SelectRootProvider, SelectTrigger, SelectValueText, useSelectStyles };\n","import React from \"react\";\nimport { Text } from \"components/Text/text.component\";\nimport { SelectOption } from \"components/Select/select.types\";\nimport { FormControlSize } from \"hocs/withFormControl/withFormControl.types\";\n\ninterface SelectItemContentProps {\n item: SelectOption;\n onContrast: boolean;\n shouldTruncateText: boolean;\n size: FormControlSize;\n}\n\nexport const SelectItemContent = ({\n item,\n onContrast,\n shouldTruncateText,\n size,\n}: SelectItemContentProps): React.JSX.Element => {\n return (\n <>\n {item.leftElement}\n {typeof item.label === \"string\" ? (\n <Text\n size={size}\n truncated={shouldTruncateText}\n variant={item.variant || (onContrast ? \"onContrast\" : \"default\")}\n >\n {item.label}\n </Text>\n ) : (\n item.label\n )}\n </>\n );\n};\n","import React, { useMemo } from \"react\";\nimport { Select as CSelect, useSelectContext } from \"@chakra-ui/react/select\";\nimport { SelectOption } from \"components/Select/select.types\";\nimport { SelectItemContent } from \"../SelectItemContent/selectItemContent.component\";\nimport { FormControlSize } from \"hocs/withFormControl/withFormControl.types\";\n\ninterface SelectTriggerProps {\n placeholder?: string;\n placeholderElement?: React.ReactNode;\n onContrast: boolean;\n shouldTruncateText: boolean;\n size: FormControlSize;\n}\n\nexport const SelectTrigger = ({\n placeholder = \"\",\n placeholderElement,\n ...rest\n}: SelectTriggerProps): React.JSX.Element => {\n const select = useSelectContext();\n const selectedItem = useMemo(() => {\n const items = select.selectedItems as SelectOption[];\n return items[0];\n }, [select]);\n\n return (\n <CSelect.Trigger>\n {!selectedItem && placeholderElement}\n <CSelect.ValueText placeholder={placeholder}>\n {selectedItem && <SelectItemContent item={selectedItem} {...rest} />}\n </CSelect.ValueText>\n </CSelect.Trigger>\n );\n};\n","import React, { ForwardedRef, useMemo } from \"react\";\nimport { Select as CSelect } from \"@chakra-ui/react/select\";\nimport { Portal } from \"@chakra-ui/react/portal\";\nimport {\n withFormControl,\n WithFormControlProps,\n} from \"hocs/withFormControl/withFormControl\";\nimport { FormControlSize } from \"hocs/withFormControl/withFormControl.types\";\nimport { createListCollection } from \"@chakra-ui/react/collection\";\nimport { Icon } from \"components/Icon/icon.component\";\nimport { Button } from \"components/Button/button.component\";\nimport { Text } from \"components/Text/text.component\";\nimport { Spinner } from \"components/Spinner/spinner.component\";\nimport { Flex } from \"@chakra-ui/react/flex\";\nimport { SelectOption } from \"./select.types\";\nimport { SelectItemContent } from \"./components/SelectItemContent/selectItemContent.component\";\nimport { SelectTrigger } from \"./components/SelectTrigger/selectTrigger.component\";\nimport { useModalContentRef } from \"components/Modal/context/modal.context\";\n\nexport interface SelectProps\n extends Omit<CSelect.RootProps, \"collection\" | \"multiple\">,\n WithFormControlProps {\n clearable?: boolean;\n emptyPlaceholder?: string;\n loading?: boolean;\n options: SelectOption[];\n placeholder?: string;\n placeholderElement?: React.ReactNode;\n selectRef?: ForwardedRef<HTMLSelectElement>;\n shouldTruncateText?: boolean;\n size?: FormControlSize;\n}\n\nconst Select = withFormControl(\n ({\n clearable,\n emptyPlaceholder = \"No options available\",\n loading,\n onContrast,\n options,\n placeholder = \"\",\n placeholderElement,\n selectRef,\n shouldTruncateText,\n size = \"md\",\n ...rest\n }: SelectProps): React.JSX.Element => {\n const { contentRef: modalContentRef } = useModalContentRef();\n const _computedVariant = onContrast ? \"onContrast\" : \"default\";\n const collection = useMemo(() => {\n return createListCollection({\n items: options ?? [],\n itemToString: (option) =>\n typeof option.label === \"string\"\n ? option.label\n : option.valueText || \"\",\n itemToValue: (option) => option.value,\n });\n }, [options]);\n\n console.log(modalContentRef);\n\n return (\n <CSelect.Root\n className=\"Select\"\n data-testid=\"kibble-select\"\n collection={collection}\n size={size}\n variant={_computedVariant}\n {...rest}\n >\n <CSelect.HiddenSelect ref={selectRef} />\n <CSelect.Control>\n <SelectTrigger\n placeholder={placeholder}\n placeholderElement={placeholderElement}\n onContrast={!!onContrast}\n shouldTruncateText={!!shouldTruncateText}\n size={size}\n />\n <CSelect.IndicatorGroup>\n {clearable && (\n <CSelect.ClearTrigger asChild>\n <Button\n iconName=\"close\"\n onContrast={onContrast}\n size={size === \"lg\" ? \"sm\" : \"xs\"}\n variant=\"ghostNeutral\"\n />\n </CSelect.ClearTrigger>\n )}\n <Icon\n name=\"chevronDown\"\n size={size}\n variant={onContrast ? \"onContrast\" : \"default\"}\n />\n </CSelect.IndicatorGroup>\n </CSelect.Control>\n <Portal container={modalContentRef || undefined}>\n <CSelect.Positioner>\n <CSelect.Content>\n {loading ? (\n <Flex w=\"100%\" justifyContent=\"center\" py={3}>\n <Spinner\n variant={onContrast ? \"brandOnContrast\" : \"brand\"}\n size={size}\n />\n </Flex>\n ) : (\n <>\n {collection.items.length ? (\n collection.items.map((item) => (\n <CSelect.Item item={item} key={item.value}>\n <SelectItemContent\n item={item}\n onContrast={!!onContrast}\n shouldTruncateText={!!shouldTruncateText}\n size={size}\n />\n </CSelect.Item>\n ))\n ) : (\n <Flex w=\"100%\" justifyContent=\"center\" py={3}>\n <Text\n size=\"sm\"\n variant={onContrast ? \"subtleOnContrast\" : \"subtle\"}\n >\n {emptyPlaceholder}\n </Text>\n </Flex>\n )}\n </>\n )}\n </CSelect.Content>\n </CSelect.Positioner>\n </Portal>\n </CSelect.Root>\n );\n }\n);\n\nconst WrappedSelect = React.forwardRef(\n (props: SelectProps, ref: ForwardedRef<HTMLSelectElement>) => (\n <Select selectRef={ref} {...props} />\n )\n);\n\nWrappedSelect.displayName = \"Select\";\n\nexport { WrappedSelect as Select };\n"],"names":["createListCollection","options","ListCollection","SelectProvider","useSelectContext","createContext","SelectClearTrigger","forwardRef","props","ref","select","mergedProps","mergeProps","jsx","ark","SelectContent","presence","usePresenceContext","composeRefs","SelectControl","SelectHiddenSelect","isValueEmpty","field","useFieldContext","jsxs","item","index","SelectIndicator","SelectItemProvider","useSelectItemContext","SelectItemPropsProvider","useSelectItemPropsContext","SelectItem","itemProps","localProps","createSplitProps","itemState","SelectItemGroupPropsProvider","useSelectItemGroupPropsContext","SelectItemGroup","id","useId","_itemGroupProps","itemGroupProps","SelectItemGroupLabel","SelectItemIndicator","SelectItemText","SelectLabel","SelectPositioner","useSelect","dir","useLocaleContext","getRootNode","useEnvironmentContext","machineProps","service","useMachine","select.machine","select.connect","normalizeProps","SelectImpl","presenceProps","selectProps","splitPresenceProps","useSelectProps","usePresence","PresenceProvider","SelectRoot","SelectRootProvider","SelectTrigger","SelectValueText","children","placeholder","localprops","withProvider","withContext","createSlotRecipeContext","Select.RootProvider","Select.Root","Select.Trigger","Select.Positioner","Select.Content","Select.ValueText","Select.ClearTrigger","CloseIcon","Select.ItemGroup","Select.ItemGroupLabel","Select.Item","Select.ItemText","Select.ItemIndicator","CheckIcon","SelectIndicatorGroup","Select.Indicator","ChevronDownIcon","Select.Control","Select.Label","Select.HiddenSelect","SelectItemContent","onContrast","shouldTruncateText","size","Fragment","Text","placeholderElement","rest","selectedItem","useMemo","CSelect.Trigger","CSelect.ValueText","Select","withFormControl","clearable","emptyPlaceholder","loading","selectRef","modalContentRef","useModalContentRef","_computedVariant","collection","option","CSelect.Root","CSelect.HiddenSelect","CSelect.Control","CSelect.IndicatorGroup","CSelect.ClearTrigger","Button","Icon","Portal","CSelect.Positioner","CSelect.Content","Flex","Spinner","CSelect.Item","WrappedSelect","React"],"mappings":"gpBAEMA,EAAwBC,GAAY,IAAIC,EAAAA,eAAeD,CAAO,ECC9D,CAACE,EAAgBC,CAAgB,EAAIC,gBAAc,CACvD,KAAM,gBACN,SAAU,mBACV,aAAc,oBAChB,CAAC,ECAKC,EAAqBC,EAAU,WAAC,CAACC,EAAOC,IAAQ,CACpD,MAAMC,EAASN,EAAkB,EAC3BO,EAAcC,EAAU,WAACF,EAAO,qBAAoB,EAAIF,CAAK,EACnE,OAAuBK,EAAAA,kBAAAA,IAAIC,EAAAA,IAAI,OAAQ,CAAE,GAAGH,EAAa,IAAAF,EAAK,CAChE,CAAC,EACDH,EAAmB,YAAc,qBCHjC,MAAMS,EAAgBR,EAAU,WAAC,CAACC,EAAOC,IAAQ,CAC/C,MAAMC,EAASN,EAAkB,EAC3BY,EAAWC,EAAAA,mBAAoB,EAC/BN,EAAcC,EAAU,WAACF,EAAO,gBAAiB,EAAEM,EAAS,iBAAkB,EAAER,CAAK,EA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,CACvC,CACF,CAAA,CAAA,EACF,EACArF,EAAAA,kBAAAA,IAACkH,UAAO,UAAWZ,GAAmB,OACpC,SAACtG,EAAAA,kBAAAA,IAAAmH,GAAA,CACC,SAAAnH,EAAA,kBAAA,IAACoH,GAAA,CACE,WACEpH,EAAAA,kBAAAA,IAAAqH,EAAA,KAAA,CAAK,EAAE,OAAO,eAAe,SAAS,GAAI,EACzC,SAAArH,EAAA,kBAAA,IAACsH,EAAA,QAAA,CACC,QAASjC,EAAa,kBAAoB,QAC1C,KAAAE,CAAA,CAAA,CAEJ,CAAA,EAGGvF,EAAAA,kBAAAA,IAAAwF,EAAA,kBAAA,SAAA,CAAA,SAAAiB,EAAW,MAAM,OAChBA,EAAW,MAAM,IAAK7F,GACpBZ,EAAAA,kBAAAA,IAACuH,GAAA,CAAa,KAAA3G,EACZ,SAAAZ,EAAA,kBAAA,IAACoF,EAAA,CACC,KAAAxE,EACA,WAAY,CAAC,CAACyE,EACd,mBAAoB,CAAC,CAACC,EACtB,KAAAC,CAAA,CAL2B,CAAA,EAAA3E,EAAK,KAOpC,CACD,EAEDZ,EAAAA,kBAAAA,IAACqH,EAAAA,KAAK,CAAA,EAAE,OAAO,eAAe,SAAS,GAAI,EACzC,SAAArH,EAAA,kBAAA,IAACyF,EAAA,YAAA,CACC,KAAK,KACL,QAASJ,EAAa,mBAAqB,SAE1C,SAAAc,CAAA,CAEL,CAAA,CAAA,CAEJ,CAAA,EAEJ,CAAA,CACF,CACF,CAAA,CAAA,CAAA,CACF,CAAA,CAGN,EAEMqB,EAAgBC,EAAM,QAAA,WAC1B,CAAC9H,EAAoBC,IACnBI,wBAACgG,IAAO,UAAWpG,EAAM,GAAGD,CAAO,CAAA,CAEvC,EAEA6H,EAAc,YAAc","x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22]}
|
|
1
|
+
{"version":3,"file":"select.component-CASOsFQJ.js","sources":["../../node_modules/@ark-ui/react/dist/components/collection.js","../../node_modules/@ark-ui/react/dist/components/select/use-select-context.js","../../node_modules/@ark-ui/react/dist/components/select/select-clear-trigger.js","../../node_modules/@ark-ui/react/dist/components/select/select-content.js","../../node_modules/@ark-ui/react/dist/components/select/select-control.js","../../node_modules/@ark-ui/react/dist/components/select/select-hidden-select.js","../../node_modules/@ark-ui/react/dist/components/select/select-indicator.js","../../node_modules/@ark-ui/react/dist/components/select/use-select-item-context.js","../../node_modules/@ark-ui/react/dist/components/select/use-select-item-props-context.js","../../node_modules/@ark-ui/react/dist/components/select/select-item.js","../../node_modules/@ark-ui/react/dist/components/select/use-select-item-group-props.js","../../node_modules/@ark-ui/react/dist/components/select/select-item-group.js","../../node_modules/@ark-ui/react/dist/components/select/select-item-group-label.js","../../node_modules/@ark-ui/react/dist/components/select/select-item-indicator.js","../../node_modules/@ark-ui/react/dist/components/select/select-item-text.js","../../node_modules/@ark-ui/react/dist/components/select/select-label.js","../../node_modules/@ark-ui/react/dist/components/select/select-positioner.js","../../node_modules/@ark-ui/react/dist/components/select/use-select.js","../../node_modules/@ark-ui/react/dist/components/select/select-root.js","../../node_modules/@ark-ui/react/dist/components/select/select-root-provider.js","../../node_modules/@ark-ui/react/dist/components/select/select-trigger.js","../../node_modules/@ark-ui/react/dist/components/select/select-value-text.js","../../node_modules/@chakra-ui/react/dist/esm/components/select/select.js","../../src/components/Select/components/SelectItemContent/selectItemContent.component.tsx","../../src/components/Select/components/SelectTrigger/selectTrigger.component.tsx","../../src/components/Select/select.component.tsx"],"sourcesContent":["import { ListCollection, filePathToTree, TreeCollection } from '@zag-js/collection';\n\nconst createListCollection = (options) => new ListCollection(options);\nconst createTreeCollection = (options) => new TreeCollection(options);\nconst createFileTreeCollection = (paths) => filePathToTree(paths);\n\nexport { createFileTreeCollection, createListCollection, createTreeCollection };\n","'use client';\nimport { createContext } from '../../utils/create-context.js';\n\nconst [SelectProvider, useSelectContext] = createContext({\n name: \"SelectContext\",\n hookName: \"useSelectContext\",\n providerName: \"<SelectProvider />\"\n});\n\nexport { SelectProvider, useSelectContext };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { ark } from '../factory.js';\nimport { useSelectContext } from './use-select-context.js';\n\nconst SelectClearTrigger = forwardRef((props, ref) => {\n const select = useSelectContext();\n const mergedProps = mergeProps(select.getClearTriggerProps(), props);\n return /* @__PURE__ */ jsx(ark.button, { ...mergedProps, ref });\n});\nSelectClearTrigger.displayName = \"SelectClearTrigger\";\n\nexport { SelectClearTrigger };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { composeRefs } from '../../utils/compose-refs.js';\nimport { ark } from '../factory.js';\nimport { usePresenceContext } from '../presence/use-presence-context.js';\nimport { useSelectContext } from './use-select-context.js';\n\nconst SelectContent = forwardRef((props, ref) => {\n const select = useSelectContext();\n const presence = usePresenceContext();\n const mergedProps = mergeProps(select.getContentProps(), presence.getPresenceProps(), props);\n if (presence.unmounted) {\n return null;\n }\n return /* @__PURE__ */ jsx(ark.div, { ...mergedProps, ref: composeRefs(presence.ref, ref) });\n});\nSelectContent.displayName = \"SelectContent\";\n\nexport { SelectContent };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { ark } from '../factory.js';\nimport { useSelectContext } from './use-select-context.js';\n\nconst SelectControl = forwardRef((props, ref) => {\n const select = useSelectContext();\n const mergedProps = mergeProps(select.getControlProps(), props);\n return /* @__PURE__ */ jsx(ark.div, { ...mergedProps, ref });\n});\nSelectControl.displayName = \"SelectControl\";\n\nexport { SelectControl };\n","'use client';\nimport { jsxs, jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { ark } from '../factory.js';\nimport { useFieldContext } from '../field/use-field-context.js';\nimport { useSelectContext } from './use-select-context.js';\n\nconst SelectHiddenSelect = forwardRef((props, ref) => {\n const select = useSelectContext();\n const mergedProps = mergeProps(select.getHiddenSelectProps(), props);\n const isValueEmpty = select.value.length === 0;\n const field = useFieldContext();\n return /* @__PURE__ */ jsxs(ark.select, { \"aria-describedby\": field?.ariaDescribedby, ...mergedProps, ref, children: [\n isValueEmpty && /* @__PURE__ */ jsx(\"option\", { value: \"\" }),\n select.collection.items.map((item, index) => /* @__PURE__ */ jsx(\n \"option\",\n {\n value: select.collection.getItemValue(item) ?? \"\",\n disabled: select.collection.getItemDisabled(item),\n children: select.collection.stringifyItem(item)\n },\n index\n ))\n ] });\n});\nSelectHiddenSelect.displayName = \"SelectHiddenSelect\";\n\nexport { SelectHiddenSelect };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { ark } from '../factory.js';\nimport { useSelectContext } from './use-select-context.js';\n\nconst SelectIndicator = forwardRef((props, ref) => {\n const select = useSelectContext();\n const mergedProps = mergeProps(select.getIndicatorProps(), props);\n return /* @__PURE__ */ jsx(ark.div, { ...mergedProps, ref });\n});\nSelectIndicator.displayName = \"SelectIndicator\";\n\nexport { SelectIndicator };\n","'use client';\nimport { createContext } from '../../utils/create-context.js';\n\nconst [SelectItemProvider, useSelectItemContext] = createContext({\n name: \"SelectItemContext\",\n hookName: \"useSelectItemContext\",\n providerName: \"<SelectItemProvider />\"\n});\n\nexport { SelectItemProvider, useSelectItemContext };\n","'use client';\nimport { createContext } from '../../utils/create-context.js';\n\nconst [SelectItemPropsProvider, useSelectItemPropsContext] = createContext({\n name: \"SelectItemPropsContext\",\n hookName: \"useSelectItemPropsContext\",\n providerName: \"<SelectItemPropsProvider />\"\n});\n\nexport { SelectItemPropsProvider, useSelectItemPropsContext };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { createSplitProps } from '../../utils/create-split-props.js';\nimport { ark } from '../factory.js';\nimport { useSelectContext } from './use-select-context.js';\nimport { SelectItemProvider } from './use-select-item-context.js';\nimport { SelectItemPropsProvider } from './use-select-item-props-context.js';\n\nconst SelectItem = forwardRef((props, ref) => {\n const [itemProps, localProps] = createSplitProps()(props, [\"item\", \"persistFocus\"]);\n const select = useSelectContext();\n const mergedProps = mergeProps(select.getItemProps(itemProps), localProps);\n const itemState = select.getItemState(itemProps);\n return /* @__PURE__ */ jsx(SelectItemPropsProvider, { value: itemProps, children: /* @__PURE__ */ jsx(SelectItemProvider, { value: itemState, children: /* @__PURE__ */ jsx(ark.div, { ...mergedProps, ref }) }) });\n});\nSelectItem.displayName = \"SelectItem\";\n\nexport { SelectItem };\n","'use client';\nimport { createContext } from '../../utils/create-context.js';\n\nconst [SelectItemGroupPropsProvider, useSelectItemGroupPropsContext] = createContext({\n name: \"SelectItemGroupPropsContext\",\n hookName: \"useSelectItemGroupPropsContext\",\n providerName: \"<SelectItemGroupPropsProvider />\"\n});\n\nexport { SelectItemGroupPropsProvider, useSelectItemGroupPropsContext };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef, useId } from 'react';\nimport { createSplitProps } from '../../utils/create-split-props.js';\nimport { ark } from '../factory.js';\nimport { useSelectContext } from './use-select-context.js';\nimport { SelectItemGroupPropsProvider } from './use-select-item-group-props.js';\n\nconst SelectItemGroup = forwardRef((props, ref) => {\n const id = useId();\n const [_itemGroupProps, localProps] = createSplitProps()(props, [\"id\"]);\n const itemGroupProps = { id, ..._itemGroupProps };\n const select = useSelectContext();\n const mergedProps = mergeProps(select.getItemGroupProps(itemGroupProps), localProps);\n return /* @__PURE__ */ jsx(SelectItemGroupPropsProvider, { value: itemGroupProps, children: /* @__PURE__ */ jsx(ark.div, { ...mergedProps, ref }) });\n});\nSelectItemGroup.displayName = \"SelectItemGroup\";\n\nexport { SelectItemGroup };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { ark } from '../factory.js';\nimport { useSelectContext } from './use-select-context.js';\nimport { useSelectItemGroupPropsContext } from './use-select-item-group-props.js';\n\nconst SelectItemGroupLabel = forwardRef((props, ref) => {\n const select = useSelectContext();\n const itemGroupProps = useSelectItemGroupPropsContext();\n const mergedProps = mergeProps(select.getItemGroupLabelProps({ htmlFor: itemGroupProps.id }), props);\n return /* @__PURE__ */ jsx(ark.div, { ...mergedProps, ref });\n});\nSelectItemGroupLabel.displayName = \"SelectItemGroupLabel\";\n\nexport { SelectItemGroupLabel };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { ark } from '../factory.js';\nimport { useSelectContext } from './use-select-context.js';\nimport { useSelectItemPropsContext } from './use-select-item-props-context.js';\n\nconst SelectItemIndicator = forwardRef((props, ref) => {\n const select = useSelectContext();\n const itemProps = useSelectItemPropsContext();\n const mergedProps = mergeProps(select.getItemIndicatorProps(itemProps), props);\n return /* @__PURE__ */ jsx(ark.div, { ...mergedProps, ref });\n});\nSelectItemIndicator.displayName = \"SelectItemIndicator\";\n\nexport { SelectItemIndicator };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { ark } from '../factory.js';\nimport { useSelectContext } from './use-select-context.js';\nimport { useSelectItemPropsContext } from './use-select-item-props-context.js';\n\nconst SelectItemText = forwardRef((props, ref) => {\n const select = useSelectContext();\n const itemProps = useSelectItemPropsContext();\n const mergedProps = mergeProps(select.getItemTextProps(itemProps), props);\n return /* @__PURE__ */ jsx(ark.span, { ...mergedProps, ref });\n});\nSelectItemText.displayName = \"SelectItemText\";\n\nexport { SelectItemText };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { ark } from '../factory.js';\nimport { useSelectContext } from './use-select-context.js';\n\nconst SelectLabel = forwardRef((props, ref) => {\n const select = useSelectContext();\n const mergedProps = mergeProps(select.getLabelProps(), props);\n return /* @__PURE__ */ jsx(ark.label, { ...mergedProps, ref });\n});\nSelectLabel.displayName = \"SelectLabel\";\n\nexport { SelectLabel };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { ark } from '../factory.js';\nimport { usePresenceContext } from '../presence/use-presence-context.js';\nimport { useSelectContext } from './use-select-context.js';\n\nconst SelectPositioner = forwardRef((props, ref) => {\n const select = useSelectContext();\n const mergedProps = mergeProps(select.getPositionerProps(), props);\n const presence = usePresenceContext();\n if (presence.unmounted) {\n return null;\n }\n return /* @__PURE__ */ jsx(ark.div, { ...mergedProps, ref });\n});\nSelectPositioner.displayName = \"SelectPositioner\";\n\nexport { SelectPositioner };\n","'use client';\nimport { useMachine, normalizeProps } from '@zag-js/react';\nimport * as select from '@zag-js/select';\nimport { useId } from 'react';\nimport { useEnvironmentContext } from '../../providers/environment/use-environment-context.js';\nimport { useLocaleContext } from '../../providers/locale/use-locale-context.js';\nimport { useFieldContext } from '../field/use-field-context.js';\n\nconst useSelect = (props) => {\n const id = useId();\n const { dir } = useLocaleContext();\n const { getRootNode } = useEnvironmentContext();\n const field = useFieldContext();\n const machineProps = {\n id,\n ids: {\n label: field?.ids.label,\n hiddenSelect: field?.ids.control\n },\n disabled: field?.disabled,\n readOnly: field?.readOnly,\n invalid: field?.invalid,\n required: field?.required,\n dir,\n getRootNode,\n ...props\n };\n const service = useMachine(select.machine, machineProps);\n return select.connect(service, normalizeProps);\n};\n\nexport { useSelect };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { createSplitProps } from '../../utils/create-split-props.js';\nimport { ark } from '../factory.js';\nimport { splitPresenceProps } from '../presence/split-presence-props.js';\nimport { usePresence } from '../presence/use-presence.js';\nimport { PresenceProvider } from '../presence/use-presence-context.js';\nimport { useSelect } from './use-select.js';\nimport { SelectProvider } from './use-select-context.js';\n\nconst SelectImpl = (props, ref) => {\n const [presenceProps, selectProps] = splitPresenceProps(props);\n const [useSelectProps, localProps] = createSplitProps()(selectProps, [\n \"closeOnSelect\",\n \"collection\",\n \"composite\",\n \"defaultHighlightedValue\",\n \"defaultOpen\",\n \"defaultValue\",\n \"deselectable\",\n \"disabled\",\n \"form\",\n \"highlightedValue\",\n \"id\",\n \"ids\",\n \"invalid\",\n \"loopFocus\",\n \"multiple\",\n \"name\",\n \"onFocusOutside\",\n \"onHighlightChange\",\n \"onInteractOutside\",\n \"onOpenChange\",\n \"onPointerDownOutside\",\n \"onValueChange\",\n \"open\",\n \"positioning\",\n \"readOnly\",\n \"required\",\n \"scrollToIndexFn\",\n \"value\"\n ]);\n const select = useSelect(useSelectProps);\n const presence = usePresence(mergeProps({ present: select.open }, presenceProps));\n const mergedProps = mergeProps(select.getRootProps(), localProps);\n return /* @__PURE__ */ jsx(SelectProvider, { value: select, children: /* @__PURE__ */ jsx(PresenceProvider, { value: presence, children: /* @__PURE__ */ jsx(ark.div, { ...mergedProps, ref }) }) });\n};\nconst SelectRoot = forwardRef(SelectImpl);\n\nexport { SelectRoot };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { createSplitProps } from '../../utils/create-split-props.js';\nimport { ark } from '../factory.js';\nimport { splitPresenceProps } from '../presence/split-presence-props.js';\nimport { usePresence } from '../presence/use-presence.js';\nimport { PresenceProvider } from '../presence/use-presence-context.js';\nimport { SelectProvider } from './use-select-context.js';\n\nconst SelectImpl = (props, ref) => {\n const [presenceProps, selectProps] = splitPresenceProps(props);\n const [{ value: select }, localProps] = createSplitProps()(selectProps, [\"value\"]);\n const presence = usePresence(mergeProps({ present: select.open }, presenceProps));\n const mergedProps = mergeProps(select.getRootProps(), localProps);\n return /* @__PURE__ */ jsx(SelectProvider, { value: select, children: /* @__PURE__ */ jsx(PresenceProvider, { value: presence, children: /* @__PURE__ */ jsx(ark.div, { ...mergedProps, ref }) }) });\n};\nconst SelectRootProvider = forwardRef(SelectImpl);\n\nexport { SelectRootProvider };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { ark } from '../factory.js';\nimport { useSelectContext } from './use-select-context.js';\n\nconst SelectTrigger = forwardRef((props, ref) => {\n const select = useSelectContext();\n const mergedProps = mergeProps(select.getTriggerProps(), props);\n return /* @__PURE__ */ jsx(ark.button, { ...mergedProps, ref });\n});\nSelectTrigger.displayName = \"SelectTrigger\";\n\nexport { SelectTrigger };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { ark } from '../factory.js';\nimport { useSelectContext } from './use-select-context.js';\n\nconst SelectValueText = forwardRef((props, ref) => {\n const { children, placeholder, ...localprops } = props;\n const select = useSelectContext();\n const mergedProps = mergeProps(select.getValueTextProps(), localprops);\n return /* @__PURE__ */ jsx(ark.span, { ...mergedProps, ref, children: children || select.valueAsString || placeholder });\n});\nSelectValueText.displayName = \"SelectValueText\";\n\nexport { SelectValueText };\n","\"use strict\";\n\"use client\";\nimport { jsx } from 'react/jsx-runtime';\nimport { Select } from '@ark-ui/react/select';\nimport { createSlotRecipeContext } from '../../styled-system/create-slot-recipe-context.js';\nimport { CloseIcon, CheckIcon, ChevronDownIcon } from '../icons.js';\n\nconst {\n withProvider,\n withContext,\n useStyles: useSelectStyles,\n PropsProvider\n} = createSlotRecipeContext({ key: \"select\" });\nconst SelectRootProvider = withProvider(Select.RootProvider, \"root\", {\n forwardAsChild: true\n});\nconst SelectRoot = withProvider(\n Select.Root,\n \"root\",\n {\n forwardAsChild: true,\n defaultProps: { positioning: { sameWidth: true } }\n }\n);\nconst SelectPropsProvider = PropsProvider;\nconst SelectTrigger = withContext(\n Select.Trigger,\n \"trigger\",\n { forwardAsChild: true }\n);\nconst SelectPositioner = withContext(Select.Positioner, \"positioner\", { forwardAsChild: true });\nconst SelectContent = withContext(\n Select.Content,\n \"content\",\n { forwardAsChild: true }\n);\nconst SelectValueText = withContext(Select.ValueText, \"valueText\", { forwardAsChild: true });\nconst SelectClearTrigger = withContext(Select.ClearTrigger, \"clearTrigger\", {\n forwardAsChild: true,\n defaultProps: { children: /* @__PURE__ */ jsx(CloseIcon, { boxSize: \"1em\" }) }\n});\nconst SelectItemGroup = withContext(Select.ItemGroup, \"itemGroup\", { forwardAsChild: true });\nconst SelectItemGroupLabel = withContext(Select.ItemGroupLabel, \"itemGroupLabel\", { forwardAsChild: true });\nconst SelectItem = withContext(\n Select.Item,\n \"item\",\n { forwardAsChild: true }\n);\nconst SelectItemText = withContext(\n Select.ItemText,\n \"itemText\",\n { forwardAsChild: true }\n);\nconst SelectItemIndicator = withContext(Select.ItemIndicator, \"itemIndicator\", {\n forwardAsChild: true,\n defaultProps: {\n children: /* @__PURE__ */ jsx(CheckIcon, {})\n }\n});\nconst SelectIndicatorGroup = withContext(\"div\", \"indicatorGroup\");\nconst SelectIndicator = withContext(Select.Indicator, \"indicator\", {\n forwardAsChild: true,\n defaultProps: {\n children: /* @__PURE__ */ jsx(ChevronDownIcon, {})\n }\n});\nconst SelectControl = withContext(\n Select.Control,\n \"control\",\n { forwardAsChild: true }\n);\nconst SelectLabel = withContext(\n Select.Label,\n \"label\",\n { forwardAsChild: true }\n);\nconst SelectContext = Select.Context;\nconst SelectHiddenSelect = Select.HiddenSelect;\nconst SelectItemContext = Select.ItemContext;\n\nexport { SelectClearTrigger, SelectContent, SelectContext, SelectControl, SelectHiddenSelect, SelectIndicator, SelectIndicatorGroup, SelectItem, SelectItemContext, SelectItemGroup, SelectItemGroupLabel, SelectItemIndicator, SelectItemText, SelectLabel, SelectPositioner, SelectPropsProvider, SelectRoot, SelectRootProvider, SelectTrigger, SelectValueText, useSelectStyles };\n","import React from \"react\";\nimport { Text } from \"components/Text/text.component\";\nimport { SelectOption } from \"components/Select/select.types\";\nimport { FormControlSize } from \"hocs/withFormControl/withFormControl.types\";\n\ninterface SelectItemContentProps {\n item: SelectOption;\n onContrast: boolean;\n shouldTruncateText: boolean;\n size: FormControlSize;\n}\n\nexport const SelectItemContent = ({\n item,\n onContrast,\n shouldTruncateText,\n size,\n}: SelectItemContentProps): React.JSX.Element => {\n return (\n <>\n {item.leftElement}\n {typeof item.label === \"string\" ? (\n <Text\n size={size}\n truncated={shouldTruncateText}\n variant={item.variant || (onContrast ? \"onContrast\" : \"default\")}\n >\n {item.label}\n </Text>\n ) : (\n item.label\n )}\n </>\n );\n};\n","import React, { useMemo } from \"react\";\nimport { Select as CSelect, useSelectContext } from \"@chakra-ui/react/select\";\nimport { SelectOption } from \"components/Select/select.types\";\nimport { SelectItemContent } from \"../SelectItemContent/selectItemContent.component\";\nimport { FormControlSize } from \"hocs/withFormControl/withFormControl.types\";\n\ninterface SelectTriggerProps {\n placeholder?: string;\n placeholderElement?: React.ReactNode;\n onContrast: boolean;\n shouldTruncateText: boolean;\n size: FormControlSize;\n}\n\nexport const SelectTrigger = ({\n placeholder = \"\",\n placeholderElement,\n ...rest\n}: SelectTriggerProps): React.JSX.Element => {\n const select = useSelectContext();\n const selectedItem = useMemo(() => {\n const items = select.selectedItems as SelectOption[];\n return items[0];\n }, [select]);\n\n return (\n <CSelect.Trigger>\n {!selectedItem && placeholderElement}\n <CSelect.ValueText placeholder={placeholder}>\n {selectedItem && <SelectItemContent item={selectedItem} {...rest} />}\n </CSelect.ValueText>\n </CSelect.Trigger>\n );\n};\n","import React, { ForwardedRef, useCallback, useMemo, useState } from \"react\";\nimport { Select as CSelect } from \"@chakra-ui/react/select\";\nimport { Portal } from \"@chakra-ui/react/portal\";\nimport {\n withFormControl,\n WithFormControlProps,\n} from \"hocs/withFormControl/withFormControl\";\nimport { FormControlSize } from \"hocs/withFormControl/withFormControl.types\";\nimport { createListCollection } from \"@chakra-ui/react/collection\";\nimport { Icon } from \"components/Icon/icon.component\";\nimport { Button } from \"components/Button/button.component\";\nimport { Text } from \"components/Text/text.component\";\nimport { Spinner } from \"components/Spinner/spinner.component\";\nimport { Flex } from \"@chakra-ui/react/flex\";\nimport { SelectOption } from \"./select.types\";\nimport { SelectItemContent } from \"./components/SelectItemContent/selectItemContent.component\";\nimport { SelectTrigger } from \"./components/SelectTrigger/selectTrigger.component\";\nimport { useModalContentRef } from \"components/Modal/context/modal.context\";\nimport { Box } from \"@chakra-ui/react/box\";\nimport { TextInput } from \"components/TextInput/textInput.component\";\n\nexport interface SelectProps\n extends Omit<CSelect.RootProps, \"collection\" | \"multiple\">,\n WithFormControlProps {\n clearable?: boolean;\n emptyPlaceholder?: string;\n loading?: boolean;\n onSearch?: (e: React.ChangeEvent<HTMLInputElement>) => void;\n options: SelectOption[];\n placeholder?: string;\n placeholderElement?: React.ReactNode;\n searchable?: boolean;\n searchPlaceholder?: string;\n selectRef?: ForwardedRef<HTMLSelectElement>;\n shouldTruncateText?: boolean;\n size?: FormControlSize;\n}\n\nconst Select = withFormControl(\n ({\n clearable,\n emptyPlaceholder = \"No options available\",\n loading,\n onContrast,\n onSearch,\n options,\n placeholder = \"\",\n placeholderElement,\n searchable = false,\n searchPlaceholder = \"Search...\",\n selectRef,\n shouldTruncateText = true,\n size = \"md\",\n ...rest\n }: SelectProps): React.JSX.Element => {\n const { contentRef: modalContentRef } = useModalContentRef();\n const _computedVariant = onContrast ? \"onContrast\" : \"default\";\n const [searchText, setSearchText] = useState<string>(\"\");\n const [filteredOptions, setFilteredOptions] =\n useState<SelectOption[]>(options);\n\n // Search\n const handleSearch = useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n const searchInput = e.target.value;\n setSearchText(searchInput);\n\n if (onSearch) {\n onSearch(e);\n } else {\n if (searchInput === \"\" || !searchInput) {\n setFilteredOptions(options);\n } else {\n const filteredItems = options.filter((option): boolean => {\n const labelText =\n typeof option.label === \"string\"\n ? option.label\n : option.valueText;\n\n return !!labelText\n ?.toLowerCase()\n .includes(searchInput.toLowerCase());\n });\n setFilteredOptions(filteredItems);\n }\n }\n },\n [onSearch, options],\n );\n\n const collection = useMemo(() => {\n return createListCollection({\n items: filteredOptions ?? [],\n itemToString: (option) =>\n typeof option.label === \"string\"\n ? option.label\n : option.valueText || \"\",\n itemToValue: (option) => option.value,\n });\n }, [filteredOptions]);\n\n return (\n <CSelect.Root\n className=\"Select\"\n data-testid=\"kibble-select\"\n collection={collection}\n size={size}\n variant={_computedVariant}\n {...rest}\n >\n <CSelect.HiddenSelect ref={selectRef} />\n <CSelect.Control>\n <SelectTrigger\n placeholder={placeholder}\n placeholderElement={placeholderElement}\n onContrast={!!onContrast}\n shouldTruncateText={!!shouldTruncateText}\n size={size}\n />\n <CSelect.IndicatorGroup>\n {clearable && (\n <CSelect.ClearTrigger asChild>\n <Button\n iconName=\"close\"\n onContrast={onContrast}\n size={size === \"lg\" ? \"sm\" : \"xs\"}\n variant=\"ghostNeutral\"\n />\n </CSelect.ClearTrigger>\n )}\n <Icon\n name=\"chevronDown\"\n size={size}\n variant={onContrast ? \"onContrast\" : \"default\"}\n />\n </CSelect.IndicatorGroup>\n </CSelect.Control>\n <Portal container={modalContentRef || undefined}>\n <CSelect.Positioner>\n <CSelect.Content>\n {loading ? (\n <Flex w=\"100%\" justifyContent=\"center\" py={3}>\n <Spinner\n variant={onContrast ? \"brandOnContrast\" : \"brand\"}\n size={size}\n />\n </Flex>\n ) : (\n <>\n {searchable && (\n <Box\n className=\"Select__Header\"\n data-testid=\"kibble-select-header\"\n m=\"0 12px 8px\"\n >\n <TextInput\n className=\"Select__SearchBar\"\n data-testid=\"kibble-select-search-bar\"\n placeholder={searchPlaceholder}\n onChange={handleSearch}\n size=\"sm\"\n value={searchText}\n clearable\n onClear={(): void => {\n setSearchText(\"\");\n handleSearch({\n target: { value: \"\" },\n } as React.ChangeEvent<HTMLInputElement>);\n }}\n formControlStyle={{ mt: 1 }}\n />\n </Box>\n )}\n {collection.items.length ? (\n collection.items.map((item) => (\n <CSelect.Item item={item} key={item.value}>\n <SelectItemContent\n item={item}\n onContrast={!!onContrast}\n shouldTruncateText={!!shouldTruncateText}\n size={size}\n />\n </CSelect.Item>\n ))\n ) : (\n <Flex w=\"100%\" justifyContent=\"center\" py={3}>\n <Text\n size=\"sm\"\n variant={onContrast ? \"subtleOnContrast\" : \"subtle\"}\n >\n {emptyPlaceholder}\n </Text>\n </Flex>\n )}\n </>\n )}\n </CSelect.Content>\n </CSelect.Positioner>\n </Portal>\n </CSelect.Root>\n );\n },\n);\n\nconst WrappedSelect = React.forwardRef(\n (props: SelectProps, ref: ForwardedRef<HTMLSelectElement>) => (\n <Select selectRef={ref} {...props} />\n ),\n);\n\nWrappedSelect.displayName = \"Select\";\n\nexport { WrappedSelect as Select };\n"],"names":["createListCollection","options","ListCollection","SelectProvider","useSelectContext","createContext","SelectClearTrigger","forwardRef","props","ref","select","mergedProps","mergeProps","jsx","ark","SelectContent","presence","usePresenceContext","composeRefs","SelectControl","SelectHiddenSelect","isValueEmpty","field","useFieldContext","jsxs","item","index","SelectIndicator","SelectItemProvider","useSelectItemContext","SelectItemPropsProvider","useSelectItemPropsContext","SelectItem","itemProps","localProps","createSplitProps","itemState","SelectItemGroupPropsProvider","useSelectItemGroupPropsContext","SelectItemGroup","id","useId","_itemGroupProps","itemGroupProps","SelectItemGroupLabel","SelectItemIndicator","SelectItemText","SelectLabel","SelectPositioner","useSelect","dir","useLocaleContext","getRootNode","useEnvironmentContext","machineProps","service","useMachine","select.machine","select.connect","normalizeProps","SelectImpl","presenceProps","selectProps","splitPresenceProps","useSelectProps","usePresence","PresenceProvider","SelectRoot","SelectRootProvider","SelectTrigger","SelectValueText","children","placeholder","localprops","withProvider","withContext","createSlotRecipeContext","Select.RootProvider","Select.Root","Select.Trigger","Select.Positioner","Select.Content","Select.ValueText","Select.ClearTrigger","CloseIcon","Select.ItemGroup","Select.ItemGroupLabel","Select.Item","Select.ItemText","Select.ItemIndicator","CheckIcon","SelectIndicatorGroup","Select.Indicator","ChevronDownIcon","Select.Control","Select.Label","Select.HiddenSelect","SelectItemContent","onContrast","shouldTruncateText","size","Fragment","Text","placeholderElement","rest","selectedItem","useMemo","CSelect.Trigger","CSelect.ValueText","Select","withFormControl","clearable","emptyPlaceholder","loading","onSearch","searchable","searchPlaceholder","selectRef","modalContentRef","useModalContentRef","_computedVariant","searchText","setSearchText","useState","filteredOptions","setFilteredOptions","handleSearch","useCallback","e","searchInput","filteredItems","option","collection","CSelect.Root","CSelect.HiddenSelect","CSelect.Control","CSelect.IndicatorGroup","CSelect.ClearTrigger","Button","Icon","Portal","CSelect.Positioner","CSelect.Content","Flex","Spinner","Box","TextInput","CSelect.Item","WrappedSelect","React"],"mappings":"yuBAEMA,GAAwBC,GAAY,IAAIC,EAAAA,eAAeD,CAAO,ECC9D,CAACE,EAAgBC,CAAgB,EAAIC,gBAAc,CACvD,KAAM,gBACN,SAAU,mBACV,aAAc,oBAChB,CAAC,ECAKC,EAAqBC,EAAU,WAAC,CAACC,EAAOC,IAAQ,CACpD,MAAMC,EAASN,EAAkB,EAC3BO,EAAcC,EAAU,WAACF,EAAO,qBAAoB,EAAIF,CAAK,EACnE,OAAuBK,EAAAA,kBAAAA,IAAIC,EAAAA,IAAI,OAAQ,CAAE,GAAGH,EAAa,IAAAF,EAAK,CAChE,CAAC,EACDH,EAAmB,YAAc,qBCHjC,MAAMS,EAAgBR,EAAU,WAAC,CAACC,EAAOC,IAAQ,CAC/C,MAAMC,EAASN,EAAkB,EAC3BY,EAAWC,EAAAA,mBAAoB,EAC/BN,EAAcC,EAAU,WAACF,EAAO,gBAAiB,EAAEM,EAAS,iBAAkB,EAAER,CAAK,EAC3F,OAAIQ,EAAS,UACJ,KAEcH,wBAAIC,EAAAA,IAAI,IAAK,CAAE,GAAGH,EAAa,IAAKO,EAAAA,YAAYF,EAAS,IAAKP,CAAG,CAAC,CAAE,CAC7F,CAAC,EACDM,EAAc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Z,EAAA,kBAAA,IAAAsI,GAAA,CAAa,KAAA1H,EACZ,SAAAZ,EAAA,kBAAA,IAACoF,EAAA,CACC,KAAAxE,EACA,WAAY,CAAC,CAACyE,EACd,mBAAoB,CAAC,CAACC,EACtB,KAAAC,CAAA,CAL2B,CAAA,EAAA3E,EAAK,KAOpC,CACD,EAEDZ,EAAAA,kBAAAA,IAACkI,EAAAA,KAAK,CAAA,EAAE,OAAO,eAAe,SAAS,GAAI,EACzC,SAAAlI,EAAA,kBAAA,IAACyF,EAAA,YAAA,CACC,KAAK,KACL,QAASJ,EAAa,mBAAqB,SAE1C,SAAAc,CAAA,CAAA,CAEL,CAAA,CAAA,EAEJ,CAAA,CAEJ,EACF,CACF,CAAA,CAAA,CAAA,CACF,CAAA,CAGN,EAEMoC,EAAgBC,GAAM,QAAA,WAC1B,CAAC7I,EAAoBC,IACnBI,wBAACgG,IAAO,UAAWpG,EAAM,GAAGD,CAAO,CAAA,CAEvC,EAEA4I,EAAc,YAAc","x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22]}
|
|
@@ -0,0 +1,391 @@
|
|
|
1
|
+
import { j as e } from "./jsx-runtime-C5mzlN2N.js";
|
|
2
|
+
import ae, { forwardRef as i, useId as G, useMemo as A, useState as N, useCallback as ie } from "react";
|
|
3
|
+
import { w as de } from "./withFormControl-Vf_flDYv.js";
|
|
4
|
+
import { I as pe } from "./icon.component-BmcWaysM.js";
|
|
5
|
+
import { B as me } from "./button.component-BWlRjD5a.js";
|
|
6
|
+
import { W as R } from "./text.component-D3E0SdX1.js";
|
|
7
|
+
import { S as ue } from "./spinner.component-DCSsW51J.js";
|
|
8
|
+
import { a as h, f as d, u as L, h as xe, b as g, j as Se, i as Pe, k as he, n as ge, s as O, l as k, m as F, P as fe } from "./use-locale-context-zakBNK5b.js";
|
|
9
|
+
import { c as Ce } from "./create-slot-recipe-context-DJkLYvCT.js";
|
|
10
|
+
import { C as ve, b as je, c as Ie } from "./icons-grAfs3Oz.js";
|
|
11
|
+
import { u as V } from "./use-field-context-B8ygn96q.js";
|
|
12
|
+
import { U as a } from "./index-DLvqBeH6.js";
|
|
13
|
+
import { L as be, m as Te, c as ye } from "./index-Dn2nvQ5m.js";
|
|
14
|
+
import { u as Ne } from "./tooltip.component-DYBYGsfe.js";
|
|
15
|
+
import { W as we } from "./textInput.component-BpCIE07n.js";
|
|
16
|
+
import { F as w } from "./flex-C2d2LH-K.js";
|
|
17
|
+
import { B as Ge } from "./box-y05hq0PT.js";
|
|
18
|
+
const Ae = (r) => new be(r), [$, p] = h({
|
|
19
|
+
name: "SelectContext",
|
|
20
|
+
hookName: "useSelectContext",
|
|
21
|
+
providerName: "<SelectProvider />"
|
|
22
|
+
}), _ = i((r, o) => {
|
|
23
|
+
const s = p(), t = a(s.getClearTriggerProps(), r);
|
|
24
|
+
return /* @__PURE__ */ e.jsx(d.button, { ...t, ref: o });
|
|
25
|
+
});
|
|
26
|
+
_.displayName = "SelectClearTrigger";
|
|
27
|
+
const H = i((r, o) => {
|
|
28
|
+
const s = p(), t = L(), l = a(s.getContentProps(), t.getPresenceProps(), r);
|
|
29
|
+
return t.unmounted ? null : /* @__PURE__ */ e.jsx(d.div, { ...l, ref: xe(t.ref, o) });
|
|
30
|
+
});
|
|
31
|
+
H.displayName = "SelectContent";
|
|
32
|
+
const W = i((r, o) => {
|
|
33
|
+
const s = p(), t = a(s.getControlProps(), r);
|
|
34
|
+
return /* @__PURE__ */ e.jsx(d.div, { ...t, ref: o });
|
|
35
|
+
});
|
|
36
|
+
W.displayName = "SelectControl";
|
|
37
|
+
const B = i((r, o) => {
|
|
38
|
+
const s = p(), t = a(s.getHiddenSelectProps(), r), l = s.value.length === 0, n = V();
|
|
39
|
+
return /* @__PURE__ */ e.jsxs(d.select, { "aria-describedby": n?.ariaDescribedby, ...t, ref: o, children: [
|
|
40
|
+
l && /* @__PURE__ */ e.jsx("option", { value: "" }),
|
|
41
|
+
s.collection.items.map((c, x) => /* @__PURE__ */ e.jsx(
|
|
42
|
+
"option",
|
|
43
|
+
{
|
|
44
|
+
value: s.collection.getItemValue(c) ?? "",
|
|
45
|
+
disabled: s.collection.getItemDisabled(c),
|
|
46
|
+
children: s.collection.stringifyItem(c)
|
|
47
|
+
},
|
|
48
|
+
x
|
|
49
|
+
))
|
|
50
|
+
] });
|
|
51
|
+
});
|
|
52
|
+
B.displayName = "SelectHiddenSelect";
|
|
53
|
+
const D = i((r, o) => {
|
|
54
|
+
const s = p(), t = a(s.getIndicatorProps(), r);
|
|
55
|
+
return /* @__PURE__ */ e.jsx(d.div, { ...t, ref: o });
|
|
56
|
+
});
|
|
57
|
+
D.displayName = "SelectIndicator";
|
|
58
|
+
const [Re, ht] = h({
|
|
59
|
+
name: "SelectItemContext",
|
|
60
|
+
hookName: "useSelectItemContext",
|
|
61
|
+
providerName: "<SelectItemProvider />"
|
|
62
|
+
}), [Le, E] = h({
|
|
63
|
+
name: "SelectItemPropsContext",
|
|
64
|
+
hookName: "useSelectItemPropsContext",
|
|
65
|
+
providerName: "<SelectItemPropsProvider />"
|
|
66
|
+
}), q = i((r, o) => {
|
|
67
|
+
const [s, t] = g()(r, ["item", "persistFocus"]), l = p(), n = a(l.getItemProps(s), t), c = l.getItemState(s);
|
|
68
|
+
return /* @__PURE__ */ e.jsx(Le, { value: s, children: /* @__PURE__ */ e.jsx(Re, { value: c, children: /* @__PURE__ */ e.jsx(d.div, { ...n, ref: o }) }) });
|
|
69
|
+
});
|
|
70
|
+
q.displayName = "SelectItem";
|
|
71
|
+
const [Oe, ke] = h({
|
|
72
|
+
name: "SelectItemGroupPropsContext",
|
|
73
|
+
hookName: "useSelectItemGroupPropsContext",
|
|
74
|
+
providerName: "<SelectItemGroupPropsProvider />"
|
|
75
|
+
}), M = i((r, o) => {
|
|
76
|
+
const s = G(), [t, l] = g()(r, ["id"]), n = { id: s, ...t }, c = p(), x = a(c.getItemGroupProps(n), l);
|
|
77
|
+
return /* @__PURE__ */ e.jsx(Oe, { value: n, children: /* @__PURE__ */ e.jsx(d.div, { ...x, ref: o }) });
|
|
78
|
+
});
|
|
79
|
+
M.displayName = "SelectItemGroup";
|
|
80
|
+
const U = i((r, o) => {
|
|
81
|
+
const s = p(), t = ke(), l = a(s.getItemGroupLabelProps({ htmlFor: t.id }), r);
|
|
82
|
+
return /* @__PURE__ */ e.jsx(d.div, { ...l, ref: o });
|
|
83
|
+
});
|
|
84
|
+
U.displayName = "SelectItemGroupLabel";
|
|
85
|
+
const z = i((r, o) => {
|
|
86
|
+
const s = p(), t = E(), l = a(s.getItemIndicatorProps(t), r);
|
|
87
|
+
return /* @__PURE__ */ e.jsx(d.div, { ...l, ref: o });
|
|
88
|
+
});
|
|
89
|
+
z.displayName = "SelectItemIndicator";
|
|
90
|
+
const J = i((r, o) => {
|
|
91
|
+
const s = p(), t = E(), l = a(s.getItemTextProps(t), r);
|
|
92
|
+
return /* @__PURE__ */ e.jsx(d.span, { ...l, ref: o });
|
|
93
|
+
});
|
|
94
|
+
J.displayName = "SelectItemText";
|
|
95
|
+
const K = i((r, o) => {
|
|
96
|
+
const s = p(), t = a(s.getLabelProps(), r);
|
|
97
|
+
return /* @__PURE__ */ e.jsx(d.label, { ...t, ref: o });
|
|
98
|
+
});
|
|
99
|
+
K.displayName = "SelectLabel";
|
|
100
|
+
const Q = i((r, o) => {
|
|
101
|
+
const s = p(), t = a(s.getPositionerProps(), r);
|
|
102
|
+
return L().unmounted ? null : /* @__PURE__ */ e.jsx(d.div, { ...t, ref: o });
|
|
103
|
+
});
|
|
104
|
+
Q.displayName = "SelectPositioner";
|
|
105
|
+
const Fe = (r) => {
|
|
106
|
+
const o = G(), { dir: s } = Se(), { getRootNode: t } = Pe(), l = V(), n = {
|
|
107
|
+
id: o,
|
|
108
|
+
ids: {
|
|
109
|
+
label: l?.ids.label,
|
|
110
|
+
hiddenSelect: l?.ids.control
|
|
111
|
+
},
|
|
112
|
+
disabled: l?.disabled,
|
|
113
|
+
readOnly: l?.readOnly,
|
|
114
|
+
invalid: l?.invalid,
|
|
115
|
+
required: l?.required,
|
|
116
|
+
dir: s,
|
|
117
|
+
getRootNode: t,
|
|
118
|
+
...r
|
|
119
|
+
}, c = he(Te, n);
|
|
120
|
+
return ye(c, ge);
|
|
121
|
+
}, Ve = (r, o) => {
|
|
122
|
+
const [s, t] = O(r), [l, n] = g()(t, [
|
|
123
|
+
"closeOnSelect",
|
|
124
|
+
"collection",
|
|
125
|
+
"composite",
|
|
126
|
+
"defaultHighlightedValue",
|
|
127
|
+
"defaultOpen",
|
|
128
|
+
"defaultValue",
|
|
129
|
+
"deselectable",
|
|
130
|
+
"disabled",
|
|
131
|
+
"form",
|
|
132
|
+
"highlightedValue",
|
|
133
|
+
"id",
|
|
134
|
+
"ids",
|
|
135
|
+
"invalid",
|
|
136
|
+
"loopFocus",
|
|
137
|
+
"multiple",
|
|
138
|
+
"name",
|
|
139
|
+
"onFocusOutside",
|
|
140
|
+
"onHighlightChange",
|
|
141
|
+
"onInteractOutside",
|
|
142
|
+
"onOpenChange",
|
|
143
|
+
"onPointerDownOutside",
|
|
144
|
+
"onValueChange",
|
|
145
|
+
"open",
|
|
146
|
+
"positioning",
|
|
147
|
+
"readOnly",
|
|
148
|
+
"required",
|
|
149
|
+
"scrollToIndexFn",
|
|
150
|
+
"value"
|
|
151
|
+
]), c = Fe(l), x = k(a({ present: c.open }, s)), f = a(c.getRootProps(), n);
|
|
152
|
+
return /* @__PURE__ */ e.jsx($, { value: c, children: /* @__PURE__ */ e.jsx(F, { value: x, children: /* @__PURE__ */ e.jsx(d.div, { ...f, ref: o }) }) });
|
|
153
|
+
}, $e = i(Ve), _e = (r, o) => {
|
|
154
|
+
const [s, t] = O(r), [{ value: l }, n] = g()(t, ["value"]), c = k(a({ present: l.open }, s)), x = a(l.getRootProps(), n);
|
|
155
|
+
return /* @__PURE__ */ e.jsx($, { value: l, children: /* @__PURE__ */ e.jsx(F, { value: c, children: /* @__PURE__ */ e.jsx(d.div, { ...x, ref: o }) }) });
|
|
156
|
+
}, He = i(_e), X = i((r, o) => {
|
|
157
|
+
const s = p(), t = a(s.getTriggerProps(), r);
|
|
158
|
+
return /* @__PURE__ */ e.jsx(d.button, { ...t, ref: o });
|
|
159
|
+
});
|
|
160
|
+
X.displayName = "SelectTrigger";
|
|
161
|
+
const Y = i((r, o) => {
|
|
162
|
+
const { children: s, placeholder: t, ...l } = r, n = p(), c = a(n.getValueTextProps(), l);
|
|
163
|
+
return /* @__PURE__ */ e.jsx(d.span, { ...c, ref: o, children: s || n.valueAsString || t });
|
|
164
|
+
});
|
|
165
|
+
Y.displayName = "SelectValueText";
|
|
166
|
+
const {
|
|
167
|
+
withProvider: Z,
|
|
168
|
+
withContext: m
|
|
169
|
+
} = Ce({ key: "select" });
|
|
170
|
+
Z(He, "root", {
|
|
171
|
+
forwardAsChild: !0
|
|
172
|
+
});
|
|
173
|
+
const We = Z(
|
|
174
|
+
$e,
|
|
175
|
+
"root",
|
|
176
|
+
{
|
|
177
|
+
forwardAsChild: !0,
|
|
178
|
+
defaultProps: { positioning: { sameWidth: !0 } }
|
|
179
|
+
}
|
|
180
|
+
), Be = m(
|
|
181
|
+
X,
|
|
182
|
+
"trigger",
|
|
183
|
+
{ forwardAsChild: !0 }
|
|
184
|
+
), De = m(Q, "positioner", { forwardAsChild: !0 }), Ee = m(
|
|
185
|
+
H,
|
|
186
|
+
"content",
|
|
187
|
+
{ forwardAsChild: !0 }
|
|
188
|
+
), qe = m(Y, "valueText", { forwardAsChild: !0 }), Me = m(_, "clearTrigger", {
|
|
189
|
+
forwardAsChild: !0,
|
|
190
|
+
defaultProps: { children: /* @__PURE__ */ e.jsx(ve, { boxSize: "1em" }) }
|
|
191
|
+
});
|
|
192
|
+
m(M, "itemGroup", { forwardAsChild: !0 });
|
|
193
|
+
m(U, "itemGroupLabel", { forwardAsChild: !0 });
|
|
194
|
+
const Ue = m(
|
|
195
|
+
q,
|
|
196
|
+
"item",
|
|
197
|
+
{ forwardAsChild: !0 }
|
|
198
|
+
);
|
|
199
|
+
m(
|
|
200
|
+
J,
|
|
201
|
+
"itemText",
|
|
202
|
+
{ forwardAsChild: !0 }
|
|
203
|
+
);
|
|
204
|
+
m(z, "itemIndicator", {
|
|
205
|
+
forwardAsChild: !0,
|
|
206
|
+
defaultProps: {
|
|
207
|
+
children: /* @__PURE__ */ e.jsx(je, {})
|
|
208
|
+
}
|
|
209
|
+
});
|
|
210
|
+
const ze = m("div", "indicatorGroup");
|
|
211
|
+
m(D, "indicator", {
|
|
212
|
+
forwardAsChild: !0,
|
|
213
|
+
defaultProps: {
|
|
214
|
+
children: /* @__PURE__ */ e.jsx(Ie, {})
|
|
215
|
+
}
|
|
216
|
+
});
|
|
217
|
+
const Je = m(
|
|
218
|
+
W,
|
|
219
|
+
"control",
|
|
220
|
+
{ forwardAsChild: !0 }
|
|
221
|
+
);
|
|
222
|
+
m(
|
|
223
|
+
K,
|
|
224
|
+
"label",
|
|
225
|
+
{ forwardAsChild: !0 }
|
|
226
|
+
);
|
|
227
|
+
const Ke = B, ee = ({
|
|
228
|
+
item: r,
|
|
229
|
+
onContrast: o,
|
|
230
|
+
shouldTruncateText: s,
|
|
231
|
+
size: t
|
|
232
|
+
}) => /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
233
|
+
r.leftElement,
|
|
234
|
+
typeof r.label == "string" ? /* @__PURE__ */ e.jsx(
|
|
235
|
+
R,
|
|
236
|
+
{
|
|
237
|
+
size: t,
|
|
238
|
+
truncated: s,
|
|
239
|
+
variant: r.variant || (o ? "onContrast" : "default"),
|
|
240
|
+
children: r.label
|
|
241
|
+
}
|
|
242
|
+
) : r.label
|
|
243
|
+
] }), Qe = ({
|
|
244
|
+
placeholder: r = "",
|
|
245
|
+
placeholderElement: o,
|
|
246
|
+
...s
|
|
247
|
+
}) => {
|
|
248
|
+
const t = p(), l = A(() => t.selectedItems[0], [t]);
|
|
249
|
+
return /* @__PURE__ */ e.jsxs(Be, { children: [
|
|
250
|
+
!l && o,
|
|
251
|
+
/* @__PURE__ */ e.jsx(qe, { placeholder: r, children: l && /* @__PURE__ */ e.jsx(ee, { item: l, ...s }) })
|
|
252
|
+
] });
|
|
253
|
+
}, Xe = de(
|
|
254
|
+
({
|
|
255
|
+
clearable: r,
|
|
256
|
+
emptyPlaceholder: o = "No options available",
|
|
257
|
+
loading: s,
|
|
258
|
+
onContrast: t,
|
|
259
|
+
onSearch: l,
|
|
260
|
+
options: n,
|
|
261
|
+
placeholder: c = "",
|
|
262
|
+
placeholderElement: x,
|
|
263
|
+
searchable: f = !1,
|
|
264
|
+
searchPlaceholder: te = "Search...",
|
|
265
|
+
selectRef: re,
|
|
266
|
+
shouldTruncateText: j = !0,
|
|
267
|
+
size: S = "md",
|
|
268
|
+
...se
|
|
269
|
+
}) => {
|
|
270
|
+
const { contentRef: oe } = Ne(), le = t ? "onContrast" : "default", [ne, I] = N(""), [b, T] = N(n), y = ie(
|
|
271
|
+
(u) => {
|
|
272
|
+
const P = u.target.value;
|
|
273
|
+
if (I(P), l)
|
|
274
|
+
l(u);
|
|
275
|
+
else if (P === "" || !P)
|
|
276
|
+
T(n);
|
|
277
|
+
else {
|
|
278
|
+
const ce = n.filter((v) => !!(typeof v.label == "string" ? v.label : v.valueText)?.toLowerCase().includes(P.toLowerCase()));
|
|
279
|
+
T(ce);
|
|
280
|
+
}
|
|
281
|
+
},
|
|
282
|
+
[l, n]
|
|
283
|
+
), C = A(() => Ae({
|
|
284
|
+
items: b ?? [],
|
|
285
|
+
itemToString: (u) => typeof u.label == "string" ? u.label : u.valueText || "",
|
|
286
|
+
itemToValue: (u) => u.value
|
|
287
|
+
}), [b]);
|
|
288
|
+
return /* @__PURE__ */ e.jsxs(
|
|
289
|
+
We,
|
|
290
|
+
{
|
|
291
|
+
className: "Select",
|
|
292
|
+
"data-testid": "kibble-select",
|
|
293
|
+
collection: C,
|
|
294
|
+
size: S,
|
|
295
|
+
variant: le,
|
|
296
|
+
...se,
|
|
297
|
+
children: [
|
|
298
|
+
/* @__PURE__ */ e.jsx(Ke, { ref: re }),
|
|
299
|
+
/* @__PURE__ */ e.jsxs(Je, { children: [
|
|
300
|
+
/* @__PURE__ */ e.jsx(
|
|
301
|
+
Qe,
|
|
302
|
+
{
|
|
303
|
+
placeholder: c,
|
|
304
|
+
placeholderElement: x,
|
|
305
|
+
onContrast: !!t,
|
|
306
|
+
shouldTruncateText: !!j,
|
|
307
|
+
size: S
|
|
308
|
+
}
|
|
309
|
+
),
|
|
310
|
+
/* @__PURE__ */ e.jsxs(ze, { children: [
|
|
311
|
+
r && /* @__PURE__ */ e.jsx(Me, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
312
|
+
me,
|
|
313
|
+
{
|
|
314
|
+
iconName: "close",
|
|
315
|
+
onContrast: t,
|
|
316
|
+
size: S === "lg" ? "sm" : "xs",
|
|
317
|
+
variant: "ghostNeutral"
|
|
318
|
+
}
|
|
319
|
+
) }),
|
|
320
|
+
/* @__PURE__ */ e.jsx(
|
|
321
|
+
pe,
|
|
322
|
+
{
|
|
323
|
+
name: "chevronDown",
|
|
324
|
+
size: S,
|
|
325
|
+
variant: t ? "onContrast" : "default"
|
|
326
|
+
}
|
|
327
|
+
)
|
|
328
|
+
] })
|
|
329
|
+
] }),
|
|
330
|
+
/* @__PURE__ */ e.jsx(fe, { container: oe || void 0, children: /* @__PURE__ */ e.jsx(De, { children: /* @__PURE__ */ e.jsx(Ee, { children: s ? /* @__PURE__ */ e.jsx(w, { w: "100%", justifyContent: "center", py: 3, children: /* @__PURE__ */ e.jsx(
|
|
331
|
+
ue,
|
|
332
|
+
{
|
|
333
|
+
variant: t ? "brandOnContrast" : "brand",
|
|
334
|
+
size: S
|
|
335
|
+
}
|
|
336
|
+
) }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
337
|
+
f && /* @__PURE__ */ e.jsx(
|
|
338
|
+
Ge,
|
|
339
|
+
{
|
|
340
|
+
className: "Select__Header",
|
|
341
|
+
"data-testid": "kibble-select-header",
|
|
342
|
+
m: "0 12px 8px",
|
|
343
|
+
children: /* @__PURE__ */ e.jsx(
|
|
344
|
+
we,
|
|
345
|
+
{
|
|
346
|
+
className: "Select__SearchBar",
|
|
347
|
+
"data-testid": "kibble-select-search-bar",
|
|
348
|
+
placeholder: te,
|
|
349
|
+
onChange: y,
|
|
350
|
+
size: "sm",
|
|
351
|
+
value: ne,
|
|
352
|
+
clearable: !0,
|
|
353
|
+
onClear: () => {
|
|
354
|
+
I(""), y({
|
|
355
|
+
target: { value: "" }
|
|
356
|
+
});
|
|
357
|
+
},
|
|
358
|
+
formControlStyle: { mt: 1 }
|
|
359
|
+
}
|
|
360
|
+
)
|
|
361
|
+
}
|
|
362
|
+
),
|
|
363
|
+
C.items.length ? C.items.map((u) => /* @__PURE__ */ e.jsx(Ue, { item: u, children: /* @__PURE__ */ e.jsx(
|
|
364
|
+
ee,
|
|
365
|
+
{
|
|
366
|
+
item: u,
|
|
367
|
+
onContrast: !!t,
|
|
368
|
+
shouldTruncateText: !!j,
|
|
369
|
+
size: S
|
|
370
|
+
}
|
|
371
|
+
) }, u.value)) : /* @__PURE__ */ e.jsx(w, { w: "100%", justifyContent: "center", py: 3, children: /* @__PURE__ */ e.jsx(
|
|
372
|
+
R,
|
|
373
|
+
{
|
|
374
|
+
size: "sm",
|
|
375
|
+
variant: t ? "subtleOnContrast" : "subtle",
|
|
376
|
+
children: o
|
|
377
|
+
}
|
|
378
|
+
) })
|
|
379
|
+
] }) }) }) })
|
|
380
|
+
]
|
|
381
|
+
}
|
|
382
|
+
);
|
|
383
|
+
}
|
|
384
|
+
), Ye = ae.forwardRef(
|
|
385
|
+
(r, o) => /* @__PURE__ */ e.jsx(Xe, { selectRef: o, ...r })
|
|
386
|
+
);
|
|
387
|
+
Ye.displayName = "Select";
|
|
388
|
+
export {
|
|
389
|
+
Ye as W
|
|
390
|
+
};
|
|
391
|
+
//# sourceMappingURL=select.component-CEDzVkE_.js.map
|