@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
|
@@ -144,6 +144,7 @@ export type SingleSelectV2MenuProps = {
|
|
|
144
144
|
customValueLabel?: string
|
|
145
145
|
|
|
146
146
|
menuId?: string
|
|
147
|
+
menuFooter?: ReactNode
|
|
147
148
|
}
|
|
148
149
|
export type SingleSelectV2PropsBase = {
|
|
149
150
|
label?: string
|
|
@@ -194,6 +195,7 @@ export type SingleSelectV2PropsBase = {
|
|
|
194
195
|
customValueLabel?: string
|
|
195
196
|
|
|
196
197
|
singleSelectGroupPosition?: 'center' | 'left' | 'right'
|
|
198
|
+
menuFooter?: ReactNode
|
|
197
199
|
}
|
|
198
200
|
|
|
199
201
|
export type SingleSelectV2Props = Omit<
|
|
@@ -5,6 +5,25 @@ import SkeletonCard from './SkeletonCard'
|
|
|
5
5
|
|
|
6
6
|
import type { SkeletonProps } from './types'
|
|
7
7
|
|
|
8
|
+
const SkeletonRoot = forwardRef<HTMLDivElement, SkeletonProps>((props, ref) => (
|
|
9
|
+
<Skeleton {...props} ref={ref} />
|
|
10
|
+
))
|
|
11
|
+
|
|
12
|
+
// Convenience aliases (no flat export — they exist only as compound statics)
|
|
13
|
+
const SkeletonCircle = forwardRef<HTMLDivElement, Omit<SkeletonProps, 'shape'>>(
|
|
14
|
+
(props, ref) => <Skeleton {...props} shape="circle" ref={ref} />
|
|
15
|
+
)
|
|
16
|
+
|
|
17
|
+
const SkeletonRectangle = forwardRef<
|
|
18
|
+
HTMLDivElement,
|
|
19
|
+
Omit<SkeletonProps, 'shape'>
|
|
20
|
+
>((props, ref) => <Skeleton {...props} shape="rectangle" ref={ref} />)
|
|
21
|
+
|
|
22
|
+
const SkeletonRounded = forwardRef<
|
|
23
|
+
HTMLDivElement,
|
|
24
|
+
Omit<SkeletonProps, 'shape'>
|
|
25
|
+
>((props, ref) => <Skeleton {...props} shape="rounded" ref={ref} />)
|
|
26
|
+
|
|
8
27
|
/**
|
|
9
28
|
* Enhanced Skeleton with compound component pattern
|
|
10
29
|
*
|
|
@@ -17,40 +36,35 @@ import type { SkeletonProps } from './types'
|
|
|
17
36
|
* Or traditional:
|
|
18
37
|
* <Skeleton.Text loading={isLoading} lines={3} />
|
|
19
38
|
*/
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
*/
|
|
28
|
-
Avatar: SkeletonAvatar,
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* Card skeleton with default layout or custom children
|
|
32
|
-
*/
|
|
33
|
-
Card: SkeletonCard,
|
|
39
|
+
// Statics that reuse a flat export are typed as `typeof` that export so the
|
|
40
|
+
// emitted declarations state the value identity instead of re-declaring props.
|
|
41
|
+
const SkeletonCompound: typeof SkeletonRoot & {
|
|
42
|
+
/**
|
|
43
|
+
* Avatar skeleton with circular or square shapes and multiple sizes
|
|
44
|
+
*/
|
|
45
|
+
Avatar: typeof SkeletonAvatar
|
|
34
46
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
47
|
+
/**
|
|
48
|
+
* Card skeleton with default layout or custom children
|
|
49
|
+
*/
|
|
50
|
+
Card: typeof SkeletonCard
|
|
39
51
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
52
|
+
/**
|
|
53
|
+
* Base skeleton component for custom shapes and layouts
|
|
54
|
+
*/
|
|
55
|
+
Base: typeof Skeleton
|
|
44
56
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
57
|
+
Circle: typeof SkeletonCircle
|
|
58
|
+
Rectangle: typeof SkeletonRectangle
|
|
59
|
+
Rounded: typeof SkeletonRounded
|
|
60
|
+
} = Object.assign(SkeletonRoot, {
|
|
61
|
+
Avatar: SkeletonAvatar,
|
|
62
|
+
Card: SkeletonCard,
|
|
63
|
+
Base: Skeleton,
|
|
64
|
+
Circle: SkeletonCircle,
|
|
65
|
+
Rectangle: SkeletonRectangle,
|
|
66
|
+
Rounded: SkeletonRounded,
|
|
67
|
+
})
|
|
54
68
|
|
|
55
69
|
// Display names for better debugging
|
|
56
70
|
SkeletonCompound.displayName = 'Skeleton'
|
|
@@ -45,6 +45,7 @@ export const StyledToast: React.FC<CustomToastProps> = ({
|
|
|
45
45
|
onClose,
|
|
46
46
|
actionButton,
|
|
47
47
|
toastId,
|
|
48
|
+
wrap = false,
|
|
48
49
|
...props
|
|
49
50
|
}) => {
|
|
50
51
|
const snackbarTokens = useResponsiveTokens<SnackbarTokens>('SNACKBAR')
|
|
@@ -75,14 +76,17 @@ export const StyledToast: React.FC<CustomToastProps> = ({
|
|
|
75
76
|
>
|
|
76
77
|
<Block
|
|
77
78
|
display="flex"
|
|
78
|
-
alignItems=
|
|
79
|
+
alignItems={wrap ? 'flex-start' : 'center'}
|
|
79
80
|
justifyContent="space-between"
|
|
80
81
|
gap={snackbarTokens.gap}
|
|
81
82
|
>
|
|
82
83
|
<Block
|
|
83
84
|
display="flex"
|
|
84
|
-
alignItems="
|
|
85
|
+
alignItems="center"
|
|
85
86
|
flexShrink={0}
|
|
87
|
+
height={
|
|
88
|
+
snackbarTokens.content.textContainer.header.lineHeight
|
|
89
|
+
}
|
|
86
90
|
data-element="icon"
|
|
87
91
|
aria-hidden="true"
|
|
88
92
|
>
|
|
@@ -107,12 +111,16 @@ export const StyledToast: React.FC<CustomToastProps> = ({
|
|
|
107
111
|
}
|
|
108
112
|
data-element="header"
|
|
109
113
|
data-id={header}
|
|
110
|
-
style={
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
114
|
+
style={
|
|
115
|
+
wrap
|
|
116
|
+
? { minWidth: 0 }
|
|
117
|
+
: {
|
|
118
|
+
minWidth: 0,
|
|
119
|
+
overflow: 'hidden',
|
|
120
|
+
textOverflow: 'ellipsis',
|
|
121
|
+
whiteSpace: 'nowrap',
|
|
122
|
+
}
|
|
123
|
+
}
|
|
116
124
|
>
|
|
117
125
|
{header}
|
|
118
126
|
</Text>
|
|
@@ -221,6 +229,7 @@ export const addSnackbar = ({
|
|
|
221
229
|
actionButton,
|
|
222
230
|
duration,
|
|
223
231
|
position,
|
|
232
|
+
wrap = false,
|
|
224
233
|
}: AddToastOptions) => {
|
|
225
234
|
// Determine if position includes "center" for proper alignment
|
|
226
235
|
const isCenter = position?.includes('center')
|
|
@@ -237,6 +246,7 @@ export const addSnackbar = ({
|
|
|
237
246
|
}}
|
|
238
247
|
actionButton={actionButton}
|
|
239
248
|
toastId={t}
|
|
249
|
+
wrap={wrap}
|
|
240
250
|
/>
|
|
241
251
|
),
|
|
242
252
|
{
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
/** @deprecated Will be deprecated soon. Use SnackbarV2 instead. */
|
|
1
2
|
export { default as Snackbar } from './Snackbar'
|
|
3
|
+
/** @deprecated Will be deprecated soon. Use SnackbarV2 instead. */
|
|
2
4
|
export { addSnackbar } from './Snackbar'
|
|
3
5
|
export * from './snackbar.tokens'
|
|
4
6
|
export * from './types'
|
|
@@ -61,6 +61,8 @@ export type SnackbarTokens = Readonly<{
|
|
|
61
61
|
fontSize: CSSObject['fontSize']
|
|
62
62
|
// Pattern: content.textContainer.header.fontWeight
|
|
63
63
|
fontWeight: CSSObject['fontWeight']
|
|
64
|
+
// Pattern: content.textContainer.header.lineHeight
|
|
65
|
+
lineHeight: CSSObject['lineHeight']
|
|
64
66
|
}
|
|
65
67
|
|
|
66
68
|
// Description text styling
|
|
@@ -149,6 +151,8 @@ export const getSnackbarTokens = (
|
|
|
149
151
|
},
|
|
150
152
|
fontSize: foundationToken.font.size.body.md.fontSize,
|
|
151
153
|
fontWeight: foundationToken.font.weight[500],
|
|
154
|
+
lineHeight:
|
|
155
|
+
foundationToken.font.size.body.md.lineHeight,
|
|
152
156
|
},
|
|
153
157
|
|
|
154
158
|
description: {
|
|
@@ -222,6 +226,8 @@ export const getSnackbarTokens = (
|
|
|
222
226
|
},
|
|
223
227
|
fontSize: foundationToken.font.size.body.lg.fontSize,
|
|
224
228
|
fontWeight: foundationToken.font.weight[600],
|
|
229
|
+
lineHeight:
|
|
230
|
+
foundationToken.font.size.body.lg.lineHeight,
|
|
225
231
|
},
|
|
226
232
|
|
|
227
233
|
description: {
|
|
@@ -26,6 +26,7 @@ export type AddToastOptions = {
|
|
|
26
26
|
}
|
|
27
27
|
duration?: number
|
|
28
28
|
position?: SnackbarPosition
|
|
29
|
+
wrap?: boolean
|
|
29
30
|
}
|
|
30
31
|
|
|
31
32
|
export type CustomToastProps = {
|
|
@@ -39,6 +40,7 @@ export type CustomToastProps = {
|
|
|
39
40
|
autoDismiss?: boolean
|
|
40
41
|
}
|
|
41
42
|
toastId?: string | number
|
|
43
|
+
wrap?: boolean
|
|
42
44
|
}
|
|
43
45
|
|
|
44
46
|
export type SnackbarProps = {
|
|
@@ -39,6 +39,7 @@ import type { StatCardTokenType } from './statcard.tokens'
|
|
|
39
39
|
import { useResponsiveTokens } from '../../hooks/useResponsiveTokens'
|
|
40
40
|
import { BREAKPOINTS } from '../../breakpoints/breakPoints'
|
|
41
41
|
import { useBreakpoints } from '../../hooks/useBreakPoints'
|
|
42
|
+
import { useResizeObserver } from '../../hooks/useResizeObserver'
|
|
42
43
|
import {
|
|
43
44
|
SelectMenuSize,
|
|
44
45
|
SelectMenuVariant,
|
|
@@ -304,6 +305,12 @@ const StatCard = ({
|
|
|
304
305
|
const isSmallScreen = breakPointLabel === 'sm'
|
|
305
306
|
const titleIconRef = useRef<HTMLDivElement>(null)
|
|
306
307
|
const titleIconWidth = titleIconRef.current?.offsetWidth || 0
|
|
308
|
+
const actionIconRef = useRef<HTMLDivElement>(null)
|
|
309
|
+
const [actionIconWidth, setActionIconWidth] = useState(0)
|
|
310
|
+
|
|
311
|
+
useResizeObserver(actionIconRef, (rect) => {
|
|
312
|
+
setActionIconWidth(rect.width)
|
|
313
|
+
})
|
|
307
314
|
|
|
308
315
|
const [hoveredBarIndex, setHoveredBarIndex] = useState<number | null>(null)
|
|
309
316
|
|
|
@@ -824,6 +831,16 @@ const StatCard = ({
|
|
|
824
831
|
statCardToken.textContainer
|
|
825
832
|
.header.gap
|
|
826
833
|
}
|
|
834
|
+
paddingRight={
|
|
835
|
+
actionIcon
|
|
836
|
+
? actionIconWidth +
|
|
837
|
+
toPixels(
|
|
838
|
+
statCardToken
|
|
839
|
+
.textContainer
|
|
840
|
+
.header.gap
|
|
841
|
+
)
|
|
842
|
+
: undefined
|
|
843
|
+
}
|
|
827
844
|
>
|
|
828
845
|
<StatCardHeaderTitleText
|
|
829
846
|
title={title}
|
|
@@ -843,6 +860,7 @@ const StatCard = ({
|
|
|
843
860
|
direction !==
|
|
844
861
|
StatCardDirection.HORIZONTAL && (
|
|
845
862
|
<Block
|
|
863
|
+
ref={actionIconRef}
|
|
846
864
|
data-element="view-more"
|
|
847
865
|
display="flex"
|
|
848
866
|
alignItems="center"
|
|
@@ -1091,6 +1109,7 @@ const StatCard = ({
|
|
|
1091
1109
|
>
|
|
1092
1110
|
{actionIcon && (
|
|
1093
1111
|
<Block
|
|
1112
|
+
ref={actionIconRef}
|
|
1094
1113
|
data-element="action-icon"
|
|
1095
1114
|
display="flex"
|
|
1096
1115
|
alignItems="flex-start"
|
|
@@ -1131,6 +1150,16 @@ const StatCard = ({
|
|
|
1131
1150
|
statCardToken.textContainer.header
|
|
1132
1151
|
.gap
|
|
1133
1152
|
}
|
|
1153
|
+
paddingRight={
|
|
1154
|
+
actionIcon
|
|
1155
|
+
? actionIconWidth +
|
|
1156
|
+
toPixels(
|
|
1157
|
+
statCardToken
|
|
1158
|
+
.textContainer.header
|
|
1159
|
+
.gap
|
|
1160
|
+
)
|
|
1161
|
+
: undefined
|
|
1162
|
+
}
|
|
1134
1163
|
>
|
|
1135
1164
|
<StatCardHeaderTitleText
|
|
1136
1165
|
title={title}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
/** @deprecated Will be deprecated soon. Use SwitchV2 instead. */
|
|
1
2
|
export { Switch } from './Switch'
|
|
3
|
+
/** @deprecated Will be deprecated soon. Use SwitchV2 instead. */
|
|
2
4
|
export { default as SwitchGroup } from './SwitchGroup'
|
|
3
5
|
export { SwitchSize } from './types'
|
|
4
6
|
export type { SwitchProps, SwitchGroupProps } from './types'
|
|
@@ -3,6 +3,7 @@ import TabsList from './TabsList'
|
|
|
3
3
|
import TabsTrigger from './TabsTrigger'
|
|
4
4
|
import TabsContent from './TabsContent'
|
|
5
5
|
|
|
6
|
+
/** @deprecated Will be deprecated soon. Use TabsV2 instead. */
|
|
6
7
|
export { Tabs, TabsList, TabsTrigger, TabsContent }
|
|
7
8
|
export * from './types'
|
|
8
9
|
export * from './tabs.token'
|
|
@@ -95,7 +95,15 @@ const TimelineRoot = forwardRef<HTMLDivElement, TimelineRootProps>(
|
|
|
95
95
|
|
|
96
96
|
TimelineRoot.displayName = 'Timeline'
|
|
97
97
|
|
|
98
|
-
|
|
98
|
+
// Statics reuse the flat exports, so they are typed as `typeof` those exports
|
|
99
|
+
// to keep the emitted declarations stating the value identity.
|
|
100
|
+
const Timeline: typeof TimelineRoot & {
|
|
101
|
+
Label: typeof TimelineLabel
|
|
102
|
+
Header: typeof TimelineHeader
|
|
103
|
+
Substep: typeof TimelineSubstep
|
|
104
|
+
Node: typeof TimelineNode
|
|
105
|
+
ShowMore: typeof TimelineShowMore
|
|
106
|
+
} = Object.assign(TimelineRoot, {
|
|
99
107
|
Label: TimelineLabel,
|
|
100
108
|
Header: TimelineHeader,
|
|
101
109
|
Substep: TimelineSubstep,
|
|
@@ -38,6 +38,10 @@ import type { ResponsiveChartTokens } from '../components/Charts/chart.tokens'
|
|
|
38
38
|
import type { ResponsiveSnackbarTokens } from '../components/Snackbar/snackbar.tokens'
|
|
39
39
|
import type { ResponsiveKeyValuePairTokens } from '../components/KeyValuePair/KeyValuePair.tokens'
|
|
40
40
|
import type { ResponsiveCardTokens } from '../components/Card/card.tokens'
|
|
41
|
+
import {
|
|
42
|
+
getCardV2Tokens,
|
|
43
|
+
type ResponsiveCardV2Tokens,
|
|
44
|
+
} from '../components/CardV2/cardV2.tokens'
|
|
41
45
|
import {
|
|
42
46
|
getTopbarTokens,
|
|
43
47
|
type ResponsiveTopbarTokens,
|
|
@@ -239,6 +243,12 @@ import {
|
|
|
239
243
|
getChatInputV2MobileTokens,
|
|
240
244
|
ChatInputV2MobileTokensType,
|
|
241
245
|
} from '../components/InputsV2/ChatInputV2/ChatInputV2Mobile.tokens'
|
|
246
|
+
import {
|
|
247
|
+
ResponsiveUploadV2Tokens,
|
|
248
|
+
getUploadV2Tokens,
|
|
249
|
+
} from '../components/InputsV2/UploadV2/UploadV2.tokens'
|
|
250
|
+
import { getModalV2Tokens } from '../components/ModalV2/modalV2.tokens'
|
|
251
|
+
import type { ResponsiveModalV2Tokens } from '../components/ModalV2/modalV2.tokens.types'
|
|
242
252
|
export type ComponentTokenType = {
|
|
243
253
|
TAGS?: ResponsiveTagTokens
|
|
244
254
|
SEARCH_INPUT?: ResponsiveSearchInputTokens
|
|
@@ -275,6 +285,7 @@ export type ComponentTokenType = {
|
|
|
275
285
|
STEPPER?: ResponsiveStepperTokens
|
|
276
286
|
KEYVALUEPAIR?: ResponsiveKeyValuePairTokens
|
|
277
287
|
CARD?: ResponsiveCardTokens
|
|
288
|
+
CARDV2?: ResponsiveCardV2Tokens
|
|
278
289
|
SKELETON?: ResponsiveSkeletonTokens
|
|
279
290
|
TOPBAR?: ResponsiveTopbarTokens
|
|
280
291
|
TOPBARV2?: ResponsiveTopbarV2Tokens
|
|
@@ -318,6 +329,8 @@ export type ComponentTokenType = {
|
|
|
318
329
|
SEARCH_INPUT_V2?: ResponsiveSearchInputV2Tokens
|
|
319
330
|
CHAT_INPUTV2_MOBILE?: ChatInputV2MobileTokensType
|
|
320
331
|
STEPPERV2?: ResponsiveStepperV2Tokens
|
|
332
|
+
UPLOADV2?: ResponsiveUploadV2Tokens
|
|
333
|
+
MODALV2?: ResponsiveModalV2Tokens
|
|
321
334
|
}
|
|
322
335
|
|
|
323
336
|
type ThemeContextType = {
|
|
@@ -364,6 +377,7 @@ const ThemeContext = createContext<ThemeContextType>({
|
|
|
364
377
|
STEPPER: getStepperTokens(FOUNDATION_THEME),
|
|
365
378
|
KEYVALUEPAIR: getKeyValuePairTokens(FOUNDATION_THEME),
|
|
366
379
|
CARD: getCardTokens(FOUNDATION_THEME),
|
|
380
|
+
CARDV2: getCardV2Tokens(FOUNDATION_THEME, Theme.LIGHT),
|
|
367
381
|
TOPBAR: getTopbarTokens(FOUNDATION_THEME),
|
|
368
382
|
TOPBARV2: getTopbarV2Tokens(FOUNDATION_THEME),
|
|
369
383
|
SKELETON: getSkeletonTokens(FOUNDATION_THEME),
|
|
@@ -420,6 +434,8 @@ const ThemeContext = createContext<ThemeContextType>({
|
|
|
420
434
|
Theme.LIGHT
|
|
421
435
|
),
|
|
422
436
|
STEPPERV2: getStepperV2Tokens(FOUNDATION_THEME, Theme.LIGHT),
|
|
437
|
+
UPLOADV2: getUploadV2Tokens(FOUNDATION_THEME, Theme.LIGHT),
|
|
438
|
+
MODALV2: getModalV2Tokens(FOUNDATION_THEME, Theme.LIGHT),
|
|
423
439
|
},
|
|
424
440
|
breakpoints: BREAKPOINTS,
|
|
425
441
|
theme: 'light',
|
|
@@ -17,6 +17,7 @@ import { getUnitInputTokens } from '../components/Inputs/UnitInput/unitInput.tok
|
|
|
17
17
|
import { getMultiValueInputTokens } from '../components/Inputs/MultiValueInput/multiValueInput.tokens'
|
|
18
18
|
import { getDropdownInputTokens } from '../components/Inputs/DropdownInput/dropdownInput.tokens'
|
|
19
19
|
import { getModalComponentTokens } from '../components/Modal/modal.tokens'
|
|
20
|
+
import { getModalV2Tokens } from '../components/ModalV2/modalV2.tokens'
|
|
20
21
|
import { getBreadcrumbTokens } from '../components/Breadcrumb/breadcrumb.tokens'
|
|
21
22
|
import { getPopoverTokens } from '../components/Popover/popover.tokens'
|
|
22
23
|
import { getMenuTokens } from '../components/Menu/menu.tokens'
|
|
@@ -32,6 +33,7 @@ import { getSnackbarTokens } from '../components/Snackbar/snackbar.tokens'
|
|
|
32
33
|
import { getStepperTokens } from '../components/Stepper/stepper.tokens'
|
|
33
34
|
import { getKeyValuePairTokens } from '../components/KeyValuePair/KeyValuePair.tokens'
|
|
34
35
|
import { getCardTokens } from '../components/Card/card.tokens'
|
|
36
|
+
import { getCardV2Tokens } from '../components/CardV2/cardV2.tokens'
|
|
35
37
|
import { getSkeletonTokens } from '../components/Skeleton/skeleton.tokens'
|
|
36
38
|
import { getTopbarTokens } from '../components/Topbar/topbar.tokens'
|
|
37
39
|
import { getTopbarV2Tokens } from '../components/TopbarV2/topbarV2.tokens'
|
|
@@ -80,6 +82,7 @@ import { getStepperV2Tokens } from '../components/StepperV2/stepperV2.tokens'
|
|
|
80
82
|
|
|
81
83
|
import { getChatInputV2Tokens } from '../components/InputsV2/ChatInputV2/ChatInputV2.tokens'
|
|
82
84
|
import { getChatInputV2MobileTokens } from '../components/InputsV2/ChatInputV2/ChatInputV2Mobile.tokens'
|
|
85
|
+
import { getUploadV2Tokens } from '../components/InputsV2/UploadV2/UploadV2.tokens'
|
|
83
86
|
const initTokens = (
|
|
84
87
|
componentTokens: ComponentTokenType,
|
|
85
88
|
foundationTokens: ThemeType,
|
|
@@ -120,6 +123,9 @@ const initTokens = (
|
|
|
120
123
|
getKeyValuePairTokens(foundationTokens),
|
|
121
124
|
MODAL:
|
|
122
125
|
componentTokens.MODAL ?? getModalComponentTokens(foundationTokens),
|
|
126
|
+
MODALV2:
|
|
127
|
+
componentTokens.MODALV2 ??
|
|
128
|
+
getModalV2Tokens(foundationTokens, theme),
|
|
123
129
|
BREADCRUMB:
|
|
124
130
|
componentTokens.BREADCRUMB ?? getBreadcrumbTokens(foundationTokens),
|
|
125
131
|
POPOVER: componentTokens.POPOVER ?? getPopoverTokens(foundationTokens),
|
|
@@ -150,6 +156,8 @@ const initTokens = (
|
|
|
150
156
|
componentTokens.SNACKBAR ?? getSnackbarTokens(foundationTokens),
|
|
151
157
|
STEPPER: componentTokens.STEPPER ?? getStepperTokens(foundationTokens),
|
|
152
158
|
CARD: componentTokens.CARD ?? getCardTokens(foundationTokens),
|
|
159
|
+
CARDV2:
|
|
160
|
+
componentTokens.CARDV2 ?? getCardV2Tokens(foundationTokens, theme),
|
|
153
161
|
SKELETON:
|
|
154
162
|
componentTokens.SKELETON ?? getSkeletonTokens(foundationTokens),
|
|
155
163
|
TOPBAR: componentTokens.TOPBAR ?? getTopbarTokens(foundationTokens),
|
|
@@ -265,6 +273,9 @@ const initTokens = (
|
|
|
265
273
|
STEPPERV2:
|
|
266
274
|
componentTokens.STEPPERV2 ??
|
|
267
275
|
getStepperV2Tokens(foundationTokens, theme),
|
|
276
|
+
UPLOADV2:
|
|
277
|
+
componentTokens.UPLOADV2 ??
|
|
278
|
+
getUploadV2Tokens(foundationTokens, theme),
|
|
268
279
|
}
|
|
269
280
|
}
|
|
270
281
|
|
|
@@ -33,6 +33,7 @@ import { ResponsiveSnackbarTokens } from '../components/Snackbar/snackbar.tokens
|
|
|
33
33
|
import { ResponsiveStepperTokens } from '../components/Stepper/stepper.tokens'
|
|
34
34
|
import { ResponsiveKeyValuePairTokens } from '../components/KeyValuePair/KeyValuePair.tokens'
|
|
35
35
|
import { ResponsiveCardTokens } from '../components/Card/card.tokens'
|
|
36
|
+
import type { ResponsiveCardV2Tokens } from '../components/CardV2/cardV2.tokens'
|
|
36
37
|
import { ResponsiveSkeletonTokens } from '../components/Skeleton/skeleton.tokens'
|
|
37
38
|
import type { ResponsiveTopbarTokens } from '../components/Topbar/topbar.tokens'
|
|
38
39
|
import type { ResponsiveAvatarTokens } from '../components/Avatar/avatar.tokens'
|
|
@@ -76,6 +77,8 @@ import { ResponsiveSearchInputV2Tokens } from '../components/InputsV2/SearchInpu
|
|
|
76
77
|
import { ResponsiveChatInputV2TokensType } from '../components/InputsV2/ChatInputV2/ChatInputV2.tokens'
|
|
77
78
|
import { ChatInputV2MobileTokensType } from '../components/InputsV2/ChatInputV2/ChatInputV2Mobile.tokens'
|
|
78
79
|
import type { ResponsiveStepperV2Tokens } from '../components/StepperV2/stepperV2.tokens'
|
|
80
|
+
import { ResponsiveUploadV2Tokens } from '../components/InputsV2/UploadV2/UploadV2.tokens'
|
|
81
|
+
import type { ResponsiveModalV2Tokens } from '../components/ModalV2/modalV2.tokens.types'
|
|
79
82
|
|
|
80
83
|
export const useComponentToken = (
|
|
81
84
|
component: keyof ComponentTokenType
|
|
@@ -113,6 +116,7 @@ export const useComponentToken = (
|
|
|
113
116
|
| ResponsiveStepperTokens
|
|
114
117
|
| ResponsiveKeyValuePairTokens
|
|
115
118
|
| ResponsiveCardTokens
|
|
119
|
+
| ResponsiveCardV2Tokens
|
|
116
120
|
| ResponsiveSkeletonTokens
|
|
117
121
|
| ResponsiveTopbarTokens
|
|
118
122
|
| ResponsiveAvatarTokens
|
|
@@ -157,7 +161,11 @@ export const useComponentToken = (
|
|
|
157
161
|
| ResponsiveBadgeTokens
|
|
158
162
|
| ResponsiveChatInputV2TokensType
|
|
159
163
|
| ChatInputV2MobileTokensType
|
|
160
|
-
| ResponsiveStepperV2Tokens
|
|
164
|
+
| ResponsiveStepperV2Tokens
|
|
165
|
+
| ResponsiveStepperV2Tokens
|
|
166
|
+
| ResponsiveModalV2Tokens
|
|
167
|
+
| ResponsiveUploadV2Tokens
|
|
168
|
+
| ChatInputV2MobileTokensType => {
|
|
161
169
|
const { componentTokens } = useTheme()
|
|
162
170
|
switch (component) {
|
|
163
171
|
case 'TOOLTIP':
|
|
@@ -230,6 +238,8 @@ export const useComponentToken = (
|
|
|
230
238
|
return componentTokens.KEYVALUEPAIR
|
|
231
239
|
case 'CARD':
|
|
232
240
|
return componentTokens.CARD
|
|
241
|
+
case 'CARDV2':
|
|
242
|
+
return componentTokens.CARDV2
|
|
233
243
|
case 'SKELETON':
|
|
234
244
|
return componentTokens.SKELETON
|
|
235
245
|
case 'TOPBAR':
|
|
@@ -316,6 +326,10 @@ export const useComponentToken = (
|
|
|
316
326
|
return componentTokens.SEARCH_INPUT_V2
|
|
317
327
|
case 'STEPPERV2':
|
|
318
328
|
return componentTokens.STEPPERV2
|
|
329
|
+
case 'UPLOADV2':
|
|
330
|
+
return componentTokens.UPLOADV2
|
|
331
|
+
case 'MODALV2':
|
|
332
|
+
return componentTokens.MODALV2
|
|
319
333
|
default:
|
|
320
334
|
throw new Error(`Unknown component token: ${component}`)
|
|
321
335
|
}
|
|
@@ -4,10 +4,73 @@ import { useBreakpoints } from './useBreakPoints'
|
|
|
4
4
|
import { useComponentToken } from '../context/useComponentToken'
|
|
5
5
|
import type { BreakpointType } from '../breakpoints/breakPoints'
|
|
6
6
|
|
|
7
|
+
const warnedV1Components = new Set<string>()
|
|
8
|
+
|
|
9
|
+
// Keep this map in sync with public v2 component exports in lib/main.ts.
|
|
10
|
+
const v1TokenReplacementMap: Partial<
|
|
11
|
+
Record<keyof ComponentTokenType, { component: string; replacement: string }>
|
|
12
|
+
> = {
|
|
13
|
+
ACCORDION: { component: 'Accordion', replacement: 'AccordionV2' },
|
|
14
|
+
ALERT: { component: 'Alert', replacement: 'AlertV2' },
|
|
15
|
+
AVATAR: { component: 'Avatar', replacement: 'AvatarV2' },
|
|
16
|
+
BREADCRUMB: { component: 'Breadcrumb', replacement: 'BreadcrumbV2' },
|
|
17
|
+
BUTTON: { component: 'Button', replacement: 'ButtonV2' },
|
|
18
|
+
CARD: { component: 'Card', replacement: 'CardV2' },
|
|
19
|
+
CHAT_INPUT: { component: 'ChatInput', replacement: 'ChatInputV2' },
|
|
20
|
+
CHECKBOX: { component: 'Checkbox', replacement: 'CheckboxV2' },
|
|
21
|
+
CHARTS: { component: 'Charts', replacement: 'ChartV2' },
|
|
22
|
+
DRAWER: { component: 'Drawer', replacement: 'DrawerV2' },
|
|
23
|
+
KEYVALUEPAIR: { component: 'KeyValuePair', replacement: 'KeyValuePairV2' },
|
|
24
|
+
MENU: { component: 'Menu', replacement: 'MenuV2' },
|
|
25
|
+
MODAL: { component: 'Modal', replacement: 'ModalV2' },
|
|
26
|
+
MULTI_SELECT: { component: 'MultiSelect', replacement: 'MultiSelectV2' },
|
|
27
|
+
MULTI_VALUE_INPUT: {
|
|
28
|
+
component: 'MultiValueInput',
|
|
29
|
+
replacement: 'MultiValueInputV2',
|
|
30
|
+
},
|
|
31
|
+
NUMBER_INPUT: { component: 'NumberInput', replacement: 'NumberInputV2' },
|
|
32
|
+
OTP_INPUT: { component: 'OTPInput', replacement: 'OTPInputV2' },
|
|
33
|
+
POPOVER: { component: 'Popover', replacement: 'PopoverV2' },
|
|
34
|
+
PROGRESS_BAR: { component: 'ProgressBar', replacement: 'ProgressBarV2' },
|
|
35
|
+
RADIO: { component: 'Radio', replacement: 'RadioV2' },
|
|
36
|
+
SEARCH_INPUT: { component: 'SearchInput', replacement: 'SearchInputV2' },
|
|
37
|
+
SIDEBAR: { component: 'Sidebar', replacement: 'SidebarV2' },
|
|
38
|
+
SINGLE_SELECT: { component: 'SingleSelect', replacement: 'SingleSelectV2' },
|
|
39
|
+
SNACKBAR: { component: 'Snackbar', replacement: 'SnackbarV2' },
|
|
40
|
+
STAT_CARD: { component: 'StatCard', replacement: 'StatCardV2' },
|
|
41
|
+
STEPPER: { component: 'Stepper', replacement: 'StepperV2' },
|
|
42
|
+
SWITCH: { component: 'Switch', replacement: 'SwitchV2' },
|
|
43
|
+
TABS: { component: 'Tabs', replacement: 'TabsV2' },
|
|
44
|
+
TAGS: { component: 'Tag', replacement: 'TagV2' },
|
|
45
|
+
TEXT_AREA: { component: 'TextArea', replacement: 'TextAreaV2' },
|
|
46
|
+
TEXT_INPUT: { component: 'TextInput', replacement: 'TextInputV2' },
|
|
47
|
+
TOOLTIP: { component: 'Tooltip', replacement: 'TooltipV2' },
|
|
48
|
+
TOPBAR: { component: 'Topbar', replacement: 'TopbarV2' },
|
|
49
|
+
UPLOAD: { component: 'Upload', replacement: 'UploadV2' },
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
const warnV1ComponentUsage = (component: string, replacement: string) => {
|
|
53
|
+
if (warnedV1Components.has(component)) return
|
|
54
|
+
|
|
55
|
+
warnedV1Components.add(component)
|
|
56
|
+
console.warn(
|
|
57
|
+
`[Blend] ${component} is a v1 component and will be deprecated soon. Blend v1 components will be removed soon. Please migrate to ${replacement}.`
|
|
58
|
+
)
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
const warnV1TokenUsage = (component: keyof ComponentTokenType) => {
|
|
62
|
+
const deprecation = v1TokenReplacementMap[component]
|
|
63
|
+
if (!deprecation) return
|
|
64
|
+
|
|
65
|
+
warnV1ComponentUsage(deprecation.component, deprecation.replacement)
|
|
66
|
+
}
|
|
67
|
+
|
|
7
68
|
export const useResponsiveTokens = <T>(component: keyof ComponentTokenType) => {
|
|
8
69
|
const { breakpoints } = useContext(ThemeContext)
|
|
9
70
|
const { breakPointLabel } = useBreakpoints(breakpoints)
|
|
10
71
|
|
|
72
|
+
warnV1TokenUsage(component)
|
|
73
|
+
|
|
11
74
|
const componentTokens = useComponentToken(component) as Record<
|
|
12
75
|
keyof BreakpointType,
|
|
13
76
|
T
|
package/lib/main.ts
CHANGED
|
@@ -52,6 +52,7 @@ export * from './components/Switch'
|
|
|
52
52
|
export * from './components/Tabs'
|
|
53
53
|
export * from './components/Tags'
|
|
54
54
|
export * from './components/Tooltip'
|
|
55
|
+
export * from './components/Topbar'
|
|
55
56
|
export * from './components/Upload'
|
|
56
57
|
export * from './components/VirtualList'
|
|
57
58
|
|
|
@@ -69,6 +70,7 @@ export * from './components/AvatarV2'
|
|
|
69
70
|
export * from './components/TooltipV2'
|
|
70
71
|
export * from './components/ProgressBarV2'
|
|
71
72
|
export * from './components/StatCardV2'
|
|
73
|
+
export * from './components/CardV2'
|
|
72
74
|
export * from './components/AccordionV2'
|
|
73
75
|
export * from './components/InputsV2/TextInputV2'
|
|
74
76
|
export * from './components/InputsV2/TextAreaV2'
|
|
@@ -78,6 +80,7 @@ export * from './components/ChartsV2'
|
|
|
78
80
|
export * from './components/ButtonV2/ButtonGroupV2'
|
|
79
81
|
export * from './components/common/TruncatedTextWithTooltipV2'
|
|
80
82
|
export * from './components/PopoverV2'
|
|
83
|
+
export * from './components/ModalV2'
|
|
81
84
|
export * from './components/SidebarV2'
|
|
82
85
|
export * from './components/StepperV2'
|
|
83
86
|
export * from './components/TagGroupV2'
|
|
@@ -88,6 +91,19 @@ export * from './components/InputsV2/MultiValueInputV2'
|
|
|
88
91
|
export * from './components/InputsV2/NumberInputV2'
|
|
89
92
|
export * from './components/InputsV2/OTPInputV2'
|
|
90
93
|
export * from './components/InputsV2/SearchInputV2'
|
|
94
|
+
export { UploadV2 } from './components/InputsV2/UploadV2'
|
|
95
|
+
export {
|
|
96
|
+
UploadState as UploadV2State,
|
|
97
|
+
UploadDragState as UploadV2DragState,
|
|
98
|
+
UploadErrorReason,
|
|
99
|
+
} from './components/InputsV2/UploadV2'
|
|
100
|
+
export type {
|
|
101
|
+
UploadV2Props,
|
|
102
|
+
UploadFileV2,
|
|
103
|
+
UploadErrorReasonValue,
|
|
104
|
+
UploadV2TokensType,
|
|
105
|
+
ResponsiveUploadV2Tokens,
|
|
106
|
+
} from './components/InputsV2/UploadV2'
|
|
91
107
|
export * from './components/SnackbarV2'
|
|
92
108
|
export * from './components/CodeEditorV2'
|
|
93
109
|
export * from './components/KeyValuePairV2'
|