@mangtre/ui 0.1.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 +26 -0
- package/dist/MangThemeProvider-BqdGKBP2.d.ts +34 -0
- package/dist/Money-Dw3GnUvX.d.ts +27 -0
- package/dist/actions.d.ts +31 -0
- package/dist/actions.js +13 -0
- package/dist/ai.d.ts +58 -0
- package/dist/ai.js +13 -0
- package/dist/analytics.d.ts +40 -0
- package/dist/analytics.js +15 -0
- package/dist/app.d.ts +24 -0
- package/dist/app.js +9 -0
- package/dist/catalog.d.ts +76 -0
- package/dist/catalog.js +1210 -0
- package/dist/charts.d.ts +89 -0
- package/dist/charts.js +34 -0
- package/dist/chunk-3AL4SUFD.js +301 -0
- package/dist/chunk-4XNSYKQE.js +142 -0
- package/dist/chunk-5Z4VLQKH.js +43 -0
- package/dist/chunk-7P2EQZYD.js +59 -0
- package/dist/chunk-7WHNIEDV.js +120 -0
- package/dist/chunk-ASZKHSMG.js +82 -0
- package/dist/chunk-BCBN2EGH.js +216 -0
- package/dist/chunk-BLYAFV45.js +320 -0
- package/dist/chunk-DLKEXWPA.js +90 -0
- package/dist/chunk-DTASXPTB.js +70 -0
- package/dist/chunk-FZRXVRC7.js +63 -0
- package/dist/chunk-ID233AGM.js +108 -0
- package/dist/chunk-IVYXOKMO.js +74 -0
- package/dist/chunk-IX3DYETF.js +61 -0
- package/dist/chunk-JJB4PJC3.js +166 -0
- package/dist/chunk-K5Q3RCV6.js +119 -0
- package/dist/chunk-LNRUPJDF.js +161 -0
- package/dist/chunk-LZORNMBL.js +0 -0
- package/dist/chunk-OBPXCUVF.js +282 -0
- package/dist/chunk-OJX2EIMB.js +145 -0
- package/dist/chunk-PPOYMKV3.js +170 -0
- package/dist/chunk-PQGUWJG4.js +47 -0
- package/dist/chunk-RE7OWRA4.js +187 -0
- package/dist/chunk-SJF3CHAW.js +108 -0
- package/dist/chunk-UF6ANDJZ.js +112 -0
- package/dist/chunk-VGC5DMOM.js +107 -0
- package/dist/chunk-VP56Z4BS.js +0 -0
- package/dist/chunk-VRD66FIA.js +77 -0
- package/dist/chunk-X7T2DJLU.js +113 -0
- package/dist/chunk-XPV3OOLU.js +147 -0
- package/dist/chunk-YN5O6YL6.js +69 -0
- package/dist/chunk-Z4ANGBPC.js +94 -0
- package/dist/creator.d.ts +55 -0
- package/dist/creator.js +20 -0
- package/dist/data-room.d.ts +50 -0
- package/dist/data-room.js +17 -0
- package/dist/editor.d.ts +32 -0
- package/dist/editor.js +14 -0
- package/dist/feedback.d.ts +48 -0
- package/dist/feedback.js +16 -0
- package/dist/forms.d.ts +91 -0
- package/dist/forms.js +26 -0
- package/dist/handoff.d.ts +37 -0
- package/dist/handoff.js +13 -0
- package/dist/index.css +2 -0
- package/dist/index.d.ts +62 -0
- package/dist/index.js +338 -0
- package/dist/layout.d.ts +57 -0
- package/dist/layout.js +22 -0
- package/dist/learning.d.ts +46 -0
- package/dist/learning.js +15 -0
- package/dist/media.d.ts +48 -0
- package/dist/media.js +16 -0
- package/dist/monetization.d.ts +30 -0
- package/dist/monetization.js +14 -0
- package/dist/money.d.ts +45 -0
- package/dist/money.js +28 -0
- package/dist/navigation.d.ts +36 -0
- package/dist/navigation.js +14 -0
- package/dist/overlay.d.ts +72 -0
- package/dist/overlay.js +20 -0
- package/dist/platform.d.ts +94 -0
- package/dist/platform.js +42 -0
- package/dist/primitives.d.ts +83 -0
- package/dist/primitives.js +22 -0
- package/dist/privacy.d.ts +28 -0
- package/dist/privacy.js +15 -0
- package/dist/sandbox.d.ts +40 -0
- package/dist/sandbox.js +15 -0
- package/dist/settings.d.ts +29 -0
- package/dist/settings.js +13 -0
- package/dist/surface.d.ts +33 -0
- package/dist/surface.js +16 -0
- package/dist/theme.css +63 -0
- package/dist/theme.d.ts +64 -0
- package/dist/theme.js +27 -0
- package/dist/tokens.css +119 -0
- package/dist/tokens.d.ts +128 -0
- package/dist/tokens.js +8 -0
- package/package.json +151 -0
package/dist/feedback.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import {
|
|
2
|
+
EmptyState,
|
|
3
|
+
ErrorState,
|
|
4
|
+
Progress,
|
|
5
|
+
Skeleton,
|
|
6
|
+
Spinner
|
|
7
|
+
} from "./chunk-VGC5DMOM.js";
|
|
8
|
+
import "./chunk-3AL4SUFD.js";
|
|
9
|
+
import "./chunk-PPOYMKV3.js";
|
|
10
|
+
export {
|
|
11
|
+
EmptyState,
|
|
12
|
+
ErrorState,
|
|
13
|
+
Progress,
|
|
14
|
+
Skeleton,
|
|
15
|
+
Spinner
|
|
16
|
+
};
|
package/dist/forms.d.ts
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { ReactNode, InputHTMLAttributes, SelectHTMLAttributes, TextareaHTMLAttributes } from 'react';
|
|
3
|
+
import { T as ThemeMode } from './MangThemeProvider-BqdGKBP2.js';
|
|
4
|
+
import '@mangtre/core';
|
|
5
|
+
|
|
6
|
+
interface FieldProps {
|
|
7
|
+
label?: ReactNode;
|
|
8
|
+
description?: ReactNode;
|
|
9
|
+
/** Error message; when set the control is marked `aria-invalid`. */
|
|
10
|
+
error?: ReactNode;
|
|
11
|
+
required?: boolean;
|
|
12
|
+
theme?: ThemeMode;
|
|
13
|
+
className?: string;
|
|
14
|
+
/** A single form control (Input/Select/TextArea/…). */
|
|
15
|
+
children: ReactNode;
|
|
16
|
+
}
|
|
17
|
+
declare function Field({ label, description, error, required, theme, className, children, }: FieldProps): react.JSX.Element;
|
|
18
|
+
|
|
19
|
+
interface InputProps extends InputHTMLAttributes<HTMLInputElement> {
|
|
20
|
+
theme?: ThemeMode;
|
|
21
|
+
}
|
|
22
|
+
declare function Input({ theme, className, ...rest }: InputProps): react.JSX.Element;
|
|
23
|
+
interface TextAreaProps extends TextareaHTMLAttributes<HTMLTextAreaElement> {
|
|
24
|
+
theme?: ThemeMode;
|
|
25
|
+
}
|
|
26
|
+
declare function TextArea({ theme, className, ...rest }: TextAreaProps): react.JSX.Element;
|
|
27
|
+
interface SelectProps extends SelectHTMLAttributes<HTMLSelectElement> {
|
|
28
|
+
theme?: ThemeMode;
|
|
29
|
+
}
|
|
30
|
+
declare function Select({ theme, className, children, ...rest }: SelectProps): react.JSX.Element;
|
|
31
|
+
|
|
32
|
+
type BaseProps = Omit<InputHTMLAttributes<HTMLInputElement>, "type"> & {
|
|
33
|
+
label?: ReactNode;
|
|
34
|
+
theme?: ThemeMode;
|
|
35
|
+
};
|
|
36
|
+
interface CheckboxProps extends BaseProps {
|
|
37
|
+
}
|
|
38
|
+
declare function Checkbox({ label, theme, className, disabled, ...rest }: CheckboxProps): react.JSX.Element;
|
|
39
|
+
interface SwitchProps extends BaseProps {
|
|
40
|
+
}
|
|
41
|
+
/** Toggle switch — a styled checkbox (`role` stays the native checkbox for AT support). */
|
|
42
|
+
declare function Switch({ label, theme, className, disabled, ...rest }: SwitchProps): react.JSX.Element;
|
|
43
|
+
|
|
44
|
+
interface SegmentOption {
|
|
45
|
+
value: string;
|
|
46
|
+
label: ReactNode;
|
|
47
|
+
disabled?: boolean;
|
|
48
|
+
}
|
|
49
|
+
interface SegmentedControlProps {
|
|
50
|
+
options: SegmentOption[];
|
|
51
|
+
value: string;
|
|
52
|
+
onChange: (value: string) => void;
|
|
53
|
+
/** Accessible name for the group. */
|
|
54
|
+
ariaLabel?: string;
|
|
55
|
+
size?: "sm" | "md";
|
|
56
|
+
theme?: ThemeMode;
|
|
57
|
+
className?: string;
|
|
58
|
+
}
|
|
59
|
+
/** Single-select mode/filter toggle (radio-like, button-flush). For 2–4 mutually exclusive modes. */
|
|
60
|
+
declare function SegmentedControl({ options, value, onChange, ariaLabel, size, theme, className, }: SegmentedControlProps): react.JSX.Element;
|
|
61
|
+
interface ChipProps {
|
|
62
|
+
children: ReactNode;
|
|
63
|
+
/** Selected styling (for filter/tag pickers). */
|
|
64
|
+
selected?: boolean;
|
|
65
|
+
/** Makes the whole chip a toggle button. */
|
|
66
|
+
onClick?: () => void;
|
|
67
|
+
/** Adds a trailing × remove button. */
|
|
68
|
+
onRemove?: () => void;
|
|
69
|
+
/** Accessible label for the × button. Default "Xoá". */
|
|
70
|
+
removeLabel?: string;
|
|
71
|
+
icon?: ReactNode;
|
|
72
|
+
theme?: ThemeMode;
|
|
73
|
+
className?: string;
|
|
74
|
+
}
|
|
75
|
+
/** Compact pill — selectable (`onClick`) and/or removable (`onRemove`). For tags & quick filters. */
|
|
76
|
+
declare function Chip({ children, selected, onClick, onRemove, removeLabel, icon, theme, className, }: ChipProps): react.JSX.Element;
|
|
77
|
+
interface NumberStepperProps {
|
|
78
|
+
value: number;
|
|
79
|
+
onChange: (value: number) => void;
|
|
80
|
+
min?: number;
|
|
81
|
+
max?: number;
|
|
82
|
+
step?: number;
|
|
83
|
+
/** Accessible name for the numeric input. */
|
|
84
|
+
ariaLabel?: string;
|
|
85
|
+
theme?: ThemeMode;
|
|
86
|
+
className?: string;
|
|
87
|
+
}
|
|
88
|
+
/** Numeric entry with −/+ buttons, clamped to [min,max]. For quantities, reps, counts. */
|
|
89
|
+
declare function NumberStepper({ value, onChange, min, max, step, ariaLabel, theme, className, }: NumberStepperProps): react.JSX.Element;
|
|
90
|
+
|
|
91
|
+
export { Checkbox, type CheckboxProps, Chip, type ChipProps, Field, type FieldProps, Input, type InputProps, NumberStepper, type NumberStepperProps, type SegmentOption, SegmentedControl, type SegmentedControlProps, Select, type SelectProps, Switch, type SwitchProps, TextArea, type TextAreaProps };
|
package/dist/forms.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Chip,
|
|
3
|
+
Field,
|
|
4
|
+
Input,
|
|
5
|
+
NumberStepper,
|
|
6
|
+
SegmentedControl,
|
|
7
|
+
Select,
|
|
8
|
+
TextArea
|
|
9
|
+
} from "./chunk-OBPXCUVF.js";
|
|
10
|
+
import {
|
|
11
|
+
Checkbox,
|
|
12
|
+
Switch
|
|
13
|
+
} from "./chunk-PQGUWJG4.js";
|
|
14
|
+
import "./chunk-3AL4SUFD.js";
|
|
15
|
+
import "./chunk-PPOYMKV3.js";
|
|
16
|
+
export {
|
|
17
|
+
Checkbox,
|
|
18
|
+
Chip,
|
|
19
|
+
Field,
|
|
20
|
+
Input,
|
|
21
|
+
NumberStepper,
|
|
22
|
+
SegmentedControl,
|
|
23
|
+
Select,
|
|
24
|
+
Switch,
|
|
25
|
+
TextArea
|
|
26
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
import { Locale } from '@mangtre/core';
|
|
4
|
+
import { T as ThemeMode } from './MangThemeProvider-BqdGKBP2.js';
|
|
5
|
+
|
|
6
|
+
interface HandoffConnectionStatusProps {
|
|
7
|
+
connected: boolean;
|
|
8
|
+
/** Connected device label. */
|
|
9
|
+
device?: string;
|
|
10
|
+
locale?: Locale;
|
|
11
|
+
}
|
|
12
|
+
declare function HandoffConnectionStatus({ connected, device, locale, }: HandoffConnectionStatusProps): react.JSX.Element;
|
|
13
|
+
interface HandoffPairingPanelProps {
|
|
14
|
+
/** The QR node (app-generated, e.g. a <canvas>/<svg>/<img>). */
|
|
15
|
+
qr?: ReactNode;
|
|
16
|
+
connected?: boolean;
|
|
17
|
+
device?: string;
|
|
18
|
+
title?: ReactNode;
|
|
19
|
+
note?: ReactNode;
|
|
20
|
+
locale?: Locale;
|
|
21
|
+
theme?: ThemeMode;
|
|
22
|
+
className?: string;
|
|
23
|
+
}
|
|
24
|
+
declare function HandoffPairingPanel({ qr, connected, device, title, note, locale, theme, className, }: HandoffPairingPanelProps): react.JSX.Element;
|
|
25
|
+
interface HandoffPayloadBannerProps {
|
|
26
|
+
/** Payload kind label (text/json/image). */
|
|
27
|
+
kind: string;
|
|
28
|
+
device?: string;
|
|
29
|
+
onPaste: () => void;
|
|
30
|
+
onDismiss?: () => void;
|
|
31
|
+
locale?: Locale;
|
|
32
|
+
theme?: ThemeMode;
|
|
33
|
+
className?: string;
|
|
34
|
+
}
|
|
35
|
+
declare function HandoffPayloadBanner({ kind, device, onPaste, onDismiss, locale, theme, className, }: HandoffPayloadBannerProps): react.JSX.Element;
|
|
36
|
+
|
|
37
|
+
export { HandoffConnectionStatus, type HandoffConnectionStatusProps, HandoffPairingPanel, type HandoffPairingPanelProps, HandoffPayloadBanner, type HandoffPayloadBannerProps };
|
package/dist/handoff.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import {
|
|
2
|
+
HandoffConnectionStatus,
|
|
3
|
+
HandoffPairingPanel,
|
|
4
|
+
HandoffPayloadBanner
|
|
5
|
+
} from "./chunk-DLKEXWPA.js";
|
|
6
|
+
import "./chunk-YN5O6YL6.js";
|
|
7
|
+
import "./chunk-3AL4SUFD.js";
|
|
8
|
+
import "./chunk-PPOYMKV3.js";
|
|
9
|
+
export {
|
|
10
|
+
HandoffConnectionStatus,
|
|
11
|
+
HandoffPairingPanel,
|
|
12
|
+
HandoffPayloadBanner
|
|
13
|
+
};
|
package/dist/index.css
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* src/theme.css */
|
|
2
|
+
@theme { --color-mang-green: #37b693; --color-mang-shoot: #8fe3b8; --color-mang-bamboo: #1f7a5c; --color-mang-soil: #b5793a; --color-mang-sun: #e8c547; --color-mang-paper: #f4f1e8; --color-mang-dark: #14201c; --color-surface-base: #ffffff; --color-surface-sunken: #f6faf9; --color-surface-inverse: #14201c; --color-content-default: #16242c; --color-content-strong: #14201c; --color-content-muted: #5d6f78; --color-content-inverse: #f4f1e8; --color-content-on-accent: #ffffff; --color-line-subtle: #eef3f2; --color-line-default: #e4eceb; --color-line-strong: #cdd9d6; --color-accent-default: #37b693; --color-accent-hover: #2e9e80; --color-accent-soft: #e7f6f1; --color-state-success: #1f9c7e; --color-state-success-soft: #e7f6f1; --color-state-danger: #d2674a; --color-state-danger-soft: #fbeee9; --color-state-warning: #c77d2e; --color-state-warning-soft: #fbf1e2; --color-state-info: #2e7cb8; --color-state-info-soft: #e6f0f8; --font-heading: "Quicksand Variable", system-ui, sans-serif; --font-body: "Inter", system-ui, sans-serif; }
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
export { Tokens, defaultTheme, tokens } from './tokens.js';
|
|
2
|
+
export { D as Density, M as MangThemeContextValue, a as MangThemeProvider, b as MangThemeProviderProps, T as ThemeMode, u as useDensity, c as useLocale, d as useMangTheme, e as useResolvedTheme } from './MangThemeProvider-BqdGKBP2.js';
|
|
3
|
+
export { KIT_STYLE_ID, ScopeProps, cx, useAreaStyles, useKitStyles, useScope, useScopedStyle } from './theme.js';
|
|
4
|
+
export { Box, BoxProps, Divider, DividerProps, HStack, Heading, HeadingProps, Spacer, SpacerProps, Stack, StackProps, Text, TextProps, VStack } from './primitives.js';
|
|
5
|
+
export { Button, ButtonGroup, ButtonGroupProps, ButtonProps, ButtonSize, ButtonVariant, IconButton, IconButtonProps } from './actions.js';
|
|
6
|
+
export { Checkbox, CheckboxProps, Chip, ChipProps, Field, FieldProps, Input, InputProps, NumberStepper, NumberStepperProps, SegmentOption, SegmentedControl, SegmentedControlProps, Select, SelectProps, Switch, SwitchProps, TextArea, TextAreaProps } from './forms.js';
|
|
7
|
+
export { Card, CardBody, CardFooter, CardHeader, CardProps, Panel, PanelProps } from './surface.js';
|
|
8
|
+
export { Tab, TabList, TabListProps, TabPanel, TabPanelProps, TabProps, Tabs, TabsProps } from './navigation.js';
|
|
9
|
+
export { Dialog, DialogProps, Sheet, SheetProps, ToastAction, ToastInput, ToastItem, ToastProvider, ToastProviderProps, ToastTone, ToastViewport, ToastViewportProps, toastReducer, useToast } from './overlay.js';
|
|
10
|
+
export { EmptyState, EmptyStateProps, ErrorState, ErrorStateProps, Progress, ProgressProps, Skeleton, SkeletonProps, Spinner, SpinnerProps } from './feedback.js';
|
|
11
|
+
export { Badge, BadgeProps, BadgeTone, CloudBadge, DesktopOnly, GracefulDegradePanel, GracefulDegradePanelProps, LocalBadge, PermissionBadge, PermissionBadgeProps, PermissionGate, PermissionGateProps, RealtimeBadge, Surface, SurfaceBadge, SurfaceBadgeProps, SurfaceGate, SurfaceGateProps, VerifiedBadge, VerifiedBadgeProps, WebOnly, ZaloOnly } from './platform.js';
|
|
12
|
+
export { M as MoneyText, a as MoneyTextProps, V as VndText, b as VndTextProps, f as formatVnd } from './Money-Dw3GnUvX.js';
|
|
13
|
+
export { AiModelOption, AiSetupCard, AiSetupCardProps, AiStatusCard, AiStatusCardProps, PowerPicker, PowerPickerProps } from './ai.js';
|
|
14
|
+
export { AreaChart, BarChart, BarChartProps, DonutChart, DonutChartProps, Heatmap, HeatmapProps, Legend, LegendItem, LineChart, LineChartProps, SERIES, Segment, Sparkline, SparklineProps, Stat, StatGroup, StatProps, axisMax, barFractions, linePoints, pieSegments } from './charts.js';
|
|
15
|
+
export { HandoffConnectionStatus, HandoffConnectionStatusProps, HandoffPairingPanel, HandoffPairingPanelProps, HandoffPayloadBanner, HandoffPayloadBannerProps } from './handoff.js';
|
|
16
|
+
export { RoomConflictNotice, RoomConflictNoticeProps, RoomLinkCard, RoomLinkCardProps, RoomPresence, RoomPresenceProps, RoomShareButton, RoomShareButtonProps, RoomStatus, RoomStatusBadge, RoomStatusBadgeProps } from './data-room.js';
|
|
17
|
+
export { AnalyticsConsentToggle, AnalyticsConsentToggleProps, EventLogRow, EventLogTable, EventLogTableProps, GateMetBadge, GateMetBadgeProps, GateReport, GateReportProps, GateReportRow } from './analytics.js';
|
|
18
|
+
export { SafetyScanBadge, SafetyScanBadgeProps, SandboxError, SandboxErrorProps, SandboxFrame, SandboxFrameProps, ScanFinding, ScanLevel, StaticScanResult, StaticScanResultProps } from './sandbox.js';
|
|
19
|
+
export { BuildBadge, BuildBadgeProps, BundleUploadDropzone, BundleUploadDropzoneProps, ManifestPreview, ManifestPreviewProps, ManifestSummary, ReviewStatus, ReviewStatusBadge, ReviewStatusBadgeProps, StaticScanPanel, StaticScanPanelProps, VersionBadge, VersionBadgeProps } from './creator.js';
|
|
20
|
+
export { AmountSummary, AmountSummaryProps, ExpenseList, ExpenseRow, ExpenseRowProps, PaidBadge, PaidBadgeProps, SettlementCard, SettlementCardProps, UnpaidBadge } from './money.js';
|
|
21
|
+
export { Flashcard, FlashcardProps, QuizCard, QuizCardProps, QuizOption, ScoreCard, ScoreCardProps, StreakBadge, StreakBadgeProps } from './learning.js';
|
|
22
|
+
export { AppFrame, AppFrameProps, BottomActionBar, Container, ContainerProps, ListRow, ListRowProps, Page, PageHeader, PageHeaderProps, SafeArea, SafeAreaProps, Section, SectionProps } from './layout.js';
|
|
23
|
+
export { Avatar, AvatarGroup, AvatarGroupProps, AvatarProps, Dropzone, DropzoneProps, FilePreview, FilePreviewProps, ImagePreview, ImagePreviewProps } from './media.js';
|
|
24
|
+
export { SettingsRow, SettingsRowProps, SettingsSection, SettingsToggle, SettingsToggleProps } from './settings.js';
|
|
25
|
+
export { ExternalLinkWarning, ExternalLinkWarningProps, LocalFirstNotice, NoPiiBadge, PrivacyNotice, PrivacyNoticeProps } from './privacy.js';
|
|
26
|
+
export { CalloutBlock, CalloutBlockProps, CalloutTone, CodeBlock, CodeBlockProps, Kbd, Prose } from './editor.js';
|
|
27
|
+
export { ComingSoonMonetizationCard, ComingSoonMonetizationCardProps, EarningsLedgerTable, EarningsRow, PayoutStatus, PayoutStatusBadge } from './monetization.js';
|
|
28
|
+
import { ThemeTokens } from '@mangtre/core';
|
|
29
|
+
export { MangApp, MangAppProps } from './app.js';
|
|
30
|
+
import 'react';
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Refcounted, id-keyed `<style>` injection — the shared mechanism every Măng UI piece uses to
|
|
34
|
+
* mount its scoped CSS (a mini-app's whole stylesheet, or a self-styling component like
|
|
35
|
+
* `PowerPicker`). Extracted from `index.ts` so components can import it without a barrel cycle.
|
|
36
|
+
*/
|
|
37
|
+
/**
|
|
38
|
+
* Mount a refcounted, id-keyed `<style>` into `<head>` and return a disposer.
|
|
39
|
+
*
|
|
40
|
+
* A mini-app injects its whole stylesheet as one `<style>` on mount and drops it on unmount.
|
|
41
|
+
* The shell can mount → unmount → re-mount an app in quick succession — React StrictMode
|
|
42
|
+
* double-invokes effects in dev, and an async-loaded app can overlap a stale teardown — so a
|
|
43
|
+
* naive "whoever created the tag removes it" flag lets a STALE instance's cleanup delete the
|
|
44
|
+
* `<style>` out from under a LIVE one, leaving the app rendered but unstyled. Counting live
|
|
45
|
+
* instances and only removing the tag when the count hits zero makes teardown correct under
|
|
46
|
+
* ANY mount/unmount interleaving. The latest mount refreshes the CSS (the theme may differ).
|
|
47
|
+
*
|
|
48
|
+
* The returned disposer is idempotent (safe to call more than once — extra calls are no-ops).
|
|
49
|
+
*/
|
|
50
|
+
declare function mountScopedStyle(id: string, css: string): () => void;
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* `applyThemeVars` — write the brand theme onto an element as CSS custom properties
|
|
54
|
+
* (`--mang-color-*`, `--mang-font-*`). The RUNTIME seam: projects the `sdk.theme` accent thread
|
|
55
|
+
* (7 colors + fonts) onto a host element, independent of the build-time `@mangtre/ui` import.
|
|
56
|
+
*
|
|
57
|
+
* Kept in its own module (not the barrel) so `MangApp` can use it without a circular import.
|
|
58
|
+
*/
|
|
59
|
+
|
|
60
|
+
declare function applyThemeVars(el: HTMLElement, theme?: ThemeTokens): void;
|
|
61
|
+
|
|
62
|
+
export { applyThemeVars, mountScopedStyle };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,338 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ExternalLinkWarning,
|
|
3
|
+
LocalFirstNotice,
|
|
4
|
+
NoPiiBadge,
|
|
5
|
+
PrivacyNotice
|
|
6
|
+
} from "./chunk-IVYXOKMO.js";
|
|
7
|
+
import {
|
|
8
|
+
CalloutBlock,
|
|
9
|
+
CodeBlock,
|
|
10
|
+
Kbd,
|
|
11
|
+
Prose
|
|
12
|
+
} from "./chunk-Z4ANGBPC.js";
|
|
13
|
+
import {
|
|
14
|
+
ComingSoonMonetizationCard,
|
|
15
|
+
EarningsLedgerTable,
|
|
16
|
+
PayoutStatusBadge
|
|
17
|
+
} from "./chunk-ASZKHSMG.js";
|
|
18
|
+
import {
|
|
19
|
+
AnalyticsConsentToggle,
|
|
20
|
+
EventLogTable,
|
|
21
|
+
GateMetBadge,
|
|
22
|
+
GateReport
|
|
23
|
+
} from "./chunk-ID233AGM.js";
|
|
24
|
+
import "./chunk-VP56Z4BS.js";
|
|
25
|
+
import {
|
|
26
|
+
BuildBadge,
|
|
27
|
+
BundleUploadDropzone,
|
|
28
|
+
ManifestPreview,
|
|
29
|
+
ReviewStatusBadge,
|
|
30
|
+
StaticScanPanel,
|
|
31
|
+
VersionBadge
|
|
32
|
+
} from "./chunk-JJB4PJC3.js";
|
|
33
|
+
import {
|
|
34
|
+
SafetyScanBadge,
|
|
35
|
+
SandboxError,
|
|
36
|
+
SandboxFrame,
|
|
37
|
+
StaticScanResult
|
|
38
|
+
} from "./chunk-X7T2DJLU.js";
|
|
39
|
+
import {
|
|
40
|
+
AmountSummary,
|
|
41
|
+
ExpenseList,
|
|
42
|
+
ExpenseRow,
|
|
43
|
+
PaidBadge,
|
|
44
|
+
SettlementCard,
|
|
45
|
+
UnpaidBadge
|
|
46
|
+
} from "./chunk-UF6ANDJZ.js";
|
|
47
|
+
import {
|
|
48
|
+
Flashcard,
|
|
49
|
+
QuizCard,
|
|
50
|
+
ScoreCard,
|
|
51
|
+
StreakBadge
|
|
52
|
+
} from "./chunk-4XNSYKQE.js";
|
|
53
|
+
import {
|
|
54
|
+
AppFrame,
|
|
55
|
+
BottomActionBar,
|
|
56
|
+
Container,
|
|
57
|
+
ListRow,
|
|
58
|
+
Page,
|
|
59
|
+
PageHeader,
|
|
60
|
+
SafeArea,
|
|
61
|
+
Section
|
|
62
|
+
} from "./chunk-XPV3OOLU.js";
|
|
63
|
+
import {
|
|
64
|
+
Avatar,
|
|
65
|
+
AvatarGroup,
|
|
66
|
+
Dropzone,
|
|
67
|
+
FilePreview,
|
|
68
|
+
ImagePreview
|
|
69
|
+
} from "./chunk-RE7OWRA4.js";
|
|
70
|
+
import {
|
|
71
|
+
SettingsRow,
|
|
72
|
+
SettingsSection,
|
|
73
|
+
SettingsToggle
|
|
74
|
+
} from "./chunk-VRD66FIA.js";
|
|
75
|
+
import {
|
|
76
|
+
Tab,
|
|
77
|
+
TabList,
|
|
78
|
+
TabPanel,
|
|
79
|
+
Tabs
|
|
80
|
+
} from "./chunk-SJF3CHAW.js";
|
|
81
|
+
import {
|
|
82
|
+
Dialog,
|
|
83
|
+
Sheet
|
|
84
|
+
} from "./chunk-LNRUPJDF.js";
|
|
85
|
+
import {
|
|
86
|
+
EmptyState,
|
|
87
|
+
ErrorState,
|
|
88
|
+
Progress,
|
|
89
|
+
Skeleton,
|
|
90
|
+
Spinner
|
|
91
|
+
} from "./chunk-VGC5DMOM.js";
|
|
92
|
+
import {
|
|
93
|
+
CloudBadge,
|
|
94
|
+
DesktopOnly,
|
|
95
|
+
GracefulDegradePanel,
|
|
96
|
+
LocalBadge,
|
|
97
|
+
PermissionBadge,
|
|
98
|
+
PermissionGate,
|
|
99
|
+
RealtimeBadge,
|
|
100
|
+
SurfaceBadge,
|
|
101
|
+
SurfaceGate,
|
|
102
|
+
WebOnly,
|
|
103
|
+
ZaloOnly
|
|
104
|
+
} from "./chunk-K5Q3RCV6.js";
|
|
105
|
+
import {
|
|
106
|
+
MoneyText,
|
|
107
|
+
VndText,
|
|
108
|
+
formatVnd
|
|
109
|
+
} from "./chunk-IX3DYETF.js";
|
|
110
|
+
import {
|
|
111
|
+
Badge,
|
|
112
|
+
VerifiedBadge
|
|
113
|
+
} from "./chunk-FZRXVRC7.js";
|
|
114
|
+
import {
|
|
115
|
+
AiSetupCard,
|
|
116
|
+
AiStatusCard,
|
|
117
|
+
PowerPicker
|
|
118
|
+
} from "./chunk-BCBN2EGH.js";
|
|
119
|
+
import {
|
|
120
|
+
AreaChart,
|
|
121
|
+
BarChart,
|
|
122
|
+
DonutChart,
|
|
123
|
+
Heatmap,
|
|
124
|
+
Legend,
|
|
125
|
+
LineChart,
|
|
126
|
+
SERIES,
|
|
127
|
+
Sparkline,
|
|
128
|
+
Stat,
|
|
129
|
+
StatGroup,
|
|
130
|
+
axisMax,
|
|
131
|
+
barFractions,
|
|
132
|
+
linePoints,
|
|
133
|
+
pieSegments
|
|
134
|
+
} from "./chunk-BLYAFV45.js";
|
|
135
|
+
import {
|
|
136
|
+
HandoffConnectionStatus,
|
|
137
|
+
HandoffPairingPanel,
|
|
138
|
+
HandoffPayloadBanner
|
|
139
|
+
} from "./chunk-DLKEXWPA.js";
|
|
140
|
+
import {
|
|
141
|
+
RoomConflictNotice,
|
|
142
|
+
RoomLinkCard,
|
|
143
|
+
RoomPresence,
|
|
144
|
+
RoomShareButton,
|
|
145
|
+
RoomStatusBadge
|
|
146
|
+
} from "./chunk-OJX2EIMB.js";
|
|
147
|
+
import {
|
|
148
|
+
MangApp,
|
|
149
|
+
applyThemeVars
|
|
150
|
+
} from "./chunk-7P2EQZYD.js";
|
|
151
|
+
import {
|
|
152
|
+
ToastProvider,
|
|
153
|
+
ToastViewport,
|
|
154
|
+
toastReducer,
|
|
155
|
+
useToast
|
|
156
|
+
} from "./chunk-DTASXPTB.js";
|
|
157
|
+
import {
|
|
158
|
+
Box,
|
|
159
|
+
Divider,
|
|
160
|
+
HStack,
|
|
161
|
+
Heading,
|
|
162
|
+
Spacer,
|
|
163
|
+
Stack,
|
|
164
|
+
Text,
|
|
165
|
+
VStack
|
|
166
|
+
} from "./chunk-7WHNIEDV.js";
|
|
167
|
+
import "./chunk-LZORNMBL.js";
|
|
168
|
+
import {
|
|
169
|
+
Button,
|
|
170
|
+
ButtonGroup,
|
|
171
|
+
IconButton
|
|
172
|
+
} from "./chunk-YN5O6YL6.js";
|
|
173
|
+
import {
|
|
174
|
+
Chip,
|
|
175
|
+
Field,
|
|
176
|
+
Input,
|
|
177
|
+
NumberStepper,
|
|
178
|
+
SegmentedControl,
|
|
179
|
+
Select,
|
|
180
|
+
TextArea
|
|
181
|
+
} from "./chunk-OBPXCUVF.js";
|
|
182
|
+
import {
|
|
183
|
+
Checkbox,
|
|
184
|
+
Switch
|
|
185
|
+
} from "./chunk-PQGUWJG4.js";
|
|
186
|
+
import {
|
|
187
|
+
Card,
|
|
188
|
+
CardBody,
|
|
189
|
+
CardFooter,
|
|
190
|
+
CardHeader,
|
|
191
|
+
Panel
|
|
192
|
+
} from "./chunk-5Z4VLQKH.js";
|
|
193
|
+
import {
|
|
194
|
+
mountScopedStyle
|
|
195
|
+
} from "./chunk-3AL4SUFD.js";
|
|
196
|
+
import {
|
|
197
|
+
defaultTheme,
|
|
198
|
+
tokens
|
|
199
|
+
} from "./chunk-PPOYMKV3.js";
|
|
200
|
+
export {
|
|
201
|
+
AiSetupCard,
|
|
202
|
+
AiStatusCard,
|
|
203
|
+
AmountSummary,
|
|
204
|
+
AnalyticsConsentToggle,
|
|
205
|
+
AppFrame,
|
|
206
|
+
AreaChart,
|
|
207
|
+
Avatar,
|
|
208
|
+
AvatarGroup,
|
|
209
|
+
Badge,
|
|
210
|
+
BarChart,
|
|
211
|
+
BottomActionBar,
|
|
212
|
+
Box,
|
|
213
|
+
BuildBadge,
|
|
214
|
+
BundleUploadDropzone,
|
|
215
|
+
Button,
|
|
216
|
+
ButtonGroup,
|
|
217
|
+
CalloutBlock,
|
|
218
|
+
Card,
|
|
219
|
+
CardBody,
|
|
220
|
+
CardFooter,
|
|
221
|
+
CardHeader,
|
|
222
|
+
Checkbox,
|
|
223
|
+
Chip,
|
|
224
|
+
CloudBadge,
|
|
225
|
+
CodeBlock,
|
|
226
|
+
ComingSoonMonetizationCard,
|
|
227
|
+
Container,
|
|
228
|
+
DesktopOnly,
|
|
229
|
+
Dialog,
|
|
230
|
+
Divider,
|
|
231
|
+
DonutChart,
|
|
232
|
+
Dropzone,
|
|
233
|
+
EarningsLedgerTable,
|
|
234
|
+
EmptyState,
|
|
235
|
+
ErrorState,
|
|
236
|
+
EventLogTable,
|
|
237
|
+
ExpenseList,
|
|
238
|
+
ExpenseRow,
|
|
239
|
+
ExternalLinkWarning,
|
|
240
|
+
Field,
|
|
241
|
+
FilePreview,
|
|
242
|
+
Flashcard,
|
|
243
|
+
GateMetBadge,
|
|
244
|
+
GateReport,
|
|
245
|
+
GracefulDegradePanel,
|
|
246
|
+
HStack,
|
|
247
|
+
HandoffConnectionStatus,
|
|
248
|
+
HandoffPairingPanel,
|
|
249
|
+
HandoffPayloadBanner,
|
|
250
|
+
Heading,
|
|
251
|
+
Heatmap,
|
|
252
|
+
IconButton,
|
|
253
|
+
ImagePreview,
|
|
254
|
+
Input,
|
|
255
|
+
Kbd,
|
|
256
|
+
Legend,
|
|
257
|
+
LineChart,
|
|
258
|
+
ListRow,
|
|
259
|
+
LocalBadge,
|
|
260
|
+
LocalFirstNotice,
|
|
261
|
+
MangApp,
|
|
262
|
+
ManifestPreview,
|
|
263
|
+
MoneyText,
|
|
264
|
+
NoPiiBadge,
|
|
265
|
+
NumberStepper,
|
|
266
|
+
Page,
|
|
267
|
+
PageHeader,
|
|
268
|
+
PaidBadge,
|
|
269
|
+
Panel,
|
|
270
|
+
PayoutStatusBadge,
|
|
271
|
+
PermissionBadge,
|
|
272
|
+
PermissionGate,
|
|
273
|
+
PowerPicker,
|
|
274
|
+
PrivacyNotice,
|
|
275
|
+
Progress,
|
|
276
|
+
Prose,
|
|
277
|
+
QuizCard,
|
|
278
|
+
RealtimeBadge,
|
|
279
|
+
ReviewStatusBadge,
|
|
280
|
+
RoomConflictNotice,
|
|
281
|
+
RoomLinkCard,
|
|
282
|
+
RoomPresence,
|
|
283
|
+
RoomShareButton,
|
|
284
|
+
RoomStatusBadge,
|
|
285
|
+
SERIES,
|
|
286
|
+
SafeArea,
|
|
287
|
+
SafetyScanBadge,
|
|
288
|
+
SandboxError,
|
|
289
|
+
SandboxFrame,
|
|
290
|
+
ScoreCard,
|
|
291
|
+
Section,
|
|
292
|
+
SegmentedControl,
|
|
293
|
+
Select,
|
|
294
|
+
SettingsRow,
|
|
295
|
+
SettingsSection,
|
|
296
|
+
SettingsToggle,
|
|
297
|
+
SettlementCard,
|
|
298
|
+
Sheet,
|
|
299
|
+
Skeleton,
|
|
300
|
+
Spacer,
|
|
301
|
+
Sparkline,
|
|
302
|
+
Spinner,
|
|
303
|
+
Stack,
|
|
304
|
+
Stat,
|
|
305
|
+
StatGroup,
|
|
306
|
+
StaticScanPanel,
|
|
307
|
+
StaticScanResult,
|
|
308
|
+
StreakBadge,
|
|
309
|
+
SurfaceBadge,
|
|
310
|
+
SurfaceGate,
|
|
311
|
+
Switch,
|
|
312
|
+
Tab,
|
|
313
|
+
TabList,
|
|
314
|
+
TabPanel,
|
|
315
|
+
Tabs,
|
|
316
|
+
Text,
|
|
317
|
+
TextArea,
|
|
318
|
+
ToastProvider,
|
|
319
|
+
ToastViewport,
|
|
320
|
+
UnpaidBadge,
|
|
321
|
+
VStack,
|
|
322
|
+
VerifiedBadge,
|
|
323
|
+
VersionBadge,
|
|
324
|
+
VndText,
|
|
325
|
+
WebOnly,
|
|
326
|
+
ZaloOnly,
|
|
327
|
+
applyThemeVars,
|
|
328
|
+
axisMax,
|
|
329
|
+
barFractions,
|
|
330
|
+
defaultTheme,
|
|
331
|
+
formatVnd,
|
|
332
|
+
linePoints,
|
|
333
|
+
mountScopedStyle,
|
|
334
|
+
pieSegments,
|
|
335
|
+
toastReducer,
|
|
336
|
+
tokens,
|
|
337
|
+
useToast
|
|
338
|
+
};
|
package/dist/layout.d.ts
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { CSSProperties, ReactNode } from 'react';
|
|
3
|
+
import { T as ThemeMode } from './MangThemeProvider-BqdGKBP2.js';
|
|
4
|
+
import '@mangtre/core';
|
|
5
|
+
|
|
6
|
+
interface AppFrameProps {
|
|
7
|
+
className?: string;
|
|
8
|
+
style?: CSSProperties;
|
|
9
|
+
children?: ReactNode;
|
|
10
|
+
}
|
|
11
|
+
/** Full-height column frame (header/body/footer compose inside). */
|
|
12
|
+
declare function AppFrame({ className, style, children }: AppFrameProps): react.JSX.Element;
|
|
13
|
+
interface Themed {
|
|
14
|
+
theme?: ThemeMode;
|
|
15
|
+
className?: string;
|
|
16
|
+
children?: ReactNode;
|
|
17
|
+
}
|
|
18
|
+
declare function Page({ theme, className, children }: Themed): react.JSX.Element;
|
|
19
|
+
interface ContainerProps extends Themed {
|
|
20
|
+
width?: "default" | "reading";
|
|
21
|
+
}
|
|
22
|
+
declare function Container({ width, theme, className, children }: ContainerProps): react.JSX.Element;
|
|
23
|
+
interface PageHeaderProps extends Themed {
|
|
24
|
+
eyebrow?: ReactNode;
|
|
25
|
+
title: ReactNode;
|
|
26
|
+
actions?: ReactNode;
|
|
27
|
+
}
|
|
28
|
+
declare function PageHeader({ eyebrow, title, actions, theme, className }: PageHeaderProps): react.JSX.Element;
|
|
29
|
+
interface SectionProps extends Themed {
|
|
30
|
+
title?: ReactNode;
|
|
31
|
+
}
|
|
32
|
+
declare function Section({ title, theme, className, children }: SectionProps): react.JSX.Element;
|
|
33
|
+
declare function BottomActionBar({ theme, className, children }: Themed): react.JSX.Element;
|
|
34
|
+
interface ListRowProps extends Themed {
|
|
35
|
+
/** Leading slot — icon, avatar, emoji. */
|
|
36
|
+
leading?: ReactNode;
|
|
37
|
+
title: ReactNode;
|
|
38
|
+
/** Secondary line under the title. */
|
|
39
|
+
meta?: ReactNode;
|
|
40
|
+
/** Trailing slot — badge, amount, chevron, action. */
|
|
41
|
+
trailing?: ReactNode;
|
|
42
|
+
/** Makes the whole row a button. */
|
|
43
|
+
onClick?: () => void;
|
|
44
|
+
}
|
|
45
|
+
/** A list item with leading / title+meta / trailing slots. Interactive when `onClick` is set. */
|
|
46
|
+
declare function ListRow({ leading, title, meta, trailing, onClick, theme, className, }: ListRowProps): react.JSX.Element;
|
|
47
|
+
interface SafeAreaProps {
|
|
48
|
+
/** Edges to pad for device insets. Default all. */
|
|
49
|
+
edges?: Array<"top" | "bottom" | "left" | "right">;
|
|
50
|
+
className?: string;
|
|
51
|
+
style?: CSSProperties;
|
|
52
|
+
children?: ReactNode;
|
|
53
|
+
}
|
|
54
|
+
/** Adds `env(safe-area-inset-*)` padding for notched devices/PWAs. */
|
|
55
|
+
declare function SafeArea({ edges, className, style, children, }: SafeAreaProps): react.JSX.Element;
|
|
56
|
+
|
|
57
|
+
export { AppFrame, type AppFrameProps, BottomActionBar, Container, type ContainerProps, ListRow, type ListRowProps, Page, PageHeader, type PageHeaderProps, SafeArea, type SafeAreaProps, Section, type SectionProps };
|
package/dist/layout.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AppFrame,
|
|
3
|
+
BottomActionBar,
|
|
4
|
+
Container,
|
|
5
|
+
ListRow,
|
|
6
|
+
Page,
|
|
7
|
+
PageHeader,
|
|
8
|
+
SafeArea,
|
|
9
|
+
Section
|
|
10
|
+
} from "./chunk-XPV3OOLU.js";
|
|
11
|
+
import "./chunk-3AL4SUFD.js";
|
|
12
|
+
import "./chunk-PPOYMKV3.js";
|
|
13
|
+
export {
|
|
14
|
+
AppFrame,
|
|
15
|
+
BottomActionBar,
|
|
16
|
+
Container,
|
|
17
|
+
ListRow,
|
|
18
|
+
Page,
|
|
19
|
+
PageHeader,
|
|
20
|
+
SafeArea,
|
|
21
|
+
Section
|
|
22
|
+
};
|