krl-alfred 1.73.2 → 1.73.4
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/ActionButton/ActionButton.js +3 -1
- package/dist/components/Button/Button.js +2 -2
- package/dist/components/Button/props.js +1 -1
- package/dist/components/Button/stories/Button.stories.js +2 -1
- package/dist/i18n/i18n.js +34 -0
- package/dist/i18n/locales/english.json +5 -0
- package/dist/i18n/locales/turkish.json +5 -0
- package/dist/index.js +9 -1
- package/package.json +6 -2
|
@@ -20,7 +20,9 @@ var ActionButton_styled_1 = require("./ActionButton.styled");
|
|
|
20
20
|
var Icon_1 = __importDefault(require("../Icon/Icon"));
|
|
21
21
|
var Button_1 = __importDefault(require("../Button"));
|
|
22
22
|
var date_fns_1 = require("date-fns");
|
|
23
|
+
var react_i18next_1 = require("react-i18next");
|
|
23
24
|
var ActionButton = function (props) {
|
|
25
|
+
var t = (0, react_i18next_1.useTranslation)().t;
|
|
24
26
|
var _a = (0, react_1.useState)(0), days = _a[0], setDays = _a[1];
|
|
25
27
|
var _b = (0, react_1.useState)(0), minutes = _b[0], setMinutes = _b[1];
|
|
26
28
|
var _c = (0, react_1.useState)(0), hours = _c[0], setHours = _c[1];
|
|
@@ -43,7 +45,7 @@ var ActionButton = function (props) {
|
|
|
43
45
|
(0, react_1.useEffect)(function () {
|
|
44
46
|
count();
|
|
45
47
|
}, [props.date]);
|
|
46
|
-
return (0, jsx_runtime_1.jsxs)(ActionButton_styled_1.ActionButtonStyled, __assign({}, props, { children: [(0, jsx_runtime_1.jsxs)("div", { className: "top", children: [(0, jsx_runtime_1.jsx)("div", { className: "icon", children: (0, jsx_runtime_1.jsx)(Icon_1.default, { name: props.icon, width: "45px", height: "45px" }) }), (0, jsx_runtime_1.jsx)("strong", { className: "title body-bold-14-17", children: props.title })] }), (0, jsx_runtime_1.jsxs)("div", { className: "bottom", children: [(0, jsx_runtime_1.jsx)("div", {}), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsxs)("div", { className: "timer", children: [(0, jsx_runtime_1.jsxs)("div", { className: "box", children: [(0, jsx_runtime_1.jsx)("div", { className: "title-extra-bold-16-19", children: days }), (0, jsx_runtime_1.jsx)("div", { className: "caption-regular-10-12", children:
|
|
48
|
+
return (0, jsx_runtime_1.jsxs)(ActionButton_styled_1.ActionButtonStyled, __assign({}, props, { children: [(0, jsx_runtime_1.jsxs)("div", { className: "top", children: [(0, jsx_runtime_1.jsx)("div", { className: "icon", children: (0, jsx_runtime_1.jsx)(Icon_1.default, { name: props.icon, width: "45px", height: "45px" }) }), (0, jsx_runtime_1.jsx)("strong", { className: "title body-bold-14-17", children: props.title })] }), (0, jsx_runtime_1.jsxs)("div", { className: "bottom", children: [(0, jsx_runtime_1.jsx)("div", {}), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsxs)("div", { className: "timer", children: [(0, jsx_runtime_1.jsxs)("div", { className: "box", children: [(0, jsx_runtime_1.jsx)("div", { className: "title-extra-bold-16-19", children: days }), (0, jsx_runtime_1.jsx)("div", { className: "caption-regular-10-12", children: t('day') })] }), (0, jsx_runtime_1.jsx)("div", { className: "dots caption-bold-12-15", children: ":" }), (0, jsx_runtime_1.jsxs)("div", { className: "box", children: [(0, jsx_runtime_1.jsx)("div", { className: "title-extra-bold-16-19", children: hours.toString().padStart(2, '0') }), (0, jsx_runtime_1.jsx)("div", { className: "caption-regular-10-12", children: t('hour') })] }), (0, jsx_runtime_1.jsx)("div", { className: "dots caption-bold-12-15", children: ":" }), (0, jsx_runtime_1.jsxs)("div", { className: "box", children: [(0, jsx_runtime_1.jsx)("div", { className: "title-extra-bold-16-19", children: minutes.toString().padStart(2, '0') }), (0, jsx_runtime_1.jsx)("div", { className: "caption-regular-10-12", children: t('minute') })] })] }), (0, jsx_runtime_1.jsx)(Button_1.default, { size: "xsmall", width: "32px", icon: "ArrowMediumRight", variant: "primary" })] })] })] }));
|
|
47
49
|
};
|
|
48
50
|
ActionButton.defaultProps = {
|
|
49
51
|
title: "Title",
|
|
@@ -25,8 +25,8 @@ var Children = function (props) {
|
|
|
25
25
|
};
|
|
26
26
|
var Button = function (props) {
|
|
27
27
|
var _a, _b, _c, _d, _e, _f;
|
|
28
|
-
var isLoading = props.isLoading, onClick = props.onClick, disabled = props.disabled, size = props.size, variant = props.variant, width = props.width, icon = props.icon, children = props.children;
|
|
29
|
-
return ((0, jsx_runtime_1.jsx)(Button_styled_1.ButtonStyled, { className: (0, classnames_1.default)((_a = {}, _a["loading"] = isLoading, _a), (_b = {}, _b["caption-bold-12-15"] = size === 'xsmall' && variant !== 'ghost', _b), (_c = {}, _c["body-bold-13-16"] = size === 'xsmall' && variant === 'ghost', _c), (_d = {}, _d["body-bold-13-16"] = size === 'small', _d), (_e = {}, _e["body-bold-14-17"] = size === 'big', _e), (_f = {}, _f["body-bold-14-17"] = size === 'medium', _f)), onClick: onClick, disabled: disabled || isLoading, size: size, variant: variant, width: width, icon: icon, children: isLoading ? (0, jsx_runtime_1.jsx)(Loader_1.default, { width: size === "big" ? "24px" : "16px", height: size === "big" ? "24px" : "16px", variant: variant === 'primary' ? 'secondary' : 'primary' }) :
|
|
28
|
+
var type = props.type, isLoading = props.isLoading, onClick = props.onClick, disabled = props.disabled, size = props.size, variant = props.variant, width = props.width, icon = props.icon, children = props.children;
|
|
29
|
+
return ((0, jsx_runtime_1.jsx)(Button_styled_1.ButtonStyled, { className: (0, classnames_1.default)((_a = {}, _a["loading"] = isLoading, _a), (_b = {}, _b["caption-bold-12-15"] = size === 'xsmall' && variant !== 'ghost', _b), (_c = {}, _c["body-bold-13-16"] = size === 'xsmall' && variant === 'ghost', _c), (_d = {}, _d["body-bold-13-16"] = size === 'small', _d), (_e = {}, _e["body-bold-14-17"] = size === 'big', _e), (_f = {}, _f["body-bold-14-17"] = size === 'medium', _f)), onClick: onClick, disabled: disabled || isLoading, size: size, variant: variant, width: width, icon: icon, type: type, children: isLoading ? (0, jsx_runtime_1.jsx)(Loader_1.default, { width: size === "big" ? "24px" : "16px", height: size === "big" ? "24px" : "16px", variant: variant === 'primary' ? 'secondary' : 'primary' }) :
|
|
30
30
|
(0, jsx_runtime_1.jsx)(Children, { icon: icon, children: children }) }));
|
|
31
31
|
};
|
|
32
32
|
exports.default = Button;
|
|
@@ -5,4 +5,4 @@ var Icon_1 = require("../Icon");
|
|
|
5
5
|
exports.variants = ['primary', 'secondary', 'inverted', 'ghost'];
|
|
6
6
|
exports.sizes = ['big', 'medium', 'small', 'xsmall'];
|
|
7
7
|
exports.iconNames = Object.keys(Icon_1.iconList);
|
|
8
|
-
var ButtonDefault = { size: 'medium', variant: 'primary', isLoading: false, width: "auto" };
|
|
8
|
+
var ButtonDefault = { size: 'medium', variant: 'primary', isLoading: false, width: "auto", type: "button" };
|
|
@@ -0,0 +1,34 @@
|
|
|
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.init = void 0;
|
|
18
|
+
var i18next_1 = __importDefault(require("i18next"));
|
|
19
|
+
var react_i18next_1 = require("react-i18next");
|
|
20
|
+
var english_json_1 = __importDefault(require("./locales/english.json"));
|
|
21
|
+
var turkish_json_1 = __importDefault(require("./locales/turkish.json"));
|
|
22
|
+
var init = function (options) {
|
|
23
|
+
if (options === void 0) { options = {}; }
|
|
24
|
+
return i18next_1.default.use(react_i18next_1.initReactI18next).init(__assign({ fallbackLng: 'en', lng: 'tr', resources: {
|
|
25
|
+
en: {
|
|
26
|
+
translation: __assign({}, english_json_1.default)
|
|
27
|
+
},
|
|
28
|
+
tr: {
|
|
29
|
+
translation: __assign({}, turkish_json_1.default)
|
|
30
|
+
}
|
|
31
|
+
}, debug: false }, options));
|
|
32
|
+
};
|
|
33
|
+
exports.init = init;
|
|
34
|
+
exports.default = i18next_1.default;
|
package/dist/index.js
CHANGED
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.CampaignCard = exports.Dropdown = exports.InlineProgress = exports.Loader = exports.ShoppingCartProduct = exports.CouponCode = exports.InfoBox = exports.ContentBox = exports.ListGroup = exports.InsuranceBox = exports.Tooltip = exports.TextLink = exports.SelectBox = exports.Badges = exports.Carousel = exports.SuggestBox = exports.Toast = exports.Banner = exports.Accordion = exports.Divider = exports.SearchBox = exports.ValueProposition = exports.Textarea = exports.ActionButton = exports.RadioButton = exports.Icon = exports.Agreement = exports.Alert = exports.Stepper = exports.ProductCard = exports.OtpInput = exports.Modal = exports.Input = exports.CircleProgress = exports.Checkbox = exports.CategoryMenu = exports.Breadcrumbs = exports.Button = void 0;
|
|
6
|
+
exports.trLocale = exports.enLocale = exports.initi18n = exports.initReactI18next = exports.CampaignCard = exports.Dropdown = exports.InlineProgress = exports.Loader = exports.ShoppingCartProduct = exports.CouponCode = exports.InfoBox = exports.ContentBox = exports.ListGroup = exports.InsuranceBox = exports.Tooltip = exports.TextLink = exports.SelectBox = exports.Badges = exports.Carousel = exports.SuggestBox = exports.Toast = exports.Banner = exports.Accordion = exports.Divider = exports.SearchBox = exports.ValueProposition = exports.Textarea = exports.ActionButton = exports.RadioButton = exports.Icon = exports.Agreement = exports.Alert = exports.Stepper = exports.ProductCard = exports.OtpInput = exports.Modal = exports.Input = exports.CircleProgress = exports.Checkbox = exports.CategoryMenu = exports.Breadcrumbs = exports.Button = void 0;
|
|
7
7
|
var Button_1 = __importDefault(require("./components/Button"));
|
|
8
8
|
exports.Button = Button_1.default;
|
|
9
9
|
var Breadcrumbs_1 = __importDefault(require("./components/Breadcrumbs"));
|
|
@@ -80,3 +80,11 @@ var Dropdown_1 = __importDefault(require("./components/Dropdown"));
|
|
|
80
80
|
exports.Dropdown = Dropdown_1.default;
|
|
81
81
|
var CampaignCard_1 = __importDefault(require("./components/CampaignCard"));
|
|
82
82
|
exports.CampaignCard = CampaignCard_1.default;
|
|
83
|
+
var react_i18next_1 = require("react-i18next");
|
|
84
|
+
Object.defineProperty(exports, "initReactI18next", { enumerable: true, get: function () { return react_i18next_1.initReactI18next; } });
|
|
85
|
+
var i18n_1 = require("./i18n/i18n");
|
|
86
|
+
Object.defineProperty(exports, "initi18n", { enumerable: true, get: function () { return i18n_1.init; } });
|
|
87
|
+
var english_json_1 = __importDefault(require("./i18n/locales/english.json"));
|
|
88
|
+
exports.enLocale = english_json_1.default;
|
|
89
|
+
var turkish_json_1 = __importDefault(require("./i18n/locales/turkish.json"));
|
|
90
|
+
exports.trLocale = turkish_json_1.default;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "krl-alfred",
|
|
3
|
-
"version": "1.73.
|
|
3
|
+
"version": "1.73.4",
|
|
4
4
|
"files": [
|
|
5
5
|
"dist"
|
|
6
6
|
],
|
|
@@ -24,11 +24,13 @@
|
|
|
24
24
|
"classnames": "^2.3.2",
|
|
25
25
|
"css-loader": "^6.7.3",
|
|
26
26
|
"date-fns": "^2.30.0",
|
|
27
|
+
"i18next": "^23.7.6",
|
|
27
28
|
"plop": "^3.1.2",
|
|
28
29
|
"react": "^18.2.0",
|
|
29
30
|
"react-circular-progressbar": "^2.1.0",
|
|
30
31
|
"react-device-detect": "^2.2.3",
|
|
31
32
|
"react-dom": "^18.2.0",
|
|
33
|
+
"react-i18next": "^13.5.0",
|
|
32
34
|
"react-input-mask": "^2.0.4",
|
|
33
35
|
"react-otp-input": "^3.0.2",
|
|
34
36
|
"react-router-dom": "^6.10.0",
|
|
@@ -37,6 +39,7 @@
|
|
|
37
39
|
"sass": "^1.60.0",
|
|
38
40
|
"sass-loader": "^13.2.2",
|
|
39
41
|
"slick-carousel": "^1.8.1",
|
|
42
|
+
"storybook-i18n": "^2.0.13",
|
|
40
43
|
"style-loader": "^3.3.2",
|
|
41
44
|
"styled-components": "^5.0.1",
|
|
42
45
|
"typescript": "^5.1.6"
|
|
@@ -89,6 +92,7 @@
|
|
|
89
92
|
"@svgr/cli": "^7.0.0",
|
|
90
93
|
"@svgr/webpack": "^7.0.0",
|
|
91
94
|
"semantic-release": "^21.0.1",
|
|
92
|
-
"storybook": "7.2.1"
|
|
95
|
+
"storybook": "7.2.1",
|
|
96
|
+
"storybook-addon-locale": "^0.3.6"
|
|
93
97
|
}
|
|
94
98
|
}
|