krl-alfred 2.24.7 → 2.24.8
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/RadioButton/layouts/horizontal/Horizontal.styled.js +3 -3
- package/dist/components/RadioButton/layouts/horizontal/Horizontal.test.js +8 -0
- package/dist/components/RadioGroup/RadioGroup.styled.js +1 -1
- package/dist/components/RadioGroup/RadioGroup.test.js +14 -0
- package/dist/components/RadioGroup/stories/RadioGroup.stories.d.ts +54 -0
- package/dist/components/RadioGroup/stories/RadioGroup.stories.js +44 -1
- package/package.json +1 -1
|
@@ -40,7 +40,7 @@ var getIndicatorSize = function (size) {
|
|
|
40
40
|
return '16px';
|
|
41
41
|
}
|
|
42
42
|
};
|
|
43
|
-
exports.HorizontalLabel = styled_components_1.default.label(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n width: 100%;\n align-items: stretch;\n justify-content:
|
|
43
|
+
exports.HorizontalLabel = styled_components_1.default.label(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n width: 100%;\n flex: 1 1 auto;\n align-items: stretch;\n justify-content: flex-start;\n cursor: inherit;\n ", "\n"], ["\n display: flex;\n flex-direction: column;\n width: 100%;\n flex: 1 1 auto;\n align-items: stretch;\n justify-content: flex-start;\n cursor: inherit;\n ", "\n"])), function (props) { return (0, radioInteraction_1.nonCheckableWrapperStyles)(props); });
|
|
44
44
|
exports.Inner = styled_components_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n width: 100%;\n padding: 1rem 1.5rem;\n min-height: ", ";\n display: flex;\n align-items: center;\n justify-content: space-between;\n box-sizing: border-box;\n\n @media only screen and ", " {\n padding: 0 1rem;\n }\n"], ["\n width: 100%;\n padding: 1rem 1.5rem;\n min-height: ", ";\n display: flex;\n align-items: center;\n justify-content: space-between;\n box-sizing: border-box;\n\n @media only screen and ", " {\n padding: 0 1rem;\n }\n"])), function (props) { return (props.$innerMinHeight === 'initial' ? 'initial' : '70px'); }, devices_1.devices.sm);
|
|
45
45
|
exports.LeftContent = styled_components_1.default.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n justify-content: flex-start;\n width: auto;\n position: relative;\n"], ["\n display: flex;\n align-items: center;\n justify-content: flex-start;\n width: auto;\n position: relative;\n"])));
|
|
46
46
|
exports.Indicator = styled_components_1.default.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n flex: 0 0 auto;\n ", "\n ", "\n display: block;\n position: relative;\n margin: 0 ", " 0 0;\n width: ", ";\n height: ", ";\n"], ["\n flex: 0 0 auto;\n ", "\n ", "\n display: block;\n position: relative;\n margin: 0 ", " 0 0;\n width: ", ";\n height: ", ";\n"])), RadioIndicator_styled_1.radioIndicatorIconStyles, function (props) { return props.checked && !props.$disabled && !props.$hasError && RadioIndicator_styled_1.radioIndicatorCheckedStyles; }, function (props) { return props.$labelOffset || "0.5rem"; }, function (props) { return getIndicatorSize(props.$size); }, function (props) { return getIndicatorSize(props.$size); });
|
|
@@ -51,13 +51,13 @@ exports.BadgesWrapper = styled_components_1.default.div(templateObject_8 || (tem
|
|
|
51
51
|
exports.TitleBadgeTopRight = styled_components_1.default.div(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n position: absolute;\n top: 0.5rem;\n right: 0.5rem;\n display: flex;\n align-items: center;\n z-index: 1;\n"], ["\n position: absolute;\n top: 0.5rem;\n right: 0.5rem;\n display: flex;\n align-items: center;\n z-index: 1;\n"])));
|
|
52
52
|
exports.Description = styled_components_1.default.div(templateObject_10 || (templateObject_10 = __makeTemplateObject(["\n color: var(--dark-opacity-50);\n font: var(--caption-medium-12-15);\n margin-top: 0.5rem;\n margin-bottom: 0;\n width: 100%;\n display: block;\n\n p {\n margin: 0;\n }\n\n a {\n color: inherit;\n }\n"], ["\n color: var(--dark-opacity-50);\n font: var(--caption-medium-12-15);\n margin-top: 0.5rem;\n margin-bottom: 0;\n width: 100%;\n display: block;\n\n p {\n margin: 0;\n }\n\n a {\n color: inherit;\n }\n"])));
|
|
53
53
|
exports.ErrorMessage = styled_components_1.default.div(templateObject_11 || (templateObject_11 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n margin-top: 8px;\n color: var(--red);\n\n svg {\n margin-right: 8px;\n }\n\n p {\n margin: 0;\n font: var(--caption-semi-bold-11-13);\n }\n"], ["\n display: flex;\n align-items: center;\n margin-top: 8px;\n color: var(--red);\n\n svg {\n margin-right: 8px;\n }\n\n p {\n margin: 0;\n font: var(--caption-semi-bold-11-13);\n }\n"])));
|
|
54
|
-
exports.HorizontalRoot = styled_components_1.default.div(templateObject_12 || (templateObject_12 = __makeTemplateObject(["\n display:
|
|
54
|
+
exports.HorizontalRoot = styled_components_1.default.div(templateObject_12 || (templateObject_12 = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n align-self: stretch;\n width: 100%;\n"], ["\n display: flex;\n flex-direction: column;\n align-self: stretch;\n width: 100%;\n"])));
|
|
55
55
|
exports.RightContent = styled_components_1.default.div(templateObject_13 || (templateObject_13 = __makeTemplateObject(["\n flex: 0 0 auto;\n width: auto;\n text-align: end;\n row-gap: 0.25rem;\n display: grid;\n"], ["\n flex: 0 0 auto;\n width: auto;\n text-align: end;\n row-gap: 0.25rem;\n display: grid;\n"])));
|
|
56
56
|
exports.Price = styled_components_1.default.strong(templateObject_14 || (templateObject_14 = __makeTemplateObject(["\n color: var(--dark);\n font: var(--title-bold-16-19);\n"], ["\n color: var(--dark);\n font: var(--title-bold-16-19);\n"])));
|
|
57
57
|
exports.TotalPrice = styled_components_1.default.strong(templateObject_15 || (templateObject_15 = __makeTemplateObject(["\n display: block;\n color: var(--dark-opacity-50);\n font: var(--caption-semi-bold-12-15);\n"], ["\n display: block;\n color: var(--dark-opacity-50);\n font: var(--caption-semi-bold-12-15);\n"])));
|
|
58
58
|
exports.TotalLabel = styled_components_1.default.span(templateObject_16 || (templateObject_16 = __makeTemplateObject(["\n @media only screen and ", " {\n display: none;\n }\n"], ["\n @media only screen and ", " {\n display: none;\n }\n"])), devices_1.devices.sm);
|
|
59
59
|
exports.ContentArea = styled_components_1.default.div(templateObject_17 || (templateObject_17 = __makeTemplateObject(["\n width: 100%;\n padding: 0 1.5rem 1.5rem;\n box-sizing: border-box;\n cursor: default;\n\n @media only screen and ", " {\n padding: 0 1rem 1rem;\n }\n"], ["\n width: 100%;\n padding: 0 1.5rem 1.5rem;\n box-sizing: border-box;\n cursor: default;\n\n @media only screen and ", " {\n padding: 0 1rem 1rem;\n }\n"])), devices_1.devices.sm);
|
|
60
|
-
exports.HorizontalBoxStyled = styled_components_1.default.div(templateObject_19 || (templateObject_19 = __makeTemplateObject(["\n display:
|
|
60
|
+
exports.HorizontalBoxStyled = styled_components_1.default.div(templateObject_19 || (templateObject_19 = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n position: relative;\n flex: 1 1 auto;\n width: 100%;\n border-radius: 0.5rem;\n background-color: var(--theme-bg-color);\n box-sizing: border-box;\n\n &:before {\n content: \"\";\n position: absolute;\n inset: 0;\n border-radius: inherit;\n border: ", ";\n box-sizing: border-box;\n pointer-events: none;\n z-index: 1;\n }\n\n ", "\n\n ", " {\n cursor: ", ";\n ", "\n }\n\n ", "\n\n input[type=\"radio\"] {\n height: 0;\n width: 0;\n opacity: 0;\n z-index: -1;\n position: absolute;\n\n ", "\n\n ", "\n\n ", "\n }\n"], ["\n display: flex;\n flex-direction: column;\n position: relative;\n flex: 1 1 auto;\n width: 100%;\n border-radius: 0.5rem;\n background-color: var(--theme-bg-color);\n box-sizing: border-box;\n\n &:before {\n content: \"\";\n position: absolute;\n inset: 0;\n border-radius: inherit;\n border: ", ";\n box-sizing: border-box;\n pointer-events: none;\n z-index: 1;\n }\n\n ", "\n\n ", " {\n cursor: ", ";\n ", "\n }\n\n ", "\n\n input[type=\"radio\"] {\n height: 0;\n width: 0;\n opacity: 0;\n z-index: -1;\n position: absolute;\n\n ", "\n\n ", "\n\n ", "\n }\n"])), function (props) {
|
|
61
61
|
if (props.$disabled)
|
|
62
62
|
return '1px solid var(--grey-10)';
|
|
63
63
|
if (props.$hasError)
|
|
@@ -68,6 +68,14 @@ describe('RadioButton Horizontal', function () {
|
|
|
68
68
|
var container = renderHorizontal({ isCheckable: false, checked: true }).container;
|
|
69
69
|
expect(container.querySelector('label')).toHaveStyle({ cursor: 'default' });
|
|
70
70
|
});
|
|
71
|
+
it('fills parent height so grid cells stay equal', function () {
|
|
72
|
+
var container = renderHorizontal().container;
|
|
73
|
+
var root = container.firstChild;
|
|
74
|
+
var box = root.firstChild;
|
|
75
|
+
expect(root).toHaveStyle({ display: 'flex' });
|
|
76
|
+
expect(box).toHaveStyle({ flexGrow: '1' });
|
|
77
|
+
expect(container.querySelector('label')).toHaveStyle({ flexGrow: '1' });
|
|
78
|
+
});
|
|
71
79
|
it('does not trigger onChange when isCheckable is false', function () {
|
|
72
80
|
var onChange = jest.fn();
|
|
73
81
|
var container = renderHorizontal({
|
|
@@ -16,7 +16,7 @@ exports.InfoArea = styled_components_1.default.div(templateObject_3 || (template
|
|
|
16
16
|
exports.InfoIconWrapper = styled_components_1.default.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n flex-shrink: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n width: 24px;\n height: 24px;\n color: var(--dark-opacity-50);\n"], ["\n flex-shrink: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n width: 24px;\n height: 24px;\n color: var(--dark-opacity-50);\n"])));
|
|
17
17
|
exports.InfoText = styled_components_1.default.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n margin: 0;\n flex: 1;\n font: var(--caption-medium-12-15);\n color: var(--dark-opacity-50);\n"], ["\n margin: 0;\n flex: 1;\n font: var(--caption-medium-12-15);\n color: var(--dark-opacity-50);\n"])));
|
|
18
18
|
exports.RadioButtonsWrapper = styled_components_1.default.div(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n gap: ", ";\n width: 100%;\n\n ", "\n"], ["\n gap: ", ";\n width: 100%;\n\n ", "\n"])), function (props) { return props.$gap || "0.5rem"; }, function (props) { return props.$gridColumnLength
|
|
19
|
-
? "\n display: grid;\n grid-template-columns: repeat(".concat(props.$gridColumnLength, ", minmax(0, 1fr));\n ").concat(props.$isHorizontalOnMobile
|
|
19
|
+
? "\n display: grid;\n align-items: stretch;\n grid-template-columns: repeat(".concat(props.$gridColumnLength, ", minmax(0, 1fr));\n > * {\n min-width: 0;\n align-self: stretch;\n }\n ").concat(props.$isHorizontalOnMobile
|
|
20
20
|
? "\n @media only screen and ".concat(devices_1.devices.md, " {\n grid-template-columns: 1fr;\n }\n ")
|
|
21
21
|
: "", "\n ")
|
|
22
22
|
: "\n display: flex;\n ".concat(props.$isHorizontalOnMobile && props.$layout === "horizontal"
|
|
@@ -50,4 +50,18 @@ describe('RadioGroup', function () {
|
|
|
50
50
|
] })).container;
|
|
51
51
|
expect(container.querySelector('label')).toHaveStyle({ cursor: 'default' });
|
|
52
52
|
});
|
|
53
|
+
it('stretches horizontal options to fill grid cell height', function () {
|
|
54
|
+
(0, react_1.render)((0, jsx_runtime_1.jsx)(RadioGroup_1.default, { name: "grid-group", radioLayout: "horizontal", gridColumnLength: 3, options: [
|
|
55
|
+
__assign(__assign({}, baseOptions[0]), { description: 'Kısa' }),
|
|
56
|
+
{
|
|
57
|
+
id: 'option-b',
|
|
58
|
+
label: 'Seçenek B',
|
|
59
|
+
value: 'b',
|
|
60
|
+
description: 'Daha uzun açıklama, daralınca birden fazla satıra geçer',
|
|
61
|
+
},
|
|
62
|
+
] }));
|
|
63
|
+
react_1.screen.getAllByRole('radio').forEach(function (radio) {
|
|
64
|
+
expect(radio.closest('label')).toHaveStyle({ flexGrow: '1' });
|
|
65
|
+
});
|
|
66
|
+
});
|
|
53
67
|
});
|
|
@@ -283,6 +283,60 @@ export declare const GridStackedOnMobile: {
|
|
|
283
283
|
};
|
|
284
284
|
render: (args: any) => React.JSX.Element;
|
|
285
285
|
};
|
|
286
|
+
export declare const SubscriptionRuleType: {
|
|
287
|
+
name: string;
|
|
288
|
+
args: {
|
|
289
|
+
name: string;
|
|
290
|
+
label: string;
|
|
291
|
+
hasInfo: boolean;
|
|
292
|
+
infoText: string;
|
|
293
|
+
infoIcon: string;
|
|
294
|
+
options: {
|
|
295
|
+
label: string;
|
|
296
|
+
value: string;
|
|
297
|
+
description: string;
|
|
298
|
+
}[];
|
|
299
|
+
value: string;
|
|
300
|
+
onChange: (value: any) => void;
|
|
301
|
+
gap: string;
|
|
302
|
+
gridColumnLength: number;
|
|
303
|
+
isFilled: boolean;
|
|
304
|
+
labelOffset: string;
|
|
305
|
+
layout: string;
|
|
306
|
+
radioLayout: string;
|
|
307
|
+
size: string;
|
|
308
|
+
textSize: string;
|
|
309
|
+
};
|
|
310
|
+
render: (args: any) => React.JSX.Element;
|
|
311
|
+
};
|
|
312
|
+
export declare const SubscriptionRuleTypeWithError: {
|
|
313
|
+
name: string;
|
|
314
|
+
args: {
|
|
315
|
+
name: string;
|
|
316
|
+
hasError: boolean;
|
|
317
|
+
value: string;
|
|
318
|
+
options: {
|
|
319
|
+
hasError: boolean;
|
|
320
|
+
label: string;
|
|
321
|
+
value: string;
|
|
322
|
+
description: string;
|
|
323
|
+
}[];
|
|
324
|
+
label: string;
|
|
325
|
+
hasInfo: boolean;
|
|
326
|
+
infoText: string;
|
|
327
|
+
infoIcon: string;
|
|
328
|
+
onChange: (value: any) => void;
|
|
329
|
+
gap: string;
|
|
330
|
+
gridColumnLength: number;
|
|
331
|
+
isFilled: boolean;
|
|
332
|
+
labelOffset: string;
|
|
333
|
+
layout: string;
|
|
334
|
+
radioLayout: string;
|
|
335
|
+
size: string;
|
|
336
|
+
textSize: string;
|
|
337
|
+
};
|
|
338
|
+
render: (args: any) => React.JSX.Element;
|
|
339
|
+
};
|
|
286
340
|
export declare const ColorPicker: {
|
|
287
341
|
args: {
|
|
288
342
|
name: string;
|
|
@@ -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.AllRadioLayouts = exports.VariantPricing = exports.HorizontalInstallmentWithError = exports.HorizontalInstallmentNotCheckable = exports.HorizontalInstallmentWithTitleImage = exports.HorizontalInstallment = exports.BoxedWithIconLayout = exports.WithDescriptions = exports.WithDisabledOptions = exports.ColorPicker = exports.GridStackedOnMobile = exports.GridTwoColumns = exports.WithInfoArea = exports.BoxedMdWithoutIndicator = exports.BoxedMdFilled = exports.BoxedMdLayout = exports.BoxedSmFilled = exports.BoxedSmLayout = exports.BoxedLayout = exports.Horizontal = exports.VerticalHorizontalOnMobile = exports.WithoutIndicator = exports.Default = void 0;
|
|
17
|
+
exports.AllRadioLayouts = exports.VariantPricing = exports.HorizontalInstallmentWithError = exports.HorizontalInstallmentNotCheckable = exports.HorizontalInstallmentWithTitleImage = exports.HorizontalInstallment = exports.BoxedWithIconLayout = exports.WithDescriptions = exports.WithDisabledOptions = exports.ColorPicker = exports.SubscriptionRuleTypeWithError = exports.SubscriptionRuleType = exports.GridStackedOnMobile = exports.GridTwoColumns = exports.WithInfoArea = exports.BoxedMdWithoutIndicator = exports.BoxedMdFilled = exports.BoxedMdLayout = exports.BoxedSmFilled = exports.BoxedSmLayout = exports.BoxedLayout = exports.Horizontal = exports.VerticalHorizontalOnMobile = exports.WithoutIndicator = exports.Default = void 0;
|
|
18
18
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
19
19
|
var react_1 = __importDefault(require("react"));
|
|
20
20
|
var RadioGroup_1 = __importDefault(require("../RadioGroup"));
|
|
@@ -302,6 +302,49 @@ exports.GridStackedOnMobile = {
|
|
|
302
302
|
] }),
|
|
303
303
|
render: exports.GridTwoColumns.render,
|
|
304
304
|
};
|
|
305
|
+
exports.SubscriptionRuleType = {
|
|
306
|
+
name: "Grid 3 sütun (abonelik tipi, filled + açıklama)",
|
|
307
|
+
args: {
|
|
308
|
+
name: "subscriptionRuleType",
|
|
309
|
+
label: "Abonelik tipi",
|
|
310
|
+
hasInfo: true,
|
|
311
|
+
infoText: "Bu kuralda hangi model(ler) sunulacak? Esnek + Taahhütlü seçersen müşteri checkout'ta ikisi arasında seçim yapar — her ikisinin kuralları (sıklık, duraklatma/atlama modülleri ve taahhüt süreleri) birlikte aşağıda yapılandırılır.",
|
|
312
|
+
infoIcon: "InfoSquare",
|
|
313
|
+
options: [
|
|
314
|
+
{
|
|
315
|
+
label: "Esnek",
|
|
316
|
+
value: "flexible",
|
|
317
|
+
description: "Taahhütsüz, gönderim sıklığı seçilebilir, müşteri istediği zaman iptal eder.",
|
|
318
|
+
},
|
|
319
|
+
{
|
|
320
|
+
label: "Taahhütlü",
|
|
321
|
+
value: "committed",
|
|
322
|
+
description: "Sadece taahhütlü, süre seçimi (6 ay, 12 ay) ve cayma bedeli bulunur.",
|
|
323
|
+
},
|
|
324
|
+
{
|
|
325
|
+
label: "Esnek+Taahhütlü",
|
|
326
|
+
value: "hybrid",
|
|
327
|
+
description: "İkisi birlikte sunulur, müşteri esnek veya taahhütlü seçimi yapar.",
|
|
328
|
+
},
|
|
329
|
+
],
|
|
330
|
+
value: "flexible",
|
|
331
|
+
onChange: function (value) { return console.log("Selected value:", value); },
|
|
332
|
+
gap: "1rem",
|
|
333
|
+
gridColumnLength: 3,
|
|
334
|
+
isFilled: true,
|
|
335
|
+
labelOffset: "1rem",
|
|
336
|
+
layout: "horizontal",
|
|
337
|
+
radioLayout: "horizontal",
|
|
338
|
+
size: "small",
|
|
339
|
+
textSize: "medium",
|
|
340
|
+
},
|
|
341
|
+
render: function (args) { return ((0, jsx_runtime_1.jsx)("div", __assign({ style: { maxWidth: "960px" } }, { children: (0, jsx_runtime_1.jsx)(RadioGroup_1.default, __assign({}, args)) }))); },
|
|
342
|
+
};
|
|
343
|
+
exports.SubscriptionRuleTypeWithError = {
|
|
344
|
+
name: "Grid 3 sütun (abonelik tipi) — error",
|
|
345
|
+
args: __assign(__assign({}, exports.SubscriptionRuleType.args), { name: "subscriptionRuleTypeError", hasError: true, value: "", options: exports.SubscriptionRuleType.args.options.map(function (option) { return (__assign(__assign({}, option), { hasError: true })); }) }),
|
|
346
|
+
render: exports.SubscriptionRuleType.render,
|
|
347
|
+
};
|
|
305
348
|
exports.ColorPicker = {
|
|
306
349
|
args: {
|
|
307
350
|
name: "colorRadioGroup",
|