@selectwin/kit 0.1.208 → 0.1.210

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,5 +1,5 @@
1
- import { ReactNode, ComponentPropsWithoutRef } from 'react';
2
- export declare function SelectDetailList({ children, stacked, compact, loading, }: {
1
+ import { ReactNode, HTMLAttributes, ComponentPropsWithoutRef } from 'react';
2
+ type SelectDetailListOwnProps = {
3
3
  children: ReactNode;
4
4
  stacked?: boolean;
5
5
  /**
@@ -10,7 +10,11 @@ export declare function SelectDetailList({ children, stacked, compact, loading,
10
10
  compact?: boolean;
11
11
  /** Shimmer every row's value. The labels stay — only the values are unknown. */
12
12
  loading?: boolean;
13
- }): import("react").JSX.Element;
13
+ /** 0.1.210: `dl` desenha a lista de definição (`<dl>`, `<dt>`, `<dd>`). Padrão `div`, como antes. */
14
+ as?: 'div' | 'dl';
15
+ };
16
+ export type SelectDetailListProps = SelectDetailListOwnProps & Omit<ComponentPropsWithoutRef<'div'>, keyof SelectDetailListOwnProps>;
17
+ export declare function SelectDetailList({ children, stacked, compact, loading, as, className, ...rest }: SelectDetailListProps): import("react").JSX.Element;
14
18
  type SelectDetailRowOwnProps = {
15
19
  label: ReactNode;
16
20
  children: ReactNode;
@@ -21,5 +25,5 @@ type SelectDetailRowOwnProps = {
21
25
  loading?: boolean;
22
26
  };
23
27
  export type SelectDetailRowProps = SelectDetailRowOwnProps & Omit<ComponentPropsWithoutRef<'div'>, keyof SelectDetailRowOwnProps>;
24
- export declare const SelectDetailRow: import('react').ForwardRefExoticComponent<SelectDetailRowOwnProps & Omit<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, keyof SelectDetailRowOwnProps> & import('react').RefAttributes<HTMLDivElement>>;
28
+ export declare const SelectDetailRow: import('react').ForwardRefExoticComponent<SelectDetailRowOwnProps & Omit<Omit<import('react').DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, keyof SelectDetailRowOwnProps> & import('react').RefAttributes<HTMLDivElement>>;
25
29
  export {};
@@ -3,40 +3,44 @@ import { useSelectReveal as e } from "./internal/useSelectReveal.js";
3
3
  import { createContext as t, forwardRef as n, useContext as r } from "react";
4
4
  import { jsx as i, jsxs as a } from "react/jsx-runtime";
5
5
  //#region src/SelectDetail.tsx
6
- var o = t(!1);
7
- function s({ children: t, stacked: n = !1, compact: r = !1, loading: a = !1 }) {
8
- let s = e({
6
+ var o = t(!1), s = t(!1);
7
+ function c({ children: t, stacked: n = !1, compact: r = !1, loading: a = !1, as: c = "div", className: l, ...u }) {
8
+ let d = e({
9
9
  selector: ".select-detail",
10
10
  y: 8,
11
11
  duration: .45,
12
12
  stagger: .05,
13
13
  scroll: !0
14
- });
14
+ }), f = `select-detaillist${n ? " select-detaillist--stacked" : ""}${r ? " select-detaillist--compact" : ""}${l ? " " + l : ""}`;
15
15
  return /* @__PURE__ */ i(o.Provider, {
16
16
  value: a,
17
- children: /* @__PURE__ */ i("div", {
18
- className: `select-detaillist${n ? " select-detaillist--stacked" : ""}${r ? " select-detaillist--compact" : ""}`,
19
- ref: s,
20
- children: t
17
+ children: /* @__PURE__ */ i(s.Provider, {
18
+ value: c === "dl",
19
+ children: i(c === "dl" ? "dl" : "div", {
20
+ ...u,
21
+ className: f,
22
+ ref: d,
23
+ children: t
24
+ })
21
25
  })
22
26
  });
23
27
  }
24
- var c = n(function({ label: e, children: t, action: n, align: s = "center", loading: c, className: l, ...u }, d) {
25
- let f = r(o), p = c ?? f;
28
+ var l = n(function({ label: e, children: t, action: n, align: c = "center", loading: l, className: u, ...d }, f) {
29
+ let p = r(o), m = l ?? p, h = r(s), g = h ? "dt" : "div", _ = h ? "dd" : "div";
26
30
  return /* @__PURE__ */ a("div", {
27
- ref: d,
28
- ...u,
29
- className: `select-detail select-detail--${s}${l ? " " + l : ""}`,
31
+ ref: f,
32
+ ...d,
33
+ className: `select-detail select-detail--${c}${u ? " " + u : ""}`,
30
34
  children: [
31
- /* @__PURE__ */ i("div", {
35
+ /* @__PURE__ */ i(g, {
32
36
  className: "select-detail__label",
33
37
  children: e
34
38
  }),
35
- /* @__PURE__ */ i("div", {
39
+ /* @__PURE__ */ i(_, {
36
40
  className: "select-detail__value",
37
- children: p ? /* @__PURE__ */ i("span", { className: "select-skeleton select-detail__skel" }) : t
41
+ children: m ? /* @__PURE__ */ i("span", { className: "select-skeleton select-detail__skel" }) : t
38
42
  }),
39
- n && /* @__PURE__ */ i("div", {
43
+ n && /* @__PURE__ */ i(_, {
40
44
  className: "select-detail__action",
41
45
  children: n
42
46
  })
@@ -44,6 +48,6 @@ var c = n(function({ label: e, children: t, action: n, align: s = "center", load
44
48
  });
45
49
  });
46
50
  //#endregion
47
- export { s as SelectDetailList, c as SelectDetailRow };
51
+ export { c as SelectDetailList, l as SelectDetailRow };
48
52
 
49
53
  //# sourceMappingURL=SelectDetail.js.map
@@ -1,7 +1,9 @@
1
- import { ComponentPropsWithoutRef, ReactNode } from 'react';
1
+ import { ComponentPropsWithoutRef, ReactNode, HTMLAttributes } from 'react';
2
2
  type SelectKpiBandOwnProps = {
3
3
  children: ReactNode;
4
+ /** 0.1.210: `dl` para a faixa de números só de leitura (os `SelectKpiCard` viram `<dt>` e `<dd>`). Padrão `div`. */
5
+ as?: 'div' | 'dl';
4
6
  };
5
7
  export type SelectKpiBandProps = SelectKpiBandOwnProps & Omit<ComponentPropsWithoutRef<'div'>, keyof SelectKpiBandOwnProps>;
6
- export declare const SelectKpiBand: import('react').ForwardRefExoticComponent<SelectKpiBandOwnProps & Omit<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "children"> & import('react').RefAttributes<HTMLDivElement>>;
8
+ export declare const SelectKpiBand: import('react').ForwardRefExoticComponent<SelectKpiBandOwnProps & Omit<Omit<import('react').DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, keyof SelectKpiBandOwnProps> & import('react').RefAttributes<HTMLDivElement>>;
7
9
  export {};
@@ -1,17 +1,28 @@
1
1
  /* empty css */
2
- import { forwardRef as e } from "react";
3
- import { jsx as t } from "react/jsx-runtime";
2
+ import { useInsideFrame as e } from "./internal/frame.js";
3
+ import { KpiListContext as t } from "./internal/kpiList.js";
4
+ import { forwardRef as n } from "react";
5
+ import { jsx as r } from "react/jsx-runtime";
4
6
  //#region src/SelectKpiBand.tsx
5
- var n = e(function({ children: e, className: n, ...r }, i) {
6
- return /* @__PURE__ */ t("div", {
7
- ref: i,
7
+ var i = n(function({ children: n, as: i = "div", className: a, ...o }, s) {
8
+ let c = `select-kpiband${e() ? " select-kpiband--nested" : ""}${a ? " " + a : ""}`;
9
+ return i === "dl" ? /* @__PURE__ */ r(t.Provider, {
10
+ value: !0,
11
+ children: /* @__PURE__ */ r("dl", {
12
+ ref: s,
13
+ ...o,
14
+ className: c,
15
+ children: n
16
+ })
17
+ }) : /* @__PURE__ */ r("div", {
18
+ ref: s,
8
19
  role: "group",
9
- ...r,
10
- className: `select-kpiband${n ? " " + n : ""}`,
11
- children: e
20
+ ...o,
21
+ className: c,
22
+ children: n
12
23
  });
13
24
  });
14
25
  //#endregion
15
- export { n as SelectKpiBand };
26
+ export { i as SelectKpiBand };
16
27
 
17
28
  //# sourceMappingURL=SelectKpiBand.js.map
@@ -1,54 +1,59 @@
1
1
  import { SelectInfoTip as e } from "./SelectInfoTip.js";
2
- import { forwardRef as t } from "react";
3
- import { Fragment as n, jsx as r, jsxs as i } from "react/jsx-runtime";
2
+ import { useKpiList as t } from "./internal/kpiList.js";
3
+ import { forwardRef as n } from "react";
4
+ import { Fragment as r, jsx as i, jsxs as a } from "react/jsx-runtime";
4
5
  //#region src/SelectKpiCard.tsx
5
- var a = t(function({ label: t, value: a, caption: o, chart: s, help: c, tone: l, bare: u = !1, onClick: d, selected: f = !1, loading: p = !1, className: m, ...h }, g) {
6
- let _ = d != null, v = _ ? {
6
+ var o = n(function({ label: n, value: o, caption: s, chart: c, help: l, tone: u, bare: d = !1, onClick: f, selected: p = !1, loading: m = !1, className: h, ...g }, _) {
7
+ let v = f != null, y = t(), b = y ? "dt" : "span", x = y ? "dd" : "span", S = y ? "dd" : "div", C = v ? {
7
8
  role: "button",
8
9
  tabIndex: 0,
9
- "aria-pressed": f,
10
- onClick: d,
10
+ "aria-pressed": p,
11
+ onClick: f,
11
12
  onKeyDown: (e) => {
12
- e.target === e.currentTarget && (e.key === "Enter" || e.key === " ") && (e.preventDefault(), d());
13
+ e.target === e.currentTarget && (e.key === "Enter" || e.key === " ") && (e.preventDefault(), f());
13
14
  }
14
- } : {}, y = "select-kpi" + (u ? " select-kpi--bare" : "") + (_ ? " select-kpi--interactive" : "") + (_ && f ? " select-kpi--selected" : "") + (m ? " " + m : "");
15
- return /* @__PURE__ */ i("div", {
16
- ref: g,
17
- ...h,
18
- ...v,
19
- className: y,
20
- children: [/* @__PURE__ */ i("span", {
21
- className: `select-kpi__label${c == null ? "" : " select-kpi__label--help"}`,
22
- children: [c == null ? t : /* @__PURE__ */ r("span", {
15
+ } : {}, w = "select-kpi" + (d ? " select-kpi--bare" : "") + (v ? " select-kpi--interactive" : "") + (v && p ? " select-kpi--selected" : "") + (h ? " " + h : "");
16
+ return /* @__PURE__ */ a("div", {
17
+ ref: _,
18
+ ...g,
19
+ ...C,
20
+ className: w,
21
+ children: [/* @__PURE__ */ a(b, {
22
+ className: `select-kpi__label${l == null ? "" : " select-kpi__label--help"}`,
23
+ children: [l == null ? n : /* @__PURE__ */ i("span", {
23
24
  className: "select-kpi__labeltext",
24
- children: t
25
- }), c != null && /* @__PURE__ */ r(e, {
26
- content: c,
25
+ children: n
26
+ }), l != null && /* @__PURE__ */ i(e, {
27
+ content: l,
27
28
  placement: "top-end"
28
29
  })]
29
- }), p ? /* @__PURE__ */ i(n, { children: [/* @__PURE__ */ r("span", {
30
+ }), m ? y ? /* @__PURE__ */ a("dd", {
31
+ className: "select-kpi__loading",
32
+ "aria-hidden": "true",
33
+ children: [/* @__PURE__ */ i("span", { className: "select-skeleton select-kpi__skelvalue" }), /* @__PURE__ */ i("span", { className: "select-skeleton select-kpi__skelcaption" })]
34
+ }) : /* @__PURE__ */ a(r, { children: [/* @__PURE__ */ i("span", {
30
35
  className: "select-skeleton select-kpi__skelvalue",
31
36
  "aria-hidden": "true"
32
- }), /* @__PURE__ */ r("span", {
37
+ }), /* @__PURE__ */ i("span", {
33
38
  className: "select-skeleton select-kpi__skelcaption",
34
39
  "aria-hidden": "true"
35
- })] }) : /* @__PURE__ */ i(n, { children: [
36
- /* @__PURE__ */ r("span", {
37
- className: `select-kpi__value${l ? ` select-kpi__value--${l}` : ""}`,
38
- children: a
40
+ })] }) : /* @__PURE__ */ a(r, { children: [
41
+ /* @__PURE__ */ i(x, {
42
+ className: `select-kpi__value${u ? ` select-kpi__value--${u}` : ""}`,
43
+ children: o
39
44
  }),
40
- s != null && /* @__PURE__ */ r("div", {
45
+ c != null && /* @__PURE__ */ i(S, {
41
46
  className: "select-kpi__chart",
42
- children: s
47
+ children: c
43
48
  }),
44
- o != null && /* @__PURE__ */ r("span", {
49
+ s != null && /* @__PURE__ */ i(x, {
45
50
  className: "select-kpi__caption",
46
- children: o
51
+ children: s
47
52
  })
48
53
  ] })]
49
54
  });
50
55
  });
51
56
  //#endregion
52
- export { a as SelectKpiCard };
57
+ export { o as SelectKpiCard };
53
58
 
54
59
  //# sourceMappingURL=SelectKpiCard.js.map
@@ -25,6 +25,8 @@ export interface SelectKitMessages {
25
25
  optional: string;
26
26
  notifications: string;
27
27
  needsAttention: string;
28
+ /** 0.1.209: o passo feito, para o leitor de tela (o visto do número é decorativo). */
29
+ done: string;
28
30
  };
29
31
  pagination: {
30
32
  label: string;
@@ -24,7 +24,8 @@ var r = {
24
24
  hidePassword: "Ocultar senha",
25
25
  optional: "(opcional)",
26
26
  notifications: "Notificações",
27
- needsAttention: "precisa de atenção"
27
+ needsAttention: "precisa de atenção",
28
+ done: "feito"
28
29
  },
29
30
  pagination: {
30
31
  label: "Paginação",
@@ -111,7 +112,8 @@ var r = {
111
112
  hidePassword: "Hide password",
112
113
  optional: "(optional)",
113
114
  notifications: "Notifications",
114
- needsAttention: "needs attention"
115
+ needsAttention: "needs attention",
116
+ done: "done"
115
117
  },
116
118
  pagination: {
117
119
  label: "Pagination",
@@ -19,5 +19,10 @@ export interface SelectPaginationProps {
19
19
  onPage?: (page: number) => void;
20
20
  /** Noun for the count label, e.g. "produtos". Defaults to "resultados" ("results" in English, `SelectLocaleProvider`). */
21
21
  noun?: string;
22
+ /**
23
+ * 0.1.210: a próxima página está chegando (a lista por cursor pede ao servidor). O "próxima" gira e fica
24
+ * `aria-busy`/`aria-disabled` sem perder o foco (o `disabled` o jogaria no `<body>`), e não aceita outro clique.
25
+ */
26
+ loading?: boolean;
22
27
  }
23
28
  export declare const SelectPagination: import('react').ForwardRefExoticComponent<SelectPaginationProps & Omit<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLElement>, HTMLElement>, "ref">, keyof SelectPaginationProps> & import('react').RefAttributes<HTMLElement>>;
@@ -1,10 +1,11 @@
1
1
  /* empty css */
2
- import { ChevronLeftIcon as e, ChevronRightIcon as t } from "./icons.js";
3
- import { formatSelectNumber as n, useSelectLocale as r, useSelectMessages as i } from "./SelectLocale.js";
4
- import { forwardRef as a } from "react";
5
- import { jsx as o, jsxs as s } from "react/jsx-runtime";
2
+ import { SelectSpinner as e } from "./SelectSpinner.js";
3
+ import { ChevronLeftIcon as t, ChevronRightIcon as n } from "./icons.js";
4
+ import { formatSelectNumber as r, useSelectLocale as i, useSelectMessages as a } from "./SelectLocale.js";
5
+ import { forwardRef as o } from "react";
6
+ import { jsx as s, jsxs as c } from "react/jsx-runtime";
6
7
  //#region src/SelectPagination.tsx
7
- function c(e, t) {
8
+ function l(e, t) {
8
9
  let n = [.../* @__PURE__ */ new Set([
9
10
  1,
10
11
  t,
@@ -15,7 +16,7 @@ function c(e, t) {
15
16
  for (let e of n) e - i > 1 && r.push("gap"), r.push(e), i = e;
16
17
  return r;
17
18
  }
18
- function l(e, t, n, r, i, a, o, s) {
19
+ function u(e, t, n, r, i, a, o, s) {
19
20
  let c = [];
20
21
  if (e != null) {
21
22
  if (e === 0) c.push(o.count(s(0), i));
@@ -26,50 +27,53 @@ function l(e, t, n, r, i, a, o, s) {
26
27
  }
27
28
  return a && r != null && r > 0 && c.push(o.pageOf(s(n), s(r))), c;
28
29
  }
29
- var u = a(function({ page: a, pageCount: u, total: d, pageSize: f, hasPrevious: p, hasNext: m, onPrevious: h, onNext: g, onPage: _, noun: v, className: y, ...b }, x) {
30
- let S = i().pagination, C = r(), w = (e) => n(e, C), T = v ?? S.noun, E = p ?? a > 1, D = m ?? (u == null || a < u), O = h ?? (_ ? () => _(a - 1) : void 0), k = g ?? (_ ? () => _(a + 1) : void 0), A = u != null && u > 1 && _ != null, j = A ? c(a, u) : [], M = l(d, f, a, u, T, A, S, w);
31
- return /* @__PURE__ */ s("nav", {
32
- ref: x,
33
- ...b,
34
- className: `select-pagination${y ? " " + y : ""}`,
35
- "aria-label": S.label,
36
- children: [/* @__PURE__ */ s("div", {
30
+ var d = o(function({ page: o, pageCount: d, total: f, pageSize: p, hasPrevious: m, hasNext: h, onPrevious: g, onNext: _, onPage: v, noun: y, loading: b = !1, className: x, ...S }, C) {
31
+ let w = a().pagination, T = i(), E = (e) => r(e, T), D = y ?? w.noun, O = m ?? o > 1, k = h ?? (d == null || o < d), A = g ?? (v ? () => v(o - 1) : void 0), j = _ ?? (v ? () => v(o + 1) : void 0), M = d != null && d > 1 && v != null, N = M ? l(o, d) : [], P = u(f, p, o, d, D, M, w, E);
32
+ return /* @__PURE__ */ c("nav", {
33
+ ref: C,
34
+ ...S,
35
+ className: `select-pagination${x ? " " + x : ""}`,
36
+ "aria-label": w.label,
37
+ children: [/* @__PURE__ */ c("div", {
37
38
  className: "select-pagination__controls",
38
39
  children: [
39
- /* @__PURE__ */ o("button", {
40
+ /* @__PURE__ */ s("button", {
40
41
  type: "button",
41
42
  className: "select-pagination__nav",
42
- onClick: O,
43
- disabled: !E || !O,
44
- "aria-label": S.previous,
45
- children: /* @__PURE__ */ o(e, {})
43
+ onClick: A,
44
+ disabled: !O || !A,
45
+ "aria-label": w.previous,
46
+ children: /* @__PURE__ */ s(t, {})
46
47
  }),
47
- A ? j.map((e, t) => e === "gap" ? /* @__PURE__ */ o("span", {
48
+ M ? N.map((e, t) => e === "gap" ? /* @__PURE__ */ s("span", {
48
49
  className: "select-pagination__gap",
49
50
  "aria-hidden": "true",
50
51
  children: "…"
51
- }, `gap-${t}`) : /* @__PURE__ */ o("button", {
52
+ }, `gap-${t}`) : /* @__PURE__ */ s("button", {
52
53
  type: "button",
53
- className: `select-pagination__page${e === a ? " is-active" : ""}`,
54
- onClick: () => _ == null ? void 0 : _(e),
55
- "aria-current": e === a ? "page" : void 0,
54
+ className: `select-pagination__page${e === o ? " is-active" : ""}`,
55
+ onClick: () => v == null ? void 0 : v(e),
56
+ "aria-current": e === o ? "page" : void 0,
56
57
  children: e
57
- }, e)) : /* @__PURE__ */ o("span", {
58
+ }, e)) : /* @__PURE__ */ s("span", {
58
59
  className: "select-pagination__current",
59
- children: u == null ? S.page(w(a)) : `${w(a)} / ${w(u)}`
60
+ "aria-live": "polite",
61
+ children: d == null ? w.page(E(o)) : `${E(o)} / ${E(d)}`
60
62
  }),
61
- /* @__PURE__ */ o("button", {
63
+ /* @__PURE__ */ s("button", {
62
64
  type: "button",
63
65
  className: "select-pagination__nav",
64
- onClick: k,
65
- disabled: !D || !k,
66
- "aria-label": S.next,
67
- children: /* @__PURE__ */ o(t, {})
66
+ onClick: b ? void 0 : j,
67
+ disabled: !k || !j,
68
+ "aria-disabled": b || void 0,
69
+ "aria-busy": b || void 0,
70
+ "aria-label": w.next,
71
+ children: b ? /* @__PURE__ */ s(e, { size: "sm" }) : /* @__PURE__ */ s(n, {})
68
72
  })
69
73
  ]
70
- }), M.length > 0 && /* @__PURE__ */ o("p", {
74
+ }), P.length > 0 && /* @__PURE__ */ s("p", {
71
75
  className: "select-pagination__count",
72
- children: M.map((e, t) => /* @__PURE__ */ o("span", {
76
+ children: P.map((e, t) => /* @__PURE__ */ s("span", {
73
77
  className: "select-pagination__part",
74
78
  children: t > 0 ? ` · ${e}` : e
75
79
  }, t))
@@ -77,6 +81,6 @@ var u = a(function({ page: a, pageCount: u, total: d, pageSize: f, hasPrevious:
77
81
  });
78
82
  });
79
83
  //#endregion
80
- export { u as SelectPagination };
84
+ export { d as SelectPagination };
81
85
 
82
86
  //# sourceMappingURL=SelectPagination.js.map
@@ -25,6 +25,10 @@ type SelectSegmentedOwnProps = {
25
25
  disabled?: boolean;
26
26
  /** A recusa da escolha (0.1.141): a trilha com o contorno de erro e a frase embaixo, no lugar do `hint`. */
27
27
  error?: ReactNode;
28
+ /** `tabs` (padrão): a trilha troca um painel (tablist). `radio` (0.1.209): uma escolha (radiogroup). */
29
+ semantics?: 'tabs' | 'radio';
30
+ /** `sm` (0.1.209): o tier pequeno (28px) fora de um `.select-dense` — a linha de um menu, o cabeçalho de um cartão. */
31
+ size?: 'md' | 'sm';
28
32
  };
29
33
  export type SelectSegmentedProps = SelectSegmentedOwnProps & Omit<ComponentPropsWithoutRef<'div'>, keyof SelectSegmentedOwnProps>;
30
34
  export declare const SelectSegmented: import('react').ForwardRefExoticComponent<SelectSegmentedOwnProps & Omit<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, keyof SelectSegmentedOwnProps> & import('react').RefAttributes<HTMLDivElement>>;
@@ -1,51 +1,61 @@
1
1
  import { forwardRef as e, useId as t, useLayoutEffect as n, useRef as r, useState as i } from "react";
2
2
  import { jsx as a, jsxs as o } from "react/jsx-runtime";
3
3
  //#region src/SelectSegmented.tsx
4
- var s = e(function({ value: e, onChange: s, options: c, ariaLabel: l, fullWidth: u = !1, label: d, hint: f, disabled: p = !1, error: m, className: h, ...g }, _) {
5
- let v = t(), y = Math.max(0, c.findIndex((t) => t.value === e)), b = r([]), [x, S] = i(null), C = c.map((e) => e.count ?? "").join(",");
4
+ var s = e(function({ value: e, onChange: s, options: c, ariaLabel: l, fullWidth: u = !1, label: d, hint: f, disabled: p = !1, error: m, semantics: h = "tabs", size: g = "md", className: _, ...v }, y) {
5
+ let b = t(), x = Math.max(0, c.findIndex((t) => t.value === e)), S = r([]), [C, w] = i(null), T = h === "radio", E = c.map((e) => e.count ?? "").join(",");
6
6
  n(() => {
7
7
  let e = () => {
8
- let e = b.current[y];
8
+ let e = S.current[x];
9
9
  if (!e) return;
10
10
  let t = {
11
11
  left: e.offsetLeft,
12
12
  width: e.offsetWidth
13
13
  };
14
- S((e) => e && e.left === t.left && e.width === t.width ? e : t);
14
+ w((e) => e && e.left === t.left && e.width === t.width ? e : t);
15
15
  };
16
16
  e();
17
17
  let t = typeof ResizeObserver < "u" ? new ResizeObserver(e) : null;
18
- return b.current.forEach((e) => e && (t == null ? void 0 : t.observe(e))), () => t == null ? void 0 : t.disconnect();
18
+ return S.current.forEach((e) => e && (t == null ? void 0 : t.observe(e))), () => t == null ? void 0 : t.disconnect();
19
19
  }, [
20
- y,
20
+ x,
21
21
  c.length,
22
- C
22
+ E
23
23
  ]);
24
- let w = x ? {
25
- left: x.left,
26
- width: x.width,
24
+ let D = C ? {
25
+ left: C.left,
26
+ width: C.width,
27
27
  opacity: 1
28
- } : { opacity: 0 }, T = /* @__PURE__ */ o("div", {
29
- ref: d == null ? _ : void 0,
30
- ...d == null ? g : {},
31
- className: `select-segmented${u ? " select-segmented--full" : ""}${p ? " select-segmented--disabled" : ""}${m != null && m !== !1 ? " select-segmented--error" : ""}${d == null && h ? " " + h : ""}`,
32
- role: "tablist",
28
+ } : { opacity: 0 }, O = d == null ? v : {}, k = (t) => {
29
+ var n, r;
30
+ if ((n = O.onKeyDown) == null || n.call(O, t), t.defaultPrevented || p || !c.length) return;
31
+ let i = S.current.findIndex((e) => e === t.target);
32
+ if (i < 0) return;
33
+ let a = t.key === "ArrowRight" || T && t.key === "ArrowDown", o = t.key === "ArrowLeft" || T && t.key === "ArrowUp", l = a ? (i + 1) % c.length : o ? (i - 1 + c.length) % c.length : t.key === "Home" ? 0 : t.key === "End" ? c.length - 1 : -1;
34
+ l < 0 || (t.preventDefault(), (r = S.current[l]) == null || r.focus(), c[l].value !== e && s(c[l].value));
35
+ }, A = /* @__PURE__ */ o("div", {
36
+ ref: d == null ? y : void 0,
37
+ ...O,
38
+ className: `select-segmented${u ? " select-segmented--full" : ""}${g === "sm" ? " select-segmented--sm" : ""}${p ? " select-segmented--disabled" : ""}${m != null && m !== !1 ? " select-segmented--error" : ""}${d == null && _ ? " " + _ : ""}`,
39
+ role: T ? "radiogroup" : "tablist",
33
40
  "aria-label": l,
34
- "aria-labelledby": d != null && !l ? v : void 0,
41
+ "aria-labelledby": d != null && !l ? b : void 0,
35
42
  "aria-disabled": p || void 0,
43
+ onKeyDown: k,
36
44
  children: [/* @__PURE__ */ a("span", {
37
45
  className: "select-segmented__pill",
38
46
  "aria-hidden": "true",
39
- style: w
47
+ style: D
40
48
  }), c.map((t, n) => {
41
49
  let r = t.value === e, i = !!t.count && t.count > 0, c = t.title && i ? `${t.title}, ${t.countLabel ?? t.count}` : t.title;
42
50
  return /* @__PURE__ */ o("button", {
43
51
  ref: (e) => {
44
- b.current[n] = e;
52
+ S.current[n] = e;
45
53
  },
46
54
  type: "button",
47
- role: "tab",
48
- "aria-selected": r,
55
+ role: T ? "radio" : "tab",
56
+ "aria-selected": T ? void 0 : r,
57
+ "aria-checked": T ? r : void 0,
58
+ tabIndex: n === x ? 0 : -1,
49
59
  className: `select-segmented__item${r ? " select-segmented__item--active" : ""}`,
50
60
  title: t.title,
51
61
  "aria-label": c,
@@ -58,28 +68,28 @@ var s = e(function({ value: e, onChange: s, options: c, ariaLabel: l, fullWidth:
58
68
  }) : null]
59
69
  }, t.value);
60
70
  })]
61
- }), E = m != null && m !== !1 && m !== "";
62
- return d == null && !E ? T : d == null ? /* @__PURE__ */ o("div", {
71
+ }), j = m != null && m !== !1 && m !== "";
72
+ return d == null && !j ? A : d == null ? /* @__PURE__ */ o("div", {
63
73
  className: "select-field",
64
- children: [T, /* @__PURE__ */ a("p", {
74
+ children: [A, /* @__PURE__ */ a("p", {
65
75
  className: "select-field__error",
66
76
  children: m
67
77
  })]
68
78
  }) : /* @__PURE__ */ o("div", {
69
- ref: _,
70
- ...g,
71
- className: `select-field${h ? " " + h : ""}`,
79
+ ref: y,
80
+ ...v,
81
+ className: `select-field${_ ? " " + _ : ""}`,
72
82
  children: [
73
83
  /* @__PURE__ */ a("div", {
74
84
  className: "select-field__labelrow",
75
85
  children: /* @__PURE__ */ a("span", {
76
86
  className: "select-field__label",
77
- id: v,
87
+ id: b,
78
88
  children: d
79
89
  })
80
90
  }),
81
- T,
82
- E ? /* @__PURE__ */ a("p", {
91
+ A,
92
+ j ? /* @__PURE__ */ a("p", {
83
93
  className: "select-field__error",
84
94
  children: m
85
95
  }) : f != null && /* @__PURE__ */ a("p", {
@@ -29,6 +29,14 @@ var o = n(function({ steps: n, current: o, onSelect: s, orientation: c = "horizo
29
29
  ")"
30
30
  ]
31
31
  }),
32
+ l === "done" && /* @__PURE__ */ a("span", {
33
+ className: "select-steps__sr",
34
+ children: [
35
+ "(",
36
+ p.common.done,
37
+ ")"
38
+ ]
39
+ }),
32
40
  m && c.description && /* @__PURE__ */ i("span", {
33
41
  className: "select-steps__desc",
34
42
  children: c.description
@@ -4,6 +4,8 @@ export interface SelectTab {
4
4
  label: ReactNode;
5
5
  /** Status dot tone shown before the label. */
6
6
  dot?: 'success' | 'neutral' | 'warning';
7
+ /** O número do que a aba mostra (0.1.209), na língua do kit: as falhas das entregas, os itens de um estado. O 0 aparece. */
8
+ count?: number;
7
9
  }
8
10
  type SelectTabsOwnProps = {
9
11
  tabs: SelectTab[];
@@ -12,7 +14,9 @@ type SelectTabsOwnProps = {
12
14
  /** Right-aligned slot INSIDE the tab bar (shares the bottom border) — e.g. a board's
13
15
  * "Personalizar" trigger. Controls inside render on the small (28px) tier. */
14
16
  end?: ReactNode;
17
+ /** O id do conteúdo que as abas trocam (0.1.209): vira o `aria-controls` de cada aba. */
18
+ panelId?: string;
15
19
  };
16
20
  export type SelectTabsProps = SelectTabsOwnProps & Omit<ComponentPropsWithoutRef<'div'>, keyof SelectTabsOwnProps>;
17
- export declare function SelectTabs({ tabs, value, onChange, end, className, ...rest }: SelectTabsProps): import("react").JSX.Element;
21
+ export declare function SelectTabs({ tabs, value, onChange, end, panelId, className, onKeyDown, ...rest }: SelectTabsProps): import("react").JSX.Element;
18
22
  export {};