@x15ventures/x15-ui-library 3.16.1 → 3.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/autoGenerated/libraryThemes.js +12 -12
- package/dist/cjs/autoGenerated/libraryThemes.js.map +1 -1
- package/dist/cjs/autoGenerated/libraryThemes.json +12 -12
- package/dist/cjs/components/design/accordion/Accordion.js +7 -23
- package/dist/cjs/components/design/accordion/Accordion.js.map +1 -1
- package/dist/cjs/components/design/banners/pageBanner/PageBanner.js +2 -4
- package/dist/cjs/components/design/banners/pageBanner/PageBanner.js.map +1 -1
- package/dist/cjs/components/design/card/cardContent/CardContentLine.js +2 -2
- package/dist/cjs/components/design/card/cardContent/CardContentLine.js.map +1 -1
- package/dist/cjs/components/design/card/cardHeader/CardHeaderItem.js +2 -2
- package/dist/cjs/components/design/card/cardHeader/CardHeaderItem.js.map +1 -1
- package/dist/cjs/components/design/dialog/Dialog.js +3 -1
- package/dist/cjs/components/design/dialog/Dialog.js.map +1 -1
- package/dist/cjs/components/design/dialog/dialog.css +5 -0
- package/dist/cjs/components/design/headerBar/HeaderBar.js +3 -3
- package/dist/cjs/components/design/headerBar/HeaderBar.js.map +1 -1
- package/dist/cjs/components/design/icons/notificationIcon/NotificationIcon.js +4 -5
- package/dist/cjs/components/design/icons/notificationIcon/NotificationIcon.js.map +1 -1
- package/dist/cjs/components/design/paginators/Paginator.js +4 -12
- package/dist/cjs/components/design/paginators/Paginator.js.map +1 -1
- package/dist/cjs/components/design/progressIndicators/circularProgressIndicator/CircularProgressIndicator.js +89 -0
- package/dist/cjs/components/design/progressIndicators/circularProgressIndicator/CircularProgressIndicator.js.map +1 -0
- package/dist/cjs/components/design/progressIndicators/circularProgressIndicator/circularProgressIndicator.css +301 -0
- package/dist/cjs/components/design/revealMore/RevealMoreBelow.js +1 -3
- package/dist/cjs/components/design/revealMore/RevealMoreBelow.js.map +1 -1
- package/dist/cjs/components/design/revealMore/RevealMoreInline.js +3 -5
- package/dist/cjs/components/design/revealMore/RevealMoreInline.js.map +1 -1
- package/dist/cjs/components/design/revealMore/types/revealMoreTypes.js.map +1 -1
- package/dist/cjs/components/design/sidePanel/SidePanel.js +3 -5
- package/dist/cjs/components/design/sidePanel/SidePanel.js.map +1 -1
- package/dist/cjs/components/design/statusIndicators/statusIconLabel/StatusIconLabel.js +6 -11
- package/dist/cjs/components/design/statusIndicators/statusIconLabel/StatusIconLabel.js.map +1 -1
- package/dist/cjs/components/design/tabs/Tabs.js +2 -2
- package/dist/cjs/components/design/tabs/Tabs.js.map +1 -1
- package/dist/cjs/components/design/themeLoader/ThemeLoader.js +2 -2
- package/dist/cjs/components/design/themeLoader/ThemeLoader.js.map +1 -1
- package/dist/cjs/components/design/tooltip/Tooltip.js +43 -13
- package/dist/cjs/components/design/tooltip/Tooltip.js.map +1 -1
- package/dist/cjs/components/design/tooltip/index.js +6 -0
- package/dist/cjs/components/design/tooltip/index.js.map +1 -1
- package/dist/cjs/components/design/tooltip/tooltip.css +18 -7
- package/dist/cjs/components/form/buttons/SimpleButton.js +3 -3
- package/dist/cjs/components/form/buttons/SimpleButton.js.map +1 -1
- package/dist/cjs/components/form/buttons/button.interface.js.map +1 -1
- package/dist/cjs/components/form/formFields/formFieldWrapper/formFieldProps.js.map +1 -1
- package/dist/cjs/components/form/formFields/subComponents/inputs/checkbox/InputCheckbox.js +5 -5
- package/dist/cjs/components/form/formFields/subComponents/inputs/checkbox/InputCheckbox.js.map +1 -1
- package/dist/cjs/components/form/formFields/subComponents/inputs/checkbox/checkboxSwitch/CheckboxSwitch.js +176 -0
- package/dist/cjs/components/form/formFields/subComponents/inputs/checkbox/checkboxSwitch/CheckboxSwitch.js.map +1 -0
- package/dist/cjs/components/form/formFields/subComponents/inputs/checkbox/checkboxSwitch/_checkboxSwitchVariables.css +0 -0
- package/dist/cjs/components/form/formFields/subComponents/inputs/checkbox/checkboxSwitch/checkboxSwitch.css +306 -0
- package/dist/cjs/components/form/formFields/subComponents/inputs/checkbox/checkboxSwitch/checkboxSwitchProps.js +6 -0
- package/dist/cjs/components/form/formFields/subComponents/inputs/checkbox/checkboxSwitch/checkboxSwitchProps.js.map +1 -0
- package/dist/cjs/components/form/formFields/subComponents/inputs/checkbox/inputCheckboxProps.js.map +1 -1
- package/dist/cjs/components/form/formFields/subComponents/inputs/file/dragAndDrop/DragAndDropFileUpload.js +3 -5
- package/dist/cjs/components/form/formFields/subComponents/inputs/file/dragAndDrop/DragAndDropFileUpload.js.map +1 -1
- package/dist/cjs/components/form/formFields/subComponents/inputs/file/fileAttachmentList/FileAttachmentsList.js +12 -22
- package/dist/cjs/components/form/formFields/subComponents/inputs/file/fileAttachmentList/FileAttachmentsList.js.map +1 -1
- package/dist/cjs/components/form/formFields/subComponents/inputs/file/fileInputProps.js.map +1 -1
- package/dist/cjs/components/index.js +14 -0
- package/dist/cjs/components/index.js.map +1 -1
- package/dist/cjs/components/navigation/menu/Menu.interfaces.js.map +1 -1
- package/dist/cjs/components/navigation/menu/menuItemContent/MenuItemIcon.js +19 -31
- package/dist/cjs/components/navigation/menu/menuItemContent/MenuItemIcon.js.map +1 -1
- package/dist/cjs/helpers/iconHelpers.js +83 -0
- package/dist/cjs/helpers/iconHelpers.js.map +1 -0
- package/dist/cjs/helpers/index.js +43 -0
- package/dist/cjs/helpers/index.js.map +1 -1
- package/dist/cjs/helpers/objectHelpers.js +9 -2
- package/dist/cjs/helpers/objectHelpers.js.map +1 -1
- package/dist/cjs/hooks/InteractiveHostFocus.js +62 -0
- package/dist/cjs/hooks/InteractiveHostFocus.js.map +1 -0
- package/dist/cjs/hooks/index.js +7 -0
- package/dist/cjs/hooks/index.js.map +1 -1
- package/dist/cjs/index.js +79 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/interfaces/headerText.interface.js.map +1 -1
- package/dist/cjs/package.json +16 -28
- package/dist/cjs/styles/index.css +61 -0
- package/dist/cjs/styles/storybook/storybook.css +7 -0
- package/dist/cjs/styles/variables/cssVars/_darkModeVariables.css +21 -0
- package/dist/cjs/styles/variables/cssVars/_formVariables.css +40 -0
- package/dist/cjs/widgets/index.js +14 -0
- package/dist/cjs/widgets/index.js.map +1 -0
- package/dist/cjs/widgets/processLauncher/ProcessLauncher.js +272 -0
- package/dist/cjs/widgets/processLauncher/ProcessLauncher.js.map +1 -0
- package/dist/cjs/widgets/processLauncher/index.js +13 -0
- package/dist/cjs/widgets/processLauncher/index.js.map +1 -0
- package/dist/cjs/widgets/processLauncher/processLauncher.interfaces.js +6 -0
- package/dist/cjs/widgets/processLauncher/processLauncher.interfaces.js.map +1 -0
- package/dist/components/design/accordion/Accordion.d.ts +3 -2
- package/dist/components/design/accordion/Accordion.d.ts.map +1 -1
- package/dist/components/design/banners/pageBanner/PageBanner.d.ts +2 -1
- package/dist/components/design/banners/pageBanner/PageBanner.d.ts.map +1 -1
- package/dist/components/design/card/cardContent/CardContentLine.d.ts +2 -2
- package/dist/components/design/card/cardContent/CardContentLine.d.ts.map +1 -1
- package/dist/components/design/card/cardHeader/CardHeaderItem.d.ts +2 -2
- package/dist/components/design/card/cardHeader/CardHeaderItem.d.ts.map +1 -1
- package/dist/components/design/dialog/Dialog.d.ts.map +1 -1
- package/dist/components/design/headerBar/HeaderBar.d.ts.map +1 -1
- package/dist/components/design/icons/notificationIcon/NotificationIcon.d.ts +2 -2
- package/dist/components/design/icons/notificationIcon/NotificationIcon.d.ts.map +1 -1
- package/dist/components/design/paginators/Paginator.d.ts +3 -2
- package/dist/components/design/paginators/Paginator.d.ts.map +1 -1
- package/dist/components/design/progressIndicators/circularProgressIndicator/CircularProgressIndicator.d.ts +18 -0
- package/dist/components/design/progressIndicators/circularProgressIndicator/CircularProgressIndicator.d.ts.map +1 -0
- package/dist/components/design/progressIndicators/circularProgressIndicator/CircularProgressIndicator.test.d.ts +5 -0
- package/dist/components/design/progressIndicators/circularProgressIndicator/CircularProgressIndicator.test.d.ts.map +1 -0
- package/dist/components/design/revealMore/RevealMoreBelow.d.ts.map +1 -1
- package/dist/components/design/revealMore/RevealMoreInline.d.ts.map +1 -1
- package/dist/components/design/revealMore/types/revealMoreTypes.d.ts +3 -2
- package/dist/components/design/revealMore/types/revealMoreTypes.d.ts.map +1 -1
- package/dist/components/design/sidePanel/SidePanel.d.ts +3 -2
- package/dist/components/design/sidePanel/SidePanel.d.ts.map +1 -1
- package/dist/components/design/statusIndicators/statusIconLabel/StatusIconLabel.d.ts +2 -2
- package/dist/components/design/statusIndicators/statusIconLabel/StatusIconLabel.d.ts.map +1 -1
- package/dist/components/design/tabs/Tabs.d.ts +3 -3
- package/dist/components/design/tabs/Tabs.d.ts.map +1 -1
- package/dist/components/design/tooltip/Tooltip.d.ts +17 -3
- package/dist/components/design/tooltip/Tooltip.d.ts.map +1 -1
- package/dist/components/design/tooltip/Tooltip.test.d.ts +1 -1
- package/dist/components/design/tooltip/Tooltip.test.d.ts.map +1 -1
- package/dist/components/design/tooltip/index.d.ts +1 -1
- package/dist/components/design/tooltip/index.d.ts.map +1 -1
- package/dist/components/form/buttons/SimpleButton.test.d.ts +5 -0
- package/dist/components/form/buttons/SimpleButton.test.d.ts.map +1 -0
- package/dist/components/form/buttons/button.interface.d.ts +3 -3
- package/dist/components/form/buttons/button.interface.d.ts.map +1 -1
- package/dist/components/form/formFields/formFieldWrapper/formFieldProps.d.ts +2 -1
- package/dist/components/form/formFields/formFieldWrapper/formFieldProps.d.ts.map +1 -1
- package/dist/components/form/formFields/subComponents/inputs/checkbox/checkboxSwitch/CheckboxSwitch.d.ts +29 -0
- package/dist/components/form/formFields/subComponents/inputs/checkbox/checkboxSwitch/CheckboxSwitch.d.ts.map +1 -0
- package/dist/components/form/formFields/subComponents/inputs/checkbox/checkboxSwitch/CheckboxSwitch.test.d.ts +5 -0
- package/dist/components/form/formFields/subComponents/inputs/checkbox/checkboxSwitch/CheckboxSwitch.test.d.ts.map +1 -0
- package/dist/components/form/formFields/subComponents/inputs/checkbox/checkboxSwitch/checkboxSwitchProps.d.ts +52 -0
- package/dist/components/form/formFields/subComponents/inputs/checkbox/checkboxSwitch/checkboxSwitchProps.d.ts.map +1 -0
- package/dist/components/form/formFields/subComponents/inputs/checkbox/inputCheckboxProps.d.ts +3 -3
- package/dist/components/form/formFields/subComponents/inputs/checkbox/inputCheckboxProps.d.ts.map +1 -1
- package/dist/components/form/formFields/subComponents/inputs/file/fileAttachmentList/FileAttachmentsList.d.ts.map +1 -1
- package/dist/components/form/formFields/subComponents/inputs/file/fileInputProps.d.ts +4 -3
- package/dist/components/form/formFields/subComponents/inputs/file/fileInputProps.d.ts.map +1 -1
- package/dist/components/index.d.ts +4 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/navigation/menu/Menu.interfaces.d.ts +4 -3
- package/dist/components/navigation/menu/Menu.interfaces.d.ts.map +1 -1
- package/dist/components/navigation/menu/menuItemContent/MenuItemIcon.d.ts +2 -1
- package/dist/components/navigation/menu/menuItemContent/MenuItemIcon.d.ts.map +1 -1
- package/dist/components/navigation/menu/menuItemContent/MenuItemIcon.test.d.ts +5 -0
- package/dist/components/navigation/menu/menuItemContent/MenuItemIcon.test.d.ts.map +1 -0
- package/dist/esm/autoGenerated/libraryThemes.js +12 -12
- package/dist/esm/autoGenerated/libraryThemes.js.map +1 -1
- package/dist/esm/autoGenerated/libraryThemes.json +12 -12
- package/dist/esm/components/design/accordion/Accordion.js +7 -23
- package/dist/esm/components/design/accordion/Accordion.js.map +1 -1
- package/dist/esm/components/design/banners/pageBanner/PageBanner.js +2 -4
- package/dist/esm/components/design/banners/pageBanner/PageBanner.js.map +1 -1
- package/dist/esm/components/design/card/cardContent/CardContentLine.js +2 -2
- package/dist/esm/components/design/card/cardContent/CardContentLine.js.map +1 -1
- package/dist/esm/components/design/card/cardHeader/CardHeaderItem.js +2 -2
- package/dist/esm/components/design/card/cardHeader/CardHeaderItem.js.map +1 -1
- package/dist/esm/components/design/dialog/Dialog.js +3 -1
- package/dist/esm/components/design/dialog/Dialog.js.map +1 -1
- package/dist/esm/components/design/dialog/dialog.css +5 -0
- package/dist/esm/components/design/headerBar/HeaderBar.js +3 -3
- package/dist/esm/components/design/headerBar/HeaderBar.js.map +1 -1
- package/dist/esm/components/design/icons/notificationIcon/NotificationIcon.js +4 -5
- package/dist/esm/components/design/icons/notificationIcon/NotificationIcon.js.map +1 -1
- package/dist/esm/components/design/paginators/Paginator.js +4 -12
- package/dist/esm/components/design/paginators/Paginator.js.map +1 -1
- package/dist/esm/components/design/progressIndicators/circularProgressIndicator/CircularProgressIndicator.js +82 -0
- package/dist/esm/components/design/progressIndicators/circularProgressIndicator/CircularProgressIndicator.js.map +1 -0
- package/dist/esm/components/design/progressIndicators/circularProgressIndicator/circularProgressIndicator.css +301 -0
- package/dist/esm/components/design/revealMore/RevealMoreBelow.js +1 -3
- package/dist/esm/components/design/revealMore/RevealMoreBelow.js.map +1 -1
- package/dist/esm/components/design/revealMore/RevealMoreInline.js +2 -4
- package/dist/esm/components/design/revealMore/RevealMoreInline.js.map +1 -1
- package/dist/esm/components/design/revealMore/types/revealMoreTypes.js.map +1 -1
- package/dist/esm/components/design/sidePanel/SidePanel.js +3 -5
- package/dist/esm/components/design/sidePanel/SidePanel.js.map +1 -1
- package/dist/esm/components/design/statusIndicators/statusIconLabel/StatusIconLabel.js +6 -11
- package/dist/esm/components/design/statusIndicators/statusIconLabel/StatusIconLabel.js.map +1 -1
- package/dist/esm/components/design/tabs/Tabs.js +2 -2
- package/dist/esm/components/design/tabs/Tabs.js.map +1 -1
- package/dist/esm/components/design/themeLoader/ThemeLoader.js +1 -1
- package/dist/esm/components/design/themeLoader/ThemeLoader.js.map +1 -1
- package/dist/esm/components/design/tooltip/Tooltip.js +41 -12
- package/dist/esm/components/design/tooltip/Tooltip.js.map +1 -1
- package/dist/esm/components/design/tooltip/index.js +1 -1
- package/dist/esm/components/design/tooltip/index.js.map +1 -1
- package/dist/esm/components/design/tooltip/tooltip.css +18 -7
- package/dist/esm/components/form/buttons/SimpleButton.js +3 -3
- package/dist/esm/components/form/buttons/SimpleButton.js.map +1 -1
- package/dist/esm/components/form/buttons/button.interface.js.map +1 -1
- package/dist/esm/components/form/formFields/formFieldWrapper/formFieldProps.js.map +1 -1
- package/dist/esm/components/form/formFields/subComponents/inputs/checkbox/InputCheckbox.js +5 -5
- package/dist/esm/components/form/formFields/subComponents/inputs/checkbox/InputCheckbox.js.map +1 -1
- package/dist/esm/components/form/formFields/subComponents/inputs/checkbox/checkboxSwitch/CheckboxSwitch.js +167 -0
- package/dist/esm/components/form/formFields/subComponents/inputs/checkbox/checkboxSwitch/CheckboxSwitch.js.map +1 -0
- package/dist/esm/components/form/formFields/subComponents/inputs/checkbox/checkboxSwitch/_checkboxSwitchVariables.css +0 -0
- package/dist/esm/components/form/formFields/subComponents/inputs/checkbox/checkboxSwitch/checkboxSwitch.css +306 -0
- package/dist/esm/components/form/formFields/subComponents/inputs/checkbox/checkboxSwitch/checkboxSwitchProps.js +2 -0
- package/dist/esm/components/form/formFields/subComponents/inputs/checkbox/checkboxSwitch/checkboxSwitchProps.js.map +1 -0
- package/dist/esm/components/form/formFields/subComponents/inputs/checkbox/inputCheckboxProps.js.map +1 -1
- package/dist/esm/components/form/formFields/subComponents/inputs/file/dragAndDrop/DragAndDropFileUpload.js +3 -5
- package/dist/esm/components/form/formFields/subComponents/inputs/file/dragAndDrop/DragAndDropFileUpload.js.map +1 -1
- package/dist/esm/components/form/formFields/subComponents/inputs/file/fileAttachmentList/FileAttachmentsList.js +12 -22
- package/dist/esm/components/form/formFields/subComponents/inputs/file/fileAttachmentList/FileAttachmentsList.js.map +1 -1
- package/dist/esm/components/form/formFields/subComponents/inputs/file/fileInputProps.js.map +1 -1
- package/dist/esm/components/index.js +2 -0
- package/dist/esm/components/index.js.map +1 -1
- package/dist/esm/components/navigation/menu/Menu.interfaces.js.map +1 -1
- package/dist/esm/components/navigation/menu/menuItemContent/MenuItemIcon.js +17 -30
- package/dist/esm/components/navigation/menu/menuItemContent/MenuItemIcon.js.map +1 -1
- package/dist/esm/helpers/iconHelpers.js +73 -0
- package/dist/esm/helpers/iconHelpers.js.map +1 -0
- package/dist/esm/helpers/index.js +2 -1
- package/dist/esm/helpers/index.js.map +1 -1
- package/dist/esm/helpers/objectHelpers.js +7 -3
- package/dist/esm/helpers/objectHelpers.js.map +1 -1
- package/dist/esm/hooks/InteractiveHostFocus.js +56 -0
- package/dist/esm/hooks/InteractiveHostFocus.js.map +1 -0
- package/dist/esm/hooks/index.js +1 -0
- package/dist/esm/hooks/index.js.map +1 -1
- package/dist/esm/index.js +5 -4
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/interfaces/headerText.interface.js.map +1 -1
- package/dist/esm/package.json +16 -28
- package/dist/esm/styles/index.css +61 -0
- package/dist/esm/styles/storybook/storybook.css +7 -0
- package/dist/esm/styles/variables/cssVars/_darkModeVariables.css +21 -0
- package/dist/esm/styles/variables/cssVars/_formVariables.css +40 -0
- package/dist/esm/widgets/index.js +4 -0
- package/dist/esm/widgets/index.js.map +1 -0
- package/dist/esm/widgets/processLauncher/ProcessLauncher.js +263 -0
- package/dist/esm/widgets/processLauncher/ProcessLauncher.js.map +1 -0
- package/dist/esm/widgets/processLauncher/index.js +2 -0
- package/dist/esm/widgets/processLauncher/index.js.map +1 -0
- package/dist/esm/widgets/processLauncher/processLauncher.interfaces.js +2 -0
- package/dist/esm/widgets/processLauncher/processLauncher.interfaces.js.map +1 -0
- package/dist/helpers/iconHelpers.d.ts +30 -0
- package/dist/helpers/iconHelpers.d.ts.map +1 -0
- package/dist/helpers/iconHelpers.test.d.ts +5 -0
- package/dist/helpers/iconHelpers.test.d.ts.map +1 -0
- package/dist/helpers/index.d.ts +4 -1
- package/dist/helpers/index.d.ts.map +1 -1
- package/dist/helpers/objectHelpers.d.ts +10 -3
- package/dist/helpers/objectHelpers.d.ts.map +1 -1
- package/dist/hooks/InteractiveHostFocus.d.ts +12 -0
- package/dist/hooks/InteractiveHostFocus.d.ts.map +1 -0
- package/dist/hooks/InteractiveHostFocus.test.d.ts +5 -0
- package/dist/hooks/InteractiveHostFocus.test.d.ts.map +1 -0
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/index.d.ts +9 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/interfaces/headerText.interface.d.ts +3 -3
- package/dist/interfaces/headerText.interface.d.ts.map +1 -1
- package/dist/package.json +16 -28
- package/dist/widgets/index.d.ts +3 -0
- package/dist/widgets/index.d.ts.map +1 -0
- package/dist/widgets/processLauncher/ProcessLauncher.d.ts +21 -0
- package/dist/widgets/processLauncher/ProcessLauncher.d.ts.map +1 -0
- package/dist/widgets/processLauncher/ProcessLauncher.test.d.ts +5 -0
- package/dist/widgets/processLauncher/ProcessLauncher.test.d.ts.map +1 -0
- package/dist/widgets/processLauncher/index.d.ts +4 -0
- package/dist/widgets/processLauncher/index.d.ts.map +1 -0
- package/dist/widgets/processLauncher/processLauncher.interfaces.d.ts +45 -0
- package/dist/widgets/processLauncher/processLauncher.interfaces.d.ts.map +1 -0
- package/package.json +16 -28
- package/readme.md +0 -36
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Paginator.js","names":["React","useEffect","useRef","useState","SimpleButton","SelectDropdown","Paginator","id","page","totalPages","pageSize","allowPageSizeChange","onPageChange","onPageSizeChange","paginationType","paginatorPosition","buttonConfig","maxButtonsVisible","displayedButtonLimit","setDisplayedButtonLimit","activePage","setActivePage","isPageSizeChangeAllowed","setIsPageSizeChangeAllowed","pageNumberButtonsVisible","setPageNumberButtonsVisible","Array","from","length","_","i","lowestPageNumberVisible","highestPageNumberVisible","pageSizeChangePosition","isNonNullPrevIcon","previousButton","icon","isNonNullNextIcon","nextButton","isNonNullFirstIcon","firstButton","isNonNullLastIcon","lastButton","updateVisiblePageNumbers","newPage","current","newVisiblePages","filter","pageNum","resetVisiblePageNumbers","handlePageChange","handlePageSizeChange","event","Number","target","value","requiresPagination","pageSizeChange","createElement","className","field","name","options","label","includeEmptyOption","defaultValue","onChange","text","layout","customCssClasses","wrapper","Fragment","disabled","onClickHandler","leftIcon","undefined","hideLabel","buttonStyle","size","map","pageNumber","key","String","rightIcon"],"sources":["../../../../../src/components/design/paginators/Paginator.tsx"],"sourcesContent":["'use client';\n\nimport React, { ReactElement, useEffect, useRef, useState } from 'react';\nimport { SimpleButton } from '../../form/buttons/SimpleButton';\nimport { SelectDropdown } from '../../form/formFields/subComponents/InputVariants';\nimport { GenericFunction } from '../../../interfaces/generic.interface';\n\nimport './paginator.scss';\n\nexport interface IconLabelProp {\n icon?: string | ReactElement | null;\n label?: string | null;\n}\n\nexport interface PaginatorProps {\n id: string;\n page: number;\n totalPages: number;\n pageSize: number;\n onPageChange: GenericFunction;\n allowPageSizeChange?: boolean;\n onPageSizeChange?: GenericFunction;\n paginationType?: 'buttons' | 'showMore';\n paginatorPosition?: 'left' | 'right' | 'center';\n buttonConfig?: {\n previousButton?: IconLabelProp;\n nextButton?: IconLabelProp;\n firstButton?: IconLabelProp;\n lastButton?: IconLabelProp;\n };\n maxButtonsVisible?: number;\n}\n\nexport const Paginator: React.FC<PaginatorProps> = (\n {\n id,\n page,\n totalPages,\n pageSize = 20,\n allowPageSizeChange,\n onPageChange,\n onPageSizeChange,\n paginationType = 'buttons',\n paginatorPosition = paginationType === 'showMore' ? 'center' : 'right',\n buttonConfig,\n maxButtonsVisible = 5,\n }\n) => {\n\n const [displayedButtonLimit, setDisplayedButtonLimit] = useState<number>(maxButtonsVisible > totalPages ? totalPages : maxButtonsVisible);\n const [activePage, setActivePage] = useState(0);\n const [isPageSizeChangeAllowed, setIsPageSizeChangeAllowed] = useState<boolean>(false);\n const [pageNumberButtonsVisible, setPageNumberButtonsVisible] = useState<number[]>(Array.from({ length: displayedButtonLimit }, (_, i) => i + 1));\n \n const lowestPageNumberVisible = useRef(1);\n const highestPageNumberVisible = useRef(displayedButtonLimit);\n\n const pageSizeChangePosition = paginatorPosition === 'center' ? 'right' : paginatorPosition === 'right' ? 'left' : 'right';\n\n const isNonNullPrevIcon = buttonConfig?.previousButton?.icon !== null;\n const isNonNullNextIcon = buttonConfig?.nextButton?.icon !== null;\n const isNonNullFirstIcon = buttonConfig?.firstButton?.icon !== null;\n const isNonNullLastIcon = buttonConfig?.lastButton?.icon !== null;\n\n const updateVisiblePageNumbers = (newPage: number) => {\n if (newPage >= lowestPageNumberVisible.current && newPage <= highestPageNumberVisible.current) {\n return;\n }\n if (newPage < lowestPageNumberVisible.current) {\n lowestPageNumberVisible.current = newPage;\n highestPageNumberVisible.current = newPage + displayedButtonLimit - 1;\n } else if (newPage > highestPageNumberVisible.current) {\n highestPageNumberVisible.current = newPage;\n lowestPageNumberVisible.current = newPage - displayedButtonLimit + 1;\n }\n\n const newVisiblePages = Array.from({ length: displayedButtonLimit }, (_, i) => lowestPageNumberVisible.current + i).filter((pageNum) => pageNum >= 1 && pageNum <= totalPages);\n\n setPageNumberButtonsVisible(newVisiblePages);\n };\n\n // ensure lowest and highest visible page numbers are within a valid range\n const resetVisiblePageNumbers = (page: number) => {\n lowestPageNumberVisible.current = 1;\n highestPageNumberVisible.current = displayedButtonLimit;\n\n const newVisiblePages = Array.from({ length: displayedButtonLimit }, (_, i) => i + 1).filter((pageNum) => pageNum >= 1 && pageNum <= totalPages);\n\n setPageNumberButtonsVisible(newVisiblePages);\n updateVisiblePageNumbers(page);\n };\n\n const handlePageChange = (newPage: number) => {\n if (newPage < 1 || newPage > totalPages) {\n return;\n }\n setActivePage(newPage);\n onPageChange(newPage);\n updateVisiblePageNumbers(newPage);\n };\n\n const handlePageSizeChange = (event: React.ChangeEvent<HTMLSelectElement>) => {\n onPageSizeChange && onPageSizeChange(Number(event.target.value));\n };\n\n const requiresPagination = () => {\n if (paginationType === 'buttons') {\n return totalPages > 1;\n }\n\n if (paginationType === 'showMore') {\n return page < totalPages;\n }\n return false;\n };\n\n useEffect(() => {\n const newPage = page > totalPages ? totalPages : page < 1 ? 1 : page;\n if (newPage !== page) {\n onPageChange(newPage);\n }\n setActivePage(newPage);\n if (newPage < lowestPageNumberVisible.current || newPage > highestPageNumberVisible.current || displayedButtonLimit !== pageNumberButtonsVisible.length) {\n resetVisiblePageNumbers(newPage);\n }\n setIsPageSizeChangeAllowed(allowPageSizeChange === true && paginationType === 'buttons');\n }, [page, totalPages, displayedButtonLimit]);\n\n useEffect(() => {\n setDisplayedButtonLimit(maxButtonsVisible > totalPages ? totalPages : maxButtonsVisible);\n }, [totalPages, maxButtonsVisible]);\n\n if (!requiresPagination()) {\n return null;\n }\n\n const pageSizeChange = () => ( \n <div className=\"pageSizeChangeContainer\">\n <SelectDropdown {\n ...{\n field: {\n id: `paginator_${ id }_pageSizeChange`,\n name: `paginator_${ id }_pageSizeChange`,\n options: [\n {\n label: '10',\n value: 10,\n },\n {\n label: '20',\n value: 20,\n },\n {\n label: '50',\n value: 50,\n },\n {\n label: '100',\n value: 100,\n },\n ],\n includeEmptyOption: false,\n defaultValue: pageSize,\n onChange: handlePageSizeChange,\n },\n label: {\n text: 'Items per page',\n },\n layout: 'horizontal',\n customCssClasses: {\n wrapper: 'pageSizeChange',\n }\n }\n }\n />\n </div>\n );\n\n return (\n <div id={ `paginator_${ id }` } className={ `paginator ${ paginationType } position_${ paginatorPosition } ${ isPageSizeChangeAllowed ? 'withPageSizeChange' : '' }` }>\n { paginationType === 'buttons' && (\n <>\n { isPageSizeChangeAllowed && pageSizeChangePosition === 'left' && pageSizeChange() }\n <div className=\"paginatorControls\">\n\n <SimpleButton\n id={ `paginator_${ id }_first` }\n disabled={ activePage === 1 }\n onClickHandler={ () => handlePageChange(1) }\n leftIcon={ isNonNullFirstIcon ? { icon: buttonConfig?.firstButton?.icon || 'first' } : undefined }\n hideLabel={ buttonConfig?.firstButton?.label ? false : true }\n label={ buttonConfig?.firstButton?.label || 'Go to first item' }\n buttonStyle={ { size: 'compact' } }\n />\n <SimpleButton\n id={ `paginator_${ id }_previous` }\n disabled={ activePage === 1 }\n onClickHandler={ () => handlePageChange(activePage - 1) }\n leftIcon={ isNonNullPrevIcon ? { icon: buttonConfig?.previousButton?.icon || 'previous2' } : undefined }\n hideLabel={ buttonConfig?.previousButton?.label ? false : true }\n label={ buttonConfig?.previousButton?.label || `Show previous ${ pageSize } items` }\n buttonStyle={ { size: 'compact' } }\n />\n\n <div className=\"paginatorPageButtonsWrapper\">\n <div className=\"paginatorPageButtonsScroller\">\n <div className=\"paginatorPageButtons\">\n {\n pageNumberButtonsVisible.map((pageNumber) => (\n <SimpleButton\n key={ `paginator_${ id }_page_${ pageNumber }` }\n id={ `paginator_${ id }_page_${ pageNumber }` }\n disabled={ activePage === pageNumber }\n onClickHandler={ () => handlePageChange(pageNumber) }\n label={ String(pageNumber) }\n buttonStyle={ { size: 'compact' } }\n />\n ))\n }\n </div>\n </div>\n </div>\n\n <SimpleButton\n id={ `paginator_${ id }_next` }\n disabled={ activePage === totalPages }\n onClickHandler={ () => handlePageChange(activePage + 1) }\n rightIcon={ isNonNullNextIcon ? { icon: buttonConfig?.nextButton?.icon || 'next2' } : undefined }\n hideLabel={ buttonConfig?.nextButton?.label ? false : true }\n label={ buttonConfig?.nextButton?.label || `Show next ${ pageSize } items` }\n buttonStyle={ { size: 'compact' } }\n />\n <SimpleButton\n id={ `paginator_${ id }_last` }\n disabled={ activePage === totalPages }\n onClickHandler={ () => handlePageChange(totalPages) }\n rightIcon={ isNonNullLastIcon ? { icon: buttonConfig?.lastButton?.icon || 'last' } : undefined }\n hideLabel={ buttonConfig?.lastButton?.label ? false : true }\n label={ buttonConfig?.lastButton?.label || 'Go to last item' }\n buttonStyle={ { size: 'compact' } }\n />\n\n </div>\n { isPageSizeChangeAllowed && pageSizeChangePosition === 'right' && pageSizeChange() }\n </>\n ) }\n { paginationType === 'showMore' && (\n <div className=\"showMore\">\n <SimpleButton\n id={ `paginator_${ id }_previous` }\n onClickHandler={ () => handlePageChange(activePage + 1) }\n rightIcon={ { icon: 'arrowDown' } }\n label=\"Show more items\"\n buttonStyle={ { size: 'compact' } }\n />\n </div>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"file":"Paginator.js","names":["React","useEffect","useRef","useState","SimpleButton","SelectDropdown","Paginator","id","page","totalPages","pageSize","allowPageSizeChange","onPageChange","onPageSizeChange","paginationType","paginatorPosition","buttonConfig","maxButtonsVisible","displayedButtonLimit","setDisplayedButtonLimit","activePage","setActivePage","isPageSizeChangeAllowed","setIsPageSizeChangeAllowed","pageNumberButtonsVisible","setPageNumberButtonsVisible","Array","from","length","_","i","lowestPageNumberVisible","highestPageNumberVisible","pageSizeChangePosition","isNonNullPrevIcon","previousButton","icon","isNonNullNextIcon","nextButton","isNonNullFirstIcon","firstButton","isNonNullLastIcon","lastButton","updateVisiblePageNumbers","newPage","current","newVisiblePages","filter","pageNum","resetVisiblePageNumbers","handlePageChange","handlePageSizeChange","event","Number","target","value","requiresPagination","pageSizeChange","createElement","className","field","name","options","label","includeEmptyOption","defaultValue","onChange","text","layout","customCssClasses","wrapper","Fragment","disabled","onClickHandler","leftIcon","undefined","hideLabel","buttonStyle","size","map","pageNumber","key","String","rightIcon"],"sources":["../../../../../src/components/design/paginators/Paginator.tsx"],"sourcesContent":["'use client';\n\nimport React, { useEffect, useRef, useState } from 'react';\nimport { SimpleButton } from '../../form/buttons/SimpleButton';\nimport { SelectDropdown } from '../../form/formFields/subComponents/InputVariants';\nimport { GenericFunction } from '../../../interfaces/generic.interface';\nimport { IconSource } from '../../../helpers/iconHelpers';\n\nimport './paginator.scss';\n\nexport interface IconLabelProp {\n icon?: IconSource | null;\n label?: string | null;\n}\n\nexport interface PaginatorProps {\n id: string;\n page: number;\n totalPages: number;\n pageSize: number;\n onPageChange: GenericFunction;\n allowPageSizeChange?: boolean;\n onPageSizeChange?: GenericFunction;\n paginationType?: 'buttons' | 'showMore';\n paginatorPosition?: 'left' | 'right' | 'center';\n buttonConfig?: {\n previousButton?: IconLabelProp;\n nextButton?: IconLabelProp;\n firstButton?: IconLabelProp;\n lastButton?: IconLabelProp;\n };\n maxButtonsVisible?: number;\n}\n\nexport const Paginator: React.FC<PaginatorProps> = (\n {\n id,\n page,\n totalPages,\n pageSize = 20,\n allowPageSizeChange,\n onPageChange,\n onPageSizeChange,\n paginationType = 'buttons',\n paginatorPosition = paginationType === 'showMore' ? 'center' : 'right',\n buttonConfig,\n maxButtonsVisible = 5,\n }\n) => {\n\n const [displayedButtonLimit, setDisplayedButtonLimit] = useState<number>(maxButtonsVisible > totalPages ? totalPages : maxButtonsVisible);\n const [activePage, setActivePage] = useState(0);\n const [isPageSizeChangeAllowed, setIsPageSizeChangeAllowed] = useState<boolean>(false);\n const [pageNumberButtonsVisible, setPageNumberButtonsVisible] = useState<number[]>(Array.from({ length: displayedButtonLimit }, (_, i) => i + 1));\n \n const lowestPageNumberVisible = useRef(1);\n const highestPageNumberVisible = useRef(displayedButtonLimit);\n\n const pageSizeChangePosition = paginatorPosition === 'center' ? 'right' : paginatorPosition === 'right' ? 'left' : 'right';\n\n const isNonNullPrevIcon = buttonConfig?.previousButton?.icon !== null;\n const isNonNullNextIcon = buttonConfig?.nextButton?.icon !== null;\n const isNonNullFirstIcon = buttonConfig?.firstButton?.icon !== null;\n const isNonNullLastIcon = buttonConfig?.lastButton?.icon !== null;\n\n const updateVisiblePageNumbers = (newPage: number) => {\n if (newPage >= lowestPageNumberVisible.current && newPage <= highestPageNumberVisible.current) {\n return;\n }\n if (newPage < lowestPageNumberVisible.current) {\n lowestPageNumberVisible.current = newPage;\n highestPageNumberVisible.current = newPage + displayedButtonLimit - 1;\n } else if (newPage > highestPageNumberVisible.current) {\n highestPageNumberVisible.current = newPage;\n lowestPageNumberVisible.current = newPage - displayedButtonLimit + 1;\n }\n\n const newVisiblePages = Array.from({ length: displayedButtonLimit }, (_, i) => lowestPageNumberVisible.current + i).filter((pageNum) => pageNum >= 1 && pageNum <= totalPages);\n\n setPageNumberButtonsVisible(newVisiblePages);\n };\n\n // ensure lowest and highest visible page numbers are within a valid range\n const resetVisiblePageNumbers = (page: number) => {\n lowestPageNumberVisible.current = 1;\n highestPageNumberVisible.current = displayedButtonLimit;\n\n const newVisiblePages = Array.from({ length: displayedButtonLimit }, (_, i) => i + 1).filter((pageNum) => pageNum >= 1 && pageNum <= totalPages);\n\n setPageNumberButtonsVisible(newVisiblePages);\n updateVisiblePageNumbers(page);\n };\n\n const handlePageChange = (newPage: number) => {\n if (newPage < 1 || newPage > totalPages) {\n return;\n }\n setActivePage(newPage);\n onPageChange(newPage);\n updateVisiblePageNumbers(newPage);\n };\n\n const handlePageSizeChange = (event: React.ChangeEvent<HTMLSelectElement>) => {\n onPageSizeChange && onPageSizeChange(Number(event.target.value));\n };\n\n const requiresPagination = () => {\n if (paginationType === 'buttons') {\n return totalPages > 1;\n }\n\n if (paginationType === 'showMore') {\n return page < totalPages;\n }\n return false;\n };\n\n useEffect(() => {\n const newPage = page > totalPages ? totalPages : page < 1 ? 1 : page;\n if (newPage !== page) {\n onPageChange(newPage);\n }\n setActivePage(newPage);\n if (newPage < lowestPageNumberVisible.current || newPage > highestPageNumberVisible.current || displayedButtonLimit !== pageNumberButtonsVisible.length) {\n resetVisiblePageNumbers(newPage);\n }\n setIsPageSizeChangeAllowed(allowPageSizeChange === true && paginationType === 'buttons');\n }, [page, totalPages, displayedButtonLimit]);\n\n useEffect(() => {\n setDisplayedButtonLimit(maxButtonsVisible > totalPages ? totalPages : maxButtonsVisible);\n }, [totalPages, maxButtonsVisible]);\n\n if (!requiresPagination()) {\n return null;\n }\n\n const pageSizeChange = () => ( \n <div className=\"pageSizeChangeContainer\">\n <SelectDropdown {\n ...{\n field: {\n id: `paginator_${ id }_pageSizeChange`,\n name: `paginator_${ id }_pageSizeChange`,\n options: [\n {\n label: '10',\n value: 10,\n },\n {\n label: '20',\n value: 20,\n },\n {\n label: '50',\n value: 50,\n },\n {\n label: '100',\n value: 100,\n },\n ],\n includeEmptyOption: false,\n defaultValue: pageSize,\n onChange: handlePageSizeChange,\n },\n label: {\n text: 'Items per page',\n },\n layout: 'horizontal',\n customCssClasses: {\n wrapper: 'pageSizeChange',\n }\n }\n }\n />\n </div>\n );\n\n return (\n <div id={ `paginator_${ id }` } className={ `paginator ${ paginationType } position_${ paginatorPosition } ${ isPageSizeChangeAllowed ? 'withPageSizeChange' : '' }` }>\n { paginationType === 'buttons' && (\n <>\n { isPageSizeChangeAllowed && pageSizeChangePosition === 'left' && pageSizeChange() }\n <div className=\"paginatorControls\">\n\n <SimpleButton\n id={ `paginator_${ id }_first` }\n disabled={ activePage === 1 }\n onClickHandler={ () => handlePageChange(1) }\n leftIcon={ isNonNullFirstIcon ? buttonConfig?.firstButton?.icon || 'first' : undefined }\n hideLabel={ buttonConfig?.firstButton?.label ? false : true }\n label={ buttonConfig?.firstButton?.label || 'Go to first item' }\n buttonStyle={ { size: 'compact' } }\n />\n <SimpleButton\n id={ `paginator_${ id }_previous` }\n disabled={ activePage === 1 }\n onClickHandler={ () => handlePageChange(activePage - 1) }\n leftIcon={ isNonNullPrevIcon ? buttonConfig?.previousButton?.icon || 'previous2' : undefined }\n hideLabel={ buttonConfig?.previousButton?.label ? false : true }\n label={ buttonConfig?.previousButton?.label || `Show previous ${ pageSize } items` }\n buttonStyle={ { size: 'compact' } }\n />\n\n <div className=\"paginatorPageButtonsWrapper\">\n <div className=\"paginatorPageButtonsScroller\">\n <div className=\"paginatorPageButtons\">\n {\n pageNumberButtonsVisible.map((pageNumber) => (\n <SimpleButton\n key={ `paginator_${ id }_page_${ pageNumber }` }\n id={ `paginator_${ id }_page_${ pageNumber }` }\n disabled={ activePage === pageNumber }\n onClickHandler={ () => handlePageChange(pageNumber) }\n label={ String(pageNumber) }\n buttonStyle={ { size: 'compact' } }\n />\n ))\n }\n </div>\n </div>\n </div>\n\n <SimpleButton\n id={ `paginator_${ id }_next` }\n disabled={ activePage === totalPages }\n onClickHandler={ () => handlePageChange(activePage + 1) }\n rightIcon={ isNonNullNextIcon ? buttonConfig?.nextButton?.icon || 'next2' : undefined }\n hideLabel={ buttonConfig?.nextButton?.label ? false : true }\n label={ buttonConfig?.nextButton?.label || `Show next ${ pageSize } items` }\n buttonStyle={ { size: 'compact' } }\n />\n <SimpleButton\n id={ `paginator_${ id }_last` }\n disabled={ activePage === totalPages }\n onClickHandler={ () => handlePageChange(totalPages) }\n rightIcon={ isNonNullLastIcon ? buttonConfig?.lastButton?.icon || 'last' : undefined }\n hideLabel={ buttonConfig?.lastButton?.label ? false : true }\n label={ buttonConfig?.lastButton?.label || 'Go to last item' }\n buttonStyle={ { size: 'compact' } }\n />\n\n </div>\n { isPageSizeChangeAllowed && pageSizeChangePosition === 'right' && pageSizeChange() }\n </>\n ) }\n { paginationType === 'showMore' && (\n <div className=\"showMore\">\n <SimpleButton\n id={ `paginator_${ id }_previous` }\n onClickHandler={ () => handlePageChange(activePage + 1) }\n rightIcon={ { icon: 'arrowDown' } }\n label=\"Show more items\"\n buttonStyle={ { size: 'compact' } }\n />\n </div>\n ) }\n </div>\n );\n};\n\nexport default Paginator;\n"],"mappings":"AAAA,YAAY;;AAEZ,OAAOA,KAAK,IAAIC,SAAS,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,OAAO;AAC1D,SAASC,YAAY,QAAQ,iCAAiC;AAC9D,SAASC,cAAc,QAAQ,mDAAmD;AAIlF,OAAO,kBAAkB;AA0BzB,OAAO,MAAMC,SAAmC,GAAGA,CACjD;EACEC,EAAE;EACFC,IAAI;EACJC,UAAU;EACVC,QAAQ,GAAG,EAAE;EACbC,mBAAmB;EACnBC,YAAY;EACZC,gBAAgB;EAChBC,cAAc,GAAG,SAAS;EAC1BC,iBAAiB,GAAGD,cAAc,KAAK,UAAU,GAAG,QAAQ,GAAG,OAAO;EACtEE,YAAY;EACZC,iBAAiB,GAAG;AACtB,CAAC,KACE;EAEH,MAAM,CAACC,oBAAoB,EAAEC,uBAAuB,CAAC,GAAGhB,QAAQ,CAASc,iBAAiB,GAAGR,UAAU,GAAGA,UAAU,GAAGQ,iBAAiB,CAAC;EACzI,MAAM,CAACG,UAAU,EAAEC,aAAa,CAAC,GAAGlB,QAAQ,CAAC,CAAC,CAAC;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AA0D,aAAA;IAAKC,SAAS,EAAC;EAAU,gBACvB3D,KAAA,CAAA0D,aAAA,CAACtD,YAAY;IACXG,EAAE,EAAG,aAAcA,EAAE,WAAc;IACnCkE,cAAc,EAAGA,CAAA,KAAMvB,gBAAgB,CAAC9B,UAAU,GAAG,CAAC,CAAG;IACzD+D,SAAS,EAAG;MAAE/C,IAAI,EAAE;IAAY,CAAG;IACnC2B,KAAK,EAAC,iBAAiB;IACvBc,WAAW,EAAG;MAAEC,IAAI,EAAE;IAAU;EAAG,CACpC,CACE,CAEJ,CAAC;AAEV,CAAC;AAED,eAAexE,SAAS","ignoreList":[]}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import { Tooltip } from '../../tooltip/Tooltip';
|
|
6
|
+
import { renderIcon } from '../../../../helpers/iconHelpers';
|
|
7
|
+
import './circularProgressIndicator.css';
|
|
8
|
+
export const CircularProgressIndicator = ({
|
|
9
|
+
name,
|
|
10
|
+
progress,
|
|
11
|
+
description = '',
|
|
12
|
+
statusMessage = '',
|
|
13
|
+
icon = null,
|
|
14
|
+
hideLabel = false,
|
|
15
|
+
id,
|
|
16
|
+
mode = 'default',
|
|
17
|
+
onClickHandler,
|
|
18
|
+
size = 'default'
|
|
19
|
+
}) => {
|
|
20
|
+
const clampedProgress = Math.min(100, Math.max(0, progress));
|
|
21
|
+
const progressCopy = `${clampedProgress}% complete`;
|
|
22
|
+
const progressSummary = `${progressCopy}${description ? ` ${description}` : ''}`;
|
|
23
|
+
const hasStatus = mode !== 'default';
|
|
24
|
+
const statusTooltipId = `${id}_status`;
|
|
25
|
+
const isActionable = typeof onClickHandler === 'function';
|
|
26
|
+
const getTitle = () => {
|
|
27
|
+
if (statusMessage) {
|
|
28
|
+
return statusMessage;
|
|
29
|
+
}
|
|
30
|
+
return progressSummary;
|
|
31
|
+
};
|
|
32
|
+
const modeIconsMap = {
|
|
33
|
+
default: '',
|
|
34
|
+
warning: 'warning',
|
|
35
|
+
error: 'notification',
|
|
36
|
+
success: 'checkmark'
|
|
37
|
+
};
|
|
38
|
+
const progressIndicatorContent = /*#__PURE__*/React.createElement("span", {
|
|
39
|
+
className: "progressIndicator"
|
|
40
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
41
|
+
className: "glowRing"
|
|
42
|
+
}), /*#__PURE__*/React.createElement("span", {
|
|
43
|
+
className: "progressRing"
|
|
44
|
+
}), /*#__PURE__*/React.createElement("span", {
|
|
45
|
+
className: "actionIcon"
|
|
46
|
+
}, renderIcon(icon), /*#__PURE__*/React.createElement("span", {
|
|
47
|
+
className: `labelText ${hideLabel || size === 'xsmall' ? 'sr-only' : ''}`
|
|
48
|
+
}, name)), hasStatus && /*#__PURE__*/React.createElement("span", {
|
|
49
|
+
className: "statusIndicator"
|
|
50
|
+
}, /*#__PURE__*/React.createElement(Tooltip, {
|
|
51
|
+
passiveTrigger: true,
|
|
52
|
+
triggerId: statusTooltipId,
|
|
53
|
+
customCssClass: "statusIcon",
|
|
54
|
+
icon: modeIconsMap[mode]
|
|
55
|
+
}, getTitle())));
|
|
56
|
+
const sharedProps = {
|
|
57
|
+
className: `circularProgressIndicator ${mode}Mode ${size}`,
|
|
58
|
+
id,
|
|
59
|
+
style: {
|
|
60
|
+
'--progress': `${clampedProgress}%`
|
|
61
|
+
},
|
|
62
|
+
title: hasStatus ? '' : getTitle(),
|
|
63
|
+
'aria-label': progressSummary,
|
|
64
|
+
...(hasStatus ? {
|
|
65
|
+
'aria-describedby': statusTooltipId + '_content'
|
|
66
|
+
} : {})
|
|
67
|
+
};
|
|
68
|
+
if (isActionable) {
|
|
69
|
+
return /*#__PURE__*/React.createElement("button", _extends({}, sharedProps, {
|
|
70
|
+
type: "button",
|
|
71
|
+
onClick: onClickHandler
|
|
72
|
+
}), progressIndicatorContent);
|
|
73
|
+
}
|
|
74
|
+
return /*#__PURE__*/React.createElement("div", _extends({}, sharedProps, {
|
|
75
|
+
role: "progressbar",
|
|
76
|
+
"aria-valuemin": 0,
|
|
77
|
+
"aria-valuemax": 100,
|
|
78
|
+
"aria-valuenow": clampedProgress
|
|
79
|
+
}), progressIndicatorContent);
|
|
80
|
+
};
|
|
81
|
+
export default CircularProgressIndicator;
|
|
82
|
+
//# sourceMappingURL=CircularProgressIndicator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CircularProgressIndicator.js","names":["_extends","React","Tooltip","renderIcon","CircularProgressIndicator","name","progress","description","statusMessage","icon","hideLabel","id","mode","onClickHandler","size","clampedProgress","Math","min","max","progressCopy","progressSummary","hasStatus","statusTooltipId","isActionable","getTitle","modeIconsMap","default","warning","error","success","progressIndicatorContent","createElement","className","passiveTrigger","triggerId","customCssClass","sharedProps","style","title","type","onClick","role"],"sources":["../../../../../../src/components/design/progressIndicators/circularProgressIndicator/CircularProgressIndicator.tsx"],"sourcesContent":["'use client';\n\nimport React from 'react';\nimport { Tooltip } from '../../tooltip/Tooltip';\nimport { IconSource, renderIcon } from '../../../../helpers/iconHelpers';\n\nimport './circularProgressIndicator.scss';\n\nexport interface CircularProgressIndicatorProps {\n name: string;\n progress: number; // 0 - 100\n description?: string;\n statusMessage?: string;\n icon?: IconSource;\n hideLabel?: boolean;\n id: string;\n onClickHandler?: () => void;\n mode?: 'default' | 'warning' | 'error' | 'success';\n size?: 'xsmall' | 'small' | 'default' | 'large' | 'xlarge';\n}\n\nexport const CircularProgressIndicator: React.FC<CircularProgressIndicatorProps> = (\n {\n name,\n progress,\n description = '',\n statusMessage = '',\n icon = null,\n hideLabel = false,\n id,\n mode = 'default',\n onClickHandler,\n size = 'default',\n }\n) => {\n const clampedProgress = Math.min(100, Math.max(0, progress));\n const progressCopy = `${ clampedProgress }% complete`;\n const progressSummary = `${ progressCopy }${ description ? ` ${ description }` : '' }`;\n const hasStatus = mode !== 'default';\n const statusTooltipId = `${ id }_status`;\n const isActionable = typeof onClickHandler === 'function';\n \n const getTitle = () => {\n if (statusMessage) {\n return statusMessage;\n }\n return progressSummary;\n };\n\n const modeIconsMap = {\n default: '',\n warning: 'warning',\n error: 'notification',\n success: 'checkmark',\n };\n\n const progressIndicatorContent = (\n <span className=\"progressIndicator\">\n <span className=\"glowRing\" />\n <span className=\"progressRing\" />\n <span className=\"actionIcon\">\n { renderIcon(icon) }\n <span className={ `labelText ${ hideLabel || size === 'xsmall' ? 'sr-only' : '' }` }>{ name }</span>\n </span>\n\n { hasStatus &&\n <span className=\"statusIndicator\">\n <Tooltip\n passiveTrigger\n triggerId={ statusTooltipId }\n customCssClass=\"statusIcon\"\n icon={ modeIconsMap[mode] }\n >\n { getTitle() }\n </Tooltip>\n </span>\n }\n </span>\n );\n\n const sharedProps = {\n className: `circularProgressIndicator ${ mode }Mode ${ size }`,\n id,\n style: {\n '--progress': `${ clampedProgress }%`,\n } as React.CSSProperties,\n title: hasStatus ? '' : getTitle(),\n 'aria-label': progressSummary,\n ...(hasStatus ? { 'aria-describedby': statusTooltipId + '_content' } : {}),\n };\n\n if (isActionable) {\n return (\n <button\n { ...sharedProps }\n type=\"button\"\n onClick={ onClickHandler }\n >\n { progressIndicatorContent }\n </button>\n );\n }\n\n return (\n <div\n { ...sharedProps }\n role=\"progressbar\"\n aria-valuemin={ 0 }\n aria-valuemax={ 100 }\n aria-valuenow={ clampedProgress }\n >\n { progressIndicatorContent }\n </div>\n );\n};\n\nexport default CircularProgressIndicator;"],"mappings":"AAAA,YAAY;;AAAC,OAAAA,QAAA;AAEb,OAAOC,KAAK,MAAM,OAAO;AACzB,SAASC,OAAO,QAAQ,uBAAuB;AAC/C,SAAqBC,UAAU,QAAQ,iCAAiC;AAExE,OAAO,kCAAkC;AAezC,OAAO,MAAMC,yBAAmE,GAAGA,CACjF;EACEC,IAAI;EACJC,QAAQ;EACRC,WAAW,GAAG,EAAE;EAChBC,aAAa,GAAG,EAAE;EAClBC,IAAI,GAAG,IAAI;EACXC,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AAA;IAAMC,SAAS,EAAC;EAAiB,gBAC/B/B,KAAA,CAAA8B,aAAA,CAAC7B,OAAO;IACN+B,cAAc;IACdC,SAAS,EAAGZ,eAAiB;IAC7Ba,cAAc,EAAC,YAAY;IAC3B1B,IAAI,EAAGgB,YAAY,CAACb,IAAI;EAAG,GAEzBY,QAAQ,CAAC,CACJ,CACL,CAEJ,CACP;EAED,MAAMY,WAAW,GAAG;IAClBJ,SAAS,EAAE,6BAA8BpB,IAAI,QAAUE,IAAI,EAAG;IAC9DH,EAAE;IACF0B,KAAK,EAAE;MACL,YAAY,EAAE,GAAItB,eAAe;IACnC,CAAwB;IACxBuB,KAAK,EAAEjB,SAAS,GAAG,EAAE,GAAGG,QAAQ,CAAC,CAAC;IAClC,YAAY,EAAEJ,eAAe;IAC7B,IAAIC,SAAS,GAAG;MAAE,kBAAkB,EAAEC,eAAe,GAAG;IAAW,CAAC,GAAG,CAAC,CAAC;EAC3E,CAAC;EAED,IAAIC,YAAY,EAAE;IAChB,oBACEtB,KAAA,CAAA8B,aAAA,WAAA/B,QAAA,KACOoC,WAAW;MAChBG,IAAI,EAAC,QAAQ;MACbC,OAAO,EAAG3B;IAAgB,IAExBiB,wBACI,CAAC;EAEb;EAEA,oBACE7B,KAAA,CAAA8B,aAAA,QAAA/B,QAAA,KACOoC,WAAW;IAChBK,IAAI,EAAC,aAAa;IAClB,iBAAgB,CAAG;IACnB,iBAAgB,GAAK;IACrB,iBAAgB1B;EAAiB,IAE/Be,wBACC,CAAC;AAEV,CAAC;AAED,eAAe1B,yBAAyB","ignoreList":[]}
|
|
@@ -0,0 +1,301 @@
|
|
|
1
|
+
.circularProgressIndicator {
|
|
2
|
+
--progress: 0%; /* Overwrite the progress value to set the progress (0% to 100%) */
|
|
3
|
+
--progressIndicatorSize: 100px;
|
|
4
|
+
--progressIndicatorBgColor: #f0f0f0;
|
|
5
|
+
--glowRingThickness: 5%;
|
|
6
|
+
--progressRingSize: 90%;
|
|
7
|
+
--progressRingThickness: 10%;
|
|
8
|
+
--glowRingColor: #ec008c;
|
|
9
|
+
--glowRingColorHighlight: #fff;
|
|
10
|
+
--glowRingColorShade: #B02568;
|
|
11
|
+
--errorColor: #ff0000;
|
|
12
|
+
--errorColorShade: #cc0000;
|
|
13
|
+
--warnColor: #ffcc00;
|
|
14
|
+
--warnColorShade: #ff9900;
|
|
15
|
+
--successColor: #009900;
|
|
16
|
+
--successColorShade: #006600;
|
|
17
|
+
--progressRingColor: #ec008c;
|
|
18
|
+
--progressRingColorHighlight: #fff;
|
|
19
|
+
--progressRingColorShade: #B02568;
|
|
20
|
+
--progressStartAngle: -45deg;
|
|
21
|
+
border: 0;
|
|
22
|
+
background: transparent;
|
|
23
|
+
}
|
|
24
|
+
.circularProgressIndicator.xsmall {
|
|
25
|
+
--progressIndicatorSize: 40px;
|
|
26
|
+
--glowRingThickness: 5px;
|
|
27
|
+
}
|
|
28
|
+
.circularProgressIndicator.xsmall .statusIndicator {
|
|
29
|
+
width: 16px;
|
|
30
|
+
height: 16px;
|
|
31
|
+
top: 5%;
|
|
32
|
+
right: 5%;
|
|
33
|
+
border: none;
|
|
34
|
+
}
|
|
35
|
+
.circularProgressIndicator.xsmall .statusIndicator .statusIcon .icon {
|
|
36
|
+
font-size: 11px;
|
|
37
|
+
}
|
|
38
|
+
.circularProgressIndicator.xsmall .statusIndicator .statusIcon .icon.icon-warning {
|
|
39
|
+
position: relative;
|
|
40
|
+
top: -1px;
|
|
41
|
+
}
|
|
42
|
+
.circularProgressIndicator.small {
|
|
43
|
+
--progressIndicatorSize: 75px;
|
|
44
|
+
}
|
|
45
|
+
.circularProgressIndicator.small .actionIcon .labelText {
|
|
46
|
+
font-size: 11px;
|
|
47
|
+
}
|
|
48
|
+
.circularProgressIndicator.small .statusIndicator {
|
|
49
|
+
width: 18px;
|
|
50
|
+
height: 18px;
|
|
51
|
+
top: 5%;
|
|
52
|
+
right: 5%;
|
|
53
|
+
border-width: 1px;
|
|
54
|
+
}
|
|
55
|
+
.circularProgressIndicator.small .statusIndicator .statusIcon .icon {
|
|
56
|
+
font-size: 14px;
|
|
57
|
+
}
|
|
58
|
+
.circularProgressIndicator.small .statusIndicator .statusIcon .icon.icon-warning {
|
|
59
|
+
position: relative;
|
|
60
|
+
top: -1px;
|
|
61
|
+
}
|
|
62
|
+
.circularProgressIndicator.large {
|
|
63
|
+
--progressIndicatorSize: 150px;
|
|
64
|
+
}
|
|
65
|
+
.circularProgressIndicator.large .actionIcon .icon {
|
|
66
|
+
height: 30px;
|
|
67
|
+
font-size: 20px;
|
|
68
|
+
}
|
|
69
|
+
.circularProgressIndicator.large .actionIcon .labelText {
|
|
70
|
+
font-size: 16px;
|
|
71
|
+
}
|
|
72
|
+
.circularProgressIndicator.large .actionIcon .iconSvg {
|
|
73
|
+
height: 50px;
|
|
74
|
+
width: 50px;
|
|
75
|
+
}
|
|
76
|
+
.circularProgressIndicator.large .actionIcon .iconSvg path {
|
|
77
|
+
stroke-width: 1px;
|
|
78
|
+
}
|
|
79
|
+
.circularProgressIndicator.large .statusIndicator {
|
|
80
|
+
width: 30px;
|
|
81
|
+
height: 30px;
|
|
82
|
+
}
|
|
83
|
+
.circularProgressIndicator.large .statusIndicator .statusIcon .icon {
|
|
84
|
+
font-size: 16px;
|
|
85
|
+
}
|
|
86
|
+
.circularProgressIndicator.large .statusIndicator .statusIcon .icon.icon-warning {
|
|
87
|
+
position: relative;
|
|
88
|
+
top: -1px;
|
|
89
|
+
}
|
|
90
|
+
.circularProgressIndicator.xlarge {
|
|
91
|
+
--progressIndicatorSize: 200px;
|
|
92
|
+
}
|
|
93
|
+
.circularProgressIndicator.xlarge .actionIcon .icon {
|
|
94
|
+
height: 40px;
|
|
95
|
+
font-size: 30px;
|
|
96
|
+
}
|
|
97
|
+
.circularProgressIndicator.xlarge .actionIcon .labelText {
|
|
98
|
+
font-size: 16px;
|
|
99
|
+
}
|
|
100
|
+
.circularProgressIndicator.xlarge .actionIcon .iconSvg {
|
|
101
|
+
height: 75px;
|
|
102
|
+
width: 75px;
|
|
103
|
+
}
|
|
104
|
+
.circularProgressIndicator.xlarge .actionIcon .iconSvg path {
|
|
105
|
+
stroke-width: 1px;
|
|
106
|
+
}
|
|
107
|
+
.circularProgressIndicator.xlarge .statusIndicator {
|
|
108
|
+
width: 40px;
|
|
109
|
+
height: 40px;
|
|
110
|
+
}
|
|
111
|
+
.circularProgressIndicator.xlarge .statusIndicator .statusIcon .icon {
|
|
112
|
+
font-size: 18px;
|
|
113
|
+
}
|
|
114
|
+
.circularProgressIndicator.xlarge .statusIndicator .statusIcon .icon.icon-warning {
|
|
115
|
+
position: relative;
|
|
116
|
+
top: -1px;
|
|
117
|
+
}
|
|
118
|
+
.circularProgressIndicator.errorMode {
|
|
119
|
+
--glowRingColor: var(--errorColor);
|
|
120
|
+
--glowRingColorHighlight: var(--errorColor);
|
|
121
|
+
--glowRingColorShade: var(--errorColorShade);
|
|
122
|
+
--progressRingColor: var(--errorColor);
|
|
123
|
+
--progressRingColorShade: var(--errorColorShade);
|
|
124
|
+
}
|
|
125
|
+
.circularProgressIndicator.errorMode .statusIndicator {
|
|
126
|
+
color: var(--errorColor);
|
|
127
|
+
border-color: var(--errorColorShade);
|
|
128
|
+
}
|
|
129
|
+
.circularProgressIndicator.errorMode .statusIndicator .icon {
|
|
130
|
+
color: var(--errorColor);
|
|
131
|
+
}
|
|
132
|
+
.circularProgressIndicator.warningMode {
|
|
133
|
+
--glowRingColor: var(--warnColor);
|
|
134
|
+
--glowRingColorHighlight: var(--warnColor);
|
|
135
|
+
--glowRingColorShade: var(--warnColorShade);
|
|
136
|
+
--progressRingColor: var(--warnColor);
|
|
137
|
+
--progressRingColorShade: var(--warnColorShade);
|
|
138
|
+
}
|
|
139
|
+
.circularProgressIndicator.warningMode .statusIndicator {
|
|
140
|
+
color: var(--warnColorShade);
|
|
141
|
+
border-color: var(--warnColorShade);
|
|
142
|
+
}
|
|
143
|
+
.circularProgressIndicator.warningMode .statusIndicator .icon {
|
|
144
|
+
color: var(--warnColorShade);
|
|
145
|
+
}
|
|
146
|
+
.circularProgressIndicator.successMode {
|
|
147
|
+
--glowRingColor: var(--successColor);
|
|
148
|
+
--glowRingColorHighlight: var(--successColor);
|
|
149
|
+
--glowRingColorShade: var(--successColorShade);
|
|
150
|
+
--progressRingColor: var(--successColor);
|
|
151
|
+
--progressRingColorShade: var(--successColorShade);
|
|
152
|
+
}
|
|
153
|
+
.circularProgressIndicator.successMode .statusIndicator {
|
|
154
|
+
color: var(--successColorShade);
|
|
155
|
+
border-color: var(--successColorShade);
|
|
156
|
+
}
|
|
157
|
+
.circularProgressIndicator.successMode .statusIndicator .icon {
|
|
158
|
+
color: var(--successColorShade);
|
|
159
|
+
}
|
|
160
|
+
.circularProgressIndicator .progressIndicator {
|
|
161
|
+
display: block;
|
|
162
|
+
position: relative;
|
|
163
|
+
width: var(--progressIndicatorSize);
|
|
164
|
+
height: var(--progressIndicatorSize);
|
|
165
|
+
}
|
|
166
|
+
.circularProgressIndicator .progressIndicator .glowRing {
|
|
167
|
+
width: 100%;
|
|
168
|
+
height: 100%;
|
|
169
|
+
position: absolute;
|
|
170
|
+
border-radius: 50%;
|
|
171
|
+
top: 0;
|
|
172
|
+
left: 0;
|
|
173
|
+
background-image: conic-gradient(from var(--progressStartAngle), var(--glowRingColorHighlight) 0%, var(--glowRingColor) 20%, var(--glowRingColorShade) 50%, var(--glowRingColor) 80%, var(--glowRingColorHighlight) 95%);
|
|
174
|
+
box-shadow: 0 0 10px 0 var(--glowRingColor);
|
|
175
|
+
}
|
|
176
|
+
.circularProgressIndicator .progressIndicator .glowRing:before {
|
|
177
|
+
content: "";
|
|
178
|
+
position: absolute;
|
|
179
|
+
top: calc(var(--glowRingThickness) / 2);
|
|
180
|
+
left: calc(var(--glowRingThickness) / 2);
|
|
181
|
+
width: calc(100% - var(--glowRingThickness));
|
|
182
|
+
height: calc(100% - var(--glowRingThickness));
|
|
183
|
+
border-radius: 50%;
|
|
184
|
+
box-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
|
|
185
|
+
background-color: var(--progressIndicatorBgColor);
|
|
186
|
+
}
|
|
187
|
+
.circularProgressIndicator .progressRing {
|
|
188
|
+
width: var(--progressRingSize);
|
|
189
|
+
height: var(--progressRingSize);
|
|
190
|
+
border-radius: 50%;
|
|
191
|
+
background-image: conic-gradient(from var(--progressStartAngle), var(--progressRingColorHighlight) 0%, var(--progressRingColor) 30%, var(--progressRingColorShade) 50%, var(--progressRingColor) 80%, var(--progressRingColorHighlight) 95%);
|
|
192
|
+
position: absolute;
|
|
193
|
+
top: 50%;
|
|
194
|
+
left: 50%;
|
|
195
|
+
transform: translate(-50%, -50%);
|
|
196
|
+
}
|
|
197
|
+
.circularProgressIndicator .progressRing:before, .circularProgressIndicator .progressRing:after {
|
|
198
|
+
content: "";
|
|
199
|
+
position: absolute;
|
|
200
|
+
border-radius: 50%;
|
|
201
|
+
top: 50%;
|
|
202
|
+
left: 50%;
|
|
203
|
+
transform: translate(-50%, -50%);
|
|
204
|
+
}
|
|
205
|
+
.circularProgressIndicator .progressRing {
|
|
206
|
+
/* Mask the progress ring to show only the progress portion */
|
|
207
|
+
}
|
|
208
|
+
.circularProgressIndicator .progressRing:before {
|
|
209
|
+
width: calc(var(--progressRingSize) + var(--progressRingThickness) + 2px);
|
|
210
|
+
height: calc(var(--progressRingSize) + var(--progressRingThickness) + 2px);
|
|
211
|
+
border: 1px solid #fff;
|
|
212
|
+
z-index: 1;
|
|
213
|
+
/* This css is correct. Ignore VSCode warning. */
|
|
214
|
+
background-image: conic-gradient(from var(--progressStartAngle), transparent 0 calc(var(--progress) - 0.2%), var(--progressIndicatorBgColor) calc(var(--progress) + 0.2%));
|
|
215
|
+
}
|
|
216
|
+
.circularProgressIndicator .progressRing:after {
|
|
217
|
+
z-index: 2;
|
|
218
|
+
width: calc(var(--progressRingSize) - var(--progressRingThickness));
|
|
219
|
+
height: calc(var(--progressRingSize) - var(--progressRingThickness));
|
|
220
|
+
background-color: var(--progressIndicatorBgColor);
|
|
221
|
+
box-shadow: inset 1px 1px 10px 1px rgba(0, 0, 0, 0.15), inset -2px -2px 5px 1px rgba(0, 0, 0, 0.15);
|
|
222
|
+
}
|
|
223
|
+
.circularProgressIndicator .actionIcon {
|
|
224
|
+
position: absolute;
|
|
225
|
+
top: 50%;
|
|
226
|
+
left: 50%;
|
|
227
|
+
transform: translate(-50%, -50%);
|
|
228
|
+
width: 50%;
|
|
229
|
+
height: 50%;
|
|
230
|
+
display: flex;
|
|
231
|
+
flex-direction: column;
|
|
232
|
+
align-items: center;
|
|
233
|
+
text-align: center;
|
|
234
|
+
justify-content: center;
|
|
235
|
+
}
|
|
236
|
+
.circularProgressIndicator .actionIcon .icon {
|
|
237
|
+
height: 24px;
|
|
238
|
+
font-size: 24px;
|
|
239
|
+
line-height: 1;
|
|
240
|
+
}
|
|
241
|
+
.circularProgressIndicator .actionIcon .labelText {
|
|
242
|
+
font-size: 13px;
|
|
243
|
+
line-height: 1;
|
|
244
|
+
}
|
|
245
|
+
.circularProgressIndicator .actionIcon .iconSvg {
|
|
246
|
+
fill: none;
|
|
247
|
+
stroke-width: 1.5;
|
|
248
|
+
stroke-linecap: round;
|
|
249
|
+
stroke-linejoin: round;
|
|
250
|
+
height: 24px;
|
|
251
|
+
}
|
|
252
|
+
.circularProgressIndicator .actionIcon .iconSvg .svgIconColor_1 {
|
|
253
|
+
stroke: #000;
|
|
254
|
+
}
|
|
255
|
+
.circularProgressIndicator .actionIcon .iconSvg .svgIconColor_2 {
|
|
256
|
+
stroke: #000;
|
|
257
|
+
}
|
|
258
|
+
.circularProgressIndicator .actionIcon .iconSvg .svgIconFill_1 {
|
|
259
|
+
fill: var(--progressRingColor);
|
|
260
|
+
}
|
|
261
|
+
.circularProgressIndicator .statusIndicator {
|
|
262
|
+
position: absolute;
|
|
263
|
+
top: 9%;
|
|
264
|
+
right: 9%;
|
|
265
|
+
width: 20px;
|
|
266
|
+
height: 20px;
|
|
267
|
+
border-radius: 50%;
|
|
268
|
+
border: 2px solid;
|
|
269
|
+
font-size: 20px;
|
|
270
|
+
font-weight: bold;
|
|
271
|
+
background: #fff;
|
|
272
|
+
display: flex;
|
|
273
|
+
justify-content: center;
|
|
274
|
+
align-items: center;
|
|
275
|
+
text-align: center;
|
|
276
|
+
}
|
|
277
|
+
.circularProgressIndicator .statusIndicator .tooltip {
|
|
278
|
+
margin: 0;
|
|
279
|
+
width: 100%;
|
|
280
|
+
}
|
|
281
|
+
.circularProgressIndicator .statusIndicator .tooltip > span.icon_only { /* Non-button passive tooltip version */
|
|
282
|
+
left: 0;
|
|
283
|
+
top: 0;
|
|
284
|
+
min-width: auto;
|
|
285
|
+
min-height: auto;
|
|
286
|
+
width: 100%;
|
|
287
|
+
height: 100%;
|
|
288
|
+
}
|
|
289
|
+
.circularProgressIndicator .statusIndicator .tooltip > span.icon_only .icon,
|
|
290
|
+
.circularProgressIndicator .statusIndicator .tooltip > span.icon_only .svgIcon {
|
|
291
|
+
width: 100%;
|
|
292
|
+
height: 100%;
|
|
293
|
+
}
|
|
294
|
+
.circularProgressIndicator .statusIndicator .statusIcon .icon {
|
|
295
|
+
font-size: 14px;
|
|
296
|
+
background: none;
|
|
297
|
+
}
|
|
298
|
+
.circularProgressIndicator .statusIndicator .statusIcon .icon.icon-warning {
|
|
299
|
+
position: relative;
|
|
300
|
+
top: -1px;
|
|
301
|
+
}
|
|
@@ -54,9 +54,7 @@ export const RevealMoreBelow = props => {
|
|
|
54
54
|
id: "revealMore_button-below",
|
|
55
55
|
cssClass: "button compact",
|
|
56
56
|
label: isExpanded ? props.revealLessLabel || 'Reveal Less' : props.revealMoreLabel || 'Reveal More',
|
|
57
|
-
leftIcon: props.icon
|
|
58
|
-
icon: isExpanded ? props.icon.onRevealLess : props.icon.onRevealMore
|
|
59
|
-
} : undefined,
|
|
57
|
+
leftIcon: isExpanded ? props.icon?.onRevealLess : props.icon?.onRevealMore,
|
|
60
58
|
"aria-hidden": props.revealLessLabelOnClickHandler || props.revealMoreLabelOnClickHandler ? false : true
|
|
61
59
|
})));
|
|
62
60
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RevealMoreBelow.js","names":["React","useRef","useEffect","SimpleButton","useRevealMoreLogic","useCustomButton","RevealMoreBelow","props","children","lineClamp","customCssClass","isExpanded","isOverflowing","setIsOverflowing","toggleExpand","renderCustomButton","contentRef","isCustomButton","el","current","scrollHeight","clientHeight","elementStyle","overflow","display","WebkitBoxOrient","WebkitLineClamp","createElement","className","ref","style","revealLessButton","revealMoreButton","onClickHandler","revealLessLabelOnClickHandler","revealMoreLabelOnClickHandler","id","cssClass","label","revealLessLabel","revealMoreLabel","leftIcon","icon","onRevealLess","onRevealMore"
|
|
1
|
+
{"version":3,"file":"RevealMoreBelow.js","names":["React","useRef","useEffect","SimpleButton","useRevealMoreLogic","useCustomButton","RevealMoreBelow","props","children","lineClamp","customCssClass","isExpanded","isOverflowing","setIsOverflowing","toggleExpand","renderCustomButton","contentRef","isCustomButton","el","current","scrollHeight","clientHeight","elementStyle","overflow","display","WebkitBoxOrient","WebkitLineClamp","createElement","className","ref","style","revealLessButton","revealMoreButton","onClickHandler","revealLessLabelOnClickHandler","revealMoreLabelOnClickHandler","id","cssClass","label","revealLessLabel","revealMoreLabel","leftIcon","icon","onRevealLess","onRevealMore"],"sources":["../../../../../src/components/design/revealMore/RevealMoreBelow.tsx"],"sourcesContent":["'use client';\n\nimport React, { useRef, useEffect } from 'react';\nimport { SimpleButton } from '../../..';\nimport { RevealMoreBelowProps, ManagedButtonProps } from './types/revealMoreTypes';\nimport { useRevealMoreLogic } from './hooks/useRevealMoreLogic';\nimport { useCustomButton } from './hooks/useCustomButton';\n\nexport const RevealMoreBelow: React.FC<RevealMoreBelowProps> = (props) => {\n const {\n children,\n lineClamp = 2,\n customCssClass\n } = props;\n\n const { isExpanded, isOverflowing, setIsOverflowing, toggleExpand } = useRevealMoreLogic();\n const { renderCustomButton } = useCustomButton(toggleExpand);\n const contentRef = useRef<HTMLDivElement>(null);\n\n const isCustomButton = 'revealMoreButton' in props && 'revealLessButton' in props;\n\n useEffect(() => {\n const el = contentRef.current;\n if (el) {\n setIsOverflowing(el.scrollHeight > el.clientHeight);\n }\n }, [children, lineClamp]);\n\n const elementStyle: React.CSSProperties = {\n overflow: 'hidden',\n display: '-webkit-box',\n WebkitBoxOrient: 'vertical',\n WebkitLineClamp: lineClamp,\n };\n\n return (\n <div className={ `revealMore revealMore_below ${ customCssClass || '' }` }>\n <div\n ref={ contentRef }\n className={ 'revealMore_content' }\n style={ isExpanded ? { ...elementStyle, WebkitLineClamp: 'none' } : elementStyle }\n >\n { children }\n </div>\n { isOverflowing && (\n isCustomButton ? (\n renderCustomButton(\n isExpanded ? props.revealLessButton : props.revealMoreButton\n )\n ) : (\n <SimpleButton\n onClickHandler={ () => {\n toggleExpand();\n if (isExpanded) {\n (props as ManagedButtonProps).revealLessLabelOnClickHandler?.();\n } else {\n (props as ManagedButtonProps).revealMoreLabelOnClickHandler?.();\n }\n } }\n id='revealMore_button-below'\n cssClass=\"button compact\"\n label={\n isExpanded \n ? (props as ManagedButtonProps).revealLessLabel || 'Reveal Less' \n : (props as ManagedButtonProps).revealMoreLabel || 'Reveal More'\n }\n leftIcon={\n isExpanded\n ? (props as ManagedButtonProps).icon?.onRevealLess\n : (props as ManagedButtonProps).icon?.onRevealMore\n }\n aria-hidden = { props.revealLessLabelOnClickHandler || props.revealMoreLabelOnClickHandler ? false : true }\n />\n )\n ) }\n </div>\n );\n};"],"mappings":"AAAA,YAAY;;AAEZ,OAAOA,KAAK,IAAIC,MAAM,EAAEC,SAAS,QAAQ,OAAO;AAChD,SAASC,YAAY,QAAQ,UAAU;AAEvC,SAASC,kBAAkB,QAAQ,4BAA4B;AAC/D,SAASC,eAAe,QAAQ,yBAAyB;AAEzD,OAAO,MAAMC,eAA+C,GAAIC,KAAK,IAAK;EACxE,MAAM;IACJC,QAAQ;IACRC,SAAS,GAAG,CAAC;IACbC;EACF,CAAC,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6B,GAAG,CAAC;MACjE,CAAC,MAAM;QACJ3B,KAAK,CAAwB4B,6BAA6B,GAAG,CAAC;MACjE;IACF,CAAG;IACHC,EAAE,EAAC,yBAAyB;IAC5BC,QAAQ,EAAC,gBAAgB;IACzBC,KAAK,EACH3B,UAAU,GACLJ,KAAK,CAAwBgC,eAAe,IAAI,aAAa,GAC7DhC,KAAK,CAAwBiC,eAAe,IAAI,aACtD;IACDC,QAAQ,EACN9B,UAAU,GACLJ,KAAK,CAAwBmC,IAAI,EAAEC,YAAY,GAC/CpC,KAAK,CAAwBmC,IAAI,EAAEE,YACzC;IACD,eAAgBrC,KAAK,CAAC2B,6BAA6B,IAAI3B,KAAK,CAAC4B,6BAA6B,GAAG,KAAK,GAAG;EAAM,CAC5G,CACF,CAEA,CAAC;AAEV,CAAC","ignoreList":[]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import React, { useState, useEffect } from 'react';
|
|
4
|
-
import { SimpleButton } from '
|
|
4
|
+
import { SimpleButton } from '../../form/buttons/SimpleButton';
|
|
5
5
|
import { useRevealMoreLogic } from './hooks/useRevealMoreLogic';
|
|
6
6
|
import { useCustomButton } from './hooks/useCustomButton';
|
|
7
7
|
export const RevealMoreInline = props => {
|
|
@@ -49,9 +49,7 @@ export const RevealMoreInline = props => {
|
|
|
49
49
|
id: "revealMore_button-inline",
|
|
50
50
|
cssClass: "button compact text_only",
|
|
51
51
|
label: isExpanded ? props.revealLessLabel || 'Reveal Less' : props.revealMoreLabel || 'Reveal More',
|
|
52
|
-
leftIcon: props.icon
|
|
53
|
-
icon: isExpanded ? props.icon.onRevealLess : props.icon.onRevealMore
|
|
54
|
-
} : undefined
|
|
52
|
+
leftIcon: isExpanded ? props.icon?.onRevealLess : props.icon?.onRevealMore
|
|
55
53
|
}))));
|
|
56
54
|
};
|
|
57
55
|
//# sourceMappingURL=RevealMoreInline.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RevealMoreInline.js","names":["React","useState","useEffect","SimpleButton","useRevealMoreLogic","useCustomButton","RevealMoreInline","props","children","characterClamp","customCssClass","isExpanded","isOverflowing","setIsOverflowing","toggleExpand","renderCustomButton","truncatedText","setTruncatedText","isCustomButton","text","limit","length","substring","displayText","createElement","className","revealLessButton","revealMoreButton","onClickHandler","revealLessLabelOnClickHandler","revealMoreLabelOnClickHandler","id","cssClass","label","revealLessLabel","revealMoreLabel","leftIcon","icon","onRevealLess","onRevealMore"
|
|
1
|
+
{"version":3,"file":"RevealMoreInline.js","names":["React","useState","useEffect","SimpleButton","useRevealMoreLogic","useCustomButton","RevealMoreInline","props","children","characterClamp","customCssClass","isExpanded","isOverflowing","setIsOverflowing","toggleExpand","renderCustomButton","truncatedText","setTruncatedText","isCustomButton","text","limit","length","substring","displayText","createElement","className","revealLessButton","revealMoreButton","onClickHandler","revealLessLabelOnClickHandler","revealMoreLabelOnClickHandler","id","cssClass","label","revealLessLabel","revealMoreLabel","leftIcon","icon","onRevealLess","onRevealMore"],"sources":["../../../../../src/components/design/revealMore/RevealMoreInline.tsx"],"sourcesContent":["'use client';\n\nimport React, { useState, useEffect } from 'react';\nimport { SimpleButton } from '../../form/buttons/SimpleButton';\nimport { RevealMoreInlineProps, ManagedButtonProps } from './types/revealMoreTypes';\nimport { useRevealMoreLogic } from './hooks/useRevealMoreLogic';\nimport { useCustomButton } from './hooks/useCustomButton';\n\nexport const RevealMoreInline: React.FC<RevealMoreInlineProps> = (props) => {\n const {\n children,\n characterClamp = 100,\n customCssClass\n } = props;\n\n const { isExpanded, isOverflowing, setIsOverflowing, toggleExpand } = useRevealMoreLogic();\n const { renderCustomButton } = useCustomButton(toggleExpand);\n const [truncatedText, setTruncatedText] = useState('');\n\n const isCustomButton = 'revealMoreButton' in props && 'revealLessButton' in props;\n\n useEffect(() => {\n const text = children as string;\n const limit = characterClamp;\n \n if (text.length > limit) {\n setTruncatedText(text.substring(0, limit));\n setIsOverflowing(true);\n } else {\n setTruncatedText(text);\n setIsOverflowing(false);\n }\n }, [children, characterClamp]);\n\n const displayText = isExpanded ? (children as string) : truncatedText;\n\n return (\n <div className={ `revealMore revealMore_inline ${ customCssClass || '' }` }>\n <span className=\"revealMore_content\">\n { displayText }\n { isOverflowing && (\n isCustomButton ? (\n renderCustomButton(\n isExpanded ? props.revealLessButton : props.revealMoreButton\n )\n ) : (\n <SimpleButton\n onClickHandler={ () => {\n toggleExpand();\n if (isExpanded) {\n (props as ManagedButtonProps).revealLessLabelOnClickHandler?.();\n } else {\n (props as ManagedButtonProps).revealMoreLabelOnClickHandler?.();\n }\n } }\n id='revealMore_button-inline'\n cssClass=\"button compact text_only\"\n label={\n isExpanded \n ? (props as ManagedButtonProps).revealLessLabel || 'Reveal Less' \n : (props as ManagedButtonProps).revealMoreLabel || 'Reveal More'\n }\n leftIcon={\n isExpanded\n ? (props as ManagedButtonProps).icon?.onRevealLess\n : (props as ManagedButtonProps).icon?.onRevealMore\n }\n />\n )\n ) }\n </span>\n </div>\n );\n};"],"mappings":"AAAA,YAAY;;AAEZ,OAAOA,KAAK,IAAIC,QAAQ,EAAEC,SAAS,QAAQ,OAAO;AAClD,SAASC,YAAY,QAAQ,iCAAiC;AAE9D,SAASC,kBAAkB,QAAQ,4BAA4B;AAC/D,SAASC,eAAe,QAAQ,yBAAyB;AAEzD,OAAO,MAAMC,gBAAiD,GAAIC,KAAK,IAAK;EAC1E,MAAM;IACJC,QAAQ;IACRC,cAAc,GAAG,GAAG;IACpBC;EACF,CAAC,GAAGH,KAAK;EAET,MAAM;IAAEI,UAAU;IAAEC,aAAa;IAAEC,gBAAgB;IAAEC;EAAa,CAAC,GAAGV,kBAAkB,CAAC,CAAC;EAC1F,MAAM;IAAEW;EAAmB,CAAC,GAAGV,eAAe,CAACS,YAAY,CAAC;EAC5D,MAAM,CAACE,aAAa,EAAEC,gBAAgB,CAAC,GAAGhB,QAAQ,CAAC,EAAE,CAAC;EAEtD,MAAMiB,cAAc,GAA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,GACLJ,KAAK,CAAwB8B,IAAI,EAAEC,YAAY,GAC/C/B,KAAK,CAAwB8B,IAAI,EAAEE;EACzC,CACF,CACF,CAEC,CACH,CAAC;AAEV,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"revealMoreTypes.js","names":[],"sources":["../../../../../../src/components/design/revealMore/types/revealMoreTypes.ts"],"sourcesContent":["import React from 'react';\n\n// Props shared by both components\nexport type BaseRevealMoreProps = {\n children: React.ReactNode | string;\n customCssClass?: string;\n}\n\n// Button configuration types\nexport type CustomButtonProps = {\n revealMoreButton: React.ReactElement;\n revealLessButton: React.ReactElement;\n}\n\nexport type ManagedButtonProps = {\n revealMoreLabel?: string;\n revealLessLabel?: string;\n revealMoreLabelOnClickHandler?: () => void;\n revealLessLabelOnClickHandler?: () => void;\n icon?: {\n onRevealMore:
|
|
1
|
+
{"version":3,"file":"revealMoreTypes.js","names":[],"sources":["../../../../../../src/components/design/revealMore/types/revealMoreTypes.ts"],"sourcesContent":["import React from 'react';\nimport { IconSource } from '../../../../helpers/iconHelpers';\n\n// Props shared by both components\nexport type BaseRevealMoreProps = {\n children: React.ReactNode | string;\n customCssClass?: string;\n}\n\n// Button configuration types\nexport type CustomButtonProps = {\n revealMoreButton: React.ReactElement;\n revealLessButton: React.ReactElement;\n}\n\nexport type ManagedButtonProps = {\n revealMoreLabel?: string;\n revealLessLabel?: string;\n revealMoreLabelOnClickHandler?: () => void;\n revealLessLabelOnClickHandler?: () => void;\n icon?: {\n onRevealMore: IconSource;\n onRevealLess: IconSource;\n };\n}\n\n// Component-specific props\nexport type RevealMoreInlineProps = BaseRevealMoreProps & (CustomButtonProps | ManagedButtonProps) & {\n characterClamp?: number;\n children: string; \n}\n\nexport type RevealMoreBelowProps = BaseRevealMoreProps & (CustomButtonProps | ManagedButtonProps) & {\n lineClamp?: number;\n children: React.ReactNode | string;\n}\n\n// Main component props \nexport type RevealMoreProps = \n | ({ labelStyle: 'inline' } & RevealMoreInlineProps)\n | ({ labelStyle: 'below' } & RevealMoreBelowProps);"],"mappings":"","ignoreList":[]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
|
4
|
-
import {
|
|
4
|
+
import { renderIcon } from '../../../helpers/iconHelpers';
|
|
5
5
|
import './sidePanel.css';
|
|
6
6
|
export const SidePanel = ({
|
|
7
7
|
id,
|
|
@@ -33,7 +33,7 @@ export const SidePanel = ({
|
|
|
33
33
|
onClose();
|
|
34
34
|
}
|
|
35
35
|
}, [isOpenState, onClose, onOpen]);
|
|
36
|
-
const
|
|
36
|
+
const getToggleIcon = () => {
|
|
37
37
|
if (icons) {
|
|
38
38
|
return isOpenState ? icons.closed : icons.open;
|
|
39
39
|
}
|
|
@@ -57,9 +57,7 @@ export const SidePanel = ({
|
|
|
57
57
|
title: TOGGLE_TEXT,
|
|
58
58
|
type: "button",
|
|
59
59
|
onClick: () => TogglePanelOpenState()
|
|
60
|
-
}, /*#__PURE__*/React.createElement(
|
|
61
|
-
icon: getIconCssClass()
|
|
62
|
-
}), /*#__PURE__*/React.createElement("span", {
|
|
60
|
+
}, renderIcon(getToggleIcon()), /*#__PURE__*/React.createElement("span", {
|
|
63
61
|
className: "sr-only"
|
|
64
62
|
}, "Open and close panel"));
|
|
65
63
|
const panelCssClass = useCallback(() => `sidePanel
|