@wakastellar/ui 1.0.10 → 2.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/README.md +163 -193
- package/dist/blocks/chat/index.d.ts +2 -0
- package/dist/blocks/chat/widget.d.ts +100 -0
- package/dist/charts.cjs.js +1 -0
- package/dist/charts.es.js +16 -0
- package/dist/cn-B-fTneHh.js +1 -0
- package/dist/cn-DzRe1GWm.mjs +21 -0
- package/dist/components/index.d.ts +122 -0
- package/dist/components/waka-3d-pie-chart/index.d.ts +67 -0
- package/dist/components/waka-achievement-unlock/index.d.ts +83 -0
- package/dist/components/waka-activity-feed/index.d.ts +78 -0
- package/dist/components/waka-address-autocomplete/index.d.ts +124 -0
- package/dist/components/waka-alert-stack/index.d.ts +58 -0
- package/dist/components/waka-allocation-matrix/index.d.ts +193 -0
- package/dist/components/waka-approval-chain/index.d.ts +43 -0
- package/dist/components/waka-audit-log/index.d.ts +142 -0
- package/dist/components/waka-badge-showcase/index.d.ts +51 -0
- package/dist/components/waka-biometric-prompt/index.d.ts +84 -0
- package/dist/components/waka-bottom-sheet/index.d.ts +61 -0
- package/dist/components/waka-breadcrumb-path/index.d.ts +46 -0
- package/dist/components/waka-budget-burn/index.d.ts +154 -0
- package/dist/components/waka-capacity-planner/index.d.ts +132 -0
- package/dist/components/waka-cart-summary/index.d.ts +154 -0
- package/dist/components/waka-challenge-timer/index.d.ts +86 -0
- package/dist/components/waka-chat-bubble/index.d.ts +127 -0
- package/dist/components/waka-checklist/index.d.ts +123 -0
- package/dist/components/waka-checkout-stepper/index.d.ts +154 -0
- package/dist/components/waka-cohort-table/index.d.ts +130 -0
- package/dist/components/waka-combo-counter/index.d.ts +53 -0
- package/dist/components/waka-command-bar/index.d.ts +45 -0
- package/dist/components/waka-compare-period/index.d.ts +122 -0
- package/dist/components/waka-connection-matrix/index.d.ts +117 -0
- package/dist/components/waka-contribution-graph/index.d.ts +34 -0
- package/dist/components/waka-cost-breakdown/index.d.ts +50 -0
- package/dist/components/waka-coupon-input/index.d.ts +105 -0
- package/dist/components/waka-credit-card-input/index.d.ts +95 -0
- package/dist/components/waka-daily-reward/index.d.ts +76 -0
- package/dist/components/waka-deployment-lane/index.d.ts +43 -0
- package/dist/components/waka-device-trust/index.d.ts +95 -0
- package/dist/components/waka-dock/index.d.ts +44 -0
- package/dist/components/waka-empty-state/index.d.ts +85 -0
- package/dist/components/waka-error-shake/index.d.ts +49 -0
- package/dist/components/waka-feature-announcement/index.d.ts +112 -0
- package/dist/components/waka-floating-nav/index.d.ts +51 -0
- package/dist/components/waka-flow-diagram/index.d.ts +71 -0
- package/dist/components/waka-funnel-chart/index.d.ts +108 -0
- package/dist/components/waka-glow-card/index.d.ts +32 -0
- package/dist/components/waka-goal-progress/index.d.ts +139 -0
- package/dist/components/waka-haptic-button/index.d.ts +45 -0
- package/dist/components/waka-health-pulse/index.d.ts +28 -0
- package/dist/components/waka-heatmap/index.d.ts +135 -0
- package/dist/components/waka-hotspot/index.d.ts +106 -0
- package/dist/components/waka-incident-timeline/index.d.ts +38 -0
- package/dist/components/waka-invoice-preview/index.d.ts +137 -0
- package/dist/components/waka-kpi-dashboard/index.d.ts +80 -0
- package/dist/components/waka-leaderboard/index.d.ts +85 -0
- package/dist/components/waka-level-progress/index.d.ts +89 -0
- package/dist/components/waka-liquid-button/index.d.ts +41 -0
- package/dist/components/waka-loading-orbit/index.d.ts +90 -0
- package/dist/components/waka-loot-box/index.d.ts +87 -0
- package/dist/components/waka-magic-link/index.d.ts +34 -0
- package/dist/components/waka-magnetic-button/index.d.ts +56 -0
- package/dist/components/waka-mention-input/index.d.ts +106 -0
- package/dist/components/waka-metric-sparkline/index.d.ts +46 -0
- package/dist/components/waka-milestone-road/index.d.ts +91 -0
- package/dist/components/waka-morph-button/index.d.ts +62 -0
- package/dist/components/waka-network-topology/index.d.ts +35 -0
- package/dist/components/waka-orbital-menu/index.d.ts +61 -0
- package/dist/components/waka-order-tracker/index.d.ts +121 -0
- package/dist/components/waka-password-strength/index.d.ts +98 -0
- package/dist/components/waka-payment-method-picker/index.d.ts +88 -0
- package/dist/components/waka-permission-matrix/index.d.ts +197 -0
- package/dist/components/waka-phone-input/index.d.ts +93 -0
- package/dist/components/waka-pipeline-view/index.d.ts +49 -0
- package/dist/components/waka-player-card/index.d.ts +36 -0
- package/dist/components/waka-points-popup/index.d.ts +75 -0
- package/dist/components/waka-power-up/index.d.ts +103 -0
- package/dist/components/waka-presence-indicator/index.d.ts +188 -0
- package/dist/components/waka-pricing-table/index.d.ts +77 -0
- package/dist/components/waka-product-card/index.d.ts +81 -0
- package/dist/components/waka-progress-onboarding/index.d.ts +97 -0
- package/dist/components/waka-pull-to-refresh/index.d.ts +45 -0
- package/dist/components/waka-quest-card/index.d.ts +110 -0
- package/dist/components/waka-quota-bar/index.d.ts +100 -0
- package/dist/components/waka-radar-score/index.d.ts +95 -0
- package/dist/components/waka-rank-badge/index.d.ts +58 -0
- package/dist/components/waka-rating-input/index.d.ts +110 -0
- package/dist/components/waka-reaction-picker/index.d.ts +77 -0
- package/dist/components/waka-region-map/index.d.ts +27 -0
- package/dist/components/waka-resource-gauge/index.d.ts +78 -0
- package/dist/components/waka-resource-pool/index.d.ts +81 -0
- package/dist/components/waka-rollback-slider/index.d.ts +79 -0
- package/dist/components/waka-sankey-diagram/index.d.ts +120 -0
- package/dist/components/waka-schedule-picker/index.d.ts +100 -0
- package/dist/components/waka-scratch-card/index.d.ts +87 -0
- package/dist/components/waka-season-pass/index.d.ts +65 -0
- package/dist/components/waka-security-score/index.d.ts +124 -0
- package/dist/components/waka-server-rack/index.d.ts +44 -0
- package/dist/components/waka-session-manager/index.d.ts +116 -0
- package/dist/components/waka-signature-pad/index.d.ts +87 -0
- package/dist/components/waka-skeleton-wave/index.d.ts +79 -0
- package/dist/components/waka-skill-tree/index.d.ts +78 -0
- package/dist/components/waka-sla-tracker/index.d.ts +65 -0
- package/dist/components/waka-slider-range/index.d.ts +88 -0
- package/dist/components/waka-spin-wheel/index.d.ts +51 -0
- package/dist/components/waka-spotlight/index.d.ts +47 -0
- package/dist/components/waka-stats-hexagon/index.d.ts +149 -0
- package/dist/components/waka-status-matrix/index.d.ts +38 -0
- package/dist/components/waka-streak-counter/index.d.ts +27 -0
- package/dist/components/waka-success-explosion/index.d.ts +51 -0
- package/dist/components/waka-swipe-card/index.d.ts +64 -0
- package/dist/components/waka-tabs-morph/index.d.ts +66 -0
- package/dist/components/waka-tag-input/index.d.ts +134 -0
- package/dist/components/waka-team-banner/index.d.ts +122 -0
- package/dist/components/waka-terminal-output/index.d.ts +48 -0
- package/dist/components/waka-thread-view/index.d.ts +101 -0
- package/dist/components/waka-tilt-card/index.d.ts +36 -0
- package/dist/components/waka-tooltip-tour/index.d.ts +118 -0
- package/dist/components/waka-tour-guide/index.d.ts +122 -0
- package/dist/components/waka-tournament-bracket/index.d.ts +101 -0
- package/dist/components/waka-treemap-chart/index.d.ts +104 -0
- package/dist/components/waka-two-factor-setup/index.d.ts +93 -0
- package/dist/components/waka-typewriter/index.d.ts +98 -0
- package/dist/components/waka-typing-indicator/index.d.ts +64 -0
- package/dist/components/waka-versus-card/index.d.ts +117 -0
- package/dist/components/waka-video-call/index.d.ts +170 -0
- package/dist/components/waka-voice-message/index.d.ts +117 -0
- package/dist/components/waka-welcome-modal/index.d.ts +120 -0
- package/dist/components/waka-xp-bar/index.d.ts +54 -0
- package/dist/export.cjs.js +1 -0
- package/dist/export.d.ts +3 -1
- package/dist/export.es.js +5 -0
- package/dist/index-B9GTFkji.js +1 -0
- package/dist/index-c0jcWyEL.mjs +466 -0
- package/dist/index.cjs.js +2530 -22
- package/dist/index.d.ts +1 -0
- package/dist/index.es.js +71378 -18523
- package/dist/rich-text.cjs.js +1 -0
- package/dist/rich-text.es.js +4 -0
- package/dist/types-BOWIoR7j.mjs +1111 -0
- package/dist/types-D2yCJ91P.js +1 -0
- package/dist/useDataTableImport-D8R2HQl6.mjs +229 -0
- package/dist/useDataTableImport-S_hhA5Wo.js +9 -0
- package/package.json +57 -20
- package/src/styles/base.css +108 -0
- package/src/styles/code-highlight.css +82 -86
- package/src/styles/globals-v3.css +9 -0
- package/src/styles/globals.css +57 -74
- package/src/styles/tailwind.preset.js +69 -0
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export interface SpendDataPoint {
|
|
3
|
+
/** Date of the spend */
|
|
4
|
+
date: Date;
|
|
5
|
+
/** Amount spent on this day */
|
|
6
|
+
amount: number;
|
|
7
|
+
/** Category breakdown (optional) */
|
|
8
|
+
categories?: Record<string, number>;
|
|
9
|
+
}
|
|
10
|
+
export interface BudgetCategory {
|
|
11
|
+
/** Unique identifier */
|
|
12
|
+
id: string;
|
|
13
|
+
/** Display name */
|
|
14
|
+
name: string;
|
|
15
|
+
/** Allocated budget for this category */
|
|
16
|
+
budget: number;
|
|
17
|
+
/** Current spend for this category */
|
|
18
|
+
spent: number;
|
|
19
|
+
/** Custom color */
|
|
20
|
+
color?: string;
|
|
21
|
+
}
|
|
22
|
+
export interface BudgetBurnState {
|
|
23
|
+
/** Total budget amount */
|
|
24
|
+
totalBudget: number;
|
|
25
|
+
/** Total amount spent */
|
|
26
|
+
totalSpent: number;
|
|
27
|
+
/** Budget period start date */
|
|
28
|
+
startDate: Date;
|
|
29
|
+
/** Budget period end date */
|
|
30
|
+
endDate: Date;
|
|
31
|
+
/** Daily spending data */
|
|
32
|
+
spendHistory: SpendDataPoint[];
|
|
33
|
+
/** Budget categories */
|
|
34
|
+
categories: BudgetCategory[];
|
|
35
|
+
/** Current burn rate (spend per day) */
|
|
36
|
+
burnRate: number;
|
|
37
|
+
/** Ideal burn rate to stay on budget */
|
|
38
|
+
idealBurnRate: number;
|
|
39
|
+
/** Projected depletion date */
|
|
40
|
+
depletionDate: Date | null;
|
|
41
|
+
/** Days remaining in period */
|
|
42
|
+
daysRemaining: number;
|
|
43
|
+
/** Time elapsed percentage */
|
|
44
|
+
timeElapsedPercent: number;
|
|
45
|
+
/** Budget used percentage */
|
|
46
|
+
budgetUsedPercent: number;
|
|
47
|
+
/** Danger zone (burn rate is too high) */
|
|
48
|
+
isDangerZone: boolean;
|
|
49
|
+
/** Warning zone (burn rate approaching danger) */
|
|
50
|
+
isWarningZone: boolean;
|
|
51
|
+
}
|
|
52
|
+
export interface WakaBudgetBurnProps {
|
|
53
|
+
/** Total budget amount */
|
|
54
|
+
budget: number;
|
|
55
|
+
/** Budget period start date */
|
|
56
|
+
startDate: Date;
|
|
57
|
+
/** Budget period end date */
|
|
58
|
+
endDate: Date;
|
|
59
|
+
/** Daily spending history */
|
|
60
|
+
spendHistory: SpendDataPoint[];
|
|
61
|
+
/** Budget categories (optional) */
|
|
62
|
+
categories?: BudgetCategory[];
|
|
63
|
+
/** Currency symbol */
|
|
64
|
+
currency?: string;
|
|
65
|
+
/** Danger threshold (percentage over ideal burn rate) */
|
|
66
|
+
dangerThreshold?: number;
|
|
67
|
+
/** Warning threshold (percentage over ideal burn rate) */
|
|
68
|
+
warningThreshold?: number;
|
|
69
|
+
/** Show projected burn line */
|
|
70
|
+
showProjection?: boolean;
|
|
71
|
+
/** Show ideal burn line */
|
|
72
|
+
showIdealLine?: boolean;
|
|
73
|
+
/** Show category breakdown */
|
|
74
|
+
showCategories?: boolean;
|
|
75
|
+
/** Show daily/weekly/monthly trends */
|
|
76
|
+
showTrends?: boolean;
|
|
77
|
+
/** Enable animations */
|
|
78
|
+
animated?: boolean;
|
|
79
|
+
/** Chart height in pixels */
|
|
80
|
+
height?: number;
|
|
81
|
+
/** Custom value formatter */
|
|
82
|
+
formatValue?: (value: number) => string;
|
|
83
|
+
/** Callback when danger zone is entered */
|
|
84
|
+
onDangerZone?: () => void;
|
|
85
|
+
/** Callback when budget is depleted */
|
|
86
|
+
onBudgetDepleted?: () => void;
|
|
87
|
+
/** Additional CSS classes */
|
|
88
|
+
className?: string;
|
|
89
|
+
}
|
|
90
|
+
export declare function WakaBudgetBurn({ budget, startDate, endDate, spendHistory, categories, currency, dangerThreshold, warningThreshold, showProjection, showIdealLine, showCategories, showTrends, animated, height, formatValue: customFormatValue, onDangerZone, onBudgetDepleted, className, }: WakaBudgetBurnProps): import("react/jsx-runtime").JSX.Element;
|
|
91
|
+
export interface UseBudgetBurnOptions {
|
|
92
|
+
/** Total budget amount */
|
|
93
|
+
budget: number;
|
|
94
|
+
/** Budget period start date */
|
|
95
|
+
startDate: Date;
|
|
96
|
+
/** Budget period end date */
|
|
97
|
+
endDate: Date;
|
|
98
|
+
/** Initial spending history */
|
|
99
|
+
initialHistory?: SpendDataPoint[];
|
|
100
|
+
/** Initial categories */
|
|
101
|
+
initialCategories?: BudgetCategory[];
|
|
102
|
+
/** Danger threshold percentage */
|
|
103
|
+
dangerThreshold?: number;
|
|
104
|
+
/** Warning threshold percentage */
|
|
105
|
+
warningThreshold?: number;
|
|
106
|
+
/** Callback when danger zone is entered */
|
|
107
|
+
onDangerZone?: () => void;
|
|
108
|
+
/** Callback when budget is depleted */
|
|
109
|
+
onBudgetDepleted?: () => void;
|
|
110
|
+
}
|
|
111
|
+
export declare function useBudgetBurn({ budget, startDate, endDate, initialHistory, initialCategories, dangerThreshold, warningThreshold, onDangerZone, onBudgetDepleted, }: UseBudgetBurnOptions): {
|
|
112
|
+
spendHistory: SpendDataPoint[];
|
|
113
|
+
categories: BudgetCategory[];
|
|
114
|
+
addSpend: (date: Date, amount: number, categoryBreakdown?: Record<string, number>) => void;
|
|
115
|
+
removeSpend: (date: Date) => void;
|
|
116
|
+
updateCategory: (id: string, updates: Partial<BudgetCategory>) => void;
|
|
117
|
+
addCategory: (category: BudgetCategory) => void;
|
|
118
|
+
removeCategory: (id: string) => void;
|
|
119
|
+
reset: () => void;
|
|
120
|
+
setSpendHistory: React.Dispatch<React.SetStateAction<SpendDataPoint[]>>;
|
|
121
|
+
setCategories: React.Dispatch<React.SetStateAction<BudgetCategory[]>>;
|
|
122
|
+
getForecast: (days: number) => {
|
|
123
|
+
projectedSpend: number;
|
|
124
|
+
projectedRemaining: number;
|
|
125
|
+
projectedPercentUsed: number;
|
|
126
|
+
willDeplete: boolean;
|
|
127
|
+
daysUntilDepletion: number;
|
|
128
|
+
};
|
|
129
|
+
/** Total budget amount */
|
|
130
|
+
totalBudget: number;
|
|
131
|
+
/** Total amount spent */
|
|
132
|
+
totalSpent: number;
|
|
133
|
+
/** Budget period start date */
|
|
134
|
+
startDate: Date;
|
|
135
|
+
/** Budget period end date */
|
|
136
|
+
endDate: Date;
|
|
137
|
+
/** Current burn rate (spend per day) */
|
|
138
|
+
burnRate: number;
|
|
139
|
+
/** Ideal burn rate to stay on budget */
|
|
140
|
+
idealBurnRate: number;
|
|
141
|
+
/** Projected depletion date */
|
|
142
|
+
depletionDate: Date | null;
|
|
143
|
+
/** Days remaining in period */
|
|
144
|
+
daysRemaining: number;
|
|
145
|
+
/** Time elapsed percentage */
|
|
146
|
+
timeElapsedPercent: number;
|
|
147
|
+
/** Budget used percentage */
|
|
148
|
+
budgetUsedPercent: number;
|
|
149
|
+
/** Danger zone (burn rate is too high) */
|
|
150
|
+
isDangerZone: boolean;
|
|
151
|
+
/** Warning zone (burn rate approaching danger) */
|
|
152
|
+
isWarningZone: boolean;
|
|
153
|
+
};
|
|
154
|
+
export default WakaBudgetBurn;
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export type ResourceType = "cpu" | "memory" | "storage" | "network" | "custom";
|
|
3
|
+
export type TimelineRange = "1m" | "3m" | "6m" | "12m";
|
|
4
|
+
export type ThresholdStatus = "safe" | "warning" | "danger" | "critical";
|
|
5
|
+
export interface ResourceData {
|
|
6
|
+
/** Unique identifier for the resource */
|
|
7
|
+
id: string;
|
|
8
|
+
/** Display name of the resource */
|
|
9
|
+
name: string;
|
|
10
|
+
/** Resource type for icon selection */
|
|
11
|
+
type: ResourceType;
|
|
12
|
+
/** Custom icon component (for custom type) */
|
|
13
|
+
customIcon?: React.ComponentType<{
|
|
14
|
+
className?: string;
|
|
15
|
+
}>;
|
|
16
|
+
/** Current usage value */
|
|
17
|
+
current: number;
|
|
18
|
+
/** Total available capacity */
|
|
19
|
+
total: number;
|
|
20
|
+
/** Unit of measurement */
|
|
21
|
+
unit: string;
|
|
22
|
+
/** Historical usage data points */
|
|
23
|
+
history?: number[];
|
|
24
|
+
/** Projected usage at different time ranges */
|
|
25
|
+
projections: {
|
|
26
|
+
"1m": number;
|
|
27
|
+
"3m": number;
|
|
28
|
+
"6m": number;
|
|
29
|
+
"12m"?: number;
|
|
30
|
+
};
|
|
31
|
+
/** Growth rate per month (percentage) */
|
|
32
|
+
growthRate?: number;
|
|
33
|
+
}
|
|
34
|
+
export interface Threshold {
|
|
35
|
+
/** Warning threshold percentage (default: 70) */
|
|
36
|
+
warning: number;
|
|
37
|
+
/** Danger threshold percentage (default: 85) */
|
|
38
|
+
danger: number;
|
|
39
|
+
/** Critical threshold percentage (default: 95) */
|
|
40
|
+
critical: number;
|
|
41
|
+
}
|
|
42
|
+
export interface ScalingRecommendation {
|
|
43
|
+
/** Unique identifier */
|
|
44
|
+
id: string;
|
|
45
|
+
/** Resource this recommendation applies to */
|
|
46
|
+
resourceId: string;
|
|
47
|
+
/** Type of recommendation */
|
|
48
|
+
type: "scale_up" | "scale_out" | "optimize" | "monitor";
|
|
49
|
+
/** Priority level */
|
|
50
|
+
priority: "low" | "medium" | "high" | "urgent";
|
|
51
|
+
/** Short title */
|
|
52
|
+
title: string;
|
|
53
|
+
/** Detailed description */
|
|
54
|
+
description: string;
|
|
55
|
+
/** Suggested action */
|
|
56
|
+
action: string;
|
|
57
|
+
/** Estimated time until action needed */
|
|
58
|
+
timeframe?: string;
|
|
59
|
+
/** Potential cost impact */
|
|
60
|
+
costImpact?: string;
|
|
61
|
+
}
|
|
62
|
+
export interface WakaCapacityPlannerProps {
|
|
63
|
+
/** Array of resources to display */
|
|
64
|
+
resources: ResourceData[];
|
|
65
|
+
/** Threshold configuration */
|
|
66
|
+
thresholds?: Threshold;
|
|
67
|
+
/** Scaling recommendations */
|
|
68
|
+
recommendations?: ScalingRecommendation[];
|
|
69
|
+
/** Initial timeline range */
|
|
70
|
+
initialTimelineRange?: TimelineRange;
|
|
71
|
+
/** Size variant */
|
|
72
|
+
size?: "sm" | "md" | "lg";
|
|
73
|
+
/** Enable animations */
|
|
74
|
+
animated?: boolean;
|
|
75
|
+
/** Show recommendations panel */
|
|
76
|
+
showRecommendations?: boolean;
|
|
77
|
+
/** Show timeline slider */
|
|
78
|
+
showTimeline?: boolean;
|
|
79
|
+
/** Show projection chart */
|
|
80
|
+
showProjectionChart?: boolean;
|
|
81
|
+
/** Callback when timeline range changes */
|
|
82
|
+
onTimelineChange?: (range: TimelineRange) => void;
|
|
83
|
+
/** Callback when resource is clicked */
|
|
84
|
+
onResourceClick?: (resource: ResourceData) => void;
|
|
85
|
+
/** Callback when recommendation action is triggered */
|
|
86
|
+
onRecommendationAction?: (recommendation: ScalingRecommendation) => void;
|
|
87
|
+
/** Additional CSS classes */
|
|
88
|
+
className?: string;
|
|
89
|
+
}
|
|
90
|
+
export interface UseCapacityPlannerOptions {
|
|
91
|
+
/** Initial resources */
|
|
92
|
+
resources: ResourceData[];
|
|
93
|
+
/** Threshold configuration */
|
|
94
|
+
thresholds?: Threshold;
|
|
95
|
+
/** Initial timeline range */
|
|
96
|
+
initialTimelineRange?: TimelineRange;
|
|
97
|
+
}
|
|
98
|
+
export interface UseCapacityPlannerReturn {
|
|
99
|
+
/** Current resources state */
|
|
100
|
+
resources: ResourceData[];
|
|
101
|
+
/** Selected timeline range */
|
|
102
|
+
timelineRange: TimelineRange;
|
|
103
|
+
/** Current thresholds */
|
|
104
|
+
thresholds: Threshold;
|
|
105
|
+
/** Resources at risk (warning or above) */
|
|
106
|
+
resourcesAtRisk: ResourceData[];
|
|
107
|
+
/** Resources in critical state */
|
|
108
|
+
criticalResources: ResourceData[];
|
|
109
|
+
/** Overall health status */
|
|
110
|
+
overallHealth: ThresholdStatus;
|
|
111
|
+
/** Set timeline range */
|
|
112
|
+
setTimelineRange: (range: TimelineRange) => void;
|
|
113
|
+
/** Update a resource */
|
|
114
|
+
updateResource: (id: string, updates: Partial<ResourceData>) => void;
|
|
115
|
+
/** Get projected value for a resource */
|
|
116
|
+
getProjectedValue: (resource: ResourceData) => number;
|
|
117
|
+
/** Get status for a resource */
|
|
118
|
+
getResourceStatus: (resource: ResourceData) => ThresholdStatus;
|
|
119
|
+
/** Get projected status for a resource */
|
|
120
|
+
getProjectedStatus: (resource: ResourceData) => ThresholdStatus;
|
|
121
|
+
/** Calculate time until threshold breach */
|
|
122
|
+
getTimeUntilBreach: (resource: ResourceData, threshold: ThresholdStatus) => string | null;
|
|
123
|
+
/** Set thresholds */
|
|
124
|
+
setThresholds: (thresholds: Threshold) => void;
|
|
125
|
+
/** Add a new resource */
|
|
126
|
+
addResource: (resource: ResourceData) => void;
|
|
127
|
+
/** Remove a resource */
|
|
128
|
+
removeResource: (id: string) => void;
|
|
129
|
+
}
|
|
130
|
+
export declare function useCapacityPlanner({ resources: initialResources, thresholds: initialThresholds, initialTimelineRange, }: UseCapacityPlannerOptions): UseCapacityPlannerReturn;
|
|
131
|
+
export declare function WakaCapacityPlanner({ resources, thresholds, recommendations, initialTimelineRange, size, animated, showRecommendations, showTimeline, showProjectionChart, onTimelineChange, onResourceClick, onRecommendationAction, className, }: WakaCapacityPlannerProps): import("react/jsx-runtime").JSX.Element;
|
|
132
|
+
export default WakaCapacityPlanner;
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export interface CartItem {
|
|
3
|
+
/** Unique identifier for the item */
|
|
4
|
+
id: string;
|
|
5
|
+
/** Product name */
|
|
6
|
+
name: string;
|
|
7
|
+
/** Product description (optional) */
|
|
8
|
+
description?: string;
|
|
9
|
+
/** Product image URL */
|
|
10
|
+
image?: string;
|
|
11
|
+
/** Unit price */
|
|
12
|
+
price: number;
|
|
13
|
+
/** Quantity in cart */
|
|
14
|
+
quantity: number;
|
|
15
|
+
/** Maximum quantity allowed (optional) */
|
|
16
|
+
maxQuantity?: number;
|
|
17
|
+
/** Minimum quantity allowed (default: 1) */
|
|
18
|
+
minQuantity?: number;
|
|
19
|
+
/** Whether the item is in stock */
|
|
20
|
+
inStock?: boolean;
|
|
21
|
+
/** Product variant (e.g., "Red, Large") */
|
|
22
|
+
variant?: string;
|
|
23
|
+
/** Original price before discount */
|
|
24
|
+
originalPrice?: number;
|
|
25
|
+
/** SKU or product code */
|
|
26
|
+
sku?: string;
|
|
27
|
+
/** Additional metadata */
|
|
28
|
+
metadata?: Record<string, unknown>;
|
|
29
|
+
}
|
|
30
|
+
export interface CartDiscount {
|
|
31
|
+
/** Discount code */
|
|
32
|
+
code: string;
|
|
33
|
+
/** Discount type */
|
|
34
|
+
type: "percentage" | "fixed" | "shipping";
|
|
35
|
+
/** Discount value (percentage or fixed amount) */
|
|
36
|
+
value: number;
|
|
37
|
+
/** Minimum order amount for discount to apply */
|
|
38
|
+
minOrderAmount?: number;
|
|
39
|
+
/** Description of the discount */
|
|
40
|
+
description?: string;
|
|
41
|
+
}
|
|
42
|
+
export interface CartTotals {
|
|
43
|
+
/** Subtotal before taxes, shipping, and discounts */
|
|
44
|
+
subtotal: number;
|
|
45
|
+
/** Tax amount */
|
|
46
|
+
tax: number;
|
|
47
|
+
/** Tax rate (percentage) */
|
|
48
|
+
taxRate: number;
|
|
49
|
+
/** Shipping cost */
|
|
50
|
+
shipping: number;
|
|
51
|
+
/** Total discount amount */
|
|
52
|
+
discount: number;
|
|
53
|
+
/** Grand total */
|
|
54
|
+
total: number;
|
|
55
|
+
}
|
|
56
|
+
export interface WakaCartSummaryProps {
|
|
57
|
+
/** Cart items */
|
|
58
|
+
items: CartItem[];
|
|
59
|
+
/** Currency code (default: "USD") */
|
|
60
|
+
currency?: string;
|
|
61
|
+
/** Tax rate as decimal (e.g., 0.08 for 8%) */
|
|
62
|
+
taxRate?: number;
|
|
63
|
+
/** Shipping cost */
|
|
64
|
+
shippingCost?: number;
|
|
65
|
+
/** Free shipping threshold (amount) */
|
|
66
|
+
freeShippingThreshold?: number;
|
|
67
|
+
/** Applied discount/coupon */
|
|
68
|
+
discount?: CartDiscount | null;
|
|
69
|
+
/** Loading state */
|
|
70
|
+
isLoading?: boolean;
|
|
71
|
+
/** Show item images */
|
|
72
|
+
showImages?: boolean;
|
|
73
|
+
/** Show item descriptions */
|
|
74
|
+
showDescriptions?: boolean;
|
|
75
|
+
/** Show SKU/product codes */
|
|
76
|
+
showSku?: boolean;
|
|
77
|
+
/** Enable quantity editing */
|
|
78
|
+
enableQuantityEdit?: boolean;
|
|
79
|
+
/** Enable item removal */
|
|
80
|
+
enableRemove?: boolean;
|
|
81
|
+
/** Custom empty state */
|
|
82
|
+
emptyState?: React.ReactNode;
|
|
83
|
+
/** Custom loading state */
|
|
84
|
+
loadingState?: React.ReactNode;
|
|
85
|
+
/** Header content */
|
|
86
|
+
header?: React.ReactNode;
|
|
87
|
+
/** Footer content (e.g., checkout button) */
|
|
88
|
+
footer?: React.ReactNode;
|
|
89
|
+
/** Additional CSS classes */
|
|
90
|
+
className?: string;
|
|
91
|
+
/** Item container CSS classes */
|
|
92
|
+
itemClassName?: string;
|
|
93
|
+
/** Summary section CSS classes */
|
|
94
|
+
summaryClassName?: string;
|
|
95
|
+
/** Callback when item quantity changes */
|
|
96
|
+
onQuantityChange?: (itemId: string, quantity: number) => void;
|
|
97
|
+
/** Callback when item is removed */
|
|
98
|
+
onRemoveItem?: (itemId: string) => void;
|
|
99
|
+
/** Callback when discount is applied */
|
|
100
|
+
onApplyDiscount?: (code: string) => Promise<CartDiscount | null>;
|
|
101
|
+
/** Callback when discount is removed */
|
|
102
|
+
onRemoveDiscount?: () => void;
|
|
103
|
+
/** Callback for checkout action */
|
|
104
|
+
onCheckout?: (totals: CartTotals) => void;
|
|
105
|
+
/** Custom price formatter */
|
|
106
|
+
formatPrice?: (price: number, currency: string) => string;
|
|
107
|
+
/** Animation duration in ms */
|
|
108
|
+
animationDuration?: number;
|
|
109
|
+
/** Accessibility label */
|
|
110
|
+
ariaLabel?: string;
|
|
111
|
+
}
|
|
112
|
+
export declare const WakaCartSummary: React.FC<WakaCartSummaryProps>;
|
|
113
|
+
export interface UseCartSummaryOptions {
|
|
114
|
+
/** Initial cart items */
|
|
115
|
+
initialItems?: CartItem[];
|
|
116
|
+
/** Currency code */
|
|
117
|
+
currency?: string;
|
|
118
|
+
/** Tax rate */
|
|
119
|
+
taxRate?: number;
|
|
120
|
+
/** Shipping cost */
|
|
121
|
+
shippingCost?: number;
|
|
122
|
+
/** Free shipping threshold */
|
|
123
|
+
freeShippingThreshold?: number;
|
|
124
|
+
/** Callback when cart changes */
|
|
125
|
+
onCartChange?: (items: CartItem[]) => void;
|
|
126
|
+
}
|
|
127
|
+
export interface UseCartSummaryReturn {
|
|
128
|
+
/** Current cart items */
|
|
129
|
+
items: CartItem[];
|
|
130
|
+
/** Applied discount */
|
|
131
|
+
discount: CartDiscount | null;
|
|
132
|
+
/** Cart totals */
|
|
133
|
+
totals: CartTotals;
|
|
134
|
+
/** Total item count */
|
|
135
|
+
itemCount: number;
|
|
136
|
+
/** Whether the cart is empty */
|
|
137
|
+
isEmpty: boolean;
|
|
138
|
+
/** Add item to cart */
|
|
139
|
+
addItem: (item: CartItem) => void;
|
|
140
|
+
/** Remove item from cart */
|
|
141
|
+
removeItem: (itemId: string) => void;
|
|
142
|
+
/** Update item quantity */
|
|
143
|
+
updateQuantity: (itemId: string, quantity: number) => void;
|
|
144
|
+
/** Clear all items */
|
|
145
|
+
clearCart: () => void;
|
|
146
|
+
/** Apply discount code */
|
|
147
|
+
applyDiscount: (discount: CartDiscount) => void;
|
|
148
|
+
/** Remove discount */
|
|
149
|
+
removeDiscount: () => void;
|
|
150
|
+
/** Set items directly */
|
|
151
|
+
setItems: (items: CartItem[]) => void;
|
|
152
|
+
}
|
|
153
|
+
export declare function useCartSummary(options?: UseCartSummaryOptions): UseCartSummaryReturn;
|
|
154
|
+
export default WakaCartSummary;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export interface ChallengeTask {
|
|
3
|
+
/** Unique identifier */
|
|
4
|
+
id: string;
|
|
5
|
+
/** Task description */
|
|
6
|
+
text: string;
|
|
7
|
+
/** Whether the task is completed */
|
|
8
|
+
completed: boolean;
|
|
9
|
+
/** Current progress value (for countable tasks) */
|
|
10
|
+
current?: number;
|
|
11
|
+
/** Target value (for countable tasks) */
|
|
12
|
+
target?: number;
|
|
13
|
+
}
|
|
14
|
+
export interface ChallengeReward {
|
|
15
|
+
/** Type of reward */
|
|
16
|
+
type: "xp" | "badge" | "item" | "currency" | "custom";
|
|
17
|
+
/** Reward label */
|
|
18
|
+
label: string;
|
|
19
|
+
/** Reward value */
|
|
20
|
+
value: number | string;
|
|
21
|
+
/** Custom icon */
|
|
22
|
+
icon?: React.ReactNode;
|
|
23
|
+
}
|
|
24
|
+
export interface Challenge {
|
|
25
|
+
/** Unique identifier */
|
|
26
|
+
id: string;
|
|
27
|
+
/** Challenge name */
|
|
28
|
+
name: string;
|
|
29
|
+
/** Challenge description */
|
|
30
|
+
description?: string;
|
|
31
|
+
/** End date/time */
|
|
32
|
+
endTime: Date;
|
|
33
|
+
/** Start date/time (for personal challenges) */
|
|
34
|
+
startTime?: Date;
|
|
35
|
+
/** Tasks to complete (optional) */
|
|
36
|
+
tasks?: ChallengeTask[];
|
|
37
|
+
/** Rewards for completion */
|
|
38
|
+
rewards?: ChallengeReward[];
|
|
39
|
+
/** Whether this is a personal (pausable) challenge */
|
|
40
|
+
isPersonal?: boolean;
|
|
41
|
+
/** Challenge category/type */
|
|
42
|
+
category?: "daily" | "weekly" | "event" | "personal" | "competition";
|
|
43
|
+
}
|
|
44
|
+
export interface WakaChallengeTimerProps {
|
|
45
|
+
/** Challenge data */
|
|
46
|
+
challenge: Challenge;
|
|
47
|
+
/** Size variant */
|
|
48
|
+
size?: "compact" | "default" | "large";
|
|
49
|
+
/** Callback when timer reaches zero */
|
|
50
|
+
onComplete?: (challengeId: string) => void;
|
|
51
|
+
/** Callback when timer enters urgent mode (< threshold remaining) */
|
|
52
|
+
onUrgent?: (challengeId: string) => void;
|
|
53
|
+
/** Callback when pausing (for personal challenges) */
|
|
54
|
+
onPause?: (challengeId: string) => void;
|
|
55
|
+
/** Callback when starting/resuming (for personal challenges) */
|
|
56
|
+
onStart?: (challengeId: string) => void;
|
|
57
|
+
/** Callback when task is clicked */
|
|
58
|
+
onTaskClick?: (challengeId: string, taskId: string) => void;
|
|
59
|
+
/** Whether the timer is paused (for personal challenges) */
|
|
60
|
+
isPaused?: boolean;
|
|
61
|
+
/** Threshold in seconds for urgent animation (default: 3600 = 1 hour) */
|
|
62
|
+
urgentThreshold?: number;
|
|
63
|
+
/** Custom className */
|
|
64
|
+
className?: string;
|
|
65
|
+
}
|
|
66
|
+
export interface TimeRemaining {
|
|
67
|
+
days: number;
|
|
68
|
+
hours: number;
|
|
69
|
+
minutes: number;
|
|
70
|
+
seconds: number;
|
|
71
|
+
totalSeconds: number;
|
|
72
|
+
isExpired: boolean;
|
|
73
|
+
isUrgent: boolean;
|
|
74
|
+
}
|
|
75
|
+
export interface UseChallengeTimerOptions {
|
|
76
|
+
endTime: Date;
|
|
77
|
+
isPaused?: boolean;
|
|
78
|
+
urgentThreshold?: number;
|
|
79
|
+
onComplete?: () => void;
|
|
80
|
+
onUrgent?: () => void;
|
|
81
|
+
}
|
|
82
|
+
export declare function useChallengeTimer({ endTime, isPaused, urgentThreshold, onComplete, onUrgent, }: UseChallengeTimerOptions): TimeRemaining;
|
|
83
|
+
export declare function WakaChallengeTimer({ challenge, size, onComplete, onUrgent, onPause, onStart, onTaskClick, isPaused, urgentThreshold, className, }: WakaChallengeTimerProps): import("react/jsx-runtime").JSX.Element;
|
|
84
|
+
export declare function WakaChallengeTimerSkeleton({ size }: {
|
|
85
|
+
size?: "compact" | "default" | "large";
|
|
86
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
export type MessageStatus = "sending" | "sent" | "delivered" | "read" | "failed";
|
|
4
|
+
export type ReadReceiptStatus = "sent" | "delivered" | "read";
|
|
5
|
+
export interface MessageReaction {
|
|
6
|
+
emoji: string;
|
|
7
|
+
count: number;
|
|
8
|
+
users: string[];
|
|
9
|
+
reacted: boolean;
|
|
10
|
+
}
|
|
11
|
+
export interface MessageAttachment {
|
|
12
|
+
id: string;
|
|
13
|
+
type: "image" | "file" | "video" | "audio";
|
|
14
|
+
url: string;
|
|
15
|
+
name: string;
|
|
16
|
+
size?: number;
|
|
17
|
+
mimeType?: string;
|
|
18
|
+
thumbnail?: string;
|
|
19
|
+
width?: number;
|
|
20
|
+
height?: number;
|
|
21
|
+
}
|
|
22
|
+
export interface LinkPreview {
|
|
23
|
+
url: string;
|
|
24
|
+
title: string;
|
|
25
|
+
description?: string;
|
|
26
|
+
image?: string;
|
|
27
|
+
favicon?: string;
|
|
28
|
+
siteName?: string;
|
|
29
|
+
}
|
|
30
|
+
export interface MessageThread {
|
|
31
|
+
count: number;
|
|
32
|
+
lastReply?: string;
|
|
33
|
+
participants: Array<{
|
|
34
|
+
id: string;
|
|
35
|
+
name: string;
|
|
36
|
+
avatar?: string;
|
|
37
|
+
}>;
|
|
38
|
+
}
|
|
39
|
+
export interface ChatUser {
|
|
40
|
+
id: string;
|
|
41
|
+
name: string;
|
|
42
|
+
avatar?: string;
|
|
43
|
+
initials?: string;
|
|
44
|
+
}
|
|
45
|
+
export interface WakaChatBubbleProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof bubbleVariants> {
|
|
46
|
+
/** The message content */
|
|
47
|
+
message: string;
|
|
48
|
+
/** Whether the message was sent by the current user */
|
|
49
|
+
isSent?: boolean;
|
|
50
|
+
/** User who sent the message */
|
|
51
|
+
sender?: ChatUser;
|
|
52
|
+
/** Show avatar */
|
|
53
|
+
showAvatar?: boolean;
|
|
54
|
+
/** Message timestamp */
|
|
55
|
+
timestamp?: Date | string;
|
|
56
|
+
/** Format for timestamp display */
|
|
57
|
+
timestampFormat?: "time" | "datetime" | "relative";
|
|
58
|
+
/** Message status */
|
|
59
|
+
status?: MessageStatus;
|
|
60
|
+
/** Read receipt status (for sent messages) */
|
|
61
|
+
readReceipt?: ReadReceiptStatus;
|
|
62
|
+
/** Reactions on the message */
|
|
63
|
+
reactions?: MessageReaction[];
|
|
64
|
+
/** Thread/reply info */
|
|
65
|
+
thread?: MessageThread;
|
|
66
|
+
/** Whether the message was edited */
|
|
67
|
+
isEdited?: boolean;
|
|
68
|
+
/** Attachments */
|
|
69
|
+
attachments?: MessageAttachment[];
|
|
70
|
+
/** Link preview */
|
|
71
|
+
linkPreview?: LinkPreview;
|
|
72
|
+
/** Enable markdown rendering */
|
|
73
|
+
markdown?: boolean;
|
|
74
|
+
/** Called when reaction is added */
|
|
75
|
+
onAddReaction?: (emoji: string) => void;
|
|
76
|
+
/** Called when existing reaction is toggled */
|
|
77
|
+
onToggleReaction?: (emoji: string) => void;
|
|
78
|
+
/** Called when reply button is clicked */
|
|
79
|
+
onReply?: () => void;
|
|
80
|
+
/** Called when edit is requested */
|
|
81
|
+
onEdit?: () => void;
|
|
82
|
+
/** Called when delete is requested */
|
|
83
|
+
onDelete?: () => void;
|
|
84
|
+
/** Called when retry is requested (for failed messages) */
|
|
85
|
+
onRetry?: () => void;
|
|
86
|
+
/** Called when thread is clicked */
|
|
87
|
+
onThreadClick?: () => void;
|
|
88
|
+
/** Called when attachment is clicked */
|
|
89
|
+
onAttachmentClick?: (attachment: MessageAttachment) => void;
|
|
90
|
+
/** Called when link preview is clicked */
|
|
91
|
+
onLinkPreviewClick?: (url: string) => void;
|
|
92
|
+
/** Show action menu */
|
|
93
|
+
showActions?: boolean;
|
|
94
|
+
/** Emoji picker content (render prop) */
|
|
95
|
+
emojiPicker?: (onSelect: (emoji: string) => void) => React.ReactNode;
|
|
96
|
+
/** Quick reaction emojis */
|
|
97
|
+
quickReactions?: string[];
|
|
98
|
+
/** Custom timestamp renderer */
|
|
99
|
+
renderTimestamp?: (timestamp: Date | string) => React.ReactNode;
|
|
100
|
+
/** Maximum width of the bubble */
|
|
101
|
+
maxWidth?: string | number;
|
|
102
|
+
}
|
|
103
|
+
declare const bubbleVariants: (props?: ({
|
|
104
|
+
variant?: "default" | "minimal" | "elevated" | null | undefined;
|
|
105
|
+
isSent?: boolean | null | undefined;
|
|
106
|
+
} & import('class-variance-authority/dist/types').ClassProp) | undefined) => string;
|
|
107
|
+
export declare const WakaChatBubble: React.ForwardRefExoticComponent<WakaChatBubbleProps & React.RefAttributes<HTMLDivElement>>;
|
|
108
|
+
export interface WakaChatTypingIndicatorProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
109
|
+
/** Users currently typing */
|
|
110
|
+
users?: ChatUser[];
|
|
111
|
+
/** Show avatar */
|
|
112
|
+
showAvatar?: boolean;
|
|
113
|
+
}
|
|
114
|
+
export declare function WakaChatTypingIndicator({ users, showAvatar, className, ...props }: WakaChatTypingIndicatorProps): import("react/jsx-runtime").JSX.Element | null;
|
|
115
|
+
export interface WakaChatDateSeparatorProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
116
|
+
/** Date to display */
|
|
117
|
+
date: Date | string;
|
|
118
|
+
}
|
|
119
|
+
export declare function WakaChatDateSeparator({ date, className, ...props }: WakaChatDateSeparatorProps): import("react/jsx-runtime").JSX.Element;
|
|
120
|
+
export interface WakaChatSystemMessageProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
121
|
+
/** System message text */
|
|
122
|
+
message: string;
|
|
123
|
+
/** Icon to display */
|
|
124
|
+
icon?: React.ReactNode;
|
|
125
|
+
}
|
|
126
|
+
export declare function WakaChatSystemMessage({ message, icon, className, ...props }: WakaChatSystemMessageProps): import("react/jsx-runtime").JSX.Element;
|
|
127
|
+
export {};
|