@wakastellar/ui 2.1.2 → 2.3.2

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 (123) hide show
  1. package/dist/blocks/apm-overview/index.d.ts +58 -0
  2. package/dist/blocks/cicd-builder/index.d.ts +47 -0
  3. package/dist/blocks/cloud-cost-dashboard/index.d.ts +49 -0
  4. package/dist/blocks/container-orchestrator/index.d.ts +63 -0
  5. package/dist/blocks/database-admin/index.d.ts +84 -0
  6. package/dist/blocks/gitops-sync-status/index.d.ts +45 -0
  7. package/dist/blocks/incident-manager/index.d.ts +44 -0
  8. package/dist/blocks/index.d.ts +10 -0
  9. package/dist/blocks/infrastructure-map/index.d.ts +32 -0
  10. package/dist/blocks/on-call-schedule/index.d.ts +43 -0
  11. package/dist/blocks/release-notes/index.d.ts +49 -0
  12. package/dist/components/index.d.ts +34 -0
  13. package/dist/components/waka-ad-banner/index.d.ts +36 -0
  14. package/dist/components/waka-ad-fallback/index.d.ts +33 -0
  15. package/dist/components/waka-ad-inline/index.d.ts +15 -0
  16. package/dist/components/waka-ad-interstitial/index.d.ts +26 -0
  17. package/dist/components/waka-ad-placeholder/index.d.ts +17 -0
  18. package/dist/components/waka-ad-provider/index.d.ts +103 -0
  19. package/dist/components/waka-ad-sidebar/index.d.ts +18 -0
  20. package/dist/components/waka-ad-sticky-footer/index.d.ts +17 -0
  21. package/dist/components/waka-alert-panel/index.d.ts +45 -0
  22. package/dist/components/waka-artifact-list/index.d.ts +32 -0
  23. package/dist/components/waka-build-matrix/index.d.ts +36 -0
  24. package/dist/components/waka-config-comparator/index.d.ts +37 -0
  25. package/dist/components/waka-container-list/index.d.ts +51 -0
  26. package/dist/components/waka-content-recommendation/index.d.ts +23 -0
  27. package/dist/components/waka-database-card/index.d.ts +46 -0
  28. package/dist/components/waka-dependency-tree/index.d.ts +38 -0
  29. package/dist/components/waka-env-var-editor/index.d.ts +30 -0
  30. package/dist/components/waka-feature-flag-row/index.d.ts +45 -0
  31. package/dist/components/waka-kubernetes-overview/index.d.ts +98 -0
  32. package/dist/components/waka-log-viewer/index.d.ts +38 -0
  33. package/dist/components/waka-migration-list/index.d.ts +36 -0
  34. package/dist/components/waka-outstream-video/index.d.ts +24 -0
  35. package/dist/components/waka-pod-card/index.d.ts +73 -0
  36. package/dist/components/waka-query-explain/index.d.ts +48 -0
  37. package/dist/components/waka-secret-card/index.d.ts +43 -0
  38. package/dist/components/waka-security-scan-result/index.d.ts +45 -0
  39. package/dist/components/waka-service-graph/index.d.ts +44 -0
  40. package/dist/components/waka-sponsored-badge/index.d.ts +20 -0
  41. package/dist/components/waka-sponsored-card/index.d.ts +25 -0
  42. package/dist/components/waka-sponsored-feed/index.d.ts +31 -0
  43. package/dist/components/waka-test-report/index.d.ts +60 -0
  44. package/dist/components/waka-trace-viewer/index.d.ts +36 -0
  45. package/dist/components/waka-video-ad/index.d.ts +32 -0
  46. package/dist/components/waka-video-overlay/index.d.ts +26 -0
  47. package/dist/index.cjs.js +251 -200
  48. package/dist/index.d.ts +1 -0
  49. package/dist/index.es.js +47315 -35823
  50. package/dist/utils/security.d.ts +96 -0
  51. package/package.json +4 -4
  52. package/src/blocks/apm-overview/index.tsx +672 -0
  53. package/src/blocks/cicd-builder/index.tsx +738 -0
  54. package/src/blocks/cloud-cost-dashboard/index.tsx +597 -0
  55. package/src/blocks/container-orchestrator/index.tsx +729 -0
  56. package/src/blocks/database-admin/index.tsx +679 -0
  57. package/src/blocks/gitops-sync-status/index.tsx +557 -0
  58. package/src/blocks/incident-manager/index.tsx +586 -0
  59. package/src/blocks/index.ts +119 -0
  60. package/src/blocks/infrastructure-map/index.tsx +638 -0
  61. package/src/blocks/on-call-schedule/index.tsx +615 -0
  62. package/src/blocks/release-notes/index.tsx +643 -0
  63. package/src/blocks/sidebar/index.tsx +6 -6
  64. package/src/components/DataTable/templates/index.tsx +3 -2
  65. package/src/components/index.ts +283 -0
  66. package/src/components/waka-3d-pie-chart/index.tsx +11 -11
  67. package/src/components/waka-achievement-unlock/index.tsx +16 -16
  68. package/src/components/waka-ad-banner/index.tsx +275 -0
  69. package/src/components/waka-ad-fallback/index.tsx +181 -0
  70. package/src/components/waka-ad-inline/index.tsx +103 -0
  71. package/src/components/waka-ad-interstitial/index.tsx +278 -0
  72. package/src/components/waka-ad-placeholder/index.tsx +84 -0
  73. package/src/components/waka-ad-provider/index.tsx +329 -0
  74. package/src/components/waka-ad-sidebar/index.tsx +113 -0
  75. package/src/components/waka-ad-sticky-footer/index.tsx +125 -0
  76. package/src/components/waka-alert-panel/index.tsx +493 -0
  77. package/src/components/waka-artifact-list/index.tsx +416 -0
  78. package/src/components/waka-badge-showcase/index.tsx +12 -11
  79. package/src/components/waka-build-matrix/index.tsx +396 -0
  80. package/src/components/waka-command-bar/index.tsx +2 -1
  81. package/src/components/waka-config-comparator/index.tsx +416 -0
  82. package/src/components/waka-container-list/index.tsx +475 -0
  83. package/src/components/waka-content-recommendation/index.tsx +294 -0
  84. package/src/components/waka-cost-breakdown/index.tsx +10 -10
  85. package/src/components/waka-database-card/index.tsx +473 -0
  86. package/src/components/waka-dependency-tree/index.tsx +542 -0
  87. package/src/components/waka-env-var-editor/index.tsx +417 -0
  88. package/src/components/waka-feature-flag-row/index.tsx +386 -0
  89. package/src/components/waka-funnel-chart/index.tsx +8 -8
  90. package/src/components/waka-health-pulse/index.tsx +6 -6
  91. package/src/components/waka-kubernetes-overview/index.tsx +536 -0
  92. package/src/components/waka-leaderboard/index.tsx +9 -9
  93. package/src/components/waka-log-viewer/index.tsx +386 -0
  94. package/src/components/waka-loot-box/index.tsx +20 -20
  95. package/src/components/waka-migration-list/index.tsx +487 -0
  96. package/src/components/waka-outstream-video/index.tsx +240 -0
  97. package/src/components/waka-player-card/index.tsx +5 -5
  98. package/src/components/waka-pod-card/index.tsx +528 -0
  99. package/src/components/waka-query-explain/index.tsx +657 -0
  100. package/src/components/waka-quota-bar/index.tsx +4 -4
  101. package/src/components/waka-radar-score/index.tsx +10 -10
  102. package/src/components/waka-scratch-card/index.tsx +5 -4
  103. package/src/components/waka-secret-card/index.tsx +371 -0
  104. package/src/components/waka-security-scan-result/index.tsx +473 -0
  105. package/src/components/waka-server-rack/index.tsx +28 -27
  106. package/src/components/waka-service-graph/index.tsx +445 -0
  107. package/src/components/waka-sponsored-badge/index.tsx +97 -0
  108. package/src/components/waka-sponsored-card/index.tsx +275 -0
  109. package/src/components/waka-sponsored-feed/index.tsx +127 -0
  110. package/src/components/waka-spotlight/index.tsx +2 -1
  111. package/src/components/waka-success-explosion/index.tsx +4 -4
  112. package/src/components/waka-test-report/index.tsx +469 -0
  113. package/src/components/waka-trace-viewer/index.tsx +490 -0
  114. package/src/components/waka-video-ad/index.tsx +406 -0
  115. package/src/components/waka-video-overlay/index.tsx +257 -0
  116. package/src/components/waka-xp-bar/index.tsx +13 -13
  117. package/src/styles/base.css +16 -0
  118. package/src/styles/tailwind.preset.js +12 -0
  119. package/src/styles/themes/forest.css +16 -0
  120. package/src/styles/themes/monochrome.css +16 -0
  121. package/src/styles/themes/perpetuity.css +16 -0
  122. package/src/styles/themes/sunset.css +16 -0
  123. package/src/styles/themes/twilight.css +16 -0
@@ -0,0 +1,96 @@
1
+ /**
2
+ * Security utilities for sanitizing user input and preventing XSS/injection attacks.
3
+ *
4
+ * @module security
5
+ */
6
+ /**
7
+ * Validates and sanitizes a URL to prevent javascript: protocol attacks.
8
+ *
9
+ * @param url - The URL to validate
10
+ * @returns The sanitized URL if safe, or undefined if potentially malicious
11
+ *
12
+ * @example
13
+ * ```ts
14
+ * const safeUrl = sanitizeUrl("https://example.com") // "https://example.com"
15
+ * const blocked = sanitizeUrl("javascript:alert(1)") // undefined
16
+ * ```
17
+ *
18
+ * @security
19
+ * This function blocks:
20
+ * - javascript: protocol URLs
21
+ * - data: protocol URLs (except data:image for specific use cases)
22
+ * - vbscript: protocol URLs
23
+ * - URLs with encoded dangerous protocols
24
+ */
25
+ export declare function sanitizeUrl(url: string | undefined | null): string | undefined;
26
+ /**
27
+ * Safely navigates to a URL after validation.
28
+ * Use this instead of directly assigning to window.location.href.
29
+ *
30
+ * @param url - The URL to navigate to
31
+ * @returns true if navigation was performed, false if blocked
32
+ *
33
+ * @example
34
+ * ```ts
35
+ * // Safe navigation
36
+ * safeNavigate("https://example.com") // navigates
37
+ * safeNavigate("javascript:alert(1)") // blocked, returns false
38
+ * ```
39
+ */
40
+ export declare function safeNavigate(url: string | undefined | null): boolean;
41
+ /**
42
+ * Escapes special regex characters in a string.
43
+ * Use this when creating RegExp from user input to prevent ReDoS attacks.
44
+ *
45
+ * @param str - The string to escape
46
+ * @returns The escaped string safe for use in RegExp
47
+ *
48
+ * @example
49
+ * ```ts
50
+ * const pattern = escapeRegex("user.name") // "user\\.name"
51
+ * const regex = new RegExp(pattern, "i")
52
+ * ```
53
+ *
54
+ * @security
55
+ * This prevents:
56
+ * - ReDoS (Regular Expression Denial of Service) attacks
57
+ * - Unintended regex matching due to special characters
58
+ */
59
+ export declare function escapeRegex(str: string): string;
60
+ /**
61
+ * Creates a safe RegExp from user input by escaping special characters.
62
+ *
63
+ * @param pattern - The pattern string (will be escaped)
64
+ * @param flags - Optional regex flags
65
+ * @returns A safe RegExp instance
66
+ *
67
+ * @example
68
+ * ```ts
69
+ * const regex = createSafeRegex("search.term", "gi")
70
+ * // Matches literal "search.term" not "search" + any char + "term"
71
+ * ```
72
+ */
73
+ export declare function createSafeRegex(pattern: string, flags?: string): RegExp;
74
+ /**
75
+ * Creates a RegExp for highlighting text in search results.
76
+ * Escapes the search term and wraps in capture group for splitting.
77
+ *
78
+ * @param searchTerm - The term to highlight
79
+ * @returns A case-insensitive RegExp for highlighting
80
+ *
81
+ * @example
82
+ * ```ts
83
+ * const regex = createHighlightRegex("search")
84
+ * const parts = "Search results".split(regex)
85
+ * // ["", "Search", " results"]
86
+ * ```
87
+ */
88
+ export declare function createHighlightRegex(searchTerm: string): RegExp;
89
+ /**
90
+ * Sanitizes HTML content by escaping dangerous characters.
91
+ * Use when displaying user-generated content.
92
+ *
93
+ * @param html - The HTML string to sanitize
94
+ * @returns Escaped HTML safe for display
95
+ */
96
+ export declare function escapeHtml(html: string): string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wakastellar/ui",
3
- "version": "2.1.2",
3
+ "version": "2.3.2",
4
4
  "description": "Zero-config UI Library for Next.js with TweakCN theming and i18n support",
5
5
  "keywords": [
6
6
  "ui",
@@ -107,7 +107,7 @@
107
107
  "@tiptap/extension-underline": "^2.0.0 || ^3.0.0",
108
108
  "@tiptap/react": "^2.0.0 || ^3.0.0",
109
109
  "@tiptap/starter-kit": "^2.0.0 || ^3.0.0",
110
- "jspdf": "*",
110
+ "jspdf": ">=4.0.0",
111
111
  "jspdf-autotable": "*",
112
112
  "next": ">=14.0.0",
113
113
  "react": ">=18.0.0",
@@ -165,12 +165,12 @@
165
165
  "@vitest/coverage-v8": "^3.2.4",
166
166
  "@vitest/ui": "^3.2.4",
167
167
  "autoprefixer": "^10.4.16",
168
- "esbuild": "^0.24.2",
168
+ "esbuild": "^0.25.0",
169
169
  "jsdom": "^23.0.1",
170
170
  "playwright": "^1.56.0",
171
171
  "postcss": "^8.4.31",
172
172
  "react-hook-form": "^7.70.0",
173
- "storybook": "^9.1.10",
173
+ "storybook": "^9.1.17",
174
174
  "tailwindcss": "^4.1.8",
175
175
  "typescript": "^5.5.0",
176
176
  "vite": "^7.1.9",