@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
|
@@ -8,13 +8,10 @@ import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
|
8
8
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
9
9
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
10
10
|
var _excluded = ["className", "classes", "width", "steps", "stepSize", "showTitles", "type"],
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
_excluded2 = ["state", "title", "separatorClassName"],
|
|
12
|
+
_excluded3 = ["stepsWidth", "navWidth"];
|
|
14
13
|
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; }
|
|
15
|
-
|
|
16
14
|
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; }
|
|
17
|
-
|
|
18
15
|
import "core-js/modules/es.array.includes.js";
|
|
19
16
|
import "core-js/modules/es.object.to-string.js";
|
|
20
17
|
import "core-js/modules/es.array.concat.js";
|
|
@@ -34,6 +31,7 @@ import HvDefaultNavigation from "./DefaultNavigation";
|
|
|
34
31
|
import HvSimpleNavigation from "./SimpleNavigation";
|
|
35
32
|
import { SEPARATOR_WIDTH, TITLE_MARGIN, TITLE_WIDTH } from "./utils";
|
|
36
33
|
import styles from "./styles";
|
|
34
|
+
|
|
37
35
|
/**
|
|
38
36
|
* Navigation page with steps.
|
|
39
37
|
*
|
|
@@ -55,41 +53,35 @@ import styles from "./styles";
|
|
|
55
53
|
* displayed above, the width of the separator element will be 100px.
|
|
56
54
|
* If the step component has titles, each one will have 215px of width by default.
|
|
57
55
|
*/
|
|
58
|
-
|
|
59
56
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
60
|
-
|
|
61
57
|
var HvStepNavigation = function HvStepNavigation(_ref) {
|
|
62
58
|
var className = _ref.className,
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
59
|
+
classes = _ref.classes,
|
|
60
|
+
width = _ref.width,
|
|
61
|
+
steps = _ref.steps,
|
|
62
|
+
stepSize = _ref.stepSize,
|
|
63
|
+
showTitles = _ref.showTitles,
|
|
64
|
+
_ref$type = _ref.type,
|
|
65
|
+
type = _ref$type === void 0 ? "Default" : _ref$type,
|
|
66
|
+
others = _objectWithoutProperties(_ref, _excluded);
|
|
67
|
+
var theme = useTheme();
|
|
68
|
+
// current breakpoint 'xs' | 'sm' | 'md' | 'lg' | 'xl'
|
|
69
|
+
var breakpoint = useWidth();
|
|
70
|
+
// step configurations
|
|
76
71
|
var stepSizeKey = stepSize !== null && stepSize !== void 0 ? stepSize : ["xs", "sm"].includes(breakpoint) ? "SM" : "MD";
|
|
77
72
|
var hasTitles = showTitles !== null && showTitles !== void 0 ? showTitles : !["xs", "sm"].includes(breakpoint);
|
|
78
|
-
|
|
79
73
|
var styledLi = function styledLi(containerSize) {
|
|
80
74
|
return styled("li")({
|
|
81
75
|
width: containerSize,
|
|
82
76
|
height: containerSize
|
|
83
77
|
});
|
|
84
78
|
};
|
|
85
|
-
|
|
86
79
|
var styledDiv = function styledDiv(containerSize) {
|
|
87
80
|
return styled("div")({
|
|
88
81
|
width: containerSize,
|
|
89
82
|
height: containerSize
|
|
90
83
|
});
|
|
91
84
|
};
|
|
92
|
-
|
|
93
85
|
var styledSeparatorElement = function styledSeparatorElement(title, separatorClassName, separatorHeight, separatorWidth, backgroundColor) {
|
|
94
86
|
var Separator = withStyles({
|
|
95
87
|
separatorElement: {
|
|
@@ -110,34 +102,30 @@ var HvStepNavigation = function HvStepNavigation(_ref) {
|
|
|
110
102
|
children: /*#__PURE__*/_jsx(Separator, {})
|
|
111
103
|
}, "separator-".concat(title));
|
|
112
104
|
};
|
|
113
|
-
|
|
114
105
|
var drawItems = function drawItems(_ref3) {
|
|
115
106
|
var _ref3$separatorValues = _ref3.separatorValues,
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
107
|
+
minWidth = _ref3$separatorValues.minWidth,
|
|
108
|
+
maxWidth = _ref3$separatorValues.maxWidth,
|
|
109
|
+
getColor = _ref3$separatorValues.getColor,
|
|
110
|
+
height = _ref3$separatorValues.height,
|
|
111
|
+
_ref3$stepValues = _ref3.stepValues,
|
|
112
|
+
minSize = _ref3$stepValues.minSize,
|
|
113
|
+
maxSize = _ref3$stepValues.maxSize,
|
|
114
|
+
StepComponent = _ref3$stepValues.StepComponent;
|
|
124
115
|
var items = steps.reduce(function (acc, _ref4, index) {
|
|
125
116
|
var state = _ref4.state,
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
117
|
+
title = _ref4.title,
|
|
118
|
+
separatorClassName = _ref4.separatorClassName,
|
|
119
|
+
props = _objectWithoutProperties(_ref4, _excluded2);
|
|
130
120
|
var containerSize = state === "Current" ? maxSize : minSize;
|
|
131
121
|
var StepContainer = styledLi(containerSize);
|
|
132
122
|
var Step = styledDiv(Math.max(containerSize, 30), Math.max(containerSize, 30));
|
|
133
|
-
|
|
134
123
|
var stepProps = _objectSpread({}, _objectSpread({
|
|
135
124
|
size: stepSizeKey,
|
|
136
125
|
state: state,
|
|
137
126
|
title: title,
|
|
138
127
|
number: index + 1
|
|
139
128
|
}, props));
|
|
140
|
-
|
|
141
129
|
var stepElement = /*#__PURE__*/_jsx(StepContainer, {
|
|
142
130
|
className: classes.li,
|
|
143
131
|
children: hasTitles ? /*#__PURE__*/_jsx(StepComponent, _objectSpread({
|
|
@@ -158,12 +146,10 @@ var HvStepNavigation = function HvStepNavigation(_ref) {
|
|
|
158
146
|
})
|
|
159
147
|
})
|
|
160
148
|
}, "step-".concat(title));
|
|
161
|
-
|
|
162
149
|
if (index < steps.length - 1) {
|
|
163
150
|
var separatorElement = styledSeparatorElement(title, separatorClassName, height, [steps[index + 1].state, state].includes("Current") ? minWidth : maxWidth, getColor(steps[index + 1].state === "Disabled" ? "Disabled" : state, theme));
|
|
164
151
|
return [].concat(_toConsumableArray(acc), [stepElement, separatorElement]);
|
|
165
152
|
}
|
|
166
|
-
|
|
167
153
|
return [].concat(_toConsumableArray(acc), [stepElement]);
|
|
168
154
|
}, []);
|
|
169
155
|
return /*#__PURE__*/_jsx("ol", {
|
|
@@ -171,10 +157,8 @@ var HvStepNavigation = function HvStepNavigation(_ref) {
|
|
|
171
157
|
children: items
|
|
172
158
|
});
|
|
173
159
|
};
|
|
174
|
-
|
|
175
160
|
var getDynamicValues = function getDynamicValues(stepsWidth) {
|
|
176
161
|
var _width$breakpoint, _theme$breakpoints$va, _theme$breakpoints$va2;
|
|
177
|
-
|
|
178
162
|
var maxWidth = (_width$breakpoint = width === null || width === void 0 ? void 0 : width[breakpoint]) !== null && _width$breakpoint !== void 0 ? _width$breakpoint : Math.max(Number(hasTitles) * (TITLE_WIDTH + TITLE_MARGIN) * steps.length - TITLE_MARGIN, SEPARATOR_WIDTH * (steps.length - 1) + stepsWidth);
|
|
179
163
|
var next = theme.breakpoints.keys.find(function (_, index, self) {
|
|
180
164
|
return index - 1 >= 0 ? self[index - 1] === breakpoint : false;
|
|
@@ -188,7 +172,6 @@ var HvStepNavigation = function HvStepNavigation(_ref) {
|
|
|
188
172
|
separatorWidth: separatorWidth
|
|
189
173
|
};
|
|
190
174
|
};
|
|
191
|
-
|
|
192
175
|
var styledTitle = function styledTitle(titleClassName, variant, title, titleWidth) {
|
|
193
176
|
return withStyles({
|
|
194
177
|
stepTitle: {
|
|
@@ -205,33 +188,29 @@ var HvStepNavigation = function HvStepNavigation(_ref) {
|
|
|
205
188
|
}) : null;
|
|
206
189
|
});
|
|
207
190
|
};
|
|
208
|
-
|
|
209
191
|
var getTitles = function getTitles(getTitleProps) {
|
|
210
192
|
return hasTitles ? /*#__PURE__*/_jsx("div", {
|
|
211
193
|
className: classes.titles,
|
|
212
194
|
children: steps.map(function (_ref6, index) {
|
|
213
195
|
var rawTitle = _ref6.title,
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
196
|
+
state = _ref6.state,
|
|
197
|
+
titleClassName = _ref6.titleClassName;
|
|
217
198
|
var _getTitleProps = getTitleProps({
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
199
|
+
state: state,
|
|
200
|
+
rawTitle: rawTitle,
|
|
201
|
+
number: index + 1
|
|
202
|
+
}),
|
|
203
|
+
_getTitleProps$varian = _getTitleProps.variant,
|
|
204
|
+
variant = _getTitleProps$varian === void 0 ? "highlightText" : _getTitleProps$varian,
|
|
205
|
+
_getTitleProps$title = _getTitleProps.title,
|
|
206
|
+
title = _getTitleProps$title === void 0 ? rawTitle : _getTitleProps$title,
|
|
207
|
+
_getTitleProps$titleW = _getTitleProps.titleWidth,
|
|
208
|
+
titleWidth = _getTitleProps$titleW === void 0 ? 0 : _getTitleProps$titleW;
|
|
229
209
|
var Title = styledTitle(titleClassName, variant, title, titleWidth);
|
|
230
210
|
return /*#__PURE__*/_jsx(Title, {}, "step-title-".concat(rawTitle));
|
|
231
211
|
})
|
|
232
212
|
}) : null;
|
|
233
213
|
};
|
|
234
|
-
|
|
235
214
|
var StepNavigation = {
|
|
236
215
|
Default: HvDefaultNavigation,
|
|
237
216
|
Simple: HvSimpleNavigation
|
|
@@ -245,9 +224,8 @@ var HvStepNavigation = function HvStepNavigation(_ref) {
|
|
|
245
224
|
}, others)), {}, {
|
|
246
225
|
children: function children(_ref7) {
|
|
247
226
|
var stepsWidth = _ref7.stepsWidth,
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
227
|
+
navWidth = _ref7.navWidth,
|
|
228
|
+
itemsProps = _objectWithoutProperties(_ref7, _excluded3);
|
|
251
229
|
return /*#__PURE__*/_jsx(Typography, {
|
|
252
230
|
component: "nav",
|
|
253
231
|
style: {
|
|
@@ -259,13 +237,11 @@ var HvStepNavigation = function HvStepNavigation(_ref) {
|
|
|
259
237
|
}
|
|
260
238
|
}));
|
|
261
239
|
};
|
|
262
|
-
|
|
263
240
|
process.env.NODE_ENV !== "production" ? HvStepNavigation.propTypes = {
|
|
264
241
|
/**
|
|
265
242
|
* Class names to be applied.
|
|
266
243
|
*/
|
|
267
244
|
className: PropTypes.string,
|
|
268
|
-
|
|
269
245
|
/**
|
|
270
246
|
* A Jss Object used to override or extend the styles applied.
|
|
271
247
|
*/
|
|
@@ -274,33 +250,27 @@ process.env.NODE_ENV !== "production" ? HvStepNavigation.propTypes = {
|
|
|
274
250
|
* Styles applied to the component root class.
|
|
275
251
|
*/
|
|
276
252
|
root: PropTypes.string,
|
|
277
|
-
|
|
278
253
|
/**
|
|
279
254
|
* Styles applied to the li element.
|
|
280
255
|
*/
|
|
281
256
|
li: PropTypes.string,
|
|
282
|
-
|
|
283
257
|
/**
|
|
284
258
|
* Styles applied to the ol element.
|
|
285
259
|
*/
|
|
286
260
|
ol: PropTypes.string,
|
|
287
|
-
|
|
288
261
|
/**
|
|
289
262
|
* Styles applied to the separator element.
|
|
290
263
|
*/
|
|
291
264
|
separator: PropTypes.string,
|
|
292
|
-
|
|
293
265
|
/**
|
|
294
266
|
* Styles applied to the titles container element.
|
|
295
267
|
*/
|
|
296
268
|
titles: PropTypes.string
|
|
297
269
|
}).isRequired,
|
|
298
|
-
|
|
299
270
|
/**
|
|
300
271
|
* Type of step navigation. Values = {"Simple", "Default"}.
|
|
301
272
|
*/
|
|
302
273
|
type: PropTypes.oneOf(["Simple", "Default"]),
|
|
303
|
-
|
|
304
274
|
/**
|
|
305
275
|
* Steps to show on the component.
|
|
306
276
|
*/
|
|
@@ -309,39 +279,32 @@ process.env.NODE_ENV !== "production" ? HvStepNavigation.propTypes = {
|
|
|
309
279
|
* Class names to override styles on the step component.
|
|
310
280
|
*/
|
|
311
281
|
className: PropTypes.string,
|
|
312
|
-
|
|
313
282
|
/**
|
|
314
283
|
* Class names to override styles on the separator component after the step.
|
|
315
284
|
*/
|
|
316
285
|
separatorClassName: PropTypes.string,
|
|
317
|
-
|
|
318
286
|
/**
|
|
319
287
|
* Class names to override styles on the title component above the step.
|
|
320
288
|
*/
|
|
321
289
|
titleClassName: PropTypes.string,
|
|
322
|
-
|
|
323
290
|
/**
|
|
324
291
|
* Title of the step.
|
|
325
292
|
*/
|
|
326
293
|
title: PropTypes.string.isRequired,
|
|
327
|
-
|
|
328
294
|
/**
|
|
329
295
|
* State of the step. Values = {"Pending", "Failed", "Completed", "Current", "Disabled", "Enabled"}.
|
|
330
296
|
*/
|
|
331
297
|
state: PropTypes.oneOf(["Pending", "Failed", "Completed", "Current", "Disabled", "Enabled"]).isRequired,
|
|
332
|
-
|
|
333
298
|
/**
|
|
334
299
|
* Define if a step is disabled/enabled.
|
|
335
300
|
* If this property is not defined and the step is on state "Disabled", the step component will be disabled
|
|
336
301
|
*/
|
|
337
302
|
disabled: PropTypes.bool
|
|
338
303
|
})).isRequired,
|
|
339
|
-
|
|
340
304
|
/**
|
|
341
305
|
* Sets one of the standard sizes of the steps. Values = {"XS", "SM", "MD", "LG", "XL"}
|
|
342
306
|
*/
|
|
343
307
|
stepSize: PropTypes.oneOf(["XS", "SM", "MD", "LG", "XL"]),
|
|
344
|
-
|
|
345
308
|
/**
|
|
346
309
|
* Width of the component element on each breakpoint screen resolution.
|
|
347
310
|
*/
|
|
@@ -352,7 +315,6 @@ process.env.NODE_ENV !== "production" ? HvStepNavigation.propTypes = {
|
|
|
352
315
|
lg: PropTypes.number,
|
|
353
316
|
xl: PropTypes.number
|
|
354
317
|
}),
|
|
355
|
-
|
|
356
318
|
/**
|
|
357
319
|
* Defines either show a title or only a tooltip on each step component
|
|
358
320
|
*/
|
|
@@ -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,M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,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,IAAMC,gBAAgB,GAAG,SAAnBA,gBAAgB,OAShB;EAAA,IARJC,SAAS,QAATA,SAAS;IACTC,OAAO,QAAPA,OAAO;IACPC,KAAK,QAALA,KAAK;IACLC,KAAK,QAALA,KAAK;IACLC,QAAQ,QAARA,QAAQ;IACRC,UAAU,QAAVA,UAAU;IAAA,iBACVC,IAAI;IAAJA,IAAI,0BAAG,SAAS;IACbC,MAAM;EAET,IAAMC,KAAK,GAAGpB,QAAQ,EAAE;EACxB;EACA,IAAMqB,UAAU,GAAGjB,QAAQ,EAAE;EAC7B;EACA,IAAMkB,WAAW,GAAGN,QAAQ,aAARA,QAAQ,cAARA,QAAQ,GAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAACO,QAAQ,CAACF,UAAU,CAAC,GAAG,IAAI,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pF,QAAQ,EAAEpB,SAAS,CAACyG,KAAK,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;EACzD;AACF;AACA;EACEvF,KAAK,EAAElB,SAAS,CAACuG,KAAK,CAAC;IACrBM,EAAE,EAAE7G,SAAS,CAAC+D,MAAM;IACpB+C,EAAE,EAAE9G,SAAS,CAAC+D,MAAM;IACpBgD,EAAE,EAAE/G,SAAS,CAAC+D,MAAM;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,IAAMA,MAAM,GAAG,SAATA,
|
|
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,IAAMA,MAAM,GAAG,SAATA,MAAM;EAAA,OAAU;IACpBC,IAAI,EAAE;MACJC,OAAO,EAAE,MAAM;MACfC,aAAa,EAAE;IACjB,CAAC;IACDC,MAAM,EAAE;MACNF,OAAO,EAAE;IACX,CAAC;IACDG,EAAE,EAAE;MACFH,OAAO,EAAE,MAAM;MACfI,UAAU,EAAE,QAAQ;MACpBC,cAAc,EAAE,QAAQ;MACxBC,QAAQ,EAAE,MAAM;MAChBC,OAAO,EAAE,CAAC;MACVC,SAAS,EAAE;IACb,CAAC;IACDC,EAAE,EAAE;MACFT,OAAO,EAAE,MAAM;MACfI,UAAU,EAAE,QAAQ;MACpBC,cAAc,EAAE;IAClB,CAAC;IACDK,SAAS,EAAE;MACTC,UAAU,EAAE,MAAM;MAClB,SAAS,EAAE;QACTX,OAAO,EAAE;MACX;IACF;EACF,CAAC;AAAA,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,IAAMA,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,IAAMA,YAAY,GAAG,EAAE;AACvB,IAAMC,WAAW,GAAG,GAAG;AACvB,IAAMC,WAAW,GAAG,EAAE;AACtB,IAAMC,eAAe,GAAG,GAAG;AAE3B,SAASD,WAAW,EAAEF,YAAY,EAAEC,WAAW,EAAEE,eAAe"}
|
|
@@ -8,39 +8,34 @@ import "core-js/modules/es.object.get-own-property-descriptors.js";
|
|
|
8
8
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
9
9
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
10
10
|
var _excluded = ["classes", "timestamp", "locale", "component", "emptyElement", "disableRefresh", "showSeconds", "justText"];
|
|
11
|
-
|
|
12
11
|
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; }
|
|
13
|
-
|
|
14
12
|
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; }
|
|
15
|
-
|
|
16
13
|
import React from "react";
|
|
17
14
|
import PropTypes from "prop-types";
|
|
18
15
|
import { withStyles } from "@mui/styles";
|
|
19
16
|
import { HvTypography, useLocale } from "@hitachivantara/uikit-react-core";
|
|
20
17
|
import useTimeAgo from "./useTimeAgo";
|
|
21
18
|
import styles from "./styles";
|
|
19
|
+
|
|
22
20
|
/**
|
|
23
21
|
* The HvTimeAgo component implements the Design System relative time format guidelines.
|
|
24
22
|
*/
|
|
25
|
-
|
|
26
23
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
27
|
-
|
|
28
24
|
var HvTimeAgo = function HvTimeAgo(_ref) {
|
|
29
25
|
var classes = _ref.classes,
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
26
|
+
timestamp = _ref.timestamp,
|
|
27
|
+
localeProp = _ref.locale,
|
|
28
|
+
_ref$component = _ref.component,
|
|
29
|
+
Component = _ref$component === void 0 ? HvTypography : _ref$component,
|
|
30
|
+
_ref$emptyElement = _ref.emptyElement,
|
|
31
|
+
emptyElement = _ref$emptyElement === void 0 ? "—" : _ref$emptyElement,
|
|
32
|
+
_ref$disableRefresh = _ref.disableRefresh,
|
|
33
|
+
disableRefresh = _ref$disableRefresh === void 0 ? false : _ref$disableRefresh,
|
|
34
|
+
_ref$showSeconds = _ref.showSeconds,
|
|
35
|
+
showSeconds = _ref$showSeconds === void 0 ? false : _ref$showSeconds,
|
|
36
|
+
_ref$justText = _ref.justText,
|
|
37
|
+
justText = _ref$justText === void 0 ? false : _ref$justText,
|
|
38
|
+
others = _objectWithoutProperties(_ref, _excluded);
|
|
44
39
|
var contextLocale = useLocale();
|
|
45
40
|
var locale = localeProp || contextLocale;
|
|
46
41
|
var timeAgo = useTimeAgo(timestamp, {
|
|
@@ -55,7 +50,6 @@ var HvTimeAgo = function HvTimeAgo(_ref) {
|
|
|
55
50
|
children: !timestamp ? emptyElement : timeAgo
|
|
56
51
|
}));
|
|
57
52
|
};
|
|
58
|
-
|
|
59
53
|
process.env.NODE_ENV !== "production" ? HvTimeAgo.propTypes = {
|
|
60
54
|
/**
|
|
61
55
|
* A Jss Object used to override or extend the styles applied.
|
|
@@ -66,40 +60,33 @@ process.env.NODE_ENV !== "production" ? HvTimeAgo.propTypes = {
|
|
|
66
60
|
*/
|
|
67
61
|
root: PropTypes.string
|
|
68
62
|
}),
|
|
69
|
-
|
|
70
63
|
/**
|
|
71
64
|
* The timestamp to format, in seconds
|
|
72
65
|
*/
|
|
73
66
|
timestamp: PropTypes.number,
|
|
74
|
-
|
|
75
67
|
/**
|
|
76
68
|
* The locale to be used. Should be on of the dayjs supported locales
|
|
77
69
|
* @see https://day.js.org/docs/en/i18n/i18n
|
|
78
70
|
*/
|
|
79
71
|
locale: PropTypes.string,
|
|
80
|
-
|
|
81
72
|
/**
|
|
82
73
|
* The component used for the root node. Either a string to use a HTML element or a component.
|
|
83
74
|
* Defaults to `div`.
|
|
84
75
|
*/
|
|
85
76
|
component: PropTypes.elementType,
|
|
86
|
-
|
|
87
77
|
/**
|
|
88
78
|
* The element to render when the timestamp is null or 0
|
|
89
79
|
* Defaults to `—` (Em Dash)
|
|
90
80
|
*/
|
|
91
81
|
emptyElement: PropTypes.node,
|
|
92
|
-
|
|
93
82
|
/**
|
|
94
83
|
* Disables periodic date refreshes
|
|
95
84
|
*/
|
|
96
85
|
disableRefresh: PropTypes.bool,
|
|
97
|
-
|
|
98
86
|
/**
|
|
99
87
|
* Whether to show seconds in the rendered time
|
|
100
88
|
*/
|
|
101
89
|
showSeconds: PropTypes.bool,
|
|
102
|
-
|
|
103
90
|
/**
|
|
104
91
|
* Whether the component should render just the string
|
|
105
92
|
* Consider using `useTimeAgo` instead
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TimeAgo.js","names":["React","PropTypes","withStyles","HvTypography","useLocale","useTimeAgo","styles","HvTimeAgo","classes","timestamp","localeProp","locale","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","localeProp","locale","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,IAAMC,SAAS,GAAG,SAAZA,SAAS,OAUT;EAAA,IATJC,OAAO,QAAPA,OAAO;IACPC,SAAS,QAATA,SAAS;IACDC,UAAU,QAAlBC,MAAM;IAAA,sBACNC,SAAS;IAAEC,SAAS,+BAAGV,YAAY;IAAA,yBACnCW,YAAY;IAAZA,YAAY,kCAAG,GAAG;IAAA,2BAClBC,cAAc;IAAdA,cAAc,oCAAG,KAAK;IAAA,wBACtBC,WAAW;IAAXA,WAAW,iCAAG,KAAK;IAAA,qBACnBC,QAAQ;IAARA,QAAQ,8BAAG,KAAK;IACbC,MAAM;EAET,IAAMC,aAAa,GAAGf,SAAS,EAAE;EACjC,IAAMO,MAAM,GAAGD,UAAU,IAAIS,aAAa;EAC1C,IAAMC,OAAO,GAAGf,UAAU,CAACI,SAAS,EAAE;IAAEE,MAAM,EAANA,MAAM;IAAEI,cAAc,EAAdA,cAAc;IAAEC,WAAW,EAAXA;EAAY,CAAC,CAAC;EAE9E,IAAIC,QAAQ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