@juspay/blend-design-system 0.0.37-beta.7 → 0.0.37
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/dist/{node-C_DmV86X.js → breadcrumbV2.tokens-CovJEwot.js} +16 -0
- package/dist/components/Accordion/index.d.ts +2 -0
- package/dist/components/AccordionV2/accordionV2.animations.d.ts +1 -1
- package/dist/components/Alert/index.d.ts +1 -0
- package/dist/components/Avatar/index.d.ts +1 -0
- package/dist/components/Breadcrumb/index.d.ts +1 -0
- package/dist/components/Button/index.d.ts +1 -0
- package/dist/components/ButtonGroup/index.d.ts +1 -0
- package/dist/components/Card/index.d.ts +1 -0
- package/dist/components/CardV2/CardV2.d.ts +45 -0
- package/dist/components/CardV2/CardV2.utils.d.ts +14 -0
- package/dist/components/CardV2/CardV2Components.d.ts +8 -0
- package/dist/components/CardV2/CardV2Context.d.ts +14 -0
- package/dist/components/CardV2/CardV2Skeleton.d.ts +6 -0
- package/dist/components/CardV2/accessibility/CardV2AccessibilityReport.d.ts +2 -0
- package/dist/components/CardV2/accessibility/index.d.ts +1 -0
- package/dist/components/CardV2/cardV2.dark.tokens.d.ts +3 -0
- package/dist/components/CardV2/cardV2.light.tokens.d.ts +3 -0
- package/dist/components/CardV2/cardV2.tokens.d.ts +5 -0
- package/dist/components/CardV2/cardV2.tokens.types.d.ts +92 -0
- package/dist/components/CardV2/cardV2.types.d.ts +106 -0
- package/dist/components/CardV2/index.d.ts +5 -0
- package/dist/components/Charts/index.d.ts +10 -0
- package/dist/components/Charts/types.d.ts +2 -0
- package/dist/components/ChatInput/index.d.ts +1 -0
- package/dist/components/Checkbox/index.d.ts +1 -0
- package/dist/components/CodeEditor/index.d.ts +1 -0
- package/dist/components/CodeEditor/types.d.ts +22 -2
- package/dist/components/CodeEditorV2/CodeEditorV2.d.ts +1 -1
- package/dist/components/CodeEditorV2/codeEditorV2.types.d.ts +23 -2
- package/dist/components/DataTable/PivotTableModal/pivotModal.styled.d.ts +184 -0
- package/dist/components/DataTable/TableBody/types.d.ts +3 -1
- package/dist/components/DataTable/hooks/index.d.ts +2 -0
- package/dist/components/DataTable/hooks/useReducedMotion.d.ts +1 -0
- package/dist/components/DataTable/hooks/useRowFlip.d.ts +6 -0
- package/dist/components/DataTable/types.d.ts +26 -0
- package/dist/components/DateRangePicker/CalendarGrid.d.ts +5 -2
- package/dist/components/DateRangePicker/types.d.ts +3 -1
- package/dist/components/DateRangePicker/utils.d.ts +5 -5
- package/dist/components/Directory/Directory.d.ts +1 -1
- package/dist/components/Directory/NavItem.d.ts +1 -1
- package/dist/components/Directory/Section.d.ts +1 -1
- package/dist/components/Directory/VirtualizedDirectory.d.ts +3 -0
- package/dist/components/Directory/directory.tokens.d.ts +7 -0
- package/dist/components/Directory/types.d.ts +38 -1
- package/dist/components/Directory/utils.d.ts +3 -1
- package/dist/components/Drawer/index.d.ts +1 -0
- package/dist/components/Inputs/MultiValueInput/index.d.ts +1 -0
- package/dist/components/Inputs/NumberInput/index.d.ts +1 -0
- package/dist/components/Inputs/OTPInput/index.d.ts +1 -0
- package/dist/components/Inputs/SearchInput/index.d.ts +1 -0
- package/dist/components/Inputs/TextArea/index.d.ts +1 -0
- package/dist/components/Inputs/TextInput/index.d.ts +1 -0
- package/dist/components/InputsV2/TextAreaV2/utils.d.ts +2 -1
- package/dist/components/InputsV2/TextInputV2/utils.d.ts +2 -1
- package/dist/components/InputsV2/UploadV2/UploadContainerV2.d.ts +24 -0
- package/dist/components/InputsV2/UploadV2/UploadV2.d.ts +31 -0
- package/dist/components/InputsV2/UploadV2/UploadV2.dark.tokens.d.ts +3 -0
- package/dist/components/InputsV2/UploadV2/UploadV2.light.tokens.d.ts +3 -0
- package/dist/components/InputsV2/UploadV2/UploadV2.tokens.d.ts +5 -0
- package/dist/components/InputsV2/UploadV2/UploadV2.tokens.types.d.ts +115 -0
- package/dist/components/InputsV2/UploadV2/UploadV2.types.d.ts +56 -0
- package/dist/components/InputsV2/UploadV2/index.d.ts +3 -0
- package/dist/components/InputsV2/UploadV2/utils.d.ts +32 -0
- package/dist/components/KeyValuePair/index.d.ts +1 -0
- package/dist/components/Menu/Menu.d.ts +1 -1
- package/dist/components/Menu/index.d.ts +1 -0
- package/dist/components/Menu/types.d.ts +7 -0
- package/dist/components/Menu/utils.d.ts +10 -2
- package/dist/components/MenuV2/MenuV2Content.d.ts +1 -0
- package/dist/components/MenuV2/menuV2.types.d.ts +5 -0
- package/dist/components/MenuV2/menuV2.utils.d.ts +10 -2
- package/dist/components/Modal/index.d.ts +1 -0
- package/dist/components/ModalV2/ModalV2.d.ts +22 -0
- package/dist/components/ModalV2/ModalV2Footer.d.ts +10 -0
- package/dist/components/ModalV2/ModalV2Header.d.ts +15 -0
- package/dist/components/ModalV2/ModalV2Skeleton.d.ts +4 -0
- package/dist/components/ModalV2/index.d.ts +4 -0
- package/dist/components/ModalV2/mobileModalV2.d.ts +23 -0
- package/dist/components/ModalV2/modalAnimationV2.d.ts +3 -0
- package/dist/components/ModalV2/modalV2.dark.tokens.d.ts +3 -0
- package/dist/components/ModalV2/modalV2.light.tokens.d.ts +3 -0
- package/dist/components/ModalV2/modalV2.tokens.d.ts +5 -0
- package/dist/components/ModalV2/modalV2.tokens.types.d.ts +91 -0
- package/dist/components/ModalV2/modalV2.types.d.ts +66 -0
- package/dist/components/MultiSelect/MultiSelect.d.ts +1 -1
- package/dist/components/MultiSelect/MultiSelectMenu.d.ts +1 -1
- package/dist/components/MultiSelect/index.d.ts +2 -0
- package/dist/components/MultiSelect/types.d.ts +2 -0
- package/dist/components/MultiSelectV2/MultiSelectV2.d.ts +1 -1
- package/dist/components/MultiSelectV2/MultiSelectV2Menu.d.ts +1 -1
- package/dist/components/MultiSelectV2/multiSelectV2.types.d.ts +2 -0
- package/dist/components/Popover/index.d.ts +1 -0
- package/dist/components/Primitives/Block/Block.d.ts +1 -1
- package/dist/components/ProgressBar/index.d.ts +1 -0
- package/dist/components/Radio/index.d.ts +2 -0
- package/dist/components/Sidebar/SidebarContent.d.ts +9 -1
- package/dist/components/Sidebar/index.d.ts +1 -0
- package/dist/components/Sidebar/types.d.ts +9 -1
- package/dist/components/SidebarV2/SidebarV2Panel.d.ts +10 -2
- package/dist/components/SidebarV2/types.d.ts +9 -1
- package/dist/components/SingleSelect/SingleSelect.d.ts +1 -1
- package/dist/components/SingleSelect/SingleSelectMenu.d.ts +2 -1
- package/dist/components/SingleSelect/index.d.ts +1 -0
- package/dist/components/SingleSelect/types.d.ts +1 -0
- package/dist/components/SingleSelectV2/SingleSelectV2.d.ts +1 -1
- package/dist/components/SingleSelectV2/SingleSelectV2Menu.d.ts +1 -1
- package/dist/components/SingleSelectV2/singleSelectV2.tokens.types.d.ts +8 -0
- package/dist/components/SingleSelectV2/singleSelectV2.types.d.ts +2 -0
- package/dist/components/Skeleton/SkeletonCompound.d.ts +24 -33
- package/dist/components/Snackbar/Snackbar.d.ts +1 -1
- package/dist/components/Snackbar/index.d.ts +2 -0
- package/dist/components/Snackbar/snackbar.tokens.d.ts +1 -0
- package/dist/components/Snackbar/types.d.ts +2 -0
- package/dist/components/StatCard/index.d.ts +1 -0
- package/dist/components/Stepper/index.d.ts +1 -0
- package/dist/components/Switch/index.d.ts +2 -0
- package/dist/components/Tabs/index.d.ts +1 -0
- package/dist/components/Tags/index.d.ts +1 -0
- package/dist/components/Timeline/Timeline.d.ts +13 -37
- package/dist/components/Tooltip/index.d.ts +1 -0
- package/dist/components/Topbar/index.d.ts +1 -0
- package/dist/components/Upload/index.d.ts +1 -0
- package/dist/context/ThemeContext.d.ts +6 -0
- package/dist/context/useComponentToken.d.ts +4 -1
- package/dist/main.d.ts +6 -0
- package/dist/main.js +45436 -42186
- package/dist/node-B3rrXW84.js +1023 -0
- package/dist/node.d.ts +2 -0
- package/dist/node.js +21 -18
- package/dist/{tokens.js → token-engine.js} +1 -1
- package/lib/components/Accordion/AccordionItem.tsx +2 -6
- package/lib/components/Accordion/index.ts +2 -0
- package/lib/components/AccordionV2/AccordionV2Item.tsx +1 -1
- package/lib/components/AccordionV2/accordionV2.animations.ts +1 -5
- package/lib/components/Alert/index.ts +1 -0
- package/lib/components/Avatar/index.ts +1 -0
- package/lib/components/Breadcrumb/index.ts +1 -0
- package/lib/components/Button/index.ts +1 -0
- package/lib/components/ButtonGroup/index.ts +1 -0
- package/lib/components/Card/index.ts +1 -0
- package/lib/components/CardV2/CardV2.tsx +327 -0
- package/lib/components/CardV2/CardV2.utils.tsx +77 -0
- package/lib/components/CardV2/CardV2Components.tsx +297 -0
- package/lib/components/CardV2/CardV2Context.tsx +18 -0
- package/lib/components/CardV2/CardV2Skeleton.tsx +40 -0
- package/lib/components/CardV2/accessibility/CardV2AccessibilityReport.ts +284 -0
- package/lib/components/CardV2/accessibility/index.ts +1 -0
- package/lib/components/CardV2/cardV2.dark.tokens.ts +177 -0
- package/lib/components/CardV2/cardV2.light.tokens.ts +177 -0
- package/lib/components/CardV2/cardV2.tokens.ts +21 -0
- package/lib/components/CardV2/cardV2.tokens.types.ts +94 -0
- package/lib/components/CardV2/cardV2.types.ts +131 -0
- package/lib/components/CardV2/index.ts +13 -0
- package/lib/components/Charts/ChartLegend.tsx +25 -5
- package/lib/components/Charts/Charts.tsx +10 -0
- package/lib/components/Charts/index.ts +10 -0
- package/lib/components/Charts/types.tsx +2 -0
- package/lib/components/ChatInput/index.tsx +1 -0
- package/lib/components/Checkbox/index.ts +1 -0
- package/lib/components/CodeEditor/MonacoEditorWrapper.tsx +6 -2
- package/lib/components/CodeEditor/index.ts +1 -0
- package/lib/components/CodeEditor/types.ts +52 -2
- package/lib/components/CodeEditorV2/MonacoEditor/MonacoEditorWrapper.tsx +6 -2
- package/lib/components/CodeEditorV2/codeEditorV2.types.ts +44 -5
- package/lib/components/DataTable/DataTable.tsx +8 -0
- package/lib/components/DataTable/TableBody/index.tsx +47 -11
- package/lib/components/DataTable/TableBody/types.ts +7 -1
- package/lib/components/DataTable/TableCell/index.tsx +1 -1
- package/lib/components/DataTable/hooks/index.ts +2 -0
- package/lib/components/DataTable/hooks/useReducedMotion.ts +19 -0
- package/lib/components/DataTable/hooks/useRowFlip.ts +170 -0
- package/lib/components/DataTable/types.ts +32 -0
- package/lib/components/DateRangePicker/CalendarGrid.tsx +39 -6
- package/lib/components/DateRangePicker/DateRangePicker.tsx +27 -4
- package/lib/components/DateRangePicker/types.ts +6 -1
- package/lib/components/DateRangePicker/utils.ts +123 -12
- package/lib/components/Directory/Directory.tsx +31 -0
- package/lib/components/Directory/NavItem.tsx +177 -86
- package/lib/components/Directory/Section.tsx +9 -0
- package/lib/components/Directory/VirtualizedDirectory.tsx +670 -0
- package/lib/components/Directory/directory.tokens.ts +21 -0
- package/lib/components/Directory/types.ts +43 -1
- package/lib/components/Directory/utils.ts +81 -1
- package/lib/components/Drawer/index.ts +1 -0
- package/lib/components/Inputs/DropdownInput/DropdownInput.tsx +6 -2
- package/lib/components/Inputs/MultiValueInput/index.ts +1 -0
- package/lib/components/Inputs/NumberInput/NumberInput.tsx +6 -2
- package/lib/components/Inputs/NumberInput/index.ts +1 -0
- package/lib/components/Inputs/OTPInput/index.ts +1 -0
- package/lib/components/Inputs/SearchInput/index.ts +1 -0
- package/lib/components/Inputs/TextArea/TextArea.tsx +4 -2
- package/lib/components/Inputs/TextArea/index.ts +1 -0
- package/lib/components/Inputs/TextInput/TextInput.tsx +6 -2
- package/lib/components/Inputs/TextInput/index.ts +1 -0
- package/lib/components/Inputs/UnitInput/UnitInput.tsx +6 -2
- package/lib/components/InputsV2/NumberInputV2/NumberInputV2.tsx +6 -2
- package/lib/components/InputsV2/TextAreaV2/TextAreaV2.tsx +2 -1
- package/lib/components/InputsV2/TextAreaV2/utils.ts +3 -1
- package/lib/components/InputsV2/TextInputV2/TextInputV2.tsx +1 -0
- package/lib/components/InputsV2/TextInputV2/utils.ts +6 -8
- package/lib/components/InputsV2/UploadV2/UploadContainerV2.tsx +470 -0
- package/lib/components/InputsV2/UploadV2/UploadV2.dark.tokens.ts +348 -0
- package/lib/components/InputsV2/UploadV2/UploadV2.light.tokens.ts +348 -0
- package/lib/components/InputsV2/UploadV2/UploadV2.tokens.ts +20 -0
- package/lib/components/InputsV2/UploadV2/UploadV2.tokens.types.ts +117 -0
- package/lib/components/InputsV2/UploadV2/UploadV2.tsx +336 -0
- package/lib/components/InputsV2/UploadV2/UploadV2.types.ts +67 -0
- package/lib/components/InputsV2/UploadV2/index.ts +3 -0
- package/lib/components/InputsV2/UploadV2/utils.ts +170 -0
- package/lib/components/KeyValuePair/index.ts +1 -0
- package/lib/components/Menu/Menu.tsx +18 -2
- package/lib/components/Menu/SubMenu.tsx +25 -3
- package/lib/components/Menu/index.ts +1 -0
- package/lib/components/Menu/types.tsx +14 -0
- package/lib/components/Menu/utils.ts +46 -3
- package/lib/components/MenuV2/MenuV2.tsx +9 -2
- package/lib/components/MenuV2/MenuV2Content.tsx +6 -0
- package/lib/components/MenuV2/MenuV2SubMenu.tsx +16 -2
- package/lib/components/MenuV2/menuV2.types.ts +11 -0
- package/lib/components/MenuV2/menuV2.utils.ts +45 -3
- package/lib/components/Modal/index.ts +1 -0
- package/lib/components/ModalV2/ModalV2.tsx +269 -0
- package/lib/components/ModalV2/ModalV2Footer.tsx +76 -0
- package/lib/components/ModalV2/ModalV2Header.tsx +144 -0
- package/lib/components/ModalV2/ModalV2Skeleton.tsx +80 -0
- package/lib/components/ModalV2/index.ts +4 -0
- package/lib/components/ModalV2/mobileModalV2.tsx +411 -0
- package/lib/components/ModalV2/modalAnimationV2.tsx +19 -0
- package/lib/components/ModalV2/modalV2.dark.tokens.ts +183 -0
- package/lib/components/ModalV2/modalV2.light.tokens.ts +183 -0
- package/lib/components/ModalV2/modalV2.tokens.ts +21 -0
- package/lib/components/ModalV2/modalV2.tokens.types.ts +94 -0
- package/lib/components/ModalV2/modalV2.types.ts +80 -0
- package/lib/components/MultiSelect/MultiSelect.tsx +4 -1
- package/lib/components/MultiSelect/MultiSelectMenu.tsx +8 -0
- package/lib/components/MultiSelect/MultiSelectTrigger.tsx +2 -1
- package/lib/components/MultiSelect/index.ts +2 -0
- package/lib/components/MultiSelect/types.ts +2 -0
- package/lib/components/MultiSelectV2/MultiSelectV2.tsx +2 -0
- package/lib/components/MultiSelectV2/MultiSelectV2Menu.tsx +8 -0
- package/lib/components/MultiSelectV2/MultiSelectV2Trigger.tsx +4 -1
- package/lib/components/MultiSelectV2/multiSelectV2.types.ts +2 -0
- package/lib/components/Popover/index.ts +1 -0
- package/lib/components/Primitives/Block/Block.tsx +1 -1
- package/lib/components/ProgressBar/index.ts +1 -0
- package/lib/components/Radio/index.ts +2 -0
- package/lib/components/Sidebar/Sidebar.tsx +38 -0
- package/lib/components/Sidebar/SidebarContent.tsx +25 -1
- package/lib/components/Sidebar/index.ts +1 -0
- package/lib/components/Sidebar/types.ts +13 -1
- package/lib/components/SidebarV2/SidebarV2.tsx +30 -0
- package/lib/components/SidebarV2/SidebarV2Panel.tsx +25 -1
- package/lib/components/SidebarV2/types.ts +9 -1
- package/lib/components/SingleSelect/SingleSelect.tsx +4 -1
- package/lib/components/SingleSelect/SingleSelectMenu.tsx +171 -138
- package/lib/components/SingleSelect/SingleSelectTrigger.tsx +3 -1
- package/lib/components/SingleSelect/index.ts +1 -0
- package/lib/components/SingleSelect/types.ts +1 -0
- package/lib/components/SingleSelectV2/SingleSelectV2.tsx +2 -0
- package/lib/components/SingleSelectV2/SingleSelectV2Menu.tsx +84 -58
- package/lib/components/SingleSelectV2/SingleSelectV2Search.tsx +1 -0
- package/lib/components/SingleSelectV2/SingleSelectV2Trigger.tsx +3 -1
- package/lib/components/SingleSelectV2/singleSelectV2.dark.tokens.ts +8 -0
- package/lib/components/SingleSelectV2/singleSelectV2.light.tokens.ts +8 -0
- package/lib/components/SingleSelectV2/singleSelectV2.tokens.types.ts +8 -0
- package/lib/components/SingleSelectV2/singleSelectV2.types.ts +2 -0
- package/lib/components/Skeleton/SkeletonCompound.tsx +45 -31
- package/lib/components/Snackbar/Snackbar.tsx +18 -8
- package/lib/components/Snackbar/index.ts +2 -0
- package/lib/components/Snackbar/snackbar.tokens.ts +6 -0
- package/lib/components/Snackbar/types.ts +2 -0
- package/lib/components/StatCard/StatCard.tsx +29 -0
- package/lib/components/StatCard/index.ts +1 -0
- package/lib/components/Stepper/index.ts +1 -0
- package/lib/components/Switch/index.ts +2 -0
- package/lib/components/Tabs/index.ts +1 -0
- package/lib/components/Tags/index.ts +1 -0
- package/lib/components/Timeline/Timeline.tsx +9 -1
- package/lib/components/Tooltip/index.ts +1 -0
- package/lib/components/Topbar/index.ts +1 -0
- package/lib/components/Upload/index.ts +1 -0
- package/lib/context/ThemeContext.tsx +16 -0
- package/lib/context/initComponentTokens.ts +11 -0
- package/lib/context/useComponentToken.ts +15 -1
- package/lib/hooks/useResponsiveTokens.ts +63 -0
- package/lib/main.ts +16 -0
- package/lib/node.ts +2 -0
- package/package.json +5 -4
- package/dist/tokens.d.ts +0 -2
|
@@ -77,6 +77,7 @@ type SingleSelectMenuProps = {
|
|
|
77
77
|
allowCustomValue?: boolean
|
|
78
78
|
customValueLabel?: string
|
|
79
79
|
menuId?: string
|
|
80
|
+
menuFooter?: React.ReactNode
|
|
80
81
|
}
|
|
81
82
|
|
|
82
83
|
type FlattenedItem = {
|
|
@@ -128,16 +129,32 @@ const Content = styled(RadixMenu.Content)`
|
|
|
128
129
|
border-radius: 8px;
|
|
129
130
|
box-shadow: ${FOUNDATION_THEME.shadows.sm};
|
|
130
131
|
z-index: 101;
|
|
132
|
+
display: flex;
|
|
133
|
+
flex-direction: column;
|
|
134
|
+
overflow: hidden;
|
|
135
|
+
|
|
136
|
+
&[data-state='closed'] {
|
|
137
|
+
pointer-events: none;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
${dropdownContentAnimations}
|
|
141
|
+
`
|
|
142
|
+
|
|
143
|
+
const ScrollableContent = styled(Block)`
|
|
131
144
|
overflow-y: auto;
|
|
132
145
|
overflow-x: hidden;
|
|
133
146
|
scrollbar-width: none;
|
|
134
147
|
scrollbar-color: transparent transparent;
|
|
148
|
+
flex-grow: 1;
|
|
149
|
+
min-height: 0;
|
|
135
150
|
|
|
136
|
-
|
|
137
|
-
|
|
151
|
+
&::-webkit-scrollbar {
|
|
152
|
+
display: none;
|
|
138
153
|
}
|
|
154
|
+
`
|
|
139
155
|
|
|
140
|
-
|
|
156
|
+
const MenuFooter = styled(Block)`
|
|
157
|
+
flex-shrink: 0;
|
|
141
158
|
`
|
|
142
159
|
|
|
143
160
|
const StyledSubMenu = styled(RadixMenu.Sub)(() => ({
|
|
@@ -382,6 +399,7 @@ const SingleSelectMenu = ({
|
|
|
382
399
|
},
|
|
383
400
|
allowCustomValue = false,
|
|
384
401
|
customValueLabel = 'Specify',
|
|
402
|
+
menuFooter,
|
|
385
403
|
}: SingleSelectMenuProps) => {
|
|
386
404
|
const singleSelectTokens =
|
|
387
405
|
useResponsiveTokens<SingleSelectTokensType>('SINGLE_SELECT')
|
|
@@ -622,6 +640,7 @@ const SingleSelectMenu = ({
|
|
|
622
640
|
left={0}
|
|
623
641
|
right={0}
|
|
624
642
|
zIndex={50}
|
|
643
|
+
flexShrink={0}
|
|
625
644
|
backgroundColor={
|
|
626
645
|
FOUNDATION_THEME.colors.gray[0]
|
|
627
646
|
}
|
|
@@ -670,155 +689,169 @@ const SingleSelectMenu = ({
|
|
|
670
689
|
/>
|
|
671
690
|
</Block>
|
|
672
691
|
)}
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
>
|
|
684
|
-
<Text
|
|
685
|
-
variant="body.md"
|
|
686
|
-
color={
|
|
687
|
-
singleSelectTokens.menu.item
|
|
688
|
-
.optionsLabel.color.default
|
|
692
|
+
<ScrollableContent>
|
|
693
|
+
{items.length === 0 ||
|
|
694
|
+
(filteredItems.length === 0 &&
|
|
695
|
+
searchText.length > 0) ? (
|
|
696
|
+
<Block
|
|
697
|
+
display="flex"
|
|
698
|
+
justifyContent="center"
|
|
699
|
+
alignItems="center"
|
|
700
|
+
padding={
|
|
701
|
+
singleSelectTokens.menu.item.padding
|
|
689
702
|
}
|
|
690
|
-
textAlign="center"
|
|
691
703
|
>
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
704
|
+
<Text
|
|
705
|
+
variant="body.md"
|
|
706
|
+
color={
|
|
707
|
+
singleSelectTokens.menu.item
|
|
708
|
+
.optionsLabel.color.default
|
|
709
|
+
}
|
|
710
|
+
textAlign="center"
|
|
711
|
+
>
|
|
712
|
+
{items.length === 0
|
|
713
|
+
? 'No items available'
|
|
714
|
+
: 'No results found'}
|
|
715
|
+
</Text>
|
|
716
|
+
</Block>
|
|
717
|
+
) : enableVirtualization &&
|
|
718
|
+
filteredItems.length > 0 ? (
|
|
719
|
+
<Block
|
|
720
|
+
data-element="virtual-list"
|
|
721
|
+
padding={FOUNDATION_THEME.unit[6]}
|
|
722
|
+
>
|
|
723
|
+
<VirtualList
|
|
724
|
+
items={flattenedItems}
|
|
725
|
+
renderItem={renderVirtualItem}
|
|
726
|
+
height={maxMenuHeight - 60}
|
|
727
|
+
itemHeight={virtualListItemHeight}
|
|
728
|
+
overscan={virtualListOverscan}
|
|
729
|
+
onEndReached={onEndReached}
|
|
730
|
+
endReachedThreshold={
|
|
731
|
+
endReachedThreshold
|
|
732
|
+
}
|
|
733
|
+
hasMore={hasMore}
|
|
734
|
+
isLoading={false}
|
|
735
|
+
/>
|
|
736
|
+
</Block>
|
|
737
|
+
) : (
|
|
738
|
+
<Block
|
|
739
|
+
data-element="menu-content"
|
|
740
|
+
paddingX={
|
|
741
|
+
singleSelectTokens.menu.padding[
|
|
742
|
+
size
|
|
743
|
+
][variant].x
|
|
712
744
|
}
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
style={{
|
|
731
|
-
paddingTop: enableSearch
|
|
732
|
-
? 0
|
|
733
|
-
: FOUNDATION_THEME.unit[6],
|
|
734
|
-
}}
|
|
735
|
-
>
|
|
736
|
-
{filteredItems.map((group, groupId) => (
|
|
737
|
-
<React.Fragment key={groupId}>
|
|
738
|
-
{group.groupLabel && (
|
|
739
|
-
<Label data-element="menu-group-label">
|
|
740
|
-
<Text
|
|
741
|
-
fontSize={
|
|
742
|
-
singleSelectTokens
|
|
743
|
-
.menu.item
|
|
744
|
-
.optionsLabel
|
|
745
|
-
.fontSize
|
|
746
|
-
}
|
|
747
|
-
color={
|
|
748
|
-
singleSelectTokens
|
|
749
|
-
.menu.item
|
|
750
|
-
.optionsLabel
|
|
751
|
-
.color.default
|
|
752
|
-
}
|
|
753
|
-
fontWeight={
|
|
754
|
-
singleSelectTokens
|
|
755
|
-
.menu.item
|
|
756
|
-
.optionsLabel
|
|
757
|
-
.fontWeight
|
|
758
|
-
}
|
|
759
|
-
>
|
|
760
|
-
{group.groupLabel}
|
|
761
|
-
</Text>
|
|
762
|
-
</Label>
|
|
763
|
-
)}
|
|
764
|
-
{group.items.map(
|
|
765
|
-
(item, itemIndex) => {
|
|
766
|
-
let itemIdx = 0
|
|
767
|
-
for (
|
|
768
|
-
let i = 0;
|
|
769
|
-
i < groupId;
|
|
770
|
-
i++
|
|
771
|
-
) {
|
|
772
|
-
itemIdx +=
|
|
773
|
-
filteredItems[i]
|
|
774
|
-
.items.length
|
|
775
|
-
}
|
|
776
|
-
itemIdx += itemIndex
|
|
777
|
-
return (
|
|
778
|
-
<Item
|
|
779
|
-
key={`${groupId}-${itemIndex}`}
|
|
780
|
-
selected={selected}
|
|
781
|
-
item={item}
|
|
782
|
-
onSelect={onSelect}
|
|
783
|
-
singleSelectTokens={
|
|
784
|
-
singleSelectTokens
|
|
785
|
-
}
|
|
786
|
-
index={itemIdx}
|
|
787
|
-
/>
|
|
788
|
-
)
|
|
789
|
-
}
|
|
790
|
-
)}
|
|
791
|
-
{groupId !==
|
|
792
|
-
filteredItems.length - 1 &&
|
|
793
|
-
group.showSeparator && (
|
|
794
|
-
<RadixMenu.Separator
|
|
795
|
-
asChild
|
|
796
|
-
>
|
|
797
|
-
<Block
|
|
798
|
-
height={
|
|
745
|
+
paddingY={
|
|
746
|
+
singleSelectTokens.menu.padding[
|
|
747
|
+
size
|
|
748
|
+
][variant].y
|
|
749
|
+
}
|
|
750
|
+
style={{
|
|
751
|
+
paddingTop: enableSearch
|
|
752
|
+
? 0
|
|
753
|
+
: FOUNDATION_THEME.unit[6],
|
|
754
|
+
}}
|
|
755
|
+
>
|
|
756
|
+
{filteredItems.map((group, groupId) => (
|
|
757
|
+
<React.Fragment key={groupId}>
|
|
758
|
+
{group.groupLabel && (
|
|
759
|
+
<Label data-element="menu-group-label">
|
|
760
|
+
<Text
|
|
761
|
+
fontSize={
|
|
799
762
|
singleSelectTokens
|
|
800
763
|
.menu.item
|
|
801
|
-
.
|
|
802
|
-
.
|
|
764
|
+
.optionsLabel
|
|
765
|
+
.fontSize
|
|
803
766
|
}
|
|
804
|
-
|
|
767
|
+
color={
|
|
805
768
|
singleSelectTokens
|
|
806
769
|
.menu.item
|
|
807
|
-
.
|
|
770
|
+
.optionsLabel
|
|
808
771
|
.color
|
|
772
|
+
.default
|
|
809
773
|
}
|
|
810
|
-
|
|
774
|
+
fontWeight={
|
|
811
775
|
singleSelectTokens
|
|
812
776
|
.menu.item
|
|
813
|
-
.
|
|
814
|
-
.
|
|
777
|
+
.optionsLabel
|
|
778
|
+
.fontWeight
|
|
815
779
|
}
|
|
816
|
-
|
|
817
|
-
|
|
780
|
+
>
|
|
781
|
+
{group.groupLabel}
|
|
782
|
+
</Text>
|
|
783
|
+
</Label>
|
|
818
784
|
)}
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
785
|
+
{group.items.map(
|
|
786
|
+
(item, itemIndex) => {
|
|
787
|
+
let itemIdx = 0
|
|
788
|
+
for (
|
|
789
|
+
let i = 0;
|
|
790
|
+
i < groupId;
|
|
791
|
+
i++
|
|
792
|
+
) {
|
|
793
|
+
itemIdx +=
|
|
794
|
+
filteredItems[i]
|
|
795
|
+
.items
|
|
796
|
+
.length
|
|
797
|
+
}
|
|
798
|
+
itemIdx += itemIndex
|
|
799
|
+
return (
|
|
800
|
+
<Item
|
|
801
|
+
key={`${groupId}-${itemIndex}`}
|
|
802
|
+
selected={
|
|
803
|
+
selected
|
|
804
|
+
}
|
|
805
|
+
item={item}
|
|
806
|
+
onSelect={
|
|
807
|
+
onSelect
|
|
808
|
+
}
|
|
809
|
+
singleSelectTokens={
|
|
810
|
+
singleSelectTokens
|
|
811
|
+
}
|
|
812
|
+
index={itemIdx}
|
|
813
|
+
/>
|
|
814
|
+
)
|
|
815
|
+
}
|
|
816
|
+
)}
|
|
817
|
+
{groupId !==
|
|
818
|
+
filteredItems.length - 1 &&
|
|
819
|
+
group.showSeparator && (
|
|
820
|
+
<RadixMenu.Separator
|
|
821
|
+
asChild
|
|
822
|
+
>
|
|
823
|
+
<Block
|
|
824
|
+
height={
|
|
825
|
+
singleSelectTokens
|
|
826
|
+
.menu
|
|
827
|
+
.item
|
|
828
|
+
.seperator
|
|
829
|
+
.height
|
|
830
|
+
}
|
|
831
|
+
backgroundColor={
|
|
832
|
+
singleSelectTokens
|
|
833
|
+
.menu
|
|
834
|
+
.item
|
|
835
|
+
.seperator
|
|
836
|
+
.color
|
|
837
|
+
}
|
|
838
|
+
margin={
|
|
839
|
+
singleSelectTokens
|
|
840
|
+
.menu
|
|
841
|
+
.item
|
|
842
|
+
.seperator
|
|
843
|
+
.margin
|
|
844
|
+
}
|
|
845
|
+
/>
|
|
846
|
+
</RadixMenu.Separator>
|
|
847
|
+
)}
|
|
848
|
+
</React.Fragment>
|
|
849
|
+
))}
|
|
850
|
+
</Block>
|
|
851
|
+
)}
|
|
852
|
+
</ScrollableContent>
|
|
853
|
+
{menuFooter && (
|
|
854
|
+
<MenuFooter>{menuFooter}</MenuFooter>
|
|
822
855
|
)}
|
|
823
856
|
</>
|
|
824
857
|
)}
|
|
@@ -64,6 +64,7 @@ const SingleSelectV2 = ({
|
|
|
64
64
|
allowCustomValue = false,
|
|
65
65
|
customValueLabel = 'Specify',
|
|
66
66
|
singleSelectGroupPosition,
|
|
67
|
+
menuFooter,
|
|
67
68
|
...rest
|
|
68
69
|
}: SingleSelectV2Props) => {
|
|
69
70
|
const { disabled, name, ...buttonRest } = rest as {
|
|
@@ -248,6 +249,7 @@ const SingleSelectV2 = ({
|
|
|
248
249
|
allowCustomValue={allowCustomValue}
|
|
249
250
|
customValueLabel={customValueLabel}
|
|
250
251
|
menuId={menuId}
|
|
252
|
+
menuFooter={menuFooter}
|
|
251
253
|
size={size}
|
|
252
254
|
variant={variant}
|
|
253
255
|
trigger={
|
|
@@ -41,16 +41,32 @@ import {
|
|
|
41
41
|
const Content = styled(RadixMenu.Content)`
|
|
42
42
|
position: relative;
|
|
43
43
|
z-index: ${SELECT_V2_MENU_Z_INDEX};
|
|
44
|
+
display: flex;
|
|
45
|
+
flex-direction: column;
|
|
46
|
+
overflow: hidden;
|
|
47
|
+
|
|
48
|
+
&[data-state='closed'] {
|
|
49
|
+
pointer-events: none;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
${menuContentAnimations}
|
|
53
|
+
`
|
|
54
|
+
|
|
55
|
+
const ScrollableContent = styled(Block)`
|
|
44
56
|
overflow-y: auto;
|
|
45
57
|
overflow-x: hidden;
|
|
46
58
|
scrollbar-width: none;
|
|
47
59
|
scrollbar-color: transparent transparent;
|
|
60
|
+
flex-grow: 1;
|
|
61
|
+
min-height: 0;
|
|
48
62
|
|
|
49
|
-
|
|
50
|
-
|
|
63
|
+
&::-webkit-scrollbar {
|
|
64
|
+
display: none;
|
|
51
65
|
}
|
|
66
|
+
`
|
|
52
67
|
|
|
53
|
-
|
|
68
|
+
const MenuFooter = styled(Block)`
|
|
69
|
+
flex-shrink: 0;
|
|
54
70
|
`
|
|
55
71
|
|
|
56
72
|
const SingleSelectV2Menu = ({
|
|
@@ -78,6 +94,7 @@ const SingleSelectV2Menu = ({
|
|
|
78
94
|
allowCustomValue = false,
|
|
79
95
|
customValueLabel = 'Specify',
|
|
80
96
|
menuId,
|
|
97
|
+
menuFooter,
|
|
81
98
|
}: SingleSelectV2MenuProps) => {
|
|
82
99
|
const singleSelectTokens =
|
|
83
100
|
useResponsiveTokens<SingleSelectV2TokensType>('SINGLE_SELECT_V2')
|
|
@@ -286,63 +303,72 @@ const SingleSelectV2Menu = ({
|
|
|
286
303
|
containerRef={searchContainerRef}
|
|
287
304
|
/>
|
|
288
305
|
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
306
|
+
<ScrollableContent>
|
|
307
|
+
{showEmptyState ? (
|
|
308
|
+
<Block
|
|
309
|
+
display="flex"
|
|
310
|
+
justifyContent="center"
|
|
311
|
+
alignItems="center"
|
|
312
|
+
style={{
|
|
313
|
+
paddingTop: menuItem.paddingTop,
|
|
314
|
+
paddingRight: menuItem.paddingRight,
|
|
315
|
+
paddingBottom:
|
|
316
|
+
menuItem.paddingBottom,
|
|
317
|
+
paddingLeft: menuItem.paddingLeft,
|
|
318
|
+
}}
|
|
319
|
+
>
|
|
320
|
+
<Text
|
|
321
|
+
variant="body.md"
|
|
322
|
+
fontSize={
|
|
323
|
+
menuItem.groupLabelText.fontSize
|
|
324
|
+
}
|
|
325
|
+
fontWeight={
|
|
326
|
+
menuItem.groupLabelText
|
|
327
|
+
.fontWeight
|
|
328
|
+
}
|
|
329
|
+
color={
|
|
330
|
+
menuItem.groupLabelText.color
|
|
331
|
+
.default
|
|
332
|
+
}
|
|
333
|
+
textAlign="center"
|
|
334
|
+
>
|
|
335
|
+
{emptyMessage}
|
|
336
|
+
</Text>
|
|
337
|
+
</Block>
|
|
338
|
+
) : showVirtualList ? (
|
|
339
|
+
<SingleSelectV2VirtualList
|
|
340
|
+
flattenedItems={flattenedItems}
|
|
341
|
+
selected={selected}
|
|
342
|
+
onSelect={onSelect}
|
|
343
|
+
singleSelectTokens={singleSelectTokens}
|
|
344
|
+
size={size}
|
|
345
|
+
variant={variant}
|
|
346
|
+
virtualViewportHeight={
|
|
347
|
+
adjustedVirtualViewportHeight
|
|
308
348
|
}
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
349
|
+
virtualItems={virtualItems}
|
|
350
|
+
totalSize={virtualizer.getTotalSize()}
|
|
351
|
+
measureElement={
|
|
352
|
+
virtualizer.measureElement
|
|
312
353
|
}
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
{
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
measureElement={virtualizer.measureElement}
|
|
332
|
-
loadingComponent={loadingComponent}
|
|
333
|
-
hasMore={hasMore}
|
|
334
|
-
virtualScrollRef={virtualScrollRef}
|
|
335
|
-
/>
|
|
336
|
-
) : (
|
|
337
|
-
<SingleSelectV2List
|
|
338
|
-
filteredItems={filteredItems}
|
|
339
|
-
selected={selected}
|
|
340
|
-
onSelect={onSelect}
|
|
341
|
-
singleSelectTokens={singleSelectTokens}
|
|
342
|
-
size={size}
|
|
343
|
-
variant={variant}
|
|
344
|
-
enableSearch={enableSearch}
|
|
345
|
-
/>
|
|
354
|
+
loadingComponent={loadingComponent}
|
|
355
|
+
hasMore={hasMore}
|
|
356
|
+
virtualScrollRef={virtualScrollRef}
|
|
357
|
+
/>
|
|
358
|
+
) : (
|
|
359
|
+
<SingleSelectV2List
|
|
360
|
+
filteredItems={filteredItems}
|
|
361
|
+
selected={selected}
|
|
362
|
+
onSelect={onSelect}
|
|
363
|
+
singleSelectTokens={singleSelectTokens}
|
|
364
|
+
size={size}
|
|
365
|
+
variant={variant}
|
|
366
|
+
enableSearch={enableSearch}
|
|
367
|
+
/>
|
|
368
|
+
)}
|
|
369
|
+
</ScrollableContent>
|
|
370
|
+
{menuFooter && (
|
|
371
|
+
<MenuFooter>{menuFooter}</MenuFooter>
|
|
346
372
|
)}
|
|
347
373
|
</>
|
|
348
374
|
)}
|
|
@@ -349,6 +349,14 @@ export const getSingleSelectV2DarkTokens = (
|
|
|
349
349
|
},
|
|
350
350
|
iconColor: foundationToken.colors.gray[500],
|
|
351
351
|
},
|
|
352
|
+
footer: {
|
|
353
|
+
paddingTop: foundationToken.unit[16],
|
|
354
|
+
paddingRight: foundationToken.unit[16],
|
|
355
|
+
paddingBottom: foundationToken.unit[16],
|
|
356
|
+
paddingLeft: foundationToken.unit[16],
|
|
357
|
+
backgroundColor: foundationToken.colors.gray[800],
|
|
358
|
+
borderTop: `${foundationToken.border.width[1]} solid ${foundationToken.colors.gray[700]}`,
|
|
359
|
+
},
|
|
352
360
|
},
|
|
353
361
|
|
|
354
362
|
mobilePanel: {
|
|
@@ -349,6 +349,14 @@ export const getSingleSelectV2LightTokens = (
|
|
|
349
349
|
},
|
|
350
350
|
iconColor: foundationToken.colors.gray[400],
|
|
351
351
|
},
|
|
352
|
+
footer: {
|
|
353
|
+
paddingTop: foundationToken.unit[16],
|
|
354
|
+
paddingRight: foundationToken.unit[16],
|
|
355
|
+
paddingBottom: foundationToken.unit[16],
|
|
356
|
+
paddingLeft: foundationToken.unit[16],
|
|
357
|
+
backgroundColor: foundationToken.colors.gray[0],
|
|
358
|
+
borderTop: `${foundationToken.border.width[1]} solid ${foundationToken.colors.gray[200]}`,
|
|
359
|
+
},
|
|
352
360
|
},
|
|
353
361
|
|
|
354
362
|
mobilePanel: {
|
|
@@ -167,6 +167,14 @@ export type SingleSelectV2TokensType = {
|
|
|
167
167
|
}
|
|
168
168
|
iconColor: CSSObject['color']
|
|
169
169
|
}
|
|
170
|
+
footer: {
|
|
171
|
+
paddingTop: CSSObject['paddingTop']
|
|
172
|
+
paddingRight: CSSObject['paddingRight']
|
|
173
|
+
paddingBottom: CSSObject['paddingBottom']
|
|
174
|
+
paddingLeft: CSSObject['paddingLeft']
|
|
175
|
+
backgroundColor: CSSObject['backgroundColor']
|
|
176
|
+
borderTop: CSSObject['borderTop']
|
|
177
|
+
}
|
|
170
178
|
}
|
|
171
179
|
|
|
172
180
|
mobilePanel: {
|