@juspay/blend-design-system 0.0.37-beta.3 → 0.0.37-beta.4
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/AccordionV2/index.d.ts +3 -0
- package/dist/components/AvatarV2/avatarV2.utils.d.ts +1 -1
- package/dist/components/AvatarV2/index.d.ts +1 -2
- package/dist/components/BreadcrumbV2/index.d.ts +10 -0
- package/dist/components/ButtonV2/ButtonGroupV2/index.d.ts +1 -0
- package/dist/components/ButtonV2/buttonV2.types.d.ts +0 -4
- package/dist/components/ButtonV2/index.d.ts +3 -0
- package/dist/components/ButtonV2/utils.d.ts +1 -1
- package/dist/components/ChartsV2/index.d.ts +5 -0
- package/dist/components/CodeEditorV2/CodeEditorV2.d.ts +1 -1
- package/dist/components/CodeEditorV2/codeEditorV2.tokens.d.ts +5 -5
- package/dist/components/CodeEditorV2/codeEditorV2.types.d.ts +5 -5
- package/dist/components/CodeEditorV2/index.d.ts +2 -0
- package/dist/components/CodeEditorV2/utils.d.ts +1 -1
- package/dist/components/DataTable/DataTable.d.ts +2 -1
- package/dist/components/DataTable/PivotTableModal/PivotPreviewPanel.d.ts +3 -0
- package/dist/components/DataTable/PivotTableModal/PivotTableIllustration.d.ts +7 -0
- package/dist/components/DataTable/PivotTableModal/index.d.ts +3 -0
- package/dist/components/DataTable/PivotTableModal/pivotModalStyleTokens.d.ts +123 -0
- package/dist/components/DataTable/PivotTableModal/types.d.ts +62 -0
- package/dist/components/DataTable/PivotTableModal/utils.d.ts +32 -0
- package/dist/components/DataTable/TableBody/types.d.ts +2 -0
- package/dist/components/DataTable/TableHeader/types.d.ts +1 -0
- package/dist/components/DataTable/index.d.ts +2 -0
- package/dist/components/DataTable/types.d.ts +56 -0
- package/dist/components/DataTable/utils.d.ts +19 -1
- package/dist/components/InputsV2/ChatInputV2/AttachmentDropdown.d.ts +3 -3
- package/dist/components/InputsV2/ChatInputV2/ChatInputTagV2.d.ts +2 -2
- package/dist/components/InputsV2/ChatInputV2/ChatInputV2.d.ts +4 -4
- package/dist/components/InputsV2/ChatInputV2/ChatInputV2.types.d.ts +8 -8
- package/dist/components/InputsV2/ChatInputV2/ChatInputV2AttachmentRow.d.ts +3 -3
- package/dist/components/InputsV2/ChatInputV2/MobileChatInputV2.d.ts +2 -2
- package/dist/components/InputsV2/ChatInputV2/utils.d.ts +4 -4
- package/dist/components/InputsV2/SearchInputV2/utils.d.ts +39 -0
- package/dist/components/InputsV2/TextInputV2/TextInputV2.types.d.ts +2 -2
- package/dist/components/InputsV2/TextInputV2/index.d.ts +2 -0
- package/dist/components/InputsV2/utils/utils.d.ts +1 -1
- package/dist/components/KeyValuePairV2/KeyValuePairV2.d.ts +1 -1
- package/dist/components/KeyValuePairV2/ResponsiveText.d.ts +2 -2
- package/dist/components/KeyValuePairV2/index.d.ts +3 -0
- package/dist/components/KeyValuePairV2/keyValuePairV2.types.d.ts +2 -2
- package/dist/components/KeyValuePairV2/responsiveTextStyles.d.ts +3 -3
- package/dist/components/KeyValuePairV2/utils.d.ts +2 -2
- package/dist/components/MenuV2/index.d.ts +1 -0
- package/dist/components/MenuV2/menuV2.utils.d.ts +2 -2
- package/dist/components/MultiSelectV2/index.d.ts +3 -0
- package/dist/components/MultiSelectV2/multiSelectV2.types.d.ts +1 -1
- package/dist/components/MultiSelectV2/utils.d.ts +2 -2
- package/dist/components/ProgressBarV2/index.d.ts +3 -0
- package/dist/components/ProgressBarV2/utils.d.ts +1 -1
- package/dist/components/SelectV2/index.d.ts +1 -0
- package/dist/components/SelectorV2/CheckboxV2/index.d.ts +4 -0
- package/dist/components/SelectorV2/CheckboxV2/utils.d.ts +1 -1
- package/dist/components/SelectorV2/RadioV2/index.d.ts +3 -0
- package/dist/components/SelectorV2/SwitchV2/index.d.ts +1 -0
- package/dist/components/SidebarV2/index.d.ts +5 -0
- package/dist/components/SingleSelectV2/SingleSelectV2VirtualList.d.ts +2 -2
- package/dist/components/SingleSelectV2/index.d.ts +3 -0
- package/dist/components/SingleSelectV2/singleSelectV2.types.d.ts +2 -2
- package/dist/components/SingleSelectV2/utils.d.ts +6 -6
- package/dist/components/StatCardV2/index.d.ts +10 -1
- package/dist/components/StepperV2/index.d.ts +3 -1
- package/dist/components/StepperV2/stepperV2.types.d.ts +2 -2
- package/dist/components/TabsV2/index.d.ts +3 -1
- package/dist/components/TagV2/index.d.ts +3 -0
- package/dist/components/TooltipV2/index.d.ts +1 -0
- package/dist/components/common/index.d.ts +1 -1
- package/dist/main.d.ts +30 -70
- package/dist/main.js +87817 -85412
- package/dist/{node-CRWdZOVN.js → node-C2uf3sNA.js} +1303 -1300
- package/dist/node.js +1 -1
- package/dist/tokens.js +1 -1
- package/lib/components/AccordionV2/index.ts +3 -0
- package/lib/components/AvatarV2/AvatarV2.tsx +2 -2
- package/lib/components/AvatarV2/avatarV2.utils.ts +1 -1
- package/lib/components/AvatarV2/index.ts +1 -12
- package/lib/components/BreadcrumbV2/index.ts +10 -0
- package/lib/components/ButtonV2/ButtonGroupV2/index.ts +1 -0
- package/lib/components/ButtonV2/ButtonV2.tsx +2 -2
- package/lib/components/ButtonV2/LinkButton.tsx +2 -2
- package/lib/components/ButtonV2/buttonV2.types.ts +0 -6
- package/lib/components/ButtonV2/index.ts +3 -0
- package/lib/components/ButtonV2/utils.ts +2 -2
- package/lib/components/Charts/BlendChart.tsx +1 -1
- package/lib/components/ChartsV2/ChartV2.tsx +3 -2
- package/lib/components/ChartsV2/index.ts +5 -0
- package/lib/components/CodeEditorV2/CodeEditorV2.tsx +2 -2
- package/lib/components/CodeEditorV2/codeEditorV2.dark.tokens.ts +37 -25
- package/lib/components/CodeEditorV2/codeEditorV2.light.token.ts +37 -25
- package/lib/components/CodeEditorV2/codeEditorV2.tokens.ts +5 -5
- package/lib/components/CodeEditorV2/codeEditorV2.types.ts +5 -5
- package/lib/components/CodeEditorV2/index.ts +2 -0
- package/lib/components/CodeEditorV2/utils.ts +1 -1
- package/lib/components/DataTable/DataTable.tsx +148 -4
- package/lib/components/DataTable/PivotTableModal/PivotPreviewPanel.tsx +174 -0
- package/lib/components/DataTable/PivotTableModal/PivotTableIllustration.tsx +28 -0
- package/lib/components/DataTable/PivotTableModal/index.tsx +859 -0
- package/lib/components/DataTable/PivotTableModal/pivot-table-illustration.png +0 -0
- package/lib/components/DataTable/PivotTableModal/pivotModal.styled.ts +13 -0
- package/lib/components/DataTable/PivotTableModal/pivotModalStyleTokens.ts +250 -0
- package/lib/components/DataTable/PivotTableModal/types.ts +69 -0
- package/lib/components/DataTable/PivotTableModal/utils.ts +360 -0
- package/lib/components/DataTable/TableBody/index.tsx +16 -5
- package/lib/components/DataTable/TableBody/types.ts +2 -0
- package/lib/components/DataTable/TableHeader/index.tsx +6 -3
- package/lib/components/DataTable/TableHeader/types.ts +1 -0
- package/lib/components/DataTable/index.ts +4 -0
- package/lib/components/DataTable/types.ts +57 -0
- package/lib/components/DataTable/utils.ts +197 -0
- package/lib/components/InputsV2/ChatInputV2/AttachmentDropdown.tsx +3 -3
- package/lib/components/InputsV2/ChatInputV2/ChatInputTagV2.tsx +3 -3
- package/lib/components/InputsV2/ChatInputV2/ChatInputV2.types.ts +8 -8
- package/lib/components/InputsV2/ChatInputV2/ChatInputV2AttachmentRow.tsx +7 -7
- package/lib/components/InputsV2/ChatInputV2/utils.ts +8 -8
- package/lib/components/InputsV2/SearchInputV2/utils.ts +14 -1
- package/lib/components/InputsV2/TextInputV2/TextInputV2.tsx +3 -3
- package/lib/components/InputsV2/TextInputV2/TextInputV2.types.ts +2 -2
- package/lib/components/InputsV2/TextInputV2/index.ts +2 -0
- package/lib/components/KeyValuePairV2/KeyValuePairV2.tsx +6 -2
- package/lib/components/KeyValuePairV2/ResponsiveText.tsx +2 -2
- package/lib/components/KeyValuePairV2/index.ts +3 -0
- package/lib/components/KeyValuePairV2/keyValuePairV2.types.ts +2 -2
- package/lib/components/KeyValuePairV2/responsiveTextStyles.ts +3 -3
- package/lib/components/KeyValuePairV2/utils.ts +3 -3
- package/lib/components/MenuV2/MenuV2.tsx +2 -2
- package/lib/components/MenuV2/MenuV2SubMenu.tsx +2 -2
- package/lib/components/MenuV2/index.ts +1 -0
- package/lib/components/MenuV2/menuV2.utils.ts +4 -4
- package/lib/components/MultiSelectV2/MultiSelectV2.tsx +2 -2
- package/lib/components/MultiSelectV2/MultiSelectV2Menu.tsx +5 -2
- package/lib/components/MultiSelectV2/index.ts +3 -0
- package/lib/components/MultiSelectV2/mobile/MobileMultiSelectV2.tsx +7 -4
- package/lib/components/MultiSelectV2/multiSelectV2.types.ts +1 -1
- package/lib/components/MultiSelectV2/utils.ts +2 -2
- package/lib/components/ProgressBarV2/ProgressBarV2.tsx +5 -2
- package/lib/components/ProgressBarV2/index.ts +3 -0
- package/lib/components/ProgressBarV2/utils.ts +1 -1
- package/lib/components/SelectV2/index.ts +1 -0
- package/lib/components/SelectorV2/CheckboxV2/CheckboxV2.tsx +2 -2
- package/lib/components/SelectorV2/CheckboxV2/index.ts +4 -0
- package/lib/components/SelectorV2/CheckboxV2/utils.ts +1 -1
- package/lib/components/SelectorV2/RadioV2/index.ts +3 -0
- package/lib/components/SelectorV2/SwitchV2/index.ts +1 -0
- package/lib/components/Sidebar/Sidebar.tsx +7 -2
- package/lib/components/SidebarV2/index.ts +5 -0
- package/lib/components/SingleSelectV2/MobileSingleSelectV2.tsx +2 -2
- package/lib/components/SingleSelectV2/SingleSelectV2.tsx +10 -3
- package/lib/components/SingleSelectV2/SingleSelectV2Menu.tsx +4 -2
- package/lib/components/SingleSelectV2/SingleSelectV2VirtualList.tsx +5 -2
- package/lib/components/SingleSelectV2/index.ts +7 -0
- package/lib/components/SingleSelectV2/singleSelectV2.types.ts +2 -2
- package/lib/components/SingleSelectV2/utils.ts +10 -10
- package/lib/components/StatCardV2/index.ts +13 -1
- package/lib/components/StepperV2/index.ts +3 -1
- package/lib/components/StepperV2/stepperV2.types.ts +2 -2
- package/lib/components/TabsV2/index.ts +13 -1
- package/lib/components/TagV2/index.ts +3 -0
- package/lib/components/TooltipV2/index.ts +1 -0
- package/lib/components/common/index.ts +1 -1
- package/lib/main.ts +34 -258
- package/lib/types/assets.d.ts +24 -0
- package/package.json +2 -1
package/dist/node.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
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 c, g as b, p as d, o as u, n as S, m as p, a as h, l as m, j as v, i as x, k as A, h as C, f as M, e as B, d as E, c as N, b as P } from "./node-
|
|
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 c, g as b, p as d, o as u, n as S, m as p, a as h, l as m, j as v, i as x, k as A, h as C, f as M, e as B, d as E, c as N, b as P } from "./node-C2uf3sNA.js";
|
|
2
2
|
export {
|
|
3
3
|
a as FOUNDATION_THEME,
|
|
4
4
|
o as Theme,
|
package/dist/tokens.js
CHANGED
|
@@ -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 S, f as p, h, i as R, j as A, k as y, l as C, m as N, n as I, o as P, p as _, q as m, r as B, s as L, t as M, u as w, v as j, w as U, x as D, y as G, z as H } from "./node-
|
|
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 S, f as p, h, i as R, j as A, k as y, l as C, m as N, n as I, o as P, p as _, q as m, r as B, s as L, t as M, u as w, v as j, w as U, x as D, y as G, z as H } from "./node-C2uf3sNA.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 Se, canUserPerformAction as pe, 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 _e, hexToRgb as me, incrementVersion as Be, isValidHexColor as Le, listPresets as Me, meetsWCAG as we, 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));
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
export { default as AccordionV2 } from './AccordionV2'
|
|
2
2
|
export { AccordionV2Item } from './AccordionV2Item'
|
|
3
|
+
export { AccordionV2Chevron } from './AccordionV2Chevron'
|
|
4
|
+
export { AccordionV2TriggerContent } from './AccordionV2TriggerContent'
|
|
5
|
+
export * from './accordionV2.animations'
|
|
3
6
|
export * from './accordionV2.tokens'
|
|
4
7
|
export * from './accordionV2.types'
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
getAriaLiveValue,
|
|
22
22
|
getStatusPositionStyles,
|
|
23
23
|
renderFallbackContent,
|
|
24
|
-
|
|
24
|
+
createAvatarKeyboardHandler,
|
|
25
25
|
isInteractive,
|
|
26
26
|
} from './avatarV2.utils'
|
|
27
27
|
|
|
@@ -209,7 +209,7 @@ const AvatarV2 = forwardRef<HTMLDivElement, AvatarV2Props>(
|
|
|
209
209
|
onImageLoad?.()
|
|
210
210
|
}
|
|
211
211
|
|
|
212
|
-
const keyboardHandler =
|
|
212
|
+
const keyboardHandler = createAvatarKeyboardHandler(rest.onClick)
|
|
213
213
|
const filteredProps = filterBlockedProps(rest)
|
|
214
214
|
|
|
215
215
|
const renderAvatarContent = () => {
|
|
@@ -174,7 +174,7 @@ export function getStatusPositionStyles(
|
|
|
174
174
|
return { top, right }
|
|
175
175
|
}
|
|
176
176
|
}
|
|
177
|
-
export function
|
|
177
|
+
export function createAvatarKeyboardHandler(
|
|
178
178
|
onClick: ((event: React.MouseEvent<HTMLDivElement>) => void) | undefined
|
|
179
179
|
) {
|
|
180
180
|
if (!onClick) {
|
|
@@ -1,15 +1,4 @@
|
|
|
1
1
|
export { default as AvatarV2 } from './AvatarV2'
|
|
2
|
-
export
|
|
3
|
-
AvatarV2Props,
|
|
4
|
-
AvatarV2SkeletonConfig,
|
|
5
|
-
AvatarV2StatusConfig,
|
|
6
|
-
} from './avatarV2.types'
|
|
7
|
-
export {
|
|
8
|
-
AvatarV2Size,
|
|
9
|
-
AvatarV2Shape,
|
|
10
|
-
AvatarV2Status,
|
|
11
|
-
AvatarV2StatusPosition,
|
|
12
|
-
AvatarV2Variant,
|
|
13
|
-
} from './avatarV2.types'
|
|
2
|
+
export * from './avatarV2.types'
|
|
14
3
|
export * from './avatarV2.tokens'
|
|
15
4
|
export * from './avatarV2.utils'
|
|
@@ -1,3 +1,13 @@
|
|
|
1
1
|
export { default as BreadcrumbV2 } from './BreadcrumbV2'
|
|
2
|
+
export { default as BreadcrumbV2Icon } from './BreadcrumbV2Icon'
|
|
3
|
+
export { default as BreadcrumbV2Item } from './BreadcrumbV2Item'
|
|
4
|
+
export { default as BreadcrumbV2List } from './BreadcrumbV2List'
|
|
5
|
+
export type { BreadcrumbV2ListProps } from './BreadcrumbV2List'
|
|
6
|
+
export { default as BreadcrumbV2OverflowMenu } from './BreadcrumbV2OverflowMenu'
|
|
7
|
+
export type { BreadcrumbV2OverflowMenuProps } from './BreadcrumbV2OverflowMenu'
|
|
8
|
+
export { default as BreadcrumbV2Page } from './BreadcrumbV2Page'
|
|
9
|
+
export type { BreadcrumbV2PageProps } from './BreadcrumbV2Page'
|
|
10
|
+
export { default as BreadcrumbV2Separator } from './BreadcrumbV2Separator'
|
|
2
11
|
export * from './breadcrumbV2.tokens'
|
|
3
12
|
export * from './breadcrumbV2.types'
|
|
13
|
+
export * from './utils'
|
|
@@ -15,7 +15,7 @@ import Skeleton from '../Skeleton/Skeleton'
|
|
|
15
15
|
import PrimitiveButton from '../Primitives/PrimitiveButton/PrimitiveButton'
|
|
16
16
|
import { VisuallyHidden } from './VisuallyHidden'
|
|
17
17
|
import {
|
|
18
|
-
|
|
18
|
+
getButtonV2BorderRadius,
|
|
19
19
|
getButtonHeight,
|
|
20
20
|
getButtonStatus,
|
|
21
21
|
getButtonTabIndex,
|
|
@@ -208,7 +208,7 @@ const ButtonV2 = forwardRef<HTMLButtonElement, ButtonV2Props>(
|
|
|
208
208
|
onClick?.(event)
|
|
209
209
|
}
|
|
210
210
|
|
|
211
|
-
const borderRadius =
|
|
211
|
+
const borderRadius = getButtonV2BorderRadius(
|
|
212
212
|
size,
|
|
213
213
|
buttonType,
|
|
214
214
|
subType,
|
|
@@ -12,7 +12,7 @@ import { useResponsiveTokens } from '../../hooks/useResponsiveTokens'
|
|
|
12
12
|
import Skeleton from '../Skeleton/Skeleton'
|
|
13
13
|
import { renderButtonContent } from './ButtonV2'
|
|
14
14
|
import {
|
|
15
|
-
|
|
15
|
+
getButtonV2BorderRadius,
|
|
16
16
|
getButtonHeight,
|
|
17
17
|
getButtonStatus,
|
|
18
18
|
getSkeletonBorderRadius,
|
|
@@ -60,7 +60,7 @@ const LinkButton = forwardRef<HTMLAnchorElement, LinkButtonProps>(
|
|
|
60
60
|
)
|
|
61
61
|
const buttonStatus = getButtonStatus(isLoading, isDisabled)
|
|
62
62
|
|
|
63
|
-
const borderRadius =
|
|
63
|
+
const borderRadius = getButtonV2BorderRadius(
|
|
64
64
|
size,
|
|
65
65
|
buttonType,
|
|
66
66
|
subType,
|
|
@@ -34,12 +34,6 @@ export enum PaddingDirection {
|
|
|
34
34
|
LEFT = 'left',
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
// Legacy exports for backward compatibility
|
|
38
|
-
export const ButtonType = ButtonV2Type
|
|
39
|
-
export const ButtonSize = ButtonV2Size
|
|
40
|
-
export const ButtonSubType = ButtonV2SubType
|
|
41
|
-
export const ButtonState = ButtonV2State
|
|
42
|
-
|
|
43
37
|
export type ButtonSlot = {
|
|
44
38
|
slot: React.ReactNode
|
|
45
39
|
maxHeight?: string | number
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { default as ButtonV2 } from './ButtonV2'
|
|
2
|
+
export { renderButtonContent } from './ButtonV2'
|
|
2
3
|
export { default as IconButton } from './IconButton'
|
|
3
4
|
export { default as LinkButton } from './LinkButton'
|
|
4
5
|
export { ButtonGroupV2 } from './ButtonGroupV2'
|
|
@@ -6,3 +7,5 @@ export type { ButtonV2Props, LinkButtonProps } from './buttonV2.types'
|
|
|
6
7
|
export type { IconButtonProps } from './IconButton'
|
|
7
8
|
export type { ButtonGroupV2Props, ButtonGroupPosition } from './ButtonGroupV2'
|
|
8
9
|
export * from './buttonV2.types'
|
|
10
|
+
export * from './buttonV2.tokens'
|
|
11
|
+
export * from './utils'
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
import type { ButtonV2TokensType } from './buttonV2.tokens'
|
|
11
11
|
import { FOUNDATION_THEME } from '../../tokens'
|
|
12
12
|
|
|
13
|
-
export function
|
|
13
|
+
export function getButtonV2BorderRadius(
|
|
14
14
|
size: ButtonV2Size,
|
|
15
15
|
buttonType: ButtonV2Type,
|
|
16
16
|
subType: ButtonV2SubType,
|
|
@@ -101,7 +101,7 @@ export function getSkeletonBorderRadius(
|
|
|
101
101
|
buttonGroupPosition: 'center' | 'left' | 'right' | undefined,
|
|
102
102
|
tokens: ButtonV2TokensType
|
|
103
103
|
): string {
|
|
104
|
-
return
|
|
104
|
+
return getButtonV2BorderRadius(
|
|
105
105
|
size,
|
|
106
106
|
buttonType,
|
|
107
107
|
subType,
|
|
@@ -5,8 +5,9 @@ import {
|
|
|
5
5
|
ChartV2SeriesOptionsType,
|
|
6
6
|
} from './chartV2.types'
|
|
7
7
|
import Highcharts from 'highcharts'
|
|
8
|
-
import
|
|
9
|
-
|
|
8
|
+
import {
|
|
9
|
+
HighchartsReact,
|
|
10
|
+
type HighchartsReactProps,
|
|
10
11
|
} from 'highcharts-react-official'
|
|
11
12
|
import { useResponsiveTokens } from '../../hooks/useResponsiveTokens'
|
|
12
13
|
import { ChartV2TokensType } from './chartV2.tokens'
|
|
@@ -7,3 +7,8 @@ export { default as ChartV2Skeleton } from './ChartV2Skeleton'
|
|
|
7
7
|
export { default as ChartV2NoData } from './ChartV2NoData'
|
|
8
8
|
export * from './chartV2.tokens'
|
|
9
9
|
export * from './chartV2.types'
|
|
10
|
+
export { useChartLegend } from './useChartLegend'
|
|
11
|
+
export { useChartLegendHover } from './useChartLegendHover'
|
|
12
|
+
export { default as useChartRefs } from './useChartRefs'
|
|
13
|
+
export { getLegendItems, applyHoverState } from './utils'
|
|
14
|
+
export { mergeChartOptions } from './chartV2Options'
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
copyToClipboardWithTemporaryFeedback,
|
|
9
9
|
isDiffEditorMode,
|
|
10
10
|
shouldShowLineNumbers,
|
|
11
|
-
|
|
11
|
+
getCodeEditorV2ContainerStyles,
|
|
12
12
|
toCssValue,
|
|
13
13
|
} from './utils'
|
|
14
14
|
import { CodeEditorV2Header } from './CodeEditorV2Header'
|
|
@@ -91,7 +91,7 @@ const CodeEditorV2 = forwardRef<HTMLDivElement, CodeEditorV2Props>(
|
|
|
91
91
|
const resolvedEditorHeight = toCssValue(height)
|
|
92
92
|
const hasFixedEditorHeight = Boolean(resolvedEditorHeight)
|
|
93
93
|
const editorMinHeight = hasFixedEditorHeight ? height! : minHeight
|
|
94
|
-
const containerStyles =
|
|
94
|
+
const containerStyles = getCodeEditorV2ContainerStyles(
|
|
95
95
|
hasFixedEditorHeight ? undefined : minHeight,
|
|
96
96
|
maxHeight
|
|
97
97
|
)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FoundationTokenType } from '../../tokens/theme.token'
|
|
2
2
|
import { ResponsiveCodeEditorV2Tokens } from './codeEditorV2.tokens'
|
|
3
|
-
import {
|
|
3
|
+
import { CodeEditorV2DiffLineType, MonacoTheme } from './codeEditorV2.types'
|
|
4
4
|
|
|
5
5
|
export const darkCodeEditorV2Tokens = (
|
|
6
6
|
foundationToken: FoundationTokenType
|
|
@@ -41,20 +41,24 @@ export const darkCodeEditorV2Tokens = (
|
|
|
41
41
|
width: '40px',
|
|
42
42
|
color: foundationToken.colors.gray[0],
|
|
43
43
|
backgroundColor: {
|
|
44
|
-
[
|
|
44
|
+
[CodeEditorV2DiffLineType.UNCHANGED]:
|
|
45
45
|
foundationToken.colors.gray[200],
|
|
46
|
-
[
|
|
47
|
-
|
|
46
|
+
[CodeEditorV2DiffLineType.REMOVED]:
|
|
47
|
+
foundationToken.colors.red[500],
|
|
48
|
+
[CodeEditorV2DiffLineType.ADDED]:
|
|
49
|
+
foundationToken.colors.green[500],
|
|
48
50
|
},
|
|
49
51
|
borderLeft: {
|
|
50
|
-
[
|
|
51
|
-
[
|
|
52
|
-
[
|
|
52
|
+
[CodeEditorV2DiffLineType.UNCHANGED]: 'none',
|
|
53
|
+
[CodeEditorV2DiffLineType.REMOVED]: `2px solid ${foundationToken.colors.red[600]}`,
|
|
54
|
+
[CodeEditorV2DiffLineType.ADDED]: `2px solid ${foundationToken.colors.green[600]}`,
|
|
53
55
|
},
|
|
54
56
|
borderColor: {
|
|
55
|
-
[
|
|
56
|
-
[
|
|
57
|
-
|
|
57
|
+
[CodeEditorV2DiffLineType.UNCHANGED]: 'transparent',
|
|
58
|
+
[CodeEditorV2DiffLineType.REMOVED]:
|
|
59
|
+
foundationToken.colors.red[600],
|
|
60
|
+
[CodeEditorV2DiffLineType.ADDED]:
|
|
61
|
+
foundationToken.colors.green[600],
|
|
58
62
|
},
|
|
59
63
|
},
|
|
60
64
|
code: {
|
|
@@ -68,9 +72,11 @@ export const darkCodeEditorV2Tokens = (
|
|
|
68
72
|
},
|
|
69
73
|
highlightedLine: {
|
|
70
74
|
backgroundColor: {
|
|
71
|
-
[
|
|
72
|
-
[
|
|
73
|
-
|
|
75
|
+
[CodeEditorV2DiffLineType.UNCHANGED]: 'transparent',
|
|
76
|
+
[CodeEditorV2DiffLineType.REMOVED]:
|
|
77
|
+
foundationToken.colors.red[700],
|
|
78
|
+
[CodeEditorV2DiffLineType.ADDED]:
|
|
79
|
+
foundationToken.colors.green[700],
|
|
74
80
|
},
|
|
75
81
|
},
|
|
76
82
|
syntax: {
|
|
@@ -120,20 +126,24 @@ export const darkCodeEditorV2Tokens = (
|
|
|
120
126
|
width: '44px',
|
|
121
127
|
color: foundationToken.colors.gray[0],
|
|
122
128
|
backgroundColor: {
|
|
123
|
-
[
|
|
129
|
+
[CodeEditorV2DiffLineType.UNCHANGED]:
|
|
124
130
|
foundationToken.colors.gray[200],
|
|
125
|
-
[
|
|
126
|
-
|
|
131
|
+
[CodeEditorV2DiffLineType.REMOVED]:
|
|
132
|
+
foundationToken.colors.red[500],
|
|
133
|
+
[CodeEditorV2DiffLineType.ADDED]:
|
|
134
|
+
foundationToken.colors.green[500],
|
|
127
135
|
},
|
|
128
136
|
borderLeft: {
|
|
129
|
-
[
|
|
130
|
-
[
|
|
131
|
-
[
|
|
137
|
+
[CodeEditorV2DiffLineType.UNCHANGED]: 'none',
|
|
138
|
+
[CodeEditorV2DiffLineType.REMOVED]: `2px solid ${foundationToken.colors.red[600]}`,
|
|
139
|
+
[CodeEditorV2DiffLineType.ADDED]: `2px solid ${foundationToken.colors.green[600]}`,
|
|
132
140
|
},
|
|
133
141
|
borderColor: {
|
|
134
|
-
[
|
|
135
|
-
[
|
|
136
|
-
|
|
142
|
+
[CodeEditorV2DiffLineType.UNCHANGED]: 'transparent',
|
|
143
|
+
[CodeEditorV2DiffLineType.REMOVED]:
|
|
144
|
+
foundationToken.colors.red[600],
|
|
145
|
+
[CodeEditorV2DiffLineType.ADDED]:
|
|
146
|
+
foundationToken.colors.green[600],
|
|
137
147
|
},
|
|
138
148
|
},
|
|
139
149
|
code: {
|
|
@@ -147,9 +157,11 @@ export const darkCodeEditorV2Tokens = (
|
|
|
147
157
|
},
|
|
148
158
|
highlightedLine: {
|
|
149
159
|
backgroundColor: {
|
|
150
|
-
[
|
|
151
|
-
[
|
|
152
|
-
|
|
160
|
+
[CodeEditorV2DiffLineType.UNCHANGED]: 'transparent',
|
|
161
|
+
[CodeEditorV2DiffLineType.REMOVED]:
|
|
162
|
+
foundationToken.colors.red[700],
|
|
163
|
+
[CodeEditorV2DiffLineType.ADDED]:
|
|
164
|
+
foundationToken.colors.green[700],
|
|
153
165
|
},
|
|
154
166
|
},
|
|
155
167
|
syntax: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FoundationTokenType } from '../../tokens/theme.token'
|
|
2
2
|
import { ResponsiveCodeEditorV2Tokens } from './codeEditorV2.tokens'
|
|
3
|
-
import {
|
|
3
|
+
import { CodeEditorV2DiffLineType, MonacoTheme } from './codeEditorV2.types'
|
|
4
4
|
|
|
5
5
|
export const lightCodeEditorV2Tokens = (
|
|
6
6
|
foundationToken: FoundationTokenType
|
|
@@ -41,21 +41,25 @@ export const lightCodeEditorV2Tokens = (
|
|
|
41
41
|
width: '40px',
|
|
42
42
|
color: foundationToken.colors.gray[400],
|
|
43
43
|
backgroundColor: {
|
|
44
|
-
[
|
|
44
|
+
[CodeEditorV2DiffLineType.UNCHANGED]:
|
|
45
45
|
foundationToken.colors.gray[200],
|
|
46
|
-
[
|
|
47
|
-
|
|
46
|
+
[CodeEditorV2DiffLineType.REMOVED]:
|
|
47
|
+
foundationToken.colors.red[200],
|
|
48
|
+
[CodeEditorV2DiffLineType.ADDED]:
|
|
49
|
+
foundationToken.colors.green[200],
|
|
48
50
|
},
|
|
49
51
|
borderLeft: {
|
|
50
|
-
[
|
|
51
|
-
[
|
|
52
|
-
[
|
|
52
|
+
[CodeEditorV2DiffLineType.UNCHANGED]: 'none',
|
|
53
|
+
[CodeEditorV2DiffLineType.REMOVED]: `2px solid ${foundationToken.colors.red[600]}`,
|
|
54
|
+
[CodeEditorV2DiffLineType.ADDED]: `2px solid ${foundationToken.colors.green[600]}`,
|
|
53
55
|
},
|
|
54
56
|
borderColor: {
|
|
55
|
-
[
|
|
57
|
+
[CodeEditorV2DiffLineType.UNCHANGED]:
|
|
56
58
|
foundationToken.colors.gray[0],
|
|
57
|
-
[
|
|
58
|
-
|
|
59
|
+
[CodeEditorV2DiffLineType.REMOVED]:
|
|
60
|
+
foundationToken.colors.red[600],
|
|
61
|
+
[CodeEditorV2DiffLineType.ADDED]:
|
|
62
|
+
foundationToken.colors.green[600],
|
|
59
63
|
},
|
|
60
64
|
},
|
|
61
65
|
code: {
|
|
@@ -69,9 +73,11 @@ export const lightCodeEditorV2Tokens = (
|
|
|
69
73
|
},
|
|
70
74
|
highlightedLine: {
|
|
71
75
|
backgroundColor: {
|
|
72
|
-
[
|
|
73
|
-
[
|
|
74
|
-
|
|
76
|
+
[CodeEditorV2DiffLineType.UNCHANGED]: 'transparent',
|
|
77
|
+
[CodeEditorV2DiffLineType.REMOVED]:
|
|
78
|
+
foundationToken.colors.red[100],
|
|
79
|
+
[CodeEditorV2DiffLineType.ADDED]:
|
|
80
|
+
foundationToken.colors.green[100],
|
|
75
81
|
},
|
|
76
82
|
},
|
|
77
83
|
syntax: {
|
|
@@ -121,21 +127,25 @@ export const lightCodeEditorV2Tokens = (
|
|
|
121
127
|
width: '44px',
|
|
122
128
|
color: foundationToken.colors.gray[400],
|
|
123
129
|
backgroundColor: {
|
|
124
|
-
[
|
|
130
|
+
[CodeEditorV2DiffLineType.UNCHANGED]:
|
|
125
131
|
foundationToken.colors.gray[200],
|
|
126
|
-
[
|
|
127
|
-
|
|
132
|
+
[CodeEditorV2DiffLineType.REMOVED]:
|
|
133
|
+
foundationToken.colors.red[200],
|
|
134
|
+
[CodeEditorV2DiffLineType.ADDED]:
|
|
135
|
+
foundationToken.colors.green[200],
|
|
128
136
|
},
|
|
129
137
|
borderLeft: {
|
|
130
|
-
[
|
|
131
|
-
[
|
|
132
|
-
[
|
|
138
|
+
[CodeEditorV2DiffLineType.UNCHANGED]: 'none',
|
|
139
|
+
[CodeEditorV2DiffLineType.REMOVED]: `2px solid ${foundationToken.colors.red[600]}`,
|
|
140
|
+
[CodeEditorV2DiffLineType.ADDED]: `2px solid ${foundationToken.colors.green[600]}`,
|
|
133
141
|
},
|
|
134
142
|
borderColor: {
|
|
135
|
-
[
|
|
143
|
+
[CodeEditorV2DiffLineType.UNCHANGED]:
|
|
136
144
|
foundationToken.colors.gray[0],
|
|
137
|
-
[
|
|
138
|
-
|
|
145
|
+
[CodeEditorV2DiffLineType.REMOVED]:
|
|
146
|
+
foundationToken.colors.red[600],
|
|
147
|
+
[CodeEditorV2DiffLineType.ADDED]:
|
|
148
|
+
foundationToken.colors.green[600],
|
|
139
149
|
},
|
|
140
150
|
},
|
|
141
151
|
code: {
|
|
@@ -149,9 +159,11 @@ export const lightCodeEditorV2Tokens = (
|
|
|
149
159
|
},
|
|
150
160
|
highlightedLine: {
|
|
151
161
|
backgroundColor: {
|
|
152
|
-
[
|
|
153
|
-
[
|
|
154
|
-
|
|
162
|
+
[CodeEditorV2DiffLineType.UNCHANGED]: 'transparent',
|
|
163
|
+
[CodeEditorV2DiffLineType.REMOVED]:
|
|
164
|
+
foundationToken.colors.red[100],
|
|
165
|
+
[CodeEditorV2DiffLineType.ADDED]:
|
|
166
|
+
foundationToken.colors.green[100],
|
|
155
167
|
},
|
|
156
168
|
},
|
|
157
169
|
syntax: {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { CSSObject } from 'styled-components'
|
|
2
|
-
import { DiffLineType } from './codeEditorV2.types'
|
|
3
2
|
import { BreakpointType } from '../../breakpoints/breakPoints'
|
|
4
3
|
import { FoundationTokenType } from '../../tokens/theme.token'
|
|
5
4
|
import { darkCodeEditorV2Tokens } from './codeEditorV2.dark.tokens'
|
|
6
5
|
import { lightCodeEditorV2Tokens } from './codeEditorV2.light.token'
|
|
7
6
|
import { Theme } from '../../context/theme.enum'
|
|
7
|
+
import { CodeEditorV2DiffLineType } from './codeEditorV2.types'
|
|
8
8
|
|
|
9
9
|
export type CodeEditorV2Tokens = {
|
|
10
10
|
backgroundColor: CSSObject['backgroundColor']
|
|
@@ -44,13 +44,13 @@ export type CodeEditorV2Tokens = {
|
|
|
44
44
|
width: CSSObject['width']
|
|
45
45
|
color: CSSObject['color']
|
|
46
46
|
backgroundColor: {
|
|
47
|
-
[key in
|
|
47
|
+
[key in CodeEditorV2DiffLineType]: CSSObject['backgroundColor']
|
|
48
48
|
}
|
|
49
49
|
borderLeft: {
|
|
50
|
-
[key in
|
|
50
|
+
[key in CodeEditorV2DiffLineType]: CSSObject['borderLeft']
|
|
51
51
|
}
|
|
52
52
|
borderColor: {
|
|
53
|
-
[key in
|
|
53
|
+
[key in CodeEditorV2DiffLineType]: CSSObject['color']
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
56
|
// Code tokens
|
|
@@ -66,7 +66,7 @@ export type CodeEditorV2Tokens = {
|
|
|
66
66
|
// Highlighted line tokens (for diff mode and code highlighting)
|
|
67
67
|
highlightedLine: {
|
|
68
68
|
backgroundColor: {
|
|
69
|
-
[key in
|
|
69
|
+
[key in CodeEditorV2DiffLineType]: CSSObject['backgroundColor']
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
72
|
// Syntax highlighting tokens
|
|
@@ -11,18 +11,18 @@ export enum MonacoTheme {
|
|
|
11
11
|
LIGHT = 'light',
|
|
12
12
|
DARK = 'dark',
|
|
13
13
|
}
|
|
14
|
-
export enum
|
|
14
|
+
export enum CodeEditorV2DiffLineType {
|
|
15
15
|
ADDED = 'added',
|
|
16
16
|
REMOVED = 'removed',
|
|
17
17
|
UNCHANGED = 'unchanged',
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
export type
|
|
20
|
+
export type CodeEditorV2DiffLine = {
|
|
21
21
|
content: string
|
|
22
|
-
type:
|
|
22
|
+
type: CodeEditorV2DiffLineType
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
export type
|
|
25
|
+
export type CodeEditorV2SupportedLanguage =
|
|
26
26
|
| 'javascript'
|
|
27
27
|
| 'typescript'
|
|
28
28
|
| 'jsx'
|
|
@@ -57,7 +57,7 @@ export type CodeEditorV2Props = {
|
|
|
57
57
|
rightSlot?: ReactNode
|
|
58
58
|
showCopyButton?: boolean
|
|
59
59
|
}
|
|
60
|
-
language?:
|
|
60
|
+
language?: CodeEditorV2SupportedLanguage
|
|
61
61
|
placeholder?: string
|
|
62
62
|
readOnly?: boolean
|
|
63
63
|
disabled?: boolean
|
|
@@ -98,7 +98,7 @@ export const isDiffEditorMode = (
|
|
|
98
98
|
/**
|
|
99
99
|
* Calculates container styles with min/max height
|
|
100
100
|
*/
|
|
101
|
-
export const
|
|
101
|
+
export const getCodeEditorV2ContainerStyles = (
|
|
102
102
|
minHeight?: string | number,
|
|
103
103
|
maxHeight?: string | number
|
|
104
104
|
): React.CSSProperties => {
|