@pega/cosmos-react-core 8.34.13 → 8.35.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.
@@ -4,7 +4,7 @@ import styled, { css } from 'styled-components';
4
4
  import { rgba } from 'polished';
5
5
  import { calculateFontSize } from '../../styles';
6
6
  import { defaultThemeProp } from '../../theme';
7
- import { tryCatch, withTestIds } from '../../utils';
7
+ import { cssQuoteAndEscape, tryCatch, withTestIds } from '../../utils';
8
8
  import { useTestIds } from '../../hooks';
9
9
  import VisuallyHiddenText from '../VisuallyHiddenText';
10
10
  import { getStatusTestIds } from './Badges.test-ids';
@@ -29,7 +29,7 @@ export const StyledStatus = styled.span(({ theme, variant, afterContent }) => {
29
29
  padding-inline: calc(${spacing} / 2);
30
30
 
31
31
  &::after {
32
- content: '${afterContent}' / '';
32
+ content: ${cssQuoteAndEscape(`${afterContent}`)} / '';
33
33
  text-transform: uppercase;
34
34
  }
35
35
  `;
@@ -1 +1 @@
1
- {"version":3,"file":"Status.js","sourceRoot":"","sources":["../../../src/components/Badges/Status.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAEnC,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAEhC,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,kBAAkB,MAAM,uBAAuB,CAAC;AAEvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAYrD,MAAM,CAAC,MAAM,YAAY,GAAG,MAAM,CAAC,IAAI,CAErC,CAAC,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C,CAChB,CAAC;AACJ,CAAC,CAAC,EACF,gBAAgB,CACjB,CAAC","sourcesContent":["import { forwardRef } from 'react';\nimport type { PropsWithoutRef, ReactText } from 'react';\nimport styled, { css } from 'styled-components';\nimport { rgba } from 'polished';\n\nimport { calculateFontSize } from '../../styles';\nimport { defaultThemeProp } from '../../theme';\nimport type { RefElement, WithAttributes, TestIdProp } from '../../types';\nimport { tryCatch, withTestIds } from '../../utils';\nimport { useTestIds } from '../../hooks';\nimport VisuallyHiddenText from '../VisuallyHiddenText';\n\nimport { getStatusTestIds } from './Badges.test-ids';\n\nexport type StatusProps = WithAttributes<\n 'span',\n TestIdProp & {\n /** Determines the color to render the Badge as. This color is derived from the Theme. */\n variant: 'success' | 'urgent' | 'warn' | 'pending' | 'info';\n /** The content of the Badge, transformed to uppercase. */\n children: ReactText;\n }\n>;\n\nexport const StyledStatus = styled.span<\n Pick<StatusProps, 'variant'> & { afterContent: StatusProps['children'] }\n>(({ theme, variant, afterContent }) => {\n const { spacing } = theme.base;\n const borderRadius = theme.base['border-radius'];\n const { 'font-stretch': fontStretch, status } = theme.components.badges;\n\n const { background, foreground } = status[variant];\n const shadow = tryCatch(() => rgba(foreground, 0.1));\n const fontSize = calculateFontSize(theme.base['font-size'], theme.base['font-scale']);\n\n return css`\n display: inline-block;\n position: relative;\n background-color: ${background};\n border-radius: calc(0.25 * ${borderRadius});\n color: ${foreground};\n box-shadow: inset 0 0 0 0.0625rem ${shadow};\n font-size: ${fontSize.xxs};\n font-weight: bold;\n font-stretch: ${fontStretch};\n line-height: 1rem;\n padding-inline: calc(${spacing} / 2);\n\n &::after {\n content: '${afterContent}' / '';\n text-transform: uppercase;\n }\n `;\n});\n\nStyledStatus.defaultProps = defaultThemeProp;\n\nexport default withTestIds(\n forwardRef<RefElement<StatusProps>, PropsWithoutRef<StatusProps>>(function Status(\n { testId, variant = 'info', children, ...restProps },\n ref\n ) {\n const testIds = useTestIds(testId, getStatusTestIds);\n\n return (\n <StyledStatus\n data-testid={testIds.root}\n {...restProps}\n variant={variant}\n ref={ref}\n afterContent={children}\n >\n <VisuallyHiddenText>{`${children}`}</VisuallyHiddenText>\n </StyledStatus>\n );\n }),\n getStatusTestIds\n);\n"]}
1
+ {"version":3,"file":"Status.js","sourceRoot":"","sources":["../../../src/components/Badges/Status.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAEnC,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAEhC,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C,OAAO,EAAE,iBAAiB,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AACvE,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,kBAAkB,MAAM,uBAAuB,CAAC;AAEvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAYrD,MAAM,CAAC,MAAM,YAAY,GAAG,MAAM,CAAC,IAAI,CAErC,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,EAAE,EAAE;IACrC,MAAM,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC,IAAI,CAAC;IAC/B,MAAM,YAAY,GAAG,KAAK,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;IACjD,MAAM,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC,UAAU,CAAC,MAAM,CAAC;IAExE,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC;IACnD,MAAM,MAAM,GAAG,QAAQ,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,UAAU,EAAE,GAAG,CAAC,CAAC,CAAC;IACrD,MAAM,QAAQ,GAAG,iBAAiB,CAAC,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC;IAEtF,OAAO,GAAG,CAAA;;;wBAGY,UAAU;iCACD,YAAY;aAChC,UAAU;wCACiB,MAAM;iBAC7B,QAAQ,CAAC,GAAG;;oBAET,WAAW;;2BAEJ,OAAO;;;iBAGjB,iBAAiB,CAAC,GAAG,YAAY,EAAE,CAAC;;;GAGlD,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,YAAY,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAE7C,eAAe,WAAW,CACxB,UAAU,CAAwD,SAAS,MAAM,CAC/E,EAAE,MAAM,EAAE,OAAO,GAAG,MAAM,EAAE,QAAQ,EAAE,GAAG,SAAS,EAAE,EACpD,GAAG;IAEH,MAAM,OAAO,GAAG,UAAU,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;IAErD,OAAO,CACL,KAAC,YAAY,mBACE,OAAO,CAAC,IAAI,KACrB,SAAS,EACb,OAAO,EAAE,OAAO,EAChB,GAAG,EAAE,GAAG,EACR,YAAY,EAAE,QAAQ,YAEtB,KAAC,kBAAkB,cAAE,GAAG,QAAQ,EAAE,GAAsB,GAC3C,CAChB,CAAC;AACJ,CAAC,CAAC,EACF,gBAAgB,CACjB,CAAC","sourcesContent":["import { forwardRef } from 'react';\nimport type { PropsWithoutRef, ReactText } from 'react';\nimport styled, { css } from 'styled-components';\nimport { rgba } from 'polished';\n\nimport { calculateFontSize } from '../../styles';\nimport { defaultThemeProp } from '../../theme';\nimport type { RefElement, WithAttributes, TestIdProp } from '../../types';\nimport { cssQuoteAndEscape, tryCatch, withTestIds } from '../../utils';\nimport { useTestIds } from '../../hooks';\nimport VisuallyHiddenText from '../VisuallyHiddenText';\n\nimport { getStatusTestIds } from './Badges.test-ids';\n\nexport type StatusProps = WithAttributes<\n 'span',\n TestIdProp & {\n /** Determines the color to render the Badge as. This color is derived from the Theme. */\n variant: 'success' | 'urgent' | 'warn' | 'pending' | 'info';\n /** The content of the Badge, transformed to uppercase. */\n children: ReactText;\n }\n>;\n\nexport const StyledStatus = styled.span<\n Pick<StatusProps, 'variant'> & { afterContent: StatusProps['children'] }\n>(({ theme, variant, afterContent }) => {\n const { spacing } = theme.base;\n const borderRadius = theme.base['border-radius'];\n const { 'font-stretch': fontStretch, status } = theme.components.badges;\n\n const { background, foreground } = status[variant];\n const shadow = tryCatch(() => rgba(foreground, 0.1));\n const fontSize = calculateFontSize(theme.base['font-size'], theme.base['font-scale']);\n\n return css`\n display: inline-block;\n position: relative;\n background-color: ${background};\n border-radius: calc(0.25 * ${borderRadius});\n color: ${foreground};\n box-shadow: inset 0 0 0 0.0625rem ${shadow};\n font-size: ${fontSize.xxs};\n font-weight: bold;\n font-stretch: ${fontStretch};\n line-height: 1rem;\n padding-inline: calc(${spacing} / 2);\n\n &::after {\n content: ${cssQuoteAndEscape(`${afterContent}`)} / '';\n text-transform: uppercase;\n }\n `;\n});\n\nStyledStatus.defaultProps = defaultThemeProp;\n\nexport default withTestIds(\n forwardRef<RefElement<StatusProps>, PropsWithoutRef<StatusProps>>(function Status(\n { testId, variant = 'info', children, ...restProps },\n ref\n ) {\n const testIds = useTestIds(testId, getStatusTestIds);\n\n return (\n <StyledStatus\n data-testid={testIds.root}\n {...restProps}\n variant={variant}\n ref={ref}\n afterContent={children}\n >\n <VisuallyHiddenText>{`${children}`}</VisuallyHiddenText>\n </StyledStatus>\n );\n }),\n getStatusTestIds\n);\n"]}
@@ -1,7 +1,6 @@
1
- import type { FunctionComponent } from 'react';
2
- import type { ForwardProps } from '../../../types';
1
+ import type { WithAttributes } from '../../../types';
3
2
  import type { MultiSelectInputProps } from './MultiSelectInput.types';
4
3
  export declare const StyledMultiSelectInput: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
5
- declare const MultiSelectInput: FunctionComponent<MultiSelectInputProps & ForwardProps>;
4
+ declare const MultiSelectInput: import("react").ForwardRefExoticComponent<Omit<WithAttributes<"input", MultiSelectInputProps>, "ref"> & import("react").RefAttributes<HTMLInputElement>>;
6
5
  export default MultiSelectInput;
7
6
  //# sourceMappingURL=MultiSelectInput.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"MultiSelectInput.d.ts","sourceRoot":"","sources":["../../../../src/components/ComboBox/MultiSelectInput/MultiSelectInput.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAmD,MAAM,OAAO,CAAC;AAGhG,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAiBnD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAEtE,eAAO,MAAM,sBAAsB,yGAYlC,CAAC;AAIF,QAAA,MAAM,gBAAgB,EAAE,iBAAiB,CAAC,qBAAqB,GAAG,YAAY,CAuO7E,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
1
+ {"version":3,"file":"MultiSelectInput.d.ts","sourceRoot":"","sources":["../../../../src/components/ComboBox/MultiSelectInput/MultiSelectInput.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAkBrD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAEtE,eAAO,MAAM,sBAAsB,yGAiBlC,CAAC;AAIF,QAAA,MAAM,gBAAgB,0JAuOpB,CAAC;AAEH,eAAe,gBAAgB,CAAC"}
@@ -5,8 +5,8 @@ import { defaultThemeProp } from '../../../theme';
5
5
  import Selectable from '../../Badges/Selection';
6
6
  import { StyledFormControl } from '../../FormControl';
7
7
  import Flex from '../../Flex';
8
- import { useConsolidatedRef, useActiveDescendant, useDirection, useI18n, useUID } from '../../../hooks';
9
- import { cap } from '../../../utils';
8
+ import { useArrows, useConsolidatedRef, useDirection, useFocusWithin, useI18n, useUID } from '../../../hooks';
9
+ import { isInstance, getActiveElement } from '../../../utils';
10
10
  import VisuallyHiddenText from '../../VisuallyHiddenText';
11
11
  import { StyledSelectInput } from '../ComboBox.styles';
12
12
  export const StyledMultiSelectInput = styled(StyledSelectInput) `
@@ -15,6 +15,11 @@ export const StyledMultiSelectInput = styled(StyledSelectInput) `
15
15
  ul {
16
16
  list-style: none;
17
17
  display: contents;
18
+
19
+ /* The pill's own focus ring is enough; suppress the inner link's ring so it does not distort it. */
20
+ a[href]:focus-visible {
21
+ box-shadow: none;
22
+ }
18
23
  }
19
24
 
20
25
  input {
@@ -29,90 +34,90 @@ const MultiSelectInput = forwardRef(function MultiSelectInput(props, ref) {
29
34
  const id = useUID();
30
35
  const inputRef = useConsolidatedRef(ref);
31
36
  const listRef = useRef(null);
32
- const [focusDescendant, setFocusDescendant] = useState(null);
33
- const [activeItemId, setActiveItemId] = useState(null);
34
- const { start, end } = useDirection();
35
- const uadConfig = useMemo(() => ({
36
- focusEl: inputRef.current,
37
- scope: listRef.current,
38
- selector: 'li[role="option"]',
39
- orientation: 'horizontal',
40
- focusReturnEl: focusDescendant,
41
- clearFocusReturn: () => {
42
- setFocusDescendant(null);
43
- },
44
- pauseDescendantEvaluation,
45
- preventInitialScroll: true,
46
- onClick: (el) => {
47
- el.click();
48
- }
49
- }), [pauseDescendantEvaluation, selected, focusDescendant]);
50
- const { activeDescendant } = useActiveDescendant(uadConfig, [selected]);
37
+ const [lastFocusedId, setLastFocusedId] = useState();
38
+ const { start } = useDirection();
39
+ const selectionDescriptionId = `${id}-selectionDescription`;
40
+ const selector = ':scope > li';
41
+ const focusSelector = '[data-selection-focus]';
42
+ const tabStopId = lastFocusedId && selected.some(item => item.id.toString() === lastFocusedId)
43
+ ? lastFocusedId
44
+ : selected[selected.length - 1]?.id.toString();
51
45
  const handleSelectedRemoval = useCallback((selectionId, idx) => {
52
- if (!pauseDescendantEvaluation) {
53
- if (idx === selected.length - 1) {
54
- // If removing last selected item
55
- if (selected.length > 1) {
56
- // If other selected items, focus previous
57
- setFocusDescendant(listRef.current?.querySelectorAll(uadConfig.selector)[idx - 1] ||
58
- null);
59
- }
60
- else {
61
- // Blur selected if final only item removed
46
+ const items = Array.from(listRef.current?.querySelectorAll(selector) ?? []);
47
+ const sibling = items[idx > 0 ? idx - 1 : 1];
48
+ if (listRef.current?.contains(getActiveElement())) {
49
+ if (sibling)
50
+ (sibling.querySelector('a') ?? sibling).focus();
51
+ else {
52
+ inputRef.current?.focus();
53
+ // Focusing the input fires onListBlur; notify here only when focus could not move.
54
+ if (listRef.current?.contains(getActiveElement()))
62
55
  onSelectedBlur?.();
63
- }
64
- }
65
- else if (selected.length > 1) {
66
- // If not last item removed and other selected items, focus next
67
- setFocusDescendant(listRef.current?.querySelectorAll(uadConfig.selector)[idx + 1] ||
68
- null);
69
56
  }
70
57
  }
71
58
  onRemove?.(selectionId, idx);
72
- inputRef.current?.focus();
73
- }, [selected, onRemove, onSelectedBlur, uadConfig]);
59
+ }, [onRemove, onSelectedBlur]);
60
+ // Selected items are a single tab stop, separate from the input.
74
61
  useEffect(() => {
75
- // Maintain active item & prev. val only as it changes.
76
- if (activeDescendant?.id && activeDescendant.id !== activeItemId) {
77
- setActiveItemId(activeDescendant.id);
62
+ listRef.current?.querySelectorAll(selector).forEach(item => {
63
+ const target = item.querySelector('a') ?? item;
64
+ target.setAttribute('data-selection-focus', '');
65
+ target.tabIndex = !disabled && item.dataset.selection === tabStopId ? 0 : -1;
66
+ });
67
+ }, [disabled, selected, tabStopId]);
68
+ useArrows(listRef, { selector: focusSelector, dir: 'left-right', cycle: false, updateTabIndex: false }, [selected.length]);
69
+ useFocusWithin([listRef], isFocused => {
70
+ if (isFocused)
71
+ onSelectedFocus?.();
72
+ else
73
+ onSelectedBlur?.();
74
+ });
75
+ const onListTabKeyDown = useCallback((e) => {
76
+ // Tab (forward) from within the list: move focus to the input
77
+ if (e.key === 'Tab' && !e.shiftKey && !disabled) {
78
+ e.preventDefault();
79
+ inputRef.current?.focus();
80
+ return;
78
81
  }
79
- }, [activeDescendant]);
82
+ // Shift+Tab from within the list: exit the combobox entirely
83
+ if (e.key === 'Tab' && e.shiftKey) {
84
+ const focusables = Array.from(listRef.current?.querySelectorAll('a, button') ?? []);
85
+ const elementsToRestore = inputRef.current ? [...focusables, inputRef.current] : focusables;
86
+ const previousTabIndexes = elementsToRestore.map(el => ({
87
+ el,
88
+ tabindex: el.getAttribute('tabindex')
89
+ }));
90
+ elementsToRestore.forEach(el => el.setAttribute('tabindex', '-1'));
91
+ requestAnimationFrame(() => {
92
+ previousTabIndexes.forEach(({ el, tabindex }) => {
93
+ if (tabindex === null) {
94
+ el.removeAttribute('tabindex');
95
+ }
96
+ else {
97
+ el.setAttribute('tabindex', tabindex);
98
+ }
99
+ });
100
+ });
101
+ }
102
+ }, [disabled]);
80
103
  const onInputKeyDown = useCallback((e) => {
81
- if (selected.length &&
82
- inputRef.current?.selectionStart === 0 &&
83
- inputRef.current?.selectionEnd === 0) {
84
- const lastIndex = selected.length - 1;
85
- if (pauseDescendantEvaluation && e.key === `Arrow${cap(start)}`) {
86
- setFocusDescendant(listRef.current?.querySelectorAll(uadConfig.selector)[lastIndex] ||
87
- null);
88
- onSelectedFocus?.();
89
- }
90
- const lastSelectableId = listRef.current?.querySelectorAll(uadConfig.selector)[lastIndex]
91
- ?.id;
92
- const onLastItem = activeItemId === lastSelectableId;
93
- if (!pauseDescendantEvaluation &&
94
- ((onLastItem && e.key === `Arrow${cap(end)}`) || e.key === 'ArrowDown')) {
95
- onSelectedBlur?.();
96
- }
97
- if (['Backspace', 'Delete'].includes(e.key) && !(readOnly || disabled)) {
98
- handleSelectedRemoval(selected[lastIndex].id, lastIndex);
104
+ // Shift+Tab: Focus the selected items tab stop
105
+ if (e.key === 'Tab' && e.shiftKey && selected.length) {
106
+ const target = listRef.current?.querySelector('[tabindex="0"]');
107
+ if (target) {
108
+ e.preventDefault();
109
+ e.stopPropagation();
110
+ target.focus();
111
+ return;
99
112
  }
100
113
  }
101
114
  onKeyDown?.(e);
102
- }, [
103
- pauseDescendantEvaluation,
104
- activeItemId,
105
- onKeyDown,
106
- handleSelectedRemoval,
107
- selected,
108
- readOnly,
109
- disabled
110
- ]);
111
- const ariaDescribedBy = useMemo(() => {
112
- return onChange
113
- ? `${id}-inputDescription ${id}-searchDescription`
114
- : `${id}-inputDescription`;
115
- }, [id]);
115
+ }, [onKeyDown, selected.length]);
116
+ const onListFocus = useCallback((e) => {
117
+ const item = isInstance(e.target, HTMLElement) ? e.target.closest('li') : null;
118
+ if (item?.dataset.selection)
119
+ setLastFocusedId(item.dataset.selection);
120
+ }, []);
116
121
  const ariaControlsValue = useMemo(() => {
117
122
  if (!pauseDescendantEvaluation) {
118
123
  return selected.length > 0 ? id : undefined;
@@ -121,22 +126,26 @@ const MultiSelectInput = forwardRef(function MultiSelectInput(props, ref) {
121
126
  }, [pauseDescendantEvaluation, selected.length]);
122
127
  return (_jsxs(Flex, { as: StyledMultiSelectInput, forwardedAs: StyledFormControl, hasSuggestion: status === 'pending' && !!onResolveSuggestion, container: { alignItems: 'center', justify: 'between' }, readOnly: readOnly, disabled: disabled, status: status, children: [_jsxs(Flex, { container: { alignContent: 'center', wrap: 'wrap', rowGap: 0.5, colGap: 0.25, pad: 0.25 }, item: { grow: 1 }, onClick: (e) => {
123
128
  // Ignore clicks on selection items
124
- if (e.target instanceof HTMLElement &&
125
- !(e.target instanceof HTMLInputElement) &&
129
+ if (isInstance(e.target, HTMLElement) &&
130
+ !isInstance(e.target, HTMLInputElement) &&
126
131
  !e.currentTarget.contains(e.target.closest('li'))) {
127
132
  e.stopPropagation();
128
133
  inputRef.current?.focus();
129
134
  inputRef.current?.click();
130
135
  }
131
- }, children: [selected.length > 0 && (_jsx("ul", { ref: listRef, id: id, role: 'listbox', "aria-label": t('selected_items'), children: selected.map((element, idx) => {
132
- return (_jsx(Selectable, { as: 'li', role: 'option', id: element.id.toString(), status: status, onRemove: !readOnly && !disabled
136
+ }, children: [selected.length > 0 && (
137
+ // eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions
138
+ _jsx("ul", { ref: listRef, id: id, "aria-label": t('selected_items'), onKeyDown: onListTabKeyDown, onFocus: onListFocus, children: selected.map((element, idx) => {
139
+ return (_jsx(Selectable, { as: 'li', id: element.id.toString(), "data-selection": element.id.toString(), status: status, contextualLabel: element.text, onRemove: !readOnly && !disabled
133
140
  ? () => {
134
141
  handleSelectedRemoval(element.id, idx);
135
142
  }
136
- : undefined, tabIndex: -1, "aria-label": `${t('remove')} ${element.text}`, "aria-describedby": ariaDescribedBy, children: element.text }, element.id));
143
+ : undefined, tabIndex: -1, "aria-label": !readOnly && !disabled && onRemove
144
+ ? `${t('remove')} ${element.text}`
145
+ : element.text, "aria-describedby": selectionDescriptionId, children: element.text }, element.id));
137
146
  }) })), _jsx(Flex, { item: { grow: 1 }, as: 'input', size: 1, ref: inputRef, value: value,
138
147
  // no-op avoids react uncontrolled warning
139
- onChange: onChange || (() => { }), onKeyDown: onInputKeyDown, readOnly: readOnly || !onChange, disabled: disabled, placeholder: selected?.length ? undefined : placeholder, autoComplete: 'off', autoFocus: autoFocus, "aria-controls": ariaControlsValue, "aria-required": !!required, ...restProps })] }), actions, _jsx(VisuallyHiddenText, { id: `${id}-inputDescription`, children: `${t('combobox_open_close')} ` }), _jsx(VisuallyHiddenText, { id: `${id}-searchDescription`, children: t('combobox_search_instructions') })] }));
148
+ onChange: onChange || (() => { }), onKeyDown: onInputKeyDown, readOnly: readOnly || !onChange, disabled: disabled, placeholder: selected?.length ? undefined : placeholder, autoComplete: 'off', autoFocus: autoFocus, "aria-controls": ariaControlsValue, "aria-required": !!required, ...restProps })] }), actions, _jsx(VisuallyHiddenText, { id: selectionDescriptionId, children: `${t('multiselect_instructions', [start])}${!disabled ? ` ${t('multiselect_tab_to_input')}` : ''}` })] }));
140
149
  });
141
150
  export default MultiSelectInput;
142
151
  //# sourceMappingURL=MultiSelectInput.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"MultiSelectInput.js","sourceRoot":"","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SAAS,EAAE,SAAS,mBACL,iBAAiB,mBACjB,CAAC,CAAC,QAAQ,KACrB,SAAS,GACb,IACG,EACN,OAAO,EAER,KAAC,kBAAkB,IAAC,EAAE,EAAE,GAAG,EAAE,mBAAmB,YAC7C,GAAG,CAAC,CAAC,qBAAqB,CAAC,GAAG,GACZ,EACrB,KAAC,kBAAkB,IAAC,EAAE,EAAE,GAAG,EAAE,oBAAoB,YAC9C,CAAC,CAAC,8BAA8B,CAAC,GACf,IAChB,CACR,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,gBAAgB,CAAC","sourcesContent":["import { forwardRef, useRef, useCallback, useMemo, useState, useEffect } from 'react';\nimport type { FunctionComponent, Ref, PropsWithoutRef, KeyboardEvent, MouseEvent } from 'react';\nimport styled from 'styled-components';\n\nimport type { ForwardProps } from '../../../types';\nimport { defaultThemeProp } from '../../../theme';\nimport Selectable from '../../Badges/Selection';\nimport { StyledFormControl } from '../../FormControl';\nimport Flex from '../../Flex';\nimport {\n useConsolidatedRef,\n useActiveDescendant,\n useDirection,\n useI18n,\n useUID\n} from '../../../hooks';\nimport { cap } from '../../../utils';\nimport VisuallyHiddenText from '../../VisuallyHiddenText';\nimport { StyledSelectInput } from '../ComboBox.styles';\nimport type { Selected } from '../ComboBox.types';\n\nimport type { MultiSelectInputProps } from './MultiSelectInput.types';\n\nexport const StyledMultiSelectInput = styled(StyledSelectInput)`\n cursor: text;\n\n ul {\n list-style: none;\n display: contents;\n }\n\n input {\n width: 8ch;\n height: 1.125rem;\n }\n`;\n\nStyledMultiSelectInput.defaultProps = defaultThemeProp;\n\nconst MultiSelectInput: FunctionComponent<MultiSelectInputProps & ForwardProps> = forwardRef(\n function MultiSelectInput(\n props: PropsWithoutRef<MultiSelectInputProps>,\n ref: Ref<HTMLInputElement>\n ) {\n const {\n selected = [],\n value,\n onRemove,\n onChange,\n onKeyDown,\n onResolveSuggestion,\n actions,\n readOnly,\n disabled,\n status,\n placeholder,\n autoFocus,\n pauseDescendantEvaluation,\n onSelectedFocus,\n onSelectedBlur,\n 'aria-controls': ariaControls,\n required,\n ...restProps\n } = props;\n const t = useI18n();\n const id = useUID();\n\n const inputRef = useConsolidatedRef<HTMLInputElement>(ref);\n const listRef = useRef<HTMLUListElement>(null);\n const [focusDescendant, setFocusDescendant] = useState<HTMLElement | null>(null);\n const [activeItemId, setActiveItemId] = useState<string | null>(null);\n const { start, end } = useDirection();\n\n const uadConfig = useMemo(\n () => ({\n focusEl: inputRef.current,\n scope: listRef.current,\n selector: 'li[role=\"option\"]',\n orientation: 'horizontal' as const,\n focusReturnEl: focusDescendant,\n clearFocusReturn: () => {\n setFocusDescendant(null);\n },\n pauseDescendantEvaluation,\n preventInitialScroll: true,\n onClick: (el: HTMLElement) => {\n el.click();\n }\n }),\n [pauseDescendantEvaluation, selected, focusDescendant]\n );\n\n const { activeDescendant } = useActiveDescendant(uadConfig, [selected]);\n\n const handleSelectedRemoval = useCallback(\n (selectionId: Selected['id'], idx: number) => {\n if (!pauseDescendantEvaluation) {\n if (idx === selected.length - 1) {\n // If removing last selected item\n if (selected.length > 1) {\n // If other selected items, focus previous\n setFocusDescendant(\n (listRef.current?.querySelectorAll(uadConfig.selector)[idx - 1] as HTMLElement) ||\n null\n );\n } else {\n // Blur selected if final only item removed\n onSelectedBlur?.();\n }\n } else if (selected.length > 1) {\n // If not last item removed and other selected items, focus next\n setFocusDescendant(\n (listRef.current?.querySelectorAll(uadConfig.selector)[idx + 1] as HTMLElement) ||\n null\n );\n }\n }\n onRemove?.(selectionId, idx);\n inputRef.current?.focus();\n },\n [selected, onRemove, onSelectedBlur, uadConfig]\n );\n\n useEffect(() => {\n // Maintain active item & prev. val only as it changes.\n if (activeDescendant?.id && activeDescendant.id !== activeItemId) {\n setActiveItemId(activeDescendant.id);\n }\n }, [activeDescendant]);\n\n const onInputKeyDown = useCallback(\n (e: KeyboardEvent<HTMLInputElement>) => {\n if (\n selected.length &&\n inputRef.current?.selectionStart === 0 &&\n inputRef.current?.selectionEnd === 0\n ) {\n const lastIndex = selected.length - 1;\n if (pauseDescendantEvaluation && e.key === `Arrow${cap(start)}`) {\n setFocusDescendant(\n (listRef.current?.querySelectorAll(uadConfig.selector)[lastIndex] as HTMLElement) ||\n null\n );\n onSelectedFocus?.();\n }\n\n const lastSelectableId = listRef.current?.querySelectorAll(uadConfig.selector)[lastIndex]\n ?.id;\n const onLastItem = activeItemId === lastSelectableId;\n\n if (\n !pauseDescendantEvaluation &&\n ((onLastItem && e.key === `Arrow${cap(end)}`) || e.key === 'ArrowDown')\n ) {\n onSelectedBlur?.();\n }\n\n if (['Backspace', 'Delete'].includes(e.key) && !(readOnly || disabled)) {\n handleSelectedRemoval(selected[lastIndex].id, lastIndex);\n }\n }\n onKeyDown?.(e);\n },\n [\n pauseDescendantEvaluation,\n activeItemId,\n onKeyDown,\n handleSelectedRemoval,\n selected,\n readOnly,\n disabled\n ]\n );\n\n const ariaDescribedBy = useMemo(() => {\n return onChange\n ? `${id}-inputDescription ${id}-searchDescription`\n : `${id}-inputDescription`;\n }, [id]);\n\n const ariaControlsValue = useMemo(() => {\n if (!pauseDescendantEvaluation) {\n return selected.length > 0 ? id : undefined;\n }\n return ariaControls;\n }, [pauseDescendantEvaluation, selected.length]);\n\n return (\n <Flex\n as={StyledMultiSelectInput}\n forwardedAs={StyledFormControl}\n hasSuggestion={status === 'pending' && !!onResolveSuggestion}\n container={{ alignItems: 'center', justify: 'between' }}\n readOnly={readOnly}\n disabled={disabled}\n status={status}\n >\n <Flex\n container={{ alignContent: 'center', wrap: 'wrap', rowGap: 0.5, colGap: 0.25, pad: 0.25 }}\n item={{ grow: 1 }}\n onClick={(e: MouseEvent<HTMLDivElement>) => {\n // Ignore clicks on selection items\n if (\n e.target instanceof HTMLElement &&\n !(e.target instanceof HTMLInputElement) &&\n !e.currentTarget.contains(e.target.closest('li'))\n ) {\n e.stopPropagation();\n inputRef.current?.focus();\n inputRef.current?.click();\n }\n }}\n >\n {selected.length > 0 && (\n <ul ref={listRef} id={id} role='listbox' aria-label={t('selected_items')}>\n {selected.map((element, idx) => {\n return (\n <Selectable\n as='li'\n key={element.id}\n role='option'\n id={element.id.toString()}\n status={status}\n onRemove={\n !readOnly && !disabled\n ? () => {\n handleSelectedRemoval(element.id, idx);\n }\n : undefined\n }\n tabIndex={-1}\n aria-label={`${t('remove')} ${element.text}`}\n aria-describedby={ariaDescribedBy}\n >\n {element.text}\n </Selectable>\n );\n })}\n </ul>\n )}\n <Flex\n item={{ grow: 1 }}\n as='input'\n size={1}\n ref={inputRef}\n value={value}\n // no-op avoids react uncontrolled warning\n onChange={onChange || (() => {})}\n onKeyDown={onInputKeyDown}\n readOnly={readOnly || !onChange}\n disabled={disabled}\n placeholder={selected?.length ? undefined : placeholder}\n autoComplete='off'\n autoFocus={autoFocus}\n aria-controls={ariaControlsValue}\n aria-required={!!required}\n {...restProps}\n />\n </Flex>\n {actions}\n\n <VisuallyHiddenText id={`${id}-inputDescription`}>\n {`${t('combobox_open_close')} `}\n </VisuallyHiddenText>\n <VisuallyHiddenText id={`${id}-searchDescription`}>\n {t('combobox_search_instructions')}\n </VisuallyHiddenText>\n </Flex>\n );\n }\n);\n\nexport default MultiSelectInput;\n"]}
1
+ {"version":3,"file":"MultiSelectInput.js","sourceRoot":"","sources":["../../../../src/components/ComboBox/MultiSelectInput/MultiSelectInput.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,WAAW,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEtF,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAGvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,UAAU,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,IAAI,MAAM,YAAY,CAAC;AAC9B,OAAO,EACL,SAAS,EACT,kBAAkB,EAClB,YA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, PropsWithoutRef, KeyboardEvent, FocusEvent, MouseEvent } from 'react';\nimport styled from 'styled-components';\n\nimport type { WithAttributes } from '../../../types';\nimport { defaultThemeProp } from '../../../theme';\nimport Selectable from '../../Badges/Selection';\nimport { StyledFormControl } from '../../FormControl';\nimport Flex from '../../Flex';\nimport {\n useArrows,\n useConsolidatedRef,\n useDirection,\n useFocusWithin,\n useI18n,\n useUID\n} from '../../../hooks';\nimport { isInstance, getActiveElement } from '../../../utils';\nimport VisuallyHiddenText from '../../VisuallyHiddenText';\nimport { StyledSelectInput } from '../ComboBox.styles';\nimport type { Selected } from '../ComboBox.types';\n\nimport type { MultiSelectInputProps } from './MultiSelectInput.types';\n\nexport const StyledMultiSelectInput = styled(StyledSelectInput)`\n cursor: text;\n\n ul {\n list-style: none;\n display: contents;\n\n /* The pill's own focus ring is enough; suppress the inner link's ring so it does not distort it. */\n a[href]:focus-visible {\n box-shadow: none;\n }\n }\n\n input {\n width: 8ch;\n height: 1.125rem;\n }\n`;\n\nStyledMultiSelectInput.defaultProps = defaultThemeProp;\n\nconst MultiSelectInput = forwardRef(function MultiSelectInput(\n props: PropsWithoutRef<WithAttributes<'input', MultiSelectInputProps>>,\n ref: Ref<HTMLInputElement>\n) {\n const {\n selected = [],\n value,\n onRemove,\n onChange,\n onKeyDown,\n onResolveSuggestion,\n actions,\n readOnly,\n disabled,\n status,\n placeholder,\n autoFocus,\n pauseDescendantEvaluation,\n onSelectedFocus,\n onSelectedBlur,\n 'aria-controls': ariaControls,\n required,\n ...restProps\n } = props;\n const t = useI18n();\n const id = useUID();\n\n const inputRef = useConsolidatedRef<HTMLInputElement>(ref);\n const listRef = useRef<HTMLUListElement>(null);\n const [lastFocusedId, setLastFocusedId] = useState<string>();\n const { start } = useDirection();\n const selectionDescriptionId = `${id}-selectionDescription`;\n const selector = ':scope > li';\n const focusSelector = '[data-selection-focus]';\n\n const tabStopId =\n lastFocusedId && selected.some(item => item.id.toString() === lastFocusedId)\n ? lastFocusedId\n : selected[selected.length - 1]?.id.toString();\n\n const handleSelectedRemoval = useCallback(\n (selectionId: Selected['id'], idx: number) => {\n const items = Array.from(listRef.current?.querySelectorAll<HTMLElement>(selector) ?? []);\n const sibling = items[idx > 0 ? idx - 1 : 1];\n\n if (listRef.current?.contains(getActiveElement())) {\n if (sibling) (sibling.querySelector<HTMLElement>('a') ?? sibling).focus();\n else {\n inputRef.current?.focus();\n // Focusing the input fires onListBlur; notify here only when focus could not move.\n if (listRef.current?.contains(getActiveElement())) onSelectedBlur?.();\n }\n }\n onRemove?.(selectionId, idx);\n },\n [onRemove, onSelectedBlur]\n );\n\n // Selected items are a single tab stop, separate from the input.\n useEffect(() => {\n listRef.current?.querySelectorAll<HTMLElement>(selector).forEach(item => {\n const target = item.querySelector<HTMLElement>('a') ?? item;\n target.setAttribute('data-selection-focus', '');\n target.tabIndex = !disabled && item.dataset.selection === tabStopId ? 0 : -1;\n });\n }, [disabled, selected, tabStopId]);\n\n useArrows(\n listRef,\n { selector: focusSelector, dir: 'left-right', cycle: false, updateTabIndex: false },\n [selected.length]\n );\n\n useFocusWithin([listRef], isFocused => {\n if (isFocused) onSelectedFocus?.();\n else onSelectedBlur?.();\n });\n\n const onListTabKeyDown = useCallback(\n (e: KeyboardEvent<HTMLUListElement>) => {\n // Tab (forward) from within the list: move focus to the input\n if (e.key === 'Tab' && !e.shiftKey && !disabled) {\n e.preventDefault();\n inputRef.current?.focus();\n return;\n }\n\n // Shift+Tab from within the list: exit the combobox entirely\n if (e.key === 'Tab' && e.shiftKey) {\n const focusables = Array.from(listRef.current?.querySelectorAll('a, button') ?? []);\n const elementsToRestore = inputRef.current ? [...focusables, inputRef.current] : focusables;\n const previousTabIndexes = elementsToRestore.map(el => ({\n el,\n tabindex: el.getAttribute('tabindex')\n }));\n elementsToRestore.forEach(el => el.setAttribute('tabindex', '-1'));\n requestAnimationFrame(() => {\n previousTabIndexes.forEach(({ el, tabindex }) => {\n if (tabindex === null) {\n el.removeAttribute('tabindex');\n } else {\n el.setAttribute('tabindex', tabindex);\n }\n });\n });\n }\n },\n [disabled]\n );\n\n const onInputKeyDown = useCallback(\n (e: KeyboardEvent<HTMLInputElement>) => {\n // Shift+Tab: Focus the selected items tab stop\n if (e.key === 'Tab' && e.shiftKey && selected.length) {\n const target = listRef.current?.querySelector<HTMLElement>('[tabindex=\"0\"]');\n\n if (target) {\n e.preventDefault();\n e.stopPropagation();\n target.focus();\n return;\n }\n }\n onKeyDown?.(e);\n },\n [onKeyDown, selected.length]\n );\n\n const onListFocus = useCallback((e: FocusEvent<HTMLUListElement>) => {\n const item = isInstance(e.target, HTMLElement) ? e.target.closest('li') : null;\n if (item?.dataset.selection) setLastFocusedId(item.dataset.selection);\n }, []);\n\n const ariaControlsValue = useMemo(() => {\n if (!pauseDescendantEvaluation) {\n return selected.length > 0 ? id : undefined;\n }\n return ariaControls;\n }, [pauseDescendantEvaluation, selected.length]);\n\n return (\n <Flex\n as={StyledMultiSelectInput}\n forwardedAs={StyledFormControl}\n hasSuggestion={status === 'pending' && !!onResolveSuggestion}\n container={{ alignItems: 'center', justify: 'between' }}\n readOnly={readOnly}\n disabled={disabled}\n status={status}\n >\n <Flex\n container={{ alignContent: 'center', wrap: 'wrap', rowGap: 0.5, colGap: 0.25, pad: 0.25 }}\n item={{ grow: 1 }}\n onClick={(e: MouseEvent<HTMLDivElement>) => {\n // Ignore clicks on selection items\n if (\n isInstance(e.target, HTMLElement) &&\n !isInstance(e.target, HTMLInputElement) &&\n !e.currentTarget.contains(e.target.closest('li'))\n ) {\n e.stopPropagation();\n inputRef.current?.focus();\n inputRef.current?.click();\n }\n }}\n >\n {selected.length > 0 && (\n // eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions\n <ul\n ref={listRef}\n id={id}\n aria-label={t('selected_items')}\n onKeyDown={onListTabKeyDown}\n onFocus={onListFocus}\n >\n {selected.map((element, idx) => {\n return (\n <Selectable\n as='li'\n key={element.id}\n id={element.id.toString()}\n data-selection={element.id.toString()}\n status={status}\n contextualLabel={element.text}\n onRemove={\n !readOnly && !disabled\n ? () => {\n handleSelectedRemoval(element.id, idx);\n }\n : undefined\n }\n tabIndex={-1}\n aria-label={\n !readOnly && !disabled && onRemove\n ? `${t('remove')} ${element.text}`\n : element.text\n }\n aria-describedby={selectionDescriptionId}\n >\n {element.text}\n </Selectable>\n );\n })}\n </ul>\n )}\n <Flex\n item={{ grow: 1 }}\n as='input'\n size={1}\n ref={inputRef}\n value={value}\n // no-op avoids react uncontrolled warning\n onChange={onChange || (() => {})}\n onKeyDown={onInputKeyDown}\n readOnly={readOnly || !onChange}\n disabled={disabled}\n placeholder={selected?.length ? undefined : placeholder}\n autoComplete='off'\n autoFocus={autoFocus}\n aria-controls={ariaControlsValue}\n aria-required={!!required}\n {...restProps}\n />\n </Flex>\n {actions}\n\n <VisuallyHiddenText id={selectionDescriptionId}>\n {`${t('multiselect_instructions', [start])}${!disabled ? ` ${t('multiselect_tab_to_input')}` : ''}`}\n </VisuallyHiddenText>\n </Flex>\n );\n});\n\nexport default MultiSelectInput;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"EditorBackground.d.ts","sourceRoot":"","sources":["../../../../src/components/PageTemplates/GridLayout/EditorBackground.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAEhC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAIhD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAsErD,UAAU,qBAAsB,SAAQ,cAAc;IACpD,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,WAAW,EAAE,OAAO,CAAC;CACtB;AAED;;;GAGG;AACH,QAAA,MAAM,gBAAgB,EAAE,EAAE,CAAC,qBAAqB,CAyC/C,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
1
+ {"version":3,"file":"EditorBackground.d.ts","sourceRoot":"","sources":["../../../../src/components/PageTemplates/GridLayout/EditorBackground.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAEhC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAIhD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAuErD,UAAU,qBAAsB,SAAQ,cAAc;IACpD,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,WAAW,EAAE,OAAO,CAAC;CACtB;AAED;;;GAGG;AACH,QAAA,MAAM,gBAAgB,EAAE,EAAE,CAAC,qBAAqB,CAyC/C,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
@@ -4,6 +4,7 @@ import { rgba } from 'polished';
4
4
  import Grid from '../../Grid';
5
5
  import { defaultThemeProp } from '../../../theme';
6
6
  import { useI18n } from '../../../hooks';
7
+ import { cssQuoteAndEscape } from '../../../utils';
7
8
  import useGridLayoutConfig from './config';
8
9
  import { getArrayFromRange } from './utils';
9
10
  const StyledGrid = styled(Grid) `
@@ -37,7 +38,7 @@ const StyledPageBreak = styled.div(({ containerPadding, rowHeight, theme, margin
37
38
  border-block-start: 2px dashed ${palette['border-line']};
38
39
 
39
40
  &::before {
40
- content: '${prefix}';
41
+ content: ${cssQuoteAndEscape(prefix)};
41
42
  position: absolute;
42
43
  font-size: 0.75rem;
43
44
  line-height: 1;
@@ -1 +1 @@
1
- {"version":3,"file":"EditorBackground.js","sourceRoot":"","sources":["../../../../src/components/PageTemplates/GridLayout/EditorBackground.tsx"],"names":[],"mappings":";AACA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;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aAAa,EAAE,KAAK,CAAC,CAAC;IAE9D,OAAO,CACL,MAAC,UAAU,IAAC,SAAS,EAAE,EAAE,IAAI,EAAE,UAAU,UAAU,QAAQ,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,aACrF,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CACd,KAAC,cAAc,IAEb,SAAS,EAAE,SAAS;gBACpB,yDAAyD;gBACzD,WAAW,EAAE,WAAW,IAAI,CAAC,GAAG,YAAY,GAAG,UAAU,IAHpD,CAAC,CAIN,CACH,CAAC,EACD,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CACnB,KAAC,eAAe,IAEd,SAAS,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,WAAY,EACjC,SAAS,EAAE,SAAS,EACpB,MAAM,EAAE,MAAM,EACd,gBAAgB,EAAE,gBAAgB,EAClC,MAAM,EAAE,CAAC,CAAC,aAAa,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAL5B,CAAC,CAMN,CACH,CAAC,IACS,CACd,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,gBAAgB,CAAC","sourcesContent":["import type { FC } from 'react';\nimport styled, { css } from 'styled-components';\nimport type { Layout } from 'react-grid-layout';\nimport { rgba } from 'polished';\n\nimport Grid from '../../Grid';\nimport type { NoChildrenProp } from '../../../types';\nimport { defaultThemeProp } from '../../../theme';\nimport { useI18n } from '../../../hooks';\n\nimport useGridLayoutConfig from './config';\nimport { getArrayFromRange } from './utils';\n\nconst StyledGrid = styled(Grid)`\n position: absolute;\n z-index: -1;\n pointer-events: none;\n inline-size: 100%;\n`;\n\nconst StyledGridCell = styled.div<{ rowHeight: number; highlighted: boolean }>(\n ({ theme, highlighted, rowHeight }) => {\n const {\n base: { palette }\n } = theme;\n const borderColor = palette[highlighted ? 'warn' : 'border-line'];\n const background = highlighted ? rgba(palette.warn, 0.1) : 'transparent';\n\n return css`\n /* stylelint-disable-next-line unit-allowed-list */\n border: 1px solid ${borderColor};\n background: ${background};\n block-size: ${rowHeight}px;\n `;\n }\n);\nStyledGridCell.defaultProps = defaultThemeProp;\n\ninterface PageBreakProps {\n rowsAbove: number;\n rowHeight: number;\n margin: [number, number];\n containerPadding: [number, number];\n prefix: string;\n}\n\nconst StyledPageBreak = styled.div<PageBreakProps>(\n ({ containerPadding, rowHeight, theme, margin, rowsAbove, prefix }) => {\n const {\n base: { palette }\n } = theme;\n return css`\n position: absolute;\n inset-inline-start: ${containerPadding[0]}px;\n inset-inline-end: ${containerPadding[0]}px;\n inset-block-start: ${containerPadding[1] + rowsAbove * (rowHeight + margin[1])}px;\n /* stylelint-disable-next-line unit-allowed-list */\n margin-block-start: ${-margin[1] / 2 - 1}px;\n /* stylelint-disable-next-line unit-allowed-list */\n border-block-start: 2px dashed ${palette['border-line']};\n\n &::before {\n content: '${prefix}';\n position: absolute;\n font-size: 0.75rem;\n line-height: 1;\n transform: translate(0, -50%);\n background-color: ${palette['app-background']};\n color: ${palette['border-line']};\n padding-inline-end: 0.25rem;\n }\n `;\n }\n);\nStyledPageBreak.defaultProps = defaultThemeProp;\n\ninterface EditorBackgroundProps extends NoChildrenProp {\n layout?: Layout[];\n numColumns: number;\n rowHeight: number;\n rowsPerPage: number | null; // null when not applying auto-fit\n highlighted: boolean;\n}\n\n/**\n * Renders background grid-cells for GridEditor\n * @component\n */\nconst EditorBackground: FC<EditorBackgroundProps> = ({\n layout,\n numColumns,\n rowHeight,\n rowsPerPage,\n highlighted\n}) => {\n const t = useI18n();\n const { margin, containerPadding } = useGridLayoutConfig();\n\n const maxYInLayout = layout ? Math.max(...layout.map(item => item.y + item.h)) : 0;\n const maxY = Math.max(maxYInLayout, rowsPerPage || 0);\n const numGridCells = (maxY + 1) * numColumns;\n const cells = getArrayFromRange(0, numGridCells, false);\n\n // rowsPerPage will be null if auto-fit is disabled. Don't show pageBreaks in that case.\n const numPageBreaks = rowsPerPage ? Math.floor(maxY / rowsPerPage) : 0;\n const pageBreaks = getArrayFromRange(0, numPageBreaks, false);\n\n return (\n <StyledGrid container={{ cols: `repeat(${numColumns}, 1fr)`, gap: 2, pad: [0, 2, 2, 2] }}>\n {cells.map(n => (\n <StyledGridCell\n key={n}\n rowHeight={rowHeight}\n // Highlight all cells except the dummy row at the bottom\n highlighted={highlighted && n < numGridCells - numColumns}\n />\n ))}\n {pageBreaks.map(n => (\n <StyledPageBreak\n key={n}\n rowsAbove={(n + 1) * rowsPerPage!}\n rowHeight={rowHeight}\n margin={margin}\n containerPadding={containerPadding}\n prefix={t('page_number', [n + 1])}\n />\n ))}\n </StyledGrid>\n );\n};\n\nexport default EditorBackground;\n"]}
1
+ {"version":3,"file":"EditorBackground.js","sourceRoot":"","sources":["../../../../src/components/PageTemplates/GridLayout/EditorBackground.tsx"],"names":[],"mappings":";AACA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAEhC,OAAO,IAAI,MAAM,YAAY,CAAC;AAE9B,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACzC,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAEnD,OAAO,mBAAmB,MAAM,UAAU,CAAC;AAC3C,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAE5C,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,CAAA;;;;;CAK9B,CAAC;AAEF,MAAM,cAAc,GAAG,MAAM,CAAC,GAAG,CAC/B,CAAC,EAAE,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,EAAE,EAAE;IACpC,MAAM,EACJ,IAAI,EAAE,EAAE,OAAO,EAAE,EAClB,GAAG,KAAK,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AAC,CAAC,GAAG,CAAC,CAAC,GAAG,WAAY,EACjC,SAAS,EAAE,SAAS,EACpB,MAAM,EAAE,MAAM,EACd,gBAAgB,EAAE,gBAAgB,EAClC,MAAM,EAAE,CAAC,CAAC,aAAa,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAL5B,CAAC,CAMN,CACH,CAAC,IACS,CACd,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,gBAAgB,CAAC","sourcesContent":["import type { FC } from 'react';\nimport styled, { css } from 'styled-components';\nimport type { Layout } from 'react-grid-layout';\nimport { rgba } from 'polished';\n\nimport Grid from '../../Grid';\nimport type { NoChildrenProp } from '../../../types';\nimport { defaultThemeProp } from '../../../theme';\nimport { useI18n } from '../../../hooks';\nimport { cssQuoteAndEscape } from '../../../utils';\n\nimport useGridLayoutConfig from './config';\nimport { getArrayFromRange } from './utils';\n\nconst StyledGrid = styled(Grid)`\n position: absolute;\n z-index: -1;\n pointer-events: none;\n inline-size: 100%;\n`;\n\nconst StyledGridCell = styled.div<{ rowHeight: number; highlighted: boolean }>(\n ({ theme, highlighted, rowHeight }) => {\n const {\n base: { palette }\n } = theme;\n const borderColor = palette[highlighted ? 'warn' : 'border-line'];\n const background = highlighted ? rgba(palette.warn, 0.1) : 'transparent';\n\n return css`\n /* stylelint-disable-next-line unit-allowed-list */\n border: 1px solid ${borderColor};\n background: ${background};\n block-size: ${rowHeight}px;\n `;\n }\n);\nStyledGridCell.defaultProps = defaultThemeProp;\n\ninterface PageBreakProps {\n rowsAbove: number;\n rowHeight: number;\n margin: [number, number];\n containerPadding: [number, number];\n prefix: string;\n}\n\nconst StyledPageBreak = styled.div<PageBreakProps>(\n ({ containerPadding, rowHeight, theme, margin, rowsAbove, prefix }) => {\n const {\n base: { palette }\n } = theme;\n return css`\n position: absolute;\n inset-inline-start: ${containerPadding[0]}px;\n inset-inline-end: ${containerPadding[0]}px;\n inset-block-start: ${containerPadding[1] + rowsAbove * (rowHeight + margin[1])}px;\n /* stylelint-disable-next-line unit-allowed-list */\n margin-block-start: ${-margin[1] / 2 - 1}px;\n /* stylelint-disable-next-line unit-allowed-list */\n border-block-start: 2px dashed ${palette['border-line']};\n\n &::before {\n content: ${cssQuoteAndEscape(prefix)};\n position: absolute;\n font-size: 0.75rem;\n line-height: 1;\n transform: translate(0, -50%);\n background-color: ${palette['app-background']};\n color: ${palette['border-line']};\n padding-inline-end: 0.25rem;\n }\n `;\n }\n);\nStyledPageBreak.defaultProps = defaultThemeProp;\n\ninterface EditorBackgroundProps extends NoChildrenProp {\n layout?: Layout[];\n numColumns: number;\n rowHeight: number;\n rowsPerPage: number | null; // null when not applying auto-fit\n highlighted: boolean;\n}\n\n/**\n * Renders background grid-cells for GridEditor\n * @component\n */\nconst EditorBackground: FC<EditorBackgroundProps> = ({\n layout,\n numColumns,\n rowHeight,\n rowsPerPage,\n highlighted\n}) => {\n const t = useI18n();\n const { margin, containerPadding } = useGridLayoutConfig();\n\n const maxYInLayout = layout ? Math.max(...layout.map(item => item.y + item.h)) : 0;\n const maxY = Math.max(maxYInLayout, rowsPerPage || 0);\n const numGridCells = (maxY + 1) * numColumns;\n const cells = getArrayFromRange(0, numGridCells, false);\n\n // rowsPerPage will be null if auto-fit is disabled. Don't show pageBreaks in that case.\n const numPageBreaks = rowsPerPage ? Math.floor(maxY / rowsPerPage) : 0;\n const pageBreaks = getArrayFromRange(0, numPageBreaks, false);\n\n return (\n <StyledGrid container={{ cols: `repeat(${numColumns}, 1fr)`, gap: 2, pad: [0, 2, 2, 2] }}>\n {cells.map(n => (\n <StyledGridCell\n key={n}\n rowHeight={rowHeight}\n // Highlight all cells except the dummy row at the bottom\n highlighted={highlighted && n < numGridCells - numColumns}\n />\n ))}\n {pageBreaks.map(n => (\n <StyledPageBreak\n key={n}\n rowsAbove={(n + 1) * rowsPerPage!}\n rowHeight={rowHeight}\n margin={margin}\n containerPadding={containerPadding}\n prefix={t('page_number', [n + 1])}\n />\n ))}\n </StyledGrid>\n );\n};\n\nexport default EditorBackground;\n"]}
@@ -277,6 +277,8 @@ declare const useI18n: () => import("../i18n/translate").TranslationFunction<Rea
277
277
  combobox_open_list_button_a11y: string;
278
278
  combobox_close_list_button_a11y: string;
279
279
  multiselect_instructions: string;
280
+ multiselect_instructions_with_links: string;
281
+ multiselect_tab_to_input: string;
280
282
  selected_items: string;
281
283
  composite_input_open_button_a11y: string;
282
284
  composite_input_close_button_a11y: string;
@@ -1 +1 @@
1
- {"version":3,"file":"useI18n.d.ts","sourceRoot":"","sources":["../../src/hooks/useI18n.ts"],"names":[],"mappings":"AAMA;;;GAGG;AACH,QAAA,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAGZ,CAAC;AAEF,eAAe,OAAO,CAAC"}
@@ -273,6 +273,8 @@ declare const _default: {
273
273
  combobox_open_list_button_a11y: string;
274
274
  combobox_close_list_button_a11y: string;
275
275
  multiselect_instructions: string;
276
+ multiselect_instructions_with_links: string;
277
+ multiselect_tab_to_input: string;
276
278
  selected_items: string;
277
279
  composite_input_open_button_a11y: string;
278
280
  composite_input_close_button_a11y: string;
@@ -1 +1 @@
1
- {"version":3,"file":"default.d.ts","sourceRoot":"","sources":["../../src/i18n/default.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAygDE,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA0OxB,uCAAuC;;;;;;;;;;;IAavC,yCAAyC;;;;;;;;;;;;;;;;;;;;;;;;;AAhwD3C,wBA4xDE"}
@@ -296,6 +296,8 @@ export default {
296
296
  combobox_open_list_button_a11y: 'Open combobox list',
297
297
  combobox_close_list_button_a11y: 'Close combobox list',
298
298
  multiselect_instructions: 'Arrow {0} from start to review selected items',
299
+ multiselect_instructions_with_links: 'Shift+Tab, then arrow {0} to review selected items',
300
+ multiselect_tab_to_input: 'Tab to go to input',
299
301
  selected_items: 'Selected items',
300
302
  /* core:CompositeInput */
301
303
  composite_input_open_button_a11y: 'Open configuration dialog',