@charcoal-ui/react 6.0.0-rc.8 → 6.0.0
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/_lib/compat.d.ts.map +1 -1
- package/dist/_lib/createDivComponent.cjs +0 -1
- package/dist/_lib/createDivComponent.cjs.map +1 -1
- package/dist/_lib/createDivComponent.d.ts +1 -1
- package/dist/_lib/createDivComponent.js.map +1 -1
- package/dist/_lib/index.cjs.map +1 -1
- package/dist/_lib/index.js.map +1 -1
- package/dist/_lib/useClassNames.cjs +0 -1
- package/dist/_lib/useClassNames.cjs.map +1 -1
- package/dist/_lib/useClassNames.js.map +1 -1
- package/dist/_lib/useForwardedRef.cjs +1 -1
- package/dist/_lib/useForwardedRef.cjs.map +1 -1
- package/dist/_lib/useForwardedRef.js.map +1 -1
- package/dist/_lib/useIsomorphicLayoutEffect.cjs +0 -1
- package/dist/_lib/useIsomorphicLayoutEffect.cjs.map +1 -1
- package/dist/_lib/useIsomorphicLayoutEffect.d.ts +2 -2
- package/dist/_lib/useIsomorphicLayoutEffect.d.ts.map +1 -1
- package/dist/_lib/useIsomorphicLayoutEffect.js.map +1 -1
- package/dist/components/Button/index.d.ts +1 -1
- package/dist/components/Button/index.d.ts.map +1 -1
- package/dist/components/Button/index2.cjs +1 -1
- package/dist/components/Button/index2.cjs.map +1 -1
- package/dist/components/Button/index2.js.map +1 -1
- package/dist/components/Carousel/CarouselItem.cjs +0 -1
- package/dist/components/Carousel/CarouselItem.cjs.map +1 -1
- package/dist/components/Carousel/CarouselItem.d.ts.map +1 -1
- package/dist/components/Carousel/CarouselItem.js.map +1 -1
- package/dist/components/Carousel/carouselStore.cjs.map +1 -1
- package/dist/components/Carousel/carouselStore.js.map +1 -1
- package/dist/components/Carousel/index.d.ts +1 -1
- package/dist/components/Carousel/index.d.ts.map +1 -1
- package/dist/components/Carousel/index2.cjs +0 -1
- package/dist/components/Carousel/index2.cjs.map +1 -1
- package/dist/components/Carousel/index2.js.map +1 -1
- package/dist/components/Carousel/intersectionObserver.cjs.map +1 -1
- package/dist/components/Carousel/intersectionObserver.js.map +1 -1
- package/dist/components/Carousel/resizeObserver.cjs.map +1 -1
- package/dist/components/Carousel/resizeObserver.js.map +1 -1
- package/dist/components/Carousel/store.cjs.map +1 -1
- package/dist/components/Carousel/store.js.map +1 -1
- package/dist/components/Carousel/useCarouselScroller.cjs +0 -1
- package/dist/components/Carousel/useCarouselScroller.cjs.map +1 -1
- package/dist/components/Carousel/useCarouselScroller.js.map +1 -1
- package/dist/components/Checkbox/CheckboxInput/index.d.ts.map +1 -1
- package/dist/components/Checkbox/CheckboxInput/index2.cjs +0 -1
- package/dist/components/Checkbox/CheckboxInput/index2.cjs.map +1 -1
- package/dist/components/Checkbox/CheckboxInput/index2.js.map +1 -1
- package/dist/components/Checkbox/CheckboxWithLabel.cjs +1 -1
- package/dist/components/Checkbox/CheckboxWithLabel.cjs.map +1 -1
- package/dist/components/Checkbox/CheckboxWithLabel.d.ts +2 -2
- package/dist/components/Checkbox/CheckboxWithLabel.d.ts.map +1 -1
- package/dist/components/Checkbox/CheckboxWithLabel.js.map +1 -1
- package/dist/components/Checkbox/index.d.ts.map +1 -1
- package/dist/components/Checkbox/index2.cjs +0 -1
- package/dist/components/Checkbox/index2.cjs.map +1 -1
- package/dist/components/Checkbox/index2.js.map +1 -1
- package/dist/components/Clickable/index.d.ts +1 -1
- package/dist/components/Clickable/index.d.ts.map +1 -1
- package/dist/components/Clickable/index2.cjs +1 -1
- package/dist/components/Clickable/index2.cjs.map +1 -1
- package/dist/components/Clickable/index2.js.map +1 -1
- package/dist/components/DropdownSelector/DropdownMenuItem/index2.cjs +0 -1
- package/dist/components/DropdownSelector/DropdownMenuItem/index2.cjs.map +1 -1
- package/dist/components/DropdownSelector/DropdownMenuItem/index2.js.map +1 -1
- package/dist/components/DropdownSelector/DropdownPopover.cjs +0 -1
- package/dist/components/DropdownSelector/DropdownPopover.cjs.map +1 -1
- package/dist/components/DropdownSelector/DropdownPopover.js.map +1 -1
- package/dist/components/DropdownSelector/ListItem/index.d.ts +1 -1
- package/dist/components/DropdownSelector/ListItem/index.d.ts.map +1 -1
- package/dist/components/DropdownSelector/ListItem/index2.cjs +0 -1
- package/dist/components/DropdownSelector/ListItem/index2.cjs.map +1 -1
- package/dist/components/DropdownSelector/ListItem/index2.js.map +1 -1
- package/dist/components/DropdownSelector/MenuItem/index.cjs +29 -2
- package/dist/components/DropdownSelector/MenuItem/index.cjs.map +1 -1
- package/dist/components/DropdownSelector/MenuItem/index.d.ts.map +1 -1
- package/dist/components/DropdownSelector/MenuItem/index.js +30 -2
- package/dist/components/DropdownSelector/MenuItem/index.js.map +1 -1
- package/dist/components/DropdownSelector/MenuItem/internals/handleFocusByKeyBoard.cjs.map +1 -1
- package/dist/components/DropdownSelector/MenuItem/internals/handleFocusByKeyBoard.js.map +1 -1
- package/dist/components/DropdownSelector/MenuItem/internals/useMenuItemHandleKeyDown.cjs +0 -1
- package/dist/components/DropdownSelector/MenuItem/internals/useMenuItemHandleKeyDown.cjs.map +1 -1
- package/dist/components/DropdownSelector/MenuItem/internals/useMenuItemHandleKeyDown.js.map +1 -1
- package/dist/components/DropdownSelector/MenuItemGroup/index2.cjs +0 -1
- package/dist/components/DropdownSelector/MenuItemGroup/index2.cjs.map +1 -1
- package/dist/components/DropdownSelector/MenuItemGroup/index2.js.map +1 -1
- package/dist/components/DropdownSelector/MenuList/MenuListContext.cjs +0 -1
- package/dist/components/DropdownSelector/MenuList/MenuListContext.cjs.map +1 -1
- package/dist/components/DropdownSelector/MenuList/MenuListContext.js.map +1 -1
- package/dist/components/DropdownSelector/MenuList/index2.cjs +0 -1
- package/dist/components/DropdownSelector/MenuList/index2.cjs.map +1 -1
- package/dist/components/DropdownSelector/MenuList/index2.js.map +1 -1
- package/dist/components/DropdownSelector/MenuList/internals/getValuesRecursive.cjs +1 -1
- package/dist/components/DropdownSelector/MenuList/internals/getValuesRecursive.cjs.map +1 -1
- package/dist/components/DropdownSelector/MenuList/internals/getValuesRecursive.js.map +1 -1
- package/dist/components/DropdownSelector/Popover/index.d.ts.map +1 -1
- package/dist/components/DropdownSelector/Popover/index2.cjs +18 -1
- package/dist/components/DropdownSelector/Popover/index2.cjs.map +1 -1
- package/dist/components/DropdownSelector/Popover/index2.js +19 -1
- package/dist/components/DropdownSelector/Popover/index2.js.map +1 -1
- package/dist/components/DropdownSelector/Popover/usePreventScroll.cjs +0 -1
- package/dist/components/DropdownSelector/Popover/usePreventScroll.cjs.map +1 -1
- package/dist/components/DropdownSelector/Popover/usePreventScroll.js.map +1 -1
- package/dist/components/DropdownSelector/index.d.ts.map +1 -1
- package/dist/components/DropdownSelector/index2.cjs +27 -10
- package/dist/components/DropdownSelector/index2.cjs.map +1 -1
- package/dist/components/DropdownSelector/index2.js +26 -9
- package/dist/components/DropdownSelector/index2.js.map +1 -1
- package/dist/components/DropdownSelector/utils/findPreviewRecursive.cjs +1 -1
- package/dist/components/DropdownSelector/utils/findPreviewRecursive.cjs.map +1 -1
- package/dist/components/DropdownSelector/utils/findPreviewRecursive.js.map +1 -1
- package/dist/components/FieldLabel/index.d.ts.map +1 -1
- package/dist/components/FieldLabel/index2.cjs +1 -1
- package/dist/components/FieldLabel/index2.cjs.map +1 -1
- package/dist/components/FieldLabel/index2.js.map +1 -1
- package/dist/components/HintText/index2.cjs +0 -1
- package/dist/components/HintText/index2.cjs.map +1 -1
- package/dist/components/HintText/index2.js.map +1 -1
- package/dist/components/Icon/index.cjs +1 -1
- package/dist/components/Icon/index.cjs.map +1 -1
- package/dist/components/Icon/index.d.ts.map +1 -1
- package/dist/components/Icon/index.js.map +1 -1
- package/dist/components/IconButton/index.d.ts +1 -1
- package/dist/components/IconButton/index.d.ts.map +1 -1
- package/dist/components/IconButton/index2.cjs +1 -1
- package/dist/components/IconButton/index2.cjs.map +1 -1
- package/dist/components/IconButton/index2.js.map +1 -1
- package/dist/components/LoadingSpinner/index.d.ts.map +1 -1
- package/dist/components/LoadingSpinner/index2.cjs +0 -1
- package/dist/components/LoadingSpinner/index2.cjs.map +1 -1
- package/dist/components/LoadingSpinner/index2.js.map +1 -1
- package/dist/components/Modal/Dialog/index2.cjs +1 -1
- package/dist/components/Modal/Dialog/index2.cjs.map +1 -1
- package/dist/components/Modal/Dialog/index2.js.map +1 -1
- package/dist/components/Modal/ModalBackgroundContext.cjs +1 -1
- package/dist/components/Modal/ModalBackgroundContext.cjs.map +1 -1
- package/dist/components/Modal/ModalBackgroundContext.js.map +1 -1
- package/dist/components/Modal/ModalPlumbing.d.ts +3 -3
- package/dist/components/Modal/ModalPlumbing2.cjs +0 -1
- package/dist/components/Modal/ModalPlumbing2.cjs.map +1 -1
- package/dist/components/Modal/ModalPlumbing2.js.map +1 -1
- package/dist/components/Modal/index.d.ts.map +1 -1
- package/dist/components/Modal/index2.cjs +1 -1
- package/dist/components/Modal/index2.cjs.map +1 -1
- package/dist/components/Modal/index2.js.map +1 -1
- package/dist/components/Modal/useCustomModalOverlay.cjs +1 -1
- package/dist/components/Modal/useCustomModalOverlay.cjs.map +1 -1
- package/dist/components/Modal/useCustomModalOverlay.js.map +1 -1
- package/dist/components/Modal/useTransitionPresence.cjs +1 -3
- package/dist/components/Modal/useTransitionPresence.cjs.map +1 -1
- package/dist/components/Modal/useTransitionPresence.js +1 -2
- package/dist/components/Modal/useTransitionPresence.js.map +1 -1
- package/dist/components/MultiSelect/context.cjs +0 -1
- package/dist/components/MultiSelect/context.cjs.map +1 -1
- package/dist/components/MultiSelect/context.js.map +1 -1
- package/dist/components/MultiSelect/index.d.ts +1 -1
- package/dist/components/MultiSelect/index.d.ts.map +1 -1
- package/dist/components/MultiSelect/index2.cjs +2 -2
- package/dist/components/MultiSelect/index2.cjs.map +1 -1
- package/dist/components/MultiSelect/index2.js.map +1 -1
- package/dist/components/Pagination/PaginationContext.cjs +0 -1
- package/dist/components/Pagination/PaginationContext.cjs.map +1 -1
- package/dist/components/Pagination/PaginationContext.js.map +1 -1
- package/dist/components/Pagination/helper.cjs.map +1 -1
- package/dist/components/Pagination/helper.js.map +1 -1
- package/dist/components/Pagination/index2.cjs +26 -135
- package/dist/components/Pagination/index2.cjs.map +1 -1
- package/dist/components/Pagination/index2.js +86 -182
- package/dist/components/Pagination/index2.js.map +1 -1
- package/dist/components/Radio/RadioGroup/index2.cjs +1 -1
- package/dist/components/Radio/RadioGroup/index2.cjs.map +1 -1
- package/dist/components/Radio/RadioGroup/index2.js.map +1 -1
- package/dist/components/Radio/RadioGroupContext.cjs.map +1 -1
- package/dist/components/Radio/RadioGroupContext.js.map +1 -1
- package/dist/components/Radio/RadioInput/index.d.ts.map +1 -1
- package/dist/components/Radio/RadioInput/index2.cjs +0 -1
- package/dist/components/Radio/RadioInput/index2.cjs.map +1 -1
- package/dist/components/Radio/RadioInput/index2.js.map +1 -1
- package/dist/components/Radio/index.d.ts.map +1 -1
- package/dist/components/Radio/index2.cjs +2 -2
- package/dist/components/Radio/index2.cjs.map +1 -1
- package/dist/components/Radio/index2.js.map +1 -1
- package/dist/components/SegmentedControl/RadioGroupContext.cjs +1 -1
- package/dist/components/SegmentedControl/RadioGroupContext.cjs.map +1 -1
- package/dist/components/SegmentedControl/RadioGroupContext.js.map +1 -1
- package/dist/components/SegmentedControl/index.d.ts.map +1 -1
- package/dist/components/SegmentedControl/index2.cjs +1 -1
- package/dist/components/SegmentedControl/index2.cjs.map +1 -1
- package/dist/components/SegmentedControl/index2.js.map +1 -1
- package/dist/components/Switch/SwitchInput/index.d.ts.map +1 -1
- package/dist/components/Switch/SwitchInput/index2.cjs +0 -1
- package/dist/components/Switch/SwitchInput/index2.cjs.map +1 -1
- package/dist/components/Switch/SwitchInput/index2.js.map +1 -1
- package/dist/components/Switch/SwitchWithLabel.cjs +1 -1
- package/dist/components/Switch/SwitchWithLabel.cjs.map +1 -1
- package/dist/components/Switch/SwitchWithLabel.d.ts +2 -2
- package/dist/components/Switch/SwitchWithLabel.d.ts.map +1 -1
- package/dist/components/Switch/SwitchWithLabel.js.map +1 -1
- package/dist/components/Switch/index.d.ts +1 -1
- package/dist/components/Switch/index.d.ts.map +1 -1
- package/dist/components/Switch/index2.cjs +0 -1
- package/dist/components/Switch/index2.cjs.map +1 -1
- package/dist/components/Switch/index2.js.map +1 -1
- package/dist/components/TagItem/index.d.ts +1 -1
- package/dist/components/TagItem/index.d.ts.map +1 -1
- package/dist/components/TagItem/index2.cjs +1 -1
- package/dist/components/TagItem/index2.cjs.map +1 -1
- package/dist/components/TagItem/index2.js.map +1 -1
- package/dist/components/TextArea/index.d.ts.map +1 -1
- package/dist/components/TextArea/index2.cjs +0 -1
- package/dist/components/TextArea/index2.cjs.map +1 -1
- package/dist/components/TextArea/index2.js.map +1 -1
- package/dist/components/TextEllipsis/helper.cjs +2 -1
- package/dist/components/TextEllipsis/helper.cjs.map +1 -1
- package/dist/components/TextEllipsis/helper.d.ts.map +1 -1
- package/dist/components/TextEllipsis/helper.js +1 -1
- package/dist/components/TextEllipsis/helper.js.map +1 -1
- package/dist/components/TextEllipsis/index2.cjs +14 -98
- package/dist/components/TextEllipsis/index2.cjs.map +1 -1
- package/dist/components/TextEllipsis/index2.js +14 -93
- package/dist/components/TextEllipsis/index2.js.map +1 -1
- package/dist/components/TextField/AssistiveText/index.d.ts +1 -1
- package/dist/components/TextField/AssistiveText/index2.cjs.map +1 -1
- package/dist/components/TextField/AssistiveText/index2.js.map +1 -1
- package/dist/components/TextField/index.d.ts +1 -1
- package/dist/components/TextField/index.d.ts.map +1 -1
- package/dist/components/TextField/index2.cjs +1 -1
- package/dist/components/TextField/index2.cjs.map +1 -1
- package/dist/components/TextField/index2.js.map +1 -1
- package/dist/components/TextField/useFocusWithClick.cjs +0 -1
- package/dist/components/TextField/useFocusWithClick.cjs.map +1 -1
- package/dist/components/TextField/useFocusWithClick.js.map +1 -1
- package/dist/core/CharcoalProvider.cjs +1 -1
- package/dist/core/CharcoalProvider.cjs.map +1 -1
- package/dist/core/CharcoalProvider.js.map +1 -1
- package/dist/core/SSRProvider.cjs +1 -1
- package/dist/core/SSRProvider.cjs.map +1 -1
- package/dist/core/SSRProvider.js +1 -1
- package/dist/core/SSRProvider.js.map +1 -1
- package/dist/core/SetThemeScript.cjs +0 -1
- package/dist/core/SetThemeScript.cjs.map +1 -1
- package/dist/core/SetThemeScript.js.map +1 -1
- package/dist/core/themeHelper.cjs +0 -1
- package/dist/core/themeHelper.cjs.map +1 -1
- package/dist/core/themeHelper.d.ts +2 -2
- package/dist/core/themeHelper.d.ts.map +1 -1
- package/dist/core/themeHelper.js.map +1 -1
- package/dist/index.cjs +22 -23
- package/dist/index.css +907 -901
- package/dist/layered.css +907 -901
- package/dist/layered.css.map +1 -1
- package/package.json +10 -10
- package/src/__tests__/css-shorthand-safety.test.ts +150 -0
- package/src/_lib/compat.ts +1 -7
- package/src/components/Button/__snapshots__/index.css.snap +8 -3
- package/src/components/Button/index.css +8 -3
- package/src/components/Carousel/index.browser.test.tsx +1 -1
- package/src/components/Carousel/intersectionObserver.test.ts +12 -12
- package/src/components/Carousel/resizeObserver.test.ts +1 -1
- package/src/components/DropdownSelector/MenuItem/index.tsx +40 -2
- package/src/components/DropdownSelector/Popover/index.tsx +20 -1
- package/src/components/DropdownSelector/index.browser.test.tsx +94 -0
- package/src/components/DropdownSelector/index.test.tsx +57 -2
- package/src/components/DropdownSelector/index.tsx +37 -12
- package/src/components/FieldLabel/index.tsx +1 -2
- package/src/components/Icon/index.tsx +2 -1
- package/src/components/LoadingSpinner/__snapshots__/index.css.snap +1 -2
- package/src/components/LoadingSpinner/index.css +1 -2
- package/src/components/Modal/__snapshots__/index.css.snap +1 -0
- package/src/components/Pagination/__snapshots__/index.css.snap +3 -1
- package/src/components/Pagination/index.css +3 -1
- package/src/components/TextEllipsis/TextEllipsis.story.tsx +1 -1
- package/src/css.d.ts +1 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index2.cjs","names":[
|
|
1
|
+
{"version":3,"file":"index2.cjs","names":[],"sources":["../../../src/components/DropdownSelector/index.tsx"],"sourcesContent":["import './index.css'\n\nimport React, { ReactNode, useState, useRef, useMemo, useCallback } from 'react'\nimport Icon from '../Icon'\nimport FieldLabel from '../FieldLabel'\nimport { DropdownPopover } from './DropdownPopover'\nimport { findPreviewRecursive } from './utils/findPreviewRecursive'\nimport MenuList, { MenuListChildren } from './MenuList'\nimport { getValuesRecursive } from './MenuList/internals/getValuesRecursive'\nimport { AssistiveText } from '../TextField/AssistiveText'\nimport { useClassNames } from '../../_lib/useClassNames'\nimport { PopoverProps } from './Popover'\n\nimport { useVisuallyHidden } from 'react-aria/VisuallyHidden'\nimport { useId } from 'react-aria/useId'\n\nexport type DropdownSelectorProps = {\n label: string\n value: string\n disabled?: boolean\n placeholder?: string\n showLabel?: boolean\n invalid?: boolean\n assistiveText?: string\n required?: boolean\n requiredText?: string\n subLabel?: ReactNode\n /**\n * the name of hidden `<select />`\n */\n name?: string\n children: MenuListChildren\n onChange: (value: string) => void\n className?: string\n selectRef?: React.Ref<HTMLSelectElement>\n} & Pick<PopoverProps, 'inertWorkaround'>\n\nexport default function DropdownSelector({\n onChange,\n showLabel = false,\n selectRef,\n ...props\n}: DropdownSelectorProps) {\n const triggerRef = useRef<HTMLButtonElement>(null)\n const penHandledRef = useRef(false)\n const [isOpen, setIsOpen] = useState(false)\n const preview = findPreviewRecursive(props.children, props.value)\n\n const isPlaceholder = useMemo(\n () => props.placeholder !== undefined && preview === undefined,\n [preview, props.placeholder],\n )\n\n const propsArray = getValuesRecursive(props.children)\n const hasMatchedValue = useMemo(\n () => propsArray.some((itemProps) => itemProps.value === props.value),\n [propsArray, props.value],\n )\n\n const { visuallyHiddenProps } = useVisuallyHidden()\n\n const handleChange = useCallback(\n (e: React.ChangeEvent<HTMLSelectElement>) => {\n onChange(e.target.value)\n },\n [onChange],\n )\n\n // Popover が document listener の登録に使うため、識別子を安定させる\n const handleClose = useCallback(() => {\n setIsOpen(false)\n }, [])\n\n const handleSelect = useCallback(\n (v: string) => {\n onChange(v)\n setIsOpen(false)\n },\n [onChange],\n )\n\n const handleTriggerPointerUp = useCallback(\n (e: React.PointerEvent<HTMLButtonElement>) => {\n if (e.pointerType !== 'pen') return\n if (props.disabled === true) return\n penHandledRef.current = true\n setIsOpen(true)\n },\n [props.disabled],\n )\n\n const handleTriggerClick = useCallback(() => {\n if (penHandledRef.current) {\n penHandledRef.current = false\n return\n }\n if (props.disabled === true) return\n setIsOpen(true)\n }, [props.disabled])\n\n const labelId = useId()\n const describedbyId = useId()\n\n const classNames = useClassNames(\n 'charcoal-dropdown-selector-root',\n props.className,\n )\n\n return (\n <div className={classNames} aria-disabled={props.disabled}>\n <FieldLabel\n id={labelId}\n label={props.label}\n required={props.required}\n requiredText={props.requiredText}\n subLabel={props.subLabel}\n {...(!showLabel ? visuallyHiddenProps : {})}\n />\n <div {...visuallyHiddenProps} aria-hidden=\"true\">\n <select\n name={props.name}\n value={props.value}\n onChange={handleChange}\n tabIndex={-1}\n ref={selectRef}\n >\n {!hasMatchedValue && (\n <option value={props.value}>{props.value}</option>\n )}\n {propsArray.map((itemProps) => {\n return (\n <option\n key={itemProps.value}\n value={itemProps.value}\n disabled={itemProps.disabled}\n >\n {itemProps.value}\n </option>\n )\n })}\n </select>\n </div>\n {/* eslint-disable-next-line jsx-a11y/role-supports-aria-props */}\n <button\n className=\"charcoal-dropdown-selector-button\"\n aria-labelledby={labelId}\n aria-invalid={props.invalid}\n aria-describedby={\n props.assistiveText !== undefined ? describedbyId : undefined\n }\n disabled={props.disabled}\n onPointerUp={handleTriggerPointerUp}\n onClick={handleTriggerClick}\n ref={triggerRef}\n type=\"button\"\n data-active={isOpen}\n >\n <span\n className=\"charcoal-ui-dropdown-selector-text\"\n data-placeholder={isPlaceholder}\n >\n {isPlaceholder ? props.placeholder : preview}\n </span>\n <Icon className=\"charcoal-ui-dropdown-selector-icon\" name=\"16/Menu\" />\n </button>\n {isOpen && (\n <DropdownPopover\n isOpen={isOpen}\n onClose={handleClose}\n triggerRef={triggerRef}\n value={props.value}\n inertWorkaround={props.inertWorkaround}\n >\n <MenuList value={props.value} onChange={handleSelect}>\n {props.children}\n </MenuList>\n </DropdownPopover>\n )}\n {props.assistiveText !== undefined && (\n <AssistiveText data-invalid={props.invalid === true} id={describedbyId}>\n {props.assistiveText}\n </AssistiveText>\n )}\n </div>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAqCA,SAAwB,iBAAiB,EACvC,UACA,YAAY,OACZ,WACA,GAAG,SACqB;CACxB,MAAM,+BAAuC,IAAI;CACjD,MAAM,kCAAuB,KAAK;CAClC,MAAM,CAAC,QAAQ,iCAAsB,KAAK;CAC1C,MAAM,UAAU,kDAAqB,MAAM,UAAU,MAAM,KAAK;CAEhE,MAAM,yCACE,MAAM,gBAAgB,UAAa,YAAY,QACrD,CAAC,SAAS,MAAM,WAAW,CAC7B;CAEA,MAAM,aAAa,8CAAmB,MAAM,QAAQ;CACpD,MAAM,2CACE,WAAW,MAAM,cAAc,UAAU,UAAU,MAAM,KAAK,GACpE,CAAC,YAAY,MAAM,KAAK,CAC1B;CAEA,MAAM,EAAE,yEAA0C;CAElD,MAAM,uCACH,MAA4C;EAC3C,SAAS,EAAE,OAAO,KAAK;CACzB,GACA,CAAC,QAAQ,CACX;CAGA,MAAM,2CAAgC;EACpC,UAAU,KAAK;CACjB,GAAG,CAAA,CAAE;CAEL,MAAM,uCACH,MAAc;EACb,SAAS,CAAC;EACV,UAAU,KAAK;CACjB,GACA,CAAC,QAAQ,CACX;CAEA,MAAM,iDACH,MAA6C;EAC5C,IAAI,EAAE,gBAAgB,OAAO;EAC7B,IAAI,MAAM,aAAa,MAAM;EAC7B,cAAc,UAAU;EACxB,UAAU,IAAI;CAChB,GACA,CAAC,MAAM,QAAQ,CACjB;CAEA,MAAM,kDAAuC;EAC3C,IAAI,cAAc,SAAS;GACzB,cAAc,UAAU;GACxB;EACF;EACA,IAAI,MAAM,aAAa,MAAM;EAC7B,UAAU,IAAI;CAChB,GAAG,CAAC,MAAM,QAAQ,CAAC;CAEnB,MAAM,sCAAgB;CACtB,MAAM,4CAAsB;CAO5B,OACE,4CAAC,OAAD;EAAK,WANY,oCACjB,mCACA,MAAM,SAIU;EAAY,iBAAe,MAAM;YAAjD;GACE,2CAAC,yBAAD;IACE,IAAI;IACJ,OAAO,MAAM;IACb,UAAU,MAAM;IAChB,cAAc,MAAM;IACpB,UAAU,MAAM;IAChB,GAAK,CAAC,YAAY,sBAAsB,CAAC;GAAG;GAE9C,2CAAC,OAAD;IAAK,GAAI;IAAqB,eAAY;cACxC,4CAAC,UAAD;KACE,MAAM,MAAM;KACZ,OAAO,MAAM;KACb,UAAU;KACV,UAAU;KACV,KAAK;eALP,CAOG,CAAC,mBACA,2CAAC,UAAD;MAAQ,OAAO,MAAM;gBAAQ,MAAM;KAAc,IAElD,WAAW,KAAK,cAAc;MAC7B,OACE,2CAAC,UAAD;OAEE,OAAO,UAAU;OACjB,UAAU,UAAU;iBAEnB,UAAU;MACL,GALD,UAAU,KAKT;KAEZ,CAAC,CACK;;GACL;GAEL,4CAAC,UAAD;IACE,WAAU;IACV,mBAAiB;IACjB,gBAAc,MAAM;IACpB,oBACE,MAAM,kBAAkB,SAAY,gBAAgB;IAEtD,UAAU,MAAM;IAChB,aAAa;IACb,SAAS;IACT,KAAK;IACL,MAAK;IACL,eAAa;cAZf,CAcE,2CAAC,QAAD;KACE,WAAU;KACV,oBAAkB;eAEjB,gBAAgB,MAAM,cAAc;IACjC,IACN,2CAAC,uBAAD;KAAM,WAAU;KAAqC,MAAK;IAAS,EAC7D;;GACP,UACC,2CAAC,yCAAD;IACU;IACR,SAAS;IACG;IACZ,OAAO,MAAM;IACb,iBAAiB,MAAM;cAEvB,2CAAC,yBAAD;KAAU,OAAO,MAAM;KAAO,UAAU;eACrC,MAAM;IACC;GACK;GAElB,MAAM,kBAAkB,UACvB,2CAAC,+BAAD;IAAe,gBAAc,MAAM,YAAY;IAAM,IAAI;cACtD,MAAM;GACM;EAEd;;AAET"}
|
|
@@ -16,6 +16,7 @@ import { useVisuallyHidden } from "react-aria/VisuallyHidden";
|
|
|
16
16
|
//#region src/components/DropdownSelector/index.tsx
|
|
17
17
|
function DropdownSelector({ onChange, showLabel = false, selectRef, ...props }) {
|
|
18
18
|
const triggerRef = useRef(null);
|
|
19
|
+
const penHandledRef = useRef(false);
|
|
19
20
|
const [isOpen, setIsOpen] = useState(false);
|
|
20
21
|
const preview = findPreviewRecursive(props.children, props.value);
|
|
21
22
|
const isPlaceholder = useMemo(() => props.placeholder !== void 0 && preview === void 0, [preview, props.placeholder]);
|
|
@@ -25,6 +26,27 @@ function DropdownSelector({ onChange, showLabel = false, selectRef, ...props })
|
|
|
25
26
|
const handleChange = useCallback((e) => {
|
|
26
27
|
onChange(e.target.value);
|
|
27
28
|
}, [onChange]);
|
|
29
|
+
const handleClose = useCallback(() => {
|
|
30
|
+
setIsOpen(false);
|
|
31
|
+
}, []);
|
|
32
|
+
const handleSelect = useCallback((v) => {
|
|
33
|
+
onChange(v);
|
|
34
|
+
setIsOpen(false);
|
|
35
|
+
}, [onChange]);
|
|
36
|
+
const handleTriggerPointerUp = useCallback((e) => {
|
|
37
|
+
if (e.pointerType !== "pen") return;
|
|
38
|
+
if (props.disabled === true) return;
|
|
39
|
+
penHandledRef.current = true;
|
|
40
|
+
setIsOpen(true);
|
|
41
|
+
}, [props.disabled]);
|
|
42
|
+
const handleTriggerClick = useCallback(() => {
|
|
43
|
+
if (penHandledRef.current) {
|
|
44
|
+
penHandledRef.current = false;
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
if (props.disabled === true) return;
|
|
48
|
+
setIsOpen(true);
|
|
49
|
+
}, [props.disabled]);
|
|
28
50
|
const labelId = useId();
|
|
29
51
|
const describedbyId = useId();
|
|
30
52
|
return /* @__PURE__ */ jsxs("div", {
|
|
@@ -66,10 +88,8 @@ function DropdownSelector({ onChange, showLabel = false, selectRef, ...props })
|
|
|
66
88
|
"aria-invalid": props.invalid,
|
|
67
89
|
"aria-describedby": props.assistiveText !== void 0 ? describedbyId : void 0,
|
|
68
90
|
disabled: props.disabled,
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
setIsOpen(true);
|
|
72
|
-
},
|
|
91
|
+
onPointerUp: handleTriggerPointerUp,
|
|
92
|
+
onClick: handleTriggerClick,
|
|
73
93
|
ref: triggerRef,
|
|
74
94
|
type: "button",
|
|
75
95
|
"data-active": isOpen,
|
|
@@ -84,16 +104,13 @@ function DropdownSelector({ onChange, showLabel = false, selectRef, ...props })
|
|
|
84
104
|
}),
|
|
85
105
|
isOpen && /* @__PURE__ */ jsx(DropdownPopover, {
|
|
86
106
|
isOpen,
|
|
87
|
-
onClose:
|
|
107
|
+
onClose: handleClose,
|
|
88
108
|
triggerRef,
|
|
89
109
|
value: props.value,
|
|
90
110
|
inertWorkaround: props.inertWorkaround,
|
|
91
111
|
children: /* @__PURE__ */ jsx(MenuList, {
|
|
92
112
|
value: props.value,
|
|
93
|
-
onChange:
|
|
94
|
-
onChange(v);
|
|
95
|
-
setIsOpen(false);
|
|
96
|
-
},
|
|
113
|
+
onChange: handleSelect,
|
|
97
114
|
children: props.children
|
|
98
115
|
})
|
|
99
116
|
}),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index2.js","names":[
|
|
1
|
+
{"version":3,"file":"index2.js","names":[],"sources":["../../../src/components/DropdownSelector/index.tsx"],"sourcesContent":["import './index.css'\n\nimport React, { ReactNode, useState, useRef, useMemo, useCallback } from 'react'\nimport Icon from '../Icon'\nimport FieldLabel from '../FieldLabel'\nimport { DropdownPopover } from './DropdownPopover'\nimport { findPreviewRecursive } from './utils/findPreviewRecursive'\nimport MenuList, { MenuListChildren } from './MenuList'\nimport { getValuesRecursive } from './MenuList/internals/getValuesRecursive'\nimport { AssistiveText } from '../TextField/AssistiveText'\nimport { useClassNames } from '../../_lib/useClassNames'\nimport { PopoverProps } from './Popover'\n\nimport { useVisuallyHidden } from 'react-aria/VisuallyHidden'\nimport { useId } from 'react-aria/useId'\n\nexport type DropdownSelectorProps = {\n label: string\n value: string\n disabled?: boolean\n placeholder?: string\n showLabel?: boolean\n invalid?: boolean\n assistiveText?: string\n required?: boolean\n requiredText?: string\n subLabel?: ReactNode\n /**\n * the name of hidden `<select />`\n */\n name?: string\n children: MenuListChildren\n onChange: (value: string) => void\n className?: string\n selectRef?: React.Ref<HTMLSelectElement>\n} & Pick<PopoverProps, 'inertWorkaround'>\n\nexport default function DropdownSelector({\n onChange,\n showLabel = false,\n selectRef,\n ...props\n}: DropdownSelectorProps) {\n const triggerRef = useRef<HTMLButtonElement>(null)\n const penHandledRef = useRef(false)\n const [isOpen, setIsOpen] = useState(false)\n const preview = findPreviewRecursive(props.children, props.value)\n\n const isPlaceholder = useMemo(\n () => props.placeholder !== undefined && preview === undefined,\n [preview, props.placeholder],\n )\n\n const propsArray = getValuesRecursive(props.children)\n const hasMatchedValue = useMemo(\n () => propsArray.some((itemProps) => itemProps.value === props.value),\n [propsArray, props.value],\n )\n\n const { visuallyHiddenProps } = useVisuallyHidden()\n\n const handleChange = useCallback(\n (e: React.ChangeEvent<HTMLSelectElement>) => {\n onChange(e.target.value)\n },\n [onChange],\n )\n\n // Popover が document listener の登録に使うため、識別子を安定させる\n const handleClose = useCallback(() => {\n setIsOpen(false)\n }, [])\n\n const handleSelect = useCallback(\n (v: string) => {\n onChange(v)\n setIsOpen(false)\n },\n [onChange],\n )\n\n const handleTriggerPointerUp = useCallback(\n (e: React.PointerEvent<HTMLButtonElement>) => {\n if (e.pointerType !== 'pen') return\n if (props.disabled === true) return\n penHandledRef.current = true\n setIsOpen(true)\n },\n [props.disabled],\n )\n\n const handleTriggerClick = useCallback(() => {\n if (penHandledRef.current) {\n penHandledRef.current = false\n return\n }\n if (props.disabled === true) return\n setIsOpen(true)\n }, [props.disabled])\n\n const labelId = useId()\n const describedbyId = useId()\n\n const classNames = useClassNames(\n 'charcoal-dropdown-selector-root',\n props.className,\n )\n\n return (\n <div className={classNames} aria-disabled={props.disabled}>\n <FieldLabel\n id={labelId}\n label={props.label}\n required={props.required}\n requiredText={props.requiredText}\n subLabel={props.subLabel}\n {...(!showLabel ? visuallyHiddenProps : {})}\n />\n <div {...visuallyHiddenProps} aria-hidden=\"true\">\n <select\n name={props.name}\n value={props.value}\n onChange={handleChange}\n tabIndex={-1}\n ref={selectRef}\n >\n {!hasMatchedValue && (\n <option value={props.value}>{props.value}</option>\n )}\n {propsArray.map((itemProps) => {\n return (\n <option\n key={itemProps.value}\n value={itemProps.value}\n disabled={itemProps.disabled}\n >\n {itemProps.value}\n </option>\n )\n })}\n </select>\n </div>\n {/* eslint-disable-next-line jsx-a11y/role-supports-aria-props */}\n <button\n className=\"charcoal-dropdown-selector-button\"\n aria-labelledby={labelId}\n aria-invalid={props.invalid}\n aria-describedby={\n props.assistiveText !== undefined ? describedbyId : undefined\n }\n disabled={props.disabled}\n onPointerUp={handleTriggerPointerUp}\n onClick={handleTriggerClick}\n ref={triggerRef}\n type=\"button\"\n data-active={isOpen}\n >\n <span\n className=\"charcoal-ui-dropdown-selector-text\"\n data-placeholder={isPlaceholder}\n >\n {isPlaceholder ? props.placeholder : preview}\n </span>\n <Icon className=\"charcoal-ui-dropdown-selector-icon\" name=\"16/Menu\" />\n </button>\n {isOpen && (\n <DropdownPopover\n isOpen={isOpen}\n onClose={handleClose}\n triggerRef={triggerRef}\n value={props.value}\n inertWorkaround={props.inertWorkaround}\n >\n <MenuList value={props.value} onChange={handleSelect}>\n {props.children}\n </MenuList>\n </DropdownPopover>\n )}\n {props.assistiveText !== undefined && (\n <AssistiveText data-invalid={props.invalid === true} id={describedbyId}>\n {props.assistiveText}\n </AssistiveText>\n )}\n </div>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAqCA,SAAwB,iBAAiB,EACvC,UACA,YAAY,OACZ,WACA,GAAG,SACqB;CACxB,MAAM,aAAa,OAA0B,IAAI;CACjD,MAAM,gBAAgB,OAAO,KAAK;CAClC,MAAM,CAAC,QAAQ,aAAa,SAAS,KAAK;CAC1C,MAAM,UAAU,qBAAqB,MAAM,UAAU,MAAM,KAAK;CAEhE,MAAM,gBAAgB,cACd,MAAM,gBAAgB,UAAa,YAAY,QACrD,CAAC,SAAS,MAAM,WAAW,CAC7B;CAEA,MAAM,aAAa,mBAAmB,MAAM,QAAQ;CACpD,MAAM,kBAAkB,cAChB,WAAW,MAAM,cAAc,UAAU,UAAU,MAAM,KAAK,GACpE,CAAC,YAAY,MAAM,KAAK,CAC1B;CAEA,MAAM,EAAE,wBAAwB,kBAAkB;CAElD,MAAM,eAAe,aAClB,MAA4C;EAC3C,SAAS,EAAE,OAAO,KAAK;CACzB,GACA,CAAC,QAAQ,CACX;CAGA,MAAM,cAAc,kBAAkB;EACpC,UAAU,KAAK;CACjB,GAAG,CAAA,CAAE;CAEL,MAAM,eAAe,aAClB,MAAc;EACb,SAAS,CAAC;EACV,UAAU,KAAK;CACjB,GACA,CAAC,QAAQ,CACX;CAEA,MAAM,yBAAyB,aAC5B,MAA6C;EAC5C,IAAI,EAAE,gBAAgB,OAAO;EAC7B,IAAI,MAAM,aAAa,MAAM;EAC7B,cAAc,UAAU;EACxB,UAAU,IAAI;CAChB,GACA,CAAC,MAAM,QAAQ,CACjB;CAEA,MAAM,qBAAqB,kBAAkB;EAC3C,IAAI,cAAc,SAAS;GACzB,cAAc,UAAU;GACxB;EACF;EACA,IAAI,MAAM,aAAa,MAAM;EAC7B,UAAU,IAAI;CAChB,GAAG,CAAC,MAAM,QAAQ,CAAC;CAEnB,MAAM,UAAU,MAAM;CACtB,MAAM,gBAAgB,MAAM;CAO5B,OACE,qBAAC,OAAD;EAAK,WANY,cACjB,mCACA,MAAM,SAIU;EAAY,iBAAe,MAAM;YAAjD;GACE,oBAAC,YAAD;IACE,IAAI;IACJ,OAAO,MAAM;IACb,UAAU,MAAM;IAChB,cAAc,MAAM;IACpB,UAAU,MAAM;IAChB,GAAK,CAAC,YAAY,sBAAsB,CAAC;GAAG;GAE9C,oBAAC,OAAD;IAAK,GAAI;IAAqB,eAAY;cACxC,qBAAC,UAAD;KACE,MAAM,MAAM;KACZ,OAAO,MAAM;KACb,UAAU;KACV,UAAU;KACV,KAAK;eALP,CAOG,CAAC,mBACA,oBAAC,UAAD;MAAQ,OAAO,MAAM;gBAAQ,MAAM;KAAc,IAElD,WAAW,KAAK,cAAc;MAC7B,OACE,oBAAC,UAAD;OAEE,OAAO,UAAU;OACjB,UAAU,UAAU;iBAEnB,UAAU;MACL,GALD,UAAU,KAKT;KAEZ,CAAC,CACK;;GACL;GAEL,qBAAC,UAAD;IACE,WAAU;IACV,mBAAiB;IACjB,gBAAc,MAAM;IACpB,oBACE,MAAM,kBAAkB,SAAY,gBAAgB;IAEtD,UAAU,MAAM;IAChB,aAAa;IACb,SAAS;IACT,KAAK;IACL,MAAK;IACL,eAAa;cAZf,CAcE,oBAAC,QAAD;KACE,WAAU;KACV,oBAAkB;eAEjB,gBAAgB,MAAM,cAAc;IACjC,IACN,oBAAC,MAAD;KAAM,WAAU;KAAqC,MAAK;IAAS,EAC7D;;GACP,UACC,oBAAC,iBAAD;IACU;IACR,SAAS;IACG;IACZ,OAAO,MAAM;IACb,iBAAiB,MAAM;cAEvB,oBAAC,UAAD;KAAU,OAAO,MAAM;KAAO,UAAU;eACrC,MAAM;IACC;GACK;GAElB,MAAM,kBAAkB,UACvB,oBAAC,eAAD;IAAe,gBAAc,MAAM,YAAY;IAAM,IAAI;cACtD,MAAM;GACM;EAEd;;AAET"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
const require_runtime = require('../../../_virtual/_rolldown/runtime.cjs');
|
|
3
3
|
let react = require("react");
|
|
4
|
-
react = require_runtime.__toESM(react);
|
|
4
|
+
react = require_runtime.__toESM(react, 1);
|
|
5
5
|
|
|
6
6
|
//#region src/components/DropdownSelector/utils/findPreviewRecursive.tsx
|
|
7
7
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"findPreviewRecursive.cjs","names":[
|
|
1
|
+
{"version":3,"file":"findPreviewRecursive.cjs","names":[],"sources":["../../../../src/components/DropdownSelector/utils/findPreviewRecursive.tsx"],"sourcesContent":["import { ReactNode } from 'react'\nimport * as React from 'react'\n\n/**\n * DropdownSelectorの選択中の要素をレンダリングするため、\n * 選択中のMenuItemを再帰的に探索しReactNodeを返す。\n *\n * @param children\n * @param value\n * @param values\n * @returns\n */\nexport function findPreviewRecursive(\n children: ReactNode,\n value: string,\n): ReactNode | undefined {\n const childArray = React.Children.toArray(children)\n for (let i = 0; i < childArray.length; i++) {\n const child = childArray[i]\n if (React.isValidElement(child)) {\n if ('value' in child.props) {\n const childValue = (child.props as { value: string }).value\n if (childValue === value && 'children' in child.props) {\n const children = (child.props as { children: ReactNode }).children\n return children\n }\n }\n if ('children' in child.props) {\n const children = findPreviewRecursive(\n (child.props as { children: ReactNode }).children,\n value,\n )\n if (children !== undefined) {\n return children\n }\n }\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;AAYA,SAAgB,qBACd,UACA,OACuB;CACvB,MAAM,aAAa,MAAM,SAAS,QAAQ,QAAQ;CAClD,KAAK,IAAI,IAAI,GAAG,IAAI,WAAW,QAAQ,KAAK;EAC1C,MAAM,QAAQ,WAAW;EACzB,IAAI,MAAM,eAAe,KAAK,GAAG;GAC/B,IAAI,WAAW,MAAM,OAEnB;QADoB,MAAM,MAA4B,UACnC,SAAS,cAAc,MAAM,OAE9C,OADkB,MAAM,MAAkC;GAE5D;GAEF,IAAI,cAAc,MAAM,OAAO;IAC7B,MAAM,WAAW,qBACd,MAAM,MAAkC,UACzC,KACF;IACA,IAAI,aAAa,QACf,OAAO;GAEX;EACF;CACF;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"findPreviewRecursive.js","names":[
|
|
1
|
+
{"version":3,"file":"findPreviewRecursive.js","names":[],"sources":["../../../../src/components/DropdownSelector/utils/findPreviewRecursive.tsx"],"sourcesContent":["import { ReactNode } from 'react'\nimport * as React from 'react'\n\n/**\n * DropdownSelectorの選択中の要素をレンダリングするため、\n * 選択中のMenuItemを再帰的に探索しReactNodeを返す。\n *\n * @param children\n * @param value\n * @param values\n * @returns\n */\nexport function findPreviewRecursive(\n children: ReactNode,\n value: string,\n): ReactNode | undefined {\n const childArray = React.Children.toArray(children)\n for (let i = 0; i < childArray.length; i++) {\n const child = childArray[i]\n if (React.isValidElement(child)) {\n if ('value' in child.props) {\n const childValue = (child.props as { value: string }).value\n if (childValue === value && 'children' in child.props) {\n const children = (child.props as { children: ReactNode }).children\n return children\n }\n }\n if ('children' in child.props) {\n const children = findPreviewRecursive(\n (child.props as { children: ReactNode }).children,\n value,\n )\n if (children !== undefined) {\n return children\n }\n }\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;AAYA,SAAgB,qBACd,UACA,OACuB;CACvB,MAAM,aAAa,QAAM,SAAS,QAAQ,QAAQ;CAClD,KAAK,IAAI,IAAI,GAAG,IAAI,WAAW,QAAQ,KAAK;EAC1C,MAAM,QAAQ,WAAW;EACzB,IAAI,QAAM,eAAe,KAAK,GAAG;GAC/B,IAAI,WAAW,MAAM,OAEnB;QADoB,MAAM,MAA4B,UACnC,SAAS,cAAc,MAAM,OAE9C,OADkB,MAAM,MAAkC;GAE5D;GAEF,IAAI,cAAc,MAAM,OAAO;IAC7B,MAAM,WAAW,qBACd,MAAM,MAAkC,UACzC,KACF;IACA,IAAI,aAAa,QACf,OAAO;GAEX;EACF;CACF;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/FieldLabel/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAG9B,OAAO,aAAa,CAAA;AAEpB,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/FieldLabel/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAG9B,OAAO,aAAa,CAAA;AAEpB,MAAM,WAAW,eAAgB,SAAQ,KAAK,CAAC,mBAAmB,CAAC,gBAAgB,CAAC;IAClF,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACnC,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAE3B,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAA;CAC/B;AAED,QAAA,MAAM,UAAU,0FA8Bf,CAAA;eAEc,UAAU"}
|
|
@@ -3,7 +3,7 @@ const require_runtime = require('../../_virtual/_rolldown/runtime.cjs');
|
|
|
3
3
|
const require_useClassNames = require('../../_lib/useClassNames.cjs');
|
|
4
4
|
require('./index.cjs');
|
|
5
5
|
let react = require("react");
|
|
6
|
-
react = require_runtime.__toESM(react);
|
|
6
|
+
react = require_runtime.__toESM(react, 1);
|
|
7
7
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
8
8
|
|
|
9
9
|
//#region src/components/FieldLabel/index.tsx
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index2.cjs","names":[
|
|
1
|
+
{"version":3,"file":"index2.cjs","names":[],"sources":["../../../src/components/FieldLabel/index.tsx"],"sourcesContent":["import * as React from 'react'\nimport { useClassNames } from '../../_lib/useClassNames'\n\nimport './index.css'\n\nexport interface FieldLabelProps extends React.LabelHTMLAttributes<HTMLLabelElement> {\n readonly className?: string\n readonly label: string\n readonly subLabel?: React.ReactNode\n readonly required?: boolean\n // TODO: 翻訳用のContextで注入する\n readonly requiredText?: string\n}\n\nconst FieldLabel = React.forwardRef<HTMLLabelElement, FieldLabelProps>(\n function FieldLabel(\n {\n style,\n className,\n label,\n required = false,\n requiredText,\n subLabel,\n ...labelProps\n },\n ref,\n ) {\n const classNames = useClassNames('charcoal-field-label-root', className)\n return (\n <div style={style} className={classNames}>\n <label ref={ref} className=\"charcoal-field-label\" {...labelProps}>\n {label}\n </label>\n {required && (\n <div className=\"charcoal-field-label-required-text\">\n {requiredText}\n </div>\n )}\n <div className=\"charcoal-field-label-sub-label\">\n <span>{subLabel}</span>\n </div>\n </div>\n )\n },\n)\n\nexport default FieldLabel\n"],"mappings":";;;;;;;;;AAcA,MAAM,aAAa,MAAM,WACvB,SAAS,WACP,EACE,OACA,WACA,OACA,WAAW,OACX,cACA,UACA,GAAG,cAEL,KACA;CAEA,OACE,4CAAC,OAAD;EAAY;EAAO,WAFF,oCAAc,6BAA6B,SAE9B;YAA9B;GACE,2CAAC,SAAD;IAAY;IAAK,WAAU;IAAuB,GAAI;cACnD;GACI;GACN,YACC,2CAAC,OAAD;IAAK,WAAU;cACZ;GACE;GAEP,2CAAC,OAAD;IAAK,WAAU;cACb,2CAAC,QAAD,YAAO,SAAe;GACnB;EACF;;AAET,CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index2.js","names":[
|
|
1
|
+
{"version":3,"file":"index2.js","names":[],"sources":["../../../src/components/FieldLabel/index.tsx"],"sourcesContent":["import * as React from 'react'\nimport { useClassNames } from '../../_lib/useClassNames'\n\nimport './index.css'\n\nexport interface FieldLabelProps extends React.LabelHTMLAttributes<HTMLLabelElement> {\n readonly className?: string\n readonly label: string\n readonly subLabel?: React.ReactNode\n readonly required?: boolean\n // TODO: 翻訳用のContextで注入する\n readonly requiredText?: string\n}\n\nconst FieldLabel = React.forwardRef<HTMLLabelElement, FieldLabelProps>(\n function FieldLabel(\n {\n style,\n className,\n label,\n required = false,\n requiredText,\n subLabel,\n ...labelProps\n },\n ref,\n ) {\n const classNames = useClassNames('charcoal-field-label-root', className)\n return (\n <div style={style} className={classNames}>\n <label ref={ref} className=\"charcoal-field-label\" {...labelProps}>\n {label}\n </label>\n {required && (\n <div className=\"charcoal-field-label-required-text\">\n {requiredText}\n </div>\n )}\n <div className=\"charcoal-field-label-sub-label\">\n <span>{subLabel}</span>\n </div>\n </div>\n )\n },\n)\n\nexport default FieldLabel\n"],"mappings":";;;;;;;AAcA,MAAM,aAAa,QAAM,WACvB,SAAS,WACP,EACE,OACA,WACA,OACA,WAAW,OACX,cACA,UACA,GAAG,cAEL,KACA;CAEA,OACE,qBAAC,OAAD;EAAY;EAAO,WAFF,cAAc,6BAA6B,SAE9B;YAA9B;GACE,oBAAC,SAAD;IAAY;IAAK,WAAU;IAAuB,GAAI;cACnD;GACI;GACN,YACC,oBAAC,OAAD;IAAK,WAAU;cACZ;GACE;GAEP,oBAAC,OAAD;IAAK,WAAU;cACb,oBAAC,QAAD,YAAO,SAAe;GACnB;EACF;;AAET,CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index2.cjs","names":[
|
|
1
|
+
{"version":3,"file":"index2.cjs","names":[],"sources":["../../../src/components/HintText/index.tsx"],"sourcesContent":["import { ReactNode } from 'react'\nimport Icon from '../Icon'\n\nimport './index.css'\nimport { useClassNames } from '../../_lib/useClassNames'\n\nexport type HintTextContext = 'page' | 'section'\nexport interface HintTextProps {\n children: ReactNode\n context?: HintTextContext\n className?: string\n}\n\nexport default function HintText({\n children,\n context = 'section',\n className,\n}: HintTextProps) {\n const classNames = useClassNames('charcoal-hint-text', className)\n\n return (\n <div className={classNames} data-context={context}>\n <div className=\"charcoal-hint-text-icon\">\n <Icon name=\"16/Info\" />\n </div>\n <p className=\"charcoal-hint-text-message\">{children}</p>\n </div>\n )\n}\n"],"mappings":";;;;;;;AAaA,SAAwB,SAAS,EAC/B,UACA,UAAU,WACV,aACgB;CAGhB,OACE,4CAAC,OAAD;EAAK,WAHY,oCAAc,sBAAsB,SAGrC;EAAY,gBAAc;YAA1C,CACE,2CAAC,OAAD;GAAK,WAAU;aACb,2CAAC,uBAAD,EAAM,MAAK,UAAS;EACjB,IACL,2CAAC,KAAD;GAAG,WAAU;GAA8B;EAAY,EACpD;;AAET"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index2.js","names":[
|
|
1
|
+
{"version":3,"file":"index2.js","names":[],"sources":["../../../src/components/HintText/index.tsx"],"sourcesContent":["import { ReactNode } from 'react'\nimport Icon from '../Icon'\n\nimport './index.css'\nimport { useClassNames } from '../../_lib/useClassNames'\n\nexport type HintTextContext = 'page' | 'section'\nexport interface HintTextProps {\n children: ReactNode\n context?: HintTextContext\n className?: string\n}\n\nexport default function HintText({\n children,\n context = 'section',\n className,\n}: HintTextProps) {\n const classNames = useClassNames('charcoal-hint-text', className)\n\n return (\n <div className={classNames} data-context={context}>\n <div className=\"charcoal-hint-text-icon\">\n <Icon name=\"16/Info\" />\n </div>\n <p className=\"charcoal-hint-text-message\">{children}</p>\n </div>\n )\n}\n"],"mappings":";;;;;;;AAaA,SAAwB,SAAS,EAC/B,UACA,UAAU,WACV,aACgB;CAGhB,OACE,qBAAC,OAAD;EAAK,WAHY,cAAc,sBAAsB,SAGrC;EAAY,gBAAc;YAA1C,CACE,oBAAC,OAAD;GAAK,WAAU;aACb,oBAAC,MAAD,EAAM,MAAK,UAAS;EACjB,IACL,oBAAC,KAAD;GAAG,WAAU;GAA8B;EAAY,EACpD;;AAET"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
const require_runtime = require('../../_virtual/_rolldown/runtime.cjs');
|
|
3
3
|
require('../../icons/css/icon.cjs');
|
|
4
4
|
let react = require("react");
|
|
5
|
-
react = require_runtime.__toESM(react);
|
|
5
|
+
react = require_runtime.__toESM(react, 1);
|
|
6
6
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
7
7
|
let _charcoal_ui_icons = require("@charcoal-ui/icons");
|
|
8
8
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":[
|
|
1
|
+
{"version":3,"file":"index.cjs","names":[],"sources":["../../../src/components/Icon/index.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport '@charcoal-ui/icons'\n// tmp fix for https://github.com/rolldown/tsdown/pull/981\nimport '../../../../icons/css/icon.css'\nimport { calcActualSize } from '@charcoal-ui/icons'\nimport type { IconSizing, PixivIcon, Props } from '@charcoal-ui/icons'\n\nexport interface OwnProps {\n /**\n * @deprecated `fixedSize` を利用してください。\n * `attr()` の数値解釈サポートが限定的なため、リセット CSS だけではレイアウトシフトが防げません。\n */\n unsafeNonGuidelineScale?: number\n /**\n * 固定 px サイズで描画します。ガイドライン外のサイズを利用する場合に推奨される指定方法で、\n * 他のサイズ指定 (`scale` / `unsafeNonGuidelineScale`) よりも常に優先されます。\n *\n * `<Icon>` は同じ値を `--charcoal-icon-size` インライン CSS 変数として自動付与するため、\n * Web Component の hydrate 前後でレイアウトシフトは発生しません。\n */\n fixedSize?: number\n className?: string\n}\n\nexport interface IconProps\n extends\n OwnProps,\n React.PropsWithoutRef<\n Omit<Props, 'class' | 'unsafe-non-guideline-scale' | 'fixed-size' | 'css'>\n > {}\n\nconst Icon = React.forwardRef<PixivIcon, IconProps>(function IconInner(\n {\n name,\n scale,\n unsafeNonGuidelineScale,\n fixedSize,\n className,\n style: userStyle,\n ...rest\n },\n ref,\n) {\n const actualSize = React.useMemo(\n // IconSizing の排他制約は IconProps の型レベルで保証されるため、内部では緩和する\n () =>\n calcActualSize({\n name,\n scale,\n unsafeNonGuidelineScale,\n fixedSize,\n } as { name: string } & IconSizing),\n [name, scale, unsafeNonGuidelineScale, fixedSize],\n )\n\n const style = React.useMemo(\n () =>\n ({\n ...userStyle,\n '--charcoal-icon-size': `${actualSize}px`,\n }) as React.CSSProperties,\n [actualSize, userStyle],\n )\n\n return (\n <pixiv-icon\n ref={ref}\n name={name}\n scale={scale}\n unsafe-non-guideline-scale={unsafeNonGuidelineScale}\n fixed-size={fixedSize}\n style={style}\n class={`charcoal-icon ${className || ''}`.trim()}\n {...rest}\n />\n )\n})\n\nexport default Icon\n"],"mappings":";;;;;;;;;AAgCA,MAAM,OAAO,MAAM,WAAiC,SAAS,UAC3D,EACE,MACA,OACA,yBACA,WACA,WACA,OAAO,WACP,GAAG,QAEL,KACA;CACA,MAAM,aAAa,MAAM,qDAGN;EACb;EACA;EACA;EACA;CACF,CAAkC,GACpC;EAAC;EAAM;EAAO;EAAyB;CAAS,CAClD;CAWA,OACE,2CAAC,cAAD;EACO;EACC;EACC;EACP,8BAA4B;EAC5B,cAAY;EACZ,OAhBU,MAAM,eAEf;GACC,GAAG;GACH,wBAAwB,GAAG,WAAU;EACvC,IACF,CAAC,YAAY,SAAS,CAUb;EACP,OAAO,iBAAiB,aAAa,KAAK,KAAK;EAC/C,GAAI;CAAK;AAGf,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Icon/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,oBAAoB,CAAA;AAE3B,OAAO,gCAAgC,CAAA;AAEvC,OAAO,KAAK,EAAc,SAAS,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAA;AAEtE,MAAM,WAAW,QAAQ;IACvB;;;OAGG;IACH,uBAAuB,CAAC,EAAE,MAAM,CAAA;IAChC;;;;;;OAMG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,MAAM,WAAW,SACf,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Icon/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,oBAAoB,CAAA;AAE3B,OAAO,gCAAgC,CAAA;AAEvC,OAAO,KAAK,EAAc,SAAS,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAA;AAEtE,MAAM,WAAW,QAAQ;IACvB;;;OAGG;IACH,uBAAuB,CAAC,EAAE,MAAM,CAAA;IAChC;;;;;;OAMG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,MAAM,WAAW,SACf,SACE,QAAQ,EACR,KAAK,CAAC,eAAe,CACnB,IAAI,CAAC,KAAK,EAAE,OAAO,GAAG,4BAA4B,GAAG,YAAY,GAAG,KAAK,CAAC,CAC3E;CAAG;AAER,QAAA,MAAM,IAAI,6EA6CR,CAAA;eAEa,IAAI"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../src/components/Icon/index.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport '@charcoal-ui/icons'\n// tmp fix for https://github.com/rolldown/tsdown/pull/981\nimport '../../../../icons/css/icon.css'\nimport { calcActualSize } from '@charcoal-ui/icons'\nimport type { IconSizing, PixivIcon, Props } from '@charcoal-ui/icons'\n\nexport interface OwnProps {\n /**\n * @deprecated `fixedSize` を利用してください。\n * `attr()` の数値解釈サポートが限定的なため、リセット CSS だけではレイアウトシフトが防げません。\n */\n unsafeNonGuidelineScale?: number\n /**\n * 固定 px サイズで描画します。ガイドライン外のサイズを利用する場合に推奨される指定方法で、\n * 他のサイズ指定 (`scale` / `unsafeNonGuidelineScale`) よりも常に優先されます。\n *\n * `<Icon>` は同じ値を `--charcoal-icon-size` インライン CSS 変数として自動付与するため、\n * Web Component の hydrate 前後でレイアウトシフトは発生しません。\n */\n fixedSize?: number\n className?: string\n}\n\nexport interface IconProps\n extends\n OwnProps,\n React.PropsWithoutRef<\n Omit<Props, 'class' | 'unsafe-non-guideline-scale' | 'fixed-size' | 'css'>\n > {}\n\nconst Icon = React.forwardRef<PixivIcon, IconProps>(function IconInner(\n {\n name,\n scale,\n unsafeNonGuidelineScale,\n fixedSize,\n className,\n style: userStyle,\n ...rest\n },\n ref,\n) {\n const actualSize = React.useMemo(\n // IconSizing の排他制約は IconProps の型レベルで保証されるため、内部では緩和する\n () =>\n calcActualSize({\n name,\n scale,\n unsafeNonGuidelineScale,\n fixedSize,\n } as { name: string } & IconSizing),\n [name, scale, unsafeNonGuidelineScale, fixedSize],\n )\n\n const style = React.useMemo(\n () =>\n ({\n ...userStyle,\n '--charcoal-icon-size': `${actualSize}px`,\n }) as React.CSSProperties,\n [actualSize, userStyle],\n )\n\n return (\n <pixiv-icon\n ref={ref}\n name={name}\n scale={scale}\n unsafe-non-guideline-scale={unsafeNonGuidelineScale}\n fixed-size={fixedSize}\n style={style}\n class={`charcoal-icon ${className || ''}`.trim()}\n {...rest}\n />\n )\n})\n\nexport default Icon\n"],"mappings":";;;;;;;AAgCA,MAAM,OAAO,QAAM,WAAiC,SAAS,UAC3D,EACE,MACA,OACA,yBACA,WACA,WACA,OAAO,WACP,GAAG,QAEL,KACA;CACA,MAAM,aAAa,QAAM,cAGrB,eAAe;EACb;EACA;EACA;EACA;CACF,CAAkC,GACpC;EAAC;EAAM;EAAO;EAAyB;CAAS,CAClD;CAWA,OACE,oBAAC,cAAD;EACO;EACC;EACC;EACP,8BAA4B;EAC5B,cAAY;EACZ,OAhBU,QAAM,eAEf;GACC,GAAG;GACH,wBAAwB,GAAG,WAAU;EACvC,IACF,CAAC,YAAY,SAAS,CAUb;EACP,OAAO,iBAAiB,aAAa,KAAK,KAAK;EAC/C,GAAI;CAAK;AAGf,CAAC"}
|
|
@@ -10,6 +10,6 @@ export type IconButtonProps<T extends React.ElementType = 'button'> = {
|
|
|
10
10
|
readonly isActive?: boolean;
|
|
11
11
|
component?: T;
|
|
12
12
|
} & Omit<React.ComponentPropsWithRef<T>, 'children' | 'as'>;
|
|
13
|
-
declare const IconButton: <T extends React.ElementType =
|
|
13
|
+
declare const IconButton: <T extends React.ElementType = 'button'>(p: IconButtonProps<T>) => JSX.Element;
|
|
14
14
|
export default IconButton;
|
|
15
15
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/IconButton/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAqC,KAAK,GAAG,EAAE,MAAM,OAAO,CAAA;AAE1E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAEvD,OAAO,aAAa,CAAA;AAEpB,KAAK,OAAO,GAAG,SAAS,GAAG,SAAS,CAAA;AACpC,KAAK,IAAI,GAAG,IAAI,GAAG,GAAG,GAAG,GAAG,CAAA;AAE5B,MAAM,MAAM,eAAe,CAAC,CAAC,SAAS,KAAK,CAAC,WAAW,GAAG,QAAQ,IAAI;IACpE,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAA;IAC1B,QAAQ,CAAC,IAAI,CAAC,EAAE,IAAI,CAAA;IACpB,QAAQ,CAAC,IAAI,EAAE,MAAM,aAAa,CAAA;IAClC,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAC3B,SAAS,CAAC,EAAE,CAAC,CAAA;CACd,GAAG,IAAI,CAAC,KAAK,CAAC,qBAAqB,CAAC,CAAC,CAAC,EAAE,UAAU,GAAG,IAAI,CAAC,CAAA;AAE3D,QAAA,MAAM,UAAU,EA6BX,CAAC,CAAC,SAAS,KAAK,CAAC,WAAW,GAAG,QAAQ,EAC1C,CAAC,EAAE,eAAe,CAAC,CAAC,CAAC,KAClB,GAAG,CAAC,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/IconButton/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAqC,KAAK,GAAG,EAAE,MAAM,OAAO,CAAA;AAE1E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAEvD,OAAO,aAAa,CAAA;AAEpB,KAAK,OAAO,GAAG,SAAS,GAAG,SAAS,CAAA;AACpC,KAAK,IAAI,GAAG,IAAI,GAAG,GAAG,GAAG,GAAG,CAAA;AAE5B,MAAM,MAAM,eAAe,CAAC,CAAC,SAAS,KAAK,CAAC,WAAW,GAAG,QAAQ,IAAI;IACpE,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAA;IAC1B,QAAQ,CAAC,IAAI,CAAC,EAAE,IAAI,CAAA;IACpB,QAAQ,CAAC,IAAI,EAAE,MAAM,aAAa,CAAA;IAClC,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAC3B,SAAS,CAAC,EAAE,CAAC,CAAA;CACd,GAAG,IAAI,CAAC,KAAK,CAAC,qBAAqB,CAAC,CAAC,CAAC,EAAE,UAAU,GAAG,IAAI,CAAC,CAAA;AAE3D,QAAA,MAAM,UAAU,EA6BX,CAAC,CAAC,SAAS,KAAK,CAAC,WAAW,GAAG,QAAQ,EAC1C,CAAC,EAAE,eAAe,CAAC,CAAC,CAAC,KAClB,GAAG,CAAC,OAAO,CAAA;eAED,UAAU"}
|
|
@@ -3,7 +3,7 @@ const require_runtime = require('../../_virtual/_rolldown/runtime.cjs');
|
|
|
3
3
|
const require_useClassNames = require('../../_lib/useClassNames.cjs');
|
|
4
4
|
require('./index.cjs');
|
|
5
5
|
let react = require("react");
|
|
6
|
-
react = require_runtime.__toESM(react);
|
|
6
|
+
react = require_runtime.__toESM(react, 1);
|
|
7
7
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
8
8
|
|
|
9
9
|
//#region src/components/IconButton/index.tsx
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index2.cjs","names":[
|
|
1
|
+
{"version":3,"file":"index2.cjs","names":[],"sources":["../../../src/components/IconButton/index.tsx"],"sourcesContent":["import React, { ForwardedRef, forwardRef, useMemo, type JSX } from 'react'\nimport { useClassNames } from '../../_lib/useClassNames'\nimport type { KnownIconType } from '@charcoal-ui/icons'\n\nimport './index.css'\n\ntype Variant = 'Default' | 'Overlay'\ntype Size = 'XS' | 'S' | 'M'\n\nexport type IconButtonProps<T extends React.ElementType = 'button'> = {\n readonly variant?: Variant\n readonly size?: Size\n readonly icon: keyof KnownIconType\n readonly isActive?: boolean\n component?: T\n} & Omit<React.ComponentPropsWithRef<T>, 'children' | 'as'>\n\nconst IconButton = forwardRef<HTMLButtonElement, IconButtonProps>(\n function IconButtonInner<T extends React.ElementType>(\n {\n variant = 'Default',\n size = 'M',\n icon,\n isActive = false,\n component,\n ...rest\n }: IconButtonProps<T>,\n ref: ForwardedRef<HTMLButtonElement>,\n ) {\n validateIconSize(size, icon)\n const Component = useMemo(() => component ?? 'button', [component])\n const classNames = useClassNames('charcoal-icon-button', rest.className)\n\n return (\n <Component\n {...rest}\n ref={ref}\n className={classNames}\n data-size={size}\n data-active={isActive}\n data-variant={variant}\n >\n <pixiv-icon name={icon} />\n </Component>\n )\n },\n) as <T extends React.ElementType = 'button'>(\n p: IconButtonProps<T>,\n) => JSX.Element\n\nexport default IconButton\n\n/**\n * validates matches of size and icon\n */\nfunction validateIconSize(size: Size, icon: keyof KnownIconType) {\n let requiredIconSize: string\n switch (size) {\n case 'XS':\n requiredIconSize = '16'\n break\n case 'S':\n case 'M':\n requiredIconSize = '24'\n break\n }\n // アイコン名は サイズ/名前\n const result = /^\\d*/u.exec(icon)\n if (result == null) {\n throw new Error('Invalid icon name')\n }\n const [iconSize] = result\n if (iconSize !== requiredIconSize) {\n // eslint-disable-next-line no-console\n console.warn(\n `IconButton with size \"${size}\" expect icon size \"${requiredIconSize}, but got \"${iconSize}\"`,\n )\n }\n}\n"],"mappings":";;;;;;;;;AAiBA,MAAM,mCACJ,SAAS,gBACP,EACE,UAAU,WACV,OAAO,KACP,MACA,WAAW,OACX,WACA,GAAG,QAEL,KACA;CACA,iBAAiB,MAAM,IAAI;CAC3B,MAAM,qCAA0B,aAAa,UAAU,CAAC,SAAS,CAAC;CAClE,MAAM,aAAa,oCAAc,wBAAwB,KAAK,SAAS;CAEvE,OACE,2CAAC,WAAD;EACE,GAAI;EACC;EACL,WAAW;EACX,aAAW;EACX,eAAa;EACb,gBAAc;YAEd,2CAAC,cAAD,EAAY,MAAM,KAAK;CACd;AAEf,CACF;;;;AASA,SAAS,iBAAiB,MAAY,MAA2B;CAC/D,IAAI;CACJ,QAAQ,MAAR;EACE,KAAK;GACH,mBAAmB;GACnB;EACF,KAAK;EACL,KAAK;GACH,mBAAmB;GACnB;CACJ;CAEA,MAAM,SAAS,QAAQ,KAAK,IAAI;CAChC,IAAI,UAAU,MACZ,MAAM,IAAI,MAAM,mBAAmB;CAErC,MAAM,CAAC,YAAY;CACnB,IAAI,aAAa,kBAEf,QAAQ,KACN,yBAAyB,KAAI,sBAAuB,iBAAgB,aAAc,SAAQ,EAC5F;AAEJ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index2.js","names":[
|
|
1
|
+
{"version":3,"file":"index2.js","names":[],"sources":["../../../src/components/IconButton/index.tsx"],"sourcesContent":["import React, { ForwardedRef, forwardRef, useMemo, type JSX } from 'react'\nimport { useClassNames } from '../../_lib/useClassNames'\nimport type { KnownIconType } from '@charcoal-ui/icons'\n\nimport './index.css'\n\ntype Variant = 'Default' | 'Overlay'\ntype Size = 'XS' | 'S' | 'M'\n\nexport type IconButtonProps<T extends React.ElementType = 'button'> = {\n readonly variant?: Variant\n readonly size?: Size\n readonly icon: keyof KnownIconType\n readonly isActive?: boolean\n component?: T\n} & Omit<React.ComponentPropsWithRef<T>, 'children' | 'as'>\n\nconst IconButton = forwardRef<HTMLButtonElement, IconButtonProps>(\n function IconButtonInner<T extends React.ElementType>(\n {\n variant = 'Default',\n size = 'M',\n icon,\n isActive = false,\n component,\n ...rest\n }: IconButtonProps<T>,\n ref: ForwardedRef<HTMLButtonElement>,\n ) {\n validateIconSize(size, icon)\n const Component = useMemo(() => component ?? 'button', [component])\n const classNames = useClassNames('charcoal-icon-button', rest.className)\n\n return (\n <Component\n {...rest}\n ref={ref}\n className={classNames}\n data-size={size}\n data-active={isActive}\n data-variant={variant}\n >\n <pixiv-icon name={icon} />\n </Component>\n )\n },\n) as <T extends React.ElementType = 'button'>(\n p: IconButtonProps<T>,\n) => JSX.Element\n\nexport default IconButton\n\n/**\n * validates matches of size and icon\n */\nfunction validateIconSize(size: Size, icon: keyof KnownIconType) {\n let requiredIconSize: string\n switch (size) {\n case 'XS':\n requiredIconSize = '16'\n break\n case 'S':\n case 'M':\n requiredIconSize = '24'\n break\n }\n // アイコン名は サイズ/名前\n const result = /^\\d*/u.exec(icon)\n if (result == null) {\n throw new Error('Invalid icon name')\n }\n const [iconSize] = result\n if (iconSize !== requiredIconSize) {\n // eslint-disable-next-line no-console\n console.warn(\n `IconButton with size \"${size}\" expect icon size \"${requiredIconSize}, but got \"${iconSize}\"`,\n )\n }\n}\n"],"mappings":";;;;;;;AAiBA,MAAM,aAAa,WACjB,SAAS,gBACP,EACE,UAAU,WACV,OAAO,KACP,MACA,WAAW,OACX,WACA,GAAG,QAEL,KACA;CACA,iBAAiB,MAAM,IAAI;CAC3B,MAAM,YAAY,cAAc,aAAa,UAAU,CAAC,SAAS,CAAC;CAClE,MAAM,aAAa,cAAc,wBAAwB,KAAK,SAAS;CAEvE,OACE,oBAAC,WAAD;EACE,GAAI;EACC;EACL,WAAW;EACX,aAAW;EACX,eAAa;EACb,gBAAc;YAEd,oBAAC,cAAD,EAAY,MAAM,KAAK;CACd;AAEf,CACF;;;;AASA,SAAS,iBAAiB,MAAY,MAA2B;CAC/D,IAAI;CACJ,QAAQ,MAAR;EACE,KAAK;GACH,mBAAmB;GACnB;EACF,KAAK;EACL,KAAK;GACH,mBAAmB;GACnB;CACJ;CAEA,MAAM,SAAS,QAAQ,KAAK,IAAI;CAChC,IAAI,UAAU,MACZ,MAAM,IAAI,MAAM,mBAAmB;CAErC,MAAM,CAAC,YAAY;CACnB,IAAI,aAAa,kBAEf,QAAQ,KACN,yBAAyB,KAAI,sBAAuB,iBAAgB,aAAc,SAAQ,EAC5F;AAEJ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/LoadingSpinner/index.tsx"],"names":[],"mappings":"AAGA,OAAO,aAAa,CAAA;AAEpB,MAAM,MAAM,mBAAmB,GAAG;IAChC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAA;IACzB,QAAQ,CAAC,WAAW,CAAC,EAAE,OAAO,CAAA;IAC9B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAC5B,CAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/LoadingSpinner/index.tsx"],"names":[],"mappings":"AAGA,OAAO,aAAa,CAAA;AAEpB,MAAM,MAAM,mBAAmB,GAAG;IAChC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAA;IACzB,QAAQ,CAAC,WAAW,CAAC,EAAE,OAAO,CAAA;IAC9B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAC5B,CAAA;;;AA+BD,KAAK,KAAK,GAAG;IACX,IAAI,CAAC,EAAE,OAAO,CAAA;CACf,CAAA;AAED,MAAM,WAAW,yBAAyB;IACxC,OAAO,IAAI,IAAI,CAAA;CAChB;AAED,eAAO,MAAM,kBAAkB,6GAyB9B,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index2.cjs","names":[
|
|
1
|
+
{"version":3,"file":"index2.cjs","names":[],"sources":["../../../src/components/LoadingSpinner/index.tsx"],"sourcesContent":["import { forwardRef, useImperativeHandle, useRef, memo } from 'react'\nimport { useClassNames } from '../../_lib/useClassNames'\n\nimport './index.css'\n\nexport type LoadingSpinnerProps = {\n readonly size?: number\n readonly padding?: number\n readonly transparent?: boolean\n readonly className?: string\n}\n\nconst LoadingSpinner = forwardRef<HTMLDivElement, LoadingSpinnerProps>(\n function LoadingSpinnerInner(\n { size = 48, padding = 16, transparent = false, ...props },\n ref,\n ) {\n const classNames = useClassNames(\n 'charcoal-loading-spinner',\n props.className,\n )\n\n return (\n <div\n role=\"progressbar\"\n style={{\n '--charcoal-loading-spinner-size': `${size}px`,\n '--charcoal-loading-spinner-padding': `${padding}px`,\n }}\n data-transparent={transparent}\n className={classNames}\n ref={ref}\n >\n <LoadingSpinnerIcon />\n </div>\n )\n },\n)\n\nexport default memo(LoadingSpinner)\n\ntype Props = {\n once?: boolean\n}\n\nexport interface LoadingSpinnerIconHandler {\n restart(): void\n}\n\nexport const LoadingSpinnerIcon = forwardRef<LoadingSpinnerIconHandler, Props>(\n function LoadingSpinnerIcon({ once = false }, ref) {\n const iconRef = useRef<HTMLDivElement>(null)\n\n useImperativeHandle(ref, () => ({\n restart: () => {\n if (!iconRef.current) {\n return\n }\n iconRef.current.dataset.resetAnimation = 'true'\n // Force reflow hack!\n void iconRef.current.offsetWidth\n delete iconRef.current.dataset.resetAnimation\n },\n }))\n\n return (\n <div\n role=\"presentation\"\n ref={iconRef}\n data-once={once}\n className=\"charcoal-loading-spinner-icon\"\n />\n )\n },\n)\n"],"mappings":";;;;;;;AAYA,MAAM,uCACJ,SAAS,oBACP,EAAE,OAAO,IAAI,UAAU,IAAI,cAAc,OAAO,GAAG,SACnD,KACA;CACA,MAAM,aAAa,oCACjB,4BACA,MAAM,SACR;CAEA,OACE,2CAAC,OAAD;EACE,MAAK;EACL,OAAO;GACL,mCAAmC,GAAG,KAAI;GAC1C,sCAAsC,GAAG,QAAO;EAClD;EACA,oBAAkB;EAClB,WAAW;EACN;YAEL,2CAAC,oBAAD,CAAmB;CAChB;AAET,CACF;AAEA,6CAAoB,cAAc;AAUlC,MAAa,2CACX,SAAS,mBAAmB,EAAE,OAAO,SAAS,KAAK;CACjD,MAAM,4BAAiC,IAAI;CAE3C,+BAAoB,YAAY,EAC9B,eAAe;EACb,IAAI,CAAC,QAAQ,SACX;EAEF,QAAQ,QAAQ,QAAQ,iBAAiB;EAEzC,AAAK,QAAQ,QAAQ;EACrB,OAAO,QAAQ,QAAQ,QAAQ;CACjC,EACF,EAAE;CAEF,OACE,2CAAC,OAAD;EACE,MAAK;EACL,KAAK;EACL,aAAW;EACX,WAAU;CAA+B;AAG/C,CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index2.js","names":[
|
|
1
|
+
{"version":3,"file":"index2.js","names":[],"sources":["../../../src/components/LoadingSpinner/index.tsx"],"sourcesContent":["import { forwardRef, useImperativeHandle, useRef, memo } from 'react'\nimport { useClassNames } from '../../_lib/useClassNames'\n\nimport './index.css'\n\nexport type LoadingSpinnerProps = {\n readonly size?: number\n readonly padding?: number\n readonly transparent?: boolean\n readonly className?: string\n}\n\nconst LoadingSpinner = forwardRef<HTMLDivElement, LoadingSpinnerProps>(\n function LoadingSpinnerInner(\n { size = 48, padding = 16, transparent = false, ...props },\n ref,\n ) {\n const classNames = useClassNames(\n 'charcoal-loading-spinner',\n props.className,\n )\n\n return (\n <div\n role=\"progressbar\"\n style={{\n '--charcoal-loading-spinner-size': `${size}px`,\n '--charcoal-loading-spinner-padding': `${padding}px`,\n }}\n data-transparent={transparent}\n className={classNames}\n ref={ref}\n >\n <LoadingSpinnerIcon />\n </div>\n )\n },\n)\n\nexport default memo(LoadingSpinner)\n\ntype Props = {\n once?: boolean\n}\n\nexport interface LoadingSpinnerIconHandler {\n restart(): void\n}\n\nexport const LoadingSpinnerIcon = forwardRef<LoadingSpinnerIconHandler, Props>(\n function LoadingSpinnerIcon({ once = false }, ref) {\n const iconRef = useRef<HTMLDivElement>(null)\n\n useImperativeHandle(ref, () => ({\n restart: () => {\n if (!iconRef.current) {\n return\n }\n iconRef.current.dataset.resetAnimation = 'true'\n // Force reflow hack!\n void iconRef.current.offsetWidth\n delete iconRef.current.dataset.resetAnimation\n },\n }))\n\n return (\n <div\n role=\"presentation\"\n ref={iconRef}\n data-once={once}\n className=\"charcoal-loading-spinner-icon\"\n />\n )\n },\n)\n"],"mappings":";;;;;;;AAYA,MAAM,iBAAiB,WACrB,SAAS,oBACP,EAAE,OAAO,IAAI,UAAU,IAAI,cAAc,OAAO,GAAG,SACnD,KACA;CACA,MAAM,aAAa,cACjB,4BACA,MAAM,SACR;CAEA,OACE,oBAAC,OAAD;EACE,MAAK;EACL,OAAO;GACL,mCAAmC,GAAG,KAAI;GAC1C,sCAAsC,GAAG,QAAO;EAClD;EACA,oBAAkB;EAClB,WAAW;EACN;YAEL,oBAAC,oBAAD,CAAmB;CAChB;AAET,CACF;AAEA,6BAAe,KAAK,cAAc;AAUlC,MAAa,qBAAqB,WAChC,SAAS,mBAAmB,EAAE,OAAO,SAAS,KAAK;CACjD,MAAM,UAAU,OAAuB,IAAI;CAE3C,oBAAoB,YAAY,EAC9B,eAAe;EACb,IAAI,CAAC,QAAQ,SACX;EAEF,QAAQ,QAAQ,QAAQ,iBAAiB;EAEzC,AAAK,QAAQ,QAAQ;EACrB,OAAO,QAAQ,QAAQ,QAAQ;CACjC,EACF,EAAE;CAEF,OACE,oBAAC,OAAD;EACE,MAAK;EACL,KAAK;EACL,aAAW;EACX,WAAU;CAA+B;AAG/C,CACF"}
|
|
@@ -4,7 +4,7 @@ const require_useClassNames = require('../../../_lib/useClassNames.cjs');
|
|
|
4
4
|
const require_useForwardedRef = require('../../../_lib/useForwardedRef.cjs');
|
|
5
5
|
require('./index.cjs');
|
|
6
6
|
let react = require("react");
|
|
7
|
-
react = require_runtime.__toESM(react);
|
|
7
|
+
react = require_runtime.__toESM(react, 1);
|
|
8
8
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
9
9
|
let react_aria_useDialog = require("react-aria/useDialog");
|
|
10
10
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index2.cjs","names":[
|
|
1
|
+
{"version":3,"file":"index2.cjs","names":[],"sources":["../../../../src/components/Modal/Dialog/index.tsx"],"sourcesContent":["import { forwardRef } from 'react'\nimport * as React from 'react'\nimport { useDialog } from 'react-aria/useDialog'\nimport { useForwardedRef } from '../../../_lib/useForwardedRef'\nimport { Size, BottomSheet } from '..'\n\nimport './index.css'\nimport { useClassNames } from '../../../_lib/useClassNames'\n\nexport const Dialog = forwardRef<\n HTMLDivElement,\n React.ComponentPropsWithoutRef<'div'> & {\n size: Size\n bottomSheet: BottomSheet\n }\n>(function Dialog({ size, bottomSheet, className, ...props }, forwardRef) {\n const ref = useForwardedRef(forwardRef)\n const { dialogProps } = useDialog(\n {\n role: 'dialog',\n },\n ref,\n )\n\n const classNames = useClassNames('charcoal-modal-dialog', className)\n return (\n <div\n className={classNames}\n role={dialogProps.role}\n data-bottom-sheet={bottomSheet}\n tabIndex={dialogProps.tabIndex}\n aria-labelledby={dialogProps['aria-labelledby']}\n onBlur={dialogProps.onBlur}\n data-size={size}\n ref={ref}\n {...props}\n />\n )\n})\n"],"mappings":";;;;;;;;;;;AASA,MAAa,+BAMX,SAAS,OAAO,EAAE,MAAM,aAAa,WAAW,GAAG,SAAS,YAAY;CACxE,MAAM,MAAM,wCAAgB,UAAU;CACtC,MAAM,EAAE,oDACN,EACE,MAAM,SACR,GACA,GACF;CAGA,OACE,2CAAC,OAAD;EACE,WAHe,oCAAc,yBAAyB,SAG3C;EACX,MAAM,YAAY;EAClB,qBAAmB;EACnB,UAAU,YAAY;EACtB,mBAAiB,YAAY;EAC7B,QAAQ,YAAY;EACpB,aAAW;EACN;EACL,GAAI;CAAM;AAGhB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index2.js","names":[
|
|
1
|
+
{"version":3,"file":"index2.js","names":[],"sources":["../../../../src/components/Modal/Dialog/index.tsx"],"sourcesContent":["import { forwardRef } from 'react'\nimport * as React from 'react'\nimport { useDialog } from 'react-aria/useDialog'\nimport { useForwardedRef } from '../../../_lib/useForwardedRef'\nimport { Size, BottomSheet } from '..'\n\nimport './index.css'\nimport { useClassNames } from '../../../_lib/useClassNames'\n\nexport const Dialog = forwardRef<\n HTMLDivElement,\n React.ComponentPropsWithoutRef<'div'> & {\n size: Size\n bottomSheet: BottomSheet\n }\n>(function Dialog({ size, bottomSheet, className, ...props }, forwardRef) {\n const ref = useForwardedRef(forwardRef)\n const { dialogProps } = useDialog(\n {\n role: 'dialog',\n },\n ref,\n )\n\n const classNames = useClassNames('charcoal-modal-dialog', className)\n return (\n <div\n className={classNames}\n role={dialogProps.role}\n data-bottom-sheet={bottomSheet}\n tabIndex={dialogProps.tabIndex}\n aria-labelledby={dialogProps['aria-labelledby']}\n onBlur={dialogProps.onBlur}\n data-size={size}\n ref={ref}\n {...props}\n />\n )\n})\n"],"mappings":";;;;;;;;;AASA,MAAa,SAAS,WAMpB,SAAS,OAAO,EAAE,MAAM,aAAa,WAAW,GAAG,SAAS,YAAY;CACxE,MAAM,MAAM,gBAAgB,UAAU;CACtC,MAAM,EAAE,gBAAgB,UACtB,EACE,MAAM,SACR,GACA,GACF;CAGA,OACE,oBAAC,OAAD;EACE,WAHe,cAAc,yBAAyB,SAG3C;EACX,MAAM,YAAY;EAClB,qBAAmB;EACnB,UAAU,YAAY;EACtB,mBAAiB,YAAY;EAC7B,QAAQ,YAAY;EACpB,aAAW;EACN;EACL,GAAI;CAAM;AAGhB,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
const require_runtime = require('../../_virtual/_rolldown/runtime.cjs');
|
|
3
3
|
let react = require("react");
|
|
4
|
-
react = require_runtime.__toESM(react);
|
|
4
|
+
react = require_runtime.__toESM(react, 1);
|
|
5
5
|
|
|
6
6
|
//#region src/components/Modal/ModalBackgroundContext.tsx
|
|
7
7
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModalBackgroundContext.cjs","names":[
|
|
1
|
+
{"version":3,"file":"ModalBackgroundContext.cjs","names":[],"sources":["../../../src/components/Modal/ModalBackgroundContext.tsx"],"sourcesContent":["import * as React from 'react'\n\n/**\n * ModalBackgroundのElementが入ったコンテキスト\n */\nexport const ModalBackgroundContext = React.createContext<HTMLElement | null>(\n null,\n)\n"],"mappings":";;;;;;;;;AAKA,MAAa,yBAAyB,MAAM,cAC1C,IACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModalBackgroundContext.js","names":[
|
|
1
|
+
{"version":3,"file":"ModalBackgroundContext.js","names":[],"sources":["../../../src/components/Modal/ModalBackgroundContext.tsx"],"sourcesContent":["import * as React from 'react'\n\n/**\n * ModalBackgroundのElementが入ったコンテキスト\n */\nexport const ModalBackgroundContext = React.createContext<HTMLElement | null>(\n null,\n)\n"],"mappings":";;;;;;;AAKA,MAAa,yBAAyB,QAAM,cAC1C,IACF"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import './ModalPlumbing.css';
|
|
2
2
|
export declare function ModalHeader(): import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export declare const ModalAlign: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
4
|
-
ref?: ((instance: HTMLDivElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) |
|
|
4
|
+
ref?: import("react").RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | null | undefined;
|
|
5
5
|
}, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
6
6
|
export declare const ModalBody: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
7
|
-
ref?: ((instance: HTMLDivElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) |
|
|
7
|
+
ref?: import("react").RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | null | undefined;
|
|
8
8
|
}, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
9
9
|
export declare const ModalButtons: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
10
|
-
ref?: ((instance: HTMLDivElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) |
|
|
10
|
+
ref?: import("react").RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | null | undefined;
|
|
11
11
|
}, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
12
12
|
//# sourceMappingURL=ModalPlumbing.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModalPlumbing2.cjs","names":[
|
|
1
|
+
{"version":3,"file":"ModalPlumbing2.cjs","names":[],"sources":["../../../src/components/Modal/ModalPlumbing.tsx"],"sourcesContent":["import { ModalContext } from '.'\nimport { useContext } from 'react'\n\nimport './ModalPlumbing.css'\nimport { createDivComponent } from '../../_lib/createDivComponent'\n\nexport function ModalHeader() {\n const modalCtx = useContext(ModalContext)\n return (\n <div\n className=\"charcoal-modal-header-root\"\n data-bottom-sheet={modalCtx.bottomSheet}\n >\n <div className=\"charcoal-modal-header-title\">{modalCtx.title}</div>\n </div>\n )\n}\n\nexport const ModalAlign = createDivComponent('charcoal-modal-align')\n\nexport const ModalBody = createDivComponent('charcoal-modal-body')\n\nexport const ModalButtons = createDivComponent('charcoal-modal-buttons')\n"],"mappings":";;;;;;;;AAMA,SAAgB,cAAc;CAC5B,MAAM,iCAAsB,0BAAY;CACxC,OACE,2CAAC,OAAD;EACE,WAAU;EACV,qBAAmB,SAAS;YAE5B,2CAAC,OAAD;GAAK,WAAU;aAA+B,SAAS;EAAW;CAC/D;AAET;AAEA,MAAa,aAAa,8CAAmB,sBAAsB;AAEnE,MAAa,YAAY,8CAAmB,qBAAqB;AAEjE,MAAa,eAAe,8CAAmB,wBAAwB"}
|