@pega/cosmos-react-core 2.0.0-rc.3 → 2.0.0-rc.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/AppShell/AppShell.d.ts.map +1 -1
- package/lib/components/AppShell/AppShell.js +4 -2
- package/lib/components/AppShell/AppShell.js.map +1 -1
- package/lib/components/AppShell/AppShellContext.d.ts +1 -0
- package/lib/components/AppShell/AppShellContext.d.ts.map +1 -1
- package/lib/components/AppShell/AppShellContext.js +8 -1
- package/lib/components/AppShell/AppShellContext.js.map +1 -1
- package/lib/components/AppShell/index.d.ts +1 -0
- package/lib/components/AppShell/index.d.ts.map +1 -1
- package/lib/components/AppShell/index.js +1 -0
- package/lib/components/AppShell/index.js.map +1 -1
- package/lib/components/Backdrop/index.d.ts +1 -2
- package/lib/components/Backdrop/index.d.ts.map +1 -1
- package/lib/components/Backdrop/index.js +1 -2
- package/lib/components/Backdrop/index.js.map +1 -1
- package/lib/components/Configuration/Configuration.js +1 -1
- package/lib/components/Configuration/Configuration.js.map +1 -1
- package/lib/components/DateTime/index.d.ts +1 -0
- package/lib/components/DateTime/index.d.ts.map +1 -1
- package/lib/components/DateTime/index.js +1 -0
- package/lib/components/DateTime/index.js.map +1 -1
- package/lib/components/ExpandCollapse/ExpandCollapse.js +1 -1
- package/lib/components/ExpandCollapse/ExpandCollapse.js.map +1 -1
- package/lib/components/FieldGroup/FieldGroupList.d.ts +1 -1
- package/lib/components/FieldGroup/FieldGroupList.d.ts.map +1 -1
- package/lib/components/FieldGroup/FieldGroupList.js +1 -1
- package/lib/components/FieldGroup/FieldGroupList.js.map +1 -1
- package/lib/components/FieldGroup/index.d.ts +1 -0
- package/lib/components/FieldGroup/index.d.ts.map +1 -1
- package/lib/components/FieldGroup/index.js +1 -0
- package/lib/components/FieldGroup/index.js.map +1 -1
- package/lib/components/File/index.d.ts +1 -0
- package/lib/components/File/index.d.ts.map +1 -1
- package/lib/components/File/index.js +1 -0
- package/lib/components/File/index.js.map +1 -1
- package/lib/components/Icon/index.d.ts +1 -0
- package/lib/components/Icon/index.d.ts.map +1 -1
- package/lib/components/Icon/index.js +1 -0
- package/lib/components/Icon/index.js.map +1 -1
- package/lib/components/Input/index.d.ts +1 -1
- package/lib/components/Input/index.d.ts.map +1 -1
- package/lib/components/Input/index.js.map +1 -1
- package/lib/components/Lightbox/Lightbox.styles.d.ts +1 -1
- package/lib/components/Lightbox/Lightbox.styles.d.ts.map +1 -1
- package/lib/components/Link/Link.d.ts.map +1 -1
- package/lib/components/Link/Link.js +7 -2
- package/lib/components/Link/Link.js.map +1 -1
- package/lib/components/Location/index.d.ts +4 -4
- package/lib/components/Location/index.d.ts.map +1 -1
- package/lib/components/Location/index.js.map +1 -1
- package/lib/components/Modal/Modal.d.ts.map +1 -1
- package/lib/components/Modal/Modal.js +8 -4
- package/lib/components/Modal/Modal.js.map +1 -1
- package/lib/components/Modal/Modal.styles.d.ts.map +1 -1
- package/lib/components/Modal/Modal.styles.js +0 -1
- package/lib/components/Modal/Modal.styles.js.map +1 -1
- package/lib/components/MultiStep/index.d.ts +1 -1
- package/lib/components/MultiStep/index.d.ts.map +1 -1
- package/lib/components/MultiStep/index.js.map +1 -1
- package/lib/components/PageTemplates/index.d.ts +2 -3
- package/lib/components/PageTemplates/index.d.ts.map +1 -1
- package/lib/components/PageTemplates/index.js +1 -1
- package/lib/components/PageTemplates/index.js.map +1 -1
- package/lib/components/Popover/Popover.js +1 -1
- package/lib/components/Popover/Popover.js.map +1 -1
- package/lib/components/SearchInput/SearchInput.d.ts +1 -1
- package/lib/components/SearchInput/SearchInput.d.ts.map +1 -1
- package/lib/components/Select/index.d.ts +2 -3
- package/lib/components/Select/index.d.ts.map +1 -1
- package/lib/components/Select/index.js.map +1 -1
- package/lib/components/Table/index.d.ts +1 -2
- package/lib/components/Table/index.d.ts.map +1 -1
- package/lib/components/Table/index.js.map +1 -1
- package/lib/components/TextArea/index.d.ts +1 -1
- package/lib/components/TextArea/index.d.ts.map +1 -1
- package/lib/components/TextArea/index.js.map +1 -1
- package/lib/components/Tree/index.d.ts +1 -1
- package/lib/components/Tree/index.d.ts.map +1 -1
- package/lib/components/Tree/index.js.map +1 -1
- package/lib/hooks/useI18n.d.ts +6 -0
- package/lib/hooks/useI18n.d.ts.map +1 -1
- package/lib/i18n/default.d.ts +6 -0
- package/lib/i18n/default.d.ts.map +1 -1
- package/lib/i18n/default.js +10 -1
- package/lib/i18n/default.js.map +1 -1
- package/lib/i18n/i18n.d.ts +12 -0
- package/lib/i18n/i18n.d.ts.map +1 -1
- package/lib/index.d.ts +2 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +2 -0
- package/lib/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppShell.d.ts","sourceRoot":"","sources":["../../../src/components/AppShell/AppShell.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EAWjB,EAAE,EAIH,MAAM,OAAO,CAAC;AAiBf,OAAO,KAAK,EAAE,YAAY,EAAc,MAAM,aAAa,CAAC;AA6C5D,OAAO,EACL,aAAa,EAOb,UAAU,EACX,MAAM,kBAAkB,CAAC;AAsR1B,eAAO,MAAM,KAAK,EAAE,EAAE,CAAC,UAAU,CAmGhC,CAAC;AAEF,QAAA,MAAM,QAAQ,EAAE,iBAAiB,CAAC,aAAa,GAAG,YAAY,
|
|
1
|
+
{"version":3,"file":"AppShell.d.ts","sourceRoot":"","sources":["../../../src/components/AppShell/AppShell.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EAWjB,EAAE,EAIH,MAAM,OAAO,CAAC;AAiBf,OAAO,KAAK,EAAE,YAAY,EAAc,MAAM,aAAa,CAAC;AA6C5D,OAAO,EACL,aAAa,EAOb,UAAU,EACX,MAAM,kBAAkB,CAAC;AAsR1B,eAAO,MAAM,KAAK,EAAE,EAAE,CAAC,UAAU,CAmGhC,CAAC;AAEF,QAAA,MAAM,QAAQ,EAAE,iBAAiB,CAAC,aAAa,GAAG,YAAY,CA0Q7D,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
|
@@ -259,6 +259,7 @@ const AppShell = forwardRef((props, ref) => {
|
|
|
259
259
|
caseTypes, links, banners, environment: { name: envName, color: envColor } = {}, main, operator, utils, cases, ...restProps } = props;
|
|
260
260
|
const { appName, portalName, href: appInfoHref, imageSrc: logoSrc, ...appInfoRestProps } = appInfo;
|
|
261
261
|
const t = useI18n();
|
|
262
|
+
const { start } = useDirection();
|
|
262
263
|
const theme = useTheme();
|
|
263
264
|
const navRef = useConsolidatedRef(ref);
|
|
264
265
|
const [drawerOpen, setDrawerOpen] = useState(false);
|
|
@@ -274,6 +275,7 @@ const AppShell = forwardRef((props, ref) => {
|
|
|
274
275
|
const showMainContent = showAppHeader ? headerEl || mobileHeaderEl : true;
|
|
275
276
|
const openNavTimeoutId = useRef();
|
|
276
277
|
const closeNavTimeoutId = useRef();
|
|
278
|
+
const previewTriggerRef = useRef(null);
|
|
277
279
|
const { state: navState, set: setNavState } = useTransitionState({
|
|
278
280
|
ref: navRef,
|
|
279
281
|
property: 'width',
|
|
@@ -340,7 +342,6 @@ const AppShell = forwardRef((props, ref) => {
|
|
|
340
342
|
alignItems: 'center',
|
|
341
343
|
areas: portalName ? '"logo app" "logo portal"' : '"logo app"'
|
|
342
344
|
}, children: [_jsx(Grid, { item: { area: 'logo' }, as: Image, src: logoSrc, alt: appName }, void 0), _jsx(Grid, { item: { area: 'app' }, as: 'span', children: appName }, void 0), portalName && (_jsx(Grid, { item: { area: 'portal' }, as: 'span', children: portalName }, void 0))] }, void 0)), searchInput && !showAppHeader && (_jsx(StyledSearchForm, { role: 'search', "aria-label": searchLabel, onSubmit: e => e.preventDefault(), children: _jsx(SearchInput, { ...searchInput }, void 0) }, void 0)), _jsxs(StyledScrollWrap, { children: [caseTypes && _jsx(CaseTypes, { caseTypes: caseTypes }, void 0), links && _jsx(Links, { links: links }, void 0), cases && _jsx(Cases, { cases: cases }, void 0)] }, void 0), _jsx(Utils, { appHeader: showAppHeader, operator: operator, items: utils }, void 0)] }, void 0));
|
|
343
|
-
const { start } = useDirection();
|
|
344
345
|
return (_jsxs(AppShellContext.Provider, { value: useMemo(() => ({
|
|
345
346
|
navOpen: mobileNavOpen || navState === 'open' || navState === 'opening',
|
|
346
347
|
navState,
|
|
@@ -349,7 +350,8 @@ const AppShell = forwardRef((props, ref) => {
|
|
|
349
350
|
refocusEl,
|
|
350
351
|
setRefocusEl,
|
|
351
352
|
focusedImperatively,
|
|
352
|
-
headerEl: headerEl || mobileHeaderEl
|
|
353
|
+
headerEl: headerEl || mobileHeaderEl,
|
|
354
|
+
previewTriggerRef
|
|
353
355
|
}), [navState, mobileNavOpen, drawerOpen, refocusEl, headerEl, mobileHeaderEl]), children: [_jsx(SkipNavigation, {}, void 0), showAppHeader && (_jsx(AppHeader, { ...appInfo, searchInput: searchInput, searchLabel: searchLabel, operator: operator, ref: setHeaderEl }, void 0)), isSmallOrAbove ? (appShellJSX) : (_jsxs(_Fragment, { children: [_jsx(Flex, { as: StyledMobileNav, container: { alignItems: 'center' }, ref: setMobileHeaderEl, children: _jsx(Button, { variant: 'simple', onClick: () => setMobileNavBackdrop(true), "aria-label": t('app_shell_open_nav'), icon: true, children: _jsx(Icon, { name: 'bars' }, void 0) }, void 0) }, void 0), _jsx(Backdrop, { open: mobileNavBackdrop, transitionSpeed: 'none', onAfterTransitionIn: () => setMobileNavOpen(true), onBeforeTransitionOut: () => setMobileNavOpen(false), onClick: e => {
|
|
354
356
|
if (e.currentTarget === e.target)
|
|
355
357
|
setMobileNavOpen(false);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppShell.js","sourceRoot":"","sources":["../../../src/components/AppShell/AppShell.tsx"],"names":[],"mappings":";;AAAA,OAAO,EAEL,UAAU,EAGV,QAAQ,EACR,WAAW,EACX,SAAS,EACT,OAAO,EAEP,UAAU,EACV,MAAM,EAIN,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AAC,cAAc,EAC1B,YAAY,EAAE,cAAc,CAAC,CAAC,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC,CAAC,cAAc,EAAE,YAAY,aAEnF,OAAO,IAAI,KAAC,kBAAkB,cAAE,OAAO,WAAsB,EAC7D,IAAI,YACS,CACjB,YACwB,CAC5B,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,QAAQ,CAAC","sourcesContent":["import {\n FunctionComponent,\n forwardRef,\n PropsWithoutRef,\n Ref,\n useState,\n useCallback,\n useEffect,\n useMemo,\n ElementType,\n useContext,\n useRef,\n FC,\n MouseEventHandler,\n MutableRefObject,\n useLayoutEffect\n} from 'react';\n\nimport Flex from '../Flex';\nimport Link from '../Link';\nimport Count from '../Badges/Count';\nimport BareButton from '../Button/BareButton';\nimport SearchInput from '../SearchInput';\nimport Icon, { registerIcon } from '../Icon';\nimport * as timesIcon from '../Icon/icons/times.icon';\nimport * as plusIcon from '../Icon/icons/plus.icon';\nimport * as caseSolidIcon from '../Icon/icons/case-solid.icon';\nimport * as barsIcon from '../Icon/icons/bars.icon';\nimport * as caretLeftIcon from '../Icon/icons/caret-left.icon';\nimport * as caretRightIcon from '../Icon/icons/caret-right.icon';\nimport Text from '../Text';\nimport Image from '../Image';\nimport ExpandCollapse from '../ExpandCollapse';\nimport type { ForwardProps, OmitStrict } from '../../types';\nimport {\n useFocusWithin,\n useI18n,\n useBreakpoint,\n useConsolidatedRef,\n useDirection,\n useTheme,\n useElement,\n useTransitionState\n} from '../../hooks';\nimport { openCloseStates } from '../../hooks/useTransitionState';\nimport Grid from '../Grid';\nimport Button from '../Button';\nimport Drawer from '../Drawer';\nimport type { PopoverProps } from '../Popover';\nimport Backdrop from '../Backdrop';\nimport { documentIsAvailable } from '../../utils';\n\nimport AppShellContext from './AppShellContext';\nimport AppShellDrawer from './Drawer';\nimport AppShellOperator from './Operator';\nimport AppHeader from './AppHeader';\nimport SkipNavigation from './SkipNavigation';\nimport {\n StyledAppNav,\n StyledAppInfo,\n StyledSearchForm,\n StyledCaseTypes,\n StyledScrollWrap,\n StyledUtils,\n StyledNavList,\n StyledNestedNavList,\n StyledNavListItem,\n StyledNavListMenuButton,\n StyledAppMain,\n StyledCaseClose,\n StyledAppShellNavIcon,\n StyledNavCasesList,\n StyledAppEnvironment,\n StyledBannerRegion,\n StyledCountIcon,\n StyledUtilIconCount,\n StyledMobileNav\n} from './AppShell.styles';\nimport {\n AppShellProps,\n CaseProps,\n CaseTypeProps,\n LinkProps,\n NavListItemProps,\n NavListProps,\n UtilItemProps,\n UtilsProps\n} from './AppShell.types';\n\nregisterIcon(timesIcon, plusIcon, caseSolidIcon, barsIcon, caretRightIcon, caretLeftIcon);\n\nconst NavComponents: {\n List: FunctionComponent<NavListProps>;\n ListItem: FunctionComponent<NavListItemProps>;\n} = {\n List(props: NavListProps) {\n const { items = [], nestedList, collapsed } = props;\n let Component: ElementType = StyledNavList;\n let fwdProps: {\n as?: ElementType;\n forwardedAs?: ElementType;\n nullWhenCollapsed?: boolean;\n transitionSpeed?: string;\n collapsed: boolean;\n } = {\n collapsed: !!collapsed\n };\n\n const {\n base: { animation }\n } = useTheme();\n\n if (nestedList) {\n fwdProps = {\n as: ExpandCollapse,\n forwardedAs: 'ul',\n nullWhenCollapsed: true,\n transitionSpeed: items.length >= 10 ? `calc(2 * ${animation.speed})` : animation.speed,\n ...fwdProps\n };\n\n Component = StyledNestedNavList;\n }\n\n return (\n <Component {...fwdProps}>\n {items?.map(item => (\n <NavComponents.ListItem {...item} key={item.id || item.primary} />\n ))}\n </Component>\n );\n },\n ListItem(props: NavListItemProps) {\n const { navOpen } = useContext(AppShellContext);\n const {\n visual,\n primary,\n secondary,\n href,\n onClick,\n items,\n collapseItems = false,\n dismissible = false,\n onDismiss,\n active,\n actions,\n forwardedRef,\n ...restProps\n } = props;\n\n const t = useI18n();\n\n const hasItems = Array.isArray(items) && items.length > 0;\n const compProps: {\n href?: string;\n variant?: string;\n onClick?: MouseEventHandler<HTMLAnchorElement | HTMLButtonElement | HTMLDivElement>;\n actions?: NavListItemProps['actions'];\n as?: ElementType<any>;\n popover?: OmitStrict<PopoverProps, 'show' | 'target' | 'children'>;\n } = {\n onClick,\n href\n };\n\n let Component: ElementType;\n\n if (actions) {\n Component = AppShellOperator;\n compProps.actions = actions;\n compProps.as = StyledNavListMenuButton;\n compProps.popover = {\n placement: 'right-end',\n modifiers: [\n {\n name: 'offset',\n options: { offset: [-12, -16] }\n },\n {\n name: 'flip',\n options: {\n boundary: documentIsAvailable ? document.body : undefined,\n fallbackPlacements: ['top-end']\n }\n }\n ]\n };\n } else if (href) {\n Component = Link;\n } else if (onClick) {\n Component = BareButton;\n } else {\n Component = 'div';\n }\n\n useEffect(() => {\n if (!navOpen && actions) {\n const node = document.getElementsByTagName('body')[0];\n const clickEvent = document.createEvent('MouseEvent');\n clickEvent.initEvent('mousedown', true, true);\n node.dispatchEvent(clickEvent);\n }\n }, [navOpen]);\n\n const { end } = useDirection();\n\n return (\n <StyledNavListItem\n {...restProps}\n key={primary}\n nestedListCollapsed={hasItems ? collapseItems : true}\n >\n {/* forwardedRef typed as 'any' due to ambiguity of Component element type */}\n <Component {...compProps} ref={forwardedRef as any}>\n {visual}\n {secondary ? (\n <Flex container={{ direction: 'column', alignItems: 'start' }}>\n <span>{primary}</span>\n <Text variant='secondary'>{secondary}</Text>\n </Flex>\n ) : (\n <span>{primary}</span>\n )}\n {(hasItems || actions) && <Icon name={`caret-${end}`} as={StyledAppShellNavIcon} />}\n </Component>\n {dismissible && (\n <Button\n icon\n variant='simple'\n as={StyledCaseClose}\n onClick={onDismiss}\n aria-label={t('dismiss_case')}\n >\n <Icon name='times' />\n </Button>\n )}\n {hasItems && (\n <NavComponents.List nestedList items={items} collapsed={!navOpen || collapseItems} />\n )}\n </StyledNavListItem>\n );\n }\n};\n\nconst CaseTypes: FunctionComponent<{ caseTypes: CaseTypeProps[] }> = ({\n caseTypes\n}: {\n caseTypes: CaseTypeProps[];\n}) => {\n const { navOpen } = useContext(AppShellContext);\n const [expanded, setExpanded] = useState(false);\n const t = useI18n();\n\n const toggleExpanded = useCallback(() => {\n setExpanded(state => !state);\n }, []);\n\n useEffect(() => {\n if (!navOpen) setExpanded(false);\n }, [navOpen]);\n const transformedCaseTypes = caseTypes.map(caseType => {\n return {\n ...caseType,\n primary: caseType.name\n };\n });\n return useMemo(\n () => (\n <StyledCaseTypes expanded={expanded && navOpen}>\n <NavComponents.List\n items={[\n {\n primary: t('app_shell_create'),\n visual: <Icon name='plus' as={StyledAppShellNavIcon} />,\n onClick: toggleExpanded,\n items: transformedCaseTypes,\n collapseItems: !expanded || !navOpen\n }\n ]}\n />\n </StyledCaseTypes>\n ),\n [expanded, navOpen, toggleExpanded, caseTypes]\n );\n};\n\nconst Links: FunctionComponent<{ links: LinkProps[] }> = (props: { links: LinkProps[] }) => {\n const { links } = props;\n const navLinksRef = useRef<NavListItemProps[]>([]);\n const [transformedLinks, setTransformedLinks] = useState<NavListItemProps[]>([]);\n\n const toggleExpanded = (id: string) => {\n const updatedLinks = navLinksRef.current.map(link => {\n if (link.id === id) return { ...link, collapseItems: !link.collapseItems };\n return { ...link };\n });\n setTransformedLinks(updatedLinks);\n };\n\n // TODO: Can this be a memo instead of a state and an effect?\n const mergedNavLinks = (items: LinkProps[]): NavListItemProps[] => {\n return items.map((link: LinkProps) => {\n return {\n ...link,\n primary: link.name,\n 'aria-current': link.active ? 'page' : null,\n visual: link.icon ? <Icon name={link.icon} as={StyledAppShellNavIcon} /> : null,\n onClick: link.links ? () => toggleExpanded(link.id) : link.onClick,\n items: link.links ? mergedNavLinks(link.links) : undefined,\n collapseItems: true\n };\n });\n };\n\n useEffect(() => {\n setTransformedLinks(mergedNavLinks(links));\n }, [links]);\n\n useEffect(() => {\n navLinksRef.current = transformedLinks;\n }, [transformedLinks]);\n\n return (\n <div>\n <NavComponents.List items={transformedLinks} />\n </div>\n );\n};\n\nconst Cases: FunctionComponent<{ cases: CaseProps[] }> = (props: { cases: CaseProps[] }) => {\n const { cases } = props;\n\n const setupCases = (items: CaseProps[]): NavListItemProps[] => {\n return items.map((item: CaseProps) => {\n const {\n id,\n primary,\n secondary,\n visual = <Icon name='case-solid' as={StyledAppShellNavIcon} />,\n active,\n onClick,\n onDismiss\n } = item;\n return {\n id,\n 'aria-current': active ? 'page' : undefined,\n primary,\n secondary,\n active: !!active,\n dismissible: true,\n onClick,\n onDismiss,\n visual\n };\n });\n };\n\n return (\n <StyledNavCasesList>\n <NavComponents.List items={setupCases(cases)} />\n </StyledNavCasesList>\n );\n};\n\n// TODO: Need to add back re-focus support to drawer.\nexport const Utils: FC<UtilsProps> = ({ operator, items, appHeader }) => {\n const { drawerOpen, setDrawerOpen, focusedImperatively } = useContext(AppShellContext);\n const [transformedLinks, setTransformedLinks] = useState<NavListItemProps[]>([]);\n const [item, setItem] = useState<UtilItemProps>();\n const [activeUtilItem, setActiveUtilItem] = useState('');\n const returnFocusRef: MutableRefObject<\n HTMLAnchorElement | HTMLDivElement | HTMLButtonElement | null\n > = useRef(null);\n\n const operatorInfo: NavListItemProps[] = useMemo(\n () =>\n appHeader\n ? []\n : [\n {\n primary: operator.name,\n visual: operator.avatar,\n actions: operator.actions\n }\n ],\n [appHeader, operator.name, operator.avatar, operator.actions]\n );\n\n // TODO: Can this be a memo instead of a state and an effect?\n const mergedUtilItems = (drawerItems: UtilItemProps[]): NavListItemProps[] => {\n return drawerItems?.map((drawerItem: UtilItemProps) => {\n return {\n onClick: e => {\n returnFocusRef.current = e.currentTarget;\n if (drawerItem.drawerView) {\n setItem(drawerItem);\n setActiveUtilItem(drawerItem.name);\n }\n },\n ...drawerItem,\n primary: drawerItem.name,\n visual: drawerItem.count ? (\n <StyledUtilIconCount>\n {drawerItem.visual}\n <Count as={StyledCountIcon} variant='urgent'>\n {drawerItem.count}\n </Count>\n </StyledUtilIconCount>\n ) : (\n drawerItem.visual\n )\n };\n });\n };\n\n useEffect(() => {\n if (items) {\n setTransformedLinks([...mergedUtilItems(items)!, ...operatorInfo]);\n } else {\n setTransformedLinks(operatorInfo);\n }\n }, [items, operatorInfo]);\n\n useEffect(() => {\n items?.forEach(uItem => {\n if (uItem.name === activeUtilItem) {\n setItem(uItem);\n }\n });\n }, [items]);\n\n useEffect(() => {\n if (item) setDrawerOpen(true);\n }, [item]);\n\n useEffect(() => {\n if (!drawerOpen) {\n setActiveUtilItem('');\n focusedImperatively.current = true;\n returnFocusRef?.current?.focus();\n }\n }, [drawerOpen]);\n\n return (\n <>\n <StyledUtils>\n <NavComponents.List\n // Pull onDrawerOpen and onDrawerClose off to avoid DOM passthrough warning.\n items={transformedLinks.map(({ onDrawerOpen, onDrawerClose, ...util }) => util)}\n />\n </StyledUtils>\n {item && (\n <AppShellDrawer\n content={item.drawerView}\n header={item.drawerHeader || item.name}\n onDrawerClose={() => {\n setItem(undefined);\n item.onDrawerClose?.();\n }}\n onDrawerOpen={item.onDrawerOpen}\n />\n )}\n </>\n );\n};\n\nconst AppShell: FunctionComponent<AppShellProps & ForwardProps> = forwardRef(\n (props: PropsWithoutRef<AppShellProps>, ref: Ref<HTMLDivElement>) => {\n const {\n appInfo,\n searchInput,\n appHeader,\n searchLabel = 'Sitewide', // FIXME: TR\n caseTypes,\n links,\n banners,\n environment: { name: envName, color: envColor } = {},\n main,\n operator,\n utils,\n cases,\n ...restProps\n } = props;\n const {\n appName,\n portalName,\n href: appInfoHref,\n imageSrc: logoSrc,\n ...appInfoRestProps\n } = appInfo;\n\n const t = useI18n();\n const theme = useTheme();\n const navRef = useConsolidatedRef(ref);\n const [drawerOpen, setDrawerOpen] = useState(false);\n const [mobileNavOpen, setMobileNavOpen] = useState(false);\n const [mobileNavBackdrop, setMobileNavBackdrop] = useState(false);\n const [refocusEl, setRefocusEl] = useState<HTMLButtonElement | null>(null);\n const focusedImperatively = useRef(false);\n const [headerEl, setHeaderEl] = useElement<HTMLDivElement>();\n const [mobileHeaderEl, setMobileHeaderEl] = useElement<HTMLDivElement>();\n const isXlOrAbove = useBreakpoint('xl');\n const isSmallOrAbove = useBreakpoint('sm');\n\n const showAppHeader = !!appHeader && isSmallOrAbove;\n const showMainContent = showAppHeader ? headerEl || mobileHeaderEl : true;\n const openNavTimeoutId = useRef<ReturnType<typeof setTimeout>>();\n const closeNavTimeoutId = useRef<ReturnType<typeof setTimeout>>();\n\n const { state: navState, set: setNavState } = useTransitionState({\n ref: navRef,\n property: 'width',\n states: openCloseStates,\n defaultState: isXlOrAbove ? 'open' : 'closed'\n });\n\n const openNav = useCallback((delay: number = 0) => {\n if (closeNavTimeoutId.current) clearTimeout(closeNavTimeoutId.current);\n openNavTimeoutId.current = setTimeout(() => {\n setNavState('open');\n }, delay);\n }, []);\n\n const closeNav = useCallback((delay: number = 0) => {\n if (openNavTimeoutId.current) clearTimeout(openNavTimeoutId.current);\n closeNavTimeoutId.current = setTimeout(() => {\n setNavState('closed');\n }, delay);\n }, []);\n\n const onFocus = useCallback(() => {\n if (!focusedImperatively.current && isSmallOrAbove) openNav();\n focusedImperatively.current = false;\n }, [openNav, isSmallOrAbove]);\n\n const onKeydown = useCallback(({ key }: KeyboardEvent) => {\n if (key === 'Escape') setMobileNavOpen(false);\n }, []);\n\n useFocusWithin<HTMLElement>(\n [navRef],\n useCallback(\n (isFocused: boolean, navElement: Element | null) => {\n if (!isFocused && !navElement?.matches(':hover')) closeNav();\n },\n [closeNav]\n )\n );\n\n useLayoutEffect(() => {\n if (isXlOrAbove) {\n openNav();\n } else {\n closeNav();\n }\n }, [isXlOrAbove]);\n\n useEffect(() => {\n if (navState === 'closed' || navState === 'closing') setDrawerOpen(false);\n }, [navState]);\n\n useEffect(() => {\n if (mobileNavOpen) {\n document.addEventListener('keydown', onKeydown);\n return () => {\n document.removeEventListener('keydown', onKeydown);\n };\n }\n }, [mobileNavOpen]);\n\n useEffect(() => {\n if (isSmallOrAbove && mobileNavOpen) {\n setMobileNavBackdrop(false);\n setMobileNavOpen(false);\n }\n }, [isSmallOrAbove, mobileNavOpen]);\n\n const appShellJSX = (\n <Flex\n {...restProps}\n container={{\n direction: 'column',\n justify: 'between'\n }}\n ref={navRef}\n as={StyledAppNav}\n appHeader={showAppHeader}\n navOpen={mobileNavOpen}\n showEnv={!!envName}\n onFocus={onFocus}\n onMouseEnter={isSmallOrAbove && !isXlOrAbove ? () => openNav(200) : undefined}\n onMouseLeave={isSmallOrAbove && !isXlOrAbove ? () => closeNav(200) : undefined}\n >\n {envName && (\n <StyledAppEnvironment\n item={{ shrink: 0 }}\n color={envColor ?? theme.base.colors.red['extra-light']}\n >\n {envName}\n </StyledAppEnvironment>\n )}\n {!showAppHeader && (\n <StyledAppInfo\n as={Grid}\n forwardedAs={appInfoHref ? (Link as any) : 'div'}\n href={appInfoHref}\n aria-label={`${appName}${portalName ? ` - ${portalName}` : ''}`}\n {...appInfoRestProps}\n container={{\n alignItems: 'center',\n areas: portalName ? '\"logo app\" \"logo portal\"' : '\"logo app\"'\n }}\n >\n <Grid item={{ area: 'logo' }} as={Image} src={logoSrc} alt={appName} />\n <Grid item={{ area: 'app' }} as='span'>\n {appName}\n </Grid>\n {portalName && (\n <Grid item={{ area: 'portal' }} as='span'>\n {portalName}\n </Grid>\n )}\n </StyledAppInfo>\n )}\n\n {searchInput && !showAppHeader && (\n <StyledSearchForm\n role='search'\n aria-label={searchLabel}\n onSubmit={e => e.preventDefault()}\n >\n <SearchInput {...searchInput} />\n </StyledSearchForm>\n )}\n\n <StyledScrollWrap>\n {caseTypes && <CaseTypes caseTypes={caseTypes} />}\n {links && <Links links={links} />}\n {cases && <Cases cases={cases} />}\n </StyledScrollWrap>\n\n <Utils appHeader={showAppHeader} operator={operator} items={utils} />\n </Flex>\n );\n\n const { start } = useDirection();\n\n return (\n <AppShellContext.Provider\n value={useMemo(\n () => ({\n navOpen: mobileNavOpen || navState === 'open' || navState === 'opening',\n navState,\n drawerOpen,\n setDrawerOpen,\n refocusEl,\n setRefocusEl,\n focusedImperatively,\n headerEl: headerEl || mobileHeaderEl\n }),\n [navState, mobileNavOpen, drawerOpen, refocusEl, headerEl, mobileHeaderEl]\n )}\n >\n <SkipNavigation />\n {showAppHeader && (\n <AppHeader\n {...appInfo}\n searchInput={searchInput}\n searchLabel={searchLabel}\n operator={operator}\n ref={setHeaderEl}\n />\n )}\n\n {isSmallOrAbove ? (\n appShellJSX\n ) : (\n <>\n <Flex as={StyledMobileNav} container={{ alignItems: 'center' }} ref={setMobileHeaderEl}>\n <Button\n variant='simple'\n onClick={() => setMobileNavBackdrop(true)}\n aria-label={t('app_shell_open_nav')}\n icon\n >\n <Icon name='bars' />\n </Button>\n </Flex>\n\n <Backdrop\n open={mobileNavBackdrop}\n transitionSpeed='none'\n onAfterTransitionIn={() => setMobileNavOpen(true)}\n onBeforeTransitionOut={() => setMobileNavOpen(false)}\n onClick={e => {\n if (e.currentTarget === e.target) setMobileNavOpen(false);\n }}\n >\n <Drawer\n open={mobileNavOpen}\n onAfterClose={() => {\n setMobileNavBackdrop(false);\n }}\n position='fixed'\n placement={start}\n size='min(18.75rem, calc(100vw - 3.5rem))'\n nullWhenClosed\n >\n {appShellJSX}\n </Drawer>\n </Backdrop>\n </>\n )}\n {showMainContent && (\n <StyledAppMain\n tabIndex={-1}\n appHeader={showAppHeader}\n mobileNav={!isSmallOrAbove}\n headerOffset={isSmallOrAbove ? headerEl?.offsetHeight : mobileHeaderEl?.offsetHeight}\n >\n {banners && <StyledBannerRegion>{banners}</StyledBannerRegion>}\n {main}\n </StyledAppMain>\n )}\n </AppShellContext.Provider>\n );\n }\n);\n\nexport default AppShell;\n"]}
|
|
1
|
+
{"version":3,"file":"AppShell.js","sourceRoot":"","sources":["../../../src/components/AppShell/AppShell.tsx"],"names":[],"mappings":";;AAAA,OAAO,EAEL,UAAU,EAGV,QAAQ,EACR,WAAW,EACX,SAAS,EACT,OAAO,EAEP,UAAU,EACV,MAAM,EAIN,eAAe,EAChB,MAAM,OAAO,CAAC;AAEf,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,IAAI,MAAM,SAAS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,EAAE,cAAc,CAAC,CAAC,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC,CAAC,cAAc,EAAE,YAAY,aAEnF,OAAO,IAAI,KAAC,kBAAkB,cAAE,OAAO,WAAsB,EAC7D,IAAI,YACS,CACjB,YACwB,CAC5B,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,QAAQ,CAAC","sourcesContent":["import {\n FunctionComponent,\n forwardRef,\n PropsWithoutRef,\n Ref,\n useState,\n useCallback,\n useEffect,\n useMemo,\n ElementType,\n useContext,\n useRef,\n FC,\n MouseEventHandler,\n MutableRefObject,\n useLayoutEffect\n} from 'react';\n\nimport Flex from '../Flex';\nimport Link from '../Link';\nimport Count from '../Badges/Count';\nimport BareButton from '../Button/BareButton';\nimport SearchInput from '../SearchInput';\nimport Icon, { registerIcon } from '../Icon';\nimport * as timesIcon from '../Icon/icons/times.icon';\nimport * as plusIcon from '../Icon/icons/plus.icon';\nimport * as caseSolidIcon from '../Icon/icons/case-solid.icon';\nimport * as barsIcon from '../Icon/icons/bars.icon';\nimport * as caretLeftIcon from '../Icon/icons/caret-left.icon';\nimport * as caretRightIcon from '../Icon/icons/caret-right.icon';\nimport Text from '../Text';\nimport Image from '../Image';\nimport ExpandCollapse from '../ExpandCollapse';\nimport type { ForwardProps, OmitStrict } from '../../types';\nimport {\n useFocusWithin,\n useI18n,\n useBreakpoint,\n useConsolidatedRef,\n useDirection,\n useTheme,\n useElement,\n useTransitionState\n} from '../../hooks';\nimport { openCloseStates } from '../../hooks/useTransitionState';\nimport Grid from '../Grid';\nimport Button from '../Button';\nimport Drawer from '../Drawer';\nimport type { PopoverProps } from '../Popover';\nimport Backdrop from '../Backdrop';\nimport { documentIsAvailable } from '../../utils';\n\nimport AppShellContext from './AppShellContext';\nimport AppShellDrawer from './Drawer';\nimport AppShellOperator from './Operator';\nimport AppHeader from './AppHeader';\nimport SkipNavigation from './SkipNavigation';\nimport {\n StyledAppNav,\n StyledAppInfo,\n StyledSearchForm,\n StyledCaseTypes,\n StyledScrollWrap,\n StyledUtils,\n StyledNavList,\n StyledNestedNavList,\n StyledNavListItem,\n StyledNavListMenuButton,\n StyledAppMain,\n StyledCaseClose,\n StyledAppShellNavIcon,\n StyledNavCasesList,\n StyledAppEnvironment,\n StyledBannerRegion,\n StyledCountIcon,\n StyledUtilIconCount,\n StyledMobileNav\n} from './AppShell.styles';\nimport {\n AppShellProps,\n CaseProps,\n CaseTypeProps,\n LinkProps,\n NavListItemProps,\n NavListProps,\n UtilItemProps,\n UtilsProps\n} from './AppShell.types';\n\nregisterIcon(timesIcon, plusIcon, caseSolidIcon, barsIcon, caretRightIcon, caretLeftIcon);\n\nconst NavComponents: {\n List: FunctionComponent<NavListProps>;\n ListItem: FunctionComponent<NavListItemProps>;\n} = {\n List(props: NavListProps) {\n const { items = [], nestedList, collapsed } = props;\n let Component: ElementType = StyledNavList;\n let fwdProps: {\n as?: ElementType;\n forwardedAs?: ElementType;\n nullWhenCollapsed?: boolean;\n transitionSpeed?: string;\n collapsed: boolean;\n } = {\n collapsed: !!collapsed\n };\n\n const {\n base: { animation }\n } = useTheme();\n\n if (nestedList) {\n fwdProps = {\n as: ExpandCollapse,\n forwardedAs: 'ul',\n nullWhenCollapsed: true,\n transitionSpeed: items.length >= 10 ? `calc(2 * ${animation.speed})` : animation.speed,\n ...fwdProps\n };\n\n Component = StyledNestedNavList;\n }\n\n return (\n <Component {...fwdProps}>\n {items?.map(item => (\n <NavComponents.ListItem {...item} key={item.id || item.primary} />\n ))}\n </Component>\n );\n },\n ListItem(props: NavListItemProps) {\n const { navOpen } = useContext(AppShellContext);\n const {\n visual,\n primary,\n secondary,\n href,\n onClick,\n items,\n collapseItems = false,\n dismissible = false,\n onDismiss,\n active,\n actions,\n forwardedRef,\n ...restProps\n } = props;\n\n const t = useI18n();\n\n const hasItems = Array.isArray(items) && items.length > 0;\n const compProps: {\n href?: string;\n variant?: string;\n onClick?: MouseEventHandler<HTMLAnchorElement | HTMLButtonElement | HTMLDivElement>;\n actions?: NavListItemProps['actions'];\n as?: ElementType<any>;\n popover?: OmitStrict<PopoverProps, 'show' | 'target' | 'children'>;\n } = {\n onClick,\n href\n };\n\n let Component: ElementType;\n\n if (actions) {\n Component = AppShellOperator;\n compProps.actions = actions;\n compProps.as = StyledNavListMenuButton;\n compProps.popover = {\n placement: 'right-end',\n modifiers: [\n {\n name: 'offset',\n options: { offset: [-12, -16] }\n },\n {\n name: 'flip',\n options: {\n boundary: documentIsAvailable ? document.body : undefined,\n fallbackPlacements: ['top-end']\n }\n }\n ]\n };\n } else if (href) {\n Component = Link;\n } else if (onClick) {\n Component = BareButton;\n } else {\n Component = 'div';\n }\n\n useEffect(() => {\n if (!navOpen && actions) {\n const node = document.getElementsByTagName('body')[0];\n const clickEvent = document.createEvent('MouseEvent');\n clickEvent.initEvent('mousedown', true, true);\n node.dispatchEvent(clickEvent);\n }\n }, [navOpen]);\n\n const { end } = useDirection();\n\n return (\n <StyledNavListItem\n {...restProps}\n key={primary}\n nestedListCollapsed={hasItems ? collapseItems : true}\n >\n {/* forwardedRef typed as 'any' due to ambiguity of Component element type */}\n <Component {...compProps} ref={forwardedRef as any}>\n {visual}\n {secondary ? (\n <Flex container={{ direction: 'column', alignItems: 'start' }}>\n <span>{primary}</span>\n <Text variant='secondary'>{secondary}</Text>\n </Flex>\n ) : (\n <span>{primary}</span>\n )}\n {(hasItems || actions) && <Icon name={`caret-${end}`} as={StyledAppShellNavIcon} />}\n </Component>\n {dismissible && (\n <Button\n icon\n variant='simple'\n as={StyledCaseClose}\n onClick={onDismiss}\n aria-label={t('dismiss_case')}\n >\n <Icon name='times' />\n </Button>\n )}\n {hasItems && (\n <NavComponents.List nestedList items={items} collapsed={!navOpen || collapseItems} />\n )}\n </StyledNavListItem>\n );\n }\n};\n\nconst CaseTypes: FunctionComponent<{ caseTypes: CaseTypeProps[] }> = ({\n caseTypes\n}: {\n caseTypes: CaseTypeProps[];\n}) => {\n const { navOpen } = useContext(AppShellContext);\n const [expanded, setExpanded] = useState(false);\n const t = useI18n();\n\n const toggleExpanded = useCallback(() => {\n setExpanded(state => !state);\n }, []);\n\n useEffect(() => {\n if (!navOpen) setExpanded(false);\n }, [navOpen]);\n const transformedCaseTypes = caseTypes.map(caseType => {\n return {\n ...caseType,\n primary: caseType.name\n };\n });\n return useMemo(\n () => (\n <StyledCaseTypes expanded={expanded && navOpen}>\n <NavComponents.List\n items={[\n {\n primary: t('app_shell_create'),\n visual: <Icon name='plus' as={StyledAppShellNavIcon} />,\n onClick: toggleExpanded,\n items: transformedCaseTypes,\n collapseItems: !expanded || !navOpen\n }\n ]}\n />\n </StyledCaseTypes>\n ),\n [expanded, navOpen, toggleExpanded, caseTypes]\n );\n};\n\nconst Links: FunctionComponent<{ links: LinkProps[] }> = (props: { links: LinkProps[] }) => {\n const { links } = props;\n const navLinksRef = useRef<NavListItemProps[]>([]);\n const [transformedLinks, setTransformedLinks] = useState<NavListItemProps[]>([]);\n\n const toggleExpanded = (id: string) => {\n const updatedLinks = navLinksRef.current.map(link => {\n if (link.id === id) return { ...link, collapseItems: !link.collapseItems };\n return { ...link };\n });\n setTransformedLinks(updatedLinks);\n };\n\n // TODO: Can this be a memo instead of a state and an effect?\n const mergedNavLinks = (items: LinkProps[]): NavListItemProps[] => {\n return items.map((link: LinkProps) => {\n return {\n ...link,\n primary: link.name,\n 'aria-current': link.active ? 'page' : null,\n visual: link.icon ? <Icon name={link.icon} as={StyledAppShellNavIcon} /> : null,\n onClick: link.links ? () => toggleExpanded(link.id) : link.onClick,\n items: link.links ? mergedNavLinks(link.links) : undefined,\n collapseItems: true\n };\n });\n };\n\n useEffect(() => {\n setTransformedLinks(mergedNavLinks(links));\n }, [links]);\n\n useEffect(() => {\n navLinksRef.current = transformedLinks;\n }, [transformedLinks]);\n\n return (\n <div>\n <NavComponents.List items={transformedLinks} />\n </div>\n );\n};\n\nconst Cases: FunctionComponent<{ cases: CaseProps[] }> = (props: { cases: CaseProps[] }) => {\n const { cases } = props;\n\n const setupCases = (items: CaseProps[]): NavListItemProps[] => {\n return items.map((item: CaseProps) => {\n const {\n id,\n primary,\n secondary,\n visual = <Icon name='case-solid' as={StyledAppShellNavIcon} />,\n active,\n onClick,\n onDismiss\n } = item;\n return {\n id,\n 'aria-current': active ? 'page' : undefined,\n primary,\n secondary,\n active: !!active,\n dismissible: true,\n onClick,\n onDismiss,\n visual\n };\n });\n };\n\n return (\n <StyledNavCasesList>\n <NavComponents.List items={setupCases(cases)} />\n </StyledNavCasesList>\n );\n};\n\n// TODO: Need to add back re-focus support to drawer.\nexport const Utils: FC<UtilsProps> = ({ operator, items, appHeader }) => {\n const { drawerOpen, setDrawerOpen, focusedImperatively } = useContext(AppShellContext);\n const [transformedLinks, setTransformedLinks] = useState<NavListItemProps[]>([]);\n const [item, setItem] = useState<UtilItemProps>();\n const [activeUtilItem, setActiveUtilItem] = useState('');\n const returnFocusRef: MutableRefObject<\n HTMLAnchorElement | HTMLDivElement | HTMLButtonElement | null\n > = useRef(null);\n\n const operatorInfo: NavListItemProps[] = useMemo(\n () =>\n appHeader\n ? []\n : [\n {\n primary: operator.name,\n visual: operator.avatar,\n actions: operator.actions\n }\n ],\n [appHeader, operator.name, operator.avatar, operator.actions]\n );\n\n // TODO: Can this be a memo instead of a state and an effect?\n const mergedUtilItems = (drawerItems: UtilItemProps[]): NavListItemProps[] => {\n return drawerItems?.map((drawerItem: UtilItemProps) => {\n return {\n onClick: e => {\n returnFocusRef.current = e.currentTarget;\n if (drawerItem.drawerView) {\n setItem(drawerItem);\n setActiveUtilItem(drawerItem.name);\n }\n },\n ...drawerItem,\n primary: drawerItem.name,\n visual: drawerItem.count ? (\n <StyledUtilIconCount>\n {drawerItem.visual}\n <Count as={StyledCountIcon} variant='urgent'>\n {drawerItem.count}\n </Count>\n </StyledUtilIconCount>\n ) : (\n drawerItem.visual\n )\n };\n });\n };\n\n useEffect(() => {\n if (items) {\n setTransformedLinks([...mergedUtilItems(items)!, ...operatorInfo]);\n } else {\n setTransformedLinks(operatorInfo);\n }\n }, [items, operatorInfo]);\n\n useEffect(() => {\n items?.forEach(uItem => {\n if (uItem.name === activeUtilItem) {\n setItem(uItem);\n }\n });\n }, [items]);\n\n useEffect(() => {\n if (item) setDrawerOpen(true);\n }, [item]);\n\n useEffect(() => {\n if (!drawerOpen) {\n setActiveUtilItem('');\n focusedImperatively.current = true;\n returnFocusRef?.current?.focus();\n }\n }, [drawerOpen]);\n\n return (\n <>\n <StyledUtils>\n <NavComponents.List\n // Pull onDrawerOpen and onDrawerClose off to avoid DOM passthrough warning.\n items={transformedLinks.map(({ onDrawerOpen, onDrawerClose, ...util }) => util)}\n />\n </StyledUtils>\n {item && (\n <AppShellDrawer\n content={item.drawerView}\n header={item.drawerHeader || item.name}\n onDrawerClose={() => {\n setItem(undefined);\n item.onDrawerClose?.();\n }}\n onDrawerOpen={item.onDrawerOpen}\n />\n )}\n </>\n );\n};\n\nconst AppShell: FunctionComponent<AppShellProps & ForwardProps> = forwardRef(\n (props: PropsWithoutRef<AppShellProps>, ref: Ref<HTMLDivElement>) => {\n const {\n appInfo,\n searchInput,\n appHeader,\n searchLabel = 'Sitewide', // FIXME: TR\n caseTypes,\n links,\n banners,\n environment: { name: envName, color: envColor } = {},\n main,\n operator,\n utils,\n cases,\n ...restProps\n } = props;\n const {\n appName,\n portalName,\n href: appInfoHref,\n imageSrc: logoSrc,\n ...appInfoRestProps\n } = appInfo;\n\n const t = useI18n();\n const { start } = useDirection();\n const theme = useTheme();\n const navRef = useConsolidatedRef(ref);\n\n const [drawerOpen, setDrawerOpen] = useState(false);\n const [mobileNavOpen, setMobileNavOpen] = useState(false);\n const [mobileNavBackdrop, setMobileNavBackdrop] = useState(false);\n const [refocusEl, setRefocusEl] = useState<HTMLButtonElement | null>(null);\n\n const focusedImperatively = useRef(false);\n const [headerEl, setHeaderEl] = useElement<HTMLDivElement>();\n const [mobileHeaderEl, setMobileHeaderEl] = useElement<HTMLDivElement>();\n\n const isXlOrAbove = useBreakpoint('xl');\n const isSmallOrAbove = useBreakpoint('sm');\n\n const showAppHeader = !!appHeader && isSmallOrAbove;\n const showMainContent = showAppHeader ? headerEl || mobileHeaderEl : true;\n\n const openNavTimeoutId = useRef<ReturnType<typeof setTimeout>>();\n const closeNavTimeoutId = useRef<ReturnType<typeof setTimeout>>();\n const previewTriggerRef = useRef<HTMLElement>(null);\n\n const { state: navState, set: setNavState } = useTransitionState({\n ref: navRef,\n property: 'width',\n states: openCloseStates,\n defaultState: isXlOrAbove ? 'open' : 'closed'\n });\n\n const openNav = useCallback((delay: number = 0) => {\n if (closeNavTimeoutId.current) clearTimeout(closeNavTimeoutId.current);\n openNavTimeoutId.current = setTimeout(() => {\n setNavState('open');\n }, delay);\n }, []);\n\n const closeNav = useCallback((delay: number = 0) => {\n if (openNavTimeoutId.current) clearTimeout(openNavTimeoutId.current);\n closeNavTimeoutId.current = setTimeout(() => {\n setNavState('closed');\n }, delay);\n }, []);\n\n const onFocus = useCallback(() => {\n if (!focusedImperatively.current && isSmallOrAbove) openNav();\n focusedImperatively.current = false;\n }, [openNav, isSmallOrAbove]);\n\n const onKeydown = useCallback(({ key }: KeyboardEvent) => {\n if (key === 'Escape') setMobileNavOpen(false);\n }, []);\n\n useFocusWithin<HTMLElement>(\n [navRef],\n useCallback(\n (isFocused: boolean, navElement: Element | null) => {\n if (!isFocused && !navElement?.matches(':hover')) closeNav();\n },\n [closeNav]\n )\n );\n\n useLayoutEffect(() => {\n if (isXlOrAbove) {\n openNav();\n } else {\n closeNav();\n }\n }, [isXlOrAbove]);\n\n useEffect(() => {\n if (navState === 'closed' || navState === 'closing') setDrawerOpen(false);\n }, [navState]);\n\n useEffect(() => {\n if (mobileNavOpen) {\n document.addEventListener('keydown', onKeydown);\n return () => {\n document.removeEventListener('keydown', onKeydown);\n };\n }\n }, [mobileNavOpen]);\n\n useEffect(() => {\n if (isSmallOrAbove && mobileNavOpen) {\n setMobileNavBackdrop(false);\n setMobileNavOpen(false);\n }\n }, [isSmallOrAbove, mobileNavOpen]);\n\n const appShellJSX = (\n <Flex\n {...restProps}\n container={{\n direction: 'column',\n justify: 'between'\n }}\n ref={navRef}\n as={StyledAppNav}\n appHeader={showAppHeader}\n navOpen={mobileNavOpen}\n showEnv={!!envName}\n onFocus={onFocus}\n onMouseEnter={isSmallOrAbove && !isXlOrAbove ? () => openNav(200) : undefined}\n onMouseLeave={isSmallOrAbove && !isXlOrAbove ? () => closeNav(200) : undefined}\n >\n {envName && (\n <StyledAppEnvironment\n item={{ shrink: 0 }}\n color={envColor ?? theme.base.colors.red['extra-light']}\n >\n {envName}\n </StyledAppEnvironment>\n )}\n {!showAppHeader && (\n <StyledAppInfo\n as={Grid}\n forwardedAs={appInfoHref ? (Link as any) : 'div'}\n href={appInfoHref}\n aria-label={`${appName}${portalName ? ` - ${portalName}` : ''}`}\n {...appInfoRestProps}\n container={{\n alignItems: 'center',\n areas: portalName ? '\"logo app\" \"logo portal\"' : '\"logo app\"'\n }}\n >\n <Grid item={{ area: 'logo' }} as={Image} src={logoSrc} alt={appName} />\n <Grid item={{ area: 'app' }} as='span'>\n {appName}\n </Grid>\n {portalName && (\n <Grid item={{ area: 'portal' }} as='span'>\n {portalName}\n </Grid>\n )}\n </StyledAppInfo>\n )}\n\n {searchInput && !showAppHeader && (\n <StyledSearchForm\n role='search'\n aria-label={searchLabel}\n onSubmit={e => e.preventDefault()}\n >\n <SearchInput {...searchInput} />\n </StyledSearchForm>\n )}\n\n <StyledScrollWrap>\n {caseTypes && <CaseTypes caseTypes={caseTypes} />}\n {links && <Links links={links} />}\n {cases && <Cases cases={cases} />}\n </StyledScrollWrap>\n\n <Utils appHeader={showAppHeader} operator={operator} items={utils} />\n </Flex>\n );\n\n return (\n <AppShellContext.Provider\n value={useMemo(\n () => ({\n navOpen: mobileNavOpen || navState === 'open' || navState === 'opening',\n navState,\n drawerOpen,\n setDrawerOpen,\n refocusEl,\n setRefocusEl,\n focusedImperatively,\n headerEl: headerEl || mobileHeaderEl,\n previewTriggerRef\n }),\n [navState, mobileNavOpen, drawerOpen, refocusEl, headerEl, mobileHeaderEl]\n )}\n >\n <SkipNavigation />\n {showAppHeader && (\n <AppHeader\n {...appInfo}\n searchInput={searchInput}\n searchLabel={searchLabel}\n operator={operator}\n ref={setHeaderEl}\n />\n )}\n\n {isSmallOrAbove ? (\n appShellJSX\n ) : (\n <>\n <Flex as={StyledMobileNav} container={{ alignItems: 'center' }} ref={setMobileHeaderEl}>\n <Button\n variant='simple'\n onClick={() => setMobileNavBackdrop(true)}\n aria-label={t('app_shell_open_nav')}\n icon\n >\n <Icon name='bars' />\n </Button>\n </Flex>\n\n <Backdrop\n open={mobileNavBackdrop}\n transitionSpeed='none'\n onAfterTransitionIn={() => setMobileNavOpen(true)}\n onBeforeTransitionOut={() => setMobileNavOpen(false)}\n onClick={e => {\n if (e.currentTarget === e.target) setMobileNavOpen(false);\n }}\n >\n <Drawer\n open={mobileNavOpen}\n onAfterClose={() => {\n setMobileNavBackdrop(false);\n }}\n position='fixed'\n placement={start}\n size='min(18.75rem, calc(100vw - 3.5rem))'\n nullWhenClosed\n >\n {appShellJSX}\n </Drawer>\n </Backdrop>\n </>\n )}\n {showMainContent && (\n <StyledAppMain\n tabIndex={-1}\n appHeader={showAppHeader}\n mobileNav={!isSmallOrAbove}\n headerOffset={isSmallOrAbove ? headerEl?.offsetHeight : mobileHeaderEl?.offsetHeight}\n >\n {banners && <StyledBannerRegion>{banners}</StyledBannerRegion>}\n {main}\n </StyledAppMain>\n )}\n </AppShellContext.Provider>\n );\n }\n);\n\nexport default AppShell;\n"]}
|
|
@@ -9,6 +9,7 @@ interface AppShellContextValue {
|
|
|
9
9
|
setRefocusEl: (el: HTMLButtonElement | null) => void;
|
|
10
10
|
focusedImperatively: MutableRefObject<boolean>;
|
|
11
11
|
headerEl: HTMLDivElement | null;
|
|
12
|
+
previewTriggerRef: MutableRefObject<HTMLElement | null>;
|
|
12
13
|
}
|
|
13
14
|
export declare type DrawerContent = 'notifications' | 'recents';
|
|
14
15
|
declare const AppShellContext: import("react").Context<AppShellContextValue>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppShellContext.d.ts","sourceRoot":"","sources":["../../../src/components/AppShell/AppShellContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,gBAAgB,EAAE,MAAM,OAAO,CAAC;AAExD,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAEjE,UAAU,oBAAoB;IAC5B,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,OAAO,eAAe,CAAC,MAAM,OAAO,eAAe,CAAC,CAAC;IAC/D,UAAU,EAAE,OAAO,CAAC;IACpB,aAAa,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACvC,SAAS,EAAE,iBAAiB,GAAG,IAAI,CAAC;IACpC,YAAY,EAAE,CAAC,EAAE,EAAE,iBAAiB,GAAG,IAAI,KAAK,IAAI,CAAC;IACrD,mBAAmB,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAC;IAC/C,QAAQ,EAAE,cAAc,GAAG,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"AppShellContext.d.ts","sourceRoot":"","sources":["../../../src/components/AppShell/AppShellContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,gBAAgB,EAAE,MAAM,OAAO,CAAC;AAExD,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAEjE,UAAU,oBAAoB;IAC5B,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,OAAO,eAAe,CAAC,MAAM,OAAO,eAAe,CAAC,CAAC;IAC/D,UAAU,EAAE,OAAO,CAAC;IACpB,aAAa,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACvC,SAAS,EAAE,iBAAiB,GAAG,IAAI,CAAC;IACpC,YAAY,EAAE,CAAC,EAAE,EAAE,iBAAiB,GAAG,IAAI,KAAK,IAAI,CAAC;IACrD,mBAAmB,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAC;IAC/C,QAAQ,EAAE,cAAc,GAAG,IAAI,CAAC;IAChC,iBAAiB,EAAE,gBAAgB,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;CACzD;AAED,oBAAY,aAAa,GAAG,eAAe,GAAG,SAAS,CAAC;AAExD,QAAA,MAAM,eAAe,+CAoBnB,CAAC;AAEH,eAAe,eAAe,CAAC"}
|
|
@@ -11,7 +11,14 @@ const AppShellContext = createContext({
|
|
|
11
11
|
return false;
|
|
12
12
|
}
|
|
13
13
|
},
|
|
14
|
-
headerEl: null
|
|
14
|
+
headerEl: null,
|
|
15
|
+
previewTriggerRef: {
|
|
16
|
+
get current() {
|
|
17
|
+
return null;
|
|
18
|
+
},
|
|
19
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
20
|
+
set current(val) { }
|
|
21
|
+
}
|
|
15
22
|
});
|
|
16
23
|
export default AppShellContext;
|
|
17
24
|
//# sourceMappingURL=AppShellContext.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppShellContext.js","sourceRoot":"","sources":["../../../src/components/AppShell/AppShellContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAoB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"AppShellContext.js","sourceRoot":"","sources":["../../../src/components/AppShell/AppShellContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAoB,MAAM,OAAO,CAAC;AAkBxD,MAAM,eAAe,GAAG,aAAa,CAAuB;IAC1D,OAAO,EAAE,KAAK;IACd,QAAQ,EAAE,QAAQ;IAClB,UAAU,EAAE,KAAK;IACjB,aAAa,EAAE,GAAG,EAAE,GAAE,CAAC;IACvB,SAAS,EAAE,IAAI;IACf,YAAY,EAAE,GAAG,EAAE,GAAE,CAAC;IACtB,mBAAmB,EAAE;QACnB,IAAI,OAAO;YACT,OAAO,KAAK,CAAC;QACf,CAAC;KACF;IACD,QAAQ,EAAE,IAAI;IACd,iBAAiB,EAAE;QACjB,IAAI,OAAO;YACT,OAAO,IAAI,CAAC;QACd,CAAC;QACD,gEAAgE;QAChE,IAAI,OAAO,CAAC,GAAG,IAAG,CAAC;KACpB;CACF,CAAC,CAAC;AAEH,eAAe,eAAe,CAAC","sourcesContent":["import { createContext, MutableRefObject } from 'react';\n\nimport { openCloseStates } from '../../hooks/useTransitionState';\n\ninterface AppShellContextValue {\n navOpen: boolean;\n navState: typeof openCloseStates[keyof typeof openCloseStates];\n drawerOpen: boolean;\n setDrawerOpen: (open: boolean) => void;\n refocusEl: HTMLButtonElement | null;\n setRefocusEl: (el: HTMLButtonElement | null) => void;\n focusedImperatively: MutableRefObject<boolean>;\n headerEl: HTMLDivElement | null;\n previewTriggerRef: MutableRefObject<HTMLElement | null>;\n}\n\nexport type DrawerContent = 'notifications' | 'recents';\n\nconst AppShellContext = createContext<AppShellContextValue>({\n navOpen: false,\n navState: 'closed',\n drawerOpen: false,\n setDrawerOpen: () => {},\n refocusEl: null,\n setRefocusEl: () => {},\n focusedImperatively: {\n get current() {\n return false;\n }\n },\n headerEl: null,\n previewTriggerRef: {\n get current() {\n return null;\n },\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n set current(val) {}\n }\n});\n\nexport default AppShellContext;\n"]}
|
|
@@ -2,4 +2,5 @@ export { default } from './AppShell';
|
|
|
2
2
|
export { default as AppShellList, AppShellListProps } from './AppShellList';
|
|
3
3
|
export { AppHeaderProps, AppShellProps, AppShellDrawerProps, DrawerItemProps, DrawerListProps } from './AppShell.types';
|
|
4
4
|
export { default as SkipNavigation } from './SkipNavigation';
|
|
5
|
+
export { default as AppShellContext } from './AppShellContext';
|
|
5
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/AppShell/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAC5E,OAAO,EACL,cAAc,EACd,aAAa,EACb,mBAAmB,EACnB,eAAe,EACf,eAAe,EAChB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,kBAAkB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/AppShell/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAC5E,OAAO,EACL,cAAc,EACd,aAAa,EACb,mBAAmB,EACnB,eAAe,EACf,eAAe,EAChB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/AppShell/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,OAAO,IAAI,YAAY,EAAqB,MAAM,gBAAgB,CAAC;AAQ5E,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,kBAAkB,CAAC","sourcesContent":["export { default } from './AppShell';\nexport { default as AppShellList, AppShellListProps } from './AppShellList';\nexport {\n AppHeaderProps,\n AppShellProps,\n AppShellDrawerProps,\n DrawerItemProps,\n DrawerListProps\n} from './AppShell.types';\nexport { default as SkipNavigation } from './SkipNavigation';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/AppShell/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,OAAO,IAAI,YAAY,EAAqB,MAAM,gBAAgB,CAAC;AAQ5E,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC","sourcesContent":["export { default } from './AppShell';\nexport { default as AppShellList, AppShellListProps } from './AppShellList';\nexport {\n AppHeaderProps,\n AppShellProps,\n AppShellDrawerProps,\n DrawerItemProps,\n DrawerListProps\n} from './AppShell.types';\nexport { default as SkipNavigation } from './SkipNavigation';\nexport { default as AppShellContext } from './AppShellContext';\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Backdrop/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Backdrop/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Backdrop/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Backdrop/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAiB,cAAc,EAAE,MAAM,YAAY,CAAC","sourcesContent":["export { default, BackdropProps, StyledBackdrop } from './Backdrop';\n"]}
|
|
@@ -25,7 +25,7 @@ if (windowIsAvailable) {
|
|
|
25
25
|
if (!window[metaKey]) {
|
|
26
26
|
window[metaKey] = [];
|
|
27
27
|
}
|
|
28
|
-
window[metaKey].push({ version: '2.0.0-rc.
|
|
28
|
+
window[metaKey].push({ version: '2.0.0-rc.4' });
|
|
29
29
|
}
|
|
30
30
|
const Configuration = ({ context = ConfigurationContext, children, locale, direction, translations: customTranslations, theme, disableDefaultFontLoading, styleSheetTarget, portalTarget, overrideMap, renderNativeControls }) => {
|
|
31
31
|
const ctx = useContext(context);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Configuration.js","sourceRoot":"","sources":["../../../src/components/Configuration/Configuration.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,aAAa,EACb,UAAU,EAIV,OAAO,EACP,QAAQ,EACR,SAAS,EAEV,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAErE,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EACL,YAAY,EACZ,gBAAgB,EAGjB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,qBAAqB,EAGrB,kBAAkB,EAClB,SAAS,IAAI,iBAAiB,EAC/B,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAoD3F,MAAM,cAAc,GAAG,MAAM,CAAC,GAAG,CAAC,mDAAmD,CAAC,CAAC;AAcvF,MAAM,YAAY,GAAgC,EAAE,CAAC;AACrD,MAAM,aAAa,GAAG,oBAAoB,CAAC,CAAC,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC;AAEvE,MAAM,CAAC,MAAM,oBAAoB,GAAG,aAAa,CAA4B;IAC3E,CAAC,cAAc,CAAC,EAAE,KAAK;IACvB,MAAM,EAAE,aAAa;IACrB,SAAS,EAAE,iBAAiB,CAAC,aAAa,CAAC;IAC3C,YAAY,EAAE,kBAAkB;IAChC,YAAY,EAAE,gBAAgB;IAC9B,gBAAgB,EAAE,mBAAm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Aa,CAAC,YAAY,GAAG,YAAY,CAAC;AAE1C,eAAe,aAAa,CAAC","sourcesContent":["import {\n createContext,\n useContext,\n FunctionComponent,\n ComponentType,\n ReactNode,\n useMemo,\n useState,\n useEffect,\n Context\n} from 'react';\nimport { createPortal } from 'react-dom';\nimport { ThemeProvider, StyleSheetManager } from 'styled-components';\n\nimport { GlobalStyle } from '../../styles';\nimport {\n ThemeMachine,\n BaseThemeMachine,\n DefaultSettableTheme,\n DefaultThemeDefinition\n} from '../../theme';\nimport {\n createTranslationPack,\n Translation,\n TranslationPack,\n DefaultTranslation,\n direction as directionOfLocale\n} from '../../i18n';\nimport { FileInputProps } from '../File';\nimport { windowIsAvailable, navigatorIsAvailable, documentIsAvailable } from '../../utils';\n\nexport interface ConfigurationProps {\n /**\n * Any components or nodes that should be impacted by the settings applied by this Configuration component.\n */\n children: ReactNode;\n /**\n * Context to read previous configuration values from.\n */\n context?: Context<ConfigurationContextValue>;\n /**\n * User locale as defined in [BCP-47](https://www.techonthenet.com/js/language_tags.php).\n */\n locale?: string;\n /**\n * Override rendering direction of the document. Direction will be based on the locale if now provided.\n */\n direction?: 'ltr' | 'rtl';\n /**\n * Object with (partial) translations.\n */\n translations?: Translation;\n /**\n * Theme object used to override any or all Cosmos theme properties.\n */\n theme?: DefaultSettableTheme;\n /**\n * Disables loading Open Sans from Google Fonts. Only takes effect on the root configuration.\n */\n disableDefaultFontLoading?: boolean;\n /**\n * Target element for loading styles related to `styled-components`.\n */\n styleSheetTarget?: HTMLElement;\n /**\n * Target element for rendering a `ReactDOM` portal.\n */\n portalTarget?: Element;\n /**\n * Override map to replace Cosmos components.\n */\n overrideMap?: {\n FileInput?: ComponentType<FileInputProps>;\n };\n /**\n * Use native HTML5 controls for inputs instead of rich ones.\n * @default false\n */\n renderNativeControls?: boolean;\n}\n\nconst initializedKey = Symbol.for('@pega/cosmos-react-core.configuration.initialized');\n\nexport interface ConfigurationContextValue {\n [initializedKey]: boolean;\n locale: string;\n direction: ConfigurationProps['direction'];\n translations: TranslationPack;\n themeMachine: ThemeMachine<DefaultThemeDefinition>;\n styleSheetTarget?: HTMLElement;\n portalTarget?: Element;\n overrideMap: NonNullable<ConfigurationProps['overrideMap']>;\n renderNativeControls: boolean;\n}\n\nconst defaultProps: Partial<ConfigurationProps> = {};\nconst defaultLocale = navigatorIsAvailable ? navigator.language : 'en';\n\nexport const ConfigurationContext = createContext<ConfigurationContextValue>({\n [initializedKey]: false,\n locale: defaultLocale,\n direction: directionOfLocale(defaultLocale),\n translations: DefaultTranslation,\n themeMachine: BaseThemeMachine,\n styleSheetTarget: documentIsAvailable ? document.head : undefined,\n portalTarget: documentIsAvailable ? document.body : undefined,\n overrideMap: {},\n renderNativeControls: false\n});\n\nconst metaKey = Symbol.for('@pega/cosmos-react-core.metadata');\n\ninterface CosmosMetadata {\n version: string;\n}\n\ndeclare global {\n interface Window {\n [metaKey]: CosmosMetadata[];\n }\n}\n\nif (windowIsAvailable) {\n if (!window[metaKey]) {\n window[metaKey] = [];\n }\n\n window[metaKey].push({ version: '2.0.0-rc.
|
|
1
|
+
{"version":3,"file":"Configuration.js","sourceRoot":"","sources":["../../../src/components/Configuration/Configuration.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,aAAa,EACb,UAAU,EAIV,OAAO,EACP,QAAQ,EACR,SAAS,EAEV,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAErE,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EACL,YAAY,EACZ,gBAAgB,EAGjB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,qBAAqB,EAGrB,kBAAkB,EAClB,SAAS,IAAI,iBAAiB,EAC/B,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,aAA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AAY;YACZ,CAAC,cAAc,CAAC,EAAE,IAAI;YACtB,gBAAgB,EAAE,gBAAgB,IAAI,GAAG,CAAC,gBAAgB;YAC1D,YAAY,EAAE,YAAY,IAAI,GAAG,CAAC,YAAY;YAC9C,WAAW,EAAE,WAAW,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,CAAC,WAAW,EAAE,GAAG,WAAW,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,WAAW;YACnF,oBAAoB,EAAE,oBAAoB,IAAI,GAAG,CAAC,oBAAoB;SACvE,YAED,KAAC,aAAa,IAAC,KAAK,EAAE,YAAY,CAAC,KAAK,YAAG,eAAe,WAAiB,WAC7C,CACjC,CAAC;AACJ,CAAC,CAAC;AAEF,aAAa,CAAC,YAAY,GAAG,YAAY,CAAC;AAE1C,eAAe,aAAa,CAAC","sourcesContent":["import {\n createContext,\n useContext,\n FunctionComponent,\n ComponentType,\n ReactNode,\n useMemo,\n useState,\n useEffect,\n Context\n} from 'react';\nimport { createPortal } from 'react-dom';\nimport { ThemeProvider, StyleSheetManager } from 'styled-components';\n\nimport { GlobalStyle } from '../../styles';\nimport {\n ThemeMachine,\n BaseThemeMachine,\n DefaultSettableTheme,\n DefaultThemeDefinition\n} from '../../theme';\nimport {\n createTranslationPack,\n Translation,\n TranslationPack,\n DefaultTranslation,\n direction as directionOfLocale\n} from '../../i18n';\nimport { FileInputProps } from '../File';\nimport { windowIsAvailable, navigatorIsAvailable, documentIsAvailable } from '../../utils';\n\nexport interface ConfigurationProps {\n /**\n * Any components or nodes that should be impacted by the settings applied by this Configuration component.\n */\n children: ReactNode;\n /**\n * Context to read previous configuration values from.\n */\n context?: Context<ConfigurationContextValue>;\n /**\n * User locale as defined in [BCP-47](https://www.techonthenet.com/js/language_tags.php).\n */\n locale?: string;\n /**\n * Override rendering direction of the document. Direction will be based on the locale if now provided.\n */\n direction?: 'ltr' | 'rtl';\n /**\n * Object with (partial) translations.\n */\n translations?: Translation;\n /**\n * Theme object used to override any or all Cosmos theme properties.\n */\n theme?: DefaultSettableTheme;\n /**\n * Disables loading Open Sans from Google Fonts. Only takes effect on the root configuration.\n */\n disableDefaultFontLoading?: boolean;\n /**\n * Target element for loading styles related to `styled-components`.\n */\n styleSheetTarget?: HTMLElement;\n /**\n * Target element for rendering a `ReactDOM` portal.\n */\n portalTarget?: Element;\n /**\n * Override map to replace Cosmos components.\n */\n overrideMap?: {\n FileInput?: ComponentType<FileInputProps>;\n };\n /**\n * Use native HTML5 controls for inputs instead of rich ones.\n * @default false\n */\n renderNativeControls?: boolean;\n}\n\nconst initializedKey = Symbol.for('@pega/cosmos-react-core.configuration.initialized');\n\nexport interface ConfigurationContextValue {\n [initializedKey]: boolean;\n locale: string;\n direction: ConfigurationProps['direction'];\n translations: TranslationPack;\n themeMachine: ThemeMachine<DefaultThemeDefinition>;\n styleSheetTarget?: HTMLElement;\n portalTarget?: Element;\n overrideMap: NonNullable<ConfigurationProps['overrideMap']>;\n renderNativeControls: boolean;\n}\n\nconst defaultProps: Partial<ConfigurationProps> = {};\nconst defaultLocale = navigatorIsAvailable ? navigator.language : 'en';\n\nexport const ConfigurationContext = createContext<ConfigurationContextValue>({\n [initializedKey]: false,\n locale: defaultLocale,\n direction: directionOfLocale(defaultLocale),\n translations: DefaultTranslation,\n themeMachine: BaseThemeMachine,\n styleSheetTarget: documentIsAvailable ? document.head : undefined,\n portalTarget: documentIsAvailable ? document.body : undefined,\n overrideMap: {},\n renderNativeControls: false\n});\n\nconst metaKey = Symbol.for('@pega/cosmos-react-core.metadata');\n\ninterface CosmosMetadata {\n version: string;\n}\n\ndeclare global {\n interface Window {\n [metaKey]: CosmosMetadata[];\n }\n}\n\nif (windowIsAvailable) {\n if (!window[metaKey]) {\n window[metaKey] = [];\n }\n\n window[metaKey].push({ version: '2.0.0-rc.4' });\n}\n\nconst Configuration: FunctionComponent<ConfigurationProps> = ({\n context = ConfigurationContext,\n children,\n locale,\n direction,\n translations: customTranslations,\n theme,\n disableDefaultFontLoading,\n styleSheetTarget,\n portalTarget,\n overrideMap,\n renderNativeControls\n}: ConfigurationProps) => {\n const ctx = useContext(context);\n const themeMachine = theme\n ? new ThemeMachine<DefaultThemeDefinition>({ theme, parent: ctx.themeMachine })\n : ctx.themeMachine;\n const translations = useMemo(\n () => createTranslationPack({ ...ctx.translations, ...customTranslations }),\n [ctx.translations, customTranslations]\n );\n\n const [mounted, setMounted] = useState(false);\n\n useEffect(() => {\n setMounted(true);\n }, []);\n\n const wrappedChildren = ctx[initializedKey] ? (\n children\n ) : (\n <StyleSheetManager disableVendorPrefixes target={styleSheetTarget ?? ctx.styleSheetTarget}>\n <>\n {!disableDefaultFontLoading &&\n mounted &&\n documentIsAvailable &&\n createPortal(\n <link\n rel='stylesheet'\n href='https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,400;0,600;0,700;1,400;1,600;1,700&display=swap'\n />,\n document.head\n )}\n <GlobalStyle />\n {children}\n </>\n </StyleSheetManager>\n );\n return (\n <ConfigurationContext.Provider\n value={{\n locale: locale ?? ctx.locale,\n direction: direction ?? (locale !== undefined ? directionOfLocale(locale) : ctx.direction),\n translations,\n themeMachine,\n [initializedKey]: true,\n styleSheetTarget: styleSheetTarget ?? ctx.styleSheetTarget,\n portalTarget: portalTarget ?? ctx.portalTarget,\n overrideMap: overrideMap ? { ...ctx.overrideMap, ...overrideMap } : ctx.overrideMap,\n renderNativeControls: renderNativeControls ?? ctx.renderNativeControls\n }}\n >\n <ThemeProvider theme={themeMachine.theme}>{wrappedChildren}</ThemeProvider>\n </ConfigurationContext.Provider>\n );\n};\n\nConfiguration.defaultProps = defaultProps;\n\nexport default Configuration;\n"]}
|
|
@@ -10,6 +10,7 @@ export { default as DateRangeInput } from './Input/DateRangeInput';
|
|
|
10
10
|
export type { DateRangeInputProps } from './Input/DateRangeInput';
|
|
11
11
|
export { default as DurationInput } from './Input/Duration/DurationInput';
|
|
12
12
|
export type { default as DurationInputProps } from './Input/Duration/DurationInput.types';
|
|
13
|
+
export { Format } from './Input/Duration/DurationInput.types';
|
|
13
14
|
export { default as DateTimeInput } from './Input/DateTimeInput';
|
|
14
15
|
export type { DateTimeInputProps } from './Input/DateTimeInput';
|
|
15
16
|
export { default as DayOfWeekInput } from './Input/DayOfWeekInput';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/DateTime/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACzD,YAAY,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACzD,YAAY,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAC3D,YAAY,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACzD,YAAY,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACnE,YAAY,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAClE,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAC1E,YAAY,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAC1F,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACjE,YAAY,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACnE,YAAY,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAClE,OAAO,EAAE,OAAO,IAAI,YA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AAE,OAAO,IAAI,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAC1E,YAAY,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAC1F,OAAO,EAAE,MAAM,EAAE,MAAM,sCAAsC,CAAC;AAC9D,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACjE,YAAY,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACnE,YAAY,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAClE,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAC/D,YAAY,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAE9D,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAC5D,YAAY,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAC5D,YAAY,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAE5E,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC/D,YAAY,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC/D,YAAY,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -4,6 +4,7 @@ export { default as MonthInput } from './Input/MonthInput';
|
|
|
4
4
|
export { default as TimeInput } from './Input/TimeInput';
|
|
5
5
|
export { default as DateRangeInput } from './Input/DateRangeInput';
|
|
6
6
|
export { default as DurationInput } from './Input/Duration/DurationInput';
|
|
7
|
+
export { Format } from './Input/Duration/DurationInput.types';
|
|
7
8
|
export { default as DateTimeInput } from './Input/DateTimeInput';
|
|
8
9
|
export { default as DayOfWeekInput } from './Input/DayOfWeekInput';
|
|
9
10
|
export { default as QuarterInput } from './Input/QuarterInput';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/DateTime/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEzD,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEzD,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAE3D,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEzD,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAEnE,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAE1E,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAEjE,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAEnE,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAG/D,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAE5D,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAG5D,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAE/D,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC","sourcesContent":["export { default as DateInput } from './Input/DateInput';\nexport type { DateInputProps } from './Input/DateInput';\nexport { default as WeekInput } from './Input/WeekInput';\nexport type { WeekInputProps } from './Input/WeekInput';\nexport { default as MonthInput } from './Input/MonthInput';\nexport type { MonthInputProps } from './Input/MonthInput';\nexport { default as TimeInput } from './Input/TimeInput';\nexport type { TimeInputProps } from './Input/TimeInput';\nexport { default as DateRangeInput } from './Input/DateRangeInput';\nexport type { DateRangeInputProps } from './Input/DateRangeInput';\nexport { default as DurationInput } from './Input/Duration/DurationInput';\nexport type { default as DurationInputProps } from './Input/Duration/DurationInput.types';\nexport { default as DateTimeInput } from './Input/DateTimeInput';\nexport type { DateTimeInputProps } from './Input/DateTimeInput';\nexport { default as DayOfWeekInput } from './Input/DayOfWeekInput';\nexport type { DayOfWeekInputProps } from './Input/DayOfWeekInput';\nexport { default as QuarterInput } from './Input/QuarterInput';\nexport type { QuarterInputProps } from './Input/QuarterInput';\n\nexport { default as TimePicker } from './Picker/TimePicker';\nexport type { TimePickerProps } from './Picker/TimePicker';\nexport { default as DatePicker } from './Picker/DatePicker';\nexport type { default as DatePickerProps } from './Picker/DatePicker.types';\n\nexport { default as DateTimeDisplay } from './DateTimeDisplay';\nexport type { DateTimeDisplayProps } from './DateTimeDisplay';\nexport { default as DurationDisplay } from './DurationDisplay';\nexport type { DurationDisplayProps } from './DurationDisplay';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/DateTime/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEzD,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEzD,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAE3D,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEzD,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAEnE,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAE1E,OAAO,EAAE,MAAM,EAAE,MAAM,sCAAsC,CAAC;AAC9D,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAEjE,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAEnE,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAG/D,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAE5D,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAG5D,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAE/D,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC","sourcesContent":["export { default as DateInput } from './Input/DateInput';\nexport type { DateInputProps } from './Input/DateInput';\nexport { default as WeekInput } from './Input/WeekInput';\nexport type { WeekInputProps } from './Input/WeekInput';\nexport { default as MonthInput } from './Input/MonthInput';\nexport type { MonthInputProps } from './Input/MonthInput';\nexport { default as TimeInput } from './Input/TimeInput';\nexport type { TimeInputProps } from './Input/TimeInput';\nexport { default as DateRangeInput } from './Input/DateRangeInput';\nexport type { DateRangeInputProps } from './Input/DateRangeInput';\nexport { default as DurationInput } from './Input/Duration/DurationInput';\nexport type { default as DurationInputProps } from './Input/Duration/DurationInput.types';\nexport { Format } from './Input/Duration/DurationInput.types';\nexport { default as DateTimeInput } from './Input/DateTimeInput';\nexport type { DateTimeInputProps } from './Input/DateTimeInput';\nexport { default as DayOfWeekInput } from './Input/DayOfWeekInput';\nexport type { DayOfWeekInputProps } from './Input/DayOfWeekInput';\nexport { default as QuarterInput } from './Input/QuarterInput';\nexport type { QuarterInputProps } from './Input/QuarterInput';\n\nexport { default as TimePicker } from './Picker/TimePicker';\nexport type { TimePickerProps } from './Picker/TimePicker';\nexport { default as DatePicker } from './Picker/DatePicker';\nexport type { default as DatePickerProps } from './Picker/DatePicker.types';\n\nexport { default as DateTimeDisplay } from './DateTimeDisplay';\nexport type { DateTimeDisplayProps } from './DateTimeDisplay';\nexport { default as DurationDisplay } from './DurationDisplay';\nexport type { DurationDisplayProps } from './DurationDisplay';\n"]}
|
|
@@ -16,7 +16,7 @@ const getStyle = (props) => {
|
|
|
16
16
|
if (status === 'expanded' || status === 'collapsed') {
|
|
17
17
|
if (max || min) {
|
|
18
18
|
style[dimension] = status === 'expanded' ? maxSize : min || 0;
|
|
19
|
-
style
|
|
19
|
+
style[`overflow${dimension === 'width' ? 'X' : 'Y'}`] = 'hidden';
|
|
20
20
|
}
|
|
21
21
|
if (status === 'collapsed' && !nullWhenCollapsed && !min) {
|
|
22
22
|
style.display = 'none';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExpandCollapse.js","sourceRoot":"","sources":["../../../src/components/ExpandCollapse/ExpandCollapse.tsx"],"names":[],"mappings":";AAAA,OAAO,EAGL,UAAU,EAGV,QAAQ,EACR,eAAe,EACf,WAAW,EAEZ,MAAM,OAAO,CAAC;AAGf,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAwDxE,MAAM,aAAa,GAAG,CACpB,EAAe,EACf,SAAuD,EAC/C,EAAE;IACV,IAAI,CAAC,EAAE;QAAE,OAAO,EAAE,CAAC;IACnB,OAAO,SAAS,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,YAAY,IAAI,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,WAAW,IAAI,CAAC;AACjF,CAAC,CAAC;AAEF,MAAM,QAAQ,GAAG,CAAC,KAAoB,EAAiB,EAAE;IACvD,MAAM,EACJ,MAAM,EACN,SAAS,EACT,eAAe,EACf,wBAAwB,EACxB,GAAG,EACH,GAAG,EACH,iBAAiB,EACjB,EAAE,EACH,GAAG,KAAK,CAAC;IACV,MAAM,KAAK,GAAkB,EAAE,CAAC;IAChC,IAAI,OAAO,GAAG,GAAG,CAAC;IAElB,IAAI,EAAE,IAAI,CAAC,GAAG,EAAE;QACd,OAAO,GAAG,aAAa,CAA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cesContent":["import {\n FunctionComponent,\n Ref,\n forwardRef,\n ReactNode,\n PropsWithoutRef,\n useState,\n useLayoutEffect,\n useCallback,\n CSSProperties\n} from 'react';\n\nimport { ForwardProps, BaseProps, AsProp, PropsWithDefaults } from '../../types';\nimport { useConsolidatedRef, usePrevious, useTheme } from '../../hooks';\n\nexport interface ExpandCollapseProps extends AsProp, BaseProps {\n /** Content to expand/collapse. */\n children?: ReactNode;\n /**\n * If true,the content will be hidden.\n * @default false\n */\n collapsed?: boolean;\n /**\n * Used to determine the transition property.\n * @default \"height\"\n */\n dimension?: 'height' | 'width';\n /** Minimum height/width to collapse to. This will set the starting collapsed size as well. */\n min?: string;\n /** Maximum height/width to expand to. Expanded state will expanded up until, but not beyond, the natural height/width of the element. */\n max?: string;\n /** Callback fired after content collapsed. */\n onAfterCollapse?: () => void;\n /** Callback fired after content expanded. */\n onAfterExpand?: () => void;\n /** Callback fired before content collapsed. */\n onBeforeCollapse?: () => void;\n /** Callback fired before content expanded. */\n onBeforeExpand?: () => void;\n /**\n * Determine the speed of animation. This value comes from `theme.base.animation.speed`.\n * @default \"0.25s\"\n */\n transitionSpeed?: string;\n /**\n * If true, removes the component from the real DOM when collapsed. For full virtual DOM unmount(if necessary), perform at a parent level.\n * @default false\n */\n nullWhenCollapsed?: boolean;\n}\n\ntype ExpandCollapsePropsWithDefaults = PropsWithDefaults<\n ExpandCollapseProps,\n 'collapsed' | 'dimension' | 'transitionSpeed' | 'nullWhenCollapsed'\n>;\n\ntype Statuses = 'collapsed' | 'collapsing' | 'expanded' | 'expanding';\n\ninterface GetStyleProps\n extends Pick<\n ExpandCollapsePropsWithDefaults,\n 'dimension' | 'transitionSpeed' | 'min' | 'max' | 'nullWhenCollapsed'\n > {\n status: Statuses;\n el?: HTMLElement | null;\n transitionTimingFunction?: string;\n}\n\nconst getScrollSize = (\n el: HTMLElement,\n dimension: ExpandCollapsePropsWithDefaults['dimension']\n): string => {\n if (!el) return '';\n return dimension === 'height' ? `${el.scrollHeight}px` : `${el.scrollWidth}px`;\n};\n\nconst getStyle = (props: GetStyleProps): CSSProperties => {\n const {\n status,\n dimension,\n transitionSpeed,\n transitionTimingFunction,\n min,\n max,\n nullWhenCollapsed,\n el\n } = props;\n const style: CSSProperties = {};\n let maxSize = max;\n\n if (el && !max) {\n maxSize = getScrollSize(el, dimension!);\n }\n\n if (status === 'expanded' || status === 'collapsed') {\n if (max || min) {\n style[dimension as 'height' | 'width'] = status === 'expanded' ? maxSize : min || 0;\n style.overflow = 'hidden';\n }\n\n if (status === 'collapsed' && !nullWhenCollapsed && !min) {\n style.display = 'none';\n }\n }\n\n if (status === 'expanding' || status === 'collapsing') {\n style[dimension as 'height' | 'width'] = status === 'expanding' ? maxSize : min || 0;\n style.overflow = 'hidden';\n style.transitionProperty = dimension;\n style.transitionDuration = `max(${transitionSpeed}, 0.01ms)`;\n style.transitionTimingFunction = transitionTimingFunction;\n }\n\n return style;\n};\n\nconst ExpandCollapse: FunctionComponent<ExpandCollapseProps & ForwardProps> = forwardRef(\n (props: PropsWithoutRef<ExpandCollapseProps>, refArg: Ref<HTMLElement>) => {\n const {\n base: { animation: themeAnimation }\n } = useTheme();\n\n const {\n children,\n dimension = 'height',\n collapsed = false,\n onBeforeExpand,\n onAfterExpand,\n onBeforeCollapse,\n onAfterCollapse,\n transitionSpeed = themeAnimation.speed,\n min,\n max,\n nullWhenCollapsed = false,\n as: Tag = 'div',\n ...restProps\n } = props;\n\n const [status, setStatus] = useState<Statuses>(collapsed ? 'collapsed' : 'expanded');\n const styleStateHook = useState<CSSProperties>();\n const setStyle = styleStateHook[1];\n let style = styleStateHook[0];\n const previousStatus = usePrevious(status);\n const ref = useConsolidatedRef(refArg);\n\n const onTransitionEnd = useCallback(\n (e: TransitionEvent) => {\n if (e.target !== ref.current || e.propertyName !== dimension) return;\n setStatus(status === 'expanding' ? 'expanded' : 'collapsed');\n },\n [ref.current, status]\n );\n\n useLayoutEffect(() => {\n const wantsToCollapse = collapsed;\n const wantsToExpand = !collapsed;\n const canCollapse = ['expanded', 'expanding'].includes(status);\n const canExpand = ['collapsed', 'collapsing'].includes(status);\n\n if (wantsToExpand && canExpand) {\n onBeforeExpand?.();\n setStatus('expanding');\n } else if (wantsToCollapse && canCollapse) {\n onBeforeCollapse?.();\n setStatus('collapsing');\n }\n\n if (status === 'expanded' && previousStatus !== 'expanded') {\n onAfterExpand?.();\n } else if (status === 'collapsed' && previousStatus !== 'collapsed') {\n onAfterCollapse?.();\n }\n\n setStyle(\n getStyle({\n dimension,\n min,\n max,\n transitionSpeed,\n nullWhenCollapsed,\n status,\n el: ref.current,\n transitionTimingFunction: themeAnimation.timing.ease\n })\n );\n }, [collapsed, status, min, max]);\n\n if (status !== previousStatus && ['expanded', 'collapsed'].includes(previousStatus!)) {\n style = getStyle({\n dimension,\n min,\n max,\n transitionSpeed,\n nullWhenCollapsed,\n status: status === 'expanding' ? 'collapsing' : 'expanding',\n el: ref.current,\n transitionTimingFunction: themeAnimation.timing.ease\n });\n }\n\n return status === 'collapsed' && nullWhenCollapsed && !min ? null : (\n <Tag ref={ref} onTransitionEnd={onTransitionEnd} {...restProps} style={style}>\n {children}\n </Tag>\n );\n }\n);\n\nexport default ExpandCollapse;\n"]}
|
|
1
|
+
{"version":3,"file":"ExpandCollapse.js","sourceRoot":"","sources":["../../../src/components/ExpandCollapse/ExpandCollapse.tsx"],"names":[],"mappings":";AAAA,OAAO,EAGL,UAAU,EAGV,QAAQ,EACR,eAAe,EACf,WAAW,EAEZ,MAAM,OAAO,CAAC;AAGf,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAwDxE,MAAM,aAAa,GAAG,CACpB,EAAe,EACf,SAAuD,EAC/C,EAAE;IACV,IAAI,CAAC,EAAE;QAAE,OAAO,EAAE,CAAC;IACnB,OAAO,SAAS,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,YAAY,IAAI,CAAC,CAAC,CAAC,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AK,WAAW,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,WAAW;YAC3D,EAAE,EAAE,GAAG,CAAC,OAAO;YACf,wBAAwB,EAAE,cAAc,CAAC,MAAM,CAAC,IAAI;SACrD,CAAC,CAAC;KACJ;IAED,OAAO,MAAM,KAAK,WAAW,IAAI,iBAAiB,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAClE,KAAC,GAAG,IAAC,GAAG,EAAE,GAAG,EAAE,eAAe,EAAE,eAAe,KAAM,SAAS,EAAE,KAAK,EAAE,KAAK,YACzE,QAAQ,WACL,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,cAAc,CAAC","sourcesContent":["import {\n FunctionComponent,\n Ref,\n forwardRef,\n ReactNode,\n PropsWithoutRef,\n useState,\n useLayoutEffect,\n useCallback,\n CSSProperties\n} from 'react';\n\nimport { ForwardProps, BaseProps, AsProp, PropsWithDefaults } from '../../types';\nimport { useConsolidatedRef, usePrevious, useTheme } from '../../hooks';\n\nexport interface ExpandCollapseProps extends AsProp, BaseProps {\n /** Content to expand/collapse. */\n children?: ReactNode;\n /**\n * If true,the content will be hidden.\n * @default false\n */\n collapsed?: boolean;\n /**\n * Used to determine the transition property.\n * @default \"height\"\n */\n dimension?: 'height' | 'width';\n /** Minimum height/width to collapse to. This will set the starting collapsed size as well. */\n min?: string;\n /** Maximum height/width to expand to. Expanded state will expanded up until, but not beyond, the natural height/width of the element. */\n max?: string;\n /** Callback fired after content collapsed. */\n onAfterCollapse?: () => void;\n /** Callback fired after content expanded. */\n onAfterExpand?: () => void;\n /** Callback fired before content collapsed. */\n onBeforeCollapse?: () => void;\n /** Callback fired before content expanded. */\n onBeforeExpand?: () => void;\n /**\n * Determine the speed of animation. This value comes from `theme.base.animation.speed`.\n * @default \"0.25s\"\n */\n transitionSpeed?: string;\n /**\n * If true, removes the component from the real DOM when collapsed. For full virtual DOM unmount(if necessary), perform at a parent level.\n * @default false\n */\n nullWhenCollapsed?: boolean;\n}\n\ntype ExpandCollapsePropsWithDefaults = PropsWithDefaults<\n ExpandCollapseProps,\n 'collapsed' | 'dimension' | 'transitionSpeed' | 'nullWhenCollapsed'\n>;\n\ntype Statuses = 'collapsed' | 'collapsing' | 'expanded' | 'expanding';\n\ninterface GetStyleProps\n extends Pick<\n ExpandCollapsePropsWithDefaults,\n 'dimension' | 'transitionSpeed' | 'min' | 'max' | 'nullWhenCollapsed'\n > {\n status: Statuses;\n el?: HTMLElement | null;\n transitionTimingFunction?: string;\n}\n\nconst getScrollSize = (\n el: HTMLElement,\n dimension: ExpandCollapsePropsWithDefaults['dimension']\n): string => {\n if (!el) return '';\n return dimension === 'height' ? `${el.scrollHeight}px` : `${el.scrollWidth}px`;\n};\n\nconst getStyle = (props: GetStyleProps): CSSProperties => {\n const {\n status,\n dimension,\n transitionSpeed,\n transitionTimingFunction,\n min,\n max,\n nullWhenCollapsed,\n el\n } = props;\n const style: CSSProperties = {};\n let maxSize = max;\n\n if (el && !max) {\n maxSize = getScrollSize(el, dimension!);\n }\n\n if (status === 'expanded' || status === 'collapsed') {\n if (max || min) {\n style[dimension as 'height' | 'width'] = status === 'expanded' ? maxSize : min || 0;\n style[`overflow${dimension === 'width' ? 'X' : 'Y'}`] = 'hidden';\n }\n\n if (status === 'collapsed' && !nullWhenCollapsed && !min) {\n style.display = 'none';\n }\n }\n\n if (status === 'expanding' || status === 'collapsing') {\n style[dimension as 'height' | 'width'] = status === 'expanding' ? maxSize : min || 0;\n style.overflow = 'hidden';\n style.transitionProperty = dimension;\n style.transitionDuration = `max(${transitionSpeed}, 0.01ms)`;\n style.transitionTimingFunction = transitionTimingFunction;\n }\n\n return style;\n};\n\nconst ExpandCollapse: FunctionComponent<ExpandCollapseProps & ForwardProps> = forwardRef(\n (props: PropsWithoutRef<ExpandCollapseProps>, refArg: Ref<HTMLElement>) => {\n const {\n base: { animation: themeAnimation }\n } = useTheme();\n\n const {\n children,\n dimension = 'height',\n collapsed = false,\n onBeforeExpand,\n onAfterExpand,\n onBeforeCollapse,\n onAfterCollapse,\n transitionSpeed = themeAnimation.speed,\n min,\n max,\n nullWhenCollapsed = false,\n as: Tag = 'div',\n ...restProps\n } = props;\n\n const [status, setStatus] = useState<Statuses>(collapsed ? 'collapsed' : 'expanded');\n const styleStateHook = useState<CSSProperties>();\n const setStyle = styleStateHook[1];\n let style = styleStateHook[0];\n const previousStatus = usePrevious(status);\n const ref = useConsolidatedRef(refArg);\n\n const onTransitionEnd = useCallback(\n (e: TransitionEvent) => {\n if (e.target !== ref.current || e.propertyName !== dimension) return;\n setStatus(status === 'expanding' ? 'expanded' : 'collapsed');\n },\n [ref.current, status]\n );\n\n useLayoutEffect(() => {\n const wantsToCollapse = collapsed;\n const wantsToExpand = !collapsed;\n const canCollapse = ['expanded', 'expanding'].includes(status);\n const canExpand = ['collapsed', 'collapsing'].includes(status);\n\n if (wantsToExpand && canExpand) {\n onBeforeExpand?.();\n setStatus('expanding');\n } else if (wantsToCollapse && canCollapse) {\n onBeforeCollapse?.();\n setStatus('collapsing');\n }\n\n if (status === 'expanded' && previousStatus !== 'expanded') {\n onAfterExpand?.();\n } else if (status === 'collapsed' && previousStatus !== 'collapsed') {\n onAfterCollapse?.();\n }\n\n setStyle(\n getStyle({\n dimension,\n min,\n max,\n transitionSpeed,\n nullWhenCollapsed,\n status,\n el: ref.current,\n transitionTimingFunction: themeAnimation.timing.ease\n })\n );\n }, [collapsed, status, min, max]);\n\n if (status !== previousStatus && ['expanded', 'collapsed'].includes(previousStatus!)) {\n style = getStyle({\n dimension,\n min,\n max,\n transitionSpeed,\n nullWhenCollapsed,\n status: status === 'expanding' ? 'collapsing' : 'expanding',\n el: ref.current,\n transitionTimingFunction: themeAnimation.timing.ease\n });\n }\n\n return status === 'collapsed' && nullWhenCollapsed && !min ? null : (\n <Tag ref={ref} onTransitionEnd={onTransitionEnd} {...restProps} style={style}>\n {children}\n </Tag>\n );\n }\n);\n\nexport default ExpandCollapse;\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FunctionComponent, Ref } from 'react';
|
|
2
2
|
import { ForwardProps } from '../../types';
|
|
3
|
-
import { FieldGroupProps } from '
|
|
3
|
+
import { FieldGroupProps } from './FieldGroup';
|
|
4
4
|
export interface FieldGroupListItemProps extends FieldGroupProps {
|
|
5
5
|
/** The ID of the field group list item */
|
|
6
6
|
id: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FieldGroupList.d.ts","sourceRoot":"","sources":["../../../src/components/FieldGroup/FieldGroupList.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAA+B,GAAG,EAAE,MAAM,OAAO,CAAC;AAG5E,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAO3C,OAAmB,EAAE,eAAe,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"FieldGroupList.d.ts","sourceRoot":"","sources":["../../../src/components/FieldGroup/FieldGroupList.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAA+B,GAAG,EAAE,MAAM,OAAO,CAAC;AAG5E,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAO3C,OAAmB,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAI3D,MAAM,WAAW,uBAAwB,SAAQ,eAAe;IAC9D,0CAA0C;IAC1C,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,uBAAuB,EAAE,CAAC;IACjC,KAAK,CAAC,EAAE,MAAM,IAAI,CAAC;IACnB,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,GAAG,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;CAC3B;AAWD,eAAO,MAAM,cAAc,qJAe1B,CAAC;AAaF,QAAA,MAAM,cAAc,EAAE,iBAAiB,CAAC,mBAAmB,GAAG,YAAY,CAsCzE,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
|
@@ -6,7 +6,7 @@ import Icon, { registerIcon } from '../Icon';
|
|
|
6
6
|
import * as plusIcon from '../Icon/icons/plus.icon';
|
|
7
7
|
import { useI18n } from '../../hooks';
|
|
8
8
|
import { defaultThemeProp } from '../../theme';
|
|
9
|
-
import FieldGroup from '
|
|
9
|
+
import FieldGroup from './FieldGroup';
|
|
10
10
|
registerIcon(plusIcon);
|
|
11
11
|
const StyledFieldGroupList = styled.div(({ theme }) => css `
|
|
12
12
|
margin-top: ${theme.base.spacing};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FieldGroupList.js","sourceRoot":"","sources":["../../../src/components/FieldGroup/FieldGroupList.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAqB,UAAU,EAAwB,MAAM,OAAO,CAAC;AAC5E,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAGhD,OAAO,MAAM,MAAM,WAAW,CAAC;AAC/B,OAAO,IAAI,EAAE,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,KAAK,QAAQ,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C,OAAO,UAA+B,MAAM,
|
|
1
|
+
{"version":3,"file":"FieldGroupList.js","sourceRoot":"","sources":["../../../src/components/FieldGroup/FieldGroupList.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAqB,UAAU,EAAwB,MAAM,OAAO,CAAC;AAC5E,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAGhD,OAAO,MAAM,MAAM,WAAW,CAAC;AAC/B,OAAO,IAAI,EAAE,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,KAAK,QAAQ,MAAM,yBAAyB,CAAC;AACpD,O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GAAG,EAAE,GAAG,KAAM,SAAS,aAC1C,KAAK,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,aAAa,EAA2B,EAAE,EAAE;gBAC/E,OAAO,CACL,KAAC,cAAc,IAEb,IAAI,EAAE,IAAI,KACN,aAAa,EACjB,OAAO,EAAE;wBACP;4BACE,IAAI,EAAE,QAAQ;4BACd,IAAI,EAAE,OAAO;4BACb,QAAQ,EAAE,IAAI;4BACd,OAAO,EAAE,QAAQ;gCACf,CAAC,CAAC,GAAG,EAAE;oCACH,QAAQ,CAAC,EAAE,CAAC,CAAC;gCACf,CAAC;gCACH,CAAC,CAAC,SAAS;yBACd;qBACF,YAEA,QAAQ,IAhBJ,EAAE,CAiBQ,CAClB,CAAC;YACJ,CAAC,CAAC,EACF,MAAC,eAAe,IAAC,OAAO,EAAC,MAAM,EAAC,OAAO,EAAE,KAAK,aAC5C,KAAC,IAAI,IAAC,IAAI,EAAC,MAAM,WAAG,OAAE,CAAC,CAAC,KAAK,CAAC,YACd,YACG,CACxB,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,cAAc,CAAC","sourcesContent":["import { FunctionComponent, forwardRef, PropsWithoutRef, Ref } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport { ForwardProps } from '../../types';\nimport Button from '../Button';\nimport Icon, { registerIcon } from '../Icon';\nimport * as plusIcon from '../Icon/icons/plus.icon';\nimport { useI18n } from '../../hooks';\nimport { defaultThemeProp } from '../../theme';\n\nimport FieldGroup, { FieldGroupProps } from './FieldGroup';\n\nregisterIcon(plusIcon);\n\nexport interface FieldGroupListItemProps extends FieldGroupProps {\n /** The ID of the field group list item */\n id: string;\n}\n\nexport interface FieldGroupListProps {\n items: FieldGroupListItemProps[];\n onAdd?: () => void;\n onDelete?: (id: string) => void;\n ref?: Ref<HTMLDivElement>;\n}\n\nconst StyledFieldGroupList = styled.div(\n ({ theme }) =>\n css`\n margin-top: ${theme.base.spacing};\n `\n);\n\nStyledFieldGroupList.defaultProps = defaultThemeProp;\n\nexport const StyledListItem = styled(FieldGroup)(\n ({ theme }) =>\n css`\n padding: ${theme.base.spacing} 0 calc(2 * ${theme.base.spacing});\n border-bottom: 0.0625rem solid ${theme.base.palette['border-line']};\n margin-bottom: calc(2 * ${theme.base.spacing});\n\n legend {\n margin-bottom: -${theme.base.spacing};\n }\n\n & > * {\n margin: ${theme.base.spacing} 0;\n }\n `\n);\n\nStyledListItem.defaultProps = defaultThemeProp;\n\nconst StyledAddButton = styled(Button)(\n ({ theme }) =>\n css`\n margin-top: ${theme.base.spacing};\n `\n);\n\nStyledAddButton.defaultProps = defaultThemeProp;\n\nconst FieldGroupList: FunctionComponent<FieldGroupListProps & ForwardProps> = forwardRef(\n (\n { items, onAdd, onDelete, ...restProps }: PropsWithoutRef<FieldGroupListProps>,\n ref: FieldGroupListProps['ref']\n ) => {\n const t = useI18n();\n\n return (\n <StyledFieldGroupList ref={ref} {...restProps}>\n {items.map(({ id, children, name, ...restItemProps }: FieldGroupListItemProps) => {\n return (\n <StyledListItem\n key={id}\n name={name}\n {...restItemProps}\n actions={[\n {\n text: 'Delete',\n icon: 'trash',\n iconOnly: true,\n onClick: onDelete\n ? () => {\n onDelete(id);\n }\n : undefined\n }\n ]}\n >\n {children}\n </StyledListItem>\n );\n })}\n <StyledAddButton variant='link' onClick={onAdd}>\n <Icon name='plus' /> {t('add')}\n </StyledAddButton>\n </StyledFieldGroupList>\n );\n }\n);\n\nexport default FieldGroupList;\n"]}
|
|
@@ -2,4 +2,5 @@ export { default } from './FieldGroup';
|
|
|
2
2
|
export { FieldGroupProps } from './FieldGroup';
|
|
3
3
|
export { StyledFieldGroup } from './FieldGroup';
|
|
4
4
|
export { StyledFieldGroupLegend } from './FieldGroup';
|
|
5
|
+
export { default as FieldGroupList, FieldGroupListProps, FieldGroupListItemProps } from './FieldGroupList';
|
|
5
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/FieldGroup/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/FieldGroup/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AACtD,OAAO,EACL,OAAO,IAAI,cAAc,EACzB,mBAAmB,EACnB,uBAAuB,EACxB,MAAM,kBAAkB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/FieldGroup/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC","sourcesContent":["export { default } from './FieldGroup';\nexport { FieldGroupProps } from './FieldGroup';\nexport { StyledFieldGroup } from './FieldGroup';\nexport { StyledFieldGroupLegend } from './FieldGroup';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/FieldGroup/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AACtD,OAAO,EACL,OAAO,IAAI,cAAc,EAG1B,MAAM,kBAAkB,CAAC","sourcesContent":["export { default } from './FieldGroup';\nexport { FieldGroupProps } from './FieldGroup';\nexport { StyledFieldGroup } from './FieldGroup';\nexport { StyledFieldGroupLegend } from './FieldGroup';\nexport {\n default as FieldGroupList,\n FieldGroupListProps,\n FieldGroupListItemProps\n} from './FieldGroupList';\n"]}
|