@iress-oss/ids-components 6.0.0-alpha.18 → 6.0.0-alpha.19

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.
@@ -1,96 +1,114 @@
1
- import { jsx as e, jsxs as p, Fragment as N } from "react/jsx-runtime";
2
- import { C as T } from "../../floating-ui.react-BlU6Nz_4.js";
3
- import { propagateTestid as y } from "../../helpers/utility/propagateTestid.js";
4
- import { TabSetProvider as C, TabSetContext as v } from "./TabSetProvider.js";
5
- import { useState as u, useContext as h, useEffect as x, useRef as I } from "react";
6
- import { s as m } from "../../factory-CsinCTPr.js";
7
- import { tabSet as $ } from "./TabSet.styles.js";
8
- import { c as n } from "../../cx-DN21T1EH.js";
9
- import { GlobalCSSClass as g } from "../../enums.js";
10
- const j = (r) => {
11
- const a = I({}), s = h(v);
12
- let t;
1
+ import { jsx as t, jsxs as m, Fragment as j } from "react/jsx-runtime";
2
+ import { C as q } from "../../floating-ui.react-BlU6Nz_4.js";
3
+ import { propagateTestid as z } from "../../helpers/utility/propagateTestid.js";
4
+ import { TabSetProvider as H, TabSetContext as C } from "./TabSetProvider.js";
5
+ import { useState as n, useRef as O, useEffect as u, useContext as W } from "react";
6
+ import { s as v } from "../../factory-CsinCTPr.js";
7
+ import { tabSet as R } from "./TabSet.styles.js";
8
+ import { c as p } from "../../cx-DN21T1EH.js";
9
+ import { GlobalCSSClass as k } from "../../enums.js";
10
+ const A = (r) => {
11
+ const a = O({}), s = W(C);
12
+ let e;
13
13
  if (s?.hover) {
14
- const { offsetLeft: c, scrollWidth: o } = s.hover;
15
- t = {
14
+ const { offsetLeft: i, scrollWidth: l } = s.hover;
15
+ e = {
16
16
  opacity: 1,
17
- left: `${c}px`,
18
- width: `${o}px`
17
+ left: `${i}px`,
18
+ width: `${l}px`
19
19
  };
20
20
  } else
21
- t = {
21
+ e = {
22
22
  // eslint-disable-next-line react-hooks/refs -- we want to persist the previous style
23
23
  ...a.current,
24
24
  opacity: 0
25
25
  };
26
- return x(() => {
27
- s?.hover && (a.current = t);
28
- }, [s?.hover, t]), /* @__PURE__ */ e("div", { ...r, style: t });
29
- }, w = (r) => {
30
- const [a, s] = u({}), t = h(v);
31
- return x(() => {
32
- const c = setTimeout(() => {
33
- if (t?.active) {
34
- const { offsetLeft: o, scrollWidth: l } = t.active;
26
+ return u(() => {
27
+ s?.hover && (a.current = e);
28
+ }, [s?.hover, e]), /* @__PURE__ */ t("div", { ...r, style: e });
29
+ }, F = (r) => {
30
+ const [a, s] = n({}), e = W(C);
31
+ return u(() => {
32
+ const i = setTimeout(() => {
33
+ if (e?.active) {
34
+ const { offsetLeft: l, scrollWidth: d } = e.active;
35
35
  s({
36
- left: `${o}px`,
37
- width: `${l}px`
36
+ left: `${l}px`,
37
+ width: `${d}px`
38
38
  });
39
39
  }
40
40
  }, 150);
41
- return () => clearTimeout(c);
42
- }, [t?.active]), /* @__PURE__ */ e("div", { ...r, style: a });
43
- }, L = ({
41
+ return () => clearTimeout(i);
42
+ }, [e?.active]), /* @__PURE__ */ t("div", { ...r, style: a });
43
+ }, G = ({
44
44
  children: r,
45
45
  className: a,
46
46
  defaultSelected: s,
47
- layout: t = "top-left",
48
- onChange: c,
49
- panelStyle: o,
50
- selected: l,
51
- tabHolderStyle: d,
52
- ...f
47
+ layout: e = "top-left",
48
+ onChange: i,
49
+ panelStyle: l,
50
+ selected: d,
51
+ tabHolderStyle: h,
52
+ ...w
53
53
  }) => {
54
- const [S, b] = u(null), i = $({ layout: t });
55
- return /* @__PURE__ */ e(
56
- C,
54
+ const [$, g] = n(null), [S, b] = n(!1), [N, x] = n(!1), f = O(null), o = R({ layout: e, overflowStart: S, overflowEnd: N });
55
+ return u(() => {
56
+ const c = () => {
57
+ const T = f.current?.querySelector('[role="tablist"]');
58
+ if (T) {
59
+ const { scrollWidth: y, clientWidth: I, scrollLeft: L } = T;
60
+ y > I ? (b(L > 1), x(L < y - I - 1)) : (b(!1), x(!1));
61
+ }
62
+ };
63
+ c();
64
+ const E = f.current?.querySelector('[role="tablist"]');
65
+ return E?.addEventListener("scroll", c), window.addEventListener("resize", c), () => {
66
+ E?.removeEventListener("scroll", c), window.removeEventListener("resize", c);
67
+ };
68
+ }, [r]), /* @__PURE__ */ t(
69
+ H,
57
70
  {
58
71
  defaultSelected: s,
59
- onChange: c,
60
- panel: S,
61
- selected: l,
62
- children: /* @__PURE__ */ e(
63
- m.div,
72
+ onChange: i,
73
+ panel: $,
74
+ selected: d,
75
+ children: /* @__PURE__ */ t(
76
+ v.div,
64
77
  {
65
- className: n(a, i.root, g.TabSet),
66
- ...f,
67
- children: r && /* @__PURE__ */ p(N, { children: [
68
- /* @__PURE__ */ p(
69
- m.div,
78
+ className: p(a, o.root, k.TabSet),
79
+ ...w,
80
+ children: r && /* @__PURE__ */ m(j, { children: [
81
+ /* @__PURE__ */ m(
82
+ v.div,
70
83
  {
71
- ...d,
72
- className: n(i.listHolder, d?.className),
84
+ ...h,
85
+ ref: f,
86
+ className: p(o.listHolder, h?.className),
73
87
  children: [
74
- /* @__PURE__ */ e(w, { className: i.activeIndicator }),
75
- /* @__PURE__ */ e(j, { className: i.hoverIndicator }),
76
- /* @__PURE__ */ e(
77
- T,
88
+ S && /* @__PURE__ */ t("div", { className: o.overflowStartIndicator }),
89
+ N && /* @__PURE__ */ t("div", { className: o.overflowEndIndicator }),
90
+ /* @__PURE__ */ m(
91
+ q,
78
92
  {
79
- render: /* @__PURE__ */ e("div", { className: i.list, role: "tablist" }),
93
+ render: /* @__PURE__ */ t("div", { className: o.list, role: "tablist" }),
80
94
  loop: !1,
81
- children: r
95
+ children: [
96
+ /* @__PURE__ */ t(F, { className: o.activeIndicator }),
97
+ /* @__PURE__ */ t(A, { className: o.hoverIndicator }),
98
+ r
99
+ ]
82
100
  }
83
101
  )
84
102
  ]
85
103
  }
86
104
  ),
87
- /* @__PURE__ */ e(
88
- m.div,
105
+ /* @__PURE__ */ t(
106
+ v.div,
89
107
  {
90
- ...o,
91
- className: n(i.panel, o?.className),
92
- "data-testid": o?.["data-testid"] ?? y(f["data-testid"], "panel"),
93
- ref: b
108
+ ...l,
109
+ className: p(o.panel, l?.className),
110
+ "data-testid": l?.["data-testid"] ?? z(w["data-testid"], "panel"),
111
+ ref: g
94
112
  }
95
113
  )
96
114
  ] })
@@ -99,7 +117,7 @@ const j = (r) => {
99
117
  }
100
118
  );
101
119
  };
102
- L.displayName = "IressTabSet";
120
+ G.displayName = "IressTabSet";
103
121
  export {
104
- L as IressTabSet
122
+ G as IressTabSet
105
123
  };
@@ -1,4 +1,4 @@
1
- export declare const tabSet: import('../../styled-system/types').SlotRecipeRuntimeFn<"list" | "root" | "panel" | "hoverIndicator" | "listHolder" | "activeIndicator", {
1
+ export declare const tabSet: import('../../styled-system/types').SlotRecipeRuntimeFn<"list" | "root" | "panel" | "hoverIndicator" | "listHolder" | "activeIndicator" | "overflowEndIndicator" | "overflowStartIndicator", {
2
2
  layout: {
3
3
  'top-left': {
4
4
  list: {
@@ -22,4 +22,33 @@ export declare const tabSet: import('../../styled-system/types').SlotRecipeRunti
22
22
  };
23
23
  };
24
24
  };
25
+ overflowEnd: {
26
+ true: {
27
+ overflowEndIndicator: {
28
+ layerStyle: "elevation.overflow";
29
+ position: "absolute";
30
+ top: "spacing.0";
31
+ bottom: "spacing.1";
32
+ right: "spacing.0";
33
+ width: "input.4";
34
+ pointerEvents: "[none]";
35
+ maskImage: "[linear-gradient(to right, transparent 30%, black 100%)]";
36
+ };
37
+ };
38
+ };
39
+ overflowStart: {
40
+ true: {
41
+ overflowStartIndicator: {
42
+ layerStyle: "elevation.overflow";
43
+ position: "absolute";
44
+ top: "spacing.0";
45
+ bottom: "spacing.1";
46
+ left: "spacing.0";
47
+ width: "input.4";
48
+ pointerEvents: "[none]";
49
+ maskImage: "[linear-gradient(to right, transparent 30%, black 100%)]";
50
+ transform: "[rotate(180deg)]";
51
+ };
52
+ };
53
+ };
25
54
  }>;
@@ -6,7 +6,9 @@ const e = t({
6
6
  "listHolder",
7
7
  "panel",
8
8
  "activeIndicator",
9
- "hoverIndicator"
9
+ "hoverIndicator",
10
+ "overflowEndIndicator",
11
+ "overflowStartIndicator"
10
12
  ],
11
13
  base: {
12
14
  root: {
@@ -15,19 +17,32 @@ const e = t({
15
17
  bg: "colour.neutral.10",
16
18
  borderRadius: "radius.system.layout"
17
19
  },
18
- list: {
19
- display: "flex",
20
- flexWrap: "wrap",
21
- borderBottom: "divider",
22
- "& > :has(.ids-badge)": {
23
- mr: "spacing.4"
20
+ listHolder: {
21
+ position: "relative",
22
+ overflowX: "clip",
23
+ overflowY: "visible",
24
+ pt: "spacing.2",
25
+ _after: {
26
+ content: '""',
27
+ position: "absolute",
28
+ bottom: "spacing.1",
29
+ left: "spacing.0",
30
+ right: "spacing.0",
31
+ borderBottom: "divider",
32
+ pointerEvents: "none"
24
33
  }
25
34
  },
26
- listHolder: {
35
+ list: {
36
+ display: "flex",
37
+ flexWrap: "nowrap",
38
+ scrollable: "x",
39
+ overflowY: "visible",
40
+ scrollSnapType: "[x proximity]",
27
41
  position: "relative"
28
42
  },
29
43
  panel: {
30
44
  pt: "md",
45
+ textStyle: "typography.body.md",
31
46
  _focusVisible: {
32
47
  layerStyle: "elevation.focus",
33
48
  outline: "[none]"
@@ -35,20 +50,35 @@ const e = t({
35
50
  },
36
51
  activeIndicator: {
37
52
  position: "absolute",
38
- bottom: "[0]",
53
+ top: "spacing.1",
54
+ bottom: "spacing.1",
39
55
  left: "[0]",
40
- height: "[2px]",
41
- bg: "colour.primary.text",
42
- transition: "all"
56
+ bg: "colour.neutral.20",
57
+ transition: "all",
58
+ borderRadius: "radius.075",
59
+ borderBottomRadius: "none",
60
+ pointerEvents: "none",
61
+ _after: {
62
+ content: '""',
63
+ position: "absolute",
64
+ bottom: "spacing.0",
65
+ left: "spacing.0",
66
+ right: "spacing.0",
67
+ height: "[2px]",
68
+ bg: "colour.primary.text",
69
+ transition: "all",
70
+ zIndex: "[2]"
71
+ }
43
72
  },
44
73
  hoverIndicator: {
45
74
  position: "absolute",
46
- top: "spacing.2",
47
- bottom: "spacing.2",
75
+ top: "spacing.1",
76
+ bottom: "spacing.1",
48
77
  left: "[0]",
49
- bg: "colour.neutral.20",
78
+ bg: "colour.primary.surfaceHover",
50
79
  transition: "all",
51
- borderRadius: "radius.system.button",
80
+ borderRadius: "radius.075",
81
+ borderBottomRadius: "none",
52
82
  pointerEvents: "none"
53
83
  }
54
84
  },
@@ -75,6 +105,35 @@ const e = t({
75
105
  left: "[100%]"
76
106
  }
77
107
  }
108
+ },
109
+ overflowEnd: {
110
+ true: {
111
+ overflowEndIndicator: {
112
+ layerStyle: "elevation.overflow",
113
+ position: "absolute",
114
+ top: "spacing.0",
115
+ bottom: "spacing.1",
116
+ right: "spacing.0",
117
+ width: "input.4",
118
+ pointerEvents: "[none]",
119
+ maskImage: "[linear-gradient(to right, transparent 30%, black 100%)]"
120
+ }
121
+ }
122
+ },
123
+ overflowStart: {
124
+ true: {
125
+ overflowStartIndicator: {
126
+ layerStyle: "elevation.overflow",
127
+ position: "absolute",
128
+ top: "spacing.0",
129
+ bottom: "spacing.1",
130
+ left: "spacing.0",
131
+ width: "input.4",
132
+ pointerEvents: "[none]",
133
+ maskImage: "[linear-gradient(to right, transparent 30%, black 100%)]",
134
+ transform: "[rotate(180deg)]"
135
+ }
136
+ }
78
137
  }
79
138
  },
80
139
  defaultVariants: {
@@ -8,7 +8,7 @@ const s = {
8
8
  variable: "var(--borders-divider)"
9
9
  },
10
10
  "borders.input": {
11
- value: "1px solid var(--iress-colour-neutral-70, #5D6C7E)",
11
+ value: "1px solid var(--iress-colour-neutral-70, #6D7278)",
12
12
  variable: "var(--borders-input)"
13
13
  },
14
14
  "borders.placeholder": {
@@ -16,7 +16,7 @@ const s = {
16
16
  variable: "var(--borders-placeholder)"
17
17
  },
18
18
  "borders.hover": {
19
- value: "1px solid var(--iress-colour-primary-fill, #1D1F4B)",
19
+ value: "1px solid var(--iress-colour-primary-fill, #003271)",
20
20
  variable: "var(--borders-hover)"
21
21
  },
22
22
  "borders.table": {
@@ -24,11 +24,11 @@ const s = {
24
24
  variable: "var(--borders-table)"
25
25
  },
26
26
  "colors.colour.primary.fill": {
27
- value: "var(--iress-colour-primary-fill, #1D1F4B)",
27
+ value: "var(--iress-colour-primary-fill, #003271)",
28
28
  variable: "var(--colors-colour\\.primary\\.fill)"
29
29
  },
30
30
  "colors.colour.primary.fillHover": {
31
- value: "var(--iress-colour-primary-fill-hover, #0D0E24)",
31
+ value: "var(--iress-colour-primary-fill-hover, #002352)",
32
32
  variable: "var(--colors-colour\\.primary\\.fill-hover)"
33
33
  },
34
34
  "colors.colour.primary.onFill": {
@@ -36,15 +36,15 @@ const s = {
36
36
  variable: "var(--colors-colour\\.primary\\.on-fill)"
37
37
  },
38
38
  "colors.colour.primary.surface": {
39
- value: "var(--iress-colour-primary-surface, #E9E9ED)",
39
+ value: "var(--iress-colour-primary-surface, #EBF3FF)",
40
40
  variable: "var(--colors-colour\\.primary\\.surface)"
41
41
  },
42
42
  "colors.colour.primary.surfaceHover": {
43
- value: "var(--iress-colour-primary-surface-hover, #D2D2DB)",
43
+ value: "var(--iress-colour-primary-surface-hover, #DCEAFE)",
44
44
  variable: "var(--colors-colour\\.primary\\.surface-hover)"
45
45
  },
46
46
  "colors.colour.primary.text": {
47
- value: "var(--iress-colour-primary-text, #141F4D)",
47
+ value: "var(--iress-colour-primary-text, #003271)",
48
48
  variable: "var(--colors-colour\\.primary\\.text)"
49
49
  },
50
50
  "colors.colour.neutral.10": {
@@ -72,7 +72,7 @@ const s = {
72
72
  variable: "var(--colors-colour\\.neutral\\.60)"
73
73
  },
74
74
  "colors.colour.neutral.70": {
75
- value: "var(--iress-colour-neutral-70, #5D6C7E)",
75
+ value: "var(--iress-colour-neutral-70, #6D7278)",
76
76
  variable: "var(--colors-colour\\.neutral\\.70)"
77
77
  },
78
78
  "colors.colour.neutral.80": {
@@ -80,7 +80,7 @@ const s = {
80
80
  variable: "var(--colors-colour\\.neutral\\.80)"
81
81
  },
82
82
  "colors.colour.neutral.90": {
83
- value: "var(--iress-colour-neutral-90, #13213F)",
83
+ value: "var(--iress-colour-neutral-90, #141F4D)",
84
84
  variable: "var(--colors-colour\\.neutral\\.90)"
85
85
  },
86
86
  "colors.colour.accent.1": {
@@ -112,7 +112,7 @@ const s = {
112
112
  variable: "var(--colors-colour\\.system\\.success\\.surface-hover)"
113
113
  },
114
114
  "colors.colour.system.success.text": {
115
- value: "var(--iress-colour-system-success-text, #0A2E25)",
115
+ value: "var(--iress-colour-system-success-text, #124d3d)",
116
116
  variable: "var(--colors-colour\\.system\\.success\\.text)"
117
117
  },
118
118
  "colors.colour.system.danger.fill": {
@@ -136,7 +136,7 @@ const s = {
136
136
  variable: "var(--colors-colour\\.system\\.danger\\.surface-hover)"
137
137
  },
138
138
  "colors.colour.system.danger.text": {
139
- value: "var(--iress-colour-system-danger-text, #2D0909)",
139
+ value: "var(--iress-colour-system-danger-text, #8a1f1f)",
140
140
  variable: "var(--colors-colour\\.system\\.danger\\.text)"
141
141
  },
142
142
  "colors.colour.system.warning.fill": {
@@ -156,7 +156,7 @@ const s = {
156
156
  variable: "var(--colors-colour\\.system\\.warning\\.surface)"
157
157
  },
158
158
  "colors.colour.system.warning.text": {
159
- value: "var(--iress-colour-system-warning-text, #2B1F00)",
159
+ value: "var(--iress-colour-system-warning-text, #6b4700)",
160
160
  variable: "var(--colors-colour\\.system\\.warning\\.text)"
161
161
  },
162
162
  "colors.colour.system.warning.surfaceHover": {
@@ -180,7 +180,7 @@ const s = {
180
180
  variable: "var(--colors-colour\\.system\\.info\\.surface)"
181
181
  },
182
182
  "colors.colour.system.info.text": {
183
- value: "var(--iress-colour-system-info-text, #121D33)",
183
+ value: "var(--iress-colour-system-info-text, #203a75)",
184
184
  variable: "var(--colors-colour\\.system\\.info\\.text)"
185
185
  },
186
186
  "colors.colour.system.info.surfaceHover": {
@@ -188,7 +188,7 @@ const s = {
188
188
  variable: "var(--colors-colour\\.system\\.info\\.surface-hover)"
189
189
  },
190
190
  "colors.colour.system.backdrop.fill": {
191
- value: "var(--iress-colour-system-backdrop-fill, #393F46CC)",
191
+ value: "var(--iress-colour-system-backdrop-fill, #61656bcc)",
192
192
  variable: "var(--colors-colour\\.system\\.backdrop\\.fill)"
193
193
  },
194
194
  "colors.colour.data.subtle.10": {
@@ -276,7 +276,7 @@ const s = {
276
276
  variable: "var(--colors-alt)"
277
277
  },
278
278
  "colors.muted": {
279
- value: "var(--iress-colour-neutral-70, #5D6C7E)",
279
+ value: "var(--iress-colour-neutral-70, #6D7278)",
280
280
  variable: "var(--colors-muted)"
281
281
  },
282
282
  "colors.text": {