@latte-macchiat-io/latte-vanilla-components 0.0.425 → 0.0.427
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/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { useEffect, useState } from 'react';
|
|
4
4
|
|
|
5
5
|
import { getCookie, setCookie } from './cookie';
|
|
6
|
-
import { consentActions, consentContent,
|
|
6
|
+
import { consentActions, consentContent, consentOverlay } from './styles.css';
|
|
7
7
|
import { cn } from '../../utils/styleOverride';
|
|
8
8
|
|
|
9
9
|
import { Button } from '../Button';
|
|
@@ -15,7 +15,7 @@ declare const window: Window &
|
|
|
15
15
|
gtag: any;
|
|
16
16
|
};
|
|
17
17
|
|
|
18
|
-
export interface ConsentCookieProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'color'
|
|
18
|
+
export interface ConsentCookieProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'color'> {
|
|
19
19
|
cookieName?: string;
|
|
20
20
|
cookieExpirationDays?: number;
|
|
21
21
|
onAccept?: () => void;
|
|
@@ -30,7 +30,6 @@ export interface ConsentCookieProps extends Omit<React.HTMLAttributes<HTMLDivEle
|
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
export const ConsentCookie = ({
|
|
33
|
-
variant,
|
|
34
33
|
onAccept,
|
|
35
34
|
onReject,
|
|
36
35
|
children,
|
|
@@ -89,11 +88,11 @@ export const ConsentCookie = ({
|
|
|
89
88
|
if (!showConsent) return null;
|
|
90
89
|
|
|
91
90
|
return (
|
|
92
|
-
<div className={cn(
|
|
91
|
+
<div className={cn(consentOverlay, className)} role="dialog" aria-modal="true" aria-labelledby="consent-title">
|
|
93
92
|
<div className={consentContent}>
|
|
94
93
|
{children}
|
|
95
94
|
<div className={consentActions}>
|
|
96
|
-
<Button size="sm" onClick={handleReject}>
|
|
95
|
+
<Button size="sm" variant="secondary" onClick={handleReject}>
|
|
97
96
|
{translations?.actions.reject || 'Reject'}
|
|
98
97
|
</Button>
|
|
99
98
|
<Button variant="primary" size="sm" onClick={handleAccept}>
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { keyframes, style } from '@vanilla-extract/css';
|
|
2
|
-
import { recipe, RecipeVariants } from '@vanilla-extract/recipes';
|
|
3
2
|
import { queries } from '../../styles/mediaqueries';
|
|
4
3
|
import { themeContract } from '../../theme/contract.css';
|
|
5
4
|
import { generateResponsiveMedia } from '../../utils/generateResponsiveMedia';
|
|
@@ -20,7 +19,7 @@ const slideUp = keyframes({
|
|
|
20
19
|
},
|
|
21
20
|
});
|
|
22
21
|
|
|
23
|
-
const consentOverlay = style(
|
|
22
|
+
export const consentOverlay = style(
|
|
24
23
|
{
|
|
25
24
|
top: 0,
|
|
26
25
|
left: 0,
|
|
@@ -94,88 +93,3 @@ export const consentActions = style(
|
|
|
94
93
|
},
|
|
95
94
|
'consent-actions'
|
|
96
95
|
);
|
|
97
|
-
|
|
98
|
-
export const consentRecipe = recipe(
|
|
99
|
-
{
|
|
100
|
-
base: consentOverlay,
|
|
101
|
-
|
|
102
|
-
variants: {
|
|
103
|
-
// position: {
|
|
104
|
-
// 'bottom-right': {},
|
|
105
|
-
// 'bottom-left': {
|
|
106
|
-
// // selectors: {
|
|
107
|
-
// // '& > div': {
|
|
108
|
-
// // left: themeContract.space.md,
|
|
109
|
-
// // right: 'auto',
|
|
110
|
-
// // },
|
|
111
|
-
// // },
|
|
112
|
-
// },
|
|
113
|
-
// 'bottom-center': {
|
|
114
|
-
// // selectors: {
|
|
115
|
-
// // '& > div': {
|
|
116
|
-
// // left: '50%',
|
|
117
|
-
// // right: 'auto',
|
|
118
|
-
// // transform: 'translateX(-50%)',
|
|
119
|
-
// // },
|
|
120
|
-
// // },
|
|
121
|
-
// },
|
|
122
|
-
// 'top-right': {
|
|
123
|
-
// // selectors: {
|
|
124
|
-
// // '& > div': {
|
|
125
|
-
// // top: themeContract.space.md,
|
|
126
|
-
// // bottom: 'auto',
|
|
127
|
-
// // },
|
|
128
|
-
// // },
|
|
129
|
-
// },
|
|
130
|
-
// 'top-left': {
|
|
131
|
-
// // selectors: {
|
|
132
|
-
// // '& > div': {
|
|
133
|
-
// // top: themeContract.space.md,
|
|
134
|
-
// // bottom: 'auto',
|
|
135
|
-
// // left: themeContract.space.md,
|
|
136
|
-
// // right: 'auto',
|
|
137
|
-
// // },
|
|
138
|
-
// // },
|
|
139
|
-
// },
|
|
140
|
-
// 'top-center': {
|
|
141
|
-
// // selectors: {
|
|
142
|
-
// // '& > div': {
|
|
143
|
-
// // top: themeContract.space.md,
|
|
144
|
-
// // bottom: 'auto',
|
|
145
|
-
// // left: '50%',
|
|
146
|
-
// // right: 'auto',
|
|
147
|
-
// // transform: 'translateX(-50%)',
|
|
148
|
-
// // },
|
|
149
|
-
// // },
|
|
150
|
-
// },
|
|
151
|
-
// },
|
|
152
|
-
variant: {
|
|
153
|
-
modal: {},
|
|
154
|
-
banner: {
|
|
155
|
-
'::before': {
|
|
156
|
-
display: 'none',
|
|
157
|
-
},
|
|
158
|
-
|
|
159
|
-
// selectors: {
|
|
160
|
-
// '& > div': {
|
|
161
|
-
// position: 'static',
|
|
162
|
-
// width: '100%',
|
|
163
|
-
// maxWidth: 'none',
|
|
164
|
-
// borderRadius: 0,
|
|
165
|
-
// bottom: 'auto',
|
|
166
|
-
// right: 'auto',
|
|
167
|
-
// },
|
|
168
|
-
// },
|
|
169
|
-
},
|
|
170
|
-
},
|
|
171
|
-
},
|
|
172
|
-
|
|
173
|
-
defaultVariants: {
|
|
174
|
-
// position: 'bottom-right',
|
|
175
|
-
variant: 'modal',
|
|
176
|
-
},
|
|
177
|
-
},
|
|
178
|
-
'consent'
|
|
179
|
-
);
|
|
180
|
-
|
|
181
|
-
export type ConsentCookieVariants = RecipeVariants<typeof consentRecipe>;
|