@typeolymp/ui-components 1.16.0 → 1.16.2
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/build/components/atoms/Subheading/index.d.ts +1 -0
- package/build/components/molecules/Collapse/index.d.ts +1 -1
- package/build/components/organisms/Form/index.d.ts +1 -1
- package/build/index.es.js +366 -12
- package/build/index.es.js.map +1 -1
- package/build/index.js +361 -7
- package/build/index.js.map +1 -1
- package/package.json +20 -12
|
@@ -54,7 +54,7 @@ declare type RangeFieldType = {
|
|
|
54
54
|
export declare type FormFieldType = InputFieldType | PasswordInputFieldType | DateInputFieldType | TextareaFieldType | RadioGroupFieldType | NumberFieldType | CheckboxesFieldType | SelectFieldType | ToggleFieldType | RangeFieldType;
|
|
55
55
|
export declare type PropsType = {
|
|
56
56
|
title?: string;
|
|
57
|
-
description?: string;
|
|
57
|
+
description?: string | JSX.Element;
|
|
58
58
|
fields: FormFieldType[];
|
|
59
59
|
button?: ButtonPropsType;
|
|
60
60
|
onChangeFields?(newValues: {
|
package/build/index.es.js
CHANGED
|
@@ -2,9 +2,6 @@ import { jsx as jsx$1, jsxs, Fragment as Fragment$1 } from 'react/jsx-runtime';
|
|
|
2
2
|
import * as React$3 from 'react';
|
|
3
3
|
import React__default, { useLayoutEffect, useContext, forwardRef, createElement, createContext, Fragment, useRef, useState, useEffect, useImperativeHandle } from 'react';
|
|
4
4
|
import styled, { keyframes as keyframes$1 } from 'styled-components';
|
|
5
|
-
import { getCountryCodeByLocale, getNativeLanguageByLocale } from '@typeolymp/utils/parsers';
|
|
6
|
-
import { hasCapitalLetter, hasNumber, hasSpecialCharacter } from '@typeolymp/utils/expressions';
|
|
7
|
-
import { Medal as Medal$1 } from '@typeolymp/utils/enums';
|
|
8
5
|
|
|
9
6
|
var theme = {
|
|
10
7
|
colors: {
|
|
@@ -3491,7 +3488,11 @@ var Button = forwardRef(function (_a, ref) {
|
|
|
3491
3488
|
var buttonRef = useRef(null);
|
|
3492
3489
|
var _b = useState(false), isLoading = _b[0], setIsLoading = _b[1];
|
|
3493
3490
|
var as = href || asAnchor ? "a" : "button";
|
|
3494
|
-
var onClick = function () {
|
|
3491
|
+
var onClick = function (e) {
|
|
3492
|
+
if (props.onClickAsync || props.onClick) {
|
|
3493
|
+
e.stopPropagation();
|
|
3494
|
+
e.preventDefault();
|
|
3495
|
+
}
|
|
3495
3496
|
if (props.onClickAsync) {
|
|
3496
3497
|
setIsLoading(true);
|
|
3497
3498
|
new Promise(function (resolve) {
|
|
@@ -3599,6 +3600,266 @@ var Wrapper$a = styled.div(templateObject_1$Q || (templateObject_1$Q = __makeTem
|
|
|
3599
3600
|
});
|
|
3600
3601
|
var templateObject_1$Q;
|
|
3601
3602
|
|
|
3603
|
+
var parsers = {};
|
|
3604
|
+
|
|
3605
|
+
var getCountryByLocale$1 = {};
|
|
3606
|
+
|
|
3607
|
+
var enums = {};
|
|
3608
|
+
|
|
3609
|
+
var Color = {};
|
|
3610
|
+
|
|
3611
|
+
(function (exports) {
|
|
3612
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3613
|
+
exports.Color = void 0;
|
|
3614
|
+
(function (Color) {
|
|
3615
|
+
Color["RED"] = "red";
|
|
3616
|
+
Color["YELLOW"] = "yellow";
|
|
3617
|
+
Color["BLUE"] = "blue";
|
|
3618
|
+
Color["GREEN"] = "green";
|
|
3619
|
+
Color["PURPLE"] = "purple";
|
|
3620
|
+
Color["PINK"] = "pink";
|
|
3621
|
+
Color["ORANGE"] = "orange";
|
|
3622
|
+
Color["DARK_GRAY"] = "darkGray";
|
|
3623
|
+
Color["LIGHT_GRAY"] = "lightGray";
|
|
3624
|
+
})(exports.Color || (exports.Color = {}));
|
|
3625
|
+
|
|
3626
|
+
}(Color));
|
|
3627
|
+
|
|
3628
|
+
var Country = {};
|
|
3629
|
+
|
|
3630
|
+
(function (exports) {
|
|
3631
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3632
|
+
exports.Country = void 0;
|
|
3633
|
+
(function (Country) {
|
|
3634
|
+
Country["NL"] = "Nederland";
|
|
3635
|
+
Country["BE"] = "Belgi\u00EB";
|
|
3636
|
+
})(exports.Country || (exports.Country = {}));
|
|
3637
|
+
|
|
3638
|
+
}(Country));
|
|
3639
|
+
|
|
3640
|
+
var CourseTranslation = {};
|
|
3641
|
+
|
|
3642
|
+
(function (exports) {
|
|
3643
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3644
|
+
exports.CourseTranslation = void 0;
|
|
3645
|
+
(function (CourseTranslation) {
|
|
3646
|
+
CourseTranslation["NL_NL"] = "nl-NL";
|
|
3647
|
+
// EN_GB = "en-GB",
|
|
3648
|
+
})(exports.CourseTranslation || (exports.CourseTranslation = {}));
|
|
3649
|
+
|
|
3650
|
+
}(CourseTranslation));
|
|
3651
|
+
|
|
3652
|
+
var KeyboardLayout = {};
|
|
3653
|
+
|
|
3654
|
+
(function (exports) {
|
|
3655
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3656
|
+
exports.KeyboardLayout = void 0;
|
|
3657
|
+
(function (KeyboardLayout) {
|
|
3658
|
+
KeyboardLayout["QWERTY_NL"] = "qwerty-nl";
|
|
3659
|
+
// QWERTY_UK = "qwerty-uk",
|
|
3660
|
+
// QWERTY_US = "qwerty-us",
|
|
3661
|
+
// QWERTY_TR = "qwerty-tr",
|
|
3662
|
+
KeyboardLayout["AZERTY_BE"] = "azerty-be";
|
|
3663
|
+
// AZERTY_FR = "azerty-fr",
|
|
3664
|
+
// QWERTZ_DE = "qwertz-de",
|
|
3665
|
+
})(exports.KeyboardLayout || (exports.KeyboardLayout = {}));
|
|
3666
|
+
|
|
3667
|
+
}(KeyboardLayout));
|
|
3668
|
+
|
|
3669
|
+
var Locale = {};
|
|
3670
|
+
|
|
3671
|
+
(function (exports) {
|
|
3672
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3673
|
+
exports.Locale = void 0;
|
|
3674
|
+
(function (Locale) {
|
|
3675
|
+
Locale["NL_NL"] = "nl-NL";
|
|
3676
|
+
Locale["NL_BE"] = "nl-BE";
|
|
3677
|
+
// EN_GB = "en-GB",
|
|
3678
|
+
// FR_FR = "fr-FR",
|
|
3679
|
+
// FR_BE = "fr-BE",
|
|
3680
|
+
// DE_DE = "de-DE",
|
|
3681
|
+
})(exports.Locale || (exports.Locale = {}));
|
|
3682
|
+
|
|
3683
|
+
}(Locale));
|
|
3684
|
+
|
|
3685
|
+
var Plan = {};
|
|
3686
|
+
|
|
3687
|
+
(function (exports) {
|
|
3688
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3689
|
+
exports.Plan = void 0;
|
|
3690
|
+
(function (Plan) {
|
|
3691
|
+
Plan["HOBBY"] = "hobby";
|
|
3692
|
+
Plan["PROFESSIONAL"] = "professional";
|
|
3693
|
+
})(exports.Plan || (exports.Plan = {}));
|
|
3694
|
+
|
|
3695
|
+
}(Plan));
|
|
3696
|
+
|
|
3697
|
+
var TextTopic = {};
|
|
3698
|
+
|
|
3699
|
+
(function (exports) {
|
|
3700
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3701
|
+
exports.TextTopic = void 0;
|
|
3702
|
+
(function (TextTopic) {
|
|
3703
|
+
TextTopic["SPORT"] = "sport";
|
|
3704
|
+
TextTopic["MUSIC"] = "music";
|
|
3705
|
+
TextTopic["TECHNIC"] = "technic";
|
|
3706
|
+
TextTopic["MOVIES"] = "movies";
|
|
3707
|
+
TextTopic["NATURE"] = "nature";
|
|
3708
|
+
TextTopic["HISTORY"] = "history";
|
|
3709
|
+
TextTopic["ART"] = "art";
|
|
3710
|
+
TextTopic["FASHION"] = "fashion";
|
|
3711
|
+
TextTopic["OTHER"] = "other";
|
|
3712
|
+
})(exports.TextTopic || (exports.TextTopic = {}));
|
|
3713
|
+
|
|
3714
|
+
}(TextTopic));
|
|
3715
|
+
|
|
3716
|
+
var Medal$1 = {};
|
|
3717
|
+
|
|
3718
|
+
(function (exports) {
|
|
3719
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3720
|
+
exports.Medal = void 0;
|
|
3721
|
+
(function (Medal) {
|
|
3722
|
+
Medal["GOLD"] = "gold";
|
|
3723
|
+
Medal["SILVER"] = "silver";
|
|
3724
|
+
Medal["BRONZE"] = "bronze";
|
|
3725
|
+
})(exports.Medal || (exports.Medal = {}));
|
|
3726
|
+
|
|
3727
|
+
}(Medal$1));
|
|
3728
|
+
|
|
3729
|
+
(function (exports) {
|
|
3730
|
+
var __createBinding = (commonjsGlobal && commonjsGlobal.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3731
|
+
if (k2 === undefined) k2 = k;
|
|
3732
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
3733
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
3734
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
3735
|
+
}
|
|
3736
|
+
Object.defineProperty(o, k2, desc);
|
|
3737
|
+
}) : (function(o, m, k, k2) {
|
|
3738
|
+
if (k2 === undefined) k2 = k;
|
|
3739
|
+
o[k2] = m[k];
|
|
3740
|
+
}));
|
|
3741
|
+
var __exportStar = (commonjsGlobal && commonjsGlobal.__exportStar) || function(m, exports) {
|
|
3742
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
3743
|
+
};
|
|
3744
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3745
|
+
__exportStar(Color, exports);
|
|
3746
|
+
__exportStar(Country, exports);
|
|
3747
|
+
__exportStar(CourseTranslation, exports);
|
|
3748
|
+
__exportStar(KeyboardLayout, exports);
|
|
3749
|
+
__exportStar(Locale, exports);
|
|
3750
|
+
__exportStar(Plan, exports);
|
|
3751
|
+
__exportStar(TextTopic, exports);
|
|
3752
|
+
__exportStar(Medal$1, exports);
|
|
3753
|
+
|
|
3754
|
+
}(enums));
|
|
3755
|
+
|
|
3756
|
+
Object.defineProperty(getCountryByLocale$1, "__esModule", { value: true });
|
|
3757
|
+
getCountryByLocale$1.getCountryByLocale = void 0;
|
|
3758
|
+
var enums_1$2 = enums;
|
|
3759
|
+
var getCountryByLocale = function (locale) {
|
|
3760
|
+
var countries = {
|
|
3761
|
+
"nl-NL": enums_1$2.Country.NL,
|
|
3762
|
+
"nl-BE": enums_1$2.Country.BE,
|
|
3763
|
+
};
|
|
3764
|
+
return countries[locale];
|
|
3765
|
+
};
|
|
3766
|
+
getCountryByLocale$1.getCountryByLocale = getCountryByLocale;
|
|
3767
|
+
|
|
3768
|
+
var getCourseTranslationByLocale$1 = {};
|
|
3769
|
+
|
|
3770
|
+
Object.defineProperty(getCourseTranslationByLocale$1, "__esModule", { value: true });
|
|
3771
|
+
getCourseTranslationByLocale$1.getCourseTranslationByLocale = void 0;
|
|
3772
|
+
var enums_1$1 = enums;
|
|
3773
|
+
var getCourseTranslationByLocale = function (locale) {
|
|
3774
|
+
var courseTranslations = {
|
|
3775
|
+
"nl-NL": enums_1$1.CourseTranslation.NL_NL,
|
|
3776
|
+
"nl-BE": enums_1$1.CourseTranslation.NL_NL,
|
|
3777
|
+
// "en-GB": KeyboardLayout.QWERTY_UK,
|
|
3778
|
+
// "en-US": KeyboardLayout.QWERTY_US,
|
|
3779
|
+
// "fr-BE": KeyboardLayout.AZERTY_FR,
|
|
3780
|
+
// "fr-FR": KeyboardLayout.AZERTY_FR,
|
|
3781
|
+
// "de-DE": KeyboardLayout.QWERTZ_DE,
|
|
3782
|
+
};
|
|
3783
|
+
return courseTranslations[locale];
|
|
3784
|
+
};
|
|
3785
|
+
getCourseTranslationByLocale$1.getCourseTranslationByLocale = getCourseTranslationByLocale;
|
|
3786
|
+
|
|
3787
|
+
var getKeyboardLayoutByLocale$1 = {};
|
|
3788
|
+
|
|
3789
|
+
Object.defineProperty(getKeyboardLayoutByLocale$1, "__esModule", { value: true });
|
|
3790
|
+
getKeyboardLayoutByLocale$1.getKeyboardLayoutByLocale = void 0;
|
|
3791
|
+
var enums_1 = enums;
|
|
3792
|
+
var getKeyboardLayoutByLocale = function (locale) {
|
|
3793
|
+
var keyboardLayouts = {
|
|
3794
|
+
"nl-NL": enums_1.KeyboardLayout.QWERTY_NL,
|
|
3795
|
+
"nl-BE": enums_1.KeyboardLayout.AZERTY_BE,
|
|
3796
|
+
// "en-GB": KeyboardLayout.QWERTY_UK,
|
|
3797
|
+
// "en-US": KeyboardLayout.QWERTY_US,
|
|
3798
|
+
// "fr-BE": KeyboardLayout.AZERTY_FR,
|
|
3799
|
+
// "fr-FR": KeyboardLayout.AZERTY_FR,
|
|
3800
|
+
// "de-DE": KeyboardLayout.QWERTZ_DE,
|
|
3801
|
+
};
|
|
3802
|
+
return keyboardLayouts[locale];
|
|
3803
|
+
};
|
|
3804
|
+
getKeyboardLayoutByLocale$1.getKeyboardLayoutByLocale = getKeyboardLayoutByLocale;
|
|
3805
|
+
|
|
3806
|
+
var getLanguageCodeByLocale$1 = {};
|
|
3807
|
+
|
|
3808
|
+
Object.defineProperty(getLanguageCodeByLocale$1, "__esModule", { value: true });
|
|
3809
|
+
getLanguageCodeByLocale$1.getLanguageCodeByLocale = void 0;
|
|
3810
|
+
var getLanguageCodeByLocale = function (locale) { return locale.split("-")[0]; };
|
|
3811
|
+
getLanguageCodeByLocale$1.getLanguageCodeByLocale = getLanguageCodeByLocale;
|
|
3812
|
+
|
|
3813
|
+
var getCountryCodeByLocale$1 = {};
|
|
3814
|
+
|
|
3815
|
+
Object.defineProperty(getCountryCodeByLocale$1, "__esModule", { value: true });
|
|
3816
|
+
getCountryCodeByLocale$1.getCountryCodeByLocale = void 0;
|
|
3817
|
+
var getCountryCodeByLocale = function (locale) { return locale.split("-")[1]; };
|
|
3818
|
+
getCountryCodeByLocale$1.getCountryCodeByLocale = getCountryCodeByLocale;
|
|
3819
|
+
|
|
3820
|
+
var getNativeLanguageByLocale$1 = {};
|
|
3821
|
+
|
|
3822
|
+
Object.defineProperty(getNativeLanguageByLocale$1, "__esModule", { value: true });
|
|
3823
|
+
getNativeLanguageByLocale$1.getNativeLanguageByLocale = void 0;
|
|
3824
|
+
var getNativeLanguageByLocale = function (locale) {
|
|
3825
|
+
var nativeLanguages = {
|
|
3826
|
+
"nl-NL": "Nederlands",
|
|
3827
|
+
"nl-BE": "Nederlands (BE)",
|
|
3828
|
+
// "en-GB": "English (UK)",
|
|
3829
|
+
// "en-US": "English (US)",
|
|
3830
|
+
// "fr-BE": "Français (BE)",
|
|
3831
|
+
// "fr-FR": "Français",
|
|
3832
|
+
// "de-DE": "Deutsch",
|
|
3833
|
+
};
|
|
3834
|
+
return nativeLanguages[locale];
|
|
3835
|
+
};
|
|
3836
|
+
getNativeLanguageByLocale$1.getNativeLanguageByLocale = getNativeLanguageByLocale;
|
|
3837
|
+
|
|
3838
|
+
(function (exports) {
|
|
3839
|
+
var __createBinding = (commonjsGlobal && commonjsGlobal.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3840
|
+
if (k2 === undefined) k2 = k;
|
|
3841
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
3842
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
3843
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
3844
|
+
}
|
|
3845
|
+
Object.defineProperty(o, k2, desc);
|
|
3846
|
+
}) : (function(o, m, k, k2) {
|
|
3847
|
+
if (k2 === undefined) k2 = k;
|
|
3848
|
+
o[k2] = m[k];
|
|
3849
|
+
}));
|
|
3850
|
+
var __exportStar = (commonjsGlobal && commonjsGlobal.__exportStar) || function(m, exports) {
|
|
3851
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
3852
|
+
};
|
|
3853
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3854
|
+
__exportStar(getCountryByLocale$1, exports);
|
|
3855
|
+
__exportStar(getCourseTranslationByLocale$1, exports);
|
|
3856
|
+
__exportStar(getKeyboardLayoutByLocale$1, exports);
|
|
3857
|
+
__exportStar(getLanguageCodeByLocale$1, exports);
|
|
3858
|
+
__exportStar(getCountryCodeByLocale$1, exports);
|
|
3859
|
+
__exportStar(getNativeLanguageByLocale$1, exports);
|
|
3860
|
+
|
|
3861
|
+
}(parsers));
|
|
3862
|
+
|
|
3602
3863
|
var flags = {
|
|
3603
3864
|
NL: (jsxs("svg", __assign$2({ viewBox: "0 0 22 18", xmlSpace: "preserve" }, { children: [jsx$1("path", { d: "M0 1c0-.6.4-1 1-1h20c.6 0 1 .4 1 1v5H0V1z", fill: "#e62743" }), jsx$1("path", { fill: "#fff", d: "M0 6H22V12H0z" }), jsx$1("path", { d: "M0 12h22v5c0 .6-.4 1-1 1H1c-.6 0-1-.4-1-1v-5z", fill: "#148cc6" })] }))),
|
|
3604
3865
|
BE: (jsxs("svg", __assign$2({ viewBox: "0 0 22 18", xmlSpace: "preserve" }, { children: [jsx$1("path", { d: "M15 0h6c.6 0 1 .4 1 1v16c0 .6-.4 1-1 1h-6V0z", fill: "#e62743" }), jsx$1("path", { fill: "#ffd800", d: "M7 0H15V18H7z" }), jsx$1("path", { d: "M0 1c0-.6.4-1 1-1h6v18H1c-.6 0-1-.4-1-1V1z", fill: "#23292f" })] }))),
|
|
@@ -3606,7 +3867,7 @@ var flags = {
|
|
|
3606
3867
|
FR: (jsxs("svg", __assign$2({ viewBox: "0 0 22 18", xmlSpace: "preserve" }, { children: [jsx$1("path", { d: "M15 0h6c.6 0 1 .4 1 1v16c0 .6-.4 1-1 1h-6V0z", fill: "#148cc6" }), jsx$1("path", { fill: "#fff", d: "M7 0H15V18H7z" }), jsx$1("path", { d: "M0 1c0-.6.4-1 1-1h6v18H1c-.6 0-1-.4-1-1V1z", fill: "#e62743" })] }))),
|
|
3607
3868
|
DE: (jsxs("svg", __assign$2({ viewBox: "0 0 22 18", xmlSpace: "preserve" }, { children: [jsx$1("path", { d: "M0 1c0-.6.4-1 1-1h20c.6 0 1 .4 1 1v5H0V1z", fill: "#000" }), jsx$1("path", { fill: "#e62743", d: "M0 6H22V12H0z" }), jsx$1("path", { d: "M0 12h22v5c0 .6-.4 1-1 1H1c-.6 0-1-.4-1-1v-5z", fill: "#ffd800" })] }))),
|
|
3608
3869
|
};
|
|
3609
|
-
var Flag = function (props) { return (jsx$1(Wrapper$a, __assign$2({}, props, { children: flags[getCountryCodeByLocale(props.locale)] }))); };
|
|
3870
|
+
var Flag = function (props) { return (jsx$1(Wrapper$a, __assign$2({}, props, { children: flags[parsers.getCountryCodeByLocale(props.locale)] }))); };
|
|
3610
3871
|
|
|
3611
3872
|
var StyledHeading = styled.span(templateObject_1$P || (templateObject_1$P = __makeTemplateObject$1(["\n font-family: ", ";\n font-size: ", ";\n font-weight: 700;\n font-style: normal;\n line-height: ", ";\n letter-spacing: ", ";\n margin: 0;\n color: ", ";\n text-align: ", ";\n"], ["\n font-family: ", ";\n font-size: ", ";\n font-weight: 700;\n font-style: normal;\n line-height: ", ";\n letter-spacing: ", ";\n margin: 0;\n color: ", ";\n text-align: ", ";\n"])), theme.fonts.heading, function (_a) {
|
|
3612
3873
|
var type = _a.type;
|
|
@@ -3830,6 +4091,99 @@ var Helper = styled(StyledParagraph)(templateObject_6$3 || (templateObject_6$3 =
|
|
|
3830
4091
|
}, fadeIn);
|
|
3831
4092
|
var templateObject_1$L, templateObject_2$x, templateObject_3$b, templateObject_4$7, templateObject_5$3, templateObject_6$3;
|
|
3832
4093
|
|
|
4094
|
+
var expressions = {};
|
|
4095
|
+
|
|
4096
|
+
var hasCapitalLetter$1 = {};
|
|
4097
|
+
|
|
4098
|
+
Object.defineProperty(hasCapitalLetter$1, "__esModule", { value: true });
|
|
4099
|
+
hasCapitalLetter$1.hasCapitalLetter = void 0;
|
|
4100
|
+
var hasCapitalLetter = function (input) {
|
|
4101
|
+
var regex = new RegExp(/[A-Z]/g);
|
|
4102
|
+
return regex.test(input);
|
|
4103
|
+
};
|
|
4104
|
+
hasCapitalLetter$1.hasCapitalLetter = hasCapitalLetter;
|
|
4105
|
+
|
|
4106
|
+
var hasNumber$1 = {};
|
|
4107
|
+
|
|
4108
|
+
Object.defineProperty(hasNumber$1, "__esModule", { value: true });
|
|
4109
|
+
hasNumber$1.hasNumber = void 0;
|
|
4110
|
+
var hasNumber = function (input) {
|
|
4111
|
+
var regex = new RegExp(/\d/g);
|
|
4112
|
+
return regex.test(input);
|
|
4113
|
+
};
|
|
4114
|
+
hasNumber$1.hasNumber = hasNumber;
|
|
4115
|
+
|
|
4116
|
+
var hasSpecialCharacter$1 = {};
|
|
4117
|
+
|
|
4118
|
+
Object.defineProperty(hasSpecialCharacter$1, "__esModule", { value: true });
|
|
4119
|
+
hasSpecialCharacter$1.hasSpecialCharacter = void 0;
|
|
4120
|
+
var hasSpecialCharacter = function (input) {
|
|
4121
|
+
var regex = new RegExp(/`|~|!|"|-|_|@|#|\$|%|\^|&|\*|\(|\)|\+|=|\[|\{|\]|\}|\||\\|'|<|,|\.|>|\?|\/|""|;|:|\s/g);
|
|
4122
|
+
return regex.test(input);
|
|
4123
|
+
};
|
|
4124
|
+
hasSpecialCharacter$1.hasSpecialCharacter = hasSpecialCharacter;
|
|
4125
|
+
|
|
4126
|
+
var isValidEmail$1 = {};
|
|
4127
|
+
|
|
4128
|
+
Object.defineProperty(isValidEmail$1, "__esModule", { value: true });
|
|
4129
|
+
isValidEmail$1.isValidEmail = void 0;
|
|
4130
|
+
var isValidEmail = function (email) {
|
|
4131
|
+
var regex = new RegExp(/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/);
|
|
4132
|
+
return regex.test(email);
|
|
4133
|
+
};
|
|
4134
|
+
isValidEmail$1.isValidEmail = isValidEmail;
|
|
4135
|
+
|
|
4136
|
+
var isValidUsername$1 = {};
|
|
4137
|
+
|
|
4138
|
+
Object.defineProperty(isValidUsername$1, "__esModule", { value: true });
|
|
4139
|
+
isValidUsername$1.isValidUsername = void 0;
|
|
4140
|
+
var isValidEmail_1 = isValidEmail$1;
|
|
4141
|
+
var isValidUsername = function (username) {
|
|
4142
|
+
return username.length >= 5 &&
|
|
4143
|
+
username.length <= 15 &&
|
|
4144
|
+
username.indexOf(" ") < 0 &&
|
|
4145
|
+
!(0, isValidEmail_1.isValidEmail)(username);
|
|
4146
|
+
};
|
|
4147
|
+
isValidUsername$1.isValidUsername = isValidUsername;
|
|
4148
|
+
|
|
4149
|
+
var isStrongPassword$1 = {};
|
|
4150
|
+
|
|
4151
|
+
Object.defineProperty(isStrongPassword$1, "__esModule", { value: true });
|
|
4152
|
+
isStrongPassword$1.isStrongPassword = void 0;
|
|
4153
|
+
var _1 = expressions;
|
|
4154
|
+
var isStrongPassword = function (password) {
|
|
4155
|
+
return password.length >= 8 &&
|
|
4156
|
+
(0, _1.hasNumber)(password) &&
|
|
4157
|
+
(0, _1.hasSpecialCharacter)(password) &&
|
|
4158
|
+
(0, _1.hasCapitalLetter)(password);
|
|
4159
|
+
};
|
|
4160
|
+
isStrongPassword$1.isStrongPassword = isStrongPassword;
|
|
4161
|
+
|
|
4162
|
+
(function (exports) {
|
|
4163
|
+
var __createBinding = (commonjsGlobal && commonjsGlobal.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4164
|
+
if (k2 === undefined) k2 = k;
|
|
4165
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
4166
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
4167
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
4168
|
+
}
|
|
4169
|
+
Object.defineProperty(o, k2, desc);
|
|
4170
|
+
}) : (function(o, m, k, k2) {
|
|
4171
|
+
if (k2 === undefined) k2 = k;
|
|
4172
|
+
o[k2] = m[k];
|
|
4173
|
+
}));
|
|
4174
|
+
var __exportStar = (commonjsGlobal && commonjsGlobal.__exportStar) || function(m, exports) {
|
|
4175
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
4176
|
+
};
|
|
4177
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4178
|
+
__exportStar(hasCapitalLetter$1, exports);
|
|
4179
|
+
__exportStar(hasNumber$1, exports);
|
|
4180
|
+
__exportStar(hasSpecialCharacter$1, exports);
|
|
4181
|
+
__exportStar(isValidEmail$1, exports);
|
|
4182
|
+
__exportStar(isValidUsername$1, exports);
|
|
4183
|
+
__exportStar(isStrongPassword$1, exports);
|
|
4184
|
+
|
|
4185
|
+
}(expressions));
|
|
4186
|
+
|
|
3833
4187
|
var password_helper_capital_letter = "Minimaal 1 hoofdletter";
|
|
3834
4188
|
var password_helper_number = "Minimaal 1 getal";
|
|
3835
4189
|
var password_helper_special_character = "Minimaal 1 leesteken";
|
|
@@ -3866,7 +4220,7 @@ var PasswordInput = function (props) {
|
|
|
3866
4220
|
if (props.onKeyPress)
|
|
3867
4221
|
props.onKeyPress(e);
|
|
3868
4222
|
};
|
|
3869
|
-
return (jsxs(Container$m, { children: [jsxs(InputIconWrapper, __assign$2({ disabled: props.disabled }, { children: [jsx$1(Icon, { type: isVisible ? "eyeInvisible" : "eye", color: "gray", size: "small", onClick: toggle }), jsx$1(StyledInput, __assign$2({ type: isVisible ? "text" : "password" }, props, { onChange: onChange, onKeyPress: onKeyPress }))] })), props.helperLocale && value.length ? (jsxs(HelperContainer, { children: [jsxs(Helper, __assign$2({ isOk: hasCapitalLetter(value) }, { children: ["\u2022 ", translations[props.helperLocale].password_helper_capital_letter] })), jsxs(Helper, __assign$2({ isOk: hasNumber(value) }, { children: ["\u2022 ", translations[props.helperLocale].password_helper_number] })), jsxs(Helper, __assign$2({ isOk: hasSpecialCharacter(value) }, { children: ["\u2022 ", translations[props.helperLocale].password_helper_special_character] })), jsxs(Helper, __assign$2({ isOk: value.length >= 8 }, { children: ["\u2022 ", translations[props.helperLocale].password_helper_password_length] }))] })) : null] }));
|
|
4223
|
+
return (jsxs(Container$m, { children: [jsxs(InputIconWrapper, __assign$2({ disabled: props.disabled }, { children: [jsx$1(Icon, { type: isVisible ? "eyeInvisible" : "eye", color: "gray", size: "small", onClick: toggle }), jsx$1(StyledInput, __assign$2({ type: isVisible ? "text" : "password" }, props, { onChange: onChange, onKeyPress: onKeyPress }))] })), props.helperLocale && value.length ? (jsxs(HelperContainer, { children: [jsxs(Helper, __assign$2({ isOk: expressions.hasCapitalLetter(value) }, { children: ["\u2022 ", translations[props.helperLocale].password_helper_capital_letter] })), jsxs(Helper, __assign$2({ isOk: expressions.hasNumber(value) }, { children: ["\u2022 ", translations[props.helperLocale].password_helper_number] })), jsxs(Helper, __assign$2({ isOk: expressions.hasSpecialCharacter(value) }, { children: ["\u2022 ", translations[props.helperLocale].password_helper_special_character] })), jsxs(Helper, __assign$2({ isOk: value.length >= 8 }, { children: ["\u2022 ", translations[props.helperLocale].password_helper_password_length] }))] })) : null] }));
|
|
3870
4224
|
};
|
|
3871
4225
|
|
|
3872
4226
|
function requiredArgs(required, args) {
|
|
@@ -10884,7 +11238,7 @@ var Checkboxes = function (props) {
|
|
|
10884
11238
|
};
|
|
10885
11239
|
|
|
10886
11240
|
var Container$i = styled.div(templateObject_1$x || (templateObject_1$x = __makeTemplateObject$1(["\n width: 100%;\n background-color: ", ";\n box-shadow: 0px 4px 0px rgba(0, 0, 0, 20%);\n border-radius: 6px;\n padding: 10px 20px;\n"], ["\n width: 100%;\n background-color: ", ";\n box-shadow: 0px 4px 0px rgba(0, 0, 0, 20%);\n border-radius: 6px;\n padding: 10px 20px;\n"])), theme.colors.lightGray.light);
|
|
10887
|
-
var Item = styled.div(templateObject_2$s || (templateObject_2$s = __makeTemplateObject$1(["\n padding: 10px 0;\n cursor: pointer;\n\n > div:first-child {\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-bottom: 5px;\n }\n\n p {\n display: ", ";\n }\n\n :not(:last-child) {\n border-bottom: 1px solid ", ";\n }\n"], ["\n padding: 10px 0;\n cursor: pointer;\n\n > div:first-child {\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-bottom: 5px;\n }\n\n p {\n display: ", ";\n }\n\n :not(:last-child) {\n border-bottom: 1px solid ", ";\n }\n"])), function (_a) {
|
|
11241
|
+
var Item = styled.div(templateObject_2$s || (templateObject_2$s = __makeTemplateObject$1(["\n padding: 10px 0;\n cursor: pointer;\n\n > div:first-child {\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-bottom: 5px;\n }\n\n p, > div:last-child {\n display: ", ";\n margin: 0;\n }\n\n :not(:last-child) {\n border-bottom: 1px solid ", ";\n }\n"], ["\n padding: 10px 0;\n cursor: pointer;\n\n > div:first-child {\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-bottom: 5px;\n }\n\n p, > div:last-child {\n display: ", ";\n margin: 0;\n }\n\n :not(:last-child) {\n border-bottom: 1px solid ", ";\n }\n"])), function (_a) {
|
|
10888
11242
|
var isOpen = _a.isOpen;
|
|
10889
11243
|
return (isOpen ? "" : "none");
|
|
10890
11244
|
}, theme.colors.lightGray.dark);
|
|
@@ -10902,7 +11256,7 @@ var Collapse = function (props) {
|
|
|
10902
11256
|
};
|
|
10903
11257
|
return (jsx$1(Container$i, __assign$2({}, props, { children: props.items.map(function (item, index) {
|
|
10904
11258
|
var isOpen = openItems.includes(index);
|
|
10905
|
-
return (jsxs(Item, __assign$2({ isOpen: isOpen, onClick: function () { return onClickItem(index, isOpen); } }, { children: [jsxs("div", { children: [jsx$1(Heading, __assign$2({ type: "h6" }, { children: item.title })), jsx$1(Icon, { type: isOpen ? "chevronUp" : "chevronDown", color: "blue" })] }), jsx$1(Paragraph, __assign$2({ weight: "regular" }, { children: item.content }))] }), "".concat(item.title, "-").concat(index)));
|
|
11259
|
+
return (jsxs(Item, __assign$2({ isOpen: isOpen, onClick: function () { return onClickItem(index, isOpen); } }, { children: [jsxs("div", { children: [jsx$1(Heading, __assign$2({ type: "h6" }, { children: item.title })), jsx$1(Icon, { type: isOpen ? "chevronUp" : "chevronDown", color: "blue" })] }), jsx$1(Paragraph, __assign$2({ weight: "regular", as: typeof item.content !== "string" ? "div" : undefined }, { children: item.content }))] }), "".concat(item.title, "-").concat(index)));
|
|
10906
11260
|
}) })));
|
|
10907
11261
|
};
|
|
10908
11262
|
|
|
@@ -11130,15 +11484,15 @@ var LocaleSelect = function (props) {
|
|
|
11130
11484
|
setLocale(locale);
|
|
11131
11485
|
props.onChange(locale);
|
|
11132
11486
|
};
|
|
11133
|
-
return (jsxs(Container$d, __assign$2({ color: props.color || "light", dropdownIsVisible: dropdownIsVisible, onClick: function () { return setDropdownIsVisible(!dropdownIsVisible); }, onMouseLeave: function () { return setDropdownIsVisible(false); } }, { children: [jsxs(SelectedLocaleWrapper, { children: [jsxs("div", { children: [jsx$1(Flag, { locale: locale }), jsx$1(Spacer, { horizontal: 10 }), jsx$1(Heading, __assign$2({ type: "h6" }, { children: getNativeLanguageByLocale(locale) }))] }), dropdownIsVisible ? (jsx$1(Icon, { type: "chevronUp", size: "small", color: "darkGray" })) : (jsx$1(Icon, { type: "chevronDown", size: "small", color: "darkGray" }))] }), dropdownIsVisible && (jsx$1(DropdownContainer, __assign$2({ color: props.color || "light" }, { children: props.locales
|
|
11487
|
+
return (jsxs(Container$d, __assign$2({ color: props.color || "light", dropdownIsVisible: dropdownIsVisible, onClick: function () { return setDropdownIsVisible(!dropdownIsVisible); }, onMouseLeave: function () { return setDropdownIsVisible(false); } }, { children: [jsxs(SelectedLocaleWrapper, { children: [jsxs("div", { children: [jsx$1(Flag, { locale: locale }), jsx$1(Spacer, { horizontal: 10 }), jsx$1(Heading, __assign$2({ type: "h6" }, { children: parsers.getNativeLanguageByLocale(locale) }))] }), dropdownIsVisible ? (jsx$1(Icon, { type: "chevronUp", size: "small", color: "darkGray" })) : (jsx$1(Icon, { type: "chevronDown", size: "small", color: "darkGray" }))] }), dropdownIsVisible && (jsx$1(DropdownContainer, __assign$2({ color: props.color || "light" }, { children: props.locales
|
|
11134
11488
|
.filter(function (l) { return l !== locale; })
|
|
11135
|
-
.map(function (locale) { return (jsxs(LocaleWrapper, __assign$2({ onClick: function () { return onSelectLocale(locale); } }, { children: [jsxs("div", { children: [jsx$1(Flag, { locale: locale }), jsx$1(Spacer, { horizontal: 10 }), jsx$1(Paragraph, __assign$2({ size: "small", weight: "regular", color: "darkGray" }, { children: getNativeLanguageByLocale(locale) }))] }), jsx$1(Icon, { type: "chevronRight", size: "small", color: "darkGray" })] }), locale)); }) })))] })));
|
|
11489
|
+
.map(function (locale) { return (jsxs(LocaleWrapper, __assign$2({ onClick: function () { return onSelectLocale(locale); } }, { children: [jsxs("div", { children: [jsx$1(Flag, { locale: locale }), jsx$1(Spacer, { horizontal: 10 }), jsx$1(Paragraph, __assign$2({ size: "small", weight: "regular", color: "darkGray" }, { children: parsers.getNativeLanguageByLocale(locale) }))] }), jsx$1(Icon, { type: "chevronRight", size: "small", color: "darkGray" })] }), locale)); }) })))] })));
|
|
11136
11490
|
};
|
|
11137
11491
|
|
|
11138
11492
|
var Wrapper$1 = styled.div(templateObject_1$o || (templateObject_1$o = __makeTemplateObject$1(["\n width: 100%;\n min-width: 200px;\n display: flex;\n justify-content: space-between;\n\n > div {\n display: flex;\n align-items: center;\n }\n"], ["\n width: 100%;\n min-width: 200px;\n display: flex;\n justify-content: space-between;\n\n > div {\n display: flex;\n align-items: center;\n }\n"])));
|
|
11139
11493
|
var templateObject_1$o;
|
|
11140
11494
|
|
|
11141
|
-
var Medals = function (props) { return (jsxs(Wrapper$1, { children: [jsxs("div", { children: [jsx$1(Medal, { type: Medal
|
|
11495
|
+
var Medals = function (props) { return (jsxs(Wrapper$1, { children: [jsxs("div", { children: [jsx$1(Medal, { type: enums.Medal.GOLD }), jsx$1(Spacer, { horizontal: 5 }), jsxs(Heading, __assign$2({ type: "h6" }, { children: ["x ", props.gold || 0] }))] }), jsxs("div", { children: [jsx$1(Medal, { type: enums.Medal.SILVER }), jsx$1(Spacer, { horizontal: 5 }), jsxs(Heading, __assign$2({ type: "h6" }, { children: ["x ", props.silver || 0] }))] }), jsxs("div", { children: [jsx$1(Medal, { type: enums.Medal.BRONZE }), jsx$1(Spacer, { horizontal: 5 }), jsxs(Heading, __assign$2({ type: "h6" }, { children: ["x ", props.bronze || 0] }))] })] })); };
|
|
11142
11496
|
|
|
11143
11497
|
var NotificationContainer = styled.div(templateObject_1$n || (templateObject_1$n = __makeTemplateObject$1(["\n width: fit-content;\n max-width: 460px;\n padding: 15px;\n border-radius: 6px;\n background-color: ", ";\n box-shadow: 0px 2px 0px rgb(0 0 0 / 20%);\n\n > div:first-child {\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-bottom: 15px;\n }\n"], ["\n width: fit-content;\n max-width: 460px;\n padding: 15px;\n border-radius: 6px;\n background-color: ", ";\n box-shadow: 0px 2px 0px rgb(0 0 0 / 20%);\n\n > div:first-child {\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-bottom: 15px;\n }\n"])), function (_a) {
|
|
11144
11498
|
var contrast = _a.contrast;
|
|
@@ -11752,7 +12106,7 @@ var Form = forwardRef(function (props, ref) {
|
|
|
11752
12106
|
props.onError(feedback);
|
|
11753
12107
|
}
|
|
11754
12108
|
};
|
|
11755
|
-
return (jsxs(Fragment$1, { children: [props.title && (jsxs(Fragment$1, { children: [jsx$1(Heading, __assign$2({ type: "h4" }, { children: props.title })), jsx$1(Spacer, { vertical: 15 })] })), props.description && (jsx$1(DescriptionWrapper, { children: jsx$1(Paragraph, __assign$2({ color: "darkGray", weight: "regular" }, { children: htmlReactParser(props.description) })) })), jsx$1(FormWrapper, { children: props.fields.map(function (field, index) {
|
|
12109
|
+
return (jsxs(Fragment$1, { children: [props.title && (jsxs(Fragment$1, { children: [jsx$1(Heading, __assign$2({ type: "h4" }, { children: props.title })), jsx$1(Spacer, { vertical: 15 })] })), props.description && (jsx$1(DescriptionWrapper, { children: typeof props.description === "string" ? (jsx$1(Paragraph, __assign$2({ color: "darkGray", weight: "regular" }, { children: htmlReactParser(props.description) }))) : (props.description) })), jsx$1(FormWrapper, { children: props.fields.map(function (field, index) {
|
|
11756
12110
|
switch (field.type) {
|
|
11757
12111
|
case "text":
|
|
11758
12112
|
return (createElement(WithValidation, __assign$2({}, feedback[field.name], { key: "field-".concat(index) }),
|