@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
package/dist/node.d.ts
CHANGED
|
@@ -17,6 +17,7 @@ export { getCheckboxV2Tokens } from './components/SelectorV2/CheckboxV2/checkbox
|
|
|
17
17
|
export { getCodeEditorV2Tokens } from './components/CodeEditorV2/codeEditorV2.tokens';
|
|
18
18
|
export { getKeyValuePairV2Tokens } from './components/KeyValuePairV2/keyValuePairV2.tokens';
|
|
19
19
|
export { getMenuV2Tokens } from './components/MenuV2/menuV2.tokens';
|
|
20
|
+
export { getModalV2Tokens } from './components/ModalV2/modalV2.tokens';
|
|
20
21
|
export { getMultiSelectV2Tokens } from './components/MultiSelectV2/multiSelectV2.tokens';
|
|
21
22
|
export { getPopoverV2Tokens } from './components/PopoverV2/popoverV2.token';
|
|
22
23
|
export { getProgressBarV2Tokens } from './components/ProgressBarV2/progressBarV2.tokens';
|
|
@@ -28,6 +29,7 @@ export { getStatCardV2Tokens } from './components/StatCardV2/statcardV2.tokens';
|
|
|
28
29
|
export { getTabsV2Tokens } from './components/TabsV2/tabsV2.tokens';
|
|
29
30
|
export { getTagV2Tokens } from './components/TagV2/tagV2.tokens';
|
|
30
31
|
export { getTextInputV2Tokens } from './components/InputsV2/TextInputV2/TextInputV2.tokens';
|
|
32
|
+
export { getUploadV2Tokens } from './components/InputsV2/UploadV2/UploadV2.tokens';
|
|
31
33
|
export { getTimelineTokens } from './components/Timeline/timeline.token';
|
|
32
34
|
export { getTopbarTokens } from './components/Topbar/topbar.tokens';
|
|
33
35
|
export { getSidebarTokens } from './components/Sidebar/sidebar.tokens';
|
package/dist/node.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { F as a, T as o, y as t, x as T, w as n, v as g, z as k, u as V, t as r, s as i, r as l, q as
|
|
1
|
+
import { F as a, T as o, y as t, x as T, w as n, v as g, z as k, u as V, t as r, s as i, r as l, q as d, g as c, p as b, o as p, n as u, m as S, a as m, l as h, j as x, i as M, k as v, h as A, f as C, e as f, d as B, c as E, b as N } from "./breadcrumbV2.tokens-CovJEwot.js";
|
|
2
|
+
import { g as w, a as y } from "./node-B3rrXW84.js";
|
|
2
3
|
export {
|
|
3
4
|
a as FOUNDATION_THEME,
|
|
4
5
|
o as Theme,
|
|
@@ -11,21 +12,23 @@ export {
|
|
|
11
12
|
r as getCheckboxV2Tokens,
|
|
12
13
|
i as getCodeEditorV2Tokens,
|
|
13
14
|
l as getKeyValuePairV2Tokens,
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
m as
|
|
22
|
-
|
|
23
|
-
x as
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
15
|
+
d as getMenuV2Tokens,
|
|
16
|
+
c as getMobileNavigationTokens,
|
|
17
|
+
w as getModalV2Tokens,
|
|
18
|
+
b as getMultiSelectV2Tokens,
|
|
19
|
+
p as getPopoverV2Tokens,
|
|
20
|
+
u as getProgressBarV2Tokens,
|
|
21
|
+
S as getRadioV2Tokens,
|
|
22
|
+
m as getSidebarTokens,
|
|
23
|
+
h as getSingleSelectV2Tokens,
|
|
24
|
+
x as getSnackbarV2Tokens,
|
|
25
|
+
M as getStatCardV2Tokens,
|
|
26
|
+
v as getSwitchV2Tokens,
|
|
27
|
+
A as getTabsV2Tokens,
|
|
28
|
+
C as getTagV2Tokens,
|
|
29
|
+
f as getTextInputV2Tokens,
|
|
30
|
+
B as getTimelineTokens,
|
|
31
|
+
E as getTooltipV2Tokens,
|
|
32
|
+
N as getTopbarTokens,
|
|
33
|
+
y as getUploadV2Tokens
|
|
31
34
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { F as u, T as d, g as k, a as E, b as V, c as g, d as v, e as p, f as S, h, i as R, j as A, k as y, l as C, m as N, n as I, o as P, p as m, q as _, r as B, s as L, t as w, u as M, v as j, w as U, x as D, y as G, z as H } from "./
|
|
1
|
+
import { F as u, T as d, g as k, a as E, b as V, c as g, d as v, e as p, f as S, h, i as R, j as A, k as y, l as C, m as N, n as I, o as P, p as m, q as _, r as B, s as L, t as w, u as M, v as j, w as U, x as D, y as G, z as H } from "./breadcrumbV2.tokens-CovJEwot.js";
|
|
2
2
|
import { BRANCH_COLLECTION as ie, BRANCH_ID_PATTERN as ae, PRESETS as ce, PRESET_BLEND_DEFAULT as fe, PRESET_GREEN as le, PRESET_JUSPAY as Te, PRESET_ORANGE as ue, PRESET_PURPLE as de, RADIUS_PRESETS as Oe, SNAPSHOT_SUBCOLLECTION as ke, STORAGE_KEYS as Ee, TEAM_ROLE_PERMISSIONS as Ve, VERSION_PATTERN as ge, VERSION_SUBCOLLECTION as ve, analyzeContrast as pe, canUserPerformAction as Se, diffBrandConfigs as he, extractOverridePaths as Re, generateBranchId as Ae, generateColorScale as ye, getContrastRatio as Ce, getContrastRatioHex as Ne, getDefaultOnboardingState as Ie, getDefaultPreferences as Pe, getPreset as me, hexToRgb as _e, incrementVersion as Be, isValidHexColor as Le, listPresets as we, meetsWCAG as Me, parseBranchId as je, relativeLuminance as Ue, resolveWithInheritance as De, snapshotsPath as Ge, suggestForeground as He, validateAgainstLocks as xe, validateBranchId as Ke, validateBrandConfig as Fe, validatePaletteContrast as Je, validateVersion as $e, versionsPath as Ye } from "./tokens-server.js";
|
|
3
3
|
function O(e) {
|
|
4
4
|
const o = typeof structuredClone == "function" ? structuredClone(u) : JSON.parse(JSON.stringify(u));
|
|
@@ -158,8 +158,8 @@ const StyledAccordionContent = styled(RadixAccordion.Content)<{
|
|
|
158
158
|
$accordionType: AccordionType
|
|
159
159
|
$accordionToken: AccordionTokenType
|
|
160
160
|
}>((props) => ({
|
|
161
|
-
overflow: '
|
|
162
|
-
transition: '
|
|
161
|
+
overflow: 'hidden',
|
|
162
|
+
transition: 'height 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94)',
|
|
163
163
|
|
|
164
164
|
'&[data-state="open"]': {
|
|
165
165
|
animation: 'accordion-down 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94)',
|
|
@@ -176,22 +176,18 @@ const StyledAccordionContent = styled(RadixAccordion.Content)<{
|
|
|
176
176
|
'@keyframes accordion-down': {
|
|
177
177
|
from: {
|
|
178
178
|
height: 0,
|
|
179
|
-
opacity: 0,
|
|
180
179
|
},
|
|
181
180
|
to: {
|
|
182
181
|
height: 'var(--radix-accordion-content-height)',
|
|
183
|
-
opacity: 1,
|
|
184
182
|
},
|
|
185
183
|
},
|
|
186
184
|
|
|
187
185
|
'@keyframes accordion-up': {
|
|
188
186
|
from: {
|
|
189
187
|
height: 'var(--radix-accordion-content-height)',
|
|
190
|
-
opacity: 1,
|
|
191
188
|
},
|
|
192
189
|
to: {
|
|
193
190
|
height: 0,
|
|
194
|
-
opacity: 0,
|
|
195
191
|
},
|
|
196
192
|
},
|
|
197
193
|
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
/** @deprecated Will be deprecated soon. Use AccordionV2 instead. */
|
|
1
2
|
export { default as Accordion } from './Accordion'
|
|
3
|
+
/** @deprecated Will be deprecated soon. Use AccordionV2 instead. */
|
|
2
4
|
export { default as AccordionItem } from './AccordionItem'
|
|
3
5
|
export * from './accordion.tokens'
|
|
4
6
|
export * from './types'
|
|
@@ -149,7 +149,7 @@ const StyledAccordionContent = styled(RadixAccordion.Content)<{
|
|
|
149
149
|
$accordionType: AccordionV2Type
|
|
150
150
|
$accordionToken: AccordionV2TokensType
|
|
151
151
|
}>`
|
|
152
|
-
overflow:
|
|
152
|
+
overflow: hidden;
|
|
153
153
|
transition: ${ACCORDION_TRANSITION};
|
|
154
154
|
|
|
155
155
|
&[data-state='open'] {
|
|
@@ -3,24 +3,20 @@ import { keyframes } from 'styled-components'
|
|
|
3
3
|
export const accordionDown = keyframes`
|
|
4
4
|
from {
|
|
5
5
|
height: 0;
|
|
6
|
-
opacity: 0;
|
|
7
6
|
}
|
|
8
7
|
to {
|
|
9
8
|
height: var(--radix-accordion-content-height);
|
|
10
|
-
opacity: 1;
|
|
11
9
|
}
|
|
12
10
|
`
|
|
13
11
|
|
|
14
12
|
export const accordionUp = keyframes`
|
|
15
13
|
from {
|
|
16
14
|
height: var(--radix-accordion-content-height);
|
|
17
|
-
opacity: 1;
|
|
18
15
|
}
|
|
19
16
|
to {
|
|
20
17
|
height: 0;
|
|
21
|
-
opacity: 0;
|
|
22
18
|
}
|
|
23
19
|
`
|
|
24
20
|
|
|
25
21
|
export const ACCORDION_TRANSITION =
|
|
26
|
-
'
|
|
22
|
+
'height 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94)'
|
|
@@ -0,0 +1,327 @@
|
|
|
1
|
+
import { forwardRef, useId, useMemo } from 'react'
|
|
2
|
+
import styled, { css } from 'styled-components'
|
|
3
|
+
import { useResponsiveTokens } from '../../hooks/useResponsiveTokens'
|
|
4
|
+
import { filterBlockedProps } from '../../utils/prop-helpers'
|
|
5
|
+
import Block from '../Primitives/Block/Block'
|
|
6
|
+
import type { CardV2TokensType } from './cardV2.tokens'
|
|
7
|
+
import { CardV2Context } from './CardV2Context'
|
|
8
|
+
import {
|
|
9
|
+
CardV2Actions,
|
|
10
|
+
CardV2Body,
|
|
11
|
+
CardV2Content,
|
|
12
|
+
CardV2Footer,
|
|
13
|
+
CardV2Header,
|
|
14
|
+
CardV2Media,
|
|
15
|
+
CardV2Meta,
|
|
16
|
+
} from './CardV2Components'
|
|
17
|
+
import CardV2Skeleton from './CardV2Skeleton'
|
|
18
|
+
import {
|
|
19
|
+
CardV2ActionPlacement,
|
|
20
|
+
CardV2Orientation,
|
|
21
|
+
CardV2Padding,
|
|
22
|
+
CardV2Variant,
|
|
23
|
+
type CardV2Props,
|
|
24
|
+
} from './cardV2.types'
|
|
25
|
+
import {
|
|
26
|
+
getCardV2Padding,
|
|
27
|
+
isTextPrimitive,
|
|
28
|
+
toCardV2ActionArray,
|
|
29
|
+
} from './CardV2.utils'
|
|
30
|
+
|
|
31
|
+
const StyledCard = styled(Block)<{
|
|
32
|
+
$tokens: CardV2TokensType
|
|
33
|
+
$interactive: boolean
|
|
34
|
+
$selected: boolean
|
|
35
|
+
}>`
|
|
36
|
+
transition:
|
|
37
|
+
border-color 160ms ease,
|
|
38
|
+
box-shadow 160ms ease,
|
|
39
|
+
transform 160ms ease;
|
|
40
|
+
|
|
41
|
+
${({ $tokens, $interactive }) =>
|
|
42
|
+
$interactive &&
|
|
43
|
+
css`
|
|
44
|
+
cursor: pointer;
|
|
45
|
+
|
|
46
|
+
&:hover {
|
|
47
|
+
border: ${$tokens.state.hover.border};
|
|
48
|
+
box-shadow: ${$tokens.state.hover.boxShadow};
|
|
49
|
+
}
|
|
50
|
+
`}
|
|
51
|
+
|
|
52
|
+
${({ $tokens, $selected }) =>
|
|
53
|
+
$selected &&
|
|
54
|
+
css`
|
|
55
|
+
border: ${$tokens.state.selected.border};
|
|
56
|
+
box-shadow: ${$tokens.state.selected.boxShadow};
|
|
57
|
+
`}
|
|
58
|
+
|
|
59
|
+
&:focus-visible {
|
|
60
|
+
outline: ${({ $tokens }) => $tokens.state.focus.outline};
|
|
61
|
+
outline-offset: ${({ $tokens }) => $tokens.state.focus.outlineOffset};
|
|
62
|
+
}
|
|
63
|
+
`
|
|
64
|
+
|
|
65
|
+
const CardV2Root = forwardRef<HTMLDivElement, CardV2Props>(
|
|
66
|
+
(
|
|
67
|
+
{
|
|
68
|
+
variant = CardV2Variant.OUTLINED,
|
|
69
|
+
orientation = CardV2Orientation.VERTICAL,
|
|
70
|
+
padding,
|
|
71
|
+
title,
|
|
72
|
+
truncateTitle,
|
|
73
|
+
subtitle,
|
|
74
|
+
description,
|
|
75
|
+
eyebrow,
|
|
76
|
+
media,
|
|
77
|
+
mediaWidth,
|
|
78
|
+
mediaHeight,
|
|
79
|
+
mediaMinHeight,
|
|
80
|
+
leadingSlot,
|
|
81
|
+
trailingSlot,
|
|
82
|
+
footer,
|
|
83
|
+
actions,
|
|
84
|
+
actionPlacement = CardV2ActionPlacement.BODY,
|
|
85
|
+
centered = false,
|
|
86
|
+
interactive = false,
|
|
87
|
+
selected = false,
|
|
88
|
+
skeleton,
|
|
89
|
+
width,
|
|
90
|
+
minWidth,
|
|
91
|
+
maxWidth,
|
|
92
|
+
height,
|
|
93
|
+
minHeight,
|
|
94
|
+
maxHeight,
|
|
95
|
+
scrollable,
|
|
96
|
+
children,
|
|
97
|
+
role,
|
|
98
|
+
tabIndex,
|
|
99
|
+
...props
|
|
100
|
+
},
|
|
101
|
+
ref
|
|
102
|
+
) => {
|
|
103
|
+
const tokens = useResponsiveTokens<CardV2TokensType>('CARDV2')
|
|
104
|
+
const filteredProps = filterBlockedProps(props)
|
|
105
|
+
const {
|
|
106
|
+
'aria-label': providedAriaLabel,
|
|
107
|
+
...filteredPropsWithoutAriaLabel
|
|
108
|
+
} = filteredProps
|
|
109
|
+
const actionItems = toCardV2ActionArray(actions)
|
|
110
|
+
const isHorizontal = orientation === CardV2Orientation.HORIZONTAL
|
|
111
|
+
const resolvedPadding =
|
|
112
|
+
padding ??
|
|
113
|
+
(variant === CardV2Variant.GHOST
|
|
114
|
+
? CardV2Padding.NONE
|
|
115
|
+
: CardV2Padding.COMFORTABLE)
|
|
116
|
+
const resolvedRole = role ?? (interactive ? 'button' : 'region')
|
|
117
|
+
const supportsAriaSelected = [
|
|
118
|
+
'gridcell',
|
|
119
|
+
'option',
|
|
120
|
+
'row',
|
|
121
|
+
'tab',
|
|
122
|
+
'treeitem',
|
|
123
|
+
].includes(resolvedRole)
|
|
124
|
+
const hasBodyActions =
|
|
125
|
+
actionPlacement === CardV2ActionPlacement.BODY &&
|
|
126
|
+
actionItems.length > 0
|
|
127
|
+
const hasFooterActions =
|
|
128
|
+
actionPlacement === CardV2ActionPlacement.FOOTER &&
|
|
129
|
+
actionItems.length > 0
|
|
130
|
+
const hasHeaderContent = Boolean(
|
|
131
|
+
leadingSlot || eyebrow || title || subtitle || trailingSlot
|
|
132
|
+
)
|
|
133
|
+
const hasBodyContent = Boolean(
|
|
134
|
+
description || children || hasBodyActions
|
|
135
|
+
)
|
|
136
|
+
const hasFooterContent = Boolean(footer || hasFooterActions)
|
|
137
|
+
const hasContentColumn = Boolean(
|
|
138
|
+
hasHeaderContent || hasBodyContent || hasFooterContent
|
|
139
|
+
)
|
|
140
|
+
const shouldShowFooterDivider = Boolean(
|
|
141
|
+
hasFooterActions && (media || hasHeaderContent || hasBodyContent)
|
|
142
|
+
)
|
|
143
|
+
const resolvedScrollable = scrollable ?? Boolean(maxHeight)
|
|
144
|
+
const hasPropComposition = Boolean(
|
|
145
|
+
title ||
|
|
146
|
+
subtitle ||
|
|
147
|
+
description ||
|
|
148
|
+
eyebrow ||
|
|
149
|
+
media ||
|
|
150
|
+
leadingSlot ||
|
|
151
|
+
trailingSlot ||
|
|
152
|
+
footer ||
|
|
153
|
+
actionItems.length > 0
|
|
154
|
+
)
|
|
155
|
+
const baseId = useId()
|
|
156
|
+
const ids = {
|
|
157
|
+
eyebrow: `${baseId}-card-eyebrow`,
|
|
158
|
+
title: `${baseId}-card-title`,
|
|
159
|
+
subtitle: `${baseId}-card-subtitle`,
|
|
160
|
+
description: `${baseId}-card-description`,
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
const ariaLabel = useMemo(() => {
|
|
164
|
+
const parts = [title, subtitle, description].filter(isTextPrimitive)
|
|
165
|
+
return parts.length > 0 ? parts.join(' - ') : undefined
|
|
166
|
+
}, [title, subtitle, description])
|
|
167
|
+
|
|
168
|
+
return (
|
|
169
|
+
<CardV2Context.Provider
|
|
170
|
+
value={{
|
|
171
|
+
tokens,
|
|
172
|
+
centered,
|
|
173
|
+
scrollable: resolvedScrollable,
|
|
174
|
+
ids,
|
|
175
|
+
}}
|
|
176
|
+
>
|
|
177
|
+
<StyledCard
|
|
178
|
+
ref={ref}
|
|
179
|
+
$tokens={tokens}
|
|
180
|
+
$interactive={interactive}
|
|
181
|
+
$selected={selected}
|
|
182
|
+
display="flex"
|
|
183
|
+
flexDirection="column"
|
|
184
|
+
width={width ?? tokens.width}
|
|
185
|
+
minWidth={minWidth ?? tokens.minWidth}
|
|
186
|
+
maxWidth={maxWidth ?? tokens.maxWidth}
|
|
187
|
+
height={height}
|
|
188
|
+
minHeight={minHeight}
|
|
189
|
+
maxHeight={maxHeight}
|
|
190
|
+
padding={getCardV2Padding(tokens, resolvedPadding)}
|
|
191
|
+
border={tokens.border[variant]}
|
|
192
|
+
borderRadius={tokens.borderRadius}
|
|
193
|
+
backgroundColor={tokens.backgroundColor[variant]}
|
|
194
|
+
boxShadow={tokens.boxShadow[variant]}
|
|
195
|
+
overflow="hidden"
|
|
196
|
+
role={resolvedRole}
|
|
197
|
+
tabIndex={tabIndex ?? (interactive ? 0 : undefined)}
|
|
198
|
+
aria-label={
|
|
199
|
+
!title ? (providedAriaLabel ?? ariaLabel) : undefined
|
|
200
|
+
}
|
|
201
|
+
aria-labelledby={title ? ids.title : undefined}
|
|
202
|
+
aria-describedby={
|
|
203
|
+
description
|
|
204
|
+
? ids.description
|
|
205
|
+
: subtitle
|
|
206
|
+
? ids.subtitle
|
|
207
|
+
: undefined
|
|
208
|
+
}
|
|
209
|
+
aria-pressed={
|
|
210
|
+
selected && resolvedRole === 'button' ? true : undefined
|
|
211
|
+
}
|
|
212
|
+
aria-selected={
|
|
213
|
+
selected && supportsAriaSelected ? true : undefined
|
|
214
|
+
}
|
|
215
|
+
data-selected={selected || undefined}
|
|
216
|
+
data-card-variant={variant}
|
|
217
|
+
{...filteredPropsWithoutAriaLabel}
|
|
218
|
+
>
|
|
219
|
+
{skeleton?.show ? (
|
|
220
|
+
<CardV2Skeleton skeleton={skeleton} />
|
|
221
|
+
) : children && !hasPropComposition ? (
|
|
222
|
+
<Block
|
|
223
|
+
display="flex"
|
|
224
|
+
flexDirection={isHorizontal ? 'row' : 'column'}
|
|
225
|
+
alignItems={centered ? 'center' : 'stretch'}
|
|
226
|
+
gap={tokens.layout.gap}
|
|
227
|
+
minHeight={0}
|
|
228
|
+
textAlign={centered ? 'center' : undefined}
|
|
229
|
+
>
|
|
230
|
+
{children}
|
|
231
|
+
</Block>
|
|
232
|
+
) : (
|
|
233
|
+
<Block
|
|
234
|
+
display="flex"
|
|
235
|
+
flexDirection={isHorizontal ? 'row' : 'column'}
|
|
236
|
+
alignItems={
|
|
237
|
+
isHorizontal && centered ? 'center' : 'stretch'
|
|
238
|
+
}
|
|
239
|
+
gap={
|
|
240
|
+
media
|
|
241
|
+
? tokens.layout.mediaGap[orientation]
|
|
242
|
+
: tokens.layout.gap
|
|
243
|
+
}
|
|
244
|
+
minHeight={0}
|
|
245
|
+
textAlign={centered ? 'center' : undefined}
|
|
246
|
+
justifyContent={centered ? 'center' : undefined}
|
|
247
|
+
>
|
|
248
|
+
<CardV2Media
|
|
249
|
+
orientation={orientation}
|
|
250
|
+
width={mediaWidth}
|
|
251
|
+
height={mediaHeight}
|
|
252
|
+
minHeight={mediaMinHeight}
|
|
253
|
+
>
|
|
254
|
+
{media}
|
|
255
|
+
</CardV2Media>
|
|
256
|
+
{hasContentColumn && (
|
|
257
|
+
<Block
|
|
258
|
+
display="flex"
|
|
259
|
+
flexDirection="column"
|
|
260
|
+
minWidth={0}
|
|
261
|
+
minHeight={0}
|
|
262
|
+
gap={tokens.layout.gap}
|
|
263
|
+
textAlign={centered ? 'center' : undefined}
|
|
264
|
+
alignItems={centered ? 'center' : undefined}
|
|
265
|
+
width="100%"
|
|
266
|
+
>
|
|
267
|
+
<CardV2Header
|
|
268
|
+
eyebrow={eyebrow}
|
|
269
|
+
title={title}
|
|
270
|
+
truncateTitle={truncateTitle}
|
|
271
|
+
subtitle={subtitle}
|
|
272
|
+
leadingSlot={leadingSlot}
|
|
273
|
+
trailingSlot={trailingSlot}
|
|
274
|
+
/>
|
|
275
|
+
<CardV2Body
|
|
276
|
+
description={description}
|
|
277
|
+
actions={
|
|
278
|
+
hasBodyActions
|
|
279
|
+
? actionItems
|
|
280
|
+
: undefined
|
|
281
|
+
}
|
|
282
|
+
>
|
|
283
|
+
{children}
|
|
284
|
+
</CardV2Body>
|
|
285
|
+
<CardV2Footer
|
|
286
|
+
divider={shouldShowFooterDivider}
|
|
287
|
+
actions={
|
|
288
|
+
hasFooterActions
|
|
289
|
+
? actionItems
|
|
290
|
+
: undefined
|
|
291
|
+
}
|
|
292
|
+
>
|
|
293
|
+
{footer}
|
|
294
|
+
</CardV2Footer>
|
|
295
|
+
</Block>
|
|
296
|
+
)}
|
|
297
|
+
</Block>
|
|
298
|
+
)}
|
|
299
|
+
</StyledCard>
|
|
300
|
+
</CardV2Context.Provider>
|
|
301
|
+
)
|
|
302
|
+
}
|
|
303
|
+
)
|
|
304
|
+
|
|
305
|
+
CardV2Root.displayName = 'CardV2'
|
|
306
|
+
|
|
307
|
+
const CardV2: typeof CardV2Root & {
|
|
308
|
+
Header: typeof CardV2Header
|
|
309
|
+
Meta: typeof CardV2Meta
|
|
310
|
+
Media: typeof CardV2Media
|
|
311
|
+
Body: typeof CardV2Body
|
|
312
|
+
Content: typeof CardV2Content
|
|
313
|
+
Actions: typeof CardV2Actions
|
|
314
|
+
Footer: typeof CardV2Footer
|
|
315
|
+
Skeleton: typeof CardV2Skeleton
|
|
316
|
+
} = Object.assign(CardV2Root, {
|
|
317
|
+
Header: CardV2Header,
|
|
318
|
+
Meta: CardV2Meta,
|
|
319
|
+
Media: CardV2Media,
|
|
320
|
+
Body: CardV2Body,
|
|
321
|
+
Content: CardV2Content,
|
|
322
|
+
Actions: CardV2Actions,
|
|
323
|
+
Footer: CardV2Footer,
|
|
324
|
+
Skeleton: CardV2Skeleton,
|
|
325
|
+
})
|
|
326
|
+
|
|
327
|
+
export default CardV2
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import type { ReactNode } from 'react'
|
|
2
|
+
import Block from '../Primitives/Block/Block'
|
|
3
|
+
import Text from '../Text/Text'
|
|
4
|
+
import type { CardV2TokensType } from './cardV2.tokens'
|
|
5
|
+
import { CardV2Padding, type CardV2Action } from './cardV2.types'
|
|
6
|
+
|
|
7
|
+
export const isTextPrimitive = (value: unknown): value is string | number =>
|
|
8
|
+
typeof value === 'string' || typeof value === 'number'
|
|
9
|
+
|
|
10
|
+
export const toCardV2ActionArray = (
|
|
11
|
+
actions?: CardV2Action | CardV2Action[]
|
|
12
|
+
) => {
|
|
13
|
+
if (!actions) return []
|
|
14
|
+
return Array.isArray(actions) ? actions : [actions]
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export const getCardV2Padding = (
|
|
18
|
+
tokens: CardV2TokensType,
|
|
19
|
+
padding: CardV2Padding
|
|
20
|
+
) => {
|
|
21
|
+
const paddingTokens = tokens.padding[padding]
|
|
22
|
+
return `${String(paddingTokens.y)} ${String(paddingTokens.x)}`
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export const renderCardV2Text = ({
|
|
26
|
+
value,
|
|
27
|
+
id,
|
|
28
|
+
as,
|
|
29
|
+
styles,
|
|
30
|
+
dataElement,
|
|
31
|
+
truncate,
|
|
32
|
+
}: {
|
|
33
|
+
value?: ReactNode
|
|
34
|
+
id: string
|
|
35
|
+
as: 'p' | 'h2'
|
|
36
|
+
styles: React.CSSProperties
|
|
37
|
+
dataElement: string
|
|
38
|
+
truncate?: boolean
|
|
39
|
+
}) => {
|
|
40
|
+
if (!value) return null
|
|
41
|
+
const resolvedStyles = {
|
|
42
|
+
...styles,
|
|
43
|
+
margin: 0,
|
|
44
|
+
lineHeight:
|
|
45
|
+
typeof styles.lineHeight === 'number'
|
|
46
|
+
? `${styles.lineHeight}px`
|
|
47
|
+
: styles.lineHeight,
|
|
48
|
+
...(truncate
|
|
49
|
+
? {
|
|
50
|
+
overflow: 'hidden',
|
|
51
|
+
textOverflow: 'ellipsis',
|
|
52
|
+
whiteSpace: 'nowrap',
|
|
53
|
+
maxWidth: '100%',
|
|
54
|
+
}
|
|
55
|
+
: {}),
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
if (isTextPrimitive(value)) {
|
|
59
|
+
return (
|
|
60
|
+
<Text
|
|
61
|
+
as={as}
|
|
62
|
+
id={id}
|
|
63
|
+
style={resolvedStyles}
|
|
64
|
+
truncate={truncate}
|
|
65
|
+
data-element={dataElement}
|
|
66
|
+
>
|
|
67
|
+
{value}
|
|
68
|
+
</Text>
|
|
69
|
+
)
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
return (
|
|
73
|
+
<Block id={id} style={resolvedStyles} data-element={dataElement}>
|
|
74
|
+
{value}
|
|
75
|
+
</Block>
|
|
76
|
+
)
|
|
77
|
+
}
|