@selectwin/kit 0.1.227 → 0.1.228
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/dist/SelectAppFrame.d.ts +95 -0
- package/dist/SelectAppFrame.js +280 -0
- package/dist/SelectLocale.d.ts +10 -0
- package/dist/SelectLocale.js +16 -0
- package/dist/SelectWorkspaceSwitcher.d.ts +5 -0
- package/dist/SelectWorkspaceSwitcher.js +11 -11
- package/dist/index.d.ts +2 -0
- package/dist/index.js +151 -150
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { ComponentPropsWithoutRef, ReactNode } from 'react';
|
|
2
|
+
import { SelectKitMessages } from './SelectLocale';
|
|
3
|
+
export interface SelectAppFrameProps extends ComponentPropsWithoutRef<'div'> {
|
|
4
|
+
/** O "Pular para o conteúdo": o primeiro Tab da página leva direto à coluna dela. */
|
|
5
|
+
skip?: {
|
|
6
|
+
to: string;
|
|
7
|
+
label: string;
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
/** O fundo escuro de toda a tela (o da barra: o painel claro sobe dele) e o atalho para o conteúdo. */
|
|
11
|
+
export declare function SelectAppFrame({ skip, className, children, ...rest }: SelectAppFrameProps): import("react").JSX.Element;
|
|
12
|
+
export interface SelectAppPanelProps extends ComponentPropsWithoutRef<'div'> {
|
|
13
|
+
/** O trilho das seções (`SelectAppRail`): no computador, numa coluna à esquerda; abaixo de 1024 px, some. */
|
|
14
|
+
rail?: ReactNode;
|
|
15
|
+
}
|
|
16
|
+
/** O painel claro de cantos redondos, embaixo da barra: o trilho e a página. */
|
|
17
|
+
export declare function SelectAppPanel({ rail, className, children, ...rest }: SelectAppPanelProps): import("react").JSX.Element;
|
|
18
|
+
export interface SelectAppMainProps extends ComponentPropsWithoutRef<'main'> {
|
|
19
|
+
/**
|
|
20
|
+
* Um menu lateral da área (a Operação, com as páginas em grupos): uma coluna ao lado do conteúdo, embaixo do cabeçalho
|
|
21
|
+
* da página (o `<header>` da página ocupa a linha de cima de ponta a ponta). Abaixo de 1024 px, some.
|
|
22
|
+
*/
|
|
23
|
+
aside?: ReactNode;
|
|
24
|
+
/** O que fica no lugar do `aside` abaixo de 1024 px (um seletor das mesmas páginas), logo depois do cabeçalho. */
|
|
25
|
+
asideCompact?: ReactNode;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* A coluna da página: a largura máxima, o respiro e o espaço embaixo para o botão do canto. Recebe o foco a cada
|
|
29
|
+
* navegação (`tabIndex={-1}` + `focus()` do app): quem usa leitor de tela ouve a página nova. O conteúdo novo entra num
|
|
30
|
+
* fade curto.
|
|
31
|
+
*/
|
|
32
|
+
export declare const SelectAppMain: import('react').ForwardRefExoticComponent<SelectAppMainProps & import('react').RefAttributes<HTMLElement>>;
|
|
33
|
+
export interface SelectAppRailPage {
|
|
34
|
+
id: string;
|
|
35
|
+
label: string;
|
|
36
|
+
to: string;
|
|
37
|
+
/** A página aberta. */
|
|
38
|
+
current?: boolean;
|
|
39
|
+
}
|
|
40
|
+
export interface SelectAppRailItem {
|
|
41
|
+
id: string;
|
|
42
|
+
label: string;
|
|
43
|
+
/** O destino da seção (a primeira página dela). */
|
|
44
|
+
to: string;
|
|
45
|
+
icon?: ReactNode;
|
|
46
|
+
/** A seção aberta (o círculo fica nela). */
|
|
47
|
+
active?: boolean;
|
|
48
|
+
/** As páginas da seção: embaixo dela (expandido) ou num painel ao lado (recolhido). */
|
|
49
|
+
pages?: readonly SelectAppRailPage[];
|
|
50
|
+
}
|
|
51
|
+
export interface SelectAppRailProps {
|
|
52
|
+
/** O nome do menu para o leitor de tela ("Seções"). */
|
|
53
|
+
label: string;
|
|
54
|
+
/** Expandido (o nome e as páginas) ou recolhido (só os ícones). */
|
|
55
|
+
wide: boolean;
|
|
56
|
+
onToggle: () => void;
|
|
57
|
+
/** A pílula de cima: as seções. */
|
|
58
|
+
items: readonly SelectAppRailItem[];
|
|
59
|
+
/** A pílula de baixo (as configurações): o painel dela abre para cima. */
|
|
60
|
+
bottom?: readonly SelectAppRailItem[];
|
|
61
|
+
/** A tecla que alterna, fora de um campo de texto (padrão `[`; `false` desliga). */
|
|
62
|
+
shortcutKey?: string | false;
|
|
63
|
+
/** O ícone do botão do topo (padrão: o do menu). */
|
|
64
|
+
toggleIcon?: ReactNode;
|
|
65
|
+
/** Os textos, por cima dos do kit (`appFrame.rail`). */
|
|
66
|
+
messages?: Partial<SelectKitMessages['appFrame']['rail']>;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* O TRILHO das seções, à esquerda do painel (o `AppRail` do `dashboard-web`): o botão do topo alterna o modo; as seções
|
|
70
|
+
* numa pílula; a de baixo (`bottom`) em outra, embaixo. Expandido, a seção aberta abre as páginas sozinha (e troca quando
|
|
71
|
+
* a rota troca de seção); recolhido, o painel das páginas fecha ao trocar de rota, ao clicar fora e no Esc.
|
|
72
|
+
*/
|
|
73
|
+
export declare function SelectAppRail({ label, wide, onToggle, items, bottom, shortcutKey, toggleIcon, messages }: SelectAppRailProps): import("react").JSX.Element;
|
|
74
|
+
export interface SelectAppDrawerProps {
|
|
75
|
+
id?: string;
|
|
76
|
+
open: boolean;
|
|
77
|
+
onClose: () => void;
|
|
78
|
+
/** O nome do menu para o leitor de tela. */
|
|
79
|
+
label: string;
|
|
80
|
+
/** A marca no topo da gaveta (ela cobre a barra). */
|
|
81
|
+
logo?: ReactNode;
|
|
82
|
+
/** O nome do botão de fechar (padrão: o do kit). */
|
|
83
|
+
closeLabel?: string;
|
|
84
|
+
/** O ícone do fechar (padrão: o do kit), para o app que tem o próprio jogo de ícones. */
|
|
85
|
+
closeIcon?: ReactNode;
|
|
86
|
+
/** A caixa de contexto embaixo da marca (a organização e o trocador de workspace). */
|
|
87
|
+
context?: ReactNode;
|
|
88
|
+
/** As seções (o `SelectSideNav`). */
|
|
89
|
+
children?: ReactNode;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* O MENU do celular: um `<dialog>` modal à esquerda, com a marca e o fechar, a caixa de contexto e as seções. O Esc e o
|
|
93
|
+
* clique fora fecham; o navegador devolve o foco a quem abriu.
|
|
94
|
+
*/
|
|
95
|
+
export declare function SelectAppDrawer({ id, open, onClose, label, logo, closeLabel, closeIcon, context, children }: SelectAppDrawerProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,280 @@
|
|
|
1
|
+
import { ChevronDownIcon as e, CloseIcon as t, MenuIcon as n } from "./icons.js";
|
|
2
|
+
import { useSelectMessages as r } from "./SelectLocale.js";
|
|
3
|
+
import { SelectIconButton as i } from "./SelectIconButton.js";
|
|
4
|
+
import { forwardRef as a, useEffect as o, useLayoutEffect as s, useRef as c, useState as l } from "react";
|
|
5
|
+
import { Fragment as u, jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
6
|
+
import { Link as p } from "react-router-dom";
|
|
7
|
+
//#region src/SelectAppFrame.tsx
|
|
8
|
+
var m = (...e) => e.filter(Boolean).join(" ");
|
|
9
|
+
function h({ skip: e, className: t, children: n, ...r }) {
|
|
10
|
+
return /* @__PURE__ */ f("div", {
|
|
11
|
+
...r,
|
|
12
|
+
className: m("select-appframe", t),
|
|
13
|
+
children: [e && /* @__PURE__ */ d("a", {
|
|
14
|
+
href: e.to,
|
|
15
|
+
className: "select-appframe__skip",
|
|
16
|
+
children: e.label
|
|
17
|
+
}), n]
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
function g({ rail: e, className: t, children: n, ...r }) {
|
|
21
|
+
return /* @__PURE__ */ f("div", {
|
|
22
|
+
...r,
|
|
23
|
+
className: m("select-appframe__panel", t),
|
|
24
|
+
children: [e, n]
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
var _ = a(function({ aside: e, asideCompact: t, className: n, children: r, ...i }, a) {
|
|
28
|
+
let o = e != null || t != null;
|
|
29
|
+
return /* @__PURE__ */ f("main", {
|
|
30
|
+
ref: a,
|
|
31
|
+
...i,
|
|
32
|
+
className: m("select-appframe__main", o && "select-appframe__main--aside", n),
|
|
33
|
+
children: [o && /* @__PURE__ */ f("div", {
|
|
34
|
+
className: "select-appframe__aside",
|
|
35
|
+
children: [e != null && /* @__PURE__ */ d("div", {
|
|
36
|
+
className: "select-appframe__asidenav",
|
|
37
|
+
children: e
|
|
38
|
+
}), t != null && /* @__PURE__ */ d("div", {
|
|
39
|
+
className: "select-appframe__asidecompact",
|
|
40
|
+
children: t
|
|
41
|
+
})]
|
|
42
|
+
}), r]
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
function v({ pages: e, onPick: t }) {
|
|
46
|
+
return /* @__PURE__ */ d(u, { children: e.map((e) => /* @__PURE__ */ d(p, {
|
|
47
|
+
to: e.to,
|
|
48
|
+
className: m("select-apprail__page", e.current && "is-active"),
|
|
49
|
+
"aria-current": e.current ? "page" : void 0,
|
|
50
|
+
onClick: t,
|
|
51
|
+
children: e.label
|
|
52
|
+
}, e.id)) });
|
|
53
|
+
}
|
|
54
|
+
function y({ items: t, wide: n, open: r, setOpen: i, flyout: a, setFlyout: l, up: u = !1, t: h }) {
|
|
55
|
+
var g, _;
|
|
56
|
+
let y = t.findIndex((e) => e.active), b = c(0);
|
|
57
|
+
y >= 0 && (b.current = y);
|
|
58
|
+
let x = n ? t.findIndex((e) => {
|
|
59
|
+
var t;
|
|
60
|
+
return e.id === r && (((t = e.pages) == null ? void 0 : t.length) ?? 0) > 0;
|
|
61
|
+
}) : -1, S = x >= 0 && x < b.current ? ((g = t[x].pages) == null ? void 0 : g.length) ?? 0 : 0, C = c(null), w = c(null), T = (_ = t.flatMap((e) => e.pages ?? []).find((e) => e.current)) == null ? void 0 : _.id;
|
|
62
|
+
return s(() => {
|
|
63
|
+
let e = w.current;
|
|
64
|
+
e && (e.style.setProperty("--rail-i", String(b.current)), e.style.setProperty("--rail-pn", String(S)), e.style.setProperty("--rail-pb", S > 0 ? "1" : "0"));
|
|
65
|
+
}), o(() => {
|
|
66
|
+
var e, t;
|
|
67
|
+
n && ((e = C.current) == null || (e = e.querySelector(".select-apprail__page[aria-current=\"page\"]")) == null || (t = e.scrollIntoView) == null || t.call(e, { block: "nearest" }));
|
|
68
|
+
}, [
|
|
69
|
+
T,
|
|
70
|
+
r,
|
|
71
|
+
n
|
|
72
|
+
]), /* @__PURE__ */ f("div", {
|
|
73
|
+
ref: C,
|
|
74
|
+
className: m("select-apprail__pill", n && "is-wide"),
|
|
75
|
+
children: [/* @__PURE__ */ d("span", {
|
|
76
|
+
ref: w,
|
|
77
|
+
className: m("select-apprail__ind", y >= 0 && "is-on"),
|
|
78
|
+
"aria-hidden": "true"
|
|
79
|
+
}), t.map((t) => {
|
|
80
|
+
let o = t.pages ?? [], s = o.length > 0, c = n && s && r === t.id, g = !n && s && a === t.id;
|
|
81
|
+
return /* @__PURE__ */ f("div", {
|
|
82
|
+
className: "select-apprail__slot",
|
|
83
|
+
children: [
|
|
84
|
+
/* @__PURE__ */ f(p, {
|
|
85
|
+
to: t.to,
|
|
86
|
+
className: m("select-apprail__btn", t.active && "is-active"),
|
|
87
|
+
"aria-label": t.label,
|
|
88
|
+
"aria-current": t.active ? "true" : void 0,
|
|
89
|
+
"aria-expanded": s ? c || g : void 0,
|
|
90
|
+
onClick: (e) => {
|
|
91
|
+
if (!s) {
|
|
92
|
+
l(null);
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
if (!n) {
|
|
96
|
+
e.preventDefault(), l(g ? null : t.id);
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
c && t.active && e.preventDefault(), i(c ? null : t.id);
|
|
100
|
+
},
|
|
101
|
+
children: [
|
|
102
|
+
/* @__PURE__ */ d("span", {
|
|
103
|
+
className: "select-apprail__icon",
|
|
104
|
+
"aria-hidden": "true",
|
|
105
|
+
children: t.icon
|
|
106
|
+
}),
|
|
107
|
+
/* @__PURE__ */ d("span", {
|
|
108
|
+
className: "select-apprail__label",
|
|
109
|
+
"aria-hidden": "true",
|
|
110
|
+
children: t.label
|
|
111
|
+
}),
|
|
112
|
+
s && /* @__PURE__ */ d("span", {
|
|
113
|
+
className: m("select-apprail__chev", c && "is-open"),
|
|
114
|
+
"aria-hidden": "true",
|
|
115
|
+
children: /* @__PURE__ */ d(e, {})
|
|
116
|
+
}),
|
|
117
|
+
!n && !g && /* @__PURE__ */ f("span", {
|
|
118
|
+
className: "select-apprail__tip",
|
|
119
|
+
"aria-hidden": "true",
|
|
120
|
+
children: [/* @__PURE__ */ d("span", {
|
|
121
|
+
className: "select-apprail__name",
|
|
122
|
+
children: t.label
|
|
123
|
+
}), s && /* @__PURE__ */ d("span", {
|
|
124
|
+
className: "select-apprail__hint",
|
|
125
|
+
children: h.seePages
|
|
126
|
+
})]
|
|
127
|
+
})
|
|
128
|
+
]
|
|
129
|
+
}),
|
|
130
|
+
g && /* @__PURE__ */ f("div", {
|
|
131
|
+
className: m("select-apprail__fly", u && "select-apprail__fly--up"),
|
|
132
|
+
role: "group",
|
|
133
|
+
"aria-label": h.sectionPages(t.label),
|
|
134
|
+
children: [/* @__PURE__ */ d("span", {
|
|
135
|
+
className: "select-apprail__flytitle",
|
|
136
|
+
children: t.label
|
|
137
|
+
}), /* @__PURE__ */ d(v, {
|
|
138
|
+
pages: o,
|
|
139
|
+
onPick: () => l(null)
|
|
140
|
+
})]
|
|
141
|
+
}),
|
|
142
|
+
s && /* @__PURE__ */ d("div", {
|
|
143
|
+
className: m("select-apprail__pagesw", c && "is-open"),
|
|
144
|
+
children: /* @__PURE__ */ d("div", {
|
|
145
|
+
className: "select-apprail__pagesclip",
|
|
146
|
+
children: /* @__PURE__ */ d("div", {
|
|
147
|
+
className: "select-apprail__pages",
|
|
148
|
+
role: "group",
|
|
149
|
+
"aria-label": h.sectionPages(t.label),
|
|
150
|
+
children: /* @__PURE__ */ d(v, { pages: o })
|
|
151
|
+
})
|
|
152
|
+
})
|
|
153
|
+
})
|
|
154
|
+
]
|
|
155
|
+
}, t.id);
|
|
156
|
+
})]
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
function b({ label: e, wide: t, onToggle: i, items: a, bottom: s = [], shortcutKey: u = "[", toggleIcon: p, messages: h }) {
|
|
160
|
+
var g, _;
|
|
161
|
+
let v = {
|
|
162
|
+
...r().appFrame.rail,
|
|
163
|
+
...h
|
|
164
|
+
}, b = [...a, ...s], x = ((g = b.find((e) => e.active)) == null ? void 0 : g.id) ?? null, S = ((_ = b.flatMap((e) => e.pages ?? []).find((e) => e.current)) == null ? void 0 : _.id) ?? null, [C, w] = l(x);
|
|
165
|
+
o(() => w(x), [x]);
|
|
166
|
+
let [T, E] = l(null), D = c(null);
|
|
167
|
+
o(() => E(null), [
|
|
168
|
+
x,
|
|
169
|
+
S,
|
|
170
|
+
t
|
|
171
|
+
]), o(() => {
|
|
172
|
+
if (!T) return;
|
|
173
|
+
let e = (e) => {
|
|
174
|
+
var t;
|
|
175
|
+
(t = D.current) != null && t.contains(e.target) || E(null);
|
|
176
|
+
}, t = (e) => {
|
|
177
|
+
e.key === "Escape" && E(null);
|
|
178
|
+
};
|
|
179
|
+
return document.addEventListener("pointerdown", e), document.addEventListener("keydown", t), () => {
|
|
180
|
+
document.removeEventListener("pointerdown", e), document.removeEventListener("keydown", t);
|
|
181
|
+
};
|
|
182
|
+
}, [T]);
|
|
183
|
+
let O = c(i);
|
|
184
|
+
O.current = i, o(() => {
|
|
185
|
+
if (!u) return;
|
|
186
|
+
let e = (e) => {
|
|
187
|
+
if (e.key !== u || e.metaKey || e.ctrlKey || e.altKey) return;
|
|
188
|
+
let t = e.target;
|
|
189
|
+
t && (t.isContentEditable || /^(INPUT|TEXTAREA|SELECT)$/.test(t.tagName)) || O.current();
|
|
190
|
+
};
|
|
191
|
+
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
192
|
+
}, [u]);
|
|
193
|
+
let k = t ? v.collapse : v.expand, A = (e, n = !1) => /* @__PURE__ */ d(y, {
|
|
194
|
+
items: e,
|
|
195
|
+
wide: t,
|
|
196
|
+
open: C,
|
|
197
|
+
setOpen: w,
|
|
198
|
+
flyout: T,
|
|
199
|
+
setFlyout: E,
|
|
200
|
+
up: n,
|
|
201
|
+
t: v
|
|
202
|
+
});
|
|
203
|
+
return /* @__PURE__ */ f("nav", {
|
|
204
|
+
ref: D,
|
|
205
|
+
"aria-label": e,
|
|
206
|
+
className: m("select-apprail", t && "is-wide"),
|
|
207
|
+
children: [/* @__PURE__ */ f("div", {
|
|
208
|
+
className: "select-apprail__top",
|
|
209
|
+
children: [/* @__PURE__ */ f("button", {
|
|
210
|
+
type: "button",
|
|
211
|
+
className: "select-apprail__toggle",
|
|
212
|
+
"aria-expanded": t,
|
|
213
|
+
"aria-label": k,
|
|
214
|
+
onClick: i,
|
|
215
|
+
children: [
|
|
216
|
+
/* @__PURE__ */ d("span", {
|
|
217
|
+
className: "select-apprail__icon",
|
|
218
|
+
"aria-hidden": "true",
|
|
219
|
+
children: p ?? /* @__PURE__ */ d(n, {})
|
|
220
|
+
}),
|
|
221
|
+
/* @__PURE__ */ d("span", {
|
|
222
|
+
className: "select-apprail__label",
|
|
223
|
+
"aria-hidden": "true",
|
|
224
|
+
children: k
|
|
225
|
+
}),
|
|
226
|
+
u && /* @__PURE__ */ d("kbd", {
|
|
227
|
+
className: "select-apprail__kbd",
|
|
228
|
+
"aria-hidden": "true",
|
|
229
|
+
children: u
|
|
230
|
+
}),
|
|
231
|
+
!t && /* @__PURE__ */ d("span", {
|
|
232
|
+
className: "select-apprail__tip",
|
|
233
|
+
"aria-hidden": "true",
|
|
234
|
+
children: /* @__PURE__ */ d("span", {
|
|
235
|
+
className: "select-apprail__name",
|
|
236
|
+
children: u ? v.shortcut(k, u) : k
|
|
237
|
+
})
|
|
238
|
+
})
|
|
239
|
+
]
|
|
240
|
+
}), a.length > 0 && A(a)]
|
|
241
|
+
}), s.length > 0 && A(s, !0)]
|
|
242
|
+
});
|
|
243
|
+
}
|
|
244
|
+
function x({ id: e, open: n, onClose: a, label: s, logo: l, closeLabel: u, closeIcon: p, context: m, children: h }) {
|
|
245
|
+
let g = r().appFrame, _ = c(null);
|
|
246
|
+
return o(() => {
|
|
247
|
+
var e, t;
|
|
248
|
+
let r = _.current;
|
|
249
|
+
r && (n && !r.open ? (e = r.showModal) == null || e.call(r) : !n && r.open && ((t = r.close) == null || t.call(r)));
|
|
250
|
+
}, [n]), /* @__PURE__ */ d("dialog", {
|
|
251
|
+
ref: _,
|
|
252
|
+
id: e,
|
|
253
|
+
"aria-label": s,
|
|
254
|
+
className: "select-appdrawer",
|
|
255
|
+
onClose: a,
|
|
256
|
+
onClick: (e) => e.target === e.currentTarget && a(),
|
|
257
|
+
children: /* @__PURE__ */ f("div", {
|
|
258
|
+
className: "select-appdrawer__box",
|
|
259
|
+
children: [
|
|
260
|
+
/* @__PURE__ */ f("div", {
|
|
261
|
+
className: "select-appdrawer__head",
|
|
262
|
+
children: [l, /* @__PURE__ */ d(i, {
|
|
263
|
+
label: u ?? g.drawerClose,
|
|
264
|
+
icon: p ?? /* @__PURE__ */ d(t, {}),
|
|
265
|
+
onClick: a
|
|
266
|
+
})]
|
|
267
|
+
}),
|
|
268
|
+
m != null && /* @__PURE__ */ d("div", {
|
|
269
|
+
className: "select-appdrawer__context",
|
|
270
|
+
children: m
|
|
271
|
+
}),
|
|
272
|
+
h
|
|
273
|
+
]
|
|
274
|
+
})
|
|
275
|
+
});
|
|
276
|
+
}
|
|
277
|
+
//#endregion
|
|
278
|
+
export { x as SelectAppDrawer, h as SelectAppFrame, _ as SelectAppMain, g as SelectAppPanel, b as SelectAppRail };
|
|
279
|
+
|
|
280
|
+
//# sourceMappingURL=SelectAppFrame.js.map
|
package/dist/SelectLocale.d.ts
CHANGED
|
@@ -137,6 +137,16 @@ export interface SelectKitMessages {
|
|
|
137
137
|
/** 0.1.227: a moldura do app — o botão do menu do celular e a busca da barra (SelectAppBar, SelectAppSearch). */
|
|
138
138
|
appFrame: {
|
|
139
139
|
menuOpen: string;
|
|
140
|
+
/** 0.1.228: o fechar da gaveta do celular (SelectAppDrawer). */
|
|
141
|
+
drawerClose: string;
|
|
142
|
+
/** 0.1.228: o trilho (SelectAppRail): o botão do topo, o atalho, a dica da seção com páginas e o grupo das páginas. */
|
|
143
|
+
rail: {
|
|
144
|
+
expand: string;
|
|
145
|
+
collapse: string;
|
|
146
|
+
shortcut: (label: string, key: string) => string;
|
|
147
|
+
seePages: string;
|
|
148
|
+
sectionPages: (section: string) => string;
|
|
149
|
+
};
|
|
140
150
|
search: {
|
|
141
151
|
label: string;
|
|
142
152
|
placeholder: string;
|
package/dist/SelectLocale.js
CHANGED
|
@@ -141,6 +141,14 @@ var r = {
|
|
|
141
141
|
},
|
|
142
142
|
appFrame: {
|
|
143
143
|
menuOpen: "Abrir o menu",
|
|
144
|
+
drawerClose: "Fechar o menu",
|
|
145
|
+
rail: {
|
|
146
|
+
expand: "Expandir o menu",
|
|
147
|
+
collapse: "Recolher o menu",
|
|
148
|
+
shortcut: (e, t) => `${e} ( ${t} )`,
|
|
149
|
+
seePages: "Clique para ver as páginas",
|
|
150
|
+
sectionPages: (e) => `Páginas de ${e}`
|
|
151
|
+
},
|
|
144
152
|
search: {
|
|
145
153
|
label: "Buscar",
|
|
146
154
|
placeholder: "Buscar",
|
|
@@ -297,6 +305,14 @@ var r = {
|
|
|
297
305
|
},
|
|
298
306
|
appFrame: {
|
|
299
307
|
menuOpen: "Open the menu",
|
|
308
|
+
drawerClose: "Close the menu",
|
|
309
|
+
rail: {
|
|
310
|
+
expand: "Expand the menu",
|
|
311
|
+
collapse: "Collapse the menu",
|
|
312
|
+
shortcut: (e, t) => `${e} ( ${t} )`,
|
|
313
|
+
seePages: "Click to see the pages",
|
|
314
|
+
sectionPages: (e) => `${e} pages`
|
|
315
|
+
},
|
|
300
316
|
search: {
|
|
301
317
|
label: "Search",
|
|
302
318
|
placeholder: "Search",
|
|
@@ -6,6 +6,11 @@ type SelectWorkspaceSwitcherOwnProps = {
|
|
|
6
6
|
onClick?: () => void;
|
|
7
7
|
/** Sem troca possível: desenha o mesmo pill, sem a seta e sem ser botão. */
|
|
8
8
|
readOnly?: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* 0.1.228: a pílula com a borda, numa linha de texto (a linha de contexto do cabeçalho da página, a caixa da gaveta
|
|
11
|
+
* do celular), em vez do botão sem fundo da barra.
|
|
12
|
+
*/
|
|
13
|
+
pill?: boolean;
|
|
9
14
|
};
|
|
10
15
|
export type SelectWorkspaceSwitcherProps = SelectWorkspaceSwitcherOwnProps & Omit<ComponentPropsWithoutRef<'button'>, keyof SelectWorkspaceSwitcherOwnProps>;
|
|
11
16
|
export declare const SelectWorkspaceSwitcher: import('react').ForwardRefExoticComponent<SelectWorkspaceSwitcherOwnProps & Omit<Omit<import('react').DetailedHTMLProps<import('react').ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref">, keyof SelectWorkspaceSwitcherOwnProps> & import('react').RefAttributes<HTMLButtonElement>>;
|
|
@@ -2,8 +2,8 @@ import { SelectorIcon as e } from "./icons.js";
|
|
|
2
2
|
import { forwardRef as t } from "react";
|
|
3
3
|
import { Fragment as n, jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
4
4
|
//#region src/SelectWorkspaceSwitcher.tsx
|
|
5
|
-
var a = t(function({ avatar: t, name: a, badge: o, onClick: s, readOnly: c = !1,
|
|
6
|
-
let
|
|
5
|
+
var a = t(function({ avatar: t, name: a, badge: o, onClick: s, readOnly: c = !1, pill: l = !1, className: u, ...d }, f) {
|
|
6
|
+
let p = /* @__PURE__ */ i(n, { children: [
|
|
7
7
|
t && /* @__PURE__ */ r("span", {
|
|
8
8
|
className: "select-wsswitcher__avatar",
|
|
9
9
|
children: t
|
|
@@ -15,19 +15,19 @@ var a = t(function({ avatar: t, name: a, badge: o, onClick: s, readOnly: c = !1,
|
|
|
15
15
|
o
|
|
16
16
|
] });
|
|
17
17
|
return c ? /* @__PURE__ */ r("div", {
|
|
18
|
-
className: `select-wsswitcher select-wsswitcher--readonly${l ? " " +
|
|
19
|
-
"aria-label":
|
|
20
|
-
title:
|
|
21
|
-
id:
|
|
22
|
-
children:
|
|
18
|
+
className: `select-wsswitcher select-wsswitcher--readonly${l ? " select-wsswitcher--pill" : ""}${u ? " " + u : ""}`,
|
|
19
|
+
"aria-label": d["aria-label"],
|
|
20
|
+
title: d.title,
|
|
21
|
+
id: d.id,
|
|
22
|
+
children: p
|
|
23
23
|
}) : /* @__PURE__ */ i("button", {
|
|
24
|
-
ref:
|
|
25
|
-
...
|
|
24
|
+
ref: f,
|
|
25
|
+
...d,
|
|
26
26
|
type: "button",
|
|
27
|
-
className: `select-wsswitcher${l ? " " +
|
|
27
|
+
className: `select-wsswitcher${l ? " select-wsswitcher--pill" : ""}${u ? " " + u : ""}`,
|
|
28
28
|
onClick: s,
|
|
29
29
|
"aria-haspopup": "menu",
|
|
30
|
-
children: [
|
|
30
|
+
children: [p, /* @__PURE__ */ r("span", {
|
|
31
31
|
className: "select-wsswitcher__selector",
|
|
32
32
|
"aria-hidden": "true",
|
|
33
33
|
children: /* @__PURE__ */ r(e, {})
|
package/dist/index.d.ts
CHANGED
|
@@ -72,6 +72,8 @@ export { SelectSideNav } from './SelectSideNav';
|
|
|
72
72
|
export { SelectAppBar, SelectAppBarButton, SelectAppBarAccount, SelectAppPages } from './SelectAppBar';
|
|
73
73
|
export type { SelectAppBarProps, SelectAppBarButtonProps, SelectAppBarAccountProps, SelectAppPage } from './SelectAppBar';
|
|
74
74
|
export { SelectAppSearch } from './SelectAppSearch';
|
|
75
|
+
export { SelectAppFrame, SelectAppPanel, SelectAppMain, SelectAppRail, SelectAppDrawer } from './SelectAppFrame';
|
|
76
|
+
export type { SelectAppFrameProps, SelectAppPanelProps, SelectAppMainProps, SelectAppRailProps, SelectAppRailItem, SelectAppRailPage, SelectAppDrawerProps, } from './SelectAppFrame';
|
|
75
77
|
export type { SelectAppSearchItem, SelectAppSearchGroup, SelectAppSearchProps } from './SelectAppSearch';
|
|
76
78
|
export { SelectSearchInput } from './SelectSearchInput';
|
|
77
79
|
export { SelectTable, SelectTableRow, SelectTableCell, SelectTableEmpty, SelectUserCell } from './SelectTable';
|