@rojaostudio/ds 1.0.0 → 1.0.2
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/components/accordion.js +43 -37
- package/dist/components/alert.js +35 -28
- package/dist/components/avatar.js +41 -34
- package/dist/components/badge.js +21 -14
- package/dist/components/blocker-card.js +11 -2
- package/dist/components/bottom-sheet.js +60 -53
- package/dist/components/breadcrumb.js +32 -22
- package/dist/components/button.js +18 -11
- package/dist/components/card.js +24 -9
- package/dist/components/chat-bubble.js +6 -5
- package/dist/components/checkbox.js +61 -48
- package/dist/components/chip-input.js +98 -81
- package/dist/components/chips.js +36 -29
- package/dist/components/choice-card.js +48 -42
- package/dist/components/choice-carousel.js +79 -74
- package/dist/components/choice-preview-card.js +17 -6
- package/dist/components/color-input.js +41 -35
- package/dist/components/combobox.js +97 -75
- package/dist/components/context-menu.js +17 -13
- package/dist/components/copilot-hint.js +40 -31
- package/dist/components/copy-field.js +8 -5
- package/dist/components/currency-input.js +40 -32
- package/dist/components/danger-zone.js +19 -9
- package/dist/components/data-table-header.js +185 -135
- package/dist/components/date-picker.js +114 -95
- package/dist/components/divider.js +11 -8
- package/dist/components/drawer.js +40 -28
- package/dist/components/dropzone.js +23 -20
- package/dist/components/empty-state.js +26 -23
- package/dist/components/fab.js +38 -26
- package/dist/components/filter-chip.js +20 -16
- package/dist/components/floating-stepper.js +42 -32
- package/dist/components/form-card-header.js +9 -1
- package/dist/components/icon-button.js +19 -13
- package/dist/components/image-crop-modal.js +69 -48
- package/dist/components/image-upload.js +172 -128
- package/dist/components/input.js +90 -62
- package/dist/components/insight-card.js +12 -1
- package/dist/components/label.js +12 -7
- package/dist/components/media-tile.js +11 -8
- package/dist/components/menu.js +28 -25
- package/dist/components/modal.js +43 -28
- package/dist/components/notice.js +34 -16
- package/dist/components/option-tile.js +55 -49
- package/dist/components/page-shell.js +13 -6
- package/dist/components/page-skeleton.js +32 -2
- package/dist/components/page-tabs.js +39 -26
- package/dist/components/pagination.js +38 -33
- package/dist/components/paywall-banner.js +19 -3
- package/dist/components/paywall.js +18 -8
- package/dist/components/phone-frame.js +5 -4
- package/dist/components/phone-input.js +50 -31
- package/dist/components/pix-icon.js +11 -6
- package/dist/components/popover.js +27 -23
- package/dist/components/pricing-card.js +16 -1
- package/dist/components/qr-display.js +16 -11
- package/dist/components/radio.js +73 -56
- package/dist/components/row-actions.js +61 -53
- package/dist/components/saving-bar-context.js +35 -29
- package/dist/components/saving-bar.js +36 -33
- package/dist/components/search.js +49 -44
- package/dist/components/section-card.js +43 -35
- package/dist/components/section-header.js +11 -1
- package/dist/components/select.js +83 -62
- package/dist/components/selectable-card.js +10 -3
- package/dist/components/setting-row.js +11 -1
- package/dist/components/settings-list.js +9 -5
- package/dist/components/skeleton.js +6 -5
- package/dist/components/slider.js +52 -38
- package/dist/components/spinner.js +18 -12
- package/dist/components/step-progress.js +11 -10
- package/dist/components/summary-bar.js +33 -28
- package/dist/components/table.js +20 -15
- package/dist/components/textarea.js +40 -24
- package/dist/components/themed.d.ts +1 -1
- package/dist/components/themed.js +2 -1
- package/dist/components/time-picker.js +117 -97
- package/dist/components/toaster.js +80 -74
- package/dist/components/toggle-card-compact.js +79 -71
- package/dist/components/toggle-card.js +61 -53
- package/dist/components/toggle-group.js +35 -29
- package/dist/components/toggle.js +46 -36
- package/dist/components/tooltip.js +30 -25
- package/dist/components/typing-indicator.js +10 -7
- package/dist/targets/native/components/accordion.js +31 -25
- package/dist/targets/native/components/alert.js +22 -16
- package/dist/targets/native/components/avatar.js +36 -29
- package/dist/targets/native/components/badge.js +4 -3
- package/dist/targets/native/components/button.js +11 -4
- package/dist/targets/native/components/card.js +2 -1
- package/dist/targets/native/components/checkbox.js +18 -15
- package/dist/targets/native/components/chips.js +19 -16
- package/dist/targets/native/components/choice-card.js +29 -23
- package/dist/targets/native/components/context-menu.js +13 -9
- package/dist/targets/native/components/currency-input.js +28 -25
- package/dist/targets/native/components/danger-zone.js +10 -4
- package/dist/targets/native/components/date-picker.js +86 -70
- package/dist/targets/native/components/divider.js +3 -2
- package/dist/targets/native/components/empty-state.js +6 -1
- package/dist/targets/native/components/fab.js +32 -26
- package/dist/targets/native/components/filter-chip.js +9 -8
- package/dist/targets/native/components/form-field.js +20 -10
- package/dist/targets/native/components/form-screen.js +50 -45
- package/dist/targets/native/components/google-icon.js +31 -25
- package/dist/targets/native/components/icon-button.js +6 -4
- package/dist/targets/native/components/icon.js +2 -1
- package/dist/targets/native/components/image-upload.js +59 -50
- package/dist/targets/native/components/input.js +41 -34
- package/dist/targets/native/components/list-item.js +29 -23
- package/dist/targets/native/components/menu.js +12 -10
- package/dist/targets/native/components/modal.js +41 -32
- package/dist/targets/native/components/paywall-banner.js +13 -4
- package/dist/targets/native/components/paywall.js +11 -1
- package/dist/targets/native/components/radio.js +19 -16
- package/dist/targets/native/components/search.js +41 -38
- package/dist/targets/native/components/select.js +71 -63
- package/dist/targets/native/components/sheet.js +36 -30
- package/dist/targets/native/components/skeleton.js +6 -5
- package/dist/targets/native/components/slider.js +51 -43
- package/dist/targets/native/components/spinner.js +2 -1
- package/dist/targets/native/components/stepper.js +14 -9
- package/dist/targets/native/components/switch.js +15 -14
- package/dist/targets/native/components/text.js +2 -1
- package/dist/targets/native/components/textarea.js +2 -1
- package/dist/targets/native/components/theme.js +2 -1
- package/dist/targets/native/components/toaster.js +24 -21
- package/dist/targets/native/index.d.ts +1 -1
- package/dist/targets/native/index.js +1 -3
- package/package.json +190 -194
- package/styles/base.css +3 -3
- package/brand/rojao-black-on-white.png +0 -0
- package/brand/rojao-black.png +0 -0
- package/brand/rojao-white-on-black.png +0 -0
- package/brand/rojao-white.png +0 -0
|
@@ -3,6 +3,7 @@ import {
|
|
|
3
3
|
__spreadProps,
|
|
4
4
|
__spreadValues
|
|
5
5
|
} from "../chunk-ORMEWXMH.js";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
7
|
import {
|
|
7
8
|
createContext,
|
|
8
9
|
useCallback,
|
|
@@ -39,7 +40,7 @@ function SavingBarProvider({ children }) {
|
|
|
39
40
|
});
|
|
40
41
|
}, []);
|
|
41
42
|
const value = useMemo(() => ({ bars, register, unregister }), [bars, register, unregister]);
|
|
42
|
-
return /* @__PURE__ */
|
|
43
|
+
return /* @__PURE__ */ jsx(SavingBarContext.Provider, { value, children });
|
|
43
44
|
}
|
|
44
45
|
function usePageSavingBar(reg, deps = []) {
|
|
45
46
|
const id = useId();
|
|
@@ -88,34 +89,39 @@ function SavingBarRoot() {
|
|
|
88
89
|
const onSave = single ? single.onSave : saveAll;
|
|
89
90
|
const onDiscard = single ? single.onDiscard : discardAll;
|
|
90
91
|
const secondary = single == null ? void 0 : single.secondary;
|
|
91
|
-
return /* @__PURE__ */
|
|
92
|
-
"
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
92
|
+
return /* @__PURE__ */ jsx("div", { className: "fixed bottom-3 right-6 z-50 transition-all duration-300 ease-out", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3 rounded-(--radius-card) px-4 py-3 [background:var(--saving-bar-bg)] [box-shadow:var(--saving-bar-shadow)]", children: [
|
|
93
|
+
message && /* @__PURE__ */ jsx("span", { className: "text-label pr-1 [color:var(--saving-bar-message)]", children: message }),
|
|
94
|
+
onDiscard && /* @__PURE__ */ jsx(
|
|
95
|
+
"button",
|
|
96
|
+
{
|
|
97
|
+
type: "button",
|
|
98
|
+
onClick: onDiscard,
|
|
99
|
+
disabled: anyPending,
|
|
100
|
+
className: "rounded-(--radius-card) border px-3 py-1.5 text-label font-medium transition-colors disabled:opacity-40 [border-color:var(--saving-bar-discard-border)] [color:var(--saving-bar-discard-text)] hover:[border-color:var(--saving-bar-discard-border-hover)] hover:[color:var(--saving-bar-discard-text-hover)]",
|
|
101
|
+
children: discardLabel
|
|
102
|
+
}
|
|
103
|
+
),
|
|
104
|
+
secondary && /* @__PURE__ */ jsx(
|
|
105
|
+
"button",
|
|
106
|
+
{
|
|
107
|
+
type: "button",
|
|
108
|
+
onClick: secondary.onClick,
|
|
109
|
+
disabled: anyPending,
|
|
110
|
+
className: "rounded-(--radius-card) border px-3 py-1.5 text-label font-medium transition-colors disabled:opacity-40 [border-color:var(--saving-bar-discard-border)] [color:var(--saving-bar-discard-text)] hover:[border-color:var(--saving-bar-discard-border-hover)] hover:[color:var(--saving-bar-discard-text-hover)]",
|
|
111
|
+
children: secondary.label
|
|
112
|
+
}
|
|
113
|
+
),
|
|
114
|
+
onSave && /* @__PURE__ */ jsx(
|
|
115
|
+
"button",
|
|
116
|
+
{
|
|
117
|
+
type: "button",
|
|
118
|
+
onClick: () => onSave(),
|
|
119
|
+
disabled: anyPending,
|
|
120
|
+
className: "rounded-(--radius-card) px-4 py-1.5 text-label font-medium transition-colors disabled:opacity-50 flex items-center gap-2 min-w-[80px] justify-center [background:var(--saving-bar-save-bg)] [color:var(--saving-bar-save-text)] hover:[background:var(--saving-bar-save-bg-hover)]",
|
|
121
|
+
children: anyPending ? /* @__PURE__ */ jsx(Loader2, { className: "w-4 h-4 animate-spin" }) : saveLabel
|
|
122
|
+
}
|
|
123
|
+
)
|
|
124
|
+
] }) });
|
|
119
125
|
}
|
|
120
126
|
export {
|
|
121
127
|
SavingBarProvider,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import "../chunk-ORMEWXMH.js";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
4
|
import { Loader2 } from "lucide-react";
|
|
4
5
|
function SavingBar({
|
|
5
6
|
visible,
|
|
@@ -12,59 +13,61 @@ function SavingBar({
|
|
|
12
13
|
children,
|
|
13
14
|
variant = "floating"
|
|
14
15
|
}) {
|
|
15
|
-
const pill = /* @__PURE__ */
|
|
16
|
+
const pill = /* @__PURE__ */ jsxs(
|
|
16
17
|
"div",
|
|
17
18
|
{
|
|
18
19
|
className: [
|
|
19
20
|
"flex items-center gap-3 rounded-(--radius-card) px-4 py-3",
|
|
20
21
|
"[background:var(--saving-bar-bg)]",
|
|
21
22
|
variant === "floating" ? "[box-shadow:var(--saving-bar-shadow)]" : ""
|
|
22
|
-
].filter(Boolean).join(" ")
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
23
|
+
].filter(Boolean).join(" "),
|
|
24
|
+
children: [
|
|
25
|
+
message && /* @__PURE__ */ jsx("span", { className: "text-label pr-1 [color:var(--saving-bar-message)]", children: message }),
|
|
26
|
+
children,
|
|
27
|
+
onDiscard && /* @__PURE__ */ jsx(
|
|
28
|
+
"button",
|
|
29
|
+
{
|
|
30
|
+
type: "button",
|
|
31
|
+
onClick: onDiscard,
|
|
32
|
+
disabled: pending,
|
|
33
|
+
className: "rounded-(--radius-card) border px-3 py-1.5 text-label font-medium transition-colors disabled:opacity-40 [border-color:var(--saving-bar-discard-border)] [color:var(--saving-bar-discard-text)] hover:[border-color:var(--saving-bar-discard-border-hover)] hover:[color:var(--saving-bar-discard-text-hover)]",
|
|
34
|
+
children: discardLabel
|
|
35
|
+
}
|
|
36
|
+
),
|
|
37
|
+
onSave && /* @__PURE__ */ jsx(
|
|
38
|
+
"button",
|
|
39
|
+
{
|
|
40
|
+
type: "button",
|
|
41
|
+
onClick: onSave,
|
|
42
|
+
disabled: pending,
|
|
43
|
+
className: "rounded-(--radius-card) px-4 py-1.5 text-label font-medium transition-colors disabled:opacity-50 flex items-center gap-2 min-w-[80px] justify-center [background:var(--saving-bar-save-bg)] [color:var(--saving-bar-save-text)] hover:[background:var(--saving-bar-save-bg-hover)]",
|
|
44
|
+
children: pending ? /* @__PURE__ */ jsx(Loader2, { className: "w-4 h-4 animate-spin" }) : saveLabel
|
|
45
|
+
}
|
|
46
|
+
)
|
|
47
|
+
]
|
|
48
|
+
}
|
|
46
49
|
);
|
|
47
50
|
if (variant === "inline") {
|
|
48
|
-
return /* @__PURE__ */
|
|
51
|
+
return /* @__PURE__ */ jsx(
|
|
49
52
|
"div",
|
|
50
53
|
{
|
|
51
54
|
className: [
|
|
52
55
|
"flex justify-end mt-8 transition-all duration-300 ease-out",
|
|
53
56
|
visible ? "opacity-100 pointer-events-auto" : "opacity-0 pointer-events-none"
|
|
54
|
-
].join(" ")
|
|
55
|
-
|
|
56
|
-
|
|
57
|
+
].join(" "),
|
|
58
|
+
children: pill
|
|
59
|
+
}
|
|
57
60
|
);
|
|
58
61
|
}
|
|
59
|
-
return /* @__PURE__ */
|
|
62
|
+
return /* @__PURE__ */ jsx(
|
|
60
63
|
"div",
|
|
61
64
|
{
|
|
62
65
|
className: [
|
|
63
66
|
"fixed bottom-3 right-6 z-50 transition-all duration-300 ease-out",
|
|
64
67
|
visible ? "translate-y-0 opacity-100 pointer-events-auto" : "translate-y-4 opacity-0 pointer-events-none"
|
|
65
|
-
].join(" ")
|
|
66
|
-
|
|
67
|
-
|
|
68
|
+
].join(" "),
|
|
69
|
+
children: pill
|
|
70
|
+
}
|
|
68
71
|
);
|
|
69
72
|
}
|
|
70
73
|
export {
|
|
@@ -3,6 +3,7 @@ import {
|
|
|
3
3
|
__objRest,
|
|
4
4
|
__spreadValues
|
|
5
5
|
} from "../chunk-ORMEWXMH.js";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
7
|
import { forwardRef, useEffect, useRef } from "react";
|
|
7
8
|
import { Search as SearchIcon, X } from "lucide-react";
|
|
8
9
|
const SIZE_CLASS = {
|
|
@@ -31,50 +32,54 @@ const Search = forwardRef(function Search2(_a, ref) {
|
|
|
31
32
|
if (debounceRef.current) clearTimeout(debounceRef.current);
|
|
32
33
|
onClear == null ? void 0 : onClear();
|
|
33
34
|
}
|
|
34
|
-
return /* @__PURE__ */
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
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
|
-
|
|
35
|
+
return /* @__PURE__ */ jsxs("div", { className: ["relative inline-flex", width === "full" ? "w-full" : "w-auto"].join(" "), children: [
|
|
36
|
+
/* @__PURE__ */ jsx(
|
|
37
|
+
SearchIcon,
|
|
38
|
+
{
|
|
39
|
+
size: ICON_SIZE[size],
|
|
40
|
+
className: ["absolute top-1/2 -translate-y-1/2 text-fg-muted pointer-events-none", ICON_POS[size]].join(" ")
|
|
41
|
+
}
|
|
42
|
+
),
|
|
43
|
+
/* @__PURE__ */ jsx(
|
|
44
|
+
"input",
|
|
45
|
+
__spreadValues({
|
|
46
|
+
ref,
|
|
47
|
+
type: "search",
|
|
48
|
+
role: "searchbox",
|
|
49
|
+
value,
|
|
50
|
+
onChange: handleChange,
|
|
51
|
+
onKeyDown: (e) => {
|
|
52
|
+
if (e.key === "Enter") {
|
|
53
|
+
if (debounceRef.current) clearTimeout(debounceRef.current);
|
|
54
|
+
onSearch == null ? void 0 : onSearch(e.target.value);
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
className: [
|
|
58
|
+
"w-full rounded-(--radius-control) bg-surface-default text-fg-primary placeholder:text-fg-placeholder",
|
|
59
|
+
"border border-stroke-control transition-colors outline-none",
|
|
60
|
+
"focus:border-stroke-focus focus:ring-2 focus:ring-stroke-focus/20",
|
|
61
|
+
"[&::-webkit-search-cancel-button]:hidden",
|
|
62
|
+
SIZE_CLASS[size],
|
|
63
|
+
className
|
|
64
|
+
].join(" ")
|
|
65
|
+
}, rest)
|
|
66
|
+
),
|
|
67
|
+
hasValue && /* @__PURE__ */ jsx(
|
|
68
|
+
"button",
|
|
69
|
+
{
|
|
70
|
+
type: "button",
|
|
71
|
+
onClick: handleClear,
|
|
72
|
+
"aria-label": "Limpar busca",
|
|
73
|
+
className: [
|
|
74
|
+
"absolute top-1/2 -translate-y-1/2 inline-flex items-center justify-center",
|
|
75
|
+
"rounded-(--radius-control) text-fg-muted hover:text-fg-primary transition-colors",
|
|
76
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-stroke-focus",
|
|
77
|
+
CLEAR_POS[size]
|
|
78
|
+
].join(" "),
|
|
79
|
+
children: /* @__PURE__ */ jsx(X, { size: ICON_SIZE[size] - 2 })
|
|
80
|
+
}
|
|
81
|
+
)
|
|
82
|
+
] });
|
|
78
83
|
});
|
|
79
84
|
export {
|
|
80
85
|
Search
|
|
@@ -1,47 +1,55 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import "../chunk-ORMEWXMH.js";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
4
|
import { ChevronDown, ChevronRight } from "lucide-react";
|
|
4
5
|
function SectionCard({ label, badge, open, onToggle, children }) {
|
|
5
|
-
return /* @__PURE__ */
|
|
6
|
+
return /* @__PURE__ */ jsxs(
|
|
6
7
|
"div",
|
|
7
8
|
{
|
|
8
9
|
className: [
|
|
9
10
|
"rounded-(--radius-card) overflow-hidden transition-colors border",
|
|
10
11
|
open ? "[border-color:var(--section-card-border-active)]" : "[border-color:var(--section-card-border)]"
|
|
11
|
-
].join(" ")
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
12
|
+
].join(" "),
|
|
13
|
+
children: [
|
|
14
|
+
/* @__PURE__ */ jsxs(
|
|
15
|
+
"button",
|
|
16
|
+
{
|
|
17
|
+
type: "button",
|
|
18
|
+
onClick: onToggle,
|
|
19
|
+
className: [
|
|
20
|
+
"w-full flex items-center justify-between px-4 py-3 text-left transition-colors",
|
|
21
|
+
open ? "[background:var(--section-card-header-bg-active)]" : "hover:[background:var(--section-card-header-bg-hover)]"
|
|
22
|
+
].join(" "),
|
|
23
|
+
children: [
|
|
24
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 min-w-0", children: [
|
|
25
|
+
/* @__PURE__ */ jsx(
|
|
26
|
+
"span",
|
|
27
|
+
{
|
|
28
|
+
className: [
|
|
29
|
+
"text-caption font-semibold uppercase tracking-wide shrink-0",
|
|
30
|
+
open ? "[color:var(--section-card-label-active)]" : "[color:var(--section-card-label)]"
|
|
31
|
+
].join(" "),
|
|
32
|
+
children: label
|
|
33
|
+
}
|
|
34
|
+
),
|
|
35
|
+
badge && /* @__PURE__ */ jsx(
|
|
36
|
+
"span",
|
|
37
|
+
{
|
|
38
|
+
className: [
|
|
39
|
+
"text-caption truncate min-w-0",
|
|
40
|
+
open ? "[color:var(--section-card-badge-active)]" : "[color:var(--section-card-badge)]"
|
|
41
|
+
].join(" "),
|
|
42
|
+
children: badge
|
|
43
|
+
}
|
|
44
|
+
)
|
|
45
|
+
] }),
|
|
46
|
+
open ? /* @__PURE__ */ jsx(ChevronDown, { className: "w-4 h-4 shrink-0 [color:var(--section-card-chevron)]" }) : /* @__PURE__ */ jsx(ChevronRight, { className: "w-4 h-4 shrink-0 [color:var(--section-card-chevron)]" })
|
|
47
|
+
]
|
|
48
|
+
}
|
|
49
|
+
),
|
|
50
|
+
open && /* @__PURE__ */ jsx("div", { className: "px-4 pb-4 pt-4 space-y-4 [border-top:1px_solid_var(--section-card-divider)] [background:var(--surface-default)]", children })
|
|
51
|
+
]
|
|
52
|
+
}
|
|
45
53
|
);
|
|
46
54
|
}
|
|
47
55
|
export {
|
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
import "../chunk-ORMEWXMH.js";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
3
|
function SectionHeader({ eyebrow, number, title, description, action, className = "" }) {
|
|
3
|
-
return /* @__PURE__ */
|
|
4
|
+
return /* @__PURE__ */ jsxs("div", { className: ["mb-6", className].filter(Boolean).join(" "), children: [
|
|
5
|
+
eyebrow && /* @__PURE__ */ jsx("p", { className: "uppercase text-fg-muted mb-1.5 [font-size:var(--font-size-eyebrow)] [font-weight:var(--font-weight-eyebrow)] [letter-spacing:var(--letter-spacing-eyebrow)]", children: number ? `${number} \xB7 ${eyebrow}` : eyebrow }),
|
|
6
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-4", children: [
|
|
7
|
+
/* @__PURE__ */ jsxs("div", { className: "min-w-0", children: [
|
|
8
|
+
/* @__PURE__ */ jsx("h2", { className: "text-body font-semibold text-fg-primary", children: title }),
|
|
9
|
+
description && /* @__PURE__ */ jsx("p", { className: "text-label text-fg-muted mt-1", children: description })
|
|
10
|
+
] }),
|
|
11
|
+
action && /* @__PURE__ */ jsx("div", { className: "shrink-0", children: action })
|
|
12
|
+
] })
|
|
13
|
+
] });
|
|
4
14
|
}
|
|
5
15
|
export {
|
|
6
16
|
SectionHeader
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
__objRest,
|
|
4
|
+
__spreadProps,
|
|
4
5
|
__spreadValues
|
|
5
6
|
} from "../chunk-ORMEWXMH.js";
|
|
7
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
8
|
import {
|
|
7
9
|
Children,
|
|
8
10
|
forwardRef,
|
|
@@ -72,68 +74,87 @@ const Select = forwardRef(function Select2(_a, ref) {
|
|
|
72
74
|
setter == null ? void 0 : setter.call(el, value);
|
|
73
75
|
el.dispatchEvent(new Event("change", { bubbles: true }));
|
|
74
76
|
}
|
|
75
|
-
return /* @__PURE__ */
|
|
76
|
-
"
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
"
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
"
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
selected
|
|
135
|
-
|
|
136
|
-
|
|
77
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1.5 w-full", children: [
|
|
78
|
+
label && /* @__PURE__ */ jsxs("label", { htmlFor: selectId, className: "inline-flex items-center gap-1 text-label font-medium text-fg-primary", children: [
|
|
79
|
+
/* @__PURE__ */ jsx("span", { children: label }),
|
|
80
|
+
required && /* @__PURE__ */ jsx("span", { className: "text-danger", "aria-label": "obrigat\xF3rio", children: "*" }),
|
|
81
|
+
optional && !required && /* @__PURE__ */ jsx("span", { className: "text-fg-muted font-normal", children: "(opcional)" })
|
|
82
|
+
] }),
|
|
83
|
+
/* @__PURE__ */ jsxs("div", { className: "relative", children: [
|
|
84
|
+
/* @__PURE__ */ jsxs(
|
|
85
|
+
"select",
|
|
86
|
+
__spreadProps(__spreadValues({
|
|
87
|
+
ref: setRefs,
|
|
88
|
+
id: selectId,
|
|
89
|
+
required,
|
|
90
|
+
className: [
|
|
91
|
+
"w-full rounded-(--radius-control) appearance-none",
|
|
92
|
+
"bg-surface-default text-fg-primary",
|
|
93
|
+
"border transition-colors outline-none",
|
|
94
|
+
sz.h,
|
|
95
|
+
sz.text,
|
|
96
|
+
sz.padL,
|
|
97
|
+
sz.padR,
|
|
98
|
+
error ? "border-danger focus:border-danger focus:ring-2 focus:ring-danger/20" : "border-stroke-control focus:border-stroke-focus focus:ring-2 focus:ring-stroke-focus/20",
|
|
99
|
+
"disabled:opacity-50 disabled:cursor-not-allowed",
|
|
100
|
+
className
|
|
101
|
+
].filter(Boolean).join(" "),
|
|
102
|
+
"aria-invalid": error ? true : void 0,
|
|
103
|
+
"aria-describedby": error ? `${selectId}-error` : helper ? `${selectId}-helper` : void 0
|
|
104
|
+
}, props), {
|
|
105
|
+
children: [
|
|
106
|
+
placeholder && /* @__PURE__ */ jsx("option", { value: "", disabled: true, hidden: true, children: placeholder }),
|
|
107
|
+
options.map((o) => /* @__PURE__ */ jsx("option", { value: o.value, disabled: o.disabled, children: o.label }, o.value)),
|
|
108
|
+
children
|
|
109
|
+
]
|
|
110
|
+
})
|
|
111
|
+
),
|
|
112
|
+
/* @__PURE__ */ jsx(
|
|
113
|
+
ChevronDown,
|
|
114
|
+
{
|
|
115
|
+
size: size === "sm" ? 14 : size === "lg" ? 18 : 16,
|
|
116
|
+
className: [
|
|
117
|
+
"absolute top-1/2 -translate-y-1/2 text-fg-muted pointer-events-none",
|
|
118
|
+
size === "sm" ? "right-2.5" : size === "lg" ? "right-3.5" : "right-3"
|
|
119
|
+
].join(" ")
|
|
120
|
+
}
|
|
121
|
+
),
|
|
122
|
+
isXs && !props.disabled && allOptions.length > 0 && /* @__PURE__ */ jsx(
|
|
123
|
+
"button",
|
|
124
|
+
{
|
|
125
|
+
type: "button",
|
|
126
|
+
"aria-label": (_a2 = label != null ? label : placeholder) != null ? _a2 : "Selecionar",
|
|
127
|
+
"aria-haspopup": "dialog",
|
|
128
|
+
onClick: openSheet,
|
|
129
|
+
className: "absolute inset-0 w-full h-full rounded-(--radius-control) opacity-0"
|
|
130
|
+
}
|
|
131
|
+
)
|
|
132
|
+
] }),
|
|
133
|
+
error && /* @__PURE__ */ jsx("p", { id: `${selectId}-error`, className: "text-caption text-danger-text", children: error }),
|
|
134
|
+
!error && helper && /* @__PURE__ */ jsx("p", { id: `${selectId}-helper`, className: "text-caption text-fg-muted", children: helper }),
|
|
135
|
+
isXs && /* @__PURE__ */ jsx(BottomSheet, { open: sheetOpen, onClose: () => setSheetOpen(false), title: label != null ? label : placeholder, children: /* @__PURE__ */ jsx("div", { className: "pb-2", children: allOptions.map((o) => {
|
|
136
|
+
const selected = o.value === sheetValue;
|
|
137
|
+
return /* @__PURE__ */ jsxs(
|
|
138
|
+
"button",
|
|
139
|
+
{
|
|
140
|
+
type: "button",
|
|
141
|
+
disabled: o.disabled,
|
|
142
|
+
onClick: () => commitSheetValue(o.value),
|
|
143
|
+
className: [
|
|
144
|
+
"w-full flex items-center justify-between gap-3 px-1 py-3.5 text-left text-label",
|
|
145
|
+
"border-b border-stroke-subtle last:border-0 transition-colors",
|
|
146
|
+
selected ? "font-medium text-fg-primary" : "text-fg-secondary",
|
|
147
|
+
"disabled:opacity-50 disabled:cursor-not-allowed"
|
|
148
|
+
].join(" "),
|
|
149
|
+
children: [
|
|
150
|
+
/* @__PURE__ */ jsx("span", { className: "min-w-0 flex-1", children: o.label }),
|
|
151
|
+
selected && /* @__PURE__ */ jsx(Check, { size: 16, className: "shrink-0" })
|
|
152
|
+
]
|
|
153
|
+
},
|
|
154
|
+
o.value
|
|
155
|
+
);
|
|
156
|
+
}) }) })
|
|
157
|
+
] });
|
|
137
158
|
});
|
|
138
159
|
export {
|
|
139
160
|
Select
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import "../chunk-ORMEWXMH.js";
|
|
3
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
4
|
import { Check, ChevronRight } from "lucide-react";
|
|
4
5
|
function SelectableCard({
|
|
5
6
|
selected = false,
|
|
@@ -16,11 +17,17 @@ function SelectableCard({
|
|
|
16
17
|
const state = selected ? "border-2 border-stroke-focus bg-surface-raised" : "border border-stroke-default bg-surface-default hover:border-stroke-strong";
|
|
17
18
|
const disabledCls = disabled ? "opacity-50 cursor-not-allowed pointer-events-none" : "cursor-pointer";
|
|
18
19
|
const cls = [base, state, disabledCls, className].filter(Boolean).join(" ");
|
|
19
|
-
const inner = /* @__PURE__ */
|
|
20
|
+
const inner = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
21
|
+
ribbon && /* @__PURE__ */ jsx("span", { className: "absolute -top-3 left-1/2 -translate-x-1/2", children: ribbon }),
|
|
22
|
+
/* @__PURE__ */ jsx("div", { className: "flex-1 min-w-0", children }),
|
|
23
|
+
indicator === "radio" && /* @__PURE__ */ jsx("span", { className: `shrink-0 size-4 rounded-full border-2 flex items-center justify-center ${selected ? "border-stroke-focus" : "border-stroke-strong"}`, children: selected && /* @__PURE__ */ jsx("span", { className: "size-2 rounded-full bg-stroke-focus" }) }),
|
|
24
|
+
indicator === "check" && selected && /* @__PURE__ */ jsx(Check, { className: "shrink-0 size-4 text-fg-primary", strokeWidth: 2.5 }),
|
|
25
|
+
indicator === "chevron" && /* @__PURE__ */ jsx(ChevronRight, { className: "shrink-0 size-4 text-fg-muted", strokeWidth: 2 })
|
|
26
|
+
] });
|
|
20
27
|
if (as === "a") {
|
|
21
|
-
return /* @__PURE__ */
|
|
28
|
+
return /* @__PURE__ */ jsx("a", { href, className: cls, "aria-disabled": disabled || void 0, "aria-current": selected || void 0, children: inner });
|
|
22
29
|
}
|
|
23
|
-
return /* @__PURE__ */
|
|
30
|
+
return /* @__PURE__ */ jsx("button", { type: "button", onClick, disabled, "aria-pressed": selected, className: cls, children: inner });
|
|
24
31
|
}
|
|
25
32
|
export {
|
|
26
33
|
SelectableCard
|