@yamada-ui/react 2.2.1-dev-20260511135752 → 2.2.1-dev-20260511183442
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/cjs/components/chart/use-cartesian-chart.cjs +7 -28
- package/dist/cjs/components/chart/use-cartesian-chart.cjs.map +1 -1
- package/dist/cjs/components/chart/use-polar-chart.cjs +9 -36
- package/dist/cjs/components/chart/use-polar-chart.cjs.map +1 -1
- package/dist/cjs/components/popover/use-popover.cjs +14 -4
- package/dist/cjs/components/popover/use-popover.cjs.map +1 -1
- package/dist/cjs/hooks/use-combobox/index.cjs +32 -31
- package/dist/cjs/hooks/use-combobox/index.cjs.map +1 -1
- package/dist/esm/components/chart/use-cartesian-chart.js +7 -28
- package/dist/esm/components/chart/use-cartesian-chart.js.map +1 -1
- package/dist/esm/components/chart/use-polar-chart.js +9 -36
- package/dist/esm/components/chart/use-polar-chart.js.map +1 -1
- package/dist/esm/components/popover/use-popover.js +14 -4
- package/dist/esm/components/popover/use-popover.js.map +1 -1
- package/dist/esm/hooks/use-combobox/index.js +32 -31
- package/dist/esm/hooks/use-combobox/index.js.map +1 -1
- package/dist/types/components/accordion/accordion.style.d.ts +1 -1
- package/dist/types/components/autocomplete/autocomplete.style.d.ts +1 -1
- package/dist/types/components/breadcrumb/breadcrumb.style.d.ts +1 -1
- package/dist/types/components/calendar/calendar.style.d.ts +2 -2
- package/dist/types/components/carousel/carousel.style.d.ts +2 -2
- package/dist/types/components/chart/cartesian-chart.style.d.ts +1 -1
- package/dist/types/components/chart/polar-chart.style.d.ts +1 -1
- package/dist/types/components/checkbox-card/checkbox-card.d.ts +3 -3
- package/dist/types/components/checkbox-card/checkbox-card.style.d.ts +1 -1
- package/dist/types/components/color-picker/color-picker.style.d.ts +1 -1
- package/dist/types/components/data-list/data-list.style.d.ts +1 -1
- package/dist/types/components/empty-state/empty-state.style.d.ts +2 -2
- package/dist/types/components/flip/flip.d.ts +1 -1
- package/dist/types/components/flip/flip.style.d.ts +1 -1
- package/dist/types/components/list/list.style.d.ts +2 -2
- package/dist/types/components/menu/menu.style.d.ts +2 -2
- package/dist/types/components/native-accordion/native-accordion.style.d.ts +2 -2
- package/dist/types/components/notice/notice.style.d.ts +1 -1
- package/dist/types/components/number-input/number-input.style.d.ts +1 -1
- package/dist/types/components/pagination/pagination.style.d.ts +1 -1
- package/dist/types/components/radio-card/radio-card.d.ts +3 -3
- package/dist/types/components/radio-card/radio-card.style.d.ts +1 -1
- package/dist/types/components/rating/rating.style.d.ts +2 -2
- package/dist/types/components/reorder/reorder.style.d.ts +1 -1
- package/dist/types/components/resizable/resizable.style.d.ts +2 -2
- package/dist/types/components/segmented-control/segmented-control.style.d.ts +2 -2
- package/dist/types/components/steps/steps.style.d.ts +1 -1
- package/dist/types/components/timeline/timeline.d.ts +1 -1
- package/dist/types/components/timeline/timeline.style.d.ts +1 -1
- package/dist/types/components/tree/tree.style.d.ts +1 -1
- package/dist/types/providers/i18n-provider/i18n-provider.d.ts +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["createContext"],"sources":["../../../../src/hooks/use-combobox/index.tsx"],"sourcesContent":["\"use client\"\n\nimport type {\n JSXElementConstructor,\n KeyboardEvent,\n MouseEvent,\n ReactNode,\n RefObject,\n} from \"react\"\nimport type { UsePopoverProps } from \"../../components/popover\"\nimport type { HTMLProps, PropGetter, SimpleDirection } from \"../../core\"\nimport type { Descendant } from \"../use-descendants\"\nimport type { UseDisclosureProps } from \"../use-disclosure\"\nimport { useCallback, useId, useMemo, useRef } from \"react\"\nimport scrollIntoView from \"scroll-into-view-if-needed\"\nimport { usePopoverProps } from \"../../components/popover\"\nimport { mergeProps, useEnvironment } from \"../../core\"\nimport {\n ariaAttr,\n createContext,\n cx,\n dataAttr,\n findChild,\n getValidChildren,\n handlerAll,\n isComposing,\n isSomeElement,\n isUndefined,\n mergeRefs,\n runKeyAction,\n useUpdateEffect,\n} from \"../../utils\"\nimport { createDescendants } from \"../use-descendants\"\nimport { useDisclosure } from \"../use-disclosure\"\n\ninterface ComboboxSharedItem extends Omit<HTMLProps, \"children\" | \"value\"> {\n label: ReactNode\n}\n\nexport interface ComboboxItemWithValue extends ComboboxSharedItem {\n query?: string\n value?: string\n}\n\nexport interface ComboboxItemWithItems extends ComboboxSharedItem {\n items: ComboboxItemWithValue[]\n}\n\nexport type ComboboxItem = ComboboxItemWithItems | ComboboxItemWithValue\n\nexport interface CreateComboboxItemOptions {\n Group: JSXElementConstructor<any>\n Label: JSXElementConstructor<any>\n Option: JSXElementConstructor<any>\n}\n\nexport const createComboboxItem = (\n children: ReactNode,\n { Group, Label, Option }: CreateComboboxItemOptions,\n) => {\n const validChildren = getValidChildren(children)\n\n return validChildren\n .filter(\n ({ type }) => isSomeElement(type, Option) || isSomeElement(type, Group),\n )\n .map(({ type, props }) => {\n if (isSomeElement(type, Option)) {\n return { ...props, label: props.children }\n } else {\n const validChildren = getValidChildren(props.children)\n const label = findChild(validChildren, Label)\n\n return {\n ...props,\n items: validChildren\n .filter(({ type }) => isSomeElement(type, Option))\n .map(({ props }) => ({ ...props, label: props.children })),\n label: label?.props.children ?? props.label,\n }\n }\n })\n}\n\nexport interface CreateComboboxChildrenOptions {\n Group: JSXElementConstructor<any>\n Option: JSXElementConstructor<any>\n Empty?: JSXElementConstructor<any>\n}\n\nexport const createComboboxChildren = (\n items: ComboboxItem[],\n { Empty, Group, Option }: CreateComboboxChildrenOptions,\n) => {\n return items.map((item, index) => {\n if (\"data-empty\" in item && Empty) {\n const { label, ...rest } = item\n\n return (\n <Empty key={index} {...rest}>\n {label}\n </Empty>\n )\n } else if (\"items\" in item) {\n const { items, label, ...rest } = item\n\n return (\n <Group key={index} label={label} {...rest}>\n {items.map(({ label, ...rest }, index) => (\n <Option key={index} {...rest}>\n {label}\n </Option>\n ))}\n </Group>\n )\n } else {\n const { label, ...rest } = item\n\n return (\n <Option key={index} {...rest}>\n {label}\n </Option>\n )\n }\n })\n}\n\nexport interface ComboboxDescendantProps {\n id: string\n closeOnSelect?: boolean\n value?: string\n}\nexport type ComboboxDescendant = Descendant<\n HTMLDivElement,\n ComboboxDescendantProps\n>\n\nconst {\n DescendantsContext: ComboboxDescendantsContext,\n useDescendant: useComboboxDescendant,\n useDescendantRegister: useComboboxDescendantRegister,\n useDescendants: useComboboxDescendants,\n} = createDescendants<HTMLDivElement, ComboboxDescendantProps>()\n\nexport {\n ComboboxDescendantsContext,\n useComboboxDescendant,\n useComboboxDescendantRegister,\n useComboboxDescendants,\n}\n\ninterface ComboboxContext extends Pick<\n UseComboboxReturn,\n \"onActiveDescendant\" | \"onClose\" | \"onSelect\"\n> {}\n\nconst [ComboboxContext, useComboboxContext] = createContext<ComboboxContext>({\n name: \"ComboboxContext\",\n})\n\ninterface ComboboxGroupContext extends Pick<\n UseComboboxGroupReturn,\n \"getLabelProps\"\n> {}\n\nconst [ComboboxGroupContext, useComboboxGroupContext] =\n createContext<ComboboxGroupContext>({\n name: \"ComboboxGroupContext\",\n })\n\nexport {\n ComboboxContext,\n ComboboxGroupContext,\n useComboboxContext,\n useComboboxGroupContext,\n}\n\nexport interface UseComboboxProps\n extends\n Omit<HTMLProps, \"onChange\">,\n Omit<UseDisclosureProps, \"timing\">,\n Omit<\n UsePopoverProps,\n \"autoFocus\" | \"initialFocusRef\" | \"modal\" | \"transform\" | \"updateRef\"\n > {\n /**\n * If `true`, the list element will be closed when value is selected.\n *\n * @default true\n */\n closeOnSelect?: boolean\n /**\n * If `true`, the combobox will be disabled.\n *\n * @default false\n */\n disabled?: boolean\n /**\n * The value to focus on when the combobox is opened.\n */\n initialFocusValue?: string\n /**\n * If `true`, the combobox will be opened when click on the field.\n *\n * @default true\n */\n openOnClick?: boolean\n /**\n * If `true`, the combobox will be opened when enter is pressed.\n *\n * @default true\n */\n openOnEnter?: boolean\n /**\n * If `true`, the combobox will be opened when space is pressed.\n *\n * @default true\n */\n openOnSpace?: boolean\n /**\n * If `true`, the combobox will be readonly.\n *\n * @default false\n */\n readOnly?: boolean\n /**\n * The `ref` of the element that should receive focus when selected.\n */\n selectFocusRef?: RefObject<HTMLElement | null>\n /**\n * If `true`, the item will be selected when space is pressed.\n *\n * @default true\n */\n selectOnSpace?: boolean\n /**\n * The callback invoked when value is selected.\n */\n onChange?: (value: string) => void\n}\n\nexport const useCombobox = (props: UseComboboxProps = {}) => {\n const [\n { matchWidth = true, ...popoverProps },\n {\n \"aria-label\": ariaLabelProp,\n \"aria-labelledby\": ariaLabelledbyProp,\n closeOnSelect: closeOnSelectProp = true,\n defaultOpen,\n disabled,\n initialFocusValue,\n open: openProp,\n openOnClick = true,\n openOnEnter = true,\n openOnSpace = true,\n readOnly,\n selectFocusRef,\n selectOnSpace = true,\n onChange: onChangeProp,\n onClose: onCloseProp,\n onOpen: onOpenProp,\n ...rest\n },\n ] = usePopoverProps(props, [\n \"disabled\",\n \"open\",\n \"defaultOpen\",\n \"onOpen\",\n \"onClose\",\n \"openOnClick\",\n ])\n const { getWindow } = useEnvironment()\n const interactive = !(readOnly || disabled)\n const triggerRef = useRef<HTMLDivElement>(null)\n const contentRef = useRef<HTMLDivElement>(null)\n const contentId = useId()\n const descendants = useComboboxDescendants()\n const { open, onClose, onOpen } = useDisclosure({\n defaultOpen,\n open: openProp,\n onClose: onCloseProp,\n onOpen: onOpenProp,\n })\n const activeDescendant = useRef<ComboboxDescendant | null>(null)\n const mergedPopoverProps = useMemo<UsePopoverProps>(\n () => ({\n autoFocus: false,\n matchWidth,\n openOnClick: false,\n ...popoverProps,\n disabled: !interactive,\n open,\n onClose,\n onOpen,\n }),\n [interactive, matchWidth, onClose, onOpen, open, popoverProps],\n )\n\n const onSelect = useCallback(\n (value?: string, closeOnSelect = closeOnSelectProp) => {\n const ref = selectFocusRef ?? triggerRef\n\n ref.current?.focus()\n\n if (!interactive || isUndefined(value)) return\n\n onChangeProp?.(value)\n\n if (!closeOnSelect) return\n\n onClose()\n },\n [closeOnSelectProp, interactive, onChangeProp, onClose, selectFocusRef],\n )\n\n const onScrollIntoView = useCallback(\n (descendant?: ComboboxDescendant, block: SimpleDirection = \"start\") => {\n if (!contentRef.current || !descendant) return\n\n const style = getWindow()?.getComputedStyle(contentRef.current)\n const padding =\n block === \"start\" ? style?.paddingBlockStart : style?.paddingBlockEnd\n const value = parseInt(padding ?? \"0px\")\n\n scrollIntoView(descendant.node, {\n behavior: (actions) =>\n actions.forEach(({ el, top }) => {\n el.scrollTop = block === \"start\" ? top - value : top + value\n }),\n block,\n boundary: contentRef.current,\n inline: \"nearest\",\n scrollMode: \"if-needed\",\n })\n },\n [getWindow],\n )\n\n const onActiveDescendant = useCallback(\n (descendant?: ComboboxDescendant) => {\n if (!triggerRef.current || !descendant || disabled) return\n\n triggerRef.current.setAttribute(\"aria-activedescendant\", descendant.id)\n\n activeDescendant.current = descendant\n\n descendants.active(descendant)\n },\n [descendants, disabled],\n )\n\n const onOpenWithActiveDescendant = useCallback(\n (\n getFallbackDescendant: () => ComboboxDescendant | undefined,\n block: SimpleDirection = \"start\",\n ) => {\n onOpen()\n\n setTimeout(() => {\n if (!initialFocusValue) {\n const descendant = getFallbackDescendant()\n\n onActiveDescendant(descendant)\n onScrollIntoView(descendant, block)\n } else {\n const values = descendants.values()\n const descendant =\n values.find(({ value }) => initialFocusValue === value) ??\n getFallbackDescendant()\n\n onActiveDescendant(descendant)\n onScrollIntoView(descendant, block)\n }\n })\n },\n [\n descendants,\n initialFocusValue,\n onActiveDescendant,\n onOpen,\n onScrollIntoView,\n ],\n )\n\n const onClick = useCallback(\n (ev: MouseEvent<HTMLDivElement>) => {\n if (disabled) return\n\n ev.preventDefault()\n\n if (!open) {\n if (openOnClick)\n onOpenWithActiveDescendant(descendants.enabledFirstValue)\n } else {\n onClose()\n }\n },\n [\n descendants,\n disabled,\n onClose,\n onOpenWithActiveDescendant,\n open,\n openOnClick,\n ],\n )\n\n const onKeyDown = useCallback(\n (ev: KeyboardEvent<HTMLDivElement>) => {\n if (disabled || isComposing(ev)) return\n\n runKeyAction(\n ev,\n {\n ArrowDown: (ev) => {\n ev.preventDefault()\n\n if (!open) {\n onOpenWithActiveDescendant(descendants.enabledFirstValue)\n } else if (activeDescendant.current) {\n const descendant = descendants.enabledNextValue(\n activeDescendant.current,\n )\n\n onActiveDescendant(descendant)\n\n onScrollIntoView(\n descendant,\n descendant?.recurred ? \"start\" : \"end\",\n )\n } else {\n const descendant = descendants.enabledFirstValue()\n\n onActiveDescendant(descendant)\n\n onScrollIntoView(descendant)\n }\n },\n ArrowUp: (ev) => {\n ev.preventDefault()\n\n if (!open) {\n onOpenWithActiveDescendant(descendants.enabledLastValue, \"end\")\n } else if (activeDescendant.current) {\n const descendant = descendants.enabledPrevValue(\n activeDescendant.current,\n )\n\n onActiveDescendant(descendant)\n\n onScrollIntoView(\n descendant,\n descendant?.recurred ? \"end\" : \"start\",\n )\n } else {\n const descendant = descendants.enabledLastValue()\n\n onActiveDescendant(descendant)\n\n onScrollIntoView(descendant, \"end\")\n }\n },\n End: (ev) => {\n ev.preventDefault()\n\n if (!open) return\n\n const descendant = descendants.enabledLastValue()\n\n onActiveDescendant(descendant)\n\n onScrollIntoView(descendant, \"end\")\n },\n Enter: (ev) => {\n if (!open) {\n if (!openOnEnter) return\n\n ev.preventDefault()\n\n onOpenWithActiveDescendant(descendants.enabledFirstValue)\n } else {\n if (!activeDescendant.current) return\n\n ev.preventDefault()\n\n const { closeOnSelect, value } = activeDescendant.current\n\n onSelect(value, closeOnSelect)\n }\n },\n Home: (ev) => {\n if (!open) return\n\n ev.preventDefault()\n\n const descendant = descendants.enabledFirstValue()\n\n onActiveDescendant(descendant)\n\n onScrollIntoView(descendant)\n },\n Space: (ev) => {\n if (!open) {\n if (!openOnSpace) return\n\n ev.preventDefault()\n\n onOpenWithActiveDescendant(descendants.enabledFirstValue)\n } else {\n if (!activeDescendant.current || !selectOnSpace) return\n\n ev.preventDefault()\n\n const { closeOnSelect, value } = activeDescendant.current\n\n onSelect(value, closeOnSelect)\n }\n },\n },\n { preventDefault: false },\n )\n },\n [\n disabled,\n open,\n onOpenWithActiveDescendant,\n descendants,\n onActiveDescendant,\n onScrollIntoView,\n openOnEnter,\n onSelect,\n openOnSpace,\n selectOnSpace,\n ],\n )\n\n useUpdateEffect(() => {\n if (open) return\n\n activeDescendant.current = null\n }, [open])\n\n const getTriggerProps: PropGetter = useCallback(\n ({\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledby,\n ...props\n } = {}) =>\n mergeProps(\n {\n ref: triggerRef,\n \"aria-controls\": open ? contentId : undefined,\n \"aria-disabled\": ariaAttr(!interactive),\n \"aria-expanded\": open,\n \"aria-haspopup\": \"listbox\",\n \"aria-label\": ariaLabel || ariaLabelProp,\n \"aria-labelledby\": cx(ariaLabelledby, ariaLabelledbyProp),\n \"data-disabled\": dataAttr(disabled),\n \"data-readonly\": dataAttr(readOnly),\n role: \"combobox\",\n tabIndex: interactive ? 0 : -1,\n },\n rest,\n props,\n { onClick, onKeyDown },\n )(),\n [\n open,\n contentId,\n interactive,\n ariaLabelledbyProp,\n disabled,\n readOnly,\n ariaLabelProp,\n rest,\n onClick,\n onKeyDown,\n ],\n )\n\n const getContentProps: PropGetter = useCallback(\n ({ ref, ...props } = {}) => ({\n id: contentId,\n role: \"listbox\",\n ...props,\n ref: mergeRefs(ref, contentRef),\n onKeyDown: handlerAll(props.onKeyDown),\n }),\n [contentId],\n )\n\n const getSeparatorProps: PropGetter = useCallback(\n (props) => ({ role: \"separator\", ...props }),\n [],\n )\n\n return {\n activeDescendant,\n descendants,\n interactive,\n open,\n getContentProps,\n getSeparatorProps,\n getTriggerProps,\n popoverProps: mergedPopoverProps,\n onActiveDescendant,\n onClose,\n onOpen,\n onOpenWithActiveDescendant,\n onScrollIntoView,\n onSelect,\n }\n}\n\nexport type UseComboboxReturn = ReturnType<typeof useCombobox>\n\nexport interface UseComboboxGroupProps extends HTMLProps {}\n\nexport const useComboboxGroup = ({\n \"aria-labelledby\": ariaLabelledbyProp,\n ...rest\n}: UseComboboxGroupProps = {}) => {\n const labelId = useId()\n\n const getGroupProps: PropGetter = useCallback(\n ({ \"aria-labelledby\": ariaLabelledby, ...props } = {}) =>\n mergeProps(\n {\n \"aria-labelledby\": cx(ariaLabelledbyProp, ariaLabelledby, labelId),\n role: \"group\",\n },\n rest,\n props,\n )(),\n [ariaLabelledbyProp, labelId, rest],\n )\n\n const getLabelProps: PropGetter<\"span\"> = useCallback(\n (props) => ({ id: labelId, role: \"presentation\", ...props }),\n [labelId],\n )\n\n return { getGroupProps, getLabelProps }\n}\n\nexport type UseComboboxGroupReturn = ReturnType<typeof useComboboxGroup>\n\nexport interface UseComboboxItemProps extends HTMLProps {\n /**\n * If `true`, the item will be closed when selected.\n */\n closeOnSelect?: boolean\n /**\n * If `true`, the item will be disabled.\n *\n * @default false\n */\n disabled?: boolean\n /**\n * If `true`, the item will be selected.\n */\n selected?: boolean\n /**\n * The value of the item.\n */\n value?: string\n}\n\nexport const useComboboxItem = ({\n id,\n \"aria-disabled\": ariaDisabled,\n \"data-disabled\": dataDisabled,\n closeOnSelect,\n disabled = false,\n selected = false,\n value,\n ...rest\n}: UseComboboxItemProps = {}) => {\n const uuid = useId()\n const itemRef = useRef<HTMLDivElement>(null)\n const { onActiveDescendant, onClose, onSelect } = useComboboxContext()\n\n id ??= uuid\n\n const { descendants, register } = useComboboxDescendant({\n id,\n closeOnSelect,\n disabled,\n value,\n })\n\n const onActive = useCallback(() => {\n if (disabled) return\n\n const current = descendants.value(itemRef.current)\n\n onActiveDescendant(current)\n }, [descendants, disabled, onActiveDescendant])\n\n const onClick = useCallback(\n (ev: MouseEvent<HTMLDivElement>) => {\n ev.preventDefault()\n\n if (disabled) return\n\n onSelect(value, closeOnSelect)\n },\n [closeOnSelect, disabled, onSelect, value],\n )\n\n const getItemProps: PropGetter = useCallback(\n (props = {}) =>\n mergeProps(\n {\n id,\n ref: itemRef,\n \"aria-disabled\": ariaDisabled ?? ariaAttr(disabled),\n \"aria-selected\": selected,\n \"data-disabled\": dataDisabled ?? dataAttr(disabled),\n \"data-selected\": dataAttr(selected),\n \"data-value\": value,\n role: \"option\",\n tabIndex: -1,\n },\n rest,\n props,\n { ref: register, onClick, onMouseMove: onActive },\n )(),\n [\n id,\n ariaDisabled,\n disabled,\n selected,\n dataDisabled,\n value,\n rest,\n register,\n onClick,\n onActive,\n ],\n )\n\n const getIndicatorProps: PropGetter = useCallback(\n (props = {}) =>\n mergeProps({ style: { opacity: selected ? 1 : 0 } }, props)(),\n [selected],\n )\n\n return {\n descendants,\n disabled,\n selected,\n getIndicatorProps,\n getItemProps,\n onActiveDescendant,\n onClose,\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAwDA,MAAa,sBACX,UACA,EAAE,OAAO,OAAO,aACb;CAGH,OAFsB,iBAAiB,SAEnB,CACjB,QACE,EAAE,WAAW,cAAc,MAAM,OAAO,IAAI,cAAc,MAAM,MAAM,CACxE,CACA,KAAK,EAAE,MAAM,YAAY;EACxB,IAAI,cAAc,MAAM,OAAO,EAC7B,OAAO;GAAE,GAAG;GAAO,OAAO,MAAM;GAAU;OACrC;GACL,MAAM,gBAAgB,iBAAiB,MAAM,SAAS;GACtD,MAAM,QAAQ,UAAU,eAAe,MAAM;GAE7C,OAAO;IACL,GAAG;IACH,OAAO,cACJ,QAAQ,EAAE,WAAW,cAAc,MAAM,OAAO,CAAC,CACjD,KAAK,EAAE,aAAa;KAAE,GAAG;KAAO,OAAO,MAAM;KAAU,EAAE;IAC5D,OAAO,OAAO,MAAM,YAAY,MAAM;IACvC;;GAEH;;AASN,MAAa,0BACX,OACA,EAAE,OAAO,OAAO,aACb;CACH,OAAO,MAAM,KAAK,MAAM,UAAU;EAChC,IAAI,gBAAgB,QAAQ,OAAO;GACjC,MAAM,EAAE,OAAO,GAAG,SAAS;GAE3B,OACE,oBAAC,OAAD;IAAmB,GAAI;cACpB;IACK,EAFI,MAEJ;SAEL,IAAI,WAAW,MAAM;GA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BAAgB;EAEnB,IAAI,UAAU;EAEd,SAAS,OAAO,cAAc;IAEhC;EAAC;EAAe;EAAU;EAAU;EAAM,CAC3C;CAED,MAAM,eAA2B,aAC9B,QAAQ,EAAE,KACT,WACE;EACE;EACA,KAAK;EACL,iBAAiB,iBAAA,GAAA,cAAA,UAAyB,SAAS;EACnD,iBAAiB;EACjB,iBAAiB,iBAAA,GAAA,cAAA,UAAyB,SAAS;EACnD,kBAAA,GAAA,cAAA,UAA0B,SAAS;EACnC,cAAc;EACd,MAAM;EACN,UAAU;EACX,EACD,MACA,OACA;EAAE,KAAK;EAAU;EAAS,aAAa;EAAU,CAClD,EAAE,EACL;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD,CACF;CAQD,OAAO;EACL;EACA;EACA;EACA,mBAVoC,aACnC,QAAQ,EAAE,KACT,WAAW,EAAE,OAAO,EAAE,SAAS,WAAW,IAAI,GAAG,EAAE,EAAE,MAAM,EAAE,EAC/D,CAAC,SAAS,CAOO;EACjB;EACA;EACA;EACD"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["createContext"],"sources":["../../../../src/hooks/use-combobox/index.tsx"],"sourcesContent":["\"use client\"\n\nimport type {\n JSXElementConstructor,\n KeyboardEvent,\n MouseEvent,\n ReactNode,\n RefObject,\n} from \"react\"\nimport type { UsePopoverProps } from \"../../components/popover\"\nimport type { HTMLProps, PropGetter, SimpleDirection } from \"../../core\"\nimport type { Descendant } from \"../use-descendants\"\nimport type { UseDisclosureProps } from \"../use-disclosure\"\nimport { useCallback, useId, useMemo, useRef } from \"react\"\nimport scrollIntoView from \"scroll-into-view-if-needed\"\nimport { usePopoverProps } from \"../../components/popover\"\nimport { mergeProps, useEnvironment } from \"../../core\"\nimport {\n ariaAttr,\n createContext,\n cx,\n dataAttr,\n findChild,\n getValidChildren,\n handlerAll,\n isComposing,\n isSomeElement,\n isUndefined,\n mergeRefs,\n runKeyAction,\n useUpdateEffect,\n} from \"../../utils\"\nimport { createDescendants } from \"../use-descendants\"\nimport { useDisclosure } from \"../use-disclosure\"\n\ninterface ComboboxSharedItem extends Omit<HTMLProps, \"children\" | \"value\"> {\n label: ReactNode\n}\n\nexport interface ComboboxItemWithValue extends ComboboxSharedItem {\n query?: string\n value?: string\n}\n\nexport interface ComboboxItemWithItems extends ComboboxSharedItem {\n items: ComboboxItemWithValue[]\n}\n\nexport type ComboboxItem = ComboboxItemWithItems | ComboboxItemWithValue\n\nexport interface CreateComboboxItemOptions {\n Group: JSXElementConstructor<any>\n Label: JSXElementConstructor<any>\n Option: JSXElementConstructor<any>\n}\n\nexport const createComboboxItem = (\n children: ReactNode,\n { Group, Label, Option }: CreateComboboxItemOptions,\n) => {\n const validChildren = getValidChildren(children)\n\n return validChildren\n .filter(\n ({ type }) => isSomeElement(type, Option) || isSomeElement(type, Group),\n )\n .map(({ type, props }) => {\n if (isSomeElement(type, Option)) {\n return { ...props, label: props.children }\n } else {\n const validChildren = getValidChildren(props.children)\n const label = findChild(validChildren, Label)\n\n return {\n ...props,\n items: validChildren\n .filter(({ type }) => isSomeElement(type, Option))\n .map(({ props }) => ({ ...props, label: props.children })),\n label: label?.props.children ?? props.label,\n }\n }\n })\n}\n\nexport interface CreateComboboxChildrenOptions {\n Group: JSXElementConstructor<any>\n Option: JSXElementConstructor<any>\n Empty?: JSXElementConstructor<any>\n}\n\nexport const createComboboxChildren = (\n items: ComboboxItem[],\n { Empty, Group, Option }: CreateComboboxChildrenOptions,\n) => {\n return items.map((item, index) => {\n if (\"data-empty\" in item && Empty) {\n const { label, ...rest } = item\n\n return (\n <Empty key={index} {...rest}>\n {label}\n </Empty>\n )\n } else if (\"items\" in item) {\n const { items, label, ...rest } = item\n\n return (\n <Group key={index} label={label} {...rest}>\n {items.map(({ label, ...rest }, index) => (\n <Option key={index} {...rest}>\n {label}\n </Option>\n ))}\n </Group>\n )\n } else {\n const { label, ...rest } = item\n\n return (\n <Option key={index} {...rest}>\n {label}\n </Option>\n )\n }\n })\n}\n\nexport interface ComboboxDescendantProps {\n id: string\n closeOnSelect?: boolean\n value?: string\n}\nexport type ComboboxDescendant = Descendant<\n HTMLDivElement,\n ComboboxDescendantProps\n>\n\nconst {\n DescendantsContext: ComboboxDescendantsContext,\n useDescendant: useComboboxDescendant,\n useDescendantRegister: useComboboxDescendantRegister,\n useDescendants: useComboboxDescendants,\n} = createDescendants<HTMLDivElement, ComboboxDescendantProps>()\n\nexport {\n ComboboxDescendantsContext,\n useComboboxDescendant,\n useComboboxDescendantRegister,\n useComboboxDescendants,\n}\n\ninterface ComboboxContext extends Pick<\n UseComboboxReturn,\n \"onActiveDescendant\" | \"onClose\" | \"onSelect\"\n> {}\n\nconst [ComboboxContext, useComboboxContext] = createContext<ComboboxContext>({\n name: \"ComboboxContext\",\n})\n\ninterface ComboboxGroupContext extends Pick<\n UseComboboxGroupReturn,\n \"getLabelProps\"\n> {}\n\nconst [ComboboxGroupContext, useComboboxGroupContext] =\n createContext<ComboboxGroupContext>({\n name: \"ComboboxGroupContext\",\n })\n\nexport {\n ComboboxContext,\n ComboboxGroupContext,\n useComboboxContext,\n useComboboxGroupContext,\n}\n\nexport interface UseComboboxProps\n extends\n Omit<HTMLProps, \"onChange\">,\n Omit<UseDisclosureProps, \"timing\">,\n Omit<\n UsePopoverProps,\n \"autoFocus\" | \"initialFocusRef\" | \"modal\" | \"transform\" | \"updateRef\"\n > {\n /**\n * If `true`, the list element will be closed when value is selected.\n *\n * @default true\n */\n closeOnSelect?: boolean\n /**\n * If `true`, the combobox will be disabled.\n *\n * @default false\n */\n disabled?: boolean\n /**\n * The value to focus on when the combobox is opened.\n */\n initialFocusValue?: string\n /**\n * If `true`, the combobox will be opened when click on the field.\n *\n * @default true\n */\n openOnClick?: boolean\n /**\n * If `true`, the combobox will be opened when enter is pressed.\n *\n * @default true\n */\n openOnEnter?: boolean\n /**\n * If `true`, the combobox will be opened when space is pressed.\n *\n * @default true\n */\n openOnSpace?: boolean\n /**\n * If `true`, the combobox will be readonly.\n *\n * @default false\n */\n readOnly?: boolean\n /**\n * The `ref` of the element that should receive focus when selected.\n */\n selectFocusRef?: RefObject<HTMLElement | null>\n /**\n * If `true`, the item will be selected when space is pressed.\n *\n * @default true\n */\n selectOnSpace?: boolean\n /**\n * The callback invoked when value is selected.\n */\n onChange?: (value: string) => void\n}\n\nexport const useCombobox = (props: UseComboboxProps = {}) => {\n const [\n { matchWidth = true, ...popoverProps },\n {\n \"aria-label\": ariaLabelProp,\n \"aria-labelledby\": ariaLabelledbyProp,\n closeOnSelect: closeOnSelectProp = true,\n defaultOpen,\n disabled,\n initialFocusValue,\n open: openProp,\n openOnClick = true,\n openOnEnter = true,\n openOnSpace = true,\n readOnly,\n selectFocusRef,\n selectOnSpace = true,\n onChange: onChangeProp,\n onClose: onCloseProp,\n onOpen: onOpenProp,\n ...rest\n },\n ] = usePopoverProps(props, [\n \"disabled\",\n \"open\",\n \"defaultOpen\",\n \"onOpen\",\n \"onClose\",\n \"openOnClick\",\n ])\n const { getWindow } = useEnvironment()\n const interactive = !(readOnly || disabled)\n const triggerRef = useRef<HTMLDivElement>(null)\n const contentRef = useRef<HTMLDivElement>(null)\n const contentId = useId()\n const descendants = useComboboxDescendants()\n const { open, onClose, onOpen } = useDisclosure({\n defaultOpen,\n open: openProp,\n onClose: onCloseProp,\n onOpen: onOpenProp,\n })\n const activeDescendant = useRef<ComboboxDescendant | null>(null)\n const mergedPopoverProps = useMemo<UsePopoverProps>(\n () => ({\n autoFocus: false,\n matchWidth,\n openOnClick: false,\n ...popoverProps,\n disabled: !interactive,\n open,\n onClose,\n onOpen,\n }),\n [interactive, matchWidth, onClose, onOpen, open, popoverProps],\n )\n\n const onSelect = useCallback(\n (value?: string, closeOnSelect = closeOnSelectProp) => {\n const ref = selectFocusRef ?? triggerRef\n\n ref.current?.focus()\n\n if (!interactive || isUndefined(value)) return\n\n onChangeProp?.(value)\n\n if (!closeOnSelect) return\n\n onClose()\n },\n [closeOnSelectProp, interactive, onChangeProp, onClose, selectFocusRef],\n )\n\n const onScrollIntoView = useCallback(\n (descendant?: ComboboxDescendant, block: SimpleDirection = \"start\") => {\n if (!contentRef.current || !descendant) return\n\n const style = getWindow()?.getComputedStyle(contentRef.current)\n const padding =\n block === \"start\" ? style?.paddingBlockStart : style?.paddingBlockEnd\n const value = parseInt(padding ?? \"0px\")\n\n scrollIntoView(descendant.node, {\n behavior: (actions) =>\n actions.forEach(({ el, top }) => {\n el.scrollTop = block === \"start\" ? top - value : top + value\n }),\n block,\n boundary: contentRef.current,\n inline: \"nearest\",\n scrollMode: \"if-needed\",\n })\n },\n [getWindow],\n )\n\n const onActiveDescendant = useCallback(\n (descendant?: ComboboxDescendant) => {\n if (!triggerRef.current || !descendant || disabled) return\n\n triggerRef.current.setAttribute(\"aria-activedescendant\", descendant.id)\n\n activeDescendant.current = descendant\n\n descendants.active(descendant)\n },\n [descendants, disabled],\n )\n\n const onOpenWithActiveDescendant = useCallback(\n (\n getFallbackDescendant: () => ComboboxDescendant | undefined,\n block: SimpleDirection = \"start\",\n ) => {\n onOpen()\n\n setTimeout(() => {\n if (!initialFocusValue) {\n const descendant = getFallbackDescendant()\n\n onActiveDescendant(descendant)\n onScrollIntoView(descendant, block)\n } else {\n const values = descendants.values()\n const descendant =\n values.find(({ value }) => initialFocusValue === value) ??\n getFallbackDescendant()\n\n onActiveDescendant(descendant)\n onScrollIntoView(descendant, block)\n }\n })\n },\n [\n descendants,\n initialFocusValue,\n onActiveDescendant,\n onOpen,\n onScrollIntoView,\n ],\n )\n\n const onClick = useCallback(\n (ev: MouseEvent<HTMLDivElement>) => {\n if (disabled) return\n\n ev.preventDefault()\n\n if (!open) {\n if (openOnClick)\n onOpenWithActiveDescendant(descendants.enabledFirstValue)\n } else {\n onClose()\n }\n },\n [\n descendants,\n disabled,\n onClose,\n onOpenWithActiveDescendant,\n open,\n openOnClick,\n ],\n )\n\n const onKeyDown = useCallback(\n (ev: KeyboardEvent<HTMLDivElement>) => {\n if (disabled || isComposing(ev)) return\n\n runKeyAction(\n ev,\n {\n ArrowDown: (ev) => {\n ev.preventDefault()\n\n if (!open) {\n onOpenWithActiveDescendant(descendants.enabledFirstValue)\n } else if (activeDescendant.current) {\n const descendant = descendants.enabledNextValue(\n activeDescendant.current,\n )\n\n onActiveDescendant(descendant)\n\n onScrollIntoView(\n descendant,\n descendant?.recurred ? \"start\" : \"end\",\n )\n } else {\n const descendant = descendants.enabledFirstValue()\n\n onActiveDescendant(descendant)\n\n onScrollIntoView(descendant)\n }\n },\n ArrowUp: (ev) => {\n ev.preventDefault()\n\n if (!open) {\n onOpenWithActiveDescendant(descendants.enabledLastValue, \"end\")\n } else if (activeDescendant.current) {\n const descendant = descendants.enabledPrevValue(\n activeDescendant.current,\n )\n\n onActiveDescendant(descendant)\n\n onScrollIntoView(\n descendant,\n descendant?.recurred ? \"end\" : \"start\",\n )\n } else {\n const descendant = descendants.enabledLastValue()\n\n onActiveDescendant(descendant)\n\n onScrollIntoView(descendant, \"end\")\n }\n },\n End: (ev) => {\n ev.preventDefault()\n\n if (!open) return\n\n const descendant = descendants.enabledLastValue()\n\n onActiveDescendant(descendant)\n\n onScrollIntoView(descendant, \"end\")\n },\n Enter: (ev) => {\n if (!open) {\n if (!openOnEnter) return\n\n ev.preventDefault()\n\n onOpenWithActiveDescendant(descendants.enabledFirstValue)\n } else {\n if (!activeDescendant.current) return\n\n ev.preventDefault()\n\n const { closeOnSelect, value } = activeDescendant.current\n\n onSelect(value, closeOnSelect)\n }\n },\n Home: (ev) => {\n if (!open) return\n\n ev.preventDefault()\n\n const descendant = descendants.enabledFirstValue()\n\n onActiveDescendant(descendant)\n\n onScrollIntoView(descendant)\n },\n Space: (ev) => {\n if (!open) {\n if (!openOnSpace) return\n\n ev.preventDefault()\n\n onOpenWithActiveDescendant(descendants.enabledFirstValue)\n } else {\n if (!activeDescendant.current || !selectOnSpace) return\n\n ev.preventDefault()\n\n const { closeOnSelect, value } = activeDescendant.current\n\n onSelect(value, closeOnSelect)\n }\n },\n },\n { preventDefault: false },\n )\n },\n [\n disabled,\n open,\n onOpenWithActiveDescendant,\n descendants,\n onActiveDescendant,\n onScrollIntoView,\n openOnEnter,\n onSelect,\n openOnSpace,\n selectOnSpace,\n ],\n )\n\n useUpdateEffect(() => {\n if (open) return\n\n activeDescendant.current = null\n }, [open])\n\n const getTriggerProps: PropGetter = useCallback(\n ({\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledby,\n ...props\n } = {}) => ({\n ...mergeProps(\n {\n ref: triggerRef,\n \"aria-controls\": open ? contentId : undefined,\n \"aria-disabled\": ariaAttr(!interactive),\n \"aria-expanded\": open,\n \"aria-haspopup\": \"listbox\",\n \"aria-label\": ariaLabel || ariaLabelProp,\n \"aria-labelledby\": cx(ariaLabelledby, ariaLabelledbyProp),\n \"data-disabled\": dataAttr(disabled),\n \"data-readonly\": dataAttr(readOnly),\n role: \"combobox\",\n tabIndex: interactive ? 0 : -1,\n },\n rest,\n props,\n )({ mergeEvent: false }),\n onClick: handlerAll(props.onClick, rest.onClick, onClick),\n onKeyDown: handlerAll(props.onKeyDown, rest.onKeyDown, onKeyDown),\n }),\n [\n open,\n contentId,\n interactive,\n ariaLabelledbyProp,\n disabled,\n readOnly,\n ariaLabelProp,\n rest,\n onClick,\n onKeyDown,\n ],\n )\n\n const getContentProps: PropGetter = useCallback(\n ({ ref, ...props } = {}) => ({\n id: contentId,\n role: \"listbox\",\n ...props,\n ref: mergeRefs(ref, contentRef),\n onKeyDown: handlerAll(props.onKeyDown),\n }),\n [contentId],\n )\n\n const getSeparatorProps: PropGetter = useCallback(\n (props) => ({ role: \"separator\", ...props }),\n [],\n )\n\n return {\n activeDescendant,\n descendants,\n interactive,\n open,\n getContentProps,\n getSeparatorProps,\n getTriggerProps,\n popoverProps: mergedPopoverProps,\n onActiveDescendant,\n onClose,\n onOpen,\n onOpenWithActiveDescendant,\n onScrollIntoView,\n onSelect,\n }\n}\n\nexport type UseComboboxReturn = ReturnType<typeof useCombobox>\n\nexport interface UseComboboxGroupProps extends HTMLProps {}\n\nexport const useComboboxGroup = ({\n \"aria-labelledby\": ariaLabelledbyProp,\n ...rest\n}: UseComboboxGroupProps = {}) => {\n const labelId = useId()\n\n const getGroupProps: PropGetter = useCallback(\n ({ \"aria-labelledby\": ariaLabelledby, ...props } = {}) =>\n mergeProps(\n {\n \"aria-labelledby\": cx(ariaLabelledbyProp, ariaLabelledby, labelId),\n role: \"group\",\n },\n rest,\n props,\n )(),\n [ariaLabelledbyProp, labelId, rest],\n )\n\n const getLabelProps: PropGetter<\"span\"> = useCallback(\n (props) => ({ id: labelId, role: \"presentation\", ...props }),\n [labelId],\n )\n\n return { getGroupProps, getLabelProps }\n}\n\nexport type UseComboboxGroupReturn = ReturnType<typeof useComboboxGroup>\n\nexport interface UseComboboxItemProps extends HTMLProps {\n /**\n * If `true`, the item will be closed when selected.\n */\n closeOnSelect?: boolean\n /**\n * If `true`, the item will be disabled.\n *\n * @default false\n */\n disabled?: boolean\n /**\n * If `true`, the item will be selected.\n */\n selected?: boolean\n /**\n * The value of the item.\n */\n value?: string\n}\n\nexport const useComboboxItem = ({\n id,\n \"aria-disabled\": ariaDisabled,\n \"data-disabled\": dataDisabled,\n closeOnSelect,\n disabled = false,\n selected = false,\n value,\n ...rest\n}: UseComboboxItemProps = {}) => {\n const uuid = useId()\n const itemRef = useRef<HTMLDivElement>(null)\n const { onActiveDescendant, onClose, onSelect } = useComboboxContext()\n\n id ??= uuid\n\n const { descendants, register } = useComboboxDescendant({\n id,\n closeOnSelect,\n disabled,\n value,\n })\n\n const onActive = useCallback(() => {\n if (disabled) return\n\n const current = descendants.value(itemRef.current)\n\n onActiveDescendant(current)\n }, [descendants, disabled, onActiveDescendant])\n\n const onClick = useCallback(\n (ev: MouseEvent<HTMLDivElement>) => {\n ev.preventDefault()\n\n if (disabled) return\n\n onSelect(value, closeOnSelect)\n },\n [closeOnSelect, disabled, onSelect, value],\n )\n\n const getItemProps: PropGetter = useCallback(\n (props = {}) => ({\n ...mergeProps(\n {\n id,\n ref: itemRef,\n \"aria-disabled\": ariaDisabled ?? ariaAttr(disabled),\n \"aria-selected\": selected,\n \"data-disabled\": dataDisabled ?? dataAttr(disabled),\n \"data-selected\": dataAttr(selected),\n \"data-value\": value,\n role: \"option\",\n tabIndex: -1,\n },\n rest,\n props,\n { ref: register },\n )({ mergeEvent: false }),\n onClick: handlerAll(props.onClick, rest.onClick, onClick),\n onMouseMove: handlerAll(props.onMouseMove, rest.onMouseMove, onActive),\n }),\n [\n id,\n ariaDisabled,\n disabled,\n selected,\n dataDisabled,\n value,\n rest,\n register,\n onClick,\n onActive,\n ],\n )\n\n const getIndicatorProps: PropGetter = useCallback(\n (props = {}) =>\n mergeProps({ style: { opacity: selected ? 1 : 0 } }, props)(),\n [selected],\n )\n\n return {\n descendants,\n disabled,\n selected,\n getIndicatorProps,\n getItemProps,\n onActiveDescendant,\n onClose,\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAwDA,MAAa,sBACX,UACA,EAAE,OAAO,OAAO,aACb;CAGH,OAFsB,iBAAiB,SAEnB,CACjB,QACE,EAAE,WAAW,cAAc,MAAM,OAAO,IAAI,cAAc,MAAM,MAAM,CACxE,CACA,KAAK,EAAE,MAAM,YAAY;EACxB,IAAI,cAAc,MAAM,OAAO,EAC7B,OAAO;GAAE,GAAG;GAAO,OAAO,MAAM;GAAU;OACrC;GACL,MAAM,gBAAgB,iBAAiB,MAAM,SAAS;GACtD,MAAM,QAAQ,UAAU,eAAe,MAAM;GAE7C,OAAO;IACL,GAAG;IACH,OAAO,cACJ,QAAQ,EAAE,WAAW,cAAc,MAAM,OAAO,CAAC,CACjD,KAAK,EAAE,aAAa;KAAE,GAAG;KAAO,OAAO,MAAM;KAAU,EAAE;IAC5D,OAAO,OAAO,MAAM,YAAY,MAAM;IACvC;;GAEH;;AASN,MAAa,0BACX,OACA,EAAE,OAAO,OAAO,aACb;CACH,OAAO,MAAM,KAAK,MAAM,UAAU;EAChC,IAAI,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E,oBAAoB,SAAS,aAAa,oBAAoB;CAEtE,OAAO;CAEP,MAAM,EAAE,aAAa,aAAa,sBAAsB;EACtD;EACA;EACA;EACA;EACD,CAAC;CAEF,MAAM,WAAW,kBAAkB;EACjC,IAAI,UAAU;EAId,mBAFgB,YAAY,MAAM,QAAQ,QAEhB,CAAC;IAC1B;EAAC;EAAa;EAAU;EAAmB,CAAC;CAE/C,MAAM,UAAU,aACb,OAAmC;EAClC,GAAG,gBAAgB;EAEnB,IAAI,UAAU;EAEd,SAAS,OAAO,cAAc;IAEhC;EAAC;EAAe;EAAU;EAAU;EAAM,CAC3C;CAED,MAAM,eAA2B,aAC9B,QAAQ,EAAE,MAAM;EACf,GAAG,WACD;GACE;GACA,KAAK;GACL,iBAAiB,iBAAA,GAAA,cAAA,UAAyB,SAAS;GACnD,iBAAiB;GACjB,iBAAiB,iBAAA,GAAA,cAAA,UAAyB,SAAS;GACnD,kBAAA,GAAA,cAAA,UAA0B,SAAS;GACnC,cAAc;GACd,MAAM;GACN,UAAU;GACX,EACD,MACA,OACA,EAAE,KAAK,UAAU,CAClB,CAAC,EAAE,YAAY,OAAO,CAAC;EACxB,UAAA,GAAA,cAAA,YAAoB,MAAM,SAAS,KAAK,SAAS,QAAQ;EACzD,cAAA,GAAA,cAAA,YAAwB,MAAM,aAAa,KAAK,aAAa,SAAS;EACvE,GACD;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD,CACF;CAQD,OAAO;EACL;EACA;EACA;EACA,mBAVoC,aACnC,QAAQ,EAAE,KACT,WAAW,EAAE,OAAO,EAAE,SAAS,WAAW,IAAI,GAAG,EAAE,EAAE,MAAM,EAAE,EAC/D,CAAC,SAAS,CAOO;EACjB;EACA;EACA;EACD"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ComponentSlotStyle } from "../../core/system/index.types.js";
|
|
2
2
|
import { CSSModifierObject, CSSPropObject, CSSSlotObject } from "../../core/css/index.types.js";
|
|
3
3
|
//#region src/components/accordion/accordion.style.d.ts
|
|
4
|
-
declare const accordionStyle: ComponentSlotStyle<"button" | "panel" | "icon" | "
|
|
4
|
+
declare const accordionStyle: ComponentSlotStyle<"button" | "panel" | "icon" | "item" | "root", CSSPropObject<CSSSlotObject<"button" | "panel" | "icon" | "item" | "root">>, CSSModifierObject<CSSSlotObject<"button" | "panel" | "icon" | "item" | "root">>, {
|
|
5
5
|
panel: {
|
|
6
6
|
button: {
|
|
7
7
|
rounded: "l2";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ComponentSlotStyle } from "../../core/system/index.types.js";
|
|
2
2
|
import { CSSPropObject, CSSSlotObject } from "../../core/css/index.types.js";
|
|
3
3
|
//#region src/components/autocomplete/autocomplete.style.d.ts
|
|
4
|
-
declare const autocompleteStyle: ComponentSlotStyle<"input" | "label" | "option" | "content" | "group" | "separator" | "icon" | "root" | "indicator" | "field" | "
|
|
4
|
+
declare const autocompleteStyle: ComponentSlotStyle<"input" | "label" | "option" | "content" | "group" | "separator" | "icon" | "root" | "indicator" | "field" | "empty" | "valueText", CSSPropObject<CSSSlotObject<"input" | "label" | "option" | "content" | "group" | "separator" | "icon" | "root" | "indicator" | "field" | "empty" | "valueText">>, {
|
|
5
5
|
xs: {
|
|
6
6
|
empty: {
|
|
7
7
|
gap: "1.5";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ComponentSlotStyle } from "../../core/system/index.types.js";
|
|
2
2
|
import { CSSPropObject, CSSSlotObject } from "../../core/css/index.types.js";
|
|
3
3
|
//#region src/components/breadcrumb/breadcrumb.style.d.ts
|
|
4
|
-
declare const breadcrumbStyle: ComponentSlotStyle<"link" | "list" | "separator" | "ellipsis" | "
|
|
4
|
+
declare const breadcrumbStyle: ComponentSlotStyle<"link" | "list" | "separator" | "ellipsis" | "item" | "root", CSSPropObject<CSSSlotObject<"link" | "list" | "separator" | "ellipsis" | "item" | "root">>, {
|
|
5
5
|
sm: {
|
|
6
6
|
list: {
|
|
7
7
|
fontSize: "sm";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ComponentSlotStyle } from "../../core/system/index.types.js";
|
|
2
2
|
import { CSSModifierObject, CSSSlotObject } from "../../core/css/index.types.js";
|
|
3
3
|
//#region src/components/calendar/calendar.style.d.ts
|
|
4
|
-
declare const calendarStyle: ComponentSlotStyle<"button" | "select" | "cell" | "navigation" | "row" | "separator" | "next" | "root" | "
|
|
4
|
+
declare const calendarStyle: ComponentSlotStyle<"button" | "select" | "cell" | "navigation" | "row" | "separator" | "next" | "root" | "month" | "week" | "weekday" | "day" | "control" | "months" | "prev" | "weeks" | "years", {
|
|
5
5
|
/**
|
|
6
6
|
* If `true`, the calendar will be fixed rows.
|
|
7
7
|
*
|
|
@@ -73,7 +73,7 @@ declare const calendarStyle: ComponentSlotStyle<"button" | "select" | "cell" | "
|
|
|
73
73
|
"--font-size": "fontSizes.xl";
|
|
74
74
|
};
|
|
75
75
|
};
|
|
76
|
-
}, CSSModifierObject<CSSSlotObject<"button" | "select" | "cell" | "navigation" | "row" | "separator" | "next" | "root" | "
|
|
76
|
+
}, CSSModifierObject<CSSSlotObject<"button" | "select" | "cell" | "navigation" | "row" | "separator" | "next" | "root" | "month" | "week" | "weekday" | "day" | "control" | "months" | "prev" | "weeks" | "years">>>;
|
|
77
77
|
type CalendarStyle = typeof calendarStyle;
|
|
78
78
|
//#endregion
|
|
79
79
|
export { CalendarStyle, calendarStyle };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ComponentSlotStyle } from "../../core/system/index.types.js";
|
|
2
2
|
import { CSSModifierObject, CSSPropObject, CSSSlotObject } from "../../core/css/index.types.js";
|
|
3
3
|
//#region src/components/carousel/carousel.style.d.ts
|
|
4
|
-
declare const carouselStyle: ComponentSlotStyle<"list" | "next" | "
|
|
4
|
+
declare const carouselStyle: ComponentSlotStyle<"list" | "next" | "item" | "root" | "trigger" | "indicator" | "prev" | "indicators", CSSPropObject<CSSSlotObject<"list" | "next" | "item" | "root" | "trigger" | "indicator" | "prev" | "indicators">>, {
|
|
5
5
|
sm: {
|
|
6
6
|
root: {
|
|
7
7
|
h: "sm";
|
|
@@ -17,7 +17,7 @@ declare const carouselStyle: ComponentSlotStyle<"list" | "next" | "root" | "trig
|
|
|
17
17
|
h: "lg";
|
|
18
18
|
};
|
|
19
19
|
};
|
|
20
|
-
}, CSSModifierObject<CSSSlotObject<"list" | "next" | "
|
|
20
|
+
}, CSSModifierObject<CSSSlotObject<"list" | "next" | "item" | "root" | "trigger" | "indicator" | "prev" | "indicators">>>;
|
|
21
21
|
type CarouselStyle = typeof carouselStyle;
|
|
22
22
|
//#endregion
|
|
23
23
|
export { CarouselStyle, carouselStyle };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ComponentSlotStyle } from "../../core/system/index.types.js";
|
|
2
2
|
import { CSSModifierObject, CSSPropObject, CSSSlotObject } from "../../core/css/index.types.js";
|
|
3
3
|
//#region src/components/chart/cartesian-chart.style.d.ts
|
|
4
|
-
declare const cartesianChartStyle: ComponentSlotStyle<"area" | "line" | "grid" | "bar" | "dot" | "root" | "
|
|
4
|
+
declare const cartesianChartStyle: ComponentSlotStyle<"area" | "line" | "grid" | "bar" | "dot" | "root" | "labelList" | "activeDot" | "referenceLine" | "referenceLineLabel" | "xAxis" | "xAxisLabel" | "xAxisTick" | "xAxisTickLine" | "yAxis" | "yAxisLabel" | "yAxisTick" | "yAxisTickLine", CSSPropObject<CSSSlotObject<"area" | "line" | "grid" | "bar" | "dot" | "root" | "labelList" | "activeDot" | "referenceLine" | "referenceLineLabel" | "xAxis" | "xAxisLabel" | "xAxisTick" | "xAxisTickLine" | "yAxis" | "yAxisLabel" | "yAxisTick" | "yAxisTickLine">>, CSSModifierObject<CSSSlotObject<"area" | "line" | "grid" | "bar" | "dot" | "root" | "labelList" | "activeDot" | "referenceLine" | "referenceLineLabel" | "xAxis" | "xAxisLabel" | "xAxisTick" | "xAxisTickLine" | "yAxis" | "yAxisLabel" | "yAxisTick" | "yAxisTickLine">>, CSSModifierObject<CSSSlotObject<"area" | "line" | "grid" | "bar" | "dot" | "root" | "labelList" | "activeDot" | "referenceLine" | "referenceLineLabel" | "xAxis" | "xAxisLabel" | "xAxisTick" | "xAxisTickLine" | "yAxis" | "yAxisLabel" | "yAxisTick" | "yAxisTickLine">>>;
|
|
5
5
|
type CartesianChartStyle = typeof cartesianChartStyle;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { CartesianChartStyle, cartesianChartStyle };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ComponentSlotStyle } from "../../core/system/index.types.js";
|
|
2
2
|
import { CSSModifierObject, CSSPropObject, CSSSlotObject } from "../../core/css/index.types.js";
|
|
3
3
|
//#region src/components/chart/polar-chart.style.d.ts
|
|
4
|
-
declare const polarChartStyle: ComponentSlotStyle<"label" | "grid" | "dot" | "root" | "
|
|
4
|
+
declare const polarChartStyle: ComponentSlotStyle<"label" | "grid" | "dot" | "root" | "labelList" | "activeDot" | "angleAxis" | "angleAxisLabel" | "angleAxisLine" | "angleAxisTick" | "angleAxisTickLine" | "labelLine" | "pie" | "radar" | "radial" | "radialBackground" | "radiusAxis" | "radiusAxisLabel" | "radiusAxisLine" | "radiusAxisTick" | "radiusAxisTickLine" | "sector", CSSPropObject<CSSSlotObject<"label" | "grid" | "dot" | "root" | "labelList" | "activeDot" | "angleAxis" | "angleAxisLabel" | "angleAxisLine" | "angleAxisTick" | "angleAxisTickLine" | "labelLine" | "pie" | "radar" | "radial" | "radialBackground" | "radiusAxis" | "radiusAxisLabel" | "radiusAxisLine" | "radiusAxisTick" | "radiusAxisTickLine" | "sector">>, CSSModifierObject<CSSSlotObject<"label" | "grid" | "dot" | "root" | "labelList" | "activeDot" | "angleAxis" | "angleAxisLabel" | "angleAxisLine" | "angleAxisTick" | "angleAxisTickLine" | "labelLine" | "pie" | "radar" | "radial" | "radialBackground" | "radiusAxis" | "radiusAxisLabel" | "radiusAxisLine" | "radiusAxisTick" | "radiusAxisTickLine" | "sector">>, CSSModifierObject<CSSSlotObject<"label" | "grid" | "dot" | "root" | "labelList" | "activeDot" | "angleAxis" | "angleAxisLabel" | "angleAxisLine" | "angleAxisTick" | "angleAxisTickLine" | "labelLine" | "pie" | "radar" | "radial" | "radialBackground" | "radiusAxis" | "radiusAxisLabel" | "radiusAxisLine" | "radiusAxisTick" | "radiusAxisTickLine" | "sector">>>;
|
|
5
5
|
type PolarChartStyle = typeof polarChartStyle;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { PolarChartStyle, polarChartStyle };
|
|
@@ -63,7 +63,7 @@ interface CheckboxCardRootProps<Y extends string = string> extends Merge<HTMLSty
|
|
|
63
63
|
*/
|
|
64
64
|
rootProps?: HTMLStyledProps<"label">;
|
|
65
65
|
}
|
|
66
|
-
declare const component: <H extends "fragment" | As = "div", R extends _$_yamada_ui_utils0.Dict = _$_yamada_ui_utils0.Dict<any>>(el: H | _$react.FC<R>, slot?: ComponentSlot<ComponentSlotName<ComponentSlotStyle<"group" | "root" | "
|
|
66
|
+
declare const component: <H extends "fragment" | As = "div", R extends _$_yamada_ui_utils0.Dict = _$_yamada_ui_utils0.Dict<any>>(el: H | _$react.FC<R>, slot?: ComponentSlot<ComponentSlotName<ComponentSlotStyle<"group" | "root" | "description" | "indicator" | "addon", {
|
|
67
67
|
justify: {
|
|
68
68
|
end: {
|
|
69
69
|
addon: {
|
|
@@ -213,7 +213,7 @@ declare const component: <H extends "fragment" | As = "div", R extends _$_yamada
|
|
|
213
213
|
name,
|
|
214
214
|
className,
|
|
215
215
|
...options
|
|
216
|
-
}?: ComponentOptions) => (initialProps?: InitialProps<R>, ...superProps: SuperProps<R>[]) => H extends "fragment" ? _$react.FunctionComponent<R> : Component<Exclude<H, "fragment">, R>, CheckboxCardPropsContext: _$react.Context<Partial<CheckboxCardRootProps<string>> | undefined>, useCheckboxCardPropsContext: () => Partial<CheckboxCardRootProps<string>> | undefined, useRootComponentProps: <Y extends _$_yamada_ui_utils0.Dict = {}, R extends keyof Y = keyof Y>(props: Y, slot?: ComponentSlot<ComponentSlotName<ComponentSlotStyle<"group" | "root" | "
|
|
216
|
+
}?: ComponentOptions) => (initialProps?: InitialProps<R>, ...superProps: SuperProps<R>[]) => H extends "fragment" ? _$react.FunctionComponent<R> : Component<Exclude<H, "fragment">, R>, CheckboxCardPropsContext: _$react.Context<Partial<CheckboxCardRootProps<string>> | undefined>, useCheckboxCardPropsContext: () => Partial<CheckboxCardRootProps<string>> | undefined, useRootComponentProps: <Y extends _$_yamada_ui_utils0.Dict = {}, R extends keyof Y = keyof Y>(props: Y, slot?: ComponentSlot<ComponentSlotName<ComponentSlotStyle<"group" | "root" | "description" | "indicator" | "addon", {
|
|
217
217
|
justify: {
|
|
218
218
|
end: {
|
|
219
219
|
addon: {
|
|
@@ -363,7 +363,7 @@ declare const component: <H extends "fragment" | As = "div", R extends _$_yamada
|
|
|
363
363
|
className,
|
|
364
364
|
withContext,
|
|
365
365
|
transferProps
|
|
366
|
-
}?: UseComponentPropsOptions<R>) => [CSSSlotObject, Merge<WithoutThemeProps<Y, ComponentSlotStyle<"group" | "root" | "
|
|
366
|
+
}?: UseComponentPropsOptions<R>) => [CSSSlotObject, Merge<WithoutThemeProps<Y, ComponentSlotStyle<"group" | "root" | "description" | "indicator" | "addon", {
|
|
367
367
|
justify: {
|
|
368
368
|
end: {
|
|
369
369
|
addon: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ComponentSlotStyle } from "../../core/system/index.types.js";
|
|
2
2
|
//#region src/components/checkbox-card/checkbox-card.style.d.ts
|
|
3
|
-
declare const checkboxCardStyle: ComponentSlotStyle<"group" | "root" | "
|
|
3
|
+
declare const checkboxCardStyle: ComponentSlotStyle<"group" | "root" | "description" | "indicator" | "addon", {
|
|
4
4
|
/**
|
|
5
5
|
* The justify indicator of the component
|
|
6
6
|
*
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ComponentSlotStyle } from "../../core/system/index.types.js";
|
|
2
2
|
import { CSSPropObject, CSSSlotObject } from "../../core/css/index.types.js";
|
|
3
3
|
//#region src/components/color-picker/color-picker.style.d.ts
|
|
4
|
-
declare const colorPickerStyle: ComponentSlotStyle<"input" | "content" | "icon" | "root" | "
|
|
4
|
+
declare const colorPickerStyle: ComponentSlotStyle<"input" | "content" | "icon" | "root" | "field" | "colorSwatch" | "eyeDropper", CSSPropObject<CSSSlotObject<"input" | "content" | "icon" | "root" | "field" | "colorSwatch" | "eyeDropper">>, {
|
|
5
5
|
xs: {
|
|
6
6
|
field: {
|
|
7
7
|
fontSize: "1em";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ComponentSlotStyle } from "../../core/system/index.types.js";
|
|
2
2
|
//#region src/components/data-list/data-list.style.d.ts
|
|
3
|
-
declare const dataListStyle: ComponentSlotStyle<"term" | "
|
|
3
|
+
declare const dataListStyle: ComponentSlotStyle<"term" | "item" | "root" | "description", {
|
|
4
4
|
/**
|
|
5
5
|
* The orientation of the data list.
|
|
6
6
|
*
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ComponentSlotStyle } from "../../core/system/index.types.js";
|
|
2
2
|
import { CSSModifierObject, CSSPropObject, CSSSlotObject } from "../../core/css/index.types.js";
|
|
3
3
|
//#region src/components/empty-state/empty-state.style.d.ts
|
|
4
|
-
declare const emptyState: ComponentSlotStyle<"title" | "content" | "root" | "
|
|
4
|
+
declare const emptyState: ComponentSlotStyle<"title" | "content" | "root" | "description" | "indicator", CSSPropObject<CSSSlotObject<"title" | "content" | "root" | "description" | "indicator">>, {
|
|
5
5
|
sm: {
|
|
6
6
|
content: {
|
|
7
7
|
gap: "xs";
|
|
@@ -47,7 +47,7 @@ declare const emptyState: ComponentSlotStyle<"title" | "content" | "root" | "ind
|
|
|
47
47
|
fontSize: "xl";
|
|
48
48
|
};
|
|
49
49
|
};
|
|
50
|
-
}, CSSModifierObject<CSSSlotObject<"title" | "content" | "root" | "
|
|
50
|
+
}, CSSModifierObject<CSSSlotObject<"title" | "content" | "root" | "description" | "indicator">>>;
|
|
51
51
|
type EmptyState = typeof emptyState;
|
|
52
52
|
//#endregion
|
|
53
53
|
export { EmptyState, emptyState };
|
|
@@ -82,7 +82,7 @@ declare const Flip: Component<({
|
|
|
82
82
|
onChange,
|
|
83
83
|
onClick: onClickProp,
|
|
84
84
|
...rest
|
|
85
|
-
}: WithoutThemeProps<FlipProps, ComponentSlotStyle<"from" | "to" | "
|
|
85
|
+
}: WithoutThemeProps<FlipProps, ComponentSlotStyle<"from" | "to" | "item" | "root", CSSPropObject<CSSSlotObject<"from" | "to" | "item" | "root">>, CSSModifierObject<CSSSlotObject<"from" | "to" | "item" | "root">>, CSSModifierObject<CSSSlotObject<"from" | "to" | "item" | "root">>>, keyof FlipProps>) => _$react_jsx_runtime0.JSX.Element, FlipProps>;
|
|
86
86
|
//#endregion
|
|
87
87
|
export { Flip, FlipProps, FlipPropsContext, useFlipPropsContext };
|
|
88
88
|
//# sourceMappingURL=flip.d.ts.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ComponentSlotStyle } from "../../core/system/index.types.js";
|
|
2
2
|
import { CSSModifierObject, CSSPropObject, CSSSlotObject } from "../../core/css/index.types.js";
|
|
3
3
|
//#region src/components/flip/flip.style.d.ts
|
|
4
|
-
declare const flipStyle: ComponentSlotStyle<"from" | "to" | "
|
|
4
|
+
declare const flipStyle: ComponentSlotStyle<"from" | "to" | "item" | "root", CSSPropObject<CSSSlotObject<"from" | "to" | "item" | "root">>, CSSModifierObject<CSSSlotObject<"from" | "to" | "item" | "root">>, CSSModifierObject<CSSSlotObject<"from" | "to" | "item" | "root">>>;
|
|
5
5
|
type FlipStyle = typeof flipStyle;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { FlipStyle, flipStyle };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ComponentSlotStyle } from "../../core/system/index.types.js";
|
|
2
2
|
import { CSSModifierObject, CSSSlotObject } from "../../core/css/index.types.js";
|
|
3
3
|
//#region src/components/list/list.style.d.ts
|
|
4
|
-
declare const listStyle: ComponentSlotStyle<"icon" | "
|
|
4
|
+
declare const listStyle: ComponentSlotStyle<"icon" | "item" | "root", {
|
|
5
5
|
styleType: {
|
|
6
6
|
circle: {
|
|
7
7
|
root: {
|
|
@@ -35,7 +35,7 @@ declare const listStyle: ComponentSlotStyle<"icon" | "root" | "item", {
|
|
|
35
35
|
};
|
|
36
36
|
};
|
|
37
37
|
};
|
|
38
|
-
}, CSSModifierObject<CSSSlotObject<"icon" | "
|
|
38
|
+
}, CSSModifierObject<CSSSlotObject<"icon" | "item" | "root">>, CSSModifierObject<CSSSlotObject<"icon" | "item" | "root">>>;
|
|
39
39
|
type ListStyle = typeof listStyle;
|
|
40
40
|
//#endregion
|
|
41
41
|
export { ListStyle, listStyle };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ComponentSlotStyle } from "../../core/system/index.types.js";
|
|
2
2
|
import { CSSModifierObject, CSSPropObject, CSSSlotObject } from "../../core/css/index.types.js";
|
|
3
3
|
//#region src/components/menu/menu.style.d.ts
|
|
4
|
-
declare const menuStyle: ComponentSlotStyle<"footer" | "header" | "label" | "content" | "command" | "group" | "separator" | "
|
|
4
|
+
declare const menuStyle: ComponentSlotStyle<"footer" | "header" | "label" | "content" | "command" | "group" | "separator" | "item" | "indicator", CSSPropObject<CSSSlotObject<"footer" | "header" | "label" | "content" | "command" | "group" | "separator" | "item" | "indicator">>, {
|
|
5
5
|
sm: {
|
|
6
6
|
command: {
|
|
7
7
|
fontSize: "2xs";
|
|
@@ -86,7 +86,7 @@ declare const menuStyle: ComponentSlotStyle<"footer" | "header" | "label" | "con
|
|
|
86
86
|
px: "2";
|
|
87
87
|
};
|
|
88
88
|
};
|
|
89
|
-
}, CSSModifierObject<CSSSlotObject<"footer" | "header" | "label" | "content" | "command" | "group" | "separator" | "
|
|
89
|
+
}, CSSModifierObject<CSSSlotObject<"footer" | "header" | "label" | "content" | "command" | "group" | "separator" | "item" | "indicator">>>;
|
|
90
90
|
type MenuStyle = typeof menuStyle;
|
|
91
91
|
//#endregion
|
|
92
92
|
export { MenuStyle, menuStyle };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ComponentSlotStyle } from "../../core/system/index.types.js";
|
|
2
2
|
import { CSSModifierObject, CSSSlotObject } from "../../core/css/index.types.js";
|
|
3
3
|
//#region src/components/native-accordion/native-accordion.style.d.ts
|
|
4
|
-
declare const nativeAccordionStyle: ComponentSlotStyle<"button" | "panel" | "icon" | "
|
|
4
|
+
declare const nativeAccordionStyle: ComponentSlotStyle<"button" | "panel" | "icon" | "item" | "root", {
|
|
5
5
|
/**
|
|
6
6
|
* If `true`, animate the accordion items when they are expanded or collapsed.
|
|
7
7
|
*
|
|
@@ -31,7 +31,7 @@ declare const nativeAccordionStyle: ComponentSlotStyle<"button" | "panel" | "ico
|
|
|
31
31
|
};
|
|
32
32
|
};
|
|
33
33
|
};
|
|
34
|
-
}, CSSModifierObject<CSSSlotObject<"button" | "panel" | "icon" | "
|
|
34
|
+
}, CSSModifierObject<CSSSlotObject<"button" | "panel" | "icon" | "item" | "root">>, {
|
|
35
35
|
panel: {
|
|
36
36
|
button: {
|
|
37
37
|
rounded: "l2";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ComponentSlotStyle } from "../../core/system/index.types.js";
|
|
2
2
|
import { CSSModifierObject, CSSPropObject, CSSSlotObject } from "../../core/css/index.types.js";
|
|
3
3
|
//#region src/components/notice/notice.style.d.ts
|
|
4
|
-
declare const noticeStyle: ComponentSlotStyle<"content" | "
|
|
4
|
+
declare const noticeStyle: ComponentSlotStyle<"content" | "item" | "root" | "closeButton", CSSPropObject<CSSSlotObject<"content" | "item" | "root" | "closeButton">>, CSSModifierObject<CSSSlotObject<"content" | "item" | "root" | "closeButton">>, CSSModifierObject<CSSSlotObject<"content" | "item" | "root" | "closeButton">>>;
|
|
5
5
|
type NoticeStyle = typeof noticeStyle;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { NoticeStyle };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ComponentSlotStyle } from "../../core/system/index.types.js";
|
|
2
2
|
import { CSSPropObject, CSSSlotObject } from "../../core/css/index.types.js";
|
|
3
3
|
//#region src/components/number-input/number-input.style.d.ts
|
|
4
|
-
declare const numberInputStyle: ComponentSlotStyle<"button" | "root" | "field" | "
|
|
4
|
+
declare const numberInputStyle: ComponentSlotStyle<"button" | "root" | "field" | "control" | "decrement" | "increment", CSSPropObject<CSSSlotObject<"button" | "root" | "field" | "control" | "decrement" | "increment">>, {
|
|
5
5
|
xs: {
|
|
6
6
|
control: {
|
|
7
7
|
boxSize: "calc({--height} - {spaces.2})";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ComponentSlotStyle } from "../../core/system/index.types.js";
|
|
2
2
|
import { CSSPropObject, CSSSlotObject } from "../../core/css/index.types.js";
|
|
3
3
|
//#region src/components/pagination/pagination.style.d.ts
|
|
4
|
-
declare const paginationStyle: ComponentSlotStyle<"text" | "
|
|
4
|
+
declare const paginationStyle: ComponentSlotStyle<"text" | "item" | "root", CSSPropObject<CSSSlotObject<"text" | "item" | "root">>, {
|
|
5
5
|
xs: {
|
|
6
6
|
item: {
|
|
7
7
|
fontSize: "{font-size}";
|
|
@@ -55,7 +55,7 @@ interface RadioCardRootProps<Y extends string = string> extends Merge<HTMLStyled
|
|
|
55
55
|
*/
|
|
56
56
|
rootProps?: HTMLStyledProps<"label">;
|
|
57
57
|
}
|
|
58
|
-
declare const component: <H extends "fragment" | As = "div", R extends _$_yamada_ui_utils0.Dict = _$_yamada_ui_utils0.Dict<any>>(el: H | _$react.FC<R>, slot?: ComponentSlot<ComponentSlotName<ComponentSlotStyle<"group" | "root" | "
|
|
58
|
+
declare const component: <H extends "fragment" | As = "div", R extends _$_yamada_ui_utils0.Dict = _$_yamada_ui_utils0.Dict<any>>(el: H | _$react.FC<R>, slot?: ComponentSlot<ComponentSlotName<ComponentSlotStyle<"group" | "root" | "description" | "indicator" | "addon", {
|
|
59
59
|
justify: {
|
|
60
60
|
end: {
|
|
61
61
|
addon: {
|
|
@@ -232,7 +232,7 @@ declare const component: <H extends "fragment" | As = "div", R extends _$_yamada
|
|
|
232
232
|
name,
|
|
233
233
|
className,
|
|
234
234
|
...options
|
|
235
|
-
}?: ComponentOptions) => (initialProps?: InitialProps<R>, ...superProps: SuperProps<R>[]) => H extends "fragment" ? _$react.FunctionComponent<R> : Component<Exclude<H, "fragment">, R>, RadioCardPropsContext: _$react.Context<Partial<RadioCardRootProps<string>> | undefined>, useRadioCardPropsContext: () => Partial<RadioCardRootProps<string>> | undefined, useRootComponentProps: <Y extends _$_yamada_ui_utils0.Dict = {}, R extends keyof Y = keyof Y>(props: Y, slot?: ComponentSlot<ComponentSlotName<ComponentSlotStyle<"group" | "root" | "
|
|
235
|
+
}?: ComponentOptions) => (initialProps?: InitialProps<R>, ...superProps: SuperProps<R>[]) => H extends "fragment" ? _$react.FunctionComponent<R> : Component<Exclude<H, "fragment">, R>, RadioCardPropsContext: _$react.Context<Partial<RadioCardRootProps<string>> | undefined>, useRadioCardPropsContext: () => Partial<RadioCardRootProps<string>> | undefined, useRootComponentProps: <Y extends _$_yamada_ui_utils0.Dict = {}, R extends keyof Y = keyof Y>(props: Y, slot?: ComponentSlot<ComponentSlotName<ComponentSlotStyle<"group" | "root" | "description" | "indicator" | "addon", {
|
|
236
236
|
justify: {
|
|
237
237
|
end: {
|
|
238
238
|
addon: {
|
|
@@ -409,7 +409,7 @@ declare const component: <H extends "fragment" | As = "div", R extends _$_yamada
|
|
|
409
409
|
className,
|
|
410
410
|
withContext,
|
|
411
411
|
transferProps
|
|
412
|
-
}?: UseComponentPropsOptions<R>) => [CSSSlotObject, Merge<WithoutThemeProps<Y, ComponentSlotStyle<"group" | "root" | "
|
|
412
|
+
}?: UseComponentPropsOptions<R>) => [CSSSlotObject, Merge<WithoutThemeProps<Y, ComponentSlotStyle<"group" | "root" | "description" | "indicator" | "addon", {
|
|
413
413
|
justify: {
|
|
414
414
|
end: {
|
|
415
415
|
addon: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ComponentSlotStyle } from "../../core/system/index.types.js";
|
|
2
2
|
//#region src/components/radio-card/radio-card.style.d.ts
|
|
3
|
-
declare const radioCardStyle: ComponentSlotStyle<"group" | "root" | "
|
|
3
|
+
declare const radioCardStyle: ComponentSlotStyle<"group" | "root" | "description" | "indicator" | "addon", {
|
|
4
4
|
/**
|
|
5
5
|
* The justify indicator of the component
|
|
6
6
|
*
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ComponentSlotStyle } from "../../core/system/index.types.js";
|
|
2
2
|
import { CSSModifierObject, CSSPropObject, CSSSlotObject } from "../../core/css/index.types.js";
|
|
3
3
|
//#region src/components/rating/rating.style.d.ts
|
|
4
|
-
declare const ratingStyle: ComponentSlotStyle<"group" | "icon" | "
|
|
4
|
+
declare const ratingStyle: ComponentSlotStyle<"group" | "icon" | "item" | "root", CSSPropObject<CSSSlotObject<"group" | "icon" | "item" | "root">>, {
|
|
5
5
|
xs: {
|
|
6
6
|
icon: {
|
|
7
7
|
fontSize: "md";
|
|
@@ -27,7 +27,7 @@ declare const ratingStyle: ComponentSlotStyle<"group" | "icon" | "root" | "item"
|
|
|
27
27
|
fontSize: "3xl";
|
|
28
28
|
};
|
|
29
29
|
};
|
|
30
|
-
}, CSSModifierObject<CSSSlotObject<"group" | "icon" | "
|
|
30
|
+
}, CSSModifierObject<CSSSlotObject<"group" | "icon" | "item" | "root">>>;
|
|
31
31
|
type RatingStyle = typeof ratingStyle;
|
|
32
32
|
//#endregion
|
|
33
33
|
export { RatingStyle, ratingStyle };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ComponentSlotStyle } from "../../core/system/index.types.js";
|
|
2
2
|
//#region src/components/reorder/reorder.style.d.ts
|
|
3
|
-
declare const reorderStyle: ComponentSlotStyle<"
|
|
3
|
+
declare const reorderStyle: ComponentSlotStyle<"item" | "root" | "trigger", {
|
|
4
4
|
/**
|
|
5
5
|
* The orientation of the reorder.
|
|
6
6
|
*
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ComponentSlotStyle } from "../../core/system/index.types.js";
|
|
2
2
|
import { CSSModifierObject, CSSSlotObject } from "../../core/css/index.types.js";
|
|
3
3
|
//#region src/components/resizable/resizable.style.d.ts
|
|
4
|
-
declare const resizableStyle: ComponentSlotStyle<"icon" | "
|
|
4
|
+
declare const resizableStyle: ComponentSlotStyle<"icon" | "item" | "root" | "trigger", {
|
|
5
5
|
/**
|
|
6
6
|
* The orientation of the resizable.
|
|
7
7
|
*
|
|
@@ -19,7 +19,7 @@ declare const resizableStyle: ComponentSlotStyle<"icon" | "root" | "trigger" | "
|
|
|
19
19
|
};
|
|
20
20
|
};
|
|
21
21
|
};
|
|
22
|
-
}, CSSModifierObject<CSSSlotObject<"icon" | "
|
|
22
|
+
}, CSSModifierObject<CSSSlotObject<"icon" | "item" | "root" | "trigger">>, {
|
|
23
23
|
border: {
|
|
24
24
|
icon: {
|
|
25
25
|
bg: "colorScheme.muted";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ComponentSlotStyle } from "../../core/system/index.types.js";
|
|
2
2
|
import { CSSModifierObject, CSSSlotObject } from "../../core/css/index.types.js";
|
|
3
3
|
//#region src/components/segmented-control/segmented-control.style.d.ts
|
|
4
|
-
declare const segmentedControlStyle: ComponentSlotStyle<"
|
|
4
|
+
declare const segmentedControlStyle: ComponentSlotStyle<"item" | "root" | "indicator", {
|
|
5
5
|
/**
|
|
6
6
|
* If `true`, the segmented control will be full rounded.
|
|
7
7
|
*
|
|
@@ -113,7 +113,7 @@ declare const segmentedControlStyle: ComponentSlotStyle<"root" | "indicator" | "
|
|
|
113
113
|
};
|
|
114
114
|
};
|
|
115
115
|
};
|
|
116
|
-
}, CSSModifierObject<CSSSlotObject<"
|
|
116
|
+
}, CSSModifierObject<CSSSlotObject<"item" | "root" | "indicator">>>;
|
|
117
117
|
type SegmentedControlStyle = typeof segmentedControlStyle;
|
|
118
118
|
//#endregion
|
|
119
119
|
export { SegmentedControlStyle, segmentedControlStyle };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ComponentSlotStyle } from "../../core/system/index.types.js";
|
|
2
2
|
//#region src/components/steps/steps.style.d.ts
|
|
3
|
-
declare const stepsStyle: ComponentSlotStyle<"title" | "list" | "separator" | "
|
|
3
|
+
declare const stepsStyle: ComponentSlotStyle<"title" | "list" | "separator" | "item" | "root" | "description" | "indicator", {
|
|
4
4
|
/**
|
|
5
5
|
* The orientation of the steps.
|
|
6
6
|
*
|
|
@@ -69,7 +69,7 @@ declare const TimelineRoot: Component<({
|
|
|
69
69
|
index,
|
|
70
70
|
items,
|
|
71
71
|
...rest
|
|
72
|
-
}: WithoutThemeProps<TimelineRootProps, ComponentSlotStyle<"title" | "content" | "
|
|
72
|
+
}: WithoutThemeProps<TimelineRootProps, ComponentSlotStyle<"title" | "content" | "item" | "root" | "description" | "indicator" | "connector", {
|
|
73
73
|
align: {
|
|
74
74
|
center: {
|
|
75
75
|
content: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ComponentSlotStyle } from "../../core/system/index.types.js";
|
|
2
2
|
//#region src/components/timeline/timeline.style.d.ts
|
|
3
|
-
declare const timelineStyle: ComponentSlotStyle<"title" | "content" | "
|
|
3
|
+
declare const timelineStyle: ComponentSlotStyle<"title" | "content" | "item" | "root" | "description" | "indicator" | "connector", {
|
|
4
4
|
/**
|
|
5
5
|
* The alignment of the timeline.
|
|
6
6
|
*
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ComponentSlotStyle } from "../../core/system/index.types.js";
|
|
2
2
|
//#region src/components/tree/tree.style.d.ts
|
|
3
|
-
declare const treeStyle: ComponentSlotStyle<"label" | "checkbox" | "group" | "end" | "start" | "element" | "
|
|
3
|
+
declare const treeStyle: ComponentSlotStyle<"label" | "checkbox" | "group" | "end" | "start" | "element" | "item" | "root" | "indicator", {
|
|
4
4
|
/**
|
|
5
5
|
* The shape of the component
|
|
6
6
|
*
|