@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
|
@@ -25,13 +25,21 @@ const StyledElement = styled(Block)<{
|
|
|
25
25
|
$isActive?: boolean
|
|
26
26
|
$tokens: DirectoryTokenType
|
|
27
27
|
$iconOnlyMode?: boolean
|
|
28
|
+
$hasHierarchyLineInset?: boolean
|
|
28
29
|
}>`
|
|
29
30
|
background-color: ${({ $isActive, $tokens }) =>
|
|
30
31
|
$isActive
|
|
31
32
|
? $tokens.section.itemList.item.backgroundColor.active
|
|
32
33
|
: $tokens.section.itemList.item.backgroundColor.default};
|
|
33
34
|
border: none;
|
|
34
|
-
width:
|
|
35
|
+
width: ${({ $hasHierarchyLineInset, $tokens }) =>
|
|
36
|
+
$hasHierarchyLineInset
|
|
37
|
+
? `calc(100% - ${$tokens.section.itemList.nested.connector.itemInset})`
|
|
38
|
+
: '100%'};
|
|
39
|
+
margin-left: ${({ $hasHierarchyLineInset, $tokens }) =>
|
|
40
|
+
$hasHierarchyLineInset
|
|
41
|
+
? $tokens.section.itemList.nested.connector.itemInset
|
|
42
|
+
: 0};
|
|
35
43
|
min-width: 0;
|
|
36
44
|
flex-shrink: 0;
|
|
37
45
|
display: flex;
|
|
@@ -40,10 +48,15 @@ const StyledElement = styled(Block)<{
|
|
|
40
48
|
$iconOnlyMode ? 'center' : 'flex-start'};
|
|
41
49
|
gap: ${({ $tokens, $iconOnlyMode }) =>
|
|
42
50
|
$iconOnlyMode ? '0' : $tokens.section.itemList.item.gap};
|
|
43
|
-
padding: ${({ $tokens, $iconOnlyMode }) =>
|
|
51
|
+
padding: ${({ $tokens, $iconOnlyMode, $hasHierarchyLineInset }) =>
|
|
44
52
|
$iconOnlyMode
|
|
45
53
|
? `${$tokens.section.itemList.item.iconOnlyPadding.paddingTop} ${$tokens.section.itemList.item.iconOnlyPadding.paddingRight} ${$tokens.section.itemList.item.iconOnlyPadding.paddingBottom} ${$tokens.section.itemList.item.iconOnlyPadding.paddingLeft}`
|
|
46
|
-
: `${$tokens.section.itemList.item.padding.y} ${$tokens.section.itemList.item.padding.x}
|
|
54
|
+
: `${$tokens.section.itemList.item.padding.y} ${$tokens.section.itemList.item.padding.x} ${$tokens.section.itemList.item.padding.y} ${
|
|
55
|
+
$hasHierarchyLineInset
|
|
56
|
+
? $tokens.section.itemList.nested.connector
|
|
57
|
+
.itemPaddingLeft
|
|
58
|
+
: $tokens.section.itemList.item.padding.x
|
|
59
|
+
}`};
|
|
47
60
|
color: ${({ $isActive, $tokens }) =>
|
|
48
61
|
$isActive
|
|
49
62
|
? $tokens.section.itemList.item.color.active
|
|
@@ -116,26 +129,78 @@ const ChevronWrapper = styled(Block)<{
|
|
|
116
129
|
}
|
|
117
130
|
`
|
|
118
131
|
|
|
119
|
-
const NestedList = styled(Block)<{
|
|
132
|
+
const NestedList = styled(Block)<{
|
|
133
|
+
$tokens: DirectoryTokenType
|
|
134
|
+
$showHierarchyLines?: boolean
|
|
135
|
+
}>`
|
|
120
136
|
width: 100%;
|
|
121
137
|
padding-left: ${({ $tokens }) =>
|
|
122
138
|
$tokens.section.itemList.nested.paddingLeft};
|
|
123
|
-
margin-top: ${({ $tokens }) =>
|
|
139
|
+
margin-top: ${({ $tokens, $showHierarchyLines }) =>
|
|
140
|
+
$showHierarchyLines ? '0' : $tokens.section.itemList.nested.marginTop};
|
|
124
141
|
position: relative;
|
|
125
142
|
display: flex;
|
|
126
143
|
flex-direction: column;
|
|
127
|
-
gap: ${({ $tokens }) =>
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
144
|
+
gap: ${({ $tokens, $showHierarchyLines }) =>
|
|
145
|
+
$showHierarchyLines ? 0 : $tokens.section.itemList.gap};
|
|
146
|
+
`
|
|
147
|
+
|
|
148
|
+
const NavListItem = styled.li<{
|
|
149
|
+
$showHierarchyLines?: boolean
|
|
150
|
+
$isLast?: boolean
|
|
151
|
+
$tokens: DirectoryTokenType
|
|
152
|
+
$hierarchyLineBorderRadius: React.CSSProperties['borderRadius']
|
|
153
|
+
}>`
|
|
154
|
+
width: 100%;
|
|
155
|
+
display: flex;
|
|
156
|
+
flex-direction: column;
|
|
157
|
+
justify-content: flex-start;
|
|
158
|
+
align-items: stretch;
|
|
159
|
+
position: relative;
|
|
160
|
+
|
|
161
|
+
${({ $showHierarchyLines, $isLast, $tokens, $hierarchyLineBorderRadius }) =>
|
|
162
|
+
$showHierarchyLines &&
|
|
163
|
+
`
|
|
164
|
+
--directory-connector-elbow-top: ${$tokens.section.itemList.nested.connector.elbowTop};
|
|
165
|
+
|
|
166
|
+
padding-bottom: ${$isLast ? '0' : $tokens.section.itemList.gap};
|
|
167
|
+
|
|
168
|
+
&::before,
|
|
169
|
+
&::after {
|
|
170
|
+
content: '';
|
|
171
|
+
position: absolute;
|
|
172
|
+
pointer-events: none;
|
|
173
|
+
border-color: ${$tokens.section.itemList.nested.border.color};
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
&::before {
|
|
177
|
+
left: calc(-1 * ${$tokens.section.itemList.nested.paddingLeft} + ${$tokens.section.itemList.nested.border.leftOffset});
|
|
178
|
+
top: calc(-1 * ${$tokens.section.itemList.gap});
|
|
179
|
+
bottom: ${$isLast ? 'calc(100% - var(--directory-connector-elbow-top))' : `calc(-1 * ${$tokens.section.itemList.gap})`};
|
|
180
|
+
border-left: ${$tokens.section.itemList.nested.border.width} solid ${$tokens.section.itemList.nested.border.color};
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
&::after {
|
|
184
|
+
left: calc(-1 * ${$tokens.section.itemList.nested.paddingLeft} + ${$tokens.section.itemList.nested.border.leftOffset});
|
|
185
|
+
top: var(--directory-connector-elbow-top);
|
|
186
|
+
width: calc(${$tokens.section.itemList.nested.paddingLeft} - ${$tokens.section.itemList.nested.border.leftOffset} + ${$tokens.section.itemList.nested.connector.elbowWidthOffset});
|
|
187
|
+
height: ${$tokens.section.itemList.nested.connector.elbowHeight};
|
|
188
|
+
border-left: ${$tokens.section.itemList.nested.border.width} solid ${$tokens.section.itemList.nested.border.color};
|
|
189
|
+
border-bottom: ${$tokens.section.itemList.nested.border.width} solid ${$tokens.section.itemList.nested.border.color};
|
|
190
|
+
border-bottom-left-radius: ${addPxToValue($hierarchyLineBorderRadius)};
|
|
191
|
+
}
|
|
192
|
+
`}
|
|
193
|
+
`
|
|
194
|
+
|
|
195
|
+
const NavItemContentFrame = styled.div<{
|
|
196
|
+
$showHierarchyLines?: boolean
|
|
197
|
+
}>`
|
|
198
|
+
position: relative;
|
|
199
|
+
z-index: ${({ $showHierarchyLines }) => ($showHierarchyLines ? 1 : 'auto')};
|
|
200
|
+
`
|
|
201
|
+
|
|
202
|
+
const NestedListFrame = styled.div`
|
|
203
|
+
position: relative;
|
|
139
204
|
`
|
|
140
205
|
|
|
141
206
|
type ActiveItemContextValue = {
|
|
@@ -223,6 +288,10 @@ const NavItem = ({
|
|
|
223
288
|
onNavigate,
|
|
224
289
|
itemPath = item.label,
|
|
225
290
|
iconOnlyMode = false,
|
|
291
|
+
showHierarchyLines = false,
|
|
292
|
+
hierarchyLineBorderRadius = 0,
|
|
293
|
+
isLast = false,
|
|
294
|
+
isNested = false,
|
|
226
295
|
}: NavItemProps) => {
|
|
227
296
|
const tokens = useResponsiveTokens<DirectoryTokenType>('DIRECTORY')
|
|
228
297
|
const [isExpanded, setIsExpanded] = React.useState(false)
|
|
@@ -402,6 +471,7 @@ const NavItem = ({
|
|
|
402
471
|
$isActive={isActive}
|
|
403
472
|
$tokens={tokens}
|
|
404
473
|
$iconOnlyMode={iconOnlyMode}
|
|
474
|
+
$hasHierarchyLineInset={showHierarchyLines && isNested}
|
|
405
475
|
{...elementProps}
|
|
406
476
|
ref={refCallback}
|
|
407
477
|
onClick={handleClick}
|
|
@@ -436,82 +506,103 @@ const NavItem = ({
|
|
|
436
506
|
)
|
|
437
507
|
|
|
438
508
|
return (
|
|
439
|
-
<
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
}}
|
|
509
|
+
<NavListItem
|
|
510
|
+
$showHierarchyLines={showHierarchyLines && isNested}
|
|
511
|
+
$isLast={isLast}
|
|
512
|
+
$tokens={tokens}
|
|
513
|
+
$hierarchyLineBorderRadius={hierarchyLineBorderRadius}
|
|
514
|
+
data-directory-hierarchy-item={
|
|
515
|
+
showHierarchyLines && isNested ? 'true' : undefined
|
|
516
|
+
}
|
|
448
517
|
>
|
|
449
|
-
{
|
|
450
|
-
|
|
451
|
-
{
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
518
|
+
<NavItemContentFrame $showHierarchyLines={showHierarchyLines}>
|
|
519
|
+
{iconOnlyMode && item.leftSlot ? (
|
|
520
|
+
<TooltipV2 content={item.label} side={TooltipV2Side.RIGHT}>
|
|
521
|
+
{itemElement}
|
|
522
|
+
</TooltipV2>
|
|
523
|
+
) : (
|
|
524
|
+
itemElement
|
|
525
|
+
)}
|
|
526
|
+
</NavItemContentFrame>
|
|
456
527
|
|
|
457
528
|
{hasChildren && isExpanded && !iconOnlyMode && (
|
|
458
|
-
<
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
}
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
? Math.max(0, currentIndex - 1)
|
|
489
|
-
: Math.min(
|
|
490
|
-
(item.items?.length ||
|
|
491
|
-
0) - 1,
|
|
492
|
-
currentIndex + 1
|
|
493
|
-
)
|
|
494
|
-
const nestedItems =
|
|
495
|
-
itemRef.current?.parentElement
|
|
496
|
-
?.querySelector('ul')
|
|
497
|
-
?.querySelectorAll('button, a')
|
|
529
|
+
<NestedListFrame>
|
|
530
|
+
<NestedList
|
|
531
|
+
ref={nestedListRef}
|
|
532
|
+
as="ul"
|
|
533
|
+
$tokens={tokens}
|
|
534
|
+
$showHierarchyLines={showHierarchyLines}
|
|
535
|
+
role="list"
|
|
536
|
+
aria-label={`${item.label} submenu`}
|
|
537
|
+
data-directory-hierarchy-line={
|
|
538
|
+
showHierarchyLines ? 'true' : undefined
|
|
539
|
+
}
|
|
540
|
+
>
|
|
541
|
+
{item.items &&
|
|
542
|
+
item.items.map((childItem, childIdx) => (
|
|
543
|
+
<NavItem
|
|
544
|
+
key={childIdx}
|
|
545
|
+
item={childItem}
|
|
546
|
+
index={childIdx}
|
|
547
|
+
itemPath={`${itemPath}/${childItem.label}`}
|
|
548
|
+
iconOnlyMode={iconOnlyMode}
|
|
549
|
+
showHierarchyLines={showHierarchyLines}
|
|
550
|
+
hierarchyLineBorderRadius={
|
|
551
|
+
hierarchyLineBorderRadius
|
|
552
|
+
}
|
|
553
|
+
isLast={
|
|
554
|
+
childIdx ===
|
|
555
|
+
(item.items?.length || 0) - 1
|
|
556
|
+
}
|
|
557
|
+
isNested
|
|
558
|
+
onNavigate={(direction, currentIndex) => {
|
|
498
559
|
if (
|
|
499
|
-
|
|
500
|
-
|
|
560
|
+
direction === 'up' &&
|
|
561
|
+
currentIndex === 0
|
|
501
562
|
) {
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
563
|
+
itemRef.current?.focus()
|
|
564
|
+
} else if (
|
|
565
|
+
direction === 'down' &&
|
|
566
|
+
currentIndex ===
|
|
567
|
+
(item.items?.length || 0) - 1
|
|
568
|
+
) {
|
|
569
|
+
onNavigate('down', index)
|
|
570
|
+
} else {
|
|
571
|
+
const nextIndex =
|
|
572
|
+
direction === 'up'
|
|
573
|
+
? Math.max(
|
|
574
|
+
0,
|
|
575
|
+
currentIndex - 1
|
|
576
|
+
)
|
|
577
|
+
: Math.min(
|
|
578
|
+
(item.items?.length ||
|
|
579
|
+
0) - 1,
|
|
580
|
+
currentIndex + 1
|
|
581
|
+
)
|
|
582
|
+
const nestedItems =
|
|
583
|
+
itemRef.current?.parentElement
|
|
584
|
+
?.querySelector('ul')
|
|
585
|
+
?.querySelectorAll(
|
|
586
|
+
'button, a'
|
|
587
|
+
)
|
|
588
|
+
if (
|
|
589
|
+
nestedItems &&
|
|
590
|
+
nestedItems[nextIndex]
|
|
591
|
+
) {
|
|
592
|
+
;(
|
|
593
|
+
nestedItems[
|
|
594
|
+
nextIndex
|
|
595
|
+
] as HTMLElement
|
|
596
|
+
).focus()
|
|
597
|
+
}
|
|
507
598
|
}
|
|
508
|
-
}
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
</
|
|
599
|
+
}}
|
|
600
|
+
/>
|
|
601
|
+
))}
|
|
602
|
+
</NestedList>
|
|
603
|
+
</NestedListFrame>
|
|
513
604
|
)}
|
|
514
|
-
</
|
|
605
|
+
</NavListItem>
|
|
515
606
|
)
|
|
516
607
|
}
|
|
517
608
|
|
|
@@ -55,6 +55,8 @@ const Section = ({
|
|
|
55
55
|
onNavigateBetweenSections,
|
|
56
56
|
idPrefix,
|
|
57
57
|
iconOnlyMode = false,
|
|
58
|
+
showHierarchyLines = false,
|
|
59
|
+
hierarchyLineBorderRadius = 0,
|
|
58
60
|
}: SectionProps) => {
|
|
59
61
|
const tokens = useResponsiveTokens<DirectoryTokenType>('DIRECTORY')
|
|
60
62
|
const sectionStateContext = useSectionState()
|
|
@@ -259,6 +261,13 @@ const Section = ({
|
|
|
259
261
|
index={itemIdx}
|
|
260
262
|
itemPath={item.label}
|
|
261
263
|
iconOnlyMode={iconOnlyMode}
|
|
264
|
+
showHierarchyLines={showHierarchyLines}
|
|
265
|
+
hierarchyLineBorderRadius={
|
|
266
|
+
hierarchyLineBorderRadius
|
|
267
|
+
}
|
|
268
|
+
isLast={
|
|
269
|
+
itemIdx === (section.items?.length || 0) - 1
|
|
270
|
+
}
|
|
262
271
|
onNavigate={handleItemNavigation}
|
|
263
272
|
/>
|
|
264
273
|
))}
|