@selectwin/kit 0.1.261 → 0.1.263
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.
- package/README.md +72 -0
- package/dist/SelectActionMenu.d.ts +7 -1
- package/dist/SelectActionMenu.js +14 -13
- package/dist/SelectBlockBuilder.d.ts +63 -0
- package/dist/SelectBlockBuilder.js +370 -0
- package/dist/SelectCalendar.d.ts +68 -4
- package/dist/SelectCalendar.js +449 -279
- package/dist/SelectChannelPreview.d.ts +34 -5
- package/dist/SelectChannelPreview.js +167 -73
- package/dist/SelectChartCard.d.ts +13 -0
- package/dist/SelectChartCard.js +50 -30
- package/dist/SelectCombobox.d.ts +5 -0
- package/dist/SelectCombobox.js +77 -61
- package/dist/SelectConversationContext.d.ts +30 -0
- package/dist/SelectConversationContext.js +141 -0
- package/dist/SelectDatePicker.d.ts +4 -0
- package/dist/SelectDatePicker.js +78 -62
- package/dist/SelectDateRangeField.d.ts +6 -1
- package/dist/SelectDateRangeField.js +9 -8
- package/dist/SelectField.d.ts +7 -3
- package/dist/SelectField.js +71 -70
- package/dist/SelectFilterBar.d.ts +9 -0
- package/dist/SelectFilterBar.js +301 -179
- package/dist/SelectFunnel.d.ts +12 -2
- package/dist/SelectFunnel.js +193 -63
- package/dist/SelectHorizontalBar.d.ts +11 -1
- package/dist/SelectHorizontalBar.js +86 -35
- package/dist/SelectHtmlFrame.d.ts +3 -1
- package/dist/SelectHtmlFrame.js +4 -4
- package/dist/SelectLocale.d.ts +146 -0
- package/dist/SelectLocale.js +363 -31
- package/dist/SelectMail.d.ts +80 -4
- package/dist/SelectMail.js +433 -300
- package/dist/SelectMailEditor.d.ts +35 -1
- package/dist/SelectMailEditor.js +347 -163
- package/dist/SelectNumberedList.d.ts +20 -2
- package/dist/SelectNumberedList.js +75 -17
- package/dist/SelectPopover.js +1 -0
- package/dist/SelectProgressBar.d.ts +22 -5
- package/dist/SelectProgressBar.js +70 -40
- package/dist/SelectRecordCard.d.ts +13 -4
- package/dist/SelectRecordCard.js +30 -8
- package/dist/SelectRuleBuilder.d.ts +52 -0
- package/dist/SelectRuleBuilder.js +157 -0
- package/dist/SelectSearchPreview.d.ts +35 -0
- package/dist/SelectSearchPreview.js +69 -0
- package/dist/SelectSegmented.d.ts +2 -0
- package/dist/SelectSegmented.js +1 -1
- package/dist/SelectSortable.d.ts +5 -1
- package/dist/SelectSparkBars.d.ts +5 -1
- package/dist/SelectSparkBars.js +65 -57
- package/dist/SelectSteps.d.ts +6 -0
- package/dist/SelectSteps.js +43 -10
- package/dist/SelectTabs.d.ts +16 -4
- package/dist/SelectTabs.js +95 -60
- package/dist/SelectTextarea.d.ts +1 -1
- package/dist/SelectVoiceNote.d.ts +6 -1
- package/dist/SelectVoiceNote.js +118 -106
- package/dist/chartUtils.d.ts +10 -0
- package/dist/index.d.ts +18 -2
- package/dist/index.js +153 -149
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
/** O título que o buscador mostra inteiro (o resto vira reticências). */
|
|
3
|
+
export declare const SELECT_SEARCH_TITLE_MAX = 60;
|
|
4
|
+
/** A descrição que o buscador mostra inteira. */
|
|
5
|
+
export declare const SELECT_SEARCH_DESCRIPTION_MAX = 160;
|
|
6
|
+
/**
|
|
7
|
+
* O texto cortado em `max` letras, como o buscador: sem cortar a palavra no meio (volta até o espaço, se ele estiver
|
|
8
|
+
* perto do fim) e com as reticências. O que cabe fica como está; os espaços repetidos viram um. PURA.
|
|
9
|
+
*/
|
|
10
|
+
export declare function selectSearchSnippet(text: string, max: number): string;
|
|
11
|
+
/**
|
|
12
|
+
* O endereço em migalhas, como o buscador: o domínio (sem o `www.`) e os pedaços do caminho, com " › " entre eles; sem o
|
|
13
|
+
* esquema, a busca e a âncora. Um endereço que não se lê volta como veio. PURA.
|
|
14
|
+
*/
|
|
15
|
+
export declare function selectSearchBreadcrumb(url: string): string;
|
|
16
|
+
type SelectSearchPreviewOwnProps = {
|
|
17
|
+
/** O título da página (o `<title>`); passa de `titleMax` (60), corta. */
|
|
18
|
+
title: string;
|
|
19
|
+
/** O endereço da página ("https://lp.loja-exemplo.com.br/guia-de-taxas", com ou sem o esquema). */
|
|
20
|
+
url: string;
|
|
21
|
+
/** A descrição (a `meta description`); passa de `descriptionMax` (160), corta. */
|
|
22
|
+
description?: string;
|
|
23
|
+
/** `desktop` (o padrão) ou `mobile`: o resultado no celular. */
|
|
24
|
+
device?: 'desktop' | 'mobile';
|
|
25
|
+
/** O nome do site, em cima do endereço no celular (padrão: o domínio). */
|
|
26
|
+
siteName?: string;
|
|
27
|
+
/** Os tetos do corte (padrão: 60 e 160, os do pedido). */
|
|
28
|
+
titleMax?: number;
|
|
29
|
+
descriptionMax?: number;
|
|
30
|
+
/** O nome da prévia para o leitor de tela (padrão: "Prévia do resultado da busca"). */
|
|
31
|
+
label?: string;
|
|
32
|
+
};
|
|
33
|
+
export type SelectSearchPreviewProps = SelectSearchPreviewOwnProps & Omit<ComponentPropsWithoutRef<'div'>, keyof SelectSearchPreviewOwnProps | 'children'>;
|
|
34
|
+
export declare function SelectSearchPreview({ title, url, description, device, siteName, titleMax, descriptionMax, label, className, ...rest }: SelectSearchPreviewProps): import("react").JSX.Element;
|
|
35
|
+
export {};
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/* empty css */
|
|
2
|
+
import { useSelectMessages as e } from "./SelectLocale.js";
|
|
3
|
+
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
4
|
+
//#region src/SelectSearchPreview.tsx
|
|
5
|
+
var r = 60, i = 160;
|
|
6
|
+
function a(e, t) {
|
|
7
|
+
let n = e.replace(/\s+/g, " ").trim();
|
|
8
|
+
if (n.length <= t) return n;
|
|
9
|
+
let r = n.slice(0, Math.max(1, t - 1)), i = r.lastIndexOf(" "), a = i > t * .66 ? i : r.length;
|
|
10
|
+
return `${r.slice(0, a).replace(/[\s.,;:!?·|–—-]+$/, "")}…`;
|
|
11
|
+
}
|
|
12
|
+
function o(e) {
|
|
13
|
+
let t = e.trim();
|
|
14
|
+
try {
|
|
15
|
+
let e = new URL(/^[a-z][a-z\d+.-]*:\/\//i.test(t) ? t : `https://${t}`);
|
|
16
|
+
return [e.hostname.replace(/^www\./i, ""), ...e.pathname.split("/").filter(Boolean).map((e) => {
|
|
17
|
+
try {
|
|
18
|
+
return decodeURIComponent(e);
|
|
19
|
+
} catch {
|
|
20
|
+
return e;
|
|
21
|
+
}
|
|
22
|
+
})].join(" › ");
|
|
23
|
+
} catch {
|
|
24
|
+
return t;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
function s({ title: r, url: i, description: s, device: c = "desktop", siteName: l, titleMax: u = 60, descriptionMax: d = 160, label: f, className: p, ...m }) {
|
|
28
|
+
let h = e().searchPreview, g = o(i), _ = l ?? g.split(" › ")[0] ?? "", v = c === "mobile";
|
|
29
|
+
return /* @__PURE__ */ n("div", {
|
|
30
|
+
...m,
|
|
31
|
+
role: "group",
|
|
32
|
+
"aria-label": f ?? h.label,
|
|
33
|
+
className: `select-searchpreview${v ? " select-searchpreview--mobile" : ""}${p ? " " + p : ""}`,
|
|
34
|
+
children: [
|
|
35
|
+
v ? /* @__PURE__ */ n("span", {
|
|
36
|
+
className: "select-searchpreview__site",
|
|
37
|
+
children: [/* @__PURE__ */ t("span", {
|
|
38
|
+
className: "select-searchpreview__favicon",
|
|
39
|
+
"aria-hidden": "true",
|
|
40
|
+
children: _.slice(0, 1).toUpperCase()
|
|
41
|
+
}), /* @__PURE__ */ n("span", {
|
|
42
|
+
className: "select-searchpreview__sitetext",
|
|
43
|
+
children: [/* @__PURE__ */ t("span", {
|
|
44
|
+
className: "select-searchpreview__sitename",
|
|
45
|
+
children: _
|
|
46
|
+
}), /* @__PURE__ */ t("span", {
|
|
47
|
+
className: "select-searchpreview__url",
|
|
48
|
+
children: g
|
|
49
|
+
})]
|
|
50
|
+
})]
|
|
51
|
+
}) : /* @__PURE__ */ t("span", {
|
|
52
|
+
className: "select-searchpreview__url",
|
|
53
|
+
children: g
|
|
54
|
+
}),
|
|
55
|
+
/* @__PURE__ */ t("span", {
|
|
56
|
+
className: "select-searchpreview__title",
|
|
57
|
+
children: a(r, u)
|
|
58
|
+
}),
|
|
59
|
+
s ? /* @__PURE__ */ t("span", {
|
|
60
|
+
className: "select-searchpreview__desc",
|
|
61
|
+
children: a(s, d)
|
|
62
|
+
}) : null
|
|
63
|
+
]
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
//#endregion
|
|
67
|
+
export { i as SELECT_SEARCH_DESCRIPTION_MAX, r as SELECT_SEARCH_TITLE_MAX, s as SelectSearchPreview, o as selectSearchBreadcrumb, a as selectSearchSnippet };
|
|
68
|
+
|
|
69
|
+
//# sourceMappingURL=SelectSearchPreview.js.map
|
|
@@ -39,6 +39,8 @@ type SelectSegmentedOwnProps = {
|
|
|
39
39
|
/**
|
|
40
40
|
* 0.1.260, com `chips`: as fichas numa linha só, que rola de lado (a prancha da lista do Chat no celular), no lugar de
|
|
41
41
|
* quebrar a linha. A ficha marcada vem para a vista, e a ponta que esconde fichas some num degradê.
|
|
42
|
+
* 0.1.263: também na trilha (`track`, a linha do período dos Relatórios em 390 px): a trilha já rolava de lado, e agora
|
|
43
|
+
* a marcada vem para a vista e a ponta que esconde opções some no mesmo degradê.
|
|
42
44
|
*/
|
|
43
45
|
scroll?: boolean;
|
|
44
46
|
/**
|
package/dist/SelectSegmented.js
CHANGED
|
@@ -22,7 +22,7 @@ var u = n(function({ value: n, onChange: u, options: d, ariaLabel: f, fullWidth:
|
|
|
22
22
|
d.length,
|
|
23
23
|
M
|
|
24
24
|
]);
|
|
25
|
-
let N = x
|
|
25
|
+
let N = x, P = o(null), F = o(!1);
|
|
26
26
|
a(() => {
|
|
27
27
|
let t = P.current;
|
|
28
28
|
N && t && (e(t, O.current[D] ?? null, F.current), F.current = !0);
|
package/dist/SelectSortable.d.ts
CHANGED
|
@@ -56,7 +56,11 @@ export interface SelectSortableHandleProps {
|
|
|
56
56
|
}
|
|
57
57
|
/** O que o `item(id)` devolve: as props do `SelectSortableItem`. */
|
|
58
58
|
export interface SelectSortableItemBinding {
|
|
59
|
-
|
|
59
|
+
/**
|
|
60
|
+
* 0.1.263: qualquer elemento (era só o `<div>`): o mesmo `item(id)` vale no `SelectNumberedItem`, que é um `<li>`. Quem
|
|
61
|
+
* usava com o `SelectSortableItem` segue igual.
|
|
62
|
+
*/
|
|
63
|
+
ref: (el: HTMLElement | null) => void;
|
|
60
64
|
dragging: boolean;
|
|
61
65
|
}
|
|
62
66
|
export interface SelectSortable {
|
|
@@ -13,7 +13,11 @@ type SelectSparkBarsOwnProps = {
|
|
|
13
13
|
tooltip?: (index: number) => SelectColumnTooltip | null;
|
|
14
14
|
/** A barra que o foco do teclado acende primeiro (padrão: a última). */
|
|
15
15
|
start?: number;
|
|
16
|
+
/** 0.1.263: o topo da escala, o mesmo em todas as linhas de uma tabela (padrão: o maior número da série). */
|
|
17
|
+
max?: number;
|
|
18
|
+
/** 0.1.263: sem o brilho e sem o ponto do destaque — a barrinha da linha de tabela, na altura toda, sobre a linha de base. */
|
|
19
|
+
plain?: boolean;
|
|
16
20
|
};
|
|
17
21
|
export type SelectSparkBarsProps = SelectSparkBarsOwnProps & Omit<ComponentPropsWithoutRef<'div'>, keyof SelectSparkBarsOwnProps>;
|
|
18
|
-
export declare function SelectSparkBars({ data, height, color, labels, label, tooltip, start, className, ...rest }: SelectSparkBarsProps): import("react").JSX.Element;
|
|
22
|
+
export declare function SelectSparkBars({ data, height, color, labels, label, tooltip, start, max: fixedMax, plain, className, ...rest }: SelectSparkBarsProps): import("react").JSX.Element;
|
|
19
23
|
export {};
|
package/dist/SelectSparkBars.js
CHANGED
|
@@ -3,96 +3,104 @@ import { chartColor as e, useChartSize as t } from "./chartUtils.js";
|
|
|
3
3
|
import { FloatingChartTooltip as n } from "./chartTip.js";
|
|
4
4
|
import { tipSpeech as r, useChartPointer as i } from "./internal/chartPointer.js";
|
|
5
5
|
import { useId as a, useReducer as o } from "react";
|
|
6
|
-
import {
|
|
6
|
+
import { Fragment as s, jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
7
7
|
//#region src/SelectSparkBars.tsx
|
|
8
|
-
function
|
|
9
|
-
var
|
|
10
|
-
let { ref:
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
8
|
+
function u({ data: u, height: d = 96, color: f, labels: p, label: m, tooltip: h, start: g, max: _, plain: v = !1, className: y, ...b }) {
|
|
9
|
+
var x;
|
|
10
|
+
let { ref: S, width: C } = t(d), w = a(), [, T] = o((e) => e + 1, 0), E = f ?? e(0), D = u.length, O = _ != null && _ > 0 ? _ : Math.max(...u, 1), k = D > 0 && C > 0 ? Math.min(12, Math.max(1.5, (C - (D > 60 ? 1.5 : 3) * (D - 1)) / D)) : 0, A = D > 1 ? (C - k * D) / (D - 1) : 0, j = (e) => e * (k + A), M = (e) => {
|
|
11
|
+
let t = Math.min(Math.max(e, 0), O) / O;
|
|
12
|
+
return v ? e > 0 ? d - Math.max(2, t * (d - 1)) : d : d - t * (d - 8);
|
|
13
|
+
}, { active: N, props: P } = i({
|
|
14
|
+
count: D,
|
|
15
|
+
indexAt: (e) => Math.floor((e + A / 2) / (k + A || 1)),
|
|
16
|
+
start: g,
|
|
17
|
+
focusable: m != null
|
|
18
|
+
}), F = N != null && h ? h(N) : null, I = F && N != null ? (x = S.current) == null ? void 0 : x.getBoundingClientRect() : void 0, L = N == null ? 0 : M(u[N] ?? 0), R = I != null && I.top + L < 96, z = D - 1;
|
|
19
|
+
return /* @__PURE__ */ l("div", {
|
|
20
|
+
...b,
|
|
21
|
+
ref: S,
|
|
22
|
+
className: `select-sparkbars${v ? " select-sparkbars--plain" : ""}${y ? " " + y : ""}`,
|
|
20
23
|
children: [
|
|
21
|
-
|
|
22
|
-
width:
|
|
23
|
-
height:
|
|
24
|
+
C > 0 && D > 0 && /* @__PURE__ */ l("svg", {
|
|
25
|
+
width: C,
|
|
26
|
+
height: d,
|
|
24
27
|
className: "select-chart",
|
|
25
|
-
...
|
|
28
|
+
...m == null ? { "aria-hidden": !0 } : {
|
|
26
29
|
role: "img",
|
|
27
|
-
"aria-label":
|
|
30
|
+
"aria-label": m
|
|
28
31
|
},
|
|
29
|
-
...
|
|
32
|
+
...P,
|
|
30
33
|
children: [
|
|
31
|
-
|
|
32
|
-
|
|
34
|
+
v ? /* @__PURE__ */ c("line", {
|
|
35
|
+
className: "select-sparkbars__base",
|
|
36
|
+
x1: 0,
|
|
37
|
+
x2: C,
|
|
38
|
+
y1: d - .5,
|
|
39
|
+
y2: d - .5
|
|
40
|
+
}) : /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ c("defs", { children: /* @__PURE__ */ l("linearGradient", {
|
|
41
|
+
id: `${w}-glow`,
|
|
33
42
|
x1: "0",
|
|
34
43
|
y1: "0",
|
|
35
44
|
x2: "0",
|
|
36
45
|
y2: "1",
|
|
37
|
-
children: [/* @__PURE__ */
|
|
46
|
+
children: [/* @__PURE__ */ c("stop", {
|
|
38
47
|
offset: "0%",
|
|
39
|
-
stopColor:
|
|
48
|
+
stopColor: E,
|
|
40
49
|
stopOpacity: .16
|
|
41
|
-
}), /* @__PURE__ */
|
|
50
|
+
}), /* @__PURE__ */ c("stop", {
|
|
42
51
|
offset: "100%",
|
|
43
|
-
stopColor:
|
|
52
|
+
stopColor: E,
|
|
44
53
|
stopOpacity: 0
|
|
45
54
|
})]
|
|
46
|
-
}) }),
|
|
47
|
-
/* @__PURE__ */ s("rect", {
|
|
55
|
+
}) }), /* @__PURE__ */ c("rect", {
|
|
48
56
|
x: 0,
|
|
49
|
-
y:
|
|
50
|
-
width:
|
|
51
|
-
height:
|
|
57
|
+
y: M(O) - 4,
|
|
58
|
+
width: j(z) + k,
|
|
59
|
+
height: d - M(O) + 4,
|
|
52
60
|
rx: 6,
|
|
53
|
-
fill: `url(#${
|
|
54
|
-
}),
|
|
55
|
-
|
|
56
|
-
className: `select-sparkbars__bar${
|
|
57
|
-
x:
|
|
58
|
-
y:
|
|
59
|
-
width:
|
|
60
|
-
height:
|
|
61
|
-
rx:
|
|
62
|
-
fill:
|
|
61
|
+
fill: `url(#${w}-glow)`
|
|
62
|
+
})] }),
|
|
63
|
+
u.map((e, t) => /* @__PURE__ */ c("rect", {
|
|
64
|
+
className: `select-sparkbars__bar${N != null && N !== t ? " is-dim" : ""}`,
|
|
65
|
+
x: j(t),
|
|
66
|
+
y: M(e),
|
|
67
|
+
width: k,
|
|
68
|
+
height: d - M(e),
|
|
69
|
+
rx: k > 3 ? 1.5 : 0,
|
|
70
|
+
fill: E
|
|
63
71
|
}, t)),
|
|
64
|
-
/* @__PURE__ */
|
|
72
|
+
v ? null : /* @__PURE__ */ c("circle", {
|
|
65
73
|
className: "select-sparkbars__end",
|
|
66
|
-
cx:
|
|
67
|
-
cy:
|
|
74
|
+
cx: j(z) + k / 2,
|
|
75
|
+
cy: M(u[z] ?? 0) - 5,
|
|
68
76
|
r: 4,
|
|
69
|
-
fill:
|
|
77
|
+
fill: E
|
|
70
78
|
})
|
|
71
79
|
]
|
|
72
80
|
}),
|
|
73
|
-
|
|
81
|
+
p != null && p.length > 0 && /* @__PURE__ */ c("div", {
|
|
74
82
|
className: "select-sparkbars__labels",
|
|
75
|
-
children:
|
|
83
|
+
children: p.map((e, t) => /* @__PURE__ */ c("span", { children: e }, t))
|
|
76
84
|
}),
|
|
77
|
-
|
|
85
|
+
m != null && /* @__PURE__ */ c("span", {
|
|
78
86
|
className: "select-visually-hidden",
|
|
79
87
|
"aria-live": "polite",
|
|
80
|
-
children:
|
|
88
|
+
children: F ? r(F.title, F.rows) : ""
|
|
81
89
|
}),
|
|
82
|
-
/* @__PURE__ */
|
|
83
|
-
tip:
|
|
84
|
-
x:
|
|
85
|
-
y:
|
|
86
|
-
place:
|
|
87
|
-
title:
|
|
88
|
-
rows:
|
|
90
|
+
/* @__PURE__ */ c(n, {
|
|
91
|
+
tip: F && I && N != null ? {
|
|
92
|
+
x: I.left + j(N) + k / 2,
|
|
93
|
+
y: R ? I.top + d + 2 : I.top + L - 6,
|
|
94
|
+
place: R ? "bottom" : "top",
|
|
95
|
+
title: F.title,
|
|
96
|
+
rows: F.rows
|
|
89
97
|
} : null,
|
|
90
|
-
onDismiss:
|
|
98
|
+
onDismiss: T
|
|
91
99
|
})
|
|
92
100
|
]
|
|
93
101
|
});
|
|
94
102
|
}
|
|
95
103
|
//#endregion
|
|
96
|
-
export {
|
|
104
|
+
export { u as SelectSparkBars };
|
|
97
105
|
|
|
98
106
|
//# sourceMappingURL=SelectSparkBars.js.map
|
package/dist/SelectSteps.d.ts
CHANGED
|
@@ -28,6 +28,12 @@ type SelectStepsOwnProps = {
|
|
|
28
28
|
* diz a etapa atual no cabeçalho ("Etapa 4 de 6").
|
|
29
29
|
*/
|
|
30
30
|
connected?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* 0.1.263: `bars` é a faixa da janela da conversa (a prancha O-MobileThread): as colunas iguais, cada uma com a barra de
|
|
33
|
+
* 5 px no tom do estado e o rótulo embaixo ("Até 24 h: à vontade"). Sem número, sem ligação, sem a vertical. Padrão
|
|
34
|
+
* `numbers`, a barra de sempre.
|
|
35
|
+
*/
|
|
36
|
+
variant?: 'numbers' | 'bars';
|
|
31
37
|
};
|
|
32
38
|
export type SelectStepsProps = SelectStepsOwnProps & Omit<ComponentPropsWithoutRef<'ol'>, keyof SelectStepsOwnProps>;
|
|
33
39
|
export declare const SelectSteps: import('react').ForwardRefExoticComponent<SelectStepsOwnProps & Omit<Omit<import('react').DetailedHTMLProps<import('react').OlHTMLAttributes<HTMLOListElement>, HTMLOListElement>, "ref">, keyof SelectStepsOwnProps> & import('react').RefAttributes<HTMLOListElement>>;
|
package/dist/SelectSteps.js
CHANGED
|
@@ -3,14 +3,47 @@ import { useSelectMessages as n } from "./SelectLocale.js";
|
|
|
3
3
|
import { forwardRef as r } from "react";
|
|
4
4
|
import { Fragment as i, jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
5
5
|
//#region src/SelectSteps.tsx
|
|
6
|
-
var s = r(function({ steps: r, current: s, onSelect: c, orientation: l = "horizontal", connected: u = !1,
|
|
7
|
-
let
|
|
6
|
+
var s = r(function({ steps: r, current: s, onSelect: c, orientation: l = "horizontal", connected: u = !1, variant: d = "numbers", className: f, ...p }, m) {
|
|
7
|
+
let h = n(), g = d === "bars", _ = !g && l === "vertical", v = !g && u && !_;
|
|
8
8
|
return /* @__PURE__ */ a("ol", {
|
|
9
|
-
ref:
|
|
10
|
-
...
|
|
11
|
-
className: `select-steps${
|
|
9
|
+
ref: m,
|
|
10
|
+
...p,
|
|
11
|
+
className: `select-steps${g ? " select-steps--bars" : ""}${_ ? " select-steps--vertical" : ""}${v ? " select-steps--connected" : ""}${f ? " " + f : ""}`,
|
|
12
12
|
children: r.map((n, r) => {
|
|
13
|
-
let l = typeof n == "string" ? { label: n } : n, u = l.state ?? (r < s ? "done" : r === s ? "current" : "pending"), d = !!c && r !== s && (u === "done" || u === "error"), f = /* @__PURE__ */ o(i, { children: [
|
|
13
|
+
let l = typeof n == "string" ? { label: n } : n, u = l.state ?? (r < s ? "done" : r === s ? "current" : "pending"), d = !!c && r !== s && (u === "done" || u === "error"), f = g ? /* @__PURE__ */ o(i, { children: [
|
|
14
|
+
/* @__PURE__ */ a("span", {
|
|
15
|
+
className: "select-steps__bar",
|
|
16
|
+
"aria-hidden": "true"
|
|
17
|
+
}),
|
|
18
|
+
/* @__PURE__ */ a("span", {
|
|
19
|
+
className: "select-steps__barlabel",
|
|
20
|
+
children: l.label
|
|
21
|
+
}),
|
|
22
|
+
l.locked && /* @__PURE__ */ o("span", {
|
|
23
|
+
className: "select-steps__sr",
|
|
24
|
+
children: [
|
|
25
|
+
"(",
|
|
26
|
+
l.lockedLabel ?? h.lock.label,
|
|
27
|
+
")"
|
|
28
|
+
]
|
|
29
|
+
}),
|
|
30
|
+
u === "error" && /* @__PURE__ */ o("span", {
|
|
31
|
+
className: "select-steps__sr",
|
|
32
|
+
children: [
|
|
33
|
+
"(",
|
|
34
|
+
h.common.needsAttention,
|
|
35
|
+
")"
|
|
36
|
+
]
|
|
37
|
+
}),
|
|
38
|
+
u === "done" && /* @__PURE__ */ o("span", {
|
|
39
|
+
className: "select-steps__sr",
|
|
40
|
+
children: [
|
|
41
|
+
"(",
|
|
42
|
+
h.common.done,
|
|
43
|
+
")"
|
|
44
|
+
]
|
|
45
|
+
})
|
|
46
|
+
] }) : /* @__PURE__ */ o(i, { children: [/* @__PURE__ */ o("span", {
|
|
14
47
|
className: "select-steps__num",
|
|
15
48
|
"aria-hidden": "true",
|
|
16
49
|
children: [u === "done" ? /* @__PURE__ */ a(e, {}) : u === "error" ? "!" : r + 1, l.locked ? /* @__PURE__ */ a("span", {
|
|
@@ -28,7 +61,7 @@ var s = r(function({ steps: r, current: s, onSelect: c, orientation: l = "horizo
|
|
|
28
61
|
className: "select-steps__sr",
|
|
29
62
|
children: [
|
|
30
63
|
"(",
|
|
31
|
-
l.lockedLabel ??
|
|
64
|
+
l.lockedLabel ?? h.lock.label,
|
|
32
65
|
")"
|
|
33
66
|
]
|
|
34
67
|
}),
|
|
@@ -36,7 +69,7 @@ var s = r(function({ steps: r, current: s, onSelect: c, orientation: l = "horizo
|
|
|
36
69
|
className: "select-steps__sr",
|
|
37
70
|
children: [
|
|
38
71
|
"(",
|
|
39
|
-
|
|
72
|
+
h.common.needsAttention,
|
|
40
73
|
")"
|
|
41
74
|
]
|
|
42
75
|
}),
|
|
@@ -44,11 +77,11 @@ var s = r(function({ steps: r, current: s, onSelect: c, orientation: l = "horizo
|
|
|
44
77
|
className: "select-steps__sr",
|
|
45
78
|
children: [
|
|
46
79
|
"(",
|
|
47
|
-
|
|
80
|
+
h.common.done,
|
|
48
81
|
")"
|
|
49
82
|
]
|
|
50
83
|
}),
|
|
51
|
-
|
|
84
|
+
_ && l.description && /* @__PURE__ */ a("span", {
|
|
52
85
|
className: "select-steps__desc",
|
|
53
86
|
children: l.description
|
|
54
87
|
})
|
package/dist/SelectTabs.d.ts
CHANGED
|
@@ -7,23 +7,35 @@ export interface SelectTab {
|
|
|
7
7
|
dot?: 'success' | 'neutral' | 'warning';
|
|
8
8
|
/** 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. */
|
|
9
9
|
count?: number;
|
|
10
|
+
/** 0.1.263, com `as="nav"`: o endereço da aba no app (o `<Link>` do roteador). */
|
|
11
|
+
to?: string;
|
|
12
|
+
/** 0.1.263, com `as="nav"`: o endereço de fora do app (o `<a>` comum). */
|
|
13
|
+
href?: string;
|
|
10
14
|
}
|
|
11
|
-
type
|
|
15
|
+
type SelectTabsBaseProps = {
|
|
12
16
|
tabs: SelectTab[];
|
|
17
|
+
/** A aba marcada (com `as="nav"`, a página aberta). */
|
|
13
18
|
value: string;
|
|
14
|
-
onChange: (id: string) => void;
|
|
15
19
|
/** Right-aligned slot INSIDE the tab bar (shares the bottom border) — e.g. a board's
|
|
16
20
|
* "Personalizar" trigger. Controls inside render on the small (28px) tier. */
|
|
17
21
|
end?: ReactNode;
|
|
18
22
|
/** O id do conteúdo que as abas trocam (0.1.209): vira o `aria-controls` de cada aba. */
|
|
19
23
|
panelId?: string;
|
|
20
24
|
};
|
|
21
|
-
|
|
25
|
+
type SelectTabsOwnProps = SelectTabsBaseProps & ({
|
|
26
|
+
as?: 'tablist';
|
|
27
|
+
onChange: (id: string) => void;
|
|
28
|
+
} | {
|
|
29
|
+
/** 0.1.263: `nav` — as abas que são endereços (links com `aria-current="page"`, sem o `role="tab"`). */
|
|
30
|
+
as: 'nav';
|
|
31
|
+
onChange?: (id: string) => void;
|
|
32
|
+
});
|
|
33
|
+
export type SelectTabsProps = SelectTabsOwnProps & Omit<ComponentPropsWithoutRef<'div'>, keyof SelectTabsBaseProps | 'as' | 'onChange'>;
|
|
22
34
|
/**
|
|
23
35
|
* 0.1.259: as pontas da barra que escondem abas e até onde rolar para a aba ficar à vista — as contas moram em
|
|
24
36
|
* `internal/scrollReveal` desde a 0.1.260 (as fichas que rolam usam as mesmas); os nomes daqui seguem. PURAS.
|
|
25
37
|
*/
|
|
26
38
|
export declare const selectTabsOverflow: typeof selectScrollOverflow;
|
|
27
39
|
export declare const selectTabScrollTarget: typeof selectScrollTarget;
|
|
28
|
-
export declare function SelectTabs({ tabs, value, onChange, end, panelId, className, onKeyDown, ...rest }: SelectTabsProps): import("react").JSX.Element;
|
|
40
|
+
export declare function SelectTabs({ tabs, value, onChange, end, panelId, as, className, onKeyDown, ...rest }: SelectTabsProps): import("react").JSX.Element;
|
|
29
41
|
export {};
|