@juspay/blend-design-system 0.0.37-beta.6 → 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.
Files changed (92) hide show
  1. package/dist/components/CodeEditor/types.d.ts +22 -2
  2. package/dist/components/CodeEditorV2/CodeEditorV2.d.ts +1 -1
  3. package/dist/components/CodeEditorV2/codeEditorV2.types.d.ts +23 -2
  4. package/dist/components/DataTable/TableBody/types.d.ts +1 -0
  5. package/dist/components/DataTable/TableCell/types.d.ts +1 -0
  6. package/dist/components/DataTable/columnTypes.d.ts +5 -3
  7. package/dist/components/DataTable/dataTable.tokens.d.ts +4 -0
  8. package/dist/components/DataTable/types.d.ts +20 -2
  9. package/dist/components/DataTable/utils.d.ts +4 -3
  10. package/dist/components/MenuV2/MenuV2Content.d.ts +1 -0
  11. package/dist/components/MenuV2/menuV2.types.d.ts +5 -0
  12. package/dist/components/MenuV2/menuV2.utils.d.ts +10 -2
  13. package/dist/components/MultiSelect/MultiSelect.d.ts +1 -1
  14. package/dist/components/MultiSelect/MultiSelectMenu.d.ts +1 -1
  15. package/dist/components/MultiSelect/types.d.ts +2 -0
  16. package/dist/components/MultiSelectV2/MultiSelectV2.d.ts +1 -1
  17. package/dist/components/MultiSelectV2/MultiSelectV2Menu.d.ts +1 -1
  18. package/dist/components/MultiSelectV2/multiSelectV2.types.d.ts +2 -0
  19. package/dist/components/SingleSelect/SingleSelect.d.ts +1 -1
  20. package/dist/components/SingleSelect/SingleSelectMenu.d.ts +2 -1
  21. package/dist/components/SingleSelect/types.d.ts +1 -0
  22. package/dist/components/SingleSelectV2/SingleSelectV2.d.ts +1 -1
  23. package/dist/components/SingleSelectV2/SingleSelectV2Menu.d.ts +1 -1
  24. package/dist/components/SingleSelectV2/singleSelectV2.tokens.types.d.ts +8 -0
  25. package/dist/components/SingleSelectV2/singleSelectV2.types.d.ts +2 -0
  26. package/dist/components/Skeleton/hooks/useSkeletonBase.d.ts +7 -11
  27. package/dist/components/Snackbar/Snackbar.d.ts +1 -1
  28. package/dist/components/Snackbar/snackbar.tokens.d.ts +1 -0
  29. package/dist/components/Snackbar/types.d.ts +2 -0
  30. package/dist/components/StatCardV2/StatCardV2.d.ts +1 -0
  31. package/dist/components/StatCardV2/StatCardV2NoData.d.ts +2 -2
  32. package/dist/components/StatCardV2/statcardV2.types.d.ts +1 -0
  33. package/dist/components/TabsV2/tabsV2.tokens.types.d.ts +3 -0
  34. package/dist/global-utils/GlobalUtils.d.ts +2 -1
  35. package/dist/main.js +27446 -27271
  36. package/dist/{node-CJ_Tft0g.js → node-CovJEwot.js} +65 -25
  37. package/dist/node.js +1 -1
  38. package/dist/{tokens.js → token-engine.js} +1 -1
  39. package/lib/components/Card/Card.tsx +1 -0
  40. package/lib/components/Charts/ChartHeader.tsx +4 -1
  41. package/lib/components/CodeBlock/CodeBlock.tsx +8 -4
  42. package/lib/components/CodeEditor/MonacoEditorWrapper.tsx +6 -2
  43. package/lib/components/CodeEditor/types.ts +52 -2
  44. package/lib/components/CodeEditorV2/MonacoEditor/MonacoEditorWrapper.tsx +6 -2
  45. package/lib/components/CodeEditorV2/codeEditorV2.types.ts +44 -5
  46. package/lib/components/DataTable/DataTable.tsx +2 -0
  47. package/lib/components/DataTable/TableBody/index.tsx +2 -0
  48. package/lib/components/DataTable/TableBody/types.ts +1 -0
  49. package/lib/components/DataTable/TableCell/index.tsx +45 -20
  50. package/lib/components/DataTable/TableCell/types.ts +1 -0
  51. package/lib/components/DataTable/columnTypes.ts +5 -3
  52. package/lib/components/DataTable/dataTable.tokens.ts +15 -0
  53. package/lib/components/DataTable/types.ts +33 -2
  54. package/lib/components/DataTable/utils.ts +91 -5
  55. package/lib/components/DateRangePicker/CalendarGrid.tsx +3 -0
  56. package/lib/components/DateRangePicker/DateRangePicker.tsx +5 -1
  57. package/lib/components/MenuV2/MenuV2.tsx +9 -2
  58. package/lib/components/MenuV2/MenuV2Content.tsx +6 -0
  59. package/lib/components/MenuV2/MenuV2SubMenu.tsx +16 -2
  60. package/lib/components/MenuV2/menuV2.types.ts +11 -0
  61. package/lib/components/MenuV2/menuV2.utils.ts +45 -3
  62. package/lib/components/MultiSelect/MultiSelect.tsx +2 -0
  63. package/lib/components/MultiSelect/MultiSelectMenu.tsx +8 -0
  64. package/lib/components/MultiSelect/types.ts +2 -0
  65. package/lib/components/MultiSelectV2/MultiSelectV2.tsx +2 -0
  66. package/lib/components/MultiSelectV2/MultiSelectV2Menu.tsx +8 -0
  67. package/lib/components/MultiSelectV2/multiSelectV2.types.ts +2 -0
  68. package/lib/components/SingleSelect/SingleSelect.tsx +2 -0
  69. package/lib/components/SingleSelect/SingleSelectMenu.tsx +171 -138
  70. package/lib/components/SingleSelect/types.ts +1 -0
  71. package/lib/components/SingleSelectV2/SingleSelectV2.tsx +2 -0
  72. package/lib/components/SingleSelectV2/SingleSelectV2Menu.tsx +84 -58
  73. package/lib/components/SingleSelectV2/SingleSelectV2Search.tsx +1 -0
  74. package/lib/components/SingleSelectV2/singleSelectV2.dark.tokens.ts +8 -0
  75. package/lib/components/SingleSelectV2/singleSelectV2.light.tokens.ts +8 -0
  76. package/lib/components/SingleSelectV2/singleSelectV2.tokens.types.ts +8 -0
  77. package/lib/components/SingleSelectV2/singleSelectV2.types.ts +2 -0
  78. package/lib/components/Skeleton/hooks/useSkeletonBase.ts +11 -1
  79. package/lib/components/Snackbar/Snackbar.tsx +18 -8
  80. package/lib/components/Snackbar/snackbar.tokens.ts +6 -0
  81. package/lib/components/Snackbar/types.ts +2 -0
  82. package/lib/components/StatCard/StatCard.tsx +39 -2
  83. package/lib/components/StatCardV2/StatCardV2.tsx +8 -6
  84. package/lib/components/StatCardV2/StatCardV2NoData.tsx +8 -6
  85. package/lib/components/StatCardV2/statcardV2.types.ts +1 -0
  86. package/lib/components/TabsV2/TabsV2List.tsx +5 -1
  87. package/lib/components/TabsV2/tabsV2.dark.tokens.ts +12 -0
  88. package/lib/components/TabsV2/tabsV2.light.tokens.ts +12 -0
  89. package/lib/components/TabsV2/tabsV2.tokens.types.ts +3 -0
  90. package/lib/global-utils/GlobalUtils.ts +10 -1
  91. package/package.json +5 -4
  92. package/dist/tokens.d.ts +0 -2
@@ -1,4 +1,4 @@
1
- const L = {
1
+ const E = {
2
2
  xs: "0px 1px 1px 0px rgba(5, 5, 6, 0.04)",
3
3
  sm: "0px 2px 3px 0px rgba(5, 5, 6, 0.05)",
4
4
  md: "0px 2px 8px 1px rgba(5, 5, 6, 0.07)",
@@ -265,7 +265,7 @@ const L = {
265
265
  200: "200px",
266
266
  350: "350px",
267
267
  auto: "auto"
268
- }, a = {
268
+ }, C = {
269
269
  gray: {
270
270
  0: "#FFFFFF",
271
271
  25: "#FCFCFD",
@@ -361,7 +361,7 @@ const L = {
361
361
  900: "#733E0A",
362
362
  950: "#432004"
363
363
  }
364
- }, C = {
364
+ }, a = {
365
365
  0: 0,
366
366
  10: 10,
367
367
  99: 99,
@@ -372,13 +372,13 @@ const L = {
372
372
  1100: 1100,
373
373
  1200: 1200
374
374
  }, Ur = {
375
- shadows: L,
375
+ shadows: E,
376
376
  border: N,
377
377
  font: H,
378
378
  opacity: D,
379
379
  unit: I,
380
- colors: a,
381
- zIndex: C
380
+ colors: C,
381
+ zIndex: a
382
382
  };
383
383
  var h = /* @__PURE__ */ ((r) => (r.LIGHT = "light", r.DARK = "dark", r))(h || {});
384
384
  const Xr = (r) => ({
@@ -2240,7 +2240,7 @@ const Xr = (r) => ({
2240
2240
  }
2241
2241
  }
2242
2242
  }
2243
- }), W = (r) => ({
2243
+ }), G = (r) => ({
2244
2244
  sm: {
2245
2245
  gap: r.unit[10],
2246
2246
  // Pattern: backgroundColor.[variant].[subType].[state]
@@ -3639,7 +3639,7 @@ const Xr = (r) => ({
3639
3639
  }
3640
3640
  }
3641
3641
  }
3642
- }), Vr = (r, c = h.LIGHT) => c === h.DARK || c === "dark" ? W(r) : A(r), G = (r) => ({
3642
+ }), Vr = (r, c = h.LIGHT) => c === h.DARK || c === "dark" ? G(r) : A(r), W = (r) => ({
3643
3643
  sm: {
3644
3644
  gap: r.unit[6],
3645
3645
  backgroundColor: {
@@ -4309,7 +4309,7 @@ const Xr = (r) => ({
4309
4309
  }
4310
4310
  }
4311
4311
  }
4312
- }), qr = (r, c = h.LIGHT) => c === h.DARK || c === "dark" ? G(r) : B(r);
4312
+ }), qr = (r, c = h.LIGHT) => c === h.DARK || c === "dark" ? W(r) : B(r);
4313
4313
  var M = /* @__PURE__ */ ((r) => (r.START = "start", r.CENTER = "center", r.END = "end", r))(M || {}), F = /* @__PURE__ */ ((r) => (r.TOP = "top", r.LEFT = "left", r.RIGHT = "right", r.BOTTOM = "bottom", r))(F || {}), m = /* @__PURE__ */ ((r) => (r.DEFAULT = "default", r.ACTION = "action", r))(m || {}), x = /* @__PURE__ */ ((r) => (r.PRIMARY = "primary", r.DANGER = "danger", r))(x || {});
4314
4314
  const U = (r) => ({
4315
4315
  sm: {
@@ -7082,6 +7082,14 @@ const f = (r) => {
7082
7082
  color: r.colors.gray[600]
7083
7083
  },
7084
7084
  iconColor: r.colors.gray[400]
7085
+ },
7086
+ footer: {
7087
+ paddingTop: r.unit[16],
7088
+ paddingRight: r.unit[16],
7089
+ paddingBottom: r.unit[16],
7090
+ paddingLeft: r.unit[16],
7091
+ backgroundColor: r.colors.gray[0],
7092
+ borderTop: `${r.border.width[1]} solid ${r.colors.gray[200]}`
7085
7093
  }
7086
7094
  },
7087
7095
  mobilePanel: {
@@ -7428,6 +7436,14 @@ const f = (r) => {
7428
7436
  color: r.colors.gray[200]
7429
7437
  },
7430
7438
  iconColor: r.colors.gray[500]
7439
+ },
7440
+ footer: {
7441
+ paddingTop: r.unit[16],
7442
+ paddingRight: r.unit[16],
7443
+ paddingBottom: r.unit[16],
7444
+ paddingLeft: r.unit[16],
7445
+ backgroundColor: r.colors.gray[800],
7446
+ borderTop: `${r.border.width[1]} solid ${r.colors.gray[700]}`
7431
7447
  }
7432
7448
  },
7433
7449
  mobilePanel: {
@@ -11649,7 +11665,7 @@ const $r = (r) => ({
11649
11665
  }
11650
11666
  }
11651
11667
  }
11652
- }), l0 = (r, c = h.LIGHT) => c === h.DARK || c === "dark" ? Rr(r) : Or(r), Er = (r) => ({
11668
+ }), l0 = (r, c = h.LIGHT) => c === h.DARK || c === "dark" ? Rr(r) : Or(r), Lr = (r) => ({
11653
11669
  sm: {
11654
11670
  gap: r.unit[8],
11655
11671
  group: {
@@ -11918,7 +11934,7 @@ const $r = (r) => ({
11918
11934
  }
11919
11935
  }
11920
11936
  }
11921
- }), Lr = (r) => ({
11937
+ }), Er = (r) => ({
11922
11938
  sm: {
11923
11939
  gap: r.unit[8],
11924
11940
  group: {
@@ -12187,7 +12203,7 @@ const $r = (r) => ({
12187
12203
  }
12188
12204
  }
12189
12205
  }
12190
- }), s0 = (r, c = h.LIGHT) => c === h.DARK || c === "dark" ? Lr(r) : Er(r), Nr = (r) => ({
12206
+ }), s0 = (r, c = h.LIGHT) => c === h.DARK || c === "dark" ? Er(r) : Lr(r), Nr = (r) => ({
12191
12207
  sm: {
12192
12208
  // background (size-independent)
12193
12209
  background: r.colors.gray[0],
@@ -12738,6 +12754,12 @@ const Dr = (r) => ({
12738
12754
  }
12739
12755
  }
12740
12756
  },
12757
+ borderBottom: {
12758
+ [l.UNDERLINE]: `${r.border.width[1]} solid ${r.colors.gray[200]}`,
12759
+ [l.BOXED]: "none",
12760
+ [l.FLOATING]: "none",
12761
+ [l.PILLS]: "none"
12762
+ },
12741
12763
  activeIndicator: {
12742
12764
  height: r.border.width[2],
12743
12765
  color: r.colors.gray[700],
@@ -13051,6 +13073,12 @@ const Dr = (r) => ({
13051
13073
  }
13052
13074
  }
13053
13075
  },
13076
+ borderBottom: {
13077
+ [l.UNDERLINE]: `${r.border.width[1]} solid ${r.colors.gray[200]}`,
13078
+ [l.BOXED]: "none",
13079
+ [l.FLOATING]: "none",
13080
+ [l.PILLS]: "none"
13081
+ },
13054
13082
  activeIndicator: {
13055
13083
  height: r.border.width[2],
13056
13084
  color: r.colors.gray[700],
@@ -13365,6 +13393,12 @@ const Dr = (r) => ({
13365
13393
  }
13366
13394
  }
13367
13395
  },
13396
+ borderBottom: {
13397
+ [l.UNDERLINE]: `${r.border.width[1]} solid ${r.colors.gray[700]}`,
13398
+ [l.BOXED]: "none",
13399
+ [l.FLOATING]: "none",
13400
+ [l.PILLS]: "none"
13401
+ },
13368
13402
  activeIndicator: {
13369
13403
  height: r.border.width[2],
13370
13404
  color: r.colors.gray[200],
@@ -13678,6 +13712,12 @@ const Dr = (r) => ({
13678
13712
  }
13679
13713
  }
13680
13714
  },
13715
+ borderBottom: {
13716
+ [l.UNDERLINE]: `${r.border.width[1]} solid ${r.colors.gray[700]}`,
13717
+ [l.BOXED]: "none",
13718
+ [l.FLOATING]: "none",
13719
+ [l.PILLS]: "none"
13720
+ },
13681
13721
  activeIndicator: {
13682
13722
  height: r.border.width[2],
13683
13723
  color: r.colors.gray[200],
@@ -13881,10 +13921,10 @@ const Dr = (r) => ({
13881
13921
  }
13882
13922
  }
13883
13923
  }), c0 = (r, c = h.LIGHT) => c === h.DARK || c === "dark" ? Ir(r) : Dr(r);
13884
- var e = /* @__PURE__ */ ((r) => (r.ADDED = "added", r.REMOVED = "removed", r.UNCHANGED = "unchanged", r))(e || {}), ar = /* @__PURE__ */ ((r) => (r.DEFAULT = "default", r.NO_GUTTER = "no-gutter", r.DIFF = "diff", r))(ar || {}), E = /* @__PURE__ */ ((r) => (r.LIGHT = "light", r.DARK = "dark", r))(E || {});
13885
- const Cr = (r) => ({
13924
+ var e = /* @__PURE__ */ ((r) => (r.ADDED = "added", r.REMOVED = "removed", r.UNCHANGED = "unchanged", r))(e || {}), Cr = /* @__PURE__ */ ((r) => (r.DEFAULT = "default", r.NO_GUTTER = "no-gutter", r.DIFF = "diff", r))(Cr || {}), L = /* @__PURE__ */ ((r) => (r.LIGHT = "light", r.DARK = "dark", r))(L || {});
13925
+ const ar = (r) => ({
13886
13926
  sm: {
13887
- theme: E.DARK,
13927
+ theme: L.DARK,
13888
13928
  backgroundColor: r.colors.gray[25],
13889
13929
  border: `1px solid ${r.colors.gray[200]}`,
13890
13930
  borderRadius: r.border.radius[8],
@@ -13961,7 +14001,7 @@ const Cr = (r) => ({
13961
14001
  }
13962
14002
  },
13963
14003
  lg: {
13964
- theme: E.DARK,
14004
+ theme: L.DARK,
13965
14005
  backgroundColor: r.colors.gray[25],
13966
14006
  border: `1px solid ${r.colors.gray[200]}`,
13967
14007
  borderRadius: r.border.radius[8],
@@ -14043,7 +14083,7 @@ const Cr = (r) => ({
14043
14083
  border: `1px solid ${r.colors.gray[200]}`,
14044
14084
  borderRadius: r.border.radius[8],
14045
14085
  boxShadow: "0px 2px 3px 0px rgba(5, 5, 6, 0.05)",
14046
- theme: E.LIGHT,
14086
+ theme: L.LIGHT,
14047
14087
  header: {
14048
14088
  backgroundColor: r.colors.gray[50],
14049
14089
  borderBottom: `1px solid ${r.colors.gray[200]}`,
@@ -14120,7 +14160,7 @@ const Cr = (r) => ({
14120
14160
  border: `1px solid ${r.colors.gray[200]}`,
14121
14161
  borderRadius: r.border.radius[8],
14122
14162
  boxShadow: "0px 2px 3px 0px rgba(5, 5, 6, 0.05)",
14123
- theme: E.LIGHT,
14163
+ theme: L.LIGHT,
14124
14164
  header: {
14125
14165
  backgroundColor: r.colors.gray[50],
14126
14166
  borderBottom: `1px solid ${r.colors.gray[200]}`,
@@ -14192,9 +14232,9 @@ const Cr = (r) => ({
14192
14232
  }
14193
14233
  }
14194
14234
  }
14195
- }), t0 = (r, c = h.LIGHT) => c === h.DARK || c === "dark" ? Cr(r) : Ar(r);
14196
- var b = /* @__PURE__ */ ((r) => (r.SM = "sm", r.MD = "md", r.LG = "lg", r))(b || {}), Wr = /* @__PURE__ */ ((r) => (r.LINEAR = "linear", r.CIRCULAR = "circular", r))(Wr || {}), i = /* @__PURE__ */ ((r) => (r.SOLID = "solid", r.SEGMENTED = "segmented", r))(i || {});
14197
- const Gr = (r) => ({
14235
+ }), t0 = (r, c = h.LIGHT) => c === h.DARK || c === "dark" ? ar(r) : Ar(r);
14236
+ var b = /* @__PURE__ */ ((r) => (r.SM = "sm", r.MD = "md", r.LG = "lg", r))(b || {}), Gr = /* @__PURE__ */ ((r) => (r.LINEAR = "linear", r.CIRCULAR = "circular", r))(Gr || {}), i = /* @__PURE__ */ ((r) => (r.SOLID = "solid", r.SEGMENTED = "segmented", r))(i || {});
14237
+ const Wr = (r) => ({
14198
14238
  sm: {
14199
14239
  linear: {
14200
14240
  height: {
@@ -14576,7 +14616,7 @@ const Gr = (r) => ({
14576
14616
  },
14577
14617
  transition: "width 0.3s ease-in-out"
14578
14618
  }
14579
- }), i0 = (r, c = h.LIGHT) => c === h.DARK || c === "dark" ? Gr(r) : Br(r), Mr = (r) => ({
14619
+ }), i0 = (r, c = h.LIGHT) => c === h.DARK || c === "dark" ? Wr(r) : Br(r), Mr = (r) => ({
14580
14620
  sm: {
14581
14621
  gap: r.unit[0],
14582
14622
  item: {
@@ -14688,7 +14728,7 @@ export {
14688
14728
  rr as I,
14689
14729
  s as J,
14690
14730
  z as K,
14691
- Wr as L,
14731
+ Gr as L,
14692
14732
  m as M,
14693
14733
  b as N,
14694
14734
  u as O,
@@ -14702,8 +14742,8 @@ export {
14702
14742
  l as W,
14703
14743
  t as X,
14704
14744
  R as Y,
14705
- ar as Z,
14706
- E as _,
14745
+ Cr as Z,
14746
+ L as _,
14707
14747
  _r as a,
14708
14748
  v as a0,
14709
14749
  O as a1,
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-CJ_Tft0g.js";
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-CovJEwot.js";
2
2
  export {
3
3
  a as FOUNDATION_THEME,
4
4
  o as Theme,
@@ -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 "./node-CJ_Tft0g.js";
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 "./node-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));
@@ -108,6 +108,7 @@ const Card = forwardRef<HTMLDivElement, CardProps>(
108
108
  borderRadius={cardToken.borderRadius}
109
109
  backgroundColor={cardToken.backgroundColor}
110
110
  boxShadow={cardToken.boxShadow}
111
+ overflow="hidden"
111
112
  display="flex"
112
113
  flexDirection="column"
113
114
  onMouseEnter={handleMouseEnter}
@@ -55,8 +55,11 @@ const ChartHeader: React.FC<ChartHeaderProps> = ({
55
55
  }
56
56
  role="group"
57
57
  aria-label="Chart header"
58
+ width="100%"
58
59
  >
59
- <Block data-element="chart-header-slot">{chartHeaderSlot}</Block>
60
+ <Block data-element="chart-header-slot" width="100%" minWidth="0">
61
+ {chartHeaderSlot}
62
+ </Block>
60
63
  <Block
61
64
  display="flex"
62
65
  alignItems="center"
@@ -265,7 +265,7 @@ const CodeBlock = forwardRef<HTMLDivElement, CodeBlockProps>(
265
265
  )}
266
266
  </Block>
267
267
 
268
- {showCopyButton && (
268
+ {showCopyButton && !isDiffMode && (
269
269
  <Button
270
270
  data-element="copy-button"
271
271
  type="button"
@@ -301,14 +301,18 @@ const CodeBlock = forwardRef<HTMLDivElement, CodeBlockProps>(
301
301
  backgroundColor={tokens.body.backgroundColor}
302
302
  overflow="auto"
303
303
  position={
304
- !showHeader && showCopyButton ? 'relative' : undefined
304
+ !showHeader && showCopyButton && !isDiffMode
305
+ ? 'relative'
306
+ : undefined
305
307
  }
306
308
  className={
307
- !showHeader && showCopyButton ? 'code-body' : undefined
309
+ !showHeader && showCopyButton && !isDiffMode
310
+ ? 'code-body'
311
+ : undefined
308
312
  }
309
313
  style={{ maxHeight: maxHeight || 'none' }}
310
314
  >
311
- {!showHeader && showCopyButton && (
315
+ {!showHeader && showCopyButton && !isDiffMode && (
312
316
  <CopyOverlay>
313
317
  <Button
314
318
  data-element="copy-button"
@@ -5,9 +5,13 @@ import Block from '../Primitives/Block/Block'
5
5
  import type { CodeBlockTokenType } from '../CodeBlock/codeBlock.token'
6
6
  import './monaco-editor.css'
7
7
 
8
+ // Monaco registers only `javascript`/`typescript` (VS Code's
9
+ // `javascriptreact`/`typescriptreact` IDs are not registered, so they would
10
+ // fall back to plaintext with no highlighting). Monaco's JS/TS tokenizers
11
+ // handle JSX/TSX syntax fine, so map the ergonomic aliases onto them.
8
12
  const LANGUAGE_MAP: Record<string, string> = {
9
- jsx: 'javascriptreact',
10
- tsx: 'typescriptreact',
13
+ jsx: 'javascript',
14
+ tsx: 'typescript',
11
15
  }
12
16
 
13
17
  const mapLanguage = (value: string) => LANGUAGE_MAP[value] ?? value
@@ -1,11 +1,61 @@
1
1
  import type { ReactNode } from 'react'
2
- import type { SupportedLanguage } from '../CodeBlock/types'
3
2
 
4
3
  export enum CodeEditorVariant {
5
4
  DEFAULT = 'default',
6
5
  NO_GUTTER = 'no-gutter',
7
6
  }
8
7
 
8
+ /**
9
+ * Common Monaco language IDs, provided purely for IDE autocomplete on the
10
+ * `language` prop — NOT a runtime constraint. Every entry is verified against
11
+ * the language IDs monaco-editor actually registers (Monaco does not export a
12
+ * static union of its built-in IDs; they are only enumerable at runtime via
13
+ * `monaco.languages.getLanguages()`). Note Monaco's plain-text ID is
14
+ * `plaintext` and shell scripts are `shell` (there is no `bash` ID). Monaco
15
+ * also has no distinct `jsx`/`tsx` IDs — those still work through the open
16
+ * string arm of {@link CodeEditorLanguage}: the editor maps them onto the
17
+ * `javascript`/`typescript` tokenizers.
18
+ */
19
+ export type KnownCodeEditorLanguage =
20
+ | 'javascript'
21
+ | 'typescript'
22
+ | 'json'
23
+ | 'css'
24
+ | 'scss'
25
+ | 'less'
26
+ | 'html'
27
+ | 'xml'
28
+ | 'markdown'
29
+ | 'yaml'
30
+ | 'ini'
31
+ | 'graphql'
32
+ | 'sql'
33
+ | 'python'
34
+ | 'rust'
35
+ | 'go'
36
+ | 'java'
37
+ | 'kotlin'
38
+ | 'swift'
39
+ | 'c'
40
+ | 'cpp'
41
+ | 'csharp'
42
+ | 'php'
43
+ | 'ruby'
44
+ | 'shell'
45
+ | 'powershell'
46
+ | 'dockerfile'
47
+ | 'plaintext'
48
+
49
+ /**
50
+ * Language accepted by {@link CodeEditorProps.language}: autocomplete for
51
+ * {@link KnownCodeEditorLanguage}, while `(string & {})` keeps the prop open
52
+ * to every other Monaco language ID (the component forwards to Monaco, whose
53
+ * own `language` option is a plain `string`). Decoupled from `CodeBlock`'s
54
+ * `SupportedLanguage`, which is scoped to CodeBlock's hand-rolled tokenizer
55
+ * rather than Monaco.
56
+ */
57
+ export type CodeEditorLanguage = KnownCodeEditorLanguage | (string & {})
58
+
9
59
  export type CodeEditorProps = {
10
60
  value: string
11
61
  onChange?: (value: string) => void
@@ -30,7 +80,7 @@ export type CodeEditorProps = {
30
80
  */
31
81
  showLeftIcon?: boolean
32
82
  showCopyButton?: boolean
33
- language?: SupportedLanguage
83
+ language?: CodeEditorLanguage
34
84
  placeholder?: string
35
85
  readOnly?: boolean
36
86
  disabled?: boolean
@@ -25,9 +25,13 @@ import { CSSObject } from 'styled-components'
25
25
  // Language mapping
26
26
  // ---------------------------------------------------------------------------
27
27
 
28
+ // Monaco registers only `javascript`/`typescript` (VS Code's
29
+ // `javascriptreact`/`typescriptreact` IDs are not registered, so they would
30
+ // fall back to plaintext with no highlighting). Monaco's JS/TS tokenizers
31
+ // handle JSX/TSX syntax fine, so map the ergonomic aliases onto them.
28
32
  const LANGUAGE_MAP: Record<string, string> = {
29
- jsx: 'javascriptreact',
30
- tsx: 'typescriptreact',
33
+ jsx: 'javascript',
34
+ tsx: 'typescript',
31
35
  }
32
36
 
33
37
  const mapLanguage = (lang: string) => LANGUAGE_MAP[lang] ?? lang
@@ -21,19 +21,58 @@ export type CodeEditorV2DiffLine = {
21
21
  type: CodeEditorV2DiffLineType
22
22
  }
23
23
 
24
- export type CodeEditorV2SupportedLanguage =
24
+ /**
25
+ * Common Monaco language IDs, provided purely for IDE autocomplete on the
26
+ * `language` prop — NOT a runtime constraint. Every entry is verified against
27
+ * the language IDs monaco-editor actually registers (Monaco does not export a
28
+ * static union of its built-in IDs; they are only enumerable at runtime via
29
+ * `monaco.languages.getLanguages()`). Note Monaco's plain-text ID is
30
+ * `plaintext` and shell scripts are `shell` (there is no `bash` ID). Monaco
31
+ * also has no distinct `jsx`/`tsx` IDs — those still work through the open
32
+ * string arm of {@link CodeEditorV2Language}: the editor maps them onto the
33
+ * `javascript`/`typescript` tokenizers.
34
+ */
35
+ export type KnownCodeEditorV2Language =
25
36
  | 'javascript'
26
37
  | 'typescript'
27
- | 'jsx'
28
- | 'tsx'
29
38
  | 'json'
30
39
  | 'css'
40
+ | 'scss'
41
+ | 'less'
31
42
  | 'html'
43
+ | 'xml'
32
44
  | 'markdown'
33
45
  | 'yaml'
46
+ | 'ini'
47
+ | 'graphql'
48
+ | 'sql'
34
49
  | 'python'
35
50
  | 'rust'
36
- | 'haskell'
51
+ | 'go'
52
+ | 'java'
53
+ | 'kotlin'
54
+ | 'swift'
55
+ | 'c'
56
+ | 'cpp'
57
+ | 'csharp'
58
+ | 'php'
59
+ | 'ruby'
60
+ | 'shell'
61
+ | 'powershell'
62
+ | 'dockerfile'
63
+ | 'plaintext'
64
+
65
+ /**
66
+ * Language accepted by {@link CodeEditorV2Props.language}: autocomplete for
67
+ * {@link KnownCodeEditorV2Language}, while `(string & {})` keeps the prop open
68
+ * to every other Monaco language ID (matching the internal
69
+ * `MonacoEditorWrapper`'s `language: string` — Monaco itself types the option
70
+ * as a plain `string`).
71
+ */
72
+ export type CodeEditorV2Language = KnownCodeEditorV2Language | (string & {})
73
+
74
+ /** @deprecated Use {@link CodeEditorV2Language} instead. */
75
+ export type CodeEditorV2SupportedLanguage = CodeEditorV2Language
37
76
 
38
77
  export type CodeEditorV2Dimensions = {
39
78
  width?: CSSObject['width']
@@ -56,7 +95,7 @@ export type CodeEditorV2Props = {
56
95
  rightSlot?: ReactNode
57
96
  showCopyButton?: boolean
58
97
  }
59
- language?: CodeEditorV2SupportedLanguage
98
+ language?: CodeEditorV2Language
60
99
  placeholder?: string
61
100
  readOnly?: boolean
62
101
  disabled?: boolean
@@ -159,6 +159,7 @@ const DataTable = forwardRef(
159
159
  mobileColumnsToShow,
160
160
  enablePivotTable = false,
161
161
  pivotTableConfig,
162
+ dateLabel,
162
163
  ...rest
163
164
  }: DataTableProps<T>,
164
165
  ref: React.Ref<HTMLDivElement>
@@ -1975,6 +1976,7 @@ const DataTable = forwardRef(
1975
1976
  >
1976
1977
  | undefined
1977
1978
  }
1979
+ dateLabel={dateLabel}
1978
1980
  isLoading={
1979
1981
  isLoading ||
1980
1982
  (serverSidePagination &&
@@ -564,6 +564,7 @@ const TableBody = forwardRef<
564
564
  getColumnWidth,
565
565
  getRowStyle,
566
566
  getDisplayValue,
567
+ dateLabel,
567
568
  isLoading = false,
568
569
  showSkeleton = false,
569
570
  skeletonVariant = 'pulse',
@@ -1289,6 +1290,7 @@ const TableBody = forwardRef<
1289
1290
  getDisplayValue={
1290
1291
  getDisplayValue
1291
1292
  }
1293
+ dateLabel={dateLabel}
1292
1294
  />
1293
1295
  )
1294
1296
  }
@@ -50,6 +50,7 @@ export type TableBodyProps<T extends Record<string, unknown>> = {
50
50
  ) => React.CSSProperties
51
51
  getRowStyle?: (row: T, index: number) => React.CSSProperties
52
52
  getDisplayValue?: (value: unknown, column: ColumnDefinition<T>) => unknown
53
+ dateLabel?: string
53
54
  isLoading?: boolean
54
55
  showSkeleton?: boolean
55
56
  skeletonVariant?: SkeletonVariant
@@ -11,7 +11,12 @@ import { TableTokenType } from '../dataTable.tokens'
11
11
  import Block from '../../Primitives/Block/Block'
12
12
  import PrimitiveInput from '../../Primitives/PrimitiveInput/PrimitiveInput'
13
13
  import { FOUNDATION_THEME } from '../../../tokens'
14
- import { ColumnType, DropdownColumnProps, DateColumnProps } from '../types'
14
+ import {
15
+ ColumnType,
16
+ DropdownColumnProps,
17
+ DateColumnProps,
18
+ DateFormat,
19
+ } from '../types'
15
20
  import SingleSelect from '../../SingleSelect/SingleSelect'
16
21
  import { SelectMenuVariant } from '../../Select'
17
22
  import { SelectMenuGroupType } from '../../Select/types'
@@ -19,7 +24,7 @@ import { useResponsiveTokens } from '../../../hooks/useResponsiveTokens'
19
24
  import { useResizeObserver } from '../../../hooks/useResizeObserver'
20
25
  import Tooltip from '../../Tooltip/Tooltip'
21
26
  import { TooltipSize } from '../../Tooltip/types'
22
- import { parseDateLike } from '../utils'
27
+ import { parseDateLike, formatDateString } from '../utils'
23
28
 
24
29
  const StyledTableCell = styled.td<{
25
30
  width?: React.CSSProperties
@@ -79,9 +84,13 @@ const isEmptyValue = (value: unknown, columnType?: ColumnType): boolean => {
79
84
  const TruncatedTextWithTooltip = ({
80
85
  text,
81
86
  style = {},
87
+ suffix,
88
+ tableToken,
82
89
  }: {
83
90
  text: string
84
91
  style?: React.CSSProperties
92
+ suffix?: string
93
+ tableToken?: TableTokenType
85
94
  }) => {
86
95
  const textRef = useRef<HTMLSpanElement>(null)
87
96
  const [isTruncated, setIsTruncated] = useState(false)
@@ -125,16 +134,32 @@ const TruncatedTextWithTooltip = ({
125
134
  <span
126
135
  ref={textRef}
127
136
  style={{
128
- display: 'block',
137
+ display: 'inline-flex',
138
+ alignItems: 'baseline',
129
139
  width: '100%',
130
140
  minWidth: 0,
131
141
  overflow: 'hidden',
132
142
  textOverflow: 'ellipsis',
133
143
  whiteSpace: 'nowrap',
144
+ gap: '3px',
134
145
  ...style,
135
146
  }}
136
147
  >
137
148
  {text}
149
+ {suffix != null && (
150
+ <span
151
+ style={{
152
+ fontSize:
153
+ tableToken?.dataTable.table.body.cell.dateLabel
154
+ .fontSize,
155
+ color: tableToken?.dataTable.table.body.cell.dateLabel
156
+ .color,
157
+ whiteSpace: 'nowrap',
158
+ }}
159
+ >
160
+ {suffix}
161
+ </span>
162
+ )}
138
163
  </span>
139
164
  )
140
165
 
@@ -177,6 +202,7 @@ const TableCell = forwardRef<
177
202
  hasCustomBackground,
178
203
  onFieldChange,
179
204
  getDisplayValue,
205
+ dateLabel,
180
206
  'data-row-index': dataRowIndex,
181
207
  'data-col-index': dataColIndex,
182
208
  tabIndex: cellTabIndex,
@@ -455,23 +481,22 @@ const TableCell = forwardRef<
455
481
  const date = parseDateLike(dateData.date)
456
482
  const showTime = dateData.showTime || false
457
483
 
458
- const formatDate = (date: Date): string => {
459
- if (isNaN(date.getTime())) return '-'
484
+ // Format string precedence: cell-level `DateColumnProps.format`
485
+ // beats column-level `dateFormat`. Falls back to a sensible
486
+ // default based on whether time should be shown.
487
+ const formatStr =
488
+ dateData.format ||
489
+ (column as { dateFormat?: DateFormat }).dateFormat ||
490
+ (showTime ? 'DD MMM YYYY, hh:mm A' : 'DD MMM YYYY')
460
491
 
461
- const options: Intl.DateTimeFormatOptions = {
462
- year: 'numeric',
463
- month: 'short',
464
- day: '2-digit',
465
- }
492
+ const dateLabelStr =
493
+ dateData.dateLabel ||
494
+ (column as { dateLabel?: string }).dateLabel ||
495
+ dateLabel
466
496
 
467
- if (showTime) {
468
- options.hour = '2-digit'
469
- options.minute = '2-digit'
470
- }
471
-
472
- return new Intl.DateTimeFormat('en-US', options).format(
473
- date
474
- )
497
+ const formatDate = (date: Date): string => {
498
+ if (isNaN(date.getTime())) return '-'
499
+ return formatDateString(date, formatStr)
475
500
  }
476
501
 
477
502
  return (
@@ -485,10 +510,10 @@ const TableCell = forwardRef<
485
510
  <TruncatedTextWithTooltip
486
511
  text={date ? formatDate(date) : '-'}
487
512
  style={{
488
- fontSize:
489
- FOUNDATION_THEME.font.size.body.sm.fontSize,
490
513
  color: FOUNDATION_THEME.colors.gray[700],
491
514
  }}
515
+ suffix={dateLabelStr}
516
+ tableToken={tableToken}
492
517
  />
493
518
  </Block>
494
519
  )