@salesmind-ai/design-system 0.3.0 → 0.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 (212) hide show
  1. package/README.md +32 -2
  2. package/dist/admin/index.cjs +68 -2928
  3. package/dist/admin/index.cjs.map +1 -1
  4. package/dist/admin/index.js +5 -2915
  5. package/dist/admin/index.js.map +1 -1
  6. package/dist/blog/index.cjs +53 -1064
  7. package/dist/blog/index.cjs.map +1 -1
  8. package/dist/blog/index.js +8 -1054
  9. package/dist/blog/index.js.map +1 -1
  10. package/dist/charts/index.cjs +46 -2694
  11. package/dist/charts/index.cjs.map +1 -1
  12. package/dist/charts/index.js +3 -2680
  13. package/dist/charts/index.js.map +1 -1
  14. package/dist/chunk-2GARWEJK.js +17 -0
  15. package/dist/chunk-2GARWEJK.js.map +1 -0
  16. package/dist/chunk-3NKRFUAR.js +37 -0
  17. package/dist/chunk-3NKRFUAR.js.map +1 -0
  18. package/dist/chunk-3TGSIILM.cjs +201 -0
  19. package/dist/chunk-3TGSIILM.cjs.map +1 -0
  20. package/dist/chunk-4GM5BGBN.cjs +801 -0
  21. package/dist/chunk-4GM5BGBN.cjs.map +1 -0
  22. package/dist/chunk-5LGDEZWY.cjs +2434 -0
  23. package/dist/chunk-5LGDEZWY.cjs.map +1 -0
  24. package/dist/chunk-6H4DSTXR.js +786 -0
  25. package/dist/chunk-6H4DSTXR.js.map +1 -0
  26. package/dist/chunk-6UNG76Y2.js +153 -0
  27. package/dist/chunk-6UNG76Y2.js.map +1 -0
  28. package/dist/chunk-7PX2AZ6Y.js +39 -0
  29. package/dist/chunk-7PX2AZ6Y.js.map +1 -0
  30. package/dist/chunk-B6AVAX4F.js +1415 -0
  31. package/dist/chunk-B6AVAX4F.js.map +1 -0
  32. package/dist/chunk-BILT5KD3.js +264 -0
  33. package/dist/chunk-BILT5KD3.js.map +1 -0
  34. package/dist/chunk-C2BCDNAV.js +24 -0
  35. package/dist/chunk-C2BCDNAV.js.map +1 -0
  36. package/dist/chunk-CH42VPWE.cjs +421 -0
  37. package/dist/chunk-CH42VPWE.cjs.map +1 -0
  38. package/dist/chunk-CJ2MKVAF.cjs +46 -0
  39. package/dist/chunk-CJ2MKVAF.cjs.map +1 -0
  40. package/dist/chunk-DP74LUXG.cjs +98 -0
  41. package/dist/chunk-DP74LUXG.cjs.map +1 -0
  42. package/dist/chunk-E7D6EKJ4.cjs +44 -0
  43. package/dist/chunk-E7D6EKJ4.cjs.map +1 -0
  44. package/dist/chunk-ECXBTUH6.cjs +584 -0
  45. package/dist/chunk-ECXBTUH6.cjs.map +1 -0
  46. package/dist/chunk-EFRAP5ES.js +157 -0
  47. package/dist/chunk-EFRAP5ES.js.map +1 -0
  48. package/dist/chunk-F6YYWMME.js +485 -0
  49. package/dist/chunk-F6YYWMME.js.map +1 -0
  50. package/dist/chunk-FAFAP4L5.js +183 -0
  51. package/dist/chunk-FAFAP4L5.js.map +1 -0
  52. package/dist/chunk-GUZIMHWS.js +1608 -0
  53. package/dist/chunk-GUZIMHWS.js.map +1 -0
  54. package/dist/chunk-H2Y6BSTL.cjs +69 -0
  55. package/dist/chunk-H2Y6BSTL.cjs.map +1 -0
  56. package/dist/chunk-HN4PHABT.js +126 -0
  57. package/dist/chunk-HN4PHABT.js.map +1 -0
  58. package/dist/chunk-HRENHNDJ.js +211 -0
  59. package/dist/chunk-HRENHNDJ.js.map +1 -0
  60. package/dist/chunk-I75BFEYT.cjs +2561 -0
  61. package/dist/chunk-I75BFEYT.cjs.map +1 -0
  62. package/dist/chunk-IFRATNLU.js +562 -0
  63. package/dist/chunk-IFRATNLU.js.map +1 -0
  64. package/dist/chunk-IYPXJ6YC.cjs +69 -0
  65. package/dist/chunk-IYPXJ6YC.cjs.map +1 -0
  66. package/dist/chunk-JPJN4YBC.js +409 -0
  67. package/dist/chunk-JPJN4YBC.js.map +1 -0
  68. package/dist/chunk-KBA2LFBG.js +62 -0
  69. package/dist/chunk-KBA2LFBG.js.map +1 -0
  70. package/dist/chunk-KCKUSU2M.cjs +166 -0
  71. package/dist/chunk-KCKUSU2M.cjs.map +1 -0
  72. package/dist/chunk-KJ2OXQF4.js +287 -0
  73. package/dist/chunk-KJ2OXQF4.js.map +1 -0
  74. package/dist/chunk-KNQEIU7O.cjs +1202 -0
  75. package/dist/chunk-KNQEIU7O.cjs.map +1 -0
  76. package/dist/chunk-KVGSVGRK.cjs +569 -0
  77. package/dist/chunk-KVGSVGRK.cjs.map +1 -0
  78. package/dist/chunk-L352JRV6.cjs +105 -0
  79. package/dist/chunk-L352JRV6.cjs.map +1 -0
  80. package/dist/chunk-LJADZITX.cjs +298 -0
  81. package/dist/chunk-LJADZITX.cjs.map +1 -0
  82. package/dist/chunk-LMJPWXTZ.cjs +194 -0
  83. package/dist/chunk-LMJPWXTZ.cjs.map +1 -0
  84. package/dist/chunk-LOWEAQST.js +701 -0
  85. package/dist/chunk-LOWEAQST.js.map +1 -0
  86. package/dist/chunk-MDB2WCRQ.cjs +137 -0
  87. package/dist/chunk-MDB2WCRQ.cjs.map +1 -0
  88. package/dist/chunk-MQDEE7HC.cjs +283 -0
  89. package/dist/chunk-MQDEE7HC.cjs.map +1 -0
  90. package/dist/chunk-MQRB634A.cjs +34 -0
  91. package/dist/chunk-MQRB634A.cjs.map +1 -0
  92. package/dist/chunk-MTI27RDV.js +185 -0
  93. package/dist/chunk-MTI27RDV.js.map +1 -0
  94. package/dist/chunk-MU6GW5ZV.js +2317 -0
  95. package/dist/chunk-MU6GW5ZV.js.map +1 -0
  96. package/dist/chunk-NN3TUHIH.js +28 -0
  97. package/dist/chunk-NN3TUHIH.js.map +1 -0
  98. package/dist/chunk-NT4LBP7D.cjs +111 -0
  99. package/dist/chunk-NT4LBP7D.cjs.map +1 -0
  100. package/dist/chunk-OLV7OD3X.cjs +502 -0
  101. package/dist/chunk-OLV7OD3X.cjs.map +1 -0
  102. package/dist/chunk-OXNXEQY7.js +2538 -0
  103. package/dist/chunk-OXNXEQY7.js.map +1 -0
  104. package/dist/chunk-P5BOFE5A.js +546 -0
  105. package/dist/chunk-P5BOFE5A.js.map +1 -0
  106. package/dist/chunk-Q2MFGYTE.cjs +1449 -0
  107. package/dist/chunk-Q2MFGYTE.cjs.map +1 -0
  108. package/dist/chunk-Q75DBVDY.cjs +68 -0
  109. package/dist/chunk-Q75DBVDY.cjs.map +1 -0
  110. package/dist/chunk-REQ5Q6ZI.js +1022 -0
  111. package/dist/chunk-REQ5Q6ZI.js.map +1 -0
  112. package/dist/chunk-SICKWUWB.js +62 -0
  113. package/dist/chunk-SICKWUWB.js.map +1 -0
  114. package/dist/chunk-T343CCH5.js +1190 -0
  115. package/dist/chunk-T343CCH5.js.map +1 -0
  116. package/dist/chunk-TEC62D4A.cjs +1624 -0
  117. package/dist/chunk-TEC62D4A.cjs.map +1 -0
  118. package/dist/chunk-TW5JB35D.js +2122 -0
  119. package/dist/chunk-TW5JB35D.js.map +1 -0
  120. package/dist/chunk-VC5LMUVQ.cjs +20 -0
  121. package/dist/chunk-VC5LMUVQ.cjs.map +1 -0
  122. package/dist/chunk-VM7WFMKI.cjs +76 -0
  123. package/dist/chunk-VM7WFMKI.cjs.map +1 -0
  124. package/dist/chunk-W2WTP6HS.cjs +233 -0
  125. package/dist/chunk-W2WTP6HS.cjs.map +1 -0
  126. package/dist/chunk-WH7PYHZY.cjs +35 -0
  127. package/dist/chunk-WH7PYHZY.cjs.map +1 -0
  128. package/dist/chunk-XQZVY7JJ.cjs +717 -0
  129. package/dist/chunk-XQZVY7JJ.cjs.map +1 -0
  130. package/dist/chunk-XU3OMQ7V.js +98 -0
  131. package/dist/chunk-XU3OMQ7V.js.map +1 -0
  132. package/dist/chunk-XWPDRMZG.js +62 -0
  133. package/dist/chunk-XWPDRMZG.js.map +1 -0
  134. package/dist/chunk-Y3CPKNB7.js +67 -0
  135. package/dist/chunk-Y3CPKNB7.js.map +1 -0
  136. package/dist/chunk-YNVRDD2P.js +98 -0
  137. package/dist/chunk-YNVRDD2P.js.map +1 -0
  138. package/dist/chunk-YSYR54XR.js +92 -0
  139. package/dist/chunk-YSYR54XR.js.map +1 -0
  140. package/dist/chunk-YTYDQBVY.cjs +162 -0
  141. package/dist/chunk-YTYDQBVY.cjs.map +1 -0
  142. package/dist/chunk-ZDLOA2UT.cjs +1042 -0
  143. package/dist/chunk-ZDLOA2UT.cjs.map +1 -0
  144. package/dist/chunk-ZWUKRCOJ.cjs +2162 -0
  145. package/dist/chunk-ZWUKRCOJ.cjs.map +1 -0
  146. package/dist/core/index.cjs +807 -4333
  147. package/dist/core/index.cjs.map +1 -1
  148. package/dist/core/index.js +14 -4130
  149. package/dist/core/index.js.map +1 -1
  150. package/dist/i18n/index.cjs +86 -558
  151. package/dist/i18n/index.cjs.map +1 -1
  152. package/dist/i18n/index.js +1 -544
  153. package/dist/i18n/index.js.map +1 -1
  154. package/dist/index.cjs +1432 -17139
  155. package/dist/index.cjs.map +1 -1
  156. package/dist/index.css +11 -7
  157. package/dist/index.css.map +1 -1
  158. package/dist/index.js +31 -16784
  159. package/dist/index.js.map +1 -1
  160. package/dist/marketing/index.cjs +142 -3072
  161. package/dist/marketing/index.cjs.map +1 -1
  162. package/dist/marketing/index.js +11 -3042
  163. package/dist/marketing/index.js.map +1 -1
  164. package/dist/motion/index.cjs +26 -1222
  165. package/dist/motion/index.cjs.map +1 -1
  166. package/dist/motion/index.js +2 -1215
  167. package/dist/motion/index.js.map +1 -1
  168. package/dist/nav/index.cjs +101 -1518
  169. package/dist/nav/index.cjs.map +1 -1
  170. package/dist/nav/index.js +4 -1498
  171. package/dist/nav/index.js.map +1 -1
  172. package/dist/report/index.cjs +171 -2403
  173. package/dist/report/index.cjs.map +1 -1
  174. package/dist/report/index.js +3 -2363
  175. package/dist/report/index.js.map +1 -1
  176. package/dist/sections/index.cjs +28 -378
  177. package/dist/sections/index.cjs.map +1 -1
  178. package/dist/sections/index.css +1 -4
  179. package/dist/sections/index.css.map +1 -1
  180. package/dist/sections/index.js +4 -372
  181. package/dist/sections/index.js.map +1 -1
  182. package/dist/social-proof/index.cjs +53 -1249
  183. package/dist/social-proof/index.cjs.map +1 -1
  184. package/dist/social-proof/index.css +10 -3
  185. package/dist/social-proof/index.css.map +1 -1
  186. package/dist/social-proof/index.js +6 -1234
  187. package/dist/social-proof/index.js.map +1 -1
  188. package/dist/theme/index.cjs +38 -565
  189. package/dist/theme/index.cjs.map +1 -1
  190. package/dist/theme/index.js +2 -555
  191. package/dist/theme/index.js.map +1 -1
  192. package/dist/web/client/index.cjs +48 -0
  193. package/dist/web/client/index.cjs.map +1 -0
  194. package/dist/web/client/index.css +456 -0
  195. package/dist/web/client/index.css.map +1 -0
  196. package/dist/web/client/index.d.cts +172 -0
  197. package/dist/web/client/index.d.ts +172 -0
  198. package/dist/web/client/index.js +7 -0
  199. package/dist/web/client/index.js.map +1 -0
  200. package/dist/web/index.cjs +158 -1346
  201. package/dist/web/index.cjs.map +1 -1
  202. package/dist/web/index.d.cts +5 -893
  203. package/dist/web/index.d.ts +5 -893
  204. package/dist/web/index.js +9 -1305
  205. package/dist/web/index.js.map +1 -1
  206. package/dist/web/server/index.cjs +32 -0
  207. package/dist/web/server/index.cjs.map +1 -0
  208. package/dist/web/server/index.d.cts +725 -0
  209. package/dist/web/server/index.d.ts +725 -0
  210. package/dist/web/server/index.js +3 -0
  211. package/dist/web/server/index.js.map +1 -0
  212. package/package.json +14 -1
@@ -0,0 +1,172 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { ReactNode } from 'react';
3
+
4
+ /**
5
+ * Generic analytics script loader.
6
+ *
7
+ * Framework-agnostic: injects a `<script>` tag into `<head>` once,
8
+ * guards against double-loading, and respects cookie consent.
9
+ *
10
+ * @example
11
+ * ```ts
12
+ * import { createAnalyticsLoader } from '@salesmind-ai/design-system/web';
13
+ *
14
+ * const loadGA = createAnalyticsLoader({
15
+ * id: 'ga-script',
16
+ * src: (gaId) => `https://www.googletagmanager.com/gtag/js?id=${gaId}`,
17
+ * onLoad: (gaId) => {
18
+ * window.dataLayer = window.dataLayer || [];
19
+ * function gtag(...args: unknown[]) { window.dataLayer.push(args); }
20
+ * gtag('js', new Date());
21
+ * gtag('config', gaId);
22
+ * },
23
+ * });
24
+ *
25
+ * // Later, after consent:
26
+ * loadGA('G-XXXXXX');
27
+ * ```
28
+ */
29
+ interface AnalyticsLoaderConfig<TId extends string = string> {
30
+ /** Unique DOM id for the script element (prevents double-loading) */
31
+ id: string;
32
+ /** Build the script src URL from the tracking ID */
33
+ src: (trackingId: TId) => string;
34
+ /** Async attribute on the script tag (default: true) */
35
+ async?: boolean;
36
+ /** Called after the script is appended to the DOM */
37
+ onLoad?: (trackingId: TId) => void;
38
+ /** Custom inline script content instead of an external src */
39
+ inlineScript?: (trackingId: TId) => string;
40
+ }
41
+ /**
42
+ * Create a reusable analytics loader function.
43
+ * The returned function injects the script once and is safe to call multiple times.
44
+ */
45
+ declare function createAnalyticsLoader<TId extends string = string>(config: AnalyticsLoaderConfig<TId>): (trackingId: TId) => void;
46
+ declare global {
47
+ interface Window {
48
+ dataLayer: unknown[];
49
+ clarity?: (...args: unknown[]) => void;
50
+ }
51
+ }
52
+ /**
53
+ * Load Google Analytics (gtag.js).
54
+ * Call with your GA measurement ID after cookie consent.
55
+ */
56
+ declare const loadGoogleAnalytics: (trackingId: string) => void;
57
+ /**
58
+ * Load Microsoft Clarity.
59
+ * Call with your Clarity project ID after cookie consent.
60
+ */
61
+ declare const loadClarity: (trackingId: string) => void;
62
+
63
+ /** Cookie consent state */
64
+ type ConsentStatus = 'granted' | 'denied' | null;
65
+ /** Event name dispatched on window when consent changes */
66
+ declare const COOKIE_CONSENT_EVENT = "cookie_consent_granted";
67
+ /** localStorage key for cookie consent */
68
+ declare const COOKIE_CONSENT_KEY = "cookie_consent";
69
+ /** Labels for i18n support */
70
+ interface CookieConsentLabels {
71
+ title?: string;
72
+ description?: string;
73
+ privacyLinkText?: string;
74
+ acceptLabel?: string;
75
+ declineLabel?: string;
76
+ }
77
+ interface CookieConsentProps {
78
+ /** Delay in ms before showing the banner (default: 1000) */
79
+ delay?: number;
80
+ /** URL to the privacy policy page (default: "/legal/privacy") */
81
+ privacyUrl?: string;
82
+ /** Called when the user accepts cookies */
83
+ onAccept?: () => void;
84
+ /** Called when the user declines cookies */
85
+ onDecline?: () => void;
86
+ /** Override default labels for i18n */
87
+ labels?: CookieConsentLabels;
88
+ /** Custom className for the container */
89
+ className?: string;
90
+ }
91
+ /**
92
+ * CookieConsent — GDPR-compliant cookie consent banner.
93
+ *
94
+ * - Animated entrance/exit via CSS transitions (no framer-motion)
95
+ * - Respects prior consent stored in localStorage
96
+ * - Dispatches a `cookie_consent_granted` event on the window for analytics loaders
97
+ * - Uses DS Button component
98
+ *
99
+ * @example
100
+ * ```tsx
101
+ * import { CookieConsent } from '@salesmind-ai/design-system/web';
102
+ *
103
+ * <CookieConsent
104
+ * privacyUrl="/legal/privacy"
105
+ * onAccept={() => loadGoogleAnalytics('G-XXXX')}
106
+ * />
107
+ * ```
108
+ */
109
+ declare function CookieConsent({ delay, privacyUrl, onAccept, onDecline, labels, className, }: CookieConsentProps): react_jsx_runtime.JSX.Element | null;
110
+
111
+ /**
112
+ * React hook that tracks cookie consent status.
113
+ *
114
+ * Returns `true` once the user has granted cookie consent,
115
+ * `false` if denied, `null` if not yet decided.
116
+ *
117
+ * Listens for the `cookie_consent_granted` window event dispatched
118
+ * by the CookieConsent component.
119
+ *
120
+ * @example
121
+ * ```tsx
122
+ * const hasConsent = useCookieConsent();
123
+ *
124
+ * useEffect(() => {
125
+ * if (hasConsent) loadGoogleAnalytics('G-XXXX');
126
+ * }, [hasConsent]);
127
+ * ```
128
+ */
129
+ declare function useCookieConsent(): ConsentStatus;
130
+
131
+ /** Arbitrary properties bag attached to every analytics event. */
132
+ type AnalyticsEventProps = Record<string, string | number | boolean | undefined>;
133
+ /** Signature for the track function provided by AnalyticsProvider. */
134
+ type TrackFn = (event: string, props?: AnalyticsEventProps) => void;
135
+ /** Value exposed by the AnalyticsContext. */
136
+ interface AnalyticsContextValue {
137
+ track: TrackFn;
138
+ }
139
+
140
+ /** Props for the AnalyticsProvider component */
141
+ interface AnalyticsProviderProps {
142
+ /** Callback invoked on every track() call. Wire this to your analytics backend. */
143
+ onTrack: TrackFn;
144
+ /** Enable console logging in development (default: false) */
145
+ debug?: boolean;
146
+ children: ReactNode;
147
+ }
148
+ /**
149
+ * Provides analytics event tracking to all descendant DS components.
150
+ *
151
+ * @example
152
+ * ```tsx
153
+ * <AnalyticsProvider
154
+ * onTrack={(event, props) => {
155
+ * window.gtag?.('event', event, props);
156
+ * }}
157
+ * >
158
+ * <App />
159
+ * </AnalyticsProvider>
160
+ * ```
161
+ */
162
+ declare function AnalyticsProvider({ onTrack, debug, children }: AnalyticsProviderProps): react_jsx_runtime.JSX.Element;
163
+
164
+ /**
165
+ * Hook that returns the analytics `track` function.
166
+ *
167
+ * Safe to call without a wrapping `<AnalyticsProvider>` — all calls
168
+ * become no-ops in that case (Storybook, tests, SSR).
169
+ */
170
+ declare function useAnalytics(): AnalyticsContextValue;
171
+
172
+ export { type AnalyticsContextValue, type AnalyticsEventProps, type AnalyticsLoaderConfig, AnalyticsProvider, type AnalyticsProviderProps, COOKIE_CONSENT_EVENT, COOKIE_CONSENT_KEY, type ConsentStatus, CookieConsent, type CookieConsentLabels, type CookieConsentProps, type TrackFn, createAnalyticsLoader, loadClarity, loadGoogleAnalytics, useAnalytics, useCookieConsent };
@@ -0,0 +1,172 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { ReactNode } from 'react';
3
+
4
+ /**
5
+ * Generic analytics script loader.
6
+ *
7
+ * Framework-agnostic: injects a `<script>` tag into `<head>` once,
8
+ * guards against double-loading, and respects cookie consent.
9
+ *
10
+ * @example
11
+ * ```ts
12
+ * import { createAnalyticsLoader } from '@salesmind-ai/design-system/web';
13
+ *
14
+ * const loadGA = createAnalyticsLoader({
15
+ * id: 'ga-script',
16
+ * src: (gaId) => `https://www.googletagmanager.com/gtag/js?id=${gaId}`,
17
+ * onLoad: (gaId) => {
18
+ * window.dataLayer = window.dataLayer || [];
19
+ * function gtag(...args: unknown[]) { window.dataLayer.push(args); }
20
+ * gtag('js', new Date());
21
+ * gtag('config', gaId);
22
+ * },
23
+ * });
24
+ *
25
+ * // Later, after consent:
26
+ * loadGA('G-XXXXXX');
27
+ * ```
28
+ */
29
+ interface AnalyticsLoaderConfig<TId extends string = string> {
30
+ /** Unique DOM id for the script element (prevents double-loading) */
31
+ id: string;
32
+ /** Build the script src URL from the tracking ID */
33
+ src: (trackingId: TId) => string;
34
+ /** Async attribute on the script tag (default: true) */
35
+ async?: boolean;
36
+ /** Called after the script is appended to the DOM */
37
+ onLoad?: (trackingId: TId) => void;
38
+ /** Custom inline script content instead of an external src */
39
+ inlineScript?: (trackingId: TId) => string;
40
+ }
41
+ /**
42
+ * Create a reusable analytics loader function.
43
+ * The returned function injects the script once and is safe to call multiple times.
44
+ */
45
+ declare function createAnalyticsLoader<TId extends string = string>(config: AnalyticsLoaderConfig<TId>): (trackingId: TId) => void;
46
+ declare global {
47
+ interface Window {
48
+ dataLayer: unknown[];
49
+ clarity?: (...args: unknown[]) => void;
50
+ }
51
+ }
52
+ /**
53
+ * Load Google Analytics (gtag.js).
54
+ * Call with your GA measurement ID after cookie consent.
55
+ */
56
+ declare const loadGoogleAnalytics: (trackingId: string) => void;
57
+ /**
58
+ * Load Microsoft Clarity.
59
+ * Call with your Clarity project ID after cookie consent.
60
+ */
61
+ declare const loadClarity: (trackingId: string) => void;
62
+
63
+ /** Cookie consent state */
64
+ type ConsentStatus = 'granted' | 'denied' | null;
65
+ /** Event name dispatched on window when consent changes */
66
+ declare const COOKIE_CONSENT_EVENT = "cookie_consent_granted";
67
+ /** localStorage key for cookie consent */
68
+ declare const COOKIE_CONSENT_KEY = "cookie_consent";
69
+ /** Labels for i18n support */
70
+ interface CookieConsentLabels {
71
+ title?: string;
72
+ description?: string;
73
+ privacyLinkText?: string;
74
+ acceptLabel?: string;
75
+ declineLabel?: string;
76
+ }
77
+ interface CookieConsentProps {
78
+ /** Delay in ms before showing the banner (default: 1000) */
79
+ delay?: number;
80
+ /** URL to the privacy policy page (default: "/legal/privacy") */
81
+ privacyUrl?: string;
82
+ /** Called when the user accepts cookies */
83
+ onAccept?: () => void;
84
+ /** Called when the user declines cookies */
85
+ onDecline?: () => void;
86
+ /** Override default labels for i18n */
87
+ labels?: CookieConsentLabels;
88
+ /** Custom className for the container */
89
+ className?: string;
90
+ }
91
+ /**
92
+ * CookieConsent — GDPR-compliant cookie consent banner.
93
+ *
94
+ * - Animated entrance/exit via CSS transitions (no framer-motion)
95
+ * - Respects prior consent stored in localStorage
96
+ * - Dispatches a `cookie_consent_granted` event on the window for analytics loaders
97
+ * - Uses DS Button component
98
+ *
99
+ * @example
100
+ * ```tsx
101
+ * import { CookieConsent } from '@salesmind-ai/design-system/web';
102
+ *
103
+ * <CookieConsent
104
+ * privacyUrl="/legal/privacy"
105
+ * onAccept={() => loadGoogleAnalytics('G-XXXX')}
106
+ * />
107
+ * ```
108
+ */
109
+ declare function CookieConsent({ delay, privacyUrl, onAccept, onDecline, labels, className, }: CookieConsentProps): react_jsx_runtime.JSX.Element | null;
110
+
111
+ /**
112
+ * React hook that tracks cookie consent status.
113
+ *
114
+ * Returns `true` once the user has granted cookie consent,
115
+ * `false` if denied, `null` if not yet decided.
116
+ *
117
+ * Listens for the `cookie_consent_granted` window event dispatched
118
+ * by the CookieConsent component.
119
+ *
120
+ * @example
121
+ * ```tsx
122
+ * const hasConsent = useCookieConsent();
123
+ *
124
+ * useEffect(() => {
125
+ * if (hasConsent) loadGoogleAnalytics('G-XXXX');
126
+ * }, [hasConsent]);
127
+ * ```
128
+ */
129
+ declare function useCookieConsent(): ConsentStatus;
130
+
131
+ /** Arbitrary properties bag attached to every analytics event. */
132
+ type AnalyticsEventProps = Record<string, string | number | boolean | undefined>;
133
+ /** Signature for the track function provided by AnalyticsProvider. */
134
+ type TrackFn = (event: string, props?: AnalyticsEventProps) => void;
135
+ /** Value exposed by the AnalyticsContext. */
136
+ interface AnalyticsContextValue {
137
+ track: TrackFn;
138
+ }
139
+
140
+ /** Props for the AnalyticsProvider component */
141
+ interface AnalyticsProviderProps {
142
+ /** Callback invoked on every track() call. Wire this to your analytics backend. */
143
+ onTrack: TrackFn;
144
+ /** Enable console logging in development (default: false) */
145
+ debug?: boolean;
146
+ children: ReactNode;
147
+ }
148
+ /**
149
+ * Provides analytics event tracking to all descendant DS components.
150
+ *
151
+ * @example
152
+ * ```tsx
153
+ * <AnalyticsProvider
154
+ * onTrack={(event, props) => {
155
+ * window.gtag?.('event', event, props);
156
+ * }}
157
+ * >
158
+ * <App />
159
+ * </AnalyticsProvider>
160
+ * ```
161
+ */
162
+ declare function AnalyticsProvider({ onTrack, debug, children }: AnalyticsProviderProps): react_jsx_runtime.JSX.Element;
163
+
164
+ /**
165
+ * Hook that returns the analytics `track` function.
166
+ *
167
+ * Safe to call without a wrapping `<AnalyticsProvider>` — all calls
168
+ * become no-ops in that case (Storybook, tests, SSR).
169
+ */
170
+ declare function useAnalytics(): AnalyticsContextValue;
171
+
172
+ export { type AnalyticsContextValue, type AnalyticsEventProps, type AnalyticsLoaderConfig, AnalyticsProvider, type AnalyticsProviderProps, COOKIE_CONSENT_EVENT, COOKIE_CONSENT_KEY, type ConsentStatus, CookieConsent, type CookieConsentLabels, type CookieConsentProps, type TrackFn, createAnalyticsLoader, loadClarity, loadGoogleAnalytics, useAnalytics, useCookieConsent };
@@ -0,0 +1,7 @@
1
+ "use client";
2
+ export { AnalyticsProvider, COOKIE_CONSENT_EVENT, COOKIE_CONSENT_KEY, CookieConsent, createAnalyticsLoader, loadClarity, loadGoogleAnalytics, useCookieConsent } from '../../chunk-6UNG76Y2.js';
3
+ import '../../chunk-SICKWUWB.js';
4
+ export { useAnalytics } from '../../chunk-2GARWEJK.js';
5
+ import '../../chunk-KJ2OXQF4.js';
6
+ //# sourceMappingURL=out.js.map
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":""}