uikit-react-public 0.44.4 → 0.45.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,3 @@
1
1
  export { default } from './Badge';
2
2
  export type { BadgeProps } from './Badge';
3
+ export type { BadgeVariant } from './Badge';
@@ -0,0 +1,16 @@
1
+ import { MouseEvent as ReactMouseEvent, ReactNode } from 'react';
2
+ import { BaseDialogProps } from '../Dialog/BaseDialog';
3
+ import { CookieCategory, CookiePreferences } from './types';
4
+ interface CookieSettingsProps extends Omit<BaseDialogProps, 'children' | 'onChange' | 'onClose' | 'size' | 'modal'> {
5
+ cookies: CookieCategory[];
6
+ preferences: CookiePreferences;
7
+ description?: ReactNode;
8
+ policyHref?: string;
9
+ policyLabel?: ReactNode;
10
+ onClose?: (ev?: ReactMouseEvent | KeyboardEvent) => void;
11
+ onPreferenceToggle: (cookie: CookieCategory) => void;
12
+ onSavePreferences?: () => void;
13
+ saveButtonLabel?: ReactNode;
14
+ }
15
+ declare const CookieSettings: ({ open, cookies, preferences, description, policyHref, policyLabel, onClose, onPreferenceToggle, onSavePreferences, saveButtonLabel, testId, className, ...props }: CookieSettingsProps) => import("react").JSX.Element;
16
+ export default CookieSettings;
@@ -0,0 +1,26 @@
1
+ import { HTMLAttributes, ReactNode } from 'react';
2
+ import { MarginProps } from '../common/marginsStyle';
3
+ import { CookieCategory, CookiePreferences } from './types';
4
+ export declare const NAME = "ucl-uikit-cookies-notice";
5
+ export interface CookiesNoticeBaseProps extends HTMLAttributes<HTMLDivElement> {
6
+ heading?: ReactNode;
7
+ description?: ReactNode;
8
+ policyHref?: string;
9
+ policyLabel?: ReactNode;
10
+ cookies?: CookieCategory[];
11
+ preferences?: CookiePreferences;
12
+ modal?: boolean;
13
+ manageCookiesLabel?: ReactNode;
14
+ acceptAllLabel?: ReactNode;
15
+ acceptNecessaryLabel?: ReactNode;
16
+ onAcceptAll?: (preferences: CookiePreferences) => void;
17
+ onAcceptNecessary?: (preferences: CookiePreferences) => void;
18
+ onManageCookies?: () => void;
19
+ onPreferencesChange?: (preferences: CookiePreferences) => void;
20
+ onSavePreferences?: (preferences: CookiePreferences) => void;
21
+ onSettingsClose?: () => void;
22
+ testId?: string;
23
+ }
24
+ export type CookiesNoticeProps = CookiesNoticeBaseProps & MarginProps;
25
+ declare const CookiesNotice: ({ heading, description, policyHref, policyLabel, cookies, preferences, modal, manageCookiesLabel, acceptAllLabel, acceptNecessaryLabel, onAcceptAll, onAcceptNecessary, onManageCookies, onPreferencesChange, onSavePreferences, onSettingsClose, testId, className, ...props }: CookiesNoticeProps) => import("react").JSX.Element;
26
+ export default CookiesNotice;
@@ -0,0 +1,13 @@
1
+ import { StoryObj } from '@storybook/react-vite';
2
+ declare const meta: {
3
+ title: string;
4
+ component: ({ heading, description, policyHref, policyLabel, cookies, preferences, modal, manageCookiesLabel, acceptAllLabel, acceptNecessaryLabel, onAcceptAll, onAcceptNecessary, onManageCookies, onPreferencesChange, onSavePreferences, onSettingsClose, testId, className, ...props }: import('./CookiesNotice').CookiesNoticeProps) => import("react").JSX.Element;
5
+ parameters: {
6
+ layout: string;
7
+ };
8
+ tags: string[];
9
+ };
10
+ export default meta;
11
+ type Story = StoryObj<typeof meta>;
12
+ export declare const NonModal: Story;
13
+ export declare const Modal: Story;
@@ -0,0 +1,6 @@
1
+ import { CookieCategory } from './types';
2
+ export declare const DEFAULT_POLICY_HREF = "https://www.ucl.ac.uk/legal-services/privacy/cookie-policy";
3
+ export declare const DEFAULT_HEADING = "Help us improve your experience";
4
+ export declare const DEFAULT_DESCRIPTION = "We use cookies for authentication, analytics, and third-party services like Google Maps. Some cookies are required for the site to function and cannot be turned off. By accepting, you agree to the ";
5
+ export declare const DEFAULT_DESCRIPTION_SUFFIX = " You can update your preferences any time.";
6
+ export declare const DEFAULT_COOKIE_CATEGORIES: CookieCategory[];
@@ -0,0 +1,3 @@
1
+ export { default } from './CookiesNotice';
2
+ export type { CookiesNoticeBaseProps, CookiesNoticeProps, } from './CookiesNotice';
3
+ export type { CookieCategory, CookiePreferences } from './types';
@@ -0,0 +1,12 @@
1
+ import { ReactNode } from 'react';
2
+ export type CookiePreferences = Record<string, boolean>;
3
+ export interface CookieCategory {
4
+ id: string;
5
+ title: ReactNode;
6
+ description: ReactNode;
7
+ required?: boolean;
8
+ defaultEnabled?: boolean;
9
+ toggleLabel?: string;
10
+ learnMoreHref?: string;
11
+ learnMoreLabel?: ReactNode;
12
+ }
@@ -24,7 +24,7 @@ export type { SnackbarProps, SnackbarsItem, SnackbarsPlacement, SnackbarsProps,
24
24
  export { default as Avatar } from './Avatar';
25
25
  export type { AvatarProps } from './Avatar';
26
26
  export { default as Badge } from './Badge';
27
- export type { BadgeProps } from './Badge';
27
+ export type { BadgeProps, BadgeVariant } from './Badge';
28
28
  export { default as BaseCheckbox } from './BaseCheckbox';
29
29
  export type { BaseCheckboxProps, BaseCheckboxState } from './BaseCheckbox';
30
30
  export { default as Spinner } from './Spinner';
@@ -125,8 +125,11 @@ export { default as FileInput } from './FileInput';
125
125
  export type { FileInputProps } from './FileInput';
126
126
  export { default as Timepicker } from './Timepicker';
127
127
  export type { TimepickerProps } from './Timepicker';
128
+ /** @deprecated Use CookiesNotice instead. */
128
129
  export { default as CookieNotice } from './CookieNotice';
129
130
  export type { CookieNoticeProps } from './CookieNotice';
131
+ export { default as CookiesNotice } from './CookiesNotice';
132
+ export type { CookieCategory, CookiePreferences, CookiesNoticeBaseProps, CookiesNoticeProps, } from './CookiesNotice';
130
133
  export { default as Search } from './Search';
131
134
  export type { SearchProps } from './Search';
132
135
  export { default as SkipToContent } from './SkipToContent';