@hitachivantara/uikit-react-lab 4.0.2 → 4.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ColorPicker/ColorPicker.js +25 -78
- package/dist/ColorPicker/ColorPicker.js.map +1 -1
- package/dist/ColorPicker/Fields/Fields.js +15 -47
- package/dist/ColorPicker/Fields/Fields.js.map +1 -1
- package/dist/ColorPicker/Fields/index.js +0 -2
- package/dist/ColorPicker/Fields/index.js.map +1 -1
- package/dist/ColorPicker/Fields/styles.js +0 -2
- package/dist/ColorPicker/Fields/styles.js.map +1 -1
- package/dist/ColorPicker/Picker/Picker.js +5 -23
- package/dist/ColorPicker/Picker/Picker.js.map +1 -1
- package/dist/ColorPicker/Picker/index.js +0 -2
- package/dist/ColorPicker/Picker/index.js.map +1 -1
- package/dist/ColorPicker/Picker/styles.js +0 -2
- package/dist/ColorPicker/Picker/styles.js.map +1 -1
- package/dist/ColorPicker/PresetColors/PresetColors.js +2 -24
- package/dist/ColorPicker/PresetColors/PresetColors.js.map +1 -1
- package/dist/ColorPicker/PresetColors/index.js +0 -2
- package/dist/ColorPicker/PresetColors/index.js.map +1 -1
- package/dist/ColorPicker/PresetColors/styles.js +0 -2
- package/dist/ColorPicker/PresetColors/styles.js.map +1 -1
- package/dist/ColorPicker/index.js +0 -2
- package/dist/ColorPicker/index.js.map +1 -1
- package/dist/ColorPicker/styles.js +0 -2
- package/dist/ColorPicker/styles.js.map +1 -1
- package/dist/Drawer/Drawer.js +10 -50
- package/dist/Drawer/Drawer.js.map +1 -1
- package/dist/Drawer/index.js +0 -2
- package/dist/Drawer/index.js.map +1 -1
- package/dist/Drawer/styles.js +0 -3
- package/dist/Drawer/styles.js.map +1 -1
- package/dist/ImageCarousel/ImageCarousel.js +46 -149
- package/dist/ImageCarousel/ImageCarousel.js.map +1 -1
- package/dist/ImageCarousel/index.js +0 -2
- package/dist/ImageCarousel/index.js.map +1 -1
- package/dist/ImageCarousel/styles.js +0 -5
- package/dist/ImageCarousel/styles.js.map +1 -1
- package/dist/InlineEditor/InlineEditor.js +25 -82
- package/dist/InlineEditor/InlineEditor.js.map +1 -1
- package/dist/InlineEditor/index.js +0 -2
- package/dist/InlineEditor/index.js.map +1 -1
- package/dist/InlineEditor/styles.js +0 -14
- package/dist/InlineEditor/styles.js.map +1 -1
- package/dist/NavigationAnchors/NavigationAnchors.js +44 -116
- package/dist/NavigationAnchors/NavigationAnchors.js.map +1 -1
- package/dist/NavigationAnchors/NavigationOption.js +0 -10
- package/dist/NavigationAnchors/NavigationOption.js.map +1 -1
- package/dist/NavigationAnchors/index.js +0 -2
- package/dist/NavigationAnchors/index.js.map +1 -1
- package/dist/NavigationAnchors/styles.js +0 -2
- package/dist/NavigationAnchors/styles.js.map +1 -1
- package/dist/NotificationPanel/EmptyStatePanel/EmptyStatePanel.js +5 -26
- package/dist/NotificationPanel/EmptyStatePanel/EmptyStatePanel.js.map +1 -1
- package/dist/NotificationPanel/EmptyStatePanel/index.js +0 -2
- package/dist/NotificationPanel/EmptyStatePanel/index.js.map +1 -1
- package/dist/NotificationPanel/EmptyStatePanel/styles.js +0 -2
- package/dist/NotificationPanel/EmptyStatePanel/styles.js.map +1 -1
- package/dist/NotificationPanel/Notification/Notification.js +12 -57
- package/dist/NotificationPanel/Notification/Notification.js.map +1 -1
- package/dist/NotificationPanel/Notification/index.js +0 -2
- package/dist/NotificationPanel/Notification/index.js.map +1 -1
- package/dist/NotificationPanel/Notification/styles.js +0 -14
- package/dist/NotificationPanel/Notification/styles.js.map +1 -1
- package/dist/NotificationPanel/NotificationPanel.js +23 -92
- package/dist/NotificationPanel/NotificationPanel.js.map +1 -1
- package/dist/NotificationPanel/NotificationsIndicator/NotificationsIndicator.js +4 -35
- package/dist/NotificationPanel/NotificationsIndicator/NotificationsIndicator.js.map +1 -1
- package/dist/NotificationPanel/NotificationsIndicator/index.js +0 -2
- package/dist/NotificationPanel/NotificationsIndicator/index.js.map +1 -1
- package/dist/NotificationPanel/NotificationsIndicator/styles.js +0 -2
- package/dist/NotificationPanel/NotificationsIndicator/styles.js.map +1 -1
- package/dist/NotificationPanel/index.js +0 -2
- package/dist/NotificationPanel/index.js.map +1 -1
- package/dist/NotificationPanel/styles.js +0 -2
- package/dist/NotificationPanel/styles.js.map +1 -1
- package/dist/StepNavigation/DefaultNavigation/DefaultNavigation.js +15 -44
- package/dist/StepNavigation/DefaultNavigation/DefaultNavigation.js.map +1 -1
- package/dist/StepNavigation/DefaultNavigation/Step/Step.js +9 -41
- package/dist/StepNavigation/DefaultNavigation/Step/Step.js.map +1 -1
- package/dist/StepNavigation/DefaultNavigation/Step/index.js +0 -2
- package/dist/StepNavigation/DefaultNavigation/Step/index.js.map +1 -1
- package/dist/StepNavigation/DefaultNavigation/Step/styles.js +0 -2
- package/dist/StepNavigation/DefaultNavigation/Step/styles.js.map +1 -1
- package/dist/StepNavigation/DefaultNavigation/index.js +0 -2
- package/dist/StepNavigation/DefaultNavigation/index.js.map +1 -1
- package/dist/StepNavigation/DefaultNavigation/styles.js +0 -2
- package/dist/StepNavigation/DefaultNavigation/styles.js.map +1 -1
- package/dist/StepNavigation/DefaultNavigation/utils.js +0 -3
- package/dist/StepNavigation/DefaultNavigation/utils.js.map +1 -1
- package/dist/StepNavigation/SimpleNavigation/Dot/Dot.js +6 -47
- package/dist/StepNavigation/SimpleNavigation/Dot/Dot.js.map +1 -1
- package/dist/StepNavigation/SimpleNavigation/Dot/index.js +0 -2
- package/dist/StepNavigation/SimpleNavigation/Dot/index.js.map +1 -1
- package/dist/StepNavigation/SimpleNavigation/Dot/styles.js.map +1 -1
- package/dist/StepNavigation/SimpleNavigation/SimpleNavigation.js +14 -44
- package/dist/StepNavigation/SimpleNavigation/SimpleNavigation.js.map +1 -1
- package/dist/StepNavigation/SimpleNavigation/index.js +0 -2
- package/dist/StepNavigation/SimpleNavigation/index.js.map +1 -1
- package/dist/StepNavigation/SimpleNavigation/styles.js +0 -2
- package/dist/StepNavigation/SimpleNavigation/styles.js.map +1 -1
- package/dist/StepNavigation/SimpleNavigation/utils.js +0 -6
- package/dist/StepNavigation/SimpleNavigation/utils.js.map +1 -1
- package/dist/StepNavigation/StepNavigation.js +39 -106
- package/dist/StepNavigation/StepNavigation.js.map +1 -1
- package/dist/StepNavigation/index.js +0 -2
- package/dist/StepNavigation/index.js.map +1 -1
- package/dist/StepNavigation/styles.js +0 -2
- package/dist/StepNavigation/styles.js.map +1 -1
- package/dist/StepNavigation/utils.js.map +1 -1
- package/dist/TimeAgo/TimeAgo.js +13 -44
- package/dist/TimeAgo/TimeAgo.js.map +1 -1
- package/dist/TimeAgo/formatUtils.js +15 -35
- package/dist/TimeAgo/formatUtils.js.map +1 -1
- package/dist/TimeAgo/index.js +0 -3
- package/dist/TimeAgo/index.js.map +1 -1
- package/dist/TimeAgo/styles.js.map +1 -1
- package/dist/TimeAgo/useTimeAgo.js +7 -16
- package/dist/TimeAgo/useTimeAgo.js.map +1 -1
- package/dist/TimeAgo/useTimeout.js +0 -2
- package/dist/TimeAgo/useTimeout.js.map +1 -1
- package/dist/Wizard/Wizard.d.ts +5 -5
- package/dist/Wizard/Wizard.js +33 -85
- package/dist/Wizard/Wizard.js.map +1 -1
- package/dist/Wizard/WizardActions/WizardActions.d.ts +2 -2
- package/dist/Wizard/WizardActions/WizardActions.js +31 -86
- package/dist/Wizard/WizardActions/WizardActions.js.map +1 -1
- package/dist/Wizard/WizardActions/index.js +0 -2
- package/dist/Wizard/WizardActions/index.js.map +1 -1
- package/dist/Wizard/WizardActions/styles.js +0 -2
- package/dist/Wizard/WizardActions/styles.js.map +1 -1
- package/dist/Wizard/WizardContainer/WizardContainer.js +5 -35
- package/dist/Wizard/WizardContainer/WizardContainer.js.map +1 -1
- package/dist/Wizard/WizardContainer/index.js +0 -2
- package/dist/Wizard/WizardContainer/index.js.map +1 -1
- package/dist/Wizard/WizardContainer/styles.js +0 -2
- package/dist/Wizard/WizardContainer/styles.js.map +1 -1
- package/dist/Wizard/WizardContent/LoadingContainer.js +2 -25
- package/dist/Wizard/WizardContent/LoadingContainer.js.map +1 -1
- package/dist/Wizard/WizardContent/WizardContent.d.ts +1 -1
- package/dist/Wizard/WizardContent/WizardContent.js +12 -55
- package/dist/Wizard/WizardContent/WizardContent.js.map +1 -1
- package/dist/Wizard/WizardContent/index.js +0 -2
- package/dist/Wizard/WizardContent/index.js.map +1 -1
- package/dist/Wizard/WizardContent/styles.js +0 -2
- package/dist/Wizard/WizardContent/styles.js.map +1 -1
- package/dist/Wizard/WizardContext/WizardContext.d.ts +12 -0
- package/dist/Wizard/WizardContext/WizardContext.js +0 -4
- package/dist/Wizard/WizardContext/WizardContext.js.map +1 -1
- package/dist/Wizard/WizardContext/WizardContextProvider.d.ts +28 -0
- package/dist/Wizard/WizardContext/WizardContextProvider.js +41 -0
- package/dist/Wizard/WizardContext/WizardContextProvider.js.map +1 -0
- package/dist/Wizard/WizardContext/index.d.ts +5 -0
- package/dist/Wizard/WizardContext/index.js +7 -2
- package/dist/Wizard/WizardContext/index.js.map +1 -1
- package/dist/Wizard/WizardTitle/WizardTitle.d.ts +7 -9
- package/dist/Wizard/WizardTitle/WizardTitle.js +18 -59
- package/dist/Wizard/WizardTitle/WizardTitle.js.map +1 -1
- package/dist/Wizard/WizardTitle/index.js +0 -2
- package/dist/Wizard/WizardTitle/index.js.map +1 -1
- package/dist/Wizard/WizardTitle/styles.js +0 -2
- package/dist/Wizard/WizardTitle/styles.js.map +1 -1
- package/dist/Wizard/index.d.ts +15 -0
- package/dist/Wizard/index.js +7 -7
- package/dist/Wizard/index.js.map +1 -1
- package/dist/Wizard/styles.js +0 -2
- package/dist/Wizard/styles.js.map +1 -1
- package/dist/index.js +12 -23
- package/dist/index.js.map +1 -1
- package/dist/legacy/ColorPicker/ColorPicker.js +26 -51
- package/dist/legacy/ColorPicker/ColorPicker.js.map +1 -1
- package/dist/legacy/ColorPicker/Fields/Fields.js +17 -27
- package/dist/legacy/ColorPicker/Fields/Fields.js.map +1 -1
- package/dist/legacy/ColorPicker/Fields/index.js.map +1 -1
- package/dist/legacy/ColorPicker/Fields/styles.js.map +1 -1
- package/dist/legacy/ColorPicker/Picker/Picker.js +7 -7
- package/dist/legacy/ColorPicker/Picker/Picker.js.map +1 -1
- package/dist/legacy/ColorPicker/Picker/index.js.map +1 -1
- package/dist/legacy/ColorPicker/Picker/styles.js.map +1 -1
- package/dist/legacy/ColorPicker/PresetColors/PresetColors.js +2 -7
- package/dist/legacy/ColorPicker/PresetColors/PresetColors.js.map +1 -1
- package/dist/legacy/ColorPicker/PresetColors/index.js.map +1 -1
- package/dist/legacy/ColorPicker/PresetColors/styles.js.map +1 -1
- package/dist/legacy/ColorPicker/index.js.map +1 -1
- package/dist/legacy/ColorPicker/styles.js +0 -1
- package/dist/legacy/ColorPicker/styles.js.map +1 -1
- package/dist/legacy/Drawer/Drawer.js +11 -30
- package/dist/legacy/Drawer/Drawer.js.map +1 -1
- package/dist/legacy/Drawer/index.js.map +1 -1
- package/dist/legacy/Drawer/styles.js +0 -2
- package/dist/legacy/Drawer/styles.js.map +1 -1
- package/dist/legacy/ImageCarousel/ImageCarousel.js +46 -120
- package/dist/legacy/ImageCarousel/ImageCarousel.js.map +1 -1
- package/dist/legacy/ImageCarousel/index.js.map +1 -1
- package/dist/legacy/ImageCarousel/styles.js +0 -3
- package/dist/legacy/ImageCarousel/styles.js.map +1 -1
- package/dist/legacy/InlineEditor/InlineEditor.js +26 -55
- package/dist/legacy/InlineEditor/InlineEditor.js.map +1 -1
- package/dist/legacy/InlineEditor/index.js.map +1 -1
- package/dist/legacy/InlineEditor/styles.js +0 -5
- package/dist/legacy/InlineEditor/styles.js.map +1 -1
- package/dist/legacy/NavigationAnchors/NavigationAnchors.js +44 -82
- package/dist/legacy/NavigationAnchors/NavigationAnchors.js.map +1 -1
- package/dist/legacy/NavigationAnchors/NavigationOption.js +0 -5
- package/dist/legacy/NavigationAnchors/NavigationOption.js.map +1 -1
- package/dist/legacy/NavigationAnchors/index.js.map +1 -1
- package/dist/legacy/NavigationAnchors/styles.js +0 -1
- package/dist/legacy/NavigationAnchors/styles.js.map +1 -1
- package/dist/legacy/NotificationPanel/EmptyStatePanel/EmptyStatePanel.js +5 -16
- package/dist/legacy/NotificationPanel/EmptyStatePanel/EmptyStatePanel.js.map +1 -1
- package/dist/legacy/NotificationPanel/EmptyStatePanel/index.js.map +1 -1
- package/dist/legacy/NotificationPanel/EmptyStatePanel/styles.js +0 -1
- package/dist/legacy/NotificationPanel/EmptyStatePanel/styles.js.map +1 -1
- package/dist/legacy/NotificationPanel/Notification/Notification.js +12 -44
- package/dist/legacy/NotificationPanel/Notification/Notification.js.map +1 -1
- package/dist/legacy/NotificationPanel/Notification/index.js.map +1 -1
- package/dist/legacy/NotificationPanel/Notification/styles.js +0 -5
- package/dist/legacy/NotificationPanel/Notification/styles.js.map +1 -1
- package/dist/legacy/NotificationPanel/NotificationPanel.js +23 -61
- package/dist/legacy/NotificationPanel/NotificationPanel.js.map +1 -1
- package/dist/legacy/NotificationPanel/NotificationsIndicator/NotificationsIndicator.js +4 -17
- package/dist/legacy/NotificationPanel/NotificationsIndicator/NotificationsIndicator.js.map +1 -1
- package/dist/legacy/NotificationPanel/NotificationsIndicator/index.js.map +1 -1
- package/dist/legacy/NotificationPanel/NotificationsIndicator/styles.js +0 -1
- package/dist/legacy/NotificationPanel/NotificationsIndicator/styles.js.map +1 -1
- package/dist/legacy/NotificationPanel/index.js.map +1 -1
- package/dist/legacy/NotificationPanel/styles.js +0 -1
- package/dist/legacy/NotificationPanel/styles.js.map +1 -1
- package/dist/legacy/StepNavigation/DefaultNavigation/DefaultNavigation.js +16 -27
- package/dist/legacy/StepNavigation/DefaultNavigation/DefaultNavigation.js.map +1 -1
- package/dist/legacy/StepNavigation/DefaultNavigation/Step/Step.js +10 -29
- package/dist/legacy/StepNavigation/DefaultNavigation/Step/Step.js.map +1 -1
- package/dist/legacy/StepNavigation/DefaultNavigation/Step/index.js.map +1 -1
- package/dist/legacy/StepNavigation/DefaultNavigation/Step/styles.js +0 -1
- package/dist/legacy/StepNavigation/DefaultNavigation/Step/styles.js.map +1 -1
- package/dist/legacy/StepNavigation/DefaultNavigation/index.js.map +1 -1
- package/dist/legacy/StepNavigation/DefaultNavigation/styles.js +0 -1
- package/dist/legacy/StepNavigation/DefaultNavigation/styles.js.map +1 -1
- package/dist/legacy/StepNavigation/DefaultNavigation/utils.js +0 -2
- package/dist/legacy/StepNavigation/DefaultNavigation/utils.js.map +1 -1
- package/dist/legacy/StepNavigation/SimpleNavigation/Dot/Dot.js +7 -21
- package/dist/legacy/StepNavigation/SimpleNavigation/Dot/Dot.js.map +1 -1
- package/dist/legacy/StepNavigation/SimpleNavigation/Dot/index.js.map +1 -1
- package/dist/legacy/StepNavigation/SimpleNavigation/Dot/styles.js.map +1 -1
- package/dist/legacy/StepNavigation/SimpleNavigation/SimpleNavigation.js +15 -26
- package/dist/legacy/StepNavigation/SimpleNavigation/SimpleNavigation.js.map +1 -1
- package/dist/legacy/StepNavigation/SimpleNavigation/index.js.map +1 -1
- package/dist/legacy/StepNavigation/SimpleNavigation/styles.js +0 -1
- package/dist/legacy/StepNavigation/SimpleNavigation/styles.js.map +1 -1
- package/dist/legacy/StepNavigation/SimpleNavigation/utils.js +0 -6
- package/dist/legacy/StepNavigation/SimpleNavigation/utils.js.map +1 -1
- package/dist/legacy/StepNavigation/StepNavigation.js +40 -78
- package/dist/legacy/StepNavigation/StepNavigation.js.map +1 -1
- package/dist/legacy/StepNavigation/index.js.map +1 -1
- package/dist/legacy/StepNavigation/styles.js +0 -1
- package/dist/legacy/StepNavigation/styles.js.map +1 -1
- package/dist/legacy/StepNavigation/utils.js.map +1 -1
- package/dist/legacy/TimeAgo/TimeAgo.js +14 -27
- package/dist/legacy/TimeAgo/TimeAgo.js.map +1 -1
- package/dist/legacy/TimeAgo/formatUtils.js +16 -18
- package/dist/legacy/TimeAgo/formatUtils.js.map +1 -1
- package/dist/legacy/TimeAgo/index.js.map +1 -1
- package/dist/legacy/TimeAgo/styles.js.map +1 -1
- package/dist/legacy/TimeAgo/useTimeAgo.js +8 -11
- package/dist/legacy/TimeAgo/useTimeAgo.js.map +1 -1
- package/dist/legacy/TimeAgo/useTimeout.js.map +1 -1
- package/dist/legacy/Wizard/Wizard.d.ts +5 -5
- package/dist/legacy/Wizard/Wizard.js +33 -59
- package/dist/legacy/Wizard/Wizard.js.map +1 -1
- package/dist/legacy/Wizard/WizardActions/WizardActions.d.ts +2 -2
- package/dist/legacy/Wizard/WizardActions/WizardActions.js +33 -62
- package/dist/legacy/Wizard/WizardActions/WizardActions.js.map +1 -1
- package/dist/legacy/Wizard/WizardActions/index.js.map +1 -1
- package/dist/legacy/Wizard/WizardActions/styles.js +0 -1
- package/dist/legacy/Wizard/WizardActions/styles.js.map +1 -1
- package/dist/legacy/Wizard/WizardContainer/WizardContainer.js +5 -17
- package/dist/legacy/Wizard/WizardContainer/WizardContainer.js.map +1 -1
- package/dist/legacy/Wizard/WizardContainer/index.js.map +1 -1
- package/dist/legacy/Wizard/WizardContainer/styles.js +0 -1
- package/dist/legacy/Wizard/WizardContainer/styles.js.map +1 -1
- package/dist/legacy/Wizard/WizardContent/LoadingContainer.js +2 -8
- package/dist/legacy/Wizard/WizardContent/LoadingContainer.js.map +1 -1
- package/dist/legacy/Wizard/WizardContent/WizardContent.d.ts +1 -1
- package/dist/legacy/Wizard/WizardContent/WizardContent.js +11 -27
- package/dist/legacy/Wizard/WizardContent/WizardContent.js.map +1 -1
- package/dist/legacy/Wizard/WizardContent/index.js.map +1 -1
- package/dist/legacy/Wizard/WizardContent/styles.js +0 -1
- package/dist/legacy/Wizard/WizardContent/styles.js.map +1 -1
- package/dist/legacy/Wizard/WizardContext/WizardContext.d.ts +12 -0
- package/dist/legacy/Wizard/WizardContext/WizardContext.js +0 -2
- package/dist/legacy/Wizard/WizardContext/WizardContext.js.map +1 -1
- package/dist/legacy/Wizard/WizardContext/WizardContextProvider.d.ts +28 -0
- package/dist/legacy/Wizard/WizardContext/WizardContextProvider.js +33 -0
- package/dist/legacy/Wizard/WizardContext/WizardContextProvider.js.map +1 -0
- package/dist/legacy/Wizard/WizardContext/index.d.ts +5 -0
- package/dist/legacy/Wizard/WizardContext/index.js +1 -0
- package/dist/legacy/Wizard/WizardContext/index.js.map +1 -1
- package/dist/legacy/Wizard/WizardTitle/WizardTitle.d.ts +7 -9
- package/dist/legacy/Wizard/WizardTitle/WizardTitle.js +17 -42
- package/dist/legacy/Wizard/WizardTitle/WizardTitle.js.map +1 -1
- package/dist/legacy/Wizard/WizardTitle/index.js.map +1 -1
- package/dist/legacy/Wizard/WizardTitle/styles.js +0 -1
- package/dist/legacy/Wizard/WizardTitle/styles.js.map +1 -1
- package/dist/legacy/Wizard/index.d.ts +15 -0
- package/dist/legacy/Wizard/index.js +1 -0
- package/dist/legacy/Wizard/index.js.map +1 -1
- package/dist/legacy/Wizard/styles.js +0 -1
- package/dist/legacy/Wizard/styles.js.map +1 -1
- package/dist/legacy/index.js +1 -0
- package/dist/legacy/index.js.map +1 -1
- package/dist/modern/ColorPicker/ColorPicker.js +1 -25
- package/dist/modern/ColorPicker/ColorPicker.js.map +1 -1
- package/dist/modern/ColorPicker/Fields/Fields.js +3 -10
- package/dist/modern/ColorPicker/Fields/Fields.js.map +1 -1
- package/dist/modern/ColorPicker/Fields/index.js.map +1 -1
- package/dist/modern/ColorPicker/Fields/styles.js.map +1 -1
- package/dist/modern/ColorPicker/Picker/Picker.js +3 -3
- package/dist/modern/ColorPicker/Picker/Picker.js.map +1 -1
- package/dist/modern/ColorPicker/Picker/index.js.map +1 -1
- package/dist/modern/ColorPicker/Picker/styles.js.map +1 -1
- package/dist/modern/ColorPicker/PresetColors/PresetColors.js +0 -5
- package/dist/modern/ColorPicker/PresetColors/PresetColors.js.map +1 -1
- package/dist/modern/ColorPicker/PresetColors/index.js.map +1 -1
- package/dist/modern/ColorPicker/PresetColors/styles.js.map +1 -1
- package/dist/modern/ColorPicker/index.js.map +1 -1
- package/dist/modern/ColorPicker/styles.js +0 -1
- package/dist/modern/ColorPicker/styles.js.map +1 -1
- package/dist/modern/Drawer/Drawer.js +11 -30
- package/dist/modern/Drawer/Drawer.js.map +1 -1
- package/dist/modern/Drawer/index.js.map +1 -1
- package/dist/modern/Drawer/styles.js +0 -2
- package/dist/modern/Drawer/styles.js.map +1 -1
- package/dist/modern/ImageCarousel/ImageCarousel.js +18 -83
- package/dist/modern/ImageCarousel/ImageCarousel.js.map +1 -1
- package/dist/modern/ImageCarousel/index.js.map +1 -1
- package/dist/modern/ImageCarousel/styles.js +0 -1
- package/dist/modern/ImageCarousel/styles.js.map +1 -1
- package/dist/modern/InlineEditor/InlineEditor.js +16 -43
- package/dist/modern/InlineEditor/InlineEditor.js.map +1 -1
- package/dist/modern/InlineEditor/index.js.map +1 -1
- package/dist/modern/InlineEditor/styles.js +0 -5
- package/dist/modern/InlineEditor/styles.js.map +1 -1
- package/dist/modern/NavigationAnchors/NavigationAnchors.js +40 -74
- package/dist/modern/NavigationAnchors/NavigationAnchors.js.map +1 -1
- package/dist/modern/NavigationAnchors/NavigationOption.js +0 -6
- package/dist/modern/NavigationAnchors/NavigationOption.js.map +1 -1
- package/dist/modern/NavigationAnchors/index.js.map +1 -1
- package/dist/modern/NavigationAnchors/styles.js +0 -1
- package/dist/modern/NavigationAnchors/styles.js.map +1 -1
- package/dist/modern/NotificationPanel/EmptyStatePanel/EmptyStatePanel.js +0 -11
- package/dist/modern/NotificationPanel/EmptyStatePanel/EmptyStatePanel.js.map +1 -1
- package/dist/modern/NotificationPanel/EmptyStatePanel/index.js.map +1 -1
- package/dist/modern/NotificationPanel/EmptyStatePanel/styles.js +0 -1
- package/dist/modern/NotificationPanel/EmptyStatePanel/styles.js.map +1 -1
- package/dist/modern/NotificationPanel/Notification/Notification.js +2 -33
- package/dist/modern/NotificationPanel/Notification/Notification.js.map +1 -1
- package/dist/modern/NotificationPanel/Notification/index.js.map +1 -1
- package/dist/modern/NotificationPanel/Notification/styles.js +0 -5
- package/dist/modern/NotificationPanel/Notification/styles.js.map +1 -1
- package/dist/modern/NotificationPanel/NotificationPanel.js +16 -50
- package/dist/modern/NotificationPanel/NotificationPanel.js.map +1 -1
- package/dist/modern/NotificationPanel/NotificationsIndicator/NotificationsIndicator.js +6 -19
- package/dist/modern/NotificationPanel/NotificationsIndicator/NotificationsIndicator.js.map +1 -1
- package/dist/modern/NotificationPanel/NotificationsIndicator/index.js.map +1 -1
- package/dist/modern/NotificationPanel/NotificationsIndicator/styles.js +0 -1
- package/dist/modern/NotificationPanel/NotificationsIndicator/styles.js.map +1 -1
- package/dist/modern/NotificationPanel/index.js.map +1 -1
- package/dist/modern/NotificationPanel/styles.js +0 -1
- package/dist/modern/NotificationPanel/styles.js.map +1 -1
- package/dist/modern/StepNavigation/DefaultNavigation/DefaultNavigation.js +14 -23
- package/dist/modern/StepNavigation/DefaultNavigation/DefaultNavigation.js.map +1 -1
- package/dist/modern/StepNavigation/DefaultNavigation/Step/Step.js +1 -20
- package/dist/modern/StepNavigation/DefaultNavigation/Step/Step.js.map +1 -1
- package/dist/modern/StepNavigation/DefaultNavigation/Step/index.js.map +1 -1
- package/dist/modern/StepNavigation/DefaultNavigation/Step/styles.js +0 -1
- package/dist/modern/StepNavigation/DefaultNavigation/Step/styles.js.map +1 -1
- package/dist/modern/StepNavigation/DefaultNavigation/index.js.map +1 -1
- package/dist/modern/StepNavigation/DefaultNavigation/styles.js +0 -1
- package/dist/modern/StepNavigation/DefaultNavigation/styles.js.map +1 -1
- package/dist/modern/StepNavigation/DefaultNavigation/utils.js +0 -2
- package/dist/modern/StepNavigation/DefaultNavigation/utils.js.map +1 -1
- package/dist/modern/StepNavigation/SimpleNavigation/Dot/Dot.js +1 -15
- package/dist/modern/StepNavigation/SimpleNavigation/Dot/Dot.js.map +1 -1
- package/dist/modern/StepNavigation/SimpleNavigation/Dot/index.js.map +1 -1
- package/dist/modern/StepNavigation/SimpleNavigation/Dot/styles.js.map +1 -1
- package/dist/modern/StepNavigation/SimpleNavigation/SimpleNavigation.js +14 -23
- package/dist/modern/StepNavigation/SimpleNavigation/SimpleNavigation.js.map +1 -1
- package/dist/modern/StepNavigation/SimpleNavigation/index.js.map +1 -1
- package/dist/modern/StepNavigation/SimpleNavigation/styles.js +0 -1
- package/dist/modern/StepNavigation/SimpleNavigation/styles.js.map +1 -1
- package/dist/modern/StepNavigation/SimpleNavigation/utils.js +0 -6
- package/dist/modern/StepNavigation/SimpleNavigation/utils.js.map +1 -1
- package/dist/modern/StepNavigation/StepNavigation.js +25 -62
- package/dist/modern/StepNavigation/StepNavigation.js.map +1 -1
- package/dist/modern/StepNavigation/index.js.map +1 -1
- package/dist/modern/StepNavigation/styles.js +0 -1
- package/dist/modern/StepNavigation/styles.js.map +1 -1
- package/dist/modern/StepNavigation/utils.js.map +1 -1
- package/dist/modern/TimeAgo/TimeAgo.js +11 -24
- package/dist/modern/TimeAgo/TimeAgo.js.map +1 -1
- package/dist/modern/TimeAgo/formatUtils.js +16 -18
- package/dist/modern/TimeAgo/formatUtils.js.map +1 -1
- package/dist/modern/TimeAgo/index.js.map +1 -1
- package/dist/modern/TimeAgo/styles.js.map +1 -1
- package/dist/modern/TimeAgo/useTimeAgo.js +1 -3
- package/dist/modern/TimeAgo/useTimeAgo.js.map +1 -1
- package/dist/modern/TimeAgo/useTimeout.js.map +1 -1
- package/dist/modern/Wizard/Wizard.d.ts +5 -5
- package/dist/modern/Wizard/Wizard.js +24 -49
- package/dist/modern/Wizard/Wizard.js.map +1 -1
- package/dist/modern/Wizard/WizardActions/WizardActions.d.ts +2 -2
- package/dist/modern/Wizard/WizardActions/WizardActions.js +6 -30
- package/dist/modern/Wizard/WizardActions/WizardActions.js.map +1 -1
- package/dist/modern/Wizard/WizardActions/index.js.map +1 -1
- package/dist/modern/Wizard/WizardActions/styles.js +0 -1
- package/dist/modern/Wizard/WizardActions/styles.js.map +1 -1
- package/dist/modern/Wizard/WizardContainer/WizardContainer.js +7 -19
- package/dist/modern/Wizard/WizardContainer/WizardContainer.js.map +1 -1
- package/dist/modern/Wizard/WizardContainer/index.js.map +1 -1
- package/dist/modern/Wizard/WizardContainer/styles.js +0 -1
- package/dist/modern/Wizard/WizardContainer/styles.js.map +1 -1
- package/dist/modern/Wizard/WizardContent/LoadingContainer.js +4 -10
- package/dist/modern/Wizard/WizardContent/LoadingContainer.js.map +1 -1
- package/dist/modern/Wizard/WizardContent/WizardContent.d.ts +1 -1
- package/dist/modern/Wizard/WizardContent/WizardContent.js +1 -15
- package/dist/modern/Wizard/WizardContent/WizardContent.js.map +1 -1
- package/dist/modern/Wizard/WizardContent/index.js.map +1 -1
- package/dist/modern/Wizard/WizardContent/styles.js +0 -1
- package/dist/modern/Wizard/WizardContent/styles.js.map +1 -1
- package/dist/modern/Wizard/WizardContext/WizardContext.d.ts +12 -0
- package/dist/modern/Wizard/WizardContext/WizardContext.js +0 -2
- package/dist/modern/Wizard/WizardContext/WizardContext.js.map +1 -1
- package/dist/modern/Wizard/WizardContext/WizardContextProvider.d.ts +28 -0
- package/dist/modern/Wizard/WizardContext/WizardContextProvider.js +34 -0
- package/dist/modern/Wizard/WizardContext/WizardContextProvider.js.map +1 -0
- package/dist/modern/Wizard/WizardContext/index.d.ts +5 -0
- package/dist/modern/Wizard/WizardContext/index.js +1 -0
- package/dist/modern/Wizard/WizardContext/index.js.map +1 -1
- package/dist/modern/Wizard/WizardTitle/WizardTitle.d.ts +7 -9
- package/dist/modern/Wizard/WizardTitle/WizardTitle.js +3 -24
- package/dist/modern/Wizard/WizardTitle/WizardTitle.js.map +1 -1
- package/dist/modern/Wizard/WizardTitle/index.js.map +1 -1
- package/dist/modern/Wizard/WizardTitle/styles.js +0 -1
- package/dist/modern/Wizard/WizardTitle/styles.js.map +1 -1
- package/dist/modern/Wizard/index.d.ts +15 -0
- package/dist/modern/Wizard/index.js +1 -0
- package/dist/modern/Wizard/index.js.map +1 -1
- package/dist/modern/Wizard/styles.js +0 -1
- package/dist/modern/Wizard/styles.js.map +1 -1
- package/dist/modern/index.js +1 -0
- package/dist/modern/index.js.map +1 -1
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StepNavigation.js","names":["React","PropTypes","clsx","Typography","styled","useTheme","withStyles","HvTooltip","HvTypography","useWidth","HvDefaultNavigation","HvSimpleNavigation","SEPARATOR_WIDTH","TITLE_MARGIN","TITLE_WIDTH","styles","HvStepNavigation","className","classes","width","steps","stepSize","showTitles","type","others","theme","breakpoint","stepSizeKey","includes","hasTitles","styledLi","containerSize","height","styledDiv","styledSeparatorElement","title","separatorClassName","separatorHeight","separatorWidth","backgroundColor","Separator","separatorElement","separator","drawItems","separatorValues","minWidth","maxWidth","getColor","stepValues","minSize","maxSize","StepComponent","items","reduce","acc","index","state","props","StepContainer","Step","Math","max","stepProps","size","number","stepElement","li","length","ol","getDynamicValues","stepsWidth","Number","next","breakpoints","keys","find","_","self","navWidth","min","values","titleWidth","ceil","styledTitle","titleClassName","variant","stepTitle","textAlign","marginRight","getTitles","getTitleProps","titles","map","rawTitle","Title","StepNavigation","Default","Simple","numSteps","root","itemsProps","margin","propTypes","string","shape","isRequired","oneOf","arrayOf","disabled","bool","xs","sm","md","lg","xl","name"],"sources":["../../../src/StepNavigation/StepNavigation.js"],"sourcesContent":["import React from \"react\";\nimport PropTypes from \"prop-types\";\nimport clsx from \"clsx\";\n\nimport { Typography, styled, useTheme } from \"@mui/material\";\nimport { withStyles } from \"@mui/styles\";\nimport { HvTooltip, HvTypography, useWidth } from \"@hitachivantara/uikit-react-core\";\n\nimport HvDefaultNavigation from \"./DefaultNavigation\";\nimport HvSimpleNavigation from \"./SimpleNavigation\";\nimport { SEPARATOR_WIDTH, TITLE_MARGIN, TITLE_WIDTH } from \"./utils\";\nimport styles from \"./styles\";\n\n/**\n * Navigation page with steps.\n *\n * You need to define the <b>steps<b/> displayed on the component so that itself can be drawn on the UI.\n * On each step, you need to define a <b>state</b> - 'Pending', 'Failed', 'Completed', 'Current', 'Disabled' -\n * and a <b>title</b> to be shown as a tooltip or a text above of the step. You can also:\n * * Define a <b>className</b> on each step element;\n * * Define a <b>separatorClassName</b> to specify a className for the separator element. The default height\n * values of the separator element are 2px/3px on 'Simple'/'Default' layouts respectively;\n * * Define a <b>titleClassName</b> to specify a className for the title above each step element.\n *\n * For the root element, you can:\n * * Define a <b>className</b>;\n * * Choose a <b>type</b> of layout: 'Simple' or 'Default';\n * * Choose the <b>stepSize</b> of the step component: \"XS\", \"SM\", \"MD\", \"LG\", \"XL\". The default size will be\n * correspondent to the current media breakpoint;\n * * Choose either you want to <b>showTitles</b> near to each step component or a tootlip on hover;\n * * Define a <b>width</b> of the component. If you don't define any value and the step component has no title\n * displayed above, the width of the separator element will be 100px.\n * If the step component has titles, each one will have 215px of width by default.\n */\nconst HvStepNavigation = ({\n className,\n classes,\n width,\n steps,\n stepSize,\n showTitles,\n type = \"Default\",\n ...others\n}) => {\n const theme = useTheme();\n // current breakpoint 'xs' | 'sm' | 'md' | 'lg' | 'xl'\n const breakpoint = useWidth();\n // step configurations\n const stepSizeKey = stepSize ?? ([\"xs\", \"sm\"].includes(breakpoint) ? \"SM\" : \"MD\");\n const hasTitles = showTitles ?? ![\"xs\", \"sm\"].includes(breakpoint);\n\n const styledLi = (containerSize) =>\n styled(\"li\")({\n width: containerSize,\n height: containerSize,\n });\n\n const styledDiv = (containerSize) =>\n styled(\"div\")({\n width: containerSize,\n height: containerSize,\n });\n\n const styledSeparatorElement = (\n title,\n separatorClassName,\n separatorHeight,\n separatorWidth,\n backgroundColor\n ) => {\n const Separator = withStyles({\n separatorElement: {\n height: separatorHeight,\n width: separatorWidth,\n backgroundColor,\n },\n })(({ classes: { separatorElement } }) => (\n <div\n aria-label={`separator-${title}`}\n className={clsx(separatorElement, separatorClassName)}\n />\n ));\n return (\n <li aria-hidden key={`separator-${title}`} className={classes.separator}>\n <Separator />\n </li>\n );\n };\n\n const drawItems = ({\n separatorValues: { minWidth, maxWidth, getColor, height },\n stepValues: { minSize, maxSize, StepComponent },\n }) => {\n const items = steps.reduce((acc, { state, title, separatorClassName, ...props }, index) => {\n const containerSize = state === \"Current\" ? maxSize : minSize;\n const StepContainer = styledLi(containerSize);\n const Step = styledDiv(Math.max(containerSize, 30), Math.max(containerSize, 30));\n const stepProps = {\n ...{\n size: stepSizeKey,\n state,\n title,\n number: index + 1,\n ...props,\n },\n };\n const stepElement = (\n <StepContainer key={`step-${title}`} className={classes.li}>\n {hasTitles ? (\n <StepComponent aria-label={`step-${title}`} {...stepProps} />\n ) : (\n <HvTooltip\n placement=\"bottom\"\n title={<HvTypography>{`${index + 1}. ${title}`}</HvTypography>}\n >\n <div aria-label={`step-container-${title}`}>\n <Step className={classes.li}>\n <StepComponent aria-label={`step-${title}`} {...stepProps} />\n </Step>\n </div>\n </HvTooltip>\n )}\n </StepContainer>\n );\n if (index < steps.length - 1) {\n const separatorElement = styledSeparatorElement(\n title,\n separatorClassName,\n height,\n [steps[index + 1].state, state].includes(\"Current\") ? minWidth : maxWidth,\n getColor(steps[index + 1].state === \"Disabled\" ? \"Disabled\" : state, theme)\n );\n return [...acc, stepElement, separatorElement];\n }\n return [...acc, stepElement];\n }, []);\n\n return <ol className={classes.ol}>{items}</ol>;\n };\n\n const getDynamicValues = (stepsWidth) => {\n const maxWidth =\n width?.[breakpoint] ??\n Math.max(\n Number(hasTitles) * (TITLE_WIDTH + TITLE_MARGIN) * steps.length - TITLE_MARGIN,\n SEPARATOR_WIDTH * (steps.length - 1) + stepsWidth\n );\n const next = theme.breakpoints.keys.find((_, index, self) =>\n index - 1 >= 0 ? self[index - 1] === breakpoint : false\n );\n const navWidth = Math.min(maxWidth, theme.breakpoints.values?.[next] ?? maxWidth);\n const titleWidth = Number(hasTitles) * Math.ceil((navWidth + TITLE_MARGIN) / steps.length);\n const separatorWidth =\n Number(!hasTitles) * Math.ceil((navWidth - stepsWidth) / (steps.length - 1));\n return { width: navWidth, titleWidth, separatorWidth };\n };\n\n const styledTitle = (titleClassName, variant, title, titleWidth) =>\n withStyles({\n stepTitle: {\n textAlign: \"center\",\n width: titleWidth - TITLE_MARGIN,\n marginRight: TITLE_MARGIN,\n },\n })(({ classes: { stepTitle } }) =>\n title ? (\n <HvTypography variant={variant} className={clsx(stepTitle, titleClassName)}>\n {title}\n </HvTypography>\n ) : null\n );\n\n const getTitles = (getTitleProps) =>\n hasTitles ? (\n <div className={classes.titles}>\n {steps.map(({ title: rawTitle, state, titleClassName }, index) => {\n const {\n variant = \"highlightText\",\n title = rawTitle,\n titleWidth = 0,\n } = getTitleProps({\n state,\n rawTitle,\n number: index + 1,\n });\n const Title = styledTitle(titleClassName, variant, title, titleWidth);\n return <Title key={`step-title-${rawTitle}`} />;\n })}\n </div>\n ) : null;\n\n const StepNavigation = {\n Default: HvDefaultNavigation,\n Simple: HvSimpleNavigation,\n }[type];\n\n return (\n <StepNavigation\n {...{\n stepSize: stepSizeKey,\n numSteps: steps.length,\n getTitles,\n getDynamicValues,\n className: clsx(className, classes.root),\n ...others,\n }}\n >\n {({ stepsWidth, navWidth, ...itemsProps }) => (\n <Typography\n component=\"nav\"\n style={{\n width: `${navWidth}px`,\n margin: 0,\n }}\n >\n {drawItems(itemsProps)}\n </Typography>\n )}\n </StepNavigation>\n );\n};\n\nHvStepNavigation.propTypes = {\n /**\n * Class names to be applied.\n */\n className: PropTypes.string,\n /**\n * A Jss Object used to override or extend the styles applied.\n */\n classes: PropTypes.shape({\n /**\n * Styles applied to the component root class.\n */\n root: PropTypes.string,\n /**\n * Styles applied to the li element.\n */\n li: PropTypes.string,\n /**\n * Styles applied to the ol element.\n */\n ol: PropTypes.string,\n /**\n * Styles applied to the separator element.\n */\n separator: PropTypes.string,\n /**\n * Styles applied to the titles container element.\n */\n titles: PropTypes.string,\n }).isRequired,\n /**\n * Type of step navigation. Values = {\"Simple\", \"Default\"}.\n */\n type: PropTypes.oneOf([\"Simple\", \"Default\"]),\n /**\n * Steps to show on the component.\n */\n steps: PropTypes.arrayOf(\n PropTypes.shape({\n /**\n * Class names to override styles on the step component.\n */\n className: PropTypes.string,\n /**\n * Class names to override styles on the separator component after the step.\n */\n separatorClassName: PropTypes.string,\n /**\n * Class names to override styles on the title component above the step.\n */\n titleClassName: PropTypes.string,\n /**\n * Title of the step.\n */\n title: PropTypes.string.isRequired,\n /**\n * State of the step. Values = {\"Pending\", \"Failed\", \"Completed\", \"Current\", \"Disabled\", \"Enabled\"}.\n */\n state: PropTypes.oneOf([\"Pending\", \"Failed\", \"Completed\", \"Current\", \"Disabled\", \"Enabled\"])\n .isRequired,\n /**\n * Define if a step is disabled/enabled.\n * If this property is not defined and the step is on state \"Disabled\", the step component will be disabled\n */\n disabled: PropTypes.bool,\n })\n ).isRequired,\n /**\n * Sets one of the standard sizes of the steps. Values = {\"XS\", \"SM\", \"MD\", \"LG\", \"XL\"}\n */\n stepSize: PropTypes.oneOf([\"XS\", \"SM\", \"MD\", \"LG\", \"XL\"]),\n /**\n * Width of the component element on each breakpoint screen resolution.\n */\n width: PropTypes.shape({\n xs: PropTypes.number,\n sm: PropTypes.number,\n md: PropTypes.number,\n lg: PropTypes.number,\n xl: PropTypes.number,\n }),\n /**\n * Defines either show a title or only a tooltip on each step component\n */\n showTitles: PropTypes.bool,\n};\n\nexport default withStyles(styles, { name: \"HvStepNavigation\" })(HvStepNavigation);\n"],"mappings":";;;;;;;;;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,IAAP,MAAiB,MAAjB;AAEA,SAASC,UAAT,EAAqBC,MAArB,EAA6BC,QAA7B,QAA6C,eAA7C;AACA,SAASC,UAAT,QAA2B,aAA3B;AACA,SAASC,SAAT,EAAoBC,YAApB,EAAkCC,QAAlC,QAAkD,kCAAlD;AAEA,OAAOC,mBAAP,MAAgC,qBAAhC;AACA,OAAOC,kBAAP,MAA+B,oBAA/B;AACA,SAASC,eAAT,EAA0BC,YAA1B,EAAwCC,WAAxC,QAA2D,SAA3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AACA;IACMpE,KAAK,EAAElC,SAAS,CAACsG,MAAV,CAAiBE,UAhBV;;IAiBd;AACN;AACA;IACMjD,KAAK,EAAEvD,SAAS,CAACyG,KAAV,CAAgB,CAAC,SAAD,EAAY,QAAZ,EAAsB,WAAtB,EAAmC,SAAnC,EAA8C,UAA9C,EAA0D,SAA1D,CAAhB,EACJD,UArBW;;IAsBd;AACN;AACA;AACA;IACMG,QAAQ,EAAE3G,SAAS,CAAC4G;EA1BN,CAAhB,CADK,EA6BLJ,UAlEyB;;EAmE3B;AACF;AACA;EACEpF,QAAQ,EAAEpB,SAAS,CAACyG,KAAV,CAAgB,CAAC,IAAD,EAAO,IAAP,EAAa,IAAb,EAAmB,IAAnB,EAAyB,IAAzB,CAAhB,CAtEiB;;EAuE3B;AACF;AACA;EACEvF,KAAK,EAAElB,SAAS,CAACuG,KAAV,CAAgB;IACrBM,EAAE,EAAE7G,SAAS,CAAC+D,MADO;IAErB+C,EAAE,EAAE9G,SAAS,CAAC+D,MAFO;IAGrBgD,EAAE,EAAE/G,SAAS,CAAC+D,MAHO;IAIrBiD,EAAE,EAAEhH,SAAS,CAAC+D,MAJO;IAKrBkD,EAAE,EAAEjH,SAAS,CAAC+D;EALO,CAAhB,CA1EoB;;EAiF3B;AACF;AACA;EACE1C,UAAU,EAAErB,SAAS,CAAC4G;AApFK,CAA7B;AAuFA,eAAevG,UAAU,CAACS,MAAD,EAAS;EAAEoG,IAAI,EAAE;AAAR,CAAT,CAAV,CAAiDnG,gBAAjD,CAAf"}
|
|
1
|
+
{"version":3,"file":"StepNavigation.js","names":["React","PropTypes","clsx","Typography","styled","useTheme","withStyles","HvTooltip","HvTypography","useWidth","HvDefaultNavigation","HvSimpleNavigation","SEPARATOR_WIDTH","TITLE_MARGIN","TITLE_WIDTH","styles","HvStepNavigation","className","classes","width","steps","stepSize","showTitles","type","others","theme","breakpoint","stepSizeKey","includes","hasTitles","styledLi","containerSize","height","styledDiv","styledSeparatorElement","title","separatorClassName","separatorHeight","separatorWidth","backgroundColor","Separator","separatorElement","separator","drawItems","separatorValues","minWidth","maxWidth","getColor","stepValues","minSize","maxSize","StepComponent","items","reduce","acc","index","state","props","StepContainer","Step","Math","max","stepProps","size","number","stepElement","li","length","ol","getDynamicValues","stepsWidth","Number","next","breakpoints","keys","find","_","self","navWidth","min","values","titleWidth","ceil","styledTitle","titleClassName","variant","stepTitle","textAlign","marginRight","getTitles","getTitleProps","titles","map","rawTitle","Title","StepNavigation","Default","Simple","numSteps","root","itemsProps","margin","propTypes","string","shape","isRequired","oneOf","arrayOf","disabled","bool","xs","sm","md","lg","xl","name"],"sources":["../../../src/StepNavigation/StepNavigation.js"],"sourcesContent":["import React from \"react\";\nimport PropTypes from \"prop-types\";\nimport clsx from \"clsx\";\n\nimport { Typography, styled, useTheme } from \"@mui/material\";\nimport { withStyles } from \"@mui/styles\";\nimport { HvTooltip, HvTypography, useWidth } from \"@hitachivantara/uikit-react-core\";\n\nimport HvDefaultNavigation from \"./DefaultNavigation\";\nimport HvSimpleNavigation from \"./SimpleNavigation\";\nimport { SEPARATOR_WIDTH, TITLE_MARGIN, TITLE_WIDTH } from \"./utils\";\nimport styles from \"./styles\";\n\n/**\n * Navigation page with steps.\n *\n * You need to define the <b>steps<b/> displayed on the component so that itself can be drawn on the UI.\n * On each step, you need to define a <b>state</b> - 'Pending', 'Failed', 'Completed', 'Current', 'Disabled' -\n * and a <b>title</b> to be shown as a tooltip or a text above of the step. You can also:\n * * Define a <b>className</b> on each step element;\n * * Define a <b>separatorClassName</b> to specify a className for the separator element. The default height\n * values of the separator element are 2px/3px on 'Simple'/'Default' layouts respectively;\n * * Define a <b>titleClassName</b> to specify a className for the title above each step element.\n *\n * For the root element, you can:\n * * Define a <b>className</b>;\n * * Choose a <b>type</b> of layout: 'Simple' or 'Default';\n * * Choose the <b>stepSize</b> of the step component: \"XS\", \"SM\", \"MD\", \"LG\", \"XL\". The default size will be\n * correspondent to the current media breakpoint;\n * * Choose either you want to <b>showTitles</b> near to each step component or a tootlip on hover;\n * * Define a <b>width</b> of the component. If you don't define any value and the step component has no title\n * displayed above, the width of the separator element will be 100px.\n * If the step component has titles, each one will have 215px of width by default.\n */\nconst HvStepNavigation = ({\n className,\n classes,\n width,\n steps,\n stepSize,\n showTitles,\n type = \"Default\",\n ...others\n}) => {\n const theme = useTheme();\n // current breakpoint 'xs' | 'sm' | 'md' | 'lg' | 'xl'\n const breakpoint = useWidth();\n // step configurations\n const stepSizeKey = stepSize ?? ([\"xs\", \"sm\"].includes(breakpoint) ? \"SM\" : \"MD\");\n const hasTitles = showTitles ?? ![\"xs\", \"sm\"].includes(breakpoint);\n\n const styledLi = (containerSize) =>\n styled(\"li\")({\n width: containerSize,\n height: containerSize,\n });\n\n const styledDiv = (containerSize) =>\n styled(\"div\")({\n width: containerSize,\n height: containerSize,\n });\n\n const styledSeparatorElement = (\n title,\n separatorClassName,\n separatorHeight,\n separatorWidth,\n backgroundColor\n ) => {\n const Separator = withStyles({\n separatorElement: {\n height: separatorHeight,\n width: separatorWidth,\n backgroundColor,\n },\n })(({ classes: { separatorElement } }) => (\n <div\n aria-label={`separator-${title}`}\n className={clsx(separatorElement, separatorClassName)}\n />\n ));\n return (\n <li aria-hidden key={`separator-${title}`} className={classes.separator}>\n <Separator />\n </li>\n );\n };\n\n const drawItems = ({\n separatorValues: { minWidth, maxWidth, getColor, height },\n stepValues: { minSize, maxSize, StepComponent },\n }) => {\n const items = steps.reduce((acc, { state, title, separatorClassName, ...props }, index) => {\n const containerSize = state === \"Current\" ? maxSize : minSize;\n const StepContainer = styledLi(containerSize);\n const Step = styledDiv(Math.max(containerSize, 30), Math.max(containerSize, 30));\n const stepProps = {\n ...{\n size: stepSizeKey,\n state,\n title,\n number: index + 1,\n ...props,\n },\n };\n const stepElement = (\n <StepContainer key={`step-${title}`} className={classes.li}>\n {hasTitles ? (\n <StepComponent aria-label={`step-${title}`} {...stepProps} />\n ) : (\n <HvTooltip\n placement=\"bottom\"\n title={<HvTypography>{`${index + 1}. ${title}`}</HvTypography>}\n >\n <div aria-label={`step-container-${title}`}>\n <Step className={classes.li}>\n <StepComponent aria-label={`step-${title}`} {...stepProps} />\n </Step>\n </div>\n </HvTooltip>\n )}\n </StepContainer>\n );\n if (index < steps.length - 1) {\n const separatorElement = styledSeparatorElement(\n title,\n separatorClassName,\n height,\n [steps[index + 1].state, state].includes(\"Current\") ? minWidth : maxWidth,\n getColor(steps[index + 1].state === \"Disabled\" ? \"Disabled\" : state, theme)\n );\n return [...acc, stepElement, separatorElement];\n }\n return [...acc, stepElement];\n }, []);\n\n return <ol className={classes.ol}>{items}</ol>;\n };\n\n const getDynamicValues = (stepsWidth) => {\n const maxWidth =\n width?.[breakpoint] ??\n Math.max(\n Number(hasTitles) * (TITLE_WIDTH + TITLE_MARGIN) * steps.length - TITLE_MARGIN,\n SEPARATOR_WIDTH * (steps.length - 1) + stepsWidth\n );\n const next = theme.breakpoints.keys.find((_, index, self) =>\n index - 1 >= 0 ? self[index - 1] === breakpoint : false\n );\n const navWidth = Math.min(maxWidth, theme.breakpoints.values?.[next] ?? maxWidth);\n const titleWidth = Number(hasTitles) * Math.ceil((navWidth + TITLE_MARGIN) / steps.length);\n const separatorWidth =\n Number(!hasTitles) * Math.ceil((navWidth - stepsWidth) / (steps.length - 1));\n return { width: navWidth, titleWidth, separatorWidth };\n };\n\n const styledTitle = (titleClassName, variant, title, titleWidth) =>\n withStyles({\n stepTitle: {\n textAlign: \"center\",\n width: titleWidth - TITLE_MARGIN,\n marginRight: TITLE_MARGIN,\n },\n })(({ classes: { stepTitle } }) =>\n title ? (\n <HvTypography variant={variant} className={clsx(stepTitle, titleClassName)}>\n {title}\n </HvTypography>\n ) : null\n );\n\n const getTitles = (getTitleProps) =>\n hasTitles ? (\n <div className={classes.titles}>\n {steps.map(({ title: rawTitle, state, titleClassName }, index) => {\n const {\n variant = \"highlightText\",\n title = rawTitle,\n titleWidth = 0,\n } = getTitleProps({\n state,\n rawTitle,\n number: index + 1,\n });\n const Title = styledTitle(titleClassName, variant, title, titleWidth);\n return <Title key={`step-title-${rawTitle}`} />;\n })}\n </div>\n ) : null;\n\n const StepNavigation = {\n Default: HvDefaultNavigation,\n Simple: HvSimpleNavigation,\n }[type];\n\n return (\n <StepNavigation\n {...{\n stepSize: stepSizeKey,\n numSteps: steps.length,\n getTitles,\n getDynamicValues,\n className: clsx(className, classes.root),\n ...others,\n }}\n >\n {({ stepsWidth, navWidth, ...itemsProps }) => (\n <Typography\n component=\"nav\"\n style={{\n width: `${navWidth}px`,\n margin: 0,\n }}\n >\n {drawItems(itemsProps)}\n </Typography>\n )}\n </StepNavigation>\n );\n};\n\nHvStepNavigation.propTypes = {\n /**\n * Class names to be applied.\n */\n className: PropTypes.string,\n /**\n * A Jss Object used to override or extend the styles applied.\n */\n classes: PropTypes.shape({\n /**\n * Styles applied to the component root class.\n */\n root: PropTypes.string,\n /**\n * Styles applied to the li element.\n */\n li: PropTypes.string,\n /**\n * Styles applied to the ol element.\n */\n ol: PropTypes.string,\n /**\n * Styles applied to the separator element.\n */\n separator: PropTypes.string,\n /**\n * Styles applied to the titles container element.\n */\n titles: PropTypes.string,\n }).isRequired,\n /**\n * Type of step navigation. Values = {\"Simple\", \"Default\"}.\n */\n type: PropTypes.oneOf([\"Simple\", \"Default\"]),\n /**\n * Steps to show on the component.\n */\n steps: PropTypes.arrayOf(\n PropTypes.shape({\n /**\n * Class names to override styles on the step component.\n */\n className: PropTypes.string,\n /**\n * Class names to override styles on the separator component after the step.\n */\n separatorClassName: PropTypes.string,\n /**\n * Class names to override styles on the title component above the step.\n */\n titleClassName: PropTypes.string,\n /**\n * Title of the step.\n */\n title: PropTypes.string.isRequired,\n /**\n * State of the step. Values = {\"Pending\", \"Failed\", \"Completed\", \"Current\", \"Disabled\", \"Enabled\"}.\n */\n state: PropTypes.oneOf([\"Pending\", \"Failed\", \"Completed\", \"Current\", \"Disabled\", \"Enabled\"])\n .isRequired,\n /**\n * Define if a step is disabled/enabled.\n * If this property is not defined and the step is on state \"Disabled\", the step component will be disabled\n */\n disabled: PropTypes.bool,\n })\n ).isRequired,\n /**\n * Sets one of the standard sizes of the steps. Values = {\"XS\", \"SM\", \"MD\", \"LG\", \"XL\"}\n */\n stepSize: PropTypes.oneOf([\"XS\", \"SM\", \"MD\", \"LG\", \"XL\"]),\n /**\n * Width of the component element on each breakpoint screen resolution.\n */\n width: PropTypes.shape({\n xs: PropTypes.number,\n sm: PropTypes.number,\n md: PropTypes.number,\n lg: PropTypes.number,\n xl: PropTypes.number,\n }),\n /**\n * Defines either show a title or only a tooltip on each step component\n */\n showTitles: PropTypes.bool,\n};\n\nexport default withStyles(styles, { name: \"HvStepNavigation\" })(HvStepNavigation);\n"],"mappings":";;;;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,IAAI,MAAM,MAAM;AAEvB,SAASC,UAAU,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,eAAe;AAC5D,SAASC,UAAU,QAAQ,aAAa;AACxC,SAASC,SAAS,EAAEC,YAAY,EAAEC,QAAQ,QAAQ,kCAAkC;AAEpF,OAAOC,mBAAmB,MAAM,qBAAqB;AACrD,OAAOC,kBAAkB,MAAM,oBAAoB;AACnD,SAASC,eAAe,EAAEC,YAAY,EAAEC,WAAW,QAAQ,SAAS;AACpE,OAAOC,MAAM,MAAM,UAAU;;AAE7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AApBA;AAqBA,MAAMC,gBAAgB,GAAG,QASnB;EAAA,IAToB;MACxBC,SAAS;MACTC,OAAO;MACPC,KAAK;MACLC,KAAK;MACLC,QAAQ;MACRC,UAAU;MACVC,IAAI,GAAG;IAET,CAAC;IADIC,MAAM;EAET,MAAMC,KAAK,GAAGpB,QAAQ,EAAE;EACxB;EACA,MAAMqB,UAAU,GAAGjB,QAAQ,EAAE;EAC7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AM;IACpBiD,EAAE,EAAEhH,SAAS,CAAC+D,MAAM;IACpBkD,EAAE,EAAEjH,SAAS,CAAC+D;EAChB,CAAC,CAAC;EACF;AACF;AACA;EACE1C,UAAU,EAAErB,SAAS,CAAC4G;AACxB,CAAC;AAED,eAAevG,UAAU,CAACS,MAAM,EAAE;EAAEoG,IAAI,EAAE;AAAmB,CAAC,CAAC,CAACnG,gBAAgB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["default"],"sources":["../../../src/StepNavigation/index.js"],"sourcesContent":["export { default } from \"./StepNavigation\";\n"],"mappings":"AAAA,SAASA,
|
|
1
|
+
{"version":3,"file":"index.js","names":["default"],"sources":["../../../src/StepNavigation/index.js"],"sourcesContent":["export { default } from \"./StepNavigation\";\n"],"mappings":"AAAA,SAASA,OAAO,QAAQ,kBAAkB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","names":["styles","root","display","flexDirection","titles","ol","alignItems","justifyContent","flexWrap","padding","listStyle","li","separator","userSelect"],"sources":["../../../src/StepNavigation/styles.js"],"sourcesContent":["const styles = () => ({\n root: {\n display: \"flex\",\n flexDirection: \"column\",\n },\n titles: {\n display: \"flex\",\n },\n ol: {\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n flexWrap: \"wrap\",\n padding: 0,\n listStyle: \"none\",\n },\n li: {\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n },\n separator: {\n userSelect: \"none\",\n \"& > div\": {\n display: \"flex\",\n },\n },\n});\n\nexport default styles;\n"],"mappings":"AAAA,MAAMA,MAAM,GAAG,OAAO;EACpBC,IAAI,EAAE;IACJC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"styles.js","names":["styles","root","display","flexDirection","titles","ol","alignItems","justifyContent","flexWrap","padding","listStyle","li","separator","userSelect"],"sources":["../../../src/StepNavigation/styles.js"],"sourcesContent":["const styles = () => ({\n root: {\n display: \"flex\",\n flexDirection: \"column\",\n },\n titles: {\n display: \"flex\",\n },\n ol: {\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n flexWrap: \"wrap\",\n padding: 0,\n listStyle: \"none\",\n },\n li: {\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n },\n separator: {\n userSelect: \"none\",\n \"& > div\": {\n display: \"flex\",\n },\n },\n});\n\nexport default styles;\n"],"mappings":"AAAA,MAAMA,MAAM,GAAG,OAAO;EACpBC,IAAI,EAAE;IACJC,OAAO,EAAE,MAAM;IACfC,aAAa,EAAE;EACjB,CAAC;EACDC,MAAM,EAAE;IACNF,OAAO,EAAE;EACX,CAAC;EACDG,EAAE,EAAE;IACFH,OAAO,EAAE,MAAM;IACfI,UAAU,EAAE,QAAQ;IACpBC,cAAc,EAAE,QAAQ;IACxBC,QAAQ,EAAE,MAAM;IAChBC,OAAO,EAAE,CAAC;IACVC,SAAS,EAAE;EACb,CAAC;EACDC,EAAE,EAAE;IACFT,OAAO,EAAE,MAAM;IACfI,UAAU,EAAE,QAAQ;IACpBC,cAAc,EAAE;EAClB,CAAC;EACDK,SAAS,EAAE;IACTC,UAAU,EAAE,MAAM;IAClB,SAAS,EAAE;MACTX,OAAO,EAAE;IACX;EACF;AACF,CAAC,CAAC;AAEF,eAAeF,MAAM"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","names":["TITLE_MARGIN","TITLE_WIDTH","STEP_MARGIN","SEPARATOR_WIDTH"],"sources":["../../../src/StepNavigation/utils.js"],"sourcesContent":["const TITLE_MARGIN = 20;\nconst TITLE_WIDTH = 215;\nconst STEP_MARGIN = 20;\nconst SEPARATOR_WIDTH = 100;\n\nexport { STEP_MARGIN, TITLE_MARGIN, TITLE_WIDTH, SEPARATOR_WIDTH };\n"],"mappings":"AAAA,MAAMA,YAAY,GAAG,
|
|
1
|
+
{"version":3,"file":"utils.js","names":["TITLE_MARGIN","TITLE_WIDTH","STEP_MARGIN","SEPARATOR_WIDTH"],"sources":["../../../src/StepNavigation/utils.js"],"sourcesContent":["const TITLE_MARGIN = 20;\nconst TITLE_WIDTH = 215;\nconst STEP_MARGIN = 20;\nconst SEPARATOR_WIDTH = 100;\n\nexport { STEP_MARGIN, TITLE_MARGIN, TITLE_WIDTH, SEPARATOR_WIDTH };\n"],"mappings":"AAAA,MAAMA,YAAY,GAAG,EAAE;AACvB,MAAMC,WAAW,GAAG,GAAG;AACvB,MAAMC,WAAW,GAAG,EAAE;AACtB,MAAMC,eAAe,GAAG,GAAG;AAE3B,SAASD,WAAW,EAAEF,YAAY,EAAEC,WAAW,EAAEE,eAAe"}
|
|
@@ -1,36 +1,31 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
3
|
const _excluded = ["classes", "timestamp", "locale", "component", "emptyElement", "disableRefresh", "showSeconds", "justText"];
|
|
4
|
-
|
|
5
4
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
6
|
-
|
|
7
5
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
8
|
-
|
|
9
6
|
import React from "react";
|
|
10
7
|
import PropTypes from "prop-types";
|
|
11
8
|
import { withStyles } from "@mui/styles";
|
|
12
9
|
import { HvTypography, useLocale } from "@hitachivantara/uikit-react-core";
|
|
13
10
|
import useTimeAgo from "./useTimeAgo";
|
|
14
11
|
import styles from "./styles";
|
|
12
|
+
|
|
15
13
|
/**
|
|
16
14
|
* The HvTimeAgo component implements the Design System relative time format guidelines.
|
|
17
15
|
*/
|
|
18
|
-
|
|
19
16
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
20
|
-
|
|
21
17
|
const HvTimeAgo = _ref => {
|
|
22
18
|
let {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
19
|
+
classes,
|
|
20
|
+
timestamp,
|
|
21
|
+
locale: localeProp,
|
|
22
|
+
component: Component = HvTypography,
|
|
23
|
+
emptyElement = "—",
|
|
24
|
+
disableRefresh = false,
|
|
25
|
+
showSeconds = false,
|
|
26
|
+
justText = false
|
|
27
|
+
} = _ref,
|
|
28
|
+
others = _objectWithoutProperties(_ref, _excluded);
|
|
34
29
|
const contextLocale = useLocale();
|
|
35
30
|
const locale = localeProp || contextLocale;
|
|
36
31
|
const timeAgo = useTimeAgo(timestamp, {
|
|
@@ -45,7 +40,6 @@ const HvTimeAgo = _ref => {
|
|
|
45
40
|
children: !timestamp ? emptyElement : timeAgo
|
|
46
41
|
}));
|
|
47
42
|
};
|
|
48
|
-
|
|
49
43
|
process.env.NODE_ENV !== "production" ? HvTimeAgo.propTypes = {
|
|
50
44
|
/**
|
|
51
45
|
* A Jss Object used to override or extend the styles applied.
|
|
@@ -56,40 +50,33 @@ process.env.NODE_ENV !== "production" ? HvTimeAgo.propTypes = {
|
|
|
56
50
|
*/
|
|
57
51
|
root: PropTypes.string
|
|
58
52
|
}),
|
|
59
|
-
|
|
60
53
|
/**
|
|
61
54
|
* The timestamp to format, in seconds
|
|
62
55
|
*/
|
|
63
56
|
timestamp: PropTypes.number,
|
|
64
|
-
|
|
65
57
|
/**
|
|
66
58
|
* The locale to be used. Should be on of the dayjs supported locales
|
|
67
59
|
* @see https://day.js.org/docs/en/i18n/i18n
|
|
68
60
|
*/
|
|
69
61
|
locale: PropTypes.string,
|
|
70
|
-
|
|
71
62
|
/**
|
|
72
63
|
* The component used for the root node. Either a string to use a HTML element or a component.
|
|
73
64
|
* Defaults to `div`.
|
|
74
65
|
*/
|
|
75
66
|
component: PropTypes.elementType,
|
|
76
|
-
|
|
77
67
|
/**
|
|
78
68
|
* The element to render when the timestamp is null or 0
|
|
79
69
|
* Defaults to `—` (Em Dash)
|
|
80
70
|
*/
|
|
81
71
|
emptyElement: PropTypes.node,
|
|
82
|
-
|
|
83
72
|
/**
|
|
84
73
|
* Disables periodic date refreshes
|
|
85
74
|
*/
|
|
86
75
|
disableRefresh: PropTypes.bool,
|
|
87
|
-
|
|
88
76
|
/**
|
|
89
77
|
* Whether to show seconds in the rendered time
|
|
90
78
|
*/
|
|
91
79
|
showSeconds: PropTypes.bool,
|
|
92
|
-
|
|
93
80
|
/**
|
|
94
81
|
* Whether the component should render just the string
|
|
95
82
|
* Consider using `useTimeAgo` instead
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TimeAgo.js","names":["React","PropTypes","withStyles","HvTypography","useLocale","useTimeAgo","styles","HvTimeAgo","classes","timestamp","locale","localeProp","component","Component","emptyElement","disableRefresh","showSeconds","justText","others","contextLocale","timeAgo","root","propTypes","shape","string","number","elementType","node","bool","name"],"sources":["../../../src/TimeAgo/TimeAgo.js"],"sourcesContent":["import React from \"react\";\nimport PropTypes from \"prop-types\";\nimport { withStyles } from \"@mui/styles\";\nimport { HvTypography, useLocale } from \"@hitachivantara/uikit-react-core\";\nimport useTimeAgo from \"./useTimeAgo\";\nimport styles from \"./styles\";\n\n/**\n * The HvTimeAgo component implements the Design System relative time format guidelines.\n */\nconst HvTimeAgo = ({\n classes,\n timestamp,\n locale: localeProp,\n component: Component = HvTypography,\n emptyElement = \"—\",\n disableRefresh = false,\n showSeconds = false,\n justText = false,\n ...others\n}) => {\n const contextLocale = useLocale();\n const locale = localeProp || contextLocale;\n const timeAgo = useTimeAgo(timestamp, { locale, disableRefresh, showSeconds });\n\n if (justText && timestamp) return timeAgo;\n\n return (\n <Component className={classes.root} {...others}>\n {!timestamp ? emptyElement : timeAgo}\n </Component>\n );\n};\n\nHvTimeAgo.propTypes = {\n /**\n * A Jss Object used to override or extend the styles applied.\n */\n classes: PropTypes.shape({\n /**\n * Styles applied to the component root class.\n */\n root: PropTypes.string,\n }),\n /**\n * The timestamp to format, in seconds\n */\n timestamp: PropTypes.number,\n /**\n * The locale to be used. Should be on of the dayjs supported locales\n * @see https://day.js.org/docs/en/i18n/i18n\n */\n locale: PropTypes.string,\n /**\n * The component used for the root node. Either a string to use a HTML element or a component.\n * Defaults to `div`.\n */\n component: PropTypes.elementType,\n /**\n * The element to render when the timestamp is null or 0\n * Defaults to `—` (Em Dash)\n */\n emptyElement: PropTypes.node,\n /**\n * Disables periodic date refreshes\n */\n disableRefresh: PropTypes.bool,\n /**\n * Whether to show seconds in the rendered time\n */\n showSeconds: PropTypes.bool,\n /**\n * Whether the component should render just the string\n * Consider using `useTimeAgo` instead\n */\n justText: PropTypes.bool,\n};\n\nexport default withStyles(styles, { name: \"HvTimeAgo\" })(HvTimeAgo);\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"TimeAgo.js","names":["React","PropTypes","withStyles","HvTypography","useLocale","useTimeAgo","styles","HvTimeAgo","classes","timestamp","locale","localeProp","component","Component","emptyElement","disableRefresh","showSeconds","justText","others","contextLocale","timeAgo","root","propTypes","shape","string","number","elementType","node","bool","name"],"sources":["../../../src/TimeAgo/TimeAgo.js"],"sourcesContent":["import React from \"react\";\nimport PropTypes from \"prop-types\";\nimport { withStyles } from \"@mui/styles\";\nimport { HvTypography, useLocale } from \"@hitachivantara/uikit-react-core\";\nimport useTimeAgo from \"./useTimeAgo\";\nimport styles from \"./styles\";\n\n/**\n * The HvTimeAgo component implements the Design System relative time format guidelines.\n */\nconst HvTimeAgo = ({\n classes,\n timestamp,\n locale: localeProp,\n component: Component = HvTypography,\n emptyElement = \"—\",\n disableRefresh = false,\n showSeconds = false,\n justText = false,\n ...others\n}) => {\n const contextLocale = useLocale();\n const locale = localeProp || contextLocale;\n const timeAgo = useTimeAgo(timestamp, { locale, disableRefresh, showSeconds });\n\n if (justText && timestamp) return timeAgo;\n\n return (\n <Component className={classes.root} {...others}>\n {!timestamp ? emptyElement : timeAgo}\n </Component>\n );\n};\n\nHvTimeAgo.propTypes = {\n /**\n * A Jss Object used to override or extend the styles applied.\n */\n classes: PropTypes.shape({\n /**\n * Styles applied to the component root class.\n */\n root: PropTypes.string,\n }),\n /**\n * The timestamp to format, in seconds\n */\n timestamp: PropTypes.number,\n /**\n * The locale to be used. Should be on of the dayjs supported locales\n * @see https://day.js.org/docs/en/i18n/i18n\n */\n locale: PropTypes.string,\n /**\n * The component used for the root node. Either a string to use a HTML element or a component.\n * Defaults to `div`.\n */\n component: PropTypes.elementType,\n /**\n * The element to render when the timestamp is null or 0\n * Defaults to `—` (Em Dash)\n */\n emptyElement: PropTypes.node,\n /**\n * Disables periodic date refreshes\n */\n disableRefresh: PropTypes.bool,\n /**\n * Whether to show seconds in the rendered time\n */\n showSeconds: PropTypes.bool,\n /**\n * Whether the component should render just the string\n * Consider using `useTimeAgo` instead\n */\n justText: PropTypes.bool,\n};\n\nexport default withStyles(styles, { name: \"HvTimeAgo\" })(HvTimeAgo);\n"],"mappings":";;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAClC,SAASC,UAAU,QAAQ,aAAa;AACxC,SAASC,YAAY,EAAEC,SAAS,QAAQ,kCAAkC;AAC1E,OAAOC,UAAU,MAAM,cAAc;AACrC,OAAOC,MAAM,MAAM,UAAU;;AAE7B;AACA;AACA;AAFA;AAGA,MAAMC,SAAS,GAAG,QAUZ;EAAA,IAVa;MACjBC,OAAO;MACPC,SAAS;MACTC,MAAM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SAAS,CAAC"}
|
|
@@ -5,13 +5,13 @@ import localeData from "dayjs/plugin/localeData";
|
|
|
5
5
|
import localizedFormat from "dayjs/plugin/localizedFormat";
|
|
6
6
|
import relativeTime from "dayjs/plugin/relativeTime";
|
|
7
7
|
import updateLocale from "dayjs/plugin/updateLocale";
|
|
8
|
+
|
|
8
9
|
/**
|
|
9
10
|
* Relative time thresholds defined by
|
|
10
11
|
* {@link https://xd.adobe.com/view/1b7df235-5cf8-4b51-a2f0-0be1bb591c55-4e2e/ Design System}
|
|
11
12
|
*
|
|
12
13
|
* Implementation using day.js {@link https://day.js.org/docs/en/customization/relative-time relativeTime}
|
|
13
14
|
*/
|
|
14
|
-
|
|
15
15
|
const thresholds = [{
|
|
16
16
|
l: "s",
|
|
17
17
|
r: 119,
|
|
@@ -68,7 +68,6 @@ export const secondsUntilNextDay = (date = new Date()) => {
|
|
|
68
68
|
midnight.setMilliseconds(0);
|
|
69
69
|
return (midnight.getTime() - date.getTime()) / 1000;
|
|
70
70
|
};
|
|
71
|
-
|
|
72
71
|
const secondsUntilNextWeek = (date = new Date()) => {
|
|
73
72
|
const firstMonthDayOfWeek = date.getDate() - date.getDay();
|
|
74
73
|
const firstMonthDayOfNextWeek = firstMonthDayOfWeek + 7; // auto roll over to next month if needed
|
|
@@ -81,6 +80,7 @@ const secondsUntilNextWeek = (date = new Date()) => {
|
|
|
81
80
|
firstDayNextWeek.setMilliseconds(0);
|
|
82
81
|
return (firstDayNextWeek.getTime() - date.getTime()) / 1000;
|
|
83
82
|
};
|
|
83
|
+
|
|
84
84
|
/**
|
|
85
85
|
* @typedef {Object} TimeAgo
|
|
86
86
|
* @property {string} timeAgo - the formatted date using the "time ago format"
|
|
@@ -97,64 +97,62 @@ const secondsUntilNextWeek = (date = new Date()) => {
|
|
|
97
97
|
*
|
|
98
98
|
* @return {TimeAgo} the formatted date using the "time ago format" and the time until it needs to be updated
|
|
99
99
|
*/
|
|
100
|
-
|
|
101
|
-
|
|
102
100
|
export const formatTimeAgo = (date, locale, showSeconds = false, referenceDate = new Date()) => {
|
|
103
101
|
const dayReferenceDate = dayjs(referenceDate);
|
|
104
102
|
const dayDate = dayjs(date).locale(locale);
|
|
105
103
|
const dayDiffSeconds = dayReferenceDate.diff(dayDate, "second");
|
|
106
|
-
const formatUseSeconds = showSeconds ? "LTS" : "LT";
|
|
104
|
+
const formatUseSeconds = showSeconds ? "LTS" : "LT";
|
|
107
105
|
|
|
106
|
+
// check if the date is after the reference date
|
|
108
107
|
if (date.getTime() > referenceDate.getTime()) {
|
|
109
108
|
return {
|
|
110
109
|
timeAgo: dayDate.format(`L ${formatUseSeconds}`),
|
|
111
110
|
delay: (date.getTime() - referenceDate.getTime()) / 1000
|
|
112
111
|
};
|
|
113
|
-
}
|
|
114
|
-
|
|
112
|
+
}
|
|
115
113
|
|
|
114
|
+
// just now, until the 2 minutes
|
|
116
115
|
if (dayDiffSeconds < 120) {
|
|
117
116
|
return {
|
|
118
117
|
timeAgo: dayjs.duration(dayDiffSeconds, "second").locale(locale).humanize(),
|
|
119
118
|
delay: 120 - dayDiffSeconds
|
|
120
119
|
};
|
|
121
|
-
}
|
|
122
|
-
|
|
120
|
+
}
|
|
123
121
|
|
|
122
|
+
// ago in minutes, until the 1 hour mark
|
|
124
123
|
const dayDiffMinutes = dayReferenceDate.diff(dayDate, "minute");
|
|
125
|
-
|
|
126
124
|
if (dayDiffMinutes < 60) {
|
|
127
125
|
return {
|
|
128
126
|
timeAgo: dayjs.duration(-dayDiffMinutes, "minute").locale(locale).humanize(true),
|
|
129
127
|
delay: 60 * (dayDiffMinutes + 1) - dayDiffSeconds
|
|
130
128
|
};
|
|
131
|
-
}
|
|
132
|
-
|
|
129
|
+
}
|
|
133
130
|
|
|
131
|
+
// formatted date with text description for today
|
|
134
132
|
if (dayReferenceDate.isSame(dayDate, "day")) {
|
|
135
133
|
return {
|
|
136
134
|
timeAgo: `${dayDate.calendar(dayReferenceDate)}`,
|
|
137
135
|
delay: secondsUntilNextDay(referenceDate)
|
|
138
136
|
};
|
|
139
|
-
}
|
|
140
|
-
|
|
137
|
+
}
|
|
141
138
|
|
|
139
|
+
// formatted date with text description for yesterday
|
|
142
140
|
if (dayReferenceDate.subtract(1, "day").isSame(dayDate, "day")) {
|
|
143
141
|
return {
|
|
144
142
|
timeAgo: `${dayDate.calendar(dayReferenceDate)}`,
|
|
145
143
|
delay: secondsUntilNextDay(referenceDate)
|
|
146
144
|
};
|
|
147
|
-
}
|
|
148
|
-
|
|
145
|
+
}
|
|
149
146
|
|
|
147
|
+
// formatted date with week during the current week
|
|
150
148
|
if (dayDate.isSame(dayReferenceDate, "week")) {
|
|
151
149
|
return {
|
|
152
150
|
timeAgo: dayDate.format(`ddd, ${formatUseSeconds}`),
|
|
153
151
|
delay: secondsUntilNextWeek(date)
|
|
154
152
|
};
|
|
155
|
-
}
|
|
156
|
-
|
|
153
|
+
}
|
|
157
154
|
|
|
155
|
+
// formatted without special gimmicks
|
|
158
156
|
return {
|
|
159
157
|
timeAgo: dayDate.format(`L ${formatUseSeconds}`),
|
|
160
158
|
delay: 0
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formatUtils.js","names":["dayjs","calendar","duration","localeData","localizedFormat","relativeTime","updateLocale","thresholds","l","r","d","extend","secondsUntilNextDay","date","Date","midnight","getTime","setDate","getDate","setHours","setMinutes","setSeconds","setMilliseconds","secondsUntilNextWeek","firstMonthDayOfWeek","getDay","firstMonthDayOfNextWeek","firstDayNextWeek","formatTimeAgo","locale","showSeconds","referenceDate","dayReferenceDate","dayDate","dayDiffSeconds","diff","formatUseSeconds","timeAgo","format","delay","humanize","dayDiffMinutes","isSame","subtract"],"sources":["../../../src/TimeAgo/formatUtils.js"],"sourcesContent":["import dayjs from \"dayjs\";\nimport calendar from \"dayjs/plugin/calendar\";\nimport duration from \"dayjs/plugin/duration\";\nimport localeData from \"dayjs/plugin/localeData\";\nimport localizedFormat from \"dayjs/plugin/localizedFormat\";\nimport relativeTime from \"dayjs/plugin/relativeTime\";\nimport updateLocale from \"dayjs/plugin/updateLocale\";\n\n/**\n * Relative time thresholds defined by\n * {@link https://xd.adobe.com/view/1b7df235-5cf8-4b51-a2f0-0be1bb591c55-4e2e/ Design System}\n *\n * Implementation using day.js {@link https://day.js.org/docs/en/customization/relative-time relativeTime}\n */\nconst thresholds = [\n { l: \"s\", r: 119, d: \"second\" },\n { l: \"m\", r: 1 },\n { l: \"mm\", r: 59, d: \"minute\" },\n { l: \"h\", r: 1 },\n { l: \"hh\", r: 23, d: \"hour\" },\n { l: \"d\", r: 1 },\n { l: \"dd\", r: 29, d: \"day\" },\n { l: \"M\", r: 1 },\n { l: \"MM\", r: 11, d: \"month\" },\n { l: \"y\", r: 17 },\n { l: \"yy\", d: \"year\" },\n];\n\ndayjs.extend(localeData);\ndayjs.extend(duration);\ndayjs.extend(calendar);\ndayjs.extend(localizedFormat);\ndayjs.extend(relativeTime, { thresholds });\ndayjs.extend(updateLocale);\n\nexport const secondsUntilNextDay = (date = new Date()) => {\n const midnight = new Date(date.getTime());\n\n midnight.setDate(midnight.getDate() + 1);\n midnight.setHours(0);\n midnight.setMinutes(0);\n midnight.setSeconds(0);\n midnight.setMilliseconds(0);\n\n return (midnight.getTime() - date.getTime()) / 1000;\n};\n\nconst secondsUntilNextWeek = (date = new Date()) => {\n const firstMonthDayOfWeek = date.getDate() - date.getDay();\n const firstMonthDayOfNextWeek = firstMonthDayOfWeek + 7; // auto roll over to next month if needed\n\n const firstDayNextWeek = new Date(date.getTime());\n\n firstDayNextWeek.setDate(firstMonthDayOfNextWeek);\n firstDayNextWeek.setHours(0);\n firstDayNextWeek.setMinutes(0);\n firstDayNextWeek.setSeconds(0);\n firstDayNextWeek.setMilliseconds(0);\n\n return (firstDayNextWeek.getTime() - date.getTime()) / 1000;\n};\n\n/**\n * @typedef {Object} TimeAgo\n * @property {string} timeAgo - the formatted date using the \"time ago format\"\n * @property {number} delay - the time until the date needs to be updated\n */\n\n/**\n * Formats a date to the a relative time format using dayjs.\n *\n * @param {Date} date - date to format.\n * @param {String} locale - locale to use.\n * @param {Boolean} [showSeconds=false] - if seconds should be part of the result.\n * @param {Date} referenceDate - reference date to use when formatting (defaults to current date).\n *\n * @return {TimeAgo} the formatted date using the \"time ago format\" and the time until it needs to be updated\n */\nexport const formatTimeAgo = (date, locale, showSeconds = false, referenceDate = new Date()) => {\n const dayReferenceDate = dayjs(referenceDate);\n const dayDate = dayjs(date).locale(locale);\n\n const dayDiffSeconds = dayReferenceDate.diff(dayDate, \"second\");\n\n const formatUseSeconds = showSeconds ? \"LTS\" : \"LT\";\n\n // check if the date is after the reference date\n if (date.getTime() > referenceDate.getTime()) {\n return {\n timeAgo: dayDate.format(`L ${formatUseSeconds}`),\n delay: (date.getTime() - referenceDate.getTime()) / 1000,\n };\n }\n\n // just now, until the 2 minutes\n if (dayDiffSeconds < 120) {\n return {\n timeAgo: dayjs.duration(dayDiffSeconds, \"second\").locale(locale).humanize(),\n delay: 120 - dayDiffSeconds,\n };\n }\n\n // ago in minutes, until the 1 hour mark\n const dayDiffMinutes = dayReferenceDate.diff(dayDate, \"minute\");\n\n if (dayDiffMinutes < 60) {\n return {\n timeAgo: dayjs.duration(-dayDiffMinutes, \"minute\").locale(locale).humanize(true),\n delay: 60 * (dayDiffMinutes + 1) - dayDiffSeconds,\n };\n }\n\n // formatted date with text description for today\n if (dayReferenceDate.isSame(dayDate, \"day\")) {\n return {\n timeAgo: `${dayDate.calendar(dayReferenceDate)}`,\n delay: secondsUntilNextDay(referenceDate),\n };\n }\n\n // formatted date with text description for yesterday\n if (dayReferenceDate.subtract(1, \"day\").isSame(dayDate, \"day\")) {\n return {\n timeAgo: `${dayDate.calendar(dayReferenceDate)}`,\n delay: secondsUntilNextDay(referenceDate),\n };\n }\n\n // formatted date with week during the current week\n if (dayDate.isSame(dayReferenceDate, \"week\")) {\n return {\n timeAgo: dayDate.format(`ddd, ${formatUseSeconds}`),\n delay: secondsUntilNextWeek(date),\n };\n }\n\n // formatted without special gimmicks\n return {\n timeAgo: dayDate.format(`L ${formatUseSeconds}`),\n delay: 0,\n };\n};\n"],"mappings":"AAAA,OAAOA,
|
|
1
|
+
{"version":3,"file":"formatUtils.js","names":["dayjs","calendar","duration","localeData","localizedFormat","relativeTime","updateLocale","thresholds","l","r","d","extend","secondsUntilNextDay","date","Date","midnight","getTime","setDate","getDate","setHours","setMinutes","setSeconds","setMilliseconds","secondsUntilNextWeek","firstMonthDayOfWeek","getDay","firstMonthDayOfNextWeek","firstDayNextWeek","formatTimeAgo","locale","showSeconds","referenceDate","dayReferenceDate","dayDate","dayDiffSeconds","diff","formatUseSeconds","timeAgo","format","delay","humanize","dayDiffMinutes","isSame","subtract"],"sources":["../../../src/TimeAgo/formatUtils.js"],"sourcesContent":["import dayjs from \"dayjs\";\nimport calendar from \"dayjs/plugin/calendar\";\nimport duration from \"dayjs/plugin/duration\";\nimport localeData from \"dayjs/plugin/localeData\";\nimport localizedFormat from \"dayjs/plugin/localizedFormat\";\nimport relativeTime from \"dayjs/plugin/relativeTime\";\nimport updateLocale from \"dayjs/plugin/updateLocale\";\n\n/**\n * Relative time thresholds defined by\n * {@link https://xd.adobe.com/view/1b7df235-5cf8-4b51-a2f0-0be1bb591c55-4e2e/ Design System}\n *\n * Implementation using day.js {@link https://day.js.org/docs/en/customization/relative-time relativeTime}\n */\nconst thresholds = [\n { l: \"s\", r: 119, d: \"second\" },\n { l: \"m\", r: 1 },\n { l: \"mm\", r: 59, d: \"minute\" },\n { l: \"h\", r: 1 },\n { l: \"hh\", r: 23, d: \"hour\" },\n { l: \"d\", r: 1 },\n { l: \"dd\", r: 29, d: \"day\" },\n { l: \"M\", r: 1 },\n { l: \"MM\", r: 11, d: \"month\" },\n { l: \"y\", r: 17 },\n { l: \"yy\", d: \"year\" },\n];\n\ndayjs.extend(localeData);\ndayjs.extend(duration);\ndayjs.extend(calendar);\ndayjs.extend(localizedFormat);\ndayjs.extend(relativeTime, { thresholds });\ndayjs.extend(updateLocale);\n\nexport const secondsUntilNextDay = (date = new Date()) => {\n const midnight = new Date(date.getTime());\n\n midnight.setDate(midnight.getDate() + 1);\n midnight.setHours(0);\n midnight.setMinutes(0);\n midnight.setSeconds(0);\n midnight.setMilliseconds(0);\n\n return (midnight.getTime() - date.getTime()) / 1000;\n};\n\nconst secondsUntilNextWeek = (date = new Date()) => {\n const firstMonthDayOfWeek = date.getDate() - date.getDay();\n const firstMonthDayOfNextWeek = firstMonthDayOfWeek + 7; // auto roll over to next month if needed\n\n const firstDayNextWeek = new Date(date.getTime());\n\n firstDayNextWeek.setDate(firstMonthDayOfNextWeek);\n firstDayNextWeek.setHours(0);\n firstDayNextWeek.setMinutes(0);\n firstDayNextWeek.setSeconds(0);\n firstDayNextWeek.setMilliseconds(0);\n\n return (firstDayNextWeek.getTime() - date.getTime()) / 1000;\n};\n\n/**\n * @typedef {Object} TimeAgo\n * @property {string} timeAgo - the formatted date using the \"time ago format\"\n * @property {number} delay - the time until the date needs to be updated\n */\n\n/**\n * Formats a date to the a relative time format using dayjs.\n *\n * @param {Date} date - date to format.\n * @param {String} locale - locale to use.\n * @param {Boolean} [showSeconds=false] - if seconds should be part of the result.\n * @param {Date} referenceDate - reference date to use when formatting (defaults to current date).\n *\n * @return {TimeAgo} the formatted date using the \"time ago format\" and the time until it needs to be updated\n */\nexport const formatTimeAgo = (date, locale, showSeconds = false, referenceDate = new Date()) => {\n const dayReferenceDate = dayjs(referenceDate);\n const dayDate = dayjs(date).locale(locale);\n\n const dayDiffSeconds = dayReferenceDate.diff(dayDate, \"second\");\n\n const formatUseSeconds = showSeconds ? \"LTS\" : \"LT\";\n\n // check if the date is after the reference date\n if (date.getTime() > referenceDate.getTime()) {\n return {\n timeAgo: dayDate.format(`L ${formatUseSeconds}`),\n delay: (date.getTime() - referenceDate.getTime()) / 1000,\n };\n }\n\n // just now, until the 2 minutes\n if (dayDiffSeconds < 120) {\n return {\n timeAgo: dayjs.duration(dayDiffSeconds, \"second\").locale(locale).humanize(),\n delay: 120 - dayDiffSeconds,\n };\n }\n\n // ago in minutes, until the 1 hour mark\n const dayDiffMinutes = dayReferenceDate.diff(dayDate, \"minute\");\n\n if (dayDiffMinutes < 60) {\n return {\n timeAgo: dayjs.duration(-dayDiffMinutes, \"minute\").locale(locale).humanize(true),\n delay: 60 * (dayDiffMinutes + 1) - dayDiffSeconds,\n };\n }\n\n // formatted date with text description for today\n if (dayReferenceDate.isSame(dayDate, \"day\")) {\n return {\n timeAgo: `${dayDate.calendar(dayReferenceDate)}`,\n delay: secondsUntilNextDay(referenceDate),\n };\n }\n\n // formatted date with text description for yesterday\n if (dayReferenceDate.subtract(1, \"day\").isSame(dayDate, \"day\")) {\n return {\n timeAgo: `${dayDate.calendar(dayReferenceDate)}`,\n delay: secondsUntilNextDay(referenceDate),\n };\n }\n\n // formatted date with week during the current week\n if (dayDate.isSame(dayReferenceDate, \"week\")) {\n return {\n timeAgo: dayDate.format(`ddd, ${formatUseSeconds}`),\n delay: secondsUntilNextWeek(date),\n };\n }\n\n // formatted without special gimmicks\n return {\n timeAgo: dayDate.format(`L ${formatUseSeconds}`),\n delay: 0,\n };\n};\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,QAAQ,MAAM,uBAAuB;AAC5C,OAAOC,QAAQ,MAAM,uBAAuB;AAC5C,OAAOC,UAAU,MAAM,yBAAyB;AAChD,OAAOC,eAAe,MAAM,8BAA8B;AAC1D,OAAOC,YAAY,MAAM,2BAA2B;AACpD,OAAOC,YAAY,MAAM,2BAA2B;;AAEpD;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,UAAU,GAAG,CACjB;EAAEC,CAAC,EAAE,GAAG;EAAEC,CAAC,EAAE,GAAG;EAAEC,CAAC,EAAE;AAAS,CAAC,EAC/B;EAAEF,CAAC,EAAE,GAAG;EAAEC,CAAC,EAAE;AAAE,CAAC,EAChB;EAAED,CAAC,EAAE,IAAI;EAAEC,CAAC,EAAE,EAAE;EAAEC,CAAC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ACT,OAAO,EAAE,KAAK,CAAC,EAAE;IAC9D,OAAO;MACLI,OAAO,EAAG,GAAEJ,OAAO,CAAChC,QAAQ,CAAC+B,gBAAgB,CAAE,EAAC;MAChDO,KAAK,EAAE3B,mBAAmB,CAACmB,aAAa;IAC1C,CAAC;EACH;;EAEA;EACA,IAAIE,OAAO,CAACS,MAAM,CAACV,gBAAgB,EAAE,MAAM,CAAC,EAAE;IAC5C,OAAO;MACLK,OAAO,EAAEJ,OAAO,CAACK,MAAM,CAAE,QAAOF,gBAAiB,EAAC,CAAC;MACnDG,KAAK,EAAEhB,oBAAoB,CAACV,IAAI;IAClC,CAAC;EACH;;EAEA;EACA,OAAO;IACLwB,OAAO,EAAEJ,OAAO,CAACK,MAAM,CAAE,KAAIF,gBAAiB,EAAC,CAAC;IAChDG,KAAK,EAAE;EACT,CAAC;AACH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["default","useTimeAgo"],"sources":["../../../src/TimeAgo/index.js"],"sourcesContent":["export { default } from \"./TimeAgo\";\nexport { default as useTimeAgo } from \"./useTimeAgo\";\n"],"mappings":"AAAA,SAASA,
|
|
1
|
+
{"version":3,"file":"index.js","names":["default","useTimeAgo"],"sources":["../../../src/TimeAgo/index.js"],"sourcesContent":["export { default } from \"./TimeAgo\";\nexport { default as useTimeAgo } from \"./useTimeAgo\";\n"],"mappings":"AAAA,SAASA,OAAO,QAAQ,WAAW;AACnC,SAASA,OAAO,IAAIC,UAAU,QAAQ,cAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","names":["styles","root"],"sources":["../../../src/TimeAgo/styles.js"],"sourcesContent":["const styles = {\n root: {},\n};\n\nexport default styles;\n"],"mappings":"AAAA,MAAMA,MAAM,GAAG;EACbC,IAAI,EAAE;
|
|
1
|
+
{"version":3,"file":"styles.js","names":["styles","root"],"sources":["../../../src/TimeAgo/styles.js"],"sourcesContent":["const styles = {\n root: {},\n};\n\nexport default styles;\n"],"mappings":"AAAA,MAAMA,MAAM,GAAG;EACbC,IAAI,EAAE,CAAC;AACT,CAAC;AAED,eAAeD,MAAM"}
|
|
@@ -1,16 +1,14 @@
|
|
|
1
|
-
import "core-js/modules/web.dom-collections.iterator.js";
|
|
2
1
|
import { useEffect, useState } from "react";
|
|
3
2
|
import useTimeout from "./useTimeout";
|
|
4
3
|
import { formatTimeAgo } from "./formatUtils";
|
|
4
|
+
|
|
5
5
|
/**
|
|
6
6
|
* Calls `formatTimeAgo` with timestamp conversion
|
|
7
7
|
*/
|
|
8
|
-
|
|
9
8
|
const fmt = (timestamp, locale, showSeconds) => {
|
|
10
9
|
const timestampMs = String(timestamp).length > 11 ? timestamp : timestamp * 1000;
|
|
11
10
|
return formatTimeAgo(new Date(timestampMs), locale, showSeconds);
|
|
12
11
|
};
|
|
13
|
-
|
|
14
12
|
export default function useTimeAgo(timestamp, options) {
|
|
15
13
|
const {
|
|
16
14
|
locale,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTimeAgo.js","names":["useEffect","useState","useTimeout","formatTimeAgo","fmt","timestamp","locale","showSeconds","timestampMs","String","length","Date","useTimeAgo","options","disableRefresh","timeAgo","setTimeAgo","refreshTime","delay","newTimeAgo"],"sources":["../../../src/TimeAgo/useTimeAgo.js"],"sourcesContent":["import { useEffect, useState } from \"react\";\nimport useTimeout from \"./useTimeout\";\nimport { formatTimeAgo } from \"./formatUtils\";\n\n/**\n * Calls `formatTimeAgo` with timestamp conversion\n */\nconst fmt = (timestamp, locale, showSeconds) => {\n const timestampMs = String(timestamp).length > 11 ? timestamp : timestamp * 1000;\n return formatTimeAgo(new Date(timestampMs), locale, showSeconds);\n};\n\nexport default function useTimeAgo(timestamp, options) {\n const { locale, disableRefresh = false, showSeconds = false } = options;\n const [timeAgo, setTimeAgo] = useState(fmt(timestamp, locale, showSeconds));\n const refreshTime = disableRefresh ? 0 : timeAgo.delay * 1000;\n\n useEffect(() => {\n const newTimeAgo = fmt(timestamp, locale, showSeconds);\n setTimeAgo(newTimeAgo);\n }, [timestamp, locale, showSeconds]);\n\n useTimeout(() => {\n const newTimeAgo = fmt(timestamp, locale, showSeconds);\n setTimeAgo(newTimeAgo);\n }, refreshTime);\n\n return timeAgo.timeAgo;\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"useTimeAgo.js","names":["useEffect","useState","useTimeout","formatTimeAgo","fmt","timestamp","locale","showSeconds","timestampMs","String","length","Date","useTimeAgo","options","disableRefresh","timeAgo","setTimeAgo","refreshTime","delay","newTimeAgo"],"sources":["../../../src/TimeAgo/useTimeAgo.js"],"sourcesContent":["import { useEffect, useState } from \"react\";\nimport useTimeout from \"./useTimeout\";\nimport { formatTimeAgo } from \"./formatUtils\";\n\n/**\n * Calls `formatTimeAgo` with timestamp conversion\n */\nconst fmt = (timestamp, locale, showSeconds) => {\n const timestampMs = String(timestamp).length > 11 ? timestamp : timestamp * 1000;\n return formatTimeAgo(new Date(timestampMs), locale, showSeconds);\n};\n\nexport default function useTimeAgo(timestamp, options) {\n const { locale, disableRefresh = false, showSeconds = false } = options;\n const [timeAgo, setTimeAgo] = useState(fmt(timestamp, locale, showSeconds));\n const refreshTime = disableRefresh ? 0 : timeAgo.delay * 1000;\n\n useEffect(() => {\n const newTimeAgo = fmt(timestamp, locale, showSeconds);\n setTimeAgo(newTimeAgo);\n }, [timestamp, locale, showSeconds]);\n\n useTimeout(() => {\n const newTimeAgo = fmt(timestamp, locale, showSeconds);\n setTimeAgo(newTimeAgo);\n }, refreshTime);\n\n return timeAgo.timeAgo;\n}\n"],"mappings":"AAAA,SAASA,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AAC3C,OAAOC,UAAU,MAAM,cAAc;AACrC,SAASC,aAAa,QAAQ,eAAe;;AAE7C;AACA;AACA;AACA,MAAMC,GAAG,GAAG,CAACC,SAAS,EAAEC,MAAM,EAAEC,WAAW,KAAK;EAC9C,MAAMC,WAAW,GAAGC,MAAM,CAACJ,SAAS,CAAC,CAACK,MAAM,GAAG,EAAE,GAAGL,SAAS,GAAGA,SAAS,GAAG,IAAI;EAChF,OAAOF,aAAa,CAAC,IAAIQ,IAAI,CAACH,WAAW,CAAC,EAAEF,MAAM,EAAEC,WAAW,CAAC;AAClE,CAAC;AAED,eAAe,SAASK,UAAU,CAACP,SAAS,EAAEQ,OAAO,EAAE;EACrD,MAAM;IAAEP,MAAM;IAAEQ,cAAc,GAAG,KAAK;IAAEP,WAAW,GAAG;EAAM,CAAC,GAAGM,OAAO;EACvE,MAAM,CAACE,OAAO,EAAEC,UAAU,CAAC,GAAGf,QAAQ,CAACG,GAAG,CAACC,SAAS,EAAEC,MAAM,EAAEC,WAAW,CAAC,CAAC;EAC3E,MAAMU,WAAW,GAAGH,cAAc,GAAG,CAAC,GAAGC,OAAO,CAACG,KAAK,GAAG,IAAI;EAE7DlB,SAAS,CAAC,MAAM;IACd,MAAMmB,UAAU,GAAGf,GAAG,CAACC,SAAS,EAAEC,MAAM,EAAEC,WAAW,CAAC;IACtDS,UAAU,CAACG,UAAU,CAAC;EACxB,CAAC,EAAE,CAACd,SAAS,EAAEC,MAAM,EAAEC,WAAW,CAAC,CAAC;EAEpCL,UAAU,CAAC,MAAM;IACf,MAAMiB,UAAU,GAAGf,GAAG,CAACC,SAAS,EAAEC,MAAM,EAAEC,WAAW,CAAC;IACtDS,UAAU,CAACG,UAAU,CAAC;EACxB,CAAC,EAAEF,WAAW,CAAC;EAEf,OAAOF,OAAO,CAACA,OAAO;AACxB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTimeout.js","names":["useEffect","useRef","useTimeout","callback","delay","savedCallback","current","undefined","id","setTimeout","clearTimeout"],"sources":["../../../src/TimeAgo/useTimeout.js"],"sourcesContent":["import { useEffect, useRef } from \"react\";\n\nexport default function useTimeout(callback, delay) {\n const savedCallback = useRef(callback);\n\n useEffect(() => {\n savedCallback.current = callback;\n }, [callback]);\n\n useEffect(() => {\n if (!delay) return undefined;\n\n const id = setTimeout(() => savedCallback.current(), delay);\n return () => clearTimeout(id);\n }, [delay]);\n}\n"],"mappings":"AAAA,SAASA,
|
|
1
|
+
{"version":3,"file":"useTimeout.js","names":["useEffect","useRef","useTimeout","callback","delay","savedCallback","current","undefined","id","setTimeout","clearTimeout"],"sources":["../../../src/TimeAgo/useTimeout.js"],"sourcesContent":["import { useEffect, useRef } from \"react\";\n\nexport default function useTimeout(callback, delay) {\n const savedCallback = useRef(callback);\n\n useEffect(() => {\n savedCallback.current = callback;\n }, [callback]);\n\n useEffect(() => {\n if (!delay) return undefined;\n\n const id = setTimeout(() => savedCallback.current(), delay);\n return () => clearTimeout(id);\n }, [delay]);\n}\n"],"mappings":"AAAA,SAASA,SAAS,EAAEC,MAAM,QAAQ,OAAO;AAEzC,eAAe,SAASC,UAAU,CAACC,QAAQ,EAAEC,KAAK,EAAE;EAClD,MAAMC,aAAa,GAAGJ,MAAM,CAACE,QAAQ,CAAC;EAEtCH,SAAS,CAAC,MAAM;IACdK,aAAa,CAACC,OAAO,GAAGH,QAAQ;EAClC,CAAC,EAAE,CAACA,QAAQ,CAAC,CAAC;EAEdH,SAAS,CAAC,MAAM;IACd,IAAI,CAACI,KAAK,EAAE,OAAOG,SAAS;IAE5B,MAAMC,EAAE,GAAGC,UAAU,CAAC,MAAMJ,aAAa,CAACC,OAAO,EAAE,EAAEF,KAAK,CAAC;IAC3D,OAAO,MAAMM,YAAY,CAACF,EAAE,CAAC;EAC/B,CAAC,EAAE,CAACJ,KAAK,CAAC,CAAC;AACb"}
|
|
@@ -13,7 +13,7 @@ export type HvWizardProps = StandardProps<
|
|
|
13
13
|
/**
|
|
14
14
|
* Class names to be applied.
|
|
15
15
|
*/
|
|
16
|
-
className
|
|
16
|
+
className?: string;
|
|
17
17
|
/**
|
|
18
18
|
* Current state of the Wizard.
|
|
19
19
|
*/
|
|
@@ -25,19 +25,19 @@ export type HvWizardProps = StandardProps<
|
|
|
25
25
|
/**
|
|
26
26
|
* Function executed on submit.
|
|
27
27
|
*/
|
|
28
|
-
|
|
28
|
+
handleSubmit: any;
|
|
29
29
|
/**
|
|
30
30
|
* Title for the wizard.
|
|
31
31
|
*/
|
|
32
|
-
title
|
|
32
|
+
title?: string;
|
|
33
33
|
/**
|
|
34
34
|
* The content of the component.
|
|
35
35
|
*/
|
|
36
|
-
children
|
|
36
|
+
children?: React.ReactNode;
|
|
37
37
|
/**
|
|
38
38
|
* An object containing all the labels for the wizard.
|
|
39
39
|
*/
|
|
40
|
-
labels
|
|
40
|
+
labels?: HvWizardActionsProps["labels"] & HvWizardTitleProps["labels"];
|
|
41
41
|
/**
|
|
42
42
|
* Shows the summary button.
|
|
43
43
|
*/
|