@c15t/react 3.0.0-alpha.0 → 3.0.0-alpha.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.
- package/AGENTS.md +4 -1
- package/dist/aggregate-components.js +1 -1
- package/dist/component-hooks/use-manager.js +1 -1
- package/dist/components/consent-gate/atoms.js +1 -0
- package/dist/components/consent-gate/consent-gate.js +2 -0
- package/dist/components/consent-gate/index.js +2 -0
- package/dist/components/preferences/atoms/accordion.js +1 -1
- package/dist/components/preferences/atoms/vendor-list.js +1 -0
- package/dist/components/preferences/index.js +1 -1
- package/dist/consent-gate.js +2 -0
- package/dist/draft.js +1 -1
- package/dist/external-iab-context.js +1 -1
- package/dist/hooks.js +1 -1
- package/dist/iab/styles.tw3.css +4 -110
- package/dist/index.js +1 -1
- package/dist/provider.js +1 -1
- package/dist/styles.tw3.css +10 -113
- package/dist/utils/deferred-module.js +2 -0
- package/dist/version.js +1 -1
- package/dist-types/aggregate-components.d.ts +2 -2
- package/dist-types/component-hooks/use-headless-iab-consent-ui.d.ts +1 -1
- package/dist-types/component-hooks/use-manager.d.ts +6 -1
- package/dist-types/components/consent-gate/atoms.d.ts +11 -0
- package/dist-types/components/consent-gate/consent-gate.d.ts +2 -0
- package/dist-types/components/consent-gate/index.d.ts +41 -0
- package/dist-types/components/{frame → consent-gate}/types.d.ts +7 -7
- package/dist-types/components/consent-preferences-link/consent-preferences-link.d.ts +1 -1
- package/dist-types/components/consent-preferences-link/index.d.ts +1 -1
- package/dist-types/components/iab-panel/atoms/purpose-item.d.ts +1 -1
- package/dist-types/components/iab-panel/atoms/stack-item.d.ts +1 -1
- package/dist-types/components/iab-panel/atoms/vendor-list.d.ts +1 -1
- package/dist-types/components/iab-panel/iab-panel.d.ts +1 -1
- package/dist-types/components/iab-panel/index.d.ts +24 -24
- package/dist-types/components/iab-prompt/index.d.ts +17 -17
- package/dist-types/components/panel/atoms/card.d.ts +4 -4
- package/dist-types/components/panel/atoms/overlay.d.ts +1 -1
- package/dist-types/components/panel/index.d.ts +7 -7
- package/dist-types/components/panel/panel.d.ts +2 -2
- package/dist-types/components/panel-link/index.d.ts +1 -1
- package/dist-types/components/panel-trigger/atoms/button.d.ts +1 -1
- package/dist-types/components/panel-trigger/atoms/icon.d.ts +1 -1
- package/dist-types/components/panel-trigger/atoms/root.d.ts +2 -2
- package/dist-types/components/panel-trigger/atoms/toolbar.d.ts +2 -2
- package/dist-types/components/panel-trigger/index.d.ts +4 -4
- package/dist-types/components/panel-trigger/panel-trigger-toolbar.d.ts +1 -1
- package/dist-types/components/panel-trigger/panel-trigger.d.ts +9 -9
- package/dist-types/components/panel-trigger/types.d.ts +1 -1
- package/dist-types/components/preferences/atoms/accordion.d.ts +6 -4
- package/dist-types/components/preferences/atoms/button.d.ts +1 -1
- package/dist-types/components/preferences/atoms/footer.d.ts +1 -1
- package/dist-types/components/preferences/atoms/root.d.ts +1 -1
- package/dist-types/components/preferences/atoms/vendor-list.d.ts +23 -0
- package/dist-types/components/preferences/index.d.ts +13 -11
- package/dist-types/components/preferences/policy-actions.d.ts +2 -2
- package/dist-types/components/preferences/preferences.d.ts +1 -1
- package/dist-types/components/preferences/types.d.ts +1 -1
- package/dist-types/components/prompt/components.d.ts +3 -3
- package/dist-types/components/prompt/index.d.ts +11 -11
- package/dist-types/components/prompt/policy-actions.d.ts +2 -2
- package/dist-types/components/prompt/prompt.d.ts +1 -1
- package/dist-types/components/shared/policy-actions.d.ts +2 -2
- package/dist-types/components/shared/primitives/box.d.ts +1 -1
- package/dist-types/components/shared/primitives/button.d.ts +2 -2
- package/dist-types/components/shared/primitives/button.types.d.ts +1 -1
- package/dist-types/components/shared/ui/accordion/accordion.d.ts +2 -2
- package/dist-types/components/shared/ui/accordion/index.d.ts +2 -2
- package/dist-types/components/shared/ui/animated-collapse/index.d.ts +2 -2
- package/dist-types/components/shared/ui/branding.d.ts +1 -1
- package/dist-types/components/shared/ui/button/button.d.ts +1 -1
- package/dist-types/components/shared/ui/button/index.d.ts +2 -2
- package/dist-types/components/shared/ui/collapsible/index.d.ts +1 -1
- package/dist-types/components/shared/ui/dialog/index.d.ts +1 -1
- package/dist-types/components/shared/ui/preference-item/index.d.ts +1 -1
- package/dist-types/components/shared/ui/switch/index.d.ts +2 -2
- package/dist-types/components/shared/ui/switch/switch.d.ts +1 -1
- package/dist-types/components/shared/ui/tabs/index.d.ts +1 -1
- package/dist-types/consent-gate.d.ts +1 -0
- package/dist-types/context/index.d.ts +3 -3
- package/dist-types/context/theme-context.d.ts +1 -1
- package/dist-types/draft.d.ts +53 -1
- package/dist-types/headless.d.ts +7 -7
- package/dist-types/hooks/use-headless-iab-consent-ui.d.ts +1 -1
- package/dist-types/hooks/use-iab-manager.d.ts +1 -1
- package/dist-types/hooks/use-theme.d.ts +1 -1
- package/dist-types/hooks.d.ts +28 -1
- package/dist-types/iab.d.ts +5 -5
- package/dist-types/index.d.ts +25 -25
- package/dist-types/module-hooks.d.ts +4 -4
- package/dist-types/panel-link.d.ts +1 -1
- package/dist-types/panel-trigger.d.ts +1 -1
- package/dist-types/panel.d.ts +1 -1
- package/dist-types/preferences.d.ts +1 -1
- package/dist-types/primitives/accordion.d.ts +1 -1
- package/dist-types/primitives/button.d.ts +1 -1
- package/dist-types/primitives/collapsible.d.ts +1 -1
- package/dist-types/primitives/dialog.d.ts +1 -1
- package/dist-types/primitives/preference-item.d.ts +1 -1
- package/dist-types/primitives/switch.d.ts +1 -1
- package/dist-types/primitives/tabs.d.ts +1 -1
- package/dist-types/primitives.d.ts +7 -7
- package/dist-types/prompt.d.ts +1 -1
- package/dist-types/provider.d.ts +27 -5
- package/dist-types/server/fetch-ssr-data.d.ts +1 -1
- package/dist-types/server/index.d.ts +5 -5
- package/dist-types/theme-provider.d.ts +2 -2
- package/dist-types/types/index.d.ts +3 -3
- package/dist-types/types/manager.d.ts +1 -1
- package/dist-types/types/theme/index.d.ts +1 -1
- package/dist-types/ui-config-context.d.ts +1 -1
- package/dist-types/utils/deferred-module.d.ts +11 -0
- package/dist-types/utils/index.d.ts +4 -4
- package/dist-types/utils/merge-slot-props.d.ts +2 -2
- package/dist-types/utils/merge-styles.d.ts +1 -1
- package/dist-types/utils/theme-utils.d.ts +1 -1
- package/dist-types/version.d.ts +1 -1
- package/docs/README.md +4 -1
- package/docs/frameworks/react/components/consent-dialog.md +1 -1
- package/docs/frameworks/react/components/{frame.md → consent-gate.md} +27 -27
- package/docs/frameworks/react/components/consent-manager-provider.md +14 -1
- package/docs/frameworks/react/components/consent-widget.md +39 -6
- package/docs/frameworks/react/concepts/consent-categories.md +31 -2
- package/docs/frameworks/react/script-loader.md +8 -0
- package/docs/frameworks/react/styling/overview.md +10 -0
- package/docs/guides/deployment-modes.md +12 -0
- package/docs/integrations/building-integrations.md +5 -0
- package/docs/integrations/clear-on-revocation.md +167 -0
- package/docs/integrations/cloudflare-zaraz.md +399 -0
- package/docs/integrations/google-maps.md +20 -20
- package/docs/integrations/granular-consent.md +208 -0
- package/docs/integrations/overview.md +5 -4
- package/docs/integrations/youtube.md +26 -21
- package/docs/upgrade-v3.md +47 -0
- package/package.json +26 -16
- package/dist/components/frame/atoms.js +0 -1
- package/dist/components/frame/frame.js +0 -2
- package/dist/components/frame/index.js +0 -2
- package/dist/frame.js +0 -2
- package/dist-types/components/frame/atoms.d.ts +0 -11
- package/dist-types/components/frame/frame.d.ts +0 -2
- package/dist-types/components/frame/index.d.ts +0 -24
- package/dist-types/frame.d.ts +0 -1
- package/readme.json +0 -48
- package/src/iab/styles.css +0 -11
- package/src/styles.css +0 -10
- /package/dist/components/{frame → consent-gate}/types.js +0 -0
|
@@ -7,10 +7,10 @@
|
|
|
7
7
|
* of the dialog's parts.
|
|
8
8
|
*/
|
|
9
9
|
import type { FC } from 'react';
|
|
10
|
-
import { Card, ConsentCustomizationCard, ConsentDialogContent, ConsentDialogFooter, ConsentDialogHeader, ConsentDialogHeaderDescription, ConsentDialogHeaderTitle, Content, Footer, Header, HeaderDescription, HeaderTitle } from './atoms/card';
|
|
11
|
-
import { Overlay } from './atoms/overlay';
|
|
12
|
-
import { Root } from './atoms/root';
|
|
13
|
-
import type { ConsentDialogProps } from './panel';
|
|
10
|
+
import { Card, ConsentCustomizationCard, ConsentDialogContent, ConsentDialogFooter, ConsentDialogHeader, ConsentDialogHeaderDescription, ConsentDialogHeaderTitle, Content, Footer, Header, HeaderDescription, HeaderTitle } from './atoms/card.js';
|
|
11
|
+
import { Overlay } from './atoms/overlay.js';
|
|
12
|
+
import { Root } from './atoms/root.js';
|
|
13
|
+
import type { ConsentDialogProps } from './panel.js';
|
|
14
14
|
export type { ConsentDialogProps };
|
|
15
15
|
/**
|
|
16
16
|
* This interface extends the base ConsentDialog component with additional sub-components
|
|
@@ -98,7 +98,7 @@ export interface ConsentDialogCompoundComponent extends FC<ConsentDialogProps> {
|
|
|
98
98
|
*/
|
|
99
99
|
declare const ConsentDialog: ConsentDialogCompoundComponent;
|
|
100
100
|
export default ConsentDialog;
|
|
101
|
-
export { Card, ConsentCustomizationCard, ConsentDialogContent, ConsentDialogFooter, ConsentDialogHeader, ConsentDialogHeaderDescription, ConsentDialogHeaderTitle, Content, Footer, Header, HeaderDescription, HeaderTitle, } from './atoms/card';
|
|
102
|
-
export { ConsentDialogOverlay, Overlay } from './atoms/overlay';
|
|
103
|
-
export { ConsentDialogRoot, Root } from './atoms/root';
|
|
101
|
+
export { Card, ConsentCustomizationCard, ConsentDialogContent, ConsentDialogFooter, ConsentDialogHeader, ConsentDialogHeaderDescription, ConsentDialogHeaderTitle, Content, Footer, Header, HeaderDescription, HeaderTitle, } from './atoms/card.js';
|
|
102
|
+
export { ConsentDialogOverlay, Overlay } from './atoms/overlay.js';
|
|
103
|
+
export { ConsentDialogRoot, Root } from './atoms/root.js';
|
|
104
104
|
export { ConsentDialog };
|
|
@@ -8,8 +8,8 @@ import type * as C15tCoreTypes from '@c15t/core';
|
|
|
8
8
|
* prefer a one-line `<ConsentDialog />` usage still have it.
|
|
9
9
|
*/
|
|
10
10
|
import type { FC } from 'react';
|
|
11
|
-
import type { ConsentDialogTriggerProps } from '../panel-trigger';
|
|
12
|
-
import type { InlineLegalLinksProps } from '../shared/primitives/legal-links';
|
|
11
|
+
import type { ConsentDialogTriggerProps } from '../panel-trigger/index.js';
|
|
12
|
+
import type { InlineLegalLinksProps } from '../shared/primitives/legal-links/index.js';
|
|
13
13
|
/**
|
|
14
14
|
* Props for the `<ConsentDialog />` convenience component.
|
|
15
15
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { ConsentDialogLink, type ConsentDialogLinkProps, } from '../consent-preferences-link/consent-preferences-link';
|
|
1
|
+
export { ConsentDialogLink, type ConsentDialogLinkProps, } from '../consent-preferences-link/consent-preferences-link.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
|
-
import type { CornerPosition, TriggerVisibility } from '../types';
|
|
3
|
-
import type { UseDraggableReturn } from '../use-draggable';
|
|
2
|
+
import type { CornerPosition, TriggerVisibility } from '../types.js';
|
|
3
|
+
import type { UseDraggableReturn } from '../use-draggable.js';
|
|
4
4
|
/**
|
|
5
5
|
* Context value for the ConsentDialogTrigger compound component.
|
|
6
6
|
*/
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import type { PolicyRight } from '@c15t/schema/types';
|
|
7
7
|
import type { ReactNode } from 'react';
|
|
8
|
-
import type { ClassNameStyle } from '../../../types/theme';
|
|
9
|
-
import type { ConsentDialogTriggerToolbarAction, ConsentDialogTriggerToolbarPreferences, TriggerOrientation, TriggerSize } from '../types';
|
|
8
|
+
import type { ClassNameStyle } from '../../../types/theme/index.js';
|
|
9
|
+
import type { ConsentDialogTriggerToolbarAction, ConsentDialogTriggerToolbarPreferences, TriggerOrientation, TriggerSize } from '../types.js';
|
|
10
10
|
/** Right the built-in action stands for; opt-out wins when the rule carries it. */
|
|
11
11
|
export type ToolbarPreferencesRight = Extract<PolicyRight, 'opt-out' | 'preferences'>;
|
|
12
12
|
export interface TriggerToolbarProps extends Omit<ClassNameStyle, 'baseClassName'> {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @packageDocumentation
|
|
5
5
|
*/
|
|
6
|
-
export { ConsentDialogTrigger, type ConsentDialogTriggerCompound, TriggerButton, type TriggerButtonProps, TriggerIcon, type TriggerIconProps, TriggerRoot, type TriggerRootProps, TriggerText, type TriggerTextProps, useTriggerContext, } from './panel-trigger';
|
|
7
|
-
export { ConsentDialogTriggerToolbar } from './panel-trigger-toolbar';
|
|
8
|
-
export type { ConsentDialogTriggerProps, ConsentDialogTriggerToolbarAction, ConsentDialogTriggerToolbarPreferences, ConsentDialogTriggerToolbarProps, CornerPosition, TriggerIcon as TriggerIconType, TriggerOrientation, TriggerSize, TriggerVisibility, } from './types';
|
|
9
|
-
export { type UseDraggableOptions, type UseDraggableReturn, useDraggable, } from './use-draggable';
|
|
6
|
+
export { ConsentDialogTrigger, type ConsentDialogTriggerCompound, TriggerButton, type TriggerButtonProps, TriggerIcon, type TriggerIconProps, TriggerRoot, type TriggerRootProps, TriggerText, type TriggerTextProps, useTriggerContext, } from './panel-trigger.js';
|
|
7
|
+
export { ConsentDialogTriggerToolbar } from './panel-trigger-toolbar.js';
|
|
8
|
+
export type { ConsentDialogTriggerProps, ConsentDialogTriggerToolbarAction, ConsentDialogTriggerToolbarPreferences, ConsentDialogTriggerToolbarProps, CornerPosition, TriggerIcon as TriggerIconType, TriggerOrientation, TriggerSize, TriggerVisibility, } from './types.js';
|
|
9
|
+
export { type UseDraggableOptions, type UseDraggableReturn, useDraggable, } from './use-draggable.js';
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* @packageDocumentation
|
|
6
6
|
*/
|
|
7
7
|
import type { ReactNode } from 'react';
|
|
8
|
-
import type { ConsentDialogTriggerToolbarProps } from './types';
|
|
8
|
+
import type { ConsentDialogTriggerToolbarProps } from './types.js';
|
|
9
9
|
export declare function ConsentDialogTriggerToolbar({ actions, preferences, orientation, defaultPosition, persistPosition, ariaLabel, showWhen, size, className, style, noStyle, onPositionChange, }: ConsentDialogTriggerToolbarProps): ReactNode;
|
|
10
10
|
export declare namespace ConsentDialogTriggerToolbar {
|
|
11
11
|
var displayName: string;
|
|
@@ -7,15 +7,15 @@
|
|
|
7
7
|
* @packageDocumentation
|
|
8
8
|
*/
|
|
9
9
|
import type { FC } from 'react';
|
|
10
|
-
import { TriggerButton } from './atoms/button';
|
|
11
|
-
import type { TriggerButtonProps } from './atoms/button';
|
|
12
|
-
import { TriggerIcon } from './atoms/icon';
|
|
13
|
-
import type { TriggerIconProps } from './atoms/icon';
|
|
14
|
-
import { TriggerRoot, useTriggerContext } from './atoms/root';
|
|
15
|
-
import type { TriggerRootProps } from './atoms/root';
|
|
16
|
-
import { TriggerText } from './atoms/text';
|
|
17
|
-
import type { TriggerTextProps } from './atoms/text';
|
|
18
|
-
import type { ConsentDialogTriggerProps } from './types';
|
|
10
|
+
import { TriggerButton } from './atoms/button.js';
|
|
11
|
+
import type { TriggerButtonProps } from './atoms/button.js';
|
|
12
|
+
import { TriggerIcon } from './atoms/icon.js';
|
|
13
|
+
import type { TriggerIconProps } from './atoms/icon.js';
|
|
14
|
+
import { TriggerRoot, useTriggerContext } from './atoms/root.js';
|
|
15
|
+
import type { TriggerRootProps } from './atoms/root.js';
|
|
16
|
+
import { TriggerText } from './atoms/text.js';
|
|
17
|
+
import type { TriggerTextProps } from './atoms/text.js';
|
|
18
|
+
import type { ConsentDialogTriggerProps } from './types.js';
|
|
19
19
|
/**
|
|
20
20
|
* Compound component interface for ConsentDialogTrigger.
|
|
21
21
|
*/
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import type { CornerPosition } from '@c15t/ui/utils/trigger-utils';
|
|
7
7
|
import type { ReactNode } from 'react';
|
|
8
|
-
import type { ClassNameStyle } from '../../types/theme';
|
|
8
|
+
import type { ClassNameStyle } from '../../types/theme/index.js';
|
|
9
9
|
/**
|
|
10
10
|
* Icon rendered by a consent dialog trigger control.
|
|
11
11
|
*
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
|
-
import type { BoxProps } from '../../shared/primitives/box';
|
|
3
|
-
import * as PreferenceItem from '../../shared/ui/preference-item';
|
|
4
|
-
import * as RadixSwitch from '../../shared/ui/switch';
|
|
2
|
+
import type { BoxProps } from '../../shared/primitives/box.js';
|
|
3
|
+
import * as PreferenceItem from '../../shared/ui/preference-item/index.js';
|
|
4
|
+
import * as RadixSwitch from '../../shared/ui/switch/index.js';
|
|
5
|
+
import { ConsentWidgetVendorList } from './vendor-list.js';
|
|
5
6
|
declare const ConsentWidgetAccordionTrigger: import("react").ForwardRefExoticComponent<BoxProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
6
7
|
declare const ConsentWidgetAccordionTriggerInner: import("react").ForwardRefExoticComponent<PreferenceItem.PreferenceItemTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
7
8
|
declare const ConsentWidgetAccordionContent: import("react").ForwardRefExoticComponent<PreferenceItem.PreferenceItemContentProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -25,4 +26,5 @@ declare const Accordion: typeof ConsentWidgetAccordion;
|
|
|
25
26
|
declare const Switch: import("react").ForwardRefExoticComponent<RadixSwitch.SwitchProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
26
27
|
declare const AccordionItems: typeof ConsentWidgetAccordionItems;
|
|
27
28
|
declare const AccordionItem: import("react").ForwardRefExoticComponent<Omit<PreferenceItem.PreferenceItemRootProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
28
|
-
|
|
29
|
+
declare const VendorList: typeof ConsentWidgetVendorList;
|
|
30
|
+
export { ConsentWidgetVendorList, VendorList, Accordion, AccordionArrow, AccordionContent, AccordionItem, AccordionItems, AccordionTrigger, AccordionTriggerInner, ConsentWidgetAccordion, ConsentWidgetAccordionArrow, ConsentWidgetAccordionContent, ConsentWidgetAccordionItem, ConsentWidgetAccordionItems, ConsentWidgetAccordionTrigger, ConsentWidgetAccordionTriggerInner, ConsentWidgetSwitch, Switch, };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { AllConsentNames } from '@c15t/core';
|
|
2
|
+
import type { BoxProps } from '../../shared/primitives/box.js';
|
|
3
|
+
export interface ConsentWidgetVendorListProps extends Omit<BoxProps, 'children' | 'slotKey'> {
|
|
4
|
+
/** Category whose vendors to list. */
|
|
5
|
+
category: AllConsentNames;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Vendor rows nested inside one category's accordion content, each a
|
|
9
|
+
* collapsed card of its own that opens for its description and privacy
|
|
10
|
+
* policy link. A long list stays one line per vendor.
|
|
11
|
+
*
|
|
12
|
+
* Renders nothing when the category has no presentable vendor or the model
|
|
13
|
+
* is `iab`. Each row's switch stages a per-vendor grant on the same draft
|
|
14
|
+
* the category switches use; nothing is recorded until Save. While the
|
|
15
|
+
* parent category is off in the draft, the vendor switches are disabled: a
|
|
16
|
+
* vendor toggle never grants a category on its own. A `disabled` vendor is
|
|
17
|
+
* listed without a switch.
|
|
18
|
+
*
|
|
19
|
+
* @param props - The category whose vendors to list, plus `Box` attributes.
|
|
20
|
+
* @returns The vendor list, or `null` when there is nothing to list.
|
|
21
|
+
* @public
|
|
22
|
+
*/
|
|
23
|
+
export declare const ConsentWidgetVendorList: ({ category, className, noStyle, ...props }: ConsentWidgetVendorListProps) => import("react").JSX.Element | null;
|
|
@@ -8,12 +8,12 @@
|
|
|
8
8
|
*
|
|
9
9
|
*/
|
|
10
10
|
import type { FC } from 'react';
|
|
11
|
-
import { Accordion, AccordionArrow, AccordionContent, AccordionItem, AccordionItems, AccordionTrigger, AccordionTriggerInner, Switch } from './atoms/accordion';
|
|
12
|
-
import { AcceptAllButton, CustomizeButton, RejectButton, SaveButton } from './atoms/button';
|
|
13
|
-
import { Footer, FooterSubGroup } from './atoms/footer';
|
|
14
|
-
import { Root } from './atoms/root';
|
|
15
|
-
import { PolicyActions } from './policy-actions';
|
|
16
|
-
import type { ConsentWidgetProps } from './types';
|
|
11
|
+
import { Accordion, AccordionArrow, AccordionContent, AccordionItem, AccordionItems, AccordionTrigger, AccordionTriggerInner, Switch, VendorList } from './atoms/accordion.js';
|
|
12
|
+
import { AcceptAllButton, CustomizeButton, RejectButton, SaveButton } from './atoms/button.js';
|
|
13
|
+
import { Footer, FooterSubGroup } from './atoms/footer.js';
|
|
14
|
+
import { Root } from './atoms/root.js';
|
|
15
|
+
import { PolicyActions } from './policy-actions.js';
|
|
16
|
+
import type { ConsentWidgetProps } from './types.js';
|
|
17
17
|
export type { ConsentWidgetProps };
|
|
18
18
|
/**
|
|
19
19
|
* This interface extends the base ConsentWidget component with additional sub-components
|
|
@@ -31,6 +31,8 @@ export interface ConsentWidgetCompoundComponent extends FC<ConsentWidgetProps> {
|
|
|
31
31
|
Switch: typeof Switch;
|
|
32
32
|
AccordionItems: typeof AccordionItems;
|
|
33
33
|
AccordionItem: typeof AccordionItem;
|
|
34
|
+
/** Vendor rows for one category, nested by `AccordionItems`. */
|
|
35
|
+
VendorList: typeof VendorList;
|
|
34
36
|
Root: typeof Root;
|
|
35
37
|
AcceptAllButton: typeof AcceptAllButton;
|
|
36
38
|
CustomizeButton: typeof CustomizeButton;
|
|
@@ -94,9 +96,9 @@ export interface ConsentWidgetCompoundComponent extends FC<ConsentWidgetProps> {
|
|
|
94
96
|
*/
|
|
95
97
|
declare const ConsentWidget: ConsentWidgetCompoundComponent;
|
|
96
98
|
export default ConsentWidget;
|
|
97
|
-
export { Accordion, AccordionArrow, AccordionContent, AccordionItem, AccordionItems, AccordionTrigger, AccordionTriggerInner, ConsentWidgetAccordion, ConsentWidgetAccordionArrow, ConsentWidgetAccordionContent, ConsentWidgetAccordionItem, ConsentWidgetAccordionItems, ConsentWidgetAccordionTrigger, ConsentWidgetAccordionTriggerInner, ConsentWidgetSwitch, Switch, } from './atoms/accordion';
|
|
98
|
-
export { AcceptAllButton, ConsentWidgetAcceptAllButton, ConsentWidgetCustomizeButton, ConsentWidgetRejectButton, ConsentWidgetSaveButton, CustomizeButton, RejectButton, SaveButton, } from './atoms/button';
|
|
99
|
-
export { ConsentWidgetFooter, ConsentWidgetFooterSubGroup, Footer, FooterSubGroup, } from './atoms/footer';
|
|
100
|
-
export { ConsentWidgetRoot, Root } from './atoms/root';
|
|
101
|
-
export { type ConsentWidgetPolicyActionRenderProps, ConsentWidgetPolicyActions, type ConsentWidgetPolicyActionsProps, PolicyActions, } from './policy-actions';
|
|
99
|
+
export { Accordion, AccordionArrow, AccordionContent, AccordionItem, AccordionItems, AccordionTrigger, AccordionTriggerInner, ConsentWidgetAccordion, ConsentWidgetAccordionArrow, ConsentWidgetAccordionContent, ConsentWidgetAccordionItem, ConsentWidgetAccordionItems, ConsentWidgetAccordionTrigger, ConsentWidgetAccordionTriggerInner, ConsentWidgetSwitch, ConsentWidgetVendorList, Switch, VendorList, } from './atoms/accordion.js';
|
|
100
|
+
export { AcceptAllButton, ConsentWidgetAcceptAllButton, ConsentWidgetCustomizeButton, ConsentWidgetRejectButton, ConsentWidgetSaveButton, CustomizeButton, RejectButton, SaveButton, } from './atoms/button.js';
|
|
101
|
+
export { ConsentWidgetFooter, ConsentWidgetFooterSubGroup, Footer, FooterSubGroup, } from './atoms/footer.js';
|
|
102
|
+
export { ConsentWidgetRoot, Root } from './atoms/root.js';
|
|
103
|
+
export { type ConsentWidgetPolicyActionRenderProps, ConsentWidgetPolicyActions, type ConsentWidgetPolicyActionsProps, PolicyActions, } from './policy-actions.js';
|
|
102
104
|
export { ConsentWidget };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
|
-
import type { HeadlessConsentDialogAction } from '../../component-hooks/use-headless-consent-ui';
|
|
3
|
-
import type { PolicyActionRenderProps } from '../shared/policy-actions';
|
|
2
|
+
import type { HeadlessConsentDialogAction } from '../../component-hooks/use-headless-consent-ui.js';
|
|
3
|
+
import type { PolicyActionRenderProps } from '../shared/policy-actions.js';
|
|
4
4
|
export type ConsentWidgetPolicyActionRenderProps = PolicyActionRenderProps<HeadlessConsentDialogAction>;
|
|
5
5
|
export interface ConsentWidgetPolicyActionsProps {
|
|
6
6
|
renderAction?: (action: HeadlessConsentDialogAction, props: ConsentWidgetPolicyActionRenderProps) => ReactNode;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { ConsentWidgetProps } from './types';
|
|
1
|
+
import type { ConsentWidgetProps } from './types.js';
|
|
2
2
|
export declare const ConsentWidget: ({ hideBranding, noStyle: localNoStyle, disableAnimation: localDisableAnimation, scrollLock: localScrollLock, trapFocus: localTrapFocus, ...props }: ConsentWidgetProps) => import("react").JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
|
-
import type { InlineLegalLinksProps } from '../shared/primitives/legal-links';
|
|
2
|
+
import type { InlineLegalLinksProps } from '../shared/primitives/legal-links/index.js';
|
|
3
3
|
export interface ConsentWidgetRootProps {
|
|
4
4
|
children: ReactNode;
|
|
5
5
|
useProvider?: boolean;
|
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import type { PolicyRight } from '@c15t/schema/types';
|
|
7
7
|
import type { ButtonHTMLAttributes, ReactNode } from 'react';
|
|
8
|
-
import type { BoxProps } from '../shared/primitives/box';
|
|
9
|
-
import type { ConsentButtonProps } from '../shared/primitives/button.types';
|
|
10
|
-
import type { InlineLegalLinksProps } from '../shared/primitives/legal-links';
|
|
8
|
+
import type { BoxProps } from '../shared/primitives/box.js';
|
|
9
|
+
import type { ConsentButtonProps } from '../shared/primitives/button.types.js';
|
|
10
|
+
import type { InlineLegalLinksProps } from '../shared/primitives/legal-links/index.js';
|
|
11
11
|
/** Rights the banner can expose as links. `disclosure` is carried by legal links. */
|
|
12
12
|
export type ConsentBannerRight = Exclude<PolicyRight, 'disclosure'>;
|
|
13
13
|
/**
|
|
@@ -8,11 +8,11 @@
|
|
|
8
8
|
*
|
|
9
9
|
*/
|
|
10
10
|
import type { FC } from 'react';
|
|
11
|
-
import { Overlay } from './atoms/overlay';
|
|
12
|
-
import { Root } from './atoms/root';
|
|
13
|
-
import { AcceptButton, Card, CustomizeButton, Description, DismissButton, Footer, FooterSubGroup, Header, RejectButton, RightLink, Rights, Title } from './components';
|
|
14
|
-
import { PolicyActions } from './policy-actions';
|
|
15
|
-
import type { ConsentBannerButton, ConsentBannerLayout, ConsentBannerProps } from './prompt';
|
|
11
|
+
import { Overlay } from './atoms/overlay.js';
|
|
12
|
+
import { Root } from './atoms/root.js';
|
|
13
|
+
import { AcceptButton, Card, CustomizeButton, Description, DismissButton, Footer, FooterSubGroup, Header, RejectButton, RightLink, Rights, Title } from './components.js';
|
|
14
|
+
import { PolicyActions } from './policy-actions.js';
|
|
15
|
+
import type { ConsentBannerButton, ConsentBannerLayout, ConsentBannerProps } from './prompt.js';
|
|
16
16
|
/**
|
|
17
17
|
* This interface extends the base ConsentBanner component with additional sub-components
|
|
18
18
|
* that can be used to compose the banner's structure.
|
|
@@ -114,10 +114,10 @@ export interface ConsentBannerCompoundComponent extends FC<ConsentBannerProps> {
|
|
|
114
114
|
*/
|
|
115
115
|
declare const ConsentBanner: ConsentBannerCompoundComponent;
|
|
116
116
|
export default ConsentBanner;
|
|
117
|
-
export { ConsentBannerOverlay, Overlay } from './atoms/overlay';
|
|
118
|
-
export { ConsentBannerRoot, Root } from './atoms/root';
|
|
119
|
-
export { AcceptButton, Card, ConsentBannerAcceptButton, ConsentBannerCard, ConsentBannerCustomizeButton, ConsentBannerDescription, ConsentBannerDismissButton, ConsentBannerFooter, ConsentBannerFooterSubGroup, ConsentBannerHeader, ConsentBannerRejectButton, type ConsentBannerRight, ConsentBannerRightLink, type ConsentBannerRightLinkProps, ConsentBannerRights, type ConsentBannerRightsProps, ConsentBannerTitle, CustomizeButton, Description, DismissButton, Footer, FooterSubGroup, Header, RejectButton, RightLink, Rights, Title, } from './components';
|
|
120
|
-
export { type ConsentBannerSurface, useConsentBannerSurface, } from './surface-context';
|
|
121
|
-
export { useBannerCopy } from './use-banner-copy';
|
|
122
|
-
export { type ConsentBannerPolicyActionRenderProps, ConsentBannerPolicyActions, type ConsentBannerPolicyActionsProps, PolicyActions, } from './policy-actions';
|
|
117
|
+
export { ConsentBannerOverlay, Overlay } from './atoms/overlay.js';
|
|
118
|
+
export { ConsentBannerRoot, Root } from './atoms/root.js';
|
|
119
|
+
export { AcceptButton, Card, ConsentBannerAcceptButton, ConsentBannerCard, ConsentBannerCustomizeButton, ConsentBannerDescription, ConsentBannerDismissButton, ConsentBannerFooter, ConsentBannerFooterSubGroup, ConsentBannerHeader, ConsentBannerRejectButton, type ConsentBannerRight, ConsentBannerRightLink, type ConsentBannerRightLinkProps, ConsentBannerRights, type ConsentBannerRightsProps, ConsentBannerTitle, CustomizeButton, Description, DismissButton, Footer, FooterSubGroup, Header, RejectButton, RightLink, Rights, Title, } from './components.js';
|
|
120
|
+
export { type ConsentBannerSurface, useConsentBannerSurface, } from './surface-context.js';
|
|
121
|
+
export { useBannerCopy } from './use-banner-copy.js';
|
|
122
|
+
export { type ConsentBannerPolicyActionRenderProps, ConsentBannerPolicyActions, type ConsentBannerPolicyActionsProps, PolicyActions, } from './policy-actions.js';
|
|
123
123
|
export { ConsentBanner, type ConsentBannerButton, type ConsentBannerLayout, type ConsentBannerProps, };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
|
-
import type { HeadlessConsentBannerAction } from '../../component-hooks/use-headless-consent-ui';
|
|
3
|
-
import type { PolicyActionRenderProps } from '../shared/policy-actions';
|
|
2
|
+
import type { HeadlessConsentBannerAction } from '../../component-hooks/use-headless-consent-ui.js';
|
|
3
|
+
import type { PolicyActionRenderProps } from '../shared/policy-actions.js';
|
|
4
4
|
export type ConsentBannerPolicyActionRenderProps = PolicyActionRenderProps<HeadlessConsentBannerAction>;
|
|
5
5
|
export interface ConsentBannerPolicyActionsProps {
|
|
6
6
|
/** Replaces the default preferences buttons before the policy actions. */
|
|
@@ -2,7 +2,7 @@ import type * as C15tCoreTypes from '@c15t/core';
|
|
|
2
2
|
import type { PromptPosition, PromptVariant } from '@c15t/core';
|
|
3
3
|
import type { SurfacePresentation } from '@c15t/ui/utils';
|
|
4
4
|
import type { FC, ReactNode } from 'react';
|
|
5
|
-
import type { InlineLegalLinksProps } from '../shared/primitives/legal-links';
|
|
5
|
+
import type { InlineLegalLinksProps } from '../shared/primitives/legal-links/index.js';
|
|
6
6
|
/**
|
|
7
7
|
* Identifiers for the available buttons in the consent banner.
|
|
8
8
|
* @public
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ComponentType, ReactNode } from 'react';
|
|
2
|
-
import type { HeadlessConsentSurfaceState } from '../../component-hooks/use-headless-consent-ui';
|
|
3
|
-
import type { CSSPropertiesWithVars, CSSVariables } from '../../types/theme';
|
|
2
|
+
import type { HeadlessConsentSurfaceState } from '../../component-hooks/use-headless-consent-ui.js';
|
|
3
|
+
import type { CSSPropertiesWithVars, CSSVariables } from '../../types/theme/index.js';
|
|
4
4
|
export interface PolicyActionRenderProps<TAction extends string> {
|
|
5
5
|
key: string;
|
|
6
6
|
consentAction: TAction;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ConsentComponentSlotKey } from '@c15t/schema/config';
|
|
2
2
|
import type { HTMLAttributes } from 'react';
|
|
3
|
-
import type { ExtendThemeKeys } from '../../../types/theme';
|
|
3
|
+
import type { ExtendThemeKeys } from '../../../types/theme/index.js';
|
|
4
4
|
/**
|
|
5
5
|
* Props for the description text component of the CookieBanner.
|
|
6
6
|
* Extends standard HTML div attributes.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { AllConsentNames } from '@c15t/core';
|
|
2
|
-
import type { ButtonVariantsProps } from '../ui/button/button';
|
|
3
|
-
import type { ConsentButtonProps } from './button.types';
|
|
2
|
+
import type { ButtonVariantsProps } from '../ui/button/button.js';
|
|
3
|
+
import type { ConsentButtonProps } from './button.types.js';
|
|
4
4
|
type ConsentActionThemeKey = 'accept' | 'reject' | 'customize' | 'dismiss' | 'save';
|
|
5
5
|
/**
|
|
6
6
|
* Button component that allows users to reject non-essential cookies.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ConsentComponentSlotKey } from '@c15t/schema/config';
|
|
2
2
|
import type { ButtonMode } from '@c15t/ui/styles/primitives';
|
|
3
3
|
import type { ComponentRef, HTMLAttributes, MouseEvent } from 'react';
|
|
4
|
-
import type { CSSVariables, ExtendThemeKeys } from '../../../types/theme';
|
|
4
|
+
import type { CSSVariables, ExtendThemeKeys } from '../../../types/theme/index.js';
|
|
5
5
|
export type ConsentButtonElement = ComponentRef<'button'>;
|
|
6
6
|
/**
|
|
7
7
|
* Props for CookieBanner button components.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { AccordionType } from '@c15t/ui/primitives/accordion';
|
|
2
2
|
import type { ButtonHTMLAttributes, ElementType, HTMLAttributes } from 'react';
|
|
3
|
-
import type { PolymorphicComponentProps } from '../../libs/polymorphic';
|
|
4
|
-
import type { ThemeValue } from '../../../../types/theme';
|
|
3
|
+
import type { PolymorphicComponentProps } from '../../libs/polymorphic.js';
|
|
4
|
+
import type { ThemeValue } from '../../../../types/theme/index.js';
|
|
5
5
|
export type AccordionVariant = 'default' | 'bordered';
|
|
6
6
|
export type AccordionSize = 'medium' | 'small';
|
|
7
7
|
export interface AccordionVariantsProps {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './accordion';
|
|
2
|
-
export * from './accordion.types';
|
|
1
|
+
export * from './accordion.js';
|
|
2
|
+
export * from './accordion.types.js';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export type { AnimatedCollapseProps } from './animated-collapse';
|
|
2
|
-
export { AnimatedCollapse } from './animated-collapse';
|
|
1
|
+
export type { AnimatedCollapseProps } from './animated-collapse.js';
|
|
2
|
+
export { AnimatedCollapse } from './animated-collapse.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Branding } from '@c15t/core';
|
|
2
2
|
import type { SVGProps } from 'react';
|
|
3
|
-
import type { CSSPropertiesWithVars } from '../../../types/theme';
|
|
3
|
+
import type { CSSPropertiesWithVars } from '../../../types/theme/index.js';
|
|
4
4
|
export type ResolvedBranding = 'c15t' | 'inth' | 'none';
|
|
5
5
|
export type BrandingVariant = 'footer' | 'dialog-tag' | 'banner-tag';
|
|
6
6
|
export type BrandingSlotContext = 'banner' | 'dialog' | 'manager' | 'iab-banner' | 'iab-dialog';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ButtonHTMLAttributes, ElementType } from 'react';
|
|
2
|
-
import type { PolymorphicComponentProps } from '../../libs/polymorphic';
|
|
2
|
+
import type { PolymorphicComponentProps } from '../../libs/polymorphic.js';
|
|
3
3
|
export type ButtonVariant = 'primary' | 'neutral' | 'secondary';
|
|
4
4
|
export type ButtonMode = 'filled' | 'stroke' | 'lighter' | 'ghost';
|
|
5
5
|
export type ButtonSize = 'medium' | 'small' | 'xsmall' | 'xxsmall';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './button';
|
|
2
|
-
export * from './button.types';
|
|
1
|
+
export * from './button.js';
|
|
2
|
+
export * from './button.types.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './collapsible';
|
|
1
|
+
export * from './collapsible.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './dialog';
|
|
1
|
+
export * from './dialog.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './preference-item';
|
|
1
|
+
export * from './preference-item.js';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './switch';
|
|
2
|
-
export type { SwitchCSSVariables, SwitchRootCSSVariables, SwitchThumbCSSVariables, SwitchTrackCSSVariables, } from './switch.types';
|
|
1
|
+
export * from './switch.js';
|
|
2
|
+
export type { SwitchCSSVariables, SwitchRootCSSVariables, SwitchThumbCSSVariables, SwitchTrackCSSVariables, } from './switch.types.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ButtonHTMLAttributes } from 'react';
|
|
2
|
-
import type { ThemeValue } from '../../../../types/theme';
|
|
2
|
+
import type { ThemeValue } from '../../../../types/theme/index.js';
|
|
3
3
|
export type SwitchSize = 'medium' | 'small';
|
|
4
4
|
export interface SwitchVariantsProps {
|
|
5
5
|
size?: SwitchSize;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './tabs';
|
|
1
|
+
export * from './tabs.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './components/consent-gate/index.js';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from '../context';
|
|
2
|
-
export * from './consent-tracking-context';
|
|
3
|
-
export * from './theme-context';
|
|
1
|
+
export * from '../context.js';
|
|
2
|
+
export * from './consent-tracking-context.js';
|
|
3
|
+
export * from './theme-context.js';
|
package/dist-types/draft.d.ts
CHANGED
|
@@ -4,11 +4,24 @@ import type { ReactNode } from 'react';
|
|
|
4
4
|
export interface ConsentDraftHandle {
|
|
5
5
|
values: Readonly<ConsentState>;
|
|
6
6
|
displayedCategories: readonly AllConsentNames[];
|
|
7
|
+
/**
|
|
8
|
+
* Granted flag per declared vendor. Seeded from the denials the gate
|
|
9
|
+
* honors, so a vendor declared `disabled` reads `true` whatever an older
|
|
10
|
+
* record says; every vendor not denied is `true`. Empty under an `iab`
|
|
11
|
+
* policy.
|
|
12
|
+
*/
|
|
13
|
+
vendors: Readonly<Record<string, boolean>>;
|
|
7
14
|
isDirty: boolean;
|
|
8
|
-
/** A
|
|
15
|
+
/** A policy or displayed-category change requires reset and review before saving. */
|
|
9
16
|
isStale: boolean;
|
|
10
17
|
set: (category: AllConsentNames, value: boolean) => void;
|
|
11
18
|
update: (patch: Partial<ConsentState>) => void;
|
|
19
|
+
/**
|
|
20
|
+
* Stage one vendor's grant. Recorded by the next save. Ignored for a
|
|
21
|
+
* vendor that is not declared or is declared `disabled`, since the kernel
|
|
22
|
+
* would drop the grant on save.
|
|
23
|
+
*/
|
|
24
|
+
setVendor: (vendorId: string, granted: boolean) => void;
|
|
12
25
|
acceptAll: () => void;
|
|
13
26
|
rejectAll: () => void;
|
|
14
27
|
save: () => Promise<SaveResult>;
|
|
@@ -29,3 +42,42 @@ export declare const useConsentManagerDraft: () => {
|
|
|
29
42
|
};
|
|
30
43
|
/** Read and edit displayed choices without replacing masked effective permissions. */
|
|
31
44
|
export declare const useConsentDraft: () => ConsentDraftHandle;
|
|
45
|
+
/** The vendor slice of the consent draft, for a custom vendor control. */
|
|
46
|
+
export interface VendorDraftHandle {
|
|
47
|
+
/** Granted flag per declared vendor. See {@link ConsentDraftHandle.vendors}. */
|
|
48
|
+
vendors: Readonly<Record<string, boolean>>;
|
|
49
|
+
/** Stage one vendor's grant for the next save. See {@link ConsentDraftHandle.setVendor}. */
|
|
50
|
+
setVendor: (vendorId: string, granted: boolean) => void;
|
|
51
|
+
/** Whether any draft value, category or vendor, differs from the record. */
|
|
52
|
+
isDirty: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* Whether the policy or the vendor surface changed under an unsaved edit.
|
|
55
|
+
* `save` refuses a stale draft. See {@link ConsentDraftHandle.isStale}.
|
|
56
|
+
*/
|
|
57
|
+
isStale: boolean;
|
|
58
|
+
/** Confirm the draft, categories and vendors together. */
|
|
59
|
+
save: () => Promise<SaveResult>;
|
|
60
|
+
/** Discard staged edits and reseed from the record. See {@link ConsentDraftHandle.reset}. */
|
|
61
|
+
reset: () => void;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Read and stage vendor grants on the same draft the category switches use.
|
|
65
|
+
* A custom vendor toggle needs only this; the categories stay where the
|
|
66
|
+
* stock widget or `useConsentDraft()` left them, and one save confirms both.
|
|
67
|
+
* When the policy or the vendor list changes under a staged edit the draft
|
|
68
|
+
* turns stale and `save` refuses it; `reset` reseeds it from the record.
|
|
69
|
+
*
|
|
70
|
+
* @returns The draft's vendor map, the setter, the dirty and stale flags,
|
|
71
|
+
* the save and the reset.
|
|
72
|
+
* @example
|
|
73
|
+
* ```tsx
|
|
74
|
+
* const { vendors, setVendor, isStale, reset, save } = useVendorDraft();
|
|
75
|
+
* <Switch
|
|
76
|
+
* checked={vendors['meta-pixel'] ?? true}
|
|
77
|
+
* onCheckedChange={(on) => setVendor('meta-pixel', on)}
|
|
78
|
+
* />;
|
|
79
|
+
* {isStale && <button onClick={reset}>Review again</button>}
|
|
80
|
+
* ```
|
|
81
|
+
* @public
|
|
82
|
+
*/
|
|
83
|
+
export declare const useVendorDraft: () => VendorDraftHandle;
|
package/dist-types/headless.d.ts
CHANGED
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
* Pair with `ConsentProvider` from `@c15t/react` (or `@c15t/react/provider`).
|
|
6
6
|
*/
|
|
7
7
|
export { defaultTranslationConfig, detectBrowserLanguage, mergeTranslationConfigs, prepareTranslationConfig, } from '@c15t/core';
|
|
8
|
-
export { type ConsentDialogTriggerVisibility, type UseConsentDialogTriggerOptions, type UseConsentDialogTriggerResult, useConsentDialogTrigger, } from './component-hooks/use-panel-trigger';
|
|
9
|
-
export { useConsentManager } from './component-hooks/use-manager';
|
|
10
|
-
export { type HeadlessConsentBannerAction, type HeadlessConsentBannerState, type HeadlessConsentDialogAction, type HeadlessConsentDialogState, type HeadlessConsentSurface, type HeadlessConsentSurfaceAction, type HeadlessConsentSurfaceState, type HeadlessConsentWriteAction, useHeadlessConsentUI, } from './component-hooks/use-headless-consent-ui';
|
|
11
|
-
export { useTranslations } from './component-hooks/use-translations';
|
|
12
|
-
export { useColorScheme } from './hooks/use-color-scheme';
|
|
13
|
-
export { useFocusTrap } from './hooks/use-focus-trap';
|
|
14
|
-
export type { ReactUIOptions } from './types/manager';
|
|
8
|
+
export { type ConsentDialogTriggerVisibility, type UseConsentDialogTriggerOptions, type UseConsentDialogTriggerResult, useConsentDialogTrigger, } from './component-hooks/use-panel-trigger.js';
|
|
9
|
+
export { useConsentManager } from './component-hooks/use-manager.js';
|
|
10
|
+
export { type HeadlessConsentBannerAction, type HeadlessConsentBannerState, type HeadlessConsentDialogAction, type HeadlessConsentDialogState, type HeadlessConsentSurface, type HeadlessConsentSurfaceAction, type HeadlessConsentSurfaceState, type HeadlessConsentWriteAction, useHeadlessConsentUI, } from './component-hooks/use-headless-consent-ui.js';
|
|
11
|
+
export { useTranslations } from './component-hooks/use-translations.js';
|
|
12
|
+
export { useColorScheme } from './hooks/use-color-scheme.js';
|
|
13
|
+
export { useFocusTrap } from './hooks/use-focus-trap.js';
|
|
14
|
+
export type { ReactUIOptions } from './types/manager.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { HeadlessIABBannerAction, HeadlessIABDialogAction, HeadlessIABPreferenceTab } from '@c15t/iab/headless';
|
|
2
|
-
import { useIABConsentManager } from './use-iab-manager';
|
|
2
|
+
import { useIABConsentManager } from './use-iab-manager.js';
|
|
3
3
|
export type { HeadlessIABBannerAction, HeadlessIABDialogAction, HeadlessIABPreferenceTab, };
|
|
4
4
|
export interface HeadlessIABBannerState {
|
|
5
5
|
isVisible: boolean;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ActiveUI, ConsentPresentation, TranslationConfig } from '@c15t/core';
|
|
2
2
|
export declare const useIABConsentManager: (overrides?: ConsentPresentation) => {
|
|
3
3
|
activeUI: ActiveUI;
|
|
4
|
-
iab: import("../iab-context").ReactIABState | null;
|
|
4
|
+
iab: import("../iab-context.js").ReactIABState | null;
|
|
5
5
|
model: import("@c15t/core").KernelModel | null;
|
|
6
6
|
policyBanner: {
|
|
7
7
|
allowedActions: import("@c15t/core").PresentationAction[];
|