@c15t/react 2.0.0-rc.5 → 2.0.0-rc.6

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 (262) hide show
  1. package/dist/components/consent-banner/atoms/overlay.cjs +1 -1
  2. package/dist/components/consent-banner/atoms/root.cjs +1 -1
  3. package/dist/components/consent-banner/components.cjs +1 -1
  4. package/dist/components/consent-banner/components.js +1 -1
  5. package/dist/components/consent-banner/consent-banner.cjs +1 -1
  6. package/dist/components/consent-banner/consent-banner.js +1 -1
  7. package/dist/components/consent-banner/error-boundary.cjs +1 -1
  8. package/dist/components/consent-banner/index.cjs +1 -1
  9. package/dist/components/consent-banner/index.js +1 -1
  10. package/dist/components/consent-dialog/atoms/card.cjs +1 -1
  11. package/dist/components/consent-dialog/atoms/card.js +1 -1
  12. package/dist/components/consent-dialog/atoms/overlay.cjs +1 -1
  13. package/dist/components/consent-dialog/atoms/overlay.js +1 -1
  14. package/dist/components/consent-dialog/atoms/root.cjs +1 -1
  15. package/dist/components/consent-dialog/atoms/root.js +1 -1
  16. package/dist/components/consent-dialog/consent-dialog.cjs +1 -1
  17. package/dist/components/consent-dialog/index.cjs +1 -1
  18. package/dist/components/consent-dialog/index.js +1 -1
  19. package/dist/components/consent-dialog-link/index.cjs +1 -1
  20. package/dist/components/consent-dialog-link/index.js +1 -1
  21. package/dist/components/consent-dialog-trigger/atoms/button.cjs +1 -1
  22. package/dist/components/consent-dialog-trigger/atoms/icon.cjs +1 -1
  23. package/dist/components/consent-dialog-trigger/atoms/icon.js +1 -1
  24. package/dist/components/consent-dialog-trigger/atoms/root.cjs +1 -1
  25. package/dist/components/consent-dialog-trigger/atoms/root.js +1 -1
  26. package/dist/components/consent-dialog-trigger/atoms/text.cjs +1 -1
  27. package/dist/components/consent-dialog-trigger/atoms/text.js +1 -1
  28. package/dist/components/consent-dialog-trigger/consent-dialog-trigger.cjs +1 -1
  29. package/dist/components/consent-dialog-trigger/consent-dialog-trigger.js +1 -1
  30. package/dist/components/consent-dialog-trigger/index.cjs +1 -1
  31. package/dist/components/consent-dialog-trigger/index.js +1 -1
  32. package/dist/components/consent-dialog-trigger/types.cjs +1 -1
  33. package/dist/components/consent-dialog-trigger/use-draggable.cjs +1 -1
  34. package/dist/components/consent-dialog-trigger/use-draggable.js +1 -1
  35. package/dist/components/consent-preferences-link/consent-preferences-link.cjs +1 -1
  36. package/dist/components/consent-preferences-link/index.cjs +1 -1
  37. package/dist/components/consent-preferences-link/index.js +1 -1
  38. package/dist/components/consent-widget/atoms/accordion.cjs +1 -1
  39. package/dist/components/consent-widget/atoms/accordion.js +1 -1
  40. package/dist/components/consent-widget/atoms/button.cjs +1 -1
  41. package/dist/components/consent-widget/atoms/footer.cjs +1 -1
  42. package/dist/components/consent-widget/atoms/root.cjs +1 -1
  43. package/dist/components/consent-widget/consent-widget.cjs +1 -1
  44. package/dist/components/consent-widget/consent-widget.js +1 -1
  45. package/dist/components/consent-widget/index.cjs +1 -1
  46. package/dist/components/consent-widget/index.js +1 -1
  47. package/dist/components/consent-widget/types.cjs +1 -1
  48. package/dist/components/frame/atoms.cjs +1 -1
  49. package/dist/components/frame/frame.cjs +1 -1
  50. package/dist/components/frame/index.cjs +1 -1
  51. package/dist/components/frame/index.js +1 -1
  52. package/dist/components/frame/types.cjs +1 -1
  53. package/dist/components/iab-consent-banner/atoms/button-group.cjs +1 -1
  54. package/dist/components/iab-consent-banner/atoms/card.cjs +1 -1
  55. package/dist/components/iab-consent-banner/atoms/description.cjs +1 -1
  56. package/dist/components/iab-consent-banner/atoms/footer.cjs +1 -1
  57. package/dist/components/iab-consent-banner/atoms/header.cjs +1 -1
  58. package/dist/components/iab-consent-banner/atoms/overlay.cjs +1 -1
  59. package/dist/components/iab-consent-banner/atoms/root.cjs +1 -1
  60. package/dist/components/iab-consent-banner/atoms/title.cjs +1 -1
  61. package/dist/components/iab-consent-banner/iab-consent-banner.cjs +1 -1
  62. package/dist/components/iab-consent-banner/iab-consent-banner.js +1 -1
  63. package/dist/components/iab-consent-banner/index.cjs +1 -1
  64. package/dist/components/iab-consent-banner/index.js +1 -1
  65. package/dist/components/iab-consent-dialog/atoms/card.cjs +1 -1
  66. package/dist/components/iab-consent-dialog/atoms/content.cjs +1 -1
  67. package/dist/components/iab-consent-dialog/atoms/footer.cjs +1 -1
  68. package/dist/components/iab-consent-dialog/atoms/footer.js +1 -1
  69. package/dist/components/iab-consent-dialog/atoms/header.cjs +1 -1
  70. package/dist/components/iab-consent-dialog/atoms/header.js +1 -1
  71. package/dist/components/iab-consent-dialog/atoms/overlay.cjs +1 -1
  72. package/dist/components/iab-consent-dialog/atoms/purpose-item.cjs +1 -1
  73. package/dist/components/iab-consent-dialog/atoms/purpose-item.js +1 -1
  74. package/dist/components/iab-consent-dialog/atoms/root.cjs +1 -1
  75. package/dist/components/iab-consent-dialog/atoms/stack-item.cjs +1 -1
  76. package/dist/components/iab-consent-dialog/atoms/stack-item.js +1 -1
  77. package/dist/components/iab-consent-dialog/atoms/tabs.cjs +1 -1
  78. package/dist/components/iab-consent-dialog/atoms/tabs.js +1 -1
  79. package/dist/components/iab-consent-dialog/atoms/vendor-list.cjs +1 -1
  80. package/dist/components/iab-consent-dialog/atoms/vendor-list.js +1 -1
  81. package/dist/components/iab-consent-dialog/hooks/use-gvl-data.cjs +1 -1
  82. package/dist/components/iab-consent-dialog/iab-consent-dialog.cjs +1 -1
  83. package/dist/components/iab-consent-dialog/iab-consent-dialog.js +1 -1
  84. package/dist/components/iab-consent-dialog/index.cjs +1 -1
  85. package/dist/components/iab-consent-dialog/index.js +1 -1
  86. package/dist/components/iab-consent-dialog/types.cjs +1 -1
  87. package/dist/components/iab-consent-dialog/use-iab-translations.cjs +1 -1
  88. package/dist/components/shared/libs/policy-actions.cjs +1 -1
  89. package/dist/components/shared/libs/policy-actions.js +1 -1
  90. package/dist/components/shared/libs/polymorphic.cjs +1 -1
  91. package/dist/components/shared/libs/recursive-clone-children.cjs +1 -1
  92. package/dist/components/shared/libs/slot.cjs +1 -0
  93. package/dist/components/shared/libs/slot.js +1 -0
  94. package/dist/components/shared/libs/use-controllable-state.cjs +1 -0
  95. package/dist/components/shared/libs/use-controllable-state.js +1 -0
  96. package/dist/components/shared/primitives/box.cjs +1 -1
  97. package/dist/components/shared/primitives/box.js +1 -1
  98. package/dist/components/shared/primitives/button.cjs +1 -1
  99. package/dist/components/shared/primitives/button.js +1 -1
  100. package/dist/components/shared/primitives/button.types.cjs +1 -1
  101. package/dist/components/shared/primitives/legal-links/index.cjs +1 -1
  102. package/dist/components/shared/primitives/legal-links/index.js +1 -1
  103. package/dist/components/shared/ui/accordion/accordion.cjs +1 -1
  104. package/dist/components/shared/ui/accordion/accordion.js +1 -1
  105. package/dist/components/shared/ui/accordion/accordion.types.cjs +1 -1
  106. package/dist/components/shared/ui/accordion/index.cjs +1 -1
  107. package/dist/components/shared/ui/animated-collapse/animated-collapse.cjs +1 -1
  108. package/dist/components/shared/ui/animated-collapse/index.cjs +1 -1
  109. package/dist/components/shared/ui/animated-collapse/index.js +1 -1
  110. package/dist/components/shared/ui/button/button.cjs +1 -1
  111. package/dist/components/shared/ui/button/button.js +1 -1
  112. package/dist/components/shared/ui/button/button.types.cjs +1 -1
  113. package/dist/components/shared/ui/button/index.cjs +1 -1
  114. package/dist/components/shared/ui/collapsible/collapsible.cjs +1 -0
  115. package/dist/components/shared/ui/collapsible/collapsible.js +1 -0
  116. package/dist/components/shared/ui/collapsible/index.cjs +1 -0
  117. package/dist/components/shared/ui/collapsible/index.js +1 -0
  118. package/dist/components/shared/ui/dialog/dialog.cjs +1 -0
  119. package/dist/components/shared/ui/dialog/dialog.js +1 -0
  120. package/dist/components/shared/ui/dialog/index.cjs +1 -0
  121. package/dist/components/shared/ui/dialog/index.js +1 -0
  122. package/dist/components/shared/ui/icon.cjs +1 -1
  123. package/dist/components/shared/ui/logo.cjs +1 -1
  124. package/dist/components/shared/ui/preference-item/index.cjs +1 -0
  125. package/dist/components/shared/ui/preference-item/index.js +1 -0
  126. package/dist/components/shared/ui/preference-item/preference-item.cjs +1 -0
  127. package/dist/components/shared/ui/preference-item/preference-item.js +1 -0
  128. package/dist/components/shared/ui/switch/index.cjs +1 -1
  129. package/dist/components/shared/ui/switch/switch.cjs +1 -1
  130. package/dist/components/shared/ui/switch/switch.js +1 -1
  131. package/dist/components/shared/ui/switch/switch.types.cjs +1 -1
  132. package/dist/components/shared/ui/tabs/index.cjs +1 -0
  133. package/dist/components/shared/ui/tabs/index.js +1 -0
  134. package/dist/components/shared/ui/tabs/tabs.cjs +1 -0
  135. package/dist/components/shared/ui/tabs/tabs.js +1 -0
  136. package/dist/context/consent-manager-context.cjs +1 -1
  137. package/dist/context/consent-tracking-context.cjs +1 -1
  138. package/dist/context/theme-context.cjs +1 -1
  139. package/dist/headless.cjs +1 -1
  140. package/dist/headless.js +1 -1
  141. package/dist/hooks/index.cjs +1 -1
  142. package/dist/hooks/use-color-scheme.cjs +1 -1
  143. package/dist/hooks/use-component-config.cjs +1 -1
  144. package/dist/hooks/use-consent-dialog-trigger.cjs +1 -1
  145. package/dist/hooks/use-consent-manager.cjs +1 -1
  146. package/dist/hooks/use-focus-trap.cjs +1 -1
  147. package/dist/hooks/use-focus-trap.js +1 -1
  148. package/dist/hooks/use-headless-consent-ui.cjs +1 -1
  149. package/dist/hooks/use-headless-consent-ui.js +1 -1
  150. package/dist/hooks/use-headless-iab-consent-ui.cjs +1 -1
  151. package/dist/hooks/use-reduced-motion.cjs +1 -1
  152. package/dist/hooks/use-reduced-motion.js +1 -1
  153. package/dist/hooks/use-scroll-lock.cjs +1 -1
  154. package/dist/hooks/use-scroll-lock.js +1 -1
  155. package/dist/hooks/use-ssr-status.cjs +1 -1
  156. package/dist/hooks/use-styles.cjs +1 -1
  157. package/dist/hooks/use-text-direction.cjs +1 -1
  158. package/dist/hooks/use-theme.cjs +1 -1
  159. package/dist/hooks/use-theme.js +1 -1
  160. package/dist/hooks/use-translations.cjs +1 -1
  161. package/dist/iab/styles.css +1 -0
  162. package/dist/iab.cjs +1 -0
  163. package/dist/iab.js +1 -0
  164. package/dist/index.cjs +1 -1
  165. package/dist/index.js +1 -1
  166. package/dist/primitives/accordion.cjs +1 -0
  167. package/dist/primitives/accordion.js +1 -0
  168. package/dist/primitives/button.cjs +1 -0
  169. package/dist/primitives/button.js +1 -0
  170. package/dist/primitives/collapsible.cjs +1 -0
  171. package/dist/primitives/collapsible.js +1 -0
  172. package/dist/primitives/dialog.cjs +1 -0
  173. package/dist/primitives/dialog.js +1 -0
  174. package/dist/primitives/preference-item.cjs +1 -0
  175. package/dist/primitives/preference-item.js +1 -0
  176. package/dist/primitives/switch.cjs +1 -0
  177. package/dist/primitives/switch.js +1 -0
  178. package/dist/primitives/tabs.cjs +1 -0
  179. package/dist/primitives/tabs.js +1 -0
  180. package/dist/primitives.cjs +1 -0
  181. package/dist/primitives.js +1 -0
  182. package/dist/providers/consent-manager-provider.cjs +1 -1
  183. package/dist/providers/consent-manager-provider.js +1 -1
  184. package/dist/server/fetch-ssr-data.cjs +1 -1
  185. package/dist/server/fetch-ssr-data.js +1 -1
  186. package/dist/server/headers.cjs +1 -1
  187. package/dist/server/index.cjs +1 -1
  188. package/dist/server/index.js +1 -1
  189. package/dist/server/init-cache-key.cjs +1 -1
  190. package/dist/server/init-cache-key.js +1 -1
  191. package/dist/server/normalize-url.cjs +1 -1
  192. package/dist/server/types.cjs +1 -1
  193. package/dist/styles.css +1 -0
  194. package/dist/types/consent-manager.cjs +1 -1
  195. package/dist/types/theme/index.cjs +1 -1
  196. package/dist/types/theme/style-keys.cjs +1 -1
  197. package/dist/types/theme/style-types.cjs +1 -1
  198. package/dist/utils/cn.cjs +1 -1
  199. package/dist/utils/merge-styles.cjs +1 -1
  200. package/dist/utils/test-helpers.cjs +1 -1
  201. package/dist/utils/test-helpers.js +1 -1
  202. package/dist/utils/theme-utils.cjs +1 -1
  203. package/dist/version.cjs +1 -1
  204. package/dist/version.js +1 -1
  205. package/dist-types/components/consent-banner/atoms/overlay.d.ts +1 -1
  206. package/dist-types/components/consent-banner/atoms/root.d.ts +1 -1
  207. package/dist-types/components/consent-banner/components.d.ts +1 -1
  208. package/dist-types/components/consent-banner/index.d.ts +1 -1
  209. package/dist-types/components/consent-dialog/atoms/card.d.ts +1 -1
  210. package/dist-types/components/consent-dialog/atoms/overlay.d.ts +1 -1
  211. package/dist-types/components/consent-dialog/atoms/root.d.ts +1 -1
  212. package/dist-types/components/consent-dialog/index.d.ts +1 -1
  213. package/dist-types/components/consent-dialog-trigger/consent-dialog-trigger.d.ts +2 -2
  214. package/dist-types/components/consent-dialog-trigger/types.d.ts +1 -1
  215. package/dist-types/components/consent-dialog-trigger/use-draggable.d.ts +1 -1
  216. package/dist-types/components/consent-preferences-link/consent-preferences-link.d.ts +1 -0
  217. package/dist-types/components/consent-widget/atoms/accordion.d.ts +19 -37
  218. package/dist-types/components/consent-widget/atoms/button.d.ts +1 -1
  219. package/dist-types/components/consent-widget/atoms/root.d.ts +1 -1
  220. package/dist-types/components/consent-widget/index.d.ts +1 -1
  221. package/dist-types/components/frame/atoms.d.ts +1 -1
  222. package/dist-types/components/frame/index.d.ts +1 -1
  223. package/dist-types/components/iab-consent-banner/index.d.ts +1 -1
  224. package/dist-types/components/iab-consent-dialog/atoms/tabs.d.ts +3 -30
  225. package/dist-types/components/iab-consent-dialog/index.d.ts +1 -1
  226. package/dist-types/components/shared/libs/policy-actions.d.ts +3 -3
  227. package/dist-types/components/shared/libs/slot.d.ts +6 -0
  228. package/dist-types/components/shared/libs/use-controllable-state.d.ts +7 -0
  229. package/dist-types/components/shared/ui/accordion/accordion.d.ts +32 -67
  230. package/dist-types/components/shared/ui/button/button.d.ts +2 -2
  231. package/dist-types/components/shared/ui/collapsible/collapsible.d.ts +20 -0
  232. package/dist-types/components/shared/ui/collapsible/index.d.ts +1 -0
  233. package/dist-types/components/shared/ui/dialog/dialog.d.ts +29 -0
  234. package/dist-types/components/shared/ui/dialog/index.d.ts +1 -0
  235. package/dist-types/components/shared/ui/preference-item/index.d.ts +1 -0
  236. package/dist-types/components/shared/ui/preference-item/preference-item.d.ts +33 -0
  237. package/dist-types/components/shared/ui/switch/switch.d.ts +7 -31
  238. package/dist-types/components/shared/ui/tabs/index.d.ts +1 -0
  239. package/dist-types/components/shared/ui/tabs/tabs.d.ts +28 -0
  240. package/dist-types/headless.d.ts +0 -1
  241. package/dist-types/hooks/use-headless-consent-ui.d.ts +1 -1
  242. package/dist-types/iab.d.ts +24 -0
  243. package/dist-types/index.d.ts +0 -3
  244. package/dist-types/primitives/accordion.d.ts +1 -0
  245. package/dist-types/primitives/button.d.ts +1 -0
  246. package/dist-types/primitives/collapsible.d.ts +1 -0
  247. package/dist-types/primitives/dialog.d.ts +1 -0
  248. package/dist-types/primitives/preference-item.d.ts +1 -0
  249. package/dist-types/primitives/switch.d.ts +1 -0
  250. package/dist-types/primitives/tabs.d.ts +1 -0
  251. package/dist-types/primitives.d.ts +7 -0
  252. package/dist-types/version.d.ts +1 -1
  253. package/docs/building-headless-components.md +4 -4
  254. package/docs/components/consent-manager-provider.md +1 -0
  255. package/docs/concepts/policy-packs.md +1 -1
  256. package/docs/hooks/use-consent-manager/overview.md +2 -2
  257. package/docs/hooks/use-translations.md +1 -0
  258. package/docs/quickstart.md +13 -3
  259. package/docs/styling/tailwind.md +31 -2
  260. package/package.json +26 -18
  261. package/client/components/iab-consent-banner.js +0 -4
  262. package/client/components/iab-consent-dialog.js +0 -4
@@ -0,0 +1,33 @@
1
+ import { type PreferenceItemVariantsProps } from '../../../../../../ui/dist-types/styles/primitives/preference-item.d.ts';
2
+ import { type HTMLAttributes, type ReactNode } from 'react';
3
+ export interface PreferenceItemRootProps extends HTMLAttributes<HTMLDivElement>, PreferenceItemVariantsProps {
4
+ children: ReactNode;
5
+ defaultOpen?: boolean;
6
+ disabled?: boolean;
7
+ noStyle?: boolean;
8
+ onOpenChange?: (open: boolean) => void;
9
+ open?: boolean;
10
+ }
11
+ declare const PreferenceItemRoot: import("react").ForwardRefExoticComponent<PreferenceItemRootProps & import("react").RefAttributes<HTMLDivElement>>;
12
+ export interface PreferenceItemTriggerProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'type'> {
13
+ noStyle?: boolean;
14
+ }
15
+ declare const PreferenceItemTrigger: import("react").ForwardRefExoticComponent<PreferenceItemTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
16
+ export interface PreferenceItemSlotProps extends HTMLAttributes<HTMLDivElement> {
17
+ noStyle?: boolean;
18
+ }
19
+ declare const PreferenceItemLeading: import("react").ForwardRefExoticComponent<PreferenceItemSlotProps & import("react").RefAttributes<HTMLDivElement>>;
20
+ declare const PreferenceItemHeader: import("react").ForwardRefExoticComponent<PreferenceItemSlotProps & import("react").RefAttributes<HTMLDivElement>>;
21
+ declare const PreferenceItemMeta: import("react").ForwardRefExoticComponent<PreferenceItemSlotProps & import("react").RefAttributes<HTMLDivElement>>;
22
+ declare const PreferenceItemAuxiliary: import("react").ForwardRefExoticComponent<PreferenceItemSlotProps & import("react").RefAttributes<HTMLDivElement>>;
23
+ declare const PreferenceItemControl: import("react").ForwardRefExoticComponent<PreferenceItemSlotProps & import("react").RefAttributes<HTMLDivElement>>;
24
+ export interface PreferenceItemTitleProps extends HTMLAttributes<HTMLHeadingElement> {
25
+ noStyle?: boolean;
26
+ }
27
+ declare const PreferenceItemTitle: import("react").ForwardRefExoticComponent<PreferenceItemTitleProps & import("react").RefAttributes<HTMLHeadingElement>>;
28
+ export interface PreferenceItemContentProps extends HTMLAttributes<HTMLDivElement> {
29
+ innerClassName?: string;
30
+ noStyle?: boolean;
31
+ }
32
+ declare const PreferenceItemContent: import("react").ForwardRefExoticComponent<PreferenceItemContentProps & import("react").RefAttributes<HTMLDivElement>>;
33
+ export { PreferenceItemAuxiliary as Auxiliary, PreferenceItemContent as Content, PreferenceItemControl as Control, PreferenceItemHeader as Header, PreferenceItemLeading as Leading, PreferenceItemMeta as Meta, PreferenceItemRoot as Root, PreferenceItemTitle as Title, PreferenceItemTrigger as Trigger, };
@@ -1,6 +1,5 @@
1
- import { type SwitchSize, type SwitchVariantsProps, switchVariants } from '../../../../../../ui/dist-types/styles/primitives/index.d.ts';
2
- import * as SwitchPrimitives from '@radix-ui/react-switch';
3
- import { type ComponentPropsWithoutRef } from 'react';
1
+ import { type SwitchSize, type SwitchVariantsProps, switchVariants } from '../../../../../../ui/dist-types/styles/primitives/switch.d.ts';
2
+ import { type ButtonHTMLAttributes } from 'react';
4
3
  import type { AllThemeKeys, ThemeValue } from '../../../../types/theme';
5
4
  export type { SwitchSize, SwitchVariantsProps };
6
5
  export { switchVariants };
@@ -9,36 +8,13 @@ export type SwitchStylesKeys = {
9
8
  'switch.thumb': ThemeValue;
10
9
  'switch.track': ThemeValue;
11
10
  };
12
- /**
13
- * Props for the Switch component.
14
- * Extends Radix Switch primitive props with variant support.
15
- *
16
- * @public
17
- */
18
- export interface SwitchProps extends ComponentPropsWithoutRef<typeof SwitchPrimitives.Root>, SwitchVariantsProps {
19
- /**
20
- * When true, removes default styles.
21
- */
11
+ export interface SwitchProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'onChange' | 'size'>, SwitchVariantsProps {
12
+ checked?: boolean;
13
+ defaultChecked?: boolean;
22
14
  noStyle?: boolean;
23
- /**
24
- * Theme key for custom theming.
25
- */
15
+ onCheckedChange?: (checked: boolean) => void;
16
+ size?: SwitchSize;
26
17
  themeKey?: AllThemeKeys;
27
18
  }
28
- /**
29
- * Switch component with explicit variant support.
30
- *
31
- * @remarks
32
- * A toggle switch component built on Radix UI primitives with
33
- * explicit size variants for type-safe styling.
34
- *
35
- * @example
36
- * ```tsx
37
- * <Switch size="small" />
38
- * <Switch size="medium" checked={isEnabled} onCheckedChange={setIsEnabled} />
39
- * ```
40
- *
41
- * @public
42
- */
43
19
  declare const Switch: import("react").ForwardRefExoticComponent<SwitchProps & import("react").RefAttributes<HTMLButtonElement>>;
44
20
  export { Switch as Root };
@@ -0,0 +1 @@
1
+ export * from './tabs';
@@ -0,0 +1,28 @@
1
+ import { type TabsVariantsProps } from '../../../../../../ui/dist-types/styles/primitives/tabs.d.ts';
2
+ import { type HTMLAttributes, type ReactNode } from 'react';
3
+ export interface TabsRootProps extends Omit<HTMLAttributes<HTMLDivElement>, 'defaultValue' | 'onChange'>, TabsVariantsProps {
4
+ children: ReactNode;
5
+ defaultValue?: string;
6
+ disabled?: boolean;
7
+ loop?: boolean;
8
+ noStyle?: boolean;
9
+ onValueChange?: (value: string) => void;
10
+ value?: string;
11
+ }
12
+ declare const TabsRoot: import("react").ForwardRefExoticComponent<TabsRootProps & import("react").RefAttributes<HTMLDivElement>>;
13
+ export interface TabsListProps extends Omit<HTMLAttributes<HTMLDivElement>, 'defaultValue' | 'onChange'>, TabsVariantsProps {
14
+ noStyle?: boolean;
15
+ }
16
+ declare const TabsList: import("react").ForwardRefExoticComponent<TabsListProps & import("react").RefAttributes<HTMLDivElement>>;
17
+ export interface TabsTriggerProps extends HTMLAttributes<HTMLButtonElement> {
18
+ noStyle?: boolean;
19
+ value: string;
20
+ }
21
+ declare const TabsTrigger: import("react").ForwardRefExoticComponent<TabsTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
22
+ export interface TabsContentProps extends HTMLAttributes<HTMLDivElement> {
23
+ forceMount?: boolean;
24
+ noStyle?: boolean;
25
+ value: string;
26
+ }
27
+ declare const TabsContent: import("react").ForwardRefExoticComponent<TabsContentProps & import("react").RefAttributes<HTMLDivElement>>;
28
+ export { TabsContent as Content, TabsList as List, TabsRoot as Root, TabsTrigger as Trigger, };
@@ -4,7 +4,6 @@ export { type ConsentDialogTriggerVisibility, type UseConsentDialogTriggerOption
4
4
  export { useConsentManager } from './hooks/use-consent-manager';
5
5
  export { useFocusTrap } from './hooks/use-focus-trap';
6
6
  export { type HeadlessConsentBannerAction, type HeadlessConsentBannerState, type HeadlessConsentDialogAction, type HeadlessConsentDialogState, type HeadlessConsentSurface, type HeadlessConsentSurfaceAction, type HeadlessConsentSurfaceState, type HeadlessConsentWriteAction, type UseHeadlessConsentUIResult, useHeadlessConsentUI, } from './hooks/use-headless-consent-ui';
7
- export { type HeadlessIABBannerAction, type HeadlessIABBannerState, type HeadlessIABDialogAction, type HeadlessIABDialogState, type HeadlessIABPreferenceTab, type UseHeadlessIABConsentUIResult, useHeadlessIABConsentUI, } from './hooks/use-headless-iab-consent-ui';
8
7
  export { useTranslations } from './hooks/use-translations';
9
8
  export { ConsentManagerProvider } from './providers/consent-manager-provider';
10
9
  export type { ConsentManagerOptions, ConsentManagerProviderProps, } from './types/consent-manager';
@@ -9,7 +9,7 @@ export interface HeadlessConsentSurfaceState<TAction extends string = HeadlessCo
9
9
  allowedActions: TAction[];
10
10
  orderedActions: TAction[];
11
11
  actionGroups: TAction[][];
12
- primaryAction?: TAction;
12
+ primaryActions: TAction[];
13
13
  layout?: PolicyUiActionGroup[];
14
14
  direction: PolicyUiActionDirection;
15
15
  uiProfile?: PolicyUiProfile;
@@ -0,0 +1,24 @@
1
+ /**
2
+ * IAB TCF 2.3 React components and hooks.
3
+ *
4
+ * This subpath export contains all IAB-specific React UI. It is only
5
+ * loaded when explicitly imported from '@c15t/react/iab'.
6
+ *
7
+ * Requires `@c15t/iab` as a peer dependency.
8
+ *
9
+ * @example
10
+ * ```tsx
11
+ * import { iab } from '@c15t/iab';
12
+ * import { IABConsentBanner, IABConsentDialog } from '@c15t/react/iab';
13
+ *
14
+ * <ConsentManagerProvider options={{ mode: 'hosted', iab: iab({ cmpId: 28 }) }}>
15
+ * <IABConsentBanner />
16
+ * <IABConsentDialog />
17
+ * </ConsentManagerProvider>
18
+ * ```
19
+ *
20
+ * @packageDocumentation
21
+ */
22
+ export { IABConsentBanner, type IABConsentBannerProps, } from './components/iab-consent-banner';
23
+ export { IABConsentDialog, type IABConsentDialogProps, } from './components/iab-consent-dialog';
24
+ export { type HeadlessIABBannerAction, type HeadlessIABBannerState, type HeadlessIABDialogAction, type HeadlessIABDialogState, type HeadlessIABPreferenceTab, type UseHeadlessIABConsentUIResult, useHeadlessIABConsentUI, } from './hooks/use-headless-iab-consent-ui';
@@ -7,15 +7,12 @@ export { ConsentDialogLink, type ConsentDialogLinkProps, } from './components/co
7
7
  export { ConsentDialogTrigger, type ConsentDialogTriggerCompound, type ConsentDialogTriggerProps, TriggerButton, type TriggerButtonProps, TriggerIcon, type TriggerIconProps, type TriggerIconType, TriggerRoot, type TriggerRootProps, type TriggerSize, TriggerText, type TriggerTextProps, type TriggerVisibility, type UseDraggableOptions, type UseDraggableReturn, useDraggable, useTriggerContext, } from './components/consent-dialog-trigger';
8
8
  export { ConsentWidget, type ConsentWidgetProps, } from './components/consent-widget';
9
9
  export { Frame, type FrameProps } from './components/frame';
10
- export { IABConsentBanner, type IABConsentBannerProps, } from './components/iab-consent-banner';
11
- export { IABConsentDialog, type IABConsentDialogProps, } from './components/iab-consent-dialog';
12
10
  export { ConsentButton } from './components/shared/primitives/button';
13
11
  export { useColorScheme } from './hooks/use-color-scheme';
14
12
  export { type ConsentDialogTriggerVisibility, type UseConsentDialogTriggerOptions, type UseConsentDialogTriggerResult, useConsentDialogTrigger, } from './hooks/use-consent-dialog-trigger';
15
13
  export { useConsentManager } from './hooks/use-consent-manager';
16
14
  export { useFocusTrap } from './hooks/use-focus-trap';
17
15
  export { type HeadlessConsentBannerAction, type HeadlessConsentBannerState, type HeadlessConsentDialogAction, type HeadlessConsentDialogState, type HeadlessConsentSurface, type HeadlessConsentSurfaceAction, type HeadlessConsentSurfaceState, type HeadlessConsentWriteAction, type UseHeadlessConsentUIResult, useHeadlessConsentUI, } from './hooks/use-headless-consent-ui';
18
- export { type HeadlessIABBannerAction, type HeadlessIABBannerState, type HeadlessIABDialogAction, type HeadlessIABDialogState, type HeadlessIABPreferenceTab, type UseHeadlessIABConsentUIResult, useHeadlessIABConsentUI, } from './hooks/use-headless-iab-consent-ui';
19
16
  export { useSSRStatus } from './hooks/use-ssr-status';
20
17
  export { useTranslations } from './hooks/use-translations';
21
18
  export { ConsentManagerProvider } from './providers/consent-manager-provider';
@@ -0,0 +1 @@
1
+ export * from '../components/shared/ui/accordion';
@@ -0,0 +1 @@
1
+ export * from '../components/shared/ui/button';
@@ -0,0 +1 @@
1
+ export * from '../components/shared/ui/collapsible';
@@ -0,0 +1 @@
1
+ export * from '../components/shared/ui/dialog';
@@ -0,0 +1 @@
1
+ export * from '../components/shared/ui/preference-item';
@@ -0,0 +1 @@
1
+ export * from '../components/shared/ui/switch';
@@ -0,0 +1 @@
1
+ export * from '../components/shared/ui/tabs';
@@ -0,0 +1,7 @@
1
+ export * as Accordion from './components/shared/ui/accordion';
2
+ export * as Button from './components/shared/ui/button';
3
+ export * as Collapsible from './components/shared/ui/collapsible';
4
+ export * as Dialog from './components/shared/ui/dialog';
5
+ export * as PreferenceItem from './components/shared/ui/preference-item';
6
+ export * as Switch from './components/shared/ui/switch';
7
+ export * as Tabs from './components/shared/ui/tabs';
@@ -1 +1 @@
1
- export declare const version = "2.0.0-rc.5";
1
+ export declare const version = "2.0.0-rc.6";
@@ -6,7 +6,7 @@ Building headless components is easier now because c15t exposes policy-aware pri
6
6
 
7
7
  The headless stack is:
8
8
 
9
- * `useHeadlessConsentUI()` for policy-aware banner/dialog actions, ordering, layout, and primary action hints
9
+ * `useHeadlessConsentUI()` for policy-aware banner/dialog actions, ordering, layout, and primary actions hints
10
10
  * `useConsentManager()` for runtime state, categories, selected consent state, and policy metadata
11
11
  * `useTranslations()` for the resolved copy
12
12
  * `offlinePolicy.policyPacks` for offline previews that behave like backend policy resolution
@@ -24,7 +24,7 @@ The main win is that your custom UI can stay aligned with policy packs without d
24
24
  * the order those actions should render in
25
25
  * grouped actions from policy `layout`
26
26
  * layout `direction` (`row` or `column`)
27
- * the primary action
27
+ * the primary actions
28
28
  * UI profile and scroll-lock hints
29
29
  * whether the banner or dialog should currently be visible
30
30
 
@@ -88,7 +88,7 @@ export function CustomConsentBanner() {
88
88
  <button
89
89
  key={action}
90
90
  type="button"
91
- className={action === banner.primaryAction ? 'btn-primary' : 'btn-secondary'}
91
+ className={banner.primaryActions.includes(action) ? 'btn-primary' : 'btn-secondary'}
92
92
  onClick={() => {
93
93
  if (action === 'customize') {
94
94
  openDialog();
@@ -197,7 +197,7 @@ When you build custom banner or dialog components, make sure they use:
197
197
 
198
198
  * `activeUI` or `banner.isVisible` / `dialog.isVisible` for visibility
199
199
  * `allowedActions`, `orderedActions`, or `actionGroups` instead of hard-coding buttons
200
- * `primaryAction` for visual emphasis
200
+ * `primaryActions` for visual emphasis
201
201
  * `consentCategories` when deciding which category toggles to render
202
202
  * `policyDecision` when you want to debug why a specific UI state was chosen
203
203
 
@@ -146,6 +146,7 @@ IAB TCF 2.3 configuration.
146
146
  |Property|Type|Description|Default|Required|
147
147
  |:--|:--|:--|:--|:--:|
148
148
  |enabled|boolean|Enable IAB TCF 2.3 mode. Note: Only works in 'hosted' client mode (legacy alias: 'c15t') because it requires a backend. Options: Fetch GVL from gvl.consent.io; Initialize \_\_tcfapi CMP API; Generate TC Strings for IAB compliance|-|✅ Required|
149
+ |\_module|IABModule \|undefined|IAB runtime module injected by \`@c15t/iab\`.|-|Optional|
149
150
  |cmpId|number \|undefined|CMP ID registered with IAB Europe. When using consent.io as the backend, this is automatically provided via the \`/init\` endpoint — no client-side configuration needed. Only set this if you self-host and have your own CMP registration. A valid (non-zero) CMP ID is required for IAB TCF compliance.|-|Optional|
150
151
  |cmpVersion|string \|number \|undefined|CMP version. When omitted, defaults to package version from \`\~/cmp-defaults\` (which uses \~/version).|-|Optional|
151
152
  |vendors|number\[] \|undefined|IAB-registered vendor IDs to include (optional). Used to scope the vendor list when fetching GVL or when hosted fallback paths are used (e.g. if GVL fetch fails).|-|Optional|
@@ -47,7 +47,7 @@ ui: {
47
47
  allowedActions: ['reject', 'accept', 'customize'],
48
48
  layout: [['reject', 'accept'], 'customize'],
49
49
  direction: 'row',
50
- primaryAction: 'customize',
50
+ primaryActions: ['accept', 'customize'],
51
51
  },
52
52
  }
53
53
  ```
@@ -130,7 +130,7 @@ Policy-driven UI hints for the consent banner surface.
130
130
  |Property|Type|Description|Default|Required|
131
131
  |:--|:--|:--|:--|:--:|
132
132
  |allowedActions|PolicyUiAction \|undefined|Allowed actions for this surface derived from backend runtime policy.|-|Optional|
133
- |primaryAction|PolicyUiAction \|undefined|Preferred primary action hint from backend runtime policy.|-|Optional|
133
+ |primaryActions|PolicyUiAction \|undefined|Preferred primary action hints from backend runtime policy.|-|Optional|
134
134
  |layout|PolicyUiActionGroup \|undefined|Explicit grouped action layout hint from backend runtime policy.|-|Optional|
135
135
  |direction|PolicyUiActionDirection \|undefined|Direction hint for the grouped action layout.|-|Optional|
136
136
  |uiProfile|PolicyUiProfile \|undefined|Presentation profile hint from backend runtime policy.|-|Optional|
@@ -143,7 +143,7 @@ Policy-driven UI hints for the consent dialog surface.
143
143
  |Property|Type|Description|Default|Required|
144
144
  |:--|:--|:--|:--|:--:|
145
145
  |allowedActions|PolicyUiAction \|undefined|Allowed actions for this surface derived from backend runtime policy.|-|Optional|
146
- |primaryAction|PolicyUiAction \|undefined|Preferred primary action hint from backend runtime policy.|-|Optional|
146
+ |primaryActions|PolicyUiAction \|undefined|Preferred primary action hints from backend runtime policy.|-|Optional|
147
147
  |layout|PolicyUiActionGroup \|undefined|Explicit grouped action layout hint from backend runtime policy.|-|Optional|
148
148
  |direction|PolicyUiActionDirection \|undefined|Direction hint for the grouped action layout.|-|Optional|
149
149
  |uiProfile|PolicyUiProfile \|undefined|Presentation profile hint from backend runtime policy.|-|Optional|
@@ -45,6 +45,7 @@ The returned `Translations` object has these sections:
45
45
  |rejectAll|string \|undefined|-|-|✅ Required|
46
46
  |customize|string \|undefined|-|-|✅ Required|
47
47
  |save|string \|undefined|-|-|✅ Required|
48
+ |close|string \|undefined|-|-|✅ Required|
48
49
 
49
50
  #### `cookieBanner` CookieBannerTranslations
50
51
 
@@ -33,7 +33,17 @@ availableIn:
33
33
  |yarn|`yarn add @c15t/react`|
34
34
  |bun|`bun add @c15t/react`|
35
35
 
36
- 2. **Create ConsentManager components** Create a provider component with the consent UI and a wrapper that re-exports it. This initializes the consent store and makes consent state available to all child components.
36
+ 2. **Import styles** Import the prebuilt component stylesheet at the root of your application. This is required for styled components to render correctly.
37
+
38
+ ```tsx
39
+ import '@c15t/react/styles.css';
40
+ ```
41
+
42
+ > ℹ️ Info:
43
+ >
44
+ > If you are using the headless API or fully custom styling, you can skip this import.
45
+
46
+ 3. **Create ConsentManager components** Create a provider component with the consent UI and a wrapper that re-exports it. This initializes the consent store and makes consent state available to all child components.
37
47
 
38
48
  ```tsx
39
49
  'use client';
@@ -73,7 +83,7 @@ availableIn:
73
83
  >
74
84
  > Don't have a backend yet? You can use mode: 'offline' for local-only consent storage, but review the browser-only storage consequences before choosing it for production.
75
85
 
76
- 3. **Mount ConsentManager at the app root** Wrap your existing app tree with ConsentManager so all routes/components can access consent state.
86
+ 4. **Mount ConsentManager at the app root** Wrap your existing app tree with ConsentManager so all routes/components can access consent state.
77
87
 
78
88
  ```tsx
79
89
  import { ConsentManager } from './components/consent-manager';
@@ -87,7 +97,7 @@ availableIn:
87
97
  }
88
98
  ```
89
99
 
90
- 4. **Verify it works** Start your development server and confirm:
100
+ 5. **Verify it works** Start your development server and confirm:
91
101
 
92
102
  A consent banner appears at the bottom of the pageClicking "Customize" opens a dialog with toggles for each consent categoryAfter accepting or rejecting, the banner dismisses and your choice persists across page reloads
93
103
 
@@ -6,19 +6,48 @@ c15t works with Tailwind CSS out of the box. Use the `slots` theme option to app
6
6
 
7
7
  ## Setup
8
8
 
9
+ Import the standard c15t stylesheet once at the root of your app:
10
+
11
+ ```tsx
12
+ // React
13
+ import '@c15t/react/styles.css';
14
+
15
+ // Next.js
16
+ import '@c15t/nextjs/styles.css';
17
+ ```
18
+
9
19
  ### Tailwind v4
10
20
 
11
- No additional configuration needed. Tailwind v4 automatically scans your source files.
21
+ Tailwind v4 automatically scans your source files. Declare c15t's layer order once in your global CSS so utilities stay last:
22
+
23
+ ```css
24
+ @layer theme, base, components, c15t, utilities;
25
+ @import "tailwindcss";
26
+ ```
12
27
 
13
28
  ### Tailwind v3
14
29
 
15
- Add c15t's component paths to your `content` array:
30
+ Keep Tailwind's directives in your app stylesheet, but wrap `@tailwind base` in a native `base` layer so c15t's `@layer c15t` rules can sit above Preflight:
31
+
32
+ ```css title="app/globals.css"
33
+ @layer base, components, c15t;
34
+
35
+ @layer base {
36
+ @tailwind base;
37
+ }
38
+
39
+ @tailwind components;
40
+ @tailwind utilities;
41
+ ```
42
+
43
+ Then add c15t's component paths to your `content` array:
16
44
 
17
45
  ```js title="tailwind.config.js"
18
46
  module.exports = {
19
47
  content: [
20
48
  './src/**/*.{js,ts,jsx,tsx}',
21
49
  './node_modules/@c15t/react/**/*.{js,mjs}',
50
+ './node_modules/@c15t/nextjs/**/*.{js,mjs}',
22
51
  ],
23
52
  };
24
53
  ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@c15t/react",
3
- "version": "2.0.0-rc.5",
3
+ "version": "2.0.0-rc.6",
4
4
  "description": "Developer-first CMP for React: cookie banner, consent manager, preferences centre. GDPR ready with minimal setup and rich customization",
5
5
  "keywords": [
6
6
  "react",
@@ -26,9 +26,23 @@
26
26
  "directory": "packages/react"
27
27
  },
28
28
  "license": "GPL-3.0-only",
29
- "sideEffects": false,
29
+ "sideEffects": [
30
+ "**/*.css"
31
+ ],
30
32
  "type": "module",
31
33
  "exports": {
34
+ "./styles.css": "./dist/styles.css",
35
+ "./iab/styles.css": "./dist/iab/styles.css",
36
+ "./primitives": {
37
+ "types": "./dist/primitives.d.ts",
38
+ "import": "./dist/primitives.js",
39
+ "require": "./dist/primitives.cjs"
40
+ },
41
+ "./primitives/*": {
42
+ "types": "./dist/primitives/*.d.ts",
43
+ "import": "./dist/primitives/*.js",
44
+ "require": "./dist/primitives/*.cjs"
45
+ },
32
46
  "./server": {
33
47
  "types": "./dist-types/server/index.d.ts",
34
48
  "import": "./dist/server/index.js",
@@ -84,15 +98,10 @@
84
98
  "import": "./client/components/frame.js",
85
99
  "require": "./dist/components/frame/index.cjs"
86
100
  },
87
- "./components/iab-consent-banner": {
88
- "types": "./dist-types/components/iab-consent-banner/index.d.ts",
89
- "import": "./client/components/iab-consent-banner.js",
90
- "require": "./dist/components/iab-consent-banner/index.cjs"
91
- },
92
- "./components/iab-consent-dialog": {
93
- "types": "./dist-types/components/iab-consent-dialog/index.d.ts",
94
- "import": "./client/components/iab-consent-dialog.js",
95
- "require": "./dist/components/iab-consent-dialog/index.cjs"
101
+ "./iab": {
102
+ "types": "./dist-types/iab.d.ts",
103
+ "import": "./dist/iab.js",
104
+ "require": "./dist/iab.cjs"
96
105
  },
97
106
  "./hooks": {
98
107
  "types": "./dist-types/hooks/index.d.ts",
@@ -149,19 +158,18 @@
149
158
  "not op_mini all"
150
159
  ],
151
160
  "dependencies": {
152
- "@c15t/ui": "2.0.0-rc.5",
153
- "@radix-ui/react-accordion": "1.2.12",
154
- "@radix-ui/react-slot": "1.2.4",
155
- "@radix-ui/react-switch": "1.2.6",
156
- "c15t": "2.0.0-rc.5",
161
+ "@c15t/ui": "2.0.0-rc.6",
162
+ "c15t": "2.0.0-rc.6",
157
163
  "clsx": "2.1.1"
158
164
  },
159
165
  "devDependencies": {
160
- "@c15t/backend": "2.0.0-rc.5",
166
+ "@c15t/backend": "2.0.0-rc.6",
167
+ "@c15t/iab": "2.0.0-rc.6",
161
168
  "@c15t/typescript-config": "0.0.1-beta.1",
162
169
  "@c15t/vitest-config": "1.0.0",
170
+ "@iabtechlabtcf/core": "^1.5.20",
163
171
  "genversion": "3.2.0",
164
- "msw": "^2.12.7"
172
+ "msw": "^2.12.14"
165
173
  },
166
174
  "peerDependencies": {
167
175
  "react": "^19.0.0 || ^19.0.0-rc || ^18.0.0 || ^17.0.0 || ^16.8.0",
@@ -1,4 +0,0 @@
1
- 'use client';
2
-
3
- export * from '../../dist/components/iab-consent-banner/index.js';
4
- export { default } from '../../dist/components/iab-consent-banner/index.js';
@@ -1,4 +0,0 @@
1
- 'use client';
2
-
3
- export * from '../../dist/components/iab-consent-dialog/index.js';
4
- export { default } from '../../dist/components/iab-consent-dialog/index.js';