react-magma-dom 2.5.12 → 2.5.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Accordion/Accordion.stories.d.ts +8 -0
- package/dist/components/Datagrid/Datagrid.stories.d.ts +8 -8
- package/dist/components/Heading/Heading.stories.d.ts +1 -1
- package/dist/components/Table/Table.stories.d.ts +546 -3
- package/dist/components/Tabs/Tabs.stories.d.ts +2 -0
- package/dist/components/Tag/Tag.stories.d.ts +20 -20
- package/dist/esm/index.js +19 -5
- package/dist/esm/index.js.map +1 -1
- package/dist/properties.json +84 -84
- package/dist/react-magma-dom.cjs.development.js +18 -4
- package/dist/react-magma-dom.cjs.development.js.map +1 -1
- package/dist/react-magma-dom.cjs.production.min.js +1 -1
- package/dist/react-magma-dom.cjs.production.min.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react-magma-dom.cjs.production.min.js","sources":["../src/theme/components/transition.ts","../src/theme/magma.ts","../src/theme/ThemeContext.ts","../src/components/StyledButton/styles.ts","../src/utils/index.ts","../src/i18n/default.ts","../src/i18n/index.ts","../src/components/Spinner/index.tsx","../src/components/StyledButton/index.tsx","../src/inverse/index.ts","../src/components/Button/index.tsx","../src/components/IconButton/index.tsx","../src/components/AlertBase/index.tsx","../src/components/ProgressRing/index.tsx","../src/components/Announce/index.tsx","../src/components/Alert/index.tsx","../src/components/AppBar/AppBar.tsx","../src/components/Badge/index.tsx","../src/components/Banner/index.tsx","../src/components/HideAtBreakpoint/index.tsx","../src/components/Breadcrumb/Breadcrumb.tsx","../src/components/Hyperlink/index.tsx","../src/components/Breadcrumb/BreadcrumbItem.tsx","../src/components/BreakpointsContainer/index.tsx","../src/components/Card/Card.tsx","../src/components/Typography/index.tsx","../src/components/Card/CardBody.tsx","../src/components/Heading/index.tsx","../src/components/Card/CardHeading.tsx","../src/components/SelectionControls/InputStyles.tsx","../src/utils/UtilityStyles.tsx","../src/components/InputBase/index.tsx","../src/components/Label/index.tsx","../src/components/Input/InputMessage.tsx","../src/components/Checkbox/index.tsx","../src/components/FormGroup/index.tsx","../src/components/SelectionControls/StyledLabel.tsx","../src/components/SelectionControls/StyledContainer.tsx","../src/components/Container/Container.tsx","../src/hooks/useControlled.ts","../src/hooks/useDataPagination.ts","../src/components/IndeterminateCheckbox/index.tsx","../src/components/VisuallyHidden/index.tsx","../src/components/Table/Table.tsx","../src/components/Table/TableBody.tsx","../src/components/Table/TableCell.tsx","../src/components/Table/TableHeaderCell.tsx","../src/components/Table/TableHead.tsx","../src/components/Pagination/usePagination.ts","../src/hooks/useDescendants.ts","../src/components/Dropdown/Dropdown.tsx","../src/components/Dropdown/DropdownButton.tsx","../src/components/Dropdown/DropdownContent.tsx","../src/components/Dropdown/DropdownDivider.tsx","../src/components/Dropdown/DropdownHeader.tsx","../src/components/Dropdown/DropdownMenuItem.tsx","../src/components/Tooltip/index.tsx","../src/components/Dropdown/DropdownSplitButton.tsx","../src/components/Table/TablePagination.tsx","../src/components/Table/TableRow.tsx","../src/components/Datagrid/components.tsx","../src/components/Datagrid/Datagrid.tsx","../src/components/DatePicker/CalendarContext.ts","../src/components/DatePicker/utils.ts","../src/components/DatePicker/CalendarHeader.tsx","../src/components/DatePicker/CalendarDay.tsx","../src/components/DatePicker/HelperInformation.tsx","../src/hooks/useFocusLock.ts","../src/components/DatePicker/CalendarMonth.tsx","../src/components/FormFieldContainer/FormFieldContainer.tsx","../src/components/Input/index.tsx","../src/components/DatePicker/index.tsx","../src/components/Dropdown/DropdownMenuNavItem.tsx","../src/components/Flex/Flex.tsx","../src/components/List/List.tsx","../src/components/Paragraph/index.tsx","../src/components/Form/index.tsx","../src/components/ProgressBar/index.tsx","../src/components/List/ListItem.tsx","../src/components/LoadingIndicator/index.tsx","../src/components/Select/shared.ts","../src/components/Select/components.tsx","../src/components/Select/SelectTriggerButton.tsx","../src/components/Tabs/shared.ts","../src/components/NativeSelect/NativeSelect.tsx","../src/components/Tabs/TabsContainer.tsx","../src/components/Tabs/TabsScrollButtons.tsx","../src/components/Tabs/utils.ts","../src/components/Tabs/Tabs.tsx","../src/hooks/useForceUpdate.ts","../src/components/Tabs/Tab.tsx","../src/components/Tabs/TabPanel.tsx","../src/components/Tabs/TabPanelsContainer.tsx","../src/components/NavTabs/NavTabs.tsx","../src/components/NavTabs/NavTab.tsx","../src/components/Pagination/PageButton.tsx","../src/components/Pagination/Pagination.tsx","../src/components/Radio/index.tsx","../src/components/PasswordInput/index.tsx","../src/components/RadioGroup/index.tsx","../src/components/Modal/Modal.tsx","../src/components/Transition/Transition.tsx","../src/components/Search/index.tsx","../src/components/Select/ItemsList.tsx","../src/components/Select/index.tsx","../src/components/Select/SelectContainer.tsx","../src/components/Select/Select.tsx","../src/components/Select/MultiSelect.tsx","../src/components/Combobox/ComboboxInput.tsx","../src/components/Combobox/shared.ts","../src/components/Combobox/Combobox.tsx","../src/components/Combobox/MultiCombobox.tsx","../src/components/Spacer/Spacer.tsx","../src/components/Combobox/index.tsx","../src/components/SkipLink/index.tsx","../src/components/Tag/Tag.tsx","../src/components/Toggle/index.tsx","../src/components/Toast/ToastsContainer.tsx","../src/components/Toast/index.tsx","../src/components/Accordion/useAccordion.ts","../src/components/Textarea/index.tsx","../src/components/TimePicker/AmPmToggle.tsx","../src/components/TimePicker/TimePicker.tsx","../src/components/TimePicker/useTimePicker.ts","../src/theme/GlobalStyles/index.tsx","../src/components/Accordion/Accordion.tsx","../src/components/Accordion/useAccordionItem.ts","../src/components/Accordion/AccordionItem.tsx","../src/components/Accordion/useAccordionButton.ts","../src/components/Drawer/Drawer.tsx","../src/components/Accordion/AccordionButton.tsx","../src/components/Accordion/AccordionPanel.tsx","../src/components/Grid/Grid.tsx","../src/components/BlockQuote/BlockQuote.tsx","../src/components/BlockQuote/BlockQuoteItem.tsx","../src/components/Dropdown/DropdownMenuGroup.tsx","../src/components/SkipLinkContent/index.tsx","../src/hooks/useMediaQuery.ts"],"sourcesContent":["import * as React from 'react';\nimport { Variant } from 'framer-motion';\nexport type MotionVariants<T extends string> = Record<T, Variant>;\n\nexport interface ThemeTransitions {\n [key: string]: {\n motion: MotionVariants<'enter' | 'exit'>;\n baseStyle: React.CSSProperties;\n };\n}\n\nexport const transitions: ThemeTransitions = {\n fade: {\n motion: {\n exit: {\n opacity: 0,\n transition: {\n opacity: {\n duration: 0.1,\n ease: 'easeOut',\n },\n },\n },\n enter: {\n opacity: 1,\n transition: {\n duration: 0.2,\n ease: 'easeIn',\n },\n },\n },\n baseStyle: {},\n },\n slideTop: {\n motion: {\n exit: {\n y: '-100%',\n transition: {\n y: {\n duration: 0.15,\n ease: 'easeInOut',\n },\n },\n },\n enter: {\n y: '0',\n transition: {\n y: {\n type: 'spring',\n damping: 25,\n stiffness: 180,\n },\n },\n },\n },\n baseStyle: {\n position: 'fixed',\n top: 0,\n right: 0,\n left: 0,\n },\n },\n slideBottom: {\n motion: {\n exit: {\n y: '100%',\n transition: {\n y: {\n duration: 0.15,\n ease: 'easeInOut',\n },\n },\n },\n enter: {\n y: '0',\n transition: {\n y: {\n type: 'spring',\n damping: 25,\n stiffness: 180,\n },\n },\n },\n },\n baseStyle: {\n position: 'fixed',\n bottom: 0,\n right: 0,\n left: 0,\n },\n },\n slideRight: {\n motion: {\n exit: {\n x: '100%',\n transition: {\n x: {\n duration: 0.15,\n ease: 'easeInOut',\n },\n },\n },\n enter: {\n x: '0',\n transition: {\n x: {\n type: 'spring',\n damping: 25,\n stiffness: 180,\n },\n },\n },\n },\n baseStyle: {\n position: 'fixed',\n top: 0,\n right: 0,\n bottom: 0,\n },\n },\n slideLeft: {\n motion: {\n exit: {\n x: '-100%',\n transition: {\n x: {\n duration: 0.15,\n ease: 'easeInOut',\n },\n },\n },\n enter: {\n x: '0',\n transition: {\n x: {\n type: 'spring',\n damping: 25,\n stiffness: 180,\n },\n },\n },\n },\n baseStyle: {\n position: 'fixed',\n top: 0,\n bottom: 0,\n left: 0,\n },\n },\n nudgeTop: {\n motion: {\n exit: {\n y: '-50px',\n transition: {\n y: {\n duration: 0.15,\n ease: 'easeInOut',\n },\n },\n },\n enter: {\n y: '0',\n transition: {\n y: {\n type: 'spring',\n damping: 25,\n stiffness: 180,\n },\n },\n },\n },\n baseStyle: {},\n },\n nudgeBottom: {\n motion: {\n exit: {\n y: '50px',\n transition: {\n y: {\n duration: 0.15,\n ease: 'easeInOut',\n },\n },\n },\n enter: {\n y: '0',\n transition: {\n y: {\n type: 'spring',\n damping: 25,\n stiffness: 180,\n },\n },\n },\n },\n baseStyle: {},\n },\n nudgeRight: {\n motion: {\n exit: {\n x: '50px',\n transition: {\n x: {\n duration: 0.15,\n ease: 'easeInOut',\n },\n },\n },\n enter: {\n x: '0',\n transition: {\n x: {\n type: 'spring',\n damping: 25,\n stiffness: 180,\n },\n },\n },\n },\n baseStyle: {},\n },\n nudgeLeft: {\n motion: {\n exit: {\n x: '-50px',\n transition: {\n x: {\n duration: 0.15,\n ease: 'easeInOut',\n },\n },\n },\n enter: {\n x: '0',\n transition: {\n x: {\n type: 'spring',\n damping: 25,\n stiffness: 180,\n },\n },\n },\n },\n baseStyle: {},\n },\n scale: {\n motion: {\n exit: {\n scale: 0.95,\n transition: {\n scale: {\n duration: 0.1,\n ease: 'easeOut',\n },\n },\n },\n enter: {\n scale: 1,\n transition: {\n scale: {\n duration: 0.25,\n ease: 'easeInOut',\n },\n },\n },\n },\n baseStyle: {},\n },\n rotate45: {\n motion: {\n exit: {\n rotate: 0,\n transition: {\n rotate: {\n type: 'tween',\n stiffness: 50,\n duration: 0.15,\n },\n },\n },\n enter: {\n rotate: -45,\n transition: {\n rotate: {\n type: 'tween',\n stiffness: 50,\n duration: 0.15,\n },\n },\n },\n },\n baseStyle: {},\n },\n rotate90: {\n motion: {\n exit: {\n rotate: 0,\n transition: {\n rotate: {\n type: 'tween',\n stiffness: 50,\n duration: 0.15,\n },\n },\n },\n enter: {\n rotate: -90,\n transition: {\n rotate: {\n type: 'tween',\n stiffness: 50,\n duration: 0.15,\n },\n },\n },\n },\n baseStyle: {},\n },\n rotate180: {\n motion: {\n exit: {\n rotate: 0,\n transition: {\n rotate: {\n type: 'tween',\n stiffness: 50,\n duration: 0.15,\n },\n },\n },\n enter: {\n rotate: -180,\n transition: {\n rotate: {\n type: 'tween',\n stiffness: 50,\n duration: 0.15,\n },\n },\n },\n },\n baseStyle: {},\n },\n collapse: {\n motion: {\n exit: {\n height: 0,\n transition: {\n height: { duration: 0.2, ease: 'easeInOut' },\n },\n },\n enter: {\n height: 'auto',\n transition: {\n height: { duration: 0.3, ease: 'easeInOut' },\n },\n },\n },\n baseStyle: {\n overflow: 'hidden',\n },\n },\n};\n","import { ThemeTransitions, transitions } from './components/transition';\n\nexport interface Colors {\n primary: string;\n primaryInverse: string;\n focus: string;\n focusInverse: string;\n foundation: string;\n foundation02: string;\n foundation03: string;\n foundation04: string;\n pop: string;\n pop02: string;\n pop03: string;\n pop04: string;\n pop05: string;\n pop06: string;\n success: string;\n success02: string;\n successInverse: string;\n danger: string;\n dangerInverse: string;\n neutral: string;\n neutral02: string;\n neutral03: string;\n neutral04: string;\n neutral05: string;\n neutral06: string;\n neutral07: string;\n neutral08: string;\n disabledText: string;\n disabledInverseText: string;\n toggleBoxShadow: string;\n shade: string;\n shade02: string;\n tint: string;\n tint02: string;\n tint03: string;\n tint04: string;\n tone: string;\n tone02: string;\n border: string;\n borderInverse: string;\n}\n\nexport interface Breakpoints {\n xs: number;\n small: number;\n medium: number;\n large: number;\n xl: number;\n}\n\nexport interface IconSizes {\n xSmall: number;\n small: number;\n medium: number;\n large: number;\n xLarge: number;\n}\n\nexport interface SpacingScale {\n spacing01: string;\n spacing02: string;\n spacing03: string;\n spacing04: string;\n spacing05: string;\n spacing06: string;\n spacing07: string;\n spacing08: string;\n spacing09: string;\n spacing10: string;\n spacing11: string;\n spacing12: string;\n spacing13: string;\n spacing14: string;\n}\n\nexport interface TypographyExpressiveSizes {\n headingXLarge: any;\n headingLarge: any;\n headingMedium: any;\n headingSmall: any;\n headingXSmall: any;\n headingXXSmall: any;\n bodyLarge: any;\n bodyMedium: any;\n bodySmall: any;\n bodyXSmall: any;\n}\n\nexport interface TypeScaleSize {\n fontSize: string;\n letterSpacing?: string;\n lineHeight: string;\n}\n\nexport interface TypeScale {\n size01: TypeScaleSize;\n size02: TypeScaleSize;\n size03: TypeScaleSize;\n size04: TypeScaleSize;\n size05: TypeScaleSize;\n size06: TypeScaleSize;\n size07: TypeScaleSize;\n size08: TypeScaleSize;\n size09: TypeScaleSize;\n size10: TypeScaleSize;\n size11: TypeScaleSize;\n size12: TypeScaleSize;\n size13: TypeScaleSize;\n}\n\nexport interface VisualStyle {\n mobile: TypeScaleSize;\n desktop: TypeScaleSize;\n fontWeight?: number;\n}\n\nexport interface TypographyVisualStyles {\n headingXLarge: VisualStyle;\n headingLarge: VisualStyle;\n headingMedium: VisualStyle;\n headingSmall: VisualStyle;\n headingXSmall: VisualStyle;\n heading2XSmall: VisualStyle;\n bodyLarge: VisualStyle;\n bodyMedium: VisualStyle;\n bodySmall: VisualStyle;\n bodyXSmall: VisualStyle;\n}\n\ninterface AppBar {\n backgroundColor: string;\n height: string;\n padding: string;\n textColor: string;\n compact: {\n height: string;\n padding: string;\n };\n inverse: {\n backgroundColor: string;\n textColor: string;\n };\n}\nexport interface Modal {\n width: {\n small: string;\n medium: string;\n large: string;\n };\n}\n\ninterface Drawer {\n default: {\n maxWidth: string;\n minHeight: string;\n borderRadius: string;\n margin: string;\n top: string;\n bottom: string;\n left: string;\n right: string;\n position: string;\n };\n right: {\n left: string;\n height: string;\n width: string;\n };\n left: {\n right: string;\n height: string;\n width: string;\n };\n top: {\n bottom: string;\n height: string;\n };\n bottom: {\n top: string;\n height: string;\n };\n}\n\ninterface Combobox {\n menu: {\n maxHeight: string;\n };\n}\n\ninterface Dropdown {\n content: {\n maxHeight: string;\n };\n}\n\ninterface Dropdown {\n content: {\n maxHeight: string;\n };\n}\n\ninterface Select {\n menu: {\n maxHeight: string;\n };\n}\n\ninterface Tabs {\n approxTabSize: {\n horizontal: number;\n vertical: number;\n };\n}\n\nexport interface Tooltip {\n arrowSize: string;\n arrowSizeDoubled: string;\n backgroundColor: string;\n fontWeight: number | string;\n maxWidth: string;\n textColor: string;\n typeScale: TypeScaleSize;\n zIndex: number;\n inverse: any;\n}\n\nexport interface ThemeInterface {\n appBar: AppBar;\n breakpoints: Breakpoints;\n bodyFont: string;\n bodyExpressiveFont: string;\n bodyNarrativeFont: string;\n borderRadius: string;\n colors: Colors;\n combobox: Combobox;\n direction: string;\n drawer: Drawer;\n dropdown: Dropdown;\n headingFont: string;\n iconSizes: IconSizes;\n iterableColors: string[];\n spacingMultiplier: number;\n spaceScale: SpacingScale;\n headingExpressiveFont: string;\n headingNarrativeFont: string;\n select: Select;\n typeScale: TypeScale;\n typographyVisualStyles: TypographyVisualStyles;\n typographyExpressiveVisualStyles: TypographyVisualStyles;\n typographyNarrativeVisualStyles: TypographyVisualStyles;\n modal: Modal;\n tabs: Tabs;\n tooltip: Tooltip;\n transitions: ThemeTransitions;\n}\n\nconst typeScale = {\n size01: {\n fontSize: '12px',\n letterSpacing: '.32px',\n lineHeight: '16px',\n },\n size02: {\n fontSize: '14px',\n letterSpacing: '.16px',\n lineHeight: '20px',\n },\n size03: {\n fontSize: '16px',\n lineHeight: '24px',\n },\n size04: {\n fontSize: '18px',\n lineHeight: '24px',\n },\n size05: {\n fontSize: '20px',\n lineHeight: '32px',\n },\n size06: {\n fontSize: '24px',\n lineHeight: '32px',\n },\n size07: {\n fontSize: '28px',\n lineHeight: '40px',\n },\n size08: {\n fontSize: '32px',\n lineHeight: '40px',\n },\n size09: {\n fontSize: '36px',\n lineHeight: '48px',\n },\n size10: {\n fontSize: '42px',\n lineHeight: '48px',\n },\n size11: {\n fontSize: '48px',\n lineHeight: '56px',\n },\n size12: {\n fontSize: '54px',\n lineHeight: '64px',\n },\n size13: {\n fontSize: '60px',\n lineHeight: '72px',\n },\n};\n\nconst colors = {\n primary: '#006298', // link color blue\n primaryInverse: '#70CDFF', // link color inverse blue\n focus: '#027EE1',\n focusInverse: 'rgba(255,255,255,0.7)',\n foundation: '#00263E',\n foundation02: '#003865',\n foundation03: '#00A9E0',\n foundation04: '#71C5E8',\n pop: '#E0004D',\n pop02: '#FC4C02',\n pop03: '#F2A900',\n pop04: '#FFC72C',\n pop05: '#92278F',\n pop06: '#007A6D',\n success: '#3A8200',\n success02: '#48A200',\n successInverse: '#91CF60',\n danger: '#C61D23',\n dangerInverse: '#F59295',\n neutral: '#3F3F3F', // main dark grey text color\n neutral02: '#575757',\n neutral03: '#707070',\n neutral04: '#8f8f8f', // lightest gray that meets 3:1 contrast ratio\n neutral05: '#BFBFBF',\n neutral06: '#DFDFDF',\n neutral07: '#F7F7F7',\n neutral08: '#FFFFFF', // white\n disabledText: 'rgba(114,114,114,0.6)',\n disabledInverseText: 'rgba(255,255,255,0.25)',\n toggleBoxShadow:\n '0 2px 2px -1px rgba(0, 0, 0, 0.3), 0 0 4px 0 rgba(0, 0, 0, 0.24),0 0 5px 0 rgba(0, 0, 0, 0.22)',\n shade: 'rgba(0,0,0,0.05)',\n shade02: 'rgba(0,0,0,0.3)',\n tint: 'rgba(255,255,255,0.05)',\n tint02: 'rgba(255,255,255,0.1)',\n tint03: 'rgba(255,255,255,0.1)',\n tint04: 'rgba(255,255,255,0.4)',\n tone: 'rgba(63,63,63,0.07)',\n tone02: 'rgba(63,63,63,0.1)',\n border: '#DFDFDF',\n borderInverse: 'rgba(255,255,255,0.25)',\n};\n\nconst spaceScale = {\n spacing01: '2px',\n spacing02: '4px',\n spacing03: '8px',\n spacing04: '12px',\n spacing05: '16px',\n spacing06: '24px',\n spacing07: '28px',\n spacing08: '32px',\n spacing09: '40px',\n spacing10: '48px',\n spacing11: '56px',\n spacing12: '64px',\n spacing13: '96px',\n spacing14: '160px',\n};\n\nexport const magma = {\n bodyFont: '\"Open Sans\",Helvetica,sans-serif',\n bodyExpressiveFont: '\"Open Sans\",Helvetica,sans-serif',\n bodyNarrativeFont: \"'Noto Serif',Times New Roman,serif\",\n borderRadius: '4px',\n colors: colors,\n headingFont: '\"Open Sans\",Helvetica,sans-serif',\n headingExpressiveFont: '\"Open Sans\",Helvetica,sans-serif',\n headingNarrativeFont: \"'Noto Serif',Times New Roman,serif\",\n direction: 'ltr',\n spacingMultiplier: 8,\n transitions,\n // breakpoints\n breakpoints: {\n xs: 0,\n small: 600,\n medium: 768,\n large: 1024,\n xl: 1200,\n },\n\n spaceScale: spaceScale,\n\n iconSizes: {\n xSmall: 16,\n small: 20,\n medium: 24,\n large: 32,\n xLarge: 54,\n },\n\n // Typography\n typeScale: typeScale,\n typographyVisualStyles: {\n headingXLarge: {\n mobile: typeScale.size07,\n desktop: typeScale.size09,\n fontWeight: 600,\n },\n headingLarge: {\n mobile: typeScale.size06,\n desktop: typeScale.size07,\n fontWeight: 600,\n },\n headingMedium: {\n mobile: typeScale.size05,\n desktop: typeScale.size06,\n fontWeight: 600,\n },\n headingSmall: {\n mobile: typeScale.size04,\n desktop: typeScale.size05,\n fontWeight: 600,\n },\n headingXSmall: {\n mobile: typeScale.size04,\n desktop: typeScale.size04,\n fontWeight: 600,\n },\n heading2XSmall: {\n mobile: typeScale.size01,\n desktop: typeScale.size01,\n fontWeight: 700,\n },\n bodyLarge: {\n mobile: typeScale.size04,\n desktop: typeScale.size05,\n },\n bodyMedium: {\n mobile: typeScale.size03,\n desktop: typeScale.size03,\n },\n bodySmall: {\n mobile: typeScale.size02,\n desktop: typeScale.size02,\n },\n bodyXSmall: {\n mobile: typeScale.size01,\n desktop: typeScale.size01,\n },\n },\n typographyExpressiveVisualStyles: {\n headingXLarge: {\n mobile: typeScale.size08,\n desktop: typeScale.size11,\n fontWeight: 600,\n },\n headingLarge: {\n mobile: typeScale.size07,\n desktop: typeScale.size09,\n fontWeight: 300,\n },\n headingMedium: {\n mobile: typeScale.size06,\n desktop: typeScale.size07,\n fontWeight: 300,\n },\n headingSmall: {\n mobile: typeScale.size05,\n desktop: typeScale.size06,\n fontWeight: 300,\n },\n headingXSmall: {\n mobile: typeScale.size04,\n desktop: typeScale.size05,\n fontWeight: 300,\n },\n heading2XSmall: {\n mobile: typeScale.size03,\n desktop: typeScale.size03,\n fontWeight: 700,\n },\n bodyLarge: {\n mobile: typeScale.size05,\n desktop: typeScale.size06,\n },\n bodyMedium: {\n mobile: typeScale.size03,\n desktop: typeScale.size03,\n },\n bodySmall: {\n mobile: typeScale.size02,\n desktop: typeScale.size02,\n },\n bodyXSmall: {\n mobile: typeScale.size01,\n desktop: typeScale.size01,\n },\n },\n typographyNarrativeVisualStyles: {\n headingXLarge: {\n mobile: typeScale.size07,\n desktop: typeScale.size08,\n fontWeight: 700,\n },\n headingLarge: {\n mobile: typeScale.size06,\n desktop: typeScale.size07,\n fontWeight: 700,\n },\n headingMedium: {\n mobile: typeScale.size05,\n desktop: typeScale.size06,\n fontWeight: 700,\n },\n headingSmall: {\n mobile: typeScale.size04,\n desktop: typeScale.size05,\n fontWeight: 700,\n },\n headingXSmall: {\n mobile: typeScale.size04,\n desktop: typeScale.size04,\n fontWeight: 700,\n },\n heading2XSmall: {\n mobile: typeScale.size01,\n desktop: typeScale.size01,\n fontWeight: 700,\n },\n bodyLarge: {\n mobile: typeScale.size04,\n desktop: typeScale.size05,\n },\n bodyMedium: {\n mobile: typeScale.size03,\n desktop: typeScale.size03,\n },\n bodySmall: {\n mobile: typeScale.size02,\n desktop: typeScale.size02,\n },\n bodyXSmall: {\n mobile: typeScale.size01,\n desktop: typeScale.size01,\n },\n },\n\n appBar: {\n backgroundColor: colors.neutral08,\n height: '88px',\n padding: `${spaceScale.spacing06} ${spaceScale.spacing05}`,\n textColor: colors.neutral,\n compact: {\n height: '56px',\n padding: `${spaceScale.spacing05} ${spaceScale.spacing05} ${spaceScale.spacing05} ${spaceScale.spacing06}`,\n },\n inverse: {\n backgroundColor: colors.foundation02,\n textColor: colors.neutral08,\n },\n },\n\n combobox: {\n menu: {\n maxHeight: '250px',\n },\n },\n\n modal: {\n width: {\n small: '300px',\n medium: '600px',\n large: '900px',\n },\n },\n\n drawer: {\n default: {\n maxWidth: '100%',\n minHeight: '300px',\n margin: '0',\n borderRadius: '0',\n top: '0',\n right: '0',\n bottom: '0',\n left: '0',\n position: 'relative',\n },\n right: {\n left: 'auto',\n height: '100%',\n width: '300px',\n position: 'fixed',\n },\n left: {\n right: 'auto',\n height: '100%',\n width: '300px',\n },\n top: {\n bottom: 'auto',\n height: '300px',\n },\n bottom: {\n top: 'auto',\n height: '300px',\n position: 'fixed',\n },\n },\n\n dropdown: {\n content: {\n maxHeight: '250px',\n },\n },\n\n iterableColors: [\n '#0085CC',\n '#E0004D',\n '#FA6600',\n '#48A200',\n '#B12FAD',\n '#00A393',\n '#00507A',\n '#8F0033',\n '#B84900',\n '#255200',\n '#711E6E',\n '#005249',\n ],\n\n tabs: {\n approxTabSize: {\n horizontal: 120,\n vertical: 80,\n },\n },\n\n select: {\n menu: {\n maxHeight: '250px',\n },\n },\n\n tag: {\n border: '0',\n display: 'inline-flex',\n alignItems: 'center',\n justifyContent: 'space-around',\n },\n\n tooltip: {\n arrowSize: '4px',\n arrowSizeDoubled: '8px',\n backgroundColor: colors.neutral,\n fontWeight: 600,\n maxWidth: '300px',\n textColor: colors.neutral08,\n typeScale: typeScale.size01,\n zIndex: 999,\n inverse: {\n backgroundColor: colors.neutral08,\n textColor: colors.neutral,\n },\n },\n};\n","import * as React from 'react';\nimport { magma } from './magma';\n\nexport const ThemeContext = React.createContext(\n magma // default value\n);\n","import { darken, lighten, tint } from 'polished';\n\nconst DEFAULT_STYLE_PROPS = {\n color: 'primary',\n shape: 'fill',\n size: 'medium',\n textTransform: 'uppercase',\n variant: 'solid',\n};\n\nexport function buildPropsWithDefaultButtonStyles(props) {\n return { ...DEFAULT_STYLE_PROPS, ...props };\n}\n\nexport function buildButtonBorderRadius(props) {\n switch (props.shape) {\n case 'round':\n return '100%';\n case 'leftCap':\n return `${props.theme.borderRadius} 0 0 ${props.theme.borderRadius}`;\n case 'rightCap':\n return `0 ${props.theme.borderRadius} ${props.theme.borderRadius} 0`;\n default:\n //fill\n return props.theme.borderRadius;\n }\n}\n\nexport function buildButtonFontSize(props) {\n switch (props.size) {\n case 'small':\n return props.theme.typeScale.size01.fontSize;\n case 'large':\n return props.theme.typeScale.size04.fontSize;\n default:\n //medium\n return props.theme.typeScale.size03.fontSize;\n }\n}\n\nexport function buildButtonLineHeight(props) {\n switch (props.size) {\n case 'small':\n return props.theme.typeScale.size01.lineHeight;\n case 'large':\n return props.theme.typeScale.size04.lineHeight;\n default:\n //medium\n return props.theme.typeScale.size03.lineHeight;\n }\n}\n\nexport function buildButtonSize(props) {\n switch (props.size) {\n case 'small':\n return props.theme.spaceScale.spacing07;\n case 'large':\n return props.theme.spaceScale.spacing11;\n default:\n //medium\n return props.theme.spaceScale.spacing09;\n }\n}\n\nexport function buildButtonPadding(props) {\n switch (props.size) {\n case 'small':\n return `${props.theme.spaceScale.spacing02} ${props.theme.spaceScale.spacing03}`;\n case 'large':\n return `${props.theme.spaceScale.spacing04} ${props.theme.spaceScale.spacing06}`;\n default:\n //medium\n return `${props.theme.spaceScale.spacing04} ${props.theme.spaceScale.spacing05}`;\n }\n}\n\nexport function buildButtonBackground(props) {\n props = buildPropsWithDefaultButtonStyles(props);\n\n if (props.variant !== 'solid' && props.color !== 'marketing') {\n return 'rgba(0,0,0,0)';\n }\n if (props.disabled) {\n return props.theme.colors.neutral06;\n }\n if (props.color === 'marketing') {\n return props.theme.colors.pop04;\n }\n if (props.isInverse) {\n return props.theme.colors.neutral08;\n }\n switch (props.color) {\n case 'secondary':\n return props.theme.colors.neutral08;\n case 'success':\n return props.theme.colors.success;\n case 'danger':\n return props.theme.colors.danger;\n default:\n return props.theme.colors.primary;\n }\n}\n\nexport function buildBorderColor(props) {\n props = buildPropsWithDefaultButtonStyles(props);\n\n if (props.disabled && props.isInverse && props.variant === 'outline') {\n return props.theme.colors.disabledInverseText;\n }\n if (props.disabled) {\n return props.theme.colors.neutral06;\n }\n if (props.color === 'marketing') {\n return props.theme.colors.pop04;\n }\n if (props.isInverse) {\n return props.theme.colors.neutral08;\n }\n if (props.color === 'secondary') {\n return props.theme.colors.neutral05;\n }\n if (props.variant === 'solid') {\n switch (props.color) {\n case 'success':\n return props.theme.colors.success;\n case 'danger':\n return props.theme.colors.danger;\n default:\n return props.theme.colors.primary;\n }\n }\n}\n\nexport function buildColor(props) {\n props = buildPropsWithDefaultButtonStyles(props);\n\n if (props.disabled && props.isInverse && props.variant !== 'solid') {\n return props.theme.colors.disabledInverseText;\n }\n if (props.disabled) {\n return props.theme.colors.disabledText;\n }\n if (props.color === 'marketing') {\n return props.theme.colors.foundation02;\n }\n if (\n (!props.isInverse && props.variant === 'solid') ||\n (props.isInverse && props.variant !== 'solid')\n ) {\n if (props.color === 'secondary' && !props.isInverse) {\n return props.theme.colors.neutral;\n }\n return props.theme.colors.neutral08;\n }\n switch (props.color) {\n case 'secondary':\n return props.theme.colors.neutral;\n case 'success':\n return props.theme.colors.success;\n case 'danger':\n return props.theme.colors.danger;\n default:\n return props.theme.colors.primary;\n }\n}\n\nexport function buildFocusBackground(props) {\n props = buildPropsWithDefaultButtonStyles(props);\n\n if (props.color === 'marketing') {\n return lighten(0.1, props.theme.colors.pop04);\n }\n if (\n (props.variant !== 'solid' && !props.isInverse) ||\n (props.variant === 'solid' && props.isInverse)\n ) {\n switch (props.color) {\n case 'secondary':\n return tint(0.9, props.theme.colors.neutral);\n case 'success':\n return tint(0.9, props.theme.colors.success);\n case 'danger':\n return tint(0.9, props.theme.colors.danger);\n default:\n return tint(0.9, props.theme.colors.primary);\n }\n }\n if (props.variant !== 'solid' && props.isInverse) {\n return 'rgba(0, 0, 0, 0.3)';\n }\n switch (props.color) {\n case 'secondary':\n return darken(0.1, props.theme.colors.neutral08);\n case 'success':\n return darken(0.1, props.theme.colors.success);\n case 'danger':\n return darken(0.1, props.theme.colors.danger);\n default:\n return darken(0.1, props.theme.colors.primary);\n }\n}\n\nexport function buildFocusColor(props) {\n props = buildPropsWithDefaultButtonStyles(props);\n if (props.color === 'marketing') {\n return props.theme.colors.foundation02;\n }\n if (\n (props.variant !== 'solid' && !props.isInverse) ||\n (props.variant === 'solid' && props.isInverse)\n ) {\n switch (props.color) {\n case 'secondary':\n return props.theme.colors.neutral;\n case 'success':\n return darken(0.1, props.theme.colors.success);\n case 'danger':\n return darken(0.1, props.theme.colors.danger);\n default:\n return darken(0.1, props.theme.colors.primary);\n }\n }\n if (props.variant !== 'solid' && props.isInverse) {\n return props.theme.colors.neutral08;\n }\n if (props.color === 'secondary' && !props.isInverse) {\n return props.theme.colors.neutral;\n }\n return props.theme.colors.neutral08;\n}\n\nexport function buildAfterBackground(props) {\n props = buildPropsWithDefaultButtonStyles(props);\n\n if (\n (props.variant !== 'solid' && !props.isInverse) ||\n (props.variant === 'solid' && props.isInverse)\n ) {\n switch (props.color) {\n case 'secondary':\n return props.theme.colors.neutral;\n case 'success':\n return props.theme.colors.success;\n case 'danger':\n return props.theme.colors.danger;\n default:\n return props.theme.colors.primary;\n }\n }\n if (\n props.variant === 'solid' &&\n !props.isInverse &&\n props.color === 'secondary'\n ) {\n return props.theme.colors.neutral;\n }\n return props.theme.colors.neutral08;\n}\n\nexport function buildActiveBackground(props) {\n props = buildPropsWithDefaultButtonStyles(props);\n\n if (props.color === 'marketing') {\n return lighten(0.2, props.theme.colors.pop04);\n }\n if (\n (props.variant !== 'solid' && !props.isInverse) ||\n (props.variant === 'solid' && props.isInverse)\n ) {\n switch (props.color) {\n case 'secondary':\n return tint(0.7, props.theme.colors.neutral);\n case 'success':\n return tint(0.7, props.theme.colors.success);\n case 'danger':\n return tint(0.7, props.theme.colors.danger);\n default:\n return tint(0.7, props.theme.colors.primary);\n }\n }\n if (props.variant !== 'solid' && props.isInverse) {\n return 'rgba(0, 0, 0, 0.5);';\n }\n switch (props.color) {\n case 'secondary':\n return darken(0.2, props.theme.colors.neutral08);\n case 'success':\n return darken(0.2, props.theme.colors.success);\n case 'danger':\n return darken(0.2, props.theme.colors.danger);\n default:\n return darken(0.2, props.theme.colors.primary);\n }\n}\n\nexport function buildActiveColor(props) {\n props = buildPropsWithDefaultButtonStyles(props);\n\n if (props.color === 'marketing') {\n return props.theme.colors.foundation02;\n }\n if (\n (props.variant !== 'solid' && !props.isInverse) ||\n (props.variant === 'solid' && props.isInverse)\n ) {\n switch (props.color) {\n case 'secondary':\n return props.theme.colors.neutral;\n case 'success':\n return darken(0.2, props.theme.colors.success);\n case 'danger':\n return darken(0.2, props.theme.colors.danger);\n default:\n return darken(0.2, props.theme.colors.primary);\n }\n }\n if (props.variant !== 'solid' && props.isInverse) {\n return props.theme.colors.neutral08;\n }\n if (props.color === 'secondary' && !props.isInverse) {\n return props.theme.colors.neutral;\n }\n return props.theme.colors.neutral08;\n}\n","import React from 'react';\nimport { v4 as uuidv4 } from 'uuid';\n\nexport function generateId(id?: string) {\n return id ? id : uuidv4();\n}\n\nexport function useGenerateId(newId?: string) {\n const [id, updateId] = React.useState<string>(newId);\n\n React.useEffect(() => {\n updateId(generateId(newId));\n }, []);\n\n React.useEffect(() => {\n newId && updateId(generateId(newId));\n }, [newId]);\n\n return id;\n}\n\nexport function omit(props, obj) {\n return props.reduce(\n (newObj, val) => (({ [val]: dropped, ...rest }) => rest)(newObj),\n obj\n );\n}\n\nexport type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;\n\ntype Without<T, U> = { [P in Exclude<keyof T, keyof U>]?: never };\n\nexport type XOR<T, U> = T | U extends object\n ? (Without<T, U> & U) | (Without<U, T> & T)\n : T | U;\n\nexport function usePrevious(value) {\n const ref = React.useRef();\n React.useEffect(() => {\n ref.current = value;\n });\n return ref.current;\n}\n\nexport function debounce(func, wait) {\n let timeout;\n function debounced(...args) {\n // tslint:disable-next-line\n const context = this;\n if (timeout) clearTimeout(timeout);\n timeout = setTimeout(() => {\n timeout = null;\n func.apply(context, args);\n }, wait);\n }\n\n debounced.clear = () => {\n clearTimeout(timeout);\n };\n\n return debounced;\n}\n\n// Based on https://stackoverflow.com/a/24394376\nlet cachedType;\n\nexport function detectScrollType() {\n if (cachedType) {\n return cachedType;\n }\n\n const dummy = document.createElement('div');\n dummy.appendChild(document.createTextNode('ABCD'));\n dummy.dir = 'rtl';\n dummy.style.fontSize = '14px';\n dummy.style.width = '4px';\n dummy.style.height = '1px';\n dummy.style.position = 'absolute';\n dummy.style.top = '-1000px';\n dummy.style.overflow = 'scroll';\n\n document.body.appendChild(dummy);\n\n cachedType = 'reverse';\n\n if (dummy.scrollLeft > 0) {\n cachedType = 'default';\n } else {\n dummy.scrollLeft = 1;\n if (dummy.scrollLeft === 0) {\n cachedType = 'negative';\n }\n }\n}\n\nexport function getNormalizedScrollLeft(element, direction) {\n const scrollLeft = element.scrollLeft;\n\n // Perform the calculations only when direction is rtl to avoid messing up the ltr bahavior\n if (direction !== 'rtl') {\n return scrollLeft;\n }\n\n const type = detectScrollType();\n\n switch (type) {\n case 'negative':\n return (\n Number(element.scrollWidth) -\n Number(element.clientWidth) +\n Number(scrollLeft)\n );\n case 'reverse':\n return (\n Number(element.scrollWidth) -\n Number(element.clientWidth) -\n Number(scrollLeft)\n );\n default:\n return scrollLeft;\n }\n}\n\nfunction easeInOutSin(time) {\n return (1 + Math.sin(Math.PI * time - Math.PI / 2)) / 2;\n}\n\nexport function animate(property, element, to, options: any = {}) {\n const { ease = easeInOutSin, duration = 300 } = options;\n\n let start = null;\n const from = Number(element[property]);\n let cancelled = false;\n\n const cancel = () => {\n cancelled = true;\n };\n\n const step = timestamp => {\n if (cancelled) {\n return;\n }\n\n if (start === null) {\n start = timestamp;\n }\n const time = Math.min(1, (timestamp - start) / duration);\n\n element[property] = ease(time) * (to - from) + from;\n\n if (time >= 1) {\n requestAnimationFrame(() => {});\n return;\n }\n\n requestAnimationFrame(step);\n };\n\n if (from === to) {\n return cancel;\n }\n\n requestAnimationFrame(step);\n return cancel;\n}\n\nexport function assignRef(ref, value) {\n if (ref === null) return;\n if (typeof ref === 'function') {\n ref(value);\n } else {\n try {\n ref.current = value;\n } catch (error) {\n throw new Error(`Cannot assign value \"${value}\" to ref \"${ref}\"`);\n }\n }\n}\n\nexport function useForkedRef(...refs) {\n return React.useMemo(() => {\n if (refs.every(ref => ref === null)) {\n return null;\n }\n return (node: any) => {\n refs.forEach(ref => {\n assignRef(ref, node);\n });\n };\n }, [...refs]);\n}\n\nexport function stringIncludesUnit(x) {\n return x.includes('px') || x.includes('em') || x.includes('%');\n}\n\nexport function convertStyleValueToString(\n value: string | number,\n defaultValue?: string\n): string {\n return value\n ? typeof value === 'number' ||\n (typeof value === 'string' && !stringIncludesUnit(value))\n ? `${value}px`\n : value\n : defaultValue || 'initial';\n}\n\nexport function getNodeText(node) {\n if (['string', 'number'].includes(typeof node)) return node;\n if (node instanceof Array) return node.map(getNodeText).join('');\n if (typeof node === 'object' && node) return getNodeText(node.props.children);\n}\n\nconst candidateSelectors = [\n 'input',\n 'select',\n 'textarea',\n 'a[href]',\n 'button',\n '[tabindex]:not([tabindex=\"-1\"])',\n 'audio[controls]',\n 'video[controls]',\n '[contenteditable]:not([contenteditable=\"false\"])',\n].join(',');\n\nexport function getTrapElements(container): Array<HTMLElement> {\n return Array.from(container.current.querySelectorAll(candidateSelectors));\n}\n\nexport function toCamelCase(str) {\n return str\n .toLowerCase()\n .replace(/[^a-z 0-9]/gi, '')\n .replace(/(?:^\\w|[A-Z]|\\b\\w)/g, (ltr, index) =>\n index === 0 ? ltr.toLowerCase() : ltr.toUpperCase()\n )\n .replace(/\\s+/g, '');\n}\n","import { I18nInterface } from './interface';\n\nexport const defaultI18n: I18nInterface = {\n locale: null,\n dateFormat: 'MM/dd/yyyy',\n timeFormat: '12',\n example:\n 'i18n defaults must be set in packages/react-magma-dom/src/i18n/default.ts',\n months: {\n long: {\n january: 'January',\n february: 'February',\n march: 'March',\n april: 'April',\n may: 'May',\n june: 'June',\n july: 'July',\n august: 'August',\n september: 'September',\n october: 'October',\n november: 'November',\n december: 'December',\n },\n short: {\n january: 'Jan',\n february: 'Feb',\n march: 'Mar',\n april: 'Apr',\n may: 'May',\n june: 'Jun',\n july: 'Jul',\n august: 'Aug',\n september: 'Sep',\n october: 'Oct',\n november: 'Nov',\n december: 'Dec',\n },\n },\n days: {\n long: {\n monday: 'Monday',\n tuesday: 'Tuesday',\n wednesday: 'Wednesday',\n thursday: 'Thursday',\n friday: 'Friday',\n saturday: 'Saturday',\n sunday: 'Sunday',\n },\n short: {\n monday: 'Mon',\n tuesday: 'Tues',\n wednesday: 'Wed',\n thursday: 'Thur',\n friday: 'Fri',\n saturday: 'Sat',\n sunday: 'Sun',\n },\n min: {\n monday: 'M',\n tuesday: 'T',\n wednesday: 'W',\n thursday: 'T',\n friday: 'F',\n saturday: 'S',\n sunday: 'S',\n },\n },\n emptyItemsListText: 'No Options',\n alert: {\n dismissAriaLabel: 'Close this message',\n },\n breadcrumb: {\n navAriaLabel: 'Breadcrumb',\n },\n charts: {\n line: {\n chartTabLabel: 'Chart',\n dataLegendsLabel:\n 'Select one or more of the categories below to filter out the ones you don’t want to see.',\n dataTabLabel: 'Data',\n keyboardInstructions:\n 'In the chart below, use your up and down arrows to move between each line. Use your left and right arrows to move between points on a line.',\n keyboardInstructionsHeader: 'Keyboard Instructions',\n keyboardInstructionsTooltip: 'Keyboard Instructions',\n legendButtonAriaLabel: 'Toggle data for {name}',\n },\n },\n combobox: {\n clearIndicatorAriaLabel:\n 'reset selection for {labelText}. {selectedItem} is selected',\n createLabel: 'Create \"{inputValue}\"',\n },\n datePicker: {\n startOfWeek: 'sunday',\n calendarIconAriaLabel: 'Toggle Calendar Widget',\n calendarOpenAnnounce:\n 'Calendar Widget is now open. Press the question mark key to get the keyboard shortcuts for changing dates.',\n calendarCloseAriaLabel: 'Close Calendar Widget',\n previousMonthAriaLabel: 'Previous Month',\n nextMonthAriaLabel: 'Next Month',\n disabledDayAriaLabel: 'Not Available. ',\n selectedDayAriaLabel: '(Selected)',\n todayAriaLabel: '(Today)',\n helpModal: {\n header: 'Keyboard Shortcuts',\n helpButtonAriaLabel: 'Calendar Widget Help',\n enter: {\n ariaLabel: 'Enter key',\n explanation: 'Select the date in focus.',\n },\n rightAndLeftArrowKeys: {\n ariaLabel: 'Right and left arrow keys',\n explanation: 'Move backward (left) and forward (right) by one day.',\n },\n upAndDownArrowKeys: {\n ariaLabel: 'up and down arrow keys',\n explanation: 'Move backward (up) and forward (down) by one week.',\n },\n pageUpAndPageDownKeys: {\n ariaLabel: 'page up and page down keys',\n displayValue: 'PGUP/PGDN',\n explanation: 'Switch months.',\n },\n homeAndEndKeys: {\n ariaLabel: 'Home and end keys',\n displayValue: 'HOME/END',\n explanation: 'Go to the first or last day of a week.',\n },\n escape: {\n ariaLabel: 'Escape key',\n displayValue: 'ESC',\n explanation: 'Return to the date input field.',\n },\n questionMark: {\n ariaLabel: 'Question Mark',\n explanation: 'Open this panel.',\n },\n },\n },\n dropdown: {\n menuItemSelectedAriaLabel: '(selected)',\n toggleMenuAriaLabel: 'Toggle menu',\n },\n dropzone: {\n browseFiles: 'Browse Files',\n dragMessage: 'Drag and drop or browse files to upload.',\n errors: {\n 'too-many-errors': {\n message: 'Files must not have any errors.',\n },\n 'too-many-files': {\n message: 'You must upload a maximum of',\n },\n 'too-few-files': {\n message: 'You must upload a minimum of',\n },\n 'file-invalid-type': {\n header: 'Invalid File Type',\n message: 'Upload only the allowed file types',\n },\n 'file-too-large': {\n header: 'File exceeds size limit',\n message: 'Upload only files with a maximum size of',\n },\n 'file-too-small': {\n header: 'File size is below the limit',\n message: 'Upload only files with a minimum size of',\n },\n required: {\n message: 'You must upload at least one file.',\n },\n },\n files: 'files',\n bytes: 'Bytes',\n deleteFile: 'Delete file',\n removeFile: 'Remove file',\n },\n header: {\n navigationButtonLabel: 'Open navigation menu',\n search: {\n input: {\n ariaLabel: 'Search',\n placeholder: 'Search',\n },\n iconAriaLabel: 'Search',\n },\n },\n indeterminateCheckbox: {\n isCheckedAnnounce: 'All subitems are checked for {labelText} checkbox',\n isIndeterminateAnnounce:\n 'Some, but not all, subitems are checked for {labelText} checkbox',\n isUncheckedAnnounce: 'No subitems are checked for {labelText} checkbox',\n },\n input: {\n isClearableAriaLabel: 'Clear Input',\n },\n loadingIndicator: {\n progressBar: {\n messages: {\n first: 'Please be patient as this could take up to a minute to load.',\n second: 'Thank you for your patience. Still loading...',\n third: 'Thank you for waiting. We’re almost there!',\n },\n },\n spinner: {\n messages: {\n first: 'Loading...',\n second: 'Thank you for your patience. Still loading...',\n third: 'Sorry for the delay. This is taking longer than expected.',\n },\n },\n },\n modal: {\n closeAriaLabel: 'Close dialog',\n },\n multiSelect: {\n placeholder: 'Select...',\n selectedItemButtonAriaLabel: 'reset item {selectedItem}',\n },\n multiCombobox: {\n selectedItemButtonAriaLabel: 'reset item {selectedItem}',\n },\n pagination: {\n nextButtonLabel: 'Next Page',\n previousButtonLabel: 'Previous Page',\n pageButtonLabel: 'Go to Page',\n },\n password: {\n shown: {\n ariaLabel:\n 'Show password. Note: this will visually expose your password on the screen',\n buttonText: 'Show',\n announce: 'Password is now visible',\n },\n hidden: {\n ariaLabel: 'Hide password',\n buttonText: 'Hide',\n announce: 'Password is now hidden',\n },\n },\n search: {\n input: {\n ariaLabel: 'Search',\n placeholder: 'Search',\n },\n iconAriaLabel: 'Search',\n },\n select: {\n placeholder: 'Select...',\n clearIndicatorAriaLabel:\n 'reset selection for {labelText}. {selectedItem} is selected',\n },\n skipLink: {\n buttonText: 'Skip Navigation',\n },\n spinner: {\n ariaLabel: 'Loading',\n },\n table: {\n pagination: {\n ofLabel: 'of',\n nextAriaLabel: 'Next page',\n previousAriaLabel: 'Previous page',\n rowsPerPageLabel: 'Rows per page',\n },\n },\n tabs: {\n horizontalTabsInstructions:\n 'use the right and left arrow keys to activate other tabs',\n verticalTabsInstructions:\n 'use the down and up arrow keys to activate other tabs',\n nextButtonLabel: 'Scroll tabs forward',\n previousButtonLabel: 'Scroll tabs back',\n },\n tag: {\n deleteAriaLabel: 'Delete {labelText} tag',\n },\n timePicker: {\n hoursAriaLabel: 'Hour',\n minutesAriaLabel: 'Minute',\n amButtonAriaLabel:\n 'AM selected. To change to PM press the p or enter button.',\n pmButtonAriaLabel:\n 'PM selected. To change to AM press the a or enter button.',\n amSelectedAnnounce: 'AM is now selected',\n pmSelectedAnnounce: 'PM is now selected',\n },\n wizard: {\n actions: {\n next: 'next',\n previous: 'previous',\n cancel: 'cancel',\n submit: 'submit',\n },\n optional: 'optional',\n navigationLabel: 'Navigation for the wizard',\n },\n};\n","import * as React from 'react';\nimport { defaultI18n } from './default';\nimport { I18nInterface } from './interface';\n\nexport const I18nContext = React.createContext<I18nInterface>(defaultI18n);\n","import * as React from 'react';\nimport styled from '../../theme/styled';\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport { I18nContext } from '../../i18n';\nimport { stringIncludesUnit } from '../../utils';\nimport { ThemeInterface } from '../../theme/magma';\n\nexport interface SpinnerProps extends React.HTMLAttributes<HTMLSpanElement> {\n /**\n * The color of the spinner border\n * @default \"#006298\"\n */\n color?: string;\n /**\n * The height and width of the spinner. Can be a string or number; if number is provided, the size is in px.\n * @default 16\n */\n size?: string | number;\n /**\n * @internal\n */\n theme?: ThemeInterface;\n testId?: string;\n}\n\nconst StyledSpinner = styled.span<SpinnerProps>`\n animation: spinner-border 0.75s linear infinite;\n border: 2px solid ${props => props.color};\n border-right-color: transparent;\n border-radius: 50%;\n display: inline-block;\n height: ${props => props.size};\n width: ${props => props.size};\n\n @keyframes spinner-border {\n to {\n transform: rotate(360deg);\n }\n }\n`;\n\nexport const Spinner = React.forwardRef<HTMLSpanElement, SpinnerProps>(\n (props, ref) => {\n const { 'aria-label': ariaLabel, color, size, testId, ...other } = props;\n\n const theme = React.useContext(ThemeContext);\n const i18n = React.useContext(I18nContext);\n\n const sizeString = size\n ? typeof size === 'number' ||\n (typeof size === 'string' && !stringIncludesUnit(size))\n ? `${size}px`\n : size\n : theme.spaceScale.spacing05;\n\n return (\n <StyledSpinner\n {...other}\n aria-label={ariaLabel ? ariaLabel : i18n.spinner.ariaLabel}\n color={color ? color : theme.colors.primary}\n data-testid={testId}\n ref={ref}\n role=\"img\"\n size={sizeString}\n />\n );\n }\n);\n","import * as React from 'react';\nimport { css } from '@emotion/core';\nimport styled from '@emotion/styled';\nimport {\n buildActiveBackground,\n buildActiveColor,\n buildAfterBackground,\n buildButtonBorderRadius,\n buildButtonFontSize,\n buildButtonLineHeight,\n buildButtonSize,\n buildButtonPadding,\n buildBorderColor,\n buildButtonBackground,\n buildColor,\n buildFocusBackground,\n buildFocusColor,\n} from './styles';\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport { ButtonType, ButtonProps, ButtonSize, ButtonVariant } from '../Button';\nimport { Spinner } from '../Spinner';\n\nexport interface StyledButtonProps extends ButtonProps {\n href?: string;\n iconOnly?: boolean;\n}\n\nexport const buttonStyles = props => css`\n align-items: center;\n background: ${buildButtonBackground(props)};\n border: ${props.variant === 'outline' ||\n (props.variant !== 'link' && props.color === 'secondary' && !props.isInverse)\n ? '2px solid'\n : '0'};\n border-color: ${buildBorderColor(props)};\n border-radius: ${buildButtonBorderRadius(props)};\n color: ${buildColor(props)};\n cursor: ${props.disabled ? 'not-allowed' : 'pointer'};\n display: ${props.isFullWidth ? 'flex' : 'inline-flex'};\n flex-shrink: 0;\n font-family: ${props.theme.bodyFont};\n font-size: ${buildButtonFontSize(props)};\n font-weight: 600;\n height: ${buildButtonSize(props)};\n justify-content: center;\n letter-spacing: ${props.size === 'small'\n ? props.theme.typeScale.size01.letterSpacing\n : 'inherit'};\n line-height: ${buildButtonLineHeight(props)};\n margin: ${props.isFullWidth\n ? `${props.theme.spaceScale.spacing02} 0`\n : props.theme.spaceScale.spacing02};\n min-width: ${props.size === 'small' ? '0' : props.theme.spaceScale.spacing13};\n overflow: hidden;\n padding: ${buildButtonPadding(props)};\n position: relative;\n text-align: center;\n text-decoration: none;\n text-transform: ${props.textTransform || 'uppercase'};\n touch-action: manipulation;\n transition: background 0.35s, border-color 0.35s, box-shadow 0.35s,\n color 0.35s;\n vertical-align: middle;\n white-space: nowrap;\n width: ${props.iconOnly\n ? buildButtonSize(props)\n : props.isFullWidth\n ? '100%'\n : 'auto'};\n\n &:not(:disabled) {\n &:focus {\n outline: 2px dotted\n ${props.isInverse\n ? props.theme.colors.focusInverse\n : props.theme.colors.focus};\n outline-offset: 3px;\n }\n\n &:hover,\n &:focus {\n background: ${buildFocusBackground(props)};\n color: ${buildFocusColor(props)};\n }\n\n &:after {\n background: ${buildAfterBackground(props)};\n border-radius: 50%;\n content: '';\n height: ${props.theme.spaceScale.spacing07};\n left: 50%;\n opacity: 0;\n padding: 50%;\n position: absolute;\n top: 50%;\n transform: translate(-50%, -50%) scale(1);\n transition: opacity 1s, transform 0.5s;\n width: ${props.theme.spaceScale.spacing07};\n }\n\n &:active {\n background: ${buildActiveBackground(props)};\n color: ${buildActiveColor(props)};\n &:after {\n opacity: 0.4;\n transform: translate(-50%, -50%) scale(0);\n transition: transform 0s;\n }\n }\n }\n\n svg {\n flex-shrink: 0;\n }\n\n ${props.iconOnly &&\n css`\n display: inline-flex;\n justify-content: center;\n line-height: 1;\n min-width: 0;\n padding: 0;\n `}\n`;\n\nexport const BaseStyledButton = styled.button`\n ${buttonStyles}\n`;\n\nconst SpinnerWrapper = styled.span`\n position: absolute;\n display: flex;\n`;\n\nconst ChildrenWrapper = styled.span<{ isLoading: boolean; testId?: string }>`\n visibility: ${props => (props.isLoading ? 'hidden' : 'visible')};\n display: inline-flex;\n align-items: center;\n`;\n\nexport const StyledButton = React.forwardRef<\n HTMLButtonElement,\n StyledButtonProps\n>((props, ref) => {\n const {\n size,\n variant,\n isInverse,\n children,\n type = ButtonType.button,\n testId,\n isLoading,\n } = props;\n const theme = React.useContext(ThemeContext);\n\n const spinnerColor =\n isInverse &&\n (variant === ButtonVariant.outline || variant === ButtonVariant.link)\n ? theme.colors.neutral08\n : theme.colors.neutral03;\n\n const spinnerSize =\n size === ButtonSize.small\n ? theme.iconSizes.xSmall\n : size === ButtonSize.large\n ? theme.iconSizes.large\n : theme.iconSizes.medium;\n\n return (\n <BaseStyledButton\n {...props}\n data-testid={testId}\n ref={ref}\n type={type}\n theme={theme}\n disabled={isLoading || props.disabled}\n >\n {isLoading && (\n <SpinnerWrapper>\n <Spinner\n testId={`${testId}-spinner`}\n color={spinnerColor}\n size={spinnerSize}\n />\n </SpinnerWrapper>\n )}\n <ChildrenWrapper isLoading={isLoading} testId={`${testId}-children`}>\n {children}\n </ChildrenWrapper>\n </BaseStyledButton>\n );\n});\n","import * as React from 'react';\n\ninterface InverseInterface {\n isInverse?: boolean;\n}\n\nexport const InverseContext = React.createContext<InverseInterface>({\n isInverse: false,\n});\n\nexport function useIsInverse(inverseProp?: boolean) {\n const inverseContext = React.useContext(InverseContext);\n\n return typeof inverseProp !== 'undefined'\n ? Boolean(inverseProp)\n : inverseContext.isInverse;\n}\n","import * as React from 'react';\nimport { StyledButton } from '../StyledButton';\nimport { useIsInverse } from '../../inverse';\n\nexport enum ButtonVariant {\n solid = 'solid', //default\n outline = 'outline',\n link = 'link',\n}\n\nexport enum ButtonColor {\n primary = 'primary', //default\n secondary = 'secondary',\n success = 'success',\n danger = 'danger',\n marketing = 'marketing',\n}\n\nexport enum ButtonShape {\n fill = 'fill', //default\n leftCap = 'leftCap',\n rightCap = 'rightCap',\n round = 'round', // default for icon only buttons\n}\n\nexport enum ButtonSize {\n large = 'large',\n medium = 'medium', //default\n small = 'small',\n}\n\nexport enum ButtonTextTransform {\n uppercase = 'uppercase', //default\n none = 'none',\n}\n\nexport enum ButtonType {\n button = 'button',\n submit = 'submit',\n reset = 'reset',\n}\n\nexport interface ButtonStyles {\n /**\n * The color of the button, indicating its function in the UI\n * @default ButtonColor.primary\n */\n color?: ButtonColor;\n /**\n * Set the button to display full-width.\n * @default false\n */\n isFullWidth?: boolean;\n isInverse?: boolean;\n /**\n * Defines the border radius\n * @default ButtonShape.fill\n */\n shape?: ButtonShape;\n /**\n * Set the button to a loading state\n * @default false\n */\n isLoading?: boolean;\n /**\n * The relative size of the button\n * @default ButtonSize.medium\n */\n size?: ButtonSize;\n /**\n * Determines whether the button appears in all-caps\n * @default ButtonTextTransform.uppercase\n */\n textTransform?: ButtonTextTransform;\n /**\n * The variant of the button\n * @default ButtonVariant.solid\n */\n variant?: ButtonVariant;\n}\n\n/**\n * @children required\n */\ninterface BaseButtonProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n testId?: string;\n /**\n * @internal\n */\n theme?: any;\n /**\n * The type attribute of the button\n * ButtonType.button\n */\n type?: ButtonType;\n}\n\nexport type ButtonProps = BaseButtonProps & ButtonStyles;\n\nexport const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n (props, ref) => {\n const { children, ...rest } = props;\n\n const isInverse = useIsInverse(props.isInverse);\n\n return (\n <StyledButton {...rest} isInverse={isInverse} ref={ref}>\n {children}\n </StyledButton>\n );\n }\n);\n","import * as React from 'react';\nimport styled from '../../theme/styled';\nimport { StyledButton } from '../StyledButton';\nimport {\n ButtonProps,\n ButtonColor,\n ButtonShape,\n ButtonSize,\n ButtonVariant,\n ButtonTextTransform,\n} from '../Button';\nimport { IconProps } from 'react-magma-icons';\nimport { omit, Omit, XOR } from '../../utils';\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport { useIsInverse } from '../../inverse';\n\nexport enum ButtonIconPosition {\n left = 'left',\n right = 'right',\n}\n\nexport interface IconOnlyButtonProps extends Omit<ButtonProps, 'children'> {\n /**\n * Icon to display within the component\n */\n icon: React.ReactElement<IconProps>;\n /**\n * The text the screen reader will announce. Required for icon-only buttons\n */\n 'aria-label': string;\n}\n\nexport interface IconTextButtonProps extends ButtonProps {\n /**\n * Icon to display within the component\n */\n icon: React.ReactElement<IconProps>;\n children: React.ReactChild | React.ReactChild[];\n /**\n * Position within the button for the icon to appear\n * @default ButtonIconPosition.right\n */\n iconPosition?: ButtonIconPosition;\n}\n\nexport type IconButtonProps = XOR<IconOnlyButtonProps, IconTextButtonProps>;\n\nexport interface SpanProps {\n size?: ButtonSize;\n}\n\nconst SpanTextLeft = styled.span<SpanProps>`\n padding-right: ${props => getIconPadding(props)};\n`;\n\nconst SpanTextRight = styled.span<SpanProps>`\n padding-left: ${props => getIconPadding(props)};\n`;\n\nfunction getIconPadding(props) {\n switch (props.size) {\n case 'large':\n return props.theme.spaceScale.spacing05;\n case 'small':\n return props.theme.spaceScale.spacing02;\n default:\n return props.theme.spaceScale.spacing03;\n }\n}\n\nfunction getIconSize(size, theme) {\n switch (size) {\n case 'large':\n return theme.iconSizes.large;\n case 'small':\n return theme.iconSizes.small;\n default:\n return theme.iconSizes.medium;\n }\n}\n\nexport function instanceOfIconOnly(object: any): object is IconOnlyButtonProps {\n return 'icon' in object && !('children' in object);\n}\n\nexport const IconButton = React.forwardRef<HTMLButtonElement, IconButtonProps>(\n (props, ref) => {\n let icon;\n let iconPosition;\n let children;\n const { color, shape, size, testId, textTransform, variant, ...rest } =\n props;\n\n const theme = React.useContext(ThemeContext);\n\n if (instanceOfIconOnly(props)) {\n icon = props.icon;\n } else {\n icon = props.icon;\n iconPosition = props.iconPosition;\n children = props.children;\n }\n\n const other = omit(['iconPosition', 'textPosition'], rest);\n\n const isInverse = useIsInverse(props.isInverse);\n\n if (icon && !children) {\n return (\n <StyledButton\n {...other}\n ref={ref}\n color={color ? color : ButtonColor.primary}\n iconOnly\n testId={testId}\n isInverse={isInverse}\n shape={shape ? shape : ButtonShape.round}\n size={size ? size : ButtonSize.medium}\n variant={variant ? variant : ButtonVariant.solid}\n >\n {React.Children.only(\n React.cloneElement(icon, {\n size: icon.props.size\n ? icon.props.size\n : getIconSize(size, theme),\n })\n )}\n </StyledButton>\n );\n }\n return (\n <StyledButton\n {...other}\n ref={ref}\n color={color ? color : ButtonColor.primary}\n isInverse={isInverse}\n shape={shape ? shape : ButtonShape.fill}\n size={size ? size : ButtonSize.medium}\n testId={testId}\n textTransform={\n textTransform ? textTransform : ButtonTextTransform.uppercase\n }\n variant={variant ? variant : ButtonVariant.solid}\n >\n {iconPosition === ButtonIconPosition.right && (\n <SpanTextLeft size={size} theme={theme}>\n {children}\n </SpanTextLeft>\n )}\n {React.Children.only(\n React.cloneElement(icon, {\n size: icon.props.size ? icon.props.size : getIconSize(size, theme),\n 'data-testid': `${testId}-icon`,\n })\n )}\n {iconPosition !== ButtonIconPosition.right && (\n <SpanTextRight size={size} theme={theme}>\n {children}\n </SpanTextRight>\n )}\n </StyledButton>\n );\n }\n);\n","import * as React from 'react';\nimport { css } from '@emotion/core';\nimport styled from '../../theme/styled';\nimport isPropValid from '@emotion/is-prop-valid';\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport {\n InfoIcon,\n CheckCircleIcon,\n WarningIcon,\n ErrorIcon,\n IconProps,\n CloseIcon,\n} from 'react-magma-icons';\nimport { ButtonVariant } from '../Button';\nimport { IconButton } from '../IconButton';\nimport { ProgressRing } from '../ProgressRing';\nimport { useGenerateId } from '../../utils';\nimport { I18nContext } from '../../i18n';\nimport { InverseContext, useIsInverse } from '../../inverse';\n\nexport const VARIANT_ICON: {\n [name: string]: React.FunctionComponent<IconProps>;\n} = {\n info: InfoIcon,\n muted: InfoIcon,\n success: CheckCircleIcon,\n warning: WarningIcon,\n danger: ErrorIcon,\n};\n\nexport enum AlertVariant {\n info = 'info', //default,\n muted = 'muted',\n success = 'success',\n warning = 'warning',\n danger = 'danger',\n}\n\nexport interface AlertBaseProps extends React.HTMLAttributes<HTMLDivElement> {\n closeAriaLabel?: string;\n forceDismiss?: () => void;\n hasTimerRing?: boolean;\n isExiting?: boolean;\n isDismissed?: boolean;\n isDismissible?: boolean;\n isInverse?: boolean;\n isPaused?: boolean;\n isToast?: boolean;\n onDismiss?: () => void;\n testId?: string;\n toastDuration?: number;\n variant?: AlertVariant;\n}\n\nexport const transitionDuration = 500;\n\nexport function buildAlertBackground(props) {\n switch (props.variant) {\n case 'muted':\n return 'rgba(0, 0, 0, 0)';\n case 'success':\n return props.theme.colors.success;\n case 'warning':\n return props.theme.colors.pop04;\n case 'danger':\n return props.theme.colors.danger;\n default:\n return props.theme.colors.neutral;\n }\n}\n\nconst StyledAlert = styled.div<AlertBaseProps>`\n align-items: stretch;\n animation: ${props =>\n props.isExiting\n ? `fadeout ${transitionDuration}ms`\n : `fadein ${transitionDuration}ms`};\n \n display: flex;\n flex-direction: column;\n font-size: ${props => props.theme.typeScale.size03.fontSize};\n line-height: ${props => props.theme.typeScale.size03.lineHeight};\n margin-bottom: ${props => props.theme.spaceScale.spacing06};\n max-width: 100%;\n padding: 0;\n position: relative;\n\n @media (max-width: ${props => props.theme.breakpoints.small}px) {\n font-size: ${props => props.theme.typeScale.size02.fontSize};\n letter-spacing: ${props => props.theme.typeScale.size02.letterSpacing};\n line-height: ${props => props.theme.typeScale.size02.lineHeight};\n }\n\n &:focus {\n outline: 2px dotted ${props =>\n props.isInverse\n ? props.theme.colors.focusInverse\n : props.theme.colors.focus};\n }\n }\n\n ${props =>\n props.isToast &&\n css`\n animation: ${props.isExiting\n ? `slideout ${transitionDuration}ms`\n : `slidein ${transitionDuration}ms`};\n min-width: 375px;\n margin: 0 auto;\n\n @media (max-width: ${props.theme.breakpoints.small}px) {\n min-width: 0;\n width: 100%;\n }\n `}\n\n @keyframes fadein {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n }\n\n @keyframes fadeout {\n from {\n opacity: 1;\n }\n to {\n opacity: 0;\n }\n }\n\n \n @keyframes slidein {\n from {\n left: -500px;\n }\n to {\n left: 0;\n }\n }\n\n @keyframes slideout {\n from {\n left: 0;\n }\n to {\n left: -500px;\n }\n }\n\n a {\n color: inherit;\n font-weight: 600;\n text-decoration: underline;\n\n &:focus {\n outline: 2px dotted ${props =>\n props.variant === 'warning'\n ? props.theme.colors.focus\n : props.theme.colors.focusInverse};\n }\n }\n }\n`;\n\nconst StyledAlertInner = styled.div<AlertBaseProps>`\n background-color: ${props => buildAlertBackground(props)};\n border-radius: ${props => props.theme.borderRadius};\n color: ${props =>\n props.variant === AlertVariant.muted\n ? props.theme.colors.neutral03\n : props.isInverse\n ? props.theme.colors.neutral08\n : props.theme.colors.neutral};\n display: flex;\n position: relative;\n padding-right: 12px; \n\n ${props =>\n props.isToast &&\n css`\n border: 1px solid ${props.theme.colors.neutral08};\n box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.4);\n height: ${props.theme.spaceScale.spacing11};\n `}\n`;\n\nconst AlertContents = styled.div`\n align-self: center;\n flex-grow: 1;\n padding: ${props => props.theme.spaceScale.spacing04} 0;\n\n @media (max-width: ${props => props.theme.breakpoints.small}px) {\n padding-left: ${props => props.theme.spaceScale.spacing04};\n }\n`;\n\nconst IconWrapperStyles = css`\n align-items: center;\n display: flex;\n flex-shrink: 0;\n margin-right: 1px;\n`;\n\nconst IconWrapper = styled.span<{ isToast?: boolean; theme: any }>`\n ${IconWrapperStyles}\n padding: 0 ${props => props.theme.spaceScale.spacing03} 0 ${props =>\n props.theme.spaceScale.spacing04};\n\n @media (max-width: ${props => props.theme.breakpoints.small}px) {\n display: none;\n }\n`;\n\nconst ProgressRingWrapper = styled.div`\n opacity: 0.7;\n margin-top: ${props => props.theme.spaceScale.spacing01};\n position: absolute;\n top: ${props => props.theme.spaceScale.spacing02};\n right: ${props => props.theme.spaceScale.spacing02};\n`;\n\nconst DismissibleIconWrapper = styled.span<AlertBaseProps>`\n ${IconWrapperStyles}\n`;\n\nconst whitelistProps = ['icon', 'isInverse', 'theme', 'variant'];\n\nconst shouldForwardProp = prop => {\n return isPropValid(prop) || whitelistProps.includes(prop);\n};\n\nconst DismissButton = styled(IconButton, { shouldForwardProp })<{\n alertVariant?: AlertVariant;\n}>`\n align-self: stretch;\n border-radius: 0 ${props => props.theme.borderRadius}\n ${props => props.theme.borderRadius} 0;\n color: inherit;\n height: auto;\n padding: 0 ${props => props.theme.spaceScale.spacing04};\n width: auto;\n\n &&:focus:not(:disabled) {\n outline: 2px dotted\n ${({ alertVariant, theme }) =>\n alertVariant === 'warning'\n ? theme.colors.focus\n : theme.colors.focusInverse};\n outline-offset: 0 !important;\n }\n\n &:hover,\n &:focus {\n :not(:disabled):before {\n background: ${({ alertVariant, theme }) =>\n alertVariant === 'warning'\n ? theme.colors.focus\n : theme.colors.focusInverse};\n opacity: 0.15;\n }\n\n &:after {\n display: none;\n }\n }\n`;\n\nfunction renderIcon(variant = 'info', isToast?: boolean, theme?: any) {\n const Icon = VARIANT_ICON[variant];\n\n return (\n <IconWrapper isToast={isToast} theme={theme}>\n <Icon size={theme.iconSizes.medium} />\n </IconWrapper>\n );\n}\n\nexport const AlertBase = React.forwardRef<HTMLDivElement, AlertBaseProps>(\n (props, ref) => {\n const {\n children,\n closeAriaLabel,\n forceDismiss,\n hasTimerRing,\n id: defaultId,\n isDismissed,\n isDismissible,\n isExiting: externalIsExiting,\n isPaused,\n isToast,\n onDismiss,\n testId,\n toastDuration,\n variant,\n ...other\n } = props;\n\n const id = useGenerateId(defaultId);\n const [isExiting, setIsExiting] = React.useState(false);\n\n const isInverse = useIsInverse(props.isInverse);\n\n React.useEffect(() => {\n if (isExiting) {\n setTimeout(() => {\n setIsExiting(false);\n onDismiss && typeof onDismiss === 'function' && onDismiss();\n }, transitionDuration - 300);\n }\n }, [isExiting]);\n\n React.useEffect(() => {\n if (isDismissed) {\n handleDismiss();\n }\n }, [isDismissed]);\n\n function handleDismiss() {\n setIsExiting(true);\n }\n\n const theme = React.useContext(ThemeContext);\n const i18n = React.useContext(I18nContext);\n\n return (\n <StyledAlert\n {...other}\n data-testid={testId}\n id={id}\n tabIndex={-1}\n isInverse={isInverse}\n isExiting={isExiting}\n isToast={isToast}\n ref={ref}\n theme={theme}\n >\n <InverseContext.Provider\n value={{\n isInverse: variant !== AlertVariant.warning,\n }}\n >\n <StyledAlertInner\n isInverse={variant !== AlertVariant.warning}\n isToast={isToast}\n theme={theme}\n variant={variant}\n >\n {renderIcon(variant, isToast, theme)}\n <AlertContents theme={theme}>{children}</AlertContents>\n {isDismissible && (\n <DismissibleIconWrapper variant={variant} theme={theme}>\n {hasTimerRing && isToast && (\n <ProgressRingWrapper theme={theme}>\n <ProgressRing\n color={\n variant === AlertVariant.warning\n ? theme.colors.neutral\n : theme.colors.neutral08\n }\n isActive={!isPaused}\n />\n </ProgressRingWrapper>\n )}\n <DismissButton\n alertVariant={variant}\n aria-label={\n closeAriaLabel\n ? closeAriaLabel\n : i18n.alert.dismissAriaLabel\n }\n icon={\n <CloseIcon\n size={\n hasTimerRing\n ? theme.iconSizes.xSmall\n : theme.iconSizes.small\n }\n />\n }\n isInverse\n onClick={forceDismiss || handleDismiss}\n theme={theme}\n variant={ButtonVariant.link}\n />\n </DismissibleIconWrapper>\n )}\n </StyledAlertInner>\n </InverseContext.Provider>\n </StyledAlert>\n );\n }\n);\n","import * as React from 'react';\nimport styled from '../../theme/styled';\nimport { ThemeContext } from '../../theme/ThemeContext';\n\nexport interface ProgressRingProps\n extends React.HTMLAttributes<HTMLDivElement> {\n color?: string;\n duration?: number;\n isActive?: boolean;\n percentage?: number;\n radius?: number;\n strokeWidth?: number;\n testId?: string;\n}\n\nconst Circle = styled.circle`\n transition: stroke-dashoffset 0.35s;\n transform: rotate(-90deg);\n transform-origin: 50% 50%;\n`;\n\nexport const ProgressRing = React.forwardRef<HTMLDivElement, ProgressRingProps>(\n (props, ref) => {\n const {\n color,\n duration = 5000,\n isActive,\n radius = 21,\n strokeWidth = 3,\n testId,\n ...other\n } = props;\n\n const [percentage, setPercentage] = React.useState(100);\n\n React.useEffect(() => {\n const intervalDuration = duration / 50;\n\n let interval = null;\n\n if (isActive) {\n interval = setInterval(() => {\n setPercentage(percentage - 2);\n }, intervalDuration);\n\n if (percentage <= 0) {\n clearInterval(interval);\n }\n } else {\n clearInterval(interval);\n }\n\n return () => clearInterval(interval);\n }, [percentage, isActive]);\n\n const normalizedRadius = radius - strokeWidth * 2;\n const circumference = normalizedRadius * 2 * Math.PI;\n const strokeDashoffset = circumference - (percentage / 100) * circumference;\n\n const theme = React.useContext(ThemeContext);\n\n return (\n <div {...other} ref={ref} data-testid={testId}>\n <svg height={radius * 2} width={radius * 2}>\n <Circle\n cx={radius}\n cy={radius}\n fill=\"transparent\"\n r={normalizedRadius}\n stroke={color ? color : theme.colors.neutral}\n strokeWidth={strokeWidth}\n strokeDasharray={`${circumference} ${circumference}`}\n style={{ strokeDashoffset }}\n />\n </svg>\n </div>\n );\n }\n);\n","import * as React from 'react';\n\n/**\n * @children required\n */\nexport interface AnnounceProps extends React.HTMLAttributes<HTMLDivElement> {\n /**\n * Value of the `aria-live` attribute\n * @default AnnouncePoliteness.polite\n */\n politeness?: AnnouncePoliteness;\n /*\n * Test ID attached to an internal element as `data-testid` for consumer testing\n */\n testId?: string;\n}\n\nexport enum AnnouncePoliteness {\n polite = 'polite', //default\n off = 'off',\n assertive = 'assertive',\n}\n\nexport const Announce = React.forwardRef<HTMLDivElement, AnnounceProps>(\n (props, ref) => {\n const { children, politeness, testId, ...other } = props;\n\n return (\n <div\n {...other}\n aria-live={politeness || AnnouncePoliteness.polite}\n ref={ref}\n data-testid={testId}\n >\n {children}\n </div>\n );\n }\n);\n","import * as React from 'react';\nimport { AlertBase, AlertVariant } from '../AlertBase';\n\n/**\n * @children required\n */\nexport interface AlertProps extends React.HTMLAttributes<HTMLDivElement> {\n /**\n * The text read by screen readers for the close button\n * @default \"Close this message\"\n */\n closeAriaLabel?: string;\n /**\n * If true, the component will be able to be dismissed and will include a close button\n * @default false\n */\n isDismissible?: boolean;\n isInverse?: boolean;\n /**\n * Action that fires when the close button is clicked (required when isDismissible is true)\n */\n onDismiss?: () => void;\n testId?: string;\n /**\n * The variant of the alert, indicating its function in the UI\n * @default `AlertVariant.info`\n */\n variant?: AlertVariant;\n}\n\nexport const Alert = React.forwardRef<HTMLDivElement, AlertProps>(\n (props, ref) => {\n return <AlertBase ref={ref} {...props} />;\n }\n);\n","import * as React from 'react';\nimport styled from '../../theme/styled';\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport { ThemeInterface } from '../../theme/magma';\nimport { InverseContext, useIsInverse } from '../../inverse';\n\n/**\n * @children required\n */\nexport interface AppBarProps extends React.HTMLAttributes<HTMLDivElement> {\n /**\n * If true, the component will render at a shorter height with less padding\n * @default false\n **/\n isCompact?: boolean;\n isInverse?: boolean;\n position?: AppBarPosition;\n testId?: string;\n /**\n * @internal\n */\n theme?: ThemeInterface;\n}\n\nexport enum AppBarPosition {\n absolute = 'absolute',\n fixed = 'fixed',\n relative = 'relative',\n static = 'static', // default\n sticky = 'sticky',\n}\n\nconst StyledHeader = styled.header<{\n isCompact?: boolean;\n isInverse?: boolean;\n position: AppBarPosition;\n}>`\n align-items: center;\n background: ${props =>\n props.isInverse\n ? props.theme.appBar.inverse.backgroundColor\n : props.theme.appBar.backgroundColor};\n border-bottom: 1px solid\n ${props =>\n props.isInverse\n ? props.theme.colors.foundation\n : props.theme.colors.neutral06};\n box-shadow: ${props =>\n props.position === AppBarPosition.sticky ||\n props.position === AppBarPosition.fixed\n ? '0 2px 3px 0 rgb(0 0 0 / 37%)'\n : '0 0 0'};\n color: ${props =>\n props.isInverse\n ? props.theme.appBar.inverse.textColor\n : props.theme.appBar.textColor};\n display: flex;\n height: ${props =>\n props.isCompact\n ? props.theme.appBar.compact.height\n : props.theme.appBar.height};\n left: 0;\n padding: ${props =>\n props.isCompact\n ? props.theme.appBar.compact.padding\n : props.theme.appBar.padding};\n position: ${props => props.position};\n right: 0;\n top: 0;\n z-index: 10;\n`;\n\nexport const AppBar = React.forwardRef<HTMLDivElement, AppBarProps>(\n (props, ref) => {\n const {\n children,\n position = AppBarPosition.static,\n testId,\n ...other\n } = props;\n const theme = React.useContext(ThemeContext);\n const isInverse = useIsInverse(props.isInverse);\n\n return (\n <InverseContext.Provider\n value={{\n isInverse,\n }}\n >\n <StyledHeader\n {...other}\n data-testid={testId}\n position={position}\n ref={ref}\n theme={theme}\n >\n {children}\n </StyledHeader>\n </InverseContext.Provider>\n );\n }\n);\n","import * as React from 'react';\nimport { css } from '@emotion/core';\nimport styled from '../../theme/styled';\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport { darken, lighten } from 'polished';\n\n/**\n * @children required\n */\nexport interface BadgeProps extends React.HTMLAttributes<HTMLButtonElement> {\n /**\n * The color variant of the badge\n * @default BadgeColor.primary\n */\n color?: BadgeColor;\n /**\n * Action that fires when the badge is clicked. Causes the Badge to render as a button instead of a span.\n */\n onClick?: () => void;\n testId?: string;\n /**\n * Indicates the style variant of the component\n * @default BadgeVariant.label\n */\n variant?: BadgeVariant;\n}\n\nexport enum BadgeColor {\n danger = 'danger',\n primary = 'primary',\n secondary = 'secondary', // default\n success = 'success',\n light = 'light',\n}\n\nexport enum BadgeVariant {\n counter = 'counter',\n label = 'label', // default\n}\n\nexport function buildBadgeBackground(props) {\n switch (props.color) {\n case 'danger':\n return props.theme.colors.danger;\n case 'light':\n return props.theme.colors.neutral07;\n case 'primary':\n return props.theme.colors.primary;\n case 'secondary':\n return props.theme.colors.neutral02;\n case 'success':\n return props.theme.colors.success;\n\n default:\n return props.theme.colors.neutral02;\n }\n}\n\nexport function buildBadgeFocusBackground(props) {\n switch (props.color) {\n case 'danger':\n return darken(0.1, props.theme.colors.danger);\n case 'light':\n return lighten(0.05, props.theme.colors.neutral07);\n case 'primary':\n return darken(0.1, props.theme.colors.primary);\n case 'secondary':\n return darken(0.1, props.theme.colors.neutral02);\n case 'success':\n return darken(0.1, props.theme.colors.success);\n\n default:\n return darken(0.1, props.theme.colors.neutral02);\n }\n}\n\nexport function buildBadgeActiveBackground(props) {\n switch (props.color) {\n case 'danger':\n return darken(0.2, props.theme.colors.danger);\n case 'light':\n return lighten(0.1, props.theme.colors.neutral07);\n case 'primary':\n return darken(0.2, props.theme.colors.primary);\n case 'secondary':\n return darken(0.2, props.theme.colors.neutral02);\n case 'success':\n return darken(0.2, props.theme.colors.success);\n\n default:\n return darken(0.2, props.theme.colors.neutral02);\n }\n}\n\nexport const baseBadgeStyles = props => css`\n background: ${buildBadgeBackground(props)};\n border: 1px solid;\n border-color: ${props.color === BadgeColor.light\n ? props.theme.colors.neutral06\n : 'transparent'};\n border-radius: ${props.variant === BadgeVariant.counter\n ? props.theme.spaceScale.spacing06\n : props.theme.borderRadius};\n color: ${props.color === 'light'\n ? props.theme.colors.neutral\n : props.theme.colors.neutral08};\n display: inline-block;\n font-weight: bold;\n font-size: ${props.variant === BadgeVariant.counter\n ? props.theme.typeScale.size02.fontSize\n : props.theme.typeScale.size01.fontSize};\n letter-spacing: ${props.variant === BadgeVariant.counter\n ? props.theme.typeScale.size02.letterSpacing\n : props.theme.typeScale.size01.letterSpacing};\n line-height: ${props.variant === BadgeVariant.counter\n ? props.theme.typeScale.size02.lineHeight\n : props.theme.typeScale.size01.lineHeight};\n margin: ${props.variant === BadgeVariant.counter\n ? `0 0 0 ${props.theme.spaceScale.spacing03}`\n : `0 ${props.theme.spaceScale.spacing03} 0 0`};\n max-height: ${props.variant === BadgeVariant.counter\n ? props.theme.spaceScale.spacing06\n : 'auto'};\n min-width: ${props.theme.spaceScale.spacing06};\n padding: ${props.variant === BadgeVariant.counter\n ? `1px ${props.theme.spaceScale.spacing02}`\n : `${props.theme.spaceScale.spacing01} ${props.theme.spaceScale.spacing02}`};\n text-align: ${props.variant == BadgeVariant.counter ? 'center' : 'inherit'};\n`;\n\nconst StyledSpan = styled.span<BadgeProps>`\n ${baseBadgeStyles};\n`;\n\nconst StyledButton = styled.button<BadgeProps>`\n ${baseBadgeStyles};\n cursor: pointer;\n transition: background 0.35s;\n\n &:hover,\n &:focus {\n background: ${props => buildBadgeFocusBackground(props)};\n }\n\n &:active {\n background: ${props => buildBadgeActiveBackground(props)};\n }\n`;\n\nfunction getStyledBadgeComponent(isClickable: boolean) {\n return isClickable ? StyledButton : StyledSpan;\n}\n\nexport const Badge = React.forwardRef<HTMLSpanElement, BadgeProps>(\n (props, ref) => {\n const { children, onClick, testId, variant, ...other } = props;\n\n const BadgeComponent = getStyledBadgeComponent(Boolean(onClick));\n\n const theme = React.useContext(ThemeContext);\n\n return (\n <BadgeComponent\n {...other}\n data-testid={testId}\n variant={variant ? variant : BadgeVariant.label}\n onClick={onClick}\n ref={ref}\n theme={theme}\n >\n {children}\n </BadgeComponent>\n );\n }\n);\n","import * as React from 'react';\nimport styled from '../../theme/styled';\nimport isPropValid from '@emotion/is-prop-valid';\nimport { AlertProps } from '../Alert';\nimport { AlertVariant, buildAlertBackground, VARIANT_ICON } from '../AlertBase';\nimport { CloseIcon } from 'react-magma-icons';\nimport { Button, ButtonSize, ButtonVariant, ButtonColor } from '../Button';\nimport { IconButton } from '../IconButton';\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport { I18nContext } from '../../i18n';\n\n/**\n * @children required\n */\nexport interface BannerProps extends AlertProps {\n /**\n * The text displayed inside of the action button\n */\n actionButtonText?: string;\n /**\n * Action that fires when the action button is clicked. Must be present for button to appear\n */\n actionButtonOnClick?: () => void;\n /**\n * If true, the component will be able to be dismissed and will include a close button\n * @default false\n */\n isDismissible?: boolean;\n}\n\nconst StyledBanner = styled.div<AlertProps>`\n align-items: stretch;\n background: ${props => buildAlertBackground(props)};\n color: ${props =>\n props.variant === 'warning'\n ? props.theme.colors.neutral\n : props.theme.colors.neutral08};\n display: flex;\n font-size: ${props => props.theme.typeScale.size03.fontSize};\n line-height: ${props => props.theme.typeScale.size03.lineHeight};\n position: relative;\n text-align: left;\n\n @media (max-width: ${props => props.theme.breakpoints.small}px) {\n text-align: left;\n font-size: ${props => props.theme.typeScale.size02.fontSize};\n letter-spacing: ${props => props.theme.typeScale.size02.letterSpacing};\n line-height: ${props => props.theme.typeScale.size02.lineHeight};\n }\n`;\n\nconst BannerContents = styled.div`\n align-items: center;\n display: flex;\n flex-grow: 1;\n justify-content: flex-start;\n padding: ${props => props.theme.spaceScale.spacing04};\n\n @media (max-width: ${props => props.theme.breakpoints.small}px) {\n justify-content: flex-start;\n }\n`;\n\nconst ButtonWrapper = styled.span`\n align-items: center;\n display: flex;\n flex-shrink: 0;\n`;\n\nconst allowedProps = ['icon', 'isInverse', 'theme', 'variant'];\n\nconst shouldForwardProp = prop => {\n return isPropValid(prop) || allowedProps.includes(prop);\n};\n\nconst DismissButton = styled(IconButton, { shouldForwardProp })<{\n alertVariant?: AlertVariant;\n}>`\n align-self: stretch;\n border-radius: 0;\n color: ${({ alertVariant, theme }) =>\n alertVariant === 'warning' ? theme.colors.neutral : theme.colors.neutral08};\n height: auto;\n padding: 0 ${props => props.theme.spaceScale.spacing05};\n width: auto;\n\n &&:focus:not(:disabled) {\n outline: 2px dotted\n ${({ alertVariant, theme }) =>\n alertVariant === 'warning'\n ? theme.colors.neutral\n : theme.colors.neutral08};\n outline-offset: 0 !important;\n }\n\n &:hover,\n &:focus {\n :not(:disabled) {\n &:before {\n background: ${({ alertVariant, theme }) =>\n alertVariant === 'warning'\n ? theme.colors.neutral\n : theme.colors.neutral08};\n opacity: 0.15;\n }\n\n &:after {\n display: none;\n }\n }\n }\n`;\n\nconst IconWrapper = styled.span`\n display: inline-flex;\n padding-right: ${props => props.theme.spaceScale.spacing03};\n\n @media (max-width: ${props => props.theme.breakpoints.small}px) {\n display: none;\n }\n`;\n\nfunction renderIcon(variant = 'info', theme: any) {\n const Icon = VARIANT_ICON[variant];\n\n return (\n <IconWrapper theme={theme}>\n <Icon size={theme.iconSizes.medium} />\n </IconWrapper>\n );\n}\n\nfunction getButtonColor(variant: AlertVariant) {\n switch (variant) {\n case 'success':\n return ButtonColor.success;\n case 'warning':\n return ButtonColor.secondary;\n case 'danger':\n return ButtonColor.danger;\n default:\n return ButtonColor.primary;\n }\n}\n\nexport const Banner = React.forwardRef<HTMLDivElement, BannerProps>(\n (props, ref) => {\n const {\n actionButtonText,\n actionButtonOnClick,\n children,\n closeAriaLabel,\n isDismissible,\n onDismiss,\n testId,\n variant,\n ...other\n } = props;\n\n const theme = React.useContext(ThemeContext);\n const i18n = React.useContext(I18nContext);\n\n return (\n <StyledBanner\n {...other}\n data-testid={testId}\n ref={ref}\n theme={theme}\n variant={variant}\n >\n <BannerContents theme={theme}>\n {renderIcon(variant, theme)}\n {children}\n {actionButtonText && actionButtonOnClick && (\n <Button\n color={getButtonColor(variant)}\n isInverse\n onClick={actionButtonOnClick}\n style={{ margin: `0 0 0 ${theme.spaceScale.spacing08}` }}\n size={ButtonSize.small}\n >\n {actionButtonText}\n </Button>\n )}\n </BannerContents>\n\n {isDismissible && (\n <ButtonWrapper>\n <DismissButton\n alertVariant={variant}\n aria-label={\n closeAriaLabel ? closeAriaLabel : i18n.alert.dismissAriaLabel\n }\n icon={<CloseIcon size={theme.iconSizes.small} />}\n isInverse\n onClick={onDismiss}\n theme={theme}\n variant={ButtonVariant.link}\n />\n </ButtonWrapper>\n )}\n </StyledBanner>\n );\n }\n);\n","import * as React from 'react';\nimport styled from '@emotion/styled';\n\n/**\n * @children required\n */\nexport interface HideAtBreakpointProps\n extends React.HTMLAttributes<HTMLDivElement> {\n displayType?: HideAtBreakpointDisplayType;\n /**\n * Maximum width at which to hide the content\n */\n maxWidth?: number;\n /**\n * Minimum width at which to hide the content\n */\n minWidth?: number;\n testId?: string;\n}\n\nexport enum HideAtBreakpointDisplayType {\n block = 'block', // default\n flex = 'flex',\n inline = 'inline',\n inlineFlex = 'inline-flex',\n}\n\nconst Container = styled.div<HideAtBreakpointProps>`\n display: ${props => props.displayType};\n\n @media (min-width: ${props => props.minWidth}px) {\n display: none;\n }\n\n @media (max-width: ${props => props.maxWidth}px) {\n display: none;\n }\n`;\n\nexport const HideAtBreakpoint = React.forwardRef<\n HTMLDivElement,\n HideAtBreakpointProps\n>((props, ref) => {\n const {\n children,\n displayType = HideAtBreakpointDisplayType.block,\n minWidth,\n maxWidth,\n testId,\n ...other\n } = props;\n\n return (\n <Container\n {...other}\n data-testid={testId}\n displayType={displayType}\n maxWidth={maxWidth}\n minWidth={minWidth}\n ref={ref}\n >\n {children}\n </Container>\n );\n});\n","import * as React from 'react';\nimport styled from '../../theme/styled';\nimport isPropValid from '@emotion/is-prop-valid';\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport { I18nContext } from '../../i18n';\nimport { InverseContext, useIsInverse } from '../../inverse';\n\n/**\n * @children required\n */\nexport interface BreadcrumbProps extends React.HTMLAttributes<HTMLElement> {\n isInverse?: boolean;\n testId?: string;\n}\n\nconst StyledList = styled('ol', {\n shouldForwardProp: isPropValid,\n})<BreadcrumbProps>`\n display: flex;\n flex-wrap: wrap;\n font-size: ${props => props.theme.typeScale.size02.fontSize};\n letter-spacing: ${props => props.theme.typeScale.size02.letterSpacing};\n line-height: ${props => props.theme.typeScale.size02.lineHeight};\n list-style: none;\n margin: 0;\n padding: 0;\n`;\n\nexport const Breadcrumb = React.forwardRef<HTMLOListElement, BreadcrumbProps>(\n (props, ref) => {\n const {\n 'aria-label': ariaLabel,\n children,\n isInverse: isInverseProp,\n testId,\n ...other\n } = props;\n\n const theme = React.useContext(ThemeContext);\n const i18n = React.useContext(I18nContext);\n const isInverse = useIsInverse(isInverseProp);\n\n return (\n <InverseContext.Provider value={{ isInverse }}>\n <nav\n {...other}\n aria-label={ariaLabel ? ariaLabel : i18n.breadcrumb.navAriaLabel}\n data-testid={testId}\n >\n <StyledList isInverse={isInverse} ref={ref} theme={theme}>\n {children}\n </StyledList>\n </nav>\n </InverseContext.Provider>\n );\n }\n);\n","import * as React from 'react';\nimport { ButtonStyles } from '../Button';\nimport styled from '@emotion/styled';\nimport { css, ClassNames } from '@emotion/core';\nimport { omit, Omit } from '../../utils';\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport { BaseStyledButton, buttonStyles } from '../StyledButton';\nimport { ThemeInterface } from '../../theme/magma';\nimport { useIsInverse } from '../../inverse';\n\n/**\n * @children required\n */\nexport interface HyperlinkProps\n extends ButtonStyles,\n Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, 'color'> {\n children: React.ReactNode;\n /**\n * How the hyperlink is styled (can look like either a plain link or a button)\n */\n styledAs?: 'Button' | 'Link';\n testId?: string;\n /**\n * The href value of the link\n */\n to: string;\n}\n\nconst linkStyles = props => css`\n color: ${props.isInverse\n ? props.theme.colors.primaryInverse\n : props.theme.colors.primary};\n text-decoration: underline;\n &:not([disabled]) {\n &:hover,\n &:focus {\n color: ${props.isInverse\n ? props.theme.colors.primaryInverse\n : props.theme.colors.foundation02};\n }\n &:focus {\n outline: 2px dotted\n ${props.isInverse\n ? props.theme.colors.focusInverse\n : props.theme.colors.focus};\n outline-offset: 3px;\n }\n }\n`;\n\nconst StyledLink = styled.a<{ isInverse?: boolean; theme: ThemeInterface }>`\n ${linkStyles}\n`;\n\nexport const Hyperlink = React.forwardRef<HTMLAnchorElement, HyperlinkProps>(\n (props, ref) => {\n const { children, to, styledAs, testId, ...rest } = props;\n\n const other = omit(['positionTop', 'positionLeft', 'type'], rest);\n const theme = React.useContext(ThemeContext);\n const isInverse = useIsInverse(props.isInverse);\n\n if (typeof children === 'function') {\n const composedStyle =\n styledAs === 'Button'\n ? buttonStyles({ ...props, theme })\n : linkStyles({ ...props, theme });\n\n return (\n <ClassNames>\n {({ css: composedCss }) => {\n const className = composedCss(composedStyle);\n return (children as (props: object) => React.ReactNode)({\n to,\n className,\n isInverse,\n });\n }}\n </ClassNames>\n );\n } else {\n const LinkStyledAsButton = BaseStyledButton.withComponent('a');\n const HyperlinkComponent =\n styledAs === 'Button' ? LinkStyledAsButton : StyledLink;\n\n return (\n <HyperlinkComponent\n {...other}\n ref={ref}\n data-testid={testId}\n href={to}\n isInverse={isInverse}\n theme={theme}\n >\n {children}\n </HyperlinkComponent>\n );\n }\n }\n);\n","import * as React from 'react';\nimport styled from '../../theme/styled';\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport { Hyperlink } from '../Hyperlink';\nimport { useIsInverse } from '../../inverse';\nimport { ChevronRightIcon } from 'react-magma-icons';\n\n/**\n * @children required\n */\nexport interface BreadcrumbItemProps\n extends React.HTMLAttributes<HTMLLIElement> {\n testId?: string;\n /**\n * The href value of the link. If left blank, the breadcrumb item will render as a span with aria-current=\"page\" on it.\n */\n to?: string;\n}\n\nconst StyledItem = styled.li`\n list-style: none;\n margin: 0;\n padding: 0;\n display: flex;\n`;\n\nconst StyledSpan = styled.span<{ isInverse?: boolean }>`\n color: ${props =>\n props.isInverse\n ? props.theme.colors.neutral08\n : props.theme.colors.neutral03};\n\n svg {\n margin: 0 ${props => props.theme.spaceScale.spacing02};\n }\n`;\n\nexport const BreadcrumbItem = React.forwardRef<\n HTMLLIElement,\n BreadcrumbItemProps\n>((props, ref) => {\n const { children, to, testId, ...other } = props;\n const theme = React.useContext(ThemeContext);\n const isInverse = useIsInverse();\n\n return (\n <StyledItem {...other} data-testid={testId} ref={ref}>\n {to ? (\n <>\n <Hyperlink to={to} isInverse={isInverse}>\n {children}\n </Hyperlink>\n <StyledSpan isInverse={isInverse} theme={theme}>\n <ChevronRightIcon size={theme.iconSizes.small} />\n </StyledSpan>\n </>\n ) : (\n <StyledSpan aria-current=\"page\" isInverse={isInverse} theme={theme}>\n {children}\n </StyledSpan>\n )}\n </StyledItem>\n );\n});\n","import * as React from 'react';\nimport { HideAtBreakpoint } from '../HideAtBreakpoint';\nimport { ThemeContext } from '../../theme/ThemeContext';\n\nexport enum BreakpointScreenSize {\n xs = 'xs', //default\n small = 'small',\n medium = 'medium',\n large = 'large',\n xl = 'xl',\n}\n\n/**\n * @children required\n */\nexport interface BreakpointsContainerProps\n extends React.HTMLAttributes<HTMLDivElement> {\n /**\n * Object that defines the pixel size of individual breakpoints\n * @default { xs: 0, small: 600, medium: 768, large: 1024, xl: 1200 }\n */\n breakpoints?: object;\n}\n\nexport interface BreakpointProps extends React.HTMLAttributes<HTMLDivElement> {\n /**\n * The relative screen size for the breakpoint. Will go from pixel width specified up to the next breakpoint.\n * @default BreakpointScreenSize.xs\n */\n screenSize?: BreakpointScreenSize;\n testId?: string;\n}\n\nexport const Breakpoint: React.FunctionComponent<BreakpointProps> = ({\n children,\n screenSize,\n testId,\n ...other\n}: BreakpointProps) => {\n return <div {...other}>{children}</div>;\n};\n\nfunction getMinWidth(\n screenSize: BreakpointScreenSize,\n breakpointValues: object,\n definedBreakpoints: any\n) {\n const sizes = Object.keys(breakpointValues);\n\n const newSizes = sizes.slice(sizes.indexOf(screenSize) + 1);\n\n const nextSize = newSizes.find(newSize =>\n definedBreakpoints.includes(newSize)\n );\n\n return breakpointValues[nextSize];\n}\n\nexport const BreakpointsContainer: React.FunctionComponent<BreakpointsContainerProps> = ({\n children,\n breakpoints,\n ...other\n}: BreakpointsContainerProps) => {\n const definedBreakpoints = [];\n\n React.Children.forEach(children, (child: React.ReactElement) => {\n definedBreakpoints.push(child.props.screenSize);\n });\n\n const theme = React.useContext(ThemeContext);\n\n const defaultBreakpoints = theme.breakpoints;\n\n const breakpointValues = breakpoints ? breakpoints : defaultBreakpoints;\n\n return (\n <>\n {React.Children.map(children, (child: React.ReactElement) => {\n return child.props.screenSize ? (\n <HideAtBreakpoint\n {...other}\n maxWidth={breakpointValues[child.props.screenSize] - 1}\n minWidth={getMinWidth(\n child.props.screenSize,\n breakpointValues,\n definedBreakpoints\n )}\n testId={child.props.testId}\n >\n {child}\n </HideAtBreakpoint>\n ) : (\n child\n );\n })}\n </>\n );\n};\n","import * as React from 'react';\nimport { css } from '@emotion/core';\nimport styled from '../../theme/styled';\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport { ThemeInterface } from '../../theme/magma';\nimport { useIsInverse } from '../../inverse';\n\n/**\n * @children required\n */\nexport interface CardProps extends React.LabelHTMLAttributes<HTMLDivElement> {\n /**\n * Sets the alignment of the card content\n * @default CardAlignment.left\n */\n align?: CardAlignment;\n /**\n * Color for the background and border-color, set by CSS.\n */\n background?: string;\n /**\n * If a value is passed, the card will be styled as a callout for the specified type.\n * @default none\n */\n calloutType?: CardCalloutType;\n /**\n * If true, card will render with a box-shadow\n * @default false\n */\n hasDropShadow?: boolean;\n isInverse?: boolean;\n testId?: string;\n /**\n * Width of the component, set by CSS.\n */\n width?: string | number;\n}\n\nexport enum CardAlignment {\n center = 'center',\n left = 'left',\n right = 'right',\n}\n\nexport enum CardCalloutType {\n danger = 'danger',\n primary = 'primary',\n success = 'success',\n warning = 'warning',\n}\n\nexport function buildCalloutBackground(\n props: CardProps & { theme: ThemeInterface }\n) {\n if (props.isInverse) {\n switch (props.calloutType) {\n case 'danger':\n return props.theme.colors.dangerInverse;\n case 'success':\n return props.theme.colors.successInverse;\n case 'warning':\n return props.theme.colors.pop04;\n default:\n return props.theme.colors.foundation04;\n }\n }\n\n switch (props.calloutType) {\n case 'danger':\n return props.theme.colors.danger;\n case 'success':\n return props.theme.colors.success;\n case 'warning':\n return props.theme.colors.pop04;\n default:\n return props.theme.colors.primary;\n }\n}\n\nconst StyledCard = styled.div<CardProps>`\n background: ${props =>\n props.background\n ? props.background\n : props.isInverse\n ? props.theme.colors.foundation\n : props.theme.colors.neutral08};\n border: 1px solid\n ${props =>\n props.background ? props.background : props.theme.colors.neutral06};\n border-radius: ${props => props.theme.borderRadius};\n box-shadow: ${props =>\n props.hasDropShadow ? '0 2px 6px 0 rgba(0,0,0,0.18)' : '0 0 0'};\n color: ${props =>\n props.isInverse\n ? props.theme.colors.neutral08\n : props.theme.colors.neutral};\n display: flex;\n flex-direction: column;\n overflow: visible;\n padding-left: ${props =>\n props.calloutType ? props.theme.spaceScale.spacing02 : '0'};\n position: relative;\n text-align: ${props => props.align};\n width: ${props => props.width};\n\n ${props =>\n props.calloutType &&\n css`\n &:before {\n background: ${buildCalloutBackground(props)};\n border-radius: ${props.theme.borderRadius} 0 0\n ${props.theme.borderRadius};\n content: '';\n display: block;\n height: 100%;\n position: absolute;\n left: 0;\n width: ${props.theme.spaceScale.spacing02};\n }\n `}\n`;\n\ninterface NavTabsContextInterface {\n isInverse?: boolean;\n}\n\nexport const CardContext = React.createContext<NavTabsContextInterface>({\n isInverse: false,\n});\n\nexport const Card = React.forwardRef<HTMLDivElement, CardProps>(\n (props, ref) => {\n const { align, children, testId, width, ...other } = props;\n\n const isInverse = useIsInverse(props.isInverse);\n\n const theme = React.useContext(ThemeContext);\n\n const widthString = width\n ? typeof width === 'number'\n ? `${width}px`\n : width\n : 'auto';\n\n return (\n <StyledCard\n {...other}\n align={align ? align : CardAlignment.left}\n data-testid={testId}\n isInverse={isInverse}\n ref={ref}\n theme={theme}\n width={widthString}\n >\n <CardContext.Provider\n value={{\n isInverse,\n }}\n >\n {children}\n </CardContext.Provider>\n </StyledCard>\n );\n }\n);\n","import * as React from 'react';\nimport styled from '../../theme/styled';\nimport { css } from '@emotion/core';\n\nexport interface TypographyProps<T = HTMLParagraphElement>\n extends React.HTMLAttributes<T> {\n as?: string;\n children?: any;\n color?: TypographyColor;\n contextVariant?: TypographyContextVariant;\n element?: string;\n isInverse?: boolean;\n noMargins?: boolean;\n ref?: any;\n testId?: string;\n theme?: any;\n visualStyle?: TypographyVisualStyle;\n}\n\nexport enum TypographyColor {\n danger = 'danger',\n default = 'default', // default\n success = 'success',\n subdued = 'subdued',\n}\n\nexport enum TypographyContextVariant {\n default = 'default', // default\n expressive = 'expressive',\n narrative = 'narrative',\n}\n\nexport enum TypographyVisualStyle {\n headingXLarge = 'headingXLarge',\n headingLarge = 'headingLarge',\n headingMedium = 'headingMedium',\n headingSmall = 'headingSmall',\n headingXSmall = 'headingXSmall',\n heading2XSmall = 'heading2XSmall',\n bodyLarge = 'bodyLarge',\n bodyMedium = 'bodyMedium',\n bodySmall = 'bodySmall',\n bodyXSmall = 'bodyXSmall',\n}\n\nexport function getBodyFontFamily(props) {\n switch (props.contextVariant) {\n case TypographyContextVariant.expressive:\n return props.theme.bodyExpressiveFont;\n case TypographyContextVariant.narrative:\n return props.theme.bodyNarrativeFont;\n default:\n return props.theme.bodyFont;\n }\n}\n\nexport const colorStyles = props => css`\n color: ${props.isInverse\n ? props.theme.colors.neutral08\n : props.contextVariant === 'expressive'\n ? props.theme.colors.foundation02\n : props.theme.colors.neutral};\n\n ${props.color === TypographyColor.danger &&\n !props.isInverse &&\n css`\n color: ${props.theme.colors.danger};\n `}\n\n ${props.color === TypographyColor.success &&\n !props.isInverse &&\n css`\n color: ${props.theme.colors.success};\n `}\n\n${props.color === TypographyColor.subdued &&\n !props.isInverse &&\n css`\n color: ${props.theme.colors.neutral03};\n `}\n\n ${props.color === TypographyColor.danger &&\n props.isInverse &&\n css`\n color: ${props.theme.colors.dangerInverse};\n `}\n\n ${props.color === TypographyColor.success &&\n props.isInverse &&\n css`\n color: ${props.theme.colors.successInverse};\n `}\n\n${props.color === TypographyColor.subdued &&\n props.isInverse &&\n css`\n color: ${props.theme.colors.focusInverse};\n `}\n`;\n\nconst baseParagraphStyles = props => css`\n ${colorStyles(props)}\n font-family: ${getBodyFontFamily(props)};\n font-weight: normal;\n`;\n\nexport const paragraphLargeStyles = props => css`\n ${baseParagraphStyles(props)}\n\n margin: ${props.noMargins ? '0' : `${props.theme.spaceScale.spacing06} 0`};\n\n font-size: ${props.theme.typographyVisualStyles.bodyLarge.mobile.fontSize};\n line-height: ${props.theme.typographyVisualStyles.bodyLarge.mobile\n .lineHeight};\n\n @media (min-width: ${props.theme.breakpoints.small}px) {\n font-size: ${props.theme.typographyVisualStyles.bodyLarge.desktop.fontSize};\n line-height: ${props.theme.typographyVisualStyles.bodyLarge.desktop\n .lineHeight};\n }\n\n ${props.contextVariant === TypographyContextVariant.expressive &&\n css`\n font-size: ${props.theme.typographyExpressiveVisualStyles.bodyLarge.mobile\n .fontSize};\n line-height: ${props.theme.typographyExpressiveVisualStyles.bodyLarge.mobile\n .lineHeight};\n\n @media (min-width: ${props.theme.breakpoints.small}px) {\n font-size: ${props.theme.typographyExpressiveVisualStyles.bodyLarge\n .desktop.fontSize};\n line-height: ${props.theme.typographyExpressiveVisualStyles.bodyLarge\n .desktop.lineHeight};\n }\n `};\n`;\n\nexport const paragraphMediumStyles = props => css`\n ${baseParagraphStyles(props)}\n\n font-size: ${props.theme.typographyVisualStyles.bodyMedium.mobile.fontSize};\n line-height: ${props.theme.typographyVisualStyles.bodyMedium.mobile\n .lineHeight};\n margin: ${props.noMargins ? '0' : `${props.theme.spaceScale.spacing06} 0`};\n\n @media (min-width: ${props.theme.breakpoints.small}px) {\n font-size: ${props.theme.typographyVisualStyles.bodyMedium.desktop\n .fontSize};\n line-height: ${props.theme.typographyVisualStyles.bodyMedium.desktop\n .lineHeight};\n }\n`;\n\nexport const paragraphSmallStyles = props => css`\n ${baseParagraphStyles(props)}\n\n font-size: ${props.theme.typographyVisualStyles.bodySmall.mobile.fontSize};\n letter-spacing: ${props.theme.typographyVisualStyles.bodySmall.mobile\n .letterSpacing};\n line-height: ${props.theme.typographyVisualStyles.bodySmall.mobile\n .lineHeight};\n margin: ${props.noMargins ? '0' : `${props.theme.spaceScale.spacing05} 0`};\n\n @media (min-width: ${props.theme.breakpoints.small}px) {\n font-size: ${props.theme.typographyVisualStyles.bodySmall.desktop.fontSize};\n letter-spacing: ${props.theme.typographyVisualStyles.bodySmall.desktop\n .letterSpacing};\n line-height: ${props.theme.typographyVisualStyles.bodySmall.desktop\n .lineHeight};\n }\n`;\n\nexport const paragraphXSmallStyles = props => css`\n ${baseParagraphStyles(props)}\n\n font-size: ${props.theme.typographyVisualStyles.bodyXSmall.mobile.fontSize};\n letter-spacing: ${props.theme.typographyVisualStyles.bodyXSmall.mobile\n .letterSpacing};\n line-height: ${props.theme.typographyVisualStyles.bodyXSmall.mobile\n .lineHeight};\n margin: ${props.noMargins ? '0' : `${props.theme.spaceScale.spacing03} 0`};\n\n @media (min-width: ${props.theme.breakpoints.small}px) {\n font-size: ${props.theme.typographyVisualStyles.bodyXSmall.desktop\n .fontSize};\n letter-spacing: ${props.theme.typographyVisualStyles.bodyXSmall.desktop\n .letterSpacing};\n line-height: ${props.theme.typographyVisualStyles.bodyXSmall.desktop\n .lineHeight};\n }\n`;\n\nfunction getHeadingFontFamily(props) {\n switch (props.contextVariant) {\n case TypographyContextVariant.expressive:\n return props.theme.headingExpressiveFont;\n case TypographyContextVariant.narrative:\n return props.theme.headingNarrativeFont;\n default:\n return props.theme.headingFont;\n }\n}\n\nconst baseHeadingStyles = props => css`\n border-bottom: 2px solid transparent;\n font-family: ${getHeadingFontFamily(props)};\n padding: 0;\n\n &:focus {\n border-bottom: 2px dotted\n ${props.isInverse\n ? props.theme.colors.focusInverse\n : props.theme.colors.focus};\n outline: 0;\n transition: border 0.1s linear;\n }\n\n ${colorStyles(props)}\n`;\n\nexport const headingXLargeStyles = props => css`\n ${baseHeadingStyles(props)}\n\n font-size: ${props.theme.typographyVisualStyles.headingXLarge.mobile\n .fontSize};\n font-weight: ${props.theme.typographyVisualStyles.headingXLarge.fontWeight};\n line-height: ${props.theme.typographyVisualStyles.headingXLarge.mobile\n .lineHeight};\n margin: ${props.noMargins ? 0 : `0 0 ${props.theme.spaceScale.spacing05}`};\n\n @media (min-width: ${props.theme.breakpoints.small}px) {\n font-size: ${props.theme.typographyVisualStyles.headingXLarge.desktop\n .fontSize};\n line-height: ${props.theme.typographyVisualStyles.headingXLarge.desktop\n .lineHeight};\n }\n\n ${props.contextVariant === 'expressive' &&\n css`\n font-size: ${props.theme.typographyExpressiveVisualStyles.headingXLarge\n .mobile.fontSize};\n font-weight: ${props.theme.typographyExpressiveVisualStyles.headingXLarge\n .fontWeight};\n line-height: ${props.theme.typographyExpressiveVisualStyles.headingXLarge\n .mobile.lineHeight};\n\n @media (min-width: ${props.theme.breakpoints.small}px) {\n font-size: ${props.theme.typographyExpressiveVisualStyles.headingXLarge\n .desktop.fontSize};\n line-height: ${props.theme.typographyExpressiveVisualStyles.headingXLarge\n .desktop.lineHeight};\n }\n `};\n\n ${props.contextVariant === 'narrative' &&\n css`\n font-size: ${props.theme.typographyNarrativeVisualStyles.headingXLarge\n .mobile.fontSize};\n font-weight: ${props.theme.typographyNarrativeVisualStyles.headingXLarge\n .fontWeight};\n line-height: ${props.theme.typographyNarrativeVisualStyles.headingXLarge\n .mobile.lineHeight};\n @media (min-width: ${props.theme.breakpoints.small}px) {\n font-size: ${props.theme.typographyNarrativeVisualStyles.headingXLarge\n .desktop.fontSize};\n line-height: ${props.theme.typographyNarrativeVisualStyles.headingXLarge\n .desktop.lineHeight};\n }\n `};\n`;\n\nexport const headingLargeStyles = props => css`\n ${baseHeadingStyles(props)}\n\n font-size: ${props.theme.typographyVisualStyles.headingLarge.mobile.fontSize};\n font-weight: ${props.theme.typographyVisualStyles.headingLarge.fontWeight};\n line-height: ${props.theme.typographyVisualStyles.headingLarge.mobile\n .lineHeight};\n margin: ${props.noMargins\n ? 0\n : `${props.theme.spaceScale.spacing10} 0 ${props.theme.spaceScale.spacing05}`};\n\n @media (min-width: ${props.theme.breakpoints.small}px) {\n font-size: ${props.theme.typographyVisualStyles.headingLarge.desktop\n .fontSize};\n line-height: ${props.theme.typographyVisualStyles.headingLarge.desktop\n .lineHeight};\n }\n\n ${props.contextVariant === 'expressive' &&\n css`\n font-size: ${props.theme.typographyExpressiveVisualStyles.headingLarge\n .mobile.fontSize};\n font-weight: ${props.theme.typographyExpressiveVisualStyles.headingLarge\n .fontWeight};\n line-height: ${props.theme.typographyExpressiveVisualStyles.headingLarge\n .mobile.lineHeight};\n\n @media (min-width: ${props.theme.breakpoints.small}px) {\n font-size: ${props.theme.typographyExpressiveVisualStyles.headingLarge\n .desktop.fontSize};\n line-height: ${props.theme.typographyExpressiveVisualStyles.headingLarge\n .desktop.lineHeight};\n }\n `};\n\n ${props.contextVariant === 'narrative' &&\n css`\n font-size: ${props.theme.typographyNarrativeVisualStyles.headingLarge.mobile\n .fontSize};\n font-weight: ${props.theme.typographyNarrativeVisualStyles.headingLarge\n .fontWeight};\n line-height: ${props.theme.typographyNarrativeVisualStyles.headingLarge\n .mobile.lineHeight};\n @media (min-width: ${props.theme.breakpoints.small}px) {\n font-size: ${props.theme.typographyNarrativeVisualStyles.headingLarge\n .desktop.fontSize};\n line-height: ${props.theme.typographyNarrativeVisualStyles.headingLarge\n .desktop.lineHeight};\n }\n `};\n`;\n\nexport const headingMediumStyles = props => css`\n ${baseHeadingStyles(props)};\n\n font-size: ${props.theme.typographyVisualStyles.headingMedium.mobile\n .fontSize};\n font-weight: ${props.theme.typographyVisualStyles.headingMedium.fontWeight};\n line-height: ${props.theme.typographyVisualStyles.headingMedium.mobile\n .lineHeight};\n margin: ${props.noMargins\n ? 0\n : `${props.theme.spaceScale.spacing09} 0 ${props.theme.spaceScale.spacing05}`};\n\n @media (min-width: ${props.theme.breakpoints.small}px) {\n font-size: ${props.theme.typographyVisualStyles.headingMedium.desktop\n .fontSize};\n line-height: ${props.theme.typographyVisualStyles.headingMedium.desktop\n .lineHeight};\n }\n\n ${props.contextVariant === 'expressive' &&\n css`\n font-size: ${props.theme.typographyExpressiveVisualStyles.headingMedium\n .mobile.fontSize};\n font-weight: ${props.theme.typographyExpressiveVisualStyles.headingMedium\n .fontWeight};\n line-height: ${props.theme.typographyExpressiveVisualStyles.headingMedium\n .mobile.lineHeight};\n\n @media (min-width: ${props.theme.breakpoints.small}px) {\n font-size: ${props.theme.typographyExpressiveVisualStyles.headingMedium\n .desktop.fontSize};\n line-height: ${props.theme.typographyExpressiveVisualStyles.headingMedium\n .desktop.lineHeight};\n }\n `};\n\n ${props.contextVariant === 'narrative' &&\n css`\n font-size: ${props.theme.typographyNarrativeVisualStyles.headingMedium\n .mobile.fontSize};\n font-weight: ${props.theme.typographyNarrativeVisualStyles.headingMedium\n .fontWeight};\n line-height: ${props.theme.typographyNarrativeVisualStyles.headingMedium\n .mobile.lineHeight};\n @media (min-width: ${props.theme.breakpoints.small}px) {\n font-size: ${props.theme.typographyNarrativeVisualStyles.headingMedium\n .desktop.fontSize};\n line-height: ${props.theme.typographyNarrativeVisualStyles.headingMedium\n .desktop.lineHeight};\n }\n `};\n`;\n\nexport const headingSmallStyles = props => css`\n ${baseHeadingStyles(props)}\n\n font-size: ${props.theme.typographyVisualStyles.headingSmall.mobile.fontSize};\n font-weight: ${props.theme.typographyVisualStyles.headingSmall.fontWeight};\n line-height: ${props.theme.typographyVisualStyles.headingSmall.mobile\n .lineHeight};\n margin: ${props.noMargins\n ? 0\n : `${props.theme.spaceScale.spacing08} 0 ${props.theme.spaceScale.spacing05}`};\n\n @media (min-width: ${props.theme.breakpoints.small}px) {\n font-size: ${props.theme.typographyVisualStyles.headingSmall.desktop\n .fontSize};\n line-height: ${props.theme.typographyVisualStyles.headingSmall.desktop\n .lineHeight};\n }\n ${props.contextVariant === 'expressive' &&\n css`\n font-size: ${props.theme.typographyExpressiveVisualStyles.headingSmall\n .mobile.fontSize};\n font-weight: ${props.theme.typographyExpressiveVisualStyles.headingSmall\n .fontWeight};\n line-height: ${props.theme.typographyExpressiveVisualStyles.headingSmall\n .mobile.lineHeight};\n\n @media (min-width: ${props.theme.breakpoints.small}px) {\n font-size: ${props.theme.typographyExpressiveVisualStyles.headingSmall\n .desktop.fontSize};\n line-height: ${props.theme.typographyExpressiveVisualStyles.headingSmall\n .desktop.lineHeight};\n }\n `};\n\n ${props.contextVariant === 'narrative' &&\n css`\n font-size: ${props.theme.typographyNarrativeVisualStyles.headingSmall.mobile\n .fontSize};\n font-weight: ${props.theme.typographyNarrativeVisualStyles.headingSmall\n .fontWeight};\n line-height: ${props.theme.typographyNarrativeVisualStyles.headingSmall\n .mobile.lineHeight};\n @media (min-width: ${props.theme.breakpoints.small}px) {\n font-size: ${props.theme.typographyNarrativeVisualStyles.headingSmall\n .desktop.fontSize};\n line-height: ${props.theme.typographyNarrativeVisualStyles.headingSmall\n .desktop.lineHeight};\n }\n `};\n`;\n\nexport const headingXSmallStyles = props => css`\n ${baseHeadingStyles(props)}\n\n font-size: ${props.theme.typographyVisualStyles.headingXSmall.mobile\n .fontSize};\n font-weight: ${props.theme.typographyVisualStyles.headingXSmall.fontWeight};\n line-height: ${props.theme.typographyVisualStyles.headingXSmall.mobile\n .lineHeight};\n margin: ${props.noMargins\n ? 0\n : `${props.theme.spaceScale.spacing06} 0 ${props.theme.spaceScale.spacing05}`};\n\n @media (min-width: ${props.theme.breakpoints.small}px) {\n font-size: ${props.theme.typographyVisualStyles.headingXSmall.desktop\n .fontSize};\n line-height: ${props.theme.typographyVisualStyles.headingXSmall.desktop\n .lineHeight};\n }\n\n ${props.contextVariant === 'expressive' &&\n css`\n font-size: ${props.theme.typographyExpressiveVisualStyles.headingXSmall\n .mobile.fontSize};\n font-weight: ${props.theme.typographyExpressiveVisualStyles.headingXSmall\n .fontWeight};\n line-height: ${props.theme.typographyExpressiveVisualStyles.headingXSmall\n .mobile.lineHeight};\n\n @media (min-width: ${props.theme.breakpoints.small}px) {\n font-size: ${props.theme.typographyExpressiveVisualStyles.headingXSmall\n .desktop.fontSize};\n line-height: ${props.theme.typographyExpressiveVisualStyles.headingXSmall\n .desktop.lineHeight};\n }\n `};\n\n ${props.contextVariant === 'narrative' &&\n css`\n font-size: ${props.theme.typographyNarrativeVisualStyles.headingXSmall\n .mobile.fontSize};\n font-weight: ${props.theme.typographyNarrativeVisualStyles.headingXSmall\n .fontWeight};\n line-height: ${props.theme.typographyNarrativeVisualStyles.headingXSmall\n .mobile.lineHeight};\n @media (min-width: ${props.theme.breakpoints.small}px) {\n font-size: ${props.theme.typographyNarrativeVisualStyles.headingXSmall\n .desktop.fontSize};\n line-height: ${props.theme.typographyNarrativeVisualStyles.headingXSmall\n .desktop.lineHeight};\n }\n `};\n`;\n\nexport const heading2XSmallStyles = props => css`\n ${baseHeadingStyles(props)}\n\n font-size: ${props.theme.typographyVisualStyles.heading2XSmall.mobile\n .fontSize};\n font-weight: ${props.theme.typographyVisualStyles.heading2XSmall.fontWeight};\n letter-spacing: ${props.theme.typographyVisualStyles.heading2XSmall.mobile\n .letterSpacing};\n line-height: ${props.theme.typographyVisualStyles.heading2XSmall.mobile\n .lineHeight};\n text-transform: uppercase;\n margin: ${props.noMargins\n ? 0\n : `${props.theme.spaceScale.spacing06} 0 ${props.theme.spaceScale.spacing03}`};\n\n @media (min-width: ${props.theme.breakpoints.small}px) {\n font-size: ${props.theme.typographyVisualStyles.heading2XSmall.desktop\n .fontSize};\n letter-spacing: ${props.theme.typographyVisualStyles.heading2XSmall.desktop\n .letterSpacing};\n line-height: ${props.theme.typographyVisualStyles.heading2XSmall.desktop\n .lineHeight};\n }\n\n ${props.contextVariant === 'expressive' &&\n css`\n font-size: ${props.theme.typographyExpressiveVisualStyles.heading2XSmall\n .mobile.fontSize};\n font-weight: ${props.theme.typographyExpressiveVisualStyles.heading2XSmall\n .fontWeight};\n letter-spacing: ${props.theme.typographyExpressiveVisualStyles\n .heading2XSmall.mobile.letterSpacing};\n line-height: ${props.theme.typographyExpressiveVisualStyles.heading2XSmall\n .mobile.lineHeight};\n text-transform: none;\n\n @media (min-width: ${props.theme.breakpoints.small}px) {\n font-size: ${props.theme.typographyExpressiveVisualStyles.heading2XSmall\n .desktop.fontSize};\n letter-spacing: ${props.theme.typographyExpressiveVisualStyles\n .heading2XSmall.desktop.letterSpacing};\n line-height: ${props.theme.typographyExpressiveVisualStyles.heading2XSmall\n .desktop.lineHeight};\n }\n `};\n\n ${props.contextVariant === 'narrative' &&\n css`\n font-size: ${props.theme.typographyNarrativeVisualStyles.heading2XSmall\n .mobile.fontSize};\n font-weight: ${props.theme.typographyNarrativeVisualStyles.heading2XSmall\n .fontWeight};\n letter-spacing: ${props.theme.typographyNarrativeVisualStyles.heading2XSmall\n .mobile.letterSpacing};\n line-height: ${props.theme.typographyNarrativeVisualStyles.heading2XSmall\n .mobile.lineHeight};\n @media (min-width: ${props.theme.breakpoints.small}px) {\n font-size: ${props.theme.typographyNarrativeVisualStyles.heading2XSmall\n .desktop.fontSize};\n letter-spacing: ${props.theme.typographyNarrativeVisualStyles\n .heading2XSmall.desktop.letterSpacing};\n line-height: ${props.theme.typographyNarrativeVisualStyles.heading2XSmall\n .desktop.lineHeight};\n }\n `};\n`;\n\nfunction getTypographyStyles(props) {\n switch (props.visualStyle) {\n case TypographyVisualStyle.headingXLarge:\n return headingXLargeStyles(props);\n case TypographyVisualStyle.headingLarge:\n return headingLargeStyles(props);\n case TypographyVisualStyle.headingMedium:\n return headingMediumStyles(props);\n case TypographyVisualStyle.headingSmall:\n return headingSmallStyles(props);\n case TypographyVisualStyle.headingXSmall:\n return headingXSmallStyles(props);\n case TypographyVisualStyle.heading2XSmall:\n return heading2XSmallStyles(props);\n case TypographyVisualStyle.bodyLarge:\n return paragraphLargeStyles(props);\n case TypographyVisualStyle.bodyMedium:\n return paragraphMediumStyles(props);\n case TypographyVisualStyle.bodySmall:\n return paragraphSmallStyles(props);\n case TypographyVisualStyle.bodyXSmall:\n return paragraphXSmallStyles(props);\n default:\n return headingLargeStyles(props);\n }\n}\n\nexport const TypographyComponent = styled.p<TypographyProps>`\n ${props => getTypographyStyles(props)}\n`;\n","import * as React from 'react';\nimport styled from '../../theme/styled';\nimport { CardProps } from '../Card';\nimport { ThemeContext } from '../../theme/ThemeContext';\n\n/**\n * @children required\n */\nexport interface CardBodyProps\n extends React.LabelHTMLAttributes<HTMLDivElement> {\n testId?: string;\n}\n\nconst StyledCardBody = styled.div<CardProps>`\n padding: ${props => props.theme.spaceScale.spacing05};\n text-align: ${props => props.align};\n\n @media (min-width: ${props => props.theme.breakpoints.small}px) {\n padding: ${props => props.theme.spaceScale.spacing06};\n }\n`;\n\nexport const CardBody = React.forwardRef<HTMLDivElement, CardBodyProps>(\n (props, ref) => {\n const { children, testId, ...other } = props;\n const theme = React.useContext(ThemeContext);\n\n return (\n <StyledCardBody {...other} data-testid={testId} ref={ref} theme={theme}>\n {children}\n </StyledCardBody>\n );\n }\n);\n","import * as React from 'react';\nimport { useIsInverse } from '../../inverse';\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport {\n TypographyColor,\n TypographyContextVariant,\n TypographyVisualStyle,\n TypographyComponent,\n TypographyProps,\n} from '../Typography';\n\n/**\n * @children required\n */\nexport interface HeadingProps extends TypographyProps<HTMLHeadingElement> {\n /**\n * The color of the component, that helps to convey meaning or relative emphasis\n * @default TypographyColor.default\n */\n color?: TypographyColor;\n /**\n * Additional styles for typography based on the context of the content\n * @default TypographyColor.default\n */\n contextVariant?: TypographyContextVariant;\n isInverse?: boolean;\n /**\n * Number to indicate which level heading will render (e.g. h1, h2 etc.)\n */\n level: 1 | 2 | 3 | 4 | 5 | 6;\n testId?: string;\n /**\n * Applies visual styles including font-size, font-weight, line-height and margins\n */\n visualStyle?: TypographyVisualStyle;\n}\n\nexport const Heading = React.forwardRef<HTMLHeadingElement, HeadingProps>(\n (props, ref) => {\n const { level, testId, visualStyle, children, ...other } = props;\n const theme = React.useContext(ThemeContext);\n\n const stylesFromLevel = {\n 1: TypographyVisualStyle.headingXLarge,\n 2: TypographyVisualStyle.headingLarge,\n 3: TypographyVisualStyle.headingMedium,\n 4: TypographyVisualStyle.headingSmall,\n 5: TypographyVisualStyle.headingXSmall,\n 6: TypographyVisualStyle.heading2XSmall,\n };\n\n const headingElement = `h${level}`;\n\n return (\n <TypographyComponent\n {...other}\n as={headingElement}\n data-testid={testId}\n isInverse={useIsInverse(props.isInverse)}\n ref={ref}\n visualStyle={visualStyle ? visualStyle : stylesFromLevel[level]}\n theme={theme}\n >\n {children}\n </TypographyComponent>\n );\n }\n);\n","import * as React from 'react';\nimport styled from '../../theme/styled';\nimport { CardContext } from './Card';\nimport { Heading } from '../Heading';\nimport { TypographyColor, TypographyVisualStyle } from '../Typography';\n\n/**\n * @children required\n */\nexport interface CardHeadingProps\n extends React.LabelHTMLAttributes<HTMLHeadingElement> {\n /**\n * Number to indicate which level heading will render (e.g. h1, h2 etc.)\n * @default 4\n */\n headingLevel?: 1 | 2 | 3 | 4 | 5 | 6;\n isInverse?: boolean;\n testId?: string;\n}\n\nconst StyledCardHeading = styled(Heading)`\n margin-top: 0;\n`;\n\nexport const CardHeading = React.forwardRef<\n HTMLHeadingElement,\n CardHeadingProps\n>((props, ref) => {\n const { headingLevel, children, ...other } = props;\n\n const context = React.useContext(CardContext);\n\n return (\n <StyledCardHeading\n {...other}\n color={TypographyColor.default}\n isInverse={context.isInverse}\n level={headingLevel ? headingLevel : 4}\n ref={ref}\n testId={props.testId}\n visualStyle={TypographyVisualStyle.headingSmall}\n >\n {children}\n </StyledCardHeading>\n );\n});\n","import { css } from '@emotion/core';\n\nexport const DisplayInputStyles = props => css`\n align-items: center;\n display: flex;\n height: ${props.theme.spaceScale.spacing06};\n flex-shrink: 0;\n justify-content: center;\n position: relative;\n transition: all 0.2s ease-out;\n width: ${props.theme.spaceScale.spacing06};\n\n &:before,\n &:after {\n // focus and active states\n content: '';\n position: absolute;\n }\n\n &:after {\n // active state\n border-radius: 50%;\n height: ${props.theme.spaceScale.spacing09};\n left: -${props.theme.spaceScale.spacing03};\n opacity: 0;\n padding: 50%;\n top: -${props.theme.spaceScale.spacing03};\n transform: scale(1);\n transition: opacity 1s, transform 0.5s;\n width: ${props.theme.spaceScale.spacing09};\n }\n`;\n\nexport const DisplayInputActiveStyles = css`\n opacity: 0.4;\n transform: scale(0);\n transition: transform 0s;\n`;\n\nexport function buildDisplayInputActiveBackground(props) {\n return props.isInverse\n ? props.theme.colors.neutral08\n : props.color\n ? props.color\n : props.theme.colors.primary;\n}\n\nexport function buildDisplayInputBorderColor(props) {\n if (props.hasError) {\n if (props.isInverse) {\n return props.theme.colors.dangerInverse;\n }\n return props.theme.colors.danger;\n }\n return 'transparent';\n}\n\nexport function buildDisplayInputFocusStyles(props) {\n return css`\n height: 30px;\n position: absolute;\n width: 30px;\n outline: 2px dotted\n ${props.isInverse\n ? props.theme.colors.focusInverse\n : props.theme.colors.focus};\n `;\n}\n","import { css } from '@emotion/core';\n\nexport const HiddenStyles = css`\n clip: rect(1px, 1px, 1px, 1px);\n height: 1px;\n position: absolute;\n overflow: hidden;\n top: auto;\n white-space: nowrap;\n width: 1px;\n`;\n","import * as React from 'react';\nimport styled from '../../theme/styled';\nimport { css } from '@emotion/core';\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport { ButtonVariant, ButtonType, ButtonSize, ButtonShape } from '../Button';\nimport { IconButton } from '../IconButton';\nimport { ClearIcon, IconProps } from 'react-magma-icons';\nimport { useIsInverse } from '../../inverse';\nimport { ThemeInterface } from '../../theme/magma';\nimport { I18nContext } from '../../i18n';\nimport { useForkedRef } from '../../utils';\n\nexport enum InputSize {\n large = 'large',\n medium = 'medium', //default\n}\n\nexport enum InputType {\n email = 'email',\n file = 'file',\n number = 'number',\n password = 'password',\n search = 'search',\n text = 'text', // default\n}\n\nexport enum InputIconPosition {\n top = 'top',\n left = 'left',\n right = 'right', // default\n}\n\nexport interface InputBaseProps\n extends React.InputHTMLAttributes<HTMLInputElement> {\n /**\n * Style properties for the component container element\n */\n containerStyle?: React.CSSProperties;\n /**\n * @internal\n */\n hasError?: boolean;\n /**\n * Icon to display within the component\n */\n icon?: React.ReactElement<IconProps>;\n /**\n * Text for the aria-label attribute for an icon, if provided\n */\n iconAriaLabel?: string;\n /**\n * Position within the component for the icon to appear\n * @default InputIconPosition.right\n */\n iconPosition?: InputIconPosition;\n /**\n * Reference to the icon element\n */\n iconRef?: React.Ref<HTMLButtonElement>;\n /**\n * Relative size of the component\n * @default InputSize.medium\n */\n inputSize?: InputSize;\n /**\n * Style properties for the input element\n */\n inputStyle?: React.CSSProperties;\n /**\n * Clear contents of input by clicking a clear button\n * @default false\n */\n isClearable?: boolean;\n /**\n * Function to be called when the contents of input are cleared by clicking a clear button\n */\n onClear?: () => void;\n isInverse?: boolean;\n /**\n * For use in predictive search which moves the icon to the left\n */\n isPredictive?: boolean;\n /**\n * Action that will fire when icon is clicked\n */\n onIconClick?: () => void;\n /**\n * Action that will fire when icon receives keypress\n */\n onIconKeyDown?: (event) => void;\n testId?: string;\n /**\n * @internal\n */\n theme?: any;\n /**\n * The type attribute of the form field\n * @default InputType.text\n */\n type?: InputType;\n}\n\nexport interface InputWrapperStylesProps {\n width?: string;\n iconPosition?: InputIconPosition;\n isInverse?: boolean;\n isClearable?: boolean;\n isPredictive?: boolean;\n theme?: ThemeInterface;\n hasError?: boolean;\n disabled?: boolean;\n}\n\nexport const inputWrapperStyles = (props: InputWrapperStylesProps) => css`\n align-items: center;\n display: flex;\n flex-shrink: 0;\n position: relative;\n width: ${props.width || 'auto'};\n background-color: ${props.theme.colors.neutral08};\n border-radius: ${props.theme.borderRadius};\n border: 1px solid\n ${props.isInverse\n ? props.theme.colors.neutral08\n : props.theme.colors.neutral03};\n\n &:focus-within {\n outline: 2px dotted\n ${props.isInverse\n ? props.theme.colors.focusInverse\n : props.theme.colors.focus};\n outline-offset: 4px;\n }\n\n ${props.hasError &&\n css`\n border-color: ${props.theme.colors.danger};\n box-shadow: 0 0 0 1px\n ${props.isInverse\n ? props.theme.colors.neutral08\n : props.theme.colors.danger};\n `}\n\n ${props.disabled &&\n css`\n border-color: ${props.theme.colors.neutral05};\n background-color: ${props.disabled\n ? props.theme.colors.neutral07\n : props.theme.colors.neutral08};\n `}\n button {\n bottom: ${props.iconPosition === InputIconPosition.top\n ? '40px'\n : 'inherit'};\n right: ${props.iconPosition === InputIconPosition.top ? '-4px' : 'inherit'};\n }\n`;\n\nexport interface InputBaseStylesProps {\n isInverse?: boolean;\n iconPosition?: InputIconPosition;\n inputSize?: InputSize;\n isPredictive?: boolean;\n theme?: ThemeInterface;\n disabled?: boolean;\n}\n\nexport const inputBaseStyles = (props: InputBaseStylesProps) => css`\n border: 0;\n border-radius: ${props.theme.borderRadius};\n background: ${props.theme.colors.neutral08};\n color: ${props.theme.colors.neutral};\n display: block;\n font-size: ${props.theme.typeScale.size03.fontSize};\n line-height: ${props.theme.typeScale.size03.lineHeight};\n font-family: ${props.theme.bodyFont};\n height: ${props.theme.spaceScale.spacing09};\n padding: ${props.theme.spaceScale.spacing03};\n -webkit-appearance: none;\n width: 100%;\n\n ${props.iconPosition === 'left' &&\n css`\n padding-left: ${props.theme.spaceScale.spacing09};\n `}\n\n ${props.iconPosition === 'right' &&\n css`\n padding-right: ${props.theme.spaceScale.spacing09};\n `}\n\n ${props.inputSize === 'large' &&\n css`\n font-size: ${props.theme.typeScale.size04.fontSize};\n line-height: ${props.theme.typeScale.size04.lineHeight};\n height: ${props.theme.spaceScale.spacing11};\n padding: ${props.theme.spaceScale.spacing04};\n `}\n\n ${props.iconPosition === 'left' &&\n props.inputSize === 'large' &&\n css`\n padding-left: ${props.theme.spaceScale.spacing10};\n `}\n\n ${props.iconPosition === 'right' &&\n props.inputSize === 'large' &&\n css`\n padding-right: ${props.theme.spaceScale.spacing10};\n `}\n\n &::placeholder {\n color: ${props.theme.colors.neutral03};\n opacity: 1;\n }\n\n &:focus {\n outline: 0;\n }\n\n &[type='search'] {\n &::-webkit-search-decoration,\n &::-webkit-search-cancel-button,\n &::-webkit-search-results-button,\n &::-webkit-search-results-decoration {\n display: none;\n }\n }\n\n ${props.disabled &&\n css`\n background: ${props.theme.colors.neutral07};\n color: ${props.theme.colors.disabledText};\n cursor: not-allowed;\n\n &::placeholder {\n color: ${props.theme.colors.disabledText};\n }\n `}\n`;\n\nexport const InputWrapper = styled.div<InputWrapperStylesProps>`\n ${inputWrapperStyles}\n`;\n\nconst StyledInput = styled.input<InputBaseStylesProps>`\n ${inputBaseStyles}\n`;\n\nconst IconWrapper = styled.span<{\n iconPosition?: InputIconPosition;\n inputSize?: InputSize;\n isClearable?: boolean;\n isPredictive?: boolean;\n disabled?: boolean;\n}>`\n bottom: ${props => (props.iconPosition === 'top' ? '45px' : 'inherit')};\n color: ${props => props.theme.colors.neutral};\n left: ${props =>\n props.iconPosition === 'left' ? props.theme.spaceScale.spacing03 : 'auto'};\n right: ${props =>\n props.iconPosition === 'right'\n ? props.theme.spaceScale.spacing03\n : props.iconPosition === 'top'\n ? '3px'\n : 'auto'};\n position: absolute;\n top: ${props =>\n props.iconPosition === 'top'\n ? 'inherit'\n : props => props.theme.spaceScale.spacing03};\n\n ${props =>\n props.inputSize === 'large' &&\n css`\n bottom: ${props.iconPosition === 'top' ? '56px' : 'inherit'};\n left: ${props.iconPosition === 'left'\n ? props.theme.spaceScale.spacing04\n : 'auto'};\n right: ${props.iconPosition === 'right'\n ? props.theme.spaceScale.spacing04\n : props.iconPosition === 'top'\n ? '3px'\n : 'auto'};\n top: ${props.iconPosition === 'top'\n ? 'inherit'\n : props.theme.spaceScale.spacing04};\n `}\n`;\n\nconst IconButtonContainer = styled.span<{\n iconPosition?: InputIconPosition;\n size?: InputSize;\n theme: ThemeInterface;\n isClearable?: boolean;\n disabled?: boolean;\n}>`\n background-color: ${({ disabled, theme }) =>\n disabled ? theme.colors.neutral07 : theme.colors.neutral08};\n bottom: ${props => (props.iconPosition === 'top' ? '40px' : 'inherit')};\n height: auto;\n margin: 0;\n position: relative;\n right: ${props =>\n props.size === InputSize.large\n ? props.theme.spaceScale.spacing02\n : props.theme.spaceScale.spacing01};\n\n svg {\n height: ${props =>\n props.size === InputSize.large\n ? `${props.theme.iconSizes.large}px`\n : `${props.theme.iconSizes.medium}px`};\n width: ${props =>\n props.size === InputSize.large\n ? `${props.theme.iconSizes.large}px`\n : `${props.theme.iconSizes.medium}px`};\n }\n`;\n\nconst IsClearableContainer = styled.span<{\n size?: InputSize;\n theme: ThemeInterface;\n isClearable?: boolean;\n disabled?: boolean;\n}>`\n background-color: ${({ disabled, theme }) =>\n disabled ? theme.colors.neutral07 : theme.colors.neutral08};\n position: relative;\n right: ${props =>\n props.size === InputSize.large\n ? props.theme.spaceScale.spacing02\n : props.theme.spaceScale.spacing01};\n`;\n\nfunction getIconSize(size: string, theme: ThemeInterface) {\n switch (size) {\n case 'large':\n return theme.iconSizes.large;\n default:\n return theme.iconSizes.medium;\n }\n}\n\nexport const InputBase = React.forwardRef<HTMLInputElement, InputBaseProps>(\n (props, forwardedRef) => {\n const {\n children,\n containerStyle,\n defaultValue,\n disabled,\n hasError,\n icon,\n iconAriaLabel,\n iconRef,\n isClearable,\n isPredictive,\n onClear,\n onIconClick,\n onIconKeyDown,\n inputSize,\n inputStyle,\n testId,\n type,\n ...other\n } = props;\n\n const i18n = React.useContext(I18nContext);\n\n const theme = React.useContext(ThemeContext);\n const iconPosition =\n icon && onIconClick\n ? InputIconPosition.right\n : icon && !props.iconPosition\n ? InputIconPosition.left\n : props.iconPosition;\n\n const [value, setValue] = React.useState<\n string | ReadonlyArray<string> | number\n >(props.defaultValue || props.value || '');\n\n React.useEffect(() => {\n if (props.value !== undefined && props.value !== null) {\n setValue(props.value);\n }\n }, [props.value]);\n\n const inputRef = React.useRef<HTMLInputElement>();\n const ref = useForkedRef(forwardedRef, inputRef);\n\n function handleClearInput() {\n onClear && typeof onClear === 'function' && onClear();\n setValue('');\n inputRef.current.focus();\n }\n\n function handleChange(event: React.ChangeEvent<HTMLInputElement>) {\n props.onChange &&\n typeof props.onChange === 'function' &&\n props.onChange(event);\n\n setValue(event.target.value);\n }\n\n return (\n <InputWrapper\n disabled={disabled}\n iconPosition={iconPosition}\n isInverse={props.isInverse}\n theme={theme}\n style={containerStyle}\n hasError={hasError}\n isClearable={isClearable}\n >\n <StyledInput\n {...other}\n aria-invalid={hasError}\n disabled={disabled}\n data-testid={testId}\n iconPosition={iconPosition}\n inputSize={inputSize ? inputSize : InputSize.medium}\n isInverse={useIsInverse(props.isInverse)}\n isPredictive={isPredictive}\n ref={ref}\n onChange={handleChange}\n style={inputStyle}\n theme={theme}\n type={type ? type : InputType.text}\n value={value}\n />\n {isClearable && value && (\n <IsClearableContainer theme={theme} disabled={disabled}>\n <IconButton\n aria-label={i18n.input.isClearableAriaLabel}\n disabled={disabled}\n icon={<ClearIcon />}\n isInverse={false}\n onClick={handleClearInput}\n onKeyDown={onIconKeyDown}\n ref={iconRef}\n shape={ButtonShape.fill}\n size={\n inputSize === InputSize.large\n ? ButtonSize.medium\n : ButtonSize.small\n }\n testId=\"clear-button\"\n type={ButtonType.button}\n variant={ButtonVariant.link}\n />\n </IsClearableContainer>\n )}\n\n {icon && !onIconClick && (\n <IconWrapper\n aria-label={iconAriaLabel}\n iconPosition={iconPosition}\n inputSize={inputSize ? inputSize : InputSize.medium}\n isPredictive={isPredictive}\n theme={theme}\n disabled={disabled}\n >\n {React.Children.only(\n React.cloneElement(icon, {\n size: getIconSize(\n inputSize ? inputSize : InputSize.medium,\n theme\n ),\n })\n )}\n </IconWrapper>\n )}\n\n {onIconClick && (\n <IconButtonContainer\n iconPosition={iconPosition}\n size={\n inputSize === InputSize.large ? InputSize.large : InputSize.medium\n }\n theme={theme}\n disabled={disabled}\n >\n <IconButton\n aria-label={iconAriaLabel}\n icon={icon}\n isInverse={false}\n onClick={onIconClick}\n onKeyDown={onIconKeyDown}\n ref={iconRef}\n disabled={disabled}\n shape={ButtonShape.fill}\n size={\n inputSize === InputSize.large\n ? ButtonSize.medium\n : ButtonSize.small\n }\n type={ButtonType.button}\n variant={ButtonVariant.link}\n />\n </IconButtonContainer>\n )}\n\n {children}\n </InputWrapper>\n );\n }\n);\n","import * as React from 'react';\nimport styled from '../../theme/styled';\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport { InputIconPosition, InputSize } from '../InputBase';\nimport { useIsInverse } from '../../inverse';\n\nexport enum LabelPosition {\n left = 'left',\n top = 'top', // default\n}\n\nexport interface LabelProps\n extends React.LabelHTMLAttributes<HTMLLabelElement> {\n actionable?: boolean;\n iconPosition?: InputIconPosition;\n isInverse?: boolean;\n labelPosition?: LabelPosition;\n size?: InputSize;\n theme?: any;\n testId?: string;\n}\n\nconst StyledLabel = styled.label<{\n iconPosition: InputIconPosition;\n isInverse: boolean;\n theme: any;\n size: InputSize;\n labelPosition: LabelPosition;\n}>`\n color: ${props =>\n props.isInverse\n ? props.theme.colors.neutral08\n : props.theme.colors.neutral};\n display: inline-block;\n font-size: ${props =>\n props.size === InputSize.large\n ? props.theme.typeScale.size03.fontSize\n : props.theme.typeScale.size02.fontSize};\n font-weight: 600;\n letter-spacing: ${props =>\n props.size === InputSize.large\n ? 'inherit'\n : props.theme.typeScale.size02.letterSpacing};\n line-height: ${props =>\n props.size === InputSize.large\n ? props.theme.typeScale.size03.lineHeight\n : props.theme.typeScale.size02.lineHeight};\n margin: ${props =>\n props.labelPosition === LabelPosition.left\n ? `0 ${props.theme.spaceScale.spacing05} 0 0`\n : `0 0 ${props.theme.spaceScale.spacing03}`};\n max-width: ${props =>\n props.iconPosition === InputIconPosition.top\n ? 'calc(100% - 51px)'\n : '100%'};\n text-align: left;\n white-space: ${props =>\n props.iconPosition === InputIconPosition.top ? 'inherit' : 'nowrap'};\n`;\n\nconst StyledSpan = StyledLabel.withComponent('span');\n\nexport const Label = React.forwardRef<HTMLLabelElement, LabelProps>(\n (props, ref) => {\n const {\n actionable = true,\n children,\n iconPosition,\n labelPosition,\n size,\n testId,\n ...other\n } = props;\n const theme = React.useContext(ThemeContext);\n\n return actionable ? (\n <StyledLabel\n {...other}\n data-testid={testId}\n isInverse={useIsInverse(props.isInverse)}\n iconPosition={iconPosition}\n labelPosition={labelPosition || LabelPosition.top}\n ref={ref}\n size={size ? size : InputSize.medium}\n theme={theme}\n >\n {children}\n </StyledLabel>\n ) : (\n <StyledSpan\n {...other}\n data-testid={testId}\n isInverse={useIsInverse(props.isInverse)}\n iconPosition={iconPosition}\n labelPosition={labelPosition || LabelPosition.top}\n ref={ref}\n size={size ? size : InputSize.medium}\n theme={theme}\n >\n {children}\n </StyledSpan>\n );\n }\n);\n","import * as React from 'react';\nimport styled from '../../theme/styled';\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport { ErrorIcon } from 'react-magma-icons';\nimport { Announce } from '../Announce';\nimport { InputSize } from '../InputBase';\n\nexport interface InputMessageProps\n extends React.HTMLAttributes<HTMLDivElement> {\n hasError?: boolean;\n id?: string;\n inputSize?: InputSize;\n isInverse?: boolean;\n}\n\nfunction BuildMessageColor(props) {\n const { isInverse, hasError, theme } = props;\n if (isInverse) {\n return hasError ? theme.colors.dangerInverse : theme.colors.neutral08;\n }\n return hasError ? theme.colors.danger : theme.colors.neutral03;\n}\n\nconst Message = styled.div<InputMessageProps>`\n align-items: center;\n border-radius: ${props => props.theme.borderRadius};\n color: ${props => BuildMessageColor(props)};\n display: flex;\n font-size: ${props => props.theme.typeScale.size02.fontSize};\n letter-spacing: ${props => props.theme.typeScale.size02.letterSpacing};\n line-height: ${props => props.theme.typeScale.size02.lineHeight};\n margin-top: ${props =>\n props.inputSize === InputSize.large\n ? props.theme.spaceScale.spacing03\n : props.theme.spaceScale.spacing02};\n text-align: left;\n`;\n\nconst IconWrapper = styled.span`\n display: inline-flex;\n flex-shrink: 0;\n padding-right: ${props => props.theme.spaceScale.spacing02};\n`;\n\nexport const InputMessage: React.FunctionComponent<InputMessageProps> = ({\n children,\n id,\n isInverse,\n hasError,\n ...other\n}: InputMessageProps) => {\n const theme = React.useContext(ThemeContext);\n\n return (\n <Announce>\n <Message\n {...other}\n data-testid=\"inputMessage\"\n id={id}\n isInverse={isInverse}\n hasError={hasError}\n theme={theme}\n >\n {hasError && (\n <IconWrapper aria-label=\"Error\" role=\"img\" theme={theme}>\n <ErrorIcon size={theme.iconSizes.small} />\n </IconWrapper>\n )}\n <div>{children}</div>\n </Message>\n </Announce>\n );\n};\n","import * as React from 'react';\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport {\n DisplayInputStyles,\n DisplayInputActiveStyles,\n buildDisplayInputActiveBackground,\n buildDisplayInputBorderColor,\n buildDisplayInputFocusStyles,\n} from '../SelectionControls/InputStyles';\nimport { FormGroupContext } from '../FormGroup';\nimport { HiddenStyles } from '../../utils/UtilityStyles';\nimport { InputMessage } from '../Input/InputMessage';\nimport { CheckBoxIcon, CheckBoxOutlineBlankIcon } from 'react-magma-icons';\nimport { StyledLabel } from '../SelectionControls/StyledLabel';\nimport { StyledContainer } from '../SelectionControls/StyledContainer';\nimport styled from '@emotion/styled';\nimport { omit, useGenerateId } from '../../utils';\nimport { useIsInverse } from '../../inverse';\n\nexport enum CheckboxTextPosition {\n left = 'left',\n right = 'right', // default\n}\n\nexport interface CheckboxProps\n extends React.InputHTMLAttributes<HTMLInputElement> {\n /**\n * If true, element is checked (i.e. selected)\n * @default false\n */\n checked?: boolean;\n /**\n * Hex code for the background color\n * @default #0000FF\n */\n color?: string;\n /**\n * Style properties for the component container element\n */\n containerStyle?: React.CSSProperties;\n /**\n * If true, checkbox is checked on first render\n */\n defaultChecked?: boolean;\n /**\n * If true, element is disabled\n * @default false\n */\n disabled?: boolean;\n /**\n * Content of the error message for an individual checkbox. If a value is provided, the input will be styled as an error state and the error message will display.\n */\n errorMessage?: React.ReactNode;\n /*\n * @internal\n */\n hasError?: boolean;\n /**\n * Style properties for the checkbox element\n */\n inputStyle?: React.CSSProperties;\n isInverse?: boolean;\n /**\n * If true, label text will be hidden visually, but will still be read by assistive technology\n * @default false\n */\n isTextVisuallyHidden?: boolean;\n /**\n * Style properties for the label element\n */\n labelStyle?: React.CSSProperties;\n /**\n * Content of label; can be node or string\n */\n labelText: React.ReactNode;\n testId?: string;\n /**\n * Whether the label appears to the left of the right of the checkbox\n * @default CheckboxTextPosition.right\n */\n textPosition?: CheckboxTextPosition;\n}\n\nexport const HiddenLabelText = styled.span`\n ${HiddenStyles};\n`;\n\nexport const HiddenInput = styled.input`\n ${HiddenStyles};\n`;\n\nfunction buildCheckIconColor(props) {\n if (props.disabled) {\n if (props.isInverse) {\n return props.theme.colors.tint04;\n }\n return props.theme.colors.neutral05;\n }\n if (props.isInverse) {\n return props.theme.colors.neutral08;\n }\n if (props.isChecked || props.isIndeterminate) {\n return props.color;\n }\n return props.theme.colors.neutral02;\n}\n\nexport const StyledFakeInput = styled.span<{\n isChecked?: boolean;\n color: string;\n disabled?: boolean;\n isIndeterminate?: boolean;\n isInverse?: boolean;\n hasError?: boolean;\n textPosition?: CheckboxTextPosition;\n theme?: any;\n}>`\n ${DisplayInputStyles};\n border: 2px solid;\n border-color: ${props => buildDisplayInputBorderColor(props)};\n color: ${props => buildCheckIconColor(props)};\n cursor: ${props => (props.disabled ? 'not-allowed' : 'pointer')};\n margin: ${props =>\n props.textPosition === 'left'\n ? `${props.theme.spaceScale.spacing01} 0 0 ${props.theme.spaceScale.spacing03}`\n : `0 ${props.theme.spaceScale.spacing03} 0 0`};\n\n svg {\n flex-shrink: 0;\n pointer-events: none;\n transition: all 0.2s ease-out;\n }\n\n ${HiddenInput}:focus + label & {\n &:before {\n ${props => buildDisplayInputFocusStyles(props)};\n }\n }\n\n &:after {\n // active state\n background: ${props => buildDisplayInputActiveBackground(props)};\n top: -10px;\n left: -10px;\n }\n\n /* prettier-ignore */\n ${HiddenInput}:not(:disabled):active + label & {\n &:after {\n ${DisplayInputActiveStyles}\n }\n }\n`;\n\nexport const Checkbox = React.forwardRef<HTMLInputElement, CheckboxProps>(\n (props, ref) => {\n const { checked, id: defaultId, defaultChecked, onChange } = props;\n const [isChecked, updateIsChecked] = React.useState(\n Boolean(defaultChecked) || Boolean(checked)\n );\n\n const id = useGenerateId(defaultId);\n const isControlled = typeof checked === 'boolean' ? true : false;\n\n React.useEffect(() => {\n if (typeof checked === 'boolean') {\n updateIsChecked(checked);\n }\n }, [checked]);\n\n function handleChange(event: React.ChangeEvent<HTMLInputElement>) {\n const { checked: targetChecked } = event.target;\n\n onChange && typeof onChange === 'function' && onChange(event);\n\n if (!isControlled) {\n updateIsChecked(targetChecked);\n }\n }\n\n const theme = React.useContext(ThemeContext);\n const context = React.useContext(FormGroupContext);\n\n const {\n color = theme.colors.primary,\n containerStyle,\n disabled,\n errorMessage,\n inputStyle,\n labelStyle,\n labelText,\n isTextVisuallyHidden,\n testId,\n textPosition,\n ...rest\n } = props;\n const other = omit(['defaultChecked'], rest);\n\n const descriptionId = errorMessage && `${id}__desc`;\n const groupDescriptionId = context.descriptionId;\n\n const describedBy =\n descriptionId && groupDescriptionId\n ? `${groupDescriptionId} ${descriptionId}`\n : descriptionId\n ? descriptionId\n : groupDescriptionId\n ? groupDescriptionId\n : null;\n\n const hasError = context.hasError || !!errorMessage;\n\n const isInverse = useIsInverse(props.isInverse);\n\n return (\n <>\n <StyledContainer style={containerStyle}>\n <HiddenInput\n {...other}\n aria-describedby={describedBy}\n id={id}\n data-testid={testId}\n checked={isChecked}\n disabled={disabled}\n ref={ref}\n type=\"checkbox\"\n onChange={handleChange}\n />\n <StyledLabel htmlFor={id} isInverse={isInverse} style={labelStyle}>\n {!isTextVisuallyHidden &&\n textPosition === CheckboxTextPosition.left &&\n labelText}\n\n <StyledFakeInput\n isChecked={isChecked}\n color={color}\n disabled={disabled}\n hasError={hasError}\n isInverse={isInverse}\n style={inputStyle}\n textPosition={textPosition}\n theme={theme}\n >\n {isChecked ? (\n <CheckBoxIcon size={theme.iconSizes.medium} />\n ) : (\n <CheckBoxOutlineBlankIcon size={theme.iconSizes.medium} />\n )}\n </StyledFakeInput>\n\n {isTextVisuallyHidden ? (\n <HiddenLabelText>{labelText}</HiddenLabelText>\n ) : (\n textPosition !== CheckboxTextPosition.left &&\n labelText &&\n labelText\n )}\n </StyledLabel>\n </StyledContainer>\n {!!errorMessage && (\n <InputMessage id={descriptionId} hasError isInverse={isInverse}>\n {errorMessage}\n </InputMessage>\n )}\n </>\n );\n }\n);\n","import * as React from 'react';\nimport { HiddenStyles } from '../../utils/UtilityStyles';\nimport { InputMessage } from '../Input/InputMessage';\nimport { Label } from '../Label';\nimport styled from '../../theme/styled';\nimport { omit, useGenerateId } from '../../utils';\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport { useIsInverse } from '../../inverse';\n\n/**\n * @children required\n */\nexport interface FormGroupProps extends React.HTMLAttributes<HTMLDivElement> {\n /**\n * Style properties for the component container element\n */\n containerStyle?: React.CSSProperties;\n /**\n * Content of the error message. If a value is provided, the form fields will be styled to show an error state\n */\n errorMessage?: React.ReactNode;\n /**\n * Content of the helper message\n */\n helperMessage?: React.ReactNode;\n isInverse?: boolean;\n /**\n * If true, label text for the form group will be hidden visually, but will still be read by assistive technology\n * @default false\n */\n isTextVisuallyHidden?: boolean;\n /**\n * ID of the element that labels the form group, used in the aria-labelledby attribute for the group. Alternatively, the labelText prop can be used\n */\n labelledById?: string;\n /**\n * Style properties for the label of the form group\n */\n labelStyle?: React.CSSProperties;\n /**\n * Content of label for form group; can be a node or a string. Alternatively, the labelledById prop can be used\n */\n labelText?: React.ReactNode;\n testId?: string;\n}\n\nexport interface FormGroupContextInterface {\n descriptionId?: string;\n hasError?: boolean;\n}\n\nexport const FormGroupContext = React.createContext<FormGroupContextInterface>({\n hasError: false,\n});\n\nconst HiddenLabel = styled.label`\n ${HiddenStyles};\n`;\n\nexport const FormGroup = React.forwardRef<HTMLDivElement, FormGroupProps>(\n (props, ref) => {\n const id = useGenerateId(props.id);\n\n const {\n containerStyle,\n errorMessage,\n helperMessage,\n labelledById,\n labelStyle,\n labelText,\n isTextVisuallyHidden,\n testId,\n children,\n ...rest\n } = props;\n const other = omit(['id'], rest);\n\n const descriptionId = errorMessage || helperMessage ? `${id}__desc` : null;\n const theme = React.useContext(ThemeContext);\n const isInverse = useIsInverse(props.isInverse);\n\n return (\n <div\n {...other}\n aria-labelledby={labelledById ? labelledById : id}\n data-testid={testId}\n ref={ref}\n role=\"group\"\n style={containerStyle}\n >\n <FormGroupContext.Provider\n value={{\n descriptionId,\n hasError: !!errorMessage,\n }}\n >\n {labelText && isTextVisuallyHidden && (\n <HiddenLabel id={id} style={labelStyle}>\n {labelText}\n </HiddenLabel>\n )}\n\n {labelText && !isTextVisuallyHidden && (\n <Label\n id={id}\n isInverse={isInverse}\n style={labelStyle}\n theme={theme}\n >\n {labelText}\n </Label>\n )}\n {children}\n\n <InputMessage\n id={descriptionId}\n hasError={!!errorMessage}\n isInverse={isInverse}\n >\n {(errorMessage || helperMessage) && (\n <>{errorMessage ? errorMessage : helperMessage}</>\n )}\n </InputMessage>\n </FormGroupContext.Provider>\n </div>\n );\n }\n);\n","import * as React from 'react';\nimport styled from '../../theme/styled';\nimport { ThemeContext } from '../../theme/ThemeContext';\n\nexport interface StyledLabelProps {\n children?: any;\n htmlFor: string;\n isInverse?: boolean;\n style?: React.CSSProperties;\n}\n\nconst StyledLabelComponent = styled.label<StyledLabelProps>`\n align-items: flex-start;\n color: ${props =>\n props.isInverse ? props.theme.colors.neutral08 : 'inherit'};\n display: flex;\n font-size: ${props => props.theme.typeScale.size03.fontSize};\n line-height: ${props => props.theme.typeScale.size03.lineHeight};\n margin: 0;\n padding: ${props => props.theme.spaceScale.spacing03} 0;\n`;\n\nexport const StyledLabel: React.FunctionComponent<StyledLabelProps> = ({\n children,\n htmlFor,\n isInverse,\n style,\n}: StyledLabelProps) => (\n <ThemeContext.Consumer>\n {theme => (\n <StyledLabelComponent\n htmlFor={htmlFor}\n isInverse={isInverse}\n style={style}\n theme={theme}\n >\n {children}\n </StyledLabelComponent>\n )}\n </ThemeContext.Consumer>\n);\n","import * as React from 'react';\nimport styled from '../../theme/styled';\n\nexport interface ContainerProps {\n children?: any;\n style?: React.CSSProperties;\n}\n\nconst StyledContainerComponent = styled.div<ContainerProps>`\n align-items: baseline;\n display: flex;\n flex-wrap: nowrap;\n position: relative;\n`;\n\nexport const StyledContainer: React.FunctionComponent<ContainerProps> = ({\n children,\n style,\n}: ContainerProps) => (\n <StyledContainerComponent style={style}>{children}</StyledContainerComponent>\n);\n","import * as React from 'react';\nimport { ThemeInterface } from '../../theme/magma';\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport { InverseContext, useIsInverse } from '../../inverse';\nimport { convertStyleValueToString } from '../../utils';\nimport styled from '@emotion/styled';\n\n/**\n * @children required\n */\nexport interface ContainerProps extends React.HTMLAttributes<HTMLDivElement> {\n isInverse?: boolean;\n /**\n * Left/right padding, set by CSS. If a number is provided, value will be in pixels\n */\n gutterWidth?: number | string;\n /**\n * Max-width of the component, set by CSS. If a number is provided, value will be in pixels\n */\n maxWidth?: number | string;\n testId?: string;\n}\n\nconst StyledContainer = styled.div<{\n gutterWidth: string;\n isInverse?: boolean;\n maxWidth: string;\n theme: ThemeInterface;\n}>`\n background: ${props =>\n props.isInverse\n ? props.theme.colors.foundation\n : props.theme.colors.neutral08};\n color: ${props =>\n props.isInverse\n ? props.theme.colors.neutral08\n : props.theme.colors.neutral};\n display: flow-root;\n margin: 0 auto;\n max-width: ${props => props.maxWidth};\n padding: ${props => `0 ${props.gutterWidth}`};\n`;\n\nexport const Container = React.forwardRef<HTMLDivElement, ContainerProps>(\n (props, ref) => {\n const theme = React.useContext(ThemeContext);\n const {\n children,\n gutterWidth = theme.spaceScale.spacing06,\n maxWidth,\n testId,\n ...other\n } = props;\n\n const gutterWidthString = convertStyleValueToString(gutterWidth);\n const maxWidthString = convertStyleValueToString(maxWidth, 'none');\n\n const isInverse = useIsInverse(props.isInverse);\n\n return (\n <InverseContext.Provider\n value={{\n isInverse,\n }}\n >\n <StyledContainer\n ref={ref}\n data-testid={testId}\n gutterWidth={gutterWidthString}\n isInverse={isInverse}\n maxWidth={maxWidthString}\n theme={theme}\n {...other}\n >\n {children}\n </StyledContainer>\n </InverseContext.Provider>\n );\n }\n);\n","import * as React from 'react';\n\nexport function useControlled({ controlled, default: defaultProp }) {\n const { current: isControlled } = React.useRef(controlled !== undefined);\n const [valueState, setValue] = React.useState(defaultProp);\n const value = isControlled ? controlled : valueState;\n\n const setValueIfUncontrolled = React.useCallback(newValue => {\n if (!isControlled) {\n setValue(newValue);\n }\n }, []);\n\n return [value, setValueIfUncontrolled];\n}\n","import { useControlled } from './useControlled';\n\nexport interface UseDataPaginationProps<PaginatedItem> {\n /**\n * Number of items per page by default when uncontrolled\n * @default 10\n */\n defaultItemsPerPage?: number;\n /**\n * Array of items to be displayed\n */\n items?: PaginatedItem[];\n /**\n * Number of items per page\n */\n itemsPerPage?: number;\n /**\n * Event that fires when the number of items per page is changed\n */\n onItemsPerPageChange?: (newRowsPerPage: number) => void;\n}\nexport interface UseDataPaginationReturn<PaginatedItem> {\n getPageItems: (page: number) => PaginatedItem[];\n itemsPerPage: number;\n length: number;\n onItemsPerPageChange: (newItemsPerPage: number) => void;\n}\n\nexport function useDataPagination<T>(\n props: UseDataPaginationProps<T> = {}\n): UseDataPaginationReturn<T> {\n const {\n defaultItemsPerPage = 10,\n items = [],\n itemsPerPage: itemsPerPageProp,\n onItemsPerPageChange,\n } = props;\n\n const [itemsPerPage, setItemsPerPageState] = useControlled({\n controlled: itemsPerPageProp,\n default: defaultItemsPerPage,\n });\n\n function handleItemsPerPageChange(newItemsPerPage: number) {\n if (!itemsPerPageProp) {\n setItemsPerPageState(newItemsPerPage);\n }\n\n onItemsPerPageChange &&\n typeof onItemsPerPageChange === 'function' &&\n onItemsPerPageChange(newItemsPerPage);\n }\n\n const getPageItems = (page: number) => {\n const isLastPage = page * itemsPerPage >= items.length;\n\n const start = (page - 1) * itemsPerPage;\n const end = isLastPage ? items.length : page * itemsPerPage;\n\n return items.slice(start, end);\n };\n\n const length = Math.ceil(items.length / itemsPerPage);\n\n return {\n getPageItems,\n itemsPerPage,\n length,\n onItemsPerPageChange: handleItemsPerPageChange,\n };\n}\n","import * as React from 'react';\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport {\n CheckboxProps,\n HiddenLabelText,\n HiddenInput,\n StyledFakeInput,\n} from '../Checkbox';\nimport {\n CheckBoxIcon,\n CheckBoxOutlineBlankIcon,\n IndeterminateCheckBoxIcon,\n} from 'react-magma-icons';\nimport { FormGroupContext } from '../FormGroup';\nimport { InputMessage } from '../Input/InputMessage';\nimport { StyledLabel } from '../SelectionControls/StyledLabel';\nimport { StyledContainer } from '../SelectionControls/StyledContainer';\nimport { useGenerateId, Omit } from '../../utils';\nimport { VisuallyHidden } from '../VisuallyHidden';\nimport { Announce } from '../Announce';\nimport { I18nContext } from '../../i18n';\nimport { useIsInverse } from '../../inverse';\n\nexport interface IndeterminateCheckboxProps\n extends Omit<CheckboxProps, 'checked'> {\n /**\n * Status of the indeterminate, three-state checkbox, which includes and indeterminate (e.g. mixed) option.\n * @default IndeterminateCheckboxStatus.unchecked\n */\n status: IndeterminateCheckboxStatus;\n testId?: string;\n}\n\nexport enum IndeterminateCheckboxStatus {\n checked = 'checked',\n indeterminate = 'indeterminate',\n unchecked = 'unchecked', //default\n}\n\nexport const IndeterminateCheckbox = React.forwardRef<\n HTMLInputElement,\n IndeterminateCheckboxProps\n>((props, ref) => {\n const [isChecked, updateIsChecked] = React.useState(\n props.status === 'indeterminate'\n ? false\n : Boolean(props.status === 'checked')\n );\n\n const id = useGenerateId(props.id);\n\n React.useEffect(() => {\n updateIsChecked(\n props.status === 'indeterminate'\n ? false\n : Boolean(props.status === 'checked')\n );\n }, [props.status]);\n\n function handleChange(event: React.ChangeEvent<HTMLInputElement>) {\n const { checked: targetChecked } = event.target;\n\n props.onChange &&\n typeof props.onChange === 'function' &&\n props.onChange(event);\n\n if (props.status !== 'indeterminate') {\n updateIsChecked(targetChecked);\n }\n }\n\n const theme = React.useContext(ThemeContext);\n const i18n = React.useContext(I18nContext);\n const context = React.useContext(FormGroupContext);\n\n const {\n color = theme.colors.primary,\n containerStyle,\n disabled,\n errorMessage,\n inputStyle,\n labelStyle,\n labelText,\n isTextVisuallyHidden,\n status,\n testId,\n ...other\n } = props;\n\n const isIndeterminate = status === 'indeterminate';\n const isUnchecked = status === 'unchecked';\n\n function replaceLabelTextForAnnounceText(baseAnnounceText) {\n return baseAnnounceText.replace(\n /\\{labelText\\}/g,\n getStringifiedLabelText(labelText)\n );\n }\n\n function getStringifiedLabelText(node) {\n if (['string', 'number'].includes(typeof node)) return node;\n if (node instanceof Array)\n return node.map(getStringifiedLabelText).join('');\n if (typeof node === 'object' && node)\n return getStringifiedLabelText(node.props.children);\n }\n\n const showAnnounce = isChecked || isIndeterminate || isUnchecked;\n const announceText = isChecked\n ? replaceLabelTextForAnnounceText(\n i18n.indeterminateCheckbox.isCheckedAnnounce\n )\n : isIndeterminate\n ? replaceLabelTextForAnnounceText(\n i18n.indeterminateCheckbox.isIndeterminateAnnounce\n )\n : isUnchecked\n ? replaceLabelTextForAnnounceText(\n i18n.indeterminateCheckbox.isUncheckedAnnounce\n )\n : '';\n\n const descriptionId = errorMessage ? `${id}__desc` : null;\n const groupDescriptionId = context.descriptionId;\n\n const describedBy =\n descriptionId && groupDescriptionId\n ? `${groupDescriptionId} ${descriptionId}`\n : descriptionId\n ? descriptionId\n : groupDescriptionId\n ? groupDescriptionId\n : null;\n\n const hasError = context.hasError || !!errorMessage;\n\n const isInverse = useIsInverse(props.isInverse);\n\n return (\n <>\n <StyledContainer style={containerStyle}>\n <HiddenInput\n {...other}\n aria-describedby={describedBy}\n checked={isChecked}\n data-testid={testId}\n disabled={disabled}\n id={id}\n ref={ref}\n type=\"checkbox\"\n onChange={handleChange}\n />\n <StyledLabel htmlFor={id} isInverse={isInverse} style={labelStyle}>\n <StyledFakeInput\n isChecked={isChecked}\n color={color}\n disabled={disabled}\n hasError={hasError}\n isIndeterminate={isIndeterminate}\n isInverse={isInverse}\n style={inputStyle}\n theme={theme}\n >\n {isIndeterminate ? (\n <IndeterminateCheckBoxIcon\n testId=\"indeterminateIcon\"\n size={theme.iconSizes.medium}\n />\n ) : isChecked ? (\n <CheckBoxIcon size={theme.iconSizes.medium} />\n ) : (\n <CheckBoxOutlineBlankIcon size={theme.iconSizes.medium} />\n )}\n </StyledFakeInput>\n {isTextVisuallyHidden ? (\n <HiddenLabelText>{labelText}</HiddenLabelText>\n ) : (\n labelText\n )}\n </StyledLabel>\n <Announce>\n {showAnnounce && <VisuallyHidden>{announceText}</VisuallyHidden>}\n </Announce>\n </StyledContainer>\n {!!errorMessage && (\n <InputMessage\n id={descriptionId}\n hasError\n isInverse={isInverse}\n style={{ paddingLeft: theme.spaceScale.spacing08 }}\n >\n {errorMessage}\n </InputMessage>\n )}\n </>\n );\n});\n","import * as React from 'react';\nimport styled from '../../theme/styled';\nimport { HiddenStyles } from '../../utils/UtilityStyles';\n\n/**\n * @children required\n */\nexport interface VisuallyHiddenProps\n extends React.HTMLAttributes<HTMLDivElement> {\n testId?: string;\n}\n\nconst VisuallyHiddenDiv = styled.div`\n ${HiddenStyles}\n`;\n\nexport const VisuallyHidden: React.FunctionComponent<VisuallyHiddenProps> = props => {\n const { children, testId, ...other } = props;\n return (\n <VisuallyHiddenDiv {...other} data-testid={testId}>\n {children}\n </VisuallyHiddenDiv>\n );\n};\n","import * as React from 'react';\nimport styled from '../../theme/styled';\nimport { useIsInverse } from '../../inverse';\nimport { ThemeContext } from '../../theme/ThemeContext';\n\n/**\n * @children required\n */\nexport interface TableProps extends React.HTMLAttributes<HTMLTableElement> {\n /**\n * Relative padding of the table cells\n * @default TableDensity.normal\n */\n density?: TableDensity;\n /**\n * If true, row will be visually highlighted on hover\n */\n hasHoverStyles?: boolean;\n /**\n * If true, columns will have vertical borders\n */\n hasVerticalBorders?: boolean;\n /**\n * If true, every other row will have a background color\n */\n hasZebraStripes?: boolean;\n isInverse?: boolean;\n /**\n * @internal\n */\n isSelectable?: boolean;\n /**\n * Minimum width for the table in pixels\n * @default 600\n */\n minWidth?: number;\n rowCount?: number;\n selectedItems?: Array<number>;\n testId?: string;\n}\n\nexport enum TableDensity {\n compact = 'compact',\n loose = 'loose',\n normal = 'normal', // default\n}\n\nexport enum TableCellAlign {\n center = 'center',\n inherit = 'inherit',\n justify = 'justify',\n left = 'left', // default\n right = 'right',\n}\n\nexport enum TableSortDirection {\n ascending = 'ascending',\n descending = 'descending',\n none = 'none', // default\n}\n\nexport enum TableRowColor {\n danger = 'danger',\n info = 'info',\n success = 'success',\n warning = 'warning',\n}\n\ninterface TableContextInterface {\n density?: TableDensity;\n hasHoverStyles?: boolean;\n hasVerticalBorders?: boolean;\n hasZebraStripes?: boolean;\n isInverse?: boolean;\n isSelectable?: boolean;\n rowCount?: number;\n selectedItems?: Array<number>;\n}\n\nexport const TableContext = React.createContext<TableContextInterface>({\n density: TableDensity.normal,\n hasHoverStyles: false,\n hasZebraStripes: false,\n hasVerticalBorders: false,\n isInverse: false,\n isSelectable: false,\n rowCount: 0,\n selectedItems: [],\n});\n\nconst TableContainer = styled.div`\n overflow-x: auto;\n`;\n\nconst StyledTable = styled.table<{ isInverse?: boolean; minWidth: number }>`\n border-collapse: collapse;\n border-spacing: 0;\n color: ${props =>\n props.isInverse\n ? props.theme.colors.neutral08\n : props.theme.colors.neutral};\n display: table;\n font-size: ${props => props.theme.typeScale.size03.fontSize};\n line-height: ${props => props.theme.typeScale.size03.lineHeight};\n min-width: ${props => props.minWidth}px;\n width: 100%;\n`;\n\nexport const Table = React.forwardRef<HTMLTableElement, TableProps>(\n (props, ref) => {\n const {\n children,\n density,\n hasHoverStyles,\n hasVerticalBorders,\n hasZebraStripes,\n isSelectable,\n minWidth,\n rowCount,\n selectedItems,\n testId,\n ...other\n } = props;\n\n const theme = React.useContext(ThemeContext);\n\n const isInverse = useIsInverse(props.isInverse);\n\n return (\n <TableContext.Provider\n value={{\n density,\n hasHoverStyles,\n hasZebraStripes,\n hasVerticalBorders,\n isInverse: isInverse,\n isSelectable,\n }}\n >\n <TableContainer>\n <StyledTable\n {...other}\n data-testid={testId}\n isInverse={isInverse}\n minWidth={minWidth || theme.breakpoints.small}\n ref={ref}\n theme={theme}\n >\n {children}\n </StyledTable>\n </TableContainer>\n </TableContext.Provider>\n );\n }\n);\n","import * as React from 'react';\n\n/**\n * @children required\n */\nexport interface TableBodyProps\n extends React.HTMLAttributes<HTMLTableSectionElement> {\n testId?: string;\n}\n\nexport const TableBody = React.forwardRef<\n HTMLTableSectionElement,\n TableBodyProps\n>((props, ref) => {\n const { children, testId, ...other } = props;\n return (\n <tbody {...other} ref={ref} data-testid={testId}>\n {children}\n </tbody>\n );\n});\n","import * as React from 'react';\nimport styled from '../../theme/styled';\nimport { css } from '@emotion/core';\nimport { TableCellAlign, TableContext, TableDensity } from './Table';\nimport { ThemeContext } from '../../theme/ThemeContext';\n\nexport interface TableCellProps\n extends React.HTMLAttributes<HTMLTableCellElement> {\n /**\n * Text alignment of the cell content. Right alignment should be used for numeric values\n * @default TableCellAlign.left\n */\n align?: TableCellAlign;\n testId?: string;\n /**\n * Width of the component, set by CSS\n * @default auto\n */\n width?: string | number;\n}\n\nexport const baseTableCellStyle = props => css`\n border-right: ${props.hasVerticalBorders ? '1px solid' : 0};\n border-color: ${props.isInverse\n ? props.theme.colors.tint04\n : props.theme.colors.neutral06};\n display: table-cell;\n font-size: inherit;\n line-height: inherit;\n padding: ${buildCellPaddingStyle(props.density, props.theme)};\n text-align: ${props.textAlign};\n\n &:last-of-type {\n border-right: 0;\n }\n`;\n\nexport function buildCellPaddingStyle(density, theme: any) {\n switch (density) {\n case 'compact':\n return `${theme.spaceScale.spacing02} ${theme.spaceScale.spacing03}`;\n case 'loose':\n return `${theme.spaceScale.spacing06} ${theme.spaceScale.spacing08}`;\n\n default:\n return `${theme.spaceScale.spacing04} ${theme.spaceScale.spacing05}`;\n }\n}\n\nconst StyledCell = styled.td<{\n density?: TableDensity;\n hasVerticalBorders?: boolean;\n isInverse?: boolean;\n textAlign?: TableCellAlign;\n theme?: any;\n width?: string;\n}>`\n ${baseTableCellStyle}\n\n ${props =>\n props.width &&\n css`\n width: ${props.width};\n `}\n`;\n\nexport const TableCell = React.forwardRef<HTMLTableCellElement, TableCellProps>(\n (props, ref) => {\n const { align, children, testId, width, ...other } = props;\n const tableContext = React.useContext(TableContext);\n const theme = React.useContext(ThemeContext);\n\n const widthString = typeof width === 'number' ? `${width}px` : width;\n\n return (\n <StyledCell\n {...other}\n data-testid={testId}\n density={tableContext.density}\n hasVerticalBorders={tableContext.hasVerticalBorders}\n isInverse={tableContext.isInverse}\n ref={ref}\n textAlign={align || TableCellAlign.left}\n theme={theme}\n width={widthString}\n >\n {children}\n </StyledCell>\n );\n }\n);\n\nTableCell.displayName = 'TableCell';\n","import * as React from 'react';\nimport styled from '../../theme/styled';\nimport { css } from '@emotion/core';\nimport { baseTableCellStyle, buildCellPaddingStyle } from './TableCell';\nimport {\n TableCellAlign,\n TableContext,\n TableDensity,\n TableSortDirection,\n} from './Table';\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport { SortDoubleArrowIcon, SouthIcon, NorthIcon } from 'react-magma-icons';\n\nexport interface TableHeaderCellProps\n extends React.HTMLAttributes<HTMLTableHeaderCellElement> {\n /**\n * Text alignment of the cell content. Right alignment should be used for numeric values\n * @default TableCellAlign.left\n */\n align?: TableCellAlign;\n /**\n * @default false\n * If true, style as a row header rather than a column header\n */\n isRowHeader?: boolean;\n /**\n * If true, the header will render a button for sorting\n */\n isSortable?: boolean;\n /**\n * Event that fires when clicking the table header cell sort button\n */\n onSort?: () => void;\n /**\n * Direction and range of data cells that are covered by the header cell\n * @default TableHeaderCellScope.col\n */\n scope?: TableHeaderCellScope;\n /**\n * Direction by which the column is sorted\n * @default TableSortDirection.none\n */\n sortDirection?: TableSortDirection;\n testId?: string;\n /**\n * Width of the component, set by CSS\n * @default auto\n */\n width?: string | number;\n}\n\nexport enum TableHeaderCellScope {\n col = 'col',\n colgroup = 'colgroup',\n row = 'row',\n rowgroup = 'rowgroup',\n}\n\nconst StyledTableHeaderCell = styled.th<{\n density?: TableDensity;\n hasVerticalBorders?: boolean;\n isInverse?: boolean;\n isRowHeader?: boolean;\n isSortable?: boolean;\n textAlign?: TableCellAlign;\n width?: string;\n}>`\n ${props => {\n return props.isRowHeader\n ? {}\n : {\n background: props.isInverse\n ? props.theme.colors.tint03\n : props.theme.colors.neutral07,\n borderBottom: '2px solid',\n fontWeight: 'bold',\n verticalAlign: 'bottom',\n };\n }}\n\n ${baseTableCellStyle}\n\n ${props =>\n props.isSortable &&\n css`\n padding: 0;\n `}\n\n ${props =>\n props.width &&\n css`\n width: ${props.width};\n `}\n`;\n\nconst SortButton = styled.button<{\n density?: TableDensity;\n isInverse?: boolean;\n textAlign?: TableCellAlign;\n}>`\n align-items: flex-end;\n background: none;\n border: 0;\n color: inherit;\n display: flex;\n justify-content: ${props =>\n props.textAlign === TableCellAlign.right ? 'flex-end' : 'flex-start'};\n margin: 0;\n padding: ${props => buildCellPaddingStyle(props.density, props.theme)}};\n text-align: left;\n width: 100%;\n\n &:focus {\n outline: 2px dotted\n ${props =>\n props.isInverse\n ? props.theme.colors.focusInverse\n : props.theme.colors.focus};\n outline-offset: -2px;\n }\n\n &:hover,\n &:focus {\n background: ${props =>\n props.isInverse ? props.theme.colors.tint : props.theme.colors.neutral06};\n\n svg {\n fill: ${props =>\n props.isInverse\n ? props.theme.colors.neutral08\n : props.theme.colors.neutral};\n }\n }\n`;\n\nconst IconWrapper = styled.span`\n padding-left: ${props => props.theme.spaceScale.spacing03};\n position: relative;\n top: ${props => props.theme.spaceScale.spacing02};\n`;\n\nexport const TableHeaderCell = React.forwardRef<\n HTMLTableCellElement,\n TableHeaderCellProps\n>((props, ref) => {\n const {\n align,\n children,\n isRowHeader = false,\n isSortable,\n onSort,\n scope = isRowHeader ? TableHeaderCellScope.row : TableHeaderCellScope.col,\n sortDirection,\n testId,\n width,\n ...other\n } = props;\n const theme = React.useContext(ThemeContext);\n const tableContext = React.useContext(TableContext);\n\n function handleSort() {\n onSort && typeof onSort === 'function' && onSort();\n }\n\n const SortIcon =\n sortDirection === TableSortDirection.ascending ? (\n <SouthIcon size={theme.iconSizes.small} />\n ) : sortDirection === TableSortDirection.descending ? (\n <NorthIcon size={theme.iconSizes.small} />\n ) : (\n <SortDoubleArrowIcon\n color={\n tableContext.isInverse\n ? theme.colors.neutral06\n : theme.colors.neutral04\n }\n size={theme.iconSizes.small}\n />\n );\n\n const widthString = typeof width === 'number' ? `${width}px` : width;\n\n return (\n <StyledTableHeaderCell\n {...other}\n data-testid={testId}\n density={tableContext.density}\n hasVerticalBorders={tableContext.hasVerticalBorders}\n isInverse={tableContext.isInverse}\n ref={ref}\n isRowHeader={isRowHeader}\n isSortable={isSortable}\n scope={scope}\n textAlign={align || TableCellAlign.left}\n theme={theme}\n width={widthString}\n >\n {isSortable ? (\n <SortButton\n density={tableContext.density}\n isInverse={tableContext.isInverse}\n onClick={handleSort}\n textAlign={align || TableCellAlign.left}\n theme={theme}\n >\n <span>{children}</span>\n <IconWrapper theme={theme}>{SortIcon}</IconWrapper>\n </SortButton>\n ) : (\n <>{children}</>\n )}\n </StyledTableHeaderCell>\n );\n});\n\nTableHeaderCell.displayName = 'TableHeaderCell';\n","import * as React from 'react';\n\n/**\n * @children required\n */\nexport interface TableHeadProps\n extends React.HTMLAttributes<HTMLTableSectionElement> {\n testId?: string;\n}\n\nexport const TableHead = React.forwardRef<\n HTMLTableSectionElement,\n TableHeadProps\n>((props, ref) => {\n const { children, testId, ...other } = props;\n return (\n <thead {...other} ref={ref} data-testid={testId}>\n {children}\n </thead>\n );\n});\n","import React from 'react';\nimport { I18nContext } from '../../i18n';\nimport { useControlled } from '../../hooks/useControlled';\n\nexport interface UsePaginationProps {\n /**\n * The total number of Pagination buttons\n * @default 1\n */\n count?: number;\n /**\n * Page selected by default when the component is uncontrolled\n */\n defaultPage?: number;\n /**\n * If true, disables all of the Pagination buttons\n * @default false\n */\n disabled?: boolean;\n /**\n * If true, hides the next page button\n * @default false\n */\n hideNextButton?: boolean;\n /**\n * If true, hides the previous page button\n * @default false\n */\n hidePreviousButton?: boolean;\n /**\n * Number of page buttons before and after the current page\n * @default 1\n */\n numberOfAdjacentPages?: number;\n /**\n * Number of page buttons at the beginning and end of the page number buttons list\n * @default 1\n */\n numberOfEdgePages?: number;\n /**\n * Event that fires when the page number changes\n */\n onPageChange?: (event: React.SyntheticEvent, newPage: number) => void;\n /**\n * Current page number\n */\n page?: number;\n /**\n * If true, shows the first page button\n * @default false\n */\n showFirstButton?: boolean;\n /**\n * If true, shows the last page button\n * @default false\n */\n showLastButton?: boolean;\n}\n\nexport function usePagination(props: Partial<UsePaginationProps> = {}) {\n const {\n count = 1,\n defaultPage = 1,\n disabled = false,\n hideNextButton = false,\n hidePreviousButton = false,\n numberOfAdjacentPages = 1,\n numberOfEdgePages = 1,\n onPageChange: handleChange,\n page: pageProp,\n showFirstButton = false,\n showLastButton = false,\n ...other\n } = props;\n\n const i18n = React.useContext(I18nContext);\n\n const [page, setPageState] = useControlled({\n controlled: pageProp,\n default: defaultPage,\n });\n\n const handleClick = (event, value) => {\n if (!pageProp) {\n setPageState(value);\n }\n\n handleChange &&\n typeof handleChange === 'function' &&\n handleChange(event, value);\n };\n\n const range = (start, end) => {\n const length = end - start + 1;\n return Array.from({ length }, (_, i) => start + i);\n };\n\n const startPages = range(1, Math.min(numberOfEdgePages, count));\n const endPages = range(\n Math.max(count - numberOfEdgePages + 1, numberOfEdgePages + 1),\n count\n );\n\n const siblingsStart = Math.max(\n Math.min(\n // Natural start\n page - numberOfAdjacentPages,\n // Lower boundary when page is high\n count - numberOfEdgePages - numberOfAdjacentPages * 2 - 1\n ),\n // Greater than startPages\n numberOfEdgePages + 2\n );\n\n const siblingsEnd = Math.min(\n Math.max(\n // Natural end\n page + numberOfAdjacentPages,\n // Upper boundary when page is low\n numberOfEdgePages + numberOfAdjacentPages * 2 + 2\n ),\n // Less than endPages\n endPages.length > 0 ? endPages[0] - 2 : count - 1\n );\n\n // Basic list of items to render\n const itemList = [\n ...(showFirstButton ? ['first'] : []),\n ...(hidePreviousButton ? [] : ['previous']),\n ...startPages,\n\n // Start ellipsis\n ...(siblingsStart > numberOfEdgePages + 2\n ? ['start-ellipsis']\n : numberOfEdgePages + 1 < count - numberOfEdgePages\n ? [numberOfEdgePages + 1]\n : []),\n\n // Sibling pages\n ...range(siblingsStart, siblingsEnd),\n\n // End ellipsis\n ...(siblingsEnd < count - numberOfEdgePages - 1\n ? ['end-ellipsis']\n : count - numberOfEdgePages > numberOfEdgePages\n ? [count - numberOfEdgePages]\n : []),\n\n ...endPages,\n ...(hideNextButton ? [] : ['next']),\n ...(showLastButton ? ['last'] : []),\n ];\n\n // Map the button type to its page number\n const buttonPage = type => {\n switch (type) {\n case 'first':\n return 1;\n case 'previous':\n return page - 1;\n case 'next':\n return page + 1;\n case 'last':\n return count;\n default:\n return null;\n }\n };\n\n // Convert the basic item list to PaginationItem props objects\n const pageButtons = itemList.map(item => {\n return typeof item === 'number'\n ? {\n onClick: event => {\n handleClick(event, item);\n },\n type: 'page',\n page: item,\n isSelected: item === page,\n disabled,\n 'aria-current': item === page ? 'true' : undefined,\n 'aria-label': `${i18n.pagination.pageButtonLabel} ${item}`,\n }\n : {\n onClick: event => {\n handleClick(event, buttonPage(item));\n },\n type: item,\n page: buttonPage(item),\n isSelected: false,\n disabled:\n disabled ||\n (item.indexOf('ellipsis') === -1 &&\n (item === 'next' || item === 'last' ? page >= count : page <= 1)),\n };\n });\n\n return {\n page,\n pageButtons,\n setPageState,\n ...other,\n };\n}\n","import React from 'react';\n\nexport function registerDescendant(\n itemRefArray: React.MutableRefObject<React.MutableRefObject<Element>[]>,\n itemRef: React.MutableRefObject<Element>\n) {\n if (\n itemRefArray.current.find(\n ({ current: item }) => item === itemRef.current\n ) == null\n ) {\n const index = itemRefArray.current.findIndex(({ current: item }) => {\n if (!item || !itemRef.current) return false;\n\n return Boolean(\n item.compareDocumentPosition(itemRef.current) &\n Node.DOCUMENT_POSITION_PRECEDING\n );\n });\n\n const newItem = itemRef;\n\n itemRefArray.current =\n index === -1\n ? [...itemRefArray.current, newItem]\n : [\n ...itemRefArray.current.slice(0, index),\n newItem,\n ...itemRefArray.current.slice(index),\n ];\n }\n}\n\nexport function unregisterDescendant(\n itemRefArray: React.MutableRefObject<React.MutableRefObject<Element>[]>,\n itemRef: React.MutableRefObject<Element>\n) {\n if (!itemRef.current) return;\n\n itemRefArray.current = itemRefArray.current.filter(\n item => itemRef.current !== item.current\n );\n}\n\nexport function useDescendants(): [\n React.MutableRefObject<React.MutableRefObject<Element>[]>,\n (\n refArray: React.MutableRefObject<React.MutableRefObject<Element>[]>,\n ref: React.MutableRefObject<Element>\n ) => void,\n (\n refArray: React.MutableRefObject<React.MutableRefObject<Element>[]>,\n ref: React.MutableRefObject<Element>\n ) => void\n] {\n const itemRefArray = React.useRef<React.MutableRefObject<Element>[]>([]);\n\n return [itemRefArray, registerDescendant, unregisterDescendant];\n}","import * as React from 'react';\nimport styled from '../../theme/styled';\nimport { useDescendants } from '../../hooks/useDescendants';\nimport { useForkedRef } from '../../utils';\n\nexport enum DropdownDropDirection {\n down = 'down', //default\n left = 'left',\n right = 'right',\n up = 'up',\n}\n\nexport enum DropdownAlignment {\n start = 'start', //default\n end = 'end',\n}\n\nexport interface DropdownProps extends React.HTMLAttributes<HTMLDivElement> {\n /**\n * Index of the item that will active/selected. If none is provided, no item will appear active\n * @default -1\n */\n activeIndex?: number;\n /**\n * Alignment of the dropdown content\n * @default `DropdownAlignment.start`\n */\n alignment?: DropdownAlignment;\n /**\n * Position of the dropdown content\n * @default `DropdownDropDirection.down`\n */\n dropDirection?: DropdownDropDirection;\n /**\n * Max-height of dropdown content\n * @default 250px\n */\n maxHeight?: string | number;\n /**\n * Function called on dropdown close before focusing the toggle button\n * @deprecated true\n */\n onBeforeShiftFocus?: (event: React.SyntheticEvent) => void;\n /**\n * Function called when closing the dropdown menu\n */\n onClose?: (event: React.SyntheticEvent) => void;\n /**\n * Function called when opening the dropdown menu\n */\n onOpen?: () => void;\n testId?: string;\n /**\n * Width of menu\n * @default Width of longest menu item\n */\n width?: string | number;\n}\n\nconst Container = styled.div`\n display: inline-block;\n position: relative;\n`;\n\ninterface DropdownContextInterface {\n activeItemIndex?: number;\n alignment?: DropdownAlignment;\n closeDropdown?: (event: React.SyntheticEvent | React.KeyboardEvent) => void;\n dropdownButtonId?: React.MutableRefObject<string>;\n dropDirection?: DropdownDropDirection;\n handleDropdownBlur?: (event: React.FocusEvent) => void;\n itemRefArray?: React.MutableRefObject<React.MutableRefObject<Element>[]>;\n isFixedWidth?: boolean;\n isOpen?: boolean;\n maxHeight?: string;\n menuRef?: any;\n openDropdown?: () => void;\n registerDropdownMenuItem: (\n itemRefArray: React.MutableRefObject<React.MutableRefObject<Element>[]>,\n itemRef: React.MutableRefObject<Element>\n ) => void;\n setActiveItemIndex?: React.Dispatch<React.SetStateAction<number>>;\n setIsOpen: React.Dispatch<React.SetStateAction<boolean>>;\n toggleRef?: any;\n width?: string;\n}\n\nexport const DropdownContext = React.createContext<DropdownContextInterface>({\n isOpen: false,\n registerDropdownMenuItem: (elements, element) => {},\n setIsOpen: () => false,\n});\n\nexport const useDropdownContext = () => React.useContext(DropdownContext);\n\nexport const Dropdown = React.forwardRef<HTMLDivElement, DropdownProps>(\n (props, forwardedRef) => {\n const {\n activeIndex,\n alignment,\n children,\n dropDirection,\n maxHeight,\n onBeforeShiftFocus,\n onClose,\n onOpen,\n testId,\n width,\n ...other\n } = props;\n\n const [isOpen, setIsOpen] = React.useState<boolean>(false);\n\n const [activeItemIndex, setActiveItemIndex] = React.useState<number>(\n activeIndex || -1\n );\n\n const ownRef = React.useRef<any>();\n const toggleRef = React.useRef<HTMLButtonElement>();\n const menuRef = React.useRef<any>([]);\n const dropdownButtonId = React.useRef<string>('');\n\n const ref = useForkedRef(forwardedRef, ownRef);\n\n const [itemRefArray, registerDropdownMenuItem] = useDescendants();\n\n React.useEffect(() => {\n if (activeIndex >= 0) {\n setActiveItemIndex(activeIndex);\n }\n }, [activeIndex]);\n\n function openDropdown() {\n const [filteredItems] = getFilteredItem();\n\n setIsOpen(true);\n\n setTimeout(() => {\n filteredItems.length > 0 &&\n filteredItems[0].current &&\n filteredItems[0].current.focus();\n }, 0);\n\n onOpen && typeof onOpen === 'function' && onOpen();\n }\n\n function closeDropdown(event) {\n setIsOpen(false);\n\n if (onBeforeShiftFocus && typeof onBeforeShiftFocus === 'function') {\n event.preventMagmaFocus = handlePreventMagmaFocus;\n onBeforeShiftFocus(event);\n }\n\n onClose && typeof onClose === 'function' && onClose(event);\n }\n\n function getFilteredItem(): [any, number] {\n const filteredItems = itemRefArray.current.filter(\n itemRef => itemRef.current\n );\n const filteredItemIndex = filteredItems\n .map(filteredItem => filteredItem.current)\n .indexOf(document.activeElement);\n\n return [filteredItems, filteredItemIndex];\n }\n\n function handleKeyDown(event: React.KeyboardEvent) {\n if (event.key === 'Escape') {\n closeDropdown(event);\n }\n\n if (event.key === 'ArrowDown') {\n const [filteredItems, filteredItemIndex] = getFilteredItem();\n\n if (filteredItems.length === 0) {\n return;\n }\n\n event.preventDefault();\n\n if (\n filteredItemIndex === -1 ||\n filteredItemIndex === filteredItems.length - 1\n ) {\n filteredItems[0].current.focus();\n } else {\n filteredItems[filteredItemIndex + 1].current.focus();\n }\n }\n\n if (event.key === 'ArrowUp') {\n const [filteredItems, filteredItemIndex] = getFilteredItem();\n\n if (filteredItems.length === 0) {\n return;\n }\n\n event.preventDefault();\n\n if (filteredItemIndex === -1 || filteredItemIndex === 0) {\n filteredItems[filteredItems.length - 1].current.focus();\n } else {\n filteredItems[filteredItemIndex - 1].current.focus();\n }\n }\n }\n\n function handleDropdownBlur(event: React.FocusEvent) {\n const { currentTarget, relatedTarget } = event;\n\n const isInMenu =\n relatedTarget && currentTarget.contains(relatedTarget as Node);\n\n if (!isInMenu && isOpen) {\n closeDropdown(event);\n }\n }\n\n function handlePreventMagmaFocus() {}\n\n const maxHeightString =\n typeof maxHeight === 'number' ? `${maxHeight}px` : maxHeight;\n\n const widthString = typeof width === 'number' ? `${width}px` : width;\n\n return (\n <DropdownContext.Provider\n value={{\n activeItemIndex,\n alignment,\n closeDropdown,\n dropdownButtonId,\n dropDirection,\n handleDropdownBlur,\n itemRefArray,\n isFixedWidth: !!width,\n isOpen,\n maxHeight: maxHeightString,\n menuRef,\n openDropdown,\n registerDropdownMenuItem,\n setActiveItemIndex,\n setIsOpen,\n toggleRef,\n width: widthString,\n }}\n >\n <Container\n {...other}\n ref={ref}\n data-testid={testId}\n onKeyDown={isOpen ? handleKeyDown : null}\n onBlur={handleDropdownBlur}\n >\n {children}\n </Container>\n </DropdownContext.Provider>\n );\n }\n);\n","import { css } from '@emotion/core';\nimport * as React from 'react';\nimport { IconButton, ButtonIconPosition } from '../IconButton';\nimport {\n ArrowDropUpIcon,\n ArrowLeftIcon,\n ArrowRightIcon,\n ArrowDropDownIcon,\n IconProps,\n} from 'react-magma-icons';\nimport { DropdownContext, DropdownDropDirection } from './Dropdown';\nimport { Omit, useForkedRef, useGenerateId, XOR } from '../../utils';\nimport { ButtonProps, ButtonSize } from '../Button';\nimport { useIsInverse } from '../../inverse';\nimport styled from '../../theme/styled';\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport { ThemeInterface } from '../../theme/magma';\n\nexport interface IconOnlyDropdownButtonProps\n extends Omit<ButtonProps, 'children'> {\n /**\n * Icon to display within the component\n */\n icon?: React.ReactElement<IconProps>;\n /**\n * The text the screen reader will announce. Required for icon-only buttons\n */\n 'aria-label': string;\n}\n\nexport interface IconTextDropdownButtonProps extends ButtonProps {\n /**\n * Icon to display within the component\n */\n icon?: React.ReactElement<IconProps>;\n /**\n * Position within the button for the icon to appear\n * @default `ButtonIconPosition.right`\n */\n iconPosition?: ButtonIconPosition;\n /**\n * The content of the component\n */\n children: React.ReactChild | React.ReactChild[];\n}\n\nexport type DropdownButtonProps = XOR<\n IconOnlyDropdownButtonProps,\n IconTextDropdownButtonProps\n>;\n\nfunction instanceOfIconOnlyDropdownButton(\n object: any\n): object is IconOnlyDropdownButtonProps {\n return 'icon' in object && !('children' in object);\n}\n\nfunction getButtonPadding(theme: ThemeInterface, size?: ButtonSize) {\n switch (size) {\n case 'small':\n return theme.spaceScale.spacing02;\n case 'large':\n return theme.spaceScale.spacing05;\n default:\n return theme.spaceScale.spacing03;\n }\n}\n\nconst StyledIconButton = styled(IconButton)`\n ${props =>\n props.iconPosition === ButtonIconPosition.right &&\n props.children &&\n css`\n padding-right: ${getButtonPadding(props.theme, props.size)};\n `}\n ${props =>\n props.iconPosition === ButtonIconPosition.left &&\n props.children &&\n css`\n padding-left: ${getButtonPadding(props.theme, props.size)};\n `}\n`;\n\nexport const DropdownButton = React.forwardRef<\n HTMLButtonElement,\n DropdownButtonProps\n>((props, forwardedRef) => {\n const context = React.useContext(DropdownContext);\n const theme = React.useContext(ThemeContext);\n\n context.dropdownButtonId.current = useGenerateId(props.id);\n\n const ref = useForkedRef(context.toggleRef, forwardedRef);\n\n function getButtonIcon(dropDirection: DropdownDropDirection) {\n switch (dropDirection) {\n case DropdownDropDirection.left:\n return <ArrowLeftIcon testId=\"caretLeft\" />;\n case DropdownDropDirection.right:\n return <ArrowRightIcon testId=\"caretRight\" />;\n case DropdownDropDirection.up:\n return <ArrowDropUpIcon testId=\"caretUp\" />;\n\n default:\n return <ArrowDropDownIcon testId=\"caretDown\" />;\n }\n }\n\n const buttonIcon = getButtonIcon(context.dropDirection);\n\n let children;\n const { icon = buttonIcon, iconPosition, ...other } = props;\n\n const isInverse = useIsInverse(props.isInverse);\n\n if (!instanceOfIconOnlyDropdownButton(props)) {\n children = props.children;\n }\n\n function handleClick(event: React.SyntheticEvent) {\n if (context.isOpen) {\n context.closeDropdown(event);\n } else {\n context.openDropdown();\n }\n }\n\n const iconPositionToUse = props.icon\n ? iconPosition\n ? iconPosition\n : ButtonIconPosition.left\n : context.dropDirection === DropdownDropDirection.left\n ? ButtonIconPosition.left\n : ButtonIconPosition.right;\n\n return (\n <StyledIconButton\n {...other}\n aria-expanded={context.isOpen}\n aria-haspopup=\"true\"\n icon={icon}\n iconPosition={iconPositionToUse}\n id={context.dropdownButtonId.current}\n isInverse={isInverse}\n onClick={handleClick}\n ref={ref}\n theme={theme}\n >\n {children}\n </StyledIconButton>\n );\n});\n","import * as React from 'react';\nimport styled from '../../theme/styled';\nimport { css } from '@emotion/core';\nimport { Card } from '../Card';\nimport {\n DropdownContext,\n DropdownAlignment,\n DropdownDropDirection,\n} from './Dropdown';\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport { useForkedRef } from '../../utils';\n\n/**\n * @children required\n */\nexport interface DropdownContentProps\n extends React.HTMLAttributes<HTMLDivElement> {\n testId?: string;\n}\n\nconst StyledCard = styled(Card)<{\n alignment?: DropdownAlignment;\n dropDirection?: DropdownDropDirection;\n isOpen?: boolean;\n maxHeight?: string;\n width?: string;\n}>`\n display: ${props => (props.isOpen ? 'block' : 'none')};\n left: ${props => props.theme.spaceScale.spacing02};\n max-height: ${props =>\n props.maxHeight ? props.maxHeight : props.theme.dropdown.content.maxHeight};\n opacity: ${props => (props.isOpen ? '1' : '0')};\n outline: 0;\n overflow-y: auto;\n padding: ${props => props.theme.spaceScale.spacing03} 0;\n position: absolute;\n transition: opacity 0.3s;\n white-space: nowrap;\n z-index: 2;\n\n ${props =>\n props.width &&\n css`\n white-space: normal;\n width: ${props.width};\n `}\n\n ${props =>\n props.dropDirection === 'up' &&\n css`\n top: auto;\n bottom: 100%;\n `}\n\n ${props =>\n props.dropDirection === 'left' &&\n css`\n left: auto;\n right: 100%;\n top: ${props.theme.spaceScale.spacing02};\n `}\n\n ${props =>\n props.dropDirection === 'right' &&\n css`\n left: 100%;\n top: ${props.theme.spaceScale.spacing02};\n `}\n\n ${props =>\n props.alignment === 'end' &&\n props.dropDirection !== 'left' &&\n props.dropDirection !== 'right' &&\n css`\n left: auto;\n right: ${props.theme.spaceScale.spacing02};\n `}\n\n ${props =>\n props.alignment === 'end' &&\n (props.dropDirection === 'left' || props.dropDirection === 'right') &&\n css`\n bottom: ${props.theme.spaceScale.spacing02};\n top: auto;\n `}\n`;\n\nconst StyledDiv = styled.div`\n padding: ${props => props.theme.spaceScale.spacing02} 0;\n`;\n\nexport const DropdownContent = React.forwardRef<\n HTMLDivElement,\n DropdownContentProps\n>((props, forwardedRef) => {\n const { children, testId, ...other } = props;\n const context = React.useContext(DropdownContext);\n const theme = React.useContext(ThemeContext);\n const ref = useForkedRef(forwardedRef, context.menuRef);\n\n return (\n <StyledCard\n {...other}\n alignment={context.alignment}\n dropDirection={context.dropDirection}\n hasDropShadow\n isInverse={false}\n isOpen={context.isOpen}\n maxHeight={context.maxHeight}\n ref={ref}\n tabIndex={-1}\n testId={testId || 'dropdownContent'}\n theme={theme}\n width={context.width}\n >\n <StyledDiv\n aria-labelledby={context.dropdownButtonId.current}\n role=\"menu\"\n theme={theme}\n >\n {children}\n </StyledDiv>\n </StyledCard>\n );\n});\n","import * as React from 'react';\nimport styled from '../../theme/styled';\nimport { ThemeContext } from '../../theme/ThemeContext';\n\nexport interface DropdownDividerProps\n extends React.HTMLAttributes<HTMLHRElement> {\n testId?: string;\n}\n\nconst StyledHr = styled.hr`\n background: ${props => props.theme.colors.neutral06};\n border: 0;\n height: 1px;\n margin: ${props => props.theme.spaceScale.spacing02} 0;\n`;\n\nexport const DropdownDivider: React.FunctionComponent<DropdownDividerProps> = (\n props: DropdownDividerProps\n) => {\n const { testId, ...other } = props;\n\n const theme = React.useContext(ThemeContext);\n return <StyledHr {...other} data-testid={testId} theme={theme} />;\n};\n","import * as React from 'react';\nimport styled from '../../theme/styled';\nimport { ThemeContext } from '../../theme/ThemeContext';\n\n/**\n * @children required\n */\nexport interface DropdownHeaderProps\n extends React.HTMLAttributes<HTMLDivElement> {\n testId?: string;\n}\n\nconst StyledDiv = styled.div`\n color: ${props => props.theme.colors.neutral03};\n font-size: ${props => props.theme.typeScale.size01.fontSize};\n letter-spacing: ${props => props.theme.typeScale.size01.letterSpacing};\n line-height: ${props => props.theme.typeScale.size01.lineHeight};\n font-weight: bold;\n margin: 0;\n padding: ${props =>\n `${props.theme.spaceScale.spacing03} ${props.theme.spaceScale.spacing05} ${props.theme.spaceScale.spacing02}`};\n text-transform: uppercase;\n`;\n\nexport const DropdownHeader = React.forwardRef<\n HTMLDivElement,\n DropdownHeaderProps\n>((props, ref) => {\n const { children, testId, ...other } = props;\n\n const theme = React.useContext(ThemeContext);\n\n return (\n <StyledDiv {...other} data-testid={testId} theme={theme}>\n {children}\n </StyledDiv>\n );\n});\n","import * as React from 'react';\nimport { css } from '@emotion/core';\nimport styled from '../../theme/styled';\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport { I18nContext } from '../../i18n';\nimport { DropdownContext } from './Dropdown';\nimport { IconProps, CheckIcon } from 'react-magma-icons';\nimport { Omit, useForkedRef } from '../../utils';\n\nexport interface DropdownMenuItemProps\n extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onClick'> {\n /**\n * Leading icon for the menu item\n */\n icon?: React.ReactElement<IconProps>;\n /**\n * @internal\n */\n index?: number;\n /**\n * @internal\n */\n isActive?: boolean;\n /**\n * If true, item will be disabled; it will appear dimmed and onClick event (or any other events) will not fire\n * @default false\n */\n disabled?: boolean;\n /**\n * Action that fires when the menu item is clicked. If the menuitem also has a value prop, the value will be passed to the onClick handler\n */\n onClick?: (value?: string | number) => void;\n /**\n * Value of the component, gets passed to the onClick event\n */\n value?: string | number;\n}\n\nexport const MenuItemStyles = props => {\n return css`\n align-items: center;\n color: ${props.disabled\n ? props.theme.colors.disabledText\n : props.theme.colors.neutral};\n cursor: ${props.disabled ? 'not-allowed' : 'pointer'};\n display: flex;\n font-size: ${props.theme.typeScale.size03.fontSize};\n line-height: ${props.theme.typeScale.size03.lineHeight};\n margin: 0;\n padding: ${props.isInactive\n ? `${props.theme.spaceScale.spacing03} ${props.theme.spaceScale.spacing05} ${props.theme.spaceScale.spacing03} ${props.theme.spaceScale.spacing11}`\n : `${props.theme.spaceScale.spacing03} ${props.theme.spaceScale.spacing05}`};\n white-space: ${props.isFixedWidth ? 'normal' : 'nowrap'};\n\n &:hover,\n &:focus {\n background: ${props.disabled ? 'none' : props.theme.colors.neutral07};\n color: ${props.disabled\n ? props.theme.colors.disabledText\n : props.theme.colors.neutral};\n }\n\n &:focus {\n outline-offset: -3px;\n }\n `;\n};\n\nconst StyledItem = styled.div<{\n as?: string;\n disabled?: boolean;\n isFixedWidth?: boolean;\n isInactive?: boolean;\n value?: string | number;\n}>`\n ${MenuItemStyles}\n`;\n\nexport const IconWrapper = styled.span`\n color: ${props => props.theme.colors.neutral03};\n display: inline-flex;\n margin-right: ${props => props.theme.spaceScale.spacing05};\n\n svg {\n height: ${props => props.theme.iconSizes.medium}px;\n width: ${props => props.theme.iconSizes.medium}px;\n }\n`;\n\nexport const DropdownMenuItem = React.forwardRef<\n HTMLDivElement,\n DropdownMenuItemProps\n>((props, forwardedRef) => {\n const { children, disabled, icon, onClick, value, ...other } = props;\n\n const ownRef = React.useRef<HTMLDivElement>();\n const theme = React.useContext(ThemeContext);\n const context = React.useContext(DropdownContext);\n\n const ref = useForkedRef(forwardedRef, ownRef);\n\n const index = context.itemRefArray.current.findIndex(({ current: item }) => {\n if (!item || !ownRef.current) return false;\n\n return item === ownRef.current;\n });\n\n function handleClick(event: React.SyntheticEvent | React.KeyboardEvent) {\n if (context.activeItemIndex >= 0) {\n context.setActiveItemIndex(index);\n }\n\n if (onClick && !disabled) {\n onClick(value);\n }\n\n if (!disabled && context.activeItemIndex < 0) {\n context.closeDropdown(event);\n }\n }\n\n function handleKeyDown(event: React.KeyboardEvent) {\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n handleClick(event);\n }\n }\n\n const isActive =\n context.activeItemIndex >= 0 && context.activeItemIndex === index;\n\n const isInactive =\n context.activeItemIndex >= 0 && context.activeItemIndex !== index;\n\n React.useEffect(() => {\n if (!disabled)\n context.registerDropdownMenuItem(context.itemRefArray, ownRef);\n }, []);\n\n const i18n = React.useContext(I18nContext);\n\n return (\n <StyledItem\n {...other}\n aria-disabled={disabled}\n disabled={disabled}\n isFixedWidth={context.isFixedWidth}\n isInactive={isInactive}\n onClick={handleClick}\n onKeyDown={handleKeyDown}\n ref={disabled ? null : ref}\n role=\"menuitem\"\n theme={theme}\n tabIndex={disabled ? null : -1}\n value={value}\n >\n {icon && <IconWrapper theme={theme}>{icon}</IconWrapper>}\n {isActive && (\n <IconWrapper theme={theme}>\n <CheckIcon aria-label={i18n.dropdown.menuItemSelectedAriaLabel} />\n </IconWrapper>\n )}\n {children}\n </StyledItem>\n );\n});\n\nDropdownMenuItem.displayName = 'DropdownMenuItem';\n","import * as React from 'react';\nimport styled from '../../theme/styled';\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport { useForkedRef, useGenerateId } from '../../utils';\nimport { usePopper } from 'react-popper';\nimport { useIsInverse } from '../../inverse';\n\nexport enum TooltipPosition {\n bottom = 'bottom',\n left = 'left',\n right = 'right',\n top = 'top', //default\n}\n\nexport const EnumTooltipPosition = TooltipPosition;\n\nexport interface TooltipProps extends React.HTMLAttributes<HTMLDivElement> {\n /**\n * Style properties for the arrow element\n */\n arrowStyle?: React.CSSProperties;\n /**\n * The element that triggers the tooltip when it is hovered or focused. Must be a react element (not a string) and should be a focusable element to meet a11y requirements\n */\n children: React.ReactElement;\n /**\n * Style properties for the component container element which includes both the tooltip trigger and the tooltip popover content\n */\n containerStyle?: React.CSSProperties;\n /**\n * The content of the tooltip\n */\n content: React.ReactNode;\n isInverse?: boolean;\n /**\n * Override the default opening of the tooltip on hover/focus to remain open\n */\n open?: boolean;\n /**\n * Position the tooltip appears in relation to its trigger\n */\n position?: TooltipPosition;\n testId?: string;\n /**\n * Style properties for the inner tooltip content\n */\n tooltipStyle?: React.CSSProperties;\n}\n\nexport interface ITooltipState {\n id?: string;\n isVisible?: boolean;\n}\n\nconst TooltipContainer = styled.div`\n display: inline;\n pointer-events: auto;\n`;\n\nexport const TooltipArrow = styled.span<{\n position?: any;\n isInverse?: boolean;\n}>`\n &&,\n &&:before {\n display: block;\n height: ${props => props.theme.tooltip.arrowSizeDoubled};\n position: absolute;\n width: ${props => props.theme.tooltip.arrowSizeDoubled};\n z-index: -1;\n }\n\n &&::before {\n content: '';\n transform: rotate(45deg);\n background: ${props =>\n props.isInverse\n ? props.theme.tooltip.inverse.backgroundColor\n : props.theme.tooltip.backgroundColor};\n }\n`;\n\nexport const StyledTooltip = styled.div<{\n isInverse?: boolean;\n isVisible?: boolean;\n position: TooltipPosition;\n visible?: boolean;\n}>`\n background: ${props =>\n props.isInverse\n ? props.theme.tooltip.inverse.backgroundColor\n : props.theme.tooltip.backgroundColor};\n border-radius: ${props => props.theme.borderRadius};\n color: ${props =>\n props.isInverse\n ? props.theme.tooltip.inverse.textColor\n : props.theme.tooltip.textColor};\n font-size: ${props => props.theme.tooltip.typeScale.fontSize};\n letter-spacing: ${props => props.theme.tooltip.typeScale.letterSpacing};\n line-height: ${props => props.theme.tooltip.typeScale.lineHeight};\n font-weight: ${props => props.theme.tooltip.fontWeight};\n max-width: ${props => props.theme.tooltip.maxWidth};\n min-height: 2.5em;\n padding: ${props => props.theme.spaceScale.spacing03}\n ${props => props.theme.spaceScale.spacing04};\n z-index: ${props => props.theme.tooltip.zIndex};\n\n &[data-popper-placement='top'] {\n margin-bottom: 14px;\n & > span:last-child {\n bottom: 10px;\n }\n }\n\n &[data-popper-placement='bottom'] {\n margin-top: 14px;\n & > span:last-child {\n top: 10px;\n }\n }\n\n &[data-popper-placement='left'] {\n margin-right: 14px;\n & > span:last-child {\n right: 10px;\n }\n }\n\n &[data-popper-placement='right'] {\n margin-left: 14px;\n & > span:last-child {\n left: 10px;\n }\n }\n`;\n\n// Using any for the ref because it is put ont he passed in children which does not have a specific type\nexport const Tooltip = React.forwardRef<any, TooltipProps>((props, ref) => {\n const [isVisible, setIsVisible] = React.useState<boolean>(props.open);\n const [referenceElement, setReferenceElement] =\n React.useState<HTMLElement>(null);\n const [popperElement, setPopperElement] =\n React.useState<HTMLDivElement>(null);\n const [arrowElement, setArrowElement] = React.useState<HTMLSpanElement>(null);\n\n const { styles, attributes } = usePopper(referenceElement, popperElement, {\n modifiers: [\n { name: 'arrow', options: { element: arrowElement } },\n {\n name: 'offset',\n options: {\n offset: [0, 0],\n },\n },\n ],\n placement: props.position || TooltipPosition.top,\n });\n\n const combinedRef = useForkedRef(ref, setReferenceElement);\n\n React.useEffect(() => {\n const handleEsc = event => {\n if (event.key === 'Escape') {\n hideTooltip();\n }\n };\n window.addEventListener('keydown', handleEsc);\n\n return () => {\n window.removeEventListener('keydown', handleEsc);\n };\n }, []);\n\n function handleKeyDown(event: React.KeyboardEvent) {\n if (event.key === 'Escape') {\n hideTooltip();\n }\n }\n\n function showTooltip() {\n setIsVisible(true);\n }\n\n function hideTooltip() {\n setIsVisible(props.open);\n }\n\n const {\n arrowStyle,\n children,\n content,\n containerStyle,\n id: defaultId,\n position,\n testId,\n tooltipStyle,\n ...other\n } = props;\n\n const id = useGenerateId(defaultId);\n const theme = React.useContext(ThemeContext);\n\n if (Array.isArray(children)) {\n throw new Error('Tooltip children can only be one element.');\n }\n\n const tooltipTrigger = React.cloneElement(children, {\n 'aria-describedby': isVisible ? id : null,\n onBlur: hideTooltip,\n onFocus: showTooltip,\n ref: combinedRef,\n });\n\n const combinedTooltipStyles = {\n ...styles.popper,\n ...tooltipStyle,\n };\n\n const combinedArrowStyle = { ...styles.arrow, ...arrowStyle };\n\n const isInverse = useIsInverse(props.isInverse);\n\n return (\n <TooltipContainer\n {...other}\n data-testid={testId}\n onKeyDown={handleKeyDown}\n onMouseLeave={hideTooltip}\n onMouseEnter={showTooltip}\n style={containerStyle}\n >\n {tooltipTrigger}\n {isVisible && (\n <div\n ref={setPopperElement}\n style={combinedTooltipStyles}\n {...attributes.popper}\n >\n <StyledTooltip\n id={id}\n isInverse={isInverse}\n position={position ? position : TooltipPosition.top}\n theme={theme}\n role=\"tooltip\"\n {...attributes.popper}\n >\n {content}\n <TooltipArrow\n isInverse={isInverse}\n ref={setArrowElement}\n style={combinedArrowStyle}\n theme={theme}\n />\n </StyledTooltip>\n </div>\n )}\n </TooltipContainer>\n );\n});\n","import * as React from 'react';\n\nimport { Button, ButtonShape, ButtonStyles, ButtonVariant } from '../Button';\nimport { IconButton } from '../IconButton';\nimport { ArrowDropUpIcon, ArrowDropDownIcon } from 'react-magma-icons';\nimport { DropdownContext, DropdownDropDirection } from './Dropdown';\nimport { I18nContext } from '../../i18n';\nimport { useForkedRef, useGenerateId } from '../../utils';\nimport { ThemeContext } from '../../theme/ThemeContext';\n\nexport interface DropdownSplitButtonProps extends ButtonStyles {\n /**\n * The text the screen reader will announce. Required for icon-only buttons\n */\n 'aria-label': string;\n /**\n * The content of the component. If no children are provided, the button will render in an icon only style\n */\n children?: any;\n /**\n * Icon to display within the component\n */\n id?: string;\n /**\n * If true, element is disabled\n */\n disabled?: boolean;\n /**\n * Function that fires when the button is clicked\n */\n onClick?: () => void;\n}\n\nexport const DropdownSplitButton = React.forwardRef<\n HTMLButtonElement,\n DropdownSplitButtonProps\n>((props, forwardedRef) => {\n const {\n 'aria-label': ariaLabel,\n children,\n id,\n variant = ButtonVariant.solid,\n onClick,\n ...other\n } = props;\n\n const context = React.useContext(DropdownContext);\n\n const theme = React.useContext(ThemeContext);\n\n const ref = useForkedRef(forwardedRef, context.toggleRef);\n\n context.dropdownButtonId.current = useGenerateId(id);\n\n const buttonIcon =\n context.dropDirection === DropdownDropDirection.up ? (\n <ArrowDropUpIcon size={theme.iconSizes.medium} testId=\"caretUp\" />\n ) : (\n <ArrowDropDownIcon size={theme.iconSizes.medium} testId=\"caretDown\" />\n );\n\n function handleClick(event: React.SyntheticEvent) {\n if (context.isOpen) {\n context.closeDropdown(event);\n } else {\n context.openDropdown();\n }\n }\n\n const i18n = React.useContext(I18nContext);\n\n return (\n <>\n <Button\n {...other}\n id={context.dropdownButtonId.current}\n onClick={onClick}\n shape={ButtonShape.leftCap}\n style={{ borderRight: 0, marginRight: 0 }}\n variant={variant}\n >\n {children}\n </Button>\n <IconButton\n {...other}\n aria-expanded={context.isOpen}\n aria-label={ariaLabel ? ariaLabel : i18n.dropdown.toggleMenuAriaLabel}\n aria-haspopup=\"true\"\n icon={buttonIcon}\n onClick={handleClick}\n shape={ButtonShape.rightCap}\n style={{\n marginLeft:\n variant === ButtonVariant.outline ? 0 : theme.spaceScale.spacing01,\n }}\n ref={ref}\n variant={variant}\n />\n </>\n );\n});\n","import * as React from 'react';\nimport { IconButton } from '../IconButton';\nimport { ButtonColor, ButtonVariant } from '../Button';\nimport { EastIcon, WestIcon } from 'react-magma-icons';\nimport { Label } from '../Label';\nimport styled from '@emotion/styled';\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport { ThemeInterface } from '../../theme/magma';\nimport { I18nContext } from '../../i18n';\nimport { useIsInverse } from '../../inverse';\nimport { usePagination } from '../Pagination/usePagination';\nimport { XOR } from '../../utils';\nimport { useControlled } from '../../hooks/useControlled';\nimport {\n Dropdown,\n DropdownAlignment,\n DropdownDropDirection,\n DropdownButton,\n DropdownContent,\n DropdownMenuItem,\n} from '../Dropdown';\n\nexport interface BaseTablePaginationProps\n extends React.HTMLAttributes<HTMLDivElement> {\n /**\n * Position of the dropdown content\n * @default `DropdownDropDirection.up`\n */\n dropdownDropDirection?: DropdownDropDirection;\n /**\n * Total number of rows\n */\n itemCount: number;\n isInverse?: boolean;\n /**\n * Event that fires when the page number changes\n */\n onPageChange?: (event: React.SyntheticEvent, newPage: number) => void;\n /**\n * Event that fires when the number of rows per page changes\n */\n onRowsPerPageChange?: (newRowsPerPage: number) => void;\n /**\n * Values added to the rows per page select\n */\n rowsPerPageValues?: number[];\n testId?: string;\n}\n\nexport interface ControlledPageProps {\n /**\n * Current page number\n */\n page?: number;\n}\n\nexport interface UncontrolledPageProps {\n /**\n * Page selected by default when the component is uncontrolled\n * @default 1\n */\n defaultPage?: number;\n}\n\nexport type PagePaginationProps = XOR<\n ControlledPageProps,\n UncontrolledPageProps\n>;\n\nexport interface ControlledRowsPerPageProps {\n /**\n * Number of rows per page\n */\n rowsPerPage?: number;\n}\n\nexport interface UncontrolledRowsPerPageProps {\n /**\n * Number of rows per page by default when component is uncontrolled\n * @default 10\n */\n defaultRowsPerPage?: number;\n}\n\nexport type RowsPaginationProps = XOR<\n ControlledRowsPerPageProps,\n UncontrolledRowsPerPageProps\n>;\n\nexport type TablePaginationProps = BaseTablePaginationProps &\n PagePaginationProps &\n RowsPaginationProps;\n\nconst StyledContainer = styled.div<{\n isInverse?: boolean;\n theme: ThemeInterface;\n}>`\n align-items: center;\n background: ${props =>\n props.isInverse ? props.theme.colors.tint03 : props.theme.colors.neutral07};\n border-top: 1px solid\n ${props =>\n props.isInverse\n ? props.theme.colors.neutral08\n : props.theme.colors.neutral06};\n display: flex;\n justify-content: flex-end;\n padding: ${props => props.theme.spaceScale.spacing02};\n`;\n\nconst PageCount = styled(Label)<{ theme: ThemeInterface }>`\n margin: 0 ${props => props.theme.spaceScale.spacing08};\n`;\n\nconst RowsPerPageLabel = styled.span`\n font-weight: 600;\n line-height: 20px;\n margin: 0 16px 0 0;\n text-align: left;\n`;\n\nexport const TablePagination = React.forwardRef<\n HTMLDivElement,\n TablePaginationProps\n>((props, ref) => {\n const {\n testId,\n defaultPage,\n defaultRowsPerPage = 10,\n dropdownDropDirection = DropdownDropDirection.up,\n itemCount,\n onPageChange,\n onRowsPerPageChange,\n page: pageProp,\n rowsPerPage: rowsPerPageProp,\n rowsPerPageValues = [10, 20, 50, 100],\n ...other\n } = props;\n\n const theme = React.useContext(ThemeContext);\n const i18n = React.useContext(I18nContext);\n\n const isInverse = useIsInverse(props.isInverse);\n\n const [rowsPerPage, setRowsPerPageState] = useControlled({\n controlled: rowsPerPageProp,\n default: defaultRowsPerPage,\n });\n\n const { page, pageButtons, setPageState } = usePagination({\n count: itemCount / rowsPerPage,\n defaultPage,\n numberOfEdgePages: 0,\n numberOfAdjacentPages: 0,\n onPageChange,\n page: pageProp,\n });\n\n const [activeIndex, setActiveIndex] = React.useState(rowsPerPage);\n const isLastPage = page * rowsPerPage >= itemCount;\n\n const displayPageStart = (page - 1) * rowsPerPage + 1;\n const displayPageEnd = isLastPage ? itemCount : page * rowsPerPage;\n\n const rowsPerPageItems = rowsPerPageValues.map(value => ({\n label: value.toString(),\n value,\n }));\n\n function handleRowsPerPageChange(value: number) {\n if (!pageProp) {\n setPageState(1);\n\n onPageChange &&\n typeof onPageChange === 'function' &&\n onPageChange({} as React.SyntheticEvent, 1);\n }\n\n if (!rowsPerPageProp) {\n setRowsPerPageState(value);\n }\n\n onRowsPerPageChange &&\n typeof onRowsPerPageChange === 'function' &&\n onRowsPerPageChange(value);\n setActiveIndex(rowsPerPage);\n }\n\n const previousButton = pageButtons[0];\n const nextButton = pageButtons[pageButtons.length - 1];\n\n return (\n <StyledContainer\n {...other}\n data-testid={testId}\n isInverse={isInverse}\n ref={ref}\n theme={theme}\n >\n <RowsPerPageLabel>\n {i18n.table.pagination.rowsPerPageLabel}:\n </RowsPerPageLabel>\n <Dropdown\n alignment={DropdownAlignment.end}\n dropDirection={dropdownDropDirection}\n activeIndex={activeIndex}\n >\n <DropdownButton\n aria-label={i18n.table.pagination.rowsPerPageLabel}\n color={ButtonColor.secondary}\n style={{ minWidth: 0 }}\n testId=\"rowPerPageDropdownButton\"\n >\n {rowsPerPageItems.find(item => item.value === rowsPerPage).label}\n </DropdownButton>\n <DropdownContent>\n {rowsPerPageItems.map((row, index) => (\n <DropdownMenuItem\n key={index}\n onClick={handleRowsPerPageChange}\n value={row.value}\n >\n {row.label}\n </DropdownMenuItem>\n ))}\n </DropdownContent>\n </Dropdown>\n\n <PageCount isInverse={isInverse} theme={theme}>\n {`${displayPageStart}-${displayPageEnd} ${i18n.table.pagination.ofLabel} ${itemCount}`}\n </PageCount>\n\n <IconButton\n aria-label={i18n.table.pagination.previousAriaLabel}\n color={ButtonColor.secondary}\n disabled={previousButton.disabled}\n icon={<WestIcon />}\n isInverse={isInverse}\n onClick={previousButton.onClick}\n testId=\"previousBtn\"\n variant={ButtonVariant.link}\n />\n <IconButton\n aria-label={i18n.table.pagination.nextAriaLabel}\n color={ButtonColor.secondary}\n disabled={nextButton.disabled}\n icon={<EastIcon />}\n isInverse={isInverse}\n onClick={nextButton.onClick}\n testId=\"nextBtn\"\n variant={ButtonVariant.link}\n />\n </StyledContainer>\n );\n});\n","import * as React from 'react';\nimport styled from '../../theme/styled';\nimport { css } from '@emotion/core';\nimport { TableContext, TableRowColor, TableCell, TableHeaderCell } from './';\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport { Checkbox } from '../Checkbox';\nimport {\n IndeterminateCheckbox,\n IndeterminateCheckboxStatus,\n} from '../IndeterminateCheckbox';\n\n/**\n * @children required\n */\nexport interface TableRowProps\n extends React.HTMLAttributes<HTMLTableRowElement> {\n /**\n * The color scheme of the table row, giving contextual meaning to the content\n */\n color?: TableRowColor;\n headerRowStatus?: IndeterminateCheckboxStatus;\n isSelected?: boolean;\n isSelectableDisabled?: boolean;\n onHeaderRowSelect?: (event: React.ChangeEvent<HTMLInputElement>) => void;\n onTableRowSelect?: (event: React.ChangeEvent<HTMLInputElement>) => void;\n rowIndex?: number;\n testId?: string;\n}\n\nfunction buildTableRowBackground(props) {\n switch (props.color) {\n case 'success':\n return props.theme.colors.success;\n case 'warning':\n return props.theme.colors.pop04;\n case 'danger':\n return props.theme.colors.danger;\n case 'info':\n return props.theme.colors.primary;\n default:\n return 'inherit';\n }\n}\n\nfunction buildTableRowColor(props) {\n if (props.color === 'warning') {\n return props.theme.colors.neutral;\n }\n\n if (props.color) {\n return props.theme.colors.neutral08;\n }\n\n return 'inherit';\n}\n\nconst StyledTableRow = styled.tr<{\n color?: string;\n hasHoverStyles?: boolean;\n hasZebraStripes?: boolean;\n isInverse?: boolean;\n}>`\n border-bottom: 1px solid\n ${props =>\n props.isInverse\n ? props.theme.colors.tint04\n : props.theme.colors.neutral06};\n color: inherit;\n display: table-row;\n outline: 0;\n vertical-align: top;\n\n &:last-child {\n border-bottom: 0;\n }\n\n ${props =>\n !props.color &&\n css`\n &:nth-of-type(even) {\n background: ${props.hasZebraStripes\n ? props.isInverse\n ? props.theme.colors.tint\n : props.theme.colors.tone\n : 'none'};\n }\n `};\n\n ${props =>\n props.hasHoverStyles &&\n !props.color &&\n css`\n &:hover {\n background: ${\n props.isInverse ? props.theme.colors.tint02 : props.theme.colors.tone02\n };\n `}\n\n ${props =>\n props.color &&\n css`\n background: ${buildTableRowBackground(props)};\n color: ${buildTableRowColor(props)};\n `};\n`;\n\nexport const TableRow = React.forwardRef<HTMLTableRowElement, TableRowProps>(\n (props, ref) => {\n const {\n children,\n headerRowStatus,\n isSelected,\n isSelectableDisabled,\n onHeaderRowSelect,\n onTableRowSelect,\n rowIndex,\n testId,\n ...other\n } = props;\n const theme = React.useContext(ThemeContext);\n const tableContext = React.useContext(TableContext);\n\n let isHeaderRow = false;\n\n React.Children.forEach(children, (child: any) => {\n if (child.type.displayName === 'TableHeaderCell') {\n isHeaderRow = true;\n return;\n }\n });\n\n function getIsCheckboxInverse() {\n if (props.color && props.color === TableRowColor.warning) {\n return false;\n }\n if (props.color && props.color !== TableRowColor.warning) {\n return true;\n }\n\n return tableContext.isInverse;\n }\n\n return (\n <StyledTableRow\n {...other}\n data-testid={testId}\n hasHoverStyles={tableContext.hasHoverStyles && !isHeaderRow}\n hasZebraStripes={tableContext.hasZebraStripes}\n isInverse={tableContext.isInverse}\n ref={ref}\n theme={theme}\n >\n {tableContext.isSelectable && isHeaderRow && (\n <TableHeaderCell width={theme.spaceScale.spacing05}>\n <IndeterminateCheckbox\n status={headerRowStatus}\n isInverse={getIsCheckboxInverse()}\n labelStyle={{ padding: 0 }}\n labelText=\"Select all rows\"\n isTextVisuallyHidden\n onChange={onHeaderRowSelect}\n />\n </TableHeaderCell>\n )}\n {tableContext.isSelectable && !isHeaderRow && (\n <TableCell\n width={theme.spaceScale.spacing05}\n style={{ verticalAlign: 'middle' }}\n >\n <Checkbox\n checked={isSelected}\n disabled={isSelectableDisabled}\n labelStyle={{ padding: 0 }}\n labelText={`Select row ${rowIndex} of ${tableContext.rowCount}`}\n isTextVisuallyHidden\n isInverse={getIsCheckboxInverse()}\n onChange={onTableRowSelect}\n />\n </TableCell>\n )}\n\n {children}\n </StyledTableRow>\n );\n }\n);\n","import * as React from 'react';\nimport { TablePagination } from '../Table';\nimport { DatagridComponents } from './Datagrid';\n\nexport const DefaultPagination = props => {\n return <TablePagination {...props} />;\n};\n\nexport function defaultComponents<T>(components: DatagridComponents) {\n return {\n Pagination: DefaultPagination,\n ...components,\n };\n}\n","import * as React from 'react';\nimport { useControlled } from '../../hooks/useControlled';\nimport { useDataPagination } from '../../hooks/useDataPagination';\nimport { XOR } from '../../utils';\nimport { IndeterminateCheckboxStatus } from '../IndeterminateCheckbox';\nimport {\n Table,\n TableBody,\n TableRow,\n TableCell,\n TableHead,\n TableHeaderCell,\n TableProps,\n TableHeaderCellProps,\n TableRowColor,\n TablePaginationProps,\n} from '../Table';\nimport { defaultComponents } from './components';\n\nexport interface DatagridColumn extends TableHeaderCellProps {\n /**\n * Unique identifier for each column\n */\n field: string;\n /**\n * Header text for each column\n */\n header: string;\n /**\n * @default false\n * Set to true if you want the column to be the header for each row\n */\n isRowHeader?: boolean;\n}\n\nexport interface DatagridRow {\n /**\n * Unique identifier for each row\n */\n id: string | number;\n /**\n * The color scheme of the table row, giving contextual meaning to the content\n */\n color?: TableRowColor;\n /**\n * If true, the select box will be disabled\n */\n isSelectableDisabled?: boolean;\n /**\n * Used to allow each unique column field as a key with the row content as the value\n */\n [key: string]: any;\n}\n\nexport interface DatagridComponents {\n Pagination?: React.FunctionComponent<TablePaginationProps>;\n}\n\nexport interface DatagridComponentsProps {\n pagination?: Partial<\n Omit<\n TablePaginationProps,\n 'page' | 'defaultPage' | 'rowsPerPage' | 'defaultRowsPerPage'\n >\n >;\n}\n\n/**\n * @children required\n */\nexport interface BaseDatagridProps extends TableProps {\n /**\n * Column data to be displayed in the table header\n */\n columns: DatagridColumn[];\n /**\n * Custom components to replace internally used components with\n * @default { Pagination }\n */\n components?: DatagridComponents;\n /**\n * Props to be passed to the default components used internally to build the datagrid\n */\n componentsProps?: DatagridComponentsProps;\n /**\n * Pass in false to turn off pagination\n * @default true\n */\n hasPagination?: boolean;\n /**\n * Row data to be displayed in each row in the table\n */\n rows: DatagridRow[];\n /**\n * Function called when the checkbox in the table header is clicked on\n */\n onHeaderSelect?: (event: React.ChangeEvent<HTMLInputElement>) => void;\n /**\n * Function called when the checkbox in each table row is clicked on\n */\n onRowSelect?: (\n id: string | number,\n event: React.ChangeEvent<HTMLInputElement>\n ) => void;\n /**\n * Function called when the rows selected in the table changes\n */\n onSelectedRowsChange?: (newSelectedRows: (string | number)[]) => void;\n /**\n * Pagination data used to create the pagination footer. Created using the usePagination hook.\n */\n paginationProps?: Partial<TablePaginationProps>;\n}\n\nexport interface ControlledSelectedRowsProps {\n /**\n * Array of rows that are selected in the table when component is controlled\n */\n selectedRows?: (string | number)[];\n}\n\nexport interface UncontrolledSelectedRowsProps {\n /**\n * Array of rows that are selected in the table on render when component is uncontrolled\n */\n defaultSelectedRows?: (string | number)[];\n}\n\nexport type DatagridSelectedRowsProps = XOR<\n ControlledSelectedRowsProps,\n UncontrolledSelectedRowsProps\n>;\n\nexport type DatagridProps = BaseDatagridProps & DatagridSelectedRowsProps;\n\nexport const Datagrid = React.forwardRef<HTMLTableElement, DatagridProps>(\n (props, ref) => {\n const {\n columns,\n components: customComponents,\n componentsProps = {},\n defaultSelectedRows = [],\n onHeaderSelect,\n onRowSelect,\n onSelectedRowsChange,\n paginationProps = {},\n rows,\n selectedRows: selectedRowsProp,\n hasPagination = true,\n ...other\n } = props;\n const [rowsToShow, setRowsToShow] = React.useState<DatagridRow[]>([]);\n const [selectedRows, updatedSelectedRows] = useControlled({\n controlled: selectedRowsProp,\n default: defaultSelectedRows,\n });\n\n const isControlled = selectedRowsProp ? true : false;\n\n const {\n getPageItems,\n itemsPerPage: rowsPerPage,\n onItemsPerPageChange,\n } = useDataPagination({\n defaultItemsPerPage: paginationProps.defaultRowsPerPage,\n items: rows,\n itemsPerPage: paginationProps.rowsPerPage,\n onItemsPerPageChange: paginationProps.onRowsPerPageChange,\n });\n\n const [currentPage, setCurrentPage] = useControlled({\n controlled: paginationProps.page,\n default: paginationProps.defaultPage || 1,\n });\n\n React.useEffect(() => {\n setRowsToShow(hasPagination ? getPageItems(currentPage) : rows);\n }, [currentPage, rowsPerPage]);\n\n const { Pagination } = defaultComponents({\n ...customComponents,\n });\n\n const { defaultPage: _, ...passedOnPaginationProps } = paginationProps;\n\n passedOnPaginationProps.page = currentPage;\n passedOnPaginationProps.itemCount = rows.length;\n passedOnPaginationProps.rowsPerPage = rowsPerPage;\n passedOnPaginationProps.onRowsPerPageChange = onItemsPerPageChange;\n passedOnPaginationProps.onPageChange = React.useCallback(\n (event, newPage: number) => {\n if (!paginationProps.page) {\n setCurrentPage(newPage);\n }\n\n paginationProps.onPageChange &&\n typeof paginationProps.onPageChange === 'function' &&\n paginationProps.onPageChange(event, newPage);\n },\n [paginationProps.onPageChange]\n );\n\n const filteredRows = rowsToShow.filter(row => !row.isSelectableDisabled);\n\n const headerRowStatus =\n selectedRows.length === filteredRows.length\n ? IndeterminateCheckboxStatus.checked\n : selectedRows.length > 0\n ? IndeterminateCheckboxStatus.indeterminate\n : IndeterminateCheckboxStatus.unchecked;\n\n function handleRowSelect(\n id: string | number,\n event: React.ChangeEvent<HTMLInputElement>\n ) {\n const { checked } = event.target;\n const newSelectedRows = [...selectedRows];\n\n checked\n ? newSelectedRows.push(id)\n : newSelectedRows.splice(newSelectedRows.indexOf(id), 1);\n\n handleSelectedRowsChange(newSelectedRows);\n\n onRowSelect &&\n typeof onRowSelect === 'function' &&\n onRowSelect(id, event);\n }\n\n function handleHeaderSelect(event: React.ChangeEvent<HTMLInputElement>) {\n if (\n headerRowStatus === IndeterminateCheckboxStatus.indeterminate ||\n headerRowStatus === IndeterminateCheckboxStatus.checked\n ) {\n handleSelectedRowsChange([]);\n } else {\n handleSelectedRowsChange(filteredRows.map(row => row.id));\n }\n\n onHeaderSelect &&\n typeof onHeaderSelect === 'function' &&\n onHeaderSelect(event);\n }\n\n function handleSelectedRowsChange(newSelectedRows) {\n if (isControlled) {\n onSelectedRowsChange &&\n typeof onSelectedRowsChange === 'function' &&\n onSelectedRowsChange(newSelectedRows);\n } else {\n updatedSelectedRows(newSelectedRows);\n }\n }\n\n return (\n <>\n <Table {...other} ref={ref}>\n <TableHead>\n <TableRow\n headerRowStatus={headerRowStatus}\n onHeaderRowSelect={handleHeaderSelect}\n >\n {columns.map(({ field, header, ...other }) => (\n <TableHeaderCell\n key={`headercell${field}`}\n {...other}\n isRowHeader={false}\n >\n {header}\n </TableHeaderCell>\n ))}\n </TableRow>\n </TableHead>\n\n <TableBody>\n {rowsToShow.map(({ id, color, isSelectableDisabled, ...other }) => (\n <TableRow\n key={`row${id}`}\n color={color}\n isSelected={\n selectedRows ? selectedRows.indexOf(id) > -1 : false\n }\n isSelectableDisabled={isSelectableDisabled}\n onTableRowSelect={event => handleRowSelect(id, event)}\n >\n {columns.map(({ field, isRowHeader }: DatagridColumn) => {\n return isRowHeader ? (\n <TableHeaderCell\n key={`cell${field}`}\n isRowHeader={isRowHeader}\n >\n {other[field]}\n </TableHeaderCell>\n ) : (\n <TableCell key={`cell${field}`}>{other[field]}</TableCell>\n );\n })}\n </TableRow>\n ))}\n </TableBody>\n </Table>\n {hasPagination && (\n <Pagination\n isInverse={props.isInverse}\n itemCount={rows.length}\n {...passedOnPaginationProps}\n {...componentsProps.pagination}\n />\n )}\n </>\n );\n }\n);\n","import * as React from 'react';\n\nexport interface CalendarContextInterface {\n chosenDate: Date;\n focusedDate: Date;\n dateFocused?: boolean;\n maxDate?: Date;\n minDate?: Date;\n helperInformationShown?: boolean;\n buildCalendarMonth: (date: Date, enableOutsideDates?: boolean) => Date[][];\n showHelperInformation: () => void;\n hideHelperInformation: () => void;\n onDateChange: (day: Date, event: React.SyntheticEvent) => void;\n onKeyDown: (event: React.KeyboardEvent) => void;\n onPrevMonthClick: () => void;\n onNextMonthClick: () => void;\n setDateFocused: (value: boolean) => void;\n}\n\nexport const CalendarContext = React.createContext<CalendarContextInterface>({\n chosenDate: new Date(),\n focusedDate: new Date(),\n buildCalendarMonth: (newDate: Date, enableOutsideDates: boolean) => [\n [newDate],\n ],\n showHelperInformation: () => {},\n hideHelperInformation: () => {},\n onDateChange: (newDate: Date, event: React.SyntheticEvent) => {},\n onKeyDown: (event: React.KeyboardEvent) => {},\n onPrevMonthClick: () => {},\n onNextMonthClick: () => {},\n setDateFocused: (value: boolean) => {},\n});\n","import {\n subDays,\n subWeeks,\n subMonths,\n addDays,\n addWeeks,\n addMonths,\n getDay,\n format,\n startOfWeek,\n endOfWeek,\n startOfMonth,\n endOfMonth,\n differenceInDays,\n} from 'date-fns';\nimport { enUS } from 'date-fns/locale';\n\nexport function handleKeyPress(\n e: React.KeyboardEvent,\n prevDate: Date,\n toggleCalendar?: (calendarOpened: boolean) => void,\n showHelperInformation?: () => void,\n onDateChange?: (day: Date) => void,\n iconRef?: React.RefObject<any>\n) {\n const { key } = e;\n\n if (key === 'Enter' || key === ' ') {\n if (!(e.target as HTMLElement).getAttribute('aria-disabled')) {\n onDateChange(prevDate);\n }\n }\n\n switch (key) {\n case 'ArrowUp':\n e.preventDefault();\n return subWeeks(prevDate, 1);\n\n case 'ArrowLeft':\n e.preventDefault();\n return subDays(prevDate, 1);\n\n case 'Home':\n e.preventDefault();\n return startOfWeek(prevDate);\n\n case 'PageUp':\n e.preventDefault();\n return subMonths(prevDate, 1);\n\n case 'ArrowDown':\n e.preventDefault();\n return addWeeks(prevDate, 1);\n\n case 'ArrowRight':\n e.preventDefault();\n return addDays(prevDate, 1);\n\n case 'End':\n e.preventDefault();\n return endOfWeek(prevDate);\n\n case 'PageDown':\n e.preventDefault();\n return addMonths(prevDate, 1);\n\n case 'Escape':\n e.preventDefault();\n toggleCalendar(false);\n iconRef.current.focus();\n break;\n\n case '?':\n e.preventDefault();\n showHelperInformation();\n break;\n\n default:\n break;\n }\n}\n\nexport function getCalendarMonthWeeks(\n month,\n enableOutsideDays,\n firstDayOfWeek = 0\n): Date[][] {\n const firstOfMonth = startOfMonth(month);\n const lastOfMonth = endOfMonth(month);\n\n const prevDays = (getDay(firstOfMonth) + 7 - firstDayOfWeek) % 7;\n const nextDays = (firstDayOfWeek + 6 - getDay(lastOfMonth)) % 7;\n const firstDay = subDays(firstOfMonth, prevDays);\n const lastDay = addDays(lastOfMonth, nextDays);\n\n const totalDays = differenceInDays(lastDay, firstDay) + 1;\n\n const currentDay = firstDay;\n const weeksInMonth = [];\n\n for (let i = 0; i < totalDays; i += 1) {\n if (i % 7 === 0) {\n weeksInMonth.push([]);\n }\n\n let day = null;\n if ((i >= prevDays && i < totalDays - nextDays) || enableOutsideDays) {\n day = addDays(currentDay, i);\n }\n\n weeksInMonth[weeksInMonth.length - 1].push(day);\n }\n\n return weeksInMonth;\n}\n\nexport function getPrevMonthFromDate(prevDate) {\n return startOfMonth(subMonths(prevDate, 1));\n}\n\nexport function getNextMonthFromDate(prevDate) {\n return startOfMonth(addMonths(prevDate, 1));\n}\n\nexport function i18nFormat(date, formatStr = 'PP', locale = enUS) {\n return (\n date &&\n format(getDateFromString(date), formatStr, {\n locale,\n })\n );\n}\n\nexport function getDateFromString(date) {\n return date ? (date instanceof Date ? date : new Date(date)) : null;\n}\n","import * as React from 'react';\nimport { Announce } from '../Announce';\nimport { CalendarContext } from './CalendarContext';\nimport { ArrowBackIcon, ArrowForwardIcon } from 'react-magma-icons';\nimport { ButtonType, ButtonVariant } from '../Button';\nimport { IconButton } from '../IconButton';\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport { addMonths, subMonths } from 'date-fns';\nimport { enUS } from 'date-fns/locale';\nimport styled from '../../theme/styled';\nimport { useForkedRef, usePrevious } from '../../utils';\nimport { i18nFormat as format } from './utils';\nimport { I18nContext } from '../../i18n';\n\ninterface CalendarHeaderProps {\n focusHeader?: boolean;\n}\n\nconst CalendarHeaderContainer = styled.div`\n align-items: center;\n display: flex;\n padding: ${props => props.theme.spaceScale.spacing10} 0\n ${props => props.theme.spaceScale.spacing03};\n margin-top: -${props => props.theme.spaceScale.spacing01};\n`;\n\nconst CalendarIconButton = styled.div<{ next?: boolean }>`\n flex-grow: 0;\n flex-width: 10%;\n flex-basis: 10%;\n order: ${props => (props.next ? 2 : 0)};\n`;\n\nconst CalendarHeaderText = styled.div`\n caption-side: initial;\n color: ${props => props.theme.colors.neutral};\n font-size: ${props => props.theme.typeScale.size03.fontSize};\n line-height: ${props => props.theme.typeScale.size03.lineHeight};\n order: 1;\n text-align: center;\n flex-grow: 0;\n flex-width: 90%;\n flex-basis: 90%;\n`;\n\nexport const CalendarHeader = React.forwardRef<\n HTMLDivElement,\n CalendarHeaderProps\n>((props, forwardedRef) => {\n const calendarHeader = React.useRef<HTMLDivElement>();\n const { focusedDate, onPrevMonthClick, onNextMonthClick } =\n React.useContext(CalendarContext);\n const prevFocusHeader = usePrevious(props.focusHeader);\n const ref = useForkedRef(forwardedRef, calendarHeader);\n\n React.useEffect(() => {\n if (!prevFocusHeader && props.focusHeader) {\n calendarHeader.current.focus();\n }\n }, [props.focusHeader]);\n\n const theme = React.useContext(ThemeContext);\n const i18n = React.useContext(I18nContext);\n\n const locale = i18n.locale || enUS;\n\n const currentMonth = format(focusedDate, 'MMMM yyyy', locale);\n\n const capitalizeCurrentMonth =\n currentMonth &&\n currentMonth.charAt(0).toUpperCase() + currentMonth.slice(1);\n\n return (\n <CalendarHeaderContainer theme={theme}>\n <CalendarHeaderText tabIndex={-1} theme={theme} ref={ref}>\n <Announce>{capitalizeCurrentMonth}</Announce>\n </CalendarHeaderText>\n <CalendarIconButton>\n <IconButton\n aria-label={`${i18n.datePicker.previousMonthAriaLabel} ${format(\n subMonths(new Date(focusedDate), 1),\n 'MMMM yyyy',\n locale\n )}`}\n icon={<ArrowBackIcon />}\n type={ButtonType.button}\n variant={ButtonVariant.link}\n onClick={onPrevMonthClick}\n />\n </CalendarIconButton>\n <CalendarIconButton next>\n <IconButton\n aria-label={`${i18n.datePicker.nextMonthAriaLabel} ${format(\n addMonths(new Date(focusedDate), 1),\n 'MMMM yyyy',\n locale\n )}`}\n icon={<ArrowForwardIcon />}\n type={ButtonType.button}\n variant={ButtonVariant.link}\n onClick={onNextMonthClick}\n />\n </CalendarIconButton>\n </CalendarHeaderContainer>\n );\n});\n","import * as React from 'react';\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport styled from '../../theme/styled';\nimport { isAfter, isBefore, isSameDay } from 'date-fns';\nimport { enUS } from 'date-fns/locale';\nimport { CalendarContext } from './CalendarContext';\nimport { I18nContext } from '../../i18n';\nimport { i18nFormat as format } from './utils';\n\ninterface CalendarDayProps {\n day: Date;\n dayFocusable?: boolean;\n onDateChange?: (day: Date, event: React.SyntheticEvent) => void;\n}\n\nconst CalendarDayCell = styled.td`\n border: 1px solid ${props => props.theme.colors.neutral06};\n color: ${props => props.theme.colors.neutral};\n font-size: ${props => props.theme.typeScale.size03.fontSize};\n line-height: ${props => props.theme.typeScale.size03.lineHeight};\n height: ${props => props.theme.spaceScale.spacing09};\n padding: 0;\n position: relative;\n text-align: center;\n width: ${props => props.theme.spaceScale.spacing09};\n`;\n\nconst CalendarDayInner = styled.button<{\n isChosen?: boolean;\n isFocused?: boolean;\n disabled?: boolean;\n}>`\n align-items: center;\n background: ${props =>\n props.isChosen\n ? props.theme.colors.foundation02\n : props.theme.colors.neutral08};\n border: 2px solid transparent;\n border-radius: 100%;\n color: ${props =>\n props.isChosen\n ? props.theme.colors.neutral08\n : props.disabled\n ? props.theme.colors.disabledText\n : props.theme.colors.neutral};\n cursor: ${props => (props.disabled ? 'not-allowed' : 'pointer')};\n display: flex;\n height: calc(${props => props.theme.spaceScale.spacing09} - 4px);\n justify-content: center;\n margin: ${props => props.theme.spaceScale.spacing01};\n overflow: hidden;\n outline-offset: 0;\n position: relative;\n transition: background 0.5s ease-in-out 0s;\n width: calc(${props => props.theme.spaceScale.spacing09} - 4px);\n\n &:focus {\n outline: 2px dotted ${props => props.theme.colors.focus};\n }\n\n &:before {\n background: ${props => props.theme.colors.neutral};\n content: '';\n height: 200%;\n left: 0;\n opacity: 0;\n position: absolute;\n top: -50%;\n transition: 0.2s;\n width: 200%;\n }\n\n &:hover {\n &:before {\n opacity: ${props => (props.disabled ? 0 : 0.1)};\n }\n }\n`;\n\nconst EmptyCell = styled.td`\n border: 0;\n padding: 0;\n`;\n\nconst TodayIndicator = styled.span`\n border-left: 8px solid ${props => props.theme.colors.pop};\n border-top: 8px solid transparent;\n border-bottom: 8px solid transparent;\n bottom: -6px;\n display: block;\n height: 0;\n position: absolute;\n transform: rotate(45deg);\n right: -2px;\n width: 0;\n`;\n\nexport const CalendarDay: React.FunctionComponent<CalendarDayProps> = (\n props: CalendarDayProps\n) => {\n const dayRef = React.useRef<HTMLButtonElement>();\n const {\n dateFocused,\n focusedDate,\n chosenDate,\n maxDate,\n minDate,\n setDateFocused,\n onDateChange,\n } = React.useContext(CalendarContext);\n const [focused, setFocused] = React.useState<boolean>(false);\n const { day, dayFocusable } = props;\n\n React.useEffect(() => {\n if (dateFocused && isSameDay(props.day, focusedDate)) {\n dayRef.current.focus();\n setFocused(true);\n } else {\n if (focused) {\n setFocused(false);\n }\n }\n }, [focusedDate, dateFocused]);\n\n function onCalendarDayFocus() {\n setDateFocused(true);\n }\n\n function onDayClick(event: React.SyntheticEvent) {\n if (disabled) {\n event.preventDefault();\n return;\n }\n\n onDateChange(day, event);\n }\n\n const disabled: boolean =\n (maxDate ? isAfter(props.day, maxDate) : false) ||\n (minDate ? isBefore(props.day, minDate) : false);\n\n const theme = React.useContext(ThemeContext);\n const i18n = React.useContext(I18nContext);\n\n if (day) {\n const sameDateAsFocusedDate = isSameDay(day, focusedDate);\n const sameDateAsChosenDate = isSameDay(day, chosenDate);\n const sameDateAsToday = isSameDay(day, new Date());\n const locale = i18n.locale || enUS;\n const ariaLabel = `${\n disabled ? i18n.datePicker.disabledDayAriaLabel : ''\n } ${format(day, 'EEEE, MMMM do yyyy', locale)} ${\n sameDateAsToday ? i18n.datePicker.todayAriaLabel : ''\n } ${sameDateAsChosenDate ? i18n.datePicker.selectedDayAriaLabel : ''}`;\n\n return (\n <CalendarDayCell onFocus={onCalendarDayFocus} theme={theme}>\n <CalendarDayInner\n aria-disabled={disabled}\n aria-label={ariaLabel}\n disabled={disabled}\n isChosen={sameDateAsChosenDate}\n isFocused={dayFocusable && sameDateAsFocusedDate}\n onClick={onDayClick}\n ref={dayRef}\n tabIndex={sameDateAsFocusedDate ? 0 : -1}\n type=\"button\"\n theme={theme}\n >\n {format(day, 'd', locale)}\n </CalendarDayInner>\n {sameDateAsToday && (\n <TodayIndicator data-testid=\"todayIndicator\" theme={theme} />\n )}\n </CalendarDayCell>\n );\n } else {\n return <EmptyCell />;\n }\n};\n","import * as React from 'react';\nimport styled from '../../theme/styled';\nimport { ButtonColor, ButtonSize, ButtonType, ButtonVariant } from '../Button';\n\nimport { IconButton } from '../IconButton';\nimport { Heading } from '../Heading';\nimport { ArrowBackIcon, CloseIcon } from 'react-magma-icons';\nimport { TypographyVisualStyle } from '../Typography';\n\nimport { I18nContext } from '../../i18n';\nimport { ThemeContext } from '../../theme/ThemeContext';\n\ninterface HelperInformationProps {\n isOpen?: boolean;\n onClose?: (event?: React.SyntheticEvent) => void;\n}\n\nconst List = styled.ul`\n list-style: none;\n margin: 0;\n padding: 0;\n text-align: left;\n`;\n\nconst Item = styled.li`\n display: flex;\n list-style: none;\n margin-bottom: 12px;\n font-size: ${props => props.theme.typeScale.size02.fontSize};\n line-height: ${props => props.theme.typeScale.size02.lineHeight};\n align-items: center;\n span {\n flex: 0 0 100px;\n overflow: hidden;\n line-height: 28px;\n min-height: 36px;\n height: max-content;\n text-align: center;\n }\n div {\n flex: 1;\n }\n`;\n\nconst KeyboardShortcutButtonWrapper = styled.span`\n background: rgb(242, 242, 242);\n font-family: monospace;\n font-size: ${props => props.theme.typeScale.size02.fontSize};\n letter-spacing: ${props => props.theme.typeScale.size02.letterSpacing};\n line-height: ${props => props.theme.typeScale.size02.lineHeight};\n margin-right: ${props => props.theme.spaceScale.spacing03};\n text-transform: uppercase;\n padding: ${props => props.theme.spaceScale.spacing02}\n ${props => props.theme.spaceScale.spacing04};\n`;\n\nconst StyledPopup = styled.div`\n position: relative;\n background: white;\n`;\n\nconst StyledNavContainer = styled.div`\n display: flex;\n justify-content: space-between;\n padding: 2px;\n`;\nconst StyledContent = styled.div`\n z-index: 9999;\n position: relative;\n background: white;\n h2 {\n margin: 10px 0 12px 0;\n }\n`;\n\nexport const HelperInformation: React.FunctionComponent<\n HelperInformationProps\n> = (props: HelperInformationProps) => {\n const i18n = React.useContext(I18nContext);\n const theme = React.useContext(ThemeContext);\n\n return (\n <StyledPopup>\n <StyledNavContainer>\n <IconButton\n icon={<ArrowBackIcon />}\n size={ButtonSize.small}\n style={{ top: '4px', left: '-12px' }}\n variant={ButtonVariant.link}\n onClick={props.onClose}\n >\n Back to Calendar\n </IconButton>\n <IconButton\n aria-label={i18n.datePicker.calendarCloseAriaLabel}\n color={ButtonColor.secondary}\n icon={<CloseIcon />}\n size={ButtonSize.medium}\n style={{ left: '16px' }}\n type={ButtonType.button}\n onClick={props.onClose}\n variant={ButtonVariant.link}\n />\n </StyledNavContainer>\n <StyledContent>\n <Heading level={2} visualStyle={TypographyVisualStyle.headingXSmall}>\n {i18n.datePicker.helpModal.header}\n </Heading>\n <List id=\"DayPickerKeyboardShortcuts_description\">\n <Item theme={theme}>\n <KeyboardShortcutButtonWrapper\n aria-label={i18n.datePicker.helpModal.enter.ariaLabel}\n role=\"img\"\n theme={theme}\n >\n ↵\n </KeyboardShortcutButtonWrapper>\n <div>{i18n.datePicker.helpModal.enter.explanation}</div>\n </Item>\n <Item theme={theme}>\n <KeyboardShortcutButtonWrapper\n role=\"img\"\n theme={theme}\n aria-label={\n i18n.datePicker.helpModal.rightAndLeftArrowKeys.ariaLabel\n }\n >\n ←/→\n </KeyboardShortcutButtonWrapper>\n <div>\n {i18n.datePicker.helpModal.rightAndLeftArrowKeys.explanation}\n </div>\n </Item>\n <Item theme={theme}>\n <KeyboardShortcutButtonWrapper\n role=\"img\"\n theme={theme}\n aria-label={\n i18n.datePicker.helpModal.upAndDownArrowKeys.ariaLabel\n }\n >\n ↑/↓\n </KeyboardShortcutButtonWrapper>\n <div>\n {i18n.datePicker.helpModal.upAndDownArrowKeys.explanation}\n </div>\n </Item>\n <Item theme={theme}>\n <KeyboardShortcutButtonWrapper\n role=\"img\"\n theme={theme}\n aria-label={\n i18n.datePicker.helpModal.pageUpAndPageDownKeys.ariaLabel\n }\n >\n {i18n.datePicker.helpModal.pageUpAndPageDownKeys.displayValue}\n </KeyboardShortcutButtonWrapper>\n <div>\n {i18n.datePicker.helpModal.pageUpAndPageDownKeys.explanation}\n </div>\n </Item>\n <Item theme={theme}>\n <KeyboardShortcutButtonWrapper\n role=\"img\"\n theme={theme}\n aria-label={i18n.datePicker.helpModal.homeAndEndKeys.ariaLabel}\n >\n {i18n.datePicker.helpModal.homeAndEndKeys.displayValue}\n </KeyboardShortcutButtonWrapper>\n <div>{i18n.datePicker.helpModal.homeAndEndKeys.explanation}</div>\n </Item>\n <Item theme={theme}>\n <KeyboardShortcutButtonWrapper\n role=\"img\"\n theme={theme}\n aria-label={i18n.datePicker.helpModal.escape.ariaLabel}\n >\n {i18n.datePicker.helpModal.escape.displayValue}\n </KeyboardShortcutButtonWrapper>\n <div>{i18n.datePicker.helpModal.escape.explanation}</div>\n </Item>\n <Item theme={theme}>\n <KeyboardShortcutButtonWrapper\n role=\"img\"\n theme={theme}\n aria-label={i18n.datePicker.helpModal.questionMark.ariaLabel}\n >\n ?\n </KeyboardShortcutButtonWrapper>\n <div>{i18n.datePicker.helpModal.questionMark.explanation}</div>\n </Item>\n </List>\n </StyledContent>\n </StyledPopup>\n );\n};\n","import * as React from 'react';\n\nexport interface FocusableElement extends HTMLElement {\n focus(options?: FocusOptions): void;\n}\n\nexport function useFocusLock(\n active: boolean,\n header?: React.MutableRefObject<FocusableElement>,\n body?: React.MutableRefObject<FocusableElement>\n): React.MutableRefObject<any> {\n const rootNode = React.useRef<HTMLElement>(null);\n const focusableItems = React.useRef<Array<HTMLElement>>([]);\n\n const updateFocusableItems = () => {\n focusableItems.current = rootNode.current?.querySelectorAll(\n 'button, [href], input, select, textarea, [tabindex]:not([tabindex=\"-1\"]), video'\n ) as unknown as Array<HTMLElement>;\n };\n\n React.useEffect(() => {\n if (active) {\n updateFocusableItems();\n\n if (header && header.current) {\n header.current.focus();\n } else if (focusableItems.current && focusableItems.current.length > 0) {\n const { 0: firstItem } = focusableItems.current;\n\n firstItem.focus();\n } else if (body && body.current) {\n (body.current.firstChild as HTMLElement).setAttribute('tabIndex', '-1');\n (body.current.firstChild as HTMLElement).focus();\n }\n }\n }, [active]);\n\n React.useEffect(() => {\n const observer: MutationObserver = new MutationObserver(() => {\n updateFocusableItems();\n });\n\n updateFocusableItems();\n\n rootNode.current &&\n observer.observe(rootNode.current, { childList: true, subtree: true });\n return () => {\n observer.disconnect();\n };\n }, [rootNode]);\n\n React.useEffect(() => {\n const handleKeyPress = (event: KeyboardEvent) => {\n if (!focusableItems.current) return;\n\n const { key, shiftKey } = event;\n const {\n length,\n 0: firstItem,\n [length - 1]: lastItem,\n } = focusableItems.current;\n\n if (active && key === 'Tab') {\n // If no focusable items are\n if (length === 0) {\n event.preventDefault();\n return;\n }\n\n // If only one item then prevent tabbing when locked\n if (length === 1) {\n event.preventDefault();\n if (firstItem !== document.activeElement) {\n firstItem.focus();\n }\n\n return;\n }\n\n // If focused on last item then focus on first item when tab is pressed\n if (!shiftKey && document.activeElement === lastItem) {\n event.preventDefault();\n firstItem.focus();\n return;\n }\n\n // If focused on first item then focus on last item when shift + tab is pressed\n if (\n shiftKey &&\n (document.activeElement === firstItem ||\n document.activeElement === header.current)\n ) {\n event.preventDefault();\n lastItem.focus();\n return;\n }\n }\n };\n\n window.addEventListener('keydown', handleKeyPress);\n\n return () => {\n window.removeEventListener('keydown', handleKeyPress);\n };\n }, [active, focusableItems]);\n\n return rootNode;\n}\n","import * as React from 'react';\nimport { ButtonColor, ButtonSize, ButtonType, ButtonVariant } from '../Button';\nimport { IconButton } from '../IconButton';\nimport { Tooltip } from '../Tooltip';\nimport { CloseIcon, KeyboardIcon } from 'react-magma-icons';\nimport { CalendarContext } from './CalendarContext';\nimport { CalendarHeader } from './CalendarHeader';\nimport { CalendarDay } from './CalendarDay';\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport styled from '../../theme/styled';\nimport { HelperInformation } from './HelperInformation';\nimport { usePrevious } from '../../utils';\nimport { I18nContext } from '../../i18n';\nimport { useFocusLock } from '../../hooks/useFocusLock';\n\ninterface CalendarMonthProps {\n calendarOpened?: boolean;\n focusOnOpen?: boolean;\n handleCloseButtonClick: (event: React.SyntheticEvent) => void;\n setDateFocused?: (value: boolean) => void;\n}\n\nconst CalendarContainer = styled.div`\n background: ${props => props.theme.colors.neutral08};\n padding: 0 ${props => props.theme.spaceScale.spacing05}\n ${props => props.theme.spaceScale.spacing03};\n overflow: visible;\n`;\n\nconst MonthContainer = styled.div`\n background: ${props => props.theme.colors.neutral08};\n text-align: center;\n user-select: none;\n vertical-align: top;\n`;\n\nconst Table = styled.table`\n border-collapse: collapse;\n border-spacing: 0;\n margin-bottom: ${props => props.theme.spaceScale.spacing03};\n`;\n\nconst Th = styled.th`\n border: 0;\n color: ${props => props.theme.colors.neutral};\n font-size: ${props => props.theme.typeScale.size02.fontSize};\n line-height: ${props => props.theme.typeScale.size02.lineHeight};\n font-weight: normal;\n padding: 0;\n text-align: center;\n`;\n\nconst HelperButton = styled.span<{ theme?: any }>`\n top: ${props => props.theme.spaceScale.spacing01};\n position: absolute;\n left: ${props => props.theme.spaceScale.spacing01};\n z-index: 2;\n`;\n\nconst CloseButton = styled.span<{ theme?: any }>`\n position: absolute;\n right: ${props => props.theme.spaceScale.spacing01};\n top: ${props => props.theme.spaceScale.spacing01};\n z-index: 1;\n`;\n\nexport const CalendarMonth: React.FunctionComponent<CalendarMonthProps> = (\n props: CalendarMonthProps\n) => {\n const lastFocus = React.useRef<any>();\n const headingRef = React.useRef<any>();\n const context = React.useContext(CalendarContext);\n const [dayFocusable, setDayFocusable] = React.useState<boolean>(false);\n const [focusHeader, setFocusHeader] = React.useState<boolean>(false);\n const prevCalendarOpened = usePrevious(props.calendarOpened);\n\n const focusTrapElement = useFocusLock(props.calendarOpened, headingRef);\n\n React.useEffect(() => {\n if (!prevCalendarOpened && props.calendarOpened) {\n lastFocus.current = document.activeElement;\n\n if (props.focusOnOpen) {\n setDayFocusable(true);\n context.setDateFocused(true);\n }\n }\n\n if (props.calendarOpened && !props.focusOnOpen && !focusHeader) {\n setFocusHeader(true);\n }\n\n if (prevCalendarOpened && !props.calendarOpened) {\n setFocusHeader(false);\n }\n }, [props.calendarOpened, props.focusOnOpen]);\n\n function onCalendarTableFocus() {\n setDayFocusable(true);\n }\n\n function onCalendarTableBlur() {\n setDayFocusable(false);\n context.setDateFocused(false);\n }\n\n function turnOffDateFocused() {\n context.setDateFocused(false);\n }\n\n const theme = React.useContext(ThemeContext);\n const i18n = React.useContext(I18nContext);\n\n const days = [\n 'sunday',\n 'monday',\n 'tuesday',\n 'wednesday',\n 'thursday',\n 'friday',\n 'saturday',\n ];\n const startOfWeek = days.indexOf(i18n.datePicker.startOfWeek);\n const sortedDays = days.slice(startOfWeek).concat(days.slice(0, startOfWeek));\n const tableDaysHeaders = sortedDays.map((day, index) => (\n <Th key={index} theme={theme}>\n {i18n.days.min[day]}\n </Th>\n ));\n\n return (\n <>\n <CalendarContainer\n data-testid=\"calendarMonthContainer\"\n tabIndex={-1}\n theme={theme}\n onKeyDown={context.onKeyDown}\n >\n {context.helperInformationShown ? (\n <HelperInformation\n isOpen={context.helperInformationShown}\n onClose={context.hideHelperInformation}\n />\n ) : (\n <MonthContainer\n data-testid=\"monthContainer\"\n data-visible=\"true\"\n theme={theme}\n ref={focusTrapElement}\n >\n <CalendarHeader ref={headingRef} focusHeader={focusHeader} />\n\n <Table\n role=\"presentation\"\n onBlur={onCalendarTableBlur}\n onFocus={onCalendarTableFocus}\n theme={theme}\n >\n <tbody>\n <tr>{tableDaysHeaders}</tr>\n {context\n .buildCalendarMonth(context.focusedDate)\n .map((week, i) => (\n <tr key={i}>\n {week.map((day, dayOfWeek) => (\n <CalendarDay\n key={dayOfWeek}\n day={day}\n dayFocusable={dayFocusable}\n onDateChange={context.onDateChange}\n />\n ))}\n </tr>\n ))}\n </tbody>\n </Table>\n <Tooltip\n content={'Keyboard instructions'}\n tooltipStyle={{ position: 'fixed' }}\n >\n <HelperButton theme={theme}>\n <IconButton\n aria-label={i18n.datePicker.helpModal.helpButtonAriaLabel}\n icon={<KeyboardIcon />}\n onClick={context.showHelperInformation}\n size={ButtonSize.small}\n onFocus={turnOffDateFocused}\n type={ButtonType.button}\n variant={ButtonVariant.link}\n />\n </HelperButton>\n </Tooltip>\n\n <CloseButton theme={theme}>\n <IconButton\n aria-label={i18n.datePicker.calendarCloseAriaLabel}\n color={ButtonColor.secondary}\n icon={<CloseIcon />}\n onClick={props.handleCloseButtonClick}\n size={ButtonSize.medium}\n type={ButtonType.button}\n variant={ButtonVariant.link}\n />\n </CloseButton>\n </MonthContainer>\n )}\n </CalendarContainer>\n </>\n );\n};\n","import * as React from 'react';\nimport styled from '../../theme/styled';\nimport { InputIconPosition, InputSize } from '../InputBase';\nimport { InputMessage } from '../Input/InputMessage';\nimport { Label } from '../Label';\nimport { VisuallyHidden } from '../VisuallyHidden';\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport { InverseContext, useIsInverse } from '../../inverse';\n\n/**\n * @children required\n */\nexport interface FormFieldContainerProps\n extends FormFieldContainerBaseProps,\n React.HTMLAttributes<HTMLDivElement> {}\n\nexport interface FormFieldContainerBaseProps {\n /**\n * Is the wrapped input hidden with display:none? This would make the input look like an actionable item, so FormFieldContainer uses a span in lieu of a label.\n */\n actionable?: boolean;\n /**\n * Style properties for the outer container\n */\n containerStyle?: React.CSSProperties;\n /**\n * Content of the error message. If a value is provided, the field will be styled as an error state and the error message will display.\n */\n errorMessage?: React.ReactNode;\n /**\n * ID of the form field. Also used in the descrption ID.\n */\n fieldId: string;\n /**\n * Content of the helper message.\n */\n helperMessage?: React.ReactNode;\n /**\n * If true, label text will be hidden visually, but will still be read by assistive technology\n * @default false\n */\n isLabelVisuallyHidden?: boolean;\n /**\n * Style properties for the label element\n */\n labelStyle?: React.CSSProperties;\n /**\n * Content for label; can be a node or a string\n */\n labelText?: React.ReactNode;\n /**\n * Style properties for the helper or error message\n */\n messageStyle?: React.CSSProperties;\n /**\n * Relative size of the component\n * @default InputSize.medium\n */\n iconPosition?: InputIconPosition;\n inputSize?: InputSize;\n testId?: string;\n isInverse?: boolean;\n}\n\nconst StyledFormFieldContainer = styled.div<{ isInverse?: boolean }>`\n color: ${props =>\n props.isInverse\n ? props.theme.colors.neutral08\n : props.theme.colors.neutral};\n`;\n\nexport const FormFieldContainer = React.forwardRef<\n HTMLDivElement,\n FormFieldContainerProps\n>((props, ref) => {\n const {\n actionable = true,\n children,\n containerStyle,\n errorMessage,\n fieldId,\n helperMessage,\n iconPosition,\n inputSize,\n isInverse: isInverseProp,\n isLabelVisuallyHidden,\n labelStyle,\n labelText,\n messageStyle,\n testId,\n ...rest\n } = props;\n const theme = React.useContext(ThemeContext);\n const isInverse = useIsInverse(isInverseProp);\n\n const descriptionId =\n errorMessage || helperMessage ? `${fieldId}__desc` : null;\n\n return (\n <InverseContext.Provider value={{ isInverse }}>\n <StyledFormFieldContainer\n {...rest}\n data-testid={props.testId}\n isInverse={isInverse}\n ref={ref}\n style={containerStyle}\n theme={theme}\n >\n {labelText && (\n <Label\n actionable={actionable}\n htmlFor={fieldId}\n iconPosition={iconPosition}\n size={inputSize}\n style={labelStyle}\n >\n {isLabelVisuallyHidden ? (\n <VisuallyHidden>{labelText}</VisuallyHidden>\n ) : (\n labelText\n )}\n </Label>\n )}\n {children}\n {(errorMessage || helperMessage) && (\n <InputMessage\n hasError={!!errorMessage}\n id={descriptionId}\n isInverse={isInverse}\n style={messageStyle}\n >\n {(errorMessage || helperMessage) && (\n <>{errorMessage ? errorMessage : helperMessage}</>\n )}\n </InputMessage>\n )}\n </StyledFormFieldContainer>\n </InverseContext.Provider>\n );\n});\n","import * as React from 'react';\nimport {\n FormFieldContainer,\n FormFieldContainerBaseProps,\n} from '../FormFieldContainer';\nimport { InputBase, InputBaseProps, InputSize } from '../InputBase';\nimport { useGenerateId } from '../../utils';\nimport { useIsInverse } from '../../inverse';\n\nexport interface InputProps\n extends Omit<FormFieldContainerBaseProps, 'fieldId'>,\n InputBaseProps {}\n\nexport const Input = React.forwardRef<HTMLInputElement, InputProps>(\n (props, ref) => {\n const {\n children,\n containerStyle,\n errorMessage,\n helperMessage,\n iconPosition,\n id: defaultId,\n inputSize = InputSize.medium,\n isLabelVisuallyHidden,\n labelStyle,\n labelText,\n messageStyle,\n ...other\n } = props;\n\n const id = useGenerateId(defaultId);\n\n const descriptionId = errorMessage || helperMessage ? `${id}__desc` : null;\n\n const isInverse = useIsInverse(props.isInverse);\n\n return (\n <FormFieldContainer\n containerStyle={containerStyle}\n errorMessage={errorMessage}\n fieldId={id}\n helperMessage={helperMessage}\n iconPosition={iconPosition}\n isLabelVisuallyHidden={isLabelVisuallyHidden}\n isInverse={isInverse}\n inputSize={inputSize}\n labelStyle={labelStyle}\n labelText={labelText}\n messageStyle={messageStyle}\n >\n <InputBase\n {...other}\n aria-describedby={\n descriptionId ? descriptionId : props['aria-describedby']\n }\n aria-invalid={!!errorMessage}\n hasError={!!errorMessage}\n iconPosition={iconPosition}\n id={id}\n inputSize={inputSize}\n isInverse={isInverse}\n ref={ref}\n >\n {children}\n </InputBase>\n </FormFieldContainer>\n );\n }\n);\n","import * as React from 'react';\nimport { CalendarContext } from './CalendarContext';\nimport { CalendarMonth } from './CalendarMonth';\nimport { Announce } from '../Announce';\nimport { Input } from '../Input';\nimport { InputType } from '../InputBase';\nimport { isAfter, isBefore, isValid, isSameDay } from 'date-fns';\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport styled from '../../theme/styled';\nimport { EventIcon } from 'react-magma-icons';\nimport { VisuallyHidden } from '../VisuallyHidden';\nimport {\n handleKeyPress,\n getCalendarMonthWeeks,\n getPrevMonthFromDate,\n getNextMonthFromDate,\n i18nFormat as format,\n getDateFromString,\n} from './utils';\nimport { omit, useGenerateId, Omit, useForkedRef } from '../../utils';\nimport { I18nContext } from '../../i18n';\nimport { InverseContext, useIsInverse } from '../../inverse';\n\nexport interface DatePickerProps\n extends Omit<\n React.InputHTMLAttributes<HTMLInputElement>,\n 'value' | 'onChange'\n > {\n /**\n * Style properties for the component container element\n */\n containerStyle?: React.CSSProperties;\n /**\n * Default selected date value\n */\n defaultDate?: Date;\n /**\n * Content of the error message. If a value is provided, the component will be styled to show an error state\n */\n errorMessage?: React.ReactNode;\n /**\n * Content of the helper message\n */\n helperMessage?: React.ReactNode;\n /**\n * Style properties for the input element\n */\n inputStyle?: React.CSSProperties;\n /**\n * Clear contents of input by clicking a clear button\n * @default false\n */\n isClearable?: boolean;\n isInverse?: boolean;\n /**\n * Style properties for the label element\n */\n labelStyle?: React.CSSProperties;\n /**\n * Text for label\n */\n labelText: React.ReactNode;\n /**\n * Maximum date allowed to be chosen in the calendar\n */\n maxDate?: Date;\n /**\n * Style properties for the helper or error message\n */\n messageStyle?: React.CSSProperties;\n /**\n * Minimum date allowed to be chosen in the calendar\n */\n minDate?: Date;\n /**\n * Text for input placeholder\n */\n placeholder?: string;\n /**\n * If true, this component must have a value\n * @default false\n */\n required?: boolean;\n testId?: string;\n /**\n * Value of the date input, used when setting the date value externally\n */\n value?: Date;\n /**\n * Event fired in multiple instances when internal values are changed and can be used as a generic state change event\n */\n onChange?: (\n value: string,\n event: React.ChangeEvent | React.SyntheticEvent\n ) => void;\n /**\n * Event that will fire when day is changed\n */\n onDateChange?: (day: Date, event: React.SyntheticEvent) => void;\n /**\n * Event that will fire when the text input loses focus\n */\n onInputBlur?: (event: React.FocusEvent) => void;\n /**\n * Event that will fire when the text input is changed\n */\n onInputChange?: (event: React.ChangeEvent) => void;\n /**\n * Event that will fire when the text input gains focus\n */\n onInputFocus?: (event: React.FocusEvent) => void;\n}\n\nconst DatePickerContainer = styled.div`\n position: relative;\n`;\n\nconst DatePickerCalendar = styled.div<{ opened: boolean }>`\n border: 1px solid ${props => props.theme.colors.neutral06};\n border-radius: ${props => props.theme.borderRadius};\n box-shadow: 0 2px 6px 0 rgba(0, 0, 0, 0.15);\n display: ${props => (props.opened ? 'block' : 'none')};\n margin-top: -${props => props.theme.spaceScale.spacing07};\n opacity: ${props => (props.opened ? '1' : '0')};\n overflow: hidden;\n position: absolute;\n transition: opacity 0.2s ease-in-out 0s;\n width: 320px;\n z-index: ${props => (props.opened ? '998' : '-1')};\n`;\n\nexport const DatePicker = React.forwardRef<HTMLInputElement, DatePickerProps>(\n (props, forwardedRef) => {\n const theme = React.useContext(ThemeContext);\n const i18n = React.useContext(I18nContext);\n const iconRef = React.useRef<HTMLButtonElement>();\n const inputRef = React.useRef<HTMLInputElement>();\n const lastFocus = React.useRef<any>();\n const id: string = useGenerateId(props.id);\n const [helperInformationShown, setHelperInformationShown] =\n React.useState<boolean>(false);\n const [calendarOpened, setCalendarOpened] = React.useState<boolean>(false);\n const [dateFocused, setDateFocused] = React.useState<boolean>(false);\n\n const [focusedDate, setFocusedDate] = React.useState<Date>(\n setDateFromConsumer(props.value || props.defaultDate) ||\n setDefaultFocusedDate()\n );\n const [chosenDate, setChosenDate] = React.useState<Date | null>(\n setDateFromConsumer(props.value || props.defaultDate)\n );\n\n const ref = useForkedRef(forwardedRef, inputRef);\n\n React.useEffect(() => {\n if (!calendarOpened) {\n setDateFocused(false);\n }\n }, [calendarOpened]);\n\n React.useEffect(() => {\n if (props.value) {\n setChosenDate(setDateFromConsumer(props.value));\n setFocusedDate(\n setDateFromConsumer(props.value) || setDefaultFocusedDate()\n );\n }\n }, [props.value]);\n\n function showHelperInformation() {\n lastFocus.current = document.activeElement;\n setHelperInformationShown(true);\n }\n\n function hideHelperInformation() {\n setHelperInformationShown(false);\n lastFocus.current.focus();\n }\n\n function setDateFromConsumer(date: Date): Date {\n const convertedDate = getDateFromString(date);\n const convertedMinDate = getDateFromString(props.minDate);\n const convertedMaxDate = getDateFromString(props.maxDate);\n\n return date &&\n inDateRange(convertedDate, convertedMinDate, convertedMaxDate)\n ? convertedDate\n : null;\n }\n\n function setDefaultFocusedDate(): Date {\n const newDate = new Date();\n const convertedMinDate = getDateFromString(props.minDate);\n const convertedMaxDate = getDateFromString(props.maxDate);\n\n if (inDateRange(newDate, convertedMinDate, convertedMaxDate)) {\n return newDate;\n } else if (convertedMaxDate || convertedMinDate) {\n return convertedMinDate ? convertedMinDate : convertedMaxDate;\n }\n }\n\n function inDateRange(\n date: Date,\n minDateValue?: Date,\n maxDateValue?: Date\n ): boolean {\n return (\n (maxDateValue\n ? isBefore(date, maxDateValue) || isSameDay(date, maxDateValue)\n : true) &&\n (minDateValue\n ? isAfter(date, minDateValue) || isSameDay(date, minDateValue)\n : true)\n );\n }\n\n function buildCalendarMonth(date: Date, enableOutsideDates: boolean) {\n const days = [\n 'sunday',\n 'monday',\n 'tuesday',\n 'wednesday',\n 'thursday',\n 'friday',\n 'saturday',\n ];\n const { startOfWeek } = i18n.datePicker;\n return getCalendarMonthWeeks(\n date,\n enableOutsideDates,\n days.indexOf(startOfWeek)\n );\n }\n\n function onPrevMonthClick() {\n setFocusedDate(getPrevMonthFromDate);\n }\n\n function onNextMonthClick() {\n setFocusedDate(getNextMonthFromDate);\n }\n\n function onDateChange(day: Date) {\n setChosenDate(day);\n setCalendarOpened(false);\n }\n\n function reset() {\n setFocusedDate(setDefaultFocusedDate());\n setChosenDate(null);\n setDateFocused(false);\n }\n\n function isValidDateFromString(value: string, day: Date) {\n const isValidDateFormat = /^\\d{1,2}\\/\\d{1,2}\\/\\d{4}$/.test(value);\n const isValidDate = isValid(day);\n\n return isValidDateFormat && isValidDate;\n }\n\n function handleInputChange(event) {\n const { value } = event.target;\n const day = new Date(value);\n setCalendarOpened(false);\n\n props.onInputChange &&\n typeof props.onInputChange === 'function' &&\n props.onInputChange(event);\n\n const isValidDay = isValidDateFromString(value, day);\n\n props.onChange &&\n typeof props.onChange === 'function' &&\n props.onChange(isValidDay ? day.toISOString() : value, event);\n }\n\n function handleInputFocus(event: React.FocusEvent) {\n props.onInputFocus &&\n typeof props.onInputFocus === 'function' &&\n props.onInputFocus(event);\n }\n\n function handleInputBlur(event: React.FocusEvent) {\n const { value } = inputRef.current;\n const day = new Date(value);\n const convertedMinDate = getDateFromString(props.minDate);\n const convertedMaxDate = getDateFromString(props.maxDate);\n\n if (\n isValidDateFromString(value, day) &&\n inDateRange(day, convertedMinDate, convertedMaxDate)\n ) {\n handleDateChange(day, event);\n } else {\n reset && typeof reset === 'function' && reset();\n }\n\n props.onInputBlur &&\n typeof props.onInputBlur === 'function' &&\n props.onInputBlur(event);\n }\n\n function handleInputKeyDown(event: React.KeyboardEvent) {\n if (event.key === 'Escape') {\n event.preventDefault();\n setCalendarOpened(false);\n inputRef.current.focus();\n }\n }\n\n function handleKeyDown(event: React.KeyboardEvent) {\n if (dateFocused && document.activeElement.closest('table')) {\n const newChosenDate = handleKeyPress(\n event,\n focusedDate,\n setCalendarOpened,\n showHelperInformation,\n onDateChange,\n iconRef\n );\n if (newChosenDate) {\n setFocusedDate(newChosenDate);\n }\n } else {\n if (event.key === 'Escape') {\n setCalendarOpened(false);\n iconRef.current.focus();\n }\n\n if (event.key === '?') {\n showHelperInformation();\n }\n }\n }\n\n function handleDateChange(\n day: Date,\n event: React.SyntheticEvent | React.ChangeEvent\n ) {\n props.onDateChange &&\n typeof props.onDateChange === 'function' &&\n props.onDateChange(day, event);\n\n props.onChange &&\n typeof props.onChange === 'function' &&\n props.onChange(day.toISOString(), event);\n\n onDateChange(day);\n setFocusedDate(day);\n }\n\n function handleDaySelection(day: Date, event: React.SyntheticEvent) {\n handleDateChange(day, event);\n inputRef.current.focus();\n }\n\n function handleCalendarBlur(event: React.SyntheticEvent) {\n const { currentTarget } = event;\n\n // timeout needed for active element to update. Browser behavior.\n // https://bugzilla.mozilla.org/show_bug.cgi?id=452307\n setTimeout(() => {\n const isInCalendar = currentTarget.contains(document.activeElement);\n\n if (!isInCalendar && !helperInformationShown) {\n setCalendarOpened(false);\n }\n }, 0);\n }\n\n function handleCloseButtonClick(event: React.SyntheticEvent) {\n iconRef.current.focus();\n setCalendarOpened(false);\n }\n\n function toggleCalendarOpened() {\n setCalendarOpened(opened => !opened);\n }\n\n const { placeholder, testId, ...rest } = props;\n const other = omit(\n ['onDateChange', 'onInputChange', 'onInputBlur', 'onInputFocus'],\n rest\n );\n\n const isInverse = useIsInverse(props.isInverse);\n\n const minDate = getDateFromString(props.minDate);\n const maxDate = getDateFromString(props.maxDate);\n\n const dateFormat = i18n.dateFormat;\n\n const inputValue = chosenDate ? format(chosenDate, dateFormat) : '';\n\n return (\n <CalendarContext.Provider\n value={{\n chosenDate,\n focusedDate,\n dateFocused,\n maxDate,\n minDate,\n helperInformationShown,\n buildCalendarMonth,\n showHelperInformation,\n hideHelperInformation,\n onKeyDown: handleKeyDown,\n onPrevMonthClick,\n onNextMonthClick,\n onDateChange: handleDaySelection,\n setDateFocused,\n }}\n >\n <DatePickerContainer data-testid={testId} onBlur={handleCalendarBlur}>\n <Announce>\n {calendarOpened && (\n <VisuallyHidden>\n {i18n.datePicker.calendarOpenAnnounce}\n </VisuallyHidden>\n )}\n </Announce>\n <Input\n {...other}\n icon={<EventIcon />}\n iconAriaLabel={i18n.datePicker.calendarIconAriaLabel}\n iconRef={iconRef}\n onIconClick={toggleCalendarOpened}\n onIconKeyDown={handleInputKeyDown}\n id={id}\n isInverse={isInverse}\n ref={ref}\n onChange={handleInputChange}\n onBlur={handleInputBlur}\n onFocus={handleInputFocus}\n onKeyDown={handleInputKeyDown}\n placeholder={placeholder ? placeholder : dateFormat.toLowerCase()}\n type={InputType.text}\n value={inputValue}\n />\n <InverseContext.Provider value={{ isInverse: false }}>\n <DatePickerCalendar\n data-testid=\"calendarContainer\"\n opened={calendarOpened}\n theme={theme}\n >\n <CalendarMonth\n focusOnOpen={\n calendarOpened && Boolean(focusedDate) && Boolean(chosenDate)\n }\n handleCloseButtonClick={handleCloseButtonClick}\n calendarOpened={calendarOpened}\n setDateFocused={setDateFocused}\n />\n </DatePickerCalendar>\n </InverseContext.Provider>\n </DatePickerContainer>\n </CalendarContext.Provider>\n );\n }\n);\n","import * as React from 'react';\nimport styled from '../../theme/styled';\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport { MenuItemStyles, IconWrapper } from './DropdownMenuItem';\nimport { DropdownContext } from './Dropdown';\nimport { IconProps } from 'react-magma-icons';\nimport { Omit, useForkedRef } from '../../utils';\n\nexport interface DropdownMenuNavItemProps\n extends Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, 'color'> {\n /**\n * Leading icon for the menu item\n */\n icon?: React.ReactElement<IconProps>;\n /**\n * The href value of the link\n */\n to: string;\n}\n\nconst StyledItem = styled.a<{\n disabled?: boolean;\n isFixedWidth?: boolean;\n isInactive?: boolean;\n}>`\n ${MenuItemStyles}\n text-decoration: none;\n`;\n\nexport const DropdownMenuNavItem = React.forwardRef<\n HTMLAnchorElement,\n DropdownMenuNavItemProps\n>((props, forwardedRef) => {\n const { children, icon, to, ...other } = props;\n\n const ownRef = React.useRef<HTMLDivElement>();\n const theme = React.useContext(ThemeContext);\n const context = React.useContext(DropdownContext);\n\n const ref = useForkedRef(forwardedRef, ownRef);\n\n React.useEffect(() => {\n context.registerDropdownMenuItem(context.itemRefArray, ownRef);\n }, []);\n\n return (\n <StyledItem\n {...other}\n href={to}\n isFixedWidth={context.isFixedWidth}\n ref={ref}\n role=\"menuitem\"\n tabIndex={-1}\n theme={theme}\n >\n {icon && <IconWrapper theme={theme}>{icon}</IconWrapper>}\n {children}\n </StyledItem>\n );\n});\n\nDropdownMenuNavItem.displayName = 'DropdownMenuNavItem';\n","import * as React from 'react';\nimport styled from '../../theme/styled';\nimport { css } from '@emotion/core';\nimport { ThemeContext } from '../../theme/ThemeContext';\n\nexport enum FlexAlignContent {\n center = 'center',\n flexStart = 'flex-start',\n flexEnd = 'flex-end',\n spaceBetween = 'space-between',\n spaceAround = 'space-around',\n stretch = 'stretch', // default\n}\n\nexport enum FlexAlignItems {\n baseline = 'baseline',\n center = 'center',\n flexStart = 'flex-start',\n flexEnd = 'flex-end',\n stretch = 'stretch', // default\n}\n\nexport enum FlexBehavior {\n container = 'container',\n item = 'item',\n both = 'both',\n}\n\nexport enum FlexDirection {\n column = 'column',\n columnReverse = 'column-reverse',\n row = 'row', // default\n rowReverse = 'row-reverse',\n}\n\nexport enum FlexJustify {\n center = 'center',\n flexStart = 'flex-start', //default\n flexEnd = 'flex-end',\n spaceBetween = 'space-between',\n spaceAround = 'space-around',\n spaceEvenly = 'space-evenly',\n}\n\nexport enum FlexWrap {\n nowrap = 'nowrap',\n wrap = 'wrap', //default\n wrapReverse = 'wrap-reverse',\n}\n\n/**\n * @children required\n */\nexport interface FlexProps extends React.HTMLAttributes<HTMLDivElement> {\n /**\n * Defines the align-content style property. It's applied for all screen sizes.\n * @default FlexAlignContent.stretch\n */\n alignContent?: FlexAlignContent;\n /**\n * Defines the align-items style property. It's applied for all screen sizes.\n * @default FlexAlignItems.stretch\n */\n alignItems?: FlexAlignItems;\n /**\n * Defines the flex behavior for the component. Options are container, item or both. You should be wrapping items with a container.\n */\n behavior: FlexBehavior;\n /**\n * Defines the flex-direction style property. It's applied for all screen sizes.\n * @default FlexDirection.row\n */\n direction?: FlexDirection;\n /**\n * If true, the component will have the flex item behavior. You should be wrapping items with a container.\n */\n justify?: FlexJustify;\n /**\n * Defines the space between the type item component. Spacing will be this number multiplied by 8px. It can only be used on a type container component.\n * @default 0\n */\n spacing?: number;\n testId?: string;\n /**\n * Defines the flex-wrap style property. It's applied for all screen sizes.\n * @default FlexWrap.wrap\n */\n wrap?: FlexWrap;\n /**\n * Defines the number of grids the component is going to use. It's applied for all the screen sizes with the lowest priority.\n * @default false\n */\n xs?: false | true | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;\n /**\n * Defines the number of grids the component is going to use. It's applied for the small breakpoint and wider screens.\n * @default false\n */\n sm?: false | true | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;\n /**\n * Defines the number of grids the component is going to use. It's applied for the medium breakpoint and wider screens.\n * @default false\n */\n md?: false | true | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;\n /**\n * Defines the number of grids the component is going to use. It's applied for the large breakpoint and wider screens.\n * @default false\n */\n lg?: false | true | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;\n /**\n * Defines the number of grids the component is going to use. It's applied for the extra-large breakpoint and wider screens.\n * @default false\n */\n xl?: false | true | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;\n}\n\nfunction getWidth(size) {\n return `${Math.round((size / 12) * 10e7) / 10e5}%`;\n}\n\nconst StyledFlex = styled.div<FlexProps>`\n ${props =>\n props.behavior !== FlexBehavior.item &&\n css`\n align-content: ${props.alignContent};\n align-items: ${props.alignItems};\n flex-direction: ${props.direction};\n display: flex;\n flex-wrap: ${props.wrap};\n justify-content: ${props.justify};\n margin: ${0 - props.spacing * 4}px;\n width: calc(100% + ${props.spacing * props.theme.spacingMultiplier}px);\n\n > div {\n padding: ${props.spacing * 4}px;\n }\n `};\n\n ${props =>\n props.behavior !== FlexBehavior.container &&\n css`\n flex-grow: ${props.xs === true ? '1' : '0'};\n flex-basis: ${props.xs === true ? '0' : getWidth(props.xs)};\n max-width: ${props.xs === true ? '100%' : getWidth(props.xs)};\n\n ${props.sm &&\n css`\n @media (min-width: ${props.theme.breakpoints.small}px) {\n flex-grow: ${props.sm === true ? '1' : '0'};\n flex-basis: ${props.sm === true ? '0' : getWidth(props.sm)};\n max-width: ${props.sm === true ? '100%' : getWidth(props.sm)};\n }\n `};\n\n ${props.md &&\n css`\n @media (min-width: ${props.theme.breakpoints.medium}px) {\n flex-grow: ${props.md === true ? '1' : '0'};\n flex-basis: ${props.md === true ? '0' : getWidth(props.md)};\n max-width: ${props.md === true ? '100%' : getWidth(props.md)};\n }\n `};\n\n ${props.lg &&\n css`\n @media (min-width: ${props.theme.breakpoints.large}px) {\n flex-grow: ${props.lg === true ? '1' : '0'};\n flex-basis: ${props.lg === true ? '0' : getWidth(props.lg)};\n max-width: ${props.lg === true ? '100%' : getWidth(props.lg)};\n }\n `};\n\n ${props.xl &&\n css`\n @media (min-width: ${props.theme.breakpoints.xl}px) {\n flex-grow: ${props.xl === true ? '1' : '0'};\n flex-basis: ${props.xl === true ? '0' : getWidth(props.xl)};\n max-width: ${props.xl === true ? '100%' : getWidth(props.xl)};\n }\n `};\n `};\n`;\n\nexport const Flex = React.forwardRef<HTMLDivElement, FlexProps>(\n (props, ref) => {\n const {\n children,\n alignContent = FlexAlignContent.stretch,\n alignItems = FlexAlignItems.stretch,\n direction = FlexDirection.row,\n justify = FlexJustify.flexStart,\n spacing = 0,\n testId,\n wrap = FlexWrap.wrap,\n ...other\n } = props;\n\n const theme = React.useContext(ThemeContext);\n\n return (\n <StyledFlex\n {...other}\n alignContent={alignContent}\n alignItems={alignItems}\n data-testid={testId}\n direction={direction}\n justify={justify}\n ref={ref}\n spacing={spacing}\n theme={theme}\n wrap={wrap}\n >\n {children}\n </StyledFlex>\n );\n }\n);\n","import * as React from 'react';\nimport styled from '../../theme/styled';\nimport { css } from '@emotion/core';\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport { magma, ThemeInterface } from '../../theme/magma';\nimport { TypographyVisualStyle, TypographyComponent } from '../Typography';\nimport { InverseContext, useIsInverse } from '../../inverse';\n\n/**\n * @children required\n */\nexport interface ListProps extends React.HTMLAttributes<HTMLDivElement> {\n description?: boolean;\n /**\n * Allows an ordered list to start at a determined value of a letter or number.\n */\n hasStart?: string;\n /**\n * For use with inline icons within list items.\n */\n icon?: React.ReactElement<any> | React.ReactElement<any>[];\n /**\n * Aligns the icon at the top, or center of each list item.\n */\n iconAlign?: IconAlignment;\n /**\n * Sizes the icon between small, medium, and large.\n * @default 'medium'\n *\n */\n iconSize?: IconSizes;\n isInverse?: boolean;\n /**\n * @default false\n */\n isOrdered?: boolean;\n /**\n * If list is ordered, then this allows the list to reverse the content.\n * @default false\n */\n isReversed?: boolean;\n /**\n * Options for list type bullet formatting.\n */\n listType?: ulListType | olListType;\n /**\n * Adds a bottom margin to each list item with the Magma space scale.\n */\n spacingStyle?: keyof typeof magma.spaceScale;\n testId?: string;\n /**\n * @internal\n */\n theme?: ThemeInterface;\n /**\n * Applies visual styles including font-size, font-weight, line-height and margins\n * @default TypographyVisualStyle.bodyMedium\n */\n\n visualStyle?: TypographyVisualStyle;\n}\n\nexport enum IconSizes {\n small = 'small',\n medium = 'medium',\n large = 'large',\n}\n\nexport enum IconAlignment {\n center = 'center',\n top = 'top',\n}\n\nexport enum ulListType {\n circle = 'circle',\n disc = 'disc',\n square = 'square',\n}\n\nexport enum olListType {\n lowercase = 'a',\n uppercase = 'A',\n lowercaseRoman = 'i',\n uppercaseRoman = 'I',\n numbers = '1',\n}\n\nexport function getIconSizes(props) {\n switch (props.iconSize) {\n case IconSizes.small:\n return props.theme.iconSizes.small;\n case IconSizes.large:\n return props.theme.iconSizes.large;\n default:\n return props.theme.iconSizes.medium;\n }\n}\n\nexport function getListAlignment(props) {\n switch (props.iconAlign) {\n case IconAlignment.center:\n return `center`;\n case IconAlignment.top:\n return `flex-start`;\n default:\n return `center`;\n }\n}\n\nexport function getListDisplay(props) {\n if (props.icon) {\n return 'grid';\n }\n return 'list-item';\n}\n\nconst ListStyles = props => css`\n margin: 0;\n padding: 0;\n list-style-type: ${props.listType};\n color: ${props.isInverse\n ? props.theme.colors.neutral08\n : props.theme.colors.neutral};\n li {\n align-items: ${getListAlignment(props)};\n margin-bottom: ${props.spacingStyle};\n grid-template-areas: 'a b';\n grid-template-columns: auto 1fr;\n }\n span {\n margin: ${props.iconSize === 'small'\n ? '0 16px 0 0'\n : props.iconSize === 'large'\n ? '0 26px 0 0'\n : '0 18px 0 0'};\n }\n p {\n font-size: 0.8em;\n font-weight: 400;\n margin-bottom: 8px;\n margin-left: 0;\n grid-template: 'b';\n grid-column-start: 2;\n }\n svg {\n height: ${getIconSizes(props)}px;\n width: ${getIconSizes(props)}px;\n }\n`;\n\nconst StyledList = styled(TypographyComponent)`\n ${ListStyles};\n`;\n\nexport const List = React.forwardRef<HTMLDivElement, ListProps>(\n (props, ref) => {\n const {\n children,\n color,\n description,\n testId,\n hasStart,\n icon,\n iconAlign,\n iconSize,\n isInverse: isInverseProp,\n isOrdered,\n isReversed,\n listType,\n spacingStyle,\n visualStyle,\n ...rest\n } = props;\n const theme = React.useContext(ThemeContext);\n const isInverse = useIsInverse(isInverseProp);\n\n return (\n <InverseContext.Provider value={{ isInverse }}>\n <StyledList\n as={isOrdered ? 'ol' : 'ul'}\n data-testid={props.testId}\n description={description}\n icon={icon}\n iconAlign={iconAlign}\n iconSize={iconSize}\n isInverse={isInverse}\n type={listType ? listType : 'inherit'}\n reversed={isReversed}\n ref={ref}\n spacingStyle={magma.spaceScale[spacingStyle] || spacingStyle}\n start={hasStart}\n theme={theme}\n visualStyle={\n visualStyle ? visualStyle : TypographyVisualStyle.bodyMedium\n }\n {...rest}\n >\n {children}\n </StyledList>\n </InverseContext.Provider>\n );\n }\n);\n","import * as React from 'react';\nimport { useIsInverse } from '../../inverse';\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport {\n TypographyVisualStyle,\n TypographyColor,\n TypographyContextVariant,\n TypographyComponent,\n} from '../Typography';\n\n/**\n * @children required\n */\nexport interface ParagraphProps\n extends React.HTMLAttributes<HTMLParagraphElement> {\n /**\n * The color of the component, helping to convey meaning or relative emphasis\n * @default TypographyColor.default\n */\n color?: TypographyColor;\n /**\n * Additional styles for typography based on the context of the content\n * @default TypographyContextVariant.default\n */\n contextVariant?: TypographyContextVariant;\n isInverse?: boolean;\n /**\n * If true, the component will not have the default top and bottom margin and instead will a margin value of 0\n * @default false\n */\n noMargins?: boolean;\n testId?: string;\n /**\n * @internal\n */\n theme?: any;\n /**\n * Applies visual styles including font-size, font-weight, line-height and margins\n * @default TypographyVisualStyle.bodyMedium\n */\n visualStyle?: TypographyVisualStyle;\n}\n\nexport const Paragraph = React.forwardRef<HTMLParagraphElement, ParagraphProps>(\n (props, ref) => {\n const { color, testId, visualStyle, children, ...other } = props;\n const theme = React.useContext(ThemeContext);\n\n return (\n <TypographyComponent\n {...other}\n color={color || TypographyColor.default}\n data-testid={testId}\n isInverse={useIsInverse(props.isInverse)}\n ref={ref}\n theme={theme}\n visualStyle={visualStyle || TypographyVisualStyle.bodyMedium}\n >\n {children}\n </TypographyComponent>\n );\n }\n);\n","import * as React from 'react';\nimport { Alert } from '../Alert';\nimport { AlertVariant } from '../AlertBase';\nimport { Heading } from '../Heading';\nimport { Paragraph } from '../Paragraph';\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport { ThemeInterface } from '../../theme/magma';\nimport { InverseContext, useIsInverse } from '../../inverse';\nimport styled from '@emotion/styled';\nimport { TypographyContextVariant, TypographyVisualStyle } from '../Typography';\n\n/**\n * @children required\n */\nexport interface FormProps extends React.FormHTMLAttributes<HTMLFormElement> {\n /**\n * React Node containing the form action buttons; will appear under the form fields\n */\n actions: React.ReactNode;\n /**\n * General description of the form\n */\n description?: string;\n /**\n * Additional form level validation message\n */\n errorMessage?: string;\n /**\n * Title of the form\n */\n header: string;\n /**\n * Additional styles to the form heading for typography based on the context of the content\n * @default TypographyColor.default\n */\n headingContextVariant?: TypographyContextVariant;\n /**\n * Number to indicate which level heading will render for the form header (e.g. h1, h2 etc.)\n * @default 3\n */\n headingLevel?: 1 | 2 | 3 | 4 | 5 | 6;\n /**\n * Applies visual styles to the form heading including font-size, font-weight, line-height and margins\n */\n headingVisualStyle?: TypographyVisualStyle;\n isInverse?: boolean;\n /**\n * Handler for form submission\n */\n testId?: string;\n}\n\nconst StyledForm = styled.form<{ isInverse?: boolean; theme: ThemeInterface }>`\n background: ${props =>\n props.isInverse\n ? props.theme.colors.foundation\n : props.theme.colors.neutral08};\n color: ${props =>\n props.isInverse\n ? props.theme.colors.neutral08\n : props.theme.colors.neutral};\n`;\n\nconst FormActions = styled.div`\n display: flex;\n justify-content: flex-end;\n`;\n\nexport const Form = React.forwardRef<HTMLFormElement, FormProps>(\n (props, ref) => {\n const {\n actions,\n children,\n header,\n headingContextVariant,\n headingLevel = 3,\n headingVisualStyle,\n description,\n errorMessage,\n testId,\n ...other\n } = props;\n\n const theme = React.useContext(ThemeContext);\n\n const isInverse = useIsInverse(props.isInverse);\n\n return (\n <InverseContext.Provider\n value={{\n isInverse,\n }}\n >\n <StyledForm\n ref={ref}\n data-testid={testId}\n isInverse={isInverse}\n theme={theme}\n {...other}\n >\n <Heading\n contextVariant={headingContextVariant}\n level={headingLevel}\n visualStyle={headingVisualStyle}\n >\n {header}\n </Heading>\n {description && <Paragraph>{description}</Paragraph>}\n {errorMessage && (\n <Alert variant={AlertVariant.danger}>{errorMessage}</Alert>\n )}\n <div>{children}</div>\n <FormActions>{actions}</FormActions>\n </StyledForm>\n </InverseContext.Provider>\n );\n }\n);\n","import * as React from 'react';\nimport { css } from '@emotion/core';\nimport styled from '../../theme/styled';\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport { convertStyleValueToString, useGenerateId } from '../../utils';\nimport { useIsInverse } from '../../inverse';\nimport { VisuallyHidden } from '../VisuallyHidden';\n\nexport interface ProgressBarProps extends React.HTMLAttributes<HTMLDivElement> {\n /**\n * The color variant of the progress bar\n * @default ProgressBarColor.primary\n */\n color?: ProgressBarColor;\n /**\n * The height of the progress bar. Can be a string or number; if number is provided height is in px\n * @default 8\n */\n height?: number | string;\n /**\n * If true, the progress bar with have a shimmer animation\n * @default false\n */\n isAnimated?: boolean;\n isInverse?: boolean;\n /**\n * @internal\n */\n isLoadingIndicator?: boolean;\n /**\n * If true, the label with the percentage value will display to the right of the progress bar\n * @default false\n */\n isLabelVisible?: boolean;\n /**\n * The percentage of which the bar is filled\n * @default 0\n */\n percentage?: number;\n testId?: string;\n}\n\nexport enum ProgressBarColor {\n danger = 'danger',\n primary = 'primary', // default\n pop = 'pop',\n pop02 = 'pop02',\n success = 'success',\n}\n\nfunction buildProgressBarBackground(props) {\n if (props.isInverse) {\n switch (props.color) {\n case 'danger':\n return props.theme.colors.dangerInverse;\n case 'success':\n return props.theme.colors.successInverse;\n default:\n return props.theme.colors.primaryInverse;\n }\n }\n switch (props.color) {\n case 'danger':\n return props.theme.colors.danger;\n case 'pop':\n return props.theme.colors.pop;\n case 'pop02':\n return props.theme.colors.pop02;\n case 'success':\n return props.theme.colors.success;\n default:\n return props.theme.colors.primary;\n }\n}\n\nconst Container = styled.div<{ isLoadingIndicator?: boolean }>`\n align-items: center;\n display: ${props => (props.isLoadingIndicator ? 'block' : 'flex')};\n`;\n\nconst Track = styled.div<ProgressBarProps>`\n background: ${props =>\n props.isInverse ? 'rgba(0,0,0,0.25)' : props.theme.colors.neutral08};\n box-shadow: inset 0 0 0 1px\n ${props =>\n props.isInverse\n ? `${props.theme.colors.neutral08}80`\n : props.theme.colors.neutral04};\n border-radius: 50em;\n overflow: hidden;\n display: flex;\n height: ${props => props.height};\n /* padding: 1px; */\n width: 100%;\n`;\n\nconst Bar = styled.div<ProgressBarProps>`\n background: ${props => buildProgressBarBackground(props)};\n border-radius: 50em;\n display: flex;\n transition: width 0.3s;\n width: ${props => props.percentage}%;\n\n ${props =>\n props.isAnimated &&\n css`\n background-image: linear-gradient(\n to right,\n ${buildProgressBarBackground(props)} 0%,\n rgba(255, 255, 255, 0.5) 20%,\n ${buildProgressBarBackground(props)} 40%,\n ${buildProgressBarBackground(props)} 100%\n );\n background-repeat: no-repeat;\n background-size: 1800px 104px;\n display: inline-block;\n position: relative;\n\n animation-duration: 1s;\n animation-fill-mode: forwards;\n animation-iteration-count: infinite;\n animation-name: placeholderShimmer;\n animation-timing-function: linear;\n\n @keyframes placeholderShimmer {\n 0% {\n background-position: -600px 0;\n }\n\n 100% {\n background-position: 600px 0;\n }\n }\n `}\n`;\n\nconst Percentage = styled.span`\n font-size: ${props => props.theme.typeScale.size02.fontSize};\n letter-spacing: ${props => props.theme.typeScale.size02.letterSpacing};\n line-height: ${props => props.theme.typeScale.size02.lineHeight};\n margin-left: ${props => props.theme.spaceScale.spacing03};\n`;\n\nconst TopPercentage = styled.div`\n font-size: ${props => props.theme.typeScale.size05.fontSize};\n line-height: ${props => props.theme.typeScale.size05.lineHeight};\n margin-bottom: ${props => props.theme.spaceScale.spacing03};\n text-align: center;\n`;\n\nexport const ProgressBar = React.forwardRef<HTMLDivElement, ProgressBarProps>(\n (props, ref) => {\n const {\n color,\n height,\n id: defaultId,\n isAnimated,\n isLabelVisible,\n isLoadingIndicator,\n percentage,\n testId,\n ...other\n } = props;\n\n const id = useGenerateId(defaultId);\n const labelId = `${id}__label`;\n\n const percentageValue = percentage ? percentage : 0;\n\n const theme = React.useContext(ThemeContext);\n\n const heightString = convertStyleValueToString(\n height,\n theme.spaceScale.spacing03\n );\n\n const isInverse = useIsInverse(props.isInverse);\n\n return (\n <Container\n {...other}\n id={defaultId}\n isLoadingIndicator={isLoadingIndicator}\n >\n {isLoadingIndicator && (\n <TopPercentage theme={theme}>{percentageValue}%</TopPercentage>\n )}\n <Track\n data-testid={testId}\n height={heightString}\n isInverse={isInverse}\n ref={ref}\n theme={theme}\n >\n <Bar\n aria-labelledby={labelId}\n aria-valuenow={percentageValue}\n aria-valuemin={0}\n aria-valuemax={100}\n color={color}\n isAnimated={isAnimated}\n isInverse={isInverse}\n percentage={percentageValue}\n role=\"progressbar\"\n theme={theme}\n />\n </Track>\n {isLabelVisible ? (\n <Percentage id={labelId} theme={theme}>\n {percentageValue}%\n </Percentage>\n ) : (\n <VisuallyHidden id={labelId}>{percentageValue}%</VisuallyHidden>\n )}\n </Container>\n );\n }\n);\n","import * as React from 'react';\nimport styled from '../../theme/styled';\nimport { css } from '@emotion/core';\nimport { getListDisplay, ListProps } from './';\nimport { magma } from '../../theme/magma';\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport { InverseContext, useIsInverse } from '../../inverse';\n\n/**\n * @children required\n */\nexport interface ListItemProps\n extends ListProps,\n React.HTMLAttributes<HTMLDivElement> {\n /**\n * Option for changing icon background with all Magma colors.\n */\n iconBackground?: keyof typeof magma.colors;\n /**\n * Option for changing icon color with all Magma colors.\n */\n iconColor?: keyof typeof magma.colors;\n}\n\nconst ListItemStyles = props => css`\n display: ${getListDisplay(props)};\n margin: 0;\n padding: 0;\n margin-left: ${props.icon ? 'inherit' : '1.1em'};\n color: ${props.description && !props.isInverse\n ? props.theme.colors.neutral03\n : 'inherit'};\n list-style-type: ${props.icon || props.description ? 'none' : 'inherit'};\n`;\n\nconst IconStyles = props => css`\n background: ${props.iconBackground};\n color: ${props.iconColor};\n border-radius: 50%;\n display: inline-flex;\n padding: 10px;\n`;\n\nconst StyledListItem = styled.li`\n ${ListItemStyles};\n`;\n\nconst StyledIcon = styled.span`\n ${IconStyles};\n`;\n\nexport const ListItem = React.forwardRef<HTMLDivElement, ListItemProps>(\n (props, ref) => {\n const {\n children,\n description,\n icon,\n iconAlign,\n iconBackground,\n iconColor,\n testId,\n isInverse: isInverseProp,\n } = props;\n const theme = React.useContext(ThemeContext);\n const isInverse = useIsInverse(isInverseProp);\n\n return (\n <InverseContext.Provider value={{ isInverse }}>\n <StyledListItem\n as={description ? 'p' : 'li'}\n description={description}\n icon={icon}\n iconAlign={iconAlign}\n isInverse={isInverse}\n theme={theme}\n testId={testId}\n >\n {icon && (\n <StyledIcon\n iconBackground={\n magma.colors[iconBackground] || magma.colors.primary\n }\n iconColor={magma.colors[iconColor] || magma.colors.neutral08}\n theme={theme}\n >\n {icon}\n </StyledIcon>\n )}\n {children}\n </StyledListItem>\n </InverseContext.Provider>\n );\n }\n);\n","import * as React from 'react';\nimport { ProgressBar, ProgressBarColor } from '../ProgressBar';\nimport { Spinner } from '../Spinner';\nimport styled from '@emotion/styled';\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport { ThemeInterface } from '../../theme/magma';\nimport { I18nContext } from '../../i18n';\n\nexport interface LoadingIndicatorProps\n extends React.HTMLAttributes<HTMLDivElement | HTMLSpanElement> {\n /**\n * @internal\n */\n css?: any; // Adding css prop to fix emotion error\n /**\n * Message displayed for the first five seconds\n * @default \"Loading...\"\n */\n message1?: string;\n /**\n * Message displayed for the first five seconds\n * @default \"Thank you for your patience. Still loading...\"\n */\n message2?: string;\n /**\n * Message displayed after 15 seconds\n * @default \"Sorry for the delay. This is taking longer than expected.\"\n */\n message3?: string;\n /**\n * Message displayed for the first five seconds\n * @default 0\n */\n percentage?: number;\n testId?: string;\n /**\n * Type of loading indictor to display, can be progress bar or spinner\n * @default LoadingIndicatorType.spinner\n */\n type?: LoadingIndicatorType;\n}\n\nexport enum LoadingIndicatorType {\n progressbar = 'progressbar',\n spinner = 'spinner', // default\n}\n\nexport interface LoadingIndicatorState {\n messageLevel: number;\n}\n\nconst StyledLoadingIndicator = styled.div`\n text-align: center;\n`;\n\nconst MessageContainer = styled.div<{ theme: ThemeInterface }>`\n font-size: ${props => props.theme.typeScale.size02.fontSize};\n letter-spacing: ${props => props.theme.typeScale.size02.letterSpacing};\n line-height: ${props => props.theme.typeScale.size02.lineHeight};\n margin-top: ${props => props.theme.spaceScale.spacing05};\n min-height: 5em;\n position: relative;\n text-align: center;\n`;\n\nconst Message = styled.div<{ hide?: boolean }>`\n opacity: ${props => (props.hide ? '0' : '1')};\n position: absolute;\n transition: opacity 0.3s;\n width: 100%;\n`;\n\nexport const LoadingIndicator = React.forwardRef<\n HTMLDivElement,\n LoadingIndicatorProps\n>((props, ref) => {\n const [messageLevel, setMessageLevel] = React.useState<1 | 2 | 3>(1);\n\n const theme = React.useContext(ThemeContext);\n const i18n = React.useContext(I18nContext);\n\n React.useEffect(() => {\n const { type: loadingIndicatorType } = props;\n const messageLevel2Timeout = setTimeout(\n () => {\n setMessageLevel(2);\n },\n loadingIndicatorType === LoadingIndicatorType.progressbar ? 10000 : 5000\n );\n\n const messageLevel3Timeout = setTimeout(\n () => {\n setMessageLevel(3);\n },\n loadingIndicatorType === LoadingIndicatorType.progressbar ? 30000 : 15000\n );\n\n return () => {\n clearTimeout(messageLevel2Timeout);\n clearTimeout(messageLevel3Timeout);\n };\n }, []);\n\n const { color, testId, type, ...other } = props;\n let { message1, message2, message3 } = props;\n\n message1 = message1\n ? message1\n : type === LoadingIndicatorType.progressbar\n ? i18n.loadingIndicator.progressBar.messages.first\n : i18n.loadingIndicator.spinner.messages.first;\n\n message2 = message2\n ? message2\n : type === LoadingIndicatorType.progressbar\n ? i18n.loadingIndicator.progressBar.messages.second\n : i18n.loadingIndicator.spinner.messages.second;\n\n message3 = message3\n ? message3\n : type === LoadingIndicatorType.progressbar\n ? i18n.loadingIndicator.progressBar.messages.third\n : i18n.loadingIndicator.spinner.messages.third;\n\n return (\n <StyledLoadingIndicator aria-busy=\"true\" data-testid={testId} ref={ref}>\n {type === LoadingIndicatorType.progressbar ? (\n <ProgressBar\n {...other}\n color={color as ProgressBarColor}\n height={theme.spaceScale.spacing03}\n isAnimated\n isLoadingIndicator\n />\n ) : (\n <Spinner {...other} size={theme.spaceScale.spacing10} />\n )}\n\n <MessageContainer theme={theme}>\n <Message aria-hidden={messageLevel !== 1} hide={messageLevel !== 1}>\n {message1}\n </Message>\n <Message aria-hidden={messageLevel !== 2} hide={messageLevel !== 2}>\n {message2}\n </Message>\n <Message aria-hidden={messageLevel !== 3} hide={messageLevel !== 3}>\n {message3}\n </Message>\n </MessageContainer>\n </StyledLoadingIndicator>\n );\n});\n","import styled from '../../theme/styled';\n\nimport { inputBaseStyles } from '../InputBase';\nimport { Card } from '../Card';\n\nexport const SelectContainer = styled.div`\n position: relative;\n`;\n\nexport const StyledButton = styled.div`\n ${inputBaseStyles}\n align-items: center;\n display: flex;\n text-align: left;\n`;\n\nexport const SelectText = styled.span`\n flex-grow: 1;\n padding: 0 8px 0 4px;\n`;\n\nexport const StyledCard = styled(Card)<{\n isOpen?: boolean;\n}>`\n display: ${props => (props.isOpen ? 'block' : 'none')};\n left: 4px;\n margin-top: 4px;\n padding: 4px 0 0;\n position: absolute;\n right: 4px;\n top: auto;\n z-index: 2;\n`;\n\nexport const StyledList = styled('ul')<{ isOpen?: boolean; maxHeight: string }>`\n display: ${props => (props.isOpen ? 'block' : 'none')};\n list-style: none;\n margin: 0 0 4px;\n outline: none;\n padding: 0;\n max-height: ${props => props.maxHeight};\n overflow-y: auto;\n`;\n\nexport const StyledItem = styled('li')<{ isFocused?: boolean }>`\n align-self: center;\n background: ${props =>\n props.isFocused ? props.theme.colors.neutral06 : 'transparent'};\n border: 2px dotted;\n border-color: ${props =>\n props.isFocused ? props.theme.colors.focus : 'transparent'};\n cursor: default;\n line-height: 24px;\n margin: 0;\n padding: 8px 16px;\n`;\n\nexport const SelectedItemsWrapper = styled.span`\n display: flex;\n flex-grow: 1;\n flex-wrap: wrap;\n padding: 0 0 0 4px;\n`;\n\nexport const SelectedItemButton = styled.button`\n align-self: center;\n background: ${props => props.theme.colors.neutral06};\n border-radius: 4px;\n border: 0;\n box-shadow: 0 0 0;\n display: flex;\n font-size: 12px;\n line-height: 16px;\n height: 24px;\n margin: 4px 2px 4px 4px;\n padding: ${props => props.theme.spaceScale.spacing02}\n ${props => props.theme.spaceScale.spacing02}\n ${props => props.theme.spaceScale.spacing02}\n ${props => props.theme.spaceScale.spacing03};\n position: relative;\n white-space: nowrap;\n`;\n\nexport const IconWrapper = styled.span`\n padding-left: 12px;\n`;\n","import * as React from 'react';\nimport { IconButton, IconButtonProps } from '../IconButton';\nimport { Spinner, SpinnerProps } from '../Spinner';\nimport { IconProps, ArrowDropDownIcon } from 'react-magma-icons';\nimport { StyledItem } from './shared';\nimport { ThemeInterface } from '../../theme/magma';\n\nexport type ItemRenderOptions<T> = {\n key: string;\n isFocused?: boolean;\n item: T;\n itemRef: React.Ref<HTMLLIElement>;\n itemString: string;\n theme: ThemeInterface;\n [key: string]: any;\n};\n\nexport type SelectComponents<T> = {\n ClearIndicator?: React.FunctionComponent<IconButtonProps>;\n DropdownIndicator?: React.FunctionComponent<Partial<IconProps>>;\n LoadingIndicator?: React.FunctionComponent<SpinnerProps>;\n Item?: React.FunctionComponent<ItemRenderOptions<T>>;\n};\n\nexport const DefaultClearIndicator = props => {\n return <IconButton testId=\"clearIndicator\" {...props} />;\n};\n\nexport const DefaultDropdownIndicator = props => {\n return (\n <ArrowDropDownIcon\n size={24}\n style={{ flexShrink: 0 }}\n testId=\"caretDown\"\n {...props}\n />\n );\n};\n\nexport const DefaultLoadingIndicator = props => {\n return <Spinner testId=\"loadingIndicator\" {...props} />;\n};\n\nexport function DefaultItem<T>({\n itemRef,\n itemString,\n ...props\n}: ItemRenderOptions<T>) {\n return (\n <StyledItem {...props} ref={itemRef}>\n {itemString}\n </StyledItem>\n );\n}\n\nexport function defaultComponents<T>(props: SelectComponents<T>) {\n return {\n ClearIndicator: DefaultClearIndicator,\n DropdownIndicator: DefaultDropdownIndicator,\n LoadingIndicator: DefaultLoadingIndicator,\n Item: DefaultItem,\n ...props,\n };\n}\n","import React from 'react';\nimport {\n inputBaseStyles,\n inputWrapperStyles,\n InputBaseStylesProps,\n InputWrapperStylesProps,\n} from '../InputBase';\nimport { defaultComponents, SelectComponents } from '../Select/components';\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport styled from '../../theme/styled';\n\nconst StyledButton = styled.div<InputBaseStylesProps & InputWrapperStylesProps>`\n ${inputBaseStyles}\n ${inputWrapperStyles}\n\n align-items: center;\n display: flex;\n height: auto;\n min-height: ${props => props.theme.spaceScale.spacing09};\n padding: 0 ${props => props.theme.spaceScale.spacing03} 0\n ${props => props.theme.spaceScale.spacing02};\n text-align: left;\n`;\n\nconst ChildrenContainer = styled.div`\n align-items: center;\n display: flex;\n flex-grow: 1;\n flex-wrap: wrap;\n`;\n\ninterface SelectTriggerButtonInterface<T> {\n ariaDescribedBy?: string;\n children: React.ReactNode | React.ReactNode[];\n customComponents?: SelectComponents<T>;\n hasError?: boolean;\n disabled?: boolean;\n isInverse?: boolean;\n style?: React.CSSProperties;\n toggleButtonProps: any;\n tabindex?: number;\n}\n\nexport function SelectTriggerButton<T>(props: SelectTriggerButtonInterface<T>) {\n const {\n ariaDescribedBy,\n children,\n customComponents,\n hasError,\n disabled,\n isInverse,\n style: passedInStyle,\n toggleButtonProps,\n } = props;\n const theme = React.useContext(ThemeContext);\n\n const { DropdownIndicator } = defaultComponents<T>({\n ...customComponents,\n });\n\n const style = { ...passedInStyle, cursor: 'default' };\n\n return (\n <StyledButton\n {...toggleButtonProps}\n aria-describedby={ariaDescribedBy}\n data-testid=\"selectTriggerButton\"\n hasError={hasError}\n disabled={disabled}\n isInverse={isInverse}\n role=\"button\"\n style={style}\n theme={theme}\n tabIndex={disabled ? undefined : 0}\n >\n <ChildrenContainer>{children}</ChildrenContainer>\n <DropdownIndicator />\n </StyledButton>\n );\n}\n","export enum TabsOrientation {\n horizontal = 'horizontal',\n vertical = 'vertical',\n}\n","import * as React from 'react';\nimport styled from '../../theme/styled';\n\nimport { inputBaseStyles } from '../InputBase';\nimport {\n FormFieldContainer,\n FormFieldContainerBaseProps,\n} from '../FormFieldContainer';\nimport { SelectTriggerButton } from '../Select/SelectTriggerButton';\n\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport { useIsInverse } from '../../inverse';\nimport { useGenerateId } from '../../utils';\n\n/**\n * @children required\n */\nexport interface NativeSelectProps\n extends Omit<FormFieldContainerBaseProps, 'inputSize'>,\n React.SelectHTMLAttributes<HTMLSelectElement> {\n testId?: string;\n optionLabel?: string;\n}\nconst StyledNativeSelect = styled.select`\n ${inputBaseStyles};\n background: inherit;\n`;\n\nexport const NativeSelect = React.forwardRef<HTMLDivElement, NativeSelectProps>(\n (props, ref) => {\n const {\n children,\n containerStyle,\n disabled,\n errorMessage,\n id: defaultId,\n helperMessage,\n isInverse: isInverseProp,\n labelStyle,\n labelText,\n messageStyle,\n testId,\n ...other\n } = props;\n const theme = React.useContext(ThemeContext);\n const isInverse = useIsInverse(isInverseProp);\n const id = useGenerateId(defaultId);\n\n return (\n <FormFieldContainer\n containerStyle={containerStyle}\n errorMessage={errorMessage}\n fieldId={id}\n labelStyle={labelStyle}\n labelText={labelText}\n isInverse={isInverse}\n helperMessage={helperMessage}\n messageStyle={messageStyle}\n ref={ref}\n >\n <SelectTriggerButton\n disabled={disabled}\n hasError={!!errorMessage}\n isInverse={isInverse}\n toggleButtonProps={''}\n >\n <StyledNativeSelect\n {...other}\n data-testid={testId}\n disabled={disabled}\n id={id}\n isInverse={isInverse}\n theme={theme}\n >\n {children}\n </StyledNativeSelect>\n </SelectTriggerButton>\n </FormFieldContainer>\n );\n }\n);\n","import React from 'react';\nimport styled from '@emotion/styled';\nimport { useIsInverse } from '../../inverse';\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport { ThemeInterface } from '../../theme/magma';\n\ninterface TabsContainerProps extends React.HTMLAttributes<HTMLDivElement> {\n /**\n * The index of the current active tab. You can use this for managing state of the tabs component by your custom logic.\n */\n activeIndex?: number;\n isInverse?: boolean;\n testId?: string;\n}\n\ninterface TabsContainerContextInterface {\n activeTabIndex: number;\n isInverseContainer: boolean;\n setActiveTabIndex: React.Dispatch<React.SetStateAction<number>>;\n}\n\nexport const TabsContainerContext = React.createContext<TabsContainerContextInterface>(\n {\n activeTabIndex: 0,\n isInverseContainer: false,\n setActiveTabIndex: () => 0,\n }\n);\n\nconst StyledTabsContainer = styled.div<{\n isInverse?: boolean;\n theme: ThemeInterface;\n}>`\n background: ${props =>\n props.isInverse ? props.theme.colors.foundation02 : 'none'};\n color: ${props =>\n props.isInverse\n ? props.theme.colors.neutral08\n : props.theme.colors.neutral};\n display: flex;\n flex-wrap: wrap;\n position: relative;\n`;\n\nexport const TabsContainer = React.forwardRef<\n HTMLDivElement,\n TabsContainerProps\n>((props, ref) => {\n const { activeIndex, children, testId } = props;\n\n React.useEffect(() => {\n if (activeIndex >= 0) {\n setActiveTabIndex(activeIndex);\n }\n }, [activeIndex]);\n\n const [activeTabIndex, setActiveTabIndex] = React.useState(activeIndex || 0);\n\n const isInverse = useIsInverse(props.isInverse);\n\n React.useEffect(() => {\n setIsInverseContainer(isInverse);\n }, [props.isInverse]);\n\n const [isInverseContainer, setIsInverseContainer] = React.useState(\n Boolean(props.isInverse)\n );\n\n const theme = React.useContext(ThemeContext);\n\n return (\n <TabsContainerContext.Provider\n value={{\n activeTabIndex,\n setActiveTabIndex,\n isInverseContainer,\n }}\n >\n <StyledTabsContainer\n ref={ref}\n data-testid={testId}\n theme={theme}\n {...props}\n >\n {children}\n </StyledTabsContainer>\n </TabsContainerContext.Provider>\n );\n});\n","import React from 'react';\nimport styled from '@emotion/styled';\nimport { css } from '@emotion/core';\nimport { transparentize } from 'polished';\nimport { TabsOrientation } from './shared';\nimport { ThemeInterface } from '../../theme/magma';\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport { I18nContext } from '../../i18n';\n\nimport {\n ArrowBackIosIcon,\n ExpandLessIcon,\n ExpandMoreIcon,\n ArrowForwardIosIcon,\n} from 'react-magma-icons';\n\nexport interface ScrollButtonProps\n extends React.HTMLAttributes<HTMLButtonElement> {\n backgroundColor?: string;\n buttonVisible?: boolean;\n isInverse?: boolean;\n orientation?: TabsOrientation;\n theme?: ThemeInterface;\n}\n\nconst StyledScrollButton = styled.button<ScrollButtonProps>`\n align-items: center;\n backdrop-filter: blur(1px);\n border: 0;\n color: ${props =>\n props.isInverse\n ? props.theme.colors.neutral08\n : props.theme.colors.neutral};\n cursor: pointer;\n display: ${props => (props.buttonVisible ? 'flex' : 'none')};\n justify-content: center;\n outline-offset: 0;\n position: absolute;\n -webkit-appearance: none;\n z-index: 2;\n\n bottom: 0;\n top: 0;\n width: 44px;\n\n ${props =>\n props.orientation === 'vertical' &&\n css`\n left: 0;\n height: 44px;\n right: 0;\n width: 100%;\n `}\n`;\n\nconst StyledButtonPrev = styled(StyledScrollButton)<ScrollButtonProps>`\n background: ${props => `linear-gradient(\n 90deg,\n ${props.backgroundColor} 0%,\n ${transparentize(0.5, props.backgroundColor)} 100%\n )`};\n left: 0;\n\n ${props =>\n props.orientation === 'vertical' &&\n css`\n background: ${`linear-gradient(\n ${props.backgroundColor} 0%,\n ${transparentize(0.5, props.backgroundColor)} 100%\n )`};\n\n bottom: auto;\n `}\n`;\n\nconst StyledButtonNext = styled(StyledScrollButton)<{\n backgroundColor?: string;\n orientation?: TabsOrientation;\n}>`\n background: ${props => `linear-gradient(\n 90deg,\n ${transparentize(0.5, props.backgroundColor)} 0%,\n ${props.backgroundColor} 100%\n )`};\n right: 0;\n\n ${props =>\n props.orientation === 'vertical' &&\n css`\n background: linear-gradient(\n ${transparentize(0.5, props.backgroundColor)} 0%,\n ${props.backgroundColor} 100%\n );\n top: auto;\n `}\n`;\n\nexport const ButtonPrev = React.forwardRef<\n HTMLButtonElement,\n ScrollButtonProps\n>((props, ref) => {\n const theme = React.useContext(ThemeContext);\n const i18n = React.useContext(I18nContext);\n\n return (\n <StyledButtonPrev\n aria-label={i18n.tabs.previousButtonLabel}\n backgroundColor={props.backgroundColor}\n buttonVisible={props.buttonVisible}\n data-testid=\"buttonPrev\"\n isInverse={props.isInverse}\n onClick={props.onClick}\n orientation={props.orientation}\n ref={ref}\n theme={props.theme}\n >\n {props.orientation === TabsOrientation.vertical ? (\n <ExpandLessIcon size={theme.iconSizes.small} />\n ) : (\n <ArrowBackIosIcon size={theme.iconSizes.small} />\n )}\n </StyledButtonPrev>\n );\n});\n\nexport const ButtonNext = React.forwardRef<\n HTMLButtonElement,\n ScrollButtonProps\n>((props, ref) => {\n const theme = React.useContext(ThemeContext);\n const i18n = React.useContext(I18nContext);\n\n return (\n <StyledButtonNext\n aria-label={i18n.tabs.nextButtonLabel}\n backgroundColor={props.backgroundColor}\n buttonVisible={props.buttonVisible}\n data-testid=\"buttonNext\"\n isInverse={props.isInverse}\n onClick={props.onClick}\n orientation={props.orientation}\n ref={ref}\n theme={props.theme}\n >\n {props.orientation === TabsOrientation.vertical ? (\n <ExpandMoreIcon size={theme.iconSizes.small} />\n ) : (\n <ArrowForwardIosIcon size={theme.iconSizes.small} />\n )}\n </StyledButtonNext>\n );\n});\n","import React from 'react';\nimport { TabsOrientation } from './shared';\nimport {\n animate,\n debounce,\n getNormalizedScrollLeft,\n detectScrollType,\n} from '../../utils';\n\nexport function useTabsMeta(theme, orientation, backgroundColor, isInverse) {\n const isRtl = theme.direction === 'rtl';\n const vertical = orientation === TabsOrientation.vertical;\n const scrollStart = vertical ? 'scrollTop' : 'scrollLeft';\n const clientSize = vertical ? 'clientHeight' : 'clientWidth';\n\n const approxTabSize = vertical\n ? theme.tabs.approxTabSize.vertical\n : theme.tabs.approxTabSize.horizontal;\n\n const background = backgroundColor\n ? backgroundColor\n : isInverse\n ? theme.colors.foundation\n : theme.colors.neutral08;\n\n const [displayScroll, setDisplayScroll] = React.useState({\n start: false,\n end: false,\n });\n\n const tabsWrapperRef = React.useRef<HTMLDivElement>();\n const prevButtonRef = React.useRef<HTMLButtonElement>();\n const nextButtonRef = React.useRef<HTMLButtonElement>();\n\n function scroll(scrollValue) {\n animate(scrollStart, tabsWrapperRef.current, scrollValue);\n }\n\n function moveTabsScroll(delta) {\n let scrollValue = tabsWrapperRef.current[scrollStart];\n\n if (vertical) {\n scrollValue += delta;\n } else {\n scrollValue += delta * (isRtl ? -1 : 1);\n // Fix for Edge\n scrollValue *= isRtl && detectScrollType() === 'reverse' ? -1 : 1;\n }\n\n scroll(scrollValue);\n }\n\n function handleStartScrollClick() {\n moveTabsScroll(-tabsWrapperRef.current[clientSize] + approxTabSize);\n }\n\n function handleEndScrollClick() {\n moveTabsScroll(tabsWrapperRef.current[clientSize] - approxTabSize);\n }\n\n function updateScrollButtonState() {\n const {\n scrollTop,\n scrollHeight,\n clientHeight,\n scrollWidth,\n clientWidth,\n } = tabsWrapperRef.current;\n let showStartScroll;\n let showEndScroll;\n\n if (vertical) {\n showStartScroll = scrollTop > 1;\n showEndScroll = scrollTop < scrollHeight - clientHeight - 1;\n } else {\n const scrollLeft = getNormalizedScrollLeft(\n tabsWrapperRef.current,\n theme.direction\n );\n // use 1 for the potential rounding error with browser zooms.\n showStartScroll = isRtl\n ? scrollLeft < scrollWidth - clientWidth - 1\n : scrollLeft > 1;\n showEndScroll = !isRtl\n ? scrollLeft < scrollWidth - clientWidth - 1\n : scrollLeft > 1;\n }\n\n if (\n showStartScroll !== displayScroll.start ||\n showEndScroll !== displayScroll.end\n ) {\n setDisplayScroll({ start: showStartScroll, end: showEndScroll });\n }\n }\n\n React.useEffect(() => {\n const handleResize = debounce(updateScrollButtonState, 100);\n\n window.addEventListener('resize', handleResize);\n return () => {\n handleResize.clear();\n window.removeEventListener('resize', handleResize);\n };\n }, [updateScrollButtonState]);\n\n const handleTabsScroll = React.useCallback(\n debounce(updateScrollButtonState, 100),\n [updateScrollButtonState]\n );\n\n React.useEffect(() => {\n return () => {\n handleTabsScroll.clear();\n };\n }, [handleTabsScroll]);\n\n React.useEffect(updateScrollButtonState);\n\n return [\n { vertical, background, displayScroll, scrollStart },\n { handleStartScrollClick, handleEndScrollClick, handleTabsScroll, scroll },\n { prevButtonRef, nextButtonRef, tabsWrapperRef },\n ];\n}\n","import React from 'react';\nimport styled from '@emotion/styled';\nimport { TabsContainerContext } from './TabsContainer';\nimport isPropValid from '@emotion/is-prop-valid';\nimport { Omit, getNormalizedScrollLeft } from '../../utils';\nimport { useDescendants } from '../../hooks/useDescendants';\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport { ThemeInterface } from '../../theme/magma';\nimport { ButtonNext, ButtonPrev } from './TabsScrollButtons';\nimport { useTabsMeta } from './utils';\nimport { I18nContext } from '../../i18n';\n\nexport enum TabsAlignment {\n center = 'center',\n left = 'left',\n right = 'right',\n}\n\nexport enum TabsBorderPosition {\n bottom = 'bottom',\n left = 'left',\n right = 'right',\n top = 'top',\n}\n\nexport enum TabsIconPosition {\n bottom = 'bottom',\n left = 'left',\n right = 'right',\n top = 'top',\n}\n\nexport enum TabsOrientation {\n horizontal = 'horizontal',\n vertical = 'vertical',\n}\n\nexport interface VerticalTabsProps {\n orientation?: TabsOrientation.vertical;\n borderPosition?: TabsBorderPosition.left | TabsBorderPosition.right;\n}\nexport interface HorizontalTabsProps {\n orientation?: TabsOrientation.horizontal;\n borderPosition?: TabsBorderPosition.bottom | TabsBorderPosition.top;\n}\n\nexport declare type Orientation = HorizontalTabsProps | VerticalTabsProps;\n\nexport interface TabsProps\n extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange'> {\n /**\n * Alignment of the tabs menu\n * @default TabsAlignment.left\n */\n alignment?: TabsAlignment;\n /**\n * The text the screen reader will announce that describes your tablist.\n */\n 'aria-label'?: string;\n /**\n * Background color for the tabs menu\n */\n backgroundColor?: string;\n /**\n * The orientation of icon on Tab\n */\n iconPosition?: TabsIconPosition;\n /**\n * If true, the components takes the full width of the screen\n */\n isFullWidth?: boolean;\n isInverse?: boolean;\n /**\n * The onChange handler for managing state of Tabs component by your custom logic.\n */\n onChange?: (newActiveIndex: number) => void;\n orientation?: TabsOrientation;\n testId?: string;\n}\n\ninterface TabsContextInterface {\n borderPosition?: TabsBorderPosition;\n buttonRefArray?: React.MutableRefObject<React.MutableRefObject<Element>[]>;\n changeHandler: (\n newActiveIndex: number,\n event?: React.MouseEvent<HTMLButtonElement, MouseEvent>\n ) => void;\n iconPosition?: TabsIconPosition;\n isInverse?: boolean;\n isFullWidth?: boolean;\n orientation?: TabsOrientation;\n registerTabButton: (\n itemRefArray: React.MutableRefObject<React.MutableRefObject<Element>[]>,\n itemRef: React.MutableRefObject<Element>\n ) => void;\n}\n\nexport const TabsContext = React.createContext<TabsContextInterface>({\n borderPosition: TabsBorderPosition.bottom,\n changeHandler: () => {},\n iconPosition: TabsIconPosition.left,\n isInverse: false,\n isFullWidth: false,\n orientation: TabsOrientation.horizontal,\n registerTabButton: (elements, element) => {},\n});\n\nexport const StyledContainer = styled('div', {\n shouldForwardProp: isPropValid,\n})<{\n as?: string;\n orientation: TabsOrientation;\n isInverse: boolean;\n backgroundColor: string;\n theme: ThemeInterface;\n}>`\n background-color: ${props =>\n props.backgroundColor\n ? props.backgroundColor\n : props.isInverse\n ? props.theme.colors.foundation\n : 'transparent'};\n background: backgroundColor;\n display: flex;\n height: ${props => (props.orientation === 'vertical' ? '100%' : 'auto')};\n\n position: relative;\n width: ${props => (props.orientation === 'vertical' ? 'auto' : '100%')};\n`;\n\nexport const StyledTabsWrapper = styled('div', {\n shouldForwardProp: isPropValid,\n})<{\n orientation: TabsOrientation;\n}>`\n display: flex;\n flex-grow: 1;\n overflow-x: ${props => (props.orientation === 'vertical' ? '' : 'auto')};\n overflow-y: ${props => (props.orientation === 'vertical' ? 'auto' : '')};\n\n &::-webkit-scrollbar {\n width: 0;\n height: 0;\n }\n scrollbar-width: none;\n`;\n\nexport const StyledTabs = styled('ul', { shouldForwardProp: isPropValid })<{\n alignment?: TabsAlignment;\n orientation: TabsOrientation;\n}>`\n align-items: center;\n display: flex;\n flex-direction: ${props =>\n props.orientation === 'vertical' ? 'column' : 'row'};\n justify-content: ${props =>\n props.alignment === 'center'\n ? 'center'\n : props.alignment === 'right'\n ? 'flex-end'\n : ''};\n margin: 0;\n padding: 0;\n width: ${props => (props.orientation === 'vertical' ? 'auto' : '100%')};\n`;\n\nexport const Tabs = React.forwardRef<HTMLDivElement, TabsProps & Orientation>(\n (props, ref) => {\n const {\n alignment,\n backgroundColor,\n borderPosition,\n children,\n isFullWidth,\n orientation,\n onChange,\n iconPosition,\n testId,\n ...rest\n } = props;\n\n const theme = React.useContext(ThemeContext);\n\n const { activeTabIndex, setActiveTabIndex, isInverseContainer } =\n React.useContext(TabsContainerContext);\n\n const isInverse =\n typeof props.isInverse !== 'undefined'\n ? Boolean(props.isInverse)\n : isInverseContainer;\n\n const [tabsMeta, tabsHandleMethods, tabsRefs] = useTabsMeta(\n theme,\n orientation,\n backgroundColor,\n isInverse\n );\n\n const { vertical, background, displayScroll, scrollStart } = tabsMeta;\n const {\n handleStartScrollClick,\n handleEndScrollClick,\n handleTabsScroll,\n scroll,\n } = tabsHandleMethods;\n const { prevButtonRef, nextButtonRef, tabsWrapperRef } = tabsRefs;\n\n const start = vertical ? 'top' : 'left';\n const end = vertical ? 'bottom' : 'right';\n\n const [buttonRefArray, registerTabButton] = useDescendants();\n\n const childrenWrapperRef = React.useRef<HTMLUListElement>();\n\n function getTabsMeta() {\n const tabsNode = tabsWrapperRef.current;\n let tabsMeta;\n if (tabsNode) {\n const rect = tabsNode.getBoundingClientRect();\n tabsMeta = {\n clientWidth: tabsNode.clientWidth,\n scrollLeft: tabsNode.scrollLeft,\n scrollTop: tabsNode.scrollTop,\n scrollLeftNormalized: getNormalizedScrollLeft(\n tabsNode,\n theme.direction\n ),\n scrollWidth: tabsNode.scrollWidth,\n top: rect.top,\n bottom: rect.bottom,\n left: rect.left,\n right: rect.right,\n };\n }\n\n let tabMeta;\n if (tabsNode) {\n const childrenArray = childrenWrapperRef.current.children;\n if (childrenArray.length > 0) {\n const tab = childrenArray[activeTabIndex];\n tabMeta = tab ? (tab as any).getBoundingClientRect() : null;\n }\n }\n return { tabsMeta, tabMeta };\n }\n\n function scrollSelectedIntoView() {\n const { tabsMeta, tabMeta } = getTabsMeta();\n\n if (!tabMeta || !tabsMeta) {\n return;\n }\n\n const prevButtonOffset = vertical\n ? Number(prevButtonRef.current.offsetHeight)\n : Number(prevButtonRef.current.offsetWidth);\n const nextButtonOffset = vertical\n ? Number(nextButtonRef.current.offsetHeight)\n : Number(nextButtonRef.current.offsetWidth);\n\n if (tabMeta[start] < Number(tabsMeta[start]) + prevButtonOffset) {\n // left side of button is out of view\n const nextScrollStart =\n Number(tabsMeta[scrollStart]) +\n (Number(tabMeta[start]) - Number(tabsMeta[start])) -\n prevButtonOffset;\n scroll(nextScrollStart);\n } else if (tabMeta[end] > Number(tabsMeta[end]) - nextButtonOffset) {\n // right side of button is out of view\n const nextScrollStart =\n Number(tabsMeta[scrollStart]) +\n (Number(tabMeta[end]) - Number(tabsMeta[end])) +\n nextButtonOffset;\n scroll(nextScrollStart);\n }\n }\n\n React.useEffect(scrollSelectedIntoView, []);\n\n React.useEffect(scrollSelectedIntoView, [activeTabIndex]);\n\n function changeHandler(\n newActiveIndex: number,\n event?: React.MouseEvent<HTMLButtonElement, MouseEvent>\n ): void {\n if (\n (event.target as HTMLInputElement).children[0] &&\n (event.target as HTMLInputElement).children[0].hasAttribute('disabled')\n ) {\n event.preventDefault();\n return undefined;\n }\n\n onChange && typeof onChange === 'function' && onChange(newActiveIndex);\n\n newActiveIndex === activeTabIndex\n ? scrollSelectedIntoView()\n : setActiveTabIndex(newActiveIndex);\n }\n\n function tabIsEnabled(tabIndex) {\n return (\n buttonRefArray.current[tabIndex].current.getAttribute('disabled') ===\n null\n );\n }\n\n function findPreviousEnabledTabIndex(modifiedActiveTabIndex?: number) {\n const currentTabIndex = modifiedActiveTabIndex\n ? modifiedActiveTabIndex\n : activeTabIndex;\n const newActiveTabIndex = currentTabIndex > 0 ? currentTabIndex - 1 : 0;\n\n if (tabIsEnabled(newActiveTabIndex)) {\n return newActiveTabIndex;\n } else if (newActiveTabIndex - 1 >= 0) {\n return findPreviousEnabledTabIndex(newActiveTabIndex);\n } else {\n return activeTabIndex;\n }\n }\n\n function findNextEnabledTabIndex(\n lastChildIndex: number,\n modifiedActiveTabIndex?: number\n ) {\n const currentTabIndex =\n modifiedActiveTabIndex === 0 || modifiedActiveTabIndex\n ? modifiedActiveTabIndex\n : activeTabIndex;\n const newActiveTabIndex =\n currentTabIndex < lastChildIndex ? currentTabIndex + 1 : lastChildIndex;\n\n if (tabIsEnabled(newActiveTabIndex)) {\n return newActiveTabIndex;\n } else if (newActiveTabIndex + 1 <= lastChildIndex) {\n return findNextEnabledTabIndex(lastChildIndex, newActiveTabIndex);\n } else {\n return activeTabIndex;\n }\n }\n\n function handleKeyDown(event: React.KeyboardEvent) {\n const target = event.target as HTMLButtonElement;\n\n const role = target.getAttribute('role');\n if (role !== 'tab') {\n return;\n }\n\n const lastChildIndex = buttonRefArray.current.length - 1;\n let newActiveTabIndex = null;\n let previousItemKey =\n orientation !== TabsOrientation.vertical ? 'ArrowLeft' : 'ArrowUp';\n let nextItemKey =\n orientation !== TabsOrientation.vertical ? 'ArrowRight' : 'ArrowDown';\n\n switch (event.key) {\n case previousItemKey:\n newActiveTabIndex = findPreviousEnabledTabIndex();\n break;\n case nextItemKey:\n newActiveTabIndex = findNextEnabledTabIndex(lastChildIndex);\n break;\n case 'Home':\n newActiveTabIndex = tabIsEnabled(0)\n ? 0\n : findNextEnabledTabIndex(lastChildIndex, 0);\n break;\n case 'End':\n newActiveTabIndex = tabIsEnabled(lastChildIndex)\n ? lastChildIndex\n : findPreviousEnabledTabIndex(lastChildIndex);\n break;\n default:\n break;\n }\n\n if (newActiveTabIndex !== null) {\n onChange &&\n typeof onChange === 'function' &&\n onChange(newActiveTabIndex);\n setActiveTabIndex(newActiveTabIndex);\n (\n buttonRefArray.current[newActiveTabIndex].current as HTMLButtonElement\n ).focus();\n event.preventDefault();\n }\n }\n\n const i18n = React.useContext(I18nContext);\n const ariaLabel = `${rest['aria-label'] || ''}, ${\n orientation === TabsOrientation.vertical\n ? i18n.tabs.verticalTabsInstructions\n : i18n.tabs.horizontalTabsInstructions\n }`;\n\n return (\n <StyledContainer\n data-testid={testId}\n backgroundColor={background}\n isInverse={isInverse}\n orientation={orientation || TabsOrientation.horizontal}\n ref={ref}\n theme={theme}\n {...rest}\n >\n <ButtonPrev\n backgroundColor={background}\n buttonVisible={displayScroll.start}\n isInverse={isInverse}\n onClick={handleStartScrollClick}\n orientation={orientation || TabsOrientation.horizontal}\n ref={prevButtonRef}\n theme={theme}\n />\n <StyledTabsWrapper\n data-testid=\"tabsWrapper\"\n onScroll={handleTabsScroll}\n orientation={orientation}\n ref={tabsWrapperRef}\n >\n <StyledTabs\n alignment={alignment ? alignment : TabsAlignment.left}\n aria-label={ariaLabel}\n aria-orientation={orientation || TabsOrientation.horizontal}\n onKeyDown={handleKeyDown}\n orientation={orientation}\n ref={childrenWrapperRef}\n role=\"tablist\"\n >\n <TabsContext.Provider\n value={{\n borderPosition,\n buttonRefArray,\n changeHandler,\n iconPosition,\n isInverse,\n isFullWidth,\n orientation,\n registerTabButton,\n }}\n >\n {children}\n </TabsContext.Provider>\n </StyledTabs>\n </StyledTabsWrapper>\n <ButtonNext\n backgroundColor={background}\n buttonVisible={displayScroll.end}\n isInverse={isInverse}\n onClick={handleEndScrollClick}\n orientation={orientation || TabsOrientation.horizontal}\n ref={nextButtonRef}\n theme={theme}\n />\n </StyledContainer>\n );\n }\n);\n","import React from 'react';\n\nexport function useForceUpdate() {\n const [, setTick] = React.useState(0);\n const update = React.useCallback(() => {\n setTick(tick => tick + 1);\n }, []);\n return update;\n}","import React from 'react';\nimport styled from '@emotion/styled';\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport { css } from '@emotion/core';\nimport isPropValid from '@emotion/is-prop-valid';\nimport { TabsIconPosition, TabsBorderPosition, TabsContext } from './Tabs';\nimport { TabsOrientation } from './shared';\nimport { useForkedRef } from '../../utils';\nimport { useForceUpdate } from '../../hooks/useForceUpdate';\nimport { TabsContainerContext } from './TabsContainer';\nimport { ThemeInterface } from '../../theme/magma';\n\nexport interface TabProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n /**\n * Icon to display within the component\n */\n icon?: React.ReactElement<any> | React.ReactElement<any>[];\n /**\n * If true, the component will display with the active/selected state\n * @default false\n */\n isActive?: boolean;\n isInverse?: boolean;\n testId?: string;\n /**\n * @internal\n */\n theme?: any;\n}\n\nexport const StyledTabsChild = styled('li', {\n shouldForwardProp: isPropValid,\n})<{\n borderPosition?: TabsBorderPosition;\n isActive?: boolean;\n isFullWidth?: boolean;\n isInverse?: boolean;\n orientation: TabsOrientation;\n theme: ThemeInterface;\n}>`\n flex-grow: 0;\n flex-shrink: ${props => (props.isFullWidth ? '1' : '0')};\n height: ${props => (props.orientation === 'vertical' ? 'auto' : '100%')};\n list-style: none;\n margin: 0;\n max-width: ${props => (props.isFullWidth ? '100%' : '250px')};\n padding: 0;\n position: relative;\n white-space: normal;\n width: ${props =>\n props.isFullWidth || props.orientation === 'vertical' ? '100%' : 'auto'};\n\n &:after {\n background: ${props =>\n props.isInverse ? props.theme.colors.pop02 : props.theme.colors.primary};\n border-radius: 2px;\n content: '';\n display: block;\n height: 4px;\n opacity: ${props => (props.isActive ? '1' : '0')};\n position: absolute;\n transition: 0.4s all;\n width: auto;\n\n bottom: ${props => (props.borderPosition === 'top' ? 'auto' : '0')};\n left: ${props => (props.isActive ? '0' : '50%')};\n right: ${props => (props.isActive ? '0' : '50%')};\n top: ${props => (props.borderPosition === 'top' ? '0' : 'auto')};\n\n ${props =>\n props.orientation === 'vertical' &&\n css`\n height: auto;\n\n bottom: ${props.isActive ? '0' : '50%'};\n left: ${props.borderPosition === 'right' ? 'auto' : '0'};\n right: ${props.borderPosition === 'right' ? '0' : 'auto'};\n top: ${props.isActive ? '0' : '50%'};\n\n width: 4px;\n `}\n }\n`;\n\nfunction getFlexDirection(position: TabsIconPosition) {\n switch (position) {\n case TabsIconPosition.left:\n return 'row';\n case TabsIconPosition.right:\n return 'row-reverse';\n case TabsIconPosition.top:\n return 'column';\n case TabsIconPosition.bottom:\n return 'column-reverse';\n default:\n return 'column';\n }\n}\n\nexport const TabStyles = props => css`\n align-items: center;\n background: transparent;\n border: 0;\n color: ${props.isActive && !props.isInverse\n ? props.theme.colors.primary\n : props.isInverse\n ? props.theme.colors.neutral08\n : props.theme.colors.neutral03};\n cursor: ${props.disabled ? 'auto' : 'pointer'};\n display: flex;\n flex-direction: ${getFlexDirection(props.iconPosition)};\n flex-grow: 0;\n flex-shrink: ${props.isFullWidth ? '1' : '0'};\n font-weight: 600;\n font-size: ${props.theme.typeScale.size02.fontSize};\n letter-spacing: ${props.theme.typeScale.size02.letterSpacing};\n line-height: ${props.theme.typeScale.size02.lineHeight};\n height: 100%;\n justify-content: ${props.iconPosition === 'left' ? 'flex-start' : 'center'};\n opacity: ${props.disabled\n ? 0.4\n : props.isInverse && !props.isActive\n ? 0.7\n : 1};\n padding: ${props.theme.spaceScale.spacing04}\n ${props.theme.spaceScale.spacing05};\n position: relative;\n pointer-events: ${props.disabled ? 'none' : ''};\n text-align: center;\n text-decoration: none;\n text-transform: uppercase;\n width: ${props.isFullWidth ? '100%' : 'auto'};\n\n ${props.orientation === 'vertical' &&\n css`\n align-items: flex-start;\n justify-content: ${props.iconPosition === 'left'\n ? 'flex-start'\n : 'flex-end'};\n text-align: left;\n width: 100%;\n\n align-items: center;\n `}\n\n &:hover,\n &:focus {\n background-color: ${props.isActive\n ? ''\n : props.isInverse\n ? props.theme.colors.shade02\n : props.theme.colors.shade};\n color: ${props.isActive\n ? props.isInverse\n ? props.theme.colors.neutral08\n : props.theme.colors.primary\n : props.isInverse\n ? props.theme.colors.neutral08\n : props.theme.colors.neutral02};\n }\n\n &:focus {\n outline-offset: -2px;\n outline: ${props.isInverse\n ? props.theme.colors.focusInverse\n : props.theme.colors.focus}\n dotted 2px;\n }\n`;\n\nconst StyledTab = styled('button', { shouldForwardProp: isPropValid })<{\n borderPosition?: TabsBorderPosition;\n iconPosition?: TabsIconPosition;\n isActive?: boolean;\n isFullWidth?: boolean;\n isInverse?: boolean;\n orientation: TabsOrientation;\n theme: ThemeInterface;\n}>`\n ${TabStyles}\n`;\n\nfunction getIconMargin(props) {\n if (props.isIconOnly) {\n return `0`;\n }\n\n switch (props.iconPosition) {\n case TabsIconPosition.left:\n return `0 ${props.theme.spaceScale.spacing03} 0 0`;\n case TabsIconPosition.right:\n return `0 0 0 ${props.theme.spaceScale.spacing03}`;\n case TabsIconPosition.top:\n return `0 0 ${props.theme.spaceScale.spacing02}`;\n case TabsIconPosition.bottom:\n return `${props.theme.spaceScale.spacing02} 0 0`;\n default:\n return `0 0 ${props.theme.spaceScale.spacing02}`;\n }\n}\n\nexport const StyledIcon = styled.span<{\n iconPosition: TabsIconPosition;\n isIconOnly?: boolean;\n theme: ThemeInterface;\n}>`\n display: flex;\n margin: ${props => getIconMargin(props)};\n\n svg {\n height: ${props => props.theme.iconSizes.small}px;\n width: ${props => props.theme.iconSizes.small}px;\n }\n`;\n\nexport const Tab = React.forwardRef<HTMLButtonElement, TabProps>(\n (props, forwardedRef) => {\n const { children, icon, disabled, testId, ...rest } = props;\n const { activeTabIndex } = React.useContext(TabsContainerContext);\n const { buttonRefArray, registerTabButton } = React.useContext(TabsContext);\n const ownRef = React.useRef<HTMLDivElement>();\n const forceUpdate = useForceUpdate();\n\n const index = buttonRefArray.current.findIndex(({ current: item }) => {\n if (!item || !ownRef.current) return false;\n\n return item === ownRef.current;\n });\n\n const isActive = index === activeTabIndex;\n\n const ref = useForkedRef(forwardedRef, ownRef);\n\n const {\n changeHandler,\n orientation,\n borderPosition,\n iconPosition,\n isInverse,\n isFullWidth,\n } = React.useContext(TabsContext);\n\n const handleClick = (index, e) => {\n changeHandler(index, e);\n\n props.onClick && typeof props.onClick === 'function' && props.onClick(e);\n };\n\n React.useEffect(() => {\n registerTabButton(buttonRefArray, ownRef);\n\n forceUpdate();\n }, []);\n\n const theme = React.useContext(ThemeContext);\n const isIconOnly = !children;\n\n const tabIconPosition = iconPosition\n ? iconPosition\n : orientation === 'vertical'\n ? TabsIconPosition.left\n : TabsIconPosition.top;\n\n return (\n <StyledTabsChild\n borderPosition={borderPosition}\n data-testid=\"tabContainer\"\n isActive={isActive}\n isFullWidth={isFullWidth}\n isInverse={isInverse}\n orientation={orientation}\n role=\"presentation\"\n theme={theme}\n >\n <StyledTab\n {...rest}\n aria-selected={isActive}\n data-testid={testId}\n disabled={disabled}\n iconPosition={tabIconPosition}\n isActive={isActive}\n isInverse={isInverse}\n isFullWidth={isFullWidth}\n onClick={e => handleClick(index, e)}\n orientation={orientation}\n ref={ref}\n role=\"tab\"\n tabIndex={isActive ? 0 : -1}\n theme={theme}\n >\n {icon && (\n <StyledIcon\n theme={theme}\n iconPosition={tabIconPosition}\n isIconOnly={isIconOnly}\n >\n {icon}\n </StyledIcon>\n )}\n {children}\n </StyledTab>\n </StyledTabsChild>\n );\n }\n);\n","import React from 'react';\nimport { TabsContainerContext } from './TabsContainer';\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport styled from '@emotion/styled';\nimport { ThemeInterface } from '../../theme/magma';\n\nconst StyledTabPanel = styled.div<{\n isInverse?: boolean;\n theme: ThemeInterface;\n}>`\n background: ${props =>\n props.isInverse\n ? props.theme.colors.foundation02\n : props.theme.colors.neutral08};\n color: ${props =>\n props.isInverse\n ? props.theme.colors.neutral08\n : props.theme.colors.neutral};\n flex: 1;\n height: 100%;\n padding: 20px;\n`;\n\nexport interface TabPanelProps extends React.HTMLAttributes<HTMLDivElement> {\n /**\n * @internal\n */\n index?: number;\n isInverse?: boolean;\n testId?: string;\n}\n\nexport const TabPanel = React.forwardRef<HTMLDivElement, TabPanelProps>(\n (props, ref) => {\n const { index, isInverse, testId, children, ...other } = props;\n\n const theme = React.useContext(ThemeContext);\n\n const { activeTabIndex } = React.useContext(TabsContainerContext);\n const activeTab = activeTabIndex === index;\n\n return activeTab ? (\n <StyledTabPanel\n ref={ref}\n data-testid={testId}\n isInverse={isInverse}\n theme={theme}\n {...other}\n >\n {children}\n </StyledTabPanel>\n ) : null;\n }\n);\n","import React from 'react';\nimport styled from '@emotion/styled';\nimport { TabsContainerContext } from './TabsContainer';\n\ninterface TabPanelContainerProps extends React.HTMLAttributes<HTMLDivElement> {\n isInverse?: boolean;\n testId?: string;\n}\n\nconst StyledContainer = styled.div`\n flex-grow: 1;\n`;\n\nexport const TabPanelsContainer = React.forwardRef<\n HTMLDivElement,\n TabPanelContainerProps\n>((props, ref) => {\n const { children, testId, ...rest } = props;\n\n const { isInverseContainer } = React.useContext(TabsContainerContext);\n\n return (\n <StyledContainer ref={ref} data-testid={testId} {...rest}>\n {React.Children.map(children, (child: React.ReactElement<any>, index) => {\n const isInverse =\n typeof child.props.isInverse !== 'undefined'\n ? child.props.isInverse\n : typeof props.isInverse !== 'undefined'\n ? props.isInverse\n : isInverseContainer;\n\n return React.cloneElement(child, { index, isInverse, key: index });\n })}\n {children}\n </StyledContainer>\n );\n});\n","import * as React from 'react';\nimport {\n StyledContainer,\n StyledTabsWrapper,\n StyledTabs,\n TabsAlignment,\n TabsBorderPosition,\n TabsIconPosition,\n TabsProps,\n Orientation,\n} from '../Tabs';\nimport { TabsOrientation } from '../Tabs/shared';\nimport { Omit } from '../../utils';\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport { ButtonNext, ButtonPrev } from '../Tabs/TabsScrollButtons';\nimport { useTabsMeta } from '../Tabs/utils';\nimport { useIsInverse } from '../../inverse';\n\nexport interface NavTabsProps extends Omit<TabsProps, 'onChange'> {}\n\ninterface NavTabsContextInterface {\n borderPosition?: TabsBorderPosition;\n iconPosition?: TabsIconPosition;\n isInverse?: boolean;\n isFullWidth?: boolean;\n orientation?: TabsOrientation;\n}\n\nexport const NavTabsContext = React.createContext<NavTabsContextInterface>({\n borderPosition: TabsBorderPosition.bottom,\n iconPosition: TabsIconPosition.left,\n isInverse: false,\n isFullWidth: false,\n orientation: TabsOrientation.horizontal,\n});\n\nexport const NavTabs = React.forwardRef<\n HTMLDivElement,\n NavTabsProps & Orientation\n>((props, ref) => {\n const {\n alignment,\n backgroundColor,\n borderPosition,\n children,\n iconPosition,\n isFullWidth,\n orientation,\n testId,\n ...rest\n } = props;\n const theme = React.useContext(ThemeContext);\n\n const isInverse = useIsInverse(props.isInverse);\n\n const background = backgroundColor\n ? backgroundColor\n : isInverse\n ? theme.colors.foundation\n : theme.colors.neutral08;\n\n const [tabsMeta, tabsHandleMethods, tabsRefs] = useTabsMeta(\n theme,\n orientation,\n backgroundColor,\n isInverse\n );\n\n const { displayScroll } = tabsMeta;\n const {\n handleStartScrollClick,\n handleEndScrollClick,\n handleTabsScroll,\n } = tabsHandleMethods;\n const { prevButtonRef, nextButtonRef, tabsWrapperRef } = tabsRefs;\n\n return (\n <StyledContainer\n aria-label={rest['aria-label']}\n as=\"nav\"\n backgroundColor={backgroundColor}\n data-testid={testId}\n isInverse={isInverse}\n orientation={orientation || TabsOrientation.horizontal}\n ref={ref}\n theme={theme}\n {...rest}\n >\n <ButtonPrev\n backgroundColor={background}\n buttonVisible={displayScroll.start}\n isInverse={isInverse}\n onClick={handleStartScrollClick}\n orientation={orientation || TabsOrientation.horizontal}\n ref={prevButtonRef}\n theme={theme}\n />\n\n <StyledTabsWrapper\n data-testid=\"navTabsWrapper\"\n onScroll={handleTabsScroll}\n orientation={orientation || TabsOrientation.horizontal}\n ref={tabsWrapperRef}\n >\n <StyledTabs\n alignment={alignment ? alignment : TabsAlignment.left}\n orientation={orientation}\n >\n <NavTabsContext.Provider\n value={{\n borderPosition,\n iconPosition,\n isInverse: isInverse,\n isFullWidth,\n orientation,\n }}\n >\n {children}\n </NavTabsContext.Provider>\n </StyledTabs>\n </StyledTabsWrapper>\n <ButtonNext\n backgroundColor={background}\n buttonVisible={displayScroll.end}\n isInverse={isInverse}\n onClick={handleEndScrollClick}\n orientation={orientation || TabsOrientation.horizontal}\n ref={nextButtonRef}\n theme={theme}\n />\n </StyledContainer>\n );\n});\n","import * as React from 'react';\nimport styled from '@emotion/styled';\nimport { jsx } from '@emotion/core';\n\nimport { NavTabsContext } from './NavTabs';\nimport {\n StyledTabsChild,\n StyledIcon,\n TabStyles,\n TabsIconPosition,\n} from '../Tabs';\nimport { TabsOrientation } from '../Tabs/shared';\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport { omit, XOR } from '../../utils';\n\n/**\n * @children required\n */\nexport interface BaseNavTabProps\n extends React.HTMLAttributes<HTMLAnchorElement> {\n /**\n * @internal\n */\n css?: any; // Adding css prop to fix emotion error\n /**\n * Icon to display within the component\n */\n icon?: React.ReactElement<any> | React.ReactElement<any>[];\n /**\n * If true, the component will display with the active/selected state\n */\n isActive?: boolean;\n isInverse?: boolean;\n /**\n * Determines if the tabs are displayed vertically or horizontally\n * @default TabsOrientation.horizontal\n */\n orientation?: TabsOrientation;\n testId?: string;\n to?: string;\n /**\n * @internal\n */\n theme?: any;\n}\n\nexport interface NavTabChildrenProps extends BaseNavTabProps {\n children: JSX.Element | string;\n /**\n * The href value of the tab link\n */\n to: string;\n}\n\nexport interface NavTabComponentProps extends BaseNavTabProps {\n /**\n * The prop for custom component instead of `a` in NavTab.\n */\n component: React.ReactNode;\n /**\n * The orientation of icon on NavTab\n */\n iconPosition?: TabsIconPosition;\n /**\n * If true, the tab will take up the full width of its container\n * @default false\n */\n isFullWidth?: boolean;\n}\n\nexport type NavTabProps = XOR<NavTabChildrenProps, NavTabComponentProps>;\n\nfunction instanceOfNavComponentTab(\n object: any\n): object is NavTabComponentProps {\n return 'component' in object && !('children' in object);\n}\n\nfunction instanceOfNavChildrenTab(object: any): object is NavTabChildrenProps {\n return !('component' in object) && 'children' in object;\n}\n\nconst StyledTab = styled.a<{\n borderPosition?: any;\n iconPosition?: TabsIconPosition;\n isActive?: boolean;\n isFullWidth?: boolean;\n isInverse?: boolean;\n orientation: TabsOrientation;\n theme: any;\n}>`\n ${TabStyles}\n`;\n\nexport const StyledCustomTab = React.forwardRef<any, NavTabComponentProps>(\n (props, ref) => {\n const { children, component, icon, style, onClick, ...rest } = props;\n\n if (React.isValidElement(component) && React.isValidElement(component)) {\n const cloneElement = (element, newProps) => {\n return jsx(element.type, {\n key: element.key,\n ref: element.ref,\n ...element.props,\n ...newProps,\n });\n };\n\n const other = omit(\n ['iconPosition', 'isInverse', 'isActive', 'isFullWidth'],\n rest\n );\n\n return cloneElement(component, {\n ...other,\n css: TabStyles(props),\n ...style,\n onClick,\n ref,\n children: (\n <>\n {icon}\n {component.props.children}\n </>\n ),\n });\n }\n }\n);\n\n// Using any type because we do not know the element type of a custom tab\nexport const NavTab = React.forwardRef<any, NavTabProps>((props, ref) => {\n let children;\n let component;\n const { isActive, icon, testId, to, ...other } = props;\n const theme = React.useContext(ThemeContext);\n\n if (instanceOfNavComponentTab(props)) {\n component = props.component;\n } else if (instanceOfNavChildrenTab(props)) {\n children = props.children;\n }\n\n const isIconOnly = !children;\n\n const {\n orientation,\n borderPosition,\n iconPosition,\n isInverse,\n isFullWidth,\n } = React.useContext(NavTabsContext);\n\n const tabIconPosition = iconPosition\n ? iconPosition\n : orientation === 'vertical'\n ? TabsIconPosition.left\n : TabsIconPosition.top;\n\n return (\n <StyledTabsChild\n borderPosition={borderPosition}\n data-testid=\"tabContainer\"\n isActive={isActive}\n isFullWidth={isFullWidth}\n isInverse={isInverse}\n orientation={orientation}\n theme={theme}\n >\n {component ? (\n <StyledCustomTab\n {...other}\n component={component}\n data-testid={testId}\n iconPosition={tabIconPosition}\n icon={\n icon && (\n <StyledIcon theme={theme} iconPosition={tabIconPosition}>\n {icon}\n </StyledIcon>\n )\n }\n isActive={isActive}\n isInverse={isInverse}\n isFullWidth={isFullWidth}\n orientation={orientation}\n theme={theme}\n />\n ) : (\n <StyledTab\n {...other}\n ref={ref}\n data-testid={testId}\n href={to}\n isActive={isActive}\n isFullWidth={isFullWidth}\n iconPosition={tabIconPosition}\n isInverse={isInverse}\n orientation={orientation}\n theme={theme}\n >\n {icon && (\n <StyledIcon\n theme={theme}\n iconPosition={tabIconPosition}\n isIconOnly={isIconOnly}\n >\n {icon}\n </StyledIcon>\n )}\n {children}\n </StyledTab>\n )}\n </StyledTabsChild>\n );\n});\n","import * as React from 'react';\nimport { Button, ButtonColor, ButtonProps, ButtonVariant } from '../Button';\nimport { BuildBorder, hoverBorder } from './Pagination';\nimport { darken } from 'polished';\nimport styled from '../../theme/styled';\nimport { ThemeContext } from '../../theme/ThemeContext';\n\nexport interface PageButtonProps extends ButtonProps {\n isSelected?: boolean;\n}\n\nexport function pageButtonTypeSize(props) {\n if (props.size === 'large') {\n return `${props.theme.typeScale.size05.fontSize}`;\n }\n return `${props.theme.typeScale.size03.fontSize}`;\n}\n\nfunction buttonSize(props) {\n switch (props.size) {\n case 'large':\n return `${props.theme.spaceScale.spacing11}`;\n default:\n return `${props.theme.spaceScale.spacing09}`;\n }\n}\n\nfunction boxShadowColor(props) {\n if (props.color === 'primary') {\n if (props.isInverse) {\n return `-${props.theme.spaceScale.spacing01} 0 0 ${props.theme.colors.neutral08}`;\n }\n return `-${props.theme.spaceScale.spacing01} 0 0 ${props.theme.colors.primary}`;\n }\n}\n\nfunction hoverBoxShadowColor(props) {\n if (props.color === 'primary') {\n if (props.isInverse) {\n return `-${props.theme.spaceScale.spacing01} 0 0 ${props.theme.colors.neutral08}`;\n }\n return `-${props.theme.spaceScale.spacing01} 0 0 ${darken(\n 0.1,\n props.theme.colors.primary\n )}`;\n }\n}\n\nconst StyledPageButton = styled(Button)`\n border: none;\n border-top: ${BuildBorder};\n border-right: ${BuildBorder};\n border-bottom: ${BuildBorder};\n border-radius: 0;\n box-shadow: ${boxShadowColor};\n font-size: ${pageButtonTypeSize} !important;\n height: ${buttonSize};\n margin: 0;\n min-width: 0;\n padding: 0;\n width: ${buttonSize};\n &:focus {\n border-color: ${hoverBorder};\n box-shadow: ${hoverBoxShadowColor};\n outline: 0 !important;\n outline-offset: 0;\n overflow: visible;\n z-index: 1;\n }\n &:focus:before {\n content: '';\n border: ${props =>\n props.isInverse\n ? `${props.theme.spaceScale.spacing01} solid ${props.theme.colors.focusInverse}`\n : `${props.theme.spaceScale.spacing01} solid ${props.theme.colors.focus}`};\n border-style: dotted;\n height: calc(100% + 14px);\n left: -7px;\n position: absolute;\n top: -7px;\n width: calc(100% + 14px);\n }\n`;\n\nexport const PageButton = React.forwardRef<HTMLButtonElement, PageButtonProps>(\n (props, ref) => {\n const { children, isInverse, isSelected, ...other } = props;\n const theme = React.useContext(ThemeContext);\n\n return (\n <StyledPageButton\n ref={ref}\n {...other}\n color={isSelected ? ButtonColor.primary : ButtonColor.secondary}\n theme={theme}\n isInverse={isInverse}\n variant={\n isInverse && !isSelected ? ButtonVariant.outline : ButtonVariant.solid\n }\n >\n {children}\n </StyledPageButton>\n );\n }\n);\n","import * as React from 'react';\nimport { ButtonColor, ButtonShape, ButtonSize, ButtonVariant } from '../Button';\nimport { darken } from 'polished';\nimport { I18nContext } from '../../i18n';\nimport { IconButton } from '../IconButton';\nimport { PageButton, pageButtonTypeSize } from './PageButton';\nimport { ArrowBackIcon, ArrowForwardIcon } from 'react-magma-icons';\nimport styled from '../../theme/styled';\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport { usePagination } from './usePagination';\n\nexport interface BasePaginationProps\n extends React.HTMLAttributes<HTMLDivElement> {\n testId?: string;\n isInverse?: boolean;\n page?: number;\n /**\n * The total number of Pagination buttons\n * @default 1\n */\n count?: number;\n /**\n * If true, disables all of the Pagination buttons\n * @default false\n */\n disabled?: boolean;\n /**\n * If true, hides the next page button\n * @default false\n */\n hideNextButton?: boolean;\n /**\n * If true, hides the previous page button\n * @default false\n */\n hidePreviousButton?: boolean;\n /**\n * Number of page buttons before and after the current page\n * @default 1\n */\n numberOfAdjacentPages?: number;\n /**\n * Number of page buttons at the beginning and end of the page number buttons list\n * @default 1\n */\n numberOfEdgePages?: number;\n /**\n * Event that fires when the page number changes\n */\n onPageChange?: (event: React.SyntheticEvent, newPage: number) => void;\n /**\n * Size toggles between default and large variant buttons.\n */\n size?: PageButtonSize;\n /**\n * If true, shows the first page button\n * @default false\n */\n showFirstButton?: boolean;\n /**\n * If true, shows the last page button\n * @default false\n */\n showLastButton?: boolean;\n}\n\nexport interface ControlledPaginationProps extends BasePaginationProps {\n defaultPage: never;\n /**\n * Current page number\n */\n page?: number;\n}\nexport interface UncontrolledPaginationProps extends BasePaginationProps {\n /**\n * Page selected by default when the component is uncontrolled\n */\n defaultPage?: number;\n page: number;\n}\nexport type PaginationProps =\n | ControlledPaginationProps\n | UncontrolledPaginationProps;\n\nexport enum PageButtonSize {\n medium = 'medium',\n large = 'large',\n}\n\nconst StyledNav = styled.nav`\n min-width: 0;\n`;\n\nconst StyledList = styled.ul`\n display: flex;\n margin: 0;\n padding: 0;\n`;\n\nconst StyledListItem = styled.li`\n list-style-type: none;\n &:last-child {\n button {\n border-left: none;\n }\n }\n`;\n\nexport function BuildBorder(props) {\n switch (props.color) {\n case 'primary':\n if (props.isInverse) {\n return `${props.theme.spaceScale.spacing01} solid ${props.theme.colors.neutral08}`;\n }\n return `${props.theme.spaceScale.spacing01} solid ${props.theme.colors.primary}`;\n default:\n if (props.isInverse) {\n if (props.disabled) {\n return `${props.theme.spaceScale.spacing01} solid ${props.theme.colors.tint04}`;\n }\n return `${props.theme.spaceScale.spacing01} solid ${props.theme.colors.neutral08}`;\n }\n if (props.disabled) {\n return `${props.theme.spaceScale.spacing01} solid ${props.theme.colors.neutral06}`;\n }\n return `${props.theme.spaceScale.spacing01} solid ${props.theme.colors.neutral05}`;\n }\n}\n\nexport function hoverBorder(props) {\n switch (props.color) {\n case 'primary':\n if (props.isInverse) {\n return `${props.theme.colors.neutral08}`;\n }\n return `${darken(0.1, props.theme.colors.primary)}`;\n default:\n if (props.isInverse) {\n return `${props.theme.colors.neutral08}`;\n }\n return `${props.theme.colors.neutral05}`;\n }\n}\n\nfunction BuildButtonSize(props) {\n switch (props.size) {\n case 'large':\n return `${props.theme.spaceScale.spacing11}`;\n default:\n return `${props.theme.spaceScale.spacing09}`;\n }\n}\n\nconst NavButton = styled(IconButton)`\n border-top: ${BuildBorder};\n border-right: ${BuildBorder};\n border-bottom: ${BuildBorder};\n border-left: ${BuildBorder};\n height: ${BuildButtonSize};\n margin: 0;\n padding: 0;\n width: ${BuildButtonSize};\n &:focus {\n z-index: 1;\n outline: 0 !important;\n outline-offset: 0;\n overflow: visible;\n }\n &:focus:before {\n content: '';\n border: ${props =>\n props.isInverse\n ? `${props.theme.spaceScale.spacing01} solid ${props.theme.colors.focusInverse}`\n : `${props.theme.spaceScale.spacing01} solid ${props.theme.colors.focus}`};\n border-style: dotted;\n height: calc(100% + 14px);\n left: -7px;\n position: absolute;\n top: -7px;\n width: calc(100% + 14px);\n }\n`;\n\nconst StyledEllipsis = styled.div`\n align-items: center;\n border-top: ${BuildBorder};\n border-right: ${BuildBorder};\n border-bottom: ${BuildBorder};\n display: flex;\n font-size: ${pageButtonTypeSize};\n height: ${BuildButtonSize};\n justify-content: center;\n width: ${BuildButtonSize};\n`;\n\nexport const Pagination = React.forwardRef<HTMLDivElement, PaginationProps>(\n (props, ref) => {\n const {\n count,\n defaultPage,\n disabled,\n hideNextButton,\n hidePreviousButton,\n isInverse,\n numberOfAdjacentPages,\n numberOfEdgePages,\n page,\n size = PageButtonSize.medium,\n showFirstButton,\n showLastButton,\n testId,\n onPageChange,\n ...other\n } = props;\n const theme = React.useContext(ThemeContext);\n const buttonSize =\n size === PageButtonSize.large ? ButtonSize.large : ButtonSize.medium;\n\n const { pageButtons } = usePagination({\n count,\n defaultPage,\n disabled,\n hideNextButton,\n hidePreviousButton,\n numberOfAdjacentPages,\n numberOfEdgePages,\n onPageChange,\n page,\n showFirstButton,\n showLastButton,\n });\n\n const i18n = React.useContext(I18nContext);\n\n return (\n <StyledNav {...other} theme={theme} data-testid={testId} ref={ref}>\n <StyledList>\n {pageButtons.map(\n ({ 'aria-current': ariaCurrent, page, type, ...other }, index) => {\n if (type === 'start-ellipsis' || type === 'end-ellipsis') {\n return (\n <StyledEllipsis\n key={index}\n isInverse={isInverse}\n size={size}\n theme={theme}\n >\n ...\n </StyledEllipsis>\n );\n } else if (type === 'page') {\n return (\n <StyledListItem\n aria-current={Boolean(ariaCurrent)}\n key={index}\n >\n <PageButton\n isInverse={isInverse}\n size={buttonSize}\n {...other}\n >\n {page}\n </PageButton>\n </StyledListItem>\n );\n } else if (type === 'previous' || type === 'next') {\n return (\n <StyledListItem key={index}>\n <NavButton\n variant={\n isInverse ? ButtonVariant.outline : ButtonVariant.solid\n }\n color={ButtonColor.secondary}\n aria-label={i18n.pagination[`${type}ButtonLabel`]}\n icon={\n type === 'previous' ? (\n <ArrowBackIcon />\n ) : (\n <ArrowForwardIcon />\n )\n }\n isInverse={isInverse}\n theme={theme}\n shape={\n type === 'previous'\n ? ButtonShape.leftCap\n : ButtonShape.rightCap\n }\n size={buttonSize}\n {...other}\n />\n </StyledListItem>\n );\n }\n }\n )}\n </StyledList>\n </StyledNav>\n );\n }\n);\n","import * as React from 'react';\nimport {\n DisplayInputStyles,\n DisplayInputActiveStyles,\n buildDisplayInputActiveBackground,\n buildDisplayInputFocusStyles,\n} from '../SelectionControls/InputStyles';\nimport { HiddenStyles } from '../../utils/UtilityStyles';\nimport { RadioContext } from '../RadioGroup';\nimport {\n RadioButtonCheckedIcon,\n RadioButtonUncheckedIcon,\n} from 'react-magma-icons';\nimport { StyledLabel } from '../SelectionControls/StyledLabel';\nimport { StyledContainer } from '../SelectionControls/StyledContainer';\n// Using the base `styled` from `emotion` until import mapping is fixed: https://github.com/emotion-js/emotion/pull/1220\n// import styled from '../../theme/styled';\nimport styled from '@emotion/styled';\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport { useGenerateId } from '../../utils';\n\nexport enum RadioTextPosition {\n left = 'left',\n right = 'right', // default\n}\n\nexport interface RadioProps\n extends React.InputHTMLAttributes<HTMLInputElement> {\n /**\n * @internal\n */\n css?: any; // Adding css prop to fix emotion error\n /**\n * Hex code for the background color\n * @default #0000FF\n */\n color?: string;\n /**\n * Style properties for the component container element\n */\n containerStyle?: React.CSSProperties;\n /**\n * Style properties for the radio button element\n */\n inputStyle?: React.CSSProperties;\n isInverse?: boolean;\n /**\n * If true, label text will be hidden visually, but will still be read by assistive technology\n * @default false\n */\n isTextVisuallyHidden?: boolean;\n /**\n * Style properties for the label element\n */\n labelStyle?: React.CSSProperties;\n /**\n * Content of label; can be node or string\n */\n labelText: React.ReactNode;\n testId?: string;\n /**\n * Whether the label appears to the left of the right of the radio button\n * @default RadioTextPosition.right\n */\n textPosition?: RadioTextPosition;\n}\n\nconst HiddenLabelText = styled.span`\n ${HiddenStyles};\n`;\n\nconst HiddenInput = styled.input<{ indeterminate?: boolean }>`\n ${HiddenStyles};\n`;\n\nfunction buildRadioIconColor(props) {\n if (props.disabled) {\n if (props.isInverse) {\n return props.theme.colors.tint04;\n }\n return props.theme.colors.neutral05;\n }\n if (props.isInverse) {\n return props.theme.colors.neutral08;\n }\n if (props.isChecked) {\n return props.color;\n }\n return props.theme.colors.neutral02;\n}\n\nexport function buildErrorBorder(props) {\n if (props.hasError) {\n if (props.isInverse) {\n return `0 0 0 2px ${props.theme.colors.dangerInverse}`;\n }\n return `0 0 0 2px ${props.theme.colors.danger}`;\n }\n return `inherit`;\n}\n\nconst StyledFakeInput = styled.span<{\n isChecked?: boolean;\n hasError?: boolean;\n isInverse: boolean;\n disabled: boolean;\n color: string;\n textPosition?: RadioTextPosition;\n theme?: any;\n}>`\n ${DisplayInputStyles};\n color: ${props => buildRadioIconColor(props)};\n cursor: ${props => (props.disabled ? 'not-allowed' : 'pointer')};\n margin: ${props =>\n props.textPosition === 'left'\n ? `0 0 0 ${props.theme.spaceScale.spacing03}`\n : `0 ${props.theme.spaceScale.spacing03} 0 0`};\n box-shadow: ${buildErrorBorder};\n\n ${HiddenInput}:checked:not (:disabled) + label & {\n background: ${props => {\n if (props.isInverse) {\n return props.theme.colors.neutral08;\n }\n }};\n }\n\n ${HiddenInput}:focus + label & {\n // focus state\n &:before {\n ${props => buildDisplayInputFocusStyles(props)};\n }\n }\n\n &:after {\n // active state\n background: ${props => buildDisplayInputActiveBackground(props)};\n }\n\n ${HiddenInput}:not(:disabled):active + label & {\n &:after {\n ${DisplayInputActiveStyles}\n }\n }\n`;\n\nexport const Radio = React.forwardRef<HTMLInputElement, RadioProps>(\n (props, ref) => {\n const id = useGenerateId(props.id);\n const context = React.useContext(RadioContext);\n const theme = React.useContext(ThemeContext);\n const {\n color = theme.colors.primary,\n containerStyle,\n disabled,\n inputStyle,\n isInverse,\n isTextVisuallyHidden,\n labelStyle,\n labelText,\n required,\n testId,\n textPosition,\n value,\n ...other\n } = props;\n\n return (\n <StyledContainer style={containerStyle}>\n <HiddenInput\n {...other}\n aria-labelledby={context.descriptionId}\n id={id}\n ref={ref}\n checked={context.selectedValue === value}\n data-testid={testId}\n disabled={disabled}\n name={context.name}\n required={context.required || required}\n type=\"radio\"\n value={value}\n onBlur={context.onBlur}\n onChange={context.onChange}\n onFocus={context.onFocus}\n />\n <StyledLabel\n htmlFor={id}\n isInverse={context.isInverse || isInverse}\n style={labelStyle}\n >\n {!isTextVisuallyHidden &&\n textPosition === RadioTextPosition.left &&\n labelText}\n\n <StyledFakeInput\n isChecked={context.selectedValue === value}\n color={color}\n disabled={disabled}\n isInverse={context.isInverse || isInverse}\n hasError={context.hasError}\n style={inputStyle}\n textPosition={textPosition}\n theme={theme}\n >\n {context.selectedValue === value ? (\n <RadioButtonCheckedIcon />\n ) : (\n <RadioButtonUncheckedIcon />\n )}\n </StyledFakeInput>\n {isTextVisuallyHidden ? (\n <HiddenLabelText>{labelText}</HiddenLabelText>\n ) : (\n textPosition !== RadioTextPosition.left && labelText && labelText\n )}\n </StyledLabel>\n </StyledContainer>\n );\n }\n);\n","import * as React from 'react';\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport { I18nContext } from '../../i18n';\nimport { Announce } from '../Announce';\nimport { InputBase, InputSize, InputType } from '../InputBase';\nimport { Button, ButtonVariant, ButtonType, ButtonSize } from '../Button';\nimport {\n FormFieldContainer,\n FormFieldContainerBaseProps,\n} from '../FormFieldContainer';\nimport { useIsInverse } from '../../inverse';\nimport { VisuallyHidden } from '../VisuallyHidden';\n\nimport { useGenerateId } from '../../utils';\n\nexport interface PasswordInputProps\n extends Omit<FormFieldContainerBaseProps, 'fieldId'>,\n React.InputHTMLAttributes<HTMLInputElement> {\n hiddenPasswordAnnounceText?: string;\n /**\n * Aria-label for the \"Hide Password\" button\n * @default \"Hide password\"\n */\n hidePasswordButtonAriaLabel?: string;\n /**\n * Text displayed on screen for the \"Hide Password\" button\n * @default \"Hide\"\n */\n hidePasswordButtonText?: string;\n isInverse?: boolean;\n /**\n * If true, label text will be hidden visually, but will still be read by assistive technology\n * @default false\n */\n isPasswordMaskButtonHidden?: boolean;\n shownPasswordAnnounceText?: string;\n /**\n * Aria-label for the \"Show Password\" button\n * @default \"Show password. Note: this will visually expose your password on the screen\"\n */\n showPasswordButtonAriaLabel?: string;\n /**\n * Text displayed on screen for the \"Show Password\" button\n * @default \"Show\"\n */\n showPasswordButtonText?: string;\n testId?: string;\n}\n\nexport const PasswordInput = React.forwardRef<\n HTMLInputElement,\n PasswordInputProps\n>((props, ref) => {\n const [passwordShown, setPasswordShown] = React.useState<boolean>(false);\n\n function togglePasswordShown() {\n setPasswordShown(prevPasswordShown => !prevPasswordShown);\n }\n\n const {\n containerStyle,\n errorMessage,\n helperMessage,\n hiddenPasswordAnnounceText,\n hidePasswordButtonAriaLabel,\n hidePasswordButtonText,\n isPasswordMaskButtonHidden,\n id: defaultId,\n inputSize = InputSize.medium,\n labelStyle,\n labelText,\n isLabelVisuallyHidden,\n messageStyle,\n shownPasswordAnnounceText,\n showPasswordButtonAriaLabel,\n showPasswordButtonText,\n type,\n ...other\n } = props;\n\n const i18n = React.useContext(I18nContext);\n\n const id = useGenerateId(defaultId);\n\n const HIDDEN_PASSWORD_ANNOUNCE_TEXT = hiddenPasswordAnnounceText\n ? hiddenPasswordAnnounceText\n : i18n.password.hidden.announce;\n const HIDE_PASSWORD_BUTTON_ARIA_LABEL = hidePasswordButtonAriaLabel\n ? hidePasswordButtonAriaLabel\n : i18n.password.hidden.ariaLabel;\n const HIDE_PASSWORD_BUTTON_TEXT = hidePasswordButtonText\n ? hidePasswordButtonText\n : i18n.password.hidden.buttonText;\n const SHOWN_PASSWORD_ANNOUNCE_TEXT = shownPasswordAnnounceText\n ? shownPasswordAnnounceText\n : i18n.password.shown.announce;\n const SHOW_PASSWORD_BUTTON_ARIA_LABEL = showPasswordButtonAriaLabel\n ? showPasswordButtonAriaLabel\n : i18n.password.shown.ariaLabel;\n const SHOW_PASSWORD_BUTTON_TEXT = showPasswordButtonText\n ? showPasswordButtonText\n : i18n.password.shown.buttonText;\n\n const descriptionId = errorMessage || helperMessage ? `${id}__desc` : null;\n const theme = React.useContext(ThemeContext);\n\n const isInverse = useIsInverse(props.isInverse);\n\n return (\n <FormFieldContainer\n containerStyle={containerStyle}\n errorMessage={errorMessage}\n fieldId={id}\n helperMessage={helperMessage}\n inputSize={inputSize}\n isLabelVisuallyHidden={isLabelVisuallyHidden}\n isInverse={isInverse}\n labelStyle={labelStyle}\n labelText={labelText}\n >\n <InputBase\n autoCorrect=\"off\"\n autoCapitalize=\"none\"\n {...other}\n aria-describedby={\n descriptionId ? descriptionId : props['aria-describedby']\n }\n aria-invalid={!!errorMessage}\n hasError={!!errorMessage}\n id={id}\n inputSize={inputSize}\n isInverse={isInverse}\n ref={ref}\n type={passwordShown ? InputType.text : InputType.password}\n >\n {!isPasswordMaskButtonHidden && (\n <>\n <Button\n aria-label={\n passwordShown\n ? HIDE_PASSWORD_BUTTON_ARIA_LABEL\n : SHOW_PASSWORD_BUTTON_ARIA_LABEL\n }\n isInverse={false}\n onClick={togglePasswordShown}\n size={ButtonSize.small}\n style={{\n borderRadius: theme.borderRadius,\n height:\n inputSize == InputSize.large\n ? theme.spaceScale.spacing10\n : theme.spaceScale.spacing08,\n margin: ' 0 3px 0 0 ',\n }}\n type={ButtonType.button}\n variant={ButtonVariant.link}\n >\n {passwordShown\n ? HIDE_PASSWORD_BUTTON_TEXT\n : SHOW_PASSWORD_BUTTON_TEXT}\n </Button>\n <VisuallyHidden>\n <Announce>\n {passwordShown\n ? SHOWN_PASSWORD_ANNOUNCE_TEXT\n : HIDDEN_PASSWORD_ANNOUNCE_TEXT}\n </Announce>\n </VisuallyHidden>\n </>\n )}\n </InputBase>\n </FormFieldContainer>\n );\n});\n","import * as React from 'react';\nimport { Label } from '../Label';\nimport { HiddenStyles } from '../../utils/UtilityStyles';\nimport { InputMessage } from '../Input/InputMessage';\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport { useIsInverse } from '../../inverse';\n\nimport styled from '../../theme/styled';\nimport { omit, useGenerateId } from '../../utils';\n\nconst HiddenLabel = styled.label`\n ${HiddenStyles};\n`;\n\n/**\n * @children required\n */\nexport interface RadioGroupProps extends React.HTMLAttributes<HTMLDivElement> {\n /**\n * Action that fires when the radio group loses focus\n */\n onBlur?: (event?: React.FocusEvent) => void;\n /**\n * Action that fires when selected value of the radio group changes\n */\n onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;\n /**\n * Action that fires when one of the radio buttons within the group receives focus\n */\n onFocus?: (event: React.FocusEvent) => void;\n /**\n * Style properties for the component container element\n */\n containerStyle?: React.CSSProperties;\n /**\n * Content of the error message. If a value is provided, the radio buttons will be styled to show an error state\n */\n errorMessage?: React.ReactNode;\n /**\n * Content of the helper message\n */\n helperMessage?: React.ReactNode;\n isInverse?: boolean;\n /**\n * If true, label text for the radio group will be hidden visually, but will still be read by assistive technology\n * @default false\n */\n isTextVisuallyHidden?: boolean;\n /**\n * ID of the element that labels the radio group, used in the aria-labelledby attribute for the group. Alternatively, the labelText prop can be used\n */\n labelledById?: string;\n /**\n * Style properties for the label of the radio group\n */\n labelStyle?: React.CSSProperties;\n /**\n * Content of label of the radio group; can be node or string. Alternatively, the labelledById prop can be used\n */\n labelText?: React.ReactNode;\n /**\n * Name attribute the radio group\n */\n name: string;\n /**\n * If true, the user must select one radio button for the form to be valid\n * @default false\n */\n required?: boolean;\n testId?: string;\n /**\n * Value of the radio button that is the default selected value for the group\n */\n value?: string;\n}\n\nexport interface RadioContextInterface {\n descriptionId?: string;\n hasError?: boolean;\n isInverse?: boolean;\n required?: boolean;\n name: string;\n selectedValue?: string;\n onBlur?: (event: React.FocusEvent) => void;\n onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;\n onFocus?: (event: React.FocusEvent) => void;\n}\n\nexport const RadioContext = React.createContext<RadioContextInterface>({\n hasError: false,\n name: 'defaultName',\n});\n\nexport const RadioGroup = React.forwardRef<HTMLDivElement, RadioGroupProps>(\n (props, ref) => {\n const id = useGenerateId(props.id);\n const [selectedValue, setSelectedValue] = React.useState<string>(\n props.value\n );\n\n React.useEffect(() => {\n setSelectedValue(props.value);\n }, [props.value]);\n\n function handleChange(event: React.ChangeEvent<HTMLInputElement>) {\n const { value: newSelectedValue } = event.target;\n props.onChange &&\n typeof props.onChange === 'function' &&\n props.onChange(event);\n setSelectedValue(newSelectedValue);\n }\n\n const {\n containerStyle,\n errorMessage,\n helperMessage,\n required,\n isTextVisuallyHidden,\n labelledById,\n labelStyle,\n labelText,\n testId,\n name,\n children,\n ...rest\n } = props;\n const other = omit(['onBlur', 'onChange', 'onFocus', 'id'], rest);\n\n const descriptionId = errorMessage || helperMessage ? `${id}__desc` : null;\n\n const theme = React.useContext(ThemeContext);\n\n const isInverse = useIsInverse(props.isInverse);\n\n return (\n <div\n {...other}\n aria-labelledby={labelledById ? labelledById : id}\n style={containerStyle}\n data-testid={testId}\n ref={ref}\n role=\"radiogroup\"\n >\n <RadioContext.Provider\n value={{\n descriptionId,\n hasError: !!errorMessage,\n isInverse,\n required,\n name,\n selectedValue,\n onBlur: props.onBlur,\n onChange: handleChange,\n onFocus: props.onFocus,\n }}\n >\n {labelText && isTextVisuallyHidden && (\n <HiddenLabel id={id} style={labelStyle}>\n {labelText}\n </HiddenLabel>\n )}\n\n {labelText && !isTextVisuallyHidden && (\n <Label\n id={id}\n style={labelStyle}\n isInverse={isInverse}\n theme={theme}\n >\n {labelText}\n </Label>\n )}\n {children}\n\n <InputMessage\n id={descriptionId}\n hasError={!!errorMessage}\n isInverse={isInverse}\n >\n {(errorMessage || helperMessage) && (\n <>{errorMessage ? errorMessage : helperMessage}</>\n )}\n </InputMessage>\n </RadioContext.Provider>\n </div>\n );\n }\n);\n","import * as React from 'react';\nimport ReactDOM from 'react-dom';\nimport styled from '@emotion/styled';\nimport { Global, css } from '@emotion/core';\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport { magma } from '../../theme/magma';\nimport { I18nContext } from '../../i18n';\nimport { ButtonColor, ButtonVariant } from '../Button';\nimport { IconButton } from '../IconButton';\nimport { CloseIcon } from 'react-magma-icons';\nimport { Heading } from '../Heading';\nimport { TypographyVisualStyle } from '../Typography';\nimport { Transition, TransitionProps } from '../Transition';\nimport { ThemeInterface } from '../../theme/magma';\nimport { omit, useGenerateId, usePrevious } from '../../utils';\nimport { useFocusLock } from '../../hooks/useFocusLock';\n\nexport enum ModalSize {\n large = 'large',\n medium = 'medium', //default\n small = 'small',\n}\n\n/**\n * @children required\n */\nexport interface ModalProps extends React.HTMLAttributes<HTMLDivElement> {\n /**\n * The text read by screen readers for the close button\n * @default \"Close dialog\"\n */\n closeAriaLabel?: string;\n /**\n * Style for the modal container\n */\n closeButtonSize?: keyof typeof magma.iconSizes;\n /**\n * Style for the modal container\n */\n containerStyle?: React.CSSProperties;\n /**\n * The content of the modal header\n */\n header?: React.ReactNode;\n /**\n * If true, clicking the backdrop will not dismiss the modal\n * @default false\n */\n isBackgroundClickDisabled?: boolean;\n /**\n * If true, the close button the the modal will be suppressed\n * @default false\n */\n isCloseButtonHidden?: boolean;\n /**\n * If true, pressing the Escape key will not dismiss the modal\n * @false\n */\n isEscKeyDownDisabled?: boolean;\n /**\n * If true, the modal will be visible\n * @default false\n */\n isOpen?: boolean;\n /**\n * If true, the modal will removed from the DOM when closed\n * @default true\n */\n unmountOnExit?: boolean;\n /**\n * @internal\n */\n containerTransition?: Omit<TransitionProps, 'isOpen'>;\n /**\n * Action that fires when the close button is clicked\n */\n onClose?: () => void;\n /**\n * Action that fires when the Escape key is pressed\n */\n onEscKeyDown?: (event: KeyboardEvent) => void;\n /**\n * The relative size of the modal\n * @default ModalSize.medium\n */\n size?: ModalSize;\n testId?: string;\n /**\n * @internal\n */\n theme?: ThemeInterface;\n}\n\nconst ModalContainer = styled(Transition)<{\n theme: ThemeInterface;\n}>`\n bottom: 0;\n left: 0;\n overflow-y: auto;\n padding: ${props => props.theme.spaceScale.spacing03};\n right: 0;\n top: 0;\n z-index: 998;\n`;\n\nconst ModalBackdrop = styled(Transition)<{ isExiting?: boolean }>`\n backdrop-filter: blur(3px);\n background: rgba(0, 0, 0, 0.6);\n bottom: 0;\n left: 0;\n right: 0;\n top: 0;\n z-index: 997;\n position: fixed;\n`;\n\nconst ModalContent = styled.div<ModalProps & { isExiting?: boolean }>`\n background: ${props => props.theme.colors.neutral08};\n border: 1px solid;\n border-color: ${props => props.theme.colors.neutral06};\n border-radius: ${props => props.theme.borderRadius};\n box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);\n color: ${props => props.theme.colors.neutral};\n margin: 0 auto;\n position: relative;\n z-index: 1000;\n\n max-width: ${props => {\n switch (props.size) {\n case 'large':\n return props.theme.modal.width.large;\n case 'small':\n return props.theme.modal.width.small;\n default:\n return props.theme.modal.width.medium;\n }\n }};\n\n @media (min-width: ${props => props.theme.breakpoints.small}px) {\n margin: ${props => props.theme.spaceScale.spacing08} auto;\n }\n`;\n\nconst ModalHeader = styled.div<{ theme?: ThemeInterface }>`\n padding: ${props => props.theme.spaceScale.spacing03}\n ${props => props.theme.spaceScale.spacing05} 0\n ${props => props.theme.spaceScale.spacing05};\n @media (min-width: ${props => props.theme.breakpoints.small}px) {\n padding: ${props => props.theme.spaceScale.spacing05}\n ${props => props.theme.spaceScale.spacing06} 0\n ${props => props.theme.spaceScale.spacing06};\n }\n`;\n\nconst H1 = styled(Heading)<{ theme?: ThemeInterface }>`\n font-size: ${props =>\n props.theme.typographyVisualStyles.headingSmall.desktop.fontSize};\n line-height: ${props =>\n props.theme.typographyVisualStyles.headingSmall.desktop.lineHeight};\n margin: 0;\n padding-right: ${props => props.theme.spaceScale.spacing10};\n`;\n\nconst CloseBtn = styled.span`\n position: absolute;\n top: 0;\n right: 0;\n`;\nconst ModalBody = styled.div<{ theme?: ThemeInterface }>`\n padding: ${props => props.theme.spaceScale.spacing05};\n\n @media (min-width: ${props => props.theme.breakpoints.small}px) {\n padding: ${props => props.theme.spaceScale.spacing06};\n }\n`;\n\nexport const Modal = React.forwardRef<HTMLDivElement, ModalProps>(\n (props, ref) => {\n const lastFocus = React.useRef<any>();\n const headingRef = React.useRef<any>();\n const bodyRef = React.useRef<any>();\n\n const id = useGenerateId(props.id);\n const headingId = `${id}_heading`;\n const contentId = `${id}_content`;\n\n const [isModalOpen, setIsModalOpen] = React.useState<boolean>(props.isOpen);\n const [isExiting, setIsExiting] = React.useState<boolean>(false);\n const [currentTarget, setCurrentTarget] = React.useState(null);\n\n const focusTrapElement = useFocusLock(\n isModalOpen,\n props.header ? headingRef : null,\n bodyRef\n );\n\n const prevOpen = usePrevious(props.isOpen);\n\n React.useEffect(() => {\n if (!prevOpen && props.isOpen) {\n setIsModalOpen(true);\n } else if (prevOpen && !props.isOpen && isModalOpen) {\n handleClose();\n }\n }, [props.isOpen]);\n\n React.useEffect(() => {\n if (isModalOpen) {\n lastFocus.current = document.activeElement;\n\n if (!props.isEscKeyDownDisabled) {\n document.body.addEventListener('keydown', handleEscapeKeyDown, false);\n }\n }\n\n return () => {\n document.body.removeEventListener(\n 'keydown',\n handleEscapeKeyDown,\n false\n );\n };\n }, [isModalOpen]);\n\n function handleModalClick(event: React.SyntheticEvent) {\n if (\n !document.getElementById(contentId).contains(event.target as Node) &&\n event.target === currentTarget\n ) {\n handleClose(event);\n }\n }\n\n function handleModalOnMouseDown(event: React.SyntheticEvent) {\n setCurrentTarget(event.target);\n }\n\n function handleEscapeKeyDown(event: KeyboardEvent) {\n if (event.key === 'Escape') {\n event.preventDefault();\n event.stopPropagation();\n\n props.onEscKeyDown &&\n typeof props.onEscKeyDown === 'function' &&\n props.onEscKeyDown(event);\n\n handleClose(event);\n }\n }\n\n function handleClose(event?) {\n if (event) {\n event.stopPropagation();\n }\n setIsExiting(true);\n\n setTimeout(() => {\n setIsExiting(false);\n setIsModalOpen(false);\n\n if (lastFocus.current) {\n lastFocus.current.focus();\n }\n\n props.onClose && typeof props.onClose === 'function' && props.onClose();\n }, 300);\n }\n\n const {\n children,\n closeAriaLabel,\n closeButtonSize,\n containerStyle,\n containerTransition = { slideTop: true },\n isBackgroundClickDisabled,\n isEscKeyDownDisabled,\n header,\n isCloseButtonHidden,\n isOpen,\n unmountOnExit = true,\n testId,\n ...rest\n } = props;\n\n const other = omit(['onEscKeyDown'], rest);\n const theme = React.useContext(ThemeContext);\n const i18n = React.useContext(I18nContext);\n\n const CloseIconButton = (\n <CloseIcon\n color={theme.colors.neutral03}\n size={\n magma.iconSizes[closeButtonSize]\n ? magma.iconSizes[closeButtonSize]\n : magma.iconSizes.small\n }\n />\n );\n\n return isModalOpen\n ? ReactDOM.createPortal(\n <div ref={focusTrapElement}>\n <Global\n styles={css`\n html {\n overflow: ${isOpen} ? hidden : auto;\n }\n `}\n />\n <ModalContainer\n aria-labelledby={header ? headingId : null}\n aria-label=\"modal\"\n aria-describedby=\"modal\"\n aria-modal={true}\n data-testid={testId}\n id={id}\n onClick={isBackgroundClickDisabled ? null : handleModalClick}\n onMouseDown={\n isBackgroundClickDisabled ? null : handleModalOnMouseDown\n }\n role=\"dialog\"\n style={containerStyle}\n theme={theme}\n isOpen={isModalOpen}\n {...containerTransition}\n unmountOnExit={unmountOnExit}\n >\n <ModalContent\n {...other}\n data-testid=\"modal-content\"\n id={contentId}\n isExiting={isExiting}\n ref={ref}\n theme={theme}\n >\n {header && (\n <ModalHeader theme={theme}>\n {header && (\n <H1\n id={headingId}\n level={1}\n ref={headingRef}\n visualStyle={TypographyVisualStyle.headingSmall}\n tabIndex={-1}\n theme={theme}\n >\n {header}\n </H1>\n )}\n </ModalHeader>\n )}\n <ModalBody ref={bodyRef} theme={theme}>\n {children}\n </ModalBody>\n {!isCloseButtonHidden && (\n <CloseBtn>\n <IconButton\n aria-label={\n closeAriaLabel\n ? closeAriaLabel\n : i18n.modal.closeAriaLabel\n }\n color={ButtonColor.secondary}\n icon={CloseIconButton}\n onClick={handleClose}\n testId=\"modal-closebtn\"\n variant={ButtonVariant.link}\n />\n </CloseBtn>\n )}\n </ModalContent>\n </ModalContainer>\n <ModalBackdrop\n data-testid=\"modal-backdrop\"\n isExiting={isExiting}\n onMouseDown={\n isBackgroundClickDisabled\n ? event => event.preventDefault()\n : null\n }\n fade\n isOpen={isModalOpen}\n unmountOnExit\n />\n </div>,\n document.getElementsByTagName('body')[0]\n )\n : null;\n }\n);\n","import * as React from 'react';\nimport { AnimatePresence, motion, HTMLMotionProps } from 'framer-motion';\nimport { MotionVariants } from '../../theme/components/transition';\n\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport { ThemeInterface } from '../../theme/magma';\n\n/**\n * @children required\n */\nexport interface TransitionProps extends HTMLMotionProps<'div'> {\n /**\n * If `true`, the element will unmount when `in={false}` and animation is done\n * @default false\n */\n unmountOnExit?: boolean;\n /**\n * If `true`, the content will animate in\n * @default false\n */\n isOpen?: boolean;\n /**\n * Custom variants to be applied to the enter and exit transitions.\n * @internal\n */\n customTransition?: MotionVariants<'enter' | 'exit'>;\n testId?: string;\n /**\n * Should children fade in/out\n * @default false\n */\n fade?: boolean;\n /**\n * Should children scale in/out\n * @default false\n */\n scale?: boolean;\n /**\n * Should children slide in/out from the top of the screen\n * @default false\n */\n slideTop?: boolean;\n /**\n * Should children slide in/out from the bottom of the screen\n * @default false\n */\n slideBottom?: boolean;\n /**\n * Should children slide in/out from the left of the screen\n * @default false\n */\n slideLeft?: boolean;\n /**\n * Should children slide in/out from the right of the screen\n * @default false\n */\n slideRight?: boolean;\n /**\n * Should the children get nudged in 50px from the top\n * @default false\n */\n nudgeTop?: boolean;\n /**\n * Should the children get nudged in 50px from the bottom\n * @default false\n */\n nudgeBottom?: boolean;\n /**\n * Should the children get nudged in 50px from the left\n * @default false\n */\n nudgeLeft?: boolean;\n /**\n * Should the children get nudged in 50px from the right\n * @default false\n */\n nudgeRight?: boolean;\n /**\n * Should children collapse in/out\n * @default false\n */\n collapse?: boolean;\n /**\n * Should children rotate 45 degrees\n * @default false\n */\n rotate45?: boolean;\n /**\n * Should children rotate 90 degrees\n * @default false\n */\n rotate90?: boolean;\n /**\n * Should children rotate 180 degrees\n * @default false\n */\n rotate180?: boolean;\n}\n\nexport const Transition = React.forwardRef<HTMLDivElement, TransitionProps>(\n (props, ref) => {\n const theme: ThemeInterface = React.useContext(ThemeContext);\n\n const {\n style,\n unmountOnExit,\n isOpen,\n testId,\n initial = 'exit',\n exit = 'exit',\n customTransition = {\n enter: { transition: {} },\n exit: { transition: {} },\n },\n ...rest\n } = props;\n\n const shouldExpand = unmountOnExit ? isOpen && unmountOnExit : true;\n\n const variants = Object.keys(rest).reduce(\n (acc, key) => {\n if (rest[key] && theme.transitions[key]) {\n const themeVariant = theme.transitions[key];\n rest[key] = undefined;\n return {\n baseStyle: {\n ...acc.baseStyle,\n ...themeVariant.baseStyle,\n },\n motion: {\n ...acc,\n enter: {\n ...acc.motion.enter,\n ...themeVariant.motion.enter,\n transition: {\n ...('transition' in acc.motion.enter\n ? acc.motion.enter.transition\n : {}),\n ...('transition' in themeVariant.motion.enter\n ? themeVariant.motion.enter.transition\n : {}),\n },\n },\n exit: {\n ...acc.motion.exit,\n ...themeVariant.motion.exit,\n transition: {\n ...('transition' in acc.motion.exit\n ? acc.motion.exit.transition\n : {}),\n ...('transition' in themeVariant.motion.exit\n ? themeVariant.motion.exit.transition\n : {}),\n },\n },\n },\n };\n }\n return acc;\n },\n { motion: customTransition, baseStyle: {} }\n );\n\n return (\n <AnimatePresence initial={false}>\n {shouldExpand && (\n <motion.div\n ref={ref}\n initial={initial}\n exit={exit}\n data-testid={testId}\n animate={isOpen || unmountOnExit ? 'enter' : 'exit'}\n variants={variants.motion}\n style={{ ...variants.baseStyle, ...style }}\n {...rest}\n />\n )}\n </AnimatePresence>\n );\n }\n);\n","import * as React from 'react';\n// import styled from '../../theme/styled';\nimport {\n InputBase,\n InputBaseProps,\n InputIconPosition,\n InputSize,\n InputType,\n} from '../InputBase';\nimport { I18nContext } from '../../i18n';\nimport { useIsInverse } from '../../inverse';\nimport { SearchIcon } from 'react-magma-icons';\nimport { Spinner } from '../Spinner';\n\nexport interface SearchProps extends InputBaseProps {\n /**\n * Style properties for the component container element\n */\n containerStyle?: React.CSSProperties;\n /**\n * Text for icon button aria-label\n * @default \"Search\"\n */\n iconAriaLabel?: string;\n /**\n * Relative size of the component\n * @default InputSize.medium\n */\n inputSize?: InputSize;\n /**\n * Style properties for the input element\n */\n inputStyle?: React.CSSProperties;\n /**\n * Clear contents of input by clicking a clear button\n */\n iconPosition?: InputIconPosition;\n isClearable?: boolean;\n /**\n * If true, the component will show a loading animation instead of a search button\n * @default false\n */\n isLoading?: boolean;\n isInverse?: boolean;\n /**\n * Text for input aria-label\n * @default \"Search\"\n */\n labelText?: string;\n /**\n * Action that will fire when search icon button is clicked\n */\n onSearch: (term: string) => void;\n testId?: string;\n /**\n * Value of the input element\n */\n value?: string;\n}\n\nexport const Search = React.forwardRef<HTMLInputElement, SearchProps>(\n (props, ref) => {\n const {\n iconAriaLabel,\n isClearable,\n isLoading,\n labelText,\n placeholder,\n onSearch,\n ...other\n } = props;\n\n const i18n = React.useContext(I18nContext);\n\n const [value, setValue] = React.useState<string>(props.value);\n\n const icon = isLoading ? <Spinner /> : <SearchIcon />;\n\n React.useEffect(() => {\n setValue(props.value);\n }, [props.value]);\n\n function handleChange(event: React.ChangeEvent<HTMLInputElement>) {\n props.onChange &&\n typeof props.onChange === 'function' &&\n props.onChange(event);\n setValue(event.target.value);\n }\n\n // handle search on enter\n function handleKeyPress(event: React.KeyboardEvent) {\n if (event.key === 'Enter') {\n event.preventDefault();\n handleSearch();\n }\n }\n\n function handleSearch() {\n onSearch(value);\n }\n\n return (\n <InputBase\n {...other}\n aria-label={labelText ? labelText : i18n.search.input.ariaLabel}\n icon={icon}\n iconAriaLabel={\n iconAriaLabel ? iconAriaLabel : i18n.search.iconAriaLabel\n }\n isClearable={isClearable}\n isInverse={useIsInverse(props.isInverse)}\n onChange={handleChange}\n onIconClick={\n props.isPredictive ? null : isLoading ? null : handleSearch\n }\n onKeyDown={handleKeyPress}\n placeholder={placeholder ? placeholder : i18n.search.input.placeholder}\n type={InputType.search}\n value={value}\n ref={ref}\n />\n );\n }\n);\n","import React from 'react';\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport { I18nContext } from '../../i18n';\nimport { StyledCard, StyledList, StyledItem } from './shared';\nimport {\n UseSelectGetMenuPropsOptions,\n UseSelectGetItemPropsOptions,\n} from 'downshift';\nimport { instanceOfToBeCreatedItemObject } from '.';\nimport {\n defaultComponents,\n SelectComponents,\n ItemRenderOptions,\n} from './components';\nimport styled from '../../theme/styled';\nimport { convertStyleValueToString } from '../../utils';\n\ninterface ItemsListProps<T> {\n customComponents?: SelectComponents<T>;\n getItemProps: (options?: UseSelectGetItemPropsOptions<T>) => any;\n getMenuProps: (options?: UseSelectGetMenuPropsOptions) => any;\n highlightedIndex?: number;\n isOpen?: boolean;\n items: T[];\n itemToString: (item: T) => string;\n maxHeight?: number | string;\n menuStyle?: React.CSSProperties;\n}\n\nconst NoItemsMessage = styled.span`\n color: ${props => props.theme.colors.neutral04};\n display: block;\n padding-top: ${props => props.theme.spaceScale.spacing03};\n text-align: center;\n`;\n\nexport function ItemsList<T>(props: ItemsListProps<T>) {\n const {\n customComponents,\n isOpen,\n getMenuProps,\n items,\n itemToString,\n highlightedIndex,\n getItemProps,\n maxHeight,\n menuStyle,\n } = props;\n\n const theme = React.useContext(ThemeContext);\n const i18n = React.useContext(I18nContext);\n\n const hasItems = items && items.length > 0;\n\n const heightString = convertStyleValueToString(maxHeight);\n const { Item } = defaultComponents<T>({\n ...customComponents,\n });\n\n return (\n <StyledCard\n hasDropShadow\n isInverse={false}\n isOpen={isOpen}\n style={menuStyle}\n >\n <StyledList isOpen={isOpen} {...getMenuProps()} maxHeight={heightString}>\n {isOpen && hasItems ? (\n items.map((item, index) => {\n const itemString = instanceOfToBeCreatedItemObject(item)\n ? item.label\n : itemToString(item);\n\n const { ref, ...otherDownshiftItemProps } = getItemProps({\n item,\n index,\n });\n\n const key = `${itemString}${index}`;\n\n const itemProps: ItemRenderOptions<T> = {\n isFocused: highlightedIndex === index,\n itemRef: ref,\n item,\n itemString,\n key,\n theme,\n ...otherDownshiftItemProps,\n };\n\n return <Item<T> {...itemProps} key={key} />;\n })\n ) : (\n <StyledItem tabIndex={-1}>\n <NoItemsMessage theme={theme}>\n {i18n.emptyItemsListText}\n </NoItemsMessage>\n </StyledItem>\n )}\n </StyledList>\n </StyledCard>\n );\n}\n","import * as React from 'react';\nimport {\n useSelect,\n useMultipleSelection,\n UseSelectProps,\n UseMultipleSelectionProps,\n} from 'downshift';\n\nimport { Select as InternalSelect } from './Select';\nimport { MultiSelect } from './MultiSelect';\nimport { SelectComponents } from './components';\nimport { useGenerateId, XOR, Omit } from '../../utils';\nimport { LabelPosition } from '../Label';\nimport { useIsInverse } from '../../inverse';\n\nexport type SelectOptions =\n | string\n | { value: string; label: string; [key: string]: any }\n | any;\n\nexport interface InternalSelectProps<T> {\n /**\n * This complex object includes all the compositional components that are used. If you wish to overwrite a component, pass in a component to the appropriate namespace\n */\n components?: SelectComponents<T>;\n /**\n * Style properties for the component container\n */\n containerStyle?: React.CSSProperties;\n /**\n * Content of the error message. If a value is provided, the component will be styled to show an error state\n */\n errorMessage?: React.ReactNode;\n /**\n * Content of the helper message\n */\n helperMessage?: React.ReactNode;\n /**\n * Style properties for the select trigger or combobox input\n */\n inputStyle?: React.CSSProperties;\n /**\n * If true, the component include a button for clearing the field\n * @default false\n */\n isClearable?: boolean;\n /**\n * Max-height for the item menu list ul element\n */\n itemListMaxHeight?: number | string;\n /**\n * If true, item will be disabled; it will appear dimmed and events will not fire\n * @default false\n */\n disabled?: boolean;\n isInverse?: boolean;\n /**\n * If true, label text will be hidden visually, but will still be read by assistive technology\n * @default false\n */\n isLabelVisuallyHidden?: boolean;\n /**\n * If true, multiple items may be selected\n * @default false\n */\n isMulti?: boolean;\n /**\n * Position of text label relative to form field\n */\n labelPosition?: LabelPosition;\n /**\n * Style properties for the label\n */\n labelStyle?: React.CSSProperties;\n /**\n * Text for label\n */\n labelText: string;\n /**\n * Style properties for the items menu\n */\n menuStyle?: React.CSSProperties;\n /**\n * Style properties for the helper or error message\n */\n messageStyle?: React.CSSProperties;\n /**\n * Text for select trigger button or combobox input placeholder\n */\n placeholder?: string;\n testId?: string;\n}\n\nexport interface InternalMultiProps<T> {\n /**\n * Event that fires when the clear button is clicked on a multi-selected item\n */\n onRemoveSelectedItem?: (removedItem: T) => void;\n}\n\nexport interface SelectProps<T extends SelectOptions>\n extends UseSelectProps<T>,\n InternalSelectProps<T> {\n /**\n * Id of the element that describes the select trigger button\n */\n ariaDescribedBy?: string;\n /**\n * @internal\n */\n hasError?: boolean;\n /**\n * Reference to the trigger button element in the select\n */\n innerRef?: React.Ref<HTMLButtonElement>;\n /**\n * @internal\n */\n isMulti?: false;\n /**\n * Event that fires when the trigger button loses focus\n */\n onBlur?: (event: React.FocusEvent) => void;\n /**\n * Event that fires when the trigger button gains focus\n */\n onFocus?: (event: React.FocusEvent) => void;\n /**\n * Event that fires when the trigger button receives keypress\n */\n onKeyDown?: (event: React.KeyboardEvent) => void;\n /**\n * Event that will fire when a character is typed while focused on the trigger button\n */\n onKeyPress?: (event: React.KeyboardEvent) => void;\n /**\n * Event that will fire when a keypress is released while focused on the trigger button\n */\n onKeyUp?: (event: React.KeyboardEvent) => void;\n}\n\nexport interface MultiSelectProps<T extends SelectOptions>\n extends UseMultipleSelectionProps<T>,\n Omit<SelectProps<T>, 'onStateChange' | 'stateReducer' | 'isMulti'>,\n InternalMultiProps<T> {\n /**\n * @internal\n */\n hasError?: boolean;\n isInverse?: boolean;\n /**\n * @internal\n */\n isMulti: true;\n}\n\nexport function instanceOfMultiSelect<T>(\n object: any\n): object is MultiSelectProps<T> {\n return 'isMulti' in object && object.type !== 'combo';\n}\n\nexport function instanceOfDefaultItemObject(\n object: any\n): object is { label: string; value: string; [key: string]: any } {\n return object && 'label' in object;\n}\n\nexport function instanceOfToBeCreatedItemObject(\n object: any\n): object is {\n label: string;\n value: string;\n react_magma__created_item: boolean;\n} {\n return (\n typeof object !== 'string' &&\n object &&\n 'react_magma__created_item' in object\n );\n}\n\nexport type XORSelectProps<T> = XOR<SelectProps<T>, MultiSelectProps<T>>;\n\nexport const SelectStateChangeTypes = useSelect.stateChangeTypes;\nexport const MultipleSelectionStateChangeTypes =\n useMultipleSelection.stateChangeTypes;\n\nexport function Select<T>(props: XORSelectProps<T>) {\n const {\n containerStyle,\n id: defaultId,\n isMulti,\n labelPosition,\n errorMessage,\n messageStyle,\n helperMessage,\n testId,\n } = props;\n\n function itemToString(item: T) {\n return item && typeof item === 'string'\n ? item\n : item && instanceOfDefaultItemObject(item)\n ? item.label\n : '';\n }\n\n const hasError = !!errorMessage;\n\n const id = useGenerateId(defaultId);\n\n const descriptionId = errorMessage || helperMessage ? `${id}__desc` : null;\n\n const isInverse = useIsInverse(props.isInverse);\n\n return (\n <div style={containerStyle} data-testid={testId}>\n {isMulti && instanceOfMultiSelect<T>(props) ? (\n <MultiSelect\n ariaDescribedBy={descriptionId}\n id={id}\n isInverse={isInverse}\n labelPosition={labelPosition || LabelPosition.top}\n itemToString={itemToString}\n {...(props as MultiSelectProps<T>)}\n hasError={hasError}\n />\n ) : (\n <InternalSelect\n ariaDescribedBy={descriptionId}\n errorMessage={errorMessage}\n id={id}\n isInverse={isInverse}\n itemToString={itemToString}\n labelPosition={labelPosition || LabelPosition.top}\n hasError={hasError}\n helperMessage={helperMessage}\n messageStyle={messageStyle}\n {...(props as SelectProps<T>)}\n />\n )}\n </div>\n );\n}\n","import React from 'react';\nimport styled from '@emotion/styled';\nimport { Label, LabelPosition } from '../Label';\nimport { VisuallyHidden } from '../VisuallyHidden';\nimport { UseSelectGetLabelPropsOptions } from 'downshift';\nimport { InputMessage } from '../Input/InputMessage';\n\nexport const SelectContainerElement = styled.div<{\n labelPosition?: LabelPosition;\n}>`\n align-items: baseline;\n display: ${props =>\n props.labelPosition == LabelPosition.left ? 'flex' : 'block'};\n position: relative;\n`;\n\nconst InputMessageContainer = styled.div`\n flex-grow: 1;\n`;\n\ninterface SelectContainerInterface<T> {\n children: React.ReactNode[];\n containerStyle?: React.CSSProperties;\n errorMessage?: React.ReactNode;\n descriptionId?: string;\n getLabelProps: (options?: UseSelectGetLabelPropsOptions) => any;\n hasError?: boolean;\n helperMessage?: React.ReactNode;\n isInverse?: boolean;\n isLabelVisuallyHidden?: boolean;\n labelPosition?: LabelPosition;\n labelStyle?: React.CSSProperties;\n labelText: string;\n messageStyle?: React.CSSProperties;\n}\n\nexport function SelectContainer<T>(props: SelectContainerInterface<T>) {\n const {\n children,\n descriptionId,\n errorMessage,\n getLabelProps,\n helperMessage,\n isInverse,\n isLabelVisuallyHidden,\n labelPosition,\n labelStyle,\n labelText,\n messageStyle,\n } = props;\n\n const hasError = !!errorMessage;\n\n return (\n <SelectContainerElement\n labelPosition={labelPosition}\n data-testid=\"selectContainerElement\"\n >\n <Label\n {...getLabelProps()}\n isInverse={isInverse}\n labelPosition={labelPosition}\n style={labelStyle}\n >\n {isLabelVisuallyHidden ? (\n <VisuallyHidden>{labelText}</VisuallyHidden>\n ) : (\n labelText\n )}\n </Label>\n <InputMessageContainer>\n {children}\n {!(\n labelPosition === LabelPosition.left &&\n !(errorMessage || helperMessage)\n ) &&\n (errorMessage || helperMessage) && (\n <InputMessage\n id={descriptionId}\n isInverse={isInverse}\n hasError={hasError}\n style={messageStyle}\n >\n {(errorMessage || helperMessage) && (\n <>{errorMessage ? errorMessage : helperMessage}</>\n )}\n </InputMessage>\n )}\n </InputMessageContainer>\n </SelectContainerElement>\n );\n}\n","import * as React from 'react';\nimport { SelectProps } from '.';\nimport { useSelect } from 'downshift';\nimport { SelectText } from './shared';\nimport { defaultComponents } from './components';\nimport { CloseIcon } from 'react-magma-icons';\nimport { ButtonSize, ButtonVariant } from '../Button';\nimport { ItemsList } from './ItemsList';\nimport { SelectContainer } from './SelectContainer';\nimport { SelectTriggerButton } from './SelectTriggerButton';\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport { I18nContext } from '../../i18n';\nimport { useForkedRef } from '../../utils';\n\nexport function Select<T>(props: SelectProps<T>) {\n const {\n ariaDescribedBy,\n components: customComponents,\n defaultSelectedItem,\n errorMessage,\n hasError,\n helperMessage,\n inputStyle,\n isLabelVisuallyHidden,\n innerRef,\n itemListMaxHeight,\n itemToString,\n items,\n labelStyle,\n labelText,\n initialSelectedItem,\n isClearable,\n disabled,\n isInverse,\n labelPosition,\n menuStyle,\n onBlur,\n onFocus,\n onIsOpenChange,\n onKeyDown,\n onKeyPress,\n onKeyUp,\n messageStyle,\n placeholder,\n selectedItem: passedInSelectedItem,\n } = props;\n\n const toggleButtonRef = React.useRef<HTMLButtonElement>();\n const theme = React.useContext(ThemeContext);\n const i18n = React.useContext(I18nContext);\n\n const ref = useForkedRef(innerRef || null, toggleButtonRef);\n\n function getValidItem(itemToCheck: T, key: string): object {\n return items.findIndex(\n i => itemToString(i) === itemToString(itemToCheck)\n ) !== -1\n ? { [key]: itemToCheck }\n : { [key]: null };\n }\n\n function handleOnIsOpenChange(changes) {\n const {\n isOpen: changedIsOpen,\n selectedItem: changedSelectedItem,\n } = changes;\n\n if (changedIsOpen && changedSelectedItem) {\n setHighlightedIndex(\n items.findIndex(\n i => itemToString(i) === itemToString(changedSelectedItem)\n )\n );\n }\n\n onIsOpenChange &&\n typeof onIsOpenChange === 'function' &&\n onIsOpenChange(changes);\n }\n\n function stateReducer(state, actionAndChanges) {\n const { type, changes } = actionAndChanges;\n switch (type) {\n case useSelect.stateChangeTypes.ToggleButtonKeyDownCharacter:\n return {\n ...changes,\n selectedItem: state.selectedItem,\n };\n default:\n return changes;\n }\n }\n\n const {\n isOpen,\n selectedItem,\n getToggleButtonProps,\n getLabelProps,\n getMenuProps,\n highlightedIndex,\n getItemProps,\n reset,\n openMenu,\n setHighlightedIndex,\n } = useSelect<T>({\n ...props,\n onIsOpenChange: handleOnIsOpenChange,\n stateReducer,\n ...(defaultSelectedItem &&\n getValidItem(defaultSelectedItem, 'defaultSelectedItem')),\n ...(initialSelectedItem &&\n getValidItem(initialSelectedItem, 'initialSelectedItem')),\n ...(passedInSelectedItem &&\n getValidItem(passedInSelectedItem, 'selectedItem')),\n });\n\n const { ClearIndicator } = defaultComponents<T>({\n ...customComponents,\n });\n\n const toggleButtonProps = getToggleButtonProps({\n disabled: disabled,\n onBlur,\n onKeyDown: event => {\n if (\n getToggleButtonProps().id === document.activeElement.id &&\n (event.key === 'Enter' || event.key === ' ')\n ) {\n event.preventDefault();\n openMenu();\n }\n\n onKeyDown && typeof onKeyDown === 'function' && onKeyDown(event);\n },\n onKeyPress,\n onKeyUp,\n onFocus,\n ref,\n });\n\n function defaultHandleClearIndicatorClick(event: React.SyntheticEvent) {\n event.stopPropagation();\n\n if (toggleButtonRef.current) {\n toggleButtonRef.current.focus();\n }\n\n reset();\n }\n\n const clearIndicatorAriaLabel = i18n.select.clearIndicatorAriaLabel\n .replace(/\\{labelText\\}/g, labelText)\n .replace(/\\{selectedItem\\}/g, itemToString(selectedItem));\n\n const selectText = itemToString(selectedItem)\n ? itemToString(selectedItem)\n : typeof placeholder === 'string'\n ? placeholder\n : i18n.select.placeholder;\n\n return (\n <SelectContainer\n errorMessage={errorMessage}\n descriptionId={ariaDescribedBy}\n getLabelProps={getLabelProps}\n helperMessage={helperMessage}\n isInverse={isInverse}\n isLabelVisuallyHidden={isLabelVisuallyHidden}\n labelPosition={labelPosition}\n labelStyle={labelStyle}\n labelText={labelText}\n messageStyle={messageStyle}\n >\n <SelectTriggerButton\n ariaDescribedBy={ariaDescribedBy}\n customComponents={customComponents}\n toggleButtonProps={toggleButtonProps}\n hasError={hasError}\n disabled={disabled}\n isInverse={isInverse}\n style={inputStyle}\n >\n <SelectText data-testid=\"selectedItemText\">{selectText}</SelectText>\n {isClearable && selectedItem && (\n <ClearIndicator\n aria-label={clearIndicatorAriaLabel}\n icon={<CloseIcon size={theme.iconSizes.xSmall} />}\n onClick={defaultHandleClearIndicatorClick}\n size={ButtonSize.small}\n style={{ marginTop: '0', marginBottom: '0' }}\n testId=\"clearIndicator\"\n variant={ButtonVariant.link}\n />\n )}\n </SelectTriggerButton>\n <ItemsList\n customComponents={customComponents}\n getItemProps={getItemProps}\n getMenuProps={getMenuProps}\n highlightedIndex={highlightedIndex}\n isOpen={isOpen}\n maxHeight={itemListMaxHeight || theme.select.menu.maxHeight}\n items={items}\n itemToString={itemToString}\n menuStyle={menuStyle}\n />\n </SelectContainer>\n );\n}\n","import * as React from 'react';\nimport { MultiSelectProps } from '.';\nimport { useSelect, useMultipleSelection } from 'downshift';\nimport { CloseIcon } from 'react-magma-icons';\nimport { ItemsList } from './ItemsList';\nimport { SelectContainer } from './SelectContainer';\nimport { SelectTriggerButton } from './SelectTriggerButton';\nimport { SelectedItemButton, IconWrapper } from './shared';\n\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport { I18nContext } from '../../i18n';\n\nexport function MultiSelect<T>(props: MultiSelectProps<T>) {\n const {\n ariaDescribedBy,\n components: customComponents,\n errorMessage,\n hasError,\n helperMessage,\n inputStyle,\n isLabelVisuallyHidden,\n innerRef,\n itemToString,\n items,\n labelPosition,\n labelStyle,\n labelText,\n disabled,\n isInverse,\n itemListMaxHeight,\n menuStyle,\n messageStyle,\n onBlur,\n onFocus,\n onKeyDown,\n onKeyPress,\n onKeyUp,\n onRemoveSelectedItem,\n placeholder,\n } = props;\n\n function checkSelectedItemValidity(itemToCheck: T) {\n return (\n items.findIndex(i => itemToString(i) === itemToString(itemToCheck)) !== -1\n );\n }\n\n const {\n getSelectedItemProps,\n getDropdownProps,\n addSelectedItem,\n removeSelectedItem,\n selectedItems,\n setActiveIndex,\n } = useMultipleSelection<T>({\n ...props,\n ...(props.initialSelectedItems && {\n initialSelectedItems: props.initialSelectedItems.filter(\n checkSelectedItemValidity\n ),\n }),\n ...(props.selectedItems && {\n selectedItems: props.selectedItems.filter(checkSelectedItemValidity),\n }),\n });\n\n function getFilteredItems(unfilteredItems) {\n return unfilteredItems.filter(\n item =>\n selectedItems.findIndex(\n selectedItem => itemToString(selectedItem) === itemToString(item)\n ) < 0\n );\n }\n\n const {\n stateReducer: passedInStateReducer,\n onStateChange,\n ...selectProps\n } = props;\n\n function stateReducer(state, actionAndChanges) {\n const { type, changes } = actionAndChanges;\n switch (type) {\n case useSelect.stateChangeTypes.ToggleButtonKeyDownCharacter:\n return {\n ...changes,\n selectedItem: state.selectedItem,\n };\n default:\n return changes;\n }\n }\n\n const {\n isOpen,\n getToggleButtonProps,\n getLabelProps,\n getMenuProps,\n highlightedIndex,\n getItemProps,\n selectItem,\n openMenu,\n } = useSelect({\n ...selectProps,\n items: getFilteredItems(items),\n onSelectedItemChange: defaultOnSelectedItemChange,\n stateReducer,\n });\n\n function defaultOnSelectedItemChange(changes) {\n const { selectedItem: newSelectedItem } = changes;\n\n if (newSelectedItem) {\n addSelectedItem(newSelectedItem);\n selectItem(null);\n }\n }\n\n function handleRemoveSelectedItem(event: React.SyntheticEvent, selectedItem) {\n event.stopPropagation();\n\n onRemoveSelectedItem && typeof onRemoveSelectedItem === 'function'\n ? onRemoveSelectedItem(selectedItem)\n : removeSelectedItem(selectedItem);\n }\n\n const theme = React.useContext(ThemeContext);\n const i18n = React.useContext(I18nContext);\n\n const toggleButtonProps = getToggleButtonProps({\n ...getDropdownProps({\n onBlur,\n onKeyDown: event => {\n if (\n document.activeElement.tagName.toLowerCase() === 'button' &&\n (event.key === 'Backspace' ||\n event.key === 'Delete' ||\n event.key === 'ArrowLeft')\n ) {\n event.nativeEvent.preventDownshiftDefault = true;\n }\n\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n openMenu();\n }\n\n onKeyDown && typeof onKeyDown === 'function' && onKeyDown(event);\n },\n onKeyPress,\n onKeyUp,\n onFocus,\n preventKeyAction: isOpen,\n ...(innerRef && { ref: innerRef }),\n }),\n disabled: disabled,\n });\n\n return (\n <SelectContainer\n descriptionId={ariaDescribedBy}\n errorMessage={errorMessage}\n getLabelProps={getLabelProps}\n helperMessage={helperMessage}\n isLabelVisuallyHidden={isLabelVisuallyHidden}\n labelPosition={labelPosition}\n labelStyle={labelStyle}\n labelText={labelText}\n isInverse={isInverse}\n messageStyle={messageStyle}\n >\n <SelectTriggerButton\n ariaDescribedBy={ariaDescribedBy}\n toggleButtonProps={toggleButtonProps}\n hasError={hasError}\n disabled={disabled}\n isInverse={isInverse}\n style={inputStyle}\n >\n {selectedItems && selectedItems.length > 0\n ? selectedItems.map((multiSelectedItem, index) => {\n const multiSelectedItemString = itemToString(multiSelectedItem);\n return (\n <SelectedItemButton\n aria-label={i18n.multiSelect.selectedItemButtonAriaLabel.replace(\n /\\{selectedItem\\}/g,\n multiSelectedItemString\n )}\n key={`selected-item-${index}`}\n {...getSelectedItemProps({\n selectedItem: multiSelectedItem,\n index,\n })}\n onClick={event =>\n handleRemoveSelectedItem(event, multiSelectedItem)\n }\n onFocus={() => setActiveIndex(index)}\n theme={theme}\n >\n {multiSelectedItemString}\n <IconWrapper>\n <CloseIcon size={theme.iconSizes.xSmall} />\n </IconWrapper>\n </SelectedItemButton>\n );\n })\n : typeof placeholder === 'string'\n ? placeholder\n : i18n.multiSelect.placeholder}\n </SelectTriggerButton>\n <ItemsList\n customComponents={customComponents}\n getItemProps={getItemProps}\n getMenuProps={getMenuProps}\n highlightedIndex={highlightedIndex}\n isOpen={isOpen}\n items={getFilteredItems(items)}\n itemToString={itemToString}\n maxHeight={itemListMaxHeight || theme.select.menu.maxHeight}\n menuStyle={menuStyle}\n />\n </SelectContainer>\n );\n}\n","import React from 'react';\nimport { inputBaseStyles } from '../InputBase';\nimport { defaultComponents, SelectComponents } from '../Select/components';\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport styled from '@emotion/styled';\nimport { css } from '@emotion/core';\nimport {\n UseComboboxGetToggleButtonPropsOptions,\n UseComboboxGetComboboxPropsOptions,\n UseComboboxGetInputPropsOptions,\n} from 'downshift';\n\nimport { SelectedItemsWrapper } from '../Select/shared';\n\nconst ComboBoxContainer = styled.div<{\n hasError?: boolean;\n isInverse?: boolean;\n theme?: any;\n}>`\n display: flex;\n`;\n\nconst InputContainer = styled.div<{\n hasError?: boolean;\n disabled?: boolean;\n isFocused?: boolean;\n isInverse?: boolean;\n theme?: any;\n}>`\n align-items: center;\n background: ${props => props.theme.colors.neutral08};\n border: 1px solid;\n border-color: ${props =>\n props.isInverse\n ? props.theme.colors.neutral08\n : props.theme.colors.neutral03};\n border-radius: ${props => props.theme.borderRadius};\n display: flex;\n min-height: ${props => props.theme.spaceScale.spacing09};\n min-width: ${props => props.theme.spaceScale.spacing13};\n padding: 0 ${props => props.theme.spaceScale.spacing03} 0 0;\n width: 100%;\n\n ${props =>\n props.isFocused &&\n css`\n outline: 2px dotted\n ${props.isInverse\n ? props.theme.colors.focusInverse\n : props.theme.colors.focus};\n outline-offset: 4px;\n `}\n\n ${props =>\n props.hasError &&\n css`\n border-color: ${props.theme.colors.danger};\n box-shadow: 0 0 0 1px\n ${props.isInverse\n ? props.theme.colors.neutral08\n : props.theme.colors.danger};\n `}\n\n ${props =>\n props.disabled &&\n css`\n background: ${props.theme.colors.neutral07};\n border-color: ${props.theme.colors.neutral05};\n color: ${props.theme.colors.disabledText};\n cursor: not-allowed;\n outline: 0;\n\n &::placeholder {\n color: ${props.theme.colors.disabledText};\n }\n `}\n`;\n\nconst StyledInput = styled.input`\n ${inputBaseStyles}\n border: 0;\n display: flex;\n flex-grow: 1;\n height: ${props => props.theme.spaceScale.spacing08};\n min-width: ${props => props.theme.spaceScale.spacing07};\n padding-left: ${props => props.theme.spaceScale.spacing02};\n width: 0;\n\n &:focus {\n outline: 0;\n }\n`;\n\ninterface ComboboxInputProps<T> {\n ariaDescribedBy?: string;\n children?: React.ReactNode | React.ReactNode[];\n customComponents?: SelectComponents<T>;\n getComboboxProps: (options?: UseComboboxGetComboboxPropsOptions) => any;\n getInputProps: (options?: UseComboboxGetInputPropsOptions) => any;\n getToggleButtonProps: (\n options?: UseComboboxGetToggleButtonPropsOptions\n ) => any;\n hasError?: boolean;\n innerRef?: React.Ref<HTMLInputElement>;\n inputStyle?: React.CSSProperties;\n disabled?: boolean;\n isInverse?: boolean;\n isLoading?: boolean;\n onInputBlur?: (event: React.FocusEvent) => void;\n onInputFocus?: (event: React.FocusEvent) => void;\n onInputKeyDown?: (event: React.KeyboardEvent) => void;\n onInputKeyPress?: (event: React.KeyboardEvent) => void;\n onInputKeyUp?: (event: React.KeyboardEvent) => void;\n placeholder?: string;\n selectedItems?: React.ReactNode;\n toggleButtonRef?: React.Ref<HTMLButtonElement>;\n}\n\nexport function ComboboxInput<T>(props: ComboboxInputProps<T>) {\n const {\n ariaDescribedBy,\n children,\n customComponents,\n getComboboxProps,\n getInputProps,\n getToggleButtonProps,\n hasError,\n innerRef,\n inputStyle,\n disabled,\n isInverse,\n isLoading,\n onInputBlur,\n onInputFocus,\n onInputKeyDown,\n onInputKeyPress,\n onInputKeyUp,\n placeholder,\n selectedItems,\n toggleButtonRef,\n } = props;\n const theme = React.useContext(ThemeContext);\n\n const [isFocused, setIsFocused] = React.useState<boolean>(false);\n\n const { DropdownIndicator, LoadingIndicator } = defaultComponents<T>({\n ...customComponents,\n });\n\n function handleBlur(e: React.FocusEvent) {\n setIsFocused(false);\n\n onInputBlur && typeof onInputBlur === 'function' && onInputBlur(e);\n }\n\n function handleFocus(e: React.FocusEvent) {\n setIsFocused(true);\n\n onInputFocus && typeof onInputFocus === 'function' && onInputFocus(e);\n }\n\n const inputProps = getInputProps({\n disabled: disabled,\n onBlur: handleBlur,\n onFocus: handleFocus,\n onKeyDown: onInputKeyDown,\n onKeyPress: onInputKeyPress,\n onKeyUp: onInputKeyUp,\n ...(innerRef && { ref: innerRef }),\n });\n\n return (\n <ComboBoxContainer\n {...getComboboxProps()}\n hasError={hasError}\n disabled={disabled}\n isInverse={isInverse}\n theme={theme}\n >\n <InputContainer\n {...getToggleButtonProps({\n disabled,\n ...(toggleButtonRef && { ref: toggleButtonRef }),\n })}\n hasError={hasError}\n disabled={disabled}\n isFocused={isFocused}\n isInverse={isInverse}\n style={inputStyle}\n theme={theme}\n >\n <SelectedItemsWrapper>\n {selectedItems}\n <StyledInput\n {...inputProps}\n aria-describedby={ariaDescribedBy}\n aria-invalid={hasError}\n disabled={disabled}\n placeholder={placeholder}\n theme={theme}\n />\n </SelectedItemsWrapper>\n {children}\n {isLoading && (\n <LoadingIndicator\n style={{ flexShrink: 0, marginRight: theme.spaceScale.spacing02 }}\n />\n )}\n <DropdownIndicator\n aria-label=\"toggle menu\"\n color={theme.colors.neutral}\n />\n </InputContainer>\n </ComboBoxContainer>\n );\n}\n","import React from 'react';\n\nexport function useComboboxItems(defaultItems, items) {\n const afterInitialRender = React.useRef(false);\n const allItems = React.useRef(defaultItems || items);\n const [displayItems, setDisplayItems] = React.useState(defaultItems || items);\n\n function updateItemsRef(newItem) {\n const newItems = [...allItems.current, newItem];\n allItems.current = newItems;\n setDisplayItems(newItems);\n }\n\n React.useEffect(() => {\n if (!afterInitialRender.current) {\n afterInitialRender.current = true;\n return;\n }\n\n const cleanItems = items ? items : [];\n\n allItems.current = cleanItems;\n setDisplayItems(cleanItems);\n }, [items]);\n\n return [allItems, displayItems, setDisplayItems, updateItemsRef];\n}\n\nfunction inputValueInList(items, inputValue, itemToString) {\n return (\n items.current.filter(\n item => itemToString(item).toLowerCase() === inputValue.toLowerCase()\n ).length > 0\n );\n}\n\nexport function defaultOnInputValueChange(\n changes,\n items,\n itemToString,\n disableCreateItem,\n setDisplayItems,\n setHighlightedIndex,\n onInputChange,\n createLabel\n) {\n const { inputValue: inputBaseValue, isOpen } = changes;\n\n if (isOpen) {\n const inputValue =\n typeof inputBaseValue === 'string'\n ? inputBaseValue\n : itemToString(inputBaseValue);\n\n const filteredItems = inputValue\n ? items.current\n .filter(item =>\n itemToString(item)\n .toLowerCase()\n .startsWith(inputValue.toLowerCase())\n )\n .concat(\n !disableCreateItem &&\n inputValue &&\n !inputValueInList(items, inputValue, itemToString)\n ? {\n label: createLabel.replace(/\\{inputValue\\}/g, inputValue),\n value: inputValue,\n react_magma__created_item: true,\n }\n : null\n )\n .filter(Boolean)\n : items.current;\n\n setHighlightedIndex(0);\n setDisplayItems(filteredItems);\n }\n\n onInputChange &&\n typeof onInputChange === 'function' &&\n onInputChange(changes);\n}\n","import * as React from 'react';\nimport { instanceOfDefaultItemObject } from '../Select';\nimport { useCombobox } from 'downshift';\nimport { CloseIcon } from 'react-magma-icons';\nimport { defaultComponents } from '../Select/components';\nimport { SelectContainer } from '../Select/SelectContainer';\nimport { ItemsList } from '../Select/ItemsList';\nimport { ComboboxInput } from './ComboboxInput';\nimport { ButtonShape, ButtonSize, ButtonVariant } from '../Button';\nimport { useComboboxItems, defaultOnInputValueChange } from './shared';\nimport { ComboboxProps } from '.';\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport { I18nContext } from '../../i18n';\nimport { useForkedRef } from '../../utils';\n\nexport function InternalCombobox<T>(props: ComboboxProps<T>) {\n const {\n ariaDescribedBy,\n components: customComponents,\n defaultItems,\n defaultSelectedItem,\n disableCreateItem,\n errorMessage,\n hasError,\n helperMessage,\n initialSelectedItem,\n inputStyle,\n isClearable,\n disabled,\n innerRef,\n isLabelVisuallyHidden,\n isLoading,\n isInverse,\n itemListMaxHeight,\n items,\n itemToString,\n labelPosition,\n labelStyle,\n labelText,\n menuStyle,\n messageStyle,\n newItemTransform,\n onInputBlur,\n onInputChange,\n onInputFocus,\n onInputKeyDown,\n onInputKeyPress,\n onInputKeyUp,\n onInputValueChange,\n onIsOpenChange,\n onItemCreated,\n placeholder,\n selectedItem: passedInSelectedItem,\n toggleButtonRef,\n } = props;\n\n const theme = React.useContext(ThemeContext);\n const i18n = React.useContext(I18nContext);\n\n function isCreatedItem(item) {\n return (\n !(typeof item === 'string') &&\n instanceOfDefaultItemObject(item) &&\n item.react_magma__created_item\n );\n }\n\n function defaultNewItemTransform(newItem) {\n return newItem.value;\n }\n\n function defaultOnSelectedItemChange(changes) {\n if (isCreatedItem(changes.selectedItem)) {\n const {\n react_magma__created_item,\n ...createdItem\n } = changes.selectedItem;\n\n const newItem =\n react_magma__created_item &&\n newItemTransform &&\n typeof newItemTransform === 'function'\n ? newItemTransform(createdItem)\n : defaultNewItemTransform(createdItem);\n\n items && onItemCreated && typeof onItemCreated === 'function'\n ? onItemCreated(newItem)\n : updateItemsRef(newItem);\n\n selectItem(newItem);\n setInputValue(itemToString(newItem));\n\n if (process.env.NODE_ENV === 'development') {\n if (!items && !disableCreateItem) {\n console.warn(\n 'React Magma Warning: Switching from uncontrolled to controlled items. If allowing new items to be created you should handle the onItemCreated event and control the items list in your code.'\n );\n }\n }\n } else {\n props.onSelectedItemChange &&\n typeof props.onSelectedItemChange === 'function' &&\n props.onSelectedItemChange(changes);\n }\n }\n\n function stateReducer(state, actionAndChanges) {\n const { type, changes } = actionAndChanges;\n\n switch (type) {\n case useCombobox.stateChangeTypes.InputKeyDownEnter: {\n const inputValue = isCreatedItem(displayItems[0])\n ? ''\n : changes.inputValue;\n return {\n ...changes,\n inputValue,\n };\n }\n case useCombobox.stateChangeTypes.ItemClick: {\n const inputValue = isCreatedItem(displayItems[0])\n ? ''\n : changes.inputValue;\n return {\n ...changes,\n inputValue,\n };\n }\n case useCombobox.stateChangeTypes.InputBlur:\n return {\n ...changes,\n inputValue:\n state.inputValue && !state.selectedItem\n ? ''\n : itemToString(state.selectedItem),\n selectedItem: state.selectedItem ? state.selectedItem : '',\n };\n case useCombobox.stateChangeTypes.FunctionReset:\n return {\n ...changes,\n inputValue: changes.selectedItem\n ? itemToString(changes.selectedItem)\n : '',\n };\n default:\n return changes;\n }\n }\n\n const [\n allItems,\n displayItems,\n setDisplayItems,\n updateItemsRef,\n ] = useComboboxItems(defaultItems, items);\n\n function getValidItem(itemToCheck: T, key: string): object {\n return allItems.current.findIndex(\n i => itemToString(i) === itemToString(itemToCheck)\n ) !== -1\n ? { [key]: itemToCheck }\n : { [key]: null };\n }\n\n function handleOnIsOpenChange(changes) {\n const {\n isOpen: changedIsOpen,\n selectedItem: changedSelectedItem,\n } = changes;\n\n if (!changedIsOpen) {\n setDisplayItems(allItems.current);\n }\n\n if (changedIsOpen && changedSelectedItem) {\n setHighlightedIndex(\n displayItems.findIndex(\n i => itemToString(i) === itemToString(changedSelectedItem)\n )\n );\n }\n\n onIsOpenChange &&\n typeof onIsOpenChange === 'function' &&\n onIsOpenChange(changes);\n }\n\n const {\n isOpen,\n getToggleButtonProps,\n getLabelProps,\n getMenuProps,\n getInputProps,\n getComboboxProps,\n highlightedIndex,\n getItemProps,\n reset,\n selectItem,\n selectedItem,\n setInputValue,\n setHighlightedIndex,\n } = useCombobox({\n ...props,\n itemToString,\n items: displayItems,\n onInputValueChange:\n onInputValueChange && typeof onInputValueChange === 'function'\n ? changes => onInputValueChange(changes, setDisplayItems)\n : changes =>\n defaultOnInputValueChange(\n changes,\n allItems,\n itemToString,\n disableCreateItem,\n setDisplayItems,\n setHighlightedIndex,\n onInputChange,\n i18n.combobox.createLabel\n ),\n onIsOpenChange: handleOnIsOpenChange,\n onSelectedItemChange: defaultOnSelectedItemChange,\n stateReducer,\n ...(defaultSelectedItem &&\n getValidItem(defaultSelectedItem, 'defaultSelectedItem')),\n ...(initialSelectedItem &&\n getValidItem(initialSelectedItem, 'initialSelectedItem')),\n ...(passedInSelectedItem &&\n getValidItem(passedInSelectedItem, 'selectedItem')),\n });\n\n const { ClearIndicator } = defaultComponents<T>({\n ...customComponents,\n });\n\n const inputRef = React.useRef<HTMLInputElement>();\n const ref = useForkedRef(innerRef || null, inputRef);\n\n function defaultHandleClearIndicatorClick(event: React.SyntheticEvent) {\n event.stopPropagation();\n\n if (inputRef.current) {\n inputRef.current.focus();\n }\n\n reset();\n }\n\n const clearIndicatorAriaLabel = i18n.combobox.clearIndicatorAriaLabel\n .replace(/\\{labelText\\}/g, labelText)\n .replace(/\\{selectedItem\\}/g, itemToString(selectedItem));\n\n return (\n <SelectContainer\n descriptionId={ariaDescribedBy}\n errorMessage={errorMessage}\n getLabelProps={getLabelProps}\n hasError={hasError}\n helperMessage={helperMessage}\n isLabelVisuallyHidden={isLabelVisuallyHidden}\n isInverse={isInverse}\n labelPosition={labelPosition}\n labelStyle={labelStyle}\n labelText={labelText}\n messageStyle={messageStyle}\n >\n <ComboboxInput\n ariaDescribedBy={ariaDescribedBy}\n customComponents={customComponents}\n disabled={disabled}\n getComboboxProps={getComboboxProps}\n getInputProps={getInputProps}\n getToggleButtonProps={getToggleButtonProps}\n hasError={hasError}\n innerRef={ref}\n inputStyle={inputStyle}\n isInverse={isInverse}\n isLoading={isLoading}\n onInputBlur={onInputBlur}\n onInputFocus={onInputFocus}\n onInputKeyDown={onInputKeyDown}\n onInputKeyPress={onInputKeyPress}\n onInputKeyUp={onInputKeyUp}\n placeholder={placeholder}\n toggleButtonRef={toggleButtonRef}\n >\n {isClearable && selectedItem && (\n <ClearIndicator\n aria-label={clearIndicatorAriaLabel}\n icon={<CloseIcon />}\n onClick={defaultHandleClearIndicatorClick}\n shape={ButtonShape.fill}\n size={ButtonSize.small}\n variant={ButtonVariant.link}\n />\n )}\n </ComboboxInput>\n <ItemsList\n customComponents={customComponents}\n getItemProps={getItemProps}\n getMenuProps={getMenuProps}\n highlightedIndex={highlightedIndex}\n isOpen={isOpen}\n items={displayItems}\n itemToString={itemToString}\n maxHeight={itemListMaxHeight || theme.combobox.menu.maxHeight}\n menuStyle={menuStyle}\n />\n </SelectContainer>\n );\n}\n","import * as React from 'react';\nimport { instanceOfDefaultItemObject } from '../Select';\nimport { useCombobox, useMultipleSelection } from 'downshift';\nimport { CloseIcon } from 'react-magma-icons';\nimport { SelectContainer } from '../Select/SelectContainer';\nimport { ItemsList } from '../Select/ItemsList';\nimport { ComboboxInput } from './ComboboxInput';\nimport { SelectedItemButton, IconWrapper } from '../Select/shared';\nimport { useComboboxItems, defaultOnInputValueChange } from './shared';\n\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport { I18nContext } from '../../i18n';\nimport { MultiComboboxProps } from '.';\n\nexport function MultiCombobox<T>(props: MultiComboboxProps<T>) {\n const [inputValue, setInputValue] = React.useState('');\n const {\n ariaDescribedBy,\n components: customComponents,\n errorMessage,\n defaultItems,\n disableCreateItem,\n hasError,\n helperMessage,\n inputStyle,\n disabled,\n innerRef,\n isLabelVisuallyHidden,\n isLoading,\n isInverse,\n itemListMaxHeight,\n items,\n itemToString,\n labelPosition,\n labelStyle,\n labelText,\n menuStyle,\n messageStyle,\n newItemTransform,\n onInputBlur,\n onInputChange,\n onInputFocus,\n onInputKeyDown,\n onInputKeyPress,\n onInputKeyUp,\n onInputValueChange,\n onIsOpenChange,\n onItemCreated,\n onRemoveSelectedItem,\n placeholder,\n toggleButtonRef,\n } = props;\n\n const theme = React.useContext(ThemeContext);\n const i18n = React.useContext(I18nContext);\n\n const [\n allItems,\n displayItems,\n setDisplayItems,\n updateItemsRef,\n ] = useComboboxItems(defaultItems, items);\n\n function checkSelectedItemValidity(itemToCheck) {\n return (\n allItems.current.findIndex(\n i => itemToString(i) === itemToString(itemToCheck)\n ) !== -1\n );\n }\n\n const {\n getSelectedItemProps,\n getDropdownProps,\n addSelectedItem,\n removeSelectedItem,\n setActiveIndex,\n selectedItems,\n } = useMultipleSelection({\n ...props,\n ...(props.initialSelectedItems && {\n initialSelectedItems: props.initialSelectedItems.filter(\n checkSelectedItemValidity\n ),\n }),\n ...(props.selectedItems && {\n selectedItems: props.selectedItems.filter(checkSelectedItemValidity),\n }),\n });\n\n function isCreatedItem(item) {\n return (\n !(typeof item === 'string') &&\n instanceOfDefaultItemObject(item) &&\n item.react_magma__created_item\n );\n }\n\n function getFilteredItems(unfilteredItems) {\n return unfilteredItems.filter(item => {\n const itemString =\n typeof item === 'object' && item.react_magma__created_item\n ? item.value\n : itemToString(item);\n return (\n (selectedItems.findIndex(\n selectedItem => itemToString(selectedItem) === itemToString(item)\n ) < 0 &&\n itemString.toLowerCase().startsWith(inputValue.toLowerCase())) ||\n isCreatedItem(item)\n );\n });\n }\n\n function defaultNewItemTransform(newItem) {\n return newItem.value;\n }\n\n function defaultOnSelectedItemChange(changes) {\n if (isCreatedItem(changes.selectedItem)) {\n const {\n react_magma__created_item,\n ...createdItem\n } = changes.selectedItem;\n\n const newItem =\n react_magma__created_item &&\n newItemTransform &&\n typeof newItemTransform === 'function'\n ? newItemTransform(createdItem)\n : defaultNewItemTransform(createdItem);\n\n items && onItemCreated && typeof onItemCreated === 'function'\n ? onItemCreated(newItem)\n : updateItemsRef(newItem);\n addSelectedItem(newItem);\n\n if (process.env.NODE_ENV === 'development') {\n if (!items && !disableCreateItem) {\n console.warn(\n 'React Magma Warning: Switching from uncontrolled to controlled items. If allowing new items to be created you should handle the onItemCreated event and control the items list in your code.'\n );\n }\n }\n } else if (changes.selectedItem) {\n addSelectedItem(changes.selectedItem);\n }\n\n selectItem(null);\n setInputValue('');\n }\n\n const {\n stateReducer: passedInStateReducer,\n onStateChange,\n ...comboboxProps\n } = props;\n\n function handleOnIsOpenChange(changes) {\n const { isOpen: changedIsOpen } = changes;\n\n if (!changedIsOpen) {\n setDisplayItems(allItems.current);\n }\n\n onIsOpenChange &&\n typeof onIsOpenChange === 'function' &&\n onIsOpenChange(changes);\n }\n\n function stateReducer(state, actionAndChanges) {\n const { type, changes } = actionAndChanges;\n switch (type) {\n case useCombobox.stateChangeTypes.InputKeyDownEnter: {\n const newSelectedItem = getFilteredItems(displayItems)[\n state.highlightedIndex\n ];\n return {\n ...changes,\n ...(newSelectedItem && {\n selectedItem: newSelectedItem,\n }),\n inputValue: '',\n };\n }\n case useCombobox.stateChangeTypes.ItemClick: {\n return {\n ...changes,\n inputValue: '',\n };\n }\n case useCombobox.stateChangeTypes.InputBlur:\n return {\n ...changes,\n inputValue: '',\n };\n default:\n return changes;\n }\n }\n\n function handleInputChange(changes) {\n setInputValue(changes.inputValue);\n\n onInputChange &&\n typeof onInputChange === 'function' &&\n onInputChange(changes);\n }\n\n const {\n isOpen,\n getToggleButtonProps,\n getLabelProps,\n getMenuProps,\n getInputProps,\n getComboboxProps,\n highlightedIndex,\n getItemProps,\n selectItem,\n setHighlightedIndex,\n } = useCombobox({\n ...comboboxProps,\n itemToString,\n items: getFilteredItems(displayItems),\n onInputValueChange:\n onInputValueChange && typeof onInputValueChange === 'function'\n ? changes => onInputValueChange(changes, setDisplayItems)\n : changes =>\n defaultOnInputValueChange(\n changes,\n allItems,\n itemToString,\n disableCreateItem,\n setDisplayItems,\n setHighlightedIndex,\n handleInputChange,\n i18n.combobox.createLabel\n ),\n onIsOpenChange: handleOnIsOpenChange,\n onSelectedItemChange: defaultOnSelectedItemChange,\n stateReducer,\n });\n\n function handleRemoveSelectedItem(event: React.SyntheticEvent, selectedItem) {\n event.stopPropagation();\n\n onRemoveSelectedItem && typeof onRemoveSelectedItem === 'function'\n ? onRemoveSelectedItem(selectedItem)\n : removeSelectedItem(selectedItem);\n }\n\n function handleInputFocus(event: React.FocusEvent) {\n setActiveIndex(-1);\n\n onInputFocus && typeof onInputFocus === 'function' && onInputFocus(event);\n }\n\n const selectedItemsContent =\n selectedItems && selectedItems.length > 0 ? (\n <>\n {selectedItems.map((multiSelectedItem, index) => (\n <SelectedItemButton\n aria-label={i18n.multiCombobox.selectedItemButtonAriaLabel.replace(\n /\\{selectedItem\\}/g,\n itemToString(multiSelectedItem)\n )}\n key={`selected-item-${index}`}\n {...getSelectedItemProps({\n selectedItem: multiSelectedItem,\n index,\n })}\n onClick={event =>\n handleRemoveSelectedItem(event, multiSelectedItem)\n }\n onFocus={() => setActiveIndex(index)}\n theme={theme}\n >\n {itemToString(multiSelectedItem)}\n <IconWrapper>\n <CloseIcon size={theme.iconSizes.xSmall} />\n </IconWrapper>\n </SelectedItemButton>\n ))}\n </>\n ) : null;\n\n return (\n <SelectContainer\n descriptionId={ariaDescribedBy}\n errorMessage={errorMessage}\n getLabelProps={getLabelProps}\n helperMessage={helperMessage}\n isInverse={isInverse}\n isLabelVisuallyHidden={isLabelVisuallyHidden}\n labelPosition={labelPosition}\n labelStyle={labelStyle}\n labelText={labelText}\n messageStyle={messageStyle}\n >\n <ComboboxInput\n ariaDescribedBy={ariaDescribedBy}\n customComponents={customComponents}\n getComboboxProps={getComboboxProps}\n getInputProps={options => ({\n ...getInputProps({\n ...options,\n ...getDropdownProps({\n onKeyDown: onInputKeyDown,\n preventKeyAction: isOpen,\n ...(innerRef && { ref: innerRef }),\n }),\n }),\n })}\n getToggleButtonProps={getToggleButtonProps}\n inputStyle={inputStyle}\n disabled={disabled}\n isInverse={isInverse}\n isLoading={isLoading}\n hasError={hasError}\n onInputBlur={onInputBlur}\n onInputFocus={handleInputFocus}\n onInputKeyDown={onInputKeyDown}\n onInputKeyPress={onInputKeyPress}\n onInputKeyUp={onInputKeyUp}\n placeholder={placeholder}\n selectedItems={selectedItemsContent}\n toggleButtonRef={toggleButtonRef}\n />\n <ItemsList\n customComponents={customComponents}\n getItemProps={getItemProps}\n getMenuProps={getMenuProps}\n highlightedIndex={highlightedIndex}\n isOpen={isOpen}\n items={getFilteredItems(displayItems)}\n itemToString={itemToString}\n maxHeight={itemListMaxHeight || theme.combobox.menu.maxHeight}\n menuStyle={menuStyle}\n />\n </SelectContainer>\n );\n}\n","import * as React from 'react';\nimport styled from '../../theme/styled';\nimport { convertStyleValueToString } from '../../utils';\n\nexport interface SpacerProps extends React.HTMLAttributes<HTMLSpanElement> {\n /**\n * Determines whether the spacer takes up space horizontally, vertically or both.\n */\n axis?: SpacerAxis;\n /**\n * Height and/or width of the component. If a number is provided, will be set in pixels.\n */\n size: number | string;\n testId?: string;\n}\n\nexport enum SpacerAxis {\n horizontal = 'horizontal',\n vertical = 'vertical',\n both = 'both', // default\n}\n\nfunction getHeight(axis: SpacerAxis, size: number | string) {\n return axis === SpacerAxis.horizontal\n ? '1px'\n : convertStyleValueToString(size);\n}\nfunction getWidth(axis: SpacerAxis, size: number | string) {\n return axis === SpacerAxis.vertical ? '1px' : convertStyleValueToString(size);\n}\n\nconst StyledSpacer = styled.span<SpacerProps>`\n display: ${props =>\n props.axis === SpacerAxis.horizontal ? 'inline-block' : 'block'};\n height: ${props => getHeight(props.axis, props.size)};\n min-height: ${props => getHeight(props.axis, props.size)};\n min-width: ${props => getWidth(props.axis, props.size)};\n width: ${props => getWidth(props.axis, props.size)};\n`;\n\nexport const Spacer = React.forwardRef<HTMLSpanElement, SpacerProps>(\n (props, ref) => {\n const { testId, axis = SpacerAxis.both, ...other } = props;\n\n return (\n <StyledSpacer {...other} axis={axis} data-testid={testId} ref={ref} />\n );\n }\n);\n","import React from 'react';\nimport {\n useCombobox,\n UseComboboxProps,\n UseComboboxState,\n UseMultipleSelectionProps,\n} from 'downshift';\nimport {\n SelectOptions,\n instanceOfDefaultItemObject,\n InternalSelectProps,\n InternalMultiProps,\n} from '../Select';\nimport { InternalCombobox } from './Combobox';\nimport { MultiCombobox } from './MultiCombobox';\nimport { useGenerateId, XOR, Omit } from '../../utils';\nimport { LabelPosition } from '../Label';\nimport { useIsInverse } from '../../inverse';\n\nexport interface ComboboxProps<T extends SelectOptions>\n extends Omit<UseComboboxProps<T>, 'items'>,\n InternalSelectProps<T> {\n /**\n * Id of the element that describes the combobox input\n */\n ariaDescribedBy?: string;\n /**\n * Default selectable options. Allows for uncontrolled component and internal creation of items. Can be an array of strings or objects\n */\n defaultItems?: T[];\n /**\n * If true, the new items cannot be created by typing in the text field\n * @default false\n */\n disableCreateItem?: boolean;\n /**\n * @internal\n */\n hasError?: boolean;\n /**\n * Position of text label relative to form field\n */\n labelPosition?: LabelPosition;\n /**\n * Reference to the input element in the combobox\n */\n innerRef?: React.Ref<HTMLInputElement>;\n /**\n * If true, the loading component is shown\n * @default false\n */\n /**\n * @internal\n */\n isMulti?: false;\n isLoading?: boolean;\n /**\n * Default selectable options. Can be an array of strings or objects\n */\n items?: T[];\n /**\n * Function passed in that transforms a newly created item to whatever format your items are in\n */\n newItemTransform?: (item: { label: string; value: string }) => T;\n /**\n * Event that fires when the input loses focus\n */\n onInputBlur?: (event: React.FocusEvent) => void;\n /**\n * Event that fires when the input's value is changed\n */\n onInputChange?: (changes: Partial<UseComboboxState<T>>) => void;\n /**\n * Event that fires when the input gains focus\n */\n onInputFocus?: (event: React.FocusEvent) => void;\n /**\n * Event that will fire when input receives keypress.\n */\n onInputKeyDown?: (event: React.KeyboardEvent) => void;\n /**\n * Event that will fire when a character is typed in the input\n */\n onInputKeyPress?: (event: React.KeyboardEvent) => void;\n /**\n * Event that will fire when a keypress is released on the input\n */\n onInputKeyUp?: (event: React.KeyboardEvent) => void;\n /**\n * Event that fires when the selected item changes\n */\n onInputValueChange?: (\n changes: Partial<UseComboboxState<T>>,\n updateInputItems?: React.Dispatch<React.SetStateAction<T[]>>\n ) => void;\n /**\n * Event that fires when a new item is created with the create item option is clicked in the item list menu\n */\n onItemCreated?: (newItem: T) => void;\n /**\n * Reference to the toggle button element wrapping the input in the combobox\n */\n toggleButtonRef?: React.Ref<HTMLButtonElement>;\n}\n\nexport interface MultiComboboxProps<T extends SelectOptions>\n extends UseMultipleSelectionProps<T>,\n Omit<ComboboxProps<T>, 'onStateChange' | 'stateReducer' | 'isMulti'>,\n InternalMultiProps<T> {\n /**\n * @internal\n */\n isMulti: true;\n}\n\nexport function instanceOfMultiCombobox<T>(\n object: any\n): object is MultiComboboxProps<T> {\n return 'isMulti' in object;\n}\n\nexport type XORComboboxProps<T> = XOR<ComboboxProps<T>, MultiComboboxProps<T>>;\n\nexport const ComboboxStateChangeTypes = useCombobox.stateChangeTypes;\n\nexport function Combobox<T>(props: XORComboboxProps<T>) {\n const {\n containerStyle,\n errorMessage,\n id: defaultId,\n isMulti,\n labelPosition,\n messageStyle,\n helperMessage,\n testId,\n } = props;\n\n function itemToString(item: T) {\n return item && typeof item === 'string'\n ? item\n : item && instanceOfDefaultItemObject(item)\n ? item.label\n : '';\n }\n\n const hasError = !!errorMessage;\n\n const id = useGenerateId(defaultId);\n const descriptionId = errorMessage || helperMessage ? `${id}__desc` : null;\n\n const isInverse = useIsInverse(props.isInverse);\n\n return (\n <div style={containerStyle} data-testid={testId}>\n {isMulti && instanceOfMultiCombobox<T>(props) ? (\n <MultiCombobox\n ariaDescribedBy={descriptionId}\n errorMessage={errorMessage}\n hasError={hasError}\n helperMessage={helperMessage}\n isInverse={isInverse}\n itemToString={itemToString}\n labelPosition={labelPosition || LabelPosition.top}\n messageStyle={messageStyle}\n {...(props as MultiComboboxProps<T>)}\n />\n ) : (\n <InternalCombobox\n ariaDescribedBy={descriptionId}\n errorMessage={errorMessage}\n hasError={hasError}\n helperMessage={helperMessage}\n isInverse={isInverse}\n itemToString={itemToString}\n labelPosition={labelPosition || LabelPosition.top}\n messageStyle={messageStyle}\n {...(props as ComboboxProps<T>)}\n />\n )}\n </div>\n );\n}\n","import * as React from 'react';\nimport styled from '../../theme/styled';\nimport { ButtonColor, ButtonVariant } from '../Button';\nimport { Hyperlink, HyperlinkProps } from '../Hyperlink';\nimport { I18nContext } from '../../i18n';\n\nexport const TARGET_ID = 'reactMagmaMainContent';\n\nexport interface SkipLinkProps extends HyperlinkProps {\n /**\n * The text in the skip link\n * @default \"Skip Navigation\"\n */\n buttonText?: string;\n /**\n * Number of pixels from the left of the screen for the skip link to be positioned\n * @default 10\n */\n positionLeft?: number;\n /**\n * Number of pixels from the top of the screen for the skip link to be positioned\n * @default 10\n */\n positionTop?: number;\n testId?: string;\n}\n\nconst handleClick = e => {\n e.preventDefault();\n\n const targetAnchor = document.getElementById(TARGET_ID);\n\n if (!targetAnchor) {\n return;\n }\n\n const targetHeading = targetAnchor.getElementsByTagName('h1')[0];\n\n if (targetHeading) {\n targetHeading.setAttribute('tabIndex', '-1');\n targetHeading.focus();\n return;\n }\n targetAnchor.focus();\n};\n\nconst StyledSkipLink = styled(Hyperlink)<{\n positionLeft: number;\n positionTop: number;\n}>`\n left: -9999px;\n position: fixed;\n top: -9999px;\n\n &:focus {\n left: ${props => props.positionLeft}px;\n top: ${props => props.positionTop}px;\n z-index: 99999;\n }\n }\n`;\n\nexport const SkipLink: React.FunctionComponent<SkipLinkProps> = props => {\n const {\n buttonText,\n color,\n positionLeft,\n positionTop,\n testId,\n variant,\n ...other\n } = props;\n const i18n = React.useContext(I18nContext);\n\n return (\n <StyledSkipLink\n {...other}\n color={color ? color : ButtonColor.primary}\n testId={testId}\n onClick={e => {\n handleClick(e);\n }}\n positionLeft={positionLeft ? positionLeft : 10}\n positionTop={positionTop ? positionTop : 10}\n styledAs=\"Button\"\n to={`#${TARGET_ID}`}\n variant={variant ? variant : ButtonVariant.solid}\n >\n {buttonText ? buttonText : i18n.skipLink.buttonText}\n </StyledSkipLink>\n );\n};\n","import * as React from 'react';\nimport styled from '../../theme/styled';\nimport { css } from '@emotion/core';\n\nimport { CancelIcon, IconProps } from 'react-magma-icons';\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport { ThemeInterface } from '../../theme/magma';\nimport { useIsInverse } from '../../inverse';\nimport { Omit, XOR, getNodeText } from '../../utils';\nimport { I18nContext } from '../../i18n';\n\nexport enum TagColor {\n danger = 'danger',\n primary = 'primary',\n lowContrast = 'lowContrast',\n highContrast = 'highContrast',\n success = 'success',\n}\n\nexport enum TagSize {\n medium = 'medium',\n small = 'small',\n}\n\n/**\n * @children required\n */\n\nexport interface BaseTagProps\n extends Omit<React.HTMLAttributes<HTMLButtonElement>, 'onClick'> {\n /**\n * Color changes between 'primary', 'low contrast', and 'high contrast' style variants between each Tag.\n */\n color?: TagColor;\n\n /**\n * Size toggles between a default, and a small size Tag.\n */\n size?: TagSize;\n\n /**\n * Gets the active Tag label for use with the aria-label attribute inline for accessibility.\n */\n labelText?: React.ReactNode;\n\n /**\n * Disabled Tag state.\n */\n disabled?: boolean;\n\n testId?: string;\n\n /**\n * Allows passing a Magma icon to the Tag.\n */\n icon?: React.ReactElement<IconProps>;\n\n /**\n * Passes a clickable state to the Tag.\n */\n isClickable?: boolean;\n\n /**\n * Allows for Inverse styling of each Tag.\n */\n isInverse?: boolean;\n\n /**\n * @internal\n */\n theme?: ThemeInterface;\n}\n\nexport interface DeletableTagProps extends BaseTagProps {\n onDelete: () => void;\n}\n\nexport interface ClickableTagProps extends BaseTagProps {\n onClick?: () => void;\n}\n\nexport type TagProps = XOR<DeletableTagProps, ClickableTagProps>;\n\nfunction buildBoxShadow(props) {\n if (props.color === 'lowContrast') {\n if (props.isInverse) {\n if (props.disabled) {\n return `0 0 0 1px ${props.theme.colors.neutral08}40`;\n }\n return `0 0 0 1px ${props.theme.colors.neutral08}80`;\n }\n if (props.disabled) {\n return `0 0 0 1px ${props.theme.colors.neutral06}`;\n }\n return `inset 0 0 0 1px ${props.theme.colors.neutral05}`;\n }\n}\n\nfunction buildButtonBackground(props) {\n if (props.isInverse) {\n if (props.disabled) {\n // Disabled inverse state background colors\n switch (props.color) {\n case 'primary':\n return `${props.theme.colors.neutral06}`;\n case 'highContrast':\n return `${props.theme.colors.neutral06}`;\n case 'lowContrast':\n return `none`;\n default:\n return `${props.theme.colors.neutral06}`;\n }\n }\n // Inverse background colors\n switch (props.color) {\n case 'danger':\n return `${props.theme.colors.dangerInverse}`;\n case 'success':\n return `${props.theme.colors.successInverse}`;\n case 'primary':\n return `${props.theme.colors.primaryInverse}`;\n case 'lowContrast':\n return `none;`;\n case 'highContrast':\n return `${props.theme.colors.neutral08}`;\n default:\n return `${props.theme.colors.neutral03}`;\n }\n } else if (props.disabled && !props.isInverse) {\n // Disabled state background colors\n switch (props.color) {\n case 'primary':\n return `${props.theme.colors.neutral06}`;\n case 'highContrast':\n return `${props.theme.colors.neutral06}`;\n case 'lowContrast':\n return `${props.theme.colors.neutral08}`;\n default:\n return `${props.theme.colors.neutral06}`;\n }\n }\n // Default state background colors\n switch (props.color) {\n case 'danger':\n return `${props.theme.colors.danger}`;\n case 'success':\n return `${props.theme.colors.success}`;\n case 'primary':\n return `${props.theme.colors.primary}`;\n case 'lowContrast':\n return `${props.theme.colors.neutral08}`;\n case 'highContrast':\n return `${props.theme.colors.neutral}`;\n default:\n return `${props.theme.colors.neutral06}`;\n }\n}\n\nfunction buildButtonTextColor(props) {\n if (props.isInverse) {\n if (props.disabled) {\n // Disabled inverse state text colors\n switch (props.color) {\n case 'primary':\n return `${props.theme.colors.neutral03}99`;\n case 'highContrast':\n return `${props.theme.colors.neutral03}99`;\n case 'lowContrast':\n return `${props.theme.colors.neutral08}40`;\n default:\n return `${props.theme.colors.neutral03}99`;\n }\n }\n // Inverse text colors\n switch (props.color) {\n case 'danger':\n return `${props.theme.colors.neutral}`;\n case 'success':\n return `${props.theme.colors.neutral}`;\n case 'primary':\n return `${props.theme.colors.neutral}`;\n case 'lowContrast':\n return `${props.theme.colors.neutral08}`;\n case 'highContrast':\n return `${props.theme.colors.neutral}`;\n default:\n return `${props.theme.colors.neutral08}`;\n }\n } else if (props.disabled && !props.isInverse) {\n // Disabled state text colors\n switch (props.color) {\n case 'primary':\n return `${props.theme.colors.neutral03}99`;\n case 'highContrast':\n return `${props.theme.colors.neutral03}99`;\n case 'lowContrast':\n return `${props.theme.colors.neutral03}99`;\n default:\n return `${props.theme.colors.neutral03}99`;\n }\n }\n // Default state text colors\n switch (props.color) {\n case 'danger':\n return `${props.theme.colors.neutral08}`;\n case 'success':\n return `${props.theme.colors.neutral08}`;\n case 'primary':\n return `${props.theme.colors.neutral08}`;\n case 'highContrast':\n return `${props.theme.colors.neutral08}`;\n default:\n return `${props.theme.colors.neutral}`;\n }\n}\n\nfunction buildSvgOpacity(props) {\n if (props.onClick || props.onDelete) {\n if (props.disabled) {\n return '60%';\n }\n return '75%';\n }\n if (props.color === 'lowContrast' && props.disabled) {\n return '25%';\n } else if (props.disabled) {\n return '60%';\n }\n return '1';\n}\n\nfunction buildTagPadding(props) {\n if (props.icon) {\n switch (props.size) {\n case 'small':\n return `0 ${props.theme.spaceScale.spacing02}`;\n default:\n return `${props.theme.spaceScale.spacing02} 6px`;\n }\n }\n switch (props.size) {\n case 'small':\n return `0 ${props.theme.spaceScale.spacing02}`;\n default:\n return `${props.theme.spaceScale.spacing02} 6px`;\n }\n}\n\nfunction buildLabelPadding(props) {\n if (props.icon) {\n switch (props.size) {\n case 'small':\n return `0 ${props.theme.spaceScale.spacing02}`;\n default:\n return `0 ${props.theme.spaceScale.spacing03}`;\n }\n }\n switch (props.size) {\n case 'small':\n return `0 ${props.theme.spaceScale.spacing02}`;\n default:\n return `0 ${props.theme.spaceScale.spacing03}`;\n }\n}\n\nconst TagStyling = props => css`\n border: ${props.theme.tag.border};\n border-radius: ${props.theme.spaceScale.spacing05};\n background: ${buildButtonBackground(props)};\n color: ${buildButtonTextColor(props)};\n box-shadow: ${buildBoxShadow(props)};\n display: ${props.theme.tag.display};\n align-items: ${props.theme.tag.alignItems};\n justify-content: ${props.theme.tag.justifyContent};\n font-size: ${props.size === 'small'\n ? `${props.theme.typeScale.size01.fontSize}`\n : `${props.theme.typeScale.size02.fontSize}`};\n font-weight: ${props.size === 'small' ? `600` : `inherit`};\n letter-spacing: ${props.size === 'small'\n ? `${props.theme.typeScale.size01.letterSpacing}`\n : `${props.theme.typeScale.size02.letterSpacing}`};\n min-width: ${props.size === 'small'\n ? props.theme.spaceScale.spacing10\n : props.theme.spaceScale.spacing12};\n padding: ${buildTagPadding(props)};\n svg:first-of-type {\n height: ${props.size === 'small'\n ? `${props.theme.iconSizes.xSmall}px`\n : `${props.theme.iconSizes.small}px`};\n opacity: ${props.disabled ? '60%' : 'inherit'};\n width: ${props.size === 'small'\n ? `${props.theme.iconSizes.xSmall}px`\n : `${props.theme.iconSizes.small}px`};\n }\n svg:last-child {\n opacity: ${buildSvgOpacity(props)};\n width: ${props.size === 'small'\n ? `${props.theme.iconSizes.xSmall}px`\n : `${props.theme.iconSizes.small}px`};\n }\n &:hover {\n svg {\n opacity: ${props.disabled ? '60%' : '1'};\n }\n }\n`;\n\nconst StyledButton = styled.button<{\n disabled?: boolean;\n isClickable?: boolean;\n isInverse?: boolean;\n size: string;\n}>`\n ${TagStyling};\n cursor: ${props => (props.disabled ? 'not-allowed' : 'pointer')};\n`;\n\nconst StyledSpan = styled.span<{\n disabled?: boolean;\n isInverse?: boolean;\n size: string;\n}>`\n ${TagStyling};\n cursor: ${props => (props.disabled ? 'not-allowed' : 'inherit')};\n`;\n\nconst LabelWrap = styled.span<{\n size: string;\n icon?: any;\n}>`\n padding: ${buildLabelPadding};\n`;\n\nfunction getStyledTag(isClickable: boolean) {\n return isClickable ? StyledButton : StyledSpan;\n}\n\nexport const Tag = React.forwardRef<HTMLButtonElement, TagProps>(\n (props, ref) => {\n const {\n children,\n color,\n labelText = children,\n onClick,\n onDelete,\n isInverse: isInverseProp,\n size = TagSize.medium,\n testId,\n ...rest\n } = props;\n\n const theme = React.useContext(ThemeContext);\n\n const isInverse = useIsInverse(isInverseProp);\n\n const i18n = React.useContext(I18nContext);\n\n const deleteAriaLabel = i18n.tag.deleteAriaLabel.replace(\n /\\{labelText\\}/g,\n getNodeText(labelText)\n );\n\n const { icon } = props;\n\n const StyledTag = getStyledTag(Boolean(onClick || onDelete));\n\n function handleClick() {\n if (onClick && typeof onClick === 'function') {\n onClick();\n } else if (onDelete && typeof onDelete === 'function') {\n onDelete();\n }\n }\n\n return (\n <StyledTag\n color={color}\n icon={icon}\n onClick={handleClick}\n isInverse={isInverse}\n ref={ref}\n data-testid={props.testId}\n size={size}\n theme={theme}\n {...rest}\n >\n {icon}\n <LabelWrap size={size} {...rest} theme={theme}>\n {children}\n </LabelWrap>\n {onDelete && (\n <CancelIcon\n aria-label={deleteAriaLabel}\n size={theme.iconSizes.small}\n />\n )}\n </StyledTag>\n );\n }\n);\n","import * as React from 'react';\nimport { HiddenStyles } from '../../utils/UtilityStyles';\nimport { CheckIcon } from 'react-magma-icons';\nimport { FormGroupContext } from '../FormGroup';\nimport { InputMessage } from '../Input/InputMessage';\nimport { StyledLabel } from '../SelectionControls/StyledLabel';\nimport { StyledContainer } from '../SelectionControls/StyledContainer';\nimport { css } from '@emotion/core';\n// Using the base `styled` from `emotion` until import mapping is fixed: https://github.com/emotion-js/emotion/pull/1220\n// import styled from '../../theme/styled';\nimport styled from '@emotion/styled';\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport { useGenerateId } from '../../utils';\nimport { useIsInverse } from '../../inverse';\n\nexport enum ToggleTextPosition {\n left = 'left', // default\n right = 'right',\n}\n\nexport interface ToggleProps\n extends React.InputHTMLAttributes<HTMLInputElement> {\n /**\n * If true, element is checked (i.e. selected)\n * @default false\n */\n checked?: boolean;\n /**\n * Style properties for the component container element\n */\n containerStyle?: React.CSSProperties;\n /**\n * If true, checkbox is checked on first render\n */\n defaultChecked?: boolean;\n /**\n * Content of the error message for toggle. If a value is provided, the component will be styled as an error state and the error message will display.\n */\n errorMessage?: React.ReactNode;\n /**\n * @internal\n */\n hasError?: boolean;\n isInverse?: boolean;\n /**\n * If true, label text will be hidden visually, but will still be read by assistive technology\n * @default false\n */\n isTextVisuallyHidden?: boolean;\n /**\n * Style properties for the label element\n */\n labelStyle?: React.CSSProperties;\n /**\n * Content for label; can be a node or a string\n */\n labelText: React.ReactNode;\n testId?: string;\n /**\n * Whether the label appears to the left of the right of the toggle switch\n * @default ToggleTextPosition.left\n */\n textPosition?: ToggleTextPosition;\n /**\n * @internal\n */\n theme?: any;\n /**\n * Style properties for the part of the component that slides back and forth on the track\n */\n thumbStyle?: React.CSSProperties;\n /**\n * Style properties for track on which the toggle thumb slides\n */\n trackStyle?: React.CSSProperties;\n}\n\nconst HiddenLabelText = styled.span`\n ${HiddenStyles};\n`;\n\nconst HiddenInput = styled.input`\n ${HiddenStyles};\n`;\n\nconst Track = styled.span<{\n isChecked?: boolean;\n disabled?: boolean;\n hasError?: boolean;\n isInverse?: boolean;\n theme?: any;\n}>`\n background: ${props => props.theme.colors.neutral04};\n border: 2px solid;\n border-color: ${props =>\n props.hasError ? props.theme.colors.danger : props.theme.colors.neutral04};\n border-radius: 12px;\n box-shadow: ${props =>\n props.isInverse && props.hasError\n ? `0 0 0 1px ${props.theme.colors.neutral08}`\n : '0 0 0'};\n cursor: pointer;\n height: 24px;\n position: relative;\n width: 48px;\n\n ${props =>\n props.isChecked &&\n css`\n background: ${props.theme.colors.success02};\n border-color: ${props.hasError\n ? props.theme.colors.danger\n : props.theme.colors.success02};\n `}\n\n ${props =>\n props.disabled &&\n css`\n background: ${props.theme.colors.neutral06};\n border-color: ${props.theme.colors.neutral06};\n cursor: not-allowed;\n `}\n\n ${HiddenInput}:focus + label & {\n outline: 2px dotted\n ${props =>\n props.isInverse\n ? props.theme.colors.focusInverse\n : props.theme.colors.focus};\n outline-offset: 3px;\n }\n\n &:before {\n // active state\n background: ${props => props.theme.colors.neutral};\n border-radius: 50%;\n content: '';\n display: block;\n height: 40px;\n left: -12px;\n opacity: 0;\n margin-top: -22px;\n padding: 50%;\n position: absolute;\n top: 50%;\n transform: scale(1);\n transition: opacity 1s, transform 0.25s;\n width: 40px;\n\n ${props =>\n props.isChecked &&\n css`\n background: ${props.theme.colors.success02};\n left: 12px;\n `}\n }\n\n ${HiddenInput}:not(:disabled):active + label & {\n &:before {\n opacity: 0.4;\n transform: scale(0);\n transition: transform 0s;\n }\n }\n`;\n\nconst Thumb = styled.span<{\n isChecked?: boolean;\n disabled?: boolean;\n theme?: any;\n}>`\n background: ${props => props.theme.colors.neutral08};\n border-radius: 100%;\n height: 20px;\n left: 0;\n margin-top: -10px;\n position: absolute;\n top: 50%;\n transition: left 0.25s;\n width: 20px;\n\n ${props =>\n props.isChecked &&\n css`\n left: 24px;\n `}\n`;\n\nconst IconContainer = styled.span<{ disabled?: boolean; theme?: any }>`\n color: ${props =>\n props.disabled\n ? props.theme.colors.neutral05\n : props.theme.colors.neutral08};\n left: ${props => props.theme.spaceScale.spacing02};\n position: absolute;\n top: ${props => props.theme.spaceScale.spacing01};\n\n svg {\n display: block;\n }\n`;\n\nconst SpanTextLeft = styled.span`\n padding-right: 10px;\n`;\n\nconst SpanTextRight = styled.span`\n padding-left: 10px;\n`;\n\nconst renderLabelText = (\n isTextVisuallyHidden: boolean,\n labelText: React.ReactNode,\n textPosition: ToggleTextPosition,\n labelStyle: React.CSSProperties\n) => {\n if (isTextVisuallyHidden) {\n return <HiddenLabelText>{labelText}</HiddenLabelText>;\n }\n\n return textPosition === ToggleTextPosition.left ? (\n <SpanTextLeft style={labelStyle}>{labelText}</SpanTextLeft>\n ) : (\n <SpanTextRight style={labelStyle}>{labelText}</SpanTextRight>\n );\n};\n\nexport const Toggle = React.forwardRef<HTMLInputElement, ToggleProps>(\n (props, ref) => {\n const {\n containerStyle,\n checked,\n defaultChecked,\n disabled,\n errorMessage,\n id: defaultId,\n isTextVisuallyHidden,\n labelStyle,\n labelText,\n onChange,\n textPosition,\n testId,\n trackStyle,\n thumbStyle,\n ...other\n } = props;\n const [isChecked, updateIsChecked] = React.useState(\n Boolean(defaultChecked) || Boolean(checked)\n );\n\n const id = useGenerateId(defaultId);\n const isControlled = typeof checked === 'boolean' ? true : false;\n\n React.useEffect(() => {\n if (typeof checked === 'boolean') {\n updateIsChecked(checked);\n }\n }, [checked]);\n\n function handleChange(event: React.ChangeEvent<HTMLInputElement>) {\n const { checked: targetChecked } = event.target;\n\n onChange && typeof onChange === 'function' && onChange(event);\n\n if (!isControlled) {\n updateIsChecked(targetChecked);\n }\n }\n\n const theme = React.useContext(ThemeContext);\n const context = React.useContext(FormGroupContext);\n\n const descriptionId = errorMessage ? `${id}__desc` : null;\n const groupDescriptionId = context.descriptionId;\n\n const describedBy =\n descriptionId && groupDescriptionId\n ? `${groupDescriptionId} ${descriptionId}`\n : descriptionId\n ? descriptionId\n : groupDescriptionId\n ? groupDescriptionId\n : null;\n\n const hasError = context.hasError || !!errorMessage;\n\n const isInverse = useIsInverse(props.isInverse);\n\n return (\n <>\n <StyledContainer>\n <HiddenInput\n {...other}\n aria-checked={isChecked}\n aria-describedby={describedBy}\n id={id}\n data-testid={testId}\n disabled={disabled}\n checked={isChecked}\n type=\"checkbox\"\n onChange={handleChange}\n ref={ref}\n role=\"switch\"\n />\n <StyledLabel\n htmlFor={id}\n isInverse={isInverse}\n style={containerStyle}\n >\n {textPosition !== ToggleTextPosition.right &&\n renderLabelText(\n isTextVisuallyHidden,\n labelText,\n ToggleTextPosition.left,\n labelStyle\n )}\n <Track\n isChecked={isChecked}\n data-testid=\"toggle-track\"\n disabled={disabled}\n hasError={hasError}\n isInverse={isInverse}\n style={trackStyle}\n theme={theme}\n >\n <IconContainer disabled={disabled} theme={theme}>\n <CheckIcon size={theme.iconSizes.xSmall} />\n </IconContainer>\n <Thumb\n isChecked={isChecked}\n disabled={disabled}\n style={thumbStyle}\n theme={theme}\n />\n </Track>\n {textPosition === ToggleTextPosition.right &&\n renderLabelText(\n isTextVisuallyHidden,\n labelText,\n ToggleTextPosition.right,\n labelStyle\n )}\n </StyledLabel>\n </StyledContainer>\n {!!errorMessage && (\n <InputMessage id={descriptionId} hasError isInverse={isInverse}>\n {errorMessage}\n </InputMessage>\n )}\n </>\n );\n }\n);\n","import * as React from 'react';\n\nexport interface ToastsContainerProps\n extends React.HTMLAttributes<HTMLDivElement> {\n /**\n * Number of additional pixels from bottom of screen\n * @default 0\n */\n bottomOffset?: number;\n /**\n * @internal\n */\n toastsArray?: any;\n testId?: string;\n}\n\nexport interface ToastsContextInterface {\n bottomOffset?: number;\n toastsArray?: any;\n}\n\nexport const ToastsContext = React.createContext<ToastsContextInterface>({\n toastsArray: { current: [] },\n bottomOffset: 0,\n});\n\nexport const ToastsContainer = React.forwardRef<\n HTMLDivElement,\n ToastsContainerProps\n>((props, ref) => {\n const { bottomOffset, children, testId } = props;\n const toastsArray = React.useRef([]);\n\n return (\n <ToastsContext.Provider value={{ bottomOffset, toastsArray }}>\n <div ref={ref} data-testid={testId}>\n {children}\n </div>\n </ToastsContext.Provider>\n );\n});\n","import * as React from 'react';\nimport styled from '../../theme/styled';\nimport { AlertBase, AlertBaseProps, transitionDuration } from '../AlertBase';\nimport { getTrapElements } from '../../utils';\nimport { useGenerateId } from '../../utils';\nimport { ToastsContext } from './ToastsContainer';\n\n/**\n * @children required\n */\nexport interface ToastProps extends AlertBaseProps {\n /**\n * CSS properties for the alert component within the toast container\n */\n alertStyle?: React.CSSProperties;\n /**\n * CSS properties for the component container\n */\n containerStyle?: React.CSSProperties;\n /**\n * If true, the component will persist until dismissed by the user\n * @default false\n */\n disableAutoDismiss?: boolean;\n /**\n * Number of milliseconds the toast displays before it closes\n * @default 5000\n */\n toastDuration?: number;\n /**\n * Action that fires when the close button is clicked (required when dismissible is true)\n */\n onDismiss: () => void;\n /**\n * Action that fires when the mouse enters the component\n */\n onMouseEnter?: (event: React.SyntheticEvent) => void;\n /**\n * Action that fires when the mouse leaves the component\n */\n onMouseLeave?: (event: React.SyntheticEvent) => void;\n}\n\nconst ToastWrapper = styled.div<{\n bottomOffsetForContainer?: number;\n bottomOffsetForToast?: number;\n}>`\n bottom: ${props => props.bottomOffsetForToast + 20}px;\n display: flex;\n left: 20px;\n justify-content: flex-start;\n max-width: 600px;\n min-width: 320px;\n position: fixed;\n transform: translateY(${props => 0 - props.bottomOffsetForContainer}px);\n transition: bottom 0.3s;\n z-index: 999;\n\n @media (max-width: 600px) {\n bottom: ${props => props.bottomOffsetForToast + 10}px;\n left: 10px;\n right: 10px;\n }\n`;\n\nconst DEFAULT_TOAST_DURATION = 5000;\nconst TOAST_HEIGHT = 65;\n\nexport const Toast = React.forwardRef<HTMLDivElement, ToastProps>(\n (props, ref) => {\n const timerAutoHide = React.useRef<any>();\n const [isDismissed, setIsDismissed] = React.useState<boolean>(false);\n const [isPaused, setIsPaused] = React.useState<boolean>(false);\n const [timerTimeRemaining, setTimerTimeRemaining] =\n React.useState<number>();\n\n const {\n alertStyle,\n id: defaultId,\n testId,\n variant,\n disableAutoDismiss,\n children,\n containerStyle,\n toastDuration,\n ...other\n } = props;\n\n const id = useGenerateId(defaultId);\n\n const lastFocus = React.useRef<any>();\n\n const { bottomOffset, toastsArray } = React.useContext(ToastsContext);\n\n const timerStartTime = Date.now();\n\n const containerElement = React.useRef<any>();\n\n function dismissToast() {\n setIsDismissed(true);\n\n setTimeout(() => {\n if (toastsArray.current) {\n toastsArray.current = toastsArray.current.filter(\n toastId => toastId !== containerElement.current\n );\n }\n }, 0);\n }\n\n function clearTimeoutAndDismiss() {\n clearTimeout(timerAutoHide.current);\n\n dismissToast();\n\n if (lastFocus.current) {\n lastFocus.current.focus();\n }\n }\n\n function setAutoHideTimer(duration = DEFAULT_TOAST_DURATION) {\n clearTimeout(timerAutoHide.current);\n const totalDuration = duration + transitionDuration;\n\n timerAutoHide.current = setTimeout(() => {\n dismissToast();\n }, totalDuration);\n }\n\n function handlePause() {\n const duration = timerTimeRemaining\n ? timerTimeRemaining\n : toastDuration\n ? toastDuration\n : DEFAULT_TOAST_DURATION;\n const timeRemaining = duration - (Date.now() - timerStartTime);\n\n clearTimeout(timerAutoHide.current);\n setTimerTimeRemaining(timeRemaining);\n\n setIsPaused(true);\n }\n\n function handleResume() {\n setAutoHideTimer(timerTimeRemaining);\n setIsPaused(false);\n }\n\n function handleMouseEnter(event: React.SyntheticEvent) {\n props.onMouseEnter &&\n typeof props.onMouseEnter === 'function' &&\n props.onMouseEnter(event);\n\n if (!props.disableAutoDismiss) {\n handlePause();\n }\n }\n\n function handleMouseLeave(event: React.SyntheticEvent) {\n props.onMouseLeave &&\n typeof props.onMouseLeave === 'function' &&\n props.onMouseLeave(event);\n\n if (!props.disableAutoDismiss) {\n handleResume();\n }\n }\n\n function calculateAndSetBottomOffsetForToast() {\n updateBottomOffsetForToast(\n typeof toastsArray.current[0] === 'undefined'\n ? 0\n : toastsArray.current.indexOf(containerElement.current) * TOAST_HEIGHT\n );\n }\n\n const [bottomOffsetForToast, updateBottomOffsetForToast] =\n React.useState(0);\n\n React.useEffect(() => {\n lastFocus.current = document.activeElement;\n\n if (!props.disableAutoDismiss) {\n setAutoHideTimer(props.toastDuration);\n }\n\n return () => {\n clearTimeout(timerAutoHide.current);\n };\n }, []);\n\n React.useEffect(() => {\n if (!disableAutoDismiss) {\n const focusableElements = getTrapElements(containerElement);\n focusableElements.forEach(element => {\n element.addEventListener('focus', handlePause);\n element.addEventListener('blur', handleResume);\n });\n }\n }, []);\n\n React.useEffect(() => {\n if (toastsArray) {\n toastsArray.current = toastsArray.current.includes(\n containerElement.current\n )\n ? toastsArray.current\n : toastsArray.current.concat([containerElement.current]);\n\n calculateAndSetBottomOffsetForToast();\n }\n }, []);\n\n React.useEffect(() => {\n calculateAndSetBottomOffsetForToast();\n }, [toastsArray.current]);\n\n return (\n <ToastWrapper\n bottomOffsetForToast={bottomOffsetForToast}\n bottomOffsetForContainer={bottomOffset}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n ref={containerElement}\n style={containerStyle}\n data-testid={testId}\n >\n <AlertBase\n {...other}\n forceDismiss={clearTimeoutAndDismiss}\n hasTimerRing={!disableAutoDismiss}\n id={id}\n isDismissible\n isDismissed={isDismissed}\n isPaused={isPaused}\n isToast\n onDismiss={props.onDismiss}\n ref={ref}\n style={{ ...alertStyle }}\n toastDuration={toastDuration ? toastDuration : DEFAULT_TOAST_DURATION}\n variant={variant}\n >\n {children}\n </AlertBase>\n </ToastWrapper>\n );\n }\n);\n","import * as React from 'react';\nimport { useDescendants } from '../../hooks/useDescendants';\n\nexport enum AccordionIconPosition {\n left = 'left',\n none = 'none',\n right = 'right', // default\n}\n\nexport interface UseAccordionProps {\n /**\n * Index of the accordion panel expanded by default. If multiple panels are allowed, takes an array.\n * @default null\n */\n defaultIndex?: number[] | number;\n /**\n * Position of the chevron icon. If 'none', the icon will not render at all.\n * @default AccordionIconPosition.right\n */\n iconPosition?: AccordionIconPosition;\n index?: number[] | number;\n isInverse?: boolean;\n /**\n * If true, multiple accordion items may be expanded at once\n * @default true\n */\n isMulti?: boolean;\n /**\n * Event that fires when an accordion button is clicked\n */\n onExpandedChange?: (event: any) => void;\n testId?: string;\n}\n\ninterface AccordionContextInterface {\n buttonRefArray?: React.MutableRefObject<React.MutableRefObject<Element>[]>;\n expandedIndex?: number[] | number;\n iconPosition?: AccordionIconPosition;\n isControlled?: boolean;\n isMulti?: boolean;\n onExpandedChange?: any;\n setExpandedIndex?: any;\n registerAccordionButton: (\n itemRefArray: React.MutableRefObject<React.MutableRefObject<Element>[]>,\n itemRef: React.MutableRefObject<Element>\n ) => void;\n}\n\nexport const AccordionContext = React.createContext<AccordionContextInterface>({\n isControlled: false,\n iconPosition: AccordionIconPosition.right,\n isMulti: false,\n registerAccordionButton: (elements, element) => {},\n});\n\nexport function useAccordion(props: UseAccordionProps) {\n const {\n isMulti = true,\n defaultIndex = isMulti ? [] : null,\n index,\n iconPosition = AccordionIconPosition.right,\n onExpandedChange,\n } = props;\n\n const isControlled = typeof index !== 'undefined';\n\n const indexProp = isControlled ? index : defaultIndex;\n\n const [expandedIndex, setExpandedIndex] = React.useState(indexProp);\n\n React.useEffect(() => {\n if (isControlled) {\n setExpandedIndex(index);\n }\n }, [index]);\n\n const [buttonRefArray, registerAccordionButton] = useDescendants();\n\n const contextValue = {\n buttonRefArray,\n expandedIndex,\n iconPosition,\n isControlled,\n isMulti,\n onExpandedChange,\n registerAccordionButton,\n setExpandedIndex,\n };\n\n return {\n contextValue,\n };\n}\n\nexport type UseAccordionReturn = ReturnType<typeof useAccordion>;\n","import * as React from 'react';\nimport styled from '../../theme/styled';\nimport {\n inputBaseStyles,\n InputBaseStylesProps,\n InputWrapperStylesProps,\n inputWrapperStyles,\n} from '../InputBase';\nimport {\n FormFieldContainer,\n FormFieldContainerBaseProps,\n} from '../FormFieldContainer';\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport { useGenerateId, Omit } from '../../utils';\nimport { useIsInverse } from '../../inverse';\n\nexport interface TextareaProps\n extends Omit<FormFieldContainerBaseProps, 'inputSize' | 'fieldId'>,\n React.TextareaHTMLAttributes<HTMLTextAreaElement> {\n /**\n * Style properties for the component container element\n */\n containerStyle?: React.CSSProperties;\n isInverse?: boolean;\n testId?: string;\n /**\n * Style properties for the textarea element\n */\n textareaStyle?: React.CSSProperties;\n /**\n * Value for the textarea\n */\n value?: string | ReadonlyArray<string> | number;\n}\n\nconst StyledTextArea = styled.textarea<\n InputWrapperStylesProps & InputBaseStylesProps\n>`\n ${inputBaseStyles};\n ${inputWrapperStyles};\n height: 4.5em;\n padding: ${props =>\n `${props.theme.spaceScale.spacing02} ${props.theme.spaceScale.spacing03}`};\n`;\n\nexport const Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(\n (props, ref) => {\n const {\n containerStyle,\n errorMessage,\n helperMessage,\n id: defaultId,\n isLabelVisuallyHidden,\n labelStyle,\n labelText,\n messageStyle,\n testId,\n textareaStyle,\n ...other\n } = props;\n\n const theme = React.useContext(ThemeContext);\n\n const id = useGenerateId(defaultId);\n const descriptionId = errorMessage || helperMessage ? `${id}__desc` : null;\n\n const [value, setValue] = React.useState<\n string | ReadonlyArray<string> | number\n >(props.defaultValue || props.value || '');\n\n React.useEffect(() => {\n setValue(props.value);\n }, [props.value]);\n function handleChange(event: React.ChangeEvent<HTMLTextAreaElement>) {\n props.onChange &&\n typeof props.onChange === 'function' &&\n props.onChange(event);\n\n setValue(event.target.value);\n }\n\n const isInverse = useIsInverse(props.isInverse);\n\n return (\n <FormFieldContainer\n containerStyle={containerStyle}\n errorMessage={errorMessage}\n fieldId={id}\n helperMessage={helperMessage}\n isLabelVisuallyHidden={isLabelVisuallyHidden}\n isInverse={isInverse}\n labelStyle={labelStyle}\n labelText={labelText}\n >\n <StyledTextArea\n {...other}\n aria-describedby={\n descriptionId ? descriptionId : props['aria-describedby']\n }\n aria-invalid={!!errorMessage}\n data-testid={testId}\n hasError={!!errorMessage}\n id={id}\n isInverse={isInverse}\n onChange={handleChange}\n ref={ref}\n style={textareaStyle}\n theme={theme}\n value={value}\n width=\"100%\"\n />\n </FormFieldContainer>\n );\n }\n);\n","import * as React from 'react';\nimport styled from '@emotion/styled';\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport { ThemeInterface } from '../../theme/magma';\n\ninterface AmPmToggleProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n children: string;\n}\n\nconst StyledAmPmToggle = styled.button<{ theme: ThemeInterface }>`\n background: none;\n border: 0;\n border-radius: 3px;\n margin-left: 3px;\n padding: 0 3px;\n\n &:focus {\n outline: 0;\n background: ${props => props.theme.colors.foundation};\n color: ${props => props.theme.colors.neutral08};\n }\n`;\n\nexport const AmPmToggle = React.forwardRef<HTMLButtonElement, AmPmToggleProps>(\n (props, ref) => {\n const { children, ...other } = props;\n const theme = React.useContext(ThemeContext);\n\n return (\n <StyledAmPmToggle\n {...other}\n data-testid=\"amPmTimeButton\"\n ref={ref}\n theme={theme}\n type=\"button\"\n >\n {children}\n </StyledAmPmToggle>\n );\n }\n);\n","import * as React from 'react';\nimport styled from '../../theme/styled';\nimport { Announce } from '../Announce';\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport { AmPmToggle } from './AmPmToggle';\nimport { ScheduleIcon } from 'react-magma-icons';\nimport { useTimePicker, UseTimePickerProps } from './useTimePicker';\n\nimport { I18nContext } from '../../i18n';\nimport { VisuallyHidden } from '../VisuallyHidden';\nimport { useIsInverse } from '../../inverse';\nimport { FormFieldContainer } from '../FormFieldContainer';\nimport { inputWrapperStyles } from '../InputBase';\n\nexport interface TimePickerProps extends UseTimePickerProps {\n /**\n * Style properties for the outer input\n */\n inputStyle?: React.CSSProperties;\n}\n\nconst InputsContainer = styled.div<{\n hasError?: boolean;\n isInverse?: boolean;\n}>`\n ${inputWrapperStyles};\n height: ${props => props.theme.spaceScale.spacing09};\n padding: ${props => props.theme.spaceScale.spacing03};\n width: 144px;\n`;\n\nconst Divider = styled.span`\n display: inline-block;\n margin: 0 1px;\n position: relative;\n top: -1px;\n`;\n\nconst StyledNumInput = styled.input`\n border: 0;\n border-radius: ${props => props.theme.borderRadius};\n margin-right: ${props => props.theme.spaceScale.spacing01};\n padding: 0 ${props => props.theme.spaceScale.spacing01};\n text-align: right;\n width: ${props => props.theme.spaceScale.spacing06};\n\n &::-webkit-inner-spin-button {\n -webkit-appearance: none;\n }\n\n -moz-appearance: textfield;\n\n &:focus {\n outline: 0;\n background: ${props => props.theme.colors.foundation02};\n color: ${props => props.theme.colors.neutral08};\n }\n`;\n\nexport const TimePicker = React.forwardRef<HTMLInputElement, TimePickerProps>(\n (props, ref) => {\n const theme = React.useContext(ThemeContext);\n const i18n = React.useContext(I18nContext);\n\n const {\n containerStyle,\n errorMessage,\n helperMessage,\n inputStyle,\n labelStyle,\n labelText,\n minutesStep,\n onChange,\n ...other\n } = props;\n\n const isInverse = useIsInverse(props.isInverse);\n\n const {\n am,\n amPm,\n amPmRef,\n descriptionId,\n hour,\n hourId,\n hourRef,\n id,\n time,\n minute,\n minuteId,\n minuteRef,\n toggleAmPm,\n handleHourChange,\n handleMinuteChange,\n handleHourKeyDown,\n handleMinuteKeyDown,\n handleAmPmKeyDown,\n } = useTimePicker(props);\n\n const hoursLabel = `${labelText}, ${i18n.timePicker.hoursAriaLabel}`;\n const minutesLabel = `${labelText}, ${i18n.timePicker.minutesAriaLabel}`;\n const amPmLabel = `${labelText}, ${\n amPm === am\n ? i18n.timePicker.amButtonAriaLabel\n : i18n.timePicker.pmButtonAriaLabel\n }`;\n\n return (\n <FormFieldContainer\n {...other}\n containerStyle={containerStyle}\n errorMessage={errorMessage}\n fieldId={id}\n helperMessage={helperMessage}\n isInverse={isInverse}\n labelText={labelText}\n >\n <InputsContainer\n isInverse={isInverse}\n hasError={!!errorMessage}\n theme={theme}\n >\n <ScheduleIcon\n color={theme.colors.neutral}\n style={{ marginRight: theme.spaceScale.spacing02 }}\n />\n <StyledNumInput\n aria-label={hoursLabel}\n aria-describedby={descriptionId}\n data-testid=\"hoursTimeInput\"\n id={hourId}\n maxLength={2}\n max=\"12\"\n min=\"1\"\n onChange={handleHourChange}\n onKeyDown={handleHourKeyDown}\n placeholder=\"--\"\n ref={hourRef}\n theme={theme}\n type=\"number\"\n value={hour}\n />\n <Divider> : </Divider>\n <StyledNumInput\n aria-label={minutesLabel}\n data-testid=\"minutesTimeInput\"\n id={minuteId}\n maxLength={2}\n max=\"59\"\n min=\"0\"\n onChange={handleMinuteChange}\n onKeyDown={handleMinuteKeyDown}\n placeholder=\"--\"\n ref={minuteRef}\n step={minutesStep || 1}\n theme={theme}\n type=\"number\"\n value={minute}\n />\n <AmPmToggle\n aria-label={amPmLabel}\n ref={amPmRef}\n onClick={toggleAmPm}\n onKeyDown={handleAmPmKeyDown}\n >\n {amPm}\n </AmPmToggle>\n <VisuallyHidden>\n <Announce>\n {amPm === am\n ? i18n.timePicker.amSelectedAnnounce\n : i18n.timePicker.pmSelectedAnnounce}\n </Announce>\n </VisuallyHidden>\n </InputsContainer>\n <input id={id} ref={ref} type=\"hidden\" value={time} />\n </FormFieldContainer>\n );\n }\n);\n","import * as React from 'react';\nimport { useGenerateId, Omit } from '../../utils';\nimport { FormFieldContainerBaseProps } from '../FormFieldContainer';\n\nimport { enUS } from 'date-fns/locale';\nimport { I18nContext } from '../../i18n';\n\nexport interface UseTimePickerProps\n extends Omit<FormFieldContainerBaseProps, 'inputSize' | 'fieldId'> {\n /**\n * ID of the hidden input that stores the time value. Also the prefix for other fields.\n */\n id?: string;\n /**\n * Style properties for the outer input\n */\n inputStyle?: React.CSSProperties;\n isInverse?: boolean;\n /**\n * Style properties for the label\n */\n minutesStep?: number;\n /**\n * Full time value passed in and converted to use in hour, minute, and AM/PM fields\n */\n value?: string;\n /**\n * Function called when the component is changed to a new time\n */\n onChange?: (value: string) => void;\n}\n\nexport function useTimePicker(props: UseTimePickerProps) {\n const { errorMessage, helperMessage, onChange } = props;\n const i18n = React.useContext(I18nContext);\n\n const locale = i18n.locale || enUS;\n const am = locale.localize.dayPeriod('am', { width: 'abbreviated' });\n const pm = locale.localize.dayPeriod('pm', { width: 'abbreviated' });\n\n const [hour, setHour] = React.useState<string>('');\n const [minute, setMinute] = React.useState<string>('');\n const [amPm, setAmPm] = React.useState<string>(am);\n const [time, setTime] = React.useState<string>('');\n const hourRef = React.useRef<HTMLInputElement>();\n const minuteRef = React.useRef<HTMLInputElement>();\n const amPmRef = React.useRef<HTMLButtonElement>();\n const id = useGenerateId(props.id);\n\n React.useEffect(() => {\n if (validTime(props.value)) {\n convertPassedInTime(props.value);\n }\n }, [props.value]);\n\n const hourId = `${id}__hour`;\n const minuteId = `${id}__minute`;\n const descriptionId = errorMessage || helperMessage ? `${id}__desc` : null;\n\n function updateTime(newTime: string) {\n setTime(newTime);\n onChange && typeof onChange === 'function' && onChange(newTime);\n }\n\n function validTime(passedInTime: string) {\n const amPmRegex = `${am}|${am.toLowerCase()}|${pm}|${pm.toLowerCase()}`;\n const timeRegex = new RegExp(\n `^([01]?[0-9]|2[0-3]):[0-5][0-9]( (${amPmRegex}))?$`,\n 'g'\n );\n return timeRegex.test(passedInTime);\n }\n\n function convertPassedInTime(passedInTime: string) {\n const [timeHour, timeMinuteAndAmPm] = passedInTime.split(':');\n const timeMinute = timeMinuteAndAmPm.substring(0, 2);\n\n const timeAmPm =\n Number(timeHour) > 12\n ? pm\n : timeMinuteAndAmPm.length > 2\n ? timeMinuteAndAmPm.split(' ')[1].toUpperCase()\n : am;\n\n setHour(calculateHour(Number(timeHour)));\n setMinute(timeMinute);\n setAmPm(timeAmPm);\n updateTime(`${timeHour}:${timeMinute} ${timeAmPm}`);\n }\n\n function calculateHour(newHour: number): string {\n if (newHour < 10) {\n return `0${newHour}`;\n } else if (newHour > 12) {\n return `0${newHour.toString().substring(0, 1)}`;\n }\n\n return newHour.toString();\n }\n\n function calculateMinute(newMinute: number): string {\n if (newMinute === 0) {\n return `00`;\n } else if (newMinute < 10) {\n return `0${newMinute}`;\n } else if (newMinute > 59) {\n return `0${newMinute.toString().substring(0, 1)}`;\n }\n\n return newMinute.toString();\n }\n\n function handleHourChange(event: React.ChangeEvent<HTMLInputElement>) {\n const newHour = calculateHour(Number(event.target.value));\n\n setHour(newHour);\n updateTime(`${newHour}:${minute} ${amPm}`);\n }\n\n function handleMinuteChange(event: React.ChangeEvent<HTMLInputElement>) {\n const newMinute = calculateMinute(Number(event.target.value));\n\n setMinute(newMinute);\n updateTime(`${hour}:${newMinute} ${amPm}`);\n }\n\n function toggleAmPm() {\n const newAmPm = amPm === am ? pm : am;\n\n setAmPm(newAmPm);\n updateTime(`${hour}:${minute} ${newAmPm}`);\n }\n\n function handleHourKeyDown(event: React.KeyboardEvent) {\n if (event.key === 'Backspace') {\n setHour('');\n }\n\n if (event.key === 'ArrowRight') {\n minuteRef.current.focus();\n }\n }\n\n function handleMinuteKeyDown(event: React.KeyboardEvent) {\n if (event.key === 'Backspace') {\n setMinute('');\n }\n\n if (event.key === 'ArrowLeft') {\n hourRef.current.focus();\n }\n\n if (event.key === 'ArrowRight') {\n amPmRef.current.focus();\n }\n }\n\n function handleAmPmKeyDown(event: React.KeyboardEvent) {\n if (event.key === 'ArrowLeft') {\n minuteRef.current.focus();\n }\n\n if (\n event.key === 'ArrowUp' ||\n event.key === 'ArrowDown' ||\n ((event.key === 'A' || event.key === 'a') && amPm === pm) ||\n ((event.key === 'P' || event.key === 'p') && amPm === am)\n ) {\n event.preventDefault();\n toggleAmPm();\n }\n }\n\n return {\n amPm,\n am,\n amPmRef,\n toggleAmPm,\n id,\n time,\n hour,\n hourId,\n hourRef,\n minute,\n minuteId,\n minuteRef,\n descriptionId,\n handleHourChange,\n handleMinuteChange,\n handleHourKeyDown,\n handleMinuteKeyDown,\n handleAmPmKeyDown,\n };\n}\n\nexport type UseTimePickerReturn = ReturnType<typeof useTimePicker>;\n","import * as React from 'react';\nimport { Global, css } from '@emotion/core';\nimport { ThemeContext } from '../ThemeContext';\nimport { useIsInverse } from '../../inverse';\n\nfunction getStyles(theme, isInverse: boolean) {\n return css`\n @import url('https://fonts.googleapis.com/css?family=Open+Sans:300,300i,400,400i,600,600i,700,700i,800,800i&display=swap');\n @import url('https://fonts.googleapis.com/css2?family=Noto+Serif:ital,wght@0,400;0,700;1,400;1,700&display=swap');\n\n *,\n *:before,\n *:after {\n box-sizing: border-box;\n }\n\n *:focus {\n outline: 2px dotted\n ${isInverse ? theme.colors.focusInverse : theme.colors.focus};\n outline-offset: 4px;\n }\n\n html {\n -ms-text-size-adjust: 100%;\n -webkit-text-size-adjust: 100%;\n font-size: ${theme.typeScale.size03.fontSize};\n line-height: ${theme.typeScale.size03.lineHeight};\n scroll-behavior: smooth;\n }\n\n html,\n body {\n background: ${isInverse\n ? theme.colors.foundation\n : theme.colors.neutral08};\n color: ${isInverse ? theme.colors.neutral08 : theme.colors.neutral};\n margin: 0;\n padding: 0;\n }\n\n body {\n font-family: ${theme.bodyFont};\n font-style: normal;\n font-weight: 400;\n font-size: ${theme.typeScale.size03.fontSize};\n line-height: ${theme.typeScale.size03.lineHeight};\n }\n\n a {\n color: ${isInverse ? theme.colors.neutral07 : theme.colors.primary};\n cursor: pointer;\n text-decoration: underline;\n\n &:hover,\n &:focus {\n color: ${isInverse ? theme.colors.neutral06 : theme.colors.focus};\n }\n }\n\n button,\n input,\n optgroup,\n select,\n textarea {\n font: inherit;\n margin: 0;\n }\n\n svg:not(:root) {\n overflow: hidden;\n }\n `;\n}\n\nexport const GlobalStyles: React.FunctionComponent = () => {\n const isInverse = useIsInverse();\n return (\n <ThemeContext.Consumer>\n {theme => <Global styles={getStyles(theme, isInverse)} />}\n </ThemeContext.Consumer>\n );\n};\n","import * as React from 'react';\nimport styled from '../../theme/styled';\n\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport { InverseContext, useIsInverse } from '../../inverse';\nimport {\n UseAccordionProps,\n AccordionContext,\n useAccordion,\n} from './useAccordion';\nimport { ThemeInterface } from '../../theme/magma';\n\n/**\n * @children required\n */\ninterface BaseAccordionProps\n extends UseAccordionProps,\n React.HTMLAttributes<HTMLDivElement> {\n testId?: string;\n /**\n * @internal\n */\n theme?: ThemeInterface;\n}\n\nexport interface AccordionMultipleProps extends BaseAccordionProps {\n /**\n * Zero-based indices of item to expanded initially. When isMulti is true this is an array of numbers.\n * @default []\n */\n defaultIndex?: number[];\n /**\n * Not used in uncontrolled accordion\n */\n index?: never;\n /**\n * If true, multiple accordion items may be expanded at once\n */\n isMulti: true;\n}\n\nexport interface AccordionSingleProps\n extends UseAccordionProps,\n React.HTMLAttributes<HTMLDivElement> {\n /**\n * Zero-based index of item to expanded initially. When isMulti is a false this is a number.\n * @default null\n */\n defaultIndex?: number;\n /**\n * Not used in uncontrolled accordion\n */\n index?: never;\n /**\n * If true, multiple accordion items may be expanded at once\n */\n isMulti: false;\n}\n\nexport interface AccordionMultipleControlledProps\n extends UseAccordionProps,\n React.HTMLAttributes<HTMLDivElement> {\n /**\n * Zero-based indices of expanded items. When isMulti is true this is an array of numbers.\n * @default []\n */\n index?: number[];\n /**\n * Not used in controlled accordion\n */\n defaultIndex?: never;\n isMulti?: true;\n}\n\nexport interface AccordionSingleControlledProps\n extends UseAccordionProps,\n React.HTMLAttributes<HTMLDivElement> {\n /**\n * Zero-based index of expanded item. When isMulti is a false this is a number.\n * @default null\n */\n index?: number;\n /**\n * Not used in controlled accordion\n */\n defaultIndex?: never;\n isMulti: false;\n}\n\nexport type AccordionProps =\n | AccordionMultipleProps\n | AccordionSingleProps\n | AccordionMultipleControlledProps\n | AccordionSingleControlledProps;\n\nconst StyledAccordion = styled.div<AccordionProps>`\n background: transparent;\n border-bottom: 1px solid ${props => props.theme.colors.neutral06};\n color: ${props =>\n props.isInverse\n ? props.theme.colors.neutral08\n : props.theme.colors.neutral};\n`;\n\nexport const Accordion = React.forwardRef<HTMLDivElement, AccordionProps>(\n (props, ref) => {\n const {\n children,\n isInverse: isInverseProp,\n onExpandedChange,\n testId,\n ...rest\n } = props;\n\n const theme = React.useContext(ThemeContext);\n const isInverse = useIsInverse(isInverseProp);\n\n const { contextValue } = useAccordion(props);\n\n return (\n <InverseContext.Provider value={{ isInverse }}>\n <AccordionContext.Provider value={contextValue}>\n <StyledAccordion\n {...rest}\n data-testid={testId}\n isInverse={isInverse}\n ref={ref}\n theme={theme}\n >\n {React.Children.map(\n children,\n (child: React.ReactElement<any>, index) => {\n return React.cloneElement(child, { index, key: index });\n }\n )}\n </StyledAccordion>\n </AccordionContext.Provider>\n </InverseContext.Provider>\n );\n }\n);\n","import * as React from 'react';\n\nimport { AccordionContext } from './useAccordion';\nimport { useGenerateId } from '../../utils';\n\nexport interface UseAccordionItemProps {\n /**\n * @internal\n */\n index?: number;\n isDisabled?: boolean;\n testId?: string;\n}\n\ninterface AccordionItemContextInterface {\n buttonId?: string;\n index?: number;\n isDisabled?: boolean;\n isExpanded?: boolean;\n panelId?: string;\n setIsExpanded?: React.Dispatch<React.SetStateAction<boolean>>;\n}\n\nexport const AccordionItemContext = React.createContext<AccordionItemContextInterface>(\n {\n isDisabled: false,\n isExpanded: false,\n setIsExpanded: () => {},\n }\n);\n\nexport function useAccordionItem(props: UseAccordionItemProps) {\n const { index, isDisabled } = props;\n\n const [isExpanded, setIsExpanded] = React.useState<boolean>(false);\n const { expandedIndex, isMulti } = React.useContext(AccordionContext);\n\n const idPrefix = useGenerateId();\n\n const buttonId = `${idPrefix}_btn`;\n const panelId = `${idPrefix}_panel`;\n\n React.useEffect(() => {\n const newIsExpanded = isMulti\n ? Array.isArray(expandedIndex) && expandedIndex.includes(index) \n : expandedIndex == index;\n \n setIsExpanded(newIsExpanded);\n });\n\n const contextValue = {\n buttonId,\n index,\n isDisabled,\n isExpanded,\n panelId,\n setIsExpanded,\n };\n\n return {\n contextValue,\n };\n}\n\nexport type UseAccordionItemReturn = ReturnType<typeof useAccordionItem>;\n","import * as React from 'react';\nimport {\n AccordionItemContext,\n UseAccordionItemProps,\n useAccordionItem,\n} from './useAccordionItem';\nimport { ThemeInterface } from '../../theme/magma';\nimport styled from '../../theme/styled';\n\n/**\n * @children required\n */\nexport interface AccordionItemProps\n extends UseAccordionItemProps,\n React.HTMLAttributes<HTMLDivElement> {\n /**\n * @internal\n */\n theme?: ThemeInterface;\n}\n\nconst StyledItem = styled.div`\n h1,\n h2,\n h3,\n h4,\n h5,\n h6 {\n background: none;\n color: inherit;\n font: inherit;\n line-height: inherit;\n margin: 0;\n padding: 0;\n }\n`;\n\nexport const AccordionItem = React.forwardRef<\n HTMLDivElement,\n AccordionItemProps\n>((props, ref) => {\n const { children, testId, ...rest } = props;\n\n const { contextValue } = useAccordionItem(props);\n\n return (\n <AccordionItemContext.Provider value={contextValue}>\n <StyledItem ref={ref} data-testid={testId} {...rest}>\n {children}\n </StyledItem>\n </AccordionItemContext.Provider>\n );\n});\n","import * as React from 'react';\n\nimport { AccordionContext } from './useAccordion';\nimport { AccordionItemContext } from './useAccordionItem';\nimport { useForceUpdate } from '../../hooks/useForceUpdate';\nimport { useForkedRef } from '../../utils';\n\nexport interface UseAccordionButtonProps {\n testId?: string;\n isInverse?: boolean;\n}\n\nexport function useAccordionButton(\n props: UseAccordionButtonProps,\n forwardedRef\n) {\n const {\n buttonRefArray,\n expandedIndex,\n iconPosition,\n isControlled,\n isMulti,\n registerAccordionButton,\n onExpandedChange,\n setExpandedIndex,\n } = React.useContext(AccordionContext);\n\n const { buttonId, index, isDisabled, isExpanded, panelId } = React.useContext(\n AccordionItemContext\n );\n\n const handleClick = () => {\n typeof onExpandedChange === 'function' && onExpandedChange(index);\n\n if (!isControlled) {\n isMulti && Array.isArray(expandedIndex)\n ? isExpanded\n ? setExpandedIndex(expandedIndex.filter(item => item !== index))\n : setExpandedIndex(expandedIndex.concat([index]))\n : isExpanded\n ? setExpandedIndex(null)\n : setExpandedIndex(index);\n }\n };\n\n const focusFirst = () => {\n (buttonRefArray.current[0].current as HTMLButtonElement).focus();\n };\n\n const focusNext = () => {\n (buttonRefArray.current[index + 1].current as HTMLButtonElement).focus();\n };\n\n const focusPrev = () => {\n (buttonRefArray.current[index - 1].current as HTMLButtonElement).focus();\n };\n\n const focusLast = () => {\n const arrLength = buttonRefArray.current.length;\n (buttonRefArray.current[arrLength - 1]\n .current as HTMLButtonElement).focus();\n };\n\n const handleKeyDown = (event: React.KeyboardEvent) => {\n const arrLength = buttonRefArray.current.length;\n\n switch (event.key) {\n case 'ArrowDown': {\n index === arrLength - 1 ? focusFirst() : focusNext();\n break;\n }\n case 'ArrowUp': {\n index === 0 ? focusLast() : focusPrev();\n break;\n }\n case 'Home': {\n focusFirst();\n break;\n }\n case 'End': {\n focusLast();\n break;\n }\n default:\n return;\n }\n };\n\n const ownRef = React.useRef<HTMLDivElement>();\n const forceUpdate = useForceUpdate();\n\n const ref = useForkedRef(forwardedRef, ownRef);\n\n React.useEffect(() => {\n if (!isDisabled) {\n registerAccordionButton(buttonRefArray, ownRef);\n }\n\n forceUpdate();\n }, []);\n\n return {\n buttonId,\n handleClick,\n handleKeyDown,\n iconPosition,\n index,\n isDisabled,\n isExpanded,\n panelId,\n ref,\n };\n}\n\nexport type UseAccordionButtonReturn = ReturnType<typeof useAccordionButton>;\n","import * as React from 'react';\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport { Modal, ModalProps } from '../Modal';\nimport { TransitionProps } from '../Transition';\n\nexport enum DrawerPosition {\n top = 'top',\n bottom = 'bottom',\n left = 'left',\n right = 'right',\n}\n\nconst transitionPreset: {\n [key in DrawerPosition]: Omit<TransitionProps, 'isOpen'>;\n} = {\n top: { slideTop: true },\n bottom: { slideBottom: true },\n left: { slideLeft: true },\n right: { slideRight: true },\n};\n\n/**\n * @children required\n */\nexport interface DrawerProps extends Omit<ModalProps, 'size'> {\n testId?: string;\n /**\n * Style properties for the drawer\n */\n drawerStyle?: React.CSSProperties;\n /**\n * Style properties for the drawer container\n */\n containerStyle?: React.CSSProperties;\n /**\n * Set the position of the drawer\n */\n position?: DrawerPosition;\n}\n\nexport const Drawer = React.forwardRef<HTMLDivElement, DrawerProps>(\n (props, ref) => {\n const { style, containerStyle, position, ...rest } = props;\n const theme = React.useContext(ThemeContext);\n const drawerStyle = {\n ...theme.drawer.default,\n ...theme.drawer[DrawerPosition[position]],\n } as React.CSSProperties;\n return (\n <Modal\n containerStyle={{\n padding: '0',\n ...containerStyle,\n }}\n containerTransition={transitionPreset[DrawerPosition[position]]}\n style={{ ...drawerStyle, ...style }}\n {...rest}\n />\n );\n }\n);\n","import * as React from 'react';\nimport styled from '../../theme/styled';\n\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport { ThemeInterface } from '../../theme/magma';\nimport { useIsInverse } from '../../inverse';\nimport { AccordionIconPosition } from './useAccordion';\nimport { Spacer } from '../Spacer';\nimport { ExpandMoreIcon } from 'react-magma-icons';\nimport {\n useAccordionButton,\n UseAccordionButtonProps,\n} from './useAccordionButton';\nimport { Transition } from '../Transition';\n\n/**\n * @children required\n */\nexport interface AccordionButtonProps\n extends UseAccordionButtonProps,\n React.HTMLAttributes<HTMLButtonElement> {\n /**\n * @internal\n */\n theme?: ThemeInterface;\n}\n\nconst StyledButton = styled.button<{\n isInverse?: boolean;\n isExpanded?: boolean;\n}>`\n background: transparent;\n border: 0;\n border-top: 1px solid ${props =>\n props.isInverse ? props.theme.colors.tint04 : props.theme.colors.neutral06};\n color: ${props =>\n props.isInverse\n ? props.theme.colors.neutral08\n : props.theme.colors.neutral};\n cursor: pointer;\n display: flex;\n font-size: ${props => props.theme.typeScale.size03.fontSize};\n line-height: ${props => props.theme.typeScale.size03.lineHeight};\n font-weight: 600;\n padding: 12px 16px;\n text-align: left;\n width: 100%;\n\n &:focus {\n outline: 2px dotted ${props =>\n props.isInverse\n ? props.theme.colors.focusInverse\n : props.theme.colors.focus};\n }\n outline-offset: -3px;\n }\n\n &&[disabled] {\n color: ${props =>\n props.isInverse\n ? props.theme.colors.disabledInverseText\n : props.theme.colors.disabledText};\n cursor: not-allowed;\n }\n`;\n\nconst TextWrapper = styled.span`\n flex-grow: 1;\n`;\n\nexport const AccordionButton = React.forwardRef<\n HTMLButtonElement,\n AccordionButtonProps\n>((props, forwardedRef) => {\n const { children, testId, isInverse: isInverseProp, ...rest } = props;\n const theme = React.useContext(ThemeContext);\n const isInverse = useIsInverse(isInverseProp);\n\n const {\n iconPosition,\n buttonId,\n isDisabled,\n isExpanded,\n panelId,\n handleClick,\n handleKeyDown,\n ref,\n } = useAccordionButton(props, forwardedRef);\n\n const caret = (\n <Transition\n isOpen={isExpanded}\n rotate180\n style={{ height: theme.spaceScale.spacing06 }}\n >\n <ExpandMoreIcon />\n </Transition>\n );\n\n return (\n <StyledButton\n {...rest}\n aria-controls={panelId}\n aria-expanded={Boolean(isExpanded)}\n data-testid={testId}\n disabled={isDisabled}\n id={buttonId}\n isExpanded={isExpanded}\n isInverse={isInverse}\n onClick={handleClick}\n onKeyDown={handleKeyDown}\n ref={ref}\n theme={theme}\n >\n {iconPosition === AccordionIconPosition.left && (\n <>\n {caret}\n <Spacer size={12} />\n </>\n )}\n <TextWrapper>{children}</TextWrapper>\n {iconPosition === AccordionIconPosition.right && (\n <>\n <Spacer size={12} />\n {caret}\n </>\n )}\n </StyledButton>\n );\n});\n","import * as React from 'react';\nimport styled from '../../theme/styled';\n\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport { ThemeInterface } from '../../theme/magma';\nimport { useIsInverse } from '../../inverse';\nimport { AccordionItemContext } from './useAccordionItem';\nimport { Transition } from '../Transition';\n\n/**\n * @children required\n */\nexport interface AccordionPanelProps\n extends React.HTMLAttributes<HTMLDivElement> {\n testId?: string;\n isInverse?: boolean;\n /**\n * @internal\n */\n theme?: ThemeInterface;\n}\n\nconst StyledPanel = styled.div<AccordionPanelProps>`\n background: transparent;\n color: ${props =>\n props.isInverse\n ? props.theme.colors.neutral08\n : props.theme.colors.neutral};\n padding: ${props =>\n `${props.theme.spaceScale.spacing03} ${props.theme.spaceScale.spacing05} ${props.theme.spaceScale.spacing04}`};\n`;\n\nexport const AccordionPanel = React.forwardRef<\n HTMLDivElement,\n AccordionPanelProps\n>((props, ref) => {\n const { children, testId, isInverse: isInverseProp, ...rest } = props;\n const theme = React.useContext(ThemeContext);\n const isInverse = useIsInverse(isInverseProp);\n\n const { buttonId, isExpanded, panelId } =\n React.useContext(AccordionItemContext);\n\n return (\n <Transition isOpen={isExpanded} collapse unmountOnExit>\n <StyledPanel\n {...rest}\n aria-labelledby={buttonId}\n aria-hidden={!isExpanded}\n data-testid={testId}\n id={panelId}\n isInverse={isInverse}\n ref={ref}\n theme={theme}\n >\n {children}\n </StyledPanel>\n </Transition>\n );\n});\n","import * as React from 'react';\nimport styled from '../../theme/styled';\nimport { css } from '@emotion/core';\nimport * as CSS from 'csstype';\n\nexport enum GridDisplay {\n grid = 'grid', // default\n inlineGrid = 'inline-grid',\n}\n\nexport enum GridJustifyItems {\n start = 'start',\n end = 'end',\n center = 'center',\n stretch = 'stretch',\n}\n\nexport enum GridJustifyContent {\n start = 'start',\n end = 'end',\n center = 'center',\n stretch = 'stretch',\n spaceAround = 'space-around',\n spaceBetween = 'space-between',\n spaceEvenly = 'space-evenly',\n}\n\nexport enum GridAlignItems {\n start = 'start',\n end = 'end',\n center = 'center',\n stretch = 'stretch',\n}\n\nexport enum GridAlignContent {\n start = 'start',\n end = 'end',\n center = 'center',\n stretch = 'stretch',\n spaceAround = 'space-around',\n spaceBetween = 'space-between',\n spaceEvenly = 'space-evenly',\n}\n\nexport enum GridItemJustifySelf {\n start = 'start',\n end = 'end',\n center = 'center',\n stretch = 'stretch',\n}\n\nexport enum GridItemAlignSelf {\n start = 'start',\n end = 'end',\n center = 'center',\n stretch = 'stretch',\n}\n\nexport enum GridAutoFlow {\n row = 'row',\n column = 'column',\n rowDense = 'row-dense',\n columnDense = 'column-dense',\n}\n\n/**\n * @children required\n */\nexport interface GridProps extends React.HTMLAttributes<HTMLDivElement> {\n /**\n * Defines the display style property. Sets grid or inline-grid.\n * @default GridDisplay.grid\n */\n gridDisplay?: GridDisplay;\n /**\n * Set the columns in the grid.\n */\n gridTemplateColumns?: CSS.Property.GridTemplateColumns;\n /**\n * Set the rows in the grid.\n */\n gridTemplateRows?: CSS.Property.GridTemplateRows;\n /**\n * Set the areas in the grid.\n */\n gridTemplateAreas?: CSS.Property.GridTemplateAreas;\n /**\n * Set the space between columns and / or rows in the grid.\n */\n gridGap?: CSS.Property.GridGap;\n /**\n * Align grid items along the inline (row) axis. Applies to all items in the grid.\n */\n gridJustifyItems?: GridJustifyItems;\n /**\n * Sets the alignment of the grid within the grid container along the inline row axis.\n */\n gridJustifyContent?: GridJustifyContent;\n /**\n * Align grid items along the block (column) axis. Applies to all items in the grid.\n */\n gridAlignItems?: GridAlignItems;\n /**\n * Sets the alignment of the grid within the grid container along the block (column) axis.\n */\n gridAlignContent?: GridAlignContent;\n /**\n * If you have grid items that you don’t explicitly place on the grid, the auto-placement algorithm kicks in to automatically place the items.\n */\n gridAutoFlow?: GridAutoFlow;\n}\n\n/**\n * @children required\n */\nexport interface GridItemProps extends React.HTMLAttributes<HTMLDivElement> {\n /**\n * Defines the span of a column on a grid item.\n */\n gridColumn?: CSS.Property.GridColumn;\n /**\n * Defines the span of a row on a grid item.\n */\n gridRow?: CSS.Property.GridRow;\n /**\n * Define which grid area a grid item belongs to.\n */\n gridArea?: CSS.Property.GridArea;\n /**\n * Aligns the grid item within the cell along the inline (row) axis. Applies to a grid item inside a single cell.\n */\n gridItemJustifySelf?: GridItemJustifySelf;\n /**\n * Aligns the grid item within the cell along the block (column) axis. Applies to a grid item inside a single cell.\n */\n gridItemAlignSelf?: GridItemAlignSelf;\n}\n\nexport const Grid = styled.div<GridProps>`\n ${props =>\n css({\n display: props.gridDisplay || GridDisplay.grid,\n 'grid-template-rows': props.gridTemplateRows,\n 'grid-template-columns': props.gridTemplateColumns,\n 'grid-areas': props.gridTemplateAreas,\n 'grid-gap': props.gridGap,\n 'justify-items': props.gridJustifyItems,\n 'justify-content': props.gridJustifyContent,\n 'align-items': props.gridAlignItems,\n 'align-content': props.gridAlignContent,\n 'grid-auto-flow': props.gridAutoFlow,\n })}\n`;\n\nexport const GridItem = styled.div<GridItemProps>`\n ${props =>\n css({\n 'grid-column': props.gridColumn,\n 'grid-row': props.gridRow,\n 'grid-area': props.gridArea,\n 'justify-self': props.gridItemJustifySelf,\n 'align-self': props.gridItemAlignSelf,\n })}\n`;\n","import * as React from 'react';\nimport styled from '../../theme/styled';\nimport { css } from '@emotion/core';\n\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport { magma, ThemeInterface } from '../../theme/magma';\nimport { InverseContext, useIsInverse } from '../../inverse';\n\n/**\n * @children required\n */\nexport interface BlockQuoteProps extends React.HTMLAttributes<HTMLDivElement> {\n /**\n * Style properties for the left border color which accept custom CSS hex values.\n */\n borderStyle?: keyof typeof magma.colors | string;\n isInverse?: boolean;\n /**\n * @internal\n */\n testId?: string;\n theme?: ThemeInterface;\n}\n\nconst BlockQuoteStyles = props => css`\n border-left: 4px solid\n ${props.isInverse\n ? props.borderStyle || props.theme.colors.neutral08\n : props.borderStyle || props.theme.colors.neutral06};\n padding: 10px 0 4px 20px;\n margin: 0;\n`;\n\nconst StyledBlockQuote = styled.figure<BlockQuoteProps>`\n ${BlockQuoteStyles};\n`;\n\nexport const BlockQuote = React.forwardRef<HTMLDivElement, BlockQuoteProps>(\n (props, ref) => {\n const {\n borderStyle,\n children,\n testId,\n isInverse: isInverseProp,\n ...rest\n } = props;\n const theme = React.useContext(ThemeContext);\n const isInverse = useIsInverse(isInverseProp);\n\n return (\n <InverseContext.Provider value={{ isInverse }}>\n <StyledBlockQuote\n borderStyle={magma.colors[borderStyle] || borderStyle}\n theme={theme}\n isInverse={isInverse}\n ref={ref}\n data-testid={props.testId}\n {...rest}\n >\n {children}\n </StyledBlockQuote>\n </InverseContext.Provider>\n );\n }\n);\n","import * as React from 'react';\nimport styled from '../../theme/styled';\nimport { css } from '@emotion/core';\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport { useIsInverse } from '../../inverse';\nimport { BlockQuoteProps } from '.';\nimport {\n TypographyVisualStyle,\n TypographyColor,\n TypographyContextVariant,\n TypographyComponent,\n} from '../Typography';\n/**\n * @children required\n */\nexport interface BlockQuoteItemProps\n extends BlockQuoteProps,\n React.HTMLAttributes<HTMLDivElement> {\n /**\n * The color of the component, helping to convey meaning or relative emphasis\n * @default TypographyColor.default\n */\n color?: TypographyColor;\n /**\n * Additional styles for typography based on the context of the content\n * @default TypographyContextVariant.default\n */\n contextVariant?: TypographyContextVariant;\n /**\n * If true, adds in an attribution line for the quote\n * @default false\n */\n hasAttribution?: boolean;\n isInverse?: boolean;\n testId?: string;\n /**\n * Applies visual styles including font-size, font-weight, line-height and margins\n * @default TypographyVisualStyle.bodyMedium\n */\n visualStyle?: TypographyVisualStyle;\n}\n\nexport const blockQuoteStyles = props => css`\n margin: 0;\n padding: 8px 0;\n blockquote {\n margin: 0;\n }\n //Inverse\n ${props.isInverse &&\n css`\n color: ${props.theme.colors.neutral08};\n `}\n //Inverse & Attribution\n ${props.isInverse &&\n props.hasAttribution &&\n css`\n color: ${props.theme.colors.neutral05};\n `}\n`;\n\nconst StyledBlockQuoteItem = styled(TypographyComponent)`\n ${blockQuoteStyles}\n`;\n\nexport const BlockQuoteItem = React.forwardRef<\n HTMLDivElement,\n BlockQuoteItemProps\n>((props, ref) => {\n const { children, color, hasAttribution, testId, visualStyle, ...rest } =\n props;\n const theme = React.useContext(ThemeContext);\n const isInverse = useIsInverse();\n\n return (\n <StyledBlockQuoteItem\n as={hasAttribution ? 'figcaption' : 'blockquote'}\n color={\n hasAttribution\n ? color || TypographyColor.subdued\n : color || TypographyColor.default\n }\n theme={theme}\n hasAttribution={hasAttribution}\n isInverse={isInverse}\n ref={ref}\n data-testid={props.testId}\n visualStyle={\n hasAttribution\n ? visualStyle || TypographyVisualStyle.bodyMedium\n : visualStyle || TypographyVisualStyle.bodyLarge\n }\n {...rest}\n >\n {hasAttribution ? (\n <>\n ― \n {children}\n </>\n ) : (\n <>\n “\n {children}\n ”\n </>\n )}\n </StyledBlockQuoteItem>\n );\n});\n","import * as React from 'react';\nimport { useGenerateId } from '../../utils';\nimport { DropdownHeader } from './DropdownHeader';\n\n/**\n * @children required\n */\nexport interface DropdownMenuGroupProps\n extends React.HTMLAttributes<HTMLDivElement> {\n /**\n * Header text to use for the menu group\n */\n header?: React.ReactNode;\n}\n\nexport const DropdownMenuGroup: React.FunctionComponent<DropdownMenuGroupProps> = (\n props: DropdownMenuGroupProps\n) => {\n const { children, id: defaultId, header, ...other } = props;\n\n const id = useGenerateId(defaultId);\n\n return (\n <div {...other} aria-labelledby={id} role=\"group\">\n {header && <DropdownHeader id={id}>{header}</DropdownHeader>}\n {children}\n </div>\n );\n};\n","import * as React from 'react';\n\nimport { TARGET_ID } from '../SkipLink';\n\n/**\n * @children required\n */\nexport interface SkipLinkContentProps\n extends React.HTMLAttributes<HTMLDivElement> {\n testId?: string;\n}\n\nexport const SkipLinkContent: React.FunctionComponent<SkipLinkContentProps> = props => {\n const { children, testId } = props;\n return (\n <div\n data-testid={testId}\n id={TARGET_ID}\n tabIndex={-1}\n style={{ outline: 0 }}\n >\n {children}\n </div>\n );\n};\n","import React from 'react';\n\nexport function useMediaQuery(queryInput) {\n const query = queryInput.replace(/^@media( ?)/m, '');\n\n const supportMatchMedia =\n typeof window !== 'undefined' && typeof window.matchMedia !== 'undefined';\n\n const matchMedia = supportMatchMedia ? window.matchMedia : null;\n\n const [match, setMatch] = React.useState(() => {\n if (supportMatchMedia) {\n return matchMedia(query).matches;\n }\n\n return false;\n });\n\n React.useEffect(() => {\n let active = true;\n\n if (!supportMatchMedia) {\n return undefined;\n }\n\n const queryList = matchMedia(query);\n\n const updateMatch = () => {\n if (active) {\n setMatch(queryList.matches);\n }\n };\n\n updateMatch();\n queryList.addEventListener('change', updateMatch);\n\n return () => {\n active = false;\n queryList.removeEventListener('change', updateMatch);\n };\n }, [query, matchMedia, supportMatchMedia]);\n\n return match;\n}\n"],"names":["typeScale","size01","fontSize","letterSpacing","lineHeight","size02","size03","size04","size05","size06","size07","size08","size09","size10","size11","size12","size13","colors","primary","primaryInverse","focus","focusInverse","foundation","foundation02","foundation03","foundation04","pop","pop02","pop03","pop04","pop05","pop06","success","success02","successInverse","danger","dangerInverse","neutral","neutral02","neutral03","neutral04","neutral05","neutral06","neutral07","neutral08","disabledText","disabledInverseText","toggleBoxShadow","shade","shade02","tint","tint02","tint03","tint04","tone","tone02","border","borderInverse","spaceScale","spacing01","spacing02","spacing03","spacing04","spacing05","spacing06","spacing07","spacing08","spacing09","spacing10","spacing11","spacing12","spacing13","spacing14","magma","bodyFont","bodyExpressiveFont","bodyNarrativeFont","borderRadius","headingFont","headingExpressiveFont","headingNarrativeFont","direction","spacingMultiplier","transitions","fade","motion","exit","opacity","transition","duration","ease","enter","baseStyle","slideTop","y","type","damping","stiffness","position","top","right","left","slideBottom","bottom","slideRight","x","slideLeft","nudgeTop","nudgeBottom","nudgeRight","nudgeLeft","scale","rotate45","rotate","rotate90","rotate180","collapse","height","overflow","breakpoints","xs","small","medium","large","xl","iconSizes","xSmall","xLarge","typographyVisualStyles","headingXLarge","mobile","desktop","fontWeight","headingLarge","headingMedium","headingSmall","headingXSmall","heading2XSmall","bodyLarge","bodyMedium","bodySmall","bodyXSmall","typographyExpressiveVisualStyles","typographyNarrativeVisualStyles","appBar","backgroundColor","padding","textColor","compact","inverse","combobox","menu","maxHeight","modal","width","drawer","maxWidth","minHeight","margin","dropdown","content","iterableColors","tabs","approxTabSize","horizontal","vertical","select","tag","display","alignItems","justifyContent","tooltip","arrowSize","arrowSizeDoubled","zIndex","ThemeContext","React","DEFAULT_STYLE_PROPS","color","shape","size","textTransform","variant","buildPropsWithDefaultButtonStyles","props","buildButtonSize","theme","cachedType","defaultI18n","locale","dateFormat","timeFormat","example","months","january","february","march","april","may","june","july","august","september","october","november","december","days","monday","tuesday","wednesday","thursday","friday","saturday","sunday","min","emptyItemsListText","alert","dismissAriaLabel","breadcrumb","navAriaLabel","charts","line","chartTabLabel","dataLegendsLabel","dataTabLabel","keyboardInstructions","keyboardInstructionsHeader","keyboardInstructionsTooltip","legendButtonAriaLabel","clearIndicatorAriaLabel","createLabel","datePicker","startOfWeek","calendarIconAriaLabel","calendarOpenAnnounce","calendarCloseAriaLabel","previousMonthAriaLabel","nextMonthAriaLabel","disabledDayAriaLabel","selectedDayAriaLabel","todayAriaLabel","helpModal","header","helpButtonAriaLabel","ariaLabel","explanation","rightAndLeftArrowKeys","upAndDownArrowKeys","pageUpAndPageDownKeys","displayValue","homeAndEndKeys","escape","questionMark","menuItemSelectedAriaLabel","toggleMenuAriaLabel","dropzone","browseFiles","dragMessage","errors","message","required","files","bytes","deleteFile","removeFile","navigationButtonLabel","search","input","placeholder","iconAriaLabel","indeterminateCheckbox","isCheckedAnnounce","isIndeterminateAnnounce","isUncheckedAnnounce","isClearableAriaLabel","loadingIndicator","progressBar","messages","first","second","third","spinner","closeAriaLabel","multiSelect","selectedItemButtonAriaLabel","multiCombobox","pagination","nextButtonLabel","previousButtonLabel","pageButtonLabel","password","shown","buttonText","announce","hidden","skipLink","table","ofLabel","nextAriaLabel","previousAriaLabel","rowsPerPageLabel","horizontalTabsInstructions","verticalTabsInstructions","deleteAriaLabel","timePicker","hoursAriaLabel","minutesAriaLabel","amButtonAriaLabel","pmButtonAriaLabel","amSelectedAnnounce","pmSelectedAnnounce","wizard","actions","next","previous","cancel","submit","optional","navigationLabel","I18nContext","generateId","id","uuidv4","useGenerateId","newId","useState","updateId","useEffect","omit","obj","reduce","newObj","val","usePrevious","value","ref","useRef","current","debounce","func","wait","timeout","debounced","args","context","this","clearTimeout","setTimeout","apply","clear","detectScrollType","dummy","document","createElement","appendChild","createTextNode","dir","style","body","scrollLeft","getNormalizedScrollLeft","element","Number","scrollWidth","clientWidth","easeInOutSin","time","Math","sin","PI","assignRef","error","Error","useForkedRef","refs","useMemo","every","node","forEach","stringIncludesUnit","includes","convertStyleValueToString","defaultValue","getNodeText","Array","map","join","children","candidateSelectors","StyledSpinner","styled","span","Spinner","testId","other","i18n","sizeString","role","buttonStyles","css","disabled","isInverse","buildButtonBackground","buildBorderColor","buildButtonBorderRadius","buildColor","isFullWidth","buildButtonFontSize","buildButtonLineHeight","buildButtonPadding","iconOnly","lighten","darken","buildFocusBackground","buildFocusColor","buildAfterBackground","buildActiveBackground","buildActiveColor","BaseStyledButton","SpinnerWrapper","ChildrenWrapper","isLoading","StyledButton","ButtonType","button","spinnerColor","ButtonVariant","outline","link","spinnerSize","ButtonSize","InverseContext","useIsInverse","inverseProp","inverseContext","Boolean","ButtonColor","ButtonShape","ButtonTextTransform","ButtonIconPosition","Button","rest","SpanTextLeft","getIconPadding","SpanTextRight","getIconSize","AlertVariant","IconButton","icon","iconPosition","object","round","solid","only","fill","uppercase","Circle","circle","ProgressRing","isActive","radius","strokeWidth","percentage","setPercentage","interval","setInterval","clearInterval","normalizedRadius","circumference","strokeDashoffset","cx","cy","r","stroke","strokeDasharray","VARIANT_ICON","info","InfoIcon","muted","CheckCircleIcon","warning","WarningIcon","ErrorIcon","buildAlertBackground","AnnouncePoliteness","StyledAlert","div","isExiting","isToast","StyledAlertInner","AlertContents","IconWrapperStyles","IconWrapper","ProgressRingWrapper","DismissibleIconWrapper","whitelistProps","DismissButton","shouldForwardProp","prop","isPropValid","alertVariant","AlertBase","forceDismiss","hasTimerRing","defaultId","isDismissed","isDismissible","externalIsExiting","isPaused","onDismiss","toastDuration","setIsExiting","handleDismiss","transitionDuration","tabIndex","Provider","renderIcon","CloseIcon","onClick","Alert","AppBarPosition","Announce","politeness","polite","BadgeColor","BadgeVariant","StyledHeader","sticky","fixed","isCompact","AppBar","baseBadgeStyles","buildBadgeBackground","light","counter","StyledSpan","buildBadgeFocusBackground","buildBadgeActiveBackground","Badge","BadgeComponent","label","StyledBanner","BannerContents","ButtonWrapper","allowedProps","getButtonColor","secondary","HideAtBreakpointDisplayType","Banner","actionButtonText","actionButtonOnClick","StyledList","Breadcrumb","isInverseProp","linkStyles","StyledLink","Hyperlink","to","styledAs","composedStyle","ClassNames","className","composedCss","LinkStyledAsButton","withComponent","href","StyledItem","li","BreadcrumbItem","ChevronRightIcon","BreakpointScreenSize","Container","displayType","minWidth","HideAtBreakpoint","block","getMinWidth","screenSize","breakpointValues","definedBreakpoints","sizes","Object","keys","slice","indexOf","find","newSize","CardAlignment","CardCalloutType","TypographyColor","TypographyContextVariant","TypographyVisualStyle","StyledCard","background","hasDropShadow","calloutType","align","buildCalloutBackground","CardContext","Card","StyledCardBody","CardBody","colorStyles","contextVariant","subdued","baseParagraphStyles","expressive","narrative","getBodyFontFamily","baseHeadingStyles","getHeadingFontFamily","headingLargeStyles","noMargins","TypographyComponent","p","visualStyle","headingXLargeStyles","headingMediumStyles","headingSmallStyles","headingXSmallStyles","heading2XSmallStyles","paragraphLargeStyles","paragraphMediumStyles","paragraphSmallStyles","paragraphXSmallStyles","getTypographyStyles","Heading","level","stylesFromLevel","as","StyledCardHeading","CardHeading","headingLevel","DisplayInputStyles","DisplayInputActiveStyles","buildDisplayInputActiveBackground","buildDisplayInputFocusStyles","InputSize","InputType","InputIconPosition","HiddenStyles","inputWrapperStyles","hasError","inputBaseStyles","inputSize","InputWrapper","StyledInput","IconButtonContainer","IsClearableContainer","LabelPosition","InputBase","forwardedRef","containerStyle","iconRef","isClearable","isPredictive","onClear","onIconClick","onIconKeyDown","inputStyle","setValue","inputRef","onChange","event","target","text","ClearIcon","onKeyDown","Message","BuildMessageColor","InputMessage","CheckboxTextPosition","StyledLabel","labelPosition","Label","actionable","FormGroupContext","HiddenLabel","FormGroup","errorMessage","helperMessage","labelledById","labelStyle","labelText","isTextVisuallyHidden","descriptionId","StyledLabelComponent","htmlFor","Consumer","StyledContainerComponent","StyledContainer","HiddenLabelText","HiddenInput","StyledFakeInput","buildDisplayInputBorderColor","isChecked","isIndeterminate","buildCheckIconColor","textPosition","Checkbox","checked","defaultChecked","updateIsChecked","isControlled","groupDescriptionId","describedBy","targetChecked","CheckBoxIcon","CheckBoxOutlineBlankIcon","gutterWidth","gutterWidthString","maxWidthString","useControlled","controlled","defaultProp","undefined","newValue","useDataPagination","defaultItemsPerPage","items","itemsPerPageProp","itemsPerPage","onItemsPerPageChange","setItemsPerPageState","length","ceil","getPageItems","page","newItemsPerPage","IndeterminateCheckboxStatus","VisuallyHiddenDiv","VisuallyHidden","TableDensity","TableCellAlign","TableSortDirection","TableRowColor","IndeterminateCheckbox","status","isUnchecked","replaceLabelTextForAnnounceText","baseAnnounceText","replace","getStringifiedLabelText","showAnnounce","announceText","IndeterminateCheckBoxIcon","paddingLeft","TableContext","density","normal","hasHoverStyles","hasZebraStripes","hasVerticalBorders","isSelectable","rowCount","selectedItems","TableContainer","StyledTable","Table","TableBody","baseTableCellStyle","buildCellPaddingStyle","textAlign","StyledCell","td","TableCell","tableContext","displayName","TableHeaderCellScope","TableHead","StyledTableHeaderCell","th","isRowHeader","borderBottom","verticalAlign","isSortable","SortButton","TableHeaderCell","onSort","scope","row","col","sortDirection","SortIcon","ascending","SouthIcon","descending","NorthIcon","SortDoubleArrowIcon","usePagination","count","defaultPage","hideNextButton","hidePreviousButton","numberOfAdjacentPages","numberOfEdgePages","handleChange","onPageChange","pageProp","showFirstButton","showLastButton","useContext","setPageState","handleClick","range","start","end","from","_","i","startPages","endPages","max","siblingsStart","siblingsEnd","itemList","buttonPage","pageButtons","item","isSelected","registerDescendant","itemRefArray","itemRef","index","findIndex","compareDocumentPosition","Node","DOCUMENT_POSITION_PRECEDING","newItem","unregisterDescendant","filter","useDescendants","DropdownDropDirection","DropdownAlignment","DropdownContext","isOpen","registerDropdownMenuItem","elements","setIsOpen","Dropdown","activeIndex","alignment","dropDirection","onBeforeShiftFocus","onClose","onOpen","activeItemIndex","setActiveItemIndex","ownRef","toggleRef","menuRef","dropdownButtonId","closeDropdown","preventMagmaFocus","handlePreventMagmaFocus","getFilteredItem","filteredItems","filteredItemIndex","filteredItem","activeElement","handleDropdownBlur","relatedTarget","currentTarget","contains","isFixedWidth","openDropdown","key","preventDefault","onBlur","getButtonPadding","StyledIconButton","DropdownButton","buttonIcon","ArrowLeftIcon","ArrowRightIcon","up","ArrowDropUpIcon","ArrowDropDownIcon","getButtonIcon","iconPositionToUse","StyledDiv","DropdownContent","StyledHr","hr","DropdownHeader","MenuItemStyles","isInactive","DropdownMenuItem","CheckIcon","TooltipPosition","DropdownSplitButton","leftCap","borderRight","marginRight","rightCap","marginLeft","PageCount","RowsPerPageLabel","TablePagination","defaultRowsPerPage","dropdownDropDirection","itemCount","onRowsPerPageChange","rowsPerPageProp","rowsPerPage","rowsPerPageValues","setRowsPerPageState","setActiveIndex","displayPageStart","displayPageEnd","rowsPerPageItems","toString","handleRowsPerPageChange","previousButton","nextButton","WestIcon","EastIcon","StyledTableRow","tr","buildTableRowBackground","buildTableRowColor","TableRow","headerRowStatus","isSelectableDisabled","onHeaderRowSelect","onTableRowSelect","rowIndex","isHeaderRow","getIsCheckboxInverse","child","DefaultPagination","Datagrid","columns","customComponents","components","componentsProps","defaultSelectedRows","onHeaderSelect","onRowSelect","onSelectedRowsChange","paginationProps","rows","selectedRowsProp","selectedRows","hasPagination","rowsToShow","setRowsToShow","updatedSelectedRows","currentPage","setCurrentPage","Pagination","passedOnPaginationProps","newPage","filteredRows","indeterminate","unchecked","handleSelectedRowsChange","newSelectedRows","field","push","splice","handleRowSelect","CalendarContext","chosenDate","Date","focusedDate","buildCalendarMonth","newDate","enableOutsideDates","showHelperInformation","hideHelperInformation","onDateChange","onPrevMonthClick","onNextMonthClick","setDateFocused","EnumTooltipPosition","TooltipContainer","TooltipArrow","StyledTooltip","Tooltip","open","isVisible","setIsVisible","referenceElement","setReferenceElement","popperElement","setPopperElement","setArrowElement","usePopper","modifiers","name","options","offset","placement","styles","attributes","combinedRef","showTooltip","hideTooltip","handleEsc","window","addEventListener","removeEventListener","arrowStyle","tooltipStyle","isArray","tooltipTrigger","onFocus","combinedTooltipStyles","popper","combinedArrowStyle","arrow","onMouseLeave","onMouseEnter","getPrevMonthFromDate","prevDate","startOfMonth","subMonths","getNextMonthFromDate","addMonths","i18nFormat","date","formatStr","enUS","format","getDateFromString","CalendarHeaderContainer","CalendarIconButton","CalendarHeaderText","CalendarHeader","calendarHeader","prevFocusHeader","focusHeader","currentMonth","capitalizeCurrentMonth","charAt","toUpperCase","ArrowBackIcon","ArrowForwardIcon","CalendarDayCell","CalendarDayInner","isChosen","EmptyCell","TodayIndicator","CalendarDay","dayRef","dateFocused","maxDate","minDate","focused","setFocused","day","dayFocusable","isSameDay","isAfter","isBefore","sameDateAsFocusedDate","sameDateAsChosenDate","sameDateAsToday","isFocused","List","ul","Item","KeyboardShortcutButtonWrapper","StyledPopup","StyledNavContainer","StyledContent","HelperInformation","useFocusLock","active","rootNode","focusableItems","updateFocusableItems","_rootNode$current","querySelectorAll","firstChild","setAttribute","observer","MutationObserver","observe","childList","subtree","disconnect","handleKeyPress","shiftKey","firstItem","lastItem","CalendarContainer","MonthContainer","Th","HelperButton","CloseButton","CalendarMonth","lastFocus","headingRef","setDayFocusable","setFocusHeader","prevCalendarOpened","calendarOpened","focusTrapElement","focusOnOpen","tableDaysHeaders","concat","helperInformationShown","week","dayOfWeek","KeyboardIcon","handleCloseButtonClick","StyledFormFieldContainer","FormFieldContainer","fieldId","isLabelVisuallyHidden","messageStyle","Input","DatePickerContainer","DatePickerCalendar","opened","DatePicker","setHelperInformationShown","setCalendarOpened","setDateFromConsumer","defaultDate","setDefaultFocusedDate","setFocusedDate","setChosenDate","convertedDate","convertedMinDate","convertedMaxDate","inDateRange","minDateValue","maxDateValue","reset","isValidDateFromString","isValidDateFormat","test","isValidDate","isValid","handleInputKeyDown","handleDateChange","toISOString","inputValue","month","enableOutsideDays","firstDayOfWeek","firstOfMonth","lastOfMonth","endOfMonth","prevDays","getDay","nextDays","firstDay","subDays","lastDay","addDays","totalDays","differenceInDays","currentDay","weeksInMonth","getCalendarMonthWeeks","closest","newChosenDate","e","toggleCalendar","getAttribute","subWeeks","addWeeks","endOfWeek","EventIcon","onInputChange","isValidDay","onInputBlur","onInputFocus","toLowerCase","a","DropdownMenuNavItem","FlexAlignContent","FlexAlignItems","FlexBehavior","FlexDirection","FlexJustify","FlexWrap","getWidth","IconSizes","IconAlignment","ulListType","olListType","StyledFlex","behavior","alignContent","wrap","justify","spacing","container","sm","md","lg","Flex","stretch","flexStart","Paragraph","StyledForm","FormActions","Form","headingContextVariant","headingVisualStyle","description","getIconSizes","iconSize","getListAlignment","iconAlign","center","getListDisplay","ProgressBarColor","ListStyles","listType","spacingStyle","hasStart","isOrdered","isReversed","reversed","ListItemStyles","IconStyles","iconBackground","iconColor","StyledListItem","StyledIcon","ListItem","buildProgressBarBackground","LoadingIndicatorType","isLoadingIndicator","Track","Bar","isAnimated","Percentage","TopPercentage","ProgressBar","isLabelVisible","labelId","percentageValue","heightString","StyledLoadingIndicator","MessageContainer","hide","LoadingIndicator","messageLevel","setMessageLevel","loadingIndicatorType","messageLevel2Timeout","progressbar","messageLevel3Timeout","message1","message2","message3","SelectText","SelectedItemsWrapper","SelectedItemButton","DefaultClearIndicator","DefaultDropdownIndicator","flexShrink","DefaultLoadingIndicator","DefaultItem","itemString","defaultComponents","ClearIndicator","DropdownIndicator","ChildrenContainer","SelectTriggerButton","ariaDescribedBy","passedInStyle","toggleButtonProps","cursor","TabsOrientation","StyledNativeSelect","NativeSelect","TabsContainerContext","createContext","activeTabIndex","isInverseContainer","setActiveTabIndex","StyledTabsContainer","TabsContainer","forwardRef","setIsInverseContainer","StyledScrollButton","buttonVisible","orientation","StyledButtonPrev","transparentize","StyledButtonNext","ButtonPrev","ExpandLessIcon","ArrowBackIosIcon","ButtonNext","ExpandMoreIcon","ArrowForwardIosIcon","useTabsMeta","isRtl","scrollStart","clientSize","displayScroll","setDisplayScroll","tabsWrapperRef","prevButtonRef","nextButtonRef","scroll","scrollValue","property","requestAnimationFrame","step","timestamp","animate","moveTabsScroll","delta","updateScrollButtonState","showStartScroll","showEndScroll","scrollTop","scrollHeight","clientHeight","handleResize","handleTabsScroll","useCallback","handleStartScrollClick","handleEndScrollClick","TabsAlignment","TabsBorderPosition","TabsIconPosition","TabsContext","borderPosition","changeHandler","registerTabButton","StyledTabsWrapper","StyledTabs","Tabs","tabsMeta","tabsHandleMethods","tabsRefs","buttonRefArray","childrenWrapperRef","scrollSelectedIntoView","tabMeta","tabsNode","rect","getBoundingClientRect","scrollLeftNormalized","childrenArray","tab","getTabsMeta","prevButtonOffset","offsetHeight","offsetWidth","nextButtonOffset","nextScrollStart","tabIsEnabled","findPreviousEnabledTabIndex","modifiedActiveTabIndex","currentTabIndex","newActiveTabIndex","findNextEnabledTabIndex","lastChildIndex","onScroll","previousItemKey","nextItemKey","newActiveIndex","hasAttribute","useForceUpdate","setTick","tick","StyledTabsChild","TabStyles","getFlexDirection","StyledTab","isIconOnly","getIconMargin","Tab","forceUpdate","tabIconPosition","StyledTabPanel","TabPanel","TabPanelsContainer","Children","cloneElement","NavTabsContext","NavTabs","StyledCustomTab","newProps","component","jsx","NavTab","instanceOfNavChildrenTab","pageButtonTypeSize","buttonSize","boxShadowColor","hoverBoxShadowColor","PageButtonSize","StyledPageButton","BuildBorder","hoverBorder","PageButton","StyledNav","nav","BuildButtonSize","RadioTextPosition","NavButton","StyledEllipsis","ariaCurrent","PasswordInput","passwordShown","setPasswordShown","hiddenPasswordAnnounceText","hidePasswordButtonAriaLabel","hidePasswordButtonText","isPasswordMaskButtonHidden","shownPasswordAnnounceText","showPasswordButtonAriaLabel","showPasswordButtonText","HIDDEN_PASSWORD_ANNOUNCE_TEXT","HIDE_PASSWORD_BUTTON_ARIA_LABEL","HIDE_PASSWORD_BUTTON_TEXT","SHOWN_PASSWORD_ANNOUNCE_TEXT","SHOW_PASSWORD_BUTTON_ARIA_LABEL","SHOW_PASSWORD_BUTTON_TEXT","autoCorrect","autoCapitalize","prevPasswordShown","RadioContext","RadioGroup","selectedValue","setSelectedValue","newSelectedValue","buildErrorBorder","ModalSize","buildRadioIconColor","Radio","RadioButtonCheckedIcon","RadioButtonUncheckedIcon","Transition","unmountOnExit","initial","customTransition","shouldExpand","variants","acc","themeVariant","AnimatePresence","ModalContainer","ModalBackdrop","ModalContent","ModalHeader","H1","CloseBtn","ModalBody","Modal","bodyRef","headingId","contentId","isModalOpen","setIsModalOpen","setCurrentTarget","prevOpen","handleEscapeKeyDown","stopPropagation","onEscKeyDown","handleClose","isEscKeyDownDisabled","closeButtonSize","containerTransition","isBackgroundClickDisabled","isCloseButtonHidden","CloseIconButton","ReactDOM","createPortal","Global","getElementById","onMouseDown","getElementsByTagName","Search","onSearch","SearchIcon","handleSearch","NoItemsMessage","ItemsList","getMenuProps","itemToString","highlightedIndex","getItemProps","menuStyle","hasItems","otherDownshiftItemProps","itemProps","SelectContainerElement","InputMessageContainer","SelectContainer","getLabelProps","Select","defaultSelectedItem","innerRef","itemListMaxHeight","initialSelectedItem","onIsOpenChange","onKeyPress","onKeyUp","passedInSelectedItem","selectedItem","toggleButtonRef","getValidItem","itemToCheck","useSelect","changes","changedSelectedItem","setHighlightedIndex","stateReducer","state","actionAndChanges","stateChangeTypes","ToggleButtonKeyDownCharacter","getToggleButtonProps","openMenu","selectText","marginTop","marginBottom","MultiSelect","onRemoveSelectedItem","checkSelectedItemValidity","useMultipleSelection","initialSelectedItems","getSelectedItemProps","getDropdownProps","addSelectedItem","removeSelectedItem","getFilteredItems","unfilteredItems","selectProps","onSelectedItemChange","newSelectedItem","selectItem","tagName","nativeEvent","preventDownshiftDefault","preventKeyAction","multiSelectedItem","multiSelectedItemString","handleRemoveSelectedItem","instanceOfDefaultItemObject","SelectStateChangeTypes","MultipleSelectionStateChangeTypes","ComboBoxContainer","InputContainer","ComboboxInput","getComboboxProps","getInputProps","onInputKeyDown","onInputKeyPress","onInputKeyUp","setIsFocused","inputProps","useComboboxItems","defaultItems","afterInitialRender","allItems","displayItems","setDisplayItems","cleanItems","newItems","defaultOnInputValueChange","disableCreateItem","inputBaseValue","startsWith","inputValueInList","react_magma__created_item","InternalCombobox","newItemTransform","onInputValueChange","onItemCreated","isCreatedItem","updateItemsRef","useCombobox","changedIsOpen","createdItem","defaultNewItemTransform","setInputValue","InputKeyDownEnter","ItemClick","InputBlur","FunctionReset","MultiCombobox","comboboxProps","handleInputChange","selectedItemsContent","SpacerAxis","ComboboxStateChangeTypes","TARGET_ID","StyledSkipLink","positionLeft","positionTop","getHeight","axis","TagColor","TagSize","StyledSpacer","Spacer","both","buildLabelPadding","ToggleTextPosition","TagStyling","buildButtonTextColor","buildBoxShadow","buildTagPadding","onDelete","buildSvgOpacity","LabelWrap","Tag","StyledTag","CancelIcon","ToastsContext","toastsArray","bottomOffset","ToastsContainer","ToastWrapper","bottomOffsetForToast","bottomOffsetForContainer","Toast","timerAutoHide","setIsDismissed","setIsPaused","timerTimeRemaining","setTimerTimeRemaining","alertStyle","disableAutoDismiss","timerStartTime","now","containerElement","dismissToast","toastId","setAutoHideTimer","handlePause","timeRemaining","handleResume","calculateAndSetBottomOffsetForToast","updateBottomOffsetForToast","AccordionIconPosition","Thumb","IconContainer","renderLabelText","Toggle","trackStyle","thumbStyle","StyledTextArea","textarea","Textarea","textareaStyle","StyledAmPmToggle","AmPmToggle","InputsContainer","Divider","StyledNumInput","TimePicker","minutesStep","am","localize","dayPeriod","pm","hour","setHour","minute","setMinute","amPm","setAmPm","setTime","hourRef","minuteRef","amPmRef","updateTime","newTime","calculateHour","newHour","substring","toggleAmPm","newAmPm","passedInTime","amPmRegex","RegExp","split","timeHour","timeMinuteAndAmPm","timeMinute","timeAmPm","convertPassedInTime","hourId","minuteId","handleHourChange","handleMinuteChange","newMinute","calculateMinute","handleHourKeyDown","handleMinuteKeyDown","handleAmPmKeyDown","useTimePicker","hoursLabel","minutesLabel","amPmLabel","ScheduleIcon","maxLength","getStyles","AccordionContext","isMulti","registerAccordionButton","useAccordion","defaultIndex","onExpandedChange","expandedIndex","setExpandedIndex","contextValue","StyledAccordion","Accordion","AccordionItemContext","isDisabled","isExpanded","setIsExpanded","useAccordionItem","idPrefix","buttonId","panelId","newIsExpanded","AccordionItem","useAccordionButton","focusFirst","focusLast","handleKeyDown","arrLength","DrawerPosition","TextWrapper","AccordionButton","caret","StyledPanel","AccordionPanel","GridDisplay","GridJustifyItems","GridJustifyContent","GridAlignItems","GridAlignContent","GridItemJustifySelf","GridItemAlignSelf","GridAutoFlow","transitionPreset","Drawer","drawerStyle","Grid","gridDisplay","grid","gridTemplateRows","gridTemplateColumns","gridTemplateAreas","gridGap","gridJustifyItems","gridJustifyContent","gridAlignItems","gridAlignContent","gridAutoFlow","GridItem","gridColumn","gridRow","gridArea","gridItemJustifySelf","gridItemAlignSelf","BlockQuoteStyles","borderStyle","StyledBlockQuote","figure","BlockQuote","blockQuoteStyles","hasAttribution","StyledBlockQuoteItem","BlockQuoteItem","InternalSelect","targetAnchor","targetHeading","queryInput","query","supportMatchMedia","matchMedia","matches","match","setMatch","queryList","updateMatch"],"mappings":"isCAWO,ICwPDA,EAAY,CAChBC,OAAQ,CACNC,SAAU,OACVC,cAAe,QACfC,WAAY,QAEdC,OAAQ,CACNH,SAAU,OACVC,cAAe,QACfC,WAAY,QAEdE,OAAQ,CACNJ,SAAU,OACVE,WAAY,QAEdG,OAAQ,CACNL,SAAU,OACVE,WAAY,QAEdI,OAAQ,CACNN,SAAU,OACVE,WAAY,QAEdK,OAAQ,CACNP,SAAU,OACVE,WAAY,QAEdM,OAAQ,CACNR,SAAU,OACVE,WAAY,QAEdO,OAAQ,CACNT,SAAU,OACVE,WAAY,QAEdQ,OAAQ,CACNV,SAAU,OACVE,WAAY,QAEdS,OAAQ,CACNX,SAAU,OACVE,WAAY,QAEdU,OAAQ,CACNZ,SAAU,OACVE,WAAY,QAEdW,OAAQ,CACNb,SAAU,OACVE,WAAY,QAEdY,OAAQ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ACc,oBAAX3wB,aAAuD,IAAtBA,OAAO4wB,WAE3CA,EAAaD,EAAoB3wB,OAAO4wB,WAAa,OAEjCpkD,EAAMqJ,UAAS,mBACnC86C,GACKC,EAAWF,GAAOG,WAFtBC,OAAOC,cAQdvkD,EAAMuJ,WAAU,eACVsuB,GAAS,KAERssB,OAICK,EAAYJ,EAAWF,GAEvBO,EAAc,WACd5sB,GACF0sB,EAASC,EAAUH,iBAIvBI,IACAD,EAAU/wB,iBAAiB,SAAUgxB,GAE9B,WACL5sB,GAAS,EACT2sB,EAAU9wB,oBAAoB,SAAU+wB,OAEzC,CAACP,EAAOE,EAAYD,IAEhBG"}
|
|
1
|
+
{"version":3,"file":"react-magma-dom.cjs.production.min.js","sources":["../src/theme/components/transition.ts","../src/theme/magma.ts","../src/theme/ThemeContext.ts","../src/components/StyledButton/styles.ts","../src/utils/index.ts","../src/i18n/default.ts","../src/i18n/index.ts","../src/components/Spinner/index.tsx","../src/components/StyledButton/index.tsx","../src/inverse/index.ts","../src/components/Button/index.tsx","../src/components/IconButton/index.tsx","../src/components/AlertBase/index.tsx","../src/components/ProgressRing/index.tsx","../src/components/Announce/index.tsx","../src/components/Alert/index.tsx","../src/components/AppBar/AppBar.tsx","../src/components/Badge/index.tsx","../src/components/Banner/index.tsx","../src/components/HideAtBreakpoint/index.tsx","../src/components/Breadcrumb/Breadcrumb.tsx","../src/components/Hyperlink/index.tsx","../src/components/Breadcrumb/BreadcrumbItem.tsx","../src/components/BreakpointsContainer/index.tsx","../src/components/Card/Card.tsx","../src/components/Typography/index.tsx","../src/components/Card/CardBody.tsx","../src/components/Heading/index.tsx","../src/components/Card/CardHeading.tsx","../src/components/SelectionControls/InputStyles.tsx","../src/utils/UtilityStyles.tsx","../src/components/InputBase/index.tsx","../src/components/Label/index.tsx","../src/components/Input/InputMessage.tsx","../src/components/Checkbox/index.tsx","../src/components/FormGroup/index.tsx","../src/components/SelectionControls/StyledLabel.tsx","../src/components/SelectionControls/StyledContainer.tsx","../src/components/Container/Container.tsx","../src/hooks/useControlled.ts","../src/hooks/useDataPagination.ts","../src/components/IndeterminateCheckbox/index.tsx","../src/components/VisuallyHidden/index.tsx","../src/components/Table/Table.tsx","../src/components/Table/TableBody.tsx","../src/components/Table/TableCell.tsx","../src/components/Table/TableHeaderCell.tsx","../src/components/Table/TableHead.tsx","../src/components/Pagination/usePagination.ts","../src/hooks/useDescendants.ts","../src/components/Dropdown/Dropdown.tsx","../src/components/Dropdown/DropdownButton.tsx","../src/components/Dropdown/DropdownContent.tsx","../src/components/Dropdown/DropdownDivider.tsx","../src/components/Dropdown/DropdownHeader.tsx","../src/components/Dropdown/DropdownMenuItem.tsx","../src/components/Tooltip/index.tsx","../src/components/Dropdown/DropdownSplitButton.tsx","../src/components/Table/TablePagination.tsx","../src/components/Table/TableRow.tsx","../src/components/Datagrid/components.tsx","../src/components/Datagrid/Datagrid.tsx","../src/components/DatePicker/CalendarContext.ts","../src/components/DatePicker/utils.ts","../src/components/DatePicker/CalendarHeader.tsx","../src/components/DatePicker/CalendarDay.tsx","../src/components/DatePicker/HelperInformation.tsx","../src/hooks/useFocusLock.ts","../src/components/DatePicker/CalendarMonth.tsx","../src/components/FormFieldContainer/FormFieldContainer.tsx","../src/components/Input/index.tsx","../src/components/DatePicker/index.tsx","../src/components/Dropdown/DropdownMenuNavItem.tsx","../src/components/Flex/Flex.tsx","../src/components/List/List.tsx","../src/components/Paragraph/index.tsx","../src/components/Form/index.tsx","../src/components/ProgressBar/index.tsx","../src/components/List/ListItem.tsx","../src/components/LoadingIndicator/index.tsx","../src/components/Select/shared.ts","../src/components/Select/components.tsx","../src/components/Select/SelectTriggerButton.tsx","../src/components/Tabs/shared.ts","../src/components/NativeSelect/NativeSelect.tsx","../src/components/Tabs/TabsContainer.tsx","../src/components/Tabs/TabsScrollButtons.tsx","../src/components/Tabs/utils.ts","../src/components/Tabs/Tabs.tsx","../src/hooks/useForceUpdate.ts","../src/components/Tabs/Tab.tsx","../src/components/Tabs/TabPanel.tsx","../src/components/Tabs/TabPanelsContainer.tsx","../src/components/NavTabs/NavTabs.tsx","../src/components/NavTabs/NavTab.tsx","../src/components/Pagination/PageButton.tsx","../src/components/Pagination/Pagination.tsx","../src/components/Radio/index.tsx","../src/components/PasswordInput/index.tsx","../src/components/RadioGroup/index.tsx","../src/components/Modal/Modal.tsx","../src/components/Transition/Transition.tsx","../src/components/Search/index.tsx","../src/components/Select/ItemsList.tsx","../src/components/Select/index.tsx","../src/components/Select/SelectContainer.tsx","../src/components/Select/Select.tsx","../src/components/Select/MultiSelect.tsx","../src/components/Combobox/ComboboxInput.tsx","../src/components/Combobox/shared.ts","../src/components/Combobox/Combobox.tsx","../src/components/Combobox/MultiCombobox.tsx","../src/components/Spacer/Spacer.tsx","../src/components/Combobox/index.tsx","../src/components/SkipLink/index.tsx","../src/components/Tag/Tag.tsx","../src/components/Toggle/index.tsx","../src/components/Toast/ToastsContainer.tsx","../src/components/Toast/index.tsx","../src/components/Accordion/useAccordion.ts","../src/components/Textarea/index.tsx","../src/components/TimePicker/AmPmToggle.tsx","../src/components/TimePicker/TimePicker.tsx","../src/components/TimePicker/useTimePicker.ts","../src/theme/GlobalStyles/index.tsx","../src/components/Accordion/Accordion.tsx","../src/components/Accordion/useAccordionItem.ts","../src/components/Accordion/AccordionItem.tsx","../src/components/Accordion/useAccordionButton.ts","../src/components/Drawer/Drawer.tsx","../src/components/Accordion/AccordionButton.tsx","../src/components/Accordion/AccordionPanel.tsx","../src/components/Grid/Grid.tsx","../src/components/BlockQuote/BlockQuote.tsx","../src/components/BlockQuote/BlockQuoteItem.tsx","../src/components/Dropdown/DropdownMenuGroup.tsx","../src/components/SkipLinkContent/index.tsx","../src/hooks/useMediaQuery.ts"],"sourcesContent":["import * as React from 'react';\nimport { Variant } from 'framer-motion';\nexport type MotionVariants<T extends string> = Record<T, Variant>;\n\nexport interface ThemeTransitions {\n [key: string]: {\n motion: MotionVariants<'enter' | 'exit'>;\n baseStyle: React.CSSProperties;\n };\n}\n\nexport const transitions: ThemeTransitions = {\n fade: {\n motion: {\n exit: {\n opacity: 0,\n transition: {\n opacity: {\n duration: 0.1,\n ease: 'easeOut',\n },\n },\n },\n enter: {\n opacity: 1,\n transition: {\n duration: 0.2,\n ease: 'easeIn',\n },\n },\n },\n baseStyle: {},\n },\n slideTop: {\n motion: {\n exit: {\n y: '-100%',\n transition: {\n y: {\n duration: 0.15,\n ease: 'easeInOut',\n },\n },\n },\n enter: {\n y: '0',\n transition: {\n y: {\n type: 'spring',\n damping: 25,\n stiffness: 180,\n },\n },\n },\n },\n baseStyle: {\n position: 'fixed',\n top: 0,\n right: 0,\n left: 0,\n },\n },\n slideBottom: {\n motion: {\n exit: {\n y: '100%',\n transition: {\n y: {\n duration: 0.15,\n ease: 'easeInOut',\n },\n },\n },\n enter: {\n y: '0',\n transition: {\n y: {\n type: 'spring',\n damping: 25,\n stiffness: 180,\n },\n },\n },\n },\n baseStyle: {\n position: 'fixed',\n bottom: 0,\n right: 0,\n left: 0,\n },\n },\n slideRight: {\n motion: {\n exit: {\n x: '100%',\n transition: {\n x: {\n duration: 0.15,\n ease: 'easeInOut',\n },\n },\n },\n enter: {\n x: '0',\n transition: {\n x: {\n type: 'spring',\n damping: 25,\n stiffness: 180,\n },\n },\n },\n },\n baseStyle: {\n position: 'fixed',\n top: 0,\n right: 0,\n bottom: 0,\n },\n },\n slideLeft: {\n motion: {\n exit: {\n x: '-100%',\n transition: {\n x: {\n duration: 0.15,\n ease: 'easeInOut',\n },\n },\n },\n enter: {\n x: '0',\n transition: {\n x: {\n type: 'spring',\n damping: 25,\n stiffness: 180,\n },\n },\n },\n },\n baseStyle: {\n position: 'fixed',\n top: 0,\n bottom: 0,\n left: 0,\n },\n },\n nudgeTop: {\n motion: {\n exit: {\n y: '-50px',\n transition: {\n y: {\n duration: 0.15,\n ease: 'easeInOut',\n },\n },\n },\n enter: {\n y: '0',\n transition: {\n y: {\n type: 'spring',\n damping: 25,\n stiffness: 180,\n },\n },\n },\n },\n baseStyle: {},\n },\n nudgeBottom: {\n motion: {\n exit: {\n y: '50px',\n transition: {\n y: {\n duration: 0.15,\n ease: 'easeInOut',\n },\n },\n },\n enter: {\n y: '0',\n transition: {\n y: {\n type: 'spring',\n damping: 25,\n stiffness: 180,\n },\n },\n },\n },\n baseStyle: {},\n },\n nudgeRight: {\n motion: {\n exit: {\n x: '50px',\n transition: {\n x: {\n duration: 0.15,\n ease: 'easeInOut',\n },\n },\n },\n enter: {\n x: '0',\n transition: {\n x: {\n type: 'spring',\n damping: 25,\n stiffness: 180,\n },\n },\n },\n },\n baseStyle: {},\n },\n nudgeLeft: {\n motion: {\n exit: {\n x: '-50px',\n transition: {\n x: {\n duration: 0.15,\n ease: 'easeInOut',\n },\n },\n },\n enter: {\n x: '0',\n transition: {\n x: {\n type: 'spring',\n damping: 25,\n stiffness: 180,\n },\n },\n },\n },\n baseStyle: {},\n },\n scale: {\n motion: {\n exit: {\n scale: 0.95,\n transition: {\n scale: {\n duration: 0.1,\n ease: 'easeOut',\n },\n },\n },\n enter: {\n scale: 1,\n transition: {\n scale: {\n duration: 0.25,\n ease: 'easeInOut',\n },\n },\n },\n },\n baseStyle: {},\n },\n rotate45: {\n motion: {\n exit: {\n rotate: 0,\n transition: {\n rotate: {\n type: 'tween',\n stiffness: 50,\n duration: 0.15,\n },\n },\n },\n enter: {\n rotate: -45,\n transition: {\n rotate: {\n type: 'tween',\n stiffness: 50,\n duration: 0.15,\n },\n },\n },\n },\n baseStyle: {},\n },\n rotate90: {\n motion: {\n exit: {\n rotate: 0,\n transition: {\n rotate: {\n type: 'tween',\n stiffness: 50,\n duration: 0.15,\n },\n },\n },\n enter: {\n rotate: -90,\n transition: {\n rotate: {\n type: 'tween',\n stiffness: 50,\n duration: 0.15,\n },\n },\n },\n },\n baseStyle: {},\n },\n rotate180: {\n motion: {\n exit: {\n rotate: 0,\n transition: {\n rotate: {\n type: 'tween',\n stiffness: 50,\n duration: 0.15,\n },\n },\n },\n enter: {\n rotate: -180,\n transition: {\n rotate: {\n type: 'tween',\n stiffness: 50,\n duration: 0.15,\n },\n },\n },\n },\n baseStyle: {},\n },\n collapse: {\n motion: {\n exit: {\n height: 0,\n opacity: 0,\n transition: {\n height: { duration: 0.2, ease: 'easeInOut', delay: 0.1 },\n opacity: { property: 1, duration: 0.1, delay: 0 },\n },\n },\n enter: {\n height: 'auto',\n opacity: 1,\n transition: {\n height: { duration: 0.3, ease: 'easeInOut', delay: 0 },\n opacity: { property: 0, duration: 0.1, delay: 0.2 }\n },\n },\n },\n baseStyle: {\n overflow: 'visible',\n },\n },\n};\n","import { ThemeTransitions, transitions } from './components/transition';\n\nexport interface Colors {\n primary: string;\n primaryInverse: string;\n focus: string;\n focusInverse: string;\n foundation: string;\n foundation02: string;\n foundation03: string;\n foundation04: string;\n pop: string;\n pop02: string;\n pop03: string;\n pop04: string;\n pop05: string;\n pop06: string;\n success: string;\n success02: string;\n successInverse: string;\n danger: string;\n dangerInverse: string;\n neutral: string;\n neutral02: string;\n neutral03: string;\n neutral04: string;\n neutral05: string;\n neutral06: string;\n neutral07: string;\n neutral08: string;\n disabledText: string;\n disabledInverseText: string;\n toggleBoxShadow: string;\n shade: string;\n shade02: string;\n tint: string;\n tint02: string;\n tint03: string;\n tint04: string;\n tone: string;\n tone02: string;\n border: string;\n borderInverse: string;\n}\n\nexport interface Breakpoints {\n xs: number;\n small: number;\n medium: number;\n large: number;\n xl: number;\n}\n\nexport interface IconSizes {\n xSmall: number;\n small: number;\n medium: number;\n large: number;\n xLarge: number;\n}\n\nexport interface SpacingScale {\n spacing01: string;\n spacing02: string;\n spacing03: string;\n spacing04: string;\n spacing05: string;\n spacing06: string;\n spacing07: string;\n spacing08: string;\n spacing09: string;\n spacing10: string;\n spacing11: string;\n spacing12: string;\n spacing13: string;\n spacing14: string;\n}\n\nexport interface TypographyExpressiveSizes {\n headingXLarge: any;\n headingLarge: any;\n headingMedium: any;\n headingSmall: any;\n headingXSmall: any;\n headingXXSmall: any;\n bodyLarge: any;\n bodyMedium: any;\n bodySmall: any;\n bodyXSmall: any;\n}\n\nexport interface TypeScaleSize {\n fontSize: string;\n letterSpacing?: string;\n lineHeight: string;\n}\n\nexport interface TypeScale {\n size01: TypeScaleSize;\n size02: TypeScaleSize;\n size03: TypeScaleSize;\n size04: TypeScaleSize;\n size05: TypeScaleSize;\n size06: TypeScaleSize;\n size07: TypeScaleSize;\n size08: TypeScaleSize;\n size09: TypeScaleSize;\n size10: TypeScaleSize;\n size11: TypeScaleSize;\n size12: TypeScaleSize;\n size13: TypeScaleSize;\n}\n\nexport interface VisualStyle {\n mobile: TypeScaleSize;\n desktop: TypeScaleSize;\n fontWeight?: number;\n}\n\nexport interface TypographyVisualStyles {\n headingXLarge: VisualStyle;\n headingLarge: VisualStyle;\n headingMedium: VisualStyle;\n headingSmall: VisualStyle;\n headingXSmall: VisualStyle;\n heading2XSmall: VisualStyle;\n bodyLarge: VisualStyle;\n bodyMedium: VisualStyle;\n bodySmall: VisualStyle;\n bodyXSmall: VisualStyle;\n}\n\ninterface AppBar {\n backgroundColor: string;\n height: string;\n padding: string;\n textColor: string;\n compact: {\n height: string;\n padding: string;\n };\n inverse: {\n backgroundColor: string;\n textColor: string;\n };\n}\nexport interface Modal {\n width: {\n small: string;\n medium: string;\n large: string;\n };\n}\n\ninterface Drawer {\n default: {\n maxWidth: string;\n minHeight: string;\n borderRadius: string;\n margin: string;\n top: string;\n bottom: string;\n left: string;\n right: string;\n position: string;\n };\n right: {\n left: string;\n height: string;\n width: string;\n };\n left: {\n right: string;\n height: string;\n width: string;\n };\n top: {\n bottom: string;\n height: string;\n };\n bottom: {\n top: string;\n height: string;\n };\n}\n\ninterface Combobox {\n menu: {\n maxHeight: string;\n };\n}\n\ninterface Dropdown {\n content: {\n maxHeight: string;\n };\n}\n\ninterface Dropdown {\n content: {\n maxHeight: string;\n };\n}\n\ninterface Select {\n menu: {\n maxHeight: string;\n };\n}\n\ninterface Tabs {\n approxTabSize: {\n horizontal: number;\n vertical: number;\n };\n}\n\nexport interface Tooltip {\n arrowSize: string;\n arrowSizeDoubled: string;\n backgroundColor: string;\n fontWeight: number | string;\n maxWidth: string;\n textColor: string;\n typeScale: TypeScaleSize;\n zIndex: number;\n inverse: any;\n}\n\nexport interface ThemeInterface {\n appBar: AppBar;\n breakpoints: Breakpoints;\n bodyFont: string;\n bodyExpressiveFont: string;\n bodyNarrativeFont: string;\n borderRadius: string;\n colors: Colors;\n combobox: Combobox;\n direction: string;\n drawer: Drawer;\n dropdown: Dropdown;\n headingFont: string;\n iconSizes: IconSizes;\n iterableColors: string[];\n spacingMultiplier: number;\n spaceScale: SpacingScale;\n headingExpressiveFont: string;\n headingNarrativeFont: string;\n select: Select;\n typeScale: TypeScale;\n typographyVisualStyles: TypographyVisualStyles;\n typographyExpressiveVisualStyles: TypographyVisualStyles;\n typographyNarrativeVisualStyles: TypographyVisualStyles;\n modal: Modal;\n tabs: Tabs;\n tooltip: Tooltip;\n transitions: ThemeTransitions;\n}\n\nconst typeScale = {\n size01: {\n fontSize: '12px',\n letterSpacing: '.32px',\n lineHeight: '16px',\n },\n size02: {\n fontSize: '14px',\n letterSpacing: '.16px',\n lineHeight: '20px',\n },\n size03: {\n fontSize: '16px',\n lineHeight: '24px',\n },\n size04: {\n fontSize: '18px',\n lineHeight: '24px',\n },\n size05: {\n fontSize: '20px',\n lineHeight: '32px',\n },\n size06: {\n fontSize: '24px',\n lineHeight: '32px',\n },\n size07: {\n fontSize: '28px',\n lineHeight: '40px',\n },\n size08: {\n fontSize: '32px',\n lineHeight: '40px',\n },\n size09: {\n fontSize: '36px',\n lineHeight: '48px',\n },\n size10: {\n fontSize: '42px',\n lineHeight: '48px',\n },\n size11: {\n fontSize: '48px',\n lineHeight: '56px',\n },\n size12: {\n fontSize: '54px',\n lineHeight: '64px',\n },\n size13: {\n fontSize: '60px',\n lineHeight: '72px',\n },\n};\n\nconst colors = {\n primary: '#006298', // link color blue\n primaryInverse: '#70CDFF', // link color inverse blue\n focus: '#027EE1',\n focusInverse: 'rgba(255,255,255,0.7)',\n foundation: '#00263E',\n foundation02: '#003865',\n foundation03: '#00A9E0',\n foundation04: '#71C5E8',\n pop: '#E0004D',\n pop02: '#FC4C02',\n pop03: '#F2A900',\n pop04: '#FFC72C',\n pop05: '#92278F',\n pop06: '#007A6D',\n success: '#3A8200',\n success02: '#48A200',\n successInverse: '#91CF60',\n danger: '#C61D23',\n dangerInverse: '#F59295',\n neutral: '#3F3F3F', // main dark grey text color\n neutral02: '#575757',\n neutral03: '#707070',\n neutral04: '#8f8f8f', // lightest gray that meets 3:1 contrast ratio\n neutral05: '#BFBFBF',\n neutral06: '#DFDFDF',\n neutral07: '#F7F7F7',\n neutral08: '#FFFFFF', // white\n disabledText: 'rgba(114,114,114,0.6)',\n disabledInverseText: 'rgba(255,255,255,0.25)',\n toggleBoxShadow:\n '0 2px 2px -1px rgba(0, 0, 0, 0.3), 0 0 4px 0 rgba(0, 0, 0, 0.24),0 0 5px 0 rgba(0, 0, 0, 0.22)',\n shade: 'rgba(0,0,0,0.05)',\n shade02: 'rgba(0,0,0,0.3)',\n tint: 'rgba(255,255,255,0.05)',\n tint02: 'rgba(255,255,255,0.1)',\n tint03: 'rgba(255,255,255,0.1)',\n tint04: 'rgba(255,255,255,0.4)',\n tone: 'rgba(63,63,63,0.07)',\n tone02: 'rgba(63,63,63,0.1)',\n border: '#DFDFDF',\n borderInverse: 'rgba(255,255,255,0.25)',\n};\n\nconst spaceScale = {\n spacing01: '2px',\n spacing02: '4px',\n spacing03: '8px',\n spacing04: '12px',\n spacing05: '16px',\n spacing06: '24px',\n spacing07: '28px',\n spacing08: '32px',\n spacing09: '40px',\n spacing10: '48px',\n spacing11: '56px',\n spacing12: '64px',\n spacing13: '96px',\n spacing14: '160px',\n};\n\nexport const magma = {\n bodyFont: '\"Open Sans\",Helvetica,sans-serif',\n bodyExpressiveFont: '\"Open Sans\",Helvetica,sans-serif',\n bodyNarrativeFont: \"'Noto Serif',Times New Roman,serif\",\n borderRadius: '4px',\n colors: colors,\n headingFont: '\"Open Sans\",Helvetica,sans-serif',\n headingExpressiveFont: '\"Open Sans\",Helvetica,sans-serif',\n headingNarrativeFont: \"'Noto Serif',Times New Roman,serif\",\n direction: 'ltr',\n spacingMultiplier: 8,\n transitions,\n // breakpoints\n breakpoints: {\n xs: 0,\n small: 600,\n medium: 768,\n large: 1024,\n xl: 1200,\n },\n\n spaceScale: spaceScale,\n\n iconSizes: {\n xSmall: 16,\n small: 20,\n medium: 24,\n large: 32,\n xLarge: 54,\n },\n\n // Typography\n typeScale: typeScale,\n typographyVisualStyles: {\n headingXLarge: {\n mobile: typeScale.size07,\n desktop: typeScale.size09,\n fontWeight: 600,\n },\n headingLarge: {\n mobile: typeScale.size06,\n desktop: typeScale.size07,\n fontWeight: 600,\n },\n headingMedium: {\n mobile: typeScale.size05,\n desktop: typeScale.size06,\n fontWeight: 600,\n },\n headingSmall: {\n mobile: typeScale.size04,\n desktop: typeScale.size05,\n fontWeight: 600,\n },\n headingXSmall: {\n mobile: typeScale.size04,\n desktop: typeScale.size04,\n fontWeight: 600,\n },\n heading2XSmall: {\n mobile: typeScale.size01,\n desktop: typeScale.size01,\n fontWeight: 700,\n },\n bodyLarge: {\n mobile: typeScale.size04,\n desktop: typeScale.size05,\n },\n bodyMedium: {\n mobile: typeScale.size03,\n desktop: typeScale.size03,\n },\n bodySmall: {\n mobile: typeScale.size02,\n desktop: typeScale.size02,\n },\n bodyXSmall: {\n mobile: typeScale.size01,\n desktop: typeScale.size01,\n },\n },\n typographyExpressiveVisualStyles: {\n headingXLarge: {\n mobile: typeScale.size08,\n desktop: typeScale.size11,\n fontWeight: 600,\n },\n headingLarge: {\n mobile: typeScale.size07,\n desktop: typeScale.size09,\n fontWeight: 300,\n },\n headingMedium: {\n mobile: typeScale.size06,\n desktop: typeScale.size07,\n fontWeight: 300,\n },\n headingSmall: {\n mobile: typeScale.size05,\n desktop: typeScale.size06,\n fontWeight: 300,\n },\n headingXSmall: {\n mobile: typeScale.size04,\n desktop: typeScale.size05,\n fontWeight: 300,\n },\n heading2XSmall: {\n mobile: typeScale.size03,\n desktop: typeScale.size03,\n fontWeight: 700,\n },\n bodyLarge: {\n mobile: typeScale.size05,\n desktop: typeScale.size06,\n },\n bodyMedium: {\n mobile: typeScale.size03,\n desktop: typeScale.size03,\n },\n bodySmall: {\n mobile: typeScale.size02,\n desktop: typeScale.size02,\n },\n bodyXSmall: {\n mobile: typeScale.size01,\n desktop: typeScale.size01,\n },\n },\n typographyNarrativeVisualStyles: {\n headingXLarge: {\n mobile: typeScale.size07,\n desktop: typeScale.size08,\n fontWeight: 700,\n },\n headingLarge: {\n mobile: typeScale.size06,\n desktop: typeScale.size07,\n fontWeight: 700,\n },\n headingMedium: {\n mobile: typeScale.size05,\n desktop: typeScale.size06,\n fontWeight: 700,\n },\n headingSmall: {\n mobile: typeScale.size04,\n desktop: typeScale.size05,\n fontWeight: 700,\n },\n headingXSmall: {\n mobile: typeScale.size04,\n desktop: typeScale.size04,\n fontWeight: 700,\n },\n heading2XSmall: {\n mobile: typeScale.size01,\n desktop: typeScale.size01,\n fontWeight: 700,\n },\n bodyLarge: {\n mobile: typeScale.size04,\n desktop: typeScale.size05,\n },\n bodyMedium: {\n mobile: typeScale.size03,\n desktop: typeScale.size03,\n },\n bodySmall: {\n mobile: typeScale.size02,\n desktop: typeScale.size02,\n },\n bodyXSmall: {\n mobile: typeScale.size01,\n desktop: typeScale.size01,\n },\n },\n\n appBar: {\n backgroundColor: colors.neutral08,\n height: '88px',\n padding: `${spaceScale.spacing06} ${spaceScale.spacing05}`,\n textColor: colors.neutral,\n compact: {\n height: '56px',\n padding: `${spaceScale.spacing05} ${spaceScale.spacing05} ${spaceScale.spacing05} ${spaceScale.spacing06}`,\n },\n inverse: {\n backgroundColor: colors.foundation02,\n textColor: colors.neutral08,\n },\n },\n\n combobox: {\n menu: {\n maxHeight: '250px',\n },\n },\n\n modal: {\n width: {\n small: '300px',\n medium: '600px',\n large: '900px',\n },\n },\n\n drawer: {\n default: {\n maxWidth: '100%',\n minHeight: '300px',\n margin: '0',\n borderRadius: '0',\n top: '0',\n right: '0',\n bottom: '0',\n left: '0',\n position: 'relative',\n },\n right: {\n left: 'auto',\n height: '100%',\n width: '300px',\n position: 'fixed',\n },\n left: {\n right: 'auto',\n height: '100%',\n width: '300px',\n },\n top: {\n bottom: 'auto',\n height: '300px',\n },\n bottom: {\n top: 'auto',\n height: '300px',\n position: 'fixed',\n },\n },\n\n dropdown: {\n content: {\n maxHeight: '250px',\n },\n },\n\n iterableColors: [\n '#0085CC',\n '#E0004D',\n '#FA6600',\n '#48A200',\n '#B12FAD',\n '#00A393',\n '#00507A',\n '#8F0033',\n '#B84900',\n '#255200',\n '#711E6E',\n '#005249',\n ],\n\n tabs: {\n approxTabSize: {\n horizontal: 120,\n vertical: 80,\n },\n },\n\n select: {\n menu: {\n maxHeight: '250px',\n },\n },\n\n tag: {\n border: '0',\n display: 'inline-flex',\n alignItems: 'center',\n justifyContent: 'space-around',\n },\n\n tooltip: {\n arrowSize: '4px',\n arrowSizeDoubled: '8px',\n backgroundColor: colors.neutral,\n fontWeight: 600,\n maxWidth: '300px',\n textColor: colors.neutral08,\n typeScale: typeScale.size01,\n zIndex: 999,\n inverse: {\n backgroundColor: colors.neutral08,\n textColor: colors.neutral,\n },\n },\n};\n","import * as React from 'react';\nimport { magma } from './magma';\n\nexport const ThemeContext = React.createContext(\n magma // default value\n);\n","import { darken, lighten, tint } from 'polished';\n\nconst DEFAULT_STYLE_PROPS = {\n color: 'primary',\n shape: 'fill',\n size: 'medium',\n textTransform: 'uppercase',\n variant: 'solid',\n};\n\nexport function buildPropsWithDefaultButtonStyles(props) {\n return { ...DEFAULT_STYLE_PROPS, ...props };\n}\n\nexport function buildButtonBorderRadius(props) {\n switch (props.shape) {\n case 'round':\n return '100%';\n case 'leftCap':\n return `${props.theme.borderRadius} 0 0 ${props.theme.borderRadius}`;\n case 'rightCap':\n return `0 ${props.theme.borderRadius} ${props.theme.borderRadius} 0`;\n default:\n //fill\n return props.theme.borderRadius;\n }\n}\n\nexport function buildButtonFontSize(props) {\n switch (props.size) {\n case 'small':\n return props.theme.typeScale.size01.fontSize;\n case 'large':\n return props.theme.typeScale.size04.fontSize;\n default:\n //medium\n return props.theme.typeScale.size03.fontSize;\n }\n}\n\nexport function buildButtonLineHeight(props) {\n switch (props.size) {\n case 'small':\n return props.theme.typeScale.size01.lineHeight;\n case 'large':\n return props.theme.typeScale.size04.lineHeight;\n default:\n //medium\n return props.theme.typeScale.size03.lineHeight;\n }\n}\n\nexport function buildButtonSize(props) {\n switch (props.size) {\n case 'small':\n return props.theme.spaceScale.spacing07;\n case 'large':\n return props.theme.spaceScale.spacing11;\n default:\n //medium\n return props.theme.spaceScale.spacing09;\n }\n}\n\nexport function buildButtonPadding(props) {\n switch (props.size) {\n case 'small':\n return `${props.theme.spaceScale.spacing02} ${props.theme.spaceScale.spacing03}`;\n case 'large':\n return `${props.theme.spaceScale.spacing04} ${props.theme.spaceScale.spacing06}`;\n default:\n //medium\n return `${props.theme.spaceScale.spacing04} ${props.theme.spaceScale.spacing05}`;\n }\n}\n\nexport function buildButtonBackground(props) {\n props = buildPropsWithDefaultButtonStyles(props);\n\n if (props.variant !== 'solid' && props.color !== 'marketing') {\n return 'rgba(0,0,0,0)';\n }\n if (props.disabled) {\n return props.theme.colors.neutral06;\n }\n if (props.color === 'marketing') {\n return props.theme.colors.pop04;\n }\n if (props.isInverse) {\n return props.theme.colors.neutral08;\n }\n switch (props.color) {\n case 'secondary':\n return props.theme.colors.neutral08;\n case 'success':\n return props.theme.colors.success;\n case 'danger':\n return props.theme.colors.danger;\n default:\n return props.theme.colors.primary;\n }\n}\n\nexport function buildBorderColor(props) {\n props = buildPropsWithDefaultButtonStyles(props);\n\n if (props.disabled && props.isInverse && props.variant === 'outline') {\n return props.theme.colors.disabledInverseText;\n }\n if (props.disabled) {\n return props.theme.colors.neutral06;\n }\n if (props.color === 'marketing') {\n return props.theme.colors.pop04;\n }\n if (props.isInverse) {\n return props.theme.colors.neutral08;\n }\n if (props.color === 'secondary') {\n return props.theme.colors.neutral05;\n }\n if (props.variant === 'solid') {\n switch (props.color) {\n case 'success':\n return props.theme.colors.success;\n case 'danger':\n return props.theme.colors.danger;\n default:\n return props.theme.colors.primary;\n }\n }\n}\n\nexport function buildColor(props) {\n props = buildPropsWithDefaultButtonStyles(props);\n\n if (props.disabled && props.isInverse && props.variant !== 'solid') {\n return props.theme.colors.disabledInverseText;\n }\n if (props.disabled) {\n return props.theme.colors.disabledText;\n }\n if (props.color === 'marketing') {\n return props.theme.colors.foundation02;\n }\n if (\n (!props.isInverse && props.variant === 'solid') ||\n (props.isInverse && props.variant !== 'solid')\n ) {\n if (props.color === 'secondary' && !props.isInverse) {\n return props.theme.colors.neutral;\n }\n return props.theme.colors.neutral08;\n }\n switch (props.color) {\n case 'secondary':\n return props.theme.colors.neutral;\n case 'success':\n return props.theme.colors.success;\n case 'danger':\n return props.theme.colors.danger;\n default:\n return props.theme.colors.primary;\n }\n}\n\nexport function buildFocusBackground(props) {\n props = buildPropsWithDefaultButtonStyles(props);\n\n if (props.color === 'marketing') {\n return lighten(0.1, props.theme.colors.pop04);\n }\n if (\n (props.variant !== 'solid' && !props.isInverse) ||\n (props.variant === 'solid' && props.isInverse)\n ) {\n switch (props.color) {\n case 'secondary':\n return tint(0.9, props.theme.colors.neutral);\n case 'success':\n return tint(0.9, props.theme.colors.success);\n case 'danger':\n return tint(0.9, props.theme.colors.danger);\n default:\n return tint(0.9, props.theme.colors.primary);\n }\n }\n if (props.variant !== 'solid' && props.isInverse) {\n return 'rgba(0, 0, 0, 0.3)';\n }\n switch (props.color) {\n case 'secondary':\n return darken(0.1, props.theme.colors.neutral08);\n case 'success':\n return darken(0.1, props.theme.colors.success);\n case 'danger':\n return darken(0.1, props.theme.colors.danger);\n default:\n return darken(0.1, props.theme.colors.primary);\n }\n}\n\nexport function buildFocusColor(props) {\n props = buildPropsWithDefaultButtonStyles(props);\n if (props.color === 'marketing') {\n return props.theme.colors.foundation02;\n }\n if (\n (props.variant !== 'solid' && !props.isInverse) ||\n (props.variant === 'solid' && props.isInverse)\n ) {\n switch (props.color) {\n case 'secondary':\n return props.theme.colors.neutral;\n case 'success':\n return darken(0.1, props.theme.colors.success);\n case 'danger':\n return darken(0.1, props.theme.colors.danger);\n default:\n return darken(0.1, props.theme.colors.primary);\n }\n }\n if (props.variant !== 'solid' && props.isInverse) {\n return props.theme.colors.neutral08;\n }\n if (props.color === 'secondary' && !props.isInverse) {\n return props.theme.colors.neutral;\n }\n return props.theme.colors.neutral08;\n}\n\nexport function buildAfterBackground(props) {\n props = buildPropsWithDefaultButtonStyles(props);\n\n if (\n (props.variant !== 'solid' && !props.isInverse) ||\n (props.variant === 'solid' && props.isInverse)\n ) {\n switch (props.color) {\n case 'secondary':\n return props.theme.colors.neutral;\n case 'success':\n return props.theme.colors.success;\n case 'danger':\n return props.theme.colors.danger;\n default:\n return props.theme.colors.primary;\n }\n }\n if (\n props.variant === 'solid' &&\n !props.isInverse &&\n props.color === 'secondary'\n ) {\n return props.theme.colors.neutral;\n }\n return props.theme.colors.neutral08;\n}\n\nexport function buildActiveBackground(props) {\n props = buildPropsWithDefaultButtonStyles(props);\n\n if (props.color === 'marketing') {\n return lighten(0.2, props.theme.colors.pop04);\n }\n if (\n (props.variant !== 'solid' && !props.isInverse) ||\n (props.variant === 'solid' && props.isInverse)\n ) {\n switch (props.color) {\n case 'secondary':\n return tint(0.7, props.theme.colors.neutral);\n case 'success':\n return tint(0.7, props.theme.colors.success);\n case 'danger':\n return tint(0.7, props.theme.colors.danger);\n default:\n return tint(0.7, props.theme.colors.primary);\n }\n }\n if (props.variant !== 'solid' && props.isInverse) {\n return 'rgba(0, 0, 0, 0.5);';\n }\n switch (props.color) {\n case 'secondary':\n return darken(0.2, props.theme.colors.neutral08);\n case 'success':\n return darken(0.2, props.theme.colors.success);\n case 'danger':\n return darken(0.2, props.theme.colors.danger);\n default:\n return darken(0.2, props.theme.colors.primary);\n }\n}\n\nexport function buildActiveColor(props) {\n props = buildPropsWithDefaultButtonStyles(props);\n\n if (props.color === 'marketing') {\n return props.theme.colors.foundation02;\n }\n if (\n (props.variant !== 'solid' && !props.isInverse) ||\n (props.variant === 'solid' && props.isInverse)\n ) {\n switch (props.color) {\n case 'secondary':\n return props.theme.colors.neutral;\n case 'success':\n return darken(0.2, props.theme.colors.success);\n case 'danger':\n return darken(0.2, props.theme.colors.danger);\n default:\n return darken(0.2, props.theme.colors.primary);\n }\n }\n if (props.variant !== 'solid' && props.isInverse) {\n return props.theme.colors.neutral08;\n }\n if (props.color === 'secondary' && !props.isInverse) {\n return props.theme.colors.neutral;\n }\n return props.theme.colors.neutral08;\n}\n","import React from 'react';\nimport { v4 as uuidv4 } from 'uuid';\n\nexport function generateId(id?: string) {\n return id ? id : uuidv4();\n}\n\nexport function useGenerateId(newId?: string) {\n const [id, updateId] = React.useState<string>(newId);\n\n React.useEffect(() => {\n updateId(generateId(newId));\n }, []);\n\n React.useEffect(() => {\n newId && updateId(generateId(newId));\n }, [newId]);\n\n return id;\n}\n\nexport function omit(props, obj) {\n return props.reduce(\n (newObj, val) => (({ [val]: dropped, ...rest }) => rest)(newObj),\n obj\n );\n}\n\nexport type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;\n\ntype Without<T, U> = { [P in Exclude<keyof T, keyof U>]?: never };\n\nexport type XOR<T, U> = T | U extends object\n ? (Without<T, U> & U) | (Without<U, T> & T)\n : T | U;\n\nexport function usePrevious(value) {\n const ref = React.useRef();\n React.useEffect(() => {\n ref.current = value;\n });\n return ref.current;\n}\n\nexport function debounce(func, wait) {\n let timeout;\n function debounced(...args) {\n // tslint:disable-next-line\n const context = this;\n if (timeout) clearTimeout(timeout);\n timeout = setTimeout(() => {\n timeout = null;\n func.apply(context, args);\n }, wait);\n }\n\n debounced.clear = () => {\n clearTimeout(timeout);\n };\n\n return debounced;\n}\n\n// Based on https://stackoverflow.com/a/24394376\nlet cachedType;\n\nexport function detectScrollType() {\n if (cachedType) {\n return cachedType;\n }\n\n const dummy = document.createElement('div');\n dummy.appendChild(document.createTextNode('ABCD'));\n dummy.dir = 'rtl';\n dummy.style.fontSize = '14px';\n dummy.style.width = '4px';\n dummy.style.height = '1px';\n dummy.style.position = 'absolute';\n dummy.style.top = '-1000px';\n dummy.style.overflow = 'scroll';\n\n document.body.appendChild(dummy);\n\n cachedType = 'reverse';\n\n if (dummy.scrollLeft > 0) {\n cachedType = 'default';\n } else {\n dummy.scrollLeft = 1;\n if (dummy.scrollLeft === 0) {\n cachedType = 'negative';\n }\n }\n}\n\nexport function getNormalizedScrollLeft(element, direction) {\n const scrollLeft = element.scrollLeft;\n\n // Perform the calculations only when direction is rtl to avoid messing up the ltr bahavior\n if (direction !== 'rtl') {\n return scrollLeft;\n }\n\n const type = detectScrollType();\n\n switch (type) {\n case 'negative':\n return (\n Number(element.scrollWidth) -\n Number(element.clientWidth) +\n Number(scrollLeft)\n );\n case 'reverse':\n return (\n Number(element.scrollWidth) -\n Number(element.clientWidth) -\n Number(scrollLeft)\n );\n default:\n return scrollLeft;\n }\n}\n\nfunction easeInOutSin(time) {\n return (1 + Math.sin(Math.PI * time - Math.PI / 2)) / 2;\n}\n\nexport function animate(property, element, to, options: any = {}) {\n const { ease = easeInOutSin, duration = 300 } = options;\n\n let start = null;\n const from = Number(element[property]);\n let cancelled = false;\n\n const cancel = () => {\n cancelled = true;\n };\n\n const step = timestamp => {\n if (cancelled) {\n return;\n }\n\n if (start === null) {\n start = timestamp;\n }\n const time = Math.min(1, (timestamp - start) / duration);\n\n element[property] = ease(time) * (to - from) + from;\n\n if (time >= 1) {\n requestAnimationFrame(() => {});\n return;\n }\n\n requestAnimationFrame(step);\n };\n\n if (from === to) {\n return cancel;\n }\n\n requestAnimationFrame(step);\n return cancel;\n}\n\nexport function assignRef(ref, value) {\n if (ref === null) return;\n if (typeof ref === 'function') {\n ref(value);\n } else {\n try {\n ref.current = value;\n } catch (error) {\n throw new Error(`Cannot assign value \"${value}\" to ref \"${ref}\"`);\n }\n }\n}\n\nexport function useForkedRef(...refs) {\n return React.useMemo(() => {\n if (refs.every(ref => ref === null)) {\n return null;\n }\n return (node: any) => {\n refs.forEach(ref => {\n assignRef(ref, node);\n });\n };\n }, [...refs]);\n}\n\nexport function stringIncludesUnit(x) {\n return x.includes('px') || x.includes('em') || x.includes('%');\n}\n\nexport function convertStyleValueToString(\n value: string | number,\n defaultValue?: string\n): string {\n return value\n ? typeof value === 'number' ||\n (typeof value === 'string' && !stringIncludesUnit(value))\n ? `${value}px`\n : value\n : defaultValue || 'initial';\n}\n\nexport function getNodeText(node) {\n if (['string', 'number'].includes(typeof node)) return node;\n if (node instanceof Array) return node.map(getNodeText).join('');\n if (typeof node === 'object' && node) return getNodeText(node.props.children);\n}\n\nconst candidateSelectors = [\n 'input',\n 'select',\n 'textarea',\n 'a[href]',\n 'button',\n '[tabindex]:not([tabindex=\"-1\"])',\n 'audio[controls]',\n 'video[controls]',\n '[contenteditable]:not([contenteditable=\"false\"])',\n].join(',');\n\nexport function getTrapElements(container): Array<HTMLElement> {\n return Array.from(container.current.querySelectorAll(candidateSelectors));\n}\n\nexport function toCamelCase(str) {\n return str\n .toLowerCase()\n .replace(/[^a-z 0-9]/gi, '')\n .replace(/(?:^\\w|[A-Z]|\\b\\w)/g, (ltr, index) =>\n index === 0 ? ltr.toLowerCase() : ltr.toUpperCase()\n )\n .replace(/\\s+/g, '');\n}\n","import { I18nInterface } from './interface';\n\nexport const defaultI18n: I18nInterface = {\n locale: null,\n dateFormat: 'MM/dd/yyyy',\n timeFormat: '12',\n example:\n 'i18n defaults must be set in packages/react-magma-dom/src/i18n/default.ts',\n months: {\n long: {\n january: 'January',\n february: 'February',\n march: 'March',\n april: 'April',\n may: 'May',\n june: 'June',\n july: 'July',\n august: 'August',\n september: 'September',\n october: 'October',\n november: 'November',\n december: 'December',\n },\n short: {\n january: 'Jan',\n february: 'Feb',\n march: 'Mar',\n april: 'Apr',\n may: 'May',\n june: 'Jun',\n july: 'Jul',\n august: 'Aug',\n september: 'Sep',\n october: 'Oct',\n november: 'Nov',\n december: 'Dec',\n },\n },\n days: {\n long: {\n monday: 'Monday',\n tuesday: 'Tuesday',\n wednesday: 'Wednesday',\n thursday: 'Thursday',\n friday: 'Friday',\n saturday: 'Saturday',\n sunday: 'Sunday',\n },\n short: {\n monday: 'Mon',\n tuesday: 'Tues',\n wednesday: 'Wed',\n thursday: 'Thur',\n friday: 'Fri',\n saturday: 'Sat',\n sunday: 'Sun',\n },\n min: {\n monday: 'M',\n tuesday: 'T',\n wednesday: 'W',\n thursday: 'T',\n friday: 'F',\n saturday: 'S',\n sunday: 'S',\n },\n },\n emptyItemsListText: 'No Options',\n alert: {\n dismissAriaLabel: 'Close this message',\n },\n breadcrumb: {\n navAriaLabel: 'Breadcrumb',\n },\n charts: {\n line: {\n chartTabLabel: 'Chart',\n dataLegendsLabel:\n 'Select one or more of the categories below to filter out the ones you don’t want to see.',\n dataTabLabel: 'Data',\n keyboardInstructions:\n 'In the chart below, use your up and down arrows to move between each line. Use your left and right arrows to move between points on a line.',\n keyboardInstructionsHeader: 'Keyboard Instructions',\n keyboardInstructionsTooltip: 'Keyboard Instructions',\n legendButtonAriaLabel: 'Toggle data for {name}',\n },\n },\n combobox: {\n clearIndicatorAriaLabel:\n 'reset selection for {labelText}. {selectedItem} is selected',\n createLabel: 'Create \"{inputValue}\"',\n },\n datePicker: {\n startOfWeek: 'sunday',\n calendarIconAriaLabel: 'Toggle Calendar Widget',\n calendarOpenAnnounce:\n 'Calendar Widget is now open. Press the question mark key to get the keyboard shortcuts for changing dates.',\n calendarCloseAriaLabel: 'Close Calendar Widget',\n previousMonthAriaLabel: 'Previous Month',\n nextMonthAriaLabel: 'Next Month',\n disabledDayAriaLabel: 'Not Available. ',\n selectedDayAriaLabel: '(Selected)',\n todayAriaLabel: '(Today)',\n helpModal: {\n header: 'Keyboard Shortcuts',\n helpButtonAriaLabel: 'Calendar Widget Help',\n enter: {\n ariaLabel: 'Enter key',\n explanation: 'Select the date in focus.',\n },\n rightAndLeftArrowKeys: {\n ariaLabel: 'Right and left arrow keys',\n explanation: 'Move backward (left) and forward (right) by one day.',\n },\n upAndDownArrowKeys: {\n ariaLabel: 'up and down arrow keys',\n explanation: 'Move backward (up) and forward (down) by one week.',\n },\n pageUpAndPageDownKeys: {\n ariaLabel: 'page up and page down keys',\n displayValue: 'PGUP/PGDN',\n explanation: 'Switch months.',\n },\n homeAndEndKeys: {\n ariaLabel: 'Home and end keys',\n displayValue: 'HOME/END',\n explanation: 'Go to the first or last day of a week.',\n },\n escape: {\n ariaLabel: 'Escape key',\n displayValue: 'ESC',\n explanation: 'Return to the date input field.',\n },\n questionMark: {\n ariaLabel: 'Question Mark',\n explanation: 'Open this panel.',\n },\n },\n },\n dropdown: {\n menuItemSelectedAriaLabel: '(selected)',\n toggleMenuAriaLabel: 'Toggle menu',\n },\n dropzone: {\n browseFiles: 'Browse Files',\n dragMessage: 'Drag and drop or browse files to upload.',\n errors: {\n 'too-many-errors': {\n message: 'Files must not have any errors.',\n },\n 'too-many-files': {\n message: 'You must upload a maximum of',\n },\n 'too-few-files': {\n message: 'You must upload a minimum of',\n },\n 'file-invalid-type': {\n header: 'Invalid File Type',\n message: 'Upload only the allowed file types',\n },\n 'file-too-large': {\n header: 'File exceeds size limit',\n message: 'Upload only files with a maximum size of',\n },\n 'file-too-small': {\n header: 'File size is below the limit',\n message: 'Upload only files with a minimum size of',\n },\n required: {\n message: 'You must upload at least one file.',\n },\n },\n files: 'files',\n bytes: 'Bytes',\n deleteFile: 'Delete file',\n removeFile: 'Remove file',\n },\n header: {\n navigationButtonLabel: 'Open navigation menu',\n search: {\n input: {\n ariaLabel: 'Search',\n placeholder: 'Search',\n },\n iconAriaLabel: 'Search',\n },\n },\n indeterminateCheckbox: {\n isCheckedAnnounce: 'All subitems are checked for {labelText} checkbox',\n isIndeterminateAnnounce:\n 'Some, but not all, subitems are checked for {labelText} checkbox',\n isUncheckedAnnounce: 'No subitems are checked for {labelText} checkbox',\n },\n input: {\n isClearableAriaLabel: 'Clear Input',\n },\n loadingIndicator: {\n progressBar: {\n messages: {\n first: 'Please be patient as this could take up to a minute to load.',\n second: 'Thank you for your patience. Still loading...',\n third: 'Thank you for waiting. We’re almost there!',\n },\n },\n spinner: {\n messages: {\n first: 'Loading...',\n second: 'Thank you for your patience. Still loading...',\n third: 'Sorry for the delay. This is taking longer than expected.',\n },\n },\n },\n modal: {\n closeAriaLabel: 'Close dialog',\n },\n multiSelect: {\n placeholder: 'Select...',\n selectedItemButtonAriaLabel: 'reset item {selectedItem}',\n },\n multiCombobox: {\n selectedItemButtonAriaLabel: 'reset item {selectedItem}',\n },\n pagination: {\n nextButtonLabel: 'Next Page',\n previousButtonLabel: 'Previous Page',\n pageButtonLabel: 'Go to Page',\n },\n password: {\n shown: {\n ariaLabel:\n 'Show password. Note: this will visually expose your password on the screen',\n buttonText: 'Show',\n announce: 'Password is now visible',\n },\n hidden: {\n ariaLabel: 'Hide password',\n buttonText: 'Hide',\n announce: 'Password is now hidden',\n },\n },\n search: {\n input: {\n ariaLabel: 'Search',\n placeholder: 'Search',\n },\n iconAriaLabel: 'Search',\n },\n select: {\n placeholder: 'Select...',\n clearIndicatorAriaLabel:\n 'reset selection for {labelText}. {selectedItem} is selected',\n },\n skipLink: {\n buttonText: 'Skip Navigation',\n },\n spinner: {\n ariaLabel: 'Loading',\n },\n table: {\n pagination: {\n ofLabel: 'of',\n nextAriaLabel: 'Next page',\n previousAriaLabel: 'Previous page',\n rowsPerPageLabel: 'Rows per page',\n },\n },\n tabs: {\n horizontalTabsInstructions:\n 'use the right and left arrow keys to activate other tabs',\n verticalTabsInstructions:\n 'use the down and up arrow keys to activate other tabs',\n nextButtonLabel: 'Scroll tabs forward',\n previousButtonLabel: 'Scroll tabs back',\n },\n tag: {\n deleteAriaLabel: 'Delete {labelText} tag',\n },\n timePicker: {\n hoursAriaLabel: 'Hour',\n minutesAriaLabel: 'Minute',\n amButtonAriaLabel:\n 'AM selected. To change to PM press the p or enter button.',\n pmButtonAriaLabel:\n 'PM selected. To change to AM press the a or enter button.',\n amSelectedAnnounce: 'AM is now selected',\n pmSelectedAnnounce: 'PM is now selected',\n },\n wizard: {\n actions: {\n next: 'next',\n previous: 'previous',\n cancel: 'cancel',\n submit: 'submit',\n },\n optional: 'optional',\n navigationLabel: 'Navigation for the wizard',\n },\n};\n","import * as React from 'react';\nimport { defaultI18n } from './default';\nimport { I18nInterface } from './interface';\n\nexport const I18nContext = React.createContext<I18nInterface>(defaultI18n);\n","import * as React from 'react';\nimport styled from '../../theme/styled';\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport { I18nContext } from '../../i18n';\nimport { stringIncludesUnit } from '../../utils';\nimport { ThemeInterface } from '../../theme/magma';\n\nexport interface SpinnerProps extends React.HTMLAttributes<HTMLSpanElement> {\n /**\n * The color of the spinner border\n * @default \"#006298\"\n */\n color?: string;\n /**\n * The height and width of the spinner. Can be a string or number; if number is provided, the size is in px.\n * @default 16\n */\n size?: string | number;\n /**\n * @internal\n */\n theme?: ThemeInterface;\n testId?: string;\n}\n\nconst StyledSpinner = styled.span<SpinnerProps>`\n animation: spinner-border 0.75s linear infinite;\n border: 2px solid ${props => props.color};\n border-right-color: transparent;\n border-radius: 50%;\n display: inline-block;\n height: ${props => props.size};\n width: ${props => props.size};\n\n @keyframes spinner-border {\n to {\n transform: rotate(360deg);\n }\n }\n`;\n\nexport const Spinner = React.forwardRef<HTMLSpanElement, SpinnerProps>(\n (props, ref) => {\n const { 'aria-label': ariaLabel, color, size, testId, ...other } = props;\n\n const theme = React.useContext(ThemeContext);\n const i18n = React.useContext(I18nContext);\n\n const sizeString = size\n ? typeof size === 'number' ||\n (typeof size === 'string' && !stringIncludesUnit(size))\n ? `${size}px`\n : size\n : theme.spaceScale.spacing05;\n\n return (\n <StyledSpinner\n {...other}\n aria-label={ariaLabel ? ariaLabel : i18n.spinner.ariaLabel}\n color={color ? color : theme.colors.primary}\n data-testid={testId}\n ref={ref}\n role=\"img\"\n size={sizeString}\n />\n );\n }\n);\n","import * as React from 'react';\nimport { css } from '@emotion/core';\nimport styled from '@emotion/styled';\nimport {\n buildActiveBackground,\n buildActiveColor,\n buildAfterBackground,\n buildButtonBorderRadius,\n buildButtonFontSize,\n buildButtonLineHeight,\n buildButtonSize,\n buildButtonPadding,\n buildBorderColor,\n buildButtonBackground,\n buildColor,\n buildFocusBackground,\n buildFocusColor,\n} from './styles';\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport { ButtonType, ButtonProps, ButtonSize, ButtonVariant } from '../Button';\nimport { Spinner } from '../Spinner';\n\nexport interface StyledButtonProps extends ButtonProps {\n href?: string;\n iconOnly?: boolean;\n}\n\nexport const buttonStyles = props => css`\n align-items: center;\n background: ${buildButtonBackground(props)};\n border: ${props.variant === 'outline' ||\n (props.variant !== 'link' && props.color === 'secondary' && !props.isInverse)\n ? '2px solid'\n : '0'};\n border-color: ${buildBorderColor(props)};\n border-radius: ${buildButtonBorderRadius(props)};\n color: ${buildColor(props)};\n cursor: ${props.disabled ? 'not-allowed' : 'pointer'};\n display: ${props.isFullWidth ? 'flex' : 'inline-flex'};\n flex-shrink: 0;\n font-family: ${props.theme.bodyFont};\n font-size: ${buildButtonFontSize(props)};\n font-weight: 600;\n height: ${buildButtonSize(props)};\n justify-content: center;\n letter-spacing: ${props.size === 'small'\n ? props.theme.typeScale.size01.letterSpacing\n : 'inherit'};\n line-height: ${buildButtonLineHeight(props)};\n margin: ${props.isFullWidth\n ? `${props.theme.spaceScale.spacing02} 0`\n : props.theme.spaceScale.spacing02};\n min-width: ${props.size === 'small' ? '0' : props.theme.spaceScale.spacing13};\n overflow: hidden;\n padding: ${buildButtonPadding(props)};\n position: relative;\n text-align: center;\n text-decoration: none;\n text-transform: ${props.textTransform || 'uppercase'};\n touch-action: manipulation;\n transition: background 0.35s, border-color 0.35s, box-shadow 0.35s,\n color 0.35s;\n vertical-align: middle;\n white-space: nowrap;\n width: ${props.iconOnly\n ? buildButtonSize(props)\n : props.isFullWidth\n ? '100%'\n : 'auto'};\n\n &:not(:disabled) {\n &:focus {\n outline: 2px dotted\n ${props.isInverse\n ? props.theme.colors.focusInverse\n : props.theme.colors.focus};\n outline-offset: 3px;\n }\n\n &:hover,\n &:focus {\n background: ${buildFocusBackground(props)};\n color: ${buildFocusColor(props)};\n }\n\n &:after {\n background: ${buildAfterBackground(props)};\n border-radius: 50%;\n content: '';\n height: ${props.theme.spaceScale.spacing07};\n left: 50%;\n opacity: 0;\n padding: 50%;\n position: absolute;\n top: 50%;\n transform: translate(-50%, -50%) scale(1);\n transition: opacity 1s, transform 0.5s;\n width: ${props.theme.spaceScale.spacing07};\n }\n\n &:active {\n background: ${buildActiveBackground(props)};\n color: ${buildActiveColor(props)};\n &:after {\n opacity: 0.4;\n transform: translate(-50%, -50%) scale(0);\n transition: transform 0s;\n }\n }\n }\n\n svg {\n flex-shrink: 0;\n }\n\n ${props.iconOnly &&\n css`\n display: inline-flex;\n justify-content: center;\n line-height: 1;\n min-width: 0;\n padding: 0;\n `}\n`;\n\nexport const BaseStyledButton = styled.button`\n ${buttonStyles}\n`;\n\nconst SpinnerWrapper = styled.span`\n position: absolute;\n display: flex;\n`;\n\nconst ChildrenWrapper = styled.span<{ isLoading: boolean; testId?: string }>`\n visibility: ${props => (props.isLoading ? 'hidden' : 'visible')};\n display: inline-flex;\n align-items: center;\n`;\n\nexport const StyledButton = React.forwardRef<\n HTMLButtonElement,\n StyledButtonProps\n>((props, ref) => {\n const {\n size,\n variant,\n isInverse,\n children,\n type = ButtonType.button,\n testId,\n isLoading,\n } = props;\n const theme = React.useContext(ThemeContext);\n\n const spinnerColor =\n isInverse &&\n (variant === ButtonVariant.outline || variant === ButtonVariant.link)\n ? theme.colors.neutral08\n : theme.colors.neutral03;\n\n const spinnerSize =\n size === ButtonSize.small\n ? theme.iconSizes.xSmall\n : size === ButtonSize.large\n ? theme.iconSizes.large\n : theme.iconSizes.medium;\n\n return (\n <BaseStyledButton\n {...props}\n data-testid={testId}\n ref={ref}\n type={type}\n theme={theme}\n disabled={isLoading || props.disabled}\n >\n {isLoading && (\n <SpinnerWrapper>\n <Spinner\n testId={`${testId}-spinner`}\n color={spinnerColor}\n size={spinnerSize}\n />\n </SpinnerWrapper>\n )}\n <ChildrenWrapper isLoading={isLoading} testId={`${testId}-children`}>\n {children}\n </ChildrenWrapper>\n </BaseStyledButton>\n );\n});\n","import * as React from 'react';\n\ninterface InverseInterface {\n isInverse?: boolean;\n}\n\nexport const InverseContext = React.createContext<InverseInterface>({\n isInverse: false,\n});\n\nexport function useIsInverse(inverseProp?: boolean) {\n const inverseContext = React.useContext(InverseContext);\n\n return typeof inverseProp !== 'undefined'\n ? Boolean(inverseProp)\n : inverseContext.isInverse;\n}\n","import * as React from 'react';\nimport { StyledButton } from '../StyledButton';\nimport { useIsInverse } from '../../inverse';\n\nexport enum ButtonVariant {\n solid = 'solid', //default\n outline = 'outline',\n link = 'link',\n}\n\nexport enum ButtonColor {\n primary = 'primary', //default\n secondary = 'secondary',\n success = 'success',\n danger = 'danger',\n marketing = 'marketing',\n}\n\nexport enum ButtonShape {\n fill = 'fill', //default\n leftCap = 'leftCap',\n rightCap = 'rightCap',\n round = 'round', // default for icon only buttons\n}\n\nexport enum ButtonSize {\n large = 'large',\n medium = 'medium', //default\n small = 'small',\n}\n\nexport enum ButtonTextTransform {\n uppercase = 'uppercase', //default\n none = 'none',\n}\n\nexport enum ButtonType {\n button = 'button',\n submit = 'submit',\n reset = 'reset',\n}\n\nexport interface ButtonStyles {\n /**\n * The color of the button, indicating its function in the UI\n * @default ButtonColor.primary\n */\n color?: ButtonColor;\n /**\n * Set the button to display full-width.\n * @default false\n */\n isFullWidth?: boolean;\n isInverse?: boolean;\n /**\n * Defines the border radius\n * @default ButtonShape.fill\n */\n shape?: ButtonShape;\n /**\n * Set the button to a loading state\n * @default false\n */\n isLoading?: boolean;\n /**\n * The relative size of the button\n * @default ButtonSize.medium\n */\n size?: ButtonSize;\n /**\n * Determines whether the button appears in all-caps\n * @default ButtonTextTransform.uppercase\n */\n textTransform?: ButtonTextTransform;\n /**\n * The variant of the button\n * @default ButtonVariant.solid\n */\n variant?: ButtonVariant;\n}\n\n/**\n * @children required\n */\ninterface BaseButtonProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n testId?: string;\n /**\n * @internal\n */\n theme?: any;\n /**\n * The type attribute of the button\n * ButtonType.button\n */\n type?: ButtonType;\n}\n\nexport type ButtonProps = BaseButtonProps & ButtonStyles;\n\nexport const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n (props, ref) => {\n const { children, ...rest } = props;\n\n const isInverse = useIsInverse(props.isInverse);\n\n return (\n <StyledButton {...rest} isInverse={isInverse} ref={ref}>\n {children}\n </StyledButton>\n );\n }\n);\n","import * as React from 'react';\nimport styled from '../../theme/styled';\nimport { StyledButton } from '../StyledButton';\nimport {\n ButtonProps,\n ButtonColor,\n ButtonShape,\n ButtonSize,\n ButtonVariant,\n ButtonTextTransform,\n} from '../Button';\nimport { IconProps } from 'react-magma-icons';\nimport { omit, Omit, XOR } from '../../utils';\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport { useIsInverse } from '../../inverse';\n\nexport enum ButtonIconPosition {\n left = 'left',\n right = 'right',\n}\n\nexport interface IconOnlyButtonProps extends Omit<ButtonProps, 'children'> {\n /**\n * Icon to display within the component\n */\n icon: React.ReactElement<IconProps>;\n /**\n * The text the screen reader will announce. Required for icon-only buttons\n */\n 'aria-label': string;\n}\n\nexport interface IconTextButtonProps extends ButtonProps {\n /**\n * Icon to display within the component\n */\n icon: React.ReactElement<IconProps>;\n children: React.ReactChild | React.ReactChild[];\n /**\n * Position within the button for the icon to appear\n * @default ButtonIconPosition.right\n */\n iconPosition?: ButtonIconPosition;\n}\n\nexport type IconButtonProps = XOR<IconOnlyButtonProps, IconTextButtonProps>;\n\nexport interface SpanProps {\n size?: ButtonSize;\n}\n\nconst SpanTextLeft = styled.span<SpanProps>`\n padding-right: ${props => getIconPadding(props)};\n`;\n\nconst SpanTextRight = styled.span<SpanProps>`\n padding-left: ${props => getIconPadding(props)};\n`;\n\nfunction getIconPadding(props) {\n switch (props.size) {\n case 'large':\n return props.theme.spaceScale.spacing05;\n case 'small':\n return props.theme.spaceScale.spacing02;\n default:\n return props.theme.spaceScale.spacing03;\n }\n}\n\nfunction getIconSize(size, theme) {\n switch (size) {\n case 'large':\n return theme.iconSizes.large;\n case 'small':\n return theme.iconSizes.small;\n default:\n return theme.iconSizes.medium;\n }\n}\n\nexport function instanceOfIconOnly(object: any): object is IconOnlyButtonProps {\n return 'icon' in object && !('children' in object);\n}\n\nexport const IconButton = React.forwardRef<HTMLButtonElement, IconButtonProps>(\n (props, ref) => {\n let icon;\n let iconPosition;\n let children;\n const { color, shape, size, testId, textTransform, variant, ...rest } =\n props;\n\n const theme = React.useContext(ThemeContext);\n\n if (instanceOfIconOnly(props)) {\n icon = props.icon;\n } else {\n icon = props.icon;\n iconPosition = props.iconPosition;\n children = props.children;\n }\n\n const other = omit(['iconPosition', 'textPosition'], rest);\n\n const isInverse = useIsInverse(props.isInverse);\n\n if (icon && !children) {\n return (\n <StyledButton\n {...other}\n ref={ref}\n color={color ? color : ButtonColor.primary}\n iconOnly\n testId={testId}\n isInverse={isInverse}\n shape={shape ? shape : ButtonShape.round}\n size={size ? size : ButtonSize.medium}\n variant={variant ? variant : ButtonVariant.solid}\n >\n {React.Children.only(\n React.cloneElement(icon, {\n size: icon.props.size\n ? icon.props.size\n : getIconSize(size, theme),\n })\n )}\n </StyledButton>\n );\n }\n return (\n <StyledButton\n {...other}\n ref={ref}\n color={color ? color : ButtonColor.primary}\n isInverse={isInverse}\n shape={shape ? shape : ButtonShape.fill}\n size={size ? size : ButtonSize.medium}\n testId={testId}\n textTransform={\n textTransform ? textTransform : ButtonTextTransform.uppercase\n }\n variant={variant ? variant : ButtonVariant.solid}\n >\n {iconPosition === ButtonIconPosition.right && (\n <SpanTextLeft size={size} theme={theme}>\n {children}\n </SpanTextLeft>\n )}\n {React.Children.only(\n React.cloneElement(icon, {\n size: icon.props.size ? icon.props.size : getIconSize(size, theme),\n 'data-testid': `${testId}-icon`,\n })\n )}\n {iconPosition !== ButtonIconPosition.right && (\n <SpanTextRight size={size} theme={theme}>\n {children}\n </SpanTextRight>\n )}\n </StyledButton>\n );\n }\n);\n","import * as React from 'react';\nimport { css } from '@emotion/core';\nimport styled from '../../theme/styled';\nimport isPropValid from '@emotion/is-prop-valid';\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport {\n InfoIcon,\n CheckCircleIcon,\n WarningIcon,\n ErrorIcon,\n IconProps,\n CloseIcon,\n} from 'react-magma-icons';\nimport { ButtonVariant } from '../Button';\nimport { IconButton } from '../IconButton';\nimport { ProgressRing } from '../ProgressRing';\nimport { useGenerateId } from '../../utils';\nimport { I18nContext } from '../../i18n';\nimport { InverseContext, useIsInverse } from '../../inverse';\n\nexport const VARIANT_ICON: {\n [name: string]: React.FunctionComponent<IconProps>;\n} = {\n info: InfoIcon,\n muted: InfoIcon,\n success: CheckCircleIcon,\n warning: WarningIcon,\n danger: ErrorIcon,\n};\n\nexport enum AlertVariant {\n info = 'info', //default,\n muted = 'muted',\n success = 'success',\n warning = 'warning',\n danger = 'danger',\n}\n\nexport interface AlertBaseProps extends React.HTMLAttributes<HTMLDivElement> {\n closeAriaLabel?: string;\n forceDismiss?: () => void;\n hasTimerRing?: boolean;\n isExiting?: boolean;\n isDismissed?: boolean;\n isDismissible?: boolean;\n isInverse?: boolean;\n isPaused?: boolean;\n isToast?: boolean;\n onDismiss?: () => void;\n testId?: string;\n toastDuration?: number;\n variant?: AlertVariant;\n}\n\nexport const transitionDuration = 500;\n\nexport function buildAlertBackground(props) {\n switch (props.variant) {\n case 'muted':\n return 'rgba(0, 0, 0, 0)';\n case 'success':\n return props.theme.colors.success;\n case 'warning':\n return props.theme.colors.pop04;\n case 'danger':\n return props.theme.colors.danger;\n default:\n return props.theme.colors.neutral;\n }\n}\n\nconst StyledAlert = styled.div<AlertBaseProps>`\n align-items: stretch;\n animation: ${props =>\n props.isExiting\n ? `fadeout ${transitionDuration}ms`\n : `fadein ${transitionDuration}ms`};\n \n display: flex;\n flex-direction: column;\n font-size: ${props => props.theme.typeScale.size03.fontSize};\n line-height: ${props => props.theme.typeScale.size03.lineHeight};\n margin-bottom: ${props => props.theme.spaceScale.spacing06};\n max-width: 100%;\n padding: 0;\n position: relative;\n\n @media (max-width: ${props => props.theme.breakpoints.small}px) {\n font-size: ${props => props.theme.typeScale.size02.fontSize};\n letter-spacing: ${props => props.theme.typeScale.size02.letterSpacing};\n line-height: ${props => props.theme.typeScale.size02.lineHeight};\n }\n\n &:focus {\n outline: 2px dotted ${props =>\n props.isInverse\n ? props.theme.colors.focusInverse\n : props.theme.colors.focus};\n }\n }\n\n ${props =>\n props.isToast &&\n css`\n animation: ${props.isExiting\n ? `slideout ${transitionDuration}ms`\n : `slidein ${transitionDuration}ms`};\n min-width: 375px;\n margin: 0 auto;\n\n @media (max-width: ${props.theme.breakpoints.small}px) {\n min-width: 0;\n width: 100%;\n }\n `}\n\n @keyframes fadein {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n }\n\n @keyframes fadeout {\n from {\n opacity: 1;\n }\n to {\n opacity: 0;\n }\n }\n\n \n @keyframes slidein {\n from {\n left: -500px;\n }\n to {\n left: 0;\n }\n }\n\n @keyframes slideout {\n from {\n left: 0;\n }\n to {\n left: -500px;\n }\n }\n\n a {\n color: inherit;\n font-weight: 600;\n text-decoration: underline;\n\n &:focus {\n outline: 2px dotted ${props =>\n props.variant === 'warning'\n ? props.theme.colors.focus\n : props.theme.colors.focusInverse};\n }\n }\n }\n`;\n\nconst StyledAlertInner = styled.div<AlertBaseProps>`\n background-color: ${props => buildAlertBackground(props)};\n border-radius: ${props => props.theme.borderRadius};\n color: ${props =>\n props.variant === AlertVariant.muted\n ? props.theme.colors.neutral03\n : props.isInverse\n ? props.theme.colors.neutral08\n : props.theme.colors.neutral};\n display: flex;\n position: relative;\n padding-right: 12px; \n\n ${props =>\n props.isToast &&\n css`\n border: 1px solid ${props.theme.colors.neutral08};\n box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.4);\n height: ${props.theme.spaceScale.spacing11};\n `}\n`;\n\nconst AlertContents = styled.div`\n align-self: center;\n flex-grow: 1;\n padding: ${props => props.theme.spaceScale.spacing04} 0;\n\n @media (max-width: ${props => props.theme.breakpoints.small}px) {\n padding-left: ${props => props.theme.spaceScale.spacing04};\n }\n`;\n\nconst IconWrapperStyles = css`\n align-items: center;\n display: flex;\n flex-shrink: 0;\n margin-right: 1px;\n`;\n\nconst IconWrapper = styled.span<{ isToast?: boolean; theme: any }>`\n ${IconWrapperStyles}\n padding: 0 ${props => props.theme.spaceScale.spacing03} 0 ${props =>\n props.theme.spaceScale.spacing04};\n\n @media (max-width: ${props => props.theme.breakpoints.small}px) {\n display: none;\n }\n`;\n\nconst ProgressRingWrapper = styled.div`\n opacity: 0.7;\n margin-top: ${props => props.theme.spaceScale.spacing01};\n position: absolute;\n top: ${props => props.theme.spaceScale.spacing02};\n right: ${props => props.theme.spaceScale.spacing02};\n`;\n\nconst DismissibleIconWrapper = styled.span<AlertBaseProps>`\n ${IconWrapperStyles}\n`;\n\nconst whitelistProps = ['icon', 'isInverse', 'theme', 'variant'];\n\nconst shouldForwardProp = prop => {\n return isPropValid(prop) || whitelistProps.includes(prop);\n};\n\nconst DismissButton = styled(IconButton, { shouldForwardProp })<{\n alertVariant?: AlertVariant;\n}>`\n align-self: stretch;\n border-radius: 0 ${props => props.theme.borderRadius}\n ${props => props.theme.borderRadius} 0;\n color: inherit;\n height: auto;\n padding: 0 ${props => props.theme.spaceScale.spacing04};\n width: auto;\n\n &&:focus:not(:disabled) {\n outline: 2px dotted\n ${({ alertVariant, theme }) =>\n alertVariant === 'warning'\n ? theme.colors.focus\n : theme.colors.focusInverse};\n outline-offset: 0 !important;\n }\n\n &:hover,\n &:focus {\n :not(:disabled):before {\n background: ${({ alertVariant, theme }) =>\n alertVariant === 'warning'\n ? theme.colors.focus\n : theme.colors.focusInverse};\n opacity: 0.15;\n }\n\n &:after {\n display: none;\n }\n }\n`;\n\nfunction renderIcon(variant = 'info', isToast?: boolean, theme?: any) {\n const Icon = VARIANT_ICON[variant];\n\n return (\n <IconWrapper isToast={isToast} theme={theme}>\n <Icon size={theme.iconSizes.medium} />\n </IconWrapper>\n );\n}\n\nexport const AlertBase = React.forwardRef<HTMLDivElement, AlertBaseProps>(\n (props, ref) => {\n const {\n children,\n closeAriaLabel,\n forceDismiss,\n hasTimerRing,\n id: defaultId,\n isDismissed,\n isDismissible,\n isExiting: externalIsExiting,\n isPaused,\n isToast,\n onDismiss,\n testId,\n toastDuration,\n variant,\n ...other\n } = props;\n\n const id = useGenerateId(defaultId);\n const [isExiting, setIsExiting] = React.useState(false);\n\n const isInverse = useIsInverse(props.isInverse);\n\n React.useEffect(() => {\n if (isExiting) {\n setTimeout(() => {\n setIsExiting(false);\n onDismiss && typeof onDismiss === 'function' && onDismiss();\n }, transitionDuration - 300);\n }\n }, [isExiting]);\n\n React.useEffect(() => {\n if (isDismissed) {\n handleDismiss();\n }\n }, [isDismissed]);\n\n function handleDismiss() {\n setIsExiting(true);\n }\n\n const theme = React.useContext(ThemeContext);\n const i18n = React.useContext(I18nContext);\n\n return (\n <StyledAlert\n {...other}\n data-testid={testId}\n id={id}\n tabIndex={-1}\n isInverse={isInverse}\n isExiting={isExiting}\n isToast={isToast}\n ref={ref}\n theme={theme}\n >\n <InverseContext.Provider\n value={{\n isInverse: variant !== AlertVariant.warning,\n }}\n >\n <StyledAlertInner\n isInverse={variant !== AlertVariant.warning}\n isToast={isToast}\n theme={theme}\n variant={variant}\n >\n {renderIcon(variant, isToast, theme)}\n <AlertContents theme={theme}>{children}</AlertContents>\n {isDismissible && (\n <DismissibleIconWrapper variant={variant} theme={theme}>\n {hasTimerRing && isToast && (\n <ProgressRingWrapper theme={theme}>\n <ProgressRing\n color={\n variant === AlertVariant.warning\n ? theme.colors.neutral\n : theme.colors.neutral08\n }\n isActive={!isPaused}\n />\n </ProgressRingWrapper>\n )}\n <DismissButton\n alertVariant={variant}\n aria-label={\n closeAriaLabel\n ? closeAriaLabel\n : i18n.alert.dismissAriaLabel\n }\n icon={\n <CloseIcon\n size={\n hasTimerRing\n ? theme.iconSizes.xSmall\n : theme.iconSizes.small\n }\n />\n }\n isInverse\n onClick={forceDismiss || handleDismiss}\n theme={theme}\n variant={ButtonVariant.link}\n />\n </DismissibleIconWrapper>\n )}\n </StyledAlertInner>\n </InverseContext.Provider>\n </StyledAlert>\n );\n }\n);\n","import * as React from 'react';\nimport styled from '../../theme/styled';\nimport { ThemeContext } from '../../theme/ThemeContext';\n\nexport interface ProgressRingProps\n extends React.HTMLAttributes<HTMLDivElement> {\n color?: string;\n duration?: number;\n isActive?: boolean;\n percentage?: number;\n radius?: number;\n strokeWidth?: number;\n testId?: string;\n}\n\nconst Circle = styled.circle`\n transition: stroke-dashoffset 0.35s;\n transform: rotate(-90deg);\n transform-origin: 50% 50%;\n`;\n\nexport const ProgressRing = React.forwardRef<HTMLDivElement, ProgressRingProps>(\n (props, ref) => {\n const {\n color,\n duration = 5000,\n isActive,\n radius = 21,\n strokeWidth = 3,\n testId,\n ...other\n } = props;\n\n const [percentage, setPercentage] = React.useState(100);\n\n React.useEffect(() => {\n const intervalDuration = duration / 50;\n\n let interval = null;\n\n if (isActive) {\n interval = setInterval(() => {\n setPercentage(percentage - 2);\n }, intervalDuration);\n\n if (percentage <= 0) {\n clearInterval(interval);\n }\n } else {\n clearInterval(interval);\n }\n\n return () => clearInterval(interval);\n }, [percentage, isActive]);\n\n const normalizedRadius = radius - strokeWidth * 2;\n const circumference = normalizedRadius * 2 * Math.PI;\n const strokeDashoffset = circumference - (percentage / 100) * circumference;\n\n const theme = React.useContext(ThemeContext);\n\n return (\n <div {...other} ref={ref} data-testid={testId}>\n <svg height={radius * 2} width={radius * 2}>\n <Circle\n cx={radius}\n cy={radius}\n fill=\"transparent\"\n r={normalizedRadius}\n stroke={color ? color : theme.colors.neutral}\n strokeWidth={strokeWidth}\n strokeDasharray={`${circumference} ${circumference}`}\n style={{ strokeDashoffset }}\n />\n </svg>\n </div>\n );\n }\n);\n","import * as React from 'react';\n\n/**\n * @children required\n */\nexport interface AnnounceProps extends React.HTMLAttributes<HTMLDivElement> {\n /**\n * Value of the `aria-live` attribute\n * @default AnnouncePoliteness.polite\n */\n politeness?: AnnouncePoliteness;\n /*\n * Test ID attached to an internal element as `data-testid` for consumer testing\n */\n testId?: string;\n}\n\nexport enum AnnouncePoliteness {\n polite = 'polite', //default\n off = 'off',\n assertive = 'assertive',\n}\n\nexport const Announce = React.forwardRef<HTMLDivElement, AnnounceProps>(\n (props, ref) => {\n const { children, politeness, testId, ...other } = props;\n\n return (\n <div\n {...other}\n aria-live={politeness || AnnouncePoliteness.polite}\n ref={ref}\n data-testid={testId}\n >\n {children}\n </div>\n );\n }\n);\n","import * as React from 'react';\nimport { AlertBase, AlertVariant } from '../AlertBase';\n\n/**\n * @children required\n */\nexport interface AlertProps extends React.HTMLAttributes<HTMLDivElement> {\n /**\n * The text read by screen readers for the close button\n * @default \"Close this message\"\n */\n closeAriaLabel?: string;\n /**\n * If true, the component will be able to be dismissed and will include a close button\n * @default false\n */\n isDismissible?: boolean;\n isInverse?: boolean;\n /**\n * Action that fires when the close button is clicked (required when isDismissible is true)\n */\n onDismiss?: () => void;\n testId?: string;\n /**\n * The variant of the alert, indicating its function in the UI\n * @default `AlertVariant.info`\n */\n variant?: AlertVariant;\n}\n\nexport const Alert = React.forwardRef<HTMLDivElement, AlertProps>(\n (props, ref) => {\n return <AlertBase ref={ref} {...props} />;\n }\n);\n","import * as React from 'react';\nimport styled from '../../theme/styled';\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport { ThemeInterface } from '../../theme/magma';\nimport { InverseContext, useIsInverse } from '../../inverse';\n\n/**\n * @children required\n */\nexport interface AppBarProps extends React.HTMLAttributes<HTMLDivElement> {\n /**\n * If true, the component will render at a shorter height with less padding\n * @default false\n **/\n isCompact?: boolean;\n isInverse?: boolean;\n position?: AppBarPosition;\n testId?: string;\n /**\n * @internal\n */\n theme?: ThemeInterface;\n}\n\nexport enum AppBarPosition {\n absolute = 'absolute',\n fixed = 'fixed',\n relative = 'relative',\n static = 'static', // default\n sticky = 'sticky',\n}\n\nconst StyledHeader = styled.header<{\n isCompact?: boolean;\n isInverse?: boolean;\n position: AppBarPosition;\n}>`\n align-items: center;\n background: ${props =>\n props.isInverse\n ? props.theme.appBar.inverse.backgroundColor\n : props.theme.appBar.backgroundColor};\n border-bottom: 1px solid\n ${props =>\n props.isInverse\n ? props.theme.colors.foundation\n : props.theme.colors.neutral06};\n box-shadow: ${props =>\n props.position === AppBarPosition.sticky ||\n props.position === AppBarPosition.fixed\n ? '0 2px 3px 0 rgb(0 0 0 / 37%)'\n : '0 0 0'};\n color: ${props =>\n props.isInverse\n ? props.theme.appBar.inverse.textColor\n : props.theme.appBar.textColor};\n display: flex;\n height: ${props =>\n props.isCompact\n ? props.theme.appBar.compact.height\n : props.theme.appBar.height};\n left: 0;\n padding: ${props =>\n props.isCompact\n ? props.theme.appBar.compact.padding\n : props.theme.appBar.padding};\n position: ${props => props.position};\n right: 0;\n top: 0;\n z-index: 10;\n`;\n\nexport const AppBar = React.forwardRef<HTMLDivElement, AppBarProps>(\n (props, ref) => {\n const {\n children,\n position = AppBarPosition.static,\n testId,\n ...other\n } = props;\n const theme = React.useContext(ThemeContext);\n const isInverse = useIsInverse(props.isInverse);\n\n return (\n <InverseContext.Provider\n value={{\n isInverse,\n }}\n >\n <StyledHeader\n {...other}\n data-testid={testId}\n position={position}\n ref={ref}\n theme={theme}\n >\n {children}\n </StyledHeader>\n </InverseContext.Provider>\n );\n }\n);\n","import * as React from 'react';\nimport { css } from '@emotion/core';\nimport styled from '../../theme/styled';\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport { darken, lighten } from 'polished';\n\n/**\n * @children required\n */\nexport interface BadgeProps extends React.HTMLAttributes<HTMLButtonElement> {\n /**\n * The color variant of the badge\n * @default BadgeColor.primary\n */\n color?: BadgeColor;\n /**\n * Action that fires when the badge is clicked. Causes the Badge to render as a button instead of a span.\n */\n onClick?: () => void;\n testId?: string;\n /**\n * Indicates the style variant of the component\n * @default BadgeVariant.label\n */\n variant?: BadgeVariant;\n}\n\nexport enum BadgeColor {\n danger = 'danger',\n primary = 'primary',\n secondary = 'secondary', // default\n success = 'success',\n light = 'light',\n}\n\nexport enum BadgeVariant {\n counter = 'counter',\n label = 'label', // default\n}\n\nexport function buildBadgeBackground(props) {\n switch (props.color) {\n case 'danger':\n return props.theme.colors.danger;\n case 'light':\n return props.theme.colors.neutral07;\n case 'primary':\n return props.theme.colors.primary;\n case 'secondary':\n return props.theme.colors.neutral02;\n case 'success':\n return props.theme.colors.success;\n\n default:\n return props.theme.colors.neutral02;\n }\n}\n\nexport function buildBadgeFocusBackground(props) {\n switch (props.color) {\n case 'danger':\n return darken(0.1, props.theme.colors.danger);\n case 'light':\n return lighten(0.05, props.theme.colors.neutral07);\n case 'primary':\n return darken(0.1, props.theme.colors.primary);\n case 'secondary':\n return darken(0.1, props.theme.colors.neutral02);\n case 'success':\n return darken(0.1, props.theme.colors.success);\n\n default:\n return darken(0.1, props.theme.colors.neutral02);\n }\n}\n\nexport function buildBadgeActiveBackground(props) {\n switch (props.color) {\n case 'danger':\n return darken(0.2, props.theme.colors.danger);\n case 'light':\n return lighten(0.1, props.theme.colors.neutral07);\n case 'primary':\n return darken(0.2, props.theme.colors.primary);\n case 'secondary':\n return darken(0.2, props.theme.colors.neutral02);\n case 'success':\n return darken(0.2, props.theme.colors.success);\n\n default:\n return darken(0.2, props.theme.colors.neutral02);\n }\n}\n\nexport const baseBadgeStyles = props => css`\n background: ${buildBadgeBackground(props)};\n border: 1px solid;\n border-color: ${props.color === BadgeColor.light\n ? props.theme.colors.neutral06\n : 'transparent'};\n border-radius: ${props.variant === BadgeVariant.counter\n ? props.theme.spaceScale.spacing06\n : props.theme.borderRadius};\n color: ${props.color === 'light'\n ? props.theme.colors.neutral\n : props.theme.colors.neutral08};\n display: inline-block;\n font-weight: bold;\n font-size: ${props.variant === BadgeVariant.counter\n ? props.theme.typeScale.size02.fontSize\n : props.theme.typeScale.size01.fontSize};\n letter-spacing: ${props.variant === BadgeVariant.counter\n ? props.theme.typeScale.size02.letterSpacing\n : props.theme.typeScale.size01.letterSpacing};\n line-height: ${props.variant === BadgeVariant.counter\n ? props.theme.typeScale.size02.lineHeight\n : props.theme.typeScale.size01.lineHeight};\n margin: ${props.variant === BadgeVariant.counter\n ? `0 0 0 ${props.theme.spaceScale.spacing03}`\n : `0 ${props.theme.spaceScale.spacing03} 0 0`};\n max-height: ${props.variant === BadgeVariant.counter\n ? props.theme.spaceScale.spacing06\n : 'auto'};\n min-width: ${props.theme.spaceScale.spacing06};\n padding: ${props.variant === BadgeVariant.counter\n ? `1px ${props.theme.spaceScale.spacing02}`\n : `${props.theme.spaceScale.spacing01} ${props.theme.spaceScale.spacing02}`};\n text-align: ${props.variant == BadgeVariant.counter ? 'center' : 'inherit'};\n`;\n\nconst StyledSpan = styled.span<BadgeProps>`\n ${baseBadgeStyles};\n`;\n\nconst StyledButton = styled.button<BadgeProps>`\n ${baseBadgeStyles};\n cursor: pointer;\n transition: background 0.35s;\n\n &:hover,\n &:focus {\n background: ${props => buildBadgeFocusBackground(props)};\n }\n\n &:active {\n background: ${props => buildBadgeActiveBackground(props)};\n }\n`;\n\nfunction getStyledBadgeComponent(isClickable: boolean) {\n return isClickable ? StyledButton : StyledSpan;\n}\n\nexport const Badge = React.forwardRef<HTMLSpanElement, BadgeProps>(\n (props, ref) => {\n const { children, onClick, testId, variant, ...other } = props;\n\n const BadgeComponent = getStyledBadgeComponent(Boolean(onClick));\n\n const theme = React.useContext(ThemeContext);\n\n return (\n <BadgeComponent\n {...other}\n data-testid={testId}\n variant={variant ? variant : BadgeVariant.label}\n onClick={onClick}\n ref={ref}\n theme={theme}\n >\n {children}\n </BadgeComponent>\n );\n }\n);\n","import * as React from 'react';\nimport styled from '../../theme/styled';\nimport isPropValid from '@emotion/is-prop-valid';\nimport { AlertProps } from '../Alert';\nimport { AlertVariant, buildAlertBackground, VARIANT_ICON } from '../AlertBase';\nimport { CloseIcon } from 'react-magma-icons';\nimport { Button, ButtonSize, ButtonVariant, ButtonColor } from '../Button';\nimport { IconButton } from '../IconButton';\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport { I18nContext } from '../../i18n';\n\n/**\n * @children required\n */\nexport interface BannerProps extends AlertProps {\n /**\n * The text displayed inside of the action button\n */\n actionButtonText?: string;\n /**\n * Action that fires when the action button is clicked. Must be present for button to appear\n */\n actionButtonOnClick?: () => void;\n /**\n * If true, the component will be able to be dismissed and will include a close button\n * @default false\n */\n isDismissible?: boolean;\n}\n\nconst StyledBanner = styled.div<AlertProps>`\n align-items: stretch;\n background: ${props => buildAlertBackground(props)};\n color: ${props =>\n props.variant === 'warning'\n ? props.theme.colors.neutral\n : props.theme.colors.neutral08};\n display: flex;\n font-size: ${props => props.theme.typeScale.size03.fontSize};\n line-height: ${props => props.theme.typeScale.size03.lineHeight};\n position: relative;\n text-align: left;\n\n @media (max-width: ${props => props.theme.breakpoints.small}px) {\n text-align: left;\n font-size: ${props => props.theme.typeScale.size02.fontSize};\n letter-spacing: ${props => props.theme.typeScale.size02.letterSpacing};\n line-height: ${props => props.theme.typeScale.size02.lineHeight};\n }\n`;\n\nconst BannerContents = styled.div`\n align-items: center;\n display: flex;\n flex-grow: 1;\n justify-content: flex-start;\n padding: ${props => props.theme.spaceScale.spacing04};\n\n @media (max-width: ${props => props.theme.breakpoints.small}px) {\n justify-content: flex-start;\n }\n`;\n\nconst ButtonWrapper = styled.span`\n align-items: center;\n display: flex;\n flex-shrink: 0;\n`;\n\nconst allowedProps = ['icon', 'isInverse', 'theme', 'variant'];\n\nconst shouldForwardProp = prop => {\n return isPropValid(prop) || allowedProps.includes(prop);\n};\n\nconst DismissButton = styled(IconButton, { shouldForwardProp })<{\n alertVariant?: AlertVariant;\n}>`\n align-self: stretch;\n border-radius: 0;\n color: ${({ alertVariant, theme }) =>\n alertVariant === 'warning' ? theme.colors.neutral : theme.colors.neutral08};\n height: auto;\n padding: 0 ${props => props.theme.spaceScale.spacing05};\n width: auto;\n\n &&:focus:not(:disabled) {\n outline: 2px dotted\n ${({ alertVariant, theme }) =>\n alertVariant === 'warning'\n ? theme.colors.neutral\n : theme.colors.neutral08};\n outline-offset: 0 !important;\n }\n\n &:hover,\n &:focus {\n :not(:disabled) {\n &:before {\n background: ${({ alertVariant, theme }) =>\n alertVariant === 'warning'\n ? theme.colors.neutral\n : theme.colors.neutral08};\n opacity: 0.15;\n }\n\n &:after {\n display: none;\n }\n }\n }\n`;\n\nconst IconWrapper = styled.span`\n display: inline-flex;\n padding-right: ${props => props.theme.spaceScale.spacing03};\n\n @media (max-width: ${props => props.theme.breakpoints.small}px) {\n display: none;\n }\n`;\n\nfunction renderIcon(variant = 'info', theme: any) {\n const Icon = VARIANT_ICON[variant];\n\n return (\n <IconWrapper theme={theme}>\n <Icon size={theme.iconSizes.medium} />\n </IconWrapper>\n );\n}\n\nfunction getButtonColor(variant: AlertVariant) {\n switch (variant) {\n case 'success':\n return ButtonColor.success;\n case 'warning':\n return ButtonColor.secondary;\n case 'danger':\n return ButtonColor.danger;\n default:\n return ButtonColor.primary;\n }\n}\n\nexport const Banner = React.forwardRef<HTMLDivElement, BannerProps>(\n (props, ref) => {\n const {\n actionButtonText,\n actionButtonOnClick,\n children,\n closeAriaLabel,\n isDismissible,\n onDismiss,\n testId,\n variant,\n ...other\n } = props;\n\n const theme = React.useContext(ThemeContext);\n const i18n = React.useContext(I18nContext);\n\n return (\n <StyledBanner\n {...other}\n data-testid={testId}\n ref={ref}\n theme={theme}\n variant={variant}\n >\n <BannerContents theme={theme}>\n {renderIcon(variant, theme)}\n {children}\n {actionButtonText && actionButtonOnClick && (\n <Button\n color={getButtonColor(variant)}\n isInverse\n onClick={actionButtonOnClick}\n style={{ margin: `0 0 0 ${theme.spaceScale.spacing08}` }}\n size={ButtonSize.small}\n >\n {actionButtonText}\n </Button>\n )}\n </BannerContents>\n\n {isDismissible && (\n <ButtonWrapper>\n <DismissButton\n alertVariant={variant}\n aria-label={\n closeAriaLabel ? closeAriaLabel : i18n.alert.dismissAriaLabel\n }\n icon={<CloseIcon size={theme.iconSizes.small} />}\n isInverse\n onClick={onDismiss}\n theme={theme}\n variant={ButtonVariant.link}\n />\n </ButtonWrapper>\n )}\n </StyledBanner>\n );\n }\n);\n","import * as React from 'react';\nimport styled from '@emotion/styled';\n\n/**\n * @children required\n */\nexport interface HideAtBreakpointProps\n extends React.HTMLAttributes<HTMLDivElement> {\n displayType?: HideAtBreakpointDisplayType;\n /**\n * Maximum width at which to hide the content\n */\n maxWidth?: number;\n /**\n * Minimum width at which to hide the content\n */\n minWidth?: number;\n testId?: string;\n}\n\nexport enum HideAtBreakpointDisplayType {\n block = 'block', // default\n flex = 'flex',\n inline = 'inline',\n inlineFlex = 'inline-flex',\n}\n\nconst Container = styled.div<HideAtBreakpointProps>`\n display: ${props => props.displayType};\n\n @media (min-width: ${props => props.minWidth}px) {\n display: none;\n }\n\n @media (max-width: ${props => props.maxWidth}px) {\n display: none;\n }\n`;\n\nexport const HideAtBreakpoint = React.forwardRef<\n HTMLDivElement,\n HideAtBreakpointProps\n>((props, ref) => {\n const {\n children,\n displayType = HideAtBreakpointDisplayType.block,\n minWidth,\n maxWidth,\n testId,\n ...other\n } = props;\n\n return (\n <Container\n {...other}\n data-testid={testId}\n displayType={displayType}\n maxWidth={maxWidth}\n minWidth={minWidth}\n ref={ref}\n >\n {children}\n </Container>\n );\n});\n","import * as React from 'react';\nimport styled from '../../theme/styled';\nimport isPropValid from '@emotion/is-prop-valid';\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport { I18nContext } from '../../i18n';\nimport { InverseContext, useIsInverse } from '../../inverse';\n\n/**\n * @children required\n */\nexport interface BreadcrumbProps extends React.HTMLAttributes<HTMLElement> {\n isInverse?: boolean;\n testId?: string;\n}\n\nconst StyledList = styled('ol', {\n shouldForwardProp: isPropValid,\n})<BreadcrumbProps>`\n display: flex;\n flex-wrap: wrap;\n font-size: ${props => props.theme.typeScale.size02.fontSize};\n letter-spacing: ${props => props.theme.typeScale.size02.letterSpacing};\n line-height: ${props => props.theme.typeScale.size02.lineHeight};\n list-style: none;\n margin: 0;\n padding: 0;\n`;\n\nexport const Breadcrumb = React.forwardRef<HTMLOListElement, BreadcrumbProps>(\n (props, ref) => {\n const {\n 'aria-label': ariaLabel,\n children,\n isInverse: isInverseProp,\n testId,\n ...other\n } = props;\n\n const theme = React.useContext(ThemeContext);\n const i18n = React.useContext(I18nContext);\n const isInverse = useIsInverse(isInverseProp);\n\n return (\n <InverseContext.Provider value={{ isInverse }}>\n <nav\n {...other}\n aria-label={ariaLabel ? ariaLabel : i18n.breadcrumb.navAriaLabel}\n data-testid={testId}\n >\n <StyledList isInverse={isInverse} ref={ref} theme={theme}>\n {children}\n </StyledList>\n </nav>\n </InverseContext.Provider>\n );\n }\n);\n","import * as React from 'react';\nimport { ButtonStyles } from '../Button';\nimport styled from '@emotion/styled';\nimport { css, ClassNames } from '@emotion/core';\nimport { omit, Omit } from '../../utils';\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport { BaseStyledButton, buttonStyles } from '../StyledButton';\nimport { ThemeInterface } from '../../theme/magma';\nimport { useIsInverse } from '../../inverse';\n\n/**\n * @children required\n */\nexport interface HyperlinkProps\n extends ButtonStyles,\n Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, 'color'> {\n children: React.ReactNode;\n /**\n * How the hyperlink is styled (can look like either a plain link or a button)\n */\n styledAs?: 'Button' | 'Link';\n testId?: string;\n /**\n * The href value of the link\n */\n to: string;\n}\n\nconst linkStyles = props => css`\n color: ${props.isInverse\n ? props.theme.colors.primaryInverse\n : props.theme.colors.primary};\n text-decoration: underline;\n &:not([disabled]) {\n &:hover,\n &:focus {\n color: ${props.isInverse\n ? props.theme.colors.primaryInverse\n : props.theme.colors.foundation02};\n }\n &:focus {\n outline: 2px dotted\n ${props.isInverse\n ? props.theme.colors.focusInverse\n : props.theme.colors.focus};\n outline-offset: 3px;\n }\n }\n`;\n\nconst StyledLink = styled.a<{ isInverse?: boolean; theme: ThemeInterface }>`\n ${linkStyles}\n`;\n\nexport const Hyperlink = React.forwardRef<HTMLAnchorElement, HyperlinkProps>(\n (props, ref) => {\n const { children, to, styledAs, testId, ...rest } = props;\n\n const other = omit(['positionTop', 'positionLeft', 'type'], rest);\n const theme = React.useContext(ThemeContext);\n const isInverse = useIsInverse(props.isInverse);\n\n if (typeof children === 'function') {\n const composedStyle =\n styledAs === 'Button'\n ? buttonStyles({ ...props, theme })\n : linkStyles({ ...props, theme });\n\n return (\n <ClassNames>\n {({ css: composedCss }) => {\n const className = composedCss(composedStyle);\n return (children as (props: object) => React.ReactNode)({\n to,\n className,\n isInverse,\n });\n }}\n </ClassNames>\n );\n } else {\n const LinkStyledAsButton = BaseStyledButton.withComponent('a');\n const HyperlinkComponent =\n styledAs === 'Button' ? LinkStyledAsButton : StyledLink;\n\n return (\n <HyperlinkComponent\n {...other}\n ref={ref}\n data-testid={testId}\n href={to}\n isInverse={isInverse}\n theme={theme}\n >\n {children}\n </HyperlinkComponent>\n );\n }\n }\n);\n","import * as React from 'react';\nimport styled from '../../theme/styled';\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport { Hyperlink } from '../Hyperlink';\nimport { useIsInverse } from '../../inverse';\nimport { ChevronRightIcon } from 'react-magma-icons';\n\n/**\n * @children required\n */\nexport interface BreadcrumbItemProps\n extends React.HTMLAttributes<HTMLLIElement> {\n testId?: string;\n /**\n * The href value of the link. If left blank, the breadcrumb item will render as a span with aria-current=\"page\" on it.\n */\n to?: string;\n}\n\nconst StyledItem = styled.li`\n list-style: none;\n margin: 0;\n padding: 0;\n display: flex;\n`;\n\nconst StyledSpan = styled.span<{ isInverse?: boolean }>`\n color: ${props =>\n props.isInverse\n ? props.theme.colors.neutral08\n : props.theme.colors.neutral03};\n\n svg {\n margin: 0 ${props => props.theme.spaceScale.spacing02};\n }\n`;\n\nexport const BreadcrumbItem = React.forwardRef<\n HTMLLIElement,\n BreadcrumbItemProps\n>((props, ref) => {\n const { children, to, testId, ...other } = props;\n const theme = React.useContext(ThemeContext);\n const isInverse = useIsInverse();\n\n return (\n <StyledItem {...other} data-testid={testId} ref={ref}>\n {to ? (\n <>\n <Hyperlink to={to} isInverse={isInverse}>\n {children}\n </Hyperlink>\n <StyledSpan isInverse={isInverse} theme={theme}>\n <ChevronRightIcon size={theme.iconSizes.small} />\n </StyledSpan>\n </>\n ) : (\n <StyledSpan aria-current=\"page\" isInverse={isInverse} theme={theme}>\n {children}\n </StyledSpan>\n )}\n </StyledItem>\n );\n});\n","import * as React from 'react';\nimport { HideAtBreakpoint } from '../HideAtBreakpoint';\nimport { ThemeContext } from '../../theme/ThemeContext';\n\nexport enum BreakpointScreenSize {\n xs = 'xs', //default\n small = 'small',\n medium = 'medium',\n large = 'large',\n xl = 'xl',\n}\n\n/**\n * @children required\n */\nexport interface BreakpointsContainerProps\n extends React.HTMLAttributes<HTMLDivElement> {\n /**\n * Object that defines the pixel size of individual breakpoints\n * @default { xs: 0, small: 600, medium: 768, large: 1024, xl: 1200 }\n */\n breakpoints?: object;\n}\n\nexport interface BreakpointProps extends React.HTMLAttributes<HTMLDivElement> {\n /**\n * The relative screen size for the breakpoint. Will go from pixel width specified up to the next breakpoint.\n * @default BreakpointScreenSize.xs\n */\n screenSize?: BreakpointScreenSize;\n testId?: string;\n}\n\nexport const Breakpoint: React.FunctionComponent<BreakpointProps> = ({\n children,\n screenSize,\n testId,\n ...other\n}: BreakpointProps) => {\n return <div {...other}>{children}</div>;\n};\n\nfunction getMinWidth(\n screenSize: BreakpointScreenSize,\n breakpointValues: object,\n definedBreakpoints: any\n) {\n const sizes = Object.keys(breakpointValues);\n\n const newSizes = sizes.slice(sizes.indexOf(screenSize) + 1);\n\n const nextSize = newSizes.find(newSize =>\n definedBreakpoints.includes(newSize)\n );\n\n return breakpointValues[nextSize];\n}\n\nexport const BreakpointsContainer: React.FunctionComponent<BreakpointsContainerProps> = ({\n children,\n breakpoints,\n ...other\n}: BreakpointsContainerProps) => {\n const definedBreakpoints = [];\n\n React.Children.forEach(children, (child: React.ReactElement) => {\n definedBreakpoints.push(child.props.screenSize);\n });\n\n const theme = React.useContext(ThemeContext);\n\n const defaultBreakpoints = theme.breakpoints;\n\n const breakpointValues = breakpoints ? breakpoints : defaultBreakpoints;\n\n return (\n <>\n {React.Children.map(children, (child: React.ReactElement) => {\n return child.props.screenSize ? (\n <HideAtBreakpoint\n {...other}\n maxWidth={breakpointValues[child.props.screenSize] - 1}\n minWidth={getMinWidth(\n child.props.screenSize,\n breakpointValues,\n definedBreakpoints\n )}\n testId={child.props.testId}\n >\n {child}\n </HideAtBreakpoint>\n ) : (\n child\n );\n })}\n </>\n );\n};\n","import * as React from 'react';\nimport { css } from '@emotion/core';\nimport styled from '../../theme/styled';\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport { ThemeInterface } from '../../theme/magma';\nimport { useIsInverse } from '../../inverse';\n\n/**\n * @children required\n */\nexport interface CardProps extends React.LabelHTMLAttributes<HTMLDivElement> {\n /**\n * Sets the alignment of the card content\n * @default CardAlignment.left\n */\n align?: CardAlignment;\n /**\n * Color for the background and border-color, set by CSS.\n */\n background?: string;\n /**\n * If a value is passed, the card will be styled as a callout for the specified type.\n * @default none\n */\n calloutType?: CardCalloutType;\n /**\n * If true, card will render with a box-shadow\n * @default false\n */\n hasDropShadow?: boolean;\n isInverse?: boolean;\n testId?: string;\n /**\n * Width of the component, set by CSS.\n */\n width?: string | number;\n}\n\nexport enum CardAlignment {\n center = 'center',\n left = 'left',\n right = 'right',\n}\n\nexport enum CardCalloutType {\n danger = 'danger',\n primary = 'primary',\n success = 'success',\n warning = 'warning',\n}\n\nexport function buildCalloutBackground(\n props: CardProps & { theme: ThemeInterface }\n) {\n if (props.isInverse) {\n switch (props.calloutType) {\n case 'danger':\n return props.theme.colors.dangerInverse;\n case 'success':\n return props.theme.colors.successInverse;\n case 'warning':\n return props.theme.colors.pop04;\n default:\n return props.theme.colors.foundation04;\n }\n }\n\n switch (props.calloutType) {\n case 'danger':\n return props.theme.colors.danger;\n case 'success':\n return props.theme.colors.success;\n case 'warning':\n return props.theme.colors.pop04;\n default:\n return props.theme.colors.primary;\n }\n}\n\nconst StyledCard = styled.div<CardProps>`\n background: ${props =>\n props.background\n ? props.background\n : props.isInverse\n ? props.theme.colors.foundation\n : props.theme.colors.neutral08};\n border: 1px solid\n ${props =>\n props.background ? props.background : props.theme.colors.neutral06};\n border-radius: ${props => props.theme.borderRadius};\n box-shadow: ${props =>\n props.hasDropShadow ? '0 2px 6px 0 rgba(0,0,0,0.18)' : '0 0 0'};\n color: ${props =>\n props.isInverse\n ? props.theme.colors.neutral08\n : props.theme.colors.neutral};\n display: flex;\n flex-direction: column;\n overflow: visible;\n padding-left: ${props =>\n props.calloutType ? props.theme.spaceScale.spacing02 : '0'};\n position: relative;\n text-align: ${props => props.align};\n width: ${props => props.width};\n\n ${props =>\n props.calloutType &&\n css`\n &:before {\n background: ${buildCalloutBackground(props)};\n border-radius: ${props.theme.borderRadius} 0 0\n ${props.theme.borderRadius};\n content: '';\n display: block;\n height: 100%;\n position: absolute;\n left: 0;\n width: ${props.theme.spaceScale.spacing02};\n }\n `}\n`;\n\ninterface NavTabsContextInterface {\n isInverse?: boolean;\n}\n\nexport const CardContext = React.createContext<NavTabsContextInterface>({\n isInverse: false,\n});\n\nexport const Card = React.forwardRef<HTMLDivElement, CardProps>(\n (props, ref) => {\n const { align, children, testId, width, ...other } = props;\n\n const isInverse = useIsInverse(props.isInverse);\n\n const theme = React.useContext(ThemeContext);\n\n const widthString = width\n ? typeof width === 'number'\n ? `${width}px`\n : width\n : 'auto';\n\n return (\n <StyledCard\n {...other}\n align={align ? align : CardAlignment.left}\n data-testid={testId}\n isInverse={isInverse}\n ref={ref}\n theme={theme}\n width={widthString}\n >\n <CardContext.Provider\n value={{\n isInverse,\n }}\n >\n {children}\n </CardContext.Provider>\n </StyledCard>\n );\n }\n);\n","import * as React from 'react';\nimport styled from '../../theme/styled';\nimport { css } from '@emotion/core';\n\nexport interface TypographyProps<T = HTMLParagraphElement>\n extends React.HTMLAttributes<T> {\n as?: string;\n children?: any;\n color?: TypographyColor;\n contextVariant?: TypographyContextVariant;\n element?: string;\n isInverse?: boolean;\n noMargins?: boolean;\n ref?: any;\n testId?: string;\n theme?: any;\n visualStyle?: TypographyVisualStyle;\n}\n\nexport enum TypographyColor {\n danger = 'danger',\n default = 'default', // default\n success = 'success',\n subdued = 'subdued',\n}\n\nexport enum TypographyContextVariant {\n default = 'default', // default\n expressive = 'expressive',\n narrative = 'narrative',\n}\n\nexport enum TypographyVisualStyle {\n headingXLarge = 'headingXLarge',\n headingLarge = 'headingLarge',\n headingMedium = 'headingMedium',\n headingSmall = 'headingSmall',\n headingXSmall = 'headingXSmall',\n heading2XSmall = 'heading2XSmall',\n bodyLarge = 'bodyLarge',\n bodyMedium = 'bodyMedium',\n bodySmall = 'bodySmall',\n bodyXSmall = 'bodyXSmall',\n}\n\nexport function getBodyFontFamily(props) {\n switch (props.contextVariant) {\n case TypographyContextVariant.expressive:\n return props.theme.bodyExpressiveFont;\n case TypographyContextVariant.narrative:\n return props.theme.bodyNarrativeFont;\n default:\n return props.theme.bodyFont;\n }\n}\n\nexport const colorStyles = props => css`\n color: ${props.isInverse\n ? props.theme.colors.neutral08\n : props.contextVariant === 'expressive'\n ? props.theme.colors.foundation02\n : props.theme.colors.neutral};\n\n ${props.color === TypographyColor.danger &&\n !props.isInverse &&\n css`\n color: ${props.theme.colors.danger};\n `}\n\n ${props.color === TypographyColor.success &&\n !props.isInverse &&\n css`\n color: ${props.theme.colors.success};\n `}\n\n${props.color === TypographyColor.subdued &&\n !props.isInverse &&\n css`\n color: ${props.theme.colors.neutral03};\n `}\n\n ${props.color === TypographyColor.danger &&\n props.isInverse &&\n css`\n color: ${props.theme.colors.dangerInverse};\n `}\n\n ${props.color === TypographyColor.success &&\n props.isInverse &&\n css`\n color: ${props.theme.colors.successInverse};\n `}\n\n${props.color === TypographyColor.subdued &&\n props.isInverse &&\n css`\n color: ${props.theme.colors.focusInverse};\n `}\n`;\n\nconst baseParagraphStyles = props => css`\n ${colorStyles(props)}\n font-family: ${getBodyFontFamily(props)};\n font-weight: normal;\n`;\n\nexport const paragraphLargeStyles = props => css`\n ${baseParagraphStyles(props)}\n\n margin: ${props.noMargins ? '0' : `${props.theme.spaceScale.spacing06} 0`};\n\n font-size: ${props.theme.typographyVisualStyles.bodyLarge.mobile.fontSize};\n line-height: ${props.theme.typographyVisualStyles.bodyLarge.mobile\n .lineHeight};\n\n @media (min-width: ${props.theme.breakpoints.small}px) {\n font-size: ${props.theme.typographyVisualStyles.bodyLarge.desktop.fontSize};\n line-height: ${props.theme.typographyVisualStyles.bodyLarge.desktop\n .lineHeight};\n }\n\n ${props.contextVariant === TypographyContextVariant.expressive &&\n css`\n font-size: ${props.theme.typographyExpressiveVisualStyles.bodyLarge.mobile\n .fontSize};\n line-height: ${props.theme.typographyExpressiveVisualStyles.bodyLarge.mobile\n .lineHeight};\n\n @media (min-width: ${props.theme.breakpoints.small}px) {\n font-size: ${props.theme.typographyExpressiveVisualStyles.bodyLarge\n .desktop.fontSize};\n line-height: ${props.theme.typographyExpressiveVisualStyles.bodyLarge\n .desktop.lineHeight};\n }\n `};\n`;\n\nexport const paragraphMediumStyles = props => css`\n ${baseParagraphStyles(props)}\n\n font-size: ${props.theme.typographyVisualStyles.bodyMedium.mobile.fontSize};\n line-height: ${props.theme.typographyVisualStyles.bodyMedium.mobile\n .lineHeight};\n margin: ${props.noMargins ? '0' : `${props.theme.spaceScale.spacing06} 0`};\n\n @media (min-width: ${props.theme.breakpoints.small}px) {\n font-size: ${props.theme.typographyVisualStyles.bodyMedium.desktop\n .fontSize};\n line-height: ${props.theme.typographyVisualStyles.bodyMedium.desktop\n .lineHeight};\n }\n`;\n\nexport const paragraphSmallStyles = props => css`\n ${baseParagraphStyles(props)}\n\n font-size: ${props.theme.typographyVisualStyles.bodySmall.mobile.fontSize};\n letter-spacing: ${props.theme.typographyVisualStyles.bodySmall.mobile\n .letterSpacing};\n line-height: ${props.theme.typographyVisualStyles.bodySmall.mobile\n .lineHeight};\n margin: ${props.noMargins ? '0' : `${props.theme.spaceScale.spacing05} 0`};\n\n @media (min-width: ${props.theme.breakpoints.small}px) {\n font-size: ${props.theme.typographyVisualStyles.bodySmall.desktop.fontSize};\n letter-spacing: ${props.theme.typographyVisualStyles.bodySmall.desktop\n .letterSpacing};\n line-height: ${props.theme.typographyVisualStyles.bodySmall.desktop\n .lineHeight};\n }\n`;\n\nexport const paragraphXSmallStyles = props => css`\n ${baseParagraphStyles(props)}\n\n font-size: ${props.theme.typographyVisualStyles.bodyXSmall.mobile.fontSize};\n letter-spacing: ${props.theme.typographyVisualStyles.bodyXSmall.mobile\n .letterSpacing};\n line-height: ${props.theme.typographyVisualStyles.bodyXSmall.mobile\n .lineHeight};\n margin: ${props.noMargins ? '0' : `${props.theme.spaceScale.spacing03} 0`};\n\n @media (min-width: ${props.theme.breakpoints.small}px) {\n font-size: ${props.theme.typographyVisualStyles.bodyXSmall.desktop\n .fontSize};\n letter-spacing: ${props.theme.typographyVisualStyles.bodyXSmall.desktop\n .letterSpacing};\n line-height: ${props.theme.typographyVisualStyles.bodyXSmall.desktop\n .lineHeight};\n }\n`;\n\nfunction getHeadingFontFamily(props) {\n switch (props.contextVariant) {\n case TypographyContextVariant.expressive:\n return props.theme.headingExpressiveFont;\n case TypographyContextVariant.narrative:\n return props.theme.headingNarrativeFont;\n default:\n return props.theme.headingFont;\n }\n}\n\nconst baseHeadingStyles = props => css`\n border-bottom: 2px solid transparent;\n font-family: ${getHeadingFontFamily(props)};\n padding: 0;\n\n &:focus {\n border-bottom: 2px dotted\n ${props.isInverse\n ? props.theme.colors.focusInverse\n : props.theme.colors.focus};\n outline: 0;\n transition: border 0.1s linear;\n }\n\n ${colorStyles(props)}\n`;\n\nexport const headingXLargeStyles = props => css`\n ${baseHeadingStyles(props)}\n\n font-size: ${props.theme.typographyVisualStyles.headingXLarge.mobile\n .fontSize};\n font-weight: ${props.theme.typographyVisualStyles.headingXLarge.fontWeight};\n line-height: ${props.theme.typographyVisualStyles.headingXLarge.mobile\n .lineHeight};\n margin: ${props.noMargins ? 0 : `0 0 ${props.theme.spaceScale.spacing05}`};\n\n @media (min-width: ${props.theme.breakpoints.small}px) {\n font-size: ${props.theme.typographyVisualStyles.headingXLarge.desktop\n .fontSize};\n line-height: ${props.theme.typographyVisualStyles.headingXLarge.desktop\n .lineHeight};\n }\n\n ${props.contextVariant === 'expressive' &&\n css`\n font-size: ${props.theme.typographyExpressiveVisualStyles.headingXLarge\n .mobile.fontSize};\n font-weight: ${props.theme.typographyExpressiveVisualStyles.headingXLarge\n .fontWeight};\n line-height: ${props.theme.typographyExpressiveVisualStyles.headingXLarge\n .mobile.lineHeight};\n\n @media (min-width: ${props.theme.breakpoints.small}px) {\n font-size: ${props.theme.typographyExpressiveVisualStyles.headingXLarge\n .desktop.fontSize};\n line-height: ${props.theme.typographyExpressiveVisualStyles.headingXLarge\n .desktop.lineHeight};\n }\n `};\n\n ${props.contextVariant === 'narrative' &&\n css`\n font-size: ${props.theme.typographyNarrativeVisualStyles.headingXLarge\n .mobile.fontSize};\n font-weight: ${props.theme.typographyNarrativeVisualStyles.headingXLarge\n .fontWeight};\n line-height: ${props.theme.typographyNarrativeVisualStyles.headingXLarge\n .mobile.lineHeight};\n @media (min-width: ${props.theme.breakpoints.small}px) {\n font-size: ${props.theme.typographyNarrativeVisualStyles.headingXLarge\n .desktop.fontSize};\n line-height: ${props.theme.typographyNarrativeVisualStyles.headingXLarge\n .desktop.lineHeight};\n }\n `};\n`;\n\nexport const headingLargeStyles = props => css`\n ${baseHeadingStyles(props)}\n\n font-size: ${props.theme.typographyVisualStyles.headingLarge.mobile.fontSize};\n font-weight: ${props.theme.typographyVisualStyles.headingLarge.fontWeight};\n line-height: ${props.theme.typographyVisualStyles.headingLarge.mobile\n .lineHeight};\n margin: ${props.noMargins\n ? 0\n : `${props.theme.spaceScale.spacing10} 0 ${props.theme.spaceScale.spacing05}`};\n\n @media (min-width: ${props.theme.breakpoints.small}px) {\n font-size: ${props.theme.typographyVisualStyles.headingLarge.desktop\n .fontSize};\n line-height: ${props.theme.typographyVisualStyles.headingLarge.desktop\n .lineHeight};\n }\n\n ${props.contextVariant === 'expressive' &&\n css`\n font-size: ${props.theme.typographyExpressiveVisualStyles.headingLarge\n .mobile.fontSize};\n font-weight: ${props.theme.typographyExpressiveVisualStyles.headingLarge\n .fontWeight};\n line-height: ${props.theme.typographyExpressiveVisualStyles.headingLarge\n .mobile.lineHeight};\n\n @media (min-width: ${props.theme.breakpoints.small}px) {\n font-size: ${props.theme.typographyExpressiveVisualStyles.headingLarge\n .desktop.fontSize};\n line-height: ${props.theme.typographyExpressiveVisualStyles.headingLarge\n .desktop.lineHeight};\n }\n `};\n\n ${props.contextVariant === 'narrative' &&\n css`\n font-size: ${props.theme.typographyNarrativeVisualStyles.headingLarge.mobile\n .fontSize};\n font-weight: ${props.theme.typographyNarrativeVisualStyles.headingLarge\n .fontWeight};\n line-height: ${props.theme.typographyNarrativeVisualStyles.headingLarge\n .mobile.lineHeight};\n @media (min-width: ${props.theme.breakpoints.small}px) {\n font-size: ${props.theme.typographyNarrativeVisualStyles.headingLarge\n .desktop.fontSize};\n line-height: ${props.theme.typographyNarrativeVisualStyles.headingLarge\n .desktop.lineHeight};\n }\n `};\n`;\n\nexport const headingMediumStyles = props => css`\n ${baseHeadingStyles(props)};\n\n font-size: ${props.theme.typographyVisualStyles.headingMedium.mobile\n .fontSize};\n font-weight: ${props.theme.typographyVisualStyles.headingMedium.fontWeight};\n line-height: ${props.theme.typographyVisualStyles.headingMedium.mobile\n .lineHeight};\n margin: ${props.noMargins\n ? 0\n : `${props.theme.spaceScale.spacing09} 0 ${props.theme.spaceScale.spacing05}`};\n\n @media (min-width: ${props.theme.breakpoints.small}px) {\n font-size: ${props.theme.typographyVisualStyles.headingMedium.desktop\n .fontSize};\n line-height: ${props.theme.typographyVisualStyles.headingMedium.desktop\n .lineHeight};\n }\n\n ${props.contextVariant === 'expressive' &&\n css`\n font-size: ${props.theme.typographyExpressiveVisualStyles.headingMedium\n .mobile.fontSize};\n font-weight: ${props.theme.typographyExpressiveVisualStyles.headingMedium\n .fontWeight};\n line-height: ${props.theme.typographyExpressiveVisualStyles.headingMedium\n .mobile.lineHeight};\n\n @media (min-width: ${props.theme.breakpoints.small}px) {\n font-size: ${props.theme.typographyExpressiveVisualStyles.headingMedium\n .desktop.fontSize};\n line-height: ${props.theme.typographyExpressiveVisualStyles.headingMedium\n .desktop.lineHeight};\n }\n `};\n\n ${props.contextVariant === 'narrative' &&\n css`\n font-size: ${props.theme.typographyNarrativeVisualStyles.headingMedium\n .mobile.fontSize};\n font-weight: ${props.theme.typographyNarrativeVisualStyles.headingMedium\n .fontWeight};\n line-height: ${props.theme.typographyNarrativeVisualStyles.headingMedium\n .mobile.lineHeight};\n @media (min-width: ${props.theme.breakpoints.small}px) {\n font-size: ${props.theme.typographyNarrativeVisualStyles.headingMedium\n .desktop.fontSize};\n line-height: ${props.theme.typographyNarrativeVisualStyles.headingMedium\n .desktop.lineHeight};\n }\n `};\n`;\n\nexport const headingSmallStyles = props => css`\n ${baseHeadingStyles(props)}\n\n font-size: ${props.theme.typographyVisualStyles.headingSmall.mobile.fontSize};\n font-weight: ${props.theme.typographyVisualStyles.headingSmall.fontWeight};\n line-height: ${props.theme.typographyVisualStyles.headingSmall.mobile\n .lineHeight};\n margin: ${props.noMargins\n ? 0\n : `${props.theme.spaceScale.spacing08} 0 ${props.theme.spaceScale.spacing05}`};\n\n @media (min-width: ${props.theme.breakpoints.small}px) {\n font-size: ${props.theme.typographyVisualStyles.headingSmall.desktop\n .fontSize};\n line-height: ${props.theme.typographyVisualStyles.headingSmall.desktop\n .lineHeight};\n }\n ${props.contextVariant === 'expressive' &&\n css`\n font-size: ${props.theme.typographyExpressiveVisualStyles.headingSmall\n .mobile.fontSize};\n font-weight: ${props.theme.typographyExpressiveVisualStyles.headingSmall\n .fontWeight};\n line-height: ${props.theme.typographyExpressiveVisualStyles.headingSmall\n .mobile.lineHeight};\n\n @media (min-width: ${props.theme.breakpoints.small}px) {\n font-size: ${props.theme.typographyExpressiveVisualStyles.headingSmall\n .desktop.fontSize};\n line-height: ${props.theme.typographyExpressiveVisualStyles.headingSmall\n .desktop.lineHeight};\n }\n `};\n\n ${props.contextVariant === 'narrative' &&\n css`\n font-size: ${props.theme.typographyNarrativeVisualStyles.headingSmall.mobile\n .fontSize};\n font-weight: ${props.theme.typographyNarrativeVisualStyles.headingSmall\n .fontWeight};\n line-height: ${props.theme.typographyNarrativeVisualStyles.headingSmall\n .mobile.lineHeight};\n @media (min-width: ${props.theme.breakpoints.small}px) {\n font-size: ${props.theme.typographyNarrativeVisualStyles.headingSmall\n .desktop.fontSize};\n line-height: ${props.theme.typographyNarrativeVisualStyles.headingSmall\n .desktop.lineHeight};\n }\n `};\n`;\n\nexport const headingXSmallStyles = props => css`\n ${baseHeadingStyles(props)}\n\n font-size: ${props.theme.typographyVisualStyles.headingXSmall.mobile\n .fontSize};\n font-weight: ${props.theme.typographyVisualStyles.headingXSmall.fontWeight};\n line-height: ${props.theme.typographyVisualStyles.headingXSmall.mobile\n .lineHeight};\n margin: ${props.noMargins\n ? 0\n : `${props.theme.spaceScale.spacing06} 0 ${props.theme.spaceScale.spacing05}`};\n\n @media (min-width: ${props.theme.breakpoints.small}px) {\n font-size: ${props.theme.typographyVisualStyles.headingXSmall.desktop\n .fontSize};\n line-height: ${props.theme.typographyVisualStyles.headingXSmall.desktop\n .lineHeight};\n }\n\n ${props.contextVariant === 'expressive' &&\n css`\n font-size: ${props.theme.typographyExpressiveVisualStyles.headingXSmall\n .mobile.fontSize};\n font-weight: ${props.theme.typographyExpressiveVisualStyles.headingXSmall\n .fontWeight};\n line-height: ${props.theme.typographyExpressiveVisualStyles.headingXSmall\n .mobile.lineHeight};\n\n @media (min-width: ${props.theme.breakpoints.small}px) {\n font-size: ${props.theme.typographyExpressiveVisualStyles.headingXSmall\n .desktop.fontSize};\n line-height: ${props.theme.typographyExpressiveVisualStyles.headingXSmall\n .desktop.lineHeight};\n }\n `};\n\n ${props.contextVariant === 'narrative' &&\n css`\n font-size: ${props.theme.typographyNarrativeVisualStyles.headingXSmall\n .mobile.fontSize};\n font-weight: ${props.theme.typographyNarrativeVisualStyles.headingXSmall\n .fontWeight};\n line-height: ${props.theme.typographyNarrativeVisualStyles.headingXSmall\n .mobile.lineHeight};\n @media (min-width: ${props.theme.breakpoints.small}px) {\n font-size: ${props.theme.typographyNarrativeVisualStyles.headingXSmall\n .desktop.fontSize};\n line-height: ${props.theme.typographyNarrativeVisualStyles.headingXSmall\n .desktop.lineHeight};\n }\n `};\n`;\n\nexport const heading2XSmallStyles = props => css`\n ${baseHeadingStyles(props)}\n\n font-size: ${props.theme.typographyVisualStyles.heading2XSmall.mobile\n .fontSize};\n font-weight: ${props.theme.typographyVisualStyles.heading2XSmall.fontWeight};\n letter-spacing: ${props.theme.typographyVisualStyles.heading2XSmall.mobile\n .letterSpacing};\n line-height: ${props.theme.typographyVisualStyles.heading2XSmall.mobile\n .lineHeight};\n text-transform: uppercase;\n margin: ${props.noMargins\n ? 0\n : `${props.theme.spaceScale.spacing06} 0 ${props.theme.spaceScale.spacing03}`};\n\n @media (min-width: ${props.theme.breakpoints.small}px) {\n font-size: ${props.theme.typographyVisualStyles.heading2XSmall.desktop\n .fontSize};\n letter-spacing: ${props.theme.typographyVisualStyles.heading2XSmall.desktop\n .letterSpacing};\n line-height: ${props.theme.typographyVisualStyles.heading2XSmall.desktop\n .lineHeight};\n }\n\n ${props.contextVariant === 'expressive' &&\n css`\n font-size: ${props.theme.typographyExpressiveVisualStyles.heading2XSmall\n .mobile.fontSize};\n font-weight: ${props.theme.typographyExpressiveVisualStyles.heading2XSmall\n .fontWeight};\n letter-spacing: ${props.theme.typographyExpressiveVisualStyles\n .heading2XSmall.mobile.letterSpacing};\n line-height: ${props.theme.typographyExpressiveVisualStyles.heading2XSmall\n .mobile.lineHeight};\n text-transform: none;\n\n @media (min-width: ${props.theme.breakpoints.small}px) {\n font-size: ${props.theme.typographyExpressiveVisualStyles.heading2XSmall\n .desktop.fontSize};\n letter-spacing: ${props.theme.typographyExpressiveVisualStyles\n .heading2XSmall.desktop.letterSpacing};\n line-height: ${props.theme.typographyExpressiveVisualStyles.heading2XSmall\n .desktop.lineHeight};\n }\n `};\n\n ${props.contextVariant === 'narrative' &&\n css`\n font-size: ${props.theme.typographyNarrativeVisualStyles.heading2XSmall\n .mobile.fontSize};\n font-weight: ${props.theme.typographyNarrativeVisualStyles.heading2XSmall\n .fontWeight};\n letter-spacing: ${props.theme.typographyNarrativeVisualStyles.heading2XSmall\n .mobile.letterSpacing};\n line-height: ${props.theme.typographyNarrativeVisualStyles.heading2XSmall\n .mobile.lineHeight};\n @media (min-width: ${props.theme.breakpoints.small}px) {\n font-size: ${props.theme.typographyNarrativeVisualStyles.heading2XSmall\n .desktop.fontSize};\n letter-spacing: ${props.theme.typographyNarrativeVisualStyles\n .heading2XSmall.desktop.letterSpacing};\n line-height: ${props.theme.typographyNarrativeVisualStyles.heading2XSmall\n .desktop.lineHeight};\n }\n `};\n`;\n\nfunction getTypographyStyles(props) {\n switch (props.visualStyle) {\n case TypographyVisualStyle.headingXLarge:\n return headingXLargeStyles(props);\n case TypographyVisualStyle.headingLarge:\n return headingLargeStyles(props);\n case TypographyVisualStyle.headingMedium:\n return headingMediumStyles(props);\n case TypographyVisualStyle.headingSmall:\n return headingSmallStyles(props);\n case TypographyVisualStyle.headingXSmall:\n return headingXSmallStyles(props);\n case TypographyVisualStyle.heading2XSmall:\n return heading2XSmallStyles(props);\n case TypographyVisualStyle.bodyLarge:\n return paragraphLargeStyles(props);\n case TypographyVisualStyle.bodyMedium:\n return paragraphMediumStyles(props);\n case TypographyVisualStyle.bodySmall:\n return paragraphSmallStyles(props);\n case TypographyVisualStyle.bodyXSmall:\n return paragraphXSmallStyles(props);\n default:\n return headingLargeStyles(props);\n }\n}\n\nexport const TypographyComponent = styled.p<TypographyProps>`\n ${props => getTypographyStyles(props)}\n`;\n","import * as React from 'react';\nimport styled from '../../theme/styled';\nimport { CardProps } from '../Card';\nimport { ThemeContext } from '../../theme/ThemeContext';\n\n/**\n * @children required\n */\nexport interface CardBodyProps\n extends React.LabelHTMLAttributes<HTMLDivElement> {\n testId?: string;\n}\n\nconst StyledCardBody = styled.div<CardProps>`\n padding: ${props => props.theme.spaceScale.spacing05};\n text-align: ${props => props.align};\n\n @media (min-width: ${props => props.theme.breakpoints.small}px) {\n padding: ${props => props.theme.spaceScale.spacing06};\n }\n`;\n\nexport const CardBody = React.forwardRef<HTMLDivElement, CardBodyProps>(\n (props, ref) => {\n const { children, testId, ...other } = props;\n const theme = React.useContext(ThemeContext);\n\n return (\n <StyledCardBody {...other} data-testid={testId} ref={ref} theme={theme}>\n {children}\n </StyledCardBody>\n );\n }\n);\n","import * as React from 'react';\nimport { useIsInverse } from '../../inverse';\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport {\n TypographyColor,\n TypographyContextVariant,\n TypographyVisualStyle,\n TypographyComponent,\n TypographyProps,\n} from '../Typography';\n\n/**\n * @children required\n */\nexport interface HeadingProps extends TypographyProps<HTMLHeadingElement> {\n /**\n * The color of the component, that helps to convey meaning or relative emphasis\n * @default TypographyColor.default\n */\n color?: TypographyColor;\n /**\n * Additional styles for typography based on the context of the content\n * @default TypographyColor.default\n */\n contextVariant?: TypographyContextVariant;\n isInverse?: boolean;\n /**\n * Number to indicate which level heading will render (e.g. h1, h2 etc.)\n */\n level: 1 | 2 | 3 | 4 | 5 | 6;\n testId?: string;\n /**\n * Applies visual styles including font-size, font-weight, line-height and margins\n */\n visualStyle?: TypographyVisualStyle;\n}\n\nexport const Heading = React.forwardRef<HTMLHeadingElement, HeadingProps>(\n (props, ref) => {\n const { level, testId, visualStyle, children, ...other } = props;\n const theme = React.useContext(ThemeContext);\n\n const stylesFromLevel = {\n 1: TypographyVisualStyle.headingXLarge,\n 2: TypographyVisualStyle.headingLarge,\n 3: TypographyVisualStyle.headingMedium,\n 4: TypographyVisualStyle.headingSmall,\n 5: TypographyVisualStyle.headingXSmall,\n 6: TypographyVisualStyle.heading2XSmall,\n };\n\n const headingElement = `h${level}`;\n\n return (\n <TypographyComponent\n {...other}\n as={headingElement}\n data-testid={testId}\n isInverse={useIsInverse(props.isInverse)}\n ref={ref}\n visualStyle={visualStyle ? visualStyle : stylesFromLevel[level]}\n theme={theme}\n >\n {children}\n </TypographyComponent>\n );\n }\n);\n","import * as React from 'react';\nimport styled from '../../theme/styled';\nimport { CardContext } from './Card';\nimport { Heading } from '../Heading';\nimport { TypographyColor, TypographyVisualStyle } from '../Typography';\n\n/**\n * @children required\n */\nexport interface CardHeadingProps\n extends React.LabelHTMLAttributes<HTMLHeadingElement> {\n /**\n * Number to indicate which level heading will render (e.g. h1, h2 etc.)\n * @default 4\n */\n headingLevel?: 1 | 2 | 3 | 4 | 5 | 6;\n isInverse?: boolean;\n testId?: string;\n}\n\nconst StyledCardHeading = styled(Heading)`\n margin-top: 0;\n`;\n\nexport const CardHeading = React.forwardRef<\n HTMLHeadingElement,\n CardHeadingProps\n>((props, ref) => {\n const { headingLevel, children, ...other } = props;\n\n const context = React.useContext(CardContext);\n\n return (\n <StyledCardHeading\n {...other}\n color={TypographyColor.default}\n isInverse={context.isInverse}\n level={headingLevel ? headingLevel : 4}\n ref={ref}\n testId={props.testId}\n visualStyle={TypographyVisualStyle.headingSmall}\n >\n {children}\n </StyledCardHeading>\n );\n});\n","import { css } from '@emotion/core';\n\nexport const DisplayInputStyles = props => css`\n align-items: center;\n display: flex;\n height: ${props.theme.spaceScale.spacing06};\n flex-shrink: 0;\n justify-content: center;\n position: relative;\n transition: all 0.2s ease-out;\n width: ${props.theme.spaceScale.spacing06};\n\n &:before,\n &:after {\n // focus and active states\n content: '';\n position: absolute;\n }\n\n &:after {\n // active state\n border-radius: 50%;\n height: ${props.theme.spaceScale.spacing09};\n left: -${props.theme.spaceScale.spacing03};\n opacity: 0;\n padding: 50%;\n top: -${props.theme.spaceScale.spacing03};\n transform: scale(1);\n transition: opacity 1s, transform 0.5s;\n width: ${props.theme.spaceScale.spacing09};\n }\n`;\n\nexport const DisplayInputActiveStyles = css`\n opacity: 0.4;\n transform: scale(0);\n transition: transform 0s;\n`;\n\nexport function buildDisplayInputActiveBackground(props) {\n return props.isInverse\n ? props.theme.colors.neutral08\n : props.color\n ? props.color\n : props.theme.colors.primary;\n}\n\nexport function buildDisplayInputBorderColor(props) {\n if (props.hasError) {\n if (props.isInverse) {\n return props.theme.colors.dangerInverse;\n }\n return props.theme.colors.danger;\n }\n return 'transparent';\n}\n\nexport function buildDisplayInputFocusStyles(props) {\n return css`\n height: 30px;\n position: absolute;\n width: 30px;\n outline: 2px dotted\n ${props.isInverse\n ? props.theme.colors.focusInverse\n : props.theme.colors.focus};\n `;\n}\n","import { css } from '@emotion/core';\n\nexport const HiddenStyles = css`\n clip: rect(1px, 1px, 1px, 1px);\n height: 1px;\n position: absolute;\n overflow: hidden;\n top: auto;\n white-space: nowrap;\n width: 1px;\n`;\n","import * as React from 'react';\nimport styled from '../../theme/styled';\nimport { css } from '@emotion/core';\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport { ButtonVariant, ButtonType, ButtonSize, ButtonShape } from '../Button';\nimport { IconButton } from '../IconButton';\nimport { ClearIcon, IconProps } from 'react-magma-icons';\nimport { useIsInverse } from '../../inverse';\nimport { ThemeInterface } from '../../theme/magma';\nimport { I18nContext } from '../../i18n';\nimport { useForkedRef } from '../../utils';\n\nexport enum InputSize {\n large = 'large',\n medium = 'medium', //default\n}\n\nexport enum InputType {\n email = 'email',\n file = 'file',\n number = 'number',\n password = 'password',\n search = 'search',\n text = 'text', // default\n}\n\nexport enum InputIconPosition {\n top = 'top',\n left = 'left',\n right = 'right', // default\n}\n\nexport interface InputBaseProps\n extends React.InputHTMLAttributes<HTMLInputElement> {\n /**\n * Style properties for the component container element\n */\n containerStyle?: React.CSSProperties;\n /**\n * @internal\n */\n hasError?: boolean;\n /**\n * Icon to display within the component\n */\n icon?: React.ReactElement<IconProps>;\n /**\n * Text for the aria-label attribute for an icon, if provided\n */\n iconAriaLabel?: string;\n /**\n * Position within the component for the icon to appear\n * @default InputIconPosition.right\n */\n iconPosition?: InputIconPosition;\n /**\n * Reference to the icon element\n */\n iconRef?: React.Ref<HTMLButtonElement>;\n /**\n * Relative size of the component\n * @default InputSize.medium\n */\n inputSize?: InputSize;\n /**\n * Style properties for the input element\n */\n inputStyle?: React.CSSProperties;\n /**\n * Clear contents of input by clicking a clear button\n * @default false\n */\n isClearable?: boolean;\n /**\n * Function to be called when the contents of input are cleared by clicking a clear button\n */\n onClear?: () => void;\n isInverse?: boolean;\n /**\n * For use in predictive search which moves the icon to the left\n */\n isPredictive?: boolean;\n /**\n * Action that will fire when icon is clicked\n */\n onIconClick?: () => void;\n /**\n * Action that will fire when icon receives keypress\n */\n onIconKeyDown?: (event) => void;\n testId?: string;\n /**\n * @internal\n */\n theme?: any;\n /**\n * The type attribute of the form field\n * @default InputType.text\n */\n type?: InputType;\n}\n\nexport interface InputWrapperStylesProps {\n width?: string;\n iconPosition?: InputIconPosition;\n isInverse?: boolean;\n isClearable?: boolean;\n isPredictive?: boolean;\n theme?: ThemeInterface;\n hasError?: boolean;\n disabled?: boolean;\n}\n\nexport const inputWrapperStyles = (props: InputWrapperStylesProps) => css`\n align-items: center;\n display: flex;\n flex-shrink: 0;\n position: relative;\n width: ${props.width || 'auto'};\n background-color: ${props.theme.colors.neutral08};\n border-radius: ${props.theme.borderRadius};\n border: 1px solid\n ${props.isInverse\n ? props.theme.colors.neutral08\n : props.theme.colors.neutral03};\n\n &:focus-within {\n outline: 2px dotted\n ${props.isInverse\n ? props.theme.colors.focusInverse\n : props.theme.colors.focus};\n outline-offset: 4px;\n }\n\n ${props.hasError &&\n css`\n border-color: ${props.theme.colors.danger};\n box-shadow: 0 0 0 1px\n ${props.isInverse\n ? props.theme.colors.neutral08\n : props.theme.colors.danger};\n `}\n\n ${props.disabled &&\n css`\n border-color: ${props.theme.colors.neutral05};\n background-color: ${props.disabled\n ? props.theme.colors.neutral07\n : props.theme.colors.neutral08};\n `}\n button {\n bottom: ${props.iconPosition === InputIconPosition.top\n ? '40px'\n : 'inherit'};\n right: ${props.iconPosition === InputIconPosition.top ? '-4px' : 'inherit'};\n }\n`;\n\nexport interface InputBaseStylesProps {\n isInverse?: boolean;\n iconPosition?: InputIconPosition;\n inputSize?: InputSize;\n isPredictive?: boolean;\n theme?: ThemeInterface;\n disabled?: boolean;\n}\n\nexport const inputBaseStyles = (props: InputBaseStylesProps) => css`\n border: 0;\n border-radius: ${props.theme.borderRadius};\n background: ${props.theme.colors.neutral08};\n color: ${props.theme.colors.neutral};\n display: block;\n font-size: ${props.theme.typeScale.size03.fontSize};\n line-height: ${props.theme.typeScale.size03.lineHeight};\n font-family: ${props.theme.bodyFont};\n height: ${props.theme.spaceScale.spacing09};\n padding: ${props.theme.spaceScale.spacing03};\n -webkit-appearance: none;\n width: 100%;\n\n ${props.iconPosition === 'left' &&\n css`\n padding-left: ${props.theme.spaceScale.spacing09};\n `}\n\n ${props.iconPosition === 'right' &&\n css`\n padding-right: ${props.theme.spaceScale.spacing09};\n `}\n\n ${props.inputSize === 'large' &&\n css`\n font-size: ${props.theme.typeScale.size04.fontSize};\n line-height: ${props.theme.typeScale.size04.lineHeight};\n height: ${props.theme.spaceScale.spacing11};\n padding: ${props.theme.spaceScale.spacing04};\n `}\n\n ${props.iconPosition === 'left' &&\n props.inputSize === 'large' &&\n css`\n padding-left: ${props.theme.spaceScale.spacing10};\n `}\n\n ${props.iconPosition === 'right' &&\n props.inputSize === 'large' &&\n css`\n padding-right: ${props.theme.spaceScale.spacing10};\n `}\n\n &::placeholder {\n color: ${props.theme.colors.neutral03};\n opacity: 1;\n }\n\n &:focus {\n outline: 0;\n }\n\n &[type='search'] {\n &::-webkit-search-decoration,\n &::-webkit-search-cancel-button,\n &::-webkit-search-results-button,\n &::-webkit-search-results-decoration {\n display: none;\n }\n }\n\n ${props.disabled &&\n css`\n background: ${props.theme.colors.neutral07};\n color: ${props.theme.colors.disabledText};\n cursor: not-allowed;\n\n &::placeholder {\n color: ${props.theme.colors.disabledText};\n }\n `}\n`;\n\nexport const InputWrapper = styled.div<InputWrapperStylesProps>`\n ${inputWrapperStyles}\n`;\n\nconst StyledInput = styled.input<InputBaseStylesProps>`\n ${inputBaseStyles}\n`;\n\nconst IconWrapper = styled.span<{\n iconPosition?: InputIconPosition;\n inputSize?: InputSize;\n isClearable?: boolean;\n isPredictive?: boolean;\n disabled?: boolean;\n}>`\n bottom: ${props => (props.iconPosition === 'top' ? '45px' : 'inherit')};\n color: ${props => props.theme.colors.neutral};\n left: ${props =>\n props.iconPosition === 'left' ? props.theme.spaceScale.spacing03 : 'auto'};\n right: ${props =>\n props.iconPosition === 'right'\n ? props.theme.spaceScale.spacing03\n : props.iconPosition === 'top'\n ? '3px'\n : 'auto'};\n position: absolute;\n top: ${props =>\n props.iconPosition === 'top'\n ? 'inherit'\n : props => props.theme.spaceScale.spacing03};\n\n ${props =>\n props.inputSize === 'large' &&\n css`\n bottom: ${props.iconPosition === 'top' ? '56px' : 'inherit'};\n left: ${props.iconPosition === 'left'\n ? props.theme.spaceScale.spacing04\n : 'auto'};\n right: ${props.iconPosition === 'right'\n ? props.theme.spaceScale.spacing04\n : props.iconPosition === 'top'\n ? '3px'\n : 'auto'};\n top: ${props.iconPosition === 'top'\n ? 'inherit'\n : props.theme.spaceScale.spacing04};\n `}\n`;\n\nconst IconButtonContainer = styled.span<{\n iconPosition?: InputIconPosition;\n size?: InputSize;\n theme: ThemeInterface;\n isClearable?: boolean;\n disabled?: boolean;\n}>`\n background-color: ${({ disabled, theme }) =>\n disabled ? theme.colors.neutral07 : theme.colors.neutral08};\n bottom: ${props => (props.iconPosition === 'top' ? '40px' : 'inherit')};\n height: auto;\n margin: 0;\n position: relative;\n right: ${props =>\n props.size === InputSize.large\n ? props.theme.spaceScale.spacing02\n : props.theme.spaceScale.spacing01};\n\n svg {\n height: ${props =>\n props.size === InputSize.large\n ? `${props.theme.iconSizes.large}px`\n : `${props.theme.iconSizes.medium}px`};\n width: ${props =>\n props.size === InputSize.large\n ? `${props.theme.iconSizes.large}px`\n : `${props.theme.iconSizes.medium}px`};\n }\n`;\n\nconst IsClearableContainer = styled.span<{\n size?: InputSize;\n theme: ThemeInterface;\n isClearable?: boolean;\n disabled?: boolean;\n}>`\n background-color: ${({ disabled, theme }) =>\n disabled ? theme.colors.neutral07 : theme.colors.neutral08};\n position: relative;\n right: ${props =>\n props.size === InputSize.large\n ? props.theme.spaceScale.spacing02\n : props.theme.spaceScale.spacing01};\n`;\n\nfunction getIconSize(size: string, theme: ThemeInterface) {\n switch (size) {\n case 'large':\n return theme.iconSizes.large;\n default:\n return theme.iconSizes.medium;\n }\n}\n\nexport const InputBase = React.forwardRef<HTMLInputElement, InputBaseProps>(\n (props, forwardedRef) => {\n const {\n children,\n containerStyle,\n defaultValue,\n disabled,\n hasError,\n icon,\n iconAriaLabel,\n iconRef,\n isClearable,\n isPredictive,\n onClear,\n onIconClick,\n onIconKeyDown,\n inputSize,\n inputStyle,\n testId,\n type,\n ...other\n } = props;\n\n const i18n = React.useContext(I18nContext);\n\n const theme = React.useContext(ThemeContext);\n const iconPosition =\n icon && onIconClick\n ? InputIconPosition.right\n : icon && !props.iconPosition\n ? InputIconPosition.left\n : props.iconPosition;\n\n const [value, setValue] = React.useState<\n string | ReadonlyArray<string> | number\n >(props.defaultValue || props.value || '');\n\n React.useEffect(() => {\n if (props.value !== undefined && props.value !== null) {\n setValue(props.value);\n }\n }, [props.value]);\n\n const inputRef = React.useRef<HTMLInputElement>();\n const ref = useForkedRef(forwardedRef, inputRef);\n\n function handleClearInput() {\n onClear && typeof onClear === 'function' && onClear();\n setValue('');\n inputRef.current.focus();\n }\n\n function handleChange(event: React.ChangeEvent<HTMLInputElement>) {\n props.onChange &&\n typeof props.onChange === 'function' &&\n props.onChange(event);\n\n setValue(event.target.value);\n }\n\n return (\n <InputWrapper\n disabled={disabled}\n iconPosition={iconPosition}\n isInverse={props.isInverse}\n theme={theme}\n style={containerStyle}\n hasError={hasError}\n isClearable={isClearable}\n >\n <StyledInput\n {...other}\n aria-invalid={hasError}\n disabled={disabled}\n data-testid={testId}\n iconPosition={iconPosition}\n inputSize={inputSize ? inputSize : InputSize.medium}\n isInverse={useIsInverse(props.isInverse)}\n isPredictive={isPredictive}\n ref={ref}\n onChange={handleChange}\n style={inputStyle}\n theme={theme}\n type={type ? type : InputType.text}\n value={value}\n />\n {isClearable && value && (\n <IsClearableContainer theme={theme} disabled={disabled}>\n <IconButton\n aria-label={i18n.input.isClearableAriaLabel}\n disabled={disabled}\n icon={<ClearIcon />}\n isInverse={false}\n onClick={handleClearInput}\n onKeyDown={onIconKeyDown}\n ref={iconRef}\n shape={ButtonShape.fill}\n size={\n inputSize === InputSize.large\n ? ButtonSize.medium\n : ButtonSize.small\n }\n testId=\"clear-button\"\n type={ButtonType.button}\n variant={ButtonVariant.link}\n />\n </IsClearableContainer>\n )}\n\n {icon && !onIconClick && (\n <IconWrapper\n aria-label={iconAriaLabel}\n iconPosition={iconPosition}\n inputSize={inputSize ? inputSize : InputSize.medium}\n isPredictive={isPredictive}\n theme={theme}\n disabled={disabled}\n >\n {React.Children.only(\n React.cloneElement(icon, {\n size: getIconSize(\n inputSize ? inputSize : InputSize.medium,\n theme\n ),\n })\n )}\n </IconWrapper>\n )}\n\n {onIconClick && (\n <IconButtonContainer\n iconPosition={iconPosition}\n size={\n inputSize === InputSize.large ? InputSize.large : InputSize.medium\n }\n theme={theme}\n disabled={disabled}\n >\n <IconButton\n aria-label={iconAriaLabel}\n icon={icon}\n isInverse={false}\n onClick={onIconClick}\n onKeyDown={onIconKeyDown}\n ref={iconRef}\n disabled={disabled}\n shape={ButtonShape.fill}\n size={\n inputSize === InputSize.large\n ? ButtonSize.medium\n : ButtonSize.small\n }\n type={ButtonType.button}\n variant={ButtonVariant.link}\n />\n </IconButtonContainer>\n )}\n\n {children}\n </InputWrapper>\n );\n }\n);\n","import * as React from 'react';\nimport styled from '../../theme/styled';\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport { InputIconPosition, InputSize } from '../InputBase';\nimport { useIsInverse } from '../../inverse';\n\nexport enum LabelPosition {\n left = 'left',\n top = 'top', // default\n}\n\nexport interface LabelProps\n extends React.LabelHTMLAttributes<HTMLLabelElement> {\n actionable?: boolean;\n iconPosition?: InputIconPosition;\n isInverse?: boolean;\n labelPosition?: LabelPosition;\n size?: InputSize;\n theme?: any;\n testId?: string;\n}\n\nconst StyledLabel = styled.label<{\n iconPosition: InputIconPosition;\n isInverse: boolean;\n theme: any;\n size: InputSize;\n labelPosition: LabelPosition;\n}>`\n color: ${props =>\n props.isInverse\n ? props.theme.colors.neutral08\n : props.theme.colors.neutral};\n display: inline-block;\n font-size: ${props =>\n props.size === InputSize.large\n ? props.theme.typeScale.size03.fontSize\n : props.theme.typeScale.size02.fontSize};\n font-weight: 600;\n letter-spacing: ${props =>\n props.size === InputSize.large\n ? 'inherit'\n : props.theme.typeScale.size02.letterSpacing};\n line-height: ${props =>\n props.size === InputSize.large\n ? props.theme.typeScale.size03.lineHeight\n : props.theme.typeScale.size02.lineHeight};\n margin: ${props =>\n props.labelPosition === LabelPosition.left\n ? `0 ${props.theme.spaceScale.spacing05} 0 0`\n : `0 0 ${props.theme.spaceScale.spacing03}`};\n max-width: ${props =>\n props.iconPosition === InputIconPosition.top\n ? 'calc(100% - 51px)'\n : '100%'};\n text-align: left;\n white-space: ${props =>\n props.iconPosition === InputIconPosition.top ? 'inherit' : 'nowrap'};\n`;\n\nconst StyledSpan = StyledLabel.withComponent('span');\n\nexport const Label = React.forwardRef<HTMLLabelElement, LabelProps>(\n (props, ref) => {\n const {\n actionable = true,\n children,\n iconPosition,\n labelPosition,\n size,\n testId,\n ...other\n } = props;\n const theme = React.useContext(ThemeContext);\n\n return actionable ? (\n <StyledLabel\n {...other}\n data-testid={testId}\n isInverse={useIsInverse(props.isInverse)}\n iconPosition={iconPosition}\n labelPosition={labelPosition || LabelPosition.top}\n ref={ref}\n size={size ? size : InputSize.medium}\n theme={theme}\n >\n {children}\n </StyledLabel>\n ) : (\n <StyledSpan\n {...other}\n data-testid={testId}\n isInverse={useIsInverse(props.isInverse)}\n iconPosition={iconPosition}\n labelPosition={labelPosition || LabelPosition.top}\n ref={ref}\n size={size ? size : InputSize.medium}\n theme={theme}\n >\n {children}\n </StyledSpan>\n );\n }\n);\n","import * as React from 'react';\nimport styled from '../../theme/styled';\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport { ErrorIcon } from 'react-magma-icons';\nimport { Announce } from '../Announce';\nimport { InputSize } from '../InputBase';\n\nexport interface InputMessageProps\n extends React.HTMLAttributes<HTMLDivElement> {\n hasError?: boolean;\n id?: string;\n inputSize?: InputSize;\n isInverse?: boolean;\n}\n\nfunction BuildMessageColor(props) {\n const { isInverse, hasError, theme } = props;\n if (isInverse) {\n return hasError ? theme.colors.dangerInverse : theme.colors.neutral08;\n }\n return hasError ? theme.colors.danger : theme.colors.neutral03;\n}\n\nconst Message = styled.div<InputMessageProps>`\n align-items: center;\n border-radius: ${props => props.theme.borderRadius};\n color: ${props => BuildMessageColor(props)};\n display: flex;\n font-size: ${props => props.theme.typeScale.size02.fontSize};\n letter-spacing: ${props => props.theme.typeScale.size02.letterSpacing};\n line-height: ${props => props.theme.typeScale.size02.lineHeight};\n margin-top: ${props =>\n props.inputSize === InputSize.large\n ? props.theme.spaceScale.spacing03\n : props.theme.spaceScale.spacing02};\n text-align: left;\n`;\n\nconst IconWrapper = styled.span`\n display: inline-flex;\n flex-shrink: 0;\n padding-right: ${props => props.theme.spaceScale.spacing02};\n`;\n\nexport const InputMessage: React.FunctionComponent<InputMessageProps> = ({\n children,\n id,\n isInverse,\n hasError,\n ...other\n}: InputMessageProps) => {\n const theme = React.useContext(ThemeContext);\n\n return (\n <Announce>\n <Message\n {...other}\n data-testid=\"inputMessage\"\n id={id}\n isInverse={isInverse}\n hasError={hasError}\n theme={theme}\n >\n {hasError && (\n <IconWrapper aria-label=\"Error\" role=\"img\" theme={theme}>\n <ErrorIcon size={theme.iconSizes.small} />\n </IconWrapper>\n )}\n <div>{children}</div>\n </Message>\n </Announce>\n );\n};\n","import * as React from 'react';\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport {\n DisplayInputStyles,\n DisplayInputActiveStyles,\n buildDisplayInputActiveBackground,\n buildDisplayInputBorderColor,\n buildDisplayInputFocusStyles,\n} from '../SelectionControls/InputStyles';\nimport { FormGroupContext } from '../FormGroup';\nimport { HiddenStyles } from '../../utils/UtilityStyles';\nimport { InputMessage } from '../Input/InputMessage';\nimport { CheckBoxIcon, CheckBoxOutlineBlankIcon } from 'react-magma-icons';\nimport { StyledLabel } from '../SelectionControls/StyledLabel';\nimport { StyledContainer } from '../SelectionControls/StyledContainer';\nimport styled from '@emotion/styled';\nimport { omit, useGenerateId } from '../../utils';\nimport { useIsInverse } from '../../inverse';\n\nexport enum CheckboxTextPosition {\n left = 'left',\n right = 'right', // default\n}\n\nexport interface CheckboxProps\n extends React.InputHTMLAttributes<HTMLInputElement> {\n /**\n * If true, element is checked (i.e. selected)\n * @default false\n */\n checked?: boolean;\n /**\n * Hex code for the background color\n * @default #0000FF\n */\n color?: string;\n /**\n * Style properties for the component container element\n */\n containerStyle?: React.CSSProperties;\n /**\n * If true, checkbox is checked on first render\n */\n defaultChecked?: boolean;\n /**\n * If true, element is disabled\n * @default false\n */\n disabled?: boolean;\n /**\n * Content of the error message for an individual checkbox. If a value is provided, the input will be styled as an error state and the error message will display.\n */\n errorMessage?: React.ReactNode;\n /*\n * @internal\n */\n hasError?: boolean;\n /**\n * Style properties for the checkbox element\n */\n inputStyle?: React.CSSProperties;\n isInverse?: boolean;\n /**\n * If true, label text will be hidden visually, but will still be read by assistive technology\n * @default false\n */\n isTextVisuallyHidden?: boolean;\n /**\n * Style properties for the label element\n */\n labelStyle?: React.CSSProperties;\n /**\n * Content of label; can be node or string\n */\n labelText: React.ReactNode;\n testId?: string;\n /**\n * Whether the label appears to the left of the right of the checkbox\n * @default CheckboxTextPosition.right\n */\n textPosition?: CheckboxTextPosition;\n}\n\nexport const HiddenLabelText = styled.span`\n ${HiddenStyles};\n`;\n\nexport const HiddenInput = styled.input`\n ${HiddenStyles};\n`;\n\nfunction buildCheckIconColor(props) {\n if (props.disabled) {\n if (props.isInverse) {\n return props.theme.colors.tint04;\n }\n return props.theme.colors.neutral05;\n }\n if (props.isInverse) {\n return props.theme.colors.neutral08;\n }\n if (props.isChecked || props.isIndeterminate) {\n return props.color;\n }\n return props.theme.colors.neutral02;\n}\n\nexport const StyledFakeInput = styled.span<{\n isChecked?: boolean;\n color: string;\n disabled?: boolean;\n isIndeterminate?: boolean;\n isInverse?: boolean;\n hasError?: boolean;\n textPosition?: CheckboxTextPosition;\n theme?: any;\n}>`\n ${DisplayInputStyles};\n border: 2px solid;\n border-color: ${props => buildDisplayInputBorderColor(props)};\n color: ${props => buildCheckIconColor(props)};\n cursor: ${props => (props.disabled ? 'not-allowed' : 'pointer')};\n margin: ${props =>\n props.textPosition === 'left'\n ? `${props.theme.spaceScale.spacing01} 0 0 ${props.theme.spaceScale.spacing03}`\n : `0 ${props.theme.spaceScale.spacing03} 0 0`};\n\n svg {\n flex-shrink: 0;\n pointer-events: none;\n transition: all 0.2s ease-out;\n }\n\n ${HiddenInput}:focus + label & {\n &:before {\n ${props => buildDisplayInputFocusStyles(props)};\n }\n }\n\n &:after {\n // active state\n background: ${props => buildDisplayInputActiveBackground(props)};\n top: -10px;\n left: -10px;\n }\n\n /* prettier-ignore */\n ${HiddenInput}:not(:disabled):active + label & {\n &:after {\n ${DisplayInputActiveStyles}\n }\n }\n`;\n\nexport const Checkbox = React.forwardRef<HTMLInputElement, CheckboxProps>(\n (props, ref) => {\n const { checked, id: defaultId, defaultChecked, onChange } = props;\n const [isChecked, updateIsChecked] = React.useState(\n Boolean(defaultChecked) || Boolean(checked)\n );\n\n const id = useGenerateId(defaultId);\n const isControlled = typeof checked === 'boolean' ? true : false;\n\n React.useEffect(() => {\n if (typeof checked === 'boolean') {\n updateIsChecked(checked);\n }\n }, [checked]);\n\n function handleChange(event: React.ChangeEvent<HTMLInputElement>) {\n const { checked: targetChecked } = event.target;\n\n onChange && typeof onChange === 'function' && onChange(event);\n\n if (!isControlled) {\n updateIsChecked(targetChecked);\n }\n }\n\n const theme = React.useContext(ThemeContext);\n const context = React.useContext(FormGroupContext);\n\n const {\n color = theme.colors.primary,\n containerStyle,\n disabled,\n errorMessage,\n inputStyle,\n labelStyle,\n labelText,\n isTextVisuallyHidden,\n testId,\n textPosition,\n ...rest\n } = props;\n const other = omit(['defaultChecked'], rest);\n\n const descriptionId = errorMessage && `${id}__desc`;\n const groupDescriptionId = context.descriptionId;\n\n const describedBy =\n descriptionId && groupDescriptionId\n ? `${groupDescriptionId} ${descriptionId}`\n : descriptionId\n ? descriptionId\n : groupDescriptionId\n ? groupDescriptionId\n : null;\n\n const hasError = context.hasError || !!errorMessage;\n\n const isInverse = useIsInverse(props.isInverse);\n\n return (\n <>\n <StyledContainer style={containerStyle}>\n <HiddenInput\n {...other}\n aria-describedby={describedBy}\n id={id}\n data-testid={testId}\n checked={isChecked}\n disabled={disabled}\n ref={ref}\n type=\"checkbox\"\n onChange={handleChange}\n />\n <StyledLabel htmlFor={id} isInverse={isInverse} style={labelStyle}>\n {!isTextVisuallyHidden &&\n textPosition === CheckboxTextPosition.left &&\n labelText}\n\n <StyledFakeInput\n isChecked={isChecked}\n color={color}\n disabled={disabled}\n hasError={hasError}\n isInverse={isInverse}\n style={inputStyle}\n textPosition={textPosition}\n theme={theme}\n >\n {isChecked ? (\n <CheckBoxIcon size={theme.iconSizes.medium} />\n ) : (\n <CheckBoxOutlineBlankIcon size={theme.iconSizes.medium} />\n )}\n </StyledFakeInput>\n\n {isTextVisuallyHidden ? (\n <HiddenLabelText>{labelText}</HiddenLabelText>\n ) : (\n textPosition !== CheckboxTextPosition.left &&\n labelText &&\n labelText\n )}\n </StyledLabel>\n </StyledContainer>\n {!!errorMessage && (\n <InputMessage id={descriptionId} hasError isInverse={isInverse}>\n {errorMessage}\n </InputMessage>\n )}\n </>\n );\n }\n);\n","import * as React from 'react';\nimport { HiddenStyles } from '../../utils/UtilityStyles';\nimport { InputMessage } from '../Input/InputMessage';\nimport { Label } from '../Label';\nimport styled from '../../theme/styled';\nimport { omit, useGenerateId } from '../../utils';\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport { useIsInverse } from '../../inverse';\n\n/**\n * @children required\n */\nexport interface FormGroupProps extends React.HTMLAttributes<HTMLDivElement> {\n /**\n * Style properties for the component container element\n */\n containerStyle?: React.CSSProperties;\n /**\n * Content of the error message. If a value is provided, the form fields will be styled to show an error state\n */\n errorMessage?: React.ReactNode;\n /**\n * Content of the helper message\n */\n helperMessage?: React.ReactNode;\n isInverse?: boolean;\n /**\n * If true, label text for the form group will be hidden visually, but will still be read by assistive technology\n * @default false\n */\n isTextVisuallyHidden?: boolean;\n /**\n * ID of the element that labels the form group, used in the aria-labelledby attribute for the group. Alternatively, the labelText prop can be used\n */\n labelledById?: string;\n /**\n * Style properties for the label of the form group\n */\n labelStyle?: React.CSSProperties;\n /**\n * Content of label for form group; can be a node or a string. Alternatively, the labelledById prop can be used\n */\n labelText?: React.ReactNode;\n testId?: string;\n}\n\nexport interface FormGroupContextInterface {\n descriptionId?: string;\n hasError?: boolean;\n}\n\nexport const FormGroupContext = React.createContext<FormGroupContextInterface>({\n hasError: false,\n});\n\nconst HiddenLabel = styled.label`\n ${HiddenStyles};\n`;\n\nexport const FormGroup = React.forwardRef<HTMLDivElement, FormGroupProps>(\n (props, ref) => {\n const id = useGenerateId(props.id);\n\n const {\n containerStyle,\n errorMessage,\n helperMessage,\n labelledById,\n labelStyle,\n labelText,\n isTextVisuallyHidden,\n testId,\n children,\n ...rest\n } = props;\n const other = omit(['id'], rest);\n\n const descriptionId = errorMessage || helperMessage ? `${id}__desc` : null;\n const theme = React.useContext(ThemeContext);\n const isInverse = useIsInverse(props.isInverse);\n\n return (\n <div\n {...other}\n aria-labelledby={labelledById ? labelledById : id}\n data-testid={testId}\n ref={ref}\n role=\"group\"\n style={containerStyle}\n >\n <FormGroupContext.Provider\n value={{\n descriptionId,\n hasError: !!errorMessage,\n }}\n >\n {labelText && isTextVisuallyHidden && (\n <HiddenLabel id={id} style={labelStyle}>\n {labelText}\n </HiddenLabel>\n )}\n\n {labelText && !isTextVisuallyHidden && (\n <Label\n id={id}\n isInverse={isInverse}\n style={labelStyle}\n theme={theme}\n >\n {labelText}\n </Label>\n )}\n {children}\n\n <InputMessage\n id={descriptionId}\n hasError={!!errorMessage}\n isInverse={isInverse}\n >\n {(errorMessage || helperMessage) && (\n <>{errorMessage ? errorMessage : helperMessage}</>\n )}\n </InputMessage>\n </FormGroupContext.Provider>\n </div>\n );\n }\n);\n","import * as React from 'react';\nimport styled from '../../theme/styled';\nimport { ThemeContext } from '../../theme/ThemeContext';\n\nexport interface StyledLabelProps {\n children?: any;\n htmlFor: string;\n isInverse?: boolean;\n style?: React.CSSProperties;\n}\n\nconst StyledLabelComponent = styled.label<StyledLabelProps>`\n align-items: flex-start;\n color: ${props =>\n props.isInverse ? props.theme.colors.neutral08 : 'inherit'};\n display: flex;\n font-size: ${props => props.theme.typeScale.size03.fontSize};\n line-height: ${props => props.theme.typeScale.size03.lineHeight};\n margin: 0;\n padding: ${props => props.theme.spaceScale.spacing03} 0;\n`;\n\nexport const StyledLabel: React.FunctionComponent<StyledLabelProps> = ({\n children,\n htmlFor,\n isInverse,\n style,\n}: StyledLabelProps) => (\n <ThemeContext.Consumer>\n {theme => (\n <StyledLabelComponent\n htmlFor={htmlFor}\n isInverse={isInverse}\n style={style}\n theme={theme}\n >\n {children}\n </StyledLabelComponent>\n )}\n </ThemeContext.Consumer>\n);\n","import * as React from 'react';\nimport styled from '../../theme/styled';\n\nexport interface ContainerProps {\n children?: any;\n style?: React.CSSProperties;\n}\n\nconst StyledContainerComponent = styled.div<ContainerProps>`\n align-items: baseline;\n display: flex;\n flex-wrap: nowrap;\n position: relative;\n`;\n\nexport const StyledContainer: React.FunctionComponent<ContainerProps> = ({\n children,\n style,\n}: ContainerProps) => (\n <StyledContainerComponent style={style}>{children}</StyledContainerComponent>\n);\n","import * as React from 'react';\nimport { ThemeInterface } from '../../theme/magma';\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport { InverseContext, useIsInverse } from '../../inverse';\nimport { convertStyleValueToString } from '../../utils';\nimport styled from '@emotion/styled';\n\n/**\n * @children required\n */\nexport interface ContainerProps extends React.HTMLAttributes<HTMLDivElement> {\n isInverse?: boolean;\n /**\n * Left/right padding, set by CSS. If a number is provided, value will be in pixels\n */\n gutterWidth?: number | string;\n /**\n * Max-width of the component, set by CSS. If a number is provided, value will be in pixels\n */\n maxWidth?: number | string;\n testId?: string;\n}\n\nconst StyledContainer = styled.div<{\n gutterWidth: string;\n isInverse?: boolean;\n maxWidth: string;\n theme: ThemeInterface;\n}>`\n background: ${props =>\n props.isInverse\n ? props.theme.colors.foundation\n : props.theme.colors.neutral08};\n color: ${props =>\n props.isInverse\n ? props.theme.colors.neutral08\n : props.theme.colors.neutral};\n display: flow-root;\n margin: 0 auto;\n max-width: ${props => props.maxWidth};\n padding: ${props => `0 ${props.gutterWidth}`};\n`;\n\nexport const Container = React.forwardRef<HTMLDivElement, ContainerProps>(\n (props, ref) => {\n const theme = React.useContext(ThemeContext);\n const {\n children,\n gutterWidth = theme.spaceScale.spacing06,\n maxWidth,\n testId,\n ...other\n } = props;\n\n const gutterWidthString = convertStyleValueToString(gutterWidth);\n const maxWidthString = convertStyleValueToString(maxWidth, 'none');\n\n const isInverse = useIsInverse(props.isInverse);\n\n return (\n <InverseContext.Provider\n value={{\n isInverse,\n }}\n >\n <StyledContainer\n ref={ref}\n data-testid={testId}\n gutterWidth={gutterWidthString}\n isInverse={isInverse}\n maxWidth={maxWidthString}\n theme={theme}\n {...other}\n >\n {children}\n </StyledContainer>\n </InverseContext.Provider>\n );\n }\n);\n","import * as React from 'react';\n\nexport function useControlled({ controlled, default: defaultProp }) {\n const { current: isControlled } = React.useRef(controlled !== undefined);\n const [valueState, setValue] = React.useState(defaultProp);\n const value = isControlled ? controlled : valueState;\n\n const setValueIfUncontrolled = React.useCallback(newValue => {\n if (!isControlled) {\n setValue(newValue);\n }\n }, []);\n\n return [value, setValueIfUncontrolled];\n}\n","import { useControlled } from './useControlled';\n\nexport interface UseDataPaginationProps<PaginatedItem> {\n /**\n * Number of items per page by default when uncontrolled\n * @default 10\n */\n defaultItemsPerPage?: number;\n /**\n * Array of items to be displayed\n */\n items?: PaginatedItem[];\n /**\n * Number of items per page\n */\n itemsPerPage?: number;\n /**\n * Event that fires when the number of items per page is changed\n */\n onItemsPerPageChange?: (newRowsPerPage: number) => void;\n}\nexport interface UseDataPaginationReturn<PaginatedItem> {\n getPageItems: (page: number) => PaginatedItem[];\n itemsPerPage: number;\n length: number;\n onItemsPerPageChange: (newItemsPerPage: number) => void;\n}\n\nexport function useDataPagination<T>(\n props: UseDataPaginationProps<T> = {}\n): UseDataPaginationReturn<T> {\n const {\n defaultItemsPerPage = 10,\n items = [],\n itemsPerPage: itemsPerPageProp,\n onItemsPerPageChange,\n } = props;\n\n const [itemsPerPage, setItemsPerPageState] = useControlled({\n controlled: itemsPerPageProp,\n default: defaultItemsPerPage,\n });\n\n function handleItemsPerPageChange(newItemsPerPage: number) {\n if (!itemsPerPageProp) {\n setItemsPerPageState(newItemsPerPage);\n }\n\n onItemsPerPageChange &&\n typeof onItemsPerPageChange === 'function' &&\n onItemsPerPageChange(newItemsPerPage);\n }\n\n const getPageItems = (page: number) => {\n const isLastPage = page * itemsPerPage >= items.length;\n\n const start = (page - 1) * itemsPerPage;\n const end = isLastPage ? items.length : page * itemsPerPage;\n\n return items.slice(start, end);\n };\n\n const length = Math.ceil(items.length / itemsPerPage);\n\n return {\n getPageItems,\n itemsPerPage,\n length,\n onItemsPerPageChange: handleItemsPerPageChange,\n };\n}\n","import * as React from 'react';\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport {\n CheckboxProps,\n HiddenLabelText,\n HiddenInput,\n StyledFakeInput,\n} from '../Checkbox';\nimport {\n CheckBoxIcon,\n CheckBoxOutlineBlankIcon,\n IndeterminateCheckBoxIcon,\n} from 'react-magma-icons';\nimport { FormGroupContext } from '../FormGroup';\nimport { InputMessage } from '../Input/InputMessage';\nimport { StyledLabel } from '../SelectionControls/StyledLabel';\nimport { StyledContainer } from '../SelectionControls/StyledContainer';\nimport { useGenerateId, Omit } from '../../utils';\nimport { VisuallyHidden } from '../VisuallyHidden';\nimport { Announce } from '../Announce';\nimport { I18nContext } from '../../i18n';\nimport { useIsInverse } from '../../inverse';\n\nexport interface IndeterminateCheckboxProps\n extends Omit<CheckboxProps, 'checked'> {\n /**\n * Status of the indeterminate, three-state checkbox, which includes and indeterminate (e.g. mixed) option.\n * @default IndeterminateCheckboxStatus.unchecked\n */\n status: IndeterminateCheckboxStatus;\n testId?: string;\n}\n\nexport enum IndeterminateCheckboxStatus {\n checked = 'checked',\n indeterminate = 'indeterminate',\n unchecked = 'unchecked', //default\n}\n\nexport const IndeterminateCheckbox = React.forwardRef<\n HTMLInputElement,\n IndeterminateCheckboxProps\n>((props, ref) => {\n const [isChecked, updateIsChecked] = React.useState(\n props.status === 'indeterminate'\n ? false\n : Boolean(props.status === 'checked')\n );\n\n const id = useGenerateId(props.id);\n\n React.useEffect(() => {\n updateIsChecked(\n props.status === 'indeterminate'\n ? false\n : Boolean(props.status === 'checked')\n );\n }, [props.status]);\n\n function handleChange(event: React.ChangeEvent<HTMLInputElement>) {\n const { checked: targetChecked } = event.target;\n\n props.onChange &&\n typeof props.onChange === 'function' &&\n props.onChange(event);\n\n if (props.status !== 'indeterminate') {\n updateIsChecked(targetChecked);\n }\n }\n\n const theme = React.useContext(ThemeContext);\n const i18n = React.useContext(I18nContext);\n const context = React.useContext(FormGroupContext);\n\n const {\n color = theme.colors.primary,\n containerStyle,\n disabled,\n errorMessage,\n inputStyle,\n labelStyle,\n labelText,\n isTextVisuallyHidden,\n status,\n testId,\n ...other\n } = props;\n\n const isIndeterminate = status === 'indeterminate';\n const isUnchecked = status === 'unchecked';\n\n function replaceLabelTextForAnnounceText(baseAnnounceText) {\n return baseAnnounceText.replace(\n /\\{labelText\\}/g,\n getStringifiedLabelText(labelText)\n );\n }\n\n function getStringifiedLabelText(node) {\n if (['string', 'number'].includes(typeof node)) return node;\n if (node instanceof Array)\n return node.map(getStringifiedLabelText).join('');\n if (typeof node === 'object' && node)\n return getStringifiedLabelText(node.props.children);\n }\n\n const showAnnounce = isChecked || isIndeterminate || isUnchecked;\n const announceText = isChecked\n ? replaceLabelTextForAnnounceText(\n i18n.indeterminateCheckbox.isCheckedAnnounce\n )\n : isIndeterminate\n ? replaceLabelTextForAnnounceText(\n i18n.indeterminateCheckbox.isIndeterminateAnnounce\n )\n : isUnchecked\n ? replaceLabelTextForAnnounceText(\n i18n.indeterminateCheckbox.isUncheckedAnnounce\n )\n : '';\n\n const descriptionId = errorMessage ? `${id}__desc` : null;\n const groupDescriptionId = context.descriptionId;\n\n const describedBy =\n descriptionId && groupDescriptionId\n ? `${groupDescriptionId} ${descriptionId}`\n : descriptionId\n ? descriptionId\n : groupDescriptionId\n ? groupDescriptionId\n : null;\n\n const hasError = context.hasError || !!errorMessage;\n\n const isInverse = useIsInverse(props.isInverse);\n\n return (\n <>\n <StyledContainer style={containerStyle}>\n <HiddenInput\n {...other}\n aria-describedby={describedBy}\n checked={isChecked}\n data-testid={testId}\n disabled={disabled}\n id={id}\n ref={ref}\n type=\"checkbox\"\n onChange={handleChange}\n />\n <StyledLabel htmlFor={id} isInverse={isInverse} style={labelStyle}>\n <StyledFakeInput\n isChecked={isChecked}\n color={color}\n disabled={disabled}\n hasError={hasError}\n isIndeterminate={isIndeterminate}\n isInverse={isInverse}\n style={inputStyle}\n theme={theme}\n >\n {isIndeterminate ? (\n <IndeterminateCheckBoxIcon\n testId=\"indeterminateIcon\"\n size={theme.iconSizes.medium}\n />\n ) : isChecked ? (\n <CheckBoxIcon size={theme.iconSizes.medium} />\n ) : (\n <CheckBoxOutlineBlankIcon size={theme.iconSizes.medium} />\n )}\n </StyledFakeInput>\n {isTextVisuallyHidden ? (\n <HiddenLabelText>{labelText}</HiddenLabelText>\n ) : (\n labelText\n )}\n </StyledLabel>\n <Announce>\n {showAnnounce && <VisuallyHidden>{announceText}</VisuallyHidden>}\n </Announce>\n </StyledContainer>\n {!!errorMessage && (\n <InputMessage\n id={descriptionId}\n hasError\n isInverse={isInverse}\n style={{ paddingLeft: theme.spaceScale.spacing08 }}\n >\n {errorMessage}\n </InputMessage>\n )}\n </>\n );\n});\n","import * as React from 'react';\nimport styled from '../../theme/styled';\nimport { HiddenStyles } from '../../utils/UtilityStyles';\n\n/**\n * @children required\n */\nexport interface VisuallyHiddenProps\n extends React.HTMLAttributes<HTMLDivElement> {\n testId?: string;\n}\n\nconst VisuallyHiddenDiv = styled.div`\n ${HiddenStyles}\n`;\n\nexport const VisuallyHidden: React.FunctionComponent<VisuallyHiddenProps> = props => {\n const { children, testId, ...other } = props;\n return (\n <VisuallyHiddenDiv {...other} data-testid={testId}>\n {children}\n </VisuallyHiddenDiv>\n );\n};\n","import * as React from 'react';\nimport styled from '../../theme/styled';\nimport { useIsInverse } from '../../inverse';\nimport { ThemeContext } from '../../theme/ThemeContext';\n\n/**\n * @children required\n */\nexport interface TableProps extends React.HTMLAttributes<HTMLTableElement> {\n /**\n * Relative padding of the table cells\n * @default TableDensity.normal\n */\n density?: TableDensity;\n /**\n * If true, row will be visually highlighted on hover\n */\n hasHoverStyles?: boolean;\n /**\n * If true, columns will have vertical borders\n */\n hasVerticalBorders?: boolean;\n /**\n * If true, every other row will have a background color\n */\n hasZebraStripes?: boolean;\n isInverse?: boolean;\n /**\n * @internal\n */\n isSelectable?: boolean;\n /**\n * Minimum width for the table in pixels\n * @default 600\n */\n minWidth?: number;\n rowCount?: number;\n selectedItems?: Array<number>;\n testId?: string;\n}\n\nexport enum TableDensity {\n compact = 'compact',\n loose = 'loose',\n normal = 'normal', // default\n}\n\nexport enum TableCellAlign {\n center = 'center',\n inherit = 'inherit',\n justify = 'justify',\n left = 'left', // default\n right = 'right',\n}\n\nexport enum TableSortDirection {\n ascending = 'ascending',\n descending = 'descending',\n none = 'none', // default\n}\n\nexport enum TableRowColor {\n danger = 'danger',\n info = 'info',\n success = 'success',\n warning = 'warning',\n}\n\ninterface TableContextInterface {\n density?: TableDensity;\n hasHoverStyles?: boolean;\n hasVerticalBorders?: boolean;\n hasZebraStripes?: boolean;\n isInverse?: boolean;\n isSelectable?: boolean;\n rowCount?: number;\n selectedItems?: Array<number>;\n}\n\nexport const TableContext = React.createContext<TableContextInterface>({\n density: TableDensity.normal,\n hasHoverStyles: false,\n hasZebraStripes: false,\n hasVerticalBorders: false,\n isInverse: false,\n isSelectable: false,\n rowCount: 0,\n selectedItems: [],\n});\n\nconst TableContainer = styled.div`\n overflow-x: visible;\n`;\n\nconst StyledTable = styled.table<{ isInverse?: boolean; minWidth: number }>`\n border-collapse: collapse;\n border-spacing: 0;\n color: ${props =>\n props.isInverse\n ? props.theme.colors.neutral08\n : props.theme.colors.neutral};\n display: table;\n font-size: ${props => props.theme.typeScale.size03.fontSize};\n line-height: ${props => props.theme.typeScale.size03.lineHeight};\n min-width: ${props => props.minWidth}px;\n width: 100%;\n`;\n\nexport const Table = React.forwardRef<HTMLTableElement, TableProps>(\n (props, ref) => {\n const {\n children,\n density,\n hasHoverStyles,\n hasVerticalBorders,\n hasZebraStripes,\n isSelectable,\n minWidth,\n rowCount,\n selectedItems,\n testId,\n ...other\n } = props;\n\n const theme = React.useContext(ThemeContext);\n\n const isInverse = useIsInverse(props.isInverse);\n\n return (\n <TableContext.Provider\n value={{\n density,\n hasHoverStyles,\n hasZebraStripes,\n hasVerticalBorders,\n isInverse: isInverse,\n isSelectable,\n }}\n >\n <TableContainer>\n <StyledTable\n {...other}\n data-testid={testId}\n isInverse={isInverse}\n minWidth={minWidth || theme.breakpoints.small}\n ref={ref}\n theme={theme}\n >\n {children}\n </StyledTable>\n </TableContainer>\n </TableContext.Provider>\n );\n }\n);\n","import * as React from 'react';\n\n/**\n * @children required\n */\nexport interface TableBodyProps\n extends React.HTMLAttributes<HTMLTableSectionElement> {\n testId?: string;\n}\n\nexport const TableBody = React.forwardRef<\n HTMLTableSectionElement,\n TableBodyProps\n>((props, ref) => {\n const { children, testId, ...other } = props;\n return (\n <tbody {...other} ref={ref} data-testid={testId}>\n {children}\n </tbody>\n );\n});\n","import * as React from 'react';\nimport styled from '../../theme/styled';\nimport { css } from '@emotion/core';\nimport { TableCellAlign, TableContext, TableDensity } from './Table';\nimport { ThemeContext } from '../../theme/ThemeContext';\n\nexport interface TableCellProps\n extends React.HTMLAttributes<HTMLTableCellElement> {\n /**\n * Text alignment of the cell content. Right alignment should be used for numeric values\n * @default TableCellAlign.left\n */\n align?: TableCellAlign;\n testId?: string;\n /**\n * Width of the component, set by CSS\n * @default auto\n */\n width?: string | number;\n}\n\nexport const baseTableCellStyle = props => css`\n border-right: ${props.hasVerticalBorders ? '1px solid' : 0};\n border-color: ${props.isInverse\n ? props.theme.colors.tint04\n : props.theme.colors.neutral06};\n display: table-cell;\n font-size: inherit;\n line-height: inherit;\n padding: ${buildCellPaddingStyle(props.density, props.theme)};\n text-align: ${props.textAlign};\n\n &:last-of-type {\n border-right: 0;\n }\n`;\n\nexport function buildCellPaddingStyle(density, theme: any) {\n switch (density) {\n case 'compact':\n return `${theme.spaceScale.spacing02} ${theme.spaceScale.spacing03}`;\n case 'loose':\n return `${theme.spaceScale.spacing06} ${theme.spaceScale.spacing08}`;\n\n default:\n return `${theme.spaceScale.spacing04} ${theme.spaceScale.spacing05}`;\n }\n}\n\nconst StyledCell = styled.td<{\n density?: TableDensity;\n hasVerticalBorders?: boolean;\n isInverse?: boolean;\n textAlign?: TableCellAlign;\n theme?: any;\n width?: string;\n}>`\n ${baseTableCellStyle}\n\n ${props =>\n props.width &&\n css`\n width: ${props.width};\n `}\n`;\n\nexport const TableCell = React.forwardRef<HTMLTableCellElement, TableCellProps>(\n (props, ref) => {\n const { align, children, testId, width, ...other } = props;\n const tableContext = React.useContext(TableContext);\n const theme = React.useContext(ThemeContext);\n\n const widthString = typeof width === 'number' ? `${width}px` : width;\n\n return (\n <StyledCell\n {...other}\n data-testid={testId}\n density={tableContext.density}\n hasVerticalBorders={tableContext.hasVerticalBorders}\n isInverse={tableContext.isInverse}\n ref={ref}\n textAlign={align || TableCellAlign.left}\n theme={theme}\n width={widthString}\n >\n {children}\n </StyledCell>\n );\n }\n);\n\nTableCell.displayName = 'TableCell';\n","import * as React from 'react';\nimport styled from '../../theme/styled';\nimport { css } from '@emotion/core';\nimport { baseTableCellStyle, buildCellPaddingStyle } from './TableCell';\nimport {\n TableCellAlign,\n TableContext,\n TableDensity,\n TableSortDirection,\n} from './Table';\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport { SortDoubleArrowIcon, SouthIcon, NorthIcon } from 'react-magma-icons';\n\nexport interface TableHeaderCellProps\n extends React.HTMLAttributes<HTMLTableHeaderCellElement> {\n /**\n * Text alignment of the cell content. Right alignment should be used for numeric values\n * @default TableCellAlign.left\n */\n align?: TableCellAlign;\n /**\n * @default false\n * If true, style as a row header rather than a column header\n */\n isRowHeader?: boolean;\n /**\n * If true, the header will render a button for sorting\n */\n isSortable?: boolean;\n /**\n * Event that fires when clicking the table header cell sort button\n */\n onSort?: () => void;\n /**\n * Direction and range of data cells that are covered by the header cell\n * @default TableHeaderCellScope.col\n */\n scope?: TableHeaderCellScope;\n /**\n * Direction by which the column is sorted\n * @default TableSortDirection.none\n */\n sortDirection?: TableSortDirection;\n testId?: string;\n /**\n * Width of the component, set by CSS\n * @default auto\n */\n width?: string | number;\n}\n\nexport enum TableHeaderCellScope {\n col = 'col',\n colgroup = 'colgroup',\n row = 'row',\n rowgroup = 'rowgroup',\n}\n\nconst StyledTableHeaderCell = styled.th<{\n density?: TableDensity;\n hasVerticalBorders?: boolean;\n isInverse?: boolean;\n isRowHeader?: boolean;\n isSortable?: boolean;\n textAlign?: TableCellAlign;\n width?: string;\n}>`\n ${props => {\n return props.isRowHeader\n ? {}\n : {\n background: props.isInverse\n ? props.theme.colors.tint03\n : props.theme.colors.neutral07,\n borderBottom: '2px solid',\n fontWeight: 'bold',\n verticalAlign: 'bottom',\n };\n }}\n\n ${baseTableCellStyle}\n\n ${props =>\n props.isSortable &&\n css`\n padding: 0;\n `}\n\n ${props =>\n props.width &&\n css`\n width: ${props.width};\n `}\n`;\n\nconst SortButton = styled.button<{\n density?: TableDensity;\n isInverse?: boolean;\n textAlign?: TableCellAlign;\n}>`\n align-items: flex-end;\n background: none;\n border: 0;\n color: inherit;\n display: flex;\n justify-content: ${props =>\n props.textAlign === TableCellAlign.right ? 'flex-end' : 'flex-start'};\n margin: 0;\n padding: ${props => buildCellPaddingStyle(props.density, props.theme)}};\n text-align: left;\n width: 100%;\n\n &:focus {\n outline: 2px dotted\n ${props =>\n props.isInverse\n ? props.theme.colors.focusInverse\n : props.theme.colors.focus};\n outline-offset: -2px;\n }\n\n &:hover,\n &:focus {\n background: ${props =>\n props.isInverse ? props.theme.colors.tint : props.theme.colors.neutral06};\n\n svg {\n fill: ${props =>\n props.isInverse\n ? props.theme.colors.neutral08\n : props.theme.colors.neutral};\n }\n }\n`;\n\nconst IconWrapper = styled.span`\n padding-left: ${props => props.theme.spaceScale.spacing03};\n position: relative;\n top: ${props => props.theme.spaceScale.spacing02};\n`;\n\nexport const TableHeaderCell = React.forwardRef<\n HTMLTableCellElement,\n TableHeaderCellProps\n>((props, ref) => {\n const {\n align,\n children,\n isRowHeader = false,\n isSortable,\n onSort,\n scope = isRowHeader ? TableHeaderCellScope.row : TableHeaderCellScope.col,\n sortDirection,\n testId,\n width,\n ...other\n } = props;\n const theme = React.useContext(ThemeContext);\n const tableContext = React.useContext(TableContext);\n\n function handleSort() {\n onSort && typeof onSort === 'function' && onSort();\n }\n\n const SortIcon =\n sortDirection === TableSortDirection.ascending ? (\n <SouthIcon size={theme.iconSizes.small} />\n ) : sortDirection === TableSortDirection.descending ? (\n <NorthIcon size={theme.iconSizes.small} />\n ) : (\n <SortDoubleArrowIcon\n color={\n tableContext.isInverse\n ? theme.colors.neutral06\n : theme.colors.neutral04\n }\n size={theme.iconSizes.small}\n />\n );\n\n const widthString = typeof width === 'number' ? `${width}px` : width;\n\n return (\n <StyledTableHeaderCell\n {...other}\n data-testid={testId}\n density={tableContext.density}\n hasVerticalBorders={tableContext.hasVerticalBorders}\n isInverse={tableContext.isInverse}\n ref={ref}\n isRowHeader={isRowHeader}\n isSortable={isSortable}\n scope={scope}\n textAlign={align || TableCellAlign.left}\n theme={theme}\n width={widthString}\n >\n {isSortable ? (\n <SortButton\n density={tableContext.density}\n isInverse={tableContext.isInverse}\n onClick={handleSort}\n textAlign={align || TableCellAlign.left}\n theme={theme}\n >\n <span>{children}</span>\n <IconWrapper theme={theme}>{SortIcon}</IconWrapper>\n </SortButton>\n ) : (\n <>{children}</>\n )}\n </StyledTableHeaderCell>\n );\n});\n\nTableHeaderCell.displayName = 'TableHeaderCell';\n","import * as React from 'react';\n\n/**\n * @children required\n */\nexport interface TableHeadProps\n extends React.HTMLAttributes<HTMLTableSectionElement> {\n testId?: string;\n}\n\nexport const TableHead = React.forwardRef<\n HTMLTableSectionElement,\n TableHeadProps\n>((props, ref) => {\n const { children, testId, ...other } = props;\n return (\n <thead {...other} ref={ref} data-testid={testId}>\n {children}\n </thead>\n );\n});\n","import React from 'react';\nimport { I18nContext } from '../../i18n';\nimport { useControlled } from '../../hooks/useControlled';\n\nexport interface UsePaginationProps {\n /**\n * The total number of Pagination buttons\n * @default 1\n */\n count?: number;\n /**\n * Page selected by default when the component is uncontrolled\n */\n defaultPage?: number;\n /**\n * If true, disables all of the Pagination buttons\n * @default false\n */\n disabled?: boolean;\n /**\n * If true, hides the next page button\n * @default false\n */\n hideNextButton?: boolean;\n /**\n * If true, hides the previous page button\n * @default false\n */\n hidePreviousButton?: boolean;\n /**\n * Number of page buttons before and after the current page\n * @default 1\n */\n numberOfAdjacentPages?: number;\n /**\n * Number of page buttons at the beginning and end of the page number buttons list\n * @default 1\n */\n numberOfEdgePages?: number;\n /**\n * Event that fires when the page number changes\n */\n onPageChange?: (event: React.SyntheticEvent, newPage: number) => void;\n /**\n * Current page number\n */\n page?: number;\n /**\n * If true, shows the first page button\n * @default false\n */\n showFirstButton?: boolean;\n /**\n * If true, shows the last page button\n * @default false\n */\n showLastButton?: boolean;\n}\n\nexport function usePagination(props: Partial<UsePaginationProps> = {}) {\n const {\n count = 1,\n defaultPage = 1,\n disabled = false,\n hideNextButton = false,\n hidePreviousButton = false,\n numberOfAdjacentPages = 1,\n numberOfEdgePages = 1,\n onPageChange: handleChange,\n page: pageProp,\n showFirstButton = false,\n showLastButton = false,\n ...other\n } = props;\n\n const i18n = React.useContext(I18nContext);\n\n const [page, setPageState] = useControlled({\n controlled: pageProp,\n default: defaultPage,\n });\n\n const handleClick = (event, value) => {\n if (!pageProp) {\n setPageState(value);\n }\n\n handleChange &&\n typeof handleChange === 'function' &&\n handleChange(event, value);\n };\n\n const range = (start, end) => {\n const length = end - start + 1;\n return Array.from({ length }, (_, i) => start + i);\n };\n\n const startPages = range(1, Math.min(numberOfEdgePages, count));\n const endPages = range(\n Math.max(count - numberOfEdgePages + 1, numberOfEdgePages + 1),\n count\n );\n\n const siblingsStart = Math.max(\n Math.min(\n // Natural start\n page - numberOfAdjacentPages,\n // Lower boundary when page is high\n count - numberOfEdgePages - numberOfAdjacentPages * 2 - 1\n ),\n // Greater than startPages\n numberOfEdgePages + 2\n );\n\n const siblingsEnd = Math.min(\n Math.max(\n // Natural end\n page + numberOfAdjacentPages,\n // Upper boundary when page is low\n numberOfEdgePages + numberOfAdjacentPages * 2 + 2\n ),\n // Less than endPages\n endPages.length > 0 ? endPages[0] - 2 : count - 1\n );\n\n // Basic list of items to render\n const itemList = [\n ...(showFirstButton ? ['first'] : []),\n ...(hidePreviousButton ? [] : ['previous']),\n ...startPages,\n\n // Start ellipsis\n ...(siblingsStart > numberOfEdgePages + 2\n ? ['start-ellipsis']\n : numberOfEdgePages + 1 < count - numberOfEdgePages\n ? [numberOfEdgePages + 1]\n : []),\n\n // Sibling pages\n ...range(siblingsStart, siblingsEnd),\n\n // End ellipsis\n ...(siblingsEnd < count - numberOfEdgePages - 1\n ? ['end-ellipsis']\n : count - numberOfEdgePages > numberOfEdgePages\n ? [count - numberOfEdgePages]\n : []),\n\n ...endPages,\n ...(hideNextButton ? [] : ['next']),\n ...(showLastButton ? ['last'] : []),\n ];\n\n // Map the button type to its page number\n const buttonPage = type => {\n switch (type) {\n case 'first':\n return 1;\n case 'previous':\n return page - 1;\n case 'next':\n return page + 1;\n case 'last':\n return count;\n default:\n return null;\n }\n };\n\n // Convert the basic item list to PaginationItem props objects\n const pageButtons = itemList.map(item => {\n return typeof item === 'number'\n ? {\n onClick: event => {\n handleClick(event, item);\n },\n type: 'page',\n page: item,\n isSelected: item === page,\n disabled,\n 'aria-current': item === page ? 'true' : undefined,\n 'aria-label': `${i18n.pagination.pageButtonLabel} ${item}`,\n }\n : {\n onClick: event => {\n handleClick(event, buttonPage(item));\n },\n type: item,\n page: buttonPage(item),\n isSelected: false,\n disabled:\n disabled ||\n (item.indexOf('ellipsis') === -1 &&\n (item === 'next' || item === 'last' ? page >= count : page <= 1)),\n };\n });\n\n return {\n page,\n pageButtons,\n setPageState,\n ...other,\n };\n}\n","import React from 'react';\n\nexport function registerDescendant(\n itemRefArray: React.MutableRefObject<React.MutableRefObject<Element>[]>,\n itemRef: React.MutableRefObject<Element>\n) {\n if (\n itemRefArray.current.find(\n ({ current: item }) => item === itemRef.current\n ) == null\n ) {\n const index = itemRefArray.current.findIndex(({ current: item }) => {\n if (!item || !itemRef.current) return false;\n\n return Boolean(\n item.compareDocumentPosition(itemRef.current) &\n Node.DOCUMENT_POSITION_PRECEDING\n );\n });\n\n const newItem = itemRef;\n\n itemRefArray.current =\n index === -1\n ? [...itemRefArray.current, newItem]\n : [\n ...itemRefArray.current.slice(0, index),\n newItem,\n ...itemRefArray.current.slice(index),\n ];\n }\n}\n\nexport function unregisterDescendant(\n itemRefArray: React.MutableRefObject<React.MutableRefObject<Element>[]>,\n itemRef: React.MutableRefObject<Element>\n) {\n if (!itemRef.current) return;\n\n itemRefArray.current = itemRefArray.current.filter(\n item => itemRef.current !== item.current\n );\n}\n\nexport function useDescendants(): [\n React.MutableRefObject<React.MutableRefObject<Element>[]>,\n (\n refArray: React.MutableRefObject<React.MutableRefObject<Element>[]>,\n ref: React.MutableRefObject<Element>\n ) => void,\n (\n refArray: React.MutableRefObject<React.MutableRefObject<Element>[]>,\n ref: React.MutableRefObject<Element>\n ) => void\n] {\n const itemRefArray = React.useRef<React.MutableRefObject<Element>[]>([]);\n\n return [itemRefArray, registerDescendant, unregisterDescendant];\n}","import * as React from 'react';\nimport styled from '../../theme/styled';\nimport { useDescendants } from '../../hooks/useDescendants';\nimport { useForkedRef } from '../../utils';\n\nexport enum DropdownDropDirection {\n down = 'down', //default\n left = 'left',\n right = 'right',\n up = 'up',\n}\n\nexport enum DropdownAlignment {\n start = 'start', //default\n end = 'end',\n}\n\nexport interface DropdownProps extends React.HTMLAttributes<HTMLDivElement> {\n /**\n * Index of the item that will active/selected. If none is provided, no item will appear active\n * @default -1\n */\n activeIndex?: number;\n /**\n * Alignment of the dropdown content\n * @default `DropdownAlignment.start`\n */\n alignment?: DropdownAlignment;\n /**\n * Position of the dropdown content\n * @default `DropdownDropDirection.down`\n */\n dropDirection?: DropdownDropDirection;\n /**\n * Max-height of dropdown content\n * @default 250px\n */\n maxHeight?: string | number;\n /**\n * Function called on dropdown close before focusing the toggle button\n * @deprecated true\n */\n onBeforeShiftFocus?: (event: React.SyntheticEvent) => void;\n /**\n * Function called when closing the dropdown menu\n */\n onClose?: (event: React.SyntheticEvent) => void;\n /**\n * Function called when opening the dropdown menu\n */\n onOpen?: () => void;\n testId?: string;\n /**\n * Width of menu\n * @default Width of longest menu item\n */\n width?: string | number;\n}\n\nconst Container = styled.div`\n display: inline-block;\n position: relative;\n`;\n\ninterface DropdownContextInterface {\n activeItemIndex?: number;\n alignment?: DropdownAlignment;\n closeDropdown?: (event: React.SyntheticEvent | React.KeyboardEvent) => void;\n dropdownButtonId?: React.MutableRefObject<string>;\n dropDirection?: DropdownDropDirection;\n handleDropdownBlur?: (event: React.FocusEvent) => void;\n itemRefArray?: React.MutableRefObject<React.MutableRefObject<Element>[]>;\n isFixedWidth?: boolean;\n isOpen?: boolean;\n maxHeight?: string;\n menuRef?: any;\n openDropdown?: () => void;\n registerDropdownMenuItem: (\n itemRefArray: React.MutableRefObject<React.MutableRefObject<Element>[]>,\n itemRef: React.MutableRefObject<Element>\n ) => void;\n setActiveItemIndex?: React.Dispatch<React.SetStateAction<number>>;\n setIsOpen: React.Dispatch<React.SetStateAction<boolean>>;\n toggleRef?: any;\n width?: string;\n}\n\nexport const DropdownContext = React.createContext<DropdownContextInterface>({\n isOpen: false,\n registerDropdownMenuItem: (elements, element) => {},\n setIsOpen: () => false,\n});\n\nexport const useDropdownContext = () => React.useContext(DropdownContext);\n\nexport const Dropdown = React.forwardRef<HTMLDivElement, DropdownProps>(\n (props, forwardedRef) => {\n const {\n activeIndex,\n alignment,\n children,\n dropDirection,\n maxHeight,\n onBeforeShiftFocus,\n onClose,\n onOpen,\n testId,\n width,\n ...other\n } = props;\n\n const [isOpen, setIsOpen] = React.useState<boolean>(false);\n\n const [activeItemIndex, setActiveItemIndex] = React.useState<number>(\n activeIndex || -1\n );\n\n const ownRef = React.useRef<any>();\n const toggleRef = React.useRef<HTMLButtonElement>();\n const menuRef = React.useRef<any>([]);\n const dropdownButtonId = React.useRef<string>('');\n\n const ref = useForkedRef(forwardedRef, ownRef);\n\n const [itemRefArray, registerDropdownMenuItem] = useDescendants();\n\n React.useEffect(() => {\n if (activeIndex >= 0) {\n setActiveItemIndex(activeIndex);\n }\n }, [activeIndex]);\n\n function openDropdown() {\n const [filteredItems] = getFilteredItem();\n\n setIsOpen(true);\n\n setTimeout(() => {\n filteredItems.length > 0 &&\n filteredItems[0].current &&\n filteredItems[0].current.focus();\n }, 0);\n\n onOpen && typeof onOpen === 'function' && onOpen();\n }\n\n function closeDropdown(event) {\n setIsOpen(false);\n\n if (onBeforeShiftFocus && typeof onBeforeShiftFocus === 'function') {\n event.preventMagmaFocus = handlePreventMagmaFocus;\n onBeforeShiftFocus(event);\n }\n\n onClose && typeof onClose === 'function' && onClose(event);\n }\n\n function getFilteredItem(): [any, number] {\n const filteredItems = itemRefArray.current.filter(\n itemRef => itemRef.current\n );\n const filteredItemIndex = filteredItems\n .map(filteredItem => filteredItem.current)\n .indexOf(document.activeElement);\n\n return [filteredItems, filteredItemIndex];\n }\n\n function handleKeyDown(event: React.KeyboardEvent) {\n if (event.key === 'Escape') {\n closeDropdown(event);\n }\n\n if (event.key === 'ArrowDown') {\n const [filteredItems, filteredItemIndex] = getFilteredItem();\n\n if (filteredItems.length === 0) {\n return;\n }\n\n event.preventDefault();\n\n if (\n filteredItemIndex === -1 ||\n filteredItemIndex === filteredItems.length - 1\n ) {\n filteredItems[0].current.focus();\n } else {\n filteredItems[filteredItemIndex + 1].current.focus();\n }\n }\n\n if (event.key === 'ArrowUp') {\n const [filteredItems, filteredItemIndex] = getFilteredItem();\n\n if (filteredItems.length === 0) {\n return;\n }\n\n event.preventDefault();\n\n if (filteredItemIndex === -1 || filteredItemIndex === 0) {\n filteredItems[filteredItems.length - 1].current.focus();\n } else {\n filteredItems[filteredItemIndex - 1].current.focus();\n }\n }\n }\n\n function handleDropdownBlur(event: React.FocusEvent) {\n const { currentTarget, relatedTarget } = event;\n\n const isInMenu =\n relatedTarget && currentTarget.contains(relatedTarget as Node);\n\n if (!isInMenu && isOpen) {\n closeDropdown(event);\n }\n }\n\n function handlePreventMagmaFocus() {}\n\n const maxHeightString =\n typeof maxHeight === 'number' ? `${maxHeight}px` : maxHeight;\n\n const widthString = typeof width === 'number' ? `${width}px` : width;\n\n return (\n <DropdownContext.Provider\n value={{\n activeItemIndex,\n alignment,\n closeDropdown,\n dropdownButtonId,\n dropDirection,\n handleDropdownBlur,\n itemRefArray,\n isFixedWidth: !!width,\n isOpen,\n maxHeight: maxHeightString,\n menuRef,\n openDropdown,\n registerDropdownMenuItem,\n setActiveItemIndex,\n setIsOpen,\n toggleRef,\n width: widthString,\n }}\n >\n <Container\n {...other}\n ref={ref}\n data-testid={testId}\n onKeyDown={isOpen ? handleKeyDown : null}\n onBlur={handleDropdownBlur}\n >\n {children}\n </Container>\n </DropdownContext.Provider>\n );\n }\n);\n","import { css } from '@emotion/core';\nimport * as React from 'react';\nimport { IconButton, ButtonIconPosition } from '../IconButton';\nimport {\n ArrowDropUpIcon,\n ArrowLeftIcon,\n ArrowRightIcon,\n ArrowDropDownIcon,\n IconProps,\n} from 'react-magma-icons';\nimport { DropdownContext, DropdownDropDirection } from './Dropdown';\nimport { Omit, useForkedRef, useGenerateId, XOR } from '../../utils';\nimport { ButtonProps, ButtonSize } from '../Button';\nimport { useIsInverse } from '../../inverse';\nimport styled from '../../theme/styled';\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport { ThemeInterface } from '../../theme/magma';\n\nexport interface IconOnlyDropdownButtonProps\n extends Omit<ButtonProps, 'children'> {\n /**\n * Icon to display within the component\n */\n icon?: React.ReactElement<IconProps>;\n /**\n * The text the screen reader will announce. Required for icon-only buttons\n */\n 'aria-label': string;\n}\n\nexport interface IconTextDropdownButtonProps extends ButtonProps {\n /**\n * Icon to display within the component\n */\n icon?: React.ReactElement<IconProps>;\n /**\n * Position within the button for the icon to appear\n * @default `ButtonIconPosition.right`\n */\n iconPosition?: ButtonIconPosition;\n /**\n * The content of the component\n */\n children: React.ReactChild | React.ReactChild[];\n}\n\nexport type DropdownButtonProps = XOR<\n IconOnlyDropdownButtonProps,\n IconTextDropdownButtonProps\n>;\n\nfunction instanceOfIconOnlyDropdownButton(\n object: any\n): object is IconOnlyDropdownButtonProps {\n return 'icon' in object && !('children' in object);\n}\n\nfunction getButtonPadding(theme: ThemeInterface, size?: ButtonSize) {\n switch (size) {\n case 'small':\n return theme.spaceScale.spacing02;\n case 'large':\n return theme.spaceScale.spacing05;\n default:\n return theme.spaceScale.spacing03;\n }\n}\n\nconst StyledIconButton = styled(IconButton)`\n ${props =>\n props.iconPosition === ButtonIconPosition.right &&\n props.children &&\n css`\n padding-right: ${getButtonPadding(props.theme, props.size)};\n `}\n ${props =>\n props.iconPosition === ButtonIconPosition.left &&\n props.children &&\n css`\n padding-left: ${getButtonPadding(props.theme, props.size)};\n `}\n`;\n\nexport const DropdownButton = React.forwardRef<\n HTMLButtonElement,\n DropdownButtonProps\n>((props, forwardedRef) => {\n const context = React.useContext(DropdownContext);\n const theme = React.useContext(ThemeContext);\n\n context.dropdownButtonId.current = useGenerateId(props.id);\n\n const ref = useForkedRef(context.toggleRef, forwardedRef);\n\n function getButtonIcon(dropDirection: DropdownDropDirection) {\n switch (dropDirection) {\n case DropdownDropDirection.left:\n return <ArrowLeftIcon testId=\"caretLeft\" />;\n case DropdownDropDirection.right:\n return <ArrowRightIcon testId=\"caretRight\" />;\n case DropdownDropDirection.up:\n return <ArrowDropUpIcon testId=\"caretUp\" />;\n\n default:\n return <ArrowDropDownIcon testId=\"caretDown\" />;\n }\n }\n\n const buttonIcon = getButtonIcon(context.dropDirection);\n\n let children;\n const { icon = buttonIcon, iconPosition, ...other } = props;\n\n const isInverse = useIsInverse(props.isInverse);\n\n if (!instanceOfIconOnlyDropdownButton(props)) {\n children = props.children;\n }\n\n function handleClick(event: React.SyntheticEvent) {\n if (context.isOpen) {\n context.closeDropdown(event);\n } else {\n context.openDropdown();\n }\n }\n\n const iconPositionToUse = props.icon\n ? iconPosition\n ? iconPosition\n : ButtonIconPosition.left\n : context.dropDirection === DropdownDropDirection.left\n ? ButtonIconPosition.left\n : ButtonIconPosition.right;\n\n return (\n <StyledIconButton\n {...other}\n aria-expanded={context.isOpen}\n aria-haspopup=\"true\"\n icon={icon}\n iconPosition={iconPositionToUse}\n id={context.dropdownButtonId.current}\n isInverse={isInverse}\n onClick={handleClick}\n ref={ref}\n theme={theme}\n >\n {children}\n </StyledIconButton>\n );\n});\n","import * as React from 'react';\nimport styled from '../../theme/styled';\nimport { css } from '@emotion/core';\nimport { Card } from '../Card';\nimport {\n DropdownContext,\n DropdownAlignment,\n DropdownDropDirection,\n} from './Dropdown';\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport { useForkedRef } from '../../utils';\n\n/**\n * @children required\n */\nexport interface DropdownContentProps\n extends React.HTMLAttributes<HTMLDivElement> {\n testId?: string;\n}\n\nconst StyledCard = styled(Card)<{\n alignment?: DropdownAlignment;\n dropDirection?: DropdownDropDirection;\n isOpen?: boolean;\n maxHeight?: string;\n width?: string;\n}>`\n display: ${props => (props.isOpen ? 'block' : 'none')};\n left: ${props => props.theme.spaceScale.spacing02};\n max-height: ${props =>\n props.maxHeight ? props.maxHeight : props.theme.dropdown.content.maxHeight};\n opacity: ${props => (props.isOpen ? '1' : '0')};\n outline: 0;\n overflow-y: auto;\n padding: ${props => props.theme.spaceScale.spacing03} 0;\n position: absolute;\n transition: opacity 0.3s;\n white-space: nowrap;\n z-index: 2;\n\n ${props =>\n props.width &&\n css`\n white-space: normal;\n width: ${props.width};\n `}\n\n ${props =>\n props.dropDirection === 'up' &&\n css`\n top: auto;\n bottom: 100%;\n `}\n\n ${props =>\n props.dropDirection === 'left' &&\n css`\n left: auto;\n right: 100%;\n top: ${props.theme.spaceScale.spacing02};\n `}\n\n ${props =>\n props.dropDirection === 'right' &&\n css`\n left: 100%;\n top: ${props.theme.spaceScale.spacing02};\n `}\n\n ${props =>\n props.alignment === 'end' &&\n props.dropDirection !== 'left' &&\n props.dropDirection !== 'right' &&\n css`\n left: auto;\n right: ${props.theme.spaceScale.spacing02};\n `}\n\n ${props =>\n props.alignment === 'end' &&\n (props.dropDirection === 'left' || props.dropDirection === 'right') &&\n css`\n bottom: ${props.theme.spaceScale.spacing02};\n top: auto;\n `}\n`;\n\nconst StyledDiv = styled.div`\n padding: ${props => props.theme.spaceScale.spacing02} 0;\n`;\n\nexport const DropdownContent = React.forwardRef<\n HTMLDivElement,\n DropdownContentProps\n>((props, forwardedRef) => {\n const { children, testId, ...other } = props;\n const context = React.useContext(DropdownContext);\n const theme = React.useContext(ThemeContext);\n const ref = useForkedRef(forwardedRef, context.menuRef);\n\n return (\n <StyledCard\n {...other}\n alignment={context.alignment}\n dropDirection={context.dropDirection}\n hasDropShadow\n isInverse={false}\n isOpen={context.isOpen}\n maxHeight={context.maxHeight}\n ref={ref}\n tabIndex={-1}\n testId={testId || 'dropdownContent'}\n theme={theme}\n width={context.width}\n >\n <StyledDiv\n aria-labelledby={context.dropdownButtonId.current}\n role=\"menu\"\n theme={theme}\n >\n {children}\n </StyledDiv>\n </StyledCard>\n );\n});\n","import * as React from 'react';\nimport styled from '../../theme/styled';\nimport { ThemeContext } from '../../theme/ThemeContext';\n\nexport interface DropdownDividerProps\n extends React.HTMLAttributes<HTMLHRElement> {\n testId?: string;\n}\n\nconst StyledHr = styled.hr`\n background: ${props => props.theme.colors.neutral06};\n border: 0;\n height: 1px;\n margin: ${props => props.theme.spaceScale.spacing02} 0;\n`;\n\nexport const DropdownDivider: React.FunctionComponent<DropdownDividerProps> = (\n props: DropdownDividerProps\n) => {\n const { testId, ...other } = props;\n\n const theme = React.useContext(ThemeContext);\n return <StyledHr {...other} data-testid={testId} theme={theme} />;\n};\n","import * as React from 'react';\nimport styled from '../../theme/styled';\nimport { ThemeContext } from '../../theme/ThemeContext';\n\n/**\n * @children required\n */\nexport interface DropdownHeaderProps\n extends React.HTMLAttributes<HTMLDivElement> {\n testId?: string;\n}\n\nconst StyledDiv = styled.div`\n color: ${props => props.theme.colors.neutral03};\n font-size: ${props => props.theme.typeScale.size01.fontSize};\n letter-spacing: ${props => props.theme.typeScale.size01.letterSpacing};\n line-height: ${props => props.theme.typeScale.size01.lineHeight};\n font-weight: bold;\n margin: 0;\n padding: ${props =>\n `${props.theme.spaceScale.spacing03} ${props.theme.spaceScale.spacing05} ${props.theme.spaceScale.spacing02}`};\n text-transform: uppercase;\n`;\n\nexport const DropdownHeader = React.forwardRef<\n HTMLDivElement,\n DropdownHeaderProps\n>((props, ref) => {\n const { children, testId, ...other } = props;\n\n const theme = React.useContext(ThemeContext);\n\n return (\n <StyledDiv {...other} data-testid={testId} theme={theme}>\n {children}\n </StyledDiv>\n );\n});\n","import * as React from 'react';\nimport { css } from '@emotion/core';\nimport styled from '../../theme/styled';\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport { I18nContext } from '../../i18n';\nimport { DropdownContext } from './Dropdown';\nimport { IconProps, CheckIcon } from 'react-magma-icons';\nimport { Omit, useForkedRef } from '../../utils';\n\nexport interface DropdownMenuItemProps\n extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onClick'> {\n /**\n * Leading icon for the menu item\n */\n icon?: React.ReactElement<IconProps>;\n /**\n * @internal\n */\n index?: number;\n /**\n * @internal\n */\n isActive?: boolean;\n /**\n * If true, item will be disabled; it will appear dimmed and onClick event (or any other events) will not fire\n * @default false\n */\n disabled?: boolean;\n /**\n * Action that fires when the menu item is clicked. If the menuitem also has a value prop, the value will be passed to the onClick handler\n */\n onClick?: (value?: string | number) => void;\n /**\n * Value of the component, gets passed to the onClick event\n */\n value?: string | number;\n}\n\nexport const MenuItemStyles = props => {\n return css`\n align-items: center;\n color: ${props.disabled\n ? props.theme.colors.disabledText\n : props.theme.colors.neutral};\n cursor: ${props.disabled ? 'not-allowed' : 'pointer'};\n display: flex;\n font-size: ${props.theme.typeScale.size03.fontSize};\n line-height: ${props.theme.typeScale.size03.lineHeight};\n margin: 0;\n padding: ${props.isInactive\n ? `${props.theme.spaceScale.spacing03} ${props.theme.spaceScale.spacing05} ${props.theme.spaceScale.spacing03} ${props.theme.spaceScale.spacing11}`\n : `${props.theme.spaceScale.spacing03} ${props.theme.spaceScale.spacing05}`};\n white-space: ${props.isFixedWidth ? 'normal' : 'nowrap'};\n\n &:hover,\n &:focus {\n background: ${props.disabled ? 'none' : props.theme.colors.neutral07};\n color: ${props.disabled\n ? props.theme.colors.disabledText\n : props.theme.colors.neutral};\n }\n\n &:focus {\n outline-offset: -3px;\n }\n `;\n};\n\nconst StyledItem = styled.div<{\n as?: string;\n disabled?: boolean;\n isFixedWidth?: boolean;\n isInactive?: boolean;\n value?: string | number;\n}>`\n ${MenuItemStyles}\n`;\n\nexport const IconWrapper = styled.span`\n color: ${props => props.theme.colors.neutral03};\n display: inline-flex;\n margin-right: ${props => props.theme.spaceScale.spacing05};\n\n svg {\n height: ${props => props.theme.iconSizes.medium}px;\n width: ${props => props.theme.iconSizes.medium}px;\n }\n`;\n\nexport const DropdownMenuItem = React.forwardRef<\n HTMLDivElement,\n DropdownMenuItemProps\n>((props, forwardedRef) => {\n const { children, disabled, icon, onClick, value, ...other } = props;\n\n const ownRef = React.useRef<HTMLDivElement>();\n const theme = React.useContext(ThemeContext);\n const context = React.useContext(DropdownContext);\n\n const ref = useForkedRef(forwardedRef, ownRef);\n\n const index = context.itemRefArray.current.findIndex(({ current: item }) => {\n if (!item || !ownRef.current) return false;\n\n return item === ownRef.current;\n });\n\n function handleClick(event: React.SyntheticEvent | React.KeyboardEvent) {\n if (context.activeItemIndex >= 0) {\n context.setActiveItemIndex(index);\n }\n\n if (onClick && !disabled) {\n onClick(value);\n }\n\n if (!disabled && context.activeItemIndex < 0) {\n context.closeDropdown(event);\n }\n }\n\n function handleKeyDown(event: React.KeyboardEvent) {\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n handleClick(event);\n }\n }\n\n const isActive =\n context.activeItemIndex >= 0 && context.activeItemIndex === index;\n\n const isInactive =\n context.activeItemIndex >= 0 && context.activeItemIndex !== index;\n\n React.useEffect(() => {\n if (!disabled)\n context.registerDropdownMenuItem(context.itemRefArray, ownRef);\n }, []);\n\n const i18n = React.useContext(I18nContext);\n\n return (\n <StyledItem\n {...other}\n aria-disabled={disabled}\n disabled={disabled}\n isFixedWidth={context.isFixedWidth}\n isInactive={isInactive}\n onClick={handleClick}\n onKeyDown={handleKeyDown}\n ref={disabled ? null : ref}\n role=\"menuitem\"\n theme={theme}\n tabIndex={disabled ? null : -1}\n value={value}\n >\n {icon && <IconWrapper theme={theme}>{icon}</IconWrapper>}\n {isActive && (\n <IconWrapper theme={theme}>\n <CheckIcon aria-label={i18n.dropdown.menuItemSelectedAriaLabel} />\n </IconWrapper>\n )}\n {children}\n </StyledItem>\n );\n});\n\nDropdownMenuItem.displayName = 'DropdownMenuItem';\n","import * as React from 'react';\nimport styled from '../../theme/styled';\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport { useForkedRef, useGenerateId } from '../../utils';\nimport { usePopper } from 'react-popper';\nimport { useIsInverse } from '../../inverse';\n\nexport enum TooltipPosition {\n bottom = 'bottom',\n left = 'left',\n right = 'right',\n top = 'top', //default\n}\n\nexport const EnumTooltipPosition = TooltipPosition;\n\nexport interface TooltipProps extends React.HTMLAttributes<HTMLDivElement> {\n /**\n * Style properties for the arrow element\n */\n arrowStyle?: React.CSSProperties;\n /**\n * The element that triggers the tooltip when it is hovered or focused. Must be a react element (not a string) and should be a focusable element to meet a11y requirements\n */\n children: React.ReactElement;\n /**\n * Style properties for the component container element which includes both the tooltip trigger and the tooltip popover content\n */\n containerStyle?: React.CSSProperties;\n /**\n * The content of the tooltip\n */\n content: React.ReactNode;\n isInverse?: boolean;\n /**\n * Override the default opening of the tooltip on hover/focus to remain open\n */\n open?: boolean;\n /**\n * Position the tooltip appears in relation to its trigger\n */\n position?: TooltipPosition;\n testId?: string;\n /**\n * Style properties for the inner tooltip content\n */\n tooltipStyle?: React.CSSProperties;\n}\n\nexport interface ITooltipState {\n id?: string;\n isVisible?: boolean;\n}\n\nconst TooltipContainer = styled.div`\n display: inline;\n pointer-events: auto;\n`;\n\nexport const TooltipArrow = styled.span<{\n position?: any;\n isInverse?: boolean;\n}>`\n &&,\n &&:before {\n display: block;\n height: ${props => props.theme.tooltip.arrowSizeDoubled};\n position: absolute;\n width: ${props => props.theme.tooltip.arrowSizeDoubled};\n z-index: -1;\n }\n\n &&::before {\n content: '';\n transform: rotate(45deg);\n background: ${props =>\n props.isInverse\n ? props.theme.tooltip.inverse.backgroundColor\n : props.theme.tooltip.backgroundColor};\n }\n`;\n\nexport const StyledTooltip = styled.div<{\n isInverse?: boolean;\n isVisible?: boolean;\n position: TooltipPosition;\n visible?: boolean;\n}>`\n background: ${props =>\n props.isInverse\n ? props.theme.tooltip.inverse.backgroundColor\n : props.theme.tooltip.backgroundColor};\n border-radius: ${props => props.theme.borderRadius};\n color: ${props =>\n props.isInverse\n ? props.theme.tooltip.inverse.textColor\n : props.theme.tooltip.textColor};\n font-size: ${props => props.theme.tooltip.typeScale.fontSize};\n letter-spacing: ${props => props.theme.tooltip.typeScale.letterSpacing};\n line-height: ${props => props.theme.tooltip.typeScale.lineHeight};\n font-weight: ${props => props.theme.tooltip.fontWeight};\n max-width: ${props => props.theme.tooltip.maxWidth};\n min-height: 2.5em;\n padding: ${props => props.theme.spaceScale.spacing03}\n ${props => props.theme.spaceScale.spacing04};\n z-index: ${props => props.theme.tooltip.zIndex};\n\n &[data-popper-placement='top'] {\n margin-bottom: 14px;\n & > span:last-child {\n bottom: 10px;\n }\n }\n\n &[data-popper-placement='bottom'] {\n margin-top: 14px;\n & > span:last-child {\n top: 10px;\n }\n }\n\n &[data-popper-placement='left'] {\n margin-right: 14px;\n & > span:last-child {\n right: 10px;\n }\n }\n\n &[data-popper-placement='right'] {\n margin-left: 14px;\n & > span:last-child {\n left: 10px;\n }\n }\n`;\n\n// Using any for the ref because it is put ont he passed in children which does not have a specific type\nexport const Tooltip = React.forwardRef<any, TooltipProps>((props, ref) => {\n const [isVisible, setIsVisible] = React.useState<boolean>(props.open);\n const [referenceElement, setReferenceElement] =\n React.useState<HTMLElement>(null);\n const [popperElement, setPopperElement] =\n React.useState<HTMLDivElement>(null);\n const [arrowElement, setArrowElement] = React.useState<HTMLSpanElement>(null);\n\n const { styles, attributes } = usePopper(referenceElement, popperElement, {\n modifiers: [\n { name: 'arrow', options: { element: arrowElement } },\n {\n name: 'offset',\n options: {\n offset: [0, 0],\n },\n },\n ],\n placement: props.position || TooltipPosition.top,\n });\n\n const combinedRef = useForkedRef(ref, setReferenceElement);\n\n React.useEffect(() => {\n const handleEsc = event => {\n if (event.key === 'Escape') {\n hideTooltip();\n }\n };\n window.addEventListener('keydown', handleEsc);\n\n return () => {\n window.removeEventListener('keydown', handleEsc);\n };\n }, []);\n\n function handleKeyDown(event: React.KeyboardEvent) {\n if (event.key === 'Escape') {\n hideTooltip();\n }\n }\n\n function showTooltip() {\n setIsVisible(true);\n }\n\n function hideTooltip() {\n setIsVisible(props.open);\n }\n\n const {\n arrowStyle,\n children,\n content,\n containerStyle,\n id: defaultId,\n position,\n testId,\n tooltipStyle,\n ...other\n } = props;\n\n const id = useGenerateId(defaultId);\n const theme = React.useContext(ThemeContext);\n\n if (Array.isArray(children)) {\n throw new Error('Tooltip children can only be one element.');\n }\n\n const tooltipTrigger = React.cloneElement(children, {\n 'aria-describedby': isVisible ? id : null,\n onBlur: hideTooltip,\n onFocus: showTooltip,\n ref: combinedRef,\n });\n\n const combinedTooltipStyles = {\n ...styles.popper,\n ...tooltipStyle,\n };\n\n const combinedArrowStyle = { ...styles.arrow, ...arrowStyle };\n\n const isInverse = useIsInverse(props.isInverse);\n\n return (\n <TooltipContainer\n {...other}\n data-testid={testId}\n onKeyDown={handleKeyDown}\n onMouseLeave={hideTooltip}\n onMouseEnter={showTooltip}\n style={containerStyle}\n >\n {tooltipTrigger}\n {isVisible && (\n <div\n ref={setPopperElement}\n style={combinedTooltipStyles}\n {...attributes.popper}\n >\n <StyledTooltip\n id={id}\n isInverse={isInverse}\n position={position ? position : TooltipPosition.top}\n theme={theme}\n role=\"tooltip\"\n {...attributes.popper}\n >\n {content}\n <TooltipArrow\n isInverse={isInverse}\n ref={setArrowElement}\n style={combinedArrowStyle}\n theme={theme}\n />\n </StyledTooltip>\n </div>\n )}\n </TooltipContainer>\n );\n});\n","import * as React from 'react';\n\nimport { Button, ButtonShape, ButtonStyles, ButtonVariant } from '../Button';\nimport { IconButton } from '../IconButton';\nimport { ArrowDropUpIcon, ArrowDropDownIcon } from 'react-magma-icons';\nimport { DropdownContext, DropdownDropDirection } from './Dropdown';\nimport { I18nContext } from '../../i18n';\nimport { useForkedRef, useGenerateId } from '../../utils';\nimport { ThemeContext } from '../../theme/ThemeContext';\n\nexport interface DropdownSplitButtonProps extends ButtonStyles {\n /**\n * The text the screen reader will announce. Required for icon-only buttons\n */\n 'aria-label': string;\n /**\n * The content of the component. If no children are provided, the button will render in an icon only style\n */\n children?: any;\n /**\n * Icon to display within the component\n */\n id?: string;\n /**\n * If true, element is disabled\n */\n disabled?: boolean;\n /**\n * Function that fires when the button is clicked\n */\n onClick?: () => void;\n}\n\nexport const DropdownSplitButton = React.forwardRef<\n HTMLButtonElement,\n DropdownSplitButtonProps\n>((props, forwardedRef) => {\n const {\n 'aria-label': ariaLabel,\n children,\n id,\n variant = ButtonVariant.solid,\n onClick,\n ...other\n } = props;\n\n const context = React.useContext(DropdownContext);\n\n const theme = React.useContext(ThemeContext);\n\n const ref = useForkedRef(forwardedRef, context.toggleRef);\n\n context.dropdownButtonId.current = useGenerateId(id);\n\n const buttonIcon =\n context.dropDirection === DropdownDropDirection.up ? (\n <ArrowDropUpIcon size={theme.iconSizes.medium} testId=\"caretUp\" />\n ) : (\n <ArrowDropDownIcon size={theme.iconSizes.medium} testId=\"caretDown\" />\n );\n\n function handleClick(event: React.SyntheticEvent) {\n if (context.isOpen) {\n context.closeDropdown(event);\n } else {\n context.openDropdown();\n }\n }\n\n const i18n = React.useContext(I18nContext);\n\n return (\n <>\n <Button\n {...other}\n id={context.dropdownButtonId.current}\n onClick={onClick}\n shape={ButtonShape.leftCap}\n style={{ borderRight: 0, marginRight: 0 }}\n variant={variant}\n >\n {children}\n </Button>\n <IconButton\n {...other}\n aria-expanded={context.isOpen}\n aria-label={ariaLabel ? ariaLabel : i18n.dropdown.toggleMenuAriaLabel}\n aria-haspopup=\"true\"\n icon={buttonIcon}\n onClick={handleClick}\n shape={ButtonShape.rightCap}\n style={{\n marginLeft:\n variant === ButtonVariant.outline ? 0 : theme.spaceScale.spacing01,\n }}\n ref={ref}\n variant={variant}\n />\n </>\n );\n});\n","import * as React from 'react';\nimport { IconButton } from '../IconButton';\nimport { ButtonColor, ButtonVariant } from '../Button';\nimport { EastIcon, WestIcon } from 'react-magma-icons';\nimport { Label } from '../Label';\nimport styled from '@emotion/styled';\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport { ThemeInterface } from '../../theme/magma';\nimport { I18nContext } from '../../i18n';\nimport { useIsInverse } from '../../inverse';\nimport { usePagination } from '../Pagination/usePagination';\nimport { XOR } from '../../utils';\nimport { useControlled } from '../../hooks/useControlled';\nimport {\n Dropdown,\n DropdownAlignment,\n DropdownDropDirection,\n DropdownButton,\n DropdownContent,\n DropdownMenuItem,\n} from '../Dropdown';\n\nexport interface BaseTablePaginationProps\n extends React.HTMLAttributes<HTMLDivElement> {\n /**\n * Position of the dropdown content\n * @default `DropdownDropDirection.up`\n */\n dropdownDropDirection?: DropdownDropDirection;\n /**\n * Total number of rows\n */\n itemCount: number;\n isInverse?: boolean;\n /**\n * Event that fires when the page number changes\n */\n onPageChange?: (event: React.SyntheticEvent, newPage: number) => void;\n /**\n * Event that fires when the number of rows per page changes\n */\n onRowsPerPageChange?: (newRowsPerPage: number) => void;\n /**\n * Values added to the rows per page select\n */\n rowsPerPageValues?: number[];\n testId?: string;\n}\n\nexport interface ControlledPageProps {\n /**\n * Current page number\n */\n page?: number;\n}\n\nexport interface UncontrolledPageProps {\n /**\n * Page selected by default when the component is uncontrolled\n * @default 1\n */\n defaultPage?: number;\n}\n\nexport type PagePaginationProps = XOR<\n ControlledPageProps,\n UncontrolledPageProps\n>;\n\nexport interface ControlledRowsPerPageProps {\n /**\n * Number of rows per page\n */\n rowsPerPage?: number;\n}\n\nexport interface UncontrolledRowsPerPageProps {\n /**\n * Number of rows per page by default when component is uncontrolled\n * @default 10\n */\n defaultRowsPerPage?: number;\n}\n\nexport type RowsPaginationProps = XOR<\n ControlledRowsPerPageProps,\n UncontrolledRowsPerPageProps\n>;\n\nexport type TablePaginationProps = BaseTablePaginationProps &\n PagePaginationProps &\n RowsPaginationProps;\n\nconst StyledContainer = styled.div<{\n isInverse?: boolean;\n theme: ThemeInterface;\n}>`\n align-items: center;\n background: ${props =>\n props.isInverse ? props.theme.colors.tint03 : props.theme.colors.neutral07};\n border-top: 1px solid\n ${props =>\n props.isInverse\n ? props.theme.colors.neutral08\n : props.theme.colors.neutral06};\n display: flex;\n justify-content: flex-end;\n padding: ${props => props.theme.spaceScale.spacing02};\n`;\n\nconst PageCount = styled(Label)<{ theme: ThemeInterface }>`\n margin: 0 ${props => props.theme.spaceScale.spacing08};\n`;\n\nconst RowsPerPageLabel = styled.span`\n font-weight: 600;\n line-height: 20px;\n margin: 0 16px 0 0;\n text-align: left;\n`;\n\nexport const TablePagination = React.forwardRef<\n HTMLDivElement,\n TablePaginationProps\n>((props, ref) => {\n const {\n testId,\n defaultPage,\n defaultRowsPerPage = 10,\n dropdownDropDirection = DropdownDropDirection.up,\n itemCount,\n onPageChange,\n onRowsPerPageChange,\n page: pageProp,\n rowsPerPage: rowsPerPageProp,\n rowsPerPageValues = [10, 20, 50, 100],\n ...other\n } = props;\n\n const theme = React.useContext(ThemeContext);\n const i18n = React.useContext(I18nContext);\n\n const isInverse = useIsInverse(props.isInverse);\n\n const [rowsPerPage, setRowsPerPageState] = useControlled({\n controlled: rowsPerPageProp,\n default: defaultRowsPerPage,\n });\n\n const { page, pageButtons, setPageState } = usePagination({\n count: itemCount / rowsPerPage,\n defaultPage,\n numberOfEdgePages: 0,\n numberOfAdjacentPages: 0,\n onPageChange,\n page: pageProp,\n });\n\n const [activeIndex, setActiveIndex] = React.useState(rowsPerPage);\n const isLastPage = page * rowsPerPage >= itemCount;\n\n const displayPageStart = (page - 1) * rowsPerPage + 1;\n const displayPageEnd = isLastPage ? itemCount : page * rowsPerPage;\n\n const rowsPerPageItems = rowsPerPageValues.map(value => ({\n label: value.toString(),\n value,\n }));\n\n function handleRowsPerPageChange(value: number) {\n if (!pageProp) {\n setPageState(1);\n\n onPageChange &&\n typeof onPageChange === 'function' &&\n onPageChange({} as React.SyntheticEvent, 1);\n }\n\n if (!rowsPerPageProp) {\n setRowsPerPageState(value);\n }\n\n onRowsPerPageChange &&\n typeof onRowsPerPageChange === 'function' &&\n onRowsPerPageChange(value);\n setActiveIndex(rowsPerPage);\n }\n\n const previousButton = pageButtons[0];\n const nextButton = pageButtons[pageButtons.length - 1];\n\n return (\n <StyledContainer\n {...other}\n data-testid={testId}\n isInverse={isInverse}\n ref={ref}\n theme={theme}\n >\n <RowsPerPageLabel>\n {i18n.table.pagination.rowsPerPageLabel}:\n </RowsPerPageLabel>\n <Dropdown\n alignment={DropdownAlignment.end}\n dropDirection={dropdownDropDirection}\n activeIndex={activeIndex}\n >\n <DropdownButton\n aria-label={i18n.table.pagination.rowsPerPageLabel}\n color={ButtonColor.secondary}\n style={{ minWidth: 0 }}\n testId=\"rowPerPageDropdownButton\"\n >\n {rowsPerPageItems.find(item => item.value === rowsPerPage).label}\n </DropdownButton>\n <DropdownContent>\n {rowsPerPageItems.map((row, index) => (\n <DropdownMenuItem\n key={index}\n onClick={handleRowsPerPageChange}\n value={row.value}\n >\n {row.label}\n </DropdownMenuItem>\n ))}\n </DropdownContent>\n </Dropdown>\n\n <PageCount isInverse={isInverse} theme={theme}>\n {`${displayPageStart}-${displayPageEnd} ${i18n.table.pagination.ofLabel} ${itemCount}`}\n </PageCount>\n\n <IconButton\n aria-label={i18n.table.pagination.previousAriaLabel}\n color={ButtonColor.secondary}\n disabled={previousButton.disabled}\n icon={<WestIcon />}\n isInverse={isInverse}\n onClick={previousButton.onClick}\n testId=\"previousBtn\"\n variant={ButtonVariant.link}\n />\n <IconButton\n aria-label={i18n.table.pagination.nextAriaLabel}\n color={ButtonColor.secondary}\n disabled={nextButton.disabled}\n icon={<EastIcon />}\n isInverse={isInverse}\n onClick={nextButton.onClick}\n testId=\"nextBtn\"\n variant={ButtonVariant.link}\n />\n </StyledContainer>\n );\n});\n","import * as React from 'react';\nimport styled from '../../theme/styled';\nimport { css } from '@emotion/core';\nimport { TableContext, TableRowColor, TableCell, TableHeaderCell } from './';\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport { Checkbox } from '../Checkbox';\nimport {\n IndeterminateCheckbox,\n IndeterminateCheckboxStatus,\n} from '../IndeterminateCheckbox';\n\n/**\n * @children required\n */\nexport interface TableRowProps\n extends React.HTMLAttributes<HTMLTableRowElement> {\n /**\n * The color scheme of the table row, giving contextual meaning to the content\n */\n color?: TableRowColor;\n headerRowStatus?: IndeterminateCheckboxStatus;\n isSelected?: boolean;\n isSelectableDisabled?: boolean;\n onHeaderRowSelect?: (event: React.ChangeEvent<HTMLInputElement>) => void;\n onTableRowSelect?: (event: React.ChangeEvent<HTMLInputElement>) => void;\n rowIndex?: number;\n testId?: string;\n}\n\nfunction buildTableRowBackground(props) {\n switch (props.color) {\n case 'success':\n return props.theme.colors.success;\n case 'warning':\n return props.theme.colors.pop04;\n case 'danger':\n return props.theme.colors.danger;\n case 'info':\n return props.theme.colors.primary;\n default:\n return 'inherit';\n }\n}\n\nfunction buildTableRowColor(props) {\n if (props.color === 'warning') {\n return props.theme.colors.neutral;\n }\n\n if (props.color) {\n return props.theme.colors.neutral08;\n }\n\n return 'inherit';\n}\n\nconst StyledTableRow = styled.tr<{\n color?: string;\n hasHoverStyles?: boolean;\n hasZebraStripes?: boolean;\n isInverse?: boolean;\n}>`\n border-bottom: 1px solid\n ${props =>\n props.isInverse\n ? props.theme.colors.tint04\n : props.theme.colors.neutral06};\n color: inherit;\n display: table-row;\n outline: 0;\n vertical-align: top;\n\n &:last-child {\n border-bottom: 0;\n }\n\n ${props =>\n !props.color &&\n css`\n &:nth-of-type(even) {\n background: ${props.hasZebraStripes\n ? props.isInverse\n ? props.theme.colors.tint\n : props.theme.colors.tone\n : 'none'};\n }\n `};\n\n ${props =>\n props.hasHoverStyles &&\n !props.color &&\n css`\n &:hover {\n background: ${\n props.isInverse ? props.theme.colors.tint02 : props.theme.colors.tone02\n };\n `}\n\n ${props =>\n props.color &&\n css`\n background: ${buildTableRowBackground(props)};\n color: ${buildTableRowColor(props)};\n `};\n`;\n\nexport const TableRow = React.forwardRef<HTMLTableRowElement, TableRowProps>(\n (props, ref) => {\n const {\n children,\n headerRowStatus,\n isSelected,\n isSelectableDisabled,\n onHeaderRowSelect,\n onTableRowSelect,\n rowIndex,\n testId,\n ...other\n } = props;\n const theme = React.useContext(ThemeContext);\n const tableContext = React.useContext(TableContext);\n\n let isHeaderRow = false;\n\n React.Children.forEach(children, (child: any) => {\n if (child.type.displayName === 'TableHeaderCell') {\n isHeaderRow = true;\n return;\n }\n });\n\n function getIsCheckboxInverse() {\n if (props.color && props.color === TableRowColor.warning) {\n return false;\n }\n if (props.color && props.color !== TableRowColor.warning) {\n return true;\n }\n\n return tableContext.isInverse;\n }\n\n return (\n <StyledTableRow\n {...other}\n data-testid={testId}\n hasHoverStyles={tableContext.hasHoverStyles && !isHeaderRow}\n hasZebraStripes={tableContext.hasZebraStripes}\n isInverse={tableContext.isInverse}\n ref={ref}\n theme={theme}\n >\n {tableContext.isSelectable && isHeaderRow && (\n <TableHeaderCell width={theme.spaceScale.spacing05}>\n <IndeterminateCheckbox\n status={headerRowStatus}\n isInverse={getIsCheckboxInverse()}\n labelStyle={{ padding: 0 }}\n labelText=\"Select all rows\"\n isTextVisuallyHidden\n onChange={onHeaderRowSelect}\n />\n </TableHeaderCell>\n )}\n {tableContext.isSelectable && !isHeaderRow && (\n <TableCell\n width={theme.spaceScale.spacing05}\n style={{ verticalAlign: 'middle' }}\n >\n <Checkbox\n checked={isSelected}\n disabled={isSelectableDisabled}\n labelStyle={{ padding: 0 }}\n labelText={`Select row ${rowIndex} of ${tableContext.rowCount}`}\n isTextVisuallyHidden\n isInverse={getIsCheckboxInverse()}\n onChange={onTableRowSelect}\n />\n </TableCell>\n )}\n\n {children}\n </StyledTableRow>\n );\n }\n);\n","import * as React from 'react';\nimport { TablePagination } from '../Table';\nimport { DatagridComponents } from './Datagrid';\n\nexport const DefaultPagination = props => {\n return <TablePagination {...props} />;\n};\n\nexport function defaultComponents<T>(components: DatagridComponents) {\n return {\n Pagination: DefaultPagination,\n ...components,\n };\n}\n","import * as React from 'react';\nimport { useControlled } from '../../hooks/useControlled';\nimport { useDataPagination } from '../../hooks/useDataPagination';\nimport { XOR } from '../../utils';\nimport { IndeterminateCheckboxStatus } from '../IndeterminateCheckbox';\nimport {\n Table,\n TableBody,\n TableRow,\n TableCell,\n TableHead,\n TableHeaderCell,\n TableProps,\n TableHeaderCellProps,\n TableRowColor,\n TablePaginationProps,\n} from '../Table';\nimport { defaultComponents } from './components';\n\nexport interface DatagridColumn extends TableHeaderCellProps {\n /**\n * Unique identifier for each column\n */\n field: string;\n /**\n * Header text for each column\n */\n header: string;\n /**\n * @default false\n * Set to true if you want the column to be the header for each row\n */\n isRowHeader?: boolean;\n}\n\nexport interface DatagridRow {\n /**\n * Unique identifier for each row\n */\n id: string | number;\n /**\n * The color scheme of the table row, giving contextual meaning to the content\n */\n color?: TableRowColor;\n /**\n * If true, the select box will be disabled\n */\n isSelectableDisabled?: boolean;\n /**\n * Used to allow each unique column field as a key with the row content as the value\n */\n [key: string]: any;\n}\n\nexport interface DatagridComponents {\n Pagination?: React.FunctionComponent<TablePaginationProps>;\n}\n\nexport interface DatagridComponentsProps {\n pagination?: Partial<\n Omit<\n TablePaginationProps,\n 'page' | 'defaultPage' | 'rowsPerPage' | 'defaultRowsPerPage'\n >\n >;\n}\n\n/**\n * @children required\n */\nexport interface BaseDatagridProps extends TableProps {\n /**\n * Column data to be displayed in the table header\n */\n columns: DatagridColumn[];\n /**\n * Custom components to replace internally used components with\n * @default { Pagination }\n */\n components?: DatagridComponents;\n /**\n * Props to be passed to the default components used internally to build the datagrid\n */\n componentsProps?: DatagridComponentsProps;\n /**\n * Pass in false to turn off pagination\n * @default true\n */\n hasPagination?: boolean;\n /**\n * Row data to be displayed in each row in the table\n */\n rows: DatagridRow[];\n /**\n * Function called when the checkbox in the table header is clicked on\n */\n onHeaderSelect?: (event: React.ChangeEvent<HTMLInputElement>) => void;\n /**\n * Function called when the checkbox in each table row is clicked on\n */\n onRowSelect?: (\n id: string | number,\n event: React.ChangeEvent<HTMLInputElement>\n ) => void;\n /**\n * Function called when the rows selected in the table changes\n */\n onSelectedRowsChange?: (newSelectedRows: (string | number)[]) => void;\n /**\n * Pagination data used to create the pagination footer. Created using the usePagination hook.\n */\n paginationProps?: Partial<TablePaginationProps>;\n}\n\nexport interface ControlledSelectedRowsProps {\n /**\n * Array of rows that are selected in the table when component is controlled\n */\n selectedRows?: (string | number)[];\n}\n\nexport interface UncontrolledSelectedRowsProps {\n /**\n * Array of rows that are selected in the table on render when component is uncontrolled\n */\n defaultSelectedRows?: (string | number)[];\n}\n\nexport type DatagridSelectedRowsProps = XOR<\n ControlledSelectedRowsProps,\n UncontrolledSelectedRowsProps\n>;\n\nexport type DatagridProps = BaseDatagridProps & DatagridSelectedRowsProps;\n\nexport const Datagrid = React.forwardRef<HTMLTableElement, DatagridProps>(\n (props, ref) => {\n const {\n columns,\n components: customComponents,\n componentsProps = {},\n defaultSelectedRows = [],\n onHeaderSelect,\n onRowSelect,\n onSelectedRowsChange,\n paginationProps = {},\n rows,\n selectedRows: selectedRowsProp,\n hasPagination = true,\n ...other\n } = props;\n const [rowsToShow, setRowsToShow] = React.useState<DatagridRow[]>([]);\n const [selectedRows, updatedSelectedRows] = useControlled({\n controlled: selectedRowsProp,\n default: defaultSelectedRows,\n });\n\n const isControlled = selectedRowsProp ? true : false;\n\n const {\n getPageItems,\n itemsPerPage: rowsPerPage,\n onItemsPerPageChange,\n } = useDataPagination({\n defaultItemsPerPage: paginationProps.defaultRowsPerPage,\n items: rows,\n itemsPerPage: paginationProps.rowsPerPage,\n onItemsPerPageChange: paginationProps.onRowsPerPageChange,\n });\n\n const [currentPage, setCurrentPage] = useControlled({\n controlled: paginationProps.page,\n default: paginationProps.defaultPage || 1,\n });\n\n React.useEffect(() => {\n setRowsToShow(hasPagination ? getPageItems(currentPage) : rows);\n }, [currentPage, rowsPerPage]);\n\n const { Pagination } = defaultComponents({\n ...customComponents,\n });\n\n const { defaultPage: _, ...passedOnPaginationProps } = paginationProps;\n\n passedOnPaginationProps.page = currentPage;\n passedOnPaginationProps.itemCount = rows.length;\n passedOnPaginationProps.rowsPerPage = rowsPerPage;\n passedOnPaginationProps.onRowsPerPageChange = onItemsPerPageChange;\n passedOnPaginationProps.onPageChange = React.useCallback(\n (event, newPage: number) => {\n if (!paginationProps.page) {\n setCurrentPage(newPage);\n }\n\n paginationProps.onPageChange &&\n typeof paginationProps.onPageChange === 'function' &&\n paginationProps.onPageChange(event, newPage);\n },\n [paginationProps.onPageChange]\n );\n\n const filteredRows = rowsToShow.filter(row => !row.isSelectableDisabled);\n\n const headerRowStatus =\n selectedRows.length === filteredRows.length\n ? IndeterminateCheckboxStatus.checked\n : selectedRows.length > 0\n ? IndeterminateCheckboxStatus.indeterminate\n : IndeterminateCheckboxStatus.unchecked;\n\n function handleRowSelect(\n id: string | number,\n event: React.ChangeEvent<HTMLInputElement>\n ) {\n const { checked } = event.target;\n const newSelectedRows = [...selectedRows];\n\n checked\n ? newSelectedRows.push(id)\n : newSelectedRows.splice(newSelectedRows.indexOf(id), 1);\n\n handleSelectedRowsChange(newSelectedRows);\n\n onRowSelect &&\n typeof onRowSelect === 'function' &&\n onRowSelect(id, event);\n }\n\n function handleHeaderSelect(event: React.ChangeEvent<HTMLInputElement>) {\n if (\n headerRowStatus === IndeterminateCheckboxStatus.indeterminate ||\n headerRowStatus === IndeterminateCheckboxStatus.checked\n ) {\n handleSelectedRowsChange([]);\n } else {\n handleSelectedRowsChange(filteredRows.map(row => row.id));\n }\n\n onHeaderSelect &&\n typeof onHeaderSelect === 'function' &&\n onHeaderSelect(event);\n }\n\n function handleSelectedRowsChange(newSelectedRows) {\n if (isControlled) {\n onSelectedRowsChange &&\n typeof onSelectedRowsChange === 'function' &&\n onSelectedRowsChange(newSelectedRows);\n } else {\n updatedSelectedRows(newSelectedRows);\n }\n }\n\n return (\n <>\n <Table {...other} ref={ref}>\n <TableHead>\n <TableRow\n headerRowStatus={headerRowStatus}\n onHeaderRowSelect={handleHeaderSelect}\n >\n {columns.map(({ field, header, ...other }) => (\n <TableHeaderCell\n key={`headercell${field}`}\n {...other}\n isRowHeader={false}\n >\n {header}\n </TableHeaderCell>\n ))}\n </TableRow>\n </TableHead>\n\n <TableBody>\n {rowsToShow.map(({ id, color, isSelectableDisabled, ...other }) => (\n <TableRow\n key={`row${id}`}\n color={color}\n isSelected={\n selectedRows ? selectedRows.indexOf(id) > -1 : false\n }\n isSelectableDisabled={isSelectableDisabled}\n onTableRowSelect={event => handleRowSelect(id, event)}\n >\n {columns.map(({ field, isRowHeader }: DatagridColumn) => {\n return isRowHeader ? (\n <TableHeaderCell\n key={`cell${field}`}\n isRowHeader={isRowHeader}\n >\n {other[field]}\n </TableHeaderCell>\n ) : (\n <TableCell key={`cell${field}`}>{other[field]}</TableCell>\n );\n })}\n </TableRow>\n ))}\n </TableBody>\n </Table>\n {hasPagination && (\n <Pagination\n isInverse={props.isInverse}\n itemCount={rows.length}\n {...passedOnPaginationProps}\n {...componentsProps.pagination}\n />\n )}\n </>\n );\n }\n);\n","import * as React from 'react';\n\nexport interface CalendarContextInterface {\n chosenDate: Date;\n focusedDate: Date;\n dateFocused?: boolean;\n maxDate?: Date;\n minDate?: Date;\n helperInformationShown?: boolean;\n buildCalendarMonth: (date: Date, enableOutsideDates?: boolean) => Date[][];\n showHelperInformation: () => void;\n hideHelperInformation: () => void;\n onDateChange: (day: Date, event: React.SyntheticEvent) => void;\n onKeyDown: (event: React.KeyboardEvent) => void;\n onPrevMonthClick: () => void;\n onNextMonthClick: () => void;\n setDateFocused: (value: boolean) => void;\n}\n\nexport const CalendarContext = React.createContext<CalendarContextInterface>({\n chosenDate: new Date(),\n focusedDate: new Date(),\n buildCalendarMonth: (newDate: Date, enableOutsideDates: boolean) => [\n [newDate],\n ],\n showHelperInformation: () => {},\n hideHelperInformation: () => {},\n onDateChange: (newDate: Date, event: React.SyntheticEvent) => {},\n onKeyDown: (event: React.KeyboardEvent) => {},\n onPrevMonthClick: () => {},\n onNextMonthClick: () => {},\n setDateFocused: (value: boolean) => {},\n});\n","import {\n subDays,\n subWeeks,\n subMonths,\n addDays,\n addWeeks,\n addMonths,\n getDay,\n format,\n startOfWeek,\n endOfWeek,\n startOfMonth,\n endOfMonth,\n differenceInDays,\n} from 'date-fns';\nimport { enUS } from 'date-fns/locale';\n\nexport function handleKeyPress(\n e: React.KeyboardEvent,\n prevDate: Date,\n toggleCalendar?: (calendarOpened: boolean) => void,\n showHelperInformation?: () => void,\n onDateChange?: (day: Date) => void,\n iconRef?: React.RefObject<any>\n) {\n const { key } = e;\n\n if (key === 'Enter' || key === ' ') {\n if (!(e.target as HTMLElement).getAttribute('aria-disabled')) {\n onDateChange(prevDate);\n }\n }\n\n switch (key) {\n case 'ArrowUp':\n e.preventDefault();\n return subWeeks(prevDate, 1);\n\n case 'ArrowLeft':\n e.preventDefault();\n return subDays(prevDate, 1);\n\n case 'Home':\n e.preventDefault();\n return startOfWeek(prevDate);\n\n case 'PageUp':\n e.preventDefault();\n return subMonths(prevDate, 1);\n\n case 'ArrowDown':\n e.preventDefault();\n return addWeeks(prevDate, 1);\n\n case 'ArrowRight':\n e.preventDefault();\n return addDays(prevDate, 1);\n\n case 'End':\n e.preventDefault();\n return endOfWeek(prevDate);\n\n case 'PageDown':\n e.preventDefault();\n return addMonths(prevDate, 1);\n\n case 'Escape':\n e.preventDefault();\n toggleCalendar(false);\n iconRef.current.focus();\n break;\n\n case '?':\n e.preventDefault();\n showHelperInformation();\n break;\n\n default:\n break;\n }\n}\n\nexport function getCalendarMonthWeeks(\n month,\n enableOutsideDays,\n firstDayOfWeek = 0\n): Date[][] {\n const firstOfMonth = startOfMonth(month);\n const lastOfMonth = endOfMonth(month);\n\n const prevDays = (getDay(firstOfMonth) + 7 - firstDayOfWeek) % 7;\n const nextDays = (firstDayOfWeek + 6 - getDay(lastOfMonth)) % 7;\n const firstDay = subDays(firstOfMonth, prevDays);\n const lastDay = addDays(lastOfMonth, nextDays);\n\n const totalDays = differenceInDays(lastDay, firstDay) + 1;\n\n const currentDay = firstDay;\n const weeksInMonth = [];\n\n for (let i = 0; i < totalDays; i += 1) {\n if (i % 7 === 0) {\n weeksInMonth.push([]);\n }\n\n let day = null;\n if ((i >= prevDays && i < totalDays - nextDays) || enableOutsideDays) {\n day = addDays(currentDay, i);\n }\n\n weeksInMonth[weeksInMonth.length - 1].push(day);\n }\n\n return weeksInMonth;\n}\n\nexport function getPrevMonthFromDate(prevDate) {\n return startOfMonth(subMonths(prevDate, 1));\n}\n\nexport function getNextMonthFromDate(prevDate) {\n return startOfMonth(addMonths(prevDate, 1));\n}\n\nexport function i18nFormat(date, formatStr = 'PP', locale = enUS) {\n return (\n date &&\n format(getDateFromString(date), formatStr, {\n locale,\n })\n );\n}\n\nexport function getDateFromString(date) {\n return date ? (date instanceof Date ? date : new Date(date)) : null;\n}\n","import * as React from 'react';\nimport { Announce } from '../Announce';\nimport { CalendarContext } from './CalendarContext';\nimport { ArrowBackIcon, ArrowForwardIcon } from 'react-magma-icons';\nimport { ButtonType, ButtonVariant } from '../Button';\nimport { IconButton } from '../IconButton';\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport { addMonths, subMonths } from 'date-fns';\nimport { enUS } from 'date-fns/locale';\nimport styled from '../../theme/styled';\nimport { useForkedRef, usePrevious } from '../../utils';\nimport { i18nFormat as format } from './utils';\nimport { I18nContext } from '../../i18n';\n\ninterface CalendarHeaderProps {\n focusHeader?: boolean;\n}\n\nconst CalendarHeaderContainer = styled.div`\n align-items: center;\n display: flex;\n padding: ${props => props.theme.spaceScale.spacing10} 0\n ${props => props.theme.spaceScale.spacing03};\n margin-top: -${props => props.theme.spaceScale.spacing01};\n`;\n\nconst CalendarIconButton = styled.div<{ next?: boolean }>`\n flex-grow: 0;\n flex-width: 10%;\n flex-basis: 10%;\n order: ${props => (props.next ? 2 : 0)};\n`;\n\nconst CalendarHeaderText = styled.div`\n caption-side: initial;\n color: ${props => props.theme.colors.neutral};\n font-size: ${props => props.theme.typeScale.size03.fontSize};\n line-height: ${props => props.theme.typeScale.size03.lineHeight};\n order: 1;\n text-align: center;\n flex-grow: 0;\n flex-width: 90%;\n flex-basis: 90%;\n`;\n\nexport const CalendarHeader = React.forwardRef<\n HTMLDivElement,\n CalendarHeaderProps\n>((props, forwardedRef) => {\n const calendarHeader = React.useRef<HTMLDivElement>();\n const { focusedDate, onPrevMonthClick, onNextMonthClick } =\n React.useContext(CalendarContext);\n const prevFocusHeader = usePrevious(props.focusHeader);\n const ref = useForkedRef(forwardedRef, calendarHeader);\n\n React.useEffect(() => {\n if (!prevFocusHeader && props.focusHeader) {\n calendarHeader.current.focus();\n }\n }, [props.focusHeader]);\n\n const theme = React.useContext(ThemeContext);\n const i18n = React.useContext(I18nContext);\n\n const locale = i18n.locale || enUS;\n\n const currentMonth = format(focusedDate, 'MMMM yyyy', locale);\n\n const capitalizeCurrentMonth =\n currentMonth &&\n currentMonth.charAt(0).toUpperCase() + currentMonth.slice(1);\n\n return (\n <CalendarHeaderContainer theme={theme}>\n <CalendarHeaderText tabIndex={-1} theme={theme} ref={ref}>\n <Announce>{capitalizeCurrentMonth}</Announce>\n </CalendarHeaderText>\n <CalendarIconButton>\n <IconButton\n aria-label={`${i18n.datePicker.previousMonthAriaLabel} ${format(\n subMonths(new Date(focusedDate), 1),\n 'MMMM yyyy',\n locale\n )}`}\n icon={<ArrowBackIcon />}\n type={ButtonType.button}\n variant={ButtonVariant.link}\n onClick={onPrevMonthClick}\n />\n </CalendarIconButton>\n <CalendarIconButton next>\n <IconButton\n aria-label={`${i18n.datePicker.nextMonthAriaLabel} ${format(\n addMonths(new Date(focusedDate), 1),\n 'MMMM yyyy',\n locale\n )}`}\n icon={<ArrowForwardIcon />}\n type={ButtonType.button}\n variant={ButtonVariant.link}\n onClick={onNextMonthClick}\n />\n </CalendarIconButton>\n </CalendarHeaderContainer>\n );\n});\n","import * as React from 'react';\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport styled from '../../theme/styled';\nimport { isAfter, isBefore, isSameDay } from 'date-fns';\nimport { enUS } from 'date-fns/locale';\nimport { CalendarContext } from './CalendarContext';\nimport { I18nContext } from '../../i18n';\nimport { i18nFormat as format } from './utils';\n\ninterface CalendarDayProps {\n day: Date;\n dayFocusable?: boolean;\n onDateChange?: (day: Date, event: React.SyntheticEvent) => void;\n}\n\nconst CalendarDayCell = styled.td`\n border: 1px solid ${props => props.theme.colors.neutral06};\n color: ${props => props.theme.colors.neutral};\n font-size: ${props => props.theme.typeScale.size03.fontSize};\n line-height: ${props => props.theme.typeScale.size03.lineHeight};\n height: ${props => props.theme.spaceScale.spacing09};\n padding: 0;\n position: relative;\n text-align: center;\n width: ${props => props.theme.spaceScale.spacing09};\n`;\n\nconst CalendarDayInner = styled.button<{\n isChosen?: boolean;\n isFocused?: boolean;\n disabled?: boolean;\n}>`\n align-items: center;\n background: ${props =>\n props.isChosen\n ? props.theme.colors.foundation02\n : props.theme.colors.neutral08};\n border: 2px solid transparent;\n border-radius: 100%;\n color: ${props =>\n props.isChosen\n ? props.theme.colors.neutral08\n : props.disabled\n ? props.theme.colors.disabledText\n : props.theme.colors.neutral};\n cursor: ${props => (props.disabled ? 'not-allowed' : 'pointer')};\n display: flex;\n height: calc(${props => props.theme.spaceScale.spacing09} - 4px);\n justify-content: center;\n margin: ${props => props.theme.spaceScale.spacing01};\n overflow: hidden;\n outline-offset: 0;\n position: relative;\n transition: background 0.5s ease-in-out 0s;\n width: calc(${props => props.theme.spaceScale.spacing09} - 4px);\n\n &:focus {\n outline: 2px dotted ${props => props.theme.colors.focus};\n }\n\n &:before {\n background: ${props => props.theme.colors.neutral};\n content: '';\n height: 200%;\n left: 0;\n opacity: 0;\n position: absolute;\n top: -50%;\n transition: 0.2s;\n width: 200%;\n }\n\n &:hover {\n &:before {\n opacity: ${props => (props.disabled ? 0 : 0.1)};\n }\n }\n`;\n\nconst EmptyCell = styled.td`\n border: 0;\n padding: 0;\n`;\n\nconst TodayIndicator = styled.span`\n border-left: 8px solid ${props => props.theme.colors.pop};\n border-top: 8px solid transparent;\n border-bottom: 8px solid transparent;\n bottom: -6px;\n display: block;\n height: 0;\n position: absolute;\n transform: rotate(45deg);\n right: -2px;\n width: 0;\n`;\n\nexport const CalendarDay: React.FunctionComponent<CalendarDayProps> = (\n props: CalendarDayProps\n) => {\n const dayRef = React.useRef<HTMLButtonElement>();\n const {\n dateFocused,\n focusedDate,\n chosenDate,\n maxDate,\n minDate,\n setDateFocused,\n onDateChange,\n } = React.useContext(CalendarContext);\n const [focused, setFocused] = React.useState<boolean>(false);\n const { day, dayFocusable } = props;\n\n React.useEffect(() => {\n if (dateFocused && isSameDay(props.day, focusedDate)) {\n dayRef.current.focus();\n setFocused(true);\n } else {\n if (focused) {\n setFocused(false);\n }\n }\n }, [focusedDate, dateFocused]);\n\n function onCalendarDayFocus() {\n setDateFocused(true);\n }\n\n function onDayClick(event: React.SyntheticEvent) {\n if (disabled) {\n event.preventDefault();\n return;\n }\n\n onDateChange(day, event);\n }\n\n const disabled: boolean =\n (maxDate ? isAfter(props.day, maxDate) : false) ||\n (minDate ? isBefore(props.day, minDate) : false);\n\n const theme = React.useContext(ThemeContext);\n const i18n = React.useContext(I18nContext);\n\n if (day) {\n const sameDateAsFocusedDate = isSameDay(day, focusedDate);\n const sameDateAsChosenDate = isSameDay(day, chosenDate);\n const sameDateAsToday = isSameDay(day, new Date());\n const locale = i18n.locale || enUS;\n const ariaLabel = `${\n disabled ? i18n.datePicker.disabledDayAriaLabel : ''\n } ${format(day, 'EEEE, MMMM do yyyy', locale)} ${\n sameDateAsToday ? i18n.datePicker.todayAriaLabel : ''\n } ${sameDateAsChosenDate ? i18n.datePicker.selectedDayAriaLabel : ''}`;\n\n return (\n <CalendarDayCell onFocus={onCalendarDayFocus} theme={theme}>\n <CalendarDayInner\n aria-disabled={disabled}\n aria-label={ariaLabel}\n disabled={disabled}\n isChosen={sameDateAsChosenDate}\n isFocused={dayFocusable && sameDateAsFocusedDate}\n onClick={onDayClick}\n ref={dayRef}\n tabIndex={sameDateAsFocusedDate ? 0 : -1}\n type=\"button\"\n theme={theme}\n >\n {format(day, 'd', locale)}\n </CalendarDayInner>\n {sameDateAsToday && (\n <TodayIndicator data-testid=\"todayIndicator\" theme={theme} />\n )}\n </CalendarDayCell>\n );\n } else {\n return <EmptyCell />;\n }\n};\n","import * as React from 'react';\nimport styled from '../../theme/styled';\nimport { ButtonColor, ButtonSize, ButtonType, ButtonVariant } from '../Button';\n\nimport { IconButton } from '../IconButton';\nimport { Heading } from '../Heading';\nimport { ArrowBackIcon, CloseIcon } from 'react-magma-icons';\nimport { TypographyVisualStyle } from '../Typography';\n\nimport { I18nContext } from '../../i18n';\nimport { ThemeContext } from '../../theme/ThemeContext';\n\ninterface HelperInformationProps {\n isOpen?: boolean;\n onClose?: (event?: React.SyntheticEvent) => void;\n}\n\nconst List = styled.ul`\n list-style: none;\n margin: 0;\n padding: 0;\n text-align: left;\n`;\n\nconst Item = styled.li`\n display: flex;\n list-style: none;\n margin-bottom: 12px;\n font-size: ${props => props.theme.typeScale.size02.fontSize};\n line-height: ${props => props.theme.typeScale.size02.lineHeight};\n align-items: center;\n span {\n flex: 0 0 100px;\n overflow: hidden;\n line-height: 28px;\n min-height: 36px;\n height: max-content;\n text-align: center;\n }\n div {\n flex: 1;\n }\n`;\n\nconst KeyboardShortcutButtonWrapper = styled.span`\n background: rgb(242, 242, 242);\n font-family: monospace;\n font-size: ${props => props.theme.typeScale.size02.fontSize};\n letter-spacing: ${props => props.theme.typeScale.size02.letterSpacing};\n line-height: ${props => props.theme.typeScale.size02.lineHeight};\n margin-right: ${props => props.theme.spaceScale.spacing03};\n text-transform: uppercase;\n padding: ${props => props.theme.spaceScale.spacing02}\n ${props => props.theme.spaceScale.spacing04};\n`;\n\nconst StyledPopup = styled.div`\n position: relative;\n background: white;\n`;\n\nconst StyledNavContainer = styled.div`\n display: flex;\n justify-content: space-between;\n padding: 2px;\n`;\nconst StyledContent = styled.div`\n z-index: 9999;\n position: relative;\n background: white;\n h2 {\n margin: 10px 0 12px 0;\n }\n`;\n\nexport const HelperInformation: React.FunctionComponent<\n HelperInformationProps\n> = (props: HelperInformationProps) => {\n const i18n = React.useContext(I18nContext);\n const theme = React.useContext(ThemeContext);\n\n return (\n <StyledPopup>\n <StyledNavContainer>\n <IconButton\n icon={<ArrowBackIcon />}\n size={ButtonSize.small}\n style={{ top: '4px', left: '-12px' }}\n variant={ButtonVariant.link}\n onClick={props.onClose}\n >\n Back to Calendar\n </IconButton>\n <IconButton\n aria-label={i18n.datePicker.calendarCloseAriaLabel}\n color={ButtonColor.secondary}\n icon={<CloseIcon />}\n size={ButtonSize.medium}\n style={{ left: '16px' }}\n type={ButtonType.button}\n onClick={props.onClose}\n variant={ButtonVariant.link}\n />\n </StyledNavContainer>\n <StyledContent>\n <Heading level={2} visualStyle={TypographyVisualStyle.headingXSmall}>\n {i18n.datePicker.helpModal.header}\n </Heading>\n <List id=\"DayPickerKeyboardShortcuts_description\">\n <Item theme={theme}>\n <KeyboardShortcutButtonWrapper\n aria-label={i18n.datePicker.helpModal.enter.ariaLabel}\n role=\"img\"\n theme={theme}\n >\n ↵\n </KeyboardShortcutButtonWrapper>\n <div>{i18n.datePicker.helpModal.enter.explanation}</div>\n </Item>\n <Item theme={theme}>\n <KeyboardShortcutButtonWrapper\n role=\"img\"\n theme={theme}\n aria-label={\n i18n.datePicker.helpModal.rightAndLeftArrowKeys.ariaLabel\n }\n >\n ←/→\n </KeyboardShortcutButtonWrapper>\n <div>\n {i18n.datePicker.helpModal.rightAndLeftArrowKeys.explanation}\n </div>\n </Item>\n <Item theme={theme}>\n <KeyboardShortcutButtonWrapper\n role=\"img\"\n theme={theme}\n aria-label={\n i18n.datePicker.helpModal.upAndDownArrowKeys.ariaLabel\n }\n >\n ↑/↓\n </KeyboardShortcutButtonWrapper>\n <div>\n {i18n.datePicker.helpModal.upAndDownArrowKeys.explanation}\n </div>\n </Item>\n <Item theme={theme}>\n <KeyboardShortcutButtonWrapper\n role=\"img\"\n theme={theme}\n aria-label={\n i18n.datePicker.helpModal.pageUpAndPageDownKeys.ariaLabel\n }\n >\n {i18n.datePicker.helpModal.pageUpAndPageDownKeys.displayValue}\n </KeyboardShortcutButtonWrapper>\n <div>\n {i18n.datePicker.helpModal.pageUpAndPageDownKeys.explanation}\n </div>\n </Item>\n <Item theme={theme}>\n <KeyboardShortcutButtonWrapper\n role=\"img\"\n theme={theme}\n aria-label={i18n.datePicker.helpModal.homeAndEndKeys.ariaLabel}\n >\n {i18n.datePicker.helpModal.homeAndEndKeys.displayValue}\n </KeyboardShortcutButtonWrapper>\n <div>{i18n.datePicker.helpModal.homeAndEndKeys.explanation}</div>\n </Item>\n <Item theme={theme}>\n <KeyboardShortcutButtonWrapper\n role=\"img\"\n theme={theme}\n aria-label={i18n.datePicker.helpModal.escape.ariaLabel}\n >\n {i18n.datePicker.helpModal.escape.displayValue}\n </KeyboardShortcutButtonWrapper>\n <div>{i18n.datePicker.helpModal.escape.explanation}</div>\n </Item>\n <Item theme={theme}>\n <KeyboardShortcutButtonWrapper\n role=\"img\"\n theme={theme}\n aria-label={i18n.datePicker.helpModal.questionMark.ariaLabel}\n >\n ?\n </KeyboardShortcutButtonWrapper>\n <div>{i18n.datePicker.helpModal.questionMark.explanation}</div>\n </Item>\n </List>\n </StyledContent>\n </StyledPopup>\n );\n};\n","import * as React from 'react';\n\nexport interface FocusableElement extends HTMLElement {\n focus(options?: FocusOptions): void;\n}\n\nexport function useFocusLock(\n active: boolean,\n header?: React.MutableRefObject<FocusableElement>,\n body?: React.MutableRefObject<FocusableElement>\n): React.MutableRefObject<any> {\n const rootNode = React.useRef<HTMLElement>(null);\n const focusableItems = React.useRef<Array<HTMLElement>>([]);\n\n const updateFocusableItems = () => {\n focusableItems.current = rootNode.current?.querySelectorAll(\n 'button, [href], input, select, textarea, [tabindex]:not([tabindex=\"-1\"]), video'\n ) as unknown as Array<HTMLElement>;\n };\n\n React.useEffect(() => {\n if (active) {\n updateFocusableItems();\n\n if (header && header.current) {\n header.current.focus();\n } else if (focusableItems.current && focusableItems.current.length > 0) {\n const { 0: firstItem } = focusableItems.current;\n\n firstItem.focus();\n } else if (body && body.current) {\n (body.current.firstChild as HTMLElement).setAttribute('tabIndex', '-1');\n (body.current.firstChild as HTMLElement).focus();\n }\n }\n }, [active]);\n\n React.useEffect(() => {\n const observer: MutationObserver = new MutationObserver(() => {\n updateFocusableItems();\n });\n\n updateFocusableItems();\n\n rootNode.current &&\n observer.observe(rootNode.current, { childList: true, subtree: true });\n return () => {\n observer.disconnect();\n };\n }, [rootNode]);\n\n React.useEffect(() => {\n const handleKeyPress = (event: KeyboardEvent) => {\n if (!focusableItems.current) return;\n\n const { key, shiftKey } = event;\n const {\n length,\n 0: firstItem,\n [length - 1]: lastItem,\n } = focusableItems.current;\n\n if (active && key === 'Tab') {\n // If no focusable items are\n if (length === 0) {\n event.preventDefault();\n return;\n }\n\n // If only one item then prevent tabbing when locked\n if (length === 1) {\n event.preventDefault();\n if (firstItem !== document.activeElement) {\n firstItem.focus();\n }\n\n return;\n }\n\n // If focused on last item then focus on first item when tab is pressed\n if (!shiftKey && document.activeElement === lastItem) {\n event.preventDefault();\n firstItem.focus();\n return;\n }\n\n // If focused on first item then focus on last item when shift + tab is pressed\n if (\n shiftKey &&\n (document.activeElement === firstItem ||\n document.activeElement === header.current)\n ) {\n event.preventDefault();\n lastItem.focus();\n return;\n }\n }\n };\n\n window.addEventListener('keydown', handleKeyPress);\n\n return () => {\n window.removeEventListener('keydown', handleKeyPress);\n };\n }, [active, focusableItems]);\n\n return rootNode;\n}\n","import * as React from 'react';\nimport { ButtonColor, ButtonSize, ButtonType, ButtonVariant } from '../Button';\nimport { IconButton } from '../IconButton';\nimport { Tooltip } from '../Tooltip';\nimport { CloseIcon, KeyboardIcon } from 'react-magma-icons';\nimport { CalendarContext } from './CalendarContext';\nimport { CalendarHeader } from './CalendarHeader';\nimport { CalendarDay } from './CalendarDay';\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport styled from '../../theme/styled';\nimport { HelperInformation } from './HelperInformation';\nimport { usePrevious } from '../../utils';\nimport { I18nContext } from '../../i18n';\nimport { useFocusLock } from '../../hooks/useFocusLock';\n\ninterface CalendarMonthProps {\n calendarOpened?: boolean;\n focusOnOpen?: boolean;\n handleCloseButtonClick: (event: React.SyntheticEvent) => void;\n setDateFocused?: (value: boolean) => void;\n}\n\nconst CalendarContainer = styled.div`\n background: ${props => props.theme.colors.neutral08};\n padding: 0 ${props => props.theme.spaceScale.spacing05}\n ${props => props.theme.spaceScale.spacing03};\n overflow: visible;\n`;\n\nconst MonthContainer = styled.div`\n background: ${props => props.theme.colors.neutral08};\n text-align: center;\n user-select: none;\n vertical-align: top;\n`;\n\nconst Table = styled.table`\n border-collapse: collapse;\n border-spacing: 0;\n margin-bottom: ${props => props.theme.spaceScale.spacing03};\n`;\n\nconst Th = styled.th`\n border: 0;\n color: ${props => props.theme.colors.neutral};\n font-size: ${props => props.theme.typeScale.size02.fontSize};\n line-height: ${props => props.theme.typeScale.size02.lineHeight};\n font-weight: normal;\n padding: 0;\n text-align: center;\n`;\n\nconst HelperButton = styled.span<{ theme?: any }>`\n top: ${props => props.theme.spaceScale.spacing01};\n position: absolute;\n left: ${props => props.theme.spaceScale.spacing01};\n z-index: 2;\n`;\n\nconst CloseButton = styled.span<{ theme?: any }>`\n position: absolute;\n right: ${props => props.theme.spaceScale.spacing01};\n top: ${props => props.theme.spaceScale.spacing01};\n z-index: 1;\n`;\n\nexport const CalendarMonth: React.FunctionComponent<CalendarMonthProps> = (\n props: CalendarMonthProps\n) => {\n const lastFocus = React.useRef<any>();\n const headingRef = React.useRef<any>();\n const context = React.useContext(CalendarContext);\n const [dayFocusable, setDayFocusable] = React.useState<boolean>(false);\n const [focusHeader, setFocusHeader] = React.useState<boolean>(false);\n const prevCalendarOpened = usePrevious(props.calendarOpened);\n\n const focusTrapElement = useFocusLock(props.calendarOpened, headingRef);\n\n React.useEffect(() => {\n if (!prevCalendarOpened && props.calendarOpened) {\n lastFocus.current = document.activeElement;\n\n if (props.focusOnOpen) {\n setDayFocusable(true);\n context.setDateFocused(true);\n }\n }\n\n if (props.calendarOpened && !props.focusOnOpen && !focusHeader) {\n setFocusHeader(true);\n }\n\n if (prevCalendarOpened && !props.calendarOpened) {\n setFocusHeader(false);\n }\n }, [props.calendarOpened, props.focusOnOpen]);\n\n function onCalendarTableFocus() {\n setDayFocusable(true);\n }\n\n function onCalendarTableBlur() {\n setDayFocusable(false);\n context.setDateFocused(false);\n }\n\n function turnOffDateFocused() {\n context.setDateFocused(false);\n }\n\n const theme = React.useContext(ThemeContext);\n const i18n = React.useContext(I18nContext);\n\n const days = [\n 'sunday',\n 'monday',\n 'tuesday',\n 'wednesday',\n 'thursday',\n 'friday',\n 'saturday',\n ];\n const startOfWeek = days.indexOf(i18n.datePicker.startOfWeek);\n const sortedDays = days.slice(startOfWeek).concat(days.slice(0, startOfWeek));\n const tableDaysHeaders = sortedDays.map((day, index) => (\n <Th key={index} theme={theme}>\n {i18n.days.min[day]}\n </Th>\n ));\n\n return (\n <>\n <CalendarContainer\n data-testid=\"calendarMonthContainer\"\n tabIndex={-1}\n theme={theme}\n onKeyDown={context.onKeyDown}\n >\n {context.helperInformationShown ? (\n <HelperInformation\n isOpen={context.helperInformationShown}\n onClose={context.hideHelperInformation}\n />\n ) : (\n <MonthContainer\n data-testid=\"monthContainer\"\n data-visible=\"true\"\n theme={theme}\n ref={focusTrapElement}\n >\n <CalendarHeader ref={headingRef} focusHeader={focusHeader} />\n\n <Table\n role=\"presentation\"\n onBlur={onCalendarTableBlur}\n onFocus={onCalendarTableFocus}\n theme={theme}\n >\n <tbody>\n <tr>{tableDaysHeaders}</tr>\n {context\n .buildCalendarMonth(context.focusedDate)\n .map((week, i) => (\n <tr key={i}>\n {week.map((day, dayOfWeek) => (\n <CalendarDay\n key={dayOfWeek}\n day={day}\n dayFocusable={dayFocusable}\n onDateChange={context.onDateChange}\n />\n ))}\n </tr>\n ))}\n </tbody>\n </Table>\n <Tooltip\n content={'Keyboard instructions'}\n tooltipStyle={{ position: 'fixed' }}\n >\n <HelperButton theme={theme}>\n <IconButton\n aria-label={i18n.datePicker.helpModal.helpButtonAriaLabel}\n icon={<KeyboardIcon />}\n onClick={context.showHelperInformation}\n size={ButtonSize.small}\n onFocus={turnOffDateFocused}\n type={ButtonType.button}\n variant={ButtonVariant.link}\n />\n </HelperButton>\n </Tooltip>\n\n <CloseButton theme={theme}>\n <IconButton\n aria-label={i18n.datePicker.calendarCloseAriaLabel}\n color={ButtonColor.secondary}\n icon={<CloseIcon />}\n onClick={props.handleCloseButtonClick}\n size={ButtonSize.medium}\n type={ButtonType.button}\n variant={ButtonVariant.link}\n />\n </CloseButton>\n </MonthContainer>\n )}\n </CalendarContainer>\n </>\n );\n};\n","import * as React from 'react';\nimport styled from '../../theme/styled';\nimport { InputIconPosition, InputSize } from '../InputBase';\nimport { InputMessage } from '../Input/InputMessage';\nimport { Label } from '../Label';\nimport { VisuallyHidden } from '../VisuallyHidden';\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport { InverseContext, useIsInverse } from '../../inverse';\n\n/**\n * @children required\n */\nexport interface FormFieldContainerProps\n extends FormFieldContainerBaseProps,\n React.HTMLAttributes<HTMLDivElement> {}\n\nexport interface FormFieldContainerBaseProps {\n /**\n * Is the wrapped input hidden with display:none? This would make the input look like an actionable item, so FormFieldContainer uses a span in lieu of a label.\n */\n actionable?: boolean;\n /**\n * Style properties for the outer container\n */\n containerStyle?: React.CSSProperties;\n /**\n * Content of the error message. If a value is provided, the field will be styled as an error state and the error message will display.\n */\n errorMessage?: React.ReactNode;\n /**\n * ID of the form field. Also used in the descrption ID.\n */\n fieldId: string;\n /**\n * Content of the helper message.\n */\n helperMessage?: React.ReactNode;\n /**\n * If true, label text will be hidden visually, but will still be read by assistive technology\n * @default false\n */\n isLabelVisuallyHidden?: boolean;\n /**\n * Style properties for the label element\n */\n labelStyle?: React.CSSProperties;\n /**\n * Content for label; can be a node or a string\n */\n labelText?: React.ReactNode;\n /**\n * Style properties for the helper or error message\n */\n messageStyle?: React.CSSProperties;\n /**\n * Relative size of the component\n * @default InputSize.medium\n */\n iconPosition?: InputIconPosition;\n inputSize?: InputSize;\n testId?: string;\n isInverse?: boolean;\n}\n\nconst StyledFormFieldContainer = styled.div<{ isInverse?: boolean }>`\n color: ${props =>\n props.isInverse\n ? props.theme.colors.neutral08\n : props.theme.colors.neutral};\n`;\n\nexport const FormFieldContainer = React.forwardRef<\n HTMLDivElement,\n FormFieldContainerProps\n>((props, ref) => {\n const {\n actionable = true,\n children,\n containerStyle,\n errorMessage,\n fieldId,\n helperMessage,\n iconPosition,\n inputSize,\n isInverse: isInverseProp,\n isLabelVisuallyHidden,\n labelStyle,\n labelText,\n messageStyle,\n testId,\n ...rest\n } = props;\n const theme = React.useContext(ThemeContext);\n const isInverse = useIsInverse(isInverseProp);\n\n const descriptionId =\n errorMessage || helperMessage ? `${fieldId}__desc` : null;\n\n return (\n <InverseContext.Provider value={{ isInverse }}>\n <StyledFormFieldContainer\n {...rest}\n data-testid={props.testId}\n isInverse={isInverse}\n ref={ref}\n style={containerStyle}\n theme={theme}\n >\n {labelText && (\n <Label\n actionable={actionable}\n htmlFor={fieldId}\n iconPosition={iconPosition}\n size={inputSize}\n style={labelStyle}\n >\n {isLabelVisuallyHidden ? (\n <VisuallyHidden>{labelText}</VisuallyHidden>\n ) : (\n labelText\n )}\n </Label>\n )}\n {children}\n {(errorMessage || helperMessage) && (\n <InputMessage\n hasError={!!errorMessage}\n id={descriptionId}\n isInverse={isInverse}\n style={messageStyle}\n >\n {(errorMessage || helperMessage) && (\n <>{errorMessage ? errorMessage : helperMessage}</>\n )}\n </InputMessage>\n )}\n </StyledFormFieldContainer>\n </InverseContext.Provider>\n );\n});\n","import * as React from 'react';\nimport {\n FormFieldContainer,\n FormFieldContainerBaseProps,\n} from '../FormFieldContainer';\nimport { InputBase, InputBaseProps, InputSize } from '../InputBase';\nimport { useGenerateId } from '../../utils';\nimport { useIsInverse } from '../../inverse';\n\nexport interface InputProps\n extends Omit<FormFieldContainerBaseProps, 'fieldId'>,\n InputBaseProps {}\n\nexport const Input = React.forwardRef<HTMLInputElement, InputProps>(\n (props, ref) => {\n const {\n children,\n containerStyle,\n errorMessage,\n helperMessage,\n iconPosition,\n id: defaultId,\n inputSize = InputSize.medium,\n isLabelVisuallyHidden,\n labelStyle,\n labelText,\n messageStyle,\n ...other\n } = props;\n\n const id = useGenerateId(defaultId);\n\n const descriptionId = errorMessage || helperMessage ? `${id}__desc` : null;\n\n const isInverse = useIsInverse(props.isInverse);\n\n return (\n <FormFieldContainer\n containerStyle={containerStyle}\n errorMessage={errorMessage}\n fieldId={id}\n helperMessage={helperMessage}\n iconPosition={iconPosition}\n isLabelVisuallyHidden={isLabelVisuallyHidden}\n isInverse={isInverse}\n inputSize={inputSize}\n labelStyle={labelStyle}\n labelText={labelText}\n messageStyle={messageStyle}\n >\n <InputBase\n {...other}\n aria-describedby={\n descriptionId ? descriptionId : props['aria-describedby']\n }\n aria-invalid={!!errorMessage}\n hasError={!!errorMessage}\n iconPosition={iconPosition}\n id={id}\n inputSize={inputSize}\n isInverse={isInverse}\n ref={ref}\n >\n {children}\n </InputBase>\n </FormFieldContainer>\n );\n }\n);\n","import * as React from 'react';\nimport { CalendarContext } from './CalendarContext';\nimport { CalendarMonth } from './CalendarMonth';\nimport { Announce } from '../Announce';\nimport { Input } from '../Input';\nimport { InputType } from '../InputBase';\nimport { isAfter, isBefore, isValid, isSameDay } from 'date-fns';\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport styled from '../../theme/styled';\nimport { EventIcon } from 'react-magma-icons';\nimport { VisuallyHidden } from '../VisuallyHidden';\nimport {\n handleKeyPress,\n getCalendarMonthWeeks,\n getPrevMonthFromDate,\n getNextMonthFromDate,\n i18nFormat as format,\n getDateFromString,\n} from './utils';\nimport { omit, useGenerateId, Omit, useForkedRef } from '../../utils';\nimport { I18nContext } from '../../i18n';\nimport { InverseContext, useIsInverse } from '../../inverse';\n\nexport interface DatePickerProps\n extends Omit<\n React.InputHTMLAttributes<HTMLInputElement>,\n 'value' | 'onChange'\n > {\n /**\n * Style properties for the component container element\n */\n containerStyle?: React.CSSProperties;\n /**\n * Default selected date value\n */\n defaultDate?: Date;\n /**\n * Content of the error message. If a value is provided, the component will be styled to show an error state\n */\n errorMessage?: React.ReactNode;\n /**\n * Content of the helper message\n */\n helperMessage?: React.ReactNode;\n /**\n * Style properties for the input element\n */\n inputStyle?: React.CSSProperties;\n /**\n * Clear contents of input by clicking a clear button\n * @default false\n */\n isClearable?: boolean;\n isInverse?: boolean;\n /**\n * Style properties for the label element\n */\n labelStyle?: React.CSSProperties;\n /**\n * Text for label\n */\n labelText: React.ReactNode;\n /**\n * Maximum date allowed to be chosen in the calendar\n */\n maxDate?: Date;\n /**\n * Style properties for the helper or error message\n */\n messageStyle?: React.CSSProperties;\n /**\n * Minimum date allowed to be chosen in the calendar\n */\n minDate?: Date;\n /**\n * Text for input placeholder\n */\n placeholder?: string;\n /**\n * If true, this component must have a value\n * @default false\n */\n required?: boolean;\n testId?: string;\n /**\n * Value of the date input, used when setting the date value externally\n */\n value?: Date;\n /**\n * Event fired in multiple instances when internal values are changed and can be used as a generic state change event\n */\n onChange?: (\n value: string,\n event: React.ChangeEvent | React.SyntheticEvent\n ) => void;\n /**\n * Event that will fire when day is changed\n */\n onDateChange?: (day: Date, event: React.SyntheticEvent) => void;\n /**\n * Event that will fire when the text input loses focus\n */\n onInputBlur?: (event: React.FocusEvent) => void;\n /**\n * Event that will fire when the text input is changed\n */\n onInputChange?: (event: React.ChangeEvent) => void;\n /**\n * Event that will fire when the text input gains focus\n */\n onInputFocus?: (event: React.FocusEvent) => void;\n}\n\nconst DatePickerContainer = styled.div`\n position: relative;\n`;\n\nconst DatePickerCalendar = styled.div<{ opened: boolean }>`\n border: 1px solid ${props => props.theme.colors.neutral06};\n border-radius: ${props => props.theme.borderRadius};\n box-shadow: 0 2px 6px 0 rgba(0, 0, 0, 0.15);\n display: ${props => (props.opened ? 'block' : 'none')};\n margin-top: -${props => props.theme.spaceScale.spacing07};\n opacity: ${props => (props.opened ? '1' : '0')};\n overflow: hidden;\n position: absolute;\n transition: opacity 0.2s ease-in-out 0s;\n width: 320px;\n z-index: ${props => (props.opened ? '998' : '-1')};\n`;\n\nexport const DatePicker = React.forwardRef<HTMLInputElement, DatePickerProps>(\n (props, forwardedRef) => {\n const theme = React.useContext(ThemeContext);\n const i18n = React.useContext(I18nContext);\n const iconRef = React.useRef<HTMLButtonElement>();\n const inputRef = React.useRef<HTMLInputElement>();\n const lastFocus = React.useRef<any>();\n const id: string = useGenerateId(props.id);\n const [helperInformationShown, setHelperInformationShown] =\n React.useState<boolean>(false);\n const [calendarOpened, setCalendarOpened] = React.useState<boolean>(false);\n const [dateFocused, setDateFocused] = React.useState<boolean>(false);\n\n const [focusedDate, setFocusedDate] = React.useState<Date>(\n setDateFromConsumer(props.value || props.defaultDate) ||\n setDefaultFocusedDate()\n );\n const [chosenDate, setChosenDate] = React.useState<Date | null>(\n setDateFromConsumer(props.value || props.defaultDate)\n );\n\n const ref = useForkedRef(forwardedRef, inputRef);\n\n React.useEffect(() => {\n if (!calendarOpened) {\n setDateFocused(false);\n }\n }, [calendarOpened]);\n\n React.useEffect(() => {\n if (props.value) {\n setChosenDate(setDateFromConsumer(props.value));\n setFocusedDate(\n setDateFromConsumer(props.value) || setDefaultFocusedDate()\n );\n }\n }, [props.value]);\n\n function showHelperInformation() {\n lastFocus.current = document.activeElement;\n setHelperInformationShown(true);\n }\n\n function hideHelperInformation() {\n setHelperInformationShown(false);\n lastFocus.current.focus();\n }\n\n function setDateFromConsumer(date: Date): Date {\n const convertedDate = getDateFromString(date);\n const convertedMinDate = getDateFromString(props.minDate);\n const convertedMaxDate = getDateFromString(props.maxDate);\n\n return date &&\n inDateRange(convertedDate, convertedMinDate, convertedMaxDate)\n ? convertedDate\n : null;\n }\n\n function setDefaultFocusedDate(): Date {\n const newDate = new Date();\n const convertedMinDate = getDateFromString(props.minDate);\n const convertedMaxDate = getDateFromString(props.maxDate);\n\n if (inDateRange(newDate, convertedMinDate, convertedMaxDate)) {\n return newDate;\n } else if (convertedMaxDate || convertedMinDate) {\n return convertedMinDate ? convertedMinDate : convertedMaxDate;\n }\n }\n\n function inDateRange(\n date: Date,\n minDateValue?: Date,\n maxDateValue?: Date\n ): boolean {\n return (\n (maxDateValue\n ? isBefore(date, maxDateValue) || isSameDay(date, maxDateValue)\n : true) &&\n (minDateValue\n ? isAfter(date, minDateValue) || isSameDay(date, minDateValue)\n : true)\n );\n }\n\n function buildCalendarMonth(date: Date, enableOutsideDates: boolean) {\n const days = [\n 'sunday',\n 'monday',\n 'tuesday',\n 'wednesday',\n 'thursday',\n 'friday',\n 'saturday',\n ];\n const { startOfWeek } = i18n.datePicker;\n return getCalendarMonthWeeks(\n date,\n enableOutsideDates,\n days.indexOf(startOfWeek)\n );\n }\n\n function onPrevMonthClick() {\n setFocusedDate(getPrevMonthFromDate);\n }\n\n function onNextMonthClick() {\n setFocusedDate(getNextMonthFromDate);\n }\n\n function onDateChange(day: Date) {\n setChosenDate(day);\n setCalendarOpened(false);\n }\n\n function reset() {\n setFocusedDate(setDefaultFocusedDate());\n setChosenDate(null);\n setDateFocused(false);\n }\n\n function isValidDateFromString(value: string, day: Date) {\n const isValidDateFormat = /^\\d{1,2}\\/\\d{1,2}\\/\\d{4}$/.test(value);\n const isValidDate = isValid(day);\n\n return isValidDateFormat && isValidDate;\n }\n\n function handleInputChange(event) {\n const { value } = event.target;\n const day = new Date(value);\n setCalendarOpened(false);\n\n props.onInputChange &&\n typeof props.onInputChange === 'function' &&\n props.onInputChange(event);\n\n const isValidDay = isValidDateFromString(value, day);\n\n props.onChange &&\n typeof props.onChange === 'function' &&\n props.onChange(isValidDay ? day.toISOString() : value, event);\n }\n\n function handleInputFocus(event: React.FocusEvent) {\n props.onInputFocus &&\n typeof props.onInputFocus === 'function' &&\n props.onInputFocus(event);\n }\n\n function handleInputBlur(event: React.FocusEvent) {\n const { value } = inputRef.current;\n const day = new Date(value);\n const convertedMinDate = getDateFromString(props.minDate);\n const convertedMaxDate = getDateFromString(props.maxDate);\n\n if (\n isValidDateFromString(value, day) &&\n inDateRange(day, convertedMinDate, convertedMaxDate)\n ) {\n handleDateChange(day, event);\n } else {\n reset && typeof reset === 'function' && reset();\n }\n\n props.onInputBlur &&\n typeof props.onInputBlur === 'function' &&\n props.onInputBlur(event);\n }\n\n function handleInputKeyDown(event: React.KeyboardEvent) {\n if (event.key === 'Escape') {\n event.preventDefault();\n setCalendarOpened(false);\n inputRef.current.focus();\n }\n }\n\n function handleKeyDown(event: React.KeyboardEvent) {\n if (dateFocused && document.activeElement.closest('table')) {\n const newChosenDate = handleKeyPress(\n event,\n focusedDate,\n setCalendarOpened,\n showHelperInformation,\n onDateChange,\n iconRef\n );\n if (newChosenDate) {\n setFocusedDate(newChosenDate);\n }\n } else {\n if (event.key === 'Escape') {\n setCalendarOpened(false);\n iconRef.current.focus();\n }\n\n if (event.key === '?') {\n showHelperInformation();\n }\n }\n }\n\n function handleDateChange(\n day: Date,\n event: React.SyntheticEvent | React.ChangeEvent\n ) {\n props.onDateChange &&\n typeof props.onDateChange === 'function' &&\n props.onDateChange(day, event);\n\n props.onChange &&\n typeof props.onChange === 'function' &&\n props.onChange(day.toISOString(), event);\n\n onDateChange(day);\n setFocusedDate(day);\n }\n\n function handleDaySelection(day: Date, event: React.SyntheticEvent) {\n handleDateChange(day, event);\n inputRef.current.focus();\n }\n\n function handleCalendarBlur(event: React.SyntheticEvent) {\n const { currentTarget } = event;\n\n // timeout needed for active element to update. Browser behavior.\n // https://bugzilla.mozilla.org/show_bug.cgi?id=452307\n setTimeout(() => {\n const isInCalendar = currentTarget.contains(document.activeElement);\n\n if (!isInCalendar && !helperInformationShown) {\n setCalendarOpened(false);\n }\n }, 0);\n }\n\n function handleCloseButtonClick(event: React.SyntheticEvent) {\n iconRef.current.focus();\n setCalendarOpened(false);\n }\n\n function toggleCalendarOpened() {\n setCalendarOpened(opened => !opened);\n }\n\n const { placeholder, testId, ...rest } = props;\n const other = omit(\n ['onDateChange', 'onInputChange', 'onInputBlur', 'onInputFocus'],\n rest\n );\n\n const isInverse = useIsInverse(props.isInverse);\n\n const minDate = getDateFromString(props.minDate);\n const maxDate = getDateFromString(props.maxDate);\n\n const dateFormat = i18n.dateFormat;\n\n const inputValue = chosenDate ? format(chosenDate, dateFormat) : '';\n\n return (\n <CalendarContext.Provider\n value={{\n chosenDate,\n focusedDate,\n dateFocused,\n maxDate,\n minDate,\n helperInformationShown,\n buildCalendarMonth,\n showHelperInformation,\n hideHelperInformation,\n onKeyDown: handleKeyDown,\n onPrevMonthClick,\n onNextMonthClick,\n onDateChange: handleDaySelection,\n setDateFocused,\n }}\n >\n <DatePickerContainer data-testid={testId} onBlur={handleCalendarBlur}>\n <Announce>\n {calendarOpened && (\n <VisuallyHidden>\n {i18n.datePicker.calendarOpenAnnounce}\n </VisuallyHidden>\n )}\n </Announce>\n <Input\n {...other}\n icon={<EventIcon />}\n iconAriaLabel={i18n.datePicker.calendarIconAriaLabel}\n iconRef={iconRef}\n onIconClick={toggleCalendarOpened}\n onIconKeyDown={handleInputKeyDown}\n id={id}\n isInverse={isInverse}\n ref={ref}\n onChange={handleInputChange}\n onBlur={handleInputBlur}\n onFocus={handleInputFocus}\n onKeyDown={handleInputKeyDown}\n placeholder={placeholder ? placeholder : dateFormat.toLowerCase()}\n type={InputType.text}\n value={inputValue}\n />\n <InverseContext.Provider value={{ isInverse: false }}>\n <DatePickerCalendar\n data-testid=\"calendarContainer\"\n opened={calendarOpened}\n theme={theme}\n >\n <CalendarMonth\n focusOnOpen={\n calendarOpened && Boolean(focusedDate) && Boolean(chosenDate)\n }\n handleCloseButtonClick={handleCloseButtonClick}\n calendarOpened={calendarOpened}\n setDateFocused={setDateFocused}\n />\n </DatePickerCalendar>\n </InverseContext.Provider>\n </DatePickerContainer>\n </CalendarContext.Provider>\n );\n }\n);\n","import * as React from 'react';\nimport styled from '../../theme/styled';\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport { MenuItemStyles, IconWrapper } from './DropdownMenuItem';\nimport { DropdownContext } from './Dropdown';\nimport { IconProps } from 'react-magma-icons';\nimport { Omit, useForkedRef } from '../../utils';\n\nexport interface DropdownMenuNavItemProps\n extends Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, 'color'> {\n /**\n * Leading icon for the menu item\n */\n icon?: React.ReactElement<IconProps>;\n /**\n * The href value of the link\n */\n to: string;\n}\n\nconst StyledItem = styled.a<{\n disabled?: boolean;\n isFixedWidth?: boolean;\n isInactive?: boolean;\n}>`\n ${MenuItemStyles}\n text-decoration: none;\n`;\n\nexport const DropdownMenuNavItem = React.forwardRef<\n HTMLAnchorElement,\n DropdownMenuNavItemProps\n>((props, forwardedRef) => {\n const { children, icon, to, ...other } = props;\n\n const ownRef = React.useRef<HTMLDivElement>();\n const theme = React.useContext(ThemeContext);\n const context = React.useContext(DropdownContext);\n\n const ref = useForkedRef(forwardedRef, ownRef);\n\n React.useEffect(() => {\n context.registerDropdownMenuItem(context.itemRefArray, ownRef);\n }, []);\n\n return (\n <StyledItem\n {...other}\n href={to}\n isFixedWidth={context.isFixedWidth}\n ref={ref}\n role=\"menuitem\"\n tabIndex={-1}\n theme={theme}\n >\n {icon && <IconWrapper theme={theme}>{icon}</IconWrapper>}\n {children}\n </StyledItem>\n );\n});\n\nDropdownMenuNavItem.displayName = 'DropdownMenuNavItem';\n","import * as React from 'react';\nimport styled from '../../theme/styled';\nimport { css } from '@emotion/core';\nimport { ThemeContext } from '../../theme/ThemeContext';\n\nexport enum FlexAlignContent {\n center = 'center',\n flexStart = 'flex-start',\n flexEnd = 'flex-end',\n spaceBetween = 'space-between',\n spaceAround = 'space-around',\n stretch = 'stretch', // default\n}\n\nexport enum FlexAlignItems {\n baseline = 'baseline',\n center = 'center',\n flexStart = 'flex-start',\n flexEnd = 'flex-end',\n stretch = 'stretch', // default\n}\n\nexport enum FlexBehavior {\n container = 'container',\n item = 'item',\n both = 'both',\n}\n\nexport enum FlexDirection {\n column = 'column',\n columnReverse = 'column-reverse',\n row = 'row', // default\n rowReverse = 'row-reverse',\n}\n\nexport enum FlexJustify {\n center = 'center',\n flexStart = 'flex-start', //default\n flexEnd = 'flex-end',\n spaceBetween = 'space-between',\n spaceAround = 'space-around',\n spaceEvenly = 'space-evenly',\n}\n\nexport enum FlexWrap {\n nowrap = 'nowrap',\n wrap = 'wrap', //default\n wrapReverse = 'wrap-reverse',\n}\n\n/**\n * @children required\n */\nexport interface FlexProps extends React.HTMLAttributes<HTMLDivElement> {\n /**\n * Defines the align-content style property. It's applied for all screen sizes.\n * @default FlexAlignContent.stretch\n */\n alignContent?: FlexAlignContent;\n /**\n * Defines the align-items style property. It's applied for all screen sizes.\n * @default FlexAlignItems.stretch\n */\n alignItems?: FlexAlignItems;\n /**\n * Defines the flex behavior for the component. Options are container, item or both. You should be wrapping items with a container.\n */\n behavior: FlexBehavior;\n /**\n * Defines the flex-direction style property. It's applied for all screen sizes.\n * @default FlexDirection.row\n */\n direction?: FlexDirection;\n /**\n * If true, the component will have the flex item behavior. You should be wrapping items with a container.\n */\n justify?: FlexJustify;\n /**\n * Defines the space between the type item component. Spacing will be this number multiplied by 8px. It can only be used on a type container component.\n * @default 0\n */\n spacing?: number;\n testId?: string;\n /**\n * Defines the flex-wrap style property. It's applied for all screen sizes.\n * @default FlexWrap.wrap\n */\n wrap?: FlexWrap;\n /**\n * Defines the number of grids the component is going to use. It's applied for all the screen sizes with the lowest priority.\n * @default false\n */\n xs?: false | true | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;\n /**\n * Defines the number of grids the component is going to use. It's applied for the small breakpoint and wider screens.\n * @default false\n */\n sm?: false | true | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;\n /**\n * Defines the number of grids the component is going to use. It's applied for the medium breakpoint and wider screens.\n * @default false\n */\n md?: false | true | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;\n /**\n * Defines the number of grids the component is going to use. It's applied for the large breakpoint and wider screens.\n * @default false\n */\n lg?: false | true | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;\n /**\n * Defines the number of grids the component is going to use. It's applied for the extra-large breakpoint and wider screens.\n * @default false\n */\n xl?: false | true | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;\n}\n\nfunction getWidth(size) {\n return `${Math.round((size / 12) * 10e7) / 10e5}%`;\n}\n\nconst StyledFlex = styled.div<FlexProps>`\n ${props =>\n props.behavior !== FlexBehavior.item &&\n css`\n align-content: ${props.alignContent};\n align-items: ${props.alignItems};\n flex-direction: ${props.direction};\n display: flex;\n flex-wrap: ${props.wrap};\n justify-content: ${props.justify};\n margin: ${0 - props.spacing * 4}px;\n width: calc(100% + ${props.spacing * props.theme.spacingMultiplier}px);\n\n > div {\n padding: ${props.spacing * 4}px;\n }\n `};\n\n ${props =>\n props.behavior !== FlexBehavior.container &&\n css`\n flex-grow: ${props.xs === true ? '1' : '0'};\n flex-basis: ${props.xs === true ? '0' : getWidth(props.xs)};\n max-width: ${props.xs === true ? '100%' : getWidth(props.xs)};\n\n ${props.sm &&\n css`\n @media (min-width: ${props.theme.breakpoints.small}px) {\n flex-grow: ${props.sm === true ? '1' : '0'};\n flex-basis: ${props.sm === true ? '0' : getWidth(props.sm)};\n max-width: ${props.sm === true ? '100%' : getWidth(props.sm)};\n }\n `};\n\n ${props.md &&\n css`\n @media (min-width: ${props.theme.breakpoints.medium}px) {\n flex-grow: ${props.md === true ? '1' : '0'};\n flex-basis: ${props.md === true ? '0' : getWidth(props.md)};\n max-width: ${props.md === true ? '100%' : getWidth(props.md)};\n }\n `};\n\n ${props.lg &&\n css`\n @media (min-width: ${props.theme.breakpoints.large}px) {\n flex-grow: ${props.lg === true ? '1' : '0'};\n flex-basis: ${props.lg === true ? '0' : getWidth(props.lg)};\n max-width: ${props.lg === true ? '100%' : getWidth(props.lg)};\n }\n `};\n\n ${props.xl &&\n css`\n @media (min-width: ${props.theme.breakpoints.xl}px) {\n flex-grow: ${props.xl === true ? '1' : '0'};\n flex-basis: ${props.xl === true ? '0' : getWidth(props.xl)};\n max-width: ${props.xl === true ? '100%' : getWidth(props.xl)};\n }\n `};\n `};\n`;\n\nexport const Flex = React.forwardRef<HTMLDivElement, FlexProps>(\n (props, ref) => {\n const {\n children,\n alignContent = FlexAlignContent.stretch,\n alignItems = FlexAlignItems.stretch,\n direction = FlexDirection.row,\n justify = FlexJustify.flexStart,\n spacing = 0,\n testId,\n wrap = FlexWrap.wrap,\n ...other\n } = props;\n\n const theme = React.useContext(ThemeContext);\n\n return (\n <StyledFlex\n {...other}\n alignContent={alignContent}\n alignItems={alignItems}\n data-testid={testId}\n direction={direction}\n justify={justify}\n ref={ref}\n spacing={spacing}\n theme={theme}\n wrap={wrap}\n >\n {children}\n </StyledFlex>\n );\n }\n);\n","import * as React from 'react';\nimport styled from '../../theme/styled';\nimport { css } from '@emotion/core';\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport { magma, ThemeInterface } from '../../theme/magma';\nimport { TypographyVisualStyle, TypographyComponent } from '../Typography';\nimport { InverseContext, useIsInverse } from '../../inverse';\n\n/**\n * @children required\n */\nexport interface ListProps extends React.HTMLAttributes<HTMLDivElement> {\n description?: boolean;\n /**\n * Allows an ordered list to start at a determined value of a letter or number.\n */\n hasStart?: string;\n /**\n * For use with inline icons within list items.\n */\n icon?: React.ReactElement<any> | React.ReactElement<any>[];\n /**\n * Aligns the icon at the top, or center of each list item.\n */\n iconAlign?: IconAlignment;\n /**\n * Sizes the icon between small, medium, and large.\n * @default 'medium'\n *\n */\n iconSize?: IconSizes;\n isInverse?: boolean;\n /**\n * @default false\n */\n isOrdered?: boolean;\n /**\n * If list is ordered, then this allows the list to reverse the content.\n * @default false\n */\n isReversed?: boolean;\n /**\n * Options for list type bullet formatting.\n */\n listType?: ulListType | olListType;\n /**\n * Adds a bottom margin to each list item with the Magma space scale.\n */\n spacingStyle?: keyof typeof magma.spaceScale;\n testId?: string;\n /**\n * @internal\n */\n theme?: ThemeInterface;\n /**\n * Applies visual styles including font-size, font-weight, line-height and margins\n * @default TypographyVisualStyle.bodyMedium\n */\n\n visualStyle?: TypographyVisualStyle;\n}\n\nexport enum IconSizes {\n small = 'small',\n medium = 'medium',\n large = 'large',\n}\n\nexport enum IconAlignment {\n center = 'center',\n top = 'top',\n}\n\nexport enum ulListType {\n circle = 'circle',\n disc = 'disc',\n square = 'square',\n}\n\nexport enum olListType {\n lowercase = 'a',\n uppercase = 'A',\n lowercaseRoman = 'i',\n uppercaseRoman = 'I',\n numbers = '1',\n}\n\nexport function getIconSizes(props) {\n switch (props.iconSize) {\n case IconSizes.small:\n return props.theme.iconSizes.small;\n case IconSizes.large:\n return props.theme.iconSizes.large;\n default:\n return props.theme.iconSizes.medium;\n }\n}\n\nexport function getListAlignment(props) {\n switch (props.iconAlign) {\n case IconAlignment.center:\n return `center`;\n case IconAlignment.top:\n return `flex-start`;\n default:\n return `center`;\n }\n}\n\nexport function getListDisplay(props) {\n if (props.icon) {\n return 'grid';\n }\n return 'list-item';\n}\n\nconst ListStyles = props => css`\n margin: 0;\n padding: 0;\n list-style-type: ${props.listType};\n color: ${props.isInverse\n ? props.theme.colors.neutral08\n : props.theme.colors.neutral};\n li {\n align-items: ${getListAlignment(props)};\n margin-bottom: ${props.spacingStyle};\n grid-template-areas: 'a b';\n grid-template-columns: auto 1fr;\n }\n span {\n margin: ${props.iconSize === 'small'\n ? '0 16px 0 0'\n : props.iconSize === 'large'\n ? '0 26px 0 0'\n : '0 18px 0 0'};\n }\n p {\n font-size: 0.8em;\n font-weight: 400;\n margin-bottom: 8px;\n margin-left: 0;\n grid-template: 'b';\n grid-column-start: 2;\n }\n svg {\n height: ${getIconSizes(props)}px;\n width: ${getIconSizes(props)}px;\n }\n`;\n\nconst StyledList = styled(TypographyComponent)`\n ${ListStyles};\n`;\n\nexport const List = React.forwardRef<HTMLDivElement, ListProps>(\n (props, ref) => {\n const {\n children,\n color,\n description,\n testId,\n hasStart,\n icon,\n iconAlign,\n iconSize,\n isInverse: isInverseProp,\n isOrdered,\n isReversed,\n listType,\n spacingStyle,\n visualStyle,\n ...rest\n } = props;\n const theme = React.useContext(ThemeContext);\n const isInverse = useIsInverse(isInverseProp);\n\n return (\n <InverseContext.Provider value={{ isInverse }}>\n <StyledList\n as={isOrdered ? 'ol' : 'ul'}\n data-testid={props.testId}\n description={description}\n icon={icon}\n iconAlign={iconAlign}\n iconSize={iconSize}\n isInverse={isInverse}\n type={listType ? listType : 'inherit'}\n reversed={isReversed}\n ref={ref}\n spacingStyle={magma.spaceScale[spacingStyle] || spacingStyle}\n start={hasStart}\n theme={theme}\n visualStyle={\n visualStyle ? visualStyle : TypographyVisualStyle.bodyMedium\n }\n {...rest}\n >\n {children}\n </StyledList>\n </InverseContext.Provider>\n );\n }\n);\n","import * as React from 'react';\nimport { useIsInverse } from '../../inverse';\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport {\n TypographyVisualStyle,\n TypographyColor,\n TypographyContextVariant,\n TypographyComponent,\n} from '../Typography';\n\n/**\n * @children required\n */\nexport interface ParagraphProps\n extends React.HTMLAttributes<HTMLParagraphElement> {\n /**\n * The color of the component, helping to convey meaning or relative emphasis\n * @default TypographyColor.default\n */\n color?: TypographyColor;\n /**\n * Additional styles for typography based on the context of the content\n * @default TypographyContextVariant.default\n */\n contextVariant?: TypographyContextVariant;\n isInverse?: boolean;\n /**\n * If true, the component will not have the default top and bottom margin and instead will a margin value of 0\n * @default false\n */\n noMargins?: boolean;\n testId?: string;\n /**\n * @internal\n */\n theme?: any;\n /**\n * Applies visual styles including font-size, font-weight, line-height and margins\n * @default TypographyVisualStyle.bodyMedium\n */\n visualStyle?: TypographyVisualStyle;\n}\n\nexport const Paragraph = React.forwardRef<HTMLParagraphElement, ParagraphProps>(\n (props, ref) => {\n const { color, testId, visualStyle, children, ...other } = props;\n const theme = React.useContext(ThemeContext);\n\n return (\n <TypographyComponent\n {...other}\n color={color || TypographyColor.default}\n data-testid={testId}\n isInverse={useIsInverse(props.isInverse)}\n ref={ref}\n theme={theme}\n visualStyle={visualStyle || TypographyVisualStyle.bodyMedium}\n >\n {children}\n </TypographyComponent>\n );\n }\n);\n","import * as React from 'react';\nimport { Alert } from '../Alert';\nimport { AlertVariant } from '../AlertBase';\nimport { Heading } from '../Heading';\nimport { Paragraph } from '../Paragraph';\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport { ThemeInterface } from '../../theme/magma';\nimport { InverseContext, useIsInverse } from '../../inverse';\nimport styled from '@emotion/styled';\nimport { TypographyContextVariant, TypographyVisualStyle } from '../Typography';\n\n/**\n * @children required\n */\nexport interface FormProps extends React.FormHTMLAttributes<HTMLFormElement> {\n /**\n * React Node containing the form action buttons; will appear under the form fields\n */\n actions: React.ReactNode;\n /**\n * General description of the form\n */\n description?: string;\n /**\n * Additional form level validation message\n */\n errorMessage?: string;\n /**\n * Title of the form\n */\n header: string;\n /**\n * Additional styles to the form heading for typography based on the context of the content\n * @default TypographyColor.default\n */\n headingContextVariant?: TypographyContextVariant;\n /**\n * Number to indicate which level heading will render for the form header (e.g. h1, h2 etc.)\n * @default 3\n */\n headingLevel?: 1 | 2 | 3 | 4 | 5 | 6;\n /**\n * Applies visual styles to the form heading including font-size, font-weight, line-height and margins\n */\n headingVisualStyle?: TypographyVisualStyle;\n isInverse?: boolean;\n /**\n * Handler for form submission\n */\n testId?: string;\n}\n\nconst StyledForm = styled.form<{ isInverse?: boolean; theme: ThemeInterface }>`\n background: ${props =>\n props.isInverse\n ? props.theme.colors.foundation\n : props.theme.colors.neutral08};\n color: ${props =>\n props.isInverse\n ? props.theme.colors.neutral08\n : props.theme.colors.neutral};\n`;\n\nconst FormActions = styled.div`\n display: flex;\n justify-content: flex-end;\n`;\n\nexport const Form = React.forwardRef<HTMLFormElement, FormProps>(\n (props, ref) => {\n const {\n actions,\n children,\n header,\n headingContextVariant,\n headingLevel = 3,\n headingVisualStyle,\n description,\n errorMessage,\n testId,\n ...other\n } = props;\n\n const theme = React.useContext(ThemeContext);\n\n const isInverse = useIsInverse(props.isInverse);\n\n return (\n <InverseContext.Provider\n value={{\n isInverse,\n }}\n >\n <StyledForm\n ref={ref}\n data-testid={testId}\n isInverse={isInverse}\n theme={theme}\n {...other}\n >\n <Heading\n contextVariant={headingContextVariant}\n level={headingLevel}\n visualStyle={headingVisualStyle}\n >\n {header}\n </Heading>\n {description && <Paragraph>{description}</Paragraph>}\n {errorMessage && (\n <Alert variant={AlertVariant.danger}>{errorMessage}</Alert>\n )}\n <div>{children}</div>\n <FormActions>{actions}</FormActions>\n </StyledForm>\n </InverseContext.Provider>\n );\n }\n);\n","import * as React from 'react';\nimport { css } from '@emotion/core';\nimport styled from '../../theme/styled';\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport { convertStyleValueToString, useGenerateId } from '../../utils';\nimport { useIsInverse } from '../../inverse';\nimport { VisuallyHidden } from '../VisuallyHidden';\n\nexport interface ProgressBarProps extends React.HTMLAttributes<HTMLDivElement> {\n /**\n * The color variant of the progress bar\n * @default ProgressBarColor.primary\n */\n color?: ProgressBarColor;\n /**\n * The height of the progress bar. Can be a string or number; if number is provided height is in px\n * @default 8\n */\n height?: number | string;\n /**\n * If true, the progress bar with have a shimmer animation\n * @default false\n */\n isAnimated?: boolean;\n isInverse?: boolean;\n /**\n * @internal\n */\n isLoadingIndicator?: boolean;\n /**\n * If true, the label with the percentage value will display to the right of the progress bar\n * @default false\n */\n isLabelVisible?: boolean;\n /**\n * The percentage of which the bar is filled\n * @default 0\n */\n percentage?: number;\n testId?: string;\n}\n\nexport enum ProgressBarColor {\n danger = 'danger',\n primary = 'primary', // default\n pop = 'pop',\n pop02 = 'pop02',\n success = 'success',\n}\n\nfunction buildProgressBarBackground(props) {\n if (props.isInverse) {\n switch (props.color) {\n case 'danger':\n return props.theme.colors.dangerInverse;\n case 'success':\n return props.theme.colors.successInverse;\n default:\n return props.theme.colors.primaryInverse;\n }\n }\n switch (props.color) {\n case 'danger':\n return props.theme.colors.danger;\n case 'pop':\n return props.theme.colors.pop;\n case 'pop02':\n return props.theme.colors.pop02;\n case 'success':\n return props.theme.colors.success;\n default:\n return props.theme.colors.primary;\n }\n}\n\nconst Container = styled.div<{ isLoadingIndicator?: boolean }>`\n align-items: center;\n display: ${props => (props.isLoadingIndicator ? 'block' : 'flex')};\n`;\n\nconst Track = styled.div<ProgressBarProps>`\n background: ${props =>\n props.isInverse ? 'rgba(0,0,0,0.25)' : props.theme.colors.neutral08};\n box-shadow: inset 0 0 0 1px\n ${props =>\n props.isInverse\n ? `${props.theme.colors.neutral08}80`\n : props.theme.colors.neutral04};\n border-radius: 50em;\n overflow: hidden;\n display: flex;\n height: ${props => props.height};\n /* padding: 1px; */\n width: 100%;\n`;\n\nconst Bar = styled.div<ProgressBarProps>`\n background: ${props => buildProgressBarBackground(props)};\n border-radius: 50em;\n display: flex;\n transition: width 0.3s;\n width: ${props => props.percentage}%;\n\n ${props =>\n props.isAnimated &&\n css`\n background-image: linear-gradient(\n to right,\n ${buildProgressBarBackground(props)} 0%,\n rgba(255, 255, 255, 0.5) 20%,\n ${buildProgressBarBackground(props)} 40%,\n ${buildProgressBarBackground(props)} 100%\n );\n background-repeat: no-repeat;\n background-size: 1800px 104px;\n display: inline-block;\n position: relative;\n\n animation-duration: 1s;\n animation-fill-mode: forwards;\n animation-iteration-count: infinite;\n animation-name: placeholderShimmer;\n animation-timing-function: linear;\n\n @keyframes placeholderShimmer {\n 0% {\n background-position: -600px 0;\n }\n\n 100% {\n background-position: 600px 0;\n }\n }\n `}\n`;\n\nconst Percentage = styled.span`\n font-size: ${props => props.theme.typeScale.size02.fontSize};\n letter-spacing: ${props => props.theme.typeScale.size02.letterSpacing};\n line-height: ${props => props.theme.typeScale.size02.lineHeight};\n margin-left: ${props => props.theme.spaceScale.spacing03};\n`;\n\nconst TopPercentage = styled.div`\n font-size: ${props => props.theme.typeScale.size05.fontSize};\n line-height: ${props => props.theme.typeScale.size05.lineHeight};\n margin-bottom: ${props => props.theme.spaceScale.spacing03};\n text-align: center;\n`;\n\nexport const ProgressBar = React.forwardRef<HTMLDivElement, ProgressBarProps>(\n (props, ref) => {\n const {\n color,\n height,\n id: defaultId,\n isAnimated,\n isLabelVisible,\n isLoadingIndicator,\n percentage,\n testId,\n ...other\n } = props;\n\n const id = useGenerateId(defaultId);\n const labelId = `${id}__label`;\n\n const percentageValue = percentage ? percentage : 0;\n\n const theme = React.useContext(ThemeContext);\n\n const heightString = convertStyleValueToString(\n height,\n theme.spaceScale.spacing03\n );\n\n const isInverse = useIsInverse(props.isInverse);\n\n return (\n <Container\n {...other}\n id={defaultId}\n isLoadingIndicator={isLoadingIndicator}\n >\n {isLoadingIndicator && (\n <TopPercentage theme={theme}>{percentageValue}%</TopPercentage>\n )}\n <Track\n data-testid={testId}\n height={heightString}\n isInverse={isInverse}\n ref={ref}\n theme={theme}\n >\n <Bar\n aria-labelledby={labelId}\n aria-valuenow={percentageValue}\n aria-valuemin={0}\n aria-valuemax={100}\n color={color}\n isAnimated={isAnimated}\n isInverse={isInverse}\n percentage={percentageValue}\n role=\"progressbar\"\n theme={theme}\n />\n </Track>\n {isLabelVisible ? (\n <Percentage id={labelId} theme={theme}>\n {percentageValue}%\n </Percentage>\n ) : (\n <VisuallyHidden id={labelId}>{percentageValue}%</VisuallyHidden>\n )}\n </Container>\n );\n }\n);\n","import * as React from 'react';\nimport styled from '../../theme/styled';\nimport { css } from '@emotion/core';\nimport { getListDisplay, ListProps } from './';\nimport { magma } from '../../theme/magma';\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport { InverseContext, useIsInverse } from '../../inverse';\n\n/**\n * @children required\n */\nexport interface ListItemProps\n extends ListProps,\n React.HTMLAttributes<HTMLDivElement> {\n /**\n * Option for changing icon background with all Magma colors.\n */\n iconBackground?: keyof typeof magma.colors;\n /**\n * Option for changing icon color with all Magma colors.\n */\n iconColor?: keyof typeof magma.colors;\n}\n\nconst ListItemStyles = props => css`\n display: ${getListDisplay(props)};\n margin: 0;\n padding: 0;\n margin-left: ${props.icon ? 'inherit' : '1.1em'};\n color: ${props.description && !props.isInverse\n ? props.theme.colors.neutral03\n : 'inherit'};\n list-style-type: ${props.icon || props.description ? 'none' : 'inherit'};\n`;\n\nconst IconStyles = props => css`\n background: ${props.iconBackground};\n color: ${props.iconColor};\n border-radius: 50%;\n display: inline-flex;\n padding: 10px;\n`;\n\nconst StyledListItem = styled.li`\n ${ListItemStyles};\n`;\n\nconst StyledIcon = styled.span`\n ${IconStyles};\n`;\n\nexport const ListItem = React.forwardRef<HTMLDivElement, ListItemProps>(\n (props, ref) => {\n const {\n children,\n description,\n icon,\n iconAlign,\n iconBackground,\n iconColor,\n testId,\n isInverse: isInverseProp,\n } = props;\n const theme = React.useContext(ThemeContext);\n const isInverse = useIsInverse(isInverseProp);\n\n return (\n <InverseContext.Provider value={{ isInverse }}>\n <StyledListItem\n as={description ? 'p' : 'li'}\n description={description}\n icon={icon}\n iconAlign={iconAlign}\n isInverse={isInverse}\n theme={theme}\n testId={testId}\n >\n {icon && (\n <StyledIcon\n iconBackground={\n magma.colors[iconBackground] || magma.colors.primary\n }\n iconColor={magma.colors[iconColor] || magma.colors.neutral08}\n theme={theme}\n >\n {icon}\n </StyledIcon>\n )}\n {children}\n </StyledListItem>\n </InverseContext.Provider>\n );\n }\n);\n","import * as React from 'react';\nimport { ProgressBar, ProgressBarColor } from '../ProgressBar';\nimport { Spinner } from '../Spinner';\nimport styled from '@emotion/styled';\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport { ThemeInterface } from '../../theme/magma';\nimport { I18nContext } from '../../i18n';\n\nexport interface LoadingIndicatorProps\n extends React.HTMLAttributes<HTMLDivElement | HTMLSpanElement> {\n /**\n * @internal\n */\n css?: any; // Adding css prop to fix emotion error\n /**\n * Message displayed for the first five seconds\n * @default \"Loading...\"\n */\n message1?: string;\n /**\n * Message displayed for the first five seconds\n * @default \"Thank you for your patience. Still loading...\"\n */\n message2?: string;\n /**\n * Message displayed after 15 seconds\n * @default \"Sorry for the delay. This is taking longer than expected.\"\n */\n message3?: string;\n /**\n * Message displayed for the first five seconds\n * @default 0\n */\n percentage?: number;\n testId?: string;\n /**\n * Type of loading indictor to display, can be progress bar or spinner\n * @default LoadingIndicatorType.spinner\n */\n type?: LoadingIndicatorType;\n}\n\nexport enum LoadingIndicatorType {\n progressbar = 'progressbar',\n spinner = 'spinner', // default\n}\n\nexport interface LoadingIndicatorState {\n messageLevel: number;\n}\n\nconst StyledLoadingIndicator = styled.div`\n text-align: center;\n`;\n\nconst MessageContainer = styled.div<{ theme: ThemeInterface }>`\n font-size: ${props => props.theme.typeScale.size02.fontSize};\n letter-spacing: ${props => props.theme.typeScale.size02.letterSpacing};\n line-height: ${props => props.theme.typeScale.size02.lineHeight};\n margin-top: ${props => props.theme.spaceScale.spacing05};\n min-height: 5em;\n position: relative;\n text-align: center;\n`;\n\nconst Message = styled.div<{ hide?: boolean }>`\n opacity: ${props => (props.hide ? '0' : '1')};\n position: absolute;\n transition: opacity 0.3s;\n width: 100%;\n`;\n\nexport const LoadingIndicator = React.forwardRef<\n HTMLDivElement,\n LoadingIndicatorProps\n>((props, ref) => {\n const [messageLevel, setMessageLevel] = React.useState<1 | 2 | 3>(1);\n\n const theme = React.useContext(ThemeContext);\n const i18n = React.useContext(I18nContext);\n\n React.useEffect(() => {\n const { type: loadingIndicatorType } = props;\n const messageLevel2Timeout = setTimeout(\n () => {\n setMessageLevel(2);\n },\n loadingIndicatorType === LoadingIndicatorType.progressbar ? 10000 : 5000\n );\n\n const messageLevel3Timeout = setTimeout(\n () => {\n setMessageLevel(3);\n },\n loadingIndicatorType === LoadingIndicatorType.progressbar ? 30000 : 15000\n );\n\n return () => {\n clearTimeout(messageLevel2Timeout);\n clearTimeout(messageLevel3Timeout);\n };\n }, []);\n\n const { color, testId, type, ...other } = props;\n let { message1, message2, message3 } = props;\n\n message1 = message1\n ? message1\n : type === LoadingIndicatorType.progressbar\n ? i18n.loadingIndicator.progressBar.messages.first\n : i18n.loadingIndicator.spinner.messages.first;\n\n message2 = message2\n ? message2\n : type === LoadingIndicatorType.progressbar\n ? i18n.loadingIndicator.progressBar.messages.second\n : i18n.loadingIndicator.spinner.messages.second;\n\n message3 = message3\n ? message3\n : type === LoadingIndicatorType.progressbar\n ? i18n.loadingIndicator.progressBar.messages.third\n : i18n.loadingIndicator.spinner.messages.third;\n\n return (\n <StyledLoadingIndicator aria-busy=\"true\" data-testid={testId} ref={ref}>\n {type === LoadingIndicatorType.progressbar ? (\n <ProgressBar\n {...other}\n color={color as ProgressBarColor}\n height={theme.spaceScale.spacing03}\n isAnimated\n isLoadingIndicator\n />\n ) : (\n <Spinner {...other} size={theme.spaceScale.spacing10} />\n )}\n\n <MessageContainer theme={theme}>\n <Message aria-hidden={messageLevel !== 1} hide={messageLevel !== 1}>\n {message1}\n </Message>\n <Message aria-hidden={messageLevel !== 2} hide={messageLevel !== 2}>\n {message2}\n </Message>\n <Message aria-hidden={messageLevel !== 3} hide={messageLevel !== 3}>\n {message3}\n </Message>\n </MessageContainer>\n </StyledLoadingIndicator>\n );\n});\n","import styled from '../../theme/styled';\n\nimport { inputBaseStyles } from '../InputBase';\nimport { Card } from '../Card';\n\nexport const SelectContainer = styled.div`\n position: relative;\n`;\n\nexport const StyledButton = styled.div`\n ${inputBaseStyles}\n align-items: center;\n display: flex;\n text-align: left;\n`;\n\nexport const SelectText = styled.span`\n flex-grow: 1;\n padding: 0 8px 0 4px;\n`;\n\nexport const StyledCard = styled(Card)<{\n isOpen?: boolean;\n}>`\n display: ${props => (props.isOpen ? 'block' : 'none')};\n left: 4px;\n margin-top: 4px;\n padding: 4px 0 0;\n position: absolute;\n right: 4px;\n top: auto;\n z-index: 2;\n`;\n\nexport const StyledList = styled('ul')<{ isOpen?: boolean; maxHeight: string }>`\n display: ${props => (props.isOpen ? 'block' : 'none')};\n list-style: none;\n margin: 0 0 4px;\n outline: none;\n padding: 0;\n max-height: ${props => props.maxHeight};\n overflow-y: auto;\n`;\n\nexport const StyledItem = styled('li')<{ isFocused?: boolean }>`\n align-self: center;\n background: ${props =>\n props.isFocused ? props.theme.colors.neutral06 : 'transparent'};\n border: 2px dotted;\n border-color: ${props =>\n props.isFocused ? props.theme.colors.focus : 'transparent'};\n cursor: default;\n line-height: 24px;\n margin: 0;\n padding: 8px 16px;\n`;\n\nexport const SelectedItemsWrapper = styled.span`\n display: flex;\n flex-grow: 1;\n flex-wrap: wrap;\n padding: 0 0 0 4px;\n`;\n\nexport const SelectedItemButton = styled.button`\n align-self: center;\n background: ${props => props.theme.colors.neutral06};\n border-radius: 4px;\n border: 0;\n box-shadow: 0 0 0;\n display: flex;\n font-size: 12px;\n line-height: 16px;\n height: 24px;\n margin: 4px 2px 4px 4px;\n padding: ${props => props.theme.spaceScale.spacing02}\n ${props => props.theme.spaceScale.spacing02}\n ${props => props.theme.spaceScale.spacing02}\n ${props => props.theme.spaceScale.spacing03};\n position: relative;\n white-space: nowrap;\n`;\n\nexport const IconWrapper = styled.span`\n padding-left: 12px;\n`;\n","import * as React from 'react';\nimport { IconButton, IconButtonProps } from '../IconButton';\nimport { Spinner, SpinnerProps } from '../Spinner';\nimport { IconProps, ArrowDropDownIcon } from 'react-magma-icons';\nimport { StyledItem } from './shared';\nimport { ThemeInterface } from '../../theme/magma';\n\nexport type ItemRenderOptions<T> = {\n key: string;\n isFocused?: boolean;\n item: T;\n itemRef: React.Ref<HTMLLIElement>;\n itemString: string;\n theme: ThemeInterface;\n [key: string]: any;\n};\n\nexport type SelectComponents<T> = {\n ClearIndicator?: React.FunctionComponent<IconButtonProps>;\n DropdownIndicator?: React.FunctionComponent<Partial<IconProps>>;\n LoadingIndicator?: React.FunctionComponent<SpinnerProps>;\n Item?: React.FunctionComponent<ItemRenderOptions<T>>;\n};\n\nexport const DefaultClearIndicator = props => {\n return <IconButton testId=\"clearIndicator\" {...props} />;\n};\n\nexport const DefaultDropdownIndicator = props => {\n return (\n <ArrowDropDownIcon\n size={24}\n style={{ flexShrink: 0 }}\n testId=\"caretDown\"\n {...props}\n />\n );\n};\n\nexport const DefaultLoadingIndicator = props => {\n return <Spinner testId=\"loadingIndicator\" {...props} />;\n};\n\nexport function DefaultItem<T>({\n itemRef,\n itemString,\n ...props\n}: ItemRenderOptions<T>) {\n return (\n <StyledItem {...props} ref={itemRef}>\n {itemString}\n </StyledItem>\n );\n}\n\nexport function defaultComponents<T>(props: SelectComponents<T>) {\n return {\n ClearIndicator: DefaultClearIndicator,\n DropdownIndicator: DefaultDropdownIndicator,\n LoadingIndicator: DefaultLoadingIndicator,\n Item: DefaultItem,\n ...props,\n };\n}\n","import React from 'react';\nimport {\n inputBaseStyles,\n inputWrapperStyles,\n InputBaseStylesProps,\n InputWrapperStylesProps,\n} from '../InputBase';\nimport { defaultComponents, SelectComponents } from '../Select/components';\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport styled from '../../theme/styled';\n\nconst StyledButton = styled.div<InputBaseStylesProps & InputWrapperStylesProps>`\n ${inputBaseStyles}\n ${inputWrapperStyles}\n\n align-items: center;\n display: flex;\n height: auto;\n min-height: ${props => props.theme.spaceScale.spacing09};\n padding: 0 ${props => props.theme.spaceScale.spacing03} 0\n ${props => props.theme.spaceScale.spacing02};\n text-align: left;\n`;\n\nconst ChildrenContainer = styled.div`\n align-items: center;\n display: flex;\n flex-grow: 1;\n flex-wrap: wrap;\n`;\n\ninterface SelectTriggerButtonInterface<T> {\n ariaDescribedBy?: string;\n children: React.ReactNode | React.ReactNode[];\n customComponents?: SelectComponents<T>;\n hasError?: boolean;\n disabled?: boolean;\n isInverse?: boolean;\n style?: React.CSSProperties;\n toggleButtonProps: any;\n tabindex?: number;\n}\n\nexport function SelectTriggerButton<T>(props: SelectTriggerButtonInterface<T>) {\n const {\n ariaDescribedBy,\n children,\n customComponents,\n hasError,\n disabled,\n isInverse,\n style: passedInStyle,\n toggleButtonProps,\n } = props;\n const theme = React.useContext(ThemeContext);\n\n const { DropdownIndicator } = defaultComponents<T>({\n ...customComponents,\n });\n\n const style = { ...passedInStyle, cursor: 'default' };\n\n return (\n <StyledButton\n {...toggleButtonProps}\n aria-describedby={ariaDescribedBy}\n data-testid=\"selectTriggerButton\"\n hasError={hasError}\n disabled={disabled}\n isInverse={isInverse}\n role=\"button\"\n style={style}\n theme={theme}\n tabIndex={disabled ? undefined : 0}\n >\n <ChildrenContainer>{children}</ChildrenContainer>\n <DropdownIndicator />\n </StyledButton>\n );\n}\n","export enum TabsOrientation {\n horizontal = 'horizontal',\n vertical = 'vertical',\n}\n","import * as React from 'react';\nimport styled from '../../theme/styled';\n\nimport { inputBaseStyles } from '../InputBase';\nimport {\n FormFieldContainer,\n FormFieldContainerBaseProps,\n} from '../FormFieldContainer';\nimport { SelectTriggerButton } from '../Select/SelectTriggerButton';\n\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport { useIsInverse } from '../../inverse';\nimport { useGenerateId } from '../../utils';\n\n/**\n * @children required\n */\nexport interface NativeSelectProps\n extends Omit<FormFieldContainerBaseProps, 'inputSize'>,\n React.SelectHTMLAttributes<HTMLSelectElement> {\n testId?: string;\n optionLabel?: string;\n}\nconst StyledNativeSelect = styled.select`\n ${inputBaseStyles};\n background: inherit;\n`;\n\nexport const NativeSelect = React.forwardRef<HTMLDivElement, NativeSelectProps>(\n (props, ref) => {\n const {\n children,\n containerStyle,\n disabled,\n errorMessage,\n id: defaultId,\n helperMessage,\n isInverse: isInverseProp,\n labelStyle,\n labelText,\n messageStyle,\n testId,\n ...other\n } = props;\n const theme = React.useContext(ThemeContext);\n const isInverse = useIsInverse(isInverseProp);\n const id = useGenerateId(defaultId);\n\n return (\n <FormFieldContainer\n containerStyle={containerStyle}\n errorMessage={errorMessage}\n fieldId={id}\n labelStyle={labelStyle}\n labelText={labelText}\n isInverse={isInverse}\n helperMessage={helperMessage}\n messageStyle={messageStyle}\n ref={ref}\n >\n <SelectTriggerButton\n disabled={disabled}\n hasError={!!errorMessage}\n isInverse={isInverse}\n toggleButtonProps={''}\n >\n <StyledNativeSelect\n {...other}\n data-testid={testId}\n disabled={disabled}\n id={id}\n isInverse={isInverse}\n theme={theme}\n >\n {children}\n </StyledNativeSelect>\n </SelectTriggerButton>\n </FormFieldContainer>\n );\n }\n);\n","import React from 'react';\nimport styled from '@emotion/styled';\nimport { useIsInverse } from '../../inverse';\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport { ThemeInterface } from '../../theme/magma';\n\ninterface TabsContainerProps extends React.HTMLAttributes<HTMLDivElement> {\n /**\n * The index of the current active tab. You can use this for managing state of the tabs component by your custom logic.\n */\n activeIndex?: number;\n isInverse?: boolean;\n testId?: string;\n}\n\ninterface TabsContainerContextInterface {\n activeTabIndex: number;\n isInverseContainer: boolean;\n setActiveTabIndex: React.Dispatch<React.SetStateAction<number>>;\n}\n\nexport const TabsContainerContext = React.createContext<TabsContainerContextInterface>(\n {\n activeTabIndex: 0,\n isInverseContainer: false,\n setActiveTabIndex: () => 0,\n }\n);\n\nconst StyledTabsContainer = styled.div<{\n isInverse?: boolean;\n theme: ThemeInterface;\n}>`\n background: ${props =>\n props.isInverse ? props.theme.colors.foundation02 : 'none'};\n color: ${props =>\n props.isInverse\n ? props.theme.colors.neutral08\n : props.theme.colors.neutral};\n display: flex;\n flex-wrap: wrap;\n position: relative;\n`;\n\nexport const TabsContainer = React.forwardRef<\n HTMLDivElement,\n TabsContainerProps\n>((props, ref) => {\n const { activeIndex, children, testId } = props;\n\n React.useEffect(() => {\n if (activeIndex >= 0) {\n setActiveTabIndex(activeIndex);\n }\n }, [activeIndex]);\n\n const [activeTabIndex, setActiveTabIndex] = React.useState(activeIndex || 0);\n\n const isInverse = useIsInverse(props.isInverse);\n\n React.useEffect(() => {\n setIsInverseContainer(isInverse);\n }, [props.isInverse]);\n\n const [isInverseContainer, setIsInverseContainer] = React.useState(\n Boolean(props.isInverse)\n );\n\n const theme = React.useContext(ThemeContext);\n\n return (\n <TabsContainerContext.Provider\n value={{\n activeTabIndex,\n setActiveTabIndex,\n isInverseContainer,\n }}\n >\n <StyledTabsContainer\n ref={ref}\n data-testid={testId}\n theme={theme}\n {...props}\n >\n {children}\n </StyledTabsContainer>\n </TabsContainerContext.Provider>\n );\n});\n","import React from 'react';\nimport styled from '@emotion/styled';\nimport { css } from '@emotion/core';\nimport { transparentize } from 'polished';\nimport { TabsOrientation } from './shared';\nimport { ThemeInterface } from '../../theme/magma';\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport { I18nContext } from '../../i18n';\n\nimport {\n ArrowBackIosIcon,\n ExpandLessIcon,\n ExpandMoreIcon,\n ArrowForwardIosIcon,\n} from 'react-magma-icons';\n\nexport interface ScrollButtonProps\n extends React.HTMLAttributes<HTMLButtonElement> {\n backgroundColor?: string;\n buttonVisible?: boolean;\n isInverse?: boolean;\n orientation?: TabsOrientation;\n theme?: ThemeInterface;\n}\n\nconst StyledScrollButton = styled.button<ScrollButtonProps>`\n align-items: center;\n backdrop-filter: blur(1px);\n border: 0;\n color: ${props =>\n props.isInverse\n ? props.theme.colors.neutral08\n : props.theme.colors.neutral};\n cursor: pointer;\n display: ${props => (props.buttonVisible ? 'flex' : 'none')};\n justify-content: center;\n outline-offset: 0;\n position: absolute;\n -webkit-appearance: none;\n z-index: 2;\n\n bottom: 0;\n top: 0;\n width: 44px;\n\n ${props =>\n props.orientation === 'vertical' &&\n css`\n left: 0;\n height: 44px;\n right: 0;\n width: 100%;\n `}\n`;\n\nconst StyledButtonPrev = styled(StyledScrollButton)<ScrollButtonProps>`\n background: ${props => `linear-gradient(\n 90deg,\n ${props.backgroundColor} 0%,\n ${transparentize(0.5, props.backgroundColor)} 100%\n )`};\n left: 0;\n\n ${props =>\n props.orientation === 'vertical' &&\n css`\n background: ${`linear-gradient(\n ${props.backgroundColor} 0%,\n ${transparentize(0.5, props.backgroundColor)} 100%\n )`};\n\n bottom: auto;\n `}\n`;\n\nconst StyledButtonNext = styled(StyledScrollButton)<{\n backgroundColor?: string;\n orientation?: TabsOrientation;\n}>`\n background: ${props => `linear-gradient(\n 90deg,\n ${transparentize(0.5, props.backgroundColor)} 0%,\n ${props.backgroundColor} 100%\n )`};\n right: 0;\n\n ${props =>\n props.orientation === 'vertical' &&\n css`\n background: linear-gradient(\n ${transparentize(0.5, props.backgroundColor)} 0%,\n ${props.backgroundColor} 100%\n );\n top: auto;\n `}\n`;\n\nexport const ButtonPrev = React.forwardRef<\n HTMLButtonElement,\n ScrollButtonProps\n>((props, ref) => {\n const theme = React.useContext(ThemeContext);\n const i18n = React.useContext(I18nContext);\n\n return (\n <StyledButtonPrev\n aria-label={i18n.tabs.previousButtonLabel}\n backgroundColor={props.backgroundColor}\n buttonVisible={props.buttonVisible}\n data-testid=\"buttonPrev\"\n isInverse={props.isInverse}\n onClick={props.onClick}\n orientation={props.orientation}\n ref={ref}\n theme={props.theme}\n >\n {props.orientation === TabsOrientation.vertical ? (\n <ExpandLessIcon size={theme.iconSizes.small} />\n ) : (\n <ArrowBackIosIcon size={theme.iconSizes.small} />\n )}\n </StyledButtonPrev>\n );\n});\n\nexport const ButtonNext = React.forwardRef<\n HTMLButtonElement,\n ScrollButtonProps\n>((props, ref) => {\n const theme = React.useContext(ThemeContext);\n const i18n = React.useContext(I18nContext);\n\n return (\n <StyledButtonNext\n aria-label={i18n.tabs.nextButtonLabel}\n backgroundColor={props.backgroundColor}\n buttonVisible={props.buttonVisible}\n data-testid=\"buttonNext\"\n isInverse={props.isInverse}\n onClick={props.onClick}\n orientation={props.orientation}\n ref={ref}\n theme={props.theme}\n >\n {props.orientation === TabsOrientation.vertical ? (\n <ExpandMoreIcon size={theme.iconSizes.small} />\n ) : (\n <ArrowForwardIosIcon size={theme.iconSizes.small} />\n )}\n </StyledButtonNext>\n );\n});\n","import React from 'react';\nimport { TabsOrientation } from './shared';\nimport {\n animate,\n debounce,\n getNormalizedScrollLeft,\n detectScrollType,\n} from '../../utils';\n\nexport function useTabsMeta(theme, orientation, backgroundColor, isInverse) {\n const isRtl = theme.direction === 'rtl';\n const vertical = orientation === TabsOrientation.vertical;\n const scrollStart = vertical ? 'scrollTop' : 'scrollLeft';\n const clientSize = vertical ? 'clientHeight' : 'clientWidth';\n\n const approxTabSize = vertical\n ? theme.tabs.approxTabSize.vertical\n : theme.tabs.approxTabSize.horizontal;\n\n const background = backgroundColor\n ? backgroundColor\n : isInverse\n ? theme.colors.foundation\n : theme.colors.neutral08;\n\n const [displayScroll, setDisplayScroll] = React.useState({\n start: false,\n end: false,\n });\n\n const tabsWrapperRef = React.useRef<HTMLDivElement>();\n const prevButtonRef = React.useRef<HTMLButtonElement>();\n const nextButtonRef = React.useRef<HTMLButtonElement>();\n\n function scroll(scrollValue) {\n animate(scrollStart, tabsWrapperRef.current, scrollValue);\n }\n\n function moveTabsScroll(delta) {\n let scrollValue = tabsWrapperRef.current[scrollStart];\n\n if (vertical) {\n scrollValue += delta;\n } else {\n scrollValue += delta * (isRtl ? -1 : 1);\n // Fix for Edge\n scrollValue *= isRtl && detectScrollType() === 'reverse' ? -1 : 1;\n }\n\n scroll(scrollValue);\n }\n\n function handleStartScrollClick() {\n moveTabsScroll(-tabsWrapperRef.current[clientSize] + approxTabSize);\n }\n\n function handleEndScrollClick() {\n moveTabsScroll(tabsWrapperRef.current[clientSize] - approxTabSize);\n }\n\n function updateScrollButtonState() {\n const {\n scrollTop,\n scrollHeight,\n clientHeight,\n scrollWidth,\n clientWidth,\n } = tabsWrapperRef.current;\n let showStartScroll;\n let showEndScroll;\n\n if (vertical) {\n showStartScroll = scrollTop > 1;\n showEndScroll = scrollTop < scrollHeight - clientHeight - 1;\n } else {\n const scrollLeft = getNormalizedScrollLeft(\n tabsWrapperRef.current,\n theme.direction\n );\n // use 1 for the potential rounding error with browser zooms.\n showStartScroll = isRtl\n ? scrollLeft < scrollWidth - clientWidth - 1\n : scrollLeft > 1;\n showEndScroll = !isRtl\n ? scrollLeft < scrollWidth - clientWidth - 1\n : scrollLeft > 1;\n }\n\n if (\n showStartScroll !== displayScroll.start ||\n showEndScroll !== displayScroll.end\n ) {\n setDisplayScroll({ start: showStartScroll, end: showEndScroll });\n }\n }\n\n React.useEffect(() => {\n const handleResize = debounce(updateScrollButtonState, 100);\n\n window.addEventListener('resize', handleResize);\n return () => {\n handleResize.clear();\n window.removeEventListener('resize', handleResize);\n };\n }, [updateScrollButtonState]);\n\n const handleTabsScroll = React.useCallback(\n debounce(updateScrollButtonState, 100),\n [updateScrollButtonState]\n );\n\n React.useEffect(() => {\n return () => {\n handleTabsScroll.clear();\n };\n }, [handleTabsScroll]);\n\n React.useEffect(updateScrollButtonState);\n\n return [\n { vertical, background, displayScroll, scrollStart },\n { handleStartScrollClick, handleEndScrollClick, handleTabsScroll, scroll },\n { prevButtonRef, nextButtonRef, tabsWrapperRef },\n ];\n}\n","import React from 'react';\nimport styled from '@emotion/styled';\nimport { TabsContainerContext } from './TabsContainer';\nimport isPropValid from '@emotion/is-prop-valid';\nimport { Omit, getNormalizedScrollLeft } from '../../utils';\nimport { useDescendants } from '../../hooks/useDescendants';\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport { ThemeInterface } from '../../theme/magma';\nimport { ButtonNext, ButtonPrev } from './TabsScrollButtons';\nimport { useTabsMeta } from './utils';\nimport { I18nContext } from '../../i18n';\n\nexport enum TabsAlignment {\n center = 'center',\n left = 'left',\n right = 'right',\n}\n\nexport enum TabsBorderPosition {\n bottom = 'bottom',\n left = 'left',\n right = 'right',\n top = 'top',\n}\n\nexport enum TabsIconPosition {\n bottom = 'bottom',\n left = 'left',\n right = 'right',\n top = 'top',\n}\n\nexport enum TabsOrientation {\n horizontal = 'horizontal',\n vertical = 'vertical',\n}\n\nexport interface VerticalTabsProps {\n orientation?: TabsOrientation.vertical;\n borderPosition?: TabsBorderPosition.left | TabsBorderPosition.right;\n}\nexport interface HorizontalTabsProps {\n orientation?: TabsOrientation.horizontal;\n borderPosition?: TabsBorderPosition.bottom | TabsBorderPosition.top;\n}\n\nexport declare type Orientation = HorizontalTabsProps | VerticalTabsProps;\n\nexport interface TabsProps\n extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange'> {\n /**\n * Alignment of the tabs menu\n * @default TabsAlignment.left\n */\n alignment?: TabsAlignment;\n /**\n * The text the screen reader will announce that describes your tablist.\n */\n 'aria-label'?: string;\n /**\n * Background color for the tabs menu\n */\n backgroundColor?: string;\n /**\n * The orientation of icon on Tab\n */\n iconPosition?: TabsIconPosition;\n /**\n * If true, the components takes the full width of the screen\n */\n isFullWidth?: boolean;\n isInverse?: boolean;\n /**\n * The onChange handler for managing state of Tabs component by your custom logic.\n */\n onChange?: (newActiveIndex: number) => void;\n orientation?: TabsOrientation;\n testId?: string;\n}\n\ninterface TabsContextInterface {\n borderPosition?: TabsBorderPosition;\n buttonRefArray?: React.MutableRefObject<React.MutableRefObject<Element>[]>;\n changeHandler: (\n newActiveIndex: number,\n event?: React.MouseEvent<HTMLButtonElement, MouseEvent>\n ) => void;\n iconPosition?: TabsIconPosition;\n isInverse?: boolean;\n isFullWidth?: boolean;\n orientation?: TabsOrientation;\n registerTabButton: (\n itemRefArray: React.MutableRefObject<React.MutableRefObject<Element>[]>,\n itemRef: React.MutableRefObject<Element>\n ) => void;\n}\n\nexport const TabsContext = React.createContext<TabsContextInterface>({\n borderPosition: TabsBorderPosition.bottom,\n changeHandler: () => {},\n iconPosition: TabsIconPosition.left,\n isInverse: false,\n isFullWidth: false,\n orientation: TabsOrientation.horizontal,\n registerTabButton: (elements, element) => {},\n});\n\nexport const StyledContainer = styled('div', {\n shouldForwardProp: isPropValid,\n})<{\n as?: string;\n orientation: TabsOrientation;\n isInverse: boolean;\n backgroundColor: string;\n theme: ThemeInterface;\n}>`\n background-color: ${props =>\n props.backgroundColor\n ? props.backgroundColor\n : props.isInverse\n ? props.theme.colors.foundation\n : 'transparent'};\n background: backgroundColor;\n display: flex;\n height: ${props => (props.orientation === 'vertical' ? '100%' : 'auto')};\n\n position: relative;\n width: ${props => (props.orientation === 'vertical' ? 'auto' : '100%')};\n`;\n\nexport const StyledTabsWrapper = styled('div', {\n shouldForwardProp: isPropValid,\n})<{\n orientation: TabsOrientation;\n}>`\n display: flex;\n flex-grow: 1;\n overflow-x: ${props => (props.orientation === 'vertical' ? '' : 'auto')};\n overflow-y: ${props => (props.orientation === 'vertical' ? 'auto' : '')};\n\n &::-webkit-scrollbar {\n width: 0;\n height: 0;\n }\n scrollbar-width: none;\n`;\n\nexport const StyledTabs = styled('ul', { shouldForwardProp: isPropValid })<{\n alignment?: TabsAlignment;\n orientation: TabsOrientation;\n}>`\n align-items: center;\n display: flex;\n flex-direction: ${props =>\n props.orientation === 'vertical' ? 'column' : 'row'};\n justify-content: ${props =>\n props.alignment === 'center'\n ? 'center'\n : props.alignment === 'right'\n ? 'flex-end'\n : ''};\n margin: 0;\n padding: 0;\n width: ${props => (props.orientation === 'vertical' ? 'auto' : '100%')};\n`;\n\nexport const Tabs = React.forwardRef<HTMLDivElement, TabsProps & Orientation>(\n (props, ref) => {\n const {\n alignment,\n backgroundColor,\n borderPosition,\n children,\n isFullWidth,\n orientation,\n onChange,\n iconPosition,\n testId,\n ...rest\n } = props;\n\n const theme = React.useContext(ThemeContext);\n\n const { activeTabIndex, setActiveTabIndex, isInverseContainer } =\n React.useContext(TabsContainerContext);\n\n const isInverse =\n typeof props.isInverse !== 'undefined'\n ? Boolean(props.isInverse)\n : isInverseContainer;\n\n const [tabsMeta, tabsHandleMethods, tabsRefs] = useTabsMeta(\n theme,\n orientation,\n backgroundColor,\n isInverse\n );\n\n const { vertical, background, displayScroll, scrollStart } = tabsMeta;\n const {\n handleStartScrollClick,\n handleEndScrollClick,\n handleTabsScroll,\n scroll,\n } = tabsHandleMethods;\n const { prevButtonRef, nextButtonRef, tabsWrapperRef } = tabsRefs;\n\n const start = vertical ? 'top' : 'left';\n const end = vertical ? 'bottom' : 'right';\n\n const [buttonRefArray, registerTabButton] = useDescendants();\n\n const childrenWrapperRef = React.useRef<HTMLUListElement>();\n\n function getTabsMeta() {\n const tabsNode = tabsWrapperRef.current;\n let tabsMeta;\n if (tabsNode) {\n const rect = tabsNode.getBoundingClientRect();\n tabsMeta = {\n clientWidth: tabsNode.clientWidth,\n scrollLeft: tabsNode.scrollLeft,\n scrollTop: tabsNode.scrollTop,\n scrollLeftNormalized: getNormalizedScrollLeft(\n tabsNode,\n theme.direction\n ),\n scrollWidth: tabsNode.scrollWidth,\n top: rect.top,\n bottom: rect.bottom,\n left: rect.left,\n right: rect.right,\n };\n }\n\n let tabMeta;\n if (tabsNode) {\n const childrenArray = childrenWrapperRef.current.children;\n if (childrenArray.length > 0) {\n const tab = childrenArray[activeTabIndex];\n tabMeta = tab ? (tab as any).getBoundingClientRect() : null;\n }\n }\n return { tabsMeta, tabMeta };\n }\n\n function scrollSelectedIntoView() {\n const { tabsMeta, tabMeta } = getTabsMeta();\n\n if (!tabMeta || !tabsMeta) {\n return;\n }\n\n const prevButtonOffset = vertical\n ? Number(prevButtonRef.current.offsetHeight)\n : Number(prevButtonRef.current.offsetWidth);\n const nextButtonOffset = vertical\n ? Number(nextButtonRef.current.offsetHeight)\n : Number(nextButtonRef.current.offsetWidth);\n\n if (tabMeta[start] < Number(tabsMeta[start]) + prevButtonOffset) {\n // left side of button is out of view\n const nextScrollStart =\n Number(tabsMeta[scrollStart]) +\n (Number(tabMeta[start]) - Number(tabsMeta[start])) -\n prevButtonOffset;\n scroll(nextScrollStart);\n } else if (tabMeta[end] > Number(tabsMeta[end]) - nextButtonOffset) {\n // right side of button is out of view\n const nextScrollStart =\n Number(tabsMeta[scrollStart]) +\n (Number(tabMeta[end]) - Number(tabsMeta[end])) +\n nextButtonOffset;\n scroll(nextScrollStart);\n }\n }\n\n React.useEffect(scrollSelectedIntoView, []);\n\n React.useEffect(scrollSelectedIntoView, [activeTabIndex]);\n\n function changeHandler(\n newActiveIndex: number,\n event?: React.MouseEvent<HTMLButtonElement, MouseEvent>\n ): void {\n if (\n (event.target as HTMLInputElement).children[0] &&\n (event.target as HTMLInputElement).children[0].hasAttribute('disabled')\n ) {\n event.preventDefault();\n return undefined;\n }\n\n onChange && typeof onChange === 'function' && onChange(newActiveIndex);\n\n newActiveIndex === activeTabIndex\n ? scrollSelectedIntoView()\n : setActiveTabIndex(newActiveIndex);\n }\n\n function tabIsEnabled(tabIndex) {\n return (\n buttonRefArray.current[tabIndex].current.getAttribute('disabled') ===\n null\n );\n }\n\n function findPreviousEnabledTabIndex(modifiedActiveTabIndex?: number) {\n const currentTabIndex = modifiedActiveTabIndex\n ? modifiedActiveTabIndex\n : activeTabIndex;\n const newActiveTabIndex = currentTabIndex > 0 ? currentTabIndex - 1 : 0;\n\n if (tabIsEnabled(newActiveTabIndex)) {\n return newActiveTabIndex;\n } else if (newActiveTabIndex - 1 >= 0) {\n return findPreviousEnabledTabIndex(newActiveTabIndex);\n } else {\n return activeTabIndex;\n }\n }\n\n function findNextEnabledTabIndex(\n lastChildIndex: number,\n modifiedActiveTabIndex?: number\n ) {\n const currentTabIndex =\n modifiedActiveTabIndex === 0 || modifiedActiveTabIndex\n ? modifiedActiveTabIndex\n : activeTabIndex;\n const newActiveTabIndex =\n currentTabIndex < lastChildIndex ? currentTabIndex + 1 : lastChildIndex;\n\n if (tabIsEnabled(newActiveTabIndex)) {\n return newActiveTabIndex;\n } else if (newActiveTabIndex + 1 <= lastChildIndex) {\n return findNextEnabledTabIndex(lastChildIndex, newActiveTabIndex);\n } else {\n return activeTabIndex;\n }\n }\n\n function handleKeyDown(event: React.KeyboardEvent) {\n const target = event.target as HTMLButtonElement;\n\n const role = target.getAttribute('role');\n if (role !== 'tab') {\n return;\n }\n\n const lastChildIndex = buttonRefArray.current.length - 1;\n let newActiveTabIndex = null;\n let previousItemKey =\n orientation !== TabsOrientation.vertical ? 'ArrowLeft' : 'ArrowUp';\n let nextItemKey =\n orientation !== TabsOrientation.vertical ? 'ArrowRight' : 'ArrowDown';\n\n switch (event.key) {\n case previousItemKey:\n newActiveTabIndex = findPreviousEnabledTabIndex();\n break;\n case nextItemKey:\n newActiveTabIndex = findNextEnabledTabIndex(lastChildIndex);\n break;\n case 'Home':\n newActiveTabIndex = tabIsEnabled(0)\n ? 0\n : findNextEnabledTabIndex(lastChildIndex, 0);\n break;\n case 'End':\n newActiveTabIndex = tabIsEnabled(lastChildIndex)\n ? lastChildIndex\n : findPreviousEnabledTabIndex(lastChildIndex);\n break;\n default:\n break;\n }\n\n if (newActiveTabIndex !== null) {\n onChange &&\n typeof onChange === 'function' &&\n onChange(newActiveTabIndex);\n setActiveTabIndex(newActiveTabIndex);\n (\n buttonRefArray.current[newActiveTabIndex].current as HTMLButtonElement\n ).focus();\n event.preventDefault();\n }\n }\n\n const i18n = React.useContext(I18nContext);\n const ariaLabel = `${rest['aria-label'] || ''}, ${\n orientation === TabsOrientation.vertical\n ? i18n.tabs.verticalTabsInstructions\n : i18n.tabs.horizontalTabsInstructions\n }`;\n\n return (\n <StyledContainer\n data-testid={testId}\n backgroundColor={background}\n isInverse={isInverse}\n orientation={orientation || TabsOrientation.horizontal}\n ref={ref}\n theme={theme}\n {...rest}\n >\n <ButtonPrev\n backgroundColor={background}\n buttonVisible={displayScroll.start}\n isInverse={isInverse}\n onClick={handleStartScrollClick}\n orientation={orientation || TabsOrientation.horizontal}\n ref={prevButtonRef}\n theme={theme}\n />\n <StyledTabsWrapper\n data-testid=\"tabsWrapper\"\n onScroll={handleTabsScroll}\n orientation={orientation}\n ref={tabsWrapperRef}\n >\n <StyledTabs\n alignment={alignment ? alignment : TabsAlignment.left}\n aria-label={ariaLabel}\n aria-orientation={orientation || TabsOrientation.horizontal}\n onKeyDown={handleKeyDown}\n orientation={orientation}\n ref={childrenWrapperRef}\n role=\"tablist\"\n >\n <TabsContext.Provider\n value={{\n borderPosition,\n buttonRefArray,\n changeHandler,\n iconPosition,\n isInverse,\n isFullWidth,\n orientation,\n registerTabButton,\n }}\n >\n {children}\n </TabsContext.Provider>\n </StyledTabs>\n </StyledTabsWrapper>\n <ButtonNext\n backgroundColor={background}\n buttonVisible={displayScroll.end}\n isInverse={isInverse}\n onClick={handleEndScrollClick}\n orientation={orientation || TabsOrientation.horizontal}\n ref={nextButtonRef}\n theme={theme}\n />\n </StyledContainer>\n );\n }\n);\n","import React from 'react';\n\nexport function useForceUpdate() {\n const [, setTick] = React.useState(0);\n const update = React.useCallback(() => {\n setTick(tick => tick + 1);\n }, []);\n return update;\n}","import React from 'react';\nimport styled from '@emotion/styled';\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport { css } from '@emotion/core';\nimport isPropValid from '@emotion/is-prop-valid';\nimport { TabsIconPosition, TabsBorderPosition, TabsContext } from './Tabs';\nimport { TabsOrientation } from './shared';\nimport { useForkedRef } from '../../utils';\nimport { useForceUpdate } from '../../hooks/useForceUpdate';\nimport { TabsContainerContext } from './TabsContainer';\nimport { ThemeInterface } from '../../theme/magma';\n\nexport interface TabProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n /**\n * Icon to display within the component\n */\n icon?: React.ReactElement<any> | React.ReactElement<any>[];\n /**\n * If true, the component will display with the active/selected state\n * @default false\n */\n isActive?: boolean;\n isInverse?: boolean;\n testId?: string;\n /**\n * @internal\n */\n theme?: any;\n}\n\nexport const StyledTabsChild = styled('li', {\n shouldForwardProp: isPropValid,\n})<{\n borderPosition?: TabsBorderPosition;\n isActive?: boolean;\n isFullWidth?: boolean;\n isInverse?: boolean;\n orientation: TabsOrientation;\n theme: ThemeInterface;\n}>`\n flex-grow: 0;\n flex-shrink: ${props => (props.isFullWidth ? '1' : '0')};\n height: ${props => (props.orientation === 'vertical' ? 'auto' : '100%')};\n list-style: none;\n margin: 0;\n max-width: ${props => (props.isFullWidth ? '100%' : '250px')};\n padding: 0;\n position: relative;\n white-space: normal;\n width: ${props =>\n props.isFullWidth || props.orientation === 'vertical' ? '100%' : 'auto'};\n\n &:after {\n background: ${props =>\n props.isInverse ? props.theme.colors.pop02 : props.theme.colors.primary};\n border-radius: 2px;\n content: '';\n display: block;\n height: 4px;\n opacity: ${props => (props.isActive ? '1' : '0')};\n position: absolute;\n transition: 0.4s all;\n width: auto;\n\n bottom: ${props => (props.borderPosition === 'top' ? 'auto' : '0')};\n left: ${props => (props.isActive ? '0' : '50%')};\n right: ${props => (props.isActive ? '0' : '50%')};\n top: ${props => (props.borderPosition === 'top' ? '0' : 'auto')};\n\n ${props =>\n props.orientation === 'vertical' &&\n css`\n height: auto;\n\n bottom: ${props.isActive ? '0' : '50%'};\n left: ${props.borderPosition === 'right' ? 'auto' : '0'};\n right: ${props.borderPosition === 'right' ? '0' : 'auto'};\n top: ${props.isActive ? '0' : '50%'};\n\n width: 4px;\n `}\n }\n`;\n\nfunction getFlexDirection(position: TabsIconPosition) {\n switch (position) {\n case TabsIconPosition.left:\n return 'row';\n case TabsIconPosition.right:\n return 'row-reverse';\n case TabsIconPosition.top:\n return 'column';\n case TabsIconPosition.bottom:\n return 'column-reverse';\n default:\n return 'column';\n }\n}\n\nexport const TabStyles = props => css`\n align-items: center;\n background: transparent;\n border: 0;\n color: ${props.isActive && !props.isInverse\n ? props.theme.colors.primary\n : props.isInverse\n ? props.theme.colors.neutral08\n : props.theme.colors.neutral03};\n cursor: ${props.disabled ? 'auto' : 'pointer'};\n display: flex;\n flex-direction: ${getFlexDirection(props.iconPosition)};\n flex-grow: 0;\n flex-shrink: ${props.isFullWidth ? '1' : '0'};\n font-weight: 600;\n font-size: ${props.theme.typeScale.size02.fontSize};\n letter-spacing: ${props.theme.typeScale.size02.letterSpacing};\n line-height: ${props.theme.typeScale.size02.lineHeight};\n height: 100%;\n justify-content: ${props.iconPosition === 'left' ? 'flex-start' : 'center'};\n opacity: ${props.disabled\n ? 0.4\n : props.isInverse && !props.isActive\n ? 0.7\n : 1};\n padding: ${props.theme.spaceScale.spacing04}\n ${props.theme.spaceScale.spacing05};\n position: relative;\n pointer-events: ${props.disabled ? 'none' : ''};\n text-align: center;\n text-decoration: none;\n text-transform: uppercase;\n width: ${props.isFullWidth ? '100%' : 'auto'};\n\n ${props.orientation === 'vertical' &&\n css`\n align-items: flex-start;\n justify-content: ${props.iconPosition === 'left'\n ? 'flex-start'\n : 'flex-end'};\n text-align: left;\n width: 100%;\n\n align-items: center;\n `}\n\n &:hover,\n &:focus {\n background-color: ${props.isActive\n ? ''\n : props.isInverse\n ? props.theme.colors.shade02\n : props.theme.colors.shade};\n color: ${props.isActive\n ? props.isInverse\n ? props.theme.colors.neutral08\n : props.theme.colors.primary\n : props.isInverse\n ? props.theme.colors.neutral08\n : props.theme.colors.neutral02};\n }\n\n &:focus {\n outline-offset: -2px;\n outline: ${props.isInverse\n ? props.theme.colors.focusInverse\n : props.theme.colors.focus}\n dotted 2px;\n }\n`;\n\nconst StyledTab = styled('button', { shouldForwardProp: isPropValid })<{\n borderPosition?: TabsBorderPosition;\n iconPosition?: TabsIconPosition;\n isActive?: boolean;\n isFullWidth?: boolean;\n isInverse?: boolean;\n orientation: TabsOrientation;\n theme: ThemeInterface;\n}>`\n ${TabStyles}\n`;\n\nfunction getIconMargin(props) {\n if (props.isIconOnly) {\n return `0`;\n }\n\n switch (props.iconPosition) {\n case TabsIconPosition.left:\n return `0 ${props.theme.spaceScale.spacing03} 0 0`;\n case TabsIconPosition.right:\n return `0 0 0 ${props.theme.spaceScale.spacing03}`;\n case TabsIconPosition.top:\n return `0 0 ${props.theme.spaceScale.spacing02}`;\n case TabsIconPosition.bottom:\n return `${props.theme.spaceScale.spacing02} 0 0`;\n default:\n return `0 0 ${props.theme.spaceScale.spacing02}`;\n }\n}\n\nexport const StyledIcon = styled.span<{\n iconPosition: TabsIconPosition;\n isIconOnly?: boolean;\n theme: ThemeInterface;\n}>`\n display: flex;\n margin: ${props => getIconMargin(props)};\n\n svg {\n height: ${props => props.theme.iconSizes.small}px;\n width: ${props => props.theme.iconSizes.small}px;\n }\n`;\n\nexport const Tab = React.forwardRef<HTMLButtonElement, TabProps>(\n (props, forwardedRef) => {\n const { children, icon, disabled, testId, ...rest } = props;\n const { activeTabIndex } = React.useContext(TabsContainerContext);\n const { buttonRefArray, registerTabButton } = React.useContext(TabsContext);\n const ownRef = React.useRef<HTMLDivElement>();\n const forceUpdate = useForceUpdate();\n\n const index = buttonRefArray.current.findIndex(({ current: item }) => {\n if (!item || !ownRef.current) return false;\n\n return item === ownRef.current;\n });\n\n const isActive = index === activeTabIndex;\n\n const ref = useForkedRef(forwardedRef, ownRef);\n\n const {\n changeHandler,\n orientation,\n borderPosition,\n iconPosition,\n isInverse,\n isFullWidth,\n } = React.useContext(TabsContext);\n\n const handleClick = (index, e) => {\n changeHandler(index, e);\n\n props.onClick && typeof props.onClick === 'function' && props.onClick(e);\n };\n\n React.useEffect(() => {\n registerTabButton(buttonRefArray, ownRef);\n\n forceUpdate();\n }, []);\n\n const theme = React.useContext(ThemeContext);\n const isIconOnly = !children;\n\n const tabIconPosition = iconPosition\n ? iconPosition\n : orientation === 'vertical'\n ? TabsIconPosition.left\n : TabsIconPosition.top;\n\n return (\n <StyledTabsChild\n borderPosition={borderPosition}\n data-testid=\"tabContainer\"\n isActive={isActive}\n isFullWidth={isFullWidth}\n isInverse={isInverse}\n orientation={orientation}\n role=\"presentation\"\n theme={theme}\n >\n <StyledTab\n {...rest}\n aria-selected={isActive}\n data-testid={testId}\n disabled={disabled}\n iconPosition={tabIconPosition}\n isActive={isActive}\n isInverse={isInverse}\n isFullWidth={isFullWidth}\n onClick={e => handleClick(index, e)}\n orientation={orientation}\n ref={ref}\n role=\"tab\"\n tabIndex={isActive ? 0 : -1}\n theme={theme}\n >\n {icon && (\n <StyledIcon\n theme={theme}\n iconPosition={tabIconPosition}\n isIconOnly={isIconOnly}\n >\n {icon}\n </StyledIcon>\n )}\n {children}\n </StyledTab>\n </StyledTabsChild>\n );\n }\n);\n","import React from 'react';\nimport { TabsContainerContext } from './TabsContainer';\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport styled from '@emotion/styled';\nimport { ThemeInterface } from '../../theme/magma';\n\nconst StyledTabPanel = styled.div<{\n isInverse?: boolean;\n theme: ThemeInterface;\n}>`\n background: ${props =>\n props.isInverse\n ? props.theme.colors.foundation02\n : props.theme.colors.neutral08};\n color: ${props =>\n props.isInverse\n ? props.theme.colors.neutral08\n : props.theme.colors.neutral};\n flex: 1;\n height: 100%;\n padding: 20px;\n`;\n\nexport interface TabPanelProps extends React.HTMLAttributes<HTMLDivElement> {\n /**\n * @internal\n */\n index?: number;\n isInverse?: boolean;\n testId?: string;\n}\n\nexport const TabPanel = React.forwardRef<HTMLDivElement, TabPanelProps>(\n (props, ref) => {\n const { index, isInverse, testId, children, ...other } = props;\n\n const theme = React.useContext(ThemeContext);\n\n const { activeTabIndex } = React.useContext(TabsContainerContext);\n const activeTab = activeTabIndex === index;\n\n return activeTab ? (\n <StyledTabPanel\n ref={ref}\n data-testid={testId}\n isInverse={isInverse}\n theme={theme}\n {...other}\n >\n {children}\n </StyledTabPanel>\n ) : null;\n }\n);\n","import React from 'react';\nimport styled from '@emotion/styled';\nimport { TabsContainerContext } from './TabsContainer';\n\ninterface TabPanelContainerProps extends React.HTMLAttributes<HTMLDivElement> {\n isInverse?: boolean;\n testId?: string;\n}\n\nconst StyledContainer = styled.div`\n flex-grow: 1;\n`;\n\nexport const TabPanelsContainer = React.forwardRef<\n HTMLDivElement,\n TabPanelContainerProps\n>((props, ref) => {\n const { children, testId, ...rest } = props;\n\n const { isInverseContainer } = React.useContext(TabsContainerContext);\n\n return (\n <StyledContainer ref={ref} data-testid={testId} {...rest}>\n {React.Children.map(children, (child: React.ReactElement<any>, index) => {\n const isInverse =\n typeof child.props.isInverse !== 'undefined'\n ? child.props.isInverse\n : typeof props.isInverse !== 'undefined'\n ? props.isInverse\n : isInverseContainer;\n\n return React.cloneElement(child, { index, isInverse, key: index });\n })}\n {children}\n </StyledContainer>\n );\n});\n","import * as React from 'react';\nimport {\n StyledContainer,\n StyledTabsWrapper,\n StyledTabs,\n TabsAlignment,\n TabsBorderPosition,\n TabsIconPosition,\n TabsProps,\n Orientation,\n} from '../Tabs';\nimport { TabsOrientation } from '../Tabs/shared';\nimport { Omit } from '../../utils';\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport { ButtonNext, ButtonPrev } from '../Tabs/TabsScrollButtons';\nimport { useTabsMeta } from '../Tabs/utils';\nimport { useIsInverse } from '../../inverse';\n\nexport interface NavTabsProps extends Omit<TabsProps, 'onChange'> {}\n\ninterface NavTabsContextInterface {\n borderPosition?: TabsBorderPosition;\n iconPosition?: TabsIconPosition;\n isInverse?: boolean;\n isFullWidth?: boolean;\n orientation?: TabsOrientation;\n}\n\nexport const NavTabsContext = React.createContext<NavTabsContextInterface>({\n borderPosition: TabsBorderPosition.bottom,\n iconPosition: TabsIconPosition.left,\n isInverse: false,\n isFullWidth: false,\n orientation: TabsOrientation.horizontal,\n});\n\nexport const NavTabs = React.forwardRef<\n HTMLDivElement,\n NavTabsProps & Orientation\n>((props, ref) => {\n const {\n alignment,\n backgroundColor,\n borderPosition,\n children,\n iconPosition,\n isFullWidth,\n orientation,\n testId,\n ...rest\n } = props;\n const theme = React.useContext(ThemeContext);\n\n const isInverse = useIsInverse(props.isInverse);\n\n const background = backgroundColor\n ? backgroundColor\n : isInverse\n ? theme.colors.foundation\n : theme.colors.neutral08;\n\n const [tabsMeta, tabsHandleMethods, tabsRefs] = useTabsMeta(\n theme,\n orientation,\n backgroundColor,\n isInverse\n );\n\n const { displayScroll } = tabsMeta;\n const {\n handleStartScrollClick,\n handleEndScrollClick,\n handleTabsScroll,\n } = tabsHandleMethods;\n const { prevButtonRef, nextButtonRef, tabsWrapperRef } = tabsRefs;\n\n return (\n <StyledContainer\n aria-label={rest['aria-label']}\n as=\"nav\"\n backgroundColor={backgroundColor}\n data-testid={testId}\n isInverse={isInverse}\n orientation={orientation || TabsOrientation.horizontal}\n ref={ref}\n theme={theme}\n {...rest}\n >\n <ButtonPrev\n backgroundColor={background}\n buttonVisible={displayScroll.start}\n isInverse={isInverse}\n onClick={handleStartScrollClick}\n orientation={orientation || TabsOrientation.horizontal}\n ref={prevButtonRef}\n theme={theme}\n />\n\n <StyledTabsWrapper\n data-testid=\"navTabsWrapper\"\n onScroll={handleTabsScroll}\n orientation={orientation || TabsOrientation.horizontal}\n ref={tabsWrapperRef}\n >\n <StyledTabs\n alignment={alignment ? alignment : TabsAlignment.left}\n orientation={orientation}\n >\n <NavTabsContext.Provider\n value={{\n borderPosition,\n iconPosition,\n isInverse: isInverse,\n isFullWidth,\n orientation,\n }}\n >\n {children}\n </NavTabsContext.Provider>\n </StyledTabs>\n </StyledTabsWrapper>\n <ButtonNext\n backgroundColor={background}\n buttonVisible={displayScroll.end}\n isInverse={isInverse}\n onClick={handleEndScrollClick}\n orientation={orientation || TabsOrientation.horizontal}\n ref={nextButtonRef}\n theme={theme}\n />\n </StyledContainer>\n );\n});\n","import * as React from 'react';\nimport styled from '@emotion/styled';\nimport { jsx } from '@emotion/core';\n\nimport { NavTabsContext } from './NavTabs';\nimport {\n StyledTabsChild,\n StyledIcon,\n TabStyles,\n TabsIconPosition,\n} from '../Tabs';\nimport { TabsOrientation } from '../Tabs/shared';\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport { omit, XOR } from '../../utils';\n\n/**\n * @children required\n */\nexport interface BaseNavTabProps\n extends React.HTMLAttributes<HTMLAnchorElement> {\n /**\n * @internal\n */\n css?: any; // Adding css prop to fix emotion error\n /**\n * Icon to display within the component\n */\n icon?: React.ReactElement<any> | React.ReactElement<any>[];\n /**\n * If true, the component will display with the active/selected state\n */\n isActive?: boolean;\n isInverse?: boolean;\n /**\n * Determines if the tabs are displayed vertically or horizontally\n * @default TabsOrientation.horizontal\n */\n orientation?: TabsOrientation;\n testId?: string;\n to?: string;\n /**\n * @internal\n */\n theme?: any;\n}\n\nexport interface NavTabChildrenProps extends BaseNavTabProps {\n children: JSX.Element | string;\n /**\n * The href value of the tab link\n */\n to: string;\n}\n\nexport interface NavTabComponentProps extends BaseNavTabProps {\n /**\n * The prop for custom component instead of `a` in NavTab.\n */\n component: React.ReactNode;\n /**\n * The orientation of icon on NavTab\n */\n iconPosition?: TabsIconPosition;\n /**\n * If true, the tab will take up the full width of its container\n * @default false\n */\n isFullWidth?: boolean;\n}\n\nexport type NavTabProps = XOR<NavTabChildrenProps, NavTabComponentProps>;\n\nfunction instanceOfNavComponentTab(\n object: any\n): object is NavTabComponentProps {\n return 'component' in object && !('children' in object);\n}\n\nfunction instanceOfNavChildrenTab(object: any): object is NavTabChildrenProps {\n return !('component' in object) && 'children' in object;\n}\n\nconst StyledTab = styled.a<{\n borderPosition?: any;\n iconPosition?: TabsIconPosition;\n isActive?: boolean;\n isFullWidth?: boolean;\n isInverse?: boolean;\n orientation: TabsOrientation;\n theme: any;\n}>`\n ${TabStyles}\n`;\n\nexport const StyledCustomTab = React.forwardRef<any, NavTabComponentProps>(\n (props, ref) => {\n const { children, component, icon, style, onClick, ...rest } = props;\n\n if (React.isValidElement(component) && React.isValidElement(component)) {\n const cloneElement = (element, newProps) => {\n return jsx(element.type, {\n key: element.key,\n ref: element.ref,\n ...element.props,\n ...newProps,\n });\n };\n\n const other = omit(\n ['iconPosition', 'isInverse', 'isActive', 'isFullWidth'],\n rest\n );\n\n return cloneElement(component, {\n ...other,\n css: TabStyles(props),\n ...style,\n onClick,\n ref,\n children: (\n <>\n {icon}\n {component.props.children}\n </>\n ),\n });\n }\n }\n);\n\n// Using any type because we do not know the element type of a custom tab\nexport const NavTab = React.forwardRef<any, NavTabProps>((props, ref) => {\n let children;\n let component;\n const { isActive, icon, testId, to, ...other } = props;\n const theme = React.useContext(ThemeContext);\n\n if (instanceOfNavComponentTab(props)) {\n component = props.component;\n } else if (instanceOfNavChildrenTab(props)) {\n children = props.children;\n }\n\n const isIconOnly = !children;\n\n const {\n orientation,\n borderPosition,\n iconPosition,\n isInverse,\n isFullWidth,\n } = React.useContext(NavTabsContext);\n\n const tabIconPosition = iconPosition\n ? iconPosition\n : orientation === 'vertical'\n ? TabsIconPosition.left\n : TabsIconPosition.top;\n\n return (\n <StyledTabsChild\n borderPosition={borderPosition}\n data-testid=\"tabContainer\"\n isActive={isActive}\n isFullWidth={isFullWidth}\n isInverse={isInverse}\n orientation={orientation}\n theme={theme}\n >\n {component ? (\n <StyledCustomTab\n {...other}\n component={component}\n data-testid={testId}\n iconPosition={tabIconPosition}\n icon={\n icon && (\n <StyledIcon theme={theme} iconPosition={tabIconPosition}>\n {icon}\n </StyledIcon>\n )\n }\n isActive={isActive}\n isInverse={isInverse}\n isFullWidth={isFullWidth}\n orientation={orientation}\n theme={theme}\n />\n ) : (\n <StyledTab\n {...other}\n ref={ref}\n data-testid={testId}\n href={to}\n isActive={isActive}\n isFullWidth={isFullWidth}\n iconPosition={tabIconPosition}\n isInverse={isInverse}\n orientation={orientation}\n theme={theme}\n >\n {icon && (\n <StyledIcon\n theme={theme}\n iconPosition={tabIconPosition}\n isIconOnly={isIconOnly}\n >\n {icon}\n </StyledIcon>\n )}\n {children}\n </StyledTab>\n )}\n </StyledTabsChild>\n );\n});\n","import * as React from 'react';\nimport { Button, ButtonColor, ButtonProps, ButtonVariant } from '../Button';\nimport { BuildBorder, hoverBorder } from './Pagination';\nimport { darken } from 'polished';\nimport styled from '../../theme/styled';\nimport { ThemeContext } from '../../theme/ThemeContext';\n\nexport interface PageButtonProps extends ButtonProps {\n isSelected?: boolean;\n}\n\nexport function pageButtonTypeSize(props) {\n if (props.size === 'large') {\n return `${props.theme.typeScale.size05.fontSize}`;\n }\n return `${props.theme.typeScale.size03.fontSize}`;\n}\n\nfunction buttonSize(props) {\n switch (props.size) {\n case 'large':\n return `${props.theme.spaceScale.spacing11}`;\n default:\n return `${props.theme.spaceScale.spacing09}`;\n }\n}\n\nfunction boxShadowColor(props) {\n if (props.color === 'primary') {\n if (props.isInverse) {\n return `-${props.theme.spaceScale.spacing01} 0 0 ${props.theme.colors.neutral08}`;\n }\n return `-${props.theme.spaceScale.spacing01} 0 0 ${props.theme.colors.primary}`;\n }\n}\n\nfunction hoverBoxShadowColor(props) {\n if (props.color === 'primary') {\n if (props.isInverse) {\n return `-${props.theme.spaceScale.spacing01} 0 0 ${props.theme.colors.neutral08}`;\n }\n return `-${props.theme.spaceScale.spacing01} 0 0 ${darken(\n 0.1,\n props.theme.colors.primary\n )}`;\n }\n}\n\nconst StyledPageButton = styled(Button)`\n border: none;\n border-top: ${BuildBorder};\n border-right: ${BuildBorder};\n border-bottom: ${BuildBorder};\n border-radius: 0;\n box-shadow: ${boxShadowColor};\n font-size: ${pageButtonTypeSize} !important;\n height: ${buttonSize};\n margin: 0;\n min-width: 0;\n padding: 0;\n width: ${buttonSize};\n &:focus {\n border-color: ${hoverBorder};\n box-shadow: ${hoverBoxShadowColor};\n outline: 0 !important;\n outline-offset: 0;\n overflow: visible;\n z-index: 1;\n }\n &:focus:before {\n content: '';\n border: ${props =>\n props.isInverse\n ? `${props.theme.spaceScale.spacing01} solid ${props.theme.colors.focusInverse}`\n : `${props.theme.spaceScale.spacing01} solid ${props.theme.colors.focus}`};\n border-style: dotted;\n height: calc(100% + 14px);\n left: -7px;\n position: absolute;\n top: -7px;\n width: calc(100% + 14px);\n }\n`;\n\nexport const PageButton = React.forwardRef<HTMLButtonElement, PageButtonProps>(\n (props, ref) => {\n const { children, isInverse, isSelected, ...other } = props;\n const theme = React.useContext(ThemeContext);\n\n return (\n <StyledPageButton\n ref={ref}\n {...other}\n color={isSelected ? ButtonColor.primary : ButtonColor.secondary}\n theme={theme}\n isInverse={isInverse}\n variant={\n isInverse && !isSelected ? ButtonVariant.outline : ButtonVariant.solid\n }\n >\n {children}\n </StyledPageButton>\n );\n }\n);\n","import * as React from 'react';\nimport { ButtonColor, ButtonShape, ButtonSize, ButtonVariant } from '../Button';\nimport { darken } from 'polished';\nimport { I18nContext } from '../../i18n';\nimport { IconButton } from '../IconButton';\nimport { PageButton, pageButtonTypeSize } from './PageButton';\nimport { ArrowBackIcon, ArrowForwardIcon } from 'react-magma-icons';\nimport styled from '../../theme/styled';\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport { usePagination } from './usePagination';\n\nexport interface BasePaginationProps\n extends React.HTMLAttributes<HTMLDivElement> {\n testId?: string;\n isInverse?: boolean;\n page?: number;\n /**\n * The total number of Pagination buttons\n * @default 1\n */\n count?: number;\n /**\n * If true, disables all of the Pagination buttons\n * @default false\n */\n disabled?: boolean;\n /**\n * If true, hides the next page button\n * @default false\n */\n hideNextButton?: boolean;\n /**\n * If true, hides the previous page button\n * @default false\n */\n hidePreviousButton?: boolean;\n /**\n * Number of page buttons before and after the current page\n * @default 1\n */\n numberOfAdjacentPages?: number;\n /**\n * Number of page buttons at the beginning and end of the page number buttons list\n * @default 1\n */\n numberOfEdgePages?: number;\n /**\n * Event that fires when the page number changes\n */\n onPageChange?: (event: React.SyntheticEvent, newPage: number) => void;\n /**\n * Size toggles between default and large variant buttons.\n */\n size?: PageButtonSize;\n /**\n * If true, shows the first page button\n * @default false\n */\n showFirstButton?: boolean;\n /**\n * If true, shows the last page button\n * @default false\n */\n showLastButton?: boolean;\n}\n\nexport interface ControlledPaginationProps extends BasePaginationProps {\n defaultPage: never;\n /**\n * Current page number\n */\n page?: number;\n}\nexport interface UncontrolledPaginationProps extends BasePaginationProps {\n /**\n * Page selected by default when the component is uncontrolled\n */\n defaultPage?: number;\n page: number;\n}\nexport type PaginationProps =\n | ControlledPaginationProps\n | UncontrolledPaginationProps;\n\nexport enum PageButtonSize {\n medium = 'medium',\n large = 'large',\n}\n\nconst StyledNav = styled.nav`\n min-width: 0;\n`;\n\nconst StyledList = styled.ul`\n display: flex;\n margin: 0;\n padding: 0;\n`;\n\nconst StyledListItem = styled.li`\n list-style-type: none;\n &:last-child {\n button {\n border-left: none;\n }\n }\n`;\n\nexport function BuildBorder(props) {\n switch (props.color) {\n case 'primary':\n if (props.isInverse) {\n return `${props.theme.spaceScale.spacing01} solid ${props.theme.colors.neutral08}`;\n }\n return `${props.theme.spaceScale.spacing01} solid ${props.theme.colors.primary}`;\n default:\n if (props.isInverse) {\n if (props.disabled) {\n return `${props.theme.spaceScale.spacing01} solid ${props.theme.colors.tint04}`;\n }\n return `${props.theme.spaceScale.spacing01} solid ${props.theme.colors.neutral08}`;\n }\n if (props.disabled) {\n return `${props.theme.spaceScale.spacing01} solid ${props.theme.colors.neutral06}`;\n }\n return `${props.theme.spaceScale.spacing01} solid ${props.theme.colors.neutral05}`;\n }\n}\n\nexport function hoverBorder(props) {\n switch (props.color) {\n case 'primary':\n if (props.isInverse) {\n return `${props.theme.colors.neutral08}`;\n }\n return `${darken(0.1, props.theme.colors.primary)}`;\n default:\n if (props.isInverse) {\n return `${props.theme.colors.neutral08}`;\n }\n return `${props.theme.colors.neutral05}`;\n }\n}\n\nfunction BuildButtonSize(props) {\n switch (props.size) {\n case 'large':\n return `${props.theme.spaceScale.spacing11}`;\n default:\n return `${props.theme.spaceScale.spacing09}`;\n }\n}\n\nconst NavButton = styled(IconButton)`\n border-top: ${BuildBorder};\n border-right: ${BuildBorder};\n border-bottom: ${BuildBorder};\n border-left: ${BuildBorder};\n height: ${BuildButtonSize};\n margin: 0;\n padding: 0;\n width: ${BuildButtonSize};\n &:focus {\n z-index: 1;\n outline: 0 !important;\n outline-offset: 0;\n overflow: visible;\n }\n &:focus:before {\n content: '';\n border: ${props =>\n props.isInverse\n ? `${props.theme.spaceScale.spacing01} solid ${props.theme.colors.focusInverse}`\n : `${props.theme.spaceScale.spacing01} solid ${props.theme.colors.focus}`};\n border-style: dotted;\n height: calc(100% + 14px);\n left: -7px;\n position: absolute;\n top: -7px;\n width: calc(100% + 14px);\n }\n`;\n\nconst StyledEllipsis = styled.div`\n align-items: center;\n border-top: ${BuildBorder};\n border-right: ${BuildBorder};\n border-bottom: ${BuildBorder};\n display: flex;\n font-size: ${pageButtonTypeSize};\n height: ${BuildButtonSize};\n justify-content: center;\n width: ${BuildButtonSize};\n`;\n\nexport const Pagination = React.forwardRef<HTMLDivElement, PaginationProps>(\n (props, ref) => {\n const {\n count,\n defaultPage,\n disabled,\n hideNextButton,\n hidePreviousButton,\n isInverse,\n numberOfAdjacentPages,\n numberOfEdgePages,\n page,\n size = PageButtonSize.medium,\n showFirstButton,\n showLastButton,\n testId,\n onPageChange,\n ...other\n } = props;\n const theme = React.useContext(ThemeContext);\n const buttonSize =\n size === PageButtonSize.large ? ButtonSize.large : ButtonSize.medium;\n\n const { pageButtons } = usePagination({\n count,\n defaultPage,\n disabled,\n hideNextButton,\n hidePreviousButton,\n numberOfAdjacentPages,\n numberOfEdgePages,\n onPageChange,\n page,\n showFirstButton,\n showLastButton,\n });\n\n const i18n = React.useContext(I18nContext);\n\n return (\n <StyledNav {...other} theme={theme} data-testid={testId} ref={ref}>\n <StyledList>\n {pageButtons.map(\n ({ 'aria-current': ariaCurrent, page, type, ...other }, index) => {\n if (type === 'start-ellipsis' || type === 'end-ellipsis') {\n return (\n <StyledEllipsis\n key={index}\n isInverse={isInverse}\n size={size}\n theme={theme}\n >\n ...\n </StyledEllipsis>\n );\n } else if (type === 'page') {\n return (\n <StyledListItem\n aria-current={Boolean(ariaCurrent)}\n key={index}\n >\n <PageButton\n isInverse={isInverse}\n size={buttonSize}\n {...other}\n >\n {page}\n </PageButton>\n </StyledListItem>\n );\n } else if (type === 'previous' || type === 'next') {\n return (\n <StyledListItem key={index}>\n <NavButton\n variant={\n isInverse ? ButtonVariant.outline : ButtonVariant.solid\n }\n color={ButtonColor.secondary}\n aria-label={i18n.pagination[`${type}ButtonLabel`]}\n icon={\n type === 'previous' ? (\n <ArrowBackIcon />\n ) : (\n <ArrowForwardIcon />\n )\n }\n isInverse={isInverse}\n theme={theme}\n shape={\n type === 'previous'\n ? ButtonShape.leftCap\n : ButtonShape.rightCap\n }\n size={buttonSize}\n {...other}\n />\n </StyledListItem>\n );\n }\n }\n )}\n </StyledList>\n </StyledNav>\n );\n }\n);\n","import * as React from 'react';\nimport {\n DisplayInputStyles,\n DisplayInputActiveStyles,\n buildDisplayInputActiveBackground,\n buildDisplayInputFocusStyles,\n} from '../SelectionControls/InputStyles';\nimport { HiddenStyles } from '../../utils/UtilityStyles';\nimport { RadioContext } from '../RadioGroup';\nimport {\n RadioButtonCheckedIcon,\n RadioButtonUncheckedIcon,\n} from 'react-magma-icons';\nimport { StyledLabel } from '../SelectionControls/StyledLabel';\nimport { StyledContainer } from '../SelectionControls/StyledContainer';\n// Using the base `styled` from `emotion` until import mapping is fixed: https://github.com/emotion-js/emotion/pull/1220\n// import styled from '../../theme/styled';\nimport styled from '@emotion/styled';\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport { useGenerateId } from '../../utils';\n\nexport enum RadioTextPosition {\n left = 'left',\n right = 'right', // default\n}\n\nexport interface RadioProps\n extends React.InputHTMLAttributes<HTMLInputElement> {\n /**\n * @internal\n */\n css?: any; // Adding css prop to fix emotion error\n /**\n * Hex code for the background color\n * @default #0000FF\n */\n color?: string;\n /**\n * Style properties for the component container element\n */\n containerStyle?: React.CSSProperties;\n /**\n * Style properties for the radio button element\n */\n inputStyle?: React.CSSProperties;\n isInverse?: boolean;\n /**\n * If true, label text will be hidden visually, but will still be read by assistive technology\n * @default false\n */\n isTextVisuallyHidden?: boolean;\n /**\n * Style properties for the label element\n */\n labelStyle?: React.CSSProperties;\n /**\n * Content of label; can be node or string\n */\n labelText: React.ReactNode;\n testId?: string;\n /**\n * Whether the label appears to the left of the right of the radio button\n * @default RadioTextPosition.right\n */\n textPosition?: RadioTextPosition;\n}\n\nconst HiddenLabelText = styled.span`\n ${HiddenStyles};\n`;\n\nconst HiddenInput = styled.input<{ indeterminate?: boolean }>`\n ${HiddenStyles};\n`;\n\nfunction buildRadioIconColor(props) {\n if (props.disabled) {\n if (props.isInverse) {\n return props.theme.colors.tint04;\n }\n return props.theme.colors.neutral05;\n }\n if (props.isInverse) {\n return props.theme.colors.neutral08;\n }\n if (props.isChecked) {\n return props.color;\n }\n return props.theme.colors.neutral02;\n}\n\nexport function buildErrorBorder(props) {\n if (props.hasError) {\n if (props.isInverse) {\n return `0 0 0 2px ${props.theme.colors.dangerInverse}`;\n }\n return `0 0 0 2px ${props.theme.colors.danger}`;\n }\n return `inherit`;\n}\n\nconst StyledFakeInput = styled.span<{\n isChecked?: boolean;\n hasError?: boolean;\n isInverse: boolean;\n disabled: boolean;\n color: string;\n textPosition?: RadioTextPosition;\n theme?: any;\n}>`\n ${DisplayInputStyles};\n color: ${props => buildRadioIconColor(props)};\n cursor: ${props => (props.disabled ? 'not-allowed' : 'pointer')};\n margin: ${props =>\n props.textPosition === 'left'\n ? `0 0 0 ${props.theme.spaceScale.spacing03}`\n : `0 ${props.theme.spaceScale.spacing03} 0 0`};\n box-shadow: ${buildErrorBorder};\n\n ${HiddenInput}:checked:not (:disabled) + label & {\n background: ${props => {\n if (props.isInverse) {\n return props.theme.colors.neutral08;\n }\n }};\n }\n\n ${HiddenInput}:focus + label & {\n // focus state\n &:before {\n ${props => buildDisplayInputFocusStyles(props)};\n }\n }\n\n &:after {\n // active state\n background: ${props => buildDisplayInputActiveBackground(props)};\n }\n\n ${HiddenInput}:not(:disabled):active + label & {\n &:after {\n ${DisplayInputActiveStyles}\n }\n }\n`;\n\nexport const Radio = React.forwardRef<HTMLInputElement, RadioProps>(\n (props, ref) => {\n const id = useGenerateId(props.id);\n const context = React.useContext(RadioContext);\n const theme = React.useContext(ThemeContext);\n const {\n color = theme.colors.primary,\n containerStyle,\n disabled,\n inputStyle,\n isInverse,\n isTextVisuallyHidden,\n labelStyle,\n labelText,\n required,\n testId,\n textPosition,\n value,\n ...other\n } = props;\n\n return (\n <StyledContainer style={containerStyle}>\n <HiddenInput\n {...other}\n aria-labelledby={context.descriptionId}\n id={id}\n ref={ref}\n checked={context.selectedValue === value}\n data-testid={testId}\n disabled={disabled}\n name={context.name}\n required={context.required || required}\n type=\"radio\"\n value={value}\n onBlur={context.onBlur}\n onChange={context.onChange}\n onFocus={context.onFocus}\n />\n <StyledLabel\n htmlFor={id}\n isInverse={context.isInverse || isInverse}\n style={labelStyle}\n >\n {!isTextVisuallyHidden &&\n textPosition === RadioTextPosition.left &&\n labelText}\n\n <StyledFakeInput\n isChecked={context.selectedValue === value}\n color={color}\n disabled={disabled}\n isInverse={context.isInverse || isInverse}\n hasError={context.hasError}\n style={inputStyle}\n textPosition={textPosition}\n theme={theme}\n >\n {context.selectedValue === value ? (\n <RadioButtonCheckedIcon />\n ) : (\n <RadioButtonUncheckedIcon />\n )}\n </StyledFakeInput>\n {isTextVisuallyHidden ? (\n <HiddenLabelText>{labelText}</HiddenLabelText>\n ) : (\n textPosition !== RadioTextPosition.left && labelText && labelText\n )}\n </StyledLabel>\n </StyledContainer>\n );\n }\n);\n","import * as React from 'react';\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport { I18nContext } from '../../i18n';\nimport { Announce } from '../Announce';\nimport { InputBase, InputSize, InputType } from '../InputBase';\nimport { Button, ButtonVariant, ButtonType, ButtonSize } from '../Button';\nimport {\n FormFieldContainer,\n FormFieldContainerBaseProps,\n} from '../FormFieldContainer';\nimport { useIsInverse } from '../../inverse';\nimport { VisuallyHidden } from '../VisuallyHidden';\n\nimport { useGenerateId } from '../../utils';\n\nexport interface PasswordInputProps\n extends Omit<FormFieldContainerBaseProps, 'fieldId'>,\n React.InputHTMLAttributes<HTMLInputElement> {\n hiddenPasswordAnnounceText?: string;\n /**\n * Aria-label for the \"Hide Password\" button\n * @default \"Hide password\"\n */\n hidePasswordButtonAriaLabel?: string;\n /**\n * Text displayed on screen for the \"Hide Password\" button\n * @default \"Hide\"\n */\n hidePasswordButtonText?: string;\n isInverse?: boolean;\n /**\n * If true, label text will be hidden visually, but will still be read by assistive technology\n * @default false\n */\n isPasswordMaskButtonHidden?: boolean;\n shownPasswordAnnounceText?: string;\n /**\n * Aria-label for the \"Show Password\" button\n * @default \"Show password. Note: this will visually expose your password on the screen\"\n */\n showPasswordButtonAriaLabel?: string;\n /**\n * Text displayed on screen for the \"Show Password\" button\n * @default \"Show\"\n */\n showPasswordButtonText?: string;\n testId?: string;\n}\n\nexport const PasswordInput = React.forwardRef<\n HTMLInputElement,\n PasswordInputProps\n>((props, ref) => {\n const [passwordShown, setPasswordShown] = React.useState<boolean>(false);\n\n function togglePasswordShown() {\n setPasswordShown(prevPasswordShown => !prevPasswordShown);\n }\n\n const {\n containerStyle,\n errorMessage,\n helperMessage,\n hiddenPasswordAnnounceText,\n hidePasswordButtonAriaLabel,\n hidePasswordButtonText,\n isPasswordMaskButtonHidden,\n id: defaultId,\n inputSize = InputSize.medium,\n labelStyle,\n labelText,\n isLabelVisuallyHidden,\n messageStyle,\n shownPasswordAnnounceText,\n showPasswordButtonAriaLabel,\n showPasswordButtonText,\n type,\n ...other\n } = props;\n\n const i18n = React.useContext(I18nContext);\n\n const id = useGenerateId(defaultId);\n\n const HIDDEN_PASSWORD_ANNOUNCE_TEXT = hiddenPasswordAnnounceText\n ? hiddenPasswordAnnounceText\n : i18n.password.hidden.announce;\n const HIDE_PASSWORD_BUTTON_ARIA_LABEL = hidePasswordButtonAriaLabel\n ? hidePasswordButtonAriaLabel\n : i18n.password.hidden.ariaLabel;\n const HIDE_PASSWORD_BUTTON_TEXT = hidePasswordButtonText\n ? hidePasswordButtonText\n : i18n.password.hidden.buttonText;\n const SHOWN_PASSWORD_ANNOUNCE_TEXT = shownPasswordAnnounceText\n ? shownPasswordAnnounceText\n : i18n.password.shown.announce;\n const SHOW_PASSWORD_BUTTON_ARIA_LABEL = showPasswordButtonAriaLabel\n ? showPasswordButtonAriaLabel\n : i18n.password.shown.ariaLabel;\n const SHOW_PASSWORD_BUTTON_TEXT = showPasswordButtonText\n ? showPasswordButtonText\n : i18n.password.shown.buttonText;\n\n const descriptionId = errorMessage || helperMessage ? `${id}__desc` : null;\n const theme = React.useContext(ThemeContext);\n\n const isInverse = useIsInverse(props.isInverse);\n\n return (\n <FormFieldContainer\n containerStyle={containerStyle}\n errorMessage={errorMessage}\n fieldId={id}\n helperMessage={helperMessage}\n inputSize={inputSize}\n isLabelVisuallyHidden={isLabelVisuallyHidden}\n isInverse={isInverse}\n labelStyle={labelStyle}\n labelText={labelText}\n >\n <InputBase\n autoCorrect=\"off\"\n autoCapitalize=\"none\"\n {...other}\n aria-describedby={\n descriptionId ? descriptionId : props['aria-describedby']\n }\n aria-invalid={!!errorMessage}\n hasError={!!errorMessage}\n id={id}\n inputSize={inputSize}\n isInverse={isInverse}\n ref={ref}\n type={passwordShown ? InputType.text : InputType.password}\n >\n {!isPasswordMaskButtonHidden && (\n <>\n <Button\n aria-label={\n passwordShown\n ? HIDE_PASSWORD_BUTTON_ARIA_LABEL\n : SHOW_PASSWORD_BUTTON_ARIA_LABEL\n }\n isInverse={false}\n onClick={togglePasswordShown}\n size={ButtonSize.small}\n style={{\n borderRadius: theme.borderRadius,\n height:\n inputSize == InputSize.large\n ? theme.spaceScale.spacing10\n : theme.spaceScale.spacing08,\n margin: ' 0 3px 0 0 ',\n }}\n type={ButtonType.button}\n variant={ButtonVariant.link}\n >\n {passwordShown\n ? HIDE_PASSWORD_BUTTON_TEXT\n : SHOW_PASSWORD_BUTTON_TEXT}\n </Button>\n <VisuallyHidden>\n <Announce>\n {passwordShown\n ? SHOWN_PASSWORD_ANNOUNCE_TEXT\n : HIDDEN_PASSWORD_ANNOUNCE_TEXT}\n </Announce>\n </VisuallyHidden>\n </>\n )}\n </InputBase>\n </FormFieldContainer>\n );\n});\n","import * as React from 'react';\nimport { Label } from '../Label';\nimport { HiddenStyles } from '../../utils/UtilityStyles';\nimport { InputMessage } from '../Input/InputMessage';\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport { useIsInverse } from '../../inverse';\n\nimport styled from '../../theme/styled';\nimport { omit, useGenerateId } from '../../utils';\n\nconst HiddenLabel = styled.label`\n ${HiddenStyles};\n`;\n\n/**\n * @children required\n */\nexport interface RadioGroupProps extends React.HTMLAttributes<HTMLDivElement> {\n /**\n * Action that fires when the radio group loses focus\n */\n onBlur?: (event?: React.FocusEvent) => void;\n /**\n * Action that fires when selected value of the radio group changes\n */\n onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;\n /**\n * Action that fires when one of the radio buttons within the group receives focus\n */\n onFocus?: (event: React.FocusEvent) => void;\n /**\n * Style properties for the component container element\n */\n containerStyle?: React.CSSProperties;\n /**\n * Content of the error message. If a value is provided, the radio buttons will be styled to show an error state\n */\n errorMessage?: React.ReactNode;\n /**\n * Content of the helper message\n */\n helperMessage?: React.ReactNode;\n isInverse?: boolean;\n /**\n * If true, label text for the radio group will be hidden visually, but will still be read by assistive technology\n * @default false\n */\n isTextVisuallyHidden?: boolean;\n /**\n * ID of the element that labels the radio group, used in the aria-labelledby attribute for the group. Alternatively, the labelText prop can be used\n */\n labelledById?: string;\n /**\n * Style properties for the label of the radio group\n */\n labelStyle?: React.CSSProperties;\n /**\n * Content of label of the radio group; can be node or string. Alternatively, the labelledById prop can be used\n */\n labelText?: React.ReactNode;\n /**\n * Name attribute the radio group\n */\n name: string;\n /**\n * If true, the user must select one radio button for the form to be valid\n * @default false\n */\n required?: boolean;\n testId?: string;\n /**\n * Value of the radio button that is the default selected value for the group\n */\n value?: string;\n}\n\nexport interface RadioContextInterface {\n descriptionId?: string;\n hasError?: boolean;\n isInverse?: boolean;\n required?: boolean;\n name: string;\n selectedValue?: string;\n onBlur?: (event: React.FocusEvent) => void;\n onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;\n onFocus?: (event: React.FocusEvent) => void;\n}\n\nexport const RadioContext = React.createContext<RadioContextInterface>({\n hasError: false,\n name: 'defaultName',\n});\n\nexport const RadioGroup = React.forwardRef<HTMLDivElement, RadioGroupProps>(\n (props, ref) => {\n const id = useGenerateId(props.id);\n const [selectedValue, setSelectedValue] = React.useState<string>(\n props.value\n );\n\n React.useEffect(() => {\n setSelectedValue(props.value);\n }, [props.value]);\n\n function handleChange(event: React.ChangeEvent<HTMLInputElement>) {\n const { value: newSelectedValue } = event.target;\n props.onChange &&\n typeof props.onChange === 'function' &&\n props.onChange(event);\n setSelectedValue(newSelectedValue);\n }\n\n const {\n containerStyle,\n errorMessage,\n helperMessage,\n required,\n isTextVisuallyHidden,\n labelledById,\n labelStyle,\n labelText,\n testId,\n name,\n children,\n ...rest\n } = props;\n const other = omit(['onBlur', 'onChange', 'onFocus', 'id'], rest);\n\n const descriptionId = errorMessage || helperMessage ? `${id}__desc` : null;\n\n const theme = React.useContext(ThemeContext);\n\n const isInverse = useIsInverse(props.isInverse);\n\n return (\n <div\n {...other}\n aria-labelledby={labelledById ? labelledById : id}\n style={containerStyle}\n data-testid={testId}\n ref={ref}\n role=\"radiogroup\"\n >\n <RadioContext.Provider\n value={{\n descriptionId,\n hasError: !!errorMessage,\n isInverse,\n required,\n name,\n selectedValue,\n onBlur: props.onBlur,\n onChange: handleChange,\n onFocus: props.onFocus,\n }}\n >\n {labelText && isTextVisuallyHidden && (\n <HiddenLabel id={id} style={labelStyle}>\n {labelText}\n </HiddenLabel>\n )}\n\n {labelText && !isTextVisuallyHidden && (\n <Label\n id={id}\n style={labelStyle}\n isInverse={isInverse}\n theme={theme}\n >\n {labelText}\n </Label>\n )}\n {children}\n\n <InputMessage\n id={descriptionId}\n hasError={!!errorMessage}\n isInverse={isInverse}\n >\n {(errorMessage || helperMessage) && (\n <>{errorMessage ? errorMessage : helperMessage}</>\n )}\n </InputMessage>\n </RadioContext.Provider>\n </div>\n );\n }\n);\n","import * as React from 'react';\nimport ReactDOM from 'react-dom';\nimport styled from '@emotion/styled';\nimport { Global, css } from '@emotion/core';\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport { magma } from '../../theme/magma';\nimport { I18nContext } from '../../i18n';\nimport { ButtonColor, ButtonVariant } from '../Button';\nimport { IconButton } from '../IconButton';\nimport { CloseIcon } from 'react-magma-icons';\nimport { Heading } from '../Heading';\nimport { TypographyVisualStyle } from '../Typography';\nimport { Transition, TransitionProps } from '../Transition';\nimport { ThemeInterface } from '../../theme/magma';\nimport { omit, useGenerateId, usePrevious } from '../../utils';\nimport { useFocusLock } from '../../hooks/useFocusLock';\n\nexport enum ModalSize {\n large = 'large',\n medium = 'medium', //default\n small = 'small',\n}\n\n/**\n * @children required\n */\nexport interface ModalProps extends React.HTMLAttributes<HTMLDivElement> {\n /**\n * The text read by screen readers for the close button\n * @default \"Close dialog\"\n */\n closeAriaLabel?: string;\n /**\n * Style for the modal container\n */\n closeButtonSize?: keyof typeof magma.iconSizes;\n /**\n * Style for the modal container\n */\n containerStyle?: React.CSSProperties;\n /**\n * The content of the modal header\n */\n header?: React.ReactNode;\n /**\n * If true, clicking the backdrop will not dismiss the modal\n * @default false\n */\n isBackgroundClickDisabled?: boolean;\n /**\n * If true, the close button the the modal will be suppressed\n * @default false\n */\n isCloseButtonHidden?: boolean;\n /**\n * If true, pressing the Escape key will not dismiss the modal\n * @false\n */\n isEscKeyDownDisabled?: boolean;\n /**\n * If true, the modal will be visible\n * @default false\n */\n isOpen?: boolean;\n /**\n * If true, the modal will removed from the DOM when closed\n * @default true\n */\n unmountOnExit?: boolean;\n /**\n * @internal\n */\n containerTransition?: Omit<TransitionProps, 'isOpen'>;\n /**\n * Action that fires when the close button is clicked\n */\n onClose?: () => void;\n /**\n * Action that fires when the Escape key is pressed\n */\n onEscKeyDown?: (event: KeyboardEvent) => void;\n /**\n * The relative size of the modal\n * @default ModalSize.medium\n */\n size?: ModalSize;\n testId?: string;\n /**\n * @internal\n */\n theme?: ThemeInterface;\n}\n\nconst ModalContainer = styled(Transition)<{\n theme: ThemeInterface;\n}>`\n bottom: 0;\n left: 0;\n overflow-y: auto;\n padding: ${props => props.theme.spaceScale.spacing03};\n right: 0;\n top: 0;\n z-index: 998;\n`;\n\nconst ModalBackdrop = styled(Transition)<{ isExiting?: boolean }>`\n backdrop-filter: blur(3px);\n background: rgba(0, 0, 0, 0.6);\n bottom: 0;\n left: 0;\n right: 0;\n top: 0;\n z-index: 997;\n position: fixed;\n`;\n\nconst ModalContent = styled.div<ModalProps & { isExiting?: boolean }>`\n background: ${props => props.theme.colors.neutral08};\n border: 1px solid;\n border-color: ${props => props.theme.colors.neutral06};\n border-radius: ${props => props.theme.borderRadius};\n box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);\n color: ${props => props.theme.colors.neutral};\n margin: 0 auto;\n position: relative;\n z-index: 1000;\n\n max-width: ${props => {\n switch (props.size) {\n case 'large':\n return props.theme.modal.width.large;\n case 'small':\n return props.theme.modal.width.small;\n default:\n return props.theme.modal.width.medium;\n }\n }};\n\n @media (min-width: ${props => props.theme.breakpoints.small}px) {\n margin: ${props => props.theme.spaceScale.spacing08} auto;\n }\n`;\n\nconst ModalHeader = styled.div<{ theme?: ThemeInterface }>`\n padding: ${props => props.theme.spaceScale.spacing03}\n ${props => props.theme.spaceScale.spacing05} 0\n ${props => props.theme.spaceScale.spacing05};\n @media (min-width: ${props => props.theme.breakpoints.small}px) {\n padding: ${props => props.theme.spaceScale.spacing05}\n ${props => props.theme.spaceScale.spacing06} 0\n ${props => props.theme.spaceScale.spacing06};\n }\n`;\n\nconst H1 = styled(Heading)<{ theme?: ThemeInterface }>`\n font-size: ${props =>\n props.theme.typographyVisualStyles.headingSmall.desktop.fontSize};\n line-height: ${props =>\n props.theme.typographyVisualStyles.headingSmall.desktop.lineHeight};\n margin: 0;\n padding-right: ${props => props.theme.spaceScale.spacing10};\n`;\n\nconst CloseBtn = styled.span`\n position: absolute;\n top: 0;\n right: 0;\n`;\nconst ModalBody = styled.div<{ theme?: ThemeInterface }>`\n padding: ${props => props.theme.spaceScale.spacing05};\n\n @media (min-width: ${props => props.theme.breakpoints.small}px) {\n padding: ${props => props.theme.spaceScale.spacing06};\n }\n`;\n\nexport const Modal = React.forwardRef<HTMLDivElement, ModalProps>(\n (props, ref) => {\n const lastFocus = React.useRef<any>();\n const headingRef = React.useRef<any>();\n const bodyRef = React.useRef<any>();\n\n const id = useGenerateId(props.id);\n const headingId = `${id}_heading`;\n const contentId = `${id}_content`;\n\n const [isModalOpen, setIsModalOpen] = React.useState<boolean>(props.isOpen);\n const [isExiting, setIsExiting] = React.useState<boolean>(false);\n const [currentTarget, setCurrentTarget] = React.useState(null);\n\n const focusTrapElement = useFocusLock(\n isModalOpen,\n props.header ? headingRef : null,\n bodyRef\n );\n\n const prevOpen = usePrevious(props.isOpen);\n\n React.useEffect(() => {\n if (!prevOpen && props.isOpen) {\n setIsModalOpen(true);\n } else if (prevOpen && !props.isOpen && isModalOpen) {\n handleClose();\n }\n }, [props.isOpen]);\n\n React.useEffect(() => {\n if (isModalOpen) {\n lastFocus.current = document.activeElement;\n\n if (!props.isEscKeyDownDisabled) {\n document.body.addEventListener('keydown', handleEscapeKeyDown, false);\n }\n }\n\n return () => {\n document.body.removeEventListener(\n 'keydown',\n handleEscapeKeyDown,\n false\n );\n };\n }, [isModalOpen]);\n\n function handleModalClick(event: React.SyntheticEvent) {\n if (\n !document.getElementById(contentId).contains(event.target as Node) &&\n event.target === currentTarget\n ) {\n handleClose(event);\n }\n }\n\n function handleModalOnMouseDown(event: React.SyntheticEvent) {\n setCurrentTarget(event.target);\n }\n\n function handleEscapeKeyDown(event: KeyboardEvent) {\n if (event.key === 'Escape') {\n event.preventDefault();\n event.stopPropagation();\n\n props.onEscKeyDown &&\n typeof props.onEscKeyDown === 'function' &&\n props.onEscKeyDown(event);\n\n handleClose(event);\n }\n }\n\n function handleClose(event?) {\n if (event) {\n event.stopPropagation();\n }\n setIsExiting(true);\n\n setTimeout(() => {\n setIsExiting(false);\n setIsModalOpen(false);\n\n if (lastFocus.current) {\n lastFocus.current.focus();\n }\n\n props.onClose && typeof props.onClose === 'function' && props.onClose();\n }, 300);\n }\n\n const {\n children,\n closeAriaLabel,\n closeButtonSize,\n containerStyle,\n containerTransition = { slideTop: true },\n isBackgroundClickDisabled,\n isEscKeyDownDisabled,\n header,\n isCloseButtonHidden,\n isOpen,\n unmountOnExit = true,\n testId,\n ...rest\n } = props;\n\n const other = omit(['onEscKeyDown'], rest);\n const theme = React.useContext(ThemeContext);\n const i18n = React.useContext(I18nContext);\n\n const CloseIconButton = (\n <CloseIcon\n color={theme.colors.neutral03}\n size={\n magma.iconSizes[closeButtonSize]\n ? magma.iconSizes[closeButtonSize]\n : magma.iconSizes.small\n }\n />\n );\n\n return isModalOpen\n ? ReactDOM.createPortal(\n <div ref={focusTrapElement}>\n <Global\n styles={css`\n html {\n overflow: ${isOpen} ? hidden : auto;\n }\n `}\n />\n <ModalContainer\n aria-labelledby={header ? headingId : null}\n aria-label=\"modal\"\n aria-describedby=\"modal\"\n aria-modal={true}\n data-testid={testId}\n id={id}\n onClick={isBackgroundClickDisabled ? null : handleModalClick}\n onMouseDown={\n isBackgroundClickDisabled ? null : handleModalOnMouseDown\n }\n role=\"dialog\"\n style={containerStyle}\n theme={theme}\n isOpen={isModalOpen}\n {...containerTransition}\n unmountOnExit={unmountOnExit}\n >\n <ModalContent\n {...other}\n data-testid=\"modal-content\"\n id={contentId}\n isExiting={isExiting}\n ref={ref}\n theme={theme}\n >\n {header && (\n <ModalHeader theme={theme}>\n {header && (\n <H1\n id={headingId}\n level={1}\n ref={headingRef}\n visualStyle={TypographyVisualStyle.headingSmall}\n tabIndex={-1}\n theme={theme}\n >\n {header}\n </H1>\n )}\n </ModalHeader>\n )}\n <ModalBody ref={bodyRef} theme={theme}>\n {children}\n </ModalBody>\n {!isCloseButtonHidden && (\n <CloseBtn>\n <IconButton\n aria-label={\n closeAriaLabel\n ? closeAriaLabel\n : i18n.modal.closeAriaLabel\n }\n color={ButtonColor.secondary}\n icon={CloseIconButton}\n onClick={handleClose}\n testId=\"modal-closebtn\"\n variant={ButtonVariant.link}\n />\n </CloseBtn>\n )}\n </ModalContent>\n </ModalContainer>\n <ModalBackdrop\n data-testid=\"modal-backdrop\"\n isExiting={isExiting}\n onMouseDown={\n isBackgroundClickDisabled\n ? event => event.preventDefault()\n : null\n }\n fade\n isOpen={isModalOpen}\n unmountOnExit\n />\n </div>,\n document.getElementsByTagName('body')[0]\n )\n : null;\n }\n);\n","import * as React from 'react';\nimport { AnimatePresence, motion, HTMLMotionProps } from 'framer-motion';\nimport { MotionVariants } from '../../theme/components/transition';\n\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport { ThemeInterface } from '../../theme/magma';\n\n/**\n * @children required\n */\nexport interface TransitionProps extends HTMLMotionProps<'div'> {\n /**\n * If `true`, the element will unmount when `in={false}` and animation is done\n * @default false\n */\n unmountOnExit?: boolean;\n /**\n * If `true`, the content will animate in\n * @default false\n */\n isOpen?: boolean;\n /**\n * Custom variants to be applied to the enter and exit transitions.\n * @internal\n */\n customTransition?: MotionVariants<'enter' | 'exit'>;\n testId?: string;\n /**\n * Should children fade in/out\n * @default false\n */\n fade?: boolean;\n /**\n * Should children scale in/out\n * @default false\n */\n scale?: boolean;\n /**\n * Should children slide in/out from the top of the screen\n * @default false\n */\n slideTop?: boolean;\n /**\n * Should children slide in/out from the bottom of the screen\n * @default false\n */\n slideBottom?: boolean;\n /**\n * Should children slide in/out from the left of the screen\n * @default false\n */\n slideLeft?: boolean;\n /**\n * Should children slide in/out from the right of the screen\n * @default false\n */\n slideRight?: boolean;\n /**\n * Should the children get nudged in 50px from the top\n * @default false\n */\n nudgeTop?: boolean;\n /**\n * Should the children get nudged in 50px from the bottom\n * @default false\n */\n nudgeBottom?: boolean;\n /**\n * Should the children get nudged in 50px from the left\n * @default false\n */\n nudgeLeft?: boolean;\n /**\n * Should the children get nudged in 50px from the right\n * @default false\n */\n nudgeRight?: boolean;\n /**\n * Should children collapse in/out\n * @default false\n */\n collapse?: boolean;\n /**\n * Should children rotate 45 degrees\n * @default false\n */\n rotate45?: boolean;\n /**\n * Should children rotate 90 degrees\n * @default false\n */\n rotate90?: boolean;\n /**\n * Should children rotate 180 degrees\n * @default false\n */\n rotate180?: boolean;\n}\n\nexport const Transition = React.forwardRef<HTMLDivElement, TransitionProps>(\n (props, ref) => {\n const theme: ThemeInterface = React.useContext(ThemeContext);\n\n const {\n style,\n unmountOnExit,\n isOpen,\n testId,\n initial = 'exit',\n exit = 'exit',\n customTransition = {\n enter: { transition: {} },\n exit: { transition: {} },\n },\n ...rest\n } = props;\n\n const shouldExpand = unmountOnExit ? isOpen && unmountOnExit : true;\n\n const variants = Object.keys(rest).reduce(\n (acc, key) => {\n if (rest[key] && theme.transitions[key]) {\n const themeVariant = theme.transitions[key];\n rest[key] = undefined;\n return {\n baseStyle: {\n ...acc.baseStyle,\n ...themeVariant.baseStyle,\n },\n motion: {\n ...acc,\n enter: {\n ...acc.motion.enter,\n ...themeVariant.motion.enter,\n transition: {\n ...('transition' in acc.motion.enter\n ? acc.motion.enter.transition\n : {}),\n ...('transition' in themeVariant.motion.enter\n ? themeVariant.motion.enter.transition\n : {}),\n },\n },\n exit: {\n ...acc.motion.exit,\n ...themeVariant.motion.exit,\n transition: {\n ...('transition' in acc.motion.exit\n ? acc.motion.exit.transition\n : {}),\n ...('transition' in themeVariant.motion.exit\n ? themeVariant.motion.exit.transition\n : {}),\n },\n },\n },\n };\n }\n return acc;\n },\n { motion: customTransition, baseStyle: {} }\n );\n\n return (\n <AnimatePresence initial={false}>\n {shouldExpand && (\n <motion.div\n ref={ref}\n initial={initial}\n exit={exit}\n data-testid={testId}\n animate={isOpen || unmountOnExit ? 'enter' : 'exit'}\n variants={variants.motion}\n style={{ ...variants.baseStyle, ...style }}\n {...rest}\n />\n )}\n </AnimatePresence>\n );\n }\n);\n","import * as React from 'react';\n// import styled from '../../theme/styled';\nimport {\n InputBase,\n InputBaseProps,\n InputIconPosition,\n InputSize,\n InputType,\n} from '../InputBase';\nimport { I18nContext } from '../../i18n';\nimport { useIsInverse } from '../../inverse';\nimport { SearchIcon } from 'react-magma-icons';\nimport { Spinner } from '../Spinner';\n\nexport interface SearchProps extends InputBaseProps {\n /**\n * Style properties for the component container element\n */\n containerStyle?: React.CSSProperties;\n /**\n * Text for icon button aria-label\n * @default \"Search\"\n */\n iconAriaLabel?: string;\n /**\n * Relative size of the component\n * @default InputSize.medium\n */\n inputSize?: InputSize;\n /**\n * Style properties for the input element\n */\n inputStyle?: React.CSSProperties;\n /**\n * Clear contents of input by clicking a clear button\n */\n iconPosition?: InputIconPosition;\n isClearable?: boolean;\n /**\n * If true, the component will show a loading animation instead of a search button\n * @default false\n */\n isLoading?: boolean;\n isInverse?: boolean;\n /**\n * Text for input aria-label\n * @default \"Search\"\n */\n labelText?: string;\n /**\n * Action that will fire when search icon button is clicked\n */\n onSearch: (term: string) => void;\n testId?: string;\n /**\n * Value of the input element\n */\n value?: string;\n}\n\nexport const Search = React.forwardRef<HTMLInputElement, SearchProps>(\n (props, ref) => {\n const {\n iconAriaLabel,\n isClearable,\n isLoading,\n labelText,\n placeholder,\n onSearch,\n ...other\n } = props;\n\n const i18n = React.useContext(I18nContext);\n\n const [value, setValue] = React.useState<string>(props.value);\n\n const icon = isLoading ? <Spinner /> : <SearchIcon />;\n\n React.useEffect(() => {\n setValue(props.value);\n }, [props.value]);\n\n function handleChange(event: React.ChangeEvent<HTMLInputElement>) {\n props.onChange &&\n typeof props.onChange === 'function' &&\n props.onChange(event);\n setValue(event.target.value);\n }\n\n // handle search on enter\n function handleKeyPress(event: React.KeyboardEvent) {\n if (event.key === 'Enter') {\n event.preventDefault();\n handleSearch();\n }\n }\n\n function handleSearch() {\n onSearch(value);\n }\n\n return (\n <InputBase\n {...other}\n aria-label={labelText ? labelText : i18n.search.input.ariaLabel}\n icon={icon}\n iconAriaLabel={\n iconAriaLabel ? iconAriaLabel : i18n.search.iconAriaLabel\n }\n isClearable={isClearable}\n isInverse={useIsInverse(props.isInverse)}\n onChange={handleChange}\n onIconClick={\n props.isPredictive ? null : isLoading ? null : handleSearch\n }\n onKeyDown={handleKeyPress}\n placeholder={placeholder ? placeholder : i18n.search.input.placeholder}\n type={InputType.search}\n value={value}\n ref={ref}\n />\n );\n }\n);\n","import React from 'react';\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport { I18nContext } from '../../i18n';\nimport { StyledCard, StyledList, StyledItem } from './shared';\nimport {\n UseSelectGetMenuPropsOptions,\n UseSelectGetItemPropsOptions,\n} from 'downshift';\nimport { instanceOfToBeCreatedItemObject } from '.';\nimport {\n defaultComponents,\n SelectComponents,\n ItemRenderOptions,\n} from './components';\nimport styled from '../../theme/styled';\nimport { convertStyleValueToString } from '../../utils';\n\ninterface ItemsListProps<T> {\n customComponents?: SelectComponents<T>;\n getItemProps: (options?: UseSelectGetItemPropsOptions<T>) => any;\n getMenuProps: (options?: UseSelectGetMenuPropsOptions) => any;\n highlightedIndex?: number;\n isOpen?: boolean;\n items: T[];\n itemToString: (item: T) => string;\n maxHeight?: number | string;\n menuStyle?: React.CSSProperties;\n}\n\nconst NoItemsMessage = styled.span`\n color: ${props => props.theme.colors.neutral04};\n display: block;\n padding-top: ${props => props.theme.spaceScale.spacing03};\n text-align: center;\n`;\n\nexport function ItemsList<T>(props: ItemsListProps<T>) {\n const {\n customComponents,\n isOpen,\n getMenuProps,\n items,\n itemToString,\n highlightedIndex,\n getItemProps,\n maxHeight,\n menuStyle,\n } = props;\n\n const theme = React.useContext(ThemeContext);\n const i18n = React.useContext(I18nContext);\n\n const hasItems = items && items.length > 0;\n\n const heightString = convertStyleValueToString(maxHeight);\n const { Item } = defaultComponents<T>({\n ...customComponents,\n });\n\n return (\n <StyledCard\n hasDropShadow\n isInverse={false}\n isOpen={isOpen}\n style={menuStyle}\n >\n <StyledList isOpen={isOpen} {...getMenuProps()} maxHeight={heightString}>\n {isOpen && hasItems ? (\n items.map((item, index) => {\n const itemString = instanceOfToBeCreatedItemObject(item)\n ? item.label\n : itemToString(item);\n\n const { ref, ...otherDownshiftItemProps } = getItemProps({\n item,\n index,\n });\n\n const key = `${itemString}${index}`;\n\n const itemProps: ItemRenderOptions<T> = {\n isFocused: highlightedIndex === index,\n itemRef: ref,\n item,\n itemString,\n key,\n theme,\n ...otherDownshiftItemProps,\n };\n\n return <Item<T> {...itemProps} key={key} />;\n })\n ) : (\n <StyledItem tabIndex={-1}>\n <NoItemsMessage theme={theme}>\n {i18n.emptyItemsListText}\n </NoItemsMessage>\n </StyledItem>\n )}\n </StyledList>\n </StyledCard>\n );\n}\n","import * as React from 'react';\nimport {\n useSelect,\n useMultipleSelection,\n UseSelectProps,\n UseMultipleSelectionProps,\n} from 'downshift';\n\nimport { Select as InternalSelect } from './Select';\nimport { MultiSelect } from './MultiSelect';\nimport { SelectComponents } from './components';\nimport { useGenerateId, XOR, Omit } from '../../utils';\nimport { LabelPosition } from '../Label';\nimport { useIsInverse } from '../../inverse';\n\nexport type SelectOptions =\n | string\n | { value: string; label: string; [key: string]: any }\n | any;\n\nexport interface InternalSelectProps<T> {\n /**\n * This complex object includes all the compositional components that are used. If you wish to overwrite a component, pass in a component to the appropriate namespace\n */\n components?: SelectComponents<T>;\n /**\n * Style properties for the component container\n */\n containerStyle?: React.CSSProperties;\n /**\n * Content of the error message. If a value is provided, the component will be styled to show an error state\n */\n errorMessage?: React.ReactNode;\n /**\n * Content of the helper message\n */\n helperMessage?: React.ReactNode;\n /**\n * Style properties for the select trigger or combobox input\n */\n inputStyle?: React.CSSProperties;\n /**\n * If true, the component include a button for clearing the field\n * @default false\n */\n isClearable?: boolean;\n /**\n * Max-height for the item menu list ul element\n */\n itemListMaxHeight?: number | string;\n /**\n * If true, item will be disabled; it will appear dimmed and events will not fire\n * @default false\n */\n disabled?: boolean;\n isInverse?: boolean;\n /**\n * If true, label text will be hidden visually, but will still be read by assistive technology\n * @default false\n */\n isLabelVisuallyHidden?: boolean;\n /**\n * If true, multiple items may be selected\n * @default false\n */\n isMulti?: boolean;\n /**\n * Position of text label relative to form field\n */\n labelPosition?: LabelPosition;\n /**\n * Style properties for the label\n */\n labelStyle?: React.CSSProperties;\n /**\n * Text for label\n */\n labelText: string;\n /**\n * Style properties for the items menu\n */\n menuStyle?: React.CSSProperties;\n /**\n * Style properties for the helper or error message\n */\n messageStyle?: React.CSSProperties;\n /**\n * Text for select trigger button or combobox input placeholder\n */\n placeholder?: string;\n testId?: string;\n}\n\nexport interface InternalMultiProps<T> {\n /**\n * Event that fires when the clear button is clicked on a multi-selected item\n */\n onRemoveSelectedItem?: (removedItem: T) => void;\n}\n\nexport interface SelectProps<T extends SelectOptions>\n extends UseSelectProps<T>,\n InternalSelectProps<T> {\n /**\n * Id of the element that describes the select trigger button\n */\n ariaDescribedBy?: string;\n /**\n * @internal\n */\n hasError?: boolean;\n /**\n * Reference to the trigger button element in the select\n */\n innerRef?: React.Ref<HTMLButtonElement>;\n /**\n * @internal\n */\n isMulti?: false;\n /**\n * Event that fires when the trigger button loses focus\n */\n onBlur?: (event: React.FocusEvent) => void;\n /**\n * Event that fires when the trigger button gains focus\n */\n onFocus?: (event: React.FocusEvent) => void;\n /**\n * Event that fires when the trigger button receives keypress\n */\n onKeyDown?: (event: React.KeyboardEvent) => void;\n /**\n * Event that will fire when a character is typed while focused on the trigger button\n */\n onKeyPress?: (event: React.KeyboardEvent) => void;\n /**\n * Event that will fire when a keypress is released while focused on the trigger button\n */\n onKeyUp?: (event: React.KeyboardEvent) => void;\n}\n\nexport interface MultiSelectProps<T extends SelectOptions>\n extends UseMultipleSelectionProps<T>,\n Omit<SelectProps<T>, 'onStateChange' | 'stateReducer' | 'isMulti'>,\n InternalMultiProps<T> {\n /**\n * @internal\n */\n hasError?: boolean;\n isInverse?: boolean;\n /**\n * @internal\n */\n isMulti: true;\n}\n\nexport function instanceOfMultiSelect<T>(\n object: any\n): object is MultiSelectProps<T> {\n return 'isMulti' in object && object.type !== 'combo';\n}\n\nexport function instanceOfDefaultItemObject(\n object: any\n): object is { label: string; value: string; [key: string]: any } {\n return object && 'label' in object;\n}\n\nexport function instanceOfToBeCreatedItemObject(\n object: any\n): object is {\n label: string;\n value: string;\n react_magma__created_item: boolean;\n} {\n return (\n typeof object !== 'string' &&\n object &&\n 'react_magma__created_item' in object\n );\n}\n\nexport type XORSelectProps<T> = XOR<SelectProps<T>, MultiSelectProps<T>>;\n\nexport const SelectStateChangeTypes = useSelect.stateChangeTypes;\nexport const MultipleSelectionStateChangeTypes =\n useMultipleSelection.stateChangeTypes;\n\nexport function Select<T>(props: XORSelectProps<T>) {\n const {\n containerStyle,\n id: defaultId,\n isMulti,\n labelPosition,\n errorMessage,\n messageStyle,\n helperMessage,\n testId,\n } = props;\n\n function itemToString(item: T) {\n return item && typeof item === 'string'\n ? item\n : item && instanceOfDefaultItemObject(item)\n ? item.label\n : '';\n }\n\n const hasError = !!errorMessage;\n\n const id = useGenerateId(defaultId);\n\n const descriptionId = errorMessage || helperMessage ? `${id}__desc` : null;\n\n const isInverse = useIsInverse(props.isInverse);\n\n return (\n <div style={containerStyle} data-testid={testId}>\n {isMulti && instanceOfMultiSelect<T>(props) ? (\n <MultiSelect\n ariaDescribedBy={descriptionId}\n id={id}\n isInverse={isInverse}\n labelPosition={labelPosition || LabelPosition.top}\n itemToString={itemToString}\n {...(props as MultiSelectProps<T>)}\n hasError={hasError}\n />\n ) : (\n <InternalSelect\n ariaDescribedBy={descriptionId}\n errorMessage={errorMessage}\n id={id}\n isInverse={isInverse}\n itemToString={itemToString}\n labelPosition={labelPosition || LabelPosition.top}\n hasError={hasError}\n helperMessage={helperMessage}\n messageStyle={messageStyle}\n {...(props as SelectProps<T>)}\n />\n )}\n </div>\n );\n}\n","import React from 'react';\nimport styled from '@emotion/styled';\nimport { Label, LabelPosition } from '../Label';\nimport { VisuallyHidden } from '../VisuallyHidden';\nimport { UseSelectGetLabelPropsOptions } from 'downshift';\nimport { InputMessage } from '../Input/InputMessage';\n\nexport const SelectContainerElement = styled.div<{\n labelPosition?: LabelPosition;\n}>`\n align-items: baseline;\n display: ${props =>\n props.labelPosition == LabelPosition.left ? 'flex' : 'block'};\n position: relative;\n`;\n\nconst InputMessageContainer = styled.div`\n flex-grow: 1;\n`;\n\ninterface SelectContainerInterface<T> {\n children: React.ReactNode[];\n containerStyle?: React.CSSProperties;\n errorMessage?: React.ReactNode;\n descriptionId?: string;\n getLabelProps: (options?: UseSelectGetLabelPropsOptions) => any;\n hasError?: boolean;\n helperMessage?: React.ReactNode;\n isInverse?: boolean;\n isLabelVisuallyHidden?: boolean;\n labelPosition?: LabelPosition;\n labelStyle?: React.CSSProperties;\n labelText: string;\n messageStyle?: React.CSSProperties;\n}\n\nexport function SelectContainer<T>(props: SelectContainerInterface<T>) {\n const {\n children,\n descriptionId,\n errorMessage,\n getLabelProps,\n helperMessage,\n isInverse,\n isLabelVisuallyHidden,\n labelPosition,\n labelStyle,\n labelText,\n messageStyle,\n } = props;\n\n const hasError = !!errorMessage;\n\n return (\n <SelectContainerElement\n labelPosition={labelPosition}\n data-testid=\"selectContainerElement\"\n >\n <Label\n {...getLabelProps()}\n isInverse={isInverse}\n labelPosition={labelPosition}\n style={labelStyle}\n >\n {isLabelVisuallyHidden ? (\n <VisuallyHidden>{labelText}</VisuallyHidden>\n ) : (\n labelText\n )}\n </Label>\n <InputMessageContainer>\n {children}\n {!(\n labelPosition === LabelPosition.left &&\n !(errorMessage || helperMessage)\n ) &&\n (errorMessage || helperMessage) && (\n <InputMessage\n id={descriptionId}\n isInverse={isInverse}\n hasError={hasError}\n style={messageStyle}\n >\n {(errorMessage || helperMessage) && (\n <>{errorMessage ? errorMessage : helperMessage}</>\n )}\n </InputMessage>\n )}\n </InputMessageContainer>\n </SelectContainerElement>\n );\n}\n","import * as React from 'react';\nimport { SelectProps } from '.';\nimport { useSelect } from 'downshift';\nimport { SelectText } from './shared';\nimport { defaultComponents } from './components';\nimport { CloseIcon } from 'react-magma-icons';\nimport { ButtonSize, ButtonVariant } from '../Button';\nimport { ItemsList } from './ItemsList';\nimport { SelectContainer } from './SelectContainer';\nimport { SelectTriggerButton } from './SelectTriggerButton';\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport { I18nContext } from '../../i18n';\nimport { useForkedRef } from '../../utils';\n\nexport function Select<T>(props: SelectProps<T>) {\n const {\n ariaDescribedBy,\n components: customComponents,\n defaultSelectedItem,\n errorMessage,\n hasError,\n helperMessage,\n inputStyle,\n isLabelVisuallyHidden,\n innerRef,\n itemListMaxHeight,\n itemToString,\n items,\n labelStyle,\n labelText,\n initialSelectedItem,\n isClearable,\n disabled,\n isInverse,\n labelPosition,\n menuStyle,\n onBlur,\n onFocus,\n onIsOpenChange,\n onKeyDown,\n onKeyPress,\n onKeyUp,\n messageStyle,\n placeholder,\n selectedItem: passedInSelectedItem,\n } = props;\n\n const toggleButtonRef = React.useRef<HTMLButtonElement>();\n const theme = React.useContext(ThemeContext);\n const i18n = React.useContext(I18nContext);\n\n const ref = useForkedRef(innerRef || null, toggleButtonRef);\n\n function getValidItem(itemToCheck: T, key: string): object {\n return items.findIndex(\n i => itemToString(i) === itemToString(itemToCheck)\n ) !== -1\n ? { [key]: itemToCheck }\n : { [key]: null };\n }\n\n function handleOnIsOpenChange(changes) {\n const {\n isOpen: changedIsOpen,\n selectedItem: changedSelectedItem,\n } = changes;\n\n if (changedIsOpen && changedSelectedItem) {\n setHighlightedIndex(\n items.findIndex(\n i => itemToString(i) === itemToString(changedSelectedItem)\n )\n );\n }\n\n onIsOpenChange &&\n typeof onIsOpenChange === 'function' &&\n onIsOpenChange(changes);\n }\n\n function stateReducer(state, actionAndChanges) {\n const { type, changes } = actionAndChanges;\n switch (type) {\n case useSelect.stateChangeTypes.ToggleButtonKeyDownCharacter:\n return {\n ...changes,\n selectedItem: state.selectedItem,\n };\n default:\n return changes;\n }\n }\n\n const {\n isOpen,\n selectedItem,\n getToggleButtonProps,\n getLabelProps,\n getMenuProps,\n highlightedIndex,\n getItemProps,\n reset,\n openMenu,\n setHighlightedIndex,\n } = useSelect<T>({\n ...props,\n onIsOpenChange: handleOnIsOpenChange,\n stateReducer,\n ...(defaultSelectedItem &&\n getValidItem(defaultSelectedItem, 'defaultSelectedItem')),\n ...(initialSelectedItem &&\n getValidItem(initialSelectedItem, 'initialSelectedItem')),\n ...(passedInSelectedItem &&\n getValidItem(passedInSelectedItem, 'selectedItem')),\n });\n\n const { ClearIndicator } = defaultComponents<T>({\n ...customComponents,\n });\n\n const toggleButtonProps = getToggleButtonProps({\n disabled: disabled,\n onBlur,\n onKeyDown: event => {\n if (\n getToggleButtonProps().id === document.activeElement.id &&\n (event.key === 'Enter' || event.key === ' ')\n ) {\n event.preventDefault();\n openMenu();\n }\n\n onKeyDown && typeof onKeyDown === 'function' && onKeyDown(event);\n },\n onKeyPress,\n onKeyUp,\n onFocus,\n ref,\n });\n\n function defaultHandleClearIndicatorClick(event: React.SyntheticEvent) {\n event.stopPropagation();\n\n if (toggleButtonRef.current) {\n toggleButtonRef.current.focus();\n }\n\n reset();\n }\n\n const clearIndicatorAriaLabel = i18n.select.clearIndicatorAriaLabel\n .replace(/\\{labelText\\}/g, labelText)\n .replace(/\\{selectedItem\\}/g, itemToString(selectedItem));\n\n const selectText = itemToString(selectedItem)\n ? itemToString(selectedItem)\n : typeof placeholder === 'string'\n ? placeholder\n : i18n.select.placeholder;\n\n return (\n <SelectContainer\n errorMessage={errorMessage}\n descriptionId={ariaDescribedBy}\n getLabelProps={getLabelProps}\n helperMessage={helperMessage}\n isInverse={isInverse}\n isLabelVisuallyHidden={isLabelVisuallyHidden}\n labelPosition={labelPosition}\n labelStyle={labelStyle}\n labelText={labelText}\n messageStyle={messageStyle}\n >\n <SelectTriggerButton\n ariaDescribedBy={ariaDescribedBy}\n customComponents={customComponents}\n toggleButtonProps={toggleButtonProps}\n hasError={hasError}\n disabled={disabled}\n isInverse={isInverse}\n style={inputStyle}\n >\n <SelectText data-testid=\"selectedItemText\">{selectText}</SelectText>\n {isClearable && selectedItem && (\n <ClearIndicator\n aria-label={clearIndicatorAriaLabel}\n icon={<CloseIcon size={theme.iconSizes.xSmall} />}\n onClick={defaultHandleClearIndicatorClick}\n size={ButtonSize.small}\n style={{ marginTop: '0', marginBottom: '0' }}\n testId=\"clearIndicator\"\n variant={ButtonVariant.link}\n />\n )}\n </SelectTriggerButton>\n <ItemsList\n customComponents={customComponents}\n getItemProps={getItemProps}\n getMenuProps={getMenuProps}\n highlightedIndex={highlightedIndex}\n isOpen={isOpen}\n maxHeight={itemListMaxHeight || theme.select.menu.maxHeight}\n items={items}\n itemToString={itemToString}\n menuStyle={menuStyle}\n />\n </SelectContainer>\n );\n}\n","import * as React from 'react';\nimport { MultiSelectProps } from '.';\nimport { useSelect, useMultipleSelection } from 'downshift';\nimport { CloseIcon } from 'react-magma-icons';\nimport { ItemsList } from './ItemsList';\nimport { SelectContainer } from './SelectContainer';\nimport { SelectTriggerButton } from './SelectTriggerButton';\nimport { SelectedItemButton, IconWrapper } from './shared';\n\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport { I18nContext } from '../../i18n';\n\nexport function MultiSelect<T>(props: MultiSelectProps<T>) {\n const {\n ariaDescribedBy,\n components: customComponents,\n errorMessage,\n hasError,\n helperMessage,\n inputStyle,\n isLabelVisuallyHidden,\n innerRef,\n itemToString,\n items,\n labelPosition,\n labelStyle,\n labelText,\n disabled,\n isInverse,\n itemListMaxHeight,\n menuStyle,\n messageStyle,\n onBlur,\n onFocus,\n onKeyDown,\n onKeyPress,\n onKeyUp,\n onRemoveSelectedItem,\n placeholder,\n } = props;\n\n function checkSelectedItemValidity(itemToCheck: T) {\n return (\n items.findIndex(i => itemToString(i) === itemToString(itemToCheck)) !== -1\n );\n }\n\n const {\n getSelectedItemProps,\n getDropdownProps,\n addSelectedItem,\n removeSelectedItem,\n selectedItems,\n setActiveIndex,\n } = useMultipleSelection<T>({\n ...props,\n ...(props.initialSelectedItems && {\n initialSelectedItems: props.initialSelectedItems.filter(\n checkSelectedItemValidity\n ),\n }),\n ...(props.selectedItems && {\n selectedItems: props.selectedItems.filter(checkSelectedItemValidity),\n }),\n });\n\n function getFilteredItems(unfilteredItems) {\n return unfilteredItems.filter(\n item =>\n selectedItems.findIndex(\n selectedItem => itemToString(selectedItem) === itemToString(item)\n ) < 0\n );\n }\n\n const {\n stateReducer: passedInStateReducer,\n onStateChange,\n ...selectProps\n } = props;\n\n function stateReducer(state, actionAndChanges) {\n const { type, changes } = actionAndChanges;\n switch (type) {\n case useSelect.stateChangeTypes.ToggleButtonKeyDownCharacter:\n return {\n ...changes,\n selectedItem: state.selectedItem,\n };\n default:\n return changes;\n }\n }\n\n const {\n isOpen,\n getToggleButtonProps,\n getLabelProps,\n getMenuProps,\n highlightedIndex,\n getItemProps,\n selectItem,\n openMenu,\n } = useSelect({\n ...selectProps,\n items: getFilteredItems(items),\n onSelectedItemChange: defaultOnSelectedItemChange,\n stateReducer,\n });\n\n function defaultOnSelectedItemChange(changes) {\n const { selectedItem: newSelectedItem } = changes;\n\n if (newSelectedItem) {\n addSelectedItem(newSelectedItem);\n selectItem(null);\n }\n }\n\n function handleRemoveSelectedItem(event: React.SyntheticEvent, selectedItem) {\n event.stopPropagation();\n\n onRemoveSelectedItem && typeof onRemoveSelectedItem === 'function'\n ? onRemoveSelectedItem(selectedItem)\n : removeSelectedItem(selectedItem);\n }\n\n const theme = React.useContext(ThemeContext);\n const i18n = React.useContext(I18nContext);\n\n const toggleButtonProps = getToggleButtonProps({\n ...getDropdownProps({\n onBlur,\n onKeyDown: event => {\n if (\n document.activeElement.tagName.toLowerCase() === 'button' &&\n (event.key === 'Backspace' ||\n event.key === 'Delete' ||\n event.key === 'ArrowLeft')\n ) {\n event.nativeEvent.preventDownshiftDefault = true;\n }\n\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n openMenu();\n }\n\n onKeyDown && typeof onKeyDown === 'function' && onKeyDown(event);\n },\n onKeyPress,\n onKeyUp,\n onFocus,\n preventKeyAction: isOpen,\n ...(innerRef && { ref: innerRef }),\n }),\n disabled: disabled,\n });\n\n return (\n <SelectContainer\n descriptionId={ariaDescribedBy}\n errorMessage={errorMessage}\n getLabelProps={getLabelProps}\n helperMessage={helperMessage}\n isLabelVisuallyHidden={isLabelVisuallyHidden}\n labelPosition={labelPosition}\n labelStyle={labelStyle}\n labelText={labelText}\n isInverse={isInverse}\n messageStyle={messageStyle}\n >\n <SelectTriggerButton\n ariaDescribedBy={ariaDescribedBy}\n toggleButtonProps={toggleButtonProps}\n hasError={hasError}\n disabled={disabled}\n isInverse={isInverse}\n style={inputStyle}\n >\n {selectedItems && selectedItems.length > 0\n ? selectedItems.map((multiSelectedItem, index) => {\n const multiSelectedItemString = itemToString(multiSelectedItem);\n return (\n <SelectedItemButton\n aria-label={i18n.multiSelect.selectedItemButtonAriaLabel.replace(\n /\\{selectedItem\\}/g,\n multiSelectedItemString\n )}\n key={`selected-item-${index}`}\n {...getSelectedItemProps({\n selectedItem: multiSelectedItem,\n index,\n })}\n onClick={event =>\n handleRemoveSelectedItem(event, multiSelectedItem)\n }\n onFocus={() => setActiveIndex(index)}\n theme={theme}\n >\n {multiSelectedItemString}\n <IconWrapper>\n <CloseIcon size={theme.iconSizes.xSmall} />\n </IconWrapper>\n </SelectedItemButton>\n );\n })\n : typeof placeholder === 'string'\n ? placeholder\n : i18n.multiSelect.placeholder}\n </SelectTriggerButton>\n <ItemsList\n customComponents={customComponents}\n getItemProps={getItemProps}\n getMenuProps={getMenuProps}\n highlightedIndex={highlightedIndex}\n isOpen={isOpen}\n items={getFilteredItems(items)}\n itemToString={itemToString}\n maxHeight={itemListMaxHeight || theme.select.menu.maxHeight}\n menuStyle={menuStyle}\n />\n </SelectContainer>\n );\n}\n","import React from 'react';\nimport { inputBaseStyles } from '../InputBase';\nimport { defaultComponents, SelectComponents } from '../Select/components';\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport styled from '@emotion/styled';\nimport { css } from '@emotion/core';\nimport {\n UseComboboxGetToggleButtonPropsOptions,\n UseComboboxGetComboboxPropsOptions,\n UseComboboxGetInputPropsOptions,\n} from 'downshift';\n\nimport { SelectedItemsWrapper } from '../Select/shared';\n\nconst ComboBoxContainer = styled.div<{\n hasError?: boolean;\n isInverse?: boolean;\n theme?: any;\n}>`\n display: flex;\n`;\n\nconst InputContainer = styled.div<{\n hasError?: boolean;\n disabled?: boolean;\n isFocused?: boolean;\n isInverse?: boolean;\n theme?: any;\n}>`\n align-items: center;\n background: ${props => props.theme.colors.neutral08};\n border: 1px solid;\n border-color: ${props =>\n props.isInverse\n ? props.theme.colors.neutral08\n : props.theme.colors.neutral03};\n border-radius: ${props => props.theme.borderRadius};\n display: flex;\n min-height: ${props => props.theme.spaceScale.spacing09};\n min-width: ${props => props.theme.spaceScale.spacing13};\n padding: 0 ${props => props.theme.spaceScale.spacing03} 0 0;\n width: 100%;\n\n ${props =>\n props.isFocused &&\n css`\n outline: 2px dotted\n ${props.isInverse\n ? props.theme.colors.focusInverse\n : props.theme.colors.focus};\n outline-offset: 4px;\n `}\n\n ${props =>\n props.hasError &&\n css`\n border-color: ${props.theme.colors.danger};\n box-shadow: 0 0 0 1px\n ${props.isInverse\n ? props.theme.colors.neutral08\n : props.theme.colors.danger};\n `}\n\n ${props =>\n props.disabled &&\n css`\n background: ${props.theme.colors.neutral07};\n border-color: ${props.theme.colors.neutral05};\n color: ${props.theme.colors.disabledText};\n cursor: not-allowed;\n outline: 0;\n\n &::placeholder {\n color: ${props.theme.colors.disabledText};\n }\n `}\n`;\n\nconst StyledInput = styled.input`\n ${inputBaseStyles}\n border: 0;\n display: flex;\n flex-grow: 1;\n height: ${props => props.theme.spaceScale.spacing08};\n min-width: ${props => props.theme.spaceScale.spacing07};\n padding-left: ${props => props.theme.spaceScale.spacing02};\n width: 0;\n\n &:focus {\n outline: 0;\n }\n`;\n\ninterface ComboboxInputProps<T> {\n ariaDescribedBy?: string;\n children?: React.ReactNode | React.ReactNode[];\n customComponents?: SelectComponents<T>;\n getComboboxProps: (options?: UseComboboxGetComboboxPropsOptions) => any;\n getInputProps: (options?: UseComboboxGetInputPropsOptions) => any;\n getToggleButtonProps: (\n options?: UseComboboxGetToggleButtonPropsOptions\n ) => any;\n hasError?: boolean;\n innerRef?: React.Ref<HTMLInputElement>;\n inputStyle?: React.CSSProperties;\n disabled?: boolean;\n isInverse?: boolean;\n isLoading?: boolean;\n onInputBlur?: (event: React.FocusEvent) => void;\n onInputFocus?: (event: React.FocusEvent) => void;\n onInputKeyDown?: (event: React.KeyboardEvent) => void;\n onInputKeyPress?: (event: React.KeyboardEvent) => void;\n onInputKeyUp?: (event: React.KeyboardEvent) => void;\n placeholder?: string;\n selectedItems?: React.ReactNode;\n toggleButtonRef?: React.Ref<HTMLButtonElement>;\n}\n\nexport function ComboboxInput<T>(props: ComboboxInputProps<T>) {\n const {\n ariaDescribedBy,\n children,\n customComponents,\n getComboboxProps,\n getInputProps,\n getToggleButtonProps,\n hasError,\n innerRef,\n inputStyle,\n disabled,\n isInverse,\n isLoading,\n onInputBlur,\n onInputFocus,\n onInputKeyDown,\n onInputKeyPress,\n onInputKeyUp,\n placeholder,\n selectedItems,\n toggleButtonRef,\n } = props;\n const theme = React.useContext(ThemeContext);\n\n const [isFocused, setIsFocused] = React.useState<boolean>(false);\n\n const { DropdownIndicator, LoadingIndicator } = defaultComponents<T>({\n ...customComponents,\n });\n\n function handleBlur(e: React.FocusEvent) {\n setIsFocused(false);\n\n onInputBlur && typeof onInputBlur === 'function' && onInputBlur(e);\n }\n\n function handleFocus(e: React.FocusEvent) {\n setIsFocused(true);\n\n onInputFocus && typeof onInputFocus === 'function' && onInputFocus(e);\n }\n\n const inputProps = getInputProps({\n disabled: disabled,\n onBlur: handleBlur,\n onFocus: handleFocus,\n onKeyDown: onInputKeyDown,\n onKeyPress: onInputKeyPress,\n onKeyUp: onInputKeyUp,\n ...(innerRef && { ref: innerRef }),\n });\n\n return (\n <ComboBoxContainer\n {...getComboboxProps()}\n hasError={hasError}\n disabled={disabled}\n isInverse={isInverse}\n theme={theme}\n >\n <InputContainer\n {...getToggleButtonProps({\n disabled,\n ...(toggleButtonRef && { ref: toggleButtonRef }),\n })}\n hasError={hasError}\n disabled={disabled}\n isFocused={isFocused}\n isInverse={isInverse}\n style={inputStyle}\n theme={theme}\n >\n <SelectedItemsWrapper>\n {selectedItems}\n <StyledInput\n {...inputProps}\n aria-describedby={ariaDescribedBy}\n aria-invalid={hasError}\n disabled={disabled}\n placeholder={placeholder}\n theme={theme}\n />\n </SelectedItemsWrapper>\n {children}\n {isLoading && (\n <LoadingIndicator\n style={{ flexShrink: 0, marginRight: theme.spaceScale.spacing02 }}\n />\n )}\n <DropdownIndicator\n aria-label=\"toggle menu\"\n color={theme.colors.neutral}\n />\n </InputContainer>\n </ComboBoxContainer>\n );\n}\n","import React from 'react';\n\nexport function useComboboxItems(defaultItems, items) {\n const afterInitialRender = React.useRef(false);\n const allItems = React.useRef(defaultItems || items);\n const [displayItems, setDisplayItems] = React.useState(defaultItems || items);\n\n function updateItemsRef(newItem) {\n const newItems = [...allItems.current, newItem];\n allItems.current = newItems;\n setDisplayItems(newItems);\n }\n\n React.useEffect(() => {\n if (!afterInitialRender.current) {\n afterInitialRender.current = true;\n return;\n }\n\n const cleanItems = items ? items : [];\n\n allItems.current = cleanItems;\n setDisplayItems(cleanItems);\n }, [items]);\n\n return [allItems, displayItems, setDisplayItems, updateItemsRef];\n}\n\nfunction inputValueInList(items, inputValue, itemToString) {\n return (\n items.current.filter(\n item => itemToString(item).toLowerCase() === inputValue.toLowerCase()\n ).length > 0\n );\n}\n\nexport function defaultOnInputValueChange(\n changes,\n items,\n itemToString,\n disableCreateItem,\n setDisplayItems,\n setHighlightedIndex,\n onInputChange,\n createLabel\n) {\n const { inputValue: inputBaseValue, isOpen } = changes;\n\n if (isOpen) {\n const inputValue =\n typeof inputBaseValue === 'string'\n ? inputBaseValue\n : itemToString(inputBaseValue);\n\n const filteredItems = inputValue\n ? items.current\n .filter(item =>\n itemToString(item)\n .toLowerCase()\n .startsWith(inputValue.toLowerCase())\n )\n .concat(\n !disableCreateItem &&\n inputValue &&\n !inputValueInList(items, inputValue, itemToString)\n ? {\n label: createLabel.replace(/\\{inputValue\\}/g, inputValue),\n value: inputValue,\n react_magma__created_item: true,\n }\n : null\n )\n .filter(Boolean)\n : items.current;\n\n setHighlightedIndex(0);\n setDisplayItems(filteredItems);\n }\n\n onInputChange &&\n typeof onInputChange === 'function' &&\n onInputChange(changes);\n}\n","import * as React from 'react';\nimport { instanceOfDefaultItemObject } from '../Select';\nimport { useCombobox } from 'downshift';\nimport { CloseIcon } from 'react-magma-icons';\nimport { defaultComponents } from '../Select/components';\nimport { SelectContainer } from '../Select/SelectContainer';\nimport { ItemsList } from '../Select/ItemsList';\nimport { ComboboxInput } from './ComboboxInput';\nimport { ButtonShape, ButtonSize, ButtonVariant } from '../Button';\nimport { useComboboxItems, defaultOnInputValueChange } from './shared';\nimport { ComboboxProps } from '.';\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport { I18nContext } from '../../i18n';\nimport { useForkedRef } from '../../utils';\n\nexport function InternalCombobox<T>(props: ComboboxProps<T>) {\n const {\n ariaDescribedBy,\n components: customComponents,\n defaultItems,\n defaultSelectedItem,\n disableCreateItem,\n errorMessage,\n hasError,\n helperMessage,\n initialSelectedItem,\n inputStyle,\n isClearable,\n disabled,\n innerRef,\n isLabelVisuallyHidden,\n isLoading,\n isInverse,\n itemListMaxHeight,\n items,\n itemToString,\n labelPosition,\n labelStyle,\n labelText,\n menuStyle,\n messageStyle,\n newItemTransform,\n onInputBlur,\n onInputChange,\n onInputFocus,\n onInputKeyDown,\n onInputKeyPress,\n onInputKeyUp,\n onInputValueChange,\n onIsOpenChange,\n onItemCreated,\n placeholder,\n selectedItem: passedInSelectedItem,\n toggleButtonRef,\n } = props;\n\n const theme = React.useContext(ThemeContext);\n const i18n = React.useContext(I18nContext);\n\n function isCreatedItem(item) {\n return (\n !(typeof item === 'string') &&\n instanceOfDefaultItemObject(item) &&\n item.react_magma__created_item\n );\n }\n\n function defaultNewItemTransform(newItem) {\n return newItem.value;\n }\n\n function defaultOnSelectedItemChange(changes) {\n if (isCreatedItem(changes.selectedItem)) {\n const {\n react_magma__created_item,\n ...createdItem\n } = changes.selectedItem;\n\n const newItem =\n react_magma__created_item &&\n newItemTransform &&\n typeof newItemTransform === 'function'\n ? newItemTransform(createdItem)\n : defaultNewItemTransform(createdItem);\n\n items && onItemCreated && typeof onItemCreated === 'function'\n ? onItemCreated(newItem)\n : updateItemsRef(newItem);\n\n selectItem(newItem);\n setInputValue(itemToString(newItem));\n\n if (process.env.NODE_ENV === 'development') {\n if (!items && !disableCreateItem) {\n console.warn(\n 'React Magma Warning: Switching from uncontrolled to controlled items. If allowing new items to be created you should handle the onItemCreated event and control the items list in your code.'\n );\n }\n }\n } else {\n props.onSelectedItemChange &&\n typeof props.onSelectedItemChange === 'function' &&\n props.onSelectedItemChange(changes);\n }\n }\n\n function stateReducer(state, actionAndChanges) {\n const { type, changes } = actionAndChanges;\n\n switch (type) {\n case useCombobox.stateChangeTypes.InputKeyDownEnter: {\n const inputValue = isCreatedItem(displayItems[0])\n ? ''\n : changes.inputValue;\n return {\n ...changes,\n inputValue,\n };\n }\n case useCombobox.stateChangeTypes.ItemClick: {\n const inputValue = isCreatedItem(displayItems[0])\n ? ''\n : changes.inputValue;\n return {\n ...changes,\n inputValue,\n };\n }\n case useCombobox.stateChangeTypes.InputBlur:\n return {\n ...changes,\n inputValue:\n state.inputValue && !state.selectedItem\n ? ''\n : itemToString(state.selectedItem),\n selectedItem: state.selectedItem ? state.selectedItem : '',\n };\n case useCombobox.stateChangeTypes.FunctionReset:\n return {\n ...changes,\n inputValue: changes.selectedItem\n ? itemToString(changes.selectedItem)\n : '',\n };\n default:\n return changes;\n }\n }\n\n const [\n allItems,\n displayItems,\n setDisplayItems,\n updateItemsRef,\n ] = useComboboxItems(defaultItems, items);\n\n function getValidItem(itemToCheck: T, key: string): object {\n return allItems.current.findIndex(\n i => itemToString(i) === itemToString(itemToCheck)\n ) !== -1\n ? { [key]: itemToCheck }\n : { [key]: null };\n }\n\n function handleOnIsOpenChange(changes) {\n const {\n isOpen: changedIsOpen,\n selectedItem: changedSelectedItem,\n } = changes;\n\n if (!changedIsOpen) {\n setDisplayItems(allItems.current);\n }\n\n if (changedIsOpen && changedSelectedItem) {\n setHighlightedIndex(\n displayItems.findIndex(\n i => itemToString(i) === itemToString(changedSelectedItem)\n )\n );\n }\n\n onIsOpenChange &&\n typeof onIsOpenChange === 'function' &&\n onIsOpenChange(changes);\n }\n\n const {\n isOpen,\n getToggleButtonProps,\n getLabelProps,\n getMenuProps,\n getInputProps,\n getComboboxProps,\n highlightedIndex,\n getItemProps,\n reset,\n selectItem,\n selectedItem,\n setInputValue,\n setHighlightedIndex,\n } = useCombobox({\n ...props,\n itemToString,\n items: displayItems,\n onInputValueChange:\n onInputValueChange && typeof onInputValueChange === 'function'\n ? changes => onInputValueChange(changes, setDisplayItems)\n : changes =>\n defaultOnInputValueChange(\n changes,\n allItems,\n itemToString,\n disableCreateItem,\n setDisplayItems,\n setHighlightedIndex,\n onInputChange,\n i18n.combobox.createLabel\n ),\n onIsOpenChange: handleOnIsOpenChange,\n onSelectedItemChange: defaultOnSelectedItemChange,\n stateReducer,\n ...(defaultSelectedItem &&\n getValidItem(defaultSelectedItem, 'defaultSelectedItem')),\n ...(initialSelectedItem &&\n getValidItem(initialSelectedItem, 'initialSelectedItem')),\n ...(passedInSelectedItem &&\n getValidItem(passedInSelectedItem, 'selectedItem')),\n });\n\n const { ClearIndicator } = defaultComponents<T>({\n ...customComponents,\n });\n\n const inputRef = React.useRef<HTMLInputElement>();\n const ref = useForkedRef(innerRef || null, inputRef);\n\n function defaultHandleClearIndicatorClick(event: React.SyntheticEvent) {\n event.stopPropagation();\n\n if (inputRef.current) {\n inputRef.current.focus();\n }\n\n reset();\n }\n\n const clearIndicatorAriaLabel = i18n.combobox.clearIndicatorAriaLabel\n .replace(/\\{labelText\\}/g, labelText)\n .replace(/\\{selectedItem\\}/g, itemToString(selectedItem));\n\n return (\n <SelectContainer\n descriptionId={ariaDescribedBy}\n errorMessage={errorMessage}\n getLabelProps={getLabelProps}\n hasError={hasError}\n helperMessage={helperMessage}\n isLabelVisuallyHidden={isLabelVisuallyHidden}\n isInverse={isInverse}\n labelPosition={labelPosition}\n labelStyle={labelStyle}\n labelText={labelText}\n messageStyle={messageStyle}\n >\n <ComboboxInput\n ariaDescribedBy={ariaDescribedBy}\n customComponents={customComponents}\n disabled={disabled}\n getComboboxProps={getComboboxProps}\n getInputProps={getInputProps}\n getToggleButtonProps={getToggleButtonProps}\n hasError={hasError}\n innerRef={ref}\n inputStyle={inputStyle}\n isInverse={isInverse}\n isLoading={isLoading}\n onInputBlur={onInputBlur}\n onInputFocus={onInputFocus}\n onInputKeyDown={onInputKeyDown}\n onInputKeyPress={onInputKeyPress}\n onInputKeyUp={onInputKeyUp}\n placeholder={placeholder}\n toggleButtonRef={toggleButtonRef}\n >\n {isClearable && selectedItem && (\n <ClearIndicator\n aria-label={clearIndicatorAriaLabel}\n icon={<CloseIcon />}\n onClick={defaultHandleClearIndicatorClick}\n shape={ButtonShape.fill}\n size={ButtonSize.small}\n variant={ButtonVariant.link}\n />\n )}\n </ComboboxInput>\n <ItemsList\n customComponents={customComponents}\n getItemProps={getItemProps}\n getMenuProps={getMenuProps}\n highlightedIndex={highlightedIndex}\n isOpen={isOpen}\n items={displayItems}\n itemToString={itemToString}\n maxHeight={itemListMaxHeight || theme.combobox.menu.maxHeight}\n menuStyle={menuStyle}\n />\n </SelectContainer>\n );\n}\n","import * as React from 'react';\nimport { instanceOfDefaultItemObject } from '../Select';\nimport { useCombobox, useMultipleSelection } from 'downshift';\nimport { CloseIcon } from 'react-magma-icons';\nimport { SelectContainer } from '../Select/SelectContainer';\nimport { ItemsList } from '../Select/ItemsList';\nimport { ComboboxInput } from './ComboboxInput';\nimport { SelectedItemButton, IconWrapper } from '../Select/shared';\nimport { useComboboxItems, defaultOnInputValueChange } from './shared';\n\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport { I18nContext } from '../../i18n';\nimport { MultiComboboxProps } from '.';\n\nexport function MultiCombobox<T>(props: MultiComboboxProps<T>) {\n const [inputValue, setInputValue] = React.useState('');\n const {\n ariaDescribedBy,\n components: customComponents,\n errorMessage,\n defaultItems,\n disableCreateItem,\n hasError,\n helperMessage,\n inputStyle,\n disabled,\n innerRef,\n isLabelVisuallyHidden,\n isLoading,\n isInverse,\n itemListMaxHeight,\n items,\n itemToString,\n labelPosition,\n labelStyle,\n labelText,\n menuStyle,\n messageStyle,\n newItemTransform,\n onInputBlur,\n onInputChange,\n onInputFocus,\n onInputKeyDown,\n onInputKeyPress,\n onInputKeyUp,\n onInputValueChange,\n onIsOpenChange,\n onItemCreated,\n onRemoveSelectedItem,\n placeholder,\n toggleButtonRef,\n } = props;\n\n const theme = React.useContext(ThemeContext);\n const i18n = React.useContext(I18nContext);\n\n const [\n allItems,\n displayItems,\n setDisplayItems,\n updateItemsRef,\n ] = useComboboxItems(defaultItems, items);\n\n function checkSelectedItemValidity(itemToCheck) {\n return (\n allItems.current.findIndex(\n i => itemToString(i) === itemToString(itemToCheck)\n ) !== -1\n );\n }\n\n const {\n getSelectedItemProps,\n getDropdownProps,\n addSelectedItem,\n removeSelectedItem,\n setActiveIndex,\n selectedItems,\n } = useMultipleSelection({\n ...props,\n ...(props.initialSelectedItems && {\n initialSelectedItems: props.initialSelectedItems.filter(\n checkSelectedItemValidity\n ),\n }),\n ...(props.selectedItems && {\n selectedItems: props.selectedItems.filter(checkSelectedItemValidity),\n }),\n });\n\n function isCreatedItem(item) {\n return (\n !(typeof item === 'string') &&\n instanceOfDefaultItemObject(item) &&\n item.react_magma__created_item\n );\n }\n\n function getFilteredItems(unfilteredItems) {\n return unfilteredItems.filter(item => {\n const itemString =\n typeof item === 'object' && item.react_magma__created_item\n ? item.value\n : itemToString(item);\n return (\n (selectedItems.findIndex(\n selectedItem => itemToString(selectedItem) === itemToString(item)\n ) < 0 &&\n itemString.toLowerCase().startsWith(inputValue.toLowerCase())) ||\n isCreatedItem(item)\n );\n });\n }\n\n function defaultNewItemTransform(newItem) {\n return newItem.value;\n }\n\n function defaultOnSelectedItemChange(changes) {\n if (isCreatedItem(changes.selectedItem)) {\n const {\n react_magma__created_item,\n ...createdItem\n } = changes.selectedItem;\n\n const newItem =\n react_magma__created_item &&\n newItemTransform &&\n typeof newItemTransform === 'function'\n ? newItemTransform(createdItem)\n : defaultNewItemTransform(createdItem);\n\n items && onItemCreated && typeof onItemCreated === 'function'\n ? onItemCreated(newItem)\n : updateItemsRef(newItem);\n addSelectedItem(newItem);\n\n if (process.env.NODE_ENV === 'development') {\n if (!items && !disableCreateItem) {\n console.warn(\n 'React Magma Warning: Switching from uncontrolled to controlled items. If allowing new items to be created you should handle the onItemCreated event and control the items list in your code.'\n );\n }\n }\n } else if (changes.selectedItem) {\n addSelectedItem(changes.selectedItem);\n }\n\n selectItem(null);\n setInputValue('');\n }\n\n const {\n stateReducer: passedInStateReducer,\n onStateChange,\n ...comboboxProps\n } = props;\n\n function handleOnIsOpenChange(changes) {\n const { isOpen: changedIsOpen } = changes;\n\n if (!changedIsOpen) {\n setDisplayItems(allItems.current);\n }\n\n onIsOpenChange &&\n typeof onIsOpenChange === 'function' &&\n onIsOpenChange(changes);\n }\n\n function stateReducer(state, actionAndChanges) {\n const { type, changes } = actionAndChanges;\n switch (type) {\n case useCombobox.stateChangeTypes.InputKeyDownEnter: {\n const newSelectedItem = getFilteredItems(displayItems)[\n state.highlightedIndex\n ];\n return {\n ...changes,\n ...(newSelectedItem && {\n selectedItem: newSelectedItem,\n }),\n inputValue: '',\n };\n }\n case useCombobox.stateChangeTypes.ItemClick: {\n return {\n ...changes,\n inputValue: '',\n };\n }\n case useCombobox.stateChangeTypes.InputBlur:\n return {\n ...changes,\n inputValue: '',\n };\n default:\n return changes;\n }\n }\n\n function handleInputChange(changes) {\n setInputValue(changes.inputValue);\n\n onInputChange &&\n typeof onInputChange === 'function' &&\n onInputChange(changes);\n }\n\n const {\n isOpen,\n getToggleButtonProps,\n getLabelProps,\n getMenuProps,\n getInputProps,\n getComboboxProps,\n highlightedIndex,\n getItemProps,\n selectItem,\n setHighlightedIndex,\n } = useCombobox({\n ...comboboxProps,\n itemToString,\n items: getFilteredItems(displayItems),\n onInputValueChange:\n onInputValueChange && typeof onInputValueChange === 'function'\n ? changes => onInputValueChange(changes, setDisplayItems)\n : changes =>\n defaultOnInputValueChange(\n changes,\n allItems,\n itemToString,\n disableCreateItem,\n setDisplayItems,\n setHighlightedIndex,\n handleInputChange,\n i18n.combobox.createLabel\n ),\n onIsOpenChange: handleOnIsOpenChange,\n onSelectedItemChange: defaultOnSelectedItemChange,\n stateReducer,\n });\n\n function handleRemoveSelectedItem(event: React.SyntheticEvent, selectedItem) {\n event.stopPropagation();\n\n onRemoveSelectedItem && typeof onRemoveSelectedItem === 'function'\n ? onRemoveSelectedItem(selectedItem)\n : removeSelectedItem(selectedItem);\n }\n\n function handleInputFocus(event: React.FocusEvent) {\n setActiveIndex(-1);\n\n onInputFocus && typeof onInputFocus === 'function' && onInputFocus(event);\n }\n\n const selectedItemsContent =\n selectedItems && selectedItems.length > 0 ? (\n <>\n {selectedItems.map((multiSelectedItem, index) => (\n <SelectedItemButton\n aria-label={i18n.multiCombobox.selectedItemButtonAriaLabel.replace(\n /\\{selectedItem\\}/g,\n itemToString(multiSelectedItem)\n )}\n key={`selected-item-${index}`}\n {...getSelectedItemProps({\n selectedItem: multiSelectedItem,\n index,\n })}\n onClick={event =>\n handleRemoveSelectedItem(event, multiSelectedItem)\n }\n onFocus={() => setActiveIndex(index)}\n theme={theme}\n >\n {itemToString(multiSelectedItem)}\n <IconWrapper>\n <CloseIcon size={theme.iconSizes.xSmall} />\n </IconWrapper>\n </SelectedItemButton>\n ))}\n </>\n ) : null;\n\n return (\n <SelectContainer\n descriptionId={ariaDescribedBy}\n errorMessage={errorMessage}\n getLabelProps={getLabelProps}\n helperMessage={helperMessage}\n isInverse={isInverse}\n isLabelVisuallyHidden={isLabelVisuallyHidden}\n labelPosition={labelPosition}\n labelStyle={labelStyle}\n labelText={labelText}\n messageStyle={messageStyle}\n >\n <ComboboxInput\n ariaDescribedBy={ariaDescribedBy}\n customComponents={customComponents}\n getComboboxProps={getComboboxProps}\n getInputProps={options => ({\n ...getInputProps({\n ...options,\n ...getDropdownProps({\n onKeyDown: onInputKeyDown,\n preventKeyAction: isOpen,\n ...(innerRef && { ref: innerRef }),\n }),\n }),\n })}\n getToggleButtonProps={getToggleButtonProps}\n inputStyle={inputStyle}\n disabled={disabled}\n isInverse={isInverse}\n isLoading={isLoading}\n hasError={hasError}\n onInputBlur={onInputBlur}\n onInputFocus={handleInputFocus}\n onInputKeyDown={onInputKeyDown}\n onInputKeyPress={onInputKeyPress}\n onInputKeyUp={onInputKeyUp}\n placeholder={placeholder}\n selectedItems={selectedItemsContent}\n toggleButtonRef={toggleButtonRef}\n />\n <ItemsList\n customComponents={customComponents}\n getItemProps={getItemProps}\n getMenuProps={getMenuProps}\n highlightedIndex={highlightedIndex}\n isOpen={isOpen}\n items={getFilteredItems(displayItems)}\n itemToString={itemToString}\n maxHeight={itemListMaxHeight || theme.combobox.menu.maxHeight}\n menuStyle={menuStyle}\n />\n </SelectContainer>\n );\n}\n","import * as React from 'react';\nimport styled from '../../theme/styled';\nimport { convertStyleValueToString } from '../../utils';\n\nexport interface SpacerProps extends React.HTMLAttributes<HTMLSpanElement> {\n /**\n * Determines whether the spacer takes up space horizontally, vertically or both.\n */\n axis?: SpacerAxis;\n /**\n * Height and/or width of the component. If a number is provided, will be set in pixels.\n */\n size: number | string;\n testId?: string;\n}\n\nexport enum SpacerAxis {\n horizontal = 'horizontal',\n vertical = 'vertical',\n both = 'both', // default\n}\n\nfunction getHeight(axis: SpacerAxis, size: number | string) {\n return axis === SpacerAxis.horizontal\n ? '1px'\n : convertStyleValueToString(size);\n}\nfunction getWidth(axis: SpacerAxis, size: number | string) {\n return axis === SpacerAxis.vertical ? '1px' : convertStyleValueToString(size);\n}\n\nconst StyledSpacer = styled.span<SpacerProps>`\n display: ${props =>\n props.axis === SpacerAxis.horizontal ? 'inline-block' : 'block'};\n height: ${props => getHeight(props.axis, props.size)};\n min-height: ${props => getHeight(props.axis, props.size)};\n min-width: ${props => getWidth(props.axis, props.size)};\n width: ${props => getWidth(props.axis, props.size)};\n`;\n\nexport const Spacer = React.forwardRef<HTMLSpanElement, SpacerProps>(\n (props, ref) => {\n const { testId, axis = SpacerAxis.both, ...other } = props;\n\n return (\n <StyledSpacer {...other} axis={axis} data-testid={testId} ref={ref} />\n );\n }\n);\n","import React from 'react';\nimport {\n useCombobox,\n UseComboboxProps,\n UseComboboxState,\n UseMultipleSelectionProps,\n} from 'downshift';\nimport {\n SelectOptions,\n instanceOfDefaultItemObject,\n InternalSelectProps,\n InternalMultiProps,\n} from '../Select';\nimport { InternalCombobox } from './Combobox';\nimport { MultiCombobox } from './MultiCombobox';\nimport { useGenerateId, XOR, Omit } from '../../utils';\nimport { LabelPosition } from '../Label';\nimport { useIsInverse } from '../../inverse';\n\nexport interface ComboboxProps<T extends SelectOptions>\n extends Omit<UseComboboxProps<T>, 'items'>,\n InternalSelectProps<T> {\n /**\n * Id of the element that describes the combobox input\n */\n ariaDescribedBy?: string;\n /**\n * Default selectable options. Allows for uncontrolled component and internal creation of items. Can be an array of strings or objects\n */\n defaultItems?: T[];\n /**\n * If true, the new items cannot be created by typing in the text field\n * @default false\n */\n disableCreateItem?: boolean;\n /**\n * @internal\n */\n hasError?: boolean;\n /**\n * Position of text label relative to form field\n */\n labelPosition?: LabelPosition;\n /**\n * Reference to the input element in the combobox\n */\n innerRef?: React.Ref<HTMLInputElement>;\n /**\n * If true, the loading component is shown\n * @default false\n */\n /**\n * @internal\n */\n isMulti?: false;\n isLoading?: boolean;\n /**\n * Default selectable options. Can be an array of strings or objects\n */\n items?: T[];\n /**\n * Function passed in that transforms a newly created item to whatever format your items are in\n */\n newItemTransform?: (item: { label: string; value: string }) => T;\n /**\n * Event that fires when the input loses focus\n */\n onInputBlur?: (event: React.FocusEvent) => void;\n /**\n * Event that fires when the input's value is changed\n */\n onInputChange?: (changes: Partial<UseComboboxState<T>>) => void;\n /**\n * Event that fires when the input gains focus\n */\n onInputFocus?: (event: React.FocusEvent) => void;\n /**\n * Event that will fire when input receives keypress.\n */\n onInputKeyDown?: (event: React.KeyboardEvent) => void;\n /**\n * Event that will fire when a character is typed in the input\n */\n onInputKeyPress?: (event: React.KeyboardEvent) => void;\n /**\n * Event that will fire when a keypress is released on the input\n */\n onInputKeyUp?: (event: React.KeyboardEvent) => void;\n /**\n * Event that fires when the selected item changes\n */\n onInputValueChange?: (\n changes: Partial<UseComboboxState<T>>,\n updateInputItems?: React.Dispatch<React.SetStateAction<T[]>>\n ) => void;\n /**\n * Event that fires when a new item is created with the create item option is clicked in the item list menu\n */\n onItemCreated?: (newItem: T) => void;\n /**\n * Reference to the toggle button element wrapping the input in the combobox\n */\n toggleButtonRef?: React.Ref<HTMLButtonElement>;\n}\n\nexport interface MultiComboboxProps<T extends SelectOptions>\n extends UseMultipleSelectionProps<T>,\n Omit<ComboboxProps<T>, 'onStateChange' | 'stateReducer' | 'isMulti'>,\n InternalMultiProps<T> {\n /**\n * @internal\n */\n isMulti: true;\n}\n\nexport function instanceOfMultiCombobox<T>(\n object: any\n): object is MultiComboboxProps<T> {\n return 'isMulti' in object;\n}\n\nexport type XORComboboxProps<T> = XOR<ComboboxProps<T>, MultiComboboxProps<T>>;\n\nexport const ComboboxStateChangeTypes = useCombobox.stateChangeTypes;\n\nexport function Combobox<T>(props: XORComboboxProps<T>) {\n const {\n containerStyle,\n errorMessage,\n id: defaultId,\n isMulti,\n labelPosition,\n messageStyle,\n helperMessage,\n testId,\n } = props;\n\n function itemToString(item: T) {\n return item && typeof item === 'string'\n ? item\n : item && instanceOfDefaultItemObject(item)\n ? item.label\n : '';\n }\n\n const hasError = !!errorMessage;\n\n const id = useGenerateId(defaultId);\n const descriptionId = errorMessage || helperMessage ? `${id}__desc` : null;\n\n const isInverse = useIsInverse(props.isInverse);\n\n return (\n <div style={containerStyle} data-testid={testId}>\n {isMulti && instanceOfMultiCombobox<T>(props) ? (\n <MultiCombobox\n ariaDescribedBy={descriptionId}\n errorMessage={errorMessage}\n hasError={hasError}\n helperMessage={helperMessage}\n isInverse={isInverse}\n itemToString={itemToString}\n labelPosition={labelPosition || LabelPosition.top}\n messageStyle={messageStyle}\n {...(props as MultiComboboxProps<T>)}\n />\n ) : (\n <InternalCombobox\n ariaDescribedBy={descriptionId}\n errorMessage={errorMessage}\n hasError={hasError}\n helperMessage={helperMessage}\n isInverse={isInverse}\n itemToString={itemToString}\n labelPosition={labelPosition || LabelPosition.top}\n messageStyle={messageStyle}\n {...(props as ComboboxProps<T>)}\n />\n )}\n </div>\n );\n}\n","import * as React from 'react';\nimport styled from '../../theme/styled';\nimport { ButtonColor, ButtonVariant } from '../Button';\nimport { Hyperlink, HyperlinkProps } from '../Hyperlink';\nimport { I18nContext } from '../../i18n';\n\nexport const TARGET_ID = 'reactMagmaMainContent';\n\nexport interface SkipLinkProps extends HyperlinkProps {\n /**\n * The text in the skip link\n * @default \"Skip Navigation\"\n */\n buttonText?: string;\n /**\n * Number of pixels from the left of the screen for the skip link to be positioned\n * @default 10\n */\n positionLeft?: number;\n /**\n * Number of pixels from the top of the screen for the skip link to be positioned\n * @default 10\n */\n positionTop?: number;\n testId?: string;\n}\n\nconst handleClick = e => {\n e.preventDefault();\n\n const targetAnchor = document.getElementById(TARGET_ID);\n\n if (!targetAnchor) {\n return;\n }\n\n const targetHeading = targetAnchor.getElementsByTagName('h1')[0];\n\n if (targetHeading) {\n targetHeading.setAttribute('tabIndex', '-1');\n targetHeading.focus();\n return;\n }\n targetAnchor.focus();\n};\n\nconst StyledSkipLink = styled(Hyperlink)<{\n positionLeft: number;\n positionTop: number;\n}>`\n left: -9999px;\n position: fixed;\n top: -9999px;\n\n &:focus {\n left: ${props => props.positionLeft}px;\n top: ${props => props.positionTop}px;\n z-index: 99999;\n }\n }\n`;\n\nexport const SkipLink: React.FunctionComponent<SkipLinkProps> = props => {\n const {\n buttonText,\n color,\n positionLeft,\n positionTop,\n testId,\n variant,\n ...other\n } = props;\n const i18n = React.useContext(I18nContext);\n\n return (\n <StyledSkipLink\n {...other}\n color={color ? color : ButtonColor.primary}\n testId={testId}\n onClick={e => {\n handleClick(e);\n }}\n positionLeft={positionLeft ? positionLeft : 10}\n positionTop={positionTop ? positionTop : 10}\n styledAs=\"Button\"\n to={`#${TARGET_ID}`}\n variant={variant ? variant : ButtonVariant.solid}\n >\n {buttonText ? buttonText : i18n.skipLink.buttonText}\n </StyledSkipLink>\n );\n};\n","import * as React from 'react';\nimport styled from '../../theme/styled';\nimport { css } from '@emotion/core';\n\nimport { CancelIcon, IconProps } from 'react-magma-icons';\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport { ThemeInterface } from '../../theme/magma';\nimport { useIsInverse } from '../../inverse';\nimport { Omit, XOR, getNodeText } from '../../utils';\nimport { I18nContext } from '../../i18n';\n\nexport enum TagColor {\n danger = 'danger',\n primary = 'primary',\n lowContrast = 'lowContrast',\n highContrast = 'highContrast',\n success = 'success',\n}\n\nexport enum TagSize {\n medium = 'medium',\n small = 'small',\n}\n\n/**\n * @children required\n */\n\nexport interface BaseTagProps\n extends Omit<React.HTMLAttributes<HTMLButtonElement>, 'onClick'> {\n /**\n * Color changes between 'primary', 'low contrast', and 'high contrast' style variants between each Tag.\n */\n color?: TagColor;\n\n /**\n * Size toggles between a default, and a small size Tag.\n */\n size?: TagSize;\n\n /**\n * Gets the active Tag label for use with the aria-label attribute inline for accessibility.\n */\n labelText?: React.ReactNode;\n\n /**\n * Disabled Tag state.\n */\n disabled?: boolean;\n\n testId?: string;\n\n /**\n * Allows passing a Magma icon to the Tag.\n */\n icon?: React.ReactElement<IconProps>;\n\n /**\n * Passes a clickable state to the Tag.\n */\n isClickable?: boolean;\n\n /**\n * Allows for Inverse styling of each Tag.\n */\n isInverse?: boolean;\n\n /**\n * @internal\n */\n theme?: ThemeInterface;\n}\n\nexport interface DeletableTagProps extends BaseTagProps {\n onDelete: () => void;\n}\n\nexport interface ClickableTagProps extends BaseTagProps {\n onClick?: () => void;\n}\n\nexport type TagProps = XOR<DeletableTagProps, ClickableTagProps>;\n\nfunction buildBoxShadow(props) {\n if (props.color === 'lowContrast') {\n if (props.isInverse) {\n if (props.disabled) {\n return `0 0 0 1px ${props.theme.colors.neutral08}40`;\n }\n return `0 0 0 1px ${props.theme.colors.neutral08}80`;\n }\n if (props.disabled) {\n return `0 0 0 1px ${props.theme.colors.neutral06}`;\n }\n return `inset 0 0 0 1px ${props.theme.colors.neutral05}`;\n }\n}\n\nfunction buildButtonBackground(props) {\n if (props.isInverse) {\n if (props.disabled) {\n // Disabled inverse state background colors\n switch (props.color) {\n case 'primary':\n return `${props.theme.colors.neutral06}`;\n case 'highContrast':\n return `${props.theme.colors.neutral06}`;\n case 'lowContrast':\n return `none`;\n default:\n return `${props.theme.colors.neutral06}`;\n }\n }\n // Inverse background colors\n switch (props.color) {\n case 'danger':\n return `${props.theme.colors.dangerInverse}`;\n case 'success':\n return `${props.theme.colors.successInverse}`;\n case 'primary':\n return `${props.theme.colors.primaryInverse}`;\n case 'lowContrast':\n return `none;`;\n case 'highContrast':\n return `${props.theme.colors.neutral08}`;\n default:\n return `${props.theme.colors.neutral03}`;\n }\n } else if (props.disabled && !props.isInverse) {\n // Disabled state background colors\n switch (props.color) {\n case 'primary':\n return `${props.theme.colors.neutral06}`;\n case 'highContrast':\n return `${props.theme.colors.neutral06}`;\n case 'lowContrast':\n return `${props.theme.colors.neutral08}`;\n default:\n return `${props.theme.colors.neutral06}`;\n }\n }\n // Default state background colors\n switch (props.color) {\n case 'danger':\n return `${props.theme.colors.danger}`;\n case 'success':\n return `${props.theme.colors.success}`;\n case 'primary':\n return `${props.theme.colors.primary}`;\n case 'lowContrast':\n return `${props.theme.colors.neutral08}`;\n case 'highContrast':\n return `${props.theme.colors.neutral}`;\n default:\n return `${props.theme.colors.neutral06}`;\n }\n}\n\nfunction buildButtonTextColor(props) {\n if (props.isInverse) {\n if (props.disabled) {\n // Disabled inverse state text colors\n switch (props.color) {\n case 'primary':\n return `${props.theme.colors.neutral03}99`;\n case 'highContrast':\n return `${props.theme.colors.neutral03}99`;\n case 'lowContrast':\n return `${props.theme.colors.neutral08}40`;\n default:\n return `${props.theme.colors.neutral03}99`;\n }\n }\n // Inverse text colors\n switch (props.color) {\n case 'danger':\n return `${props.theme.colors.neutral}`;\n case 'success':\n return `${props.theme.colors.neutral}`;\n case 'primary':\n return `${props.theme.colors.neutral}`;\n case 'lowContrast':\n return `${props.theme.colors.neutral08}`;\n case 'highContrast':\n return `${props.theme.colors.neutral}`;\n default:\n return `${props.theme.colors.neutral08}`;\n }\n } else if (props.disabled && !props.isInverse) {\n // Disabled state text colors\n switch (props.color) {\n case 'primary':\n return `${props.theme.colors.neutral03}99`;\n case 'highContrast':\n return `${props.theme.colors.neutral03}99`;\n case 'lowContrast':\n return `${props.theme.colors.neutral03}99`;\n default:\n return `${props.theme.colors.neutral03}99`;\n }\n }\n // Default state text colors\n switch (props.color) {\n case 'danger':\n return `${props.theme.colors.neutral08}`;\n case 'success':\n return `${props.theme.colors.neutral08}`;\n case 'primary':\n return `${props.theme.colors.neutral08}`;\n case 'highContrast':\n return `${props.theme.colors.neutral08}`;\n default:\n return `${props.theme.colors.neutral}`;\n }\n}\n\nfunction buildSvgOpacity(props) {\n if (props.onClick || props.onDelete) {\n if (props.disabled) {\n return '60%';\n }\n return '75%';\n }\n if (props.color === 'lowContrast' && props.disabled) {\n return '25%';\n } else if (props.disabled) {\n return '60%';\n }\n return '1';\n}\n\nfunction buildTagPadding(props) {\n if (props.icon) {\n switch (props.size) {\n case 'small':\n return `0 ${props.theme.spaceScale.spacing02}`;\n default:\n return `${props.theme.spaceScale.spacing02} 6px`;\n }\n }\n switch (props.size) {\n case 'small':\n return `0 ${props.theme.spaceScale.spacing02}`;\n default:\n return `${props.theme.spaceScale.spacing02} 6px`;\n }\n}\n\nfunction buildLabelPadding(props) {\n if (props.icon) {\n switch (props.size) {\n case 'small':\n return `0 ${props.theme.spaceScale.spacing02}`;\n default:\n return `0 ${props.theme.spaceScale.spacing03}`;\n }\n }\n switch (props.size) {\n case 'small':\n return `0 ${props.theme.spaceScale.spacing02}`;\n default:\n return `0 ${props.theme.spaceScale.spacing03}`;\n }\n}\n\nconst TagStyling = props => css`\n border: ${props.theme.tag.border};\n border-radius: ${props.theme.spaceScale.spacing05};\n background: ${buildButtonBackground(props)};\n color: ${buildButtonTextColor(props)};\n box-shadow: ${buildBoxShadow(props)};\n display: ${props.theme.tag.display};\n align-items: ${props.theme.tag.alignItems};\n justify-content: ${props.theme.tag.justifyContent};\n font-size: ${props.size === 'small'\n ? `${props.theme.typeScale.size01.fontSize}`\n : `${props.theme.typeScale.size02.fontSize}`};\n font-weight: ${props.size === 'small' ? `600` : `inherit`};\n letter-spacing: ${props.size === 'small'\n ? `${props.theme.typeScale.size01.letterSpacing}`\n : `${props.theme.typeScale.size02.letterSpacing}`};\n min-width: ${props.size === 'small'\n ? props.theme.spaceScale.spacing10\n : props.theme.spaceScale.spacing12};\n padding: ${buildTagPadding(props)};\n svg:first-of-type {\n height: ${props.size === 'small'\n ? `${props.theme.iconSizes.xSmall}px`\n : `${props.theme.iconSizes.small}px`};\n opacity: ${props.disabled ? '60%' : 'inherit'};\n width: ${props.size === 'small'\n ? `${props.theme.iconSizes.xSmall}px`\n : `${props.theme.iconSizes.small}px`};\n }\n svg:last-child {\n opacity: ${buildSvgOpacity(props)};\n width: ${props.size === 'small'\n ? `${props.theme.iconSizes.xSmall}px`\n : `${props.theme.iconSizes.small}px`};\n }\n &:hover {\n svg {\n opacity: ${props.disabled ? '60%' : '1'};\n }\n }\n`;\n\nconst StyledButton = styled.button<{\n disabled?: boolean;\n isClickable?: boolean;\n isInverse?: boolean;\n size: string;\n}>`\n ${TagStyling};\n cursor: ${props => (props.disabled ? 'not-allowed' : 'pointer')};\n`;\n\nconst StyledSpan = styled.span<{\n disabled?: boolean;\n isInverse?: boolean;\n size: string;\n}>`\n ${TagStyling};\n cursor: ${props => (props.disabled ? 'not-allowed' : 'inherit')};\n`;\n\nconst LabelWrap = styled.span<{\n size: string;\n icon?: any;\n}>`\n padding: ${buildLabelPadding};\n`;\n\nfunction getStyledTag(isClickable: boolean) {\n return isClickable ? StyledButton : StyledSpan;\n}\n\nexport const Tag = React.forwardRef<HTMLButtonElement, TagProps>(\n (props, ref) => {\n const {\n children,\n color,\n labelText = children,\n onClick,\n onDelete,\n isInverse: isInverseProp,\n size = TagSize.medium,\n testId,\n ...rest\n } = props;\n\n const theme = React.useContext(ThemeContext);\n\n const isInverse = useIsInverse(isInverseProp);\n\n const i18n = React.useContext(I18nContext);\n\n const deleteAriaLabel = i18n.tag.deleteAriaLabel.replace(\n /\\{labelText\\}/g,\n getNodeText(labelText)\n );\n\n const { icon } = props;\n\n const StyledTag = getStyledTag(Boolean(onClick || onDelete));\n\n function handleClick() {\n if (onClick && typeof onClick === 'function') {\n onClick();\n } else if (onDelete && typeof onDelete === 'function') {\n onDelete();\n }\n }\n\n return (\n <StyledTag\n color={color}\n icon={icon}\n onClick={handleClick}\n isInverse={isInverse}\n ref={ref}\n data-testid={props.testId}\n size={size}\n theme={theme}\n {...rest}\n >\n {icon}\n <LabelWrap size={size} {...rest} theme={theme}>\n {children}\n </LabelWrap>\n {onDelete && (\n <CancelIcon\n aria-label={deleteAriaLabel}\n size={theme.iconSizes.small}\n />\n )}\n </StyledTag>\n );\n }\n);\n","import * as React from 'react';\nimport { HiddenStyles } from '../../utils/UtilityStyles';\nimport { CheckIcon } from 'react-magma-icons';\nimport { FormGroupContext } from '../FormGroup';\nimport { InputMessage } from '../Input/InputMessage';\nimport { StyledLabel } from '../SelectionControls/StyledLabel';\nimport { StyledContainer } from '../SelectionControls/StyledContainer';\nimport { css } from '@emotion/core';\n// Using the base `styled` from `emotion` until import mapping is fixed: https://github.com/emotion-js/emotion/pull/1220\n// import styled from '../../theme/styled';\nimport styled from '@emotion/styled';\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport { useGenerateId } from '../../utils';\nimport { useIsInverse } from '../../inverse';\n\nexport enum ToggleTextPosition {\n left = 'left', // default\n right = 'right',\n}\n\nexport interface ToggleProps\n extends React.InputHTMLAttributes<HTMLInputElement> {\n /**\n * If true, element is checked (i.e. selected)\n * @default false\n */\n checked?: boolean;\n /**\n * Style properties for the component container element\n */\n containerStyle?: React.CSSProperties;\n /**\n * If true, checkbox is checked on first render\n */\n defaultChecked?: boolean;\n /**\n * Content of the error message for toggle. If a value is provided, the component will be styled as an error state and the error message will display.\n */\n errorMessage?: React.ReactNode;\n /**\n * @internal\n */\n hasError?: boolean;\n isInverse?: boolean;\n /**\n * If true, label text will be hidden visually, but will still be read by assistive technology\n * @default false\n */\n isTextVisuallyHidden?: boolean;\n /**\n * Style properties for the label element\n */\n labelStyle?: React.CSSProperties;\n /**\n * Content for label; can be a node or a string\n */\n labelText: React.ReactNode;\n testId?: string;\n /**\n * Whether the label appears to the left of the right of the toggle switch\n * @default ToggleTextPosition.left\n */\n textPosition?: ToggleTextPosition;\n /**\n * @internal\n */\n theme?: any;\n /**\n * Style properties for the part of the component that slides back and forth on the track\n */\n thumbStyle?: React.CSSProperties;\n /**\n * Style properties for track on which the toggle thumb slides\n */\n trackStyle?: React.CSSProperties;\n}\n\nconst HiddenLabelText = styled.span`\n ${HiddenStyles};\n`;\n\nconst HiddenInput = styled.input`\n ${HiddenStyles};\n`;\n\nconst Track = styled.span<{\n isChecked?: boolean;\n disabled?: boolean;\n hasError?: boolean;\n isInverse?: boolean;\n theme?: any;\n}>`\n background: ${props => props.theme.colors.neutral04};\n border: 2px solid;\n border-color: ${props =>\n props.hasError ? props.theme.colors.danger : props.theme.colors.neutral04};\n border-radius: 12px;\n box-shadow: ${props =>\n props.isInverse && props.hasError\n ? `0 0 0 1px ${props.theme.colors.neutral08}`\n : '0 0 0'};\n cursor: pointer;\n height: 24px;\n position: relative;\n width: 48px;\n\n ${props =>\n props.isChecked &&\n css`\n background: ${props.theme.colors.success02};\n border-color: ${props.hasError\n ? props.theme.colors.danger\n : props.theme.colors.success02};\n `}\n\n ${props =>\n props.disabled &&\n css`\n background: ${props.theme.colors.neutral06};\n border-color: ${props.theme.colors.neutral06};\n cursor: not-allowed;\n `}\n\n ${HiddenInput}:focus + label & {\n outline: 2px dotted\n ${props =>\n props.isInverse\n ? props.theme.colors.focusInverse\n : props.theme.colors.focus};\n outline-offset: 3px;\n }\n\n &:before {\n // active state\n background: ${props => props.theme.colors.neutral};\n border-radius: 50%;\n content: '';\n display: block;\n height: 40px;\n left: -12px;\n opacity: 0;\n margin-top: -22px;\n padding: 50%;\n position: absolute;\n top: 50%;\n transform: scale(1);\n transition: opacity 1s, transform 0.25s;\n width: 40px;\n\n ${props =>\n props.isChecked &&\n css`\n background: ${props.theme.colors.success02};\n left: 12px;\n `}\n }\n\n ${HiddenInput}:not(:disabled):active + label & {\n &:before {\n opacity: 0.4;\n transform: scale(0);\n transition: transform 0s;\n }\n }\n`;\n\nconst Thumb = styled.span<{\n isChecked?: boolean;\n disabled?: boolean;\n theme?: any;\n}>`\n background: ${props => props.theme.colors.neutral08};\n border-radius: 100%;\n height: 20px;\n left: 0;\n margin-top: -10px;\n position: absolute;\n top: 50%;\n transition: left 0.25s;\n width: 20px;\n\n ${props =>\n props.isChecked &&\n css`\n left: 24px;\n `}\n`;\n\nconst IconContainer = styled.span<{ disabled?: boolean; theme?: any }>`\n color: ${props =>\n props.disabled\n ? props.theme.colors.neutral05\n : props.theme.colors.neutral08};\n left: ${props => props.theme.spaceScale.spacing02};\n position: absolute;\n top: ${props => props.theme.spaceScale.spacing01};\n\n svg {\n display: block;\n }\n`;\n\nconst SpanTextLeft = styled.span`\n padding-right: 10px;\n`;\n\nconst SpanTextRight = styled.span`\n padding-left: 10px;\n`;\n\nconst renderLabelText = (\n isTextVisuallyHidden: boolean,\n labelText: React.ReactNode,\n textPosition: ToggleTextPosition,\n labelStyle: React.CSSProperties\n) => {\n if (isTextVisuallyHidden) {\n return <HiddenLabelText>{labelText}</HiddenLabelText>;\n }\n\n return textPosition === ToggleTextPosition.left ? (\n <SpanTextLeft style={labelStyle}>{labelText}</SpanTextLeft>\n ) : (\n <SpanTextRight style={labelStyle}>{labelText}</SpanTextRight>\n );\n};\n\nexport const Toggle = React.forwardRef<HTMLInputElement, ToggleProps>(\n (props, ref) => {\n const {\n containerStyle,\n checked,\n defaultChecked,\n disabled,\n errorMessage,\n id: defaultId,\n isTextVisuallyHidden,\n labelStyle,\n labelText,\n onChange,\n textPosition,\n testId,\n trackStyle,\n thumbStyle,\n ...other\n } = props;\n const [isChecked, updateIsChecked] = React.useState(\n Boolean(defaultChecked) || Boolean(checked)\n );\n\n const id = useGenerateId(defaultId);\n const isControlled = typeof checked === 'boolean' ? true : false;\n\n React.useEffect(() => {\n if (typeof checked === 'boolean') {\n updateIsChecked(checked);\n }\n }, [checked]);\n\n function handleChange(event: React.ChangeEvent<HTMLInputElement>) {\n const { checked: targetChecked } = event.target;\n\n onChange && typeof onChange === 'function' && onChange(event);\n\n if (!isControlled) {\n updateIsChecked(targetChecked);\n }\n }\n\n const theme = React.useContext(ThemeContext);\n const context = React.useContext(FormGroupContext);\n\n const descriptionId = errorMessage ? `${id}__desc` : null;\n const groupDescriptionId = context.descriptionId;\n\n const describedBy =\n descriptionId && groupDescriptionId\n ? `${groupDescriptionId} ${descriptionId}`\n : descriptionId\n ? descriptionId\n : groupDescriptionId\n ? groupDescriptionId\n : null;\n\n const hasError = context.hasError || !!errorMessage;\n\n const isInverse = useIsInverse(props.isInverse);\n\n return (\n <>\n <StyledContainer>\n <HiddenInput\n {...other}\n aria-checked={isChecked}\n aria-describedby={describedBy}\n id={id}\n data-testid={testId}\n disabled={disabled}\n checked={isChecked}\n type=\"checkbox\"\n onChange={handleChange}\n ref={ref}\n role=\"switch\"\n />\n <StyledLabel\n htmlFor={id}\n isInverse={isInverse}\n style={containerStyle}\n >\n {textPosition !== ToggleTextPosition.right &&\n renderLabelText(\n isTextVisuallyHidden,\n labelText,\n ToggleTextPosition.left,\n labelStyle\n )}\n <Track\n isChecked={isChecked}\n data-testid=\"toggle-track\"\n disabled={disabled}\n hasError={hasError}\n isInverse={isInverse}\n style={trackStyle}\n theme={theme}\n >\n <IconContainer disabled={disabled} theme={theme}>\n <CheckIcon size={theme.iconSizes.xSmall} />\n </IconContainer>\n <Thumb\n isChecked={isChecked}\n disabled={disabled}\n style={thumbStyle}\n theme={theme}\n />\n </Track>\n {textPosition === ToggleTextPosition.right &&\n renderLabelText(\n isTextVisuallyHidden,\n labelText,\n ToggleTextPosition.right,\n labelStyle\n )}\n </StyledLabel>\n </StyledContainer>\n {!!errorMessage && (\n <InputMessage id={descriptionId} hasError isInverse={isInverse}>\n {errorMessage}\n </InputMessage>\n )}\n </>\n );\n }\n);\n","import * as React from 'react';\n\nexport interface ToastsContainerProps\n extends React.HTMLAttributes<HTMLDivElement> {\n /**\n * Number of additional pixels from bottom of screen\n * @default 0\n */\n bottomOffset?: number;\n /**\n * @internal\n */\n toastsArray?: any;\n testId?: string;\n}\n\nexport interface ToastsContextInterface {\n bottomOffset?: number;\n toastsArray?: any;\n}\n\nexport const ToastsContext = React.createContext<ToastsContextInterface>({\n toastsArray: { current: [] },\n bottomOffset: 0,\n});\n\nexport const ToastsContainer = React.forwardRef<\n HTMLDivElement,\n ToastsContainerProps\n>((props, ref) => {\n const { bottomOffset, children, testId } = props;\n const toastsArray = React.useRef([]);\n\n return (\n <ToastsContext.Provider value={{ bottomOffset, toastsArray }}>\n <div ref={ref} data-testid={testId}>\n {children}\n </div>\n </ToastsContext.Provider>\n );\n});\n","import * as React from 'react';\nimport styled from '../../theme/styled';\nimport { AlertBase, AlertBaseProps, transitionDuration } from '../AlertBase';\nimport { getTrapElements } from '../../utils';\nimport { useGenerateId } from '../../utils';\nimport { ToastsContext } from './ToastsContainer';\n\n/**\n * @children required\n */\nexport interface ToastProps extends AlertBaseProps {\n /**\n * CSS properties for the alert component within the toast container\n */\n alertStyle?: React.CSSProperties;\n /**\n * CSS properties for the component container\n */\n containerStyle?: React.CSSProperties;\n /**\n * If true, the component will persist until dismissed by the user\n * @default false\n */\n disableAutoDismiss?: boolean;\n /**\n * Number of milliseconds the toast displays before it closes\n * @default 5000\n */\n toastDuration?: number;\n /**\n * Action that fires when the close button is clicked (required when dismissible is true)\n */\n onDismiss: () => void;\n /**\n * Action that fires when the mouse enters the component\n */\n onMouseEnter?: (event: React.SyntheticEvent) => void;\n /**\n * Action that fires when the mouse leaves the component\n */\n onMouseLeave?: (event: React.SyntheticEvent) => void;\n}\n\nconst ToastWrapper = styled.div<{\n bottomOffsetForContainer?: number;\n bottomOffsetForToast?: number;\n}>`\n bottom: ${props => props.bottomOffsetForToast + 20}px;\n display: flex;\n left: 20px;\n justify-content: flex-start;\n max-width: 600px;\n min-width: 320px;\n position: fixed;\n transform: translateY(${props => 0 - props.bottomOffsetForContainer}px);\n transition: bottom 0.3s;\n z-index: 999;\n\n @media (max-width: 600px) {\n bottom: ${props => props.bottomOffsetForToast + 10}px;\n left: 10px;\n right: 10px;\n }\n`;\n\nconst DEFAULT_TOAST_DURATION = 5000;\nconst TOAST_HEIGHT = 65;\n\nexport const Toast = React.forwardRef<HTMLDivElement, ToastProps>(\n (props, ref) => {\n const timerAutoHide = React.useRef<any>();\n const [isDismissed, setIsDismissed] = React.useState<boolean>(false);\n const [isPaused, setIsPaused] = React.useState<boolean>(false);\n const [timerTimeRemaining, setTimerTimeRemaining] =\n React.useState<number>();\n\n const {\n alertStyle,\n id: defaultId,\n testId,\n variant,\n disableAutoDismiss,\n children,\n containerStyle,\n toastDuration,\n ...other\n } = props;\n\n const id = useGenerateId(defaultId);\n\n const lastFocus = React.useRef<any>();\n\n const { bottomOffset, toastsArray } = React.useContext(ToastsContext);\n\n const timerStartTime = Date.now();\n\n const containerElement = React.useRef<any>();\n\n function dismissToast() {\n setIsDismissed(true);\n\n setTimeout(() => {\n if (toastsArray.current) {\n toastsArray.current = toastsArray.current.filter(\n toastId => toastId !== containerElement.current\n );\n }\n }, 0);\n }\n\n function clearTimeoutAndDismiss() {\n clearTimeout(timerAutoHide.current);\n\n dismissToast();\n\n if (lastFocus.current) {\n lastFocus.current.focus();\n }\n }\n\n function setAutoHideTimer(duration = DEFAULT_TOAST_DURATION) {\n clearTimeout(timerAutoHide.current);\n const totalDuration = duration + transitionDuration;\n\n timerAutoHide.current = setTimeout(() => {\n dismissToast();\n }, totalDuration);\n }\n\n function handlePause() {\n const duration = timerTimeRemaining\n ? timerTimeRemaining\n : toastDuration\n ? toastDuration\n : DEFAULT_TOAST_DURATION;\n const timeRemaining = duration - (Date.now() - timerStartTime);\n\n clearTimeout(timerAutoHide.current);\n setTimerTimeRemaining(timeRemaining);\n\n setIsPaused(true);\n }\n\n function handleResume() {\n setAutoHideTimer(timerTimeRemaining);\n setIsPaused(false);\n }\n\n function handleMouseEnter(event: React.SyntheticEvent) {\n props.onMouseEnter &&\n typeof props.onMouseEnter === 'function' &&\n props.onMouseEnter(event);\n\n if (!props.disableAutoDismiss) {\n handlePause();\n }\n }\n\n function handleMouseLeave(event: React.SyntheticEvent) {\n props.onMouseLeave &&\n typeof props.onMouseLeave === 'function' &&\n props.onMouseLeave(event);\n\n if (!props.disableAutoDismiss) {\n handleResume();\n }\n }\n\n function calculateAndSetBottomOffsetForToast() {\n updateBottomOffsetForToast(\n typeof toastsArray.current[0] === 'undefined'\n ? 0\n : toastsArray.current.indexOf(containerElement.current) * TOAST_HEIGHT\n );\n }\n\n const [bottomOffsetForToast, updateBottomOffsetForToast] =\n React.useState(0);\n\n React.useEffect(() => {\n lastFocus.current = document.activeElement;\n\n if (!props.disableAutoDismiss) {\n setAutoHideTimer(props.toastDuration);\n }\n\n return () => {\n clearTimeout(timerAutoHide.current);\n };\n }, []);\n\n React.useEffect(() => {\n if (!disableAutoDismiss) {\n const focusableElements = getTrapElements(containerElement);\n focusableElements.forEach(element => {\n element.addEventListener('focus', handlePause);\n element.addEventListener('blur', handleResume);\n });\n }\n }, []);\n\n React.useEffect(() => {\n if (toastsArray) {\n toastsArray.current = toastsArray.current.includes(\n containerElement.current\n )\n ? toastsArray.current\n : toastsArray.current.concat([containerElement.current]);\n\n calculateAndSetBottomOffsetForToast();\n }\n }, []);\n\n React.useEffect(() => {\n calculateAndSetBottomOffsetForToast();\n }, [toastsArray.current]);\n\n return (\n <ToastWrapper\n bottomOffsetForToast={bottomOffsetForToast}\n bottomOffsetForContainer={bottomOffset}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n ref={containerElement}\n style={containerStyle}\n data-testid={testId}\n >\n <AlertBase\n {...other}\n forceDismiss={clearTimeoutAndDismiss}\n hasTimerRing={!disableAutoDismiss}\n id={id}\n isDismissible\n isDismissed={isDismissed}\n isPaused={isPaused}\n isToast\n onDismiss={props.onDismiss}\n ref={ref}\n style={{ ...alertStyle }}\n toastDuration={toastDuration ? toastDuration : DEFAULT_TOAST_DURATION}\n variant={variant}\n >\n {children}\n </AlertBase>\n </ToastWrapper>\n );\n }\n);\n","import * as React from 'react';\nimport { useDescendants } from '../../hooks/useDescendants';\n\nexport enum AccordionIconPosition {\n left = 'left',\n none = 'none',\n right = 'right', // default\n}\n\nexport interface UseAccordionProps {\n /**\n * Index of the accordion panel expanded by default. If multiple panels are allowed, takes an array.\n * @default null\n */\n defaultIndex?: number[] | number;\n /**\n * Position of the chevron icon. If 'none', the icon will not render at all.\n * @default AccordionIconPosition.right\n */\n iconPosition?: AccordionIconPosition;\n index?: number[] | number;\n isInverse?: boolean;\n /**\n * If true, multiple accordion items may be expanded at once\n * @default true\n */\n isMulti?: boolean;\n /**\n * Event that fires when an accordion button is clicked\n */\n onExpandedChange?: (event: any) => void;\n testId?: string;\n}\n\ninterface AccordionContextInterface {\n buttonRefArray?: React.MutableRefObject<React.MutableRefObject<Element>[]>;\n expandedIndex?: number[] | number;\n iconPosition?: AccordionIconPosition;\n isControlled?: boolean;\n isMulti?: boolean;\n onExpandedChange?: any;\n setExpandedIndex?: any;\n registerAccordionButton: (\n itemRefArray: React.MutableRefObject<React.MutableRefObject<Element>[]>,\n itemRef: React.MutableRefObject<Element>\n ) => void;\n}\n\nexport const AccordionContext = React.createContext<AccordionContextInterface>({\n isControlled: false,\n iconPosition: AccordionIconPosition.right,\n isMulti: false,\n registerAccordionButton: (elements, element) => {},\n});\n\nexport function useAccordion(props: UseAccordionProps) {\n const {\n isMulti = true,\n defaultIndex = isMulti ? [] : null,\n index,\n iconPosition = AccordionIconPosition.right,\n onExpandedChange,\n } = props;\n\n const isControlled = typeof index !== 'undefined';\n\n const indexProp = isControlled ? index : defaultIndex;\n\n const [expandedIndex, setExpandedIndex] = React.useState(indexProp);\n\n React.useEffect(() => {\n if (isControlled) {\n setExpandedIndex(index);\n }\n }, [index]);\n\n const [buttonRefArray, registerAccordionButton] = useDescendants();\n\n const contextValue = {\n buttonRefArray,\n expandedIndex,\n iconPosition,\n isControlled,\n isMulti,\n onExpandedChange,\n registerAccordionButton,\n setExpandedIndex,\n };\n\n return {\n contextValue,\n };\n}\n\nexport type UseAccordionReturn = ReturnType<typeof useAccordion>;\n","import * as React from 'react';\nimport styled from '../../theme/styled';\nimport {\n inputBaseStyles,\n InputBaseStylesProps,\n InputWrapperStylesProps,\n inputWrapperStyles,\n} from '../InputBase';\nimport {\n FormFieldContainer,\n FormFieldContainerBaseProps,\n} from '../FormFieldContainer';\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport { useGenerateId, Omit } from '../../utils';\nimport { useIsInverse } from '../../inverse';\n\nexport interface TextareaProps\n extends Omit<FormFieldContainerBaseProps, 'inputSize' | 'fieldId'>,\n React.TextareaHTMLAttributes<HTMLTextAreaElement> {\n /**\n * Style properties for the component container element\n */\n containerStyle?: React.CSSProperties;\n isInverse?: boolean;\n testId?: string;\n /**\n * Style properties for the textarea element\n */\n textareaStyle?: React.CSSProperties;\n /**\n * Value for the textarea\n */\n value?: string | ReadonlyArray<string> | number;\n}\n\nconst StyledTextArea = styled.textarea<\n InputWrapperStylesProps & InputBaseStylesProps\n>`\n ${inputBaseStyles};\n ${inputWrapperStyles};\n height: 4.5em;\n padding: ${props =>\n `${props.theme.spaceScale.spacing02} ${props.theme.spaceScale.spacing03}`};\n`;\n\nexport const Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(\n (props, ref) => {\n const {\n containerStyle,\n errorMessage,\n helperMessage,\n id: defaultId,\n isLabelVisuallyHidden,\n labelStyle,\n labelText,\n messageStyle,\n testId,\n textareaStyle,\n ...other\n } = props;\n\n const theme = React.useContext(ThemeContext);\n\n const id = useGenerateId(defaultId);\n const descriptionId = errorMessage || helperMessage ? `${id}__desc` : null;\n\n const [value, setValue] = React.useState<\n string | ReadonlyArray<string> | number\n >(props.defaultValue || props.value || '');\n\n React.useEffect(() => {\n setValue(props.value);\n }, [props.value]);\n function handleChange(event: React.ChangeEvent<HTMLTextAreaElement>) {\n props.onChange &&\n typeof props.onChange === 'function' &&\n props.onChange(event);\n\n setValue(event.target.value);\n }\n\n const isInverse = useIsInverse(props.isInverse);\n\n return (\n <FormFieldContainer\n containerStyle={containerStyle}\n errorMessage={errorMessage}\n fieldId={id}\n helperMessage={helperMessage}\n isLabelVisuallyHidden={isLabelVisuallyHidden}\n isInverse={isInverse}\n labelStyle={labelStyle}\n labelText={labelText}\n >\n <StyledTextArea\n {...other}\n aria-describedby={\n descriptionId ? descriptionId : props['aria-describedby']\n }\n aria-invalid={!!errorMessage}\n data-testid={testId}\n hasError={!!errorMessage}\n id={id}\n isInverse={isInverse}\n onChange={handleChange}\n ref={ref}\n style={textareaStyle}\n theme={theme}\n value={value}\n width=\"100%\"\n />\n </FormFieldContainer>\n );\n }\n);\n","import * as React from 'react';\nimport styled from '@emotion/styled';\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport { ThemeInterface } from '../../theme/magma';\n\ninterface AmPmToggleProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n children: string;\n}\n\nconst StyledAmPmToggle = styled.button<{ theme: ThemeInterface }>`\n background: none;\n border: 0;\n border-radius: 3px;\n margin-left: 3px;\n padding: 0 3px;\n\n &:focus {\n outline: 0;\n background: ${props => props.theme.colors.foundation};\n color: ${props => props.theme.colors.neutral08};\n }\n`;\n\nexport const AmPmToggle = React.forwardRef<HTMLButtonElement, AmPmToggleProps>(\n (props, ref) => {\n const { children, ...other } = props;\n const theme = React.useContext(ThemeContext);\n\n return (\n <StyledAmPmToggle\n {...other}\n data-testid=\"amPmTimeButton\"\n ref={ref}\n theme={theme}\n type=\"button\"\n >\n {children}\n </StyledAmPmToggle>\n );\n }\n);\n","import * as React from 'react';\nimport styled from '../../theme/styled';\nimport { Announce } from '../Announce';\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport { AmPmToggle } from './AmPmToggle';\nimport { ScheduleIcon } from 'react-magma-icons';\nimport { useTimePicker, UseTimePickerProps } from './useTimePicker';\n\nimport { I18nContext } from '../../i18n';\nimport { VisuallyHidden } from '../VisuallyHidden';\nimport { useIsInverse } from '../../inverse';\nimport { FormFieldContainer } from '../FormFieldContainer';\nimport { inputWrapperStyles } from '../InputBase';\n\nexport interface TimePickerProps extends UseTimePickerProps {\n /**\n * Style properties for the outer input\n */\n inputStyle?: React.CSSProperties;\n}\n\nconst InputsContainer = styled.div<{\n hasError?: boolean;\n isInverse?: boolean;\n}>`\n ${inputWrapperStyles};\n height: ${props => props.theme.spaceScale.spacing09};\n padding: ${props => props.theme.spaceScale.spacing03};\n width: 144px;\n`;\n\nconst Divider = styled.span`\n display: inline-block;\n margin: 0 1px;\n position: relative;\n top: -1px;\n`;\n\nconst StyledNumInput = styled.input`\n border: 0;\n border-radius: ${props => props.theme.borderRadius};\n margin-right: ${props => props.theme.spaceScale.spacing01};\n padding: 0 ${props => props.theme.spaceScale.spacing01};\n text-align: right;\n width: ${props => props.theme.spaceScale.spacing06};\n\n &::-webkit-inner-spin-button {\n -webkit-appearance: none;\n }\n\n -moz-appearance: textfield;\n\n &:focus {\n outline: 0;\n background: ${props => props.theme.colors.foundation02};\n color: ${props => props.theme.colors.neutral08};\n }\n`;\n\nexport const TimePicker = React.forwardRef<HTMLInputElement, TimePickerProps>(\n (props, ref) => {\n const theme = React.useContext(ThemeContext);\n const i18n = React.useContext(I18nContext);\n\n const {\n containerStyle,\n errorMessage,\n helperMessage,\n inputStyle,\n labelStyle,\n labelText,\n minutesStep,\n onChange,\n ...other\n } = props;\n\n const isInverse = useIsInverse(props.isInverse);\n\n const {\n am,\n amPm,\n amPmRef,\n descriptionId,\n hour,\n hourId,\n hourRef,\n id,\n time,\n minute,\n minuteId,\n minuteRef,\n toggleAmPm,\n handleHourChange,\n handleMinuteChange,\n handleHourKeyDown,\n handleMinuteKeyDown,\n handleAmPmKeyDown,\n } = useTimePicker(props);\n\n const hoursLabel = `${labelText}, ${i18n.timePicker.hoursAriaLabel}`;\n const minutesLabel = `${labelText}, ${i18n.timePicker.minutesAriaLabel}`;\n const amPmLabel = `${labelText}, ${\n amPm === am\n ? i18n.timePicker.amButtonAriaLabel\n : i18n.timePicker.pmButtonAriaLabel\n }`;\n\n return (\n <FormFieldContainer\n {...other}\n containerStyle={containerStyle}\n errorMessage={errorMessage}\n fieldId={id}\n helperMessage={helperMessage}\n isInverse={isInverse}\n labelText={labelText}\n >\n <InputsContainer\n isInverse={isInverse}\n hasError={!!errorMessage}\n theme={theme}\n >\n <ScheduleIcon\n color={theme.colors.neutral}\n style={{ marginRight: theme.spaceScale.spacing02 }}\n />\n <StyledNumInput\n aria-label={hoursLabel}\n aria-describedby={descriptionId}\n data-testid=\"hoursTimeInput\"\n id={hourId}\n maxLength={2}\n max=\"12\"\n min=\"1\"\n onChange={handleHourChange}\n onKeyDown={handleHourKeyDown}\n placeholder=\"--\"\n ref={hourRef}\n theme={theme}\n type=\"number\"\n value={hour}\n />\n <Divider> : </Divider>\n <StyledNumInput\n aria-label={minutesLabel}\n data-testid=\"minutesTimeInput\"\n id={minuteId}\n maxLength={2}\n max=\"59\"\n min=\"0\"\n onChange={handleMinuteChange}\n onKeyDown={handleMinuteKeyDown}\n placeholder=\"--\"\n ref={minuteRef}\n step={minutesStep || 1}\n theme={theme}\n type=\"number\"\n value={minute}\n />\n <AmPmToggle\n aria-label={amPmLabel}\n ref={amPmRef}\n onClick={toggleAmPm}\n onKeyDown={handleAmPmKeyDown}\n >\n {amPm}\n </AmPmToggle>\n <VisuallyHidden>\n <Announce>\n {amPm === am\n ? i18n.timePicker.amSelectedAnnounce\n : i18n.timePicker.pmSelectedAnnounce}\n </Announce>\n </VisuallyHidden>\n </InputsContainer>\n <input id={id} ref={ref} type=\"hidden\" value={time} />\n </FormFieldContainer>\n );\n }\n);\n","import * as React from 'react';\nimport { useGenerateId, Omit } from '../../utils';\nimport { FormFieldContainerBaseProps } from '../FormFieldContainer';\n\nimport { enUS } from 'date-fns/locale';\nimport { I18nContext } from '../../i18n';\n\nexport interface UseTimePickerProps\n extends Omit<FormFieldContainerBaseProps, 'inputSize' | 'fieldId'> {\n /**\n * ID of the hidden input that stores the time value. Also the prefix for other fields.\n */\n id?: string;\n /**\n * Style properties for the outer input\n */\n inputStyle?: React.CSSProperties;\n isInverse?: boolean;\n /**\n * Style properties for the label\n */\n minutesStep?: number;\n /**\n * Full time value passed in and converted to use in hour, minute, and AM/PM fields\n */\n value?: string;\n /**\n * Function called when the component is changed to a new time\n */\n onChange?: (value: string) => void;\n}\n\nexport function useTimePicker(props: UseTimePickerProps) {\n const { errorMessage, helperMessage, onChange } = props;\n const i18n = React.useContext(I18nContext);\n\n const locale = i18n.locale || enUS;\n const am = locale.localize.dayPeriod('am', { width: 'abbreviated' });\n const pm = locale.localize.dayPeriod('pm', { width: 'abbreviated' });\n\n const [hour, setHour] = React.useState<string>('');\n const [minute, setMinute] = React.useState<string>('');\n const [amPm, setAmPm] = React.useState<string>(am);\n const [time, setTime] = React.useState<string>('');\n const hourRef = React.useRef<HTMLInputElement>();\n const minuteRef = React.useRef<HTMLInputElement>();\n const amPmRef = React.useRef<HTMLButtonElement>();\n const id = useGenerateId(props.id);\n\n React.useEffect(() => {\n if (validTime(props.value)) {\n convertPassedInTime(props.value);\n }\n }, [props.value]);\n\n const hourId = `${id}__hour`;\n const minuteId = `${id}__minute`;\n const descriptionId = errorMessage || helperMessage ? `${id}__desc` : null;\n\n function updateTime(newTime: string) {\n setTime(newTime);\n onChange && typeof onChange === 'function' && onChange(newTime);\n }\n\n function validTime(passedInTime: string) {\n const amPmRegex = `${am}|${am.toLowerCase()}|${pm}|${pm.toLowerCase()}`;\n const timeRegex = new RegExp(\n `^([01]?[0-9]|2[0-3]):[0-5][0-9]( (${amPmRegex}))?$`,\n 'g'\n );\n return timeRegex.test(passedInTime);\n }\n\n function convertPassedInTime(passedInTime: string) {\n const [timeHour, timeMinuteAndAmPm] = passedInTime.split(':');\n const timeMinute = timeMinuteAndAmPm.substring(0, 2);\n\n const timeAmPm =\n Number(timeHour) > 12\n ? pm\n : timeMinuteAndAmPm.length > 2\n ? timeMinuteAndAmPm.split(' ')[1].toUpperCase()\n : am;\n\n setHour(calculateHour(Number(timeHour)));\n setMinute(timeMinute);\n setAmPm(timeAmPm);\n updateTime(`${timeHour}:${timeMinute} ${timeAmPm}`);\n }\n\n function calculateHour(newHour: number): string {\n if (newHour < 10) {\n return `0${newHour}`;\n } else if (newHour > 12) {\n return `0${newHour.toString().substring(0, 1)}`;\n }\n\n return newHour.toString();\n }\n\n function calculateMinute(newMinute: number): string {\n if (newMinute === 0) {\n return `00`;\n } else if (newMinute < 10) {\n return `0${newMinute}`;\n } else if (newMinute > 59) {\n return `0${newMinute.toString().substring(0, 1)}`;\n }\n\n return newMinute.toString();\n }\n\n function handleHourChange(event: React.ChangeEvent<HTMLInputElement>) {\n const newHour = calculateHour(Number(event.target.value));\n\n setHour(newHour);\n updateTime(`${newHour}:${minute} ${amPm}`);\n }\n\n function handleMinuteChange(event: React.ChangeEvent<HTMLInputElement>) {\n const newMinute = calculateMinute(Number(event.target.value));\n\n setMinute(newMinute);\n updateTime(`${hour}:${newMinute} ${amPm}`);\n }\n\n function toggleAmPm() {\n const newAmPm = amPm === am ? pm : am;\n\n setAmPm(newAmPm);\n updateTime(`${hour}:${minute} ${newAmPm}`);\n }\n\n function handleHourKeyDown(event: React.KeyboardEvent) {\n if (event.key === 'Backspace') {\n setHour('');\n }\n\n if (event.key === 'ArrowRight') {\n minuteRef.current.focus();\n }\n }\n\n function handleMinuteKeyDown(event: React.KeyboardEvent) {\n if (event.key === 'Backspace') {\n setMinute('');\n }\n\n if (event.key === 'ArrowLeft') {\n hourRef.current.focus();\n }\n\n if (event.key === 'ArrowRight') {\n amPmRef.current.focus();\n }\n }\n\n function handleAmPmKeyDown(event: React.KeyboardEvent) {\n if (event.key === 'ArrowLeft') {\n minuteRef.current.focus();\n }\n\n if (\n event.key === 'ArrowUp' ||\n event.key === 'ArrowDown' ||\n ((event.key === 'A' || event.key === 'a') && amPm === pm) ||\n ((event.key === 'P' || event.key === 'p') && amPm === am)\n ) {\n event.preventDefault();\n toggleAmPm();\n }\n }\n\n return {\n amPm,\n am,\n amPmRef,\n toggleAmPm,\n id,\n time,\n hour,\n hourId,\n hourRef,\n minute,\n minuteId,\n minuteRef,\n descriptionId,\n handleHourChange,\n handleMinuteChange,\n handleHourKeyDown,\n handleMinuteKeyDown,\n handleAmPmKeyDown,\n };\n}\n\nexport type UseTimePickerReturn = ReturnType<typeof useTimePicker>;\n","import * as React from 'react';\nimport { Global, css } from '@emotion/core';\nimport { ThemeContext } from '../ThemeContext';\nimport { useIsInverse } from '../../inverse';\n\nfunction getStyles(theme, isInverse: boolean) {\n return css`\n @import url('https://fonts.googleapis.com/css?family=Open+Sans:300,300i,400,400i,600,600i,700,700i,800,800i&display=swap');\n @import url('https://fonts.googleapis.com/css2?family=Noto+Serif:ital,wght@0,400;0,700;1,400;1,700&display=swap');\n\n *,\n *:before,\n *:after {\n box-sizing: border-box;\n }\n\n *:focus {\n outline: 2px dotted\n ${isInverse ? theme.colors.focusInverse : theme.colors.focus};\n outline-offset: 4px;\n }\n\n html {\n -ms-text-size-adjust: 100%;\n -webkit-text-size-adjust: 100%;\n font-size: ${theme.typeScale.size03.fontSize};\n line-height: ${theme.typeScale.size03.lineHeight};\n scroll-behavior: smooth;\n }\n\n html,\n body {\n background: ${isInverse\n ? theme.colors.foundation\n : theme.colors.neutral08};\n color: ${isInverse ? theme.colors.neutral08 : theme.colors.neutral};\n margin: 0;\n padding: 0;\n }\n\n body {\n font-family: ${theme.bodyFont};\n font-style: normal;\n font-weight: 400;\n font-size: ${theme.typeScale.size03.fontSize};\n line-height: ${theme.typeScale.size03.lineHeight};\n }\n\n a {\n color: ${isInverse ? theme.colors.neutral07 : theme.colors.primary};\n cursor: pointer;\n text-decoration: underline;\n\n &:hover,\n &:focus {\n color: ${isInverse ? theme.colors.neutral06 : theme.colors.focus};\n }\n }\n\n button,\n input,\n optgroup,\n select,\n textarea {\n font: inherit;\n margin: 0;\n }\n\n svg:not(:root) {\n overflow: hidden;\n }\n `;\n}\n\nexport const GlobalStyles: React.FunctionComponent = () => {\n const isInverse = useIsInverse();\n return (\n <ThemeContext.Consumer>\n {theme => <Global styles={getStyles(theme, isInverse)} />}\n </ThemeContext.Consumer>\n );\n};\n","import * as React from 'react';\nimport styled from '../../theme/styled';\n\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport { InverseContext, useIsInverse } from '../../inverse';\nimport {\n UseAccordionProps,\n AccordionContext,\n useAccordion,\n} from './useAccordion';\nimport { ThemeInterface } from '../../theme/magma';\n\n/**\n * @children required\n */\ninterface BaseAccordionProps\n extends UseAccordionProps,\n React.HTMLAttributes<HTMLDivElement> {\n testId?: string;\n /**\n * @internal\n */\n theme?: ThemeInterface;\n}\n\nexport interface AccordionMultipleProps extends BaseAccordionProps {\n /**\n * Zero-based indices of item to expanded initially. When isMulti is true this is an array of numbers.\n * @default []\n */\n defaultIndex?: number[];\n /**\n * Not used in uncontrolled accordion\n */\n index?: never;\n /**\n * If true, multiple accordion items may be expanded at once\n */\n isMulti: true;\n}\n\nexport interface AccordionSingleProps\n extends UseAccordionProps,\n React.HTMLAttributes<HTMLDivElement> {\n /**\n * Zero-based index of item to expanded initially. When isMulti is a false this is a number.\n * @default null\n */\n defaultIndex?: number;\n /**\n * Not used in uncontrolled accordion\n */\n index?: never;\n /**\n * If true, multiple accordion items may be expanded at once\n */\n isMulti: false;\n}\n\nexport interface AccordionMultipleControlledProps\n extends UseAccordionProps,\n React.HTMLAttributes<HTMLDivElement> {\n /**\n * Zero-based indices of expanded items. When isMulti is true this is an array of numbers.\n * @default []\n */\n index?: number[];\n /**\n * Not used in controlled accordion\n */\n defaultIndex?: never;\n isMulti?: true;\n}\n\nexport interface AccordionSingleControlledProps\n extends UseAccordionProps,\n React.HTMLAttributes<HTMLDivElement> {\n /**\n * Zero-based index of expanded item. When isMulti is a false this is a number.\n * @default null\n */\n index?: number;\n /**\n * Not used in controlled accordion\n */\n defaultIndex?: never;\n isMulti: false;\n}\n\nexport type AccordionProps =\n | AccordionMultipleProps\n | AccordionSingleProps\n | AccordionMultipleControlledProps\n | AccordionSingleControlledProps;\n\nconst StyledAccordion = styled.div<AccordionProps>`\n background: transparent;\n border-bottom: 1px solid ${props => props.theme.colors.neutral06};\n color: ${props =>\n props.isInverse\n ? props.theme.colors.neutral08\n : props.theme.colors.neutral};\n`;\n\nexport const Accordion = React.forwardRef<HTMLDivElement, AccordionProps>(\n (props, ref) => {\n const {\n children,\n isInverse: isInverseProp,\n onExpandedChange,\n testId,\n ...rest\n } = props;\n\n const theme = React.useContext(ThemeContext);\n const isInverse = useIsInverse(isInverseProp);\n\n const { contextValue } = useAccordion(props);\n\n return (\n <InverseContext.Provider value={{ isInverse }}>\n <AccordionContext.Provider value={contextValue}>\n <StyledAccordion\n {...rest}\n data-testid={testId}\n isInverse={isInverse}\n ref={ref}\n theme={theme}\n >\n {React.Children.map(\n children,\n (child: React.ReactElement<any>, index) => {\n return React.cloneElement(child, { index, key: index });\n }\n )}\n </StyledAccordion>\n </AccordionContext.Provider>\n </InverseContext.Provider>\n );\n }\n);\n","import * as React from 'react';\n\nimport { AccordionContext } from './useAccordion';\nimport { useGenerateId } from '../../utils';\n\nexport interface UseAccordionItemProps {\n /**\n * @internal\n */\n index?: number;\n isDisabled?: boolean;\n testId?: string;\n}\n\ninterface AccordionItemContextInterface {\n buttonId?: string;\n index?: number;\n isDisabled?: boolean;\n isExpanded?: boolean;\n panelId?: string;\n setIsExpanded?: React.Dispatch<React.SetStateAction<boolean>>;\n}\n\nexport const AccordionItemContext = React.createContext<AccordionItemContextInterface>(\n {\n isDisabled: false,\n isExpanded: false,\n setIsExpanded: () => {},\n }\n);\n\nexport function useAccordionItem(props: UseAccordionItemProps) {\n const { index, isDisabled } = props;\n\n const [isExpanded, setIsExpanded] = React.useState<boolean>(false);\n const { expandedIndex, isMulti } = React.useContext(AccordionContext);\n\n const idPrefix = useGenerateId();\n\n const buttonId = `${idPrefix}_btn`;\n const panelId = `${idPrefix}_panel`;\n\n React.useEffect(() => {\n const newIsExpanded = isMulti\n ? Array.isArray(expandedIndex) && expandedIndex.includes(index) \n : expandedIndex == index;\n \n setIsExpanded(newIsExpanded);\n });\n\n const contextValue = {\n buttonId,\n index,\n isDisabled,\n isExpanded,\n panelId,\n setIsExpanded,\n };\n\n return {\n contextValue,\n };\n}\n\nexport type UseAccordionItemReturn = ReturnType<typeof useAccordionItem>;\n","import * as React from 'react';\nimport {\n AccordionItemContext,\n UseAccordionItemProps,\n useAccordionItem,\n} from './useAccordionItem';\nimport { ThemeInterface } from '../../theme/magma';\nimport styled from '../../theme/styled';\n\n/**\n * @children required\n */\nexport interface AccordionItemProps\n extends UseAccordionItemProps,\n React.HTMLAttributes<HTMLDivElement> {\n /**\n * @internal\n */\n theme?: ThemeInterface;\n}\n\nconst StyledItem = styled.div`\n h1,\n h2,\n h3,\n h4,\n h5,\n h6 {\n background: none;\n color: inherit;\n font: inherit;\n line-height: inherit;\n margin: 0;\n padding: 0;\n }\n`;\n\nexport const AccordionItem = React.forwardRef<\n HTMLDivElement,\n AccordionItemProps\n>((props, ref) => {\n const { children, testId, ...rest } = props;\n\n const { contextValue } = useAccordionItem(props);\n\n return (\n <AccordionItemContext.Provider value={contextValue}>\n <StyledItem ref={ref} data-testid={testId} {...rest}>\n {children}\n </StyledItem>\n </AccordionItemContext.Provider>\n );\n});\n","import * as React from 'react';\n\nimport { AccordionContext } from './useAccordion';\nimport { AccordionItemContext } from './useAccordionItem';\nimport { useForceUpdate } from '../../hooks/useForceUpdate';\nimport { useForkedRef } from '../../utils';\n\nexport interface UseAccordionButtonProps {\n testId?: string;\n isInverse?: boolean;\n}\n\nexport function useAccordionButton(\n props: UseAccordionButtonProps,\n forwardedRef\n) {\n const {\n buttonRefArray,\n expandedIndex,\n iconPosition,\n isControlled,\n isMulti,\n registerAccordionButton,\n onExpandedChange,\n setExpandedIndex,\n } = React.useContext(AccordionContext);\n\n const { buttonId, index, isDisabled, isExpanded, panelId } = React.useContext(\n AccordionItemContext\n );\n\n const handleClick = () => {\n typeof onExpandedChange === 'function' && onExpandedChange(index);\n\n if (!isControlled) {\n isMulti && Array.isArray(expandedIndex)\n ? isExpanded\n ? setExpandedIndex(expandedIndex.filter(item => item !== index))\n : setExpandedIndex(expandedIndex.concat([index]))\n : isExpanded\n ? setExpandedIndex(null)\n : setExpandedIndex(index);\n }\n };\n\n const focusFirst = () => {\n (buttonRefArray.current[0].current as HTMLButtonElement).focus();\n };\n\n const focusNext = () => {\n (buttonRefArray.current[index + 1].current as HTMLButtonElement).focus();\n };\n\n const focusPrev = () => {\n (buttonRefArray.current[index - 1].current as HTMLButtonElement).focus();\n };\n\n const focusLast = () => {\n const arrLength = buttonRefArray.current.length;\n (buttonRefArray.current[arrLength - 1]\n .current as HTMLButtonElement).focus();\n };\n\n const handleKeyDown = (event: React.KeyboardEvent) => {\n const arrLength = buttonRefArray.current.length;\n\n switch (event.key) {\n case 'ArrowDown': {\n index === arrLength - 1 ? focusFirst() : focusNext();\n break;\n }\n case 'ArrowUp': {\n index === 0 ? focusLast() : focusPrev();\n break;\n }\n case 'Home': {\n focusFirst();\n break;\n }\n case 'End': {\n focusLast();\n break;\n }\n default:\n return;\n }\n };\n\n const ownRef = React.useRef<HTMLDivElement>();\n const forceUpdate = useForceUpdate();\n\n const ref = useForkedRef(forwardedRef, ownRef);\n\n React.useEffect(() => {\n if (!isDisabled) {\n registerAccordionButton(buttonRefArray, ownRef);\n }\n\n forceUpdate();\n }, []);\n\n return {\n buttonId,\n handleClick,\n handleKeyDown,\n iconPosition,\n index,\n isDisabled,\n isExpanded,\n panelId,\n ref,\n };\n}\n\nexport type UseAccordionButtonReturn = ReturnType<typeof useAccordionButton>;\n","import * as React from 'react';\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport { Modal, ModalProps } from '../Modal';\nimport { TransitionProps } from '../Transition';\n\nexport enum DrawerPosition {\n top = 'top',\n bottom = 'bottom',\n left = 'left',\n right = 'right',\n}\n\nconst transitionPreset: {\n [key in DrawerPosition]: Omit<TransitionProps, 'isOpen'>;\n} = {\n top: { slideTop: true },\n bottom: { slideBottom: true },\n left: { slideLeft: true },\n right: { slideRight: true },\n};\n\n/**\n * @children required\n */\nexport interface DrawerProps extends Omit<ModalProps, 'size'> {\n testId?: string;\n /**\n * Style properties for the drawer\n */\n drawerStyle?: React.CSSProperties;\n /**\n * Style properties for the drawer container\n */\n containerStyle?: React.CSSProperties;\n /**\n * Set the position of the drawer\n */\n position?: DrawerPosition;\n}\n\nexport const Drawer = React.forwardRef<HTMLDivElement, DrawerProps>(\n (props, ref) => {\n const { style, containerStyle, position, ...rest } = props;\n const theme = React.useContext(ThemeContext);\n const drawerStyle = {\n ...theme.drawer.default,\n ...theme.drawer[DrawerPosition[position]],\n } as React.CSSProperties;\n return (\n <Modal\n containerStyle={{\n padding: '0',\n ...containerStyle,\n }}\n containerTransition={transitionPreset[DrawerPosition[position]]}\n style={{ ...drawerStyle, ...style }}\n {...rest}\n />\n );\n }\n);\n","import * as React from 'react';\nimport styled from '../../theme/styled';\n\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport { ThemeInterface } from '../../theme/magma';\nimport { useIsInverse } from '../../inverse';\nimport { AccordionIconPosition } from './useAccordion';\nimport { Spacer } from '../Spacer';\nimport { ExpandMoreIcon } from 'react-magma-icons';\nimport {\n useAccordionButton,\n UseAccordionButtonProps,\n} from './useAccordionButton';\nimport { Transition } from '../Transition';\n\n/**\n * @children required\n */\nexport interface AccordionButtonProps\n extends UseAccordionButtonProps,\n React.HTMLAttributes<HTMLButtonElement> {\n /**\n * @internal\n */\n theme?: ThemeInterface;\n}\n\nconst StyledButton = styled.button<{\n isInverse?: boolean;\n isExpanded?: boolean;\n}>`\n background: transparent;\n border: 0;\n border-top: 1px solid ${props =>\n props.isInverse ? props.theme.colors.tint04 : props.theme.colors.neutral06};\n color: ${props =>\n props.isInverse\n ? props.theme.colors.neutral08\n : props.theme.colors.neutral};\n cursor: pointer;\n display: flex;\n font-size: ${props => props.theme.typeScale.size03.fontSize};\n line-height: ${props => props.theme.typeScale.size03.lineHeight};\n font-weight: 600;\n padding: 12px 16px;\n text-align: left;\n width: 100%;\n\n &:focus {\n outline: 2px dotted ${props =>\n props.isInverse\n ? props.theme.colors.focusInverse\n : props.theme.colors.focus};\n }\n outline-offset: -3px;\n }\n\n &&[disabled] {\n color: ${props =>\n props.isInverse\n ? props.theme.colors.disabledInverseText\n : props.theme.colors.disabledText};\n cursor: not-allowed;\n }\n`;\n\nconst TextWrapper = styled.span`\n flex-grow: 1;\n`;\n\nexport const AccordionButton = React.forwardRef<\n HTMLButtonElement,\n AccordionButtonProps\n>((props, forwardedRef) => {\n const { children, testId, isInverse: isInverseProp, ...rest } = props;\n const theme = React.useContext(ThemeContext);\n const isInverse = useIsInverse(isInverseProp);\n\n const {\n iconPosition,\n buttonId,\n isDisabled,\n isExpanded,\n panelId,\n handleClick,\n handleKeyDown,\n ref,\n } = useAccordionButton(props, forwardedRef);\n\n const caret = (\n <Transition\n isOpen={isExpanded}\n rotate180\n style={{ height: theme.spaceScale.spacing06 }}\n >\n <ExpandMoreIcon />\n </Transition>\n );\n\n return (\n <StyledButton\n {...rest}\n aria-controls={panelId}\n aria-expanded={Boolean(isExpanded)}\n data-testid={testId}\n disabled={isDisabled}\n id={buttonId}\n isExpanded={isExpanded}\n isInverse={isInverse}\n onClick={handleClick}\n onKeyDown={handleKeyDown}\n ref={ref}\n theme={theme}\n >\n {iconPosition === AccordionIconPosition.left && (\n <>\n {caret}\n <Spacer size={12} />\n </>\n )}\n <TextWrapper>{children}</TextWrapper>\n {iconPosition === AccordionIconPosition.right && (\n <>\n <Spacer size={12} />\n {caret}\n </>\n )}\n </StyledButton>\n );\n});\n","import * as React from 'react';\nimport styled from '../../theme/styled';\n\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport { ThemeInterface } from '../../theme/magma';\nimport { useIsInverse } from '../../inverse';\nimport { AccordionItemContext } from './useAccordionItem';\nimport { Transition } from '../Transition';\n\n/**\n * @children required\n */\nexport interface AccordionPanelProps\n extends React.HTMLAttributes<HTMLDivElement> {\n testId?: string;\n isInverse?: boolean;\n /**\n * @internal\n */\n theme?: ThemeInterface;\n}\n\nconst StyledPanel = styled.div<AccordionPanelProps>`\n background: transparent;\n color: ${props =>\n props.isInverse\n ? props.theme.colors.neutral08\n : props.theme.colors.neutral};\n padding: ${props =>\n `${props.theme.spaceScale.spacing03} ${props.theme.spaceScale.spacing05} ${props.theme.spaceScale.spacing04}`};\n`;\n\nexport const AccordionPanel = React.forwardRef<\n HTMLDivElement,\n AccordionPanelProps\n>((props, ref) => {\n const { children, testId, isInverse: isInverseProp, ...rest } = props;\n const theme = React.useContext(ThemeContext);\n const isInverse = useIsInverse(isInverseProp);\n\n const { buttonId, isExpanded, panelId } =\n React.useContext(AccordionItemContext);\n\n return (\n <Transition\n isOpen={isExpanded}\n collapse\n unmountOnExit\n >\n <StyledPanel\n {...rest}\n aria-labelledby={buttonId}\n aria-hidden={!isExpanded}\n data-testid={testId}\n id={panelId}\n isInverse={isInverse}\n ref={ref}\n theme={theme}\n >\n {children}\n </StyledPanel>\n </Transition>\n );\n});\n","import * as React from 'react';\nimport styled from '../../theme/styled';\nimport { css } from '@emotion/core';\nimport * as CSS from 'csstype';\n\nexport enum GridDisplay {\n grid = 'grid', // default\n inlineGrid = 'inline-grid',\n}\n\nexport enum GridJustifyItems {\n start = 'start',\n end = 'end',\n center = 'center',\n stretch = 'stretch',\n}\n\nexport enum GridJustifyContent {\n start = 'start',\n end = 'end',\n center = 'center',\n stretch = 'stretch',\n spaceAround = 'space-around',\n spaceBetween = 'space-between',\n spaceEvenly = 'space-evenly',\n}\n\nexport enum GridAlignItems {\n start = 'start',\n end = 'end',\n center = 'center',\n stretch = 'stretch',\n}\n\nexport enum GridAlignContent {\n start = 'start',\n end = 'end',\n center = 'center',\n stretch = 'stretch',\n spaceAround = 'space-around',\n spaceBetween = 'space-between',\n spaceEvenly = 'space-evenly',\n}\n\nexport enum GridItemJustifySelf {\n start = 'start',\n end = 'end',\n center = 'center',\n stretch = 'stretch',\n}\n\nexport enum GridItemAlignSelf {\n start = 'start',\n end = 'end',\n center = 'center',\n stretch = 'stretch',\n}\n\nexport enum GridAutoFlow {\n row = 'row',\n column = 'column',\n rowDense = 'row-dense',\n columnDense = 'column-dense',\n}\n\n/**\n * @children required\n */\nexport interface GridProps extends React.HTMLAttributes<HTMLDivElement> {\n /**\n * Defines the display style property. Sets grid or inline-grid.\n * @default GridDisplay.grid\n */\n gridDisplay?: GridDisplay;\n /**\n * Set the columns in the grid.\n */\n gridTemplateColumns?: CSS.Property.GridTemplateColumns;\n /**\n * Set the rows in the grid.\n */\n gridTemplateRows?: CSS.Property.GridTemplateRows;\n /**\n * Set the areas in the grid.\n */\n gridTemplateAreas?: CSS.Property.GridTemplateAreas;\n /**\n * Set the space between columns and / or rows in the grid.\n */\n gridGap?: CSS.Property.GridGap;\n /**\n * Align grid items along the inline (row) axis. Applies to all items in the grid.\n */\n gridJustifyItems?: GridJustifyItems;\n /**\n * Sets the alignment of the grid within the grid container along the inline row axis.\n */\n gridJustifyContent?: GridJustifyContent;\n /**\n * Align grid items along the block (column) axis. Applies to all items in the grid.\n */\n gridAlignItems?: GridAlignItems;\n /**\n * Sets the alignment of the grid within the grid container along the block (column) axis.\n */\n gridAlignContent?: GridAlignContent;\n /**\n * If you have grid items that you don’t explicitly place on the grid, the auto-placement algorithm kicks in to automatically place the items.\n */\n gridAutoFlow?: GridAutoFlow;\n}\n\n/**\n * @children required\n */\nexport interface GridItemProps extends React.HTMLAttributes<HTMLDivElement> {\n /**\n * Defines the span of a column on a grid item.\n */\n gridColumn?: CSS.Property.GridColumn;\n /**\n * Defines the span of a row on a grid item.\n */\n gridRow?: CSS.Property.GridRow;\n /**\n * Define which grid area a grid item belongs to.\n */\n gridArea?: CSS.Property.GridArea;\n /**\n * Aligns the grid item within the cell along the inline (row) axis. Applies to a grid item inside a single cell.\n */\n gridItemJustifySelf?: GridItemJustifySelf;\n /**\n * Aligns the grid item within the cell along the block (column) axis. Applies to a grid item inside a single cell.\n */\n gridItemAlignSelf?: GridItemAlignSelf;\n}\n\nexport const Grid = styled.div<GridProps>`\n ${props =>\n css({\n display: props.gridDisplay || GridDisplay.grid,\n 'grid-template-rows': props.gridTemplateRows,\n 'grid-template-columns': props.gridTemplateColumns,\n 'grid-areas': props.gridTemplateAreas,\n 'grid-gap': props.gridGap,\n 'justify-items': props.gridJustifyItems,\n 'justify-content': props.gridJustifyContent,\n 'align-items': props.gridAlignItems,\n 'align-content': props.gridAlignContent,\n 'grid-auto-flow': props.gridAutoFlow,\n })}\n`;\n\nexport const GridItem = styled.div<GridItemProps>`\n ${props =>\n css({\n 'grid-column': props.gridColumn,\n 'grid-row': props.gridRow,\n 'grid-area': props.gridArea,\n 'justify-self': props.gridItemJustifySelf,\n 'align-self': props.gridItemAlignSelf,\n })}\n`;\n","import * as React from 'react';\nimport styled from '../../theme/styled';\nimport { css } from '@emotion/core';\n\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport { magma, ThemeInterface } from '../../theme/magma';\nimport { InverseContext, useIsInverse } from '../../inverse';\n\n/**\n * @children required\n */\nexport interface BlockQuoteProps extends React.HTMLAttributes<HTMLDivElement> {\n /**\n * Style properties for the left border color which accept custom CSS hex values.\n */\n borderStyle?: keyof typeof magma.colors | string;\n isInverse?: boolean;\n /**\n * @internal\n */\n testId?: string;\n theme?: ThemeInterface;\n}\n\nconst BlockQuoteStyles = props => css`\n border-left: 4px solid\n ${props.isInverse\n ? props.borderStyle || props.theme.colors.neutral08\n : props.borderStyle || props.theme.colors.neutral06};\n padding: 10px 0 4px 20px;\n margin: 0;\n`;\n\nconst StyledBlockQuote = styled.figure<BlockQuoteProps>`\n ${BlockQuoteStyles};\n`;\n\nexport const BlockQuote = React.forwardRef<HTMLDivElement, BlockQuoteProps>(\n (props, ref) => {\n const {\n borderStyle,\n children,\n testId,\n isInverse: isInverseProp,\n ...rest\n } = props;\n const theme = React.useContext(ThemeContext);\n const isInverse = useIsInverse(isInverseProp);\n\n return (\n <InverseContext.Provider value={{ isInverse }}>\n <StyledBlockQuote\n borderStyle={magma.colors[borderStyle] || borderStyle}\n theme={theme}\n isInverse={isInverse}\n ref={ref}\n data-testid={props.testId}\n {...rest}\n >\n {children}\n </StyledBlockQuote>\n </InverseContext.Provider>\n );\n }\n);\n","import * as React from 'react';\nimport styled from '../../theme/styled';\nimport { css } from '@emotion/core';\nimport { ThemeContext } from '../../theme/ThemeContext';\nimport { useIsInverse } from '../../inverse';\nimport { BlockQuoteProps } from '.';\nimport {\n TypographyVisualStyle,\n TypographyColor,\n TypographyContextVariant,\n TypographyComponent,\n} from '../Typography';\n/**\n * @children required\n */\nexport interface BlockQuoteItemProps\n extends BlockQuoteProps,\n React.HTMLAttributes<HTMLDivElement> {\n /**\n * The color of the component, helping to convey meaning or relative emphasis\n * @default TypographyColor.default\n */\n color?: TypographyColor;\n /**\n * Additional styles for typography based on the context of the content\n * @default TypographyContextVariant.default\n */\n contextVariant?: TypographyContextVariant;\n /**\n * If true, adds in an attribution line for the quote\n * @default false\n */\n hasAttribution?: boolean;\n isInverse?: boolean;\n testId?: string;\n /**\n * Applies visual styles including font-size, font-weight, line-height and margins\n * @default TypographyVisualStyle.bodyMedium\n */\n visualStyle?: TypographyVisualStyle;\n}\n\nexport const blockQuoteStyles = props => css`\n margin: 0;\n padding: 8px 0;\n blockquote {\n margin: 0;\n }\n //Inverse\n ${props.isInverse &&\n css`\n color: ${props.theme.colors.neutral08};\n `}\n //Inverse & Attribution\n ${props.isInverse &&\n props.hasAttribution &&\n css`\n color: ${props.theme.colors.neutral05};\n `}\n`;\n\nconst StyledBlockQuoteItem = styled(TypographyComponent)`\n ${blockQuoteStyles}\n`;\n\nexport const BlockQuoteItem = React.forwardRef<\n HTMLDivElement,\n BlockQuoteItemProps\n>((props, ref) => {\n const { children, color, hasAttribution, testId, visualStyle, ...rest } =\n props;\n const theme = React.useContext(ThemeContext);\n const isInverse = useIsInverse();\n\n return (\n <StyledBlockQuoteItem\n as={hasAttribution ? 'figcaption' : 'blockquote'}\n color={\n hasAttribution\n ? color || TypographyColor.subdued\n : color || TypographyColor.default\n }\n theme={theme}\n hasAttribution={hasAttribution}\n isInverse={isInverse}\n ref={ref}\n data-testid={props.testId}\n visualStyle={\n hasAttribution\n ? visualStyle || TypographyVisualStyle.bodyMedium\n : visualStyle || TypographyVisualStyle.bodyLarge\n }\n {...rest}\n >\n {hasAttribution ? (\n <>\n ― \n {children}\n </>\n ) : (\n <>\n “\n {children}\n ”\n </>\n )}\n </StyledBlockQuoteItem>\n );\n});\n","import * as React from 'react';\nimport { useGenerateId } from '../../utils';\nimport { DropdownHeader } from './DropdownHeader';\n\n/**\n * @children required\n */\nexport interface DropdownMenuGroupProps\n extends React.HTMLAttributes<HTMLDivElement> {\n /**\n * Header text to use for the menu group\n */\n header?: React.ReactNode;\n}\n\nexport const DropdownMenuGroup: React.FunctionComponent<DropdownMenuGroupProps> = (\n props: DropdownMenuGroupProps\n) => {\n const { children, id: defaultId, header, ...other } = props;\n\n const id = useGenerateId(defaultId);\n\n return (\n <div {...other} aria-labelledby={id} role=\"group\">\n {header && <DropdownHeader id={id}>{header}</DropdownHeader>}\n {children}\n </div>\n );\n};\n","import * as React from 'react';\n\nimport { TARGET_ID } from '../SkipLink';\n\n/**\n * @children required\n */\nexport interface SkipLinkContentProps\n extends React.HTMLAttributes<HTMLDivElement> {\n testId?: string;\n}\n\nexport const SkipLinkContent: React.FunctionComponent<SkipLinkContentProps> = props => {\n const { children, testId } = props;\n return (\n <div\n data-testid={testId}\n id={TARGET_ID}\n tabIndex={-1}\n style={{ outline: 0 }}\n >\n {children}\n </div>\n );\n};\n","import React from 'react';\n\nexport function useMediaQuery(queryInput) {\n const query = queryInput.replace(/^@media( ?)/m, '');\n\n const supportMatchMedia =\n typeof window !== 'undefined' && typeof window.matchMedia !== 'undefined';\n\n const matchMedia = supportMatchMedia ? window.matchMedia : null;\n\n const [match, setMatch] = React.useState(() => {\n if (supportMatchMedia) {\n return matchMedia(query).matches;\n }\n\n return false;\n });\n\n React.useEffect(() => {\n let active = true;\n\n if (!supportMatchMedia) {\n return undefined;\n }\n\n const queryList = matchMedia(query);\n\n const updateMatch = () => {\n if (active) {\n setMatch(queryList.matches);\n }\n };\n\n updateMatch();\n queryList.addEventListener('change', updateMatch);\n\n return () => {\n active = false;\n queryList.removeEventListener('change', updateMatch);\n };\n }, [query, matchMedia, supportMatchMedia]);\n\n return match;\n}\n"],"names":["typeScale","size01","fontSize","letterSpacing","lineHeight","size02","size03","size04","size05","size06","size07","size08","size09","size10","size11","size12","size13","colors","primary","primaryInverse","focus","focusInverse","foundation","foundation02","foundation03","foundation04","pop","pop02","pop03","pop04","pop05","pop06","success","success02","successInverse","danger","dangerInverse","neutral","neutral02","neutral03","neutral04","neutral05","neutral06","neutral07","neutral08","disabledText","disabledInverseText","toggleBoxShadow","shade","shade02","tint","tint02","tint03","tint04","tone","tone02","border","borderInverse","spaceScale","spacing01","spacing02","spacing03","spacing04","spacing05","spacing06","spacing07","spacing08","spacing09","spacing10","spacing11","spacing12","spacing13","spacing14","magma","bodyFont","bodyExpressiveFont","bodyNarrativeFont","borderRadius","headingFont","headingExpressiveFont","headingNarrativeFont","direction","spacingMultiplier","transitions","fade","motion","exit","opacity","transition","duration","ease","enter","baseStyle","slideTop","y","type","damping","stiffness","position","top","right","left","slideBottom","bottom","slideRight","x","slideLeft","nudgeTop","nudgeBottom","nudgeRight","nudgeLeft","scale","rotate45","rotate","rotate90","rotate180","collapse","height","delay","property","overflow","breakpoints","xs","small","medium","large","xl","iconSizes","xSmall","xLarge","typographyVisualStyles","headingXLarge","mobile","desktop","fontWeight","headingLarge","headingMedium","headingSmall","headingXSmall","heading2XSmall","bodyLarge","bodyMedium","bodySmall","bodyXSmall","typographyExpressiveVisualStyles","typographyNarrativeVisualStyles","appBar","backgroundColor","padding","textColor","compact","inverse","combobox","menu","maxHeight","modal","width","drawer","maxWidth","minHeight","margin","dropdown","content","iterableColors","tabs","approxTabSize","horizontal","vertical","select","tag","display","alignItems","justifyContent","tooltip","arrowSize","arrowSizeDoubled","zIndex","ThemeContext","React","DEFAULT_STYLE_PROPS","color","shape","size","textTransform","variant","buildPropsWithDefaultButtonStyles","props","buildButtonSize","theme","cachedType","defaultI18n","locale","dateFormat","timeFormat","example","months","january","february","march","april","may","june","july","august","september","october","november","december","days","monday","tuesday","wednesday","thursday","friday","saturday","sunday","min","emptyItemsListText","alert","dismissAriaLabel","breadcrumb","navAriaLabel","charts","line","chartTabLabel","dataLegendsLabel","dataTabLabel","keyboardInstructions","keyboardInstructionsHeader","keyboardInstructionsTooltip","legendButtonAriaLabel","clearIndicatorAriaLabel","createLabel","datePicker","startOfWeek","calendarIconAriaLabel","calendarOpenAnnounce","calendarCloseAriaLabel","previousMonthAriaLabel","nextMonthAriaLabel","disabledDayAriaLabel","selectedDayAriaLabel","todayAriaLabel","helpModal","header","helpButtonAriaLabel","ariaLabel","explanation","rightAndLeftArrowKeys","upAndDownArrowKeys","pageUpAndPageDownKeys","displayValue","homeAndEndKeys","escape","questionMark","menuItemSelectedAriaLabel","toggleMenuAriaLabel","dropzone","browseFiles","dragMessage","errors","message","required","files","bytes","deleteFile","removeFile","navigationButtonLabel","search","input","placeholder","iconAriaLabel","indeterminateCheckbox","isCheckedAnnounce","isIndeterminateAnnounce","isUncheckedAnnounce","isClearableAriaLabel","loadingIndicator","progressBar","messages","first","second","third","spinner","closeAriaLabel","multiSelect","selectedItemButtonAriaLabel","multiCombobox","pagination","nextButtonLabel","previousButtonLabel","pageButtonLabel","password","shown","buttonText","announce","hidden","skipLink","table","ofLabel","nextAriaLabel","previousAriaLabel","rowsPerPageLabel","horizontalTabsInstructions","verticalTabsInstructions","deleteAriaLabel","timePicker","hoursAriaLabel","minutesAriaLabel","amButtonAriaLabel","pmButtonAriaLabel","amSelectedAnnounce","pmSelectedAnnounce","wizard","actions","next","previous","cancel","submit","optional","navigationLabel","I18nContext","generateId","id","uuidv4","useGenerateId","newId","useState","updateId","useEffect","omit","obj","reduce","newObj","val","usePrevious","value","ref","useRef","current","debounce","func","wait","timeout","debounced","args","context","this","clearTimeout","setTimeout","apply","clear","detectScrollType","dummy","document","createElement","appendChild","createTextNode","dir","style","body","scrollLeft","getNormalizedScrollLeft","element","Number","scrollWidth","clientWidth","easeInOutSin","time","Math","sin","PI","assignRef","error","Error","useForkedRef","refs","useMemo","every","node","forEach","stringIncludesUnit","includes","convertStyleValueToString","defaultValue","getNodeText","Array","map","join","children","candidateSelectors","StyledSpinner","styled","span","Spinner","testId","other","i18n","sizeString","role","buttonStyles","css","disabled","isInverse","buildButtonBackground","buildBorderColor","buildButtonBorderRadius","buildColor","isFullWidth","buildButtonFontSize","buildButtonLineHeight","buildButtonPadding","iconOnly","lighten","darken","buildFocusBackground","buildFocusColor","buildAfterBackground","buildActiveBackground","buildActiveColor","BaseStyledButton","SpinnerWrapper","ChildrenWrapper","isLoading","StyledButton","ButtonType","button","spinnerColor","ButtonVariant","outline","link","spinnerSize","ButtonSize","InverseContext","useIsInverse","inverseProp","inverseContext","Boolean","ButtonColor","ButtonShape","ButtonTextTransform","ButtonIconPosition","Button","rest","SpanTextLeft","getIconPadding","SpanTextRight","getIconSize","AlertVariant","IconButton","icon","iconPosition","object","round","solid","only","fill","uppercase","Circle","circle","ProgressRing","isActive","radius","strokeWidth","percentage","setPercentage","interval","setInterval","clearInterval","normalizedRadius","circumference","strokeDashoffset","cx","cy","r","stroke","strokeDasharray","VARIANT_ICON","info","InfoIcon","muted","CheckCircleIcon","warning","WarningIcon","ErrorIcon","buildAlertBackground","AnnouncePoliteness","StyledAlert","div","isExiting","isToast","StyledAlertInner","AlertContents","IconWrapperStyles","IconWrapper","ProgressRingWrapper","DismissibleIconWrapper","whitelistProps","DismissButton","shouldForwardProp","prop","isPropValid","alertVariant","AlertBase","forceDismiss","hasTimerRing","defaultId","isDismissed","isDismissible","externalIsExiting","isPaused","onDismiss","toastDuration","setIsExiting","handleDismiss","transitionDuration","tabIndex","Provider","renderIcon","CloseIcon","onClick","Alert","AppBarPosition","Announce","politeness","polite","BadgeColor","BadgeVariant","StyledHeader","sticky","fixed","isCompact","AppBar","baseBadgeStyles","buildBadgeBackground","light","counter","StyledSpan","buildBadgeFocusBackground","buildBadgeActiveBackground","Badge","BadgeComponent","label","StyledBanner","BannerContents","ButtonWrapper","allowedProps","getButtonColor","secondary","HideAtBreakpointDisplayType","Banner","actionButtonText","actionButtonOnClick","StyledList","Breadcrumb","isInverseProp","linkStyles","StyledLink","Hyperlink","to","styledAs","composedStyle","ClassNames","className","composedCss","LinkStyledAsButton","withComponent","href","StyledItem","li","BreadcrumbItem","ChevronRightIcon","BreakpointScreenSize","Container","displayType","minWidth","HideAtBreakpoint","block","getMinWidth","screenSize","breakpointValues","definedBreakpoints","sizes","Object","keys","slice","indexOf","find","newSize","CardAlignment","CardCalloutType","TypographyColor","TypographyContextVariant","TypographyVisualStyle","StyledCard","background","hasDropShadow","calloutType","align","buildCalloutBackground","CardContext","Card","StyledCardBody","CardBody","colorStyles","contextVariant","subdued","baseParagraphStyles","expressive","narrative","getBodyFontFamily","baseHeadingStyles","getHeadingFontFamily","headingLargeStyles","noMargins","TypographyComponent","p","visualStyle","headingXLargeStyles","headingMediumStyles","headingSmallStyles","headingXSmallStyles","heading2XSmallStyles","paragraphLargeStyles","paragraphMediumStyles","paragraphSmallStyles","paragraphXSmallStyles","getTypographyStyles","Heading","level","stylesFromLevel","as","StyledCardHeading","CardHeading","headingLevel","DisplayInputStyles","DisplayInputActiveStyles","buildDisplayInputActiveBackground","buildDisplayInputFocusStyles","InputSize","InputType","InputIconPosition","HiddenStyles","inputWrapperStyles","hasError","inputBaseStyles","inputSize","InputWrapper","StyledInput","IconButtonContainer","IsClearableContainer","LabelPosition","InputBase","forwardedRef","containerStyle","iconRef","isClearable","isPredictive","onClear","onIconClick","onIconKeyDown","inputStyle","setValue","inputRef","onChange","event","target","text","ClearIcon","onKeyDown","Message","BuildMessageColor","InputMessage","CheckboxTextPosition","StyledLabel","labelPosition","Label","actionable","FormGroupContext","HiddenLabel","FormGroup","errorMessage","helperMessage","labelledById","labelStyle","labelText","isTextVisuallyHidden","descriptionId","StyledLabelComponent","htmlFor","Consumer","StyledContainerComponent","StyledContainer","HiddenLabelText","HiddenInput","StyledFakeInput","buildDisplayInputBorderColor","isChecked","isIndeterminate","buildCheckIconColor","textPosition","Checkbox","checked","defaultChecked","updateIsChecked","isControlled","groupDescriptionId","describedBy","targetChecked","CheckBoxIcon","CheckBoxOutlineBlankIcon","gutterWidth","gutterWidthString","maxWidthString","useControlled","controlled","defaultProp","undefined","newValue","useDataPagination","defaultItemsPerPage","items","itemsPerPageProp","itemsPerPage","onItemsPerPageChange","setItemsPerPageState","length","ceil","getPageItems","page","newItemsPerPage","IndeterminateCheckboxStatus","VisuallyHiddenDiv","VisuallyHidden","TableDensity","TableCellAlign","TableSortDirection","TableRowColor","IndeterminateCheckbox","status","isUnchecked","replaceLabelTextForAnnounceText","baseAnnounceText","replace","getStringifiedLabelText","showAnnounce","announceText","IndeterminateCheckBoxIcon","paddingLeft","TableContext","density","normal","hasHoverStyles","hasZebraStripes","hasVerticalBorders","isSelectable","rowCount","selectedItems","TableContainer","StyledTable","Table","TableBody","baseTableCellStyle","buildCellPaddingStyle","textAlign","StyledCell","td","TableCell","tableContext","displayName","TableHeaderCellScope","TableHead","StyledTableHeaderCell","th","isRowHeader","borderBottom","verticalAlign","isSortable","SortButton","TableHeaderCell","onSort","scope","row","col","sortDirection","SortIcon","ascending","SouthIcon","descending","NorthIcon","SortDoubleArrowIcon","usePagination","count","defaultPage","hideNextButton","hidePreviousButton","numberOfAdjacentPages","numberOfEdgePages","handleChange","onPageChange","pageProp","showFirstButton","showLastButton","useContext","setPageState","handleClick","range","start","end","from","_","i","startPages","endPages","max","siblingsStart","siblingsEnd","itemList","buttonPage","pageButtons","item","isSelected","registerDescendant","itemRefArray","itemRef","index","findIndex","compareDocumentPosition","Node","DOCUMENT_POSITION_PRECEDING","newItem","unregisterDescendant","filter","useDescendants","DropdownDropDirection","DropdownAlignment","DropdownContext","isOpen","registerDropdownMenuItem","elements","setIsOpen","Dropdown","activeIndex","alignment","dropDirection","onBeforeShiftFocus","onClose","onOpen","activeItemIndex","setActiveItemIndex","ownRef","toggleRef","menuRef","dropdownButtonId","closeDropdown","preventMagmaFocus","handlePreventMagmaFocus","getFilteredItem","filteredItems","filteredItemIndex","filteredItem","activeElement","handleDropdownBlur","relatedTarget","currentTarget","contains","isFixedWidth","openDropdown","key","preventDefault","onBlur","getButtonPadding","StyledIconButton","DropdownButton","buttonIcon","ArrowLeftIcon","ArrowRightIcon","up","ArrowDropUpIcon","ArrowDropDownIcon","getButtonIcon","iconPositionToUse","StyledDiv","DropdownContent","StyledHr","hr","DropdownHeader","MenuItemStyles","isInactive","DropdownMenuItem","CheckIcon","TooltipPosition","DropdownSplitButton","leftCap","borderRight","marginRight","rightCap","marginLeft","PageCount","RowsPerPageLabel","TablePagination","defaultRowsPerPage","dropdownDropDirection","itemCount","onRowsPerPageChange","rowsPerPageProp","rowsPerPage","rowsPerPageValues","setRowsPerPageState","setActiveIndex","displayPageStart","displayPageEnd","rowsPerPageItems","toString","handleRowsPerPageChange","previousButton","nextButton","WestIcon","EastIcon","StyledTableRow","tr","buildTableRowBackground","buildTableRowColor","TableRow","headerRowStatus","isSelectableDisabled","onHeaderRowSelect","onTableRowSelect","rowIndex","isHeaderRow","getIsCheckboxInverse","child","DefaultPagination","Datagrid","columns","customComponents","components","componentsProps","defaultSelectedRows","onHeaderSelect","onRowSelect","onSelectedRowsChange","paginationProps","rows","selectedRowsProp","selectedRows","hasPagination","rowsToShow","setRowsToShow","updatedSelectedRows","currentPage","setCurrentPage","Pagination","passedOnPaginationProps","newPage","filteredRows","indeterminate","unchecked","handleSelectedRowsChange","newSelectedRows","field","push","splice","handleRowSelect","CalendarContext","chosenDate","Date","focusedDate","buildCalendarMonth","newDate","enableOutsideDates","showHelperInformation","hideHelperInformation","onDateChange","onPrevMonthClick","onNextMonthClick","setDateFocused","EnumTooltipPosition","TooltipContainer","TooltipArrow","StyledTooltip","Tooltip","open","isVisible","setIsVisible","referenceElement","setReferenceElement","popperElement","setPopperElement","setArrowElement","usePopper","modifiers","name","options","offset","placement","styles","attributes","combinedRef","showTooltip","hideTooltip","handleEsc","window","addEventListener","removeEventListener","arrowStyle","tooltipStyle","isArray","tooltipTrigger","onFocus","combinedTooltipStyles","popper","combinedArrowStyle","arrow","onMouseLeave","onMouseEnter","getPrevMonthFromDate","prevDate","startOfMonth","subMonths","getNextMonthFromDate","addMonths","i18nFormat","date","formatStr","enUS","format","getDateFromString","CalendarHeaderContainer","CalendarIconButton","CalendarHeaderText","CalendarHeader","calendarHeader","prevFocusHeader","focusHeader","currentMonth","capitalizeCurrentMonth","charAt","toUpperCase","ArrowBackIcon","ArrowForwardIcon","CalendarDayCell","CalendarDayInner","isChosen","EmptyCell","TodayIndicator","CalendarDay","dayRef","dateFocused","maxDate","minDate","focused","setFocused","day","dayFocusable","isSameDay","isAfter","isBefore","sameDateAsFocusedDate","sameDateAsChosenDate","sameDateAsToday","isFocused","List","ul","Item","KeyboardShortcutButtonWrapper","StyledPopup","StyledNavContainer","StyledContent","HelperInformation","useFocusLock","active","rootNode","focusableItems","updateFocusableItems","_rootNode$current","querySelectorAll","firstChild","setAttribute","observer","MutationObserver","observe","childList","subtree","disconnect","handleKeyPress","shiftKey","firstItem","lastItem","CalendarContainer","MonthContainer","Th","HelperButton","CloseButton","CalendarMonth","lastFocus","headingRef","setDayFocusable","setFocusHeader","prevCalendarOpened","calendarOpened","focusTrapElement","focusOnOpen","tableDaysHeaders","concat","helperInformationShown","week","dayOfWeek","KeyboardIcon","handleCloseButtonClick","StyledFormFieldContainer","FormFieldContainer","fieldId","isLabelVisuallyHidden","messageStyle","Input","DatePickerContainer","DatePickerCalendar","opened","DatePicker","setHelperInformationShown","setCalendarOpened","setDateFromConsumer","defaultDate","setDefaultFocusedDate","setFocusedDate","setChosenDate","convertedDate","convertedMinDate","convertedMaxDate","inDateRange","minDateValue","maxDateValue","reset","isValidDateFromString","isValidDateFormat","test","isValidDate","isValid","handleInputKeyDown","handleDateChange","toISOString","inputValue","month","enableOutsideDays","firstDayOfWeek","firstOfMonth","lastOfMonth","endOfMonth","prevDays","getDay","nextDays","firstDay","subDays","lastDay","addDays","totalDays","differenceInDays","currentDay","weeksInMonth","getCalendarMonthWeeks","closest","newChosenDate","e","toggleCalendar","getAttribute","subWeeks","addWeeks","endOfWeek","EventIcon","onInputChange","isValidDay","onInputBlur","onInputFocus","toLowerCase","a","DropdownMenuNavItem","FlexAlignContent","FlexAlignItems","FlexBehavior","FlexDirection","FlexJustify","FlexWrap","getWidth","IconSizes","IconAlignment","ulListType","olListType","StyledFlex","behavior","alignContent","wrap","justify","spacing","container","sm","md","lg","Flex","stretch","flexStart","Paragraph","StyledForm","FormActions","Form","headingContextVariant","headingVisualStyle","description","getIconSizes","iconSize","getListAlignment","iconAlign","center","getListDisplay","ProgressBarColor","ListStyles","listType","spacingStyle","hasStart","isOrdered","isReversed","reversed","ListItemStyles","IconStyles","iconBackground","iconColor","StyledListItem","StyledIcon","ListItem","buildProgressBarBackground","LoadingIndicatorType","isLoadingIndicator","Track","Bar","isAnimated","Percentage","TopPercentage","ProgressBar","isLabelVisible","labelId","percentageValue","heightString","StyledLoadingIndicator","MessageContainer","hide","LoadingIndicator","messageLevel","setMessageLevel","loadingIndicatorType","messageLevel2Timeout","progressbar","messageLevel3Timeout","message1","message2","message3","SelectText","SelectedItemsWrapper","SelectedItemButton","DefaultClearIndicator","DefaultDropdownIndicator","flexShrink","DefaultLoadingIndicator","DefaultItem","itemString","defaultComponents","ClearIndicator","DropdownIndicator","ChildrenContainer","SelectTriggerButton","ariaDescribedBy","passedInStyle","toggleButtonProps","cursor","TabsOrientation","StyledNativeSelect","NativeSelect","TabsContainerContext","createContext","activeTabIndex","isInverseContainer","setActiveTabIndex","StyledTabsContainer","TabsContainer","forwardRef","setIsInverseContainer","StyledScrollButton","buttonVisible","orientation","StyledButtonPrev","transparentize","StyledButtonNext","ButtonPrev","ExpandLessIcon","ArrowBackIosIcon","ButtonNext","ExpandMoreIcon","ArrowForwardIosIcon","useTabsMeta","isRtl","scrollStart","clientSize","displayScroll","setDisplayScroll","tabsWrapperRef","prevButtonRef","nextButtonRef","scroll","scrollValue","requestAnimationFrame","step","timestamp","animate","moveTabsScroll","delta","updateScrollButtonState","showStartScroll","showEndScroll","scrollTop","scrollHeight","clientHeight","handleResize","handleTabsScroll","useCallback","handleStartScrollClick","handleEndScrollClick","TabsAlignment","TabsBorderPosition","TabsIconPosition","TabsContext","borderPosition","changeHandler","registerTabButton","StyledTabsWrapper","StyledTabs","Tabs","tabsMeta","tabsHandleMethods","tabsRefs","buttonRefArray","childrenWrapperRef","scrollSelectedIntoView","tabMeta","tabsNode","rect","getBoundingClientRect","scrollLeftNormalized","childrenArray","tab","getTabsMeta","prevButtonOffset","offsetHeight","offsetWidth","nextButtonOffset","nextScrollStart","tabIsEnabled","findPreviousEnabledTabIndex","modifiedActiveTabIndex","currentTabIndex","newActiveTabIndex","findNextEnabledTabIndex","lastChildIndex","onScroll","previousItemKey","nextItemKey","newActiveIndex","hasAttribute","useForceUpdate","setTick","tick","StyledTabsChild","TabStyles","getFlexDirection","StyledTab","isIconOnly","getIconMargin","Tab","forceUpdate","tabIconPosition","StyledTabPanel","TabPanel","TabPanelsContainer","Children","cloneElement","NavTabsContext","NavTabs","StyledCustomTab","newProps","component","jsx","NavTab","instanceOfNavChildrenTab","pageButtonTypeSize","buttonSize","boxShadowColor","hoverBoxShadowColor","PageButtonSize","StyledPageButton","BuildBorder","hoverBorder","PageButton","StyledNav","nav","BuildButtonSize","RadioTextPosition","NavButton","StyledEllipsis","ariaCurrent","PasswordInput","passwordShown","setPasswordShown","hiddenPasswordAnnounceText","hidePasswordButtonAriaLabel","hidePasswordButtonText","isPasswordMaskButtonHidden","shownPasswordAnnounceText","showPasswordButtonAriaLabel","showPasswordButtonText","HIDDEN_PASSWORD_ANNOUNCE_TEXT","HIDE_PASSWORD_BUTTON_ARIA_LABEL","HIDE_PASSWORD_BUTTON_TEXT","SHOWN_PASSWORD_ANNOUNCE_TEXT","SHOW_PASSWORD_BUTTON_ARIA_LABEL","SHOW_PASSWORD_BUTTON_TEXT","autoCorrect","autoCapitalize","prevPasswordShown","RadioContext","RadioGroup","selectedValue","setSelectedValue","newSelectedValue","buildErrorBorder","ModalSize","buildRadioIconColor","Radio","RadioButtonCheckedIcon","RadioButtonUncheckedIcon","Transition","unmountOnExit","initial","customTransition","shouldExpand","variants","acc","themeVariant","AnimatePresence","ModalContainer","ModalBackdrop","ModalContent","ModalHeader","H1","CloseBtn","ModalBody","Modal","bodyRef","headingId","contentId","isModalOpen","setIsModalOpen","setCurrentTarget","prevOpen","handleEscapeKeyDown","stopPropagation","onEscKeyDown","handleClose","isEscKeyDownDisabled","closeButtonSize","containerTransition","isBackgroundClickDisabled","isCloseButtonHidden","CloseIconButton","ReactDOM","createPortal","Global","getElementById","onMouseDown","getElementsByTagName","Search","onSearch","SearchIcon","handleSearch","NoItemsMessage","ItemsList","getMenuProps","itemToString","highlightedIndex","getItemProps","menuStyle","hasItems","otherDownshiftItemProps","itemProps","SelectContainerElement","InputMessageContainer","SelectContainer","getLabelProps","Select","defaultSelectedItem","innerRef","itemListMaxHeight","initialSelectedItem","onIsOpenChange","onKeyPress","onKeyUp","passedInSelectedItem","selectedItem","toggleButtonRef","getValidItem","itemToCheck","useSelect","changes","changedSelectedItem","setHighlightedIndex","stateReducer","state","actionAndChanges","stateChangeTypes","ToggleButtonKeyDownCharacter","getToggleButtonProps","openMenu","selectText","marginTop","marginBottom","MultiSelect","onRemoveSelectedItem","checkSelectedItemValidity","useMultipleSelection","initialSelectedItems","getSelectedItemProps","getDropdownProps","addSelectedItem","removeSelectedItem","getFilteredItems","unfilteredItems","selectProps","onSelectedItemChange","newSelectedItem","selectItem","tagName","nativeEvent","preventDownshiftDefault","preventKeyAction","multiSelectedItem","multiSelectedItemString","handleRemoveSelectedItem","instanceOfDefaultItemObject","SelectStateChangeTypes","MultipleSelectionStateChangeTypes","ComboBoxContainer","InputContainer","ComboboxInput","getComboboxProps","getInputProps","onInputKeyDown","onInputKeyPress","onInputKeyUp","setIsFocused","inputProps","useComboboxItems","defaultItems","afterInitialRender","allItems","displayItems","setDisplayItems","cleanItems","newItems","defaultOnInputValueChange","disableCreateItem","inputBaseValue","startsWith","inputValueInList","react_magma__created_item","InternalCombobox","newItemTransform","onInputValueChange","onItemCreated","isCreatedItem","updateItemsRef","useCombobox","changedIsOpen","createdItem","defaultNewItemTransform","setInputValue","InputKeyDownEnter","ItemClick","InputBlur","FunctionReset","MultiCombobox","comboboxProps","handleInputChange","selectedItemsContent","SpacerAxis","ComboboxStateChangeTypes","TARGET_ID","StyledSkipLink","positionLeft","positionTop","getHeight","axis","TagColor","TagSize","StyledSpacer","Spacer","both","buildLabelPadding","ToggleTextPosition","TagStyling","buildButtonTextColor","buildBoxShadow","buildTagPadding","onDelete","buildSvgOpacity","LabelWrap","Tag","StyledTag","CancelIcon","ToastsContext","toastsArray","bottomOffset","ToastsContainer","ToastWrapper","bottomOffsetForToast","bottomOffsetForContainer","Toast","timerAutoHide","setIsDismissed","setIsPaused","timerTimeRemaining","setTimerTimeRemaining","alertStyle","disableAutoDismiss","timerStartTime","now","containerElement","dismissToast","toastId","setAutoHideTimer","handlePause","timeRemaining","handleResume","calculateAndSetBottomOffsetForToast","updateBottomOffsetForToast","AccordionIconPosition","Thumb","IconContainer","renderLabelText","Toggle","trackStyle","thumbStyle","StyledTextArea","textarea","Textarea","textareaStyle","StyledAmPmToggle","AmPmToggle","InputsContainer","Divider","StyledNumInput","TimePicker","minutesStep","am","localize","dayPeriod","pm","hour","setHour","minute","setMinute","amPm","setAmPm","setTime","hourRef","minuteRef","amPmRef","updateTime","newTime","calculateHour","newHour","substring","toggleAmPm","newAmPm","passedInTime","amPmRegex","RegExp","split","timeHour","timeMinuteAndAmPm","timeMinute","timeAmPm","convertPassedInTime","hourId","minuteId","handleHourChange","handleMinuteChange","newMinute","calculateMinute","handleHourKeyDown","handleMinuteKeyDown","handleAmPmKeyDown","useTimePicker","hoursLabel","minutesLabel","amPmLabel","ScheduleIcon","maxLength","getStyles","AccordionContext","isMulti","registerAccordionButton","useAccordion","defaultIndex","onExpandedChange","expandedIndex","setExpandedIndex","contextValue","StyledAccordion","Accordion","AccordionItemContext","isDisabled","isExpanded","setIsExpanded","useAccordionItem","idPrefix","buttonId","panelId","newIsExpanded","AccordionItem","useAccordionButton","focusFirst","focusLast","handleKeyDown","arrLength","DrawerPosition","TextWrapper","AccordionButton","caret","StyledPanel","AccordionPanel","GridDisplay","GridJustifyItems","GridJustifyContent","GridAlignItems","GridAlignContent","GridItemJustifySelf","GridItemAlignSelf","GridAutoFlow","transitionPreset","Drawer","drawerStyle","Grid","gridDisplay","grid","gridTemplateRows","gridTemplateColumns","gridTemplateAreas","gridGap","gridJustifyItems","gridJustifyContent","gridAlignItems","gridAlignContent","gridAutoFlow","GridItem","gridColumn","gridRow","gridArea","gridItemJustifySelf","gridItemAlignSelf","BlockQuoteStyles","borderStyle","StyledBlockQuote","figure","BlockQuote","blockQuoteStyles","hasAttribution","StyledBlockQuoteItem","BlockQuoteItem","InternalSelect","targetAnchor","targetHeading","queryInput","query","supportMatchMedia","matchMedia","matches","match","setMatch","queryList","updateMatch"],"mappings":"isCAWO,ICwPDA,EAAY,CAChBC,OAAQ,CACNC,SAAU,OACVC,cAAe,QACfC,WAAY,QAEdC,OAAQ,CACNH,SAAU,OACVC,cAAe,QACfC,WAAY,QAEdE,OAAQ,CACNJ,SAAU,OACVE,WAAY,QAEdG,OAAQ,CACNL,SAAU,OACVE,WAAY,QAEdI,OAAQ,CACNN,SAAU,OACVE,WAAY,QAEdK,OAAQ,CACNP,SAAU,OACVE,WAAY,QAEdM,OAAQ,CACNR,SAAU,OACVE,WAAY,QAEdO,OAAQ,CACNT,SAAU,OACVE,WAAY,QAEdQ,OAAQ,CACNV,SAAU,OACVE,WAAY,QAEdS,OAAQ,CACNX,SAAU,OACVE,WAAY,QAEdU,OAAQ,CACNZ,SAAU,OACVE,WAAY,QAEdW,OAAQ,CACNb,SAAU,OACVE,WAAY,QAEdY,OAAQ,CACNd,SAAU,OACVE,WAAY,SAIVa,EAAS,C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