@pega/cosmos-react-core 4.0.0-dev.6.1 → 4.0.0-dev.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/Backdrop/Backdrop.d.ts.map +1 -1
- package/lib/components/Backdrop/Backdrop.js +22 -2
- package/lib/components/Backdrop/Backdrop.js.map +1 -1
- package/lib/components/Banner/Banner.d.ts +9 -1
- package/lib/components/Banner/Banner.d.ts.map +1 -1
- package/lib/components/Banner/Banner.js +21 -10
- package/lib/components/Banner/Banner.js.map +1 -1
- package/lib/components/Banner/index.d.ts +1 -1
- package/lib/components/Banner/index.d.ts.map +1 -1
- package/lib/components/Banner/index.js.map +1 -1
- package/lib/components/Card/Card.d.ts +4 -7
- package/lib/components/Card/Card.d.ts.map +1 -1
- package/lib/components/Card/Card.js +2 -9
- package/lib/components/Card/Card.js.map +1 -1
- package/lib/components/Configuration/Configuration.d.ts +4 -1
- package/lib/components/Configuration/Configuration.d.ts.map +1 -1
- package/lib/components/Configuration/Configuration.js +2 -0
- package/lib/components/Configuration/Configuration.js.map +1 -1
- package/lib/components/DateTime/DateTime.types.d.ts +4 -1
- package/lib/components/DateTime/DateTime.types.d.ts.map +1 -1
- package/lib/components/DateTime/DateTime.types.js.map +1 -1
- package/lib/components/DateTime/Input/DateInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/DateInput.js +12 -1
- package/lib/components/DateTime/Input/DateInput.js.map +1 -1
- package/lib/components/DateTime/Input/DateRangeInput.d.ts +4 -2
- package/lib/components/DateTime/Input/DateRangeInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/DateRangeInput.js +71 -34
- package/lib/components/DateTime/Input/DateRangeInput.js.map +1 -1
- package/lib/components/DateTime/Input/DateTimeInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/DateTimeInput.js +19 -2
- package/lib/components/DateTime/Input/DateTimeInput.js.map +1 -1
- package/lib/components/DateTime/Input/PartInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/PartInput.js +2 -2
- package/lib/components/DateTime/Input/PartInput.js.map +1 -1
- package/lib/components/DateTime/Input/TimeInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/TimeInput.js +13 -2
- package/lib/components/DateTime/Input/TimeInput.js.map +1 -1
- package/lib/components/DateTime/Input/TimeRangeInput.d.ts +4 -2
- package/lib/components/DateTime/Input/TimeRangeInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/TimeRangeInput.js +70 -27
- package/lib/components/DateTime/Input/TimeRangeInput.js.map +1 -1
- package/lib/components/Dialog/FormDialog.d.ts.map +1 -1
- package/lib/components/Dialog/FormDialog.js +2 -6
- package/lib/components/Dialog/FormDialog.js.map +1 -1
- package/lib/components/Dialog/InfoDialog.d.ts.map +1 -1
- package/lib/components/Dialog/InfoDialog.js +2 -6
- package/lib/components/Dialog/InfoDialog.js.map +1 -1
- package/lib/components/FormControl/FormControl.d.ts +4 -0
- package/lib/components/FormControl/FormControl.d.ts.map +1 -1
- package/lib/components/FormControl/FormControl.js.map +1 -1
- package/lib/components/FormControl/index.d.ts +1 -0
- package/lib/components/FormControl/index.d.ts.map +1 -1
- package/lib/components/FormControl/index.js.map +1 -1
- package/lib/components/ListToolbar/ListToolbar.d.ts.map +1 -1
- package/lib/components/ListToolbar/ListToolbar.js +84 -66
- package/lib/components/ListToolbar/ListToolbar.js.map +1 -1
- package/lib/components/ListToolbar/ListToolbar.styles.d.ts +2 -0
- package/lib/components/ListToolbar/ListToolbar.styles.d.ts.map +1 -1
- package/lib/components/ListToolbar/ListToolbar.styles.js +37 -5
- package/lib/components/ListToolbar/ListToolbar.styles.js.map +1 -1
- package/lib/components/ListToolbar/ListToolbar.types.d.ts +4 -4
- package/lib/components/ListToolbar/ListToolbar.types.d.ts.map +1 -1
- package/lib/components/ListToolbar/ListToolbar.types.js.map +1 -1
- package/lib/components/LiveLog/Context.d.ts +3 -0
- package/lib/components/LiveLog/Context.d.ts.map +1 -0
- package/lib/components/LiveLog/Context.js +9 -0
- package/lib/components/LiveLog/Context.js.map +1 -0
- package/lib/components/LiveLog/LiveLog.d.ts +10 -0
- package/lib/components/LiveLog/LiveLog.d.ts.map +1 -0
- package/lib/components/LiveLog/LiveLog.js +99 -0
- package/lib/components/LiveLog/LiveLog.js.map +1 -0
- package/lib/components/LiveLog/LiveLog.styles.d.ts +3 -0
- package/lib/components/LiveLog/LiveLog.styles.d.ts.map +1 -0
- package/lib/components/LiveLog/LiveLog.styles.js +9 -0
- package/lib/components/LiveLog/LiveLog.styles.js.map +1 -0
- package/lib/components/LiveLog/LiveLog.types.d.ts +93 -0
- package/lib/components/LiveLog/LiveLog.types.d.ts.map +1 -0
- package/lib/components/LiveLog/LiveLog.types.js +2 -0
- package/lib/components/LiveLog/LiveLog.types.js.map +1 -0
- package/lib/components/LiveLog/index.d.ts +4 -0
- package/lib/components/LiveLog/index.d.ts.map +1 -0
- package/lib/components/LiveLog/index.js +3 -0
- package/lib/components/LiveLog/index.js.map +1 -0
- package/lib/components/Menu/Menu.d.ts.map +1 -1
- package/lib/components/Menu/Menu.js +2 -0
- package/lib/components/Menu/Menu.js.map +1 -1
- package/lib/components/Menu/MenuList.d.ts.map +1 -1
- package/lib/components/Menu/MenuList.js +4 -3
- package/lib/components/Menu/MenuList.js.map +1 -1
- package/lib/components/Modal/Modal.d.ts.map +1 -1
- package/lib/components/Modal/Modal.js +6 -8
- package/lib/components/Modal/Modal.js.map +1 -1
- package/lib/components/Modal/Modal.types.d.ts +1 -0
- package/lib/components/Modal/Modal.types.d.ts.map +1 -1
- package/lib/components/Modal/Modal.types.js.map +1 -1
- package/lib/components/Number/NumberInput.types.d.ts +3 -1
- package/lib/components/Number/NumberInput.types.d.ts.map +1 -1
- package/lib/components/Number/NumberInput.types.js.map +1 -1
- package/lib/components/Number/NumberRangeInput.d.ts.map +1 -1
- package/lib/components/Number/NumberRangeInput.js +71 -4
- package/lib/components/Number/NumberRangeInput.js.map +1 -1
- package/lib/components/PageTemplates/CategorySubPage.d.ts.map +1 -1
- package/lib/components/PageTemplates/CategorySubPage.js +14 -3
- package/lib/components/PageTemplates/CategorySubPage.js.map +1 -1
- package/lib/components/PageTemplates/CategorySubPage.styles.d.ts.map +1 -1
- package/lib/components/PageTemplates/CategorySubPage.styles.js +5 -0
- package/lib/components/PageTemplates/CategorySubPage.styles.js.map +1 -1
- package/lib/components/PageTemplates/DashboardPage.d.ts.map +1 -1
- package/lib/components/PageTemplates/DashboardPage.js +16 -2
- package/lib/components/PageTemplates/DashboardPage.js.map +1 -1
- package/lib/components/PageTemplates/PageTemplates.d.ts.map +1 -1
- package/lib/components/PageTemplates/PageTemplates.js +20 -3
- package/lib/components/PageTemplates/PageTemplates.js.map +1 -1
- package/lib/components/Popover/Popover.d.ts.map +1 -1
- package/lib/components/Popover/Popover.js +2 -5
- package/lib/components/Popover/Popover.js.map +1 -1
- package/lib/components/Popover/Popover.styles.d.ts +0 -1
- package/lib/components/Popover/Popover.styles.d.ts.map +1 -1
- package/lib/components/Popover/Popover.styles.js +0 -6
- package/lib/components/Popover/Popover.styles.js.map +1 -1
- package/lib/components/Popover/modifiers.d.ts +0 -2
- package/lib/components/Popover/modifiers.d.ts.map +1 -1
- package/lib/components/Popover/modifiers.js +1 -32
- package/lib/components/Popover/modifiers.js.map +1 -1
- package/lib/components/Progress/Progress.d.ts.map +1 -1
- package/lib/components/Progress/Progress.js +92 -50
- package/lib/components/Progress/Progress.js.map +1 -1
- package/lib/components/Progress/Progress.styles.d.ts.map +1 -1
- package/lib/components/Progress/Progress.styles.js +0 -1
- package/lib/components/Progress/Progress.styles.js.map +1 -1
- package/lib/components/Progress/Progress.types.d.ts +18 -6
- package/lib/components/Progress/Progress.types.d.ts.map +1 -1
- package/lib/components/Progress/Progress.types.js.map +1 -1
- package/lib/components/Progress/index.d.ts +1 -1
- package/lib/components/Progress/index.d.ts.map +1 -1
- package/lib/components/Progress/index.js.map +1 -1
- package/lib/components/QRCode/QRCode.d.ts +14 -0
- package/lib/components/QRCode/QRCode.d.ts.map +1 -0
- package/lib/components/QRCode/QRCode.js +39 -0
- package/lib/components/QRCode/QRCode.js.map +1 -0
- package/lib/components/QRCode/index.d.ts +3 -0
- package/lib/components/QRCode/index.d.ts.map +1 -0
- package/lib/components/QRCode/index.js +2 -0
- package/lib/components/QRCode/index.js.map +1 -0
- package/lib/components/SearchInput/SearchInput.d.ts.map +1 -1
- package/lib/components/SearchInput/SearchInput.js +27 -7
- package/lib/components/SearchInput/SearchInput.js.map +1 -1
- package/lib/components/Tabs/Tabs.d.ts.map +1 -1
- package/lib/components/Tabs/Tabs.js +6 -0
- package/lib/components/Tabs/Tabs.js.map +1 -1
- package/lib/components/Toaster/Context.d.ts +1 -0
- package/lib/components/Toaster/Context.d.ts.map +1 -1
- package/lib/components/Toaster/Context.js.map +1 -1
- package/lib/components/Toaster/Toaster.d.ts.map +1 -1
- package/lib/components/Toaster/Toaster.js +5 -1
- package/lib/components/Toaster/Toaster.js.map +1 -1
- package/lib/components/Tree/StandardTree.d.ts.map +1 -1
- package/lib/components/Tree/StandardTree.js +70 -27
- package/lib/components/Tree/StandardTree.js.map +1 -1
- package/lib/components/Tree/StandardTree.styles.d.ts +1 -0
- package/lib/components/Tree/StandardTree.styles.d.ts.map +1 -1
- package/lib/components/Tree/StandardTree.styles.js +32 -18
- package/lib/components/Tree/StandardTree.styles.js.map +1 -1
- package/lib/components/Tree/StandardTree.types.d.ts +27 -0
- package/lib/components/Tree/StandardTree.types.d.ts.map +1 -1
- package/lib/components/Tree/StandardTree.types.js.map +1 -1
- package/lib/components/Tree/helpers.d.ts +11 -9
- package/lib/components/Tree/helpers.d.ts.map +1 -1
- package/lib/components/Tree/helpers.js +25 -5
- package/lib/components/Tree/helpers.js.map +1 -1
- package/lib/components/Tree/index.d.ts +1 -1
- package/lib/components/Tree/index.d.ts.map +1 -1
- package/lib/components/Tree/index.js.map +1 -1
- package/lib/components/URL/URLDisplay.d.ts +2 -2
- package/lib/components/URL/URLDisplay.d.ts.map +1 -1
- package/lib/components/URL/URLDisplay.js +8 -1
- package/lib/components/URL/URLDisplay.js.map +1 -1
- package/lib/hooks/index.d.ts +1 -0
- package/lib/hooks/index.d.ts.map +1 -1
- package/lib/hooks/index.js +1 -0
- package/lib/hooks/index.js.map +1 -1
- package/lib/hooks/useArrows.d.ts.map +1 -1
- package/lib/hooks/useArrows.js +3 -3
- package/lib/hooks/useArrows.js.map +1 -1
- package/lib/hooks/useBreakpoint.d.ts.map +1 -1
- package/lib/hooks/useBreakpoint.js +3 -2
- package/lib/hooks/useBreakpoint.js.map +1 -1
- package/lib/hooks/useI18n.d.ts +43 -0
- package/lib/hooks/useI18n.d.ts.map +1 -1
- package/lib/hooks/useLiveLog.d.ts +8 -0
- package/lib/hooks/useLiveLog.d.ts.map +1 -0
- package/lib/hooks/useLiveLog.js +16 -0
- package/lib/hooks/useLiveLog.js.map +1 -0
- package/lib/i18n/default.d.ts +43 -0
- package/lib/i18n/default.d.ts.map +1 -1
- package/lib/i18n/default.js +50 -6
- package/lib/i18n/default.js.map +1 -1
- package/lib/i18n/i18n.d.ts +43 -0
- package/lib/i18n/i18n.d.ts.map +1 -1
- package/lib/index.d.ts +4 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +4 -0
- package/lib/index.js.map +1 -1
- package/lib/register-contexts.js +2 -0
- package/lib/register-contexts.js.map +1 -1
- package/lib/theme/theme.d.ts +12 -0
- package/lib/theme/theme.d.ts.map +1 -1
- package/lib/theme/themeDefinition.json +8 -0
- package/lib/theme/themes/darkTheme.json +3 -1
- package/lib/types/types.d.ts +3 -0
- package/lib/types/types.d.ts.map +1 -1
- package/lib/types/types.js.map +1 -1
- package/package.json +3 -1
- package/lib/components/ListToolbar/QueryOptionPopover.d.ts +0 -12
- package/lib/components/ListToolbar/QueryOptionPopover.d.ts.map +0 -1
- package/lib/components/ListToolbar/QueryOptionPopover.js +0 -36
- package/lib/components/ListToolbar/QueryOptionPopover.js.map +0 -1
|
@@ -1 +1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,GAC7C,CACH,IACI,CACR,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,WAAW,CAAC","sourcesContent":["import {\n forwardRef,\n FunctionComponent,\n MouseEvent,\n PropsWithoutRef,\n useCallback,\n useMemo,\n useRef,\n useState\n} from 'react';\n\nimport Actions from '../Actions';\nimport Text from '../Text';\nimport Button from '../Button';\nimport { Action, ForwardProps } from '../../types';\nimport { useBreakpoint, useConsolidatedRef, useI18n } from '../../hooks';\nimport Flex from '../Flex';\nimport SearchInput from '../SearchInput';\nimport Icon, { registerIcon } from '../Icon';\nimport * as filterIcon from '../Icon/icons/filter.icon';\nimport * as arrowUpDownIcon from '../Icon/icons/arrow-up-down.icon';\nimport * as rowIcon from '../Icon/icons/row.icon';\nimport * as plusIcon from '../Icon/icons/plus.icon';\nimport * as moreIcon from '../Icon/icons/more.icon';\nimport { hasProp } from '../../utils';\nimport MenuButton from '../MenuButton';\nimport { Count } from '../Badges';\n\nimport PresetMenuPopover, { PresetMenuPopoverProps } from './PresetMenuPopover';\nimport {\n StyledViewSelector,\n StyledSearchForm,\n StyledListToolbar,\n StyledHeadingText\n} from './ListToolbar.styles';\nimport {\n ListToolbarProps,\n PresetMenuProps,\n QueryOptionDialogProps,\n QueryOptionId\n} from './ListToolbar.types';\nimport QueryOptionPopover from './QueryOptionPopover';\n\nregisterIcon(filterIcon, arrowUpDownIcon, rowIcon, plusIcon, moreIcon);\n\nconst CountMeta = ({ count }: { count: NonNullable<ListToolbarProps['count']> }) => {\n const t = useI18n();\n return (\n <Text variant='secondary'>\n {count.total !== undefined &&\n t('results_count', [count.totalHasMore ? `${count.total}+` : count.total], {\n count: count.total\n })}\n {count.total !== undefined && count.selected !== undefined && ' '}\n {count.selected !== undefined &&\n `(${t('selected_count', [count.selected], { count: count.selected })})`}\n </Text>\n );\n};\n\nconst QueryOptionButton = ({\n id,\n queryOptionProps,\n iconOnly,\n onClick\n}: {\n id: QueryOptionId;\n queryOptionProps: QueryOptionDialogProps | PresetMenuProps;\n iconOnly: boolean;\n onClick: (e: MouseEvent<HTMLButtonElement>) => void;\n}) => {\n const t = useI18n();\n let i18nKey: 'filter' | 'sort' | 'group';\n let icon: 'filter' | 'arrow-up-down' | 'row';\n\n if (id === 'filter') {\n i18nKey = 'filter';\n icon = 'filter';\n } else if (id === 'sort') {\n i18nKey = 'sort';\n icon = 'arrow-up-down';\n } else {\n i18nKey = 'group';\n icon = 'row';\n }\n\n const text = t(i18nKey);\n const variant = iconOnly ? 'simple' : 'text';\n\n if (hasProp(queryOptionProps, 'renderer')) {\n return (\n <div>\n <Button\n variant={variant}\n icon={iconOnly}\n label={iconOnly ? text : undefined}\n onClick={onClick}\n >\n <Flex container={{ inline: true, alignItems: 'center', gap: 1 }} as='span'>\n <Icon name={icon} />\n {!iconOnly && text}\n {!iconOnly && queryOptionProps.count && <Count>{queryOptionProps.count}</Count>}\n </Flex>\n </Button>\n </div>\n );\n }\n\n if (hasProp(queryOptionProps, 'items')) {\n return (\n <div>\n <MenuButton\n variant={variant}\n text={text}\n icon={icon}\n iconOnly={iconOnly}\n count={queryOptionProps.count}\n onClick={onClick}\n menu={{\n mode: queryOptionProps.mode,\n items: queryOptionProps.items.map(item => ({ ...item, primary: item.text })),\n onItemClick: queryOptionProps.onItemClick\n }}\n />\n </div>\n );\n }\n\n return null;\n};\n\nconst ListToolbar: FunctionComponent<ListToolbarProps & ForwardProps> = forwardRef(\n (\n {\n heading,\n formControlProps,\n createNew,\n search,\n count,\n additionalActions,\n filter,\n sort,\n group,\n actions,\n actionsButtonRef,\n condensed\n }: PropsWithoutRef<ListToolbarProps>,\n ref: ListToolbarProps['ref']\n ) => {\n const t = useI18n();\n const isSmallOrAbove = useBreakpoint('sm');\n const isMediumOrAbove = useBreakpoint('md');\n const consolidatedActionsButtonRef = useConsolidatedRef(actionsButtonRef);\n\n const [currentQueryOptionId, setCurrentQueryOptionId] = useState<QueryOptionId | null>(null);\n const queryOptionPopoverTarget = useRef<HTMLButtonElement>();\n\n const [actionsQueryOptionPreset, setActionsQueryOptionPreset] =\n useState<Pick<PresetMenuPopoverProps, 'heading' | 'menu'>>();\n const [optionPresetMenuOpen, setOptionPresetMenuOpen] = useState(false);\n\n const createNewButton = useMemo(() => {\n if (!createNew?.onClick) return null;\n const text = createNew.label ?? t('create_new');\n\n return (\n <Button\n variant={isSmallOrAbove ? 'secondary' : 'simple'}\n icon={!isSmallOrAbove}\n label={isSmallOrAbove ? undefined : text}\n aria-label={text}\n onClick={createNew.onClick}\n >\n {isSmallOrAbove ? text : <Icon name='plus' />}\n </Button>\n );\n }, [t, createNew, isSmallOrAbove]);\n\n const filterButton = filter && (\n <QueryOptionButton\n id='filter'\n queryOptionProps={filter}\n iconOnly={!isMediumOrAbove}\n onClick={e => {\n setCurrentQueryOptionId('filter');\n queryOptionPopoverTarget.current = e.currentTarget;\n }}\n />\n );\n\n const sortButton = sort && (\n <QueryOptionButton\n id='sort'\n queryOptionProps={sort}\n iconOnly={!isMediumOrAbove}\n onClick={e => {\n setCurrentQueryOptionId('sort');\n queryOptionPopoverTarget.current = e.currentTarget;\n }}\n />\n );\n\n const groupButton = group && (\n <QueryOptionButton\n id='group'\n queryOptionProps={group}\n iconOnly={!isMediumOrAbove}\n onClick={e => {\n setCurrentQueryOptionId('group');\n queryOptionPopoverTarget.current = e.currentTarget;\n }}\n />\n );\n\n let queryOptionPopover = null;\n if (currentQueryOptionId) {\n const queryOptionProps = { filter, sort, group }[currentQueryOptionId];\n if (queryOptionProps && hasProp(queryOptionProps, 'renderer')) {\n queryOptionPopover = (\n <QueryOptionPopover\n target={queryOptionPopoverTarget.current}\n heading={t(`${currentQueryOptionId}_by`)}\n onCancel={() => {\n if (queryOptionProps.onCancel() === false) return;\n setCurrentQueryOptionId(null);\n }}\n onSubmit={() => {\n if (queryOptionProps.onSubmit() === false) return;\n setCurrentQueryOptionId(null);\n }}\n >\n <queryOptionProps.renderer />\n </QueryOptionPopover>\n );\n }\n }\n\n const getQueryOptionAction = useCallback(\n (\n id: 'sort' | 'group' | 'filter',\n icon: string,\n queryOptionProps: QueryOptionDialogProps | PresetMenuProps\n ) => {\n return {\n text: t(id),\n id,\n icon,\n count: queryOptionProps.count,\n onClick: () => {\n if (hasProp(queryOptionProps, 'renderer')) {\n setCurrentQueryOptionId(id);\n queryOptionPopoverTarget.current = consolidatedActionsButtonRef.current ?? undefined;\n }\n if (hasProp(queryOptionProps, 'items')) {\n setActionsQueryOptionPreset({\n heading: t(`${id}_by`),\n menu: {\n mode: queryOptionProps.mode,\n items: queryOptionProps.items.map(item => ({ ...item, primary: item.text })),\n onItemClick: queryOptionProps.onItemClick\n }\n });\n setOptionPresetMenuOpen(true);\n }\n }\n };\n },\n []\n );\n\n const basicModeActions = useMemo(() => {\n let basicActions: Action[] = [];\n if (filter) {\n const filterAction: Action = getQueryOptionAction('filter', 'filter', filter);\n basicActions.push(filterAction);\n }\n if (sort) {\n const sortAction: Action = getQueryOptionAction('sort', 'arrow-up-down', sort);\n basicActions.push(sortAction);\n }\n if (group) {\n const groupAction: Action = getQueryOptionAction('group', 'row', group);\n basicActions.push(groupAction);\n }\n if (actions) {\n basicActions = basicActions.concat(actions);\n }\n\n return basicActions.length ? basicActions : undefined;\n }, [actions, filter, sort, group, getQueryOptionAction]);\n\n return (\n <Flex\n as={StyledListToolbar}\n container={{ direction: 'column', gap: 2 }}\n item={{ grow: 1 }}\n ref={ref}\n role='toolbar'\n >\n {(heading ||\n createNewButton ||\n (condensed && (count || additionalActions || search || basicModeActions))) && (\n <Flex container={{ alignItems: 'start', justify: 'between', gap: 2 }}>\n <Flex container={{ alignItems: 'center', gap: 2, wrap: 'wrap' }}>\n {heading &&\n (typeof heading === 'string' ? (\n <StyledHeadingText variant='h3' required={formControlProps?.required}>\n {heading}\n </StyledHeadingText>\n ) : (\n <StyledViewSelector\n variant='text'\n text={heading.views.find(view => view.selected)?.text ?? heading.views[0].text}\n menu={{\n mode: 'single-select',\n items: heading.views.map(view => ({\n ...view,\n primary: `${view.text}${\n view.id === heading.defaultId ? ` (${t('default')})` : ''\n }${view.id === heading.appDefaultId ? ` (${t('app_default')})` : ''}`\n })),\n onItemClick: heading.onViewSelect\n }}\n required={formControlProps?.required}\n />\n ))}\n {isSmallOrAbove && condensed && (\n <>\n {count && <CountMeta count={count} />}\n {additionalActions}\n </>\n )}\n </Flex>\n <Flex container={{ alignItems: 'center', gap: 2 }}>\n {search && condensed && isSmallOrAbove && <SearchInput {...search} />}\n {createNewButton}\n {condensed && basicModeActions && (\n <span>\n <Actions\n items={basicModeActions.map(({ icon, ...restProps }) => ({\n visual: icon ? <Icon name={icon} /> : undefined,\n ...restProps\n }))}\n menuAt={1}\n ref={consolidatedActionsButtonRef}\n />\n </span>\n )}\n </Flex>\n </Flex>\n )}\n {(!condensed || !isSmallOrAbove) && (\n <Flex container={{ alignItems: 'start', justify: 'between', gap: 2 }}>\n <Flex\n as={StyledSearchForm}\n container={{ alignItems: 'center', wrap: 'wrap', gap: 2 }}\n item={{ grow: 1 }}\n >\n {search && <SearchInput {...search} />}\n {isSmallOrAbove && !condensed && (\n <>\n {count && <CountMeta count={count} />}\n {additionalActions}\n </>\n )}\n </Flex>\n {!condensed && (filterButton || sortButton || groupButton || actions) && (\n <Flex container={{ alignItems: 'center', gap: 1 }} md={{ container: { gap: 2 } }}>\n <>\n {filterButton}\n {sortButton}\n {groupButton}\n </>\n {actions && (\n <Actions\n items={actions.map(({ icon, ...restProps }) => ({\n visual: icon ? <Icon name={icon} /> : undefined,\n ...restProps\n }))}\n menuAt={1}\n ref={consolidatedActionsButtonRef}\n />\n )}\n </Flex>\n )}\n </Flex>\n )}\n {!isSmallOrAbove && (count || additionalActions) && (\n <Flex container={{ alignItems: 'center', wrap: 'wrap', gap: 2 }}>\n {count && <CountMeta count={count} />}\n {additionalActions}\n </Flex>\n )}\n\n {queryOptionPopover}\n\n {condensed && (\n <PresetMenuPopover\n buttonRef={consolidatedActionsButtonRef}\n heading={actionsQueryOptionPreset?.heading}\n menu={actionsQueryOptionPreset?.menu}\n isOpen={optionPresetMenuOpen}\n onClose={() => setOptionPresetMenuOpen(false)}\n />\n )}\n </Flex>\n );\n }\n);\n\nexport default ListToolbar;\n"]}
|
|
1
|
+
{"version":3,"file":"ListToolbar.js","sourceRoot":"","sources":["../../../src/components/ListToolbar/ListToolbar.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,UAAU,EAIV,WAAW,EACX,SAAS,EACT,OAAO,EACP,MAAM,EACN,QAAQ,EACT,MAAM,OAAO,CAAC;AAEf,OAAO,OAAO,MAAM,YAAY,CAAC;AACjC,OAAO,MAAM,MAAM,WAAW,CAAC;AAE/B,OAAO,EACL,SAAS,EACT,aAAa,EACb,kBAAkB,EAClB,SAAS,EACT,YAAY,EACZ,cAAc,EACd,OAAO,EACR,MAAM,aAAa,CAAC;AACrB,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,WAAW,MAAM,gBAAgB,CAAC;AACzC,OAAO,IAAI,EAAE,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,KAAK,UAAU,MAAM,2BAA2B,CAAC;AACxD,OAAO,KAAK,eAAe,MAAM,kCAAkC,CAAC;AACpE,OAAO,KAAK,OAAO,MAAM,wBAAwB,CAAC;AAClD,OAAO,KAAK,QAAQ,MAAM,yBAAyB,CAAC;AACpD,OAAO,KAAK,QAAQ,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,UAAU,MAAM,sBAAsB,CAAC;AAE9C,OAAO,iBAA6C,MAAM,qBAAqB,CAAC;AAChF,OAAO,EACL,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB,EACjB,iBAAiB,EACjB,eAAe,EACf,eAAe,EAChB,MAAM,sBAAsB,CAAC;AAQ9B,YAAY,CAAC,UAAU,EAAE,eAAe,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;AAEvE,MAAM,SAAS,GAAG,CAAC,E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,SAAS,IAAC,KAAK,EAAE,KAAK,GAAI,IACnD,IACF,CACR,EACA,CAAC,cAAc,IAAI,CAClB,4BACE,MAAC,IAAI,IAAC,SAAS,EAAE,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,GAAG,EAAE,CAAC,EAAE,aACjE,iBAAiB,EAClB,KAAC,IAAI,IACH,EAAE,EAAE,gBAAgB,EACpB,SAAS,EAAE,EAAE,UAAU,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,EAAE,EACzD,IAAI,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,YAEhB,MAAM,IAAI,kBAAkB,GACxB,EACN,eAAe,EACf,gBAAgB,IAAI,CACnB,yBACE,KAAC,OAAO,IACN,KAAK,EAAE,gBAAgB,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,GAAG,SAAS,EAAE,EAAE,EAAE,CAAC,CAAC;oCACvD,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC,KAAC,IAAI,IAAC,IAAI,EAAE,IAAI,GAAI,CAAC,CAAC,CAAC,SAAS;oCAC/C,GAAG,SAAS;iCACb,CAAC,CAAC,EACH,MAAM,EAAE,CAAC,EACT,GAAG,EAAE,4BAA4B,GACjC,GACG,CACR,IACI,GACN,CACJ,EAEA,kBAAkB,EAEnB,KAAC,iBAAiB,IAChB,SAAS,EAAE,4BAA4B,EACvC,OAAO,EAAE,wBAAwB,EAAE,OAAO,EAC1C,IAAI,EAAE,wBAAwB,EAAE,IAAI,EACpC,MAAM,EAAE,oBAAoB,EAC5B,OAAO,EAAE,GAAG,EAAE,CAAC,uBAAuB,CAAC,KAAK,CAAC,GAC7C,IACG,CACR,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,WAAW,CAAC","sourcesContent":["import {\n forwardRef,\n FunctionComponent,\n KeyboardEvent,\n PropsWithoutRef,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState\n} from 'react';\n\nimport Actions from '../Actions';\nimport Button from '../Button';\nimport { Action, ForwardProps } from '../../types';\nimport {\n useArrows,\n useBreakpoint,\n useConsolidatedRef,\n useEscape,\n useFocusTrap,\n useFocusWithin,\n useI18n\n} from '../../hooks';\nimport Flex from '../Flex';\nimport SearchInput from '../SearchInput';\nimport Icon, { registerIcon } from '../Icon';\nimport * as filterIcon from '../Icon/icons/filter.icon';\nimport * as arrowUpDownIcon from '../Icon/icons/arrow-up-down.icon';\nimport * as rowIcon from '../Icon/icons/row.icon';\nimport * as plusIcon from '../Icon/icons/plus.icon';\nimport * as moreIcon from '../Icon/icons/more.icon';\nimport { hasProp } from '../../utils';\nimport FormDialog from '../Dialog/FormDialog';\n\nimport PresetMenuPopover, { PresetMenuPopoverProps } from './PresetMenuPopover';\nimport {\n StyledViewSelector,\n StyledSearchForm,\n StyledListToolbar,\n StyledHeadingText,\n StyledCountMeta,\n StyledContainer\n} from './ListToolbar.styles';\nimport {\n ListToolbarProps,\n PresetMenuProps,\n QueryOptionDialogProps,\n QueryOptionId\n} from './ListToolbar.types';\n\nregisterIcon(filterIcon, arrowUpDownIcon, rowIcon, plusIcon, moreIcon);\n\nconst CountMeta = ({ count }: { count: NonNullable<ListToolbarProps['count']> }) => {\n const t = useI18n();\n return (\n <StyledCountMeta variant='secondary'>\n {count.total !== undefined &&\n count.selected === undefined &&\n t('results_count', [count.totalHasMore ? `${count.total}+` : count.total], {\n count: count.total\n })}\n {count.total !== undefined &&\n count.selected !== undefined &&\n t(\n 'selected_count',\n [count.selected, count.totalHasMore ? `${count.total}+` : count.total],\n { count: count.selected }\n )}\n </StyledCountMeta>\n );\n};\n\nconst ListToolbar: FunctionComponent<ListToolbarProps & ForwardProps> = forwardRef(\n (\n {\n name,\n viewSelector,\n formControlProps,\n createNew,\n search,\n count,\n additionalActions,\n filter,\n sort,\n group,\n actions,\n actionsButtonRef\n }: PropsWithoutRef<ListToolbarProps>,\n ref: ListToolbarProps['ref']\n ) => {\n const t = useI18n();\n\n const isSmallOrAbove = useBreakpoint('sm');\n const consolidatedActionsButtonRef = useConsolidatedRef(actionsButtonRef);\n const toolbarRef = useConsolidatedRef(ref);\n const searchInputRef = useRef<HTMLInputElement>(null);\n const searchWrapperRef = useRef<HTMLDivElement>(null);\n const searchButtonRef = useRef<HTMLButtonElement>(null);\n const [isSearchOpen, setIsSearchOpen] = useState(!!search?.value);\n\n const onSearchEscape = useCallback(() => {\n if (!search?.value) {\n setIsSearchOpen(false);\n }\n setTimeout(() => searchButtonRef.current?.focus());\n }, [search?.value]);\n\n useEffect(() => {\n if (search?.value) {\n setIsSearchOpen(true);\n }\n }, [search?.value]);\n\n const hasFocus = useFocusWithin([searchWrapperRef]);\n useArrows(hasFocus ? { current: null } : toolbarRef, {\n dir: 'left-right',\n selector: \"button:enabled:first-child, :not(input) + button:enabled, div[role='button']\"\n });\n\n useEffect(() => {\n if (searchWrapperRef.current) {\n const focusables = searchWrapperRef.current.querySelectorAll<HTMLElement>(\n \"button:enabled, input[type='search']:enabled\"\n );\n if (!hasFocus) {\n focusables.forEach(item => {\n item.tabIndex = -1;\n });\n if (isSearchOpen && !search?.value) {\n setIsSearchOpen(false);\n }\n } else {\n focusables.forEach(item => {\n item.tabIndex = 0;\n });\n }\n }\n }, [hasFocus]);\n\n const [currentQueryOptionId, setCurrentQueryOptionId] = useState<QueryOptionId | null>(null);\n const queryOptionPopoverTarget = useRef<HTMLButtonElement>();\n\n const [actionsQueryOptionPreset, setActionsQueryOptionPreset] =\n useState<Pick<PresetMenuPopoverProps, 'heading' | 'menu'>>();\n const [optionPresetMenuOpen, setOptionPresetMenuOpen] = useState(false);\n\n const createNewButton = useMemo(() => {\n if (!createNew?.onClick) return null;\n const text = createNew.label ?? t('create_new');\n\n return (\n <Button variant='simple' icon label={text} aria-label={text} onClick={createNew.onClick}>\n <Icon name='plus' />\n </Button>\n );\n }, [t, createNew, isSmallOrAbove]);\n\n useFocusTrap(searchButtonRef);\n useEscape(onSearchEscape, searchButtonRef);\n const searchInputWrapper = useMemo(\n () => (\n <div role='dialog' ref={searchWrapperRef}>\n <SearchInput {...search} ref={searchInputRef} tabIndex='-1' />\n </div>\n ),\n [search]\n );\n\n const searchLabel = t('search');\n const searchButton = useMemo(() => {\n return (\n <Button\n as='div'\n role='button'\n variant='simple'\n icon\n label={searchLabel}\n aria-label={searchLabel}\n onClick={() => {\n setIsSearchOpen(true);\n setTimeout(() => searchInputRef.current?.focus());\n }}\n onKeyDown={(e: KeyboardEvent<HTMLElement>) => {\n if (e.key === 'Enter') {\n setIsSearchOpen(true);\n setTimeout(() => searchInputRef.current?.focus());\n }\n }}\n tabIndex='-1'\n ref={searchButtonRef}\n >\n {isSearchOpen ? searchInputWrapper : <Icon name='search' />}\n </Button>\n );\n }, [searchLabel, setIsSearchOpen, isSearchOpen, searchInputWrapper]);\n\n let queryOptionPopover = null;\n if (currentQueryOptionId) {\n const queryOptionProps = { filter, sort, group }[currentQueryOptionId];\n if (\n queryOptionProps &&\n hasProp(queryOptionProps, 'renderer') &&\n queryOptionPopoverTarget.current\n ) {\n queryOptionPopover = (\n <FormDialog\n target={queryOptionPopoverTarget.current}\n heading={t(`${currentQueryOptionId}_by`)}\n onCancel={() => {\n if (queryOptionProps.onCancel() === false) return;\n setCurrentQueryOptionId(null);\n }}\n onSubmit={() => {\n if (queryOptionProps.onSubmit() === false) return;\n setCurrentQueryOptionId(null);\n }}\n >\n <queryOptionProps.renderer />\n </FormDialog>\n );\n }\n }\n\n const getQueryOptionAction = useCallback(\n (\n id: 'sort' | 'group' | 'filter',\n icon: string,\n queryOptionProps: QueryOptionDialogProps | PresetMenuProps\n ) => {\n return {\n text: t(id),\n id,\n icon,\n count: queryOptionProps.count,\n onClick: () => {\n if (hasProp(queryOptionProps, 'renderer')) {\n setCurrentQueryOptionId(id);\n queryOptionPopoverTarget.current = consolidatedActionsButtonRef.current ?? undefined;\n }\n if (hasProp(queryOptionProps, 'items')) {\n setActionsQueryOptionPreset({\n heading: t(`${id}_by`),\n menu: {\n mode: queryOptionProps.mode,\n items: queryOptionProps.items.map(item => ({ ...item, primary: item.text })),\n onItemClick: queryOptionProps.onItemClick\n }\n });\n setOptionPresetMenuOpen(true);\n }\n }\n };\n },\n []\n );\n\n const basicModeActions = useMemo(() => {\n let basicActions: Action[] = [];\n if (filter) {\n const filterAction: Action = getQueryOptionAction('filter', 'filter', filter);\n basicActions.push(filterAction);\n }\n if (sort) {\n const sortAction: Action = getQueryOptionAction('sort', 'arrow-up-down', sort);\n basicActions.push(sortAction);\n }\n if (group) {\n const groupAction: Action = getQueryOptionAction('group', 'row', group);\n basicActions.push(groupAction);\n }\n if (actions) {\n basicActions = basicActions.concat(actions);\n }\n\n return basicActions.length ? basicActions : undefined;\n }, [actions, filter, sort, group, getQueryOptionAction]);\n\n return (\n <Flex\n as={StyledListToolbar}\n container={{ direction: 'column', gap: 0.5 }}\n item={{ grow: 1 }}\n ref={toolbarRef}\n role='toolbar'\n >\n {(name ||\n viewSelector ||\n createNewButton ||\n count ||\n additionalActions ||\n search ||\n basicModeActions) && (\n <Flex container={{ alignItems: 'start', justify: 'between', gap: 2 }}>\n <StyledContainer container={{ alignItems: 'center', gap: 0.5, wrap: 'wrap' }}>\n {viewSelector &&\n viewSelector.views.length > 0 &&\n (viewSelector.views.length === 1 ? (\n <StyledHeadingText variant='h3' required={formControlProps?.required}>\n {`${name}: ${viewSelector.views[0].text}`}\n </StyledHeadingText>\n ) : (\n <StyledViewSelector\n variant='text'\n text={`${name}: ${\n viewSelector.views.find(view => view.selected)?.text ??\n viewSelector.views[0].text\n }`}\n menu={{\n mode: 'single-select',\n items: viewSelector.views.map(view => ({\n ...view,\n primary: `${view.text}${\n view.id === viewSelector.defaultId ? ` (${t('default')})` : ''\n }${view.id === viewSelector.appDefaultId ? ` (${t('app_default')})` : ''}`\n })),\n onItemClick: viewSelector.onViewSelect\n }}\n required={formControlProps?.required}\n />\n ))}\n {(!viewSelector || viewSelector.views.length === 0) && (\n <StyledHeadingText variant='h3' required={formControlProps?.required}>\n {name}\n </StyledHeadingText>\n )}\n {isSmallOrAbove && count && <CountMeta count={count} />}\n </StyledContainer>\n <Flex container={{ alignItems: 'center', gap: 1 }} item={{ shrink: 0 }}>\n {isSmallOrAbove && additionalActions}\n {search && isSmallOrAbove && searchButton}\n {isSmallOrAbove && createNewButton}\n {isSmallOrAbove && basicModeActions && (\n <span>\n <Actions\n items={basicModeActions.map(({ icon, ...restProps }) => ({\n visual: icon ? <Icon name={icon} /> : undefined,\n ...restProps\n }))}\n menuAt={1}\n ref={consolidatedActionsButtonRef}\n />\n </span>\n )}\n {!isSmallOrAbove && count && <CountMeta count={count} />}\n </Flex>\n </Flex>\n )}\n {!isSmallOrAbove && (\n <>\n <Flex container={{ alignItems: 'start', justify: 'between', gap: 1 }}>\n {additionalActions}\n <Flex\n as={StyledSearchForm}\n container={{ alignItems: 'center', wrap: 'wrap', gap: 1 }}\n item={{ grow: 1 }}\n >\n {search && searchInputWrapper}\n </Flex>\n {createNewButton}\n {basicModeActions && (\n <span>\n <Actions\n items={basicModeActions.map(({ icon, ...restProps }) => ({\n visual: icon ? <Icon name={icon} /> : undefined,\n ...restProps\n }))}\n menuAt={1}\n ref={consolidatedActionsButtonRef}\n />\n </span>\n )}\n </Flex>\n </>\n )}\n\n {queryOptionPopover}\n\n <PresetMenuPopover\n buttonRef={consolidatedActionsButtonRef}\n heading={actionsQueryOptionPreset?.heading}\n menu={actionsQueryOptionPreset?.menu}\n isOpen={optionPresetMenuOpen}\n onClose={() => setOptionPresetMenuOpen(false)}\n />\n </Flex>\n );\n }\n);\n\nexport default ListToolbar;\n"]}
|
|
@@ -2,4 +2,6 @@ export declare const StyledSearchForm: import("styled-components").StyledCompone
|
|
|
2
2
|
export declare const StyledViewSelector: import("styled-components").StyledComponent<import("react").FunctionComponent<import("../..").ForwardProps & import("../MenuButton").MenuButtonProps>, import("styled-components").DefaultTheme, {}, never>;
|
|
3
3
|
export declare const StyledListToolbar: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
4
4
|
export declare const StyledHeadingText: import("styled-components").StyledComponent<import("react").FunctionComponent<import("../Text").TextProps & import("../..").ForwardProps>, import("styled-components").DefaultTheme, {}, never>;
|
|
5
|
+
export declare const StyledCountMeta: import("styled-components").StyledComponent<import("react").FunctionComponent<import("../Text").TextProps & import("../..").ForwardProps>, import("styled-components").DefaultTheme, {}, never>;
|
|
6
|
+
export declare const StyledContainer: import("styled-components").StyledComponent<import("react").FunctionComponent<import("../Flex").FlexProps & import("../..").ForwardProps>, import("styled-components").DefaultTheme, {}, never>;
|
|
5
7
|
//# sourceMappingURL=ListToolbar.styles.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListToolbar.styles.d.ts","sourceRoot":"","sources":["../../../src/components/ListToolbar/ListToolbar.styles.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ListToolbar.styles.d.ts","sourceRoot":"","sources":["../../../src/components/ListToolbar/ListToolbar.styles.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,gBAAgB,yGAK5B,CAAC;AAEF,eAAO,MAAM,kBAAkB,6MA0B7B,CAAC;AAIH,eAAO,MAAM,iBAAiB,yGAW5B,CAAC;AAIH,eAAO,MAAM,iBAAiB,iMAkB5B,CAAC;AAIH,eAAO,MAAM,eAAe,iMAW1B,CAAC;AAIH,eAAO,MAAM,eAAe,iMAU3B,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import styled, { css } from 'styled-components';
|
|
2
|
+
import Flex from '../Flex';
|
|
2
3
|
import { StyledSearchInput } from '../SearchInput';
|
|
3
4
|
import MenuButton from '../MenuButton';
|
|
4
5
|
import Text, { StyledText } from '../Text';
|
|
@@ -38,11 +39,19 @@ export const StyledViewSelector = styled(MenuButton)(({ theme, required }) => {
|
|
|
38
39
|
`;
|
|
39
40
|
});
|
|
40
41
|
StyledViewSelector.defaultProps = defaultThemeProp;
|
|
41
|
-
export const StyledListToolbar = styled.div
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
42
|
+
export const StyledListToolbar = styled.div(({ theme }) => {
|
|
43
|
+
return css `
|
|
44
|
+
${StyledButton} + ${StyledButton} {
|
|
45
|
+
margin-inline-start: 0;
|
|
46
|
+
}
|
|
47
|
+
border-radius: calc(0.25 * ${theme.base['border-radius']});
|
|
48
|
+
|
|
49
|
+
&:has(:focus-visible):not([disabled]) {
|
|
50
|
+
box-shadow: ${theme.base.shadow['focus-group']};
|
|
51
|
+
}
|
|
52
|
+
`;
|
|
53
|
+
});
|
|
54
|
+
StyledListToolbar.defaultProps = defaultThemeProp;
|
|
46
55
|
export const StyledHeadingText = styled(Text)(({ theme, required }) => {
|
|
47
56
|
const { urgent } = theme.base.palette;
|
|
48
57
|
const hitAreaMouse = theme.base['hit-area']['mouse-min'];
|
|
@@ -62,4 +71,27 @@ export const StyledHeadingText = styled(Text)(({ theme, required }) => {
|
|
|
62
71
|
`;
|
|
63
72
|
});
|
|
64
73
|
StyledHeadingText.defaultProps = defaultThemeProp;
|
|
74
|
+
export const StyledCountMeta = styled(Text)(({ theme }) => {
|
|
75
|
+
const hitAreaMouse = theme.base['hit-area']['mouse-min'];
|
|
76
|
+
const hitAreaFinger = theme.base['hit-area']['finger-min'];
|
|
77
|
+
return css `
|
|
78
|
+
line-height: ${hitAreaMouse};
|
|
79
|
+
|
|
80
|
+
@media (pointer: coarse) {
|
|
81
|
+
line-height: ${hitAreaFinger};
|
|
82
|
+
}
|
|
83
|
+
`;
|
|
84
|
+
});
|
|
85
|
+
StyledCountMeta.defaultProps = defaultThemeProp;
|
|
86
|
+
export const StyledContainer = styled(Flex) `
|
|
87
|
+
@media (pointer: coarse) {
|
|
88
|
+
overflow: hidden;
|
|
89
|
+
|
|
90
|
+
${StyledHeadingText}, ${StyledViewSelector} ${StyledText} {
|
|
91
|
+
white-space: nowrap;
|
|
92
|
+
overflow: hidden;
|
|
93
|
+
text-overflow: ellipsis;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
`;
|
|
65
97
|
//# sourceMappingURL=ListToolbar.styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListToolbar.styles.js","sourceRoot":"","sources":["../../../src/components/ListToolbar/ListToolbar.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,UAAU,MAAM,eAAe,CAAC;AACvC,OAAO,IAAI,EAAE,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAY,MAAM,cAAc,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAEzC,MAAM,CAAC,MAAM,gBAAgB,GAAG,MAAM,CAAC,GAAG,CAAA;IACtC,iBAAiB;;;;CAIpB,CAAC;AAEF,MAAM,CAAC,MAAM,kBAAkB,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE;IAC3E,MAAM,SAAS,GAAG,iBAAiB,CAAC,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC;IACvF,MAAM,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC;IACtC,MAAM,YAAY,GAAG,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,WAAW,CAAC,CAAC;IACzD,MAAM,aAAa,GAAG,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,YAAY,CAAC,CAAC;IAE3D,OAAO,GAAG,CAAA;;;MAGN,UAAU;mBACG,SAAS,CAAC,KAAK,C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AU,CAAC,CAAC,WAAW,CAAC,CAAC;IACzD,MAAM,aAAa,GAAG,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,YAAY,CAAC,CAAC;IAE3D,OAAO,GAAG,CAAA;mBACO,YAAY;;;qBAGV,aAAa;;;iBAGjB,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM;;;eAG9B,MAAM;;GAElB,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,iBAAiB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAElD,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IACxD,MAAM,YAAY,GAAG,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,WAAW,CAAC,CAAC;IACzD,MAAM,aAAa,GAAG,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,YAAY,CAAC,CAAC;IAE3D,OAAO,GAAG,CAAA;mBACO,YAAY;;;qBAGV,aAAa;;GAE/B,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAEhD,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC,IAAI,CAAC,CAAA;;;;MAIrC,iBAAiB,KAAK,kBAAkB,IAAI,UAAU;;;;;;CAM3D,CAAC","sourcesContent":["import styled, { css } from 'styled-components';\n\nimport Flex from '../Flex';\nimport { StyledSearchInput } from '../SearchInput';\nimport MenuButton from '../MenuButton';\nimport Text, { StyledText } from '../Text';\nimport { defaultThemeProp } from '../../theme';\nimport { calculateFontSize, FontSize } from '../../styles';\nimport { StyledButton } from '../Button';\n\nexport const StyledSearchForm = styled.div`\n ${StyledSearchInput} {\n flex-grow: 1;\n max-width: min(100%, 40ch);\n }\n`;\n\nexport const StyledViewSelector = styled(MenuButton)(({ theme, required }) => {\n const fontSizes = calculateFontSize(theme.base['font-size'], theme.base['font-scale']);\n const { urgent } = theme.base.palette;\n const hitAreaMouse = theme.base['hit-area']['mouse-min'];\n const hitAreaFinger = theme.base['hit-area']['finger-min'];\n\n return css`\n flex-shrink: initial;\n white-space: initial;\n ${StyledText} {\n font-size: ${fontSizes[theme.components.text.h3['font-size'] as FontSize]};\n font-weight: ${theme.components.text.h3['font-weight']};\n line-height: ${hitAreaMouse};\n word-break: break-word;\n @media (pointer: coarse) {\n line-height: ${hitAreaFinger};\n }\n }\n\n ${StyledText}::after {\n display: ${required ? 'inline-block' : 'none'};\n content: '\\\\00a0*';\n vertical-align: top;\n color: ${urgent};\n }\n `;\n});\n\nStyledViewSelector.defaultProps = defaultThemeProp;\n\nexport const StyledListToolbar = styled.div(({ theme }) => {\n return css`\n ${StyledButton} + ${StyledButton} {\n margin-inline-start: 0;\n }\n border-radius: calc(0.25 * ${theme.base['border-radius']});\n\n &:has(:focus-visible):not([disabled]) {\n box-shadow: ${theme.base.shadow['focus-group']};\n }\n `;\n});\n\nStyledListToolbar.defaultProps = defaultThemeProp;\n\nexport const StyledHeadingText = styled(Text)(({ theme, required }) => {\n const { urgent } = theme.base.palette;\n const hitAreaMouse = theme.base['hit-area']['mouse-min'];\n const hitAreaFinger = theme.base['hit-area']['finger-min'];\n\n return css`\n line-height: ${hitAreaMouse};\n word-break: break-word;\n @media (pointer: coarse) {\n line-height: ${hitAreaFinger};\n }\n &::after {\n display: ${required ? 'inline' : 'none'};\n content: '\\\\00a0*';\n vertical-align: top;\n color: ${urgent};\n }\n `;\n});\n\nStyledHeadingText.defaultProps = defaultThemeProp;\n\nexport const StyledCountMeta = styled(Text)(({ theme }) => {\n const hitAreaMouse = theme.base['hit-area']['mouse-min'];\n const hitAreaFinger = theme.base['hit-area']['finger-min'];\n\n return css`\n line-height: ${hitAreaMouse};\n\n @media (pointer: coarse) {\n line-height: ${hitAreaFinger};\n }\n `;\n});\n\nStyledCountMeta.defaultProps = defaultThemeProp;\n\nexport const StyledContainer = styled(Flex)`\n @media (pointer: coarse) {\n overflow: hidden;\n\n ${StyledHeadingText}, ${StyledViewSelector} ${StyledText} {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n }\n`;\n"]}
|
|
@@ -49,8 +49,10 @@ export interface PresetMenuProps extends QueryOption {
|
|
|
49
49
|
}
|
|
50
50
|
export declare type QueryOptionId = 'filter' | 'sort' | 'group';
|
|
51
51
|
export interface ListToolbarProps extends BaseProps {
|
|
52
|
-
/** Renders a simple
|
|
53
|
-
|
|
52
|
+
/** Renders a simple text name of table */
|
|
53
|
+
name: string;
|
|
54
|
+
/** Renders a simple view heading text or view selection menu. */
|
|
55
|
+
viewSelector?: ViewSelectorProps;
|
|
54
56
|
formControlProps?: Pick<FormControlProps, 'required'>;
|
|
55
57
|
/** Props related to new item creation button. */
|
|
56
58
|
createNew?: {
|
|
@@ -83,8 +85,6 @@ export interface ListToolbarProps extends BaseProps {
|
|
|
83
85
|
actions?: Action[];
|
|
84
86
|
/** Ref for the actions button element. */
|
|
85
87
|
actionsButtonRef?: Ref<HTMLButtonElement>;
|
|
86
|
-
/** Renders toolbar in condensed mode. */
|
|
87
|
-
condensed?: boolean;
|
|
88
88
|
/** Ref for the wrapping element. */
|
|
89
89
|
ref?: Ref<HTMLDivElement>;
|
|
90
90
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListToolbar.types.d.ts","sourceRoot":"","sources":["../../../src/components/ListToolbar/ListToolbar.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElE,OAAO,EAAE,gBAAgB,EAAE,MAAM,oDAAoD,CAAC;AAEtF,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AA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"ListToolbar.types.js","sourceRoot":"","sources":["../../../src/components/ListToolbar/ListToolbar.types.ts"],"names":[],"mappings":"","sourcesContent":["import { MouseEvent, Ref, ComponentType, ReactNode } from 'react';\n\nimport { FormControlProps } from '@pega/cosmos-react-core/lib/components/FormControl';\n\nimport { SearchInputProps } from '../SearchInput';\nimport { MenuProps } from '../Menu';\nimport { Action, BaseProps } from '../../types';\n\nexport interface ViewSelectorProps {\n /** A list of pre-defined data views. */\n views: {\n id: string;\n text: string;\n selected: boolean;\n }[];\n /** Called when a view is selected. */\n onViewSelect: MenuProps['onItemClick'];\n defaultId?: string;\n appDefaultId?: string;\n}\nexport interface QueryOption {\n /** A count representing the number of applied conditions within the query option. */\n count?: number;\n}\n\nexport interface QueryOptionDialogProps extends QueryOption {\n /** A component to render the content portion of the query option dialog. */\n renderer: ComponentType;\n /**\n * Called when the user explicitly or implicitly cancels(closes) the query dialog.\n * Returning false will block the dialog from closing.\n */\n onCancel: () => boolean | void;\n /**\n * Called when the user explicitly applies the query option conditions.\n * Returning false will block the dialog from closing.\n */\n onSubmit: () => boolean | void;\n}\n\n/** Optionally provide query option presets. */\nexport interface PresetMenuProps extends QueryOption {\n /** Mode defining whether menu selection is single or multi mode. */\n mode?: Exclude<MenuProps['mode'], 'action'>;\n /** Items of the menu. */\n items: { id: string; text: string; selected: boolean; icon?: string }[];\n /** Callback invoked on item selection. Passes the item id as an argument. */\n onItemClick: MenuProps['onItemClick'];\n}\nexport type QueryOptionId = 'filter' | 'sort' | 'group';\n\nexport interface ListToolbarProps extends BaseProps {\n /** Renders a simple heading or view selection menu. */\n
|
|
1
|
+
{"version":3,"file":"ListToolbar.types.js","sourceRoot":"","sources":["../../../src/components/ListToolbar/ListToolbar.types.ts"],"names":[],"mappings":"","sourcesContent":["import { MouseEvent, Ref, ComponentType, ReactNode } from 'react';\n\nimport { FormControlProps } from '@pega/cosmos-react-core/lib/components/FormControl';\n\nimport { SearchInputProps } from '../SearchInput';\nimport { MenuProps } from '../Menu';\nimport { Action, BaseProps } from '../../types';\n\nexport interface ViewSelectorProps {\n /** A list of pre-defined data views. */\n views: {\n id: string;\n text: string;\n selected: boolean;\n }[];\n /** Called when a view is selected. */\n onViewSelect: MenuProps['onItemClick'];\n defaultId?: string;\n appDefaultId?: string;\n}\nexport interface QueryOption {\n /** A count representing the number of applied conditions within the query option. */\n count?: number;\n}\n\nexport interface QueryOptionDialogProps extends QueryOption {\n /** A component to render the content portion of the query option dialog. */\n renderer: ComponentType;\n /**\n * Called when the user explicitly or implicitly cancels(closes) the query dialog.\n * Returning false will block the dialog from closing.\n */\n onCancel: () => boolean | void;\n /**\n * Called when the user explicitly applies the query option conditions.\n * Returning false will block the dialog from closing.\n */\n onSubmit: () => boolean | void;\n}\n\n/** Optionally provide query option presets. */\nexport interface PresetMenuProps extends QueryOption {\n /** Mode defining whether menu selection is single or multi mode. */\n mode?: Exclude<MenuProps['mode'], 'action'>;\n /** Items of the menu. */\n items: { id: string; text: string; selected: boolean; icon?: string }[];\n /** Callback invoked on item selection. Passes the item id as an argument. */\n onItemClick: MenuProps['onItemClick'];\n}\nexport type QueryOptionId = 'filter' | 'sort' | 'group';\n\nexport interface ListToolbarProps extends BaseProps {\n /** Renders a simple text name of table */\n name: string;\n /** Renders a simple view heading text or view selection menu. */\n viewSelector?: ViewSelectorProps;\n formControlProps?: Pick<FormControlProps, 'required'>;\n /** Props related to new item creation button. */\n createNew?: {\n /** Label of the new item creation button. */\n label?: string;\n /** Callback that will render a Create new button and is fired when that button is clicked. */\n onClick: (e: MouseEvent) => void;\n };\n /** Props related to the Search Input. */\n search?: SearchInputProps;\n /** Total returned results related for a given search. Optional indication of a selected item count. */\n count?: {\n total?: number;\n /**\n * If true renders + next to total number.\n * @default false\n */\n totalHasMore?: boolean;\n selected?: number;\n };\n /** Additional actions region */\n additionalActions?: ReactNode;\n /** Custom Rendering or available presets for filtering. */\n filter?: QueryOptionDialogProps | PresetMenuProps;\n /** Custom Rendering or available presets for sorting. */\n sort?: QueryOptionDialogProps | PresetMenuProps;\n /** Custom Rendering or available presets for grouping. */\n group?: QueryOptionDialogProps | PresetMenuProps;\n /** Top level dataset actions. */\n actions?: Action[];\n /** Ref for the actions button element. */\n actionsButtonRef?: Ref<HTMLButtonElement>;\n /** Ref for the wrapping element. */\n ref?: Ref<HTMLDivElement>;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Context.d.ts","sourceRoot":"","sources":["../../../src/components/LiveLog/Context.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAG3D,eAAO,MAAM,cAAc,8CAKzB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { createContext } from 'react';
|
|
2
|
+
// eslint-disable-next-line import/prefer-default-export
|
|
3
|
+
export const LiveLogContext = createContext({
|
|
4
|
+
announce: () => { },
|
|
5
|
+
announcePolite: () => { },
|
|
6
|
+
announceAssertive: () => { },
|
|
7
|
+
initialized: false
|
|
8
|
+
});
|
|
9
|
+
//# sourceMappingURL=Context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Context.js","sourceRoot":"","sources":["../../../src/components/LiveLog/Context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAItC,wDAAwD;AACxD,MAAM,CAAC,MAAM,cAAc,GAAG,aAAa,CAAsB;IAC/D,QAAQ,EAAE,GAAG,EAAE,GAAE,CAAC;IAClB,cAAc,EAAE,GAAG,EAAE,GAAE,CAAC;IACxB,iBAAiB,EAAE,GAAG,EAAE,GAAE,CAAC;IAC3B,WAAW,EAAE,KAAK;CACnB,CAAC,CAAC","sourcesContent":["import { createContext } from 'react';\n\nimport type { LiveLogContextValue } from './LiveLog.types';\n\n// eslint-disable-next-line import/prefer-default-export\nexport const LiveLogContext = createContext<LiveLogContextValue>({\n announce: () => {},\n announcePolite: () => {},\n announceAssertive: () => {},\n initialized: false\n});\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type FunctionComponent, type Context } from 'react';
|
|
2
|
+
import type { LiveLogContextValue, LiveLogProps } from './LiveLog.types';
|
|
3
|
+
declare module '../../init' {
|
|
4
|
+
interface CosmosGlobals {
|
|
5
|
+
liveLogContext?: Context<LiveLogContextValue>;
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
declare const LiveLog: FunctionComponent<LiveLogProps>;
|
|
9
|
+
export default LiveLog;
|
|
10
|
+
//# sourceMappingURL=LiveLog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LiveLog.d.ts","sourceRoot":"","sources":["../../../src/components/LiveLog/LiveLog.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,iBAAiB,EAEtB,KAAK,OAAO,EAIb,MAAM,OAAO,CAAC;AAMf,OAAO,KAAK,EACV,mBAAmB,EACnB,YAAY,EAGb,MAAM,iBAAiB,CAAC;AAGzB,OAAO,QAAQ,YAAY,CAAC;IAC1B,UAAiB,aAAa;QAC5B,cAAc,CAAC,EAAE,OAAO,CAAC,mBAAmB,CAAC,CAAC;KAC/C;CACF;AAwDD,QAAA,MAAM,OAAO,EAAE,iBAAiB,CAAC,YAAY,CAsE5C,CAAC;AAEF,eAAe,OAAO,CAAC"}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useContext, useReducer } from 'react';
|
|
3
|
+
import { createUID, windowIsAvailable } from '../../utils';
|
|
4
|
+
import { useI18n } from '../../hooks';
|
|
5
|
+
import { StyledLog } from './LiveLog.styles';
|
|
6
|
+
import { LiveLogContext } from './Context';
|
|
7
|
+
const reducer = (state, action) => {
|
|
8
|
+
const type = action.type;
|
|
9
|
+
switch (type) {
|
|
10
|
+
case 'announce': {
|
|
11
|
+
const message = action.payload.message;
|
|
12
|
+
const messageType = action.payload.type;
|
|
13
|
+
const announceMessage = ['alert', 'error', 'exception'].includes(messageType) ||
|
|
14
|
+
!state.suppressedTypes.includes(messageType);
|
|
15
|
+
if (announceMessage) {
|
|
16
|
+
const id = createUID();
|
|
17
|
+
if (action.payload.level === 'assertive') {
|
|
18
|
+
return {
|
|
19
|
+
...state,
|
|
20
|
+
assertiveMessages: [...state.assertiveMessages, { message, id }]
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
return {
|
|
24
|
+
...state,
|
|
25
|
+
politeMessages: [...state.politeMessages, { message, id }]
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
return state;
|
|
29
|
+
}
|
|
30
|
+
case 'setMaxLength': {
|
|
31
|
+
return {
|
|
32
|
+
...state,
|
|
33
|
+
maxLength: action.payload > 0 ? action.payload : 50
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
case 'trimLength': {
|
|
37
|
+
const trimPolite = state.politeMessages.length > state.maxLength;
|
|
38
|
+
const trimAssertive = state.assertiveMessages.length > state.maxLength;
|
|
39
|
+
return {
|
|
40
|
+
...state,
|
|
41
|
+
politeMessages: trimPolite
|
|
42
|
+
? [...state.politeMessages.slice(-state.maxLength)]
|
|
43
|
+
: state.politeMessages,
|
|
44
|
+
assertiveMessages: trimAssertive
|
|
45
|
+
? [...state.assertiveMessages.slice(-state.maxLength)]
|
|
46
|
+
: state.assertiveMessages
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
default:
|
|
50
|
+
return state;
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
const LiveLog = ({ children, maxLength = 50 }) => {
|
|
54
|
+
const t = useI18n();
|
|
55
|
+
const [state, dispatch] = useReducer(reducer, {
|
|
56
|
+
maxLength,
|
|
57
|
+
politeMessages: [],
|
|
58
|
+
assertiveMessages: [],
|
|
59
|
+
suppressedTypes: [] // initialize via a11y settings once available.
|
|
60
|
+
});
|
|
61
|
+
// Manage log length.
|
|
62
|
+
useEffect(() => {
|
|
63
|
+
const timeout = setTimeout(() => {
|
|
64
|
+
dispatch({ type: 'trimLength' });
|
|
65
|
+
}, 1000);
|
|
66
|
+
return () => {
|
|
67
|
+
clearTimeout(timeout);
|
|
68
|
+
};
|
|
69
|
+
}, [state.assertiveMessages, state.politeMessages, state.maxLength]);
|
|
70
|
+
// Update max length
|
|
71
|
+
useEffect(() => {
|
|
72
|
+
dispatch({ type: 'setMaxLength', payload: maxLength });
|
|
73
|
+
}, [maxLength]);
|
|
74
|
+
// Don't create additional LiveLogContext.Providers.
|
|
75
|
+
const context = windowIsAvailable
|
|
76
|
+
? window.cosmos.liveLogContext ?? LiveLogContext
|
|
77
|
+
: LiveLogContext;
|
|
78
|
+
const priorCtx = useContext(context);
|
|
79
|
+
if (priorCtx.initialized) {
|
|
80
|
+
return _jsx(context.Provider, { value: priorCtx, children: children });
|
|
81
|
+
}
|
|
82
|
+
return (_jsxs(context.Provider, { value: {
|
|
83
|
+
announce: ({ message, type = 'info', assertive = false }) => {
|
|
84
|
+
dispatch({
|
|
85
|
+
type: 'announce',
|
|
86
|
+
payload: { message, type, level: assertive ? 'assertive' : 'polite' }
|
|
87
|
+
});
|
|
88
|
+
},
|
|
89
|
+
announcePolite: ({ message, type = 'info' }) => {
|
|
90
|
+
dispatch({ type: 'announce', payload: { message, type, level: 'polite' } });
|
|
91
|
+
},
|
|
92
|
+
announceAssertive: ({ message, type = 'info' }) => {
|
|
93
|
+
dispatch({ type: 'announce', payload: { message, type, level: 'assertive' } });
|
|
94
|
+
},
|
|
95
|
+
initialized: true
|
|
96
|
+
}, children: [children, _jsxs(StyledLog, { role: 'log', "aria-relevant": 'additions', children: [_jsx("h6", { children: t('polite_announcements') }), state.politeMessages.map(({ message, id }) => (_jsx("p", { children: message }, id)))] }), _jsxs(StyledLog, { role: 'log', "aria-live": 'assertive', "aria-relevant": 'additions', children: [_jsx("h6", { children: t('assertive_announcements') }), state.assertiveMessages.map(({ message, id }) => (_jsx("p", { children: message }, id)))] })] }));
|
|
97
|
+
};
|
|
98
|
+
export default LiveLog;
|
|
99
|
+
//# sourceMappingURL=LiveLog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LiveLog.js","sourceRoot":"","sources":["../../../src/components/LiveLog/LiveLog.tsx"],"names":[],"mappings":";AAAA,OAAO,EAIL,SAAS,EACT,UAAU,EACV,UAAU,EACX,MAAM,OAAO,CAAC;AAEf,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAC3D,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEtC,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAO7C,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAQ3C,MAAM,OAAO,GAAG,CAAC,KAAmB,EAAE,MAAqB,EAAE,EAAE;IAC7D,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC;IAEzB,QAAQ,IAAI,EAAE;QACZ,KAAK,UAAU,CAAC,CAAC;YACf,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC;YACvC,MAAM,WAAW,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC;YACxC,MAAM,eAAe,GACnB,CAAC,OAAO,EAAE,OAAO,EAAE,WAAW,CAAC,CAAC,QAAQ,CAAC,WAAW,CAAC;gBACrD,CAAC,KAAK,CAAC,eAAe,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;YAE/C,IAAI,eAAe,EAAE;gBACnB,MAAM,EAAE,GAAG,SAAS,EAAE,CAAC;gBAEvB,IAAI,MAAM,CAAC,OAAO,CAAC,KAAK,KAAK,WAAW,EAAE;oBACxC,OAAO;wBACL,GAAG,KAAK;wBACR,iBAAiB,EAAE,CAAC,GAAG,KAAK,CAAC,iBAAiB,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;qBACjE,CAAC;iBACH;gBAED,OAAO;oBAC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n\nimport { createUID, windowIsAvailable } from '../../utils';\nimport { useI18n } from '../../hooks';\n\nimport { StyledLog } from './LiveLog.styles';\nimport type {\n LiveLogContextValue,\n LiveLogProps,\n LiveLogState,\n ReducerAction\n} from './LiveLog.types';\nimport { LiveLogContext } from './Context';\n\ndeclare module '../../init' {\n export interface CosmosGlobals {\n liveLogContext?: Context<LiveLogContextValue>;\n }\n}\n\nconst reducer = (state: LiveLogState, action: ReducerAction) => {\n const type = action.type;\n\n switch (type) {\n case 'announce': {\n const message = action.payload.message;\n const messageType = action.payload.type;\n const announceMessage =\n ['alert', 'error', 'exception'].includes(messageType) ||\n !state.suppressedTypes.includes(messageType);\n\n if (announceMessage) {\n const id = createUID();\n\n if (action.payload.level === 'assertive') {\n return {\n ...state,\n assertiveMessages: [...state.assertiveMessages, { message, id }]\n };\n }\n\n return {\n ...state,\n politeMessages: [...state.politeMessages, { message, id }]\n };\n }\n\n return state;\n }\n case 'setMaxLength': {\n return {\n ...state,\n maxLength: action.payload > 0 ? action.payload : 50\n };\n }\n case 'trimLength': {\n const trimPolite = state.politeMessages.length > state.maxLength;\n const trimAssertive = state.assertiveMessages.length > state.maxLength;\n\n return {\n ...state,\n politeMessages: trimPolite\n ? [...state.politeMessages.slice(-state.maxLength)]\n : state.politeMessages,\n assertiveMessages: trimAssertive\n ? [...state.assertiveMessages.slice(-state.maxLength)]\n : state.assertiveMessages\n };\n }\n default:\n return state;\n }\n};\n\nconst LiveLog: FunctionComponent<LiveLogProps> = ({ children, maxLength = 50 }: LiveLogProps) => {\n const t = useI18n();\n\n const [state, dispatch] = useReducer<Reducer<LiveLogState, ReducerAction>>(reducer, {\n maxLength,\n politeMessages: [],\n assertiveMessages: [],\n suppressedTypes: [] // initialize via a11y settings once available.\n });\n\n // Manage log length.\n useEffect(() => {\n const timeout = setTimeout(() => {\n dispatch({ type: 'trimLength' });\n }, 1000);\n\n return () => {\n clearTimeout(timeout);\n };\n }, [state.assertiveMessages, state.politeMessages, state.maxLength]);\n\n // Update max length\n useEffect(() => {\n dispatch({ type: 'setMaxLength', payload: maxLength });\n }, [maxLength]);\n\n // Don't create additional LiveLogContext.Providers.\n const context = windowIsAvailable\n ? window.cosmos.liveLogContext ?? LiveLogContext\n : LiveLogContext;\n const priorCtx = useContext(context);\n if (priorCtx.initialized) {\n return <context.Provider value={priorCtx}>{children}</context.Provider>;\n }\n\n return (\n <context.Provider\n value={{\n announce: ({ message, type = 'info', assertive = false }) => {\n dispatch({\n type: 'announce',\n payload: { message, type, level: assertive ? 'assertive' : 'polite' }\n });\n },\n announcePolite: ({ message, type = 'info' }) => {\n dispatch({ type: 'announce', payload: { message, type, level: 'polite' } });\n },\n announceAssertive: ({ message, type = 'info' }) => {\n dispatch({ type: 'announce', payload: { message, type, level: 'assertive' } });\n },\n initialized: true\n }}\n >\n {children}\n\n <StyledLog role='log' aria-relevant='additions'>\n <h6>{t('polite_announcements')}</h6>\n {state.politeMessages.map(({ message, id }) => (\n <p key={id}>{message}</p>\n ))}\n </StyledLog>\n\n <StyledLog role='log' aria-live='assertive' aria-relevant='additions'>\n <h6>{t('assertive_announcements')}</h6>\n {state.assertiveMessages.map(({ message, id }) => (\n <p key={id}>{message}</p>\n ))}\n </StyledLog>\n </context.Provider>\n );\n};\n\nexport default LiveLog;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LiveLog.styles.d.ts","sourceRoot":"","sources":["../../../src/components/LiveLog/LiveLog.styles.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,SAAS,yGAIrB,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import styled from 'styled-components';
|
|
2
|
+
import { hideVisually } from 'polished';
|
|
3
|
+
export const StyledLog = styled.div `
|
|
4
|
+
${hideVisually}
|
|
5
|
+
-webkit-user-select: none;
|
|
6
|
+
user-select: none;
|
|
7
|
+
`;
|
|
8
|
+
export default StyledLog;
|
|
9
|
+
//# sourceMappingURL=LiveLog.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LiveLog.styles.js","sourceRoot":"","sources":["../../../src/components/LiveLog/LiveLog.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,mBAAmB,CAAC;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAExC,MAAM,CAAC,MAAM,SAAS,GAAG,MAAM,CAAC,GAAG,CAAA;IAC/B,YAAY;;;CAGf,CAAC;AAEF,eAAe,SAAS,CAAC","sourcesContent":["import styled from 'styled-components';\nimport { hideVisually } from 'polished';\n\nexport const StyledLog = styled.div`\n ${hideVisually}\n -webkit-user-select: none;\n user-select: none;\n`;\n\nexport default StyledLog;\n"]}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
export declare type AnnouncementType =
|
|
3
|
+
/** Immediate attention req.
|
|
4
|
+
* (high priority)
|
|
5
|
+
* (cannot be disabled)
|
|
6
|
+
*/
|
|
7
|
+
'alert'
|
|
8
|
+
/** Immediate action req.
|
|
9
|
+
* (high priority)
|
|
10
|
+
* (cannot be disabled)
|
|
11
|
+
*/
|
|
12
|
+
| 'error'
|
|
13
|
+
/** System failure
|
|
14
|
+
* (high priority)
|
|
15
|
+
* (cannot be disabled)
|
|
16
|
+
*/
|
|
17
|
+
| 'exception'
|
|
18
|
+
/** No immediate action req.
|
|
19
|
+
* (medium priority)
|
|
20
|
+
*/
|
|
21
|
+
| 'warning'
|
|
22
|
+
/** Feedback on actions
|
|
23
|
+
* (medium priority)
|
|
24
|
+
*/
|
|
25
|
+
| 'acknowledgement'
|
|
26
|
+
/** Confirmation of action completion
|
|
27
|
+
* (medium priority)
|
|
28
|
+
*/
|
|
29
|
+
| 'success'
|
|
30
|
+
/** Passive notification
|
|
31
|
+
* (low priority)
|
|
32
|
+
* (ex: "Kelly liked your comment.")
|
|
33
|
+
*/
|
|
34
|
+
| 'info'
|
|
35
|
+
/** System feedback
|
|
36
|
+
* (low priority)
|
|
37
|
+
* (ex: "Loading create form.")
|
|
38
|
+
*/
|
|
39
|
+
| 'status';
|
|
40
|
+
interface AnnounceMethodProps {
|
|
41
|
+
/** Message to announce */
|
|
42
|
+
message: string;
|
|
43
|
+
/** Announcement type
|
|
44
|
+
* @default 'info'
|
|
45
|
+
*/
|
|
46
|
+
type?: AnnouncementType;
|
|
47
|
+
}
|
|
48
|
+
interface GenericAnnounceMethodProps extends AnnounceMethodProps {
|
|
49
|
+
/** Whether announcement is assertive.
|
|
50
|
+
* @default false
|
|
51
|
+
*/
|
|
52
|
+
assertive?: boolean;
|
|
53
|
+
}
|
|
54
|
+
export interface LiveLogContextValue {
|
|
55
|
+
announce: (props: GenericAnnounceMethodProps) => void;
|
|
56
|
+
announcePolite: (props: AnnounceMethodProps) => void;
|
|
57
|
+
announceAssertive: (props: AnnounceMethodProps) => void;
|
|
58
|
+
/** @internal */
|
|
59
|
+
initialized: boolean;
|
|
60
|
+
}
|
|
61
|
+
export interface LiveLogProps {
|
|
62
|
+
/** Content that will be provided live log context. */
|
|
63
|
+
children: ReactNode;
|
|
64
|
+
/** Length at which to start shifting the window of persisted messages.
|
|
65
|
+
* @default 50
|
|
66
|
+
*/
|
|
67
|
+
maxLength?: number;
|
|
68
|
+
}
|
|
69
|
+
interface MessageStateItem {
|
|
70
|
+
message: AnnounceMethodProps['message'];
|
|
71
|
+
id: string;
|
|
72
|
+
}
|
|
73
|
+
export interface LiveLogState {
|
|
74
|
+
maxLength: number;
|
|
75
|
+
politeMessages: MessageStateItem[];
|
|
76
|
+
assertiveMessages: MessageStateItem[];
|
|
77
|
+
suppressedTypes: AnnouncementType[];
|
|
78
|
+
}
|
|
79
|
+
export declare type ReducerAction = {
|
|
80
|
+
type: 'announce';
|
|
81
|
+
payload: {
|
|
82
|
+
message: AnnounceMethodProps['message'];
|
|
83
|
+
level: 'polite' | 'assertive';
|
|
84
|
+
type: AnnouncementType;
|
|
85
|
+
};
|
|
86
|
+
} | {
|
|
87
|
+
type: 'setMaxLength';
|
|
88
|
+
payload: number;
|
|
89
|
+
} | {
|
|
90
|
+
type: 'trimLength';
|
|
91
|
+
};
|
|
92
|
+
export {};
|
|
93
|
+
//# sourceMappingURL=LiveLog.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LiveLog.types.d.ts","sourceRoot":"","sources":["../../../src/components/LiveLog/LiveLog.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,oBAAY,gBAAgB;AAC1B;;;GAGG;AACD,OAAO;AACT;;;GAGG;GACD,OAAO;AACT;;;GAGG;GACD,WAAW;AACb;;GAEG;GACD,SAAS;AACX;;GAEG;GACD,iBAAiB;AACnB;;GAEG;GACD,SAAS;AACX;;;GAGG;GACD,MAAM;AACR;;;GAGG;GACD,QAAQ,CAAC;AAEb,UAAU,mBAAmB;IAC3B,0BAA0B;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,IAAI,CAAC,EAAE,gBAAgB,CAAC;CACzB;AAED,UAAU,0BAA2B,SAAQ,mBAAmB;IAC9D;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,CAAC,KAAK,EAAE,0BAA0B,KAAK,IAAI,CAAC;IACtD,cAAc,EAAE,CAAC,KAAK,EAAE,mBAAmB,KAAK,IAAI,CAAC;IACrD,iBAAiB,EAAE,CAAC,KAAK,EAAE,mBAAmB,KAAK,IAAI,CAAC;IACxD,gBAAgB;IAChB,WAAW,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,WAAW,YAAY;IAC3B,sDAAsD;IACtD,QAAQ,EAAE,SAAS,CAAC;IACpB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,UAAU,gBAAgB;IACxB,OAAO,EAAE,mBAAmB,CAAC,SAAS,CAAC,CAAC;IACxC,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,MAAM,WAAW,YAAY;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,gBAAgB,EAAE,CAAC;IACnC,iBAAiB,EAAE,gBAAgB,EAAE,CAAC;IACtC,eAAe,EAAE,gBAAgB,EAAE,CAAC;CACrC;AAED,oBAAY,aAAa,GACrB;IACE,IAAI,EAAE,UAAU,CAAC;IACjB,OAAO,EAAE;QACP,OAAO,EAAE,mBAAmB,CAAC,SAAS,CAAC,CAAC;QACxC,KAAK,EAAE,QAAQ,GAAG,WAAW,CAAC;QAC9B,IAAI,EAAE,gBAAgB,CAAC;KACxB,CAAC;CACH,GACD;IACE,IAAI,EAAE,cAAc,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;CACjB,GACD;IACE,IAAI,EAAE,YAAY,CAAC;CACpB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LiveLog.types.js","sourceRoot":"","sources":["../../../src/components/LiveLog/LiveLog.types.ts"],"names":[],"mappings":"","sourcesContent":["import { type ReactNode } from 'react';\n\nexport type AnnouncementType =\n /** Immediate attention req.\n * (high priority)\n * (cannot be disabled)\n */\n | 'alert'\n /** Immediate action req.\n * (high priority)\n * (cannot be disabled)\n */\n | 'error'\n /** System failure\n * (high priority)\n * (cannot be disabled)\n */\n | 'exception'\n /** No immediate action req.\n * (medium priority)\n */\n | 'warning'\n /** Feedback on actions\n * (medium priority)\n */\n | 'acknowledgement'\n /** Confirmation of action completion\n * (medium priority)\n */\n | 'success'\n /** Passive notification\n * (low priority)\n * (ex: \"Kelly liked your comment.\")\n */\n | 'info'\n /** System feedback\n * (low priority)\n * (ex: \"Loading create form.\")\n */\n | 'status';\n\ninterface AnnounceMethodProps {\n /** Message to announce */\n message: string;\n /** Announcement type\n * @default 'info'\n */\n type?: AnnouncementType;\n}\n\ninterface GenericAnnounceMethodProps extends AnnounceMethodProps {\n /** Whether announcement is assertive.\n * @default false\n */\n assertive?: boolean;\n}\n\nexport interface LiveLogContextValue {\n announce: (props: GenericAnnounceMethodProps) => void;\n announcePolite: (props: AnnounceMethodProps) => void;\n announceAssertive: (props: AnnounceMethodProps) => void;\n /** @internal */\n initialized: boolean;\n}\n\nexport interface LiveLogProps {\n /** Content that will be provided live log context. */\n children: ReactNode;\n /** Length at which to start shifting the window of persisted messages.\n * @default 50\n */\n maxLength?: number;\n}\n\ninterface MessageStateItem {\n message: AnnounceMethodProps['message'];\n id: string;\n}\n\nexport interface LiveLogState {\n maxLength: number;\n politeMessages: MessageStateItem[];\n assertiveMessages: MessageStateItem[];\n suppressedTypes: AnnouncementType[];\n}\n\nexport type ReducerAction =\n | {\n type: 'announce';\n payload: {\n message: AnnounceMethodProps['message'];\n level: 'polite' | 'assertive';\n type: AnnouncementType;\n };\n }\n | {\n type: 'setMaxLength';\n payload: number;\n }\n | {\n type: 'trimLength';\n };\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/LiveLog/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/LiveLog/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC","sourcesContent":["export { default } from './LiveLog';\nexport { LiveLogProps, AnnouncementType } from './LiveLog.types';\nexport { LiveLogContext } from './Context';\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Menu.d.ts","sourceRoot":"","sources":["../../../src/components/Menu/Menu.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,iBAAiB,EAOlB,MAAM,OAAO,CAAC;AAWf,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAO3C,OAAO,EAAoB,SAAS,EAAE,MAAM,cAAc,CAAC;AAG3D,QAAA,MAAM,IAAI,EAAE,iBAAiB,CAAC,SAAS,GAAG,YAAY,
|
|
1
|
+
{"version":3,"file":"Menu.d.ts","sourceRoot":"","sources":["../../../src/components/Menu/Menu.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,iBAAiB,EAOlB,MAAM,OAAO,CAAC;AAWf,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAO3C,OAAO,EAAoB,SAAS,EAAE,MAAM,cAAc,CAAC;AAG3D,QAAA,MAAM,IAAI,EAAE,iBAAiB,CAAC,SAAS,GAAG,YAAY,CA2VrD,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
|
@@ -186,6 +186,7 @@ const Menu = forwardRef((props, ref) => {
|
|
|
186
186
|
const contextValue = useMemo(() => {
|
|
187
187
|
return {
|
|
188
188
|
componentId: id,
|
|
189
|
+
'aria-label': label,
|
|
189
190
|
mode,
|
|
190
191
|
arrowNavigationUnsupported,
|
|
191
192
|
onItemClick,
|
|
@@ -210,6 +211,7 @@ const Menu = forwardRef((props, ref) => {
|
|
|
210
211
|
};
|
|
211
212
|
}, [
|
|
212
213
|
id,
|
|
214
|
+
label,
|
|
213
215
|
mode,
|
|
214
216
|
arrowNavigationUnsupported,
|
|
215
217
|
onItemClick,
|