@rojaostudio/ds 1.0.1 → 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 +3 -6
- 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 { forwardRef, useState, useRef, useEffect, useImperativeHandle } from "react";
|
|
7
8
|
import { Clock, ChevronUp, ChevronDown, X } from "lucide-react";
|
|
8
9
|
import { Popover } from "./popover.js";
|
|
@@ -95,118 +96,137 @@ const TimePicker = forwardRef(function TimePicker2({
|
|
|
95
96
|
if (!p) return "";
|
|
96
97
|
return formatTime(p.h, p.m, format);
|
|
97
98
|
})();
|
|
98
|
-
const dialog = /* @__PURE__ */
|
|
99
|
+
const dialog = /* @__PURE__ */ jsxs(
|
|
99
100
|
"div",
|
|
100
101
|
{
|
|
101
102
|
role: "dialog",
|
|
102
103
|
"aria-label": "Seletor de hora",
|
|
103
|
-
className: "rounded-(--radius-control) border border-stroke-default bg-surface-default shadow-lg p-3"
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
104
|
+
className: "rounded-(--radius-control) border border-stroke-default bg-surface-default shadow-lg p-3",
|
|
105
|
+
children: [
|
|
106
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
107
|
+
/* @__PURE__ */ jsx(
|
|
108
|
+
Spinner,
|
|
109
|
+
{
|
|
110
|
+
label: "Hora",
|
|
111
|
+
value: String(draft.h).padStart(2, "0"),
|
|
112
|
+
onUp: () => adjust("h", 1),
|
|
113
|
+
onDown: () => adjust("h", -1)
|
|
114
|
+
}
|
|
115
|
+
),
|
|
116
|
+
/* @__PURE__ */ jsx("span", { className: "text-heading-sm font-semibold text-fg-muted", children: ":" }),
|
|
117
|
+
/* @__PURE__ */ jsx(
|
|
118
|
+
Spinner,
|
|
119
|
+
{
|
|
120
|
+
label: "Minuto",
|
|
121
|
+
value: String(draft.m).padStart(2, "0"),
|
|
122
|
+
onUp: () => adjust("m", 1),
|
|
123
|
+
onDown: () => adjust("m", -1)
|
|
124
|
+
}
|
|
125
|
+
),
|
|
126
|
+
format === "12h" && /* @__PURE__ */ jsx("span", { className: "text-caption font-medium text-fg-secondary ml-1", children: draft.h >= 12 ? "PM" : "AM" })
|
|
127
|
+
] }),
|
|
128
|
+
/* @__PURE__ */ jsxs("div", { className: "flex justify-end gap-2 mt-3", children: [
|
|
129
|
+
/* @__PURE__ */ jsx(
|
|
130
|
+
"button",
|
|
131
|
+
{
|
|
132
|
+
type: "button",
|
|
133
|
+
onClick: () => setOpen(false),
|
|
134
|
+
className: "text-caption text-fg-muted hover:text-fg-primary transition-colors px-2 py-1",
|
|
135
|
+
children: "Cancelar"
|
|
136
|
+
}
|
|
137
|
+
),
|
|
138
|
+
/* @__PURE__ */ jsx(
|
|
139
|
+
"button",
|
|
140
|
+
{
|
|
141
|
+
type: "button",
|
|
142
|
+
onClick: () => {
|
|
143
|
+
commit();
|
|
144
|
+
setOpen(false);
|
|
145
|
+
},
|
|
146
|
+
className: "text-caption font-medium bg-brand-primary text-brand-on-primary px-3 py-1 rounded transition-colors hover:bg-brand-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-stroke-focus",
|
|
147
|
+
children: "OK"
|
|
148
|
+
}
|
|
149
|
+
)
|
|
150
|
+
] })
|
|
151
|
+
]
|
|
152
|
+
}
|
|
153
|
+
);
|
|
154
|
+
return /* @__PURE__ */ jsxs("div", { className: ["relative", width === "full" ? "block w-full" : "inline-block", className].join(" "), children: [
|
|
155
|
+
/* @__PURE__ */ jsx(
|
|
156
|
+
Popover,
|
|
107
157
|
{
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
158
|
+
trigger: /* @__PURE__ */ jsxs(
|
|
159
|
+
"button",
|
|
160
|
+
{
|
|
161
|
+
ref: triggerRef,
|
|
162
|
+
type: "button",
|
|
163
|
+
onClick: (e) => {
|
|
164
|
+
e.stopPropagation();
|
|
165
|
+
if (!disabled) setOpen((o) => !o);
|
|
166
|
+
},
|
|
167
|
+
disabled,
|
|
168
|
+
"aria-label": ariaLabel != null ? ariaLabel : "Selecionar hora",
|
|
169
|
+
"aria-haspopup": "dialog",
|
|
170
|
+
"aria-expanded": open,
|
|
171
|
+
className: [
|
|
172
|
+
"w-full flex items-center gap-2 rounded-(--radius-control) border border-stroke-default bg-surface-default",
|
|
173
|
+
"transition-colors focus:outline-none focus:border-stroke-focus focus:ring-2 focus:ring-stroke-focus/20",
|
|
174
|
+
"disabled:opacity-50 disabled:cursor-not-allowed",
|
|
175
|
+
value ? "pr-7" : "",
|
|
176
|
+
SIZE_CLASS[size]
|
|
177
|
+
].join(" "),
|
|
178
|
+
children: [
|
|
179
|
+
/* @__PURE__ */ jsx(Clock, { size: 16, className: "text-fg-muted shrink-0" }),
|
|
180
|
+
/* @__PURE__ */ jsx("span", { className: ["flex-1 text-left truncate", display ? "text-fg-primary" : "text-fg-placeholder"].join(" "), children: display || placeholder })
|
|
181
|
+
]
|
|
182
|
+
}
|
|
183
|
+
),
|
|
184
|
+
triggerClassName: width === "full" ? "block w-full" : "inline-block",
|
|
185
|
+
placement: "bottom-start",
|
|
186
|
+
offset: 4,
|
|
187
|
+
open,
|
|
188
|
+
onOpenChange: (v) => {
|
|
189
|
+
if (!disabled) setOpen(v);
|
|
190
|
+
},
|
|
191
|
+
children: () => dialog
|
|
112
192
|
}
|
|
113
|
-
),
|
|
114
|
-
|
|
193
|
+
),
|
|
194
|
+
value && !disabled && /* @__PURE__ */ jsx(
|
|
195
|
+
"button",
|
|
115
196
|
{
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
197
|
+
type: "button",
|
|
198
|
+
onClick: handleClear,
|
|
199
|
+
"aria-label": "Limpar hora",
|
|
200
|
+
className: "absolute right-2 top-1/2 -translate-y-1/2 text-fg-muted hover:text-fg-primary p-0.5 rounded transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-stroke-focus",
|
|
201
|
+
children: /* @__PURE__ */ jsx(X, { size: 14 })
|
|
120
202
|
}
|
|
121
|
-
)
|
|
122
|
-
|
|
203
|
+
)
|
|
204
|
+
] });
|
|
205
|
+
});
|
|
206
|
+
function Spinner({ label, value, onUp, onDown }) {
|
|
207
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center", role: "group", "aria-label": label, children: [
|
|
208
|
+
/* @__PURE__ */ jsx(
|
|
123
209
|
"button",
|
|
124
210
|
{
|
|
125
211
|
type: "button",
|
|
126
|
-
onClick:
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
212
|
+
onClick: onUp,
|
|
213
|
+
"aria-label": `Aumentar ${label.toLowerCase()}`,
|
|
214
|
+
className: "p-0.5 rounded hover:bg-surface-raised text-fg-muted focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-stroke-focus",
|
|
215
|
+
children: /* @__PURE__ */ jsx(ChevronUp, { size: 16 })
|
|
216
|
+
}
|
|
217
|
+
),
|
|
218
|
+
/* @__PURE__ */ jsx("div", { className: "px-2 py-1 text-heading-lg font-mono font-semibold text-fg-primary tabular-nums select-none min-w-[3ch] text-center", children: value }),
|
|
219
|
+
/* @__PURE__ */ jsx(
|
|
131
220
|
"button",
|
|
132
221
|
{
|
|
133
222
|
type: "button",
|
|
134
|
-
onClick:
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
}
|
|
138
|
-
className: "text-caption font-medium bg-brand-primary text-brand-on-primary px-3 py-1 rounded transition-colors hover:bg-brand-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-stroke-focus"
|
|
139
|
-
},
|
|
140
|
-
"OK"
|
|
141
|
-
))
|
|
142
|
-
);
|
|
143
|
-
return /* @__PURE__ */ React.createElement("div", { className: ["relative", width === "full" ? "block w-full" : "inline-block", className].join(" ") }, /* @__PURE__ */ React.createElement(
|
|
144
|
-
Popover,
|
|
145
|
-
{
|
|
146
|
-
trigger: /* @__PURE__ */ React.createElement(
|
|
147
|
-
"button",
|
|
148
|
-
{
|
|
149
|
-
ref: triggerRef,
|
|
150
|
-
type: "button",
|
|
151
|
-
onClick: (e) => {
|
|
152
|
-
e.stopPropagation();
|
|
153
|
-
if (!disabled) setOpen((o) => !o);
|
|
154
|
-
},
|
|
155
|
-
disabled,
|
|
156
|
-
"aria-label": ariaLabel != null ? ariaLabel : "Selecionar hora",
|
|
157
|
-
"aria-haspopup": "dialog",
|
|
158
|
-
"aria-expanded": open,
|
|
159
|
-
className: [
|
|
160
|
-
"w-full flex items-center gap-2 rounded-(--radius-control) border border-stroke-default bg-surface-default",
|
|
161
|
-
"transition-colors focus:outline-none focus:border-stroke-focus focus:ring-2 focus:ring-stroke-focus/20",
|
|
162
|
-
"disabled:opacity-50 disabled:cursor-not-allowed",
|
|
163
|
-
value ? "pr-7" : "",
|
|
164
|
-
SIZE_CLASS[size]
|
|
165
|
-
].join(" ")
|
|
166
|
-
},
|
|
167
|
-
/* @__PURE__ */ React.createElement(Clock, { size: 16, className: "text-fg-muted shrink-0" }),
|
|
168
|
-
/* @__PURE__ */ React.createElement("span", { className: ["flex-1 text-left truncate", display ? "text-fg-primary" : "text-fg-placeholder"].join(" ") }, display || placeholder)
|
|
169
|
-
),
|
|
170
|
-
triggerClassName: width === "full" ? "block w-full" : "inline-block",
|
|
171
|
-
placement: "bottom-start",
|
|
172
|
-
offset: 4,
|
|
173
|
-
open,
|
|
174
|
-
onOpenChange: (v) => {
|
|
175
|
-
if (!disabled) setOpen(v);
|
|
223
|
+
onClick: onDown,
|
|
224
|
+
"aria-label": `Diminuir ${label.toLowerCase()}`,
|
|
225
|
+
className: "p-0.5 rounded hover:bg-surface-raised text-fg-muted focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-stroke-focus",
|
|
226
|
+
children: /* @__PURE__ */ jsx(ChevronDown, { size: 16 })
|
|
176
227
|
}
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
), value && !disabled && /* @__PURE__ */ React.createElement(
|
|
180
|
-
"button",
|
|
181
|
-
{
|
|
182
|
-
type: "button",
|
|
183
|
-
onClick: handleClear,
|
|
184
|
-
"aria-label": "Limpar hora",
|
|
185
|
-
className: "absolute right-2 top-1/2 -translate-y-1/2 text-fg-muted hover:text-fg-primary p-0.5 rounded transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-stroke-focus"
|
|
186
|
-
},
|
|
187
|
-
/* @__PURE__ */ React.createElement(X, { size: 14 })
|
|
188
|
-
));
|
|
189
|
-
});
|
|
190
|
-
function Spinner({ label, value, onUp, onDown }) {
|
|
191
|
-
return /* @__PURE__ */ React.createElement("div", { className: "flex flex-col items-center", role: "group", "aria-label": label }, /* @__PURE__ */ React.createElement(
|
|
192
|
-
"button",
|
|
193
|
-
{
|
|
194
|
-
type: "button",
|
|
195
|
-
onClick: onUp,
|
|
196
|
-
"aria-label": `Aumentar ${label.toLowerCase()}`,
|
|
197
|
-
className: "p-0.5 rounded hover:bg-surface-raised text-fg-muted focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-stroke-focus"
|
|
198
|
-
},
|
|
199
|
-
/* @__PURE__ */ React.createElement(ChevronUp, { size: 16 })
|
|
200
|
-
), /* @__PURE__ */ React.createElement("div", { className: "px-2 py-1 text-heading-lg font-mono font-semibold text-fg-primary tabular-nums select-none min-w-[3ch] text-center" }, value), /* @__PURE__ */ React.createElement(
|
|
201
|
-
"button",
|
|
202
|
-
{
|
|
203
|
-
type: "button",
|
|
204
|
-
onClick: onDown,
|
|
205
|
-
"aria-label": `Diminuir ${label.toLowerCase()}`,
|
|
206
|
-
className: "p-0.5 rounded hover:bg-surface-raised text-fg-muted focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-stroke-focus"
|
|
207
|
-
},
|
|
208
|
-
/* @__PURE__ */ React.createElement(ChevronDown, { size: 16 })
|
|
209
|
-
));
|
|
228
|
+
)
|
|
229
|
+
] });
|
|
210
230
|
}
|
|
211
231
|
export {
|
|
212
232
|
TimePicker
|
|
@@ -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 { useEffect, useRef, useState, useCallback } from "react";
|
|
7
8
|
import { createPortal } from "react-dom";
|
|
8
9
|
import { Loader2, X, Check, AlertTriangle, Info } from "lucide-react";
|
|
@@ -99,7 +100,7 @@ function ToastVisual({
|
|
|
99
100
|
const hasAction = !!action;
|
|
100
101
|
const showClose = dismissible != null ? dismissible : !hasAction && !isLoading;
|
|
101
102
|
const animClass = animate ? origin === "top" ? "rojao-toast--enter-top" : "rojao-toast--enter-bottom" : "";
|
|
102
|
-
return /* @__PURE__ */
|
|
103
|
+
return /* @__PURE__ */ jsxs(
|
|
103
104
|
"div",
|
|
104
105
|
{
|
|
105
106
|
role: isError ? "alert" : "status",
|
|
@@ -114,57 +115,62 @@ function ToastVisual({
|
|
|
114
115
|
borderRadius: "var(--radius-toast)",
|
|
115
116
|
minHeight: "56px",
|
|
116
117
|
fontFamily: "var(--font-family)"
|
|
117
|
-
})
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
118
|
+
}),
|
|
119
|
+
children: [
|
|
120
|
+
(() => {
|
|
121
|
+
const Icon = VARIANT_ICON[variant];
|
|
122
|
+
if (!Icon) return null;
|
|
123
|
+
if (isLoading) {
|
|
124
|
+
return /* @__PURE__ */ jsx(
|
|
125
|
+
Icon,
|
|
126
|
+
{
|
|
127
|
+
size: 18,
|
|
128
|
+
className: "shrink-0 animate-spin",
|
|
129
|
+
style: { color: "var(--toast-text-muted)" }
|
|
130
|
+
}
|
|
131
|
+
);
|
|
132
|
+
}
|
|
133
|
+
const c = VARIANT_COLOR[variant];
|
|
134
|
+
return /* @__PURE__ */ jsx(
|
|
135
|
+
"span",
|
|
136
|
+
{
|
|
137
|
+
"aria-hidden": "true",
|
|
138
|
+
className: "grid place-items-center rounded-full shrink-0 size-9",
|
|
139
|
+
style: {
|
|
140
|
+
background: c,
|
|
141
|
+
color: `color-mix(in srgb, ${c} 30%, black)`,
|
|
142
|
+
boxShadow: `0 0 0 5px color-mix(in srgb, ${c} 18%, transparent)`
|
|
143
|
+
},
|
|
144
|
+
children: /* @__PURE__ */ jsx(Icon, { size: 18, strokeWidth: 2.75 })
|
|
145
|
+
}
|
|
146
|
+
);
|
|
147
|
+
})(),
|
|
148
|
+
/* @__PURE__ */ jsxs("div", { className: "flex-1 min-w-0", children: [
|
|
149
|
+
/* @__PURE__ */ jsx("p", { className: description ? "text-[0.9375rem] font-semibold leading-snug" : "text-label leading-snug", children: message }),
|
|
150
|
+
description && /* @__PURE__ */ jsx("p", { className: "text-label leading-snug mt-0.5", style: { color: "var(--toast-text-muted)" }, children: description })
|
|
151
|
+
] }),
|
|
152
|
+
hasAction ? /* @__PURE__ */ jsx(
|
|
153
|
+
"button",
|
|
125
154
|
{
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
155
|
+
type: "button",
|
|
156
|
+
onClick: action.onClick,
|
|
157
|
+
className: "shrink-0 text-label font-medium px-2 -mr-1 transition-opacity hover:opacity-80",
|
|
158
|
+
style: { color: "currentColor" },
|
|
159
|
+
children: action.label
|
|
129
160
|
}
|
|
130
|
-
)
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
background: c,
|
|
140
|
-
color: `color-mix(in srgb, ${c} 30%, black)`,
|
|
141
|
-
boxShadow: `0 0 0 5px color-mix(in srgb, ${c} 18%, transparent)`
|
|
161
|
+
) : showClose && /* @__PURE__ */ jsx(
|
|
162
|
+
"button",
|
|
163
|
+
{
|
|
164
|
+
type: "button",
|
|
165
|
+
onClick: onDismiss,
|
|
166
|
+
"aria-label": "Fechar",
|
|
167
|
+
className: "shrink-0 opacity-60 hover:opacity-100 transition-opacity",
|
|
168
|
+
style: { color: "currentColor" },
|
|
169
|
+
children: /* @__PURE__ */ jsx(X, { size: 16 })
|
|
142
170
|
}
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
})(),
|
|
147
|
-
/* @__PURE__ */ React.createElement("div", { className: "flex-1 min-w-0" }, /* @__PURE__ */ React.createElement("p", { className: description ? "text-[0.9375rem] font-semibold leading-snug" : "text-label leading-snug" }, message), description && /* @__PURE__ */ React.createElement("p", { className: "text-label leading-snug mt-0.5", style: { color: "var(--toast-text-muted)" } }, description)),
|
|
148
|
-
hasAction ? /* @__PURE__ */ React.createElement(
|
|
149
|
-
"button",
|
|
150
|
-
{
|
|
151
|
-
type: "button",
|
|
152
|
-
onClick: action.onClick,
|
|
153
|
-
className: "shrink-0 text-label font-medium px-2 -mr-1 transition-opacity hover:opacity-80",
|
|
154
|
-
style: { color: "currentColor" }
|
|
155
|
-
},
|
|
156
|
-
action.label
|
|
157
|
-
) : showClose && /* @__PURE__ */ React.createElement(
|
|
158
|
-
"button",
|
|
159
|
-
{
|
|
160
|
-
type: "button",
|
|
161
|
-
onClick: onDismiss,
|
|
162
|
-
"aria-label": "Fechar",
|
|
163
|
-
className: "shrink-0 opacity-60 hover:opacity-100 transition-opacity",
|
|
164
|
-
style: { color: "currentColor" }
|
|
165
|
-
},
|
|
166
|
-
/* @__PURE__ */ React.createElement(X, { size: 16 })
|
|
167
|
-
)
|
|
171
|
+
)
|
|
172
|
+
]
|
|
173
|
+
}
|
|
168
174
|
);
|
|
169
175
|
}
|
|
170
176
|
const POSITION_CLASS = {
|
|
@@ -240,39 +246,39 @@ function Toaster({ position = "bottom-center" } = {}) {
|
|
|
240
246
|
const isTop = position.startsWith("top-");
|
|
241
247
|
const exitClass = t.exiting ? isTop ? "rojao-toast--exit-top" : "rojao-toast--exit-bottom" : "";
|
|
242
248
|
return createPortal(
|
|
243
|
-
/* @__PURE__ */
|
|
249
|
+
/* @__PURE__ */ jsx(
|
|
244
250
|
"div",
|
|
245
251
|
{
|
|
246
252
|
"aria-live": ariaLive,
|
|
247
253
|
"aria-atomic": "true",
|
|
248
|
-
className: ["fixed z-[9999] pointer-events-none", POSITION_CLASS[position]].join(" ")
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
"div",
|
|
252
|
-
{
|
|
253
|
-
onMouseEnter: handleMouseEnter,
|
|
254
|
-
onMouseLeave: handleMouseLeave,
|
|
255
|
-
className: ["pointer-events-auto", exitClass].join(" ")
|
|
256
|
-
},
|
|
257
|
-
/* @__PURE__ */ React.createElement(
|
|
258
|
-
ToastVisual,
|
|
254
|
+
className: ["fixed z-[9999] pointer-events-none", POSITION_CLASS[position]].join(" "),
|
|
255
|
+
children: /* @__PURE__ */ jsx(
|
|
256
|
+
"div",
|
|
259
257
|
{
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
t.
|
|
267
|
-
|
|
258
|
+
onMouseEnter: handleMouseEnter,
|
|
259
|
+
onMouseLeave: handleMouseLeave,
|
|
260
|
+
className: ["pointer-events-auto", exitClass].join(" "),
|
|
261
|
+
children: /* @__PURE__ */ jsx(
|
|
262
|
+
ToastVisual,
|
|
263
|
+
{
|
|
264
|
+
message: t.message,
|
|
265
|
+
description: t.description,
|
|
266
|
+
variant: t.variant,
|
|
267
|
+
action: t.action ? {
|
|
268
|
+
label: t.action.label,
|
|
269
|
+
onClick: () => {
|
|
270
|
+
t.action.onClick();
|
|
271
|
+
startExit(t.id);
|
|
272
|
+
}
|
|
273
|
+
} : void 0,
|
|
274
|
+
animate: !t.exiting,
|
|
275
|
+
origin: isTop ? "top" : "bottom",
|
|
276
|
+
onDismiss: () => startExit(t.id)
|
|
268
277
|
}
|
|
269
|
-
|
|
270
|
-
animate: !t.exiting,
|
|
271
|
-
origin: isTop ? "top" : "bottom",
|
|
272
|
-
onDismiss: () => startExit(t.id)
|
|
278
|
+
)
|
|
273
279
|
}
|
|
274
280
|
)
|
|
275
|
-
|
|
281
|
+
}
|
|
276
282
|
),
|
|
277
283
|
document.body
|
|
278
284
|
);
|
|
@@ -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 { Pencil } from "lucide-react";
|
|
4
5
|
function ToggleCardCompact({
|
|
5
6
|
icon,
|
|
@@ -12,86 +13,93 @@ function ToggleCardCompact({
|
|
|
12
13
|
editLabel = "Editar",
|
|
13
14
|
name
|
|
14
15
|
}) {
|
|
15
|
-
return /* @__PURE__ */
|
|
16
|
+
return /* @__PURE__ */ jsxs(
|
|
16
17
|
"div",
|
|
17
18
|
{
|
|
18
19
|
className: [
|
|
19
20
|
"rounded-(--radius-card) overflow-hidden transition-colors border",
|
|
20
21
|
checked ? "[border-color:var(--section-card-border-active)]" : "[border-color:var(--section-card-border)]"
|
|
21
|
-
].join(" ")
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
{
|
|
27
|
-
className: [
|
|
28
|
-
"flex items-center gap-3 px-4 py-3 transition-colors",
|
|
29
|
-
checked ? "[background:var(--section-card-header-bg-active)]" : ""
|
|
30
|
-
].join(" ")
|
|
31
|
-
},
|
|
32
|
-
icon && /* @__PURE__ */ React.createElement(
|
|
33
|
-
"span",
|
|
34
|
-
{
|
|
35
|
-
className: [
|
|
36
|
-
"shrink-0",
|
|
37
|
-
checked ? "[color:var(--section-card-label-active)] opacity-80" : "text-(--text-disabled)"
|
|
38
|
-
].join(" ")
|
|
39
|
-
},
|
|
40
|
-
icon
|
|
41
|
-
),
|
|
42
|
-
/* @__PURE__ */ React.createElement("div", { className: "flex-1 min-w-0" }, /* @__PURE__ */ React.createElement(
|
|
43
|
-
"p",
|
|
44
|
-
{
|
|
45
|
-
className: [
|
|
46
|
-
"text-caption font-semibold uppercase tracking-wide",
|
|
47
|
-
checked ? "[color:var(--section-card-label-active)]" : "[color:var(--section-card-label)]"
|
|
48
|
-
].join(" ")
|
|
49
|
-
},
|
|
50
|
-
label
|
|
51
|
-
), (checked ? summary : description) && /* @__PURE__ */ React.createElement(
|
|
52
|
-
"p",
|
|
53
|
-
{
|
|
54
|
-
className: [
|
|
55
|
-
"text-caption leading-snug mt-0.5 truncate",
|
|
56
|
-
checked ? "[color:var(--section-card-badge-active)]" : "[color:var(--section-card-badge)]"
|
|
57
|
-
].join(" ")
|
|
58
|
-
},
|
|
59
|
-
checked ? summary : description
|
|
60
|
-
)),
|
|
61
|
-
checked && onEdit && /* @__PURE__ */ React.createElement(
|
|
62
|
-
"button",
|
|
63
|
-
{
|
|
64
|
-
type: "button",
|
|
65
|
-
onClick: onEdit,
|
|
66
|
-
"aria-label": editLabel,
|
|
67
|
-
className: "shrink-0 [color:var(--section-card-label-active)] opacity-70 hover:opacity-100 transition-opacity p-1 -m-1 rounded focus:outline-none focus-visible:ring-2 focus-visible:ring-white/40"
|
|
68
|
-
},
|
|
69
|
-
/* @__PURE__ */ React.createElement(Pencil, { size: 14 })
|
|
70
|
-
),
|
|
71
|
-
/* @__PURE__ */ React.createElement(
|
|
72
|
-
"button",
|
|
73
|
-
{
|
|
74
|
-
type: "button",
|
|
75
|
-
role: "switch",
|
|
76
|
-
"aria-checked": checked,
|
|
77
|
-
"aria-label": label,
|
|
78
|
-
onClick: () => onCheckedChange == null ? void 0 : onCheckedChange(!checked),
|
|
79
|
-
className: [
|
|
80
|
-
"relative inline-flex shrink-0 h-5 w-9 rounded-full transition-colors focus:outline-none focus-visible:ring-2",
|
|
81
|
-
checked ? "bg-(--surface-default)/30 focus-visible:ring-white/40" : "bg-(--surface-raised) border border-stroke-default focus-visible:ring-stroke-focus/30"
|
|
82
|
-
].join(" ")
|
|
83
|
-
},
|
|
84
|
-
/* @__PURE__ */ React.createElement(
|
|
85
|
-
"span",
|
|
22
|
+
].join(" "),
|
|
23
|
+
children: [
|
|
24
|
+
name && /* @__PURE__ */ jsx("input", { type: "hidden", name, value: checked ? "on" : "" }),
|
|
25
|
+
/* @__PURE__ */ jsxs(
|
|
26
|
+
"div",
|
|
86
27
|
{
|
|
87
28
|
className: [
|
|
88
|
-
"
|
|
89
|
-
checked ? "
|
|
90
|
-
].join(" ")
|
|
29
|
+
"flex items-center gap-3 px-4 py-3 transition-colors",
|
|
30
|
+
checked ? "[background:var(--section-card-header-bg-active)]" : ""
|
|
31
|
+
].join(" "),
|
|
32
|
+
children: [
|
|
33
|
+
icon && /* @__PURE__ */ jsx(
|
|
34
|
+
"span",
|
|
35
|
+
{
|
|
36
|
+
className: [
|
|
37
|
+
"shrink-0",
|
|
38
|
+
checked ? "[color:var(--section-card-label-active)] opacity-80" : "text-(--text-disabled)"
|
|
39
|
+
].join(" "),
|
|
40
|
+
children: icon
|
|
41
|
+
}
|
|
42
|
+
),
|
|
43
|
+
/* @__PURE__ */ jsxs("div", { className: "flex-1 min-w-0", children: [
|
|
44
|
+
/* @__PURE__ */ jsx(
|
|
45
|
+
"p",
|
|
46
|
+
{
|
|
47
|
+
className: [
|
|
48
|
+
"text-caption font-semibold uppercase tracking-wide",
|
|
49
|
+
checked ? "[color:var(--section-card-label-active)]" : "[color:var(--section-card-label)]"
|
|
50
|
+
].join(" "),
|
|
51
|
+
children: label
|
|
52
|
+
}
|
|
53
|
+
),
|
|
54
|
+
(checked ? summary : description) && /* @__PURE__ */ jsx(
|
|
55
|
+
"p",
|
|
56
|
+
{
|
|
57
|
+
className: [
|
|
58
|
+
"text-caption leading-snug mt-0.5 truncate",
|
|
59
|
+
checked ? "[color:var(--section-card-badge-active)]" : "[color:var(--section-card-badge)]"
|
|
60
|
+
].join(" "),
|
|
61
|
+
children: checked ? summary : description
|
|
62
|
+
}
|
|
63
|
+
)
|
|
64
|
+
] }),
|
|
65
|
+
checked && onEdit && /* @__PURE__ */ jsx(
|
|
66
|
+
"button",
|
|
67
|
+
{
|
|
68
|
+
type: "button",
|
|
69
|
+
onClick: onEdit,
|
|
70
|
+
"aria-label": editLabel,
|
|
71
|
+
className: "shrink-0 [color:var(--section-card-label-active)] opacity-70 hover:opacity-100 transition-opacity p-1 -m-1 rounded focus:outline-none focus-visible:ring-2 focus-visible:ring-white/40",
|
|
72
|
+
children: /* @__PURE__ */ jsx(Pencil, { size: 14 })
|
|
73
|
+
}
|
|
74
|
+
),
|
|
75
|
+
/* @__PURE__ */ jsx(
|
|
76
|
+
"button",
|
|
77
|
+
{
|
|
78
|
+
type: "button",
|
|
79
|
+
role: "switch",
|
|
80
|
+
"aria-checked": checked,
|
|
81
|
+
"aria-label": label,
|
|
82
|
+
onClick: () => onCheckedChange == null ? void 0 : onCheckedChange(!checked),
|
|
83
|
+
className: [
|
|
84
|
+
"relative inline-flex shrink-0 h-5 w-9 rounded-full transition-colors focus:outline-none focus-visible:ring-2",
|
|
85
|
+
checked ? "bg-(--surface-default)/30 focus-visible:ring-white/40" : "bg-(--surface-raised) border border-stroke-default focus-visible:ring-stroke-focus/30"
|
|
86
|
+
].join(" "),
|
|
87
|
+
children: /* @__PURE__ */ jsx(
|
|
88
|
+
"span",
|
|
89
|
+
{
|
|
90
|
+
className: [
|
|
91
|
+
"absolute top-0.5 inline-block h-4 w-4 rounded-full bg-(--surface-default) shadow-sm transition-transform",
|
|
92
|
+
checked ? "translate-x-[18px]" : "translate-x-0.5"
|
|
93
|
+
].join(" ")
|
|
94
|
+
}
|
|
95
|
+
)
|
|
96
|
+
}
|
|
97
|
+
)
|
|
98
|
+
]
|
|
91
99
|
}
|
|
92
100
|
)
|
|
93
|
-
|
|
94
|
-
|
|
101
|
+
]
|
|
102
|
+
}
|
|
95
103
|
);
|
|
96
104
|
}
|
|
97
105
|
export {
|