@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,14 +1,10 @@
1
- import { ReactElement, ReactNode } from 'react';
1
+ import { ReactNode } from 'react';
2
2
  import { IressStyledProps, Statuses } from '../../types';
3
3
  export interface IressBadgeProps extends IressStyledProps<'span'> {
4
4
  /**
5
5
  * Content of the badge.
6
6
  */
7
7
  children?: ReactNode;
8
- /**
9
- * Element to attach the badge to.
10
- */
11
- host?: ReactElement;
12
8
  /**
13
9
  * Style of the badge.
14
10
  */
@@ -19,6 +15,6 @@ export interface IressBadgeProps extends IressStyledProps<'span'> {
19
15
  pill?: boolean;
20
16
  }
21
17
  export declare const IressBadge: {
22
- ({ children, mode, pill, className, host, ...restProps }: IressBadgeProps): import("react/jsx-runtime").JSX.Element;
18
+ ({ children, mode, pill, className, ...restProps }: IressBadgeProps): import("react/jsx-runtime").JSX.Element;
23
19
  displayName: string;
24
20
  };
@@ -1,48 +1,35 @@
1
- import { jsx as c, jsxs as n } from "react/jsx-runtime";
2
- import { propagateTestid as f } from "../../helpers/utility/propagateTestid.js";
3
- import { c as r } from "../../css-DNdLYQld.js";
4
- import { c as g } from "../../cx-DN21T1EH.js";
5
- import { badge as b } from "./Badge.styles.js";
6
- import { s as x } from "../../factory-CsinCTPr.js";
7
- import { s as y } from "../../is-valid-prop-DweT-eOL.js";
8
- import { GlobalCSSClass as B } from "../../enums.js";
9
- const C = ({
10
- children: e,
11
- mode: m = "neutral",
12
- pill: p,
13
- className: d,
14
- host: s,
15
- ...a
1
+ import { jsx as l } from "react/jsx-runtime";
2
+ import { c } from "../../css-DNdLYQld.js";
3
+ import { c as i } from "../../cx-DN21T1EH.js";
4
+ import { badge as n } from "./Badge.styles.js";
5
+ import { s as d } from "../../factory-CsinCTPr.js";
6
+ import { s as f } from "../../is-valid-prop-DweT-eOL.js";
7
+ import { GlobalCSSClass as g } from "../../enums.js";
8
+ const y = ({
9
+ children: o,
10
+ mode: r = "neutral",
11
+ pill: a,
12
+ className: t,
13
+ ...e
16
14
  }) => {
17
- const o = b.raw({
18
- mode: m,
19
- pill: p,
20
- host: !!s
21
- }), [i, l] = y(a), t = /* @__PURE__ */ c(
22
- x.span,
15
+ const s = n.raw({
16
+ mode: r,
17
+ pill: a
18
+ }), [m, p] = f(e);
19
+ return /* @__PURE__ */ l(
20
+ d.span,
23
21
  {
24
- ...l,
25
- className: g(
26
- r(o.root, o.badge, i),
27
- d,
28
- B.Badge
22
+ ...p,
23
+ className: i(
24
+ c(s.root, s.badge, m),
25
+ t,
26
+ g.Badge
29
27
  ),
30
- children: e
28
+ children: o
31
29
  }
32
30
  );
33
- return s ? /* @__PURE__ */ n(
34
- "div",
35
- {
36
- className: r(o.host),
37
- "data-testid": f(a["data-testid"], "host"),
38
- children: [
39
- s,
40
- t
41
- ]
42
- }
43
- ) : t;
44
31
  };
45
- C.displayName = "IressBadge";
32
+ y.displayName = "IressBadge";
46
33
  export {
47
- C as IressBadge
34
+ y as IressBadge
48
35
  };
@@ -1,20 +1,4 @@
1
- export declare const badge: import('../../styled-system/types').SlotRecipeRuntimeFn<"badge" | "root" | "host", {
2
- host: {
3
- true: {
4
- badge: {
5
- position: "absolute";
6
- insetBlockStart: "spacing.0";
7
- insetInlineEnd: "spacing.0";
8
- zIndex: "100";
9
- transformOrigin: "100% 0";
10
- borderRadius: "radius.100";
11
- transform: {
12
- base: "translate(50%, -50%)";
13
- _rtl: "translate(-50%, -50%)";
14
- };
15
- };
16
- };
17
- };
1
+ export declare const badge: import('../../styled-system/types').SlotRecipeRuntimeFn<"badge" | "root", {
18
2
  pill: {
19
3
  true: {
20
4
  badge: {
@@ -1,6 +1,6 @@
1
1
  import { s as o } from "../../sva-B7kca5XO.js";
2
2
  const r = o({
3
- slots: ["root", "badge", "host"],
3
+ slots: ["root", "badge"],
4
4
  base: {
5
5
  root: {
6
6
  // Performance: CSS containment limits style recalculation scope
@@ -14,7 +14,7 @@ const r = o({
14
14
  whiteSpace: "nowrap",
15
15
  textDecoration: "none",
16
16
  minHeight: "[1.35em]",
17
- minWidth: "[1.35em]"
17
+ minWidth: "[1.5em]"
18
18
  },
19
19
  badge: {
20
20
  alignItems: "center",
@@ -26,29 +26,9 @@ const r = o({
26
26
  lineHeight: 1,
27
27
  display: "inline-block"
28
28
  }
29
- },
30
- host: {
31
- position: "relative",
32
- height: "auto"
33
29
  }
34
30
  },
35
31
  variants: {
36
- host: {
37
- true: {
38
- badge: {
39
- position: "absolute",
40
- insetBlockStart: "spacing.0",
41
- insetInlineEnd: "spacing.0",
42
- zIndex: "100",
43
- transformOrigin: "100% 0",
44
- borderRadius: "radius.100",
45
- transform: {
46
- base: "translate(50%, -50%)",
47
- _rtl: "translate(-50%, -50%)"
48
- }
49
- }
50
- }
51
- },
52
32
  pill: {
53
33
  true: {
54
34
  badge: {
@@ -151,8 +131,7 @@ const r = o({
151
131
  },
152
132
  defaultVariants: {
153
133
  mode: "neutral",
154
- pill: !1,
155
- host: !1
134
+ pill: !1
156
135
  }
157
136
  });
158
137
  export {
@@ -22,6 +22,9 @@ export declare const input: import('../../styled-system/types').SlotRecipeRuntim
22
22
  };
23
23
  isTextarea: {
24
24
  true: {
25
+ wrapper: {
26
+ alignItems: "end";
27
+ };
25
28
  formControl: {
26
29
  lineHeight: number;
27
30
  height: "auto";
@@ -106,6 +106,9 @@ const o = r({
106
106
  },
107
107
  isTextarea: {
108
108
  true: {
109
+ wrapper: {
110
+ alignItems: "end"
111
+ },
109
112
  formControl: {
110
113
  lineHeight: 1.5,
111
114
  height: "auto",
@@ -6,7 +6,7 @@ import { progress as b } from "./Progress.styles.js";
6
6
  import { s as p } from "../../factory-CsinCTPr.js";
7
7
  import { s as x } from "../../is-valid-prop-DweT-eOL.js";
8
8
  import { GlobalCSSClass as C } from "../../enums.js";
9
- import { t as N } from "../../index-Bm5rQqn5.js";
9
+ import { t as N } from "../../index-0AvnPY9d.js";
10
10
  const h = ({
11
11
  backgroundImage: e,
12
12
  borderRadius: t,
@@ -1,6 +1,6 @@
1
1
  import { useRef as m, useEffect as y } from "react";
2
2
  import { GlobalCSSClass as e } from "../../../enums.js";
3
- import { t as p } from "../../../index-Bm5rQqn5.js";
3
+ import { t as p } from "../../../index-0AvnPY9d.js";
4
4
  import { useBreakpoint as S } from "../../../hooks/useBreakpoint.js";
5
5
  function h({
6
6
  element: r,
@@ -1,42 +1,42 @@
1
- import { jsxs as E, Fragment as M, jsx as u } from "react/jsx-runtime";
2
- import { forwardRef as L, useRef as N, useContext as D, useImperativeHandle as R, useLayoutEffect as $, useCallback as S, useMemo as j } from "react";
3
- import { idsLogger as F } from "../../../helpers/utility/idsLogger.js";
4
- import { useIdIfNeeded as H } from "../../../hooks/useIdIfNeeded.js";
5
- import { createPortal as K } from "react-dom";
6
- import { s as q } from "../../../factory-CsinCTPr.js";
7
- import { tab as G } from "./Tab.styles.js";
8
- import { c as U } from "../../../cx-DN21T1EH.js";
9
- import { a as W } from "../../../floating-ui.react-BlU6Nz_4.js";
10
- import { focusableElements as Y } from "../../../helpers/dom/focusableElements.js";
11
- import { GlobalCSSClass as z } from "../../../enums.js";
12
- import { TabSetContext as B } from "../TabSetProvider.js";
13
- const J = (a, e, s, i) => {
14
- const t = a.querySelector("[id]"), r = t?.getAttribute("id");
15
- t?.removeAttribute("id"), a.removeAttribute("tabindex"), a.removeAttribute("data-active"), a.removeAttribute("aria-selected"), s.ref?.(e), e.tabIndex = i ? 0 : -1, i ? e.setAttribute("data-active", "") : e.removeAttribute("data-active"), r && e.setAttribute("id", r), e.setAttribute("aria-selected", String(i));
16
- }, h = ({
17
- activate: a,
1
+ import { jsxs as L, Fragment as N, jsx as u } from "react/jsx-runtime";
2
+ import { forwardRef as D, useRef as S, useContext as R, useImperativeHandle as $, useLayoutEffect as j, useEffect as F, useCallback as C, useMemo as H } from "react";
3
+ import { idsLogger as K } from "../../../helpers/utility/idsLogger.js";
4
+ import { useIdIfNeeded as q } from "../../../hooks/useIdIfNeeded.js";
5
+ import { createPortal as G } from "react-dom";
6
+ import { s as U } from "../../../factory-CsinCTPr.js";
7
+ import { tab as V } from "./Tab.styles.js";
8
+ import { c as W } from "../../../cx-DN21T1EH.js";
9
+ import { a as Y } from "../../../floating-ui.react-BlU6Nz_4.js";
10
+ import { focusableElements as z } from "../../../helpers/dom/focusableElements.js";
11
+ import { GlobalCSSClass as B } from "../../../enums.js";
12
+ import { TabSetContext as J } from "../TabSetProvider.js";
13
+ const O = (n, e, c, a) => {
14
+ const t = n.querySelector("[id]"), r = t?.getAttribute("id");
15
+ t?.removeAttribute("id"), n.removeAttribute("tabindex"), n.removeAttribute("data-active"), n.removeAttribute("aria-selected"), c.ref?.(e), e.tabIndex = a ? 0 : -1, a ? e.setAttribute("data-active", "") : e.removeAttribute("data-active"), r && e.setAttribute("id", r), e.setAttribute("aria-selected", String(a));
16
+ }, k = ({
17
+ activate: n,
18
18
  children: e,
19
- selected: s,
20
- ...i
19
+ selected: c,
20
+ ...a
21
21
  }) => /* @__PURE__ */ u(
22
- W,
22
+ Y,
23
23
  {
24
24
  render: (t) => /* @__PURE__ */ u(
25
25
  "div",
26
26
  {
27
- ...i,
27
+ ...a,
28
28
  ...t,
29
- "aria-selected": s,
30
- onClick: () => a(),
31
- onKeyDown: (r) => ["Space", "Enter"].includes(r.key) && a(),
29
+ "aria-selected": c,
30
+ onClick: () => n(),
31
+ onKeyDown: (r) => ["Space", "Enter"].includes(r.key) && n(),
32
32
  ref: (r) => {
33
33
  if (!r) return;
34
- const m = Y(r)[0];
35
- m && J(
34
+ const l = z(r)[0];
35
+ l && O(
36
36
  r,
37
- m,
37
+ l,
38
38
  t,
39
- s
39
+ c
40
40
  );
41
41
  },
42
42
  children: e
@@ -44,105 +44,119 @@ const J = (a, e, s, i) => {
44
44
  )
45
45
  }
46
46
  );
47
- h.displayName = "TabInsideTabSet";
48
- const O = ({
49
- active: a,
47
+ k.displayName = "TabInsideTabSet";
48
+ const P = ({
49
+ active: n,
50
50
  children: e,
51
- className: s,
52
- "data-testid": i,
51
+ className: c,
52
+ "data-testid": a,
53
53
  href: t,
54
54
  label: r,
55
- type: m = "button",
55
+ type: l = "button",
56
56
  value: v,
57
- ...b
58
- }, C) => {
59
- const d = H({ id: b.id }), c = N(null), n = D(B), { register: A, unregister: g, setHover: p } = n ?? {}, { onMouseEnter: y, onMouseLeave: T } = b;
60
- R(C, () => c.current), $(() => {
61
- const o = c.current;
62
- if (o)
63
- return A?.(o, v), () => g?.(o);
57
+ ...f
58
+ }, x) => {
59
+ const d = q({ id: f.id }), s = S(null), o = R(J), { register: A, unregister: g, setHover: p } = o ?? {}, { onMouseEnter: w, onMouseLeave: y } = f, I = S(!0);
60
+ $(x, () => s.current), j(() => {
61
+ const i = s.current;
62
+ if (i)
63
+ return A?.(i, v), () => g?.(i);
64
64
  }, [A, g, v]);
65
- const f = n ? n.isActive(c.current) : a, w = U(
66
- s,
67
- G({ active: f, insideTabSet: !!n }),
68
- z.Tab
69
- ), x = S(
70
- (o) => {
71
- y?.(o), p?.(o.currentTarget);
65
+ const m = o ? o.isActive(s.current) : n;
66
+ F(() => {
67
+ if (m && s.current && o) {
68
+ if (I.current) {
69
+ I.current = !1;
70
+ return;
71
+ }
72
+ s.current.scrollIntoView?.({
73
+ behavior: "smooth",
74
+ block: "nearest",
75
+ inline: "center"
76
+ });
77
+ }
78
+ }, [m, o]);
79
+ const T = W(
80
+ c,
81
+ V({ active: m, insideTabSet: !!o }),
82
+ B.Tab
83
+ ), E = C(
84
+ (i) => {
85
+ w?.(i), p?.(i.currentTarget);
72
86
  },
73
- [y, p]
74
- ), k = S(
75
- (o) => {
76
- T?.(o), p?.();
87
+ [w, p]
88
+ ), M = C(
89
+ (i) => {
90
+ y?.(i), p?.();
77
91
  },
78
- [T, p]
79
- ), I = j(
80
- () => q(t ? "a" : "button"),
92
+ [y, p]
93
+ ), h = H(
94
+ () => U(t ? "a" : "button"),
81
95
  [t]
82
96
  );
83
- if (e && t && F(
97
+ if (e && t && K(
84
98
  "IressTab: You should not use `children` with `href` prop, as the `children` will be seen before the page navigates."
85
- ), n) {
86
- const o = e && f;
87
- return /* @__PURE__ */ E(M, { children: [
99
+ ), o) {
100
+ const i = e && m;
101
+ return /* @__PURE__ */ L(N, { children: [
88
102
  /* @__PURE__ */ u(
89
- h,
103
+ k,
90
104
  {
91
- activate: () => n.activate(c.current),
92
- selected: f,
105
+ activate: () => o.activate(s.current),
106
+ selected: m,
93
107
  children: /* @__PURE__ */ u(
94
- I,
108
+ h,
95
109
  {
96
- className: w,
110
+ className: T,
97
111
  "aria-controls": e ? `${d}--panel` : void 0,
98
112
  role: "tab",
99
- "data-testid": i,
100
- ...b,
113
+ "data-testid": a,
114
+ ...f,
101
115
  href: t,
102
116
  id: d,
103
- onMouseEnter: x,
104
- onMouseLeave: k,
105
- ref: c,
106
- type: m,
117
+ onMouseEnter: E,
118
+ onMouseLeave: M,
119
+ ref: s,
120
+ type: l,
107
121
  children: r
108
122
  }
109
123
  )
110
124
  }
111
125
  ),
112
- n.panel && K(
126
+ o.panel && G(
113
127
  /* @__PURE__ */ u(
114
128
  "div",
115
129
  {
116
130
  "aria-labelledby": d,
117
131
  id: `${d}--panel`,
118
132
  role: "tabpanel",
119
- onKeyDown: (l) => {
120
- (l.key === "ArrowLeft" || l.key === "ArrowRight" || l.key === "ArrowUp" || l.key === "ArrowDown") && l.stopPropagation();
133
+ onKeyDown: (b) => {
134
+ (b.key === "ArrowLeft" || b.key === "ArrowRight" || b.key === "ArrowUp" || b.key === "ArrowDown") && b.stopPropagation();
121
135
  },
122
- hidden: !o,
136
+ hidden: !i,
123
137
  children: e
124
138
  }
125
139
  ),
126
- n.panel,
140
+ o.panel,
127
141
  `${d}--panel`
128
142
  )
129
143
  ] });
130
144
  }
131
145
  return /* @__PURE__ */ u(
132
- I,
146
+ h,
133
147
  {
134
- className: w,
135
- "data-testid": i,
136
- ...b,
148
+ className: T,
149
+ "data-testid": a,
150
+ ...f,
137
151
  href: t,
138
152
  id: d,
139
- ref: c,
140
- type: m,
153
+ ref: s,
154
+ type: l,
141
155
  children: r
142
156
  }
143
157
  );
144
- }, P = L(O);
145
- P.displayName = "IressTab";
158
+ }, Q = D(P);
159
+ Q.displayName = "IressTab";
146
160
  export {
147
- P as IressTab
161
+ Q as IressTab
148
162
  };
@@ -12,6 +12,9 @@ export declare const tab: import('../../../styled-system/types').RecipeRuntimeFn
12
12
  _hover: {
13
13
  bg: "[none]";
14
14
  };
15
+ _focusVisible: {
16
+ layerStyle: "elevation.focusCompact";
17
+ };
15
18
  };
16
19
  };
17
20
  }>;
@@ -1,5 +1,5 @@
1
1
  import { c as t } from "../../../cva-DtPMccE9.js";
2
- const e = t({
2
+ const o = t({
3
3
  base: {
4
4
  alignItems: "center",
5
5
  borderBottom: "[2px solid transparent]",
@@ -39,11 +39,14 @@ const e = t({
39
39
  borderBottomWidth: "0px",
40
40
  _hover: {
41
41
  bg: "[none]"
42
+ },
43
+ _focusVisible: {
44
+ layerStyle: "elevation.focusCompact"
42
45
  }
43
46
  }
44
47
  }
45
48
  }
46
49
  });
47
50
  export {
48
- e as tab
51
+ o as tab
49
52
  };