krl-alfred 2.19.0 → 2.20.1
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/components/AddressCard/stories/AddressCard.stories.d.ts +2 -1
- package/dist/components/AddressCard/stories/AddressCard.stories.js +6 -5
- package/dist/components/Checkbox/Checkbox.d.ts +1 -1
- package/dist/components/Checkbox/Checkbox.js +3 -7
- package/dist/components/Checkbox/stories/Checkbox.stories.d.ts +1 -1
- package/dist/components/Icon/iconList/PlayMd.d.ts +3 -0
- package/dist/components/Icon/iconList/PlayMd.js +40 -0
- package/dist/components/Icon/iconList/RadioButtonElementChecked.js +1 -1
- package/dist/components/Icon/iconList/Rectangle.js +1 -1
- package/dist/components/Icon/iconList/index.d.ts +5 -1
- package/dist/components/Icon/iconList/index.js +9 -3
- package/dist/components/Modal/Modal.d.ts +1 -1
- package/dist/components/Modal/Modal.js +29 -13
- package/dist/components/Modal/props.d.ts +2 -0
- package/dist/components/Modal/props.js +1 -0
- package/dist/components/Modal/stories/Modal.stories.d.ts +1 -1
- package/dist/components/ProductCardHorizontalMd/ProductCardHorizontalMd.d.ts +1 -1
- package/dist/components/ProductCardHorizontalMd/ProductCardHorizontalMd.js +15 -3
- package/dist/components/ProductCardHorizontalMd/ProductCardHorizontalMd.styled.d.ts +7 -1
- package/dist/components/ProductCardHorizontalMd/ProductCardHorizontalMd.styled.js +19 -13
- package/dist/components/ProductCardHorizontalMd/props.d.ts +8 -0
- package/dist/components/ProductCardHorizontalMd/props.js +6 -1
- package/dist/components/ProductCardHorizontalMd/stories/ProductCardHorizontalMd.stories.d.ts +54 -1
- package/dist/components/ProductCardHorizontalMd/stories/ProductCardHorizontalMd.stories.js +17 -1
- package/dist/components/ProductCardHorizontalSm/ProductCardHorizontalSm.d.ts +1 -1
- package/dist/components/ProductCardHorizontalSm/ProductCardHorizontalSm.js +3 -2
- package/dist/components/ProductCardHorizontalSm/ProductCardHorizontalSm.styled.d.ts +1 -1
- package/dist/components/ProductCardHorizontalSm/ProductCardHorizontalSm.styled.js +5 -2
- package/dist/components/ProductCardHorizontalSm/props.d.ts +5 -3
- package/dist/components/ProductCardHorizontalSm/props.js +1 -0
- package/dist/components/ProductCardHorizontalSm/stories/ProductCardHorizontalSm.stories.d.ts +68 -1
- package/dist/components/ProductCardHorizontalSm/stories/ProductCardHorizontalSm.stories.js +9 -2
- package/dist/components/QuantitySelector/QuantitySelector.d.ts +4 -0
- package/dist/components/QuantitySelector/QuantitySelector.js +31 -0
- package/dist/components/QuantitySelector/QuantitySelector.styled.d.ts +7 -0
- package/dist/components/QuantitySelector/QuantitySelector.styled.js +20 -0
- package/dist/components/QuantitySelector/index.d.ts +1 -0
- package/dist/components/QuantitySelector/index.js +8 -0
- package/dist/components/QuantitySelector/props.d.ts +25 -0
- package/dist/components/QuantitySelector/props.js +19 -0
- package/dist/components/QuantitySelector/stories/QuantitySelector.stories.d.ts +90 -0
- package/dist/components/QuantitySelector/stories/QuantitySelector.stories.js +58 -0
- package/dist/components/RadioButton/layouts/basic/Basic.d.ts +1 -1
- package/dist/components/RadioButton/layouts/basic/Basic.js +3 -7
- package/dist/components/RadioButton/layouts/boxed/Boxed.d.ts +1 -1
- package/dist/components/RadioButton/layouts/boxed/Boxed.js +3 -7
- package/dist/components/RadioButton/layouts/boxedMd/BoxedMd.d.ts +1 -1
- package/dist/components/RadioButton/layouts/boxedMd/BoxedMd.js +3 -7
- package/dist/components/RadioButton/layouts/boxedSm/BoxedSm.d.ts +1 -1
- package/dist/components/RadioButton/layouts/boxedSm/BoxedSm.js +3 -7
- package/dist/components/RadioButton/layouts/boxedWithIcon/BoxedWithIcon.d.ts +1 -1
- package/dist/components/RadioButton/layouts/boxedWithIcon/BoxedWithIcon.js +3 -10
- package/dist/components/RadioButton/layouts/horizontal/Horizontal.js +3 -2
- package/dist/components/RadioGroup/RadioGroup.d.ts +1 -1
- package/dist/components/RadioGroup/RadioGroup.js +2 -2
- package/dist/components/RadioGroup/RadioGroup.styled.js +7 -2
- package/dist/components/RadioGroup/props.d.ts +3 -0
- package/dist/components/RadioGroup/props.js +2 -1
- package/dist/components/RadioGroup/stories/RadioGroup.stories.d.ts +41 -1
- package/dist/components/RadioGroup/stories/RadioGroup.stories.js +19 -1
- package/dist/components/ShoppingCartProduct/ShoppingCartProduct.js +3 -1
- package/dist/components/ShoppingCartProduct/ShoppingCartProduct.styled.d.ts +0 -1
- package/dist/components/ShoppingCartProduct/ShoppingCartProduct.styled.js +3 -4
- package/dist/index.d.ts +2 -1
- package/dist/index.js +3 -1
- package/dist/style/style.min.css +1 -1
- package/dist/style/style.min.css.map +1 -1
- package/dist/utils/getRootCssVariable.d.ts +3 -0
- package/dist/utils/getRootCssVariable.js +13 -0
- package/package.json +1 -1
package/dist/components/ProductCardHorizontalMd/stories/ProductCardHorizontalMd.stories.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import type { ProductCardHorizontalMdProps } from "../props";
|
|
3
3
|
declare const _default: {
|
|
4
4
|
title: string;
|
|
5
|
-
component: React.MemoExoticComponent<({ title, description, listDescription, image, unitPriceText, totalPrice, slug, component, onClick, hasLoading, textSize, hasBgColor, }: import("../props").ProductCardHorizontalMd) => React.JSX.Element>;
|
|
5
|
+
component: React.MemoExoticComponent<({ title, description, listDescription, image, unitPriceText, totalPrice, oldPrice, newPrice, discountRate, variant, slug, component, onClick, hasLoading, textSize, hasBgColor, }: import("../props").ProductCardHorizontalMd) => React.JSX.Element>;
|
|
6
6
|
tags: string[];
|
|
7
7
|
argTypes: {
|
|
8
8
|
title: {
|
|
@@ -20,6 +20,19 @@ declare const _default: {
|
|
|
20
20
|
totalPrice: {
|
|
21
21
|
control: string;
|
|
22
22
|
};
|
|
23
|
+
oldPrice: {
|
|
24
|
+
control: string;
|
|
25
|
+
};
|
|
26
|
+
newPrice: {
|
|
27
|
+
control: string;
|
|
28
|
+
};
|
|
29
|
+
discountRate: {
|
|
30
|
+
control: string;
|
|
31
|
+
};
|
|
32
|
+
variant: {
|
|
33
|
+
control: string;
|
|
34
|
+
options: readonly ["default", "discount"];
|
|
35
|
+
};
|
|
23
36
|
slug: {
|
|
24
37
|
control: string;
|
|
25
38
|
};
|
|
@@ -51,6 +64,10 @@ export declare const Default: {
|
|
|
51
64
|
image?: React.ReactNode;
|
|
52
65
|
unitPriceText?: string;
|
|
53
66
|
totalPrice?: string;
|
|
67
|
+
oldPrice?: string;
|
|
68
|
+
newPrice?: string;
|
|
69
|
+
discountRate?: number;
|
|
70
|
+
variant?: "discount" | "default";
|
|
54
71
|
slug?: string;
|
|
55
72
|
component?: React.ElementType<any, keyof React.JSX.IntrinsicElements>;
|
|
56
73
|
onClick?(): void;
|
|
@@ -68,6 +85,10 @@ export declare const WithoutLink: {
|
|
|
68
85
|
image?: React.ReactNode;
|
|
69
86
|
unitPriceText?: string;
|
|
70
87
|
totalPrice?: string;
|
|
88
|
+
oldPrice?: string;
|
|
89
|
+
newPrice?: string;
|
|
90
|
+
discountRate?: number;
|
|
91
|
+
variant?: "discount" | "default";
|
|
71
92
|
component?: React.ElementType<any, keyof React.JSX.IntrinsicElements>;
|
|
72
93
|
onClick?(): void;
|
|
73
94
|
hasLoading?: boolean;
|
|
@@ -83,6 +104,10 @@ export declare const WithoutUnitPrice: {
|
|
|
83
104
|
listDescription?: string[];
|
|
84
105
|
image?: React.ReactNode;
|
|
85
106
|
totalPrice?: string;
|
|
107
|
+
oldPrice?: string;
|
|
108
|
+
newPrice?: string;
|
|
109
|
+
discountRate?: number;
|
|
110
|
+
variant?: "discount" | "default";
|
|
86
111
|
slug?: string;
|
|
87
112
|
component?: React.ElementType<any, keyof React.JSX.IntrinsicElements>;
|
|
88
113
|
onClick?(): void;
|
|
@@ -100,6 +125,10 @@ export declare const Loading: {
|
|
|
100
125
|
image?: React.ReactNode;
|
|
101
126
|
unitPriceText?: string;
|
|
102
127
|
totalPrice?: string;
|
|
128
|
+
oldPrice?: string;
|
|
129
|
+
newPrice?: string;
|
|
130
|
+
discountRate?: number;
|
|
131
|
+
variant?: "discount" | "default";
|
|
103
132
|
slug?: string;
|
|
104
133
|
component?: React.ElementType<any, keyof React.JSX.IntrinsicElements>;
|
|
105
134
|
onClick?(): void;
|
|
@@ -116,6 +145,10 @@ export declare const TextSizeMd: {
|
|
|
116
145
|
image?: React.ReactNode;
|
|
117
146
|
unitPriceText?: string;
|
|
118
147
|
totalPrice?: string;
|
|
148
|
+
oldPrice?: string;
|
|
149
|
+
newPrice?: string;
|
|
150
|
+
discountRate?: number;
|
|
151
|
+
variant?: "discount" | "default";
|
|
119
152
|
slug?: string;
|
|
120
153
|
component?: React.ElementType<any, keyof React.JSX.IntrinsicElements>;
|
|
121
154
|
onClick?(): void;
|
|
@@ -133,12 +166,28 @@ export declare const WithBgColor: {
|
|
|
133
166
|
image?: React.ReactNode;
|
|
134
167
|
unitPriceText?: string;
|
|
135
168
|
totalPrice?: string;
|
|
169
|
+
oldPrice?: string;
|
|
170
|
+
newPrice?: string;
|
|
171
|
+
discountRate?: number;
|
|
172
|
+
variant?: "discount" | "default";
|
|
136
173
|
component?: React.ElementType<any, keyof React.JSX.IntrinsicElements>;
|
|
137
174
|
onClick?(): void;
|
|
138
175
|
hasLoading?: boolean;
|
|
139
176
|
textSize?: "sm" | "md";
|
|
140
177
|
};
|
|
141
178
|
};
|
|
179
|
+
export declare const Discount: {
|
|
180
|
+
args: {
|
|
181
|
+
title: string;
|
|
182
|
+
image: React.JSX.Element;
|
|
183
|
+
variant: string;
|
|
184
|
+
discountRate: number;
|
|
185
|
+
oldPrice: string;
|
|
186
|
+
newPrice: string;
|
|
187
|
+
hasBgColor: boolean;
|
|
188
|
+
slug: any;
|
|
189
|
+
};
|
|
190
|
+
};
|
|
142
191
|
export declare const ListDescription: {
|
|
143
192
|
args: {
|
|
144
193
|
description: any;
|
|
@@ -150,6 +199,10 @@ export declare const ListDescription: {
|
|
|
150
199
|
image?: React.ReactNode;
|
|
151
200
|
unitPriceText?: string;
|
|
152
201
|
totalPrice?: string;
|
|
202
|
+
oldPrice?: string;
|
|
203
|
+
newPrice?: string;
|
|
204
|
+
discountRate?: number;
|
|
205
|
+
variant?: "discount" | "default";
|
|
153
206
|
component?: React.ElementType<any, keyof React.JSX.IntrinsicElements>;
|
|
154
207
|
onClick?(): void;
|
|
155
208
|
hasLoading?: boolean;
|
|
@@ -14,7 +14,7 @@ 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.ListDescription = exports.WithBgColor = exports.TextSizeMd = exports.Loading = exports.WithoutUnitPrice = exports.WithoutLink = exports.Default = void 0;
|
|
17
|
+
exports.ListDescription = exports.Discount = exports.WithBgColor = exports.TextSizeMd = exports.Loading = exports.WithoutUnitPrice = exports.WithoutLink = exports.Default = void 0;
|
|
18
18
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
19
19
|
var ProductCardHorizontalMd_1 = __importDefault(require("../ProductCardHorizontalMd"));
|
|
20
20
|
var props_1 = require("../props");
|
|
@@ -38,6 +38,10 @@ exports.default = {
|
|
|
38
38
|
listDescription: { control: 'object' },
|
|
39
39
|
unitPriceText: { control: 'text' },
|
|
40
40
|
totalPrice: { control: 'text' },
|
|
41
|
+
oldPrice: { control: 'text' },
|
|
42
|
+
newPrice: { control: 'text' },
|
|
43
|
+
discountRate: { control: 'number' },
|
|
44
|
+
variant: { control: 'select', options: props_1.variants },
|
|
41
45
|
slug: { control: 'text' },
|
|
42
46
|
image: { control: false },
|
|
43
47
|
component: { control: false },
|
|
@@ -65,6 +69,18 @@ exports.TextSizeMd = {
|
|
|
65
69
|
exports.WithBgColor = {
|
|
66
70
|
args: __assign(__assign({}, defaultArgs), { hasBgColor: true, slug: null }),
|
|
67
71
|
};
|
|
72
|
+
exports.Discount = {
|
|
73
|
+
args: {
|
|
74
|
+
title: "Çekirdek kahve",
|
|
75
|
+
image: DefaultImage,
|
|
76
|
+
variant: 'discount',
|
|
77
|
+
discountRate: 20,
|
|
78
|
+
oldPrice: "920 TL",
|
|
79
|
+
newPrice: "520 TL",
|
|
80
|
+
hasBgColor: true,
|
|
81
|
+
slug: null,
|
|
82
|
+
},
|
|
83
|
+
};
|
|
68
84
|
exports.ListDescription = {
|
|
69
85
|
args: __assign(__assign({}, defaultArgs), { description: null, listDescription: ['İki ayda bir gönderim', 'Ücretsiz kargo', 'İptal edilebilir'], hasBgColor: true, textSize: 'md', slug: null }),
|
|
70
86
|
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
declare const _default: React.MemoExoticComponent<({ title, description, price, priceSm, slug, period, image, component, imageComponent, hasImageBorder, imageWidth, imageHeight, infoPosition, hasButton, buttonVariant, buttonText, hasBorder, isSelected, hasTitleWrap, hasButtonRemoveMdDown, hasBordeHover, hasTooltip, tooltipSelectorTitle, tooltipDescription, isDisabled, imageInnerWidth, imageInnerHeight, hasImageRounded, }: import("./props").ProductCardHorizontalSm) => React.JSX.Element>;
|
|
2
|
+
declare const _default: React.MemoExoticComponent<({ title, description, price, priceSm, slug, period, image, component, imageComponent, hasImageBorder, imageWidth, imageHeight, infoPosition, hasButton, buttonVariant, buttonText, hasBorder, isSelected, hasTitleWrap, hasButtonRemoveMdDown, hasDescriptionHideMdDown, hasBordeHover, hasTooltip, tooltipSelectorTitle, tooltipDescription, isDisabled, imageInnerWidth, imageInnerHeight, hasImageRounded, }: import("./props").ProductCardHorizontalSm) => React.JSX.Element>;
|
|
3
3
|
export default _default;
|
|
@@ -40,7 +40,8 @@ var ImageContent = (0, react_1.memo)(function (_a) {
|
|
|
40
40
|
prev.imageComponent === next.imageComponent;
|
|
41
41
|
});
|
|
42
42
|
var ProductCardHorizontalSm = function (_a) {
|
|
43
|
-
var _b = _a.title, title = _b === void 0 ? props_1.ProductCardHorizontalSmDefault.title : _b, _c = _a.description, description = _c === void 0 ? props_1.ProductCardHorizontalSmDefault.description : _c, _d = _a.price, price = _d === void 0 ? props_1.ProductCardHorizontalSmDefault.price : _d, _e = _a.priceSm, priceSm = _e === void 0 ? props_1.ProductCardHorizontalSmDefault.priceSm : _e, _f = _a.slug, slug = _f === void 0 ? props_1.ProductCardHorizontalSmDefault.slug : _f, _g = _a.period, period = _g === void 0 ? props_1.ProductCardHorizontalSmDefault.period : _g, _h = _a.image, image = _h === void 0 ? props_1.ProductCardHorizontalSmDefault.image : _h, _j = _a.component, component = _j === void 0 ? props_1.ProductCardHorizontalSmDefault.component : _j, _k = _a.imageComponent, imageComponent = _k === void 0 ? props_1.ProductCardHorizontalSmDefault.imageComponent : _k, _l = _a.hasImageBorder, hasImageBorder = _l === void 0 ? props_1.ProductCardHorizontalSmDefault.hasImageBorder : _l, _m = _a.imageWidth, imageWidth = _m === void 0 ? props_1.ProductCardHorizontalSmDefault.imageWidth : _m, _o = _a.imageHeight, imageHeight = _o === void 0 ? props_1.ProductCardHorizontalSmDefault.imageHeight : _o, _p = _a.infoPosition, infoPosition = _p === void 0 ? props_1.ProductCardHorizontalSmDefault.infoPosition : _p, _q = _a.hasButton, hasButton = _q === void 0 ? props_1.ProductCardHorizontalSmDefault.hasButton : _q, _r = _a.buttonVariant, buttonVariant = _r === void 0 ? props_1.ProductCardHorizontalSmDefault.buttonVariant : _r, _s = _a.buttonText, buttonText = _s === void 0 ? props_1.ProductCardHorizontalSmDefault.buttonText : _s, _t = _a.hasBorder, hasBorder = _t === void 0 ? props_1.ProductCardHorizontalSmDefault.hasBorder : _t, _u = _a.isSelected, isSelected = _u === void 0 ? props_1.ProductCardHorizontalSmDefault.isSelected : _u, _v = _a.hasTitleWrap, hasTitleWrap = _v === void 0 ? props_1.ProductCardHorizontalSmDefault.hasTitleWrap : _v, _w = _a.hasButtonRemoveMdDown, hasButtonRemoveMdDown = _w === void 0 ? props_1.ProductCardHorizontalSmDefault.hasButtonRemoveMdDown : _w, _x = _a.
|
|
44
|
-
|
|
43
|
+
var _b = _a.title, title = _b === void 0 ? props_1.ProductCardHorizontalSmDefault.title : _b, _c = _a.description, description = _c === void 0 ? props_1.ProductCardHorizontalSmDefault.description : _c, _d = _a.price, price = _d === void 0 ? props_1.ProductCardHorizontalSmDefault.price : _d, _e = _a.priceSm, priceSm = _e === void 0 ? props_1.ProductCardHorizontalSmDefault.priceSm : _e, _f = _a.slug, slug = _f === void 0 ? props_1.ProductCardHorizontalSmDefault.slug : _f, _g = _a.period, period = _g === void 0 ? props_1.ProductCardHorizontalSmDefault.period : _g, _h = _a.image, image = _h === void 0 ? props_1.ProductCardHorizontalSmDefault.image : _h, _j = _a.component, component = _j === void 0 ? props_1.ProductCardHorizontalSmDefault.component : _j, _k = _a.imageComponent, imageComponent = _k === void 0 ? props_1.ProductCardHorizontalSmDefault.imageComponent : _k, _l = _a.hasImageBorder, hasImageBorder = _l === void 0 ? props_1.ProductCardHorizontalSmDefault.hasImageBorder : _l, _m = _a.imageWidth, imageWidth = _m === void 0 ? props_1.ProductCardHorizontalSmDefault.imageWidth : _m, _o = _a.imageHeight, imageHeight = _o === void 0 ? props_1.ProductCardHorizontalSmDefault.imageHeight : _o, _p = _a.infoPosition, infoPosition = _p === void 0 ? props_1.ProductCardHorizontalSmDefault.infoPosition : _p, _q = _a.hasButton, hasButton = _q === void 0 ? props_1.ProductCardHorizontalSmDefault.hasButton : _q, _r = _a.buttonVariant, buttonVariant = _r === void 0 ? props_1.ProductCardHorizontalSmDefault.buttonVariant : _r, _s = _a.buttonText, buttonText = _s === void 0 ? props_1.ProductCardHorizontalSmDefault.buttonText : _s, _t = _a.hasBorder, hasBorder = _t === void 0 ? props_1.ProductCardHorizontalSmDefault.hasBorder : _t, _u = _a.isSelected, isSelected = _u === void 0 ? props_1.ProductCardHorizontalSmDefault.isSelected : _u, _v = _a.hasTitleWrap, hasTitleWrap = _v === void 0 ? props_1.ProductCardHorizontalSmDefault.hasTitleWrap : _v, _w = _a.hasButtonRemoveMdDown, hasButtonRemoveMdDown = _w === void 0 ? props_1.ProductCardHorizontalSmDefault.hasButtonRemoveMdDown : _w, _x = _a.hasDescriptionHideMdDown, hasDescriptionHideMdDown = _x === void 0 ? props_1.ProductCardHorizontalSmDefault.hasDescriptionHideMdDown : _x, _y = _a.hasBordeHover, hasBordeHover = _y === void 0 ? props_1.ProductCardHorizontalSmDefault.hasBordeHover : _y, _z = _a.hasTooltip, hasTooltip = _z === void 0 ? props_1.ProductCardHorizontalSmDefault.hasTooltip : _z, _0 = _a.tooltipSelectorTitle, tooltipSelectorTitle = _0 === void 0 ? props_1.ProductCardHorizontalSmDefault.tooltipSelectorTitle : _0, _1 = _a.tooltipDescription, tooltipDescription = _1 === void 0 ? props_1.ProductCardHorizontalSmDefault.tooltipDescription : _1, _2 = _a.isDisabled, isDisabled = _2 === void 0 ? props_1.ProductCardHorizontalSmDefault.isDisabled : _2, _3 = _a.imageInnerWidth, imageInnerWidth = _3 === void 0 ? props_1.ProductCardHorizontalSmDefault.imageInnerWidth : _3, _4 = _a.imageInnerHeight, imageInnerHeight = _4 === void 0 ? props_1.ProductCardHorizontalSmDefault.imageInnerHeight : _4, _5 = _a.hasImageRounded, hasImageRounded = _5 === void 0 ? props_1.ProductCardHorizontalSmDefault.hasImageRounded : _5;
|
|
44
|
+
var hasPeriod = period != null && period !== "";
|
|
45
|
+
return ((0, jsx_runtime_1.jsxs)(ProductCardHorizontalSm_styled_1.ProductCardHorizontalSmStyled, __assign({ "$hasImageBorder": hasImageBorder, "$imageWidth": imageWidth, "$imageHeight": imageHeight, "$isSelected": isSelected, "$hasBordeHover": hasBordeHover, "$isDisabled": isDisabled }, { children: [(0, jsx_runtime_1.jsx)(ProductCardHorizontalSm_styled_1.Border, { "$isSelected": isSelected, "$hasBordeHover": hasBordeHover, "$hasBorder": hasBorder }), (0, jsx_runtime_1.jsx)(LinkComponent, __assign({ component: component, slug: slug }, { children: (0, jsx_runtime_1.jsxs)(ProductCardHorizontalSm_styled_1.HorizontalSmWrapper, { children: [(0, jsx_runtime_1.jsx)(ImageContent, { image: image, title: title, imageInnerWidth: imageInnerWidth, imageInnerHeight: imageInnerHeight, imageHeight: imageHeight, imageWidth: imageWidth, hasImageBorder: hasImageBorder, hasImageRounded: hasImageRounded, imageComponent: imageComponent }), (0, jsx_runtime_1.jsxs)(ProductCardHorizontalSm_styled_1.TextWrapper, __assign({ "$hasPeriod": hasPeriod }, { children: [(0, jsx_runtime_1.jsx)(ProductCardHorizontalSm_styled_1.Title, __assign({ "$hasTitleWrap": hasTitleWrap }, { children: title })), description && ((0, jsx_runtime_1.jsx)(ProductCardHorizontalSm_styled_1.Description, __assign({ "$hasDescriptionHideMdDown": hasDescriptionHideMdDown }, { children: description }))), infoPosition === "left" && ((0, jsx_runtime_1.jsxs)(ProductCardHorizontalSm_styled_1.PriceContent, __assign({ "$infoPosition": infoPosition }, { children: [(0, jsx_runtime_1.jsxs)(ProductCardHorizontalSm_styled_1.Price, { children: [price, priceSm && (0, jsx_runtime_1.jsx)("small", { children: priceSm })] }), (0, jsx_runtime_1.jsx)(ProductCardHorizontalSm_styled_1.Period, __assign({ "$infoPosition": infoPosition }, { children: period }))] })))] })), (0, jsx_runtime_1.jsxs)(ProductCardHorizontalSm_styled_1.RightContentWrapper, __assign({ "$hasButtonRemoveMdDown": hasButtonRemoveMdDown }, { children: [infoPosition === "right" && ((0, jsx_runtime_1.jsxs)(ProductCardHorizontalSm_styled_1.PriceContent, __assign({ "$infoPosition": infoPosition }, { children: [(0, jsx_runtime_1.jsx)(ProductCardHorizontalSm_styled_1.Period, __assign({ "$infoPosition": infoPosition }, { children: period })), (0, jsx_runtime_1.jsxs)(ProductCardHorizontalSm_styled_1.Price, { children: [price, priceSm && (0, jsx_runtime_1.jsx)("small", { children: priceSm })] })] }))), hasButton && ((0, jsx_runtime_1.jsx)(Button_1.default, __assign({ disabled: isDisabled, variant: buttonVariant, size: "xsmall" }, { children: buttonText }))), hasTooltip && ((0, jsx_runtime_1.jsx)(Tooltip_1.default, __assign({ selectorTitle: tooltipSelectorTitle, popupWidth: "238px", position: "topRight", popupSize: "medium" }, { children: tooltipDescription })))] }))] }) }))] })));
|
|
45
46
|
};
|
|
46
47
|
exports.default = (0, react_1.memo)(ProductCardHorizontalSm);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { ProductCardHorizontalSmStyledProps } from "./props";
|
|
3
3
|
export declare const Title: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, keyof ProductCardHorizontalSmStyledProps> & ProductCardHorizontalSmStyledProps, never> & Partial<Pick<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, keyof ProductCardHorizontalSmStyledProps> & ProductCardHorizontalSmStyledProps, never>>> & string;
|
|
4
|
-
export declare const Description: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, never> & Partial<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, never>>> & string;
|
|
4
|
+
export declare const Description: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, keyof ProductCardHorizontalSmStyledProps> & ProductCardHorizontalSmStyledProps, never> & Partial<Pick<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, keyof ProductCardHorizontalSmStyledProps> & ProductCardHorizontalSmStyledProps, never>>> & string;
|
|
5
5
|
export declare const Border: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof ProductCardHorizontalSmStyledProps> & ProductCardHorizontalSmStyledProps, never> & Partial<Pick<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof ProductCardHorizontalSmStyledProps> & ProductCardHorizontalSmStyledProps, never>>> & string;
|
|
6
6
|
export declare const ProductCardHorizontalSmStyled: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof ProductCardHorizontalSmStyledProps> & ProductCardHorizontalSmStyledProps, never> & Partial<Pick<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof ProductCardHorizontalSmStyledProps> & ProductCardHorizontalSmStyledProps, never>>> & string;
|
|
7
7
|
export declare const HorizontalSmWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never> & Partial<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>> & string;
|
|
@@ -11,7 +11,10 @@ exports.RightContentWrapper = exports.Period = exports.Price = exports.PriceCont
|
|
|
11
11
|
var styled_components_1 = __importDefault(require("styled-components"));
|
|
12
12
|
var devices_1 = require("../../constants/devices");
|
|
13
13
|
exports.Title = styled_components_1.default.strong(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: -webkit-box;\n -webkit-line-clamp: ", ";\n -webkit-box-orient: vertical;\n overflow: hidden;\n word-break: break-word;\n font: var(--body-semi-bold-14-17);\n transition: color 0.2s ease;\n"], ["\n display: -webkit-box;\n -webkit-line-clamp: ", ";\n -webkit-box-orient: vertical;\n overflow: hidden;\n word-break: break-word;\n font: var(--body-semi-bold-14-17);\n transition: color 0.2s ease;\n"])), function (props) { return (props.$hasTitleWrap ? "2" : "1"); });
|
|
14
|
-
exports.Description = styled_components_1.default.p(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n margin: 0.25rem 0 0;\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n overflow: hidden;\n word-break: break-word;\n font: var(--caption-medium-12-15);\n color: var(--grey-50);\n"], ["\n margin: 0.25rem 0 0;\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n overflow: hidden;\n word-break: break-word;\n font: var(--caption-medium-12-15);\n color: var(--grey-50);\n"])))
|
|
14
|
+
exports.Description = styled_components_1.default.p(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n margin: 0.25rem 0 0;\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n overflow: hidden;\n word-break: break-word;\n font: var(--caption-medium-12-15);\n color: var(--grey-50);\n\n ", "\n"], ["\n margin: 0.25rem 0 0;\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n overflow: hidden;\n word-break: break-word;\n font: var(--caption-medium-12-15);\n color: var(--grey-50);\n\n ", "\n"])), function (props) {
|
|
15
|
+
return props.$hasDescriptionHideMdDown &&
|
|
16
|
+
"\n @media only screen and ".concat(devices_1.devices.md, " {\n display: none;\n }\n ");
|
|
17
|
+
});
|
|
15
18
|
exports.Border = styled_components_1.default.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n user-select: none;\n pointer-events: none;\n position: absolute;\n inset: 0;\n border-radius: inherit;\n border: 1px solid transparent;\n opacity: ", ";\n transition: border-color 0.2s ease, opacity 0.2s ease;\n border-color: ", ";\n ", "\n"], ["\n user-select: none;\n pointer-events: none;\n position: absolute;\n inset: 0;\n border-radius: inherit;\n border: 1px solid transparent;\n opacity: ", ";\n transition: border-color 0.2s ease, opacity 0.2s ease;\n border-color: ", ";\n ", "\n"])), function (p) { return (p.$hasBorder ? 1 : 0); }, function (p) { return (p.$hasBorder ? "var(--grey-10)" : "transparent"); }, function (p) { return p.$isSelected && "border-color: var(--primary);border-width: 2px;"; });
|
|
16
19
|
exports.ProductCardHorizontalSmStyled = styled_components_1.default.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n color: var(--dark);\n padding: 0 0.5rem;\n border-radius: 0.5rem;\n position: relative;\n transition: color 0.2s ease;\n\n ", "\n\n ", "\n\n a {\n text-decoration: none;\n color: inherit;\n\n @media ((hover: hover) and (pointer: fine)) {\n &:hover {\n ", " {\n color: var(--primary-hover);\n }\n }\n }\n\n &:active {\n ", " {\n color: var(--primary-hover);\n }\n }\n }\n"], ["\n color: var(--dark);\n padding: 0 0.5rem;\n border-radius: 0.5rem;\n position: relative;\n transition: color 0.2s ease;\n\n ", "\n\n ", "\n\n a {\n text-decoration: none;\n color: inherit;\n\n @media ((hover: hover) and (pointer: fine)) {\n &:hover {\n ", " {\n color: var(--primary-hover);\n }\n }\n }\n\n &:active {\n ", " {\n color: var(--primary-hover);\n }\n }\n }\n"])), function (props) {
|
|
17
20
|
return props.$isDisabled &&
|
|
@@ -22,7 +25,7 @@ exports.ProductCardHorizontalSmStyled = styled_components_1.default.div(template
|
|
|
22
25
|
}, exports.Title, exports.Title);
|
|
23
26
|
exports.HorizontalSmWrapper = styled_components_1.default.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n text-decoration: none;\n display: grid;\n grid-template-columns: auto 1fr auto;\n align-items: center;\n min-height: 66px;\n padding-right: 0.5rem;\n"], ["\n text-decoration: none;\n display: grid;\n grid-template-columns: auto 1fr auto;\n align-items: center;\n min-height: 66px;\n padding-right: 0.5rem;\n"])));
|
|
24
27
|
exports.ImgWrapper = styled_components_1.default.div(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n border: ", ";\n border-radius: 0.5rem;\n position: relative;\n overflow: hidden;\n width: ", ";\n height: ", ";\n display: flex;\n align-items: center;\n justify-content: center;\n margin-right: 1rem;\n background: white;\n transform: translateZ(0);\n\n img {\n vertical-align: middle !important;\n display: block !important;\n object-fit: cover !important;\n border-radius: ", " !important;\n }\n"], ["\n border: ", ";\n border-radius: 0.5rem;\n position: relative;\n overflow: hidden;\n width: ", ";\n height: ", ";\n display: flex;\n align-items: center;\n justify-content: center;\n margin-right: 1rem;\n background: white;\n transform: translateZ(0);\n\n img {\n vertical-align: middle !important;\n display: block !important;\n object-fit: cover !important;\n border-radius: ", " !important;\n }\n"])), function (props) { return (props.$hasImageBorder ? "1px solid var(--dark-opacity-5)" : "none"); }, function (props) { return (props.$imageWidth ? props.$imageWidth : "71px"); }, function (props) { return (props.$imageHeight ? props.$imageHeight : "50px"); }, function (props) { return (props.$hasImageRounded ? "4px" : "0"); });
|
|
25
|
-
exports.TextWrapper = styled_components_1.default.div(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n padding-right: ", ";\n"], ["\n padding-right: ", ";\n"])), function (props) { return (props.$
|
|
28
|
+
exports.TextWrapper = styled_components_1.default.div(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n padding-right: ", ";\n"], ["\n padding-right: ", ";\n"])), function (props) { return (props.$hasPeriod ? "1rem" : "0.5rem"); });
|
|
26
29
|
exports.PriceContent = styled_components_1.default.div(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), function (props) {
|
|
27
30
|
return (props === null || props === void 0 ? void 0 : props.$infoPosition) === "left"
|
|
28
31
|
? "\n text-align: start;\n display: flex;\n align-items: flex-end;\n margin-top: 8px;\n "
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import React from "react";
|
|
2
2
|
import { variants } from "../Button/props";
|
|
3
3
|
type VARIANT = typeof variants[number];
|
|
4
4
|
export interface ProductCardHorizontalSm {
|
|
@@ -7,7 +7,7 @@ export interface ProductCardHorizontalSm {
|
|
|
7
7
|
price?: string;
|
|
8
8
|
priceSm?: string;
|
|
9
9
|
slug?: string;
|
|
10
|
-
period?:
|
|
10
|
+
period?: React.ReactNode;
|
|
11
11
|
image?: string;
|
|
12
12
|
component?: React.ElementType | null;
|
|
13
13
|
/** Örn. `import Image from "next/image"` → `imageComponent={Image}` */
|
|
@@ -23,6 +23,7 @@ export interface ProductCardHorizontalSm {
|
|
|
23
23
|
isSelected?: boolean;
|
|
24
24
|
hasTitleWrap?: boolean;
|
|
25
25
|
hasButtonRemoveMdDown?: boolean;
|
|
26
|
+
hasDescriptionHideMdDown?: boolean;
|
|
26
27
|
hasBordeHover?: boolean;
|
|
27
28
|
hasTooltip?: boolean;
|
|
28
29
|
tooltipSelectorTitle?: string;
|
|
@@ -33,7 +34,7 @@ export interface ProductCardHorizontalSm {
|
|
|
33
34
|
hasImageRounded?: boolean;
|
|
34
35
|
}
|
|
35
36
|
export interface ProductCardHorizontalSmStyledProps {
|
|
36
|
-
$
|
|
37
|
+
$hasPeriod?: boolean;
|
|
37
38
|
$hasImageBorder?: boolean;
|
|
38
39
|
$imageWidth?: string;
|
|
39
40
|
$imageHeight?: string;
|
|
@@ -42,6 +43,7 @@ export interface ProductCardHorizontalSmStyledProps {
|
|
|
42
43
|
$isSelected?: boolean;
|
|
43
44
|
$hasTitleWrap?: boolean;
|
|
44
45
|
$hasButtonRemoveMdDown?: boolean;
|
|
46
|
+
$hasDescriptionHideMdDown?: boolean;
|
|
45
47
|
$hasBordeHover?: boolean;
|
|
46
48
|
$isDisabled?: boolean;
|
|
47
49
|
$hasImageRounded?: boolean;
|
package/dist/components/ProductCardHorizontalSm/stories/ProductCardHorizontalSm.stories.d.ts
CHANGED
|
@@ -20,7 +20,7 @@ declare const _default: {
|
|
|
20
20
|
control: string;
|
|
21
21
|
};
|
|
22
22
|
period: {
|
|
23
|
-
control:
|
|
23
|
+
control: boolean;
|
|
24
24
|
};
|
|
25
25
|
image: {
|
|
26
26
|
control: string;
|
|
@@ -76,6 +76,9 @@ declare const _default: {
|
|
|
76
76
|
hasButtonRemoveMdDown: {
|
|
77
77
|
control: string;
|
|
78
78
|
};
|
|
79
|
+
hasDescriptionHideMdDown: {
|
|
80
|
+
control: string;
|
|
81
|
+
};
|
|
79
82
|
hasTooltip: {
|
|
80
83
|
control: string;
|
|
81
84
|
};
|
|
@@ -154,6 +157,39 @@ export declare const WithDescription: {
|
|
|
154
157
|
isDisabled: boolean;
|
|
155
158
|
};
|
|
156
159
|
};
|
|
160
|
+
export declare const DescriptionHideMdDown: {
|
|
161
|
+
args: {
|
|
162
|
+
description: string;
|
|
163
|
+
hasDescriptionHideMdDown: boolean;
|
|
164
|
+
title: string;
|
|
165
|
+
price: string;
|
|
166
|
+
priceSm: string;
|
|
167
|
+
slug: string;
|
|
168
|
+
period: string;
|
|
169
|
+
image: string;
|
|
170
|
+
component: ({ children }: {
|
|
171
|
+
children: any;
|
|
172
|
+
}) => React.JSX.Element;
|
|
173
|
+
hasImageBorder: boolean;
|
|
174
|
+
imageWidth: string;
|
|
175
|
+
imageHeight: string;
|
|
176
|
+
imageInnerWidth: number;
|
|
177
|
+
imageInnerHeight: number;
|
|
178
|
+
infoPosition: string;
|
|
179
|
+
hasButton: boolean;
|
|
180
|
+
buttonVariant: string;
|
|
181
|
+
buttonText: string;
|
|
182
|
+
hasBorder: boolean;
|
|
183
|
+
hasBordeHover: boolean;
|
|
184
|
+
isSelected: boolean;
|
|
185
|
+
hasTitleWrap: boolean;
|
|
186
|
+
hasButtonRemoveMdDown: boolean;
|
|
187
|
+
hasTooltip: boolean;
|
|
188
|
+
tooltipSelectorTitle: string;
|
|
189
|
+
tooltipDescription: string;
|
|
190
|
+
isDisabled: boolean;
|
|
191
|
+
};
|
|
192
|
+
};
|
|
157
193
|
export declare const WithButton: {
|
|
158
194
|
args: {
|
|
159
195
|
hasButton: boolean;
|
|
@@ -216,6 +252,37 @@ export declare const RightAlignedInfo: {
|
|
|
216
252
|
isDisabled: boolean;
|
|
217
253
|
};
|
|
218
254
|
};
|
|
255
|
+
export declare const CustomPeriod: {
|
|
256
|
+
args: {
|
|
257
|
+
infoPosition: string;
|
|
258
|
+
period: React.JSX.Element;
|
|
259
|
+
title: string;
|
|
260
|
+
price: string;
|
|
261
|
+
priceSm: string;
|
|
262
|
+
slug: string;
|
|
263
|
+
image: string;
|
|
264
|
+
component: ({ children }: {
|
|
265
|
+
children: any;
|
|
266
|
+
}) => React.JSX.Element;
|
|
267
|
+
hasImageBorder: boolean;
|
|
268
|
+
imageWidth: string;
|
|
269
|
+
imageHeight: string;
|
|
270
|
+
imageInnerWidth: number;
|
|
271
|
+
imageInnerHeight: number;
|
|
272
|
+
hasButton: boolean;
|
|
273
|
+
buttonVariant: string;
|
|
274
|
+
buttonText: string;
|
|
275
|
+
hasBorder: boolean;
|
|
276
|
+
hasBordeHover: boolean;
|
|
277
|
+
isSelected: boolean;
|
|
278
|
+
hasTitleWrap: boolean;
|
|
279
|
+
hasButtonRemoveMdDown: boolean;
|
|
280
|
+
hasTooltip: boolean;
|
|
281
|
+
tooltipSelectorTitle: string;
|
|
282
|
+
tooltipDescription: string;
|
|
283
|
+
isDisabled: boolean;
|
|
284
|
+
};
|
|
285
|
+
};
|
|
219
286
|
export declare const WithImageBorder: {
|
|
220
287
|
args: {
|
|
221
288
|
hasImageBorder: boolean;
|
|
@@ -14,7 +14,7 @@ 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.WithBorderHover = exports.WithImageRounded = exports.WithoutBorder = exports.WithoutTooltip = exports.Selected = exports.Disabled = exports.WithImageBorder = exports.RightAlignedInfo = exports.WithButton = exports.WithDescription = exports.Default = void 0;
|
|
17
|
+
exports.WithBorderHover = exports.WithImageRounded = exports.WithoutBorder = exports.WithoutTooltip = exports.Selected = exports.Disabled = exports.WithImageBorder = exports.CustomPeriod = exports.RightAlignedInfo = exports.WithButton = exports.DescriptionHideMdDown = exports.WithDescription = exports.Default = void 0;
|
|
18
18
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
19
19
|
var ProductCardHorizontalSm_1 = __importDefault(require("../ProductCardHorizontalSm"));
|
|
20
20
|
var props_1 = require("../../Button/props");
|
|
@@ -28,7 +28,7 @@ exports.default = {
|
|
|
28
28
|
price: { control: "text" },
|
|
29
29
|
priceSm: { control: "text" },
|
|
30
30
|
slug: { control: "text" },
|
|
31
|
-
period: { control:
|
|
31
|
+
period: { control: false },
|
|
32
32
|
image: { control: "text" },
|
|
33
33
|
component: { control: "none" },
|
|
34
34
|
imageComponent: {
|
|
@@ -55,6 +55,7 @@ exports.default = {
|
|
|
55
55
|
isSelected: { control: "boolean" },
|
|
56
56
|
hasTitleWrap: { control: "boolean" },
|
|
57
57
|
hasButtonRemoveMdDown: { control: "boolean" },
|
|
58
|
+
hasDescriptionHideMdDown: { control: "boolean" },
|
|
58
59
|
hasTooltip: { control: "boolean" },
|
|
59
60
|
tooltipSelectorTitle: { control: "text" },
|
|
60
61
|
tooltipDescription: { control: "text" },
|
|
@@ -97,12 +98,18 @@ exports.Default = {
|
|
|
97
98
|
exports.WithDescription = {
|
|
98
99
|
args: __assign(__assign({}, exports.Default.args), { description: "İki ayda bir gönderim" }),
|
|
99
100
|
};
|
|
101
|
+
exports.DescriptionHideMdDown = {
|
|
102
|
+
args: __assign(__assign({}, exports.Default.args), { description: "İki ayda bir gönderim", hasDescriptionHideMdDown: true }),
|
|
103
|
+
};
|
|
100
104
|
exports.WithButton = {
|
|
101
105
|
args: __assign(__assign({}, exports.Default.args), { hasButton: true, buttonText: "Kirala", buttonVariant: "secondary" }),
|
|
102
106
|
};
|
|
103
107
|
exports.RightAlignedInfo = {
|
|
104
108
|
args: __assign(__assign({}, exports.Default.args), { infoPosition: "right" }),
|
|
105
109
|
};
|
|
110
|
+
exports.CustomPeriod = {
|
|
111
|
+
args: __assign(__assign({}, exports.Default.args), { infoPosition: "right", period: ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("span", __assign({ className: "period-mobile" }, { children: "/ay" })), (0, jsx_runtime_1.jsx)("span", __assign({ className: "period-desktop" }, { children: "/hafta" }))] })) }),
|
|
112
|
+
};
|
|
106
113
|
exports.WithImageBorder = {
|
|
107
114
|
args: __assign(__assign({}, exports.Default.args), { hasImageBorder: true }),
|
|
108
115
|
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { QuantitySelectorProps } from "./props";
|
|
3
|
+
declare const QuantitySelector: ({ label, id, orientation, quantity, onIncrement, onDecrement, onRemove, hasRemove, hasLoading, hasError, errorText, hasDisableActions, hasDisableIncrement, }: QuantitySelectorProps) => React.JSX.Element;
|
|
4
|
+
export default QuantitySelector;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
18
|
+
var props_1 = require("./props");
|
|
19
|
+
var QuantitySelector_styled_1 = require("./QuantitySelector.styled");
|
|
20
|
+
var Icon_1 = __importDefault(require("../Icon/Icon"));
|
|
21
|
+
var Loader_1 = __importDefault(require("../Loader"));
|
|
22
|
+
var QuantitySelector = function (_a) {
|
|
23
|
+
var _b = _a.label, label = _b === void 0 ? props_1.QuantitySelectorDefault.label : _b, _c = _a.id, id = _c === void 0 ? props_1.QuantitySelectorDefault.id : _c, _d = _a.orientation, orientation = _d === void 0 ? props_1.QuantitySelectorDefault.orientation : _d, _e = _a.quantity, quantity = _e === void 0 ? props_1.QuantitySelectorDefault.quantity : _e, _f = _a.onIncrement, onIncrement = _f === void 0 ? props_1.QuantitySelectorDefault.onIncrement : _f, _g = _a.onDecrement, onDecrement = _g === void 0 ? props_1.QuantitySelectorDefault.onDecrement : _g, _h = _a.onRemove, onRemove = _h === void 0 ? props_1.QuantitySelectorDefault.onRemove : _h, _j = _a.hasRemove, hasRemove = _j === void 0 ? props_1.QuantitySelectorDefault.hasRemove : _j, _k = _a.hasLoading, hasLoading = _k === void 0 ? props_1.QuantitySelectorDefault.hasLoading : _k, _l = _a.hasError, hasError = _l === void 0 ? props_1.QuantitySelectorDefault.hasError : _l, _m = _a.errorText, errorText = _m === void 0 ? props_1.QuantitySelectorDefault.errorText : _m, _o = _a.hasDisableActions, hasDisableActions = _o === void 0 ? props_1.QuantitySelectorDefault.hasDisableActions : _o, _p = _a.hasDisableIncrement, hasDisableIncrement = _p === void 0 ? props_1.QuantitySelectorDefault.hasDisableIncrement : _p;
|
|
24
|
+
var styledProps = {
|
|
25
|
+
$orientation: orientation,
|
|
26
|
+
$hasDisableActions: hasDisableActions,
|
|
27
|
+
};
|
|
28
|
+
var decrementButton = hasRemove ? ((0, jsx_runtime_1.jsx)(QuantitySelector_styled_1.SelectorButton, __assign({ type: "button", disabled: hasLoading, onClick: onRemove }, styledProps, { children: (0, jsx_runtime_1.jsx)(Icon_1.default, { name: "DeleteSmall" }) }))) : ((0, jsx_runtime_1.jsx)(QuantitySelector_styled_1.SelectorButton, __assign({ type: "button", disabled: hasLoading, onClick: onDecrement }, styledProps, { children: (0, jsx_runtime_1.jsx)(Icon_1.default, { name: "NegativeSmall" }) })));
|
|
29
|
+
return ((0, jsx_runtime_1.jsxs)(QuantitySelector_styled_1.Container, { children: [label && (0, jsx_runtime_1.jsx)(QuantitySelector_styled_1.Label, __assign({ htmlFor: id }, { children: label })), (0, jsx_runtime_1.jsxs)(QuantitySelector_styled_1.Controls, __assign({}, styledProps, { children: [!hasDisableActions && ((0, jsx_runtime_1.jsxs)(QuantitySelector_styled_1.SelectorButton, __assign({ type: "button", disabled: hasLoading || hasError || hasDisableIncrement, onClick: onIncrement }, styledProps, { children: [(0, jsx_runtime_1.jsx)(Icon_1.default, { name: "PlusSmall" }), hasError && ((0, jsx_runtime_1.jsx)("div", { className: "popup", dangerouslySetInnerHTML: { __html: errorText } }))] }))), (0, jsx_runtime_1.jsx)(QuantitySelector_styled_1.QuantityValue, __assign({}, styledProps, { children: hasLoading ? (0, jsx_runtime_1.jsx)(Loader_1.default, { variant: "primary", width: "16px", height: "16px" }) : quantity })), !hasDisableActions && decrementButton] }))] }));
|
|
30
|
+
};
|
|
31
|
+
exports.default = QuantitySelector;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { QuantitySelectorStyledProps } from "./props";
|
|
3
|
+
export declare const Container: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never> & Partial<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>> & string;
|
|
4
|
+
export declare const Label: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>, never> & Partial<Pick<import("react").DetailedHTMLProps<import("react").LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>, never>>> & string;
|
|
5
|
+
export declare const Controls: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof QuantitySelectorStyledProps> & QuantitySelectorStyledProps, never> & Partial<Pick<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof QuantitySelectorStyledProps> & QuantitySelectorStyledProps, never>>> & string;
|
|
6
|
+
export declare const QuantityValue: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof QuantitySelectorStyledProps> & QuantitySelectorStyledProps, never> & Partial<Pick<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof QuantitySelectorStyledProps> & QuantitySelectorStyledProps, never>>> & string;
|
|
7
|
+
export declare const SelectorButton: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, keyof QuantitySelectorStyledProps> & QuantitySelectorStyledProps, never> & Partial<Pick<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, keyof QuantitySelectorStyledProps> & QuantitySelectorStyledProps, never>>> & string;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
3
|
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
4
|
+
return cooked;
|
|
5
|
+
};
|
|
6
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
7
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
8
|
+
};
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.SelectorButton = exports.QuantityValue = exports.Controls = exports.Label = exports.Container = void 0;
|
|
11
|
+
var styled_components_1 = __importDefault(require("styled-components"));
|
|
12
|
+
var devices_1 = require("../../constants/devices");
|
|
13
|
+
exports.Container = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n width: fit-content;\n"], ["\n display: flex;\n flex-direction: column;\n width: fit-content;\n"])));
|
|
14
|
+
exports.Label = styled_components_1.default.label(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: block;\n margin: 0 0 1rem;\n color: var(--dark-opacity-50);\n font: var(--caption-bold-12-15);\n"], ["\n display: block;\n margin: 0 0 1rem;\n color: var(--dark-opacity-50);\n font: var(--caption-bold-12-15);\n"])));
|
|
15
|
+
exports.Controls = styled_components_1.default.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n background-color: var(--dark-opacity-3);\n border-radius: 0.5rem;\n text-align: center;\n display: grid;\n align-content: ", ";\n justify-content: ", ";\n padding: ", ";\n width: ", ";\n height: ", ";\n grid-auto-flow: ", ";\n align-items: center;\n"], ["\n background-color: var(--dark-opacity-3);\n border-radius: 0.5rem;\n text-align: center;\n display: grid;\n align-content: ", ";\n justify-content: ", ";\n padding: ", ";\n width: ", ";\n height: ", ";\n grid-auto-flow: ", ";\n align-items: center;\n"])), function (props) { return props.$hasDisableActions ? 'center' : props.$orientation === 'horizontal' ? 'center' : 'space-between'; }, function (props) { return props.$orientation === 'horizontal' ? 'space-between' : 'center'; }, function (props) { return props.$orientation === 'horizontal' ? '0 4px' : '4px 0'; }, function (props) { return props.$orientation === 'horizontal' ? '92px' : '32px'; }, function (props) { return props.$orientation === 'horizontal' ? '32px' : '92px'; }, function (props) { return props.$orientation === 'horizontal' ? 'column' : 'row'; });
|
|
16
|
+
exports.QuantityValue = styled_components_1.default.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n color: ", ";\n font: ", ";\n\n > div {\n margin: 0 auto;\n }\n"], ["\n color: ", ";\n font: ", ";\n\n > div {\n margin: 0 auto;\n }\n"])), function (props) { return props.$hasDisableActions ? 'var(--grey-50)' : 'var(--dark)'; }, function (props) { return props.$orientation === 'horizontal'
|
|
17
|
+
? 'var(--body-extra-bold-14-17)'
|
|
18
|
+
: 'var(--body-extra-bold-13-16)'; });
|
|
19
|
+
exports.SelectorButton = styled_components_1.default.button(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n border: 0;\n padding: 0;\n outline: none;\n box-shadow: none;\n width: 24px;\n height: 24px;\n background: white;\n border-radius: 0.5rem;\n display: flex;\n align-items: center;\n justify-content: center;\n transition: all .1s ease;\n cursor: pointer;\n position: relative;\n color: var(--primary);\n flex-shrink: 0;\n\n ", "\n\n &:disabled {\n cursor: no-drop;\n background-color: white !important;\n color: var(--grey-50) !important;\n }\n\n .popup {\n position: absolute;\n width: 139px;\n padding: 10px;\n border-radius: 0.5rem;\n background-color: var(--red);\n z-index: 99999;\n box-sizing: border-box;\n right: calc(100% + 11px);\n top: -8px;\n color: white;\n opacity: 1;\n user-select: none;\n pointer-events: none;\n transition: all .1s ease;\n text-align: center;\n font: var(--caption-semi-bold-12-15);\n\n &:before {\n content: '';\n position: absolute;\n top: 14px;\n left: calc(100% - 7px);\n transform: rotate(45deg);\n background-color: var(--red);\n width: 12px;\n height: 12px;\n border-radius: 3px;\n }\n }\n\n @media only screen and ", " {\n &:hover:not(:disabled) {\n background-color: var(--primary);\n color: white;\n }\n }\n\n &:active:not(:disabled) {\n color: white;\n background-color: var(--primary);\n }\n"], ["\n border: 0;\n padding: 0;\n outline: none;\n box-shadow: none;\n width: 24px;\n height: 24px;\n background: white;\n border-radius: 0.5rem;\n display: flex;\n align-items: center;\n justify-content: center;\n transition: all .1s ease;\n cursor: pointer;\n position: relative;\n color: var(--primary);\n flex-shrink: 0;\n\n ", "\n\n &:disabled {\n cursor: no-drop;\n background-color: white !important;\n color: var(--grey-50) !important;\n }\n\n .popup {\n position: absolute;\n width: 139px;\n padding: 10px;\n border-radius: 0.5rem;\n background-color: var(--red);\n z-index: 99999;\n box-sizing: border-box;\n right: calc(100% + 11px);\n top: -8px;\n color: white;\n opacity: 1;\n user-select: none;\n pointer-events: none;\n transition: all .1s ease;\n text-align: center;\n font: var(--caption-semi-bold-12-15);\n\n &:before {\n content: '';\n position: absolute;\n top: 14px;\n left: calc(100% - 7px);\n transform: rotate(45deg);\n background-color: var(--red);\n width: 12px;\n height: 12px;\n border-radius: 3px;\n }\n }\n\n @media only screen and ", " {\n &:hover:not(:disabled) {\n background-color: var(--primary);\n color: white;\n }\n }\n\n &:active:not(:disabled) {\n color: white;\n background-color: var(--primary);\n }\n"])), function (props) { return props.$hasShadow ? "\n box-shadow: 0 6px 30px 0 var(--box-shadow-color);\n " : ""; }, devices_1.devices.mdUp);
|
|
20
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './QuantitySelector';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var QuantitySelector_1 = require("./QuantitySelector");
|
|
8
|
+
Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(QuantitySelector_1).default; } });
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export declare const orientations: readonly ["horizontal", "vertical"];
|
|
2
|
+
type ORIENTATION = (typeof orientations)[number];
|
|
3
|
+
export interface QuantitySelector {
|
|
4
|
+
label?: string;
|
|
5
|
+
id?: string;
|
|
6
|
+
orientation?: ORIENTATION;
|
|
7
|
+
quantity?: string | number;
|
|
8
|
+
onIncrement?(): void;
|
|
9
|
+
onDecrement?(): void;
|
|
10
|
+
onRemove?(): void;
|
|
11
|
+
hasRemove?: boolean;
|
|
12
|
+
hasLoading?: boolean;
|
|
13
|
+
hasError?: boolean;
|
|
14
|
+
errorText?: string;
|
|
15
|
+
hasDisableActions?: boolean;
|
|
16
|
+
hasDisableIncrement?: boolean;
|
|
17
|
+
}
|
|
18
|
+
export interface QuantitySelectorStyledProps {
|
|
19
|
+
$orientation?: ORIENTATION;
|
|
20
|
+
$hasDisableActions?: boolean;
|
|
21
|
+
$hasShadow?: boolean;
|
|
22
|
+
}
|
|
23
|
+
export declare const QuantitySelectorDefault: QuantitySelector;
|
|
24
|
+
export type QuantitySelectorProps = typeof QuantitySelectorDefault;
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.QuantitySelectorDefault = exports.orientations = void 0;
|
|
4
|
+
exports.orientations = ['horizontal', 'vertical'];
|
|
5
|
+
exports.QuantitySelectorDefault = {
|
|
6
|
+
label: null,
|
|
7
|
+
id: null,
|
|
8
|
+
orientation: 'vertical',
|
|
9
|
+
quantity: null,
|
|
10
|
+
onIncrement: null,
|
|
11
|
+
onDecrement: null,
|
|
12
|
+
onRemove: null,
|
|
13
|
+
hasRemove: false,
|
|
14
|
+
hasLoading: false,
|
|
15
|
+
hasError: false,
|
|
16
|
+
errorText: null,
|
|
17
|
+
hasDisableActions: false,
|
|
18
|
+
hasDisableIncrement: false,
|
|
19
|
+
};
|