@juspay/blend-design-system 0.0.37-beta.8 → 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.
Files changed (240) hide show
  1. package/dist/components/Accordion/index.d.ts +2 -0
  2. package/dist/components/AccordionV2/accordionV2.animations.d.ts +1 -1
  3. package/dist/components/Alert/index.d.ts +1 -0
  4. package/dist/components/Avatar/index.d.ts +1 -0
  5. package/dist/components/Breadcrumb/index.d.ts +1 -0
  6. package/dist/components/Button/index.d.ts +1 -0
  7. package/dist/components/ButtonGroup/index.d.ts +1 -0
  8. package/dist/components/Card/index.d.ts +1 -0
  9. package/dist/components/CardV2/CardV2.d.ts +45 -0
  10. package/dist/components/CardV2/CardV2.utils.d.ts +14 -0
  11. package/dist/components/CardV2/CardV2Components.d.ts +8 -0
  12. package/dist/components/CardV2/CardV2Context.d.ts +14 -0
  13. package/dist/components/CardV2/CardV2Skeleton.d.ts +6 -0
  14. package/dist/components/CardV2/accessibility/CardV2AccessibilityReport.d.ts +2 -0
  15. package/dist/components/CardV2/accessibility/index.d.ts +1 -0
  16. package/dist/components/CardV2/cardV2.dark.tokens.d.ts +3 -0
  17. package/dist/components/CardV2/cardV2.light.tokens.d.ts +3 -0
  18. package/dist/components/CardV2/cardV2.tokens.d.ts +5 -0
  19. package/dist/components/CardV2/cardV2.tokens.types.d.ts +92 -0
  20. package/dist/components/CardV2/cardV2.types.d.ts +106 -0
  21. package/dist/components/CardV2/index.d.ts +5 -0
  22. package/dist/components/Charts/index.d.ts +10 -0
  23. package/dist/components/Charts/types.d.ts +2 -0
  24. package/dist/components/ChatInput/index.d.ts +1 -0
  25. package/dist/components/Checkbox/index.d.ts +1 -0
  26. package/dist/components/CodeEditor/index.d.ts +1 -0
  27. package/dist/components/DataTable/PivotTableModal/pivotModal.styled.d.ts +184 -0
  28. package/dist/components/DataTable/TableBody/types.d.ts +3 -1
  29. package/dist/components/DataTable/hooks/index.d.ts +2 -0
  30. package/dist/components/DataTable/hooks/useReducedMotion.d.ts +1 -0
  31. package/dist/components/DataTable/hooks/useRowFlip.d.ts +6 -0
  32. package/dist/components/DataTable/types.d.ts +26 -0
  33. package/dist/components/DateRangePicker/CalendarGrid.d.ts +5 -2
  34. package/dist/components/DateRangePicker/types.d.ts +3 -1
  35. package/dist/components/DateRangePicker/utils.d.ts +5 -5
  36. package/dist/components/Directory/Directory.d.ts +1 -1
  37. package/dist/components/Directory/NavItem.d.ts +1 -1
  38. package/dist/components/Directory/Section.d.ts +1 -1
  39. package/dist/components/Directory/VirtualizedDirectory.d.ts +3 -0
  40. package/dist/components/Directory/directory.tokens.d.ts +7 -0
  41. package/dist/components/Directory/types.d.ts +38 -1
  42. package/dist/components/Directory/utils.d.ts +3 -1
  43. package/dist/components/Drawer/index.d.ts +1 -0
  44. package/dist/components/Inputs/MultiValueInput/index.d.ts +1 -0
  45. package/dist/components/Inputs/NumberInput/index.d.ts +1 -0
  46. package/dist/components/Inputs/OTPInput/index.d.ts +1 -0
  47. package/dist/components/Inputs/SearchInput/index.d.ts +1 -0
  48. package/dist/components/Inputs/TextArea/index.d.ts +1 -0
  49. package/dist/components/Inputs/TextInput/index.d.ts +1 -0
  50. package/dist/components/InputsV2/TextAreaV2/utils.d.ts +2 -1
  51. package/dist/components/InputsV2/TextInputV2/utils.d.ts +2 -1
  52. package/dist/components/InputsV2/UploadV2/UploadContainerV2.d.ts +24 -0
  53. package/dist/components/InputsV2/UploadV2/UploadV2.d.ts +31 -0
  54. package/dist/components/InputsV2/UploadV2/UploadV2.dark.tokens.d.ts +3 -0
  55. package/dist/components/InputsV2/UploadV2/UploadV2.light.tokens.d.ts +3 -0
  56. package/dist/components/InputsV2/UploadV2/UploadV2.tokens.d.ts +5 -0
  57. package/dist/components/InputsV2/UploadV2/UploadV2.tokens.types.d.ts +115 -0
  58. package/dist/components/InputsV2/UploadV2/UploadV2.types.d.ts +56 -0
  59. package/dist/components/InputsV2/UploadV2/index.d.ts +3 -0
  60. package/dist/components/InputsV2/UploadV2/utils.d.ts +32 -0
  61. package/dist/components/KeyValuePair/index.d.ts +1 -0
  62. package/dist/components/Menu/Menu.d.ts +1 -1
  63. package/dist/components/Menu/index.d.ts +1 -0
  64. package/dist/components/Menu/types.d.ts +7 -0
  65. package/dist/components/Menu/utils.d.ts +10 -2
  66. package/dist/components/Modal/index.d.ts +1 -0
  67. package/dist/components/ModalV2/ModalV2.d.ts +22 -0
  68. package/dist/components/ModalV2/ModalV2Footer.d.ts +10 -0
  69. package/dist/components/ModalV2/ModalV2Header.d.ts +15 -0
  70. package/dist/components/ModalV2/ModalV2Skeleton.d.ts +4 -0
  71. package/dist/components/ModalV2/index.d.ts +4 -0
  72. package/dist/components/ModalV2/mobileModalV2.d.ts +23 -0
  73. package/dist/components/ModalV2/modalAnimationV2.d.ts +3 -0
  74. package/dist/components/ModalV2/modalV2.dark.tokens.d.ts +3 -0
  75. package/dist/components/ModalV2/modalV2.light.tokens.d.ts +3 -0
  76. package/dist/components/ModalV2/modalV2.tokens.d.ts +5 -0
  77. package/dist/components/ModalV2/modalV2.tokens.types.d.ts +91 -0
  78. package/dist/components/ModalV2/modalV2.types.d.ts +66 -0
  79. package/dist/components/MultiSelect/index.d.ts +2 -0
  80. package/dist/components/Popover/index.d.ts +1 -0
  81. package/dist/components/Primitives/Block/Block.d.ts +1 -1
  82. package/dist/components/ProgressBar/index.d.ts +1 -0
  83. package/dist/components/Radio/index.d.ts +2 -0
  84. package/dist/components/Sidebar/SidebarContent.d.ts +9 -1
  85. package/dist/components/Sidebar/index.d.ts +1 -0
  86. package/dist/components/Sidebar/types.d.ts +9 -1
  87. package/dist/components/SidebarV2/SidebarV2Panel.d.ts +10 -2
  88. package/dist/components/SidebarV2/types.d.ts +9 -1
  89. package/dist/components/SingleSelect/index.d.ts +1 -0
  90. package/dist/components/Skeleton/SkeletonCompound.d.ts +24 -33
  91. package/dist/components/Snackbar/index.d.ts +2 -0
  92. package/dist/components/StatCard/index.d.ts +1 -0
  93. package/dist/components/Stepper/index.d.ts +1 -0
  94. package/dist/components/Switch/index.d.ts +2 -0
  95. package/dist/components/Tabs/index.d.ts +1 -0
  96. package/dist/components/Tags/index.d.ts +1 -0
  97. package/dist/components/Timeline/Timeline.d.ts +13 -37
  98. package/dist/components/Tooltip/index.d.ts +1 -0
  99. package/dist/components/Topbar/index.d.ts +1 -0
  100. package/dist/components/Upload/index.d.ts +1 -0
  101. package/dist/context/ThemeContext.d.ts +6 -0
  102. package/dist/context/useComponentToken.d.ts +4 -1
  103. package/dist/main.d.ts +6 -0
  104. package/dist/main.js +45081 -41934
  105. package/dist/node-B3rrXW84.js +1023 -0
  106. package/dist/node.d.ts +2 -0
  107. package/dist/node.js +21 -18
  108. package/dist/token-engine.js +1 -1
  109. package/lib/components/Accordion/AccordionItem.tsx +2 -6
  110. package/lib/components/Accordion/index.ts +2 -0
  111. package/lib/components/AccordionV2/AccordionV2Item.tsx +1 -1
  112. package/lib/components/AccordionV2/accordionV2.animations.ts +1 -5
  113. package/lib/components/Alert/index.ts +1 -0
  114. package/lib/components/Avatar/index.ts +1 -0
  115. package/lib/components/Breadcrumb/index.ts +1 -0
  116. package/lib/components/Button/index.ts +1 -0
  117. package/lib/components/ButtonGroup/index.ts +1 -0
  118. package/lib/components/Card/index.ts +1 -0
  119. package/lib/components/CardV2/CardV2.tsx +327 -0
  120. package/lib/components/CardV2/CardV2.utils.tsx +77 -0
  121. package/lib/components/CardV2/CardV2Components.tsx +297 -0
  122. package/lib/components/CardV2/CardV2Context.tsx +18 -0
  123. package/lib/components/CardV2/CardV2Skeleton.tsx +40 -0
  124. package/lib/components/CardV2/accessibility/CardV2AccessibilityReport.ts +284 -0
  125. package/lib/components/CardV2/accessibility/index.ts +1 -0
  126. package/lib/components/CardV2/cardV2.dark.tokens.ts +177 -0
  127. package/lib/components/CardV2/cardV2.light.tokens.ts +177 -0
  128. package/lib/components/CardV2/cardV2.tokens.ts +21 -0
  129. package/lib/components/CardV2/cardV2.tokens.types.ts +94 -0
  130. package/lib/components/CardV2/cardV2.types.ts +131 -0
  131. package/lib/components/CardV2/index.ts +13 -0
  132. package/lib/components/Charts/ChartLegend.tsx +25 -5
  133. package/lib/components/Charts/Charts.tsx +10 -0
  134. package/lib/components/Charts/index.ts +10 -0
  135. package/lib/components/Charts/types.tsx +2 -0
  136. package/lib/components/ChatInput/index.tsx +1 -0
  137. package/lib/components/Checkbox/index.ts +1 -0
  138. package/lib/components/CodeEditor/index.ts +1 -0
  139. package/lib/components/DataTable/DataTable.tsx +8 -0
  140. package/lib/components/DataTable/TableBody/index.tsx +47 -11
  141. package/lib/components/DataTable/TableBody/types.ts +7 -1
  142. package/lib/components/DataTable/TableCell/index.tsx +1 -1
  143. package/lib/components/DataTable/hooks/index.ts +2 -0
  144. package/lib/components/DataTable/hooks/useReducedMotion.ts +19 -0
  145. package/lib/components/DataTable/hooks/useRowFlip.ts +170 -0
  146. package/lib/components/DataTable/types.ts +32 -0
  147. package/lib/components/DateRangePicker/CalendarGrid.tsx +36 -6
  148. package/lib/components/DateRangePicker/DateRangePicker.tsx +22 -3
  149. package/lib/components/DateRangePicker/types.ts +6 -1
  150. package/lib/components/DateRangePicker/utils.ts +123 -12
  151. package/lib/components/Directory/Directory.tsx +31 -0
  152. package/lib/components/Directory/NavItem.tsx +177 -86
  153. package/lib/components/Directory/Section.tsx +9 -0
  154. package/lib/components/Directory/VirtualizedDirectory.tsx +670 -0
  155. package/lib/components/Directory/directory.tokens.ts +21 -0
  156. package/lib/components/Directory/types.ts +43 -1
  157. package/lib/components/Directory/utils.ts +81 -1
  158. package/lib/components/Drawer/index.ts +1 -0
  159. package/lib/components/Inputs/DropdownInput/DropdownInput.tsx +6 -2
  160. package/lib/components/Inputs/MultiValueInput/index.ts +1 -0
  161. package/lib/components/Inputs/NumberInput/NumberInput.tsx +6 -2
  162. package/lib/components/Inputs/NumberInput/index.ts +1 -0
  163. package/lib/components/Inputs/OTPInput/index.ts +1 -0
  164. package/lib/components/Inputs/SearchInput/index.ts +1 -0
  165. package/lib/components/Inputs/TextArea/TextArea.tsx +4 -2
  166. package/lib/components/Inputs/TextArea/index.ts +1 -0
  167. package/lib/components/Inputs/TextInput/TextInput.tsx +6 -2
  168. package/lib/components/Inputs/TextInput/index.ts +1 -0
  169. package/lib/components/Inputs/UnitInput/UnitInput.tsx +6 -2
  170. package/lib/components/InputsV2/NumberInputV2/NumberInputV2.tsx +6 -2
  171. package/lib/components/InputsV2/TextAreaV2/TextAreaV2.tsx +2 -1
  172. package/lib/components/InputsV2/TextAreaV2/utils.ts +3 -1
  173. package/lib/components/InputsV2/TextInputV2/TextInputV2.tsx +1 -0
  174. package/lib/components/InputsV2/TextInputV2/utils.ts +6 -8
  175. package/lib/components/InputsV2/UploadV2/UploadContainerV2.tsx +470 -0
  176. package/lib/components/InputsV2/UploadV2/UploadV2.dark.tokens.ts +348 -0
  177. package/lib/components/InputsV2/UploadV2/UploadV2.light.tokens.ts +348 -0
  178. package/lib/components/InputsV2/UploadV2/UploadV2.tokens.ts +20 -0
  179. package/lib/components/InputsV2/UploadV2/UploadV2.tokens.types.ts +117 -0
  180. package/lib/components/InputsV2/UploadV2/UploadV2.tsx +336 -0
  181. package/lib/components/InputsV2/UploadV2/UploadV2.types.ts +67 -0
  182. package/lib/components/InputsV2/UploadV2/index.ts +3 -0
  183. package/lib/components/InputsV2/UploadV2/utils.ts +170 -0
  184. package/lib/components/KeyValuePair/index.ts +1 -0
  185. package/lib/components/Menu/Menu.tsx +18 -2
  186. package/lib/components/Menu/SubMenu.tsx +25 -3
  187. package/lib/components/Menu/index.ts +1 -0
  188. package/lib/components/Menu/types.tsx +14 -0
  189. package/lib/components/Menu/utils.ts +46 -3
  190. package/lib/components/Modal/index.ts +1 -0
  191. package/lib/components/ModalV2/ModalV2.tsx +269 -0
  192. package/lib/components/ModalV2/ModalV2Footer.tsx +76 -0
  193. package/lib/components/ModalV2/ModalV2Header.tsx +144 -0
  194. package/lib/components/ModalV2/ModalV2Skeleton.tsx +80 -0
  195. package/lib/components/ModalV2/index.ts +4 -0
  196. package/lib/components/ModalV2/mobileModalV2.tsx +411 -0
  197. package/lib/components/ModalV2/modalAnimationV2.tsx +19 -0
  198. package/lib/components/ModalV2/modalV2.dark.tokens.ts +183 -0
  199. package/lib/components/ModalV2/modalV2.light.tokens.ts +183 -0
  200. package/lib/components/ModalV2/modalV2.tokens.ts +21 -0
  201. package/lib/components/ModalV2/modalV2.tokens.types.ts +94 -0
  202. package/lib/components/ModalV2/modalV2.types.ts +80 -0
  203. package/lib/components/MultiSelect/MultiSelect.tsx +2 -1
  204. package/lib/components/MultiSelect/MultiSelectTrigger.tsx +2 -1
  205. package/lib/components/MultiSelect/index.ts +2 -0
  206. package/lib/components/MultiSelectV2/MultiSelectV2Trigger.tsx +4 -1
  207. package/lib/components/Popover/index.ts +1 -0
  208. package/lib/components/Primitives/Block/Block.tsx +1 -1
  209. package/lib/components/ProgressBar/index.ts +1 -0
  210. package/lib/components/Radio/index.ts +2 -0
  211. package/lib/components/Sidebar/Sidebar.tsx +38 -0
  212. package/lib/components/Sidebar/SidebarContent.tsx +25 -1
  213. package/lib/components/Sidebar/index.ts +1 -0
  214. package/lib/components/Sidebar/types.ts +13 -1
  215. package/lib/components/SidebarV2/SidebarV2.tsx +30 -0
  216. package/lib/components/SidebarV2/SidebarV2Panel.tsx +25 -1
  217. package/lib/components/SidebarV2/types.ts +9 -1
  218. package/lib/components/SingleSelect/SingleSelect.tsx +2 -1
  219. package/lib/components/SingleSelect/SingleSelectTrigger.tsx +3 -1
  220. package/lib/components/SingleSelect/index.ts +1 -0
  221. package/lib/components/SingleSelectV2/SingleSelectV2Trigger.tsx +3 -1
  222. package/lib/components/Skeleton/SkeletonCompound.tsx +45 -31
  223. package/lib/components/Snackbar/index.ts +2 -0
  224. package/lib/components/StatCard/index.ts +1 -0
  225. package/lib/components/Stepper/index.ts +1 -0
  226. package/lib/components/Switch/index.ts +2 -0
  227. package/lib/components/Tabs/index.ts +1 -0
  228. package/lib/components/Tags/index.ts +1 -0
  229. package/lib/components/Timeline/Timeline.tsx +9 -1
  230. package/lib/components/Tooltip/index.ts +1 -0
  231. package/lib/components/Topbar/index.ts +1 -0
  232. package/lib/components/Upload/index.ts +1 -0
  233. package/lib/context/ThemeContext.tsx +16 -0
  234. package/lib/context/initComponentTokens.ts +11 -0
  235. package/lib/context/useComponentToken.ts +15 -1
  236. package/lib/hooks/useResponsiveTokens.ts +63 -0
  237. package/lib/main.ts +16 -0
  238. package/lib/node.ts +2 -0
  239. package/package.json +1 -1
  240. /package/dist/{node-CovJEwot.js → breadcrumbV2.tokens-CovJEwot.js} +0 -0
@@ -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: 100%;
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)<{ $tokens: DirectoryTokenType }>`
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 }) => $tokens.section.itemList.nested.marginTop};
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 }) => $tokens.section.itemList.gap};
128
-
129
- & > div:first-child {
130
- position: absolute;
131
- left: ${({ $tokens }) =>
132
- $tokens.section.itemList.nested.border.leftOffset};
133
- top: 0;
134
- height: 100%;
135
- width: ${({ $tokens }) => $tokens.section.itemList.nested.border.width};
136
- background-color: ${({ $tokens }) =>
137
- $tokens.section.itemList.nested.border.color};
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
- <li
440
- style={{
441
- width: '100%',
442
- display: 'flex',
443
- flexDirection: 'column',
444
- justifyContent: 'flex-start',
445
- alignItems: 'stretch',
446
- position: 'relative',
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
- {iconOnlyMode && item.leftSlot ? (
450
- <TooltipV2 content={item.label} side={TooltipV2Side.RIGHT}>
451
- {itemElement}
452
- </TooltipV2>
453
- ) : (
454
- itemElement
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
- <NestedList
459
- ref={nestedListRef}
460
- as="ul"
461
- $tokens={tokens}
462
- role="list"
463
- aria-label={`${item.label} submenu`}
464
- >
465
- {item.items &&
466
- item.items.map((childItem, childIdx) => (
467
- <NavItem
468
- key={childIdx}
469
- item={childItem}
470
- index={childIdx}
471
- itemPath={`${itemPath}/${childItem.label}`}
472
- iconOnlyMode={iconOnlyMode}
473
- onNavigate={(direction, currentIndex) => {
474
- if (
475
- direction === 'up' &&
476
- currentIndex === 0
477
- ) {
478
- itemRef.current?.focus()
479
- } else if (
480
- direction === 'down' &&
481
- currentIndex ===
482
- (item.items?.length || 0) - 1
483
- ) {
484
- onNavigate('down', index)
485
- } else {
486
- const nextIndex =
487
- direction === 'up'
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
- nestedItems &&
500
- nestedItems[nextIndex]
560
+ direction === 'up' &&
561
+ currentIndex === 0
501
562
  ) {
502
- ;(
503
- nestedItems[
504
- nextIndex
505
- ] as HTMLElement
506
- ).focus()
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
- </NestedList>
599
+ }}
600
+ />
601
+ ))}
602
+ </NestedList>
603
+ </NestedListFrame>
513
604
  )}
514
- </li>
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
  ))}