@nuvler/cli 0.5.10 → 0.5.12

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.
@@ -1812,6 +1812,21 @@ select {
1812
1812
  line-height: 1.3;
1813
1813
  }
1814
1814
 
1815
+ .mini-banner-link-label {
1816
+ display: inline-flex;
1817
+ align-items: center;
1818
+ width: fit-content;
1819
+ margin-top: 8px;
1820
+ color: var(--color-primary);
1821
+ font-size: 14px;
1822
+ font-weight: 800;
1823
+ }
1824
+
1825
+ .mini-banner-link-label::after {
1826
+ content: "→";
1827
+ margin-left: 6px;
1828
+ }
1829
+
1815
1830
  a.mini-banner-card:hover .mini-banner-image > img {
1816
1831
  transform: scale(1.025);
1817
1832
  }
@@ -2205,16 +2220,20 @@ a.mini-banner-card:focus-visible {
2205
2220
 
2206
2221
  .image-text-media {
2207
2222
  overflow: hidden;
2208
- aspect-ratio: 4 / 3;
2223
+ aspect-ratio: auto;
2209
2224
  border-radius: var(--radius-md);
2210
- background: #eef0ea;
2225
+ background: transparent;
2226
+ }
2227
+
2228
+ .image-text-media img {
2229
+ display: block;
2230
+ width: 100%;
2231
+ height: auto;
2211
2232
  }
2212
2233
 
2213
- .image-text-media img,
2214
2234
  .image-text-media .store-image-placeholder {
2235
+ min-height: 320px;
2215
2236
  width: 100%;
2216
- height: 100%;
2217
- object-fit: cover;
2218
2237
  }
2219
2238
 
2220
2239
  .image-text-copy > span {
@@ -2633,6 +2652,7 @@ a.mini-banner-card:focus-visible {
2633
2652
  color: var(--store-muted);
2634
2653
  font-size: 12px;
2635
2654
  line-height: 1.2;
2655
+ text-decoration: line-through;
2636
2656
  }
2637
2657
 
2638
2658
  .product-card-price strong {
@@ -2844,6 +2864,94 @@ a.mini-banner-card:focus-visible {
2844
2864
  gap: var(--space-3);
2845
2865
  }
2846
2866
 
2867
+ .home-brands-grid[data-columns="1"] {
2868
+ grid-template-columns: repeat(1, minmax(0, 1fr));
2869
+ }
2870
+
2871
+ .home-brands-grid[data-columns="2"] {
2872
+ grid-template-columns: repeat(2, minmax(0, 1fr));
2873
+ }
2874
+
2875
+ .home-brands-grid[data-columns="3"] {
2876
+ grid-template-columns: repeat(3, minmax(0, 1fr));
2877
+ }
2878
+
2879
+ .home-brands-grid[data-columns="4"] {
2880
+ grid-template-columns: repeat(4, minmax(0, 1fr));
2881
+ }
2882
+
2883
+ .home-brands-grid[data-columns="5"] {
2884
+ grid-template-columns: repeat(5, minmax(0, 1fr));
2885
+ }
2886
+
2887
+ .home-brands-grid[data-columns="6"] {
2888
+ grid-template-columns: repeat(6, minmax(0, 1fr));
2889
+ }
2890
+
2891
+ .brands-carousel {
2892
+ position: relative;
2893
+ padding-top: 46px;
2894
+ }
2895
+
2896
+ .brands-carousel-track {
2897
+ display: flex;
2898
+ align-items: stretch;
2899
+ gap: var(--space-3);
2900
+ overflow-x: auto;
2901
+ padding: 4px 0 22px;
2902
+ scroll-behavior: smooth;
2903
+ scroll-snap-type: x mandatory;
2904
+ scrollbar-width: none;
2905
+ }
2906
+
2907
+ .brands-carousel-track::-webkit-scrollbar {
2908
+ display: none;
2909
+ }
2910
+
2911
+ .brands-carousel-track > article,
2912
+ .brands-carousel-track > a {
2913
+ display: grid;
2914
+ min-width: 160px;
2915
+ min-height: 104px;
2916
+ flex: 0 0 calc((100% - 48px) / 5);
2917
+ place-items: center;
2918
+ overflow: hidden;
2919
+ border: 1px solid var(--store-line);
2920
+ border-radius: var(--radius-md);
2921
+ background: var(--store-surface);
2922
+ padding: var(--space-4);
2923
+ scroll-snap-align: start;
2924
+ text-align: center;
2925
+ }
2926
+
2927
+ .brands-carousel-track img {
2928
+ width: 100%;
2929
+ max-width: 150px;
2930
+ max-height: 54px;
2931
+ object-fit: contain;
2932
+ }
2933
+
2934
+ .brands-carousel-track strong {
2935
+ font-size: 14px;
2936
+ }
2937
+
2938
+ .brands-carousel .carousel-arrow {
2939
+ top: 0;
2940
+ width: 34px;
2941
+ height: 34px;
2942
+ transform: none;
2943
+ background: var(--store-surface);
2944
+ }
2945
+
2946
+ .brands-carousel .carousel-arrow-prev {
2947
+ right: 42px;
2948
+ left: auto;
2949
+ }
2950
+
2951
+ .brands-carousel .carousel-arrow-next {
2952
+ right: 0;
2953
+ }
2954
+
2847
2955
  .home-brands-grid > article,
2848
2956
  .home-brands-grid > a {
2849
2957
  display: grid;
@@ -4497,10 +4605,27 @@ a.mini-banner-card:focus-visible {
4497
4605
  grid-template-columns: 1fr;
4498
4606
  }
4499
4607
 
4500
- .home-brands-grid {
4608
+ .home-brands-grid[data-columns="1"] {
4609
+ grid-template-columns: repeat(1, minmax(0, 1fr));
4610
+ }
4611
+
4612
+ .home-brands-grid[data-columns="2"] {
4613
+ grid-template-columns: repeat(2, minmax(0, 1fr));
4614
+ }
4615
+
4616
+ .home-brands-grid[data-columns="3"],
4617
+ .home-brands-grid[data-columns="4"],
4618
+ .home-brands-grid[data-columns="5"],
4619
+ .home-brands-grid[data-columns="6"] {
4501
4620
  grid-template-columns: repeat(3, minmax(0, 1fr));
4502
4621
  }
4503
4622
 
4623
+ .brands-carousel-track > article,
4624
+ .brands-carousel-track > a {
4625
+ min-width: 0;
4626
+ flex-basis: calc((100% - 24px) / 3);
4627
+ }
4628
+
4504
4629
  .benefits-grid > div + div {
4505
4630
  border-top: 1px solid var(--store-line);
4506
4631
  border-left: 0;
@@ -4698,10 +4823,23 @@ a.mini-banner-card:focus-visible {
4698
4823
  font-size: 16px;
4699
4824
  }
4700
4825
 
4701
- .home-brands-grid {
4826
+ .home-brands-grid[data-columns="1"] {
4827
+ grid-template-columns: repeat(1, minmax(0, 1fr));
4828
+ }
4829
+
4830
+ .home-brands-grid[data-columns="2"],
4831
+ .home-brands-grid[data-columns="3"],
4832
+ .home-brands-grid[data-columns="4"],
4833
+ .home-brands-grid[data-columns="5"],
4834
+ .home-brands-grid[data-columns="6"] {
4702
4835
  grid-template-columns: repeat(2, minmax(0, 1fr));
4703
4836
  }
4704
4837
 
4838
+ .brands-carousel-track > article,
4839
+ .brands-carousel-track > a {
4840
+ flex-basis: calc((100% - 12px) / 2);
4841
+ }
4842
+
4705
4843
  .benefits-section {
4706
4844
  padding: 24px 0;
4707
4845
  }
@@ -13,13 +13,13 @@
13
13
  "typecheck": "tsc -p tsconfig.json --noEmit"
14
14
  },
15
15
  "dependencies": {
16
- "@nuvler/theme-sdk": "^1.3.3"
16
+ "@nuvler/theme-sdk": "^1.4.3"
17
17
  },
18
18
  "peerDependencies": {
19
19
  "react": "^19.0.0"
20
20
  },
21
21
  "devDependencies": {
22
- "@nuvler/cli": "^0.5.10",
22
+ "@nuvler/cli": "^0.5.12",
23
23
  "@types/react": "^19.0.0",
24
24
  "react": "^19.0.0",
25
25
  "typescript": "^5.9.0"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuvler/cli",
3
- "version": "0.5.10",
3
+ "version": "0.5.12",
4
4
  "description": "CLI oficial para criação, validação, preview e empacotamento de temas Nuvler",
5
5
  "type": "module",
6
6
  "bin": {
@@ -20,8 +20,8 @@
20
20
  "typecheck": "tsc -p tsconfig.json --noEmit"
21
21
  },
22
22
  "dependencies": {
23
- "@nuvler/theme-schema": "^1.4.0",
24
- "@nuvler/theme-sdk": "^1.4.2",
23
+ "@nuvler/theme-schema": "^1.4.1",
24
+ "@nuvler/theme-sdk": "^1.4.3",
25
25
  "@vitejs/plugin-react": "^6.0.5",
26
26
  "commander": "^15.0.0",
27
27
  "react": "19.2.8",
@@ -10,7 +10,7 @@
10
10
  "typecheck": "tsc -p tsconfig.json --noEmit"
11
11
  },
12
12
  "dependencies": {
13
- "@nuvler/theme-sdk": "^1.4.2",
13
+ "@nuvler/theme-sdk": "^1.4.3",
14
14
  "react": "19.2.8",
15
15
  "react-dom": "19.2.8"
16
16
  },
@@ -116,12 +116,19 @@ function CategoryTree({
116
116
  }
117
117
 
118
118
  function displayPrice(product: ThemeProduct): string | null {
119
- const price = product.promotionalPrice ?? product.price;
119
+ const price = typeof product.promotionalPrice === "number" && typeof product.price === "number" && product.promotionalPrice < product.price
120
+ ? product.promotionalPrice
121
+ : product.price;
120
122
  return typeof price === "number"
121
123
  ? new Intl.NumberFormat("pt-BR", { style: "currency", currency: "BRL" }).format(price)
122
124
  : null;
123
125
  }
124
126
 
127
+ function originalPrice(product: ThemeProduct): string | null {
128
+ if (typeof product.price !== "number" || typeof product.promotionalPrice !== "number" || product.promotionalPrice >= product.price) return null;
129
+ return new Intl.NumberFormat("pt-BR", { style: "currency", currency: "BRL" }).format(product.price);
130
+ }
131
+
125
132
  function SmartSearch({ adapters, showPrices }: { adapters: ThemeRuntimeAdapters; showPrices: boolean }) {
126
133
  const { Link, Image } = adapters;
127
134
  const [value, setValue] = useState("");
@@ -303,7 +310,7 @@ function ProductCard({ product, context, adapters }: {
303
310
  {catalog.showDescription && product.description && (
304
311
  <p className="product-card-description">{plainText(product.description)}</p>
305
312
  )}
306
- {catalog.showPrices && displayPrice(product) && <b>{displayPrice(product)}</b>}
313
+ {catalog.showPrices && displayPrice(product) && <div className="product-card-price">{originalPrice(product) && <s>De: {originalPrice(product)}</s>}<b>{originalPrice(product) ? "por " : ""}{displayPrice(product)}</b></div>}
307
314
  <Link className="button button-secondary button-block" href={href}>
308
315
  Ver detalhes e orçar
309
316
  </Link>