@juspay/blend-design-system 0.0.37-beta.7 → 0.0.37-beta.8
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/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/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/MultiSelect/MultiSelect.d.ts +1 -1
- package/dist/components/MultiSelect/MultiSelectMenu.d.ts +1 -1
- 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/SingleSelect/SingleSelect.d.ts +1 -1
- package/dist/components/SingleSelect/SingleSelectMenu.d.ts +2 -1
- 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/Snackbar/Snackbar.d.ts +1 -1
- package/dist/components/Snackbar/snackbar.tokens.d.ts +1 -0
- package/dist/components/Snackbar/types.d.ts +2 -0
- package/dist/main.js +18043 -17940
- package/dist/{node-C_DmV86X.js → node-CovJEwot.js} +16 -0
- package/dist/node.js +1 -1
- package/dist/{tokens.js → token-engine.js} +1 -1
- package/lib/components/CodeEditor/MonacoEditorWrapper.tsx +6 -2
- 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/DateRangePicker/CalendarGrid.tsx +3 -0
- package/lib/components/DateRangePicker/DateRangePicker.tsx +5 -1
- 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/MultiSelect/MultiSelect.tsx +2 -0
- package/lib/components/MultiSelect/MultiSelectMenu.tsx +8 -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/multiSelectV2.types.ts +2 -0
- package/lib/components/SingleSelect/SingleSelect.tsx +2 -0
- package/lib/components/SingleSelect/SingleSelectMenu.tsx +171 -138
- 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/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/Snackbar/Snackbar.tsx +18 -8
- 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/package.json +5 -4
- package/dist/tokens.d.ts +0 -2
|
@@ -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
|
{
|
|
@@ -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}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@juspay/blend-design-system",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.0.37-beta.
|
|
4
|
+
"version": "0.0.37-beta.8",
|
|
5
5
|
"description": "A comprehensive React component library and design system by Juspay",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "./dist/main.js",
|
|
@@ -23,8 +23,8 @@
|
|
|
23
23
|
"types": "./dist/node.d.ts"
|
|
24
24
|
},
|
|
25
25
|
"./tokens": {
|
|
26
|
-
"import": "./dist/
|
|
27
|
-
"types": "./dist/
|
|
26
|
+
"import": "./dist/token-engine.js",
|
|
27
|
+
"types": "./dist/token-engine.d.ts"
|
|
28
28
|
},
|
|
29
29
|
"./tokens/server": {
|
|
30
30
|
"import": "./dist/tokens-server.js",
|
|
@@ -36,7 +36,8 @@
|
|
|
36
36
|
"scripts": {
|
|
37
37
|
"lint": "eslint .",
|
|
38
38
|
"check:circular": "node scripts/check-circular.mjs",
|
|
39
|
-
"
|
|
39
|
+
"check:dist": "node scripts/check-dist.mjs",
|
|
40
|
+
"build": "pnpm lint && vite build && pnpm check:dist",
|
|
40
41
|
"prepublishOnly": "pnpm run build",
|
|
41
42
|
"test": "vitest",
|
|
42
43
|
"test:ui": "vitest --ui",
|
package/dist/tokens.d.ts
DELETED