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
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
declare const _default: {
|
|
3
|
+
title: string;
|
|
4
|
+
component: ({ label, id, orientation, quantity, onIncrement, onDecrement, onRemove, hasRemove, hasLoading, hasError, errorText, hasDisableActions, hasDisableIncrement, }: import("../props").QuantitySelector) => React.JSX.Element;
|
|
5
|
+
tags: string[];
|
|
6
|
+
argTypes: {
|
|
7
|
+
orientation: {
|
|
8
|
+
control: string;
|
|
9
|
+
options: readonly ["horizontal", "vertical"];
|
|
10
|
+
};
|
|
11
|
+
hasRemove: {
|
|
12
|
+
control: string;
|
|
13
|
+
};
|
|
14
|
+
hasLoading: {
|
|
15
|
+
control: string;
|
|
16
|
+
};
|
|
17
|
+
hasError: {
|
|
18
|
+
control: string;
|
|
19
|
+
};
|
|
20
|
+
hasDisableActions: {
|
|
21
|
+
control: string;
|
|
22
|
+
};
|
|
23
|
+
hasDisableIncrement: {
|
|
24
|
+
control: string;
|
|
25
|
+
};
|
|
26
|
+
onIncrement: {
|
|
27
|
+
action: string;
|
|
28
|
+
};
|
|
29
|
+
onDecrement: {
|
|
30
|
+
action: string;
|
|
31
|
+
};
|
|
32
|
+
onRemove: {
|
|
33
|
+
action: string;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
export default _default;
|
|
38
|
+
export declare const Horizontal: {
|
|
39
|
+
args: {
|
|
40
|
+
orientation: string;
|
|
41
|
+
quantity: number;
|
|
42
|
+
label: string;
|
|
43
|
+
id: string;
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
export declare const Vertical: {
|
|
47
|
+
args: {
|
|
48
|
+
orientation: string;
|
|
49
|
+
label: any;
|
|
50
|
+
quantity: number;
|
|
51
|
+
id: string;
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
export declare const WithRemove: {
|
|
55
|
+
args: {
|
|
56
|
+
orientation: string;
|
|
57
|
+
hasRemove: boolean;
|
|
58
|
+
quantity: number;
|
|
59
|
+
label: string;
|
|
60
|
+
id: string;
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
export declare const DisabledActions: {
|
|
64
|
+
args: {
|
|
65
|
+
orientation: string;
|
|
66
|
+
hasDisableActions: boolean;
|
|
67
|
+
quantity: number;
|
|
68
|
+
label: string;
|
|
69
|
+
id: string;
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
export declare const WithError: {
|
|
73
|
+
args: {
|
|
74
|
+
orientation: string;
|
|
75
|
+
hasError: boolean;
|
|
76
|
+
errorText: string;
|
|
77
|
+
quantity: number;
|
|
78
|
+
label: string;
|
|
79
|
+
id: string;
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
export declare const Loading: {
|
|
83
|
+
args: {
|
|
84
|
+
orientation: string;
|
|
85
|
+
hasLoading: boolean;
|
|
86
|
+
quantity: number;
|
|
87
|
+
label: string;
|
|
88
|
+
id: string;
|
|
89
|
+
};
|
|
90
|
+
};
|
|
@@ -0,0 +1,58 @@
|
|
|
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
|
+
exports.Loading = exports.WithError = exports.DisabledActions = exports.WithRemove = exports.Vertical = exports.Horizontal = void 0;
|
|
18
|
+
var QuantitySelector_1 = __importDefault(require("../QuantitySelector"));
|
|
19
|
+
var props_1 = require("../props");
|
|
20
|
+
exports.default = {
|
|
21
|
+
title: 'Components/QuantitySelector',
|
|
22
|
+
component: QuantitySelector_1.default,
|
|
23
|
+
tags: ['autodocs'],
|
|
24
|
+
argTypes: {
|
|
25
|
+
orientation: { control: 'select', options: props_1.orientations },
|
|
26
|
+
hasRemove: { control: 'boolean' },
|
|
27
|
+
hasLoading: { control: 'boolean' },
|
|
28
|
+
hasError: { control: 'boolean' },
|
|
29
|
+
hasDisableActions: { control: 'boolean' },
|
|
30
|
+
hasDisableIncrement: { control: 'boolean' },
|
|
31
|
+
onIncrement: { action: 'incremented' },
|
|
32
|
+
onDecrement: { action: 'decremented' },
|
|
33
|
+
onRemove: { action: 'removed' },
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
var defaultArgs = {
|
|
37
|
+
quantity: 10,
|
|
38
|
+
label: 'Miktar seç',
|
|
39
|
+
id: 'quantity-selector',
|
|
40
|
+
};
|
|
41
|
+
exports.Horizontal = {
|
|
42
|
+
args: __assign(__assign({}, defaultArgs), { orientation: 'horizontal' }),
|
|
43
|
+
};
|
|
44
|
+
exports.Vertical = {
|
|
45
|
+
args: __assign(__assign({}, defaultArgs), { orientation: 'vertical', label: null }),
|
|
46
|
+
};
|
|
47
|
+
exports.WithRemove = {
|
|
48
|
+
args: __assign(__assign({}, defaultArgs), { orientation: 'horizontal', hasRemove: true }),
|
|
49
|
+
};
|
|
50
|
+
exports.DisabledActions = {
|
|
51
|
+
args: __assign(__assign({}, defaultArgs), { orientation: 'horizontal', hasDisableActions: true, quantity: 1 }),
|
|
52
|
+
};
|
|
53
|
+
exports.WithError = {
|
|
54
|
+
args: __assign(__assign({}, defaultArgs), { orientation: 'vertical', hasError: true, errorText: 'Stokta yok' }),
|
|
55
|
+
};
|
|
56
|
+
exports.Loading = {
|
|
57
|
+
args: __assign(__assign({}, defaultArgs), { orientation: 'horizontal', hasLoading: true }),
|
|
58
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { RadioButtonProps } from "./../../props";
|
|
3
|
-
declare const Basic: ({ value, checked, onChange, onClick, name, id, label, disabled, size, description, valid, labelOffset, hasNoneClick,
|
|
3
|
+
declare const Basic: ({ value, checked, onChange, onClick, name, id, label, disabled, size, description, valid, labelOffset, hasNoneClick, alignment, textSize, verticalAlign, isWrapText, readOnly, showIndicator, }: RadioButtonProps) => React.JSX.Element;
|
|
4
4
|
export default Basic;
|
|
@@ -12,15 +12,11 @@ var __assign = (this && this.__assign) || function () {
|
|
|
12
12
|
};
|
|
13
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
14
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
15
|
-
var react_1 = require("react");
|
|
16
15
|
var props_1 = require("./../../props");
|
|
16
|
+
var getRootCssVariable_1 = require("../../../../utils/getRootCssVariable");
|
|
17
17
|
var Basic_styled_1 = require("./Basic.styled");
|
|
18
18
|
var Basic = function (_a) {
|
|
19
|
-
var value = _a.value, checked = _a.checked, onChange = _a.onChange, onClick = _a.onClick, name = _a.name, _b = _a.id, id = _b === void 0 ? props_1.BasicDefault.id : _b, label = _a.label, disabled = _a.disabled, _c = _a.size, size = _c === void 0 ? props_1.BasicDefault.size : _c, description = _a.description, _d = _a.valid, valid = _d === void 0 ? props_1.BasicDefault.valid : _d, _e = _a.labelOffset, labelOffset = _e === void 0 ? props_1.BasicDefault.labelOffset : _e, _f = _a.hasNoneClick, hasNoneClick = _f === void 0 ? props_1.BasicDefault.hasNoneClick : _f, _g = _a.
|
|
20
|
-
var _m = (0, react_1.useState)(color), inputColor = _m[0], setInputColor = _m[1];
|
|
21
|
-
(0, react_1.useEffect)(function () {
|
|
22
|
-
setInputColor(window.getComputedStyle(document.body).getPropertyValue('--primary'));
|
|
23
|
-
});
|
|
19
|
+
var value = _a.value, checked = _a.checked, onChange = _a.onChange, onClick = _a.onClick, name = _a.name, _b = _a.id, id = _b === void 0 ? props_1.BasicDefault.id : _b, label = _a.label, disabled = _a.disabled, _c = _a.size, size = _c === void 0 ? props_1.BasicDefault.size : _c, description = _a.description, _d = _a.valid, valid = _d === void 0 ? props_1.BasicDefault.valid : _d, _e = _a.labelOffset, labelOffset = _e === void 0 ? props_1.BasicDefault.labelOffset : _e, _f = _a.hasNoneClick, hasNoneClick = _f === void 0 ? props_1.BasicDefault.hasNoneClick : _f, _g = _a.alignment, alignment = _g === void 0 ? props_1.BasicDefault.alignment : _g, _h = _a.textSize, textSize = _h === void 0 ? props_1.BasicDefault.textSize : _h, _j = _a.verticalAlign, verticalAlign = _j === void 0 ? props_1.BasicDefault.verticalAlign : _j, isWrapText = _a.isWrapText, readOnly = _a.readOnly, _k = _a.showIndicator, showIndicator = _k === void 0 ? true : _k;
|
|
24
20
|
var styledProps = {
|
|
25
21
|
$disabled: disabled,
|
|
26
22
|
$checked: checked,
|
|
@@ -30,7 +26,7 @@ var Basic = function (_a) {
|
|
|
30
26
|
$hasNoneClick: hasNoneClick,
|
|
31
27
|
$isWrapText: isWrapText,
|
|
32
28
|
$readOnly: readOnly,
|
|
33
|
-
$color:
|
|
29
|
+
$color: (0, getRootCssVariable_1.getRadioPrimaryColor)(),
|
|
34
30
|
$alignment: alignment,
|
|
35
31
|
$textSize: textSize,
|
|
36
32
|
$verticalAlign: verticalAlign,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { RadioButtonProps } from "./../../props";
|
|
3
|
-
declare const Boxed: ({ value, checked, onChange, onClick, name, label, disabled, description, image, hasBadge, badgeText, badgeVariant, labelSm, readOnly, id, size, valid, labelOffset, textSize,
|
|
3
|
+
declare const Boxed: ({ value, checked, onChange, onClick, name, label, disabled, description, image, hasBadge, badgeText, badgeVariant, labelSm, readOnly, id, size, valid, labelOffset, textSize, showIndicator, }: RadioButtonProps) => React.JSX.Element;
|
|
4
4
|
export default Boxed;
|
|
@@ -15,16 +15,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
18
|
-
var react_1 = require("react");
|
|
19
18
|
var props_1 = require("./../../props");
|
|
19
|
+
var getRootCssVariable_1 = require("../../../../utils/getRootCssVariable");
|
|
20
20
|
var Boxed_styled_1 = require("./Boxed.styled");
|
|
21
21
|
var Badges_1 = __importDefault(require("../../../Badges"));
|
|
22
22
|
var Boxed = function (_a) {
|
|
23
|
-
var value = _a.value, checked = _a.checked, onChange = _a.onChange, onClick = _a.onClick, name = _a.name, label = _a.label, disabled = _a.disabled, description = _a.description, image = _a.image, hasBadge = _a.hasBadge, badgeText = _a.badgeText, badgeVariant = _a.badgeVariant, labelSm = _a.labelSm, readOnly = _a.readOnly, _b = _a.id, id = _b === void 0 ? props_1.BoxedDefault.id : _b, _c = _a.size, size = _c === void 0 ? props_1.BoxedDefault.size : _c, _d = _a.valid, valid = _d === void 0 ? props_1.BoxedDefault.valid : _d, _e = _a.labelOffset, labelOffset = _e === void 0 ? props_1.BoxedDefault.labelOffset : _e, _f = _a.textSize, textSize = _f === void 0 ? props_1.BoxedDefault.textSize : _f, _g = _a.
|
|
24
|
-
var _j = (0, react_1.useState)(color), inputColor = _j[0], setInputColor = _j[1];
|
|
25
|
-
(0, react_1.useEffect)(function () {
|
|
26
|
-
setInputColor(window.getComputedStyle(document.body).getPropertyValue('--primary'));
|
|
27
|
-
});
|
|
23
|
+
var value = _a.value, checked = _a.checked, onChange = _a.onChange, onClick = _a.onClick, name = _a.name, label = _a.label, disabled = _a.disabled, description = _a.description, image = _a.image, hasBadge = _a.hasBadge, badgeText = _a.badgeText, badgeVariant = _a.badgeVariant, labelSm = _a.labelSm, readOnly = _a.readOnly, _b = _a.id, id = _b === void 0 ? props_1.BoxedDefault.id : _b, _c = _a.size, size = _c === void 0 ? props_1.BoxedDefault.size : _c, _d = _a.valid, valid = _d === void 0 ? props_1.BoxedDefault.valid : _d, _e = _a.labelOffset, labelOffset = _e === void 0 ? props_1.BoxedDefault.labelOffset : _e, _f = _a.textSize, textSize = _f === void 0 ? props_1.BoxedDefault.textSize : _f, _g = _a.showIndicator, showIndicator = _g === void 0 ? true : _g;
|
|
28
24
|
var styledProps = {
|
|
29
25
|
$disabled: disabled,
|
|
30
26
|
$checked: checked,
|
|
@@ -32,7 +28,7 @@ var Boxed = function (_a) {
|
|
|
32
28
|
$valid: valid,
|
|
33
29
|
$labelOffset: labelOffset,
|
|
34
30
|
$readOnly: readOnly,
|
|
35
|
-
$color:
|
|
31
|
+
$color: (0, getRootCssVariable_1.getRadioPrimaryColor)(),
|
|
36
32
|
$textSize: textSize,
|
|
37
33
|
};
|
|
38
34
|
return ((0, jsx_runtime_1.jsxs)(Boxed_styled_1.BoxedStyled, __assign({ htmlFor: id }, styledProps, { children: [(0, jsx_runtime_1.jsx)("input", { id: id, type: "radio", name: name, value: value, disabled: disabled, checked: checked, onChange: onChange, onClick: onClick, readOnly: readOnly }), showIndicator && (0, jsx_runtime_1.jsx)(Boxed_styled_1.Indicator, __assign({}, styledProps)), (label || description || image) && ((0, jsx_runtime_1.jsxs)(Boxed_styled_1.LabelsWrapper, __assign({}, styledProps, { children: [label && ((0, jsx_runtime_1.jsxs)(Boxed_styled_1.LabelText, __assign({ htmlFor: id }, { children: [label, labelSm && (0, jsx_runtime_1.jsx)(Boxed_styled_1.LabelSm, { children: labelSm })] }))), description && ((0, jsx_runtime_1.jsx)(Boxed_styled_1.DescriptionText, __assign({ htmlFor: id }, { children: description }))), image && ((0, jsx_runtime_1.jsx)(Boxed_styled_1.ImageLabel, __assign({ htmlFor: id }, { children: image })))] }))), hasBadge && ((0, jsx_runtime_1.jsx)(Boxed_styled_1.BoxedBadgesWrapper, { children: (0, jsx_runtime_1.jsx)(Badges_1.default, { title: badgeText, layout: "belt", variant: badgeVariant, hasResponsive: true }) }))] })));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { RadioButtonProps } from "./../../props";
|
|
3
|
-
declare const BoxedMd: ({ value, checked, onChange, onClick, name, label, disabled, description, image, readOnly, id, size, valid, labelOffset, textSize,
|
|
3
|
+
declare const BoxedMd: ({ value, checked, onChange, onClick, name, label, disabled, description, image, readOnly, id, size, valid, labelOffset, textSize, showIndicator, }: RadioButtonProps) => import("react").JSX.Element;
|
|
4
4
|
export default BoxedMd;
|
|
@@ -12,15 +12,11 @@ var __assign = (this && this.__assign) || function () {
|
|
|
12
12
|
};
|
|
13
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
14
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
15
|
-
var react_1 = require("react");
|
|
16
15
|
var props_1 = require("./../../props");
|
|
16
|
+
var getRootCssVariable_1 = require("../../../../utils/getRootCssVariable");
|
|
17
17
|
var BoxedMd_styled_1 = require("./BoxedMd.styled");
|
|
18
18
|
var BoxedMd = function (_a) {
|
|
19
|
-
var value = _a.value, checked = _a.checked, onChange = _a.onChange, onClick = _a.onClick, name = _a.name, label = _a.label, disabled = _a.disabled, description = _a.description, image = _a.image, readOnly = _a.readOnly, _b = _a.id, id = _b === void 0 ? props_1.BoxedDefault.id : _b, _c = _a.size, size = _c === void 0 ? props_1.BoxedDefault.size : _c, _d = _a.valid, valid = _d === void 0 ? props_1.BoxedDefault.valid : _d, _e = _a.labelOffset, labelOffset = _e === void 0 ? props_1.BoxedDefault.labelOffset : _e, _f = _a.textSize, textSize = _f === void 0 ? props_1.BoxedDefault.textSize : _f, _g = _a.
|
|
20
|
-
var _j = (0, react_1.useState)(color), inputColor = _j[0], setInputColor = _j[1];
|
|
21
|
-
(0, react_1.useEffect)(function () {
|
|
22
|
-
setInputColor(window.getComputedStyle(document.body).getPropertyValue('--primary'));
|
|
23
|
-
});
|
|
19
|
+
var value = _a.value, checked = _a.checked, onChange = _a.onChange, onClick = _a.onClick, name = _a.name, label = _a.label, disabled = _a.disabled, description = _a.description, image = _a.image, readOnly = _a.readOnly, _b = _a.id, id = _b === void 0 ? props_1.BoxedDefault.id : _b, _c = _a.size, size = _c === void 0 ? props_1.BoxedDefault.size : _c, _d = _a.valid, valid = _d === void 0 ? props_1.BoxedDefault.valid : _d, _e = _a.labelOffset, labelOffset = _e === void 0 ? props_1.BoxedDefault.labelOffset : _e, _f = _a.textSize, textSize = _f === void 0 ? props_1.BoxedDefault.textSize : _f, _g = _a.showIndicator, showIndicator = _g === void 0 ? true : _g;
|
|
24
20
|
var styledProps = {
|
|
25
21
|
$disabled: disabled,
|
|
26
22
|
$checked: checked,
|
|
@@ -28,7 +24,7 @@ var BoxedMd = function (_a) {
|
|
|
28
24
|
$valid: valid,
|
|
29
25
|
$labelOffset: labelOffset,
|
|
30
26
|
$readOnly: readOnly,
|
|
31
|
-
$color:
|
|
27
|
+
$color: (0, getRootCssVariable_1.getRadioPrimaryColor)(),
|
|
32
28
|
$textSize: textSize,
|
|
33
29
|
$showIndicator: showIndicator,
|
|
34
30
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { RadioButtonProps } from "./../../props";
|
|
3
|
-
declare const BoxedSm: ({ value, checked, onChange, onClick, name, label, disabled, description, image, readOnly, id, size, valid, labelOffset, textSize,
|
|
3
|
+
declare const BoxedSm: ({ value, checked, onChange, onClick, name, label, disabled, description, image, readOnly, id, size, valid, labelOffset, textSize, showIndicator, }: RadioButtonProps) => import("react").JSX.Element;
|
|
4
4
|
export default BoxedSm;
|
|
@@ -12,15 +12,11 @@ var __assign = (this && this.__assign) || function () {
|
|
|
12
12
|
};
|
|
13
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
14
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
15
|
-
var react_1 = require("react");
|
|
16
15
|
var props_1 = require("./../../props");
|
|
16
|
+
var getRootCssVariable_1 = require("../../../../utils/getRootCssVariable");
|
|
17
17
|
var BoxedSm_styled_1 = require("./BoxedSm.styled");
|
|
18
18
|
var BoxedSm = function (_a) {
|
|
19
|
-
var value = _a.value, checked = _a.checked, onChange = _a.onChange, onClick = _a.onClick, name = _a.name, label = _a.label, disabled = _a.disabled, description = _a.description, image = _a.image, readOnly = _a.readOnly, _b = _a.id, id = _b === void 0 ? props_1.BoxedDefault.id : _b, _c = _a.size, size = _c === void 0 ? props_1.BoxedDefault.size : _c, _d = _a.valid, valid = _d === void 0 ? props_1.BoxedDefault.valid : _d, _e = _a.labelOffset, labelOffset = _e === void 0 ? props_1.BoxedDefault.labelOffset : _e, _f = _a.textSize, textSize = _f === void 0 ? props_1.BoxedDefault.textSize : _f, _g = _a.
|
|
20
|
-
var _j = (0, react_1.useState)(color), inputColor = _j[0], setInputColor = _j[1];
|
|
21
|
-
(0, react_1.useEffect)(function () {
|
|
22
|
-
setInputColor(window.getComputedStyle(document.body).getPropertyValue('--primary'));
|
|
23
|
-
});
|
|
19
|
+
var value = _a.value, checked = _a.checked, onChange = _a.onChange, onClick = _a.onClick, name = _a.name, label = _a.label, disabled = _a.disabled, description = _a.description, image = _a.image, readOnly = _a.readOnly, _b = _a.id, id = _b === void 0 ? props_1.BoxedDefault.id : _b, _c = _a.size, size = _c === void 0 ? props_1.BoxedDefault.size : _c, _d = _a.valid, valid = _d === void 0 ? props_1.BoxedDefault.valid : _d, _e = _a.labelOffset, labelOffset = _e === void 0 ? props_1.BoxedDefault.labelOffset : _e, _f = _a.textSize, textSize = _f === void 0 ? props_1.BoxedDefault.textSize : _f, _g = _a.showIndicator, showIndicator = _g === void 0 ? true : _g;
|
|
24
20
|
var styledProps = {
|
|
25
21
|
$disabled: disabled,
|
|
26
22
|
$checked: checked,
|
|
@@ -28,7 +24,7 @@ var BoxedSm = function (_a) {
|
|
|
28
24
|
$valid: valid,
|
|
29
25
|
$labelOffset: labelOffset,
|
|
30
26
|
$readOnly: readOnly,
|
|
31
|
-
$color:
|
|
27
|
+
$color: (0, getRootCssVariable_1.getRadioPrimaryColor)(),
|
|
32
28
|
$textSize: textSize,
|
|
33
29
|
$showIndicator: showIndicator,
|
|
34
30
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { RadioButtonProps } from "../../props";
|
|
3
|
-
declare const BoxedWithIcon: ({ value, checked, onChange, onClick, name, label, disabled, readOnly, id, size, valid, labelOffset,
|
|
3
|
+
declare const BoxedWithIcon: ({ value, checked, onChange, onClick, name, label, disabled, readOnly, id, size, valid, labelOffset, textSize, iconName, iconColor, content }: RadioButtonProps) => React.JSX.Element;
|
|
4
4
|
export default BoxedWithIcon;
|
|
@@ -15,19 +15,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
18
|
-
var react_1 = require("react");
|
|
19
18
|
var props_1 = require("../../props");
|
|
19
|
+
var getRootCssVariable_1 = require("../../../../utils/getRootCssVariable");
|
|
20
20
|
var Icon_1 = __importDefault(require("../../../Icon/Icon"));
|
|
21
21
|
var BoxedWithIcon_styled_1 = require("./BoxedWithIcon.styled");
|
|
22
22
|
var BoxedWithIcon = function (_a) {
|
|
23
|
-
var value = _a.value, checked = _a.checked, onChange = _a.onChange, onClick = _a.onClick, name = _a.name, label = _a.label, disabled = _a.disabled, readOnly = _a.readOnly, _b = _a.id, id = _b === void 0 ? props_1.BoxedWithIconDefault.id : _b, _c = _a.size, size = _c === void 0 ? props_1.BoxedWithIconDefault.size : _c, _d = _a.valid, valid = _d === void 0 ? props_1.BoxedWithIconDefault.valid : _d, _e = _a.labelOffset, labelOffset = _e === void 0 ? props_1.BoxedWithIconDefault.labelOffset : _e, _f = _a.
|
|
24
|
-
|
|
25
|
-
(0, react_1.useEffect)(function () {
|
|
26
|
-
var primaryColor = typeof window !== "undefined"
|
|
27
|
-
? window.getComputedStyle(document.body).getPropertyValue("--primary").trim() || "#9763F6"
|
|
28
|
-
: "#9763F6";
|
|
29
|
-
setInputColor(color || primaryColor);
|
|
30
|
-
}, [color]);
|
|
31
|
-
return ((0, jsx_runtime_1.jsxs)(BoxedWithIcon_styled_1.BoxedWithIconStyled, __assign({ htmlFor: id, "$disabled": disabled, "$checked": checked, "$size": size, "$valid": valid, "$readOnly": readOnly, "$color": inputColor }, { children: [(0, jsx_runtime_1.jsx)("input", { id: id, type: "radio", name: name, value: value, disabled: disabled, checked: checked, onChange: onChange, onClick: onClick, readOnly: readOnly }), (0, jsx_runtime_1.jsxs)(BoxedWithIcon_styled_1.ContentWrapper, { children: [(0, jsx_runtime_1.jsxs)(BoxedWithIcon_styled_1.Header, { children: [iconName && ((0, jsx_runtime_1.jsx)(BoxedWithIcon_styled_1.IconWrapper, { children: (0, jsx_runtime_1.jsx)(Icon_1.default, { name: iconName, color: iconColor, hasWrapper: false, width: "32", height: "32" }) })), label && (0, jsx_runtime_1.jsx)(BoxedWithIcon_styled_1.Label, { children: label }), (0, jsx_runtime_1.jsx)(BoxedWithIcon_styled_1.Indicator, { "$disabled": disabled, "$valid": valid })] }), content && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(BoxedWithIcon_styled_1.Separator, {}), (0, jsx_runtime_1.jsx)(BoxedWithIcon_styled_1.Content, { children: content })] }))] })] })));
|
|
23
|
+
var value = _a.value, checked = _a.checked, onChange = _a.onChange, onClick = _a.onClick, name = _a.name, label = _a.label, disabled = _a.disabled, readOnly = _a.readOnly, _b = _a.id, id = _b === void 0 ? props_1.BoxedWithIconDefault.id : _b, _c = _a.size, size = _c === void 0 ? props_1.BoxedWithIconDefault.size : _c, _d = _a.valid, valid = _d === void 0 ? props_1.BoxedWithIconDefault.valid : _d, _e = _a.labelOffset, labelOffset = _e === void 0 ? props_1.BoxedWithIconDefault.labelOffset : _e, _f = _a.textSize, textSize = _f === void 0 ? "medium" : _f, iconName = _a.iconName, iconColor = _a.iconColor, content = _a.content;
|
|
24
|
+
return ((0, jsx_runtime_1.jsxs)(BoxedWithIcon_styled_1.BoxedWithIconStyled, __assign({ htmlFor: id, "$disabled": disabled, "$checked": checked, "$size": size, "$valid": valid, "$readOnly": readOnly, "$color": (0, getRootCssVariable_1.getRadioPrimaryColor)() }, { children: [(0, jsx_runtime_1.jsx)("input", { id: id, type: "radio", name: name, value: value, disabled: disabled, checked: checked, onChange: onChange, onClick: onClick, readOnly: readOnly }), (0, jsx_runtime_1.jsxs)(BoxedWithIcon_styled_1.ContentWrapper, { children: [(0, jsx_runtime_1.jsxs)(BoxedWithIcon_styled_1.Header, { children: [iconName && ((0, jsx_runtime_1.jsx)(BoxedWithIcon_styled_1.IconWrapper, { children: (0, jsx_runtime_1.jsx)(Icon_1.default, { name: iconName, color: iconColor, hasWrapper: false, width: "32", height: "32" }) })), label && (0, jsx_runtime_1.jsx)(BoxedWithIcon_styled_1.Label, { children: label }), (0, jsx_runtime_1.jsx)(BoxedWithIcon_styled_1.Indicator, { "$disabled": disabled, "$valid": valid })] }), content && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(BoxedWithIcon_styled_1.Separator, {}), (0, jsx_runtime_1.jsx)(BoxedWithIcon_styled_1.Content, { children: content })] }))] })] })));
|
|
32
25
|
};
|
|
33
26
|
exports.default = BoxedWithIcon;
|
|
@@ -15,16 +15,17 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
18
|
+
var getRootCssVariable_1 = require("../../../../utils/getRootCssVariable");
|
|
18
19
|
var Badges_1 = __importDefault(require("../../../Badges"));
|
|
19
20
|
var Horizontal_styled_1 = require("./Horizontal.styled");
|
|
20
21
|
var Horizontal = function (props) {
|
|
21
|
-
var label = props.label, description = props.description, id = props.id, checked = props.checked, onChange = props.onChange, onClick = props.onClick, name = props.name, value = props.value, price = props.price, priceDesc = props.priceDesc, hasTitleBadge = props.hasTitleBadge, titleBadgeLayout = props.titleBadgeLayout, titleBadgeText = props.titleBadgeText, _a = props.titleBadgePosition, titleBadgePosition = _a === void 0 ? "inline" : _a, hasPriceBadge = props.hasPriceBadge, priceBadgeLayout = props.priceBadgeLayout, priceBadgeText = props.priceBadgeText, _b = props.labelOffset, labelOffset = _b === void 0 ? "1rem" : _b, disabled = props.disabled, _c = props.valid, valid = _c === void 0 ? true : _c,
|
|
22
|
+
var label = props.label, description = props.description, id = props.id, checked = props.checked, onChange = props.onChange, onClick = props.onClick, name = props.name, value = props.value, price = props.price, priceDesc = props.priceDesc, hasTitleBadge = props.hasTitleBadge, titleBadgeLayout = props.titleBadgeLayout, titleBadgeText = props.titleBadgeText, _a = props.titleBadgePosition, titleBadgePosition = _a === void 0 ? "inline" : _a, hasPriceBadge = props.hasPriceBadge, priceBadgeLayout = props.priceBadgeLayout, priceBadgeText = props.priceBadgeText, _b = props.labelOffset, labelOffset = _b === void 0 ? "1rem" : _b, disabled = props.disabled, _c = props.valid, valid = _c === void 0 ? true : _c, _d = props.showIndicator, showIndicator = _d === void 0 ? true : _d;
|
|
22
23
|
var titleBadgeBelow = titleBadgePosition === "below";
|
|
23
24
|
var styledProps = {
|
|
24
25
|
checked: checked,
|
|
25
26
|
$disabled: disabled,
|
|
26
27
|
$valid: valid,
|
|
27
|
-
$color:
|
|
28
|
+
$color: (0, getRootCssVariable_1.getRadioPrimaryColor)(),
|
|
28
29
|
$labelOffset: labelOffset,
|
|
29
30
|
$titleBadgeBelow: titleBadgeBelow,
|
|
30
31
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { RadioGroupProps } from "./props";
|
|
3
|
-
declare const RadioGroup: ({ options, value, onChange, name, label, disabled, size, textSize, layout, radioLayout, valid, labelOffset, color, verticalAlign, readOnly, gap, isFilled, showIndicator, hasInfo, infoText, infoIcon, gridColumnLength }: RadioGroupProps) => React.JSX.Element;
|
|
3
|
+
declare const RadioGroup: ({ options, value, onChange, name, label, disabled, size, textSize, layout, radioLayout, valid, labelOffset, color, verticalAlign, readOnly, gap, isFilled, showIndicator, hasInfo, infoText, infoIcon, gridColumnLength, isHorizontalOnMobile, }: RadioGroupProps) => React.JSX.Element;
|
|
4
4
|
export default RadioGroup;
|
|
@@ -21,13 +21,13 @@ var RadioGroup_styled_1 = require("./RadioGroup.styled");
|
|
|
21
21
|
var RadioButton_1 = __importDefault(require("../RadioButton"));
|
|
22
22
|
var Icon_1 = __importDefault(require("../Icon/Icon"));
|
|
23
23
|
var RadioGroup = function (_a) {
|
|
24
|
-
var _b = _a.options, options = _b === void 0 ? props_1.RadioGroupDefault.options : _b, _c = _a.value, value = _c === void 0 ? props_1.RadioGroupDefault.value : _c, _d = _a.onChange, onChange = _d === void 0 ? props_1.RadioGroupDefault.onChange : _d, _e = _a.name, name = _e === void 0 ? props_1.RadioGroupDefault.name : _e, _f = _a.label, label = _f === void 0 ? props_1.RadioGroupDefault.label : _f, _g = _a.disabled, disabled = _g === void 0 ? props_1.RadioGroupDefault.disabled : _g, _h = _a.size, size = _h === void 0 ? props_1.RadioGroupDefault.size : _h, _j = _a.textSize, textSize = _j === void 0 ? props_1.RadioGroupDefault.textSize : _j, _k = _a.layout, layout = _k === void 0 ? props_1.RadioGroupDefault.layout : _k, _l = _a.radioLayout, radioLayout = _l === void 0 ? props_1.RadioGroupDefault.radioLayout : _l, _m = _a.valid, valid = _m === void 0 ? props_1.RadioGroupDefault.valid : _m, _o = _a.labelOffset, labelOffset = _o === void 0 ? props_1.RadioGroupDefault.labelOffset : _o, _p = _a.color, color = _p === void 0 ? props_1.RadioGroupDefault.color : _p, _q = _a.verticalAlign, verticalAlign = _q === void 0 ? props_1.RadioGroupDefault.verticalAlign : _q, _r = _a.readOnly, readOnly = _r === void 0 ? props_1.RadioGroupDefault.readOnly : _r, _s = _a.gap, gap = _s === void 0 ? props_1.RadioGroupDefault.gap : _s, _t = _a.isFilled, isFilled = _t === void 0 ? props_1.RadioGroupDefault.isFilled : _t, _u = _a.showIndicator, showIndicator = _u === void 0 ? props_1.RadioGroupDefault.showIndicator : _u, _v = _a.hasInfo, hasInfo = _v === void 0 ? props_1.RadioGroupDefault.hasInfo : _v, _w = _a.infoText, infoText = _w === void 0 ? props_1.RadioGroupDefault.infoText : _w, _x = _a.infoIcon, infoIcon = _x === void 0 ? props_1.RadioGroupDefault.infoIcon : _x, _y = _a.gridColumnLength, gridColumnLength = _y === void 0 ? props_1.RadioGroupDefault.gridColumnLength : _y;
|
|
24
|
+
var _b = _a.options, options = _b === void 0 ? props_1.RadioGroupDefault.options : _b, _c = _a.value, value = _c === void 0 ? props_1.RadioGroupDefault.value : _c, _d = _a.onChange, onChange = _d === void 0 ? props_1.RadioGroupDefault.onChange : _d, _e = _a.name, name = _e === void 0 ? props_1.RadioGroupDefault.name : _e, _f = _a.label, label = _f === void 0 ? props_1.RadioGroupDefault.label : _f, _g = _a.disabled, disabled = _g === void 0 ? props_1.RadioGroupDefault.disabled : _g, _h = _a.size, size = _h === void 0 ? props_1.RadioGroupDefault.size : _h, _j = _a.textSize, textSize = _j === void 0 ? props_1.RadioGroupDefault.textSize : _j, _k = _a.layout, layout = _k === void 0 ? props_1.RadioGroupDefault.layout : _k, _l = _a.radioLayout, radioLayout = _l === void 0 ? props_1.RadioGroupDefault.radioLayout : _l, _m = _a.valid, valid = _m === void 0 ? props_1.RadioGroupDefault.valid : _m, _o = _a.labelOffset, labelOffset = _o === void 0 ? props_1.RadioGroupDefault.labelOffset : _o, _p = _a.color, color = _p === void 0 ? props_1.RadioGroupDefault.color : _p, _q = _a.verticalAlign, verticalAlign = _q === void 0 ? props_1.RadioGroupDefault.verticalAlign : _q, _r = _a.readOnly, readOnly = _r === void 0 ? props_1.RadioGroupDefault.readOnly : _r, _s = _a.gap, gap = _s === void 0 ? props_1.RadioGroupDefault.gap : _s, _t = _a.isFilled, isFilled = _t === void 0 ? props_1.RadioGroupDefault.isFilled : _t, _u = _a.showIndicator, showIndicator = _u === void 0 ? props_1.RadioGroupDefault.showIndicator : _u, _v = _a.hasInfo, hasInfo = _v === void 0 ? props_1.RadioGroupDefault.hasInfo : _v, _w = _a.infoText, infoText = _w === void 0 ? props_1.RadioGroupDefault.infoText : _w, _x = _a.infoIcon, infoIcon = _x === void 0 ? props_1.RadioGroupDefault.infoIcon : _x, _y = _a.gridColumnLength, gridColumnLength = _y === void 0 ? props_1.RadioGroupDefault.gridColumnLength : _y, _z = _a.isHorizontalOnMobile, isHorizontalOnMobile = _z === void 0 ? props_1.RadioGroupDefault.isHorizontalOnMobile : _z;
|
|
25
25
|
var handleRadioChange = function (optionValue) {
|
|
26
26
|
if (!onChange)
|
|
27
27
|
return;
|
|
28
28
|
onChange(optionValue);
|
|
29
29
|
};
|
|
30
|
-
return ((0, jsx_runtime_1.jsxs)(RadioGroup_styled_1.RadioGroupStyled, { children: [label && ((0, jsx_runtime_1.jsx)(RadioGroup_styled_1.GroupLabelWrapper, __assign({ "$emphasizedLabel": hasInfo }, { children: (0, jsx_runtime_1.jsx)(RadioGroup_styled_1.GroupLabel, __assign({ "$emphasizedLabel": hasInfo }, { children: label })) }))), hasInfo && infoText && ((0, jsx_runtime_1.jsxs)(RadioGroup_styled_1.InfoArea, { children: [(0, jsx_runtime_1.jsx)(RadioGroup_styled_1.InfoIconWrapper, { children: (0, jsx_runtime_1.jsx)(Icon_1.default, { name: (infoIcon || props_1.RadioGroupDefault.infoIcon), width: "24", height: "24", hasWrapper: false }) }), (0, jsx_runtime_1.jsx)(RadioGroup_styled_1.InfoText, { children: infoText })] })), (0, jsx_runtime_1.jsx)(RadioGroup_styled_1.RadioButtonsWrapper, __assign({ "$layout": layout, "$gap": gap, "$isFilled": isFilled, "$gridColumnLength": gridColumnLength }, { children: options.map(function (option, index) {
|
|
30
|
+
return ((0, jsx_runtime_1.jsxs)(RadioGroup_styled_1.RadioGroupStyled, { children: [label && ((0, jsx_runtime_1.jsx)(RadioGroup_styled_1.GroupLabelWrapper, __assign({ "$emphasizedLabel": hasInfo }, { children: (0, jsx_runtime_1.jsx)(RadioGroup_styled_1.GroupLabel, __assign({ "$emphasizedLabel": hasInfo }, { children: label })) }))), hasInfo && infoText && ((0, jsx_runtime_1.jsxs)(RadioGroup_styled_1.InfoArea, { children: [(0, jsx_runtime_1.jsx)(RadioGroup_styled_1.InfoIconWrapper, { children: (0, jsx_runtime_1.jsx)(Icon_1.default, { name: (infoIcon || props_1.RadioGroupDefault.infoIcon), width: "24", height: "24", hasWrapper: false }) }), (0, jsx_runtime_1.jsx)(RadioGroup_styled_1.InfoText, { children: infoText })] })), (0, jsx_runtime_1.jsx)(RadioGroup_styled_1.RadioButtonsWrapper, __assign({ "$layout": layout, "$gap": gap, "$isFilled": isFilled, "$gridColumnLength": gridColumnLength, "$isHorizontalOnMobile": isHorizontalOnMobile }, { children: options.map(function (option, index) {
|
|
31
31
|
var radioId = option.id || "".concat(name, "_").concat(index);
|
|
32
32
|
var isChecked = value === option.value;
|
|
33
33
|
return ((0, jsx_runtime_1.jsx)(RadioButton_1.default, { id: radioId, name: name, value: option.value, checked: isChecked, onChange: function (e) { return handleRadioChange(option.value); }, label: option.label, description: option.description, image: option.image, disabled: disabled || option.disabled, alignment: option.alignment, isWrapText: option.isWrapText, size: size, textSize: textSize, layout: radioLayout, valid: valid, labelOffset: labelOffset, color: option.color || color, verticalAlign: verticalAlign, readOnly: readOnly, showIndicator: showIndicator, titleBadgePosition: option.titleBadgePosition, hasTitleBadge: option.hasTitleBadge, titleBadgeLayout: option.titleBadgeLayout, titleBadgeText: option.titleBadgeText }, radioId));
|
|
@@ -9,14 +9,19 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
10
|
exports.RadioGroupStyled = exports.RadioButtonsWrapper = exports.InfoText = exports.InfoIconWrapper = exports.InfoArea = exports.GroupLabel = exports.GroupLabelWrapper = void 0;
|
|
11
11
|
var styled_components_1 = __importDefault(require("styled-components"));
|
|
12
|
+
var devices_1 = require("../../constants/devices");
|
|
12
13
|
exports.GroupLabelWrapper = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n margin-bottom: ", ";\n"], ["\n display: flex;\n margin-bottom: ", ";\n"])), function (props) { return props.$emphasizedLabel ? "0.5rem" : "1rem"; });
|
|
13
14
|
exports.GroupLabel = styled_components_1.default.label(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n margin: 0;\n display: block;\n color: var(--dark-opacity-50);\n font: var(--caption-bold-12-15);\n"], ["\n margin: 0;\n display: block;\n color: var(--dark-opacity-50);\n font: var(--caption-bold-12-15);\n"])));
|
|
14
15
|
exports.InfoArea = styled_components_1.default.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n gap: 0.75rem;\n padding: 0 0;\n margin-bottom: 1rem;\n"], ["\n display: flex;\n align-items: center;\n gap: 0.75rem;\n padding: 0 0;\n margin-bottom: 1rem;\n"])));
|
|
15
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"])));
|
|
16
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"])));
|
|
17
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
|
|
18
|
-
? "\n display: grid;\n grid-template-columns: repeat(".concat(props.$gridColumnLength, ", minmax(0, 1fr));\n
|
|
19
|
-
|
|
19
|
+
? "\n display: grid;\n grid-template-columns: repeat(".concat(props.$gridColumnLength, ", minmax(0, 1fr));\n ").concat(props.$isHorizontalOnMobile
|
|
20
|
+
? "\n @media only screen and ".concat(devices_1.devices.md, " {\n grid-template-columns: 1fr;\n }\n ")
|
|
21
|
+
: "", "\n ")
|
|
22
|
+
: "\n display: flex;\n ".concat(props.$isHorizontalOnMobile && props.$layout === "horizontal"
|
|
23
|
+
? "\n flex-direction: row;\n flex-wrap: wrap;\n @media only screen and ".concat(devices_1.devices.md, " {\n flex-direction: column;\n flex-wrap: nowrap;\n }\n ")
|
|
24
|
+
: "\n flex-direction: ".concat(props.$layout === "horizontal" ? "row" : "column", ";\n flex-wrap: ").concat(props.$layout === "horizontal" ? "wrap" : "nowrap", ";\n "), "\n ").concat(props.$isFilled
|
|
20
25
|
? "\n > * {\n flex: 1 1 0;\n }\n "
|
|
21
26
|
: "", "\n "); });
|
|
22
27
|
exports.RadioGroupStyled = styled_components_1.default.div(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n"], ["\n display: flex;\n flex-direction: column;\n"])));
|
|
@@ -49,6 +49,8 @@ export interface RadioGroup {
|
|
|
49
49
|
infoIcon?: string;
|
|
50
50
|
/** Satır başına sütun sayısı — verildiğinde flex yerine grid kullanılır */
|
|
51
51
|
gridColumnLength?: number;
|
|
52
|
+
/** Mobilde layout uyarlaması: flex vertical → row; grid → tek sütun (alt alta) */
|
|
53
|
+
isHorizontalOnMobile?: boolean;
|
|
52
54
|
}
|
|
53
55
|
export declare const RadioGroupDefault: RadioGroup;
|
|
54
56
|
export interface RadioGroupStyledProps {
|
|
@@ -57,6 +59,7 @@ export interface RadioGroupStyledProps {
|
|
|
57
59
|
$isFilled?: boolean;
|
|
58
60
|
$emphasizedLabel?: boolean;
|
|
59
61
|
$gridColumnLength?: number;
|
|
62
|
+
$isHorizontalOnMobile?: boolean;
|
|
60
63
|
}
|
|
61
64
|
export type RadioGroupProps = typeof RadioGroupDefault;
|
|
62
65
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
declare const _default: {
|
|
3
3
|
title: string;
|
|
4
|
-
component: ({ options, value, onChange, name, label, disabled, size, textSize, layout, radioLayout, valid, labelOffset, color, verticalAlign, readOnly, gap, isFilled, showIndicator, hasInfo, infoText, infoIcon, gridColumnLength }: import("../props").RadioGroup) => React.JSX.Element;
|
|
4
|
+
component: ({ options, value, onChange, name, label, disabled, size, textSize, layout, radioLayout, valid, labelOffset, color, verticalAlign, readOnly, gap, isFilled, showIndicator, hasInfo, infoText, infoIcon, gridColumnLength, isHorizontalOnMobile, }: import("../props").RadioGroup) => React.JSX.Element;
|
|
5
5
|
tags: string[];
|
|
6
6
|
argTypes: {
|
|
7
7
|
layout: {
|
|
@@ -49,6 +49,9 @@ declare const _default: {
|
|
|
49
49
|
min: number;
|
|
50
50
|
max: number;
|
|
51
51
|
};
|
|
52
|
+
isHorizontalOnMobile: {
|
|
53
|
+
control: string;
|
|
54
|
+
};
|
|
52
55
|
};
|
|
53
56
|
};
|
|
54
57
|
export default _default;
|
|
@@ -86,6 +89,24 @@ export declare const WithoutIndicator: {
|
|
|
86
89
|
textSize: string;
|
|
87
90
|
};
|
|
88
91
|
};
|
|
92
|
+
export declare const VerticalHorizontalOnMobile: {
|
|
93
|
+
args: {
|
|
94
|
+
layout: string;
|
|
95
|
+
isHorizontalOnMobile: boolean;
|
|
96
|
+
options: {
|
|
97
|
+
label: string;
|
|
98
|
+
value: string;
|
|
99
|
+
}[];
|
|
100
|
+
name: string;
|
|
101
|
+
label: string;
|
|
102
|
+
value: string;
|
|
103
|
+
onChange: (value: any) => void;
|
|
104
|
+
radioLayout: string;
|
|
105
|
+
size: string;
|
|
106
|
+
textSize: string;
|
|
107
|
+
showIndicator: boolean;
|
|
108
|
+
};
|
|
109
|
+
};
|
|
89
110
|
export declare const Horizontal: {
|
|
90
111
|
args: {
|
|
91
112
|
name: string;
|
|
@@ -240,6 +261,25 @@ export declare const GridTwoColumns: {
|
|
|
240
261
|
};
|
|
241
262
|
render: (args: any) => React.JSX.Element;
|
|
242
263
|
};
|
|
264
|
+
export declare const GridStackedOnMobile: {
|
|
265
|
+
args: {
|
|
266
|
+
isHorizontalOnMobile: boolean;
|
|
267
|
+
options: {
|
|
268
|
+
label: string;
|
|
269
|
+
value: string;
|
|
270
|
+
}[];
|
|
271
|
+
name: string;
|
|
272
|
+
label: string;
|
|
273
|
+
value: string;
|
|
274
|
+
onChange: (value: any) => void;
|
|
275
|
+
radioLayout: string;
|
|
276
|
+
size: string;
|
|
277
|
+
gridColumnLength: number;
|
|
278
|
+
gap: string;
|
|
279
|
+
showIndicator: boolean;
|
|
280
|
+
};
|
|
281
|
+
render: (args: any) => React.JSX.Element;
|
|
282
|
+
};
|
|
243
283
|
export declare const ColorPicker: {
|
|
244
284
|
args: {
|
|
245
285
|
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.WithDescriptions = exports.WithDisabledOptions = exports.ColorPicker = exports.GridTwoColumns = exports.WithInfoArea = exports.BoxedMdWithoutIndicator = exports.BoxedMdFilled = exports.BoxedMdLayout = exports.BoxedSmFilled = exports.BoxedSmLayout = exports.BoxedLayout = exports.Horizontal = exports.WithoutIndicator = exports.Default = void 0;
|
|
17
|
+
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;
|
|
18
18
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
19
19
|
var RadioGroup_1 = __importDefault(require("../RadioGroup"));
|
|
20
20
|
var props_1 = require("../props");
|
|
@@ -36,6 +36,7 @@ exports.default = {
|
|
|
36
36
|
infoText: { control: 'text' },
|
|
37
37
|
infoIcon: { control: 'text' },
|
|
38
38
|
gridColumnLength: { control: 'number', min: 1, max: 6 },
|
|
39
|
+
isHorizontalOnMobile: { control: 'boolean' },
|
|
39
40
|
}
|
|
40
41
|
};
|
|
41
42
|
exports.Default = {
|
|
@@ -59,6 +60,14 @@ exports.Default = {
|
|
|
59
60
|
exports.WithoutIndicator = {
|
|
60
61
|
args: __assign(__assign({}, exports.Default.args), { showIndicator: false }),
|
|
61
62
|
};
|
|
63
|
+
exports.VerticalHorizontalOnMobile = {
|
|
64
|
+
args: __assign(__assign({}, exports.Default.args), { layout: "vertical", isHorizontalOnMobile: true, options: [
|
|
65
|
+
{ label: "Option 1", value: "option1" },
|
|
66
|
+
{ label: "Option 2", value: "option2" },
|
|
67
|
+
{ label: "Option 3", value: "option3" },
|
|
68
|
+
{ label: "Option 4", value: "option4" },
|
|
69
|
+
] }),
|
|
70
|
+
};
|
|
62
71
|
exports.Horizontal = {
|
|
63
72
|
args: {
|
|
64
73
|
name: "horizontalRadioGroup",
|
|
@@ -204,6 +213,15 @@ exports.GridTwoColumns = {
|
|
|
204
213
|
},
|
|
205
214
|
render: function (args) { return ((0, jsx_runtime_1.jsx)("div", __assign({ style: { maxWidth: "720px" } }, { children: (0, jsx_runtime_1.jsx)(RadioGroup_1.default, __assign({}, args)) }))); },
|
|
206
215
|
};
|
|
216
|
+
exports.GridStackedOnMobile = {
|
|
217
|
+
args: __assign(__assign({}, exports.GridTwoColumns.args), { isHorizontalOnMobile: true, options: [
|
|
218
|
+
{ label: "Esnek", value: "flexible" },
|
|
219
|
+
{ label: "Taahhütlü", value: "committed" },
|
|
220
|
+
{ label: "Seçenek 3", value: "option3" },
|
|
221
|
+
{ label: "Seçenek 4", value: "option4" },
|
|
222
|
+
] }),
|
|
223
|
+
render: exports.GridTwoColumns.render,
|
|
224
|
+
};
|
|
207
225
|
exports.ColorPicker = {
|
|
208
226
|
args: {
|
|
209
227
|
name: "colorRadioGroup",
|