@inzumer/ui-library 1.4.0 → 2.0.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.
- package/dist/Select.styles-CeZROqOk.d.ts +8 -0
- package/dist/{chunk-BKPP4D3Q.js → chunk-27HTTVFO.js} +2 -2
- package/dist/{chunk-BKPP4D3Q.js.map → chunk-27HTTVFO.js.map} +1 -1
- package/dist/chunk-4H6VER5P.js +36 -0
- package/dist/chunk-4H6VER5P.js.map +1 -0
- package/dist/chunk-4TPQTZSR.js +76 -0
- package/dist/chunk-4TPQTZSR.js.map +1 -0
- package/dist/{chunk-D4I5OF3C.js → chunk-5LKLTY55.js} +2 -2
- package/dist/{chunk-D4I5OF3C.js.map → chunk-5LKLTY55.js.map} +1 -1
- package/dist/{chunk-WUEVXL76.js → chunk-DIA7L6IA.js} +4 -33
- package/dist/chunk-DIA7L6IA.js.map +1 -0
- package/dist/{chunk-DP274HDM.js → chunk-IY452YEX.js} +14 -4
- package/dist/chunk-IY452YEX.js.map +1 -0
- package/dist/{chunk-W3H7DYWX.js → chunk-J7X6NLSR.js} +30 -12
- package/dist/chunk-J7X6NLSR.js.map +1 -0
- package/dist/{chunk-5IHM2545.js → chunk-KAU7S3D4.js} +2 -2
- package/dist/{chunk-5IHM2545.js.map → chunk-KAU7S3D4.js.map} +1 -1
- package/dist/{chunk-ZABQF65Z.js → chunk-KSNAVEJP.js} +3 -3
- package/dist/{chunk-ZABQF65Z.js.map → chunk-KSNAVEJP.js.map} +1 -1
- package/dist/chunk-LLJXVAR6.js +184 -0
- package/dist/chunk-LLJXVAR6.js.map +1 -0
- package/dist/{chunk-7HQFLM4A.js → chunk-NA7YKEO4.js} +2 -2
- package/dist/{chunk-7HQFLM4A.js.map → chunk-NA7YKEO4.js.map} +1 -1
- package/dist/{chunk-ULLCBART.js → chunk-NTXFFBL6.js} +4 -4
- package/dist/{chunk-ULLCBART.js.map → chunk-NTXFFBL6.js.map} +1 -1
- package/dist/{chunk-P4CV2EPR.js → chunk-SPDOYFCU.js} +2 -2
- package/dist/{chunk-P4CV2EPR.js.map → chunk-SPDOYFCU.js.map} +1 -1
- package/dist/{chunk-VGLFR5SB.js → chunk-TO3FF6FR.js} +4 -4
- package/dist/{chunk-VGLFR5SB.js.map → chunk-TO3FF6FR.js.map} +1 -1
- package/dist/{chunk-UL33H4AD.js → chunk-TRLFK626.js} +24 -4
- package/dist/chunk-TRLFK626.js.map +1 -0
- package/dist/{chunk-3YRDRHO3.js → chunk-UUW7L2AV.js} +3 -3
- package/dist/{chunk-3YRDRHO3.js.map → chunk-UUW7L2AV.js.map} +1 -1
- package/dist/{chunk-PE6XEC7Y.js → chunk-VCJN4FS2.js} +4 -4
- package/dist/{chunk-PE6XEC7Y.js.map → chunk-VCJN4FS2.js.map} +1 -1
- package/dist/chunk-VK24YOIC.js +184 -0
- package/dist/chunk-VK24YOIC.js.map +1 -0
- package/dist/chunk-XUGSIK2P.js +238 -0
- package/dist/chunk-XUGSIK2P.js.map +1 -0
- package/dist/{chunk-N5CLCKR3.js → chunk-ZH2EDGW6.js} +3 -3
- package/dist/{chunk-N5CLCKR3.js.map → chunk-ZH2EDGW6.js.map} +1 -1
- package/dist/components/atoms/Icon/index.js +1 -1
- package/dist/components/atoms/Image/index.js +1 -1
- package/dist/components/atoms/Input/index.js +2 -2
- package/dist/components/atoms/Link/index.js +1 -1
- package/dist/components/atoms/RichText/index.js +1 -1
- package/dist/components/atoms/Select/index.d.ts +1 -5
- package/dist/components/atoms/Select/index.js +3 -2
- package/dist/components/atoms/Switch/index.js +2 -2
- package/dist/components/atoms/Textarea/index.js +2 -2
- package/dist/components/molecules/BottomSheet/index.js +3 -3
- package/dist/components/molecules/Breadcrumbs/index.js +3 -3
- package/dist/components/molecules/Card/index.js +2 -2
- package/dist/components/molecules/Carousel/index.d.ts +61 -0
- package/dist/components/molecules/{CookieBanner → Carousel}/index.js +2 -2
- package/dist/components/molecules/Drawer/index.js +3 -3
- package/dist/components/molecules/Dropdown/index.d.ts +44 -0
- package/dist/components/molecules/Dropdown/index.js +8 -0
- package/dist/components/molecules/MediaCard/index.d.ts +56 -0
- package/dist/components/molecules/MediaCard/index.js +6 -0
- package/dist/components/molecules/MediaCard/index.js.map +1 -0
- package/dist/components/molecules/Modal/index.d.ts +4 -0
- package/dist/components/molecules/Modal/index.js +3 -3
- package/dist/components/molecules/Snackbar/index.js +1 -1
- package/dist/components/molecules/Timeline/index.d.ts +7 -0
- package/dist/components/molecules/Timeline/index.js +3 -2
- package/dist/components/organisms/CookieConsent/index.d.ts +59 -0
- package/dist/components/{molecules/CookiePreferences → organisms/CookieConsent}/index.js +5 -5
- package/dist/components/organisms/CookieConsent/index.js.map +1 -0
- package/dist/index.d.ts +5 -2
- package/dist/index.js +22 -19
- package/package.json +15 -7
- package/dist/chunk-36CVKI5R.js +0 -79
- package/dist/chunk-36CVKI5R.js.map +0 -1
- package/dist/chunk-DP274HDM.js.map +0 -1
- package/dist/chunk-TR7XKJCO.js +0 -85
- package/dist/chunk-TR7XKJCO.js.map +0 -1
- package/dist/chunk-UL33H4AD.js.map +0 -1
- package/dist/chunk-W3H7DYWX.js.map +0 -1
- package/dist/chunk-WUEVXL76.js.map +0 -1
- package/dist/components/molecules/CookieBanner/index.d.ts +0 -46
- package/dist/components/molecules/CookiePreferences/index.d.ts +0 -34
- /package/dist/components/molecules/{CookieBanner → Carousel}/index.js.map +0 -0
- /package/dist/components/molecules/{CookiePreferences → Dropdown}/index.js.map +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { Breadcrumbs } from '../../../chunk-
|
|
2
|
-
import '../../../chunk-
|
|
3
|
-
import '../../../chunk-
|
|
1
|
+
export { Breadcrumbs } from '../../../chunk-VCJN4FS2.js';
|
|
2
|
+
import '../../../chunk-5LKLTY55.js';
|
|
3
|
+
import '../../../chunk-SPDOYFCU.js';
|
|
4
4
|
import '../../../chunk-6LLGTBM6.js';
|
|
5
5
|
//# sourceMappingURL=index.js.map
|
|
6
6
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from '../../../chunk-
|
|
2
|
-
import '../../../chunk-
|
|
1
|
+
export { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from '../../../chunk-ZH2EDGW6.js';
|
|
2
|
+
import '../../../chunk-SPDOYFCU.js';
|
|
3
3
|
import '../../../chunk-6LLGTBM6.js';
|
|
4
4
|
//# sourceMappingURL=index.js.map
|
|
5
5
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
3
|
+
|
|
4
|
+
type CarouselProps = Omit<HTMLAttributes<HTMLElement>, 'children'> & {
|
|
5
|
+
/** Accessible name of the carousel, e.g. "Featured recipes". */
|
|
6
|
+
label: string;
|
|
7
|
+
/** One child per slide. */
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
previousLabel: string;
|
|
10
|
+
nextLabel: string;
|
|
11
|
+
/** Accessible name of each slide; defaults to "1 / 6". */
|
|
12
|
+
slideLabel?: (index: number, total: number) => string;
|
|
13
|
+
/** Accessible name of each indicator; defaults to "Go to slide 3". */
|
|
14
|
+
goToLabel?: (index: number, total: number) => string;
|
|
15
|
+
/** Accessible name of the indicators group, e.g. "Choose a recipe". */
|
|
16
|
+
indicatorsLabel?: string;
|
|
17
|
+
/** Show the indicators between the buttons (default `true`). */
|
|
18
|
+
indicators?: boolean;
|
|
19
|
+
/** Optional visible heading or "See all" link above the cards. */
|
|
20
|
+
header?: ReactNode;
|
|
21
|
+
/** Width classes for each slide (defaults: 80% mobile, 45% tablet, 31% desktop). */
|
|
22
|
+
slideClassName?: string;
|
|
23
|
+
/** Stable ids for the buttons, e.g. for analytics click triggers. */
|
|
24
|
+
buttonIds?: {
|
|
25
|
+
previous?: string;
|
|
26
|
+
next?: string;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Horizontal carousel of cards: native scroll with snap (touch and trackpad drag work as usual),
|
|
31
|
+
* and below the cards previous/next buttons around indicators that show the current card and jump
|
|
32
|
+
* to any of them. Tabbing to a card scrolls it into view. No autoplay; the smooth scroll is turned
|
|
33
|
+
* off when the person prefers reduced motion.
|
|
34
|
+
*/
|
|
35
|
+
declare const Carousel: react.ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLElement>, "children"> & {
|
|
36
|
+
/** Accessible name of the carousel, e.g. "Featured recipes". */
|
|
37
|
+
label: string;
|
|
38
|
+
/** One child per slide. */
|
|
39
|
+
children: ReactNode;
|
|
40
|
+
previousLabel: string;
|
|
41
|
+
nextLabel: string;
|
|
42
|
+
/** Accessible name of each slide; defaults to "1 / 6". */
|
|
43
|
+
slideLabel?: (index: number, total: number) => string;
|
|
44
|
+
/** Accessible name of each indicator; defaults to "Go to slide 3". */
|
|
45
|
+
goToLabel?: (index: number, total: number) => string;
|
|
46
|
+
/** Accessible name of the indicators group, e.g. "Choose a recipe". */
|
|
47
|
+
indicatorsLabel?: string;
|
|
48
|
+
/** Show the indicators between the buttons (default `true`). */
|
|
49
|
+
indicators?: boolean;
|
|
50
|
+
/** Optional visible heading or "See all" link above the cards. */
|
|
51
|
+
header?: ReactNode;
|
|
52
|
+
/** Width classes for each slide (defaults: 80% mobile, 45% tablet, 31% desktop). */
|
|
53
|
+
slideClassName?: string;
|
|
54
|
+
/** Stable ids for the buttons, e.g. for analytics click triggers. */
|
|
55
|
+
buttonIds?: {
|
|
56
|
+
previous?: string;
|
|
57
|
+
next?: string;
|
|
58
|
+
};
|
|
59
|
+
} & react.RefAttributes<HTMLElement>>;
|
|
60
|
+
|
|
61
|
+
export { Carousel, type CarouselProps };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { Carousel } from '../../../chunk-LLJXVAR6.js';
|
|
2
|
+
import '../../../chunk-2HCMNEIQ.js';
|
|
2
3
|
import '../../../chunk-KL6I2JFC.js';
|
|
3
4
|
import '../../../chunk-P4Z7HH66.js';
|
|
4
|
-
import '../../../chunk-P4CV2EPR.js';
|
|
5
5
|
import '../../../chunk-6LLGTBM6.js';
|
|
6
6
|
//# sourceMappingURL=index.js.map
|
|
7
7
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export { Drawer } from '../../../chunk-
|
|
1
|
+
export { Drawer } from '../../../chunk-TO3FF6FR.js';
|
|
2
2
|
import '../../../chunk-QT62VC36.js';
|
|
3
3
|
import '../../../chunk-53YMHM24.js';
|
|
4
|
-
import '../../../chunk-BNEEI7S5.js';
|
|
5
4
|
import '../../../chunk-JCJP427C.js';
|
|
5
|
+
import '../../../chunk-BNEEI7S5.js';
|
|
6
6
|
import '../../../chunk-KL6I2JFC.js';
|
|
7
7
|
import '../../../chunk-P4Z7HH66.js';
|
|
8
|
-
import '../../../chunk-
|
|
8
|
+
import '../../../chunk-SPDOYFCU.js';
|
|
9
9
|
import '../../../chunk-6LLGTBM6.js';
|
|
10
10
|
//# sourceMappingURL=index.js.map
|
|
11
11
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
3
|
+
import { VariantProps } from 'class-variance-authority';
|
|
4
|
+
import { s as selectStyles } from '../../../Select.styles-CeZROqOk.js';
|
|
5
|
+
|
|
6
|
+
interface DropdownOption {
|
|
7
|
+
value: string;
|
|
8
|
+
label: string;
|
|
9
|
+
}
|
|
10
|
+
type DropdownProps = VariantProps<typeof selectStyles> & {
|
|
11
|
+
label: string;
|
|
12
|
+
options: DropdownOption[];
|
|
13
|
+
value: string;
|
|
14
|
+
onChange: (value: string) => void;
|
|
15
|
+
hint?: string;
|
|
16
|
+
error?: string;
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
id?: string;
|
|
19
|
+
name?: string;
|
|
20
|
+
className?: string;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* A select whose list is drawn with the theme (a native `<select>` opens the platform picker).
|
|
24
|
+
* WAI-ARIA "select-only combobox": focus stays on the trigger and the active option is announced
|
|
25
|
+
* through `aria-activedescendant`; arrows, Home/End, Enter/Space, Escape and typing a letter behave
|
|
26
|
+
* like a native select.
|
|
27
|
+
*/
|
|
28
|
+
declare const Dropdown: react.ForwardRefExoticComponent<VariantProps<(props?: ({
|
|
29
|
+
state?: "error" | "default" | null | undefined;
|
|
30
|
+
inputSize?: "sm" | "md" | "lg" | null | undefined;
|
|
31
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string> & {
|
|
32
|
+
label: string;
|
|
33
|
+
options: DropdownOption[];
|
|
34
|
+
value: string;
|
|
35
|
+
onChange: (value: string) => void;
|
|
36
|
+
hint?: string;
|
|
37
|
+
error?: string;
|
|
38
|
+
disabled?: boolean;
|
|
39
|
+
id?: string;
|
|
40
|
+
name?: string;
|
|
41
|
+
className?: string;
|
|
42
|
+
} & react.RefAttributes<HTMLButtonElement>>;
|
|
43
|
+
|
|
44
|
+
export { Dropdown, type DropdownOption, type DropdownProps };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { Dropdown } from '../../../chunk-XUGSIK2P.js';
|
|
2
|
+
import '../../../chunk-JCJP427C.js';
|
|
3
|
+
import '../../../chunk-4H6VER5P.js';
|
|
4
|
+
import '../../../chunk-FFKHEBQ7.js';
|
|
5
|
+
import '../../../chunk-SPDOYFCU.js';
|
|
6
|
+
import '../../../chunk-6LLGTBM6.js';
|
|
7
|
+
//# sourceMappingURL=index.js.map
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
3
|
+
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
4
|
+
import { VariantProps } from 'class-variance-authority';
|
|
5
|
+
|
|
6
|
+
declare const mediaCardStyles: (props?: ({
|
|
7
|
+
aspect?: "square" | "portrait" | "landscape" | null | undefined;
|
|
8
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
9
|
+
|
|
10
|
+
type MediaCardProps = Omit<HTMLAttributes<HTMLElement>, 'title'> & VariantProps<typeof mediaCardStyles> & {
|
|
11
|
+
/** Image URL; or pass your own element (e.g. an optimized `<picture>`) in `media`. */
|
|
12
|
+
src?: string;
|
|
13
|
+
/** Describes the photo; use `''` if it is only decorative. */
|
|
14
|
+
alt?: string;
|
|
15
|
+
media?: ReactNode;
|
|
16
|
+
title: ReactNode;
|
|
17
|
+
/** One short line under the title (time, category, cost per serving…). */
|
|
18
|
+
subtitle?: ReactNode;
|
|
19
|
+
/** Heading level of the title in the page outline. */
|
|
20
|
+
headingLevel?: 'h2' | 'h3' | 'h4';
|
|
21
|
+
/** Makes the whole card a link, named by the title. */
|
|
22
|
+
href?: string;
|
|
23
|
+
linkId?: string;
|
|
24
|
+
/** Small label on the top-left corner ("New", "Featured"). */
|
|
25
|
+
badge?: ReactNode;
|
|
26
|
+
/** Floating buttons on the top-right corner (save, share); they stay above the link. */
|
|
27
|
+
actions?: ReactNode;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Vertical card with a full-bleed photo, a dark gradient from the bottom for the title and
|
|
31
|
+
* subtitle, an optional badge and floating actions. For recipes, articles and guides; pair it with
|
|
32
|
+
* `Carousel` for rows of cards.
|
|
33
|
+
*/
|
|
34
|
+
declare const MediaCard: react.ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLElement>, "title"> & VariantProps<(props?: ({
|
|
35
|
+
aspect?: "square" | "portrait" | "landscape" | null | undefined;
|
|
36
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string> & {
|
|
37
|
+
/** Image URL; or pass your own element (e.g. an optimized `<picture>`) in `media`. */
|
|
38
|
+
src?: string;
|
|
39
|
+
/** Describes the photo; use `''` if it is only decorative. */
|
|
40
|
+
alt?: string;
|
|
41
|
+
media?: ReactNode;
|
|
42
|
+
title: ReactNode;
|
|
43
|
+
/** One short line under the title (time, category, cost per serving…). */
|
|
44
|
+
subtitle?: ReactNode;
|
|
45
|
+
/** Heading level of the title in the page outline. */
|
|
46
|
+
headingLevel?: "h2" | "h3" | "h4";
|
|
47
|
+
/** Makes the whole card a link, named by the title. */
|
|
48
|
+
href?: string;
|
|
49
|
+
linkId?: string;
|
|
50
|
+
/** Small label on the top-left corner ("New", "Featured"). */
|
|
51
|
+
badge?: ReactNode;
|
|
52
|
+
/** Floating buttons on the top-right corner (save, share); they stay above the link. */
|
|
53
|
+
actions?: ReactNode;
|
|
54
|
+
} & react.RefAttributes<HTMLElement>>;
|
|
55
|
+
|
|
56
|
+
export { MediaCard, type MediaCardProps };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
|
|
@@ -7,6 +7,8 @@ type ModalProps = Omit<HTMLAttributes<HTMLDivElement>, 'title'> & {
|
|
|
7
7
|
title?: ReactNode;
|
|
8
8
|
footer?: ReactNode;
|
|
9
9
|
closeOnBackdropClick?: boolean;
|
|
10
|
+
/** Height limit before the body scrolls: 80% of the viewport (`default`) or 90% (`tall`). */
|
|
11
|
+
maxHeight?: 'default' | 'tall';
|
|
10
12
|
};
|
|
11
13
|
declare const Modal: react.ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLDivElement>, "title"> & {
|
|
12
14
|
open: boolean;
|
|
@@ -14,6 +16,8 @@ declare const Modal: react.ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLDiv
|
|
|
14
16
|
title?: ReactNode;
|
|
15
17
|
footer?: ReactNode;
|
|
16
18
|
closeOnBackdropClick?: boolean;
|
|
19
|
+
/** Height limit before the body scrolls: 80% of the viewport (`default`) or 90% (`tall`). */
|
|
20
|
+
maxHeight?: "default" | "tall";
|
|
17
21
|
} & react.RefAttributes<HTMLDivElement>>;
|
|
18
22
|
|
|
19
23
|
export { Modal, type ModalProps };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export { Modal } from '../../../chunk-
|
|
1
|
+
export { Modal } from '../../../chunk-J7X6NLSR.js';
|
|
2
2
|
import '../../../chunk-QT62VC36.js';
|
|
3
3
|
import '../../../chunk-53YMHM24.js';
|
|
4
|
-
import '../../../chunk-BNEEI7S5.js';
|
|
5
4
|
import '../../../chunk-JCJP427C.js';
|
|
5
|
+
import '../../../chunk-BNEEI7S5.js';
|
|
6
6
|
import '../../../chunk-P4Z7HH66.js';
|
|
7
|
-
import '../../../chunk-
|
|
7
|
+
import '../../../chunk-SPDOYFCU.js';
|
|
8
8
|
import '../../../chunk-6LLGTBM6.js';
|
|
9
9
|
//# sourceMappingURL=index.js.map
|
|
10
10
|
//# sourceMappingURL=index.js.map
|
|
@@ -5,6 +5,13 @@ interface TimelineItem {
|
|
|
5
5
|
id?: string;
|
|
6
6
|
title: ReactNode;
|
|
7
7
|
description: ReactNode[];
|
|
8
|
+
/** Optional photo of the entry, shown under its text (lazy loaded). */
|
|
9
|
+
image?: {
|
|
10
|
+
src: string;
|
|
11
|
+
alt: string;
|
|
12
|
+
};
|
|
13
|
+
/** Your own media element instead of `image` (e.g. an optimized `<picture>`). */
|
|
14
|
+
media?: ReactNode;
|
|
8
15
|
}
|
|
9
16
|
type TimelineProps = HTMLAttributes<HTMLUListElement> & {
|
|
10
17
|
items: TimelineItem[];
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
export { Timeline } from '../../../chunk-
|
|
2
|
-
import '../../../chunk-
|
|
1
|
+
export { Timeline } from '../../../chunk-TRLFK626.js';
|
|
2
|
+
import '../../../chunk-KAU7S3D4.js';
|
|
3
|
+
import '../../../chunk-SPDOYFCU.js';
|
|
3
4
|
import '../../../chunk-6LLGTBM6.js';
|
|
4
5
|
//# sourceMappingURL=index.js.map
|
|
5
6
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
|
|
4
|
+
interface CookieCategory {
|
|
5
|
+
id: string;
|
|
6
|
+
title: string;
|
|
7
|
+
description: ReactNode;
|
|
8
|
+
/** Strictly necessary cookies can't be turned off; they show `labels.required` instead of a switch. */
|
|
9
|
+
required?: boolean;
|
|
10
|
+
}
|
|
11
|
+
/** Whether each optional category is allowed, by id. */
|
|
12
|
+
type CookieChoices = Record<string, boolean>;
|
|
13
|
+
/**
|
|
14
|
+
* - `banner`: bar at the bottom while there is no answer (`value === null`), with accept, reject
|
|
15
|
+
* and customize; customize opens the preferences dialog.
|
|
16
|
+
* - `modal`: only the preferences dialog, opened with `open` / `onOpenChange`.
|
|
17
|
+
* - `inline`: the categories with switches inside a page (privacy, settings); every change is
|
|
18
|
+
* saved at once, there is no save button.
|
|
19
|
+
*/
|
|
20
|
+
type CookieConsentMode = 'banner' | 'modal' | 'inline';
|
|
21
|
+
interface CookieConsentLabels {
|
|
22
|
+
/** Banner title. */
|
|
23
|
+
title: ReactNode;
|
|
24
|
+
/** Banner text; usually ends with a link to the privacy policy. */
|
|
25
|
+
description: ReactNode;
|
|
26
|
+
accept: string;
|
|
27
|
+
reject: string;
|
|
28
|
+
customize: string;
|
|
29
|
+
preferencesTitle: ReactNode;
|
|
30
|
+
preferencesDescription?: ReactNode;
|
|
31
|
+
save: string;
|
|
32
|
+
cancel: string;
|
|
33
|
+
/** Shown instead of a switch on required categories, e.g. "Always on". */
|
|
34
|
+
required: string;
|
|
35
|
+
}
|
|
36
|
+
interface CookieConsentProps {
|
|
37
|
+
mode: CookieConsentMode;
|
|
38
|
+
categories: CookieCategory[];
|
|
39
|
+
/** The saved answer, or `null` while the person hasn't answered. */
|
|
40
|
+
value: CookieChoices | null;
|
|
41
|
+
/** Called with the full answer: accept or reject all, the saved preferences, or a switch (inline). */
|
|
42
|
+
onChange: (value: CookieChoices) => void;
|
|
43
|
+
labels: CookieConsentLabels;
|
|
44
|
+
/** Preferences dialog visibility, to open it from outside (e.g. a footer link). Optional in `banner`. */
|
|
45
|
+
open?: boolean;
|
|
46
|
+
onOpenChange?: (open: boolean) => void;
|
|
47
|
+
/** Stable ids for buttons and switches, e.g. for analytics click triggers. */
|
|
48
|
+
getId?: (kind: 'button' | 'switch', name: string) => string;
|
|
49
|
+
className?: string;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Cookie consent in one component: the banner, the preferences dialog and the inline settings,
|
|
53
|
+
* chosen with `mode`. Controlled: the consumer stores `value` and loads non-essential scripts only
|
|
54
|
+
* after the person allows them. Accept and reject weigh the same, so rejecting is as easy as
|
|
55
|
+
* accepting (GDPR / ePrivacy).
|
|
56
|
+
*/
|
|
57
|
+
declare const CookieConsent: ({ mode, categories, value, onChange, labels, open, onOpenChange, getId, className, }: CookieConsentProps) => react_jsx_runtime.JSX.Element;
|
|
58
|
+
|
|
59
|
+
export { type CookieCategory, type CookieChoices, CookieConsent, type CookieConsentLabels, type CookieConsentMode, type CookieConsentProps };
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
export {
|
|
2
|
-
import '../../../chunk-
|
|
3
|
-
import '../../../chunk-
|
|
1
|
+
export { CookieConsent } from '../../../chunk-VK24YOIC.js';
|
|
2
|
+
import '../../../chunk-J7X6NLSR.js';
|
|
3
|
+
import '../../../chunk-KSNAVEJP.js';
|
|
4
4
|
import '../../../chunk-QT62VC36.js';
|
|
5
5
|
import '../../../chunk-53YMHM24.js';
|
|
6
|
-
import '../../../chunk-BNEEI7S5.js';
|
|
7
6
|
import '../../../chunk-JCJP427C.js';
|
|
7
|
+
import '../../../chunk-BNEEI7S5.js';
|
|
8
8
|
import '../../../chunk-KL6I2JFC.js';
|
|
9
9
|
import '../../../chunk-P4Z7HH66.js';
|
|
10
|
-
import '../../../chunk-
|
|
10
|
+
import '../../../chunk-SPDOYFCU.js';
|
|
11
11
|
import '../../../chunk-6LLGTBM6.js';
|
|
12
12
|
//# sourceMappingURL=index.js.map
|
|
13
13
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
|
package/dist/index.d.ts
CHANGED
|
@@ -11,14 +11,16 @@ export { Accordion, AccordionProps } from './components/molecules/Accordion/inde
|
|
|
11
11
|
export { BottomSheet, BottomSheetProps } from './components/molecules/BottomSheet/index.js';
|
|
12
12
|
export { BreadcrumbItem, Breadcrumbs, BreadcrumbsProps } from './components/molecules/Breadcrumbs/index.js';
|
|
13
13
|
export { Card, CardContent, CardContentProps, CardDescription, CardDescriptionProps, CardFooter, CardFooterProps, CardHeader, CardHeaderProps, CardProps, CardTitle, CardTitleProps } from './components/molecules/Card/index.js';
|
|
14
|
-
export {
|
|
15
|
-
export { CookieCategory, CookiePreferences, CookiePreferencesProps } from './components/molecules/CookiePreferences/index.js';
|
|
14
|
+
export { Carousel, CarouselProps } from './components/molecules/Carousel/index.js';
|
|
16
15
|
export { Drawer, DrawerProps } from './components/molecules/Drawer/index.js';
|
|
16
|
+
export { Dropdown, DropdownOption, DropdownProps } from './components/molecules/Dropdown/index.js';
|
|
17
17
|
export { Language, LanguageOption, LanguageProps } from './components/molecules/Language/index.js';
|
|
18
|
+
export { MediaCard, MediaCardProps } from './components/molecules/MediaCard/index.js';
|
|
18
19
|
export { Modal, ModalProps } from './components/molecules/Modal/index.js';
|
|
19
20
|
export { Snackbar, SnackbarProps } from './components/molecules/Snackbar/index.js';
|
|
20
21
|
export { Table, TableBody, TableCell, TableCellProps, TableHead, TableHeaderCell, TableHeaderCellProps, TableProps, TableRow } from './components/molecules/Table/index.js';
|
|
21
22
|
export { Timeline, TimelineItem, TimelineProps } from './components/molecules/Timeline/index.js';
|
|
23
|
+
export { CookieCategory, CookieChoices, CookieConsent, CookieConsentLabels, CookieConsentMode, CookieConsentProps } from './components/organisms/CookieConsent/index.js';
|
|
22
24
|
export { useDelayedUnmount } from './hooks/useDelayedUnmount/index.js';
|
|
23
25
|
export { useDismissableLayer } from './hooks/useDismissableLayer/index.js';
|
|
24
26
|
export { useFocusTrap } from './hooks/useFocusTrap/index.js';
|
|
@@ -30,4 +32,5 @@ import 'react';
|
|
|
30
32
|
import 'class-variance-authority/types';
|
|
31
33
|
import 'class-variance-authority';
|
|
32
34
|
import 'react/jsx-runtime';
|
|
35
|
+
import './Select.styles-CeZROqOk.js';
|
|
33
36
|
import 'clsx';
|
package/dist/index.js
CHANGED
|
@@ -1,32 +1,35 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export { Drawer } from './chunk-VGLFR5SB.js';
|
|
1
|
+
export { Dropdown } from './chunk-XUGSIK2P.js';
|
|
3
2
|
export { Language } from './chunk-2YBZCUME.js';
|
|
4
|
-
export {
|
|
3
|
+
export { MediaCard } from './chunk-4TPQTZSR.js';
|
|
4
|
+
export { Snackbar } from './chunk-27HTTVFO.js';
|
|
5
5
|
export { Table, TableBody, TableCell, TableHead, TableHeaderCell, TableRow } from './chunk-XCUA543I.js';
|
|
6
|
-
export { Timeline } from './chunk-
|
|
7
|
-
export {
|
|
6
|
+
export { Timeline } from './chunk-TRLFK626.js';
|
|
7
|
+
export { CookieConsent } from './chunk-VK24YOIC.js';
|
|
8
|
+
export { Modal } from './chunk-J7X6NLSR.js';
|
|
9
|
+
export { Switch } from './chunk-KSNAVEJP.js';
|
|
10
|
+
export { Textarea } from './chunk-UUW7L2AV.js';
|
|
8
11
|
export { Accordion } from './chunk-V3YXRI7M.js';
|
|
9
|
-
export { BottomSheet } from './chunk-
|
|
10
|
-
export { Breadcrumbs } from './chunk-
|
|
11
|
-
export { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from './chunk-
|
|
12
|
-
export {
|
|
13
|
-
export {
|
|
14
|
-
export {
|
|
15
|
-
export { Switch } from './chunk-ZABQF65Z.js';
|
|
12
|
+
export { BottomSheet } from './chunk-NTXFFBL6.js';
|
|
13
|
+
export { Breadcrumbs } from './chunk-VCJN4FS2.js';
|
|
14
|
+
export { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from './chunk-ZH2EDGW6.js';
|
|
15
|
+
export { Carousel } from './chunk-LLJXVAR6.js';
|
|
16
|
+
export { useMediaQuery } from './chunk-2HCMNEIQ.js';
|
|
17
|
+
export { Drawer } from './chunk-TO3FF6FR.js';
|
|
16
18
|
export { useFocusTrap } from './chunk-QT62VC36.js';
|
|
17
19
|
export { useScrollLock } from './chunk-53YMHM24.js';
|
|
18
|
-
export { useDelayedUnmount } from './chunk-BNEEI7S5.js';
|
|
19
20
|
export { useDismissableLayer } from './chunk-JCJP427C.js';
|
|
21
|
+
export { useDelayedUnmount } from './chunk-BNEEI7S5.js';
|
|
20
22
|
import './chunk-GQMA2AQI.js';
|
|
21
23
|
export { Button, buttonStyles } from './chunk-KL6I2JFC.js';
|
|
22
24
|
export { useMergedRef } from './chunk-P4Z7HH66.js';
|
|
23
|
-
export { Icon } from './chunk-
|
|
24
|
-
export { Image } from './chunk-
|
|
25
|
-
export { Input } from './chunk-
|
|
26
|
-
export { Link } from './chunk-
|
|
27
|
-
export { Select } from './chunk-
|
|
25
|
+
export { Icon } from './chunk-NA7YKEO4.js';
|
|
26
|
+
export { Image } from './chunk-KAU7S3D4.js';
|
|
27
|
+
export { Input } from './chunk-IY452YEX.js';
|
|
28
|
+
export { Link } from './chunk-5LKLTY55.js';
|
|
29
|
+
export { Select } from './chunk-DIA7L6IA.js';
|
|
30
|
+
import './chunk-4H6VER5P.js';
|
|
28
31
|
import './chunk-FFKHEBQ7.js';
|
|
29
|
-
export { RichText, elementByVariant } from './chunk-
|
|
32
|
+
export { RichText, elementByVariant } from './chunk-SPDOYFCU.js';
|
|
30
33
|
export { cn } from './chunk-6LLGTBM6.js';
|
|
31
34
|
//# sourceMappingURL=index.js.map
|
|
32
35
|
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inzumer/ui-library",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "React UI component library for the Inzumer design system",
|
|
6
6
|
"license": "MIT",
|
|
@@ -84,22 +84,30 @@
|
|
|
84
84
|
"types": "./dist/components/molecules/Card/index.d.ts",
|
|
85
85
|
"import": "./dist/components/molecules/Card/index.js"
|
|
86
86
|
},
|
|
87
|
-
"./
|
|
88
|
-
"types": "./dist/components/molecules/
|
|
89
|
-
"import": "./dist/components/molecules/
|
|
87
|
+
"./carousel": {
|
|
88
|
+
"types": "./dist/components/molecules/Carousel/index.d.ts",
|
|
89
|
+
"import": "./dist/components/molecules/Carousel/index.js"
|
|
90
90
|
},
|
|
91
|
-
"./cookie-
|
|
92
|
-
"types": "./dist/components/
|
|
93
|
-
"import": "./dist/components/
|
|
91
|
+
"./cookie-consent": {
|
|
92
|
+
"types": "./dist/components/organisms/CookieConsent/index.d.ts",
|
|
93
|
+
"import": "./dist/components/organisms/CookieConsent/index.js"
|
|
94
94
|
},
|
|
95
95
|
"./drawer": {
|
|
96
96
|
"types": "./dist/components/molecules/Drawer/index.d.ts",
|
|
97
97
|
"import": "./dist/components/molecules/Drawer/index.js"
|
|
98
98
|
},
|
|
99
|
+
"./dropdown": {
|
|
100
|
+
"types": "./dist/components/molecules/Dropdown/index.d.ts",
|
|
101
|
+
"import": "./dist/components/molecules/Dropdown/index.js"
|
|
102
|
+
},
|
|
99
103
|
"./language": {
|
|
100
104
|
"types": "./dist/components/molecules/Language/index.d.ts",
|
|
101
105
|
"import": "./dist/components/molecules/Language/index.js"
|
|
102
106
|
},
|
|
107
|
+
"./media-card": {
|
|
108
|
+
"types": "./dist/components/molecules/MediaCard/index.d.ts",
|
|
109
|
+
"import": "./dist/components/molecules/MediaCard/index.js"
|
|
110
|
+
},
|
|
103
111
|
"./modal": {
|
|
104
112
|
"types": "./dist/components/molecules/Modal/index.d.ts",
|
|
105
113
|
"import": "./dist/components/molecules/Modal/index.js"
|
package/dist/chunk-36CVKI5R.js
DELETED
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import { Modal } from './chunk-W3H7DYWX.js';
|
|
2
|
-
import { Switch } from './chunk-ZABQF65Z.js';
|
|
3
|
-
import { Button } from './chunk-KL6I2JFC.js';
|
|
4
|
-
import { RichText } from './chunk-P4CV2EPR.js';
|
|
5
|
-
import { useId } from 'react';
|
|
6
|
-
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
7
|
-
|
|
8
|
-
// src/components/molecules/CookiePreferences/CookiePreferences.styles.ts
|
|
9
|
-
var cookiePreferencesIntroStyles = "mb-4 text-sm text-[var(--text-secondary)]";
|
|
10
|
-
var cookieCategoryListStyles = "flex flex-col gap-4";
|
|
11
|
-
var cookieCategoryStyles = "flex flex-col gap-2 rounded-lg border border-[var(--border-default)] p-4";
|
|
12
|
-
var cookieCategoryHeaderStyles = "flex items-center justify-between gap-4";
|
|
13
|
-
var cookieCategoryTitleStyles = "font-semibold text-[var(--text-primary)]";
|
|
14
|
-
var cookieCategoryRequiredStyles = "text-xs font-semibold text-[var(--text-secondary)]";
|
|
15
|
-
var cookieCategoryDescriptionStyles = "text-sm text-[var(--text-secondary)]";
|
|
16
|
-
var CookiePreferences = ({
|
|
17
|
-
open,
|
|
18
|
-
onClose,
|
|
19
|
-
title,
|
|
20
|
-
description,
|
|
21
|
-
categories,
|
|
22
|
-
value,
|
|
23
|
-
onChange,
|
|
24
|
-
onSave,
|
|
25
|
-
saveLabel,
|
|
26
|
-
cancelLabel,
|
|
27
|
-
requiredLabel,
|
|
28
|
-
idPrefix
|
|
29
|
-
}) => {
|
|
30
|
-
const baseId = useId();
|
|
31
|
-
const prefix = idPrefix ?? baseId;
|
|
32
|
-
return /* @__PURE__ */ jsxs(
|
|
33
|
-
Modal,
|
|
34
|
-
{
|
|
35
|
-
open,
|
|
36
|
-
onClose,
|
|
37
|
-
title,
|
|
38
|
-
footer: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
39
|
-
/* @__PURE__ */ jsx(Button, { id: `${prefix}-cancel`, type: "button", variant: "ghost", onClick: onClose, children: cancelLabel }),
|
|
40
|
-
/* @__PURE__ */ jsx(Button, { id: `${prefix}-save`, type: "button", onClick: onSave, children: saveLabel })
|
|
41
|
-
] }),
|
|
42
|
-
children: [
|
|
43
|
-
description && /* @__PURE__ */ jsx(RichText, { as: "p", variant: "p3", className: cookiePreferencesIntroStyles, children: description }),
|
|
44
|
-
/* @__PURE__ */ jsx("ul", { className: cookieCategoryListStyles, children: categories.map((category) => {
|
|
45
|
-
const descriptionId = `${prefix}-${category.id}-description`;
|
|
46
|
-
return /* @__PURE__ */ jsxs("li", { className: cookieCategoryStyles, children: [
|
|
47
|
-
/* @__PURE__ */ jsx("div", { className: cookieCategoryHeaderStyles, children: category.required ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
48
|
-
/* @__PURE__ */ jsx(RichText, { as: "h3", variant: "p2", className: cookieCategoryTitleStyles, children: category.title }),
|
|
49
|
-
/* @__PURE__ */ jsx(RichText, { as: "span", variant: "p4", className: cookieCategoryRequiredStyles, children: requiredLabel })
|
|
50
|
-
] }) : /* @__PURE__ */ jsx(
|
|
51
|
-
Switch,
|
|
52
|
-
{
|
|
53
|
-
id: `${prefix}-${category.id}`,
|
|
54
|
-
label: category.title,
|
|
55
|
-
checked: value[category.id] === true,
|
|
56
|
-
onCheckedChange: (checked) => onChange(category.id, checked),
|
|
57
|
-
"aria-describedby": descriptionId
|
|
58
|
-
}
|
|
59
|
-
) }),
|
|
60
|
-
/* @__PURE__ */ jsx(
|
|
61
|
-
RichText,
|
|
62
|
-
{
|
|
63
|
-
as: "p",
|
|
64
|
-
id: descriptionId,
|
|
65
|
-
variant: "p3",
|
|
66
|
-
className: cookieCategoryDescriptionStyles,
|
|
67
|
-
children: category.description
|
|
68
|
-
}
|
|
69
|
-
)
|
|
70
|
-
] }, category.id);
|
|
71
|
-
}) })
|
|
72
|
-
]
|
|
73
|
-
}
|
|
74
|
-
);
|
|
75
|
-
};
|
|
76
|
-
|
|
77
|
-
export { CookiePreferences };
|
|
78
|
-
//# sourceMappingURL=chunk-36CVKI5R.js.map
|
|
79
|
-
//# sourceMappingURL=chunk-36CVKI5R.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/molecules/CookiePreferences/CookiePreferences.styles.ts","../src/components/molecules/CookiePreferences/CookiePreferences.tsx"],"names":[],"mappings":";;;;;;;;AAAO,IAAM,4BAAA,GAA+B,2CAAA;AAErC,IAAM,wBAAA,GAA2B,qBAAA;AAEjC,IAAM,oBAAA,GACX,0EAAA;AAEK,IAAM,0BAAA,GAA6B,yCAAA;AAEnC,IAAM,yBAAA,GAA4B,0CAAA;AAElC,IAAM,4BAAA,GAA+B,oDAAA;AAErC,IAAM,+BAAA,GAAkC,sCAAA;AC6BxC,IAAM,oBAAoB,CAAC;AAAA,EAChC,IAAA;AAAA,EACA,OAAA;AAAA,EACA,KAAA;AAAA,EACA,WAAA;AAAA,EACA,UAAA;AAAA,EACA,KAAA;AAAA,EACA,QAAA;AAAA,EACA,MAAA;AAAA,EACA,SAAA;AAAA,EACA,WAAA;AAAA,EACA,aAAA;AAAA,EACA;AACF,CAAA,KAA8B;AAC5B,EAAA,MAAM,SAAS,KAAA,EAAM;AACrB,EAAA,MAAM,SAAS,QAAA,IAAY,MAAA;AAC3B,EAAA,uBACE,IAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,IAAA;AAAA,MACA,OAAA;AAAA,MACA,KAAA;AAAA,MACA,wBACE,IAAA,CAAA,QAAA,EAAA,EACE,QAAA,EAAA;AAAA,wBAAA,GAAA,CAAC,MAAA,EAAA,EAAO,EAAA,EAAI,CAAA,EAAG,MAAM,CAAA,OAAA,CAAA,EAAW,IAAA,EAAK,QAAA,EAAS,OAAA,EAAQ,OAAA,EAAQ,OAAA,EAAS,OAAA,EACpE,QAAA,EAAA,WAAA,EACH,CAAA;AAAA,wBACA,GAAA,CAAC,MAAA,EAAA,EAAO,EAAA,EAAI,CAAA,EAAG,MAAM,SAAS,IAAA,EAAK,QAAA,EAAS,OAAA,EAAS,MAAA,EAClD,QAAA,EAAA,SAAA,EACH;AAAA,OAAA,EACF,CAAA;AAAA,MAGD,QAAA,EAAA;AAAA,QAAA,WAAA,oBACC,GAAA,CAAC,YAAS,EAAA,EAAG,GAAA,EAAI,SAAQ,IAAA,EAAK,SAAA,EAAW,8BACtC,QAAA,EAAA,WAAA,EACH,CAAA;AAAA,4BAED,IAAA,EAAA,EAAG,SAAA,EAAW,0BACZ,QAAA,EAAA,UAAA,CAAW,GAAA,CAAI,CAAC,QAAA,KAAa;AAC5B,UAAA,MAAM,aAAA,GAAgB,CAAA,EAAG,MAAM,CAAA,CAAA,EAAI,SAAS,EAAE,CAAA,YAAA,CAAA;AAC9C,UAAA,uBACE,IAAA,CAAC,IAAA,EAAA,EAAqB,SAAA,EAAW,oBAAA,EAC/B,QAAA,EAAA;AAAA,4BAAA,GAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAW,0BAAA,EACb,QAAA,EAAA,QAAA,CAAS,2BACR,IAAA,CAAA,QAAA,EAAA,EACE,QAAA,EAAA;AAAA,8BAAA,GAAA,CAAC,QAAA,EAAA,EAAS,IAAG,IAAA,EAAK,OAAA,EAAQ,MAAK,SAAA,EAAW,yBAAA,EACvC,mBAAS,KAAA,EACZ,CAAA;AAAA,8BACA,GAAA,CAAC,YAAS,EAAA,EAAG,MAAA,EAAO,SAAQ,IAAA,EAAK,SAAA,EAAW,8BACzC,QAAA,EAAA,aAAA,EACH;AAAA,aAAA,EACF,CAAA,mBAEA,GAAA;AAAA,cAAC,MAAA;AAAA,cAAA;AAAA,gBACC,EAAA,EAAI,CAAA,EAAG,MAAM,CAAA,CAAA,EAAI,SAAS,EAAE,CAAA,CAAA;AAAA,gBAC5B,OAAO,QAAA,CAAS,KAAA;AAAA,gBAChB,OAAA,EAAS,KAAA,CAAM,QAAA,CAAS,EAAE,CAAA,KAAM,IAAA;AAAA,gBAChC,iBAAiB,CAAC,OAAA,KAAY,QAAA,CAAS,QAAA,CAAS,IAAI,OAAO,CAAA;AAAA,gBAC3D,kBAAA,EAAkB;AAAA;AAAA,aACpB,EAEJ,CAAA;AAAA,4BACA,GAAA;AAAA,cAAC,QAAA;AAAA,cAAA;AAAA,gBACC,EAAA,EAAG,GAAA;AAAA,gBACH,EAAA,EAAI,aAAA;AAAA,gBACJ,OAAA,EAAQ,IAAA;AAAA,gBACR,SAAA,EAAW,+BAAA;AAAA,gBAEV,QAAA,EAAA,QAAA,CAAS;AAAA;AAAA;AACZ,WAAA,EAAA,EA5BO,SAAS,EA6BlB,CAAA;AAAA,QAEJ,CAAC,CAAA,EACH;AAAA;AAAA;AAAA,GACF;AAEJ","file":"chunk-36CVKI5R.js","sourcesContent":["export const cookiePreferencesIntroStyles = 'mb-4 text-sm text-[var(--text-secondary)]';\n\nexport const cookieCategoryListStyles = 'flex flex-col gap-4';\n\nexport const cookieCategoryStyles =\n 'flex flex-col gap-2 rounded-lg border border-[var(--border-default)] p-4';\n\nexport const cookieCategoryHeaderStyles = 'flex items-center justify-between gap-4';\n\nexport const cookieCategoryTitleStyles = 'font-semibold text-[var(--text-primary)]';\n\nexport const cookieCategoryRequiredStyles = 'text-xs font-semibold text-[var(--text-secondary)]';\n\nexport const cookieCategoryDescriptionStyles = 'text-sm text-[var(--text-secondary)]';\n","import { useId, type ReactNode } from 'react';\nimport { Button, Modal, RichText, Switch } from '@components';\nimport {\n cookieCategoryDescriptionStyles,\n cookieCategoryHeaderStyles,\n cookieCategoryListStyles,\n cookieCategoryRequiredStyles,\n cookieCategoryStyles,\n cookieCategoryTitleStyles,\n cookiePreferencesIntroStyles,\n} from './CookiePreferences.styles';\n\nexport interface CookieCategory {\n id: string;\n title: string;\n description: ReactNode;\n /** Strictly necessary cookies can't be turned off; they show `requiredLabel` instead of a switch. */\n required?: boolean;\n}\n\nexport interface CookiePreferencesProps {\n open: boolean;\n onClose: () => void;\n title: ReactNode;\n description?: ReactNode;\n categories: CookieCategory[];\n /** Enabled state of each optional category, by id. */\n value: Record<string, boolean>;\n onChange: (id: string, enabled: boolean) => void;\n onSave: () => void;\n saveLabel: string;\n cancelLabel: string;\n /** e.g. \"Always on\". */\n requiredLabel: string;\n /** Prefix for stable ids: `<prefix>-<category id>` switches and `<prefix>-save` / `<prefix>-cancel` buttons. */\n idPrefix?: string;\n}\n\n/**\n * Per-category cookie choices in a `Modal` (focus trapped, Escape closes). Controlled: the\n * consumer holds `value` and persists it on `onSave`.\n */\nexport const CookiePreferences = ({\n open,\n onClose,\n title,\n description,\n categories,\n value,\n onChange,\n onSave,\n saveLabel,\n cancelLabel,\n requiredLabel,\n idPrefix,\n}: CookiePreferencesProps) => {\n const baseId = useId();\n const prefix = idPrefix ?? baseId;\n return (\n <Modal\n open={open}\n onClose={onClose}\n title={title}\n footer={\n <>\n <Button id={`${prefix}-cancel`} type=\"button\" variant=\"ghost\" onClick={onClose}>\n {cancelLabel}\n </Button>\n <Button id={`${prefix}-save`} type=\"button\" onClick={onSave}>\n {saveLabel}\n </Button>\n </>\n }\n >\n {description && (\n <RichText as=\"p\" variant=\"p3\" className={cookiePreferencesIntroStyles}>\n {description}\n </RichText>\n )}\n <ul className={cookieCategoryListStyles}>\n {categories.map((category) => {\n const descriptionId = `${prefix}-${category.id}-description`;\n return (\n <li key={category.id} className={cookieCategoryStyles}>\n <div className={cookieCategoryHeaderStyles}>\n {category.required ? (\n <>\n <RichText as=\"h3\" variant=\"p2\" className={cookieCategoryTitleStyles}>\n {category.title}\n </RichText>\n <RichText as=\"span\" variant=\"p4\" className={cookieCategoryRequiredStyles}>\n {requiredLabel}\n </RichText>\n </>\n ) : (\n <Switch\n id={`${prefix}-${category.id}`}\n label={category.title}\n checked={value[category.id] === true}\n onCheckedChange={(checked) => onChange(category.id, checked)}\n aria-describedby={descriptionId}\n />\n )}\n </div>\n <RichText\n as=\"p\"\n id={descriptionId}\n variant=\"p3\"\n className={cookieCategoryDescriptionStyles}\n >\n {category.description}\n </RichText>\n </li>\n );\n })}\n </ul>\n </Modal>\n );\n};\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/atoms/Input/Input.tsx"],"names":[],"mappings":";;;;;;AAkBO,IAAM,KAAA,GAAQ,UAAA;AAAA,EACnB,CAAC,EAAE,SAAA,EAAW,KAAA,EAAO,SAAA,EAAW,KAAA,EAAO,IAAA,EAAM,KAAA,EAAO,EAAA,EAAI,MAAA,EAAQ,GAAG,KAAA,IAAS,GAAA,KAAQ;AAClF,IAAA,MAAM,cAAc,KAAA,EAAM;AAC1B,IAAA,MAAM,KAAK,MAAA,IAAU,WAAA;AACrB,IAAA,MAAM,aAAA,GAAgB,QAAQ,OAAA,GAAU,KAAA;AAExC,IAAA,uBACE,IAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAU,uBAAA,EACZ,QAAA,EAAA;AAAA,MAAA,KAAA,oBACC,GAAA,CAAC,OAAA,EAAA,EAAM,OAAA,EAAS,EAAA,EACd,QAAA,kBAAA,GAAA,CAAC,QAAA,EAAA,EAAS,EAAA,EAAG,MAAA,EAAO,OAAA,EAAQ,IAAA,EAAK,SAAA,EAAW,gBAAA,EACzC,iBACH,CAAA,EACF,CAAA;AAAA,sBAEF,GAAA;AAAA,QAAC,OAAA;AAAA,QAAA;AAAA,UACC,GAAA;AAAA,UACA,EAAA;AAAA,UACA,kBAAA,EAAkB,QAAQ,CAAA,EAAG,EAAE,WAAW,IAAA,GAAO,CAAA,EAAG,EAAE,CAAA,KAAA,CAAA,GAAU,MAAA;AAAA,UAChE,cAAA,EAAc,QAAQ,MAAA,GAAS,MAAA;AAAA,UAC/B,SAAA,EAAW,GAAG,WAAA,CAAY,EAAE,OAAO,aAAA,EAAe,SAAA,EAAW,CAAA,EAAG,SAAS,CAAA;AAAA,UACxE,GAAG;AAAA;AAAA,OACN;AAAA,MACC,KAAA,oBACC,GAAA,CAAC,QAAA,EAAA,EAAS,EAAA,EAAG,KAAI,EAAA,EAAI,CAAA,EAAG,EAAE,CAAA,MAAA,CAAA,EAAU,MAAK,OAAA,EAAQ,OAAA,EAAQ,IAAA,EAAK,SAAA,EAAW,kBACtE,QAAA,EAAA,KAAA,EACH,CAAA;AAAA,MAED,CAAC,KAAA,IAAS,IAAA,oBACT,GAAA,CAAC,YAAS,EAAA,EAAG,GAAA,EAAI,EAAA,EAAI,CAAA,EAAG,EAAE,CAAA,KAAA,CAAA,EAAS,OAAA,EAAQ,IAAA,EAAK,SAAA,EAAW,iBACxD,QAAA,EAAA,IAAA,EACH;AAAA,KAAA,EAEJ,CAAA;AAAA,EAEJ;AACF;AAEA,KAAA,CAAM,WAAA,GAAc,OAAA","file":"chunk-DP274HDM.js","sourcesContent":["import type { VariantProps } from 'class-variance-authority';\nimport { forwardRef, useId, type InputHTMLAttributes } from 'react';\nimport { RichText } from '@components';\nimport { cn } from '@utils';\nimport {\n inputErrorStyles,\n inputHintStyles,\n inputLabelStyles,\n inputStyles,\n} from './Input.styles';\n\nexport type InputProps = InputHTMLAttributes<HTMLInputElement> &\n VariantProps<typeof inputStyles> & {\n label?: string;\n hint?: string;\n error?: string;\n };\n\nexport const Input = forwardRef<HTMLInputElement, InputProps>(\n ({ className, state, inputSize, label, hint, error, id: idProp, ...props }, ref) => {\n const generatedId = useId();\n const id = idProp ?? generatedId;\n const resolvedState = error ? 'error' : state;\n\n return (\n <div className=\"flex flex-col gap-1.5\">\n {label && (\n <label htmlFor={id}>\n <RichText as=\"span\" variant=\"p3\" className={inputLabelStyles}>\n {label}\n </RichText>\n </label>\n )}\n <input\n ref={ref}\n id={id}\n aria-describedby={error ? `${id}-error` : hint ? `${id}-hint` : undefined}\n aria-invalid={error ? 'true' : undefined}\n className={cn(inputStyles({ state: resolvedState, inputSize }), className)}\n {...props}\n />\n {error && (\n <RichText as=\"p\" id={`${id}-error`} role=\"alert\" variant=\"p4\" className={inputErrorStyles}>\n {error}\n </RichText>\n )}\n {!error && hint && (\n <RichText as=\"p\" id={`${id}-hint`} variant=\"p4\" className={inputHintStyles}>\n {hint}\n </RichText>\n )}\n </div>\n );\n },\n);\n\nInput.displayName = 'Input';\n"]}
|