@selectwin/kit 0.1.205 → 0.1.206
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/SelectPage.d.ts +32 -8
- package/dist/SelectPage.js +111 -61
- package/dist/index.d.ts +2 -2
- package/dist/index.js +154 -154
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/SelectPage.d.ts
CHANGED
|
@@ -7,13 +7,28 @@ export interface SelectPageAction {
|
|
|
7
7
|
loading?: boolean;
|
|
8
8
|
icon?: ReactNode;
|
|
9
9
|
}
|
|
10
|
-
|
|
10
|
+
export interface SelectPageBack {
|
|
11
|
+
/** O clique. Com `to`, roda antes da navegação do link. */
|
|
12
|
+
onAction?: () => void;
|
|
13
|
+
/** 0.1.206: o endereço do app — o voltar é o `<Link>` do roteador (abre em outra aba, copia o endereço). */
|
|
14
|
+
to?: string;
|
|
15
|
+
/** O nome do voltar para o leitor de tela (o padrão: "Voltar"). */
|
|
16
|
+
content?: string;
|
|
17
|
+
}
|
|
18
|
+
/** O cabeçalho da página: o voltar, o contexto, o título, o meta, a descrição, as ações e o destaque (0.1.206). */
|
|
19
|
+
export type SelectPageHeaderProps = {
|
|
11
20
|
title?: ReactNode;
|
|
12
21
|
subtitle?: ReactNode;
|
|
13
22
|
/** Acima do título, em caixa-alta espaçada ("Produção · Segunda, 02 de novembro") — 0.1.188, o tom corporativo. */
|
|
14
23
|
eyebrow?: ReactNode;
|
|
15
|
-
/**
|
|
16
|
-
|
|
24
|
+
/** 0.1.206: a linha acima do título, antes do `eyebrow` (a organização e o workspace, com o trocador). */
|
|
25
|
+
context?: ReactNode;
|
|
26
|
+
/** 0.1.206: os avisos da página, em pilha acima do cabeçalho (a conta em análise, o limite do mês). */
|
|
27
|
+
notices?: ReactNode;
|
|
28
|
+
/** 0.1.206: uma linha sob o título (o estado, as etiquetas). */
|
|
29
|
+
meta?: ReactNode;
|
|
30
|
+
/** 0.1.206: um destaque à direita (o carrossel das análises). Com ele, as ações vão para baixo do texto. */
|
|
31
|
+
aside?: ReactNode;
|
|
17
32
|
primaryAction?: SelectPageAction;
|
|
18
33
|
secondaryActions?: SelectPageAction[];
|
|
19
34
|
/** Custom node in the header action area (e.g. an "Ações" overflow menu on detail
|
|
@@ -23,17 +38,26 @@ type SelectPageOwnProps = {
|
|
|
23
38
|
backAction?: SelectPageBack | null;
|
|
24
39
|
/** Os níveis de CIMA da página, sobre o título ("Club › Cursos"); o título é o nível atual. */
|
|
25
40
|
breadcrumbs?: SelectBreadcrumbItem[];
|
|
41
|
+
};
|
|
42
|
+
type SelectPageOwnProps = SelectPageHeaderProps & {
|
|
43
|
+
/** Um filete separa o cabeçalho do conteúdo (as telas de painel, como o Início). */
|
|
44
|
+
divided?: boolean;
|
|
26
45
|
children: ReactNode;
|
|
27
46
|
};
|
|
28
|
-
export interface SelectPageBack {
|
|
29
|
-
onAction: () => void;
|
|
30
|
-
content?: string;
|
|
31
|
-
}
|
|
32
47
|
/** O voltar das páginas que não dizem o seu (ex.: a tela anterior do app). */
|
|
33
48
|
export declare function SelectPageBackProvider({ value, children }: {
|
|
34
49
|
value: SelectPageBack | null;
|
|
35
50
|
children: ReactNode;
|
|
36
51
|
}): import("react").JSX.Element;
|
|
52
|
+
/**
|
|
53
|
+
* O cabeçalho da página sozinho (0.1.206), para a moldura que já dá a coluna da página. Devolve os avisos e a linha do
|
|
54
|
+
* cabeçalho lado a lado (sem uma caixa em volta): dentro da SelectPage, eles são filhos da coluna dela.
|
|
55
|
+
*/
|
|
56
|
+
export declare function SelectPageHeader({ title, subtitle, eyebrow, context, notices, meta, aside, primaryAction, secondaryActions, headerActions, backAction: ownBack, breadcrumbs, }: SelectPageHeaderProps): import("react").JSX.Element;
|
|
37
57
|
export type SelectPageProps = SelectPageOwnProps & Omit<ComponentPropsWithoutRef<'div'>, keyof SelectPageOwnProps>;
|
|
38
|
-
export declare const SelectPage: import('react').ForwardRefExoticComponent<
|
|
58
|
+
export declare const SelectPage: import('react').ForwardRefExoticComponent<SelectPageHeaderProps & {
|
|
59
|
+
/** Um filete separa o cabeçalho do conteúdo (as telas de painel, como o Início). */
|
|
60
|
+
divided?: boolean;
|
|
61
|
+
children: ReactNode;
|
|
62
|
+
} & Omit<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "children" | keyof SelectPageHeaderProps | "divided"> & import('react').RefAttributes<HTMLDivElement>>;
|
|
39
63
|
export {};
|
package/dist/SelectPage.js
CHANGED
|
@@ -1,85 +1,135 @@
|
|
|
1
1
|
/* empty css */
|
|
2
2
|
import { SelectButton as e } from "./SelectButton.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
3
|
+
import { safeHref as t } from "./internal/safeHref.js";
|
|
4
|
+
import { ArrowLeftIcon as n } from "./icons.js";
|
|
5
|
+
import { useSelectMessages as r } from "./SelectLocale.js";
|
|
6
|
+
import { SelectBreadcrumb as i } from "./SelectBreadcrumb.js";
|
|
7
|
+
import { createContext as a, forwardRef as o, useContext as s } from "react";
|
|
8
|
+
import { Fragment as c, jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
9
|
+
import { Link as d } from "react-router-dom";
|
|
8
10
|
//#region src/SelectPage.tsx
|
|
9
|
-
var
|
|
10
|
-
function
|
|
11
|
-
return /* @__PURE__ */
|
|
11
|
+
var f = a(null);
|
|
12
|
+
function p({ value: e, children: t }) {
|
|
13
|
+
return /* @__PURE__ */ l(f.Provider, {
|
|
12
14
|
value: e,
|
|
13
15
|
children: t
|
|
14
16
|
});
|
|
15
17
|
}
|
|
16
|
-
|
|
17
|
-
let
|
|
18
|
-
return /* @__PURE__ */
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
18
|
+
function m({ back: e, label: r }) {
|
|
19
|
+
let i = e.to === void 0 ? void 0 : t(e.to);
|
|
20
|
+
return i === void 0 ? /* @__PURE__ */ l("button", {
|
|
21
|
+
type: "button",
|
|
22
|
+
className: "select-page__back",
|
|
23
|
+
onClick: e.onAction,
|
|
24
|
+
"aria-label": r,
|
|
25
|
+
children: /* @__PURE__ */ l(n, {})
|
|
26
|
+
}) : /* @__PURE__ */ l(d, {
|
|
27
|
+
to: i,
|
|
28
|
+
className: "select-page__back",
|
|
29
|
+
"aria-label": r,
|
|
30
|
+
onClick: e.onAction,
|
|
31
|
+
children: /* @__PURE__ */ l(n, {})
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
function h({ title: t, subtitle: n, eyebrow: a, context: o, notices: d, meta: p, aside: h, primaryAction: g, secondaryActions: _, headerActions: v, backAction: y, breadcrumbs: b }) {
|
|
35
|
+
let x = r(), S = s(f), C = y === null ? null : y ?? S, w = !!g || _ && _.length > 0 || !!v, T = C || t || n || a || w || o || p || h, E = w ? /* @__PURE__ */ u("div", {
|
|
36
|
+
className: `select-page__actions${h ? " select-page__actions--below" : ""}`,
|
|
37
|
+
children: [
|
|
38
|
+
_ == null ? void 0 : _.map((t, n) => /* @__PURE__ */ l(e, {
|
|
39
|
+
variant: "secondary",
|
|
40
|
+
size: "sm",
|
|
41
|
+
inline: !0,
|
|
42
|
+
icon: t.icon,
|
|
43
|
+
disabled: t.disabled,
|
|
44
|
+
loading: t.loading,
|
|
45
|
+
onClick: t.onAction,
|
|
46
|
+
children: t.content
|
|
47
|
+
}, n)),
|
|
48
|
+
g && /* @__PURE__ */ l(e, {
|
|
49
|
+
variant: "primary",
|
|
50
|
+
size: "sm",
|
|
51
|
+
inline: !0,
|
|
52
|
+
icon: g.icon,
|
|
53
|
+
disabled: g.disabled,
|
|
54
|
+
loading: g.loading,
|
|
55
|
+
onClick: g.onAction,
|
|
56
|
+
children: g.content
|
|
57
|
+
}),
|
|
58
|
+
v
|
|
59
|
+
]
|
|
60
|
+
}) : null;
|
|
61
|
+
return /* @__PURE__ */ u(c, { children: [d != null && d !== !1 && /* @__PURE__ */ l("div", {
|
|
62
|
+
className: "select-page__notices",
|
|
63
|
+
children: d
|
|
64
|
+
}), T && /* @__PURE__ */ u("div", {
|
|
65
|
+
className: `select-page__header${h ? " select-page__header--aside" : ""}`,
|
|
66
|
+
children: [
|
|
67
|
+
/* @__PURE__ */ u("div", {
|
|
25
68
|
className: "select-page__heading",
|
|
26
|
-
children: [C && /* @__PURE__ */
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
"aria-label": C.content ?? x.common.back,
|
|
31
|
-
children: /* @__PURE__ */ s(t, {})
|
|
32
|
-
}), /* @__PURE__ */ c("div", {
|
|
69
|
+
children: [C && /* @__PURE__ */ l(m, {
|
|
70
|
+
back: C,
|
|
71
|
+
label: C.content ?? x.common.back
|
|
72
|
+
}), /* @__PURE__ */ u("div", {
|
|
33
73
|
className: "select-page__head",
|
|
34
74
|
children: [
|
|
35
|
-
|
|
36
|
-
items:
|
|
75
|
+
b && b.length > 0 && /* @__PURE__ */ l(i, {
|
|
76
|
+
items: b,
|
|
37
77
|
lastIsCurrent: !1
|
|
38
78
|
}),
|
|
39
|
-
|
|
79
|
+
o && /* @__PURE__ */ l("div", {
|
|
80
|
+
className: "select-page__context",
|
|
81
|
+
children: o
|
|
82
|
+
}),
|
|
83
|
+
a && /* @__PURE__ */ l("p", {
|
|
40
84
|
className: "select-page__eyebrow",
|
|
41
|
-
children:
|
|
85
|
+
children: a
|
|
42
86
|
}),
|
|
43
|
-
|
|
87
|
+
t && /* @__PURE__ */ l("h1", {
|
|
44
88
|
className: "select-page__title",
|
|
45
|
-
children:
|
|
89
|
+
children: t
|
|
46
90
|
}),
|
|
47
|
-
|
|
91
|
+
p && /* @__PURE__ */ l("div", {
|
|
92
|
+
className: "select-page__meta",
|
|
93
|
+
children: p
|
|
94
|
+
}),
|
|
95
|
+
n && /* @__PURE__ */ l("p", {
|
|
48
96
|
className: "select-page__subtitle",
|
|
49
|
-
children:
|
|
50
|
-
})
|
|
97
|
+
children: n
|
|
98
|
+
}),
|
|
99
|
+
h && E
|
|
51
100
|
]
|
|
52
101
|
})]
|
|
53
|
-
}),
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
102
|
+
}),
|
|
103
|
+
!h && E,
|
|
104
|
+
h && /* @__PURE__ */ l("div", {
|
|
105
|
+
className: "select-page__aside",
|
|
106
|
+
children: h
|
|
107
|
+
})
|
|
108
|
+
]
|
|
109
|
+
})] });
|
|
110
|
+
}
|
|
111
|
+
var g = o(function({ title: e, subtitle: t, eyebrow: n, context: r, notices: i, meta: a, aside: o, divided: s = !1, primaryAction: c, secondaryActions: d, headerActions: f, backAction: p, breadcrumbs: m, children: g, className: _, ...v }, y) {
|
|
112
|
+
return /* @__PURE__ */ u("div", {
|
|
113
|
+
ref: y,
|
|
114
|
+
...v,
|
|
115
|
+
className: `select select-page${s ? " select-page--divided" : ""}${_ ? " " + _ : ""}`,
|
|
116
|
+
children: [/* @__PURE__ */ l(h, {
|
|
117
|
+
title: e,
|
|
118
|
+
subtitle: t,
|
|
119
|
+
eyebrow: n,
|
|
120
|
+
context: r,
|
|
121
|
+
notices: i,
|
|
122
|
+
meta: a,
|
|
123
|
+
aside: o,
|
|
124
|
+
primaryAction: c,
|
|
125
|
+
secondaryActions: d,
|
|
126
|
+
headerActions: f,
|
|
127
|
+
backAction: p,
|
|
128
|
+
breadcrumbs: m
|
|
129
|
+
}), g]
|
|
80
130
|
});
|
|
81
131
|
});
|
|
82
132
|
//#endregion
|
|
83
|
-
export {
|
|
133
|
+
export { g as SelectPage, p as SelectPageBackProvider, h as SelectPageHeader };
|
|
84
134
|
|
|
85
135
|
//# sourceMappingURL=SelectPage.js.map
|
package/dist/index.d.ts
CHANGED
|
@@ -55,7 +55,7 @@ export { SelectPasswordStrength, passwordScore, type SelectPasswordRule } from '
|
|
|
55
55
|
export { SelectLoader, type SelectLoaderProps } from './SelectLoader';
|
|
56
56
|
export { SelectText } from './SelectText';
|
|
57
57
|
export { SelectBox, SelectStack, SelectInline, SelectGrid } from './SelectLayout';
|
|
58
|
-
export { SelectPage, SelectPageBackProvider } from './SelectPage';
|
|
58
|
+
export { SelectPage, SelectPageBackProvider, SelectPageHeader } from './SelectPage';
|
|
59
59
|
export { SelectFormLayout } from './SelectFormLayout';
|
|
60
60
|
export { SelectSkeleton } from './SelectSkeleton';
|
|
61
61
|
export { SelectIcon } from './SelectIcon';
|
|
@@ -287,7 +287,7 @@ export type { SelectKeyValuePair, SelectKeyValueEditorProps } from './SelectKeyV
|
|
|
287
287
|
export type { SelectBankAccount, SelectBankOption } from './SelectBankAccountField';
|
|
288
288
|
export type { SelectSpace } from './spacing';
|
|
289
289
|
export type { SelectTextVariant, SelectTextTone, SelectFontWeight } from './SelectText';
|
|
290
|
-
export type { SelectPageAction, SelectPageBack } from './SelectPage';
|
|
290
|
+
export type { SelectPageAction, SelectPageBack, SelectPageHeaderProps } from './SelectPage';
|
|
291
291
|
export type { SelectIconTone, SelectIconSize } from './SelectIcon';
|
|
292
292
|
export type { SelectPlacement } from './positioning';
|
|
293
293
|
export type { SelectAction, SelectActionSection } from './SelectActionList';
|