smarthr-ui 97.0.0 → 98.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (208) hide show
  1. package/lib/components/AppHeader/components/common/AppLauncherFeatures.cjs +1 -1
  2. package/lib/components/AppHeader/components/common/AppLauncherFeatures.js +1 -1
  3. package/lib/components/AppHeader/components/common/AppLauncherSortDropdown.cjs +1 -1
  4. package/lib/components/AppHeader/components/common/AppLauncherSortDropdown.js +1 -1
  5. package/lib/components/AppHeader/components/desktop/AppLauncher.cjs +5 -5
  6. package/lib/components/AppHeader/components/desktop/AppLauncher.cjs.map +1 -1
  7. package/lib/components/AppHeader/components/desktop/AppLauncher.js +5 -5
  8. package/lib/components/AppHeader/components/desktop/AppLauncher.js.map +1 -1
  9. package/lib/components/AppHeader/components/desktop/DesktopHeader.cjs +1 -1
  10. package/lib/components/AppHeader/components/desktop/DesktopHeader.js +1 -1
  11. package/lib/components/AppHeader/components/desktop/ReleaseNotesDropdown.cjs +1 -1
  12. package/lib/components/AppHeader/components/desktop/ReleaseNotesDropdown.js +1 -1
  13. package/lib/components/AppHeader/components/desktop/UserInfo.cjs +1 -1
  14. package/lib/components/AppHeader/components/desktop/UserInfo.js +1 -1
  15. package/lib/components/AppHeader/components/mobile/AppLauncher.cjs +1 -1
  16. package/lib/components/AppHeader/components/mobile/AppLauncher.js +1 -1
  17. package/lib/components/AppHeader/components/mobile/AppLauncherFilterDropdown.cjs +1 -1
  18. package/lib/components/AppHeader/components/mobile/AppLauncherFilterDropdown.js +1 -1
  19. package/lib/components/AppHeader/components/mobile/Help.cjs +1 -1
  20. package/lib/components/AppHeader/components/mobile/Help.js +1 -1
  21. package/lib/components/AppHeader/components/mobile/LanguageSelector.cjs +1 -1
  22. package/lib/components/AppHeader/components/mobile/LanguageSelector.js +1 -1
  23. package/lib/components/AppHeader/components/mobile/Menu.cjs +1 -1
  24. package/lib/components/AppHeader/components/mobile/Menu.js +1 -1
  25. package/lib/components/AppHeader/components/mobile/MenuAccordion.cjs +1 -1
  26. package/lib/components/AppHeader/components/mobile/MenuAccordion.js +1 -1
  27. package/lib/components/AppHeader/components/mobile/MenuDialog.cjs +2 -2
  28. package/lib/components/AppHeader/components/mobile/MenuDialog.js +2 -2
  29. package/lib/components/AppHeader/components/mobile/MenuSubHeading.cjs +1 -1
  30. package/lib/components/AppHeader/components/mobile/MenuSubHeading.js +1 -1
  31. package/lib/components/AppHeader/components/mobile/ReleaseNote.cjs +1 -1
  32. package/lib/components/AppHeader/components/mobile/ReleaseNote.js +1 -1
  33. package/lib/components/AppHeader/components/mobile/UserInfo.cjs +2 -2
  34. package/lib/components/AppHeader/components/mobile/UserInfo.js +2 -2
  35. package/lib/components/Browser/Browser.cjs +11 -7
  36. package/lib/components/Browser/Browser.cjs.map +1 -1
  37. package/lib/components/Browser/Browser.js +12 -8
  38. package/lib/components/Browser/Browser.js.map +1 -1
  39. package/lib/components/Calendar/Calendar.cjs +1 -1
  40. package/lib/components/Calendar/Calendar.js +1 -1
  41. package/lib/components/Calendar/CalendarTable.cjs +1 -1
  42. package/lib/components/Calendar/CalendarTable.js +1 -1
  43. package/lib/components/Calendar/YearPicker.cjs +1 -1
  44. package/lib/components/Calendar/YearPicker.js +1 -1
  45. package/lib/components/Combobox/MultiCombobox/MultiCombobox.cjs +122 -134
  46. package/lib/components/Combobox/MultiCombobox/MultiCombobox.cjs.map +1 -1
  47. package/lib/components/Combobox/MultiCombobox/MultiCombobox.js +123 -135
  48. package/lib/components/Combobox/MultiCombobox/MultiCombobox.js.map +1 -1
  49. package/lib/components/Combobox/MultiCombobox/MultiSelectedItem.cjs +1 -1
  50. package/lib/components/Combobox/MultiCombobox/MultiSelectedItem.js +1 -1
  51. package/lib/components/Combobox/SingleCombobox/SingleCombobox.cjs +96 -46
  52. package/lib/components/Combobox/SingleCombobox/SingleCombobox.cjs.map +1 -1
  53. package/lib/components/Combobox/SingleCombobox/SingleCombobox.js +98 -48
  54. package/lib/components/Combobox/SingleCombobox/SingleCombobox.js.map +1 -1
  55. package/lib/components/Combobox/useListbox.cjs +1 -1
  56. package/lib/components/Combobox/useListbox.js +1 -1
  57. package/lib/components/Combobox/useOptions.cjs +3 -1
  58. package/lib/components/Combobox/useOptions.cjs.map +1 -1
  59. package/lib/components/Combobox/useOptions.js +4 -2
  60. package/lib/components/Combobox/useOptions.js.map +1 -1
  61. package/lib/components/Dialog/ControlledActionDialog/ActionDialogContentInner.cjs +3 -3
  62. package/lib/components/Dialog/ControlledActionDialog/ActionDialogContentInner.cjs.map +1 -1
  63. package/lib/components/Dialog/ControlledActionDialog/ActionDialogContentInner.js +3 -3
  64. package/lib/components/Dialog/ControlledActionDialog/ActionDialogContentInner.js.map +1 -1
  65. package/lib/components/Dialog/ControlledFormDialog/FormDialogContentInner.cjs +3 -3
  66. package/lib/components/Dialog/ControlledFormDialog/FormDialogContentInner.cjs.map +1 -1
  67. package/lib/components/Dialog/ControlledFormDialog/FormDialogContentInner.js +3 -3
  68. package/lib/components/Dialog/ControlledFormDialog/FormDialogContentInner.js.map +1 -1
  69. package/lib/components/Dialog/ControlledMessageDialog/MessageDialogContentInner.cjs +1 -1
  70. package/lib/components/Dialog/ControlledMessageDialog/MessageDialogContentInner.js +1 -1
  71. package/lib/components/Dialog/ControlledStepFormDialog/ControlledStepFormDialog.cjs +1 -1
  72. package/lib/components/Dialog/ControlledStepFormDialog/ControlledStepFormDialog.js +1 -1
  73. package/lib/components/Dialog/ControlledStepFormDialog/StepFormDialogContentInner.cjs +2 -2
  74. package/lib/components/Dialog/ControlledStepFormDialog/StepFormDialogContentInner.cjs.map +1 -1
  75. package/lib/components/Dialog/ControlledStepFormDialog/StepFormDialogContentInner.js +2 -2
  76. package/lib/components/Dialog/ControlledStepFormDialog/StepFormDialogContentInner.js.map +1 -1
  77. package/lib/components/Dialog/DialogContentResponseStatusMessage.cjs +3 -8
  78. package/lib/components/Dialog/DialogContentResponseStatusMessage.cjs.map +1 -1
  79. package/lib/components/Dialog/DialogContentResponseStatusMessage.d.ts +1 -1
  80. package/lib/components/Dialog/DialogContentResponseStatusMessage.js +3 -8
  81. package/lib/components/Dialog/DialogContentResponseStatusMessage.js.map +1 -1
  82. package/lib/components/Dialog/FocusTrap.cjs +4 -1
  83. package/lib/components/Dialog/FocusTrap.cjs.map +1 -1
  84. package/lib/components/Dialog/FocusTrap.js +4 -1
  85. package/lib/components/Dialog/FocusTrap.js.map +1 -1
  86. package/lib/components/Dialog/ModelessDialog/ModelessDialog.cjs +1 -1
  87. package/lib/components/Dialog/ModelessDialog/ModelessDialog.js +1 -1
  88. package/lib/components/DropZone/DropZone.cjs +1 -1
  89. package/lib/components/DropZone/DropZone.js +1 -1
  90. package/lib/components/Dropdown/Dropdown.cjs +36 -34
  91. package/lib/components/Dropdown/Dropdown.cjs.map +1 -1
  92. package/lib/components/Dropdown/Dropdown.js +37 -35
  93. package/lib/components/Dropdown/Dropdown.js.map +1 -1
  94. package/lib/components/Dropdown/DropdownMenuButton/DropdownMenuButton.cjs +1 -1
  95. package/lib/components/Dropdown/DropdownMenuButton/DropdownMenuButton.js +1 -1
  96. package/lib/components/Dropdown/FilterDropdown/FilterDropdown.cjs +3 -5
  97. package/lib/components/Dropdown/FilterDropdown/FilterDropdown.cjs.map +1 -1
  98. package/lib/components/Dropdown/FilterDropdown/FilterDropdown.d.ts +1 -1
  99. package/lib/components/Dropdown/FilterDropdown/FilterDropdown.js +3 -5
  100. package/lib/components/Dropdown/FilterDropdown/FilterDropdown.js.map +1 -1
  101. package/lib/components/Dropdown/SortDropdown/useSortDropdown.cjs +1 -1
  102. package/lib/components/Dropdown/SortDropdown/useSortDropdown.js +1 -1
  103. package/lib/components/ErrorScreen/AuthErrorScreen.cjs +1 -1
  104. package/lib/components/ErrorScreen/AuthErrorScreen.js +1 -1
  105. package/lib/components/ErrorScreen/ForbiddenErrorScreen.cjs +1 -1
  106. package/lib/components/ErrorScreen/ForbiddenErrorScreen.js +1 -1
  107. package/lib/components/ErrorScreen/NotFoundErrorScreen.cjs +1 -1
  108. package/lib/components/ErrorScreen/NotFoundErrorScreen.js +1 -1
  109. package/lib/components/ErrorScreen/UnauthorizedErrorScreen.cjs +1 -1
  110. package/lib/components/ErrorScreen/UnauthorizedErrorScreen.js +1 -1
  111. package/lib/components/FormControl/FormControl.cjs +2 -22
  112. package/lib/components/FormControl/FormControl.cjs.map +1 -1
  113. package/lib/components/FormControl/FormControl.js +2 -22
  114. package/lib/components/FormControl/FormControl.js.map +1 -1
  115. package/lib/components/Header/AppLauncher/AppLauncher.cjs +1 -1
  116. package/lib/components/Header/AppLauncher/AppLauncher.js +1 -1
  117. package/lib/components/Header/LanguageSwitcher/LanguageSwitcher.cjs +1 -1
  118. package/lib/components/Header/LanguageSwitcher/LanguageSwitcher.js +1 -1
  119. package/lib/components/Icon/OpenInNewTabIcon.cjs +1 -1
  120. package/lib/components/Icon/OpenInNewTabIcon.js +1 -1
  121. package/lib/components/InformationPanel/InformationPanel.cjs +1 -1
  122. package/lib/components/InformationPanel/InformationPanel.js +1 -1
  123. package/lib/components/Input/SearchInput/SearchInputIcon.cjs +1 -1
  124. package/lib/components/Input/SearchInput/SearchInputIcon.js +1 -1
  125. package/lib/components/InputFile/InputFileMultiplyAppendable.cjs +1 -1
  126. package/lib/components/InputFile/InputFileMultiplyAppendable.js +1 -1
  127. package/lib/components/InputFile/InputFileNative.cjs +1 -1
  128. package/lib/components/InputFile/InputFileNative.js +1 -1
  129. package/lib/components/Layout/Cluster/Cluster.cjs +0 -1
  130. package/lib/components/Layout/Cluster/Cluster.cjs.map +1 -1
  131. package/lib/components/Layout/Cluster/Cluster.js +0 -1
  132. package/lib/components/Layout/Cluster/Cluster.js.map +1 -1
  133. package/lib/components/Layout/Container/Container.cjs +1 -5
  134. package/lib/components/Layout/Container/Container.cjs.map +1 -1
  135. package/lib/components/Layout/Container/Container.js +1 -5
  136. package/lib/components/Layout/Container/Container.js.map +1 -1
  137. package/lib/components/Layout/Stack/Stack.cjs +22 -22
  138. package/lib/components/Layout/Stack/Stack.cjs.map +1 -1
  139. package/lib/components/Layout/Stack/Stack.js +22 -22
  140. package/lib/components/Layout/Stack/Stack.js.map +1 -1
  141. package/lib/components/Loader/LoaderSpinner.cjs +1 -1
  142. package/lib/components/Loader/LoaderSpinner.js +1 -1
  143. package/lib/components/Pagination/Pagination.cjs +1 -1
  144. package/lib/components/Pagination/Pagination.js +1 -1
  145. package/lib/components/Pagination/PaginationItemButton.cjs +1 -1
  146. package/lib/components/Pagination/PaginationItemButton.js +1 -1
  147. package/lib/components/SideNav/SideNav.cjs +3 -22
  148. package/lib/components/SideNav/SideNav.cjs.map +1 -1
  149. package/lib/components/SideNav/SideNav.d.ts +2 -9
  150. package/lib/components/SideNav/SideNav.js +4 -23
  151. package/lib/components/SideNav/SideNav.js.map +1 -1
  152. package/lib/components/SideNav/SideNavContext.cjs +11 -0
  153. package/lib/components/SideNav/SideNavContext.cjs.map +1 -0
  154. package/lib/components/SideNav/SideNavContext.d.ts +7 -0
  155. package/lib/components/SideNav/SideNavContext.js +8 -0
  156. package/lib/components/SideNav/SideNavContext.js.map +1 -0
  157. package/lib/components/SideNav/SideNavItemButton.cjs +12 -7
  158. package/lib/components/SideNav/SideNavItemButton.cjs.map +1 -1
  159. package/lib/components/SideNav/SideNavItemButton.d.ts +5 -11
  160. package/lib/components/SideNav/SideNavItemButton.js +12 -7
  161. package/lib/components/SideNav/SideNavItemButton.js.map +1 -1
  162. package/lib/components/Table/Th.cjs +2 -2
  163. package/lib/components/Table/Th.cjs.map +1 -1
  164. package/lib/components/Table/Th.d.ts +0 -2
  165. package/lib/components/Table/Th.js +2 -2
  166. package/lib/components/Table/Th.js.map +1 -1
  167. package/lib/components/Table/ThCheckbox.cjs +1 -1
  168. package/lib/components/Table/ThCheckbox.js +1 -1
  169. package/lib/components/Table/ThSortButton.cjs +5 -6
  170. package/lib/components/Table/ThSortButton.cjs.map +1 -1
  171. package/lib/components/Table/ThSortButton.d.ts +1 -6
  172. package/lib/components/Table/ThSortButton.js +5 -6
  173. package/lib/components/Table/ThSortButton.js.map +1 -1
  174. package/lib/components/WarekiPicker/WarekiPicker.cjs +1 -1
  175. package/lib/components/WarekiPicker/WarekiPicker.js +1 -1
  176. package/lib/index.cjs +1 -6
  177. package/lib/index.cjs.map +1 -1
  178. package/lib/index.d.ts +0 -1
  179. package/lib/index.js +1 -4
  180. package/lib/index.js.map +1 -1
  181. package/lib/intl/Localizer.cjs +5 -1
  182. package/lib/intl/Localizer.cjs.map +1 -1
  183. package/lib/intl/Localizer.d.ts +1 -1
  184. package/lib/intl/Localizer.js +5 -1
  185. package/lib/intl/Localizer.js.map +1 -1
  186. package/metadata.json +1 -1
  187. package/package.json +1 -1
  188. package/smarthr-ui.css +0 -94
  189. package/lib/hooks/useDecorators.cjs +0 -18
  190. package/lib/hooks/useDecorators.cjs.map +0 -1
  191. package/lib/hooks/useDecorators.d.ts +0 -6
  192. package/lib/hooks/useDecorators.js +0 -16
  193. package/lib/hooks/useDecorators.js.map +0 -1
  194. package/lib/hooks/useDevice/DeviceProvider.cjs +0 -37
  195. package/lib/hooks/useDevice/DeviceProvider.cjs.map +0 -1
  196. package/lib/hooks/useDevice/DeviceProvider.d.ts +0 -4
  197. package/lib/hooks/useDevice/DeviceProvider.js +0 -35
  198. package/lib/hooks/useDevice/DeviceProvider.js.map +0 -1
  199. package/lib/hooks/useDevice/index.cjs +0 -10
  200. package/lib/hooks/useDevice/index.cjs.map +0 -1
  201. package/lib/hooks/useDevice/index.d.ts +0 -2
  202. package/lib/hooks/useDevice/index.js +0 -3
  203. package/lib/hooks/useDevice/index.js.map +0 -1
  204. package/lib/hooks/useDevice/useDevice.cjs +0 -11
  205. package/lib/hooks/useDevice/useDevice.cjs.map +0 -1
  206. package/lib/hooks/useDevice/useDevice.d.ts +0 -4
  207. package/lib/hooks/useDevice/useDevice.js +0 -8
  208. package/lib/hooks/useDevice/useDevice.js.map +0 -1
@@ -5,7 +5,7 @@ import { useResponseStatus } from '../../../hooks/useResponseStatus.js';
5
5
  import { Button } from '../../Button/Button.js';
6
6
  import '../../Button/AnchorButton.js';
7
7
  import '../../Button/UnstyledButton.js';
8
- import { Stack } from '../../Layout/Stack/Stack.js';
8
+ import '../../Layout/Stack/Stack.js';
9
9
  import { Cluster } from '../../Layout/Cluster/Cluster.js';
10
10
  import '../../Layout/Reel/Reel.js';
11
11
  import '../../Layout/Sidebar/Sidebar.js';
@@ -73,7 +73,7 @@ const StepFormDialogContentInner = ({ children, heading, activeStep, contentBgCo
73
73
  const calcedResponseStatus = useResponseStatus(responseStatus);
74
74
  return (
75
75
  // eslint-disable-next-line smarthr/a11y-prohibit-sectioning-content-in-form
76
- jsx(Section, { children: jsx("form", { onSubmit: handleSubmitAction, children: jsxs("div", { className: classNames.wrapper, children: [jsx(DialogHeading, { id: heading.id, sub: heading.sub ? `${heading.sub}${stepText}` : undefined, text: heading.sub ? heading.text : `${heading.text}${stepText}` }), jsx(DialogBody, { contentPadding: contentPadding, contentBgColor: contentBgColor, ref: scrollerRef, children: children }), jsxs(Stack, { gap: 0.5, className: classNames.actionArea, children: [jsxs(Cluster, { justify: "space-between", gap: { row: 0.5, column: 2 }, children: [!backButton.hidden && activeStep > 1 && (jsx(Button, { onClick: handleBackAction, variant: backButton.theme, disabled: backButton.disabled || calcedResponseStatus.isProcessing, className: "smarthr-ui-Dialog-backButton", children: backButton.text })), jsxs(Cluster, { gap: BUTTON_COLUMN_GAP, className: classNames.buttonArea, children: [!closeButton.hidden && (jsx(Button, { onClick: handleCloseAction, variant: closeButton.theme, disabled: closeButton.disabled || calcedResponseStatus.isProcessing, className: "smarthr-ui-Dialog-closeButton", children: closeButton.text })), !submitButton.hidden && (jsx(Button, { type: "submit", variant: submitButton.theme, disabled: submitButton.disabled, loading: calcedResponseStatus.isProcessing, className: "smarthr-ui-Dialog-actionButton", children: submitButton.text }))] })] }), jsx(DialogContentResponseStatusMessage, { responseStatus: calcedResponseStatus, className: classNames.message })] })] }) }) }));
76
+ jsx(Section, { children: jsx("form", { onSubmit: handleSubmitAction, children: jsxs("div", { className: classNames.wrapper, children: [jsx(DialogHeading, { id: heading.id, sub: heading.sub ? `${heading.sub}${stepText}` : undefined, text: heading.sub ? heading.text : `${heading.text}${stepText}` }), jsx(DialogBody, { contentPadding: contentPadding, contentBgColor: contentBgColor, ref: scrollerRef, children: children }), jsxs("div", { className: classNames.actionArea, children: [jsxs(Cluster, { justify: "space-between", gap: { row: 0.5, column: 2 }, children: [!backButton.hidden && activeStep > 1 && (jsx(Button, { onClick: handleBackAction, variant: backButton.theme, disabled: backButton.disabled || calcedResponseStatus.isProcessing, className: "smarthr-ui-Dialog-backButton", children: backButton.text })), jsxs(Cluster, { gap: BUTTON_COLUMN_GAP, className: classNames.buttonArea, children: [!closeButton.hidden && (jsx(Button, { onClick: handleCloseAction, variant: closeButton.theme, disabled: closeButton.disabled || calcedResponseStatus.isProcessing, className: "smarthr-ui-Dialog-closeButton", children: closeButton.text })), !submitButton.hidden && (jsx(Button, { type: "submit", variant: submitButton.theme, disabled: submitButton.disabled, loading: calcedResponseStatus.isProcessing, className: "smarthr-ui-Dialog-actionButton", children: submitButton.text }))] })] }), jsx(DialogContentResponseStatusMessage, { responseStatus: calcedResponseStatus, className: classNames.message })] })] }) }) }));
77
77
  };
78
78
 
79
79
  export { StepFormDialogContentInner };
@@ -1 +1 @@
1
- {"version":3,"file":"StepFormDialogContentInner.js","sources":["../../../../src/components/Dialog/ControlledStepFormDialog/StepFormDialogContentInner.tsx"],"sourcesContent":["'use client'\n\nimport {\n type FC,\n type FormEvent,\n type PropsWithChildren,\n useCallback,\n useContext,\n useMemo,\n} from 'react'\n\nimport { type ResponseStatus, useResponseStatus } from '../../../hooks/useResponseStatus'\nimport { Button } from '../../Button'\nimport { Cluster, Stack } from '../../Layout'\nimport { Section } from '../../SectioningContent'\nimport { DialogBody, type Props as DialogBodyProps } from '../DialogBody'\nimport { DialogContentResponseStatusMessage } from '../DialogContentResponseStatusMessage'\nimport { DialogHeading, type Props as DialogHeadingProps } from '../DialogHeading'\nimport { dialogContentInner } from '../dialogInnerStyle'\n\nimport { StepFormDialogContext, type StepItem } from './StepFormDialogProvider'\n\nimport type { useStepFormDialogButton } from './useStepFormDialogButton'\n\ntype StepFormHelpers = {\n /** 指定したステップに移動する関数 */\n goto: (nextStep: StepItem) => void\n /** ダイアログを閉じる関数 */\n close: () => void\n /** 現在のステップ情報 */\n currentStep: StepItem\n}\n\ntype CommonButtonType = ReturnType<typeof useStepFormDialogButton>\n\nexport type AbstractProps = PropsWithChildren<\n DialogBodyProps & {\n /** ダイアログタイトル */\n heading: DialogHeadingProps\n /** 現在のStepNo */\n activeStep: number\n /** submitボタン */\n submitButton: CommonButtonType\n /**\n * アクションボタンをクリックした時に発火するコールバック関数\n * @param e フォームイベント\n * @param helpers ステップ操作用のヘルパー関数群\n */\n onSubmit: (e: FormEvent<HTMLFormElement>, helpers: StepFormHelpers) => void\n /** キャンセルボタン */\n closeButton: CommonButtonType\n /** 戻るボタン */\n backButton: CommonButtonType\n }\n>\n\nexport type StepFormDialogContentInnerProps = AbstractProps & {\n firstStep: StepItem\n onClickClose: () => void\n responseStatus?: ResponseStatus\n /** ステップの総数 */\n stepLength: number\n onClickBack?: () => void\n}\n\nconst BUTTON_COLUMN_GAP = {\n row: 0.5,\n column: 1,\n} as const\n\nexport const StepFormDialogContentInner: FC<StepFormDialogContentInnerProps> = ({\n children,\n heading,\n activeStep,\n contentBgColor,\n contentPadding,\n submitButton,\n closeButton,\n backButton,\n stepLength,\n firstStep,\n onSubmit,\n onClickClose,\n responseStatus,\n onClickBack,\n}) => {\n const { currentStep, stepQueue, setCurrentStep, scrollerRef } = useContext(StepFormDialogContext)\n\n const handleCloseAction = useCallback(() => {\n onClickClose()\n setTimeout(() => {\n // HINT: ダイアログが閉じるtransitionが完了してから初期化をしている\n stepQueue.current = []\n setCurrentStep(firstStep)\n }, 300)\n }, [firstStep, stepQueue, setCurrentStep, onClickClose])\n\n const changeCurrentStep = useCallback(\n (step: Parameters<typeof setCurrentStep>[0]) => {\n setCurrentStep(step)\n\n // HINT: stepが切り替わるごとにbodyのscroll位置を先頭に戻す処理\n if (scrollerRef.current) {\n scrollerRef.current.scroll(0, 0)\n }\n },\n [setCurrentStep, scrollerRef],\n )\n\n const handleSubmitAction = useCallback(\n (e: FormEvent<HTMLFormElement>) => {\n e.preventDefault()\n // HINT: React Potals などで擬似的にformがネストしている場合など、stopPropagationを実行しないと\n // 親formが意図せずsubmitされてしまう場合がある\n e.stopPropagation()\n\n const helpers: StepFormHelpers = {\n goto: (nextStep: StepItem) => {\n stepQueue.current.push(currentStep)\n changeCurrentStep(nextStep)\n },\n close: handleCloseAction,\n currentStep,\n }\n\n onSubmit(e, helpers)\n },\n [currentStep, stepQueue, onSubmit, handleCloseAction, changeCurrentStep],\n )\n const handleBackAction = useCallback(() => {\n onClickBack?.()\n\n changeCurrentStep(stepQueue.current.pop() ?? firstStep)\n }, [firstStep, stepQueue, onClickBack, changeCurrentStep])\n\n const classNames = useMemo(() => {\n const { wrapper, actionArea, buttonArea, message } = dialogContentInner()\n\n return {\n wrapper: wrapper(),\n actionArea: actionArea(),\n buttonArea: buttonArea(),\n message: message(),\n }\n }, [])\n\n const stepText = stepLength > 1 ? `(${activeStep}/${stepLength})` : ''\n\n const calcedResponseStatus = useResponseStatus(responseStatus)\n\n return (\n // eslint-disable-next-line smarthr/a11y-prohibit-sectioning-content-in-form\n <Section>\n <form onSubmit={handleSubmitAction}>\n <div className={classNames.wrapper}>\n <DialogHeading\n id={heading.id}\n sub={heading.sub ? `${heading.sub}${stepText}` : undefined}\n text={heading.sub ? heading.text : `${heading.text}${stepText}`}\n />\n <DialogBody\n contentPadding={contentPadding}\n contentBgColor={contentBgColor}\n ref={scrollerRef}\n >\n {children}\n </DialogBody>\n <Stack gap={0.5} className={classNames.actionArea}>\n <Cluster justify=\"space-between\" gap={{ row: 0.5, column: 2 }}>\n {!backButton.hidden && activeStep > 1 && (\n <Button\n onClick={handleBackAction}\n variant={backButton.theme}\n disabled={backButton.disabled || calcedResponseStatus.isProcessing}\n className=\"smarthr-ui-Dialog-backButton\"\n >\n {backButton.text}\n </Button>\n )}\n <Cluster gap={BUTTON_COLUMN_GAP} className={classNames.buttonArea}>\n {!closeButton.hidden && (\n <Button\n onClick={handleCloseAction}\n variant={closeButton.theme}\n disabled={closeButton.disabled || calcedResponseStatus.isProcessing}\n className=\"smarthr-ui-Dialog-closeButton\"\n >\n {closeButton.text}\n </Button>\n )}\n {!submitButton.hidden && (\n <Button\n type=\"submit\"\n variant={submitButton.theme}\n disabled={submitButton.disabled}\n loading={calcedResponseStatus.isProcessing}\n className=\"smarthr-ui-Dialog-actionButton\"\n >\n {submitButton.text}\n </Button>\n )}\n </Cluster>\n </Cluster>\n <DialogContentResponseStatusMessage\n responseStatus={calcedResponseStatus}\n className={classNames.message}\n />\n </Stack>\n </div>\n </form>\n </Section>\n )\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAiEA;AACE;AACA;;AAGK;AAgBL;AAEA;AACE;;;AAGE;;;;AAKJ;;;AAKI;;;AAGF;AAIF;;;;;AAOI;AACE;AACE;;;AAGF;;;AAIF;AACF;AAGF;;;;AAMA;AACE;;;;;;;;AAUF;AAEA;;;AAIE;AA4DJ;;"}
1
+ {"version":3,"file":"StepFormDialogContentInner.js","sources":["../../../../src/components/Dialog/ControlledStepFormDialog/StepFormDialogContentInner.tsx"],"sourcesContent":["'use client'\n\nimport {\n type FC,\n type FormEvent,\n type PropsWithChildren,\n useCallback,\n useContext,\n useMemo,\n} from 'react'\n\nimport { type ResponseStatus, useResponseStatus } from '../../../hooks/useResponseStatus'\nimport { Button } from '../../Button'\nimport { Cluster } from '../../Layout'\nimport { Section } from '../../SectioningContent'\nimport { DialogBody, type Props as DialogBodyProps } from '../DialogBody'\nimport { DialogContentResponseStatusMessage } from '../DialogContentResponseStatusMessage'\nimport { DialogHeading, type Props as DialogHeadingProps } from '../DialogHeading'\nimport { dialogContentInner } from '../dialogInnerStyle'\n\nimport { StepFormDialogContext, type StepItem } from './StepFormDialogProvider'\n\nimport type { useStepFormDialogButton } from './useStepFormDialogButton'\n\ntype StepFormHelpers = {\n /** 指定したステップに移動する関数 */\n goto: (nextStep: StepItem) => void\n /** ダイアログを閉じる関数 */\n close: () => void\n /** 現在のステップ情報 */\n currentStep: StepItem\n}\n\ntype CommonButtonType = ReturnType<typeof useStepFormDialogButton>\n\nexport type AbstractProps = PropsWithChildren<\n DialogBodyProps & {\n /** ダイアログタイトル */\n heading: DialogHeadingProps\n /** 現在のStepNo */\n activeStep: number\n /** submitボタン */\n submitButton: CommonButtonType\n /**\n * アクションボタンをクリックした時に発火するコールバック関数\n * @param e フォームイベント\n * @param helpers ステップ操作用のヘルパー関数群\n */\n onSubmit: (e: FormEvent<HTMLFormElement>, helpers: StepFormHelpers) => void\n /** キャンセルボタン */\n closeButton: CommonButtonType\n /** 戻るボタン */\n backButton: CommonButtonType\n }\n>\n\nexport type StepFormDialogContentInnerProps = AbstractProps & {\n firstStep: StepItem\n onClickClose: () => void\n responseStatus?: ResponseStatus\n /** ステップの総数 */\n stepLength: number\n onClickBack?: () => void\n}\n\nconst BUTTON_COLUMN_GAP = {\n row: 0.5,\n column: 1,\n} as const\n\nexport const StepFormDialogContentInner: FC<StepFormDialogContentInnerProps> = ({\n children,\n heading,\n activeStep,\n contentBgColor,\n contentPadding,\n submitButton,\n closeButton,\n backButton,\n stepLength,\n firstStep,\n onSubmit,\n onClickClose,\n responseStatus,\n onClickBack,\n}) => {\n const { currentStep, stepQueue, setCurrentStep, scrollerRef } = useContext(StepFormDialogContext)\n\n const handleCloseAction = useCallback(() => {\n onClickClose()\n setTimeout(() => {\n // HINT: ダイアログが閉じるtransitionが完了してから初期化をしている\n stepQueue.current = []\n setCurrentStep(firstStep)\n }, 300)\n }, [firstStep, stepQueue, setCurrentStep, onClickClose])\n\n const changeCurrentStep = useCallback(\n (step: Parameters<typeof setCurrentStep>[0]) => {\n setCurrentStep(step)\n\n // HINT: stepが切り替わるごとにbodyのscroll位置を先頭に戻す処理\n if (scrollerRef.current) {\n scrollerRef.current.scroll(0, 0)\n }\n },\n [setCurrentStep, scrollerRef],\n )\n\n const handleSubmitAction = useCallback(\n (e: FormEvent<HTMLFormElement>) => {\n e.preventDefault()\n // HINT: React Potals などで擬似的にformがネストしている場合など、stopPropagationを実行しないと\n // 親formが意図せずsubmitされてしまう場合がある\n e.stopPropagation()\n\n const helpers: StepFormHelpers = {\n goto: (nextStep: StepItem) => {\n stepQueue.current.push(currentStep)\n changeCurrentStep(nextStep)\n },\n close: handleCloseAction,\n currentStep,\n }\n\n onSubmit(e, helpers)\n },\n [currentStep, stepQueue, onSubmit, handleCloseAction, changeCurrentStep],\n )\n const handleBackAction = useCallback(() => {\n onClickBack?.()\n\n changeCurrentStep(stepQueue.current.pop() ?? firstStep)\n }, [firstStep, stepQueue, onClickBack, changeCurrentStep])\n\n const classNames = useMemo(() => {\n const { wrapper, actionArea, buttonArea, message } = dialogContentInner()\n\n return {\n wrapper: wrapper(),\n actionArea: actionArea(),\n buttonArea: buttonArea(),\n message: message(),\n }\n }, [])\n\n const stepText = stepLength > 1 ? `(${activeStep}/${stepLength})` : ''\n\n const calcedResponseStatus = useResponseStatus(responseStatus)\n\n return (\n // eslint-disable-next-line smarthr/a11y-prohibit-sectioning-content-in-form\n <Section>\n <form onSubmit={handleSubmitAction}>\n <div className={classNames.wrapper}>\n <DialogHeading\n id={heading.id}\n sub={heading.sub ? `${heading.sub}${stepText}` : undefined}\n text={heading.sub ? heading.text : `${heading.text}${stepText}`}\n />\n <DialogBody\n contentPadding={contentPadding}\n contentBgColor={contentBgColor}\n ref={scrollerRef}\n >\n {children}\n </DialogBody>\n <div className={classNames.actionArea}>\n <Cluster justify=\"space-between\" gap={{ row: 0.5, column: 2 }}>\n {!backButton.hidden && activeStep > 1 && (\n <Button\n onClick={handleBackAction}\n variant={backButton.theme}\n disabled={backButton.disabled || calcedResponseStatus.isProcessing}\n className=\"smarthr-ui-Dialog-backButton\"\n >\n {backButton.text}\n </Button>\n )}\n <Cluster gap={BUTTON_COLUMN_GAP} className={classNames.buttonArea}>\n {!closeButton.hidden && (\n <Button\n onClick={handleCloseAction}\n variant={closeButton.theme}\n disabled={closeButton.disabled || calcedResponseStatus.isProcessing}\n className=\"smarthr-ui-Dialog-closeButton\"\n >\n {closeButton.text}\n </Button>\n )}\n {!submitButton.hidden && (\n <Button\n type=\"submit\"\n variant={submitButton.theme}\n disabled={submitButton.disabled}\n loading={calcedResponseStatus.isProcessing}\n className=\"smarthr-ui-Dialog-actionButton\"\n >\n {submitButton.text}\n </Button>\n )}\n </Cluster>\n </Cluster>\n <DialogContentResponseStatusMessage\n responseStatus={calcedResponseStatus}\n className={classNames.message}\n />\n </div>\n </div>\n </form>\n </Section>\n )\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAiEA;AACE;AACA;;AAGK;AAgBL;AAEA;AACE;;;AAGE;;;;AAKJ;;;AAKI;;;AAGF;AAIF;;;;;AAOI;AACE;AACE;;;AAGF;;;AAIF;AACF;AAGF;;;;AAMA;AACE;;;;;;;;AAUF;AAEA;;;AAIE;AA4DJ;;"}
@@ -1,23 +1,18 @@
1
1
  'use strict';
2
2
 
3
3
  var jsxRuntime = require('react/jsx-runtime');
4
- var React = require('react');
5
- var index = require('./../../vendor/.pnpm/tailwind-variants@0.3.1_tailwindcss@3.4.19_ts-node@10.9.2_@swc_core@1.15.17_@types_node@20.19.35_typescript@5.9.3__/vendor/tailwind-variants/dist/index.cjs');
6
4
  var components_ResponseMessage_ResponseMessage = require('../ResponseMessage/ResponseMessage.cjs');
7
5
 
8
- const classNameGenerator = index.tv({
9
- base: 'empty:!shr-mt-0',
10
- });
11
6
  const DialogContentResponseStatusMessage = ({ responseStatus, className }) => {
12
- const classNames = React.useMemo(() => classNameGenerator({ className }), [className]);
13
- const StatusMessage = () => (jsxRuntime.jsx(components_ResponseMessage_ResponseMessage.ResponseMessage, { status: responseStatus.status, children: responseStatus.message }));
7
+ const isError = responseStatus.message && responseStatus.status === 'error';
8
+ const isSuccess = responseStatus.message && responseStatus.status === 'success';
14
9
  return (
15
10
  /**
16
11
  * ライブリージョンを条件付きでDOMに追加すると、支援技術に通知が正しく行われないことがあるため、常にDOM上に存在するようにしています
17
12
  *
18
13
  * @see https://www.sarasoueidan.com/blog/accessible-notifications-with-aria-live-regions-part-2/#make-sure-the-live-region-container-is-in-the-dom-as-early-as-possible
19
14
  */
20
- jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("div", { className: classNames, role: "alert", children: responseStatus.message && responseStatus.status === 'error' && jsxRuntime.jsx(StatusMessage, {}) }), jsxRuntime.jsx("div", { className: classNames, role: "status", children: responseStatus.message && responseStatus.status === 'success' && jsxRuntime.jsx(StatusMessage, {}) })] }));
15
+ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("div", { className: isError ? `${className} shr-mt-0.5` : className, role: "alert", children: isError && jsxRuntime.jsx(components_ResponseMessage_ResponseMessage.ResponseMessage, { status: "error", children: responseStatus.message }) }), jsxRuntime.jsx("div", { className: isSuccess ? `${className} shr-mt-0.5` : className, role: "status", children: isSuccess && jsxRuntime.jsx(components_ResponseMessage_ResponseMessage.ResponseMessage, { status: "success", children: responseStatus.message }) })] }));
21
16
  };
22
17
 
23
18
  exports.DialogContentResponseStatusMessage = DialogContentResponseStatusMessage;
@@ -1 +1 @@
1
- {"version":3,"file":"DialogContentResponseStatusMessage.cjs","sources":["../../../src/components/Dialog/DialogContentResponseStatusMessage.tsx"],"sourcesContent":["import { type FC, useMemo } from 'react'\nimport { tv } from 'tailwind-variants'\n\nimport { ResponseMessage } from '../ResponseMessage'\n\nimport type { useResponseStatus } from '../../hooks/useResponseStatus'\n\nconst classNameGenerator = tv({\n base: 'empty:!shr-mt-0',\n})\n\nexport const DialogContentResponseStatusMessage: FC<{\n responseStatus: ReturnType<typeof useResponseStatus>\n className?: string\n}> = ({ responseStatus, className }) => {\n const classNames = useMemo(() => classNameGenerator({ className }), [className])\n\n const StatusMessage = () => (\n <ResponseMessage status={responseStatus.status}>{responseStatus.message}</ResponseMessage>\n )\n\n return (\n /**\n * ライブリージョンを条件付きでDOMに追加すると、支援技術に通知が正しく行われないことがあるため、常にDOM上に存在するようにしています\n *\n * @see https://www.sarasoueidan.com/blog/accessible-notifications-with-aria-live-regions-part-2/#make-sure-the-live-region-container-is-in-the-dom-as-early-as-possible\n */\n <>\n <div className={classNames} role=\"alert\">\n {responseStatus.message && responseStatus.status === 'error' && <StatusMessage />}\n </div>\n <div className={classNames} role=\"status\">\n {responseStatus.message && responseStatus.status === 'success' && <StatusMessage />}\n </div>\n </>\n )\n}\n"],"names":["tv","useMemo","_jsx","ResponseMessage","_jsxs","_Fragment"],"mappings":";;;;;;;AAOA,MAAM,kBAAkB,GAAGA,QAAE,CAAC;AAC5B,IAAA,IAAI,EAAE,iBAAiB;AACxB,CAAA,CAAC;AAEK,MAAM,kCAAkC,GAG1C,CAAC,EAAE,cAAc,EAAE,SAAS,EAAE,KAAI;AACrC,IAAA,MAAM,UAAU,GAAGC,aAAO,CAAC,MAAM,kBAAkB,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC;IAEhF,MAAM,aAAa,GAAG,OACpBC,cAAA,CAACC,0DAAe,EAAA,EAAC,MAAM,EAAE,cAAc,CAAC,MAAM,EAAA,QAAA,EAAG,cAAc,CAAC,OAAO,EAAA,CAAmB,CAC3F;IAED;AACE;;;;AAIG;IACHC,eAAA,CAAAC,mBAAA,EAAA,EAAA,QAAA,EAAA,CACEH,cAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAE,UAAU,EAAE,IAAI,EAAC,OAAO,EAAA,QAAA,EACrC,cAAc,CAAC,OAAO,IAAI,cAAc,CAAC,MAAM,KAAK,OAAO,IAAIA,cAAA,CAAC,aAAa,EAAA,EAAA,CAAG,EAAA,CAC7E,EACNA,wBAAK,SAAS,EAAE,UAAU,EAAE,IAAI,EAAC,QAAQ,EAAA,QAAA,EACtC,cAAc,CAAC,OAAO,IAAI,cAAc,CAAC,MAAM,KAAK,SAAS,IAAIA,cAAA,CAAC,aAAa,EAAA,EAAA,CAAG,EAAA,CAC/E,CAAA,EAAA,CACL;AAEP;;;;"}
1
+ {"version":3,"file":"DialogContentResponseStatusMessage.cjs","sources":["../../../src/components/Dialog/DialogContentResponseStatusMessage.tsx"],"sourcesContent":["import { ResponseMessage } from '../ResponseMessage'\n\nimport type { useResponseStatus } from '../../hooks/useResponseStatus'\nimport type { FC } from 'react'\n\nexport const DialogContentResponseStatusMessage: FC<{\n responseStatus: ReturnType<typeof useResponseStatus>\n className?: string\n}> = ({ responseStatus, className }) => {\n const isError = responseStatus.message && responseStatus.status === 'error'\n const isSuccess = responseStatus.message && responseStatus.status === 'success'\n\n return (\n /**\n * ライブリージョンを条件付きでDOMに追加すると、支援技術に通知が正しく行われないことがあるため、常にDOM上に存在するようにしています\n *\n * @see https://www.sarasoueidan.com/blog/accessible-notifications-with-aria-live-regions-part-2/#make-sure-the-live-region-container-is-in-the-dom-as-early-as-possible\n */\n <>\n <div className={isError ? `${className} shr-mt-0.5` : className} role=\"alert\">\n {isError && <ResponseMessage status=\"error\">{responseStatus.message}</ResponseMessage>}\n </div>\n <div className={isSuccess ? `${className} shr-mt-0.5` : className} role=\"status\">\n {isSuccess && <ResponseMessage status=\"success\">{responseStatus.message}</ResponseMessage>}\n </div>\n </>\n )\n}\n"],"names":["_jsxs","_Fragment","_jsx","ResponseMessage"],"mappings":";;;;;AAKO,MAAM,kCAAkC,GAG1C,CAAC,EAAE,cAAc,EAAE,SAAS,EAAE,KAAI;IACrC,MAAM,OAAO,GAAG,cAAc,CAAC,OAAO,IAAI,cAAc,CAAC,MAAM,KAAK,OAAO;IAC3E,MAAM,SAAS,GAAG,cAAc,CAAC,OAAO,IAAI,cAAc,CAAC,MAAM,KAAK,SAAS;IAE/E;AACE;;;;AAIG;AACH,IAAAA,eAAA,CAAAC,mBAAA,EAAA,EAAA,QAAA,EAAA,CACEC,cAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAE,OAAO,GAAG,CAAA,EAAG,SAAS,CAAA,WAAA,CAAa,GAAG,SAAS,EAAE,IAAI,EAAC,OAAO,EAAA,QAAA,EAC1E,OAAO,IAAIA,cAAA,CAACC,0DAAe,EAAA,EAAC,MAAM,EAAC,OAAO,EAAA,QAAA,EAAE,cAAc,CAAC,OAAO,GAAmB,EAAA,CAClF,EACND,cAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAE,SAAS,GAAG,CAAA,EAAG,SAAS,CAAA,WAAA,CAAa,GAAG,SAAS,EAAE,IAAI,EAAC,QAAQ,EAAA,QAAA,EAC7E,SAAS,IAAIA,cAAA,CAACC,0DAAe,EAAA,EAAC,MAAM,EAAC,SAAS,EAAA,QAAA,EAAE,cAAc,CAAC,OAAO,EAAA,CAAmB,EAAA,CACtF,CAAA,EAAA,CACL;AAEP;;;;"}
@@ -1,5 +1,5 @@
1
- import { type FC } from 'react';
2
1
  import type { useResponseStatus } from '../../hooks/useResponseStatus';
2
+ import type { FC } from 'react';
3
3
  export declare const DialogContentResponseStatusMessage: FC<{
4
4
  responseStatus: ReturnType<typeof useResponseStatus>;
5
5
  className?: string;
@@ -1,21 +1,16 @@
1
1
  import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
2
- import { useMemo } from 'react';
3
- import { tv as ce } from './../../vendor/.pnpm/tailwind-variants@0.3.1_tailwindcss@3.4.19_ts-node@10.9.2_@swc_core@1.15.17_@types_node@20.19.35_typescript@5.9.3__/vendor/tailwind-variants/dist/index.js';
4
2
  import { ResponseMessage } from '../ResponseMessage/ResponseMessage.js';
5
3
 
6
- const classNameGenerator = ce({
7
- base: 'empty:!shr-mt-0',
8
- });
9
4
  const DialogContentResponseStatusMessage = ({ responseStatus, className }) => {
10
- const classNames = useMemo(() => classNameGenerator({ className }), [className]);
11
- const StatusMessage = () => (jsx(ResponseMessage, { status: responseStatus.status, children: responseStatus.message }));
5
+ const isError = responseStatus.message && responseStatus.status === 'error';
6
+ const isSuccess = responseStatus.message && responseStatus.status === 'success';
12
7
  return (
13
8
  /**
14
9
  * ライブリージョンを条件付きでDOMに追加すると、支援技術に通知が正しく行われないことがあるため、常にDOM上に存在するようにしています
15
10
  *
16
11
  * @see https://www.sarasoueidan.com/blog/accessible-notifications-with-aria-live-regions-part-2/#make-sure-the-live-region-container-is-in-the-dom-as-early-as-possible
17
12
  */
18
- jsxs(Fragment, { children: [jsx("div", { className: classNames, role: "alert", children: responseStatus.message && responseStatus.status === 'error' && jsx(StatusMessage, {}) }), jsx("div", { className: classNames, role: "status", children: responseStatus.message && responseStatus.status === 'success' && jsx(StatusMessage, {}) })] }));
13
+ jsxs(Fragment, { children: [jsx("div", { className: isError ? `${className} shr-mt-0.5` : className, role: "alert", children: isError && jsx(ResponseMessage, { status: "error", children: responseStatus.message }) }), jsx("div", { className: isSuccess ? `${className} shr-mt-0.5` : className, role: "status", children: isSuccess && jsx(ResponseMessage, { status: "success", children: responseStatus.message }) })] }));
19
14
  };
20
15
 
21
16
  export { DialogContentResponseStatusMessage };
@@ -1 +1 @@
1
- {"version":3,"file":"DialogContentResponseStatusMessage.js","sources":["../../../src/components/Dialog/DialogContentResponseStatusMessage.tsx"],"sourcesContent":["import { type FC, useMemo } from 'react'\nimport { tv } from 'tailwind-variants'\n\nimport { ResponseMessage } from '../ResponseMessage'\n\nimport type { useResponseStatus } from '../../hooks/useResponseStatus'\n\nconst classNameGenerator = tv({\n base: 'empty:!shr-mt-0',\n})\n\nexport const DialogContentResponseStatusMessage: FC<{\n responseStatus: ReturnType<typeof useResponseStatus>\n className?: string\n}> = ({ responseStatus, className }) => {\n const classNames = useMemo(() => classNameGenerator({ className }), [className])\n\n const StatusMessage = () => (\n <ResponseMessage status={responseStatus.status}>{responseStatus.message}</ResponseMessage>\n )\n\n return (\n /**\n * ライブリージョンを条件付きでDOMに追加すると、支援技術に通知が正しく行われないことがあるため、常にDOM上に存在するようにしています\n *\n * @see https://www.sarasoueidan.com/blog/accessible-notifications-with-aria-live-regions-part-2/#make-sure-the-live-region-container-is-in-the-dom-as-early-as-possible\n */\n <>\n <div className={classNames} role=\"alert\">\n {responseStatus.message && responseStatus.status === 'error' && <StatusMessage />}\n </div>\n <div className={classNames} role=\"status\">\n {responseStatus.message && responseStatus.status === 'success' && <StatusMessage />}\n </div>\n </>\n )\n}\n"],"names":["tv","_jsx","_jsxs","_Fragment"],"mappings":";;;;;AAOA,MAAM,kBAAkB,GAAGA,EAAE,CAAC;AAC5B,IAAA,IAAI,EAAE,iBAAiB;AACxB,CAAA,CAAC;AAEK,MAAM,kCAAkC,GAG1C,CAAC,EAAE,cAAc,EAAE,SAAS,EAAE,KAAI;AACrC,IAAA,MAAM,UAAU,GAAG,OAAO,CAAC,MAAM,kBAAkB,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC;IAEhF,MAAM,aAAa,GAAG,OACpBC,GAAA,CAAC,eAAe,EAAA,EAAC,MAAM,EAAE,cAAc,CAAC,MAAM,EAAA,QAAA,EAAG,cAAc,CAAC,OAAO,EAAA,CAAmB,CAC3F;IAED;AACE;;;;AAIG;IACHC,IAAA,CAAAC,QAAA,EAAA,EAAA,QAAA,EAAA,CACEF,GAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAE,UAAU,EAAE,IAAI,EAAC,OAAO,EAAA,QAAA,EACrC,cAAc,CAAC,OAAO,IAAI,cAAc,CAAC,MAAM,KAAK,OAAO,IAAIA,GAAA,CAAC,aAAa,EAAA,EAAA,CAAG,EAAA,CAC7E,EACNA,aAAK,SAAS,EAAE,UAAU,EAAE,IAAI,EAAC,QAAQ,EAAA,QAAA,EACtC,cAAc,CAAC,OAAO,IAAI,cAAc,CAAC,MAAM,KAAK,SAAS,IAAIA,GAAA,CAAC,aAAa,EAAA,EAAA,CAAG,EAAA,CAC/E,CAAA,EAAA,CACL;AAEP;;;;"}
1
+ {"version":3,"file":"DialogContentResponseStatusMessage.js","sources":["../../../src/components/Dialog/DialogContentResponseStatusMessage.tsx"],"sourcesContent":["import { ResponseMessage } from '../ResponseMessage'\n\nimport type { useResponseStatus } from '../../hooks/useResponseStatus'\nimport type { FC } from 'react'\n\nexport const DialogContentResponseStatusMessage: FC<{\n responseStatus: ReturnType<typeof useResponseStatus>\n className?: string\n}> = ({ responseStatus, className }) => {\n const isError = responseStatus.message && responseStatus.status === 'error'\n const isSuccess = responseStatus.message && responseStatus.status === 'success'\n\n return (\n /**\n * ライブリージョンを条件付きでDOMに追加すると、支援技術に通知が正しく行われないことがあるため、常にDOM上に存在するようにしています\n *\n * @see https://www.sarasoueidan.com/blog/accessible-notifications-with-aria-live-regions-part-2/#make-sure-the-live-region-container-is-in-the-dom-as-early-as-possible\n */\n <>\n <div className={isError ? `${className} shr-mt-0.5` : className} role=\"alert\">\n {isError && <ResponseMessage status=\"error\">{responseStatus.message}</ResponseMessage>}\n </div>\n <div className={isSuccess ? `${className} shr-mt-0.5` : className} role=\"status\">\n {isSuccess && <ResponseMessage status=\"success\">{responseStatus.message}</ResponseMessage>}\n </div>\n </>\n )\n}\n"],"names":["_jsxs","_Fragment","_jsx"],"mappings":";;;AAKO,MAAM,kCAAkC,GAG1C,CAAC,EAAE,cAAc,EAAE,SAAS,EAAE,KAAI;IACrC,MAAM,OAAO,GAAG,cAAc,CAAC,OAAO,IAAI,cAAc,CAAC,MAAM,KAAK,OAAO;IAC3E,MAAM,SAAS,GAAG,cAAc,CAAC,OAAO,IAAI,cAAc,CAAC,MAAM,KAAK,SAAS;IAE/E;AACE;;;;AAIG;AACH,IAAAA,IAAA,CAAAC,QAAA,EAAA,EAAA,QAAA,EAAA,CACEC,GAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAE,OAAO,GAAG,CAAA,EAAG,SAAS,CAAA,WAAA,CAAa,GAAG,SAAS,EAAE,IAAI,EAAC,OAAO,EAAA,QAAA,EAC1E,OAAO,IAAIA,GAAA,CAAC,eAAe,EAAA,EAAC,MAAM,EAAC,OAAO,EAAA,QAAA,EAAE,cAAc,CAAC,OAAO,GAAmB,EAAA,CAClF,EACNA,GAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAE,SAAS,GAAG,CAAA,EAAG,SAAS,CAAA,WAAA,CAAa,GAAG,SAAS,EAAE,IAAI,EAAC,QAAQ,EAAA,QAAA,EAC7E,SAAS,IAAIA,GAAA,CAAC,eAAe,EAAA,EAAC,MAAM,EAAC,SAAS,EAAA,QAAA,EAAE,cAAc,CAAC,OAAO,EAAA,CAAmB,EAAA,CACtF,CAAA,EAAA,CACL;AAEP;;;;"}
@@ -19,7 +19,10 @@ const FocusTrap = React.forwardRef(({ firstFocusTarget, children }, ref) => {
19
19
  }));
20
20
  React.useEffect(() => {
21
21
  const handleKeyDown = (e) => {
22
- if (e.key !== 'Tab' || innerRef.current === null) {
22
+ // IME 変換中の Tab は変換候補の選択に使われるため、フォーカストラップの対象外にする。
23
+ // ここで preventDefault してしまうと、Dialog 内で日本語入力中に Tab を押しても
24
+ // 変換候補が確定されず、未確定文字列がそのまま入力されてしまう。
25
+ if (e.key !== 'Tab' || e.isComposing || innerRef.current === null) {
23
26
  return;
24
27
  }
25
28
  const tabbables = libs_tabbable.tabbable(innerRef.current).filter((elm) => elm.tabIndex >= 0);
@@ -1 +1 @@
1
- {"version":3,"file":"FocusTrap.cjs","sources":["../../../src/components/Dialog/FocusTrap.tsx"],"sourcesContent":["import {\n type PropsWithChildren,\n type RefObject,\n forwardRef,\n useEffect,\n useImperativeHandle,\n useRef,\n} from 'react'\n\nimport { tabbable } from '../../libs/tabbable'\n\ntype Props = PropsWithChildren<{\n firstFocusTarget?: RefObject<HTMLElement>\n}>\n\nexport type FocusTrapRef = {\n focus: () => void\n}\n\nexport const FocusTrap = forwardRef<FocusTrapRef, Props>(({ firstFocusTarget, children }, ref) => {\n const innerRef = useRef<HTMLDivElement | null>(null)\n const dummyFocusRef = useRef<HTMLDivElement>(null)\n\n useImperativeHandle(ref, () => ({\n focus: () => {\n if (firstFocusTarget?.current) {\n firstFocusTarget.current.focus()\n } else {\n dummyFocusRef.current?.focus()\n }\n },\n }))\n\n useEffect(() => {\n const handleKeyDown = (e: KeyboardEvent) => {\n if (e.key !== 'Tab' || innerRef.current === null) {\n return\n }\n\n const tabbables = tabbable(innerRef.current).filter((elm) => elm.tabIndex >= 0)\n\n if (tabbables.length === 0) {\n return\n }\n\n const firstTabbable = tabbables[0]\n const lastTabbable = tabbables[tabbables.length - 1]\n const currentFocused = tabbables.find((elm) => elm === e.target)\n\n if (e.shiftKey) {\n if (currentFocused === firstTabbable || document.activeElement === dummyFocusRef.current) {\n e.preventDefault()\n lastTabbable.focus()\n }\n } else if (currentFocused === lastTabbable) {\n e.preventDefault()\n firstTabbable.focus()\n }\n }\n\n window.addEventListener('keydown', handleKeyDown)\n\n return () => {\n window.removeEventListener('keydown', handleKeyDown)\n }\n }, [])\n\n useEffect(() => {\n const triggerElement = document.activeElement\n\n if (firstFocusTarget?.current) {\n firstFocusTarget.current.focus()\n } else {\n dummyFocusRef.current?.focus()\n }\n\n return () => {\n // フォーカストラップ終了時にトリガにフォーカスを戻す\n if (triggerElement instanceof HTMLElement) {\n triggerElement.focus()\n }\n }\n }, [firstFocusTarget])\n\n return (\n <div ref={innerRef}>\n {/* eslint-disable-next-line smarthr/a11y-scroller-has-tabindex -- dummy element for focus management. */}\n <div ref={dummyFocusRef} tabIndex={-1} />\n {children}\n </div>\n )\n})\n"],"names":["forwardRef","useRef","useImperativeHandle","useEffect","tabbable","_jsxs","_jsx"],"mappings":";;;;;;AAmBO,MAAM,SAAS,GAAGA,gBAAU,CAAsB,CAAC,EAAE,gBAAgB,EAAE,QAAQ,EAAE,EAAE,GAAG,KAAI;AAC/F,IAAA,MAAM,QAAQ,GAAGC,YAAM,CAAwB,IAAI,CAAC;AACpD,IAAA,MAAM,aAAa,GAAGA,YAAM,CAAiB,IAAI,CAAC;AAElD,IAAAC,yBAAmB,CAAC,GAAG,EAAE,OAAO;QAC9B,KAAK,EAAE,MAAK;AACV,YAAA,IAAI,gBAAgB,EAAE,OAAO,EAAE;AAC7B,gBAAA,gBAAgB,CAAC,OAAO,CAAC,KAAK,EAAE;YAClC;iBAAO;AACL,gBAAA,aAAa,CAAC,OAAO,EAAE,KAAK,EAAE;YAChC;QACF,CAAC;AACF,KAAA,CAAC,CAAC;IAEHC,eAAS,CAAC,MAAK;AACb,QAAA,MAAM,aAAa,GAAG,CAAC,CAAgB,KAAI;AACzC,YAAA,IAAI,CAAC,CAAC,GAAG,KAAK,KAAK,IAAI,QAAQ,CAAC,OAAO,KAAK,IAAI,EAAE;gBAChD;YACF;YAEA,MAAM,SAAS,GAAGC,sBAAQ,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,KAAK,GAAG,CAAC,QAAQ,IAAI,CAAC,CAAC;AAE/E,YAAA,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE;gBAC1B;YACF;AAEA,YAAA,MAAM,aAAa,GAAG,SAAS,CAAC,CAAC,CAAC;YAClC,MAAM,YAAY,GAAG,SAAS,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC;AACpD,YAAA,MAAM,cAAc,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC,GAAG,KAAK,GAAG,KAAK,CAAC,CAAC,MAAM,CAAC;AAEhE,YAAA,IAAI,CAAC,CAAC,QAAQ,EAAE;AACd,gBAAA,IAAI,cAAc,KAAK,aAAa,IAAI,QAAQ,CAAC,aAAa,KAAK,aAAa,CAAC,OAAO,EAAE;oBACxF,CAAC,CAAC,cAAc,EAAE;oBAClB,YAAY,CAAC,KAAK,EAAE;gBACtB;YACF;AAAO,iBAAA,IAAI,cAAc,KAAK,YAAY,EAAE;gBAC1C,CAAC,CAAC,cAAc,EAAE;gBAClB,aAAa,CAAC,KAAK,EAAE;YACvB;AACF,QAAA,CAAC;AAED,QAAA,MAAM,CAAC,gBAAgB,CAAC,SAAS,EAAE,aAAa,CAAC;AAEjD,QAAA,OAAO,MAAK;AACV,YAAA,MAAM,CAAC,mBAAmB,CAAC,SAAS,EAAE,aAAa,CAAC;AACtD,QAAA,CAAC;IACH,CAAC,EAAE,EAAE,CAAC;IAEND,eAAS,CAAC,MAAK;AACb,QAAA,MAAM,cAAc,GAAG,QAAQ,CAAC,aAAa;AAE7C,QAAA,IAAI,gBAAgB,EAAE,OAAO,EAAE;AAC7B,YAAA,gBAAgB,CAAC,OAAO,CAAC,KAAK,EAAE;QAClC;aAAO;AACL,YAAA,aAAa,CAAC,OAAO,EAAE,KAAK,EAAE;QAChC;AAEA,QAAA,OAAO,MAAK;;AAEV,YAAA,IAAI,cAAc,YAAY,WAAW,EAAE;gBACzC,cAAc,CAAC,KAAK,EAAE;YACxB;AACF,QAAA,CAAC;AACH,IAAA,CAAC,EAAE,CAAC,gBAAgB,CAAC,CAAC;IAEtB,QACEE,yBAAK,GAAG,EAAE,QAAQ,EAAA,QAAA,EAAA,CAEhBC,cAAA,CAAA,KAAA,EAAA,EAAK,GAAG,EAAE,aAAa,EAAE,QAAQ,EAAE,EAAE,EAAA,CAAI,EACxC,QAAQ,CAAA,EAAA,CACL;AAEV,CAAC;;;;"}
1
+ {"version":3,"file":"FocusTrap.cjs","sources":["../../../src/components/Dialog/FocusTrap.tsx"],"sourcesContent":["import {\n type PropsWithChildren,\n type RefObject,\n forwardRef,\n useEffect,\n useImperativeHandle,\n useRef,\n} from 'react'\n\nimport { tabbable } from '../../libs/tabbable'\n\ntype Props = PropsWithChildren<{\n firstFocusTarget?: RefObject<HTMLElement>\n}>\n\nexport type FocusTrapRef = {\n focus: () => void\n}\n\nexport const FocusTrap = forwardRef<FocusTrapRef, Props>(({ firstFocusTarget, children }, ref) => {\n const innerRef = useRef<HTMLDivElement | null>(null)\n const dummyFocusRef = useRef<HTMLDivElement>(null)\n\n useImperativeHandle(ref, () => ({\n focus: () => {\n if (firstFocusTarget?.current) {\n firstFocusTarget.current.focus()\n } else {\n dummyFocusRef.current?.focus()\n }\n },\n }))\n\n useEffect(() => {\n const handleKeyDown = (e: KeyboardEvent) => {\n // IME 変換中の Tab は変換候補の選択に使われるため、フォーカストラップの対象外にする。\n // ここで preventDefault してしまうと、Dialog 内で日本語入力中に Tab を押しても\n // 変換候補が確定されず、未確定文字列がそのまま入力されてしまう。\n if (e.key !== 'Tab' || e.isComposing || innerRef.current === null) {\n return\n }\n\n const tabbables = tabbable(innerRef.current).filter((elm) => elm.tabIndex >= 0)\n\n if (tabbables.length === 0) {\n return\n }\n\n const firstTabbable = tabbables[0]\n const lastTabbable = tabbables[tabbables.length - 1]\n const currentFocused = tabbables.find((elm) => elm === e.target)\n\n if (e.shiftKey) {\n if (currentFocused === firstTabbable || document.activeElement === dummyFocusRef.current) {\n e.preventDefault()\n lastTabbable.focus()\n }\n } else if (currentFocused === lastTabbable) {\n e.preventDefault()\n firstTabbable.focus()\n }\n }\n\n window.addEventListener('keydown', handleKeyDown)\n\n return () => {\n window.removeEventListener('keydown', handleKeyDown)\n }\n }, [])\n\n useEffect(() => {\n const triggerElement = document.activeElement\n\n if (firstFocusTarget?.current) {\n firstFocusTarget.current.focus()\n } else {\n dummyFocusRef.current?.focus()\n }\n\n return () => {\n // フォーカストラップ終了時にトリガにフォーカスを戻す\n if (triggerElement instanceof HTMLElement) {\n triggerElement.focus()\n }\n }\n }, [firstFocusTarget])\n\n return (\n <div ref={innerRef}>\n {/* eslint-disable-next-line smarthr/a11y-scroller-has-tabindex -- dummy element for focus management. */}\n <div ref={dummyFocusRef} tabIndex={-1} />\n {children}\n </div>\n )\n})\n"],"names":["forwardRef","useRef","useImperativeHandle","useEffect","tabbable","_jsxs","_jsx"],"mappings":";;;;;;AAmBO,MAAM,SAAS,GAAGA,gBAAU,CAAsB,CAAC,EAAE,gBAAgB,EAAE,QAAQ,EAAE,EAAE,GAAG,KAAI;AAC/F,IAAA,MAAM,QAAQ,GAAGC,YAAM,CAAwB,IAAI,CAAC;AACpD,IAAA,MAAM,aAAa,GAAGA,YAAM,CAAiB,IAAI,CAAC;AAElD,IAAAC,yBAAmB,CAAC,GAAG,EAAE,OAAO;QAC9B,KAAK,EAAE,MAAK;AACV,YAAA,IAAI,gBAAgB,EAAE,OAAO,EAAE;AAC7B,gBAAA,gBAAgB,CAAC,OAAO,CAAC,KAAK,EAAE;YAClC;iBAAO;AACL,gBAAA,aAAa,CAAC,OAAO,EAAE,KAAK,EAAE;YAChC;QACF,CAAC;AACF,KAAA,CAAC,CAAC;IAEHC,eAAS,CAAC,MAAK;AACb,QAAA,MAAM,aAAa,GAAG,CAAC,CAAgB,KAAI;;;;AAIzC,YAAA,IAAI,CAAC,CAAC,GAAG,KAAK,KAAK,IAAI,CAAC,CAAC,WAAW,IAAI,QAAQ,CAAC,OAAO,KAAK,IAAI,EAAE;gBACjE;YACF;YAEA,MAAM,SAAS,GAAGC,sBAAQ,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,KAAK,GAAG,CAAC,QAAQ,IAAI,CAAC,CAAC;AAE/E,YAAA,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE;gBAC1B;YACF;AAEA,YAAA,MAAM,aAAa,GAAG,SAAS,CAAC,CAAC,CAAC;YAClC,MAAM,YAAY,GAAG,SAAS,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC;AACpD,YAAA,MAAM,cAAc,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC,GAAG,KAAK,GAAG,KAAK,CAAC,CAAC,MAAM,CAAC;AAEhE,YAAA,IAAI,CAAC,CAAC,QAAQ,EAAE;AACd,gBAAA,IAAI,cAAc,KAAK,aAAa,IAAI,QAAQ,CAAC,aAAa,KAAK,aAAa,CAAC,OAAO,EAAE;oBACxF,CAAC,CAAC,cAAc,EAAE;oBAClB,YAAY,CAAC,KAAK,EAAE;gBACtB;YACF;AAAO,iBAAA,IAAI,cAAc,KAAK,YAAY,EAAE;gBAC1C,CAAC,CAAC,cAAc,EAAE;gBAClB,aAAa,CAAC,KAAK,EAAE;YACvB;AACF,QAAA,CAAC;AAED,QAAA,MAAM,CAAC,gBAAgB,CAAC,SAAS,EAAE,aAAa,CAAC;AAEjD,QAAA,OAAO,MAAK;AACV,YAAA,MAAM,CAAC,mBAAmB,CAAC,SAAS,EAAE,aAAa,CAAC;AACtD,QAAA,CAAC;IACH,CAAC,EAAE,EAAE,CAAC;IAEND,eAAS,CAAC,MAAK;AACb,QAAA,MAAM,cAAc,GAAG,QAAQ,CAAC,aAAa;AAE7C,QAAA,IAAI,gBAAgB,EAAE,OAAO,EAAE;AAC7B,YAAA,gBAAgB,CAAC,OAAO,CAAC,KAAK,EAAE;QAClC;aAAO;AACL,YAAA,aAAa,CAAC,OAAO,EAAE,KAAK,EAAE;QAChC;AAEA,QAAA,OAAO,MAAK;;AAEV,YAAA,IAAI,cAAc,YAAY,WAAW,EAAE;gBACzC,cAAc,CAAC,KAAK,EAAE;YACxB;AACF,QAAA,CAAC;AACH,IAAA,CAAC,EAAE,CAAC,gBAAgB,CAAC,CAAC;IAEtB,QACEE,yBAAK,GAAG,EAAE,QAAQ,EAAA,QAAA,EAAA,CAEhBC,cAAA,CAAA,KAAA,EAAA,EAAK,GAAG,EAAE,aAAa,EAAE,QAAQ,EAAE,EAAE,EAAA,CAAI,EACxC,QAAQ,CAAA,EAAA,CACL;AAEV,CAAC;;;;"}
@@ -17,7 +17,10 @@ const FocusTrap = forwardRef(({ firstFocusTarget, children }, ref) => {
17
17
  }));
18
18
  useEffect(() => {
19
19
  const handleKeyDown = (e) => {
20
- if (e.key !== 'Tab' || innerRef.current === null) {
20
+ // IME 変換中の Tab は変換候補の選択に使われるため、フォーカストラップの対象外にする。
21
+ // ここで preventDefault してしまうと、Dialog 内で日本語入力中に Tab を押しても
22
+ // 変換候補が確定されず、未確定文字列がそのまま入力されてしまう。
23
+ if (e.key !== 'Tab' || e.isComposing || innerRef.current === null) {
21
24
  return;
22
25
  }
23
26
  const tabbables = tabbable(innerRef.current).filter((elm) => elm.tabIndex >= 0);
@@ -1 +1 @@
1
- {"version":3,"file":"FocusTrap.js","sources":["../../../src/components/Dialog/FocusTrap.tsx"],"sourcesContent":["import {\n type PropsWithChildren,\n type RefObject,\n forwardRef,\n useEffect,\n useImperativeHandle,\n useRef,\n} from 'react'\n\nimport { tabbable } from '../../libs/tabbable'\n\ntype Props = PropsWithChildren<{\n firstFocusTarget?: RefObject<HTMLElement>\n}>\n\nexport type FocusTrapRef = {\n focus: () => void\n}\n\nexport const FocusTrap = forwardRef<FocusTrapRef, Props>(({ firstFocusTarget, children }, ref) => {\n const innerRef = useRef<HTMLDivElement | null>(null)\n const dummyFocusRef = useRef<HTMLDivElement>(null)\n\n useImperativeHandle(ref, () => ({\n focus: () => {\n if (firstFocusTarget?.current) {\n firstFocusTarget.current.focus()\n } else {\n dummyFocusRef.current?.focus()\n }\n },\n }))\n\n useEffect(() => {\n const handleKeyDown = (e: KeyboardEvent) => {\n if (e.key !== 'Tab' || innerRef.current === null) {\n return\n }\n\n const tabbables = tabbable(innerRef.current).filter((elm) => elm.tabIndex >= 0)\n\n if (tabbables.length === 0) {\n return\n }\n\n const firstTabbable = tabbables[0]\n const lastTabbable = tabbables[tabbables.length - 1]\n const currentFocused = tabbables.find((elm) => elm === e.target)\n\n if (e.shiftKey) {\n if (currentFocused === firstTabbable || document.activeElement === dummyFocusRef.current) {\n e.preventDefault()\n lastTabbable.focus()\n }\n } else if (currentFocused === lastTabbable) {\n e.preventDefault()\n firstTabbable.focus()\n }\n }\n\n window.addEventListener('keydown', handleKeyDown)\n\n return () => {\n window.removeEventListener('keydown', handleKeyDown)\n }\n }, [])\n\n useEffect(() => {\n const triggerElement = document.activeElement\n\n if (firstFocusTarget?.current) {\n firstFocusTarget.current.focus()\n } else {\n dummyFocusRef.current?.focus()\n }\n\n return () => {\n // フォーカストラップ終了時にトリガにフォーカスを戻す\n if (triggerElement instanceof HTMLElement) {\n triggerElement.focus()\n }\n }\n }, [firstFocusTarget])\n\n return (\n <div ref={innerRef}>\n {/* eslint-disable-next-line smarthr/a11y-scroller-has-tabindex -- dummy element for focus management. */}\n <div ref={dummyFocusRef} tabIndex={-1} />\n {children}\n </div>\n )\n})\n"],"names":["_jsxs","_jsx"],"mappings":";;;;AAmBO,MAAM,SAAS,GAAG,UAAU,CAAsB,CAAC,EAAE,gBAAgB,EAAE,QAAQ,EAAE,EAAE,GAAG,KAAI;AAC/F,IAAA,MAAM,QAAQ,GAAG,MAAM,CAAwB,IAAI,CAAC;AACpD,IAAA,MAAM,aAAa,GAAG,MAAM,CAAiB,IAAI,CAAC;AAElD,IAAA,mBAAmB,CAAC,GAAG,EAAE,OAAO;QAC9B,KAAK,EAAE,MAAK;AACV,YAAA,IAAI,gBAAgB,EAAE,OAAO,EAAE;AAC7B,gBAAA,gBAAgB,CAAC,OAAO,CAAC,KAAK,EAAE;YAClC;iBAAO;AACL,gBAAA,aAAa,CAAC,OAAO,EAAE,KAAK,EAAE;YAChC;QACF,CAAC;AACF,KAAA,CAAC,CAAC;IAEH,SAAS,CAAC,MAAK;AACb,QAAA,MAAM,aAAa,GAAG,CAAC,CAAgB,KAAI;AACzC,YAAA,IAAI,CAAC,CAAC,GAAG,KAAK,KAAK,IAAI,QAAQ,CAAC,OAAO,KAAK,IAAI,EAAE;gBAChD;YACF;YAEA,MAAM,SAAS,GAAG,QAAQ,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,KAAK,GAAG,CAAC,QAAQ,IAAI,CAAC,CAAC;AAE/E,YAAA,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE;gBAC1B;YACF;AAEA,YAAA,MAAM,aAAa,GAAG,SAAS,CAAC,CAAC,CAAC;YAClC,MAAM,YAAY,GAAG,SAAS,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC;AACpD,YAAA,MAAM,cAAc,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC,GAAG,KAAK,GAAG,KAAK,CAAC,CAAC,MAAM,CAAC;AAEhE,YAAA,IAAI,CAAC,CAAC,QAAQ,EAAE;AACd,gBAAA,IAAI,cAAc,KAAK,aAAa,IAAI,QAAQ,CAAC,aAAa,KAAK,aAAa,CAAC,OAAO,EAAE;oBACxF,CAAC,CAAC,cAAc,EAAE;oBAClB,YAAY,CAAC,KAAK,EAAE;gBACtB;YACF;AAAO,iBAAA,IAAI,cAAc,KAAK,YAAY,EAAE;gBAC1C,CAAC,CAAC,cAAc,EAAE;gBAClB,aAAa,CAAC,KAAK,EAAE;YACvB;AACF,QAAA,CAAC;AAED,QAAA,MAAM,CAAC,gBAAgB,CAAC,SAAS,EAAE,aAAa,CAAC;AAEjD,QAAA,OAAO,MAAK;AACV,YAAA,MAAM,CAAC,mBAAmB,CAAC,SAAS,EAAE,aAAa,CAAC;AACtD,QAAA,CAAC;IACH,CAAC,EAAE,EAAE,CAAC;IAEN,SAAS,CAAC,MAAK;AACb,QAAA,MAAM,cAAc,GAAG,QAAQ,CAAC,aAAa;AAE7C,QAAA,IAAI,gBAAgB,EAAE,OAAO,EAAE;AAC7B,YAAA,gBAAgB,CAAC,OAAO,CAAC,KAAK,EAAE;QAClC;aAAO;AACL,YAAA,aAAa,CAAC,OAAO,EAAE,KAAK,EAAE;QAChC;AAEA,QAAA,OAAO,MAAK;;AAEV,YAAA,IAAI,cAAc,YAAY,WAAW,EAAE;gBACzC,cAAc,CAAC,KAAK,EAAE;YACxB;AACF,QAAA,CAAC;AACH,IAAA,CAAC,EAAE,CAAC,gBAAgB,CAAC,CAAC;IAEtB,QACEA,cAAK,GAAG,EAAE,QAAQ,EAAA,QAAA,EAAA,CAEhBC,GAAA,CAAA,KAAA,EAAA,EAAK,GAAG,EAAE,aAAa,EAAE,QAAQ,EAAE,EAAE,EAAA,CAAI,EACxC,QAAQ,CAAA,EAAA,CACL;AAEV,CAAC;;;;"}
1
+ {"version":3,"file":"FocusTrap.js","sources":["../../../src/components/Dialog/FocusTrap.tsx"],"sourcesContent":["import {\n type PropsWithChildren,\n type RefObject,\n forwardRef,\n useEffect,\n useImperativeHandle,\n useRef,\n} from 'react'\n\nimport { tabbable } from '../../libs/tabbable'\n\ntype Props = PropsWithChildren<{\n firstFocusTarget?: RefObject<HTMLElement>\n}>\n\nexport type FocusTrapRef = {\n focus: () => void\n}\n\nexport const FocusTrap = forwardRef<FocusTrapRef, Props>(({ firstFocusTarget, children }, ref) => {\n const innerRef = useRef<HTMLDivElement | null>(null)\n const dummyFocusRef = useRef<HTMLDivElement>(null)\n\n useImperativeHandle(ref, () => ({\n focus: () => {\n if (firstFocusTarget?.current) {\n firstFocusTarget.current.focus()\n } else {\n dummyFocusRef.current?.focus()\n }\n },\n }))\n\n useEffect(() => {\n const handleKeyDown = (e: KeyboardEvent) => {\n // IME 変換中の Tab は変換候補の選択に使われるため、フォーカストラップの対象外にする。\n // ここで preventDefault してしまうと、Dialog 内で日本語入力中に Tab を押しても\n // 変換候補が確定されず、未確定文字列がそのまま入力されてしまう。\n if (e.key !== 'Tab' || e.isComposing || innerRef.current === null) {\n return\n }\n\n const tabbables = tabbable(innerRef.current).filter((elm) => elm.tabIndex >= 0)\n\n if (tabbables.length === 0) {\n return\n }\n\n const firstTabbable = tabbables[0]\n const lastTabbable = tabbables[tabbables.length - 1]\n const currentFocused = tabbables.find((elm) => elm === e.target)\n\n if (e.shiftKey) {\n if (currentFocused === firstTabbable || document.activeElement === dummyFocusRef.current) {\n e.preventDefault()\n lastTabbable.focus()\n }\n } else if (currentFocused === lastTabbable) {\n e.preventDefault()\n firstTabbable.focus()\n }\n }\n\n window.addEventListener('keydown', handleKeyDown)\n\n return () => {\n window.removeEventListener('keydown', handleKeyDown)\n }\n }, [])\n\n useEffect(() => {\n const triggerElement = document.activeElement\n\n if (firstFocusTarget?.current) {\n firstFocusTarget.current.focus()\n } else {\n dummyFocusRef.current?.focus()\n }\n\n return () => {\n // フォーカストラップ終了時にトリガにフォーカスを戻す\n if (triggerElement instanceof HTMLElement) {\n triggerElement.focus()\n }\n }\n }, [firstFocusTarget])\n\n return (\n <div ref={innerRef}>\n {/* eslint-disable-next-line smarthr/a11y-scroller-has-tabindex -- dummy element for focus management. */}\n <div ref={dummyFocusRef} tabIndex={-1} />\n {children}\n </div>\n )\n})\n"],"names":["_jsxs","_jsx"],"mappings":";;;;AAmBO,MAAM,SAAS,GAAG,UAAU,CAAsB,CAAC,EAAE,gBAAgB,EAAE,QAAQ,EAAE,EAAE,GAAG,KAAI;AAC/F,IAAA,MAAM,QAAQ,GAAG,MAAM,CAAwB,IAAI,CAAC;AACpD,IAAA,MAAM,aAAa,GAAG,MAAM,CAAiB,IAAI,CAAC;AAElD,IAAA,mBAAmB,CAAC,GAAG,EAAE,OAAO;QAC9B,KAAK,EAAE,MAAK;AACV,YAAA,IAAI,gBAAgB,EAAE,OAAO,EAAE;AAC7B,gBAAA,gBAAgB,CAAC,OAAO,CAAC,KAAK,EAAE;YAClC;iBAAO;AACL,gBAAA,aAAa,CAAC,OAAO,EAAE,KAAK,EAAE;YAChC;QACF,CAAC;AACF,KAAA,CAAC,CAAC;IAEH,SAAS,CAAC,MAAK;AACb,QAAA,MAAM,aAAa,GAAG,CAAC,CAAgB,KAAI;;;;AAIzC,YAAA,IAAI,CAAC,CAAC,GAAG,KAAK,KAAK,IAAI,CAAC,CAAC,WAAW,IAAI,QAAQ,CAAC,OAAO,KAAK,IAAI,EAAE;gBACjE;YACF;YAEA,MAAM,SAAS,GAAG,QAAQ,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,KAAK,GAAG,CAAC,QAAQ,IAAI,CAAC,CAAC;AAE/E,YAAA,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE;gBAC1B;YACF;AAEA,YAAA,MAAM,aAAa,GAAG,SAAS,CAAC,CAAC,CAAC;YAClC,MAAM,YAAY,GAAG,SAAS,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC;AACpD,YAAA,MAAM,cAAc,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC,GAAG,KAAK,GAAG,KAAK,CAAC,CAAC,MAAM,CAAC;AAEhE,YAAA,IAAI,CAAC,CAAC,QAAQ,EAAE;AACd,gBAAA,IAAI,cAAc,KAAK,aAAa,IAAI,QAAQ,CAAC,aAAa,KAAK,aAAa,CAAC,OAAO,EAAE;oBACxF,CAAC,CAAC,cAAc,EAAE;oBAClB,YAAY,CAAC,KAAK,EAAE;gBACtB;YACF;AAAO,iBAAA,IAAI,cAAc,KAAK,YAAY,EAAE;gBAC1C,CAAC,CAAC,cAAc,EAAE;gBAClB,aAAa,CAAC,KAAK,EAAE;YACvB;AACF,QAAA,CAAC;AAED,QAAA,MAAM,CAAC,gBAAgB,CAAC,SAAS,EAAE,aAAa,CAAC;AAEjD,QAAA,OAAO,MAAK;AACV,YAAA,MAAM,CAAC,mBAAmB,CAAC,SAAS,EAAE,aAAa,CAAC;AACtD,QAAA,CAAC;IACH,CAAC,EAAE,EAAE,CAAC;IAEN,SAAS,CAAC,MAAK;AACb,QAAA,MAAM,cAAc,GAAG,QAAQ,CAAC,aAAa;AAE7C,QAAA,IAAI,gBAAgB,EAAE,OAAO,EAAE;AAC7B,YAAA,gBAAgB,CAAC,OAAO,CAAC,KAAK,EAAE;QAClC;aAAO;AACL,YAAA,aAAa,CAAC,OAAO,EAAE,KAAK,EAAE;QAChC;AAEA,QAAA,OAAO,MAAK;;AAEV,YAAA,IAAI,cAAc,YAAY,WAAW,EAAE;gBACzC,cAAc,CAAC,KAAK,EAAE;YACxB;AACF,QAAA,CAAC;AACH,IAAA,CAAC,EAAE,CAAC,gBAAgB,CAAC,CAAC;IAEtB,QACEA,cAAK,GAAG,EAAE,QAAQ,EAAA,QAAA,EAAA,CAEhBC,GAAA,CAAA,KAAA,EAAA,EAAK,GAAG,EAAE,aAAa,EAAE,QAAQ,EAAE,EAAE,EAAA,CAAI,EACxC,QAAQ,CAAA,EAAA,CACL;AAEV,CAAC;;;;"}
@@ -8,7 +8,7 @@ var index = require('./../../../vendor/.pnpm/tailwind-variants@0.3.1_tailwindcss
8
8
  var hooks_useHandleEscape = require('../../../hooks/useHandleEscape.cjs');
9
9
  require('../../../intl/IntlProvider.cjs');
10
10
  var intl_useIntl = require('../../../intl/useIntl.cjs');
11
- require('react-intl');
11
+ require('../../../intl/Localizer.cjs');
12
12
  require('../../../_virtual/dayjs.min.cjs');
13
13
  require('../../../intl/TimeFormatter.cjs');
14
14
  var libs_debounce = require('../../../libs/debounce.cjs');
@@ -6,7 +6,7 @@ import { tv as ce } from './../../../vendor/.pnpm/tailwind-variants@0.3.1_tailwi
6
6
  import { useHandleEscape } from '../../../hooks/useHandleEscape.js';
7
7
  import '../../../intl/IntlProvider.js';
8
8
  import { useIntl } from '../../../intl/useIntl.js';
9
- import 'react-intl';
9
+ import '../../../intl/Localizer.js';
10
10
  import '../../../_virtual/dayjs.min.js';
11
11
  import '../../../intl/TimeFormatter.js';
12
12
  import { debounce } from '../../../libs/debounce.js';
@@ -6,7 +6,7 @@ var React = require('react');
6
6
  var index = require('./../../vendor/.pnpm/tailwind-variants@0.3.1_tailwindcss@3.4.19_ts-node@10.9.2_@swc_core@1.15.17_@types_node@20.19.35_typescript@5.9.3__/vendor/tailwind-variants/dist/index.cjs');
7
7
  require('../../intl/IntlProvider.cjs');
8
8
  var intl_useIntl = require('../../intl/useIntl.cjs');
9
- require('react-intl');
9
+ require('../../intl/Localizer.cjs');
10
10
  require('../../_virtual/dayjs.min.cjs');
11
11
  require('../../intl/TimeFormatter.cjs');
12
12
  var components_Button_Button = require('../Button/Button.cjs');
@@ -4,7 +4,7 @@ import { forwardRef, useRef, useState, useMemo, useImperativeHandle, useCallback
4
4
  import { tv as ce } from './../../vendor/.pnpm/tailwind-variants@0.3.1_tailwindcss@3.4.19_ts-node@10.9.2_@swc_core@1.15.17_@types_node@20.19.35_typescript@5.9.3__/vendor/tailwind-variants/dist/index.js';
5
5
  import '../../intl/IntlProvider.js';
6
6
  import { useIntl } from '../../intl/useIntl.js';
7
- import 'react-intl';
7
+ import '../../intl/Localizer.js';
8
8
  import '../../_virtual/dayjs.min.js';
9
9
  import '../../intl/TimeFormatter.js';
10
10
  import { Button } from '../Button/Button.js';
@@ -28,45 +28,27 @@ const Dropdown = ({ onOpen, onClose, children }) => {
28
28
  const { createPortal, portalRoot, isPortalRootMounted, isChildPortal, PortalParentProvider } = hooks_usePortal.usePortal();
29
29
  const triggerElementRef = React.useRef(null);
30
30
  const contentId = React.useId();
31
- if (portalRoot) {
32
- portalRoot.setAttribute('id', contentId);
33
- }
34
- React.useEffect(() => {
35
- const onClickBody = (e) => {
36
- // ignore events from events within DropdownTrigger and DropdownContent
37
- if (!components_Dropdown_dropdownHelper.isEventFromChild(e, triggerElementRef.current) && !isChildPortal(e.target)) {
38
- setActive(false);
39
- }
40
- };
41
- document.body.addEventListener('click', onClickBody, false);
42
- return () => {
43
- document.body.removeEventListener('click', onClickBody, false);
44
- };
45
- }, [isChildPortal, portalRoot]);
31
+ const unstableRef = React.useRef({
32
+ active,
33
+ isPortalRootMounted,
34
+ onOpen,
35
+ onClose,
36
+ createPortal,
37
+ });
38
+ unstableRef.current = {
39
+ active,
40
+ isPortalRootMounted,
41
+ onOpen,
42
+ onClose,
43
+ createPortal,
44
+ };
46
45
  // This is the root container of a dropdown content located in outside the DOM tree
47
46
  const DropdownContentRoot = React.useMemo(() => {
48
- const result = (props) => active ? createPortal(props.children) : null;
47
+ const result = (props) => unstableRef.current.active ? unstableRef.current.createPortal(props.children) : null;
49
48
  // set the displayName explicit for DevTools
50
49
  result.displayName = 'DropdownContentRoot';
51
50
  return result;
52
- }, [active, createPortal]);
53
- const togglerRef = React.useRef({
54
- isPortalRootMounted,
55
- onOpen,
56
- onClose,
57
- });
58
- React.useEffect(() => {
59
- togglerRef.current = {
60
- isPortalRootMounted,
61
- onOpen,
62
- onClose,
63
- };
64
- }, [isPortalRootMounted, onOpen, onClose]);
65
- React.useEffect(() => {
66
- if (togglerRef.current.isPortalRootMounted()) {
67
- togglerRef.current[active ? 'onOpen' : 'onClose']?.();
68
- }
69
- }, [active]);
51
+ }, []);
70
52
  const memoizedOnClickTrigger = React.useCallback((rect) => {
71
53
  setActive((current) => {
72
54
  const newActive = !current;
@@ -81,6 +63,26 @@ const Dropdown = ({ onOpen, onClose, children }) => {
81
63
  // return focus to the Trigger
82
64
  components_Dropdown_dropdownHelper.getFirstTabbable(triggerElementRef)?.focus();
83
65
  }, []);
66
+ React.useEffect(() => {
67
+ if (portalRoot) {
68
+ portalRoot.setAttribute('id', contentId);
69
+ }
70
+ const onClickBody = (e) => {
71
+ // ignore events from events within DropdownTrigger and DropdownContent
72
+ if (!components_Dropdown_dropdownHelper.isEventFromChild(e, triggerElementRef.current) && !isChildPortal(e.target)) {
73
+ setActive(false);
74
+ }
75
+ };
76
+ document.body.addEventListener('click', onClickBody, false);
77
+ return () => {
78
+ document.body.removeEventListener('click', onClickBody, false);
79
+ };
80
+ }, [isChildPortal, portalRoot, contentId]);
81
+ React.useEffect(() => {
82
+ if (unstableRef.current.isPortalRootMounted()) {
83
+ unstableRef.current[active ? 'onOpen' : 'onClose']?.();
84
+ }
85
+ }, [active]);
84
86
  return (jsxRuntime.jsx(PortalParentProvider, { children: jsxRuntime.jsx(DropdownContext.Provider, { value: {
85
87
  active,
86
88
  triggerRect,
@@ -1 +1 @@
1
- {"version":3,"file":"Dropdown.cjs","sources":["../../../src/components/Dropdown/Dropdown.tsx"],"sourcesContent":["'use client'\n\nimport {\n type FC,\n type MutableRefObject,\n type PropsWithChildren,\n type ReactNode,\n createContext,\n createRef,\n useCallback,\n useContext,\n useEffect,\n useId,\n useMemo,\n useRef,\n useState,\n} from 'react'\n\nimport { usePortal } from '../../hooks/usePortal'\n\nimport { type Rect, getFirstTabbable, isEventFromChild } from './dropdownHelper'\n\ntype Props = PropsWithChildren<{\n onOpen?: () => void\n onClose?: () => void\n}>\n\ntype DropdownContextType = {\n active: boolean\n triggerRect: Rect\n triggerElementRef: MutableRefObject<HTMLDivElement | null>\n rootTriggerRef: MutableRefObject<HTMLDivElement | null> | null\n memoizedOnClickTrigger: (rect: Rect) => void\n onClickCloser: () => void\n DropdownContentRoot: FC<{ children: ReactNode }>\n contentId: string\n}\n\nconst initialRect = { top: 0, right: 0, bottom: 0, left: 0 }\n\nexport const DropdownContext = createContext<DropdownContextType>({\n active: false,\n triggerRect: initialRect,\n triggerElementRef: createRef(),\n rootTriggerRef: null,\n memoizedOnClickTrigger: () => {\n /* noop */\n },\n onClickCloser: () => {\n /* noop */\n },\n DropdownContentRoot: () => null,\n contentId: '',\n})\n\nexport const Dropdown: FC<Props> = ({ onOpen, onClose, children }) => {\n const [active, setActive] = useState(false)\n const [triggerRect, setTriggerRect] = useState<Rect>(initialRect)\n\n const { rootTriggerRef } = useContext(DropdownContext)\n const { createPortal, portalRoot, isPortalRootMounted, isChildPortal, PortalParentProvider } =\n usePortal()\n\n const triggerElementRef = useRef<HTMLDivElement>(null)\n const contentId = useId()\n\n if (portalRoot) {\n portalRoot.setAttribute('id', contentId)\n }\n\n useEffect(() => {\n const onClickBody = (e: any) => {\n // ignore events from events within DropdownTrigger and DropdownContent\n if (!isEventFromChild(e, triggerElementRef.current) && !isChildPortal(e.target)) {\n setActive(false)\n }\n }\n\n document.body.addEventListener('click', onClickBody, false)\n\n return () => {\n document.body.removeEventListener('click', onClickBody, false)\n }\n }, [isChildPortal, portalRoot])\n\n // This is the root container of a dropdown content located in outside the DOM tree\n const DropdownContentRoot = useMemo<FC<{ children: ReactNode }>>(() => {\n const result: FC<{ children: ReactNode }> = (props) =>\n active ? createPortal(props.children) : null\n\n // set the displayName explicit for DevTools\n result.displayName = 'DropdownContentRoot'\n\n return result\n }, [active, createPortal])\n\n const togglerRef = useRef({\n isPortalRootMounted,\n onOpen,\n onClose,\n })\n useEffect(() => {\n togglerRef.current = {\n isPortalRootMounted,\n onOpen,\n onClose,\n }\n }, [isPortalRootMounted, onOpen, onClose])\n\n useEffect(() => {\n if (togglerRef.current.isPortalRootMounted()) {\n togglerRef.current[active ? 'onOpen' : 'onClose']?.()\n }\n }, [active])\n\n const memoizedOnClickTrigger = useCallback((rect: Rect) => {\n setActive((current) => {\n const newActive = !current\n\n if (newActive) {\n setTriggerRect(rect)\n }\n\n return newActive\n })\n }, [])\n\n const onClickCloser = useCallback(() => {\n setActive(false)\n\n // return focus to the Trigger\n getFirstTabbable(triggerElementRef)?.focus()\n }, [])\n\n return (\n <PortalParentProvider>\n <DropdownContext.Provider\n value={{\n active,\n triggerRect,\n triggerElementRef,\n rootTriggerRef: rootTriggerRef || triggerElementRef || null,\n memoizedOnClickTrigger,\n onClickCloser,\n DropdownContentRoot,\n contentId,\n }}\n >\n {children}\n </DropdownContext.Provider>\n </PortalParentProvider>\n )\n}\n"],"names":[],"mappings":";;;;;;;;AAsCA;AAEO;AACL;AACA;;AAEA;;;;;;;AAOA;AACA;AACD;AAEM;;;;AAKL;AAGA;AACA;;AAGE;;;AAIA;;AAEE;;;AAGF;;AAIA;;AAEA;AACF;;AAGA;;;AAKE;AAEA;AACF;;;;;AAMC;;;;;;;;;AAUC;AACE;;AAEJ;AAEA;AACE;AACE;;;;AAMA;AACF;;AAGF;;;AAIE;;;;;;AAUM;;;;;AAKD;AAMT;;;"}
1
+ {"version":3,"file":"Dropdown.cjs","sources":["../../../src/components/Dropdown/Dropdown.tsx"],"sourcesContent":["'use client'\n\nimport {\n type FC,\n type MutableRefObject,\n type PropsWithChildren,\n type ReactNode,\n createContext,\n createRef,\n useCallback,\n useContext,\n useEffect,\n useId,\n useMemo,\n useRef,\n useState,\n} from 'react'\n\nimport { usePortal } from '../../hooks/usePortal'\n\nimport { type Rect, getFirstTabbable, isEventFromChild } from './dropdownHelper'\n\ntype Props = PropsWithChildren<{\n onOpen?: () => void\n onClose?: () => void\n}>\n\ntype DropdownContextType = {\n active: boolean\n triggerRect: Rect\n triggerElementRef: MutableRefObject<HTMLDivElement | null>\n rootTriggerRef: MutableRefObject<HTMLDivElement | null> | null\n memoizedOnClickTrigger: (rect: Rect) => void\n onClickCloser: () => void\n DropdownContentRoot: FC<{ children: ReactNode }>\n contentId: string\n}\n\nconst initialRect = { top: 0, right: 0, bottom: 0, left: 0 }\n\nexport const DropdownContext = createContext<DropdownContextType>({\n active: false,\n triggerRect: initialRect,\n triggerElementRef: createRef(),\n rootTriggerRef: null,\n memoizedOnClickTrigger: () => {\n /* noop */\n },\n onClickCloser: () => {\n /* noop */\n },\n DropdownContentRoot: () => null,\n contentId: '',\n})\n\nexport const Dropdown: FC<Props> = ({ onOpen, onClose, children }) => {\n const [active, setActive] = useState(false)\n const [triggerRect, setTriggerRect] = useState<Rect>(initialRect)\n\n const { rootTriggerRef } = useContext(DropdownContext)\n const { createPortal, portalRoot, isPortalRootMounted, isChildPortal, PortalParentProvider } =\n usePortal()\n\n const triggerElementRef = useRef<HTMLDivElement>(null)\n const contentId = useId()\n\n const unstableRef = useRef({\n active,\n isPortalRootMounted,\n onOpen,\n onClose,\n createPortal,\n })\n unstableRef.current = {\n active,\n isPortalRootMounted,\n onOpen,\n onClose,\n createPortal,\n }\n\n // This is the root container of a dropdown content located in outside the DOM tree\n const DropdownContentRoot = useMemo<FC<{ children: ReactNode }>>(() => {\n const result: FC<{ children: ReactNode }> = (props) =>\n unstableRef.current.active ? unstableRef.current.createPortal(props.children) : null\n\n // set the displayName explicit for DevTools\n result.displayName = 'DropdownContentRoot'\n\n return result\n }, [])\n\n const memoizedOnClickTrigger = useCallback((rect: Rect) => {\n setActive((current) => {\n const newActive = !current\n\n if (newActive) {\n setTriggerRect(rect)\n }\n\n return newActive\n })\n }, [])\n\n const onClickCloser = useCallback(() => {\n setActive(false)\n\n // return focus to the Trigger\n getFirstTabbable(triggerElementRef)?.focus()\n }, [])\n\n useEffect(() => {\n if (portalRoot) {\n portalRoot.setAttribute('id', contentId)\n }\n\n const onClickBody = (e: any) => {\n // ignore events from events within DropdownTrigger and DropdownContent\n if (!isEventFromChild(e, triggerElementRef.current) && !isChildPortal(e.target)) {\n setActive(false)\n }\n }\n\n document.body.addEventListener('click', onClickBody, false)\n\n return () => {\n document.body.removeEventListener('click', onClickBody, false)\n }\n }, [isChildPortal, portalRoot, contentId])\n\n useEffect(() => {\n if (unstableRef.current.isPortalRootMounted()) {\n unstableRef.current[active ? 'onOpen' : 'onClose']?.()\n }\n }, [active])\n\n return (\n <PortalParentProvider>\n <DropdownContext.Provider\n value={{\n active,\n triggerRect,\n triggerElementRef,\n rootTriggerRef: rootTriggerRef || triggerElementRef || null,\n memoizedOnClickTrigger,\n onClickCloser,\n DropdownContentRoot,\n contentId,\n }}\n >\n {children}\n </DropdownContext.Provider>\n </PortalParentProvider>\n )\n}\n"],"names":[],"mappings":";;;;;;;;AAsCA;AAEO;AACL;AACA;;AAEA;;;;;;;AAOA;AACA;AACD;AAEM;;;;AAKL;AAGA;AACA;;;;;;;AAQC;;;;;;;;;AAUD;AACE;;AAIA;AAEA;;AAGF;AACE;AACE;;;;AAMA;AACF;;AAGF;;;AAIE;;;;AAKE;;AAGF;;AAEE;;;AAGF;;AAIA;;AAEA;;;AAIA;AACE;;AAEJ;;;;;AASQ;;;;;AAKD;AAMT;;;"}
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
  import { jsx } from 'react/jsx-runtime';
3
- import { createContext, createRef, useState, useContext, useRef, useId, useEffect, useMemo, useCallback } from 'react';
3
+ import { createContext, createRef, useState, useContext, useRef, useId, useMemo, useCallback, useEffect } from 'react';
4
4
  import { usePortal } from '../../hooks/usePortal.js';
5
5
  import { getFirstTabbable, isEventFromChild } from './dropdownHelper.js';
6
6
 
@@ -26,45 +26,27 @@ const Dropdown = ({ onOpen, onClose, children }) => {
26
26
  const { createPortal, portalRoot, isPortalRootMounted, isChildPortal, PortalParentProvider } = usePortal();
27
27
  const triggerElementRef = useRef(null);
28
28
  const contentId = useId();
29
- if (portalRoot) {
30
- portalRoot.setAttribute('id', contentId);
31
- }
32
- useEffect(() => {
33
- const onClickBody = (e) => {
34
- // ignore events from events within DropdownTrigger and DropdownContent
35
- if (!isEventFromChild(e, triggerElementRef.current) && !isChildPortal(e.target)) {
36
- setActive(false);
37
- }
38
- };
39
- document.body.addEventListener('click', onClickBody, false);
40
- return () => {
41
- document.body.removeEventListener('click', onClickBody, false);
42
- };
43
- }, [isChildPortal, portalRoot]);
29
+ const unstableRef = useRef({
30
+ active,
31
+ isPortalRootMounted,
32
+ onOpen,
33
+ onClose,
34
+ createPortal,
35
+ });
36
+ unstableRef.current = {
37
+ active,
38
+ isPortalRootMounted,
39
+ onOpen,
40
+ onClose,
41
+ createPortal,
42
+ };
44
43
  // This is the root container of a dropdown content located in outside the DOM tree
45
44
  const DropdownContentRoot = useMemo(() => {
46
- const result = (props) => active ? createPortal(props.children) : null;
45
+ const result = (props) => unstableRef.current.active ? unstableRef.current.createPortal(props.children) : null;
47
46
  // set the displayName explicit for DevTools
48
47
  result.displayName = 'DropdownContentRoot';
49
48
  return result;
50
- }, [active, createPortal]);
51
- const togglerRef = useRef({
52
- isPortalRootMounted,
53
- onOpen,
54
- onClose,
55
- });
56
- useEffect(() => {
57
- togglerRef.current = {
58
- isPortalRootMounted,
59
- onOpen,
60
- onClose,
61
- };
62
- }, [isPortalRootMounted, onOpen, onClose]);
63
- useEffect(() => {
64
- if (togglerRef.current.isPortalRootMounted()) {
65
- togglerRef.current[active ? 'onOpen' : 'onClose']?.();
66
- }
67
- }, [active]);
49
+ }, []);
68
50
  const memoizedOnClickTrigger = useCallback((rect) => {
69
51
  setActive((current) => {
70
52
  const newActive = !current;
@@ -79,6 +61,26 @@ const Dropdown = ({ onOpen, onClose, children }) => {
79
61
  // return focus to the Trigger
80
62
  getFirstTabbable(triggerElementRef)?.focus();
81
63
  }, []);
64
+ useEffect(() => {
65
+ if (portalRoot) {
66
+ portalRoot.setAttribute('id', contentId);
67
+ }
68
+ const onClickBody = (e) => {
69
+ // ignore events from events within DropdownTrigger and DropdownContent
70
+ if (!isEventFromChild(e, triggerElementRef.current) && !isChildPortal(e.target)) {
71
+ setActive(false);
72
+ }
73
+ };
74
+ document.body.addEventListener('click', onClickBody, false);
75
+ return () => {
76
+ document.body.removeEventListener('click', onClickBody, false);
77
+ };
78
+ }, [isChildPortal, portalRoot, contentId]);
79
+ useEffect(() => {
80
+ if (unstableRef.current.isPortalRootMounted()) {
81
+ unstableRef.current[active ? 'onOpen' : 'onClose']?.();
82
+ }
83
+ }, [active]);
82
84
  return (jsx(PortalParentProvider, { children: jsx(DropdownContext.Provider, { value: {
83
85
  active,
84
86
  triggerRect,
@@ -1 +1 @@
1
- {"version":3,"file":"Dropdown.js","sources":["../../../src/components/Dropdown/Dropdown.tsx"],"sourcesContent":["'use client'\n\nimport {\n type FC,\n type MutableRefObject,\n type PropsWithChildren,\n type ReactNode,\n createContext,\n createRef,\n useCallback,\n useContext,\n useEffect,\n useId,\n useMemo,\n useRef,\n useState,\n} from 'react'\n\nimport { usePortal } from '../../hooks/usePortal'\n\nimport { type Rect, getFirstTabbable, isEventFromChild } from './dropdownHelper'\n\ntype Props = PropsWithChildren<{\n onOpen?: () => void\n onClose?: () => void\n}>\n\ntype DropdownContextType = {\n active: boolean\n triggerRect: Rect\n triggerElementRef: MutableRefObject<HTMLDivElement | null>\n rootTriggerRef: MutableRefObject<HTMLDivElement | null> | null\n memoizedOnClickTrigger: (rect: Rect) => void\n onClickCloser: () => void\n DropdownContentRoot: FC<{ children: ReactNode }>\n contentId: string\n}\n\nconst initialRect = { top: 0, right: 0, bottom: 0, left: 0 }\n\nexport const DropdownContext = createContext<DropdownContextType>({\n active: false,\n triggerRect: initialRect,\n triggerElementRef: createRef(),\n rootTriggerRef: null,\n memoizedOnClickTrigger: () => {\n /* noop */\n },\n onClickCloser: () => {\n /* noop */\n },\n DropdownContentRoot: () => null,\n contentId: '',\n})\n\nexport const Dropdown: FC<Props> = ({ onOpen, onClose, children }) => {\n const [active, setActive] = useState(false)\n const [triggerRect, setTriggerRect] = useState<Rect>(initialRect)\n\n const { rootTriggerRef } = useContext(DropdownContext)\n const { createPortal, portalRoot, isPortalRootMounted, isChildPortal, PortalParentProvider } =\n usePortal()\n\n const triggerElementRef = useRef<HTMLDivElement>(null)\n const contentId = useId()\n\n if (portalRoot) {\n portalRoot.setAttribute('id', contentId)\n }\n\n useEffect(() => {\n const onClickBody = (e: any) => {\n // ignore events from events within DropdownTrigger and DropdownContent\n if (!isEventFromChild(e, triggerElementRef.current) && !isChildPortal(e.target)) {\n setActive(false)\n }\n }\n\n document.body.addEventListener('click', onClickBody, false)\n\n return () => {\n document.body.removeEventListener('click', onClickBody, false)\n }\n }, [isChildPortal, portalRoot])\n\n // This is the root container of a dropdown content located in outside the DOM tree\n const DropdownContentRoot = useMemo<FC<{ children: ReactNode }>>(() => {\n const result: FC<{ children: ReactNode }> = (props) =>\n active ? createPortal(props.children) : null\n\n // set the displayName explicit for DevTools\n result.displayName = 'DropdownContentRoot'\n\n return result\n }, [active, createPortal])\n\n const togglerRef = useRef({\n isPortalRootMounted,\n onOpen,\n onClose,\n })\n useEffect(() => {\n togglerRef.current = {\n isPortalRootMounted,\n onOpen,\n onClose,\n }\n }, [isPortalRootMounted, onOpen, onClose])\n\n useEffect(() => {\n if (togglerRef.current.isPortalRootMounted()) {\n togglerRef.current[active ? 'onOpen' : 'onClose']?.()\n }\n }, [active])\n\n const memoizedOnClickTrigger = useCallback((rect: Rect) => {\n setActive((current) => {\n const newActive = !current\n\n if (newActive) {\n setTriggerRect(rect)\n }\n\n return newActive\n })\n }, [])\n\n const onClickCloser = useCallback(() => {\n setActive(false)\n\n // return focus to the Trigger\n getFirstTabbable(triggerElementRef)?.focus()\n }, [])\n\n return (\n <PortalParentProvider>\n <DropdownContext.Provider\n value={{\n active,\n triggerRect,\n triggerElementRef,\n rootTriggerRef: rootTriggerRef || triggerElementRef || null,\n memoizedOnClickTrigger,\n onClickCloser,\n DropdownContentRoot,\n contentId,\n }}\n >\n {children}\n </DropdownContext.Provider>\n </PortalParentProvider>\n )\n}\n"],"names":[],"mappings":";;;;;;AAsCA;AAEO;AACL;AACA;;AAEA;;;;;;;AAOA;AACA;AACD;AAEM;;;;AAKL;AAGA;AACA;;AAGE;;;AAIA;;AAEE;;;AAGF;;AAIA;;AAEA;AACF;;AAGA;;;AAKE;AAEA;AACF;;;;;AAMC;;;;;;;;;AAUC;AACE;;AAEJ;AAEA;AACE;AACE;;;;AAMA;AACF;;AAGF;;;AAIE;;;;;;AAUM;;;;;AAKD;AAMT;;"}
1
+ {"version":3,"file":"Dropdown.js","sources":["../../../src/components/Dropdown/Dropdown.tsx"],"sourcesContent":["'use client'\n\nimport {\n type FC,\n type MutableRefObject,\n type PropsWithChildren,\n type ReactNode,\n createContext,\n createRef,\n useCallback,\n useContext,\n useEffect,\n useId,\n useMemo,\n useRef,\n useState,\n} from 'react'\n\nimport { usePortal } from '../../hooks/usePortal'\n\nimport { type Rect, getFirstTabbable, isEventFromChild } from './dropdownHelper'\n\ntype Props = PropsWithChildren<{\n onOpen?: () => void\n onClose?: () => void\n}>\n\ntype DropdownContextType = {\n active: boolean\n triggerRect: Rect\n triggerElementRef: MutableRefObject<HTMLDivElement | null>\n rootTriggerRef: MutableRefObject<HTMLDivElement | null> | null\n memoizedOnClickTrigger: (rect: Rect) => void\n onClickCloser: () => void\n DropdownContentRoot: FC<{ children: ReactNode }>\n contentId: string\n}\n\nconst initialRect = { top: 0, right: 0, bottom: 0, left: 0 }\n\nexport const DropdownContext = createContext<DropdownContextType>({\n active: false,\n triggerRect: initialRect,\n triggerElementRef: createRef(),\n rootTriggerRef: null,\n memoizedOnClickTrigger: () => {\n /* noop */\n },\n onClickCloser: () => {\n /* noop */\n },\n DropdownContentRoot: () => null,\n contentId: '',\n})\n\nexport const Dropdown: FC<Props> = ({ onOpen, onClose, children }) => {\n const [active, setActive] = useState(false)\n const [triggerRect, setTriggerRect] = useState<Rect>(initialRect)\n\n const { rootTriggerRef } = useContext(DropdownContext)\n const { createPortal, portalRoot, isPortalRootMounted, isChildPortal, PortalParentProvider } =\n usePortal()\n\n const triggerElementRef = useRef<HTMLDivElement>(null)\n const contentId = useId()\n\n const unstableRef = useRef({\n active,\n isPortalRootMounted,\n onOpen,\n onClose,\n createPortal,\n })\n unstableRef.current = {\n active,\n isPortalRootMounted,\n onOpen,\n onClose,\n createPortal,\n }\n\n // This is the root container of a dropdown content located in outside the DOM tree\n const DropdownContentRoot = useMemo<FC<{ children: ReactNode }>>(() => {\n const result: FC<{ children: ReactNode }> = (props) =>\n unstableRef.current.active ? unstableRef.current.createPortal(props.children) : null\n\n // set the displayName explicit for DevTools\n result.displayName = 'DropdownContentRoot'\n\n return result\n }, [])\n\n const memoizedOnClickTrigger = useCallback((rect: Rect) => {\n setActive((current) => {\n const newActive = !current\n\n if (newActive) {\n setTriggerRect(rect)\n }\n\n return newActive\n })\n }, [])\n\n const onClickCloser = useCallback(() => {\n setActive(false)\n\n // return focus to the Trigger\n getFirstTabbable(triggerElementRef)?.focus()\n }, [])\n\n useEffect(() => {\n if (portalRoot) {\n portalRoot.setAttribute('id', contentId)\n }\n\n const onClickBody = (e: any) => {\n // ignore events from events within DropdownTrigger and DropdownContent\n if (!isEventFromChild(e, triggerElementRef.current) && !isChildPortal(e.target)) {\n setActive(false)\n }\n }\n\n document.body.addEventListener('click', onClickBody, false)\n\n return () => {\n document.body.removeEventListener('click', onClickBody, false)\n }\n }, [isChildPortal, portalRoot, contentId])\n\n useEffect(() => {\n if (unstableRef.current.isPortalRootMounted()) {\n unstableRef.current[active ? 'onOpen' : 'onClose']?.()\n }\n }, [active])\n\n return (\n <PortalParentProvider>\n <DropdownContext.Provider\n value={{\n active,\n triggerRect,\n triggerElementRef,\n rootTriggerRef: rootTriggerRef || triggerElementRef || null,\n memoizedOnClickTrigger,\n onClickCloser,\n DropdownContentRoot,\n contentId,\n }}\n >\n {children}\n </DropdownContext.Provider>\n </PortalParentProvider>\n )\n}\n"],"names":[],"mappings":";;;;;;AAsCA;AAEO;AACL;AACA;;AAEA;;;;;;;AAOA;AACA;AACD;AAEM;;;;AAKL;AAGA;AACA;;;;;;;AAQC;;;;;;;;;AAUD;AACE;;AAIA;AAEA;;AAGF;AACE;AACE;;;;AAMA;AACF;;AAGF;;;AAIE;;;;AAKE;;AAGF;;AAEE;;;AAGF;;AAIA;;AAEA;;;AAIA;AACE;;AAEJ;;;;;AASQ;;;;;AAKD;AAMT;;"}
@@ -7,7 +7,7 @@ var index = require('./../../../vendor/.pnpm/tailwind-variants@0.3.1_tailwindcss
7
7
  var hooks_useObjectAttributes = require('../../../hooks/useObjectAttributes.cjs');
8
8
  require('../../../intl/IntlProvider.cjs');
9
9
  var intl_useIntl = require('../../../intl/useIntl.cjs');
10
- require('react-intl');
10
+ require('../../../intl/Localizer.cjs');
11
11
  require('../../../_virtual/dayjs.min.cjs');
12
12
  require('../../../intl/TimeFormatter.cjs');
13
13
  var components_Button_Button = require('../../Button/Button.cjs');
@@ -5,7 +5,7 @@ import { tv as ce } from './../../../vendor/.pnpm/tailwind-variants@0.3.1_tailwi
5
5
  import { useObjectAttributes } from '../../../hooks/useObjectAttributes.js';
6
6
  import '../../../intl/IntlProvider.js';
7
7
  import { useIntl } from '../../../intl/useIntl.js';
8
- import 'react-intl';
8
+ import '../../../intl/Localizer.js';
9
9
  import '../../../_virtual/dayjs.min.js';
10
10
  import '../../../intl/TimeFormatter.js';
11
11
  import { Button } from '../../Button/Button.js';
@@ -3,12 +3,11 @@
3
3
 
4
4
  var jsxRuntime = require('react/jsx-runtime');
5
5
  var React = require('react');
6
- var index$1 = require('../../../_virtual/index3.cjs');
7
6
  var index = require('./../../../vendor/.pnpm/tailwind-variants@0.3.1_tailwindcss@3.4.19_ts-node@10.9.2_@swc_core@1.15.17_@types_node@20.19.35_typescript@5.9.3__/vendor/tailwind-variants/dist/index.cjs');
8
7
  var hooks_useResponseStatus = require('../../../hooks/useResponseStatus.cjs');
9
8
  require('../../../intl/IntlProvider.cjs');
10
9
  var intl_useIntl = require('../../../intl/useIntl.cjs');
11
- require('react-intl');
10
+ require('../../../intl/Localizer.cjs');
12
11
  require('../../../_virtual/dayjs.min.cjs');
13
12
  require('../../../intl/TimeFormatter.cjs');
14
13
  var components_Button_Button = require('../../Button/Button.cjs');
@@ -94,7 +93,6 @@ const FilterDropdown = ({ trigger: orgTrigger, applyText, cancelText, resetText,
94
93
  defaultText: '絞り込み条件を解除',
95
94
  }),
96
95
  }), [filtered, trigger.text, applyText, cancelText, resetText, localize]);
97
- const filteredIconAlt = React.useMemo(() => index$1(decorated.filteredIconAlt), [decorated.filteredIconAlt]);
98
96
  const calcedResponseStatus = hooks_useResponseStatus.useResponseStatus(responseStatus);
99
97
  const classNamesMapper = React.useMemo(() => {
100
98
  const { iconWrapper, filteredIcon, inner, actionArea, resetButtonArea, rightButtonArea, message, } = classNameGenerator();
@@ -121,7 +119,7 @@ const FilterDropdown = ({ trigger: orgTrigger, applyText, cancelText, resetText,
121
119
  const { buttonSuffix, buttonContent } = React.useMemo(() => {
122
120
  const FilterIcon = (jsxRuntime.jsxs("span", { className: classNames.iconWrapper, children: [jsxRuntime.jsx(components_Icon_FaIcon.FaFilterIcon, { alt: trigger.onlyIcon ? decorated.trigger : undefined }), filtered && (
123
121
  // HINT: altに揃えたいが、styleが複雑になってしまうためaria-labelを利用している
124
- jsxRuntime.jsx(components_Icon_FaIcon.FaCircleCheckIcon, { "aria-label": filteredIconAlt, className: classNames.filteredIcon }))] }));
122
+ jsxRuntime.jsx(components_Icon_FaIcon.FaCircleCheckIcon, { "aria-label": decorated.filteredIconAlt, className: classNames.filteredIcon }))] }));
125
123
  if (trigger.onlyIcon) {
126
124
  return {
127
125
  buttonSuffix: undefined,
@@ -132,7 +130,7 @@ const FilterDropdown = ({ trigger: orgTrigger, applyText, cancelText, resetText,
132
130
  buttonSuffix: FilterIcon,
133
131
  buttonContent: decorated.trigger,
134
132
  };
135
- }, [filtered, decorated.trigger, trigger.onlyIcon, filteredIconAlt, classNames]);
133
+ }, [filtered, decorated.trigger, decorated.filteredIconAlt, trigger.onlyIcon, classNames]);
136
134
  return (jsxRuntime.jsxs(components_Dropdown_Dropdown.Dropdown, { onOpen: onOpen, onClose: onClose, children: [jsxRuntime.jsx(components_Dropdown_DropdownTrigger.DropdownTrigger, { tooltip: { show: trigger.onlyIcon, message: decorated.trigger }, children: jsxRuntime.jsx(components_Button_Button.Button, { ...rest, suffix: buttonSuffix, size: trigger.size, children: buttonContent }) }), jsxRuntime.jsx(components_Dropdown_DropdownContent.DropdownContent, { controllable: true, children: jsxRuntime.jsxs("form", { onSubmit: ON_SUBMIT, children: [jsxRuntime.jsx("div", { className: classNames.inner, children: children }), jsxRuntime.jsxs(components_Layout_Stack_Stack.Stack, { gap: 0.5, className: classNames.actionArea, children: [jsxRuntime.jsxs(components_Layout_Cluster_Cluster.Cluster, { gap: 1, align: "center", justify: "space-between", children: [onReset && (jsxRuntime.jsx("div", { className: classNames.resetButtonArea, children: jsxRuntime.jsx(components_Button_Button.Button, { variant: "text", size: "S", prefix: jsxRuntime.jsx(components_Icon_FaIcon.FaRotateLeftIcon, {}), onClick: onReset, disabled: calcedResponseStatus.isProcessing, children: decorated.resetText }) })), jsxRuntime.jsxs(components_Layout_Cluster_Cluster.Cluster, { gap: CONTROL_CLUSTER_GAP, justify: "flex-end", className: classNames.rightButtonArea, children: [jsxRuntime.jsx(components_Dropdown_DropdownCloser.DropdownCloser, { children: jsxRuntime.jsx(components_Button_Button.Button, { onClick: onCancel, disabled: calcedResponseStatus.isProcessing, children: decorated.cancelText }) }), jsxRuntime.jsx(components_Dropdown_DropdownCloser.DropdownCloser, { children: jsxRuntime.jsx(components_Button_Button.Button, { variant: "primary", onClick: onApply, loading: calcedResponseStatus.isProcessing, children: decorated.applyText }) })] })] }), calcedResponseStatus.message && (jsxRuntime.jsx("div", { className: classNames.message, children: jsxRuntime.jsx(components_ResponseMessage_ResponseMessage.ResponseMessage, { status: calcedResponseStatus.status, role: "alert", children: calcedResponseStatus.message }) }))] })] }) })] }));
137
135
  };
138
136