@selectwin/kit 0.1.212 → 0.1.213

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.
@@ -31,6 +31,11 @@ type SelectSectionOwnProps = {
31
31
  * dentro de uma superfície sólida (`SelectRegions`, o drawer do Workbench); numa página, a seção segue two-tone.
32
32
  */
33
33
  flush?: boolean;
34
+ /**
35
+ * 0.1.213: a seção é a moldura de uma lista (a `SelectTable` de dentro): o corpo sem a caixa branca nem o respiro, e
36
+ * a tabela com o cabeçalho na moldura e as linhas na caixa branca dela. Sem tabela no corpo, a caixa branca volta.
37
+ */
38
+ list?: boolean;
34
39
  children: ReactNode;
35
40
  };
36
41
  export type SelectSectionProps = SelectSectionOwnProps & Omit<ComponentPropsWithoutRef<'div'>, keyof SelectSectionOwnProps>;
@@ -6,20 +6,20 @@ import { inertProps as i } from "./internal/inert.js";
6
6
  import { forwardRef as a, useId as o, useState as s } from "react";
7
7
  import { jsx as c, jsxs as l } from "react/jsx-runtime";
8
8
  //#region src/SelectSection.tsx
9
- var u = a(function({ title: a, help: u, description: d, action: f, collapsible: p = !1, defaultOpen: m = !0, open: h, onOpenChange: g, footer: _, flush: v = !1, children: y, className: b, ...x }, S) {
10
- let [C, w] = s(m), T = h ?? C, E = o(), D = () => {
11
- h === void 0 && w(!T), g == null || g(!T);
12
- }, O = (r() ? " select-section--nested" : "") + (v ? " select-section--flush" : "");
9
+ var u = a(function({ title: a, help: u, description: d, action: f, collapsible: p = !1, defaultOpen: m = !0, open: h, onOpenChange: g, footer: _, flush: v = !1, list: y = !1, children: b, className: x, ...S }, C) {
10
+ let [w, T] = s(m), E = h ?? w, D = o(), O = () => {
11
+ h === void 0 && T(!E), g == null || g(!E);
12
+ }, k = (r() ? " select-section--nested" : "") + (v ? " select-section--flush" : "") + (y ? " select-section--list" : ""), A = y ? "list" : "body";
13
13
  return p ? /* @__PURE__ */ l("div", {
14
- ref: S,
15
- ...x,
16
- className: `select-section select-section--collapsible${O}${T ? " is-open" : ""}${b ? " " + b : ""}`,
14
+ ref: C,
15
+ ...S,
16
+ className: `select-section select-section--collapsible${k}${E ? " is-open" : ""}${x ? " " + x : ""}`,
17
17
  children: [/* @__PURE__ */ l("button", {
18
18
  type: "button",
19
19
  className: "select-section__head select-section__head--toggle",
20
- "aria-expanded": T,
21
- "aria-controls": E,
22
- onClick: D,
20
+ "aria-expanded": E,
21
+ "aria-controls": D,
22
+ onClick: O,
23
23
  children: [/* @__PURE__ */ l("span", {
24
24
  className: "select-section__heading",
25
25
  children: [a && /* @__PURE__ */ c("span", {
@@ -35,15 +35,18 @@ var u = a(function({ title: a, help: u, description: d, action: f, collapsible:
35
35
  children: /* @__PURE__ */ c(e, {})
36
36
  })]
37
37
  }), /* @__PURE__ */ c("div", {
38
- id: E,
38
+ id: D,
39
39
  className: "select-section__collapse",
40
- "data-open": T,
41
- ...i(!T),
40
+ "data-open": E,
41
+ ...i(!E),
42
42
  children: /* @__PURE__ */ l("div", {
43
43
  className: "select-section__collapsewrap",
44
44
  children: [/* @__PURE__ */ c("div", {
45
45
  className: "select-section__body",
46
- children: /* @__PURE__ */ c(n, { children: y })
46
+ children: /* @__PURE__ */ c(n, {
47
+ kind: A,
48
+ children: b
49
+ })
47
50
  }), _ != null && _ !== "" && /* @__PURE__ */ c("div", {
48
51
  className: "select-section__foot",
49
52
  children: _
@@ -51,9 +54,9 @@ var u = a(function({ title: a, help: u, description: d, action: f, collapsible:
51
54
  })
52
55
  })]
53
56
  }) : /* @__PURE__ */ l("div", {
54
- ref: S,
55
- ...x,
56
- className: `select-section${O}${b ? " " + b : ""}`,
57
+ ref: C,
58
+ ...S,
59
+ className: `select-section${k}${x ? " " + x : ""}`,
57
60
  children: [
58
61
  (a || d || f) && /* @__PURE__ */ l("div", {
59
62
  className: "select-section__head",
@@ -73,7 +76,10 @@ var u = a(function({ title: a, help: u, description: d, action: f, collapsible:
73
76
  }),
74
77
  /* @__PURE__ */ c("div", {
75
78
  className: "select-section__body",
76
- children: /* @__PURE__ */ c(n, { children: y })
79
+ children: /* @__PURE__ */ c(n, {
80
+ kind: A,
81
+ children: b
82
+ })
77
83
  }),
78
84
  _ != null && _ !== "" && /* @__PURE__ */ c("div", {
79
85
  className: "select-section__foot",
@@ -73,6 +73,25 @@ type SelectTableOwnProps = {
73
73
  * separados por linhas de 1px.
74
74
  */
75
75
  flush?: boolean;
76
+ /**
77
+ * 0.1.213: o nome da tabela para o leitor de tela (a grade é `role="table"`). Sem ele, o nome é o `title` quando o
78
+ * `title` é texto.
79
+ */
80
+ label?: string;
81
+ /**
82
+ * 0.1.213: a largura mínima das colunas juntas (um comprimento CSS, `'48rem'`): abaixo dela a tabela rola de lado em
83
+ * vez de apertar as colunas. Sem ela, o mínimo é a soma dos pisos das colunas.
84
+ */
85
+ minWidth?: string;
86
+ /**
87
+ * 0.1.213: como as colunas flexíveis (as sem `width`) dividem a largura.
88
+ * · `even` (o padrão): cada uma leva a mesma fatia (vezes o `grow`);
89
+ * · `content`: cada uma leva a fatia do que ela tem — a tabela mede a largura natural de cada coluna (o cabeçalho e
90
+ * as células) e divide a largura na mesma proporção, como a tabela do HTML. O nome longo ganha espaço e o "OK" não
91
+ * o desperdiça. Nenhuma coluna fica mais estreita que o que ela tem (até 20rem, `--select-table-col-cap`): sem
92
+ * espaço, a tabela rola de lado. O cabeçalho continua alinhado com as linhas (a mesma grade).
93
+ */
94
+ sizing?: 'even' | 'content';
76
95
  };
77
96
  export type SelectTableProps = SelectTableOwnProps & Omit<ComponentPropsWithoutRef<'div'>, keyof SelectTableOwnProps>;
78
97
  export declare const SelectTable: import('react').ForwardRefExoticComponent<SelectTableOwnProps & Omit<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, keyof SelectTableOwnProps> & import('react').RefAttributes<HTMLDivElement>>;
@@ -93,14 +112,26 @@ export declare const SelectUserCell: import('react').ForwardRefExoticComponent<S
93
112
  * vêm logo abaixo com `nested` — recuadas e num fundo afundado, na MESMA grade de colunas.
94
113
  * Continua uma tabela só: nada de tabela dentro de linha (card dentro de card).
95
114
  */
96
- export declare function SelectTableRow({ children, onClick, expanded, nested, }: {
115
+ type SelectTableRowOwnProps = {
97
116
  children: ReactNode;
98
117
  onClick?: () => void;
99
118
  /** Linha-mãe de um grupo: aberta/fechada (vira `aria-expanded`). */
100
119
  expanded?: boolean;
101
120
  /** Linha-filha de um grupo aberto. */
102
121
  nested?: boolean;
103
- }): import("react").JSX.Element;
122
+ /**
123
+ * 0.1.213: a linha do que está aberto agora (o plano que a página mostra ao lado, a mensagem da gaveta): o fundo
124
+ * afundado e `aria-current`.
125
+ */
126
+ current?: boolean;
127
+ /**
128
+ * 0.1.213: a linha que abre um grupo de linhas ("Do workspace · as regras dele"): o título numa célula que ocupa a
129
+ * linha toda (`<SelectTableCell span="all">`), no fundo afundado.
130
+ */
131
+ section?: boolean;
132
+ };
133
+ export type SelectTableRowProps = SelectTableRowOwnProps & Omit<ComponentPropsWithoutRef<'div'>, keyof SelectTableRowOwnProps | 'role'>;
134
+ export declare function SelectTableRow({ children, onClick, expanded, nested, current, section, className, ...rest }: SelectTableRowProps): import("react").JSX.Element;
104
135
  type SelectTableCellOwnProps = {
105
136
  children: ReactNode;
106
137
  align?: 'start' | 'end' | 'center';
@@ -110,6 +141,12 @@ type SelectTableCellOwnProps = {
110
141
  /** Chevron de grupo antes do conteúdo (primeira célula da linha-mãe). `'none'` reserva o
111
142
  * espaço sem desenhar, para alinhar uma linha sem filhas com as vizinhas que têm. */
112
143
  disclosure?: 'open' | 'closed' | 'none';
144
+ /** 0.1.213: o cabeçalho da linha (`role="rowheader"`): o leitor de tela diz o nome da linha em cada célula dela. */
145
+ header?: boolean;
146
+ /** 0.1.213: quantas colunas a célula ocupa (`'all'`: a linha toda — o título do grupo, o detalhe aberto). */
147
+ span?: number | 'all';
148
+ /** 0.1.213: o texto quebra linha em vez de cortar (a descrição, o valor longo que não pode sumir). */
149
+ wrap?: boolean;
113
150
  };
114
151
  export type SelectTableCellProps = SelectTableCellOwnProps & Omit<ComponentPropsWithoutRef<'div'>, keyof SelectTableCellOwnProps>;
115
152
  export declare const SelectTableCell: import('react').ForwardRefExoticComponent<SelectTableCellOwnProps & Omit<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, keyof SelectTableCellOwnProps> & import('react').RefAttributes<HTMLDivElement>>;
@@ -1,61 +1,83 @@
1
1
  import { ChevronDownIcon as e, ChevronRightIcon as t } from "./icons.js";
2
2
  import { useSelectReveal as n } from "./internal/useSelectReveal.js";
3
- import { FrameBody as r, useInsideFrame as i } from "./internal/frame.js";
3
+ import { FrameBody as r, useFrameKind as i } from "./internal/frame.js";
4
4
  import { SelectAvatar as a } from "./SelectAvatar.js";
5
5
  import { SelectListChrome as o, listChromeShape as s } from "./internal/listChrome.js";
6
- import { Children as c, forwardRef as l, useCallback as u, useId as d, useLayoutEffect as f, useRef as p, useState as m } from "react";
7
- import { Fragment as h, jsx as g, jsxs as _ } from "react/jsx-runtime";
6
+ import { Children as c, createContext as l, forwardRef as u, useCallback as d, useContext as f, useId as p, useLayoutEffect as ee, useRef as m, useState as h } from "react";
7
+ import { Fragment as g, jsx as _, jsxs as v } from "react/jsx-runtime";
8
8
  //#region src/SelectTable.tsx
9
- var v = 40, y = 1200, b = 8;
10
- function x(e) {
9
+ var y = 40, b = 1200, x = 8;
10
+ function S(e) {
11
11
  let t = parseFloat(getComputedStyle(document.documentElement).fontSize) || 16;
12
12
  return `${Math.round(e / t * 1e3) / 1e3}rem`;
13
13
  }
14
- var S = l(function({ columns: t, children: a, empty: l, footer: h, title: S, help: w, description: T, action: E, filters: D, tools: O, onColumnResize: k, onColumnResizeReset: A, collapsible: j = !1, defaultOpen: M = !0, flush: N = !1, className: P, ...F }, I) {
15
- let [L, R] = m(M), z = d(), B = j && S != null ? {
16
- open: L,
17
- onToggle: () => R((e) => !e),
18
- controls: z
19
- } : void 0, V = c.count(a) === 0, H = V && !!l, { hasFilters: U, hasTitleRow: W } = s({
20
- title: S,
21
- description: T,
14
+ var C = l(0), w = u(function({ columns: t, children: a, empty: l, footer: u, title: f, help: g, description: w, action: E, filters: D, tools: O, onColumnResize: k, onColumnResizeReset: A, collapsible: j = !1, defaultOpen: M = !0, flush: N = !1, label: P, minWidth: F, sizing: I = "even", className: L, ...te }, R) {
15
+ let ne = P ?? (typeof f == "string" ? f : void 0), [z, B] = h(M), V = p(), H = j && f != null ? {
16
+ open: z,
17
+ onToggle: () => B((e) => !e),
18
+ controls: V
19
+ } : void 0, U = c.count(a) === 0, W = U && !!l, { hasFilters: G, hasTitleRow: K } = s({
20
+ title: f,
21
+ description: w,
22
22
  action: E,
23
23
  filters: D,
24
24
  tools: O
25
- }), G = H && !W && !U, K = i(), q = n({
25
+ }), q = W && !K && !G, J = i(), Y = J === "body", X = J === "list", re = n({
26
26
  selector: ".select-table__row",
27
27
  y: 8,
28
28
  duration: .45,
29
29
  stagger: .05,
30
30
  scroll: !0
31
- }), J = t.length ? t.map((e) => e.width ?? `minmax(${e.minWidth ?? "var(--select-table-col-min, 6.5rem)"}, ${e.grow ?? 1}fr)`).join(" ") : "1fr", Y = p(null), X = u((e) => {
32
- Y.current = e, typeof I == "function" ? I(e) : I && (I.current = e);
33
- }, [I]);
34
- f(() => {
35
- var e;
36
- (e = Y.current) == null || e.style.setProperty("--select-table-cols", J);
37
- }, [J]);
38
- let Z = (e, n) => {
39
- let r = Y.current;
31
+ }), Z = t.length ? t.map((e) => e.width ?? `minmax(${e.minWidth ?? "var(--select-table-col-min, 6.5rem)"}, ${e.grow ?? 1}fr)`).join(" ") : "1fr", Q = m(null), ie = d((e) => {
32
+ Q.current = e, typeof R == "function" ? R(e) : R && (R.current = e);
33
+ }, [R]);
34
+ ee(() => {
35
+ let e = Q.current;
36
+ if (!e) return;
37
+ if (I !== "content" || !t.some((e) => e.width == null)) {
38
+ e.style.setProperty("--select-table-cols", Z);
39
+ return;
40
+ }
41
+ e.style.setProperty("--select-table-cols", t.map((e) => e.width ?? "max-content").join(" "));
42
+ let n = t.map(() => 0);
43
+ for (let r of e.querySelectorAll(".select-table__head, .select-table__row")) {
44
+ if (r.closest(".select-table") !== e) continue;
45
+ let i = [...r.children];
46
+ i.length !== t.length || i.some((e) => e.style.gridColumn) || i.forEach((e, t) => {
47
+ n[t] = Math.max(n[t], e.getBoundingClientRect().width);
48
+ });
49
+ }
50
+ if (n.every((e) => e === 0)) {
51
+ e.style.setProperty("--select-table-cols", Z);
52
+ return;
53
+ }
54
+ e.style.setProperty("--select-table-cols", t.map((e, t) => {
55
+ if (e.width) return e.width;
56
+ let r = Math.max(1, Math.ceil(n[t]));
57
+ return `minmax(${e.minWidth ?? `min(${r}px, var(--select-table-col-cap, 20rem))`}, ${Math.max(1, Math.round(r * (e.grow ?? 1)))}fr)`;
58
+ }).join(" "));
59
+ });
60
+ let $ = (e, n) => {
61
+ let r = Q.current;
40
62
  if (!r) return;
41
63
  let i = t.map((t, r) => r === e ? `${n}px` : t.width ?? `minmax(${t.minWidth ?? "var(--select-table-col-min, 6.5rem)"}, ${t.grow ?? 1}fr)`);
42
64
  r.style.setProperty("--select-table-cols", i.join(" "));
43
- }, Q = (e) => (t) => {
65
+ }, ae = (e) => (t) => {
44
66
  var n;
45
67
  if (!k || t.button !== 0) return;
46
68
  let r = (n = t.currentTarget.parentElement) == null ? void 0 : n.getBoundingClientRect();
47
69
  if (!r) return;
48
70
  let i = t.clientX, a = r.width;
49
71
  t.preventDefault(), t.stopPropagation(), t.currentTarget.setPointerCapture(t.pointerId);
50
- let o = Y.current;
72
+ let o = Q.current;
51
73
  o == null || o.classList.add("select-table--resizing");
52
74
  let s = a, c = (t) => {
53
- s = Math.min(y, Math.max(v, a + (t.clientX - i))), Z(e, s);
75
+ s = Math.min(b, Math.max(y, a + (t.clientX - i))), $(e, s);
54
76
  }, l = () => {
55
- window.removeEventListener("pointermove", c), window.removeEventListener("pointerup", l), window.removeEventListener("pointercancel", l), o == null || o.classList.remove("select-table--resizing"), k(e, x(s));
77
+ window.removeEventListener("pointermove", c), window.removeEventListener("pointerup", l), window.removeEventListener("pointercancel", l), o == null || o.classList.remove("select-table--resizing"), k(e, S(s));
56
78
  };
57
79
  window.addEventListener("pointermove", c), window.addEventListener("pointerup", l), window.addEventListener("pointercancel", l);
58
- }, $ = (e) => (t) => {
80
+ }, oe = (e) => (t) => {
59
81
  var n;
60
82
  if (!k) return;
61
83
  let r = t.key === "ArrowRight" ? 1 : t.key === "ArrowLeft" ? -1 : 0;
@@ -63,157 +85,177 @@ var S = l(function({ columns: t, children: a, empty: l, footer: h, title: S, hel
63
85
  let i = (n = t.currentTarget.parentElement) == null ? void 0 : n.getBoundingClientRect();
64
86
  if (!i) return;
65
87
  t.preventDefault();
66
- let a = b * (t.shiftKey ? 10 : 1), o = Math.min(y, Math.max(v, i.width + r * a));
67
- Z(e, o), k(e, x(o));
88
+ let a = x * (t.shiftKey ? 10 : 1), o = Math.min(b, Math.max(y, i.width + r * a));
89
+ $(e, o), k(e, S(o));
68
90
  };
69
- return /* @__PURE__ */ _("div", {
70
- ref: X,
71
- ...F,
72
- className: `select-table${G ? " select-table--empty" : ""}${K && !N ? " select-table--nested" : ""}${N ? " select-table--flush" : ""}${B ? ` select-table--collapsible${L ? " is-open" : ""}` : ""}${P ? " " + P : ""}`,
73
- style: { "--select-table-cols": J },
74
- children: [/* @__PURE__ */ g(o, {
75
- title: S,
76
- help: B ? void 0 : w,
77
- description: T,
91
+ return /* @__PURE__ */ v("div", {
92
+ ref: ie,
93
+ ...te,
94
+ className: `select-table${q ? " select-table--empty" : ""}${Y && !N ? " select-table--nested" : ""}${X && !N ? " select-table--inlist" : ""}${N ? " select-table--flush" : ""}${H ? ` select-table--collapsible${z ? " is-open" : ""}` : ""}${L ? " " + L : ""}`,
95
+ style: {
96
+ "--select-table-cols": Z,
97
+ ...F ? { "--select-table-min": F } : {}
98
+ },
99
+ children: [/* @__PURE__ */ _(o, {
100
+ title: f,
101
+ help: H ? void 0 : g,
102
+ description: w,
78
103
  action: E,
79
- filters: B ? void 0 : D,
80
- tools: B ? void 0 : O,
81
- toggle: B
82
- }), /* @__PURE__ */ _(C, {
83
- enabled: !!B,
84
- open: L,
85
- id: z,
104
+ filters: H ? void 0 : D,
105
+ tools: H ? void 0 : O,
106
+ toggle: H
107
+ }), /* @__PURE__ */ v(T, {
108
+ enabled: !!H,
109
+ open: z,
110
+ id: V,
86
111
  children: [
87
- B && (D != null || O != null) ? /* @__PURE__ */ g(o, {
112
+ H && (D != null || O != null) ? /* @__PURE__ */ _(o, {
88
113
  filters: D,
89
114
  tools: O
90
115
  }) : null,
91
- /* @__PURE__ */ g("div", {
92
- className: `select-table__scroll${H ? " select-table__scroll--empty" : ""}`,
93
- children: /* @__PURE__ */ _("div", {
116
+ /* @__PURE__ */ _("div", {
117
+ className: `select-table__scroll${W ? " select-table__scroll--empty" : ""}`,
118
+ children: /* @__PURE__ */ v("div", {
94
119
  className: "select-table__scrollinner",
95
- children: [!H && /* @__PURE__ */ g("div", {
120
+ ...W ? {} : {
121
+ role: "table",
122
+ "aria-label": ne
123
+ },
124
+ children: [!W && /* @__PURE__ */ _("div", {
96
125
  className: "select-table__head",
97
126
  role: "row",
98
- children: t.map((n, r) => /* @__PURE__ */ _("div", {
127
+ children: t.map((n, r) => /* @__PURE__ */ v("div", {
99
128
  role: "columnheader",
100
129
  "aria-sort": n.sortable ? n.sortDir === "asc" ? "ascending" : n.sortDir === "desc" ? "descending" : "none" : void 0,
101
130
  className: `select-table__th select-table__cell--${n.align ?? "start"}${n.tone ? ` select-table__th--${n.tone}` : ""}`,
102
- children: [n.sortable ? /* @__PURE__ */ _("button", {
131
+ children: [n.sortable ? /* @__PURE__ */ v("button", {
103
132
  type: "button",
104
133
  className: `select-table__sortbtn${n.sortDir === "asc" ? " select-table__sortbtn--asc" : ""}${n.sortDir == null ? "" : " select-table__sortbtn--active"}`,
105
134
  onClick: n.onSort,
106
- children: [n.label, /* @__PURE__ */ g(e, {})]
107
- }) : n.label, k && n.resizable !== !1 && r < t.length - 1 && /* @__PURE__ */ g("span", {
135
+ children: [n.label, /* @__PURE__ */ _(e, {})]
136
+ }) : n.label, k && n.resizable !== !1 && r < t.length - 1 && /* @__PURE__ */ _("span", {
108
137
  role: "separator",
109
138
  "aria-orientation": "vertical",
110
139
  "aria-label": "Ajustar a largura da coluna",
111
140
  tabIndex: 0,
112
141
  className: "select-table__resizer",
113
- onPointerDown: Q(r),
114
- onKeyDown: $(r),
142
+ onPointerDown: ae(r),
143
+ onKeyDown: oe(r),
115
144
  onDoubleClick: A ? () => A(r) : void 0
116
145
  })]
117
146
  }, r))
118
- }), /* @__PURE__ */ g("div", {
147
+ }), /* @__PURE__ */ _("div", {
119
148
  className: "select-table__body",
120
- children: /* @__PURE__ */ g("div", {
149
+ children: /* @__PURE__ */ _("div", {
121
150
  className: "select-table__rows",
122
- ref: q,
123
- children: /* @__PURE__ */ g(r, { children: V && l ? /* @__PURE__ */ g("div", {
124
- className: "select-table__empty",
125
- children: l
126
- }) : a })
151
+ ref: re,
152
+ children: /* @__PURE__ */ _(C.Provider, {
153
+ value: t.length,
154
+ children: /* @__PURE__ */ _(r, { children: U && l ? /* @__PURE__ */ _("div", {
155
+ className: "select-table__empty",
156
+ children: l
157
+ }) : a })
158
+ })
127
159
  })
128
160
  })]
129
161
  })
130
162
  }),
131
- h && /* @__PURE__ */ g("div", {
163
+ u && /* @__PURE__ */ _("div", {
132
164
  className: "select-table__footer",
133
- children: h
165
+ children: u
134
166
  })
135
167
  ]
136
168
  })]
137
169
  });
138
170
  });
139
- function C({ enabled: e, open: t, id: n, children: r }) {
140
- return e ? /* @__PURE__ */ g("div", {
171
+ function T({ enabled: e, open: t, id: n, children: r }) {
172
+ return e ? /* @__PURE__ */ _("div", {
141
173
  className: "select-table__collapse",
142
174
  id: n,
143
175
  "data-open": t,
144
176
  "aria-hidden": !t,
145
- children: /* @__PURE__ */ g("div", {
177
+ children: /* @__PURE__ */ _("div", {
146
178
  className: "select-table__collapsewrap",
147
179
  children: r
148
180
  })
149
- }) : /* @__PURE__ */ g(h, { children: r });
181
+ }) : /* @__PURE__ */ _(g, { children: r });
150
182
  }
151
- var w = l(function({ name: e, secondary: t, src: n, badge: r, className: i, ...o }, s) {
152
- return /* @__PURE__ */ _("span", {
183
+ var E = u(function({ name: e, secondary: t, src: n, badge: r, className: i, ...o }, s) {
184
+ return /* @__PURE__ */ v("span", {
153
185
  ref: s,
154
186
  ...o,
155
187
  className: `select-usercell${i ? " " + i : ""}`,
156
- children: [/* @__PURE__ */ g(a, {
188
+ children: [/* @__PURE__ */ _(a, {
157
189
  name: typeof e == "string" ? e : void 0,
158
190
  src: n
159
- }), /* @__PURE__ */ _("span", {
191
+ }), /* @__PURE__ */ v("span", {
160
192
  className: "select-usercell__text",
161
- children: [r ? /* @__PURE__ */ _("span", {
193
+ children: [r ? /* @__PURE__ */ v("span", {
162
194
  className: "select-usercell__line",
163
- children: [/* @__PURE__ */ g("span", {
195
+ children: [/* @__PURE__ */ _("span", {
164
196
  className: "select-usercell__name",
165
197
  children: e
166
198
  }), r]
167
- }) : /* @__PURE__ */ g("span", {
199
+ }) : /* @__PURE__ */ _("span", {
168
200
  className: "select-usercell__name",
169
201
  children: e
170
- }), t && /* @__PURE__ */ g("span", {
202
+ }), t && /* @__PURE__ */ _("span", {
171
203
  className: "select-usercell__secondary",
172
204
  children: t
173
205
  })]
174
206
  })]
175
207
  });
176
208
  });
177
- function T({ children: e, onClick: t, expanded: n, nested: r = !1 }) {
178
- let i = `select-table__row${t ? " select-table__row--clickable" : ""}${r ? " select-table__row--nested" : ""}${n ? " is-expanded" : ""}`;
179
- return t ? /* @__PURE__ */ g("div", {
180
- className: i,
209
+ function D({ children: e, onClick: t, expanded: n, nested: r = !1, current: i = !1, section: a = !1, className: o, ...s }) {
210
+ let c = `select-table__row${t ? " select-table__row--clickable" : ""}${r ? " select-table__row--nested" : ""}${a ? " select-table__row--section" : ""}${n ? " is-expanded" : ""}${i ? " is-current" : ""}${o ? " " + o : ""}`;
211
+ return t ? /* @__PURE__ */ _("div", {
212
+ ...s,
213
+ className: c,
181
214
  role: "row",
182
215
  tabIndex: 0,
183
216
  "aria-expanded": n,
217
+ "aria-current": i || void 0,
184
218
  onClick: (e) => {
185
- D(e.target, e.currentTarget) || t();
219
+ k(e.target, e.currentTarget) || t();
186
220
  },
187
221
  onKeyDown: (e) => {
188
222
  e.target !== e.currentTarget || e.key !== "Enter" && e.key !== " " || (e.preventDefault(), t());
189
223
  },
190
224
  children: e
191
- }) : /* @__PURE__ */ g("div", {
192
- className: i,
225
+ }) : /* @__PURE__ */ _("div", {
226
+ ...s,
227
+ className: c,
193
228
  role: "row",
229
+ "aria-current": i || void 0,
194
230
  children: e
195
231
  });
196
232
  }
197
- var E = "button, a[href], input, select, textarea, label, summary, [role=\"button\"], [role=\"menuitem\"], [role=\"checkbox\"], [role=\"switch\"], [data-row-click=\"ignore\"]";
198
- function D(e, t) {
233
+ var O = "button, a[href], input, select, textarea, label, summary, [role=\"button\"], [role=\"menuitem\"], [role=\"checkbox\"], [role=\"switch\"], [data-row-click=\"ignore\"]";
234
+ function k(e, t) {
199
235
  if (!(e instanceof Element) || !t.contains(e)) return !0;
200
- let n = e.closest(E);
236
+ let n = e.closest(O);
201
237
  return n !== null && n !== t && t.contains(n);
202
238
  }
203
- var O = l(function({ children: e, align: n = "start", disclosure: r, className: i, ...a }, o) {
204
- return /* @__PURE__ */ _("div", {
205
- ref: o,
206
- ...a,
207
- role: "cell",
208
- className: `select-table__td select-table__cell--${n}${i ? " " + i : ""}`,
209
- children: [r ? /* @__PURE__ */ g("span", {
239
+ var A = u(function({ children: e, align: n = "start", disclosure: r, header: i = !1, span: a, wrap: o = !1, className: s, style: c, ...l }, u) {
240
+ let d = f(C), p = a === "all" ? d || void 0 : a;
241
+ return /* @__PURE__ */ v("div", {
242
+ ref: u,
243
+ ...l,
244
+ role: i ? "rowheader" : "cell",
245
+ "aria-colspan": p && p > 1 ? p : void 0,
246
+ style: a ? {
247
+ gridColumn: a === "all" ? "1 / -1" : `span ${a}`,
248
+ ...c
249
+ } : c,
250
+ className: `select-table__td select-table__cell--${n}${o ? " select-table__td--wrap" : ""}${s ? " " + s : ""}`,
251
+ children: [r ? /* @__PURE__ */ _("span", {
210
252
  className: `select-table__disclosure${r === "open" ? " is-open" : ""}`,
211
253
  "aria-hidden": "true",
212
- children: r !== "none" && /* @__PURE__ */ g(t, {})
254
+ children: r !== "none" && /* @__PURE__ */ _(t, {})
213
255
  }) : null, e]
214
256
  });
215
- }), k = l(function({ icon: e, title: t, subtitle: n, action: r, tone: i, minHeight: a, className: o, style: s, ...c }, l) {
216
- return /* @__PURE__ */ _("div", {
257
+ }), j = u(function({ icon: e, title: t, subtitle: n, action: r, tone: i, minHeight: a, className: o, style: s, ...c }, l) {
258
+ return /* @__PURE__ */ v("div", {
217
259
  ref: l,
218
260
  ...c,
219
261
  style: a ? {
@@ -222,19 +264,19 @@ var O = l(function({ children: e, align: n = "start", disclosure: r, className:
222
264
  } : s,
223
265
  className: `select-table-empty${i === "critical" ? " select-table-empty--critical" : ""}${a ? " select-table-empty--fill" : ""}${o ? " " + o : ""}`,
224
266
  children: [
225
- e && /* @__PURE__ */ g("span", {
267
+ e && /* @__PURE__ */ _("span", {
226
268
  className: "select-table-empty__icon",
227
269
  children: e
228
270
  }),
229
- /* @__PURE__ */ g("p", {
271
+ /* @__PURE__ */ _("p", {
230
272
  className: "select-table-empty__title",
231
273
  children: t
232
274
  }),
233
- n && /* @__PURE__ */ g("p", {
275
+ n && /* @__PURE__ */ _("p", {
234
276
  className: "select-table-empty__subtitle",
235
277
  children: n
236
278
  }),
237
- r && /* @__PURE__ */ g("div", {
279
+ r && /* @__PURE__ */ _("div", {
238
280
  className: "select-table-empty__action",
239
281
  children: r
240
282
  })
@@ -242,6 +284,6 @@ var O = l(function({ children: e, align: n = "start", disclosure: r, className:
242
284
  });
243
285
  });
244
286
  //#endregion
245
- export { S as SelectTable, O as SelectTableCell, k as SelectTableEmpty, T as SelectTableRow, w as SelectUserCell };
287
+ export { w as SelectTable, A as SelectTableCell, j as SelectTableEmpty, D as SelectTableRow, E as SelectUserCell };
246
288
 
247
289
  //# sourceMappingURL=SelectTable.js.map
@@ -1,7 +1,16 @@
1
1
  import { ReactNode } from 'react';
2
+ /**
3
+ * Onde a moldura está: fora de outra (`false`), no corpo branco de outra (`'body'`), ou no corpo de uma seção que é a
4
+ * moldura de uma lista (`'list'`, 0.1.213: `SelectSection list`) — ali o corpo não tem a caixa branca, e a tabela
5
+ * desenha o cabeçalho na moldura e as linhas na caixa branca dela, como a tabela sozinha.
6
+ */
7
+ export type FrameKind = false | 'body' | 'list';
2
8
  /** Esta moldura está dentro do corpo de outra? Então desenha sem a casca. */
3
9
  export declare function useInsideFrame(): boolean;
4
- /** O corpo branco de uma moldura: o que está dentro dele sabe que está dentro. */
5
- export declare function FrameBody({ children }: {
10
+ /** Que corpo é esse (0.1.213): o branco de uma moldura, ou o de uma seção que é a moldura de uma lista. */
11
+ export declare function useFrameKind(): FrameKind;
12
+ /** O corpo de uma moldura: o que está dentro dele sabe que está dentro (e, desde a 0.1.213, de que corpo). */
13
+ export declare function FrameBody({ children, kind }: {
6
14
  children: ReactNode;
15
+ kind?: 'body' | 'list';
7
16
  }): import("react").JSX.Element;
@@ -3,15 +3,18 @@ import { jsx as n } from "react/jsx-runtime";
3
3
  //#region src/internal/frame.tsx
4
4
  var r = e(!1);
5
5
  function i() {
6
+ return t(r) !== !1;
7
+ }
8
+ function a() {
6
9
  return t(r);
7
10
  }
8
- function a({ children: e }) {
11
+ function o({ children: e, kind: t = "body" }) {
9
12
  return /* @__PURE__ */ n(r.Provider, {
10
- value: !0,
13
+ value: t,
11
14
  children: e
12
15
  });
13
16
  }
14
17
  //#endregion
15
- export { a as FrameBody, i as useInsideFrame };
18
+ export { o as FrameBody, a as useFrameKind, i as useInsideFrame };
16
19
 
17
20
  //# sourceMappingURL=frame.js.map