krl-alfred 2.23.13 → 2.23.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.
- package/dist/components/Accordion/Accordion.styled.d.ts +21 -7
- package/dist/components/Accordion/stories/Accordion.stories.d.ts +105 -28
- package/dist/components/Accordion/stories/Accordion.stories.js +73 -129
- package/dist/components/ActionButton/ActionButton.styled.d.ts +51 -17
- package/dist/components/ActionButton/stories/ActionButton.stories.d.ts +210 -18
- package/dist/components/ActionButton/stories/ActionButton.stories.js +87 -140
- package/dist/components/AddressCard/AddressCard.styled.d.ts +6 -2
- package/dist/components/AddressCard/stories/AddressCard.stories.d.ts +148 -26
- package/dist/components/AddressCard/stories/AddressCard.stories.js +96 -167
- package/dist/components/Agreement/Agreement.styled.d.ts +3 -1
- package/dist/components/Agreement/stories/Agreement.stories.d.ts +263 -1
- package/dist/components/Agreement/stories/Agreement.stories.js +89 -11
- package/dist/components/Alert/Alert.styled.d.ts +3 -1
- package/dist/components/Alert/stories/Alert.stories.d.ts +138 -8
- package/dist/components/Alert/stories/Alert.stories.js +68 -119
- package/dist/components/AutocompleteInput/AutocompleteInput.styled.d.ts +12 -4
- package/dist/components/AutocompleteInput/stories/AutocompleteInput.stories.d.ts +737 -2
- package/dist/components/AutocompleteInput/stories/AutocompleteInput.stories.js +161 -74
- package/dist/components/Badges/layouts/belt/belt.styled.d.ts +3 -1
- package/dist/components/Badges/layouts/dark/dark.styled.d.ts +3 -1
- package/dist/components/Badges/layouts/text/text.styled.d.ts +3 -1
- package/dist/components/Badges/stories/Badges.stories.d.ts +228 -10
- package/dist/components/Badges/stories/Badges.stories.js +113 -55
- package/dist/components/BannerCard/BannerCard.styled.d.ts +3 -1
- package/dist/components/BannerCard/stories/BannerCard.stories.d.ts +278 -5
- package/dist/components/BannerCard/stories/BannerCard.stories.js +82 -24
- package/dist/components/BlogCard/BlogCard.styled.d.ts +3 -1
- package/dist/components/BlogCard/stories/BlogCard.stories.d.ts +161 -9
- package/dist/components/BlogCard/stories/BlogCard.stories.js +84 -41
- package/dist/components/Breadcrumbs/Breadcrumbs.styled.d.ts +39 -13
- package/dist/components/Breadcrumbs/stories/Breadcrumbs.stories.d.ts +380 -10
- package/dist/components/Breadcrumbs/stories/Breadcrumbs.stories.js +170 -13
- package/dist/components/Button/Button.styled.d.ts +6 -2
- package/dist/components/Button/stories/Button.stories.d.ts +301 -49
- package/dist/components/Button/stories/Button.stories.js +105 -46
- package/dist/components/CampaignCard/CampaignCard.styled.d.ts +3 -1
- package/dist/components/CampaignCard/stories/CampaignCard.stories.d.ts +118 -3
- package/dist/components/CampaignCard/stories/CampaignCard.stories.js +55 -32
- package/dist/components/CategoryMenu/CategoryMenu.styled.d.ts +24 -8
- package/dist/components/CategoryMenu/stories/CategoryMenu.stories.d.ts +807 -29
- package/dist/components/CategoryMenu/stories/CategoryMenu.stories.js +198 -31
- package/dist/components/Checkbox/Checkbox.styled.d.ts +15 -5
- package/dist/components/Checkbox/stories/Checkbox.stories.d.ts +313 -7
- package/dist/components/Checkbox/stories/Checkbox.stories.js +69 -25
- package/dist/components/CheckboxGroup/CheckboxGroup.styled.d.ts +3 -1
- package/dist/components/CheckboxGroup/stories/CheckboxGroup.stories.d.ts +400 -2
- package/dist/components/CheckboxGroup/stories/CheckboxGroup.stories.js +129 -43
- package/dist/components/CircleProgress/CircleProgress.styled.d.ts +3 -1
- package/dist/components/CircleProgress/stories/CircleProgress.stories.d.ts +142 -3
- package/dist/components/CircleProgress/stories/CircleProgress.stories.js +133 -7
- package/dist/components/CircleProgressPro/CircleProgressPro.styled.d.ts +33 -11
- package/dist/components/CircleProgressPro/stories/CircleProgressPro.stories.d.ts +25 -2
- package/dist/components/CircleProgressPro/stories/CircleProgressPro.stories.js +50 -5
- package/dist/components/ColorPalette/ColorPalette.styled.d.ts +27 -9
- package/dist/components/CouponCode/CouponCode.styled.d.ts +9 -3
- package/dist/components/CouponCode/stories/CouponCode.stories.d.ts +311 -1
- package/dist/components/CouponCode/stories/CouponCode.stories.js +100 -18
- package/dist/components/DescriptionCard/DescriptionCard.styled.d.ts +117 -46
- package/dist/components/DescriptionCard/stories/DescriptionCard.stories.d.ts +788 -2
- package/dist/components/DescriptionCard/stories/DescriptionCard.stories.js +74 -3
- package/dist/components/Divider/Divider.styled.d.ts +6 -2
- package/dist/components/Divider/stories/Divider.stories.d.ts +85 -2
- package/dist/components/Divider/stories/Divider.stories.js +65 -12
- package/dist/components/Dropdown/Dropdown.styled.d.ts +6 -2
- package/dist/components/Dropdown/stories/Dropdown.stories.d.ts +395 -5
- package/dist/components/Dropdown/stories/Dropdown.stories.js +166 -36
- package/dist/components/DropdownButton/DropdownButton.styled.d.ts +9 -3
- package/dist/components/DropdownButton/stories/DropdownButton.stories.d.ts +177 -5
- package/dist/components/DropdownButton/stories/DropdownButton.stories.js +84 -36
- package/dist/components/Icon/Icon.styled.d.ts +9 -3
- package/dist/components/Icon/props.d.ts +2 -2
- package/dist/components/Icon/stories/Icons.stories.d.ts +134 -3
- package/dist/components/Icon/stories/Icons.stories.js +55 -17
- package/dist/components/InfoBox/InfoBox.styled.d.ts +24 -8
- package/dist/components/InfoBox/stories/InfoBox.stories.d.ts +25 -1
- package/dist/components/InfoBox/stories/InfoBox.stories.js +23 -13
- package/dist/components/InlineProgress/InlineProgress.styled.d.ts +3 -1
- package/dist/components/InlineProgress/stories/InlineProgress.stories.d.ts +69 -2
- package/dist/components/InlineProgress/stories/InlineProgress.stories.js +50 -7
- package/dist/components/Input/Input.styled.d.ts +27 -9
- package/dist/components/Input/stories/Input.stories.d.ts +62 -1
- package/dist/components/Input/stories/Input.stories.js +59 -40
- package/dist/components/InstallmentBox/InstallmentBox.styled.d.ts +3 -1
- package/dist/components/InstallmentBox/stories/InstallmentBox.stories.d.ts +41 -2
- package/dist/components/InstallmentBox/stories/InstallmentBox.stories.js +36 -13
- package/dist/components/InsuranceBox/InsuranceBox.styled.d.ts +21 -7
- package/dist/components/InsuranceBox/stories/InsuranceBox.stories.d.ts +53 -0
- package/dist/components/InsuranceBox/stories/InsuranceBox.stories.js +19 -1
- package/dist/components/ListGroup/ListGroup.styled.d.ts +15 -5
- package/dist/components/ListGroup/stories/ListGroup.stories.d.ts +21 -1
- package/dist/components/ListGroup/stories/ListGroup.stories.js +28 -1
- package/dist/components/Loader/Loader.styled.d.ts +6 -2
- package/dist/components/Loader/stories/Loader.stories.d.ts +22 -4
- package/dist/components/Loader/stories/Loader.stories.js +8 -1
- package/dist/components/Modal/Modal.styled.d.ts +7 -5
- package/dist/components/Modal/stories/Modal.stories.d.ts +98 -1
- package/dist/components/Modal/stories/Modal.stories.js +64 -38
- package/dist/components/OptionMenu/OptionMenu.styled.d.ts +15 -5
- package/dist/components/OptionMenu/stories/OptionMenu.stories.d.ts +126 -44
- package/dist/components/OptionMenu/stories/OptionMenu.stories.js +82 -11
- package/dist/components/OtpInput/OtpInput.styled.d.ts +12 -4
- package/dist/components/OtpInput/stories/OtpInput.stories.d.ts +29 -1
- package/dist/components/OtpInput/stories/OtpInput.stories.js +30 -19
- package/dist/components/Pagination/Pagination.styled.d.ts +3 -1
- package/dist/components/Pagination/stories/Pagination.stories.d.ts +95 -3
- package/dist/components/Pagination/stories/Pagination.stories.js +79 -18
- package/dist/components/PaymentCart/PaymentCart.styled.d.ts +36 -12
- package/dist/components/PaymentCart/stories/PaymentCart.stories.d.ts +180 -1
- package/dist/components/PaymentCart/stories/PaymentCart.stories.js +47 -14
- package/dist/components/ProductCardCheckbox/ProductCardCheckbox.d.ts +1 -1
- package/dist/components/ProductCardCheckbox/ProductCardCheckbox.js +2 -2
- package/dist/components/ProductCardCheckbox/ProductCardCheckbox.styled.d.ts +57 -19
- package/dist/components/ProductCardCheckbox/ProductCardCheckbox.styled.js +15 -13
- package/dist/components/ProductCardCheckbox/ProductCardCheckbox.test.d.ts +1 -0
- package/dist/components/ProductCardCheckbox/ProductCardCheckbox.test.js +94 -0
- package/dist/components/ProductCardCheckbox/props.d.ts +2 -0
- package/dist/components/ProductCardCheckbox/props.js +1 -0
- package/dist/components/ProductCardCheckbox/stories/ProductCardCheckbox.stories.d.ts +190 -0
- package/dist/components/ProductCardCheckbox/stories/ProductCardCheckbox.stories.js +51 -14
- package/dist/components/ProductCardHorizontal/ProductCardHorizontal.styled.d.ts +3 -1
- package/dist/components/ProductCardHorizontal/stories/ProductCardHorizontal.stories.d.ts +57 -0
- package/dist/components/ProductCardHorizontal/stories/ProductCardHorizontal.stories.js +29 -9
- package/dist/components/ProductCardHorizontalMd/ProductCardHorizontalMd.styled.d.ts +60 -29
- package/dist/components/ProductCardHorizontalMd/stories/ProductCardHorizontalMd.stories.d.ts +106 -0
- package/dist/components/ProductCardHorizontalMd/stories/ProductCardHorizontalMd.stories.js +35 -10
- package/dist/components/ProductCardHorizontalSm/ProductCardHorizontalSm.styled.d.ts +33 -11
- package/dist/components/ProductCardHorizontalSm/stories/ProductCardHorizontalSm.stories.d.ts +192 -0
- package/dist/components/ProductCardHorizontalSm/stories/ProductCardHorizontalSm.stories.js +72 -40
- package/dist/components/ProductCardRadio/ProductCardRadio.styled.d.ts +43 -17
- package/dist/components/ProductCardRadio/stories/ProductCardRadio.stories.d.ts +275 -12
- package/dist/components/ProductCardRadio/stories/ProductCardRadio.stories.js +72 -105
- package/dist/components/ProductCardVertical/ProductCardVertical.styled.d.ts +63 -21
- package/dist/components/ProductCardVertical/stories/ProductCardVertical.stories.d.ts +139 -0
- package/dist/components/ProductCardVertical/stories/ProductCardVertical.stories.js +19 -1
- package/dist/components/QuantitySelector/QuantitySelector.styled.d.ts +15 -5
- package/dist/components/QuantitySelector/stories/QuantitySelector.stories.d.ts +114 -0
- package/dist/components/QuantitySelector/stories/QuantitySelector.stories.js +58 -12
- package/dist/components/RadioButton/layouts/basic/Basic.styled.d.ts +15 -5
- package/dist/components/RadioButton/layouts/boxed/Boxed.styled.d.ts +24 -8
- package/dist/components/RadioButton/layouts/boxed/Boxed.styled.js +1 -1
- package/dist/components/RadioButton/layouts/boxedMd/BoxedMd.styled.d.ts +12 -4
- package/dist/components/RadioButton/layouts/boxedSm/BoxedSm.styled.d.ts +12 -4
- package/dist/components/RadioButton/layouts/boxedSm/BoxedSm.styled.js +1 -1
- package/dist/components/RadioButton/layouts/boxedWithIcon/BoxedWithIcon.styled.d.ts +25 -12
- package/dist/components/RadioButton/layouts/color/Color.styled.d.ts +9 -3
- package/dist/components/RadioButton/layouts/horizontal/Horizontal.js +2 -2
- package/dist/components/RadioButton/layouts/horizontal/Horizontal.styled.d.ts +55 -18
- package/dist/components/RadioButton/layouts/horizontal/Horizontal.styled.js +1 -1
- package/dist/components/RadioButton/layouts/horizontal/Horizontal.test.d.ts +1 -0
- package/dist/components/RadioButton/layouts/horizontal/Horizontal.test.js +56 -0
- package/dist/components/RadioButton/props.d.ts +4 -0
- package/dist/components/RadioButton/props.js +3 -0
- package/dist/components/RadioButton/stories/RadioButton.stories.d.ts +14 -0
- package/dist/components/RadioButton/stories/RadioButton.stories.js +15 -1
- package/dist/components/RadioGroup/RadioGroup.js +1 -1
- package/dist/components/RadioGroup/RadioGroup.styled.d.ts +21 -7
- package/dist/components/RadioGroup/RadioGroup.test.d.ts +1 -0
- package/dist/components/RadioGroup/RadioGroup.test.js +40 -0
- package/dist/components/RadioGroup/props.d.ts +4 -0
- package/dist/components/RadioScale/RadioScale.styled.d.ts +9 -3
- package/dist/components/RadioScale/stories/RadioScale.stories.d.ts +37 -0
- package/dist/components/RadioScale/stories/RadioScale.stories.js +16 -1
- package/dist/components/ReviewBlock/ReviewBlock.styled.d.ts +57 -19
- package/dist/components/ReviewBlock/stories/ReviewBlock.stories.d.ts +108 -0
- package/dist/components/ReviewBlock/stories/ReviewBlock.stories.js +23 -1
- package/dist/components/ReviewCard/ReviewCard.styled.d.ts +39 -13
- package/dist/components/ReviewCard/stories/ReviewCard.stories.d.ts +55 -0
- package/dist/components/ReviewCard/stories/ReviewCard.stories.js +19 -1
- package/dist/components/RichTextEditor/RichTextEditor.js +20 -12
- package/dist/components/RichTextEditor/RichTextEditor.styled.d.ts +36 -22
- package/dist/components/RichTextEditor/RichTextEditor.styled.js +1 -1
- package/dist/components/RichTextEditor/RichTextEditor.test.d.ts +1 -0
- package/dist/components/RichTextEditor/RichTextEditor.test.js +250 -0
- package/dist/components/RichTextEditor/props.d.ts +6 -0
- package/dist/components/RichTextEditor/props.js +3 -0
- package/dist/components/RichTextEditor/stories/RichTextEditor.stories.d.ts +74 -0
- package/dist/components/RichTextEditor/stories/RichTextEditor.stories.js +83 -1
- package/dist/components/RichTextEditor/utils/sanitize.d.ts +5 -3
- package/dist/components/RichTextEditor/utils/sanitize.js +38 -10
- package/dist/components/SearchBox/SearchBox.styled.d.ts +6 -2
- package/dist/components/SearchBox/stories/SearchBox.stories.d.ts +175 -0
- package/dist/components/SearchBox/stories/SearchBox.stories.js +53 -9
- package/dist/components/SelectBox/SelectBox.styled.d.ts +3 -1
- package/dist/components/SelectBox/stories/SelectBox.stories.d.ts +162 -2
- package/dist/components/SelectBox/stories/SelectBox.stories.js +24 -1
- package/dist/components/ShoppingCartProduct/ShoppingCartProduct.styled.d.ts +150 -56
- package/dist/components/ShoppingCartProduct/stories/ShoppingCartProduct.stories.d.ts +227 -0
- package/dist/components/ShoppingCartProduct/stories/ShoppingCartProduct.stories.js +31 -1
- package/dist/components/SkeletonLoader/SkeletonLoader.styled.d.ts +3 -1
- package/dist/components/SkeletonLoader/stories/SkeletonLoader.stories.d.ts +36 -2
- package/dist/components/SkeletonLoader/stories/SkeletonLoader.stories.js +41 -15
- package/dist/components/StepSlider/StepSlider.styled.d.ts +16 -8
- package/dist/components/StepSlider/stories/StepSlider.stories.d.ts +136 -6
- package/dist/components/StepSlider/stories/StepSlider.stories.js +86 -39
- package/dist/components/Stepper/Stepper.styled.d.ts +12 -4
- package/dist/components/Stepper/stories/Stepper.stories.d.ts +149 -3
- package/dist/components/Stepper/stories/Stepper.stories.js +92 -9
- package/dist/components/SuggestBox/SuggestBox.styled.d.ts +3 -1
- package/dist/components/SuggestBox/stories/SuggestBox.stories.d.ts +68 -2
- package/dist/components/SuggestBox/stories/SuggestBox.stories.js +48 -9
- package/dist/components/Table/Table.styled.d.ts +9 -3
- package/dist/components/Table/stories/Table.stories.d.ts +167 -2
- package/dist/components/Table/stories/Table.stories.js +72 -19
- package/dist/components/Tabs/Tabs.styled.d.ts +15 -5
- package/dist/components/Tabs/stories/Tabs.stories.d.ts +168 -12
- package/dist/components/Tabs/stories/Tabs.stories.js +118 -65
- package/dist/components/Tag/Tag.styled.d.ts +13 -8
- package/dist/components/Tag/stories/Tag.stories.d.ts +63 -5
- package/dist/components/Tag/stories/Tag.stories.js +41 -28
- package/dist/components/TagInput/TagInput.styled.d.ts +22 -11
- package/dist/components/TagInput/stories/TagInput.stories.d.ts +172 -4
- package/dist/components/TagInput/stories/TagInput.stories.js +80 -26
- package/dist/components/TextLink/TextLink.styled.d.ts +12 -4
- package/dist/components/TextLink/stories/TextLink.stories.d.ts +153 -7
- package/dist/components/TextLink/stories/TextLink.stories.js +61 -25
- package/dist/components/Textarea/Textarea.styled.d.ts +6 -2
- package/dist/components/Textarea/stories/Textarea.stories.d.ts +180 -6
- package/dist/components/Textarea/stories/Textarea.stories.js +59 -40
- package/dist/components/Toast/Toast.styled.d.ts +6 -2
- package/dist/components/Toast/stories/Toast.stories.d.ts +369 -5
- package/dist/components/Toast/stories/Toast.stories.js +77 -33
- package/dist/components/Tooltip/Tooltip.styled.d.ts +21 -7
- package/dist/components/Tooltip/stories/Tooltip.stories.d.ts +249 -19
- package/dist/components/Tooltip/stories/Tooltip.stories.js +72 -25
- package/dist/components/Typography/Typography.styled.d.ts +21 -7
- package/dist/components/Uploader/Uploader.styled.d.ts +49 -37
- package/dist/components/Uploader/stories/Uploader.stories.d.ts +219 -4
- package/dist/components/Uploader/stories/Uploader.stories.js +86 -46
- package/dist/components/VideoCard/VideoCard.styled.d.ts +18 -6
- package/dist/components/VideoCard/stories/VideoCard.stories.d.ts +50 -2
- package/dist/components/VideoCard/stories/VideoCard.stories.js +40 -10
- package/dist/setupTests.d.ts +1 -0
- package/dist/setupTests.js +3 -0
- package/package.json +9 -1
|
@@ -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.InsertVariables = exports.Disabled = exports.WithError = exports.WithSampleContent = exports.WithDescription = exports.Default = void 0;
|
|
17
|
+
exports.Interactive = exports.Complete = exports.WithoutLabel = exports.InsertVariables = exports.Disabled = exports.WithError = exports.WithTable = exports.WithCustomAllowedTags = exports.WithMaxHeight = exports.WithSampleContent = exports.WithDescription = exports.Default = void 0;
|
|
18
18
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
19
19
|
var react_1 = require("react");
|
|
20
20
|
var RichTextEditor_1 = __importDefault(require("../RichTextEditor"));
|
|
@@ -37,6 +37,8 @@ exports.default = {
|
|
|
37
37
|
hasError: { control: 'boolean' },
|
|
38
38
|
errorMessage: { control: 'text' },
|
|
39
39
|
minHeight: { control: 'text' },
|
|
40
|
+
maxHeight: { control: 'text' },
|
|
41
|
+
allowedTags: { control: false },
|
|
40
42
|
onChange: { control: false },
|
|
41
43
|
onBlur: { control: false },
|
|
42
44
|
value: { control: false },
|
|
@@ -67,6 +69,47 @@ exports.WithSampleContent = {
|
|
|
67
69
|
minHeight: '240px',
|
|
68
70
|
},
|
|
69
71
|
};
|
|
72
|
+
exports.WithMaxHeight = {
|
|
73
|
+
name: 'Sınırlı yükseklik (scroll)',
|
|
74
|
+
args: {
|
|
75
|
+
label: 'Mail metni',
|
|
76
|
+
defaultValue: SAMPLE_CONTENT.repeat(3),
|
|
77
|
+
minHeight: '220px',
|
|
78
|
+
maxHeight: '220px',
|
|
79
|
+
},
|
|
80
|
+
};
|
|
81
|
+
exports.WithCustomAllowedTags = {
|
|
82
|
+
name: 'Kısıtlı izinli etiketler',
|
|
83
|
+
args: {
|
|
84
|
+
label: 'Mail metni',
|
|
85
|
+
defaultValue: '<h2>Başlık</h2><p>Kalın <strong>metin</strong> ve normal metin.</p>',
|
|
86
|
+
minHeight: '160px',
|
|
87
|
+
allowedTags: ['p', 'br'],
|
|
88
|
+
},
|
|
89
|
+
parameters: {
|
|
90
|
+
docs: {
|
|
91
|
+
description: {
|
|
92
|
+
story: 'Sadece paragraf/satır sonuna izin verilir; `<h2>` ve `<strong>` etiketleri kaldırılır, içerikleri düz metin olarak kalır.',
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
},
|
|
96
|
+
};
|
|
97
|
+
exports.WithTable = {
|
|
98
|
+
name: 'Tablo (allowedTags: table)',
|
|
99
|
+
args: {
|
|
100
|
+
label: 'Mail metni',
|
|
101
|
+
defaultValue: "\n<p>Sipari\u015F \u00F6zeti:</p>\n<table>\n <tbody>\n <tr><th>\u00DCr\u00FCn</th><th>Adet</th><th>Tutar</th></tr>\n <tr><td>Kablosuz Kulakl\u0131k</td><td>1</td><td>\u20BA1.299</td></tr>\n <tr><td>\u015Earj Kablosu</td><td>2</td><td>\u20BA198</td></tr>\n </tbody>\n</table>",
|
|
102
|
+
minHeight: '220px',
|
|
103
|
+
allowedTags: ['p', 'table'],
|
|
104
|
+
},
|
|
105
|
+
parameters: {
|
|
106
|
+
docs: {
|
|
107
|
+
description: {
|
|
108
|
+
story: '`allowedTags` dizisine `table` eklendiğinde editör tablo şemasını (satır/hücre) destekler ve içerik render edilir. Eklenmezse `<table>` sanitize aşamasında düz metne indirilir.',
|
|
109
|
+
},
|
|
110
|
+
},
|
|
111
|
+
},
|
|
112
|
+
};
|
|
70
113
|
exports.WithError = {
|
|
71
114
|
args: {
|
|
72
115
|
label: 'Mail metni',
|
|
@@ -108,3 +151,42 @@ exports.InsertVariables = {
|
|
|
108
151
|
},
|
|
109
152
|
},
|
|
110
153
|
};
|
|
154
|
+
exports.WithoutLabel = {
|
|
155
|
+
args: {
|
|
156
|
+
placeholder: 'Metin yaz…',
|
|
157
|
+
minHeight: '180px',
|
|
158
|
+
},
|
|
159
|
+
};
|
|
160
|
+
exports.Complete = {
|
|
161
|
+
args: {
|
|
162
|
+
label: 'Mail metni',
|
|
163
|
+
placeholder: 'Metin yaz…',
|
|
164
|
+
description: 'Bu metin, gönderilen e-postalarda ürün kartının altında görünür.',
|
|
165
|
+
defaultValue: SAMPLE_CONTENT,
|
|
166
|
+
hasError: true,
|
|
167
|
+
errorMessage: 'Mail metni zorunludur.',
|
|
168
|
+
minHeight: '220px',
|
|
169
|
+
maxHeight: '280px',
|
|
170
|
+
},
|
|
171
|
+
};
|
|
172
|
+
var InteractiveStory = function (args) {
|
|
173
|
+
var _a = (0, react_1.useState)(args.defaultValue || '<p></p>'), html = _a[0], setHtml = _a[1];
|
|
174
|
+
return ((0, jsx_runtime_1.jsxs)("div", __assign({ style: { maxWidth: 720 } }, { children: [(0, jsx_runtime_1.jsx)(RichTextEditor_1.default, __assign({}, args, { value: html, onChange: setHtml })), (0, jsx_runtime_1.jsxs)("details", __assign({ style: { marginTop: '1rem' } }, { children: [(0, jsx_runtime_1.jsx)("summary", __assign({ style: { cursor: 'pointer', font: 'var(--caption-bold-12-15)', color: 'var(--dark-opacity-50)' } }, { children: "HTML \u00E7\u0131kt\u0131s\u0131" })), (0, jsx_runtime_1.jsx)("pre", __assign({ style: {
|
|
175
|
+
marginTop: '0.5rem',
|
|
176
|
+
padding: '0.75rem',
|
|
177
|
+
borderRadius: '0.5rem',
|
|
178
|
+
background: 'var(--dark-opacity-3)',
|
|
179
|
+
fontSize: 12,
|
|
180
|
+
whiteSpace: 'pre-wrap',
|
|
181
|
+
wordBreak: 'break-word',
|
|
182
|
+
} }, { children: html }))] }))] })));
|
|
183
|
+
};
|
|
184
|
+
exports.Interactive = {
|
|
185
|
+
render: function (args) { return (0, jsx_runtime_1.jsx)(InteractiveStory, __assign({}, args)); },
|
|
186
|
+
args: {
|
|
187
|
+
label: 'Mail metni',
|
|
188
|
+
placeholder: 'Metin yaz…',
|
|
189
|
+
minHeight: '220px',
|
|
190
|
+
defaultValue: '<p>Düzenlemeye başla…</p>',
|
|
191
|
+
},
|
|
192
|
+
};
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
|
|
1
|
+
/** RichTextEditor `allowedTags` prop'u verilmediğinde kullanılan varsayılan izinli etiket listesi */
|
|
2
|
+
export declare const DEFAULT_ALLOWED_TAGS: string[];
|
|
3
|
+
export declare const sanitizeHtml: (html: string, allowedTags?: string[]) => string;
|
|
2
4
|
/**
|
|
3
5
|
* TipTap HTML → dışarı verilen HTML
|
|
4
6
|
* Boş paragraflar (Enter + yazı yok) <br> olur.
|
|
5
7
|
* İçinde metin olan paragraflar <p> olarak kalır.
|
|
6
8
|
*/
|
|
7
|
-
export declare const serializeEditorHtml: (html: string) => string;
|
|
9
|
+
export declare const serializeEditorHtml: (html: string, allowedTags?: string[]) => string;
|
|
8
10
|
/**
|
|
9
11
|
* Dışarıdan gelen HTML → TipTap'in düzenleyebileceği HTML
|
|
10
12
|
* Blok seviyesindeki <br> etiketleri boş <p> olur (Enter satırı).
|
|
11
13
|
* <p> içindeki <br> hard-break olarak kalır.
|
|
12
14
|
*/
|
|
13
|
-
export declare const prepareEditorHtml: (html: string) => string;
|
|
15
|
+
export declare const prepareEditorHtml: (html: string, allowedTags?: string[]) => string;
|
|
@@ -1,11 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
3
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
4
|
+
if (ar || !(i in from)) {
|
|
5
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
6
|
+
ar[i] = from[i];
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
10
|
+
};
|
|
2
11
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
13
|
};
|
|
5
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.prepareEditorHtml = exports.serializeEditorHtml = exports.sanitizeHtml = void 0;
|
|
15
|
+
exports.prepareEditorHtml = exports.serializeEditorHtml = exports.sanitizeHtml = exports.DEFAULT_ALLOWED_TAGS = void 0;
|
|
7
16
|
var dompurify_1 = __importDefault(require("dompurify"));
|
|
8
|
-
|
|
17
|
+
/** RichTextEditor `allowedTags` prop'u verilmediğinde kullanılan varsayılan izinli etiket listesi */
|
|
18
|
+
exports.DEFAULT_ALLOWED_TAGS = [
|
|
9
19
|
'p',
|
|
10
20
|
'br',
|
|
11
21
|
'h2',
|
|
@@ -26,13 +36,28 @@ var ALLOWED_ATTR = [
|
|
|
26
36
|
'data-variable',
|
|
27
37
|
'data-id',
|
|
28
38
|
'data-label',
|
|
39
|
+
// Tablo hücrelerinde birleştirme (merge/split) ve dıştan gelen sütun genişliği bilgisi için
|
|
40
|
+
'colspan',
|
|
41
|
+
'rowspan',
|
|
42
|
+
'colwidth',
|
|
29
43
|
];
|
|
44
|
+
/**
|
|
45
|
+
* `table` etiketi izinliyken düzgün render edilebilmesi için birlikte izinli olması
|
|
46
|
+
* gereken yapısal alt etiketler. Tüketici sadece "table" eklese de tablo çalışır.
|
|
47
|
+
*/
|
|
48
|
+
var TABLE_STRUCTURE_TAGS = ['table', 'tbody', 'tr', 'th', 'td', 'colgroup', 'col'];
|
|
49
|
+
var resolveAllowedTags = function (allowedTags) {
|
|
50
|
+
if (!allowedTags.includes('table'))
|
|
51
|
+
return allowedTags;
|
|
52
|
+
return Array.from(new Set(__spreadArray(__spreadArray([], allowedTags, true), TABLE_STRUCTURE_TAGS, true)));
|
|
53
|
+
};
|
|
30
54
|
var EMPTY_PARAGRAPH_REGEX = /<p>(?:\s| |<br\s*\/?>)*<\/p>/gi;
|
|
31
|
-
var sanitizeHtml = function (html) {
|
|
55
|
+
var sanitizeHtml = function (html, allowedTags) {
|
|
56
|
+
if (allowedTags === void 0) { allowedTags = exports.DEFAULT_ALLOWED_TAGS; }
|
|
32
57
|
if (!html)
|
|
33
58
|
return '';
|
|
34
59
|
return dompurify_1.default.sanitize(html, {
|
|
35
|
-
ALLOWED_TAGS:
|
|
60
|
+
ALLOWED_TAGS: resolveAllowedTags(allowedTags),
|
|
36
61
|
ALLOWED_ATTR: ALLOWED_ATTR,
|
|
37
62
|
KEEP_CONTENT: true,
|
|
38
63
|
});
|
|
@@ -43,8 +68,9 @@ exports.sanitizeHtml = sanitizeHtml;
|
|
|
43
68
|
* Boş paragraflar (Enter + yazı yok) <br> olur.
|
|
44
69
|
* İçinde metin olan paragraflar <p> olarak kalır.
|
|
45
70
|
*/
|
|
46
|
-
var serializeEditorHtml = function (html) {
|
|
47
|
-
|
|
71
|
+
var serializeEditorHtml = function (html, allowedTags) {
|
|
72
|
+
if (allowedTags === void 0) { allowedTags = exports.DEFAULT_ALLOWED_TAGS; }
|
|
73
|
+
var sanitized = (0, exports.sanitizeHtml)(html, allowedTags);
|
|
48
74
|
if (!sanitized)
|
|
49
75
|
return '';
|
|
50
76
|
var serialized = sanitized.replace(EMPTY_PARAGRAPH_REGEX, '<br>');
|
|
@@ -59,8 +85,9 @@ exports.serializeEditorHtml = serializeEditorHtml;
|
|
|
59
85
|
* Blok seviyesindeki <br> etiketleri boş <p> olur (Enter satırı).
|
|
60
86
|
* <p> içindeki <br> hard-break olarak kalır.
|
|
61
87
|
*/
|
|
62
|
-
var prepareEditorHtml = function (html) {
|
|
63
|
-
|
|
88
|
+
var prepareEditorHtml = function (html, allowedTags) {
|
|
89
|
+
if (allowedTags === void 0) { allowedTags = exports.DEFAULT_ALLOWED_TAGS; }
|
|
90
|
+
var sanitized = (0, exports.sanitizeHtml)(html, allowedTags);
|
|
64
91
|
if (!sanitized)
|
|
65
92
|
return '';
|
|
66
93
|
if (typeof DOMParser === 'undefined') {
|
|
@@ -85,12 +112,13 @@ var prepareEditorHtml = function (html) {
|
|
|
85
112
|
if (tag === 'P' || tag === 'H2' || tag === 'SPAN') {
|
|
86
113
|
return;
|
|
87
114
|
}
|
|
88
|
-
if (tag === 'LI' || tag === 'UL' || tag === 'OL' || tag === 'DIV'
|
|
115
|
+
if (tag === 'LI' || tag === 'UL' || tag === 'OL' || tag === 'DIV'
|
|
116
|
+
|| tag === 'TABLE' || tag === 'TBODY' || tag === 'TR' || tag === 'TD' || tag === 'TH') {
|
|
89
117
|
replaceBlockBreaks(element);
|
|
90
118
|
}
|
|
91
119
|
});
|
|
92
120
|
};
|
|
93
121
|
replaceBlockBreaks(root);
|
|
94
|
-
return (0, exports.sanitizeHtml)(root.innerHTML);
|
|
122
|
+
return (0, exports.sanitizeHtml)(root.innerHTML, allowedTags);
|
|
95
123
|
};
|
|
96
124
|
exports.prepareEditorHtml = prepareEditorHtml;
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { SearchBoxStyledProps } from "./props";
|
|
3
|
-
export declare const SearchBoxStyled: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").
|
|
4
|
-
|
|
3
|
+
export declare const SearchBoxStyled: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Merged<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
|
|
4
|
+
style?: import("react").CSSProperties | import("styled-components/dist/types").CSSPropertiesWithVars;
|
|
5
|
+
}, SearchBoxStyledProps>> & string;
|
|
6
|
+
export declare const LoadingStyled: import("styled-components/dist/types").IStyledComponentBase<"web", Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
|
|
7
|
+
style?: import("react").CSSProperties | import("styled-components/dist/types").CSSPropertiesWithVars;
|
|
8
|
+
}> & string;
|
|
@@ -11,6 +11,9 @@ declare const _default: {
|
|
|
11
11
|
placeholder: {
|
|
12
12
|
control: string;
|
|
13
13
|
};
|
|
14
|
+
value: {
|
|
15
|
+
control: string;
|
|
16
|
+
};
|
|
14
17
|
isLoading: {
|
|
15
18
|
control: string;
|
|
16
19
|
};
|
|
@@ -20,6 +23,24 @@ declare const _default: {
|
|
|
20
23
|
disabled: {
|
|
21
24
|
control: string;
|
|
22
25
|
};
|
|
26
|
+
minSearchLength: {
|
|
27
|
+
control: string;
|
|
28
|
+
};
|
|
29
|
+
ariaLabel: {
|
|
30
|
+
control: string;
|
|
31
|
+
};
|
|
32
|
+
onChange: {
|
|
33
|
+
action: string;
|
|
34
|
+
};
|
|
35
|
+
onButtonClick: {
|
|
36
|
+
action: string;
|
|
37
|
+
};
|
|
38
|
+
onFocus: {
|
|
39
|
+
action: string;
|
|
40
|
+
};
|
|
41
|
+
onBlur: {
|
|
42
|
+
action: string;
|
|
43
|
+
};
|
|
23
44
|
};
|
|
24
45
|
};
|
|
25
46
|
export default _default;
|
|
@@ -29,12 +50,16 @@ export declare const Default: {
|
|
|
29
50
|
onFocus: (e: any) => void;
|
|
30
51
|
onKeyUp: (e: any) => void;
|
|
31
52
|
onChange: (e: any) => void;
|
|
53
|
+
onButtonClick: (e: any) => void;
|
|
32
54
|
placeholder: string;
|
|
33
55
|
isLoading: boolean;
|
|
34
56
|
showResultList: boolean;
|
|
35
57
|
size: string;
|
|
36
58
|
value: string;
|
|
37
59
|
children: React.JSX.Element[];
|
|
60
|
+
disabled: boolean;
|
|
61
|
+
minSearchLength: number;
|
|
62
|
+
ariaLabel: string;
|
|
38
63
|
};
|
|
39
64
|
};
|
|
40
65
|
export declare const Medium: {
|
|
@@ -44,11 +69,15 @@ export declare const Medium: {
|
|
|
44
69
|
onFocus: (e: any) => void;
|
|
45
70
|
onKeyUp: (e: any) => void;
|
|
46
71
|
onChange: (e: any) => void;
|
|
72
|
+
onButtonClick: (e: any) => void;
|
|
47
73
|
placeholder: string;
|
|
48
74
|
isLoading: boolean;
|
|
49
75
|
showResultList: boolean;
|
|
50
76
|
value: string;
|
|
51
77
|
children: React.JSX.Element[];
|
|
78
|
+
disabled: boolean;
|
|
79
|
+
minSearchLength: number;
|
|
80
|
+
ariaLabel: string;
|
|
52
81
|
};
|
|
53
82
|
};
|
|
54
83
|
export declare const Small: {
|
|
@@ -58,11 +87,15 @@ export declare const Small: {
|
|
|
58
87
|
onFocus: (e: any) => void;
|
|
59
88
|
onKeyUp: (e: any) => void;
|
|
60
89
|
onChange: (e: any) => void;
|
|
90
|
+
onButtonClick: (e: any) => void;
|
|
61
91
|
placeholder: string;
|
|
62
92
|
isLoading: boolean;
|
|
63
93
|
showResultList: boolean;
|
|
64
94
|
value: string;
|
|
65
95
|
children: React.JSX.Element[];
|
|
96
|
+
disabled: boolean;
|
|
97
|
+
minSearchLength: number;
|
|
98
|
+
ariaLabel: string;
|
|
66
99
|
};
|
|
67
100
|
};
|
|
68
101
|
export declare const WithResults: {
|
|
@@ -73,10 +106,86 @@ export declare const WithResults: {
|
|
|
73
106
|
onFocus: (e: any) => void;
|
|
74
107
|
onKeyUp: (e: any) => void;
|
|
75
108
|
onChange: (e: any) => void;
|
|
109
|
+
onButtonClick: (e: any) => void;
|
|
76
110
|
placeholder: string;
|
|
77
111
|
isLoading: boolean;
|
|
78
112
|
size: string;
|
|
79
113
|
children: React.JSX.Element[];
|
|
114
|
+
disabled: boolean;
|
|
115
|
+
minSearchLength: number;
|
|
116
|
+
ariaLabel: string;
|
|
117
|
+
};
|
|
118
|
+
};
|
|
119
|
+
export declare const MediumWithResults: {
|
|
120
|
+
args: {
|
|
121
|
+
size: string;
|
|
122
|
+
showResultList: boolean;
|
|
123
|
+
value: string;
|
|
124
|
+
onBlur: (e: any) => void;
|
|
125
|
+
onFocus: (e: any) => void;
|
|
126
|
+
onKeyUp: (e: any) => void;
|
|
127
|
+
onChange: (e: any) => void;
|
|
128
|
+
onButtonClick: (e: any) => void;
|
|
129
|
+
placeholder: string;
|
|
130
|
+
isLoading: boolean;
|
|
131
|
+
children: React.JSX.Element[];
|
|
132
|
+
disabled: boolean;
|
|
133
|
+
minSearchLength: number;
|
|
134
|
+
ariaLabel: string;
|
|
135
|
+
};
|
|
136
|
+
};
|
|
137
|
+
export declare const FewResults: {
|
|
138
|
+
args: {
|
|
139
|
+
showResultList: boolean;
|
|
140
|
+
value: string;
|
|
141
|
+
children: React.JSX.Element[];
|
|
142
|
+
onBlur: (e: any) => void;
|
|
143
|
+
onFocus: (e: any) => void;
|
|
144
|
+
onKeyUp: (e: any) => void;
|
|
145
|
+
onChange: (e: any) => void;
|
|
146
|
+
onButtonClick: (e: any) => void;
|
|
147
|
+
placeholder: string;
|
|
148
|
+
isLoading: boolean;
|
|
149
|
+
size: string;
|
|
150
|
+
disabled: boolean;
|
|
151
|
+
minSearchLength: number;
|
|
152
|
+
ariaLabel: string;
|
|
153
|
+
};
|
|
154
|
+
};
|
|
155
|
+
export declare const EmptyResults: {
|
|
156
|
+
args: {
|
|
157
|
+
showResultList: boolean;
|
|
158
|
+
value: string;
|
|
159
|
+
children: any[];
|
|
160
|
+
onBlur: (e: any) => void;
|
|
161
|
+
onFocus: (e: any) => void;
|
|
162
|
+
onKeyUp: (e: any) => void;
|
|
163
|
+
onChange: (e: any) => void;
|
|
164
|
+
onButtonClick: (e: any) => void;
|
|
165
|
+
placeholder: string;
|
|
166
|
+
isLoading: boolean;
|
|
167
|
+
size: string;
|
|
168
|
+
disabled: boolean;
|
|
169
|
+
minSearchLength: number;
|
|
170
|
+
ariaLabel: string;
|
|
171
|
+
};
|
|
172
|
+
};
|
|
173
|
+
export declare const BelowMinSearchLength: {
|
|
174
|
+
args: {
|
|
175
|
+
showResultList: boolean;
|
|
176
|
+
value: string;
|
|
177
|
+
minSearchLength: number;
|
|
178
|
+
onBlur: (e: any) => void;
|
|
179
|
+
onFocus: (e: any) => void;
|
|
180
|
+
onKeyUp: (e: any) => void;
|
|
181
|
+
onChange: (e: any) => void;
|
|
182
|
+
onButtonClick: (e: any) => void;
|
|
183
|
+
placeholder: string;
|
|
184
|
+
isLoading: boolean;
|
|
185
|
+
size: string;
|
|
186
|
+
children: React.JSX.Element[];
|
|
187
|
+
disabled: boolean;
|
|
188
|
+
ariaLabel: string;
|
|
80
189
|
};
|
|
81
190
|
};
|
|
82
191
|
export declare const Loading: {
|
|
@@ -88,9 +197,13 @@ export declare const Loading: {
|
|
|
88
197
|
onFocus: (e: any) => void;
|
|
89
198
|
onKeyUp: (e: any) => void;
|
|
90
199
|
onChange: (e: any) => void;
|
|
200
|
+
onButtonClick: (e: any) => void;
|
|
91
201
|
placeholder: string;
|
|
92
202
|
size: string;
|
|
93
203
|
children: React.JSX.Element[];
|
|
204
|
+
disabled: boolean;
|
|
205
|
+
minSearchLength: number;
|
|
206
|
+
ariaLabel: string;
|
|
94
207
|
};
|
|
95
208
|
};
|
|
96
209
|
export declare const Disabled: {
|
|
@@ -100,12 +213,15 @@ export declare const Disabled: {
|
|
|
100
213
|
onFocus: (e: any) => void;
|
|
101
214
|
onKeyUp: (e: any) => void;
|
|
102
215
|
onChange: (e: any) => void;
|
|
216
|
+
onButtonClick: (e: any) => void;
|
|
103
217
|
placeholder: string;
|
|
104
218
|
isLoading: boolean;
|
|
105
219
|
showResultList: boolean;
|
|
106
220
|
size: string;
|
|
107
221
|
value: string;
|
|
108
222
|
children: React.JSX.Element[];
|
|
223
|
+
minSearchLength: number;
|
|
224
|
+
ariaLabel: string;
|
|
109
225
|
};
|
|
110
226
|
};
|
|
111
227
|
export declare const CustomPlaceholder: {
|
|
@@ -115,10 +231,69 @@ export declare const CustomPlaceholder: {
|
|
|
115
231
|
onFocus: (e: any) => void;
|
|
116
232
|
onKeyUp: (e: any) => void;
|
|
117
233
|
onChange: (e: any) => void;
|
|
234
|
+
onButtonClick: (e: any) => void;
|
|
235
|
+
isLoading: boolean;
|
|
236
|
+
showResultList: boolean;
|
|
237
|
+
size: string;
|
|
238
|
+
value: string;
|
|
239
|
+
children: React.JSX.Element[];
|
|
240
|
+
disabled: boolean;
|
|
241
|
+
minSearchLength: number;
|
|
242
|
+
ariaLabel: string;
|
|
243
|
+
};
|
|
244
|
+
};
|
|
245
|
+
export declare const WithValue: {
|
|
246
|
+
args: {
|
|
247
|
+
value: string;
|
|
248
|
+
onBlur: (e: any) => void;
|
|
249
|
+
onFocus: (e: any) => void;
|
|
250
|
+
onKeyUp: (e: any) => void;
|
|
251
|
+
onChange: (e: any) => void;
|
|
252
|
+
onButtonClick: (e: any) => void;
|
|
253
|
+
placeholder: string;
|
|
118
254
|
isLoading: boolean;
|
|
119
255
|
showResultList: boolean;
|
|
120
256
|
size: string;
|
|
257
|
+
children: React.JSX.Element[];
|
|
258
|
+
disabled: boolean;
|
|
259
|
+
minSearchLength: number;
|
|
260
|
+
ariaLabel: string;
|
|
261
|
+
};
|
|
262
|
+
};
|
|
263
|
+
export declare const Complete: {
|
|
264
|
+
args: {
|
|
265
|
+
size: string;
|
|
266
|
+
placeholder: string;
|
|
267
|
+
value: string;
|
|
268
|
+
showResultList: boolean;
|
|
269
|
+
isLoading: boolean;
|
|
270
|
+
minSearchLength: number;
|
|
271
|
+
ariaLabel: string;
|
|
272
|
+
children: React.JSX.Element[];
|
|
273
|
+
onBlur: (e: any) => void;
|
|
274
|
+
onFocus: (e: any) => void;
|
|
275
|
+
onKeyUp: (e: any) => void;
|
|
276
|
+
onChange: (e: any) => void;
|
|
277
|
+
onButtonClick: (e: any) => void;
|
|
278
|
+
disabled: boolean;
|
|
279
|
+
};
|
|
280
|
+
};
|
|
281
|
+
export declare const Interactive: {
|
|
282
|
+
render: (args: any) => React.JSX.Element;
|
|
283
|
+
args: {
|
|
284
|
+
placeholder: string;
|
|
121
285
|
value: string;
|
|
286
|
+
minSearchLength: number;
|
|
287
|
+
onBlur: (e: any) => void;
|
|
288
|
+
onFocus: (e: any) => void;
|
|
289
|
+
onKeyUp: (e: any) => void;
|
|
290
|
+
onChange: (e: any) => void;
|
|
291
|
+
onButtonClick: (e: any) => void;
|
|
292
|
+
isLoading: boolean;
|
|
293
|
+
showResultList: boolean;
|
|
294
|
+
size: string;
|
|
122
295
|
children: React.JSX.Element[];
|
|
296
|
+
disabled: boolean;
|
|
297
|
+
ariaLabel: string;
|
|
123
298
|
};
|
|
124
299
|
};
|
|
@@ -14,8 +14,9 @@ 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.CustomPlaceholder = exports.Disabled = exports.Loading = exports.WithResults = exports.Small = exports.Medium = exports.Default = void 0;
|
|
17
|
+
exports.Interactive = exports.Complete = exports.WithValue = exports.CustomPlaceholder = exports.Disabled = exports.Loading = exports.BelowMinSearchLength = exports.EmptyResults = exports.FewResults = exports.MediumWithResults = exports.WithResults = exports.Small = exports.Medium = exports.Default = void 0;
|
|
18
18
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
19
|
+
var react_1 = __importDefault(require("react"));
|
|
19
20
|
var SearchBox_1 = __importDefault(require("../SearchBox"));
|
|
20
21
|
var productList_json_1 = __importDefault(require("../../../jsons/productList.json"));
|
|
21
22
|
var index_1 = require("../../../index");
|
|
@@ -24,17 +25,22 @@ var searchResults = productList_json_1.default.map(function (product) {
|
|
|
24
25
|
var _a, _b, _c;
|
|
25
26
|
return ((0, jsx_runtime_1.jsx)(index_1.ProductCardHorizontal, { title: product.name, image: (0, jsx_runtime_1.jsx)("img", { src: (_a = product.medias[0]) === null || _a === void 0 ? void 0 : _a.url, alt: product.name, width: "70", height: "70", className: "media" }), description: product.shortDescription, price: "".concat((_b = product.prices[0]) === null || _b === void 0 ? void 0 : _b.newPriceText, " ").concat((_c = product.prices[0]) === null || _c === void 0 ? void 0 : _c.currencyCode), period: "ay", size: "small" }, product.productId));
|
|
26
27
|
});
|
|
27
|
-
var
|
|
28
|
+
var fewResults = searchResults.slice(0, 2);
|
|
29
|
+
var baseArgs = {
|
|
28
30
|
onBlur: function (e) { return console.log(e, "onBlur"); },
|
|
29
31
|
onFocus: function (e) { return console.log(e, "onFocus"); },
|
|
30
32
|
onKeyUp: function (e) { return console.log(e.target.value, "onKeyUp"); },
|
|
31
33
|
onChange: function (e) { return console.log(e.target.value, "onChange"); },
|
|
34
|
+
onButtonClick: function (e) { return console.log(e, "onButtonClick"); },
|
|
32
35
|
placeholder: "Teknolojik ürün ara...",
|
|
33
36
|
isLoading: false,
|
|
34
37
|
showResultList: false,
|
|
35
38
|
size: "small",
|
|
36
39
|
value: "",
|
|
37
40
|
children: searchResults,
|
|
41
|
+
disabled: false,
|
|
42
|
+
minSearchLength: 2,
|
|
43
|
+
ariaLabel: "Search",
|
|
38
44
|
};
|
|
39
45
|
exports.default = {
|
|
40
46
|
title: 'Components/SearchBox',
|
|
@@ -43,29 +49,67 @@ exports.default = {
|
|
|
43
49
|
argTypes: {
|
|
44
50
|
size: { control: 'select', options: props_1.sizes },
|
|
45
51
|
placeholder: { control: 'text' },
|
|
52
|
+
value: { control: 'text' },
|
|
46
53
|
isLoading: { control: 'boolean' },
|
|
47
54
|
showResultList: { control: 'boolean' },
|
|
48
55
|
disabled: { control: 'boolean' },
|
|
56
|
+
minSearchLength: { control: 'number' },
|
|
57
|
+
ariaLabel: { control: 'text' },
|
|
58
|
+
onChange: { action: 'changed' },
|
|
59
|
+
onButtonClick: { action: 'buttonClicked' },
|
|
60
|
+
onFocus: { action: 'focused' },
|
|
61
|
+
onBlur: { action: 'blurred' },
|
|
49
62
|
}
|
|
50
63
|
};
|
|
51
64
|
exports.Default = {
|
|
52
|
-
args:
|
|
65
|
+
args: __assign({}, baseArgs),
|
|
53
66
|
};
|
|
54
67
|
exports.Medium = {
|
|
55
|
-
args: __assign(__assign({},
|
|
68
|
+
args: __assign(__assign({}, baseArgs), { size: "medium" }),
|
|
56
69
|
};
|
|
57
70
|
exports.Small = {
|
|
58
|
-
args: __assign(__assign({},
|
|
71
|
+
args: __assign(__assign({}, baseArgs), { size: "small" }),
|
|
59
72
|
};
|
|
60
73
|
exports.WithResults = {
|
|
61
|
-
args: __assign(__assign({},
|
|
74
|
+
args: __assign(__assign({}, baseArgs), { showResultList: true, value: "ipad" }),
|
|
75
|
+
};
|
|
76
|
+
exports.MediumWithResults = {
|
|
77
|
+
args: __assign(__assign({}, baseArgs), { size: "medium", showResultList: true, value: "ipad" }),
|
|
78
|
+
};
|
|
79
|
+
exports.FewResults = {
|
|
80
|
+
args: __assign(__assign({}, baseArgs), { showResultList: true, value: "ipad", children: fewResults }),
|
|
81
|
+
};
|
|
82
|
+
exports.EmptyResults = {
|
|
83
|
+
args: __assign(__assign({}, baseArgs), { showResultList: true, value: "xyz", children: [] }),
|
|
84
|
+
};
|
|
85
|
+
exports.BelowMinSearchLength = {
|
|
86
|
+
args: __assign(__assign({}, baseArgs), { showResultList: true, value: "i", minSearchLength: 2 }),
|
|
62
87
|
};
|
|
63
88
|
exports.Loading = {
|
|
64
|
-
args: __assign(__assign({},
|
|
89
|
+
args: __assign(__assign({}, baseArgs), { showResultList: true, isLoading: true, value: "ipad" }),
|
|
65
90
|
};
|
|
66
91
|
exports.Disabled = {
|
|
67
|
-
args: __assign(__assign({},
|
|
92
|
+
args: __assign(__assign({}, baseArgs), { disabled: true }),
|
|
68
93
|
};
|
|
69
94
|
exports.CustomPlaceholder = {
|
|
70
|
-
args: __assign(__assign({},
|
|
95
|
+
args: __assign(__assign({}, baseArgs), { placeholder: "Ürün veya kategori ara..." }),
|
|
96
|
+
};
|
|
97
|
+
exports.WithValue = {
|
|
98
|
+
args: __assign(__assign({}, baseArgs), { value: "MacBook" }),
|
|
99
|
+
};
|
|
100
|
+
exports.Complete = {
|
|
101
|
+
args: __assign(__assign({}, baseArgs), { size: "medium", placeholder: "Ürün, kategori veya marka ara...", value: "ipad", showResultList: true, isLoading: false, minSearchLength: 2, ariaLabel: "Ürün ara", children: fewResults }),
|
|
102
|
+
};
|
|
103
|
+
var InteractiveStory = function (args) {
|
|
104
|
+
var _a, _b;
|
|
105
|
+
var _c = react_1.default.useState(args.value || ""), value = _c[0], setValue = _c[1];
|
|
106
|
+
var query = value.trim().toLocaleLowerCase("tr-TR");
|
|
107
|
+
var filtered = query.length >= ((_a = args.minSearchLength) !== null && _a !== void 0 ? _a : 2)
|
|
108
|
+
? searchResults.filter(function (child) { var _a; return String(((_a = child === null || child === void 0 ? void 0 : child.props) === null || _a === void 0 ? void 0 : _a.title) || "").toLocaleLowerCase("tr-TR").includes(query); })
|
|
109
|
+
: [];
|
|
110
|
+
return ((0, jsx_runtime_1.jsx)("div", __assign({ style: { maxWidth: 480, minHeight: 320 } }, { children: (0, jsx_runtime_1.jsx)(SearchBox_1.default, __assign({}, args, { value: value, showResultList: query.length >= ((_b = args.minSearchLength) !== null && _b !== void 0 ? _b : 2), onChange: function (e) { return setValue(e.target.value); }, onButtonClick: function () { return console.log("search", value); } }, { children: filtered })) })));
|
|
111
|
+
};
|
|
112
|
+
exports.Interactive = {
|
|
113
|
+
render: function (args) { return (0, jsx_runtime_1.jsx)(InteractiveStory, __assign({}, args)); },
|
|
114
|
+
args: __assign(__assign({}, baseArgs), { placeholder: "Yazmaya başla...", value: "", minSearchLength: 2 }),
|
|
71
115
|
};
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { ContainerProps } from "./props";
|
|
3
|
-
export declare const Container: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").
|
|
3
|
+
export declare const Container: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Merged<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
|
|
4
|
+
style?: import("react").CSSProperties | import("styled-components/dist/types").CSSPropertiesWithVars;
|
|
5
|
+
}, ContainerProps>> & string;
|