krl-alfred 1.80.21 → 1.81.0
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/RadioScale/RadioScale.js +28 -0
- package/dist/components/RadioScale/RadioScale.styled.js +15 -0
- package/dist/components/RadioScale/index.js +8 -0
- package/dist/components/RadioScale/props.js +13 -0
- package/dist/components/RadioScale/stories/RadioScale.stories.js +38 -0
- package/dist/index.js +3 -1
- package/package.json +1 -1
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
18
|
+
var props_1 = require("./props");
|
|
19
|
+
var RadioScale_styled_1 = require("./RadioScale.styled");
|
|
20
|
+
var RadioButton_1 = __importDefault(require("../RadioButton"));
|
|
21
|
+
var RadioScale = function (_a) {
|
|
22
|
+
var _b = _a.disabled, disabled = _b === void 0 ? props_1.RadioScaleDefault.disabled : _b, _c = _a.value, value = _c === void 0 ? props_1.RadioScaleDefault.value : _c, _d = _a.valid, valid = _d === void 0 ? props_1.RadioScaleDefault.valid : _d, _e = _a.onChange, onChange = _e === void 0 ? props_1.RadioScaleDefault.onChange : _e, _f = _a.name, name = _f === void 0 ? props_1.RadioScaleDefault.name : _f, _g = _a.id, id = _g === void 0 ? props_1.RadioScaleDefault.id : _g, _h = _a.label, label = _h === void 0 ? props_1.RadioScaleDefault.label : _h, _j = _a.readOnly, readOnly = _j === void 0 ? props_1.RadioScaleDefault.readOnly : _j, _k = _a.length, length = _k === void 0 ? props_1.RadioScaleDefault.length : _k, _l = _a.alignment, alignment = _l === void 0 ? props_1.RadioScaleDefault.alignment : _l;
|
|
23
|
+
return ((0, jsx_runtime_1.jsxs)(RadioScale_styled_1.RadioScaleStyled, { children: [label && ((0, jsx_runtime_1.jsx)(RadioScale_styled_1.LabelWrapper, { children: (0, jsx_runtime_1.jsx)("label", __assign({ htmlFor: id }, { children: label })) })), (0, jsx_runtime_1.jsx)(RadioScale_styled_1.ScaleList, { children: Array.from({ length: length }).map(function (scaleValue, index) {
|
|
24
|
+
scaleValue = index + 1;
|
|
25
|
+
return ((0, jsx_runtime_1.jsx)(RadioButton_1.default, { id: "".concat(id, "_").concat(index), onChange: onChange, disabled: disabled, name: name, value: scaleValue, checked: parseInt(value) === scaleValue || value === scaleValue, label: String(scaleValue), valid: valid, alignment: alignment, readOnly: readOnly, labelOffset: alignment === "vertical" ? '0' : '0.5rem', size: "small", textSize: "medium" }));
|
|
26
|
+
}) })] }));
|
|
27
|
+
};
|
|
28
|
+
exports.default = RadioScale;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
3
|
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
4
|
+
return cooked;
|
|
5
|
+
};
|
|
6
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
7
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
8
|
+
};
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.ScaleList = exports.LabelWrapper = exports.RadioScaleStyled = void 0;
|
|
11
|
+
var styled_components_1 = __importDefault(require("styled-components"));
|
|
12
|
+
exports.RadioScaleStyled = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject([" "], [" "])));
|
|
13
|
+
exports.LabelWrapper = styled_components_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: flex;\n margin-bottom: 16px;\n font:var(--caption-bold-12-15);\n label {\n margin: 0;\n color: var(--dark-opacity-50);\n display: block;\n }\n"], ["\n display: flex;\n margin-bottom: 16px;\n font:var(--caption-bold-12-15);\n label {\n margin: 0;\n color: var(--dark-opacity-50);\n display: block;\n }\n"])));
|
|
14
|
+
exports.ScaleList = styled_components_1.default.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n justify-content: space-between;\n"], ["\n display: flex;\n align-items: center;\n justify-content: space-between;\n"])));
|
|
15
|
+
var templateObject_1, templateObject_2, templateObject_3;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var RadioScale_1 = require("./RadioScale");
|
|
8
|
+
Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(RadioScale_1).default; } });
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RadioScaleDefault = exports.alignment = void 0;
|
|
4
|
+
exports.alignment = ["vertical", "horizontal"];
|
|
5
|
+
exports.RadioScaleDefault = {
|
|
6
|
+
disabled: false,
|
|
7
|
+
valid: true,
|
|
8
|
+
readOnly: false,
|
|
9
|
+
id: "radio",
|
|
10
|
+
length: 10,
|
|
11
|
+
alignment: "horizontal",
|
|
12
|
+
label: "Label",
|
|
13
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
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.Default = void 0;
|
|
18
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
19
|
+
var RadioScale_1 = __importDefault(require("../RadioScale"));
|
|
20
|
+
var props_1 = require("../props");
|
|
21
|
+
exports.default = {
|
|
22
|
+
title: 'Components/RadioScale',
|
|
23
|
+
component: function (props) { return (0, jsx_runtime_1.jsx)("div", __assign({ style: { maxWidth: '350px' } }, { children: (0, jsx_runtime_1.jsx)(RadioScale_1.default, __assign({}, props)) })); },
|
|
24
|
+
tags: ['autodocs'],
|
|
25
|
+
argTypes: {
|
|
26
|
+
alignment: { control: 'select', options: props_1.alignment },
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
exports.Default = {
|
|
30
|
+
args: {
|
|
31
|
+
alignment: "vertical",
|
|
32
|
+
length: 5,
|
|
33
|
+
value: 3,
|
|
34
|
+
label: "Label",
|
|
35
|
+
disabled: false,
|
|
36
|
+
readOnly: false,
|
|
37
|
+
},
|
|
38
|
+
};
|
package/dist/index.js
CHANGED
|
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.ProductCardCheckbox = exports.PaymentCart = exports.Tabs = exports.ProductCardHorizontalSm = exports.ProductCardHorizontal = exports.ProductCardVertical = exports.BannerCard = exports.AutocompleteInput = exports.InstallmentBox = exports.AddressCard = exports.ReviewCard = exports.useTranslation = exports.trLocale = exports.enLocale = exports.initi18n = exports.initReactI18next = exports.CampaignCard = exports.Dropdown = exports.InlineProgress = exports.Loader = exports.ShoppingCartProduct = exports.CouponCode = exports.InfoBox = exports.ListGroup = exports.InsuranceBox = exports.Tooltip = exports.TextLink = exports.SelectBox = exports.Badges = exports.SuggestBox = exports.Toaster = exports.toast = exports.Accordion = exports.Divider = exports.SearchBox = exports.Textarea = exports.ActionButton = exports.RadioButton = exports.Icon = exports.Agreement = exports.Alert = exports.Stepper = exports.OtpInput = exports.Modal = exports.Input = exports.CircleProgress = exports.Checkbox = exports.CategoryMenu = exports.Breadcrumbs = exports.Button = void 0;
|
|
7
|
-
exports.SkeletonLoader = exports.Pagination = exports.DescriptionCard = exports.Table = exports.DropdownButton = exports.OptionMenu = void 0;
|
|
7
|
+
exports.RadioScale = exports.SkeletonLoader = exports.Pagination = exports.DescriptionCard = exports.Table = exports.DropdownButton = exports.OptionMenu = void 0;
|
|
8
8
|
var react_i18next_1 = require("react-i18next");
|
|
9
9
|
Object.defineProperty(exports, "initReactI18next", { enumerable: true, get: function () { return react_i18next_1.initReactI18next; } });
|
|
10
10
|
Object.defineProperty(exports, "useTranslation", { enumerable: true, get: function () { return react_i18next_1.useTranslation; } });
|
|
@@ -115,3 +115,5 @@ var Pagination_1 = __importDefault(require("./components/Pagination"));
|
|
|
115
115
|
exports.Pagination = Pagination_1.default;
|
|
116
116
|
var SkeletonLoader_1 = __importDefault(require("./components/SkeletonLoader"));
|
|
117
117
|
exports.SkeletonLoader = SkeletonLoader_1.default;
|
|
118
|
+
var RadioScale_1 = __importDefault(require("./components/RadioScale"));
|
|
119
|
+
exports.RadioScale = RadioScale_1.default;
|