@pega/cosmos-react-core 2.0.0-rc.1 → 2.0.0-rc.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/AppShell/AppShell.d.ts.map +1 -1
- package/lib/components/AppShell/AppShell.js +4 -2
- package/lib/components/AppShell/AppShell.js.map +1 -1
- package/lib/components/AppShell/AppShell.types.d.ts +2 -2
- package/lib/components/AppShell/AppShell.types.d.ts.map +1 -1
- package/lib/components/AppShell/AppShell.types.js.map +1 -1
- package/lib/components/AppShell/AppShellContext.d.ts +1 -0
- package/lib/components/AppShell/AppShellContext.d.ts.map +1 -1
- package/lib/components/AppShell/AppShellContext.js +8 -1
- package/lib/components/AppShell/AppShellContext.js.map +1 -1
- package/lib/components/AppShell/index.d.ts +1 -0
- package/lib/components/AppShell/index.d.ts.map +1 -1
- package/lib/components/AppShell/index.js +1 -0
- package/lib/components/AppShell/index.js.map +1 -1
- package/lib/components/Backdrop/index.d.ts +1 -2
- package/lib/components/Backdrop/index.d.ts.map +1 -1
- package/lib/components/Backdrop/index.js +1 -2
- package/lib/components/Backdrop/index.js.map +1 -1
- package/lib/components/Badges/Alert.d.ts +2 -2
- package/lib/components/Badges/Alert.d.ts.map +1 -1
- package/lib/components/Badges/Alert.js.map +1 -1
- package/lib/components/Banner/Banner.d.ts +2 -2
- package/lib/components/Banner/Banner.d.ts.map +1 -1
- package/lib/components/Banner/Banner.js.map +1 -1
- package/lib/components/Boolean/BooleanDisplay.d.ts +2 -2
- package/lib/components/Boolean/BooleanDisplay.d.ts.map +1 -1
- package/lib/components/Boolean/BooleanDisplay.js +1 -1
- package/lib/components/Boolean/BooleanDisplay.js.map +1 -1
- package/lib/components/Breadcrumbs/Breadcrumbs.d.ts +2 -2
- package/lib/components/Breadcrumbs/Breadcrumbs.d.ts.map +1 -1
- package/lib/components/Breadcrumbs/Breadcrumbs.js.map +1 -1
- package/lib/components/Checkbox/Checkbox.d.ts +2 -2
- package/lib/components/Checkbox/Checkbox.d.ts.map +1 -1
- package/lib/components/Checkbox/Checkbox.js.map +1 -1
- package/lib/components/ColorPicker/ColorPicker.d.ts +2 -2
- package/lib/components/ColorPicker/ColorPicker.d.ts.map +1 -1
- package/lib/components/ColorPicker/ColorPicker.js.map +1 -1
- package/lib/components/ComboBox/ComboBox.d.ts +0 -1
- package/lib/components/ComboBox/ComboBox.d.ts.map +1 -1
- package/lib/components/ComboBox/ComboBox.js +17 -42
- package/lib/components/ComboBox/ComboBox.js.map +1 -1
- package/lib/components/ComboBox/ComboBox.styles.d.ts +3 -0
- package/lib/components/ComboBox/ComboBox.styles.d.ts.map +1 -0
- package/lib/components/ComboBox/ComboBox.styles.js +69 -0
- package/lib/components/ComboBox/ComboBox.styles.js.map +1 -0
- package/lib/components/ComboBox/ComboBox.types.d.ts +2 -1
- package/lib/components/ComboBox/ComboBox.types.d.ts.map +1 -1
- package/lib/components/ComboBox/ComboBox.types.js.map +1 -1
- package/lib/components/ComboBox/MultiSelectInput/MultiSelectInput.d.ts +1 -1
- package/lib/components/ComboBox/MultiSelectInput/MultiSelectInput.d.ts.map +1 -1
- package/lib/components/ComboBox/MultiSelectInput/MultiSelectInput.js +5 -46
- package/lib/components/ComboBox/MultiSelectInput/MultiSelectInput.js.map +1 -1
- package/lib/components/ComboBox/SingleSelectInput/SingleSelectInput.d.ts +1 -0
- package/lib/components/ComboBox/SingleSelectInput/SingleSelectInput.d.ts.map +1 -1
- package/lib/components/ComboBox/SingleSelectInput/SingleSelectInput.js +4 -50
- package/lib/components/ComboBox/SingleSelectInput/SingleSelectInput.js.map +1 -1
- package/lib/components/Configuration/Configuration.js +1 -1
- package/lib/components/Configuration/Configuration.js.map +1 -1
- package/lib/components/Currency/CurrencyDisplay.d.ts +2 -2
- package/lib/components/Currency/CurrencyDisplay.d.ts.map +1 -1
- package/lib/components/Currency/CurrencyDisplay.js.map +1 -1
- package/lib/components/Currency/CurrencyInput.types.d.ts +2 -2
- package/lib/components/Currency/CurrencyInput.types.d.ts.map +1 -1
- package/lib/components/Currency/CurrencyInput.types.js.map +1 -1
- package/lib/components/DateTime/DateTime.types.d.ts +2 -1
- package/lib/components/DateTime/DateTime.types.d.ts.map +1 -1
- package/lib/components/DateTime/DateTime.types.js.map +1 -1
- package/lib/components/DateTime/Input/DayOfWeekInput.d.ts +2 -0
- package/lib/components/DateTime/Input/DayOfWeekInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/DayOfWeekInput.js.map +1 -1
- package/lib/components/DateTime/Input/TimeInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/TimeInput.js +3 -9
- package/lib/components/DateTime/Input/TimeInput.js.map +1 -1
- package/lib/components/DateTime/index.d.ts +1 -0
- package/lib/components/DateTime/index.d.ts.map +1 -1
- package/lib/components/DateTime/index.js +1 -0
- package/lib/components/DateTime/index.js.map +1 -1
- package/lib/components/Drawer/Drawer.d.ts.map +1 -1
- package/lib/components/Drawer/Drawer.js +4 -1
- package/lib/components/Drawer/Drawer.js.map +1 -1
- package/lib/components/Email/EmailDisplay.d.ts +2 -2
- package/lib/components/Email/EmailDisplay.d.ts.map +1 -1
- package/lib/components/Email/EmailDisplay.js.map +1 -1
- package/lib/components/ExpandCollapse/ExpandCollapse.js +1 -1
- package/lib/components/ExpandCollapse/ExpandCollapse.js.map +1 -1
- package/lib/components/FieldGroup/FieldGroupList.d.ts +1 -1
- package/lib/components/FieldGroup/FieldGroupList.d.ts.map +1 -1
- package/lib/components/FieldGroup/FieldGroupList.js +1 -1
- package/lib/components/FieldGroup/FieldGroupList.js.map +1 -1
- package/lib/components/FieldGroup/index.d.ts +1 -0
- package/lib/components/FieldGroup/index.d.ts.map +1 -1
- package/lib/components/FieldGroup/index.js +1 -0
- package/lib/components/FieldGroup/index.js.map +1 -1
- package/lib/components/FieldValueList/FieldValueList.d.ts +2 -2
- package/lib/components/FieldValueList/FieldValueList.d.ts.map +1 -1
- package/lib/components/FieldValueList/FieldValueList.js.map +1 -1
- package/lib/components/File/FileDisplay.d.ts +2 -2
- package/lib/components/File/FileDisplay.d.ts.map +1 -1
- package/lib/components/File/FileDisplay.js.map +1 -1
- package/lib/components/File/FileInput.d.ts +2 -2
- package/lib/components/File/FileInput.d.ts.map +1 -1
- package/lib/components/File/FileInput.js +4 -4
- package/lib/components/File/FileInput.js.map +1 -1
- package/lib/components/File/FileItem.d.ts +0 -2
- package/lib/components/File/FileItem.d.ts.map +1 -1
- package/lib/components/File/FileItem.js +2 -2
- package/lib/components/File/FileItem.js.map +1 -1
- package/lib/components/File/FileUploadItem.d.ts +2 -2
- package/lib/components/File/FileUploadItem.d.ts.map +1 -1
- package/lib/components/File/FileUploadItem.js +46 -39
- package/lib/components/File/FileUploadItem.js.map +1 -1
- package/lib/components/File/FileVisual.d.ts +5 -12
- package/lib/components/File/FileVisual.d.ts.map +1 -1
- package/lib/components/File/FileVisual.js +36 -47
- package/lib/components/File/FileVisual.js.map +1 -1
- package/lib/components/File/index.d.ts +1 -0
- package/lib/components/File/index.d.ts.map +1 -1
- package/lib/components/File/index.js +1 -0
- package/lib/components/File/index.js.map +1 -1
- package/lib/components/Flex/Flex.js +4 -4
- package/lib/components/Flex/Flex.js.map +1 -1
- package/lib/components/Grid/Grid.js +4 -4
- package/lib/components/Grid/Grid.js.map +1 -1
- package/lib/components/Icon/index.d.ts +1 -0
- package/lib/components/Icon/index.d.ts.map +1 -1
- package/lib/components/Icon/index.js +1 -0
- package/lib/components/Icon/index.js.map +1 -1
- package/lib/components/Image/index.d.ts +1 -1
- package/lib/components/Image/index.d.ts.map +1 -1
- package/lib/components/Image/index.js +1 -0
- package/lib/components/Image/index.js.map +1 -1
- package/lib/components/Input/Input.d.ts +2 -2
- package/lib/components/Input/Input.d.ts.map +1 -1
- package/lib/components/Input/Input.js.map +1 -1
- package/lib/components/Input/index.d.ts +1 -1
- package/lib/components/Input/index.d.ts.map +1 -1
- package/lib/components/Input/index.js.map +1 -1
- package/lib/components/Label/Label.d.ts +2 -2
- package/lib/components/Label/Label.d.ts.map +1 -1
- package/lib/components/Label/Label.js.map +1 -1
- package/lib/components/Lightbox/Lightbox.styles.d.ts +1 -1
- package/lib/components/Lightbox/Lightbox.styles.d.ts.map +1 -1
- package/lib/components/Link/Link.d.ts.map +1 -1
- package/lib/components/Link/Link.js +15 -12
- package/lib/components/Link/Link.js.map +1 -1
- package/lib/components/List/List.d.ts +2 -2
- package/lib/components/List/List.d.ts.map +1 -1
- package/lib/components/List/List.js.map +1 -1
- package/lib/components/Location/Location.types.d.ts +2 -1
- package/lib/components/Location/Location.types.d.ts.map +1 -1
- package/lib/components/Location/Location.types.js.map +1 -1
- package/lib/components/Location/index.d.ts +4 -4
- package/lib/components/Location/index.d.ts.map +1 -1
- package/lib/components/Location/index.js.map +1 -1
- package/lib/components/Menu/Menu.d.ts.map +1 -1
- package/lib/components/Menu/Menu.js +4 -3
- package/lib/components/Menu/Menu.js.map +1 -1
- package/lib/components/Menu/Menu.styles.d.ts +0 -1
- package/lib/components/Menu/Menu.styles.d.ts.map +1 -1
- package/lib/components/Menu/Menu.styles.js +10 -7
- package/lib/components/Menu/Menu.styles.js.map +1 -1
- package/lib/components/Menu/Menu.types.d.ts +2 -2
- package/lib/components/Menu/Menu.types.d.ts.map +1 -1
- package/lib/components/Menu/Menu.types.js.map +1 -1
- package/lib/components/MenuButton/MenuButton.d.ts.map +1 -1
- package/lib/components/MenuButton/MenuButton.js +1 -1
- package/lib/components/MenuButton/MenuButton.js.map +1 -1
- package/lib/components/MetaList/MetaList.d.ts +2 -2
- package/lib/components/MetaList/MetaList.d.ts.map +1 -1
- package/lib/components/MetaList/MetaList.js.map +1 -1
- package/lib/components/Modal/Contexts.d.ts.map +1 -1
- package/lib/components/Modal/Contexts.js +3 -2
- package/lib/components/Modal/Contexts.js.map +1 -1
- package/lib/components/Modal/Modal.d.ts.map +1 -1
- package/lib/components/Modal/Modal.js +11 -6
- package/lib/components/Modal/Modal.js.map +1 -1
- package/lib/components/Modal/Modal.styles.d.ts.map +1 -1
- package/lib/components/Modal/Modal.styles.js +0 -1
- package/lib/components/Modal/Modal.styles.js.map +1 -1
- package/lib/components/Modal/Modal.types.d.ts +4 -2
- package/lib/components/Modal/Modal.types.d.ts.map +1 -1
- package/lib/components/Modal/Modal.types.js +2 -1
- package/lib/components/Modal/Modal.types.js.map +1 -1
- package/lib/components/Modal/ModalManager.d.ts.map +1 -1
- package/lib/components/Modal/ModalManager.js +4 -3
- package/lib/components/Modal/ModalManager.js.map +1 -1
- package/lib/components/MultiStep/MultiStep.styles.d.ts.map +1 -1
- package/lib/components/MultiStep/MultiStep.styles.js +4 -1
- package/lib/components/MultiStep/MultiStep.styles.js.map +1 -1
- package/lib/components/MultiStep/MultiStep.types.d.ts +2 -2
- package/lib/components/MultiStep/MultiStep.types.d.ts.map +1 -1
- package/lib/components/MultiStep/MultiStep.types.js.map +1 -1
- package/lib/components/MultiStep/index.d.ts +1 -1
- package/lib/components/MultiStep/index.d.ts.map +1 -1
- package/lib/components/MultiStep/index.js.map +1 -1
- package/lib/components/Number/NumberDisplay.d.ts +2 -2
- package/lib/components/Number/NumberDisplay.d.ts.map +1 -1
- package/lib/components/Number/NumberDisplay.js.map +1 -1
- package/lib/components/Number/NumberInput.types.d.ts +2 -2
- package/lib/components/Number/NumberInput.types.d.ts.map +1 -1
- package/lib/components/Number/NumberInput.types.js.map +1 -1
- package/lib/components/PageTemplates/index.d.ts +2 -3
- package/lib/components/PageTemplates/index.d.ts.map +1 -1
- package/lib/components/PageTemplates/index.js +1 -1
- package/lib/components/PageTemplates/index.js.map +1 -1
- package/lib/components/Pagination/Pagination.d.ts +2 -2
- package/lib/components/Pagination/Pagination.d.ts.map +1 -1
- package/lib/components/Pagination/Pagination.js.map +1 -1
- package/lib/components/Paragraph/ParagraphDisplay.d.ts +11 -0
- package/lib/components/Paragraph/ParagraphDisplay.d.ts.map +1 -0
- package/lib/components/Paragraph/ParagraphDisplay.js +11 -0
- package/lib/components/Paragraph/ParagraphDisplay.js.map +1 -0
- package/lib/components/Paragraph/index.d.ts +3 -0
- package/lib/components/Paragraph/index.d.ts.map +1 -0
- package/lib/components/Paragraph/index.js +2 -0
- package/lib/components/Paragraph/index.js.map +1 -0
- package/lib/components/Phone/PhoneDisplay.d.ts +2 -2
- package/lib/components/Phone/PhoneDisplay.d.ts.map +1 -1
- package/lib/components/Phone/PhoneDisplay.js.map +1 -1
- package/lib/components/Phone/PhoneInput.d.ts +2 -2
- package/lib/components/Phone/PhoneInput.d.ts.map +1 -1
- package/lib/components/Phone/PhoneInput.js.map +1 -1
- package/lib/components/Popover/Popover.d.ts.map +1 -1
- package/lib/components/Popover/Popover.js +7 -1
- package/lib/components/Popover/Popover.js.map +1 -1
- package/lib/components/Popover/Popover.styles.d.ts.map +1 -1
- package/lib/components/Popover/Popover.styles.js +32 -17
- package/lib/components/Popover/Popover.styles.js.map +1 -1
- package/lib/components/Popover/modifiers.d.ts +3 -0
- package/lib/components/Popover/modifiers.d.ts.map +1 -0
- package/lib/components/Popover/modifiers.js +11 -0
- package/lib/components/Popover/modifiers.js.map +1 -0
- package/lib/components/Progress/Ellipsis.d.ts +1 -1
- package/lib/components/Progress/Ellipsis.d.ts.map +1 -1
- package/lib/components/Progress/Ellipsis.js +47 -47
- package/lib/components/Progress/Ellipsis.js.map +1 -1
- package/lib/components/Progress/Progress.types.d.ts +2 -2
- package/lib/components/Progress/Progress.types.d.ts.map +1 -1
- package/lib/components/Progress/Progress.types.js.map +1 -1
- package/lib/components/Progress/Ring.d.ts +1 -1
- package/lib/components/Progress/Ring.d.ts.map +1 -1
- package/lib/components/Progress/Ring.js +39 -39
- package/lib/components/Progress/Ring.js.map +1 -1
- package/lib/components/RadioButton/RadioButton.d.ts +2 -2
- package/lib/components/RadioButton/RadioButton.d.ts.map +1 -1
- package/lib/components/RadioButton/RadioButton.js.map +1 -1
- package/lib/components/RadioCheck/RadioCheck.d.ts +2 -2
- package/lib/components/RadioCheck/RadioCheck.d.ts.map +1 -1
- package/lib/components/RadioCheck/RadioCheck.js.map +1 -1
- package/lib/components/Rating/Rating.d.ts +2 -2
- package/lib/components/Rating/Rating.d.ts.map +1 -1
- package/lib/components/Rating/Rating.js.map +1 -1
- package/lib/components/SearchInput/SearchInput.d.ts +3 -3
- package/lib/components/SearchInput/SearchInput.d.ts.map +1 -1
- package/lib/components/SearchInput/SearchInput.js.map +1 -1
- package/lib/components/Select/index.d.ts +2 -3
- package/lib/components/Select/index.d.ts.map +1 -1
- package/lib/components/Select/index.js.map +1 -1
- package/lib/components/Sentiment/Sentiment.d.ts +2 -2
- package/lib/components/Sentiment/Sentiment.d.ts.map +1 -1
- package/lib/components/Sentiment/Sentiment.js.map +1 -1
- package/lib/components/Slider/Slider.types.d.ts +2 -2
- package/lib/components/Slider/Slider.types.d.ts.map +1 -1
- package/lib/components/Slider/Slider.types.js.map +1 -1
- package/lib/components/SummaryItem/SummaryItem.d.ts +2 -2
- package/lib/components/SummaryItem/SummaryItem.d.ts.map +1 -1
- package/lib/components/SummaryItem/SummaryItem.js.map +1 -1
- package/lib/components/Switch/Switch.d.ts +2 -2
- package/lib/components/Switch/Switch.d.ts.map +1 -1
- package/lib/components/Switch/Switch.js.map +1 -1
- package/lib/components/Table/Table.d.ts +2 -2
- package/lib/components/Table/Table.d.ts.map +1 -1
- package/lib/components/Table/Table.js.map +1 -1
- package/lib/components/Table/index.d.ts +1 -2
- package/lib/components/Table/index.d.ts.map +1 -1
- package/lib/components/Table/index.js.map +1 -1
- package/lib/components/Tabs/Tabs.js +1 -1
- package/lib/components/Tabs/Tabs.js.map +1 -1
- package/lib/components/Tabs/Tabs.types.d.ts +2 -2
- package/lib/components/Tabs/Tabs.types.d.ts.map +1 -1
- package/lib/components/Tabs/Tabs.types.js.map +1 -1
- package/lib/components/TextArea/TextArea.d.ts +2 -2
- package/lib/components/TextArea/TextArea.d.ts.map +1 -1
- package/lib/components/TextArea/TextArea.js +1 -3
- package/lib/components/TextArea/TextArea.js.map +1 -1
- package/lib/components/TextArea/index.d.ts +1 -1
- package/lib/components/TextArea/index.d.ts.map +1 -1
- package/lib/components/TextArea/index.js.map +1 -1
- package/lib/components/Tree/index.d.ts +1 -1
- package/lib/components/Tree/index.d.ts.map +1 -1
- package/lib/components/Tree/index.js.map +1 -1
- package/lib/components/URL/URLDisplay.d.ts +2 -2
- package/lib/components/URL/URLDisplay.d.ts.map +1 -1
- package/lib/components/URL/URLDisplay.js.map +1 -1
- package/lib/components/VisuallyHiddenText/VisuallyHiddenText.d.ts +10 -0
- package/lib/components/VisuallyHiddenText/VisuallyHiddenText.d.ts.map +1 -0
- package/lib/components/VisuallyHiddenText/VisuallyHiddenText.js +10 -0
- package/lib/components/VisuallyHiddenText/VisuallyHiddenText.js.map +1 -0
- package/lib/components/VisuallyHiddenText/index.d.ts +2 -0
- package/lib/components/VisuallyHiddenText/index.d.ts.map +1 -0
- package/lib/components/VisuallyHiddenText/index.js +2 -0
- package/lib/components/VisuallyHiddenText/index.js.map +1 -0
- package/lib/hooks/useI18n.d.ts +35 -1
- package/lib/hooks/useI18n.d.ts.map +1 -1
- package/lib/i18n/default.d.ts +35 -1
- package/lib/i18n/default.d.ts.map +1 -1
- package/lib/i18n/default.js +39 -3
- package/lib/i18n/default.js.map +1 -1
- package/lib/i18n/i18n.d.ts +70 -2
- package/lib/i18n/i18n.d.ts.map +1 -1
- package/lib/index.d.ts +4 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +4 -0
- package/lib/index.js.map +1 -1
- package/lib/utils/utils.d.ts +0 -5
- package/lib/utils/utils.d.ts.map +1 -1
- package/lib/utils/utils.js +0 -8
- package/lib/utils/utils.js.map +1 -1
- package/package.json +10 -10
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppShell.d.ts","sourceRoot":"","sources":["../../../src/components/AppShell/AppShell.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EAWjB,EAAE,EAIH,MAAM,OAAO,CAAC;AAiBf,OAAO,KAAK,EAAE,YAAY,EAAc,MAAM,aAAa,CAAC;AA6C5D,OAAO,EACL,aAAa,EAOb,UAAU,EACX,MAAM,kBAAkB,CAAC;AAsR1B,eAAO,MAAM,KAAK,EAAE,EAAE,CAAC,UAAU,CAmGhC,CAAC;AAEF,QAAA,MAAM,QAAQ,EAAE,iBAAiB,CAAC,aAAa,GAAG,YAAY,
|
|
1
|
+
{"version":3,"file":"AppShell.d.ts","sourceRoot":"","sources":["../../../src/components/AppShell/AppShell.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EAWjB,EAAE,EAIH,MAAM,OAAO,CAAC;AAiBf,OAAO,KAAK,EAAE,YAAY,EAAc,MAAM,aAAa,CAAC;AA6C5D,OAAO,EACL,aAAa,EAOb,UAAU,EACX,MAAM,kBAAkB,CAAC;AAsR1B,eAAO,MAAM,KAAK,EAAE,EAAE,CAAC,UAAU,CAmGhC,CAAC;AAEF,QAAA,MAAM,QAAQ,EAAE,iBAAiB,CAAC,aAAa,GAAG,YAAY,CA0Q7D,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
|
@@ -259,6 +259,7 @@ const AppShell = forwardRef((props, ref) => {
|
|
|
259
259
|
caseTypes, links, banners, environment: { name: envName, color: envColor } = {}, main, operator, utils, cases, ...restProps } = props;
|
|
260
260
|
const { appName, portalName, href: appInfoHref, imageSrc: logoSrc, ...appInfoRestProps } = appInfo;
|
|
261
261
|
const t = useI18n();
|
|
262
|
+
const { start } = useDirection();
|
|
262
263
|
const theme = useTheme();
|
|
263
264
|
const navRef = useConsolidatedRef(ref);
|
|
264
265
|
const [drawerOpen, setDrawerOpen] = useState(false);
|
|
@@ -274,6 +275,7 @@ const AppShell = forwardRef((props, ref) => {
|
|
|
274
275
|
const showMainContent = showAppHeader ? headerEl || mobileHeaderEl : true;
|
|
275
276
|
const openNavTimeoutId = useRef();
|
|
276
277
|
const closeNavTimeoutId = useRef();
|
|
278
|
+
const previewTriggerRef = useRef(null);
|
|
277
279
|
const { state: navState, set: setNavState } = useTransitionState({
|
|
278
280
|
ref: navRef,
|
|
279
281
|
property: 'width',
|
|
@@ -340,7 +342,6 @@ const AppShell = forwardRef((props, ref) => {
|
|
|
340
342
|
alignItems: 'center',
|
|
341
343
|
areas: portalName ? '"logo app" "logo portal"' : '"logo app"'
|
|
342
344
|
}, children: [_jsx(Grid, { item: { area: 'logo' }, as: Image, src: logoSrc, alt: appName }, void 0), _jsx(Grid, { item: { area: 'app' }, as: 'span', children: appName }, void 0), portalName && (_jsx(Grid, { item: { area: 'portal' }, as: 'span', children: portalName }, void 0))] }, void 0)), searchInput && !showAppHeader && (_jsx(StyledSearchForm, { role: 'search', "aria-label": searchLabel, onSubmit: e => e.preventDefault(), children: _jsx(SearchInput, { ...searchInput }, void 0) }, void 0)), _jsxs(StyledScrollWrap, { children: [caseTypes && _jsx(CaseTypes, { caseTypes: caseTypes }, void 0), links && _jsx(Links, { links: links }, void 0), cases && _jsx(Cases, { cases: cases }, void 0)] }, void 0), _jsx(Utils, { appHeader: showAppHeader, operator: operator, items: utils }, void 0)] }, void 0));
|
|
343
|
-
const { start } = useDirection();
|
|
344
345
|
return (_jsxs(AppShellContext.Provider, { value: useMemo(() => ({
|
|
345
346
|
navOpen: mobileNavOpen || navState === 'open' || navState === 'opening',
|
|
346
347
|
navState,
|
|
@@ -349,7 +350,8 @@ const AppShell = forwardRef((props, ref) => {
|
|
|
349
350
|
refocusEl,
|
|
350
351
|
setRefocusEl,
|
|
351
352
|
focusedImperatively,
|
|
352
|
-
headerEl: headerEl || mobileHeaderEl
|
|
353
|
+
headerEl: headerEl || mobileHeaderEl,
|
|
354
|
+
previewTriggerRef
|
|
353
355
|
}), [navState, mobileNavOpen, drawerOpen, refocusEl, headerEl, mobileHeaderEl]), children: [_jsx(SkipNavigation, {}, void 0), showAppHeader && (_jsx(AppHeader, { ...appInfo, searchInput: searchInput, searchLabel: searchLabel, operator: operator, ref: setHeaderEl }, void 0)), isSmallOrAbove ? (appShellJSX) : (_jsxs(_Fragment, { children: [_jsx(Flex, { as: StyledMobileNav, container: { alignItems: 'center' }, ref: setMobileHeaderEl, children: _jsx(Button, { variant: 'simple', onClick: () => setMobileNavBackdrop(true), "aria-label": t('app_shell_open_nav'), icon: true, children: _jsx(Icon, { name: 'bars' }, void 0) }, void 0) }, void 0), _jsx(Backdrop, { open: mobileNavBackdrop, transitionSpeed: 'none', onAfterTransitionIn: () => setMobileNavOpen(true), onBeforeTransitionOut: () => setMobileNavOpen(false), onClick: e => {
|
|
354
356
|
if (e.currentTarget === e.target)
|
|
355
357
|
setMobileNavOpen(false);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppShell.js","sourceRoot":"","sources":["../../../src/components/AppShell/AppShell.tsx"],"names":[],"mappings":";;AAAA,OAAO,EAEL,UAAU,EAGV,QAAQ,EACR,WAAW,EACX,SAAS,EACT,OAAO,EAEP,UAAU,EACV,MAAM,EAIN,eAAe,EAChB,MAAM,OAAO,CAAC;AAEf,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,KAAK,MAAM,iBAAiB,CAAC;AACpC,OAAO,UAAU,MAAM,sBAAsB,CAAC;AAC9C,OAAO,WAAW,MAAM,gBAAgB,CAAC;AACzC,OAAO,IAAI,EAAE,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,KAAK,SAAS,MAAM,0BAA0B,CAAC;AACtD,OAAO,KAAK,QAAQ,MAAM,yBAAyB,CAAC;AACpD,OAAO,KAAK,aAAa,MAAM,+BAA+B,CAAC;AAC/D,OAAO,KAAK,QAAQ,MAAM,yBAAyB,CAAC;AACpD,OAAO,KAAK,aAAa,MAAM,+BAA+B,CAAC;AAC/D,OAAO,KAAK,cAAc,MAAM,gCAAgC,CAAC;AACjE,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,KAAK,MAAM,UAAU,CAAC;AAC7B,OAAO,cAAc,MAAM,mBAAmB,CAAC;AAE/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,qBAAqB,EAAE,GAAG,EAAE,CAAC,gBAAgB,CAAC,KAAK,CAAC,EACpD,OAAO,EAAE,CAAC,CAAC,EAAE;4BACX,IAAI,CAAC,CAAC,aAAa,KAAK,CAAC,CAAC,MAAM;gCAAE,gBAAgB,CAAC,KAAK,CAAC,CAAC;wBAC5D,CAAC,YAED,KAAC,MAAM,IACL,IAAI,EAAE,aAAa,EACnB,YAAY,EAAE,GAAG,EAAE;gCACjB,oBAAoB,CAAC,KAAK,CAAC,CAAC;4BAC9B,CAAC,EACD,QAAQ,EAAC,OAAO,EAChB,SAAS,EAAE,KAAK,EAChB,IAAI,EAAC,qCAAqC,EAC1C,cAAc,kBAEb,WAAW,WACL,WACA,YACV,CACJ,EACA,eAAe,IAAI,CAClB,MAAC,aAAa,IACZ,QAAQ,EAAE,CAAC,CAAC,EACZ,SAAS,EAAE,aAAa,EACxB,SAAS,EAAE,CAAC,cAAc,EAC1B,YAAY,EAAE,cAAc,CAAC,CAAC,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC,CAAC,cAAc,EAAE,YAAY,aAEnF,OAAO,IAAI,KAAC,kBAAkB,cAAE,OAAO,WAAsB,EAC7D,IAAI,YACS,CACjB,YACwB,CAC5B,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,QAAQ,CAAC","sourcesContent":["import {\n FunctionComponent,\n forwardRef,\n PropsWithoutRef,\n Ref,\n useState,\n useCallback,\n useEffect,\n useMemo,\n ElementType,\n useContext,\n useRef,\n FC,\n MouseEventHandler,\n MutableRefObject,\n useLayoutEffect\n} from 'react';\n\nimport Flex from '../Flex';\nimport Link from '../Link';\nimport Count from '../Badges/Count';\nimport BareButton from '../Button/BareButton';\nimport SearchInput from '../SearchInput';\nimport Icon, { registerIcon } from '../Icon';\nimport * as timesIcon from '../Icon/icons/times.icon';\nimport * as plusIcon from '../Icon/icons/plus.icon';\nimport * as caseSolidIcon from '../Icon/icons/case-solid.icon';\nimport * as barsIcon from '../Icon/icons/bars.icon';\nimport * as caretLeftIcon from '../Icon/icons/caret-left.icon';\nimport * as caretRightIcon from '../Icon/icons/caret-right.icon';\nimport Text from '../Text';\nimport Image from '../Image';\nimport ExpandCollapse from '../ExpandCollapse';\nimport type { ForwardProps, OmitStrict } from '../../types';\nimport {\n useFocusWithin,\n useI18n,\n useBreakpoint,\n useConsolidatedRef,\n useDirection,\n useTheme,\n useElement,\n useTransitionState\n} from '../../hooks';\nimport { openCloseStates } from '../../hooks/useTransitionState';\nimport Grid from '../Grid';\nimport Button from '../Button';\nimport Drawer from '../Drawer';\nimport type { PopoverProps } from '../Popover';\nimport Backdrop from '../Backdrop';\nimport { documentIsAvailable } from '../../utils';\n\nimport AppShellContext from './AppShellContext';\nimport AppShellDrawer from './Drawer';\nimport AppShellOperator from './Operator';\nimport AppHeader from './AppHeader';\nimport SkipNavigation from './SkipNavigation';\nimport {\n StyledAppNav,\n StyledAppInfo,\n StyledSearchForm,\n StyledCaseTypes,\n StyledScrollWrap,\n StyledUtils,\n StyledNavList,\n StyledNestedNavList,\n StyledNavListItem,\n StyledNavListMenuButton,\n StyledAppMain,\n StyledCaseClose,\n StyledAppShellNavIcon,\n StyledNavCasesList,\n StyledAppEnvironment,\n StyledBannerRegion,\n StyledCountIcon,\n StyledUtilIconCount,\n StyledMobileNav\n} from './AppShell.styles';\nimport {\n AppShellProps,\n CaseProps,\n CaseTypeProps,\n LinkProps,\n NavListItemProps,\n NavListProps,\n UtilItemProps,\n UtilsProps\n} from './AppShell.types';\n\nregisterIcon(timesIcon, plusIcon, caseSolidIcon, barsIcon, caretRightIcon, caretLeftIcon);\n\nconst NavComponents: {\n List: FunctionComponent<NavListProps>;\n ListItem: FunctionComponent<NavListItemProps>;\n} = {\n List(props: NavListProps) {\n const { items = [], nestedList, collapsed } = props;\n let Component: ElementType = StyledNavList;\n let fwdProps: {\n as?: ElementType;\n forwardedAs?: ElementType;\n nullWhenCollapsed?: boolean;\n transitionSpeed?: string;\n collapsed: boolean;\n } = {\n collapsed: !!collapsed\n };\n\n const {\n base: { animation }\n } = useTheme();\n\n if (nestedList) {\n fwdProps = {\n as: ExpandCollapse,\n forwardedAs: 'ul',\n nullWhenCollapsed: true,\n transitionSpeed: items.length >= 10 ? `calc(2 * ${animation.speed})` : animation.speed,\n ...fwdProps\n };\n\n Component = StyledNestedNavList;\n }\n\n return (\n <Component {...fwdProps}>\n {items?.map(item => (\n <NavComponents.ListItem {...item} key={item.id || item.primary} />\n ))}\n </Component>\n );\n },\n ListItem(props: NavListItemProps) {\n const { navOpen } = useContext(AppShellContext);\n const {\n visual,\n primary,\n secondary,\n href,\n onClick,\n items,\n collapseItems = false,\n dismissible = false,\n onDismiss,\n active,\n actions,\n forwardedRef,\n ...restProps\n } = props;\n\n const t = useI18n();\n\n const hasItems = Array.isArray(items) && items.length > 0;\n const compProps: {\n href?: string;\n variant?: string;\n onClick?: MouseEventHandler<HTMLAnchorElement | HTMLButtonElement | HTMLDivElement>;\n actions?: NavListItemProps['actions'];\n as?: ElementType<any>;\n popover?: OmitStrict<PopoverProps, 'show' | 'target' | 'children'>;\n } = {\n onClick,\n href\n };\n\n let Component: ElementType;\n\n if (actions) {\n Component = AppShellOperator;\n compProps.actions = actions;\n compProps.as = StyledNavListMenuButton;\n compProps.popover = {\n placement: 'right-end',\n modifiers: [\n {\n name: 'offset',\n options: { offset: [-12, -16] }\n },\n {\n name: 'flip',\n options: {\n boundary: documentIsAvailable ? document.body : undefined,\n fallbackPlacements: ['top-end']\n }\n }\n ]\n };\n } else if (href) {\n Component = Link;\n } else if (onClick) {\n Component = BareButton;\n } else {\n Component = 'div';\n }\n\n useEffect(() => {\n if (!navOpen && actions) {\n const node = document.getElementsByTagName('body')[0];\n const clickEvent = document.createEvent('MouseEvent');\n clickEvent.initEvent('mousedown', true, true);\n node.dispatchEvent(clickEvent);\n }\n }, [navOpen]);\n\n const { end } = useDirection();\n\n return (\n <StyledNavListItem\n {...restProps}\n key={primary}\n nestedListCollapsed={hasItems ? collapseItems : true}\n >\n {/* forwardedRef typed as 'any' due to ambiguity of Component element type */}\n <Component {...compProps} ref={forwardedRef as any}>\n {visual}\n {secondary ? (\n <Flex container={{ direction: 'column', alignItems: 'start' }}>\n <span>{primary}</span>\n <Text variant='secondary'>{secondary}</Text>\n </Flex>\n ) : (\n <span>{primary}</span>\n )}\n {(hasItems || actions) && <Icon name={`caret-${end}`} as={StyledAppShellNavIcon} />}\n </Component>\n {dismissible && (\n <Button\n icon\n variant='simple'\n as={StyledCaseClose}\n onClick={onDismiss}\n aria-label={t('dismiss_case')}\n >\n <Icon name='times' />\n </Button>\n )}\n {hasItems && (\n <NavComponents.List nestedList items={items} collapsed={!navOpen || collapseItems} />\n )}\n </StyledNavListItem>\n );\n }\n};\n\nconst CaseTypes: FunctionComponent<{ caseTypes: CaseTypeProps[] }> = ({\n caseTypes\n}: {\n caseTypes: CaseTypeProps[];\n}) => {\n const { navOpen } = useContext(AppShellContext);\n const [expanded, setExpanded] = useState(false);\n const t = useI18n();\n\n const toggleExpanded = useCallback(() => {\n setExpanded(state => !state);\n }, []);\n\n useEffect(() => {\n if (!navOpen) setExpanded(false);\n }, [navOpen]);\n const transformedCaseTypes = caseTypes.map(caseType => {\n return {\n ...caseType,\n primary: caseType.name\n };\n });\n return useMemo(\n () => (\n <StyledCaseTypes expanded={expanded && navOpen}>\n <NavComponents.List\n items={[\n {\n primary: t('app_shell_create'),\n visual: <Icon name='plus' as={StyledAppShellNavIcon} />,\n onClick: toggleExpanded,\n items: transformedCaseTypes,\n collapseItems: !expanded || !navOpen\n }\n ]}\n />\n </StyledCaseTypes>\n ),\n [expanded, navOpen, toggleExpanded, caseTypes]\n );\n};\n\nconst Links: FunctionComponent<{ links: LinkProps[] }> = (props: { links: LinkProps[] }) => {\n const { links } = props;\n const navLinksRef = useRef<NavListItemProps[]>([]);\n const [transformedLinks, setTransformedLinks] = useState<NavListItemProps[]>([]);\n\n const toggleExpanded = (id: string) => {\n const updatedLinks = navLinksRef.current.map(link => {\n if (link.id === id) return { ...link, collapseItems: !link.collapseItems };\n return { ...link };\n });\n setTransformedLinks(updatedLinks);\n };\n\n // TODO: Can this be a memo instead of a state and an effect?\n const mergedNavLinks = (items: LinkProps[]): NavListItemProps[] => {\n return items.map((link: LinkProps) => {\n return {\n ...link,\n primary: link.name,\n 'aria-current': link.active ? 'page' : null,\n visual: link.icon ? <Icon name={link.icon} as={StyledAppShellNavIcon} /> : null,\n onClick: link.links ? () => toggleExpanded(link.id) : link.onClick,\n items: link.links ? mergedNavLinks(link.links) : undefined,\n collapseItems: true\n };\n });\n };\n\n useEffect(() => {\n setTransformedLinks(mergedNavLinks(links));\n }, [links]);\n\n useEffect(() => {\n navLinksRef.current = transformedLinks;\n }, [transformedLinks]);\n\n return (\n <div>\n <NavComponents.List items={transformedLinks} />\n </div>\n );\n};\n\nconst Cases: FunctionComponent<{ cases: CaseProps[] }> = (props: { cases: CaseProps[] }) => {\n const { cases } = props;\n\n const setupCases = (items: CaseProps[]): NavListItemProps[] => {\n return items.map((item: CaseProps) => {\n const {\n id,\n primary,\n secondary,\n visual = <Icon name='case-solid' as={StyledAppShellNavIcon} />,\n active,\n onClick,\n onDismiss\n } = item;\n return {\n id,\n 'aria-current': active ? 'page' : undefined,\n primary,\n secondary,\n active: !!active,\n dismissible: true,\n onClick,\n onDismiss,\n visual\n };\n });\n };\n\n return (\n <StyledNavCasesList>\n <NavComponents.List items={setupCases(cases)} />\n </StyledNavCasesList>\n );\n};\n\n// TODO: Need to add back re-focus support to drawer.\nexport const Utils: FC<UtilsProps> = ({ operator, items, appHeader }) => {\n const { drawerOpen, setDrawerOpen, focusedImperatively } = useContext(AppShellContext);\n const [transformedLinks, setTransformedLinks] = useState<NavListItemProps[]>([]);\n const [item, setItem] = useState<UtilItemProps>();\n const [activeUtilItem, setActiveUtilItem] = useState('');\n const returnFocusRef: MutableRefObject<\n HTMLAnchorElement | HTMLDivElement | HTMLButtonElement | null\n > = useRef(null);\n\n const operatorInfo: NavListItemProps[] = useMemo(\n () =>\n appHeader\n ? []\n : [\n {\n primary: operator.name,\n visual: operator.avatar,\n actions: operator.actions\n }\n ],\n [appHeader, operator.name, operator.avatar, operator.actions]\n );\n\n // TODO: Can this be a memo instead of a state and an effect?\n const mergedUtilItems = (drawerItems: UtilItemProps[]): NavListItemProps[] => {\n return drawerItems?.map((drawerItem: UtilItemProps) => {\n return {\n onClick: e => {\n returnFocusRef.current = e.currentTarget;\n if (drawerItem.drawerView) {\n setItem(drawerItem);\n setActiveUtilItem(drawerItem.name);\n }\n },\n ...drawerItem,\n primary: drawerItem.name,\n visual: drawerItem.count ? (\n <StyledUtilIconCount>\n {drawerItem.visual}\n <Count as={StyledCountIcon} variant='urgent'>\n {drawerItem.count}\n </Count>\n </StyledUtilIconCount>\n ) : (\n drawerItem.visual\n )\n };\n });\n };\n\n useEffect(() => {\n if (items) {\n setTransformedLinks([...mergedUtilItems(items)!, ...operatorInfo]);\n } else {\n setTransformedLinks(operatorInfo);\n }\n }, [items, operatorInfo]);\n\n useEffect(() => {\n items?.forEach(uItem => {\n if (uItem.name === activeUtilItem) {\n setItem(uItem);\n }\n });\n }, [items]);\n\n useEffect(() => {\n if (item) setDrawerOpen(true);\n }, [item]);\n\n useEffect(() => {\n if (!drawerOpen) {\n setActiveUtilItem('');\n focusedImperatively.current = true;\n returnFocusRef?.current?.focus();\n }\n }, [drawerOpen]);\n\n return (\n <>\n <StyledUtils>\n <NavComponents.List\n // Pull onDrawerOpen and onDrawerClose off to avoid DOM passthrough warning.\n items={transformedLinks.map(({ onDrawerOpen, onDrawerClose, ...util }) => util)}\n />\n </StyledUtils>\n {item && (\n <AppShellDrawer\n content={item.drawerView}\n header={item.drawerHeader || item.name}\n onDrawerClose={() => {\n setItem(undefined);\n item.onDrawerClose?.();\n }}\n onDrawerOpen={item.onDrawerOpen}\n />\n )}\n </>\n );\n};\n\nconst AppShell: FunctionComponent<AppShellProps & ForwardProps> = forwardRef(\n (props: PropsWithoutRef<AppShellProps>, ref: Ref<HTMLDivElement>) => {\n const {\n appInfo,\n searchInput,\n appHeader,\n searchLabel = 'Sitewide', // FIXME: TR\n caseTypes,\n links,\n banners,\n environment: { name: envName, color: envColor } = {},\n main,\n operator,\n utils,\n cases,\n ...restProps\n } = props;\n const {\n appName,\n portalName,\n href: appInfoHref,\n imageSrc: logoSrc,\n ...appInfoRestProps\n } = appInfo;\n\n const t = useI18n();\n const theme = useTheme();\n const navRef = useConsolidatedRef(ref);\n const [drawerOpen, setDrawerOpen] = useState(false);\n const [mobileNavOpen, setMobileNavOpen] = useState(false);\n const [mobileNavBackdrop, setMobileNavBackdrop] = useState(false);\n const [refocusEl, setRefocusEl] = useState<HTMLButtonElement | null>(null);\n const focusedImperatively = useRef(false);\n const [headerEl, setHeaderEl] = useElement<HTMLDivElement>();\n const [mobileHeaderEl, setMobileHeaderEl] = useElement<HTMLDivElement>();\n const isXlOrAbove = useBreakpoint('xl');\n const isSmallOrAbove = useBreakpoint('sm');\n\n const showAppHeader = !!appHeader && isSmallOrAbove;\n const showMainContent = showAppHeader ? headerEl || mobileHeaderEl : true;\n const openNavTimeoutId = useRef<ReturnType<typeof setTimeout>>();\n const closeNavTimeoutId = useRef<ReturnType<typeof setTimeout>>();\n\n const { state: navState, set: setNavState } = useTransitionState({\n ref: navRef,\n property: 'width',\n states: openCloseStates,\n defaultState: isXlOrAbove ? 'open' : 'closed'\n });\n\n const openNav = useCallback((delay: number = 0) => {\n if (closeNavTimeoutId.current) clearTimeout(closeNavTimeoutId.current);\n openNavTimeoutId.current = setTimeout(() => {\n setNavState('open');\n }, delay);\n }, []);\n\n const closeNav = useCallback((delay: number = 0) => {\n if (openNavTimeoutId.current) clearTimeout(openNavTimeoutId.current);\n closeNavTimeoutId.current = setTimeout(() => {\n setNavState('closed');\n }, delay);\n }, []);\n\n const onFocus = useCallback(() => {\n if (!focusedImperatively.current && isSmallOrAbove) openNav();\n focusedImperatively.current = false;\n }, [openNav, isSmallOrAbove]);\n\n const onKeydown = useCallback(({ key }: KeyboardEvent) => {\n if (key === 'Escape') setMobileNavOpen(false);\n }, []);\n\n useFocusWithin<HTMLElement>(\n [navRef],\n useCallback(\n (isFocused: boolean, navElement: Element | null) => {\n if (!isFocused && !navElement?.matches(':hover')) closeNav();\n },\n [closeNav]\n )\n );\n\n useLayoutEffect(() => {\n if (isXlOrAbove) {\n openNav();\n } else {\n closeNav();\n }\n }, [isXlOrAbove]);\n\n useEffect(() => {\n if (navState === 'closed' || navState === 'closing') setDrawerOpen(false);\n }, [navState]);\n\n useEffect(() => {\n if (mobileNavOpen) {\n document.addEventListener('keydown', onKeydown);\n return () => {\n document.removeEventListener('keydown', onKeydown);\n };\n }\n }, [mobileNavOpen]);\n\n useEffect(() => {\n if (isSmallOrAbove && mobileNavOpen) {\n setMobileNavBackdrop(false);\n setMobileNavOpen(false);\n }\n }, [isSmallOrAbove, mobileNavOpen]);\n\n const appShellJSX = (\n <Flex\n {...restProps}\n container={{\n direction: 'column',\n justify: 'between'\n }}\n ref={navRef}\n as={StyledAppNav}\n appHeader={showAppHeader}\n navOpen={mobileNavOpen}\n showEnv={!!envName}\n onFocus={onFocus}\n onMouseEnter={isSmallOrAbove && !isXlOrAbove ? () => openNav(200) : undefined}\n onMouseLeave={isSmallOrAbove && !isXlOrAbove ? () => closeNav(200) : undefined}\n >\n {envName && (\n <StyledAppEnvironment\n item={{ shrink: 0 }}\n color={envColor ?? theme.base.colors.red['extra-light']}\n >\n {envName}\n </StyledAppEnvironment>\n )}\n {!showAppHeader && (\n <StyledAppInfo\n as={Grid}\n forwardedAs={appInfoHref ? (Link as any) : 'div'}\n href={appInfoHref}\n aria-label={`${appName}${portalName ? ` - ${portalName}` : ''}`}\n {...appInfoRestProps}\n container={{\n alignItems: 'center',\n areas: portalName ? '\"logo app\" \"logo portal\"' : '\"logo app\"'\n }}\n >\n <Grid item={{ area: 'logo' }} as={Image} src={logoSrc} alt={appName} />\n <Grid item={{ area: 'app' }} as='span'>\n {appName}\n </Grid>\n {portalName && (\n <Grid item={{ area: 'portal' }} as='span'>\n {portalName}\n </Grid>\n )}\n </StyledAppInfo>\n )}\n\n {searchInput && !showAppHeader && (\n <StyledSearchForm\n role='search'\n aria-label={searchLabel}\n onSubmit={e => e.preventDefault()}\n >\n <SearchInput {...searchInput} />\n </StyledSearchForm>\n )}\n\n <StyledScrollWrap>\n {caseTypes && <CaseTypes caseTypes={caseTypes} />}\n {links && <Links links={links} />}\n {cases && <Cases cases={cases} />}\n </StyledScrollWrap>\n\n <Utils appHeader={showAppHeader} operator={operator} items={utils} />\n </Flex>\n );\n\n const { start } = useDirection();\n\n return (\n <AppShellContext.Provider\n value={useMemo(\n () => ({\n navOpen: mobileNavOpen || navState === 'open' || navState === 'opening',\n navState,\n drawerOpen,\n setDrawerOpen,\n refocusEl,\n setRefocusEl,\n focusedImperatively,\n headerEl: headerEl || mobileHeaderEl\n }),\n [navState, mobileNavOpen, drawerOpen, refocusEl, headerEl, mobileHeaderEl]\n )}\n >\n <SkipNavigation />\n {showAppHeader && (\n <AppHeader\n {...appInfo}\n searchInput={searchInput}\n searchLabel={searchLabel}\n operator={operator}\n ref={setHeaderEl}\n />\n )}\n\n {isSmallOrAbove ? (\n appShellJSX\n ) : (\n <>\n <Flex as={StyledMobileNav} container={{ alignItems: 'center' }} ref={setMobileHeaderEl}>\n <Button\n variant='simple'\n onClick={() => setMobileNavBackdrop(true)}\n aria-label={t('app_shell_open_nav')}\n icon\n >\n <Icon name='bars' />\n </Button>\n </Flex>\n\n <Backdrop\n open={mobileNavBackdrop}\n transitionSpeed='none'\n onAfterTransitionIn={() => setMobileNavOpen(true)}\n onBeforeTransitionOut={() => setMobileNavOpen(false)}\n onClick={e => {\n if (e.currentTarget === e.target) setMobileNavOpen(false);\n }}\n >\n <Drawer\n open={mobileNavOpen}\n onAfterClose={() => {\n setMobileNavBackdrop(false);\n }}\n position='fixed'\n placement={start}\n size='min(18.75rem, calc(100vw - 3.5rem))'\n nullWhenClosed\n >\n {appShellJSX}\n </Drawer>\n </Backdrop>\n </>\n )}\n {showMainContent && (\n <StyledAppMain\n tabIndex={-1}\n appHeader={showAppHeader}\n mobileNav={!isSmallOrAbove}\n headerOffset={isSmallOrAbove ? headerEl?.offsetHeight : mobileHeaderEl?.offsetHeight}\n >\n {banners && <StyledBannerRegion>{banners}</StyledBannerRegion>}\n {main}\n </StyledAppMain>\n )}\n </AppShellContext.Provider>\n );\n }\n);\n\nexport default AppShell;\n"]}
|
|
1
|
+
{"version":3,"file":"AppShell.js","sourceRoot":"","sources":["../../../src/components/AppShell/AppShell.tsx"],"names":[],"mappings":";;AAAA,OAAO,EAEL,UAAU,EAGV,QAAQ,EACR,WAAW,EACX,SAAS,EACT,OAAO,EAEP,UAAU,EACV,MAAM,EAIN,eAAe,EAChB,MAAM,OAAO,CAAC;AAEf,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,KAAK,MAAM,iBAAiB,CAAC;AACpC,OAAO,UAAU,MAAM,sBAAsB,CAAC;AAC9C,OAAO,WAAW,MAAM,gBAAgB,CAAC;AACzC,OAAO,IAAI,EAAE,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,KAAK,SAAS,MAAM,0BAA0B,CAAC;AACtD,OAAO,KAAK,QAAQ,MAAM,yBAAyB,CAAC;AACpD,OAAO,KAAK,aAAa,MAAM,+BAA+B,CAAC;AAC/D,OAAO,KAAK,QAAQ,MAAM,yBAAyB,CAAC;AACpD,OAAO,KAAK,aAAa,MAAM,+BAA+B,CAAC;AAC/D,OAAO,KAAK,cAAc,MAAM,gCAAgC,CAAC;AACjE,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,KAAK,MAAM,UAAU,CAAC;AAC7B,OAAO,cAAc,MAAM,mBAAmB,CAAC;AAE/C,OAAO,EACL,cAAc,EACd,OAAO,EACP,aAAa,EACb,kBAAkB,EAClB,YAAY,EACZ,QAAQ,EACR,UAAU,EACV,k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AAE,CAAC,gBAAgB,CAAC,KAAK,CAAC,EACpD,OAAO,EAAE,CAAC,CAAC,EAAE;4BACX,IAAI,CAAC,CAAC,aAAa,KAAK,CAAC,CAAC,MAAM;gCAAE,gBAAgB,CAAC,KAAK,CAAC,CAAC;wBAC5D,CAAC,YAED,KAAC,MAAM,IACL,IAAI,EAAE,aAAa,EACnB,YAAY,EAAE,GAAG,EAAE;gCACjB,oBAAoB,CAAC,KAAK,CAAC,CAAC;4BAC9B,CAAC,EACD,QAAQ,EAAC,OAAO,EAChB,SAAS,EAAE,KAAK,EAChB,IAAI,EAAC,qCAAqC,EAC1C,cAAc,kBAEb,WAAW,WACL,WACA,YACV,CACJ,EACA,eAAe,IAAI,CAClB,MAAC,aAAa,IACZ,QAAQ,EAAE,CAAC,CAAC,EACZ,SAAS,EAAE,aAAa,EACxB,SAAS,EAAE,CAAC,cAAc,EAC1B,YAAY,EAAE,cAAc,CAAC,CAAC,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC,CAAC,cAAc,EAAE,YAAY,aAEnF,OAAO,IAAI,KAAC,kBAAkB,cAAE,OAAO,WAAsB,EAC7D,IAAI,YACS,CACjB,YACwB,CAC5B,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,QAAQ,CAAC","sourcesContent":["import {\n FunctionComponent,\n forwardRef,\n PropsWithoutRef,\n Ref,\n useState,\n useCallback,\n useEffect,\n useMemo,\n ElementType,\n useContext,\n useRef,\n FC,\n MouseEventHandler,\n MutableRefObject,\n useLayoutEffect\n} from 'react';\n\nimport Flex from '../Flex';\nimport Link from '../Link';\nimport Count from '../Badges/Count';\nimport BareButton from '../Button/BareButton';\nimport SearchInput from '../SearchInput';\nimport Icon, { registerIcon } from '../Icon';\nimport * as timesIcon from '../Icon/icons/times.icon';\nimport * as plusIcon from '../Icon/icons/plus.icon';\nimport * as caseSolidIcon from '../Icon/icons/case-solid.icon';\nimport * as barsIcon from '../Icon/icons/bars.icon';\nimport * as caretLeftIcon from '../Icon/icons/caret-left.icon';\nimport * as caretRightIcon from '../Icon/icons/caret-right.icon';\nimport Text from '../Text';\nimport Image from '../Image';\nimport ExpandCollapse from '../ExpandCollapse';\nimport type { ForwardProps, OmitStrict } from '../../types';\nimport {\n useFocusWithin,\n useI18n,\n useBreakpoint,\n useConsolidatedRef,\n useDirection,\n useTheme,\n useElement,\n useTransitionState\n} from '../../hooks';\nimport { openCloseStates } from '../../hooks/useTransitionState';\nimport Grid from '../Grid';\nimport Button from '../Button';\nimport Drawer from '../Drawer';\nimport type { PopoverProps } from '../Popover';\nimport Backdrop from '../Backdrop';\nimport { documentIsAvailable } from '../../utils';\n\nimport AppShellContext from './AppShellContext';\nimport AppShellDrawer from './Drawer';\nimport AppShellOperator from './Operator';\nimport AppHeader from './AppHeader';\nimport SkipNavigation from './SkipNavigation';\nimport {\n StyledAppNav,\n StyledAppInfo,\n StyledSearchForm,\n StyledCaseTypes,\n StyledScrollWrap,\n StyledUtils,\n StyledNavList,\n StyledNestedNavList,\n StyledNavListItem,\n StyledNavListMenuButton,\n StyledAppMain,\n StyledCaseClose,\n StyledAppShellNavIcon,\n StyledNavCasesList,\n StyledAppEnvironment,\n StyledBannerRegion,\n StyledCountIcon,\n StyledUtilIconCount,\n StyledMobileNav\n} from './AppShell.styles';\nimport {\n AppShellProps,\n CaseProps,\n CaseTypeProps,\n LinkProps,\n NavListItemProps,\n NavListProps,\n UtilItemProps,\n UtilsProps\n} from './AppShell.types';\n\nregisterIcon(timesIcon, plusIcon, caseSolidIcon, barsIcon, caretRightIcon, caretLeftIcon);\n\nconst NavComponents: {\n List: FunctionComponent<NavListProps>;\n ListItem: FunctionComponent<NavListItemProps>;\n} = {\n List(props: NavListProps) {\n const { items = [], nestedList, collapsed } = props;\n let Component: ElementType = StyledNavList;\n let fwdProps: {\n as?: ElementType;\n forwardedAs?: ElementType;\n nullWhenCollapsed?: boolean;\n transitionSpeed?: string;\n collapsed: boolean;\n } = {\n collapsed: !!collapsed\n };\n\n const {\n base: { animation }\n } = useTheme();\n\n if (nestedList) {\n fwdProps = {\n as: ExpandCollapse,\n forwardedAs: 'ul',\n nullWhenCollapsed: true,\n transitionSpeed: items.length >= 10 ? `calc(2 * ${animation.speed})` : animation.speed,\n ...fwdProps\n };\n\n Component = StyledNestedNavList;\n }\n\n return (\n <Component {...fwdProps}>\n {items?.map(item => (\n <NavComponents.ListItem {...item} key={item.id || item.primary} />\n ))}\n </Component>\n );\n },\n ListItem(props: NavListItemProps) {\n const { navOpen } = useContext(AppShellContext);\n const {\n visual,\n primary,\n secondary,\n href,\n onClick,\n items,\n collapseItems = false,\n dismissible = false,\n onDismiss,\n active,\n actions,\n forwardedRef,\n ...restProps\n } = props;\n\n const t = useI18n();\n\n const hasItems = Array.isArray(items) && items.length > 0;\n const compProps: {\n href?: string;\n variant?: string;\n onClick?: MouseEventHandler<HTMLAnchorElement | HTMLButtonElement | HTMLDivElement>;\n actions?: NavListItemProps['actions'];\n as?: ElementType<any>;\n popover?: OmitStrict<PopoverProps, 'show' | 'target' | 'children'>;\n } = {\n onClick,\n href\n };\n\n let Component: ElementType;\n\n if (actions) {\n Component = AppShellOperator;\n compProps.actions = actions;\n compProps.as = StyledNavListMenuButton;\n compProps.popover = {\n placement: 'right-end',\n modifiers: [\n {\n name: 'offset',\n options: { offset: [-12, -16] }\n },\n {\n name: 'flip',\n options: {\n boundary: documentIsAvailable ? document.body : undefined,\n fallbackPlacements: ['top-end']\n }\n }\n ]\n };\n } else if (href) {\n Component = Link;\n } else if (onClick) {\n Component = BareButton;\n } else {\n Component = 'div';\n }\n\n useEffect(() => {\n if (!navOpen && actions) {\n const node = document.getElementsByTagName('body')[0];\n const clickEvent = document.createEvent('MouseEvent');\n clickEvent.initEvent('mousedown', true, true);\n node.dispatchEvent(clickEvent);\n }\n }, [navOpen]);\n\n const { end } = useDirection();\n\n return (\n <StyledNavListItem\n {...restProps}\n key={primary}\n nestedListCollapsed={hasItems ? collapseItems : true}\n >\n {/* forwardedRef typed as 'any' due to ambiguity of Component element type */}\n <Component {...compProps} ref={forwardedRef as any}>\n {visual}\n {secondary ? (\n <Flex container={{ direction: 'column', alignItems: 'start' }}>\n <span>{primary}</span>\n <Text variant='secondary'>{secondary}</Text>\n </Flex>\n ) : (\n <span>{primary}</span>\n )}\n {(hasItems || actions) && <Icon name={`caret-${end}`} as={StyledAppShellNavIcon} />}\n </Component>\n {dismissible && (\n <Button\n icon\n variant='simple'\n as={StyledCaseClose}\n onClick={onDismiss}\n aria-label={t('dismiss_case')}\n >\n <Icon name='times' />\n </Button>\n )}\n {hasItems && (\n <NavComponents.List nestedList items={items} collapsed={!navOpen || collapseItems} />\n )}\n </StyledNavListItem>\n );\n }\n};\n\nconst CaseTypes: FunctionComponent<{ caseTypes: CaseTypeProps[] }> = ({\n caseTypes\n}: {\n caseTypes: CaseTypeProps[];\n}) => {\n const { navOpen } = useContext(AppShellContext);\n const [expanded, setExpanded] = useState(false);\n const t = useI18n();\n\n const toggleExpanded = useCallback(() => {\n setExpanded(state => !state);\n }, []);\n\n useEffect(() => {\n if (!navOpen) setExpanded(false);\n }, [navOpen]);\n const transformedCaseTypes = caseTypes.map(caseType => {\n return {\n ...caseType,\n primary: caseType.name\n };\n });\n return useMemo(\n () => (\n <StyledCaseTypes expanded={expanded && navOpen}>\n <NavComponents.List\n items={[\n {\n primary: t('app_shell_create'),\n visual: <Icon name='plus' as={StyledAppShellNavIcon} />,\n onClick: toggleExpanded,\n items: transformedCaseTypes,\n collapseItems: !expanded || !navOpen\n }\n ]}\n />\n </StyledCaseTypes>\n ),\n [expanded, navOpen, toggleExpanded, caseTypes]\n );\n};\n\nconst Links: FunctionComponent<{ links: LinkProps[] }> = (props: { links: LinkProps[] }) => {\n const { links } = props;\n const navLinksRef = useRef<NavListItemProps[]>([]);\n const [transformedLinks, setTransformedLinks] = useState<NavListItemProps[]>([]);\n\n const toggleExpanded = (id: string) => {\n const updatedLinks = navLinksRef.current.map(link => {\n if (link.id === id) return { ...link, collapseItems: !link.collapseItems };\n return { ...link };\n });\n setTransformedLinks(updatedLinks);\n };\n\n // TODO: Can this be a memo instead of a state and an effect?\n const mergedNavLinks = (items: LinkProps[]): NavListItemProps[] => {\n return items.map((link: LinkProps) => {\n return {\n ...link,\n primary: link.name,\n 'aria-current': link.active ? 'page' : null,\n visual: link.icon ? <Icon name={link.icon} as={StyledAppShellNavIcon} /> : null,\n onClick: link.links ? () => toggleExpanded(link.id) : link.onClick,\n items: link.links ? mergedNavLinks(link.links) : undefined,\n collapseItems: true\n };\n });\n };\n\n useEffect(() => {\n setTransformedLinks(mergedNavLinks(links));\n }, [links]);\n\n useEffect(() => {\n navLinksRef.current = transformedLinks;\n }, [transformedLinks]);\n\n return (\n <div>\n <NavComponents.List items={transformedLinks} />\n </div>\n );\n};\n\nconst Cases: FunctionComponent<{ cases: CaseProps[] }> = (props: { cases: CaseProps[] }) => {\n const { cases } = props;\n\n const setupCases = (items: CaseProps[]): NavListItemProps[] => {\n return items.map((item: CaseProps) => {\n const {\n id,\n primary,\n secondary,\n visual = <Icon name='case-solid' as={StyledAppShellNavIcon} />,\n active,\n onClick,\n onDismiss\n } = item;\n return {\n id,\n 'aria-current': active ? 'page' : undefined,\n primary,\n secondary,\n active: !!active,\n dismissible: true,\n onClick,\n onDismiss,\n visual\n };\n });\n };\n\n return (\n <StyledNavCasesList>\n <NavComponents.List items={setupCases(cases)} />\n </StyledNavCasesList>\n );\n};\n\n// TODO: Need to add back re-focus support to drawer.\nexport const Utils: FC<UtilsProps> = ({ operator, items, appHeader }) => {\n const { drawerOpen, setDrawerOpen, focusedImperatively } = useContext(AppShellContext);\n const [transformedLinks, setTransformedLinks] = useState<NavListItemProps[]>([]);\n const [item, setItem] = useState<UtilItemProps>();\n const [activeUtilItem, setActiveUtilItem] = useState('');\n const returnFocusRef: MutableRefObject<\n HTMLAnchorElement | HTMLDivElement | HTMLButtonElement | null\n > = useRef(null);\n\n const operatorInfo: NavListItemProps[] = useMemo(\n () =>\n appHeader\n ? []\n : [\n {\n primary: operator.name,\n visual: operator.avatar,\n actions: operator.actions\n }\n ],\n [appHeader, operator.name, operator.avatar, operator.actions]\n );\n\n // TODO: Can this be a memo instead of a state and an effect?\n const mergedUtilItems = (drawerItems: UtilItemProps[]): NavListItemProps[] => {\n return drawerItems?.map((drawerItem: UtilItemProps) => {\n return {\n onClick: e => {\n returnFocusRef.current = e.currentTarget;\n if (drawerItem.drawerView) {\n setItem(drawerItem);\n setActiveUtilItem(drawerItem.name);\n }\n },\n ...drawerItem,\n primary: drawerItem.name,\n visual: drawerItem.count ? (\n <StyledUtilIconCount>\n {drawerItem.visual}\n <Count as={StyledCountIcon} variant='urgent'>\n {drawerItem.count}\n </Count>\n </StyledUtilIconCount>\n ) : (\n drawerItem.visual\n )\n };\n });\n };\n\n useEffect(() => {\n if (items) {\n setTransformedLinks([...mergedUtilItems(items)!, ...operatorInfo]);\n } else {\n setTransformedLinks(operatorInfo);\n }\n }, [items, operatorInfo]);\n\n useEffect(() => {\n items?.forEach(uItem => {\n if (uItem.name === activeUtilItem) {\n setItem(uItem);\n }\n });\n }, [items]);\n\n useEffect(() => {\n if (item) setDrawerOpen(true);\n }, [item]);\n\n useEffect(() => {\n if (!drawerOpen) {\n setActiveUtilItem('');\n focusedImperatively.current = true;\n returnFocusRef?.current?.focus();\n }\n }, [drawerOpen]);\n\n return (\n <>\n <StyledUtils>\n <NavComponents.List\n // Pull onDrawerOpen and onDrawerClose off to avoid DOM passthrough warning.\n items={transformedLinks.map(({ onDrawerOpen, onDrawerClose, ...util }) => util)}\n />\n </StyledUtils>\n {item && (\n <AppShellDrawer\n content={item.drawerView}\n header={item.drawerHeader || item.name}\n onDrawerClose={() => {\n setItem(undefined);\n item.onDrawerClose?.();\n }}\n onDrawerOpen={item.onDrawerOpen}\n />\n )}\n </>\n );\n};\n\nconst AppShell: FunctionComponent<AppShellProps & ForwardProps> = forwardRef(\n (props: PropsWithoutRef<AppShellProps>, ref: Ref<HTMLDivElement>) => {\n const {\n appInfo,\n searchInput,\n appHeader,\n searchLabel = 'Sitewide', // FIXME: TR\n caseTypes,\n links,\n banners,\n environment: { name: envName, color: envColor } = {},\n main,\n operator,\n utils,\n cases,\n ...restProps\n } = props;\n const {\n appName,\n portalName,\n href: appInfoHref,\n imageSrc: logoSrc,\n ...appInfoRestProps\n } = appInfo;\n\n const t = useI18n();\n const { start } = useDirection();\n const theme = useTheme();\n const navRef = useConsolidatedRef(ref);\n\n const [drawerOpen, setDrawerOpen] = useState(false);\n const [mobileNavOpen, setMobileNavOpen] = useState(false);\n const [mobileNavBackdrop, setMobileNavBackdrop] = useState(false);\n const [refocusEl, setRefocusEl] = useState<HTMLButtonElement | null>(null);\n\n const focusedImperatively = useRef(false);\n const [headerEl, setHeaderEl] = useElement<HTMLDivElement>();\n const [mobileHeaderEl, setMobileHeaderEl] = useElement<HTMLDivElement>();\n\n const isXlOrAbove = useBreakpoint('xl');\n const isSmallOrAbove = useBreakpoint('sm');\n\n const showAppHeader = !!appHeader && isSmallOrAbove;\n const showMainContent = showAppHeader ? headerEl || mobileHeaderEl : true;\n\n const openNavTimeoutId = useRef<ReturnType<typeof setTimeout>>();\n const closeNavTimeoutId = useRef<ReturnType<typeof setTimeout>>();\n const previewTriggerRef = useRef<HTMLElement>(null);\n\n const { state: navState, set: setNavState } = useTransitionState({\n ref: navRef,\n property: 'width',\n states: openCloseStates,\n defaultState: isXlOrAbove ? 'open' : 'closed'\n });\n\n const openNav = useCallback((delay: number = 0) => {\n if (closeNavTimeoutId.current) clearTimeout(closeNavTimeoutId.current);\n openNavTimeoutId.current = setTimeout(() => {\n setNavState('open');\n }, delay);\n }, []);\n\n const closeNav = useCallback((delay: number = 0) => {\n if (openNavTimeoutId.current) clearTimeout(openNavTimeoutId.current);\n closeNavTimeoutId.current = setTimeout(() => {\n setNavState('closed');\n }, delay);\n }, []);\n\n const onFocus = useCallback(() => {\n if (!focusedImperatively.current && isSmallOrAbove) openNav();\n focusedImperatively.current = false;\n }, [openNav, isSmallOrAbove]);\n\n const onKeydown = useCallback(({ key }: KeyboardEvent) => {\n if (key === 'Escape') setMobileNavOpen(false);\n }, []);\n\n useFocusWithin<HTMLElement>(\n [navRef],\n useCallback(\n (isFocused: boolean, navElement: Element | null) => {\n if (!isFocused && !navElement?.matches(':hover')) closeNav();\n },\n [closeNav]\n )\n );\n\n useLayoutEffect(() => {\n if (isXlOrAbove) {\n openNav();\n } else {\n closeNav();\n }\n }, [isXlOrAbove]);\n\n useEffect(() => {\n if (navState === 'closed' || navState === 'closing') setDrawerOpen(false);\n }, [navState]);\n\n useEffect(() => {\n if (mobileNavOpen) {\n document.addEventListener('keydown', onKeydown);\n return () => {\n document.removeEventListener('keydown', onKeydown);\n };\n }\n }, [mobileNavOpen]);\n\n useEffect(() => {\n if (isSmallOrAbove && mobileNavOpen) {\n setMobileNavBackdrop(false);\n setMobileNavOpen(false);\n }\n }, [isSmallOrAbove, mobileNavOpen]);\n\n const appShellJSX = (\n <Flex\n {...restProps}\n container={{\n direction: 'column',\n justify: 'between'\n }}\n ref={navRef}\n as={StyledAppNav}\n appHeader={showAppHeader}\n navOpen={mobileNavOpen}\n showEnv={!!envName}\n onFocus={onFocus}\n onMouseEnter={isSmallOrAbove && !isXlOrAbove ? () => openNav(200) : undefined}\n onMouseLeave={isSmallOrAbove && !isXlOrAbove ? () => closeNav(200) : undefined}\n >\n {envName && (\n <StyledAppEnvironment\n item={{ shrink: 0 }}\n color={envColor ?? theme.base.colors.red['extra-light']}\n >\n {envName}\n </StyledAppEnvironment>\n )}\n {!showAppHeader && (\n <StyledAppInfo\n as={Grid}\n forwardedAs={appInfoHref ? (Link as any) : 'div'}\n href={appInfoHref}\n aria-label={`${appName}${portalName ? ` - ${portalName}` : ''}`}\n {...appInfoRestProps}\n container={{\n alignItems: 'center',\n areas: portalName ? '\"logo app\" \"logo portal\"' : '\"logo app\"'\n }}\n >\n <Grid item={{ area: 'logo' }} as={Image} src={logoSrc} alt={appName} />\n <Grid item={{ area: 'app' }} as='span'>\n {appName}\n </Grid>\n {portalName && (\n <Grid item={{ area: 'portal' }} as='span'>\n {portalName}\n </Grid>\n )}\n </StyledAppInfo>\n )}\n\n {searchInput && !showAppHeader && (\n <StyledSearchForm\n role='search'\n aria-label={searchLabel}\n onSubmit={e => e.preventDefault()}\n >\n <SearchInput {...searchInput} />\n </StyledSearchForm>\n )}\n\n <StyledScrollWrap>\n {caseTypes && <CaseTypes caseTypes={caseTypes} />}\n {links && <Links links={links} />}\n {cases && <Cases cases={cases} />}\n </StyledScrollWrap>\n\n <Utils appHeader={showAppHeader} operator={operator} items={utils} />\n </Flex>\n );\n\n return (\n <AppShellContext.Provider\n value={useMemo(\n () => ({\n navOpen: mobileNavOpen || navState === 'open' || navState === 'opening',\n navState,\n drawerOpen,\n setDrawerOpen,\n refocusEl,\n setRefocusEl,\n focusedImperatively,\n headerEl: headerEl || mobileHeaderEl,\n previewTriggerRef\n }),\n [navState, mobileNavOpen, drawerOpen, refocusEl, headerEl, mobileHeaderEl]\n )}\n >\n <SkipNavigation />\n {showAppHeader && (\n <AppHeader\n {...appInfo}\n searchInput={searchInput}\n searchLabel={searchLabel}\n operator={operator}\n ref={setHeaderEl}\n />\n )}\n\n {isSmallOrAbove ? (\n appShellJSX\n ) : (\n <>\n <Flex as={StyledMobileNav} container={{ alignItems: 'center' }} ref={setMobileHeaderEl}>\n <Button\n variant='simple'\n onClick={() => setMobileNavBackdrop(true)}\n aria-label={t('app_shell_open_nav')}\n icon\n >\n <Icon name='bars' />\n </Button>\n </Flex>\n\n <Backdrop\n open={mobileNavBackdrop}\n transitionSpeed='none'\n onAfterTransitionIn={() => setMobileNavOpen(true)}\n onBeforeTransitionOut={() => setMobileNavOpen(false)}\n onClick={e => {\n if (e.currentTarget === e.target) setMobileNavOpen(false);\n }}\n >\n <Drawer\n open={mobileNavOpen}\n onAfterClose={() => {\n setMobileNavBackdrop(false);\n }}\n position='fixed'\n placement={start}\n size='min(18.75rem, calc(100vw - 3.5rem))'\n nullWhenClosed\n >\n {appShellJSX}\n </Drawer>\n </Backdrop>\n </>\n )}\n {showMainContent && (\n <StyledAppMain\n tabIndex={-1}\n appHeader={showAppHeader}\n mobileNav={!isSmallOrAbove}\n headerOffset={isSmallOrAbove ? headerEl?.offsetHeight : mobileHeaderEl?.offsetHeight}\n >\n {banners && <StyledBannerRegion>{banners}</StyledBannerRegion>}\n {main}\n </StyledAppMain>\n )}\n </AppShellContext.Provider>\n );\n }\n);\n\nexport default AppShell;\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { KeyboardEvent, MouseEvent, MouseEventHandler, ReactNode, Ref } from 'react';
|
|
2
|
-
import { Action, AsProp, BaseProps, ForwardProps } from '../../types';
|
|
2
|
+
import { Action, AsProp, BaseProps, ForwardProps, NoChildrenProp } from '../../types';
|
|
3
3
|
import { ImageProps } from '../Image';
|
|
4
4
|
import { SearchInputProps } from '../SearchInput';
|
|
5
5
|
/** AppShell props */
|
|
@@ -19,7 +19,7 @@ export interface AppInfoProps {
|
|
|
19
19
|
/** Specifies where to open the link href. */
|
|
20
20
|
target?: string;
|
|
21
21
|
}
|
|
22
|
-
export interface AppShellProps extends BaseProps, AppShellDrawerProps {
|
|
22
|
+
export interface AppShellProps extends BaseProps, AppShellDrawerProps, NoChildrenProp {
|
|
23
23
|
/** Props related to the App Shell header. */
|
|
24
24
|
appInfo: AppInfoProps;
|
|
25
25
|
/** The content of the application. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppShell.types.d.ts","sourceRoot":"","sources":["../../../src/components/AppShell/AppShell.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,iBAAiB,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAErF,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"AppShell.types.d.ts","sourceRoot":"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,CAAC;CACvB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppShell.types.js","sourceRoot":"","sources":["../../../src/components/AppShell/AppShell.types.ts"],"names":[],"mappings":"","sourcesContent":["import { KeyboardEvent, MouseEvent, MouseEventHandler, ReactNode, Ref } from 'react';\n\nimport { Action, AsProp, BaseProps, ForwardProps } from '../../types';\nimport { ImageProps } from '../Image';\nimport { SearchInputProps } from '../SearchInput';\n\n/** AppShell props */\n\nexport interface AppInfoProps {\n /** The primary text to render in the header. */\n appName: string;\n /** The source for a small application image or logo that is rendered in the nav bar. */\n imageSrc: ImageProps['src'];\n /** The source for the full size application image or logo that is rendered in the app header, if enabled. */\n fullImageSrc?: ImageProps['src'];\n /** URL or DOM id to navigate to. */\n href?: string;\n /** Click handler for the header. */\n onClick?: MouseEventHandler<HTMLAnchorElement>;\n /** The secondary text to render in the header. */\n portalName?: string;\n /** Specifies where to open the link href. */\n target?: string;\n}\n\nexport interface AppShellProps extends BaseProps, AppShellDrawerProps {\n /** Props related to the App Shell header. */\n appInfo: AppInfoProps;\n /** The content of the application. */\n main: ReactNode;\n /** The active user of the application. */\n operator: OperatorProps;\n /** If true, a header will render containing the logo and name of the app as well as search and operator regions. */\n appHeader?: boolean;\n /** Props related to the Search Input. */\n searchInput?: SearchInputProps;\n /**\n * The aria-label for the search input.\n * @default \"Sitewide\"\n */\n searchLabel?: string;\n /** A set of cases that will render in an expanded list within the App Shell. */\n caseTypes?: CaseTypeProps[];\n /** A set of links that will render as a flat list in the App Shell. */\n links?: LinkProps[];\n /** A set of cases that will render as a flat list in the App Shell. */\n cases?: CaseProps[];\n /** Used for alternate environments, such as \"dev\" or \"staging\". */\n environment?: {\n name: string;\n /** @default theme.base.colors.red['extra-light'] */\n color?: string;\n };\n /** A set of app utilities like notifications, recents that renders at the bottom of AppShell */\n utils?: UtilItemProps[];\n /** Banners will render above the main content if they are provided. */\n banners?: ReactNode;\n}\nexport interface CaseTypeProps {\n /** The display name of the case. */\n name: string;\n /** Click handler for the case. */\n onClick?: MouseEventHandler<HTMLButtonElement>;\n}\n\nexport interface LinkProps extends ForwardProps {\n /** Unique id */\n id: string;\n /** The display name of the link. */\n name: string;\n /** URL or DOM id to navigate to. */\n href: string;\n /** The name of the Cosmos Icon to render as a visual. */\n icon?: string;\n /** Determines if the link represents the active page. */\n active?: boolean;\n /** A set of nested links. */\n links?: LinkProps[];\n /** Click handler for the link. */\n onClick?: MouseEventHandler<HTMLAnchorElement>;\n}\n\nexport interface CaseProps extends ForwardProps {\n /** Unique id */\n id: string;\n /** Name of the case or some primary information like title. */\n primary: string;\n /** Additional info of a case like timestamp. */\n secondary?: string;\n /** A visual element identifying the case. If not passed will render case-solid icon */\n visual?: ReactNode;\n /** Determines if the case represents the active page. */\n active?: boolean;\n /** Click handler for the case . */\n onClick?: MouseEventHandler<HTMLButtonElement>;\n /** Dismiss handler for the case. */\n onDismiss?: MouseEventHandler<HTMLButtonElement>;\n}\n\nexport interface OperatorProps {\n /** A visual element identifying the operator. */\n avatar: ReactNode;\n /** A list of actions that will populate a menu attached to the operator. */\n actions: Action[];\n /** The name of the operator. */\n name: string;\n}\n\nexport interface UtilItemProps extends Pick<NavListItemProps, 'visual' | 'actions' | 'onClick'> {\n /** The display name of an utility item. */\n name: string;\n /* Number when given displays on top-right of a given icon. */\n count?: number;\n /** View that renders on an appShell drawer onClick of an item */\n drawerView?: ReactNode;\n /** Heading for view that renders */\n drawerHeader?: string;\n /** Callback that fires on appshell drawer open */\n onDrawerOpen?: () => void;\n /** Callback that fires on appshell drawer close */\n onDrawerClose?: () => void;\n}\nexport interface UtilsProps {\n /** The active user of the application. */\n operator: AppShellProps['operator'];\n /** A set of app utilities like notifications, recents that renders at the bottom of AppShell */\n items?: UtilItemProps[];\n appHeader?: boolean;\n}\nexport interface NavListProps extends AsProp, BaseProps {\n items?: NavListItemProps[];\n nestedList?: boolean;\n collapsed?: boolean;\n}\n\nexport interface NavListItemProps extends AsProp, BaseProps, ForwardProps {\n id?: string;\n visual?: ReactNode;\n primary: string;\n secondary?: string;\n href?: string;\n onClick?: MouseEventHandler<HTMLAnchorElement | HTMLButtonElement | HTMLDivElement>;\n active?: boolean;\n items?: NavListProps['items'];\n collapseItems?: boolean;\n actions?: OperatorProps['actions'];\n dismissible?: boolean;\n onDismiss?: MouseEventHandler<HTMLButtonElement>;\n forwardedRef?: Ref<HTMLAnchorElement | HTMLDivElement | HTMLButtonElement>;\n}\n\n/** AppHeader props */\n\nexport interface AppHeaderProps extends BaseProps, AppInfoProps {\n operator: AppShellProps['operator'];\n searchInput?: AppShellProps['searchInput'];\n searchLabel?: AppShellProps['searchLabel'];\n}\n\n/** Drawer props */\n\nexport interface DrawerListProps {\n items: (DrawerItemProps & ForwardProps)[];\n loading?: boolean;\n viewAll?: {\n onClick?: MouseEventHandler<HTMLButtonElement | HTMLAnchorElement>;\n href?: string;\n } & ForwardProps;\n newNotifications?: number;\n onItemClick?: (id: string, event: MouseEvent<HTMLButtonElement | HTMLAnchorElement>) => void;\n onItemPinToggle?: (id: string) => void;\n onDrawerOpen?: () => void;\n onDrawerClose?: () => void;\n}\n\nexport interface NotificationListProps {\n /** A list of notification items. */\n items: DrawerListProps['items'];\n /**\n * If true, a loading indicator will render in place of the list.\n * @default false\n * */\n loading?: DrawerListProps['loading'];\n /**\n * A set of callback functions for the view all functionality, if provided.\n * The onClick callback is for button use, and the href for link use. If provided both, defaults to link. */\n viewAll?: DrawerListProps['viewAll'];\n /** Number of new notifications. */\n newNotifications?: DrawerListProps['newNotifications'];\n /** Callback function run when an item is clicked on. */\n onItemClick?: DrawerListProps['onItemClick'];\n /** Callback function that runs after the Drawer opens. */\n onDrawerOpen?: DrawerListProps['onDrawerOpen'];\n /** Callback function that runs after the Drawer closes. */\n onDrawerClose?: DrawerListProps['onDrawerClose'];\n}\n\nexport interface RecentsListProps {\n /** A list of recent activity items. */\n items: DrawerListProps['items'];\n /**\n * If true, a loading indicator will render in place of the list.\n * @default false\n * */\n loading?: DrawerListProps['loading'];\n /**\n * A set of callback functions for the view all functionality, if provided.\n * The onClick callback is for button use, and the href for link use. If provided both, defaults to link. */\n viewAll?: DrawerListProps['viewAll'];\n /** Callback function that runs when an item pin is clicked. */\n onItemPinToggle?: DrawerListProps['onItemPinToggle'];\n /** Callback function that runs when an item is clicked on. */\n onItemClick?: DrawerListProps['onItemClick'];\n /** Callback function that runs after the Drawer opens. */\n onDrawerOpen?: DrawerListProps['onDrawerOpen'];\n /** Callback function that runs after the Drawer closes. */\n onDrawerClose?: DrawerListProps['onDrawerClose'];\n}\n\nexport interface PinsListProps {\n /** A list of pinned items. */\n items: DrawerListProps['items'];\n /**\n * If true, a loading indicator will render in place of the list.\n * @default false\n * */\n loading?: DrawerListProps['loading'];\n /**\n * A set of callback functions for the view all functionality, if provided.\n * The onClick callback is for button use, and the href for link use. If provided both, defaults to link. */\n viewAll?: DrawerListProps['viewAll'];\n /** Callback function that runs when an item pin is clicked. */\n onItemPinToggle?: DrawerListProps['onItemPinToggle'];\n /** Callback function that runs when an item is clicked on. */\n onItemClick?: DrawerListProps['onItemClick'];\n}\n\nexport interface AppShellDrawerProps {\n /** A list of notifications and handler functions. */\n notifications?: NotificationListProps;\n /** A list of recently visited items and handler functions. */\n recents?: RecentsListProps;\n /** A list of pinned items to display above recent items and handler functions. */\n pins?: PinsListProps;\n}\n\nexport interface DrawerItemProps extends BaseProps {\n /** An id representing the item. */\n id: string;\n /** The primary text for the item. */\n primary: string;\n /** Secondary text that will be rendered as a Meta List. */\n secondary?: string[];\n /** A visual associated with the item. */\n visual?: ReactNode;\n /** A flag indicating if the item has been read. */\n unread?: boolean;\n /** A flag indicating if the item has been pinned or not. */\n pinned?: boolean;\n /** URL or DOM id to navigate to. */\n href?: string;\n /** The onClick handler for the item. */\n onClick?: (id: string, event: MouseEvent<HTMLElement> | KeyboardEvent<HTMLElement>) => void;\n /** The handler hat is called when a pin icon is toggled on an item. */\n onPinToggle?: (id: string) => void;\n}\n\nexport interface ListProps extends DrawerListProps {\n headingText?: string;\n emptyText: string;\n displayRecents: boolean;\n displayPins?: boolean;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"AppShell.types.js","sourceRoot":"","sources":["../../../src/components/AppShell/AppShell.types.ts"],"names":[],"mappings":"","sourcesContent":["import { KeyboardEvent, MouseEvent, MouseEventHandler, ReactNode, Ref } from 'react';\n\nimport { Action, AsProp, BaseProps, ForwardProps, NoChildrenProp } from '../../types';\nimport { ImageProps } from '../Image';\nimport { SearchInputProps } from '../SearchInput';\n\n/** AppShell props */\n\nexport interface AppInfoProps {\n /** The primary text to render in the header. */\n appName: string;\n /** The source for a small application image or logo that is rendered in the nav bar. */\n imageSrc: ImageProps['src'];\n /** The source for the full size application image or logo that is rendered in the app header, if enabled. */\n fullImageSrc?: ImageProps['src'];\n /** URL or DOM id to navigate to. */\n href?: string;\n /** Click handler for the header. */\n onClick?: MouseEventHandler<HTMLAnchorElement>;\n /** The secondary text to render in the header. */\n portalName?: string;\n /** Specifies where to open the link href. */\n target?: string;\n}\n\nexport interface AppShellProps extends BaseProps, AppShellDrawerProps, NoChildrenProp {\n /** Props related to the App Shell header. */\n appInfo: AppInfoProps;\n /** The content of the application. */\n main: ReactNode;\n /** The active user of the application. */\n operator: OperatorProps;\n /** If true, a header will render containing the logo and name of the app as well as search and operator regions. */\n appHeader?: boolean;\n /** Props related to the Search Input. */\n searchInput?: SearchInputProps;\n /**\n * The aria-label for the search input.\n * @default \"Sitewide\"\n */\n searchLabel?: string;\n /** A set of cases that will render in an expanded list within the App Shell. */\n caseTypes?: CaseTypeProps[];\n /** A set of links that will render as a flat list in the App Shell. */\n links?: LinkProps[];\n /** A set of cases that will render as a flat list in the App Shell. */\n cases?: CaseProps[];\n /** Used for alternate environments, such as \"dev\" or \"staging\". */\n environment?: {\n name: string;\n /** @default theme.base.colors.red['extra-light'] */\n color?: string;\n };\n /** A set of app utilities like notifications, recents that renders at the bottom of AppShell */\n utils?: UtilItemProps[];\n /** Banners will render above the main content if they are provided. */\n banners?: ReactNode;\n}\nexport interface CaseTypeProps {\n /** The display name of the case. */\n name: string;\n /** Click handler for the case. */\n onClick?: MouseEventHandler<HTMLButtonElement>;\n}\n\nexport interface LinkProps extends ForwardProps {\n /** Unique id */\n id: string;\n /** The display name of the link. */\n name: string;\n /** URL or DOM id to navigate to. */\n href: string;\n /** The name of the Cosmos Icon to render as a visual. */\n icon?: string;\n /** Determines if the link represents the active page. */\n active?: boolean;\n /** A set of nested links. */\n links?: LinkProps[];\n /** Click handler for the link. */\n onClick?: MouseEventHandler<HTMLAnchorElement>;\n}\n\nexport interface CaseProps extends ForwardProps {\n /** Unique id */\n id: string;\n /** Name of the case or some primary information like title. */\n primary: string;\n /** Additional info of a case like timestamp. */\n secondary?: string;\n /** A visual element identifying the case. If not passed will render case-solid icon */\n visual?: ReactNode;\n /** Determines if the case represents the active page. */\n active?: boolean;\n /** Click handler for the case . */\n onClick?: MouseEventHandler<HTMLButtonElement>;\n /** Dismiss handler for the case. */\n onDismiss?: MouseEventHandler<HTMLButtonElement>;\n}\n\nexport interface OperatorProps {\n /** A visual element identifying the operator. */\n avatar: ReactNode;\n /** A list of actions that will populate a menu attached to the operator. */\n actions: Action[];\n /** The name of the operator. */\n name: string;\n}\n\nexport interface UtilItemProps extends Pick<NavListItemProps, 'visual' | 'actions' | 'onClick'> {\n /** The display name of an utility item. */\n name: string;\n /* Number when given displays on top-right of a given icon. */\n count?: number;\n /** View that renders on an appShell drawer onClick of an item */\n drawerView?: ReactNode;\n /** Heading for view that renders */\n drawerHeader?: string;\n /** Callback that fires on appshell drawer open */\n onDrawerOpen?: () => void;\n /** Callback that fires on appshell drawer close */\n onDrawerClose?: () => void;\n}\nexport interface UtilsProps {\n /** The active user of the application. */\n operator: AppShellProps['operator'];\n /** A set of app utilities like notifications, recents that renders at the bottom of AppShell */\n items?: UtilItemProps[];\n appHeader?: boolean;\n}\nexport interface NavListProps extends AsProp, BaseProps {\n items?: NavListItemProps[];\n nestedList?: boolean;\n collapsed?: boolean;\n}\n\nexport interface NavListItemProps extends AsProp, BaseProps, ForwardProps {\n id?: string;\n visual?: ReactNode;\n primary: string;\n secondary?: string;\n href?: string;\n onClick?: MouseEventHandler<HTMLAnchorElement | HTMLButtonElement | HTMLDivElement>;\n active?: boolean;\n items?: NavListProps['items'];\n collapseItems?: boolean;\n actions?: OperatorProps['actions'];\n dismissible?: boolean;\n onDismiss?: MouseEventHandler<HTMLButtonElement>;\n forwardedRef?: Ref<HTMLAnchorElement | HTMLDivElement | HTMLButtonElement>;\n}\n\n/** AppHeader props */\n\nexport interface AppHeaderProps extends BaseProps, AppInfoProps {\n operator: AppShellProps['operator'];\n searchInput?: AppShellProps['searchInput'];\n searchLabel?: AppShellProps['searchLabel'];\n}\n\n/** Drawer props */\n\nexport interface DrawerListProps {\n items: (DrawerItemProps & ForwardProps)[];\n loading?: boolean;\n viewAll?: {\n onClick?: MouseEventHandler<HTMLButtonElement | HTMLAnchorElement>;\n href?: string;\n } & ForwardProps;\n newNotifications?: number;\n onItemClick?: (id: string, event: MouseEvent<HTMLButtonElement | HTMLAnchorElement>) => void;\n onItemPinToggle?: (id: string) => void;\n onDrawerOpen?: () => void;\n onDrawerClose?: () => void;\n}\n\nexport interface NotificationListProps {\n /** A list of notification items. */\n items: DrawerListProps['items'];\n /**\n * If true, a loading indicator will render in place of the list.\n * @default false\n * */\n loading?: DrawerListProps['loading'];\n /**\n * A set of callback functions for the view all functionality, if provided.\n * The onClick callback is for button use, and the href for link use. If provided both, defaults to link. */\n viewAll?: DrawerListProps['viewAll'];\n /** Number of new notifications. */\n newNotifications?: DrawerListProps['newNotifications'];\n /** Callback function run when an item is clicked on. */\n onItemClick?: DrawerListProps['onItemClick'];\n /** Callback function that runs after the Drawer opens. */\n onDrawerOpen?: DrawerListProps['onDrawerOpen'];\n /** Callback function that runs after the Drawer closes. */\n onDrawerClose?: DrawerListProps['onDrawerClose'];\n}\n\nexport interface RecentsListProps {\n /** A list of recent activity items. */\n items: DrawerListProps['items'];\n /**\n * If true, a loading indicator will render in place of the list.\n * @default false\n * */\n loading?: DrawerListProps['loading'];\n /**\n * A set of callback functions for the view all functionality, if provided.\n * The onClick callback is for button use, and the href for link use. If provided both, defaults to link. */\n viewAll?: DrawerListProps['viewAll'];\n /** Callback function that runs when an item pin is clicked. */\n onItemPinToggle?: DrawerListProps['onItemPinToggle'];\n /** Callback function that runs when an item is clicked on. */\n onItemClick?: DrawerListProps['onItemClick'];\n /** Callback function that runs after the Drawer opens. */\n onDrawerOpen?: DrawerListProps['onDrawerOpen'];\n /** Callback function that runs after the Drawer closes. */\n onDrawerClose?: DrawerListProps['onDrawerClose'];\n}\n\nexport interface PinsListProps {\n /** A list of pinned items. */\n items: DrawerListProps['items'];\n /**\n * If true, a loading indicator will render in place of the list.\n * @default false\n * */\n loading?: DrawerListProps['loading'];\n /**\n * A set of callback functions for the view all functionality, if provided.\n * The onClick callback is for button use, and the href for link use. If provided both, defaults to link. */\n viewAll?: DrawerListProps['viewAll'];\n /** Callback function that runs when an item pin is clicked. */\n onItemPinToggle?: DrawerListProps['onItemPinToggle'];\n /** Callback function that runs when an item is clicked on. */\n onItemClick?: DrawerListProps['onItemClick'];\n}\n\nexport interface AppShellDrawerProps {\n /** A list of notifications and handler functions. */\n notifications?: NotificationListProps;\n /** A list of recently visited items and handler functions. */\n recents?: RecentsListProps;\n /** A list of pinned items to display above recent items and handler functions. */\n pins?: PinsListProps;\n}\n\nexport interface DrawerItemProps extends BaseProps {\n /** An id representing the item. */\n id: string;\n /** The primary text for the item. */\n primary: string;\n /** Secondary text that will be rendered as a Meta List. */\n secondary?: string[];\n /** A visual associated with the item. */\n visual?: ReactNode;\n /** A flag indicating if the item has been read. */\n unread?: boolean;\n /** A flag indicating if the item has been pinned or not. */\n pinned?: boolean;\n /** URL or DOM id to navigate to. */\n href?: string;\n /** The onClick handler for the item. */\n onClick?: (id: string, event: MouseEvent<HTMLElement> | KeyboardEvent<HTMLElement>) => void;\n /** The handler hat is called when a pin icon is toggled on an item. */\n onPinToggle?: (id: string) => void;\n}\n\nexport interface ListProps extends DrawerListProps {\n headingText?: string;\n emptyText: string;\n displayRecents: boolean;\n displayPins?: boolean;\n}\n"]}
|
|
@@ -9,6 +9,7 @@ interface AppShellContextValue {
|
|
|
9
9
|
setRefocusEl: (el: HTMLButtonElement | null) => void;
|
|
10
10
|
focusedImperatively: MutableRefObject<boolean>;
|
|
11
11
|
headerEl: HTMLDivElement | null;
|
|
12
|
+
previewTriggerRef: MutableRefObject<HTMLElement | null>;
|
|
12
13
|
}
|
|
13
14
|
export declare type DrawerContent = 'notifications' | 'recents';
|
|
14
15
|
declare const AppShellContext: import("react").Context<AppShellContextValue>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppShellContext.d.ts","sourceRoot":"","sources":["../../../src/components/AppShell/AppShellContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,gBAAgB,EAAE,MAAM,OAAO,CAAC;AAExD,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAEjE,UAAU,oBAAoB;IAC5B,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,OAAO,eAAe,CAAC,MAAM,OAAO,eAAe,CAAC,CAAC;IAC/D,UAAU,EAAE,OAAO,CAAC;IACpB,aAAa,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACvC,SAAS,EAAE,iBAAiB,GAAG,IAAI,CAAC;IACpC,YAAY,EAAE,CAAC,EAAE,EAAE,iBAAiB,GAAG,IAAI,KAAK,IAAI,CAAC;IACrD,mBAAmB,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAC;IAC/C,QAAQ,EAAE,cAAc,GAAG,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"AppShellContext.d.ts","sourceRoot":"","sources":["../../../src/components/AppShell/AppShellContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,gBAAgB,EAAE,MAAM,OAAO,CAAC;AAExD,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAEjE,UAAU,oBAAoB;IAC5B,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,OAAO,eAAe,CAAC,MAAM,OAAO,eAAe,CAAC,CAAC;IAC/D,UAAU,EAAE,OAAO,CAAC;IACpB,aAAa,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACvC,SAAS,EAAE,iBAAiB,GAAG,IAAI,CAAC;IACpC,YAAY,EAAE,CAAC,EAAE,EAAE,iBAAiB,GAAG,IAAI,KAAK,IAAI,CAAC;IACrD,mBAAmB,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAC;IAC/C,QAAQ,EAAE,cAAc,GAAG,IAAI,CAAC;IAChC,iBAAiB,EAAE,gBAAgB,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;CACzD;AAED,oBAAY,aAAa,GAAG,eAAe,GAAG,SAAS,CAAC;AAExD,QAAA,MAAM,eAAe,+CAoBnB,CAAC;AAEH,eAAe,eAAe,CAAC"}
|
|
@@ -11,7 +11,14 @@ const AppShellContext = createContext({
|
|
|
11
11
|
return false;
|
|
12
12
|
}
|
|
13
13
|
},
|
|
14
|
-
headerEl: null
|
|
14
|
+
headerEl: null,
|
|
15
|
+
previewTriggerRef: {
|
|
16
|
+
get current() {
|
|
17
|
+
return null;
|
|
18
|
+
},
|
|
19
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
20
|
+
set current(val) { }
|
|
21
|
+
}
|
|
15
22
|
});
|
|
16
23
|
export default AppShellContext;
|
|
17
24
|
//# sourceMappingURL=AppShellContext.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppShellContext.js","sourceRoot":"","sources":["../../../src/components/AppShell/AppShellContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAoB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"AppShellContext.js","sourceRoot":"","sources":["../../../src/components/AppShell/AppShellContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAoB,MAAM,OAAO,CAAC;AAkBxD,MAAM,eAAe,GAAG,aAAa,CAAuB;IAC1D,OAAO,EAAE,KAAK;IACd,QAAQ,EAAE,QAAQ;IAClB,UAAU,EAAE,KAAK;IACjB,aAAa,EAAE,GAAG,EAAE,GAAE,CAAC;IACvB,SAAS,EAAE,IAAI;IACf,YAAY,EAAE,GAAG,EAAE,GAAE,CAAC;IACtB,mBAAmB,EAAE;QACnB,IAAI,OAAO;YACT,OAAO,KAAK,CAAC;QACf,CAAC;KACF;IACD,QAAQ,EAAE,IAAI;IACd,iBAAiB,EAAE;QACjB,IAAI,OAAO;YACT,OAAO,IAAI,CAAC;QACd,CAAC;QACD,gEAAgE;QAChE,IAAI,OAAO,CAAC,GAAG,IAAG,CAAC;KACpB;CACF,CAAC,CAAC;AAEH,eAAe,eAAe,CAAC","sourcesContent":["import { createContext, MutableRefObject } from 'react';\n\nimport { openCloseStates } from '../../hooks/useTransitionState';\n\ninterface AppShellContextValue {\n navOpen: boolean;\n navState: typeof openCloseStates[keyof typeof openCloseStates];\n drawerOpen: boolean;\n setDrawerOpen: (open: boolean) => void;\n refocusEl: HTMLButtonElement | null;\n setRefocusEl: (el: HTMLButtonElement | null) => void;\n focusedImperatively: MutableRefObject<boolean>;\n headerEl: HTMLDivElement | null;\n previewTriggerRef: MutableRefObject<HTMLElement | null>;\n}\n\nexport type DrawerContent = 'notifications' | 'recents';\n\nconst AppShellContext = createContext<AppShellContextValue>({\n navOpen: false,\n navState: 'closed',\n drawerOpen: false,\n setDrawerOpen: () => {},\n refocusEl: null,\n setRefocusEl: () => {},\n focusedImperatively: {\n get current() {\n return false;\n }\n },\n headerEl: null,\n previewTriggerRef: {\n get current() {\n return null;\n },\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n set current(val) {}\n }\n});\n\nexport default AppShellContext;\n"]}
|
|
@@ -2,4 +2,5 @@ export { default } from './AppShell';
|
|
|
2
2
|
export { default as AppShellList, AppShellListProps } from './AppShellList';
|
|
3
3
|
export { AppHeaderProps, AppShellProps, AppShellDrawerProps, DrawerItemProps, DrawerListProps } from './AppShell.types';
|
|
4
4
|
export { default as SkipNavigation } from './SkipNavigation';
|
|
5
|
+
export { default as AppShellContext } from './AppShellContext';
|
|
5
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/AppShell/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAC5E,OAAO,EACL,cAAc,EACd,aAAa,EACb,mBAAmB,EACnB,eAAe,EACf,eAAe,EAChB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,kBAAkB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/AppShell/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAC5E,OAAO,EACL,cAAc,EACd,aAAa,EACb,mBAAmB,EACnB,eAAe,EACf,eAAe,EAChB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/AppShell/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,OAAO,IAAI,YAAY,EAAqB,MAAM,gBAAgB,CAAC;AAQ5E,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,kBAAkB,CAAC","sourcesContent":["export { default } from './AppShell';\nexport { default as AppShellList, AppShellListProps } from './AppShellList';\nexport {\n AppHeaderProps,\n AppShellProps,\n AppShellDrawerProps,\n DrawerItemProps,\n DrawerListProps\n} from './AppShell.types';\nexport { default as SkipNavigation } from './SkipNavigation';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/AppShell/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,OAAO,IAAI,YAAY,EAAqB,MAAM,gBAAgB,CAAC;AAQ5E,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC","sourcesContent":["export { default } from './AppShell';\nexport { default as AppShellList, AppShellListProps } from './AppShellList';\nexport {\n AppHeaderProps,\n AppShellProps,\n AppShellDrawerProps,\n DrawerItemProps,\n DrawerListProps\n} from './AppShell.types';\nexport { default as SkipNavigation } from './SkipNavigation';\nexport { default as AppShellContext } from './AppShellContext';\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Backdrop/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Backdrop/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Backdrop/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Backdrop/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAiB,cAAc,EAAE,MAAM,YAAY,CAAC","sourcesContent":["export { default, BackdropProps, StyledBackdrop } from './Backdrop';\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
|
-
import { ForwardProps } from '../../types';
|
|
3
|
-
export interface AlertProps {
|
|
2
|
+
import { ForwardProps, NoChildrenProp } from '../../types';
|
|
3
|
+
export interface AlertProps extends NoChildrenProp {
|
|
4
4
|
/** Determines the color to render the Badge as. This color is derived from the Theme. */
|
|
5
5
|
variant: 'urgent' | 'success';
|
|
6
6
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Alert.d.ts","sourceRoot":"","sources":["../../../src/components/Badges/Alert.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAoC,MAAM,OAAO,CAAC;AAG7D,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"Alert.d.ts","sourceRoot":"","sources":["../../../src/components/Badges/Alert.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAoC,MAAM,OAAO,CAAC;AAG7D,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAG3D,MAAM,WAAW,UAAW,SAAQ,cAAc;IAChD,yFAAyF;IACzF,OAAO,EAAE,QAAQ,GAAG,SAAS,CAAC;CAC/B;AAED,eAAO,MAAM,WAAW,iHAYtB,CAAC;AAIH,QAAA,MAAM,KAAK,EAAE,EAAE,CAAC,YAAY,GAAG,UAAU,CAKxC,CAAC;AAEF,eAAe,KAAK,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Alert.js","sourceRoot":"","sources":["../../../src/components/Badges/Alert.tsx"],"names":[],"mappings":";AAAA,OAAO,EAA4B,UAAU,EAAE,MAAM,OAAO,CAAC;AAC7D,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAGhD,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAO/C,MAAM,CAAC,MAAM,WAAW,GAAG,MAAM,CAAC,GAAG,CAAa,KAAK,CAAC,EAAE;IACxD,MAAM,MAAM,GAAG,KAAK,CAAC,KAAK,CAAC,UAAU,CAAC,MAAM,CAAC,KAAK,CAAC;IACnD,MAAM,EAAE,UAAU,EAAE,GAAG,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAC7C,MAAM,EAAE,cAAc,EAAE,WAAW,EAAE,GAAG,MAAM,CAAC,IAAI,CAAC;IACpD,OAAO,GAAG,CAAA;kBACM,UAAU;8BACE,WAAW;;;;;GAKtC,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,WAAW,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAE5C,MAAM,KAAK,GAAkC,UAAU,CACrD,CAAC,KAAkC,EAAE,GAAwB,EAAE,EAAE;IAC/D,MAAM,EAAE,OAAO,EAAE,GAAG,SAAS,EAAE,GAAG,KAAK,CAAC;IACxC,OAAO,KAAC,WAAW,OAAK,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,GAAG,WAAI,CAAC;AACpE,CAAC,CACF,CAAC;AAEF,eAAe,KAAK,CAAC","sourcesContent":["import { FC, PropsWithoutRef, Ref, forwardRef } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport { ForwardProps } from '../../types';\nimport { defaultThemeProp } from '../../theme';\n\nexport interface AlertProps {\n /** Determines the color to render the Badge as. This color is derived from the Theme. */\n variant: 'urgent' | 'success';\n}\n\nexport const StyledAlert = styled.div<AlertProps>(props => {\n const alerts = props.theme.components.badges.alert;\n const { background } = alerts[props.variant];\n const { 'border-color': borderColor } = alerts.base;\n return css`\n background: ${background};\n border: 0.0625rem solid ${borderColor};\n border-radius: 100%;\n display: inline-block;\n height: 0.625rem;\n width: 0.625rem;\n `;\n});\n\nStyledAlert.defaultProps = defaultThemeProp;\n\nconst Alert: FC<ForwardProps & AlertProps> = forwardRef(\n (props: PropsWithoutRef<AlertProps>, ref: Ref<HTMLDivElement>) => {\n const { variant, ...restProps } = props;\n return <StyledAlert {...restProps} variant={variant} ref={ref} />;\n }\n);\n\nexport default Alert;\n"]}
|
|
1
|
+
{"version":3,"file":"Alert.js","sourceRoot":"","sources":["../../../src/components/Badges/Alert.tsx"],"names":[],"mappings":";AAAA,OAAO,EAA4B,UAAU,EAAE,MAAM,OAAO,CAAC;AAC7D,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAGhD,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAO/C,MAAM,CAAC,MAAM,WAAW,GAAG,MAAM,CAAC,GAAG,CAAa,KAAK,CAAC,EAAE;IACxD,MAAM,MAAM,GAAG,KAAK,CAAC,KAAK,CAAC,UAAU,CAAC,MAAM,CAAC,KAAK,CAAC;IACnD,MAAM,EAAE,UAAU,EAAE,GAAG,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAC7C,MAAM,EAAE,cAAc,EAAE,WAAW,EAAE,GAAG,MAAM,CAAC,IAAI,CAAC;IACpD,OAAO,GAAG,CAAA;kBACM,UAAU;8BACE,WAAW;;;;;GAKtC,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,WAAW,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAE5C,MAAM,KAAK,GAAkC,UAAU,CACrD,CAAC,KAAkC,EAAE,GAAwB,EAAE,EAAE;IAC/D,MAAM,EAAE,OAAO,EAAE,GAAG,SAAS,EAAE,GAAG,KAAK,CAAC;IACxC,OAAO,KAAC,WAAW,OAAK,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,GAAG,WAAI,CAAC;AACpE,CAAC,CACF,CAAC;AAEF,eAAe,KAAK,CAAC","sourcesContent":["import { FC, PropsWithoutRef, Ref, forwardRef } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport { ForwardProps, NoChildrenProp } from '../../types';\nimport { defaultThemeProp } from '../../theme';\n\nexport interface AlertProps extends NoChildrenProp {\n /** Determines the color to render the Badge as. This color is derived from the Theme. */\n variant: 'urgent' | 'success';\n}\n\nexport const StyledAlert = styled.div<AlertProps>(props => {\n const alerts = props.theme.components.badges.alert;\n const { background } = alerts[props.variant];\n const { 'border-color': borderColor } = alerts.base;\n return css`\n background: ${background};\n border: 0.0625rem solid ${borderColor};\n border-radius: 100%;\n display: inline-block;\n height: 0.625rem;\n width: 0.625rem;\n `;\n});\n\nStyledAlert.defaultProps = defaultThemeProp;\n\nconst Alert: FC<ForwardProps & AlertProps> = forwardRef(\n (props: PropsWithoutRef<AlertProps>, ref: Ref<HTMLDivElement>) => {\n const { variant, ...restProps } = props;\n return <StyledAlert {...restProps} variant={variant} ref={ref} />;\n }\n);\n\nexport default Alert;\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FunctionComponent, ReactNode, Ref } from 'react';
|
|
2
|
-
import { BaseProps, ForwardProps } from '../../types';
|
|
3
|
-
export interface BannerProps extends BaseProps {
|
|
2
|
+
import { BaseProps, ForwardProps, NoChildrenProp } from '../../types';
|
|
3
|
+
export interface BannerProps extends BaseProps, NoChildrenProp {
|
|
4
4
|
/** Controls the styling of the Banner. */
|
|
5
5
|
variant: 'urgent' | 'success' | 'warning' | 'info';
|
|
6
6
|
/** Heading text for the Banner. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Banner.d.ts","sourceRoot":"","sources":["../../../src/components/Banner/Banner.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAA+B,GAAG,EAAE,MAAM,OAAO,CAAC;AAIvF,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAA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styled-components';\nimport { getContrast, readableColor } from 'polished';\n\nimport { BaseProps, ForwardProps } from '../../types';\nimport { defaultThemeProp } from '../../theme';\nimport Icon, { registerIcon } from '../Icon';\nimport * as timesIcon from '../Icon/icons/times.icon';\nimport Button from '../Button';\nimport { tryCatch } from '../../utils';\nimport { useDirection, useI18n } from '../../hooks';\nimport Flex from '../Flex';\nimport Text from '../Text';\n\nregisterIcon(timesIcon);\n\nexport interface BannerProps extends BaseProps {\n /** Controls the styling of the Banner. */\n variant: 'urgent' | 'success' | 'warning' | 'info';\n /** Heading text for the Banner. */\n heading?: string;\n /**\n * The heading tag to render the provided heading as. This is agnostic to the styling of the heading.\n * @default \"h2\"\n */\n headingTag?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';\n /** Pass one or more descriptive messages to inform the user. */\n messages: string[];\n /** ID for the Banner. Used both as onDismiss callback arg and DOM id. */\n id: string;\n /** Link or Button provided to the user for next steps. Link should use regular href and Button should use an onClick handler. */\n action?: ReactNode;\n /** Callback when user explicitly dismisses the Banner. */\n onDismiss?: (id: string) => void;\n ref?: Ref<HTMLDivElement>;\n}\n\nexport const StyledBannerMessages = styled.ul<{ inline: boolean }>(({ theme, inline }) => {\n return css`\n list-style-position: inside;\n ${inline &&\n css`\n display: inline-block;\n margin-inline-end: ${theme.base.spacing};\n `}\n `;\n});\n\nStyledBannerMessages.defaultProps = defaultThemeProp;\n\nexport const StyledBannerContent = styled.div<{ hasDismiss: boolean }>(({ theme, hasDismiss }) => {\n const { end } = useDirection();\n return css`\n position: relative;\n padding: calc(1.5 * ${theme.base.spacing});\n border: 0.0625rem solid ${theme.base.palette['border-line']};\n border-inline-start: none;\n border-top-${end}-radius: ${theme.components.card['border-radius']};\n border-bottom-${end}-radius: ${theme.components.card['border-radius']};\n\n ${\n hasDismiss &&\n css`\n border-inline-end: none;\n padding-inline-end: calc(0.75 * ${theme.base.spacing});\n border-radius: 0;\n `\n }\n `;\n});\n\nStyledBannerContent.defaultProps = defaultThemeProp;\n\nexport const StyledBannerMessage = styled.li<{ inline: boolean }>(({ inline, theme }) => {\n return css`\n color: ${theme.base.palette['foreground-color']};\n ${inline &&\n css`\n display: inline-block;\n margin-inline-end: ${theme.base.spacing};\n `}\n `;\n});\n\nStyledBannerMessage.defaultProps = defaultThemeProp;\n\nexport const StyledBannerDismissColumn = styled.div(({ theme }) => {\n const { end } = useDirection();\n return css`\n border-top-${end}-radius: ${theme.components.card['border-radius']};\n border-bottom-${end}-radius: ${theme.components.card['border-radius']};\n border: 0.0625rem solid ${theme.base.palette['border-line']};\n border-inline-start: none;\n `;\n});\n\nStyledBannerDismissColumn.defaultProps = defaultThemeProp;\n\nexport const StyledBannerDismissButton = styled(Button)``;\n\nexport const StyledBannerStatus = styled.div<Pick<BannerProps, 'variant'>>(({ variant, theme }) => {\n const { background: bg } = theme.components.banner[variant];\n const color = tryCatch(() =>\n getContrast(bg, theme.base.palette['primary-background']) >= 3\n ? theme.base.palette['primary-background']\n : readableColor(bg)\n );\n\n const { start } = useDirection();\n\n return css`\n background-color: ${bg};\n width: 3.125rem;\n color: ${color};\n border-top-${start}-radius: ${theme.components.card['border-radius']};\n border-bottom-${start}-radius: ${theme.components.card['border-radius']};\n font-size: 1.25rem;\n `;\n});\n\nStyledBannerStatus.defaultProps = defaultThemeProp;\n\nexport const StyledBanner = styled.div(({ theme }) => {\n return css`\n background: ${theme.components.card.background};\n border-radius: ${theme.components.card['border-radius']};\n `;\n});\n\nStyledBanner.defaultProps = defaultThemeProp;\n\nconst Banner: FunctionComponent<BannerProps & ForwardProps> = forwardRef(\n (\n {\n variant,\n heading,\n headingTag = 'h2',\n messages,\n onDismiss,\n action,\n id,\n ...restProps\n }: PropsWithoutRef<BannerProps>,\n ref: BannerProps['ref']\n ) => {\n const inline = messages.length === 1;\n const singleLine = inline && !heading;\n const hasDismiss = !!onDismiss;\n\n let bannerIcon = 'warn-solid';\n let role: string | undefined = 'alert';\n let ariaLive = 'assertive';\n\n if (variant === 'info') {\n bannerIcon = 'bulb-solid';\n ariaLive = 'polite';\n role = undefined;\n } else if (variant === 'success') {\n bannerIcon = 'check';\n ariaLive = 'polite';\n role = undefined;\n } else if (variant === 'warning') {\n bannerIcon = 'warn';\n }\n\n const t = useI18n();\n\n return (\n <Flex\n {...restProps}\n container\n as={StyledBanner}\n role={role}\n aria-live={ariaLive}\n id={id}\n ref={ref}\n >\n <Flex\n container={{ justify: 'center', alignItems: 'center' }}\n item={{ shrink: 0 }}\n as={StyledBannerStatus}\n variant={variant}\n >\n <Icon name={bannerIcon} />\n </Flex>\n\n <Flex\n container={singleLine ? { alignItems: 'center' } : { direction: 'column', gap: 1 }}\n item={{ grow: 1 }}\n as={StyledBannerContent}\n hasDismiss={hasDismiss}\n >\n {heading && (\n <Text variant='h4' as={headingTag}>\n {heading}\n </Text>\n )}\n\n <StyledBannerMessages inline={inline}>\n {messages.map((msg, index) => (\n // eslint-disable-next-line react/no-array-index-key\n <StyledBannerMessage key={`${msg}+${index}`} inline={inline}>\n {msg}\n </StyledBannerMessage>\n ))}\n </StyledBannerMessages>\n\n {action}\n </Flex>\n\n {onDismiss && (\n <Flex\n container={{\n direction: 'column',\n justify: singleLine ? 'center' : undefined,\n pad: [singleLine ? 0.5 : 1, 0.5, 0.5, 0]\n }}\n as={StyledBannerDismissColumn}\n >\n <StyledBannerDismissButton\n variant='simple'\n icon\n onClick={() => onDismiss(id)}\n aria-label={t('banner_dismiss_button_label_a11y')}\n >\n <Icon name='times' />\n </StyledBannerDismissButton>\n </Flex>\n )}\n </Flex>\n );\n }\n);\n\nexport default Banner;\n"]}
|
|
1
|
+
{"version":3,"file":"Banner.js","sourceRoot":"","sources":["../../../src/components/Banner/Banner.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAgC,UAAU,EAAwB,MAAM,OAAO,CAAC;AACvF,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,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EAED,KAAC,oBAAoB,IAAC,MAAM,EAAE,MAAM,YACjC,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE,CAAC;wBAC5B,oDAAoD;wBACpD,KAAC,mBAAmB,IAAyB,MAAM,EAAE,MAAM,YACxD,GAAG,IADoB,GAAG,GAAG,IAAI,KAAK,EAAE,CAErB,CACvB,CAAC,WACmB,EAEtB,MAAM,YACF,EAEN,SAAS,IAAI,CACZ,KAAC,IAAI,IACH,SAAS,EAAE;oBACT,SAAS,EAAE,QAAQ;oBACnB,OAAO,EAAE,UAAU,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS;oBAC1C,GAAG,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC;iBACzC,EACD,EAAE,EAAE,yBAAyB,YAE7B,KAAC,yBAAyB,IACxB,OAAO,EAAC,QAAQ,EAChB,IAAI,QACJ,OAAO,EAAE,GAAG,EAAE,CAAC,SAAS,CAAC,EAAE,CAAC,gBAChB,CAAC,CAAC,kCAAkC,CAAC,YAEjD,KAAC,IAAI,IAAC,IAAI,EAAC,OAAO,WAAG,WACK,WACvB,CACR,YACI,CACR,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,MAAM,CAAC","sourcesContent":["import { FunctionComponent, ReactNode, forwardRef, PropsWithoutRef, Ref } from 'react';\nimport styled, { css } from 'styled-components';\nimport { getContrast, readableColor } from 'polished';\n\nimport { BaseProps, ForwardProps, NoChildrenProp } from '../../types';\nimport { defaultThemeProp } from '../../theme';\nimport Icon, { registerIcon } from '../Icon';\nimport * as timesIcon from '../Icon/icons/times.icon';\nimport Button from '../Button';\nimport { tryCatch } from '../../utils';\nimport { useDirection, useI18n } from '../../hooks';\nimport Flex from '../Flex';\nimport Text from '../Text';\n\nregisterIcon(timesIcon);\n\nexport interface BannerProps extends BaseProps, NoChildrenProp {\n /** Controls the styling of the Banner. */\n variant: 'urgent' | 'success' | 'warning' | 'info';\n /** Heading text for the Banner. */\n heading?: string;\n /**\n * The heading tag to render the provided heading as. This is agnostic to the styling of the heading.\n * @default \"h2\"\n */\n headingTag?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';\n /** Pass one or more descriptive messages to inform the user. */\n messages: string[];\n /** ID for the Banner. Used both as onDismiss callback arg and DOM id. */\n id: string;\n /** Link or Button provided to the user for next steps. Link should use regular href and Button should use an onClick handler. */\n action?: ReactNode;\n /** Callback when user explicitly dismisses the Banner. */\n onDismiss?: (id: string) => void;\n ref?: Ref<HTMLDivElement>;\n}\n\nexport const StyledBannerMessages = styled.ul<{ inline: boolean }>(({ theme, inline }) => {\n return css`\n list-style-position: inside;\n ${inline &&\n css`\n display: inline-block;\n margin-inline-end: ${theme.base.spacing};\n `}\n `;\n});\n\nStyledBannerMessages.defaultProps = defaultThemeProp;\n\nexport const StyledBannerContent = styled.div<{ hasDismiss: boolean }>(({ theme, hasDismiss }) => {\n const { end } = useDirection();\n return css`\n position: relative;\n padding: calc(1.5 * ${theme.base.spacing});\n border: 0.0625rem solid ${theme.base.palette['border-line']};\n border-inline-start: none;\n border-top-${end}-radius: ${theme.components.card['border-radius']};\n border-bottom-${end}-radius: ${theme.components.card['border-radius']};\n\n ${\n hasDismiss &&\n css`\n border-inline-end: none;\n padding-inline-end: calc(0.75 * ${theme.base.spacing});\n border-radius: 0;\n `\n }\n `;\n});\n\nStyledBannerContent.defaultProps = defaultThemeProp;\n\nexport const StyledBannerMessage = styled.li<{ inline: boolean }>(({ inline, theme }) => {\n return css`\n color: ${theme.base.palette['foreground-color']};\n ${inline &&\n css`\n display: inline-block;\n margin-inline-end: ${theme.base.spacing};\n `}\n `;\n});\n\nStyledBannerMessage.defaultProps = defaultThemeProp;\n\nexport const StyledBannerDismissColumn = styled.div(({ theme }) => {\n const { end } = useDirection();\n return css`\n border-top-${end}-radius: ${theme.components.card['border-radius']};\n border-bottom-${end}-radius: ${theme.components.card['border-radius']};\n border: 0.0625rem solid ${theme.base.palette['border-line']};\n border-inline-start: none;\n `;\n});\n\nStyledBannerDismissColumn.defaultProps = defaultThemeProp;\n\nexport const StyledBannerDismissButton = styled(Button)``;\n\nexport const StyledBannerStatus = styled.div<Pick<BannerProps, 'variant'>>(({ variant, theme }) => {\n const { background: bg } = theme.components.banner[variant];\n const color = tryCatch(() =>\n getContrast(bg, theme.base.palette['primary-background']) >= 3\n ? theme.base.palette['primary-background']\n : readableColor(bg)\n );\n\n const { start } = useDirection();\n\n return css`\n background-color: ${bg};\n width: 3.125rem;\n color: ${color};\n border-top-${start}-radius: ${theme.components.card['border-radius']};\n border-bottom-${start}-radius: ${theme.components.card['border-radius']};\n font-size: 1.25rem;\n `;\n});\n\nStyledBannerStatus.defaultProps = defaultThemeProp;\n\nexport const StyledBanner = styled.div(({ theme }) => {\n return css`\n background: ${theme.components.card.background};\n border-radius: ${theme.components.card['border-radius']};\n `;\n});\n\nStyledBanner.defaultProps = defaultThemeProp;\n\nconst Banner: FunctionComponent<BannerProps & ForwardProps> = forwardRef(\n (\n {\n variant,\n heading,\n headingTag = 'h2',\n messages,\n onDismiss,\n action,\n id,\n ...restProps\n }: PropsWithoutRef<BannerProps>,\n ref: BannerProps['ref']\n ) => {\n const inline = messages.length === 1;\n const singleLine = inline && !heading;\n const hasDismiss = !!onDismiss;\n\n let bannerIcon = 'warn-solid';\n let role: string | undefined = 'alert';\n let ariaLive = 'assertive';\n\n if (variant === 'info') {\n bannerIcon = 'bulb-solid';\n ariaLive = 'polite';\n role = undefined;\n } else if (variant === 'success') {\n bannerIcon = 'check';\n ariaLive = 'polite';\n role = undefined;\n } else if (variant === 'warning') {\n bannerIcon = 'warn';\n }\n\n const t = useI18n();\n\n return (\n <Flex\n {...restProps}\n container\n as={StyledBanner}\n role={role}\n aria-live={ariaLive}\n id={id}\n ref={ref}\n >\n <Flex\n container={{ justify: 'center', alignItems: 'center' }}\n item={{ shrink: 0 }}\n as={StyledBannerStatus}\n variant={variant}\n >\n <Icon name={bannerIcon} />\n </Flex>\n\n <Flex\n container={singleLine ? { alignItems: 'center' } : { direction: 'column', gap: 1 }}\n item={{ grow: 1 }}\n as={StyledBannerContent}\n hasDismiss={hasDismiss}\n >\n {heading && (\n <Text variant='h4' as={headingTag}>\n {heading}\n </Text>\n )}\n\n <StyledBannerMessages inline={inline}>\n {messages.map((msg, index) => (\n // eslint-disable-next-line react/no-array-index-key\n <StyledBannerMessage key={`${msg}+${index}`} inline={inline}>\n {msg}\n </StyledBannerMessage>\n ))}\n </StyledBannerMessages>\n\n {action}\n </Flex>\n\n {onDismiss && (\n <Flex\n container={{\n direction: 'column',\n justify: singleLine ? 'center' : undefined,\n pad: [singleLine ? 0.5 : 1, 0.5, 0.5, 0]\n }}\n as={StyledBannerDismissColumn}\n >\n <StyledBannerDismissButton\n variant='simple'\n icon\n onClick={() => onDismiss(id)}\n aria-label={t('banner_dismiss_button_label_a11y')}\n >\n <Icon name='times' />\n </StyledBannerDismissButton>\n </Flex>\n )}\n </Flex>\n );\n }\n);\n\nexport default Banner;\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FunctionComponent, Ref } from 'react';
|
|
2
|
-
import { BaseProps, ForwardProps } from '../../types';
|
|
3
|
-
export interface BooleanDisplayProps extends BaseProps {
|
|
2
|
+
import { BaseProps, ForwardProps, NoChildrenProp } from '../../types';
|
|
3
|
+
export interface BooleanDisplayProps extends BaseProps, NoChildrenProp {
|
|
4
4
|
/** Boolean value */
|
|
5
5
|
value?: boolean;
|
|
6
6
|
/** The text to be displayed when value is true.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BooleanDisplay.d.ts","sourceRoot":"","sources":["../../../src/components/Boolean/BooleanDisplay.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,iBAAiB,EAAmB,GAAG,EAAE,MAAM,OAAO,CAAC;AAK5E,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"BooleanDisplay.d.ts","sourceRoot":"","sources":["../../../src/components/Boolean/BooleanDisplay.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,iBAAiB,EAAmB,GAAG,EAAE,MAAM,OAAO,CAAC;AAK5E,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAGtE,MAAM,WAAW,mBAAoB,SAAQ,SAAS,EAAE,cAAc;IACpE,oBAAoB;IACpB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,oCAAoC;IACpC,GAAG,CAAC,EAAE,GAAG,CAAC,eAAe,CAAC,CAAC;CAC5B;AAYD,QAAA,MAAM,cAAc,EAAE,iBAAiB,CAAC,mBAAmB,GAAG,YAAY,CAyBzE,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
|
@@ -18,7 +18,7 @@ const BooleanDisplay = forwardRef(({ value, trueLabel, falseLabel, ...restProps
|
|
|
18
18
|
const displayText = value
|
|
19
19
|
? trueLabel || t('boolean_display_true_label')
|
|
20
20
|
: falseLabel || t('boolean_display_false_label');
|
|
21
|
-
return (_jsx(StyledBooleanDisplay, { ref: ref, ...restProps, children:
|
|
21
|
+
return (_jsx(StyledBooleanDisplay, { ref: ref, ...restProps, children: value !== undefined ? (_jsxs(_Fragment, { children: [_jsx(Icon, { name: iconName }, void 0), displayText] }, void 0)) : (_jsx("span", { "aria-hidden": 'true', children: "\u2013\u2013" }, void 0)) }, void 0));
|
|
22
22
|
});
|
|
23
23
|
export default BooleanDisplay;
|
|
24
24
|
//# sourceMappingURL=BooleanDisplay.js.map
|