@wakastellar/ui 2.4.0 → 3.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.
Files changed (173) hide show
  1. package/dist/blocks/antivirus-dashboard/index.d.ts +44 -0
  2. package/dist/blocks/clamav-service-status/index.d.ts +35 -0
  3. package/dist/blocks/file-scan-uploader/index.d.ts +29 -0
  4. package/dist/blocks/index.d.ts +18 -9
  5. package/dist/blocks/quarantine-manager/index.d.ts +27 -0
  6. package/dist/blocks/scan-history-log/index.d.ts +28 -0
  7. package/dist/blocks/scan-policy-editor/index.d.ts +27 -0
  8. package/dist/blocks/scan-report-generator/index.d.ts +47 -0
  9. package/dist/blocks/signature-database-manager/index.d.ts +39 -0
  10. package/dist/blocks/threat-alert-banner/index.d.ts +26 -0
  11. package/dist/components/index.d.ts +4 -4
  12. package/dist/components/waka-signature-pad/index.d.ts +1 -1
  13. package/dist/exceljs.min-BcLLX0PC.js +29 -0
  14. package/dist/exceljs.min-KOayaaQ4.mjs +23013 -0
  15. package/dist/export.cjs.js +1 -1
  16. package/dist/export.d.ts +2 -2
  17. package/dist/export.es.js +1 -1
  18. package/dist/index.cjs.js +136 -136
  19. package/dist/index.es.js +29978 -27215
  20. package/dist/stories/Button.stories.d.ts +1 -1
  21. package/dist/stories/Header.stories.d.ts +1 -1
  22. package/dist/stories/Page.stories.d.ts +1 -1
  23. package/dist/useDataTableImport-COVnvslz.js +9 -0
  24. package/dist/useDataTableImport-DAlxBY8w.mjs +237 -0
  25. package/dist/utils/index.d.ts +1 -0
  26. package/dist/utils/logger.d.ts +9 -0
  27. package/package.json +6 -5
  28. package/src/blocks/antivirus-dashboard/AntivirusDashboard.stories.tsx +291 -0
  29. package/src/blocks/antivirus-dashboard/index.tsx +525 -0
  30. package/src/blocks/clamav-service-status/ClamAVServiceStatus.stories.tsx +195 -0
  31. package/src/blocks/clamav-service-status/index.tsx +370 -0
  32. package/src/blocks/file-scan-uploader/FileScanUploader.stories.tsx +257 -0
  33. package/src/blocks/file-scan-uploader/index.tsx +311 -0
  34. package/src/blocks/index.ts +163 -11
  35. package/src/blocks/quarantine-manager/QuarantineManager.stories.tsx +209 -0
  36. package/src/blocks/quarantine-manager/index.tsx +435 -0
  37. package/src/blocks/scan-history-log/ScanHistoryLog.stories.tsx +231 -0
  38. package/src/blocks/scan-history-log/index.tsx +406 -0
  39. package/src/blocks/scan-policy-editor/ScanPolicyEditor.stories.tsx +106 -0
  40. package/src/blocks/scan-policy-editor/index.tsx +418 -0
  41. package/src/blocks/scan-report-generator/ScanReportGenerator.stories.tsx +232 -0
  42. package/src/blocks/scan-report-generator/index.tsx +612 -0
  43. package/src/blocks/sidebar/index.tsx +2 -1
  44. package/src/blocks/signature-database-manager/SignatureDatabaseManager.stories.tsx +279 -0
  45. package/src/blocks/signature-database-manager/index.tsx +470 -0
  46. package/src/blocks/theme-creator-block/index.tsx +16 -2
  47. package/src/blocks/threat-alert-banner/ThreatAlertBanner.stories.tsx +152 -0
  48. package/src/blocks/threat-alert-banner/index.tsx +320 -0
  49. package/src/components/DataTable/DataTable.stories.tsx +203 -0
  50. package/src/components/DataTable/hooks/useDataTableExport.ts +38 -31
  51. package/src/components/DataTable/hooks/useDataTableImport.ts +31 -20
  52. package/src/components/error-boundary/ErrorBoundary.stories.tsx +125 -0
  53. package/src/components/index.ts +45 -4
  54. package/src/components/language-selector/LanguageSelector.stories.tsx +112 -0
  55. package/src/components/theme-selector/ThemeSelector.stories.tsx +77 -0
  56. package/src/components/toaster/Toaster.stories.tsx +67 -0
  57. package/src/components/waka-activity-feed/WakaActivityFeed.stories.tsx +116 -0
  58. package/src/components/waka-ad-banner/WakaAdBanner.stories.tsx +102 -0
  59. package/src/components/waka-ad-fallback/WakaAdFallback.stories.tsx +117 -0
  60. package/src/components/waka-ad-inline/WakaAdInline.stories.tsx +105 -0
  61. package/src/components/waka-ad-interstitial/WakaAdInterstitial.stories.tsx +92 -0
  62. package/src/components/waka-ad-placeholder/WakaAdPlaceholder.stories.tsx +89 -0
  63. package/src/components/waka-ad-provider/WakaAdProvider.stories.tsx +110 -0
  64. package/src/components/waka-ad-sidebar/WakaAdSidebar.stories.tsx +89 -0
  65. package/src/components/waka-ad-sidebar/index.tsx +3 -2
  66. package/src/components/waka-ad-sticky-footer/WakaAdStickyFooter.stories.tsx +88 -0
  67. package/src/components/waka-address-autocomplete/WakaAddressAutocomplete.stories.tsx +46 -0
  68. package/src/components/waka-admincrumb/WakaAdmincrumb.stories.tsx +166 -0
  69. package/src/components/waka-alert-panel/WakaAlertPanel.stories.tsx +45 -0
  70. package/src/components/waka-alert-stack/WakaAlertStack.stories.tsx +62 -0
  71. package/src/components/waka-allocation-matrix/WakaAllocationMatrix.stories.tsx +68 -0
  72. package/src/components/waka-approval-chain/WakaApprovalChain.stories.tsx +63 -0
  73. package/src/components/waka-audit-log/WakaAuditLog.stories.tsx +73 -0
  74. package/src/components/waka-autocomplete/WakaAutocomplete.stories.tsx +132 -172
  75. package/src/components/waka-biometric-prompt/WakaBiometricPrompt.stories.tsx +48 -0
  76. package/src/components/waka-breadcrumb/WakaBreadcrumb.stories.tsx +74 -191
  77. package/src/components/waka-breadcrumb-path/WakaBreadcrumbPath.stories.tsx +40 -0
  78. package/src/components/waka-budget-burn/WakaBudgetBurn.stories.tsx +86 -0
  79. package/src/components/waka-capacity-planner/WakaCapacityPlanner.stories.tsx +273 -0
  80. package/src/components/waka-cart-summary/WakaCartSummary.stories.tsx +176 -0
  81. package/src/components/waka-cart-summary/index.tsx +19 -10
  82. package/src/components/waka-challenge-timer/WakaChallengeTimer.stories.tsx +98 -0
  83. package/src/components/waka-chat-bubble/WakaChatBubble.stories.tsx +118 -0
  84. package/src/components/waka-checklist/WakaChecklist.stories.tsx +71 -0
  85. package/src/components/waka-checkout-stepper/WakaCheckoutStepper.stories.tsx +102 -0
  86. package/src/components/waka-cohort-table/WakaCohortTable.stories.tsx +56 -0
  87. package/src/components/waka-color-picker/WakaColorPicker.stories.tsx +99 -155
  88. package/src/components/waka-combo-counter/WakaComboCounter.stories.tsx +128 -0
  89. package/src/components/waka-command-bar/WakaCommandBar.stories.tsx +45 -0
  90. package/src/components/waka-compare-period/WakaComparePeriod.stories.tsx +76 -0
  91. package/src/components/waka-config-comparator/WakaConfigComparator.stories.tsx +143 -0
  92. package/src/components/waka-connection-matrix/WakaConnectionMatrix.stories.tsx +52 -0
  93. package/src/components/waka-content-recommendation/WakaContentRecommendation.stories.tsx +41 -0
  94. package/src/components/waka-coupon-input/WakaCouponInput.stories.tsx +126 -0
  95. package/src/components/waka-credit-card-input/WakaCreditCardInput.stories.tsx +120 -0
  96. package/src/components/waka-datetime-picker.form-integration/WakaDateTimePickerForm.stories.tsx +79 -0
  97. package/src/components/waka-dependency-tree/WakaDependencyTree.stories.tsx +72 -0
  98. package/src/components/waka-device-trust/WakaDeviceTrust.stories.tsx +109 -0
  99. package/src/components/waka-empty-state/WakaEmptyState.stories.tsx +87 -0
  100. package/src/components/waka-feature-announcement/WakaFeatureAnnouncement.stories.tsx +47 -0
  101. package/src/components/waka-feature-flag-row/WakaFeatureFlagRow.stories.tsx +188 -0
  102. package/src/components/waka-file-upload/WakaFileUpload.stories.tsx +118 -174
  103. package/src/components/waka-floating-nav/WakaFloatingNav.stories.tsx +53 -0
  104. package/src/components/waka-goal-progress/WakaGoalProgress.stories.tsx +137 -0
  105. package/src/components/waka-hotspot/WakaHotspot.stories.tsx +56 -0
  106. package/src/components/waka-invoice-preview/WakaInvoicePreview.stories.tsx +169 -0
  107. package/src/components/waka-kpi-dashboard/WakaKpiDashboard.stories.tsx +46 -0
  108. package/src/components/waka-level-progress/WakaLevelProgress.stories.tsx +94 -75
  109. package/src/components/waka-liquid-button/WakaLiquidButton.stories.tsx +45 -0
  110. package/src/components/waka-magic-link/WakaMagicLink.stories.tsx +61 -0
  111. package/src/components/waka-magnetic-button/WakaMagneticButton.stories.tsx +40 -0
  112. package/src/components/waka-mention-input/WakaMentionInput.stories.tsx +140 -0
  113. package/src/components/waka-milestone-road/WakaMilestoneRoad.stories.tsx +143 -0
  114. package/src/components/waka-orbital-menu/WakaOrbitalMenu.stories.tsx +54 -0
  115. package/src/components/waka-order-tracker/WakaOrderTracker.stories.tsx +163 -0
  116. package/src/components/waka-outstream-video/WakaOutstreamVideo.stories.tsx +94 -0
  117. package/src/components/waka-pagination/WakaPagination.stories.tsx +110 -280
  118. package/src/components/waka-password-strength/WakaPasswordStrength.stories.tsx +132 -268
  119. package/src/components/waka-payment-method-picker/WakaPaymentMethodPicker.stories.tsx +141 -0
  120. package/src/components/waka-permission-matrix/WakaPermissionMatrix.stories.tsx +124 -0
  121. package/src/components/waka-phone-input/WakaPhoneInput.stories.tsx +56 -0
  122. package/src/components/waka-points-popup/WakaPointsPopup.stories.tsx +96 -0
  123. package/src/components/waka-power-up/WakaPowerUp.stories.tsx +121 -0
  124. package/src/components/waka-presence-indicator/WakaPresenceIndicator.stories.tsx +49 -0
  125. package/src/components/waka-pricing-table/WakaPricingTable.stories.tsx +159 -0
  126. package/src/components/waka-product-card/WakaProductCard.stories.tsx +202 -0
  127. package/src/components/waka-progress-onboarding/WakaProgressOnboarding.stories.tsx +57 -0
  128. package/src/components/waka-pull-to-refresh/WakaPullToRefresh.stories.tsx +51 -0
  129. package/src/components/waka-rank-badge/WakaRankBadge.stories.tsx +108 -0
  130. package/src/components/waka-rating-input/WakaRatingInput.stories.tsx +51 -0
  131. package/src/components/waka-reaction-picker/WakaReactionPicker.stories.tsx +52 -0
  132. package/src/components/waka-region-map/WakaRegionMap.stories.tsx +181 -0
  133. package/src/components/waka-resource-pool/WakaResourcePool.stories.tsx +70 -0
  134. package/src/components/waka-rich-text-editor/WakaRichTextEditor.stories.tsx +108 -197
  135. package/src/components/waka-rollback-slider/WakaRollbackSlider.stories.tsx +41 -0
  136. package/src/components/waka-schedule-picker/WakaSchedulePicker.stories.tsx +64 -0
  137. package/src/components/waka-season-pass/WakaSeasonPass.stories.tsx +107 -0
  138. package/src/components/waka-security-scan-result/WakaSecurityScanResult.stories.tsx +146 -0
  139. package/src/components/waka-security-score/WakaSecurityScore.stories.tsx +63 -0
  140. package/src/components/waka-session-manager/WakaSessionManager.stories.tsx +68 -0
  141. package/src/components/waka-signature-pad/WakaSignaturePad.stories.tsx +159 -0
  142. package/src/components/waka-signature-pad/index.tsx +5 -3
  143. package/src/components/waka-sla-tracker/WakaSlaTracker.stories.tsx +65 -0
  144. package/src/components/waka-slider-range/WakaSliderRange.stories.tsx +66 -0
  145. package/src/components/waka-sponsored-badge/WakaSponsoredBadge.stories.tsx +60 -0
  146. package/src/components/waka-sponsored-card/WakaSponsoredCard.stories.tsx +64 -0
  147. package/src/components/waka-sponsored-feed/WakaSponsoredFeed.stories.tsx +58 -0
  148. package/src/components/waka-spotlight/WakaSpotlight.stories.tsx +53 -0
  149. package/src/components/waka-stats-hexagon/WakaStatsHexagon.stories.tsx +161 -0
  150. package/src/components/waka-stepper/WakaStepper.stories.tsx +137 -410
  151. package/src/components/waka-swipe-card/WakaSwipeCard.stories.tsx +51 -0
  152. package/src/components/waka-tag-input/WakaTagInput.stories.tsx +224 -0
  153. package/src/components/waka-team-banner/WakaTeamBanner.stories.tsx +50 -0
  154. package/src/components/waka-theme-creator/WakaThemeCreator.stories.tsx +58 -0
  155. package/src/components/waka-theme-manager/WakaThemeManager.stories.tsx +298 -0
  156. package/src/components/waka-theme-manager/index.tsx +6 -11
  157. package/src/components/waka-thread-view/WakaThreadView.stories.tsx +143 -0
  158. package/src/components/waka-timeline/WakaTimeline.stories.tsx +171 -324
  159. package/src/components/waka-tooltip-tour/WakaTooltipTour.stories.tsx +92 -0
  160. package/src/components/waka-tour-guide/WakaTourGuide.stories.tsx +89 -0
  161. package/src/components/waka-treemap-chart/WakaTreemapChart.stories.tsx +234 -129
  162. package/src/components/waka-treemap-chart/index.tsx +2 -2
  163. package/src/components/waka-two-factor-setup/WakaTwoFactorSetup.stories.tsx +142 -0
  164. package/src/components/waka-typing-indicator/WakaTypingIndicator.stories.tsx +134 -0
  165. package/src/components/waka-video-ad/WakaVideoAd.stories.tsx +138 -0
  166. package/src/components/waka-video-call/WakaVideoCall.stories.tsx +186 -0
  167. package/src/components/waka-video-overlay/WakaVideoOverlay.stories.tsx +100 -0
  168. package/src/components/waka-voice-message/WakaVoiceMessage.stories.tsx +190 -0
  169. package/src/components/waka-welcome-modal/WakaWelcomeModal.stories.tsx +87 -0
  170. package/src/components/waka-xp-bar/WakaXPBar.stories.tsx +29 -29
  171. package/dist/useDataTableImport-D8R2HQl6.mjs +0 -229
  172. package/dist/useDataTableImport-S_hhA5Wo.js +0 -9
  173. package/src/components/DataTable/README.md +0 -446
@@ -0,0 +1,117 @@
1
+ import type { Meta, StoryObj } from "@storybook/react"
2
+ import { WakaAdFallback } from "./index"
3
+ import { WakaAdProvider } from "../waka-ad-provider"
4
+
5
+ const mockAdConfig = {
6
+ network: "custom" as const,
7
+ testMode: true,
8
+ }
9
+
10
+ const meta: Meta<typeof WakaAdFallback> = {
11
+ title: "Components/Ads/WakaAdFallback",
12
+ component: WakaAdFallback,
13
+ parameters: {
14
+ layout: "centered",
15
+ },
16
+ tags: ["autodocs"],
17
+ decorators: [
18
+ (Story) => (
19
+ <WakaAdProvider config={mockAdConfig}>
20
+ <Story />
21
+ </WakaAdProvider>
22
+ ),
23
+ ],
24
+ argTypes: {
25
+ variant: {
26
+ control: "select",
27
+ options: ["house", "empty", "custom"],
28
+ description: "Fallback variant style",
29
+ },
30
+ size: {
31
+ control: "select",
32
+ options: ["leaderboard", "rectangle", "skyscraper", "billboard", "mobile-banner"],
33
+ description: "Ad size preset",
34
+ },
35
+ title: {
36
+ control: "text",
37
+ description: "Title text",
38
+ },
39
+ description: {
40
+ control: "text",
41
+ description: "Description text",
42
+ },
43
+ ctaText: {
44
+ control: "text",
45
+ description: "Call to action button text",
46
+ },
47
+ showBorder: {
48
+ control: "boolean",
49
+ description: "Show border around fallback",
50
+ },
51
+ },
52
+ }
53
+
54
+ export default meta
55
+ type Story = StoryObj<typeof WakaAdFallback>
56
+
57
+ export const House: Story = {
58
+ args: {
59
+ variant: "house",
60
+ size: "rectangle",
61
+ title: "Your Ad Here",
62
+ description: "Advertise with us",
63
+ ctaText: "Learn More",
64
+ showBorder: true,
65
+ },
66
+ render: (args) => <WakaAdFallback {...args} />,
67
+ }
68
+
69
+ export const Empty: Story = {
70
+ args: {
71
+ variant: "empty",
72
+ size: "rectangle",
73
+ showBorder: true,
74
+ },
75
+ render: (args) => <WakaAdFallback {...args} />,
76
+ }
77
+
78
+ export const WithImage: Story = {
79
+ args: {
80
+ variant: "house",
81
+ size: "rectangle",
82
+ title: "Premium Subscription",
83
+ description: "Get access to all features",
84
+ ctaText: "Subscribe Now",
85
+ imageUrl: "https://picsum.photos/300/250",
86
+ showBorder: false,
87
+ },
88
+ render: (args) => <WakaAdFallback {...args} />,
89
+ }
90
+
91
+ export const Leaderboard: Story = {
92
+ args: {
93
+ variant: "house",
94
+ size: "leaderboard",
95
+ title: "Promote Your Brand",
96
+ description: "Reach millions of users",
97
+ ctaText: "Start Advertising",
98
+ },
99
+ render: (args) => <WakaAdFallback {...args} />,
100
+ }
101
+
102
+ export const CustomContent: Story = {
103
+ args: {
104
+ variant: "custom",
105
+ size: "rectangle",
106
+ children: (
107
+ <div className="flex items-center justify-center h-full bg-gradient-to-br from-purple-500 to-pink-500 text-white p-4">
108
+ <div className="text-center">
109
+ <h3 className="font-bold text-lg">Custom Fallback</h3>
110
+ <p className="text-sm opacity-80">Your custom content here</p>
111
+ </div>
112
+ </div>
113
+ ),
114
+ },
115
+ render: (args) => <WakaAdFallback {...args} />,
116
+ }
117
+
@@ -0,0 +1,105 @@
1
+ import type { Meta, StoryObj } from "@storybook/react"
2
+ import { WakaAdInline } from "./index"
3
+ import { WakaAdProvider } from "../waka-ad-provider"
4
+
5
+ const mockAdConfig = {
6
+ network: "custom" as const,
7
+ testMode: true,
8
+ debugMode: true,
9
+ }
10
+
11
+ const meta: Meta<typeof WakaAdInline> = {
12
+ title: "Components/Ads/WakaAdInline",
13
+ component: WakaAdInline,
14
+ parameters: {
15
+ layout: "padded",
16
+ },
17
+ tags: ["autodocs"],
18
+ decorators: [
19
+ (Story) => (
20
+ <WakaAdProvider config={mockAdConfig}>
21
+ <div className="max-w-4xl mx-auto">
22
+ <p className="mb-4 text-muted-foreground">
23
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
24
+ </p>
25
+ <Story />
26
+ <p className="mt-4 text-muted-foreground">
27
+ Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
28
+ </p>
29
+ </div>
30
+ </WakaAdProvider>
31
+ ),
32
+ ],
33
+ argTypes: {
34
+ size: {
35
+ control: "select",
36
+ options: ["responsive", "rectangle", "leaderboard"],
37
+ description: "Ad size",
38
+ },
39
+ align: {
40
+ control: "select",
41
+ options: ["left", "center", "right"],
42
+ description: "Alignment within container",
43
+ },
44
+ margin: {
45
+ control: "select",
46
+ options: ["none", "sm", "md", "lg"],
47
+ description: "Vertical margin",
48
+ },
49
+ showSeparators: {
50
+ control: "boolean",
51
+ description: "Show separator lines",
52
+ },
53
+ label: {
54
+ control: "text",
55
+ description: "Label above the ad",
56
+ },
57
+ },
58
+ }
59
+
60
+ export default meta
61
+ type Story = StoryObj<typeof WakaAdInline>
62
+
63
+ export const Default: Story = {
64
+ args: {
65
+ slotId: "inline-ad-1",
66
+ size: "responsive",
67
+ align: "center",
68
+ margin: "md",
69
+ },
70
+ render: (args) => <WakaAdInline {...args} />,
71
+ }
72
+
73
+ export const WithSeparators: Story = {
74
+ args: {
75
+ slotId: "inline-ad-2",
76
+ size: "leaderboard",
77
+ align: "center",
78
+ margin: "md",
79
+ showSeparators: true,
80
+ label: "Sponsored",
81
+ },
82
+ render: (args) => <WakaAdInline {...args} />,
83
+ }
84
+
85
+ export const LeftAligned: Story = {
86
+ args: {
87
+ slotId: "inline-ad-3",
88
+ size: "rectangle",
89
+ align: "left",
90
+ margin: "sm",
91
+ },
92
+ render: (args) => <WakaAdInline {...args} />,
93
+ }
94
+
95
+ export const WithCustomLabel: Story = {
96
+ args: {
97
+ slotId: "inline-ad-4",
98
+ size: "rectangle",
99
+ align: "center",
100
+ margin: "lg",
101
+ label: "Partner Content",
102
+ },
103
+ render: (args) => <WakaAdInline {...args} />,
104
+ }
105
+
@@ -0,0 +1,92 @@
1
+ import type { Meta, StoryObj } from "@storybook/react"
2
+ import { WakaAdInterstitial } from "./index"
3
+ import { WakaAdProvider } from "../waka-ad-provider"
4
+ import { Button } from "../button"
5
+ import * as React from "react"
6
+
7
+ const mockAdConfig = {
8
+ network: "custom" as const,
9
+ testMode: true,
10
+ debugMode: true,
11
+ }
12
+
13
+ const InterstitialDemo = (props: Partial<React.ComponentProps<typeof WakaAdInterstitial>>) => {
14
+ const [open, setOpen] = React.useState(false)
15
+
16
+ return (
17
+ <>
18
+ <Button onClick={() => setOpen(true)}>Show Interstitial</Button>
19
+ <WakaAdInterstitial
20
+ slotId="interstitial-1"
21
+ open={open}
22
+ onClose={() => setOpen(false)}
23
+ {...props}
24
+ />
25
+ </>
26
+ )
27
+ }
28
+
29
+ const meta: Meta<typeof WakaAdInterstitial> = {
30
+ title: "Components/Ads/WakaAdInterstitial",
31
+ component: WakaAdInterstitial,
32
+ parameters: {
33
+ layout: "centered",
34
+ },
35
+ tags: ["autodocs"],
36
+ decorators: [
37
+ (Story) => (
38
+ <WakaAdProvider config={mockAdConfig}>
39
+ <Story />
40
+ </WakaAdProvider>
41
+ ),
42
+ ],
43
+ argTypes: {
44
+ minDisplayTime: {
45
+ control: "number",
46
+ description: "Minimum display time before skip (seconds)",
47
+ },
48
+ autoCloseAfter: {
49
+ control: "number",
50
+ description: "Auto-close after duration (seconds, 0 = manual only)",
51
+ },
52
+ showCountdown: {
53
+ control: "boolean",
54
+ description: "Show countdown timer",
55
+ },
56
+ skipText: {
57
+ control: "text",
58
+ description: "Skip button text",
59
+ },
60
+ },
61
+ }
62
+
63
+ export default meta
64
+ type Story = StoryObj<typeof WakaAdInterstitial>
65
+
66
+ export const Default: Story = {
67
+ args: {
68
+ minDisplayTime: 5,
69
+ showCountdown: true,
70
+ skipText: "Skip Ad",
71
+ },
72
+ render: (args) => <InterstitialDemo {...args} />,
73
+ }
74
+
75
+ export const NoSkip: Story = {
76
+ args: {
77
+ minDisplayTime: 0,
78
+ showCountdown: false,
79
+ skipText: "Close",
80
+ },
81
+ render: (args) => <InterstitialDemo {...args} />,
82
+ }
83
+
84
+ export const AutoClose: Story = {
85
+ args: {
86
+ minDisplayTime: 3,
87
+ autoCloseAfter: 10,
88
+ showCountdown: true,
89
+ },
90
+ render: (args) => <InterstitialDemo {...args} />,
91
+ }
92
+
@@ -0,0 +1,89 @@
1
+ import type { Meta, StoryObj } from "@storybook/react"
2
+ import { WakaAdPlaceholder } from "./index"
3
+ import { WakaAdProvider } from "../waka-ad-provider"
4
+
5
+ const mockAdConfig = {
6
+ network: "custom" as const,
7
+ testMode: true,
8
+ }
9
+
10
+ const meta: Meta<typeof WakaAdPlaceholder> = {
11
+ title: "Components/Ads/WakaAdPlaceholder",
12
+ component: WakaAdPlaceholder,
13
+ parameters: {
14
+ layout: "centered",
15
+ },
16
+ tags: ["autodocs"],
17
+ decorators: [
18
+ (Story) => (
19
+ <WakaAdProvider config={mockAdConfig}>
20
+ <Story />
21
+ </WakaAdProvider>
22
+ ),
23
+ ],
24
+ argTypes: {
25
+ size: {
26
+ control: "select",
27
+ options: ["leaderboard", "rectangle", "skyscraper", "billboard", "mobile-banner"],
28
+ description: "Ad size preset",
29
+ },
30
+ animated: {
31
+ control: "boolean",
32
+ description: "Show animated skeleton",
33
+ },
34
+ showLabel: {
35
+ control: "boolean",
36
+ description: "Show loading text",
37
+ },
38
+ },
39
+ }
40
+
41
+ export default meta
42
+ type Story = StoryObj<typeof WakaAdPlaceholder>
43
+
44
+ export const Rectangle: Story = {
45
+ args: {
46
+ size: "rectangle",
47
+ animated: true,
48
+ showLabel: true,
49
+ },
50
+ render: (args) => <WakaAdPlaceholder {...args} />,
51
+ }
52
+
53
+ export const Leaderboard: Story = {
54
+ args: {
55
+ size: "leaderboard",
56
+ animated: true,
57
+ showLabel: true,
58
+ },
59
+ render: (args) => <WakaAdPlaceholder {...args} />,
60
+ }
61
+
62
+ export const Skyscraper: Story = {
63
+ args: {
64
+ size: "skyscraper",
65
+ animated: true,
66
+ showLabel: true,
67
+ },
68
+ render: (args) => <WakaAdPlaceholder {...args} />,
69
+ }
70
+
71
+ export const Static: Story = {
72
+ args: {
73
+ size: "rectangle",
74
+ animated: false,
75
+ showLabel: false,
76
+ },
77
+ render: (args) => <WakaAdPlaceholder {...args} />,
78
+ }
79
+
80
+ export const CustomSize: Story = {
81
+ args: {
82
+ width: 400,
83
+ height: 200,
84
+ animated: true,
85
+ showLabel: true,
86
+ },
87
+ render: (args) => <WakaAdPlaceholder {...args} />,
88
+ }
89
+
@@ -0,0 +1,110 @@
1
+ import type { Meta, StoryObj } from "@storybook/react"
2
+ import { WakaAdProvider, useAdContext, useAdConsent } from "./index"
3
+ import { WakaAdBanner } from "../waka-ad-banner"
4
+ import { Button } from "../button"
5
+ import * as React from "react"
6
+
7
+ const AdContextDemo = () => {
8
+ const { isReady, hasConsent, config, slots } = useAdContext()
9
+ const { setConsent } = useAdConsent()
10
+
11
+ return (
12
+ <div className="space-y-4 p-4 border rounded-lg">
13
+ <h3 className="font-semibold">Ad Provider Status</h3>
14
+ <div className="grid grid-cols-2 gap-2 text-sm">
15
+ <div>Network:</div>
16
+ <div className="font-mono">{config.network}</div>
17
+ <div>Ready:</div>
18
+ <div className={isReady ? "text-green-500" : "text-yellow-500"}>
19
+ {isReady ? "Yes" : "Loading..."}
20
+ </div>
21
+ <div>Consent:</div>
22
+ <div className={hasConsent ? "text-green-500" : "text-red-500"}>
23
+ {hasConsent === null ? "Pending" : hasConsent ? "Granted" : "Denied"}
24
+ </div>
25
+ <div>Registered Slots:</div>
26
+ <div>{slots.size}</div>
27
+ </div>
28
+
29
+ <div className="flex gap-2">
30
+ <Button size="sm" onClick={() => setConsent(true)}>
31
+ Grant Consent
32
+ </Button>
33
+ <Button size="sm" variant="outline" onClick={() => setConsent(false)}>
34
+ Deny Consent
35
+ </Button>
36
+ </div>
37
+
38
+ <div className="pt-4">
39
+ <WakaAdBanner slotId="demo-ad" size="rectangle" />
40
+ </div>
41
+ </div>
42
+ )
43
+ }
44
+
45
+ const meta: Meta<typeof WakaAdProvider> = {
46
+ title: "Components/Ads/WakaAdProvider",
47
+ component: WakaAdProvider,
48
+ parameters: {
49
+ layout: "centered",
50
+ },
51
+ tags: ["autodocs"],
52
+ argTypes: {
53
+ config: {
54
+ description: "Ad configuration object",
55
+ },
56
+ },
57
+ }
58
+
59
+ export default meta
60
+ type Story = StoryObj<typeof WakaAdProvider>
61
+
62
+ export const Default: Story = {
63
+ args: {
64
+ config: {
65
+ network: "custom",
66
+ testMode: true,
67
+ debugMode: true,
68
+ enableConsent: true,
69
+ },
70
+ },
71
+ render: (args) => (
72
+ <WakaAdProvider {...args}>
73
+ <AdContextDemo />
74
+ </WakaAdProvider>
75
+ ),
76
+ }
77
+
78
+ export const WithGPT: Story = {
79
+ args: {
80
+ config: {
81
+ network: "gpt",
82
+ gptNetworkCode: "/12345/example",
83
+ enableLazyLoad: true,
84
+ debugMode: true,
85
+ },
86
+ },
87
+ render: (args) => (
88
+ <WakaAdProvider {...args}>
89
+ <AdContextDemo />
90
+ </WakaAdProvider>
91
+ ),
92
+ }
93
+
94
+ export const CustomAdServer: Story = {
95
+ args: {
96
+ config: {
97
+ network: "custom",
98
+ customAdServer: "https://ads.example.com",
99
+ customApiKey: "test-api-key",
100
+ testMode: true,
101
+ debugMode: true,
102
+ },
103
+ },
104
+ render: (args) => (
105
+ <WakaAdProvider {...args}>
106
+ <AdContextDemo />
107
+ </WakaAdProvider>
108
+ ),
109
+ }
110
+
@@ -0,0 +1,89 @@
1
+ import type { Meta, StoryObj } from "@storybook/react"
2
+ import { WakaAdSidebar } from "./index"
3
+ import { WakaAdProvider } from "../waka-ad-provider"
4
+
5
+ const mockAdConfig = {
6
+ network: "custom" as const,
7
+ testMode: true,
8
+ debugMode: true,
9
+ }
10
+
11
+ const meta: Meta<typeof WakaAdSidebar> = {
12
+ title: "Components/Ads/WakaAdSidebar",
13
+ component: WakaAdSidebar,
14
+ parameters: {
15
+ layout: "fullscreen",
16
+ },
17
+ tags: ["autodocs"],
18
+ decorators: [
19
+ (Story) => (
20
+ <WakaAdProvider config={mockAdConfig}>
21
+ <div className="flex min-h-[200vh]">
22
+ <div className="flex-1 p-8">
23
+ <h2 className="text-2xl font-bold mb-4">Main Content</h2>
24
+ <p className="text-muted-foreground mb-4">
25
+ Scroll down to see the sticky sidebar ad behavior.
26
+ </p>
27
+ {Array.from({ length: 20 }).map((_, i) => (
28
+ <p key={i} className="mb-4 text-muted-foreground">
29
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
30
+ </p>
31
+ ))}
32
+ </div>
33
+ <div className="w-[200px] p-4 bg-muted/30">
34
+ <Story />
35
+ </div>
36
+ </div>
37
+ </WakaAdProvider>
38
+ ),
39
+ ],
40
+ argTypes: {
41
+ sticky: {
42
+ control: "boolean",
43
+ description: "Enable sticky behavior",
44
+ },
45
+ stickyOffset: {
46
+ control: "number",
47
+ description: "Top offset when sticky (pixels)",
48
+ },
49
+ gap: {
50
+ control: "number",
51
+ description: "Gap between multiple ads",
52
+ },
53
+ },
54
+ }
55
+
56
+ export default meta
57
+ type Story = StoryObj<typeof WakaAdSidebar>
58
+
59
+ export const Default: Story = {
60
+ args: {
61
+ slotId: "sidebar-ad-1",
62
+ sticky: true,
63
+ stickyOffset: 80,
64
+ },
65
+ render: (args) => <WakaAdSidebar {...args} />,
66
+ }
67
+
68
+ export const WithAdditionalSlots: Story = {
69
+ args: {
70
+ slotId: "sidebar-ad-main",
71
+ sticky: true,
72
+ stickyOffset: 80,
73
+ gap: 16,
74
+ additionalSlots: [
75
+ { slotId: "sidebar-ad-2" },
76
+ { slotId: "sidebar-ad-3" },
77
+ ],
78
+ },
79
+ render: (args) => <WakaAdSidebar {...args} />,
80
+ }
81
+
82
+ export const NonSticky: Story = {
83
+ args: {
84
+ slotId: "sidebar-ad-static",
85
+ sticky: false,
86
+ },
87
+ render: (args) => <WakaAdSidebar {...args} />,
88
+ }
89
+
@@ -51,10 +51,11 @@ export function WakaAdSidebar({
51
51
  if (boundaryRect) {
52
52
  const maxTop = boundaryRect.top - container.offsetHeight - gap
53
53
  if (maxTop < stickyOffset) {
54
- // Stop at boundary
54
+ // Stop at boundary - cast to HTMLElement for offsetTop access
55
+ const boundaryElement = boundary as HTMLElement
55
56
  setStickyStyle({
56
57
  position: "absolute",
57
- top: boundary!.offsetTop - container.offsetHeight - gap,
58
+ top: boundaryElement.offsetTop - container.offsetHeight - gap,
58
59
  width: containerRect.width,
59
60
  })
60
61
  setIsSticky(false)
@@ -0,0 +1,88 @@
1
+ import type { Meta, StoryObj } from "@storybook/react"
2
+ import { WakaAdStickyFooter } from "./index"
3
+ import { WakaAdProvider } from "../waka-ad-provider"
4
+
5
+ const mockAdConfig = {
6
+ network: "custom" as const,
7
+ testMode: true,
8
+ debugMode: true,
9
+ }
10
+
11
+ const meta: Meta<typeof WakaAdStickyFooter> = {
12
+ title: "Components/Ads/WakaAdStickyFooter",
13
+ component: WakaAdStickyFooter,
14
+ parameters: {
15
+ layout: "fullscreen",
16
+ },
17
+ tags: ["autodocs"],
18
+ decorators: [
19
+ (Story) => (
20
+ <WakaAdProvider config={mockAdConfig}>
21
+ <div className="min-h-screen p-8 pb-24">
22
+ <h2 className="text-2xl font-bold mb-4">Page Content</h2>
23
+ <p className="text-muted-foreground">
24
+ The sticky footer ad will appear at the bottom of the viewport.
25
+ </p>
26
+ </div>
27
+ <Story />
28
+ </WakaAdProvider>
29
+ ),
30
+ ],
31
+ argTypes: {
32
+ dismissable: {
33
+ control: "boolean",
34
+ description: "Allow user to dismiss",
35
+ },
36
+ showCloseAfter: {
37
+ control: "number",
38
+ description: "Show close button after delay (seconds)",
39
+ },
40
+ animation: {
41
+ control: "select",
42
+ options: ["slide", "fade", "none"],
43
+ description: "Animation style",
44
+ },
45
+ blur: {
46
+ control: "boolean",
47
+ description: "Background blur effect",
48
+ },
49
+ safeAreaPadding: {
50
+ control: "boolean",
51
+ description: "Safe area padding for mobile",
52
+ },
53
+ },
54
+ }
55
+
56
+ export default meta
57
+ type Story = StoryObj<typeof WakaAdStickyFooter>
58
+
59
+ export const Default: Story = {
60
+ args: {
61
+ slotId: "sticky-footer-1",
62
+ dismissable: true,
63
+ showCloseAfter: 0,
64
+ animation: "slide",
65
+ blur: true,
66
+ },
67
+ render: (args) => <WakaAdStickyFooter {...args} />,
68
+ }
69
+
70
+ export const DelayedClose: Story = {
71
+ args: {
72
+ slotId: "sticky-footer-2",
73
+ dismissable: true,
74
+ showCloseAfter: 5,
75
+ animation: "slide",
76
+ },
77
+ render: (args) => <WakaAdStickyFooter {...args} />,
78
+ }
79
+
80
+ export const NonDismissable: Story = {
81
+ args: {
82
+ slotId: "sticky-footer-3",
83
+ dismissable: false,
84
+ animation: "fade",
85
+ },
86
+ render: (args) => <WakaAdStickyFooter {...args} />,
87
+ }
88
+