@uninspired/cookie-banner 0.0.15 → 0.0.17

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.
@@ -964,17 +964,17 @@ const Text = ({
964
964
  )
965
965
  );
966
966
  };
967
- const root$2 = "_root_12udu_53";
968
- const noTarget = "_noTarget_12udu_65";
969
- const collapsible = "_collapsible_12udu_74";
970
- const header$1 = "_header_12udu_77";
971
- const heading = "_heading_12udu_84";
972
- const chevron$1 = "_chevron_12udu_90";
973
- const open$1 = "_open_12udu_95";
974
- const settings = "_settings_12udu_101";
975
- const footer = "_footer_12udu_115";
976
- const legal = "_legal_12udu_122";
977
- const actions$1 = "_actions_12udu_125";
967
+ const root$2 = "_root_8pi9z_53";
968
+ const noTarget = "_noTarget_8pi9z_66";
969
+ const collapsible = "_collapsible_8pi9z_73";
970
+ const header$1 = "_header_8pi9z_76";
971
+ const heading = "_heading_8pi9z_83";
972
+ const chevron$1 = "_chevron_8pi9z_89";
973
+ const open$1 = "_open_8pi9z_94";
974
+ const settings = "_settings_8pi9z_100";
975
+ const footer = "_footer_8pi9z_114";
976
+ const legal = "_legal_8pi9z_121";
977
+ const actions$1 = "_actions_8pi9z_124";
978
978
  const classes$2 = {
979
979
  root: root$2,
980
980
  noTarget,
@@ -2006,11 +2006,19 @@ class Cookies {
2006
2006
  );
2007
2007
  };
2008
2008
  set = (key, value, ttl = 365) => {
2009
+ if (typeof document === "undefined") {
2010
+ console.log("Can't set cookie in non-browser environment");
2011
+ return;
2012
+ }
2009
2013
  const expires = new Date(Date.now() + ttl * 24 * 60 * 60 * 1e3);
2010
2014
  const cookie = `${this.#prefix}${key}=${this.#serialize(value)}; expires=${expires}; path=/; domain=${this.#domain}; SameSite=${this.#sameSite}; ${this.#secure ? "secure" : ""}`;
2011
2015
  document.cookie = cookie;
2012
2016
  };
2013
2017
  get = (key) => {
2018
+ if (typeof document === "undefined") {
2019
+ console.log("Can't get cookie in non-browser environment");
2020
+ return;
2021
+ }
2014
2022
  const match = document.cookie.match(
2015
2023
  new RegExp(`(?:^|; )${this.#prefix}${key}=([^;]*)`)
2016
2024
  );
@@ -962,17 +962,17 @@ const Text = ({
962
962
  )
963
963
  );
964
964
  };
965
- const root$2 = "_root_12udu_53";
966
- const noTarget = "_noTarget_12udu_65";
967
- const collapsible = "_collapsible_12udu_74";
968
- const header$1 = "_header_12udu_77";
969
- const heading = "_heading_12udu_84";
970
- const chevron$1 = "_chevron_12udu_90";
971
- const open$1 = "_open_12udu_95";
972
- const settings = "_settings_12udu_101";
973
- const footer = "_footer_12udu_115";
974
- const legal = "_legal_12udu_122";
975
- const actions$1 = "_actions_12udu_125";
965
+ const root$2 = "_root_8pi9z_53";
966
+ const noTarget = "_noTarget_8pi9z_66";
967
+ const collapsible = "_collapsible_8pi9z_73";
968
+ const header$1 = "_header_8pi9z_76";
969
+ const heading = "_heading_8pi9z_83";
970
+ const chevron$1 = "_chevron_8pi9z_89";
971
+ const open$1 = "_open_8pi9z_94";
972
+ const settings = "_settings_8pi9z_100";
973
+ const footer = "_footer_8pi9z_114";
974
+ const legal = "_legal_8pi9z_121";
975
+ const actions$1 = "_actions_8pi9z_124";
976
976
  const classes$2 = {
977
977
  root: root$2,
978
978
  noTarget,
@@ -2004,11 +2004,19 @@ class Cookies {
2004
2004
  );
2005
2005
  };
2006
2006
  set = (key, value, ttl = 365) => {
2007
+ if (typeof document === "undefined") {
2008
+ console.log("Can't set cookie in non-browser environment");
2009
+ return;
2010
+ }
2007
2011
  const expires = new Date(Date.now() + ttl * 24 * 60 * 60 * 1e3);
2008
2012
  const cookie = `${this.#prefix}${key}=${this.#serialize(value)}; expires=${expires}; path=/; domain=${this.#domain}; SameSite=${this.#sameSite}; ${this.#secure ? "secure" : ""}`;
2009
2013
  document.cookie = cookie;
2010
2014
  };
2011
2015
  get = (key) => {
2016
+ if (typeof document === "undefined") {
2017
+ console.log("Can't get cookie in non-browser environment");
2018
+ return;
2019
+ }
2012
2020
  const match = document.cookie.match(
2013
2021
  new RegExp(`(?:^|; )${this.#prefix}${key}=([^;]*)`)
2014
2022
  );
@@ -102,7 +102,7 @@
102
102
  }
103
103
  }
104
104
  }
105
- @keyframes _contentShow_12udu_1 {
105
+ @keyframes _contentShow_8pi9z_1 {
106
106
  from {
107
107
  opacity: 0;
108
108
  transform: translateX(-100px);
@@ -113,7 +113,7 @@
113
113
  }
114
114
  }
115
115
 
116
- @keyframes _contentHide_12udu_1 {
116
+ @keyframes _contentHide_8pi9z_1 {
117
117
  from {
118
118
  opacity: 1;
119
119
  transform: translateX(0px);
@@ -124,7 +124,7 @@
124
124
  }
125
125
  }
126
126
 
127
- @keyframes _slideDown_12udu_1 {
127
+ @keyframes _slideDown_8pi9z_1 {
128
128
  0% {
129
129
  max-height: var(--cb-size-settings-max-height);
130
130
  overflow: auto;
@@ -139,7 +139,7 @@
139
139
  }
140
140
  }
141
141
 
142
- @keyframes _slideUp_12udu_1 {
142
+ @keyframes _slideUp_8pi9z_1 {
143
143
  0% {
144
144
  max-height: 0;
145
145
  overflow: hidden;
@@ -154,7 +154,7 @@
154
154
  }
155
155
  }
156
156
 
157
- ._root_12udu_53 {
157
+ ._root_8pi9z_53 {
158
158
  display: flex;
159
159
  flex-direction: column;
160
160
  gap: var(--cb-space-md);
@@ -164,69 +164,68 @@
164
164
  border-radius: var(--cb-radius-md);
165
165
  overflow: hidden;
166
166
  will-change: opacity, transform;
167
- animation: _contentShow_12udu_1 150ms cubic-bezier(0.16, 1, 0.3, 1);
167
+ animation: _contentShow_8pi9z_1 150ms cubic-bezier(0.16, 1, 0.3, 1);
168
+ width: 100%;
168
169
 
169
- &._noTarget_12udu_65 {
170
+ &._noTarget_8pi9z_66 {
170
171
  position: fixed;
171
172
  bottom: var(--cb-space-md);
172
173
  left: var(--cb-space-md);
173
-
174
- width: 100%;
175
174
  max-width: var(--cb-size-banner-max-width);
176
175
  }
177
176
 
178
- ._collapsible_12udu_74 {
177
+ ._collapsible_8pi9z_73 {
179
178
  display: contents;
180
179
 
181
- ._header_12udu_77 {
180
+ ._header_8pi9z_76 {
182
181
  display: flex;
183
182
  flex-direction: row;
184
183
  align-items: flex-start;
185
184
  justify-content: space-between;
186
185
  gap: var(--cb-space-md);
187
186
 
188
- ._heading_12udu_84 {
187
+ ._heading_8pi9z_83 {
189
188
  display: flex;
190
189
  flex-direction: column;
191
190
  align-items: flex-start;
192
191
  }
193
192
 
194
- ._chevron_12udu_90 {
193
+ ._chevron_8pi9z_89 {
195
194
  transform: rotate(0deg);
196
195
  will-change: transform;
197
196
  transition: transform 150ms ease-out;
198
197
 
199
- &._open_12udu_95 {
198
+ &._open_8pi9z_94 {
200
199
  transform: rotate(180deg);
201
200
  }
202
201
  }
203
202
  }
204
203
 
205
- ._settings_12udu_101 {
204
+ ._settings_8pi9z_100 {
206
205
  display: flex;
207
206
  flex-direction: column;
208
207
  background-color: var(--cb-color-background-muted);
209
208
  border-radius: var(--cb-radius-md);
210
209
  overflow: hidden;
211
210
  will-change: max-height, overflow;
212
- animation: _slideDown_12udu_1 250ms ease-out;
211
+ animation: _slideDown_8pi9z_1 250ms ease-out;
213
212
 
214
213
  &[data-state="open"] {
215
- animation: _slideUp_12udu_1 250ms ease-out;
214
+ animation: _slideUp_8pi9z_1 250ms ease-out;
216
215
  }
217
216
  }
218
217
 
219
- ._footer_12udu_115 {
218
+ ._footer_8pi9z_114 {
220
219
  display: flex;
221
220
  flex-direction: row;
222
221
  align-items: center;
223
222
  justify-content: space-between;
224
223
  gap: var(--cb-space-md);
225
224
 
226
- ._legal_12udu_122 {
225
+ ._legal_8pi9z_121 {
227
226
  }
228
227
 
229
- ._actions_12udu_125 {
228
+ ._actions_8pi9z_124 {
230
229
  display: flex;
231
230
  flex-direction: row;
232
231
  align-items: center;