@xploreu/components 0.4.65 → 0.4.67
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/{chunk-A5644ETE.js → chunk-7JOBHAXZ.js} +2 -2
- package/dist/{chunk-A5644ETE.js.map → chunk-7JOBHAXZ.js.map} +1 -1
- package/dist/{chunk-FFZID5F7.js → chunk-7PQPPJO2.js} +2 -2
- package/dist/{chunk-FFZID5F7.js.map → chunk-7PQPPJO2.js.map} +1 -1
- package/dist/{chunk-DTWCRGRP.js → chunk-BNMOOOFY.js} +2 -2
- package/dist/{chunk-DTWCRGRP.js.map → chunk-BNMOOOFY.js.map} +1 -1
- package/dist/chunk-CT7JPFL4.js +3 -0
- package/dist/chunk-CT7JPFL4.js.map +1 -0
- package/dist/{chunk-TDAEQLUM.js → chunk-F7VAJTWI.js} +2 -2
- package/dist/{chunk-TDAEQLUM.js.map → chunk-F7VAJTWI.js.map} +1 -1
- package/dist/chunk-FTET6SSC.js +2 -0
- package/dist/chunk-FTET6SSC.js.map +1 -0
- package/dist/{chunk-R4XVXVLJ.js → chunk-ILE3MBTR.js} +2 -2
- package/dist/{chunk-R4XVXVLJ.js.map → chunk-ILE3MBTR.js.map} +1 -1
- package/dist/{chunk-AKKXXJRJ.js → chunk-MM4FBTNO.js} +2 -2
- package/dist/{chunk-AKKXXJRJ.js.map → chunk-MM4FBTNO.js.map} +1 -1
- package/dist/{chunk-SJJ74B6D.js → chunk-NJVFQXVS.js} +2 -2
- package/dist/{chunk-SJJ74B6D.js.map → chunk-NJVFQXVS.js.map} +1 -1
- package/dist/chunk-OF7UIE56.js +2 -0
- package/dist/chunk-OF7UIE56.js.map +1 -0
- package/dist/{chunk-QVE2R4LU.js → chunk-OJD5A5W4.js} +2 -2
- package/dist/{chunk-QVE2R4LU.js.map → chunk-OJD5A5W4.js.map} +1 -1
- package/dist/chunk-OLQXHFH4.js +2 -0
- package/dist/chunk-OLQXHFH4.js.map +1 -0
- package/dist/chunk-Q6KYNUGD.js +2 -0
- package/dist/{chunk-PMIXI5H3.js.map → chunk-Q6KYNUGD.js.map} +1 -1
- package/dist/chunk-QQHSCREG.js +2 -0
- package/dist/chunk-QQHSCREG.js.map +1 -0
- package/dist/chunk-REBKHJ4V.js +2 -0
- package/dist/chunk-REBKHJ4V.js.map +1 -0
- package/dist/{chunk-2JX7KPG7.js → chunk-SPVZZROC.js} +2 -2
- package/dist/{chunk-2JX7KPG7.js.map → chunk-SPVZZROC.js.map} +1 -1
- package/dist/chunk-SR4WMOQH.js +3 -0
- package/dist/chunk-SR4WMOQH.js.map +1 -0
- package/dist/chunk-TFJ6LNOE.js +2 -0
- package/dist/chunk-TFJ6LNOE.js.map +1 -0
- package/dist/{chunk-W4KMXVJ3.js → chunk-U7E7HHJZ.js} +2 -2
- package/dist/{chunk-W4KMXVJ3.js.map → chunk-U7E7HHJZ.js.map} +1 -1
- package/dist/chunk-W4DBU7UU.js +2 -0
- package/dist/chunk-W4DBU7UU.js.map +1 -0
- package/dist/chunk-XEYTRNPN.js +2 -0
- package/dist/chunk-XEYTRNPN.js.map +1 -0
- package/dist/{chunk-MILLLLR2.js → chunk-YZEE43WX.js} +2 -2
- package/dist/{chunk-MILLLLR2.js.map → chunk-YZEE43WX.js.map} +1 -1
- package/dist/chunk-ZAFFMMBP.js +3 -0
- package/dist/chunk-ZAFFMMBP.js.map +1 -0
- package/dist/composites/combobox-chip-outside.js +1 -1
- package/dist/composites/combobox-chip.js +1 -1
- package/dist/composites/combobox-simple.js +1 -1
- package/dist/composites/filter-combobox.js +1 -1
- package/dist/composites/index.js +1 -1
- package/dist/composites/index.js.map +1 -1
- package/dist/composites/phone-input.js +1 -1
- package/dist/composites/profile-avatar.js +1 -1
- package/dist/form/form-input.js +1 -1
- package/dist/form/form-rich-textarea.d.ts +18 -0
- package/dist/form/form-rich-textarea.js +2 -0
- package/dist/form/form-rich-textarea.js.map +1 -0
- package/dist/form/form-textarea.js +1 -1
- package/dist/form/form.d.ts +1 -1
- package/dist/form/index.d.ts +3 -0
- package/dist/form/index.js +1 -1
- package/dist/icons/index.d.ts +2 -0
- package/dist/icons/index.js +1 -1
- package/dist/icons/users-plus-filled-icon.d.ts +6 -0
- package/dist/icons/users-plus-filled-icon.js +2 -0
- package/dist/icons/users-plus-filled-icon.js.map +1 -0
- package/dist/icons/users-plus-icon.d.ts +6 -0
- package/dist/icons/users-plus-icon.js +2 -0
- package/dist/icons/users-plus-icon.js.map +1 -0
- package/dist/primitives/index.d.ts +4 -0
- package/dist/primitives/index.js +1 -1
- package/dist/primitives/toggle-group.d.ts +24 -0
- package/dist/primitives/toggle-group.js +2 -0
- package/dist/primitives/toggle-group.js.map +1 -0
- package/dist/primitives/toggle.d.ts +18 -0
- package/dist/primitives/toggle.js +2 -0
- package/dist/primitives/toggle.js.map +1 -0
- package/dist/ui/badge-blue.d.ts +2 -2
- package/dist/ui/badge-blue.js +1 -1
- package/dist/ui/badge.d.ts +6 -2
- package/dist/ui/badge.js +1 -1
- package/dist/ui/button.d.ts +2 -2
- package/dist/ui/combobox.js +1 -1
- package/dist/ui/date-multiple-picker.js +1 -1
- package/dist/ui/date-picker.d.ts +2 -2
- package/dist/ui/date-picker.js +1 -1
- package/dist/ui/date-range-picker.js +1 -1
- package/dist/ui/dialog.js +1 -1
- package/dist/ui/index.d.ts +9 -0
- package/dist/ui/index.js +1 -1
- package/dist/ui/input-group.d.ts +2 -2
- package/dist/ui/input-new.d.ts +1 -1
- package/dist/ui/input.d.ts +1 -1
- package/dist/ui/input.js +1 -1
- package/dist/ui/label.d.ts +2 -2
- package/dist/ui/pagination.js +1 -1
- package/dist/ui/rich-textarea.d.ts +34 -0
- package/dist/ui/rich-textarea.js +2 -0
- package/dist/ui/rich-textarea.js.map +1 -0
- package/dist/ui/switch.d.ts +2 -2
- package/dist/ui/table.js +1 -1
- package/dist/ui/textarea.d.ts +1 -1
- package/dist/ui/toast.js +1 -1
- package/dist/ui/toggle-group.d.ts +17 -0
- package/dist/ui/toggle-group.js +2 -0
- package/dist/ui/toggle-group.js.map +1 -0
- package/dist/ui/toggle.d.ts +15 -0
- package/dist/ui/toggle.js +2 -0
- package/dist/ui/toggle.js.map +1 -0
- package/package.json +116 -108
- package/dist/chunk-ALEOQB4P.js +0 -2
- package/dist/chunk-ALEOQB4P.js.map +0 -1
- package/dist/chunk-JLZNZFOO.js +0 -2
- package/dist/chunk-JLZNZFOO.js.map +0 -1
- package/dist/chunk-KPNQNOZ5.js +0 -2
- package/dist/chunk-KPNQNOZ5.js.map +0 -1
- package/dist/chunk-PMIXI5H3.js +0 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/ui/combobox.tsx"],"names":["Combobox","props","jsx","ComboboxTrigger","className","rest","cn","ComboboxLabel","ComboboxInputGroup","ComboboxInput","wrapperClassName","size","Input","SearchIcon","ComboboxInputFilter","displayValueKey","placeholder","inputProps","inputValue","setInputValue","useCombobox","inputClassName","startContent","restInputProps","jsxs","ComboboxChips","e","XIcon","event","ComboboxValue","value","item","ComboboxChip","ComboboxChipRemove","ComboboxIcon","ComboboxClear","Badge","BadgeButton","ComboboxPopup","align","sideOffset","container","initialFocus","finalFocus","style","children","ComboboxPortal","ComboboxPositioner","ComboboxHighlight","ComboboxBackdrop","ComboboxStatus","status","trimmedInputValue","text","Fragment","Loader2Icon","ComboboxEmpty","ComboboxList","items","useFilteredItems","ScrollArea","index","ComboboxHighlightItem","ComboboxRow","ComboboxItem","indicator","disabled","ComboboxItemIndicator","state","CheckCircle2Icon","Checkbox","ComboboxItemTitle","ComboboxItemDescription","ComboboxItemIcon","ComboboxItemAvatar","src","imageSrc","avatarClassName","imageAlt","fallbackText","finalSrc","Avatar","AvatarImage","AvatarFallback","ComboboxSeparator","ComboboxGroup","ComboboxGroupLabel","ComboboxCollection","ComboboxArrow","ComboboxInfiniteScroll","hasMore","threshold","InfiniteScroll"],"mappings":"8hBAgFA,SAASA,EAAAA,CAA8DC,CAAAA,CAAuC,C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AAGtF,CAAAA,CAAO,CACjD,CAIA,SAASuF,EAAAA,CAAcvF,CAAAA,CAA2B,CAChD,GAAM,CAAE,SAAA,CAAAG,CAAAA,CAAW,GAAGC,CAAK,CAAA,CAAIJ,CAAAA,CAE/B,OAAOC,GAAAA,CAACsF,CAAAA,CAAA,CACN,SAAA,CAAWlF,EAAAA,CAAG,kBAAmBF,CAAS,CAAA,CACzC,GAAGC,CAAAA,CACN,CACF,CAEA,SAASoF,EAAAA,CAAuB,CAC9B,OAAA,CAAAC,CAAAA,CACA,SAAA,CAAAC,CAAAA,CAAY,EAAA,CACZ,GAAG1F,CACL,CAAA,CAAkE,CAChE,OACEC,GAAAA,CAAC0F,GAAAA,CAAA,CACC,OAAA,CAASF,CAAAA,CACT,SAAA,CAAWC,CAAAA,CACV,GAAG1F,CAAAA,CAEH,QAAA,CAAAyF,CAAAA,EACClE,IAAAA,CAAC,KAAA,CAAA,CAAI,SAAA,CAAU,4EAAA,CACb,QAAA,CAAA,CAAAtB,IAACqD,WAAAA,CAAA,CAAY,SAAA,CAAU,qBAAA,CAAsB,EAC7CrD,GAAAA,CAAC,MAAA,CAAA,CAAK,QAAA,CAAA,iBAAA,CAEN,CAAA,CAAA,CACF,EAEJ,CAEJ","file":"chunk-R4XVXVLJ.js","sourcesContent":["import * as React from \"react\"\r\n\r\nimport {\r\n CheckCircle2Icon,\r\n Loader2Icon,\r\n SearchIcon,\r\n XIcon\r\n} from \"lucide-react\"\r\n\r\nimport {\r\n Combobox as ComboboxPrimitive,\r\n ComboboxArrow as ComboboxArrowPrimitive,\r\n type ComboboxArrowProps as ComboboxArrowPrimitiveProps,\r\n ComboboxBackdrop as ComboboxBackdropPrimitive,\r\n type ComboboxBackdropProps as ComboboxBackdropPrimitiveProps,\r\n ComboboxChip as ComboboxChipPrimitive,\r\n type ComboboxChipProps as ComboboxChipPrimitiveProps,\r\n ComboboxChipRemove as ComboboxChipRemovePrimitive,\r\n type ComboboxChipRemoveProps as ComboboxChipRemovePrimitiveProps,\r\n ComboboxChips as ComboboxChipsPrimitive,\r\n type ComboboxChipsProps as ComboboxChipsPrimitiveProps,\r\n ComboboxClear as ComboboxClearPrimitive,\r\n type ComboboxClearProps as ComboboxClearPrimitiveProps,\r\n ComboboxCollection as ComboboxCollectionPrimitive,\r\n type ComboboxCollectionProps as ComboboxCollectionPrimitiveProps,\r\n ComboboxEmpty as ComboboxEmptyPrimitive,\r\n type ComboboxEmptyProps as ComboboxEmptyPrimitiveProps,\r\n ComboboxGroup as ComboboxGroupPrimitive,\r\n ComboboxGroupLabel as ComboboxGroupLabelPrimitive,\r\n type ComboboxGroupLabelProps as ComboboxGroupLabelPrimitiveProps,\r\n type ComboboxGroupProps as ComboboxGroupPrimitiveProps,\r\n ComboboxHighlight as ComboboxHighlightPrimitive,\r\n ComboboxHighlightItem as ComboboxHighlightItemPrimitive,\r\n type ComboboxHighlightItemProps as ComboboxHighlightItemPrimitiveProps,\r\n type ComboboxHighlightProps as ComboboxHighlightPrimitiveProps,\r\n ComboboxIcon as ComboboxIconPrimitive,\r\n type ComboboxIconProps as ComboboxIconPrimitiveProps,\r\n ComboboxInput as ComboboxInputPrimitive,\r\n ComboboxInputGroup as ComboboxInputGroupPrimitive,\r\n type ComboboxInputGroupProps as ComboboxInputGroupPrimitiveProps,\r\n type ComboboxInputProps as ComboboxInputPrimitiveProps,\r\n ComboboxItem as ComboboxItemPrimitive,\r\n ComboboxItemIndicator as ComboboxItemIndicatorPrimitive,\r\n type ComboboxItemIndicatorProps as ComboboxItemIndicatorPrimitiveProps,\r\n type ComboboxItemProps as ComboboxItemPrimitiveProps,\r\n ComboboxLabel as ComboboxLabelPrimitive,\r\n type ComboboxLabelProps as ComboboxLabelPrimitiveProps,\r\n ComboboxList as ComboboxListPrimitive,\r\n type ComboboxListProps as ComboboxListPrimitiveProps,\r\n ComboboxPopup as ComboboxPopupPrimitive,\r\n type ComboboxPopupProps as ComboboxPopupPrimitiveProps,\r\n ComboboxPortal as ComboboxPortalPrimitive,\r\n type ComboboxPortalProps as ComboboxPortalPrimitiveProps,\r\n ComboboxPositioner as ComboboxPositionerPrimitive,\r\n type ComboboxPositionerProps as ComboboxPositionerPrimitiveProps,\r\n type ComboboxProps as ComboboxPrimitiveProps,\r\n ComboboxRow as ComboboxRowPrimitive,\r\n type ComboboxRowProps as ComboboxRowPrimitiveProps,\r\n ComboboxSeparator as ComboboxSeparatorPrimitive,\r\n type ComboboxSeparatorProps as ComboboxSeparatorPrimitiveProps,\r\n ComboboxStatus as ComboboxStatusPrimitive,\r\n type ComboboxStatusProps as ComboboxStatusPrimitiveProps,\r\n ComboboxTrigger as ComboboxTriggerPrimitive,\r\n type ComboboxTriggerProps as ComboboxTriggerPrimitiveProps,\r\n ComboboxValue as ComboboxValuePrimitive,\r\n type ComboboxValueProps as ComboboxValuePrimitiveProps,\r\n useCombobox,\r\n useFilteredItems,\r\n} from \"../primitives/combobox\"\r\nimport { cn } from \"@xploreu/lib/cn\"\r\n\r\nimport { ScrollArea } from \"./scroll-area\"\r\nimport { Badge, BadgeButton } from \"./badge\"\r\nimport { InfiniteScroll } from \"./infinite-scroll\"\r\nimport { Input } from \"./input\"\r\nimport { Checkbox } from \"./checkbox\"\r\nimport { Avatar, AvatarFallback, AvatarImage } from \"./avatar\"\r\n\r\ntype ComboboxProps<Value, Multiple extends boolean | undefined = false> = ComboboxPrimitiveProps<Value, Multiple>\r\n\r\nfunction Combobox<Value, Multiple extends boolean | undefined = false>(props: ComboboxProps<Value, Multiple>) {\r\n return (\r\n <ComboboxPrimitive {...props} />\r\n )\r\n}\r\n\r\ntype ComboboxTriggerProps = ComboboxTriggerPrimitiveProps\r\n\r\nfunction ComboboxTrigger(props: ComboboxTriggerProps) {\r\n const { className, ...rest } = props\r\n\r\n return <ComboboxTriggerPrimitive\r\n className={cn(\r\n \"group/combobox-trigger flex items-center gap-2\",\r\n className,\r\n )}\r\n {...rest}\r\n />\r\n}\r\n\r\ntype ComboboxLabelProps = ComboboxLabelPrimitiveProps\r\n\r\nfunction ComboboxLabel(props: ComboboxLabelProps) {\r\n const { className, ...rest } = props\r\n\r\n return <ComboboxLabelPrimitive\r\n className={cn(\r\n \"text-label-semibold-2 text-text-secondary\",\r\n className,\r\n )}\r\n {...rest}\r\n />\r\n}\r\n\r\ntype ComboboxInputGroupProps = ComboboxInputGroupPrimitiveProps\r\n\r\nfunction ComboboxInputGroup(props: ComboboxInputGroupProps) {\r\n const { className, ...rest } = props\r\n\r\n return <ComboboxInputGroupPrimitive\r\n className={cn(\r\n \"flex w-full items-center gap-2\",\r\n className,\r\n )}\r\n {...rest}\r\n />\r\n}\r\n\r\ntype ComboboxInputProps = Omit<ComboboxInputPrimitiveProps, \"size\"> & {\r\n wrapperClassName?: string\r\n size?: React.ComponentProps<typeof Input>[\"size\"]\r\n}\r\n\r\nfunction ComboboxInput({\r\n className,\r\n wrapperClassName,\r\n size = \"xs\",\r\n ...props\r\n}: ComboboxInputProps) {\r\n\r\n return (\r\n <div className={cn(\"p-3 border-b border-border-primary\", wrapperClassName)}>\r\n <ComboboxInputPrimitive\r\n className={className}\r\n render={<Input size={size} startContent={<SearchIcon />} />}\r\n {...props}\r\n />\r\n </div>\r\n )\r\n}\r\n\r\nfunction ComboboxInputFilter({\r\n className,\r\n displayValueKey = { label: \"label\", value: \"value\" },\r\n placeholder = \"Search and Select Company\",\r\n inputProps,\r\n size,\r\n ...props\r\n}: ComboboxInputProps & {\r\n displayValueKey?: {\r\n label: string\r\n value: string\r\n }\r\n placeholder?: string\r\n inputProps?: React.ComponentProps<typeof Input>\r\n}) {\r\n const { inputValue, setInputValue } = useCombobox()\r\n const { className: inputClassName, startContent, ...restInputProps } = inputProps || {}\r\n\r\n return (\r\n <div className={cn(\"flex flex-col gap-2\", className)}>\r\n <ComboboxChips\r\n onMouseDown={(e) => e.preventBaseUIHandler()}\r\n className=\"flex-col\"\r\n >\r\n <ComboboxInputPrimitive\r\n render={\r\n <Input\r\n className={cn(\"h-9 text-body-regular-3 pl-9 pr-7\", inputClassName)}\r\n endContent={\r\n <ComboboxTrigger\r\n nativeButton={false}\r\n render={(\r\n <XIcon\r\n className=\"!size-5 !right-1.5 data-[hidden=true]:opacity-0 opacity-100 transition-opacity duration-300 cursor-pointer\"\r\n data-hidden={!inputValue}\r\n data-slot=\"combobox-clear-input\"\r\n onClick={(event) => {\r\n setInputValue(\"\", {\r\n reason: \"none\",\r\n event: event.nativeEvent,\r\n cancel: () => { },\r\n allowPropagation: () => { },\r\n isCanceled: false,\r\n isPropagationAllowed: true,\r\n trigger: undefined,\r\n })\r\n }}\r\n />\r\n )}\r\n />\r\n }\r\n placeholder={placeholder}\r\n startContent={startContent ?? <SearchIcon className=\"!size-4 !text-fg-tertiary-hover\" />}\r\n {...restInputProps}\r\n />\r\n }\r\n {...props}\r\n />\r\n <ComboboxValue>\r\n {/* eslint-disable-next-line @typescript-eslint/no-explicit-any */}\r\n {(value) => value?.map((item: any) => (\r\n <ComboboxChip key={item?.[displayValueKey.value] || \"\"}>\r\n {item?.[displayValueKey.label] || \"\"}\r\n <ComboboxChipRemove />\r\n </ComboboxChip>\r\n ))}\r\n </ComboboxValue>\r\n </ComboboxChips>\r\n </div>\r\n )\r\n}\r\n\r\ntype ComboboxIconProps = ComboboxIconPrimitiveProps\r\n\r\nfunction ComboboxIcon(props: ComboboxIconProps) {\r\n const { className, ...rest } = props\r\n\r\n return <ComboboxIconPrimitive\r\n className={cn(\"text-text-secondary\", className)}\r\n {...rest}\r\n />\r\n}\r\n\r\ntype ComboboxClearProps = ComboboxClearPrimitiveProps\r\n\r\nfunction ComboboxClear(props: ComboboxClearProps) {\r\n\r\n return (\r\n <ComboboxClearPrimitive\r\n render={<XIcon />}\r\n {...props}\r\n />\r\n )\r\n}\r\n\r\ntype ComboboxValueProps = ComboboxValuePrimitiveProps\r\n\r\nfunction ComboboxValue(props: ComboboxValueProps) {\r\n return <ComboboxValuePrimitive {...props} />\r\n}\r\n\r\ntype ComboboxChipsProps = ComboboxChipsPrimitiveProps\r\n\r\nfunction ComboboxChips({\r\n className,\r\n ...props\r\n}: ComboboxChipsProps) {\r\n return <ComboboxChipsPrimitive\r\n className={cn(\"flex flex-wrap gap-2\", className)}\r\n {...props}\r\n />\r\n}\r\n\r\ntype ComboboxChipProps = ComboboxChipPrimitiveProps\r\n\r\nfunction ComboboxChip({\r\n className,\r\n ...props\r\n}: ComboboxChipProps) {\r\n return (\r\n <Badge\r\n className={cn(\"ring-1 ring-border-brand text-body-medium-3\", className)}\r\n color=\"brand\"\r\n render={(\r\n <ComboboxChipPrimitive\r\n {...props}\r\n />\r\n )}\r\n size=\"lg\"\r\n />\r\n )\r\n}\r\n\r\ntype ComboboxChipRemoveProps = ComboboxChipRemovePrimitiveProps\r\n\r\nfunction ComboboxChipRemove({\r\n className,\r\n ...props\r\n}: ComboboxChipRemoveProps) {\r\n return (\r\n <BadgeButton\r\n className={cn(\"text-fg-quaternary\", className)}\r\n render={(\r\n <ComboboxChipRemovePrimitive\r\n {...props}\r\n />\r\n )}\r\n />\r\n )\r\n}\r\n\r\ntype ComboboxPopupProps = ComboboxPositionerPrimitiveProps &\r\n ComboboxPopupPrimitiveProps & {\r\n container?: React.ComponentProps<typeof ComboboxPortal>[\"container\"]\r\n }\r\n\r\nfunction ComboboxPopup({\r\n className,\r\n align = \"start\",\r\n sideOffset = 4,\r\n container,\r\n initialFocus,\r\n finalFocus,\r\n style,\r\n children,\r\n ...props\r\n}: ComboboxPopupProps) {\r\n return (\r\n <ComboboxPortalPrimitive container={container}>\r\n <ComboboxPositionerPrimitive\r\n align={align}\r\n className=\"isolate z-50\"\r\n sideOffset={sideOffset}\r\n {...props}\r\n >\r\n <ComboboxPopupPrimitive\r\n className={cn(\r\n \"group/combobox-popup bg-bg-primary text-text-primary max-h-(--available-height) w-72 max-w-(--available-width) origin-(--transform-origin) rounded-md border border-border-primary shadow-md outline-hidden\",\r\n className,\r\n )}\r\n finalFocus={finalFocus}\r\n initialFocus={initialFocus}\r\n style={style}\r\n >\r\n <ComboboxHighlight>\r\n {children}\r\n </ComboboxHighlight>\r\n </ComboboxPopupPrimitive>\r\n </ComboboxPositionerPrimitive>\r\n </ComboboxPortalPrimitive>\r\n )\r\n}\r\n\r\ntype ComboboxPortalProps = ComboboxPortalPrimitiveProps\r\n\r\nfunction ComboboxPortal(props: ComboboxPortalProps) {\r\n return <ComboboxPortalPrimitive {...props} />\r\n}\r\n\r\ntype ComboboxPositionerProps = ComboboxPositionerPrimitiveProps\r\n\r\nfunction ComboboxPositioner(props: ComboboxPositionerProps) {\r\n return <ComboboxPositionerPrimitive {...props} />\r\n}\r\n\r\ntype ComboboxBackdropProps = ComboboxBackdropPrimitiveProps\r\n\r\nfunction ComboboxBackdrop(props: ComboboxBackdropProps) {\r\n const { className, ...rest } = props\r\n\r\n return <ComboboxBackdropPrimitive\r\n className={cn(\"bg-black/30\", className)}\r\n {...rest}\r\n />\r\n}\r\n\r\ntype ComboboxStatusProps = ComboboxStatusPrimitiveProps\r\n\r\nfunction ComboboxStatus({\r\n className,\r\n status,\r\n ...props\r\n}: Omit<ComboboxStatusProps, \"children\"> & {\r\n status?: \"empty\" | \"pending\" | null\r\n}) {\r\n const { inputValue } = useCombobox()\r\n\r\n const trimmedInputValue = inputValue?.toString().trim()\r\n\r\n const getText = () => {\r\n if (status === \"empty\" && trimmedInputValue)\r\n return `No matches for \"${trimmedInputValue}\".`\r\n\r\n if (status === \"empty\" && !trimmedInputValue)\r\n return \"No results.\"\r\n\r\n if (status === \"pending\")\r\n return (\r\n <>\r\n <Loader2Icon className=\"animate-spin size-4\" />\r\n <span>\r\n Searching...\r\n </span>\r\n </>\r\n )\r\n\r\n return null\r\n }\r\n\r\n const text = getText()\r\n\r\n return (\r\n <ComboboxStatusPrimitive\r\n className={cn(\r\n \"px-2 py-2.5 text-body-regular-2 text-text-disabled flex items-center gap-2\",\r\n !text && \"hidden\",\r\n className\r\n )}\r\n {...props}\r\n >\r\n {text}\r\n </ComboboxStatusPrimitive>\r\n )\r\n}\r\n\r\ntype ComboboxLoadingProps = React.ComponentProps<\"div\">\r\n\r\ntype ComboboxEmptyProps = ComboboxEmptyPrimitiveProps\r\n\r\nfunction ComboboxEmpty({ className, ...props }: ComboboxEmptyProps) {\r\n return <ComboboxEmptyPrimitive\r\n className={cn(\"px-3 py-2 text-body-regular-2 text-text-secondary\", className)}\r\n {...props}\r\n />\r\n}\r\n\r\ntype ComboboxListProps = Omit<ComboboxListPrimitiveProps, \"children\"> & {\r\n children: React.ReactNode | ((item: any, index: number, itemsLength: number) => React.ReactNode)\r\n}\r\n\r\nfunction ComboboxList({\r\n className,\r\n children,\r\n ...props\r\n}: ComboboxListProps) {\r\n const items = useFilteredItems()\r\n\r\n return (\r\n <ScrollArea\r\n size=\"sm\"\r\n viewportRender={(\r\n <ComboboxListPrimitive\r\n className={cn(\"max-h-[min(calc(--spacing(72)---spacing(9)),calc(var(--available-height)---spacing(9)))] flex flex-col p-1 focus-visible:outline-none data-[empty]:hidden\", className)}\r\n {...props}\r\n >\r\n {\r\n typeof children === \"function\"\r\n ? (item, index) => (\r\n children(item, index, items.length)\r\n )\r\n : children\r\n }\r\n </ComboboxListPrimitive>\r\n )}\r\n />\r\n )\r\n}\r\n\r\ntype ComboboxHighlightProps = ComboboxHighlightPrimitiveProps\r\n\r\nfunction ComboboxHighlight(props: ComboboxHighlightProps) {\r\n const { className, ...rest } = props\r\n\r\n return (\r\n <ComboboxHighlightPrimitive\r\n className={cn(\"absolute inset-0 bg-bg-primary-hover\", className)}\r\n {...rest}\r\n />\r\n )\r\n}\r\n\r\ntype ComboboxHighlightItemProps = ComboboxHighlightItemPrimitiveProps\r\n\r\nfunction ComboboxHighlightItem(props: ComboboxHighlightItemProps) {\r\n return <ComboboxHighlightItemPrimitive {...props} />\r\n}\r\n\r\ntype ComboboxRowProps = ComboboxRowPrimitiveProps\r\n\r\nfunction ComboboxRow(props: ComboboxRowProps) {\r\n const { className, ...rest } = props\r\n\r\n return <ComboboxRowPrimitive\r\n className={cn(\"group/combobox-row\", className)}\r\n {...rest}\r\n />\r\n}\r\n\r\ntype ComboboxItemProps = ComboboxItemPrimitiveProps & {\r\n indicator?: \"check-circle\" | \"checkbox\"\r\n}\r\n\r\nfunction ComboboxItem({\r\n className,\r\n children,\r\n indicator = \"check-circle\",\r\n ...props\r\n}: ComboboxItemProps) {\r\n const { disabled } = props\r\n\r\n return (\r\n <ComboboxHighlightItem\r\n activeClassName=\"bg-bg-primary-hover rounded-md\"\r\n disabled={disabled}\r\n >\r\n <ComboboxItemPrimitive\r\n data-indicator={indicator}\r\n className={cn(\r\n \"group/combobox-item relative grid grid-cols-[auto_1fr] items-center gap-x-2 my-px p-xp-md cursor-default outline-none select-none [[data-indicator=check-circle][data-selected]]:pr-8 data-[indicator=checkbox]:pl-8\",\r\n className,\r\n )}\r\n {...props}\r\n >\r\n {children}\r\n <ComboboxItemIndicator\r\n className=\"absolute group-data-[indicator=check-circle]/combobox-item:right-2 group-data-[indicator=checkbox]/combobox-item:left-2\"\r\n keepMounted={indicator === \"checkbox\"}\r\n render={(props, state) => (\r\n <span {...props}>\r\n {indicator === \"check-circle\" && (\r\n <CheckCircle2Icon className=\"size-4 text-fg-brand-primary shrink-0\" />\r\n )}\r\n\r\n {indicator === \"checkbox\" && (\r\n <Checkbox checked={state.selected} />\r\n )}\r\n </span>\r\n )}\r\n />\r\n </ComboboxItemPrimitive>\r\n </ComboboxHighlightItem>\r\n )\r\n}\r\n\r\ntype ComboboxItemTitleProps = React.ComponentProps<\"span\">\r\n\r\nfunction ComboboxItemTitle({\r\n className,\r\n ...props\r\n}: ComboboxItemTitleProps) {\r\n return (\r\n <span\r\n data-slot=\"combobox-item-title\"\r\n className={cn(\r\n \"col-start-2 text-body-medium-3 text-text-primary truncate row-span-2 group-has-[[data-slot=combobox-item-description]]/combobox-item:row-span-1\",\r\n className\r\n )}\r\n {...props}\r\n />\r\n )\r\n}\r\n\r\ntype ComboboxItemDescriptionProps = React.ComponentProps<\"span\">\r\n\r\nfunction ComboboxItemDescription({\r\n className,\r\n ...props\r\n}: ComboboxItemDescriptionProps) {\r\n return (\r\n <span\r\n data-slot=\"combobox-item-description\"\r\n className={cn(\r\n \"col-start-2 text-body-regular-3 text-text-secondary truncate\",\r\n className\r\n )}\r\n {...props}\r\n />\r\n )\r\n}\r\n\r\nfunction ComboboxItemIcon({ className, ...props }: React.ComponentProps<\"div\">) {\r\n return (\r\n <div\r\n data-slot=\"combobox-item-icon\"\r\n className={cn(\r\n \"row-span-2 col-start-1 flex items-center justify-center size-6 rounded-md bg-bg-brand-solid text-fg-white shrink-0 [&_svg]:size-3.5\",\r\n className\r\n )}\r\n {...props}\r\n />\r\n )\r\n}\r\n\r\ntype ComboboxItemAvatarProps = React.ComponentProps<typeof Avatar> & {\r\n src?: string\r\n imageSrc?: string\r\n imageAlt?: string\r\n avatarClassName?: string\r\n fallbackText?: string\r\n}\r\n\r\nfunction ComboboxItemAvatar({\r\n src,\r\n imageSrc,\r\n className,\r\n avatarClassName,\r\n imageAlt,\r\n fallbackText,\r\n children,\r\n ...props\r\n}: ComboboxItemAvatarProps) {\r\n const finalSrc = src ?? imageSrc\r\n\r\n return (\r\n <div\r\n data-slot=\"combobox-item-avatar\"\r\n className={cn(\r\n \"row-span-2 col-start-1 size-6 rounded-full overflow-hidden shrink-0\",\r\n className\r\n )}\r\n >\r\n <Avatar\r\n className={cn(\"size-full shrink-0\", avatarClassName)}\r\n {...props}\r\n >\r\n <AvatarImage alt={imageAlt} src={finalSrc} />\r\n <AvatarFallback className=\"flex aspect-square size-full items-center justify-center bg-bg-tertiary text-label-semibold-2 text-text-quaternary\">\r\n {fallbackText ?? children}\r\n </AvatarFallback>\r\n </Avatar>\r\n </div>\r\n )\r\n}\r\n\r\ntype ComboboxItemIndicatorProps = ComboboxItemIndicatorPrimitiveProps\r\n\r\nfunction ComboboxItemIndicator(props: ComboboxItemIndicatorProps) {\r\n return (\r\n <ComboboxItemIndicatorPrimitive {...props} />\r\n )\r\n}\r\n\r\ntype ComboboxSeparatorProps = ComboboxSeparatorPrimitiveProps\r\n\r\nfunction ComboboxSeparator(props: ComboboxSeparatorProps) {\r\n const { className, ...rest } = props\r\n\r\n return <ComboboxSeparatorPrimitive\r\n className={cn(\"my-1 h-px bg-border-primary\", className)}\r\n {...rest}\r\n />\r\n}\r\n\r\ntype ComboboxGroupProps = ComboboxGroupPrimitiveProps\r\n\r\nfunction ComboboxGroup(props: ComboboxGroupProps) {\r\n const { className, ...rest } = props\r\n\r\n return <ComboboxGroupPrimitive\r\n className={cn(\"py-1\", className)}\r\n {...rest}\r\n />\r\n}\r\n\r\ntype ComboboxGroupLabelProps = ComboboxGroupLabelPrimitiveProps\r\n\r\nfunction ComboboxGroupLabel(props: ComboboxGroupLabelProps) {\r\n const { className, ...rest } = props\r\n\r\n return <ComboboxGroupLabelPrimitive\r\n className={cn(\"px-3 py-1 text-body-semibold-sm text-text-secondary\", className)}\r\n {...rest}\r\n />\r\n}\r\n\r\ntype ComboboxCollectionProps = ComboboxCollectionPrimitiveProps\r\n\r\nfunction ComboboxCollection(props: ComboboxCollectionProps) {\r\n return <ComboboxCollectionPrimitive {...props} />\r\n}\r\n\r\ntype ComboboxArrowProps = ComboboxArrowPrimitiveProps\r\n\r\nfunction ComboboxArrow(props: ComboboxArrowProps) {\r\n const { className, ...rest } = props\r\n\r\n return <ComboboxArrowPrimitive\r\n className={cn(\"fill-bg-primary\", className)}\r\n {...rest}\r\n />\r\n}\r\n\r\nfunction ComboboxInfiniteScroll({\r\n hasMore,\r\n threshold = 0.5,\r\n ...props\r\n}: Omit<React.ComponentProps<typeof InfiniteScroll>, \"children\">) {\r\n return (\r\n <InfiniteScroll\r\n hasMore={hasMore}\r\n threshold={threshold}\r\n {...props}\r\n >\r\n {hasMore && (\r\n <div className=\"px-2 py-2.5 text-body-regular-2 text-text-disabled flex items-center gap-2\">\r\n <Loader2Icon className=\"animate-spin size-4\" />\r\n <span>\r\n Loading more...\r\n </span>\r\n </div>\r\n )}\r\n </InfiniteScroll>\r\n )\r\n}\r\n\r\nexport {\r\n Combobox,\r\n ComboboxArrow,\r\n type ComboboxArrowProps,\r\n ComboboxBackdrop,\r\n type ComboboxBackdropProps,\r\n ComboboxChip,\r\n type ComboboxChipProps,\r\n ComboboxChipRemove,\r\n type ComboboxChipRemoveProps,\r\n ComboboxChips,\r\n type ComboboxChipsProps,\r\n ComboboxClear,\r\n type ComboboxClearProps,\r\n ComboboxCollection,\r\n type ComboboxCollectionProps,\r\n ComboboxPopup,\r\n type ComboboxPopupProps,\r\n ComboboxEmpty,\r\n type ComboboxEmptyProps,\r\n ComboboxGroup,\r\n ComboboxGroupLabel,\r\n type ComboboxGroupLabelProps,\r\n type ComboboxGroupProps,\r\n ComboboxHighlight,\r\n ComboboxHighlightItem,\r\n type ComboboxHighlightItemProps,\r\n type ComboboxHighlightProps,\r\n ComboboxIcon,\r\n type ComboboxIconProps,\r\n ComboboxInfiniteScroll,\r\n ComboboxInput,\r\n ComboboxInputFilter,\r\n ComboboxInputGroup,\r\n type ComboboxInputGroupProps,\r\n type ComboboxInputProps,\r\n ComboboxItem,\r\n ComboboxItemTitle,\r\n type ComboboxItemTitleProps,\r\n ComboboxItemDescription,\r\n type ComboboxItemDescriptionProps,\r\n ComboboxItemIcon,\r\n ComboboxItemAvatar,\r\n type ComboboxItemAvatarProps,\r\n ComboboxItemIndicator,\r\n type ComboboxItemIndicatorProps,\r\n type ComboboxItemProps,\r\n ComboboxLabel,\r\n type ComboboxLabelProps,\r\n ComboboxList,\r\n type ComboboxListProps,\r\n type ComboboxLoadingProps,\r\n ComboboxPortal,\r\n type ComboboxPortalProps,\r\n ComboboxPositioner,\r\n type ComboboxPositionerProps,\r\n type ComboboxProps,\r\n ComboboxRow,\r\n type ComboboxRowProps,\r\n ComboboxSeparator,\r\n type ComboboxSeparatorProps,\r\n ComboboxStatus,\r\n type ComboboxStatusProps,\r\n ComboboxTrigger,\r\n type ComboboxTriggerProps,\r\n ComboboxValue,\r\n type ComboboxValueProps\r\n}"]}
|
|
1
|
+
{"version":3,"sources":["../src/ui/combobox.tsx"],"names":["Combobox","props","jsx","ComboboxTrigger","className","rest","cn","ComboboxLabel","ComboboxInputGroup","ComboboxInput","wrapperClassName","size","Input","SearchIcon","ComboboxInputFilter","displayValueKey","placeholder","inputProps","inputValue","setInputValue","useCombobox","inputClassName","startContent","restInputProps","jsxs","ComboboxChips","e","XIcon","event","ComboboxValue","value","item","ComboboxChip","ComboboxChipRemove","ComboboxIcon","ComboboxClear","Badge","BadgeButton","ComboboxPopup","align","sideOffset","container","initialFocus","finalFocus","style","children","ComboboxPortal","ComboboxPositioner","ComboboxHighlight","ComboboxBackdrop","ComboboxStatus","status","trimmedInputValue","text","Fragment","Loader2Icon","ComboboxEmpty","ComboboxList","items","useFilteredItems","ScrollArea","index","ComboboxHighlightItem","ComboboxRow","ComboboxItem","indicator","disabled","ComboboxItemIndicator","state","CheckCircle2Icon","Checkbox","ComboboxItemTitle","ComboboxItemDescription","ComboboxItemIcon","ComboboxItemAvatar","src","imageSrc","avatarClassName","imageAlt","fallbackText","finalSrc","Avatar","AvatarImage","AvatarFallback","ComboboxSeparator","ComboboxGroup","ComboboxGroupLabel","ComboboxCollection","ComboboxArrow","ComboboxInfiniteScroll","hasMore","threshold","InfiniteScroll"],"mappings":"8hBAgFA,SAASA,EAAAA,CAA8DC,CAAAA,CAAuC,CAC5G,OACEC,GAAAA,CAACF,CAAAA,CAAA,CAAmB,GAAGC,CAAAA,CAAO,CAElC,CAIA,SAASE,EAAAA,CAAgBF,CAAAA,CAA6B,CACpD,GAAM,CAAE,SAAA,CAAAG,CAAAA,CAAW,GAAGC,CAAK,CAAA,CAAIJ,CAAAA,CAE/B,OAAOC,GAAAA,CAACC,EAAA,CACN,SAAA,CAAWG,EAAAA,CACT,gDAAA,CACAF,CACF,CAAA,CACC,GAAGC,CAAAA,CACN,CACF,CAIA,SAASE,EAAAA,CAAcN,CAAAA,CAA2B,CAChD,GAAM,CAAE,SAAA,CAAAG,C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ACL,CAAA,CAAkE,CAChE,OACEC,GAAAA,CAAC0F,GAAAA,CAAA,CACC,OAAA,CAASF,CAAAA,CACT,SAAA,CAAWC,CAAAA,CACV,GAAG1F,CAAAA,CAEH,QAAA,CAAAyF,CAAAA,EACClE,IAAAA,CAAC,KAAA,CAAA,CAAI,SAAA,CAAU,4EAAA,CACb,QAAA,CAAA,CAAAtB,IAACqD,WAAAA,CAAA,CAAY,SAAA,CAAU,qBAAA,CAAsB,EAC7CrD,GAAAA,CAAC,MAAA,CAAA,CAAK,QAAA,CAAA,iBAAA,CAEN,CAAA,CAAA,CACF,EAEJ,CAEJ","file":"chunk-ILE3MBTR.js","sourcesContent":["import * as React from \"react\"\r\n\r\nimport {\r\n CheckCircle2Icon,\r\n Loader2Icon,\r\n SearchIcon,\r\n XIcon\r\n} from \"lucide-react\"\r\n\r\nimport {\r\n Combobox as ComboboxPrimitive,\r\n ComboboxArrow as ComboboxArrowPrimitive,\r\n type ComboboxArrowProps as ComboboxArrowPrimitiveProps,\r\n ComboboxBackdrop as ComboboxBackdropPrimitive,\r\n type ComboboxBackdropProps as ComboboxBackdropPrimitiveProps,\r\n ComboboxChip as ComboboxChipPrimitive,\r\n type ComboboxChipProps as ComboboxChipPrimitiveProps,\r\n ComboboxChipRemove as ComboboxChipRemovePrimitive,\r\n type ComboboxChipRemoveProps as ComboboxChipRemovePrimitiveProps,\r\n ComboboxChips as ComboboxChipsPrimitive,\r\n type ComboboxChipsProps as ComboboxChipsPrimitiveProps,\r\n ComboboxClear as ComboboxClearPrimitive,\r\n type ComboboxClearProps as ComboboxClearPrimitiveProps,\r\n ComboboxCollection as ComboboxCollectionPrimitive,\r\n type ComboboxCollectionProps as ComboboxCollectionPrimitiveProps,\r\n ComboboxEmpty as ComboboxEmptyPrimitive,\r\n type ComboboxEmptyProps as ComboboxEmptyPrimitiveProps,\r\n ComboboxGroup as ComboboxGroupPrimitive,\r\n ComboboxGroupLabel as ComboboxGroupLabelPrimitive,\r\n type ComboboxGroupLabelProps as ComboboxGroupLabelPrimitiveProps,\r\n type ComboboxGroupProps as ComboboxGroupPrimitiveProps,\r\n ComboboxHighlight as ComboboxHighlightPrimitive,\r\n ComboboxHighlightItem as ComboboxHighlightItemPrimitive,\r\n type ComboboxHighlightItemProps as ComboboxHighlightItemPrimitiveProps,\r\n type ComboboxHighlightProps as ComboboxHighlightPrimitiveProps,\r\n ComboboxIcon as ComboboxIconPrimitive,\r\n type ComboboxIconProps as ComboboxIconPrimitiveProps,\r\n ComboboxInput as ComboboxInputPrimitive,\r\n ComboboxInputGroup as ComboboxInputGroupPrimitive,\r\n type ComboboxInputGroupProps as ComboboxInputGroupPrimitiveProps,\r\n type ComboboxInputProps as ComboboxInputPrimitiveProps,\r\n ComboboxItem as ComboboxItemPrimitive,\r\n ComboboxItemIndicator as ComboboxItemIndicatorPrimitive,\r\n type ComboboxItemIndicatorProps as ComboboxItemIndicatorPrimitiveProps,\r\n type ComboboxItemProps as ComboboxItemPrimitiveProps,\r\n ComboboxLabel as ComboboxLabelPrimitive,\r\n type ComboboxLabelProps as ComboboxLabelPrimitiveProps,\r\n ComboboxList as ComboboxListPrimitive,\r\n type ComboboxListProps as ComboboxListPrimitiveProps,\r\n ComboboxPopup as ComboboxPopupPrimitive,\r\n type ComboboxPopupProps as ComboboxPopupPrimitiveProps,\r\n ComboboxPortal as ComboboxPortalPrimitive,\r\n type ComboboxPortalProps as ComboboxPortalPrimitiveProps,\r\n ComboboxPositioner as ComboboxPositionerPrimitive,\r\n type ComboboxPositionerProps as ComboboxPositionerPrimitiveProps,\r\n type ComboboxProps as ComboboxPrimitiveProps,\r\n ComboboxRow as ComboboxRowPrimitive,\r\n type ComboboxRowProps as ComboboxRowPrimitiveProps,\r\n ComboboxSeparator as ComboboxSeparatorPrimitive,\r\n type ComboboxSeparatorProps as ComboboxSeparatorPrimitiveProps,\r\n ComboboxStatus as ComboboxStatusPrimitive,\r\n type ComboboxStatusProps as ComboboxStatusPrimitiveProps,\r\n ComboboxTrigger as ComboboxTriggerPrimitive,\r\n type ComboboxTriggerProps as ComboboxTriggerPrimitiveProps,\r\n ComboboxValue as ComboboxValuePrimitive,\r\n type ComboboxValueProps as ComboboxValuePrimitiveProps,\r\n useCombobox,\r\n useFilteredItems,\r\n} from \"../primitives/combobox\"\r\nimport { cn } from \"@xploreu/lib/cn\"\r\n\r\nimport { ScrollArea } from \"./scroll-area\"\r\nimport { Badge, BadgeButton } from \"./badge\"\r\nimport { InfiniteScroll } from \"./infinite-scroll\"\r\nimport { Input } from \"./input\"\r\nimport { Checkbox } from \"./checkbox\"\r\nimport { Avatar, AvatarFallback, AvatarImage } from \"./avatar\"\r\n\r\ntype ComboboxProps<Value, Multiple extends boolean | undefined = false> = ComboboxPrimitiveProps<Value, Multiple>\r\n\r\nfunction Combobox<Value, Multiple extends boolean | undefined = false>(props: ComboboxProps<Value, Multiple>) {\r\n return (\r\n <ComboboxPrimitive {...props} />\r\n )\r\n}\r\n\r\ntype ComboboxTriggerProps = ComboboxTriggerPrimitiveProps\r\n\r\nfunction ComboboxTrigger(props: ComboboxTriggerProps) {\r\n const { className, ...rest } = props\r\n\r\n return <ComboboxTriggerPrimitive\r\n className={cn(\r\n \"group/combobox-trigger flex items-center gap-2\",\r\n className,\r\n )}\r\n {...rest}\r\n />\r\n}\r\n\r\ntype ComboboxLabelProps = ComboboxLabelPrimitiveProps\r\n\r\nfunction ComboboxLabel(props: ComboboxLabelProps) {\r\n const { className, ...rest } = props\r\n\r\n return <ComboboxLabelPrimitive\r\n className={cn(\r\n \"text-label-semibold-2 text-text-secondary\",\r\n className,\r\n )}\r\n {...rest}\r\n />\r\n}\r\n\r\ntype ComboboxInputGroupProps = ComboboxInputGroupPrimitiveProps\r\n\r\nfunction ComboboxInputGroup(props: ComboboxInputGroupProps) {\r\n const { className, ...rest } = props\r\n\r\n return <ComboboxInputGroupPrimitive\r\n className={cn(\r\n \"flex w-full items-center gap-2\",\r\n className,\r\n )}\r\n {...rest}\r\n />\r\n}\r\n\r\ntype ComboboxInputProps = Omit<ComboboxInputPrimitiveProps, \"size\"> & {\r\n wrapperClassName?: string\r\n size?: React.ComponentProps<typeof Input>[\"size\"]\r\n}\r\n\r\nfunction ComboboxInput({\r\n className,\r\n wrapperClassName,\r\n size = \"xs\",\r\n ...props\r\n}: ComboboxInputProps) {\r\n\r\n return (\r\n <div className={cn(\"p-3 border-b border-border-primary\", wrapperClassName)}>\r\n <ComboboxInputPrimitive\r\n className={className}\r\n render={<Input size={size} startContent={<SearchIcon />} />}\r\n {...props}\r\n />\r\n </div>\r\n )\r\n}\r\n\r\nfunction ComboboxInputFilter({\r\n className,\r\n displayValueKey = { label: \"label\", value: \"value\" },\r\n placeholder = \"Search and Select Company\",\r\n inputProps,\r\n size,\r\n ...props\r\n}: ComboboxInputProps & {\r\n displayValueKey?: {\r\n label: string\r\n value: string\r\n }\r\n placeholder?: string\r\n inputProps?: React.ComponentProps<typeof Input>\r\n}) {\r\n const { inputValue, setInputValue } = useCombobox()\r\n const { className: inputClassName, startContent, ...restInputProps } = inputProps || {}\r\n\r\n return (\r\n <div className={cn(\"flex flex-col gap-2\", className)}>\r\n <ComboboxChips\r\n onMouseDown={(e) => e.preventBaseUIHandler()}\r\n className=\"flex-col\"\r\n >\r\n <ComboboxInputPrimitive\r\n render={\r\n <Input\r\n className={cn(\"h-9 text-body-regular-3 pl-9 pr-7\", inputClassName)}\r\n endContent={\r\n <ComboboxTrigger\r\n nativeButton={false}\r\n render={(\r\n <XIcon\r\n className=\"!size-5 !right-1.5 data-[hidden=true]:opacity-0 opacity-100 transition-opacity duration-300 cursor-pointer\"\r\n data-hidden={!inputValue}\r\n data-slot=\"combobox-clear-input\"\r\n onClick={(event) => {\r\n setInputValue(\"\", {\r\n reason: \"none\",\r\n event: event.nativeEvent,\r\n cancel: () => { },\r\n allowPropagation: () => { },\r\n isCanceled: false,\r\n isPropagationAllowed: true,\r\n trigger: undefined,\r\n })\r\n }}\r\n />\r\n )}\r\n />\r\n }\r\n placeholder={placeholder}\r\n startContent={startContent ?? <SearchIcon className=\"!size-4 !text-fg-tertiary-hover\" />}\r\n {...restInputProps}\r\n />\r\n }\r\n {...props}\r\n />\r\n <ComboboxValue>\r\n {/* eslint-disable-next-line @typescript-eslint/no-explicit-any */}\r\n {(value) => value?.map((item: any) => (\r\n <ComboboxChip key={item?.[displayValueKey.value] || \"\"}>\r\n {item?.[displayValueKey.label] || \"\"}\r\n <ComboboxChipRemove />\r\n </ComboboxChip>\r\n ))}\r\n </ComboboxValue>\r\n </ComboboxChips>\r\n </div>\r\n )\r\n}\r\n\r\ntype ComboboxIconProps = ComboboxIconPrimitiveProps\r\n\r\nfunction ComboboxIcon(props: ComboboxIconProps) {\r\n const { className, ...rest } = props\r\n\r\n return <ComboboxIconPrimitive\r\n className={cn(\"text-text-secondary\", className)}\r\n {...rest}\r\n />\r\n}\r\n\r\ntype ComboboxClearProps = ComboboxClearPrimitiveProps\r\n\r\nfunction ComboboxClear(props: ComboboxClearProps) {\r\n\r\n return (\r\n <ComboboxClearPrimitive\r\n render={<XIcon />}\r\n {...props}\r\n />\r\n )\r\n}\r\n\r\ntype ComboboxValueProps = ComboboxValuePrimitiveProps\r\n\r\nfunction ComboboxValue(props: ComboboxValueProps) {\r\n return <ComboboxValuePrimitive {...props} />\r\n}\r\n\r\ntype ComboboxChipsProps = ComboboxChipsPrimitiveProps\r\n\r\nfunction ComboboxChips({\r\n className,\r\n ...props\r\n}: ComboboxChipsProps) {\r\n return <ComboboxChipsPrimitive\r\n className={cn(\"flex flex-wrap gap-2\", className)}\r\n {...props}\r\n />\r\n}\r\n\r\ntype ComboboxChipProps = ComboboxChipPrimitiveProps\r\n\r\nfunction ComboboxChip({\r\n className,\r\n ...props\r\n}: ComboboxChipProps) {\r\n return (\r\n <Badge\r\n className={cn(\"ring-1 ring-border-brand text-body-medium-3\", className)}\r\n color=\"brand\"\r\n render={(\r\n <ComboboxChipPrimitive\r\n {...props}\r\n />\r\n )}\r\n size=\"lg\"\r\n />\r\n )\r\n}\r\n\r\ntype ComboboxChipRemoveProps = ComboboxChipRemovePrimitiveProps\r\n\r\nfunction ComboboxChipRemove({\r\n className,\r\n ...props\r\n}: ComboboxChipRemoveProps) {\r\n return (\r\n <BadgeButton\r\n className={cn(\"text-fg-quaternary\", className)}\r\n render={(\r\n <ComboboxChipRemovePrimitive\r\n {...props}\r\n />\r\n )}\r\n />\r\n )\r\n}\r\n\r\ntype ComboboxPopupProps = ComboboxPositionerPrimitiveProps &\r\n ComboboxPopupPrimitiveProps & {\r\n container?: React.ComponentProps<typeof ComboboxPortal>[\"container\"]\r\n }\r\n\r\nfunction ComboboxPopup({\r\n className,\r\n align = \"start\",\r\n sideOffset = 4,\r\n container,\r\n initialFocus,\r\n finalFocus,\r\n style,\r\n children,\r\n ...props\r\n}: ComboboxPopupProps) {\r\n return (\r\n <ComboboxPortalPrimitive container={container}>\r\n <ComboboxPositionerPrimitive\r\n align={align}\r\n className=\"isolate z-50\"\r\n sideOffset={sideOffset}\r\n {...props}\r\n >\r\n <ComboboxPopupPrimitive\r\n className={cn(\r\n \"group/combobox-popup bg-bg-primary text-text-primary max-h-(--available-height) w-72 max-w-(--available-width) origin-(--transform-origin) rounded-md border border-border-primary shadow-md outline-hidden\",\r\n className,\r\n )}\r\n finalFocus={finalFocus}\r\n initialFocus={initialFocus}\r\n style={style}\r\n >\r\n <ComboboxHighlight>\r\n {children}\r\n </ComboboxHighlight>\r\n </ComboboxPopupPrimitive>\r\n </ComboboxPositionerPrimitive>\r\n </ComboboxPortalPrimitive>\r\n )\r\n}\r\n\r\ntype ComboboxPortalProps = ComboboxPortalPrimitiveProps\r\n\r\nfunction ComboboxPortal(props: ComboboxPortalProps) {\r\n return <ComboboxPortalPrimitive {...props} />\r\n}\r\n\r\ntype ComboboxPositionerProps = ComboboxPositionerPrimitiveProps\r\n\r\nfunction ComboboxPositioner(props: ComboboxPositionerProps) {\r\n return <ComboboxPositionerPrimitive {...props} />\r\n}\r\n\r\ntype ComboboxBackdropProps = ComboboxBackdropPrimitiveProps\r\n\r\nfunction ComboboxBackdrop(props: ComboboxBackdropProps) {\r\n const { className, ...rest } = props\r\n\r\n return <ComboboxBackdropPrimitive\r\n className={cn(\"bg-black/30\", className)}\r\n {...rest}\r\n />\r\n}\r\n\r\ntype ComboboxStatusProps = ComboboxStatusPrimitiveProps\r\n\r\nfunction ComboboxStatus({\r\n className,\r\n status,\r\n ...props\r\n}: Omit<ComboboxStatusProps, \"children\"> & {\r\n status?: \"empty\" | \"pending\" | null\r\n}) {\r\n const { inputValue } = useCombobox()\r\n\r\n const trimmedInputValue = inputValue?.toString().trim()\r\n\r\n const getText = () => {\r\n if (status === \"empty\" && trimmedInputValue)\r\n return `No matches for \"${trimmedInputValue}\".`\r\n\r\n if (status === \"empty\" && !trimmedInputValue)\r\n return \"No results.\"\r\n\r\n if (status === \"pending\")\r\n return (\r\n <>\r\n <Loader2Icon className=\"animate-spin size-4\" />\r\n <span>\r\n Searching...\r\n </span>\r\n </>\r\n )\r\n\r\n return null\r\n }\r\n\r\n const text = getText()\r\n\r\n return (\r\n <ComboboxStatusPrimitive\r\n className={cn(\r\n \"px-2 py-2.5 text-body-regular-2 text-text-disabled flex items-center gap-2\",\r\n !text && \"hidden\",\r\n className\r\n )}\r\n {...props}\r\n >\r\n {text}\r\n </ComboboxStatusPrimitive>\r\n )\r\n}\r\n\r\ntype ComboboxLoadingProps = React.ComponentProps<\"div\">\r\n\r\ntype ComboboxEmptyProps = ComboboxEmptyPrimitiveProps\r\n\r\nfunction ComboboxEmpty({ className, ...props }: ComboboxEmptyProps) {\r\n return <ComboboxEmptyPrimitive\r\n className={cn(\"px-3 py-2 text-body-regular-2 text-text-secondary\", className)}\r\n {...props}\r\n />\r\n}\r\n\r\ntype ComboboxListProps = Omit<ComboboxListPrimitiveProps, \"children\"> & {\r\n children: React.ReactNode | ((item: any, index: number, itemsLength: number) => React.ReactNode)\r\n}\r\n\r\nfunction ComboboxList({\r\n className,\r\n children,\r\n ...props\r\n}: ComboboxListProps) {\r\n const items = useFilteredItems()\r\n\r\n return (\r\n <ScrollArea\r\n size=\"sm\"\r\n viewportRender={(\r\n <ComboboxListPrimitive\r\n className={cn(\"max-h-[min(calc(--spacing(72)---spacing(9)),calc(var(--available-height)---spacing(9)))] flex flex-col p-1 focus-visible:outline-none data-[empty]:hidden\", className)}\r\n {...props}\r\n >\r\n {\r\n typeof children === \"function\"\r\n ? (item, index) => (\r\n children(item, index, items.length)\r\n )\r\n : children\r\n }\r\n </ComboboxListPrimitive>\r\n )}\r\n />\r\n )\r\n}\r\n\r\ntype ComboboxHighlightProps = ComboboxHighlightPrimitiveProps\r\n\r\nfunction ComboboxHighlight(props: ComboboxHighlightProps) {\r\n const { className, ...rest } = props\r\n\r\n return (\r\n <ComboboxHighlightPrimitive\r\n className={cn(\"absolute inset-0 bg-bg-primary-hover\", className)}\r\n {...rest}\r\n />\r\n )\r\n}\r\n\r\ntype ComboboxHighlightItemProps = ComboboxHighlightItemPrimitiveProps\r\n\r\nfunction ComboboxHighlightItem(props: ComboboxHighlightItemProps) {\r\n return <ComboboxHighlightItemPrimitive {...props} />\r\n}\r\n\r\ntype ComboboxRowProps = ComboboxRowPrimitiveProps\r\n\r\nfunction ComboboxRow(props: ComboboxRowProps) {\r\n const { className, ...rest } = props\r\n\r\n return <ComboboxRowPrimitive\r\n className={cn(\"group/combobox-row\", className)}\r\n {...rest}\r\n />\r\n}\r\n\r\ntype ComboboxItemProps = ComboboxItemPrimitiveProps & {\r\n indicator?: \"check-circle\" | \"checkbox\"\r\n}\r\n\r\nfunction ComboboxItem({\r\n className,\r\n children,\r\n indicator = \"check-circle\",\r\n ...props\r\n}: ComboboxItemProps) {\r\n const { disabled } = props\r\n\r\n return (\r\n <ComboboxHighlightItem\r\n activeClassName=\"bg-bg-primary-hover rounded-md\"\r\n disabled={disabled}\r\n >\r\n <ComboboxItemPrimitive\r\n data-indicator={indicator}\r\n className={cn(\r\n \"group/combobox-item relative grid grid-cols-[auto_1fr] items-center gap-x-2 my-px p-xp-md cursor-default outline-none select-none [[data-indicator=check-circle][data-selected]]:pr-8 data-[indicator=checkbox]:pl-8\",\r\n className,\r\n )}\r\n {...props}\r\n >\r\n {children}\r\n <ComboboxItemIndicator\r\n className=\"absolute group-data-[indicator=check-circle]/combobox-item:right-2 group-data-[indicator=checkbox]/combobox-item:left-2\"\r\n keepMounted={indicator === \"checkbox\"}\r\n render={(props, state) => (\r\n <span {...props}>\r\n {indicator === \"check-circle\" && (\r\n <CheckCircle2Icon className=\"size-4 text-fg-brand-primary shrink-0\" />\r\n )}\r\n\r\n {indicator === \"checkbox\" && (\r\n <Checkbox checked={state.selected} />\r\n )}\r\n </span>\r\n )}\r\n />\r\n </ComboboxItemPrimitive>\r\n </ComboboxHighlightItem>\r\n )\r\n}\r\n\r\ntype ComboboxItemTitleProps = React.ComponentProps<\"span\">\r\n\r\nfunction ComboboxItemTitle({\r\n className,\r\n ...props\r\n}: ComboboxItemTitleProps) {\r\n return (\r\n <span\r\n data-slot=\"combobox-item-title\"\r\n className={cn(\r\n \"col-start-2 text-body-medium-3 text-text-primary truncate row-span-2 group-has-[[data-slot=combobox-item-description]]/combobox-item:row-span-1\",\r\n className\r\n )}\r\n {...props}\r\n />\r\n )\r\n}\r\n\r\ntype ComboboxItemDescriptionProps = React.ComponentProps<\"span\">\r\n\r\nfunction ComboboxItemDescription({\r\n className,\r\n ...props\r\n}: ComboboxItemDescriptionProps) {\r\n return (\r\n <span\r\n data-slot=\"combobox-item-description\"\r\n className={cn(\r\n \"col-start-2 text-body-regular-3 text-text-secondary truncate\",\r\n className\r\n )}\r\n {...props}\r\n />\r\n )\r\n}\r\n\r\nfunction ComboboxItemIcon({ className, ...props }: React.ComponentProps<\"div\">) {\r\n return (\r\n <div\r\n data-slot=\"combobox-item-icon\"\r\n className={cn(\r\n \"row-span-2 col-start-1 flex items-center justify-center size-6 rounded-md bg-bg-brand-solid text-fg-white shrink-0 [&_svg]:size-3.5\",\r\n className\r\n )}\r\n {...props}\r\n />\r\n )\r\n}\r\n\r\ntype ComboboxItemAvatarProps = React.ComponentProps<typeof Avatar> & {\r\n src?: string\r\n imageSrc?: string\r\n imageAlt?: string\r\n avatarClassName?: string\r\n fallbackText?: string\r\n}\r\n\r\nfunction ComboboxItemAvatar({\r\n src,\r\n imageSrc,\r\n className,\r\n avatarClassName,\r\n imageAlt,\r\n fallbackText,\r\n children,\r\n ...props\r\n}: ComboboxItemAvatarProps) {\r\n const finalSrc = src ?? imageSrc\r\n\r\n return (\r\n <div\r\n data-slot=\"combobox-item-avatar\"\r\n className={cn(\r\n \"row-span-2 col-start-1 size-6 rounded-full overflow-hidden shrink-0\",\r\n className\r\n )}\r\n >\r\n <Avatar\r\n className={cn(\"size-full shrink-0\", avatarClassName)}\r\n {...props}\r\n >\r\n <AvatarImage alt={imageAlt} src={finalSrc} />\r\n <AvatarFallback className=\"flex aspect-square size-full items-center justify-center bg-bg-tertiary text-label-semibold-2 text-text-quaternary\">\r\n {fallbackText ?? children}\r\n </AvatarFallback>\r\n </Avatar>\r\n </div>\r\n )\r\n}\r\n\r\ntype ComboboxItemIndicatorProps = ComboboxItemIndicatorPrimitiveProps\r\n\r\nfunction ComboboxItemIndicator(props: ComboboxItemIndicatorProps) {\r\n return (\r\n <ComboboxItemIndicatorPrimitive {...props} />\r\n )\r\n}\r\n\r\ntype ComboboxSeparatorProps = ComboboxSeparatorPrimitiveProps\r\n\r\nfunction ComboboxSeparator(props: ComboboxSeparatorProps) {\r\n const { className, ...rest } = props\r\n\r\n return <ComboboxSeparatorPrimitive\r\n className={cn(\"my-1 h-px bg-border-primary\", className)}\r\n {...rest}\r\n />\r\n}\r\n\r\ntype ComboboxGroupProps = ComboboxGroupPrimitiveProps\r\n\r\nfunction ComboboxGroup(props: ComboboxGroupProps) {\r\n const { className, ...rest } = props\r\n\r\n return <ComboboxGroupPrimitive\r\n className={cn(\"py-1\", className)}\r\n {...rest}\r\n />\r\n}\r\n\r\ntype ComboboxGroupLabelProps = ComboboxGroupLabelPrimitiveProps\r\n\r\nfunction ComboboxGroupLabel(props: ComboboxGroupLabelProps) {\r\n const { className, ...rest } = props\r\n\r\n return <ComboboxGroupLabelPrimitive\r\n className={cn(\"px-3 py-1 text-body-semibold-sm text-text-secondary\", className)}\r\n {...rest}\r\n />\r\n}\r\n\r\ntype ComboboxCollectionProps = ComboboxCollectionPrimitiveProps\r\n\r\nfunction ComboboxCollection(props: ComboboxCollectionProps) {\r\n return <ComboboxCollectionPrimitive {...props} />\r\n}\r\n\r\ntype ComboboxArrowProps = ComboboxArrowPrimitiveProps\r\n\r\nfunction ComboboxArrow(props: ComboboxArrowProps) {\r\n const { className, ...rest } = props\r\n\r\n return <ComboboxArrowPrimitive\r\n className={cn(\"fill-bg-primary\", className)}\r\n {...rest}\r\n />\r\n}\r\n\r\nfunction ComboboxInfiniteScroll({\r\n hasMore,\r\n threshold = 0.5,\r\n ...props\r\n}: Omit<React.ComponentProps<typeof InfiniteScroll>, \"children\">) {\r\n return (\r\n <InfiniteScroll\r\n hasMore={hasMore}\r\n threshold={threshold}\r\n {...props}\r\n >\r\n {hasMore && (\r\n <div className=\"px-2 py-2.5 text-body-regular-2 text-text-disabled flex items-center gap-2\">\r\n <Loader2Icon className=\"animate-spin size-4\" />\r\n <span>\r\n Loading more...\r\n </span>\r\n </div>\r\n )}\r\n </InfiniteScroll>\r\n )\r\n}\r\n\r\nexport {\r\n Combobox,\r\n ComboboxArrow,\r\n type ComboboxArrowProps,\r\n ComboboxBackdrop,\r\n type ComboboxBackdropProps,\r\n ComboboxChip,\r\n type ComboboxChipProps,\r\n ComboboxChipRemove,\r\n type ComboboxChipRemoveProps,\r\n ComboboxChips,\r\n type ComboboxChipsProps,\r\n ComboboxClear,\r\n type ComboboxClearProps,\r\n ComboboxCollection,\r\n type ComboboxCollectionProps,\r\n ComboboxPopup,\r\n type ComboboxPopupProps,\r\n ComboboxEmpty,\r\n type ComboboxEmptyProps,\r\n ComboboxGroup,\r\n ComboboxGroupLabel,\r\n type ComboboxGroupLabelProps,\r\n type ComboboxGroupProps,\r\n ComboboxHighlight,\r\n ComboboxHighlightItem,\r\n type ComboboxHighlightItemProps,\r\n type ComboboxHighlightProps,\r\n ComboboxIcon,\r\n type ComboboxIconProps,\r\n ComboboxInfiniteScroll,\r\n ComboboxInput,\r\n ComboboxInputFilter,\r\n ComboboxInputGroup,\r\n type ComboboxInputGroupProps,\r\n type ComboboxInputProps,\r\n ComboboxItem,\r\n ComboboxItemTitle,\r\n type ComboboxItemTitleProps,\r\n ComboboxItemDescription,\r\n type ComboboxItemDescriptionProps,\r\n ComboboxItemIcon,\r\n ComboboxItemAvatar,\r\n type ComboboxItemAvatarProps,\r\n ComboboxItemIndicator,\r\n type ComboboxItemIndicatorProps,\r\n type ComboboxItemProps,\r\n ComboboxLabel,\r\n type ComboboxLabelProps,\r\n ComboboxList,\r\n type ComboboxListProps,\r\n type ComboboxLoadingProps,\r\n ComboboxPortal,\r\n type ComboboxPortalProps,\r\n ComboboxPositioner,\r\n type ComboboxPositionerProps,\r\n type ComboboxProps,\r\n ComboboxRow,\r\n type ComboboxRowProps,\r\n ComboboxSeparator,\r\n type ComboboxSeparatorProps,\r\n ComboboxStatus,\r\n type ComboboxStatusProps,\r\n ComboboxTrigger,\r\n type ComboboxTriggerProps,\r\n ComboboxValue,\r\n type ComboboxValueProps\r\n}"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {a,j,i,k,l,m,q,s,w,A,x,H}from'./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import {a,j,i,k,l,m,q,s,w,A,x,H}from'./chunk-ILE3MBTR.js';import {f,g}from'./chunk-HHG7BSWN.js';import {a as a$1}from'./chunk-Y6TKCAAJ.js';import*as u from'react';import {cn}from'@xploreu/lib/cn';import {useControlledState}from'@xploreu/hooks/use-controlled-state';import {jsxs,jsx,Fragment}from'react/jsx-runtime';function oe({multiple:G=true,inputPlaceholder:j$1="Search...",container:q$1,items:s$1,infiniteScroll:z,isPending:B,taggable:c=false,maxVisible:m$1,className:O,triggerClassName:F,contentClassName:H$1,...b}){let[J,K]=useControlledState({value:b?.inputValue?.toString(),defaultValue:b?.defaultInputValue?.toString(),onChange:b?.onInputValueChange}),[i$1,h]=useControlledState({value:b?.value??[],defaultValue:b?.defaultValue??[],onChange:b?.onValueChange}),[V,I]=u.useState([]),p=u.useRef(new Set);u.useEffect(()=>{let e=new Set(i$1.map(a=>a.value));I(a=>{let l=a.filter(o=>e.has(o.value));return l.length===a.length?a:(p.current=new Set(l.map(o=>o.value)),l)});},[i$1]);let t=J?.toString().trim()??"",v=u.useMemo(()=>t?i$1.some(e=>e.value.toLowerCase()===t.toLowerCase()):false,[t,i$1]),C=u.useMemo(()=>!c||!t?false:!s$1?.some(e=>e.label.toLowerCase()===t.toLowerCase()),[c,t,s$1]),Q=u.useMemo(()=>{let e=[...s$1??[],...V];return C?[...e,{label:t,value:t,tag:true}]:e},[s$1,V,C,t]);return jsxs(a,{...b,behavior:"chip-outside",multiple:true,items:c?Q:s$1,isItemEqualToValue:(e,a)=>e.value===a.value,onValueChange:(e,a)=>{if(c){let l=e.filter(o=>o?.tag===true&&!p.current.has(o.value));if(l.length>0){for(let o of l)p.current.add(o.value);I(o=>[...o,...l]);}}h(G?e:[e[e.length-1]],a);},onInputValueChange:K,children:[jsx(f,{className:cn(a$1(),"h-auto min-h-13 flex flex-wrap items-center gap-1.5 px-3 py-1.5 cursor-text",F,O),children:jsxs(j,{className:cn("contents",m$1!==void 0&&"flex-nowrap overflow-hidden"),children:[jsx(i,{children:e=>{let a=m$1!==void 0?e.slice(0,m$1):e,l$1=m$1!==void 0?e.length-m$1:0;return jsxs(Fragment,{children:[a?.map(o=>jsxs(k,{className:cn("max-w-full min-w-0",m$1!==void 0&&"shrink"),children:[o?.image&&jsx("img",{src:o.image,alt:o?.label||"",className:"size-4 rounded-full object-cover shrink-0 mr-1"}),jsx("span",{className:"truncate",title:o?.label||"",children:o?.label||""}),jsx(l,{})]},o?.value||"")),l$1>0&&jsxs(k,{className:"shrink-0",children:["+",l$1]})]})}}),jsx(g,{render:jsx("input",{className:"flex-1 min-w-[80px] bg-transparent outline-none text-body-regular-1 text-text-primary placeholder:text-text-placeholder",placeholder:i$1.length===0?j$1:void 0})})]})}),jsxs(m,{container:q$1,className:H$1,children:[jsx(q,{status:B||s$1===void 0?"pending":s$1?.length===0&&!C?"empty":null}),jsxs(s,{children:[s$1?.map(e=>jsxs(w,{value:e,children:[e.image!==void 0&&jsx(A,{src:e.image,fallbackText:[e.label?.[0],e.label?.split(" ")?.[1]?.[0]].filter(Boolean).join(""),imageAlt:e.label}),jsx(x,{children:e.label})]},e.value)),C&&jsxs(w,{value:{label:t,value:t,tag:true},children:[!v&&jsxs("span",{className:"text-text-secondary text-body-medium-3 col-start-2",children:["Create: ",t]}),v&&jsx(x,{children:t})]}),jsx(H,{...z})]})]})]})}export{oe as a};//# sourceMappingURL=chunk-MM4FBTNO.js.map
|
|
2
|
+
//# sourceMappingURL=chunk-MM4FBTNO.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/composites/combobox-chip.tsx"],"names":["ComboboxChip","multiple","inputPlaceholder","container","items","infiniteScroll","isPending","taggable","maxVisible","className","triggerClassName","contentClassName","props","inputValue","setInputValue","useControlledState","value","setValue","createdItems","setCreatedItems","createdValuesRef","currentValues","v","prev","next","item","trimmedInput","isInputSelected","isCreatingItem","combinedItems","base","jsxs","Combobox","a","b","eventDetails","newTags","tag","jsx","ComboboxInputGroup","cn","inputVariants","ComboboxChips","ComboboxValue","visible","overflow","Fragment","ComboboxChipRemove","ComboboxInput","ComboboxPopup","ComboboxStatus","ComboboxList","ComboboxItem","ComboboxItemAvatar","ComboboxItemTitle","ComboboxInfiniteScroll"],"mappings":"2TAkDA,SAASA,EAAAA,CAAyF,CAChG,QAAA,CAAAC,CAAAA,CAAW,KACX,gBAAA,CAAAC,GAAAA,CAAmB,WAAA,CAC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lD,CAAAA,CAAgB,CAAA,CAAA,CAC9C,CAAA,CAAA,CACF,GACF,CAEJ","file":"chunk-AKKXXJRJ.js","sourcesContent":["import * as React from \"react\"\r\n\r\nimport { cn } from \"@xploreu/lib/cn\"\r\nimport {\r\n ComboboxInput as ComboboxInputPrimitive,\r\n ComboboxInputGroup,\r\n} from \"../primitives/combobox\"\r\nimport {\r\n Combobox,\r\n ComboboxChip as ComboboxChipUI,\r\n ComboboxChipRemove,\r\n ComboboxChips,\r\n ComboboxInfiniteScroll,\r\n ComboboxItem,\r\n ComboboxList,\r\n ComboboxPortal,\r\n ComboboxPopup,\r\n ComboboxStatus,\r\n ComboboxValue,\r\n type ComboboxProps,\r\n ComboboxItemTitle,\r\n ComboboxItemAvatar\r\n} from \"../ui/combobox\"\r\nimport { useControlledState } from \"@xploreu/hooks/use-controlled-state\"\r\nimport { inputVariants } from \"../ui/input\"\r\n\r\ntype ComboboxChipProps<Value extends { label: string; value: string; image?: string; tag?: true }> = Omit<ComboboxProps<Value, true>, \"multiple\" | \"items\"> & {\r\n multiple?: boolean\r\n inputPlaceholder?: string\r\n container?: React.ComponentProps<typeof ComboboxPortal>[\"container\"]\r\n items?: Value[] | undefined\r\n infiniteScroll?: React.ComponentProps<typeof ComboboxInfiniteScroll>\r\n isPending?: boolean\r\n /**\r\n * When true, enables creatable / taggable mode.\r\n * If the typed value has no exact match in the current item list,\r\n * a \"Create \\\"…\\\"\" option is shown at the top of the dropdown.\r\n * Created items are appended to the value with `{ label, value, tag: true }`.\r\n */\r\n taggable?: boolean\r\n /**\r\n * Maximum number of chips to show before collapsing the rest into a \"+N\" chip.\r\n * When undefined, all chips are shown.\r\n */\r\n maxVisible?: number\r\n className?: string\r\n triggerClassName?: string\r\n contentClassName?: string\r\n}\r\n\r\nfunction ComboboxChip<Value extends { label: string; value: string; image?: string; tag?: true }>({\r\n multiple = true,\r\n inputPlaceholder = \"Search...\",\r\n container,\r\n items,\r\n infiniteScroll,\r\n isPending,\r\n taggable = false,\r\n maxVisible,\r\n className,\r\n triggerClassName,\r\n contentClassName,\r\n ...props\r\n}: ComboboxChipProps<Value>) {\r\n const [inputValue, setInputValue] = useControlledState({\r\n value: props?.inputValue?.toString(),\r\n defaultValue: props?.defaultInputValue?.toString(),\r\n onChange: props?.onInputValueChange,\r\n })\r\n\r\n const [value, setValue] = useControlledState({\r\n value: props?.value ?? [],\r\n defaultValue: props?.defaultValue ?? [],\r\n onChange: props?.onValueChange,\r\n })\r\n\r\n // Track items created via taggable mode\r\n // Sync with value to avoid stale tags when controlled value is reset from outside\r\n const [createdItems, setCreatedItems] = React.useState<Value[]>([])\r\n const createdValuesRef = React.useRef<Set<string>>(new Set())\r\n\r\n React.useEffect(() => {\r\n const currentValues = new Set(value.map((v) => v.value))\r\n setCreatedItems((prev) => {\r\n const next = prev.filter((item) => currentValues.has(item.value))\r\n if (next.length === prev.length) return prev\r\n createdValuesRef.current = new Set(next.map((v) => v.value))\r\n return next\r\n })\r\n }, [value])\r\n\r\n const trimmedInput = inputValue?.toString().trim() ?? \"\"\r\n const isInputSelected = React.useMemo(() => {\r\n if (!trimmedInput) return false\r\n return value.some(\r\n (item) => item.value.toLowerCase() === trimmedInput.toLowerCase()\r\n )\r\n }, [trimmedInput, value])\r\n\r\n // true = show the taggable item in dropdown (either as \"Create:\" or as checked item)\r\n const isCreatingItem = React.useMemo(() => {\r\n if (!taggable || !trimmedInput) return false\r\n return !items?.some(\r\n (item) => item.label.toLowerCase() === trimmedInput.toLowerCase()\r\n )\r\n }, [taggable, trimmedInput, items])\r\n\r\n // Merge server items with locally created tags + the \"Create\" placeholder\r\n const combinedItems = React.useMemo(() => {\r\n const base: Value[] = [\r\n ...items ?? [],\r\n ...createdItems,\r\n ]\r\n\r\n if (isCreatingItem) {\r\n return [...base, { label: trimmedInput, value: trimmedInput, tag: true } as unknown as Value]\r\n }\r\n\r\n return base\r\n }, [items, createdItems, isCreatingItem, trimmedInput])\r\n\r\n const handleValueChange: ComboboxProps<Value, true>[\"onValueChange\"] = (value, eventDetails) => {\r\n if (taggable) {\r\n const newTags = value.filter(\r\n (v) => v?.tag === true && !createdValuesRef.current.has(v.value)\r\n )\r\n if (newTags.length > 0) {\r\n for (const tag of newTags) {\r\n createdValuesRef.current.add(tag.value)\r\n }\r\n setCreatedItems((prev) => [...prev, ...newTags])\r\n }\r\n }\r\n\r\n if (!multiple) {\r\n setValue([value[value.length - 1]], eventDetails)\r\n } else {\r\n setValue(value, eventDetails)\r\n }\r\n }\r\n\r\n return (\r\n <Combobox\r\n {...props}\r\n behavior=\"chip-outside\"\r\n multiple\r\n items={taggable ? combinedItems : items}\r\n isItemEqualToValue={(a, b) => a.value === b.value}\r\n onValueChange={handleValueChange}\r\n onInputValueChange={setInputValue}\r\n >\r\n {/* Input box with chips inside */}\r\n <ComboboxInputGroup\r\n className={cn(\r\n inputVariants(),\r\n \"h-auto min-h-13 flex flex-wrap items-center gap-1.5 px-3 py-1.5 cursor-text\",\r\n triggerClassName,\r\n className\r\n )}\r\n >\r\n {/* Chips inside the input box */}\r\n <ComboboxChips\r\n className={cn(\r\n \"contents\",\r\n maxVisible !== undefined && \"flex-nowrap overflow-hidden\"\r\n )}\r\n >\r\n <ComboboxValue>\r\n {(value: Value[]) => {\r\n const visible = maxVisible !== undefined ? value.slice(0, maxVisible) : value\r\n const overflow = maxVisible !== undefined ? value.length - maxVisible : 0\r\n return (\r\n <>\r\n {visible?.map((item) => (\r\n <ComboboxChipUI\r\n key={item?.value || \"\"}\r\n className={cn(\r\n \"max-w-full min-w-0\",\r\n maxVisible !== undefined && \"shrink\"\r\n )}\r\n >\r\n {item?.image && (\r\n <img\r\n src={item.image}\r\n alt={item?.label || \"\"}\r\n className=\"size-4 rounded-full object-cover shrink-0 mr-1\"\r\n />\r\n )}\r\n <span className=\"truncate\" title={item?.label || \"\"}>\r\n {item?.label || \"\"}\r\n </span>\r\n <ComboboxChipRemove />\r\n </ComboboxChipUI>\r\n ))}\r\n {overflow > 0 && (\r\n <ComboboxChipUI className=\"shrink-0\">\r\n +{overflow}\r\n </ComboboxChipUI>\r\n )}\r\n </>\r\n )\r\n }}\r\n </ComboboxValue>\r\n {/* Text input — shrinks to fit remaining space (inside Chips so backspace works) */}\r\n <ComboboxInputPrimitive\r\n render={\r\n <input\r\n className=\"flex-1 min-w-[80px] bg-transparent outline-none text-body-regular-1 text-text-primary placeholder:text-text-placeholder\"\r\n placeholder={value.length === 0 ? inputPlaceholder : undefined}\r\n />\r\n }\r\n />\r\n </ComboboxChips>\r\n </ComboboxInputGroup>\r\n\r\n <ComboboxPopup container={container} className={contentClassName}>\r\n <ComboboxStatus\r\n status={\r\n isPending || items === undefined\r\n ? \"pending\"\r\n : items?.length === 0 && !isCreatingItem\r\n ? \"empty\"\r\n : null\r\n }\r\n />\r\n <ComboboxList>\r\n {items?.map((item) => (\r\n <ComboboxItem\r\n key={item.value}\r\n value={item as Value}\r\n >\r\n {(item.image !== undefined) && (\r\n <ComboboxItemAvatar\r\n src={item.image}\r\n fallbackText={[item.label?.[0], item.label?.split(\" \")?.[1]?.[0]].filter(Boolean).join(\"\")}\r\n imageAlt={item.label}\r\n />\r\n )}\r\n <ComboboxItemTitle>{item.label}</ComboboxItemTitle>\r\n </ComboboxItem>\r\n ))}\r\n {isCreatingItem && (\r\n <ComboboxItem\r\n value={{ label: trimmedInput, value: trimmedInput, tag: true }}\r\n >\r\n {!isInputSelected && (\r\n <span className=\"text-text-secondary text-body-medium-3 col-start-2\">Create: {trimmedInput}</span>\r\n )}\r\n {isInputSelected && (\r\n <ComboboxItemTitle>{trimmedInput}</ComboboxItemTitle>\r\n )}\r\n </ComboboxItem>\r\n )}\r\n <ComboboxInfiniteScroll {...infiniteScroll} />\r\n </ComboboxList>\r\n </ComboboxPopup>\r\n </Combobox>\r\n )\r\n}\r\n\r\nexport { ComboboxChip }\r\nexport type { ComboboxChipProps }\r\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/composites/combobox-chip.tsx"],"names":["ComboboxChip","multiple","inputPlaceholder","container","items","infiniteScroll","isPending","taggable","maxVisible","className","triggerClassName","contentClassName","props","inputValue","setInputValue","useControlledState","value","setValue","createdItems","setCreatedItems","createdValuesRef","currentValues","v","prev","next","item","trimmedInput","isInputSelected","isCreatingItem","combinedItems","base","jsxs","Combobox","a","b","eventDetails","newTags","tag","jsx","ComboboxInputGroup","cn","inputVariants","ComboboxChips","ComboboxValue","visible","overflow","Fragment","ComboboxChipRemove","ComboboxInput","ComboboxPopup","ComboboxStatus","ComboboxList","ComboboxItem","ComboboxItemAvatar","ComboboxItemTitle","ComboboxInfiniteScroll"],"mappings":"2TAkDA,SAASA,EAAAA,CAAyF,CAChG,QAAA,CAAAC,CAAAA,CAAW,KACX,gBAAA,CAAAC,GAAAA,CAAmB,WAAA,CACnB,SAAA,CAAAC,IACA,KAAA,CAAAC,GAAAA,CACA,cAAA,CAAAC,CAAAA,CACA,UAAAC,CAAAA,CACA,QAAA,CAAAC,CAAAA,CAAW,KAAA,CACX,UAAA,CAAAC,GAAAA,CACA,SAAA,CAAAC,CAAAA,CACA,iBAAAC,CAAAA,CACA,gBAAA,CAAAC,GAAAA,CACA,GAAGC,CACL,CAAA,CAA6B,CAC3B,GAAM,CAACC,CAAAA,CAAYC,CAAa,CAAA,CAAIC,kBAAAA,CAAmB,CACrD,KAAA,CAAOH,CAAAA,EAAO,UAAA,EAAY,UAAS,CACnC,YAAA,CAAcA,CAAAA,EAAO,iBAAA,EAAmB,UAAS,CACjD,QAAA,CAAUA,CAAAA,EAAO,kBACnB,CAAC,CAAA,CAEK,CAACI,GAAAA,CAAOC,CAAQ,CAAA,CAAIF,kBAAAA,CAAmB,CAC3C,KAAA,CAAOH,GAAO,KAAA,EAAS,EAAC,CACxB,YAAA,CAAcA,CAAAA,EAAO,YAAA,EAAgB,EAAC,CACtC,SAAUA,CAAAA,EAAO,aACnB,CAAC,CAAA,CAIK,CAACM,CAAAA,CAAcC,CAAe,CAAA,CAAU,WAAkB,EAAE,CAAA,CAC5DC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MAAM,CAAA,CAAA,CAAA,CAV1BA,CAAAA,CAAK,KAWZ,CACD,EACAG,CAAAA,EACCG,IAAAA,CAACqB,CAAAA,CAAA,CACC,KAAA,CAAO,CAAE,KAAA,CAAO1B,CAAAA,CAAc,MAAOA,CAAAA,CAAc,GAAA,CAAK,IAAK,CAAA,CAE5D,WAACC,CAAAA,EACAI,IAAAA,CAAC,MAAA,CAAA,CAAK,SAAA,CAAU,qDAAqD,QAAA,CAAA,CAAA,UAAA,CAASL,CAAAA,CAAAA,CAAa,CAAA,CAE5FC,CAAAA,EACCW,GAAAA,CAACgB,CAAAA,CAAA,CAAmB,QAAA,CAAA5B,EAAa,CAAA,CAAA,CAErC,CAAA,CAEFY,GAAAA,CAACiB,CAAAA,CAAA,CAAwB,GAAGlD,CAAAA,CAAgB,CAAA,CAAA,CAC9C,CAAA,CAAA,CACF,GACF,CAEJ","file":"chunk-MM4FBTNO.js","sourcesContent":["import * as React from \"react\"\r\n\r\nimport { cn } from \"@xploreu/lib/cn\"\r\nimport {\r\n ComboboxInput as ComboboxInputPrimitive,\r\n ComboboxInputGroup,\r\n} from \"../primitives/combobox\"\r\nimport {\r\n Combobox,\r\n ComboboxChip as ComboboxChipUI,\r\n ComboboxChipRemove,\r\n ComboboxChips,\r\n ComboboxInfiniteScroll,\r\n ComboboxItem,\r\n ComboboxList,\r\n ComboboxPortal,\r\n ComboboxPopup,\r\n ComboboxStatus,\r\n ComboboxValue,\r\n type ComboboxProps,\r\n ComboboxItemTitle,\r\n ComboboxItemAvatar\r\n} from \"../ui/combobox\"\r\nimport { useControlledState } from \"@xploreu/hooks/use-controlled-state\"\r\nimport { inputVariants } from \"../ui/input\"\r\n\r\ntype ComboboxChipProps<Value extends { label: string; value: string; image?: string; tag?: true }> = Omit<ComboboxProps<Value, true>, \"multiple\" | \"items\"> & {\r\n multiple?: boolean\r\n inputPlaceholder?: string\r\n container?: React.ComponentProps<typeof ComboboxPortal>[\"container\"]\r\n items?: Value[] | undefined\r\n infiniteScroll?: React.ComponentProps<typeof ComboboxInfiniteScroll>\r\n isPending?: boolean\r\n /**\r\n * When true, enables creatable / taggable mode.\r\n * If the typed value has no exact match in the current item list,\r\n * a \"Create \\\"…\\\"\" option is shown at the top of the dropdown.\r\n * Created items are appended to the value with `{ label, value, tag: true }`.\r\n */\r\n taggable?: boolean\r\n /**\r\n * Maximum number of chips to show before collapsing the rest into a \"+N\" chip.\r\n * When undefined, all chips are shown.\r\n */\r\n maxVisible?: number\r\n className?: string\r\n triggerClassName?: string\r\n contentClassName?: string\r\n}\r\n\r\nfunction ComboboxChip<Value extends { label: string; value: string; image?: string; tag?: true }>({\r\n multiple = true,\r\n inputPlaceholder = \"Search...\",\r\n container,\r\n items,\r\n infiniteScroll,\r\n isPending,\r\n taggable = false,\r\n maxVisible,\r\n className,\r\n triggerClassName,\r\n contentClassName,\r\n ...props\r\n}: ComboboxChipProps<Value>) {\r\n const [inputValue, setInputValue] = useControlledState({\r\n value: props?.inputValue?.toString(),\r\n defaultValue: props?.defaultInputValue?.toString(),\r\n onChange: props?.onInputValueChange,\r\n })\r\n\r\n const [value, setValue] = useControlledState({\r\n value: props?.value ?? [],\r\n defaultValue: props?.defaultValue ?? [],\r\n onChange: props?.onValueChange,\r\n })\r\n\r\n // Track items created via taggable mode\r\n // Sync with value to avoid stale tags when controlled value is reset from outside\r\n const [createdItems, setCreatedItems] = React.useState<Value[]>([])\r\n const createdValuesRef = React.useRef<Set<string>>(new Set())\r\n\r\n React.useEffect(() => {\r\n const currentValues = new Set(value.map((v) => v.value))\r\n setCreatedItems((prev) => {\r\n const next = prev.filter((item) => currentValues.has(item.value))\r\n if (next.length === prev.length) return prev\r\n createdValuesRef.current = new Set(next.map((v) => v.value))\r\n return next\r\n })\r\n }, [value])\r\n\r\n const trimmedInput = inputValue?.toString().trim() ?? \"\"\r\n const isInputSelected = React.useMemo(() => {\r\n if (!trimmedInput) return false\r\n return value.some(\r\n (item) => item.value.toLowerCase() === trimmedInput.toLowerCase()\r\n )\r\n }, [trimmedInput, value])\r\n\r\n // true = show the taggable item in dropdown (either as \"Create:\" or as checked item)\r\n const isCreatingItem = React.useMemo(() => {\r\n if (!taggable || !trimmedInput) return false\r\n return !items?.some(\r\n (item) => item.label.toLowerCase() === trimmedInput.toLowerCase()\r\n )\r\n }, [taggable, trimmedInput, items])\r\n\r\n // Merge server items with locally created tags + the \"Create\" placeholder\r\n const combinedItems = React.useMemo(() => {\r\n const base: Value[] = [\r\n ...items ?? [],\r\n ...createdItems,\r\n ]\r\n\r\n if (isCreatingItem) {\r\n return [...base, { label: trimmedInput, value: trimmedInput, tag: true } as unknown as Value]\r\n }\r\n\r\n return base\r\n }, [items, createdItems, isCreatingItem, trimmedInput])\r\n\r\n const handleValueChange: ComboboxProps<Value, true>[\"onValueChange\"] = (value, eventDetails) => {\r\n if (taggable) {\r\n const newTags = value.filter(\r\n (v) => v?.tag === true && !createdValuesRef.current.has(v.value)\r\n )\r\n if (newTags.length > 0) {\r\n for (const tag of newTags) {\r\n createdValuesRef.current.add(tag.value)\r\n }\r\n setCreatedItems((prev) => [...prev, ...newTags])\r\n }\r\n }\r\n\r\n if (!multiple) {\r\n setValue([value[value.length - 1]], eventDetails)\r\n } else {\r\n setValue(value, eventDetails)\r\n }\r\n }\r\n\r\n return (\r\n <Combobox\r\n {...props}\r\n behavior=\"chip-outside\"\r\n multiple\r\n items={taggable ? combinedItems : items}\r\n isItemEqualToValue={(a, b) => a.value === b.value}\r\n onValueChange={handleValueChange}\r\n onInputValueChange={setInputValue}\r\n >\r\n {/* Input box with chips inside */}\r\n <ComboboxInputGroup\r\n className={cn(\r\n inputVariants(),\r\n \"h-auto min-h-13 flex flex-wrap items-center gap-1.5 px-3 py-1.5 cursor-text\",\r\n triggerClassName,\r\n className\r\n )}\r\n >\r\n {/* Chips inside the input box */}\r\n <ComboboxChips\r\n className={cn(\r\n \"contents\",\r\n maxVisible !== undefined && \"flex-nowrap overflow-hidden\"\r\n )}\r\n >\r\n <ComboboxValue>\r\n {(value: Value[]) => {\r\n const visible = maxVisible !== undefined ? value.slice(0, maxVisible) : value\r\n const overflow = maxVisible !== undefined ? value.length - maxVisible : 0\r\n return (\r\n <>\r\n {visible?.map((item) => (\r\n <ComboboxChipUI\r\n key={item?.value || \"\"}\r\n className={cn(\r\n \"max-w-full min-w-0\",\r\n maxVisible !== undefined && \"shrink\"\r\n )}\r\n >\r\n {item?.image && (\r\n <img\r\n src={item.image}\r\n alt={item?.label || \"\"}\r\n className=\"size-4 rounded-full object-cover shrink-0 mr-1\"\r\n />\r\n )}\r\n <span className=\"truncate\" title={item?.label || \"\"}>\r\n {item?.label || \"\"}\r\n </span>\r\n <ComboboxChipRemove />\r\n </ComboboxChipUI>\r\n ))}\r\n {overflow > 0 && (\r\n <ComboboxChipUI className=\"shrink-0\">\r\n +{overflow}\r\n </ComboboxChipUI>\r\n )}\r\n </>\r\n )\r\n }}\r\n </ComboboxValue>\r\n {/* Text input — shrinks to fit remaining space (inside Chips so backspace works) */}\r\n <ComboboxInputPrimitive\r\n render={\r\n <input\r\n className=\"flex-1 min-w-[80px] bg-transparent outline-none text-body-regular-1 text-text-primary placeholder:text-text-placeholder\"\r\n placeholder={value.length === 0 ? inputPlaceholder : undefined}\r\n />\r\n }\r\n />\r\n </ComboboxChips>\r\n </ComboboxInputGroup>\r\n\r\n <ComboboxPopup container={container} className={contentClassName}>\r\n <ComboboxStatus\r\n status={\r\n isPending || items === undefined\r\n ? \"pending\"\r\n : items?.length === 0 && !isCreatingItem\r\n ? \"empty\"\r\n : null\r\n }\r\n />\r\n <ComboboxList>\r\n {items?.map((item) => (\r\n <ComboboxItem\r\n key={item.value}\r\n value={item as Value}\r\n >\r\n {(item.image !== undefined) && (\r\n <ComboboxItemAvatar\r\n src={item.image}\r\n fallbackText={[item.label?.[0], item.label?.split(\" \")?.[1]?.[0]].filter(Boolean).join(\"\")}\r\n imageAlt={item.label}\r\n />\r\n )}\r\n <ComboboxItemTitle>{item.label}</ComboboxItemTitle>\r\n </ComboboxItem>\r\n ))}\r\n {isCreatingItem && (\r\n <ComboboxItem\r\n value={{ label: trimmedInput, value: trimmedInput, tag: true }}\r\n >\r\n {!isInputSelected && (\r\n <span className=\"text-text-secondary text-body-medium-3 col-start-2\">Create: {trimmedInput}</span>\r\n )}\r\n {isInputSelected && (\r\n <ComboboxItemTitle>{trimmedInput}</ComboboxItemTitle>\r\n )}\r\n </ComboboxItem>\r\n )}\r\n <ComboboxInfiniteScroll {...infiniteScroll} />\r\n </ComboboxList>\r\n </ComboboxPopup>\r\n </Combobox>\r\n )\r\n}\r\n\r\nexport { ComboboxChip }\r\nexport type { ComboboxChipProps }\r\n"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {a,b,i,m,s,w}from'./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import {a,b,i,m,s,w}from'./chunk-ILE3MBTR.js';import*as l from'react';import {ChevronDownIcon,ChevronLeftIcon,ChevronRightIcon}from'lucide-react';import {cn}from'@xploreu/lib/cn';import {jsxs,Fragment,jsx}from'react/jsx-runtime';function j({page:r,pageSize:a$1,total:i$1,onPageChange:b$1,onPageSizeChange:n,pageSizeOptions:m$1=[10,20,50,100],showPageSize:c=true,showRange:d=true,className:C,...N}){let u=Math.max(1,Math.ceil(i$1/a$1)),h=i$1===0?0:(r-1)*a$1+1,P=Math.min(r*a$1,i$1),s$1=l.useMemo(()=>m$1.map(e=>({label:String(e),value:e})),[m$1]),I=l.useMemo(()=>s$1.find(e=>e.value===a$1)??s$1[0],[s$1,a$1]);return jsxs("div",{className:cn("flex w-full flex-col-reverse gap-3 mt-4 sm:flex-row sm:items-center sm:justify-between border-t border-border-primary pt-3 text-body-regular-2 text-text-secondary",C),"data-slot":"pagination",...N,children:[jsxs("div",{className:"flex items-center gap-2",children:[c&&n&&jsxs(Fragment,{children:[jsx("span",{className:"text-label-regular-3 text-text-tertiary",children:"Rows per page"}),jsxs(a,{items:s$1,value:I,onValueChange:e=>{e&&n&&n(e.value);},isItemEqualToValue:(e,w)=>e.value===w.value,children:[jsxs(b,{className:"h-8 gap-2 rounded-lg border border-border-primary bg-bg-primary px-3 text-label-semibold-3 text-text-primary hover:bg-bg-secondary focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border-brand-primary","aria-label":"Rows per page",children:[jsx(i,{children:e=>e?e.label:String(a$1)}),jsx(ChevronDownIcon,{className:"size-3.5 text-text-tertiary"})]}),jsx(m,{className:"w-24",children:jsx(s,{children:s$1.map(e=>jsx(w,{value:e,children:e.label},e.value))})})]})]}),c&&d&&jsx("span",{className:"text-text-tertiary",children:"\xB7"}),d&&jsxs("span",{className:"text-label-regular-3 text-text-tertiary",children:[h,"\u2013",P," of ",i$1]})]}),jsxs("div",{className:"flex items-center gap-1",children:[jsx("button",{type:"button",disabled:r<=1,onClick:()=>b$1(r-1),className:"inline-flex size-8 cursor-pointer items-center justify-center rounded-lg border border-border-primary bg-bg-primary text-text-secondary transition-colors hover:bg-bg-secondary hover:text-text-primary disabled:cursor-not-allowed disabled:opacity-40","aria-label":"Previous page",children:jsx(ChevronLeftIcon,{className:"size-4"})}),jsxs("span",{className:"px-2 text-label-semibold-3 text-text-primary",children:["Page ",r," / ",u]}),jsx("button",{type:"button",disabled:r>=u,onClick:()=>b$1(r+1),className:"inline-flex size-8 cursor-pointer items-center justify-center rounded-lg border border-border-primary bg-bg-primary text-text-secondary transition-colors hover:bg-bg-secondary hover:text-text-primary disabled:cursor-not-allowed disabled:opacity-40","aria-label":"Next page",children:jsx(ChevronRightIcon,{className:"size-4"})})]})]})}export{j as a};//# sourceMappingURL=chunk-NJVFQXVS.js.map
|
|
2
|
+
//# sourceMappingURL=chunk-NJVFQXVS.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/ui/pagination.tsx"],"names":["Pagination","page","pageSize","total","onPageChange","onPageSizeChange","pageSizeOptions","showPageSize","showRange","className","props","totalPages","startItem","endItem","items","opt","selectedItem","item","jsxs","cn","Fragment","jsx","Combobox","a","b","ComboboxTrigger","ComboboxValue","val","ChevronDownIcon","ComboboxPopup","ComboboxList","ComboboxItem","ChevronLeftIcon","ChevronRightIcon"],"mappings":"qOA6BO,SAASA,CAAAA,CAAW,CACzB,KAAAC,CAAAA,CACA,QAAA,CAAAC,GAAAA,CACA,KAAA,CAAAC,IACA,YAAA,CAAAC,GAAAA,CACA,gBAAA,CAAAC,CAAAA,CACA,gBAAAC,GAAAA,CAAkB,CAAC,EAAA,CAAI,EAAA,CAAI,GAAI,GAAG,CAAA,CAClC,YAAA,CAAAC,CAAAA,CAAe,KACf,SAAA,CAAAC,CAAAA,CAAY,IAAA,CACZ,SAAA,CAAAC,EACA,GAAGC,CACL,CAAA,CAAoB,CAClB,IAAMC,CAAAA,CAAa,IAAA,CAAK,GAAA,CAAI,CAAA,CAAG,KAAK,IAAA,CAAKR,GAAAA,CAAQD,GAAQ,CAAC,EACpDU,CAAAA,CAAYT,GAAAA,GAAU,CAAA,CAAI,CAAA,CAAA,CAAKF,EAAO,CAAA,EAAKC,GAAAA,CAAW,CAAA,CACtDW,CAAAA,CAAU,KAAK,GAAA,CAAIZ,CAAAA,CAAOC,GAAAA,CAAUC,GAAK,EAEzCW,GAAAA,CAAoC,CAAA,CAAA,OAAA,CACxC,IAAMR,GAAAA,CAAgB,IAAKS,CAAAA,GAAS,CAAE,KAAA,CAAO,MAAA,CAAOA,CAAG,CAAA,CAAG,KAAA,CAAOA,CAAI,CAAA,CAAE,EACvE,CAACT,GAAe,CAClB,CAAA,CAEMU,EAAqB,CAAA,CAAA,OAAA,CACzB,IAAMF,GAAAA,CAAM,IAAA,CAAMG,GAASA,CAAAA,CAAK,KAAA,GAAUf,GAAQ,CAAA,EAAKY,IAAM,CAAC,CAAA,CAC9D,CAACA,GAAAA,CAAOZ,GAAQ,CAClB,CAAA,CAEA,OACEgB,IAAAA,CAAC,OACC,SAAA,CAAWC,EAAAA,CACT,oKAAA,CACAV,CACF,EACA,WAAA,C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,MAAA,CAAA,CAAK,SAAA,CAAU,qBAAqB,QAAA,CAAA,MAAA,CAAC,CAAA,CAGvCb,CAAAA,EACCU,IAAAA,CAAC,QAAK,SAAA,CAAU,yCAAA,CACb,QAAA,CAAA,CAAAN,CAAAA,CAAU,SAAEC,CAAAA,CAAQ,MAAA,CAAKV,GAAAA,CAAAA,CAC5B,CAAA,CAAA,CAEJ,EAGAe,IAAAA,CAAC,KAAA,CAAA,CAAI,SAAA,CAAU,yBAAA,CACb,UAAAG,GAAAA,CAAC,QAAA,CAAA,CACC,IAAA,CAAK,QAAA,CACL,SAAUpB,CAAAA,EAAQ,CAAA,CAClB,OAAA,CAAS,IAAMG,IAAaH,CAAAA,CAAO,CAAC,CAAA,CACpC,SAAA,CAAU,0PACV,YAAA,CAAW,eAAA,CAEX,QAAA,CAAAoB,GAAAA,CAACW,gBAAA,CAAgB,SAAA,CAAU,QAAA,CAAS,CAAA,CACtC,EAEAd,IAAAA,CAAC,MAAA,CAAA,CAAK,SAAA,CAAU,8CAAA,CAA+C,kBACvDjB,CAAAA,CAAK,KAAA,CAAIU,CAAAA,CAAAA,CACjB,CAAA,CAEAU,IAAC,QAAA,CAAA,CACC,IAAA,CAAK,QAAA,CACL,QAAA,CAAUpB,GAAQU,CAAAA,CAClB,OAAA,CAAS,IAAMP,GAAAA,CAAaH,EAAO,CAAC,CAAA,CACpC,SAAA,CAAU,yPAAA,CACV,aAAW,WAAA,CAEX,QAAA,CAAAoB,GAAAA,CAACY,gBAAAA,CAAA,CAAiB,SAAA,CAAU,QAAA,CAAS,CAAA,CACvC,CAAA,CAAA,CACF,GACF,CAEJ","file":"chunk-
|
|
1
|
+
{"version":3,"sources":["../src/ui/pagination.tsx"],"names":["Pagination","page","pageSize","total","onPageChange","onPageSizeChange","pageSizeOptions","showPageSize","showRange","className","props","totalPages","startItem","endItem","items","opt","selectedItem","item","jsxs","cn","Fragment","jsx","Combobox","a","b","ComboboxTrigger","ComboboxValue","val","ChevronDownIcon","Combobo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,CAGvCb,CAAAA,EACCU,IAAAA,CAAC,QAAK,SAAA,CAAU,yCAAA,CACb,QAAA,CAAA,CAAAN,CAAAA,CAAU,SAAEC,CAAAA,CAAQ,MAAA,CAAKV,GAAAA,CAAAA,CAC5B,CAAA,CAAA,CAEJ,EAGAe,IAAAA,CAAC,KAAA,CAAA,CAAI,SAAA,CAAU,yBAAA,CACb,UAAAG,GAAAA,CAAC,QAAA,CAAA,CACC,IAAA,CAAK,QAAA,CACL,SAAUpB,CAAAA,EAAQ,CAAA,CAClB,OAAA,CAAS,IAAMG,IAAaH,CAAAA,CAAO,CAAC,CAAA,CACpC,SAAA,CAAU,0PACV,YAAA,CAAW,eAAA,CAEX,QAAA,CAAAoB,GAAAA,CAACW,gBAAA,CAAgB,SAAA,CAAU,QAAA,CAAS,CAAA,CACtC,EAEAd,IAAAA,CAAC,MAAA,CAAA,CAAK,SAAA,CAAU,8CAAA,CAA+C,kBACvDjB,CAAAA,CAAK,KAAA,CAAIU,CAAAA,CAAAA,CACjB,CAAA,CAEAU,IAAC,QAAA,CAAA,CACC,IAAA,CAAK,QAAA,CACL,QAAA,CAAUpB,GAAQU,CAAAA,CAClB,OAAA,CAAS,IAAMP,GAAAA,CAAaH,EAAO,CAAC,CAAA,CACpC,SAAA,CAAU,yPAAA,CACV,aAAW,WAAA,CAEX,QAAA,CAAAoB,GAAAA,CAACY,gBAAAA,CAAA,CAAiB,SAAA,CAAU,QAAA,CAAS,CAAA,CACvC,CAAA,CAAA,CACF,GACF,CAEJ","file":"chunk-NJVFQXVS.js","sourcesContent":["import * as React from \"react\"\r\nimport { ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon } from \"lucide-react\"\r\n\r\nimport { cn } from \"@xploreu/lib/cn\"\r\nimport {\r\n Combobox,\r\n ComboboxItem,\r\n ComboboxList,\r\n ComboboxPopup,\r\n ComboboxTrigger,\r\n ComboboxValue,\r\n} from \"./combobox\"\r\n\r\nexport interface PaginationProps extends React.ComponentProps<\"div\"> {\r\n page: number\r\n pageSize: number\r\n total: number\r\n onPageChange: (page: number) => void\r\n onPageSizeChange?: (pageSize: number) => void\r\n pageSizeOptions?: number[]\r\n showPageSize?: boolean\r\n showRange?: boolean\r\n}\r\n\r\ntype PageSizeOptionItem = {\r\n label: string\r\n value: number\r\n}\r\n\r\nexport function Pagination({\r\n page,\r\n pageSize,\r\n total,\r\n onPageChange,\r\n onPageSizeChange,\r\n pageSizeOptions = [10, 20, 50, 100],\r\n showPageSize = true,\r\n showRange = true,\r\n className,\r\n ...props\r\n}: PaginationProps) {\r\n const totalPages = Math.max(1, Math.ceil(total / pageSize))\r\n const startItem = total === 0 ? 0 : (page - 1) * pageSize + 1\r\n const endItem = Math.min(page * pageSize, total)\r\n\r\n const items: PageSizeOptionItem[] = React.useMemo(\r\n () => pageSizeOptions.map((opt) => ({ label: String(opt), value: opt })),\r\n [pageSizeOptions]\r\n )\r\n\r\n const selectedItem = React.useMemo(\r\n () => items.find((item) => item.value === pageSize) ?? items[0],\r\n [items, pageSize]\r\n )\r\n\r\n return (\r\n <div\r\n className={cn(\r\n \"flex w-full flex-col-reverse gap-3 mt-4 sm:flex-row sm:items-center sm:justify-between border-t border-border-primary pt-3 text-body-regular-2 text-text-secondary\",\r\n className\r\n )}\r\n data-slot=\"pagination\"\r\n {...props}\r\n >\r\n {/* Left: Rows per page & range */}\r\n <div className=\"flex items-center gap-2\">\r\n {showPageSize && onPageSizeChange && (\r\n <>\r\n <span className=\"text-label-regular-3 text-text-tertiary\">\r\n Rows per page\r\n </span>\r\n <Combobox<PageSizeOptionItem>\r\n items={items}\r\n value={selectedItem}\r\n onValueChange={(item) => {\r\n if (item && onPageSizeChange) {\r\n onPageSizeChange(item.value)\r\n }\r\n }}\r\n isItemEqualToValue={(a, b) => a.value === b.value}\r\n >\r\n <ComboboxTrigger\r\n className=\"h-8 gap-2 rounded-lg border border-border-primary bg-bg-primary px-3 text-label-semibold-3 text-text-primary hover:bg-bg-secondary focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border-brand-primary\"\r\n aria-label=\"Rows per page\"\r\n >\r\n <ComboboxValue>\r\n {(val) => (val ? val.label : String(pageSize))}\r\n </ComboboxValue>\r\n <ChevronDownIcon className=\"size-3.5 text-text-tertiary\" />\r\n </ComboboxTrigger>\r\n\r\n <ComboboxPopup className=\"w-24\">\r\n <ComboboxList>\r\n {items.map((item) => (\r\n <ComboboxItem\r\n key={item.value}\r\n value={item}\r\n >\r\n {item.label}\r\n </ComboboxItem>\r\n ))}\r\n </ComboboxList>\r\n </ComboboxPopup>\r\n </Combobox>\r\n </>\r\n )}\r\n\r\n {showPageSize && showRange && (\r\n <span className=\"text-text-tertiary\">·</span>\r\n )}\r\n\r\n {showRange && (\r\n <span className=\"text-label-regular-3 text-text-tertiary\">\r\n {startItem}–{endItem} of {total}\r\n </span>\r\n )}\r\n </div>\r\n\r\n {/* Right: Page controls */}\r\n <div className=\"flex items-center gap-1\">\r\n <button\r\n type=\"button\"\r\n disabled={page <= 1}\r\n onClick={() => onPageChange(page - 1)}\r\n className=\"inline-flex size-8 cursor-pointer items-center justify-center rounded-lg border border-border-primary bg-bg-primary text-text-secondary transition-colors hover:bg-bg-secondary hover:text-text-primary disabled:cursor-not-allowed disabled:opacity-40\"\r\n aria-label=\"Previous page\"\r\n >\r\n <ChevronLeftIcon className=\"size-4\" />\r\n </button>\r\n\r\n <span className=\"px-2 text-label-semibold-3 text-text-primary\">\r\n Page {page} / {totalPages}\r\n </span>\r\n\r\n <button\r\n type=\"button\"\r\n disabled={page >= totalPages}\r\n onClick={() => onPageChange(page + 1)}\r\n className=\"inline-flex size-8 cursor-pointer items-center justify-center rounded-lg border border-border-primary bg-bg-primary text-text-secondary transition-colors hover:bg-bg-secondary hover:text-text-primary disabled:cursor-not-allowed disabled:opacity-40\"\r\n aria-label=\"Next page\"\r\n >\r\n <ChevronRightIcon className=\"size-4\" />\r\n </button>\r\n </div>\r\n </div>\r\n )\r\n}\r\n"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import {b,d,e,f as f$1,g,h}from'./chunk-OHLNKXSV.js';import {c}from'./chunk-CT7JPFL4.js';import'react';import {jsx,jsxs}from'react/jsx-runtime';function f({name:F,label:o,control:c$1,rules:d$1,description:a,size:T,className:h$1,classNameRichTextarea:u,placeholder:x,...P}){return jsx(b,{control:c$1,name:F,rules:d$1,render:({field:r})=>jsxs(d,{className:h$1,children:[o&&jsx(e,{children:o}),jsx(f$1,{children:jsx(c,{...P,className:u,placeholder:x,size:T,value:r.value??"",onChange:r.onChange,onBlur:r.onBlur})}),a&&jsx(g,{children:a}),jsx(h,{})]})})}export{f as a};//# sourceMappingURL=chunk-OF7UIE56.js.map
|
|
2
|
+
//# sourceMappingURL=chunk-OF7UIE56.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/form/form-rich-textarea.tsx"],"names":["FormRichTextarea","name","label","control","rules","description","size","className","classNameRichTextarea","placeholder","props","jsx","FormField","field","jsxs","FormItem","FormLabel","FormControl","RichTextarea","FormDescription","FormMessage"],"mappings":"gJAkCA,SAASA,CAAAA,CAGP,CACA,IAAA,CAAAC,EACA,KAAA,CAAAC,CAAAA,CACA,QAAAC,GAAAA,CACA,KAAA,CAAAC,IACA,WAAA,CAAAC,CAAAA,CACA,IAAA,CAAAC,CAAAA,CACA,SAAA,CAAAC,GAAAA,CACA,sBAAAC,CAAAA,CACA,WAAA,CAAAC,EACA,GAAGC,CACL,EAA+C,CAC7C,OACEC,GAAAA,CAACC,CAAAA,CAAA,CACC,OAAA,CAAST,IACT,IAAA,CAAMF,CAAAA,CACN,MAAOG,GAAAA,CACP,MAAA,CAAQ,CAAC,CAAE,KAAA,CAAAS,CAAM,CAAA,GACfC,IAAAA,CAACC,CAAAA,CAAA,CAAS,SAAA,CAAWR,GAAAA,CAClB,UAAAL,CAAAA,EAASS,GAAAA,CAACK,EAAA,CAAW,QAAA,CAAAd,CAAAA,CAAM,CAAA,CAC5BS,GAAAA,CAACM,GAAAA,CAAA,CACC,QAAA,CAAAN,GAAAA,CAACO,EAAA,CACE,GAAGR,EACJ,SAAA,CAAWF,CAAAA,CACX,WAAA,CAAaC,CAAAA,CACb,IAAA,CAAMH,CAAAA,CACN,MAAOO,CAAAA,CAAM,KAAA,EAAS,GACtB,QAAA,CAAUA,CAAAA,CAAM,SAChB,MAAA,CAAQA,CAAAA,CAAM,MAAA,CAChB,CAAA,CACF,CAAA,CACCR,CAAAA,EAAeM,IAACQ,CAAAA,CAAA,CAAiB,SAAAd,CAAAA,CAAY,CAAA,CAC9CM,IAACS,CAAAA,CAAA,EAAY,CAAA,CAAA,CACf,CAAA,CAEJ,CAEJ","file":"chunk-OF7UIE56.js","sourcesContent":["\"use client\"\r\n\r\nimport * as React from \"react\"\r\nimport type {\r\n ControllerRenderProps,\r\n FieldPath,\r\n FieldValues,\r\n UseControllerProps,\r\n} from \"react-hook-form\"\r\nimport type { VariantProps } from \"class-variance-authority\"\r\n\r\nimport {\r\n FormControl,\r\n FormDescription,\r\n FormField,\r\n FormItem,\r\n FormLabel,\r\n FormMessage,\r\n} from \"./form\"\r\nimport { RichTextarea, type richTextareaVariants } from \"../ui/rich-textarea\"\r\n\r\ntype FormRichTextareaProps<\r\n TFieldValues extends FieldValues,\r\n TName extends FieldPath<TFieldValues>\r\n> = {\r\n label?: string\r\n description?: string\r\n placeholder?: string\r\n className?: string\r\n classNameRichTextarea?: string\r\n size?: VariantProps<typeof richTextareaVariants>[\"size\"]\r\n} & Pick<UseControllerProps<TFieldValues, TName>, \"name\" | \"control\" | \"rules\">\r\n & Omit<React.ComponentProps<typeof RichTextarea>, keyof ControllerRenderProps | \"size\">\r\n\r\nfunction FormRichTextarea<\r\n TFieldValues extends FieldValues,\r\n TName extends FieldPath<TFieldValues>\r\n>({\r\n name,\r\n label,\r\n control,\r\n rules,\r\n description,\r\n size,\r\n className,\r\n classNameRichTextarea,\r\n placeholder,\r\n ...props\r\n}: FormRichTextareaProps<TFieldValues, TName>) {\r\n return (\r\n <FormField\r\n control={control}\r\n name={name}\r\n rules={rules}\r\n render={({ field }) => (\r\n <FormItem className={className}>\r\n {label && <FormLabel>{label}</FormLabel>}\r\n <FormControl>\r\n <RichTextarea\r\n {...props}\r\n className={classNameRichTextarea}\r\n placeholder={placeholder}\r\n size={size}\r\n value={field.value ?? \"\"}\r\n onChange={field.onChange}\r\n onBlur={field.onBlur}\r\n />\r\n </FormControl>\r\n {description && <FormDescription>{description}</FormDescription>}\r\n <FormMessage />\r\n </FormItem>\r\n )}\r\n />\r\n )\r\n}\r\n\r\nexport { FormRichTextarea }\r\nexport type { FormRichTextareaProps }\r\n"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import*as i from'react';import {mergeProps}from'@base-ui/react/merge-props';import {useRender}from'@base-ui/react/use-render';import {cva}from'class-variance-authority';import {ArrowRightIcon}from'lucide-react';import {cn}from'@xploreu/lib/cn';import {jsx}from'react/jsx-runtime';var u=cva("inline-flex items-center size-max whitespace-nowrap shrink-0 overflow-hidden transition-colors cursor-pointer group/badge-group gap-2",{variants:{theme:{light:"rounded-xp-full ring-1 ring-inset",modern:"rounded-xp-card-base-md bg-bg-primary text-text-secondary ring-1 ring-inset ring-border-primary shadow-xp-xs hover:bg-bg-secondary"},color:{brand:"",gray:"",error:"",warning:"",success:""},size:{md:"text-body-medium-3",lg:"text-body-medium-2"},align:{leading:"",trailing:""}},compoundVariants:[{theme:"light",color:"brand",className:"bg-utility-brand-50 text-utility-brand-700 ring-utility-brand-200 hover:bg-utility-brand-100"},{theme:"light",color:"gray",className:"bg-utility-gray-50 text-utility-gray-700 ring-utility-gray-200 hover:bg-utility-gray-100"},{theme:"light",color:"error",className:"bg-utility-error-50 text-utility-error-700 ring-utility-error-200 hover:bg-utility-error-100"},{theme:"light",color:"warning",className:"bg-utility-warning-50 text-utility-warning-700 ring-utility-warning-200 hover:bg-utility-warning-100"},{theme:"light",color:"success",className:"bg-utility-success-50 text-utility-success-700 ring-utility-success-200 hover:bg-utility-success-100"},{align:"leading",size:"md",className:"py-1 pl-1 pr-2"},{align:"leading",size:"lg",className:"py-1 pl-1 pr-2.5"},{align:"trailing",size:"md",className:"py-1 pl-2 pr-1"},{align:"trailing",size:"lg",className:"py-1 pl-2.5 pr-1"}],defaultVariants:{theme:"light",color:"brand",size:"md",align:"leading"}}),
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import*as i from'react';import {mergeProps}from'@base-ui/react/merge-props';import {useRender}from'@base-ui/react/use-render';import {cva}from'class-variance-authority';import {ArrowRightIcon}from'lucide-react';import {cn}from'@xploreu/lib/cn';import {jsx}from'react/jsx-runtime';var u=cva("inline-flex items-center size-max whitespace-nowrap shrink-0 overflow-hidden transition-colors cursor-pointer group/badge-group gap-2",{variants:{theme:{light:"rounded-xp-full ring-1 ring-inset",modern:"rounded-xp-card-base-md bg-bg-primary text-text-secondary ring-1 ring-inset ring-border-primary shadow-xp-xs hover:bg-bg-secondary"},color:{brand:"",gray:"",error:"",warning:"",success:""},size:{md:"text-body-medium-3",lg:"text-body-medium-2"},align:{leading:"",trailing:""}},compoundVariants:[{theme:"light",color:"brand",className:"bg-utility-brand-50 text-utility-brand-700 ring-utility-brand-200 hover:bg-utility-brand-100"},{theme:"light",color:"gray",className:"bg-utility-gray-50 text-utility-gray-700 ring-utility-gray-200 hover:bg-utility-gray-100"},{theme:"light",color:"error",className:"bg-utility-error-50 text-utility-error-700 ring-utility-error-200 hover:bg-utility-error-100"},{theme:"light",color:"warning",className:"bg-utility-warning-50 text-utility-warning-700 ring-utility-warning-200 hover:bg-utility-warning-100"},{theme:"light",color:"success",className:"bg-utility-success-50 text-utility-success-700 ring-utility-success-200 hover:bg-utility-success-100"},{align:"leading",size:"md",className:"py-1 pl-1 pr-2"},{align:"leading",size:"lg",className:"py-1 pl-1 pr-2.5"},{align:"trailing",size:"md",className:"py-1 pl-2 pr-1"},{align:"trailing",size:"lg",className:"py-1 pl-2.5 pr-1"}],defaultVariants:{theme:"light",color:"brand",size:"md",align:"leading"}}),l=i.createContext({theme:"light",color:"brand",size:"md"});function b({className:a,theme:e="light",color:t="brand",size:r="md",align:o="leading",render:p,children:s,...d}){let m={"data-slot":"badge-group","data-theme":e,"data-color":t,"data-size":r,"data-align":o,className:cn(u({theme:e,color:t,size:r,align:o}),a),children:s};return jsx(l.Provider,{value:{theme:e??"light",color:t??"brand",size:r??"md"},children:useRender({defaultTagName:"div",props:mergeProps(m,d),render:p,state:{slot:"badge-group",theme:e,color:t,size:r,align:o}})})}function P({className:a,children:e,...t}){let{theme:r,color:o,size:p}=i.useContext(l),s={brand:"ring-utility-brand-200 text-utility-brand-700",gray:"ring-utility-gray-200 text-utility-gray-700",error:"ring-utility-error-200 text-utility-error-700",warning:"ring-utility-warning-200 text-utility-warning-700",success:"ring-utility-success-200 text-utility-success-700"},d=cn("inline-flex items-center justify-center font-medium shrink-0",r==="light"&&["rounded-xp-full bg-bg-primary ring-1 ring-inset",s[o]||s.brand,p==="md"?"px-2 py-0.5":"px-2.5 py-0.5"],r==="modern"&&["rounded-xp-card-base-sm bg-bg-primary shadow-xp-xs ring-1 ring-inset ring-border-primary text-text-secondary",p==="md"?"gap-1 px-1.5 py-0.5":"gap-1.5 px-2 py-0.5"],a);return jsx("span",{"data-slot":"badge-group-addon",className:d,...t,children:e})}function h({className:a,children:e=jsx(ArrowRightIcon,{}),...t}){let{color:r}=i.useContext(l),o={brand:"text-utility-brand-500",gray:"text-utility-gray-500",error:"text-utility-error-500",warning:"text-utility-warning-500",success:"text-utility-success-500"};return jsx("span",{"data-slot":"badge-group-icon",className:cn("inline-flex items-center justify-center shrink-0 [&>svg]:size-4 [&>svg]:stroke-[2px] pointer-events-none transition-transform group-hover/badge-group:translate-x-0.5",o[r]||o.brand,a),...t,children:e})}function B({className:a,...e}){let{color:t}=i.useContext(l),r={brand:"bg-utility-brand-500 outline-utility-brand-100",gray:"bg-utility-gray-500 outline-utility-gray-100",error:"bg-utility-error-500 outline-utility-error-100",warning:"bg-utility-warning-500 outline-utility-warning-100",success:"bg-utility-success-500 outline-utility-success-100"};return jsx("span",{"data-slot":"badge-group-dot",className:cn("inline-block size-1.5 shrink-0 rounded-xp-full outline-2 -outline-offset-1",r[t]||r.brand,a),...e})}export{u as a,b,P as c,h as d,B as e};//# sourceMappingURL=chunk-OJD5A5W4.js.map
|
|
2
|
+
//# sourceMappingURL=chunk-OJD5A5W4.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/ui/badge-group.tsx"],"names":["badgeGroupVariants","cva","badgeGroupContext","BadgeGroup","className","theme","color","size","align","render","children","props","defaultProps","cn","jsx","useRender","mergeProps","BadgeGroupAddon","colorAddonMap","addonClasses","BadgeGroupIcon","ArrowRightIcon","iconColorMap","BadgeGroupDot","dotColorMap"],"mappings":"wRASA,IAAMA,EAAqBC,GAAAA,CACzB,uIAAA,CACA,CACE,QAAA,CAAU,CACR,KAAA,CAAO,CACL,KAAA,CAAO,mCAAA,CACP,MAAA,CAAQ,oIACV,CAAA,CACA,KAAA,CAAO,CACL,KAAA,CAAO,EAAA,CACP,IAAA,CAAM,EAAA,CACN,KAAA,CAAO,EAAA,CACP,QAAS,EAAA,CACT,OAAA,CAAS,EACX,CAAA,CACA,IAAA,CAAM,CACJ,GAAI,oBAAA,CACJ,EAAA,CAAI,oBACN,CAAA,CACA,KAAA,CAAO,CACL,QAAS,EAAA,CACT,QAAA,CAAU,EACZ,CACF,CAAA,CACA,gBAAA,CAAkB,CAEhB,CACE,KAAA,CAAO,OAAA,CACP,KAAA,CAAO,OAAA,CACP,SAAA,CAAW,8FACb,CAAA,CACA,CACE,KAAA,CAAO,OAAA,CACP,KAAA,CAAO,MAAA,CACP,UAAW,0FACb,CAAA,CACA,CACE,KAAA,CAAO,OAAA,CACP,KAAA,CAAO,QACP,SAAA,CAAW,8FACb,CAAA,CACA,CACE,KAAA,CAAO,OAAA,CACP,MAAO,SAAA,CACP,SAAA,CAAW,sGACb,CAAA,CACA,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import { mergeProps } from \"@base-ui/react/merge-props\"\r\nimport { useRender } from \"@base-ui/react/use-render\"\r\nimport { cva, type VariantProps } from \"class-variance-authority\"\r\nimport { ArrowRightIcon } from \"lucide-react\"\r\n\r\nimport { cn } from \"@xploreu/lib/cn\"\r\n\r\nconst badgeGroupVariants = cva(\r\n \"inline-flex items-center size-max whitespace-nowrap shrink-0 overflow-hidden transition-colors cursor-pointer group/badge-group gap-2\",\r\n {\r\n variants: {\r\n theme: {\r\n light: \"rounded-xp-full ring-1 ring-inset\",\r\n modern: \"rounded-xp-card-base-md bg-bg-primary text-text-secondary ring-1 ring-inset ring-border-primary shadow-xp-xs hover:bg-bg-secondary\",\r\n },\r\n color: {\r\n brand: \"\",\r\n gray: \"\",\r\n error: \"\",\r\n warning: \"\",\r\n success: \"\",\r\n },\r\n size: {\r\n md: \"text-body-medium-3\",\r\n lg: \"text-body-medium-2\",\r\n },\r\n align: {\r\n leading: \"\",\r\n trailing: \"\",\r\n },\r\n },\r\n compoundVariants: [\r\n // Light theme colors\r\n {\r\n theme: \"light\",\r\n color: \"brand\",\r\n className: \"bg-utility-brand-50 text-utility-brand-700 ring-utility-brand-200 hover:bg-utility-brand-100\",\r\n },\r\n {\r\n theme: \"light\",\r\n color: \"gray\",\r\n className: \"bg-utility-gray-50 text-utility-gray-700 ring-utility-gray-200 hover:bg-utility-gray-100\",\r\n },\r\n {\r\n theme: \"light\",\r\n color: \"error\",\r\n className: \"bg-utility-error-50 text-utility-error-700 ring-utility-error-200 hover:bg-utility-error-100\",\r\n },\r\n {\r\n theme: \"light\",\r\n color: \"warning\",\r\n className: \"bg-utility-warning-50 text-utility-warning-700 ring-utility-warning-200 hover:bg-utility-warning-100\",\r\n },\r\n {\r\n theme: \"light\",\r\n color: \"success\",\r\n className: \"bg-utility-success-50 text-utility-success-700 ring-utility-success-200 hover:bg-utility-success-100\",\r\n },\r\n\r\n // Size & Align combinations (Root padding matching exact Figma values)\r\n // Leading: Addon on the left\r\n {\r\n align: \"leading\",\r\n size: \"md\",\r\n className: \"py-1 pl-1 pr-2\",\r\n },\r\n {\r\n align: \"leading\",\r\n size: \"lg\",\r\n className: \"py-1 pl-1 pr-2.5\",\r\n },\r\n // Trailing: Addon on the right\r\n {\r\n align: \"trailing\",\r\n size: \"md\",\r\n className: \"py-1 pl-2 pr-1\",\r\n },\r\n {\r\n align: \"trailing\",\r\n size: \"lg\",\r\n className: \"py-1 pl-2.5 pr-1\",\r\n },\r\n ],\r\n defaultVariants: {\r\n theme: \"light\",\r\n color: \"brand\",\r\n size: \"md\",\r\n align: \"leading\",\r\n },\r\n }\r\n)\r\n\r\nconst badgeGroupContext = React.createContext<{\r\n theme: \"light\" | \"modern\"\r\n color: \"brand\" | \"gray\" | \"error\" | \"warning\" | \"success\"\r\n size: \"md\" | \"lg\"\r\n}>({\r\n theme: \"light\",\r\n color: \"brand\",\r\n size: \"md\",\r\n})\r\n\r\nexport interface BadgeGroupProps\r\n extends Omit<React.ComponentProps<\"div\">, \"color\">,\r\n VariantProps<typeof badgeGroupVariants> {\r\n}\r\n\r\nfunction BadgeGroup({\r\n className,\r\n theme = \"light\",\r\n color = \"brand\",\r\n size = \"md\",\r\n align = \"leading\",\r\n render,\r\n children,\r\n ...props\r\n}: BadgeGroupProps & useRender.ComponentProps<\"div\">) {\r\n const defaultProps = {\r\n \"data-slot\": \"badge-group\",\r\n \"data-theme\": theme,\r\n \"data-color\": color,\r\n \"data-size\": size,\r\n \"data-align\": align,\r\n className: cn(badgeGroupVariants({ theme, color, size, align }), className),\r\n children,\r\n }\r\n\r\n return (\r\n <badgeGroupContext.Provider value={{ theme: theme ?? \"light\", color: color ?? \"brand\", size: size ?? \"md\" }}>\r\n {useRender({\r\n defaultTagName: \"div\",\r\n props: mergeProps(defaultProps, props),\r\n render,\r\n state: {\r\n slot: \"badge-group\",\r\n theme,\r\n color,\r\n size,\r\n align,\r\n },\r\n })}\r\n </badgeGroupContext.Provider>\r\n )\r\n}\r\n\r\nexport interface BadgeGroupAddonProps extends React.ComponentProps<\"span\"> {\r\n children?: React.ReactNode\r\n}\r\n\r\nfunction BadgeGroupAddon({\r\n className,\r\n children,\r\n ...props\r\n}: BadgeGroupAddonProps) {\r\n const { theme, color, size } = React.useContext(badgeGroupContext)\r\n\r\n const colorAddonMap: Record<string, string> = {\r\n brand: \"ring-utility-brand-200 text-utility-brand-700\",\r\n gray: \"ring-utility-gray-200 text-utility-gray-700\",\r\n error: \"ring-utility-error-200 text-utility-error-700\",\r\n warning: \"ring-utility-warning-200 text-utility-warning-700\",\r\n success: \"ring-utility-success-200 text-utility-success-700\",\r\n }\r\n\r\n const addonClasses = cn(\r\n \"inline-flex items-center justify-center font-medium shrink-0\",\r\n theme === \"light\" && [\r\n \"rounded-xp-full bg-bg-primary ring-1 ring-inset\",\r\n colorAddonMap[color] || colorAddonMap.brand,\r\n size === \"md\" ? \"px-2 py-0.5\" : \"px-2.5 py-0.5\",\r\n ],\r\n theme === \"modern\" && [\r\n \"rounded-xp-card-base-sm bg-bg-primary shadow-xp-xs ring-1 ring-inset ring-border-primary text-text-secondary\",\r\n size === \"md\" ? \"gap-1 px-1.5 py-0.5\" : \"gap-1.5 px-2 py-0.5\",\r\n ],\r\n className\r\n )\r\n\r\n return (\r\n <span data-slot=\"badge-group-addon\" className={addonClasses} {...props}>\r\n {children}\r\n </span>\r\n )\r\n}\r\n\r\nexport interface BadgeGroupIconProps extends React.ComponentProps<\"span\"> {\r\n children?: React.ReactNode\r\n}\r\n\r\nfunction BadgeGroupIcon({\r\n className,\r\n children = <ArrowRightIcon />,\r\n ...props\r\n}: BadgeGroupIconProps) {\r\n const { color } = React.useContext(badgeGroupContext)\r\n\r\n const iconColorMap: Record<string, string> = {\r\n brand: \"text-utility-brand-500\",\r\n gray: \"text-utility-gray-500\",\r\n error: \"text-utility-error-500\",\r\n warning: \"text-utility-warning-500\",\r\n success: \"text-utility-success-500\",\r\n }\r\n\r\n return (\r\n <span\r\n data-slot=\"badge-group-icon\"\r\n className={cn(\r\n \"inline-flex items-center justify-center shrink-0 [&>svg]:size-4 [&>svg]:stroke-[2px] pointer-events-none transition-transform group-hover/badge-group:translate-x-0.5\",\r\n iconColorMap[color] || iconColorMap.brand,\r\n className\r\n )}\r\n {...props}\r\n >\r\n {children}\r\n </span>\r\n )\r\n}\r\n\r\nexport interface BadgeGroupDotProps extends React.ComponentProps<\"span\"> {\r\n}\r\n\r\nfunction BadgeGroupDot({\r\n className,\r\n ...props\r\n}: BadgeGroupDotProps) {\r\n const { color } = React.useContext(badgeGroupContext)\r\n\r\n const dotColorMap: Record<string, string> = {\r\n brand: \"bg-utility-brand-500 outline-utility-brand-100\",\r\n gray: \"bg-utility-gray-500 outline-utility-gray-100\",\r\n error: \"bg-utility-error-500 outline-utility-error-100\",\r\n warning: \"bg-utility-warning-500 outline-utility-warning-100\",\r\n success: \"bg-utility-success-500 outline-utility-success-100\",\r\n }\r\n\r\n return (\r\n <span\r\n data-slot=\"badge-group-dot\"\r\n className={cn(\r\n \"inline-block size-1.5 shrink-0 rounded-xp-full outline-2 -outline-offset-1\",\r\n dotColorMap[color] || dotColorMap.brand,\r\n className\r\n )}\r\n {...props}\r\n />\r\n )\r\n}\r\n\r\nexport {\r\n BadgeGroup,\r\n BadgeGroupAddon,\r\n BadgeGroupIcon,\r\n BadgeGroupDot,\r\n badgeGroupVariants,\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/ui/badge-group.tsx"],"names":["badgeGroupVariants","cva","badgeGroupContext","BadgeGroup","className","theme","color","size","align","render","children","props","defaultProps","cn","jsx","useRender","mergeProps","BadgeGroupAddon","colorAddonMap","addonClasses","BadgeGroupIcon","ArrowRightIcon","iconColorMap","BadgeGroupDot","dotColorMap"],"mappings":"wRASA,IAAMA,EAAqBC,GAAAA,CACzB,uIAAA,CACA,CACE,QAAA,CAAU,CACR,KAAA,CAAO,CACL,KAAA,CAAO,mCAAA,CACP,MAAA,CAAQ,oIACV,CAAA,CACA,KAAA,CAAO,CACL,K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J,CAKA,SAASa,CAAAA,CAAc,CACrB,SAAA,CAAAnB,CAAAA,CACA,GAAGO,CACL,CAAA,CAAuB,CACrB,GAAM,CAAE,KAAA,CAAAL,CAAM,EAAU,CAAA,CAAA,UAAA,CAAWJ,CAAiB,CAAA,CAE9CsB,CAAAA,CAAsC,CAC1C,KAAA,CAAO,iDACP,IAAA,CAAM,8CAAA,CACN,KAAA,CAAO,gDAAA,CACP,OAAA,CAAS,oDAAA,CACT,QAAS,oDACX,CAAA,CAEA,OACEV,GAAAA,CAAC,MAAA,CAAA,CACC,WAAA,CAAU,kBACV,SAAA,CAAWD,EAAAA,CACT,4EAAA,CACAW,CAAAA,CAAYlB,CAAK,CAAA,EAAKkB,CAAAA,CAAY,KAAA,CAClCpB,CACF,CAAA,CACC,GAAGO,CAAAA,CACN,CAEJ","file":"chunk-OJD5A5W4.js","sourcesContent":["import * as React from \"react\"\r\n\r\nimport { mergeProps } from \"@base-ui/react/merge-props\"\r\nimport { useRender } from \"@base-ui/react/use-render\"\r\nimport { cva, type VariantProps } from \"class-variance-authority\"\r\nimport { ArrowRightIcon } from \"lucide-react\"\r\n\r\nimport { cn } from \"@xploreu/lib/cn\"\r\n\r\nconst badgeGroupVariants = cva(\r\n \"inline-flex items-center size-max whitespace-nowrap shrink-0 overflow-hidden transition-colors cursor-pointer group/badge-group gap-2\",\r\n {\r\n variants: {\r\n theme: {\r\n light: \"rounded-xp-full ring-1 ring-inset\",\r\n modern: \"rounded-xp-card-base-md bg-bg-primary text-text-secondary ring-1 ring-inset ring-border-primary shadow-xp-xs hover:bg-bg-secondary\",\r\n },\r\n color: {\r\n brand: \"\",\r\n gray: \"\",\r\n error: \"\",\r\n warning: \"\",\r\n success: \"\",\r\n },\r\n size: {\r\n md: \"text-body-medium-3\",\r\n lg: \"text-body-medium-2\",\r\n },\r\n align: {\r\n leading: \"\",\r\n trailing: \"\",\r\n },\r\n },\r\n compoundVariants: [\r\n // Light theme colors\r\n {\r\n theme: \"light\",\r\n color: \"brand\",\r\n className: \"bg-utility-brand-50 text-utility-brand-700 ring-utility-brand-200 hover:bg-utility-brand-100\",\r\n },\r\n {\r\n theme: \"light\",\r\n color: \"gray\",\r\n className: \"bg-utility-gray-50 text-utility-gray-700 ring-utility-gray-200 hover:bg-utility-gray-100\",\r\n },\r\n {\r\n theme: \"light\",\r\n color: \"error\",\r\n className: \"bg-utility-error-50 text-utility-error-700 ring-utility-error-200 hover:bg-utility-error-100\",\r\n },\r\n {\r\n theme: \"light\",\r\n color: \"warning\",\r\n className: \"bg-utility-warning-50 text-utility-warning-700 ring-utility-warning-200 hover:bg-utility-warning-100\",\r\n },\r\n {\r\n theme: \"light\",\r\n color: \"success\",\r\n className: \"bg-utility-success-50 text-utility-success-700 ring-utility-success-200 hover:bg-utility-success-100\",\r\n },\r\n\r\n // Size & Align combinations (Root padding matching exact Figma values)\r\n // Leading: Addon on the left\r\n {\r\n align: \"leading\",\r\n size: \"md\",\r\n className: \"py-1 pl-1 pr-2\",\r\n },\r\n {\r\n align: \"leading\",\r\n size: \"lg\",\r\n className: \"py-1 pl-1 pr-2.5\",\r\n },\r\n // Trailing: Addon on the right\r\n {\r\n align: \"trailing\",\r\n size: \"md\",\r\n className: \"py-1 pl-2 pr-1\",\r\n },\r\n {\r\n align: \"trailing\",\r\n size: \"lg\",\r\n className: \"py-1 pl-2.5 pr-1\",\r\n },\r\n ],\r\n defaultVariants: {\r\n theme: \"light\",\r\n color: \"brand\",\r\n size: \"md\",\r\n align: \"leading\",\r\n },\r\n }\r\n)\r\n\r\nconst badgeGroupContext = React.createContext<{\r\n theme: \"light\" | \"modern\"\r\n color: \"brand\" | \"gray\" | \"error\" | \"warning\" | \"success\"\r\n size: \"md\" | \"lg\"\r\n}>({\r\n theme: \"light\",\r\n color: \"brand\",\r\n size: \"md\",\r\n})\r\n\r\nexport interface BadgeGroupProps\r\n extends Omit<React.ComponentProps<\"div\">, \"color\">,\r\n VariantProps<typeof badgeGroupVariants> {\r\n}\r\n\r\nfunction BadgeGroup({\r\n className,\r\n theme = \"light\",\r\n color = \"brand\",\r\n size = \"md\",\r\n align = \"leading\",\r\n render,\r\n children,\r\n ...props\r\n}: BadgeGroupProps & useRender.ComponentProps<\"div\">) {\r\n const defaultProps = {\r\n \"data-slot\": \"badge-group\",\r\n \"data-theme\": theme,\r\n \"data-color\": color,\r\n \"data-size\": size,\r\n \"data-align\": align,\r\n className: cn(badgeGroupVariants({ theme, color, size, align }), className),\r\n children,\r\n }\r\n\r\n return (\r\n <badgeGroupContext.Provider value={{ theme: theme ?? \"light\", color: color ?? \"brand\", size: size ?? \"md\" }}>\r\n {useRender({\r\n defaultTagName: \"div\",\r\n props: mergeProps(defaultProps, props),\r\n render,\r\n state: {\r\n slot: \"badge-group\",\r\n theme,\r\n color,\r\n size,\r\n align,\r\n },\r\n })}\r\n </badgeGroupContext.Provider>\r\n )\r\n}\r\n\r\nexport interface BadgeGroupAddonProps extends React.ComponentProps<\"span\"> {\r\n children?: React.ReactNode\r\n}\r\n\r\nfunction BadgeGroupAddon({\r\n className,\r\n children,\r\n ...props\r\n}: BadgeGroupAddonProps) {\r\n const { theme, color, size } = React.useContext(badgeGroupContext)\r\n\r\n const colorAddonMap: Record<string, string> = {\r\n brand: \"ring-utility-brand-200 text-utility-brand-700\",\r\n gray: \"ring-utility-gray-200 text-utility-gray-700\",\r\n error: \"ring-utility-error-200 text-utility-error-700\",\r\n warning: \"ring-utility-warning-200 text-utility-warning-700\",\r\n success: \"ring-utility-success-200 text-utility-success-700\",\r\n }\r\n\r\n const addonClasses = cn(\r\n \"inline-flex items-center justify-center font-medium shrink-0\",\r\n theme === \"light\" && [\r\n \"rounded-xp-full bg-bg-primary ring-1 ring-inset\",\r\n colorAddonMap[color] || colorAddonMap.brand,\r\n size === \"md\" ? \"px-2 py-0.5\" : \"px-2.5 py-0.5\",\r\n ],\r\n theme === \"modern\" && [\r\n \"rounded-xp-card-base-sm bg-bg-primary shadow-xp-xs ring-1 ring-inset ring-border-primary text-text-secondary\",\r\n size === \"md\" ? \"gap-1 px-1.5 py-0.5\" : \"gap-1.5 px-2 py-0.5\",\r\n ],\r\n className\r\n )\r\n\r\n return (\r\n <span data-slot=\"badge-group-addon\" className={addonClasses} {...props}>\r\n {children}\r\n </span>\r\n )\r\n}\r\n\r\nexport interface BadgeGroupIconProps extends React.ComponentProps<\"span\"> {\r\n children?: React.ReactNode\r\n}\r\n\r\nfunction BadgeGroupIcon({\r\n className,\r\n children = <ArrowRightIcon />,\r\n ...props\r\n}: BadgeGroupIconProps) {\r\n const { color } = React.useContext(badgeGroupContext)\r\n\r\n const iconColorMap: Record<string, string> = {\r\n brand: \"text-utility-brand-500\",\r\n gray: \"text-utility-gray-500\",\r\n error: \"text-utility-error-500\",\r\n warning: \"text-utility-warning-500\",\r\n success: \"text-utility-success-500\",\r\n }\r\n\r\n return (\r\n <span\r\n data-slot=\"badge-group-icon\"\r\n className={cn(\r\n \"inline-flex items-center justify-center shrink-0 [&>svg]:size-4 [&>svg]:stroke-[2px] pointer-events-none transition-transform group-hover/badge-group:translate-x-0.5\",\r\n iconColorMap[color] || iconColorMap.brand,\r\n className\r\n )}\r\n {...props}\r\n >\r\n {children}\r\n </span>\r\n )\r\n}\r\n\r\nexport interface BadgeGroupDotProps extends React.ComponentProps<\"span\"> {\r\n}\r\n\r\nfunction BadgeGroupDot({\r\n className,\r\n ...props\r\n}: BadgeGroupDotProps) {\r\n const { color } = React.useContext(badgeGroupContext)\r\n\r\n const dotColorMap: Record<string, string> = {\r\n brand: \"bg-utility-brand-500 outline-utility-brand-100\",\r\n gray: \"bg-utility-gray-500 outline-utility-gray-100\",\r\n error: \"bg-utility-error-500 outline-utility-error-100\",\r\n warning: \"bg-utility-warning-500 outline-utility-warning-100\",\r\n success: \"bg-utility-success-500 outline-utility-success-100\",\r\n }\r\n\r\n return (\r\n <span\r\n data-slot=\"badge-group-dot\"\r\n className={cn(\r\n \"inline-block size-1.5 shrink-0 rounded-xp-full outline-2 -outline-offset-1\",\r\n dotColorMap[color] || dotColorMap.brand,\r\n className\r\n )}\r\n {...props}\r\n />\r\n )\r\n}\r\n\r\nexport {\r\n BadgeGroup,\r\n BadgeGroupAddon,\r\n BadgeGroupIcon,\r\n BadgeGroupDot,\r\n badgeGroupVariants,\r\n}\r\n"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import {b as b$1,c,d}from'./chunk-REBKHJ4V.js';import'react';import {cva}from'class-variance-authority';import {cn}from'@xploreu/lib/cn';import {jsxs,jsx}from'react/jsx-runtime';var b=cva("inline-flex items-center justify-center gap-1.5 rounded-md font-medium text-text-secondary hover:text-text-primary disabled:pointer-events-none disabled:opacity-50 data-[pressed]:text-text-brand-tertiary data-[pressed=true]:text-text-brand-tertiary [&_svg]:pointer-events-none [&_svg]:shrink-0 focus-visible:ring-2 focus-visible:ring-border-brand outline-none transition-[color,background-color,box-shadow] duration-150 ease-in-out whitespace-nowrap cursor-pointer select-none",{variants:{variant:{default:"bg-transparent",outline:"border border-border-secondary bg-transparent"},size:{default:"h-9 px-2.5 min-w-9 text-body-regular-2 [&_svg]:size-4",sm:"h-8 px-2 min-w-8 text-body-regular-3 [&_svg]:size-3.5",lg:"h-10 px-3 min-w-10 text-body-regular-1 [&_svg]:size-4.5",icon:"size-8 p-1.5 text-label-regular-4 [&_svg]:size-4","icon-sm":"size-7 p-1 text-label-regular-4 [&_svg]:size-3.5"}},defaultVariants:{variant:"default",size:"default"}});function y({className:o,variant:s,size:a,pressed:g,defaultPressed:n,onPressedChange:l,disabled:d$1,children:p,...m}){return jsxs(b$1,{pressed:g,defaultPressed:n,onPressedChange:l,disabled:d$1,className:"relative",children:[jsx(c,{className:"bg-bg-brand-primary rounded-md"}),jsx(d,{className:cn(b({variant:s,size:a,className:o})),...m,children:p})]})}export{b as a,y as b};//# sourceMappingURL=chunk-OLQXHFH4.js.map
|
|
2
|
+
//# sourceMappingURL=chunk-OLQXHFH4.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/ui/toggle.tsx"],"names":["toggleVariants","cva","Toggle","className","variant","size","pressed","defaultPressed","onPressedChange","disabled","children","props","jsxs","jsx","ToggleHighlight","ToggleItem","cn"],"mappings":"kLAaA,IAAMA,CAAAA,CAAiBC,GAAAA,CACrB,8dAAA,CACA,CACE,QAAA,CAAU,CACR,OAAA,CAAS,CACP,OAAA,CAAS,gBAAA,CACT,OAAA,CACE,+CACJ,EACA,IAAA,CAAM,CACJ,OAAA,CAAS,uDAAA,CACT,EAAA,CAAI,uDAAA,CACJ,EAAA,CAAI,yDAAA,CACJ,IAAA,CAAM,kDAAA,CACN,SAAA,CAAW,kDACb,CACF,CAAA,CACA,gBAAiB,CACf,OAAA,CAAS,SAAA,CACT,IAAA,CAAM,SACR,CACF,CACF,EAMA,SAASC,CAAAA,CAAO,CACd,SAAA,CAAAC,CAAAA,CACA,OAAA,CAAAC,EACA,IAAA,CAAAC,CAAAA,CACA,OAAA,CAAAC,CAAAA,CACA,cAAA,CAAAC,CAAAA,CACA,eAAA,CAAAC,CAAAA,CACA,QAAA,CAAAC,GAAAA,CACA,QAAA,CAAAC,CAAAA,CACA,GAAGC,CACL,EAAgB,CACd,OACEC,IAAAA,CAACV,GAAAA,CAAA,CACC,OAAA,CAASI,CAAAA,CACT,cAAA,CAAgBC,CAAAA,CAChB,eAAA,CAAiBC,CAAAA,CACjB,QAAA,CAAUC,GAAAA,CACV,SAAA,CAAU,WAEV,QAAA,CAAA,CAAAI,GAAAA,CAACC,CAAAA,CAAA,CAAyB,SAAA,CAAU,gCAAA,CAAiC,CAAA,CACrED,GAAAA,CAACE,CAAAA,CAAA,CACC,SAAA,CAAWC,EAAAA,CAAGhB,CAAAA,CAAe,CAAE,OAAA,CAAAI,CAAAA,CAAS,IAAA,CAAAC,CAAAA,CAAM,SAAA,CAAAF,CAAU,CAAC,CAAC,CAAA,CACzD,GAAGQ,CAAAA,CAEH,QAAA,CAAAD,CAAAA,CACH,CAAA,CAAA,CACF,CAEJ","file":"chunk-OLQXHFH4.js","sourcesContent":["\"use client\"\r\n\r\nimport * as React from \"react\"\r\nimport { cva, type VariantProps } from \"class-variance-authority\"\r\nimport {\r\n Toggle as TogglePrimitive,\r\n ToggleItem as ToggleItemPrimitive,\r\n ToggleHighlight as ToggleHighlightPrimitive,\r\n type ToggleProps as TogglePrimitiveProps,\r\n type ToggleItemProps as ToggleItemPrimitiveProps,\r\n} from \"../primitives/toggle\"\r\nimport { cn } from \"@xploreu/lib/cn\"\r\n\r\nconst toggleVariants = cva(\r\n \"inline-flex items-center justify-center gap-1.5 rounded-md font-medium text-text-secondary hover:text-text-primary disabled:pointer-events-none disabled:opacity-50 data-[pressed]:text-text-brand-tertiary data-[pressed=true]:text-text-brand-tertiary [&_svg]:pointer-events-none [&_svg]:shrink-0 focus-visible:ring-2 focus-visible:ring-border-brand outline-none transition-[color,background-color,box-shadow] duration-150 ease-in-out whitespace-nowrap cursor-pointer select-none\",\r\n {\r\n variants: {\r\n variant: {\r\n default: \"bg-transparent\",\r\n outline:\r\n \"border border-border-secondary bg-transparent\",\r\n },\r\n size: {\r\n default: \"h-9 px-2.5 min-w-9 text-body-regular-2 [&_svg]:size-4\",\r\n sm: \"h-8 px-2 min-w-8 text-body-regular-3 [&_svg]:size-3.5\",\r\n lg: \"h-10 px-3 min-w-10 text-body-regular-1 [&_svg]:size-4.5\",\r\n icon: \"size-8 p-1.5 text-label-regular-4 [&_svg]:size-4\",\r\n \"icon-sm\": \"size-7 p-1 text-label-regular-4 [&_svg]:size-3.5\",\r\n },\r\n },\r\n defaultVariants: {\r\n variant: \"default\",\r\n size: \"default\",\r\n },\r\n }\r\n)\r\n\r\ntype ToggleProps = TogglePrimitiveProps &\r\n ToggleItemPrimitiveProps &\r\n VariantProps<typeof toggleVariants>\r\n\r\nfunction Toggle({\r\n className,\r\n variant,\r\n size,\r\n pressed,\r\n defaultPressed,\r\n onPressedChange,\r\n disabled,\r\n children,\r\n ...props\r\n}: ToggleProps) {\r\n return (\r\n <TogglePrimitive\r\n pressed={pressed}\r\n defaultPressed={defaultPressed}\r\n onPressedChange={onPressedChange}\r\n disabled={disabled}\r\n className=\"relative\"\r\n >\r\n <ToggleHighlightPrimitive className=\"bg-bg-brand-primary rounded-md\" />\r\n <ToggleItemPrimitive\r\n className={cn(toggleVariants({ variant, size, className }))}\r\n {...props}\r\n >\r\n {children}\r\n </ToggleItemPrimitive>\r\n </TogglePrimitive>\r\n )\r\n}\r\n\r\nexport { Toggle, toggleVariants, type ToggleProps }\r\n"]}
|