krl-alfred 2.18.13 → 2.18.15

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.
@@ -14,105 +14,124 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
14
14
  return (mod && mod.__esModule) ? mod : { "default": mod };
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.WithoutOldPriceUnderline = exports.WithoutOldPrice = exports.WithoutImageOffset = exports.Minimal = exports.WithoutImageInfoText = exports.WithoutBeltBadge = exports.DarkImageInfoText = exports.ResponsiveWithNewImageType = exports.WithCustomBadge = exports.OutOfStock = exports.NoDiscount = exports.Default = void 0;
17
+ exports.WithoutOldPriceUnderline = exports.WithoutOldPrice = exports.WithoutImageOffset = exports.Minimal = exports.WithoutImageInfoText = exports.WithoutBeltBadge = exports.DarkImageInfoText = exports.ResponsiveWithNewImageType = exports.WithCustomBadge = exports.OutOfStock = exports.NoDiscount = exports.Default = exports.allProductCardArgs = void 0;
18
18
  var jsx_runtime_1 = require("react/jsx-runtime");
19
19
  var ProductCardVertical_1 = __importDefault(require("../ProductCardVertical"));
20
+ var props_1 = require("../props");
20
21
  var Badges_1 = __importDefault(require("../../Badges"));
22
+ var props_2 = require("../../Badges/props");
23
+ var DefaultImage = ((0, jsx_runtime_1.jsx)("img", { src: "https://kiralarsin.s3.eu-central-1.amazonaws.com/products/4MOMSMAMAROOANAKUC_1.jpg", alt: "\u00DCr\u00FCn g\u00F6rseli", style: { width: "100%", height: "100%", objectFit: "cover" } }));
24
+ var DefaultCustomBadge = (0, jsx_runtime_1.jsx)(Badges_1.default, { layout: "text", variant: "light", title: "\u00D6zel" });
25
+ /**
26
+ * Tüm ProductCardVertical propları — Default ve varyantlar için ortak taban.
27
+ * hasDiscount bileşende henüz kullanılmıyor; kontrol paneli ve dokümantasyon için set edilir.
28
+ */
29
+ exports.allProductCardArgs = {
30
+ title: "Apple iPad Air WiFi 64GB (2020)",
31
+ description: "50Q9900 50'' 126 Ekran QLED Smart 4K Ultra HD TV",
32
+ hasDiscount: true,
33
+ hasCustomBadge: false,
34
+ customBadge: DefaultCustomBadge,
35
+ price: "12.545,24 TL",
36
+ oldPrice: "15.000,00 TL",
37
+ oldPricePeriod: "hafta",
38
+ slug: "https://www.kiralarsin.com",
39
+ period: "hafta",
40
+ discountRate: 32,
41
+ isResponsive: false,
42
+ image: DefaultImage,
43
+ hasNewImageType: false,
44
+ hasOutOfStock: false,
45
+ hasBeltBadge: true,
46
+ isShowOldPrice: true,
47
+ beltBadgeVariant: "primary",
48
+ beltBadgeTitle: "İndirimli",
49
+ imageInfoText: "<strong>AĞUST</strong> koduyla sepette 250 TL indirim",
50
+ imageInfoTextVariant: "secondary",
51
+ isOldPricePeriodUnderline: true,
52
+ hasImageOffset: true,
53
+ };
21
54
  exports.default = {
22
55
  title: "Components/ProductCard/ProductCard Vertical",
23
- component: function (props) { return ((0, jsx_runtime_1.jsx)("div", __assign({ style: { maxWidth: "240px" } }, { children: (0, jsx_runtime_1.jsx)(ProductCardVertical_1.default, __assign({}, props)) }))); },
56
+ component: ProductCardVertical_1.default,
24
57
  tags: ["autodocs"],
25
58
  argTypes: {
26
- title: { control: "text" },
27
- description: { control: "text" },
28
- hasDiscount: { control: "boolean" },
59
+ title: { control: "text", description: "Ürün başlığı" },
60
+ description: { control: "text", description: "Kısa açıklama" },
61
+ hasDiscount: {
62
+ control: "boolean",
63
+ description: "İndirim bayrağı (gelecek kullanım / API)",
64
+ },
29
65
  price: { control: "text" },
30
66
  oldPrice: { control: "text" },
31
67
  oldPricePeriod: { control: "text" },
32
- slug: { control: "text" },
68
+ slug: {
69
+ control: "text",
70
+ description: "Ürün URL’i — story’de kartı saran link için",
71
+ },
33
72
  period: { control: "text" },
34
73
  discountRate: { control: "number" },
35
74
  isResponsive: { control: "boolean" },
36
- image: { control: "none" },
75
+ image: { control: false, description: "Story’de sabit görsel" },
37
76
  hasCustomBadge: { control: "boolean" },
38
- customBadge: { control: "none" },
77
+ customBadge: { control: false },
39
78
  hasNewImageType: { control: "boolean" },
40
79
  hasOutOfStock: { control: "boolean" },
41
80
  hasBeltBadge: { control: "boolean" },
42
81
  beltBadgeVariant: {
43
82
  control: "select",
44
- options: ["primary", "secondary", "light"],
83
+ options: props_2.variants,
45
84
  },
46
85
  beltBadgeTitle: { control: "text" },
47
86
  imageInfoText: { control: "text" },
48
87
  imageInfoTextVariant: {
49
88
  control: "select",
50
- options: ["secondary", "dark"],
89
+ options: props_1.imageInfoTextVariants,
51
90
  },
52
91
  isShowOldPrice: { control: "boolean" },
53
92
  isOldPricePeriodUnderline: { control: "boolean" },
54
93
  hasImageOffset: { control: "boolean" },
55
94
  },
95
+ render: function (args) {
96
+ var card = (0, jsx_runtime_1.jsx)(ProductCardVertical_1.default, __assign({}, args));
97
+ var wrapped = args.slug && String(args.slug).trim() !== "" ? ((0, jsx_runtime_1.jsx)("a", __assign({ href: args.slug, style: { textDecoration: "none", color: "inherit", display: "block" } }, { children: card }))) : (card);
98
+ return (0, jsx_runtime_1.jsx)("div", __assign({ style: { maxWidth: "240px" } }, { children: wrapped }));
99
+ },
56
100
  };
57
- var DefaultImage = ((0, jsx_runtime_1.jsx)("img", { src: "https://kiralarsin.s3.eu-central-1.amazonaws.com/products/4MOMSMAMAROOANAKUC_1.jpg", alt: "default", style: { width: "100%", height: "100%", objectFit: "cover" } }));
58
- var DefaultBadge = (0, jsx_runtime_1.jsx)(Badges_1.default, { layout: "text", variant: "light", title: "test" });
59
101
  exports.Default = {
60
- args: {
61
- title: "Apple iPad Air WiFi 64GB (2020)",
62
- description: "50Q9900 50'' 126 Ekran QLED Smart 4K Ultra HD TV",
63
- hasDiscount: true,
64
- price: "12.545,24 TL",
65
- oldPrice: "12.545,24 TL",
66
- oldPricePeriod: "hafta",
67
- slug: "https://www.kiralarsin.com",
68
- period: "hafta",
69
- discountRate: 32,
70
- isResponsive: false,
71
- image: DefaultImage,
72
- hasCustomBadge: false,
73
- customBadge: DefaultBadge,
74
- hasNewImageType: false,
75
- hasOutOfStock: false,
76
- hasBeltBadge: true,
77
- beltBadgeVariant: "primary",
78
- beltBadgeTitle: "discount",
79
- imageInfoText: "<strong>AĞUST</strong> koduyla sepette 250 TL indirim",
80
- imageInfoTextVariant: "secondary",
81
- isShowOldPrice: true,
82
- isOldPricePeriodUnderline: true,
83
- hasImageOffset: true,
84
- },
102
+ name: "Tüm proplar (varsayılan)",
103
+ args: __assign({}, exports.allProductCardArgs),
85
104
  };
86
105
  exports.NoDiscount = {
87
- args: __assign(__assign({}, exports.Default.args), { hasDiscount: false, discountRate: 0, oldPrice: null, isShowOldPrice: false }),
106
+ args: __assign(__assign({}, exports.allProductCardArgs), { hasDiscount: false, discountRate: 0, oldPrice: null, isShowOldPrice: false }),
88
107
  };
89
108
  exports.OutOfStock = {
90
- args: __assign(__assign({}, exports.Default.args), { hasOutOfStock: true, hasDiscount: false, discountRate: 0, hasBeltBadge: false }),
109
+ args: __assign(__assign({}, exports.allProductCardArgs), { hasOutOfStock: true, hasDiscount: false, discountRate: 0, hasBeltBadge: false }),
91
110
  };
92
111
  exports.WithCustomBadge = {
93
- args: __assign(__assign({}, exports.Default.args), { hasCustomBadge: true, hasBeltBadge: false, customBadge: (0, jsx_runtime_1.jsx)(Badges_1.default, { layout: "text", variant: "dark", title: "Yeni" }) }),
112
+ args: __assign(__assign({}, exports.allProductCardArgs), { hasCustomBadge: true, hasBeltBadge: false, customBadge: (0, jsx_runtime_1.jsx)(Badges_1.default, { layout: "text", variant: "dark", title: "Yeni" }) }),
94
113
  };
95
114
  exports.ResponsiveWithNewImageType = {
96
- args: __assign(__assign({}, exports.Default.args), { isResponsive: true, hasNewImageType: true, hasImageOffset: false }),
115
+ args: __assign(__assign({}, exports.allProductCardArgs), { isResponsive: true, hasNewImageType: true, hasImageOffset: false }),
97
116
  };
98
117
  exports.DarkImageInfoText = {
99
- args: __assign(__assign({}, exports.Default.args), { imageInfoTextVariant: "dark", imageInfoText: "<strong>ÖZEL</strong> fiyat" }),
118
+ args: __assign(__assign({}, exports.allProductCardArgs), { imageInfoTextVariant: "dark", imageInfoText: "<strong>ÖZEL</strong> fiyat" }),
100
119
  };
101
120
  exports.WithoutBeltBadge = {
102
- args: __assign(__assign({}, exports.Default.args), { hasBeltBadge: false }),
121
+ args: __assign(__assign({}, exports.allProductCardArgs), { hasBeltBadge: false }),
103
122
  };
104
123
  exports.WithoutImageInfoText = {
105
- args: __assign(__assign({}, exports.Default.args), { imageInfoText: null }),
124
+ args: __assign(__assign({}, exports.allProductCardArgs), { imageInfoText: null }),
106
125
  };
107
126
  exports.Minimal = {
108
- args: __assign(__assign({}, exports.Default.args), { hasDiscount: false, discountRate: 0, oldPrice: null, isShowOldPrice: false, hasBeltBadge: false, imageInfoText: null }),
127
+ args: __assign(__assign({}, exports.allProductCardArgs), { hasDiscount: false, discountRate: 0, oldPrice: null, isShowOldPrice: false, hasBeltBadge: false, imageInfoText: null }),
109
128
  };
110
129
  exports.WithoutImageOffset = {
111
- args: __assign(__assign({}, exports.Default.args), { hasImageOffset: false }),
130
+ args: __assign(__assign({}, exports.allProductCardArgs), { hasImageOffset: false }),
112
131
  };
113
132
  exports.WithoutOldPrice = {
114
- args: __assign(__assign({}, exports.Default.args), { isShowOldPrice: false, oldPrice: null }),
133
+ args: __assign(__assign({}, exports.allProductCardArgs), { isShowOldPrice: false, oldPrice: null }),
115
134
  };
116
135
  exports.WithoutOldPriceUnderline = {
117
- args: __assign(__assign({}, exports.Default.args), { isOldPricePeriodUnderline: false }),
136
+ args: __assign(__assign({}, exports.allProductCardArgs), { isOldPricePeriodUnderline: false }),
118
137
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "krl-alfred",
3
- "version": "2.18.13",
3
+ "version": "2.18.15",
4
4
  "files": [
5
5
  "dist"
6
6
  ],