smarthr-ui 102.1.0 → 103.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/AccordionPanel/client/AccordionPanelTrigger.cjs +0 -1
- package/lib/components/AccordionPanel/client/AccordionPanelTrigger.cjs.map +1 -1
- package/lib/components/AccordionPanel/client/AccordionPanelTrigger.js +0 -1
- package/lib/components/AccordionPanel/client/AccordionPanelTrigger.js.map +1 -1
- package/lib/components/AppHeader/AppHeader.cjs.map +1 -1
- package/lib/components/AppHeader/AppHeader.js.map +1 -1
- package/lib/components/AppHeader/components/common/AppLauncherFeatures.cjs +5 -4
- package/lib/components/AppHeader/components/common/AppLauncherFeatures.cjs.map +1 -1
- package/lib/components/AppHeader/components/common/AppLauncherFeatures.js +5 -4
- package/lib/components/AppHeader/components/common/AppLauncherFeatures.js.map +1 -1
- package/lib/components/AppHeader/components/common/AppLauncherSortDropdown.cjs +8 -7
- package/lib/components/AppHeader/components/common/AppLauncherSortDropdown.cjs.map +1 -1
- package/lib/components/AppHeader/components/common/AppLauncherSortDropdown.js +8 -7
- package/lib/components/AppHeader/components/common/AppLauncherSortDropdown.js.map +1 -1
- package/lib/components/AppHeader/components/desktop/AppLauncher.cjs +6 -5
- package/lib/components/AppHeader/components/desktop/AppLauncher.cjs.map +1 -1
- package/lib/components/AppHeader/components/desktop/AppLauncher.js +6 -5
- package/lib/components/AppHeader/components/desktop/AppLauncher.js.map +1 -1
- package/lib/components/AppHeader/components/desktop/DesktopHeader.cjs +9 -8
- package/lib/components/AppHeader/components/desktop/DesktopHeader.cjs.map +1 -1
- package/lib/components/AppHeader/components/desktop/DesktopHeader.js +9 -8
- package/lib/components/AppHeader/components/desktop/DesktopHeader.js.map +1 -1
- package/lib/components/AppHeader/components/desktop/Navigation.cjs +0 -1
- package/lib/components/AppHeader/components/desktop/Navigation.cjs.map +1 -1
- package/lib/components/AppHeader/components/desktop/Navigation.js +0 -1
- package/lib/components/AppHeader/components/desktop/Navigation.js.map +1 -1
- package/lib/components/AppHeader/components/desktop/ReleaseNotesDropdown.cjs +8 -8
- package/lib/components/AppHeader/components/desktop/ReleaseNotesDropdown.js +8 -8
- package/lib/components/AppHeader/components/desktop/UserInfo.cjs +0 -1
- package/lib/components/AppHeader/components/desktop/UserInfo.cjs.map +1 -1
- package/lib/components/AppHeader/components/desktop/UserInfo.js +0 -1
- package/lib/components/AppHeader/components/desktop/UserInfo.js.map +1 -1
- package/lib/components/AppHeader/components/mobile/AppLauncher.cjs +5 -3
- package/lib/components/AppHeader/components/mobile/AppLauncher.cjs.map +1 -1
- package/lib/components/AppHeader/components/mobile/AppLauncher.js +5 -3
- package/lib/components/AppHeader/components/mobile/AppLauncher.js.map +1 -1
- package/lib/components/AppHeader/components/mobile/AppLauncherContext.cjs +1 -3
- package/lib/components/AppHeader/components/mobile/AppLauncherContext.cjs.map +1 -1
- package/lib/components/AppHeader/components/mobile/AppLauncherContext.js +1 -3
- package/lib/components/AppHeader/components/mobile/AppLauncherContext.js.map +1 -1
- package/lib/components/AppHeader/components/mobile/AppLauncherFilterDropdown.cjs +8 -7
- package/lib/components/AppHeader/components/mobile/AppLauncherFilterDropdown.cjs.map +1 -1
- package/lib/components/AppHeader/components/mobile/AppLauncherFilterDropdown.js +8 -7
- package/lib/components/AppHeader/components/mobile/AppLauncherFilterDropdown.js.map +1 -1
- package/lib/components/AppHeader/components/mobile/Help.cjs +8 -7
- package/lib/components/AppHeader/components/mobile/Help.cjs.map +1 -1
- package/lib/components/AppHeader/components/mobile/Help.js +8 -7
- package/lib/components/AppHeader/components/mobile/Help.js.map +1 -1
- package/lib/components/AppHeader/components/mobile/LanguageSelector.cjs +6 -4
- package/lib/components/AppHeader/components/mobile/LanguageSelector.cjs.map +1 -1
- package/lib/components/AppHeader/components/mobile/LanguageSelector.js +6 -4
- package/lib/components/AppHeader/components/mobile/LanguageSelector.js.map +1 -1
- package/lib/components/AppHeader/components/mobile/Menu.cjs +4 -2
- package/lib/components/AppHeader/components/mobile/Menu.cjs.map +1 -1
- package/lib/components/AppHeader/components/mobile/Menu.js +4 -2
- package/lib/components/AppHeader/components/mobile/Menu.js.map +1 -1
- package/lib/components/AppHeader/components/mobile/MenuAccordion.cjs +5 -5
- package/lib/components/AppHeader/components/mobile/MenuAccordion.js +5 -5
- package/lib/components/AppHeader/components/mobile/MenuDialog.cjs +10 -9
- package/lib/components/AppHeader/components/mobile/MenuDialog.cjs.map +1 -1
- package/lib/components/AppHeader/components/mobile/MenuDialog.js +10 -9
- package/lib/components/AppHeader/components/mobile/MenuDialog.js.map +1 -1
- package/lib/components/AppHeader/components/mobile/MenuSubHeading.cjs +5 -4
- package/lib/components/AppHeader/components/mobile/MenuSubHeading.cjs.map +1 -1
- package/lib/components/AppHeader/components/mobile/MenuSubHeading.js +5 -4
- package/lib/components/AppHeader/components/mobile/MenuSubHeading.js.map +1 -1
- package/lib/components/AppHeader/components/mobile/MobileHeader.cjs +1 -0
- package/lib/components/AppHeader/components/mobile/MobileHeader.cjs.map +1 -1
- package/lib/components/AppHeader/components/mobile/MobileHeader.js +1 -0
- package/lib/components/AppHeader/components/mobile/MobileHeader.js.map +1 -1
- package/lib/components/AppHeader/components/mobile/NavigationContext.cjs +1 -3
- package/lib/components/AppHeader/components/mobile/NavigationContext.cjs.map +1 -1
- package/lib/components/AppHeader/components/mobile/NavigationContext.js +1 -3
- package/lib/components/AppHeader/components/mobile/NavigationContext.js.map +1 -1
- package/lib/components/AppHeader/components/mobile/NavigationItem.cjs.map +1 -1
- package/lib/components/AppHeader/components/mobile/NavigationItem.js.map +1 -1
- package/lib/components/AppHeader/components/mobile/ReleaseNote.cjs +1 -1
- package/lib/components/AppHeader/components/mobile/ReleaseNote.cjs.map +1 -1
- package/lib/components/AppHeader/components/mobile/ReleaseNote.js +1 -1
- package/lib/components/AppHeader/components/mobile/ReleaseNote.js.map +1 -1
- package/lib/components/AppHeader/components/mobile/ReleaseNoteContext.cjs +1 -3
- package/lib/components/AppHeader/components/mobile/ReleaseNoteContext.cjs.map +1 -1
- package/lib/components/AppHeader/components/mobile/ReleaseNoteContext.js +1 -3
- package/lib/components/AppHeader/components/mobile/ReleaseNoteContext.js.map +1 -1
- package/lib/components/AppHeader/components/mobile/UserInfo.cjs +14 -9
- package/lib/components/AppHeader/components/mobile/UserInfo.cjs.map +1 -1
- package/lib/components/AppHeader/components/mobile/UserInfo.js +14 -9
- package/lib/components/AppHeader/components/mobile/UserInfo.js.map +1 -1
- package/lib/components/AppNavi/AppNavi.cjs.map +1 -1
- package/lib/components/AppNavi/AppNavi.js.map +1 -1
- package/lib/components/AppNavi/AppNaviButton.cjs +9 -2
- package/lib/components/AppNavi/AppNaviButton.cjs.map +1 -1
- package/lib/components/AppNavi/AppNaviButton.js +9 -2
- package/lib/components/AppNavi/AppNaviButton.js.map +1 -1
- package/lib/components/AppNavi/AppNaviDropdown.cjs +10 -8
- package/lib/components/AppNavi/AppNaviDropdown.cjs.map +1 -1
- package/lib/components/AppNavi/AppNaviDropdown.js +10 -8
- package/lib/components/AppNavi/AppNaviDropdown.js.map +1 -1
- package/lib/components/AppNavi/AppNaviDropdownMenuButton.cjs.map +1 -1
- package/lib/components/AppNavi/AppNaviDropdownMenuButton.js.map +1 -1
- package/lib/components/Browser/BrowserItem.cjs +0 -1
- package/lib/components/Browser/BrowserItem.cjs.map +1 -1
- package/lib/components/Browser/BrowserItem.js +0 -1
- package/lib/components/Browser/BrowserItem.js.map +1 -1
- package/lib/components/Button/AnchorButton.cjs +0 -2
- package/lib/components/Button/AnchorButton.cjs.map +1 -1
- package/lib/components/Button/AnchorButton.d.ts +1 -4
- package/lib/components/Button/AnchorButton.js +0 -2
- package/lib/components/Button/AnchorButton.js.map +1 -1
- package/lib/components/Button/Button.cjs +0 -2
- package/lib/components/Button/Button.cjs.map +1 -1
- package/lib/components/Button/Button.js +0 -2
- package/lib/components/Button/Button.js.map +1 -1
- package/lib/components/Button/style.cjs +1 -1
- package/lib/components/Button/style.cjs.map +1 -1
- package/lib/components/Button/style.js +1 -1
- package/lib/components/Button/style.js.map +1 -1
- package/lib/components/Combobox/client/MultiCombobox/MultiCombobox.cjs +3 -4
- package/lib/components/Combobox/client/MultiCombobox/MultiCombobox.cjs.map +1 -1
- package/lib/components/Combobox/client/MultiCombobox/MultiCombobox.d.ts +2 -2
- package/lib/components/Combobox/client/MultiCombobox/MultiCombobox.js +3 -4
- package/lib/components/Combobox/client/MultiCombobox/MultiCombobox.js.map +1 -1
- package/lib/components/Combobox/client/MultiCombobox/MultiSelectedItem.cjs +5 -3
- package/lib/components/Combobox/client/MultiCombobox/MultiSelectedItem.cjs.map +1 -1
- package/lib/components/Combobox/client/MultiCombobox/MultiSelectedItem.js +5 -3
- package/lib/components/Combobox/client/MultiCombobox/MultiSelectedItem.js.map +1 -1
- package/lib/components/Combobox/client/SingleCombobox/SingleCombobox.cjs +6 -6
- package/lib/components/Combobox/client/SingleCombobox/SingleCombobox.cjs.map +1 -1
- package/lib/components/Combobox/client/SingleCombobox/SingleCombobox.d.ts +2 -2
- package/lib/components/Combobox/client/SingleCombobox/SingleCombobox.js +6 -6
- package/lib/components/Combobox/client/SingleCombobox/SingleCombobox.js.map +1 -1
- package/lib/components/Combobox/client/types.d.ts +5 -5
- package/lib/components/Combobox/client/useListbox.cjs +5 -0
- package/lib/components/Combobox/client/useListbox.cjs.map +1 -1
- package/lib/components/Combobox/client/useListbox.d.ts +1 -1
- package/lib/components/Combobox/client/useListbox.js +5 -0
- package/lib/components/Combobox/client/useListbox.js.map +1 -1
- package/lib/components/Combobox/client/useOptions.cjs +3 -3
- package/lib/components/Combobox/client/useOptions.cjs.map +1 -1
- package/lib/components/Combobox/client/useOptions.d.ts +1 -1
- package/lib/components/Combobox/client/useOptions.js +3 -3
- package/lib/components/Combobox/client/useOptions.js.map +1 -1
- package/lib/components/DefinitionList/DefinitionList.cjs +0 -1
- package/lib/components/DefinitionList/DefinitionList.cjs.map +1 -1
- package/lib/components/DefinitionList/DefinitionList.js +0 -1
- package/lib/components/DefinitionList/DefinitionList.js.map +1 -1
- package/lib/components/DefinitionList/client/ItemWrapper.cjs +0 -1
- package/lib/components/DefinitionList/client/ItemWrapper.cjs.map +1 -1
- package/lib/components/DefinitionList/client/ItemWrapper.js +0 -1
- package/lib/components/DefinitionList/client/ItemWrapper.js.map +1 -1
- package/lib/components/Dialog/ControlledActionDialog/ControlledActionDialog.cjs +1 -1
- package/lib/components/Dialog/ControlledActionDialog/ControlledActionDialog.js +1 -1
- package/lib/components/Dialog/ControlledActionDialog/client/ActionDialogContent.cjs +7 -2
- package/lib/components/Dialog/ControlledActionDialog/client/ActionDialogContent.cjs.map +1 -1
- package/lib/components/Dialog/ControlledActionDialog/client/ActionDialogContent.js +7 -2
- package/lib/components/Dialog/ControlledActionDialog/client/ActionDialogContent.js.map +1 -1
- package/lib/components/Dialog/ControlledFormDialog/ControlledFormDialog.cjs +1 -1
- package/lib/components/Dialog/ControlledFormDialog/ControlledFormDialog.js +1 -1
- package/lib/components/Dialog/ControlledFormDialog/FormDialogContent.cjs +7 -2
- package/lib/components/Dialog/ControlledFormDialog/FormDialogContent.cjs.map +1 -1
- package/lib/components/Dialog/ControlledFormDialog/FormDialogContent.js +7 -2
- package/lib/components/Dialog/ControlledFormDialog/FormDialogContent.js.map +1 -1
- package/lib/components/Dialog/ControlledMessageDialog/ControlledMessageDialog.cjs +1 -1
- package/lib/components/Dialog/ControlledMessageDialog/ControlledMessageDialog.js +1 -1
- package/lib/components/Dialog/ControlledMessageDialog/MessageDialogContent.cjs +7 -2
- package/lib/components/Dialog/ControlledMessageDialog/MessageDialogContent.cjs.map +1 -1
- package/lib/components/Dialog/ControlledMessageDialog/MessageDialogContent.js +7 -2
- package/lib/components/Dialog/ControlledMessageDialog/MessageDialogContent.js.map +1 -1
- package/lib/components/Dialog/ControlledStepFormDialog/client/ControlledStepFormDialog.cjs +1 -1
- package/lib/components/Dialog/ControlledStepFormDialog/client/ControlledStepFormDialog.js +1 -1
- package/lib/components/Dialog/ControlledStepFormDialog/client/StepFormDialogContent.cjs +7 -2
- package/lib/components/Dialog/ControlledStepFormDialog/client/StepFormDialogContent.cjs.map +1 -1
- package/lib/components/Dialog/ControlledStepFormDialog/client/StepFormDialogContent.js +7 -2
- package/lib/components/Dialog/ControlledStepFormDialog/client/StepFormDialogContent.js.map +1 -1
- package/lib/components/Dialog/ControlledStepFormDialog/client/StepFormDialogProvider.cjs.map +1 -1
- package/lib/components/Dialog/ControlledStepFormDialog/client/StepFormDialogProvider.d.ts +1 -1
- package/lib/components/Dialog/ControlledStepFormDialog/client/StepFormDialogProvider.js.map +1 -1
- package/lib/components/Dialog/Dialog.cjs +1 -1
- package/lib/components/Dialog/Dialog.js +1 -1
- package/lib/components/Dialog/DialogBody.cjs +1 -1
- package/lib/components/Dialog/DialogBody.cjs.map +1 -1
- package/lib/components/Dialog/DialogBody.js +1 -1
- package/lib/components/Dialog/DialogBody.js.map +1 -1
- package/lib/components/Dialog/DialogHeading.cjs +0 -1
- package/lib/components/Dialog/DialogHeading.cjs.map +1 -1
- package/lib/components/Dialog/DialogHeading.js +0 -1
- package/lib/components/Dialog/DialogHeading.js.map +1 -1
- package/lib/components/Dialog/ModelessDialog/client/ModelessDialog.cjs +10 -9
- package/lib/components/Dialog/ModelessDialog/client/ModelessDialog.cjs.map +1 -1
- package/lib/components/Dialog/ModelessDialog/client/ModelessDialog.d.ts +0 -5
- package/lib/components/Dialog/ModelessDialog/client/ModelessDialog.js +10 -9
- package/lib/components/Dialog/ModelessDialog/client/ModelessDialog.js.map +1 -1
- package/lib/components/Dialog/client/DialogContent.cjs +4 -5
- package/lib/components/Dialog/client/DialogContent.cjs.map +1 -1
- package/lib/components/Dialog/client/DialogContent.d.ts +0 -5
- package/lib/components/Dialog/client/DialogContent.js +4 -5
- package/lib/components/Dialog/client/DialogContent.js.map +1 -1
- package/lib/components/Dialog/client/{DialogOverlap.cjs → DialogOverlapCenter.cjs} +3 -4
- package/lib/components/Dialog/client/DialogOverlapCenter.cjs.map +1 -0
- package/lib/components/Dialog/client/{DialogOverlap.d.ts → DialogOverlapCenter.d.ts} +1 -1
- package/lib/components/Dialog/client/{DialogOverlap.js → DialogOverlapCenter.js} +3 -4
- package/lib/components/Dialog/client/DialogOverlapCenter.js.map +1 -0
- package/lib/components/Dialog/client/index.cjs +2 -2
- package/lib/components/Dialog/client/index.d.ts +1 -1
- package/lib/components/Dialog/client/index.js +1 -1
- package/lib/components/Dialog/index.cjs +1 -1
- package/lib/components/Dialog/index.js +1 -1
- package/lib/components/Dialog/types.d.ts +1 -1
- package/lib/components/DropZone/client/ActualDropZone.cjs +3 -2
- package/lib/components/DropZone/client/ActualDropZone.cjs.map +1 -1
- package/lib/components/DropZone/client/ActualDropZone.js +3 -2
- package/lib/components/DropZone/client/ActualDropZone.js.map +1 -1
- package/lib/components/Dropdown/FilterDropdown/FilterDropdown.cjs +3 -3
- package/lib/components/Dropdown/FilterDropdown/FilterDropdown.js +3 -3
- package/lib/components/Dropdown/client/DropdownMenuButton/ButtonList.cjs.map +1 -1
- package/lib/components/Dropdown/client/DropdownMenuButton/ButtonList.js.map +1 -1
- package/lib/components/Dropdown/client/DropdownMenuButton/DropdownMenuButton.cjs +7 -4
- package/lib/components/Dropdown/client/DropdownMenuButton/DropdownMenuButton.cjs.map +1 -1
- package/lib/components/Dropdown/client/DropdownMenuButton/DropdownMenuButton.js +8 -5
- package/lib/components/Dropdown/client/DropdownMenuButton/DropdownMenuButton.js.map +1 -1
- package/lib/components/Dropdown/client/SortDropdown/SortDropdown.cjs +5 -5
- package/lib/components/Dropdown/client/SortDropdown/SortDropdown.js +5 -5
- package/lib/components/ErrorScreen/ErrorScreen.cjs +0 -1
- package/lib/components/ErrorScreen/ErrorScreen.cjs.map +1 -1
- package/lib/components/ErrorScreen/ErrorScreen.js +0 -1
- package/lib/components/ErrorScreen/ErrorScreen.js.map +1 -1
- package/lib/components/ErrorScreen/UnauthorizedErrorScreen.cjs +7 -2
- package/lib/components/ErrorScreen/UnauthorizedErrorScreen.cjs.map +1 -1
- package/lib/components/ErrorScreen/UnauthorizedErrorScreen.js +7 -2
- package/lib/components/ErrorScreen/UnauthorizedErrorScreen.js.map +1 -1
- package/lib/components/ErrorScreen/UnexpectedErrorScreen.cjs +0 -1
- package/lib/components/ErrorScreen/UnexpectedErrorScreen.cjs.map +1 -1
- package/lib/components/ErrorScreen/UnexpectedErrorScreen.js +0 -1
- package/lib/components/ErrorScreen/UnexpectedErrorScreen.js.map +1 -1
- package/lib/components/FileViewer/client/FileViewer.cjs +8 -8
- package/lib/components/FileViewer/client/FileViewer.js +8 -8
- package/lib/components/FileViewer/client/SearchController.cjs +3 -2
- package/lib/components/FileViewer/client/SearchController.cjs.map +1 -1
- package/lib/components/FileViewer/client/SearchController.js +3 -2
- package/lib/components/FileViewer/client/SearchController.js.map +1 -1
- package/lib/components/FloatArea/FloatArea.cjs +0 -1
- package/lib/components/FloatArea/FloatArea.cjs.map +1 -1
- package/lib/components/FloatArea/FloatArea.js +0 -1
- package/lib/components/FloatArea/FloatArea.js.map +1 -1
- package/lib/components/FormGroup/client/Fieldset.cjs +0 -1
- package/lib/components/FormGroup/client/Fieldset.cjs.map +1 -1
- package/lib/components/FormGroup/client/Fieldset.js +0 -1
- package/lib/components/FormGroup/client/Fieldset.js.map +1 -1
- package/lib/components/FormGroup/client/FormControl.cjs +4 -4
- package/lib/components/FormGroup/client/FormControl.cjs.map +1 -1
- package/lib/components/FormGroup/client/FormControl.js +4 -4
- package/lib/components/FormGroup/client/FormControl.js.map +1 -1
- package/lib/components/FormGroup/client/FormGroup.cjs +0 -1
- package/lib/components/FormGroup/client/FormGroup.cjs.map +1 -1
- package/lib/components/FormGroup/client/FormGroup.js +0 -1
- package/lib/components/FormGroup/client/FormGroup.js.map +1 -1
- package/lib/components/Header/AppLauncher/AppLauncher.cjs +8 -8
- package/lib/components/Header/AppLauncher/AppLauncher.cjs.map +1 -1
- package/lib/components/Header/AppLauncher/AppLauncher.js +8 -8
- package/lib/components/Header/AppLauncher/AppLauncher.js.map +1 -1
- package/lib/components/Header/Header.cjs +7 -2
- package/lib/components/Header/Header.cjs.map +1 -1
- package/lib/components/Header/Header.js +7 -2
- package/lib/components/Header/Header.js.map +1 -1
- package/lib/components/Header/HeaderLink.cjs +5 -2
- package/lib/components/Header/HeaderLink.cjs.map +1 -1
- package/lib/components/Header/HeaderLink.js +5 -2
- package/lib/components/Header/HeaderLink.js.map +1 -1
- package/lib/components/Header/LanguageSwitcher/client/LanguageSwitcher.cjs +9 -8
- package/lib/components/Header/LanguageSwitcher/client/LanguageSwitcher.cjs.map +1 -1
- package/lib/components/Header/LanguageSwitcher/client/LanguageSwitcher.js +9 -8
- package/lib/components/Header/LanguageSwitcher/client/LanguageSwitcher.js.map +1 -1
- package/lib/components/Icon/FaIcon.cjs +22 -0
- package/lib/components/Icon/FaIcon.cjs.map +1 -1
- package/lib/components/Icon/FaIcon.d.ts +11 -0
- package/lib/components/Icon/FaIcon.js +13 -2
- package/lib/components/Icon/FaIcon.js.map +1 -1
- package/lib/components/Icon/generateIcon.cjs +3 -4
- package/lib/components/Icon/generateIcon.cjs.map +1 -1
- package/lib/components/Icon/generateIcon.d.ts +0 -6
- package/lib/components/Icon/generateIcon.js +3 -4
- package/lib/components/Icon/generateIcon.js.map +1 -1
- package/lib/components/Icon/index.cjs +11 -0
- package/lib/components/Icon/index.cjs.map +1 -1
- package/lib/components/Icon/index.js +1 -1
- package/lib/components/InformationPanel/client/InformationPanel.cjs +5 -5
- package/lib/components/InformationPanel/client/InformationPanel.js +5 -5
- package/lib/components/Input/WarekiPicker/client/Calendar/Calendar.cjs +3 -3
- package/lib/components/Input/WarekiPicker/client/Calendar/Calendar.js +3 -3
- package/lib/components/Input/WarekiPicker/client/Calendar/CalendarTable.cjs +9 -2
- package/lib/components/Input/WarekiPicker/client/Calendar/CalendarTable.cjs.map +1 -1
- package/lib/components/Input/WarekiPicker/client/Calendar/CalendarTable.js +9 -2
- package/lib/components/Input/WarekiPicker/client/Calendar/CalendarTable.js.map +1 -1
- package/lib/components/Input/WarekiPicker/client/Calendar/YearPicker.cjs +9 -2
- package/lib/components/Input/WarekiPicker/client/Calendar/YearPicker.cjs.map +1 -1
- package/lib/components/Input/WarekiPicker/client/Calendar/YearPicker.js +9 -2
- package/lib/components/Input/WarekiPicker/client/Calendar/YearPicker.js.map +1 -1
- package/lib/components/Input/WarekiPicker/client/WarekiPicker.cjs +11 -11
- package/lib/components/Input/WarekiPicker/client/WarekiPicker.cjs.map +1 -1
- package/lib/components/Input/WarekiPicker/client/WarekiPicker.d.ts +0 -4
- package/lib/components/Input/WarekiPicker/client/WarekiPicker.js +11 -11
- package/lib/components/Input/WarekiPicker/client/WarekiPicker.js.map +1 -1
- package/lib/components/Input/client/Input.cjs +40 -2
- package/lib/components/Input/client/Input.cjs.map +1 -1
- package/lib/components/Input/client/Input.js +41 -3
- package/lib/components/Input/client/Input.js.map +1 -1
- package/lib/components/InputFile/client/DownloadAnchorButton.cjs +5 -2
- package/lib/components/InputFile/client/DownloadAnchorButton.cjs.map +1 -1
- package/lib/components/InputFile/client/DownloadAnchorButton.js +5 -2
- package/lib/components/InputFile/client/DownloadAnchorButton.js.map +1 -1
- package/lib/components/InputFile/client/FilePreviewDialog.cjs +3 -4
- package/lib/components/InputFile/client/FilePreviewDialog.cjs.map +1 -1
- package/lib/components/InputFile/client/FilePreviewDialog.d.ts +3 -1
- package/lib/components/InputFile/client/FilePreviewDialog.js +3 -4
- package/lib/components/InputFile/client/FilePreviewDialog.js.map +1 -1
- package/lib/components/InputFile/client/InputFileMultiplyAppendable.cjs +1 -2
- package/lib/components/InputFile/client/InputFileMultiplyAppendable.cjs.map +1 -1
- package/lib/components/InputFile/client/InputFileMultiplyAppendable.js +1 -2
- package/lib/components/InputFile/client/InputFileMultiplyAppendable.js.map +1 -1
- package/lib/components/InputFile/client/InputFileNative.cjs +1 -2
- package/lib/components/InputFile/client/InputFileNative.cjs.map +1 -1
- package/lib/components/InputFile/client/InputFileNative.js +1 -2
- package/lib/components/InputFile/client/InputFileNative.js.map +1 -1
- package/lib/components/InputFile/client/parts.cjs +3 -2
- package/lib/components/InputFile/client/parts.cjs.map +1 -1
- package/lib/components/InputFile/client/parts.js +3 -2
- package/lib/components/InputFile/client/parts.js.map +1 -1
- package/lib/components/InputFile/types.d.ts +4 -1
- package/lib/components/Layout/index.cjs +0 -2
- package/lib/components/Layout/index.cjs.map +1 -1
- package/lib/components/Layout/index.d.ts +0 -1
- package/lib/components/Layout/index.js +0 -1
- package/lib/components/Layout/index.js.map +1 -1
- package/lib/components/NotificationBar/NotificationBar.cjs +3 -3
- package/lib/components/NotificationBar/NotificationBar.js +3 -3
- package/lib/components/PageCounter/PageCounter.cjs +0 -1
- package/lib/components/PageCounter/PageCounter.cjs.map +1 -1
- package/lib/components/PageCounter/PageCounter.js +0 -1
- package/lib/components/PageCounter/PageCounter.js.map +1 -1
- package/lib/components/Pagination/Pagination.cjs +0 -1
- package/lib/components/Pagination/Pagination.cjs.map +1 -1
- package/lib/components/Pagination/Pagination.js +0 -1
- package/lib/components/Pagination/Pagination.js.map +1 -1
- package/lib/components/SegmentedControl/client/SegmentedControl.cjs +7 -1
- package/lib/components/SegmentedControl/client/SegmentedControl.cjs.map +1 -1
- package/lib/components/SegmentedControl/client/SegmentedControl.js +7 -1
- package/lib/components/SegmentedControl/client/SegmentedControl.js.map +1 -1
- package/lib/components/SideNav/SideNavItemButton.cjs +9 -3
- package/lib/components/SideNav/SideNavItemButton.cjs.map +1 -1
- package/lib/components/SideNav/SideNavItemButton.js +9 -3
- package/lib/components/SideNav/SideNavItemButton.js.map +1 -1
- package/lib/components/Switch/Switch.cjs +2 -2
- package/lib/components/Switch/Switch.cjs.map +1 -1
- package/lib/components/Switch/Switch.js +2 -2
- package/lib/components/Switch/Switch.js.map +1 -1
- package/lib/components/TabBar/TabBar.cjs +0 -1
- package/lib/components/TabBar/TabBar.cjs.map +1 -1
- package/lib/components/TabBar/TabBar.js +0 -1
- package/lib/components/TabBar/TabBar.js.map +1 -1
- package/lib/components/TabBar/client/TabItem.cjs +4 -2
- package/lib/components/TabBar/client/TabItem.cjs.map +1 -1
- package/lib/components/TabBar/client/TabItem.js +4 -2
- package/lib/components/TabBar/client/TabItem.js.map +1 -1
- package/lib/components/Table/Td.cjs +1 -6
- package/lib/components/Table/Td.cjs.map +1 -1
- package/lib/components/Table/Td.js +1 -6
- package/lib/components/Table/Td.js.map +1 -1
- package/lib/components/Table/Th/Th.cjs +1 -4
- package/lib/components/Table/Th/Th.cjs.map +1 -1
- package/lib/components/Table/Th/Th.js +1 -4
- package/lib/components/Table/Th/Th.js.map +1 -1
- package/lib/components/Table/Th/ThSortButton.cjs +4 -2
- package/lib/components/Table/Th/ThSortButton.cjs.map +1 -1
- package/lib/components/Table/Th/ThSortButton.js +4 -2
- package/lib/components/Table/Th/ThSortButton.js.map +1 -1
- package/lib/components/TextLink/TextLink.cjs +8 -1
- package/lib/components/TextLink/TextLink.cjs.map +1 -1
- package/lib/components/TextLink/TextLink.js +8 -1
- package/lib/components/TextLink/TextLink.js.map +1 -1
- package/lib/components/Timeline/TimelineItem.cjs +0 -1
- package/lib/components/Timeline/TimelineItem.cjs.map +1 -1
- package/lib/components/Timeline/TimelineItem.js +0 -1
- package/lib/components/Timeline/TimelineItem.js.map +1 -1
- package/lib/hooks/client/useAreaClickCallbackRef.cjs.map +1 -1
- package/lib/hooks/client/useAreaClickCallbackRef.d.ts +1 -1
- package/lib/hooks/client/useAreaClickCallbackRef.js.map +1 -1
- package/lib/hooks/client/useMergeRefs/useMergeRefs.cjs +1 -0
- package/lib/hooks/client/useMergeRefs/useMergeRefs.cjs.map +1 -1
- package/lib/hooks/client/useMergeRefs/useMergeRefs.js +1 -0
- package/lib/hooks/client/useMergeRefs/useMergeRefs.js.map +1 -1
- package/lib/hooks/client/useTheme.cjs.map +1 -1
- package/lib/hooks/client/useTheme.d.ts +0 -2
- package/lib/hooks/client/useTheme.js.map +1 -1
- package/lib/index.cjs +12 -7
- package/lib/index.cjs.map +1 -1
- package/lib/index.d.ts +1 -5
- package/lib/index.js +2 -5
- package/lib/index.js.map +1 -1
- package/lib/intl/locales/en_us.json.cjs +3 -1
- package/lib/intl/locales/en_us.json.cjs.map +1 -1
- package/lib/intl/locales/en_us.json.js +3 -1
- package/lib/intl/locales/en_us.json.js.map +1 -1
- package/lib/intl/locales/id_id.json.cjs +18 -1
- package/lib/intl/locales/id_id.json.cjs.map +1 -1
- package/lib/intl/locales/id_id.json.js +18 -1
- package/lib/intl/locales/id_id.json.js.map +1 -1
- package/lib/intl/locales/index.d.ts +46 -0
- package/lib/intl/locales/ja_easy.json.cjs +3 -1
- package/lib/intl/locales/ja_easy.json.cjs.map +1 -1
- package/lib/intl/locales/ja_easy.json.js +3 -1
- package/lib/intl/locales/ja_easy.json.js.map +1 -1
- package/lib/intl/locales/ko_kr.json.cjs +3 -1
- package/lib/intl/locales/ko_kr.json.cjs.map +1 -1
- package/lib/intl/locales/ko_kr.json.js +3 -1
- package/lib/intl/locales/ko_kr.json.js.map +1 -1
- package/lib/intl/locales/pt_br.json.cjs +18 -1
- package/lib/intl/locales/pt_br.json.cjs.map +1 -1
- package/lib/intl/locales/pt_br.json.js +18 -1
- package/lib/intl/locales/pt_br.json.js.map +1 -1
- package/lib/intl/locales/vi_vn.json.cjs +3 -1
- package/lib/intl/locales/vi_vn.json.cjs.map +1 -1
- package/lib/intl/locales/vi_vn.json.js +3 -1
- package/lib/intl/locales/vi_vn.json.js.map +1 -1
- package/lib/intl/locales/zh_hans_cn.json.cjs +3 -1
- package/lib/intl/locales/zh_hans_cn.json.cjs.map +1 -1
- package/lib/intl/locales/zh_hans_cn.json.js +3 -1
- package/lib/intl/locales/zh_hans_cn.json.js.map +1 -1
- package/lib/intl/locales/zh_hant_tw.json.cjs +3 -1
- package/lib/intl/locales/zh_hant_tw.json.cjs.map +1 -1
- package/lib/intl/locales/zh_hant_tw.json.js +3 -1
- package/lib/intl/locales/zh_hant_tw.json.js.map +1 -1
- package/lib/tailwind/index.cjs +0 -2
- package/lib/tailwind/index.cjs.map +1 -1
- package/lib/tailwind/index.d.ts +0 -1
- package/lib/tailwind/index.js +0 -1
- package/lib/tailwind/index.js.map +1 -1
- package/lib/themes/createColor.cjs.map +1 -1
- package/lib/themes/createColor.d.ts +0 -14
- package/lib/themes/createColor.js.map +1 -1
- package/lib/themes/createFontSize.cjs.map +1 -1
- package/lib/themes/createFontSize.d.ts +1 -0
- package/lib/themes/createFontSize.js.map +1 -1
- package/lib/themes/createLeading.cjs.map +1 -1
- package/lib/themes/createLeading.d.ts +0 -2
- package/lib/themes/createLeading.js.map +1 -1
- package/lib/themes/index.d.ts +1 -0
- package/lib/types/Gap.d.ts +0 -4
- package/lib/types/index.d.ts +0 -2
- package/lib/vendor/.pnpm/polished@4.3.1/vendor/polished/dist/polished.esm.cjs +2 -2
- package/lib/vendor/.pnpm/polished@4.3.1/vendor/polished/dist/polished.esm.cjs.map +1 -1
- package/lib/vendor/.pnpm/polished@4.3.1/vendor/polished/dist/polished.esm.js +2 -2
- package/lib/vendor/.pnpm/polished@4.3.1/vendor/polished/dist/polished.esm.js.map +1 -1
- package/lib/vendor/.pnpm/react-icons@5.7.0_react@19.3.1/vendor/react-icons/fa6/index.cjs +33 -0
- package/lib/vendor/.pnpm/react-icons@5.7.0_react@19.3.1/vendor/react-icons/fa6/index.cjs.map +1 -1
- package/lib/vendor/.pnpm/react-icons@5.7.0_react@19.3.1/vendor/react-icons/fa6/index.js +23 -1
- package/lib/vendor/.pnpm/react-icons@5.7.0_react@19.3.1/vendor/react-icons/fa6/index.js.map +1 -1
- package/metadata.json +1 -1
- package/package.json +15 -15
- package/smarthr-ui.css +8 -16
- package/lib/components/BottomFixedArea/client/BottomFixedArea.cjs +0 -73
- package/lib/components/BottomFixedArea/client/BottomFixedArea.cjs.map +0 -1
- package/lib/components/BottomFixedArea/client/BottomFixedArea.d.ts +0 -30
- package/lib/components/BottomFixedArea/client/BottomFixedArea.js +0 -71
- package/lib/components/BottomFixedArea/client/BottomFixedArea.js.map +0 -1
- package/lib/components/BottomFixedArea/client/index.cjs +0 -8
- package/lib/components/BottomFixedArea/client/index.cjs.map +0 -1
- package/lib/components/BottomFixedArea/client/index.d.ts +0 -1
- package/lib/components/BottomFixedArea/client/index.js +0 -2
- package/lib/components/BottomFixedArea/client/index.js.map +0 -1
- package/lib/components/BottomFixedArea/index.cjs +0 -8
- package/lib/components/BottomFixedArea/index.cjs.map +0 -1
- package/lib/components/BottomFixedArea/index.d.ts +0 -1
- package/lib/components/BottomFixedArea/index.js +0 -2
- package/lib/components/BottomFixedArea/index.js.map +0 -1
- package/lib/components/Dialog/client/DialogOverlap.cjs.map +0 -1
- package/lib/components/Dialog/client/DialogOverlap.js.map +0 -1
- package/lib/components/Layout/Sidebar/Sidebar.cjs +0 -169
- package/lib/components/Layout/Sidebar/Sidebar.cjs.map +0 -1
- package/lib/components/Layout/Sidebar/Sidebar.d.ts +0 -32
- package/lib/components/Layout/Sidebar/Sidebar.js +0 -167
- package/lib/components/Layout/Sidebar/Sidebar.js.map +0 -1
- package/lib/components/Layout/Sidebar/index.cjs +0 -8
- package/lib/components/Layout/Sidebar/index.cjs.map +0 -1
- package/lib/components/Layout/Sidebar/index.d.ts +0 -1
- package/lib/components/Layout/Sidebar/index.js +0 -2
- package/lib/components/Layout/Sidebar/index.js.map +0 -1
- package/lib/components/LineClamp/client/LineClamp.cjs +0 -95
- package/lib/components/LineClamp/client/LineClamp.cjs.map +0 -1
- package/lib/components/LineClamp/client/LineClamp.d.ts +0 -11
- package/lib/components/LineClamp/client/LineClamp.js +0 -93
- package/lib/components/LineClamp/client/LineClamp.js.map +0 -1
- package/lib/components/LineClamp/client/index.cjs +0 -8
- package/lib/components/LineClamp/client/index.cjs.map +0 -1
- package/lib/components/LineClamp/client/index.d.ts +0 -1
- package/lib/components/LineClamp/client/index.js +0 -2
- package/lib/components/LineClamp/client/index.js.map +0 -1
- package/lib/components/LineClamp/index.cjs +0 -8
- package/lib/components/LineClamp/index.cjs.map +0 -1
- package/lib/components/LineClamp/index.d.ts +0 -1
- package/lib/components/LineClamp/index.js +0 -2
- package/lib/components/LineClamp/index.js.map +0 -1
- package/lib/tailwind/fontSize.cjs +0 -15
- package/lib/tailwind/fontSize.cjs.map +0 -1
- package/lib/tailwind/fontSize.d.ts +0 -1
- package/lib/tailwind/fontSize.js +0 -9
- package/lib/tailwind/fontSize.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppLauncher.js","sources":["../../../../../src/components/AppHeader/components/desktop/AppLauncher.tsx"],"sourcesContent":["'use client' // eslint-disable-line local-rules/require-client-directory\n\nimport { type FC, type PropsWithChildren, memo, useCallback, useId, useMemo } from 'react'\nimport { tv } from 'tailwind-variants'\n\nimport { useTheme } from '../../../../hooks/client/useTheme'\nimport { Localizer, useLocalize } from '../../../../intl'\nimport { UnstyledButton } from '../../../Button'\nimport { Heading } from '../../../Heading'\nimport { FaCircleXmarkIcon, FaStarIcon } from '../../../Icon'\nimport { SearchInput } from '../../../Input'\nimport { Cluster } from '../../../Layout'\nimport { Scroller } from '../../../Scroller'\nimport { Section } from '../../../SectioningContent'\nimport { SideNav, SideNavItemButton } from '../../../SideNav'\nimport { HelpLink } from '../../../TextLink'\nimport { useAppLauncher } from '../../hooks/useAppLauncher'\nimport { AppLauncherFeatures } from '../common/AppLauncherFeatures'\nimport { AppLauncherSortDropdown } from '../common/AppLauncherSortDropdown'\n\nimport type { Launcher } from '../../types'\n\ntype Props = {\n features: Array<Launcher['feature']>\n loading?: boolean\n error?: boolean\n}\n\nconst classNameGenerator = tv({\n slots: {\n wrapper: [\n 'smarthr-ui-AppLauncher',\n 'shr-grid shr-h-[40rem] shr-w-[38rem] shr-grid-rows-[auto_1fr]',\n ],\n searchArea: [\n 'smarthr-ui-AppLauncher-searchArea',\n 'shr-border-b-shorthand shr-p-1',\n '[&_.smarthr-ui-Input]:shr-h-[42px]',\n ],\n inner: ['smarthr-ui-AppLauncher-inner', 'shr-grid shr-min-h-0 shr-grid-cols-[11rem_1fr]'],\n side: [\n 'smarthr-ui-AppLauncher-side',\n 'shr-border-r-shorthand shr-flex shr-flex-col shr-bg-column shr-pb-1 shr-pt-0.5',\n '[&_hr]:shr-m-0.5 [&_hr]:shr-h-[1px] [&_hr]:shr-border-none [&_hr]:shr-bg-border',\n ],\n sideNav: [\n '[&_.smarthr-ui-SideNav-item>button]:shr-px-1 [&_.smarthr-ui-SideNav-item>button]:shr-py-0.75',\n '[&_.smarthr-ui-SideNav-item>button>span]:shr-flex-nowrap',\n '[&_.smarthr-ui-SideNav-item>button_.smarthr-ui-Icon]:shr-shrink-0 [&_.smarthr-ui-SideNav-item>button_.smarthr-ui-Icon]:shr-align-bottom',\n ],\n sideNavHeading: ['shr-px-1 shr-py-0.75 shr-text-xs shr-text-black'],\n help: ['smarthr-ui-AppLauncher-help', 'shr-mt-auto shr-px-1 shr-text-xs'],\n main: ['smarthr-ui-AppLauncher-main', 'shr-grid shr-min-h-0'],\n mainInner: ['shr-grid shr-min-h-0 shr-grid-rows-[auto_1fr]'],\n contentHead: [\n 'shr-min-h-[2rem] shr-px-1 shr-py-0.75',\n '[&_.smarthr-ui-Heading]:shr-text-black',\n ],\n scrollArea: ['shr-h-[509px]'],\n },\n variants: {\n noIcon: {\n true: {\n sideNav: ['[&_.smarthr-ui-SideNav-item>button]:shr-pl-1.5'],\n },\n },\n selected: {\n false: {\n sideNav: ['[&_.smarthr-ui-SideNav-item>button_.smarthr-ui-Icon]:shr-text-grey'],\n },\n },\n },\n})\n\nconst CLASS_NAMES = (() => {\n const {\n wrapper,\n searchArea,\n inner,\n side,\n sideNav,\n sideNavHeading,\n help,\n main,\n mainInner,\n contentHead,\n scrollArea,\n } = classNameGenerator()\n\n return {\n wrapper: wrapper(),\n searchArea: searchArea(),\n inner: inner(),\n side: side(),\n unselectedSideNav: sideNav({ selected: false }),\n selectedSideNav: sideNav({ noIcon: true, selected: true }),\n sideNavHeading: sideNavHeading(),\n help: help(),\n main: main(),\n mainInner: mainInner(),\n contentHead: contentHead(),\n scrollArea: scrollArea(),\n }\n})()\n\nexport const AppLauncher: FC<Props> = ({ features: baseFeatures, loading, error }) => {\n const {\n features,\n page,\n mode,\n sortType,\n searchQuery,\n changePage,\n setSortType,\n onChangeSearchQuery,\n onClickClearSearchQuery,\n callbackRef,\n } = useAppLauncher(baseFeatures)\n\n const translated = useLocalize({\n searchInputTitle: {\n id: 'smarthr-ui/AppHeader/Launcher/searchInputTitle',\n defaultText: 'アプリ名を入力してください。',\n },\n favoriteModeText: {\n id: 'smarthr-ui/AppHeader/Launcher/favoriteModeText',\n defaultText: 'よく使うアプリ',\n },\n allModeText: {\n id: 'smarthr-ui/AppHeader/Launcher/allModeText',\n defaultText: 'すべてのアプリ',\n },\n })\n\n return (\n <div ref={callbackRef} className={CLASS_NAMES.wrapper}>\n <div className={CLASS_NAMES.searchArea}>\n <SearchInput\n name=\"search\"\n value={searchQuery}\n title={translated.searchInputTitle}\n width=\"100%\"\n onChange={onChangeSearchQuery}\n tooltipMessage={translated.searchInputTitle}\n // TODO: subActionArea内のクリックではInputが検索欄にフォーカスを戻さないため、\n // クリア後に検索欄へフォーカスを戻す対応が必要(mobile/AppLauncher.tsxも同様)\n subActionArea={\n mode === 'search' && <ClearSearchButton onClick={onClickClearSearchQuery} />\n }\n />\n </div>\n\n <div className={CLASS_NAMES.inner}>\n <SideNavs\n mode={mode}\n page={page}\n changePage={changePage}\n favoriteModeText={translated.favoriteModeText}\n allModeText={translated.allModeText}\n />\n <div className={CLASS_NAMES.main}>\n <Section className={CLASS_NAMES.mainInner}>\n <Cluster align=\"center\" justify=\"space-between\" className={CLASS_NAMES.contentHead}>\n <MemoizedSubSubBlockHeading>\n {mode === 'search' ? (\n <Localizer\n id=\"smarthr-ui/AppHeader/Launcher/searchResultText\"\n defaultText=\"検索結果\"\n />\n ) : page === 'favorite' ? (\n translated.favoriteModeText\n ) : (\n translated.allModeText\n )}\n </MemoizedSubSubBlockHeading>\n\n {(mode === 'search' || page === 'all') && (\n <AppLauncherSortDropdown sortType={sortType} handleSelectSortType={setSortType} />\n )}\n </Cluster>\n\n <Scroller className={CLASS_NAMES.scrollArea}>\n <AppLauncherFeatures\n features={features}\n page={page}\n loading={loading}\n error={error}\n />\n </Scroller>\n </Section>\n </div>\n </div>\n </div>\n )\n}\n\nconst ClearSearchButton = memo<{ onClick: () => void }>(({ onClick }) => (\n <UnstyledButton onClick={onClick}>\n <FaCircleXmarkIcon />\n </UnstyledButton>\n))\n\nconst SideNavs = memo<\n Pick<ReturnType<typeof useAppLauncher>, 'mode' | 'page' | 'changePage'> & {\n favoriteModeText: string\n allModeText: string\n }\n>(({ mode, page, changePage, favoriteModeText, allModeText }) => {\n const theme = useTheme()\n const listHeadingId = useId()\n const isNotSearch = mode !== 'search'\n const isFavorite = isNotSearch && page === 'favorite'\n const isAll = isNotSearch && page === 'all'\n\n const unselectedItems = useMemo(\n () => [\n {\n id: 'favorite',\n title: favoriteModeText,\n prefix: <FaStarIcon color={isFavorite ? theme.textColor.white : undefined} />,\n current: isFavorite,\n },\n ],\n [isFavorite, favoriteModeText, theme.textColor.white],\n )\n const selectedItems = useMemo(\n () => [\n {\n id: 'all',\n title: allModeText,\n current: isAll,\n },\n ],\n [isAll, allModeText],\n )\n\n const onClick = useCallback(\n (e: React.MouseEvent<HTMLButtonElement>) => {\n changePage(e.currentTarget.value as Launcher['page'])\n },\n [changePage],\n )\n\n return (\n <div className={CLASS_NAMES.side}>\n <SideNav size=\"S\" className={CLASS_NAMES.unselectedSideNav} aria-label={favoriteModeText}>\n {unselectedItems.map((item) => (\n <SideNavItemButton\n key={item.id}\n id={item.id}\n current={item.current}\n onClick={onClick}\n prefix={item.prefix}\n >\n {item.title}\n </SideNavItemButton>\n ))}\n </SideNav>\n\n <hr />\n\n <Section>\n <MemoizedAppListHeading id={listHeadingId} className={CLASS_NAMES.sideNavHeading} />\n <SideNav size=\"S\" className={CLASS_NAMES.selectedSideNav} aria-labelledby={listHeadingId}>\n {selectedItems.map((item) => (\n <SideNavItemButton key={item.id} id={item.id} current={item.current} onClick={onClick}>\n {item.title}\n </SideNavItemButton>\n ))}\n </SideNav>\n </Section>\n\n <HelpLinkArea className={CLASS_NAMES.help}>\n <Localizer id=\"smarthr-ui/AppHeader/Launcher/helpText\" defaultText=\"よく使うアプリとは\" />\n </HelpLinkArea>\n </div>\n )\n})\n\nconst HelpLinkArea = memo<PropsWithChildren<{ className: string }>>(({ children, className }) => (\n <div className={className}>\n <HelpLink\n href=\"https://support.smarthr.jp/ja/help/articles/2bfd350d-8e8b-4bbd-a209-426d2eb302cc/\"\n target=\"_blank\"\n >\n {children}\n </HelpLink>\n </div>\n))\n\nconst MemoizedSubSubBlockHeading = memo<PropsWithChildren<{ className?: string }>>(\n ({ children, className }) => (\n <Heading type=\"subSubBlockTitle\" className={className}>\n {children}\n </Heading>\n ),\n)\n\nconst MemoizedAppListHeading = memo<{ id: string; className?: string }>(({ id, className }) => (\n <Heading type=\"subSubBlockTitle\" id={id} className={className}>\n <Localizer id=\"smarthr-ui/AppHeader/Launcher/listText\" defaultText=\"アプリ一覧\" />\n </Heading>\n))\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BA;AACE;AACE;;;AAGC;AACD;;;;AAIC;AACD;AACA;;;;AAIC;AACD;;;;AAIC;;AAED;AACA;;AAEA;;;AAGC;;AAEF;AACD;AACE;AACE;;AAEC;AACF;AACD;AACE;;AAEC;AACF;AACF;AACF;AAED;;;;;;;;AAqBI;;;;;;;;AAQJ;AAEO;;;AAeH;AACE;AACA;AACD;AACD;AACE;AACA;AACD;AACD;AACE;AACA;AACD;AACF;;;;;AA8DH;AAEA;AAMA;AAME;AACA;AACA;AACA;AACA;AAEA;AAEI;AACE;AACA;AACA;AACA;AACD;AACF;AAGH;AAEI;AACE;AACA;AACA;AACD;AACF;AAIH;AAEI;AACF;AAIF;AAkCF;AAEA;AAWA;AAQA;;"}
|
|
1
|
+
{"version":3,"file":"AppLauncher.js","sources":["../../../../../src/components/AppHeader/components/desktop/AppLauncher.tsx"],"sourcesContent":["'use client' // eslint-disable-line local-rules/require-client\n\nimport { type FC, type PropsWithChildren, memo, useCallback, useId, useMemo } from 'react'\nimport { tv } from 'tailwind-variants'\n\nimport { useTheme } from '../../../../hooks/client/useTheme'\nimport { Localizer, useLocalize } from '../../../../intl'\nimport { UnstyledButton } from '../../../Button'\nimport { Heading } from '../../../Heading'\nimport { FaCircleXmarkIcon, FaStarIcon } from '../../../Icon'\nimport { SearchInput } from '../../../Input'\nimport { Cluster } from '../../../Layout'\nimport { Scroller } from '../../../Scroller'\nimport { Section } from '../../../SectioningContent'\nimport { SideNav, SideNavItemButton } from '../../../SideNav'\nimport { HelpLink } from '../../../TextLink'\nimport { useAppLauncher } from '../../hooks/useAppLauncher'\nimport { AppLauncherFeatures } from '../common/AppLauncherFeatures'\nimport { AppLauncherSortDropdown } from '../common/AppLauncherSortDropdown'\n\nimport type { Launcher } from '../../types'\n\ntype Props = {\n features: Array<Launcher['feature']>\n loading?: boolean\n error?: boolean\n}\n\nconst classNameGenerator = tv({\n slots: {\n wrapper: [\n 'smarthr-ui-AppLauncher',\n 'shr-grid shr-h-[40rem] shr-w-[38rem] shr-grid-rows-[auto_1fr]',\n ],\n searchArea: [\n 'smarthr-ui-AppLauncher-searchArea',\n 'shr-border-b-shorthand shr-p-1',\n '[&_.smarthr-ui-Input]:shr-h-[42px]',\n ],\n inner: ['smarthr-ui-AppLauncher-inner', 'shr-grid shr-min-h-0 shr-grid-cols-[11rem_1fr]'],\n side: [\n 'smarthr-ui-AppLauncher-side',\n 'shr-border-r-shorthand shr-flex shr-flex-col shr-bg-column shr-pb-1 shr-pt-0.5',\n '[&_hr]:shr-m-0.5 [&_hr]:shr-h-[1px] [&_hr]:shr-border-none [&_hr]:shr-bg-border',\n ],\n sideNav: [\n '[&_.smarthr-ui-SideNav-item>button]:shr-px-1 [&_.smarthr-ui-SideNav-item>button]:shr-py-0.75',\n '[&_.smarthr-ui-SideNav-item>button>span]:shr-flex-nowrap',\n '[&_.smarthr-ui-SideNav-item>button_.smarthr-ui-Icon]:shr-shrink-0 [&_.smarthr-ui-SideNav-item>button_.smarthr-ui-Icon]:shr-align-bottom',\n ],\n sideNavHeading: ['shr-px-1 shr-py-0.75 shr-text-xs shr-text-black'],\n help: ['smarthr-ui-AppLauncher-help', 'shr-mt-auto shr-px-1 shr-text-xs'],\n main: ['smarthr-ui-AppLauncher-main', 'shr-grid shr-min-h-0'],\n mainInner: ['shr-grid shr-min-h-0 shr-grid-rows-[auto_1fr]'],\n contentHead: [\n 'shr-min-h-[2rem] shr-px-1 shr-py-0.75',\n '[&_.smarthr-ui-Heading]:shr-text-black',\n ],\n scrollArea: ['shr-h-[509px]'],\n },\n variants: {\n noIcon: {\n true: {\n sideNav: ['[&_.smarthr-ui-SideNav-item>button]:shr-pl-1.5'],\n },\n },\n selected: {\n false: {\n sideNav: ['[&_.smarthr-ui-SideNav-item>button_.smarthr-ui-Icon]:shr-text-grey'],\n },\n },\n },\n})\n\nconst CLASS_NAMES = (() => {\n const {\n wrapper,\n searchArea,\n inner,\n side,\n sideNav,\n sideNavHeading,\n help,\n main,\n mainInner,\n contentHead,\n scrollArea,\n } = classNameGenerator()\n\n return {\n wrapper: wrapper(),\n searchArea: searchArea(),\n inner: inner(),\n side: side(),\n unselectedSideNav: sideNav({ selected: false }),\n selectedSideNav: sideNav({ noIcon: true, selected: true }),\n sideNavHeading: sideNavHeading(),\n help: help(),\n main: main(),\n mainInner: mainInner(),\n contentHead: contentHead(),\n scrollArea: scrollArea(),\n }\n})()\n\nexport const AppLauncher: FC<Props> = ({ features: baseFeatures, loading, error }) => {\n const {\n features,\n page,\n mode,\n sortType,\n searchQuery,\n changePage,\n setSortType,\n onChangeSearchQuery,\n onClickClearSearchQuery,\n callbackRef,\n } = useAppLauncher(baseFeatures)\n\n const translated = useLocalize({\n searchInputTitle: {\n id: 'smarthr-ui/AppHeader/Launcher/searchInputTitle',\n defaultText: 'アプリ名を入力してください。',\n },\n favoriteModeText: {\n id: 'smarthr-ui/AppHeader/Launcher/favoriteModeText',\n defaultText: 'よく使うアプリ',\n },\n allModeText: {\n id: 'smarthr-ui/AppHeader/Launcher/allModeText',\n defaultText: 'すべてのアプリ',\n },\n })\n\n return (\n <div ref={callbackRef} className={CLASS_NAMES.wrapper}>\n <div className={CLASS_NAMES.searchArea}>\n <SearchInput\n name=\"search\"\n value={searchQuery}\n title={translated.searchInputTitle}\n width=\"100%\"\n onChange={onChangeSearchQuery}\n tooltipMessage={translated.searchInputTitle}\n // TODO: subActionArea内のクリックではInputが検索欄にフォーカスを戻さないため、\n // クリア後に検索欄へフォーカスを戻す対応が必要(mobile/AppLauncher.tsxも同様)\n subActionArea={\n mode === 'search' && <ClearSearchButton onClick={onClickClearSearchQuery} />\n }\n />\n </div>\n\n <div className={CLASS_NAMES.inner}>\n <SideNavs\n mode={mode}\n page={page}\n changePage={changePage}\n favoriteModeText={translated.favoriteModeText}\n allModeText={translated.allModeText}\n />\n <div className={CLASS_NAMES.main}>\n <Section className={CLASS_NAMES.mainInner}>\n <Cluster align=\"center\" justify=\"space-between\" className={CLASS_NAMES.contentHead}>\n <MemoizedSubSubBlockHeading>\n {mode === 'search' ? (\n <Localizer\n id=\"smarthr-ui/AppHeader/Launcher/searchResultText\"\n defaultText=\"検索結果\"\n />\n ) : page === 'favorite' ? (\n translated.favoriteModeText\n ) : (\n translated.allModeText\n )}\n </MemoizedSubSubBlockHeading>\n\n {(mode === 'search' || page === 'all') && (\n <AppLauncherSortDropdown sortType={sortType} handleSelectSortType={setSortType} />\n )}\n </Cluster>\n\n <Scroller className={CLASS_NAMES.scrollArea}>\n <AppLauncherFeatures\n features={features}\n page={page}\n loading={loading}\n error={error}\n />\n </Scroller>\n </Section>\n </div>\n </div>\n </div>\n )\n}\n\nconst ClearSearchButton = memo<{ onClick: () => void }>(({ onClick }) => (\n <UnstyledButton onClick={onClick}>\n <FaCircleXmarkIcon />\n </UnstyledButton>\n))\n\nconst SideNavs = memo<\n Pick<ReturnType<typeof useAppLauncher>, 'mode' | 'page' | 'changePage'> & {\n favoriteModeText: string\n allModeText: string\n }\n>(({ mode, page, changePage, favoriteModeText, allModeText }) => {\n const theme = useTheme()\n const listHeadingId = useId()\n const isNotSearch = mode !== 'search'\n const isFavorite = isNotSearch && page === 'favorite'\n const isAll = isNotSearch && page === 'all'\n\n const unselectedItems = useMemo(\n () => [\n {\n id: 'favorite',\n title: favoriteModeText,\n prefix: <FaStarIcon color={isFavorite ? theme.textColor.white : undefined} />,\n current: isFavorite,\n },\n ],\n [isFavorite, favoriteModeText, theme.textColor.white],\n )\n const selectedItems = useMemo(\n () => [\n {\n id: 'all',\n title: allModeText,\n current: isAll,\n },\n ],\n [isAll, allModeText],\n )\n\n const onClick = useCallback(\n (e: React.MouseEvent<HTMLButtonElement>) => {\n changePage(e.currentTarget.value as Launcher['page'])\n },\n [changePage],\n )\n\n return (\n <div className={CLASS_NAMES.side}>\n <SideNav size=\"S\" className={CLASS_NAMES.unselectedSideNav} aria-label={favoriteModeText}>\n {unselectedItems.map((item) => (\n <SideNavItemButton\n key={item.id}\n id={item.id}\n current={item.current}\n onClick={onClick}\n prefix={item.prefix}\n >\n {item.title}\n </SideNavItemButton>\n ))}\n </SideNav>\n\n <hr />\n\n <Section>\n <MemoizedAppListHeading id={listHeadingId} className={CLASS_NAMES.sideNavHeading} />\n <SideNav size=\"S\" className={CLASS_NAMES.selectedSideNav} aria-labelledby={listHeadingId}>\n {selectedItems.map((item) => (\n <SideNavItemButton key={item.id} id={item.id} current={item.current} onClick={onClick}>\n {item.title}\n </SideNavItemButton>\n ))}\n </SideNav>\n </Section>\n\n <HelpLinkArea className={CLASS_NAMES.help}>\n <Localizer id=\"smarthr-ui/AppHeader/Launcher/helpText\" defaultText=\"よく使うアプリとは\" />\n </HelpLinkArea>\n </div>\n )\n})\n\nconst HelpLinkArea = memo<PropsWithChildren<{ className: string }>>(({ children, className }) => (\n <div className={className}>\n <HelpLink\n href=\"https://support.smarthr.jp/ja/help/articles/2bfd350d-8e8b-4bbd-a209-426d2eb302cc/\"\n target=\"_blank\"\n >\n {children}\n </HelpLink>\n </div>\n))\n\nconst MemoizedSubSubBlockHeading = memo<PropsWithChildren<{ className?: string }>>(\n ({ children, className }) => (\n <Heading type=\"subSubBlockTitle\" className={className}>\n {children}\n </Heading>\n ),\n)\n\nconst MemoizedAppListHeading = memo<{ id: string; className?: string }>(({ id, className }) => (\n <Heading type=\"subSubBlockTitle\" id={id} className={className}>\n <Localizer id=\"smarthr-ui/AppHeader/Launcher/listText\" defaultText=\"アプリ一覧\" />\n </Heading>\n))\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BA;AACE;AACE;;;AAGC;AACD;;;;AAIC;AACD;AACA;;;;AAIC;AACD;;;;AAIC;;AAED;AACA;;AAEA;;;AAGC;;AAEF;AACD;AACE;AACE;;AAEC;AACF;AACD;AACE;;AAEC;AACF;AACF;AACF;AAED;;;;;;;;AAqBI;;;;;;;;AAQJ;AAEO;;;AAeH;AACE;AACA;AACD;AACD;AACE;AACA;AACD;AACD;AACE;AACA;AACD;AACF;;;;;AA8DH;AAEA;AAMA;AAME;AACA;AACA;AACA;AACA;AAEA;AAEI;AACE;AACA;AACA;AACA;AACD;AACF;AAGH;AAEI;AACE;AACA;AACA;AACD;AACF;AAIH;AAEI;AACF;AAIF;AAkCF;AAEA;AAWA;AAQA;;"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
'use strict';
|
|
2
3
|
|
|
3
4
|
var jsxRuntime = require('react/jsx-runtime');
|
|
@@ -11,8 +12,15 @@ require('../../../../intl/client/TimeFormatter.cjs');
|
|
|
11
12
|
var intl_client_useIntl = require('../../../../intl/client/useIntl.cjs');
|
|
12
13
|
var intl_localeMap = require('../../../../intl/localeMap.cjs');
|
|
13
14
|
var components_Button_Button = require('../../../Button/Button.cjs');
|
|
14
|
-
require('../../../
|
|
15
|
+
var components_Icon_FaIcon = require('../../../Icon/FaIcon.cjs');
|
|
16
|
+
require('../../../Icon/generateIcon.cjs');
|
|
17
|
+
require('../../../Icon/FilterIcon.cjs');
|
|
18
|
+
require('../../../Icon/OpenInNewTabIcon.cjs');
|
|
19
|
+
require('../../../Icon/client/FilterCheckIcon.cjs');
|
|
20
|
+
require('../../../Icon/client/StatusIcon.cjs');
|
|
21
|
+
require('../../../Button/DisabledReason.cjs');
|
|
15
22
|
require('../../../Button/client/UnstyledButton.cjs');
|
|
23
|
+
require('../../../Button/style.cjs');
|
|
16
24
|
var components_Dropdown_client_Dropdown = require('../../../Dropdown/client/Dropdown.cjs');
|
|
17
25
|
var components_Dropdown_client_DropdownContent = require('../../../Dropdown/client/DropdownContent.cjs');
|
|
18
26
|
require('../../../Dropdown/client/DropdownMenuButton/DropdownMenuButton.cjs');
|
|
@@ -25,16 +33,9 @@ var components_Header_LanguageSwitcher_client_LanguageSwitcher = require('../../
|
|
|
25
33
|
var components_Header_HeaderLink = require('../../../Header/HeaderLink.cjs');
|
|
26
34
|
require('../../../Header/HeaderDropdownMenuButton.cjs');
|
|
27
35
|
require('../../../Header/AppLauncher/AppLauncher.cjs');
|
|
28
|
-
var components_Icon_FaIcon = require('../../../Icon/FaIcon.cjs');
|
|
29
|
-
require('../../../Icon/generateIcon.cjs');
|
|
30
|
-
require('../../../Icon/FilterIcon.cjs');
|
|
31
|
-
require('../../../Icon/OpenInNewTabIcon.cjs');
|
|
32
|
-
require('../../../Icon/client/FilterCheckIcon.cjs');
|
|
33
|
-
require('../../../Icon/client/StatusIcon.cjs');
|
|
34
36
|
require('../../../Layout/Stack/Stack.cjs');
|
|
35
37
|
var components_Layout_Cluster_Cluster = require('../../../Layout/Cluster/Cluster.cjs');
|
|
36
38
|
require('../../../Layout/Reel/Reel.cjs');
|
|
37
|
-
require('../../../Layout/Sidebar/Sidebar.cjs');
|
|
38
39
|
require('../../../Layout/Center/Center.cjs');
|
|
39
40
|
require('../../../Layout/client/Container/Container.cjs');
|
|
40
41
|
var components_AppHeader_components_desktop_AppLauncher = require('./AppLauncher.cjs');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DesktopHeader.cjs","sources":["../../../../../src/components/AppHeader/components/desktop/DesktopHeader.tsx"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"DesktopHeader.cjs","sources":["../../../../../src/components/AppHeader/components/desktop/DesktopHeader.tsx"],"sourcesContent":["'use client' // eslint-disable-line local-rules/require-client\n\nimport { type FC, type PropsWithChildren, memo, useMemo } from 'react'\nimport { tv } from 'tailwind-variants'\n\nimport { Localizer, localeMap, useIntl } from '../../../../intl'\nimport { Button } from '../../../Button'\nimport { Dropdown, DropdownContent, DropdownTrigger } from '../../../Dropdown'\nimport { Header, HeaderLink, LanguageSwitcher } from '../../../Header'\nimport {\n FaCircleQuestionIcon,\n FaGraduationCapIcon,\n FaRegCircleQuestionIcon,\n FaToolboxIcon,\n} from '../../../Icon'\nimport { Cluster } from '../../../Layout'\n\nimport { AppLauncher } from './AppLauncher'\nimport { Navigation } from './Navigation'\nimport { UserInfo } from './UserInfo'\n\nimport type { HeaderProps, InternalHeaderProps } from '../../types'\n\nconst classNameGenerator = tv({\n slots: {\n wrapper: 'max-[751px]:!shr-hidden',\n appsButton: [\n 'shr-border-none shr-bg-transparent shr-px-0.25 shr-font-normal shr-text-white',\n 'hover:shr-border-transparent hover:shr-bg-transparent',\n 'focus-visible:shr-border-transparent focus-visible:shr-bg-transparent',\n 'forced-colors:shr-border-shorthand',\n ],\n },\n})\n\nexport const DesktopHeader: FC<InternalHeaderProps> = ({\n enableNew,\n className = '',\n appName,\n tenants,\n currentTenantId,\n schoolUrl,\n helpPageUrl,\n children,\n userInfo,\n desktopAdditionalContent,\n navigations,\n desktopNavigationAdditionalContent,\n releaseNote,\n features,\n isAppLauncherAvailable,\n featuresLoading,\n featuresError,\n handleOpenAppLauncher,\n locale: localeProps,\n ...rest\n}) => {\n const classNames = useMemo(() => {\n const { wrapper, appsButton } = classNameGenerator()\n\n return {\n wrapper: wrapper({ className }),\n appsButton: appsButton(),\n }\n }, [className])\n\n const { locale } = useIntl()\n\n return (\n <>\n <Header\n {...rest}\n currentTenantId={currentTenantId}\n enableNew={enableNew}\n featureName={appName}\n tenants={tenants}\n className={classNames.wrapper}\n >\n <Cluster align=\"center\" className=\"shr--me-0.25\">\n {!enableNew && (\n <>\n {isAppLauncherAvailable && (\n <Dropdown onOpen={handleOpenAppLauncher}>\n <AppLauncherButton enableNew={enableNew} className={classNames.appsButton}>\n <Localizer\n id=\"smarthr-ui/AppHeader/DesktopHeader/appLauncherLabel\"\n defaultText=\"アプリ\"\n />\n </AppLauncherButton>\n <DropdownContent controllable>\n <AppLauncher\n features={features}\n loading={featuresLoading}\n error={featuresError}\n />\n </DropdownContent>\n </Dropdown>\n )}\n\n {schoolUrl && (\n <HeaderLink\n href={schoolUrl}\n className=\"shr-flex shr-items-center shr-py-0.75 shr-leading-none\"\n prefix={<FaGraduationCapIcon />}\n >\n <Localizer id=\"smarthr-ui/AppHeader/school\" defaultText=\"スクール\" />\n </HeaderLink>\n )}\n </>\n )}\n\n {helpPageUrl && (\n <HeaderLink\n href={helpPageUrl}\n rel=\"help\"\n referrerPolicy=\"no-referrer-when-downgrade\"\n enableNew={enableNew}\n className={\n enableNew ? undefined : 'shr-flex shr-items-center shr-py-0.75 shr-leading-none'\n }\n prefix={enableNew ? <FaRegCircleQuestionIcon /> : <FaCircleQuestionIcon />}\n >\n <Localizer id=\"smarthr-ui/AppHeader/help\" defaultText=\"ヘルプ\" />\n </HeaderLink>\n )}\n\n {localeProps && (\n <LanguageSwitcher\n localeMap={localeMap}\n locale={locale}\n enableNew={enableNew}\n onLanguageSelect={localeProps.onSelectLocale as (locale: string) => void}\n />\n )}\n\n {children}\n\n {userInfo && (\n <UserInfo\n {...userInfo}\n currentTenantId={currentTenantId}\n tenants={tenants}\n desktopAdditionalContent={desktopAdditionalContent}\n enableNew={enableNew}\n />\n )}\n </Cluster>\n </Header>\n\n {navigations && (\n <Navigation\n appName={appName}\n navigations={navigations}\n additionalContent={desktopNavigationAdditionalContent}\n releaseNote={releaseNote}\n enableNew={enableNew}\n />\n )}\n </>\n )\n}\n\nconst AppLauncherButton = memo<\n Pick<HeaderProps, 'enableNew'> & PropsWithChildren<{ className: string }>\n>(({ enableNew, children, className }) => (\n <DropdownTrigger>\n <Button className={className} prefix={enableNew ?? <FaToolboxIcon />}>\n {children}\n </Button>\n </DropdownTrigger>\n))\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuBA;AACE;AACE;AACA;;;;;AAKC;AACF;AACF;AAEM;AAsBL;;;AAII;;;AAGJ;AAEA;AAEA;AA4FF;AAEA;;"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
3
|
import { memo, useMemo } from 'react';
|
|
3
4
|
import { tv as ce } from './../../../../vendor/.pnpm/tailwind-variants@0.3.1_tailwindcss@3.4.19_tsx@4.23.15_yaml@2.9.0_/vendor/tailwind-variants/dist/index.js';
|
|
@@ -9,8 +10,15 @@ import '../../../../intl/client/TimeFormatter.js';
|
|
|
9
10
|
import { useIntl } from '../../../../intl/client/useIntl.js';
|
|
10
11
|
import { localeMap } from '../../../../intl/localeMap.js';
|
|
11
12
|
import { Button } from '../../../Button/Button.js';
|
|
12
|
-
import '../../../
|
|
13
|
+
import { FaToolboxIcon, FaGraduationCapIcon, FaRegCircleQuestionIcon, FaCircleQuestionIcon } from '../../../Icon/FaIcon.js';
|
|
14
|
+
import '../../../Icon/generateIcon.js';
|
|
15
|
+
import '../../../Icon/FilterIcon.js';
|
|
16
|
+
import '../../../Icon/OpenInNewTabIcon.js';
|
|
17
|
+
import '../../../Icon/client/FilterCheckIcon.js';
|
|
18
|
+
import '../../../Icon/client/StatusIcon.js';
|
|
19
|
+
import '../../../Button/DisabledReason.js';
|
|
13
20
|
import '../../../Button/client/UnstyledButton.js';
|
|
21
|
+
import '../../../Button/style.js';
|
|
14
22
|
import { Dropdown } from '../../../Dropdown/client/Dropdown.js';
|
|
15
23
|
import { DropdownContent } from '../../../Dropdown/client/DropdownContent.js';
|
|
16
24
|
import '../../../Dropdown/client/DropdownMenuButton/DropdownMenuButton.js';
|
|
@@ -23,16 +31,9 @@ import { LanguageSwitcher } from '../../../Header/LanguageSwitcher/client/Langua
|
|
|
23
31
|
import { HeaderLink } from '../../../Header/HeaderLink.js';
|
|
24
32
|
import '../../../Header/HeaderDropdownMenuButton.js';
|
|
25
33
|
import '../../../Header/AppLauncher/AppLauncher.js';
|
|
26
|
-
import { FaToolboxIcon, FaGraduationCapIcon, FaRegCircleQuestionIcon, FaCircleQuestionIcon } from '../../../Icon/FaIcon.js';
|
|
27
|
-
import '../../../Icon/generateIcon.js';
|
|
28
|
-
import '../../../Icon/FilterIcon.js';
|
|
29
|
-
import '../../../Icon/OpenInNewTabIcon.js';
|
|
30
|
-
import '../../../Icon/client/FilterCheckIcon.js';
|
|
31
|
-
import '../../../Icon/client/StatusIcon.js';
|
|
32
34
|
import '../../../Layout/Stack/Stack.js';
|
|
33
35
|
import { Cluster } from '../../../Layout/Cluster/Cluster.js';
|
|
34
36
|
import '../../../Layout/Reel/Reel.js';
|
|
35
|
-
import '../../../Layout/Sidebar/Sidebar.js';
|
|
36
37
|
import '../../../Layout/Center/Center.js';
|
|
37
38
|
import '../../../Layout/client/Container/Container.js';
|
|
38
39
|
import { AppLauncher } from './AppLauncher.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DesktopHeader.js","sources":["../../../../../src/components/AppHeader/components/desktop/DesktopHeader.tsx"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"DesktopHeader.js","sources":["../../../../../src/components/AppHeader/components/desktop/DesktopHeader.tsx"],"sourcesContent":["'use client' // eslint-disable-line local-rules/require-client\n\nimport { type FC, type PropsWithChildren, memo, useMemo } from 'react'\nimport { tv } from 'tailwind-variants'\n\nimport { Localizer, localeMap, useIntl } from '../../../../intl'\nimport { Button } from '../../../Button'\nimport { Dropdown, DropdownContent, DropdownTrigger } from '../../../Dropdown'\nimport { Header, HeaderLink, LanguageSwitcher } from '../../../Header'\nimport {\n FaCircleQuestionIcon,\n FaGraduationCapIcon,\n FaRegCircleQuestionIcon,\n FaToolboxIcon,\n} from '../../../Icon'\nimport { Cluster } from '../../../Layout'\n\nimport { AppLauncher } from './AppLauncher'\nimport { Navigation } from './Navigation'\nimport { UserInfo } from './UserInfo'\n\nimport type { HeaderProps, InternalHeaderProps } from '../../types'\n\nconst classNameGenerator = tv({\n slots: {\n wrapper: 'max-[751px]:!shr-hidden',\n appsButton: [\n 'shr-border-none shr-bg-transparent shr-px-0.25 shr-font-normal shr-text-white',\n 'hover:shr-border-transparent hover:shr-bg-transparent',\n 'focus-visible:shr-border-transparent focus-visible:shr-bg-transparent',\n 'forced-colors:shr-border-shorthand',\n ],\n },\n})\n\nexport const DesktopHeader: FC<InternalHeaderProps> = ({\n enableNew,\n className = '',\n appName,\n tenants,\n currentTenantId,\n schoolUrl,\n helpPageUrl,\n children,\n userInfo,\n desktopAdditionalContent,\n navigations,\n desktopNavigationAdditionalContent,\n releaseNote,\n features,\n isAppLauncherAvailable,\n featuresLoading,\n featuresError,\n handleOpenAppLauncher,\n locale: localeProps,\n ...rest\n}) => {\n const classNames = useMemo(() => {\n const { wrapper, appsButton } = classNameGenerator()\n\n return {\n wrapper: wrapper({ className }),\n appsButton: appsButton(),\n }\n }, [className])\n\n const { locale } = useIntl()\n\n return (\n <>\n <Header\n {...rest}\n currentTenantId={currentTenantId}\n enableNew={enableNew}\n featureName={appName}\n tenants={tenants}\n className={classNames.wrapper}\n >\n <Cluster align=\"center\" className=\"shr--me-0.25\">\n {!enableNew && (\n <>\n {isAppLauncherAvailable && (\n <Dropdown onOpen={handleOpenAppLauncher}>\n <AppLauncherButton enableNew={enableNew} className={classNames.appsButton}>\n <Localizer\n id=\"smarthr-ui/AppHeader/DesktopHeader/appLauncherLabel\"\n defaultText=\"アプリ\"\n />\n </AppLauncherButton>\n <DropdownContent controllable>\n <AppLauncher\n features={features}\n loading={featuresLoading}\n error={featuresError}\n />\n </DropdownContent>\n </Dropdown>\n )}\n\n {schoolUrl && (\n <HeaderLink\n href={schoolUrl}\n className=\"shr-flex shr-items-center shr-py-0.75 shr-leading-none\"\n prefix={<FaGraduationCapIcon />}\n >\n <Localizer id=\"smarthr-ui/AppHeader/school\" defaultText=\"スクール\" />\n </HeaderLink>\n )}\n </>\n )}\n\n {helpPageUrl && (\n <HeaderLink\n href={helpPageUrl}\n rel=\"help\"\n referrerPolicy=\"no-referrer-when-downgrade\"\n enableNew={enableNew}\n className={\n enableNew ? undefined : 'shr-flex shr-items-center shr-py-0.75 shr-leading-none'\n }\n prefix={enableNew ? <FaRegCircleQuestionIcon /> : <FaCircleQuestionIcon />}\n >\n <Localizer id=\"smarthr-ui/AppHeader/help\" defaultText=\"ヘルプ\" />\n </HeaderLink>\n )}\n\n {localeProps && (\n <LanguageSwitcher\n localeMap={localeMap}\n locale={locale}\n enableNew={enableNew}\n onLanguageSelect={localeProps.onSelectLocale as (locale: string) => void}\n />\n )}\n\n {children}\n\n {userInfo && (\n <UserInfo\n {...userInfo}\n currentTenantId={currentTenantId}\n tenants={tenants}\n desktopAdditionalContent={desktopAdditionalContent}\n enableNew={enableNew}\n />\n )}\n </Cluster>\n </Header>\n\n {navigations && (\n <Navigation\n appName={appName}\n navigations={navigations}\n additionalContent={desktopNavigationAdditionalContent}\n releaseNote={releaseNote}\n enableNew={enableNew}\n />\n )}\n </>\n )\n}\n\nconst AppLauncherButton = memo<\n Pick<HeaderProps, 'enableNew'> & PropsWithChildren<{ className: string }>\n>(({ enableNew, children, className }) => (\n <DropdownTrigger>\n <Button className={className} prefix={enableNew ?? <FaToolboxIcon />}>\n {children}\n </Button>\n </DropdownTrigger>\n))\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuBA;AACE;AACE;AACA;;;;;AAKC;AACF;AACF;AAEM;AAsBL;;;AAII;;;AAGJ;AAEA;AAEA;AA4FF;AAEA;;"}
|
|
@@ -22,7 +22,6 @@ var components_Dropdown_DropdownMenuGroup_DropdownMenuGroup = require('../../../
|
|
|
22
22
|
require('../../../Layout/Stack/Stack.cjs');
|
|
23
23
|
var components_Layout_Cluster_Cluster = require('../../../Layout/Cluster/Cluster.cjs');
|
|
24
24
|
require('../../../Layout/Reel/Reel.cjs');
|
|
25
|
-
require('../../../Layout/Sidebar/Sidebar.cjs');
|
|
26
25
|
require('../../../Layout/Center/Center.cjs');
|
|
27
26
|
require('../../../Layout/client/Container/Container.cjs');
|
|
28
27
|
var components_AppHeader_components_common_CommonButton = require('../common/CommonButton.cjs');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Navigation.cjs","sources":["../../../../../src/components/AppHeader/components/desktop/Navigation.tsx"],"sourcesContent":["import { type FC, type ReactNode, memo, useMemo } from 'react'\nimport { tv } from 'tailwind-variants'\n\nimport {\n AppNavi,\n AppNaviAnchor,\n AppNaviButton,\n AppNaviCustomTag,\n AppNaviDropdownMenuButton,\n} from '../../../AppNavi'\nimport { AnchorButton, Button } from '../../../Button'\nimport { DropdownMenuGroup } from '../../../Dropdown'\nimport { Cluster } from '../../../Layout'\nimport { commonButtonClassNameGenerator } from '../common/CommonButton'\n\nimport { ReleaseNotesDropdown } from './ReleaseNotesDropdown'\n\nimport type {\n ChildNavigation,\n ChildNavigationGroup,\n NavigationButton,\n NavigationCustomTag,\n NavigationLink,\n Navigation as NavigationType,\n ReleaseNoteProps,\n} from '../../types'\n\nconst classNameGenerator = tv({\n base: [\n 'shr-min-w-[auto] shr-overflow-x-auto',\n 'max-[751px]:!shr-hidden',\n 'data-[with-releasenote=\"true\"]:shr-pe-0',\n ],\n})\n\ntype Props = {\n appName: ReactNode\n navigations: NavigationType[]\n additionalContent: ReactNode\n releaseNote?: ReleaseNoteProps | null\n enableNew?: boolean\n}\n\nexport const Navigation: FC<Props> = ({\n appName,\n navigations,\n additionalContent,\n releaseNote,\n enableNew,\n}) => {\n const className = useMemo(() => classNameGenerator(), [])\n const actualNavigations = useMemo(() => buildNavigations(navigations), [navigations])\n\n return (\n <AppNavi\n displayDropdownCaret\n additionalArea={\n <Cluster align=\"center\" className=\"shr-flex-nowrap shr-ps-1\">\n {additionalContent}\n {releaseNote && <ReleaseNotesDropdown {...releaseNote} />}\n </Cluster>\n }\n className={className}\n data-with-releasenote={!!releaseNote}\n label={enableNew ? undefined : appName}\n >\n {actualNavigations}\n </AppNavi>\n )\n}\n\nconst buildNavigations = (navigations: NavigationType[]) =>\n navigations.map((navigation, index) => {\n if ('elementAs' in navigation) {\n const { elementAs, ...rest } = navigation\n\n return <AppNaviCustomTag {...rest} key={index} tag={elementAs} />\n }\n if ('href' in navigation) {\n return <AppNaviAnchor {...navigation} key={index} />\n }\n if ('childNavigations' in navigation) {\n return (\n <AppNaviDropdownMenuButton key={index} label={navigation.children}>\n {buildDropdownMenu(navigation.childNavigations)}\n </AppNaviDropdownMenuButton>\n )\n }\n\n return <AppNaviButton {...navigation} key={index} />\n })\n\nconst buildDropdownMenu = (navigations: Array<ChildNavigation | ChildNavigationGroup>) =>\n navigations.map((navigation, index) => {\n if ('elementAs' in navigation) {\n return <DropdownCustomTag {...navigation} key={index} />\n }\n if ('href' in navigation) {\n return <DropdownMenuAnchorButton {...navigation} key={index} />\n }\n if ('title' in navigation) {\n return (\n <DropdownMenuGroup key={index} name={navigation.title}>\n {buildDropdownMenu(navigation.childNavigations)}\n </DropdownMenuGroup>\n )\n }\n\n return <DropdownNavigationButton {...navigation} key={index} />\n })\n\nconst DropdownCustomTag = memo<NavigationCustomTag>(\n ({ elementAs: Component, current, className, ...rest }) => {\n const actualClassName = useMemo(\n () =>\n commonButtonClassNameGenerator({\n current,\n className,\n rounded: false,\n }),\n [current, className],\n )\n\n return <Component {...rest} className={actualClassName} aria-current={current || undefined} />\n },\n)\nconst DropdownMenuAnchorButton = memo<NavigationLink>(({ current, ...rest }) => (\n <AnchorButton {...rest} aria-current={current ? 'page' : undefined} />\n))\nconst DropdownNavigationButton = memo<NavigationButton>(({ current, ...rest }) => (\n <Button {...rest} aria-current={current ? 'page' : undefined} />\n))\n"],"names":["tv","useMemo","_jsx","AppNavi","_jsxs","Cluster","ReleaseNotesDropdown","_createElement","AppNaviCustomTag","AppNaviAnchor","AppNaviDropdownMenuButton","AppNaviButton","DropdownMenuGroup","memo","commonButtonClassNameGenerator","AnchorButton","Button"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Navigation.cjs","sources":["../../../../../src/components/AppHeader/components/desktop/Navigation.tsx"],"sourcesContent":["import { type FC, type ReactNode, memo, useMemo } from 'react'\nimport { tv } from 'tailwind-variants'\n\nimport {\n AppNavi,\n AppNaviAnchor,\n AppNaviButton,\n AppNaviCustomTag,\n AppNaviDropdownMenuButton,\n} from '../../../AppNavi'\nimport { AnchorButton, Button } from '../../../Button'\nimport { DropdownMenuGroup } from '../../../Dropdown'\nimport { Cluster } from '../../../Layout'\nimport { commonButtonClassNameGenerator } from '../common/CommonButton'\n\nimport { ReleaseNotesDropdown } from './ReleaseNotesDropdown'\n\nimport type {\n ChildNavigation,\n ChildNavigationGroup,\n NavigationButton,\n NavigationCustomTag,\n NavigationLink,\n Navigation as NavigationType,\n ReleaseNoteProps,\n} from '../../types'\n\nconst classNameGenerator = tv({\n base: [\n 'shr-min-w-[auto] shr-overflow-x-auto',\n 'max-[751px]:!shr-hidden',\n 'data-[with-releasenote=\"true\"]:shr-pe-0',\n ],\n})\n\ntype Props = {\n appName: ReactNode\n navigations: NavigationType[]\n additionalContent: ReactNode\n releaseNote?: ReleaseNoteProps | null\n enableNew?: boolean\n}\n\nexport const Navigation: FC<Props> = ({\n appName,\n navigations,\n additionalContent,\n releaseNote,\n enableNew,\n}) => {\n const className = useMemo(() => classNameGenerator(), [])\n const actualNavigations = useMemo(() => buildNavigations(navigations), [navigations])\n\n return (\n <AppNavi\n displayDropdownCaret\n additionalArea={\n <Cluster align=\"center\" className=\"shr-flex-nowrap shr-ps-1\">\n {additionalContent}\n {releaseNote && <ReleaseNotesDropdown {...releaseNote} />}\n </Cluster>\n }\n className={className}\n data-with-releasenote={!!releaseNote}\n label={enableNew ? undefined : appName}\n >\n {actualNavigations}\n </AppNavi>\n )\n}\n\nconst buildNavigations = (navigations: NavigationType[]) =>\n navigations.map((navigation, index) => {\n if ('elementAs' in navigation) {\n const { elementAs, ...rest } = navigation\n\n return <AppNaviCustomTag {...rest} key={index} tag={elementAs} />\n }\n if ('href' in navigation) {\n return <AppNaviAnchor {...navigation} key={index} />\n }\n if ('childNavigations' in navigation) {\n return (\n <AppNaviDropdownMenuButton key={index} label={navigation.children}>\n {buildDropdownMenu(navigation.childNavigations)}\n </AppNaviDropdownMenuButton>\n )\n }\n\n return <AppNaviButton {...navigation} key={index} />\n })\n\nconst buildDropdownMenu = (navigations: Array<ChildNavigation | ChildNavigationGroup>) =>\n navigations.map((navigation, index) => {\n if ('elementAs' in navigation) {\n return <DropdownCustomTag {...navigation} key={index} />\n }\n if ('href' in navigation) {\n return <DropdownMenuAnchorButton {...navigation} key={index} />\n }\n if ('title' in navigation) {\n return (\n <DropdownMenuGroup key={index} name={navigation.title}>\n {buildDropdownMenu(navigation.childNavigations)}\n </DropdownMenuGroup>\n )\n }\n\n return <DropdownNavigationButton {...navigation} key={index} />\n })\n\nconst DropdownCustomTag = memo<NavigationCustomTag>(\n ({ elementAs: Component, current, className, ...rest }) => {\n const actualClassName = useMemo(\n () =>\n commonButtonClassNameGenerator({\n current,\n className,\n rounded: false,\n }),\n [current, className],\n )\n\n return <Component {...rest} className={actualClassName} aria-current={current || undefined} />\n },\n)\nconst DropdownMenuAnchorButton = memo<NavigationLink>(({ current, ...rest }) => (\n <AnchorButton {...rest} aria-current={current ? 'page' : undefined} />\n))\nconst DropdownNavigationButton = memo<NavigationButton>(({ current, ...rest }) => (\n <Button {...rest} aria-current={current ? 'page' : undefined} />\n))\n"],"names":["tv","useMemo","_jsx","AppNavi","_jsxs","Cluster","ReleaseNotesDropdown","_createElement","AppNaviCustomTag","AppNaviAnchor","AppNaviDropdownMenuButton","AppNaviButton","DropdownMenuGroup","memo","commonButtonClassNameGenerator","AnchorButton","Button"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BA,MAAM,kBAAkB,GAAGA,QAAE,CAAC;AAC5B,IAAA,IAAI,EAAE;QACJ,sCAAsC;QACtC,yBAAyB;QACzB,yCAAyC;AAC1C,KAAA;AACF,CAAA,CAAC;AAUK,MAAM,UAAU,GAAc,CAAC,EACpC,OAAO,EACP,WAAW,EACX,iBAAiB,EACjB,WAAW,EACX,SAAS,GACV,KAAI;AACH,IAAA,MAAM,SAAS,GAAGC,aAAO,CAAC,MAAM,kBAAkB,EAAE,EAAE,EAAE,CAAC;AACzD,IAAA,MAAM,iBAAiB,GAAGA,aAAO,CAAC,MAAM,gBAAgB,CAAC,WAAW,CAAC,EAAE,CAAC,WAAW,CAAC,CAAC;IAErF,QACEC,cAAA,CAACC,kCAAO,EAAA,EACN,oBAAoB,QACpB,cAAc,EACZC,eAAA,CAACC,yCAAO,EAAA,EAAC,KAAK,EAAC,QAAQ,EAAC,SAAS,EAAC,0BAA0B,EAAA,QAAA,EAAA,CACzD,iBAAiB,EACjB,WAAW,IAAIH,cAAA,CAACI,iFAAoB,EAAA,EAAA,GAAK,WAAW,EAAA,CAAI,CAAA,EAAA,CACjD,EAEZ,SAAS,EAAE,SAAS,2BACG,CAAC,CAAC,WAAW,EACpC,KAAK,EAAE,SAAS,GAAG,SAAS,GAAG,OAAO,EAAA,QAAA,EAErC,iBAAiB,EAAA,CACV;AAEd;AAEA,MAAM,gBAAg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IAAI,EAAE,UAAU,CAAC,KAAK,EAAA,QAAA,EAClD,iBAAiB,CAAC,UAAU,CAAC,gBAAgB,CAAC,IADzB,KAAK,CAET;IAExB;IAEA,OAAOL,mBAAA,CAAC,wBAAwB,EAAA,EAAA,GAAK,UAAU,EAAE,GAAG,EAAE,KAAK,EAAA,CAAI;AACjE,CAAC,CAAC;AAEJ,MAAM,iBAAiB,GAAGM,UAAI,CAC5B,CAAC,EAAE,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,KAAI;IACxD,MAAM,eAAe,GAAGZ,aAAO,CAC7B,MACEa,kFAA8B,CAAC;QAC7B,OAAO;QACP,SAAS;AACT,QAAA,OAAO,EAAE,KAAK;AACf,KAAA,CAAC,EACJ,CAAC,OAAO,EAAE,SAAS,CAAC,CACrB;AAED,IAAA,OAAOZ,cAAA,CAAC,SAAS,EAAA,EAAA,GAAK,IAAI,EAAE,SAAS,EAAE,eAAe,EAAA,cAAA,EAAgB,OAAO,IAAI,SAAS,GAAI;AAChG,CAAC,CACF;AACD,MAAM,wBAAwB,GAAGW,UAAI,CAAiB,CAAC,EAAE,OAAO,EAAE,GAAG,IAAI,EAAE,MACzEX,cAAA,CAACa,2CAAY,EAAA,EAAA,GAAK,IAAI,EAAA,cAAA,EAAgB,OAAO,GAAG,MAAM,GAAG,SAAS,EAAA,CAAI,CACvE,CAAC;AACF,MAAM,wBAAwB,GAAGF,UAAI,CAAmB,CAAC,EAAE,OAAO,EAAE,GAAG,IAAI,EAAE,MAC3EX,cAAA,CAACc,+BAAM,EAAA,EAAA,GAAK,IAAI,EAAA,cAAA,EAAgB,OAAO,GAAG,MAAM,GAAG,SAAS,EAAA,CAAI,CACjE,CAAC;;"}
|
|
@@ -20,7 +20,6 @@ import { DropdownMenuGroup } from '../../../Dropdown/DropdownMenuGroup/DropdownM
|
|
|
20
20
|
import '../../../Layout/Stack/Stack.js';
|
|
21
21
|
import { Cluster } from '../../../Layout/Cluster/Cluster.js';
|
|
22
22
|
import '../../../Layout/Reel/Reel.js';
|
|
23
|
-
import '../../../Layout/Sidebar/Sidebar.js';
|
|
24
23
|
import '../../../Layout/Center/Center.js';
|
|
25
24
|
import '../../../Layout/client/Container/Container.js';
|
|
26
25
|
import { commonButtonClassNameGenerator } from '../common/CommonButton.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Navigation.js","sources":["../../../../../src/components/AppHeader/components/desktop/Navigation.tsx"],"sourcesContent":["import { type FC, type ReactNode, memo, useMemo } from 'react'\nimport { tv } from 'tailwind-variants'\n\nimport {\n AppNavi,\n AppNaviAnchor,\n AppNaviButton,\n AppNaviCustomTag,\n AppNaviDropdownMenuButton,\n} from '../../../AppNavi'\nimport { AnchorButton, Button } from '../../../Button'\nimport { DropdownMenuGroup } from '../../../Dropdown'\nimport { Cluster } from '../../../Layout'\nimport { commonButtonClassNameGenerator } from '../common/CommonButton'\n\nimport { ReleaseNotesDropdown } from './ReleaseNotesDropdown'\n\nimport type {\n ChildNavigation,\n ChildNavigationGroup,\n NavigationButton,\n NavigationCustomTag,\n NavigationLink,\n Navigation as NavigationType,\n ReleaseNoteProps,\n} from '../../types'\n\nconst classNameGenerator = tv({\n base: [\n 'shr-min-w-[auto] shr-overflow-x-auto',\n 'max-[751px]:!shr-hidden',\n 'data-[with-releasenote=\"true\"]:shr-pe-0',\n ],\n})\n\ntype Props = {\n appName: ReactNode\n navigations: NavigationType[]\n additionalContent: ReactNode\n releaseNote?: ReleaseNoteProps | null\n enableNew?: boolean\n}\n\nexport const Navigation: FC<Props> = ({\n appName,\n navigations,\n additionalContent,\n releaseNote,\n enableNew,\n}) => {\n const className = useMemo(() => classNameGenerator(), [])\n const actualNavigations = useMemo(() => buildNavigations(navigations), [navigations])\n\n return (\n <AppNavi\n displayDropdownCaret\n additionalArea={\n <Cluster align=\"center\" className=\"shr-flex-nowrap shr-ps-1\">\n {additionalContent}\n {releaseNote && <ReleaseNotesDropdown {...releaseNote} />}\n </Cluster>\n }\n className={className}\n data-with-releasenote={!!releaseNote}\n label={enableNew ? undefined : appName}\n >\n {actualNavigations}\n </AppNavi>\n )\n}\n\nconst buildNavigations = (navigations: NavigationType[]) =>\n navigations.map((navigation, index) => {\n if ('elementAs' in navigation) {\n const { elementAs, ...rest } = navigation\n\n return <AppNaviCustomTag {...rest} key={index} tag={elementAs} />\n }\n if ('href' in navigation) {\n return <AppNaviAnchor {...navigation} key={index} />\n }\n if ('childNavigations' in navigation) {\n return (\n <AppNaviDropdownMenuButton key={index} label={navigation.children}>\n {buildDropdownMenu(navigation.childNavigations)}\n </AppNaviDropdownMenuButton>\n )\n }\n\n return <AppNaviButton {...navigation} key={index} />\n })\n\nconst buildDropdownMenu = (navigations: Array<ChildNavigation | ChildNavigationGroup>) =>\n navigations.map((navigation, index) => {\n if ('elementAs' in navigation) {\n return <DropdownCustomTag {...navigation} key={index} />\n }\n if ('href' in navigation) {\n return <DropdownMenuAnchorButton {...navigation} key={index} />\n }\n if ('title' in navigation) {\n return (\n <DropdownMenuGroup key={index} name={navigation.title}>\n {buildDropdownMenu(navigation.childNavigations)}\n </DropdownMenuGroup>\n )\n }\n\n return <DropdownNavigationButton {...navigation} key={index} />\n })\n\nconst DropdownCustomTag = memo<NavigationCustomTag>(\n ({ elementAs: Component, current, className, ...rest }) => {\n const actualClassName = useMemo(\n () =>\n commonButtonClassNameGenerator({\n current,\n className,\n rounded: false,\n }),\n [current, className],\n )\n\n return <Component {...rest} className={actualClassName} aria-current={current || undefined} />\n },\n)\nconst DropdownMenuAnchorButton = memo<NavigationLink>(({ current, ...rest }) => (\n <AnchorButton {...rest} aria-current={current ? 'page' : undefined} />\n))\nconst DropdownNavigationButton = memo<NavigationButton>(({ current, ...rest }) => (\n <Button {...rest} aria-current={current ? 'page' : undefined} />\n))\n"],"names":["tv","_jsx","_jsxs","_createElement"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Navigation.js","sources":["../../../../../src/components/AppHeader/components/desktop/Navigation.tsx"],"sourcesContent":["import { type FC, type ReactNode, memo, useMemo } from 'react'\nimport { tv } from 'tailwind-variants'\n\nimport {\n AppNavi,\n AppNaviAnchor,\n AppNaviButton,\n AppNaviCustomTag,\n AppNaviDropdownMenuButton,\n} from '../../../AppNavi'\nimport { AnchorButton, Button } from '../../../Button'\nimport { DropdownMenuGroup } from '../../../Dropdown'\nimport { Cluster } from '../../../Layout'\nimport { commonButtonClassNameGenerator } from '../common/CommonButton'\n\nimport { ReleaseNotesDropdown } from './ReleaseNotesDropdown'\n\nimport type {\n ChildNavigation,\n ChildNavigationGroup,\n NavigationButton,\n NavigationCustomTag,\n NavigationLink,\n Navigation as NavigationType,\n ReleaseNoteProps,\n} from '../../types'\n\nconst classNameGenerator = tv({\n base: [\n 'shr-min-w-[auto] shr-overflow-x-auto',\n 'max-[751px]:!shr-hidden',\n 'data-[with-releasenote=\"true\"]:shr-pe-0',\n ],\n})\n\ntype Props = {\n appName: ReactNode\n navigations: NavigationType[]\n additionalContent: ReactNode\n releaseNote?: ReleaseNoteProps | null\n enableNew?: boolean\n}\n\nexport const Navigation: FC<Props> = ({\n appName,\n navigations,\n additionalContent,\n releaseNote,\n enableNew,\n}) => {\n const className = useMemo(() => classNameGenerator(), [])\n const actualNavigations = useMemo(() => buildNavigations(navigations), [navigations])\n\n return (\n <AppNavi\n displayDropdownCaret\n additionalArea={\n <Cluster align=\"center\" className=\"shr-flex-nowrap shr-ps-1\">\n {additionalContent}\n {releaseNote && <ReleaseNotesDropdown {...releaseNote} />}\n </Cluster>\n }\n className={className}\n data-with-releasenote={!!releaseNote}\n label={enableNew ? undefined : appName}\n >\n {actualNavigations}\n </AppNavi>\n )\n}\n\nconst buildNavigations = (navigations: NavigationType[]) =>\n navigations.map((navigation, index) => {\n if ('elementAs' in navigation) {\n const { elementAs, ...rest } = navigation\n\n return <AppNaviCustomTag {...rest} key={index} tag={elementAs} />\n }\n if ('href' in navigation) {\n return <AppNaviAnchor {...navigation} key={index} />\n }\n if ('childNavigations' in navigation) {\n return (\n <AppNaviDropdownMenuButton key={index} label={navigation.children}>\n {buildDropdownMenu(navigation.childNavigations)}\n </AppNaviDropdownMenuButton>\n )\n }\n\n return <AppNaviButton {...navigation} key={index} />\n })\n\nconst buildDropdownMenu = (navigations: Array<ChildNavigation | ChildNavigationGroup>) =>\n navigations.map((navigation, index) => {\n if ('elementAs' in navigation) {\n return <DropdownCustomTag {...navigation} key={index} />\n }\n if ('href' in navigation) {\n return <DropdownMenuAnchorButton {...navigation} key={index} />\n }\n if ('title' in navigation) {\n return (\n <DropdownMenuGroup key={index} name={navigation.title}>\n {buildDropdownMenu(navigation.childNavigations)}\n </DropdownMenuGroup>\n )\n }\n\n return <DropdownNavigationButton {...navigation} key={index} />\n })\n\nconst DropdownCustomTag = memo<NavigationCustomTag>(\n ({ elementAs: Component, current, className, ...rest }) => {\n const actualClassName = useMemo(\n () =>\n commonButtonClassNameGenerator({\n current,\n className,\n rounded: false,\n }),\n [current, className],\n )\n\n return <Component {...rest} className={actualClassName} aria-current={current || undefined} />\n },\n)\nconst DropdownMenuAnchorButton = memo<NavigationLink>(({ current, ...rest }) => (\n <AnchorButton {...rest} aria-current={current ? 'page' : undefined} />\n))\nconst DropdownNavigationButton = memo<NavigationButton>(({ current, ...rest }) => (\n <Button {...rest} aria-current={current ? 'page' : undefined} />\n))\n"],"names":["tv","_jsx","_jsxs","_createElement"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BA,MAAM,kBAAkB,GAAGA,EAAE,CAAC;AAC5B,IAAA,IAAI,EAAE;QACJ,sCAAsC;QACtC,yBAAyB;QACzB,yCAAyC;AAC1C,KAAA;AACF,CAAA,CAAC;AAUK,MAAM,UAAU,GAAc,CAAC,EACpC,OAAO,EACP,WAAW,EACX,iBAAiB,EACjB,WAAW,EACX,SAAS,GACV,KAAI;AACH,IAAA,MAAM,SAAS,GAAG,OAAO,CAAC,MAAM,kBAAkB,EAAE,EAAE,EAAE,CAAC;A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E,OAAO,EAAE,GAAG,IAAI,EAAE,MACzEA,GAAA,CAAC,YAAY,EAAA,EAAA,GAAK,IAAI,EAAA,cAAA,EAAgB,OAAO,GAAG,MAAM,GAAG,SAAS,EAAA,CAAI,CACvE,CAAC;AACF,MAAM,wBAAwB,GAAG,IAAI,CAAmB,CAAC,EAAE,OAAO,EAAE,GAAG,IAAI,EAAE,MAC3EA,GAAA,CAAC,MAAM,EAAA,EAAA,GAAK,IAAI,EAAA,cAAA,EAAgB,OAAO,GAAG,MAAM,GAAG,SAAS,EAAA,CAAI,CACjE,CAAC;;"}
|
|
@@ -9,8 +9,15 @@ require('../../../../intl/client/IntlProvider.cjs');
|
|
|
9
9
|
var intl_client_Localizer = require('../../../../intl/client/Localizer.cjs');
|
|
10
10
|
require('../../../../intl/client/TimeFormatter.cjs');
|
|
11
11
|
var components_Button_Button = require('../../../Button/Button.cjs');
|
|
12
|
-
require('../../../
|
|
12
|
+
var components_Icon_FaIcon = require('../../../Icon/FaIcon.cjs');
|
|
13
|
+
require('../../../Icon/generateIcon.cjs');
|
|
14
|
+
require('../../../Icon/FilterIcon.cjs');
|
|
15
|
+
require('../../../Icon/OpenInNewTabIcon.cjs');
|
|
16
|
+
require('../../../Icon/client/FilterCheckIcon.cjs');
|
|
17
|
+
require('../../../Icon/client/StatusIcon.cjs');
|
|
18
|
+
require('../../../Button/DisabledReason.cjs');
|
|
13
19
|
require('../../../Button/client/UnstyledButton.cjs');
|
|
20
|
+
require('../../../Button/style.cjs');
|
|
14
21
|
var components_Dropdown_client_Dropdown = require('../../../Dropdown/client/Dropdown.cjs');
|
|
15
22
|
var components_Dropdown_client_DropdownContent = require('../../../Dropdown/client/DropdownContent.cjs');
|
|
16
23
|
require('../../../Dropdown/client/DropdownMenuButton/DropdownMenuButton.cjs');
|
|
@@ -18,16 +25,9 @@ var components_Dropdown_client_DropdownTrigger = require('../../../Dropdown/clie
|
|
|
18
25
|
require('../../../Dropdown/client/SortDropdown/SortDropdown.cjs');
|
|
19
26
|
require('../../../Dropdown/FilterDropdown/FilterDropdown.cjs');
|
|
20
27
|
require('../../../Dropdown/DropdownMenuGroup/DropdownMenuGroup.cjs');
|
|
21
|
-
var components_Icon_FaIcon = require('../../../Icon/FaIcon.cjs');
|
|
22
|
-
require('../../../Icon/generateIcon.cjs');
|
|
23
|
-
require('../../../Icon/FilterIcon.cjs');
|
|
24
|
-
require('../../../Icon/OpenInNewTabIcon.cjs');
|
|
25
|
-
require('../../../Icon/client/FilterCheckIcon.cjs');
|
|
26
|
-
require('../../../Icon/client/StatusIcon.cjs');
|
|
27
28
|
require('../../../Layout/Stack/Stack.cjs');
|
|
28
29
|
require('../../../Layout/Cluster/Cluster.cjs');
|
|
29
30
|
require('../../../Layout/Reel/Reel.cjs');
|
|
30
|
-
require('../../../Layout/Sidebar/Sidebar.cjs');
|
|
31
31
|
var components_Layout_Center_Center = require('../../../Layout/Center/Center.cjs');
|
|
32
32
|
require('../../../Layout/client/Container/Container.cjs');
|
|
33
33
|
var components_Loader_Loader = require('../../../Loader/Loader.cjs');
|
|
@@ -7,8 +7,15 @@ import '../../../../intl/client/IntlProvider.js';
|
|
|
7
7
|
import { Localizer } from '../../../../intl/client/Localizer.js';
|
|
8
8
|
import '../../../../intl/client/TimeFormatter.js';
|
|
9
9
|
import { Button } from '../../../Button/Button.js';
|
|
10
|
-
import '../../../
|
|
10
|
+
import { FaCaretDownIcon } from '../../../Icon/FaIcon.js';
|
|
11
|
+
import '../../../Icon/generateIcon.js';
|
|
12
|
+
import '../../../Icon/FilterIcon.js';
|
|
13
|
+
import '../../../Icon/OpenInNewTabIcon.js';
|
|
14
|
+
import '../../../Icon/client/FilterCheckIcon.js';
|
|
15
|
+
import '../../../Icon/client/StatusIcon.js';
|
|
16
|
+
import '../../../Button/DisabledReason.js';
|
|
11
17
|
import '../../../Button/client/UnstyledButton.js';
|
|
18
|
+
import '../../../Button/style.js';
|
|
12
19
|
import { Dropdown } from '../../../Dropdown/client/Dropdown.js';
|
|
13
20
|
import { DropdownContent } from '../../../Dropdown/client/DropdownContent.js';
|
|
14
21
|
import '../../../Dropdown/client/DropdownMenuButton/DropdownMenuButton.js';
|
|
@@ -16,16 +23,9 @@ import { DropdownTrigger } from '../../../Dropdown/client/DropdownTrigger.js';
|
|
|
16
23
|
import '../../../Dropdown/client/SortDropdown/SortDropdown.js';
|
|
17
24
|
import '../../../Dropdown/FilterDropdown/FilterDropdown.js';
|
|
18
25
|
import '../../../Dropdown/DropdownMenuGroup/DropdownMenuGroup.js';
|
|
19
|
-
import { FaCaretDownIcon } from '../../../Icon/FaIcon.js';
|
|
20
|
-
import '../../../Icon/generateIcon.js';
|
|
21
|
-
import '../../../Icon/FilterIcon.js';
|
|
22
|
-
import '../../../Icon/OpenInNewTabIcon.js';
|
|
23
|
-
import '../../../Icon/client/FilterCheckIcon.js';
|
|
24
|
-
import '../../../Icon/client/StatusIcon.js';
|
|
25
26
|
import '../../../Layout/Stack/Stack.js';
|
|
26
27
|
import '../../../Layout/Cluster/Cluster.js';
|
|
27
28
|
import '../../../Layout/Reel/Reel.js';
|
|
28
|
-
import '../../../Layout/Sidebar/Sidebar.js';
|
|
29
29
|
import { Center } from '../../../Layout/Center/Center.js';
|
|
30
30
|
import '../../../Layout/client/Container/Container.js';
|
|
31
31
|
import { Loader } from '../../../Loader/Loader.js';
|
|
@@ -27,7 +27,6 @@ require('../../../Icon/client/StatusIcon.cjs');
|
|
|
27
27
|
var components_Layout_Stack_Stack = require('../../../Layout/Stack/Stack.cjs');
|
|
28
28
|
var components_Layout_Cluster_Cluster = require('../../../Layout/Cluster/Cluster.cjs');
|
|
29
29
|
require('../../../Layout/Reel/Reel.cjs');
|
|
30
|
-
require('../../../Layout/Sidebar/Sidebar.cjs');
|
|
31
30
|
require('../../../Layout/Center/Center.cjs');
|
|
32
31
|
require('../../../Layout/client/Container/Container.cjs');
|
|
33
32
|
var components_Text_Text = require('../../../Text/Text.cjs');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserInfo.cjs","sources":["../../../../../src/components/AppHeader/components/desktop/UserInfo.tsx"],"sourcesContent":["import { type FC, type PropsWithChildren, type ReactNode, memo, useMemo } from 'react'\nimport { tv } from 'tailwind-variants'\n\nimport { Localizer } from '../../../../intl'\nimport { AnchorButton, Button } from '../../../Button'\nimport { Dropdown, DropdownContent, DropdownMenuButton, DropdownTrigger } from '../../../Dropdown'\nimport { FaCaretDownIcon, FaGearIcon, FaUserIcon } from '../../../Icon'\nimport { Cluster, Stack } from '../../../Layout'\nimport { Text } from '../../../Text'\nimport { buildDisplayName } from '../../utils'\nimport { CommonButton } from '../common/CommonButton'\n\nimport type { HeaderProps, UserInfoProps } from '../../types'\n\n// HeaderDropdownMenuButton と同じスタイルを適用\nconst classNameGenerator = tv({\n slots: {\n userSummary: [\n 'shr-relative -shr-mx-0.25 -shr-mt-0.5 shr-p-1',\n // FIXME: smarthr-ui で DropdownMenuButton のグルーピングができるようになったら修正しましょう\n 'after:shr-absolute after:shr-inset-x-0.5 after:shr-bottom-0 after:shr-block after:shr-h-px after:shr-bg-border after:shr-content-[\"\"]',\n ],\n dropdownMenuButton: [\n '[&_.smarthr-ui-DropdownMenuButton-trigger]:shr-border-transparent [&_.smarthr-ui-DropdownMenuButton-trigger]:shr-px-0.5 [&_.smarthr-ui-DropdownMenuButton-trigger]:shr-font-normal',\n ],\n dropdownContentButton: [\n '[&&.smarthr-ui-AnchorButton]:shr-p-0.75 [&&.smarthr-ui-AnchorButton]:shr-py-0.75',\n '[&&.smarthr-ui-Button]:shr-p-0.75 [&&.smarthr-ui-Button]:shr-py-0.75',\n ],\n button: [\n '[&&]:shr-border-transparent [&&]:shr-font-normal [&&]:last-of-type:-shr-me-0.25',\n '[&&]:focus-visible:shr-bg-transparent',\n \"[&[aria-expanded='true']_.smarthr-ui-Icon:last-child]:shr-rotate-180\",\n ],\n dropdownContent: '[&&]:shr-whitespace-pre [&&]:shr-p-0.5',\n accountImage: '',\n placeholderImage: 'shr-p-0.5',\n },\n variants: {\n enableNew: {\n true: {\n button: '[&&]:shr-px-0.5',\n },\n false: {\n button:\n '[&&]:shr-bg-transparent [&&]:shr-px-0.25 [&&]:shr-text-white [&&]:hover:shr-bg-transparent',\n },\n },\n },\n compoundSlots: [\n {\n slots: ['accountImage', 'placeholderImage'],\n className:\n 'shr-border-shorthand -shr-my-1 shr-box-border shr-flex shr-size-2 shr-items-center shr-justify-center shr-rounded-full shr-bg-white',\n },\n ],\n})\n\ntype Props = UserInfoProps &\n Pick<HeaderProps, 'desktopAdditionalContent' | 'tenants' | 'currentTenantId'>\n\nexport const UserInfo: FC<Props> = ({\n email,\n empCode,\n firstName,\n lastName,\n accountUrl,\n desktopAdditionalContent,\n ...rest\n}) => {\n const displayName = useMemo(\n () =>\n buildDisplayName({\n email,\n empCode,\n firstName,\n lastName,\n }),\n [email, empCode, firstName, lastName],\n )\n\n if (!displayName) {\n return null\n }\n\n if (!accountUrl && !desktopAdditionalContent) {\n return <span className=\"shr-text-white\">{displayName}</span>\n }\n\n return (\n <ActualUserInfo\n {...rest}\n email={email}\n empCode={empCode}\n firstName={firstName}\n lastName={lastName}\n accountUrl={accountUrl}\n desktopAdditionalContent={desktopAdditionalContent}\n displayName={displayName}\n />\n )\n}\n\nconst ActualUserInfo: FC<Props & { displayName: string }> = ({\n email,\n empCode,\n firstName,\n lastName,\n tenants,\n currentTenantId,\n accountUrl,\n accountImageUrl,\n desktopAdditionalContent,\n enableNew,\n displayName,\n}) => {\n const classNames = useMemo(() => {\n const {\n userSummary,\n dropdownMenuButton,\n dropdownContentButton,\n button,\n dropdownContent,\n accountImage,\n placeholderImage,\n } = classNameGenerator()\n\n return {\n userSummary: userSummary(),\n dropdownMenuButton: dropdownMenuButton(),\n dropdownContentButton: dropdownContentButton(),\n button: button({ enableNew }),\n dropdownContent: dropdownContent(),\n accountImage: accountImage(),\n placeholderImage: placeholderImage(),\n }\n }, [enableNew])\n\n const currentTenantName = useMemo(\n () => tenants?.find((tenant) => tenant.id === currentTenantId)?.name,\n [tenants, currentTenantId],\n )\n\n if (enableNew) {\n return (\n <DropdownMenuButton\n className={classNames.dropdownMenuButton}\n trigger={\n <DropdownMenuLabel\n firstName={firstName}\n lastName={lastName}\n email={email}\n accountImageUrl={accountImageUrl}\n currentTenantName={currentTenantName}\n accountImageClassName={classNames.accountImage}\n placeHolderImageClassName={classNames.placeholderImage}\n />\n }\n >\n <UserSummaryStack\n currentTenantName={currentTenantName}\n empCode={empCode}\n firstName={firstName}\n lastName={lastName}\n email={email}\n className={classNames.userSummary}\n />\n <DropdownContentButton href={accountUrl} className={classNames.dropdownContentButton}>\n <Localizer id=\"smarthr-ui/AppHeader/userSettings\" defaultText=\"個人設定\" />\n </DropdownContentButton>\n {desktopAdditionalContent}\n </DropdownMenuButton>\n )\n }\n\n return (\n <Dropdown>\n <DisplayNameDropdownTrigger className={classNames.button}>\n {displayName}\n </DisplayNameDropdownTrigger>\n <DropdownContent className={classNames.dropdownContent}>\n <AccountLink href={accountUrl}>\n <Localizer id=\"smarthr-ui/AppHeader/userSettings\" defaultText=\"個人設定\" />\n </AccountLink>\n {desktopAdditionalContent}\n </DropdownContent>\n </Dropdown>\n )\n}\n\nconst DropdownMenuLabel = memo<\n Pick<Props, 'firstName' | 'lastName' | 'email'> & {\n accountImageUrl?: string\n currentTenantName: ReactNode\n accountImageClassName: string\n placeHolderImageClassName: string\n }\n>(\n ({\n firstName,\n lastName,\n email,\n accountImageUrl,\n currentTenantName,\n accountImageClassName,\n placeHolderImageClassName,\n }) => {\n const body: ReactNode[] = []\n\n if (currentTenantName) {\n body.push(currentTenantName)\n }\n\n if (firstName && lastName) {\n body.push(`${firstName} ${lastName}`)\n } else if (email) {\n body.push(email)\n }\n\n if (body.length === 2) {\n body.splice(1, 0, <br />)\n }\n\n return (\n <Cluster as=\"span\" align=\"flex-start\">\n {accountImageUrl ? (\n // eslint-disable-next-line smarthr/a11y-image-has-alt-attribute, jsx-a11y/alt-text\n <img src={accountImageUrl} className={accountImageClassName} aria-hidden />\n ) : (\n <span className={placeHolderImageClassName}>\n <FaUserIcon color=\"TEXT_GREY\" />\n </span>\n )}\n\n <Text size=\"XS\" leading=\"NORMAL\" className=\"-shr-my-1 shr-text-left\">\n {body}\n </Text>\n </Cluster>\n )\n },\n)\n\nconst UserSummaryStack = memo<\n Pick<Props, 'empCode' | 'firstName' | 'lastName' | 'email'> & {\n currentTenantName: ReactNode\n className: string\n }\n>(({ currentTenantName, empCode, firstName, lastName, email, className }) => (\n <Stack gap={0.5} className={className}>\n <Text size=\"S\" color=\"TEXT_GREY\" weight=\"bold\" leading=\"TIGHT\">\n {currentTenantName}\n </Text>\n\n {empCode || (firstName && lastName) ? (\n <Cluster align=\"center\">\n {empCode && (\n <Text size=\"S\" color=\"TEXT_GREY\" leading=\"TIGHT\">\n {empCode}\n </Text>\n )}\n {firstName && lastName && <Text leading=\"TIGHT\">{`${lastName} ${firstName}`}</Text>}\n </Cluster>\n ) : (\n <Text leading=\"TIGHT\">{email}</Text>\n )}\n </Stack>\n))\n\nconst DropdownContentButton = memo<PropsWithChildren<{ href?: string | null; className: string }>>(\n ({ href, children, className }) =>\n href && (\n <AnchorButton\n href={href}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className={className}\n prefix={<FaGearIcon />}\n >\n {children}\n </AnchorButton>\n ),\n)\n\nconst DisplayNameDropdownTrigger = memo<PropsWithChildren<{ className: string }>>(\n ({ children, className }) => (\n <DropdownTrigger>\n <Button variant=\"text\" className={className} suffix={<FaCaretDownIcon />}>\n {children}\n </Button>\n </DropdownTrigger>\n ),\n)\n\nconst AccountLink = memo<PropsWithChildren<{ href?: string | null }>>(\n ({ href, children }) =>\n href && (\n <CommonButton\n elementAs=\"a\"\n href={href}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n prefix={<FaGearIcon />}\n >\n {children}\n </CommonButton>\n ),\n)\n"],"names":["tv","useMemo","buildDisplayName","_jsx","_jsxs","DropdownMenuButton","Localizer","Dropdown","DropdownContent","memo","Cluster","FaUserIcon","Text","Stack","AnchorButton","FaGearIcon","DropdownTrigger","Button","FaCaretDownIcon","CommonButton"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAcA;AACA,MAAM,kBAAkB,GAAGA,QAAE,CAAC;AAC5B,IAAA,KAAK,EAAE;AACL,QAAA,WAAW,EAAE;YACX,+CAA+C;;YAE/C,uIAAuI;AACxI,SAAA;AACD,QAAA,kBAAkB,EAAE;YAClB,oLAAoL;AACrL,SAAA;AACD,QAAA,qBAAqB,EAAE;YACrB,kFAAkF;YAClF,sEAAsE;AACvE,SAAA;AACD,QAAA,MAAM,EAAE;YACN,iFAAiF;YACjF,uCAAuC;YACvC,sEAAsE;AACvE,SAAA;AACD,QAAA,eAAe,EAAE,wCAAwC;AACzD,QAAA,YAAY,EAAE,EAAE;AAChB,QAAA,gBAAgB,EAAE,WAAW;AAC9B,KAAA;AACD,IAAA,QAAQ,EAAE;AACR,QAAA,SAAS,EAAE;AACT,YAAA,IAAI,EAAE;AACJ,gBAAA,MAAM,EAAE,iBAAiB;AAC1B,aAAA;AACD,YAAA,KAAK,EAAE;AACL,gBAAA,MAAM,EACJ,4FAA4F;AAC/F,aAAA;AACF,SAAA;AACF,KAAA;AACD,IAAA,aAAa,EAAE;AACb,QAAA;AACE,YAAA,KAAK,EAAE,CAAC,cAAc,EAAE,kBAAkB,CAAC;AAC3C,YAAA,SAAS,EACP,qIAAqI;AACxI,SAAA;AACF,KAAA;AACF,CAAA,CAAC;MAKW,QAAQ,GAAc,CAAC,EAClC,KAAK,EACL,OAAO,EACP,SAAS,EACT,QAAQ,EACR,UAAU,EACV,wBAAwB,EACxB,GAAG,IAAI,EACR,KAAI;IACH,MAAM,WAAW,GAAGC,aAAO,CACzB,MACEC,2CAAgB,CAAC;QACf,KAAK;QACL,OAAO;QACP,SAAS;QACT,QAAQ;KACT,CAAC,EACJ,CAAC,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,C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C,qBAAqB,EACzB,SAAS,EAAE,SAAS,EACpB,MAAM,EAAEX,eAACY,iCAAU,EAAA,EAAA,CAAG,YAErB,QAAQ,EAAA,CACI,CAChB,CACJ;AAED,MAAM,0BAA0B,GAAGN,UAAI,CACrC,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,MACtBN,cAAA,CAACa,0DAAe,cACdb,cAAA,CAACc,+BAAM,EAAA,EAAC,OAAO,EAAC,MAAM,EAAC,SAAS,EAAE,SAAS,EAAE,MAAM,EAAEd,cAAA,CAACe,sCAAe,KAAG,EAAA,QAAA,EACrE,QAAQ,GACF,EAAA,CACO,CACnB,CACF;AAED,MAAM,WAAW,GAAGT,UAAI,CACtB,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,KACjB,IAAI,KACFN,eAACgB,gEAAY,EAAA,EACX,SAAS,EAAC,GAAG,EACb,IAAI,EAAE,IAAI,EACV,MAAM,EAAC,QAAQ,EACf,GAAG,EAAC,qBAAqB,EACzB,MAAM,EAAEhB,eAACY,iCAAU,EAAA,EAAA,CAAG,YAErB,QAAQ,EAAA,CACI,CAChB,CACJ;;"}
|
|
1
|
+
{"version":3,"file":"UserInfo.cjs","sources":["../../../../../src/components/AppHeader/components/desktop/UserInfo.tsx"],"sourcesContent":["import { type FC, type PropsWithChildren, type ReactNode, memo, useMemo } from 'react'\nimport { tv } from 'tailwind-variants'\n\nimport { Localizer } from '../../../../intl'\nimport { AnchorButton, Button } from '../../../Button'\nimport { Dropdown, DropdownContent, DropdownMenuButton, DropdownTrigger } from '../../../Dropdown'\nimport { FaCaretDownIcon, FaGearIcon, FaUserIcon } from '../../../Icon'\nimport { Cluster, Stack } from '../../../Layout'\nimport { Text } from '../../../Text'\nimport { buildDisplayName } from '../../utils'\nimport { CommonButton } from '../common/CommonButton'\n\nimport type { HeaderProps, UserInfoProps } from '../../types'\n\n// HeaderDropdownMenuButton と同じスタイルを適用\nconst classNameGenerator = tv({\n slots: {\n userSummary: [\n 'shr-relative -shr-mx-0.25 -shr-mt-0.5 shr-p-1',\n // FIXME: smarthr-ui で DropdownMenuButton のグルーピングができるようになったら修正しましょう\n 'after:shr-absolute after:shr-inset-x-0.5 after:shr-bottom-0 after:shr-block after:shr-h-px after:shr-bg-border after:shr-content-[\"\"]',\n ],\n dropdownMenuButton: [\n '[&_.smarthr-ui-DropdownMenuButton-trigger]:shr-border-transparent [&_.smarthr-ui-DropdownMenuButton-trigger]:shr-px-0.5 [&_.smarthr-ui-DropdownMenuButton-trigger]:shr-font-normal',\n ],\n dropdownContentButton: [\n '[&&.smarthr-ui-AnchorButton]:shr-p-0.75 [&&.smarthr-ui-AnchorButton]:shr-py-0.75',\n '[&&.smarthr-ui-Button]:shr-p-0.75 [&&.smarthr-ui-Button]:shr-py-0.75',\n ],\n button: [\n '[&&]:shr-border-transparent [&&]:shr-font-normal [&&]:last-of-type:-shr-me-0.25',\n '[&&]:focus-visible:shr-bg-transparent',\n \"[&[aria-expanded='true']_.smarthr-ui-Icon:last-child]:shr-rotate-180\",\n ],\n dropdownContent: '[&&]:shr-whitespace-pre [&&]:shr-p-0.5',\n accountImage: '',\n placeholderImage: 'shr-p-0.5',\n },\n variants: {\n enableNew: {\n true: {\n button: '[&&]:shr-px-0.5',\n },\n false: {\n button:\n '[&&]:shr-bg-transparent [&&]:shr-px-0.25 [&&]:shr-text-white [&&]:hover:shr-bg-transparent',\n },\n },\n },\n compoundSlots: [\n {\n slots: ['accountImage', 'placeholderImage'],\n className:\n 'shr-border-shorthand -shr-my-1 shr-box-border shr-flex shr-size-2 shr-items-center shr-justify-center shr-rounded-full shr-bg-white',\n },\n ],\n})\n\ntype Props = UserInfoProps &\n Pick<HeaderProps, 'desktopAdditionalContent' | 'tenants' | 'currentTenantId'>\n\nexport const UserInfo: FC<Props> = ({\n email,\n empCode,\n firstName,\n lastName,\n accountUrl,\n desktopAdditionalContent,\n ...rest\n}) => {\n const displayName = useMemo(\n () =>\n buildDisplayName({\n email,\n empCode,\n firstName,\n lastName,\n }),\n [email, empCode, firstName, lastName],\n )\n\n if (!displayName) {\n return null\n }\n\n if (!accountUrl && !desktopAdditionalContent) {\n return <span className=\"shr-text-white\">{displayName}</span>\n }\n\n return (\n <ActualUserInfo\n {...rest}\n email={email}\n empCode={empCode}\n firstName={firstName}\n lastName={lastName}\n accountUrl={accountUrl}\n desktopAdditionalContent={desktopAdditionalContent}\n displayName={displayName}\n />\n )\n}\n\nconst ActualUserInfo: FC<Props & { displayName: string }> = ({\n email,\n empCode,\n firstName,\n lastName,\n tenants,\n currentTenantId,\n accountUrl,\n accountImageUrl,\n desktopAdditionalContent,\n enableNew,\n displayName,\n}) => {\n const classNames = useMemo(() => {\n const {\n userSummary,\n dropdownMenuButton,\n dropdownContentButton,\n button,\n dropdownContent,\n accountImage,\n placeholderImage,\n } = classNameGenerator()\n\n return {\n userSummary: userSummary(),\n dropdownMenuButton: dropdownMenuButton(),\n dropdownContentButton: dropdownContentButton(),\n button: button({ enableNew }),\n dropdownContent: dropdownContent(),\n accountImage: accountImage(),\n placeholderImage: placeholderImage(),\n }\n }, [enableNew])\n\n const currentTenantName = useMemo(\n () => tenants?.find((tenant) => tenant.id === currentTenantId)?.name,\n [tenants, currentTenantId],\n )\n\n if (enableNew) {\n return (\n <DropdownMenuButton\n className={classNames.dropdownMenuButton}\n trigger={\n <DropdownMenuLabel\n firstName={firstName}\n lastName={lastName}\n email={email}\n accountImageUrl={accountImageUrl}\n currentTenantName={currentTenantName}\n accountImageClassName={classNames.accountImage}\n placeHolderImageClassName={classNames.placeholderImage}\n />\n }\n >\n <UserSummaryStack\n currentTenantName={currentTenantName}\n empCode={empCode}\n firstName={firstName}\n lastName={lastName}\n email={email}\n className={classNames.userSummary}\n />\n <DropdownContentButton href={accountUrl} className={classNames.dropdownContentButton}>\n <Localizer id=\"smarthr-ui/AppHeader/userSettings\" defaultText=\"個人設定\" />\n </DropdownContentButton>\n {desktopAdditionalContent}\n </DropdownMenuButton>\n )\n }\n\n return (\n <Dropdown>\n <DisplayNameDropdownTrigger className={classNames.button}>\n {displayName}\n </DisplayNameDropdownTrigger>\n <DropdownContent className={classNames.dropdownContent}>\n <AccountLink href={accountUrl}>\n <Localizer id=\"smarthr-ui/AppHeader/userSettings\" defaultText=\"個人設定\" />\n </AccountLink>\n {desktopAdditionalContent}\n </DropdownContent>\n </Dropdown>\n )\n}\n\nconst DropdownMenuLabel = memo<\n Pick<Props, 'firstName' | 'lastName' | 'email'> & {\n accountImageUrl?: string\n currentTenantName: ReactNode\n accountImageClassName: string\n placeHolderImageClassName: string\n }\n>(\n ({\n firstName,\n lastName,\n email,\n accountImageUrl,\n currentTenantName,\n accountImageClassName,\n placeHolderImageClassName,\n }) => {\n const body: ReactNode[] = []\n\n if (currentTenantName) {\n body.push(currentTenantName)\n }\n\n if (firstName && lastName) {\n body.push(`${firstName} ${lastName}`)\n } else if (email) {\n body.push(email)\n }\n\n if (body.length === 2) {\n body.splice(1, 0, <br />)\n }\n\n return (\n <Cluster as=\"span\" align=\"flex-start\">\n {accountImageUrl ? (\n // eslint-disable-next-line smarthr/a11y-image-has-alt-attribute, jsx-a11y/alt-text\n <img src={accountImageUrl} className={accountImageClassName} aria-hidden />\n ) : (\n <span className={placeHolderImageClassName}>\n <FaUserIcon color=\"TEXT_GREY\" />\n </span>\n )}\n\n <Text size=\"XS\" leading=\"NORMAL\" className=\"-shr-my-1 shr-text-left\">\n {body}\n </Text>\n </Cluster>\n )\n },\n)\n\nconst UserSummaryStack = memo<\n Pick<Props, 'empCode' | 'firstName' | 'lastName' | 'email'> & {\n currentTenantName: ReactNode\n className: string\n }\n>(({ currentTenantName, empCode, firstName, lastName, email, className }) => (\n <Stack gap={0.5} className={className}>\n <Text size=\"S\" color=\"TEXT_GREY\" weight=\"bold\" leading=\"TIGHT\">\n {currentTenantName}\n </Text>\n\n {empCode || (firstName && lastName) ? (\n <Cluster align=\"center\">\n {empCode && (\n <Text size=\"S\" color=\"TEXT_GREY\" leading=\"TIGHT\">\n {empCode}\n </Text>\n )}\n {firstName && lastName && <Text leading=\"TIGHT\">{`${lastName} ${firstName}`}</Text>}\n </Cluster>\n ) : (\n <Text leading=\"TIGHT\">{email}</Text>\n )}\n </Stack>\n))\n\nconst DropdownContentButton = memo<PropsWithChildren<{ href?: string | null; className: string }>>(\n ({ href, children, className }) =>\n href && (\n <AnchorButton\n href={href}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className={className}\n prefix={<FaGearIcon />}\n >\n {children}\n </AnchorButton>\n ),\n)\n\nconst DisplayNameDropdownTrigger = memo<PropsWithChildren<{ className: string }>>(\n ({ children, className }) => (\n <DropdownTrigger>\n <Button variant=\"text\" className={className} suffix={<FaCaretDownIcon />}>\n {children}\n </Button>\n </DropdownTrigger>\n ),\n)\n\nconst AccountLink = memo<PropsWithChildren<{ href?: string | null }>>(\n ({ href, children }) =>\n href && (\n <CommonButton\n elementAs=\"a\"\n href={href}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n prefix={<FaGearIcon />}\n >\n {children}\n </CommonButton>\n ),\n)\n"],"names":["tv","useMemo","buildDisplayName","_jsx","_jsxs","DropdownMenuButton","Localizer","Dropdown","DropdownContent","memo","Cluster","FaUserIcon","Text","Stack","AnchorButton","FaGearIcon","DropdownTrigger","Button","FaCaretDownIcon","CommonButton"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAcA;AACA,MAAM,kBAAkB,GAAGA,QAAE,CAAC;AAC5B,IAAA,KAAK,EAAE;AACL,QAAA,WAAW,EAAE;YACX,+CAA+C;;YAE/C,uIAAuI;AACxI,SAAA;AACD,QAAA,kBAAkB,EAAE;YAClB,oLAAoL;AACrL,SAAA;AACD,QAAA,qBAAqB,EAAE;YACrB,kFAAkF;YAClF,sEAAsE;AACvE,SAAA;AACD,QAAA,MAAM,EAAE;YACN,iFAAiF;YACjF,uCAAuC;YACvC,sEAAsE;AACvE,SAAA;AACD,QAAA,eAAe,EAAE,wCAAwC;AACzD,QAAA,YAAY,EAAE,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S,EAAC,GAAG,EACb,IAAI,EAAE,IAAI,EACV,MAAM,EAAC,QAAQ,EACf,GAAG,EAAC,qBAAqB,EACzB,MAAM,EAAEhB,eAACY,iCAAU,EAAA,EAAA,CAAG,YAErB,QAAQ,EAAA,CACI,CAChB,CACJ;;"}
|
|
@@ -25,7 +25,6 @@ import '../../../Icon/client/StatusIcon.js';
|
|
|
25
25
|
import { Stack } from '../../../Layout/Stack/Stack.js';
|
|
26
26
|
import { Cluster } from '../../../Layout/Cluster/Cluster.js';
|
|
27
27
|
import '../../../Layout/Reel/Reel.js';
|
|
28
|
-
import '../../../Layout/Sidebar/Sidebar.js';
|
|
29
28
|
import '../../../Layout/Center/Center.js';
|
|
30
29
|
import '../../../Layout/client/Container/Container.js';
|
|
31
30
|
import { Text } from '../../../Text/Text.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserInfo.js","sources":["../../../../../src/components/AppHeader/components/desktop/UserInfo.tsx"],"sourcesContent":["import { type FC, type PropsWithChildren, type ReactNode, memo, useMemo } from 'react'\nimport { tv } from 'tailwind-variants'\n\nimport { Localizer } from '../../../../intl'\nimport { AnchorButton, Button } from '../../../Button'\nimport { Dropdown, DropdownContent, DropdownMenuButton, DropdownTrigger } from '../../../Dropdown'\nimport { FaCaretDownIcon, FaGearIcon, FaUserIcon } from '../../../Icon'\nimport { Cluster, Stack } from '../../../Layout'\nimport { Text } from '../../../Text'\nimport { buildDisplayName } from '../../utils'\nimport { CommonButton } from '../common/CommonButton'\n\nimport type { HeaderProps, UserInfoProps } from '../../types'\n\n// HeaderDropdownMenuButton と同じスタイルを適用\nconst classNameGenerator = tv({\n slots: {\n userSummary: [\n 'shr-relative -shr-mx-0.25 -shr-mt-0.5 shr-p-1',\n // FIXME: smarthr-ui で DropdownMenuButton のグルーピングができるようになったら修正しましょう\n 'after:shr-absolute after:shr-inset-x-0.5 after:shr-bottom-0 after:shr-block after:shr-h-px after:shr-bg-border after:shr-content-[\"\"]',\n ],\n dropdownMenuButton: [\n '[&_.smarthr-ui-DropdownMenuButton-trigger]:shr-border-transparent [&_.smarthr-ui-DropdownMenuButton-trigger]:shr-px-0.5 [&_.smarthr-ui-DropdownMenuButton-trigger]:shr-font-normal',\n ],\n dropdownContentButton: [\n '[&&.smarthr-ui-AnchorButton]:shr-p-0.75 [&&.smarthr-ui-AnchorButton]:shr-py-0.75',\n '[&&.smarthr-ui-Button]:shr-p-0.75 [&&.smarthr-ui-Button]:shr-py-0.75',\n ],\n button: [\n '[&&]:shr-border-transparent [&&]:shr-font-normal [&&]:last-of-type:-shr-me-0.25',\n '[&&]:focus-visible:shr-bg-transparent',\n \"[&[aria-expanded='true']_.smarthr-ui-Icon:last-child]:shr-rotate-180\",\n ],\n dropdownContent: '[&&]:shr-whitespace-pre [&&]:shr-p-0.5',\n accountImage: '',\n placeholderImage: 'shr-p-0.5',\n },\n variants: {\n enableNew: {\n true: {\n button: '[&&]:shr-px-0.5',\n },\n false: {\n button:\n '[&&]:shr-bg-transparent [&&]:shr-px-0.25 [&&]:shr-text-white [&&]:hover:shr-bg-transparent',\n },\n },\n },\n compoundSlots: [\n {\n slots: ['accountImage', 'placeholderImage'],\n className:\n 'shr-border-shorthand -shr-my-1 shr-box-border shr-flex shr-size-2 shr-items-center shr-justify-center shr-rounded-full shr-bg-white',\n },\n ],\n})\n\ntype Props = UserInfoProps &\n Pick<HeaderProps, 'desktopAdditionalContent' | 'tenants' | 'currentTenantId'>\n\nexport const UserInfo: FC<Props> = ({\n email,\n empCode,\n firstName,\n lastName,\n accountUrl,\n desktopAdditionalContent,\n ...rest\n}) => {\n const displayName = useMemo(\n () =>\n buildDisplayName({\n email,\n empCode,\n firstName,\n lastName,\n }),\n [email, empCode, firstName, lastName],\n )\n\n if (!displayName) {\n return null\n }\n\n if (!accountUrl && !desktopAdditionalContent) {\n return <span className=\"shr-text-white\">{displayName}</span>\n }\n\n return (\n <ActualUserInfo\n {...rest}\n email={email}\n empCode={empCode}\n firstName={firstName}\n lastName={lastName}\n accountUrl={accountUrl}\n desktopAdditionalContent={desktopAdditionalContent}\n displayName={displayName}\n />\n )\n}\n\nconst ActualUserInfo: FC<Props & { displayName: string }> = ({\n email,\n empCode,\n firstName,\n lastName,\n tenants,\n currentTenantId,\n accountUrl,\n accountImageUrl,\n desktopAdditionalContent,\n enableNew,\n displayName,\n}) => {\n const classNames = useMemo(() => {\n const {\n userSummary,\n dropdownMenuButton,\n dropdownContentButton,\n button,\n dropdownContent,\n accountImage,\n placeholderImage,\n } = classNameGenerator()\n\n return {\n userSummary: userSummary(),\n dropdownMenuButton: dropdownMenuButton(),\n dropdownContentButton: dropdownContentButton(),\n button: button({ enableNew }),\n dropdownContent: dropdownContent(),\n accountImage: accountImage(),\n placeholderImage: placeholderImage(),\n }\n }, [enableNew])\n\n const currentTenantName = useMemo(\n () => tenants?.find((tenant) => tenant.id === currentTenantId)?.name,\n [tenants, currentTenantId],\n )\n\n if (enableNew) {\n return (\n <DropdownMenuButton\n className={classNames.dropdownMenuButton}\n trigger={\n <DropdownMenuLabel\n firstName={firstName}\n lastName={lastName}\n email={email}\n accountImageUrl={accountImageUrl}\n currentTenantName={currentTenantName}\n accountImageClassName={classNames.accountImage}\n placeHolderImageClassName={classNames.placeholderImage}\n />\n }\n >\n <UserSummaryStack\n currentTenantName={currentTenantName}\n empCode={empCode}\n firstName={firstName}\n lastName={lastName}\n email={email}\n className={classNames.userSummary}\n />\n <DropdownContentButton href={accountUrl} className={classNames.dropdownContentButton}>\n <Localizer id=\"smarthr-ui/AppHeader/userSettings\" defaultText=\"個人設定\" />\n </DropdownContentButton>\n {desktopAdditionalContent}\n </DropdownMenuButton>\n )\n }\n\n return (\n <Dropdown>\n <DisplayNameDropdownTrigger className={classNames.button}>\n {displayName}\n </DisplayNameDropdownTrigger>\n <DropdownContent className={classNames.dropdownContent}>\n <AccountLink href={accountUrl}>\n <Localizer id=\"smarthr-ui/AppHeader/userSettings\" defaultText=\"個人設定\" />\n </AccountLink>\n {desktopAdditionalContent}\n </DropdownContent>\n </Dropdown>\n )\n}\n\nconst DropdownMenuLabel = memo<\n Pick<Props, 'firstName' | 'lastName' | 'email'> & {\n accountImageUrl?: string\n currentTenantName: ReactNode\n accountImageClassName: string\n placeHolderImageClassName: string\n }\n>(\n ({\n firstName,\n lastName,\n email,\n accountImageUrl,\n currentTenantName,\n accountImageClassName,\n placeHolderImageClassName,\n }) => {\n const body: ReactNode[] = []\n\n if (currentTenantName) {\n body.push(currentTenantName)\n }\n\n if (firstName && lastName) {\n body.push(`${firstName} ${lastName}`)\n } else if (email) {\n body.push(email)\n }\n\n if (body.length === 2) {\n body.splice(1, 0, <br />)\n }\n\n return (\n <Cluster as=\"span\" align=\"flex-start\">\n {accountImageUrl ? (\n // eslint-disable-next-line smarthr/a11y-image-has-alt-attribute, jsx-a11y/alt-text\n <img src={accountImageUrl} className={accountImageClassName} aria-hidden />\n ) : (\n <span className={placeHolderImageClassName}>\n <FaUserIcon color=\"TEXT_GREY\" />\n </span>\n )}\n\n <Text size=\"XS\" leading=\"NORMAL\" className=\"-shr-my-1 shr-text-left\">\n {body}\n </Text>\n </Cluster>\n )\n },\n)\n\nconst UserSummaryStack = memo<\n Pick<Props, 'empCode' | 'firstName' | 'lastName' | 'email'> & {\n currentTenantName: ReactNode\n className: string\n }\n>(({ currentTenantName, empCode, firstName, lastName, email, className }) => (\n <Stack gap={0.5} className={className}>\n <Text size=\"S\" color=\"TEXT_GREY\" weight=\"bold\" leading=\"TIGHT\">\n {currentTenantName}\n </Text>\n\n {empCode || (firstName && lastName) ? (\n <Cluster align=\"center\">\n {empCode && (\n <Text size=\"S\" color=\"TEXT_GREY\" leading=\"TIGHT\">\n {empCode}\n </Text>\n )}\n {firstName && lastName && <Text leading=\"TIGHT\">{`${lastName} ${firstName}`}</Text>}\n </Cluster>\n ) : (\n <Text leading=\"TIGHT\">{email}</Text>\n )}\n </Stack>\n))\n\nconst DropdownContentButton = memo<PropsWithChildren<{ href?: string | null; className: string }>>(\n ({ href, children, className }) =>\n href && (\n <AnchorButton\n href={href}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className={className}\n prefix={<FaGearIcon />}\n >\n {children}\n </AnchorButton>\n ),\n)\n\nconst DisplayNameDropdownTrigger = memo<PropsWithChildren<{ className: string }>>(\n ({ children, className }) => (\n <DropdownTrigger>\n <Button variant=\"text\" className={className} suffix={<FaCaretDownIcon />}>\n {children}\n </Button>\n </DropdownTrigger>\n ),\n)\n\nconst AccountLink = memo<PropsWithChildren<{ href?: string | null }>>(\n ({ href, children }) =>\n href && (\n <CommonButton\n elementAs=\"a\"\n href={href}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n prefix={<FaGearIcon />}\n >\n {children}\n </CommonButton>\n ),\n)\n"],"names":["tv","_jsx","_jsxs"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAcA;AACA,MAAM,kBAAkB,GAAGA,EAAE,CAAC;AAC5B,IAAA,KAAK,EAAE;AACL,QAAA,WAAW,EAAE;YACX,+CAA+C;;YAE/C,uIAAuI;AACxI,SAAA;AACD,QAAA,kBAAkB,EAAE;YAClB,oLAAoL;AACrL,SAAA;AACD,QAAA,qBAAqB,EAAE;YACrB,kFAAkF;YAClF,sEAAsE;AACvE,SAAA;AACD,QAAA,MAAM,EAAE;YACN,iFAAiF;YACjF,uCAAuC;YACvC,sEAAsE;AACvE,SAAA;AACD,QAAA,eAAe,EAAE,wCAAwC;AACzD,QAAA,YAAY,EAAE,EAAE;AAChB,QAAA,gBAAgB,EAAE,WAAW;AAC9B,KAAA;AACD,IAAA,QAAQ,EAAE;AACR,QAAA,SAAS,EAAE;AACT,YAAA,IAAI,EAAE;AACJ,gBAAA,MAAM,EAAE,iBAAiB;AAC1B,aAAA;AACD,YAAA,KAAK,EAAE;AACL,gBAAA,MAAM,EACJ,4FAA4F;AAC/F,aAAA;AACF,SAAA;AACF,KAAA;AACD,IAAA,aAAa,EAAE;AACb,QAAA;AACE,YAAA,KAAK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,SAAS,CAAA,CAAE,EAAA,CAAQ,CAAA,EAAA,CAC3E,KAEVA,GAAA,CAAC,IAAI,EAAA,EAAC,OAAO,EAAC,OAAO,EAAA,QAAA,EAAE,KAAK,EAAA,CAAQ,CACrC,CAAA,EAAA,CACK,CACT,CAAC;AAEF,MAAM,qBAAqB,GAAG,IAAI,CAChC,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,KAC5B,IAAI,KACFA,GAAA,CAAC,YAAY,EAAA,EACX,IAAI,EAAE,IAAI,EACV,MAAM,EAAC,QAAQ,EACf,GAAG,EAAC,qBAAqB,EACzB,SAAS,EAAE,SAAS,EACpB,MAAM,EAAEA,IAAC,UAAU,EAAA,EAAA,CAAG,YAErB,QAAQ,EAAA,CACI,CAChB,CACJ;AAED,MAAM,0BAA0B,GAAG,IAAI,CACrC,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,MACtBA,GAAA,CAAC,eAAe,cACdA,GAAA,CAAC,MAAM,EAAA,EAAC,OAAO,EAAC,MAAM,EAAC,SAAS,EAAE,SAAS,EAAE,MAAM,EAAEA,GAAA,CAAC,eAAe,KAAG,EAAA,QAAA,EACrE,QAAQ,GACF,EAAA,CACO,CACnB,CACF;AAED,MAAM,WAAW,GAAG,IAAI,CACtB,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,KACjB,IAAI,KACFA,IAAC,YAAY,EAAA,EACX,SAAS,EAAC,GAAG,EACb,IAAI,EAAE,IAAI,EACV,MAAM,EAAC,QAAQ,EACf,GAAG,EAAC,qBAAqB,EACzB,MAAM,EAAEA,IAAC,UAAU,EAAA,EAAA,CAAG,YAErB,QAAQ,EAAA,CACI,CAChB,CACJ;;"}
|
|
1
|
+
{"version":3,"file":"UserInfo.js","sources":["../../../../../src/components/AppHeader/components/desktop/UserInfo.tsx"],"sourcesContent":["import { type FC, type PropsWithChildren, type ReactNode, memo, useMemo } from 'react'\nimport { tv } from 'tailwind-variants'\n\nimport { Localizer } from '../../../../intl'\nimport { AnchorButton, Button } from '../../../Button'\nimport { Dropdown, DropdownContent, DropdownMenuButton, DropdownTrigger } from '../../../Dropdown'\nimport { FaCaretDownIcon, FaGearIcon, FaUserIcon } from '../../../Icon'\nimport { Cluster, Stack } from '../../../Layout'\nimport { Text } from '../../../Text'\nimport { buildDisplayName } from '../../utils'\nimport { CommonButton } from '../common/CommonButton'\n\nimport type { HeaderProps, UserInfoProps } from '../../types'\n\n// HeaderDropdownMenuButton と同じスタイルを適用\nconst classNameGenerator = tv({\n slots: {\n userSummary: [\n 'shr-relative -shr-mx-0.25 -shr-mt-0.5 shr-p-1',\n // FIXME: smarthr-ui で DropdownMenuButton のグルーピングができるようになったら修正しましょう\n 'after:shr-absolute after:shr-inset-x-0.5 after:shr-bottom-0 after:shr-block after:shr-h-px after:shr-bg-border after:shr-content-[\"\"]',\n ],\n dropdownMenuButton: [\n '[&_.smarthr-ui-DropdownMenuButton-trigger]:shr-border-transparent [&_.smarthr-ui-DropdownMenuButton-trigger]:shr-px-0.5 [&_.smarthr-ui-DropdownMenuButton-trigger]:shr-font-normal',\n ],\n dropdownContentButton: [\n '[&&.smarthr-ui-AnchorButton]:shr-p-0.75 [&&.smarthr-ui-AnchorButton]:shr-py-0.75',\n '[&&.smarthr-ui-Button]:shr-p-0.75 [&&.smarthr-ui-Button]:shr-py-0.75',\n ],\n button: [\n '[&&]:shr-border-transparent [&&]:shr-font-normal [&&]:last-of-type:-shr-me-0.25',\n '[&&]:focus-visible:shr-bg-transparent',\n \"[&[aria-expanded='true']_.smarthr-ui-Icon:last-child]:shr-rotate-180\",\n ],\n dropdownContent: '[&&]:shr-whitespace-pre [&&]:shr-p-0.5',\n accountImage: '',\n placeholderImage: 'shr-p-0.5',\n },\n variants: {\n enableNew: {\n true: {\n button: '[&&]:shr-px-0.5',\n },\n false: {\n button:\n '[&&]:shr-bg-transparent [&&]:shr-px-0.25 [&&]:shr-text-white [&&]:hover:shr-bg-transparent',\n },\n },\n },\n compoundSlots: [\n {\n slots: ['accountImage', 'placeholderImage'],\n className:\n 'shr-border-shorthand -shr-my-1 shr-box-border shr-flex shr-size-2 shr-items-center shr-justify-center shr-rounded-full shr-bg-white',\n },\n ],\n})\n\ntype Props = UserInfoProps &\n Pick<HeaderProps, 'desktopAdditionalContent' | 'tenants' | 'currentTenantId'>\n\nexport const UserInfo: FC<Props> = ({\n email,\n empCode,\n firstName,\n lastName,\n accountUrl,\n desktopAdditionalContent,\n ...rest\n}) => {\n const displayName = useMemo(\n () =>\n buildDisplayName({\n email,\n empCode,\n firstName,\n lastName,\n }),\n [email, empCode, firstName, lastName],\n )\n\n if (!displayName) {\n return null\n }\n\n if (!accountUrl && !desktopAdditionalContent) {\n return <span className=\"shr-text-white\">{displayName}</span>\n }\n\n return (\n <ActualUserInfo\n {...rest}\n email={email}\n empCode={empCode}\n firstName={firstName}\n lastName={lastName}\n accountUrl={accountUrl}\n desktopAdditionalContent={desktopAdditionalContent}\n displayName={displayName}\n />\n )\n}\n\nconst ActualUserInfo: FC<Props & { displayName: string }> = ({\n email,\n empCode,\n firstName,\n lastName,\n tenants,\n currentTenantId,\n accountUrl,\n accountImageUrl,\n desktopAdditionalContent,\n enableNew,\n displayName,\n}) => {\n const classNames = useMemo(() => {\n const {\n userSummary,\n dropdownMenuButton,\n dropdownContentButton,\n button,\n dropdownContent,\n accountImage,\n placeholderImage,\n } = classNameGenerator()\n\n return {\n userSummary: userSummary(),\n dropdownMenuButton: dropdownMenuButton(),\n dropdownContentButton: dropdownContentButton(),\n button: button({ enableNew }),\n dropdownContent: dropdownContent(),\n accountImage: accountImage(),\n placeholderImage: placeholderImage(),\n }\n }, [enableNew])\n\n const currentTenantName = useMemo(\n () => tenants?.find((tenant) => tenant.id === currentTenantId)?.name,\n [tenants, currentTenantId],\n )\n\n if (enableNew) {\n return (\n <DropdownMenuButton\n className={classNames.dropdownMenuButton}\n trigger={\n <DropdownMenuLabel\n firstName={firstName}\n lastName={lastName}\n email={email}\n accountImageUrl={accountImageUrl}\n currentTenantName={currentTenantName}\n accountImageClassName={classNames.accountImage}\n placeHolderImageClassName={classNames.placeholderImage}\n />\n }\n >\n <UserSummaryStack\n currentTenantName={currentTenantName}\n empCode={empCode}\n firstName={firstName}\n lastName={lastName}\n email={email}\n className={classNames.userSummary}\n />\n <DropdownContentButton href={accountUrl} className={classNames.dropdownContentButton}>\n <Localizer id=\"smarthr-ui/AppHeader/userSettings\" defaultText=\"個人設定\" />\n </DropdownContentButton>\n {desktopAdditionalContent}\n </DropdownMenuButton>\n )\n }\n\n return (\n <Dropdown>\n <DisplayNameDropdownTrigger className={classNames.button}>\n {displayName}\n </DisplayNameDropdownTrigger>\n <DropdownContent className={classNames.dropdownContent}>\n <AccountLink href={accountUrl}>\n <Localizer id=\"smarthr-ui/AppHeader/userSettings\" defaultText=\"個人設定\" />\n </AccountLink>\n {desktopAdditionalContent}\n </DropdownContent>\n </Dropdown>\n )\n}\n\nconst DropdownMenuLabel = memo<\n Pick<Props, 'firstName' | 'lastName' | 'email'> & {\n accountImageUrl?: string\n currentTenantName: ReactNode\n accountImageClassName: string\n placeHolderImageClassName: string\n }\n>(\n ({\n firstName,\n lastName,\n email,\n accountImageUrl,\n currentTenantName,\n accountImageClassName,\n placeHolderImageClassName,\n }) => {\n const body: ReactNode[] = []\n\n if (currentTenantName) {\n body.push(currentTenantName)\n }\n\n if (firstName && lastName) {\n body.push(`${firstName} ${lastName}`)\n } else if (email) {\n body.push(email)\n }\n\n if (body.length === 2) {\n body.splice(1, 0, <br />)\n }\n\n return (\n <Cluster as=\"span\" align=\"flex-start\">\n {accountImageUrl ? (\n // eslint-disable-next-line smarthr/a11y-image-has-alt-attribute, jsx-a11y/alt-text\n <img src={accountImageUrl} className={accountImageClassName} aria-hidden />\n ) : (\n <span className={placeHolderImageClassName}>\n <FaUserIcon color=\"TEXT_GREY\" />\n </span>\n )}\n\n <Text size=\"XS\" leading=\"NORMAL\" className=\"-shr-my-1 shr-text-left\">\n {body}\n </Text>\n </Cluster>\n )\n },\n)\n\nconst UserSummaryStack = memo<\n Pick<Props, 'empCode' | 'firstName' | 'lastName' | 'email'> & {\n currentTenantName: ReactNode\n className: string\n }\n>(({ currentTenantName, empCode, firstName, lastName, email, className }) => (\n <Stack gap={0.5} className={className}>\n <Text size=\"S\" color=\"TEXT_GREY\" weight=\"bold\" leading=\"TIGHT\">\n {currentTenantName}\n </Text>\n\n {empCode || (firstName && lastName) ? (\n <Cluster align=\"center\">\n {empCode && (\n <Text size=\"S\" color=\"TEXT_GREY\" leading=\"TIGHT\">\n {empCode}\n </Text>\n )}\n {firstName && lastName && <Text leading=\"TIGHT\">{`${lastName} ${firstName}`}</Text>}\n </Cluster>\n ) : (\n <Text leading=\"TIGHT\">{email}</Text>\n )}\n </Stack>\n))\n\nconst DropdownContentButton = memo<PropsWithChildren<{ href?: string | null; className: string }>>(\n ({ href, children, className }) =>\n href && (\n <AnchorButton\n href={href}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className={className}\n prefix={<FaGearIcon />}\n >\n {children}\n </AnchorButton>\n ),\n)\n\nconst DisplayNameDropdownTrigger = memo<PropsWithChildren<{ className: string }>>(\n ({ children, className }) => (\n <DropdownTrigger>\n <Button variant=\"text\" className={className} suffix={<FaCaretDownIcon />}>\n {children}\n </Button>\n </DropdownTrigger>\n ),\n)\n\nconst AccountLink = memo<PropsWithChildren<{ href?: string | null }>>(\n ({ href, children }) =>\n href && (\n <CommonButton\n elementAs=\"a\"\n href={href}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n prefix={<FaGearIcon />}\n >\n {children}\n </CommonButton>\n ),\n)\n"],"names":["tv","_jsx","_jsxs"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAcA;AACA,MAAM,kBAAkB,GAAGA,EAAE,CAAC;AAC5B,IAAA,KAAK,EAAE;AACL,QAAA,WAAW,EAAE;YACX,+CAA+C;;YAE/C,uIAAuI;AACxI,SAAA;AACD,QAAA,kBAAkB,EAAE;Y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