@rojaostudio/ds 1.0.2 → 2.0.0-next.1
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/README.md +75 -13
- package/dist/compat/generate.d.ts +0 -1
- package/dist/components/accordion.d.ts +30 -20
- package/dist/components/accordion.js +31 -93
- package/dist/components/action-bar.d.ts +24 -0
- package/dist/components/action-bar.js +55 -0
- package/dist/components/alert-dialog.d.ts +31 -0
- package/dist/components/alert-dialog.js +43 -0
- package/dist/components/alert.d.ts +31 -19
- package/dist/components/alert.js +67 -65
- package/dist/components/attachment.d.ts +37 -0
- package/dist/components/attachment.js +76 -0
- package/dist/components/avatar.d.ts +43 -36
- package/dist/components/avatar.js +59 -90
- package/dist/components/badge.d.ts +30 -41
- package/dist/components/badge.js +13 -110
- package/dist/components/banner.d.ts +27 -0
- package/dist/components/banner.js +66 -0
- package/dist/components/benefits.d.ts +30 -0
- package/dist/components/benefits.js +32 -0
- package/dist/components/breadcrumb.d.ts +25 -18
- package/dist/components/breadcrumb.js +38 -56
- package/dist/components/browser.d.ts +18 -0
- package/dist/components/browser.js +32 -0
- package/dist/components/bubble.d.ts +29 -0
- package/dist/components/bubble.js +33 -0
- package/dist/components/button-group.d.ts +19 -0
- package/dist/components/button-group.js +20 -0
- package/dist/components/button.d.ts +47 -20
- package/dist/components/button.js +45 -108
- package/dist/components/calendar.d.ts +29 -0
- package/dist/components/calendar.js +149 -0
- package/dist/components/card.d.ts +47 -19
- package/dist/components/card.js +31 -46
- package/dist/components/carousel.d.ts +28 -0
- package/dist/components/carousel.js +130 -0
- package/dist/components/chart.d.ts +49 -0
- package/dist/components/chart.js +258 -0
- package/dist/components/checkbox-group.d.ts +16 -0
- package/dist/components/checkbox-group.js +13 -0
- package/dist/components/checkbox.d.ts +25 -10
- package/dist/components/checkbox.js +87 -81
- package/dist/components/chip-input.d.ts +46 -20
- package/dist/components/chip-input.js +172 -176
- package/dist/components/chip.d.ts +28 -0
- package/dist/components/chip.js +73 -0
- package/dist/components/choice-card.d.ts +10 -13
- package/dist/components/choice-card.js +11 -62
- package/dist/components/choice-carousel.d.ts +9 -0
- package/dist/components/choice-carousel.js +28 -44
- package/dist/components/choice-preview-card.d.ts +10 -20
- package/dist/components/choice-preview-card.js +12 -40
- package/dist/components/color-input.d.ts +36 -11
- package/dist/components/color-input.js +131 -59
- package/dist/components/combobox.d.ts +60 -57
- package/dist/components/combobox.js +210 -213
- package/dist/components/command.d.ts +58 -0
- package/dist/components/command.js +177 -0
- package/dist/components/contact.d.ts +23 -0
- package/dist/components/contact.js +32 -0
- package/dist/components/context-menu.d.ts +34 -26
- package/dist/components/context-menu.js +41 -68
- package/dist/components/copy-field.d.ts +10 -5
- package/dist/components/copy-field.js +24 -29
- package/dist/components/currency-input.d.ts +25 -11
- package/dist/components/currency-input.js +29 -65
- package/dist/components/danger-zone.d.ts +10 -1
- package/dist/components/danger-zone.js +14 -18
- package/dist/components/data-table-header.d.ts +13 -2
- package/dist/components/data-table-header.js +114 -190
- package/dist/components/date-picker.d.ts +31 -32
- package/dist/components/date-picker.js +119 -254
- package/dist/components/delta.d.ts +26 -0
- package/dist/components/delta.js +24 -0
- package/dist/components/dialog.d.ts +21 -0
- package/dist/components/dialog.js +16 -0
- package/dist/components/drawer.d.ts +15 -23
- package/dist/components/drawer.js +57 -89
- package/dist/components/dropdown-menu.d.ts +63 -0
- package/dist/components/dropdown-menu.js +62 -0
- package/dist/components/dropzone.d.ts +10 -4
- package/dist/components/dropzone.js +30 -58
- package/dist/components/empty.d.ts +29 -0
- package/dist/components/empty.js +42 -0
- package/dist/components/fab.d.ts +29 -6
- package/dist/components/fab.js +51 -51
- package/dist/components/faq.d.ts +21 -0
- package/dist/components/faq.js +24 -0
- package/dist/components/file-input.d.ts +56 -0
- package/dist/components/file-input.js +244 -0
- package/dist/components/filter-chip.d.ts +34 -47
- package/dist/components/filter-chip.js +61 -61
- package/dist/components/floating-stepper.d.ts +7 -18
- package/dist/components/floating-stepper.js +27 -55
- package/dist/components/footer.d.ts +36 -0
- package/dist/components/footer.js +38 -0
- package/dist/components/form-actions.d.ts +28 -0
- package/dist/components/form-actions.js +24 -0
- package/dist/components/google-account-chooser.d.ts +25 -0
- package/dist/components/google-account-chooser.js +44 -0
- package/dist/components/google-button.d.ts +26 -0
- package/dist/components/google-button.js +38 -0
- package/dist/components/google-consent.d.ts +23 -0
- package/dist/components/google-consent.js +28 -0
- package/dist/components/google-sign-in.d.ts +26 -0
- package/dist/components/google-sign-in.js +36 -0
- package/dist/components/hover-card.d.ts +30 -0
- package/dist/components/hover-card.js +55 -0
- package/dist/components/icon-button.d.ts +41 -11
- package/dist/components/icon-button.js +44 -64
- package/dist/components/image-crop-modal.d.ts +3 -3
- package/dist/components/image-crop-modal.js +32 -39
- package/dist/components/image-upload.d.ts +21 -29
- package/dist/components/image-upload.js +55 -259
- package/dist/components/index.d.ts +105 -52
- package/dist/components/index.js +190 -74
- package/dist/components/input-otp.d.ts +35 -0
- package/dist/components/input-otp.js +119 -0
- package/dist/components/input.d.ts +23 -17
- package/dist/components/input.js +104 -137
- package/dist/components/insight-card.d.ts +25 -9
- package/dist/components/insight-card.js +42 -27
- package/dist/components/internal/announce.d.ts +3 -0
- package/dist/components/internal/announce.js +20 -0
- package/dist/components/internal/block.d.ts +15 -0
- package/dist/components/internal/block.js +14 -0
- package/dist/components/internal/button.d.ts +23 -0
- package/dist/components/internal/button.js +30 -0
- package/dist/components/internal/choice-card.d.ts +52 -0
- package/dist/components/internal/choice-card.js +117 -0
- package/dist/components/internal/choice.d.ts +25 -0
- package/dist/components/internal/choice.js +44 -0
- package/dist/components/internal/dates.d.ts +17 -0
- package/dist/components/internal/dates.js +59 -0
- package/dist/components/internal/field.d.ts +66 -0
- package/dist/components/internal/field.js +105 -0
- package/dist/components/internal/fieldset.d.ts +25 -0
- package/dist/components/internal/fieldset.js +56 -0
- package/dist/components/internal/focus-after.d.ts +3 -0
- package/dist/components/internal/focus-after.js +13 -0
- package/dist/components/internal/google.d.ts +47 -0
- package/dist/components/internal/google.js +73 -0
- package/dist/components/internal/icons.d.ts +108 -0
- package/dist/components/internal/icons.js +316 -0
- package/dist/components/internal/menu.d.ts +16 -0
- package/dist/components/internal/menu.js +14 -0
- package/dist/components/internal/modal.d.ts +50 -0
- package/dist/components/internal/modal.js +85 -0
- package/dist/components/internal/option-content.d.ts +10 -0
- package/dist/components/internal/option-content.js +13 -0
- package/dist/components/internal/radio-context.d.ts +16 -0
- package/dist/components/internal/radio-context.js +6 -0
- package/dist/components/internal/toggle.d.ts +7 -0
- package/dist/components/internal/toggle.js +13 -0
- package/dist/components/internal/use-listbox.d.ts +56 -0
- package/dist/components/internal/use-listbox.js +69 -0
- package/dist/components/internal/whatsapp.d.ts +8 -0
- package/dist/components/internal/whatsapp.js +12 -0
- package/dist/components/item.d.ts +32 -0
- package/dist/components/item.js +35 -0
- package/dist/components/kbd.d.ts +17 -0
- package/dist/components/kbd.js +18 -0
- package/dist/components/listbox.d.ts +34 -0
- package/dist/components/listbox.js +114 -0
- package/dist/components/marker.d.ts +24 -0
- package/dist/components/marker.js +28 -0
- package/dist/components/media-tile.d.ts +17 -14
- package/dist/components/media-tile.js +19 -27
- package/dist/components/message-scroller.d.ts +20 -0
- package/dist/components/message-scroller.js +108 -0
- package/dist/components/message.d.ts +33 -0
- package/dist/components/message.js +23 -0
- package/dist/components/navigation-menu.d.ts +42 -0
- package/dist/components/navigation-menu.js +30 -0
- package/dist/components/newsletter.d.ts +27 -0
- package/dist/components/newsletter.js +75 -0
- package/dist/components/number-input.d.ts +60 -0
- package/dist/components/number-input.js +234 -0
- package/dist/components/option-tile.d.ts +20 -19
- package/dist/components/option-tile.js +52 -137
- package/dist/components/page-header.d.ts +31 -0
- package/dist/components/page-header.js +25 -0
- package/dist/components/page-shell.d.ts +11 -1
- package/dist/components/page-shell.js +8 -34
- package/dist/components/page-skeleton.d.ts +15 -21
- package/dist/components/page-skeleton.js +28 -25
- package/dist/components/pagination.d.ts +32 -22
- package/dist/components/pagination.js +78 -76
- package/dist/components/password-input.d.ts +26 -0
- package/dist/components/password-input.js +112 -0
- package/dist/components/phone-input.d.ts +12 -8
- package/dist/components/phone-input.js +75 -64
- package/dist/components/phone.d.ts +27 -0
- package/dist/components/phone.js +35 -0
- package/dist/components/popover.d.ts +25 -36
- package/dist/components/popover.js +30 -131
- package/dist/components/pricing-card.d.ts +9 -25
- package/dist/components/pricing-card.js +9 -40
- package/dist/components/pricing.d.ts +48 -0
- package/dist/components/pricing.js +64 -0
- package/dist/components/progress.d.ts +30 -0
- package/dist/components/progress.js +57 -0
- package/dist/components/qr-display.d.ts +11 -6
- package/dist/components/qr-display.js +6 -22
- package/dist/components/questionnaire.d.ts +42 -0
- package/dist/components/questionnaire.js +107 -0
- package/dist/components/radio-group.d.ts +21 -0
- package/dist/components/radio-group.js +40 -0
- package/dist/components/radio.d.ts +15 -29
- package/dist/components/radio.js +45 -103
- package/dist/components/row-actions.d.ts +5 -0
- package/dist/components/row-actions.js +27 -34
- package/dist/components/saving-bar-context.d.ts +0 -5
- package/dist/components/saving-bar-context.js +16 -40
- package/dist/components/saving-bar.d.ts +26 -11
- package/dist/components/saving-bar.js +50 -65
- package/dist/components/section-card.d.ts +18 -4
- package/dist/components/section-card.js +29 -50
- package/dist/components/section-header.d.ts +8 -12
- package/dist/components/section-header.js +5 -10
- package/dist/components/select.d.ts +44 -16
- package/dist/components/select.js +83 -154
- package/dist/components/selectable-card.d.ts +11 -19
- package/dist/components/selectable-card.js +4 -28
- package/dist/components/separator.d.ts +20 -0
- package/dist/components/separator.js +19 -0
- package/dist/components/setting-row.d.ts +11 -15
- package/dist/components/setting-row.js +10 -23
- package/dist/components/settings-list.d.ts +10 -12
- package/dist/components/settings-list.js +7 -19
- package/dist/components/sheet.d.ts +21 -0
- package/dist/components/sheet.js +16 -0
- package/dist/components/sidebar.d.ts +79 -0
- package/dist/components/sidebar.js +111 -0
- package/dist/components/skeleton.d.ts +14 -20
- package/dist/components/skeleton.js +8 -37
- package/dist/components/slider.d.ts +21 -23
- package/dist/components/slider.js +59 -64
- package/dist/components/sparkline.d.ts +19 -0
- package/dist/components/sparkline.js +32 -0
- package/dist/components/spinner.d.ts +16 -8
- package/dist/components/spinner.js +34 -37
- package/dist/components/star-rating.d.ts +22 -0
- package/dist/components/star-rating.js +25 -0
- package/dist/components/stat.d.ts +33 -0
- package/dist/components/stat.js +29 -0
- package/dist/components/status.d.ts +27 -0
- package/dist/components/status.js +34 -0
- package/dist/components/step-progress.d.ts +13 -6
- package/dist/components/step-progress.js +18 -16
- package/dist/components/summary-bar.d.ts +20 -20
- package/dist/components/summary-bar.js +13 -55
- package/dist/components/switch.d.ts +20 -0
- package/dist/components/switch.js +46 -0
- package/dist/components/table.d.ts +56 -17
- package/dist/components/table.js +59 -58
- package/dist/components/tabs.d.ts +67 -0
- package/dist/components/tabs.js +56 -0
- package/dist/components/testimonial.d.ts +30 -0
- package/dist/components/testimonial.js +36 -0
- package/dist/components/textarea.d.ts +11 -16
- package/dist/components/textarea.js +55 -91
- package/dist/components/tile.d.ts +24 -0
- package/dist/components/tile.js +21 -0
- package/dist/components/time-picker.d.ts +40 -25
- package/dist/components/time-picker.js +185 -203
- package/dist/components/toast.d.ts +63 -0
- package/dist/components/toast.js +132 -0
- package/dist/components/toggle-card-compact.d.ts +15 -5
- package/dist/components/toggle-card-compact.js +19 -86
- package/dist/components/toggle-card.d.ts +11 -2
- package/dist/components/toggle-card.js +8 -77
- package/dist/components/toggle-group.d.ts +21 -59
- package/dist/components/toggle-group.js +31 -80
- package/dist/components/toggle.d.ts +19 -9
- package/dist/components/toggle.js +16 -61
- package/dist/components/tooltip.d.ts +25 -12
- package/dist/components/tooltip.js +15 -88
- package/dist/components/top-navigation.d.ts +33 -0
- package/dist/components/top-navigation.js +85 -0
- package/dist/components/typing-indicator.d.ts +6 -0
- package/dist/components/typing-indicator.js +3 -24
- package/dist/components/whatsapp-chat.d.ts +28 -0
- package/dist/components/whatsapp-chat.js +95 -0
- package/dist/components/whatsapp-message.d.ts +22 -0
- package/dist/components/whatsapp-message.js +34 -0
- package/dist/components/whatsapp-notification.d.ts +27 -0
- package/dist/components/whatsapp-notification.js +73 -0
- package/dist/components/whatsapp-template.d.ts +42 -0
- package/dist/components/whatsapp-template.js +69 -0
- package/dist/icons/index.d.ts +2 -0
- package/dist/icons/index.js +2 -0
- package/dist/icons/pix.d.ts +16 -0
- package/dist/targets/native/components/index.d.ts +0 -2
- package/dist/targets/native/components/index.js +0 -4
- package/dist/targets/native/preset.cjs +0 -1
- package/dist/targets/native/theme.css +58 -60
- package/dist/targets/native/theme.d.ts +58 -60
- package/dist/targets/native/theme.js +58 -60
- package/package.json +34 -12
- package/styles/_primitives.generated.css +40 -0
- package/styles/base.css +12 -18
- package/styles/rds/components-styles.css +11365 -0
- package/styles/rds/components.css +993 -0
- package/styles/rds/foundation.css +74 -0
- package/styles/rds/theme.css +261 -0
- package/styles/rds.css +6 -0
- package/styles/themes/rojao.css +46 -53
- package/dist/components/blocker-card.d.ts +0 -42
- package/dist/components/blocker-card.js +0 -54
- package/dist/components/bottom-sheet.d.ts +0 -31
- package/dist/components/bottom-sheet.js +0 -127
- package/dist/components/chat-bubble.d.ts +0 -16
- package/dist/components/chat-bubble.js +0 -56
- package/dist/components/chips.d.ts +0 -22
- package/dist/components/chips.js +0 -101
- package/dist/components/copilot-hint.d.ts +0 -18
- package/dist/components/copilot-hint.js +0 -72
- package/dist/components/divider.d.ts +0 -20
- package/dist/components/divider.js +0 -50
- package/dist/components/empty-state.d.ts +0 -48
- package/dist/components/empty-state.js +0 -94
- package/dist/components/form-card-header.d.ts +0 -13
- package/dist/components/form-card-header.js +0 -16
- package/dist/components/label.d.ts +0 -16
- package/dist/components/label.js +0 -48
- package/dist/components/menu.d.ts +0 -50
- package/dist/components/menu.js +0 -83
- package/dist/components/modal.d.ts +0 -25
- package/dist/components/modal.js +0 -86
- package/dist/components/notice.d.ts +0 -50
- package/dist/components/notice.js +0 -121
- package/dist/components/page-tabs.d.ts +0 -35
- package/dist/components/page-tabs.js +0 -68
- package/dist/components/paywall-banner.d.ts +0 -37
- package/dist/components/paywall-banner.js +0 -58
- package/dist/components/paywall.d.ts +0 -44
- package/dist/components/paywall.js +0 -65
- package/dist/components/phone-frame.d.ts +0 -9
- package/dist/components/phone-frame.js +0 -19
- package/dist/components/pix-icon.d.ts +0 -8
- package/dist/components/search.d.ts +0 -30
- package/dist/components/search.js +0 -86
- package/dist/components/themed.d.ts +0 -36
- package/dist/components/themed.js +0 -23
- package/dist/components/toaster.d.ts +0 -84
- package/dist/components/toaster.js +0 -290
- package/dist/components/use-dismiss.d.ts +0 -9
- package/dist/components/use-dismiss.js +0 -28
- package/dist/components/use-focus-trap.d.ts +0 -5
- package/dist/components/use-focus-trap.js +0 -54
- package/dist/targets/native/components/paywall-banner.d.ts +0 -11
- package/dist/targets/native/components/paywall-banner.js +0 -55
- package/dist/targets/native/components/paywall.d.ts +0 -18
- package/dist/targets/native/components/paywall.js +0 -71
- /package/dist/{components/pix-icon.js → icons/pix.js} +0 -0
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import * as react from 'react';
|
|
2
|
-
import { LabelHTMLAttributes, ReactNode } from 'react';
|
|
3
|
-
|
|
4
|
-
interface LabelProps extends LabelHTMLAttributes<HTMLLabelElement> {
|
|
5
|
-
/** Mostra `*` vermelho indicando obrigatório. */
|
|
6
|
-
required?: boolean;
|
|
7
|
-
/** Mostra `(opcional)` em cinza. */
|
|
8
|
-
optional?: boolean;
|
|
9
|
-
/** Tooltip helper — renderiza ícone "?" com title nativo. */
|
|
10
|
-
tooltip?: string;
|
|
11
|
-
size?: 'sm' | 'md';
|
|
12
|
-
children: ReactNode;
|
|
13
|
-
}
|
|
14
|
-
declare function Label({ required, optional, tooltip, size, className, children, ...rest }: LabelProps): react.JSX.Element;
|
|
15
|
-
|
|
16
|
-
export { Label, type LabelProps };
|
package/dist/components/label.js
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
__objRest,
|
|
3
|
-
__spreadProps,
|
|
4
|
-
__spreadValues
|
|
5
|
-
} from "../chunk-ORMEWXMH.js";
|
|
6
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
-
import { HelpCircle } from "lucide-react";
|
|
8
|
-
const SIZE_CLASS = {
|
|
9
|
-
sm: "text-caption",
|
|
10
|
-
md: "text-label"
|
|
11
|
-
};
|
|
12
|
-
function Label(_a) {
|
|
13
|
-
var _b = _a, {
|
|
14
|
-
required,
|
|
15
|
-
optional,
|
|
16
|
-
tooltip,
|
|
17
|
-
size = "md",
|
|
18
|
-
className = "",
|
|
19
|
-
children
|
|
20
|
-
} = _b, rest = __objRest(_b, [
|
|
21
|
-
"required",
|
|
22
|
-
"optional",
|
|
23
|
-
"tooltip",
|
|
24
|
-
"size",
|
|
25
|
-
"className",
|
|
26
|
-
"children"
|
|
27
|
-
]);
|
|
28
|
-
return /* @__PURE__ */ jsxs(
|
|
29
|
-
"label",
|
|
30
|
-
__spreadProps(__spreadValues({
|
|
31
|
-
className: [
|
|
32
|
-
"inline-flex items-center gap-1.5 font-medium text-fg-primary leading-none",
|
|
33
|
-
SIZE_CLASS[size],
|
|
34
|
-
className
|
|
35
|
-
].join(" ")
|
|
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
|
-
})
|
|
44
|
-
);
|
|
45
|
-
}
|
|
46
|
-
export {
|
|
47
|
-
Label
|
|
48
|
-
};
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import * as react from 'react';
|
|
2
|
-
import { ReactNode } from 'react';
|
|
3
|
-
export { ChevronRight as MenuChevron } from 'lucide-react';
|
|
4
|
-
import { PopoverPlacement } from './popover.js';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Menu — popover de ações (DropdownMenu). Inspirado em M3 Menu / shadcn DropdownMenu.
|
|
8
|
-
*
|
|
9
|
-
* Uso:
|
|
10
|
-
* <Menu trigger={<IconButton icon={<MoreVertical />} aria-label="Ações" />}>
|
|
11
|
-
* {({ close }) => (
|
|
12
|
-
* <>
|
|
13
|
-
* <MenuItem icon={<Edit />} onClick={() => { edit(); close(); }}>Editar</MenuItem>
|
|
14
|
-
* <MenuItem icon={<Copy />} onClick={...}>Duplicar</MenuItem>
|
|
15
|
-
* <MenuSeparator />
|
|
16
|
-
* <MenuItem icon={<Trash />} variant="danger" onClick={...}>Excluir</MenuItem>
|
|
17
|
-
* </>
|
|
18
|
-
* )}
|
|
19
|
-
* </Menu>
|
|
20
|
-
*/
|
|
21
|
-
interface MenuProps {
|
|
22
|
-
trigger: ReactNode;
|
|
23
|
-
children: ReactNode | ((api: {
|
|
24
|
-
close: () => void;
|
|
25
|
-
}) => ReactNode);
|
|
26
|
-
placement?: PopoverPlacement;
|
|
27
|
-
/** Largura mínima em px. default = 180. */
|
|
28
|
-
minWidth?: number;
|
|
29
|
-
className?: string;
|
|
30
|
-
open?: boolean;
|
|
31
|
-
onOpenChange?: (open: boolean) => void;
|
|
32
|
-
}
|
|
33
|
-
declare function Menu({ trigger, children, placement, minWidth, className, open, onOpenChange, }: MenuProps): react.JSX.Element;
|
|
34
|
-
interface MenuItemProps {
|
|
35
|
-
children: ReactNode;
|
|
36
|
-
icon?: ReactNode;
|
|
37
|
-
/** Ícone à direita (ex: ChevronRight pra submenu, atalho de teclado). */
|
|
38
|
-
trailing?: ReactNode;
|
|
39
|
-
variant?: 'default' | 'danger';
|
|
40
|
-
disabled?: boolean;
|
|
41
|
-
selected?: boolean;
|
|
42
|
-
onClick?: () => void;
|
|
43
|
-
}
|
|
44
|
-
declare function MenuItem({ children, icon, trailing, variant, disabled, selected, onClick, }: MenuItemProps): react.JSX.Element;
|
|
45
|
-
declare function MenuSeparator(): react.JSX.Element;
|
|
46
|
-
declare function MenuLabel({ children }: {
|
|
47
|
-
children: ReactNode;
|
|
48
|
-
}): react.JSX.Element;
|
|
49
|
-
|
|
50
|
-
export { Menu, MenuItem, type MenuItemProps, MenuLabel, type MenuProps, MenuSeparator };
|
package/dist/components/menu.js
DELETED
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import "../chunk-ORMEWXMH.js";
|
|
3
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
-
import { Check, ChevronRight } from "lucide-react";
|
|
5
|
-
import { Popover } from "./popover.js";
|
|
6
|
-
function Menu({
|
|
7
|
-
trigger,
|
|
8
|
-
children,
|
|
9
|
-
placement = "bottom-start",
|
|
10
|
-
minWidth = 180,
|
|
11
|
-
className = "",
|
|
12
|
-
open,
|
|
13
|
-
onOpenChange
|
|
14
|
-
}) {
|
|
15
|
-
return /* @__PURE__ */ jsx(
|
|
16
|
-
Popover,
|
|
17
|
-
{
|
|
18
|
-
trigger,
|
|
19
|
-
placement,
|
|
20
|
-
open,
|
|
21
|
-
onOpenChange,
|
|
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
|
-
}
|
|
37
|
-
);
|
|
38
|
-
}
|
|
39
|
-
function MenuItem({
|
|
40
|
-
children,
|
|
41
|
-
icon,
|
|
42
|
-
trailing,
|
|
43
|
-
variant = "default",
|
|
44
|
-
disabled = false,
|
|
45
|
-
selected = false,
|
|
46
|
-
onClick
|
|
47
|
-
}) {
|
|
48
|
-
const colorClass = variant === "danger" ? "text-danger-text hover:bg-danger-soft" : "text-fg-primary hover:bg-surface-raised";
|
|
49
|
-
return /* @__PURE__ */ jsxs(
|
|
50
|
-
"button",
|
|
51
|
-
{
|
|
52
|
-
type: "button",
|
|
53
|
-
role: "menuitem",
|
|
54
|
-
onClick: disabled ? void 0 : onClick,
|
|
55
|
-
disabled,
|
|
56
|
-
className: [
|
|
57
|
-
"w-full flex items-center gap-2.5 px-3 py-1.5 text-label text-left transition-colors",
|
|
58
|
-
"focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-stroke-focus focus-visible:ring-inset focus-visible:bg-surface-raised",
|
|
59
|
-
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
60
|
-
colorClass
|
|
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
|
-
}
|
|
69
|
-
);
|
|
70
|
-
}
|
|
71
|
-
function MenuSeparator() {
|
|
72
|
-
return /* @__PURE__ */ jsx("div", { role: "separator", className: "h-px bg-stroke-subtle my-1" });
|
|
73
|
-
}
|
|
74
|
-
function MenuLabel({ children }) {
|
|
75
|
-
return /* @__PURE__ */ jsx("div", { className: "px-3 py-1 text-[11px] font-semibold uppercase tracking-wider text-fg-muted", children });
|
|
76
|
-
}
|
|
77
|
-
export {
|
|
78
|
-
Menu,
|
|
79
|
-
ChevronRight as MenuChevron,
|
|
80
|
-
MenuItem,
|
|
81
|
-
MenuLabel,
|
|
82
|
-
MenuSeparator
|
|
83
|
-
};
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import * as react from 'react';
|
|
2
|
-
|
|
3
|
-
interface ModalProps {
|
|
4
|
-
open: boolean;
|
|
5
|
-
onClose: () => void;
|
|
6
|
-
title?: React.ReactNode;
|
|
7
|
-
/** Subtítulo opcional abaixo do title. */
|
|
8
|
-
subtitle?: React.ReactNode;
|
|
9
|
-
children: React.ReactNode;
|
|
10
|
-
footer?: React.ReactNode;
|
|
11
|
-
/** Ação no canto direito do header (ex.: link ghost), renderizada antes do X. */
|
|
12
|
-
headerAction?: React.ReactNode;
|
|
13
|
-
size?: 'sm' | 'md' | 'lg' | 'xl' | 'full';
|
|
14
|
-
/** Fecha ao clicar no backdrop. default = true. */
|
|
15
|
-
closeOnBackdrop?: boolean;
|
|
16
|
-
/** Esconde o botão X do header. default = false. */
|
|
17
|
-
hideClose?: boolean;
|
|
18
|
-
className?: string;
|
|
19
|
-
/** Alvo do portal. default = document.body. Passe um elemento de um subtree TEMATIZADO (ex.: a
|
|
20
|
-
* raiz do tema da loja) pra o modal herdar tokens/mode/fonte daquele contexto em vez do global. */
|
|
21
|
-
container?: Element | null;
|
|
22
|
-
}
|
|
23
|
-
declare function Modal({ open, onClose, title, subtitle, children, footer, headerAction, size, closeOnBackdrop, hideClose, className, container }: ModalProps): react.ReactPortal | null;
|
|
24
|
-
|
|
25
|
-
export { Modal, type ModalProps };
|
package/dist/components/modal.js
DELETED
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import "../chunk-ORMEWXMH.js";
|
|
3
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
-
import { useEffect, useId, useState } from "react";
|
|
5
|
-
import { X } from "lucide-react";
|
|
6
|
-
import { createPortal } from "react-dom";
|
|
7
|
-
import { useFocusTrap } from "./use-focus-trap.js";
|
|
8
|
-
const sizes = {
|
|
9
|
-
sm: "max-w-sm",
|
|
10
|
-
md: "max-w-lg",
|
|
11
|
-
lg: "max-w-2xl",
|
|
12
|
-
xl: "max-w-4xl",
|
|
13
|
-
full: "max-w-[calc(100vw-2rem)] max-h-[calc(100dvh-2rem)]"
|
|
14
|
-
};
|
|
15
|
-
function Modal({ open, onClose, title, subtitle, children, footer, headerAction, size = "md", closeOnBackdrop = true, hideClose = false, className = "", container }) {
|
|
16
|
-
const titleId = useId();
|
|
17
|
-
const dialogRef = useFocusTrap(open);
|
|
18
|
-
const [mounted, setMounted] = useState(false);
|
|
19
|
-
useEffect(() => {
|
|
20
|
-
setMounted(true);
|
|
21
|
-
}, []);
|
|
22
|
-
useEffect(() => {
|
|
23
|
-
if (!open) return;
|
|
24
|
-
const prev = document.body.style.overflow;
|
|
25
|
-
document.body.style.overflow = "hidden";
|
|
26
|
-
const onKey = (e) => {
|
|
27
|
-
if (e.key === "Escape") onClose();
|
|
28
|
-
};
|
|
29
|
-
document.addEventListener("keydown", onKey);
|
|
30
|
-
return () => {
|
|
31
|
-
document.body.style.overflow = prev;
|
|
32
|
-
document.removeEventListener("keydown", onKey);
|
|
33
|
-
};
|
|
34
|
-
}, [open, onClose]);
|
|
35
|
-
if (!open) return null;
|
|
36
|
-
if (!mounted) return null;
|
|
37
|
-
return createPortal(
|
|
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",
|
|
42
|
-
{
|
|
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
|
-
] }),
|
|
81
|
-
container != null ? container : document.body
|
|
82
|
-
);
|
|
83
|
-
}
|
|
84
|
-
export {
|
|
85
|
-
Modal
|
|
86
|
-
};
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import * as react from 'react';
|
|
2
|
-
import { ReactNode, ComponentType } from 'react';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Notice — aviso contextual com escala de SEVERIDADE real. Unifica a linguagem visual
|
|
6
|
-
* que antes estava fatiada por ORIGEM (CopilotHint cinza vs PaywallBanner vermelho),
|
|
7
|
-
* o que invertia a hierarquia: o aviso mais grave (operacional) ficava no componente
|
|
8
|
-
* mais discreto. Aqui a cor segue a gravidade, não quem emitiu.
|
|
9
|
-
*
|
|
10
|
-
* Dois eixos ortogonais:
|
|
11
|
-
* - `severity` (perceptual): info | success | warning | critical → cor/ícone/peso.
|
|
12
|
-
* - `intent` (semântico): operational | commercial → só troca o ícone default
|
|
13
|
-
* (commercial = cadeado de plano) e a telemetria; NÃO muda a cor.
|
|
14
|
-
*
|
|
15
|
-
* Regra de severidade = CUSTO DE IGNORAR, não a fonte. "Loja não recebe pedidos"
|
|
16
|
-
* (trava a venda) é `critical`; "limite do plano" (a loja segue vendendo) é `warning`.
|
|
17
|
-
*
|
|
18
|
-
* Consome só a família semântica de feedback (danger/warning/info/success) do base.css
|
|
19
|
-
* — zero cor hardcoded. Acessível: role/aria-live por severidade + ícone (cor nunca é
|
|
20
|
-
* o único canal). Crítico é não-dispensável por definição.
|
|
21
|
-
*/
|
|
22
|
-
type NoticeSeverity = 'info' | 'success' | 'warning' | 'critical';
|
|
23
|
-
type NoticeIntent = 'operational' | 'commercial';
|
|
24
|
-
interface NoticeProps {
|
|
25
|
-
severity: NoticeSeverity;
|
|
26
|
-
title: string;
|
|
27
|
-
description?: ReactNode;
|
|
28
|
-
intent?: NoticeIntent;
|
|
29
|
-
cta?: {
|
|
30
|
-
label: string;
|
|
31
|
-
href?: string;
|
|
32
|
-
onClick?: () => void;
|
|
33
|
-
};
|
|
34
|
-
/** Component de link (next/link em apps Next). */
|
|
35
|
-
linkAs?: ComponentType<{
|
|
36
|
-
href: string;
|
|
37
|
-
className?: string;
|
|
38
|
-
children: ReactNode;
|
|
39
|
-
}>;
|
|
40
|
-
/** Dispensável: ignorado quando severity='critical' (crítico nunca some). Precisa de `id`. */
|
|
41
|
-
dismissible?: boolean;
|
|
42
|
-
/** Chave de dispensa (localStorage). Re-key pela condição (ex: `zeroStock:7`) pra reaparecer quando piora. */
|
|
43
|
-
id?: string;
|
|
44
|
-
/** aria-label do botão dispensar (i18n pelo caller). */
|
|
45
|
-
dismissLabel?: string;
|
|
46
|
-
className?: string;
|
|
47
|
-
}
|
|
48
|
-
declare function Notice({ severity, title, description, intent, cta, linkAs: LinkAs, dismissible, id, dismissLabel, className, }: NoticeProps): react.JSX.Element | null;
|
|
49
|
-
|
|
50
|
-
export { Notice, type NoticeIntent, type NoticeProps, type NoticeSeverity };
|
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import "../chunk-ORMEWXMH.js";
|
|
3
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
-
import { useState, useEffect } from "react";
|
|
5
|
-
import { Info, CheckCircle2, AlertTriangle, AlertOctagon, Lock, X } from "lucide-react";
|
|
6
|
-
const STYLES = {
|
|
7
|
-
critical: {
|
|
8
|
-
container: "border-danger-border bg-danger-soft",
|
|
9
|
-
title: "text-danger-text",
|
|
10
|
-
desc: "text-danger-text/85",
|
|
11
|
-
icon: "text-danger-text",
|
|
12
|
-
cta: "bg-danger text-fg-inverse hover:bg-danger-text",
|
|
13
|
-
solidCta: true
|
|
14
|
-
},
|
|
15
|
-
warning: {
|
|
16
|
-
container: "border-warning-border bg-warning-soft",
|
|
17
|
-
title: "text-warning-text",
|
|
18
|
-
desc: "text-warning-text/85",
|
|
19
|
-
icon: "text-warning-text",
|
|
20
|
-
cta: "bg-surface-default border border-warning-border hover:bg-warning-soft text-warning-text",
|
|
21
|
-
solidCta: false
|
|
22
|
-
},
|
|
23
|
-
info: {
|
|
24
|
-
container: "border-info-border bg-info-soft",
|
|
25
|
-
title: "text-info-text",
|
|
26
|
-
desc: "text-info-text/85",
|
|
27
|
-
icon: "text-info-text",
|
|
28
|
-
cta: "bg-surface-default border border-info-border hover:bg-info-soft text-info-text",
|
|
29
|
-
solidCta: false
|
|
30
|
-
},
|
|
31
|
-
success: {
|
|
32
|
-
container: "border-success-border bg-success-soft",
|
|
33
|
-
title: "text-success-text",
|
|
34
|
-
desc: "text-success-text/85",
|
|
35
|
-
icon: "text-success-text",
|
|
36
|
-
cta: "bg-surface-default border border-success-border hover:bg-success-soft text-success-text",
|
|
37
|
-
solidCta: false
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
function iconFor(severity, intent) {
|
|
41
|
-
if (intent === "commercial" && (severity === "critical" || severity === "warning")) return Lock;
|
|
42
|
-
switch (severity) {
|
|
43
|
-
case "critical":
|
|
44
|
-
return AlertOctagon;
|
|
45
|
-
case "warning":
|
|
46
|
-
return AlertTriangle;
|
|
47
|
-
case "success":
|
|
48
|
-
return CheckCircle2;
|
|
49
|
-
default:
|
|
50
|
-
return Info;
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
function DefaultLink({ href, className, children }) {
|
|
54
|
-
return /* @__PURE__ */ jsx("a", { href, className, children });
|
|
55
|
-
}
|
|
56
|
-
function Notice({
|
|
57
|
-
severity,
|
|
58
|
-
title,
|
|
59
|
-
description,
|
|
60
|
-
intent = "operational",
|
|
61
|
-
cta,
|
|
62
|
-
linkAs: LinkAs = DefaultLink,
|
|
63
|
-
dismissible = false,
|
|
64
|
-
id,
|
|
65
|
-
dismissLabel = "Dispensar",
|
|
66
|
-
className = ""
|
|
67
|
-
}) {
|
|
68
|
-
const canDismiss = dismissible && severity !== "critical" && !!id;
|
|
69
|
-
const [dismissed, setDismissed] = useState(false);
|
|
70
|
-
useEffect(() => {
|
|
71
|
-
if (canDismiss && id) setDismissed(localStorage.getItem(`notice-dismissed:${id}`) === "1");
|
|
72
|
-
}, [canDismiss, id]);
|
|
73
|
-
if (dismissed) return null;
|
|
74
|
-
const s = STYLES[severity];
|
|
75
|
-
const Icon = iconFor(severity, intent);
|
|
76
|
-
const ctaClass = ["text-caption font-semibold px-3 py-1.5 rounded-(--radius-card) shrink-0 transition-colors", s.cta].join(" ");
|
|
77
|
-
function dismiss() {
|
|
78
|
-
if (id) localStorage.setItem(`notice-dismissed:${id}`, "1");
|
|
79
|
-
setDismissed(true);
|
|
80
|
-
}
|
|
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(
|
|
89
|
-
"div",
|
|
90
|
-
{
|
|
91
|
-
role: severity === "critical" ? "alert" : "status",
|
|
92
|
-
"aria-live": severity === "critical" ? "assertive" : "polite",
|
|
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
|
-
}
|
|
117
|
-
);
|
|
118
|
-
}
|
|
119
|
-
export {
|
|
120
|
-
Notice
|
|
121
|
-
};
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import react__default from 'react';
|
|
2
|
-
|
|
3
|
-
type PageTab = {
|
|
4
|
-
/** Route mode: a aba navega pra esta URL (default). */
|
|
5
|
-
href?: string;
|
|
6
|
-
/** Controlled mode: identifica a aba quando se usa value/onChange (sem navegar). */
|
|
7
|
-
value?: string;
|
|
8
|
-
label: string;
|
|
9
|
-
/** Show a numeric count badge */
|
|
10
|
-
count?: number;
|
|
11
|
-
/** Show a green "aberto" pill */
|
|
12
|
-
dot?: boolean;
|
|
13
|
-
/** Show an "em breve" label: tab is not yet available */
|
|
14
|
-
soon?: boolean;
|
|
15
|
-
/** Ghost route indicator (dev only) */
|
|
16
|
-
ghost?: boolean;
|
|
17
|
-
/** Match only the exact path (+ matchPaths). Use for root paths like /marketing */
|
|
18
|
-
exact?: boolean;
|
|
19
|
-
/** Extra paths that also activate this tab (prefix match) */
|
|
20
|
-
matchPaths?: string[];
|
|
21
|
-
};
|
|
22
|
-
interface PageTabsProps {
|
|
23
|
-
tabs: PageTab[];
|
|
24
|
-
trailing?: react__default.ReactNode;
|
|
25
|
-
/**
|
|
26
|
-
* Controlled mode: quando onChange é passado, as abas viram botões (sem
|
|
27
|
-
* navegação) e o ativo é tab.value === value. Use pra trocar conteúdo na
|
|
28
|
-
* mesma tela (ex: idiomas num form). Sem onChange, segue route-based (Link).
|
|
29
|
-
*/
|
|
30
|
-
value?: string;
|
|
31
|
-
onChange?: (value: string) => void;
|
|
32
|
-
}
|
|
33
|
-
declare function PageTabs({ tabs, trailing, value, onChange }: PageTabsProps): react__default.JSX.Element;
|
|
34
|
-
|
|
35
|
-
export { type PageTab, PageTabs, type PageTabsProps };
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import "../chunk-ORMEWXMH.js";
|
|
3
|
-
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
-
import Link from "next/link";
|
|
5
|
-
import { usePathname } from "next/navigation";
|
|
6
|
-
function isActive(tab, pathname) {
|
|
7
|
-
var _a, _b, _c, _d;
|
|
8
|
-
if (!tab.href) return false;
|
|
9
|
-
if (tab.exact) {
|
|
10
|
-
return pathname === tab.href || ((_b = (_a = tab.matchPaths) == null ? void 0 : _a.some((p) => pathname.startsWith(p))) != null ? _b : false);
|
|
11
|
-
}
|
|
12
|
-
return pathname === tab.href || pathname.startsWith(tab.href + "/") || ((_d = (_c = tab.matchPaths) == null ? void 0 : _c.some((p) => pathname.startsWith(p))) != null ? _d : false);
|
|
13
|
-
}
|
|
14
|
-
const TAB_BASE = "flex items-center gap-2 whitespace-nowrap shrink-0 px-4 sm:px-5 py-4 text-label font-medium border-b-2 transition-colors";
|
|
15
|
-
function tabClass(active) {
|
|
16
|
-
return [
|
|
17
|
-
TAB_BASE,
|
|
18
|
-
active ? "[border-color:var(--page-tabs-indicator-active)] [color:var(--page-tabs-text-active)]" : "border-transparent [color:var(--page-tabs-text)] hover:[color:var(--page-tabs-text-hover)] hover:[border-color:var(--page-tabs-indicator-hover)]"
|
|
19
|
-
].join(" ");
|
|
20
|
-
}
|
|
21
|
-
function TabContent({ tab, active }) {
|
|
22
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
23
|
-
tab.ghost && /* @__PURE__ */ jsx("span", { title: "Rota fantasma em valida\xE7\xE3o", children: "\u{1F47B}" }),
|
|
24
|
-
tab.label,
|
|
25
|
-
tab.soon && /* @__PURE__ */ jsx("span", { className: "text-[10px] font-medium px-1.5 py-0.5 rounded [background:var(--page-tabs-soon-bg)] [color:var(--page-tabs-soon-text)]", children: "em breve" }),
|
|
26
|
-
tab.dot && /* @__PURE__ */ jsxs("span", { className: "inline-flex items-center gap-1 px-1.5 py-0.5 rounded-full text-[10px] font-medium leading-none [background:var(--page-tabs-dot-bg)] [color:var(--page-tabs-dot-text)]", children: [
|
|
27
|
-
/* @__PURE__ */ jsx("span", { className: "w-1.5 h-1.5 rounded-full shrink-0 [background:var(--page-tabs-dot-indicator)]" }),
|
|
28
|
-
"aberto"
|
|
29
|
-
] }),
|
|
30
|
-
tab.count != null && tab.count > 0 && /* @__PURE__ */ jsx("span", { className: [
|
|
31
|
-
"inline-flex items-center justify-center min-w-[18px] h-[18px] px-1",
|
|
32
|
-
"rounded-full text-[11px] font-semibold",
|
|
33
|
-
active ? "[background:var(--page-tabs-count-bg-active)] [color:var(--page-tabs-count-text-active)]" : "[background:var(--page-tabs-count-bg)] [color:var(--page-tabs-count-text)]"
|
|
34
|
-
].join(" "), children: tab.count > 99 ? "99+" : tab.count })
|
|
35
|
-
] });
|
|
36
|
-
}
|
|
37
|
-
function PageTabs({ tabs, trailing, value, onChange }) {
|
|
38
|
-
const pathname = usePathname();
|
|
39
|
-
const controlled = onChange !== void 0;
|
|
40
|
-
return /* @__PURE__ */ jsxs("div", { className: "flex items-center [background:var(--page-tabs-bg)] [border-bottom:1px_solid_var(--page-tabs-border)]", children: [
|
|
41
|
-
/* @__PURE__ */ jsx("nav", { className: "flex flex-1 overflow-x-auto scrollbar-none px-4 sm:px-6 lg:px-8", role: controlled ? "tablist" : void 0, children: tabs.map((tab) => {
|
|
42
|
-
var _a, _b;
|
|
43
|
-
const active = controlled ? tab.value === value : isActive(tab, pathname);
|
|
44
|
-
if (controlled) {
|
|
45
|
-
return /* @__PURE__ */ jsx(
|
|
46
|
-
"button",
|
|
47
|
-
{
|
|
48
|
-
type: "button",
|
|
49
|
-
role: "tab",
|
|
50
|
-
"aria-selected": active,
|
|
51
|
-
onClick: () => {
|
|
52
|
-
var _a2;
|
|
53
|
-
return onChange == null ? void 0 : onChange((_a2 = tab.value) != null ? _a2 : "");
|
|
54
|
-
},
|
|
55
|
-
className: tabClass(active),
|
|
56
|
-
children: /* @__PURE__ */ jsx(TabContent, { tab, active })
|
|
57
|
-
},
|
|
58
|
-
(_a = tab.value) != null ? _a : tab.label
|
|
59
|
-
);
|
|
60
|
-
}
|
|
61
|
-
return /* @__PURE__ */ jsx(Link, { href: (_b = tab.href) != null ? _b : "#", className: tabClass(active), children: /* @__PURE__ */ jsx(TabContent, { tab, active }) }, tab.href);
|
|
62
|
-
}) }),
|
|
63
|
-
trailing && /* @__PURE__ */ jsx("div", { className: "hidden sm:flex shrink-0 items-center pr-4 sm:pr-6 lg:pr-8", children: trailing })
|
|
64
|
-
] });
|
|
65
|
-
}
|
|
66
|
-
export {
|
|
67
|
-
PageTabs
|
|
68
|
-
};
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import * as react from 'react';
|
|
2
|
-
import { ReactNode, ComponentType } from 'react';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* PaywallBanner — gate de feature/plano. Diferente do BlockerCard que sinaliza
|
|
6
|
-
* problema (limite, falha), o PaywallBanner aponta pra um upgrade ou ação de plano.
|
|
7
|
-
*
|
|
8
|
-
* Uso:
|
|
9
|
-
* <PaywallBanner
|
|
10
|
-
* variant="warn"
|
|
11
|
-
* title="Você está em 80% do limite"
|
|
12
|
-
* description="Faça upgrade pra continuar cadastrando produtos."
|
|
13
|
-
* ctaLabel="Ver planos"
|
|
14
|
-
* ctaHref="/billing"
|
|
15
|
-
* />
|
|
16
|
-
*
|
|
17
|
-
* <PaywallBanner variant="blocked" title="..." description="..." />
|
|
18
|
-
*/
|
|
19
|
-
interface PaywallBannerProps {
|
|
20
|
-
variant: 'warn' | 'blocked';
|
|
21
|
-
title: string;
|
|
22
|
-
description: ReactNode;
|
|
23
|
-
ctaLabel?: string;
|
|
24
|
-
ctaHref?: string;
|
|
25
|
-
/** Handler alternativo (sem href). */
|
|
26
|
-
onCta?: () => void;
|
|
27
|
-
/** Component de link (next/link em apps Next). */
|
|
28
|
-
linkAs?: ComponentType<{
|
|
29
|
-
href: string;
|
|
30
|
-
className?: string;
|
|
31
|
-
children: ReactNode;
|
|
32
|
-
}>;
|
|
33
|
-
className?: string;
|
|
34
|
-
}
|
|
35
|
-
declare function PaywallBanner({ variant, title, description, ctaLabel, ctaHref, onCta, linkAs: LinkAs, className, }: PaywallBannerProps): react.JSX.Element;
|
|
36
|
-
|
|
37
|
-
export { PaywallBanner, type PaywallBannerProps };
|