@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
package/dist/components/input.js
CHANGED
|
@@ -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, useId, useState } from "react";
|
|
7
8
|
import { Eye, EyeOff, X } from "lucide-react";
|
|
8
9
|
const SIZE = {
|
|
@@ -67,69 +68,96 @@ const Input = forwardRef(function Input2(_a, ref) {
|
|
|
67
68
|
const hasAffix = !!(prefix || suffix);
|
|
68
69
|
const inputRadius = hasAffix ? prefix && suffix ? "rounded-none" : prefix ? "rounded-l-none rounded-r-(--radius-control)" : "rounded-l-(--radius-control) rounded-r-none" : "rounded-(--radius-control)";
|
|
69
70
|
const errorClass = 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";
|
|
70
|
-
const inputElement = /* @__PURE__ */
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
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
|
-
|
|
71
|
+
const inputElement = /* @__PURE__ */ jsxs("div", { className: "relative flex-1 inline-flex items-center", children: [
|
|
72
|
+
iconLeft && /* @__PURE__ */ jsx(
|
|
73
|
+
"span",
|
|
74
|
+
{
|
|
75
|
+
"aria-hidden": true,
|
|
76
|
+
className: "absolute left-0 inset-y-0 flex items-center pl-3 text-fg-muted pointer-events-none",
|
|
77
|
+
children: /* @__PURE__ */ jsx("span", { className: "[&_svg]:shrink-0", style: { width: sz.icon, height: sz.icon }, children: iconLeft })
|
|
78
|
+
}
|
|
79
|
+
),
|
|
80
|
+
/* @__PURE__ */ jsx(
|
|
81
|
+
"input",
|
|
82
|
+
__spreadValues({
|
|
83
|
+
ref,
|
|
84
|
+
id: inputId,
|
|
85
|
+
type: effectiveType,
|
|
86
|
+
value,
|
|
87
|
+
defaultValue,
|
|
88
|
+
maxLength,
|
|
89
|
+
required,
|
|
90
|
+
className: [
|
|
91
|
+
"w-full bg-surface-default text-fg-primary placeholder:text-fg-placeholder",
|
|
92
|
+
"border transition-colors outline-none",
|
|
93
|
+
inputRadius,
|
|
94
|
+
sz.h,
|
|
95
|
+
sz.text,
|
|
96
|
+
sz.pad,
|
|
97
|
+
iconLeft ? sz.padIconL : "",
|
|
98
|
+
hasRightAdornment ? sz.padIconR : "",
|
|
99
|
+
errorClass,
|
|
100
|
+
"disabled:opacity-50 disabled:cursor-not-allowed",
|
|
101
|
+
className
|
|
102
|
+
].filter(Boolean).join(" "),
|
|
103
|
+
"aria-invalid": error ? true : void 0,
|
|
104
|
+
"aria-describedby": error ? `${inputId}-error` : helper ? `${inputId}-helper` : void 0
|
|
105
|
+
}, props)
|
|
106
|
+
),
|
|
107
|
+
hasRightAdornment && /* @__PURE__ */ jsxs("span", { className: "absolute right-0 inset-y-0 flex items-center pr-2 gap-1 pointer-events-none", children: [
|
|
108
|
+
iconRight && !showClear && !showReveal && /* @__PURE__ */ jsx("span", { className: "text-fg-muted", children: iconRight }),
|
|
109
|
+
showClear && /* @__PURE__ */ jsx(
|
|
110
|
+
"button",
|
|
111
|
+
{
|
|
112
|
+
type: "button",
|
|
113
|
+
onClick: onClear,
|
|
114
|
+
"aria-label": "Limpar",
|
|
115
|
+
className: "text-fg-muted hover:text-fg-primary p-0.5 rounded transition-colors pointer-events-auto",
|
|
116
|
+
children: /* @__PURE__ */ jsx(X, { size: sz.icon - 2 })
|
|
117
|
+
}
|
|
118
|
+
),
|
|
119
|
+
showReveal && /* @__PURE__ */ jsx(
|
|
120
|
+
"button",
|
|
121
|
+
{
|
|
122
|
+
type: "button",
|
|
123
|
+
onClick: () => setRevealed((r) => !r),
|
|
124
|
+
"aria-label": revealed ? "Ocultar senha" : "Mostrar senha",
|
|
125
|
+
className: "text-fg-muted hover:text-fg-primary p-1 rounded bg-surface-default transition-colors pointer-events-auto",
|
|
126
|
+
children: revealed ? /* @__PURE__ */ jsx(EyeOff, { size: sz.icon }) : /* @__PURE__ */ jsx(Eye, { size: sz.icon })
|
|
127
|
+
}
|
|
128
|
+
)
|
|
129
|
+
] })
|
|
130
|
+
] });
|
|
131
|
+
const wrappedInput = hasAffix ? /* @__PURE__ */ jsxs("div", { className: "inline-flex w-full items-stretch", children: [
|
|
132
|
+
prefix && /* @__PURE__ */ jsx("span", { className: [
|
|
133
|
+
"inline-flex items-center border border-r-0 border-stroke-control rounded-l-(--radius-control) bg-surface-raised text-fg-muted",
|
|
134
|
+
sz.text,
|
|
135
|
+
sz.affix
|
|
136
|
+
].join(" "), children: prefix }),
|
|
137
|
+
inputElement,
|
|
138
|
+
suffix && /* @__PURE__ */ jsx("span", { className: [
|
|
139
|
+
"inline-flex items-center border border-l-0 border-stroke-control rounded-r-(--radius-control) bg-surface-raised text-fg-muted",
|
|
140
|
+
sz.text,
|
|
141
|
+
sz.affix
|
|
142
|
+
].join(" "), children: suffix })
|
|
143
|
+
] }) : inputElement;
|
|
131
144
|
const currentLength = typeof value === "string" ? value.length : typeof defaultValue === "string" ? defaultValue.length : 0;
|
|
132
|
-
return /* @__PURE__ */
|
|
145
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1.5 w-full", children: [
|
|
146
|
+
label && /* @__PURE__ */ jsxs("label", { htmlFor: inputId, className: "inline-flex items-center gap-1 text-label font-medium text-fg-primary", children: [
|
|
147
|
+
/* @__PURE__ */ jsx("span", { children: label }),
|
|
148
|
+
required && /* @__PURE__ */ jsx("span", { className: "text-danger", "aria-label": "obrigat\xF3rio", children: "*" }),
|
|
149
|
+
optional && !required && /* @__PURE__ */ jsx("span", { className: "text-fg-muted font-normal", children: "(opcional)" })
|
|
150
|
+
] }),
|
|
151
|
+
wrappedInput,
|
|
152
|
+
(error || helper || showCount && maxLength) && /* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between gap-3", children: [
|
|
153
|
+
error ? /* @__PURE__ */ jsx("p", { id: `${inputId}-error`, className: "text-caption text-danger-text flex-1", children: error }) : helper ? /* @__PURE__ */ jsx("p", { id: `${inputId}-helper`, className: "text-caption text-fg-muted flex-1", children: helper }) : /* @__PURE__ */ jsx("span", { className: "flex-1" }),
|
|
154
|
+
showCount && maxLength && /* @__PURE__ */ jsxs("span", { className: "text-caption text-fg-muted tabular-nums shrink-0", children: [
|
|
155
|
+
currentLength,
|
|
156
|
+
"/",
|
|
157
|
+
maxLength
|
|
158
|
+
] })
|
|
159
|
+
] })
|
|
160
|
+
] });
|
|
133
161
|
});
|
|
134
162
|
export {
|
|
135
163
|
Input
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import "../chunk-ORMEWXMH.js";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
3
|
const TYPE_VARS = {
|
|
3
4
|
alert: { card: "[border-color:var(--insight-alert-border)] [background:var(--insight-alert-bg)]", badge: "[background:var(--insight-alert-badge-bg)] [color:var(--insight-alert-badge-text)]" },
|
|
4
5
|
opportunity: { card: "[border-color:var(--insight-opportunity-border)] [background:var(--insight-opportunity-bg)]", badge: "[background:var(--insight-opportunity-badge-bg)] [color:var(--insight-opportunity-badge-text)]" },
|
|
@@ -20,7 +21,17 @@ function InsightCard({
|
|
|
20
21
|
}) {
|
|
21
22
|
const v = TYPE_VARS[type];
|
|
22
23
|
const ctaClass = "shrink-0 rounded-(--radius-card) px-3 py-1.5 text-caption font-medium whitespace-nowrap shadow-sm transition-colors [background:var(--insight-action-bg)] [border:1px_solid_var(--insight-action-border)] [color:var(--insight-action-text)] hover:[background:var(--insight-action-bg-hover)]";
|
|
23
|
-
return /* @__PURE__ */
|
|
24
|
+
return /* @__PURE__ */ jsx("div", { className: ["rounded-(--radius-card) border p-4", v.card].join(" "), children: /* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between gap-4", children: [
|
|
25
|
+
/* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
|
|
26
|
+
/* @__PURE__ */ jsx("span", { className: ["inline-block text-[10px] font-semibold uppercase tracking-wide rounded px-1.5 py-0.5", v.badge].join(" "), children: TYPE_LABELS[type] }),
|
|
27
|
+
/* @__PURE__ */ jsxs("div", { className: "mt-1.5 flex items-baseline gap-2 flex-wrap", children: [
|
|
28
|
+
/* @__PURE__ */ jsx("p", { className: "font-semibold text-label leading-tight [color:var(--insight-title-color)]", children: title }),
|
|
29
|
+
potential && /* @__PURE__ */ jsx("span", { className: "text-caption font-medium tabular-nums [color:var(--insight-potential-color)]", children: potential })
|
|
30
|
+
] }),
|
|
31
|
+
/* @__PURE__ */ jsx("p", { className: "mt-0.5 text-caption [color:var(--insight-description-color)]", children: description })
|
|
32
|
+
] }),
|
|
33
|
+
action && (actionOnClick ? /* @__PURE__ */ jsx("button", { type: "button", onClick: actionOnClick, className: ctaClass, children: action }) : actionHref ? /* @__PURE__ */ jsx("a", { href: actionHref, className: ctaClass, children: action }) : null)
|
|
34
|
+
] }) });
|
|
24
35
|
}
|
|
25
36
|
export {
|
|
26
37
|
InsightCard
|
package/dist/components/label.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
__objRest,
|
|
3
|
+
__spreadProps,
|
|
3
4
|
__spreadValues
|
|
4
5
|
} from "../chunk-ORMEWXMH.js";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
7
|
import { HelpCircle } from "lucide-react";
|
|
6
8
|
const SIZE_CLASS = {
|
|
7
9
|
sm: "text-caption",
|
|
@@ -23,19 +25,22 @@ function Label(_a) {
|
|
|
23
25
|
"className",
|
|
24
26
|
"children"
|
|
25
27
|
]);
|
|
26
|
-
return /* @__PURE__ */
|
|
28
|
+
return /* @__PURE__ */ jsxs(
|
|
27
29
|
"label",
|
|
28
|
-
__spreadValues({
|
|
30
|
+
__spreadProps(__spreadValues({
|
|
29
31
|
className: [
|
|
30
32
|
"inline-flex items-center gap-1.5 font-medium text-fg-primary leading-none",
|
|
31
33
|
SIZE_CLASS[size],
|
|
32
34
|
className
|
|
33
35
|
].join(" ")
|
|
34
|
-
}, rest),
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
36
|
+
}, rest), {
|
|
37
|
+
children: [
|
|
38
|
+
/* @__PURE__ */ jsx("span", { children }),
|
|
39
|
+
required && /* @__PURE__ */ jsx("span", { className: "text-danger", "aria-label": "obrigat\xF3rio", children: "*" }),
|
|
40
|
+
optional && !required && /* @__PURE__ */ jsx("span", { className: "text-fg-muted font-normal", children: "(opcional)" }),
|
|
41
|
+
tooltip && /* @__PURE__ */ jsx("span", { title: tooltip, className: "inline-flex text-fg-muted cursor-help", "aria-label": tooltip, children: /* @__PURE__ */ jsx(HelpCircle, { size: 13 }) })
|
|
42
|
+
]
|
|
43
|
+
})
|
|
39
44
|
);
|
|
40
45
|
}
|
|
41
46
|
export {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import "../chunk-ORMEWXMH.js";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
3
|
import { ImageOff } from "lucide-react";
|
|
3
4
|
const ASPECT = {
|
|
4
5
|
square: "aspect-square",
|
|
@@ -6,7 +7,7 @@ const ASPECT = {
|
|
|
6
7
|
};
|
|
7
8
|
function MediaTile({ src, alt = "", image, label, href, fallback, aspect = "square", className = "" }) {
|
|
8
9
|
const Wrapper = href ? "a" : "div";
|
|
9
|
-
return /* @__PURE__ */
|
|
10
|
+
return /* @__PURE__ */ jsxs(
|
|
10
11
|
Wrapper,
|
|
11
12
|
{
|
|
12
13
|
href,
|
|
@@ -14,13 +15,15 @@ function MediaTile({ src, alt = "", image, label, href, fallback, aspect = "squa
|
|
|
14
15
|
"group flex flex-col rounded-(--radius-card) overflow-hidden border border-stroke-default bg-surface-default transition-all",
|
|
15
16
|
href ? "hover:shadow-md hover:ring-2 hover:ring-stroke-focus cursor-pointer" : "",
|
|
16
17
|
className
|
|
17
|
-
].filter(Boolean).join(" ")
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
18
|
+
].filter(Boolean).join(" "),
|
|
19
|
+
children: [
|
|
20
|
+
/* @__PURE__ */ jsx("div", { className: `relative w-full ${ASPECT[aspect]} bg-surface-raised overflow-hidden`, children: image ? image : src ? (
|
|
21
|
+
// eslint-disable-next-line @next/next/no-img-element
|
|
22
|
+
/* @__PURE__ */ jsx("img", { src, alt, className: "w-full h-full object-cover group-hover:scale-105 transition-transform duration-300" })
|
|
23
|
+
) : /* @__PURE__ */ jsx("div", { className: "w-full h-full flex items-center justify-center text-fg-disabled", children: fallback != null ? fallback : /* @__PURE__ */ jsx(ImageOff, { className: "size-5", strokeWidth: 1.5 }) }) }),
|
|
24
|
+
label != null && /* @__PURE__ */ jsx("div", { className: "p-1.5", children: /* @__PURE__ */ jsx("p", { className: "text-[11px] font-medium text-fg-primary line-clamp-2 leading-snug", children: label }) })
|
|
25
|
+
]
|
|
26
|
+
}
|
|
24
27
|
);
|
|
25
28
|
}
|
|
26
29
|
export {
|
package/dist/components/menu.js
CHANGED
|
@@ -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 { Check, ChevronRight } from "lucide-react";
|
|
4
5
|
import { Popover } from "./popover.js";
|
|
5
6
|
function Menu({
|
|
@@ -11,28 +12,28 @@ function Menu({
|
|
|
11
12
|
open,
|
|
12
13
|
onOpenChange
|
|
13
14
|
}) {
|
|
14
|
-
return /* @__PURE__ */
|
|
15
|
+
return /* @__PURE__ */ jsx(
|
|
15
16
|
Popover,
|
|
16
17
|
{
|
|
17
18
|
trigger,
|
|
18
19
|
placement,
|
|
19
20
|
open,
|
|
20
21
|
onOpenChange,
|
|
21
|
-
offset: 4
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
22
|
+
offset: 4,
|
|
23
|
+
children: (api) => /* @__PURE__ */ jsx(
|
|
24
|
+
"div",
|
|
25
|
+
{
|
|
26
|
+
role: "menu",
|
|
27
|
+
className: [
|
|
28
|
+
"rounded-(--radius-card) border border-stroke-default bg-surface-default shadow-lg",
|
|
29
|
+
"py-1",
|
|
30
|
+
className
|
|
31
|
+
].join(" "),
|
|
32
|
+
style: { minWidth },
|
|
33
|
+
children: typeof children === "function" ? children(api) : children
|
|
34
|
+
}
|
|
35
|
+
)
|
|
36
|
+
}
|
|
36
37
|
);
|
|
37
38
|
}
|
|
38
39
|
function MenuItem({
|
|
@@ -45,7 +46,7 @@ function MenuItem({
|
|
|
45
46
|
onClick
|
|
46
47
|
}) {
|
|
47
48
|
const colorClass = variant === "danger" ? "text-danger-text hover:bg-danger-soft" : "text-fg-primary hover:bg-surface-raised";
|
|
48
|
-
return /* @__PURE__ */
|
|
49
|
+
return /* @__PURE__ */ jsxs(
|
|
49
50
|
"button",
|
|
50
51
|
{
|
|
51
52
|
type: "button",
|
|
@@ -57,19 +58,21 @@ function MenuItem({
|
|
|
57
58
|
"focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-stroke-focus focus-visible:ring-inset focus-visible:bg-surface-raised",
|
|
58
59
|
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
59
60
|
colorClass
|
|
60
|
-
].join(" ")
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
61
|
+
].join(" "),
|
|
62
|
+
children: [
|
|
63
|
+
icon && /* @__PURE__ */ jsx("span", { className: "shrink-0 [&_svg]:size-4", children: icon }),
|
|
64
|
+
/* @__PURE__ */ jsx("span", { className: "flex-1 truncate", children }),
|
|
65
|
+
selected && /* @__PURE__ */ jsx(Check, { size: 14, className: "shrink-0 text-fg-muted" }),
|
|
66
|
+
trailing && !selected && /* @__PURE__ */ jsx("span", { className: "shrink-0 text-fg-muted", children: trailing })
|
|
67
|
+
]
|
|
68
|
+
}
|
|
66
69
|
);
|
|
67
70
|
}
|
|
68
71
|
function MenuSeparator() {
|
|
69
|
-
return /* @__PURE__ */
|
|
72
|
+
return /* @__PURE__ */ jsx("div", { role: "separator", className: "h-px bg-stroke-subtle my-1" });
|
|
70
73
|
}
|
|
71
74
|
function MenuLabel({ children }) {
|
|
72
|
-
return /* @__PURE__ */
|
|
75
|
+
return /* @__PURE__ */ jsx("div", { className: "px-3 py-1 text-[11px] font-semibold uppercase tracking-wider text-fg-muted", children });
|
|
73
76
|
}
|
|
74
77
|
export {
|
|
75
78
|
Menu,
|
package/dist/components/modal.js
CHANGED
|
@@ -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 { useEffect, useId, useState } from "react";
|
|
4
5
|
import { X } from "lucide-react";
|
|
5
6
|
import { createPortal } from "react-dom";
|
|
@@ -34,35 +35,49 @@ function Modal({ open, onClose, title, subtitle, children, footer, headerAction,
|
|
|
34
35
|
if (!open) return null;
|
|
35
36
|
if (!mounted) return null;
|
|
36
37
|
return createPortal(
|
|
37
|
-
/* @__PURE__ */
|
|
38
|
-
"div",
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
role: "dialog",
|
|
42
|
-
"aria-modal": "true",
|
|
43
|
-
"aria-labelledby": title ? titleId : void 0,
|
|
44
|
-
tabIndex: -1,
|
|
45
|
-
className: [
|
|
46
|
-
"relative z-10 w-full rounded-(--radius-card) bg-surface-default shadow-xl",
|
|
47
|
-
"flex flex-col max-h-[90dvh]",
|
|
48
|
-
"focus:outline-none",
|
|
49
|
-
sizes[size],
|
|
50
|
-
className
|
|
51
|
-
].join(" ")
|
|
52
|
-
},
|
|
53
|
-
(title || headerAction || !hideClose) && /* @__PURE__ */ React.createElement("div", { className: "flex items-start justify-between gap-4 px-6 py-4 border-b border-stroke-default shrink-0" }, /* @__PURE__ */ React.createElement("div", { className: "flex-1 min-w-0" }, title && /* @__PURE__ */ React.createElement("h2", { id: titleId, className: "text-body font-semibold text-fg-primary" }, title), subtitle && /* @__PURE__ */ React.createElement("p", { className: "text-label text-fg-muted mt-0.5" }, subtitle)), /* @__PURE__ */ React.createElement("div", { className: "flex items-center gap-2 shrink-0" }, headerAction, !hideClose && /* @__PURE__ */ React.createElement(
|
|
54
|
-
"button",
|
|
38
|
+
/* @__PURE__ */ jsxs("div", { className: "fixed inset-0 z-50 flex items-center justify-center p-4", children: [
|
|
39
|
+
/* @__PURE__ */ jsx("div", { className: "fixed inset-0 [background:var(--overlay-scrim)]", onClick: closeOnBackdrop ? onClose : void 0, "aria-hidden": "true" }),
|
|
40
|
+
/* @__PURE__ */ jsxs(
|
|
41
|
+
"div",
|
|
55
42
|
{
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
"aria-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
43
|
+
ref: dialogRef,
|
|
44
|
+
role: "dialog",
|
|
45
|
+
"aria-modal": "true",
|
|
46
|
+
"aria-labelledby": title ? titleId : void 0,
|
|
47
|
+
tabIndex: -1,
|
|
48
|
+
className: [
|
|
49
|
+
"relative z-10 w-full rounded-(--radius-card) bg-surface-default shadow-xl",
|
|
50
|
+
"flex flex-col max-h-[90dvh]",
|
|
51
|
+
"focus:outline-none",
|
|
52
|
+
sizes[size],
|
|
53
|
+
className
|
|
54
|
+
].join(" "),
|
|
55
|
+
children: [
|
|
56
|
+
(title || headerAction || !hideClose) && /* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between gap-4 px-6 py-4 border-b border-stroke-default shrink-0", children: [
|
|
57
|
+
/* @__PURE__ */ jsxs("div", { className: "flex-1 min-w-0", children: [
|
|
58
|
+
title && /* @__PURE__ */ jsx("h2", { id: titleId, className: "text-body font-semibold text-fg-primary", children: title }),
|
|
59
|
+
subtitle && /* @__PURE__ */ jsx("p", { className: "text-label text-fg-muted mt-0.5", children: subtitle })
|
|
60
|
+
] }),
|
|
61
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 shrink-0", children: [
|
|
62
|
+
headerAction,
|
|
63
|
+
!hideClose && /* @__PURE__ */ jsx(
|
|
64
|
+
"button",
|
|
65
|
+
{
|
|
66
|
+
type: "button",
|
|
67
|
+
onClick: onClose,
|
|
68
|
+
className: "text-fg-muted hover:text-fg-primary transition-colors rounded focus-visible:ring-2 focus-visible:ring-stroke-focus focus-visible:outline-none p-0.5",
|
|
69
|
+
"aria-label": "Fechar",
|
|
70
|
+
children: /* @__PURE__ */ jsx(X, { size: 20 })
|
|
71
|
+
}
|
|
72
|
+
)
|
|
73
|
+
] })
|
|
74
|
+
] }),
|
|
75
|
+
/* @__PURE__ */ jsx("div", { className: "flex-1 overflow-y-auto px-6 py-4", children }),
|
|
76
|
+
footer && /* @__PURE__ */ jsx("div", { className: "flex items-center justify-end gap-3 px-6 py-4 border-t border-stroke-default shrink-0", children: footer })
|
|
77
|
+
]
|
|
78
|
+
}
|
|
79
|
+
)
|
|
80
|
+
] }),
|
|
66
81
|
container != null ? container : document.body
|
|
67
82
|
);
|
|
68
83
|
}
|
|
@@ -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 { useState, useEffect } from "react";
|
|
4
5
|
import { Info, CheckCircle2, AlertTriangle, AlertOctagon, Lock, X } from "lucide-react";
|
|
5
6
|
const STYLES = {
|
|
@@ -50,7 +51,7 @@ function iconFor(severity, intent) {
|
|
|
50
51
|
}
|
|
51
52
|
}
|
|
52
53
|
function DefaultLink({ href, className, children }) {
|
|
53
|
-
return /* @__PURE__ */
|
|
54
|
+
return /* @__PURE__ */ jsx("a", { href, className, children });
|
|
54
55
|
}
|
|
55
56
|
function Notice({
|
|
56
57
|
severity,
|
|
@@ -77,25 +78,42 @@ function Notice({
|
|
|
77
78
|
if (id) localStorage.setItem(`notice-dismissed:${id}`, "1");
|
|
78
79
|
setDismissed(true);
|
|
79
80
|
}
|
|
80
|
-
const ctaNode = (cta == null ? void 0 : cta.href) ? /* @__PURE__ */
|
|
81
|
-
|
|
81
|
+
const ctaNode = (cta == null ? void 0 : cta.href) ? /* @__PURE__ */ jsxs(LinkAs, { href: cta.href, className: ctaClass, children: [
|
|
82
|
+
cta.label,
|
|
83
|
+
" \u2192"
|
|
84
|
+
] }) : (cta == null ? void 0 : cta.onClick) ? /* @__PURE__ */ jsxs("button", { type: "button", onClick: cta.onClick, className: ctaClass, children: [
|
|
85
|
+
cta.label,
|
|
86
|
+
" \u2192"
|
|
87
|
+
] }) : null;
|
|
88
|
+
return /* @__PURE__ */ jsxs(
|
|
82
89
|
"div",
|
|
83
90
|
{
|
|
84
91
|
role: severity === "critical" ? "alert" : "status",
|
|
85
92
|
"aria-live": severity === "critical" ? "assertive" : "polite",
|
|
86
|
-
className: ["rounded-(--radius-card) border px-4 py-3 flex flex-col sm:flex-row sm:items-center sm:justify-between gap-2", s.container, className].join(" ")
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
className:
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
93
|
+
className: ["rounded-(--radius-card) border px-4 py-3 flex flex-col sm:flex-row sm:items-center sm:justify-between gap-2", s.container, className].join(" "),
|
|
94
|
+
children: [
|
|
95
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-start gap-2.5 min-w-0", children: [
|
|
96
|
+
/* @__PURE__ */ jsx(Icon, { size: 18, "aria-hidden": true, className: ["shrink-0 mt-0.5", s.icon].join(" ") }),
|
|
97
|
+
/* @__PURE__ */ jsxs("div", { className: "min-w-0", children: [
|
|
98
|
+
/* @__PURE__ */ jsx("p", { className: ["text-label font-semibold", s.title].join(" "), children: title }),
|
|
99
|
+
description && /* @__PURE__ */ jsx("div", { className: ["text-caption mt-0.5", s.desc].join(" "), children: description })
|
|
100
|
+
] })
|
|
101
|
+
] }),
|
|
102
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 shrink-0 self-end sm:self-auto", children: [
|
|
103
|
+
ctaNode,
|
|
104
|
+
canDismiss && /* @__PURE__ */ jsx(
|
|
105
|
+
"button",
|
|
106
|
+
{
|
|
107
|
+
type: "button",
|
|
108
|
+
onClick: dismiss,
|
|
109
|
+
"aria-label": dismissLabel,
|
|
110
|
+
className: ["transition-opacity hover:opacity-70 shrink-0", s.icon].join(" "),
|
|
111
|
+
children: /* @__PURE__ */ jsx(X, { size: 16, "aria-hidden": true })
|
|
112
|
+
}
|
|
113
|
+
)
|
|
114
|
+
] })
|
|
115
|
+
]
|
|
116
|
+
}
|
|
99
117
|
);
|
|
100
118
|
}
|
|
101
119
|
export {
|