styled-hairomin 0.3.1 → 0.3.2

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/index.cjs.js CHANGED
@@ -293,6 +293,21 @@ function CardVariant({
293
293
  }) {
294
294
  switch (variant) {
295
295
  case "elevated":
296
+ // Default features jika tidak ada di props
297
+ const defaultFeatures = [{
298
+ icon: /*#__PURE__*/jsxRuntime.jsx(fa.FaBed, {}),
299
+ label: "Kasur Lembut"
300
+ }, {
301
+ icon: /*#__PURE__*/jsxRuntime.jsx(fa.FaWifi, {}),
302
+ label: "WiFi Gratis"
303
+ }];
304
+
305
+ // Normalize features dari props
306
+ const features = data.features ? data.features.map(f => typeof f === 'string' ? {
307
+ icon: null,
308
+ label: f
309
+ } : f) : defaultFeatures;
310
+ const priceSuffix = data.priceSuffix || "/malam";
296
311
  return /*#__PURE__*/jsxRuntime.jsxs(ElevatedCard, {
297
312
  children: [/*#__PURE__*/jsxRuntime.jsxs(ElevatedImageWrapper, {
298
313
  children: [/*#__PURE__*/jsxRuntime.jsx(ElevatedImage, {
@@ -304,16 +319,14 @@ function CardVariant({
304
319
  }), /*#__PURE__*/jsxRuntime.jsxs(ElevatedContent, {
305
320
  children: [/*#__PURE__*/jsxRuntime.jsx(ElevatedTitle, {
306
321
  children: data.title
307
- }), /*#__PURE__*/jsxRuntime.jsxs(ElevatedFeatures, {
308
- children: [/*#__PURE__*/jsxRuntime.jsxs(Feature, {
309
- children: [/*#__PURE__*/jsxRuntime.jsx(fa.FaBed, {}), " Kasur Lembut"]
310
- }), /*#__PURE__*/jsxRuntime.jsxs(Feature, {
311
- children: [/*#__PURE__*/jsxRuntime.jsx(fa.FaWifi, {}), " WiFi Gratis"]
312
- })]
322
+ }), /*#__PURE__*/jsxRuntime.jsx(ElevatedFeatures, {
323
+ children: features.map((feature, idx) => /*#__PURE__*/jsxRuntime.jsxs(Feature, {
324
+ children: [feature.icon, feature.label]
325
+ }, idx))
313
326
  }), /*#__PURE__*/jsxRuntime.jsxs(ElevatedFooter, {
314
327
  children: [/*#__PURE__*/jsxRuntime.jsxs(Price, {
315
328
  children: [data.price, /*#__PURE__*/jsxRuntime.jsx("span", {
316
- children: "/malam"
329
+ children: priceSuffix
317
330
  })]
318
331
  }), /*#__PURE__*/jsxRuntime.jsxs(Rating, {
319
332
  children: [/*#__PURE__*/jsxRuntime.jsx(fa.FaStar, {}), " ", data.rating]
package/dist/index.esm.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
  import styled from 'styled-components';
3
- import { FaMapMarkerAlt, FaBed, FaWifi, FaStar, FaDownload, FaCheck, FaChevronRight, FaSearch, FaBars, FaBell, FaFacebookF, FaInstagram, FaTwitter, FaLinkedin, FaPhone, FaEnvelope, FaHome, FaConciergeBell, FaInfoCircle, FaUser } from 'react-icons/fa';
3
+ import { FaMapMarkerAlt, FaStar, FaBed, FaWifi, FaDownload, FaCheck, FaChevronRight, FaSearch, FaBars, FaBell, FaFacebookF, FaInstagram, FaTwitter, FaLinkedin, FaPhone, FaEnvelope, FaHome, FaConciergeBell, FaInfoCircle, FaUser } from 'react-icons/fa';
4
4
  import { jsxs, jsx } from 'react/jsx-runtime';
5
5
  import Link from 'next/link';
6
6
 
@@ -291,6 +291,21 @@ function CardVariant({
291
291
  }) {
292
292
  switch (variant) {
293
293
  case "elevated":
294
+ // Default features jika tidak ada di props
295
+ const defaultFeatures = [{
296
+ icon: /*#__PURE__*/jsx(FaBed, {}),
297
+ label: "Kasur Lembut"
298
+ }, {
299
+ icon: /*#__PURE__*/jsx(FaWifi, {}),
300
+ label: "WiFi Gratis"
301
+ }];
302
+
303
+ // Normalize features dari props
304
+ const features = data.features ? data.features.map(f => typeof f === 'string' ? {
305
+ icon: null,
306
+ label: f
307
+ } : f) : defaultFeatures;
308
+ const priceSuffix = data.priceSuffix || "/malam";
294
309
  return /*#__PURE__*/jsxs(ElevatedCard, {
295
310
  children: [/*#__PURE__*/jsxs(ElevatedImageWrapper, {
296
311
  children: [/*#__PURE__*/jsx(ElevatedImage, {
@@ -302,16 +317,14 @@ function CardVariant({
302
317
  }), /*#__PURE__*/jsxs(ElevatedContent, {
303
318
  children: [/*#__PURE__*/jsx(ElevatedTitle, {
304
319
  children: data.title
305
- }), /*#__PURE__*/jsxs(ElevatedFeatures, {
306
- children: [/*#__PURE__*/jsxs(Feature, {
307
- children: [/*#__PURE__*/jsx(FaBed, {}), " Kasur Lembut"]
308
- }), /*#__PURE__*/jsxs(Feature, {
309
- children: [/*#__PURE__*/jsx(FaWifi, {}), " WiFi Gratis"]
310
- })]
320
+ }), /*#__PURE__*/jsx(ElevatedFeatures, {
321
+ children: features.map((feature, idx) => /*#__PURE__*/jsxs(Feature, {
322
+ children: [feature.icon, feature.label]
323
+ }, idx))
311
324
  }), /*#__PURE__*/jsxs(ElevatedFooter, {
312
325
  children: [/*#__PURE__*/jsxs(Price, {
313
326
  children: [data.price, /*#__PURE__*/jsx("span", {
314
- children: "/malam"
327
+ children: priceSuffix
315
328
  })]
316
329
  }), /*#__PURE__*/jsxs(Rating, {
317
330
  children: [/*#__PURE__*/jsx(FaStar, {}), " ", data.rating]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "styled-hairomin",
3
- "version": "0.3.1",
3
+ "version": "0.3.2",
4
4
  "type": "module",
5
5
  "main": "./dist/index.cjs.js",
6
6
  "module": "./dist/index.esm.js",