{"version":3,"file":"index.cjs","names":["SSRProvider","OriginSSRProvider","version","Fragment","isReactVersionOver","minVersion","reactMajorVersion","parseInt","split","Number","isFinite","React","OverlayProvider","SSRProvider","CharcoalProviderProps","children","ReactNode","CharcoalProvider","useEffect","useMemo","useState","LOCAL_STORAGE_KEY","DEFAULT_ROOT_ATTRIBUTE","keyStringRegExp","RegExp","assertKeyString","key","test","Error","themeSetter","attr","theme","undefined","document","documentElement","dataset","themeSelector","T","S","const","prefersColorScheme","useThemeSetter","setter","system","useTheme","getThemeSync","localStorage","getItem","localStorageKey","isDark","useMedia","media","local","setTheme","ready","useLocalStorage","defaultValue","setReady","state","setState","defaultValueMemo","fetch","window","addEventListener","handleStorage","removeEventListener","e","StorageEvent","storageArea","raw","deserialize","set","value","removeItem","serialize","setItem","event","bubbles","cancelable","url","location","href","dispatchEvent","JSON","parse","stringify","query","match","matcher","matchMedia","onChange","matches","assertKeyString","DEFAULT_ROOT_ATTRIBUTE","LOCAL_STORAGE_KEY","Props","localStorageKey","rootAttribute","makeSetThemeScriptCode","defaultProps","Partial","SetThemeScript","src","__html","useMemo","useClassNames","classNames","filter","v","join","React","ForwardedRef","ReactNode","forwardRef","useMemo","JSX","useClassNames","Variant","Size","ButtonProps","ElementType","children","variant","size","fullWidth","isActive","component","T","Omit","ComponentPropsWithRef","Button","className","props","ref","HTMLButtonElement","Component","classNames","p","Element","React","useMemo","forwardRef","ReactNode","JSX","useClassNames","ClickableProps","ElementType","children","component","T","Omit","ComponentPropsWithRef","Clickable","props","ref","ForwardedRef","HTMLButtonElement","className","Component","p","Element","ClickableElement","HTMLAnchorElement","React","ForwardedRef","forwardRef","useMemo","JSX","useClassNames","KnownIconType","Variant","Size","IconButtonProps","ElementType","variant","size","icon","isActive","component","T","Omit","ComponentPropsWithRef","IconButton","HTMLButtonElement","IconButtonInner","rest","ref","validateIconSize","Component","classNames","className","p","Element","requiredIconSize","result","exec","Error","iconSize","console","warn","React","RadioGroupContext","name","selected","disabled","readonly","invalid","onChange","next","createContext","undefined","Error","forwardRef","memo","useCallback","useClassNames","CharcoalRadioInputProps","invalid","onChange","value","InputProps","React","HTMLProps","HTMLInputElement","RadioInputProps","Omit","RadioInput","className","props","ref","handleChange","e","ChangeEvent","el","currentTarget","classNames","memo","forwardRef","useContext","React","warning","useClassNames","RadioGroupContext","RadioInput","RadioProps","PropsWithChildren","value","disabled","className","Radio","HTMLInputElement","RadioInner","children","props","ref","name","selected","isParentDisabled","readonly","invalid","onChange","classNames","undefined","isSelected","isDisabled","isReadonly","forwardRef","useCallback","useMemo","JSX","React","useClassNames","RadioGroupContext","RadioGroupProps","PropsWithChildren","className","value","Value","label","name","onChange","next","disabled","readonly","invalid","ref","Ref","HTMLDivElement","ComponentProps","RadioGroup","RadioGroupInner","children","ariaOrientation","props","classNames","handleChange","contextValue","selected","Element","createContext","MultiSelectGroupContext","name","selected","disabled","readonly","invalid","onChange","value","undefined","Error","React","PixivIcon","Props","OwnProps","unsafeNonGuidelineScale","className","IconProps","PropsWithoutRef","Omit","Icon","forwardRef","IconInner","name","scale","rest","ref","ChangeEvent","useCallback","useContext","forwardRef","memo","React","warning","MultiSelectGroupContext","Icon","useClassNames","MultiSelectProps","PropsWithChildren","value","disabled","variant","className","onChange","payload","selected","MultiSelect","HTMLInputElement","MultiSelectInner","children","ref","name","parentDisabled","readonly","invalid","parentOnChange","undefined","isSelected","includes","isDisabled","handleChange","event","currentTarget","checked","classNames","Boolean","MultiSelectGroupProps","style","CSSProperties","label","MultiSelectGroup","index","indexOf","slice","Array","from","Set","forwardRef","useCallback","useClassNames","CharcoalSwitchProps","onChange","checked","InputProps","React","HTMLProps","HTMLInputElement","SwitchInputProps","Omit","SwitchInput","className","props","ref","handleChange","e","ChangeEvent","el","currentTarget","classNames","React","useClassNames","SwitchWithLabel","memo","children","className","disabled","id","input","ReactNode","classNames","memo","forwardRef","useId","SwitchInput","SwitchInputProps","SwitchWithLabel","SwitchProps","Switch","HTMLInputElement","children","onChange","disabled","className","id","props","ref","htmlId","noChildren","undefined","input","React","useClassNames","FieldLabelProps","LabelHTMLAttributes","HTMLLabelElement","className","label","subLabel","ReactNode","required","requiredText","FieldLabel","forwardRef","style","labelProps","ref","classNames","unreachable","value","Error","arguments","length","JSON","stringify","mergeRefs","refs","React","Ref","T","RefCallback","ref","MutableRefObject","current","countCodePointsInString","string","Array","from","useEffect","React","useFocusWithClick","containerRef","RefObject","HTMLDivElement","inputRef","HTMLInputElement","HTMLTextAreaElement","el","current","handleDown","e","MouseEvent","target","focus","addEventListener","removeEventListener","forwardRef","useClassNames","createDivComponent","mainClassName","HTMLDivElement","React","ComponentPropsWithRef","DivComponent","className","props","ref","classNames","createDivComponent","AssistiveText","useVisuallyHidden","ReactNode","useCallback","useEffect","useRef","useState","React","FieldLabel","countCodePointsInString","useFocusWithClick","mergeRefs","useId","AssistiveText","useClassNames","TextFieldProps","prefix","suffix","value","onChange","showCount","showLabel","assistiveText","invalid","label","requiredText","disabled","subLabel","rdfaPrefix","getCount","Omit","ComponentPropsWithoutRef","TextField","forwardRef","HTMLInputElement","SingleLineTextFieldInner","className","maxLength","required","type","props","inputRef","visuallyHiddenProps","count","setCount","handleChange","e","ChangeEvent","target","undefined","containerRef","inputId","id","describedbyId","labelledbyId","showAssistiveText","length","classNames","useVisuallyHidden","forwardRef","useCallback","useEffect","useRef","useState","FieldLabel","countCodePointsInString","mergeRefs","useFocusWithClick","useId","AssistiveText","useClassNames","TextAreaProps","value","onChange","showCount","showLabel","assistiveText","invalid","label","requiredText","disabled","subLabel","React","ReactNode","autoHeight","getCount","Omit","ComponentPropsWithoutRef","TextArea","HTMLTextAreaElement","TextAreaInner","className","required","maxLength","rows","initialRows","props","visuallyHiddenProps","textareaRef","count","setCount","setRows","syncHeight","textarea","match","length","nonControlled","undefined","handleChange","e","ChangeEvent","target","current","containerRef","textAreaId","id","describedbyId","labelledbyId","classNames","showAssistiveText","React","useForwardedRef","ref","ForwardedRef","T","innerRef","useRef","useEffect","current","forwardRef","React","useDialog","useForwardedRef","Size","BottomSheet","useClassNames","Dialog","HTMLDivElement","ComponentPropsWithoutRef","size","bottomSheet","className","props","ref","dialogProps","role","classNames","tabIndex","onBlur","React","ModalBackgroundContext","createContext","HTMLElement","useEffect","usePreventScroll","element","HTMLElement","isOpen","useClip","defaultPaddingRight","style","paddingRight","defaultOverflow","overflow","window","innerWidth","clientWidth","React","AriaModalOverlayProps","ModalOverlayAria","ariaHideOutside","useOverlay","useOverlayFocusContain","usePreventScroll","CharcoalModalOverlayProps","overflowClip","useCharcoalModalOverlay","props","state","isOpen","onClose","ref","RefObject","HTMLElement","overlayProps","underlayProps","shouldCloseOnInteractOutside","document","body","useEffect","current","modalProps","isWindowDefined","window","useWindowWidth","width","setWidth","useState","innerWidth","handleResize","addEventListener","removeEventListener","useContext","forwardRef","memo","React","Overlay","AriaDialogProps","animated","useTransition","easings","Button","ButtonProps","IconButton","IconButtonProps","useObjectRef","Dialog","ModalBackgroundContext","CharcoalModalOverlayProps","useCharcoalModalOverlay","useWindowWidth","BottomSheet","Size","ModalProps","children","ReactNode","zIndex","title","size","bottomSheet","isOpen","onClose","className","closeButtonAriaLabel","portalContainer","HTMLElement","DEFAULT_Z_INDEX","Modal","HTMLDivElement","ModalInner","props","external","isDismissable","ref","modalProps","underlayProps","isKeyboardDismissDisabled","undefined","isMobile","Infinity","transitionEnabled","showDismiss","transition","from","transform","backgroundColor","overflow","enter","update","leave","config","duration","easing","easeOutQuart","bgRef","useRef","handleClick","useCallback","e","MouseEvent","currentTarget","target","item","current","titleProps","close","AnimatedDialog","ModalContext","createContext","HTMLAttributes","ModalCloseButton","Omit","ModalDismissButton","ModalContext","useContext","createDivComponent","ModalHeader","modalCtx","bottomSheet","title","ModalAlign","ModalBody","ModalButtons","forwardRef","useImperativeHandle","useRef","memo","useClassNames","LoadingSpinnerProps","size","padding","transparent","className","LoadingSpinner","HTMLDivElement","LoadingSpinnerInner","props","ref","classNames","Props","once","LoadingSpinnerIconHandler","restart","LoadingSpinnerIcon","iconRef","current","dataset","resetAnimation","offsetWidth","RefObject","useContext","useRef","ReactNode","DismissButton","Overlay","usePopover","ModalBackgroundContext","usePreventScroll","PopoverProps","isOpen","onClose","children","triggerRef","Element","popoverRef","HTMLDivElement","inertWorkaround","_empty","Popover","props","defaultPopoverRef","finalPopoverRef","undefined","popoverProps","underlayProps","containerPadding","close","open","setOpen","toggle","modalBackground","document","body","onClick","position","zIndex","style","inset","Key","useEffect","useRef","Popover","PopoverProps","DropdownPopoverProps","value","DropdownPopover","children","props","ref","HTMLDivElement","isOpen","current","triggerRef","style","width","clientWidth","undefined","windowScrollY","window","scrollY","windowScrollX","scrollX","selectedElement","document","querySelector","toString","HTMLElement","focus","scrollTo","el","onClose","inertWorkaround","ReactNode","React","findPreviewRecursive","children","value","childArray","Children","toArray","i","length","child","isValidElement","props","childValue","undefined","RefObject","createContext","DropdownMenuItemProps","MenuListContextType","root","HTMLUListElement","value","propsArray","setValue","v","MenuListContext","undefined","_v","React","MenuItem","MenuListChildren","MenuItemGroup","DropdownMenuItemProps","getValuesRecursive","children","childArray","Children","toArray","propsArray","i","length","child","isValidElement","props","value","disabled","ReactElement","push","useMemo","useRef","MenuListContext","getValuesRecursive","MenuItem","Divider","MenuItemGroup","MenuListChild","React","ReactElement","MenuListChildren","MenuListProps","children","value","onChange","v","MenuList","props","root","propsArray","setValue","React","ReactNode","useState","useRef","useMemo","useCallback","Icon","FieldLabel","DropdownPopover","findPreviewRecursive","MenuList","MenuListChildren","getValuesRecursive","useVisuallyHidden","AssistiveText","useClassNames","useId","PopoverProps","DropdownSelectorProps","label","value","disabled","placeholder","showLabel","invalid","assistiveText","required","requiredText","subLabel","name","children","onChange","className","selectRef","Ref","HTMLSelectElement","Pick","DropdownSelector","props","triggerRef","HTMLButtonElement","isOpen","setIsOpen","preview","isPlaceholder","undefined","propsArray","hasMatchedValue","some","itemProps","visuallyHiddenProps","handleChange","e","ChangeEvent","target","labelId","describedbyId","classNames","map","inertWorkaround","v","ForwardedRef","forwardRef","ReactNode","useMemo","JSX","useClassNames","CustomJSXElement","IntrinsicElements","React","JSXElementConstructor","ListItemProps","ElementType","children","as","T","Omit","ComponentPropsWithRef","ListItem","className","props","ref","HTMLLIElement","Component","classNames","p","Element","handleFocusByKeyBoard","element","Element","parent","HTMLElement","isScrollable","scrollHeight","clientHeight","rect","getBoundingClientRect","parentRect","bottom","scrollTo","top","scrollTop","scrollIfNeeded","elementRect","isVisible","window","innerHeight","document","documentElement","scrollIntoView","block","useCallback","useContext","handleFocusByKeyBoard","MenuListContext","useMenuItemHandleKeyDown","value","e","React","KeyboardEvent","HTMLElement","setValue","root","propsArray","setContextValue","undefined","handleKeyDown","key","isForward","preventDefault","values","map","props","filter","v","index","indexOf","n","length","focusValue","next","current","querySelector","ariaDisabled","focus","preventScroll","parentElement","ForwardedRef","forwardRef","ListItem","ListItemProps","useMenuItemHandleKeyDown","MenuItemProps","React","ElementType","value","disabled","T","MenuItem","className","_","props","ref","HTMLLIElement","handleKeyDown","setContextValue","undefined","children","MenuItem","MenuItemProps","MenuListContext","ReactNode","useContext","Icon","DropdownMenuItemProps","Omit","secondary","contentFullWidth","DropdownMenuItem","props","value","ctxValue","isSelected","children","rest","fullWidthClassName","MenuItem","Divider","MenuItemGroupChild","React","ReactElement","MenuItemGroupProps","text","children","MenuItemGroup","props","createContext","useContext","React","RadioGroupState","RadioContext","RadioProviderProps","PropsWithChildren","value","RadioProvider","FC","children","useRadioContext","state","Error","ReactNode","forwardRef","memo","useMemo","useRef","React","useRadioGroupState","AriaRadioGroupProps","AriaRadioProps","useRadio","useRadioGroup","RadioProvider","useRadioContext","useClassNames","SegmentedControlItem","label","value","disabled","SegmentedControlProps","id","name","readonly","required","className","uniformSegmentWidth","fullWidth","defaultValue","data","onChange","SegmentedControl","HTMLDivElement","SegmentedControlInner","props","ref","ariaRadioGroupProps","isDisabled","isReadOnly","isRequired","state","radioGroupProps","segmentedControlItems","map","d","item","RadioProps","children","Segmented","HTMLInputElement","ariaRadioProps","inputProps","isSelected","forwardRef","memo","useCallback","useClassNames","CharcoalCheckboxInputProps","invalid","onChange","checked","rounded","InputProps","React","HTMLProps","HTMLInputElement","CheckboxInputProps","Omit","CheckboxInput","className","props","ref","handleChange","e","ChangeEvent","el","currentTarget","classNames","React","useClassNames","CheckboxWithLabel","memo","className","children","input","id","disabled","ReactNode","classNames","forwardRef","memo","useId","CheckboxInput","CheckboxInputProps","CheckboxWithLabel","CheckboxProps","Checkbox","HTMLInputElement","disabled","className","id","children","props","ref","htmlId","noChildren","undefined","input","React","forwardRef","memo","useMemo","ForwardedRef","JSX","useObjectRef","Icon","useClassNames","SizeMap","S","M","TagItemProps","ElementType","label","translatedLabel","bgColor","bgImage","status","size","component","T","Omit","ComponentPropsWithRef","TagItem","HTMLButtonElement","TagItemInner","props","_ref","ref","hasTranslatedLabel","undefined","length","className","bgVariant","bg","Component","p","Element","ReactNode","Icon","useClassNames","HintTextContext","HintTextProps","children","context","className","HintText","classNames","Children","isValidElement","ReactElement","ReactNode","getFinalTitle","showTooltip","title","children","undefined","resolvedTitle","onlyText","hasChildren","element","Boolean","props","childToString","child","JSON","stringify","toString","Array","isArray","toArray","reduce","text","newText","concat","getFinalTitle","useClassNames","CSSProperties","TextEllipsisProps","lineHeight","lineLimit","hyphens","showTooltip","useNowrap","React","ComponentPropsWithoutRef","TextEllipsis","t0","$","_c","children","props","t1","t2","t3","t4","title","undefined","t5","finalTitle","classNames","className","hasLineHeight","t6","t7","t8","style","t9","t10","useDebugValue","warning","PageRangeDisplayed","usePaginationWindow","page","pageCount","t0","$","_c","pageRangeDisplayed","undefined","process","env","NODE_ENV","visibleLastPage","Math","min","max","floor","t1","t2","Array","from","length","_temp","start","t3","__0","i_0","i","const","window","_","createContext","useContext","Size","PageRangeDisplayed","LinkComponentProps","href","className","children","React","ReactNode","PaginationContextValue","ElementType","page","pageCount","size","isLinkMode","makeUrl","LinkComponent","T","makeClickHandler","value","linkProps","Omit","ComponentPropsWithoutRef","PaginationContext","usePaginationContext","context","Error","usePaginationWindow","useClassNames","IconButton","IconButtonProps","PaginationContext","usePaginationContext","LinkComponentProps","PaginationContextValue","PageRangeDisplayed","Size","NavButtonProps","direction","ariaLabel","NavButton","t0","$","_c","page","pageCount","size","isLinkMode","makeUrl","LinkComponent","makeClickHandler","linkProps","isPrev","targetPage","Math","max","min","disabled","navButtonClassName","className","t1","t2","component","href","onClick","t3","PageItem","value","pageItemClassName","PaginationCommonProps","pageRangeDisplayed","ariaLabelPrev","ariaLabelNext","NavProps","Omit","React","ComponentPropsWithoutRef","PaginationProps","ElementType","onChange","newPage","T","Pagination","navProps","t4","undefined","window","t5","classNames","t6","contextValue","t7","t8","t9","map","_temp","t10","t11","t12","p"],"sources":["../src/core/SSRProvider.tsx","../src/core/CharcoalProvider.tsx","../src/core/themeHelper.ts","../src/core/SetThemeScript.tsx","../src/_lib/useClassNames.ts","../src/components/Button/index.tsx","../src/components/Clickable/index.tsx","../src/components/IconButton/index.tsx","../src/components/Radio/RadioGroupContext.ts","../src/components/Radio/RadioInput/index.tsx","../src/components/Radio/index.tsx","../src/components/Radio/RadioGroup/index.tsx","../src/components/MultiSelect/context.ts","../src/components/Icon/index.tsx","../src/components/MultiSelect/index.tsx","../src/components/Switch/SwitchInput/index.tsx","../src/components/Switch/SwitchWithLabel.tsx","../src/components/Switch/index.tsx","../src/components/FieldLabel/index.tsx","../src/_lib/index.ts","../src/components/TextField/useFocusWithClick.tsx","../src/_lib/createDivComponent.tsx","../src/components/TextField/AssistiveText/index.tsx","../src/components/TextField/index.tsx","../src/components/TextArea/index.tsx","../src/_lib/useForwardedRef.tsx","../src/components/Modal/Dialog/index.tsx","../src/components/Modal/ModalBackgroundContext.tsx","../src/components/DropdownSelector/Popover/usePreventScroll.tsx","../src/components/Modal/useCustomModalOverlay.tsx","../src/components/Modal/index.tsx","../src/components/Modal/ModalPlumbing.tsx","../src/components/LoadingSpinner/index.tsx","../src/components/DropdownSelector/Popover/index.tsx","../src/components/DropdownSelector/DropdownPopover.tsx","../src/components/DropdownSelector/utils/findPreviewRecursive.tsx","../src/components/DropdownSelector/MenuList/MenuListContext.ts","../src/components/DropdownSelector/MenuList/internals/getValuesRecursive.tsx","../src/components/DropdownSelector/MenuList/index.tsx","../src/components/DropdownSelector/index.tsx","../src/components/DropdownSelector/ListItem/index.tsx","../src/components/DropdownSelector/MenuItem/internals/handleFocusByKeyBoard.tsx","../src/components/DropdownSelector/MenuItem/internals/useMenuItemHandleKeyDown.tsx","../src/components/DropdownSelector/MenuItem/index.tsx","../src/components/DropdownSelector/DropdownMenuItem/index.tsx","../src/components/DropdownSelector/MenuItemGroup/index.tsx","../src/components/SegmentedControl/RadioGroupContext.tsx","../src/components/SegmentedControl/index.tsx","../src/components/Checkbox/CheckboxInput/index.tsx","../src/components/Checkbox/CheckboxWithLabel.tsx","../src/components/Checkbox/index.tsx","../src/components/TagItem/index.tsx","../src/components/HintText/index.tsx","../src/components/TextEllipsis/helper.ts","../src/components/TextEllipsis/index.tsx","../src/components/Pagination/helper.ts","../src/components/Pagination/PaginationContext.ts","../src/components/Pagination/index.tsx"],"sourcesContent":["import { SSRProvider as OriginSSRProvider } from '@react-aria/ssr'\nimport { version, Fragment } from 'react'\n\nexport function isReactVersionOver(minVersion: number): boolean {\n  // version history on the react side: https://github.com/facebook/react/commits/main/packages/shared/ReactVersion.js\n  const reactMajorVersion = parseInt(version.split('.')[0], 10)\n  return Number.isFinite(reactMajorVersion)\n    ? reactMajorVersion >= minVersion\n    : false\n}\n\nexport const SSRProvider = isReactVersionOver(18) ? Fragment : OriginSSRProvider\n","import * as React from 'react'\nimport { OverlayProvider } from './OverlayProvider'\nimport { SSRProvider } from './SSRProvider'\n\nexport type CharcoalProviderProps = {\n  children: React.ReactNode\n}\n\nexport function CharcoalProvider({ children }: CharcoalProviderProps) {\n  return (\n    <SSRProvider>\n      <OverlayProvider>{children}</OverlayProvider>\n    </SSRProvider>\n  )\n}\n","import { useEffect, useMemo, useState } from 'react'\n\nexport const LOCAL_STORAGE_KEY = 'charcoal-theme'\nexport const DEFAULT_ROOT_ATTRIBUTE = 'theme'\n\nconst keyStringRegExp = new RegExp(/^(\\w|-)+$/)\n\n/**\n * 文字列が英数字_-のみで構成されているか検証する。不正な文字列ならエラーを投げる\n * @param key 検証するキー\n */\nexport function assertKeyString(key: string) {\n  if (!keyStringRegExp.test(key)) {\n    throw new Error(`Unexpected key :${key}, expect: /^(\\\\w|-)+$/`)\n  }\n}\n\n/**\n * `<html data-theme=\"dark\">` のような設定を行うデフォルトのセッター\n */\nexport const themeSetter =\n  (attr: string = DEFAULT_ROOT_ATTRIBUTE) =>\n  (theme: string | undefined) => {\n    assertKeyString(attr)\n    if (theme !== undefined) {\n      document.documentElement.dataset[attr] = theme\n    } else {\n      delete document.documentElement.dataset[attr]\n    }\n  }\n\n/**\n * `<html data-theme=\"dark\">` にマッチするセレクタを生成する\n */\nexport function themeSelector<\n  T extends string,\n  S extends string = typeof DEFAULT_ROOT_ATTRIBUTE,\n>(theme: T, attr?: S) {\n  return `:root[data-${attr ?? DEFAULT_ROOT_ATTRIBUTE}='${theme}']` as const\n}\n\n/**\n * prefers-color-scheme を利用する media クエリを生成する\n */\nexport function prefersColorScheme<T extends 'light' | 'dark'>(theme: T) {\n  return `@media (prefers-color-scheme: ${theme})` as const\n}\n\n/**\n * LocalStorageからテーマの情報を取得して、変化時にテーマをセットするhooks\n */\nexport function useThemeSetter({\n  key = LOCAL_STORAGE_KEY,\n  setter = themeSetter(),\n}: { key?: string; setter?: (theme: string | undefined) => void } = {}) {\n  const [theme, , system] = useTheme(key)\n\n  useEffect(() => {\n    if (theme === undefined) {\n      return\n    }\n    // prefers-color-scheme から値を取っている場合にはcssのみで処理したいのでアンセットする\n    setter(system ? undefined : theme)\n  }, [setter, system, theme])\n}\n\n/**\n * 同期的にLocalStorageからテーマを取得するヘルパ\n */\nexport function getThemeSync(key: string = LOCAL_STORAGE_KEY) {\n  const theme = localStorage.getItem(key)\n  return theme\n}\n\n/**\n * LocalStorage, prefers-color-scheme からテーマの情報を取得して、現在のテーマを返すhooks\n *\n * `dark` `light` という名前だけは特別扱いされていて、prefers-color-schemeにマッチした場合に返ります\n */\nexport const useTheme = (localStorageKey: string = LOCAL_STORAGE_KEY) => {\n  assertKeyString(localStorageKey)\n  const isDark = useMedia('(prefers-color-scheme: dark)')\n  const media = isDark !== undefined ? (isDark ? 'dark' : 'light') : undefined\n  const [local, setTheme, ready] =\n    useLocalStorage<typeof media>(localStorageKey)\n  const theme = !ready || media === undefined ? undefined : (local ?? media)\n  const system = local === undefined\n  return [theme, setTheme, system] as const\n}\n\nexport function useLocalStorage<T>(key: string, defaultValue?: () => T) {\n  const [ready, setReady] = useState(false)\n  const [state, setState] = useState<T>()\n  const defaultValueMemo = useMemo(() => defaultValue?.(), [defaultValue])\n\n  useEffect(() => {\n    fetch()\n    window.addEventListener('storage', handleStorage)\n    return () => {\n      window.removeEventListener('storage', handleStorage)\n    }\n  })\n\n  const handleStorage = (e: StorageEvent) => {\n    if (e.storageArea !== localStorage) {\n      return\n    }\n    if (e.key !== key) {\n      return\n    }\n    fetch()\n  }\n\n  const fetch = () => {\n    const raw = localStorage.getItem(key)\n    setState((raw !== null ? deserialize(raw) : null) ?? defaultValueMemo)\n    setReady(true)\n  }\n\n  const set = (value: T | undefined) => {\n    if (value === undefined) {\n      // undefinedがセットされる場合にはkeyごと削除\n      localStorage.removeItem(key)\n    } else {\n      const raw = serialize(value)\n      localStorage.setItem(key, raw)\n    }\n\n    // 同一ウィンドウではstorageイベントが発火しないので、手動で発火させる\n    const event = new StorageEvent('storage', {\n      bubbles: true,\n      cancelable: false,\n      key,\n      url: location.href,\n      storageArea: localStorage,\n    })\n    dispatchEvent(event)\n  }\n\n  return [state ?? defaultValueMemo, set, ready] as const\n}\n\nfunction deserialize<T>(raw: string): T {\n  try {\n    return JSON.parse(raw) as T\n  } catch {\n    // syntax error はすべて文字列として扱う\n    return raw as unknown as T\n  }\n}\n\nfunction serialize(value: unknown): string {\n  if (typeof value === 'string') {\n    return value\n  } else {\n    return JSON.stringify(value)\n  }\n}\n\nexport function useMedia(query: string) {\n  const [match, setState] = useState<boolean>()\n\n  useEffect(() => {\n    const matcher = window.matchMedia(query)\n\n    const onChange = () => {\n      setState(matcher.matches)\n    }\n\n    matcher.addEventListener('change', onChange)\n\n    setState(matcher.matches)\n\n    return () => {\n      matcher.removeEventListener('change', onChange)\n    }\n  }, [query])\n\n  return match\n}\n","import {\n  assertKeyString,\n  DEFAULT_ROOT_ATTRIBUTE,\n  LOCAL_STORAGE_KEY,\n} from './themeHelper'\n\ninterface Props {\n  localStorageKey: string\n  rootAttribute: string\n}\n\n/**\n * 同期的にテーマをローカルストレージから取得してhtmlの属性に設定するコードを取得する\n * @param props localStorageのキー、htmlのdataになる属性のキーを含むオブジェクト\n * @returns ソースコードの文字列\n */\nexport function makeSetThemeScriptCode({\n  localStorageKey = defaultProps.localStorageKey,\n  rootAttribute = defaultProps.rootAttribute,\n}: Partial<Props> = defaultProps) {\n  assertKeyString(localStorageKey)\n  assertKeyString(rootAttribute)\n  return `'use strict';\n(function () {\n    var localStorageKey = '${localStorageKey}'\n    var rootAttribute = '${rootAttribute}'\n    var currentTheme = localStorage.getItem(localStorageKey);\n    if (currentTheme) {\n        document.documentElement.dataset[rootAttribute] = currentTheme;\n    }\n})();\n`\n}\n\n/**\n * 同期的にテーマをローカルストレージから取得してhtmlの属性に設定するスクリプトタグ\n * @param props localStorageのキー、htmlのdataになる属性のキーを含むオブジェクト\n * @returns\n */\nexport function SetThemeScript({\n  localStorageKey = defaultProps.localStorageKey,\n  rootAttribute = defaultProps.rootAttribute,\n}: Props) {\n  const src = makeSetThemeScriptCode({ localStorageKey, rootAttribute })\n  return (\n    <script\n      dangerouslySetInnerHTML={{\n        __html: src,\n      }}\n    />\n  )\n}\n\nconst defaultProps: Props = {\n  localStorageKey: LOCAL_STORAGE_KEY,\n  rootAttribute: DEFAULT_ROOT_ATTRIBUTE,\n}\n","import { useMemo } from 'react'\n\n/**\n * Join some class names if propsClassName is defined.\n */\nexport function useClassNames(...classNames: (string | undefined)[]) {\n  return useMemo(() => classNames.filter((v) => v).join(' '), [classNames])\n}\n","import './index.css'\n\nimport React, {\n  ForwardedRef,\n  ReactNode,\n  forwardRef,\n  useMemo,\n  type JSX,\n} from 'react'\n\nimport { useClassNames } from '../../_lib/useClassNames'\n\ntype Variant = 'Primary' | 'Default' | 'Overlay' | 'Danger' | 'Navigation'\n\ntype Size = 'S' | 'M'\n\nexport type ButtonProps<T extends React.ElementType = 'button'> = {\n  children?: ReactNode\n  variant?: Variant\n  size?: Size\n  fullWidth?: boolean\n  isActive?: boolean\n  /**\n   * The component used for root element.\n   * @type T extends React.ElementType = 'button'\n   */\n  component?: T\n} & Omit<React.ComponentPropsWithRef<T>, 'children'>\n\nconst Button = forwardRef(function Button<T extends React.ElementType>(\n  {\n    variant,\n    fullWidth,\n    size,\n    className,\n    component,\n    isActive,\n    ...props\n  }: ButtonProps<T>,\n  ref: ForwardedRef<HTMLButtonElement>,\n) {\n  const Component = useMemo(() => component ?? 'button', [component])\n  const classNames = useClassNames('charcoal-button', className)\n  return (\n    <Component\n      {...props}\n      className={classNames}\n      data-variant={variant}\n      data-size={size}\n      data-full-width={fullWidth}\n      data-active={isActive}\n      ref={ref}\n    />\n  )\n}) as <T extends React.ElementType = 'button'>(\n  p: 'button' extends T\n    ? ButtonProps<'button'>\n    : ButtonProps<T> & {\n        component: T // required\n      },\n) => JSX.Element\nexport default Button\n","import React, { useMemo, forwardRef, ReactNode, type JSX } from 'react'\nimport { useClassNames } from '../../_lib/useClassNames'\nimport './index.css'\n\nexport type ClickableProps<T extends React.ElementType = 'button'> = {\n  children?: ReactNode\n  /**\n   * The component used for root element.\n   * @type T extends React.ElementType = 'button'\n   */\n  component?: T\n} & Omit<React.ComponentPropsWithRef<T>, 'children'>\n\nconst Clickable = forwardRef(function Clickable<T extends React.ElementType>(\n  { component, ...props }: ClickableProps<T>,\n  ref: React.ForwardedRef<HTMLButtonElement>,\n) {\n  const className = useClassNames('charcoal-clickable', props.className)\n\n  const Component = useMemo(() => component ?? 'button', [component])\n\n  return <Component {...props} ref={ref} className={className} />\n}) as <T extends React.ElementType = 'button'>(\n  p: ClickableProps<T>,\n) => JSX.Element\nexport default Clickable\n\n/**\n * @deprecated\n * remained for v3 compatibility and will be removed in the future\n */\nexport type ClickableElement = HTMLButtonElement & HTMLAnchorElement\n","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","import * as React from 'react'\n\nexport interface RadioGroupContext {\n  name: string\n  selected?: string\n  disabled: boolean\n  readonly: boolean\n  invalid: boolean\n  onChange: (next: string) => void\n}\n\nexport const RadioGroupContext = React.createContext<RadioGroupContext>({\n  name: undefined as never,\n  selected: undefined,\n  disabled: false,\n  readonly: false,\n  invalid: false,\n  onChange() {\n    throw new Error(\n      'Cannot find onChange() handler. Perhaps you forgot to wrap with <RadioGroup> ?',\n    )\n  },\n})\n","import './index.css'\n\nimport { forwardRef, memo, useCallback } from 'react'\nimport { useClassNames } from '../../../_lib/useClassNames'\n\ntype CharcoalRadioInputProps = {\n  invalid?: boolean\n  onChange?: (value: string) => void\n}\n\ntype InputProps = React.HTMLProps<HTMLInputElement>\n\nexport type RadioInputProps = CharcoalRadioInputProps &\n  Omit<InputProps, keyof CharcoalRadioInputProps | 'ref'>\n\nconst RadioInput = forwardRef<HTMLInputElement, RadioInputProps>(\n  function RadioInput({ onChange, invalid, className, ...props }, ref) {\n    const handleChange = useCallback(\n      (e: React.ChangeEvent<HTMLInputElement>) => {\n        const el = e.currentTarget\n        onChange?.(el.value)\n      },\n      [onChange],\n    )\n\n    const classNames = useClassNames('charcoal-radio-input', className)\n\n    return (\n      // eslint-disable-next-line jsx-a11y/role-supports-aria-props\n      <input\n        className={classNames}\n        ref={ref}\n        type=\"radio\"\n        onChange={handleChange}\n        aria-invalid={invalid}\n        {...props}\n      />\n    )\n  },\n)\n\nexport default memo(RadioInput)\n","import './index.css'\n\nimport { memo, forwardRef, useContext } from 'react'\nimport * as React from 'react'\nimport warning from 'warning'\nimport { useClassNames } from '../../_lib/useClassNames'\n\nimport { RadioGroupContext } from './RadioGroupContext'\nimport RadioInput from './RadioInput'\n\nexport type RadioProps = React.PropsWithChildren<{\n  value: string\n  disabled?: boolean\n  className?: string\n}>\n\nconst Radio = forwardRef<HTMLInputElement, RadioProps>(function RadioInner(\n  { value, disabled = false, children, ...props },\n  ref,\n) {\n  const {\n    name,\n    selected,\n    disabled: isParentDisabled,\n    readonly,\n    invalid,\n    onChange,\n  } = useContext(RadioGroupContext)\n\n  const classNames = useClassNames('charcoal-radio__label', props.className)\n\n  warning(\n    // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n    name !== undefined,\n    `\"name\" is not Provided for <Radio>. Perhaps you forgot to wrap with <RadioGroup> ?`,\n  )\n\n  const isSelected = value === selected\n  const isDisabled = disabled || isParentDisabled\n  const isReadonly = readonly && !isSelected\n\n  return (\n    <label aria-disabled={isDisabled || isReadonly} className={classNames}>\n      <RadioInput\n        name={name}\n        value={value}\n        checked={isSelected}\n        aria-invalid={invalid}\n        onChange={onChange}\n        disabled={isDisabled || isReadonly}\n        ref={ref}\n      />\n      {children != null && (\n        <div className=\"charcoal-radio__label_div\">{children}</div>\n      )}\n    </label>\n  )\n})\n\nexport default memo(Radio)\n","import './index.css'\n\nimport { forwardRef, useCallback, useMemo, type JSX } from 'react'\nimport * as React from 'react'\nimport { useClassNames } from '../../../_lib/useClassNames'\nimport { RadioGroupContext } from '../RadioGroupContext'\n\nexport type RadioGroupProps<Value extends string = string> =\n  React.PropsWithChildren<{\n    className?: string\n    value?: Value\n    /**\n     * aria-label of RadioGroup\n     */\n    label?: string\n    name: string\n    onChange(next: Value): void\n    disabled?: boolean\n    readonly?: boolean\n    invalid?: boolean\n    ref?: React.Ref<HTMLDivElement>\n    'aria-labelledby'?: React.ComponentProps<'div'>['aria-labelledby']\n    'aria-orientation'?: React.ComponentProps<'div'>['aria-orientation']\n  }>\n\nexport const RadioGroup = forwardRef<HTMLDivElement, RadioGroupProps<string>>(\n  function RadioGroupInner(\n    {\n      value,\n      label,\n      name,\n      onChange,\n      disabled,\n      readonly,\n      invalid,\n      children,\n      'aria-orientation': ariaOrientation = 'vertical',\n      ...props\n    },\n    ref,\n  ) {\n    const classNames = useClassNames('charcoal-radio-group', props.className)\n\n    const handleChange = useCallback(\n      (next: string) => {\n        onChange(next)\n      },\n      [onChange],\n    )\n\n    const contextValue = useMemo(\n      () => ({\n        name,\n        selected: value,\n        disabled: disabled ?? false,\n        readonly: readonly ?? false,\n        invalid: invalid ?? false,\n        onChange: handleChange,\n      }),\n      [disabled, handleChange, invalid, name, readonly, value],\n    )\n\n    return (\n      <RadioGroupContext.Provider value={contextValue}>\n        <div\n          role=\"radiogroup\"\n          aria-disabled={disabled}\n          aria-invalid={invalid}\n          aria-label={label}\n          aria-labelledby={props['aria-labelledby']}\n          aria-orientation={ariaOrientation}\n          className={classNames}\n          ref={ref}\n        >\n          {children}\n        </div>\n      </RadioGroupContext.Provider>\n    )\n  },\n) as <Value extends string>(props: RadioGroupProps<Value>) => JSX.Element\n","import { createContext } from 'react'\n\ntype MultiSelectGroupContext = {\n  name: string\n  selected: string[]\n  disabled: boolean\n  readonly: boolean\n  invalid: boolean\n  onChange: ({ value, selected }: { value: string; selected: boolean }) => void\n}\n\nexport const MultiSelectGroupContext = createContext<MultiSelectGroupContext>({\n  name: undefined as never,\n  selected: [],\n  disabled: false,\n  readonly: false,\n  invalid: false,\n  onChange() {\n    throw new Error(\n      'Cannot find `onChange()` handler. Perhaps you forgot to wrap it with `<MultiSelectGroup />` ?',\n    )\n  },\n})\n","import * as React from 'react'\n\nimport '@charcoal-ui/icons'\nimport type { PixivIcon, Props } from '@charcoal-ui/icons'\n\nexport interface OwnProps {\n  unsafeNonGuidelineScale?: number\n  className?: string\n}\n\nexport interface IconProps\n  extends OwnProps,\n    React.PropsWithoutRef<\n      Omit<Props, 'class' | 'unsafe-non-guideline-scale' | 'css'>\n    > {}\n\nconst Icon = React.forwardRef<PixivIcon, IconProps>(function IconInner(\n  { name, scale, unsafeNonGuidelineScale, className, ...rest },\n  ref,\n) {\n  return (\n    <pixiv-icon\n      ref={ref}\n      name={name}\n      scale={scale}\n      unsafe-non-guideline-scale={unsafeNonGuidelineScale}\n      class={className}\n      {...rest}\n    />\n  )\n})\n\nexport default Icon\n","import { ChangeEvent, useCallback, useContext, forwardRef, memo } from 'react'\nimport * as React from 'react'\nimport warning from 'warning'\n\nimport { MultiSelectGroupContext } from './context'\nimport Icon from '../Icon'\nimport { useClassNames } from '../../_lib/useClassNames'\nimport './index.css'\n\nexport type MultiSelectProps = React.PropsWithChildren<{\n  value: string\n  disabled?: boolean\n  variant?: 'default' | 'overlay'\n  className?: string\n  onChange?: (payload: { value: string; selected: boolean }) => void\n}>\n\nconst MultiSelect = forwardRef<HTMLInputElement, MultiSelectProps>(\n  function MultiSelectInner(\n    {\n      value,\n      disabled = false,\n      onChange,\n      variant = 'default',\n      className,\n      children,\n    },\n    ref,\n  ) {\n    const {\n      name,\n      selected,\n      disabled: parentDisabled,\n      readonly,\n      invalid,\n      onChange: parentOnChange,\n    } = useContext(MultiSelectGroupContext)\n\n    warning(\n      // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n      name !== undefined,\n      `\"name\" is not Provided for <MultiSelect>. Perhaps you forgot to wrap with <MultiSelectGroup> ?`,\n    )\n\n    const isSelected = selected.includes(value)\n    const isDisabled = disabled || parentDisabled || readonly\n\n    const handleChange = useCallback(\n      (event: ChangeEvent<HTMLInputElement>) => {\n        if (!(event.currentTarget instanceof HTMLInputElement)) {\n          return\n        }\n        if (onChange) onChange({ value, selected: event.currentTarget.checked })\n        parentOnChange({ value, selected: event.currentTarget.checked })\n      },\n      [onChange, parentOnChange, value],\n    )\n    const classNames = useClassNames('charcoal-multi-select', className)\n    return (\n      <label aria-disabled={isDisabled} className={classNames}>\n        <input\n          className=\"charcoal-multi-select-input\"\n          name={name}\n          value={value}\n          type=\"checkbox\"\n          checked={isSelected}\n          disabled={isDisabled}\n          onChange={handleChange}\n          data-overlay={variant === 'overlay'}\n          aria-invalid={invalid}\n          ref={ref}\n        />\n        <div\n          className=\"charcoal-multi-select-overlay\"\n          data-overlay={variant === 'overlay'}\n          aria-invalid={invalid}\n          aria-hidden\n        >\n          <Icon name=\"24/Check\" unsafe-non-guideline-scale={16 / 24} />\n        </div>\n        {Boolean(children) && (\n          <div className=\"charcoal-multi-select-label\">{children}</div>\n        )}\n      </label>\n    )\n  },\n)\n\nexport default memo(MultiSelect)\n\nexport type MultiSelectGroupProps = React.PropsWithChildren<{\n  className?: string\n  style?: React.CSSProperties\n  name: string\n  label: string\n  selected: string[]\n  onChange: (selected: string[]) => void\n  disabled?: boolean\n  readonly?: boolean\n  invalid?: boolean\n}>\n\nexport function MultiSelectGroup({\n  className,\n  style,\n  name,\n  label,\n  selected,\n  onChange,\n  disabled = false,\n  readonly = false,\n  invalid = false,\n  children,\n}: MultiSelectGroupProps) {\n  const handleChange = useCallback(\n    (payload: { value: string; selected: boolean }) => {\n      const index = selected.indexOf(payload.value)\n\n      if (payload.selected) {\n        if (index < 0) {\n          onChange([...selected, payload.value])\n        }\n      } else {\n        if (index >= 0) {\n          onChange([...selected.slice(0, index), ...selected.slice(index + 1)])\n        }\n      }\n    },\n    [onChange, selected],\n  )\n\n  return (\n    <MultiSelectGroupContext.Provider\n      value={{\n        name,\n        selected: Array.from(new Set(selected)),\n        disabled,\n        readonly,\n        invalid,\n        onChange: handleChange,\n      }}\n    >\n      <div\n        className={className}\n        style={style}\n        aria-label={label}\n        data-testid=\"SelectGroup\"\n      >\n        {children}\n      </div>\n    </MultiSelectGroupContext.Provider>\n  )\n}\n","import './index.css'\n\nimport { forwardRef, useCallback } from 'react'\nimport { useClassNames } from '../../../_lib/useClassNames'\n\nexport type CharcoalSwitchProps = {\n  onChange?: (checked: boolean) => void\n}\n\ntype InputProps = React.HTMLProps<HTMLInputElement>\n\nexport type SwitchInputProps = CharcoalSwitchProps &\n  Omit<InputProps, keyof CharcoalSwitchProps | 'ref'>\n\nconst SwitchInput = forwardRef<\n  HTMLInputElement,\n  Omit<SwitchInputProps, 'children'>\n>(function SwitchInput({ onChange, className, ...props }, ref) {\n  const handleChange = useCallback(\n    (e: React.ChangeEvent<HTMLInputElement>) => {\n      const el = e.currentTarget\n      onChange?.(el.checked)\n    },\n    [onChange],\n  )\n\n  const classNames = useClassNames('charcoal-switch-input', className)\n  return (\n    <input\n      ref={ref}\n      className={classNames}\n      type=\"checkbox\"\n      onChange={handleChange}\n      {...props}\n    />\n  )\n})\n\nexport default SwitchInput\n","import * as React from 'react'\nimport { useClassNames } from '../../_lib/useClassNames'\n\nexport const SwitchWithLabel = React.memo(function SwitchWithLabel({\n  children,\n  className,\n  disabled,\n  id,\n  input,\n}: {\n  children: React.ReactNode\n  className?: string\n  disabled?: boolean\n  id?: string\n  input: React.ReactNode\n}) {\n  const classNames = useClassNames('charcoal-switch__label', className)\n  return (\n    <label htmlFor={id} className={classNames} aria-disabled={disabled}>\n      {input}\n      <div className=\"charcoal-switch__label_div\">{children}</div>\n    </label>\n  )\n})\n","import './index.css'\n\nimport { memo, forwardRef } from 'react'\nimport { useId } from '@react-aria/utils'\nimport SwitchInput, { type SwitchInputProps } from './SwitchInput'\nimport { SwitchWithLabel } from './SwitchWithLabel'\n\nexport type SwitchProps = SwitchInputProps\n\nconst Switch = forwardRef<HTMLInputElement, SwitchProps>(function Switch(\n  { children, onChange, disabled, className, id, ...props },\n  ref,\n) {\n  const htmlId = useId(id)\n  const noChildren = children === undefined\n  const input = (\n    <SwitchInput\n      {...props}\n      disabled={disabled}\n      className={noChildren ? className : undefined}\n      id={htmlId}\n      onChange={onChange}\n      ref={ref}\n      role=\"switch\"\n      type=\"checkbox\"\n    />\n  )\n\n  if (noChildren) {\n    return input\n  }\n\n  return (\n    <SwitchWithLabel\n      className={className}\n      disabled={disabled}\n      id={htmlId}\n      input={input}\n    >\n      {children}\n    </SwitchWithLabel>\n  )\n})\n\nexport default memo(Switch)\n","import * as React from 'react'\nimport { useClassNames } from '../../_lib/useClassNames'\n\nimport './index.css'\n\nexport interface FieldLabelProps\n  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","/**\n * 今後ポートされる予定の汎用的な関数群\n */\n\n/**\n * Function used to assert a given code path is unreachable\n */\nexport function unreachable(): never\n/**\n * Function used to assert a given code path is unreachable.\n * Very useful for ensuring switches are exhaustive:\n *\n * ```ts\n * switch (a.type) {\n *   case Types.A:\n *   case Types.B:\n *     break\n *   default:\n *     unreachable(a) // will cause a build error if there was\n *                    // a Types.C that was not checked\n * }\n * ```\n *\n * @param value Value to be asserted as unreachable\n */\n// NOTE: Uses separate overloads, _not_ `value?: never`, to not allow `undefined` to be passed\n\nexport function unreachable(value: never): never\nexport function unreachable(value?: never): never {\n  throw new Error(\n    arguments.length === 0\n      ? 'unreachable'\n      : `unreachable (${JSON.stringify(value)})`,\n  )\n}\n\n/**\n * 複数のrefをマージする。\n *\n * forwardRefで受け取ったrefと、コンポーネント内で定義したrefを同じ要素につけたいケースなどで使う\n */\nexport function mergeRefs<T>(...refs: React.Ref<T>[]): React.RefCallback<T> {\n  return (value) => {\n    for (const ref of refs) {\n      if (typeof ref === 'function') {\n        ref(value)\n      } else if (ref !== null) {\n        // TODO: use RefObject\n        // https://react.dev/blog/2024/04/25/react-19-upgrade-guide#:~:text=%3D%201%3B-,MutableRef,-is%20now%20deprecated\n        ;(ref as React.MutableRefObject<T | null>).current = value\n      }\n    }\n  }\n}\n\nexport function countCodePointsInString(string: string) {\n  // [...string] とするとproduction buildで動かなくなる\n  // cf. https://twitter.com/f_subal/status/1497214727511891972\n  return Array.from(string).length\n}\n","import { useEffect } from 'react'\nimport * as React from 'react'\n\nexport function useFocusWithClick(\n  containerRef: React.RefObject<HTMLDivElement | null>,\n  inputRef: React.RefObject<HTMLInputElement | HTMLTextAreaElement | null>,\n) {\n  useEffect(() => {\n    const el = containerRef.current\n    if (el) {\n      const handleDown = (e: MouseEvent) => {\n        if (e.target !== inputRef.current) {\n          inputRef.current?.focus()\n        }\n      }\n      el.addEventListener('click', handleDown)\n      return () => {\n        el.removeEventListener('click', handleDown)\n      }\n    }\n  })\n}\n","import { forwardRef } from 'react'\nimport { useClassNames } from './useClassNames'\n\nexport function createDivComponent(mainClassName: string) {\n  return forwardRef<HTMLDivElement, React.ComponentPropsWithRef<'div'>>(\n    function DivComponent({ className, ...props }, ref) {\n      const classNames = useClassNames(mainClassName, className)\n      return <div className={classNames} ref={ref} {...props} />\n    },\n  )\n}\n","import { createDivComponent } from '../../../_lib/createDivComponent'\nimport './index.css'\n\nexport const AssistiveText = createDivComponent(\n  'charcoal-text-field-assistive-text',\n)\n","import './index.css'\n\nimport { useVisuallyHidden } from '@react-aria/visually-hidden'\nimport { ReactNode, useCallback, useEffect, useRef, useState } from 'react'\nimport * as React from 'react'\nimport FieldLabel from '../FieldLabel'\nimport { countCodePointsInString } from '../../_lib'\nimport { useFocusWithClick } from './useFocusWithClick'\nimport { mergeRefs, useId } from '@react-aria/utils'\nimport { AssistiveText } from './AssistiveText'\nimport { useClassNames } from '../../_lib/useClassNames'\n\nexport type TextFieldProps = {\n  prefix?: ReactNode\n  suffix?: ReactNode\n\n  value?: string\n  onChange?: (value: string) => void\n\n  showCount?: boolean\n  showLabel?: boolean\n  assistiveText?: string\n  invalid?: boolean\n\n  label?: string\n  requiredText?: string\n  disabled?: boolean\n  subLabel?: React.ReactNode\n  rdfaPrefix?: string\n\n  getCount?: (value: string) => number\n} & Omit<React.ComponentPropsWithoutRef<'input'>, 'prefix' | 'onChange'>\n\nconst TextField = React.forwardRef<HTMLInputElement, TextFieldProps>(\n  function SingleLineTextFieldInner(\n    {\n      assistiveText,\n      className,\n      disabled = false,\n      label = '',\n      maxLength,\n      onChange,\n      prefix = null,\n      required,\n      requiredText,\n      showCount = false,\n      showLabel = false,\n      subLabel,\n      suffix = null,\n      type = 'text',\n      invalid,\n      value,\n      getCount = countCodePointsInString,\n      ...props\n    },\n    forwardRef,\n  ) {\n    const inputRef = useRef<HTMLInputElement>(null)\n\n    const { visuallyHiddenProps } = useVisuallyHidden()\n\n    const [count, setCount] = useState(getCount(value ?? ''))\n\n    const handleChange = useCallback(\n      (e: React.ChangeEvent<HTMLInputElement>) => {\n        const value = e.target.value\n        const count = getCount(value)\n        if (maxLength !== undefined && count > maxLength) {\n          return\n        }\n        setCount(count)\n        onChange?.(value)\n      },\n      [getCount, maxLength, onChange],\n    )\n\n    useEffect(() => {\n      setCount(getCount(value ?? ''))\n    }, [getCount, value])\n\n    const containerRef = useRef(null)\n\n    useFocusWithClick(containerRef, inputRef)\n\n    const inputId = useId(props.id)\n    const describedbyId = useId()\n    const labelledbyId = useId()\n\n    const showAssistiveText =\n      assistiveText != null && assistiveText.length !== 0\n\n    const classNames = useClassNames('charcoal-text-field-root', className)\n\n    return (\n      <div className={classNames} aria-disabled={disabled}>\n        <FieldLabel\n          htmlFor={inputId}\n          id={labelledbyId}\n          label={label}\n          required={required}\n          requiredText={requiredText}\n          subLabel={subLabel}\n          {...(!showLabel ? visuallyHiddenProps : {})}\n        />\n        <div\n          className=\"charcoal-text-field-container\"\n          aria-disabled={disabled === true ? true : undefined}\n          data-invalid={invalid === true}\n          ref={containerRef}\n        >\n          {prefix && <div className=\"charcoal-text-field-prefix\">{prefix}</div>}\n          <input\n            className=\"charcoal-text-field-input\"\n            aria-describedby={showAssistiveText ? describedbyId : undefined}\n            aria-invalid={invalid}\n            aria-labelledby={labelledbyId}\n            id={inputId}\n            data-invalid={invalid === true}\n            maxLength={maxLength}\n            onChange={handleChange}\n            disabled={disabled}\n            ref={mergeRefs(forwardRef, inputRef)}\n            type={type}\n            value={value}\n            {...props}\n          />\n          {(suffix || showCount) && (\n            <div className=\"charcoal-text-field-suffix\">\n              {suffix}\n              {showCount && (\n                <span className=\"charcoal-text-field-line-counter\">\n                  {maxLength !== undefined ? `${count}/${maxLength}` : count}\n                </span>\n              )}\n            </div>\n          )}\n        </div>\n        {showAssistiveText && (\n          <AssistiveText data-invalid={invalid === true} id={describedbyId}>\n            {assistiveText}\n          </AssistiveText>\n        )}\n      </div>\n    )\n  },\n)\n\nexport default TextField\n","import './index.css'\n\nimport { useVisuallyHidden } from '@react-aria/visually-hidden'\nimport { forwardRef, useCallback, useEffect, useRef, useState } from 'react'\nimport FieldLabel from '../FieldLabel'\nimport { countCodePointsInString, mergeRefs } from '../../_lib'\nimport { useFocusWithClick } from '../TextField/useFocusWithClick'\nimport { useId } from '@react-aria/utils'\nimport { AssistiveText } from '../TextField/AssistiveText'\nimport { useClassNames } from '../../_lib/useClassNames'\n\nexport type TextAreaProps = {\n  value?: string\n  onChange?: (value: string) => void\n\n  showCount?: boolean\n  showLabel?: boolean\n  assistiveText?: string\n  invalid?: boolean\n\n  label?: string\n  requiredText?: string\n  disabled?: boolean\n  subLabel?: React.ReactNode\n  autoHeight?: boolean\n\n  getCount?: (value: string) => number\n} & Omit<React.ComponentPropsWithoutRef<'textarea'>, 'onChange'>\n\nconst TextArea = forwardRef<HTMLTextAreaElement, TextAreaProps>(\n  function TextAreaInner(\n    {\n      onChange,\n      className,\n      value,\n      showCount = false,\n      showLabel = false,\n      label = '',\n      requiredText,\n      subLabel,\n      disabled = false,\n      required,\n      assistiveText,\n      maxLength,\n      autoHeight = false,\n      rows: initialRows = 4,\n      invalid,\n      getCount = countCodePointsInString,\n      ...props\n    },\n    forwardRef,\n  ) {\n    const { visuallyHiddenProps } = useVisuallyHidden()\n    const textareaRef = useRef<HTMLTextAreaElement>(null)\n    const [count, setCount] = useState(getCount(value ?? ''))\n    const [rows, setRows] = useState(initialRows)\n\n    const syncHeight = useCallback(\n      (textarea: HTMLTextAreaElement) => {\n        const rows = (`${textarea.value}\\n`.match(/\\n/gu)?.length ?? 0) || 1\n        setRows(initialRows <= rows ? rows : initialRows)\n      },\n      [initialRows],\n    )\n\n    const nonControlled = value === undefined\n    const handleChange = useCallback(\n      (e: React.ChangeEvent<HTMLTextAreaElement>) => {\n        const value = e.target.value\n        const count = getCount(value)\n        if (maxLength !== undefined && count > maxLength) {\n          return\n        }\n        if (nonControlled) {\n          setCount(count)\n        }\n        if (autoHeight && textareaRef.current !== null) {\n          syncHeight(textareaRef.current)\n        }\n        onChange?.(value)\n      },\n      [autoHeight, getCount, maxLength, nonControlled, onChange, syncHeight],\n    )\n\n    useEffect(() => {\n      setCount(getCount(value ?? ''))\n    }, [getCount, value])\n\n    useEffect(() => {\n      if (autoHeight && textareaRef.current !== null) {\n        syncHeight(textareaRef.current)\n      }\n    }, [autoHeight, syncHeight])\n\n    const containerRef = useRef(null)\n\n    useFocusWithClick(containerRef, textareaRef)\n\n    const textAreaId = useId(props.id)\n    const describedbyId = useId()\n    const labelledbyId = useId()\n\n    const classNames = useClassNames('charcoal-text-area-root', className)\n\n    const showAssistiveText =\n      assistiveText != null && assistiveText.length !== 0\n\n    return (\n      <div className={classNames} aria-disabled={disabled}>\n        <FieldLabel\n          htmlFor={textAreaId}\n          id={labelledbyId}\n          label={label}\n          required={required}\n          requiredText={requiredText}\n          subLabel={subLabel}\n          {...(!showLabel ? visuallyHiddenProps : {})}\n        />\n        <div\n          className=\"charcoal-text-area-container\"\n          aria-disabled={disabled === true ? 'true' : undefined}\n          aria-invalid={invalid === true}\n          ref={containerRef}\n          style={{\n            '--charcoal-text-area-rows': `${showCount ? rows + 1 : rows}`,\n          }}\n        >\n          <textarea\n            className=\"charcoal-text-area-textarea\"\n            aria-describedby={showAssistiveText ? describedbyId : undefined}\n            aria-invalid={invalid}\n            aria-labelledby={labelledbyId}\n            id={textAreaId}\n            maxLength={maxLength}\n            data-no-bottom-padding={showCount}\n            onChange={handleChange}\n            ref={mergeRefs(forwardRef, textareaRef)}\n            rows={rows}\n            value={value}\n            disabled={disabled}\n            {...props}\n          />\n          {showCount && (\n            <span className=\"charcoal-text-area-counter\">\n              {maxLength !== undefined ? `${count}/${maxLength}` : count}\n            </span>\n          )}\n        </div>\n        {showAssistiveText && (\n          <AssistiveText data-invalid={invalid === true} id={describedbyId}>\n            {assistiveText}\n          </AssistiveText>\n        )}\n      </div>\n    )\n  },\n)\n\nexport default TextArea\n","import * as React from 'react'\n\nexport function useForwardedRef<T>(ref: React.ForwardedRef<T>) {\n  const innerRef = React.useRef<T>(null)\n\n  React.useEffect(() => {\n    if (!ref) return\n    if (typeof ref === 'function') {\n      ref(innerRef.current)\n    } else {\n      // eslint-disable-next-line react-compiler/react-compiler\n      ref.current = innerRef.current\n    }\n  })\n\n  return innerRef\n}\n","import { forwardRef } from 'react'\nimport * as React from 'react'\nimport { useDialog } from '@react-aria/dialog'\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","import * as React from 'react'\n\n/**\n * ModalBackgroundのElementが入ったコンテキスト\n */\nexport const ModalBackgroundContext = React.createContext<HTMLElement | null>(\n  null,\n)\n","import { useEffect } from 'react'\n\nexport function usePreventScroll(\n  element: HTMLElement | null,\n  isOpen: boolean,\n  useClip = false,\n) {\n  useEffect(() => {\n    if (isOpen && element) {\n      const defaultPaddingRight = element.style.paddingRight\n      const defaultOverflow = element.style.overflow\n      // eslint-disable-next-line react-compiler/react-compiler\n      element.style.paddingRight = `${\n        window.innerWidth - element.clientWidth\n      }px`\n      element.style.overflow = useClip ? 'clip' : 'hidden'\n      return () => {\n        element.style.paddingRight = defaultPaddingRight\n        element.style.overflow = defaultOverflow\n      }\n    }\n  }, [element, isOpen, useClip])\n}\n","import * as React from 'react'\nimport {\n  AriaModalOverlayProps,\n  ModalOverlayAria,\n  ariaHideOutside,\n  useOverlay,\n  useOverlayFocusContain,\n} from '@react-aria/overlays'\nimport { usePreventScroll } from '../DropdownSelector/Popover/usePreventScroll'\n\n/**\n * We want to enable scrolling on the modal background,\n * but `useModalOverlay` (specifically, `useOverlay` within it) detects pointer events on the scrollbar.\n * Therefore, to prevent this issue, we need to override `shouldCloseOnInteractOutside` in `useModalOverlay`.\n */\nexport type CharcoalModalOverlayProps = AriaModalOverlayProps & {\n  overflowClip?: boolean\n}\nexport function useCharcoalModalOverlay(\n  props: CharcoalModalOverlayProps,\n  state: { isOpen: boolean; onClose: () => void },\n  ref: React.RefObject<HTMLElement | null>,\n): ModalOverlayAria {\n  const { overlayProps, underlayProps } = useOverlay(\n    {\n      ...props,\n      isOpen: state.isOpen,\n      onClose: state.onClose,\n      shouldCloseOnInteractOutside: () => false,\n    },\n    ref,\n  )\n\n  usePreventScroll(\n    typeof document !== 'undefined' ? document.body : null,\n    state.isOpen,\n    props.overflowClip,\n  )\n\n  useOverlayFocusContain()\n\n  React.useEffect(() => {\n    if (state.isOpen && ref.current) {\n      return ariaHideOutside([ref.current])\n    }\n  }, [state.isOpen, ref])\n\n  return {\n    modalProps: overlayProps,\n    underlayProps,\n  }\n}\n\nfunction isWindowDefined() {\n  return typeof window !== 'undefined'\n}\n\nexport function useWindowWidth() {\n  const [width, setWidth] = React.useState(\n    isWindowDefined() ? window.innerWidth : null,\n  )\n  React.useEffect(() => {\n    const handleResize = () => {\n      setWidth(window.innerWidth)\n    }\n    window.addEventListener('resize', handleResize)\n    return () => {\n      window.removeEventListener('resize', handleResize)\n    }\n  })\n  return width\n}\n","import { useContext, forwardRef, memo } from 'react'\nimport * as React from 'react'\nimport { Overlay } from '@react-aria/overlays'\nimport type { AriaDialogProps } from '@react-types/dialog'\nimport { animated, useTransition, easings } from '@react-spring/web'\nimport Button, { ButtonProps } from '../Button'\nimport IconButton, { IconButtonProps } from '../IconButton'\nimport { useObjectRef } from '@react-aria/utils'\nimport { Dialog } from './Dialog'\nimport { ModalBackgroundContext } from './ModalBackgroundContext'\nimport {\n  CharcoalModalOverlayProps,\n  useCharcoalModalOverlay,\n  useWindowWidth,\n} from './useCustomModalOverlay'\n\nimport './index.css'\n\nexport type BottomSheet = boolean | 'full'\nexport type Size = 'S' | 'M' | 'L'\n\nexport type ModalProps = CharcoalModalOverlayProps &\n  AriaDialogProps & {\n    children: React.ReactNode\n    zIndex?: number\n    title: string\n    size?: Size\n    bottomSheet?: BottomSheet\n    isOpen: boolean\n    onClose: () => void\n    className?: string\n    closeButtonAriaLabel?: string\n\n    /**\n     * https://github.com/adobe/react-spectrum/issues/3787\n     * Next.jsで使用する際に発生するエラーの一時的な回避策でdocument.bodyを指定する必要がある\n     */\n    portalContainer?: HTMLElement\n  }\n\nconst DEFAULT_Z_INDEX = 10\n\n/**\n * モーダルコンポーネント。\n *\n * @example アプリケーションルートで `<OverlayProvider>` ないし `<CharcoalProvider>` で囲った上で利用する\n * ```tsx\n * import {\n *   OverlayProvider,\n *   Modal,\n *   ModalHeader,\n *   ModalBody,\n *   ModalButtons\n * } from '@charcoal-ui/react'\n *\n * <OverlayProvider>\n *   <App>\n *     <Modal title=\"Title\" isOpen={state.isOpen} onClose={() => state.close()} isDismissable>\n *       <ModalHeader />\n *       <ModalBody>\n *         ...\n *         <ModalButtons>...</ModalButtons>\n *       </ModalBody>\n *     </Modal>\n *   </App>\n * </OverlayProvider>\n * ```\n */\nconst Modal = forwardRef<HTMLDivElement, ModalProps>(function ModalInner(\n  { children, zIndex = DEFAULT_Z_INDEX, portalContainer, ...props },\n  external,\n) {\n  const {\n    title,\n    size = 'M',\n    bottomSheet = false,\n    isDismissable,\n    onClose,\n    className,\n    isOpen = false,\n    closeButtonAriaLabel = 'Close',\n  } = props\n\n  const ref = useObjectRef<HTMLDivElement>(external)\n\n  const { modalProps, underlayProps } = useCharcoalModalOverlay(\n    {\n      ...props,\n      isKeyboardDismissDisabled:\n        isDismissable === undefined || isDismissable === false,\n    },\n    {\n      onClose,\n      isOpen,\n    },\n    ref,\n  )\n\n  const isMobile = (useWindowWidth() ?? Infinity) < 744\n  const transitionEnabled = isMobile && bottomSheet !== false\n  const showDismiss = !isMobile || bottomSheet !== true\n\n  const transition = useTransition(isOpen, {\n    from: {\n      transform: 'translateY(100%)',\n      backgroundColor: 'rgba(0, 0, 0, 0)',\n      overflow: 'hidden',\n    },\n    enter: {\n      transform: 'translateY(0%)',\n      backgroundColor: 'rgba(0, 0, 0, 0.4)',\n    },\n    update: {\n      overflow: 'auto',\n    },\n    leave: {\n      transform: 'translateY(100%)',\n      backgroundColor: 'rgba(0, 0, 0, 0)',\n      overflow: 'hidden',\n    },\n    config: transitionEnabled\n      ? { duration: 400, easing: easings.easeOutQuart }\n      : { duration: 0 },\n  })\n\n  const bgRef = React.useRef<HTMLDivElement>(null)\n\n  const handleClick = React.useCallback(\n    (e: React.MouseEvent<HTMLDivElement, MouseEvent>) => {\n      if (e.currentTarget === e.target) {\n        onClose()\n      }\n    },\n    [onClose],\n  )\n\n  return transition(\n    ({ backgroundColor, overflow, transform }, item) =>\n      item && (\n        <Overlay portalContainer={portalContainer}>\n          {/* https://github.com/pmndrs/react-spring/issues/1515 */}\n          {/* eslint-disable-next-line @typescript-eslint/ban-ts-comment */}\n          {/* @ts-ignore */}\n          <animated.div\n            className=\"charcoal-modal-background\"\n            ref={bgRef}\n            {...underlayProps}\n            style={\n              transitionEnabled\n                ? { backgroundColor, overflow, zIndex }\n                : { zIndex }\n            }\n            data-bottom-sheet={bottomSheet}\n            onClick={handleClick}\n          >\n            <ModalBackgroundContext.Provider value={bgRef.current}>\n              {/* https://github.com/pmndrs/react-spring/issues/1515 */}\n              {/* eslint-disable-next-line @typescript-eslint/ban-ts-comment */}\n              {/* @ts-ignore */}\n              <AnimatedDialog\n                ref={ref}\n                {...modalProps}\n                style={transitionEnabled ? { transform } : {}}\n                size={size}\n                bottomSheet={bottomSheet}\n                className={className}\n              >\n                <ModalContext.Provider\n                  value={{\n                    titleProps: {},\n                    title,\n                    close: onClose,\n                    showDismiss,\n                    bottomSheet,\n                  }}\n                >\n                  {children}\n                  {isDismissable === true && (\n                    <ModalCloseButton\n                      aria-label={closeButtonAriaLabel}\n                      onClick={onClose}\n                    />\n                  )}\n                </ModalContext.Provider>\n              </AnimatedDialog>\n            </ModalBackgroundContext.Provider>\n          </animated.div>\n        </Overlay>\n      ),\n  )\n})\n\nconst AnimatedDialog = animated(Dialog)\n\nexport default memo(Modal)\n\nexport const ModalContext = React.createContext<{\n  /**\n   * @deprecated\n   */\n  titleProps: React.HTMLAttributes<HTMLElement>\n  title: string\n  close?: () => void\n  showDismiss: boolean\n  bottomSheet: BottomSheet\n}>({\n  titleProps: {},\n  title: '',\n  close: undefined,\n  showDismiss: true,\n  bottomSheet: false,\n})\n\nexport function ModalCloseButton(props: Omit<IconButtonProps, 'icon'>) {\n  return (\n    <IconButton\n      className=\"charcoal-modal-close-button\"\n      size=\"S\"\n      icon=\"24/Close\"\n      type=\"button\"\n      {...props}\n    />\n  )\n}\n\nexport function ModalDismissButton({ children, ...props }: ButtonProps) {\n  const { close, showDismiss } = useContext(ModalContext)\n\n  if (!showDismiss) {\n    return null\n  }\n\n  return (\n    <Button {...props} onClick={close} fullWidth>\n      {children}\n    </Button>\n  )\n}\n","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","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","import './index.css'\n\nimport { RefObject, useContext, useRef, ReactNode } from 'react'\nimport { DismissButton, Overlay, usePopover } from '@react-aria/overlays'\nimport { ModalBackgroundContext } from '../../Modal/ModalBackgroundContext'\nimport { usePreventScroll } from './usePreventScroll'\n\nexport type PopoverProps = {\n  isOpen: boolean\n  onClose: () => void\n  children: ReactNode\n  triggerRef: RefObject<Element | null>\n  popoverRef?: RefObject<HTMLDivElement | null>\n  /**\n   * A tmp workaround for react-aria above 3.27.3 setting overlay element to inert and causing background to be clickable.\n   * This may become default at next major.\n   * https://github.com/adobe/react-spectrum/pull/8796\n   * https://github.com/adobe/react-spectrum/issues/8784\n   *\n   * @default false\n   */\n  inertWorkaround?: boolean\n}\n\nconst _empty = () => null\n\n/**\n * 画面の全面に動的に開くことができるコンテナ要素\n * 外の要素をクリックしたり、内部からフォーカスを移動した場合に自動的に閉じる\n *\n * triggerRefの付近に画面内に収まるように表示される\n */\nexport default function Popover(props: PopoverProps) {\n  const defaultPopoverRef = useRef<HTMLDivElement>(null)\n  const finalPopoverRef =\n    props.popoverRef === undefined ? defaultPopoverRef : props.popoverRef\n  const { popoverProps, underlayProps } = usePopover(\n    {\n      triggerRef: props.triggerRef,\n      popoverRef: finalPopoverRef,\n      containerPadding: 16,\n    },\n    {\n      close: props.onClose,\n      isOpen: props.isOpen,\n      // never used\n      open: _empty,\n      setOpen: _empty,\n      toggle: _empty,\n    },\n  )\n\n  const modalBackground = useContext(ModalBackgroundContext)\n  usePreventScroll(modalBackground, props.isOpen)\n\n  if (!props.isOpen) return null\n\n  return (\n    <Overlay portalContainer={document.body}>\n      <div\n        {...underlayProps}\n        // https://github.com/adobe/react-spectrum/issues/8784#issuecomment-3234771154\n        {...(props.inertWorkaround\n          ? { 'data-react-aria-top-layer': true, onClick: props.onClose }\n          : {})}\n        style={{\n          position: 'fixed',\n          zIndex:\n            typeof popoverProps.style?.zIndex === 'number'\n              ? popoverProps.style.zIndex - 1\n              : 99999,\n          inset: 0,\n        }}\n      />\n      {/* @ts-expect-error react types we use does not support react 19 types yet */}\n      <div {...popoverProps} ref={finalPopoverRef} className=\"charcoal-popover\">\n        <DismissButton onDismiss={() => props.onClose()} />\n        <div tabIndex={0} onFocus={props.onClose} />\n        {props.children}\n        <div tabIndex={0} onFocus={props.onClose} />\n        <DismissButton onDismiss={() => props.onClose()} />\n      </div>\n    </Overlay>\n  )\n}\n","import { Key, useEffect, useRef } from 'react'\nimport Popover, { PopoverProps } from './Popover'\n\ntype DropdownPopoverProps = PopoverProps & {\n  value?: Key\n}\n\n/**\n * DropdownSelectorの選択肢をを表示するためのPopover\n * triggerRefの要素と同じ幅になる\n * 表示の際にvalueが等しいDropdownMenuItemを中央に表示する\n */\nexport function DropdownPopover({ children, ...props }: DropdownPopoverProps) {\n  const ref = useRef<HTMLDivElement>(null)\n  useEffect(() => {\n    if (props.isOpen && ref.current && props.triggerRef.current) {\n      ref.current.style.width = `${props.triggerRef.current.clientWidth}px`\n    }\n  }, [props.triggerRef, props.isOpen])\n\n  useEffect(() => {\n    if (props.isOpen) {\n      if (props.value !== undefined && props.value !== '') {\n        // windowのスクロールを維持したまま選択肢をPopoverの中心に表示する\n        const windowScrollY = window.scrollY\n        const windowScrollX = window.scrollX\n        const selectedElement = document.querySelector(\n          `[data-key=\"${props.value.toString()}\"]`,\n        ) as HTMLElement | undefined\n        selectedElement?.focus()\n        window.scrollTo(windowScrollX, windowScrollY)\n      } else {\n        const el = ref.current?.querySelector(\"[role='option']\")\n        if (el instanceof HTMLElement) {\n          el.focus()\n        }\n      }\n    }\n  }, [props.value, props.isOpen])\n\n  return (\n    <Popover\n      isOpen={props.isOpen}\n      onClose={props.onClose}\n      popoverRef={ref}\n      triggerRef={props.triggerRef}\n      inertWorkaround={props.inertWorkaround}\n    >\n      {children}\n    </Popover>\n  )\n}\n","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","import { RefObject, createContext } from 'react'\nimport { DropdownMenuItemProps } from '../DropdownMenuItem'\n\ntype MenuListContextType = {\n  root?: RefObject<HTMLUListElement | null>\n  value?: string\n  propsArray?: DropdownMenuItemProps[]\n  setValue: (v: string) => void\n}\n\nexport const MenuListContext = createContext<MenuListContextType>({\n  root: undefined,\n  value: '',\n  propsArray: [],\n  setValue: (_v: string) => {\n    // empty\n  },\n})\n","import * as React from 'react'\nimport MenuItem from '../../MenuItem'\nimport { MenuListChildren } from '..'\nimport MenuItemGroup from '../../MenuItemGroup'\nimport { DropdownMenuItemProps } from '../../DropdownMenuItem'\n\n/**\n * valueというpropsを持つ子要素の値を再起的に探索して配列にする\n *\n * @param children\n * @param value\n * @param values\n * @returns\n */\nexport function getValuesRecursive(children: MenuListChildren) {\n  const childArray = React.Children.toArray(children)\n  const propsArray: DropdownMenuItemProps[] = []\n  for (let i = 0; i < childArray.length; i++) {\n    const child = childArray[i]\n    if (React.isValidElement(child)) {\n      const props = child.props as {\n        value?: string\n        disabled?: boolean\n        children?: React.ReactElement<typeof MenuItem | typeof MenuItemGroup>[]\n      }\n      if ('value' in props && typeof props.value === 'string') {\n        propsArray.push({\n          disabled: props.disabled,\n          value: props.value,\n        })\n      }\n      if ('children' in props && props.children) {\n        propsArray.push(...getValuesRecursive(props.children))\n      }\n    }\n  }\n  return propsArray\n}\n","import './index.css'\n\nimport { useMemo, useRef } from 'react'\nimport { MenuListContext } from './MenuListContext'\nimport { getValuesRecursive } from './internals/getValuesRecursive'\nimport MenuItem from '../MenuItem'\nimport { Divider } from '../Divider'\nimport MenuItemGroup from '../MenuItemGroup'\n\ntype MenuListChild = React.ReactElement<\n  typeof MenuItem | typeof MenuItemGroup | typeof Divider\n>\n\nexport type MenuListChildren = MenuListChild | MenuListChild[]\n\nexport type MenuListProps = {\n  children: MenuListChildren\n  value?: string\n  onChange?: (v: string) => void\n}\n\nexport default function MenuList(props: MenuListProps) {\n  const root = useRef(null)\n  const propsArray = useMemo(\n    () => getValuesRecursive(props.children),\n    [props.children],\n  )\n\n  return (\n    <ul className=\"charcoal-menu-list\" ref={root}>\n      <MenuListContext.Provider\n        value={{\n          value: props.value ?? '',\n          root,\n          propsArray,\n          setValue: (v) => {\n            props.onChange?.(v)\n          },\n        }}\n      >\n        {props.children}\n      </MenuListContext.Provider>\n    </ul>\n  )\n}\n","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 { useVisuallyHidden } from '@react-aria/visually-hidden'\nimport { AssistiveText } from '../TextField/AssistiveText'\nimport { useClassNames } from '../../_lib/useClassNames'\nimport { useId } from '@react-aria/utils'\nimport { PopoverProps } from './Popover'\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 [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  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        onClick={() => {\n          if (props.disabled === true) return\n          setIsOpen(true)\n        }}\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={() => setIsOpen(false)}\n          triggerRef={triggerRef}\n          value={props.value}\n          inertWorkaround={props.inertWorkaround}\n        >\n          <MenuList\n            value={props.value}\n            onChange={(v) => {\n              onChange(v)\n              setIsOpen(false)\n            }}\n          >\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","import './index.css'\n\nimport { ForwardedRef, forwardRef, ReactNode, useMemo, type JSX } from 'react'\nimport { useClassNames } from '../../../_lib/useClassNames'\n\nexport type CustomJSXElement =\n  | keyof JSX.IntrinsicElements\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any\n  | React.JSXElementConstructor<any>\n\nexport type ListItemProps<T extends React.ElementType = 'li'> = {\n  children?: ReactNode\n  as?: T\n} & Omit<React.ComponentPropsWithRef<T>, 'children' | 'as'>\n\nconst ListItem = forwardRef(function ListItem<T extends React.ElementType>(\n  { as, className, ...props }: ListItemProps<T>,\n  ref: ForwardedRef<HTMLLIElement>,\n) {\n  const Component = useMemo(() => as ?? 'li', [as])\n  const classNames = useClassNames('charcoal-list-item', className)\n  return <Component className={classNames} ref={ref} {...props} />\n}) as <T extends React.ElementType = 'li'>(p: ListItemProps<T>) => JSX.Element\n\nexport default ListItem\n","/**\n * elementをparentのスクロールビューに入るようにスクロールする\n * parentがスクロール可能でなければelementが見えるようにスクロールする\n *\n * @param element\n * @param parent\n */\nexport function handleFocusByKeyBoard(element: Element, parent: HTMLElement) {\n  const isScrollable = parent.scrollHeight > parent.clientHeight\n  if (isScrollable) {\n    const rect = element.getBoundingClientRect()\n    const parentRect = parent.getBoundingClientRect()\n    if (rect.bottom > parentRect.bottom) {\n      parent.scrollTo({\n        top: parent.scrollTop + rect.bottom - parentRect.bottom,\n      })\n    } else if (rect.top < parentRect.top) {\n      parent.scrollTo({\n        top: parent.scrollTop - (parentRect.top - rect.top),\n      })\n    }\n  } else {\n    scrollIfNeeded(element)\n  }\n}\n\n/**\n * 要素が画面外にあればスクロールする、画面内にあればスクロールしない\n * @param element\n */\nfunction scrollIfNeeded(element: Element) {\n  const elementRect = element.getBoundingClientRect()\n  const isVisible =\n    elementRect.top >= 0 &&\n    elementRect.bottom <=\n      (window.innerHeight || document.documentElement.clientHeight)\n\n  if (!isVisible) {\n    element.scrollIntoView({\n      block: 'nearest',\n    })\n  }\n}\n","import { useCallback, useContext } from 'react'\nimport { handleFocusByKeyBoard } from './handleFocusByKeyBoard'\nimport { MenuListContext } from '../../MenuList/MenuListContext'\n\n/**\n * MenuListContextに含まれるvalue間で上下キーでfocusを移動できる\n * EnterキーでMenuListContextに値を設定する\n * 上記2つの処理を含む処理(handleKeyDown)と、Enterキーを押下した処理(setContextValue)を配列で返す\n * @param value\n * @returns\n */\nexport function useMenuItemHandleKeyDown(\n  value?: string,\n): [(e: React.KeyboardEvent<HTMLElement>) => void, () => void] {\n  const { setValue, root, propsArray } = useContext(MenuListContext)\n  const setContextValue = useCallback(() => {\n    if (value !== undefined) setValue(value)\n  }, [value, setValue])\n\n  const handleKeyDown = useCallback(\n    (e: React.KeyboardEvent<HTMLElement>) => {\n      if (e.key === 'Enter') {\n        setContextValue()\n      } else if (e.key === 'ArrowUp' || e.key === 'ArrowDown') {\n        const isForward = e.key === 'ArrowDown'\n        // prevent scroll\n        e.preventDefault()\n        if (!propsArray || value === undefined) return\n        const values = propsArray\n          .map((props) => props.value)\n          .filter((v) => v) as string[]\n        let index = values.indexOf(value)\n        if (index === -1) return\n\n        for (let n = 0; n < values.length; n++) {\n          const focusValue = isForward\n            ? // prev or last\n              index + 1 >= values.length\n              ? values[0]\n              : values[index + 1]\n            : // next or first\n              index - 1 < 0\n              ? values[values.length - 1]\n              : values[index - 1]\n          const next = root?.current?.querySelector(\n            `[data-key='${focusValue}']`,\n          )\n\n          if (next instanceof HTMLElement) {\n            if (next.ariaDisabled === 'true') {\n              index += isForward ? 1 : -1\n              continue\n            }\n            next.focus({ preventScroll: true })\n            if (root?.current?.parentElement) {\n              handleFocusByKeyBoard(next, root.current.parentElement)\n            }\n            break\n          }\n        }\n      }\n    },\n    [setContextValue, propsArray, value, root],\n  )\n  return [handleKeyDown, setContextValue]\n}\n","import { ForwardedRef, forwardRef } from 'react'\nimport ListItem, { ListItemProps } from '../ListItem'\nimport { useMenuItemHandleKeyDown } from './internals/useMenuItemHandleKeyDown'\n\nexport type MenuItemProps<T extends React.ElementType = 'li'> = {\n  value?: string\n  disabled?: boolean\n} & ListItemProps<T>\n\n/**\n * 上下キーでフォーカス移動でき、エンターキーで選択できるリストの項目\n * 基本的に`<MenuList>`, `<MenuGroup>`と合わせて使用する\n */\nconst MenuItem = forwardRef(function MenuItem<\n  T extends React.ElementType = 'li',\n>(\n  { className: _, value, disabled, ...props }: MenuItemProps<T>,\n  ref: ForwardedRef<HTMLLIElement>,\n) {\n  const [handleKeyDown, setContextValue] = useMenuItemHandleKeyDown(value)\n  return (\n    // @ts-expect-error TODO: fix mismatch between MenuItemProps and ListItemProps\n    <ListItem\n      {...props}\n      ref={ref}\n      data-key={value}\n      onKeyDown={handleKeyDown}\n      onClick={disabled === true ? undefined : setContextValue}\n      tabIndex={-1}\n      aria-disabled={disabled}\n      role=\"option\"\n    >\n      {props.children}\n    </ListItem>\n  )\n})\nexport default MenuItem\n","import './index.css'\n\nimport MenuItem, { MenuItemProps } from '../MenuItem'\nimport { MenuListContext } from '../MenuList/MenuListContext'\nimport { ReactNode, useContext } from 'react'\nimport Icon from '../../Icon'\n\nexport type DropdownMenuItemProps = Omit<MenuItemProps, 'as'> & {\n  secondary?: ReactNode\n  contentFullWidth?: boolean\n}\n\n/**\n * DropdownSelectorの選択肢として使うMenuItem\n */\nexport default function DropdownMenuItem(props: DropdownMenuItemProps) {\n  const { value: ctxValue } = useContext(MenuListContext)\n  const isSelected = props.value === ctxValue\n  const { children, secondary, ...rest } = props\n\n  const fullWidthClassName = props.contentFullWidth\n    ? 'charcoal-dropdown-selector-menu-fullwidth'\n    : ''\n\n  return (\n    <MenuItem {...rest} aria-selected={isSelected}>\n      <div className={fullWidthClassName}>\n        <div\n          className={`charcoal-dropdown-selector-menu-item-container ${\n            fullWidthClassName\n          }`}\n        >\n          {isSelected && (\n            <Icon\n              className=\"charcoal-dropdown-selector-menu-item-icon\"\n              name=\"16/Check\"\n            />\n          )}\n          <span\n            className={`charcoal-dropdown-selector-menu-item ${fullWidthClassName}`}\n            data-selected={isSelected}\n          >\n            {children}\n          </span>\n        </div>\n        {secondary && (\n          <span className=\"charcoal-dropdown-selector-menu-secondary\">\n            {secondary}\n          </span>\n        )}\n      </div>\n    </MenuItem>\n  )\n}\n","import './index.css'\n\nimport MenuItem from '../MenuItem'\nimport { Divider } from '../Divider'\n\ntype MenuItemGroupChild = React.ReactElement<typeof MenuItem | typeof Divider>\n\nexport type MenuItemGroupProps = {\n  text: string\n  children: MenuItemGroupChild | MenuItemGroupChild[]\n}\n\nexport default function MenuItemGroup(props: MenuItemGroupProps) {\n  return (\n    <li className=\"charcoal-menu-item-group\" role=\"presentation\">\n      <span>{props.text}</span>\n      <ul role=\"group\">{props.children}</ul>\n    </li>\n  )\n}\n","import { createContext, useContext } from 'react'\nimport * as React from 'react'\nimport type { RadioGroupState } from '@react-stately/radio'\n\nconst RadioContext = createContext<RadioGroupState | null>(null)\n\ntype RadioProviderProps = React.PropsWithChildren<{\n  value: RadioGroupState\n}>\nexport const RadioProvider: React.FC<RadioProviderProps> = ({\n  value,\n  children,\n}) => {\n  return <RadioContext.Provider value={value}>{children}</RadioContext.Provider>\n}\nexport const useRadioContext = () => {\n  const state = useContext(RadioContext)\n\n  if (state === null)\n    throw new Error('`<RadioProvider>` is not likely mounted.')\n\n  return state\n}\n","import { ReactNode, forwardRef, memo, useMemo, useRef } from 'react'\nimport * as React from 'react'\nimport { useRadioGroupState } from '@react-stately/radio'\nimport {\n  AriaRadioGroupProps,\n  AriaRadioProps,\n  useRadio,\n  useRadioGroup,\n} from '@react-aria/radio'\nimport { RadioProvider, useRadioContext } from './RadioGroupContext'\nimport { useClassNames } from '../../_lib/useClassNames'\n\nimport './index.css'\n\ntype SegmentedControlItem = {\n  label: React.ReactNode\n  value: string\n  disabled?: boolean\n}\n\nexport type SegmentedControlProps = {\n  readonly id?: string\n  readonly name?: string\n  readonly disabled?: boolean\n  readonly readonly?: boolean\n  readonly required?: boolean\n  readonly className?: string\n  readonly uniformSegmentWidth?: boolean\n  readonly fullWidth?: boolean\n\n  readonly value?: string\n  readonly defaultValue?: string\n\n  readonly data: string[] | SegmentedControlItem[]\n\n  readonly onChange?: (value: string) => void\n}\n\nconst SegmentedControl = forwardRef<HTMLDivElement, SegmentedControlProps>(\n  function SegmentedControlInner(props, ref) {\n    const className = useClassNames(\n      'charcoal-segmented-control',\n      props.className,\n    )\n\n    const ariaRadioGroupProps = useMemo<AriaRadioGroupProps>(\n      () => ({\n        ...props,\n        isDisabled: props.disabled,\n        isReadOnly: props.readonly,\n        isRequired: props.required,\n        'aria-label': props.name,\n      }),\n      [props],\n    )\n    const state = useRadioGroupState(ariaRadioGroupProps)\n    const { radioGroupProps } = useRadioGroup(ariaRadioGroupProps, state)\n    const segmentedControlItems = useMemo<SegmentedControlItem[]>(() => {\n      return props.data.map((d) =>\n        typeof d === 'string' ? { value: d, label: d } : d,\n      )\n    }, [props.data])\n\n    return (\n      <div\n        ref={ref}\n        {...radioGroupProps}\n        className={className}\n        data-uniform-segment-width={props.uniformSegmentWidth}\n        data-full-width={props.fullWidth}\n      >\n        <RadioProvider value={state}>\n          {segmentedControlItems.map((item) => (\n            <Segmented\n              key={item.value}\n              value={item.value}\n              disabled={item.disabled}\n              uniformSegmentWidth={props.uniformSegmentWidth}\n            >\n              {item.label}\n            </Segmented>\n          ))}\n        </RadioProvider>\n      </div>\n    )\n  },\n)\n\nexport default memo(SegmentedControl)\n\ntype RadioProps = {\n  value: string\n  disabled?: boolean\n  children?: ReactNode\n  uniformSegmentWidth?: boolean\n  fullWidth?: boolean\n}\n\nconst Segmented = (props: RadioProps) => {\n  const state = useRadioContext()\n  const ref = useRef<HTMLInputElement>(null)\n  const ariaRadioProps = useMemo<AriaRadioProps>(\n    () => ({\n      value: props.value,\n      isDisabled: props.disabled,\n      children: props.children,\n    }),\n    [props],\n  )\n\n  const { inputProps, isDisabled, isSelected } = useRadio(\n    ariaRadioProps,\n    state,\n    ref,\n  )\n\n  return (\n    <label\n      className=\"charcoal-segmented-control-radio__label\"\n      aria-disabled={isDisabled || state.isReadOnly}\n      data-checked={isSelected}\n      data-uniform-segment-width={props.uniformSegmentWidth}\n      data-full-width={props.fullWidth}\n    >\n      <input\n        className=\"charcoal-segmented-control-radio__input\"\n        {...inputProps}\n        ref={ref}\n      />\n      {props.children}\n    </label>\n  )\n}\n","import './index.css'\n\nimport { forwardRef, memo, useCallback } from 'react'\nimport { useClassNames } from '../../../_lib/useClassNames'\n\ntype CharcoalCheckboxInputProps = {\n  invalid?: boolean\n  onChange?: (checked: boolean) => void\n  rounded?: boolean\n}\n\ntype InputProps = React.HTMLProps<HTMLInputElement>\n\nexport type CheckboxInputProps = CharcoalCheckboxInputProps &\n  Omit<InputProps, keyof CharcoalCheckboxInputProps | 'ref'>\n\nconst CheckboxInput = forwardRef<HTMLInputElement, CheckboxInputProps>(\n  function CheckboxInput(\n    { onChange, checked, invalid, className, rounded, ...props },\n    ref,\n  ) {\n    const handleChange = useCallback(\n      (e: React.ChangeEvent<HTMLInputElement>) => {\n        const el = e.currentTarget\n        onChange?.(el.checked)\n      },\n      [onChange],\n    )\n\n    const classNames = useClassNames('charcoal-checkbox-input', className)\n\n    return (\n      <input\n        className={classNames}\n        ref={ref}\n        type=\"checkbox\"\n        onChange={handleChange}\n        aria-invalid={invalid}\n        checked={checked}\n        data-rounded={rounded}\n        {...props}\n      />\n    )\n  },\n)\n\nexport default memo(CheckboxInput)\n","import React from 'react'\nimport { useClassNames } from '../../_lib/useClassNames'\n\nexport const CheckboxWithLabel = React.memo(function CheckboxWithLabel({\n  className,\n  children,\n  input,\n  id,\n  disabled,\n}: {\n  children: React.ReactNode\n  input: React.ReactNode\n  disabled?: boolean\n  className?: string\n  id?: string\n}) {\n  const classNames = useClassNames('charcoal-checkbox__label', className)\n  return (\n    <label htmlFor={id} aria-disabled={disabled} className={classNames}>\n      {input}\n      <div className=\"charcoal-checkbox__label_div\">{children}</div>\n    </label>\n  )\n})\n","import './index.css'\n\nimport { forwardRef, memo } from 'react'\nimport { useId } from '@react-aria/utils'\nimport CheckboxInput, { CheckboxInputProps } from './CheckboxInput'\nimport { CheckboxWithLabel } from './CheckboxWithLabel'\n\nexport type CheckboxProps = CheckboxInputProps\n\nconst Checkbox = forwardRef<HTMLInputElement, CheckboxInputProps>(\n  function Checkbox({ disabled, className, id, children, ...props }, ref) {\n    const htmlId = useId(id)\n    const noChildren = children === undefined\n    const input = (\n      <CheckboxInput\n        {...props}\n        className={noChildren ? className : undefined}\n        disabled={disabled}\n        id={htmlId}\n        ref={ref}\n      />\n    )\n    if (noChildren) {\n      return input\n    }\n    return (\n      <CheckboxWithLabel\n        className={className}\n        disabled={disabled}\n        id={htmlId}\n        input={input}\n      >\n        {children}\n      </CheckboxWithLabel>\n    )\n  },\n)\n\nexport default memo(Checkbox)\n","import React, { forwardRef, memo, useMemo, ForwardedRef, type JSX } from 'react'\nimport { useObjectRef } from '@react-aria/utils'\nimport Icon from '../Icon'\nimport { useClassNames } from '../../_lib/useClassNames'\n\nimport './index.css'\n\ntype SizeMap = {\n  S: 32\n  M: 40\n}\n\nexport type TagItemProps<T extends React.ElementType = 'button'> = {\n  label: string\n  translatedLabel?: string\n  bgColor?: string\n  bgImage?: string\n  status?: 'default' | 'active' | 'inactive'\n  size?: keyof SizeMap\n  /**\n   * The component used for root element.\n   * @type T extends React.ElementType = 'button'\n   */\n  component?: T\n} & Omit<React.ComponentPropsWithRef<T>, 'children'>\n\nconst TagItem = forwardRef<HTMLButtonElement, TagItemProps>(\n  function TagItemInner<T extends React.ElementType>(\n    {\n      component,\n      label,\n      translatedLabel,\n      bgColor = '#7ACCB1',\n      bgImage,\n      size = 'M',\n      status = 'default',\n      ...props\n    }: TagItemProps<T>,\n    _ref: ForwardedRef<HTMLButtonElement>,\n  ) {\n    const ref = useObjectRef(_ref)\n\n    const hasTranslatedLabel =\n      translatedLabel !== undefined && translatedLabel.length > 0\n    const className = useClassNames(\n      'charcoal-tag-item',\n      'charcoal-tag-item__bg',\n      props.className,\n    )\n\n    const bgVariant =\n      bgImage !== undefined && bgImage.length > 0 ? 'image' : 'color'\n    const bg = bgVariant === 'color' ? bgColor : `url(${bgImage ?? ''})`\n\n    const Component = useMemo(() => component ?? 'button', [component])\n\n    return (\n      <Component\n        {...props}\n        ref={ref}\n        className={className}\n        data-state={status}\n        data-bg-variant={bgVariant}\n        data-size={hasTranslatedLabel ? 'M' : size}\n        style={{ '--charcoal-tag-item-bg': bg }}\n      >\n        <div\n          className=\"charcoal-tag-item__label\"\n          data-has-translate={hasTranslatedLabel}\n        >\n          {hasTranslatedLabel && (\n            <span className=\"charcoal-tag-item__label__translated\">\n              {translatedLabel}\n            </span>\n          )}\n          <span\n            className=\"charcoal-tag-item__label__text\"\n            data-has-translate={hasTranslatedLabel}\n          >\n            {label}\n          </span>\n        </div>\n        {status === 'active' && <Icon name=\"16/Remove\" />}\n      </Component>\n    )\n  },\n) as <T extends React.ElementType = 'button'>(p: TagItemProps<T>) => JSX.Element\n\nexport default memo(TagItem)\n","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","// https://github.com/fernandopasik/react-children-utilities/blob/971d8a0324e6183734d8d1af9a65dbad18ab3d00/src/lib/onlyText.ts\n\nimport { Children, isValidElement, ReactElement, ReactNode } from 'react'\n\nexport const getFinalTitle = (\n  showTooltip: boolean,\n  title?: string,\n  children?: ReactNode,\n): string | undefined => {\n  // 1. 表示フラグが false なら即終了\n  if (!showTooltip) {\n    return undefined\n  }\n\n  // 2. タイトルの候補を取得\n  const resolvedTitle = title ?? onlyText(children)\n\n  // 3. resolvedTitle が falsy (undefined, null, \"\") なら終了\n  if (!resolvedTitle) {\n    return undefined\n  }\n\n  // 4. 有効な文字列のみを返す\n  return resolvedTitle\n}\n\nconst hasChildren = (\n  element: ReactNode,\n): element is ReactElement<{ children: ReactNode[] }> =>\n  isValidElement<{ children?: ReactNode[] }>(element) &&\n  Boolean(element.props.children)\n\nexport const childToString = (\n  child?: number | string | boolean | {} | null,\n): string => {\n  if (\n    typeof child === 'undefined' ||\n    child === null ||\n    typeof child === 'boolean'\n  ) {\n    return ''\n  }\n\n  if (JSON.stringify(child) === '{}') {\n    return ''\n  }\n\n  return (child as string | number).toString()\n}\n\nexport const onlyText = (children: ReactNode): string => {\n  if (!Array.isArray(children) && !isValidElement(children)) {\n    return childToString(children)\n  }\n\n  return Children.toArray(children).reduce(\n    (text: string, child: ReactNode): string => {\n      let newText = ''\n\n      if (isValidElement(child) && hasChildren(child)) {\n        newText = onlyText(child.props.children)\n      } else if (isValidElement(child) && !hasChildren(child)) {\n        newText = ''\n      } else {\n        newText = childToString(child)\n      }\n\n      return text.concat(newText)\n    },\n    '',\n  )\n}\n","import './index.css'\n\nimport { getFinalTitle } from './helper'\nimport { useClassNames } from '../../_lib/useClassNames'\nimport { CSSProperties } from 'react'\n\nexport type TextEllipsisProps = {\n  lineHeight?: number\n  lineLimit?: number\n  /**\n   * @default 'auto'\n   */\n  hyphens?: CSSProperties['hyphens']\n  /**\n   * html title属性を付与。false のときは付与せず、空文字のときは表示しない\n   * @default true\n   */\n  showTooltip?: boolean\n  /**\n   *\n   * @default false\n   * true: use white-space: nowrap if lineLimit is 1\n   * false: use -webkit-line-clamp if lineLimit is 1\n   */\n  useNowrap?: boolean\n} & React.ComponentPropsWithoutRef<'div'>\n\n/**\n * 複数行のテキストに表示行数制限を設けて`...`で省略する\n */\nexport default function TextEllipsis({\n  lineHeight,\n  lineLimit = 1,\n  children,\n  title,\n  hyphens = 'auto',\n  showTooltip = true,\n  useNowrap = false,\n  ...props\n}: TextEllipsisProps) {\n  'use memo'\n  const finalTitle = getFinalTitle(showTooltip, title, children)\n\n  const classNames = useClassNames('charcoal-text-ellipsis', props.className)\n  const hasLineHeight = lineHeight !== undefined\n\n  return (\n    <div\n      {...props}\n      className={classNames}\n      data-line-limit={lineLimit}\n      data-has-line-height={hasLineHeight}\n      {...(useNowrap ? { 'data-use-nowrap': useNowrap } : {})}\n      style={\n        {\n          ...(hasLineHeight && {\n            '--charcoal-text-ellipsis-line-height': `${lineHeight}px`,\n          }),\n          '--charcoal-text-ellipsis-line-limit': lineLimit,\n          hyphens,\n          ...props.style,\n        } satisfies React.CSSProperties\n      }\n      title={finalTitle}\n    >\n      {children}\n    </div>\n  )\n}\n","import { useDebugValue } from 'react'\nimport warning from 'warning'\nimport type { PageRangeDisplayed } from './PaginationContext'\n\nexport function usePaginationWindow(\n  page: number,\n  pageCount: number,\n  pageRangeDisplayed: PageRangeDisplayed = 7,\n) {\n  'use memo'\n  // ページャーのリンク生成例:\n  //\n  //     < [ 1 ] [*2*] [ 3 ] [ 4 ] [ 5 ] [ 6 ] [ 7 ] >\n  //\n  //     < [ 1 ] [ 2 ] [ 3 ] [*4*] [ 5 ] [ 6 ] [ 7 ] >\n  //\n  //     < [ 1 ]  ...  [ 4 ] [*5*] [ 6 ] [ 7 ] [ 8 ] >\n  //\n  //     < [ 1 ]  ...  [ 99 ] [*100*] [ 101 ] [ 102 ] [ 103 ] >\n  //\n  //     < [ 1 ]  ...  [ 99 ] [ 100 ] [ 101 ] [ 102 ] [*103*]\n  //\n  //       [*1*] [ 2 ] >\n  //\n  // デザインの意図: 前後移動時のカーソル移動を最小限にする。\n\n  if (process.env.NODE_ENV !== 'production') {\n    warning((page | 0) === page, `\\`page\\` must be integer (${page})`)\n    warning(\n      (pageCount | 0) === pageCount,\n      `\\`pageCount\\` must be integer (${pageCount})`,\n    )\n    warning(\n      pageRangeDisplayed === 5 || pageRangeDisplayed === 7,\n      `\\`pageRangeDisplayed\\` must be 5 or 7 (${pageRangeDisplayed})`,\n    )\n  }\n\n  const visibleFirstPage = 1\n  const visibleLastPage = Math.min(\n    pageCount,\n    Math.max(page + Math.floor(pageRangeDisplayed / 2), pageRangeDisplayed),\n  )\n\n  const window = (() => {\n    if (visibleLastPage <= pageRangeDisplayed) {\n      // 表示範囲が1-7ページなら省略は無い。\n      return Array.from(\n        { length: 1 + visibleLastPage - visibleFirstPage },\n        (_, i) => visibleFirstPage + i,\n      )\n    } else {\n      const start = visibleLastPage - (pageRangeDisplayed - 1) + 2\n      // 表示範囲が1-7ページを超えるなら、\n      // - 1ページ目は固定で表示する\n      // - 2ページ目から現在のページの直前までは省略する\n      return [\n        visibleFirstPage,\n        '...' as const,\n        ...Array.from(\n          { length: 1 + visibleLastPage - start },\n          (_, i) => start + i,\n        ),\n      ]\n    }\n  })()\n\n  useDebugValue(window)\n\n  return window\n}\n","import { createContext, useContext } from 'react'\n\nexport type Size = 'S' | 'M'\n\nexport type PageRangeDisplayed = 5 | 7\n\nexport type LinkComponentProps = {\n  href: string\n  className?: string\n  children?: React.ReactNode\n}\n\nexport type PaginationContextValue<T extends React.ElementType = 'a'> = {\n  page: number\n  pageCount: number\n  size: Size\n  isLinkMode: boolean\n  makeUrl?: (page: number) => string\n  LinkComponent: T\n  makeClickHandler: (value: number) => () => void\n  linkProps?: Omit<React.ComponentPropsWithoutRef<T>, 'href' | 'children'>\n}\n\nexport const PaginationContext = createContext<PaginationContextValue<\n  React.ElementType<LinkComponentProps>\n> | null>(null)\n\nexport function usePaginationContext<\n  T extends React.ElementType = 'a',\n>(): PaginationContextValue<T> {\n  const context = useContext(PaginationContext)\n  if (context == null) {\n    throw new Error(\n      'Pagination components must be used within a Pagination component',\n    )\n  }\n  return context as PaginationContextValue<T>\n}\n","import './index.css'\n\nimport { usePaginationWindow } from './helper'\nimport { useClassNames } from '../../_lib/useClassNames'\nimport IconButton, { IconButtonProps } from '../IconButton'\nimport {\n  PaginationContext,\n  usePaginationContext,\n  type LinkComponentProps,\n  type PaginationContextValue,\n  type PageRangeDisplayed,\n  type Size,\n} from './PaginationContext'\n\ntype NavButtonProps = {\n  direction: 'prev' | 'next'\n  ariaLabel: IconButtonProps['aria-label']\n}\n\nfunction NavButton({ direction, ariaLabel }: NavButtonProps) {\n  'use memo'\n  const {\n    page,\n    pageCount,\n    size,\n    isLinkMode,\n    makeUrl,\n    LinkComponent,\n    makeClickHandler,\n    linkProps,\n  } = usePaginationContext()\n\n  const isPrev = direction === 'prev'\n  const targetPage = isPrev\n    ? Math.max(1, page - 1)\n    : Math.min(pageCount, page + 1)\n  const disabled = isPrev ? page <= 1 : page >= pageCount\n  const navButtonClassName = useClassNames(\n    'charcoal-pagination-nav-button',\n    linkProps?.className,\n  )\n\n  return (\n    <IconButton\n      icon={isPrev ? '24/Prev' : '24/Next'}\n      size={size}\n      hidden={disabled}\n      aria-label={ariaLabel}\n      {...(isLinkMode && makeUrl\n        ? {\n            component: LinkComponent as 'a',\n            href: makeUrl(targetPage),\n            'aria-disabled': disabled,\n            ...linkProps,\n            className: navButtonClassName,\n          }\n        : {\n            disabled,\n            onClick: makeClickHandler(targetPage),\n            className: navButtonClassName,\n          })}\n    />\n  )\n}\n\nfunction PageItem({ value }: { value: number | string }) {\n  'use memo'\n  const {\n    page,\n    size,\n    isLinkMode,\n    makeUrl,\n    LinkComponent,\n    makeClickHandler,\n    linkProps,\n  } = usePaginationContext()\n  const pageItemClassName = useClassNames(\n    'charcoal-pagination-button',\n    linkProps?.className,\n  )\n\n  // 省略記号\n  if (value === '...') {\n    return (\n      <IconButton\n        icon=\"24/Dot\"\n        size={size}\n        disabled\n        className=\"charcoal-pagination-spacer\"\n        aria-hidden\n      />\n    )\n  }\n  // 現在ページ（クリック不可）\n  if (value === page) {\n    return (\n      <span className=\"charcoal-pagination-button\" aria-current=\"page\">\n        {value}\n      </span>\n    )\n  }\n  if (typeof value !== 'number') return null\n  // リンクモード: ページへのリンク\n  if (isLinkMode && makeUrl) {\n    return (\n      <LinkComponent\n        href={makeUrl(value)}\n        {...linkProps}\n        className={pageItemClassName}\n      >\n        {value}\n      </LinkComponent>\n    )\n  }\n  // ボタンモード: クリックでページ遷移\n  return (\n    <button\n      type=\"button\"\n      className=\"charcoal-pagination-button\"\n      onClick={makeClickHandler(value)}\n    >\n      {value}\n    </button>\n  )\n}\n\ninterface PaginationCommonProps {\n  page: number\n  pageCount: number\n  pageRangeDisplayed?: PageRangeDisplayed\n  size?: Size\n  ariaLabelPrev?: string\n  ariaLabelNext?: string\n}\n\ntype NavProps = Omit<React.ComponentPropsWithoutRef<'nav'>, 'onChange'>\n\n/**\n * Pagination component. Use either `onChange` (button mode) or `makeUrl` (link mode).\n *\n * @example\n * // Button mode - for client-side state\n * <Pagination page={1} pageCount={10} onChange={setPage} />\n *\n * @example\n * // Link mode - for server routing / static pages\n * <Pagination page={1} pageCount={10} makeUrl={(p) => `?page=${p}`} />\n *\n * @example\n * // Link mode with custom component (e.g. Next.js Link)\n * <Pagination page={1} pageCount={10} makeUrl={(p) => `?page=${p}`} component={Link} />\n *\n * @example\n * // Link mode with linkProps (e.g. Next.js scroll)\n * <Pagination page={1} pageCount={10} makeUrl={(p) => `?page=${p}`} component={Link} linkProps={{ scroll: 'marker' }} />\n */\nexport type PaginationProps<T extends React.ElementType = 'a'> =\n  PaginationCommonProps &\n    NavProps &\n    (\n      | {\n          onChange(newPage: number): void\n          makeUrl?: never\n          component?: never\n          linkProps?: undefined\n        }\n      | {\n          makeUrl(page: number): string\n          onChange?: never\n          /**\n           * The component used for link elements. Receives `href`, `className`, and `children`.\n           * @default 'a'\n           */\n          component?: T\n          /**\n           * Additional props passed to all link elements (e.g. Next.js Link's scroll, prefetch).\n           */\n          linkProps?: Omit<\n            React.ComponentPropsWithoutRef<T>,\n            'href' | 'children'\n          >\n        }\n    )\n\nexport default function Pagination<T extends React.ElementType = 'a'>({\n  page,\n  pageCount,\n  pageRangeDisplayed,\n  size = 'M',\n  onChange,\n  makeUrl,\n  component: LinkComponent = 'a' as T,\n  linkProps,\n  className,\n  ariaLabelNext = 'Next',\n  ariaLabelPrev = 'Previous',\n  ...navProps\n}: PaginationProps<T>) {\n  'use memo'\n  const window = usePaginationWindow(page, pageCount, pageRangeDisplayed)\n  const isLinkMode = makeUrl !== undefined\n  const makeClickHandler = (value: number) => () => onChange?.(value)\n  const classNames = useClassNames('charcoal-pagination', className)\n\n  const contextValue = {\n    page,\n    pageCount,\n    size,\n    isLinkMode,\n    makeUrl,\n    LinkComponent,\n    makeClickHandler,\n    linkProps,\n  }\n\n  return (\n    <PaginationContext.Provider\n      value={\n        contextValue as PaginationContextValue<\n          React.ElementType<LinkComponentProps>\n        >\n      }\n    >\n      <nav\n        data-size={size}\n        aria-label=\"Pagination\"\n        {...navProps}\n        className={classNames}\n      >\n        <NavButton direction=\"prev\" ariaLabel={ariaLabelPrev} />\n        {window.map((p) => (\n          <PageItem key={p} value={p} />\n        ))}\n        <NavButton direction=\"next\" ariaLabel={ariaLabelNext} />\n      </nav>\n    </PaginationContext.Provider>\n  )\n}\n"],"mappings":";28BAGA,SAAgBI,EAAmBC,EAA6B,CAE9D,IAAMC,EAAoBC,SAASL,EAAAA,QAAQM,MAAM,IAAI,CAAC,GAAI,GAAG,CAC7D,OAAOC,OAAOC,SAASJ,EAAkB,CACrCA,GAAqBD,EACrB,GAGN,MAAaL,EAAcI,EAAmB,GAAG,CAAGD,EAAAA,SAAWF,EAAAA,YCH/D,SAAgBgB,EAAiB,CAAEF,YAAmC,CACpE,OACE,EAAA,EAAA,KAAC,EAAA,CAAA,UACC,EAAA,EAAA,KAAC,EAAA,gBAAA,CAAiBA,WAAAA,CAA0B,CAAA,CAChC,CCVlB,MAAaM,EAAoB,iBACpBC,EAAyB,QAEhCC,EAAkB,IAAIC,OAAO,YAAY,CAM/C,SAAgBC,EAAgBC,EAAa,CAC3C,GAAI,CAACH,EAAgBI,KAAKD,EAAI,CAC5B,MAAUE,MAAM,mBAAmBF,EAAG,wBAAyB,CAOnE,MAAaG,GACVC,EAAeR,IACfS,GAA8B,CAC7BN,EAAgBK,EAAK,CACjBC,IAAUC,IAAAA,GAGZ,OAAOC,SAASC,gBAAgBC,QAAQL,GAFxCG,SAASC,gBAAgBC,QAAQL,GAAQC,GAS/C,SAAgBK,EAGdL,EAAUD,EAAU,CACpB,MAAO,cAAcA,GAAQR,EAAsB,IAAKS,EAAK,IAM/D,SAAgBS,EAA+CT,EAAU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