@selectwin/kit 0.1.198 → 0.1.200
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/SelectBackLink.js +4 -4
- package/dist/SelectBreadcrumb.js +4 -4
- package/dist/SelectButton.d.ts +4 -2
- package/dist/SelectButton.js +23 -41
- package/dist/SelectButtonLink.d.ts +17 -0
- package/dist/SelectButtonLink.js +40 -0
- package/dist/SelectCopyRow.js +9 -9
- package/dist/SelectCopyableId.js +8 -8
- package/dist/SelectIconButton.d.ts +8 -3
- package/dist/SelectIconButton.js +1 -1
- package/dist/SelectInsight.js +43 -43
- package/dist/SelectListCard.js +10 -10
- package/dist/SelectMenu.js +8 -8
- package/dist/SelectPreviewFrame.js +11 -11
- package/dist/SelectSpinner.d.ts +5 -0
- package/dist/SelectSpinner.js +15 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.js +211 -209
- package/dist/internal/buttonParts.d.ts +24 -0
- package/dist/internal/buttonParts.js +52 -0
- package/dist/style.css +1 -1
- package/package.json +67 -67
package/dist/SelectBackLink.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { safeHref as e } from "./internal/safeHref.js";
|
|
2
|
+
import { ArrowLeftIcon as t } from "./icons.js";
|
|
3
|
+
import { useSelectMessages as n } from "./SelectLocale.js";
|
|
4
4
|
import { Fragment as r, jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
5
5
|
//#region src/SelectBackLink.tsx
|
|
6
6
|
function o({ children: o, onClick: s, href: c }) {
|
|
7
|
-
let l =
|
|
7
|
+
let l = n().common.back, u = /* @__PURE__ */ a(r, { children: [/* @__PURE__ */ i(t, {}), /* @__PURE__ */ i("span", { children: o ?? l })] }), d = e(c);
|
|
8
8
|
return d ? /* @__PURE__ */ i("a", {
|
|
9
9
|
className: "select-backlink",
|
|
10
10
|
href: d,
|
package/dist/SelectBreadcrumb.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { safeHref as e } from "./internal/safeHref.js";
|
|
2
|
+
import { ChevronRightIcon as t } from "./icons.js";
|
|
3
3
|
import { Fragment as n, forwardRef as r } from "react";
|
|
4
4
|
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
5
5
|
import { Link as o } from "react-router-dom";
|
|
@@ -13,11 +13,11 @@ var s = r(function({ items: r, lastIsCurrent: s = !0, className: c, "aria-label"
|
|
|
13
13
|
children: /* @__PURE__ */ i("ol", {
|
|
14
14
|
className: "select-breadcrumb__list",
|
|
15
15
|
children: r.map((c, l) => {
|
|
16
|
-
let u = s && l === r.length - 1, d = u ? void 0 :
|
|
16
|
+
let u = s && l === r.length - 1, d = u ? void 0 : e(c.to);
|
|
17
17
|
return /* @__PURE__ */ a(n, { children: [l > 0 && /* @__PURE__ */ i("li", {
|
|
18
18
|
className: "select-breadcrumb__sep",
|
|
19
19
|
"aria-hidden": "true",
|
|
20
|
-
children: /* @__PURE__ */ i(
|
|
20
|
+
children: /* @__PURE__ */ i(t, {})
|
|
21
21
|
}), /* @__PURE__ */ i("li", {
|
|
22
22
|
className: `select-breadcrumb__item${u ? " is-current" : ""}`,
|
|
23
23
|
children: d ? /* @__PURE__ */ i(o, {
|
package/dist/SelectButton.d.ts
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { ButtonHTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
import { SelectButtonSize, SelectButtonVariant } from './internal/buttonParts';
|
|
3
|
+
export type { SelectButtonVariant };
|
|
2
4
|
export interface SelectButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'type'> {
|
|
3
|
-
variant?:
|
|
5
|
+
variant?: SelectButtonVariant;
|
|
4
6
|
type?: 'button' | 'submit';
|
|
5
7
|
/** Control height/padding/text. `md` (default) is the compact normal button; `lg` is
|
|
6
8
|
* the larger form/CTA size (the old normal); `sm` is the small control for
|
|
7
9
|
* toolbars/filters/inline actions (shares the small height with the filter facets). */
|
|
8
|
-
size?:
|
|
10
|
+
size?: SelectButtonSize;
|
|
9
11
|
loading?: boolean;
|
|
10
12
|
icon?: ReactNode;
|
|
11
13
|
/** Icon rendered AFTER the label (e.g. the "Continue ›" arrow). */
|
package/dist/SelectButton.js
CHANGED
|
@@ -1,48 +1,30 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { ButtonContent as e, selectButtonClass as t, useSelectRipple as n } from "./internal/buttonParts.js";
|
|
2
|
+
import { forwardRef as r } from "react";
|
|
3
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
3
4
|
//#region src/SelectButton.tsx
|
|
4
|
-
var a =
|
|
5
|
-
let
|
|
6
|
-
var t, n;
|
|
7
|
-
if (p == null || p(e), f || s || typeof window < "u" && (t = (n = window).matchMedia) != null && t.call(n, "(prefers-reduced-motion: reduce)").matches) return;
|
|
8
|
-
let r = e.currentTarget.getBoundingClientRect(), i = Math.max(r.width, r.height) * 2, a = y.current++;
|
|
9
|
-
v((t) => [...t, {
|
|
10
|
-
key: a,
|
|
11
|
-
style: {
|
|
12
|
-
width: i,
|
|
13
|
-
height: i,
|
|
14
|
-
left: e.clientX - r.left - i / 2,
|
|
15
|
-
top: e.clientY - r.top - i / 2
|
|
16
|
-
}
|
|
17
|
-
}]);
|
|
18
|
-
}, x = (e) => v((t) => t.filter((t) => t.key !== e));
|
|
5
|
+
var a = r(function({ variant: r = "primary", type: a = "button", size: o = "md", loading: s = !1, icon: c, trailingIcon: l, inline: u = !1, tone: d, disabled: f, onPointerDown: p, className: m, children: h, ...g }, _) {
|
|
6
|
+
let { handlePointerDown: v, nodes: y } = n(!!(f || s), p);
|
|
19
7
|
return /* @__PURE__ */ i("button", {
|
|
20
|
-
ref:
|
|
8
|
+
ref: _,
|
|
21
9
|
type: a,
|
|
22
|
-
className:
|
|
10
|
+
className: t({
|
|
11
|
+
variant: r,
|
|
12
|
+
size: o,
|
|
13
|
+
inline: u,
|
|
14
|
+
tone: d,
|
|
15
|
+
className: m
|
|
16
|
+
}),
|
|
23
17
|
disabled: f || s,
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
className: "select-spinner",
|
|
35
|
-
"aria-hidden": "true"
|
|
36
|
-
}) : c && /* @__PURE__ */ r("span", {
|
|
37
|
-
className: "select-btn__icon",
|
|
38
|
-
children: c
|
|
39
|
-
}),
|
|
40
|
-
/* @__PURE__ */ r("span", { children: m }),
|
|
41
|
-
!s && l && /* @__PURE__ */ r("span", {
|
|
42
|
-
className: "select-btn__icon select-btn__icon--trailing",
|
|
43
|
-
children: l
|
|
44
|
-
})
|
|
45
|
-
]
|
|
18
|
+
"aria-busy": s || void 0,
|
|
19
|
+
onPointerDown: v,
|
|
20
|
+
...g,
|
|
21
|
+
children: /* @__PURE__ */ i(e, {
|
|
22
|
+
ripples: y,
|
|
23
|
+
loading: s,
|
|
24
|
+
icon: c,
|
|
25
|
+
trailingIcon: l,
|
|
26
|
+
children: h
|
|
27
|
+
})
|
|
46
28
|
});
|
|
47
29
|
});
|
|
48
30
|
//#endregion
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { AnchorHTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
import { SelectButtonSize, SelectButtonVariant } from './internal/buttonParts';
|
|
3
|
+
export interface SelectButtonLinkProps extends Omit<AnchorHTMLAttributes<HTMLAnchorElement>, 'href'> {
|
|
4
|
+
/** O endereço no app (o `<Link>` do roteador). */
|
|
5
|
+
to?: string;
|
|
6
|
+
/** Um endereço fora do app ou um arquivo (o `<a>` comum). */
|
|
7
|
+
href?: string;
|
|
8
|
+
variant?: SelectButtonVariant;
|
|
9
|
+
size?: SelectButtonSize;
|
|
10
|
+
icon?: ReactNode;
|
|
11
|
+
trailingIcon?: ReactNode;
|
|
12
|
+
/** Do tamanho do conteúdo, em vez da largura toda (como no SelectButton). */
|
|
13
|
+
inline?: boolean;
|
|
14
|
+
tone?: 'critical';
|
|
15
|
+
children: ReactNode;
|
|
16
|
+
}
|
|
17
|
+
export declare const SelectButtonLink: import('react').ForwardRefExoticComponent<SelectButtonLinkProps & import('react').RefAttributes<HTMLAnchorElement>>;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/* empty css */
|
|
2
|
+
import { ButtonContent as e, selectButtonClass as t, useSelectRipple as n } from "./internal/buttonParts.js";
|
|
3
|
+
import { safeHref as r } from "./internal/safeHref.js";
|
|
4
|
+
import { forwardRef as i } from "react";
|
|
5
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
6
|
+
import { Link as o } from "react-router-dom";
|
|
7
|
+
//#region src/SelectButtonLink.tsx
|
|
8
|
+
var s = i(function({ to: i, href: s, variant: c = "primary", size: l = "md", icon: u, trailingIcon: d, inline: f = !1, tone: p, className: m, onPointerDown: h, children: g, ..._ }, v) {
|
|
9
|
+
let { handlePointerDown: y, nodes: b } = n(!1, h), x = t({
|
|
10
|
+
variant: c,
|
|
11
|
+
size: l,
|
|
12
|
+
inline: f,
|
|
13
|
+
tone: p,
|
|
14
|
+
className: m
|
|
15
|
+
}), S = /* @__PURE__ */ a(e, {
|
|
16
|
+
ripples: b,
|
|
17
|
+
icon: u,
|
|
18
|
+
trailingIcon: d,
|
|
19
|
+
children: g
|
|
20
|
+
}), C = r(i ?? s);
|
|
21
|
+
return i !== void 0 && C !== void 0 ? /* @__PURE__ */ a(o, {
|
|
22
|
+
ref: v,
|
|
23
|
+
to: C,
|
|
24
|
+
className: x,
|
|
25
|
+
onPointerDown: y,
|
|
26
|
+
..._,
|
|
27
|
+
children: S
|
|
28
|
+
}) : /* @__PURE__ */ a("a", {
|
|
29
|
+
ref: v,
|
|
30
|
+
href: C,
|
|
31
|
+
className: x,
|
|
32
|
+
onPointerDown: y,
|
|
33
|
+
..._,
|
|
34
|
+
children: S
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
//#endregion
|
|
38
|
+
export { s as SelectButtonLink };
|
|
39
|
+
|
|
40
|
+
//# sourceMappingURL=SelectButtonLink.js.map
|
package/dist/SelectCopyRow.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { SelectButton as e } from "./SelectButton.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
2
|
+
import { safeHref as t } from "./internal/safeHref.js";
|
|
3
|
+
import { CheckIcon as n, CopyIcon as r, ExternalLinkIcon as i } from "./icons.js";
|
|
4
|
+
import { useSelectMessages as a } from "./SelectLocale.js";
|
|
5
|
+
import { SelectIconButton as o } from "./SelectIconButton.js";
|
|
6
6
|
import { forwardRef as s, useState as c } from "react";
|
|
7
7
|
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
8
8
|
//#region src/SelectCopyRow.tsx
|
|
9
9
|
var d = s(function({ label: s, value: d, href: f, onCopy: p, prose: m = !1, truncate: h = "end", className: g, ..._ }, v) {
|
|
10
|
-
let y =
|
|
10
|
+
let y = a(), [b, x] = c(!1), S = t(f), C = () => {
|
|
11
11
|
navigator.clipboard.writeText(d).then(() => {
|
|
12
12
|
x(!0), setTimeout(() => x(!1), 1200), p == null || p(d);
|
|
13
13
|
});
|
|
@@ -37,17 +37,17 @@ var d = s(function({ label: s, value: d, href: f, onCopy: p, prose: m = !1, trun
|
|
|
37
37
|
rel: "noreferrer",
|
|
38
38
|
"aria-label": y.common.open,
|
|
39
39
|
title: y.common.open,
|
|
40
|
-
children: /* @__PURE__ */ l(
|
|
40
|
+
children: /* @__PURE__ */ l(i, {})
|
|
41
41
|
}), m ? /* @__PURE__ */ l(e, {
|
|
42
42
|
variant: "secondary",
|
|
43
43
|
size: "sm",
|
|
44
44
|
inline: !0,
|
|
45
|
-
icon: l(b ?
|
|
45
|
+
icon: l(b ? n : r, {}),
|
|
46
46
|
onClick: C,
|
|
47
47
|
children: b ? y.common.copied : y.common.copy
|
|
48
|
-
}) : /* @__PURE__ */ l(
|
|
48
|
+
}) : /* @__PURE__ */ l(o, {
|
|
49
49
|
size: "sm",
|
|
50
|
-
icon: l(b ?
|
|
50
|
+
icon: l(b ? n : r, {}),
|
|
51
51
|
label: b ? y.common.copied : y.common.copy,
|
|
52
52
|
onClick: C
|
|
53
53
|
})]
|
package/dist/SelectCopyableId.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
/* empty css */
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
2
|
+
import { safeHref as e } from "./internal/safeHref.js";
|
|
3
|
+
import { CheckIcon as t, CopyIcon as n } from "./icons.js";
|
|
4
|
+
import { SelectTooltip as r } from "./SelectTooltip.js";
|
|
5
|
+
import { useSelectMessages as i } from "./SelectLocale.js";
|
|
6
6
|
import { useState as a } from "react";
|
|
7
7
|
import { Fragment as o, jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
8
8
|
import { Link as l } from "react-router-dom";
|
|
9
9
|
//#region src/SelectCopyableId.tsx
|
|
10
10
|
function u({ value: u, children: d, truncate: f, label: p, fallback: m = "—", to: h, reveal: g = "hover", variant: _ = "inline" }) {
|
|
11
|
-
let v = _ === "code", y =
|
|
11
|
+
let v = _ === "code", y = i(), b = p ?? (v ? y.copyable.copyCode : y.copyable.copyId), [x, S] = a(!1);
|
|
12
12
|
if (!u) return /* @__PURE__ */ s(o, { children: m });
|
|
13
|
-
let C = d == null && f != null && f > 0 && u.length > f, w = d ?? (C ? `${u.slice(0, Math.max(1, f - 1))}…` : u), T = C ? u : void 0, E =
|
|
13
|
+
let C = d == null && f != null && f > 0 && u.length > f, w = d ?? (C ? `${u.slice(0, Math.max(1, f - 1))}…` : u), T = C ? u : void 0, E = e(h);
|
|
14
14
|
return /* @__PURE__ */ c("span", {
|
|
15
15
|
className: `select-copyid${g === "always" || v ? " select-copyid--always" : ""}${v ? " select-copyid--code" : ""}`,
|
|
16
16
|
children: [E ? /* @__PURE__ */ s(l, {
|
|
@@ -23,7 +23,7 @@ function u({ value: u, children: d, truncate: f, label: p, fallback: m = "—",
|
|
|
23
23
|
className: "select-copyid__text",
|
|
24
24
|
title: T,
|
|
25
25
|
children: w
|
|
26
|
-
}), /* @__PURE__ */ s(
|
|
26
|
+
}), /* @__PURE__ */ s(r, {
|
|
27
27
|
content: x ? y.common.copied : b,
|
|
28
28
|
children: /* @__PURE__ */ s("button", {
|
|
29
29
|
type: "button",
|
|
@@ -34,7 +34,7 @@ function u({ value: u, children: d, truncate: f, label: p, fallback: m = "—",
|
|
|
34
34
|
});
|
|
35
35
|
},
|
|
36
36
|
"aria-label": x ? y.common.copied : b,
|
|
37
|
-
children: s(x ?
|
|
37
|
+
children: s(x ? t : n, {})
|
|
38
38
|
})
|
|
39
39
|
})]
|
|
40
40
|
});
|
|
@@ -1,12 +1,17 @@
|
|
|
1
|
-
import { ReactNode, ComponentPropsWithoutRef } from 'react';
|
|
1
|
+
import { ReactNode, ComponentPropsWithoutRef, MouseEventHandler } from 'react';
|
|
2
2
|
type SelectIconButtonOwnProps = {
|
|
3
3
|
icon: ReactNode;
|
|
4
4
|
label: string;
|
|
5
|
-
|
|
5
|
+
/** 0.1.200: recebe o evento (o menu que abre ancorado no botão precisa dele). */
|
|
6
|
+
onClick?: MouseEventHandler<HTMLButtonElement>;
|
|
6
7
|
disabled?: boolean;
|
|
7
8
|
size?: 'sm' | 'md';
|
|
8
9
|
variant?: 'ghost' | 'outline';
|
|
9
|
-
/**
|
|
10
|
+
/**
|
|
11
|
+
* Pressed/selected look — e.g. the active device in a preview toggle. 0.1.200: o `aria-pressed` só sai quando `active`
|
|
12
|
+
* vem: o botão de ícone comum (copiar, fechar, o "…") não é um botão de alternar, e o leitor de tela o anunciava como
|
|
13
|
+
* "não pressionado".
|
|
14
|
+
*/
|
|
10
15
|
active?: boolean;
|
|
11
16
|
};
|
|
12
17
|
export type SelectIconButtonProps = SelectIconButtonOwnProps & Omit<ComponentPropsWithoutRef<'button'>, keyof SelectIconButtonOwnProps>;
|
package/dist/SelectIconButton.js
CHANGED
|
@@ -2,7 +2,7 @@ import { SelectTooltip as e } from "./SelectTooltip.js";
|
|
|
2
2
|
import { forwardRef as t } from "react";
|
|
3
3
|
import { jsx as n } from "react/jsx-runtime";
|
|
4
4
|
//#region src/SelectIconButton.tsx
|
|
5
|
-
var r = t(function({ icon: t, label: r, onClick: i, disabled: a = !1, size: o = "md", variant: s = "ghost", active: c
|
|
5
|
+
var r = t(function({ icon: t, label: r, onClick: i, disabled: a = !1, size: o = "md", variant: s = "ghost", active: c, className: l, ...u }, d) {
|
|
6
6
|
return /* @__PURE__ */ n(e, {
|
|
7
7
|
content: r,
|
|
8
8
|
children: /* @__PURE__ */ n("button", {
|
package/dist/SelectInsight.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* empty css */
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { safeHref as e } from "./internal/safeHref.js";
|
|
3
|
+
import { ArrowRightIcon as t, ChevronRightIcon as n, InfoIcon as r, LockIcon as i } from "./icons.js";
|
|
4
|
+
import { SelectBadge as a } from "./SelectBadge.js";
|
|
5
5
|
import { SelectTable as o, SelectTableCell as s, SelectTableRow as c } from "./SelectTable.js";
|
|
6
6
|
import { SelectCollapsible as l } from "./SelectCollapsible.js";
|
|
7
7
|
import { Fragment as u, jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
@@ -370,33 +370,33 @@ function A({ block: e }) {
|
|
|
370
370
|
})]
|
|
371
371
|
}) : null] });
|
|
372
372
|
}
|
|
373
|
-
function j({ link:
|
|
374
|
-
let
|
|
375
|
-
if (!
|
|
376
|
-
let
|
|
377
|
-
if (!
|
|
373
|
+
function j({ link: t, primary: r }) {
|
|
374
|
+
let i = e(t.href);
|
|
375
|
+
if (!i && !t.onClick) return null;
|
|
376
|
+
let a = r ? "select-btn select-btn--primary select-btn--auto select-insight__go" : "select-insight__golink", o = /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("span", { children: t.label }), /* @__PURE__ */ d(n, {})] });
|
|
377
|
+
if (!i) return /* @__PURE__ */ d("button", {
|
|
378
378
|
type: "button",
|
|
379
|
-
className:
|
|
380
|
-
onClick:
|
|
379
|
+
className: a,
|
|
380
|
+
onClick: t.onClick,
|
|
381
381
|
children: o
|
|
382
382
|
});
|
|
383
|
-
let s =
|
|
383
|
+
let s = t.onClick ? (e) => {
|
|
384
384
|
var n;
|
|
385
|
-
|
|
385
|
+
e.button !== 0 || e.metaKey || e.ctrlKey || e.shiftKey || e.altKey || (e.preventDefault(), (n = t.onClick) == null || n.call(t));
|
|
386
386
|
} : void 0;
|
|
387
387
|
return /* @__PURE__ */ d("a", {
|
|
388
|
-
className:
|
|
389
|
-
href:
|
|
388
|
+
className: a,
|
|
389
|
+
href: i,
|
|
390
390
|
onClick: s,
|
|
391
|
-
...
|
|
391
|
+
...t.external ? {
|
|
392
392
|
target: "_blank",
|
|
393
393
|
rel: "noopener noreferrer"
|
|
394
394
|
} : {},
|
|
395
395
|
children: o
|
|
396
396
|
});
|
|
397
397
|
}
|
|
398
|
-
function M({ insight:
|
|
399
|
-
let { lang: R, labels: z } = h(
|
|
398
|
+
function M({ insight: e, locale: n, labels: o, timeZone: s = "America/Sao_Paulo", locked: c = !1, lockedCta: p, position: m, unread: _ = !1, badges: y, nav: b, triage: w, triageNote: T, footer: E, trend: M, outcome: N, renderItem: P, actionLink: F, renderAction: I, methodologyOpen: ee = !1, bare: te = !1, className: L }) {
|
|
399
|
+
let { lang: R, labels: z } = h(n, o), B = g[e.severity] ?? "info", ne = e.period ? x(e.period, R, s, z) : null, V = (e.blocks ?? []).filter(D), re = e.actions ?? [], H = `select-insight select-insight--${B}` + (c ? " select-insight--locked" : "") + (te ? " select-insight--bare" : "") + (L ? " " + L : ""), U = /* @__PURE__ */ f("header", {
|
|
400
400
|
className: "select-insight__head",
|
|
401
401
|
children: [/* @__PURE__ */ f("div", {
|
|
402
402
|
className: "select-insight__meta",
|
|
@@ -406,15 +406,15 @@ function M({ insight: t, locale: a, labels: o, timeZone: s = "America/Sao_Paulo"
|
|
|
406
406
|
children: m
|
|
407
407
|
}) : null,
|
|
408
408
|
/* @__PURE__ */ d(S, {
|
|
409
|
-
severity:
|
|
409
|
+
severity: e.severity,
|
|
410
410
|
labels: z
|
|
411
411
|
}),
|
|
412
|
-
|
|
412
|
+
e.domain ? /* @__PURE__ */ d("span", { children: z.domain[e.domain] ?? e.domain }) : null,
|
|
413
413
|
_ && !c ? /* @__PURE__ */ d(C, { label: z.unread }) : null,
|
|
414
|
-
c ? /* @__PURE__ */ d(
|
|
414
|
+
c ? /* @__PURE__ */ d(a, {
|
|
415
415
|
tone: "pro",
|
|
416
416
|
size: "sm",
|
|
417
|
-
icon: /* @__PURE__ */ d(
|
|
417
|
+
icon: /* @__PURE__ */ d(i, {}),
|
|
418
418
|
children: z.locked
|
|
419
419
|
}) : null,
|
|
420
420
|
y
|
|
@@ -427,10 +427,10 @@ function M({ insight: t, locale: a, labels: o, timeZone: s = "America/Sao_Paulo"
|
|
|
427
427
|
className: "select-insight__lead",
|
|
428
428
|
children: [/* @__PURE__ */ d("h3", {
|
|
429
429
|
className: "select-insight__title",
|
|
430
|
-
children:
|
|
430
|
+
children: e.title
|
|
431
431
|
}), /* @__PURE__ */ d("p", {
|
|
432
432
|
className: "select-insight__summary",
|
|
433
|
-
children:
|
|
433
|
+
children: e.summary
|
|
434
434
|
})]
|
|
435
435
|
});
|
|
436
436
|
if (c) return /* @__PURE__ */ f("article", {
|
|
@@ -438,7 +438,7 @@ function M({ insight: t, locale: a, labels: o, timeZone: s = "America/Sao_Paulo"
|
|
|
438
438
|
children: [
|
|
439
439
|
U,
|
|
440
440
|
W,
|
|
441
|
-
|
|
441
|
+
e.impact ? /* @__PURE__ */ f("div", {
|
|
442
442
|
className: "select-insight__stake",
|
|
443
443
|
children: [
|
|
444
444
|
/* @__PURE__ */ d("span", {
|
|
@@ -447,7 +447,7 @@ function M({ insight: t, locale: a, labels: o, timeZone: s = "America/Sao_Paulo"
|
|
|
447
447
|
}),
|
|
448
448
|
/* @__PURE__ */ d("strong", {
|
|
449
449
|
className: "select-insight__stakevalue",
|
|
450
|
-
children: v(
|
|
450
|
+
children: v(e.impact, R, z)
|
|
451
451
|
}),
|
|
452
452
|
/* @__PURE__ */ d("span", {
|
|
453
453
|
className: "select-insight__stakenote",
|
|
@@ -542,16 +542,16 @@ function M({ insight: t, locale: a, labels: o, timeZone: s = "America/Sao_Paulo"
|
|
|
542
542
|
children: T
|
|
543
543
|
}) : null]
|
|
544
544
|
})
|
|
545
|
-
}) : null, ae = V.filter((e) => e.type === "metric"), Y =
|
|
545
|
+
}) : null, ae = V.filter((e) => e.type === "metric"), Y = e.impact ? ae.find((e) => e.value.type === "money") : void 0, X = V.filter((e) => e.type === "metric" && e !== Y || e.type === "comparison"), Z = V.filter((e) => e.type === "items" || e.type === "table" || e.type === "text"), oe = e.impact != null || X.length > 0 || Z.length > 0 || M != null ? /* @__PURE__ */ f("div", {
|
|
546
546
|
className: "select-insight__group",
|
|
547
547
|
children: [
|
|
548
548
|
/* @__PURE__ */ d("h4", {
|
|
549
549
|
className: "select-insight__grouptitle",
|
|
550
550
|
children: z.evidence
|
|
551
551
|
}),
|
|
552
|
-
|
|
552
|
+
e.impact != null || X.length > 0 ? /* @__PURE__ */ f("div", {
|
|
553
553
|
className: "select-insight__tiles",
|
|
554
|
-
children: [
|
|
554
|
+
children: [e.impact ? /* @__PURE__ */ f("div", {
|
|
555
555
|
className: "select-insight__tile select-insight__tile--impact",
|
|
556
556
|
children: [
|
|
557
557
|
/* @__PURE__ */ d("div", {
|
|
@@ -560,7 +560,7 @@ function M({ insight: t, locale: a, labels: o, timeZone: s = "America/Sao_Paulo"
|
|
|
560
560
|
}),
|
|
561
561
|
/* @__PURE__ */ d("div", {
|
|
562
562
|
className: "select-insight__tilevalue",
|
|
563
|
-
children: v(
|
|
563
|
+
children: v(e.impact, R, z)
|
|
564
564
|
}),
|
|
565
565
|
/* @__PURE__ */ d("div", {
|
|
566
566
|
className: "select-insight__tilenote",
|
|
@@ -608,12 +608,12 @@ function M({ insight: t, locale: a, labels: o, timeZone: s = "America/Sao_Paulo"
|
|
|
608
608
|
renderItem: P
|
|
609
609
|
}, t) : e.type === "table" ? /* @__PURE__ */ d(A, { block: e }, t) : e.type === "text" ? /* @__PURE__ */ f("div", {
|
|
610
610
|
className: "select-insight__text",
|
|
611
|
-
children: [/* @__PURE__ */ d(
|
|
611
|
+
children: [/* @__PURE__ */ d(r, {}), /* @__PURE__ */ d("span", { children: e.text })]
|
|
612
612
|
}, t) : null)
|
|
613
613
|
]
|
|
614
614
|
}) : null, Q = [
|
|
615
|
-
|
|
616
|
-
|
|
615
|
+
e.confidence ? z.confidence[e.confidence] ?? e.confidence : null,
|
|
616
|
+
e.sampleLabel ? e.sampleLabel : e.sampleSize == null ? null : z.sample(e.sampleSize.toLocaleString(R)),
|
|
617
617
|
ne
|
|
618
618
|
].filter((e) => !!e), $ = /* @__PURE__ */ f("span", {
|
|
619
619
|
className: "select-insight__methodhead",
|
|
@@ -624,13 +624,13 @@ function M({ insight: t, locale: a, labels: o, timeZone: s = "America/Sao_Paulo"
|
|
|
624
624
|
className: "select-insight__methodsub",
|
|
625
625
|
children: Q.join(" · ")
|
|
626
626
|
}) : null]
|
|
627
|
-
}), se =
|
|
627
|
+
}), se = e.methodology ? /* @__PURE__ */ d(l, {
|
|
628
628
|
title: $,
|
|
629
629
|
defaultOpen: ee,
|
|
630
630
|
className: "select-insight__method",
|
|
631
631
|
children: /* @__PURE__ */ d("p", {
|
|
632
632
|
className: "select-insight__methodtext",
|
|
633
|
-
children:
|
|
633
|
+
children: e.methodology
|
|
634
634
|
})
|
|
635
635
|
}) : Q.length ? /* @__PURE__ */ d("div", {
|
|
636
636
|
className: "select-insight__method select-insight__method--static",
|
|
@@ -653,7 +653,7 @@ function M({ insight: t, locale: a, labels: o, timeZone: s = "America/Sao_Paulo"
|
|
|
653
653
|
className: "select-insight__outcomeside",
|
|
654
654
|
children: [/* @__PURE__ */ d("span", { children: N.before.label }), /* @__PURE__ */ d("strong", { children: N.before.value })]
|
|
655
655
|
}) : null,
|
|
656
|
-
N.before && N.after ? /* @__PURE__ */ d(
|
|
656
|
+
N.before && N.after ? /* @__PURE__ */ d(t, {}) : null,
|
|
657
657
|
N.after ? /* @__PURE__ */ f("span", {
|
|
658
658
|
className: "select-insight__outcomeside",
|
|
659
659
|
children: [/* @__PURE__ */ d("span", { children: N.after.label }), /* @__PURE__ */ d("strong", { children: N.after.value })]
|
|
@@ -696,16 +696,16 @@ function N({ layout: e = "rows", children: t, className: n, ...r }) {
|
|
|
696
696
|
children: t
|
|
697
697
|
});
|
|
698
698
|
}
|
|
699
|
-
function P({ insight:
|
|
700
|
-
let { lang: w, labels: T } = h(
|
|
699
|
+
function P({ insight: t, locale: r, labels: a, index: o, locked: s = !1, unread: c = !1, selected: l = !1, layout: p = "row", cta: m, badge: g, href: v, onClick: y, className: b, ...x }) {
|
|
700
|
+
let { lang: w, labels: T } = h(r, a), E = t.domain ? T.domain[t.domain] ?? t.domain : null, D = t.impact ? _(t.impact.maxCents, t.impact.currency, w) : null, O = t.impact && t.impact.minCents === t.impact.maxCents ? T.about("").trim() : T.upTo, k = p === "card", A = "select-insightrow" + (k ? " select-insightrow--card" : "") + (l ? " is-selected" : "") + (s ? " select-insightrow--locked" : "") + (b ? " " + b : ""), j = s ? /* @__PURE__ */ d("span", {
|
|
701
701
|
className: "select-insightrow__index select-insightrow__index--lock",
|
|
702
702
|
"aria-hidden": "true",
|
|
703
|
-
children: /* @__PURE__ */ d(
|
|
703
|
+
children: /* @__PURE__ */ d(i, {})
|
|
704
704
|
}) : o == null ? null : /* @__PURE__ */ d("span", {
|
|
705
705
|
className: `select-insightrow__index${l || k && o === 1 ? " select-insightrow__index--strong" : ""}`,
|
|
706
706
|
children: o
|
|
707
707
|
}), M = /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d(S, {
|
|
708
|
-
severity:
|
|
708
|
+
severity: t.severity,
|
|
709
709
|
labels: T
|
|
710
710
|
}), E && !s ? /* @__PURE__ */ d("span", { children: E }) : null] }), N = c && !s ? /* @__PURE__ */ d(C, { label: T.unread }) : null, P = k ? /* @__PURE__ */ f(u, { children: [
|
|
711
711
|
/* @__PURE__ */ f("span", {
|
|
@@ -722,7 +722,7 @@ function P({ insight: e, locale: n, labels: i, index: o, locked: s = !1, unread:
|
|
|
722
722
|
}),
|
|
723
723
|
/* @__PURE__ */ d("span", {
|
|
724
724
|
className: "select-insightrow__title",
|
|
725
|
-
children:
|
|
725
|
+
children: t.title
|
|
726
726
|
}),
|
|
727
727
|
D || m ? /* @__PURE__ */ f("span", {
|
|
728
728
|
className: "select-insightrow__foot",
|
|
@@ -735,7 +735,7 @@ function P({ insight: e, locale: n, labels: i, index: o, locked: s = !1, unread:
|
|
|
735
735
|
]
|
|
736
736
|
}) : null, m ? /* @__PURE__ */ f("span", {
|
|
737
737
|
className: "select-insightrow__cta",
|
|
738
|
-
children: [m, /* @__PURE__ */ d(
|
|
738
|
+
children: [m, /* @__PURE__ */ d(n, {})]
|
|
739
739
|
}) : null]
|
|
740
740
|
}) : null
|
|
741
741
|
] }) : /* @__PURE__ */ f(u, { children: [
|
|
@@ -744,7 +744,7 @@ function P({ insight: e, locale: n, labels: i, index: o, locked: s = !1, unread:
|
|
|
744
744
|
className: "select-insightrow__text",
|
|
745
745
|
children: [/* @__PURE__ */ d("span", {
|
|
746
746
|
className: "select-insightrow__title",
|
|
747
|
-
children:
|
|
747
|
+
children: t.title
|
|
748
748
|
}), /* @__PURE__ */ f("span", {
|
|
749
749
|
className: "select-insightrow__meta",
|
|
750
750
|
children: [
|
|
@@ -758,7 +758,7 @@ function P({ insight: e, locale: n, labels: i, index: o, locked: s = !1, unread:
|
|
|
758
758
|
className: "select-insightrow__impact",
|
|
759
759
|
children: [/* @__PURE__ */ d("small", { children: O }), /* @__PURE__ */ d("strong", { children: D })]
|
|
760
760
|
}) : null
|
|
761
|
-
] }), F =
|
|
761
|
+
] }), F = e(v);
|
|
762
762
|
return !F && !y ? /* @__PURE__ */ d("div", {
|
|
763
763
|
className: A,
|
|
764
764
|
children: P
|
package/dist/SelectListCard.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { safeHref as e } from "./internal/safeHref.js";
|
|
2
|
+
import { SelectInfoTip as t } from "./SelectInfoTip.js";
|
|
3
3
|
import { forwardRef as n } from "react";
|
|
4
4
|
import { Fragment as r, jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
5
5
|
//#region src/SelectListCard.tsx
|
|
6
|
-
var o = n(function({ title:
|
|
6
|
+
var o = n(function({ title: e, help: n, description: r, headerAction: o, footer: s, dense: c = !1, spread: l = !1, flush: u = !1, children: d, className: f, ...p }, m) {
|
|
7
7
|
return /* @__PURE__ */ a("div", {
|
|
8
8
|
ref: m,
|
|
9
9
|
...p,
|
|
10
10
|
className: `select-listcard${c ? " select-listcard--dense" : ""}${l ? " select-listcard--spread" : ""}${u ? " select-listcard--flush" : ""}${f ? " " + f : ""}`,
|
|
11
11
|
children: [
|
|
12
|
-
(
|
|
12
|
+
(e || o) && /* @__PURE__ */ a("div", {
|
|
13
13
|
className: "select-listcard__head",
|
|
14
14
|
children: [/* @__PURE__ */ a("div", {
|
|
15
15
|
className: "select-listcard__heading",
|
|
16
|
-
children: [
|
|
16
|
+
children: [e && /* @__PURE__ */ a("h3", {
|
|
17
17
|
className: `select-listcard__title${n == null ? "" : " select-listcard__title--help"}`,
|
|
18
|
-
children: [
|
|
18
|
+
children: [e, n != null && /* @__PURE__ */ i(t, { content: n })]
|
|
19
19
|
}), r && /* @__PURE__ */ i("p", {
|
|
20
20
|
className: "select-listcard__desc",
|
|
21
21
|
children: r
|
|
@@ -39,12 +39,12 @@ var o = n(function({ title: t, help: n, description: r, headerAction: o, footer:
|
|
|
39
39
|
]
|
|
40
40
|
});
|
|
41
41
|
});
|
|
42
|
-
function s({ media:
|
|
42
|
+
function s({ media: t, mediaSize: n = "icon", title: o, secondary: s, action: c, muted: l = !1, wrap: u = !1, onClick: d, href: f }) {
|
|
43
43
|
let p = /* @__PURE__ */ a(r, { children: [
|
|
44
|
-
|
|
44
|
+
t && /* @__PURE__ */ i("span", {
|
|
45
45
|
className: `select-listrow__media${n === "auto" ? " select-listrow__media--auto" : ""}`,
|
|
46
46
|
"aria-hidden": "true",
|
|
47
|
-
children:
|
|
47
|
+
children: t
|
|
48
48
|
}),
|
|
49
49
|
/* @__PURE__ */ a("span", {
|
|
50
50
|
className: "select-listrow__text",
|
|
@@ -60,7 +60,7 @@ function s({ media: e, mediaSize: n = "icon", title: o, secondary: s, action: c,
|
|
|
60
60
|
className: "select-listrow__action",
|
|
61
61
|
children: c
|
|
62
62
|
})
|
|
63
|
-
] }), m = `select-listrow${l ? " select-listrow--muted" : ""}${u ? " select-listrow--wrap" : ""}`, h =
|
|
63
|
+
] }), m = `select-listrow${l ? " select-listrow--muted" : ""}${u ? " select-listrow--wrap" : ""}`, h = e(f);
|
|
64
64
|
return h ? /* @__PURE__ */ i("a", {
|
|
65
65
|
className: `${m} select-listrow--clickable`,
|
|
66
66
|
href: h,
|