@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
@@ -107,6 +107,13 @@ export type DirectoryTokenType = {
107
107
  color: CSSObject['color'] // Border line color
108
108
  leftOffset: CSSObject['left'] // Border line left position
109
109
  }
110
+ connector: {
111
+ itemInset: CSSObject['marginLeft'] // Keeps item backgrounds clear of hierarchy lines
112
+ itemPaddingLeft: CSSObject['paddingLeft'] // Left padding for nested items when hierarchy lines are visible
113
+ elbowTop: CSSObject['top'] // Top offset for the horizontal connector elbow
114
+ elbowHeight: CSSObject['height'] // Height of the connector elbow
115
+ elbowWidthOffset: CSSObject['width'] // Extra width that carries the elbow closer to the child row
116
+ }
110
117
  }
111
118
  }
112
119
  }
@@ -195,6 +202,13 @@ export const getDirectoryTokens = (
195
202
  color: foundationToken.colors.gray[200],
196
203
  leftOffset: foundationToken.unit[16],
197
204
  },
205
+ connector: {
206
+ itemInset: foundationToken.unit[8],
207
+ itemPaddingLeft: foundationToken.unit[8],
208
+ elbowTop: foundationToken.unit[5],
209
+ elbowHeight: foundationToken.unit[10],
210
+ elbowWidthOffset: foundationToken.unit[6],
211
+ },
198
212
  },
199
213
  },
200
214
  },
@@ -275,6 +289,13 @@ export const getDirectoryTokens = (
275
289
  color: foundationToken.colors.gray[200],
276
290
  leftOffset: foundationToken.unit[16],
277
291
  },
292
+ connector: {
293
+ itemInset: foundationToken.unit[8],
294
+ itemPaddingLeft: foundationToken.unit[8],
295
+ elbowTop: foundationToken.unit[5],
296
+ elbowHeight: foundationToken.unit[10],
297
+ elbowWidthOffset: foundationToken.unit[6],
298
+ },
278
299
  },
279
300
  },
280
301
  },
@@ -1,4 +1,16 @@
1
- import type { ReactNode } from 'react'
1
+ import type { ReactNode, RefObject } from 'react'
2
+ import type { CSSObject } from 'styled-components'
3
+
4
+ export type DirectoryExpandedItems = Set<string> | string[]
5
+
6
+ export type DirectoryVirtualizationConfig = {
7
+ viewportRef?: RefObject<HTMLElement | null>
8
+ rowHeight?: number
9
+ sectionHeight?: number
10
+ viewportHeight?: number
11
+ overscan?: number
12
+ threshold?: number
13
+ }
2
14
 
3
15
  export type DirectoryProps = {
4
16
  directoryData: DirectoryData[] | null
@@ -7,6 +19,14 @@ export type DirectoryProps = {
7
19
  onActiveItemChange?: (item: string | null) => void
8
20
  defaultActiveItem?: string | null
9
21
  iconOnlyMode?: boolean
22
+ showHierarchyLines?: boolean
23
+ hierarchyLineBorderRadius?: CSSObject['borderRadius']
24
+ expandedItems?: DirectoryExpandedItems
25
+ defaultExpandedItems?: DirectoryExpandedItems
26
+ onExpandedItemsChange?: (items: string[]) => void
27
+ onItemExpand?: (item: NavbarItem, itemPath: string) => void | Promise<void>
28
+ enableVirtualization?: boolean
29
+ virtualization?: DirectoryVirtualizationConfig
10
30
  }
11
31
 
12
32
  export type DirectoryData = {
@@ -41,6 +61,8 @@ export type SectionProps = {
41
61
  ) => void
42
62
  idPrefix?: string
43
63
  iconOnlyMode?: boolean
64
+ showHierarchyLines?: boolean
65
+ hierarchyLineBorderRadius?: CSSObject['borderRadius']
44
66
  }
45
67
 
46
68
  export type NavItemProps = {
@@ -49,4 +71,24 @@ export type NavItemProps = {
49
71
  onNavigate: (direction: 'up' | 'down', currentIndex: number) => void
50
72
  itemPath?: string
51
73
  iconOnlyMode?: boolean
74
+ showHierarchyLines?: boolean
75
+ hierarchyLineBorderRadius?: CSSObject['borderRadius']
76
+ isLast?: boolean
77
+ isNested?: boolean
52
78
  }
79
+
80
+ export type DirectoryFlatRow =
81
+ | {
82
+ type: 'section'
83
+ section: DirectoryData
84
+ sectionIndex: number
85
+ }
86
+ | {
87
+ type: 'item'
88
+ item: NavbarItem
89
+ sectionIndex: number
90
+ itemPath: string
91
+ depth: number
92
+ isLast: boolean
93
+ ancestorIsLast: boolean[]
94
+ }
@@ -1,9 +1,89 @@
1
- import type { DirectoryData } from './types'
1
+ import type {
2
+ DirectoryData,
3
+ DirectoryExpandedItems,
4
+ DirectoryFlatRow,
5
+ NavbarItem,
6
+ } from './types'
2
7
 
3
8
  export const normalizeDirectoryData = (
4
9
  directoryData: DirectoryData[] | null
5
10
  ): DirectoryData[] => (Array.isArray(directoryData) ? directoryData : [])
6
11
 
12
+ export const normalizeExpandedItems = (
13
+ expandedItems?: DirectoryExpandedItems
14
+ ): Set<string> =>
15
+ expandedItems ? new Set(Array.from(expandedItems)) : new Set<string>()
16
+
17
+ const getItemPath = (parentPath: string, item: NavbarItem): string =>
18
+ parentPath ? `${parentPath}/${item.label}` : item.label
19
+
20
+ const flattenDirectoryItems = (
21
+ items: NavbarItem[],
22
+ expandedItems: Set<string>,
23
+ rows: DirectoryFlatRow[],
24
+ sectionIndex: number,
25
+ parentPath = '',
26
+ depth = 0,
27
+ ancestorIsLast: boolean[] = []
28
+ ) => {
29
+ items.forEach((item, index) => {
30
+ const itemPath = getItemPath(parentPath, item)
31
+ const hasChildren = !!item.items?.length
32
+ const isLast = index === items.length - 1
33
+
34
+ rows.push({
35
+ type: 'item',
36
+ item,
37
+ sectionIndex,
38
+ itemPath,
39
+ depth,
40
+ isLast,
41
+ ancestorIsLast,
42
+ })
43
+
44
+ if (hasChildren && expandedItems.has(itemPath) && item.items) {
45
+ flattenDirectoryItems(
46
+ item.items,
47
+ expandedItems,
48
+ rows,
49
+ sectionIndex,
50
+ itemPath,
51
+ depth + 1,
52
+ [...ancestorIsLast, isLast]
53
+ )
54
+ }
55
+ })
56
+ }
57
+
58
+ export const flattenDirectoryData = (
59
+ directoryData: DirectoryData[],
60
+ expandedItems: Set<string>,
61
+ openSections: Set<number>
62
+ ): DirectoryFlatRow[] => {
63
+ const rows: DirectoryFlatRow[] = []
64
+
65
+ directoryData.forEach((section, sectionIndex) => {
66
+ if (section.label) {
67
+ rows.push({
68
+ type: 'section',
69
+ section,
70
+ sectionIndex,
71
+ })
72
+ }
73
+
74
+ if (section.items && openSections.has(sectionIndex)) {
75
+ flattenDirectoryItems(
76
+ section.items,
77
+ expandedItems,
78
+ rows,
79
+ sectionIndex
80
+ )
81
+ }
82
+ })
83
+
84
+ return rows
85
+ }
86
+
7
87
  export const handleSectionNavigation = (
8
88
  direction: 'up' | 'down',
9
89
  currentIndex: number,
@@ -1,3 +1,4 @@
1
+ /** @deprecated Will be deprecated soon. Use DrawerV2 instead. */
1
2
  export {
2
3
  Drawer,
3
4
  DrawerTrigger,
@@ -278,12 +278,16 @@ const DropdownInput = ({
278
278
  paddingInlineStart={paddingInlineStart}
279
279
  paddingInlineEnd={paddingInlineEnd}
280
280
  paddingTop={
281
- isSmallScreenWithLargeSize && inputFocusedOrWithValue
281
+ label &&
282
+ isSmallScreenWithLargeSize &&
283
+ inputFocusedOrWithValue
282
284
  ? paddingY * 1.5
283
285
  : paddingY
284
286
  }
285
287
  paddingBottom={
286
- isSmallScreenWithLargeSize && inputFocusedOrWithValue
288
+ label &&
289
+ isSmallScreenWithLargeSize &&
290
+ inputFocusedOrWithValue
287
291
  ? paddingY / 2
288
292
  : paddingY
289
293
  }
@@ -1,3 +1,4 @@
1
+ /** @deprecated Will be deprecated soon. Use MultiValueInputV2 instead. */
1
2
  export { default as MultiValueInput } from './MultiValueInput'
2
3
  export * from './multiValueInput.tokens'
3
4
  export * from './types'
@@ -276,12 +276,16 @@ const NumberInput = ({
276
276
  aria-describedby={ariaDescribedBy}
277
277
  paddingX={paddingX}
278
278
  paddingTop={
279
- isSmallScreenWithLargeSize && inputFocusedOrWithValue
279
+ label &&
280
+ isSmallScreenWithLargeSize &&
281
+ inputFocusedOrWithValue
280
282
  ? paddingY * 1.5
281
283
  : paddingY
282
284
  }
283
285
  paddingBottom={
284
- isSmallScreenWithLargeSize && inputFocusedOrWithValue
286
+ label &&
287
+ isSmallScreenWithLargeSize &&
288
+ inputFocusedOrWithValue
285
289
  ? paddingY / 2
286
290
  : paddingY
287
291
  }
@@ -1,3 +1,4 @@
1
+ /** @deprecated Will be deprecated soon. Use NumberInputV2 instead. */
1
2
  export { default as NumberInput } from './NumberInput'
2
3
  export * from './numberInput.tokens'
3
4
  export * from './types'
@@ -1,3 +1,4 @@
1
+ /** @deprecated Will be deprecated soon. Use OTPInputV2 instead. */
1
2
  export { default as OTPInput } from './OTPInput'
2
3
  export * from './otpInput.tokens'
3
4
  export * from './types'
@@ -1,3 +1,4 @@
1
+ /** @deprecated Will be deprecated soon. Use SearchInputV2 instead. */
1
2
  export { default as SearchInput } from './SearchInput'
2
3
  export * from './searchInput.tokens'
3
4
  export * from './types'
@@ -153,12 +153,14 @@ const TextArea = ({
153
153
  resize={resize}
154
154
  paddingX={paddingX}
155
155
  paddingTop={
156
- isSmallScreen && inputFocusedOrWithValue
156
+ label && isSmallScreen && inputFocusedOrWithValue
157
157
  ? paddingY + 14
158
158
  : paddingY
159
159
  }
160
160
  paddingBottom={
161
- isSmallScreen && inputFocusedOrWithValue ? 0 : paddingY
161
+ label && isSmallScreen && inputFocusedOrWithValue
162
+ ? 0
163
+ : paddingY
162
164
  }
163
165
  border={
164
166
  textAreaTokens.inputContainer.border[
@@ -1,2 +1,3 @@
1
+ /** @deprecated Will be deprecated soon. Use TextAreaV2 instead. */
1
2
  export { default as TextArea } from './TextArea'
2
3
  export * from './types'
@@ -319,12 +319,16 @@ const TextInput = ({
319
319
  paddingInlineStart={paddingInlineStart}
320
320
  paddingInlineEnd={paddingInlineEnd}
321
321
  paddingTop={
322
- isSmallScreenWithLargeSize && inputFocusedOrWithValue
322
+ label &&
323
+ isSmallScreenWithLargeSize &&
324
+ inputFocusedOrWithValue
323
325
  ? paddingY * 1.5
324
326
  : paddingY
325
327
  }
326
328
  paddingBottom={
327
- isSmallScreenWithLargeSize && inputFocusedOrWithValue
329
+ label &&
330
+ isSmallScreenWithLargeSize &&
331
+ inputFocusedOrWithValue
328
332
  ? paddingY / 2
329
333
  : paddingY
330
334
  }
@@ -1,3 +1,4 @@
1
+ /** @deprecated Will be deprecated soon. Use TextInputV2 instead. */
1
2
  export { default as TextInput } from './TextInput'
2
3
  export * from './textInput.tokens'
3
4
  export * from './types'
@@ -282,12 +282,16 @@ const UnitInput = ({
282
282
  paddingInlineStart={paddingInlineStart}
283
283
  paddingInlineEnd={paddingInlineEnd}
284
284
  paddingTop={
285
- isSmallScreenWithLargeSize && inputFocusedOrWithValue
285
+ label &&
286
+ isSmallScreenWithLargeSize &&
287
+ inputFocusedOrWithValue
286
288
  ? paddingY * 1.5
287
289
  : paddingY
288
290
  }
289
291
  paddingBottom={
290
- isSmallScreenWithLargeSize && inputFocusedOrWithValue
292
+ label &&
293
+ isSmallScreenWithLargeSize &&
294
+ inputFocusedOrWithValue
291
295
  ? paddingY / 2
292
296
  : paddingY
293
297
  }
@@ -537,12 +537,16 @@ const NumberInputV2 = forwardRef<HTMLInputElement, NumberInputV2Props>(
537
537
  paddingLeft={inputPaddingLeft}
538
538
  paddingRight={inputPaddingRight}
539
539
  paddingTop={
540
- smallScreenLarge && inputFocusedOrWithValue
540
+ Boolean(label.text?.trim()) &&
541
+ smallScreenLarge &&
542
+ inputFocusedOrWithValue
541
543
  ? paddingY * 1.5
542
544
  : inputContainerTokens.paddingTop[size]
543
545
  }
544
546
  paddingBottom={
545
- smallScreenLarge && inputFocusedOrWithValue
547
+ Boolean(label.text?.trim()) &&
548
+ smallScreenLarge &&
549
+ inputFocusedOrWithValue
546
550
  ? paddingY / 2
547
551
  : inputContainerTokens.paddingBottom[size]
548
552
  }
@@ -85,8 +85,9 @@ const TextAreaV2 = forwardRef<HTMLTextAreaElement, TextAreaV2Props>(
85
85
  size,
86
86
  isSmallScreen,
87
87
  inputFocusedOrWithValue,
88
+ hasLabel: Boolean(label),
88
89
  }),
89
- [ic, size, isSmallScreen, inputFocusedOrWithValue]
90
+ [ic, size, isSmallScreen, inputFocusedOrWithValue, label]
90
91
  )
91
92
 
92
93
  const {
@@ -45,18 +45,20 @@ export function getTextAreaInputPadding({
45
45
  size,
46
46
  isSmallScreen,
47
47
  inputFocusedOrWithValue,
48
+ hasLabel,
48
49
  }: {
49
50
  inputContainer: TextAreaV2TokensType['inputContainer']
50
51
  size: InputSizeV2
51
52
  isSmallScreen: boolean
52
53
  inputFocusedOrWithValue: boolean
54
+ hasLabel: boolean
53
55
  }): TextAreaInputPadding {
54
56
  const paddingTopBase = toPixels(inputContainer.padding.top[size])
55
57
  const paddingBottomBase = toPixels(inputContainer.padding.bottom[size])
56
58
  const paddingLeft = toPixels(inputContainer.padding.left[size])
57
59
  const paddingRight = toPixels(inputContainer.padding.right[size])
58
60
 
59
- const isFloating = isSmallScreen && inputFocusedOrWithValue
61
+ const isFloating = hasLabel && isSmallScreen && inputFocusedOrWithValue
60
62
  const paddingTop = isFloating
61
63
  ? paddingTopBase + paddingTopBase
62
64
  : paddingTopBase
@@ -171,6 +171,7 @@ const TextInputV2 = forwardRef<HTMLInputElement, TextInputV2Props>(
171
171
  } = getVerticalInputPadding({
172
172
  isSmallScreenWithLargeSize,
173
173
  inputFocusedOrWithValue,
174
+ hasLabel: Boolean(label),
174
175
  paddingTop: inputContainerPaddingTop,
175
176
  paddingBottom: inputContainerPaddingBottom,
176
177
  })
@@ -22,23 +22,21 @@ export const getInputState = (
22
22
  export const getVerticalInputPadding = ({
23
23
  isSmallScreenWithLargeSize,
24
24
  inputFocusedOrWithValue,
25
+ hasLabel,
25
26
  paddingTop,
26
27
  paddingBottom,
27
28
  }: {
28
29
  isSmallScreenWithLargeSize: boolean
29
30
  inputFocusedOrWithValue: boolean
31
+ hasLabel: boolean
30
32
  paddingTop: number
31
33
  paddingBottom: number
32
34
  }) => {
33
- const top =
34
- isSmallScreenWithLargeSize && inputFocusedOrWithValue
35
- ? paddingTop * 1.5
36
- : paddingTop
35
+ const shouldFloat =
36
+ hasLabel && isSmallScreenWithLargeSize && inputFocusedOrWithValue
37
37
 
38
- const bottom =
39
- isSmallScreenWithLargeSize && inputFocusedOrWithValue
40
- ? paddingBottom / 2
41
- : paddingBottom
38
+ const top = shouldFloat ? paddingTop * 1.5 : paddingTop
39
+ const bottom = shouldFloat ? paddingBottom / 2 : paddingBottom
42
40
 
43
41
  return { top, bottom }
44
42
  }