@razorpay/blade 12.33.1 → 12.33.2
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/build/lib/native/components/Accordion/AccordionButton.native.js +1 -1
- package/build/lib/native/components/Accordion/AccordionButton.native.js.map +1 -1
- package/build/lib/native/components/Accordion/AccordionItemHeader.js +2 -1
- package/build/lib/native/components/Accordion/AccordionItemHeader.js.map +1 -1
- package/build/lib/native/components/Accordion/commonStyles.js +1 -1
- package/build/lib/native/components/Accordion/commonStyles.js.map +1 -1
- package/build/lib/native/components/ActionList/ActionListItem.js +1 -1
- package/build/lib/native/components/ActionList/ActionListItem.js.map +1 -1
- package/build/lib/native/components/BaseHeaderFooter/BaseHeader.js +1 -1
- package/build/lib/native/components/BaseHeaderFooter/BaseHeader.js.map +1 -1
- package/build/lib/native/components/Button/BaseButton/BaseButton.js +1 -1
- package/build/lib/native/components/Button/BaseButton/BaseButton.js.map +1 -1
- package/build/lib/native/components/Button/BaseButton/buttonTokens.js +1 -1
- package/build/lib/native/components/Button/BaseButton/buttonTokens.js.map +1 -1
- package/build/lib/native/components/Dropdown/Dropdown.js +1 -1
- package/build/lib/native/components/Dropdown/Dropdown.js.map +1 -1
- package/build/lib/native/components/Dropdown/DropdownButton.js +1 -1
- package/build/lib/native/components/Dropdown/DropdownButton.js.map +1 -1
- package/build/lib/native/components/Dropdown/InputDropdownButton.native.js +7 -0
- package/build/lib/native/components/Dropdown/InputDropdownButton.native.js.map +1 -0
- package/build/lib/native/components/Dropdown/dropdownComponentIds.js +1 -1
- package/build/lib/native/components/Dropdown/dropdownComponentIds.js.map +1 -1
- package/build/lib/native/components/Dropdown/useDropdown.js.map +1 -1
- package/build/lib/native/components/Icons/ChevronUpDownIcon/ChevronUpDownIcon.js +12 -0
- package/build/lib/native/components/Icons/ChevronUpDownIcon/ChevronUpDownIcon.js.map +1 -0
- package/build/lib/native/components/Input/BaseInput/BaseInput.js +1 -1
- package/build/lib/native/components/Input/BaseInput/BaseInput.js.map +1 -1
- package/build/lib/native/components/Input/BaseInput/BaseInputVisuals.js +1 -1
- package/build/lib/native/components/Input/BaseInput/BaseInputVisuals.js.map +1 -1
- package/build/lib/native/components/Input/BaseInput/baseInputStyles.js +1 -1
- package/build/lib/native/components/Input/BaseInput/baseInputStyles.js.map +1 -1
- package/build/lib/native/components/Input/BaseInput/baseInputTokens.js +1 -1
- package/build/lib/native/components/Input/BaseInput/baseInputTokens.js.map +1 -1
- package/build/lib/native/components/Input/DropdownInputTriggers/BaseDropdownInputTrigger.js +2 -5
- package/build/lib/native/components/Input/DropdownInputTriggers/BaseDropdownInputTrigger.js.map +1 -1
- package/build/lib/native/components/Input/SearchInput/SearchInput.js +12 -3
- package/build/lib/native/components/Input/SearchInput/SearchInput.js.map +1 -1
- package/build/lib/native/components/Input/TextInput/TextInput.js +11 -3
- package/build/lib/native/components/Input/TextInput/TextInput.js.map +1 -1
- package/build/lib/native/components/Typography/Text/Text.js +1 -1
- package/build/lib/native/components/Typography/Text/Text.js.map +1 -1
- package/build/lib/native/components/index.js +2 -0
- package/build/lib/native/components/index.js.map +1 -1
- package/build/lib/native/utils/useControlledDropdownInput/useControlledDropdownInput.js +14 -0
- package/build/lib/native/utils/useControlledDropdownInput/useControlledDropdownInput.js.map +1 -0
- package/build/lib/web/development/components/Accordion/AccordionItemHeader.js +18 -2
- package/build/lib/web/development/components/Accordion/AccordionItemHeader.js.map +1 -1
- package/build/lib/web/development/components/Accordion/StyledAccordionButton.web.js +4 -3
- package/build/lib/web/development/components/Accordion/StyledAccordionButton.web.js.map +1 -1
- package/build/lib/web/development/components/Accordion/commonStyles.js +1 -11
- package/build/lib/web/development/components/Accordion/commonStyles.js.map +1 -1
- package/build/lib/web/development/components/ActionList/ActionListItem.js +2 -1
- package/build/lib/web/development/components/ActionList/ActionListItem.js.map +1 -1
- package/build/lib/web/development/components/BaseHeaderFooter/BaseHeader.js +6 -3
- package/build/lib/web/development/components/BaseHeaderFooter/BaseHeader.js.map +1 -1
- package/build/lib/web/development/components/Button/BaseButton/BaseButton.js +24 -3
- package/build/lib/web/development/components/Button/BaseButton/BaseButton.js.map +1 -1
- package/build/lib/web/development/components/Button/BaseButton/StyledBaseButton.web.js +14 -2
- package/build/lib/web/development/components/Button/BaseButton/StyledBaseButton.web.js.map +1 -1
- package/build/lib/web/development/components/Button/BaseButton/buttonTokens.js +19 -0
- package/build/lib/web/development/components/Button/BaseButton/buttonTokens.js.map +1 -1
- package/build/lib/web/development/components/Dropdown/Dropdown.js +4 -1
- package/build/lib/web/development/components/Dropdown/Dropdown.js.map +1 -1
- package/build/lib/web/development/components/Dropdown/DropdownButton.js +4 -1
- package/build/lib/web/development/components/Dropdown/DropdownButton.js.map +1 -1
- package/build/lib/web/development/components/Dropdown/DropdownOverlay.web.js +4 -2
- package/build/lib/web/development/components/Dropdown/DropdownOverlay.web.js.map +1 -1
- package/build/lib/web/development/components/Dropdown/InputDropdownButton.web.js +180 -0
- package/build/lib/web/development/components/Dropdown/InputDropdownButton.web.js.map +1 -0
- package/build/lib/web/development/components/Dropdown/dropdownComponentIds.js +2 -1
- package/build/lib/web/development/components/Dropdown/dropdownComponentIds.js.map +1 -1
- package/build/lib/web/development/components/Dropdown/index.js +1 -0
- package/build/lib/web/development/components/Dropdown/index.js.map +1 -1
- package/build/lib/web/development/components/Dropdown/useDropdown.js.map +1 -1
- package/build/lib/web/development/components/Icons/ChevronUpDownIcon/ChevronUpDownIcon.js +40 -0
- package/build/lib/web/development/components/Icons/ChevronUpDownIcon/ChevronUpDownIcon.js.map +1 -0
- package/build/lib/web/development/components/Icons/ChevronUpDownIcon/index.js +2 -0
- package/build/lib/web/development/components/Icons/ChevronUpDownIcon/index.js.map +1 -0
- package/build/lib/web/development/components/Icons/index.js +1 -0
- package/build/lib/web/development/components/Icons/index.js.map +1 -1
- package/build/lib/web/development/components/Input/BaseInput/BaseInput.js +10 -4
- package/build/lib/web/development/components/Input/BaseInput/BaseInput.js.map +1 -1
- package/build/lib/web/development/components/Input/BaseInput/BaseInputVisuals.js +32 -8
- package/build/lib/web/development/components/Input/BaseInput/BaseInputVisuals.js.map +1 -1
- package/build/lib/web/development/components/Input/BaseInput/StyledBaseInput.web.js +2 -1
- package/build/lib/web/development/components/Input/BaseInput/StyledBaseInput.web.js.map +1 -1
- package/build/lib/web/development/components/Input/BaseInput/baseInputStyles.js +8 -4
- package/build/lib/web/development/components/Input/BaseInput/baseInputStyles.js.map +1 -1
- package/build/lib/web/development/components/Input/BaseInput/baseInputTokens.js +1 -1
- package/build/lib/web/development/components/Input/BaseInput/baseInputTokens.js.map +1 -1
- package/build/lib/web/development/components/Input/DropdownInputTriggers/BaseDropdownInputTrigger.js +25 -124
- package/build/lib/web/development/components/Input/DropdownInputTriggers/BaseDropdownInputTrigger.js.map +1 -1
- package/build/lib/web/development/components/Input/PhoneNumberInput/CountrySelector.web.js +6 -4
- package/build/lib/web/development/components/Input/PhoneNumberInput/CountrySelector.web.js.map +1 -1
- package/build/lib/web/development/components/Input/SearchInput/SearchInput.js +97 -30
- package/build/lib/web/development/components/Input/SearchInput/SearchInput.js.map +1 -1
- package/build/lib/web/development/components/Input/TextInput/TextInput.js +123 -31
- package/build/lib/web/development/components/Input/TextInput/TextInput.js.map +1 -1
- package/build/lib/web/development/components/Typography/Text/Text.js +0 -1
- package/build/lib/web/development/components/Typography/Text/Text.js.map +1 -1
- package/build/lib/web/development/components/index.js +2 -0
- package/build/lib/web/development/components/index.js.map +1 -1
- package/build/lib/web/development/utils/useControlledDropdownInput/index.js +2 -0
- package/build/lib/web/development/utils/useControlledDropdownInput/index.js.map +1 -0
- package/build/lib/web/development/utils/useControlledDropdownInput/useControlledDropdownInput.js +108 -0
- package/build/lib/web/development/utils/useControlledDropdownInput/useControlledDropdownInput.js.map +1 -0
- package/build/lib/web/production/components/Accordion/AccordionItemHeader.js +18 -2
- package/build/lib/web/production/components/Accordion/AccordionItemHeader.js.map +1 -1
- package/build/lib/web/production/components/Accordion/StyledAccordionButton.web.js +4 -3
- package/build/lib/web/production/components/Accordion/StyledAccordionButton.web.js.map +1 -1
- package/build/lib/web/production/components/Accordion/commonStyles.js +1 -11
- package/build/lib/web/production/components/Accordion/commonStyles.js.map +1 -1
- package/build/lib/web/production/components/ActionList/ActionListItem.js +2 -1
- package/build/lib/web/production/components/ActionList/ActionListItem.js.map +1 -1
- package/build/lib/web/production/components/BaseHeaderFooter/BaseHeader.js +6 -3
- package/build/lib/web/production/components/BaseHeaderFooter/BaseHeader.js.map +1 -1
- package/build/lib/web/production/components/Button/BaseButton/BaseButton.js +24 -3
- package/build/lib/web/production/components/Button/BaseButton/BaseButton.js.map +1 -1
- package/build/lib/web/production/components/Button/BaseButton/StyledBaseButton.web.js +14 -2
- package/build/lib/web/production/components/Button/BaseButton/StyledBaseButton.web.js.map +1 -1
- package/build/lib/web/production/components/Button/BaseButton/buttonTokens.js +19 -0
- package/build/lib/web/production/components/Button/BaseButton/buttonTokens.js.map +1 -1
- package/build/lib/web/production/components/Dropdown/Dropdown.js +4 -1
- package/build/lib/web/production/components/Dropdown/Dropdown.js.map +1 -1
- package/build/lib/web/production/components/Dropdown/DropdownButton.js +4 -1
- package/build/lib/web/production/components/Dropdown/DropdownButton.js.map +1 -1
- package/build/lib/web/production/components/Dropdown/DropdownOverlay.web.js +4 -2
- package/build/lib/web/production/components/Dropdown/DropdownOverlay.web.js.map +1 -1
- package/build/lib/web/production/components/Dropdown/InputDropdownButton.web.js +180 -0
- package/build/lib/web/production/components/Dropdown/InputDropdownButton.web.js.map +1 -0
- package/build/lib/web/production/components/Dropdown/dropdownComponentIds.js +2 -1
- package/build/lib/web/production/components/Dropdown/dropdownComponentIds.js.map +1 -1
- package/build/lib/web/production/components/Dropdown/index.js +1 -0
- package/build/lib/web/production/components/Dropdown/index.js.map +1 -1
- package/build/lib/web/production/components/Dropdown/useDropdown.js.map +1 -1
- package/build/lib/web/production/components/Icons/ChevronUpDownIcon/ChevronUpDownIcon.js +40 -0
- package/build/lib/web/production/components/Icons/ChevronUpDownIcon/ChevronUpDownIcon.js.map +1 -0
- package/build/lib/web/production/components/Icons/ChevronUpDownIcon/index.js +2 -0
- package/build/lib/web/production/components/Icons/ChevronUpDownIcon/index.js.map +1 -0
- package/build/lib/web/production/components/Icons/index.js +1 -0
- package/build/lib/web/production/components/Icons/index.js.map +1 -1
- package/build/lib/web/production/components/Input/BaseInput/BaseInput.js +10 -4
- package/build/lib/web/production/components/Input/BaseInput/BaseInput.js.map +1 -1
- package/build/lib/web/production/components/Input/BaseInput/BaseInputVisuals.js +32 -8
- package/build/lib/web/production/components/Input/BaseInput/BaseInputVisuals.js.map +1 -1
- package/build/lib/web/production/components/Input/BaseInput/StyledBaseInput.web.js +2 -1
- package/build/lib/web/production/components/Input/BaseInput/StyledBaseInput.web.js.map +1 -1
- package/build/lib/web/production/components/Input/BaseInput/baseInputStyles.js +8 -4
- package/build/lib/web/production/components/Input/BaseInput/baseInputStyles.js.map +1 -1
- package/build/lib/web/production/components/Input/BaseInput/baseInputTokens.js +1 -1
- package/build/lib/web/production/components/Input/BaseInput/baseInputTokens.js.map +1 -1
- package/build/lib/web/production/components/Input/DropdownInputTriggers/BaseDropdownInputTrigger.js +25 -124
- package/build/lib/web/production/components/Input/DropdownInputTriggers/BaseDropdownInputTrigger.js.map +1 -1
- package/build/lib/web/production/components/Input/PhoneNumberInput/CountrySelector.web.js +6 -4
- package/build/lib/web/production/components/Input/PhoneNumberInput/CountrySelector.web.js.map +1 -1
- package/build/lib/web/production/components/Input/SearchInput/SearchInput.js +97 -30
- package/build/lib/web/production/components/Input/SearchInput/SearchInput.js.map +1 -1
- package/build/lib/web/production/components/Input/TextInput/TextInput.js +123 -31
- package/build/lib/web/production/components/Input/TextInput/TextInput.js.map +1 -1
- package/build/lib/web/production/components/Typography/Text/Text.js +0 -1
- package/build/lib/web/production/components/Typography/Text/Text.js.map +1 -1
- package/build/lib/web/production/components/index.js +2 -0
- package/build/lib/web/production/components/index.js.map +1 -1
- package/build/lib/web/production/utils/useControlledDropdownInput/index.js +2 -0
- package/build/lib/web/production/utils/useControlledDropdownInput/index.js.map +1 -0
- package/build/lib/web/production/utils/useControlledDropdownInput/useControlledDropdownInput.js +108 -0
- package/build/lib/web/production/utils/useControlledDropdownInput/useControlledDropdownInput.js.map +1 -0
- package/build/types/components/index.d.ts +3098 -3001
- package/build/types/components/index.native.d.ts +2719 -2686
- package/package.json +1 -1
package/build/lib/web/development/utils/useControlledDropdownInput/useControlledDropdownInput.js
ADDED
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import React__default from 'react';
|
|
2
|
+
import isEmpty from '../lodashButBetter/isEmpty.js';
|
|
3
|
+
import '../index.js';
|
|
4
|
+
import { useFirstRender } from '../useFirstRender.js';
|
|
5
|
+
import '../fireNativeEvent/index.js';
|
|
6
|
+
import { useDropdown } from '../../components/Dropdown/useDropdown.js';
|
|
7
|
+
import { isBrowser } from '../platform/isBrowser.js';
|
|
8
|
+
import { fireNativeEvent } from '../fireNativeEvent/fireNativeEvent.web.js';
|
|
9
|
+
|
|
10
|
+
var useControlledDropdownInput = function useControlledDropdownInput(props) {
|
|
11
|
+
var isFirstRender = useFirstRender();
|
|
12
|
+
var _useDropdown = useDropdown(),
|
|
13
|
+
changeCallbackTriggerer = _useDropdown.changeCallbackTriggerer,
|
|
14
|
+
isControlled = _useDropdown.isControlled,
|
|
15
|
+
options = _useDropdown.options,
|
|
16
|
+
selectedIndices = _useDropdown.selectedIndices,
|
|
17
|
+
controlledValueIndices = _useDropdown.controlledValueIndices,
|
|
18
|
+
setSelectedIndices = _useDropdown.setSelectedIndices,
|
|
19
|
+
selectionType = _useDropdown.selectionType,
|
|
20
|
+
setIsControlled = _useDropdown.setIsControlled;
|
|
21
|
+
var getValuesArrayFromIndices = function getValuesArrayFromIndices() {
|
|
22
|
+
var indices = [];
|
|
23
|
+
if (isControlled) {
|
|
24
|
+
indices = controlledValueIndices;
|
|
25
|
+
} else {
|
|
26
|
+
indices = selectedIndices;
|
|
27
|
+
}
|
|
28
|
+
return indices.map(function (selectionIndex) {
|
|
29
|
+
return options[selectionIndex].value;
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
var selectValues = function selectValues(valuesToSelect) {
|
|
33
|
+
if (options.length > 0) {
|
|
34
|
+
// we use empty `''` for clearing the input
|
|
35
|
+
if (isEmpty(valuesToSelect)) {
|
|
36
|
+
setSelectedIndices([]);
|
|
37
|
+
} else if (typeof valuesToSelect === 'string') {
|
|
38
|
+
// single select control
|
|
39
|
+
var selectedItemIndex = options.findIndex(function (option) {
|
|
40
|
+
return option.value === valuesToSelect;
|
|
41
|
+
});
|
|
42
|
+
if (selectedItemIndex >= 0) {
|
|
43
|
+
setSelectedIndices([selectedItemIndex]);
|
|
44
|
+
}
|
|
45
|
+
} else {
|
|
46
|
+
// multiselect control
|
|
47
|
+
|
|
48
|
+
// Handles repeated values in user state
|
|
49
|
+
var uniqueValues = Array.from(new Set(valuesToSelect));
|
|
50
|
+
// Handle selectionType single with multiselect values
|
|
51
|
+
var userValues = selectionType === 'single' ? [valuesToSelect === null || valuesToSelect === void 0 ? void 0 : valuesToSelect[0]] : uniqueValues;
|
|
52
|
+
var selectedItemIndices = userValues.map(function (optionValue) {
|
|
53
|
+
return options.findIndex(function (option) {
|
|
54
|
+
return option.value === optionValue;
|
|
55
|
+
});
|
|
56
|
+
}).filter(function (value) {
|
|
57
|
+
return value >= 0;
|
|
58
|
+
});
|
|
59
|
+
setSelectedIndices(selectedItemIndices);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
// Handles `defaultValue` prop
|
|
65
|
+
React__default.useEffect(function () {
|
|
66
|
+
if (options.length > 0 && props.defaultValue) {
|
|
67
|
+
selectValues(props.defaultValue);
|
|
68
|
+
}
|
|
69
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
70
|
+
}, [options.length]);
|
|
71
|
+
|
|
72
|
+
// Handles `value` prop
|
|
73
|
+
React__default.useEffect(function () {
|
|
74
|
+
if (options.length > 0 && props.value !== undefined) {
|
|
75
|
+
if (!isControlled) {
|
|
76
|
+
setIsControlled(true);
|
|
77
|
+
}
|
|
78
|
+
selectValues(props.value);
|
|
79
|
+
|
|
80
|
+
// in single select AutoComplete, we have to set inputValue of autocomplete according to the new selection.
|
|
81
|
+
if (selectionType === 'single' && !Array.isArray(props.value) && !props.isSelectInput) {
|
|
82
|
+
var _props$syncInputValue;
|
|
83
|
+
(_props$syncInputValue = props.syncInputValueWithSelection) === null || _props$syncInputValue === void 0 ? void 0 : _props$syncInputValue.call(props, props.value);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
87
|
+
}, [props.value, options]);
|
|
88
|
+
|
|
89
|
+
// onChange behaviour
|
|
90
|
+
React__default.useEffect(function () {
|
|
91
|
+
// Ignore calling onChange on mount
|
|
92
|
+
|
|
93
|
+
if (!isFirstRender) {
|
|
94
|
+
var _props$onChange;
|
|
95
|
+
(_props$onChange = props.onChange) === null || _props$onChange === void 0 ? void 0 : _props$onChange.call(props, {
|
|
96
|
+
name: props.name,
|
|
97
|
+
values: getValuesArrayFromIndices()
|
|
98
|
+
});
|
|
99
|
+
if (isBrowser()) {
|
|
100
|
+
fireNativeEvent(props.triggererRef, ['change', 'input']);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
104
|
+
}, [changeCallbackTriggerer]);
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
export { useControlledDropdownInput };
|
|
108
|
+
//# sourceMappingURL=useControlledDropdownInput.js.map
|
package/build/lib/web/development/utils/useControlledDropdownInput/useControlledDropdownInput.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useControlledDropdownInput.js","sources":["../../../../../../src/utils/useControlledDropdownInput/useControlledDropdownInput.tsx"],"sourcesContent":["import React from 'react';\nimport type { BaseDropdownInputTriggerProps } from '~components/Input/DropdownInputTriggers/types';\nimport isEmpty from '~utils/lodashButBetter/isEmpty';\nimport { isBrowser } from '~utils';\nimport { useFirstRender } from '~utils/useFirstRender';\nimport { fireNativeEvent } from '~utils/fireNativeEvent';\nimport { useDropdown } from '~components/Dropdown/useDropdown';\n\nexport type useControlledDropdownInputProps = Pick<\n BaseDropdownInputTriggerProps,\n | 'onChange'\n | 'name'\n | 'value'\n | 'defaultValue'\n | 'onInputValueChange'\n | 'syncInputValueWithSelection'\n | 'isSelectInput'\n> & {\n triggererRef: React.RefObject<HTMLElement>;\n};\n\nconst useControlledDropdownInput = (props: useControlledDropdownInputProps): void => {\n const isFirstRender = useFirstRender();\n const {\n changeCallbackTriggerer,\n isControlled,\n options,\n selectedIndices,\n controlledValueIndices,\n setSelectedIndices,\n selectionType,\n setIsControlled,\n } = useDropdown();\n\n const getValuesArrayFromIndices = (): string[] => {\n let indices: number[] = [];\n if (isControlled) {\n indices = controlledValueIndices;\n } else {\n indices = selectedIndices;\n }\n\n return indices.map((selectionIndex) => options[selectionIndex].value);\n };\n\n const selectValues = (valuesToSelect: string | string[]): void => {\n if (options.length > 0) {\n // we use empty `''` for clearing the input\n if (isEmpty(valuesToSelect)) {\n setSelectedIndices([]);\n } else if (typeof valuesToSelect === 'string') {\n // single select control\n const selectedItemIndex = options.findIndex((option) => option.value === valuesToSelect);\n if (selectedItemIndex >= 0) {\n setSelectedIndices([selectedItemIndex]);\n }\n } else {\n // multiselect control\n\n // Handles repeated values in user state\n const uniqueValues = Array.from(new Set(valuesToSelect));\n // Handle selectionType single with multiselect values\n const userValues = selectionType === 'single' ? [valuesToSelect?.[0]] : uniqueValues;\n\n const selectedItemIndices = userValues\n .map((optionValue) => options.findIndex((option) => option.value === optionValue))\n .filter((value) => value >= 0);\n\n setSelectedIndices(selectedItemIndices);\n }\n }\n };\n\n // Handles `defaultValue` prop\n React.useEffect(() => {\n if (options.length > 0 && props.defaultValue) {\n selectValues(props.defaultValue);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [options.length]);\n\n // Handles `value` prop\n React.useEffect(() => {\n if (options.length > 0 && props.value !== undefined) {\n if (!isControlled) {\n setIsControlled(true);\n }\n\n selectValues(props.value);\n\n // in single select AutoComplete, we have to set inputValue of autocomplete according to the new selection.\n if (selectionType === 'single' && !Array.isArray(props.value) && !props.isSelectInput) {\n props.syncInputValueWithSelection?.(props.value);\n }\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [props.value, options]);\n\n // onChange behaviour\n React.useEffect(() => {\n // Ignore calling onChange on mount\n\n if (!isFirstRender) {\n props.onChange?.({\n name: props.name,\n values: getValuesArrayFromIndices(),\n });\n if (isBrowser()) {\n fireNativeEvent(props.triggererRef, ['change', 'input']);\n }\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [changeCallbackTriggerer]);\n};\n\nexport { useControlledDropdownInput };\n"],"names":["useControlledDropdownInput","props","isFirstRender","useFirstRender","_useDropdown","useDropdown","changeCallbackTriggerer","isControlled","options","selectedIndices","controlledValueIndices","setSelectedIndices","selectionType","setIsControlled","getValuesArrayFromIndices","indices","map","selectionIndex","value","selectValues","valuesToSelect","length","isEmpty","selectedItemIndex","findIndex","option","uniqueValues","Array","from","Set","userValues","selectedItemIndices","optionValue","filter","React","useEffect","defaultValue","undefined","isArray","isSelectInput","_props$syncInputValue","syncInputValueWithSelection","call","_props$onChange","onChange","name","values","isBrowser","fireNativeEvent","triggererRef"],"mappings":";;;;;;;;;AAqBA,IAAMA,0BAA0B,GAAG,SAA7BA,0BAA0BA,CAAIC,KAAsC,EAAW;AACnF,EAAA,IAAMC,aAAa,GAAGC,cAAc,EAAE,CAAA;AACtC,EAAA,IAAAC,YAAA,GASIC,WAAW,EAAE;IARfC,uBAAuB,GAAAF,YAAA,CAAvBE,uBAAuB;IACvBC,YAAY,GAAAH,YAAA,CAAZG,YAAY;IACZC,OAAO,GAAAJ,YAAA,CAAPI,OAAO;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CAACrC,KAAK,CAACiB,KAAK,CAAC,IAAI,CAACjB,KAAK,CAACsC,aAAa,EAAE;AAAA,QAAA,IAAAC,qBAAA,CAAA;AACrF,QAAA,CAAAA,qBAAA,GAAAvC,KAAK,CAACwC,2BAA2B,cAAAD,qBAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAjCA,qBAAA,CAAAE,IAAA,CAAAzC,KAAK,EAA+BA,KAAK,CAACiB,KAAK,CAAC,CAAA;AAClD,OAAA;AACF,KAAA;AACA;GACD,EAAE,CAACjB,KAAK,CAACiB,KAAK,EAAEV,OAAO,CAAC,CAAC,CAAA;;AAE1B;EACA0B,cAAK,CAACC,SAAS,CAAC,YAAM;AACpB;;IAEA,IAAI,CAACjC,aAAa,EAAE;AAAA,MAAA,IAAAyC,eAAA,CAAA;AAClB,MAAA,CAAAA,eAAA,GAAA1C,KAAK,CAAC2C,QAAQ,MAAA,IAAA,IAAAD,eAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAdA,eAAA,CAAAD,IAAA,CAAAzC,KAAK,EAAY;QACf4C,IAAI,EAAE5C,KAAK,CAAC4C,IAAI;QAChBC,MAAM,EAAEhC,yBAAyB,EAAC;AACpC,OAAC,CAAC,CAAA;MACF,IAAIiC,SAAS,EAAE,EAAE;QACfC,eAAe,CAAC/C,KAAK,CAACgD,YAAY,EAAE,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC,CAAA;AAC1D,OAAA;AACF,KAAA;AACA;AACF,GAAC,EAAE,CAAC3C,uBAAuB,CAAC,CAAC,CAAA;AAC/B;;;;"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
2
2
|
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
3
|
+
import React__default from 'react';
|
|
3
4
|
import { useAccordion, useAccordionItemIndex } from './AccordionContext.js';
|
|
4
5
|
import { componentIds } from './componentIds.js';
|
|
5
6
|
import { BaseHeader } from '../BaseHeaderFooter/BaseHeader.js';
|
|
@@ -30,10 +31,20 @@ var _AccordionItemHeader = function _AccordionItemHeader(_ref) {
|
|
|
30
31
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
31
32
|
var _useAccordion = useAccordion(),
|
|
32
33
|
size = _useAccordion.size,
|
|
33
|
-
showNumberPrefix = _useAccordion.showNumberPrefix
|
|
34
|
+
showNumberPrefix = _useAccordion.showNumberPrefix,
|
|
35
|
+
expandedIndex = _useAccordion.expandedIndex;
|
|
34
36
|
var _useAccordionItemInde = useAccordionItemIndex(),
|
|
35
37
|
index = _useAccordionItemInde.index,
|
|
36
38
|
isDisabled = _useAccordionItemInde.isDisabled;
|
|
39
|
+
var isLeadingNumberOrIcon = React__default.useMemo(function () {
|
|
40
|
+
var _leading$type$name;
|
|
41
|
+
// Check if leading is a number
|
|
42
|
+
if (showNumberPrefix && typeof index === 'number') return true;
|
|
43
|
+
|
|
44
|
+
// Check if leading is an Icon component (name ends with "Icon")
|
|
45
|
+
if (leading && /*#__PURE__*/React__default.isValidElement(leading) && typeof leading.type === 'function' && (_leading$type$name = leading.type.name) !== null && _leading$type$name !== void 0 && _leading$type$name.endsWith('Icon')) return true;
|
|
46
|
+
return false;
|
|
47
|
+
}, [leading, showNumberPrefix, index]);
|
|
37
48
|
return /*#__PURE__*/jsx(BaseBox, _objectSpread(_objectSpread({}, metaAttribute({
|
|
38
49
|
name: MetaConstants.AccordionItemHeader
|
|
39
50
|
})), {}, {
|
|
@@ -56,10 +67,15 @@ var _AccordionItemHeader = function _AccordionItemHeader(_ref) {
|
|
|
56
67
|
isDisabled: isDisabled,
|
|
57
68
|
showBackButton: false,
|
|
58
69
|
showCloseButton: false,
|
|
59
|
-
showDivider:
|
|
70
|
+
showDivider: expandedIndex === index,
|
|
60
71
|
paddingX: "spacing.5",
|
|
61
72
|
marginY: "spacing.5",
|
|
62
73
|
size: size,
|
|
74
|
+
alignItems: !subtitle && !isLeadingNumberOrIcon ? 'center' : 'flex-start',
|
|
75
|
+
dividerProps: {
|
|
76
|
+
thickness: 'thinner',
|
|
77
|
+
marginX: 'spacing.5'
|
|
78
|
+
},
|
|
63
79
|
trailingInteractionElement: /*#__PURE__*/jsx(CollapsibleChevronIcon, {
|
|
64
80
|
color: isDisabled ? 'interactive.icon.gray.disabled' : 'interactive.icon.gray.muted',
|
|
65
81
|
size: "large"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AccordionItemHeader.js","sources":["../../../../../../src/components/Accordion/AccordionItemHeader.tsx"],"sourcesContent":["import { useAccordion, useAccordionItemIndex } from './AccordionContext';\nimport { componentIds } from './componentIds';\nimport type { BaseHeaderProps } from '~components/BaseHeaderFooter/BaseHeader';\nimport { BaseHeader } from '~components/BaseHeaderFooter/BaseHeader';\nimport { Text } from '~components/Typography';\nimport BaseBox from '~components/Box/BaseBox';\nimport { CollapsibleChevronIcon } from '~components/Collapsible/CollapsibleChevronIcon';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport type { DataAnalyticsAttribute } from '~utils/types';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport { makeAnalyticsAttribute } from '~utils/makeAnalyticsAttribute';\n\nconst _AccordionItemHeader = ({\n title,\n subtitle,\n leading,\n children,\n trailing,\n titleSuffix,\n ...rest\n}: Pick<\n BaseHeaderProps,\n 'title' | 'subtitle' | 'leading' | 'children' | 'trailing' | 'titleSuffix'\n> &\n DataAnalyticsAttribute): React.ReactElement => {\n const { size, showNumberPrefix } = useAccordion();\n const { index, isDisabled } = useAccordionItemIndex();\n\n return (\n <BaseBox {...metaAttribute({ name: MetaConstants.AccordionItemHeader })} flex=\"1\">\n <BaseHeader\n leading={\n showNumberPrefix && typeof index === 'number' ? (\n // we have to add -2px margin to align the number with title of BaseHeader\n <Text size={size} weight=\"semibold\" marginTop=\"-2px\" as=\"span\">\n {index + 1}.\n </Text>\n ) : (\n leading\n )\n }\n title={title}\n subtitle={subtitle}\n trailing={trailing}\n titleSuffix={titleSuffix}\n isDisabled={isDisabled}\n showBackButton={false}\n showCloseButton={false}\n showDivider={
|
|
1
|
+
{"version":3,"file":"AccordionItemHeader.js","sources":["../../../../../../src/components/Accordion/AccordionItemHeader.tsx"],"sourcesContent":["import React from 'react';\nimport { useAccordion, useAccordionItemIndex } from './AccordionContext';\nimport { componentIds } from './componentIds';\nimport type { BaseHeaderProps } from '~components/BaseHeaderFooter/BaseHeader';\nimport { BaseHeader } from '~components/BaseHeaderFooter/BaseHeader';\nimport { Text } from '~components/Typography';\nimport BaseBox from '~components/Box/BaseBox';\nimport { CollapsibleChevronIcon } from '~components/Collapsible/CollapsibleChevronIcon';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport type { DataAnalyticsAttribute } from '~utils/types';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport { makeAnalyticsAttribute } from '~utils/makeAnalyticsAttribute';\n\nconst _AccordionItemHeader = ({\n title,\n subtitle,\n leading,\n children,\n trailing,\n titleSuffix,\n ...rest\n}: Pick<\n BaseHeaderProps,\n 'title' | 'subtitle' | 'leading' | 'children' | 'trailing' | 'titleSuffix'\n> &\n DataAnalyticsAttribute): React.ReactElement => {\n const { size, showNumberPrefix, expandedIndex } = useAccordion();\n const { index, isDisabled } = useAccordionItemIndex();\n\n const isLeadingNumberOrIcon = React.useMemo(() => {\n // Check if leading is a number\n if (showNumberPrefix && typeof index === 'number') return true;\n\n // Check if leading is an Icon component (name ends with \"Icon\")\n if (\n leading &&\n React.isValidElement(leading) &&\n typeof leading.type === 'function' &&\n leading.type.name?.endsWith('Icon')\n )\n return true;\n\n return false;\n }, [leading, showNumberPrefix, index]);\n\n return (\n <BaseBox {...metaAttribute({ name: MetaConstants.AccordionItemHeader })} flex=\"1\">\n <BaseHeader\n leading={\n showNumberPrefix && typeof index === 'number' ? (\n // we have to add -2px margin to align the number with title of BaseHeader\n <Text size={size} weight=\"semibold\" marginTop=\"-2px\" as=\"span\">\n {index + 1}.\n </Text>\n ) : (\n leading\n )\n }\n title={title}\n subtitle={subtitle}\n trailing={trailing}\n titleSuffix={titleSuffix}\n isDisabled={isDisabled}\n showBackButton={false}\n showCloseButton={false}\n showDivider={expandedIndex === index}\n paddingX=\"spacing.5\"\n marginY=\"spacing.5\"\n size={size}\n alignItems={!subtitle && !isLeadingNumberOrIcon ? 'center' : 'flex-start'}\n dividerProps={{\n thickness: 'thinner',\n marginX: 'spacing.5',\n }}\n trailingInteractionElement={\n <CollapsibleChevronIcon\n color={isDisabled ? 'interactive.icon.gray.disabled' : 'interactive.icon.gray.muted'}\n size=\"large\"\n />\n }\n {...makeAnalyticsAttribute(rest)}\n >\n {children}\n </BaseHeader>\n </BaseBox>\n );\n};\n\nconst AccordionItemHeader = assignWithoutSideEffects(_AccordionItemHeader, {\n componentId: componentIds.AccordionItemHeader,\n});\n\nexport { AccordionItemHeader };\n"],"names":["_AccordionItemHeader","_ref","title","subtitle","leading","children","trailing","titleSuffix","rest","_objectWithoutProperties","_excluded","_useAccordion","useAccordion","size","showNumberPrefix","expandedIndex","_useAccordionItemInde","useAccordionItemIndex","index","isDisabled","isLeadingNumberOrIcon","React","useMemo","_leading$type$name","isValidElement","type","name","endsWith","_jsx","BaseBox","_objectSpread","metaAttribute","MetaConstants","AccordionItemHeader","flex","BaseHeader","_jsxs","Text","weight","marginTop","as","showBackButton","showCloseButton","showDivider","paddingX","marginY","alignItems","dividerProps","thickness","marginX","trailingInteractionElement","CollapsibleChevronIcon","color","makeAnalyticsAttribute","assignWithoutSideEffects","componentId","componentIds"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAaA,IAAMA,oBAAoB,GAAG,SAAvBA,oBAAoBA,CAAAC,IAAA,EAYuB;AAAA,EAAA,IAX/CC,KAAK,GAAAD,IAAA,CAALC,KAAK;IACLC,QAAQ,GAAAF,IAAA,CAARE,QAAQ;IACRC,OAAO,GAAAH,IAAA,CAAPG,OAAO;IACPC,QAAQ,GA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AA,EAAA,EAAA,EAAA;AAAAH,MAAAA,QAAA,EAE/BA,QAAAA;KACS,CAAA,CAAA;AAAC,GAAA,CACN,CAAC,CAAA;AAEd,CAAC,CAAA;AAED,IAAM4B,mBAAmB,gBAAGqB,wBAAwB,CAACtD,oBAAoB,EAAE;EACzEuD,WAAW,EAAEC,YAAY,CAACvB,mBAAAA;AAC5B,CAAC;;;;"}
|
|
@@ -19,7 +19,6 @@ var StyledAccordionButton = /*#__PURE__*/styled.button.withConfig({
|
|
|
19
19
|
return _objectSpread(_objectSpread({}, commonStyles), {}, {
|
|
20
20
|
backgroundColor: getBackgroundColor({
|
|
21
21
|
theme: theme,
|
|
22
|
-
isExpanded: isExpanded,
|
|
23
22
|
isActive: false
|
|
24
23
|
}),
|
|
25
24
|
transitionProperty: 'background-color, box-shadow, border-radius, color',
|
|
@@ -33,10 +32,12 @@ var StyledAccordionButton = /*#__PURE__*/styled.button.withConfig({
|
|
|
33
32
|
'&:hover, &:focus-visible': {
|
|
34
33
|
backgroundColor: getBackgroundColor({
|
|
35
34
|
theme: theme,
|
|
36
|
-
isExpanded: isExpanded,
|
|
37
35
|
isActive: true
|
|
38
36
|
}),
|
|
39
|
-
color: theme.colors.interactive.icon.gray.subtle
|
|
37
|
+
color: theme.colors.interactive.icon.gray.subtle,
|
|
38
|
+
'& [data-blade-component="divider"]': {
|
|
39
|
+
opacity: 0
|
|
40
|
+
}
|
|
40
41
|
},
|
|
41
42
|
'&:focus-visible': _objectSpread(_objectSpread({}, getFocusRingStyles({
|
|
42
43
|
theme: theme
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StyledAccordionButton.web.js","sources":["../../../../../../src/components/Accordion/StyledAccordionButton.web.tsx"],"sourcesContent":["import styled from 'styled-components';\nimport type { StyledAccordionButtonProps } from './types';\nimport {\n getBackgroundColor,\n getCommonAccordionButtonStyles,\n getTransitionDuration,\n getTransitionEasing,\n} from './commonStyles';\nimport { castWebType } from '~utils';\nimport { getFocusRingStyles } from '~utils/getFocusRingStyles';\n\nconst StyledAccordionButton = styled.button<StyledAccordionButtonProps>((props) => {\n const { theme, isExpanded, disabled } = props;\n const commonStyles = getCommonAccordionButtonStyles(props);\n return {\n ...commonStyles,\n backgroundColor: getBackgroundColor({ theme,
|
|
1
|
+
{"version":3,"file":"StyledAccordionButton.web.js","sources":["../../../../../../src/components/Accordion/StyledAccordionButton.web.tsx"],"sourcesContent":["import styled from 'styled-components';\nimport type { StyledAccordionButtonProps } from './types';\nimport {\n getBackgroundColor,\n getCommonAccordionButtonStyles,\n getTransitionDuration,\n getTransitionEasing,\n} from './commonStyles';\nimport { castWebType } from '~utils';\nimport { getFocusRingStyles } from '~utils/getFocusRingStyles';\n\nconst StyledAccordionButton = styled.button<StyledAccordionButtonProps>((props) => {\n const { theme, isExpanded, disabled } = props;\n const commonStyles = getCommonAccordionButtonStyles(props);\n return {\n ...commonStyles,\n backgroundColor: getBackgroundColor({ theme, isActive: false }),\n transitionProperty: 'background-color, box-shadow, border-radius, color',\n transitionDuration: castWebType(getTransitionDuration(theme)),\n transitionTimingFunction: castWebType(getTransitionEasing(theme)),\n cursor: disabled ? 'not-allowed' : 'pointer',\n color: theme.colors.interactive.icon.gray[isExpanded ? 'subtle' : 'muted'],\n width: '100%',\n border: 'none',\n textAlign: 'left',\n\n '&:hover, &:focus-visible': {\n backgroundColor: getBackgroundColor({ theme, isActive: true }),\n color: theme.colors.interactive.icon.gray.subtle,\n\n '& [data-blade-component=\"divider\"]': {\n opacity: 0,\n },\n },\n '&:focus-visible': {\n ...getFocusRingStyles({ theme }),\n // only need border radius on the focus ring\n borderRadius: theme.border.radius.small,\n },\n };\n});\n\nexport { StyledAccordionButton };\n"],"names":["StyledAccordionButton","styled","button","withConfig","displayName","componentId","props","theme","isExpanded","disabled","commonStyles","getCommonAccordionButtonStyles","_objectSpread","backgroundColor","getBackgroundColor","isActive","transitionProperty","transitionDuration","castWebType","getTransitionDuration","transitionTimingFunction","getTransitionEasing","cursor","color","colors","interactive","icon","gray","width","border","textAlign","subtle","opacity","getFocusRingStyles","borderRadius","radius","small"],"mappings":";;;;;;;;;;AAWA,IAAMA,qBAAqB,gBAAGC,MAAM,CAACC,MAAM,CAAAC,UAAA,CAAA;EAAAC,WAAA,EAAA,iDAAA;EAAAC,WAAA,EAAA,cAAA;AAAA,CAA6B,CAAA,CAAA,UAACC,KAAK,EAAK;AACjF,EAAA,IAAQC,KAAK,GAA2BD,KAAK,CAArCC,KAAK;IAAEC,UAAU,GAAeF,KAAK,CAA9BE,UAAU;IAAEC,QAAQ,GAAKH,KAAK,CAAlBG,QAAQ,CAAA;AACnC,EAAA,IAAMC,YAAY,GAAGC,8BAA8B,CAACL,KAAK,CAAC,CAAA;AAC1D,EAAA,OAAAM,aAAA,CAAAA,aAAA,CAAA,EAAA,EACKF,YAAY,CAAA,EAAA,EAAA,EAAA;IACfG,eAAe,EAAEC,kBAAkB,CAAC;AAAEP,MAAAA,KAAK,EAALA,KAAK;AAAEQ,MAAAA,QAAQ,EAAE,KAAA;AAAM,KAAC,CAAC;AAC/DC,IAAAA,kBAAkB,EAAE,oDAAoD;AACxEC,IAAAA,kBAAkB,EAAEC,WAAW,CAACC,qBAAqB,CAACZ,KAAK,CAAC,CAAC;AAC7Da,IAAAA,wBAAwB,EAAEF,WAAW,CAACG,mBAAmB,CAACd,KAAK,CAAC,CAAC;AACjEe,IAAAA,MAAM,EAAEb,QAAQ,GAAG,aAAa,GAAG,SAAS;AAC5Cc,IAAAA,KAAK,EAAEhB,KAAK,CAACiB,MAAM,CAACC,WAAW,CAACC,IAAI,CAACC,IAAI,CAACnB,UAAU,GAAG,QAAQ,GAAG,OAAO,CAAC;AAC1EoB,IAAAA,KAAK,EAAE,MAAM;AACbC,IAAAA,MAAM,EAAE,MAAM;AACdC,IAAAA,SAAS,EAAE,MAAM;AAEjB,IAAA,0BAA0B,EAAE;MAC1BjB,eAAe,EAAEC,kBAAkB,CAAC;AAAEP,QAAAA,KAAK,EAALA,KAAK;AAAEQ,QAAAA,QAAQ,EAAE,IAAA;AAAK,OAAC,CAAC;MAC9DQ,KAAK,EAAEhB,KAAK,CAACiB,MAAM,CAACC,WAAW,CAACC,IAAI,CAACC,IAAI,CAACI,MAAM;AAEhD,MAAA,oCAAoC,EAAE;AACpCC,QAAAA,OAAO,EAAE,CAAA;AACX,OAAA;KACD;AACD,IAAA,iBAAiB,EAAApB,aAAA,CAAAA,aAAA,CAAA,EAAA,EACZqB,kBAAkB,CAAC;AAAE1B,MAAAA,KAAK,EAALA,KAAAA;AAAM,KAAC,CAAC,CAAA,EAAA,EAAA,EAAA;AAChC;AACA2B,MAAAA,YAAY,EAAE3B,KAAK,CAACsB,MAAM,CAACM,MAAM,CAACC,KAAAA;AAAK,KAAA,CAAA;AACxC,GAAA,CAAA,CAAA;AAEL,CAAC;;;;"}
|
|
@@ -12,19 +12,9 @@ var getTransitionEasing = function getTransitionEasing(theme) {
|
|
|
12
12
|
};
|
|
13
13
|
var getBackgroundColor = function getBackgroundColor(_ref) {
|
|
14
14
|
var theme = _ref.theme,
|
|
15
|
-
isExpanded = _ref.isExpanded,
|
|
16
15
|
isActive = _ref.isActive;
|
|
17
16
|
var gray = theme.colors.interactive.background.gray;
|
|
18
|
-
|
|
19
|
-
if (isActive) {
|
|
20
|
-
return gray.fadedHighlighted;
|
|
21
|
-
}
|
|
22
|
-
return gray.faded;
|
|
23
|
-
}
|
|
24
|
-
if (isActive) {
|
|
25
|
-
return gray.faded;
|
|
26
|
-
}
|
|
27
|
-
return theme.colors.transparent;
|
|
17
|
+
return isActive ? gray.faded : theme.colors.transparent;
|
|
28
18
|
};
|
|
29
19
|
var getCommonAccordionButtonStyles = function getCommonAccordionButtonStyles(props) {
|
|
30
20
|
var theme = props.theme;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commonStyles.js","sources":["../../../../../../src/components/Accordion/commonStyles.ts"],"sourcesContent":["import type { CSSObject, StyledProps } from 'styled-components';\nimport type { StyledAccordionButtonProps } from './types';\nimport type { Theme } from '~components/BladeProvider';\nimport { makeMotionTime } from '~utils';\n\n// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\nconst getTransitionDuration = (theme: Theme) => makeMotionTime(theme.motion.duration['2xquick']);\n\n// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\nconst getTransitionEasing = (theme: Theme) => theme.motion.easing.standard;\n\nconst getBackgroundColor = ({
|
|
1
|
+
{"version":3,"file":"commonStyles.js","sources":["../../../../../../src/components/Accordion/commonStyles.ts"],"sourcesContent":["import type { CSSObject, StyledProps } from 'styled-components';\nimport type { StyledAccordionButtonProps } from './types';\nimport type { Theme } from '~components/BladeProvider';\nimport { makeMotionTime } from '~utils';\n\n// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\nconst getTransitionDuration = (theme: Theme) => makeMotionTime(theme.motion.duration['2xquick']);\n\n// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\nconst getTransitionEasing = (theme: Theme) => theme.motion.easing.standard;\n\nconst getBackgroundColor = ({ theme, isActive }: { theme: Theme; isActive: boolean }): string => {\n const { gray } = theme.colors.interactive.background;\n\n return isActive ? gray.faded : theme.colors.transparent;\n};\n\nconst getCommonAccordionButtonStyles = (\n props: StyledProps<StyledAccordionButtonProps>,\n): CSSObject => {\n const { theme } = props;\n\n return {\n padding: theme.spacing[0],\n display: 'flex',\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'space-between',\n };\n};\n\nexport {\n getTransitionDuration,\n getTransitionEasing,\n getBackgroundColor,\n getCommonAccordionButtonStyles,\n};\n"],"names":["getTransitionDuration","theme","makeMotionTime","motion","duration","getTransitionEasing","easing","standard","getBackgroundColor","_ref","isActive","gray","colors","interactive","background","faded","transparent","getCommonAccordionButtonStyles","props","padding","spacing","display","flexDirection","alignItems","justifyContent"],"mappings":";;;AAKA;AACA,IAAMA,qBAAqB,GAAG,SAAxBA,qBAAqBA,CAAIC,KAAY,EAAA;EAAA,OAAKC,cAAc,CAACD,KAAK,CAACE,MAAM,CAACC,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAA;AAAA,EAAA;;AAEhG;AACA,IAAMC,mBAAmB,GAAG,SAAtBA,mBAAmBA,CAAIJ,KAAY,EAAA;AAAA,EAAA,OAAKA,KAAK,CAACE,MAAM,CAACG,MAAM,CAACC,QAAQ,CAAA;AAAA,EAAA;AAE1E,IAAMC,kBAAkB,GAAG,SAArBA,kBAAkBA,CAAAC,IAAA,EAAyE;AAAA,EAAA,IAAnER,KAAK,GAAAQ,IAAA,CAALR,KAAK;IAAES,QAAQ,GAAAD,IAAA,CAARC,QAAQ,CAAA;EAC3C,IAAQC,IAAI,GAAKV,KAAK,CAACW,MAAM,CAACC,WAAW,CAACC,UAAU,CAA5CH,IAAI,CAAA;EAEZ,OAAOD,QAAQ,GAAGC,IAAI,CAACI,KAAK,GAAGd,KAAK,CAACW,MAAM,CAACI,WAAW,CAAA;AACzD,EAAC;AAED,IAAMC,8BAA8B,GAAG,SAAjCA,8BAA8BA,CAClCC,KAA8C,EAChC;AACd,EAAA,IAAQjB,KAAK,GAAKiB,KAAK,CAAfjB,KAAK,CAAA;EAEb,OAAO;AACLkB,IAAAA,OAAO,EAAElB,KAAK,CAACmB,OAAO,CAAC,CAAC,CAAC;AACzBC,IAAAA,OAAO,EAAE,MAAM;AACfC,IAAAA,aAAa,EAAE,KAAK;AACpBC,IAAAA,UAAU,EAAE,QAAQ;AACpBC,IAAAA,cAAc,EAAE,eAAA;GACjB,CAAA;AACH;;;;"}
|
|
@@ -248,6 +248,7 @@ var _ActionListItem = function _ActionListItem(props) {
|
|
|
248
248
|
}, [activeIndex]);
|
|
249
249
|
var hasAutoComplete = hasAutoCompleteInHeader || dropdownTriggerer === dropdownComponentIds.triggers.AutoComplete;
|
|
250
250
|
var hasFilterChipSelectInput = dropdownTriggerer === dropdownComponentIds.triggers.FilterChipSelectInput;
|
|
251
|
+
var hasInputDropdownButton = dropdownTriggerer === dropdownComponentIds.triggers.InputDropdownButton;
|
|
251
252
|
var renderOnWebAs = props.href ? 'a' : 'button';
|
|
252
253
|
/**
|
|
253
254
|
* In SelectInput, returns the isSelected according to selected indexes in the state
|
|
@@ -256,7 +257,7 @@ var _ActionListItem = function _ActionListItem(props) {
|
|
|
256
257
|
* isSelected prop explicitly is the only way to select item in menu
|
|
257
258
|
*/
|
|
258
259
|
var getIsSelected = function getIsSelected() {
|
|
259
|
-
if (dropdownTriggerer === dropdownComponentIds.triggers.SelectInput || hasAutoComplete || hasFilterChipSelectInput) {
|
|
260
|
+
if (dropdownTriggerer === dropdownComponentIds.triggers.SelectInput || hasAutoComplete || hasFilterChipSelectInput || hasInputDropdownButton) {
|
|
260
261
|
if (typeof props._index === 'number') {
|
|
261
262
|
return selectedIndices.includes(props._index);
|
|
262
263
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActionListItem.js","sources":["../../../../../../src/components/ActionList/ActionListItem.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/ban-ts-comment */\nimport React from 'react';\nimport styled from 'styled-components';\nimport type { TouchableOpacity } from 'react-native';\nimport { componentIds } from './componentIds';\nimport { validateActionListItemProps, getNormalTextColor } from './actionListUtils';\nimport { getActionListItemRole, getActionListSectionRole } from './getA11yRoles';\nimport { Divider } from '~components/Divider';\nimport BaseBox from '~components/Box/BaseBox';\nimport type { IconComponent } from '~components/Icons';\nimport { useDropdown } from '~components/Dropdown/useDropdown';\nimport type { FeedbackColors } from '~tokens/theme/theme';\nimport { Text } from '~components/Typography';\nimport type { Platform } from '~utils';\nimport { castWebType, isReactNative } from '~utils';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport type { DataAnalyticsAttribute, StringChildrenType, TestID } from '~utils/types';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { makeSize } from '~utils/makeSize';\nimport { makeAccessible } from '~utils/makeAccessible';\nimport { throwBladeError } from '~utils/logger';\nimport type { BadgeProps } from '~components/Badge';\nimport { Badge } from '~components/Badge';\nimport { Box } from '~components/Box';\nimport { dropdownComponentIds } from '~components/Dropdown/dropdownComponentIds';\nimport { BaseMenuItem, useBaseMenuItem } from '~components/BaseMenu';\nimport { Checkbox } from '~components/Checkbox';\nimport type { AvatarProps } from '~components/Avatar/types';\nimport { Avatar } from '~components/Avatar';\nimport { makeAnalyticsAttribute } from '~utils/makeAnalyticsAttribute';\n\ntype ActionListItemProps = {\n title: string;\n description?: string;\n onClick?: (clickProps: {\n name: string;\n value?: boolean;\n event: Platform.Select<{\n web: React.MouseEvent;\n native: React.TouchEvent<TouchableOpacity>;\n }>;\n }) => void;\n /**\n * value that you get from `onChange` event on SelectInput or in form submissions.\n */\n value: string;\n /**\n * Link to open when item is clicked.\n */\n href?: string;\n /**\n * HTML target of the link\n */\n target?: string;\n /**\n * Item that goes on left-side of item.\n *\n * Valid elements - `<ActionListItemIcon />`, `<ActionListItemAsset />`\n *\n * Will be overriden in multiselect\n */\n leading?: React.ReactNode;\n /**\n * Item that goes on right-side of item.\n *\n * Valid elements - `<ActionListItemText />`, `<ActionListItemIcon />`\n */\n trailing?: React.ReactNode;\n /**\n * Item that goes immediately next to the title.\n *\n * Valid elements - `<ActionListItemBadge />`, `<ActionListItemBadgeGroup />`\n *\n */\n titleSuffix?: React.ReactElement;\n isDisabled?: boolean;\n intent?: Extract<FeedbackColors, 'negative'>;\n /**\n * Can be used in combination of `onClick` to highlight item as selected in Button Triggers.\n *\n * When trigger is SelectInput, Use `value` prop on SelectInput instead to make dropdown controlled.\n */\n isSelected?: boolean;\n /**\n * Internally passed from ActionList. No need to pass it explicitly\n *\n * @private\n */\n _index?: number;\n /**\n * Internally used to pass index for virtualized lists\n *\n * @private\n */\n _virtualizedIndex?: number;\n /**\n * Internally used to focus on virtualized list\n *\n * @private\n */\n _onVirtualizedFocus?: (_virtuazedIndex: number) => void;\n} & TestID &\n DataAnalyticsAttribute;\n\nconst StyledActionListSectionTitle = styled(BaseBox)((props) => ({\n // @TODO: replace this styled-component with new layout box when we have padding shorthand\n padding: makeSize(props.theme.spacing[3]),\n}));\n\ntype ActionListSectionProps = {\n title: string;\n children: React.ReactNode[] | React.ReactNode;\n /**\n * Internally used to hide the divider on final item in React Native\n *\n * Should not be used by consumers (also won't work on web)\n *\n * @private\n */\n _hideDivider?: boolean;\n /**\n * Internally used to hide / show section in AutoComplete\n *\n * @private\n */\n _sectionChildValues?: string[];\n} & TestID &\n DataAnalyticsAttribute;\n\nconst _ActionListSectionTitle = ({\n title,\n isInsideVirtualizedList = false,\n}: {\n title: string;\n isInsideVirtualizedList?: boolean;\n}): React.ReactElement => {\n return (\n <StyledActionListSectionTitle\n {...makeAccessible({\n hidden: !isInsideVirtualizedList,\n role: isInsideVirtualizedList ? 'heading' : undefined,\n })}\n >\n <Text color=\"surface.text.gray.muted\" size=\"small\" weight=\"semibold\">\n {title}\n </Text>\n </StyledActionListSectionTitle>\n );\n};\n\nconst ActionListSectionTitle = assignWithoutSideEffects(_ActionListSectionTitle, {\n componentId: componentIds.ActionListSectionTitle,\n});\nconst _ActionListSection = ({\n title,\n children,\n testID,\n _hideDivider,\n _sectionChildValues,\n ...rest\n}: ActionListSectionProps): React.ReactElement => {\n const { hasAutoCompleteInHeader, dropdownTriggerer, filteredValues } = useDropdown();\n const hasAutoComplete =\n hasAutoCompleteInHeader || dropdownTriggerer === dropdownComponentIds.triggers.AutoComplete;\n\n const isSectionVisible = React.useMemo(() => {\n if (hasAutoComplete) {\n const visibleActionListItemInSection = _sectionChildValues?.find((actionItemValue) =>\n filteredValues.includes(actionItemValue),\n );\n\n return Boolean(visibleActionListItemInSection);\n }\n\n return true;\n }, [_sectionChildValues, hasAutoComplete, filteredValues]);\n\n const showDividerInRN = !(_hideDivider && isReactNative());\n const showDividerInAutoComplete = hasAutoComplete\n ? isSectionVisible && filteredValues.length > 1\n : true;\n\n return (\n <BaseBox\n {...makeAccessible({\n role: getActionListSectionRole(),\n label: title,\n })}\n {...metaAttribute({ name: MetaConstants.ActionListSection, testID })}\n {...makeAnalyticsAttribute(rest as Record<string, unknown>)}\n >\n {/* We're announcing title as group label so we can hide this */}\n {isSectionVisible ? <ActionListSectionTitle title={title} /> : null}\n\n <BaseBox\n {...makeAccessible({\n // On web, we just wrap it in another listbox to announce item count properly for particular group.\n // On React Native, we ignore it since `menu` + `group` role will take care of accessibility\n role: isReactNative() ? undefined : 'listbox',\n })}\n >\n {children}\n </BaseBox>\n {showDividerInAutoComplete && showDividerInRN ? (\n <Divider marginX=\"spacing.3\" marginY=\"spacing.1\" />\n ) : null}\n </BaseBox>\n );\n};\n\nconst ActionListSection = assignWithoutSideEffects(React.memo(_ActionListSection), {\n componentId: componentIds.ActionListSection,\n});\n\nconst _ActionListItemIcon = ({ icon }: { icon: IconComponent }): React.ReactElement => {\n const Icon = icon;\n const { color, isDisabled } = useBaseMenuItem();\n const iconState = isDisabled ? 'disabled' : 'muted';\n return (\n <Icon\n color={\n color === 'negative'\n ? 'feedback.icon.negative.intense'\n : `interactive.icon.gray.${iconState}`\n }\n size=\"medium\"\n />\n );\n};\n\nconst ActionListItemIcon = assignWithoutSideEffects(_ActionListItemIcon, {\n componentId: componentIds.ActionListItemIcon,\n});\n\nconst _ActionListItemBadgeGroup = ({\n children,\n}: {\n children: React.ReactElement[] | React.ReactElement;\n}): React.ReactElement => {\n return (\n <Box display=\"flex\" alignItems=\"center\" flexDirection=\"row\">\n {children}\n </Box>\n );\n};\n\nconst ActionListItemBadgeGroup = assignWithoutSideEffects(_ActionListItemBadgeGroup, {\n componentId: componentIds.ActionListItemBadgeGroup,\n});\n\nconst _ActionListItemAvatar = (avatarProps: Omit<AvatarProps, 'size' | ''>): React.ReactElement => {\n return <Avatar size=\"xsmall\" {...avatarProps} />;\n};\n\nconst ActionListItemAvatar = assignWithoutSideEffects(_ActionListItemAvatar, {\n componentId: componentIds.ActionListItemAvatar,\n});\n\nconst _ActionListItemBadge = (props: BadgeProps): React.ReactElement => {\n return <Badge size=\"medium\" marginLeft=\"spacing.3\" {...props} />;\n};\n\nconst ActionListItemBadge = assignWithoutSideEffects(_ActionListItemBadge, {\n componentId: componentIds.ActionListItemBadge,\n});\n\nconst _ActionListItemText = ({\n children,\n}: {\n children: StringChildrenType;\n}): React.ReactElement => {\n const { isDisabled } = useBaseMenuItem();\n\n return (\n <Text variant=\"caption\" color={getNormalTextColor(isDisabled, { isMuted: true })}>\n {children}\n </Text>\n );\n};\n\nconst ActionListItemText = assignWithoutSideEffects(_ActionListItemText, {\n componentId: componentIds.ActionListItemText,\n});\n\nconst BaseMenuLeadingItem = ({\n isSelected,\n isDisabled,\n}: {\n isSelected?: boolean;\n isDisabled?: boolean;\n}): React.ReactElement => {\n return (\n <BaseBox\n pointerEvents=\"none\"\n // Adding aria-hidden because the listbox item in multiselect in itself explains the behaviour so announcing checkbox is unneccesary and just a nice UI tweak for us\n {...makeAccessible({\n hidden: true,\n })}\n >\n <Checkbox isChecked={isSelected} tabIndex={-1} isDisabled={isDisabled}>\n {/*\n Checkbox requires children. Didn't want to make it optional because its helpful for consumers\n But for this case in particular, we just want to use Text separately so that we can control spacing and color and keep it consistent with non-multiselect dropdowns\n */}\n {null}\n </Checkbox>\n </BaseBox>\n );\n};\n\ntype ClickHandlerType = (e: React.MouseEvent<HTMLButtonElement>) => void;\n\nconst makeActionListItemClickable = (\n clickHandler: ClickHandlerType,\n): { onPress?: (e: React.TouchEvent<TouchableOpacity>) => void; onClick?: ClickHandlerType } => {\n if (isReactNative()) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment, @typescript-eslint/prefer-ts-expect-error\n // @ts-ignore: ignoring ReactNative press type for the peace of mind\n return { onPress: clickHandler };\n }\n\n return {\n onClick: clickHandler,\n };\n};\n\n/**\n * ### ActionListItem\n *\n * Creates option inside `ActionList`.\n *\n * #### Usage\n *\n * ```jsx\n * <ActionList>\n * <ActionListItem\n * title=\"Home\"\n * value=\"home\"\n * leading={<ActionListItemIcon icon={HomeIcon} />}\n * trailing={<ActionListItemText>⌘ + S</ActionListItemText>}\n * />\n * </ActionList>\n * ```\n */\nconst _ActionListItem = (props: ActionListItemProps): React.ReactElement => {\n const {\n activeIndex,\n dropdownBaseId,\n onOptionClick,\n selectedIndices,\n setShouldIgnoreBlurAnimation,\n selectionType,\n dropdownTriggerer,\n isKeydownPressed,\n filteredValues,\n hasAutoCompleteInHeader,\n } = useDropdown();\n\n React.useEffect(() => {\n if (activeIndex === props._index && props._virtualizedIndex !== undefined) {\n props._onVirtualizedFocus?.(props._virtualizedIndex as number);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [activeIndex]);\n\n const hasAutoComplete =\n hasAutoCompleteInHeader || dropdownTriggerer === dropdownComponentIds.triggers.AutoComplete;\n\n const hasFilterChipSelectInput =\n dropdownTriggerer === dropdownComponentIds.triggers.FilterChipSelectInput;\n\n const renderOnWebAs = props.href ? 'a' : 'button';\n /**\n * In SelectInput, returns the isSelected according to selected indexes in the state\n *\n * In Other Triggers (Menu Usecase), returns `props.isSelected` since passing the\n * isSelected prop explicitly is the only way to select item in menu\n */\n const getIsSelected = (): boolean | undefined => {\n if (\n dropdownTriggerer === dropdownComponentIds.triggers.SelectInput ||\n hasAutoComplete ||\n hasFilterChipSelectInput\n ) {\n if (typeof props._index === 'number') {\n return selectedIndices.includes(props._index);\n }\n return undefined;\n }\n\n return props.isSelected;\n };\n\n const isSelected = getIsSelected();\n\n React.useEffect(() => {\n validateActionListItemProps({\n leading: props.leading,\n trailing: props.trailing,\n titleSuffix: props.titleSuffix,\n });\n }, [props.leading, props.trailing, props.titleSuffix]);\n\n React.useEffect(() => {\n if (__DEV__) {\n if (\n dropdownTriggerer === dropdownComponentIds.triggers.SelectInput &&\n props.intent === 'negative'\n ) {\n throwBladeError({\n message:\n 'negative intent ActionListItem cannot be used inside Dropdown with SelectInput trigger',\n moduleName: 'ActionListItem',\n });\n }\n }\n }, [props.intent, dropdownTriggerer]);\n\n const isVisible = hasAutoComplete && filteredValues ? filteredValues.includes(props.value) : true;\n\n return (\n <BaseMenuItem\n isVisible={isVisible}\n as={!isReactNative() ? renderOnWebAs : undefined}\n id={`${dropdownBaseId}-${props._index}`}\n tabIndex={-1}\n title={props.title}\n description={props.description}\n leading={\n selectionType === 'multiple' ? (\n <BaseMenuLeadingItem\n key={`${dropdownBaseId}-${props._index}-leading-${isSelected}`}\n isSelected={isSelected}\n isDisabled={props.isDisabled}\n />\n ) : (\n props.leading\n )\n }\n trailing={props.trailing}\n titleSuffix={props.titleSuffix}\n href={props.href}\n target={props.target}\n className={activeIndex === props._index ? 'active-focus' : ''}\n isSelected={isSelected}\n isDisabled={props.isDisabled}\n role={getActionListItemRole(dropdownTriggerer, props.href)}\n {...makeActionListItemClickable((e: React.MouseEvent<HTMLButtonElement>): void => {\n if (typeof props._index === 'number') {\n onOptionClick(e, props._index);\n props.onClick?.({ name: props.value, value: isSelected, event: castWebType(e) });\n }\n })}\n {...makeAnalyticsAttribute({ ...props })}\n {...metaAttribute({ name: MetaConstants.ActionListItem, testID: props.testID })}\n onMouseDown={() => {\n // We want to keep focus on Dropdown's trigger while option is being clicked\n // So We set this flag that ignores the blur animation to avoid the flicker between focus out + focus in\n setShouldIgnoreBlurAnimation(true);\n }}\n onMouseUp={() => {\n // (Contd from above comment...) We set this flag back to false since blur of SelectInput is done calling by this time\n setShouldIgnoreBlurAnimation(false);\n }}\n data-value={props.value}\n data-index={props._index}\n selectionType={selectionType}\n color={props.intent}\n isKeydownPressed={isKeydownPressed}\n />\n );\n};\n\nconst ActionListItem = assignWithoutSideEffects(React.memo(_ActionListItem), {\n componentId: componentIds.ActionListItem,\n displayName: componentIds.ActionListItem,\n});\n\nexport type { ActionListItemProps, ActionListSectionProps };\nexport {\n ActionListItem,\n ActionListItemIcon,\n ActionListItemText,\n ActionListItemAvatar,\n ActionListItemBadge,\n ActionListItemBadgeGroup,\n ActionListSection,\n ActionListSectionTitle,\n};\n"],"names":["StyledActionListSectionTitle","styled","BaseBox","withConfig","displayName","componentId","props","padding","makeSize","theme","spacing","_ActionListSectionTitle","_ref","title","_ref$isInsideVirtuali","isInsideVirtualizedList","_jsx","_objectSpread","makeAccessible","hidden","role","undefined","children","Text","color","size","weight","ActionListSectionTitle","assignWithoutSideEffects","componentIds","_ActionListSection","_ref2","testID","_hideDivider","_sectionChildValues","rest","_objectWithoutProperties","_excluded","_useDropdown","useDropdown","hasAutoCompleteInHeader","dropdownTriggerer","filteredValues","hasAutoComplete","dropdownComponentIds","triggers","AutoComplete","isSectionVisible","React","useMemo","visibleActionListItemInSection","find","actionItemValue","includes","Boolean","showDividerInRN","isReactNative","showDividerInAutoComplete","length","_jsxs","getActionListSectionRole","label","metaAttribute","name","MetaConstants","ActionListSection","makeAnalyticsAttribute","Divider","marginX","marginY","memo","_ActionListItemIcon","_ref3","icon","Icon","_useBaseMenuItem","useBaseMenuItem","isDisabled","iconState","concat","ActionListItemIcon","_ActionListItemBadgeGroup","_ref4","Box","display","alignItems","flexDirection","ActionListItemBadgeGroup","_ActionListItemAvatar","avatarProps","Avatar","ActionListItemAvatar","_ActionListItemBadge","Badge","marginLeft","ActionListItemBadge","_ActionListItemText","_ref5","_useBaseMenuItem2","variant","getNormalTextColor","isMuted","ActionListItemText","BaseMenuLeadingItem","_ref6","isSelected","pointerEvents","Checkbox","isChecked","tabIndex","makeActionListItemClickable","clickHandler","onPress","onClick","_ActionListItem","_useDropdown2","activeIndex","dropdownBaseId","onOptionClick","selectedIndices","setShouldIgnoreBlurAnimation","selectionType","isKeydownPressed","useEffect","_index","_virtualizedIndex","_props$_onVirtualized","_onVirtualizedFocus","call","hasFilterChipSelectInput","FilterChipSelectInput","renderOnWebAs","href","getIsSelected","SelectInput","validateActionListItemProps","leading","trailing","titleSuffix","intent","throwBladeError","message","moduleName","isVisible","value","BaseMenuItem","as","id","description","target","className","getActionListItemRole","e","_props$onClick","event","castWebType","ActionListItem","onMouseDown","onMouseUp"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwGA,I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AC+H,cAAAA;AAC5B,CAAC;;;;"}
|
|
1
|
+
{"version":3,"file":"ActionListItem.js","sources":["../../../../../../src/components/ActionList/ActionListItem.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/ban-ts-comment */\nimport React from 'react';\nimport styled from 'styled-components';\nimport type { TouchableOpacity } from 'react-native';\nimport { componentIds } from './componentIds';\nimport { validateActionListItemProps, getNormalTextColor } from './actionListUtils';\nimport { getActionListItemRole, getActionListSectionRole } from './getA11yRoles';\nimport { Divider } from '~components/Divider';\nimport BaseBox from '~components/Box/BaseBox';\nimport type { IconComponent } from '~components/Icons';\nimport { useDropdown } from '~components/Dropdown/useDropdown';\nimport type { FeedbackColors } from '~tokens/theme/theme';\nimport { Text } from '~components/Typography';\nimport type { Platform } from '~utils';\nimport { castWebType, isReactNative } from '~utils';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport type { DataAnalyticsAttribute, StringChildrenType, TestID } from '~utils/types';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { makeSize } from '~utils/makeSize';\nimport { makeAccessible } from '~utils/makeAccessible';\nimport { throwBladeError } from '~utils/logger';\nimport type { BadgeProps } from '~components/Badge';\nimport { Badge } from '~components/Badge';\nimport { Box } from '~components/Box';\nimport { dropdownComponentIds } from '~components/Dropdown/dropdownComponentIds';\nimport { BaseMenuItem, useBaseMenuItem } from '~components/BaseMenu';\nimport { Checkbox } from '~components/Checkbox';\nimport type { AvatarProps } from '~components/Avatar/types';\nimport { Avatar } from '~components/Avatar';\nimport { makeAnalyticsAttribute } from '~utils/makeAnalyticsAttribute';\n\ntype ActionListItemProps = {\n title: string;\n description?: string;\n onClick?: (clickProps: {\n name: string;\n value?: boolean;\n event: Platform.Select<{\n web: React.MouseEvent;\n native: React.TouchEvent<TouchableOpacity>;\n }>;\n }) => void;\n /**\n * value that you get from `onChange` event on SelectInput or in form submissions.\n */\n value: string;\n /**\n * Link to open when item is clicked.\n */\n href?: string;\n /**\n * HTML target of the link\n */\n target?: string;\n /**\n * Item that goes on left-side of item.\n *\n * Valid elements - `<ActionListItemIcon />`, `<ActionListItemAsset />`\n *\n * Will be overriden in multiselect\n */\n leading?: React.ReactNode;\n /**\n * Item that goes on right-side of item.\n *\n * Valid elements - `<ActionListItemText />`, `<ActionListItemIcon />`\n */\n trailing?: React.ReactNode;\n /**\n * Item that goes immediately next to the title.\n *\n * Valid elements - `<ActionListItemBadge />`, `<ActionListItemBadgeGroup />`\n *\n */\n titleSuffix?: React.ReactElement;\n isDisabled?: boolean;\n intent?: Extract<FeedbackColors, 'negative'>;\n /**\n * Can be used in combination of `onClick` to highlight item as selected in Button Triggers.\n *\n * When trigger is SelectInput, Use `value` prop on SelectInput instead to make dropdown controlled.\n */\n isSelected?: boolean;\n /**\n * Internally passed from ActionList. No need to pass it explicitly\n *\n * @private\n */\n _index?: number;\n /**\n * Internally used to pass index for virtualized lists\n *\n * @private\n */\n _virtualizedIndex?: number;\n /**\n * Internally used to focus on virtualized list\n *\n * @private\n */\n _onVirtualizedFocus?: (_virtuazedIndex: number) => void;\n} & TestID &\n DataAnalyticsAttribute;\n\nconst StyledActionListSectionTitle = styled(BaseBox)((props) => ({\n // @TODO: replace this styled-component with new layout box when we have padding shorthand\n padding: makeSize(props.theme.spacing[3]),\n}));\n\ntype ActionListSectionProps = {\n title: string;\n children: React.ReactNode[] | React.ReactNode;\n /**\n * Internally used to hide the divider on final item in React Native\n *\n * Should not be used by consumers (also won't work on web)\n *\n * @private\n */\n _hideDivider?: boolean;\n /**\n * Internally used to hide / show section in AutoComplete\n *\n * @private\n */\n _sectionChildValues?: string[];\n} & TestID &\n DataAnalyticsAttribute;\n\nconst _ActionListSectionTitle = ({\n title,\n isInsideVirtualizedList = false,\n}: {\n title: string;\n isInsideVirtualizedList?: boolean;\n}): React.ReactElement => {\n return (\n <StyledActionListSectionTitle\n {...makeAccessible({\n hidden: !isInsideVirtualizedList,\n role: isInsideVirtualizedList ? 'heading' : undefined,\n })}\n >\n <Text color=\"surface.text.gray.muted\" size=\"small\" weight=\"semibold\">\n {title}\n </Text>\n </StyledActionListSectionTitle>\n );\n};\n\nconst ActionListSectionTitle = assignWithoutSideEffects(_ActionListSectionTitle, {\n componentId: componentIds.ActionListSectionTitle,\n});\nconst _ActionListSection = ({\n title,\n children,\n testID,\n _hideDivider,\n _sectionChildValues,\n ...rest\n}: ActionListSectionProps): React.ReactElement => {\n const { hasAutoCompleteInHeader, dropdownTriggerer, filteredValues } = useDropdown();\n const hasAutoComplete =\n hasAutoCompleteInHeader || dropdownTriggerer === dropdownComponentIds.triggers.AutoComplete;\n\n const isSectionVisible = React.useMemo(() => {\n if (hasAutoComplete) {\n const visibleActionListItemInSection = _sectionChildValues?.find((actionItemValue) =>\n filteredValues.includes(actionItemValue),\n );\n\n return Boolean(visibleActionListItemInSection);\n }\n\n return true;\n }, [_sectionChildValues, hasAutoComplete, filteredValues]);\n\n const showDividerInRN = !(_hideDivider && isReactNative());\n const showDividerInAutoComplete = hasAutoComplete\n ? isSectionVisible && filteredValues.length > 1\n : true;\n\n return (\n <BaseBox\n {...makeAccessible({\n role: getActionListSectionRole(),\n label: title,\n })}\n {...metaAttribute({ name: MetaConstants.ActionListSection, testID })}\n {...makeAnalyticsAttribute(rest as Record<string, unknown>)}\n >\n {/* We're announcing title as group label so we can hide this */}\n {isSectionVisible ? <ActionListSectionTitle title={title} /> : null}\n\n <BaseBox\n {...makeAccessible({\n // On web, we just wrap it in another listbox to announce item count properly for particular group.\n // On React Native, we ignore it since `menu` + `group` role will take care of accessibility\n role: isReactNative() ? undefined : 'listbox',\n })}\n >\n {children}\n </BaseBox>\n {showDividerInAutoComplete && showDividerInRN ? (\n <Divider marginX=\"spacing.3\" marginY=\"spacing.1\" />\n ) : null}\n </BaseBox>\n );\n};\n\nconst ActionListSection = assignWithoutSideEffects(React.memo(_ActionListSection), {\n componentId: componentIds.ActionListSection,\n});\n\nconst _ActionListItemIcon = ({ icon }: { icon: IconComponent }): React.ReactElement => {\n const Icon = icon;\n const { color, isDisabled } = useBaseMenuItem();\n const iconState = isDisabled ? 'disabled' : 'muted';\n return (\n <Icon\n color={\n color === 'negative'\n ? 'feedback.icon.negative.intense'\n : `interactive.icon.gray.${iconState}`\n }\n size=\"medium\"\n />\n );\n};\n\nconst ActionListItemIcon = assignWithoutSideEffects(_ActionListItemIcon, {\n componentId: componentIds.ActionListItemIcon,\n});\n\nconst _ActionListItemBadgeGroup = ({\n children,\n}: {\n children: React.ReactElement[] | React.ReactElement;\n}): React.ReactElement => {\n return (\n <Box display=\"flex\" alignItems=\"center\" flexDirection=\"row\">\n {children}\n </Box>\n );\n};\n\nconst ActionListItemBadgeGroup = assignWithoutSideEffects(_ActionListItemBadgeGroup, {\n componentId: componentIds.ActionListItemBadgeGroup,\n});\n\nconst _ActionListItemAvatar = (avatarProps: Omit<AvatarProps, 'size' | ''>): React.ReactElement => {\n return <Avatar size=\"xsmall\" {...avatarProps} />;\n};\n\nconst ActionListItemAvatar = assignWithoutSideEffects(_ActionListItemAvatar, {\n componentId: componentIds.ActionListItemAvatar,\n});\n\nconst _ActionListItemBadge = (props: BadgeProps): React.ReactElement => {\n return <Badge size=\"medium\" marginLeft=\"spacing.3\" {...props} />;\n};\n\nconst ActionListItemBadge = assignWithoutSideEffects(_ActionListItemBadge, {\n componentId: componentIds.ActionListItemBadge,\n});\n\nconst _ActionListItemText = ({\n children,\n}: {\n children: StringChildrenType;\n}): React.ReactElement => {\n const { isDisabled } = useBaseMenuItem();\n\n return (\n <Text variant=\"caption\" color={getNormalTextColor(isDisabled, { isMuted: true })}>\n {children}\n </Text>\n );\n};\n\nconst ActionListItemText = assignWithoutSideEffects(_ActionListItemText, {\n componentId: componentIds.ActionListItemText,\n});\n\nconst BaseMenuLeadingItem = ({\n isSelected,\n isDisabled,\n}: {\n isSelected?: boolean;\n isDisabled?: boolean;\n}): React.ReactElement => {\n return (\n <BaseBox\n pointerEvents=\"none\"\n // Adding aria-hidden because the listbox item in multiselect in itself explains the behaviour so announcing checkbox is unneccesary and just a nice UI tweak for us\n {...makeAccessible({\n hidden: true,\n })}\n >\n <Checkbox isChecked={isSelected} tabIndex={-1} isDisabled={isDisabled}>\n {/*\n Checkbox requires children. Didn't want to make it optional because its helpful for consumers\n But for this case in particular, we just want to use Text separately so that we can control spacing and color and keep it consistent with non-multiselect dropdowns\n */}\n {null}\n </Checkbox>\n </BaseBox>\n );\n};\n\ntype ClickHandlerType = (e: React.MouseEvent<HTMLButtonElement>) => void;\n\nconst makeActionListItemClickable = (\n clickHandler: ClickHandlerType,\n): { onPress?: (e: React.TouchEvent<TouchableOpacity>) => void; onClick?: ClickHandlerType } => {\n if (isReactNative()) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment, @typescript-eslint/prefer-ts-expect-error\n // @ts-ignore: ignoring ReactNative press type for the peace of mind\n return { onPress: clickHandler };\n }\n\n return {\n onClick: clickHandler,\n };\n};\n\n/**\n * ### ActionListItem\n *\n * Creates option inside `ActionList`.\n *\n * #### Usage\n *\n * ```jsx\n * <ActionList>\n * <ActionListItem\n * title=\"Home\"\n * value=\"home\"\n * leading={<ActionListItemIcon icon={HomeIcon} />}\n * trailing={<ActionListItemText>⌘ + S</ActionListItemText>}\n * />\n * </ActionList>\n * ```\n */\nconst _ActionListItem = (props: ActionListItemProps): React.ReactElement => {\n const {\n activeIndex,\n dropdownBaseId,\n onOptionClick,\n selectedIndices,\n setShouldIgnoreBlurAnimation,\n selectionType,\n dropdownTriggerer,\n isKeydownPressed,\n filteredValues,\n hasAutoCompleteInHeader,\n } = useDropdown();\n\n React.useEffect(() => {\n if (activeIndex === props._index && props._virtualizedIndex !== undefined) {\n props._onVirtualizedFocus?.(props._virtualizedIndex as number);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [activeIndex]);\n\n const hasAutoComplete =\n hasAutoCompleteInHeader || dropdownTriggerer === dropdownComponentIds.triggers.AutoComplete;\n\n const hasFilterChipSelectInput =\n dropdownTriggerer === dropdownComponentIds.triggers.FilterChipSelectInput;\n\n const hasInputDropdownButton =\n dropdownTriggerer === dropdownComponentIds.triggers.InputDropdownButton;\n\n const renderOnWebAs = props.href ? 'a' : 'button';\n /**\n * In SelectInput, returns the isSelected according to selected indexes in the state\n *\n * In Other Triggers (Menu Usecase), returns `props.isSelected` since passing the\n * isSelected prop explicitly is the only way to select item in menu\n */\n const getIsSelected = (): boolean | undefined => {\n if (\n dropdownTriggerer === dropdownComponentIds.triggers.SelectInput ||\n hasAutoComplete ||\n hasFilterChipSelectInput ||\n hasInputDropdownButton\n ) {\n if (typeof props._index === 'number') {\n return selectedIndices.includes(props._index);\n }\n return undefined;\n }\n\n return props.isSelected;\n };\n\n const isSelected = getIsSelected();\n\n React.useEffect(() => {\n validateActionListItemProps({\n leading: props.leading,\n trailing: props.trailing,\n titleSuffix: props.titleSuffix,\n });\n }, [props.leading, props.trailing, props.titleSuffix]);\n\n React.useEffect(() => {\n if (__DEV__) {\n if (\n dropdownTriggerer === dropdownComponentIds.triggers.SelectInput &&\n props.intent === 'negative'\n ) {\n throwBladeError({\n message:\n 'negative intent ActionListItem cannot be used inside Dropdown with SelectInput trigger',\n moduleName: 'ActionListItem',\n });\n }\n }\n }, [props.intent, dropdownTriggerer]);\n\n const isVisible = hasAutoComplete && filteredValues ? filteredValues.includes(props.value) : true;\n\n return (\n <BaseMenuItem\n isVisible={isVisible}\n as={!isReactNative() ? renderOnWebAs : undefined}\n id={`${dropdownBaseId}-${props._index}`}\n tabIndex={-1}\n title={props.title}\n description={props.description}\n leading={\n selectionType === 'multiple' ? (\n <BaseMenuLeadingItem\n key={`${dropdownBaseId}-${props._index}-leading-${isSelected}`}\n isSelected={isSelected}\n isDisabled={props.isDisabled}\n />\n ) : (\n props.leading\n )\n }\n trailing={props.trailing}\n titleSuffix={props.titleSuffix}\n href={props.href}\n target={props.target}\n className={activeIndex === props._index ? 'active-focus' : ''}\n isSelected={isSelected}\n isDisabled={props.isDisabled}\n role={getActionListItemRole(dropdownTriggerer, props.href)}\n {...makeActionListItemClickable((e: React.MouseEvent<HTMLButtonElement>): void => {\n if (typeof props._index === 'number') {\n onOptionClick(e, props._index);\n props.onClick?.({ name: props.value, value: isSelected, event: castWebType(e) });\n }\n })}\n {...makeAnalyticsAttribute({ ...props })}\n {...metaAttribute({ name: MetaConstants.ActionListItem, testID: props.testID })}\n onMouseDown={() => {\n // We want to keep focus on Dropdown's trigger while option is being clicked\n // So We set this flag that ignores the blur animation to avoid the flicker between focus out + focus in\n setShouldIgnoreBlurAnimation(true);\n }}\n onMouseUp={() => {\n // (Contd from above comment...) We set this flag back to false since blur of SelectInput is done calling by this time\n setShouldIgnoreBlurAnimation(false);\n }}\n data-value={props.value}\n data-index={props._index}\n selectionType={selectionType}\n color={props.intent}\n isKeydownPressed={isKeydownPressed}\n />\n );\n};\n\nconst ActionListItem = assignWithoutSideEffects(React.memo(_ActionListItem), {\n componentId: componentIds.ActionListItem,\n displayName: componentIds.ActionListItem,\n});\n\nexport type { ActionListItemProps, ActionListSectionProps };\nexport {\n ActionListItem,\n ActionListItemIcon,\n ActionListItemText,\n ActionListItemAvatar,\n ActionListItemBadge,\n ActionListItemBadgeGroup,\n ActionListSection,\n ActionListSectionTitle,\n};\n"],"names":["StyledActionListSectionTitle","styled","BaseBox","withConfig","displayName","componentId","props","padding","makeSize","theme","spacing","_ActionListSectionTitle","_ref","title","_ref$isInsideVirtuali","isInsideVirtualizedList","_jsx","_objectSpread","makeAccessible","hidden","role","undefined","children","Text","color","size","weight","ActionListSectionTitle","assignWithoutSideEffects","componentIds","_ActionListSection","_ref2","testID","_hideDivider","_sectionChildValues","rest","_objectWithoutProperties","_excluded","_useDropdown","useDropdown","hasAutoCompleteInHeader","dropdownTriggerer","filteredValues","hasAutoComplete","dropdownComponentIds","triggers","AutoComplete","isSectionVisible","React","useMemo","visibleActionListItemInSection","find","actionItemValue","includes","Boolean","showDividerInRN","isReactNative","showDividerInAutoComplete","length","_jsxs","getActionListSectionRole","label","metaAttribute","name","MetaConstants","ActionListSection","makeAnalyticsAttribute","Divider","marginX","marginY","memo","_ActionListItemIcon","_ref3","icon","Icon","_useBaseMenuItem","useBaseMenuItem","isDisabled","iconState","concat","ActionListItemIcon","_ActionListItemBadgeGroup","_ref4","Box","display","alignItems","flexDirection","ActionListItemBadgeGroup","_ActionListItemAvatar","avatarProps","Avatar","ActionListItemAvatar","_ActionListItemBadge","Badge","marginLeft","ActionListItemBadge","_ActionListItemText","_ref5","_useBaseMenuItem2","variant","getNormalTextColor","isMuted","ActionListItemText","BaseMenuLeadingItem","_ref6","isSelected","pointerEvents","Checkbox","isChecked","tabIndex","makeActionListItemClickable","clickHandler","onPress","onClick","_ActionListItem","_useDropdown2","activeIndex","dropdownBaseId","onOptionClick","selectedIndices","setShouldIgnoreBlurAnimation","selectionType","isKeydownPressed","useEffect","_index","_virtualizedIndex","_props$_onVirtualized","_onVirtualizedFocus","call","hasFilterChipSelectInput","FilterChipSelectInput","hasInputDropdownButton","InputDropdownButton","renderOnWebAs","href","getIsSelected","SelectInput","validateActionListItemProps","leading","trailing","titleSuffix","intent","throwBladeError","message","moduleName","isVisible","value","BaseMenuItem","as","id","description","target","className","getActionListItemRole","e","_props$onClick","event","castWebType","ActionListItem","onMouseDown","onMouseUp"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwGA,IAAMA,4BAA4B,gBAAGC,MAAM,CAACC,OAAO,CAAC,CAAAC,UAAA,CAAA;EAAAC,WAAA,EAAA,8CAAA;EAAAC,WAAA,EAAA,UAAA;AAAA,CAAA,CAAA,CAAC,UAACC,KAAK,EAAA;EAAA,OAAM;AAC/D;IACAC,OAAO,EAAEC,QAAQ,CAACF,KAAK,CAACG,KAAK,CAACC,OAAO,CAAC,CAAC,CAAC,CAAA;GACzC,CAAA;AAAA,CAAC,CAAC,CAAA;AAsBH,IAAMC,uBAAuB,GAAG,SAA1BA,uBAAuBA,CAAAC,IAAA,EAMH;AAAA,EAA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KAAK;AAAEA,QAAAA,KAAK,EAAEzC,UAAU;QAAEmD,KAAK,EAAEC,WAAW,CAACH,CAAC,CAAA;AAAE,OAAC,CAAC,CAAA;AAClF,KAAA;GACD,CAAC,CACExF,EAAAA,sBAAsB,CAAAjD,aAAA,CAAMX,EAAAA,EAAAA,KAAK,CAAE,CAAC,CACpCwD,EAAAA,aAAa,CAAC;IAAEC,IAAI,EAAEC,aAAa,CAAC8F,cAAc;IAAE9H,MAAM,EAAE1B,KAAK,CAAC0B,MAAAA;AAAO,GAAC,CAAC,CAAA,EAAA,EAAA,EAAA;IAC/E+H,WAAW,EAAE,SAAAA,WAAAA,GAAM;AACjB;AACA;MACAvC,4BAA4B,CAAC,IAAI,CAAC,CAAA;KAClC;IACFwC,SAAS,EAAE,SAAAA,SAAAA,GAAM;AACf;MACAxC,4BAA4B,CAAC,KAAK,CAAC,CAAA;KACnC;IACF,YAAYlH,EAAAA,KAAK,CAAC4I,KAAM;IACxB,YAAY5I,EAAAA,KAAK,CAACsH,MAAO;AACzBH,IAAAA,aAAa,EAAEA,aAAc;IAC7BjG,KAAK,EAAElB,KAAK,CAACuI,MAAO;AACpBnB,IAAAA,gBAAgB,EAAEA,gBAAAA;AAAiB,GAAA,CACpC,CAAC,CAAA;AAEN,CAAC,CAAA;AAEKoC,IAAAA,cAAc,gBAAGlI,wBAAwB,eAACoB,cAAK,CAACsB,IAAI,CAAC4C,eAAe,CAAC,EAAE;EAC3E7G,WAAW,EAAEwB,YAAY,CAACiI,cAAc;EACxC1J,WAAW,EAAEyB,YAAY,CAACiI,cAAAA;AAC5B,CAAC;;;;"}
|
|
@@ -33,7 +33,7 @@ import CloseIcon from '../Icons/CloseIcon/CloseIcon.js';
|
|
|
33
33
|
import { Divider } from '../Divider/Divider.js';
|
|
34
34
|
import { assignWithoutSideEffects } from '../../utils/assignWithoutSideEffects/assignWithoutSideEffects.js';
|
|
35
35
|
|
|
36
|
-
var _excluded = ["title", "subtitle", "leading", "titleSuffix", "trailing", "showDivider", "showBackButton", "showCloseButton", "onBackButtonClick", "onCloseButtonClick", "closeButtonRef", "backButtonRef", "testID", "onClickCapture", "onKeyDown", "onKeyUp", "onLostPointerCapture", "onPointerCancel", "onPointerDown", "onPointerMove", "onPointerUp", "metaComponentName", "paddingX", "marginY", "marginBottom", "marginTop", "size", "isDisabled", "children", "trailingInteractionElement", "backgroundImage"];
|
|
36
|
+
var _excluded = ["title", "subtitle", "leading", "titleSuffix", "trailing", "showDivider", "showBackButton", "showCloseButton", "onBackButtonClick", "onCloseButtonClick", "closeButtonRef", "backButtonRef", "testID", "onClickCapture", "onKeyDown", "onKeyUp", "onLostPointerCapture", "onPointerCancel", "onPointerDown", "onPointerMove", "onPointerUp", "metaComponentName", "paddingX", "marginY", "marginBottom", "marginTop", "size", "isDisabled", "children", "trailingInteractionElement", "backgroundImage", "alignItems", "dividerProps"];
|
|
37
37
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
38
38
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
39
39
|
var commonCenterBoxProps = {
|
|
@@ -223,6 +223,9 @@ var _BaseHeader = function _BaseHeader(_ref2) {
|
|
|
223
223
|
children = _ref2.children,
|
|
224
224
|
trailingInteractionElement = _ref2.trailingInteractionElement,
|
|
225
225
|
backgroundImage = _ref2.backgroundImage,
|
|
226
|
+
_ref2$alignItems = _ref2.alignItems,
|
|
227
|
+
alignItems = _ref2$alignItems === void 0 ? 'flex-start' : _ref2$alignItems,
|
|
228
|
+
dividerProps = _ref2.dividerProps,
|
|
226
229
|
rest = _objectWithoutProperties(_ref2, _excluded);
|
|
227
230
|
var validatedTrailingComponent = useTrailingRestriction({
|
|
228
231
|
trailing: trailing,
|
|
@@ -283,7 +286,7 @@ var _BaseHeader = function _BaseHeader(_ref2) {
|
|
|
283
286
|
flex: "auto",
|
|
284
287
|
display: "flex",
|
|
285
288
|
flexDirection: "row",
|
|
286
|
-
alignItems:
|
|
289
|
+
alignItems: alignItems,
|
|
287
290
|
children: [leading ? /*#__PURE__*/jsx(BaseBox, _objectSpread(_objectSpread({
|
|
288
291
|
marginRight: "spacing.3"
|
|
289
292
|
}, centerBoxProps[size$1]), {}, {
|
|
@@ -361,7 +364,7 @@ var _BaseHeader = function _BaseHeader(_ref2) {
|
|
|
361
364
|
children: trailingInteractionElement
|
|
362
365
|
})) : null]
|
|
363
366
|
})]
|
|
364
|
-
})), showDivider ? /*#__PURE__*/jsx(Divider, {}) : null]
|
|
367
|
+
})), showDivider ? /*#__PURE__*/jsx(Divider, _objectSpread({}, dividerProps)) : null]
|
|
365
368
|
}));
|
|
366
369
|
};
|
|
367
370
|
var BaseHeader = /*#__PURE__*/assignWithoutSideEffects(_BaseHeader, {
|