@yamada-ui/checkbox 2.0.0-next-20240619220221 → 2.0.0-next-20240701004015

Sign up to get free protection for your applications and to get access to all the features.
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts","../src/checkbox.tsx","../src/checkbox-group.tsx"],"sourcesContent":["export { Checkbox, CheckboxIcon, useCheckbox } from \"./checkbox\"\nexport type {\n CheckboxProps,\n CheckboxIconProps,\n UseCheckboxProps,\n UseCheckboxReturn,\n} from \"./checkbox\"\nexport { CheckboxGroup, useCheckboxGroup } from \"./checkbox-group\"\nexport type {\n CheckboxItem,\n CheckboxGroupProps,\n UseCheckboxGroupProps,\n UseCheckboxGroupReturn,\n} from \"./checkbox-group\"\n","import type {\n HTMLUIProps,\n ThemeProps,\n ComponentArgs,\n UIPropGetter,\n} from \"@yamada-ui/core\"\nimport { ui, useMultiComponentStyle, omitThemeProps } from \"@yamada-ui/core\"\nimport type { FormControlOptions } from \"@yamada-ui/form-control\"\nimport {\n useFormControl,\n useFormControlProps,\n formControlProperties,\n} from \"@yamada-ui/form-control\"\nimport type { SVGMotionProps } from \"@yamada-ui/motion\"\nimport { AnimatePresence, motion } from \"@yamada-ui/motion\"\nimport { trackFocusVisible } from \"@yamada-ui/use-focus-visible\"\nimport type { Dict, Merge, PropGetter } from \"@yamada-ui/utils\"\nimport {\n cx,\n useCallbackRef,\n useSafeLayoutEffect,\n useUpdateEffect,\n handlerAll,\n dataAttr,\n mergeRefs,\n funcAll,\n splitObject,\n} from \"@yamada-ui/utils\"\nimport type {\n ChangeEvent,\n ChangeEventHandler,\n CSSProperties,\n FC,\n FocusEventHandler,\n InputHTMLAttributes,\n KeyboardEvent,\n ReactElement,\n SyntheticEvent,\n ForwardedRef,\n Ref,\n DOMAttributes,\n} from \"react\"\nimport {\n cloneElement,\n useCallback,\n useEffect,\n useRef,\n useState,\n forwardRef,\n useId,\n} from \"react\"\nimport { useCheckboxGroupContext } from \"./checkbox-group\"\n\nexport type UseCheckboxProps<Y extends string | number = string> =\n FormControlOptions & {\n /**\n * id assigned to input.\n */\n id?: string\n /**\n * The HTML `name` attribute used for forms.\n */\n name?: string\n /**\n * The value to be used in the checkbox input.\n */\n value?: Y\n /**\n * If `true`, the checkbox will be initially checked.\n *\n * @default false\n */\n defaultIsChecked?: boolean\n /**\n * If `true`, the checkbox will be checked.\n *\n * @default false\n */\n isChecked?: boolean\n /**\n * If `true`, the checkbox will be indeterminate.\n *\n * @default false\n */\n isIndeterminate?: boolean\n /**\n * The callback invoked when the checked state changes.\n */\n onChange?: ChangeEventHandler<HTMLInputElement>\n /**\n * The callback invoked when the checkbox is focused.\n */\n onFocus?: FocusEventHandler<HTMLInputElement>\n /**\n * The callback invoked when the checkbox is blurred.\n */\n onBlur?: FocusEventHandler<HTMLInputElement>\n /**\n * The tab-index property of the underlying input element.\n */\n tabIndex?: number\n }\n\nexport const useCheckbox = <\n Y extends string | number = string,\n M extends Dict = Dict,\n>({\n id,\n ...props\n}: UseCheckboxProps<Y> & M) => {\n id ??= useId()\n const {\n id: _id,\n name,\n value,\n isChecked: isCheckedProp,\n defaultIsChecked,\n tabIndex,\n required,\n disabled,\n readOnly,\n isIndeterminate,\n onChange: onChangeProp,\n onFocus: onFocusProp,\n onBlur: onBlurProp,\n ...computedProps\n } = useFormControlProps({ id, ...props })\n const [{ \"aria-readonly\": _ariaReadonly, ...formControlProps }, rest] =\n splitObject(computedProps, formControlProperties)\n\n const [isFocusVisible, setIsFocusVisible] = useState<boolean>(false)\n const [isFocused, setFocused] = useState<boolean>(false)\n const [isHovered, setHovered] = useState<boolean>(false)\n const [isActive, setActive] = useState<boolean>(false)\n\n const inputRef = useRef<HTMLInputElement>(null)\n const [isLabel, setIsLabel] = useState<boolean>(true)\n\n const [isChecked, setIsChecked] = useState<boolean>(!!defaultIsChecked)\n\n const isControlled = isCheckedProp !== undefined\n const checked = isControlled ? (isCheckedProp as boolean) : isChecked\n\n const onChange = useCallbackRef(\n (ev: ChangeEvent<HTMLInputElement>) => {\n if (readOnly || disabled) {\n ev.preventDefault()\n\n return\n }\n\n if (!isControlled)\n setIsChecked(!checked || isIndeterminate ? true : ev.target.checked)\n\n onChangeProp?.(ev)\n },\n [readOnly, disabled, isControlled, checked, isIndeterminate],\n )\n const onFocus = useCallbackRef(onFocusProp)\n const onBlur = useCallbackRef(onBlurProp)\n\n const onKeyDown = useCallback(\n ({ key }: KeyboardEvent<Element>) => {\n if (key === \" \") setActive(true)\n },\n [setActive],\n )\n\n const onKeyUp = useCallback(\n ({ key }: KeyboardEvent<Element>) => {\n if (key === \" \") setActive(false)\n },\n [setActive],\n )\n\n useEffect(() => {\n return trackFocusVisible(setIsFocusVisible)\n }, [])\n\n useSafeLayoutEffect(() => {\n if (inputRef.current)\n inputRef.current.indeterminate = Boolean(isIndeterminate)\n }, [isIndeterminate])\n\n useUpdateEffect(() => {\n if (disabled) setFocused(false)\n }, [disabled, setFocused])\n\n useSafeLayoutEffect(() => {\n if (!inputRef.current?.form) return\n\n inputRef.current.form.onreset = () => setIsChecked(!!defaultIsChecked)\n }, [])\n\n useSafeLayoutEffect(() => {\n if (!inputRef.current) return\n\n if (inputRef.current.checked !== checked)\n setIsChecked(inputRef.current.checked)\n }, [inputRef.current])\n\n const getContainerProps: UIPropGetter = useCallback(\n (props = {}, ref = null) => ({\n ...formControlProps,\n ...props,\n ref: mergeRefs(ref, (el: HTMLElement | undefined) => {\n if (el) setIsLabel(el.tagName === \"LABEL\")\n }),\n \"data-checked\": dataAttr(checked),\n onClick: handlerAll(props.onClick, () => {\n if (isLabel) return\n\n inputRef.current?.click()\n\n requestAnimationFrame(() => inputRef.current?.focus())\n }),\n }),\n [checked, isLabel, formControlProps],\n )\n\n const getIconProps: UIPropGetter = useCallback(\n (props = {}, ref = null) => ({\n ...formControlProps,\n ...props,\n ref,\n \"data-active\": dataAttr(isActive),\n \"data-hover\": dataAttr(isHovered),\n \"data-checked\": dataAttr(checked),\n \"data-focus\": dataAttr(isFocused),\n \"data-focus-visible\": dataAttr(isFocused && isFocusVisible),\n \"data-indeterminate\": dataAttr(isIndeterminate),\n \"aria-hidden\": true,\n onMouseDown: handlerAll(props.onMouseDown, (ev: React.MouseEvent) => {\n if (isFocused) ev.preventDefault()\n\n setActive(true)\n }),\n onMouseUp: handlerAll(props.onMouseUp, () => setActive(false)),\n onMouseEnter: handlerAll(props.onMouseEnter, () => setHovered(true)),\n onMouseLeave: handlerAll(props.onMouseLeave, () => setHovered(false)),\n }),\n [\n isActive,\n checked,\n isFocused,\n isHovered,\n isFocusVisible,\n isIndeterminate,\n formControlProps,\n ],\n )\n\n const getInputProps: PropGetter = useCallback(\n (props = {}, ref = null) => ({\n ...formControlProps,\n ...props,\n ref: mergeRefs(inputRef, ref),\n id,\n type: \"checkbox\",\n name,\n value,\n tabIndex,\n required,\n disabled,\n readOnly,\n checked,\n style: {\n border: \"0px\",\n clip: \"rect(0px, 0px, 0px, 0px)\",\n height: \"1px\",\n width: \"1px\",\n margin: \"-1px\",\n padding: \"0px\",\n overflow: \"hidden\",\n whiteSpace: \"nowrap\",\n position: \"absolute\",\n },\n onChange: handlerAll(props.onChange, onChange),\n onBlur: handlerAll(props.onBlur, onBlur, () => setFocused(false)),\n onFocus: handlerAll(props.onFocus, onFocus, () => setFocused(true)),\n onKeyDown: handlerAll(props.onKeyDown, onKeyDown),\n onKeyUp: handlerAll(props.onKeyUp, onKeyUp),\n }),\n [\n formControlProps,\n id,\n name,\n value,\n tabIndex,\n required,\n disabled,\n readOnly,\n checked,\n onChange,\n onBlur,\n onFocus,\n onKeyDown,\n onKeyUp,\n ],\n )\n\n const getLabelProps: PropGetter = useCallback(\n (props = {}, ref = null) => ({\n ...formControlProps,\n ...props,\n ref,\n \"data-checked\": dataAttr(checked),\n onMouseDown: handlerAll(props.onMouseDown, (ev: SyntheticEvent) => {\n ev.preventDefault()\n ev.stopPropagation()\n }),\n onTouchStart: handlerAll(props.onTouchStart, (ev: SyntheticEvent) => {\n ev.preventDefault()\n ev.stopPropagation()\n }),\n }),\n [checked, formControlProps],\n )\n\n return {\n props: rest,\n isFocusVisible,\n isFocused,\n isHovered,\n isActive,\n isChecked: checked,\n isIndeterminate,\n getContainerProps,\n getIconProps,\n getInputProps,\n getLabelProps,\n }\n}\n\nexport type UseCheckboxReturn = ReturnType<typeof useCheckbox>\n\ntype CheckboxOptions = {\n /**\n * Props for icon component.\n */\n iconProps?: Omit<HTMLUIProps<\"span\">, \"children\"> & { children: ReactElement }\n /**\n * Props for input element.\n */\n inputProps?: InputHTMLAttributes<HTMLInputElement>\n /**\n * Props for label element.\n */\n labelProps?: HTMLUIProps<\"span\">\n}\n\nexport type CheckboxProps<Y extends string | number = string> = Omit<\n Merge<HTMLUIProps<\"label\">, UseCheckboxProps<Y>>,\n \"checked\"\n> &\n ThemeProps<\"Checkbox\"> &\n CheckboxOptions\n\n/**\n * `Checkbox` is a component used for allowing users to select multiple values from multiple options.\n *\n * @see Docs https://yamada-ui.com/components/forms/checkbox\n */\nexport const Checkbox = forwardRef(\n <Y extends string | number = string>(\n props: CheckboxProps<Y>,\n ref: ForwardedRef<HTMLInputElement>,\n ) => {\n const group = useCheckboxGroupContext()\n const { value: groupValue, ...groupProps } = { ...group }\n const control = useFormControl(props)\n const [styles, mergedProps] = useMultiComponentStyle(\"Checkbox\", {\n ...groupProps,\n ...props,\n })\n const {\n className,\n gap = \"0.5rem\",\n isRequired = groupProps.isRequired ?? control.isRequired,\n isReadOnly = groupProps.isReadOnly ?? control.isReadOnly,\n isDisabled = groupProps.isDisabled ?? control.isDisabled,\n isInvalid = groupProps.isInvalid ?? control.isInvalid,\n iconProps,\n inputProps,\n labelProps,\n children,\n ...computedProps\n } = omitThemeProps(mergedProps)\n\n const isCheckedProp =\n groupValue && computedProps.value\n ? groupValue.includes(computedProps.value)\n : computedProps.isChecked\n const onChange =\n groupProps.onChange && computedProps.value\n ? funcAll(groupProps.onChange, computedProps.onChange)\n : computedProps.onChange\n\n const {\n isChecked,\n isIndeterminate,\n getContainerProps,\n getInputProps,\n getIconProps,\n getLabelProps,\n props: rest,\n } = useCheckbox({\n ...computedProps,\n isRequired,\n isReadOnly,\n isDisabled,\n isInvalid,\n isChecked: isCheckedProp,\n onChange,\n })\n\n const { children: customIcon, ...resolvedIconProps } = { ...iconProps }\n const cloneIcon = cloneElement(customIcon ?? <CheckboxIcon />, {\n __css: {\n opacity: isChecked || isIndeterminate ? 1 : 0,\n transform: isChecked || isIndeterminate ? \"scale(1)\" : \"scale(0.95)\",\n transitionProperty: \"transform\",\n transitionDuration: \"normal\",\n },\n isIndeterminate,\n isChecked,\n isRequired,\n isReadOnly,\n isDisabled,\n isInvalid,\n })\n\n return (\n <ui.label\n className={cx(\"ui-checkbox\", className)}\n {...getContainerProps()}\n __css={{\n gap,\n ...styles.container,\n }}\n {...rest}\n >\n <ui.input\n className=\"ui-checkbox__input\"\n {...getInputProps(inputProps, ref)}\n />\n\n <ui.span\n className=\"ui-checkbox__icon\"\n __css={{\n pointerEvents: isReadOnly ? \"none\" : undefined,\n ...styles.icon,\n }}\n {...getIconProps(resolvedIconProps)}\n >\n {cloneIcon}\n </ui.span>\n\n <ui.span\n className=\"ui-checkbox__label\"\n __css={{ ...styles.label }}\n {...getLabelProps(labelProps as DOMAttributes<HTMLElement>)}\n >\n {children}\n </ui.span>\n </ui.label>\n )\n },\n) as {\n <Y extends string | number = string>(\n props: CheckboxProps<Y> & { ref?: Ref<HTMLInputElement> },\n ): JSX.Element\n} & ComponentArgs\n\nCheckbox.displayName = \"Checkbox\"\n\nexport type CheckboxIconProps = HTMLUIProps<\"svg\"> &\n SVGMotionProps<SVGSVGElement> &\n FormControlOptions & {\n /**\n * If `true`, the icon will be indeterminate.\n *\n * @default false\n */\n isIndeterminate?: boolean\n /**\n * If `true`, the icon will be checked.\n *\n * @default false\n */\n isChecked?: boolean\n }\n\nexport const CheckboxIcon: FC<CheckboxIconProps> = ({\n isIndeterminate,\n isChecked,\n isRequired: _isRequired,\n isReadOnly: _isReadOnly,\n isDisabled: _isDisabled,\n isInvalid: _isInvalid,\n ...rest\n}) => {\n return (\n <AnimatePresence initial={false}>\n {isIndeterminate || isChecked ? (\n <ui.div\n __css={{\n position: \"absolute\",\n top: \"50%\",\n left: \"50%\",\n transform: \"translate(-50%, -50%)\",\n }}\n >\n <ui.div\n as={motion.div}\n variants={{\n unchecked: { scale: 0.5 },\n checked: { scale: 1 },\n }}\n initial=\"unchecked\"\n animate=\"checked\"\n exit=\"unchecked\"\n style={\n {\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n } as CSSProperties\n }\n >\n {isIndeterminate ? (\n <IndeterminateIcon {...rest} />\n ) : (\n <CheckIcon {...rest} />\n )}\n </ui.div>\n </ui.div>\n ) : null}\n </AnimatePresence>\n )\n}\n\nconst CheckIcon: FC<HTMLUIProps<\"svg\"> & SVGMotionProps<SVGSVGElement>> = (\n props,\n) => {\n return (\n <ui.svg\n as={motion.svg}\n width=\"1.2em\"\n viewBox=\"0 0 12 10\"\n variants={{\n unchecked: {\n opacity: 0,\n strokeDashoffset: 16,\n },\n checked: {\n opacity: 1,\n strokeDashoffset: 0,\n transition: { duration: 0.2 },\n },\n }}\n style={{\n fill: \"none\",\n strokeWidth: 2,\n stroke: \"currentColor\",\n strokeDasharray: 16,\n }}\n {...props}\n >\n <polyline points=\"1.5 6 4.5 9 10.5 1\" />\n </ui.svg>\n )\n}\n\nconst IndeterminateIcon: FC<\n HTMLUIProps<\"svg\"> & SVGMotionProps<SVGSVGElement>\n> = (props) => {\n return (\n <ui.svg\n as={motion.svg}\n width=\"1.2em\"\n viewBox=\"0 0 24 24\"\n variants={{\n unchecked: {\n scaleX: 0.65,\n opacity: 0,\n },\n checked: {\n scaleX: 1,\n opacity: 1,\n transition: {\n scaleX: { duration: 0 },\n opacity: { duration: 0.02 },\n },\n },\n }}\n style={{ stroke: \"currentColor\", strokeWidth: 4 }}\n {...props}\n >\n <line x1=\"21\" x2=\"3\" y1=\"12\" y2=\"12\" />\n </ui.svg>\n )\n}\n","import type { ComponentArgs, ThemeProps, UIPropGetter } from \"@yamada-ui/core\"\nimport type { FormControlOptions } from \"@yamada-ui/form-control\"\nimport { useFormControl } from \"@yamada-ui/form-control\"\nimport type { FlexProps } from \"@yamada-ui/layouts\"\nimport { Flex } from \"@yamada-ui/layouts\"\nimport { useControllableState } from \"@yamada-ui/use-controllable-state\"\nimport type { Dict } from \"@yamada-ui/utils\"\nimport {\n createContext,\n cx,\n isObject,\n useCallbackRef,\n getValidChildren,\n} from \"@yamada-ui/utils\"\nimport type { ChangeEvent, ForwardedRef, ReactElement, Ref } from \"react\"\nimport { forwardRef, useCallback } from \"react\"\nimport type { CheckboxProps } from \"./checkbox\"\nimport { Checkbox } from \"./checkbox\"\n\nexport type CheckboxItem<Y extends string | number = string> =\n CheckboxProps<Y> & {\n label?: string\n }\n\nconst isEvent = (value: any): value is { target: HTMLInputElement } =>\n value && isObject(value) && isObject(value.target)\n\nexport type UseCheckboxGroupProps<Y extends string | number = string> = {\n /**\n * The value of the checkbox group.\n */\n value?: Y[]\n /**\n * The initial value of the checkbox group.\n */\n defaultValue?: Y[]\n /**\n * The callback fired when any children checkbox is checked or unchecked.\n */\n onChange?: (value: Y[]) => void\n /**\n * If `true`, input elements will receive `checked` attribute instead of `isChecked`.\n *\n * This assumes, you're using native radio inputs.\n *\n * @default false\n */\n isNative?: boolean\n}\n\nexport const useCheckboxGroup = <\n Y extends string | number = string,\n M extends Dict = Dict,\n>({\n value: valueProp,\n defaultValue = [],\n onChange: onChangeProp,\n isNative,\n ...props\n}: UseCheckboxGroupProps<Y> & M) => {\n const onChangeRef = useCallbackRef(onChangeProp)\n\n const [value, setValue] = useControllableState({\n value: valueProp,\n defaultValue,\n onChange: onChangeRef,\n })\n\n const onChange = useCallback(\n (evOrValue: ChangeEvent<HTMLInputElement> | Y) => {\n const isChecked = isEvent(evOrValue)\n ? evOrValue.target.checked\n : !value.includes(evOrValue)\n\n const selectedValue = (\n isEvent(evOrValue) ? evOrValue.target.value : evOrValue\n ) as Y\n\n const nextValue = isChecked\n ? [...value, selectedValue]\n : value.filter((v) => String(v) !== String(selectedValue))\n\n setValue(nextValue)\n },\n [value, setValue],\n )\n\n const getCheckboxProps: UIPropGetter<\n \"input\",\n { value?: Y },\n { value?: Y; isChecked?: boolean }\n > = useCallback(\n (props, ref = null) => ({\n ...props,\n ref,\n [isNative ? \"checked\" : \"isChecked\"]: value.some(\n (val) => String(props?.value) === String(val),\n ),\n onChange,\n }),\n [onChange, isNative, value],\n )\n\n return { props, value, setValue, onChange, getCheckboxProps }\n}\n\nexport type UseCheckboxGroupReturn<Y extends string | number = string> =\n ReturnType<typeof useCheckboxGroup<Y>>\n\nexport type CheckboxGroupProps<Y extends string | number = string> =\n ThemeProps<\"Checkbox\"> &\n Omit<FlexProps, \"onChange\"> &\n UseCheckboxGroupProps<Y> &\n FormControlOptions & {\n /**\n * If provided, generate checkboxes based on items.\n *\n * @default '[]'\n */\n items?: CheckboxItem<Y>[]\n }\n\ntype CheckboxContext = ThemeProps<\"Checkbox\"> &\n FormControlOptions & {\n value: (string | number)[]\n onChange: (\n evOrValue: ChangeEvent<HTMLInputElement> | string | number,\n ) => void\n }\n\nconst [CheckboxGroupProvider, useCheckboxGroupContext] = createContext<\n CheckboxContext | undefined\n>({\n strict: false,\n name: \"CheckboxGroupContext\",\n})\n\nexport { useCheckboxGroupContext }\n\nexport const CheckboxGroup = forwardRef(\n <Y extends string | number = string>(\n {\n className,\n size,\n variant,\n colorScheme,\n children,\n items = [],\n direction = \"column\",\n gap,\n ...props\n }: CheckboxGroupProps<Y>,\n ref: ForwardedRef<HTMLDivElement>,\n ) => {\n const { value, onChange, props: computedProps } = useCheckboxGroup<Y>(props)\n const { isRequired, isReadOnly, isDisabled, isInvalid, ...rest } =\n useFormControl(computedProps)\n\n const validChildren = getValidChildren(children)\n let computedChildren: ReactElement[] = []\n\n if (!validChildren.length && items.length) {\n computedChildren = items.map(({ label, value, ...props }, i) => (\n <Checkbox key={i} value={value} {...props}>\n {label}\n </Checkbox>\n ))\n }\n\n return (\n <CheckboxGroupProvider\n value={\n {\n size,\n variant,\n colorScheme,\n isRequired,\n isReadOnly,\n isDisabled,\n isInvalid,\n value,\n onChange,\n } as CheckboxContext\n }\n >\n <Flex\n ref={ref}\n className={cx(\"ui-checkbox-group\", className)}\n role=\"group\"\n direction={direction}\n gap={gap ?? (direction === \"row\" ? \"1rem\" : undefined)}\n {...rest}\n >\n {children ?? computedChildren}\n </Flex>\n </CheckboxGroupProvider>\n )\n },\n) as {\n <Y extends string | number = string>(\n props: CheckboxGroupProps<Y> & { ref?: Ref<HTMLDivElement> },\n ): JSX.Element\n} & ComponentArgs\n\nCheckboxGroup.displayName = \"CheckboxGroup\"\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACMA,kBAA2D;AAE3D,IAAAA,uBAIO;AAEP,oBAAwC;AACxC,+BAAkC;AAElC,IAAAC,gBAUO;AAeP,IAAAC,gBAQO;;;AChDP,0BAA+B;AAE/B,qBAAqB;AACrB,oCAAqC;AAErC,mBAMO;AAEP,mBAAwC;AAoJhC;AA3IR,IAAM,UAAU,CAAC,UACf,aAAS,uBAAS,KAAK,SAAK,uBAAS,MAAM,MAAM;AAyB5C,IAAM,mBAAmB,CAG9B;AAAA,EACA,OAAO;AAAA,EACP,eAAe,CAAC;AAAA,EAChB,UAAU;AAAA,EACV;AAAA,EACA,GAAG;AACL,MAAoC;AAClC,QAAM,kBAAc,6BAAe,YAAY;AAE/C,QAAM,CAAC,OAAO,QAAQ,QAAI,oDAAqB;AAAA,IAC7C,OAAO;AAAA,IACP;AAAA,IACA,UAAU;AAAA,EACZ,CAAC;AAED,QAAM,eAAW;AAAA,IACf,CAAC,cAAiD;AAChD,YAAM,YAAY,QAAQ,SAAS,IAC/B,UAAU,OAAO,UACjB,CAAC,MAAM,SAAS,SAAS;AAE7B,YAAM,gBACJ,QAAQ,SAAS,IAAI,UA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EACxC;AAEJ;AAEA,IAAM,oBAEF,CAAC,UAAU;AACb,SACE;AAAA,IAAC,eAAG;AAAA,IAAH;AAAA,MACC,IAAI,qBAAO;AAAA,MACX,OAAM;AAAA,MACN,SAAQ;AAAA,MACR,UAAU;AAAA,QACR,WAAW;AAAA,UACT,QAAQ;AAAA,UACR,SAAS;AAAA,QACX;AAAA,QACA,SAAS;AAAA,UACP,QAAQ;AAAA,UACR,SAAS;AAAA,UACT,YAAY;AAAA,YACV,QAAQ,EAAE,UAAU,EAAE;AAAA,YACtB,SAAS,EAAE,UAAU,KAAK;AAAA,UAC5B;AAAA,QACF;AAAA,MACF;AAAA,MACA,OAAO,EAAE,QAAQ,gBAAgB,aAAa,EAAE;AAAA,MAC/C,GAAG;AAAA,MAEJ,uDAAC,UAAK,IAAG,MAAK,IAAG,KAAI,IAAG,MAAK,IAAG,MAAK;AAAA;AAAA,EACvC;AAEJ;","names":["import_form_control","import_utils","import_react","props","value","props","import_jsx_runtime","props","_a"]}
1
+ {"version":3,"sources":["../src/index.ts","../src/checkbox.tsx","../src/checkbox-group.tsx"],"sourcesContent":["export { Checkbox, CheckboxIcon, useCheckbox } from \"./checkbox\"\nexport type {\n CheckboxProps,\n CheckboxIconProps,\n UseCheckboxProps,\n UseCheckboxReturn,\n} from \"./checkbox\"\nexport { CheckboxGroup, useCheckboxGroup } from \"./checkbox-group\"\nexport type {\n CheckboxItem,\n CheckboxGroupProps,\n UseCheckboxGroupProps,\n UseCheckboxGroupReturn,\n} from \"./checkbox-group\"\n","import type {\n HTMLUIProps,\n ThemeProps,\n ComponentArgs,\n UIPropGetter,\n} from \"@yamada-ui/core\"\nimport { ui, useMultiComponentStyle, omitThemeProps } from \"@yamada-ui/core\"\nimport type { FormControlOptions } from \"@yamada-ui/form-control\"\nimport {\n useFormControl,\n useFormControlProps,\n formControlProperties,\n} from \"@yamada-ui/form-control\"\nimport type { SVGMotionProps } from \"@yamada-ui/motion\"\nimport { AnimatePresence, motion } from \"@yamada-ui/motion\"\nimport { trackFocusVisible } from \"@yamada-ui/use-focus-visible\"\nimport type { Dict, Merge, PropGetter } from \"@yamada-ui/utils\"\nimport {\n cx,\n useCallbackRef,\n useSafeLayoutEffect,\n useUpdateEffect,\n handlerAll,\n dataAttr,\n mergeRefs,\n funcAll,\n splitObject,\n} from \"@yamada-ui/utils\"\nimport type {\n ChangeEvent,\n ChangeEventHandler,\n CSSProperties,\n FC,\n FocusEventHandler,\n InputHTMLAttributes,\n KeyboardEvent,\n ReactElement,\n SyntheticEvent,\n ForwardedRef,\n Ref,\n DOMAttributes,\n} from \"react\"\nimport {\n cloneElement,\n useCallback,\n useEffect,\n useRef,\n useState,\n forwardRef,\n useId,\n} from \"react\"\nimport { useCheckboxGroupContext } from \"./checkbox-group\"\n\nexport type UseCheckboxProps<Y extends string | number = string> =\n FormControlOptions & {\n /**\n * id assigned to input.\n */\n id?: string\n /**\n * The HTML `name` attribute used for forms.\n */\n name?: string\n /**\n * The value to be used in the checkbox input.\n */\n value?: Y\n /**\n * If `true`, the checkbox will be initially checked.\n *\n * @default false\n */\n defaultIsChecked?: boolean\n /**\n * If `true`, the checkbox will be checked.\n *\n * @default false\n */\n isChecked?: boolean\n /**\n * If `true`, the checkbox will be indeterminate.\n *\n * @default false\n */\n isIndeterminate?: boolean\n /**\n * The callback invoked when the checked state changes.\n */\n onChange?: ChangeEventHandler<HTMLInputElement>\n /**\n * The callback invoked when the checkbox is focused.\n */\n onFocus?: FocusEventHandler<HTMLInputElement>\n /**\n * The callback invoked when the checkbox is blurred.\n */\n onBlur?: FocusEventHandler<HTMLInputElement>\n /**\n * The tab-index property of the underlying input element.\n */\n tabIndex?: number\n }\n\nexport const useCheckbox = <\n Y extends string | number = string,\n M extends Dict = Dict,\n>({\n id,\n ...props\n}: UseCheckboxProps<Y> & M) => {\n id ??= useId()\n const {\n id: _id,\n name,\n value,\n isChecked: isCheckedProp,\n defaultIsChecked,\n tabIndex,\n required,\n disabled,\n readOnly,\n isIndeterminate,\n onChange: onChangeProp,\n onFocus: onFocusProp,\n onBlur: onBlurProp,\n ...computedProps\n } = useFormControlProps({ id, ...props })\n const [{ \"aria-readonly\": _ariaReadonly, ...formControlProps }, rest] =\n splitObject(computedProps, formControlProperties)\n\n const [isFocusVisible, setIsFocusVisible] = useState<boolean>(false)\n const [isFocused, setFocused] = useState<boolean>(false)\n const [isHovered, setHovered] = useState<boolean>(false)\n const [isActive, setActive] = useState<boolean>(false)\n\n const inputRef = useRef<HTMLInputElement>(null)\n const [isLabel, setIsLabel] = useState<boolean>(true)\n\n const [isChecked, setIsChecked] = useState<boolean>(!!defaultIsChecked)\n\n const isControlled = isCheckedProp !== undefined\n const checked = isControlled ? (isCheckedProp as boolean) : isChecked\n\n const onChange = useCallbackRef(\n (ev: ChangeEvent<HTMLInputElement>) => {\n if (readOnly || disabled) {\n ev.preventDefault()\n\n return\n }\n\n if (!isControlled)\n setIsChecked(!checked || isIndeterminate ? true : ev.target.checked)\n\n onChangeProp?.(ev)\n },\n [readOnly, disabled, isControlled, checked, isIndeterminate],\n )\n const onFocus = useCallbackRef(onFocusProp)\n const onBlur = useCallbackRef(onBlurProp)\n\n const onKeyDown = useCallback(\n ({ key }: KeyboardEvent<Element>) => {\n if (key === \" \") setActive(true)\n },\n [setActive],\n )\n\n const onKeyUp = useCallback(\n ({ key }: KeyboardEvent<Element>) => {\n if (key === \" \") setActive(false)\n },\n [setActive],\n )\n\n useEffect(() => {\n return trackFocusVisible(setIsFocusVisible)\n }, [])\n\n useSafeLayoutEffect(() => {\n if (inputRef.current)\n inputRef.current.indeterminate = Boolean(isIndeterminate)\n }, [isIndeterminate])\n\n useUpdateEffect(() => {\n if (disabled) setFocused(false)\n }, [disabled, setFocused])\n\n useSafeLayoutEffect(() => {\n if (!inputRef.current?.form) return\n\n inputRef.current.form.onreset = () => setIsChecked(!!defaultIsChecked)\n }, [])\n\n useSafeLayoutEffect(() => {\n if (!inputRef.current) return\n\n if (inputRef.current.checked !== checked)\n setIsChecked(inputRef.current.checked)\n }, [inputRef.current])\n\n const getContainerProps: UIPropGetter = useCallback(\n (props = {}, ref = null) => ({\n ...formControlProps,\n ...props,\n ref: mergeRefs(ref, (el: HTMLElement | undefined) => {\n if (el) setIsLabel(el.tagName === \"LABEL\")\n }),\n \"data-checked\": dataAttr(checked),\n onClick: handlerAll(props.onClick, () => {\n if (isLabel) return\n\n inputRef.current?.click()\n\n requestAnimationFrame(() => inputRef.current?.focus())\n }),\n }),\n [checked, isLabel, formControlProps],\n )\n\n const getIconProps: UIPropGetter = useCallback(\n (props = {}, ref = null) => ({\n ...formControlProps,\n ...props,\n ref,\n \"data-active\": dataAttr(isActive),\n \"data-hover\": dataAttr(isHovered),\n \"data-checked\": dataAttr(checked),\n \"data-focus\": dataAttr(isFocused),\n \"data-focus-visible\": dataAttr(isFocused && isFocusVisible),\n \"data-indeterminate\": dataAttr(isIndeterminate),\n \"aria-hidden\": true,\n onMouseDown: handlerAll(props.onMouseDown, (ev: React.MouseEvent) => {\n if (isFocused) ev.preventDefault()\n\n setActive(true)\n }),\n onMouseUp: handlerAll(props.onMouseUp, () => setActive(false)),\n onMouseEnter: handlerAll(props.onMouseEnter, () => setHovered(true)),\n onMouseLeave: handlerAll(props.onMouseLeave, () => setHovered(false)),\n }),\n [\n isActive,\n checked,\n isFocused,\n isHovered,\n isFocusVisible,\n isIndeterminate,\n formControlProps,\n ],\n )\n\n const getInputProps: PropGetter = useCallback(\n (props = {}, ref = null) => ({\n ...formControlProps,\n ...props,\n ref: mergeRefs(inputRef, ref),\n id,\n type: \"checkbox\",\n name,\n value,\n tabIndex,\n required,\n disabled,\n readOnly,\n checked,\n \"aria-checked\": isIndeterminate ? \"mixed\" : checked,\n style: {\n border: \"0px\",\n clip: \"rect(0px, 0px, 0px, 0px)\",\n height: \"1px\",\n width: \"1px\",\n margin: \"-1px\",\n padding: \"0px\",\n overflow: \"hidden\",\n whiteSpace: \"nowrap\",\n position: \"absolute\",\n },\n onChange: handlerAll(props.onChange, onChange),\n onBlur: handlerAll(props.onBlur, onBlur, () => setFocused(false)),\n onFocus: handlerAll(props.onFocus, onFocus, () => setFocused(true)),\n onKeyDown: handlerAll(props.onKeyDown, onKeyDown),\n onKeyUp: handlerAll(props.onKeyUp, onKeyUp),\n }),\n [\n isIndeterminate,\n formControlProps,\n id,\n name,\n value,\n tabIndex,\n required,\n disabled,\n readOnly,\n checked,\n onChange,\n onBlur,\n onFocus,\n onKeyDown,\n onKeyUp,\n ],\n )\n\n const getLabelProps: PropGetter = useCallback(\n (props = {}, ref = null) => ({\n ...formControlProps,\n ...props,\n ref,\n \"data-checked\": dataAttr(checked),\n onMouseDown: handlerAll(props.onMouseDown, (ev: SyntheticEvent) => {\n ev.preventDefault()\n ev.stopPropagation()\n }),\n onTouchStart: handlerAll(props.onTouchStart, (ev: SyntheticEvent) => {\n ev.preventDefault()\n ev.stopPropagation()\n }),\n }),\n [checked, formControlProps],\n )\n\n return {\n props: rest,\n isFocusVisible,\n isFocused,\n isHovered,\n isActive,\n isChecked: checked,\n isIndeterminate,\n getContainerProps,\n getIconProps,\n getInputProps,\n getLabelProps,\n }\n}\n\nexport type UseCheckboxReturn = ReturnType<typeof useCheckbox>\n\ntype CheckboxOptions = {\n /**\n * Props for icon component.\n */\n iconProps?: Omit<HTMLUIProps<\"span\">, \"children\"> & { children: ReactElement }\n /**\n * Props for input element.\n */\n inputProps?: InputHTMLAttributes<HTMLInputElement>\n /**\n * Props for label element.\n */\n labelProps?: HTMLUIProps<\"span\">\n}\n\nexport type CheckboxProps<Y extends string | number = string> = Omit<\n Merge<HTMLUIProps<\"label\">, UseCheckboxProps<Y>>,\n \"checked\"\n> &\n ThemeProps<\"Checkbox\"> &\n CheckboxOptions\n\n/**\n * `Checkbox` is a component used for allowing users to select multiple values from multiple options.\n *\n * @see Docs https://yamada-ui.com/components/forms/checkbox\n */\nexport const Checkbox = forwardRef(\n <Y extends string | number = string>(\n props: CheckboxProps<Y>,\n ref: ForwardedRef<HTMLInputElement>,\n ) => {\n const group = useCheckboxGroupContext()\n const { value: groupValue, ...groupProps } = { ...group }\n const control = useFormControl(props)\n const [styles, mergedProps] = useMultiComponentStyle(\"Checkbox\", {\n ...groupProps,\n ...props,\n })\n const {\n className,\n gap = \"0.5rem\",\n isRequired = groupProps.isRequired ?? control.isRequired,\n isReadOnly = groupProps.isReadOnly ?? control.isReadOnly,\n isDisabled = groupProps.isDisabled ?? control.isDisabled,\n isInvalid = groupProps.isInvalid ?? control.isInvalid,\n iconProps,\n inputProps,\n labelProps,\n children,\n ...computedProps\n } = omitThemeProps(mergedProps)\n\n const isCheckedProp =\n groupValue && computedProps.value\n ? groupValue.includes(computedProps.value)\n : computedProps.isChecked\n const onChange =\n groupProps.onChange && computedProps.value\n ? funcAll(groupProps.onChange, computedProps.onChange)\n : computedProps.onChange\n\n const {\n isChecked,\n isIndeterminate,\n getContainerProps,\n getInputProps,\n getIconProps,\n getLabelProps,\n props: rest,\n } = useCheckbox({\n ...computedProps,\n isRequired,\n isReadOnly,\n isDisabled,\n isInvalid,\n isChecked: isCheckedProp,\n onChange,\n })\n\n const { children: customIcon, ...resolvedIconProps } = { ...iconProps }\n const cloneIcon = cloneElement(customIcon ?? <CheckboxIcon />, {\n __css: {\n opacity: isChecked || isIndeterminate ? 1 : 0,\n transform: isChecked || isIndeterminate ? \"scale(1)\" : \"scale(0.95)\",\n transitionProperty: \"transform\",\n transitionDuration: \"normal\",\n },\n isIndeterminate,\n isChecked,\n isRequired,\n isReadOnly,\n isDisabled,\n isInvalid,\n })\n\n return (\n <ui.label\n className={cx(\"ui-checkbox\", className)}\n {...getContainerProps()}\n __css={{\n gap,\n ...styles.container,\n }}\n {...rest}\n >\n <ui.input\n className=\"ui-checkbox__input\"\n {...getInputProps(inputProps, ref)}\n />\n\n <ui.span\n className=\"ui-checkbox__icon\"\n __css={{\n pointerEvents: isReadOnly ? \"none\" : undefined,\n ...styles.icon,\n }}\n {...getIconProps(resolvedIconProps)}\n >\n {cloneIcon}\n </ui.span>\n\n <ui.span\n className=\"ui-checkbox__label\"\n __css={{ ...styles.label }}\n {...getLabelProps(labelProps as DOMAttributes<HTMLElement>)}\n >\n {children}\n </ui.span>\n </ui.label>\n )\n },\n) as {\n <Y extends string | number = string>(\n props: CheckboxProps<Y> & { ref?: Ref<HTMLInputElement> },\n ): JSX.Element\n} & ComponentArgs\n\nCheckbox.displayName = \"Checkbox\"\n\nexport type CheckboxIconProps = HTMLUIProps<\"svg\"> &\n SVGMotionProps<SVGSVGElement> &\n FormControlOptions & {\n /**\n * If `true`, the icon will be indeterminate.\n *\n * @default false\n */\n isIndeterminate?: boolean\n /**\n * If `true`, the icon will be checked.\n *\n * @default false\n */\n isChecked?: boolean\n }\n\nexport const CheckboxIcon: FC<CheckboxIconProps> = ({\n isIndeterminate,\n isChecked,\n isRequired: _isRequired,\n isReadOnly: _isReadOnly,\n isDisabled: _isDisabled,\n isInvalid: _isInvalid,\n ...rest\n}) => {\n return (\n <AnimatePresence initial={false}>\n {isIndeterminate || isChecked ? (\n <ui.div\n __css={{\n position: \"absolute\",\n top: \"50%\",\n left: \"50%\",\n transform: \"translate(-50%, -50%)\",\n }}\n >\n <ui.div\n as={motion.div}\n variants={{\n unchecked: { scale: 0.5 },\n checked: { scale: 1 },\n }}\n initial=\"unchecked\"\n animate=\"checked\"\n exit=\"unchecked\"\n style={\n {\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n } as CSSProperties\n }\n >\n {isIndeterminate ? (\n <IndeterminateIcon {...rest} />\n ) : (\n <CheckIcon {...rest} />\n )}\n </ui.div>\n </ui.div>\n ) : null}\n </AnimatePresence>\n )\n}\n\nconst CheckIcon: FC<HTMLUIProps<\"svg\"> & SVGMotionProps<SVGSVGElement>> = (\n props,\n) => {\n return (\n <ui.svg\n as={motion.svg}\n width=\"1.2em\"\n viewBox=\"0 0 12 10\"\n variants={{\n unchecked: {\n opacity: 0,\n strokeDashoffset: 16,\n },\n checked: {\n opacity: 1,\n strokeDashoffset: 0,\n transition: { duration: 0.2 },\n },\n }}\n style={{\n fill: \"none\",\n strokeWidth: 2,\n stroke: \"currentColor\",\n strokeDasharray: 16,\n }}\n {...props}\n >\n <polyline points=\"1.5 6 4.5 9 10.5 1\" />\n </ui.svg>\n )\n}\n\nconst IndeterminateIcon: FC<\n HTMLUIProps<\"svg\"> & SVGMotionProps<SVGSVGElement>\n> = (props) => {\n return (\n <ui.svg\n as={motion.svg}\n width=\"1.2em\"\n viewBox=\"0 0 24 24\"\n variants={{\n unchecked: {\n scaleX: 0.65,\n opacity: 0,\n },\n checked: {\n scaleX: 1,\n opacity: 1,\n transition: {\n scaleX: { duration: 0 },\n opacity: { duration: 0.02 },\n },\n },\n }}\n style={{ stroke: \"currentColor\", strokeWidth: 4 }}\n {...props}\n >\n <line x1=\"21\" x2=\"3\" y1=\"12\" y2=\"12\" />\n </ui.svg>\n )\n}\n","import type { ComponentArgs, ThemeProps, UIPropGetter } from \"@yamada-ui/core\"\nimport type { FormControlOptions } from \"@yamada-ui/form-control\"\nimport { useFormControl } from \"@yamada-ui/form-control\"\nimport type { FlexProps } from \"@yamada-ui/layouts\"\nimport { Flex } from \"@yamada-ui/layouts\"\nimport { useControllableState } from \"@yamada-ui/use-controllable-state\"\nimport type { Dict, PropGetter } from \"@yamada-ui/utils\"\nimport {\n createContext,\n cx,\n isObject,\n useCallbackRef,\n getValidChildren,\n} from \"@yamada-ui/utils\"\nimport type { ChangeEvent, ForwardedRef, ReactElement, Ref } from \"react\"\nimport { forwardRef, useCallback } from \"react\"\nimport type { CheckboxProps } from \"./checkbox\"\nimport { Checkbox } from \"./checkbox\"\n\nexport type CheckboxItem<Y extends string | number = string> =\n CheckboxProps<Y> & {\n label?: string\n }\n\nconst isEvent = (value: any): value is { target: HTMLInputElement } =>\n value && isObject(value) && isObject(value.target)\n\nexport type UseCheckboxGroupProps<Y extends string | number = string> = {\n /**\n * The value of the checkbox group.\n */\n value?: Y[]\n /**\n * The initial value of the checkbox group.\n */\n defaultValue?: Y[]\n /**\n * The callback fired when any children checkbox is checked or unchecked.\n */\n onChange?: (value: Y[]) => void\n /**\n * If `true`, input elements will receive `checked` attribute instead of `isChecked`.\n *\n * This assumes, you're using native radio inputs.\n *\n * @default false\n */\n isNative?: boolean\n}\n\nexport const useCheckboxGroup = <\n Y extends string | number = string,\n M extends Dict = Dict,\n>({\n value: valueProp,\n defaultValue = [],\n onChange: onChangeProp,\n isNative,\n ...props\n}: UseCheckboxGroupProps<Y> & M) => {\n const onChangeRef = useCallbackRef(onChangeProp)\n\n const [value, setValue] = useControllableState({\n value: valueProp,\n defaultValue,\n onChange: onChangeRef,\n })\n\n const onChange = useCallback(\n (evOrValue: ChangeEvent<HTMLInputElement> | Y) => {\n const isChecked = isEvent(evOrValue)\n ? evOrValue.target.checked\n : !value.includes(evOrValue)\n\n const selectedValue = (\n isEvent(evOrValue) ? evOrValue.target.value : evOrValue\n ) as Y\n\n const nextValue = isChecked\n ? [...value, selectedValue]\n : value.filter((v) => String(v) !== String(selectedValue))\n\n setValue(nextValue)\n },\n [value, setValue],\n )\n\n const getContainerProps: PropGetter = useCallback(\n (props = {}, ref = null) => ({\n role: \"group\",\n ...props,\n ref,\n }),\n [],\n )\n\n const getCheckboxProps: UIPropGetter<\n \"input\",\n { value?: Y },\n { value?: Y; isChecked?: boolean }\n > = useCallback(\n (props, ref = null) => ({\n ...props,\n ref,\n [isNative ? \"checked\" : \"isChecked\"]: value.some(\n (val) => String(props?.value) === String(val),\n ),\n onChange,\n }),\n [onChange, isNative, value],\n )\n\n return {\n props,\n value,\n setValue,\n onChange,\n getContainerProps,\n getCheckboxProps,\n }\n}\n\nexport type UseCheckboxGroupReturn<Y extends string | number = string> =\n ReturnType<typeof useCheckboxGroup<Y>>\n\nexport type CheckboxGroupProps<Y extends string | number = string> =\n ThemeProps<\"Checkbox\"> &\n Omit<FlexProps, \"onChange\"> &\n UseCheckboxGroupProps<Y> &\n FormControlOptions & {\n /**\n * If provided, generate checkboxes based on items.\n *\n * @default '[]'\n */\n items?: CheckboxItem<Y>[]\n }\n\ntype CheckboxContext = ThemeProps<\"Checkbox\"> &\n FormControlOptions & {\n value: (string | number)[]\n onChange: (\n evOrValue: ChangeEvent<HTMLInputElement> | string | number,\n ) => void\n }\n\nconst [CheckboxGroupProvider, useCheckboxGroupContext] = createContext<\n CheckboxContext | undefined\n>({\n strict: false,\n name: \"CheckboxGroupContext\",\n})\n\nexport { useCheckboxGroupContext }\n\nexport const CheckboxGroup = forwardRef(\n <Y extends string | number = string>(\n {\n className,\n size,\n variant,\n colorScheme,\n children,\n items = [],\n direction = \"column\",\n gap,\n ...props\n }: CheckboxGroupProps<Y>,\n ref: ForwardedRef<HTMLDivElement>,\n ) => {\n const {\n value,\n onChange,\n props: computedProps,\n getContainerProps,\n } = useCheckboxGroup<Y>(props)\n const { labelId, isRequired, isReadOnly, isDisabled, isInvalid, ...rest } =\n useFormControl(computedProps)\n\n const validChildren = getValidChildren(children)\n let computedChildren: ReactElement[] = []\n\n if (!validChildren.length && items.length) {\n computedChildren = items.map(({ label, value, ...props }, i) => (\n <Checkbox key={i} value={value} {...props}>\n {label}\n </Checkbox>\n ))\n }\n\n return (\n <CheckboxGroupProvider\n value={\n {\n size,\n variant,\n colorScheme,\n isRequired,\n isReadOnly,\n isDisabled,\n isInvalid,\n value,\n onChange,\n } as CheckboxContext\n }\n >\n <Flex\n ref={ref}\n className={cx(\"ui-checkbox-group\", className)}\n direction={direction}\n gap={gap ?? (direction === \"row\" ? \"1rem\" : undefined)}\n {...getContainerProps({\n \"aria-labelledby\": labelId,\n ...rest,\n })}\n >\n {children ?? computedChildren}\n </Flex>\n </CheckboxGroupProvider>\n )\n },\n) as {\n <Y extends string | number = string>(\n props: CheckboxGroupProps<Y> & { ref?: Ref<HTMLDivElement> },\n ): JSX.Element\n} & ComponentArgs\n\nCheckboxGroup.displayName = \"CheckboxGroup\"\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AA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,UACT,QAAQ;AAAA,UACR,SAAS;AAAA,QACX;AAAA,QACA,SAAS;AAAA,UACP,QAAQ;AAAA,UACR,SAAS;AAAA,UACT,YAAY;AAAA,YACV,QAAQ,EAAE,UAAU,EAAE;AAAA,YACtB,SAAS,EAAE,UAAU,KAAK;AAAA,UAC5B;AAAA,QACF;AAAA,MACF;AAAA,MACA,OAAO,EAAE,QAAQ,gBAAgB,aAAa,EAAE;AAAA,MAC/C,GAAG;AAAA,MAEJ,uDAAC,UAAK,IAAG,MAAK,IAAG,KAAI,IAAG,MAAK,IAAG,MAAK;AAAA;AAAA,EACvC;AAEJ;","names":["import_form_control","import_utils","import_react","props","value","props","import_jsx_runtime","props","_a"]}
package/dist/index.mjs CHANGED
@@ -5,7 +5,7 @@ import {
5
5
  CheckboxIcon,
6
6
  useCheckbox,
7
7
  useCheckboxGroup
8
- } from "./chunk-OBMC7JBH.mjs";
8
+ } from "./chunk-U2KDBDCH.mjs";
9
9
  export {
10
10
  Checkbox,
11
11
  CheckboxGroup,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yamada-ui/checkbox",
3
- "version": "2.0.0-next-20240619220221",
3
+ "version": "2.0.0-next-20240701004015",
4
4
  "description": "Yamada UI checkbox component",
5
5
  "keywords": [
6
6
  "yamada",
@@ -36,13 +36,13 @@
36
36
  "url": "https://github.com/yamada-ui/yamada-ui/issues"
37
37
  },
38
38
  "dependencies": {
39
- "@yamada-ui/core": "1.7.2",
40
- "@yamada-ui/utils": "1.2.1",
41
- "@yamada-ui/layouts": "1.1.25",
42
- "@yamada-ui/form-control": "2.0.0-next-20240619220221",
43
- "@yamada-ui/motion": "1.0.29",
44
- "@yamada-ui/use-focus-visible": "1.1.1",
45
- "@yamada-ui/use-controllable-state": "1.0.14"
39
+ "@yamada-ui/core": "1.9.1-next-20240701004015",
40
+ "@yamada-ui/utils": "1.3.1-next-20240701004015",
41
+ "@yamada-ui/layouts": "1.1.28-next-20240701004015",
42
+ "@yamada-ui/form-control": "3.0.0-next-20240701004015",
43
+ "@yamada-ui/motion": "2.0.2-next-20240701004015",
44
+ "@yamada-ui/use-focus-visible": "1.1.3-next-20240701004015",
45
+ "@yamada-ui/use-controllable-state": "1.0.16-next-20240701004015"
46
46
  },
47
47
  "devDependencies": {
48
48
  "react": "^18.0.0",
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/checkbox.tsx","../src/checkbox-group.tsx"],"sourcesContent":["import type {\n HTMLUIProps,\n ThemeProps,\n ComponentArgs,\n UIPropGetter,\n} from \"@yamada-ui/core\"\nimport { ui, useMultiComponentStyle, omitThemeProps } from \"@yamada-ui/core\"\nimport type { FormControlOptions } from \"@yamada-ui/form-control\"\nimport {\n useFormControl,\n useFormControlProps,\n formControlProperties,\n} from \"@yamada-ui/form-control\"\nimport type { SVGMotionProps } from \"@yamada-ui/motion\"\nimport { AnimatePresence, motion } from \"@yamada-ui/motion\"\nimport { trackFocusVisible } from \"@yamada-ui/use-focus-visible\"\nimport type { Dict, Merge, PropGetter } from \"@yamada-ui/utils\"\nimport {\n cx,\n useCallbackRef,\n useSafeLayoutEffect,\n useUpdateEffect,\n handlerAll,\n dataAttr,\n mergeRefs,\n funcAll,\n splitObject,\n} from \"@yamada-ui/utils\"\nimport type {\n ChangeEvent,\n ChangeEventHandler,\n CSSProperties,\n FC,\n FocusEventHandler,\n InputHTMLAttributes,\n KeyboardEvent,\n ReactElement,\n SyntheticEvent,\n ForwardedRef,\n Ref,\n DOMAttributes,\n} from \"react\"\nimport {\n cloneElement,\n useCallback,\n useEffect,\n useRef,\n useState,\n forwardRef,\n useId,\n} from \"react\"\nimport { useCheckboxGroupContext } from \"./checkbox-group\"\n\nexport type UseCheckboxProps<Y extends string | number = string> =\n FormControlOptions & {\n /**\n * id assigned to input.\n */\n id?: string\n /**\n * The HTML `name` attribute used for forms.\n */\n name?: string\n /**\n * The value to be used in the checkbox input.\n */\n value?: Y\n /**\n * If `true`, the checkbox will be initially checked.\n *\n * @default false\n */\n defaultIsChecked?: boolean\n /**\n * If `true`, the checkbox will be checked.\n *\n * @default false\n */\n isChecked?: boolean\n /**\n * If `true`, the checkbox will be indeterminate.\n *\n * @default false\n */\n isIndeterminate?: boolean\n /**\n * The callback invoked when the checked state changes.\n */\n onChange?: ChangeEventHandler<HTMLInputElement>\n /**\n * The callback invoked when the checkbox is focused.\n */\n onFocus?: FocusEventHandler<HTMLInputElement>\n /**\n * The callback invoked when the checkbox is blurred.\n */\n onBlur?: FocusEventHandler<HTMLInputElement>\n /**\n * The tab-index property of the underlying input element.\n */\n tabIndex?: number\n }\n\nexport const useCheckbox = <\n Y extends string | number = string,\n M extends Dict = Dict,\n>({\n id,\n ...props\n}: UseCheckboxProps<Y> & M) => {\n id ??= useId()\n const {\n id: _id,\n name,\n value,\n isChecked: isCheckedProp,\n defaultIsChecked,\n tabIndex,\n required,\n disabled,\n readOnly,\n isIndeterminate,\n onChange: onChangeProp,\n onFocus: onFocusProp,\n onBlur: onBlurProp,\n ...computedProps\n } = useFormControlProps({ id, ...props })\n const [{ \"aria-readonly\": _ariaReadonly, ...formControlProps }, rest] =\n splitObject(computedProps, formControlProperties)\n\n const [isFocusVisible, setIsFocusVisible] = useState<boolean>(false)\n const [isFocused, setFocused] = useState<boolean>(false)\n const [isHovered, setHovered] = useState<boolean>(false)\n const [isActive, setActive] = useState<boolean>(false)\n\n const inputRef = useRef<HTMLInputElement>(null)\n const [isLabel, setIsLabel] = useState<boolean>(true)\n\n const [isChecked, setIsChecked] = useState<boolean>(!!defaultIsChecked)\n\n const isControlled = isCheckedProp !== undefined\n const checked = isControlled ? (isCheckedProp as boolean) : isChecked\n\n const onChange = useCallbackRef(\n (ev: ChangeEvent<HTMLInputElement>) => {\n if (readOnly || disabled) {\n ev.preventDefault()\n\n return\n }\n\n if (!isControlled)\n setIsChecked(!checked || isIndeterminate ? true : ev.target.checked)\n\n onChangeProp?.(ev)\n },\n [readOnly, disabled, isControlled, checked, isIndeterminate],\n )\n const onFocus = useCallbackRef(onFocusProp)\n const onBlur = useCallbackRef(onBlurProp)\n\n const onKeyDown = useCallback(\n ({ key }: KeyboardEvent<Element>) => {\n if (key === \" \") setActive(true)\n },\n [setActive],\n )\n\n const onKeyUp = useCallback(\n ({ key }: KeyboardEvent<Element>) => {\n if (key === \" \") setActive(false)\n },\n [setActive],\n )\n\n useEffect(() => {\n return trackFocusVisible(setIsFocusVisible)\n }, [])\n\n useSafeLayoutEffect(() => {\n if (inputRef.current)\n inputRef.current.indeterminate = Boolean(isIndeterminate)\n }, [isIndeterminate])\n\n useUpdateEffect(() => {\n if (disabled) setFocused(false)\n }, [disabled, setFocused])\n\n useSafeLayoutEffect(() => {\n if (!inputRef.current?.form) return\n\n inputRef.current.form.onreset = () => setIsChecked(!!defaultIsChecked)\n }, [])\n\n useSafeLayoutEffect(() => {\n if (!inputRef.current) return\n\n if (inputRef.current.checked !== checked)\n setIsChecked(inputRef.current.checked)\n }, [inputRef.current])\n\n const getContainerProps: UIPropGetter = useCallback(\n (props = {}, ref = null) => ({\n ...formControlProps,\n ...props,\n ref: mergeRefs(ref, (el: HTMLElement | undefined) => {\n if (el) setIsLabel(el.tagName === \"LABEL\")\n }),\n \"data-checked\": dataAttr(checked),\n onClick: handlerAll(props.onClick, () => {\n if (isLabel) return\n\n inputRef.current?.click()\n\n requestAnimationFrame(() => inputRef.current?.focus())\n }),\n }),\n [checked, isLabel, formControlProps],\n )\n\n const getIconProps: UIPropGetter = useCallback(\n (props = {}, ref = null) => ({\n ...formControlProps,\n ...props,\n ref,\n \"data-active\": dataAttr(isActive),\n \"data-hover\": dataAttr(isHovered),\n \"data-checked\": dataAttr(checked),\n \"data-focus\": dataAttr(isFocused),\n \"data-focus-visible\": dataAttr(isFocused && isFocusVisible),\n \"data-indeterminate\": dataAttr(isIndeterminate),\n \"aria-hidden\": true,\n onMouseDown: handlerAll(props.onMouseDown, (ev: React.MouseEvent) => {\n if (isFocused) ev.preventDefault()\n\n setActive(true)\n }),\n onMouseUp: handlerAll(props.onMouseUp, () => setActive(false)),\n onMouseEnter: handlerAll(props.onMouseEnter, () => setHovered(true)),\n onMouseLeave: handlerAll(props.onMouseLeave, () => setHovered(false)),\n }),\n [\n isActive,\n checked,\n isFocused,\n isHovered,\n isFocusVisible,\n isIndeterminate,\n formControlProps,\n ],\n )\n\n const getInputProps: PropGetter = useCallback(\n (props = {}, ref = null) => ({\n ...formControlProps,\n ...props,\n ref: mergeRefs(inputRef, ref),\n id,\n type: \"checkbox\",\n name,\n value,\n tabIndex,\n required,\n disabled,\n readOnly,\n checked,\n style: {\n border: \"0px\",\n clip: \"rect(0px, 0px, 0px, 0px)\",\n height: \"1px\",\n width: \"1px\",\n margin: \"-1px\",\n padding: \"0px\",\n overflow: \"hidden\",\n whiteSpace: \"nowrap\",\n position: \"absolute\",\n },\n onChange: handlerAll(props.onChange, onChange),\n onBlur: handlerAll(props.onBlur, onBlur, () => setFocused(false)),\n onFocus: handlerAll(props.onFocus, onFocus, () => setFocused(true)),\n onKeyDown: handlerAll(props.onKeyDown, onKeyDown),\n onKeyUp: handlerAll(props.onKeyUp, onKeyUp),\n }),\n [\n formControlProps,\n id,\n name,\n value,\n tabIndex,\n required,\n disabled,\n readOnly,\n checked,\n onChange,\n onBlur,\n onFocus,\n onKeyDown,\n onKeyUp,\n ],\n )\n\n const getLabelProps: PropGetter = useCallback(\n (props = {}, ref = null) => ({\n ...formControlProps,\n ...props,\n ref,\n \"data-checked\": dataAttr(checked),\n onMouseDown: handlerAll(props.onMouseDown, (ev: SyntheticEvent) => {\n ev.preventDefault()\n ev.stopPropagation()\n }),\n onTouchStart: handlerAll(props.onTouchStart, (ev: SyntheticEvent) => {\n ev.preventDefault()\n ev.stopPropagation()\n }),\n }),\n [checked, formControlProps],\n )\n\n return {\n props: rest,\n isFocusVisible,\n isFocused,\n isHovered,\n isActive,\n isChecked: checked,\n isIndeterminate,\n getContainerProps,\n getIconProps,\n getInputProps,\n getLabelProps,\n }\n}\n\nexport type UseCheckboxReturn = ReturnType<typeof useCheckbox>\n\ntype CheckboxOptions = {\n /**\n * Props for icon component.\n */\n iconProps?: Omit<HTMLUIProps<\"span\">, \"children\"> & { children: ReactElement }\n /**\n * Props for input element.\n */\n inputProps?: InputHTMLAttributes<HTMLInputElement>\n /**\n * Props for label element.\n */\n labelProps?: HTMLUIProps<\"span\">\n}\n\nexport type CheckboxProps<Y extends string | number = string> = Omit<\n Merge<HTMLUIProps<\"label\">, UseCheckboxProps<Y>>,\n \"checked\"\n> &\n ThemeProps<\"Checkbox\"> &\n CheckboxOptions\n\n/**\n * `Checkbox` is a component used for allowing users to select multiple values from multiple options.\n *\n * @see Docs https://yamada-ui.com/components/forms/checkbox\n */\nexport const Checkbox = forwardRef(\n <Y extends string | number = string>(\n props: CheckboxProps<Y>,\n ref: ForwardedRef<HTMLInputElement>,\n ) => {\n const group = useCheckboxGroupContext()\n const { value: groupValue, ...groupProps } = { ...group }\n const control = useFormControl(props)\n const [styles, mergedProps] = useMultiComponentStyle(\"Checkbox\", {\n ...groupProps,\n ...props,\n })\n const {\n className,\n gap = \"0.5rem\",\n isRequired = groupProps.isRequired ?? control.isRequired,\n isReadOnly = groupProps.isReadOnly ?? control.isReadOnly,\n isDisabled = groupProps.isDisabled ?? control.isDisabled,\n isInvalid = groupProps.isInvalid ?? control.isInvalid,\n iconProps,\n inputProps,\n labelProps,\n children,\n ...computedProps\n } = omitThemeProps(mergedProps)\n\n const isCheckedProp =\n groupValue && computedProps.value\n ? groupValue.includes(computedProps.value)\n : computedProps.isChecked\n const onChange =\n groupProps.onChange && computedProps.value\n ? funcAll(groupProps.onChange, computedProps.onChange)\n : computedProps.onChange\n\n const {\n isChecked,\n isIndeterminate,\n getContainerProps,\n getInputProps,\n getIconProps,\n getLabelProps,\n props: rest,\n } = useCheckbox({\n ...computedProps,\n isRequired,\n isReadOnly,\n isDisabled,\n isInvalid,\n isChecked: isCheckedProp,\n onChange,\n })\n\n const { children: customIcon, ...resolvedIconProps } = { ...iconProps }\n const cloneIcon = cloneElement(customIcon ?? <CheckboxIcon />, {\n __css: {\n opacity: isChecked || isIndeterminate ? 1 : 0,\n transform: isChecked || isIndeterminate ? \"scale(1)\" : \"scale(0.95)\",\n transitionProperty: \"transform\",\n transitionDuration: \"normal\",\n },\n isIndeterminate,\n isChecked,\n isRequired,\n isReadOnly,\n isDisabled,\n isInvalid,\n })\n\n return (\n <ui.label\n className={cx(\"ui-checkbox\", className)}\n {...getContainerProps()}\n __css={{\n gap,\n ...styles.container,\n }}\n {...rest}\n >\n <ui.input\n className=\"ui-checkbox__input\"\n {...getInputProps(inputProps, ref)}\n />\n\n <ui.span\n className=\"ui-checkbox__icon\"\n __css={{\n pointerEvents: isReadOnly ? \"none\" : undefined,\n ...styles.icon,\n }}\n {...getIconProps(resolvedIconProps)}\n >\n {cloneIcon}\n </ui.span>\n\n <ui.span\n className=\"ui-checkbox__label\"\n __css={{ ...styles.label }}\n {...getLabelProps(labelProps as DOMAttributes<HTMLElement>)}\n >\n {children}\n </ui.span>\n </ui.label>\n )\n },\n) as {\n <Y extends string | number = string>(\n props: CheckboxProps<Y> & { ref?: Ref<HTMLInputElement> },\n ): JSX.Element\n} & ComponentArgs\n\nCheckbox.displayName = \"Checkbox\"\n\nexport type CheckboxIconProps = HTMLUIProps<\"svg\"> &\n SVGMotionProps<SVGSVGElement> &\n FormControlOptions & {\n /**\n * If `true`, the icon will be indeterminate.\n *\n * @default false\n */\n isIndeterminate?: boolean\n /**\n * If `true`, the icon will be checked.\n *\n * @default false\n */\n isChecked?: boolean\n }\n\nexport const CheckboxIcon: FC<CheckboxIconProps> = ({\n isIndeterminate,\n isChecked,\n isRequired: _isRequired,\n isReadOnly: _isReadOnly,\n isDisabled: _isDisabled,\n isInvalid: _isInvalid,\n ...rest\n}) => {\n return (\n <AnimatePresence initial={false}>\n {isIndeterminate || isChecked ? (\n <ui.div\n __css={{\n position: \"absolute\",\n top: \"50%\",\n left: \"50%\",\n transform: \"translate(-50%, -50%)\",\n }}\n >\n <ui.div\n as={motion.div}\n variants={{\n unchecked: { scale: 0.5 },\n checked: { scale: 1 },\n }}\n initial=\"unchecked\"\n animate=\"checked\"\n exit=\"unchecked\"\n style={\n {\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n } as CSSProperties\n }\n >\n {isIndeterminate ? (\n <IndeterminateIcon {...rest} />\n ) : (\n <CheckIcon {...rest} />\n )}\n </ui.div>\n </ui.div>\n ) : null}\n </AnimatePresence>\n )\n}\n\nconst CheckIcon: FC<HTMLUIProps<\"svg\"> & SVGMotionProps<SVGSVGElement>> = (\n props,\n) => {\n return (\n <ui.svg\n as={motion.svg}\n width=\"1.2em\"\n viewBox=\"0 0 12 10\"\n variants={{\n unchecked: {\n opacity: 0,\n strokeDashoffset: 16,\n },\n checked: {\n opacity: 1,\n strokeDashoffset: 0,\n transition: { duration: 0.2 },\n },\n }}\n style={{\n fill: \"none\",\n strokeWidth: 2,\n stroke: \"currentColor\",\n strokeDasharray: 16,\n }}\n {...props}\n >\n <polyline points=\"1.5 6 4.5 9 10.5 1\" />\n </ui.svg>\n )\n}\n\nconst IndeterminateIcon: FC<\n HTMLUIProps<\"svg\"> & SVGMotionProps<SVGSVGElement>\n> = (props) => {\n return (\n <ui.svg\n as={motion.svg}\n width=\"1.2em\"\n viewBox=\"0 0 24 24\"\n variants={{\n unchecked: {\n scaleX: 0.65,\n opacity: 0,\n },\n checked: {\n scaleX: 1,\n opacity: 1,\n transition: {\n scaleX: { duration: 0 },\n opacity: { duration: 0.02 },\n },\n },\n }}\n style={{ stroke: \"currentColor\", strokeWidth: 4 }}\n {...props}\n >\n <line x1=\"21\" x2=\"3\" y1=\"12\" y2=\"12\" />\n </ui.svg>\n )\n}\n","import type { ComponentArgs, ThemeProps, UIPropGetter } from \"@yamada-ui/core\"\nimport type { FormControlOptions } from \"@yamada-ui/form-control\"\nimport { useFormControl } from \"@yamada-ui/form-control\"\nimport type { FlexProps } from \"@yamada-ui/layouts\"\nimport { Flex } from \"@yamada-ui/layouts\"\nimport { useControllableState } from \"@yamada-ui/use-controllable-state\"\nimport type { Dict } from \"@yamada-ui/utils\"\nimport {\n createContext,\n cx,\n isObject,\n useCallbackRef,\n getValidChildren,\n} from \"@yamada-ui/utils\"\nimport type { ChangeEvent, ForwardedRef, ReactElement, Ref } from \"react\"\nimport { forwardRef, useCallback } from \"react\"\nimport type { CheckboxProps } from \"./checkbox\"\nimport { Checkbox } from \"./checkbox\"\n\nexport type CheckboxItem<Y extends string | number = string> =\n CheckboxProps<Y> & {\n label?: string\n }\n\nconst isEvent = (value: any): value is { target: HTMLInputElement } =>\n value && isObject(value) && isObject(value.target)\n\nexport type UseCheckboxGroupProps<Y extends string | number = string> = {\n /**\n * The value of the checkbox group.\n */\n value?: Y[]\n /**\n * The initial value of the checkbox group.\n */\n defaultValue?: Y[]\n /**\n * The callback fired when any children checkbox is checked or unchecked.\n */\n onChange?: (value: Y[]) => void\n /**\n * If `true`, input elements will receive `checked` attribute instead of `isChecked`.\n *\n * This assumes, you're using native radio inputs.\n *\n * @default false\n */\n isNative?: boolean\n}\n\nexport const useCheckboxGroup = <\n Y extends string | number = string,\n M extends Dict = Dict,\n>({\n value: valueProp,\n defaultValue = [],\n onChange: onChangeProp,\n isNative,\n ...props\n}: UseCheckboxGroupProps<Y> & M) => {\n const onChangeRef = useCallbackRef(onChangeProp)\n\n const [value, setValue] = useControllableState({\n value: valueProp,\n defaultValue,\n onChange: onChangeRef,\n })\n\n const onChange = useCallback(\n (evOrValue: ChangeEvent<HTMLInputElement> | Y) => {\n const isChecked = isEvent(evOrValue)\n ? evOrValue.target.checked\n : !value.includes(evOrValue)\n\n const selectedValue = (\n isEvent(evOrValue) ? evOrValue.target.value : evOrValue\n ) as Y\n\n const nextValue = isChecked\n ? [...value, selectedValue]\n : value.filter((v) => String(v) !== String(selectedValue))\n\n setValue(nextValue)\n },\n [value, setValue],\n )\n\n const getCheckboxProps: UIPropGetter<\n \"input\",\n { value?: Y },\n { value?: Y; isChecked?: boolean }\n > = useCallback(\n (props, ref = null) => ({\n ...props,\n ref,\n [isNative ? \"checked\" : \"isChecked\"]: value.some(\n (val) => String(props?.value) === String(val),\n ),\n onChange,\n }),\n [onChange, isNative, value],\n )\n\n return { props, value, setValue, onChange, getCheckboxProps }\n}\n\nexport type UseCheckboxGroupReturn<Y extends string | number = string> =\n ReturnType<typeof useCheckboxGroup<Y>>\n\nexport type CheckboxGroupProps<Y extends string | number = string> =\n ThemeProps<\"Checkbox\"> &\n Omit<FlexProps, \"onChange\"> &\n UseCheckboxGroupProps<Y> &\n FormControlOptions & {\n /**\n * If provided, generate checkboxes based on items.\n *\n * @default '[]'\n */\n items?: CheckboxItem<Y>[]\n }\n\ntype CheckboxContext = ThemeProps<\"Checkbox\"> &\n FormControlOptions & {\n value: (string | number)[]\n onChange: (\n evOrValue: ChangeEvent<HTMLInputElement> | string | number,\n ) => void\n }\n\nconst [CheckboxGroupProvider, useCheckboxGroupContext] = createContext<\n CheckboxContext | undefined\n>({\n strict: false,\n name: \"CheckboxGroupContext\",\n})\n\nexport { useCheckboxGroupContext }\n\nexport const CheckboxGroup = forwardRef(\n <Y extends string | number = string>(\n {\n className,\n size,\n variant,\n colorScheme,\n children,\n items = [],\n direction = \"column\",\n gap,\n ...props\n }: CheckboxGroupProps<Y>,\n ref: ForwardedRef<HTMLDivElement>,\n ) => {\n const { value, onChange, props: computedProps } = useCheckboxGroup<Y>(props)\n const { isRequired, isReadOnly, isDisabled, isInvalid, ...rest } =\n useFormControl(computedProps)\n\n const validChildren = getValidChildren(children)\n let computedChildren: ReactElement[] = []\n\n if (!validChildren.length && items.length) {\n computedChildren = items.map(({ label, value, ...props }, i) => (\n <Checkbox key={i} value={value} {...props}>\n {label}\n </Checkbox>\n ))\n }\n\n return (\n <CheckboxGroupProvider\n value={\n {\n size,\n variant,\n colorScheme,\n isRequired,\n isReadOnly,\n isDisabled,\n isInvalid,\n value,\n onChange,\n } as CheckboxContext\n }\n >\n <Flex\n ref={ref}\n className={cx(\"ui-checkbox-group\", className)}\n role=\"group\"\n direction={direction}\n gap={gap ?? (direction === \"row\" ? \"1rem\" : undefined)}\n {...rest}\n >\n {children ?? computedChildren}\n </Flex>\n </CheckboxGroupProvider>\n )\n },\n) as {\n <Y extends string | number = string>(\n props: CheckboxGroupProps<Y> & { ref?: Ref<HTMLDivElement> },\n ): JSX.Element\n} & ComponentArgs\n\nCheckboxGroup.displayName = \"CheckboxGroup\"\n"],"mappings":";;;AAMA,SAAS,IAAI,wBAAwB,sBAAsB;AAE3D;AAAA,EACE,kBAAAA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,SAAS,iBAAiB,cAAc;AACxC,SAAS,yBAAyB;AAElC;AAAA,EACE,MAAAC;AAAA,EACA,kBAAAC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAeP;AAAA,EACE;AAAA,EACA,eAAAC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,cAAAC;AAAA,EACA;AAAA,OACK;;;AChDP,SAAS,sBAAsB;AAE/B,SAAS,YAAY;AACrB,SAAS,4BAA4B;AAErC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,SAAS,YAAY,mBAAmB;AAoJhC;AA3IR,IAAM,UAAU,CAAC,UACf,SAAS,SAAS,KAAK,KAAK,SAAS,MAAM,MAAM;AAyB5C,IAAM,mBAAmB,CAG9B;AAAA,EACA,OAAO;AAAA,EACP,eAAe,CAAC;AAAA,EAChB,UAAU;AAAA,EACV;AAAA,EACA,GAAG;AACL,MAAoC;AAClC,QAAM,cAAc,eAAe,YAAY;AAE/C,QAAM,CAAC,OAAO,QAAQ,IAAI,qBAAqB;AAAA,IAC7C,OAAO;AAAA,IACP;AAAA,IACA,UAAU;AAAA,EACZ,CAAC;AAED,QAAM,WAAW;AAAA,IACf,CAAC,cAAiD;AACh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,OAAO;AAAA,QACL,MAAM;AAAA,QACN,aAAa;AAAA,QACb,QAAQ;AAAA,QACR,iBAAiB;AAAA,MACnB;AAAA,MACC,GAAG;AAAA,MAEJ,0BAAAA,KAAC,cAAS,QAAO,sBAAqB;AAAA;AAAA,EACxC;AAEJ;AAEA,IAAM,oBAEF,CAAC,UAAU;AACb,SACE,gBAAAA;AAAA,IAAC,GAAG;AAAA,IAAH;AAAA,MACC,IAAI,OAAO;AAAA,MACX,OAAM;AAAA,MACN,SAAQ;AAAA,MACR,UAAU;AAAA,QACR,WAAW;AAAA,UACT,QAAQ;AAAA,UACR,SAAS;AAAA,QACX;AAAA,QACA,SAAS;AAAA,UACP,QAAQ;AAAA,UACR,SAAS;AAAA,UACT,YAAY;AAAA,YACV,QAAQ,EAAE,UAAU,EAAE;AAAA,YACtB,SAAS,EAAE,UAAU,KAAK;AAAA,UAC5B;AAAA,QACF;AAAA,MACF;AAAA,MACA,OAAO,EAAE,QAAQ,gBAAgB,aAAa,EAAE;AAAA,MAC/C,GAAG;AAAA,MAEJ,0BAAAA,KAAC,UAAK,IAAG,MAAK,IAAG,KAAI,IAAG,MAAK,IAAG,MAAK;AAAA;AAAA,EACvC;AAEJ;","names":["useFormControl","cx","useCallbackRef","useCallback","forwardRef","props","value","props","jsx","useCallbackRef","useCallback","props","_a","forwardRef","useFormControl","cx"]}