@pega/cosmos-react-core 3.0.0-dev.16.1 → 3.0.0-dev.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/AppShell/AppHeader.d.ts.map +1 -1
- package/lib/components/AppShell/AppHeader.js +4 -6
- package/lib/components/AppShell/AppHeader.js.map +1 -1
- package/lib/components/AppShell/AppHeader.styles.d.ts +16 -0
- package/lib/components/AppShell/AppHeader.styles.d.ts.map +1 -0
- package/lib/components/AppShell/AppHeader.styles.js +155 -0
- package/lib/components/AppShell/AppHeader.styles.js.map +1 -0
- package/lib/components/AppShell/AppShell.d.ts.map +1 -1
- package/lib/components/AppShell/AppShell.js +44 -157
- package/lib/components/AppShell/AppShell.js.map +1 -1
- package/lib/components/AppShell/AppShell.styles.d.ts +7 -51
- package/lib/components/AppShell/AppShell.styles.d.ts.map +1 -1
- package/lib/components/AppShell/AppShell.styles.js +44 -535
- package/lib/components/AppShell/AppShell.styles.js.map +1 -1
- package/lib/components/AppShell/AppShell.types.d.ts +16 -5
- 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 +2 -0
- package/lib/components/AppShell/AppShellContext.d.ts.map +1 -1
- package/lib/components/AppShell/AppShellContext.js +2 -0
- package/lib/components/AppShell/AppShellContext.js.map +1 -1
- package/lib/components/AppShell/AppShellList.js +3 -1
- package/lib/components/AppShell/AppShellList.js.map +1 -1
- package/lib/components/AppShell/AppShellList.styles.d.ts +19 -0
- package/lib/components/AppShell/AppShellList.styles.d.ts.map +1 -0
- package/lib/components/AppShell/AppShellList.styles.js +141 -0
- package/lib/components/AppShell/AppShellList.styles.js.map +1 -0
- package/lib/components/AppShell/AppShellSearch.d.ts +10 -0
- package/lib/components/AppShell/AppShellSearch.d.ts.map +1 -0
- package/lib/components/AppShell/AppShellSearch.js +32 -0
- package/lib/components/AppShell/AppShellSearch.js.map +1 -0
- package/lib/components/AppShell/AppShellSearch.styles.d.ts +8 -0
- package/lib/components/AppShell/AppShellSearch.styles.d.ts.map +1 -0
- package/lib/components/AppShell/AppShellSearch.styles.js +190 -0
- package/lib/components/AppShell/AppShellSearch.styles.js.map +1 -0
- package/lib/components/AppShell/Drawer.js +2 -2
- package/lib/components/AppShell/Drawer.js.map +1 -1
- package/lib/components/AppShell/Drawer.styles.d.ts +15 -0
- package/lib/components/AppShell/Drawer.styles.d.ts.map +1 -0
- package/lib/components/AppShell/Drawer.styles.js +153 -0
- package/lib/components/AppShell/Drawer.styles.js.map +1 -0
- package/lib/components/AppShell/NavigationList.d.ts +5 -0
- package/lib/components/AppShell/NavigationList.d.ts.map +1 -0
- package/lib/components/AppShell/NavigationList.js +123 -0
- package/lib/components/AppShell/NavigationList.js.map +1 -0
- package/lib/components/AppShell/NavigationListItemWrapper.d.ts +5 -0
- package/lib/components/AppShell/NavigationListItemWrapper.d.ts.map +1 -0
- package/lib/components/AppShell/NavigationListItemWrapper.js +109 -0
- package/lib/components/AppShell/NavigationListItemWrapper.js.map +1 -0
- package/lib/components/AppShell/Operator.js +4 -4
- package/lib/components/AppShell/Operator.js.map +1 -1
- package/lib/components/ComboBox/ComboBox.d.ts.map +1 -1
- package/lib/components/ComboBox/ComboBox.js +11 -2
- package/lib/components/ComboBox/ComboBox.js.map +1 -1
- package/lib/components/ComboBox/ComboBox.styles.d.ts +3 -1
- package/lib/components/ComboBox/ComboBox.styles.d.ts.map +1 -1
- package/lib/components/ComboBox/ComboBox.types.d.ts +2 -0
- 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.map +1 -1
- package/lib/components/ComboBox/MultiSelectInput/MultiSelectInput.js +2 -2
- package/lib/components/ComboBox/MultiSelectInput/MultiSelectInput.js.map +1 -1
- package/lib/components/ComboBox/MultiSelectInput/MultiSelectInput.types.d.ts +2 -0
- package/lib/components/ComboBox/MultiSelectInput/MultiSelectInput.types.d.ts.map +1 -1
- package/lib/components/ComboBox/MultiSelectInput/MultiSelectInput.types.js.map +1 -1
- package/lib/components/ComboBox/SingleSelectInput/SingleSelectInput.d.ts.map +1 -1
- package/lib/components/ComboBox/SingleSelectInput/SingleSelectInput.js +2 -2
- package/lib/components/ComboBox/SingleSelectInput/SingleSelectInput.js.map +1 -1
- package/lib/components/ComboBox/SingleSelectInput/SingleSelectInput.types.d.ts +2 -0
- package/lib/components/ComboBox/SingleSelectInput/SingleSelectInput.types.d.ts.map +1 -1
- package/lib/components/ComboBox/SingleSelectInput/SingleSelectInput.types.js.map +1 -1
- package/lib/components/Currency/CurrencyInput.d.ts.map +1 -1
- package/lib/components/Currency/CurrencyInput.js +12 -3
- package/lib/components/Currency/CurrencyInput.js.map +1 -1
- package/lib/components/DateTime/DateTime.types.d.ts +2 -0
- 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/DateInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/DateInput.js +12 -3
- package/lib/components/DateTime/Input/DateInput.js.map +1 -1
- package/lib/components/DateTime/Input/DateTimeInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/DateTimeInput.js +12 -3
- package/lib/components/DateTime/Input/DateTimeInput.js.map +1 -1
- package/lib/components/DateTime/Picker/Calendar.d.ts.map +1 -1
- package/lib/components/DateTime/Picker/Calendar.js +2 -2
- package/lib/components/DateTime/Picker/Calendar.js.map +1 -1
- package/lib/components/DateTime/Picker/TimePicker.d.ts.map +1 -1
- package/lib/components/DateTime/Picker/TimePicker.js +10 -5
- package/lib/components/DateTime/Picker/TimePicker.js.map +1 -1
- package/lib/components/ExpandCollapse/ExpandCollapse.d.ts.map +1 -1
- package/lib/components/ExpandCollapse/ExpandCollapse.js +1 -1
- package/lib/components/ExpandCollapse/ExpandCollapse.js.map +1 -1
- package/lib/components/FieldGroup/FieldGroup.d.ts.map +1 -1
- package/lib/components/FieldGroup/FieldGroup.js +27 -24
- package/lib/components/FieldGroup/FieldGroup.js.map +1 -1
- package/lib/components/FormControl/FormControl.d.ts +6 -2
- package/lib/components/FormControl/FormControl.d.ts.map +1 -1
- package/lib/components/FormControl/FormControl.js +60 -35
- package/lib/components/FormControl/FormControl.js.map +1 -1
- package/lib/components/FormField/FormField.d.ts.map +1 -1
- package/lib/components/FormField/FormField.js +65 -5
- package/lib/components/FormField/FormField.js.map +1 -1
- package/lib/components/Input/Input.d.ts.map +1 -1
- package/lib/components/Input/Input.js +13 -2
- package/lib/components/Input/Input.js.map +1 -1
- package/lib/components/Number/NumberInput.d.ts.map +1 -1
- package/lib/components/Number/NumberInput.js +13 -4
- package/lib/components/Number/NumberInput.js.map +1 -1
- package/lib/components/Number/NumberInput.styles.d.ts +6 -2
- package/lib/components/Number/NumberInput.styles.d.ts.map +1 -1
- package/lib/components/Number/NumberInput.styles.js +4 -2
- package/lib/components/Number/NumberInput.styles.js.map +1 -1
- package/lib/components/Number/NumberInput.types.d.ts +2 -0
- package/lib/components/Number/NumberInput.types.d.ts.map +1 -1
- package/lib/components/Number/NumberInput.types.js.map +1 -1
- package/lib/components/Phone/PhoneInput.d.ts.map +1 -1
- package/lib/components/Phone/PhoneInput.js +12 -3
- package/lib/components/Phone/PhoneInput.js.map +1 -1
- package/lib/components/SearchInput/SearchInput.d.ts +5 -0
- package/lib/components/SearchInput/SearchInput.d.ts.map +1 -1
- package/lib/components/SearchInput/SearchInput.js +14 -4
- package/lib/components/SearchInput/SearchInput.js.map +1 -1
- package/lib/components/SearchInput/SearchInput.styles.d.ts +3 -0
- package/lib/components/SearchInput/SearchInput.styles.d.ts.map +1 -1
- package/lib/components/SearchInput/SearchInput.styles.js +6 -0
- package/lib/components/SearchInput/SearchInput.styles.js.map +1 -1
- package/lib/components/Select/Select.d.ts +2 -0
- package/lib/components/Select/Select.d.ts.map +1 -1
- package/lib/components/Select/Select.js +4 -3
- package/lib/components/Select/Select.js.map +1 -1
- package/lib/components/TextArea/TextArea.d.ts.map +1 -1
- package/lib/components/TextArea/TextArea.js +4 -2
- package/lib/components/TextArea/TextArea.js.map +1 -1
- package/lib/components/Tooltip/Tooltip.d.ts +5 -0
- package/lib/components/Tooltip/Tooltip.d.ts.map +1 -1
- package/lib/components/Tooltip/Tooltip.js +22 -5
- package/lib/components/Tooltip/Tooltip.js.map +1 -1
- package/lib/hooks/useI18n.d.ts +7 -0
- package/lib/hooks/useI18n.d.ts.map +1 -1
- package/lib/i18n/default.d.ts +7 -0
- package/lib/i18n/default.d.ts.map +1 -1
- package/lib/i18n/default.js +8 -0
- package/lib/i18n/default.js.map +1 -1
- package/lib/i18n/i18n.d.ts +14 -0
- package/lib/i18n/i18n.d.ts.map +1 -1
- package/lib/theme/theme.d.ts +12 -0
- package/lib/theme/theme.d.ts.map +1 -1
- package/lib/theme/themeDefinition.json +7 -1
- package/lib/theme/themeOverrides.schema.json +9 -0
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AppShellList.styles.js","sourceRoot":"","sources":["../../../src/components/AppShell/AppShellList.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AACnC,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAErC,yBAAyB;AACzB,MAAM,CAAC,MAAM,yBAAyB,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BAAgB,CAAC;AAE5D,MAAM,CAAC,MAAM,uBAAuB,GAAG,MAAM,CAAC,GAAG,CAAA;IAC7C,gBAAgB;;;;;;CAMnB,CAAC;AAEF,MAAM,CAAC,MAAM,yBAAyB,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IAChE,MAAM,WAAW,GAAG,QAAQ,CAAC,GAAG,EAAE,CAChC,OAAO,CAAC,GAAG,EAAE,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC,CACpE,CAAC;IAEF,OAAO,GAAG,CAAA;kCACsB,WAAW;;;GAG1C,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,yBAAyB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAE1D,MAAM,CAAC,MAAM,yBAAyB,GAAG,MAAM,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IAC/D,OAAO,GAAG,CAAA;;;eAGG,KAAK,CAAC,IAAI,CAAC,OAAO,aAAa,KAAK,CAAC,IAAI,CAAC,OAAO;;;GAG7D,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,yBAAyB,CAAC,YAAY,GAAG,gBAAgB,CAAC","sourcesContent":["import { lighten } from 'polished';\nimport styled, { css } from 'styled-components';\n\nimport { defaultThemeProp } from '../../theme';\nimport { tryCatch } from '../../utils';\nimport { StyledAlert } from '../Badges/Alert';\nimport { StyledEmptyState } from '../EmptyState';\nimport { StyledSummaryItem } from '../SummaryItem';\nimport { StyledText } from '../Text';\n\n/* AppShellList styles */\nexport const StyledAppShellListWrapper = styled.div(({ theme }) => {\n return css`\n max-height: 100%;\n white-space: nowrap;\n\n ${StyledSummaryItem} {\n position: relative;\n &::after {\n content: '';\n position: absolute;\n top: calc(100% - 0.03125rem);\n inset-inline-end: 1rem;\n inset-inline-start: 1rem;\n height: 0.0625rem;\n background-color: ${theme.base.colors.gray['extra-dark']};\n }\n }\n `;\n});\n\nStyledAppShellListWrapper.defaultProps = defaultThemeProp;\n\nexport const StyledAppShellList = styled.ul``;\n\nStyledAppShellList.defaultProps = defaultThemeProp;\n\nexport const StyledAppShellSummaryItem = styled.div(({ theme }) => {\n return css`\n padding: ${theme.base.spacing} calc(2 * ${theme.base.spacing});\n color: inherit;\n background-color: transparent;\n border: none;\n text-decoration: none;\n cursor: pointer;\n text-align: start;\n white-space: normal;\n\n &:hover,\n &:focus {\n color: ${theme.base.colors.white};\n background-color: rgba(255, 255, 255, 0.05);\n }\n\n &:focus {\n outline: none;\n box-shadow: inset ${theme.base.shadow['focus-inverted']};\n }\n `;\n});\n\nStyledAppShellSummaryItem.defaultProps = defaultThemeProp;\n\nexport const StyledAppShellMetaList = styled.ul`\n li {\n color: inherit;\n }\n`;\n\nexport const StyledAppShellPinButton = styled.button(({ theme }) => {\n return css`\n color: inherit;\n border: none;\n background-color: transparent;\n\n &:hover,\n &:focus {\n color: ${theme.base.colors.white};\n background-color: rgba(255, 255, 255, 0.05);\n }\n\n &:focus {\n outline: none;\n box-shadow: inset ${theme.base.shadow['focus-inverted']};\n }\n `;\n});\n\nStyledAppShellPinButton.defaultProps = defaultThemeProp;\n\nexport const StyledNotificationVisual = styled.span<{ unread?: boolean; visualIncluded?: boolean }>(\n ({ theme, unread, visualIncluded }) => {\n return css`\n position: relative;\n ${StyledAlert} {\n display: ${unread ? 'auto' : 'none'};\n position: absolute;\n inset-inline-start: -0.65625rem;\n top: ${visualIncluded ? 'calc(50% - 0.15625rem)' : '0.5rem'};\n background-color: ${theme.base.palette.light};\n height: 0.3125rem;\n width: 0.3125rem;\n } ;\n `;\n }\n);\n\nStyledNotificationVisual.defaultProps = defaultThemeProp;\n\nexport const StyledNotificationPrimary = styled.span<{ unread?: boolean }>(({ theme, unread }) => {\n return css`\n font-weight: ${unread\n ? theme.base['font-weight'].bold\n : theme.base['font-weight']['semi-bold']};\n color: ${unread ? theme.base.palette.light : 'inherit'};\n `;\n});\n\nStyledNotificationPrimary.defaultProps = defaultThemeProp;\n\nexport const StyledNotificationSecondary = styled.span<{ unread?: boolean }>(\n ({ theme, unread }) => {\n return css`\n ${StyledText} {\n opacity: ${unread\n ? theme.base.transparency['transparent-1']\n : theme.base.transparency['transparent-3']};\n }\n `;\n }\n);\n\nStyledNotificationSecondary.defaultProps = defaultThemeProp;\n\nexport const EmptyStateColorContrast = styled.div`\n ${StyledEmptyState} {\n span,\n svg {\n color: rgba(255, 255, 255, 0.7);\n }\n }\n`;\n\nexport const StyledAppShellListSection = styled.div(({ theme }) => {\n const borderColor = tryCatch(() =>\n lighten(0.1, theme.components['app-shell'].nav['background-color'])\n );\n\n return css`\n border-top: 0.0625rem solid ${borderColor};\n min-height: max(20%, 8rem);\n overflow-y: auto;\n `;\n});\n\nStyledAppShellListSection.defaultProps = defaultThemeProp;\n\nexport const StyledAppShellListHeading = styled.h3(({ theme }) => {\n return css`\n position: sticky;\n top: 0;\n padding: ${theme.base.spacing} calc(2 * ${theme.base.spacing});\n background-color: hsl(207 14% 13% / 1);\n z-index: 1;\n `;\n});\n\nStyledAppShellListHeading.defaultProps = defaultThemeProp;\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { AppShellProps } from './AppShell.types';
|
|
3
|
+
export interface AppShellSearchProps {
|
|
4
|
+
collapsed: boolean;
|
|
5
|
+
isMediumOrAbove: boolean;
|
|
6
|
+
searchLabel: string;
|
|
7
|
+
searchInput: AppShellProps['searchInput'];
|
|
8
|
+
}
|
|
9
|
+
export declare const AppShellSearch: FC<AppShellSearchProps>;
|
|
10
|
+
//# sourceMappingURL=AppShellSearch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AppShellSearch.d.ts","sourceRoot":"","sources":["../../../src/components/AppShell/AppShellSearch.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAA2C,MAAM,OAAO,CAAC;AAOpE,OAAO,EAAE,aAAa,EAA2B,MAAM,kBAAkB,CAAC;AAS1E,MAAM,WAAW,mBAAmB;IAClC,SAAS,EAAE,OAAO,CAAC;IACnB,eAAe,EAAE,OAAO,CAAC;IACzB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,aAAa,CAAC,aAAa,CAAC,CAAC;CAC3C;AAED,eAAO,MAAM,cAAc,EAAE,EAAE,CAAC,mBAAmB,CA6DlD,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useContext, useEffect, useRef, useState } from 'react';
|
|
3
|
+
import { useElement, useI18n } from '../../hooks';
|
|
4
|
+
import Icon from '../Icon';
|
|
5
|
+
import SearchInput from '../SearchInput';
|
|
6
|
+
import NavigationListItemWrapper from './NavigationListItemWrapper';
|
|
7
|
+
import AppShellContext from './AppShellContext';
|
|
8
|
+
import { StyledAppShellSearchButton, StyledAppshellSearchContainer, StyledAppShellSearchDecoration, StyledSearchForm } from './AppShellSearch.styles';
|
|
9
|
+
export const AppShellSearch = ({ collapsed, isMediumOrAbove, searchLabel, searchInput }) => {
|
|
10
|
+
const [btnEl, setBtnEl] = useElement();
|
|
11
|
+
const searchRef = useRef();
|
|
12
|
+
const t = useI18n();
|
|
13
|
+
const [menuOpen, setMenuOpen] = useState(false);
|
|
14
|
+
const { navOpen } = useContext(AppShellContext);
|
|
15
|
+
const onMenuToggle = state => {
|
|
16
|
+
setMenuOpen(state === 'open');
|
|
17
|
+
};
|
|
18
|
+
useEffect(() => {
|
|
19
|
+
const onTab = (e) => {
|
|
20
|
+
if (menuOpen && e.key === 'Tab') {
|
|
21
|
+
e.preventDefault();
|
|
22
|
+
searchRef.current?.focus();
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
btnEl?.addEventListener('keydown', onTab);
|
|
26
|
+
return () => {
|
|
27
|
+
btnEl?.removeEventListener('keydown', onTab);
|
|
28
|
+
};
|
|
29
|
+
}, [btnEl, searchRef, menuOpen]);
|
|
30
|
+
return (_jsx(StyledSearchForm, { role: 'search', "aria-label": searchLabel, collapsed: collapsed, onSubmit: e => e.preventDefault(), isMediumOrAbove: isMediumOrAbove, children: collapsed ? (_jsx(NavigationListItemWrapper, { childrenElement: btnEl, label: t('search_placeholder_default'), tooltipLabel: t('search_placeholder_default'), navOpen: navOpen, onMenuToggle: onMenuToggle, content: _jsx(StyledAppshellSearchContainer, { children: _jsx(SearchInput, { ...searchInput, resultsPopover: false, ref: searchRef }) }), children: _jsx(StyledAppShellSearchButton, { ref: setBtnEl, children: _jsx(StyledAppShellSearchDecoration, { children: _jsx(Icon, { name: 'search' }) }) }) })) : (_jsx(SearchInput, { ...searchInput })) }));
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=AppShellSearch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AppShellSearch.js","sourceRoot":"","sources":["../../../src/components/AppShell/AppShellSearch.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAM,UAAU,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEpE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,WAAW,MAAM,gBAAgB,CAAC;AAEzC,OAAO,yBAAyB,MAAM,6BAA6B,CAAC;AAEpE,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAChD,OAAO,EACL,0BAA0B,EAC1B,6BAA6B,EAC7B,8BAA8B,EAC9B,gBAAgB,EACjB,MAAM,yBAAyB,CAAC;AASjC,MAAM,CAAC,MAAM,cAAc,GAA4B,CAAC,EACtD,SAAS,EACT,eAAe,EACf,WAAW,EACX,WAAW,EACZ,EAAE,EAAE;IACH,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,UAAU,EAAqB,CAAC;IAC1D,MAAM,SAAS,GAAG,MA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BAA6B,cAC5B,KAAC,WAAW,OAAK,WAAW,EAAE,cAAc,EAAE,KAAK,EAAE,GAAG,EAAE,SAAS,GAAI,GACzC,YAGlC,KAAC,0BAA0B,IAAC,GAAG,EAAE,QAAQ,YACvC,KAAC,8BAA8B,cAC7B,KAAC,IAAI,IAAC,IAAI,EAAC,QAAQ,GAAG,GACS,GACN,GACH,CAC7B,CAAC,CAAC,CAAC,CACF,KAAC,WAAW,OAAK,WAAW,GAAI,CACjC,GACgB,CACpB,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { FC, useContext, useEffect, useRef, useState } from 'react';\n\nimport { useElement, useI18n } from '../../hooks';\nimport Icon from '../Icon';\nimport SearchInput from '../SearchInput';\n\nimport NavigationListItemWrapper from './NavigationListItemWrapper';\nimport { AppShellProps, NavListItemWrapperProps } from './AppShell.types';\nimport AppShellContext from './AppShellContext';\nimport {\n StyledAppShellSearchButton,\n StyledAppshellSearchContainer,\n StyledAppShellSearchDecoration,\n StyledSearchForm\n} from './AppShellSearch.styles';\n\nexport interface AppShellSearchProps {\n collapsed: boolean;\n isMediumOrAbove: boolean;\n searchLabel: string;\n searchInput: AppShellProps['searchInput'];\n}\n\nexport const AppShellSearch: FC<AppShellSearchProps> = ({\n collapsed,\n isMediumOrAbove,\n searchLabel,\n searchInput\n}) => {\n const [btnEl, setBtnEl] = useElement<HTMLButtonElement>();\n const searchRef = useRef<HTMLInputElement>();\n const t = useI18n();\n const [menuOpen, setMenuOpen] = useState(false);\n const { navOpen } = useContext(AppShellContext);\n\n const onMenuToggle: NavListItemWrapperProps['onMenuToggle'] = state => {\n setMenuOpen(state === 'open');\n };\n\n useEffect(() => {\n const onTab = (e: KeyboardEvent) => {\n if (menuOpen && e.key === 'Tab') {\n e.preventDefault();\n searchRef.current?.focus();\n }\n };\n btnEl?.addEventListener('keydown', onTab);\n return () => {\n btnEl?.removeEventListener('keydown', onTab);\n };\n }, [btnEl, searchRef, menuOpen]);\n\n return (\n <StyledSearchForm\n role='search'\n aria-label={searchLabel}\n collapsed={collapsed}\n onSubmit={e => e.preventDefault()}\n isMediumOrAbove={isMediumOrAbove}\n >\n {collapsed ? (\n <NavigationListItemWrapper\n childrenElement={btnEl}\n label={t('search_placeholder_default')}\n tooltipLabel={t('search_placeholder_default')}\n navOpen={navOpen}\n onMenuToggle={onMenuToggle}\n content={\n <StyledAppshellSearchContainer>\n <SearchInput {...searchInput} resultsPopover={false} ref={searchRef} />\n </StyledAppshellSearchContainer>\n }\n >\n <StyledAppShellSearchButton ref={setBtnEl}>\n <StyledAppShellSearchDecoration>\n <Icon name='search' />\n </StyledAppShellSearchDecoration>\n </StyledAppShellSearchButton>\n </NavigationListItemWrapper>\n ) : (\n <SearchInput {...searchInput} />\n )}\n </StyledSearchForm>\n );\n};\n"]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const StyledSearchForm: import("styled-components").StyledComponent<"form", import("styled-components").DefaultTheme, {
|
|
2
|
+
collapsed: boolean;
|
|
3
|
+
isMediumOrAbove: boolean;
|
|
4
|
+
}, never>;
|
|
5
|
+
export declare const StyledAppShellSearchDecoration: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
6
|
+
export declare const StyledAppShellSearchButton: import("styled-components").StyledComponent<import("react").FunctionComponent<import("../Button/BareButton").BareButtonProps & import("../..").ForwardProps>, import("styled-components").DefaultTheme, {}, never>;
|
|
7
|
+
export declare const StyledAppshellSearchContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
8
|
+
//# sourceMappingURL=AppShellSearch.styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AppShellSearch.styles.d.ts","sourceRoot":"","sources":["../../../src/components/AppShell/AppShellSearch.styles.ts"],"names":[],"mappings":"AAsBA,eAAO,MAAM,gBAAgB;eAA4B,OAAO;qBAAmB,OAAO;SAwJzF,CAAC;AAIF,eAAO,MAAM,8BAA8B,yGAYzC,CAAC;AAIH,eAAO,MAAM,0BAA0B,oNAQtC,CAAC;AAIF,eAAO,MAAM,6BAA6B,yGAIxC,CAAC"}
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
import { lighten, mix } from 'polished';
|
|
2
|
+
import styled, { css } from 'styled-components';
|
|
3
|
+
import { defaultThemeProp } from '../../theme';
|
|
4
|
+
import { tryCatch } from '../../utils';
|
|
5
|
+
import BareButton from '../Button/BareButton';
|
|
6
|
+
import { StyledLink } from '../Link';
|
|
7
|
+
import { StyledMenuItem } from '../Menu';
|
|
8
|
+
import { StyledMenu, StyledMenuListContainer } from '../Menu/Menu.styles';
|
|
9
|
+
import { StyledSearchInput } from '../SearchInput';
|
|
10
|
+
import { StyledCancelButton, StyledFiltersPopover, StyledResultsPopover, StyledSearchButton } from '../SearchInput/SearchInput.styles';
|
|
11
|
+
import { StyledText } from '../Text';
|
|
12
|
+
import { StyledBackdrop } from '../Backdrop';
|
|
13
|
+
import { StyledEmptyState } from '../EmptyState';
|
|
14
|
+
import { navWidth } from './AppShell.styles';
|
|
15
|
+
export const StyledSearchForm = styled.form(({ theme, collapsed, isMediumOrAbove }) => {
|
|
16
|
+
const backgroundColor = tryCatch(() => lighten(0.1, theme.components['app-shell'].nav['background-color']));
|
|
17
|
+
const maxCollapsedSize = theme.components.input.height;
|
|
18
|
+
const activeColor = tryCatch(() => mix(0.85, theme.base.palette.dark, theme.base.palette.interactive));
|
|
19
|
+
const hoverColor = tryCatch(() => mix(0.95, theme.base.palette.dark, theme.base.palette.interactive));
|
|
20
|
+
return css `
|
|
21
|
+
flex-shrink: 0;
|
|
22
|
+
justify-content: center;
|
|
23
|
+
padding: ${theme.base.spacing} 0;
|
|
24
|
+
--background-color: ${backgroundColor};
|
|
25
|
+
|
|
26
|
+
${StyledMenuListContainer} {
|
|
27
|
+
background: transparent;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
header {
|
|
31
|
+
${StyledText} {
|
|
32
|
+
color: ${theme.base.palette.light};
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
${StyledBackdrop} {
|
|
37
|
+
background: transparent;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
${StyledEmptyState} {
|
|
41
|
+
span,
|
|
42
|
+
svg {
|
|
43
|
+
color: ${theme.base.palette.light};
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
${StyledMenu} {
|
|
48
|
+
&[data-active-scope='true'] [data-current='true'] {
|
|
49
|
+
background-color: ${activeColor};
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
${StyledLink} {
|
|
53
|
+
color: ${theme.base.palette.light};
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
${StyledMenuItem} {
|
|
58
|
+
color: ${theme.base.palette.light};
|
|
59
|
+
|
|
60
|
+
li {
|
|
61
|
+
color: ${theme.base.palette.light};
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
&:focus-within {
|
|
65
|
+
background-color: ${activeColor};
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
&:hover:not([aria-disabled='true']) {
|
|
69
|
+
background-color: ${hoverColor};
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
${StyledFiltersPopover}, ${StyledResultsPopover} {
|
|
74
|
+
background-color: ${backgroundColor};
|
|
75
|
+
z-index: calc(${theme.base['z-index'].backdrop} + 1);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
${StyledSearchInput} {
|
|
79
|
+
border: none;
|
|
80
|
+
background: transparent;
|
|
81
|
+
|
|
82
|
+
${StyledSearchButton} {
|
|
83
|
+
transition: borderRadius calc(${theme.base.animation.speed} * 2);
|
|
84
|
+
border: none;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
${StyledCancelButton} {
|
|
88
|
+
color: rgba(255, 255, 255, 0.9);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
input {
|
|
92
|
+
border-color: ${backgroundColor};
|
|
93
|
+
|
|
94
|
+
&::placeholder {
|
|
95
|
+
color: rgba(255, 255, 255, 0.4);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
&:focus:not([disabled]) {
|
|
99
|
+
border-color: ${backgroundColor};
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
input,
|
|
104
|
+
${StyledSearchButton} {
|
|
105
|
+
background: ${backgroundColor};
|
|
106
|
+
color: rgba(255, 255, 255, 0.7);
|
|
107
|
+
border: transparent;
|
|
108
|
+
|
|
109
|
+
&:focus-within {
|
|
110
|
+
border: transparent;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
&:focus-within {
|
|
115
|
+
${StyledSearchButton} {
|
|
116
|
+
color: rgba(255, 255, 255, 0.9);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
> ${StyledSearchInput} {
|
|
122
|
+
margin: 0 calc((${navWidth} - ${theme.base['hit-area']['mouse-min']}) / 2);
|
|
123
|
+
${collapsed &&
|
|
124
|
+
isMediumOrAbove &&
|
|
125
|
+
css `
|
|
126
|
+
overflow: hidden;
|
|
127
|
+
`}
|
|
128
|
+
background: ${backgroundColor};
|
|
129
|
+
|
|
130
|
+
${collapsed &&
|
|
131
|
+
isMediumOrAbove &&
|
|
132
|
+
css `
|
|
133
|
+
${StyledSearchButton} {
|
|
134
|
+
border-radius: calc(
|
|
135
|
+
${theme.base['border-radius']} * ${theme.components['search-input']['border-radius']}
|
|
136
|
+
);
|
|
137
|
+
height: ${maxCollapsedSize};
|
|
138
|
+
width: ${maxCollapsedSize};
|
|
139
|
+
padding: 0;
|
|
140
|
+
|
|
141
|
+
> :not(:first-child) {
|
|
142
|
+
display: none;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
input {
|
|
147
|
+
padding: 0;
|
|
148
|
+
max-width: 0;
|
|
149
|
+
overflow: hidden;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
${StyledCancelButton} {
|
|
153
|
+
display: none;
|
|
154
|
+
}
|
|
155
|
+
`}
|
|
156
|
+
}
|
|
157
|
+
`;
|
|
158
|
+
});
|
|
159
|
+
StyledSearchForm.defaultProps = defaultThemeProp;
|
|
160
|
+
export const StyledAppShellSearchDecoration = styled.div(({ theme }) => {
|
|
161
|
+
return css `
|
|
162
|
+
width: ${theme.components.input.height};
|
|
163
|
+
height: ${theme.components.input.height};
|
|
164
|
+
border-radius: 50%;
|
|
165
|
+
display: flex;
|
|
166
|
+
align-items: center;
|
|
167
|
+
justify-content: center;
|
|
168
|
+
background: var(--background-color);
|
|
169
|
+
color: rgba(255, 255, 255, 0.7);
|
|
170
|
+
margin: 0 auto;
|
|
171
|
+
`;
|
|
172
|
+
});
|
|
173
|
+
StyledAppShellSearchDecoration.defaultProps = defaultThemeProp;
|
|
174
|
+
export const StyledAppShellSearchButton = styled(BareButton) `
|
|
175
|
+
width: 100%;
|
|
176
|
+
&:focus {
|
|
177
|
+
${StyledAppShellSearchDecoration} {
|
|
178
|
+
outline: none;
|
|
179
|
+
box-shadow: inset ${props => props.theme.base.shadow['focus-inverted']};
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
`;
|
|
183
|
+
StyledAppShellSearchButton.defaultProps = defaultThemeProp;
|
|
184
|
+
export const StyledAppshellSearchContainer = styled.div(({ theme: { base } }) => {
|
|
185
|
+
return css `
|
|
186
|
+
padding: ${base.spacing};
|
|
187
|
+
`;
|
|
188
|
+
});
|
|
189
|
+
StyledAppshellSearchContainer.defaultProps = defaultThemeProp;
|
|
190
|
+
//# sourceMappingURL=AppShellSearch.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AppShellSearch.styles.js","sourceRoot":"","sources":["../../../src/components/AppShell/AppShellSearch.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,U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AkB;;gBAEd,KAAK,CAAC,IAAI,CAAC,eAAe,CAAC,MAAM,KAAK,CAAC,UAAU,CAAC,cAAc,CAAC,CAAC,eAAe,CAAC;;sBAE5E,gBAAgB;qBACjB,gBAAgB;;;;;;;;;;;;;;YAczB,kBAAkB;;;SAGrB;;KAEJ,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,gBAAgB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAEjD,MAAM,CAAC,MAAM,8BAA8B,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IACrE,OAAO,GAAG,CAAA;aACC,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC,MAAM;cAC5B,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC,MAAM;;;;;;;;GAQxC,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,8BAA8B,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAE/D,MAAM,CAAC,MAAM,0BAA0B,GAAG,MAAM,CAAC,UAAU,CAAC,CAAA;;;MAGtD,8BAA8B;;0BAEV,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC;;;CAG3E,CAAC;AAEF,0BAA0B,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAE3D,MAAM,CAAC,MAAM,6BAA6B,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,EAAE;IAC9E,OAAO,GAAG,CAAA;eACG,IAAI,CAAC,OAAO;GACxB,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,6BAA6B,CAAC,YAAY,GAAG,gBAAgB,CAAC","sourcesContent":["import { lighten, mix } from 'polished';\nimport styled, { css } from 'styled-components';\n\nimport { defaultThemeProp } from '../../theme';\nimport { tryCatch } from '../../utils';\nimport BareButton from '../Button/BareButton';\nimport { StyledLink } from '../Link';\nimport { StyledMenuItem } from '../Menu';\nimport { StyledMenu, StyledMenuListContainer } from '../Menu/Menu.styles';\nimport { StyledSearchInput } from '../SearchInput';\nimport {\n StyledCancelButton,\n StyledFiltersPopover,\n StyledResultsPopover,\n StyledSearchButton\n} from '../SearchInput/SearchInput.styles';\nimport { StyledText } from '../Text';\nimport { StyledBackdrop } from '../Backdrop';\nimport { StyledEmptyState } from '../EmptyState';\n\nimport { navWidth } from './AppShell.styles';\n\nexport const StyledSearchForm = styled.form<{ collapsed: boolean; isMediumOrAbove: boolean }>(\n ({ theme, collapsed, isMediumOrAbove }) => {\n const backgroundColor = tryCatch(() =>\n lighten(0.1, theme.components['app-shell'].nav['background-color'])\n );\n const maxCollapsedSize = theme.components.input.height;\n const activeColor = tryCatch(() =>\n mix(0.85, theme.base.palette.dark, theme.base.palette.interactive)\n );\n const hoverColor = tryCatch(() =>\n mix(0.95, theme.base.palette.dark, theme.base.palette.interactive)\n );\n\n return css`\n flex-shrink: 0;\n justify-content: center;\n padding: ${theme.base.spacing} 0;\n --background-color: ${backgroundColor};\n\n ${StyledMenuListContainer} {\n background: transparent;\n }\n\n header {\n ${StyledText} {\n color: ${theme.base.palette.light};\n }\n }\n\n ${StyledBackdrop} {\n background: transparent;\n }\n\n ${StyledEmptyState} {\n span,\n svg {\n color: ${theme.base.palette.light};\n }\n }\n\n ${StyledMenu} {\n &[data-active-scope='true'] [data-current='true'] {\n background-color: ${activeColor};\n }\n\n ${StyledLink} {\n color: ${theme.base.palette.light};\n }\n }\n\n ${StyledMenuItem} {\n color: ${theme.base.palette.light};\n\n li {\n color: ${theme.base.palette.light};\n }\n\n &:focus-within {\n background-color: ${activeColor};\n }\n\n &:hover:not([aria-disabled='true']) {\n background-color: ${hoverColor};\n }\n }\n\n ${StyledFiltersPopover}, ${StyledResultsPopover} {\n background-color: ${backgroundColor};\n z-index: calc(${theme.base['z-index'].backdrop} + 1);\n }\n\n ${StyledSearchInput} {\n border: none;\n background: transparent;\n\n ${StyledSearchButton} {\n transition: borderRadius calc(${theme.base.animation.speed} * 2);\n border: none;\n }\n\n ${StyledCancelButton} {\n color: rgba(255, 255, 255, 0.9);\n }\n\n input {\n border-color: ${backgroundColor};\n\n &::placeholder {\n color: rgba(255, 255, 255, 0.4);\n }\n\n &:focus:not([disabled]) {\n border-color: ${backgroundColor};\n }\n }\n\n input,\n ${StyledSearchButton} {\n background: ${backgroundColor};\n color: rgba(255, 255, 255, 0.7);\n border: transparent;\n\n &:focus-within {\n border: transparent;\n }\n }\n\n &:focus-within {\n ${StyledSearchButton} {\n color: rgba(255, 255, 255, 0.9);\n }\n }\n }\n\n > ${StyledSearchInput} {\n margin: 0 calc((${navWidth} - ${theme.base['hit-area']['mouse-min']}) / 2);\n ${collapsed &&\n isMediumOrAbove &&\n css`\n overflow: hidden;\n `}\n background: ${backgroundColor};\n\n ${collapsed &&\n isMediumOrAbove &&\n css`\n ${StyledSearchButton} {\n border-radius: calc(\n ${theme.base['border-radius']} * ${theme.components['search-input']['border-radius']}\n );\n height: ${maxCollapsedSize};\n width: ${maxCollapsedSize};\n padding: 0;\n\n > :not(:first-child) {\n display: none;\n }\n }\n\n input {\n padding: 0;\n max-width: 0;\n overflow: hidden;\n }\n\n ${StyledCancelButton} {\n display: none;\n }\n `}\n }\n `;\n }\n);\n\nStyledSearchForm.defaultProps = defaultThemeProp;\n\nexport const StyledAppShellSearchDecoration = styled.div(({ theme }) => {\n return css`\n width: ${theme.components.input.height};\n height: ${theme.components.input.height};\n border-radius: 50%;\n display: flex;\n align-items: center;\n justify-content: center;\n background: var(--background-color);\n color: rgba(255, 255, 255, 0.7);\n margin: 0 auto;\n `;\n});\n\nStyledAppShellSearchDecoration.defaultProps = defaultThemeProp;\n\nexport const StyledAppShellSearchButton = styled(BareButton)`\n width: 100%;\n &:focus {\n ${StyledAppShellSearchDecoration} {\n outline: none;\n box-shadow: inset ${props => props.theme.base.shadow['focus-inverted']};\n }\n }\n`;\n\nStyledAppShellSearchButton.defaultProps = defaultThemeProp;\n\nexport const StyledAppshellSearchContainer = styled.div(({ theme: { base } }) => {\n return css`\n padding: ${base.spacing};\n `;\n});\n\nStyledAppshellSearchContainer.defaultProps = defaultThemeProp;\n"]}
|
|
@@ -11,7 +11,7 @@ import { useDirection, useI18n, useTheme } from '../../hooks';
|
|
|
11
11
|
import Configuration from '../Configuration';
|
|
12
12
|
import { tryCatch } from '../../utils';
|
|
13
13
|
import AppShellContext from './AppShellContext';
|
|
14
|
-
import { StyledDrawerWrapper, StyledDrawerBackButton, StyledDrawerHeading, StyledDrawerListContainer } from './
|
|
14
|
+
import { StyledDrawerWrapper, StyledDrawerBackButton, StyledDrawerHeading, StyledDrawerListContainer } from './Drawer.styles';
|
|
15
15
|
registerIcon(arrowLeftIcon);
|
|
16
16
|
export default (props) => {
|
|
17
17
|
const { setDrawerOpen, drawerOpen, refocusEl, focusedImperatively } = useContext(AppShellContext);
|
|
@@ -33,7 +33,7 @@ export default (props) => {
|
|
|
33
33
|
};
|
|
34
34
|
const { ltr, rtl } = useDirection();
|
|
35
35
|
const t = useI18n();
|
|
36
|
-
return (_jsx(Configuration, { theme: appShellTheme, children: _jsxs(Drawer, { as: StyledDrawerWrapper, position: '
|
|
36
|
+
return (_jsx(Configuration, { theme: appShellTheme, children: _jsxs(Drawer, { as: StyledDrawerWrapper, position: 'fixed', placement: 'left', open: drawerOpen, nullWhenClosed: true, onAfterOpen: () => {
|
|
37
37
|
if (backButtonRef.current && document.activeElement !== backButtonRef.current) {
|
|
38
38
|
focusedImperatively.current = true;
|
|
39
39
|
backButtonRef.current.focus();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Drawer.js","sourceRoot":"","sources":["../../../src/components/AppShell/Drawer.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,EAAa,MAAM,OAAO,CAAC;AACtD,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAEnC,OAAO,UAAU,MAAM,sBAAsB,CAAC;AAC9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C,aAAa,KAAK,aAAa,CAAC,OAAO,EAAE;oBAC7E,mBAAmB,CAAC,OAAO,GAAG,IAAI,CAAC;oBACnC,aAAa,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;iBAC/B;gBACD,YAAY,EAAE,EAAE,CAAC;YACnB,CAAC,EACD,YAAY,EAAE,GAAG,EAAE;gBACjB,IAAI,SAAS,IAAI,QAAQ,CAAC,aAAa,KAAK,SAAS,EAAE;oBACrD,mBAAmB,CAAC,OAAO,GAAG,IAAI,CAAC;oBACnC,SAAS,CAAC,KAAK,EAAE,CAAC;iBACnB;gBACD,aAAa,EAAE,EAAE,CAAC;YACpB,CAAC,aAED,MAAC,IAAI,IAAC,EAAE,EAAE,mBAAmB,EAAE,SAAS,EAAE,EAAE,UAAU,EAAE,QAAQ,EAAE,aAC/D,GAAG,IAAI,KAAC,IAAI,cAAE,MAAM,GAAQ,EAC7B,KAAC,UAAU,IACT,EAAE,EAAE,sBAAsB,EAC1B,GAAG,EAAE,aAAa,EAClB,OAAO,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,KAAK,CAAC,gBACvB,CAAC,CAAC,YAAY,EAAE,CAAC,MAAM,CAAC,CAAC,YAErC,KAAC,IAAI,IAAC,IAAI,EAAC,YAAY,GAAG,GACf,EACZ,GAAG,IAAI,KAAC,IAAI,cAAE,MAAM,GAAQ,IACxB,EACP,KAAC,IAAI,IAAC,EAAE,EAAE,yBAAyB,EAAE,SAAS,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,YACpE,OAAO,GACH,IACA,GACK,CACjB,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { useContext, useRef, ReactNode } from 'react';\nimport { lighten } from 'polished';\n\nimport BareButton from '../Button/BareButton';\nimport Drawer from '../Drawer';\nimport Flex from '../Flex';\nimport Icon, { registerIcon } from '../Icon';\nimport * as arrowLeftIcon from '../Icon/icons/arrow-left.icon';\nimport Text from '../Text';\nimport { useDirection, useI18n, useTheme } from '../../hooks';\nimport Configuration from '../Configuration';\nimport { tryCatch } from '../../utils';\n\nimport AppShellContext from './AppShellContext';\nimport {\n StyledDrawerWrapper,\n StyledDrawerBackButton,\n StyledDrawerHeading,\n StyledDrawerListContainer\n} from './Drawer.styles';\n\nregisterIcon(arrowLeftIcon);\n\ninterface DrawerViewProps {\n content: ReactNode;\n header: string;\n onDrawerOpen?: () => void;\n onDrawerClose?: () => void;\n}\n\nexport default (props: DrawerViewProps) => {\n const { setDrawerOpen, drawerOpen, refocusEl, focusedImperatively } = useContext(AppShellContext);\n const { content, header, onDrawerOpen, onDrawerClose } = props;\n const theme = useTheme();\n\n const backButtonRef = useRef<HTMLButtonElement>(null);\n const appShellBg = tryCatch(() =>\n lighten(0.1, theme.components['app-shell'].nav['background-color'])\n );\n const appShellTheme = {\n base: {\n palette: {\n 'primary-background': appShellBg,\n 'foreground-color': 'rgba(255, 255, 255, 0.7)',\n interactive: theme.base.colors.blue.light\n },\n shadow: {\n focus: theme.base.shadow['focus-inverted']\n }\n }\n };\n\n const { ltr, rtl } = useDirection();\n const t = useI18n();\n\n return (\n <Configuration theme={appShellTheme}>\n <Drawer\n as={StyledDrawerWrapper}\n position='fixed'\n placement='left'\n open={drawerOpen}\n nullWhenClosed\n onAfterOpen={() => {\n if (backButtonRef.current && document.activeElement !== backButtonRef.current) {\n focusedImperatively.current = true;\n backButtonRef.current.focus();\n }\n onDrawerOpen?.();\n }}\n onAfterClose={() => {\n if (refocusEl && document.activeElement !== refocusEl) {\n focusedImperatively.current = true;\n refocusEl.focus();\n }\n onDrawerClose?.();\n }}\n >\n <Flex as={StyledDrawerHeading} container={{ alignItems: 'center' }}>\n {rtl && <Text>{header}</Text>}\n <BareButton\n as={StyledDrawerBackButton}\n ref={backButtonRef}\n onClick={() => setDrawerOpen(false)}\n aria-label={t('close_noun', [header])}\n >\n <Icon name='arrow-left' />\n </BareButton>\n {ltr && <Text>{header}</Text>}\n </Flex>\n <Flex as={StyledDrawerListContainer} container={{ direction: 'column' }}>\n {content}\n </Flex>\n </Drawer>\n </Configuration>\n );\n};\n"]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { DrawerProps } from '../Drawer';
|
|
2
|
+
export declare const StyledDrawerWrapper: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, DrawerProps, never>;
|
|
3
|
+
export declare const StyledDrawerHeading: import("styled-components").StyledComponent<"header", import("styled-components").DefaultTheme, {}, never>;
|
|
4
|
+
export declare const StyledDrawerBackButton: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, {}, never>;
|
|
5
|
+
export declare const StyledDrawerList: import("styled-components").StyledComponent<"ul", import("styled-components").DefaultTheme, {
|
|
6
|
+
displayPins: boolean;
|
|
7
|
+
}, never>;
|
|
8
|
+
export declare const StyledDrawerMetaList: import("styled-components").StyledComponent<"ul", import("styled-components").DefaultTheme, {}, never>;
|
|
9
|
+
export declare const StyledDrawerPinButton: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, {}, never>;
|
|
10
|
+
export declare const EmptyDrawerVisual: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
11
|
+
export declare const StyledDrawerListHeading: import("styled-components").StyledComponent<"h3", import("styled-components").DefaultTheme, {}, never>;
|
|
12
|
+
export declare const StyledDrawerViewAll: import("styled-components").StyledComponent<"a", import("styled-components").DefaultTheme, {}, never>;
|
|
13
|
+
export declare const StyledDrawerListSection: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
14
|
+
export declare const StyledDrawerListContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
15
|
+
//# sourceMappingURL=Drawer.styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Drawer.styles.d.ts","sourceRoot":"","sources":["../../../src/components/AppShell/Drawer.styles.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAKxC,eAAO,MAAM,mBAAmB,kHAQ9B,CAAC;AAIH,eAAO,MAAM,mBAAmB,4GAqB9B,CAAC;AAIH,eAAO,MAAM,sBAAsB,4GAmBjC,CAAC;AAIH,eAAO,MAAM,gBAAgB;iBAA4B,OAAO;SAE9D,CAAC;AAIH,eAAO,MAAM,oBAAoB,wGAIhC,CAAC;AAEF,eAAO,MAAM,qBAAqB,4GA6BhC,CAAC;AAIH,eAAO,MAAM,iBAAiB,yGAK5B,CAAC;AAIH,eAAO,MAAM,uBAAuB,wGAQlC,CAAC;AAIH,eAAO,MAAM,mBAAmB,uGAgB9B,CAAC;AAIH,eAAO,MAAM,uBAAuB,yGAUlC,CAAC;AAIH,eAAO,MAAM,yBAAyB,yGAOpC,CAAC"}
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import { lighten } from 'polished';
|
|
2
|
+
import styled, { css } from 'styled-components';
|
|
3
|
+
import { useDirection } from '../../hooks';
|
|
4
|
+
import { calculateFontSize } from '../../styles';
|
|
5
|
+
import { defaultThemeProp } from '../../theme';
|
|
6
|
+
import { tryCatch } from '../../utils';
|
|
7
|
+
import { StyledIcon } from '../Icon';
|
|
8
|
+
import { navOpenWidth } from './AppShell.styles';
|
|
9
|
+
export const StyledDrawerWrapper = styled.div(({ theme, open }) => {
|
|
10
|
+
return css `
|
|
11
|
+
background: ${theme.components['app-shell'].nav['background-color']};
|
|
12
|
+
width: ${navOpenWidth};
|
|
13
|
+
height: 100%;
|
|
14
|
+
color: rgba(255, 255, 255, 0.7);
|
|
15
|
+
opacity: ${open ? 1 : 0};
|
|
16
|
+
`;
|
|
17
|
+
});
|
|
18
|
+
StyledDrawerWrapper.defaultProps = defaultThemeProp;
|
|
19
|
+
export const StyledDrawerHeading = styled.header(({ theme }) => {
|
|
20
|
+
const fontSize = calculateFontSize(theme.base['font-size'], theme.base['font-scale']);
|
|
21
|
+
return css `
|
|
22
|
+
padding: ${theme.base.spacing} calc(2 * ${theme.base.spacing});
|
|
23
|
+
line-height: 1;
|
|
24
|
+
|
|
25
|
+
span {
|
|
26
|
+
font-size: ${fontSize.s};
|
|
27
|
+
font-weight: ${theme.base['font-weight']['semi-bold']};
|
|
28
|
+
margin: 0 auto;
|
|
29
|
+
position: relative;
|
|
30
|
+
left: -0.7rem;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
svg {
|
|
34
|
+
font-size: ${fontSize.xxl};
|
|
35
|
+
cursor: pointer;
|
|
36
|
+
color: rgba(255, 255, 255, 0.7);
|
|
37
|
+
}
|
|
38
|
+
`;
|
|
39
|
+
});
|
|
40
|
+
StyledDrawerHeading.defaultProps = defaultThemeProp;
|
|
41
|
+
export const StyledDrawerBackButton = styled.button(({ theme }) => {
|
|
42
|
+
return css `
|
|
43
|
+
height: ${theme.base['hit-area']['mouse-min']};
|
|
44
|
+
width: ${theme.base['hit-area']['mouse-min']};
|
|
45
|
+
border-radius: calc(
|
|
46
|
+
${`${theme.base['border-radius']} * ${theme.components.button['border-radius']}`}
|
|
47
|
+
);
|
|
48
|
+
|
|
49
|
+
&:hover,
|
|
50
|
+
&:focus {
|
|
51
|
+
color: ${theme.base.colors.white};
|
|
52
|
+
background-color: rgba(255, 255, 255, 0.05);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
&:focus {
|
|
56
|
+
outline: none;
|
|
57
|
+
box-shadow: inset ${theme.base.shadow['focus-inverted']};
|
|
58
|
+
}
|
|
59
|
+
`;
|
|
60
|
+
});
|
|
61
|
+
StyledDrawerBackButton.defaultProps = defaultThemeProp;
|
|
62
|
+
export const StyledDrawerList = styled.ul(() => {
|
|
63
|
+
return css ``;
|
|
64
|
+
});
|
|
65
|
+
StyledDrawerList.defaultProps = defaultThemeProp;
|
|
66
|
+
export const StyledDrawerMetaList = styled.ul `
|
|
67
|
+
li {
|
|
68
|
+
color: inherit;
|
|
69
|
+
}
|
|
70
|
+
`;
|
|
71
|
+
export const StyledDrawerPinButton = styled.button(({ theme }) => {
|
|
72
|
+
const fontSize = calculateFontSize(theme.base['font-size'], theme.base['font-scale']);
|
|
73
|
+
const { ltr } = useDirection();
|
|
74
|
+
return css `
|
|
75
|
+
color: inherit;
|
|
76
|
+
padding: calc(2 * ${theme.base.spacing});
|
|
77
|
+
cursor: pointer;
|
|
78
|
+
font-size: ${fontSize.xxl};
|
|
79
|
+
|
|
80
|
+
${StyledIcon} {
|
|
81
|
+
display: block;
|
|
82
|
+
${ltr &&
|
|
83
|
+
css `
|
|
84
|
+
transform: scaleX(-1);
|
|
85
|
+
`}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
&:hover,
|
|
89
|
+
&:focus {
|
|
90
|
+
color: ${theme.base.colors.white};
|
|
91
|
+
background-color: rgba(255, 255, 255, 0.05);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
&:focus {
|
|
95
|
+
outline: none;
|
|
96
|
+
box-shadow: inset ${theme.base.shadow['focus-inverted']};
|
|
97
|
+
}
|
|
98
|
+
`;
|
|
99
|
+
});
|
|
100
|
+
StyledDrawerPinButton.defaultProps = defaultThemeProp;
|
|
101
|
+
export const EmptyDrawerVisual = styled.div(({ theme }) => {
|
|
102
|
+
return css `
|
|
103
|
+
width: calc(4 * ${theme.base.spacing});
|
|
104
|
+
height: calc(4 * ${theme.base.spacing});
|
|
105
|
+
`;
|
|
106
|
+
});
|
|
107
|
+
EmptyDrawerVisual.defaultProps = defaultThemeProp;
|
|
108
|
+
export const StyledDrawerListHeading = styled.h3(({ theme }) => {
|
|
109
|
+
return css `
|
|
110
|
+
position: sticky;
|
|
111
|
+
top: 0;
|
|
112
|
+
padding: ${theme.base.spacing} calc(2 * ${theme.base.spacing});
|
|
113
|
+
background-color: hsl(207 14% 13% / 1);
|
|
114
|
+
z-index: 1;
|
|
115
|
+
`;
|
|
116
|
+
});
|
|
117
|
+
StyledDrawerListHeading.defaultProps = defaultThemeProp;
|
|
118
|
+
export const StyledDrawerViewAll = styled.a(({ theme }) => {
|
|
119
|
+
return css `
|
|
120
|
+
position: sticky;
|
|
121
|
+
bottom: 0;
|
|
122
|
+
padding: ${theme.base.spacing} 0;
|
|
123
|
+
color: inherit;
|
|
124
|
+
background-color: ${theme.components['app-shell'].nav['background-color']};
|
|
125
|
+
text-align: center;
|
|
126
|
+
margin-top: 0.0625rem;
|
|
127
|
+
|
|
128
|
+
&:hover,
|
|
129
|
+
&:focus {
|
|
130
|
+
color: ${theme.base.colors.white};
|
|
131
|
+
box-shadow: unset;
|
|
132
|
+
}
|
|
133
|
+
`;
|
|
134
|
+
});
|
|
135
|
+
StyledDrawerViewAll.defaultProps = defaultThemeProp;
|
|
136
|
+
export const StyledDrawerListSection = styled.div(({ theme }) => {
|
|
137
|
+
const borderColor = tryCatch(() => lighten(0.1, theme.components['app-shell'].nav['background-color']));
|
|
138
|
+
return css `
|
|
139
|
+
border-top: 0.0625rem solid ${borderColor};
|
|
140
|
+
min-height: max(20%, 8rem);
|
|
141
|
+
overflow-y: auto;
|
|
142
|
+
`;
|
|
143
|
+
});
|
|
144
|
+
StyledDrawerListSection.defaultProps = defaultThemeProp;
|
|
145
|
+
export const StyledDrawerListContainer = styled.div(({ theme }) => {
|
|
146
|
+
const fontSize = calculateFontSize(theme.base['font-size'], theme.base['font-scale']);
|
|
147
|
+
return css `
|
|
148
|
+
height: calc(100% - 4 * ${theme.base.spacing} - ${fontSize.xxl});
|
|
149
|
+
overflow: auto;
|
|
150
|
+
`;
|
|
151
|
+
});
|
|
152
|
+
StyledDrawerListContainer.defaultProps = defaultThemeProp;
|
|
153
|
+
//# sourceMappingURL=Drawer.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Drawer.styles.js","sourceRoot":"","sources":["../../../src/components/AppShell/Drawer.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AACnC,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa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AQ,CAAC,GAAG,EAAE,CAChC,OAAO,CAAC,GAAG,EAAE,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC,CACpE,CAAC;IAEF,OAAO,GAAG,CAAA;kCACsB,WAAW;;;GAG1C,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,uBAAuB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAExD,MAAM,CAAC,MAAM,yBAAyB,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IAChE,MAAM,QAAQ,GAAG,iBAAiB,CAAC,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC;IAEtF,OAAO,GAAG,CAAA;8BACkB,KAAK,CAAC,IAAI,CAAC,OAAO,MAAM,QAAQ,CAAC,GAAG;;GAE/D,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,yBAAyB,CAAC,YAAY,GAAG,gBAAgB,CAAC","sourcesContent":["import { lighten } from 'polished';\nimport styled, { css } from 'styled-components';\n\nimport { useDirection } from '../../hooks';\nimport { calculateFontSize } from '../../styles';\nimport { defaultThemeProp } from '../../theme';\nimport { tryCatch } from '../../utils';\nimport { DrawerProps } from '../Drawer';\nimport { StyledIcon } from '../Icon';\n\nimport { navOpenWidth } from './AppShell.styles';\n\nexport const StyledDrawerWrapper = styled.div<DrawerProps>(({ theme, open }) => {\n return css`\n background: ${theme.components['app-shell'].nav['background-color']};\n width: ${navOpenWidth};\n height: 100%;\n color: rgba(255, 255, 255, 0.7);\n opacity: ${open ? 1 : 0};\n `;\n});\n\nStyledDrawerWrapper.defaultProps = defaultThemeProp;\n\nexport const StyledDrawerHeading = styled.header(({ theme }) => {\n const fontSize = calculateFontSize(theme.base['font-size'], theme.base['font-scale']);\n\n return css`\n padding: ${theme.base.spacing} calc(2 * ${theme.base.spacing});\n line-height: 1;\n\n span {\n font-size: ${fontSize.s};\n font-weight: ${theme.base['font-weight']['semi-bold']};\n margin: 0 auto;\n position: relative;\n left: -0.7rem;\n }\n\n svg {\n font-size: ${fontSize.xxl};\n cursor: pointer;\n color: rgba(255, 255, 255, 0.7);\n }\n `;\n});\n\nStyledDrawerHeading.defaultProps = defaultThemeProp;\n\nexport const StyledDrawerBackButton = styled.button(({ theme }) => {\n return css`\n height: ${theme.base['hit-area']['mouse-min']};\n width: ${theme.base['hit-area']['mouse-min']};\n border-radius: calc(\n ${`${theme.base['border-radius']} * ${theme.components.button['border-radius']}`}\n );\n\n &:hover,\n &:focus {\n color: ${theme.base.colors.white};\n background-color: rgba(255, 255, 255, 0.05);\n }\n\n &:focus {\n outline: none;\n box-shadow: inset ${theme.base.shadow['focus-inverted']};\n }\n `;\n});\n\nStyledDrawerBackButton.defaultProps = defaultThemeProp;\n\nexport const StyledDrawerList = styled.ul<{ displayPins: boolean }>(() => {\n return css``;\n});\n\nStyledDrawerList.defaultProps = defaultThemeProp;\n\nexport const StyledDrawerMetaList = styled.ul`\n li {\n color: inherit;\n }\n`;\n\nexport const StyledDrawerPinButton = styled.button(({ theme }) => {\n const fontSize = calculateFontSize(theme.base['font-size'], theme.base['font-scale']);\n const { ltr } = useDirection();\n\n return css`\n color: inherit;\n padding: calc(2 * ${theme.base.spacing});\n cursor: pointer;\n font-size: ${fontSize.xxl};\n\n ${StyledIcon} {\n display: block;\n ${ltr &&\n css`\n transform: scaleX(-1);\n `}\n }\n\n &:hover,\n &:focus {\n color: ${theme.base.colors.white};\n background-color: rgba(255, 255, 255, 0.05);\n }\n\n &:focus {\n outline: none;\n box-shadow: inset ${theme.base.shadow['focus-inverted']};\n }\n `;\n});\n\nStyledDrawerPinButton.defaultProps = defaultThemeProp;\n\nexport const EmptyDrawerVisual = styled.div(({ theme }) => {\n return css`\n width: calc(4 * ${theme.base.spacing});\n height: calc(4 * ${theme.base.spacing});\n `;\n});\n\nEmptyDrawerVisual.defaultProps = defaultThemeProp;\n\nexport const StyledDrawerListHeading = styled.h3(({ theme }) => {\n return css`\n position: sticky;\n top: 0;\n padding: ${theme.base.spacing} calc(2 * ${theme.base.spacing});\n background-color: hsl(207 14% 13% / 1);\n z-index: 1;\n `;\n});\n\nStyledDrawerListHeading.defaultProps = defaultThemeProp;\n\nexport const StyledDrawerViewAll = styled.a(({ theme }) => {\n return css`\n position: sticky;\n bottom: 0;\n padding: ${theme.base.spacing} 0;\n color: inherit;\n background-color: ${theme.components['app-shell'].nav['background-color']};\n text-align: center;\n margin-top: 0.0625rem;\n\n &:hover,\n &:focus {\n color: ${theme.base.colors.white};\n box-shadow: unset;\n }\n `;\n});\n\nStyledDrawerViewAll.defaultProps = defaultThemeProp;\n\nexport const StyledDrawerListSection = styled.div(({ theme }) => {\n const borderColor = tryCatch(() =>\n lighten(0.1, theme.components['app-shell'].nav['background-color'])\n );\n\n return css`\n border-top: 0.0625rem solid ${borderColor};\n min-height: max(20%, 8rem);\n overflow-y: auto;\n `;\n});\n\nStyledDrawerListSection.defaultProps = defaultThemeProp;\n\nexport const StyledDrawerListContainer = styled.div(({ theme }) => {\n const fontSize = calculateFontSize(theme.base['font-size'], theme.base['font-scale']);\n\n return css`\n height: calc(100% - 4 * ${theme.base.spacing} - ${fontSize.xxl});\n overflow: auto;\n `;\n});\n\nStyledDrawerListContainer.defaultProps = defaultThemeProp;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NavigationList.d.ts","sourceRoot":"","sources":["../../../src/components/AppShell/NavigationList.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,EAAE,EAQH,MAAM,OAAO,CAAC;AAsBf,OAAO,EAGL,YAAY,EAEb,MAAM,kBAAkB,CAAC;AAuN1B,QAAA,MAAM,cAAc,EAAE,EAAE,CAAC,YAAY,CA4CpC,CAAC;AAEF,eAAe,cAAc,CAAC"}
|