@rojaostudio/ds 1.0.0
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/LICENSE +21 -0
- package/README.md +89 -0
- 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/chunk-ORMEWXMH.js +37 -0
- package/dist/compat/generate.d.ts +6 -0
- package/dist/compat/generate.js +1 -0
- package/dist/compat/recipes.d.ts +1 -0
- package/dist/compat/recipes.js +1 -0
- package/dist/compat/themes.d.ts +1 -0
- package/dist/compat/themes.js +1 -0
- package/dist/compat/tokens.d.ts +1 -0
- package/dist/compat/tokens.js +1 -0
- package/dist/components/accordion.d.ts +35 -0
- package/dist/components/accordion.js +95 -0
- package/dist/components/alert.d.ts +24 -0
- package/dist/components/alert.js +72 -0
- package/dist/components/avatar.d.ts +45 -0
- package/dist/components/avatar.js +97 -0
- package/dist/components/badge.d.ts +45 -0
- package/dist/components/badge.js +114 -0
- package/dist/components/blocker-card.d.ts +42 -0
- package/dist/components/blocker-card.js +45 -0
- package/dist/components/bottom-sheet.d.ts +31 -0
- package/dist/components/bottom-sheet.js +120 -0
- package/dist/components/breadcrumb.d.ts +28 -0
- package/dist/components/breadcrumb.js +52 -0
- package/dist/components/button.d.ts +27 -0
- package/dist/components/button.js +124 -0
- package/dist/components/card.d.ts +27 -0
- package/dist/components/card.js +52 -0
- package/dist/components/chat-bubble.d.ts +16 -0
- package/dist/components/chat-bubble.js +55 -0
- package/dist/components/checkbox.d.ts +14 -0
- package/dist/components/checkbox.js +78 -0
- package/dist/components/chip-input.d.ts +26 -0
- package/dist/components/chip-input.js +182 -0
- package/dist/components/chips.d.ts +22 -0
- package/dist/components/chips.js +94 -0
- package/dist/components/choice-card.d.ts +16 -0
- package/dist/components/choice-card.js +60 -0
- package/dist/components/choice-carousel.d.ts +16 -0
- package/dist/components/choice-carousel.js +154 -0
- package/dist/components/choice-preview-card.d.ts +37 -0
- package/dist/components/choice-preview-card.js +39 -0
- package/dist/components/color-input.d.ts +20 -0
- package/dist/components/color-input.js +79 -0
- package/dist/components/combobox.d.ts +70 -0
- package/dist/components/combobox.js +213 -0
- package/dist/components/context-menu.d.ts +33 -0
- package/dist/components/context-menu.js +70 -0
- package/dist/components/copilot-hint.d.ts +18 -0
- package/dist/components/copilot-hint.js +63 -0
- package/dist/components/copy-field.d.ts +16 -0
- package/dist/components/copy-field.js +41 -0
- package/dist/components/currency-input.d.ts +32 -0
- package/dist/components/currency-input.js +138 -0
- package/dist/components/danger-zone.d.ts +20 -0
- package/dist/components/danger-zone.js +21 -0
- package/dist/components/data-table-header.d.ts +43 -0
- package/dist/components/data-table-header.js +205 -0
- package/dist/components/date-picker.d.ts +40 -0
- package/dist/components/date-picker.js +252 -0
- package/dist/components/divider.d.ts +20 -0
- package/dist/components/divider.js +47 -0
- package/dist/components/drawer.d.ts +26 -0
- package/dist/components/drawer.js +82 -0
- package/dist/components/dropzone.d.ts +19 -0
- package/dist/components/dropzone.js +65 -0
- package/dist/components/empty-state.d.ts +48 -0
- package/dist/components/empty-state.js +91 -0
- package/dist/components/fab.d.ts +38 -0
- package/dist/components/fab.js +100 -0
- package/dist/components/filter-chip.d.ts +54 -0
- package/dist/components/filter-chip.js +66 -0
- package/dist/components/floating-stepper.d.ts +44 -0
- package/dist/components/floating-stepper.js +53 -0
- package/dist/components/form-card-header.d.ts +13 -0
- package/dist/components/form-card-header.js +8 -0
- package/dist/components/icon-button.d.ts +17 -0
- package/dist/components/icon-button.js +80 -0
- package/dist/components/image-crop-modal.d.ts +59 -0
- package/dist/components/image-crop-modal.js +240 -0
- package/dist/components/image-upload.d.ts +72 -0
- package/dist/components/image-upload.js +271 -0
- package/dist/components/index.d.ts +85 -0
- package/dist/components/index.js +200 -0
- package/dist/components/input.d.ts +25 -0
- package/dist/components/input.js +136 -0
- package/dist/components/insight-card.d.ts +19 -0
- package/dist/components/insight-card.js +27 -0
- package/dist/components/label.d.ts +16 -0
- package/dist/components/label.js +43 -0
- package/dist/components/media-tile.d.ts +24 -0
- package/dist/components/media-tile.js +28 -0
- package/dist/components/menu.d.ts +50 -0
- package/dist/components/menu.js +80 -0
- package/dist/components/modal.d.ts +25 -0
- package/dist/components/modal.js +71 -0
- package/dist/components/notice.d.ts +50 -0
- package/dist/components/notice.js +103 -0
- package/dist/components/option-tile.d.ts +60 -0
- package/dist/components/option-tile.js +144 -0
- package/dist/components/page-shell.d.ts +29 -0
- package/dist/components/page-shell.js +36 -0
- package/dist/components/page-skeleton.d.ts +35 -0
- package/dist/components/page-skeleton.js +12 -0
- package/dist/components/page-tabs.d.ts +35 -0
- package/dist/components/page-tabs.js +55 -0
- package/dist/components/pagination.d.ts +31 -0
- package/dist/components/pagination.js +80 -0
- package/dist/components/paywall-banner.d.ts +37 -0
- package/dist/components/paywall-banner.js +42 -0
- package/dist/components/paywall.d.ts +44 -0
- package/dist/components/paywall.js +55 -0
- package/dist/components/phone-frame.d.ts +9 -0
- package/dist/components/phone-frame.js +18 -0
- package/dist/components/phone-input.d.ts +24 -0
- package/dist/components/phone-input.js +92 -0
- package/dist/components/pix-icon.d.ts +8 -0
- package/dist/components/pix-icon.js +24 -0
- package/dist/components/popover.d.ts +44 -0
- package/dist/components/popover.js +140 -0
- package/dist/components/pricing-card.d.ts +42 -0
- package/dist/components/pricing-card.js +29 -0
- package/dist/components/qr-display.d.ts +19 -0
- package/dist/components/qr-display.js +24 -0
- package/dist/components/radio.d.ts +33 -0
- package/dist/components/radio.js +97 -0
- package/dist/components/row-actions.d.ts +24 -0
- package/dist/components/row-actions.js +76 -0
- package/dist/components/saving-bar-context.d.ts +40 -0
- package/dist/components/saving-bar-context.js +125 -0
- package/dist/components/saving-bar.d.ts +18 -0
- package/dist/components/saving-bar.js +72 -0
- package/dist/components/search.d.ts +30 -0
- package/dist/components/search.js +81 -0
- package/dist/components/section-card.d.ts +14 -0
- package/dist/components/section-card.js +49 -0
- package/dist/components/section-header.d.ts +29 -0
- package/dist/components/section-header.js +7 -0
- package/dist/components/select.d.ts +21 -0
- package/dist/components/select.js +140 -0
- package/dist/components/selectable-card.d.ts +35 -0
- package/dist/components/selectable-card.js +27 -0
- package/dist/components/setting-row.d.ts +33 -0
- package/dist/components/setting-row.js +19 -0
- package/dist/components/settings-list.d.ts +25 -0
- package/dist/components/settings-list.js +22 -0
- package/dist/components/skeleton.d.ts +24 -0
- package/dist/components/skeleton.js +49 -0
- package/dist/components/slider.d.ts +32 -0
- package/dist/components/slider.js +79 -0
- package/dist/components/spinner.d.ts +14 -0
- package/dist/components/spinner.js +36 -0
- package/dist/components/step-progress.d.ts +12 -0
- package/dist/components/step-progress.js +24 -0
- package/dist/components/summary-bar.d.ts +31 -0
- package/dist/components/summary-bar.js +54 -0
- package/dist/components/table.d.ts +23 -0
- package/dist/components/table.js +80 -0
- package/dist/components/textarea.d.ts +21 -0
- package/dist/components/textarea.js +95 -0
- package/dist/components/themed.d.ts +36 -0
- package/dist/components/themed.js +22 -0
- package/dist/components/time-picker.d.ts +34 -0
- package/dist/components/time-picker.js +213 -0
- package/dist/components/toaster.d.ts +84 -0
- package/dist/components/toaster.js +284 -0
- package/dist/components/toggle-card-compact.d.ts +21 -0
- package/dist/components/toggle-card-compact.js +99 -0
- package/dist/components/toggle-card.d.ts +15 -0
- package/dist/components/toggle-card.js +76 -0
- package/dist/components/toggle-group.d.ts +67 -0
- package/dist/components/toggle-group.js +80 -0
- package/dist/components/toggle.d.ts +13 -0
- package/dist/components/toggle.js +64 -0
- package/dist/components/tooltip.d.ts +17 -0
- package/dist/components/tooltip.js +89 -0
- package/dist/components/typing-indicator.d.ts +8 -0
- package/dist/components/typing-indicator.js +27 -0
- package/dist/components/use-dismiss.d.ts +9 -0
- package/dist/components/use-dismiss.js +28 -0
- package/dist/components/use-focus-trap.d.ts +5 -0
- package/dist/components/use-focus-trap.js +54 -0
- package/dist/icons/index.d.ts +1 -0
- package/dist/icons/index.js +89 -0
- package/dist/targets/native/components/accordion.d.ts +18 -0
- package/dist/targets/native/components/accordion.js +122 -0
- package/dist/targets/native/components/alert.d.ts +16 -0
- package/dist/targets/native/components/alert.js +58 -0
- package/dist/targets/native/components/avatar.d.ts +25 -0
- package/dist/targets/native/components/avatar.js +88 -0
- package/dist/targets/native/components/badge.d.ts +27 -0
- package/dist/targets/native/components/badge.js +59 -0
- package/dist/targets/native/components/button.d.ts +18 -0
- package/dist/targets/native/components/button.js +84 -0
- package/dist/targets/native/components/card.d.ts +6 -0
- package/dist/targets/native/components/card.js +36 -0
- package/dist/targets/native/components/checkbox.d.ts +12 -0
- package/dist/targets/native/components/checkbox.js +59 -0
- package/dist/targets/native/components/chips.d.ts +17 -0
- package/dist/targets/native/components/chips.js +77 -0
- package/dist/targets/native/components/choice-card.d.ts +11 -0
- package/dist/targets/native/components/choice-card.js +52 -0
- package/dist/targets/native/components/context-menu.d.ts +11 -0
- package/dist/targets/native/components/context-menu.js +19 -0
- package/dist/targets/native/components/currency-input.d.ts +22 -0
- package/dist/targets/native/components/currency-input.js +105 -0
- package/dist/targets/native/components/danger-zone.d.ts +13 -0
- package/dist/targets/native/components/danger-zone.js +27 -0
- package/dist/targets/native/components/date-picker.d.ts +13 -0
- package/dist/targets/native/components/date-picker.js +185 -0
- package/dist/targets/native/components/divider.d.ts +9 -0
- package/dist/targets/native/components/divider.js +36 -0
- package/dist/targets/native/components/empty-state.d.ts +13 -0
- package/dist/targets/native/components/empty-state.js +10 -0
- package/dist/targets/native/components/fab.d.ts +25 -0
- package/dist/targets/native/components/fab.js +112 -0
- package/dist/targets/native/components/filter-chip.d.ts +22 -0
- package/dist/targets/native/components/filter-chip.js +70 -0
- package/dist/targets/native/components/form-field.d.ts +13 -0
- package/dist/targets/native/components/form-field.js +29 -0
- package/dist/targets/native/components/form-screen.d.ts +19 -0
- package/dist/targets/native/components/form-screen.js +88 -0
- package/dist/targets/native/components/google-icon.d.ts +8 -0
- package/dist/targets/native/components/google-icon.js +32 -0
- package/dist/targets/native/components/icon-button.d.ts +18 -0
- package/dist/targets/native/components/icon-button.js +80 -0
- package/dist/targets/native/components/icon.d.ts +11 -0
- package/dist/targets/native/components/icon.js +9 -0
- package/dist/targets/native/components/image-upload.d.ts +12 -0
- package/dist/targets/native/components/image-upload.js +95 -0
- package/dist/targets/native/components/index.d.ts +45 -0
- package/dist/targets/native/components/index.js +100 -0
- package/dist/targets/native/components/input.d.ts +17 -0
- package/dist/targets/native/components/input.js +103 -0
- package/dist/targets/native/components/list-item.d.ts +20 -0
- package/dist/targets/native/components/list-item.js +71 -0
- package/dist/targets/native/components/menu.d.ts +24 -0
- package/dist/targets/native/components/menu.js +71 -0
- package/dist/targets/native/components/modal.d.ts +15 -0
- package/dist/targets/native/components/modal.js +110 -0
- package/dist/targets/native/components/paywall-banner.d.ts +11 -0
- package/dist/targets/native/components/paywall-banner.js +46 -0
- package/dist/targets/native/components/paywall.d.ts +18 -0
- package/dist/targets/native/components/paywall.js +61 -0
- package/dist/targets/native/components/radio.d.ts +20 -0
- package/dist/targets/native/components/radio.js +71 -0
- package/dist/targets/native/components/search.d.ts +22 -0
- package/dist/targets/native/components/search.js +92 -0
- package/dist/targets/native/components/select.d.ts +17 -0
- package/dist/targets/native/components/select.js +86 -0
- package/dist/targets/native/components/sheet.d.ts +11 -0
- package/dist/targets/native/components/sheet.js +51 -0
- package/dist/targets/native/components/skeleton.d.ts +18 -0
- package/dist/targets/native/components/skeleton.js +52 -0
- package/dist/targets/native/components/slider.d.ts +18 -0
- package/dist/targets/native/components/slider.js +153 -0
- package/dist/targets/native/components/spinner.d.ts +7 -0
- package/dist/targets/native/components/spinner.js +10 -0
- package/dist/targets/native/components/stepper.d.ts +10 -0
- package/dist/targets/native/components/stepper.js +33 -0
- package/dist/targets/native/components/switch.d.ts +20 -0
- package/dist/targets/native/components/switch.js +68 -0
- package/dist/targets/native/components/text.d.ts +12 -0
- package/dist/targets/native/components/text.js +31 -0
- package/dist/targets/native/components/textarea.d.ts +13 -0
- package/dist/targets/native/components/textarea.js +92 -0
- package/dist/targets/native/components/theme.d.ts +18 -0
- package/dist/targets/native/components/theme.js +20 -0
- package/dist/targets/native/components/toaster.d.ts +35 -0
- package/dist/targets/native/components/toaster.js +159 -0
- package/dist/targets/native/fonts.d.ts +9 -0
- package/dist/targets/native/fonts.js +10 -0
- package/dist/targets/native/icons.d.ts +1 -0
- package/dist/targets/native/icons.js +1 -0
- package/dist/targets/native/index.d.ts +3 -0
- package/dist/targets/native/index.js +11 -0
- package/dist/targets/native/preset.cjs +69 -0
- package/dist/targets/native/resolve.d.ts +22 -0
- package/dist/targets/native/resolve.js +85 -0
- package/dist/targets/native/theme.css +118 -0
- package/dist/targets/native/theme.d.ts +117 -0
- package/dist/targets/native/theme.js +118 -0
- package/package.json +194 -0
- package/styles/_primitives.generated.css +284 -0
- package/styles/base.css +950 -0
- package/styles/themes/rojao.css +107 -0
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import "../chunk-ORMEWXMH.js";
|
|
3
|
+
import { useId } from "react";
|
|
4
|
+
const SIZE_CLASS = {
|
|
5
|
+
sm: "h-control-sm text-caption px-2.5 gap-1",
|
|
6
|
+
md: "h-control-md text-label px-3 gap-1.5",
|
|
7
|
+
lg: "h-control-lg text-label px-4 gap-2"
|
|
8
|
+
};
|
|
9
|
+
function ToggleGroup(props) {
|
|
10
|
+
var _a, _b, _c, _d;
|
|
11
|
+
const options = props.options;
|
|
12
|
+
const size = (_a = props.size) != null ? _a : "md";
|
|
13
|
+
const className = (_b = props.className) != null ? _b : "";
|
|
14
|
+
const stretch = (_c = props.stretch) != null ? _c : false;
|
|
15
|
+
const label = props.label;
|
|
16
|
+
const selectedTone = (_d = props.selectedTone) != null ? _d : "brand";
|
|
17
|
+
const isMulti = props.type === "multi";
|
|
18
|
+
const groupId = useId();
|
|
19
|
+
function isActive(opt) {
|
|
20
|
+
return isMulti ? props.value.includes(opt.value) : props.value === opt.value;
|
|
21
|
+
}
|
|
22
|
+
function handleClick(opt) {
|
|
23
|
+
if (opt.disabled) return;
|
|
24
|
+
if (isMulti) {
|
|
25
|
+
const current = props.value;
|
|
26
|
+
const next = current.includes(opt.value) ? current.filter((v) => v !== opt.value) : [...current, opt.value];
|
|
27
|
+
props.onChange(next);
|
|
28
|
+
} else {
|
|
29
|
+
const single = props;
|
|
30
|
+
if (single.allowDeselect && single.value === opt.value) {
|
|
31
|
+
single.onChange(null);
|
|
32
|
+
} else {
|
|
33
|
+
single.onChange(opt.value);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
const group = /* @__PURE__ */ React.createElement(
|
|
38
|
+
"div",
|
|
39
|
+
{
|
|
40
|
+
id: groupId,
|
|
41
|
+
role: isMulti ? "group" : "radiogroup",
|
|
42
|
+
"aria-label": props["aria-label"],
|
|
43
|
+
className: [
|
|
44
|
+
stretch ? "flex w-full" : "inline-flex",
|
|
45
|
+
"rounded-(--radius-control) border border-stroke-default bg-surface-default p-0.5 gap-0.5",
|
|
46
|
+
label ? "" : className
|
|
47
|
+
].join(" ")
|
|
48
|
+
},
|
|
49
|
+
options.map((opt) => {
|
|
50
|
+
const active = isActive(opt);
|
|
51
|
+
return /* @__PURE__ */ React.createElement(
|
|
52
|
+
"button",
|
|
53
|
+
{
|
|
54
|
+
key: opt.value,
|
|
55
|
+
type: "button",
|
|
56
|
+
role: isMulti ? "switch" : "radio",
|
|
57
|
+
"aria-checked": active,
|
|
58
|
+
disabled: opt.disabled,
|
|
59
|
+
style: opt.style,
|
|
60
|
+
onClick: () => handleClick(opt),
|
|
61
|
+
className: [
|
|
62
|
+
"inline-flex items-center justify-center rounded-(--radius-control) font-medium transition-colors",
|
|
63
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-stroke-focus focus-visible:z-10",
|
|
64
|
+
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
65
|
+
stretch ? "flex-1" : "",
|
|
66
|
+
SIZE_CLASS[size],
|
|
67
|
+
active ? selectedTone === "neutral" ? "bg-surface-invert text-fg-inverse" : "bg-brand-primary text-brand-on-primary" : "text-fg-secondary hover:text-fg-primary hover:bg-surface-raised"
|
|
68
|
+
].join(" ")
|
|
69
|
+
},
|
|
70
|
+
opt.icon && /* @__PURE__ */ React.createElement("span", { className: "[&_svg]:size-4 shrink-0" }, opt.icon),
|
|
71
|
+
opt.label && /* @__PURE__ */ React.createElement("span", null, opt.label)
|
|
72
|
+
);
|
|
73
|
+
})
|
|
74
|
+
);
|
|
75
|
+
if (!label) return group;
|
|
76
|
+
return /* @__PURE__ */ React.createElement("div", { className: ["flex flex-col gap-1.5", className].join(" ") }, /* @__PURE__ */ React.createElement("label", { htmlFor: groupId, className: "text-label font-medium text-fg-primary" }, label), group);
|
|
77
|
+
}
|
|
78
|
+
export {
|
|
79
|
+
ToggleGroup
|
|
80
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { InputHTMLAttributes, ReactNode } from 'react';
|
|
3
|
+
|
|
4
|
+
interface ToggleProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'type' | 'size'> {
|
|
5
|
+
label?: ReactNode;
|
|
6
|
+
description?: ReactNode;
|
|
7
|
+
size?: 'sm' | 'md' | 'lg';
|
|
8
|
+
/** Posição do label em relação ao switch. default = "right". */
|
|
9
|
+
labelPosition?: 'left' | 'right';
|
|
10
|
+
}
|
|
11
|
+
declare const Toggle: react.ForwardRefExoticComponent<ToggleProps & react.RefAttributes<HTMLInputElement>>;
|
|
12
|
+
|
|
13
|
+
export { Toggle, type ToggleProps };
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
__objRest,
|
|
4
|
+
__spreadValues
|
|
5
|
+
} from "../chunk-ORMEWXMH.js";
|
|
6
|
+
import { forwardRef, useId } from "react";
|
|
7
|
+
const SIZE = {
|
|
8
|
+
sm: { track: "h-4 w-7", thumb: "size-3 peer-checked:translate-x-3.5", text: "text-caption" },
|
|
9
|
+
md: { track: "h-5 w-9", thumb: "size-4 peer-checked:translate-x-4", text: "text-label" },
|
|
10
|
+
lg: { track: "h-6 w-11", thumb: "size-5 peer-checked:translate-x-5", text: "text-label" }
|
|
11
|
+
};
|
|
12
|
+
const Toggle = forwardRef(function Toggle2(_a, ref) {
|
|
13
|
+
var _b = _a, { label, description, size = "md", labelPosition = "right", className = "", id } = _b, props = __objRest(_b, ["label", "description", "size", "labelPosition", "className", "id"]);
|
|
14
|
+
const generatedId = useId();
|
|
15
|
+
const inputId = id != null ? id : generatedId;
|
|
16
|
+
const sz = SIZE[size];
|
|
17
|
+
const labelEl = (label || description) && /* @__PURE__ */ React.createElement("span", { className: "flex flex-col gap-0.5 select-none" }, label && /* @__PURE__ */ React.createElement("span", { className: [sz.text, "text-fg-primary leading-snug"].join(" ") }, label), description && /* @__PURE__ */ React.createElement("span", { className: "text-caption text-fg-muted leading-snug" }, description));
|
|
18
|
+
const switchEl = /* @__PURE__ */ React.createElement("span", { className: ["relative inline-flex shrink-0 items-center", sz.track].join(" ") }, /* @__PURE__ */ React.createElement(
|
|
19
|
+
"input",
|
|
20
|
+
__spreadValues({
|
|
21
|
+
ref,
|
|
22
|
+
type: "checkbox",
|
|
23
|
+
role: "switch",
|
|
24
|
+
id: inputId,
|
|
25
|
+
className: "peer sr-only"
|
|
26
|
+
}, props)
|
|
27
|
+
), /* @__PURE__ */ React.createElement(
|
|
28
|
+
"span",
|
|
29
|
+
{
|
|
30
|
+
className: [
|
|
31
|
+
"absolute inset-0 rounded-full transition-colors",
|
|
32
|
+
"bg-surface-raised border border-stroke-control",
|
|
33
|
+
"peer-checked:bg-(--toggle-track-active) peer-checked:border-transparent",
|
|
34
|
+
"peer-focus-visible:ring-2 peer-focus-visible:ring-stroke-focus/30",
|
|
35
|
+
"peer-disabled:cursor-not-allowed"
|
|
36
|
+
].join(" ")
|
|
37
|
+
}
|
|
38
|
+
), /* @__PURE__ */ React.createElement(
|
|
39
|
+
"span",
|
|
40
|
+
{
|
|
41
|
+
className: [
|
|
42
|
+
"relative rounded-full bg-surface-default shadow-sm transition-transform translate-x-0.5",
|
|
43
|
+
sz.thumb
|
|
44
|
+
].join(" ")
|
|
45
|
+
}
|
|
46
|
+
));
|
|
47
|
+
return /* @__PURE__ */ React.createElement(
|
|
48
|
+
"label",
|
|
49
|
+
{
|
|
50
|
+
htmlFor: inputId,
|
|
51
|
+
className: [
|
|
52
|
+
"inline-flex items-start gap-2.5 cursor-pointer",
|
|
53
|
+
"has-[:disabled]:opacity-50 has-[:disabled]:cursor-not-allowed",
|
|
54
|
+
className
|
|
55
|
+
].filter(Boolean).join(" ")
|
|
56
|
+
},
|
|
57
|
+
labelPosition === "left" && labelEl,
|
|
58
|
+
/* @__PURE__ */ React.createElement("span", { className: "flex items-center pt-0.5" }, switchEl),
|
|
59
|
+
labelPosition === "right" && labelEl
|
|
60
|
+
);
|
|
61
|
+
});
|
|
62
|
+
export {
|
|
63
|
+
Toggle
|
|
64
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
|
|
4
|
+
interface TooltipProps {
|
|
5
|
+
content: ReactNode;
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
side?: 'top' | 'bottom' | 'left' | 'right';
|
|
8
|
+
delay?: number;
|
|
9
|
+
/** Extra classes on the tooltip bubble — use to override whitespace-nowrap for rich content */
|
|
10
|
+
className?: string;
|
|
11
|
+
/** Classes on the trigger wrapper span — override the default `inline-flex items-center` when the
|
|
12
|
+
* target must fill a flex/grid cell (e.g. `relative flex-1`, `block w-full`). */
|
|
13
|
+
wrapperClassName?: string;
|
|
14
|
+
}
|
|
15
|
+
declare function Tooltip({ content, children, side, delay, className, wrapperClassName }: TooltipProps): react.JSX.Element;
|
|
16
|
+
|
|
17
|
+
export { Tooltip, type TooltipProps };
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import "../chunk-ORMEWXMH.js";
|
|
3
|
+
import { useState, useRef, useEffect, useId } from "react";
|
|
4
|
+
const GAP = 8;
|
|
5
|
+
function getFixedPos(rect, side) {
|
|
6
|
+
const vpW = typeof window !== "undefined" ? window.innerWidth : 1920;
|
|
7
|
+
const EDGE = 80;
|
|
8
|
+
switch (side) {
|
|
9
|
+
case "right":
|
|
10
|
+
return { top: rect.top + rect.height / 2, left: rect.right + GAP, transform: "translateY(-50%)" };
|
|
11
|
+
case "left":
|
|
12
|
+
return { top: rect.top + rect.height / 2, left: rect.left - GAP, transform: "translate(-100%, -50%)" };
|
|
13
|
+
case "bottom": {
|
|
14
|
+
const cx = rect.left + rect.width / 2;
|
|
15
|
+
if (cx > vpW - EDGE) return { top: rect.bottom + GAP, left: rect.right, transform: "translateX(-100%)" };
|
|
16
|
+
if (cx < EDGE) return { top: rect.bottom + GAP, left: rect.left, transform: "" };
|
|
17
|
+
return { top: rect.bottom + GAP, left: cx, transform: "translateX(-50%)" };
|
|
18
|
+
}
|
|
19
|
+
case "top":
|
|
20
|
+
default: {
|
|
21
|
+
const cx = rect.left + rect.width / 2;
|
|
22
|
+
if (cx > vpW - EDGE) return { top: rect.top - GAP, left: rect.right, transform: "translate(-100%, -100%)" };
|
|
23
|
+
if (cx < EDGE) return { top: rect.top - GAP, left: rect.left, transform: "translateY(-100%)" };
|
|
24
|
+
return { top: rect.top - GAP, left: cx, transform: "translate(-50%, -100%)" };
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
const ARROW_CLASSES = {
|
|
29
|
+
top: `bottom-0 left-1/2 -translate-x-1/2 translate-y-full border-t-[var(--tooltip-bg)] border-x-transparent border-b-transparent`,
|
|
30
|
+
bottom: `top-0 left-1/2 -translate-x-1/2 -translate-y-full border-b-[var(--tooltip-bg)] border-x-transparent border-t-transparent`,
|
|
31
|
+
left: `right-0 top-1/2 -translate-y-1/2 translate-x-full border-l-[var(--tooltip-bg)] border-y-transparent border-r-transparent`,
|
|
32
|
+
right: `left-0 top-1/2 -translate-y-1/2 -translate-x-full border-r-[var(--tooltip-bg)] border-y-transparent border-l-transparent`
|
|
33
|
+
};
|
|
34
|
+
function Tooltip({ content, children, side = "top", delay = 300, className, wrapperClassName }) {
|
|
35
|
+
const id = useId();
|
|
36
|
+
const ref = useRef(null);
|
|
37
|
+
const timer = useRef(null);
|
|
38
|
+
const [pos, setPos] = useState(null);
|
|
39
|
+
function show() {
|
|
40
|
+
timer.current = setTimeout(() => {
|
|
41
|
+
if (!ref.current) return;
|
|
42
|
+
setPos(getFixedPos(ref.current.getBoundingClientRect(), side));
|
|
43
|
+
}, delay);
|
|
44
|
+
}
|
|
45
|
+
function hide() {
|
|
46
|
+
if (timer.current) clearTimeout(timer.current);
|
|
47
|
+
setPos(null);
|
|
48
|
+
}
|
|
49
|
+
useEffect(() => () => {
|
|
50
|
+
if (timer.current) clearTimeout(timer.current);
|
|
51
|
+
}, []);
|
|
52
|
+
return /* @__PURE__ */ React.createElement(
|
|
53
|
+
"span",
|
|
54
|
+
{
|
|
55
|
+
ref,
|
|
56
|
+
className: wrapperClassName != null ? wrapperClassName : "inline-flex items-center",
|
|
57
|
+
onMouseEnter: show,
|
|
58
|
+
onMouseLeave: hide,
|
|
59
|
+
onFocus: show,
|
|
60
|
+
onBlur: hide,
|
|
61
|
+
"aria-describedby": pos ? id : void 0
|
|
62
|
+
},
|
|
63
|
+
children,
|
|
64
|
+
pos && /* @__PURE__ */ React.createElement(
|
|
65
|
+
"span",
|
|
66
|
+
{
|
|
67
|
+
id,
|
|
68
|
+
role: "tooltip",
|
|
69
|
+
style: { position: "fixed", top: pos.top, left: pos.left, transform: pos.transform },
|
|
70
|
+
className: `z-[9999] px-2.5 py-1.5 bg-[var(--tooltip-bg)] text-[var(--tooltip-text)] text-caption font-medium rounded-(--radius-tooltip) whitespace-nowrap pointer-events-none shadow-md${className ? ` ${className}` : ""}`
|
|
71
|
+
},
|
|
72
|
+
/* @__PURE__ */ React.createElement(
|
|
73
|
+
"span",
|
|
74
|
+
{
|
|
75
|
+
"aria-hidden": "true",
|
|
76
|
+
className: [
|
|
77
|
+
"absolute border-[5px]",
|
|
78
|
+
ARROW_CLASSES[side]
|
|
79
|
+
].join(" "),
|
|
80
|
+
style: { width: 0, height: 0 }
|
|
81
|
+
}
|
|
82
|
+
),
|
|
83
|
+
content
|
|
84
|
+
)
|
|
85
|
+
);
|
|
86
|
+
}
|
|
87
|
+
export {
|
|
88
|
+
Tooltip
|
|
89
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import "../chunk-ORMEWXMH.js";
|
|
3
|
+
import { ChatBubble } from "./chat-bubble.js";
|
|
4
|
+
function TypingIndicator({ ariaLabel = "Digitando" }) {
|
|
5
|
+
const dotStyle = (delay) => ({
|
|
6
|
+
width: "var(--typing-dot-size)",
|
|
7
|
+
height: "var(--typing-dot-size)",
|
|
8
|
+
background: "var(--typing-dot-color)",
|
|
9
|
+
borderRadius: "9999px",
|
|
10
|
+
animation: "rojao-typing-pulse 1400ms infinite",
|
|
11
|
+
animationDelay: delay
|
|
12
|
+
});
|
|
13
|
+
return /* @__PURE__ */ React.createElement(ChatBubble, { variant: "bot", ariaLabel }, /* @__PURE__ */ React.createElement(
|
|
14
|
+
"span",
|
|
15
|
+
{
|
|
16
|
+
className: "inline-flex items-center",
|
|
17
|
+
style: { gap: "var(--typing-dot-gap)" },
|
|
18
|
+
"aria-live": "polite"
|
|
19
|
+
},
|
|
20
|
+
/* @__PURE__ */ React.createElement("span", { style: dotStyle("0ms") }),
|
|
21
|
+
/* @__PURE__ */ React.createElement("span", { style: dotStyle("200ms") }),
|
|
22
|
+
/* @__PURE__ */ React.createElement("span", { style: dotStyle("400ms") })
|
|
23
|
+
));
|
|
24
|
+
}
|
|
25
|
+
export {
|
|
26
|
+
TypingIndicator
|
|
27
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { RefObject } from 'react';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* useDismiss — outside-click + ESC para overlays (dropdown, combobox, etc).
|
|
5
|
+
* Stale-closure safe: handler updates on every render via ref.
|
|
6
|
+
*/
|
|
7
|
+
declare function useDismiss(popupRef: RefObject<Element | null>, triggerRef: RefObject<Element | null>, onDismiss: () => void, active: boolean): void;
|
|
8
|
+
|
|
9
|
+
export { useDismiss };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import "../chunk-ORMEWXMH.js";
|
|
3
|
+
import { useEffect, useRef } from "react";
|
|
4
|
+
function useDismiss(popupRef, triggerRef, onDismiss, active) {
|
|
5
|
+
const cb = useRef(onDismiss);
|
|
6
|
+
cb.current = onDismiss;
|
|
7
|
+
useEffect(() => {
|
|
8
|
+
if (!active) return;
|
|
9
|
+
const onMouse = (e) => {
|
|
10
|
+
var _a, _b;
|
|
11
|
+
const t = e.target;
|
|
12
|
+
if (((_a = popupRef.current) == null ? void 0 : _a.contains(t)) || ((_b = triggerRef.current) == null ? void 0 : _b.contains(t))) return;
|
|
13
|
+
cb.current();
|
|
14
|
+
};
|
|
15
|
+
const onKey = (e) => {
|
|
16
|
+
if (e.key === "Escape") cb.current();
|
|
17
|
+
};
|
|
18
|
+
document.addEventListener("mousedown", onMouse);
|
|
19
|
+
document.addEventListener("keydown", onKey);
|
|
20
|
+
return () => {
|
|
21
|
+
document.removeEventListener("mousedown", onMouse);
|
|
22
|
+
document.removeEventListener("keydown", onKey);
|
|
23
|
+
};
|
|
24
|
+
}, [active]);
|
|
25
|
+
}
|
|
26
|
+
export {
|
|
27
|
+
useDismiss
|
|
28
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import "../chunk-ORMEWXMH.js";
|
|
3
|
+
import { useEffect, useRef } from "react";
|
|
4
|
+
const FOCUSABLE = [
|
|
5
|
+
"a[href]",
|
|
6
|
+
"button:not([disabled])",
|
|
7
|
+
"textarea:not([disabled])",
|
|
8
|
+
"input:not([disabled])",
|
|
9
|
+
"select:not([disabled])",
|
|
10
|
+
'[tabindex]:not([tabindex="-1"])'
|
|
11
|
+
].join(", ");
|
|
12
|
+
function useFocusTrap(open) {
|
|
13
|
+
const ref = useRef(null);
|
|
14
|
+
useEffect(() => {
|
|
15
|
+
var _a;
|
|
16
|
+
if (!open) return;
|
|
17
|
+
const container = ref.current;
|
|
18
|
+
if (!container) return;
|
|
19
|
+
const previousFocus = document.activeElement;
|
|
20
|
+
const focusables = Array.from(container.querySelectorAll(FOCUSABLE));
|
|
21
|
+
((_a = focusables[0]) != null ? _a : container).focus();
|
|
22
|
+
const trap = (e) => {
|
|
23
|
+
if (e.key !== "Tab") return;
|
|
24
|
+
const nodes = Array.from(container.querySelectorAll(FOCUSABLE));
|
|
25
|
+
if (nodes.length === 0) {
|
|
26
|
+
e.preventDefault();
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
const first = nodes[0];
|
|
30
|
+
const last = nodes[nodes.length - 1];
|
|
31
|
+
if (!first || !last) return;
|
|
32
|
+
if (e.shiftKey) {
|
|
33
|
+
if (document.activeElement === first) {
|
|
34
|
+
e.preventDefault();
|
|
35
|
+
last.focus();
|
|
36
|
+
}
|
|
37
|
+
} else {
|
|
38
|
+
if (document.activeElement === last) {
|
|
39
|
+
e.preventDefault();
|
|
40
|
+
first.focus();
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
document.addEventListener("keydown", trap);
|
|
45
|
+
return () => {
|
|
46
|
+
document.removeEventListener("keydown", trap);
|
|
47
|
+
previousFocus == null ? void 0 : previousFocus.focus();
|
|
48
|
+
};
|
|
49
|
+
}, [open]);
|
|
50
|
+
return ref;
|
|
51
|
+
}
|
|
52
|
+
export {
|
|
53
|
+
useFocusTrap
|
|
54
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { AlertCircle, AlertTriangle, BarChart2, Check, CheckCircle, ChevronDown, ChevronLeft, ChevronRight, DollarSign, ExternalLink, FileText, GripVertical, House, Kanban, Layers, LayoutGrid, LayoutList, Loader2, LogOut, LucideIcon, LucideProps, Megaphone, Menu, MessagesSquare, Moon, Package, PanelLeftClose, PanelLeftOpen, Pencil, Plug, Plus, RefreshCw, Search, Settings, Star, Store, Sun, ThumbsUp, Trash2, Upload, Users, Wallet, X, Zap } from 'lucide-react';
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import "../chunk-ORMEWXMH.js";
|
|
2
|
+
import {
|
|
3
|
+
AlertCircle,
|
|
4
|
+
AlertTriangle,
|
|
5
|
+
BarChart2,
|
|
6
|
+
Check,
|
|
7
|
+
CheckCircle,
|
|
8
|
+
ChevronDown,
|
|
9
|
+
ChevronLeft,
|
|
10
|
+
ChevronRight,
|
|
11
|
+
DollarSign,
|
|
12
|
+
ExternalLink,
|
|
13
|
+
FileText,
|
|
14
|
+
GripVertical,
|
|
15
|
+
House,
|
|
16
|
+
Kanban,
|
|
17
|
+
Layers,
|
|
18
|
+
LayoutGrid,
|
|
19
|
+
LayoutList,
|
|
20
|
+
Loader2,
|
|
21
|
+
LogOut,
|
|
22
|
+
Megaphone,
|
|
23
|
+
Menu,
|
|
24
|
+
MessagesSquare,
|
|
25
|
+
Moon,
|
|
26
|
+
Package,
|
|
27
|
+
PanelLeftClose,
|
|
28
|
+
PanelLeftOpen,
|
|
29
|
+
Pencil,
|
|
30
|
+
Plug,
|
|
31
|
+
Plus,
|
|
32
|
+
RefreshCw,
|
|
33
|
+
Search,
|
|
34
|
+
Settings,
|
|
35
|
+
Star,
|
|
36
|
+
Store,
|
|
37
|
+
Sun,
|
|
38
|
+
ThumbsUp,
|
|
39
|
+
Trash2,
|
|
40
|
+
Upload,
|
|
41
|
+
Users,
|
|
42
|
+
Wallet,
|
|
43
|
+
X,
|
|
44
|
+
Zap
|
|
45
|
+
} from "lucide-react";
|
|
46
|
+
export {
|
|
47
|
+
AlertCircle,
|
|
48
|
+
AlertTriangle,
|
|
49
|
+
BarChart2,
|
|
50
|
+
Check,
|
|
51
|
+
CheckCircle,
|
|
52
|
+
ChevronDown,
|
|
53
|
+
ChevronLeft,
|
|
54
|
+
ChevronRight,
|
|
55
|
+
DollarSign,
|
|
56
|
+
ExternalLink,
|
|
57
|
+
FileText,
|
|
58
|
+
GripVertical,
|
|
59
|
+
House,
|
|
60
|
+
Kanban,
|
|
61
|
+
Layers,
|
|
62
|
+
LayoutGrid,
|
|
63
|
+
LayoutList,
|
|
64
|
+
Loader2,
|
|
65
|
+
LogOut,
|
|
66
|
+
Megaphone,
|
|
67
|
+
Menu,
|
|
68
|
+
MessagesSquare,
|
|
69
|
+
Moon,
|
|
70
|
+
Package,
|
|
71
|
+
PanelLeftClose,
|
|
72
|
+
PanelLeftOpen,
|
|
73
|
+
Pencil,
|
|
74
|
+
Plug,
|
|
75
|
+
Plus,
|
|
76
|
+
RefreshCw,
|
|
77
|
+
Search,
|
|
78
|
+
Settings,
|
|
79
|
+
Star,
|
|
80
|
+
Store,
|
|
81
|
+
Sun,
|
|
82
|
+
ThumbsUp,
|
|
83
|
+
Trash2,
|
|
84
|
+
Upload,
|
|
85
|
+
Users,
|
|
86
|
+
Wallet,
|
|
87
|
+
X,
|
|
88
|
+
Zap
|
|
89
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
|
|
4
|
+
type AccordionProps = {
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
/** Permite vários itens abertos ao mesmo tempo. Default: false (single). */
|
|
7
|
+
allowMultiple?: boolean;
|
|
8
|
+
};
|
|
9
|
+
declare function Accordion({ children, allowMultiple }: AccordionProps): react.JSX.Element;
|
|
10
|
+
type AccordionItemProps = {
|
|
11
|
+
title: string;
|
|
12
|
+
children: ReactNode;
|
|
13
|
+
defaultOpen?: boolean;
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
};
|
|
16
|
+
declare function AccordionItem({ title, children, defaultOpen, disabled }: AccordionItemProps): react.JSX.Element;
|
|
17
|
+
|
|
18
|
+
export { Accordion, AccordionItem, type AccordionItemProps, type AccordionProps };
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import "../../../chunk-ORMEWXMH.js";
|
|
2
|
+
import { ChevronDown } from "lucide-react-native";
|
|
3
|
+
import {
|
|
4
|
+
createContext,
|
|
5
|
+
useCallback,
|
|
6
|
+
useContext,
|
|
7
|
+
useEffect,
|
|
8
|
+
useRef,
|
|
9
|
+
useState
|
|
10
|
+
} from "react";
|
|
11
|
+
import { Animated, LayoutAnimation, Platform, Pressable, StyleSheet, UIManager, View } from "react-native";
|
|
12
|
+
import { Text } from "./text.js";
|
|
13
|
+
import { useTheme } from "./theme.js";
|
|
14
|
+
if (Platform.OS === "android" && UIManager.setLayoutAnimationEnabledExperimental) {
|
|
15
|
+
UIManager.setLayoutAnimationEnabledExperimental(true);
|
|
16
|
+
}
|
|
17
|
+
const AccordionContext = createContext(null);
|
|
18
|
+
function Accordion({ children, allowMultiple = false }) {
|
|
19
|
+
const t = useTheme();
|
|
20
|
+
const registry = useRef(/* @__PURE__ */ new Map());
|
|
21
|
+
const register = useCallback((id, close) => {
|
|
22
|
+
registry.current.set(id, close);
|
|
23
|
+
return () => {
|
|
24
|
+
registry.current.delete(id);
|
|
25
|
+
};
|
|
26
|
+
}, []);
|
|
27
|
+
const notifyOpen = useCallback(
|
|
28
|
+
(id) => {
|
|
29
|
+
if (allowMultiple) return;
|
|
30
|
+
registry.current.forEach((close, key) => {
|
|
31
|
+
if (key !== id) close();
|
|
32
|
+
});
|
|
33
|
+
},
|
|
34
|
+
[allowMultiple]
|
|
35
|
+
);
|
|
36
|
+
return /* @__PURE__ */ React.createElement(AccordionContext.Provider, { value: { notifyOpen, register, allowMultiple } }, /* @__PURE__ */ React.createElement(
|
|
37
|
+
View,
|
|
38
|
+
{
|
|
39
|
+
style: [
|
|
40
|
+
styles.group,
|
|
41
|
+
{ borderColor: t["--border-default"], backgroundColor: t["--surface-default"] }
|
|
42
|
+
]
|
|
43
|
+
},
|
|
44
|
+
children
|
|
45
|
+
));
|
|
46
|
+
}
|
|
47
|
+
let nextId = 0;
|
|
48
|
+
function AccordionItem({ title, children, defaultOpen = false, disabled = false }) {
|
|
49
|
+
const t = useTheme();
|
|
50
|
+
const ctx = useContext(AccordionContext);
|
|
51
|
+
const idRef = useRef(nextId++);
|
|
52
|
+
const [open, setOpen] = useState(defaultOpen);
|
|
53
|
+
const rotate = useRef(new Animated.Value(defaultOpen ? 1 : 0)).current;
|
|
54
|
+
const close = useCallback(() => setOpen(false), []);
|
|
55
|
+
useEffect(() => {
|
|
56
|
+
if (!ctx) return;
|
|
57
|
+
return ctx.register(idRef.current, close);
|
|
58
|
+
}, [ctx, close]);
|
|
59
|
+
useEffect(() => {
|
|
60
|
+
Animated.timing(rotate, {
|
|
61
|
+
toValue: open ? 1 : 0,
|
|
62
|
+
duration: 180,
|
|
63
|
+
useNativeDriver: true
|
|
64
|
+
}).start();
|
|
65
|
+
}, [open, rotate]);
|
|
66
|
+
const toggle = useCallback(() => {
|
|
67
|
+
LayoutAnimation.configureNext(LayoutAnimation.create(180, "easeInEaseOut", "opacity"));
|
|
68
|
+
setOpen((prev) => {
|
|
69
|
+
const next = !prev;
|
|
70
|
+
if (next && ctx) ctx.notifyOpen(idRef.current);
|
|
71
|
+
return next;
|
|
72
|
+
});
|
|
73
|
+
}, [ctx]);
|
|
74
|
+
const spin = rotate.interpolate({ inputRange: [0, 1], outputRange: ["0deg", "180deg"] });
|
|
75
|
+
return /* @__PURE__ */ React.createElement(View, { style: [styles.item, { borderBottomColor: t["--border-default"] }] }, /* @__PURE__ */ React.createElement(
|
|
76
|
+
Pressable,
|
|
77
|
+
{
|
|
78
|
+
accessibilityRole: "button",
|
|
79
|
+
accessibilityState: { expanded: open, disabled },
|
|
80
|
+
accessibilityLabel: title,
|
|
81
|
+
disabled,
|
|
82
|
+
hitSlop: 4,
|
|
83
|
+
onPress: toggle,
|
|
84
|
+
style: ({ pressed }) => [
|
|
85
|
+
styles.header,
|
|
86
|
+
{
|
|
87
|
+
backgroundColor: pressed && !disabled ? t["--surface-raised"] : "transparent",
|
|
88
|
+
opacity: disabled ? 0.5 : 1
|
|
89
|
+
}
|
|
90
|
+
]
|
|
91
|
+
},
|
|
92
|
+
/* @__PURE__ */ React.createElement(Text, { variant: "label", style: styles.title, numberOfLines: 1 }, title),
|
|
93
|
+
/* @__PURE__ */ React.createElement(Animated.View, { style: { transform: [{ rotate: spin }] } }, /* @__PURE__ */ React.createElement(ChevronDown, { size: 20, color: t["--text-muted"] }))
|
|
94
|
+
), open ? /* @__PURE__ */ React.createElement(View, { style: styles.body }, typeof children === "string" ? /* @__PURE__ */ React.createElement(Text, { variant: "body-sm", color: "secondary" }, children) : children) : null);
|
|
95
|
+
}
|
|
96
|
+
const styles = StyleSheet.create({
|
|
97
|
+
group: {
|
|
98
|
+
borderWidth: 1,
|
|
99
|
+
borderRadius: 12,
|
|
100
|
+
overflow: "hidden"
|
|
101
|
+
},
|
|
102
|
+
item: {
|
|
103
|
+
borderBottomWidth: StyleSheet.hairlineWidth
|
|
104
|
+
},
|
|
105
|
+
header: {
|
|
106
|
+
minHeight: 48,
|
|
107
|
+
flexDirection: "row",
|
|
108
|
+
alignItems: "center",
|
|
109
|
+
gap: 12,
|
|
110
|
+
paddingHorizontal: 16,
|
|
111
|
+
paddingVertical: 12
|
|
112
|
+
},
|
|
113
|
+
title: { flex: 1 },
|
|
114
|
+
body: {
|
|
115
|
+
paddingHorizontal: 16,
|
|
116
|
+
paddingBottom: 16
|
|
117
|
+
}
|
|
118
|
+
});
|
|
119
|
+
export {
|
|
120
|
+
Accordion,
|
|
121
|
+
AccordionItem
|
|
122
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
|
|
4
|
+
type AlertVariant = 'success' | 'danger' | 'warning' | 'info';
|
|
5
|
+
interface AlertProps {
|
|
6
|
+
variant?: AlertVariant;
|
|
7
|
+
title?: string;
|
|
8
|
+
children?: ReactNode;
|
|
9
|
+
/** Botão close (X). Quando presente, renderiza o alvo de toque. */
|
|
10
|
+
onClose?: () => void;
|
|
11
|
+
/** Esconde o ícone leading. default = false. */
|
|
12
|
+
hideIcon?: boolean;
|
|
13
|
+
}
|
|
14
|
+
declare function Alert({ variant, title, children, onClose, hideIcon }: AlertProps): react.JSX.Element;
|
|
15
|
+
|
|
16
|
+
export { Alert, type AlertProps, type AlertVariant };
|