@latte-macchiat-io/latte-vanilla-components 0.0.322 → 0.0.324

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@latte-macchiat-io/latte-vanilla-components",
3
- "version": "0.0.322",
3
+ "version": "0.0.324",
4
4
  "description": "Beautiful components for amazing projects, with a touch of Vanilla 🥤",
5
5
  "type": "module",
6
6
  "main": "./src/index.ts",
@@ -7,6 +7,7 @@ import { themeContract } from '../../theme/contract.css';
7
7
 
8
8
  import { generateResponsiveMedia } from '../../utils/generateResponsiveMedia';
9
9
  import { generateResponsiveMediaCalc } from '../../utils/generateResponsiveMediaCalc';
10
+ import { mergeResponsiveMedias } from '../../utils/mergeResponsiveMedias';
10
11
 
11
12
  export const carouselRecipe = recipe(
12
13
  {
@@ -184,13 +185,12 @@ export const carouselBullets = style({
184
185
  position: 'absolute',
185
186
  justifyContent: 'center',
186
187
 
187
- '@media': {
188
- ...generateResponsiveMedia({
188
+ '@media': mergeResponsiveMedias(
189
+ generateResponsiveMedia({
189
190
  gap: themeContract.carousel.bullet.gap,
190
191
  }),
191
-
192
- [queries.lg]: {},
193
- },
192
+ generateResponsiveMediaCalc('top', '100%', themeContract.carousel.bullet.positionVerticalOffset, '+')
193
+ ),
194
194
  });
195
195
 
196
196
  export const carouselBullet = style(
@@ -37,6 +37,14 @@ const themeCarouselBase = {
37
37
  },
38
38
  bullet: {
39
39
  borderRadius: '1000px',
40
+ positionVerticalOffset: {
41
+ mobile: '15',
42
+ sm: '15',
43
+ md: '30',
44
+ lg: '30',
45
+ xl: '50',
46
+ '2xl': '50',
47
+ },
40
48
  bottom: {
41
49
  mobile: '15px',
42
50
  sm: '15px',
@@ -851,6 +851,14 @@ export const themeContract = createGlobalThemeContract({
851
851
  borderRadius: 'latte-carousel-bullet-borderRadius',
852
852
  backgroundColor: 'latte-carousel-bullet-backgroundColor',
853
853
  activeBackgroundColor: 'latte-carousel-bullet-active-backgroundColor',
854
+ positionVerticalOffset: {
855
+ mobile: 'latte-carousel-nav-positionVerticalOffset-mobile',
856
+ sm: 'latte-carousel-nav-positionVerticalOffset-sm',
857
+ md: 'latte-carousel-nav-positionVerticalOffset-md',
858
+ lg: 'latte-carousel-nav-positionVerticalOffset-lg',
859
+ xl: 'latte-carousel-nav-positionVerticalOffset-xl',
860
+ '2xl': 'latte-carousel-nav-positionVerticalOffset-2xl',
861
+ },
854
862
 
855
863
  gap: {
856
864
  mobile: 'latte-carousel-bullet-gap-mobile',
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Fusionne plusieurs objets responsive générés pour Vanilla Extract
3
+ * sans écraser les valeurs existantes des mêmes breakpoints.
4
+ *
5
+ * Exemple :
6
+ * mergeResponsiveMedias(a, b) => combine les clés communes
7
+ */
8
+ export function mergeResponsiveMedias(...mediaObjects: Record<string, Record<string, string>>[]): Record<string, Record<string, string>> {
9
+ const merged: Record<string, Record<string, string>> = {};
10
+
11
+ for (const obj of mediaObjects) {
12
+ for (const [query, styles] of Object.entries(obj)) {
13
+ merged[query] = {
14
+ ...(merged[query] || {}),
15
+ ...styles,
16
+ };
17
+ }
18
+ }
19
+
20
+ return merged;
21
+ }