@procore/core-react 12.41.0 → 12.43.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +69 -0
- package/dist/AnchorNavigation/AnchorNavigation.js +11 -5
- package/dist/AnchorNavigation/AnchorNavigation.js.map +1 -1
- package/dist/AnchorNavigation/AnchorNavigation.styles.d.ts +1 -0
- package/dist/AnchorNavigation/AnchorNavigation.styles.js +7 -3
- package/dist/AnchorNavigation/AnchorNavigation.styles.js.map +1 -1
- package/dist/AnchorNavigation/AnchorNavigation.types.d.ts +7 -1
- package/dist/AnchorNavigation/AnchorNavigation.types.js.map +1 -1
- package/dist/Avatar/Avatar.styles.js +5 -5
- package/dist/AvatarStack/AvatarStack.styles.d.ts +74 -74
- package/dist/AvatarStack/AvatarStack.styles.js +7 -7
- package/dist/Badge/Badge.styles.js +2 -2
- package/dist/BadgePill/BadgePill.styles.js +4 -4
- package/dist/Banner/Banner.styles.js +10 -10
- package/dist/Box/Box.styles.js +1 -1
- package/dist/Breadcrumbs/Breadcrumbs.styles.js +4 -4
- package/dist/Button/Button.styles.js +5 -5
- package/dist/Button/Button.types.d.ts +1 -4
- package/dist/Button/Button.types.js.map +1 -1
- package/dist/Button/index.d.ts +1 -1
- package/dist/Button/index.js.map +1 -1
- package/dist/Calendar/Calendar.styles.js +9 -9
- package/dist/Card/Card.styles.js +1 -1
- package/dist/Checkbox/Checkbox.js +1 -0
- package/dist/Checkbox/Checkbox.js.map +1 -1
- package/dist/Checkbox/Checkbox.styles.js +6 -6
- package/dist/ContactItem/ContactItem.js +7 -3
- package/dist/ContactItem/ContactItem.js.map +1 -1
- package/dist/ContactItem/ContactItem.styles.js +5 -5
- package/dist/Content/Content.styles.js +2 -2
- package/dist/DateInput/DateInput.js +9 -0
- package/dist/DateInput/DateInput.js.map +1 -1
- package/dist/DateInput/DateInput.styles.js +6 -6
- package/dist/DetailPage/DetailPage.styles.js +7 -7
- package/dist/Dropdown/Dropdown.styles.js +3 -3
- package/dist/DropdownFlyout/DropdownFlyout.styles.js +4 -4
- package/dist/Dropzone/Dropzone.js +1 -1
- package/dist/Dropzone/Dropzone.styles.js +9 -9
- package/dist/EmptyState/EmptyState.styles.js +6 -6
- package/dist/Field/Field.styles.js +3 -3
- package/dist/FileList/FileList.styles.js +3 -3
- package/dist/FileSelect/FileExplorer/FileExplorer.styles.js +9 -9
- package/dist/FileSelect/FileExplorer/FileExplorerSidebar.styles.js +3 -3
- package/dist/FileSelect/FileSelect.styles.js +2 -2
- package/dist/FileSelect/FileSelectDropzone/FileSelectDropzone.styles.js +3 -3
- package/dist/FileSelect/FileTokenList/FileTokenList.styles.js +2 -2
- package/dist/FileSelect/GridSource/GridSource.styles.js +6 -6
- package/dist/FileSelect/LocalSource/LocalSource.styles.js +4 -4
- package/dist/FileSelect/SourceItem/SourceItem.styles.js +3 -3
- package/dist/FileSelect/ThumbnailList/ThumbnailList.styles.d.ts +1 -1
- package/dist/FileSelect/ThumbnailList/ThumbnailList.styles.js +6 -6
- package/dist/FileSelect/TreeSource/TreeSource.styles.js +1 -1
- package/dist/FileToken/FileToken.styles.js +6 -6
- package/dist/FileToken/FileTokenInner.js +1 -3
- package/dist/FileToken/FileTokenInner.js.map +1 -1
- package/dist/FilterToken/FilterToken.styles.js +5 -5
- package/dist/FlexList/FlexList.styles.js +1 -1
- package/dist/Form/Form.styles.js +13 -13
- package/dist/Form/StyledFormikForm.styles.d.ts +2 -2
- package/dist/Form/StyledFormikForm.styles.js +2 -2
- package/dist/GhostPlaceholder/GhostPlaceholder.styles.js +2 -2
- package/dist/Grid/Grid.styles.js +2 -2
- package/dist/GroupSelect/GroupSelect.styles.js +1 -1
- package/dist/Input/Input.styles.js +1 -1
- package/dist/Link/Link.styles.js +1 -1
- package/dist/ListPage/ListPage.styles.js +8 -8
- package/dist/Loader/Loader.styles.js +2 -2
- package/dist/MenuImperative/MenuImperative.d.ts +1 -1
- package/dist/MenuImperative/MenuImperative.js +126 -34
- package/dist/MenuImperative/MenuImperative.js.map +1 -1
- package/dist/MenuImperative/MenuImperative.styles.js +15 -15
- package/dist/MenuImperative/MenuImperative.styles.js.map +1 -1
- package/dist/MenuImperative/MenuImperative.types.d.ts +36 -0
- package/dist/MenuImperative/MenuImperative.types.js.map +1 -1
- package/dist/MenuImperative/sensors.d.ts +6 -3
- package/dist/MenuImperative/sensors.js +42 -34
- package/dist/MenuImperative/sensors.js.map +1 -1
- package/dist/Modal/Modal.d.ts +4 -0
- package/dist/Modal/Modal.js +30 -14
- package/dist/Modal/Modal.js.map +1 -1
- package/dist/Modal/Modal.styles.js +13 -13
- package/dist/Modal/Modal.types.d.ts +28 -5
- package/dist/Modal/Modal.types.js.map +1 -1
- package/dist/Modal/index.d.ts +1 -1
- package/dist/Modal/index.js.map +1 -1
- package/dist/MultiSelect/MultiSelect.js +7 -5
- package/dist/MultiSelect/MultiSelect.js.map +1 -1
- package/dist/MultiSelect/MultiSelect.styles.js +8 -8
- package/dist/NextMenu/NextMenu.styles.js +3 -3
- package/dist/Notation/Notation.js +1 -1
- package/dist/NumberInput/NumberInput.styles.js +7 -7
- package/dist/Overlay/OverlayArrow.styles.js +1 -1
- package/dist/OverlayTrigger/a11yPresets.d.ts +23 -30
- package/dist/OverlayTrigger/a11yPresets.js +29 -27
- package/dist/OverlayTrigger/a11yPresets.js.map +1 -1
- package/dist/PageLayout/PageLayout.styles.d.ts +1 -1
- package/dist/PageLayout/PageLayout.styles.js +16 -16
- package/dist/PageTemplate/PageFooterTemplate/PageFooterTemplate.styles.js +1 -1
- package/dist/PageTemplate/PageHeaderTemplate/PageHeaderTemplate.styles.js +3 -3
- package/dist/PageTemplate/PagePaneTemplate/PagePaneTemplate.styles.js +2 -2
- package/dist/PageTemplate/PageTemplate/PageTemplate.styles.js +3 -3
- package/dist/Pagination/Pagination.styles.js +5 -5
- package/dist/Panel/Panel.styles.js +11 -11
- package/dist/Pill/Pill.styles.js +3 -3
- package/dist/PillSelect/PillSelect.styles.js +4 -4
- package/dist/Popover/Popover.styles.js +2 -2
- package/dist/Portal/Portal.styles.js +1 -1
- package/dist/ProgressBar/ProgressBar.styles.js +4 -4
- package/dist/ProgressBar/ProgressBar.styles.js.map +1 -1
- package/dist/RadioButton/RadioButton.styles.js +3 -3
- package/dist/Required/Required.styles.js +3 -3
- package/dist/Search/Search.styles.js +5 -5
- package/dist/Section/Section.styles.js +7 -7
- package/dist/SegmentedController/SegmentedController.styles.js +4 -4
- package/dist/Select/Select.js +3 -2
- package/dist/Select/Select.js.map +1 -1
- package/dist/Select/Select.styles.js +8 -8
- package/dist/Semantic/Semantic.styles.d.ts +74 -74
- package/dist/Semantic/Semantic.styles.js +9 -9
- package/dist/Slider/Slider.styles.js +5 -5
- package/dist/Spinner/Spinner.styles.js +7 -7
- package/dist/SplitViewCard/SplitViewCard.styles.js +8 -8
- package/dist/SuperSelect/SuperSelect.components.js +35 -22
- package/dist/SuperSelect/SuperSelect.components.js.map +1 -1
- package/dist/SuperSelect/SuperSelect.presets.styles.js +1 -1
- package/dist/SuperSelect/SuperSelect.styles.d.ts +4 -2
- package/dist/SuperSelect/SuperSelect.styles.js +49 -42
- package/dist/SuperSelect/SuperSelect.styles.js.map +1 -1
- package/dist/SuperSelect/SuperSelect.types.d.ts +3 -4
- package/dist/SuperSelect/SuperSelect.types.js.map +1 -1
- package/dist/SuperSelect/presets/filterPreset.js +7 -2
- package/dist/SuperSelect/presets/filterPreset.js.map +1 -1
- package/dist/SuperSelect/useSuperSelect.d.ts +1 -1
- package/dist/SuperSelect/useSuperSelect.js +117 -90
- package/dist/SuperSelect/useSuperSelect.js.map +1 -1
- package/dist/Switch/Switch.styles.js +4 -4
- package/dist/Table/Table.styles.js +28 -28
- package/dist/TableShelf/TableShelf.styles.js +5 -5
- package/dist/Tabs/Tabs.js +1 -1
- package/dist/Tabs/Tabs.js.map +1 -1
- package/dist/Tabs/Tabs.styles.js +15 -15
- package/dist/Tearsheet/Tearsheet.js +1 -1
- package/dist/Tearsheet/Tearsheet.js.map +1 -1
- package/dist/Tearsheet/Tearsheet.styles.js +5 -5
- package/dist/Tearsheet/storybook/PageLayoutDemo.js +1 -0
- package/dist/Tearsheet/storybook/PageLayoutDemo.js.map +1 -1
- package/dist/TextArea/TextArea.styles.js +1 -1
- package/dist/TextEditorOutput/TextEditorOutput.styles.js +1 -1
- package/dist/Thumbnail/Thumbnail.hooks.d.ts +58 -58
- package/dist/Thumbnail/Thumbnail.styles.js +17 -17
- package/dist/ThumbnailGrid/ThumbnailGrid.styles.d.ts +1 -1
- package/dist/ThumbnailGrid/ThumbnailGrid.styles.js +7 -7
- package/dist/TieredSelect/TieredSelect.styles.d.ts +1 -1
- package/dist/TieredSelect/TieredSelect.styles.js +9 -9
- package/dist/Tile/Tile.styles.js +8 -8
- package/dist/Title/Title.styles.js +7 -7
- package/dist/Toast/Toast.styles.js +3 -3
- package/dist/ToggleButton/ToggleButton.styles.js +1 -1
- package/dist/Token/Token.js +1 -1
- package/dist/Token/Token.js.map +1 -1
- package/dist/Token/Token.styles.js +3 -3
- package/dist/ToolHeader/ToolHeader.styles.js +6 -6
- package/dist/ToolLandingPage/ToolLandingPage.styles.js +3 -3
- package/dist/ToolLandingPageTemplate/ToolLandingPageTemplate.d.ts +1 -1
- package/dist/Tooltip/Tooltip.styles.js +3 -3
- package/dist/Tree/Tree.js +1 -1
- package/dist/Tree/Tree.styles.js +10 -10
- package/dist/Typeahead/Typeahead.js +7 -3
- package/dist/Typeahead/Typeahead.js.map +1 -1
- package/dist/Typeahead/Typeahead.styles.js +3 -3
- package/dist/Typography/Typography.styles.js +1 -1
- package/dist/Typography/Typography.table.story.js +2 -2
- package/dist/Typography/Typography.types.d.ts +1 -0
- package/dist/Typography/Typography.types.js.map +1 -1
- package/dist/_hooks/I18n.d.ts +28 -0
- package/dist/_locales/en.json +15 -1
- package/dist/_locales/pseudo.json +15 -1
- package/dist/_storyHelpers_/components/Deprecation.styles.js +1 -1
- package/dist/_storyHelpers_/components/StoryGrid.js +3 -3
- package/dist/_styles/colors.js +1 -3
- package/dist/_styles/colors.js.map +1 -1
- package/dist/_typedoc/AnchorNavigation/AnchorNavigation.types.json +13 -3
- package/dist/_typedoc/Avatar/Avatar.types.json +20 -20
- package/dist/_typedoc/AvatarStack/AvatarStack.types.json +25 -25
- package/dist/_typedoc/Badge/Badge.types.json +6 -6
- package/dist/_typedoc/Banner/Banner.types.json +15 -15
- package/dist/_typedoc/Box/Box.types.json +72 -72
- package/dist/_typedoc/Breadcrumbs/Breadcrumbs.types.json +10 -10
- package/dist/_typedoc/Button/Button.types.json +17 -17
- package/dist/_typedoc/Calendar/Calendar.types.json +80 -80
- package/dist/_typedoc/Card/Card.types.json +6 -6
- package/dist/_typedoc/Checkbox/Checkbox.types.json +8 -8
- package/dist/_typedoc/ContactItem/ContactItem.types.json +9 -9
- package/dist/_typedoc/DateInput/DateInput.types.json +35 -35
- package/dist/_typedoc/DateSelect/DateSelect.types.json +13 -13
- package/dist/_typedoc/DetailPage/DetailPage.types.json +5 -5
- package/dist/_typedoc/Dropdown/Dropdown.types.json +39 -39
- package/dist/_typedoc/DropdownFlyout/DropdownFlyout.types.json +31 -31
- package/dist/_typedoc/Dropzone/Dropzone.types.json +44 -44
- package/dist/_typedoc/EmptyState/EmptyState.types.json +16 -16
- package/dist/_typedoc/FileList/FileList.types.json +9 -9
- package/dist/_typedoc/FileSelect/FileSelect.types.json +27 -27
- package/dist/_typedoc/FileSelect/GridSource/GridSource.types.json +20 -20
- package/dist/_typedoc/FileSelect/LocalSource/LocalSource.types.json +14 -14
- package/dist/_typedoc/FileSelect/TreeSource/TreeSource.types.json +9 -9
- package/dist/_typedoc/Flex/Flex.types.json +27 -27
- package/dist/_typedoc/FlexList/FlexList.types.json +30 -30
- package/dist/_typedoc/Form/Form.types.json +832 -832
- package/dist/_typedoc/GhostPlaceholder/GhostPlaceholder.types.json +12 -12
- package/dist/_typedoc/Grid/Grid.types.json +8 -8
- package/dist/_typedoc/GroupSelect/GroupSelect.types.json +54 -54
- package/dist/_typedoc/Input/Input.types.json +2 -2
- package/dist/_typedoc/Link/Link.types.json +1 -1
- package/dist/_typedoc/ListPage/ListPage.types.json +13 -13
- package/dist/_typedoc/Menu/Menu.types.json +62 -62
- package/dist/_typedoc/MenuImperative/MenuImperative.types.json +147 -77
- package/dist/_typedoc/Modal/Modal.types.json +96 -68
- package/dist/_typedoc/MultiSelect/MultiSelect.types.json +33 -33
- package/dist/_typedoc/NextTile/NextTile.types.json +32 -32
- package/dist/_typedoc/Notation/Notation.types.json +4 -4
- package/dist/_typedoc/NumberInput/NumberInput.types.json +54 -54
- package/dist/_typedoc/OverlayTrigger/OverlayTrigger.types.json +33 -33
- package/dist/_typedoc/PageLayout/PageLayout.types.json +28 -28
- package/dist/_typedoc/Pagination/Pagination.types.json +7 -7
- package/dist/_typedoc/Panel/Panel.types.json +27 -27
- package/dist/_typedoc/Pill/Pill.types.json +2 -2
- package/dist/_typedoc/PillSelect/PillSelect.types.json +49 -49
- package/dist/_typedoc/Popover/Popover.types.json +15 -15
- package/dist/_typedoc/ProgressBar/ProgressBar.types.json +7 -7
- package/dist/_typedoc/RadioButton/RadioButton.types.json +6 -6
- package/dist/_typedoc/Required/Required.types.json +5 -5
- package/dist/_typedoc/Search/Search.types.json +18 -18
- package/dist/_typedoc/Section/Section.types.json +15 -15
- package/dist/_typedoc/SegmentedController/SegmentedController.types.json +21 -21
- package/dist/_typedoc/Select/Select.types.json +69 -69
- package/dist/_typedoc/SettingsPage/SettingsPage.types.json +10 -10
- package/dist/_typedoc/Slider/Slider.types.json +6 -6
- package/dist/_typedoc/Spinner/Spinner.types.json +9 -9
- package/dist/_typedoc/SplitViewCard/SplitViewCard.types.json +14 -14
- package/dist/_typedoc/Table/Table.types.json +102 -102
- package/dist/_typedoc/Tabs/Tabs.types.json +21 -21
- package/dist/_typedoc/Tearsheet/Tearsheet.types.json +17 -17
- package/dist/_typedoc/TextArea/TextArea.types.json +3 -3
- package/dist/_typedoc/TextEditor/TextEditor.types.json +11 -11
- package/dist/_typedoc/TextEditorOutput/TextEditorOutput.types.json +4 -4
- package/dist/_typedoc/Thumbnail/Thumbnail.types.json +19 -19
- package/dist/_typedoc/TieredDropdown/TieredDropdown.types.json +43 -43
- package/dist/_typedoc/TieredSelect/TieredSelect.types.json +29 -29
- package/dist/_typedoc/Tile/Tile.types.json +8 -8
- package/dist/_typedoc/Title/Title.types.json +3 -3
- package/dist/_typedoc/Toast/Toast.types.json +4 -4
- package/dist/_typedoc/ToggleButton/ToggleButton.types.json +4 -4
- package/dist/_typedoc/Token/Token.types.json +7 -7
- package/dist/_typedoc/ToolHeader/ToolHeader.types.json +10 -10
- package/dist/_typedoc/ToolLandingPage/ToolLandingPage.types.json +10 -10
- package/dist/_typedoc/Tooltip/Tooltip.types.json +15 -15
- package/dist/_typedoc/Tree/Tree.types.json +90 -90
- package/dist/_typedoc/Typeahead/Typeahead.types.json +2 -2
- package/dist/_typedoc/Typography/Typography.types.json +12 -11
- package/dist/_typedoc/_utils/types.json +3 -3
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SuperSelect.styles.js","names":["Virtuoso","styled","css","Box","Button","StyledButton","Card","StyledCheckboxLabel","Pill","StyledCircle","getTypographyIntent","typographyWeights","borderRadius","colors","getEllipsis","getFocus","spacing","dataQa","focused","hovered","optionMinHeight","checkedIconPlaceholderWidth","styledSelectButtonDefaultWidth","extendedSelectMenuWidth","PillSelectOptionWrapper","div","withConfig","displayName","componentId","xs","lg","PillSelectLabel","PillSelectLabelWrapper","_ref","disabled","StyledCheckboxContainer","StyledCheckmarkContainer","blue50","sm","StyledWrapper","StyledMenu","StyledOptions","_ref2","_ref2$$scrollable","$scrollable","StyledItemContent","StyledOptionGroupLabel","md","StyledItemLabel","_ref3","$draggable","StyledDraggableWrapper","StyledGrip","StyledFooter","gray85","StyledHeader","StyledEmptyMessage","gray45","StyledSearchContainer","StyledGroup","gray15","_ref4","$clickable","semibold","StyledItem","_ref5","$emptyMinHeight","_ref6","$isDraggingOver","$highlighted","_ref7","$disabled","$isDraggingDisabled","gray96","_ref8","concat","_ref9","$selected","_ref0","$isDraggable","_ref1","$isDragging","StyledSelectAll","StyledDroppable","StyledSelectMenu","StyledLabel","_ref10","$hoverable","StyledIndicators","StyledClearIcon","StyledSpinner","StyledArrowContainer","StyledArrow","span","StyledArrowOutline","polygon","StyledArrowFill","StyledTrigger","white","gray50","_ref11","$block","gray20","_ref12","_ref12$$placeholder","$placeholder","_ref13","gray94","gray70","_ref14","$error","red50","_ref15","$hasClearIcon","_ref16","$multiple","_ref17","$open","_ref18","_ref18$$placeholder","StyledOverlay","StyledVirtuoso","StyledEllipses","StyledMultiValueContainer","StyledMultiValue","StyledMultiInputContainer","StyledMultiInput","input","_ref19","$isNavigatingTokens"],"sources":["../../src/SuperSelect/SuperSelect.styles.ts"],"sourcesContent":["import { Virtuoso } from 'react-virtuoso'\nimport styled, { css } from 'styled-components'\nimport { Box } from '../Box/Box'\nimport { Button } from '../Button'\nimport { StyledButton } from '../Button/Button.styles'\nimport { Card } from '../Card/Card'\nimport { StyledCheckboxLabel } from '../Checkbox/Checkbox.styles'\nimport { Pill } from '../Pill/Pill'\nimport { StyledCircle } from '../Spinner/Spinner.styles'\nimport {\n getTypographyIntent,\n typographyWeights,\n} from '../Typography/Typography.styles'\nimport { borderRadius } from '../_styles/borderRadius'\nimport { colors } from '../_styles/colors'\nimport { getEllipsis, getFocus } from '../_styles/mixins'\nimport { spacing } from '../_styles/spacing'\n\nexport type SuperSelectStyledTriggerProps = {\n $block?: boolean\n $disabled?: boolean\n $error?: boolean\n $hasClearIcon?: boolean\n $loading?: boolean\n $multiple?: boolean\n $open?: boolean\n $placeholder?: boolean\n}\n\nexport const dataQa = {\n focused: 'core-select-focused',\n hovered: 'core-select-hovered',\n}\n\nconst optionMinHeight = 32\n\nconst checkedIconPlaceholderWidth = 32\n\nconst styledSelectButtonDefaultWidth = 248\n\nexport const extendedSelectMenuWidth = 360\n\nexport const PillSelectOptionWrapper = styled.div`\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: ${spacing.xs}px ${spacing.lg}px;\n`\n\nexport const PillSelectLabel = styled(Pill)`\n ${getEllipsis}\n`\n\nexport const PillSelectLabelWrapper = styled.div<{ disabled?: boolean }>`\n display: flex;\n max-width: 100%;\n pointer-events: auto;\n\n ${({ disabled }) =>\n disabled &&\n css`\n pointer-events: none;\n `}\n`\n\nexport const StyledCheckboxContainer = styled.div`\n padding-left: ${spacing.lg}px;\n`\n\nexport const StyledCheckmarkContainer = styled.div`\n align-items: center;\n color: ${colors.blue50};\n display: inline-flex;\n flex-shrink: 0;\n padding: 0 ${spacing.lg}px 0 ${spacing.sm}px;\n`\n\n// Do not merge with StyledMenu, needed for max-height working in IE\nexport const StyledWrapper = styled.div`\n display: flex;\n max-height: inherit;\n min-width: inherit;\n outline: none;\n width: inherit;\n`\n\nexport const StyledMenu = styled.div`\n display: flex;\n flex-direction: column;\n outline: 0;\n width: 100%;\n`\n\nexport const StyledOptions = styled.div<{ $scrollable?: boolean }>`\n flex-basis: auto;\n flex-grow: 1;\n flex-shrink: 1;\n min-height: ${optionMinHeight}px;\n ${({ $scrollable = true }) => $scrollable && `overflow-y: auto`};\n padding: ${spacing.sm}px 0;\n position: relative;\n overflow: hidden;\n\n &:focus {\n ${getFocus()}\n margin: -1px;\n }\n`\n\nexport const StyledItemContent = styled.div`\n display: flex;\n flex-direction: row;\n align-items: center;\n`\n\nexport const StyledOptionGroupLabel = styled.div`\n padding: ${spacing.md}px 0 ${spacing.xs}px ${spacing.lg}px;\n`\n\nexport const StyledItemLabel = styled.div<{\n $draggable?: boolean\n $selectionStyle?: 'highlight' | 'checkbox' | 'checkmark'\n}>`\n ${({ $draggable }) => {\n return css`\n padding: ${spacing.xs}px ${$draggable ? 0 : spacing.lg}px;\n overflow-wrap: anywhere;\n `\n }}\n`\n\nexport const StyledDraggableWrapper = styled.div`\n display: flex;\n width: 100%;\n align-items: center;\n`\n\nexport const StyledGrip = styled.div`\n padding: 0 2px;\n height: 24px;\n visibility: hidden;\n`\n\nexport const StyledFooter = styled(Box)`\n border-top: 1px solid ${colors.gray85};\n`\n\nexport const StyledHeader = styled.div``\n\nexport const StyledEmptyMessage = styled.div`\n ${getTypographyIntent('body')};\n\n padding: ${spacing.md}px ${spacing.lg}px;\n color: ${colors.gray45};\n`\n\nexport const StyledSearchContainer = styled.div`\n padding: ${spacing.lg}px ${spacing.lg}px ${spacing.sm}px;\n\n ${StyledButton} > * {\n pointer-events: none;\n }\n`\n\nexport const StyledGroup = styled.div<{ $clickable?: boolean }>`\n ${getTypographyIntent('body')}\n\n color: ${colors.gray15};\n cursor: ${({ $clickable }) => ($clickable ? 'pointer' : 'default')};\n font-weight: ${typographyWeights.semibold};\n padding: ${spacing.xs}px ${spacing.lg}px;\n\n &:not(:first-child) {\n padding-top: ${spacing.md + spacing.xs}px;\n }\n\n && {\n padding: 0;\n }\n\n ${StyledOptionGroupLabel} {\n padding: ${spacing.xs}px ${spacing.lg} px;\n }\n\n &:not(:first-child) {\n ${StyledOptionGroupLabel} {\n padding-top: ${spacing.md + spacing.xs} px;\n }\n }\n`\n\nexport const StyledItem = styled.div<{\n $disabled?: boolean\n $selected?: boolean\n $highlighted?: boolean\n $isDraggable?: boolean\n $isDragging?: boolean\n $emptyMinHeight?: number\n $isDraggingOver?: boolean\n $isDraggingDisabled?: boolean\n}>`\n ${getTypographyIntent('body')};\n\n align-items: center;\n cursor: pointer;\n list-style-type: none;\n display: flex;\n padding: 0;\n\n ${({ $emptyMinHeight }) => {\n return css`\n &:empty {\n min-height: ${$emptyMinHeight}px;\n }\n `\n }}\n\n ${({ $isDraggingOver, $highlighted }) => {\n return (\n $isDraggingOver &&\n $highlighted &&\n css`\n background-color: initial;\n `\n )\n }}\n\n ${({ $isDraggingOver, $disabled, $isDraggingDisabled }) => {\n return (\n ($isDraggingOver || $disabled || $isDraggingDisabled) &&\n css`\n &:hover {\n ${StyledGrip} {\n visibility: hidden;\n }\n }\n `\n )\n }}\n\n a {\n // We decided to use a negative margin trick here to allow us to continue\n // to use listNavigation without having to rewrite a bunch of code in js\n color: ${colors.gray15};\n display: block;\n margin: -${spacing.xs}px -${spacing.lg}px;\n padding: ${spacing.xs}px ${spacing.lg}px;\n text-decoration: none;\n\n &:hover {\n color: ${colors.gray15};\n text-decoration: none;\n }\n }\n\n &[data-highlighted='true'] {\n background-color: ${colors.gray96};\n }\n\n ${({ $highlighted }) => $highlighted && `background-color: ${colors.gray96};`}\n\n &:hover,\n &:active {\n ${StyledGrip} {\n visibility: visible;\n }\n }\n\n ${StyledCheckboxLabel} {\n color: inherit;\n cursor: pointer;\n }\n\n ${({ $disabled, $selected }) => {\n if ($disabled) {\n return css`\n &,\n ${StyledCheckboxLabel} {\n color: ${colors.gray85};\n cursor: default;\n }\n `\n } else if ($selected) {\n return css`\n color: ${colors.blue50};\n font-weight: 700;\n\n a,\n a:hover {\n color: ${colors.blue50};\n text-decoration: none;\n }\n\n &[data-highlighted='true'] {\n background-color: ${colors.gray96};\n }\n `\n }\n\n return css`\n color: ${colors.gray15};\n\n &[data-highlighted='true'] {\n background-color: ${colors.gray96};\n }\n `\n }}\n\n ${({ $isDraggable }) => {\n if ($isDraggable) {\n return css`\n ${StyledCheckboxLabel} {\n cursor: grab;\n\n // The unchecked and checked icons\n &:before,\n &:after {\n cursor: pointer;\n }\n }\n\n &&& {\n padding-left: 0;\n }\n `\n }\n }}\n\n ${({ $isDragging }) => {\n if ($isDragging) {\n return css`\n background-color: ${colors.gray96};\n\n ${StyledGrip} {\n visibility: visible;\n }\n `\n }\n }}\n`\n\nexport const StyledSelectAll = styled(Box)`\n padding-top: ${spacing.md}px;\n padding-bottom: ${spacing.md}px;\n border-bottom: 1px solid ${colors.gray85};\n`\n\nexport const StyledDroppable = styled.div`\n ${StyledGroup}, ${StyledItem} {\n padding-left: 28px;\n }\n`\n\nexport const StyledSelectMenu = styled(Card)`\n display: flex;\n max-height: 40vh;\n max-width: ${styledSelectButtonDefaultWidth}px;\n min-width: inherit;\n`\n\nexport const StyledLabel = styled.div<{ $hoverable: boolean }>`\n ${getEllipsis()}\n flex-grow: 1;\n margin-right: ${spacing.sm}px;\n outline: none;\n pointer-events: ${({ $hoverable }) => ($hoverable ? 'initial' : 'none')};\n user-select: none;\n`\n\nexport const StyledIndicators = styled.div`\n align-items: center;\n align-self: flex-start;\n display: flex;\n height: 34px;\n justify-content: flex-end;\n margin-left: ${spacing.xs}px;\n min-width: 40px;\n width: 40px;\n`\n\nexport const StyledClearIcon = styled(Button)``\n\nexport const StyledSpinner = styled.div`\n align-items: center;\n display: flex;\n flex: 0 0 auto;\n justify-content: center;\n line-height: 0;\n`\n\nexport const StyledArrowContainer = styled.div`\n align-items: center;\n display: inline-flex;\n height: 16px;\n justify-content: flex-end;\n margin-left: ${spacing.sm}px;\n width: 8px;\n`\n\nexport const StyledArrow = styled.span`\n display: inline-flex;\n\n svg {\n fill: ${colors.gray45};\n }\n`\n\nexport const StyledArrowOutline = styled.polygon``\n\nexport const StyledArrowFill = styled.polygon``\n\nexport const StyledTrigger = styled.div<SuperSelectStyledTriggerProps>`\n ${getTypographyIntent('body')}\n\n align-items: center;\n background-color: ${colors.white};\n border-color: ${colors.gray50};\n border-radius: ${borderRadius.md}px;\n border-style: solid;\n border-width: 1px;\n color: ${colors.gray15};\n cursor: pointer;\n display: inline-flex;\n height: 36px;\n min-height: 36px;\n outline: none;\n padding: 0 ${spacing.md}px;\n position: relative;\n white-space: nowrap;\n width: ${({ $block }) =>\n $block ? '100%' : `${styledSelectButtonDefaultWidth}px`};\n\n &::placeholder {\n border-color: ${colors.gray45};\n }\n\n &:hover,\n &:active,\n &[data-qa=${dataQa.hovered}] {\n background-color: ${colors.white};\n border-color: ${colors.gray20};\n color: ${colors.gray15};\n }\n\n &:focus,\n &:focus-within,\n &[data-qa=${dataQa.focused}] {\n ${getFocus()}\n\n ${StyledCircle} {\n stroke: ${colors.blue50};\n }\n }\n\n ${({ $placeholder = false }) =>\n $placeholder &&\n css`\n ${StyledLabel} {\n color: ${colors.gray45};\n }\n `}\n\n ${({ $disabled }) =>\n $disabled &&\n css`\n background-color: ${colors.gray94};\n border-color: ${colors.gray50};\n color: ${colors.gray45};\n cursor: default;\n pointer-events: none;\n\n ${StyledLabel} {\n color: ${colors.gray70};\n }\n\n ${StyledArrow} {\n svg {\n fill: ${colors.gray70};\n }\n }\n `}\n\n ${({ $error, $disabled }) => {\n if ($error && !$disabled) {\n return css`\n &,\n &:hover {\n border-color: ${colors.red50};\n border-color: var(--core-input-error-border-color, ${colors.red50});\n }\n &:hover:focus {\n ${getFocus()}\n }\n `\n }\n }}\n\n ${({ $hasClearIcon }) => css`\n ${StyledClearIcon} {\n opacity: ${$hasClearIcon ? 1 : 0};\n }\n `}\n\n ${({ $multiple }) =>\n $multiple &&\n css`\n height: auto;\n\n &:focus-within {\n ${getFocus()}\n }\n `}\n\n ${({ $open, $hasClearIcon }) =>\n $open &&\n $hasClearIcon &&\n css`\n ${StyledClearIcon} {\n opacity: 1;\n pointer-events: all;\n }\n `}\n\n ${({ $open, $placeholder = false }) =>\n $open &&\n $placeholder &&\n css`\n ${StyledLabel} {\n opacity: 1;\n pointer-events: all;\n }\n `}\n }\n`\n\nexport const StyledOverlay = styled(Card)`\n display: flex;\n flex-direction: column;\n`\n\nexport const StyledVirtuoso = styled(Virtuoso)`\n flex: 1 1 auto;\n`\n\nexport const StyledEllipses = styled.div`\n ${getEllipsis()}\n display: inline-flex;\n\n > div {\n display: inline-flex;\n width: 100%;\n }\n`\n\nexport const StyledMultiValueContainer = styled.div`\n display: flex;\n flex-wrap: wrap;\n margin-bottom: 2px;\n margin-right: ${spacing.xs}px;\n margin-top: 2px;\n min-width: 0;\n width: 100%;\n`\n\nexport const StyledMultiValue = styled.div`\n margin-bottom: 2px;\n margin-right: ${spacing.xs}px;\n margin-top: 2px;\n flex: 0 1 auto;\n\n > div {\n max-width: 178px;\n width: 100%;\n }\n`\n\nexport const StyledMultiInputContainer = styled.div`\n margin-bottom: 2px;\n margin-right: ${spacing.xs}px;\n margin-top: 2px;\n flex: 1;\n max-width: 100%;\n min-width: 24px;\n`\n\nexport const StyledMultiInput = styled.input<{\n $isNavigatingTokens?: boolean\n}>`\n background-color: transparent;\n border-width: 0;\n font-family: inherit;\n padding: 0;\n height: 24px;\n width: 100%;\n\n ${getTypographyIntent('body')}\n\n ${({ $isNavigatingTokens }) =>\n $isNavigatingTokens &&\n css`\n color: transparent;\n `}\n\n &::-ms-clear {\n display: none;\n }\n\n &:focus {\n box-shadow: none;\n outline: none;\n }\n\n &::placeholder {\n color: ${colors.gray45};\n }\n`\n"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,gBAAgB;AACzC,OAAOC,MAAM,IAAIC,GAAG,QAAQ,mBAAmB;AAC/C,SAASC,GAAG,QAAQ,YAAY;AAChC,SAASC,MAAM,QAAQ,WAAW;AAClC,SAASC,YAAY,QAAQ,yBAAyB;AACtD,SAASC,IAAI,QAAQ,cAAc;AACnC,SAASC,mBAAmB,QAAQ,6BAA6B;AACjE,SAASC,IAAI,QAAQ,cAAc;AACnC,SAASC,YAAY,QAAQ,2BAA2B;AACxD,SACEC,mBAAmB,EACnBC,iBAAiB,QACZ,iCAAiC;AACxC,SAASC,YAAY,QAAQ,yBAAyB;AACtD,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,SAASC,WAAW,EAAEC,QAAQ,QAAQ,mBAAmB;AACzD,SAASC,OAAO,QAAQ,oBAAoB;AAa5C,OAAO,IAAMC,MAAM,GAAG;EACpBC,OAAO,EAAE,qBAAqB;EAC9BC,OAAO,EAAE;AACX,CAAC;AAED,IAAMC,eAAe,GAAG,EAAE;AAE1B,IAAMC,2BAA2B,GAAG,EAAE;AAEtC,IAAMC,8BAA8B,GAAG,GAAG;AAE1C,OAAO,IAAMC,uBAAuB,GAAG,GAAG;AAE1C,OAAO,IAAMC,uBAAuB,gBAAGvB,MAAM,CAACwB,GAAG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AC,MAAM,CAAC,EAE3B,UAAAsH,MAAA;EAAA,IAAGC,mBAAmB,GAAAD,MAAA,CAAnBC,mBAAmB;EAAA,OACtBA,mBAAmB,IACnB/H,GAAG,wBAEF;AAAA,GAYQW,MAAM,CAAC4C,MAAM,CAEzB"}
|
|
1
|
+
{"version":3,"file":"SuperSelect.styles.js","names":["Virtuoso","styled","css","Box","Button","StyledButton","Card","StyledCheckboxLabel","Pill","StyledCircle","getTypographyIntent","typographyWeights","borderRadius","colors","getEllipsis","getFocus","spacing","dataQa","focused","hovered","optionMinHeight","checkedIconPlaceholderWidth","styledSelectButtonDefaultWidth","extendedSelectMenuWidth","PillSelectOptionWrapper","div","withConfig","displayName","componentId","xs","lg","PillSelectLabel","PillSelectLabelWrapper","_ref","disabled","StyledCheckboxContainer","StyledCheckmarkContainer","blue50","sm","StyledWrapper","StyledMenu","StyledOptions","_ref2","_ref2$$scrollable","$scrollable","StyledItemContent","StyledOptionGroupLabel","md","StyledItemLabel","_ref3","$draggable","StyledDraggableWrapper","StyledGrip","StyledFooter","gray85","StyledHeader","StyledEmptyMessage","gray45","StyledSearchContainer","StyledGroup","gray15","_ref4","$clickable","semibold","StyledItem","_ref5","$emptyMinHeight","_ref6","$isDraggingOver","$highlighted","_ref7","$disabled","$isDraggingDisabled","gray96","_ref8","concat","_ref9","$selected","_ref0","$isDraggable","_ref1","$isDragging","StyledSelectAll","StyledDroppable","StyledSelectMenu","StyledLabel","_ref10","$hoverable","StyledIndicators","StyledClearIcon","StyledSpinner","StyledArrowContainer","StyledArrow","span","StyledArrowOutline","polygon","StyledArrowFill","StyledTrigger","white","gray50","_ref11","$block","gray20","_ref12","_ref12$$placeholder","$placeholder","_ref13","gray94","gray70","_ref14","$error","red50","_ref15","$hasClearIcon","_ref16","$multiple","_ref17","$open","_ref18","_ref18$$placeholder","StyledOverlay","StyledVirtuoso","StyledEllipses","StyledMultiValueContainer","StyledTokenList","ul","StyledMultiValue","li","StyledMultiInputContainer","StyledMultiInput","button","_ref19","$isNavigatingTokens","_ref20"],"sources":["../../src/SuperSelect/SuperSelect.styles.ts"],"sourcesContent":["import { Virtuoso } from 'react-virtuoso'\nimport styled, { css } from 'styled-components'\nimport { Box } from '../Box/Box'\nimport { Button } from '../Button'\nimport { StyledButton } from '../Button/Button.styles'\nimport { Card } from '../Card/Card'\nimport { StyledCheckboxLabel } from '../Checkbox/Checkbox.styles'\nimport { Pill } from '../Pill/Pill'\nimport { StyledCircle } from '../Spinner/Spinner.styles'\nimport {\n getTypographyIntent,\n typographyWeights,\n} from '../Typography/Typography.styles'\nimport { borderRadius } from '../_styles/borderRadius'\nimport { colors } from '../_styles/colors'\nimport { getEllipsis, getFocus } from '../_styles/mixins'\nimport { spacing } from '../_styles/spacing'\n\nexport type SuperSelectStyledTriggerProps = {\n $block?: boolean\n $disabled?: boolean\n $error?: boolean\n $hasClearIcon?: boolean\n $loading?: boolean\n $multiple?: boolean\n $open?: boolean\n $placeholder?: boolean\n}\n\nexport const dataQa = {\n focused: 'core-select-focused',\n hovered: 'core-select-hovered',\n}\n\nconst optionMinHeight = 32\n\nconst checkedIconPlaceholderWidth = 32\n\nconst styledSelectButtonDefaultWidth = 248\n\nexport const extendedSelectMenuWidth = 360\n\nexport const PillSelectOptionWrapper = styled.div`\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: ${spacing.xs}px ${spacing.lg}px;\n`\n\nexport const PillSelectLabel = styled(Pill)`\n ${getEllipsis}\n`\n\nexport const PillSelectLabelWrapper = styled.div<{ disabled?: boolean }>`\n display: flex;\n max-width: 100%;\n pointer-events: auto;\n\n ${({ disabled }) =>\n disabled &&\n css`\n pointer-events: none;\n `}\n`\n\nexport const StyledCheckboxContainer = styled.div`\n padding-left: ${spacing.lg}px;\n`\n\nexport const StyledCheckmarkContainer = styled.div`\n align-items: center;\n color: ${colors.blue50};\n display: inline-flex;\n flex-shrink: 0;\n padding: 0 ${spacing.lg}px 0 ${spacing.sm}px;\n`\n\n// Do not merge with StyledMenu, needed for max-height working in IE\nexport const StyledWrapper = styled.div`\n display: flex;\n max-height: inherit;\n min-width: inherit;\n outline: none;\n width: inherit;\n`\n\nexport const StyledMenu = styled.div`\n display: flex;\n flex-direction: column;\n outline: 0;\n width: 100%;\n`\n\nexport const StyledOptions = styled.div<{ $scrollable?: boolean }>`\n flex-basis: auto;\n flex-grow: 1;\n flex-shrink: 1;\n min-height: ${optionMinHeight}px;\n ${({ $scrollable = true }) => $scrollable && `overflow-y: auto`};\n padding: ${spacing.sm}px 0;\n position: relative;\n overflow: hidden;\n\n &:focus {\n ${getFocus()}\n margin: -1px;\n }\n`\n\nexport const StyledItemContent = styled.div`\n display: flex;\n flex-direction: row;\n align-items: center;\n`\n\nexport const StyledOptionGroupLabel = styled.div`\n padding: ${spacing.md}px 0 ${spacing.xs}px ${spacing.lg}px;\n`\n\nexport const StyledItemLabel = styled.div<{\n $draggable?: boolean\n $selectionStyle?: 'highlight' | 'checkbox' | 'checkmark'\n}>`\n ${({ $draggable }) => {\n return css`\n padding: ${spacing.xs}px ${$draggable ? 0 : spacing.lg}px;\n overflow-wrap: anywhere;\n `\n }}\n`\n\nexport const StyledDraggableWrapper = styled.div`\n display: flex;\n width: 100%;\n align-items: center;\n`\n\nexport const StyledGrip = styled.div`\n padding: 0 2px;\n height: 24px;\n visibility: hidden;\n`\n\nexport const StyledFooter = styled(Box)`\n border-top: 1px solid ${colors.gray85};\n`\n\nexport const StyledHeader = styled.div``\n\nexport const StyledEmptyMessage = styled.div`\n ${getTypographyIntent('body')};\n\n padding: ${spacing.md}px ${spacing.lg}px;\n color: ${colors.gray45};\n`\n\nexport const StyledSearchContainer = styled.div`\n padding: ${spacing.lg}px ${spacing.lg}px ${spacing.sm}px;\n\n ${StyledButton} > * {\n pointer-events: none;\n }\n`\n\nexport const StyledGroup = styled.div<{ $clickable?: boolean }>`\n ${getTypographyIntent('body')}\n\n color: ${colors.gray15};\n cursor: ${({ $clickable }) => ($clickable ? 'pointer' : 'default')};\n font-weight: ${typographyWeights.semibold};\n padding: ${spacing.xs}px ${spacing.lg}px;\n\n &:not(:first-child) {\n padding-top: ${spacing.md + spacing.xs}px;\n }\n\n && {\n padding: 0;\n }\n\n ${StyledOptionGroupLabel} {\n padding: ${spacing.xs}px ${spacing.lg} px;\n }\n\n &:not(:first-child) {\n ${StyledOptionGroupLabel} {\n padding-top: ${spacing.md + spacing.xs} px;\n }\n }\n`\n\nexport const StyledItem = styled.div<{\n $disabled?: boolean\n $selected?: boolean\n $highlighted?: boolean\n $isDraggable?: boolean\n $isDragging?: boolean\n $emptyMinHeight?: number\n $isDraggingOver?: boolean\n $isDraggingDisabled?: boolean\n}>`\n ${getTypographyIntent('body')};\n\n align-items: center;\n cursor: pointer;\n list-style-type: none;\n display: flex;\n padding: 0;\n\n ${({ $emptyMinHeight }) => {\n return css`\n &:empty {\n min-height: ${$emptyMinHeight}px;\n }\n `\n }}\n\n ${({ $isDraggingOver, $highlighted }) => {\n return (\n $isDraggingOver &&\n $highlighted &&\n css`\n background-color: initial;\n `\n )\n }}\n\n ${({ $isDraggingOver, $disabled, $isDraggingDisabled }) => {\n return (\n ($isDraggingOver || $disabled || $isDraggingDisabled) &&\n css`\n &:hover {\n ${StyledGrip} {\n visibility: hidden;\n }\n }\n `\n )\n }}\n\n a {\n // We decided to use a negative margin trick here to allow us to continue\n // to use listNavigation without having to rewrite a bunch of code in js\n color: ${colors.gray15};\n display: block;\n margin: -${spacing.xs}px -${spacing.lg}px;\n padding: ${spacing.xs}px ${spacing.lg}px;\n text-decoration: none;\n\n &:hover {\n color: ${colors.gray15};\n text-decoration: none;\n }\n }\n\n &[data-highlighted='true'] {\n background-color: ${colors.gray96};\n }\n\n ${({ $highlighted }) => $highlighted && `background-color: ${colors.gray96};`}\n\n &:hover,\n &:active {\n ${StyledGrip} {\n visibility: visible;\n }\n }\n\n ${StyledCheckboxLabel} {\n color: inherit;\n cursor: pointer;\n }\n\n ${({ $disabled, $selected }) => {\n if ($disabled) {\n return css`\n &,\n ${StyledCheckboxLabel} {\n color: ${colors.gray85};\n cursor: default;\n }\n `\n } else if ($selected) {\n return css`\n color: ${colors.blue50};\n font-weight: 700;\n\n a,\n a:hover {\n color: ${colors.blue50};\n text-decoration: none;\n }\n\n &[data-highlighted='true'] {\n background-color: ${colors.gray96};\n }\n `\n }\n\n return css`\n color: ${colors.gray15};\n\n &[data-highlighted='true'] {\n background-color: ${colors.gray96};\n }\n `\n }}\n\n ${({ $isDraggable }) => {\n if ($isDraggable) {\n return css`\n ${StyledCheckboxLabel} {\n cursor: grab;\n\n // The unchecked and checked icons\n &:before,\n &:after {\n cursor: pointer;\n }\n }\n\n &&& {\n padding-left: 0;\n }\n `\n }\n }}\n\n ${({ $isDragging }) => {\n if ($isDragging) {\n return css`\n background-color: ${colors.gray96};\n\n ${StyledGrip} {\n visibility: visible;\n }\n `\n }\n }}\n`\n\nexport const StyledSelectAll = styled(Box)`\n padding-top: ${spacing.md}px;\n padding-bottom: ${spacing.md}px;\n border-bottom: 1px solid ${colors.gray85};\n`\n\nexport const StyledDroppable = styled.div`\n ${StyledGroup}, ${StyledItem} {\n padding-left: 28px;\n }\n`\n\nexport const StyledSelectMenu = styled(Card)`\n display: flex;\n max-height: 40vh;\n max-width: ${styledSelectButtonDefaultWidth}px;\n min-width: inherit;\n`\n\nexport const StyledLabel = styled.div<{ $hoverable: boolean }>`\n ${getEllipsis()}\n flex-grow: 1;\n margin-right: ${spacing.sm}px;\n outline: none;\n pointer-events: ${({ $hoverable }) => ($hoverable ? 'initial' : 'none')};\n user-select: none;\n`\n\nexport const StyledIndicators = styled.div`\n align-items: center;\n align-self: flex-start;\n display: flex;\n height: 34px;\n justify-content: flex-end;\n margin-left: ${spacing.xs}px;\n min-width: 40px;\n width: 40px;\n`\n\nexport const StyledClearIcon = styled(Button)``\n\nexport const StyledSpinner = styled.div`\n align-items: center;\n display: flex;\n flex: 0 0 auto;\n justify-content: center;\n line-height: 0;\n`\n\nexport const StyledArrowContainer = styled.div`\n align-items: center;\n display: inline-flex;\n height: 16px;\n justify-content: flex-end;\n margin-left: ${spacing.sm}px;\n width: 8px;\n`\n\nexport const StyledArrow = styled.span`\n display: inline-flex;\n\n svg {\n fill: ${colors.gray45};\n }\n`\n\nexport const StyledArrowOutline = styled.polygon``\n\nexport const StyledArrowFill = styled.polygon``\n\nexport const StyledTrigger = styled.div<SuperSelectStyledTriggerProps>`\n ${getTypographyIntent('body')}\n\n align-items: center;\n background-color: ${colors.white};\n border-color: ${colors.gray50};\n border-radius: ${borderRadius.md}px;\n border-style: solid;\n border-width: 1px;\n color: ${colors.gray15};\n cursor: pointer;\n display: inline-flex;\n height: 36px;\n min-height: 36px;\n outline: none;\n padding: 0 ${spacing.md}px;\n position: relative;\n white-space: nowrap;\n width: ${({ $block }) =>\n $block ? '100%' : `${styledSelectButtonDefaultWidth}px`};\n\n &::placeholder {\n border-color: ${colors.gray45};\n }\n\n &:hover,\n &:active,\n &[data-qa=${dataQa.hovered}] {\n background-color: ${colors.white};\n border-color: ${colors.gray20};\n color: ${colors.gray15};\n }\n\n &:focus,\n &:focus-within,\n &[data-qa=${dataQa.focused}] {\n ${getFocus()}\n\n ${StyledCircle} {\n stroke: ${colors.blue50};\n }\n }\n\n ${({ $placeholder = false }) =>\n $placeholder &&\n css`\n ${StyledLabel} {\n color: ${colors.gray45};\n }\n `}\n\n ${({ $disabled }) =>\n $disabled &&\n css`\n background-color: ${colors.gray94};\n border-color: ${colors.gray50};\n color: ${colors.gray45};\n cursor: default;\n pointer-events: none;\n\n ${StyledLabel} {\n color: ${colors.gray70};\n }\n\n ${StyledArrow} {\n svg {\n fill: ${colors.gray70};\n }\n }\n `}\n\n ${({ $error, $disabled }) => {\n if ($error && !$disabled) {\n return css`\n &,\n &:hover {\n border-color: ${colors.red50};\n border-color: var(--core-input-error-border-color, ${colors.red50});\n }\n &:hover:focus {\n ${getFocus()}\n }\n `\n }\n }}\n\n ${({ $hasClearIcon }) => css`\n ${StyledClearIcon} {\n opacity: ${$hasClearIcon ? 1 : 0};\n }\n `}\n\n ${({ $multiple }) =>\n $multiple &&\n css`\n height: auto;\n\n &:focus-within {\n ${getFocus()}\n }\n `}\n\n ${({ $open, $hasClearIcon }) =>\n $open &&\n $hasClearIcon &&\n css`\n ${StyledClearIcon} {\n opacity: 1;\n pointer-events: all;\n }\n `}\n\n ${({ $open, $placeholder = false }) =>\n $open &&\n $placeholder &&\n css`\n ${StyledLabel} {\n opacity: 1;\n pointer-events: all;\n }\n `}\n }\n`\n\nexport const StyledOverlay = styled(Card)`\n display: flex;\n flex-direction: column;\n`\n\nexport const StyledVirtuoso = styled(Virtuoso)`\n flex: 1 1 auto;\n`\n\nexport const StyledEllipses = styled.div`\n ${getEllipsis()}\n display: inline-flex;\n\n > div {\n display: inline-flex;\n width: 100%;\n }\n`\n\nexport const StyledMultiValueContainer = styled.div`\n display: flex;\n flex-wrap: wrap;\n margin-bottom: 2px;\n margin-right: ${spacing.xs}px;\n margin-top: 2px;\n min-width: 0;\n width: 100%;\n`\n\nexport const StyledTokenList = styled.ul`\n display: contents;\n list-style: none;\n margin: 0;\n padding: 0;\n`\n\nexport const StyledMultiValue = styled.li`\n margin-bottom: 2px;\n margin-right: ${spacing.xs}px;\n margin-top: 2px;\n flex: 0 1 auto;\n\n > div {\n max-width: 178px;\n width: 100%;\n }\n`\n\nexport const StyledMultiInputContainer = styled.div`\n margin-bottom: 2px;\n margin-right: ${spacing.xs}px;\n margin-top: 2px;\n flex: 1;\n max-width: 100%;\n min-width: 24px;\n`\n\nexport const StyledMultiInput = styled.button<{\n $isNavigatingTokens?: boolean\n $placeholder?: boolean\n}>`\n background-color: transparent;\n border-width: 0;\n font-family: inherit;\n padding: 0;\n height: 24px;\n width: 100%;\n text-align: left;\n cursor: inherit;\n\n ${getTypographyIntent('body')}\n\n ${({ $isNavigatingTokens }) =>\n $isNavigatingTokens &&\n css`\n color: transparent;\n `}\n\n ${({ $placeholder }) =>\n $placeholder &&\n css`\n color: ${colors.gray45};\n `}\n\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B;AAAA,EAMJ"}
|
|
@@ -3,10 +3,8 @@ import type { VirtuosoHandle } from 'react-virtuoso';
|
|
|
3
3
|
import type * as defaultComponents from './SuperSelect.components';
|
|
4
4
|
import type { isOptgroupSymbol } from './SuperSelect.constants';
|
|
5
5
|
export interface TokenNavigationProps {
|
|
6
|
-
activeIndex?: number | null;
|
|
7
6
|
enabled?: boolean;
|
|
8
|
-
|
|
9
|
-
onNavigate?: (index: number | null) => void;
|
|
7
|
+
tokenRemoveRefs?: React.MutableRefObject<Array<HTMLButtonElement | null>>;
|
|
10
8
|
value?: SuperSelectValue;
|
|
11
9
|
}
|
|
12
10
|
export interface KeyboardSelectionProps {
|
|
@@ -92,6 +90,7 @@ export interface SuperSelectConfig {
|
|
|
92
90
|
value?: SuperSelectValue;
|
|
93
91
|
overlayMatchesTriggerWidth?: boolean;
|
|
94
92
|
'aria-label'?: string;
|
|
93
|
+
'aria-labelledby'?: string;
|
|
95
94
|
}
|
|
96
95
|
export declare type SuperSelectProps = SuperSelectConfig;
|
|
97
96
|
export interface SuperSelectApi {
|
|
@@ -115,12 +114,12 @@ export interface SuperSelectApi {
|
|
|
115
114
|
components: typeof defaultComponents;
|
|
116
115
|
state: {
|
|
117
116
|
activeMenuIndex: number | null;
|
|
118
|
-
activeTokenIndex: number | null;
|
|
119
117
|
isEmpty: () => boolean;
|
|
120
118
|
isSelectAllActive: boolean;
|
|
121
119
|
listContainerHeight: number;
|
|
122
120
|
listId: string;
|
|
123
121
|
maxHeight: number;
|
|
122
|
+
tokenListId: string;
|
|
124
123
|
onDragEnd: (result: SuperSelectResult) => void;
|
|
125
124
|
onSelect: (option: SuperSelectOption) => void;
|
|
126
125
|
onSelectAll?: (selectedOptions: SuperSelectOption[]) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SuperSelect.types.js","names":[],"sources":["../../src/SuperSelect/SuperSelect.types.ts"],"sourcesContent":["import type React from 'react'\nimport type { VirtuosoHandle } from 'react-virtuoso'\nimport type * as defaultComponents from './SuperSelect.components'\nimport type { isOptgroupSymbol } from './SuperSelect.constants'\n\nexport interface TokenNavigationProps {\n
|
|
1
|
+
{"version":3,"file":"SuperSelect.types.js","names":[],"sources":["../../src/SuperSelect/SuperSelect.types.ts"],"sourcesContent":["import type React from 'react'\nimport type { VirtuosoHandle } from 'react-virtuoso'\nimport type * as defaultComponents from './SuperSelect.components'\nimport type { isOptgroupSymbol } from './SuperSelect.constants'\n\nexport interface TokenNavigationProps {\n enabled?: boolean\n tokenRemoveRefs?: React.MutableRefObject<Array<HTMLButtonElement | null>>\n value?: SuperSelectValue\n}\n\nexport interface KeyboardSelectionProps {\n enabled?: boolean\n onSelect?: () => void\n}\n\nexport type SuperSelectValuePrimitive = boolean | string | number\n\nexport type SuperSelectValue =\n | SuperSelectValuePrimitive\n | Array<SuperSelectValuePrimitive>\n | null\n\nexport type SuperSelectOption = any\n\nexport type SuperSelectPreset = '' | 'pill' | 'filter' | 'contacts'\n\nexport type SuperSelectResult = {\n destination?: { index: number } | null\n source: { index: number }\n}\n\nexport interface SuperSelectPresetProps {\n filter?: {\n filterName?: string\n }\n pill?: {}\n contacts?: {}\n ''?: {}\n}\n\nexport interface SuperSelectConfig {\n block?: boolean\n components?: Partial<typeof defaultComponents>\n defaultValue?: SuperSelectValue\n disabled?: boolean\n draggable?: boolean\n emptyMessage?: string\n selectAllEnabled?: boolean\n error?: boolean\n footer?: React.ReactElement\n getOptionGroup?: (option: SuperSelectOption) => string\n getOptionIsBatch?: (option: SuperSelectOption) => boolean\n getOptionIsDisabled?: (option: SuperSelectOption) => boolean\n getOptionIsPartiallySelected?: (option: SuperSelectOption) => boolean\n getOptionIsSelected?: (option: SuperSelectOption) => boolean\n getOptionLabel?: (option: SuperSelectOption) => string\n getOptionValue?: (option: SuperSelectOption) => SuperSelectValuePrimitive\n header?: React.ReactElement\n loading?: boolean\n multiple?: boolean\n onChange?: (value: SuperSelectValue) => void\n onManualSort?: (options: SuperSelectOption[]) => void\n onUnselectAll?: (\n value: SuperSelectValue,\n options: SuperSelectOption[],\n searchValue: string,\n getValue: (opt: SuperSelectOption) => Array<SuperSelectValuePrimitive>\n ) => SuperSelectValue\n /**\n * Callback function triggered when the \"Select All\" functionality is used in a multi-select SuperSelect.\n *\n * This prop is only relevant when `multiple={true}` and `selectAllEnabled={true}`. The callback is invoked\n * when users interact with a select all option in the select list that allows them to\n * select or deselect all available options at once.\n *\n * @param selectedOptions - An array of all options that would be selected when \"Select All\" is triggered.\n * This includes all selectable options (excluding disabled options) that are\n * currently visible and available for selection.\n *\n * @remarks\n * - Only called when the component is in multi-select mode (`multiple={true}`)\n * - Requires `selectAllEnabled={true}` to show the select-all UI\n * - Disabled options are automatically excluded from the selectedOptions array\n * - Allows additional customization of select-all behavior if needed by implementing custom logic within the callback\n *\n * @see {@link selectAllEnabled} - Enable the select-all functionality\n * @see {@link multiple} - Enable multi-select mode\n * @see {@link getOptionIsDisabled} - Function to determine if options are disabled\n */\n onSelectAll?: (selectedOptions: SuperSelectOption[]) => void\n onScrollBottom?: () => void\n onOpenChange?: (open: boolean) => void\n options?: SuperSelectOption[]\n placeholder?: string\n preset?: SuperSelectPreset\n presetProps?: SuperSelectPresetProps\n search?: boolean\n selectionStyle?: 'highlight' | 'checkbox' | 'checkmark'\n setOptionGroup?: (\n option: SuperSelectOption,\n group: string\n ) => SuperSelectOption\n sort?: boolean\n tabIndex?: number\n value?: SuperSelectValue\n overlayMatchesTriggerWidth?: boolean\n 'aria-label'?: string\n 'aria-labelledby'?: string\n}\n\nexport type SuperSelectProps = SuperSelectConfig\n\nexport interface SuperSelectApi {\n config: {\n block: boolean\n disabled: boolean\n draggable: boolean\n emptyMessage: string\n error?: boolean\n footer?: React.ReactElement\n header?: React.ReactElement\n placeholder?: string\n preset: SuperSelectPreset\n presetProps?: any\n selectionStyle: 'highlight' | 'token' | 'checkbox' | 'checkmark'\n tabIndex: number\n loading: boolean\n multiple: boolean\n selectAllEnabled: boolean\n }\n components: typeof defaultComponents\n state: {\n activeMenuIndex: number | null\n isEmpty: () => boolean\n isSelectAllActive: boolean\n listContainerHeight: number\n listId: string\n maxHeight: number\n tokenListId: string\n onDragEnd: (result: SuperSelectResult) => void\n onSelect: (option: SuperSelectOption) => void\n onSelectAll?: (selectedOptions: SuperSelectOption[]) => void\n open: boolean\n options: SuperSelectOption[]\n overlayId: string\n searchValue: string\n selectAllOption: SuperSelectOption\n selectedIndex: number | null\n selectedLabel: string\n selectedOption: SuperSelectOption | null\n setOpen: (open: boolean) => void\n setPointer: any\n setActiveMenuIndex: (index: number | null) => void\n setSearchValue: ((value: string) => void) & { cancel: () => void }\n sourceOptions: SuperSelectOption[]\n value: SuperSelectValue\n width: number\n }\n props: {\n clear: () => Record<string, any>\n emptyMessage: () => Record<string, any>\n footer: () => Record<string, any>\n header: () => Record<string, any>\n item: (...args: any[]) => Record<string, any>\n label: () => Record<string, any>\n menu: () => Record<string, any>\n multiInput: () => Record<string, any>\n overlay: () => Record<string, any>\n search: () => Record<string, any>\n searchContainer: () => Record<string, any>\n tokenClear: (index: number) => Record<string, any>\n trigger: () => Record<string, any>\n virtuoso: () => Record<string, any>\n }\n option: {\n group: (option: SuperSelectOption) => string\n isBatch: (option: SuperSelectOption) => boolean\n isPartiallySelected: (option: SuperSelectOption) => boolean\n isSelected: (option: SuperSelectOption) => boolean\n isDisabled: (option: SuperSelectOption) => boolean\n isOptgroup: (option: SuperSelectOption) => boolean\n isOptSelectAll: (option: SuperSelectOption) => boolean\n label: (option: SuperSelectOption) => string\n selectAll: {\n isSelectAllPartiallySelected: (options: SuperSelectOption[]) => boolean\n isSelectAllSelected: (options: SuperSelectOption[]) => boolean\n }\n value: (option: SuperSelectOption) => SuperSelectValuePrimitive\n }\n refs: {\n floating: any\n navigationList: any\n virtuoso: React.RefObject<VirtuosoHandle>\n }\n}\n\nexport interface SuperSelectTriggerProps {\n block?: boolean\n disabled?: boolean\n error?: boolean\n loading?: boolean\n placeholder?: string\n search?: boolean\n tabIndex?: number\n}\n\nexport interface SuperSelectOptgroup {\n label: string\n id: string\n [isOptgroupSymbol]: true\n}\n\nexport interface SuperSelectMenuItemProps\n extends React.HTMLAttributes<HTMLDivElement> {\n isDragging?: boolean\n // data attributes are passed by Virtuoso\n 'data-known-size'?: number\n 'data-index': number\n}\n"],"mappings":""}
|
|
@@ -26,10 +26,15 @@ export var filterPreset = {
|
|
|
26
26
|
}),
|
|
27
27
|
TriggerContainer: /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
28
28
|
var ctx = useSuperSelectContext();
|
|
29
|
+
var multipleProps = ctx.config.multiple ? {
|
|
30
|
+
'aria-expanded': ctx.state.open,
|
|
31
|
+
role: 'button',
|
|
32
|
+
tabIndex: ctx.config.disabled ? -1 : ctx.config.tabIndex
|
|
33
|
+
} : {};
|
|
29
34
|
if (!Array.isArray(ctx.state.value)) {
|
|
30
35
|
return /*#__PURE__*/React.createElement(StyledTrigger, _extends({
|
|
31
36
|
$block: ctx.config.block
|
|
32
|
-
}, props, {
|
|
37
|
+
}, multipleProps, props, {
|
|
33
38
|
ref: ref
|
|
34
39
|
}));
|
|
35
40
|
}
|
|
@@ -44,7 +49,7 @@ export var filterPreset = {
|
|
|
44
49
|
}).join(', ')))
|
|
45
50
|
}, /*#__PURE__*/React.createElement(StyledTrigger, _extends({
|
|
46
51
|
$block: ctx.config.block
|
|
47
|
-
}, props, {
|
|
52
|
+
}, multipleProps, props, {
|
|
48
53
|
ref: ref
|
|
49
54
|
})));
|
|
50
55
|
}),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filterPreset.js","names":["React","Popover","Typography","StyledFilterPresetPopoverContent","StyledLabel","StyledTrigger","useSuperSelectContext","getFilterPresetProps","props","_props$filter","filter","getValueLabel","isValueEmpty","value","placeholder","filterName","prefixLabel","valueLabel","concat","filterPreset","components","Label","forwardRef","ctx","presetProps","config","undefined","includes","state","createElement","$hoverable","selectedLabel","TriggerContainer","ref","Array","isArray","_extends","$block","block","placement","trigger","length","overlay","map","v","option","options","find","label","join","MultiValueContainer","selectionStyle"],"sources":["../../../src/SuperSelect/presets/filterPreset.tsx"],"sourcesContent":["import React from 'react'\nimport { Popover } from '../../Popover'\nimport { Typography } from '../../Typography'\nimport { StyledFilterPresetPopoverContent } from '../SuperSelect.presets.styles'\nimport type { SuperSelectStyledTriggerProps } from '../SuperSelect.styles'\nimport { StyledLabel, StyledTrigger } from '../SuperSelect.styles'\nimport type {\n SuperSelectConfig,\n SuperSelectPresetProps,\n} from '../SuperSelect.types'\nimport { useSuperSelectContext } from '../useSuperSelect'\n\nconst getFilterPresetProps = (props?: SuperSelectPresetProps) => {\n return props?.filter ?? {}\n}\n\nconst getValueLabel = (\n isValueEmpty: boolean,\n value?: string,\n placeholder?: string,\n filterName?: string\n) => {\n const prefixLabel = isValueEmpty ? placeholder || filterName : filterName\n const valueLabel = value ? `${prefixLabel ? ': ' : ''}${value}` : ''\n return `${prefixLabel}${valueLabel}`\n}\n\nexport const filterPreset: SuperSelectConfig = {\n components: {\n Label: React.forwardRef(() => {\n const ctx = useSuperSelectContext()\n const presetProps = getFilterPresetProps(ctx.config.presetProps)\n const isValueEmpty = ['', null, undefined].includes(\n ctx.state.value as string\n )\n\n return (\n <StyledLabel $hoverable={false}>\n {getValueLabel(\n isValueEmpty,\n ctx.state.selectedLabel,\n ctx.config.placeholder,\n presetProps.filterName\n )}\n </StyledLabel>\n )\n }),\n TriggerContainer: React.forwardRef<\n HTMLDivElement,\n SuperSelectStyledTriggerProps\n >((props, ref) => {\n const ctx = useSuperSelectContext()\n\n if (!Array.isArray(ctx.state.value)) {\n return <StyledTrigger
|
|
1
|
+
{"version":3,"file":"filterPreset.js","names":["React","Popover","Typography","StyledFilterPresetPopoverContent","StyledLabel","StyledTrigger","useSuperSelectContext","getFilterPresetProps","props","_props$filter","filter","getValueLabel","isValueEmpty","value","placeholder","filterName","prefixLabel","valueLabel","concat","filterPreset","components","Label","forwardRef","ctx","presetProps","config","undefined","includes","state","createElement","$hoverable","selectedLabel","TriggerContainer","ref","multipleProps","multiple","open","role","tabIndex","disabled","Array","isArray","_extends","$block","block","placement","trigger","length","overlay","map","v","option","options","find","label","join","MultiValueContainer","selectionStyle"],"sources":["../../../src/SuperSelect/presets/filterPreset.tsx"],"sourcesContent":["import React from 'react'\nimport { Popover } from '../../Popover'\nimport { Typography } from '../../Typography'\nimport { StyledFilterPresetPopoverContent } from '../SuperSelect.presets.styles'\nimport type { SuperSelectStyledTriggerProps } from '../SuperSelect.styles'\nimport { StyledLabel, StyledTrigger } from '../SuperSelect.styles'\nimport type {\n SuperSelectConfig,\n SuperSelectPresetProps,\n} from '../SuperSelect.types'\nimport { useSuperSelectContext } from '../useSuperSelect'\n\nconst getFilterPresetProps = (props?: SuperSelectPresetProps) => {\n return props?.filter ?? {}\n}\n\nconst getValueLabel = (\n isValueEmpty: boolean,\n value?: string,\n placeholder?: string,\n filterName?: string\n) => {\n const prefixLabel = isValueEmpty ? placeholder || filterName : filterName\n const valueLabel = value ? `${prefixLabel ? ': ' : ''}${value}` : ''\n return `${prefixLabel}${valueLabel}`\n}\n\nexport const filterPreset: SuperSelectConfig = {\n components: {\n Label: React.forwardRef(() => {\n const ctx = useSuperSelectContext()\n const presetProps = getFilterPresetProps(ctx.config.presetProps)\n const isValueEmpty = ['', null, undefined].includes(\n ctx.state.value as string\n )\n\n return (\n <StyledLabel $hoverable={false}>\n {getValueLabel(\n isValueEmpty,\n ctx.state.selectedLabel,\n ctx.config.placeholder,\n presetProps.filterName\n )}\n </StyledLabel>\n )\n }),\n TriggerContainer: React.forwardRef<\n HTMLDivElement,\n SuperSelectStyledTriggerProps\n >((props, ref) => {\n const ctx = useSuperSelectContext()\n\n const multipleProps = ctx.config.multiple\n ? {\n 'aria-expanded': ctx.state.open,\n role: 'button' as const,\n tabIndex: ctx.config.disabled ? -1 : ctx.config.tabIndex,\n }\n : {}\n\n if (!Array.isArray(ctx.state.value)) {\n return (\n <StyledTrigger\n $block={ctx.config.block}\n {...multipleProps}\n {...props}\n ref={ref}\n />\n )\n }\n\n return (\n <Popover\n placement=\"top\"\n trigger={ctx.state.value.length > 1 ? 'hover' : 'none'}\n overlay={\n <StyledFilterPresetPopoverContent>\n <Typography>\n {ctx.state.value\n .map((v) => {\n const option = ctx.state.options.find(\n (option) => ctx.option.value(option) === v\n )\n return option ? ctx.option.label(option) : ''\n })\n .join(', ')}\n </Typography>\n </StyledFilterPresetPopoverContent>\n }\n >\n <StyledTrigger\n $block={ctx.config.block}\n {...multipleProps}\n {...props}\n ref={ref}\n />\n </Popover>\n )\n }),\n MultiValueContainer: () => {\n const ctx = useSuperSelectContext()\n const presetProps = getFilterPresetProps(ctx.config.presetProps)\n\n if (Array.isArray(ctx.state.value)) {\n const isValueEmpty = !ctx.state.value.length\n const value =\n ctx.state.value.length > 1\n ? `(${ctx.state.value.length})`\n : ctx.state.value.length === 1\n ? `${ctx.state.selectedLabel}`\n : ''\n\n return (\n <StyledLabel $hoverable={false}>\n {getValueLabel(\n isValueEmpty,\n value,\n ctx.config.placeholder,\n presetProps.filterName\n )}\n </StyledLabel>\n )\n }\n\n return <div>Value is not an array</div>\n },\n },\n selectionStyle: 'highlight',\n}\n"],"mappings":";AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,OAAO,QAAQ,eAAe;AACvC,SAASC,UAAU,QAAQ,kBAAkB;AAC7C,SAASC,gCAAgC,QAAQ,+BAA+B;AAEhF,SAASC,WAAW,EAAEC,aAAa,QAAQ,uBAAuB;AAKlE,SAASC,qBAAqB,QAAQ,mBAAmB;AAEzD,IAAMC,oBAAoB,GAAG,SAAvBA,oBAAoBA,CAAIC,KAA8B,EAAK;EAAA,IAAAC,aAAA;EAC/D,QAAAA,aAAA,GAAOD,KAAK,aAALA,KAAK,uBAALA,KAAK,CAAEE,MAAM,cAAAD,aAAA,cAAAA,aAAA,GAAI,CAAC,CAAC;AAC5B,CAAC;AAED,IAAME,aAAa,GAAG,SAAhBA,aAAaA,CACjBC,Y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FuB,mBAAmB,EAAE,SAArBA,mBAAmBA,CAAA,EAAQ;MACzB,IAAMjC,GAAG,GAAGjB,qBAAqB,CAAC,CAAC;MACnC,IAAMkB,WAAW,GAAGjB,oBAAoB,CAACgB,GAAG,CAACE,MAAM,CAACD,WAAW,CAAC;MAEhE,IAAIgB,KAAK,CAACC,OAAO,CAAClB,GAAG,CAACK,KAAK,CAACf,KAAK,CAAC,EAAE;QAClC,IAAMD,YAAY,GAAG,CAACW,GAAG,CAACK,KAAK,CAACf,KAAK,CAACkC,MAAM;QAC5C,IAAMlC,KAAK,GACTU,GAAG,CAACK,KAAK,CAACf,KAAK,CAACkC,MAAM,GAAG,CAAC,OAAA7B,MAAA,CAClBK,GAAG,CAACK,KAAK,CAACf,KAAK,CAACkC,MAAM,SAC1BxB,GAAG,CAACK,KAAK,CAACf,KAAK,CAACkC,MAAM,KAAK,CAAC,MAAA7B,MAAA,CACzBK,GAAG,CAACK,KAAK,CAACG,aAAa,IAC1B,EAAE;QAER,oBACE/B,KAAA,CAAA6B,aAAA,CAACzB,WAAW;UAAC0B,UAAU,EAAE;QAAM,GAC5BnB,aAAa,CACZC,YAAY,EACZC,KAAK,EACLU,GAAG,CAACE,MAAM,CAACX,WAAW,EACtBU,WAAW,CAACT,UACd,CACW,CAAC;MAElB;MAEA,oBAAOf,KAAA,CAAA6B,aAAA,cAAK,uBAA0B,CAAC;IACzC;EACF,CAAC;EACD4B,cAAc,EAAE;AAClB,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { SuperSelectApi, SuperSelectConfig } from './SuperSelect.types';
|
|
3
|
-
export declare function useSuperSelect({ block, components: customComponents, defaultValue, disabled, draggable, emptyMessage, selectAllEnabled, error, footer, getOptionGroup, getOptionIsBatch, getOptionIsDisabled, getOptionLabel, getOptionIsPartiallySelected, getOptionIsSelected, getOptionValue, onScrollBottom, onOpenChange, header, loading, multiple, onChange, onManualSort, onUnselectAll, onSelectAll, options: sourceOptions, placeholder, preset, presetProps, search, selectionStyle, setOptionGroup, sort, tabIndex, value: value_, overlayMatchesTriggerWidth, 'aria-label': ariaLabel, }: SuperSelectConfig): SuperSelectApi;
|
|
3
|
+
export declare function useSuperSelect({ block, components: customComponents, defaultValue, disabled, draggable, emptyMessage, selectAllEnabled, error, footer, getOptionGroup, getOptionIsBatch, getOptionIsDisabled, getOptionLabel, getOptionIsPartiallySelected, getOptionIsSelected, getOptionValue, onScrollBottom, onOpenChange, header, loading, multiple, onChange, onManualSort, onUnselectAll, onSelectAll, options: sourceOptions, placeholder, preset, presetProps, search, selectionStyle, setOptionGroup, sort, tabIndex, value: value_, overlayMatchesTriggerWidth, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy, }: SuperSelectConfig): SuperSelectApi;
|
|
4
4
|
export declare const SuperSelectContext: React.Context<SuperSelectApi | null>;
|
|
5
5
|
export declare function useSuperSelectContext(): SuperSelectApi;
|
|
@@ -65,48 +65,17 @@ function useTokenNavigation(context) {
|
|
|
65
65
|
enabled = _ref$enabled === void 0 ? true : _ref$enabled,
|
|
66
66
|
_ref$value = _ref.value,
|
|
67
67
|
value = _ref$value === void 0 ? [] : _ref$value,
|
|
68
|
-
|
|
69
|
-
activeIndex = _ref$activeIndex === void 0 ? null : _ref$activeIndex,
|
|
70
|
-
_ref$onNavigate = _ref.onNavigate,
|
|
71
|
-
onNavigate = _ref$onNavigate === void 0 ? noop : _ref$onNavigate,
|
|
72
|
-
_ref$onChange = _ref.onChange,
|
|
73
|
-
onChange = _ref$onChange === void 0 ? noop : _ref$onChange;
|
|
68
|
+
tokenRemoveRefs = _ref.tokenRemoveRefs;
|
|
74
69
|
return {
|
|
75
70
|
reference: {
|
|
76
71
|
onKeyDown: function onKeyDown(e) {
|
|
77
|
-
if (!enabled || !Array.isArray(value)) {
|
|
72
|
+
if (!enabled || !Array.isArray(value) || value.length === 0) {
|
|
78
73
|
return;
|
|
79
74
|
}
|
|
80
75
|
if (e.key === 'ArrowLeft') {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
onNavigate(value.length - 1);
|
|
85
|
-
}
|
|
86
|
-
} else if (e.key === 'ArrowRight') {
|
|
87
|
-
if (activeIndex !== null) {
|
|
88
|
-
if (activeIndex === value.length - 1) {
|
|
89
|
-
onNavigate(null);
|
|
90
|
-
} else {
|
|
91
|
-
onNavigate(activeIndex + 1);
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
} else if (e.key === 'Backspace') {
|
|
95
|
-
if (!e.repeat) {
|
|
96
|
-
if (activeIndex !== null) {
|
|
97
|
-
var nextVal = value.filter(function (_, i) {
|
|
98
|
-
return i !== activeIndex;
|
|
99
|
-
});
|
|
100
|
-
onChange(nextVal);
|
|
101
|
-
if (activeIndex >= nextVal.length) {
|
|
102
|
-
onNavigate(null);
|
|
103
|
-
}
|
|
104
|
-
} else if (value.length > 0) {
|
|
105
|
-
onChange(value.filter(function (_, i) {
|
|
106
|
-
return i !== value.length - 1;
|
|
107
|
-
}));
|
|
108
|
-
}
|
|
109
|
-
}
|
|
76
|
+
var _tokenRemoveRefs$curr;
|
|
77
|
+
e.preventDefault();
|
|
78
|
+
tokenRemoveRefs === null || tokenRemoveRefs === void 0 ? void 0 : (_tokenRemoveRefs$curr = tokenRemoveRefs.current[value.length - 1]) === null || _tokenRemoveRefs$curr === void 0 ? void 0 : _tokenRemoveRefs$curr.focus();
|
|
110
79
|
}
|
|
111
80
|
}
|
|
112
81
|
}
|
|
@@ -195,7 +164,8 @@ export function useSuperSelect(_ref3) {
|
|
|
195
164
|
value_ = _ref3.value,
|
|
196
165
|
_ref3$overlayMatchesT = _ref3.overlayMatchesTriggerWidth,
|
|
197
166
|
overlayMatchesTriggerWidth = _ref3$overlayMatchesT === void 0 ? true : _ref3$overlayMatchesT,
|
|
198
|
-
ariaLabel = _ref3['aria-label']
|
|
167
|
+
ariaLabel = _ref3['aria-label'],
|
|
168
|
+
ariaLabelledBy = _ref3['aria-labelledby'];
|
|
199
169
|
React.useEffect(function () {
|
|
200
170
|
if (!draggable) {
|
|
201
171
|
return;
|
|
@@ -386,7 +356,8 @@ export function useSuperSelect(_ref3) {
|
|
|
386
356
|
var searchRef = React.useRef(null);
|
|
387
357
|
var overlayId = useId(); // TODO use React 18 useId
|
|
388
358
|
var listId = useId(); // TODO use React 18 useId
|
|
389
|
-
|
|
359
|
+
var selectedValueId = useId();
|
|
360
|
+
var tokenListId = useId();
|
|
390
361
|
var _React$useState5 = React.useState(false),
|
|
391
362
|
_React$useState6 = _slicedToArray(_React$useState5, 2),
|
|
392
363
|
open = _React$useState6[0],
|
|
@@ -426,10 +397,7 @@ export function useSuperSelect(_ref3) {
|
|
|
426
397
|
_React$useState20 = _slicedToArray(_React$useState19, 2),
|
|
427
398
|
activeMenuIndex = _React$useState20[0],
|
|
428
399
|
setActiveMenuIndex = _React$useState20[1];
|
|
429
|
-
var
|
|
430
|
-
_React$useState22 = _slicedToArray(_React$useState21, 2),
|
|
431
|
-
activeTokenIndex = _React$useState22[0],
|
|
432
|
-
setActiveTokenIndex = _React$useState22[1];
|
|
400
|
+
var tokenRemoveRefs = React.useRef([]);
|
|
433
401
|
var components = _objectSpread(_objectSpread({}, defaultComponents), customComponents || {});
|
|
434
402
|
|
|
435
403
|
// TODO #memogetters: consider having getOption... getter functions memoized by consumers
|
|
@@ -573,10 +541,10 @@ export function useSuperSelect(_ref3) {
|
|
|
573
541
|
}
|
|
574
542
|
return [selectAllOption].concat(_toConsumableArray(options));
|
|
575
543
|
}, [selectAllEnabled, multiple, selectAllOption, options]);
|
|
576
|
-
var _React$
|
|
577
|
-
_React$
|
|
578
|
-
draggableOptions = _React$
|
|
579
|
-
setDraggableOptions = _React$
|
|
544
|
+
var _React$useState21 = React.useState([]),
|
|
545
|
+
_React$useState22 = _slicedToArray(_React$useState21, 2),
|
|
546
|
+
draggableOptions = _React$useState22[0],
|
|
547
|
+
setDraggableOptions = _React$useState22[1];
|
|
580
548
|
React.useEffect(function () {
|
|
581
549
|
if (!draggable) {
|
|
582
550
|
return;
|
|
@@ -846,9 +814,15 @@ export function useSuperSelect(_ref3) {
|
|
|
846
814
|
}, [open]);
|
|
847
815
|
var floating = useFloating({
|
|
848
816
|
open: open,
|
|
849
|
-
onOpenChange: function onOpenChange(
|
|
850
|
-
setOpen(
|
|
851
|
-
_onOpenChange(
|
|
817
|
+
onOpenChange: function onOpenChange(nextOpen) {
|
|
818
|
+
setOpen(nextOpen);
|
|
819
|
+
_onOpenChange(nextOpen);
|
|
820
|
+
if (!nextOpen && multiple) {
|
|
821
|
+
requestAnimationFrame(function () {
|
|
822
|
+
var _searchRef$current;
|
|
823
|
+
(_searchRef$current = searchRef.current) === null || _searchRef$current === void 0 ? void 0 : _searchRef$current.focus();
|
|
824
|
+
});
|
|
825
|
+
}
|
|
852
826
|
},
|
|
853
827
|
whileElementsMounted: function whileElementsMounted() {
|
|
854
828
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
@@ -884,6 +858,21 @@ export function useSuperSelect(_ref3) {
|
|
|
884
858
|
});
|
|
885
859
|
var _useZIndexContext = useZIndexContext(),
|
|
886
860
|
zIndex = _useZIndexContext.value;
|
|
861
|
+
var activeDescendantId = React.useMemo(function () {
|
|
862
|
+
if (activeMenuIndex === null) return undefined;
|
|
863
|
+
var baseOptions = selectAllEnabled && multiple ? allOptionsWithSelectAll : options;
|
|
864
|
+
var option = baseOptions[activeMenuIndex];
|
|
865
|
+
if (!option) return undefined;
|
|
866
|
+
if (getOptionIsOptSelectAll(option)) return "item-".concat(selectAllOption.id);
|
|
867
|
+
return "item-".concat(getOptionValue(option));
|
|
868
|
+
}, [activeMenuIndex, selectAllEnabled, multiple, allOptionsWithSelectAll, options, selectAllOption]);
|
|
869
|
+
function getAriaLabelProps() {
|
|
870
|
+
return _objectSpread(_objectSpread({}, ariaLabel && {
|
|
871
|
+
'aria-label': ariaLabel
|
|
872
|
+
}), ariaLabelledBy && {
|
|
873
|
+
'aria-labelledby': ariaLabelledBy
|
|
874
|
+
});
|
|
875
|
+
}
|
|
887
876
|
var _useInteractions = useInteractions([useClick(floating.context, {
|
|
888
877
|
enabled: !disabled,
|
|
889
878
|
keyboardHandlers: false
|
|
@@ -903,14 +892,8 @@ export function useSuperSelect(_ref3) {
|
|
|
903
892
|
selectedIndex: selectedIndex,
|
|
904
893
|
virtual: true
|
|
905
894
|
}), useTokenNavigation(floating.context, {
|
|
906
|
-
activeIndex: activeTokenIndex,
|
|
907
895
|
enabled: !disabled && multiple && searchValue === '',
|
|
908
|
-
|
|
909
|
-
onNavigate: function onNavigate(i) {
|
|
910
|
-
return setActiveTokenIndex(function () {
|
|
911
|
-
return i;
|
|
912
|
-
});
|
|
913
|
-
},
|
|
896
|
+
tokenRemoveRefs: tokenRemoveRefs,
|
|
914
897
|
value: value
|
|
915
898
|
}), useKeyboardSelection(floating.context, {
|
|
916
899
|
enabled: !disabled,
|
|
@@ -925,22 +908,24 @@ export function useSuperSelect(_ref3) {
|
|
|
925
908
|
$multiple: multiple,
|
|
926
909
|
$open: open,
|
|
927
910
|
$placeholder: !selectedLabel,
|
|
928
|
-
'aria-
|
|
911
|
+
'aria-activedescendant': multiple ? undefined : activeDescendantId
|
|
912
|
+
}, !multiple && _objectSpread(_objectSpread({
|
|
913
|
+
'aria-controls': open ? overlayId : undefined,
|
|
914
|
+
'aria-describedby': selectedValueId,
|
|
929
915
|
'aria-expanded': open,
|
|
930
|
-
'aria-haspopup':
|
|
931
|
-
},
|
|
932
|
-
'
|
|
933
|
-
|
|
916
|
+
'aria-haspopup': 'listbox'
|
|
917
|
+
}, getAriaLabelProps()), {}, {
|
|
918
|
+
role: 'button',
|
|
919
|
+
tabIndex: disabled ? -1 : tabIndex
|
|
920
|
+
})), {}, {
|
|
934
921
|
onKeyDown: function onKeyDown() {
|
|
935
922
|
setPointer(false);
|
|
936
923
|
},
|
|
937
|
-
|
|
938
|
-
search: search,
|
|
939
|
-
tabIndex: disabled ? -1 : tabIndex
|
|
924
|
+
search: search
|
|
940
925
|
}),
|
|
941
926
|
// TODO fix type
|
|
942
927
|
floating: {
|
|
943
|
-
role: search ? '
|
|
928
|
+
role: search ? 'listbox' : 'none',
|
|
944
929
|
id: overlayId,
|
|
945
930
|
onKeyDown: function onKeyDown() {
|
|
946
931
|
setPointer(false);
|
|
@@ -963,15 +948,23 @@ export function useSuperSelect(_ref3) {
|
|
|
963
948
|
getItemProps = _useInteractions.getItemProps;
|
|
964
949
|
function getLabelProps() {
|
|
965
950
|
return {
|
|
966
|
-
$hoverable: false
|
|
951
|
+
$hoverable: false,
|
|
952
|
+
id: selectedValueId
|
|
967
953
|
};
|
|
968
954
|
}
|
|
969
955
|
function getMultiInputProps() {
|
|
970
|
-
|
|
956
|
+
var showPlaceholder = isEmpty();
|
|
957
|
+
return _objectSpread(_objectSpread({
|
|
958
|
+
'aria-activedescendant': activeDescendantId,
|
|
959
|
+
'aria-controls': open ? overlayId : undefined,
|
|
960
|
+
'aria-expanded': open,
|
|
961
|
+
'aria-haspopup': 'listbox'
|
|
962
|
+
}, getAriaLabelProps()), {}, {
|
|
963
|
+
role: 'combobox',
|
|
971
964
|
ref: searchRef,
|
|
972
|
-
|
|
965
|
+
tabIndex: disabled ? -1 : tabIndex,
|
|
966
|
+
placeholder: showPlaceholder ? placeholder : '',
|
|
973
967
|
disabled: disabled,
|
|
974
|
-
'aria-controls': listId,
|
|
975
968
|
onKeyDown: function onKeyDown(e) {
|
|
976
969
|
if (e.key === 'Tab') {
|
|
977
970
|
if (open) {
|
|
@@ -981,25 +974,59 @@ export function useSuperSelect(_ref3) {
|
|
|
981
974
|
(_floating$refs$floati = floating.refs.floating.current) === null || _floating$refs$floati === void 0 ? void 0 : _floating$refs$floati.focus();
|
|
982
975
|
}
|
|
983
976
|
}
|
|
984
|
-
},
|
|
985
|
-
onChange: function onChange(e) {
|
|
986
|
-
setSearchValue(e.currentTarget.value);
|
|
987
|
-
setActiveTokenIndex(null);
|
|
988
|
-
},
|
|
989
|
-
style: {
|
|
990
|
-
opacity: activeTokenIndex === null ? 1 : 0
|
|
991
977
|
}
|
|
992
|
-
};
|
|
978
|
+
});
|
|
993
979
|
}
|
|
994
980
|
function getMultiValueProps(index) {
|
|
981
|
+
function removeToken() {
|
|
982
|
+
if (!isMultiple(multiple, value)) return;
|
|
983
|
+
var nextVal = value.filter(function (_, i) {
|
|
984
|
+
return i !== index;
|
|
985
|
+
});
|
|
986
|
+
setValue(nextVal);
|
|
987
|
+
requestAnimationFrame(function () {
|
|
988
|
+
if (nextVal.length === 0) {
|
|
989
|
+
var _searchRef$current2;
|
|
990
|
+
(_searchRef$current2 = searchRef.current) === null || _searchRef$current2 === void 0 ? void 0 : _searchRef$current2.focus();
|
|
991
|
+
} else if (index >= nextVal.length) {
|
|
992
|
+
var _tokenRemoveRefs$curr2;
|
|
993
|
+
(_tokenRemoveRefs$curr2 = tokenRemoveRefs.current[nextVal.length - 1]) === null || _tokenRemoveRefs$curr2 === void 0 ? void 0 : _tokenRemoveRefs$curr2.focus();
|
|
994
|
+
} else {
|
|
995
|
+
var _tokenRemoveRefs$curr3;
|
|
996
|
+
(_tokenRemoveRefs$curr3 = tokenRemoveRefs.current[index]) === null || _tokenRemoveRefs$curr3 === void 0 ? void 0 : _tokenRemoveRefs$curr3.focus();
|
|
997
|
+
}
|
|
998
|
+
});
|
|
999
|
+
}
|
|
995
1000
|
return {
|
|
1001
|
+
ref: function ref(el) {
|
|
1002
|
+
tokenRemoveRefs.current[index] = el;
|
|
1003
|
+
},
|
|
996
1004
|
onClick: function onClick(e) {
|
|
997
|
-
// prevent the menu from closing
|
|
998
1005
|
e.stopPropagation();
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1006
|
+
removeToken();
|
|
1007
|
+
},
|
|
1008
|
+
onKeyDown: function onKeyDown(e) {
|
|
1009
|
+
if (e.key === 'Enter' || e.key === 'Backspace' || e.key === 'Delete') {
|
|
1010
|
+
e.preventDefault();
|
|
1011
|
+
e.stopPropagation();
|
|
1012
|
+
removeToken();
|
|
1013
|
+
} else if (e.key === 'ArrowLeft') {
|
|
1014
|
+
e.preventDefault();
|
|
1015
|
+
e.stopPropagation();
|
|
1016
|
+
if (index > 0) {
|
|
1017
|
+
var _tokenRemoveRefs$curr4;
|
|
1018
|
+
(_tokenRemoveRefs$curr4 = tokenRemoveRefs.current[index - 1]) === null || _tokenRemoveRefs$curr4 === void 0 ? void 0 : _tokenRemoveRefs$curr4.focus();
|
|
1019
|
+
}
|
|
1020
|
+
} else if (e.key === 'ArrowRight') {
|
|
1021
|
+
e.preventDefault();
|
|
1022
|
+
e.stopPropagation();
|
|
1023
|
+
if (isMultiple(multiple, value) && index < value.length - 1) {
|
|
1024
|
+
var _tokenRemoveRefs$curr5;
|
|
1025
|
+
(_tokenRemoveRefs$curr5 = tokenRemoveRefs.current[index + 1]) === null || _tokenRemoveRefs$curr5 === void 0 ? void 0 : _tokenRemoveRefs$curr5.focus();
|
|
1026
|
+
} else {
|
|
1027
|
+
var _searchRef$current3;
|
|
1028
|
+
(_searchRef$current3 = searchRef.current) === null || _searchRef$current3 === void 0 ? void 0 : _searchRef$current3.focus();
|
|
1029
|
+
}
|
|
1003
1030
|
}
|
|
1004
1031
|
}
|
|
1005
1032
|
};
|
|
@@ -1014,12 +1041,15 @@ export function useSuperSelect(_ref3) {
|
|
|
1014
1041
|
}
|
|
1015
1042
|
function getSearchProps() {
|
|
1016
1043
|
return {
|
|
1044
|
+
'aria-activedescendant': activeDescendantId,
|
|
1017
1045
|
'aria-controls': listId,
|
|
1046
|
+
'aria-expanded': open,
|
|
1047
|
+
'aria-haspopup': 'listbox',
|
|
1018
1048
|
onChange: function onChange(value) {
|
|
1019
1049
|
setSearchValue(value);
|
|
1020
|
-
setActiveTokenIndex(null);
|
|
1021
1050
|
},
|
|
1022
|
-
placeholder: i18n.t('core.select.search')
|
|
1051
|
+
placeholder: i18n.t('core.select.search'),
|
|
1052
|
+
role: 'combobox'
|
|
1023
1053
|
};
|
|
1024
1054
|
}
|
|
1025
1055
|
function getHeaderProps() {
|
|
@@ -1049,10 +1079,10 @@ export function useSuperSelect(_ref3) {
|
|
|
1049
1079
|
return {
|
|
1050
1080
|
'aria-hidden': true,
|
|
1051
1081
|
'aria-label': i18n.t('core.select.clear'),
|
|
1082
|
+
tabIndex: -1,
|
|
1052
1083
|
onClick: function onClick(e) {
|
|
1053
1084
|
// prevent the menu from closing
|
|
1054
1085
|
e.stopPropagation();
|
|
1055
|
-
setActiveTokenIndex(null);
|
|
1056
1086
|
setValue(multiple ? [] : null);
|
|
1057
1087
|
setOpen(true);
|
|
1058
1088
|
}
|
|
@@ -1074,7 +1104,7 @@ export function useSuperSelect(_ref3) {
|
|
|
1074
1104
|
};
|
|
1075
1105
|
return {
|
|
1076
1106
|
role: 'listbox',
|
|
1077
|
-
id:
|
|
1107
|
+
id: listId,
|
|
1078
1108
|
data: draggable ? queriedDraggableOptions : options,
|
|
1079
1109
|
components: {
|
|
1080
1110
|
Item: components === null || components === void 0 ? void 0 : components.Item // TODO fix type
|
|
@@ -1135,9 +1165,6 @@ export function useSuperSelect(_ref3) {
|
|
|
1135
1165
|
setSearchValue(function () {
|
|
1136
1166
|
return '';
|
|
1137
1167
|
});
|
|
1138
|
-
setActiveTokenIndex(function () {
|
|
1139
|
-
return null;
|
|
1140
|
-
});
|
|
1141
1168
|
}
|
|
1142
1169
|
}, [open]);
|
|
1143
1170
|
|
|
@@ -1210,12 +1237,12 @@ export function useSuperSelect(_ref3) {
|
|
|
1210
1237
|
components: components,
|
|
1211
1238
|
state: {
|
|
1212
1239
|
activeMenuIndex: activeMenuIndex,
|
|
1213
|
-
activeTokenIndex: activeTokenIndex,
|
|
1214
1240
|
isEmpty: isEmpty,
|
|
1215
1241
|
isSelectAllActive: isSelectAllActive,
|
|
1216
1242
|
listContainerHeight: listContainerHeight,
|
|
1217
1243
|
listId: listId,
|
|
1218
1244
|
maxHeight: maxHeight,
|
|
1245
|
+
tokenListId: tokenListId,
|
|
1219
1246
|
onDragEnd: onDragEnd,
|
|
1220
1247
|
onSelect: onSelect,
|
|
1221
1248
|
onSelectAll: onSelectAll,
|