@selectwin/kit 0.1.199 → 0.1.201
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/SelectDocumentField.d.ts +1 -1
- package/dist/SelectDocumentField.js +5 -1
- package/dist/SelectFeeBreakdown.js +43 -40
- 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/SelectLocale.d.ts +7 -0
- package/dist/SelectLocale.js +14 -2
- package/dist/SelectMenu.js +8 -8
- package/dist/SelectMoney.js +71 -64
- 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/internal/document.d.ts +5 -6
- package/dist/internal/document.js +10 -9
- package/dist/internal/money.d.ts +5 -4
- package/dist/internal/money.js +12 -8
- package/dist/style.css +1 -1
- package/package.json +1 -1
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,
|
package/dist/SelectLocale.d.ts
CHANGED
|
@@ -75,6 +75,13 @@ export interface SelectKitMessages {
|
|
|
75
75
|
sideNav: {
|
|
76
76
|
pending: (hint: string) => string;
|
|
77
77
|
};
|
|
78
|
+
/** 0.1.201: o SelectFeeBreakdown — os rótulos de sempre e a legenda da barra. */
|
|
79
|
+
fees: {
|
|
80
|
+
gross: string;
|
|
81
|
+
net: string;
|
|
82
|
+
fees: string;
|
|
83
|
+
netShort: string;
|
|
84
|
+
};
|
|
78
85
|
}
|
|
79
86
|
/** Os dicionários do kit, para quem quer conferir ou montar um texto do mesmo jeito. */
|
|
80
87
|
export declare const selectKitMessages: Readonly<Record<SelectLocaleCode, SelectKitMessages>>;
|
package/dist/SelectLocale.js
CHANGED
|
@@ -80,7 +80,13 @@ var r = {
|
|
|
80
80
|
progressLabel: "Progresso",
|
|
81
81
|
progress: (e, t) => `${e} de ${t}`
|
|
82
82
|
},
|
|
83
|
-
sideNav: { pending: (e) => `${e} (com pendências)` }
|
|
83
|
+
sideNav: { pending: (e) => `${e} (com pendências)` },
|
|
84
|
+
fees: {
|
|
85
|
+
gross: "Valor bruto",
|
|
86
|
+
net: "Valor líquido",
|
|
87
|
+
fees: "Taxas",
|
|
88
|
+
netShort: "Líquido"
|
|
89
|
+
}
|
|
84
90
|
},
|
|
85
91
|
en: {
|
|
86
92
|
common: {
|
|
@@ -161,7 +167,13 @@ var r = {
|
|
|
161
167
|
progressLabel: "Progress",
|
|
162
168
|
progress: (e, t) => `${e} of ${t}`
|
|
163
169
|
},
|
|
164
|
-
sideNav: { pending: (e) => `${e} (pending)` }
|
|
170
|
+
sideNav: { pending: (e) => `${e} (pending)` },
|
|
171
|
+
fees: {
|
|
172
|
+
gross: "Gross amount",
|
|
173
|
+
net: "Net amount",
|
|
174
|
+
fees: "Fees",
|
|
175
|
+
netShort: "Net"
|
|
176
|
+
}
|
|
165
177
|
}
|
|
166
178
|
}, i = e(null);
|
|
167
179
|
function a({ locale: e, children: t }) {
|
package/dist/SelectMenu.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { safeHref as e } from "./internal/safeHref.js";
|
|
2
|
+
import { ChevronDownIcon as t, ExternalLinkIcon as n } from "./icons.js";
|
|
3
3
|
import { forwardRef as r } from "react";
|
|
4
4
|
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
5
5
|
//#region src/SelectMenu.tsx
|
|
@@ -50,8 +50,8 @@ var c = r(function({ children: e, description: t, icon: n, trailing: r, onClick:
|
|
|
50
50
|
})
|
|
51
51
|
]
|
|
52
52
|
});
|
|
53
|
-
}), l = r(function({ children:
|
|
54
|
-
let h =
|
|
53
|
+
}), l = r(function({ children: t, description: r, href: o, icon: c, trailing: l, external: u, tone: d = "default", className: f, ...p }, m) {
|
|
54
|
+
let h = e(o), g = u ?? /^(https?:|mailto:|tel:)/i.test(h ?? ""), _ = l ?? (g ? /* @__PURE__ */ i(n, {}) : void 0);
|
|
55
55
|
return /* @__PURE__ */ a("a", {
|
|
56
56
|
ref: m,
|
|
57
57
|
...p,
|
|
@@ -67,7 +67,7 @@ var c = r(function({ children: e, description: t, icon: n, trailing: r, onClick:
|
|
|
67
67
|
}),
|
|
68
68
|
/* @__PURE__ */ i(s, {
|
|
69
69
|
description: r,
|
|
70
|
-
children:
|
|
70
|
+
children: t
|
|
71
71
|
}),
|
|
72
72
|
_ && /* @__PURE__ */ i("span", {
|
|
73
73
|
className: "select-menu__trailing",
|
|
@@ -88,7 +88,7 @@ function d() {
|
|
|
88
88
|
role: "separator"
|
|
89
89
|
});
|
|
90
90
|
}
|
|
91
|
-
var f = r(function({ children:
|
|
91
|
+
var f = r(function({ children: e, onClick: n, active: r = !1, className: o, ...s }, c) {
|
|
92
92
|
return /* @__PURE__ */ a("button", {
|
|
93
93
|
ref: c,
|
|
94
94
|
...s,
|
|
@@ -97,10 +97,10 @@ var f = r(function({ children: t, onClick: n, active: r = !1, className: o, ...s
|
|
|
97
97
|
onClick: n,
|
|
98
98
|
"aria-haspopup": "menu",
|
|
99
99
|
"aria-expanded": r,
|
|
100
|
-
children: [/* @__PURE__ */ i("span", { children:
|
|
100
|
+
children: [/* @__PURE__ */ i("span", { children: e }), /* @__PURE__ */ i("span", {
|
|
101
101
|
className: "select-menubtn__caret",
|
|
102
102
|
"aria-hidden": "true",
|
|
103
|
-
children: /* @__PURE__ */ i(
|
|
103
|
+
children: /* @__PURE__ */ i(t, {})
|
|
104
104
|
})]
|
|
105
105
|
});
|
|
106
106
|
});
|
package/dist/SelectMoney.js
CHANGED
|
@@ -1,28 +1,29 @@
|
|
|
1
1
|
/* empty css */
|
|
2
2
|
import { EyeIcon as e, EyeOffIcon as t } from "./icons.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
3
|
+
import { useSelectLocale as n } from "./SelectLocale.js";
|
|
4
|
+
import { SelectIconButton as r } from "./SelectIconButton.js";
|
|
5
|
+
import { centsToBRL as i } from "./internal/money.js";
|
|
6
|
+
import { createContext as a, forwardRef as o, useCallback as s, useContext as c, useEffect as l, useMemo as u, useState as d, useSyncExternalStore as f } from "react";
|
|
7
|
+
import { Fragment as p, jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
7
8
|
//#region src/SelectMoney.tsx
|
|
8
|
-
var
|
|
9
|
+
var g = "sw:hide-money", _ = {
|
|
9
10
|
hidden: !1,
|
|
10
11
|
toggle: () => {},
|
|
11
12
|
setHidden: () => {}
|
|
12
|
-
},
|
|
13
|
-
function
|
|
13
|
+
}, v = a(null);
|
|
14
|
+
function y() {
|
|
14
15
|
try {
|
|
15
|
-
return localStorage.getItem(
|
|
16
|
+
return localStorage.getItem(g) === "1";
|
|
16
17
|
} catch {
|
|
17
18
|
return !1;
|
|
18
19
|
}
|
|
19
20
|
}
|
|
20
|
-
function
|
|
21
|
+
function b(e) {
|
|
21
22
|
try {
|
|
22
|
-
localStorage.setItem(
|
|
23
|
+
localStorage.setItem(g, e ? "1" : "0");
|
|
23
24
|
} catch {}
|
|
24
25
|
}
|
|
25
|
-
function
|
|
26
|
+
function x() {
|
|
26
27
|
let e = 0, t = /* @__PURE__ */ new Set(), n = () => t.forEach((e) => e());
|
|
27
28
|
return {
|
|
28
29
|
mark() {
|
|
@@ -40,16 +41,16 @@ function b() {
|
|
|
40
41
|
present: () => e > 0
|
|
41
42
|
};
|
|
42
43
|
}
|
|
43
|
-
var
|
|
44
|
-
function
|
|
45
|
-
let [t] =
|
|
46
|
-
r(e),
|
|
47
|
-
}, []), a =
|
|
44
|
+
var S = a(null), C = () => () => {}, w = () => !1;
|
|
45
|
+
function T({ children: e }) {
|
|
46
|
+
let [t] = d(x), [n, r] = d(y), i = s((e) => {
|
|
47
|
+
r(e), b(e);
|
|
48
|
+
}, []), a = s(() => {
|
|
48
49
|
r((e) => {
|
|
49
50
|
let t = !e;
|
|
50
|
-
return
|
|
51
|
+
return b(t), t;
|
|
51
52
|
});
|
|
52
|
-
}, []),
|
|
53
|
+
}, []), o = u(() => ({
|
|
53
54
|
hidden: n,
|
|
54
55
|
toggle: a,
|
|
55
56
|
setHidden: i
|
|
@@ -58,28 +59,28 @@ function w({ children: e }) {
|
|
|
58
59
|
a,
|
|
59
60
|
i
|
|
60
61
|
]);
|
|
61
|
-
return /* @__PURE__ */
|
|
62
|
+
return /* @__PURE__ */ m(S.Provider, {
|
|
62
63
|
value: t,
|
|
63
|
-
children: /* @__PURE__ */
|
|
64
|
-
value:
|
|
64
|
+
children: /* @__PURE__ */ m(v.Provider, {
|
|
65
|
+
value: o,
|
|
65
66
|
children: e
|
|
66
67
|
})
|
|
67
68
|
});
|
|
68
69
|
}
|
|
69
|
-
function
|
|
70
|
-
return
|
|
70
|
+
function E() {
|
|
71
|
+
return c(v) ?? _;
|
|
71
72
|
}
|
|
72
|
-
function
|
|
73
|
-
let t =
|
|
74
|
-
|
|
73
|
+
function D(e = !0) {
|
|
74
|
+
let t = c(S);
|
|
75
|
+
l(() => e && t ? t.mark() : void 0, [t, e]);
|
|
75
76
|
}
|
|
76
|
-
function
|
|
77
|
-
let e =
|
|
78
|
-
return
|
|
77
|
+
function O() {
|
|
78
|
+
let e = c(S);
|
|
79
|
+
return f(e ? e.subscribe : C, e ? e.present : w, w);
|
|
79
80
|
}
|
|
80
|
-
var
|
|
81
|
-
let { hidden: a } =
|
|
82
|
-
return
|
|
81
|
+
var k = o(function({ children: e, label: t = "valor oculto", className: n, ...r }, i) {
|
|
82
|
+
let { hidden: a } = E();
|
|
83
|
+
return D(), /* @__PURE__ */ m("span", {
|
|
83
84
|
ref: i,
|
|
84
85
|
...r,
|
|
85
86
|
className: `select-sensitive${a ? " select-sensitive--hidden" : ""}${n ? " " + n : ""}`,
|
|
@@ -87,50 +88,56 @@ var O = a(function({ children: e, label: t = "valor oculto", className: n, ...r
|
|
|
87
88
|
children: e
|
|
88
89
|
});
|
|
89
90
|
});
|
|
90
|
-
function
|
|
91
|
-
let
|
|
92
|
-
return
|
|
91
|
+
function A({ cents: e, sensitive: t = !0 }) {
|
|
92
|
+
let r = i(e, n());
|
|
93
|
+
return m(t ? k : p, { children: r });
|
|
93
94
|
}
|
|
94
|
-
var
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
95
|
+
var j = /* @__PURE__ */ new Map();
|
|
96
|
+
function M(e) {
|
|
97
|
+
let t = j.get(e);
|
|
98
|
+
return t || (t = new Intl.NumberFormat(e === "en" ? "en-US" : "pt-BR", {
|
|
99
|
+
signDisplay: "exceptZero",
|
|
100
|
+
minimumFractionDigits: 1,
|
|
101
|
+
maximumFractionDigits: 1
|
|
102
|
+
}), j.set(e, t)), t;
|
|
103
|
+
}
|
|
104
|
+
var N = o(function({ value: e, invert: t = !1, caption: r, unit: i = "percent", className: a, ...o }, s) {
|
|
105
|
+
let c = n();
|
|
106
|
+
if (e == null || !Number.isFinite(e)) return /* @__PURE__ */ h("span", {
|
|
107
|
+
ref: s,
|
|
108
|
+
...o,
|
|
109
|
+
className: `select-delta select-delta--muted${a ? " " + a : ""}`,
|
|
110
|
+
children: ["—", r ? ` ${r}` : ""]
|
|
104
111
|
});
|
|
105
|
-
let
|
|
106
|
-
return /* @__PURE__ */
|
|
107
|
-
ref:
|
|
108
|
-
...
|
|
109
|
-
className: `select-delta${
|
|
110
|
-
children: [/* @__PURE__ */
|
|
111
|
-
className: `select-delta__value select-delta__value--${
|
|
112
|
+
let l = e === 0, u = e > 0, d = l ? null : t ? !u : u, f = d == null ? "muted" : d ? "up" : "down", p = l ? "" : u ? "▲" : "▼";
|
|
113
|
+
return /* @__PURE__ */ h("span", {
|
|
114
|
+
ref: s,
|
|
115
|
+
...o,
|
|
116
|
+
className: `select-delta${a ? " " + a : ""}`,
|
|
117
|
+
children: [/* @__PURE__ */ h("span", {
|
|
118
|
+
className: `select-delta__value select-delta__value--${f}`,
|
|
112
119
|
children: [
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
120
|
+
p ? `${p} ` : "",
|
|
121
|
+
M(c).format(e),
|
|
122
|
+
i === "points" ? c === "en" ? " pp" : " p.p." : "%"
|
|
116
123
|
]
|
|
117
|
-
}),
|
|
124
|
+
}), r != null && /* @__PURE__ */ m("span", {
|
|
118
125
|
className: "select-delta__caption",
|
|
119
|
-
children:
|
|
126
|
+
children: r
|
|
120
127
|
})]
|
|
121
128
|
});
|
|
122
129
|
});
|
|
123
|
-
function
|
|
124
|
-
let { hidden:
|
|
125
|
-
return /* @__PURE__ */
|
|
130
|
+
function P() {
|
|
131
|
+
let { hidden: n, toggle: i } = E();
|
|
132
|
+
return /* @__PURE__ */ m(r, {
|
|
126
133
|
variant: "outline",
|
|
127
|
-
icon:
|
|
128
|
-
label:
|
|
129
|
-
active:
|
|
134
|
+
icon: m(n ? t : e, {}),
|
|
135
|
+
label: n ? "Mostrar valores" : "Ocultar valores",
|
|
136
|
+
active: n,
|
|
130
137
|
onClick: i
|
|
131
138
|
});
|
|
132
139
|
}
|
|
133
140
|
//#endregion
|
|
134
|
-
export {
|
|
141
|
+
export { P as SelectHideMoneyToggle, N as SelectMetricDelta, A as SelectMoney, k as SelectSensitiveValue, T as SelectValueVisibilityProvider, O as useSelectHasSensitiveValues, D as useSelectSensitiveValueMark, E as useSelectValueVisibility };
|
|
135
142
|
|
|
136
143
|
//# sourceMappingURL=SelectMoney.js.map
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { safeHref as e } from "./internal/safeHref.js";
|
|
2
|
+
import { ExternalLinkIcon as t, MobileIcon as n, MonitorIcon as r, RefreshIcon as i } from "./icons.js";
|
|
3
|
+
import { SelectIconButton as a } from "./SelectIconButton.js";
|
|
4
4
|
import { SelectLoader as o } from "./SelectLoader.js";
|
|
5
5
|
import { forwardRef as s, useLayoutEffect as c, useRef as l, useState as u } from "react";
|
|
6
6
|
import { Fragment as d, jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
7
7
|
//#region src/SelectPreviewFrame.tsx
|
|
8
8
|
var m = "allow-scripts allow-same-origin allow-forms", h = 390, g = 1280, _ = s(function({ src: s, sandbox: _ = m, title: v = "Pré-visualização", height: y = 560, fill: b = !1, initialDevice: x = "desktop", showDeviceToggle: S = !0, openLabel: C = "Abrir em nova aba", emptyLabel: w = "Salve para gerar a pré-visualização.", onReload: T, notice: E, iframeRef: D, desktopWidth: O = g, className: k, ...A }, j) {
|
|
9
|
-
let M =
|
|
9
|
+
let M = e(s), [N, P] = u(x), [F, I] = u(0), [L, R] = u(!0), z = l(null), [B, V] = u({
|
|
10
10
|
w: 0,
|
|
11
11
|
h: 0
|
|
12
12
|
});
|
|
@@ -48,22 +48,22 @@ var m = "allow-scripts allow-same-origin allow-forms", h = 390, g = 1280, _ = s(
|
|
|
48
48
|
/* @__PURE__ */ p("div", {
|
|
49
49
|
className: "select-preview__actions",
|
|
50
50
|
children: [
|
|
51
|
-
S && /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ f(
|
|
51
|
+
S && /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ f(a, {
|
|
52
52
|
size: "sm",
|
|
53
|
-
icon: /* @__PURE__ */ f(
|
|
53
|
+
icon: /* @__PURE__ */ f(r, {}),
|
|
54
54
|
label: "Ver no computador",
|
|
55
55
|
active: N === "desktop",
|
|
56
56
|
onClick: () => P("desktop")
|
|
57
|
-
}), /* @__PURE__ */ f(
|
|
57
|
+
}), /* @__PURE__ */ f(a, {
|
|
58
58
|
size: "sm",
|
|
59
|
-
icon: /* @__PURE__ */ f(
|
|
59
|
+
icon: /* @__PURE__ */ f(n, {}),
|
|
60
60
|
label: "Ver no celular",
|
|
61
61
|
active: N === "mobile",
|
|
62
62
|
onClick: () => P("mobile")
|
|
63
63
|
})] }),
|
|
64
|
-
/* @__PURE__ */ f(
|
|
64
|
+
/* @__PURE__ */ f(a, {
|
|
65
65
|
size: "sm",
|
|
66
|
-
icon: /* @__PURE__ */ f(
|
|
66
|
+
icon: /* @__PURE__ */ f(i, {}),
|
|
67
67
|
label: "Recarregar",
|
|
68
68
|
onClick: G,
|
|
69
69
|
disabled: !M
|
|
@@ -75,7 +75,7 @@ var m = "allow-scripts allow-same-origin allow-forms", h = 390, g = 1280, _ = s(
|
|
|
75
75
|
rel: "noreferrer",
|
|
76
76
|
"aria-label": C,
|
|
77
77
|
title: C,
|
|
78
|
-
children: /* @__PURE__ */ f(
|
|
78
|
+
children: /* @__PURE__ */ f(t, {})
|
|
79
79
|
})
|
|
80
80
|
]
|
|
81
81
|
})
|