@hbuesing/ui-library 1.0.0 → 1.3.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/button/customButton.d.ts +10 -0
- package/dist/components/button/index.d.ts +1 -0
- package/dist/components/checkbox/customCheckBox.d.ts +10 -0
- package/dist/components/checkbox/index.d.ts +1 -0
- package/dist/components/images/index.d.ts +1 -1
- package/dist/components/input/baseInput.d.ts +2 -1
- package/dist/components/input/customInput.d.ts +8 -0
- package/dist/components/input/index.d.ts +2 -1
- package/dist/components/input/passwordInput.d.ts +18 -0
- package/dist/components/modal/baseModal.d.ts +14 -0
- package/dist/components/modal/index.d.ts +2 -0
- package/dist/components/modal/notifyModal.d.ts +8 -0
- package/dist/components/modal/questionModal.d.ts +9 -0
- package/dist/enums/ModalType.d.ts +5 -0
- package/dist/enums/index.d.ts +1 -0
- package/dist/enums/passwordRuleTypes.d.ts +8 -0
- package/dist/hooks/clickOutside.d.ts +1 -0
- package/dist/hooks/index.d.ts +1 -0
- package/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/dist/index.d.ts +6 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/index.modern.mjs +1 -1
- package/dist/index.modern.mjs.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/package.json +6 -6
- package/dist/components/input/textInput.d.ts +0 -9
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
import './button.scss';
|
|
3
|
+
interface ICustomButton extends ComponentPropsWithoutRef<'button'> {
|
|
4
|
+
label: string;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
small?: boolean;
|
|
7
|
+
theme?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare function CustomButton(props: ICustomButton): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './customButton';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
import './checkbox.scss';
|
|
3
|
+
interface ICustomCheckbox extends ComponentPropsWithoutRef<'input'> {
|
|
4
|
+
checked: boolean;
|
|
5
|
+
label: string;
|
|
6
|
+
onCheck: (value: boolean) => void;
|
|
7
|
+
checkColor?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare function CustomCheckBox(props: ICustomCheckbox): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './customCheckBox';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from
|
|
1
|
+
export * from './svgIcon';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ComponentPropsWithoutRef } from
|
|
1
|
+
import { ComponentPropsWithoutRef } from 'react';
|
|
2
2
|
import './input.scss';
|
|
3
3
|
export interface IBaseInput extends ComponentPropsWithoutRef<'input'> {
|
|
4
4
|
label: string;
|
|
@@ -7,5 +7,6 @@ export interface IBaseInput extends ComponentPropsWithoutRef<'input'> {
|
|
|
7
7
|
iconColor?: string;
|
|
8
8
|
iconSrc?: string;
|
|
9
9
|
inputColor?: string;
|
|
10
|
+
toggle?: () => void;
|
|
10
11
|
}
|
|
11
12
|
export declare function BaseInput(props: IBaseInput): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { IBaseInput } from './baseInput';
|
|
2
|
+
import './input.scss';
|
|
3
|
+
export interface ICustomInput extends IBaseInput {
|
|
4
|
+
tooltipClose?: string;
|
|
5
|
+
tooltipIcon?: string;
|
|
6
|
+
tooltipText?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function CustomInput(props: ICustomInput): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export * from
|
|
1
|
+
export * from './customInput';
|
|
2
|
+
export * from './passwordInput';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ICustomInput } from './customInput';
|
|
2
|
+
import { PasswordRuleTypes } from 'enums/passwordRuleTypes';
|
|
3
|
+
import './input.scss';
|
|
4
|
+
interface IPasswordInput extends ICustomInput {
|
|
5
|
+
capsLockWarning: string;
|
|
6
|
+
setFailedRules: (value: PasswordRule[]) => void;
|
|
7
|
+
ruleChecked: string;
|
|
8
|
+
rules: PasswordRule[];
|
|
9
|
+
ruleUnchecked: string;
|
|
10
|
+
}
|
|
11
|
+
export interface PasswordRule {
|
|
12
|
+
count: number;
|
|
13
|
+
label: string;
|
|
14
|
+
type: PasswordRuleTypes | string;
|
|
15
|
+
pattern?: string;
|
|
16
|
+
}
|
|
17
|
+
export declare function PasswordInput(props: IPasswordInput): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ModalType } from 'enums/ModalType';
|
|
2
|
+
import './modal.scss';
|
|
3
|
+
interface IBaseModal {
|
|
4
|
+
message: string | string[];
|
|
5
|
+
title: string;
|
|
6
|
+
type: ModalType;
|
|
7
|
+
cancelLabel?: string;
|
|
8
|
+
closeLabel?: string;
|
|
9
|
+
confirm?: () => void;
|
|
10
|
+
confirmLabel?: string;
|
|
11
|
+
timeout?: number;
|
|
12
|
+
}
|
|
13
|
+
export declare function BaseModal(props: IBaseModal): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export interface IQuestionModal {
|
|
2
|
+
cancelLabel: string;
|
|
3
|
+
confirm: () => void;
|
|
4
|
+
confirmLabel: string;
|
|
5
|
+
message: string | string[];
|
|
6
|
+
title: string;
|
|
7
|
+
timeout?: number;
|
|
8
|
+
}
|
|
9
|
+
export declare function QuestionModal(props: IQuestionModal): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './passwordRuleTypes';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useOutsideClick(callback: () => void): import("react").MutableRefObject<HTMLDivElement>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './clickOutside';
|
package/dist/index.css
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
.uil-
|
|
1
|
+
.uil-button{background-color:var(--uil-white);border:1px solid var(--uil-black);border-radius:2px;box-shadow:0 0 3px 0 var(--uil-black-alt);color:var(--uil-black);cursor:pointer;font-size:var(--uil-font-base);letter-spacing:1px;line-height:var(--uil-font-base);padding:var(--uil-xs) var(--uil-s);width:-moz-fit-content;width:fit-content}.uil-button.uil-disabled{background-color:var(--uil-grey-dark);border:transparent;color:var(--uil-grey)}.uil-button.uil-small{font-size:var(--uil-m);line-height:var(--uil-m);padding:var(--uil-xxs) var(--uil-xs)}@media (min-width:1025px){.uil-button.uil-small{font-size:1.125rem;line-height:1.125rem;padding:var(--uil-xs) var(--uil-s)}}.uil-check-wrapper{align-items:center;display:flex;font-size:var(--uil-font-base);gap:var(--uil-s);line-height:var(--uil-font-base)}.uil-check-wrapper .uil-checkbox{border:2px solid var(--uil-black-alt);border-radius:2px;cursor:pointer;display:block;font-size:var(--uil-m);min-height:var(--uil-m);min-width:var(--uil-m);position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none}.uil-check-wrapper .uil-checkbox input{cursor:pointer;height:0;opacity:0;position:absolute;width:0}.uil-check-wrapper .uil-checkbox input:checked~.uil-checkmark{transform:scale(1)}.uil-check-wrapper .uil-checkbox .uil-checkmark{background-color:var(--uil-black-alt);height:var(--uil-xs);left:25%;position:absolute;top:25%;transform:scale(0);transition:.1s ease;width:var(--uil-xs)}.uil-svg{height:var(--uil-xxxl);width:var(--uil-xxxl)}.uil-input-wrapper{display:block;position:relative}.uil-input-wrapper .uil-label{background:linear-gradient(0deg,var(--uil-white) 9px,transparent 0);cursor:text;font-weight:700;left:var(--uil-xxs);opacity:.6;padding:0 var(--uil-xxxs);position:absolute;top:25%;transition:top .25s ease-in-out}.uil-input-wrapper .uil-input,.uil-input-wrapper .uil-label{color:var(--uil-black);font-size:var(--uil-font-base);line-height:var(--uil-font-base)}.uil-input-wrapper .uil-input{background-color:var(--uil-white);border:1px solid var(--uil-black);border-radius:0;box-sizing:border-box;padding:var(--uil-xs);width:100%}.uil-input-wrapper .uil-input::-moz-placeholder{color:transparent;height:0;width:0}.uil-input-wrapper .uil-input::placeholder{color:transparent;height:0;width:0}.uil-input-wrapper .uil-input:focus{outline:1px solid var(--uil-outline-focus)}.uil-input-wrapper .uil-input:disabled{background-color:var(--uil-grey);border:2px solid var(--uil-outline-disabled);color:var(--uil-grey-dark);cursor:not-allowed}.uil-input-wrapper .uil-input:disabled~.uil-label{background:transparent;color:var(--uil-grey-dark);cursor:not-allowed}.uil-input-wrapper .uil-input:disabled~.uil-icon{fill:var(--uil-grey-dark);cursor:not-allowed}.uil-input-wrapper .uil-input:disabled:not(:-moz-placeholder-shown)~.uil-label{background:linear-gradient(0deg,var(--uil-grey) 8px,transparent 0)}.uil-input-wrapper .uil-input:disabled:not(:placeholder-shown)~.uil-label{background:linear-gradient(0deg,var(--uil-grey) 8px,transparent 0)}.uil-input-wrapper .uil-icon{fill:var(--uil-black);opacity:.5;position:absolute;right:var(--uil-xs);top:50%;transform:translateY(-50%)}.uil-input-wrapper .uil-input:not(:-moz-placeholder-shown)~.uil-label{opacity:1;top:-30%}.uil-input-wrapper .uil-input:focus~.uil-label,.uil-input-wrapper .uil-input:not(:placeholder-shown)~.uil-label{opacity:1;top:-30%}.uil-input-wrapper .uil-input:not(:-moz-placeholder-shown)~.uil-icon{opacity:1}.uil-input-wrapper .uil-input:focus~.uil-icon,.uil-input-wrapper .uil-input:not(:placeholder-shown)~.uil-icon{opacity:1}.uil-tooltip-wrapper{position:relative}.uil-tooltip-wrapper .uil-tooltip-icon{fill:var(--uil-black-alt);cursor:pointer;height:-moz-fit-content;height:fit-content;width:-moz-fit-content;width:fit-content}.uil-tooltip-wrapper .uil-tooltip-icon:has(~.uil-input-wrapper>.uil-input:not(:-moz-placeholder-shown),~.uil-input-wrapper:focus-within){visibility:hidden}.uil-tooltip-wrapper .uil-tooltip-icon:has(~.uil-input-wrapper>.uil-input:not(:placeholder-shown),~.uil-input-wrapper:focus-within){visibility:hidden}.uil-tooltip-wrapper .uil-tooltip{background-color:rgba(34,34,34,.9);border-radius:3px;box-sizing:border-box;color:var(--uil-white);font-size:var(--uil-font-small);left:0;line-height:var(--uil-font-small);padding:var(--uil-s);position:absolute;top:0;width:100%;z-index:1}.uil-tooltip-wrapper .uil-tooltip .uil-tooltip-button{background-color:transparent;border:none;border-bottom:1px solid var(--uil-white);color:var(--uil-white);cursor:pointer;display:block;margin-bottom:var(--uil-m);margin-left:auto;padding:0;width:-moz-fit-content;width:fit-content}.uil-password-rules{display:flex;flex-direction:column;gap:var(--uil-xs);margin-left:var(--uil-xs);margin-top:var(--uil-m)}.uil-password-rules .uil-password-rule{align-items:center;display:flex;font-size:var(--uil-font-small);gap:var(--uil-xxs);line-height:var(--uil-font-small)}:root{--uil-black:#000;--uil-black-alt:#222;--uil-white:#fff;--uil-grey:#f3f3f3;--uil-grey-alt:#cfcfcf;--uil-grey-dark:#878787;--uil-outline-focus:#1e90ff;--uil-outline-disabled:#8b0000;--uil-success:#006a4e;--uil-error:#800020;--uil-question:#00416a;--uil-xxxs:.125rem;--uil-xxs:.25rem;--uil-xs:.5rem;--uil-s:.75rem;--uil-m:1rem;--uil-l:1.25rem;--uil-xl:1.5rem;--uil-xxl:1.75rem;--uil-xxxl:2rem;--uil-font-base:var(--uil-l);--uil-font-small:var(--uil-m)}.uil-modal-wrapper{background-color:rgba(0,0,0,.5);height:100%;left:0;position:fixed;top:0;width:100%}.uil-modal-wrapper .uil-modal{border-radius:5px;box-shadow:0 0 6px 0 var(--uil-black);left:50%;position:absolute;top:30%;transform:translateX(-50%);width:95%}@media (min-width:1025px){.uil-modal-wrapper .uil-modal{width:75%}}@media (min-width:1250px){.uil-modal-wrapper .uil-modal{width:55%}}@media (min-width:1920px){.uil-modal-wrapper .uil-modal{width:35%}}.uil-modal-wrapper .uil-modal .uil-progress-wrapper{background-color:var(--uil-grey-alt)}.uil-modal-wrapper .uil-modal .uil-progress-wrapper .uil-progress-bar{animation-duration:2s;animation-iteration-count:1;animation-name:uil-progress;border:2px solid var(--uil-grey-dark)}@keyframes uil-progress{0%{width:100%}to{width:0}}.uil-modal-wrapper .uil-modal .uil-header{background-color:var(--uil-question);border-top-left-radius:3px;border-top-right-radius:3px;color:var(--uil-white);display:flex;font-size:var(--uil-xl);font-weight:700;justify-content:space-between;line-height:var(--uil-xl);margin:0;min-height:var(--uil-xl);padding:var(--uil-xs)}@media (min-width:1025px){.uil-modal-wrapper .uil-modal .uil-header{font-size:var(--uil-xxl);line-height:var(--uil-xxl);padding:var(--uil-s)}}.uil-modal-wrapper .uil-modal .uil-header.uil-success{background-color:var(--uil-success)}.uil-modal-wrapper .uil-modal .uil-header.uil-error{background-color:var(--uil-error)}.uil-modal-wrapper .uil-modal .uil-content{background-color:var(--uil-white);border-bottom-left-radius:3px;border-bottom-right-radius:3px;display:flex;flex-direction:column;gap:var(--uil-m);padding:var(--uil-m)}@media (min-width:1025px){.uil-modal-wrapper .uil-modal .uil-content{gap:var(--uil-xxxl);padding:var(--uil-l)}}.uil-modal-wrapper .uil-modal .uil-content .uil-modal-text{color:var(--uil-black);font-size:var(--uil-l);line-height:var(--uil-l);margin:var(--uil-s) 0}@media (min-width:1025px){.uil-modal-wrapper .uil-modal .uil-content .uil-modal-text{font-size:var(--uil-l);line-height:var(--uil-l)}}.uil-modal-wrapper .uil-modal .uil-content .uil-button-wrapper{display:flex;justify-content:space-between}.uil-modal-wrapper .uil-modal .uil-content .uil-button-wrapper.uil-single{justify-content:end}
|
|
2
2
|
/*# sourceMappingURL=index.css.map */
|
package/dist/index.css.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["images.scss","input.scss"],"names":[],"mappings":"AAoBA,SACE,sBAAuB,CACvB,qBACF,CCvBA,MACE,gBAAoB,CACpB,oBAAwB,CACxB,gBAAoB,CACpB,kBAAmB,CACnB,uBAAwB,CACxB,2BAA8B,CAC9B,8BAAiC,CACjC,kBAAmB,CACnB,gBAAiB,CACjB,cAAe,CACf,cAAe,CACf,YAAa,CACb,eAAgB,CAChB,eAAgB,CAChB,iBAAkB,CAClB,eAAgB,CAChB,4BACF,CAEA,mBAEE,aAAc,CADd,iBAEF,CACA,8BASE,mEAA4E,CAL5E,WAAY,CAEZ,eAAiB,CAHjB,WAAa,CAOb,UAAY,CACZ,iBAAmB,CAVnB,iBAAkB,CAClB,OAAQ,CAUR,+BACF,CACA,4DANE,sBAAuB,CAHvB,8BAA+B,CAE/B,gCAiBF,CAVA,8BAME,iCAAkC,CAClC,iCAAkC,CAClC,eAAgB,CAPhB,qBAAsB,CAQtB,qBAAsB,CALtB,UAMF,CACA,gDACE,iBAAkB,CAElB,QAAS,CADT,OAEF,CAJA,2CACE,iBAAkB,CAElB,QAAS,CADT,OAEF,CACA,oCACE,0CACF,CACA,uCAGE,gCAAiC,CADjC,4CAA6C,CAE7C,0BAA2B,CAH3B,kBAIF,CACA,kDAEE,sBAAuB,CACvB,0BAA2B,CAF3B,kBAGF,CACA,iDAEE,yBAA0B,CAD1B,kBAEF,CACA,+EACE,kEACF,CAFA,0EACE,kEACF,CACA,6BAKE,qBAAsB,CACtB,UAAY,CALZ,iBAAkB,CAElB,mBAAoB,CADpB,OAAQ,CAER,0BAGF,CACA,sEAEE,SAAU,CADV,QAEF,CAHA,gHAEE,SAAU,CADV,QAEF,CACA,qEACE,SACF,CAFA,8GACE,SACF,CAEA,qBACE,iBACF,CACA,uCAIE,yBAA0B,CAH1B,cAAe,CACf,uBAAmB,CAAnB,kBAAmB,CACnB,sBAAkB,CAAlB,iBAEF,CACA,yIACE,iBACF,CAFA,oIACE,iBACF,CACA,kCAQE,kCAAuC,CAEvC,iBAAkB,CALlB,qBAAsB,CAEtB,sBAAuB,CAJvB,MAAO,CAMP,oBAAqB,CARrB,iBAAkB,CAClB,KAAM,CAEN,UAAW,CAEX,SAKF,CACA,sDAME,4BAA6B,CAC7B,WAAY,CAEZ,wCAAyC,CAJzC,sBAAuB,CAJvB,aAAc,CAGd,0BAA2B,CAD3B,gBAAiB,CAKjB,SAAU,CANV,sBAAkB,CAAlB,iBAQF","file":"index.css","sourcesContent":[":root {\n --uil-black: #000000;\n --uil-black-alt: #222222;\n --uil-white: #ffffff;\n --uil-grey: #f3f3f3;\n --uil-grey-dark: #878787;\n --uil-outline-focus: #1E90FFFF;\n --uil-outline-disabled: #8B0000FF;\n --uil-xxxs: .125rem;\n --uil-xxs: .25rem;\n --uil-xs: .5rem;\n --uil-s: .75rem;\n --uil-m: 1rem;\n --uil-l: 1.25rem;\n --uil-xl: 1.5rem;\n --uil-xxl: 1.75rem;\n --uil-xxxl: 2rem;\n --uil-font-base: var(--uil-l) ;\n}\n\n.uil-svg {\n height: var(--uil-xxxl);\n width: var(--uil-xxxl);\n}",":root {\n --uil-black: #000000;\n --uil-black-alt: #222222;\n --uil-white: #ffffff;\n --uil-grey: #f3f3f3;\n --uil-grey-dark: #878787;\n --uil-outline-focus: #1E90FFFF;\n --uil-outline-disabled: #8B0000FF;\n --uil-xxxs: .125rem;\n --uil-xxs: .25rem;\n --uil-xs: .5rem;\n --uil-s: .75rem;\n --uil-m: 1rem;\n --uil-l: 1.25rem;\n --uil-xl: 1.5rem;\n --uil-xxl: 1.75rem;\n --uil-xxxl: 2rem;\n --uil-font-base: var(--uil-l) ;\n}\n\n.uil-input-wrapper {\n position: relative;\n display: block;\n}\n.uil-input-wrapper .uil-label {\n position: absolute;\n top: 25%;\n left: 0.25rem;\n cursor: text;\n font-size: var(--uil-font-base);\n font-weight: bold;\n line-height: var(--uil-font-base);\n color: var(--uil-black);\n background: linear-gradient(0deg, var(--uil-white) 9px, rgba(0, 0, 0, 0) 0%);\n opacity: 0.6;\n padding: 0 0.125rem;\n transition: top 0.25s ease-in-out;\n}\n.uil-input-wrapper .uil-input {\n box-sizing: border-box;\n font-size: var(--uil-font-base);\n line-height: var(--uil-font-base);\n width: 100%;\n color: var(--uil-black);\n background-color: var(--uil-white);\n border: 1px solid var(--uil-black);\n border-radius: 0;\n padding: var(--uil-xs);\n}\n.uil-input-wrapper .uil-input::placeholder {\n color: transparent;\n width: 0;\n height: 0;\n}\n.uil-input-wrapper .uil-input:focus {\n outline: 1px solid var(--uil-outline-focus);\n}\n.uil-input-wrapper .uil-input:disabled {\n cursor: not-allowed;\n border: 2px solid var(--uil-outline-disabled);\n background-color: var(--uil-grey);\n color: var(--uil-grey-dark);\n}\n.uil-input-wrapper .uil-input:disabled ~ .uil-label {\n cursor: not-allowed;\n background: transparent;\n color: var(--uil-grey-dark);\n}\n.uil-input-wrapper .uil-input:disabled ~ .uil-icon {\n cursor: not-allowed;\n fill: var(--uil-grey-dark);\n}\n.uil-input-wrapper .uil-input:disabled:not(:placeholder-shown) ~ .uil-label {\n background: linear-gradient(0deg, var(--uil-grey) 8px, rgba(0, 0, 0, 0) 0%);\n}\n.uil-input-wrapper .uil-icon {\n position: absolute;\n top: 50%;\n right: var(--uil-xs);\n transform: translate(0%, -50%);\n fill: var(--uil-black);\n opacity: 0.5;\n}\n.uil-input-wrapper .uil-input:focus ~ .uil-label, .uil-input-wrapper .uil-input:not(:placeholder-shown) ~ .uil-label {\n top: -30%;\n opacity: 1;\n}\n.uil-input-wrapper .uil-input:focus ~ .uil-icon, .uil-input-wrapper .uil-input:not(:placeholder-shown) ~ .uil-icon {\n opacity: 1;\n}\n\n.uil-tooltip-wrapper {\n position: relative;\n}\n.uil-tooltip-wrapper .uil-tooltip-icon {\n cursor: pointer;\n height: fit-content;\n width: fit-content;\n fill: var(--uil-black-alt);\n}\n.uil-tooltip-wrapper .uil-tooltip-icon:has(~ .uil-input-wrapper > .uil-input:not(:placeholder-shown), ~ .uil-input-wrapper:focus-within) {\n visibility: hidden;\n}\n.uil-tooltip-wrapper .uil-tooltip {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n box-sizing: border-box;\n z-index: 1;\n color: var(--uil-white);\n background-color: rgba(34, 34, 34, 0.9);\n padding: var(--uil-s);\n border-radius: 3px;\n}\n.uil-tooltip-wrapper .uil-tooltip .uil-tooltip-button {\n display: block;\n width: fit-content;\n margin-left: auto;\n margin-bottom: var(--uil-m);\n color: var(--uil-white);\n background-color: transparent;\n border: none;\n padding: 0;\n border-bottom: 1px solid var(--uil-white);\n}"]}
|
|
1
|
+
{"version":3,"sources":["button.scss","checkbox.scss","images.scss","input.scss","modal.scss"],"names":[],"mappings":"AAyBA,YAKE,iCAAkC,CAClC,iCAAkC,CAClC,iBAAkB,CAKlB,yCAA0C,CAR1C,sBAAuB,CAKvB,cAAe,CARf,8BAA+B,CAE/B,kBAAmB,CADnB,gCAAiC,CAQjC,kCAAmC,CAFnC,sBAAkB,CAAlB,iBAKF,CACA,yBACE,qCAAsC,CAEtC,kBAAmB,CADnB,qBAEF,CACA,sBACE,sBAAuB,CACvB,wBAAyB,CACzB,oCACF,CACA,0BACE,sBACE,kBAAmB,CACnB,oBAAqB,CACrB,kCACF,CACF,CC9BA,mBAEE,kBAAmB,CADnB,YAAa,CAGb,8BAA+B,CAD/B,gBAAiB,CAEjB,gCACF,CACA,iCAQE,qCAAsC,CACtC,iBAAkB,CANlB,cAAe,CADf,aAAc,CAEd,sBAAuB,CAEvB,uBAAwB,CADxB,sBAAuB,CAJvB,iBAAkB,CAMlB,wBAAiB,CAAjB,qBAAiB,CAAjB,gBAGF,CACA,uCAEE,cAAe,CACf,QAAS,CAET,SAAU,CAJV,iBAAkB,CAGlB,OAEF,CACA,8DACE,kBACF,CACA,gDAIE,qCAAsC,CAEtC,oBAAqB,CAHrB,QAAS,CAFT,iBAAkB,CAClB,OAAQ,CAKR,kBAAmB,CACnB,mBAAqB,CAHrB,mBAIF,CCrCA,SACE,s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B,CALjB,oBAMF,CACA,0BACE,2CAEE,mBAAoB,CADpB,oBAEF,CACF,CACA,2DAGE,sBAAuB,CAFvB,sBAAuB,CACvB,wBAAyB,CAEzB,qBACF,CACA,0BACE,2DACE,sBAAuB,CACvB,wBACF,CACF,CACA,+DACE,YAAa,CACb,6BACF,CACA,0EACE,mBACF","file":"index.css","sourcesContent":[":root {\n --uil-black: #000000;\n --uil-black-alt: #222222;\n --uil-white: #ffffff;\n --uil-grey: #f3f3f3;\n --uil-grey-alt: #cfcfcf;\n --uil-grey-dark: #878787;\n --uil-outline-focus: #1E90FFFF;\n --uil-outline-disabled: #8B0000FF;\n --uil-success: #006A4E;\n --uil-error: #800020;\n --uil-question: #00416A;\n --uil-xxxs: .125rem;\n --uil-xxs: .25rem;\n --uil-xs: .5rem;\n --uil-s: .75rem;\n --uil-m: 1rem;\n --uil-l: 1.25rem;\n --uil-xl: 1.5rem;\n --uil-xxl: 1.75rem;\n --uil-xxxl: 2rem;\n --uil-font-base: var(--uil-l);\n --uil-font-small: var(--uil-m);\n}\n\n.uil-button {\n font-size: var(--uil-font-base);\n line-height: var(--uil-font-base);\n letter-spacing: 1px;\n color: var(--uil-black);\n background-color: var(--uil-white);\n border: 1px solid var(--uil-black);\n border-radius: 2px;\n width: fit-content;\n cursor: pointer;\n padding: var(--uil-xs) var(--uil-s);\n -webkit-box-shadow: 0 0 3px 0 var(--uil-black-alt);\n box-shadow: 0 0 3px 0 var(--uil-black-alt);\n}\n.uil-button.uil-disabled {\n background-color: var(--uil-grey-dark);\n color: var(--uil-grey);\n border: transparent;\n}\n.uil-button.uil-small {\n font-size: var(--uil-m);\n line-height: var(--uil-m);\n padding: var(--uil-xxs) var(--uil-xs);\n}\n@media (min-width: 1025px) {\n .uil-button.uil-small {\n font-size: 1.125rem;\n line-height: 1.125rem;\n padding: var(--uil-xs) var(--uil-s);\n }\n}",":root {\n --uil-black: #000000;\n --uil-black-alt: #222222;\n --uil-white: #ffffff;\n --uil-grey: #f3f3f3;\n --uil-grey-alt: #cfcfcf;\n --uil-grey-dark: #878787;\n --uil-outline-focus: #1E90FFFF;\n --uil-outline-disabled: #8B0000FF;\n --uil-success: #006A4E;\n --uil-error: #800020;\n --uil-question: #00416A;\n --uil-xxxs: .125rem;\n --uil-xxs: .25rem;\n --uil-xs: .5rem;\n --uil-s: .75rem;\n --uil-m: 1rem;\n --uil-l: 1.25rem;\n --uil-xl: 1.5rem;\n --uil-xxl: 1.75rem;\n --uil-xxxl: 2rem;\n --uil-font-base: var(--uil-l);\n --uil-font-small: var(--uil-m);\n}\n\n.uil-check-wrapper {\n display: flex;\n align-items: center;\n gap: var(--uil-s);\n font-size: var(--uil-font-base);\n line-height: var(--uil-font-base);\n}\n.uil-check-wrapper .uil-checkbox {\n position: relative;\n display: block;\n cursor: pointer;\n font-size: var(--uil-m);\n min-width: var(--uil-m);\n min-height: var(--uil-m);\n user-select: none;\n border: 2px solid var(--uil-black-alt);\n border-radius: 2px;\n}\n.uil-check-wrapper .uil-checkbox input {\n position: absolute;\n cursor: pointer;\n height: 0;\n width: 0;\n opacity: 0;\n}\n.uil-check-wrapper .uil-checkbox input:checked ~ .uil-checkmark {\n transform: scale(1);\n}\n.uil-check-wrapper .uil-checkbox .uil-checkmark {\n position: absolute;\n top: 25%;\n left: 25%;\n background-color: var(--uil-black-alt);\n width: var(--uil-xs);\n height: var(--uil-xs);\n transform: scale(0);\n transition: 0.1s ease;\n}",":root {\n --uil-black: #000000;\n --uil-black-alt: #222222;\n --uil-white: #ffffff;\n --uil-grey: #f3f3f3;\n --uil-grey-alt: #cfcfcf;\n --uil-grey-dark: #878787;\n --uil-outline-focus: #1E90FFFF;\n --uil-outline-disabled: #8B0000FF;\n --uil-success: #006A4E;\n --uil-error: #800020;\n --uil-question: #00416A;\n --uil-xxxs: .125rem;\n --uil-xxs: .25rem;\n --uil-xs: .5rem;\n --uil-s: .75rem;\n --uil-m: 1rem;\n --uil-l: 1.25rem;\n --uil-xl: 1.5rem;\n --uil-xxl: 1.75rem;\n --uil-xxxl: 2rem;\n --uil-font-base: var(--uil-l);\n --uil-font-small: var(--uil-m);\n}\n\n.uil-svg {\n height: var(--uil-xxxl);\n width: var(--uil-xxxl);\n}",":root {\n --uil-black: #000000;\n --uil-black-alt: #222222;\n --uil-white: #ffffff;\n --uil-grey: #f3f3f3;\n --uil-grey-alt: #cfcfcf;\n --uil-grey-dark: #878787;\n --uil-outline-focus: #1E90FFFF;\n --uil-outline-disabled: #8B0000FF;\n --uil-success: #006A4E;\n --uil-error: #800020;\n --uil-question: #00416A;\n --uil-xxxs: .125rem;\n --uil-xxs: .25rem;\n --uil-xs: .5rem;\n --uil-s: .75rem;\n --uil-m: 1rem;\n --uil-l: 1.25rem;\n --uil-xl: 1.5rem;\n --uil-xxl: 1.75rem;\n --uil-xxxl: 2rem;\n --uil-font-base: var(--uil-l);\n --uil-font-small: var(--uil-m);\n}\n\n.uil-input-wrapper {\n position: relative;\n display: block;\n}\n.uil-input-wrapper .uil-label {\n position: absolute;\n top: 25%;\n left: var(--uil-xxs);\n cursor: text;\n font-size: var(--uil-font-base);\n font-weight: bold;\n line-height: var(--uil-font-base);\n color: var(--uil-black);\n background: linear-gradient(0deg, var(--uil-white) 9px, rgba(0, 0, 0, 0) 0%);\n opacity: 0.6;\n padding: 0 var(--uil-xxxs);\n transition: top 0.25s ease-in-out;\n}\n.uil-input-wrapper .uil-input {\n box-sizing: border-box;\n font-size: var(--uil-font-base);\n line-height: var(--uil-font-base);\n width: 100%;\n color: var(--uil-black);\n background-color: var(--uil-white);\n border: 1px solid var(--uil-black);\n border-radius: 0;\n padding: var(--uil-xs);\n}\n.uil-input-wrapper .uil-input::placeholder {\n color: transparent;\n width: 0;\n height: 0;\n}\n.uil-input-wrapper .uil-input:focus {\n outline: 1px solid var(--uil-outline-focus);\n}\n.uil-input-wrapper .uil-input:disabled {\n cursor: not-allowed;\n border: 2px solid var(--uil-outline-disabled);\n background-color: var(--uil-grey);\n color: var(--uil-grey-dark);\n}\n.uil-input-wrapper .uil-input:disabled ~ .uil-label {\n cursor: not-allowed;\n background: transparent;\n color: var(--uil-grey-dark);\n}\n.uil-input-wrapper .uil-input:disabled ~ .uil-icon {\n cursor: not-allowed;\n fill: var(--uil-grey-dark);\n}\n.uil-input-wrapper .uil-input:disabled:not(:placeholder-shown) ~ .uil-label {\n background: linear-gradient(0deg, var(--uil-grey) 8px, rgba(0, 0, 0, 0) 0%);\n}\n.uil-input-wrapper .uil-icon {\n position: absolute;\n top: 50%;\n right: var(--uil-xs);\n transform: translate(0%, -50%);\n fill: var(--uil-black);\n opacity: 0.5;\n}\n.uil-input-wrapper .uil-input:focus ~ .uil-label, .uil-input-wrapper .uil-input:not(:placeholder-shown) ~ .uil-label {\n top: -30%;\n opacity: 1;\n}\n.uil-input-wrapper .uil-input:focus ~ .uil-icon, .uil-input-wrapper .uil-input:not(:placeholder-shown) ~ .uil-icon {\n opacity: 1;\n}\n\n.uil-tooltip-wrapper {\n position: relative;\n}\n.uil-tooltip-wrapper .uil-tooltip-icon {\n cursor: pointer;\n height: fit-content;\n width: fit-content;\n fill: var(--uil-black-alt);\n}\n.uil-tooltip-wrapper .uil-tooltip-icon:has(~ .uil-input-wrapper > .uil-input:not(:placeholder-shown), ~ .uil-input-wrapper:focus-within) {\n visibility: hidden;\n}\n.uil-tooltip-wrapper .uil-tooltip {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n box-sizing: border-box;\n z-index: 1;\n color: var(--uil-white);\n background-color: rgba(34, 34, 34, 0.9);\n padding: var(--uil-s);\n border-radius: 3px;\n font-size: var(--uil-font-small);\n line-height: var(--uil-font-small);\n}\n.uil-tooltip-wrapper .uil-tooltip .uil-tooltip-button {\n display: block;\n width: fit-content;\n margin-left: auto;\n margin-bottom: var(--uil-m);\n color: var(--uil-white);\n background-color: transparent;\n border: none;\n padding: 0;\n border-bottom: 1px solid var(--uil-white);\n cursor: pointer;\n}\n\n.uil-password-rules {\n margin-top: var(--uil-m);\n display: flex;\n flex-direction: column;\n gap: var(--uil-xs);\n margin-left: var(--uil-xs);\n}\n.uil-password-rules .uil-password-rule {\n display: flex;\n align-items: center;\n gap: var(--uil-xxs);\n font-size: var(--uil-font-small);\n line-height: var(--uil-font-small);\n}",":root {\n --uil-black: #000000;\n --uil-black-alt: #222222;\n --uil-white: #ffffff;\n --uil-grey: #f3f3f3;\n --uil-grey-alt: #cfcfcf;\n --uil-grey-dark: #878787;\n --uil-outline-focus: #1E90FFFF;\n --uil-outline-disabled: #8B0000FF;\n --uil-success: #006A4E;\n --uil-error: #800020;\n --uil-question: #00416A;\n --uil-xxxs: .125rem;\n --uil-xxs: .25rem;\n --uil-xs: .5rem;\n --uil-s: .75rem;\n --uil-m: 1rem;\n --uil-l: 1.25rem;\n --uil-xl: 1.5rem;\n --uil-xxl: 1.75rem;\n --uil-xxxl: 2rem;\n --uil-font-base: var(--uil-l);\n --uil-font-small: var(--uil-m);\n}\n\n.uil-modal-wrapper {\n position: fixed;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n background-color: rgba(0, 0, 0, 0.5);\n}\n.uil-modal-wrapper .uil-modal {\n position: absolute;\n top: 30%;\n left: 50%;\n transform: translateX(-50%);\n width: 95%;\n -webkit-box-shadow: 0 0 6px 0 var(--uil-black);\n box-shadow: 0 0 6px 0 var(--uil-black);\n border-radius: 5px;\n}\n@media (min-width: 1025px) {\n .uil-modal-wrapper .uil-modal {\n width: 75%;\n }\n}\n@media (min-width: 1250px) {\n .uil-modal-wrapper .uil-modal {\n width: 55%;\n }\n}\n@media (min-width: 1920px) {\n .uil-modal-wrapper .uil-modal {\n width: 35%;\n }\n}\n.uil-modal-wrapper .uil-modal .uil-progress-wrapper {\n background-color: var(--uil-grey-alt);\n}\n.uil-modal-wrapper .uil-modal .uil-progress-wrapper .uil-progress-bar {\n border: 2px solid var(--uil-grey-dark);\n animation-duration: 2s;\n animation-iteration-count: initial;\n animation-name: uil-progress;\n}\n@keyframes uil-progress {\n 0% {\n width: 100%;\n }\n 100% {\n width: 0;\n }\n}\n.uil-modal-wrapper .uil-modal .uil-header {\n color: var(--uil-white);\n background-color: var(--uil-question);\n display: flex;\n justify-content: space-between;\n font-size: var(--uil-xl);\n line-height: var(--uil-xl);\n font-weight: bold;\n min-height: var(--uil-xl);\n margin: 0;\n padding: var(--uil-xs);\n border-top-left-radius: 3px;\n border-top-right-radius: 3px;\n}\n@media (min-width: 1025px) {\n .uil-modal-wrapper .uil-modal .uil-header {\n font-size: var(--uil-xxl);\n line-height: var(--uil-xxl);\n padding: var(--uil-s);\n }\n}\n.uil-modal-wrapper .uil-modal .uil-header.uil-success {\n background-color: var(--uil-success);\n}\n.uil-modal-wrapper .uil-modal .uil-header.uil-error {\n background-color: var(--uil-error);\n}\n.uil-modal-wrapper .uil-modal .uil-content {\n background-color: var(--uil-white);\n padding: var(--uil-m);\n border-bottom-left-radius: 3px;\n border-bottom-right-radius: 3px;\n display: flex;\n flex-direction: column;\n gap: var(--uil-m);\n}\n@media (min-width: 1025px) {\n .uil-modal-wrapper .uil-modal .uil-content {\n padding: var(--uil-l);\n gap: var(--uil-xxxl);\n }\n}\n.uil-modal-wrapper .uil-modal .uil-content .uil-modal-text {\n font-size: var(--uil-l);\n line-height: var(--uil-l);\n color: var(--uil-black);\n margin: var(--uil-s) 0;\n}\n@media (min-width: 1025px) {\n .uil-modal-wrapper .uil-modal .uil-content .uil-modal-text {\n font-size: var(--uil-l);\n line-height: var(--uil-l);\n }\n}\n.uil-modal-wrapper .uil-modal .uil-content .uil-button-wrapper {\n display: flex;\n justify-content: space-between;\n}\n.uil-modal-wrapper .uil-modal .uil-content .uil-button-wrapper.uil-single {\n justify-content: end;\n}"]}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,7 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { CustomButton } from './components/button';
|
|
2
|
+
export { CustomCheckBox } from './components/checkbox';
|
|
2
3
|
export { SVG } from './components/images';
|
|
4
|
+
export { CustomInput, PasswordInput, PasswordRule } from './components/input';
|
|
5
|
+
export { NotifyModal, QuestionModal } from './components/modal';
|
|
6
|
+
export { useOutsideClick } from './hooks';
|
|
7
|
+
export { PasswordRuleTypes } from './enums';
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var
|
|
1
|
+
var e=require("react/jsx-runtime"),s=require("react");function r(){return r=Object.assign?Object.assign.bind():function(e){for(var s=1;s<arguments.length;s++){var r=arguments[s];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},r.apply(null,arguments)}function n(e,s){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(s.indexOf(n)>=0)continue;r[n]=e[n]}return r}var t=["disabled","label","small","theme"];function l(s){var l=s.disabled,i=void 0!==l&&l,o=s.label,a=s.small,c=void 0!==a&&a,u=s.theme,d=n(s,t),p={color:function(e){if(!u||i)return null;var s="#"===e.charAt(0)?e.substring(1,7):e,r=[parseInt(s.substring(0,2),16)/255,parseInt(s.substring(2,4),16)/255,parseInt(s.substring(4,6),16)/255].map(function(e){return e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4)});return.2126*r[0]+.7152*r[1]+.0722*r[2]>.179?"#000000":"#ffffff"}(u),backgroundColor:i?null:u,border:u?"none":null};return e.jsx("button",r({className:"uil-button "+(i?"uil-disabled":"")+" "+(c?"uil-small":""),style:p,disabled:i},d,{children:o}))}var i=["checkColor","checked","onCheck","label"];function o(s){var r=s.src,n=s.color,t=s.height,l=s.width;if(!r.includes(".svg"))throw new Error("Provided src is not an svg image");return e.jsx("svg",{"aria-hidden":!0,className:"uil-svg",style:{fill:n,height:t+"px",width:l+"px"},children:e.jsx("use",{href:r})})}var a=["iconColor","iconSrc","inputColor","label","toggle","valueChanged"];function c(s){var t=s.iconColor,l=s.iconSrc,i=s.inputColor,c=s.label,u=s.toggle,d=s.valueChanged,p=n(s,a);return e.jsxs("label",{className:"uil-input-wrapper",htmlFor:p.id,children:[e.jsx("input",r({className:"uil-input",onChange:function(e){return d(e.target.value)},placeholder:c,style:{color:i}},p)),l&&e.jsx("div",{className:"uil-icon",onClick:u,children:e.jsx(o,{src:l,width:24,height:24,color:t})}),e.jsx("span",{className:"uil-label",style:{color:i},children:c})]})}function u(e){var r=s.useRef(null);return s.useEffect(function(){function s(s){r.current&&!r.current.contains(s.target)&&e()}return document.addEventListener("click",s),document.addEventListener("touchend",s),function(){document.removeEventListener("click",s),document.removeEventListener("touchend",s)}},[e]),r}var d,p=["tooltipClose","tooltipIcon","tooltipText"];function h(t){var l=t.tooltipClose,i=t.tooltipIcon,a=t.tooltipText,d=n(t,p),h=s.useState(!1),x=h[0],m=h[1],f=u(v);function v(){m(!1)}return e.jsx(e.Fragment,{children:i?e.jsxs("div",{className:"uil-tooltip-wrapper",children:[x&&e.jsxs("div",{className:"uil-tooltip",ref:f,children:[l&&e.jsx("button",{className:"uil-tooltip-button",onClick:v,children:l}),e.jsx("span",{children:a})]}),e.jsx("div",{className:"uil-tooltip-icon",onClick:function(){return m(!x)},children:e.jsx(o,{src:i,height:16,width:16})}),e.jsx(c,r({},d))]}):e.jsx(c,r({},d))})}exports.PasswordRuleTypes=void 0,(d=exports.PasswordRuleTypes||(exports.PasswordRuleTypes={}))[d.minLength=0]="minLength",d[d.maxLength=1]="maxLength",d[d.letters=2]="letters",d[d.numbers=3]="numbers",d[d.special=4]="special",d[d.upper=5]="upper";var x,m=["capsLockWarning","rules","ruleChecked","ruleUnchecked","setFailedRules"];function f(r){var n=r.cancelLabel,t=void 0===n?"":n,i=r.closeLabel,o=r.confirm,a=r.confirmLabel,c=void 0===a?"":a,u=r.message,d=r.timeout,p=r.title,h=r.type,m=s.useState(!0),f=m[0],v=m[1];return s.useEffect(function(){d&&setTimeout(function(){v(!1)},d)},[]),f?e.jsx("div",{className:"uil-modal-wrapper",children:e.jsxs("div",{className:"uil-modal",children:[e.jsx("div",{className:"uil-header "+(h==x.success?"uil-success":"")+" "+(h==x.error?"uil-error":""),children:p}),d&&e.jsx("div",{className:"uil-progress-wrapper",children:e.jsx("div",{className:"uil-progress-bar",style:{animationDuration:r.timeout/1e3+1+"s"}})}),e.jsxs("div",{className:"uil-content",children:[e.jsx("div",{children:Array.isArray(u)?u.map(function(s,r){return e.jsx("p",{className:"uil-modal-text",children:s},r)}):e.jsx("p",{className:"uil-modal-text",children:u})}),e.jsxs("div",{className:"uil-button-wrapper "+(h!==x.question?"uil-single":""),children:[h!==x.question&&e.jsx(l,{label:i,small:!0,onClick:function(){return v(!1)},type:"button"}),h==x.question&&r.confirm&&e.jsxs(e.Fragment,{children:[e.jsx(l,{label:c,theme:"#00416A",small:!0,onClick:function(){return o},type:"button"}),e.jsx(l,{label:t,small:!0,onClick:function(){return v(!1)},type:"button"})]})]})]})]})}):e.jsx(e.Fragment,{})}!function(e){e[e.error=0]="error",e[e.question=1]="question",e[e.success=2]="success"}(x||(x={}));var v=["isSuccess"];exports.CustomButton=l,exports.CustomCheckBox=function(s){var t=s.checkColor,l=s.checked,o=s.onCheck,a=s.label,c=n(s,i);return e.jsx(e.Fragment,{children:e.jsxs("div",{className:"uil-check-wrapper",children:[e.jsxs("label",{className:"uil-checkbox",children:[e.jsx("input",r({type:"checkbox",checked:l,onChange:function(){o(!l)}},c)),e.jsx("div",{className:"uil-checkmark",style:{backgroundColor:t}})]}),e.jsx("span",{children:a})]})})},exports.CustomInput=h,exports.NotifyModal=function(s){var t=s.isSuccess,l=n(s,v);return e.jsx(f,r({type:t?x.success:x.error},l))},exports.PasswordInput=function(t){var l=t.capsLockWarning,i=t.rules,a=t.ruleChecked,c=t.ruleUnchecked,u=t.setFailedRules,d=n(t,m),p=s.useState(!1),x=p[0],f=p[1];function v(e){var s;switch(e.type){case exports.PasswordRuleTypes.minLength:s="[a-zA-Z0-9ßÄäÖöÜü._!\"`'#%&§,:;<>=@{}~\\$\\(\\)\\*\\+\\/\\\\\\?\\[\\]\\^\\|\\-]{"+e.count+",}";break;case exports.PasswordRuleTypes.maxLength:s="^[a-zA-Z0-9ßÄäÖöÜü._!\"`'#%&,:;<>=@{}~\\$\\(\\)\\*\\+\\/\\\\\\?\\[\\]\\^\\|\\-]{0,"+e.count+"}$";break;case exports.PasswordRuleTypes.letters:s="[a-zA-ZßÄäÖöÜü]{"+e.count+",}";break;case exports.PasswordRuleTypes.numbers:s="[0-9]{"+e.count+",}";break;case exports.PasswordRuleTypes.special:s="[._!\"`'#%&§,:;<>=@{}~\\$\\(\\)\\*\\+\\/\\\\\\?\\[\\]\\^\\|\\-]{"+e.count+",}";break;case exports.PasswordRuleTypes.upper:s="[A-ZÄÖÜ]{"+e.count+",}";break;default:s=e.pattern?e.pattern:""}return""!==s&&new RegExp(s).test(t.value)}return s.useEffect(function(){var e;e=[],i.forEach(function(s){v(s)||e.push(s)}),u(e)},[t.value]),s.useEffect(function(){function e(e){f(e.getModifierState&&e.getModifierState("CapsLock"))}return document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}},[]),e.jsx(e.Fragment,{children:e.jsxs("div",{children:[e.jsx(h,r({},d)),e.jsxs("div",{className:"uil-password-rules",children:[x&&e.jsx("div",{className:"uil-password-rule",children:l}),i.map(function(s,r){return e.jsxs("div",{className:"uil-password-rule",children:[e.jsx(o,{src:v(s)?a:c,height:12,width:12}),e.jsx("span",{children:s.label})]},r)})]})]})})},exports.QuestionModal=function(s){var n=r({},(function(e){if(null==e)throw new TypeError("Cannot destructure "+e)}(s),s));return e.jsx(f,r({type:x.question},n))},exports.SVG=o,exports.useOutsideClick=u;
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../src/components/images/svgIcon.tsx","../src/components/input/baseInput.tsx","../src/components/input/textInput.tsx"],"sourcesContent":["import React, {CSSProperties} from 'react';\nimport './images.scss';\n\ninterface ISvgIcon {\n src: string;\n color?: string;\n height?: number;\n width?: number;\n}\n\nexport function SVG(props: ISvgIcon) {\n const {\n src,\n color,\n height,\n width\n } = props;\n\n if (!src.includes('.svg')) {\n throw new Error('Provided src is not an svg image')\n }\n\n const style: CSSProperties = {\n fill: color,\n height: `${height}px`,\n width: `${width}px`\n }\n\n return (\n <svg aria-hidden={true} className={'uil-svg'} style={style}>\n <use href={src}/>\n </svg>\n );\n}","import React, {ComponentPropsWithoutRef} from \"react\";\nimport {SVG} from \"../images/svgIcon\";\nimport './input.scss';\n\nexport interface IBaseInput extends ComponentPropsWithoutRef<'input'> {\n label : string;\n value : string;\n valueChanged: (value: string) => void;\n iconColor? : string;\n iconSrc? : string;\n inputColor? : string;\n}\n\nexport function BaseInput(props: IBaseInput) {\n const {\n label,\n valueChanged,\n iconColor,\n iconSrc,\n inputColor,\n ...inputProps\n } = props;\n\n return (\n <label className={'uil-input-wrapper'}>\n <input\n className={'uil-input'}\n onChange={(e) => valueChanged(e.target.value)}\n placeholder={label}\n style={{color: inputColor}}\n {...inputProps}\n />\n\n {iconSrc &&\n <div className={'uil-icon'}>\n <SVG src={iconSrc} width={24} height={24} color={iconColor}/>\n </div>\n }\n\n <span className={'uil-label'} style={{color: inputColor}}>{label}</span>\n </label>\n );\n}","import React, {useState} from 'react';\nimport {BaseInput, IBaseInput} from \"./baseInput\";\nimport {SVG} from '../images/svgIcon';\nimport './input.scss';\n\ninterface ITextInput extends IBaseInput {\n tooltipIcon?: string;\n tooltipText?: string;\n tooltipClose?: string\n}\n\nexport function TextInput(props: ITextInput) {\n const {\n tooltipIcon,\n tooltipText,\n tooltipClose,\n ...inputProps\n } = props;\n\n const [tooltipVisible, setTooltipVisible] = useState(false);\n\n function closeTooltip() {\n setTooltipVisible(false);\n }\n\n return (\n <>\n {tooltipIcon ?\n <div className={'uil-tooltip-wrapper'}>\n {tooltipVisible &&\n <div className={'uil-tooltip'} onClick={closeTooltip}>\n {tooltipClose &&\n <button className={'uil-tooltip-button'} onClick={closeTooltip}>\n {tooltipClose}\n </button>\n }\n\n <span>{tooltipText}</span>\n </div>\n }\n\n <div className={'uil-tooltip-icon'} onClick={() => setTooltipVisible(!tooltipVisible)}>\n <SVG src={tooltipIcon} height={16} width={16}/>\n </div>\n\n <BaseInput {...inputProps}/>\n </div> :\n\n <BaseInput {...inputProps}/>\n }\n </>\n );\n}"],"names":["SVG","props","src","color","height","width","includes","Error","_jsx","jsx","className","style","fill","children","href","BaseInput","label","valueChanged","iconColor","iconSrc","inputColor","inputProps","_objectWithoutPropertiesLoose","_excluded","_jsxs","onChange","e","target","value","placeholder","tooltipIcon","tooltipText","tooltipClose","_useState","useState","tooltipVisible","setTooltipVisible","closeTooltip","_Fragment","Fragment","jsxs","onClick","_extends"],"mappings":"yZAUM,SAAUA,EAAIC,GAClB,IACEC,EAIED,EAJFC,IACAC,EAGEF,EAHFE,MACAC,EAEEH,EAFFG,OACAC,EACEJ,EADFI,MAGF,IAAKH,EAAII,SAAS,QAChB,MAAU,IAAAC,MAAM,oCASlB,OACEC,EAAkBC,IAAA,MAAA,CAAA,eAAA,EAAMC,UAAW,UAAWC,MAPnB,CAC3BC,KAAMT,EACNC,OAAWA,EAAU,KACrBC,MAAUA,EAAK,MAI2CQ,SACxDL,aAAKM,KAAMZ,KAGjB,4ECpBgBa,EAAUd,GACxB,IACEe,EAMEf,EANFe,MACAC,EAKEhB,EALFgB,aACAC,EAIEjB,EAJFiB,UACAC,EAGElB,EAHFkB,QACAC,EAEEnB,EAFFmB,WACGC,EAAUC,EACXrB,EAAKsB,GAET,OACEC,OAAO,QAAA,CAAAd,UAAW,oBAAmBG,SAAA,CACnCL,iBACEE,UAAW,YACXe,SAAU,SAACC,GAAC,OAAKT,EAAaS,EAAEC,OAAOC,MAAM,EAC7CC,YAAab,EACbL,MAAO,CAACR,MAAOiB,IACXC,IAGLF,GACCX,MAAA,MAAA,CAAKE,UAAW,oBACdF,EAAAA,IAACR,GAAIE,IAAKiB,EAASd,MAAO,GAAID,OAAQ,GAAID,MAAOe,MAIrDV,EAAAC,IAAA,OAAA,CAAMC,UAAW,YAAaC,MAAO,CAACR,MAAOiB,GAAWP,SAAGG,MAGjE,oFC/BM,SAAoBf,GACxB,IACE6B,EAIE7B,EAJF6B,YACAC,EAGE9B,EAHF8B,YACAC,EAEE/B,EAFF+B,aACGX,EAAUC,EACXrB,EAAKsB,GAETU,EAA4CC,YAAS,GAA9CC,EAAcF,EAAA,GAAEG,EAAiBH,EAAA,GAExC,SAASI,IACPD,GAAkB,EACpB,CAEA,OACE5B,EAAAC,IAAA6B,EAAAC,SAAA,CAAA1B,SACGiB,EACCN,EAAAgB,KAAA,MAAA,CAAK9B,UAAW,sBAAqBG,SAAA,CAClCsB,GACCX,EAAKgB,KAAA,MAAA,CAAA9B,UAAW,cAAe+B,QAASJ,YACrCL,GACCxB,EAAAA,IAAQ,SAAA,CAAAE,UAAW,qBAAsB+B,QAASJ,EAC/CxB,SAAAmB,IAILxB,EAAAA,IAAO,OAAA,CAAAK,SAAAkB,OAIXvB,EAAAA,IAAK,MAAA,CAAAE,UAAW,mBAAoB+B,QAAS,WAAA,OAAML,GAAmBD,EAAe,EACnFtB,SAAAL,MAACR,EAAG,CAACE,IAAK4B,EAAa1B,OAAQ,GAAIC,MAAO,OAG5CG,MAACO,EAAS2B,EAAKrB,CAAAA,EAAAA,OAGjBb,EAAAC,IAACM,EAAS2B,EAAA,CAAA,EAAKrB,KAIvB"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/components/button/customButton.tsx","../src/components/images/svgIcon.tsx","../src/components/input/baseInput.tsx","../src/hooks/clickOutside.ts","../src/enums/passwordRuleTypes.ts","../src/components/input/customInput.tsx","../src/enums/ModalType.ts","../src/components/modal/baseModal.tsx","../src/components/checkbox/customCheckBox.tsx","../src/components/modal/notifyModal.tsx","../src/components/input/passwordInput.tsx","../src/components/modal/questionModal.tsx"],"sourcesContent":["import React, {ComponentPropsWithoutRef, CSSProperties} from 'react';\nimport './button.scss';\n\ninterface ICustomButton extends ComponentPropsWithoutRef<'button'> {\n label : string;\n disabled?: boolean;\n small? : boolean;\n theme? : string;\n}\n\nexport function CustomButton(props: ICustomButton) {\n const {\n disabled = false,\n label,\n small = false,\n theme,\n ...buttonProps\n } = props;\n\n function setColor(bgColor: string) {\n if (!theme || disabled) return null;\n\n const color = (bgColor.charAt(0) === '#') ? bgColor.substring(1, 7) : bgColor;\n const uiColors = [\n parseInt(color.substring(0, 2), 16) / 255,\n parseInt(color.substring(2, 4), 16) / 255,\n parseInt(color.substring(4, 6), 16) / 255\n ];\n const c = uiColors.map(col => {\n return col <= 0.03928? (col / 12.92) : Math.pow((col + 0.055) / 1.055, 2.4);\n });\n const L = (0.2126 * c[0]) + (0.7152 * c[1]) + (0.0722 * c[2]);\n\n return L > 0.179 ? '#000000' : '#ffffff';\n }\n\n const style: CSSProperties = {\n color: setColor(theme),\n backgroundColor: disabled? null : theme,\n border: theme? 'none': null,\n }\n\n return (\n <button className={`uil-button ${disabled ? 'uil-disabled' : ''} ${small ? 'uil-small' : ''}`} style={style} disabled={disabled} {...buttonProps}>\n {label}\n </button>\n );\n}","import React, {CSSProperties} from 'react';\nimport './images.scss';\n\ninterface ISvgIcon {\n src : string;\n color? : string;\n height?: number;\n width? : number;\n}\n\nexport function SVG(props: ISvgIcon) {\n const {\n src,\n color,\n height,\n width\n } = props;\n\n if (!src.includes('.svg')) {\n throw new Error('Provided src is not an svg image');\n }\n\n const style: CSSProperties = {\n fill: color,\n height: `${height}px`,\n width: `${width}px`\n }\n\n return (\n <svg aria-hidden={true} className={'uil-svg'} style={style}>\n <use href={src}/>\n </svg>\n );\n}","import React, {ComponentPropsWithoutRef} from 'react';\nimport {SVG} from 'components/images/svgIcon';\nimport './input.scss';\n\nexport interface IBaseInput extends ComponentPropsWithoutRef<'input'> {\n label : string;\n value : string;\n valueChanged: (value: string) => void;\n iconColor? : string;\n iconSrc? : string;\n inputColor? : string;\n toggle? : () => void;\n}\n\nexport function BaseInput(props: IBaseInput) {\n const {\n iconColor,\n iconSrc,\n inputColor,\n label,\n toggle,\n valueChanged,\n ...inputProps\n } = props;\n\n return (\n <label className={'uil-input-wrapper'} htmlFor={inputProps.id}>\n <input\n className={'uil-input'}\n onChange={(e) => valueChanged(e.target.value)}\n placeholder={label}\n style={{color: inputColor}}\n {...inputProps}\n />\n\n {iconSrc &&\n <div className={'uil-icon'} onClick={toggle}>\n <SVG src={iconSrc} width={24} height={24} color={iconColor}/>\n </div>\n }\n\n <span className={'uil-label'} style={{color: inputColor}}>{label}</span>\n </label>\n );\n}","import {useEffect, useRef} from 'react';\n\nexport function useOutsideClick (callback: () => void) {\n const ref = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n function handleClickOutside (event: MouseEvent | TouchEvent) {\n if (ref.current && !ref.current.contains(event.target as Node)) {\n callback();\n }\n }\n\n document.addEventListener('click', handleClickOutside);\n document.addEventListener('touchend', handleClickOutside);\n\n\n return () => {\n document.removeEventListener('click', handleClickOutside);\n document.removeEventListener('touchend', handleClickOutside);\n };\n }, [callback]);\n\n return ref;\n}","export enum PasswordRuleTypes {\n minLength,\n maxLength,\n letters,\n numbers,\n special,\n upper\n}","import React, {useState} from 'react';\nimport {BaseInput, IBaseInput} from './baseInput';\nimport {SVG} from 'components/images/svgIcon';\nimport {useOutsideClick} from 'hooks/clickOutside';\nimport './input.scss';\n\nexport interface ICustomInput extends IBaseInput {\n tooltipClose?: string;\n tooltipIcon? : string;\n tooltipText? : string;\n}\n\nexport function CustomInput(props: ICustomInput) {\n const {\n tooltipClose,\n tooltipIcon,\n tooltipText,\n ...inputProps\n } = props;\n\n const [tooltipVisible, setTooltipVisible] = useState(false);\n const ref = useOutsideClick(closeTooltip);\n\n function closeTooltip() {\n setTooltipVisible(false);\n }\n\n return (\n <>\n {tooltipIcon ?\n <div className={'uil-tooltip-wrapper'}>\n {tooltipVisible &&\n <div className={'uil-tooltip'} ref={ref}>\n {tooltipClose &&\n <button className={'uil-tooltip-button'} onClick={closeTooltip}>\n {tooltipClose}\n </button>\n }\n\n <span>{tooltipText}</span>\n </div>\n }\n\n <div className={'uil-tooltip-icon'} onClick={() => setTooltipVisible(!tooltipVisible)}>\n <SVG src={tooltipIcon} height={16} width={16}/>\n </div>\n\n <BaseInput {...inputProps}/>\n </div> :\n\n <BaseInput {...inputProps}/>\n }\n </>\n );\n}","export enum ModalType {\n error,\n question,\n success\n}","import React, {useEffect, useState} from 'react';\nimport {ModalType} from 'enums/ModalType';\nimport {CustomButton} from 'components/button';\nimport './modal.scss';\n\ninterface IBaseModal {\n message : string | string[];\n title : string;\n type : ModalType;\n cancelLabel? : string;\n closeLabel? : string;\n confirm? : () => void;\n confirmLabel?: string;\n timeout? : number;\n}\n\nexport function BaseModal(props: IBaseModal) {\n const {\n cancelLabel = '',\n closeLabel,\n confirm,\n confirmLabel = '',\n message,\n timeout,\n title,\n type\n } = props;\n\n const [visible, setVisible] = useState(true);\n\n useEffect(() => {\n if (!timeout) return;\n\n setTimeout(() => {\n setVisible(false);\n }, timeout);\n },[]);\n\n return visible ?\n <div className={'uil-modal-wrapper'}>\n <div className={'uil-modal'}>\n <div className={`uil-header ${type == ModalType.success ? 'uil-success' : ''} ${type == ModalType.error ? 'uil-error' : ''}`}>\n {title}\n </div>\n\n {timeout &&\n <div className={'uil-progress-wrapper'}>\n <div className={'uil-progress-bar'} style={{animationDuration: `${(props.timeout / 1000) + 1}s`}}/>\n </div>\n }\n\n <div className={'uil-content'}>\n <div>\n {Array.isArray(message) ?\n message.map((m, idx) =>\n <p key={idx} className={'uil-modal-text'}>{m}</p>\n ) : <p className={'uil-modal-text'}>{message}</p>\n }\n </div>\n\n <div className={`uil-button-wrapper ${type !== ModalType.question ? 'uil-single' : ''}`}>\n {type !== ModalType.question &&\n <CustomButton label={closeLabel} small={true} onClick={() => setVisible(false)} type={'button'}/>\n }\n\n {type == ModalType.question && props.confirm &&\n <>\n <CustomButton label={confirmLabel} theme={'#00416A'} small={true} onClick={() => confirm} type={'button'}/>\n <CustomButton label={cancelLabel} small={true} onClick={() => setVisible(false)} type={'button'}/>\n </>\n }\n </div>\n </div>\n </div>\n </div> : <></>;\n}","import React, {ComponentPropsWithoutRef} from 'react';\nimport './checkbox.scss';\n\ninterface ICustomCheckbox extends ComponentPropsWithoutRef<'input'> {\n checked : boolean;\n label : string;\n onCheck : (value: boolean) => void;\n checkColor? : string;\n}\n\nexport function CustomCheckBox(props: ICustomCheckbox) {\n const {\n checkColor,\n checked,\n onCheck,\n label,\n ...checkProps\n } = props;\n\n return (\n <>\n <div className={'uil-check-wrapper'}>\n <label className={'uil-checkbox'}>\n <input type={'checkbox'} checked={checked} onChange={() => {onCheck(!checked)}} {...checkProps}/>\n <div className={'uil-checkmark'} style={{backgroundColor: checkColor}}/>\n </label>\n\n <span>{label}</span>\n </div>\n </>\n );\n}","import React from 'react';\nimport {BaseModal} from './baseModal';\nimport {ModalType} from 'enums/ModalType';\n\nexport interface INotifyModal {\n closeLabel: string;\n isSuccess : boolean;\n message : string | string[];\n title : string;\n timeout? : number;\n}\n\nexport function NotifyModal(props: INotifyModal) {\n const {\n isSuccess,\n ...modalProps\n } = props;\n\n return (\n <BaseModal type={isSuccess? ModalType.success : ModalType.error} {...modalProps}/>\n );\n}","import React, {useEffect, useState} from 'react';\nimport {CustomInput, ICustomInput} from './customInput';\nimport {SVG} from 'components/images/svgIcon';\nimport {PasswordRuleTypes} from 'enums/passwordRuleTypes';\nimport './input.scss';\n\ninterface IPasswordInput extends ICustomInput {\n capsLockWarning: string;\n setFailedRules : (value: PasswordRule[]) => void;\n ruleChecked : string;\n rules : PasswordRule[];\n ruleUnchecked : string;\n}\n\nexport interface PasswordRule {\n count : number;\n label : string;\n type : PasswordRuleTypes | string;\n pattern?: string;\n}\n\nexport function PasswordInput(props: IPasswordInput) {\n const {\n capsLockWarning,\n rules,\n ruleChecked,\n ruleUnchecked,\n setFailedRules,\n ...inputProps\n } = props;\n\n const [capsLock, setCapsLock] = useState(false);\n\n useEffect(() => {\n validateInput();\n },[props.value]);\n\n useEffect(() => {\n function setCapsLockState(event: globalThis.KeyboardEvent) {\n setCapsLock(event.getModifierState && event.getModifierState('CapsLock'));\n }\n\n document.addEventListener('keydown', setCapsLockState);\n\n return () => {\n document.removeEventListener('keydown', setCapsLockState);\n };\n },[]);\n\n function validateInput() {\n const failedRules: PasswordRule[] = [];\n \n rules.forEach(rule => {\n if (!checkRule(rule)) {\n failedRules.push(rule);\n }\n });\n\n setFailedRules(failedRules);\n }\n\n function checkRule(rule: PasswordRule) {\n let pattern: string;\n\n switch (rule.type) {\n case PasswordRuleTypes.minLength:\n pattern = `[a-zA-Z0-9ßÄäÖöÜü._!\"\\`'#%&§,:;<>=@{}~\\\\$\\\\(\\\\)\\\\*\\\\+\\\\/\\\\\\\\\\\\?\\\\[\\\\]\\\\^\\\\|\\\\-]{${rule.count},}`;\n break;\n case PasswordRuleTypes.maxLength:\n pattern = `^[a-zA-Z0-9ßÄäÖöÜü._!\"\\`'#%&,:;<>=@{}~\\\\$\\\\(\\\\)\\\\*\\\\+\\\\/\\\\\\\\\\\\?\\\\[\\\\]\\\\^\\\\|\\\\-]{0,${rule.count}}$`;\n break;\n case PasswordRuleTypes.letters:\n pattern = `[a-zA-ZßÄäÖöÜü]{${rule.count},}`;\n break;\n case PasswordRuleTypes.numbers:\n pattern = `[0-9]{${rule.count},}`;\n break;\n case PasswordRuleTypes.special:\n pattern = `[._!\"\\`'#%&§,:;<>=@{}~\\\\$\\\\(\\\\)\\\\*\\\\+\\\\/\\\\\\\\\\\\?\\\\[\\\\]\\\\^\\\\|\\\\-]{${rule.count},}`;\n break;\n case PasswordRuleTypes.upper:\n pattern = `[A-ZÄÖÜ]{${rule.count},}`;\n break;\n default:\n rule.pattern? pattern = rule.pattern : pattern = '';\n }\n\n if (pattern === '') return false;\n\n const reg = new RegExp(pattern);\n return reg.test(props.value);\n }\n\n return (\n <>\n <div>\n <CustomInput {...inputProps}/>\n\n <div className={'uil-password-rules'}>\n {capsLock &&\n <div className={'uil-password-rule'}>{capsLockWarning}</div>\n }\n\n {rules.map((rule, idx) =>\n <div key={idx} className={'uil-password-rule'}>\n <SVG src={checkRule(rule)? ruleChecked : ruleUnchecked} height={12} width={12}/>\n\n <span>{rule.label}</span>\n </div>\n )}\n </div>\n </div>\n </>\n );\n}","import React from 'react';\nimport {BaseModal} from './baseModal';\nimport {ModalType} from 'enums/ModalType';\n\nexport interface IQuestionModal {\n cancelLabel : string;\n confirm : () => void;\n confirmLabel: string;\n message : string | string[];\n title : string;\n timeout? : number;\n}\n\nexport function QuestionModal(props: IQuestionModal) {\n const {\n ...modalProps\n } = props;\n\n return (\n <BaseModal type={ModalType.question} {...modalProps}/>\n );\n}"],"names":["CustomButton","props","_props$disabled","disabled","label","_props$small","small","theme","buttonProps","_objectWithoutPropertiesLoose","_excluded","style","color","bgColor","charAt","substring","c","parseInt","map","col","Math","pow","setColor","backgroundColor","border","_jsx","jsx","_extends","className","SVG","src","height","width","includes","Error","fill","children","href","BaseInput","iconColor","iconSrc","inputColor","toggle","valueChanged","inputProps","_jsxs","htmlFor","id","onChange","e","target","value","placeholder","onClick","useOutsideClick","callback","ref","useRef","useEffect","handleClickOutside","event","current","contains","document","addEventListener","removeEventListener","PasswordRuleTypes","CustomInput","tooltipClose","tooltipIcon","tooltipText","_useState","useState","tooltipVisible","setTooltipVisible","closeTooltip","_Fragment","Fragment","jsxs","ModalType","BaseModal","_props$cancelLabel","cancelLabel","closeLabel","confirm","_props$confirmLabel","confirmLabel","message","timeout","title","type","visible","setVisible","setTimeout","success","error","animationDuration","Array","isArray","m","idx","question","checkColor","checked","onCheck","checkProps","isSuccess","modalProps","capsLockWarning","rules","ruleChecked","ruleUnchecked","setFailedRules","capsLock","setCapsLock","checkRule","rule","pattern","minLength","count","maxLength","letters","numbers","special","upper","RegExp","test","failedRules","forEach","push","setCapsLockState","getModifierState","_objectDestructuringEmpty"],"mappings":"ocAUM,SAAUA,EAAaC,GAC3B,IAAAC,EAMID,EALFE,SAAAA,WAAQD,GAAQA,EAChBE,EAIEH,EAJFG,MAAKC,EAIHJ,EAHF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,IACK0G,EAAUhF,EAAA,wEAAAyG,CACXnI,GAAAA,IAEJ,OACEwB,EAAAC,IAACsD,EAASrD,EAAA,CAAC+D,KAAMX,EAAUsB,UAAcM,GAE7C"}
|
package/dist/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as e,Fragment as n,jsxs as r}from"react/jsx-runtime";import{useRef as t,useEffect as i,useState as l}from"react";function c(){return c=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var r=arguments[n];for(var t in r)({}).hasOwnProperty.call(r,t)&&(e[t]=r[t])}return e},c.apply(null,arguments)}function a(e,n){if(null==e)return{};var r={};for(var t in e)if({}.hasOwnProperty.call(e,t)){if(n.indexOf(t)>=0)continue;r[t]=e[t]}return r}var o=["disabled","label","small","theme"];function u(n){var r=n.disabled,t=void 0!==r&&r,i=n.label,l=n.small,u=void 0!==l&&l,s=n.theme,d=a(n,o),h={color:function(e){if(!s||t)return null;var n="#"===e.charAt(0)?e.substring(1,7):e,r=[parseInt(n.substring(0,2),16)/255,parseInt(n.substring(2,4),16)/255,parseInt(n.substring(4,6),16)/255].map(function(e){return e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4)});return.2126*r[0]+.7152*r[1]+.0722*r[2]>.179?"#000000":"#ffffff"}(s),backgroundColor:t?null:s,border:s?"none":null};return e("button",c({className:"uil-button "+(t?"uil-disabled":"")+" "+(u?"uil-small":""),style:h,disabled:t},d,{children:i}))}var s=["checkColor","checked","onCheck","label"];function d(t){var i=t.checkColor,l=t.checked,o=t.onCheck,u=t.label,d=a(t,s);return e(n,{children:r("div",{className:"uil-check-wrapper",children:[r("label",{className:"uil-checkbox",children:[e("input",c({type:"checkbox",checked:l,onChange:function(){o(!l)}},d)),e("div",{className:"uil-checkmark",style:{backgroundColor:i}})]}),e("span",{children:u})]})})}function h(n){var r=n.src,t=n.color,i=n.height,l=n.width;if(!r.includes(".svg"))throw new Error("Provided src is not an svg image");return e("svg",{"aria-hidden":!0,className:"uil-svg",style:{fill:t,height:i+"px",width:l+"px"},children:e("use",{href:r})})}var p=["iconColor","iconSrc","inputColor","label","toggle","valueChanged"];function m(n){var t=n.iconColor,i=n.iconSrc,l=n.inputColor,o=n.label,u=n.toggle,s=n.valueChanged,d=a(n,p);return r("label",{className:"uil-input-wrapper",htmlFor:d.id,children:[e("input",c({className:"uil-input",onChange:function(e){return s(e.target.value)},placeholder:o,style:{color:l}},d)),i&&e("div",{className:"uil-icon",onClick:u,children:e(h,{src:i,width:24,height:24,color:t})}),e("span",{className:"uil-label",style:{color:l},children:o})]})}function f(e){var n=t(null);return i(function(){function r(r){n.current&&!n.current.contains(r.target)&&e()}return document.addEventListener("click",r),document.addEventListener("touchend",r),function(){document.removeEventListener("click",r),document.removeEventListener("touchend",r)}},[e]),n}var v,b=["tooltipClose","tooltipIcon","tooltipText"];function g(t){var i=t.tooltipClose,o=t.tooltipIcon,u=t.tooltipText,s=a(t,b),d=l(!1),p=d[0],v=d[1],g=f(k);function k(){v(!1)}return e(n,{children:o?r("div",{className:"uil-tooltip-wrapper",children:[p&&r("div",{className:"uil-tooltip",ref:g,children:[i&&e("button",{className:"uil-tooltip-button",onClick:k,children:i}),e("span",{children:u})]}),e("div",{className:"uil-tooltip-icon",onClick:function(){return v(!p)},children:e(h,{src:o,height:16,width:16})}),e(m,c({},s))]}):e(m,c({},s))})}!function(e){e[e.minLength=0]="minLength",e[e.maxLength=1]="maxLength",e[e.letters=2]="letters",e[e.numbers=3]="numbers",e[e.special=4]="special",e[e.upper=5]="upper"}(v||(v={}));var k,C=["capsLockWarning","rules","ruleChecked","ruleUnchecked","setFailedRules"];function w(t){var o=t.capsLockWarning,u=t.rules,s=t.ruleChecked,d=t.ruleUnchecked,p=t.setFailedRules,m=a(t,C),f=l(!1),b=f[0],k=f[1];function w(e){var n;switch(e.type){case v.minLength:n="[a-zA-Z0-9ßÄäÖöÜü._!\"`'#%&§,:;<>=@{}~\\$\\(\\)\\*\\+\\/\\\\\\?\\[\\]\\^\\|\\-]{"+e.count+",}";break;case v.maxLength:n="^[a-zA-Z0-9ßÄäÖöÜü._!\"`'#%&,:;<>=@{}~\\$\\(\\)\\*\\+\\/\\\\\\?\\[\\]\\^\\|\\-]{0,"+e.count+"}$";break;case v.letters:n="[a-zA-ZßÄäÖöÜü]{"+e.count+",}";break;case v.numbers:n="[0-9]{"+e.count+",}";break;case v.special:n="[._!\"`'#%&§,:;<>=@{}~\\$\\(\\)\\*\\+\\/\\\\\\?\\[\\]\\^\\|\\-]{"+e.count+",}";break;case v.upper:n="[A-ZÄÖÜ]{"+e.count+",}";break;default:n=e.pattern?e.pattern:""}return""!==n&&new RegExp(n).test(t.value)}return i(function(){var e;e=[],u.forEach(function(n){w(n)||e.push(n)}),p(e)},[t.value]),i(function(){function e(e){k(e.getModifierState&&e.getModifierState("CapsLock"))}return document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}},[]),e(n,{children:r("div",{children:[e(g,c({},m)),r("div",{className:"uil-password-rules",children:[b&&e("div",{className:"uil-password-rule",children:o}),u.map(function(n,t){return r("div",{className:"uil-password-rule",children:[e(h,{src:w(n)?s:d,height:12,width:12}),e("span",{children:n.label})]},t)})]})]})})}function N(t){var c=t.cancelLabel,a=void 0===c?"":c,o=t.closeLabel,s=t.confirm,d=t.confirmLabel,h=void 0===d?"":d,p=t.message,m=t.timeout,f=t.title,v=t.type,b=l(!0),g=b[0],C=b[1];return i(function(){m&&setTimeout(function(){C(!1)},m)},[]),g?e("div",{className:"uil-modal-wrapper",children:r("div",{className:"uil-modal",children:[e("div",{className:"uil-header "+(v==k.success?"uil-success":"")+" "+(v==k.error?"uil-error":""),children:f}),m&&e("div",{className:"uil-progress-wrapper",children:e("div",{className:"uil-progress-bar",style:{animationDuration:t.timeout/1e3+1+"s"}})}),r("div",{className:"uil-content",children:[e("div",{children:Array.isArray(p)?p.map(function(n,r){return e("p",{className:"uil-modal-text",children:n},r)}):e("p",{className:"uil-modal-text",children:p})}),r("div",{className:"uil-button-wrapper "+(v!==k.question?"uil-single":""),children:[v!==k.question&&e(u,{label:o,small:!0,onClick:function(){return C(!1)},type:"button"}),v==k.question&&t.confirm&&r(n,{children:[e(u,{label:h,theme:"#00416A",small:!0,onClick:function(){return s},type:"button"}),e(u,{label:a,small:!0,onClick:function(){return C(!1)},type:"button"})]})]})]})]})}):e(n,{})}!function(e){e[e.error=0]="error",e[e.question=1]="question",e[e.success=2]="success"}(k||(k={}));var y=["isSuccess"];function L(n){var r=n.isSuccess,t=a(n,y);return e(N,c({type:r?k.success:k.error},t))}function x(n){var r=c({},(function(e){if(null==e)throw new TypeError("Cannot destructure "+e)}(n),n));return e(N,c({type:k.question},r))}export{u as CustomButton,d as CustomCheckBox,g as CustomInput,L as NotifyModal,w as PasswordInput,v as PasswordRuleTypes,x as QuestionModal,h as SVG,f as useOutsideClick};
|
|
2
2
|
//# sourceMappingURL=index.mjs.map
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../src/components/images/svgIcon.tsx","../src/components/input/baseInput.tsx","../src/components/input/textInput.tsx"],"sourcesContent":["import React, {CSSProperties} from 'react';\nimport './images.scss';\n\ninterface ISvgIcon {\n src: string;\n color?: string;\n height?: number;\n width?: number;\n}\n\nexport function SVG(props: ISvgIcon) {\n const {\n src,\n color,\n height,\n width\n } = props;\n\n if (!src.includes('.svg')) {\n throw new Error('Provided src is not an svg image')\n }\n\n const style: CSSProperties = {\n fill: color,\n height: `${height}px`,\n width: `${width}px`\n }\n\n return (\n <svg aria-hidden={true} className={'uil-svg'} style={style}>\n <use href={src}/>\n </svg>\n );\n}","import React, {ComponentPropsWithoutRef} from \"react\";\nimport {SVG} from \"../images/svgIcon\";\nimport './input.scss';\n\nexport interface IBaseInput extends ComponentPropsWithoutRef<'input'> {\n label : string;\n value : string;\n valueChanged: (value: string) => void;\n iconColor? : string;\n iconSrc? : string;\n inputColor? : string;\n}\n\nexport function BaseInput(props: IBaseInput) {\n const {\n label,\n valueChanged,\n iconColor,\n iconSrc,\n inputColor,\n ...inputProps\n } = props;\n\n return (\n <label className={'uil-input-wrapper'}>\n <input\n className={'uil-input'}\n onChange={(e) => valueChanged(e.target.value)}\n placeholder={label}\n style={{color: inputColor}}\n {...inputProps}\n />\n\n {iconSrc &&\n <div className={'uil-icon'}>\n <SVG src={iconSrc} width={24} height={24} color={iconColor}/>\n </div>\n }\n\n <span className={'uil-label'} style={{color: inputColor}}>{label}</span>\n </label>\n );\n}","import React, {useState} from 'react';\nimport {BaseInput, IBaseInput} from \"./baseInput\";\nimport {SVG} from '../images/svgIcon';\nimport './input.scss';\n\ninterface ITextInput extends IBaseInput {\n tooltipIcon?: string;\n tooltipText?: string;\n tooltipClose?: string\n}\n\nexport function TextInput(props: ITextInput) {\n const {\n tooltipIcon,\n tooltipText,\n tooltipClose,\n ...inputProps\n } = props;\n\n const [tooltipVisible, setTooltipVisible] = useState(false);\n\n function closeTooltip() {\n setTooltipVisible(false);\n }\n\n return (\n <>\n {tooltipIcon ?\n <div className={'uil-tooltip-wrapper'}>\n {tooltipVisible &&\n <div className={'uil-tooltip'} onClick={closeTooltip}>\n {tooltipClose &&\n <button className={'uil-tooltip-button'} onClick={closeTooltip}>\n {tooltipClose}\n </button>\n }\n\n <span>{tooltipText}</span>\n </div>\n }\n\n <div className={'uil-tooltip-icon'} onClick={() => setTooltipVisible(!tooltipVisible)}>\n <SVG src={tooltipIcon} height={16} width={16}/>\n </div>\n\n <BaseInput {...inputProps}/>\n </div> :\n\n <BaseInput {...inputProps}/>\n }\n </>\n );\n}"],"names":["SVG","props","src","color","height","width","includes","Error","_jsx","className","style","fill","children","href","BaseInput","label","valueChanged","iconColor","iconSrc","inputColor","inputProps","_objectWithoutPropertiesLoose","_excluded","_jsxs","onChange","e","target","value","placeholder","TextInput","tooltipIcon","tooltipText","tooltipClose","_useState","useState","tooltipVisible","setTooltipVisible","closeTooltip","_F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ASF,YACrCL,GACCxB,EAAQ,SAAA,CAAAC,UAAW,qBAAsB8B,QAASF,EAC/CzB,SAAAoB,IAILxB,EAAO,OAAA,CAAAI,SAAAmB,OAIXvB,EAAK,MAAA,CAAAC,UAAW,mBAAoB8B,QAAS,WAAA,OAAMH,GAAmBD,EAAe,EACnFvB,SAAAJ,EAACR,EAAG,CAACE,IAAK4B,EAAa1B,OAAQ,GAAIC,MAAO,OAG5CG,EAACM,EAAS0B,EAAKpB,CAAAA,EAAAA,OAGjBZ,EAACM,EAAS0B,EAAA,CAAA,EAAKpB,KAIvB"}
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../src/components/button/customButton.tsx","../src/components/checkbox/customCheckBox.tsx","../src/components/images/svgIcon.tsx","../src/components/input/baseInput.tsx","../src/hooks/clickOutside.ts","../src/enums/passwordRuleTypes.ts","../src/components/input/customInput.tsx","../src/enums/ModalType.ts","../src/components/input/passwordInput.tsx","../src/components/modal/baseModal.tsx","../src/components/modal/notifyModal.tsx","../src/components/modal/questionModal.tsx"],"sourcesContent":["import React, {ComponentPropsWithoutRef, CSSProperties} from 'react';\nimport './button.scss';\n\ninterface ICustomButton extends ComponentPropsWithoutRef<'button'> {\n label : string;\n disabled?: boolean;\n small? : boolean;\n theme? : string;\n}\n\nexport function CustomButton(props: ICustomButton) {\n const {\n disabled = false,\n label,\n small = false,\n theme,\n ...buttonProps\n } = props;\n\n function setColor(bgColor: string) {\n if (!theme || disabled) return null;\n\n const color = (bgColor.charAt(0) === '#') ? bgColor.substring(1, 7) : bgColor;\n const uiColors = [\n parseInt(color.substring(0, 2), 16) / 255,\n parseInt(color.substring(2, 4), 16) / 255,\n parseInt(color.substring(4, 6), 16) / 255\n ];\n const c = uiColors.map(col => {\n return col <= 0.03928? (col / 12.92) : Math.pow((col + 0.055) / 1.055, 2.4);\n });\n const L = (0.2126 * c[0]) + (0.7152 * c[1]) + (0.0722 * c[2]);\n\n return L > 0.179 ? '#000000' : '#ffffff';\n }\n\n const style: CSSProperties = {\n color: setColor(theme),\n backgroundColor: disabled? null : theme,\n border: theme? 'none': null,\n }\n\n return (\n <button className={`uil-button ${disabled ? 'uil-disabled' : ''} ${small ? 'uil-small' : ''}`} style={style} disabled={disabled} {...buttonProps}>\n {label}\n </button>\n );\n}","import React, {ComponentPropsWithoutRef} from 'react';\nimport './checkbox.scss';\n\ninterface ICustomCheckbox extends ComponentPropsWithoutRef<'input'> {\n checked : boolean;\n label : string;\n onCheck : (value: boolean) => void;\n checkColor? : string;\n}\n\nexport function CustomCheckBox(props: ICustomCheckbox) {\n const {\n checkColor,\n checked,\n onCheck,\n label,\n ...checkProps\n } = props;\n\n return (\n <>\n <div className={'uil-check-wrapper'}>\n <label className={'uil-checkbox'}>\n <input type={'checkbox'} checked={checked} onChange={() => {onCheck(!checked)}} {...checkProps}/>\n <div className={'uil-checkmark'} style={{backgroundColor: checkColor}}/>\n </label>\n\n <span>{label}</span>\n </div>\n </>\n );\n}","import React, {CSSProperties} from 'react';\nimport './images.scss';\n\ninterface ISvgIcon {\n src : string;\n color? : string;\n height?: number;\n width? : number;\n}\n\nexport function SVG(props: ISvgIcon) {\n const {\n src,\n color,\n height,\n width\n } = props;\n\n if (!src.includes('.svg')) {\n throw new Error('Provided src is not an svg image');\n }\n\n const style: CSSProperties = {\n fill: color,\n height: `${height}px`,\n width: `${width}px`\n }\n\n return (\n <svg aria-hidden={true} className={'uil-svg'} style={style}>\n <use href={src}/>\n </svg>\n );\n}","import React, {ComponentPropsWithoutRef} from 'react';\nimport {SVG} from 'components/images/svgIcon';\nimport './input.scss';\n\nexport interface IBaseInput extends ComponentPropsWithoutRef<'input'> {\n label : string;\n value : string;\n valueChanged: (value: string) => void;\n iconColor? : string;\n iconSrc? : string;\n inputColor? : string;\n toggle? : () => void;\n}\n\nexport function BaseInput(props: IBaseInput) {\n const {\n iconColor,\n iconSrc,\n inputColor,\n label,\n toggle,\n valueChanged,\n ...inputProps\n } = props;\n\n return (\n <label className={'uil-input-wrapper'} htmlFor={inputProps.id}>\n <input\n className={'uil-input'}\n onChange={(e) => valueChanged(e.target.value)}\n placeholder={label}\n style={{color: inputColor}}\n {...inputProps}\n />\n\n {iconSrc &&\n <div className={'uil-icon'} onClick={toggle}>\n <SVG src={iconSrc} width={24} height={24} color={iconColor}/>\n </div>\n }\n\n <span className={'uil-label'} style={{color: inputColor}}>{label}</span>\n </label>\n );\n}","import {useEffect, useRef} from 'react';\n\nexport function useOutsideClick (callback: () => void) {\n const ref = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n function handleClickOutside (event: MouseEvent | TouchEvent) {\n if (ref.current && !ref.current.contains(event.target as Node)) {\n callback();\n }\n }\n\n document.addEventListener('click', handleClickOutside);\n document.addEventListener('touchend', handleClickOutside);\n\n\n return () => {\n document.removeEventListener('click', handleClickOutside);\n document.removeEventListener('touchend', handleClickOutside);\n };\n }, [callback]);\n\n return ref;\n}","export enum PasswordRuleTypes {\n minLength,\n maxLength,\n letters,\n numbers,\n special,\n upper\n}","import React, {useState} from 'react';\nimport {BaseInput, IBaseInput} from './baseInput';\nimport {SVG} from 'components/images/svgIcon';\nimport {useOutsideClick} from 'hooks/clickOutside';\nimport './input.scss';\n\nexport interface ICustomInput extends IBaseInput {\n tooltipClose?: string;\n tooltipIcon? : string;\n tooltipText? : string;\n}\n\nexport function CustomInput(props: ICustomInput) {\n const {\n tooltipClose,\n tooltipIcon,\n tooltipText,\n ...inputProps\n } = props;\n\n const [tooltipVisible, setTooltipVisible] = useState(false);\n const ref = useOutsideClick(closeTooltip);\n\n function closeTooltip() {\n setTooltipVisible(false);\n }\n\n return (\n <>\n {tooltipIcon ?\n <div className={'uil-tooltip-wrapper'}>\n {tooltipVisible &&\n <div className={'uil-tooltip'} ref={ref}>\n {tooltipClose &&\n <button className={'uil-tooltip-button'} onClick={closeTooltip}>\n {tooltipClose}\n </button>\n }\n\n <span>{tooltipText}</span>\n </div>\n }\n\n <div className={'uil-tooltip-icon'} onClick={() => setTooltipVisible(!tooltipVisible)}>\n <SVG src={tooltipIcon} height={16} width={16}/>\n </div>\n\n <BaseInput {...inputProps}/>\n </div> :\n\n <BaseInput {...inputProps}/>\n }\n </>\n );\n}","export enum ModalType {\n error,\n question,\n success\n}","import React, {useEffect, useState} from 'react';\nimport {CustomInput, ICustomInput} from './customInput';\nimport {SVG} from 'components/images/svgIcon';\nimport {PasswordRuleTypes} from 'enums/passwordRuleTypes';\nimport './input.scss';\n\ninterface IPasswordInput extends ICustomInput {\n capsLockWarning: string;\n setFailedRules : (value: PasswordRule[]) => void;\n ruleChecked : string;\n rules : PasswordRule[];\n ruleUnchecked : string;\n}\n\nexport interface PasswordRule {\n count : number;\n label : string;\n type : PasswordRuleTypes | string;\n pattern?: string;\n}\n\nexport function PasswordInput(props: IPasswordInput) {\n const {\n capsLockWarning,\n rules,\n ruleChecked,\n ruleUnchecked,\n setFailedRules,\n ...inputProps\n } = props;\n\n const [capsLock, setCapsLock] = useState(false);\n\n useEffect(() => {\n validateInput();\n },[props.value]);\n\n useEffect(() => {\n function setCapsLockState(event: globalThis.KeyboardEvent) {\n setCapsLock(event.getModifierState && event.getModifierState('CapsLock'));\n }\n\n document.addEventListener('keydown', setCapsLockState);\n\n return () => {\n document.removeEventListener('keydown', setCapsLockState);\n };\n },[]);\n\n function validateInput() {\n const failedRules: PasswordRule[] = [];\n \n rules.forEach(rule => {\n if (!checkRule(rule)) {\n failedRules.push(rule);\n }\n });\n\n setFailedRules(failedRules);\n }\n\n function checkRule(rule: PasswordRule) {\n let pattern: string;\n\n switch (rule.type) {\n case PasswordRuleTypes.minLength:\n pattern = `[a-zA-Z0-9ßÄäÖöÜü._!\"\\`'#%&§,:;<>=@{}~\\\\$\\\\(\\\\)\\\\*\\\\+\\\\/\\\\\\\\\\\\?\\\\[\\\\]\\\\^\\\\|\\\\-]{${rule.count},}`;\n break;\n case PasswordRuleTypes.maxLength:\n pattern = `^[a-zA-Z0-9ßÄäÖöÜü._!\"\\`'#%&,:;<>=@{}~\\\\$\\\\(\\\\)\\\\*\\\\+\\\\/\\\\\\\\\\\\?\\\\[\\\\]\\\\^\\\\|\\\\-]{0,${rule.count}}$`;\n break;\n case PasswordRuleTypes.letters:\n pattern = `[a-zA-ZßÄäÖöÜü]{${rule.count},}`;\n break;\n case PasswordRuleTypes.numbers:\n pattern = `[0-9]{${rule.count},}`;\n break;\n case PasswordRuleTypes.special:\n pattern = `[._!\"\\`'#%&§,:;<>=@{}~\\\\$\\\\(\\\\)\\\\*\\\\+\\\\/\\\\\\\\\\\\?\\\\[\\\\]\\\\^\\\\|\\\\-]{${rule.count},}`;\n break;\n case PasswordRuleTypes.upper:\n pattern = `[A-ZÄÖÜ]{${rule.count},}`;\n break;\n default:\n rule.pattern? pattern = rule.pattern : pattern = '';\n }\n\n if (pattern === '') return false;\n\n const reg = new RegExp(pattern);\n return reg.test(props.value);\n }\n\n return (\n <>\n <div>\n <CustomInput {...inputProps}/>\n\n <div className={'uil-password-rules'}>\n {capsLock &&\n <div className={'uil-password-rule'}>{capsLockWarning}</div>\n }\n\n {rules.map((rule, idx) =>\n <div key={idx} className={'uil-password-rule'}>\n <SVG src={checkRule(rule)? ruleChecked : ruleUnchecked} height={12} width={12}/>\n\n <span>{rule.label}</span>\n </div>\n )}\n </div>\n </div>\n </>\n );\n}","import React, {useEffect, useState} from 'react';\nimport {ModalType} from 'enums/ModalType';\nimport {CustomButton} from 'components/button';\nimport './modal.scss';\n\ninterface IBaseModal {\n message : string | string[];\n title : string;\n type : ModalType;\n cancelLabel? : string;\n closeLabel? : string;\n confirm? : () => void;\n confirmLabel?: string;\n timeout? : number;\n}\n\nexport function BaseModal(props: IBaseModal) {\n const {\n cancelLabel = '',\n closeLabel,\n confirm,\n confirmLabel = '',\n message,\n timeout,\n title,\n type\n } = props;\n\n const [visible, setVisible] = useState(true);\n\n useEffect(() => {\n if (!timeout) return;\n\n setTimeout(() => {\n setVisible(false);\n }, timeout);\n },[]);\n\n return visible ?\n <div className={'uil-modal-wrapper'}>\n <div className={'uil-modal'}>\n <div className={`uil-header ${type == ModalType.success ? 'uil-success' : ''} ${type == ModalType.error ? 'uil-error' : ''}`}>\n {title}\n </div>\n\n {timeout &&\n <div className={'uil-progress-wrapper'}>\n <div className={'uil-progress-bar'} style={{animationDuration: `${(props.timeout / 1000) + 1}s`}}/>\n </div>\n }\n\n <div className={'uil-content'}>\n <div>\n {Array.isArray(message) ?\n message.map((m, idx) =>\n <p key={idx} className={'uil-modal-text'}>{m}</p>\n ) : <p className={'uil-modal-text'}>{message}</p>\n }\n </div>\n\n <div className={`uil-button-wrapper ${type !== ModalType.question ? 'uil-single' : ''}`}>\n {type !== ModalType.question &&\n <CustomButton label={closeLabel} small={true} onClick={() => setVisible(false)} type={'button'}/>\n }\n\n {type == ModalType.question && props.confirm &&\n <>\n <CustomButton label={confirmLabel} theme={'#00416A'} small={true} onClick={() => confirm} type={'button'}/>\n <CustomButton label={cancelLabel} small={true} onClick={() => setVisible(false)} type={'button'}/>\n </>\n }\n </div>\n </div>\n </div>\n </div> : <></>;\n}","import React from 'react';\nimport {BaseModal} from './baseModal';\nimport {ModalType} from 'enums/ModalType';\n\nexport interface INotifyModal {\n closeLabel: string;\n isSuccess : boolean;\n message : string | string[];\n title : string;\n timeout? : number;\n}\n\nexport function NotifyModal(props: INotifyModal) {\n const {\n isSuccess,\n ...modalProps\n } = props;\n\n return (\n <BaseModal type={isSuccess? ModalType.success : ModalType.error} {...modalProps}/>\n );\n}","import React from 'react';\nimport {BaseModal} from './baseModal';\nimport {ModalType} from 'enums/ModalType';\n\nexport interface IQuestionModal {\n cancelLabel : string;\n confirm : () => void;\n confirmLabel: string;\n message : string | string[];\n title : string;\n timeout? : number;\n}\n\nexport function QuestionModal(props: IQuestionModal) {\n const {\n ...modalProps\n } = props;\n\n return (\n <BaseModal type={ModalType.question} {...modalProps}/>\n );\n}"],"names":["CustomButton","props","_props$disabled","disabled","label","_props$small","small","theme","buttonProps","_objectWithoutPropertiesLoose","_excluded","style","color","bgColor","charAt","substring","c","parseInt","map","col","Math","pow","setColor","backgroundColor","border","_jsx","_extends","className","CustomCheckBox","checkColor","checked","onCheck","checkProps","_Fragment","children","_jsxs","type","onChange","SVG","src","height","width","includes","Error","fill","href","BaseInput","iconColor","iconSrc","inputColor","toggle","valueChanged","inputProps","htmlFor","id","e","target","value","placeholder","onClick","useOutsideClick","callback","ref","useRef","useEffect","handleClickOutside","event","current","contains","document","addEventListener","removeEventListener","PasswordRuleTypes","CustomInput","tooltipClose","tooltipIcon","tooltipText","_useState","useState","tooltipVisible","setTooltipVisible","closeTooltip","ModalType","PasswordInput","capsLockWarning","rules","ruleChecked","ruleUnchecked","setFailedRules","capsLock","setCapsLock","checkRule","rule","pattern","minLength","count","maxLength","letters","numbers","special","upper","RegExp","test","failedRules","forEach","push","setCapsLockState","getModifierState","idx","BaseModal","_props$cancelLabel","cancelLabel","closeLabel","confirm","_props$confirmLabel","confirmLabel","message","timeout","title","visible","setVisible","setTimeout","success","error","animationDuration","Array","isArray","m","question","NotifyModal","isSuccess","modalProps","QuestionModal","_objectDestructuringEmpty"],"mappings":"0gBAUM,SAAUA,EAAaC,GAC3B,IAAAC,EAMID,EALFE,SAAAA,WAAQD,GAAQA,EAChBE,EAIEH,EAJFG,MAAKC,EAIHJ,EAHFK,MAAAA,OAAQ,IAAHD,GAAQA,EACbE,EAEEN,EAFFM,MACGC,EAAWC,EACZR,EAAKS,GAmBHC,EAAuB,CAC3BC,MAlBF,SAAkBC,GAChB,IAAKN,GAASJ,EAAU,OAAW,KAEnC,IAAMS,EAA+B,MAAtBC,EAAQC,OAAO,GAAcD,EAAQE,UAAU,EAAG,GAAKF,EAMhEG,EALW,CACfC,SAASL,EAAMG,UAAU,EAAG,GAAI,IAAM,IACtCE,SAASL,EAAMG,UAAU,EAAG,GAAI,IAAM,IACtCE,SAASL,EAAMG,UAAU,EAAG,GAAI,IAAM,KAErBG,IAAI,SAAAC,GACrB,OAAOA,GAAO,OAAUA,EAAM,MAASC,KAAKC,KAA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,GAAW,EAAM,EAAEpF,KAAM,yBAM1FX,OACb,EF3EA,SAAYyD,GACVA,EAAAA,EAAA,MAAA,GAAA,QACAA,EAAAA,EAAA,SAAA,GAAA,WACAA,EAAAA,EAAA,QAAA,GAAA,SACD,CAJD,CAAYA,IAAAA,EAIX,CAAA,wBGQe,SAAA+C,EAAYhI,GAC1B,IACEiI,EAEEjI,EAFFiI,UACGC,EAAU1H,EACXR,EAAKS,GAET,OACEe,EAACoF,EAASnF,EAACU,CAAAA,KAAM8F,EAAWhD,EAAUwC,QAAUxC,EAAUyC,OAAWQ,GAEzE,CCRM,SAAUC,EAAcnI,GAC5B,IACKkI,EAAUzG,EAAA,wEAAA2G,CACXpI,GAAAA,IAEJ,OACEwB,EAACoF,EAASnF,EAAA,CAACU,KAAM8C,EAAU8C,UAAcG,GAE7C"}
|
package/dist/index.modern.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as e,Fragment as n,jsxs as t}from"react/jsx-runtime";import{useRef as l,useEffect as r,useState as c}from"react";function i(){return i=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var l in t)({}).hasOwnProperty.call(t,l)&&(e[l]=t[l])}return e},i.apply(null,arguments)}function s(e,n){if(null==e)return{};var t={};for(var l in e)if({}.hasOwnProperty.call(e,l)){if(n.indexOf(l)>=0)continue;t[l]=e[l]}return t}const o=["disabled","label","small","theme"];function a(n){const{disabled:t=!1,label:l,small:r=!1,theme:c}=n,a=s(n,o),u={color:function(e){if(!c||t)return null;const n="#"===e.charAt(0)?e.substring(1,7):e,l=[parseInt(n.substring(0,2),16)/255,parseInt(n.substring(2,4),16)/255,parseInt(n.substring(4,6),16)/255].map(e=>e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4));return.2126*l[0]+.7152*l[1]+.0722*l[2]>.179?"#000000":"#ffffff"}(c),backgroundColor:t?null:c,border:c?"none":null};return e("button",i({className:`uil-button ${t?"uil-disabled":""} ${r?"uil-small":""}`,style:u,disabled:t},a,{children:l}))}const u=["checkColor","checked","onCheck","label"];function d(l){const{checkColor:r,checked:c,onCheck:o,label:a}=l,d=s(l,u);return e(n,{children:t("div",{className:"uil-check-wrapper",children:[t("label",{className:"uil-checkbox",children:[e("input",i({type:"checkbox",checked:c,onChange:()=>{o(!c)}},d)),e("div",{className:"uil-checkmark",style:{backgroundColor:r}})]}),e("span",{children:a})]})})}function h(n){const{src:t,color:l,height:r,width:c}=n;if(!t.includes(".svg"))throw new Error("Provided src is not an svg image");return e("svg",{"aria-hidden":!0,className:"uil-svg",style:{fill:l,height:`${r}px`,width:`${c}px`},children:e("use",{href:t})})}const p=["iconColor","iconSrc","inputColor","label","toggle","valueChanged"];function m(n){const{iconColor:l,iconSrc:r,inputColor:c,label:o,toggle:a,valueChanged:u}=n,d=s(n,p);return t("label",{className:"uil-input-wrapper",htmlFor:d.id,children:[e("input",i({className:"uil-input",onChange:e=>u(e.target.value),placeholder:o,style:{color:c}},d)),r&&e("div",{className:"uil-icon",onClick:a,children:e(h,{src:r,width:24,height:24,color:l})}),e("span",{className:"uil-label",style:{color:c},children:o})]})}function b(e){const n=l(null);return r(()=>{function t(t){n.current&&!n.current.contains(t.target)&&e()}return document.addEventListener("click",t),document.addEventListener("touchend",t),()=>{document.removeEventListener("click",t),document.removeEventListener("touchend",t)}},[e]),n}const f=["tooltipClose","tooltipIcon","tooltipText"];function g(l){const{tooltipClose:r,tooltipIcon:o,tooltipText:a}=l,u=s(l,f),[d,p]=c(!1),g=b(v);function v(){p(!1)}return e(n,{children:o?t("div",{className:"uil-tooltip-wrapper",children:[d&&t("div",{className:"uil-tooltip",ref:g,children:[r&&e("button",{className:"uil-tooltip-button",onClick:v,children:r}),e("span",{children:a})]}),e("div",{className:"uil-tooltip-icon",onClick:()=>p(!d),children:e(h,{src:o,height:16,width:16})}),e(m,i({},u))]}):e(m,i({},u))})}var v;!function(e){e[e.minLength=0]="minLength",e[e.maxLength=1]="maxLength",e[e.letters=2]="letters",e[e.numbers=3]="numbers",e[e.special=4]="special",e[e.upper=5]="upper"}(v||(v={}));const k=["capsLockWarning","rules","ruleChecked","ruleUnchecked","setFailedRules"];function C(l){const{capsLockWarning:o,rules:a,ruleChecked:u,ruleUnchecked:d,setFailedRules:p}=l,m=s(l,k),[b,f]=c(!1);function C(e){let n;switch(e.type){case v.minLength:n=`[a-zA-Z0-9ßÄäÖöÜü._!"\`'#%&§,:;<>=@{}~\\$\\(\\)\\*\\+\\/\\\\\\?\\[\\]\\^\\|\\-]{${e.count},}`;break;case v.maxLength:n=`^[a-zA-Z0-9ßÄäÖöÜü._!"\`'#%&,:;<>=@{}~\\$\\(\\)\\*\\+\\/\\\\\\?\\[\\]\\^\\|\\-]{0,${e.count}}$`;break;case v.letters:n=`[a-zA-ZßÄäÖöÜü]{${e.count},}`;break;case v.numbers:n=`[0-9]{${e.count},}`;break;case v.special:n=`[._!"\`'#%&§,:;<>=@{}~\\$\\(\\)\\*\\+\\/\\\\\\?\\[\\]\\^\\|\\-]{${e.count},}`;break;case v.upper:n=`[A-ZÄÖÜ]{${e.count},}`;break;default:n=e.pattern?e.pattern:""}return""!==n&&new RegExp(n).test(l.value)}return r(()=>{!function(){const e=[];a.forEach(n=>{C(n)||e.push(n)}),p(e)}()},[l.value]),r(()=>{function e(e){f(e.getModifierState&&e.getModifierState("CapsLock"))}return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}},[]),e(n,{children:t("div",{children:[e(g,i({},m)),t("div",{className:"uil-password-rules",children:[b&&e("div",{className:"uil-password-rule",children:o}),a.map((n,l)=>t("div",{className:"uil-password-rule",children:[e(h,{src:C(n)?u:d,height:12,width:12}),e("span",{children:n.label})]},l))]})]})})}var w;function N(l){const{cancelLabel:i="",closeLabel:s,confirm:o,confirmLabel:u="",message:d,timeout:h,title:p,type:m}=l,[b,f]=c(!0);return r(()=>{h&&setTimeout(()=>{f(!1)},h)},[]),b?e("div",{className:"uil-modal-wrapper",children:t("div",{className:"uil-modal",children:[e("div",{className:`uil-header ${m==w.success?"uil-success":""} ${m==w.error?"uil-error":""}`,children:p}),h&&e("div",{className:"uil-progress-wrapper",children:e("div",{className:"uil-progress-bar",style:{animationDuration:l.timeout/1e3+1+"s"}})}),t("div",{className:"uil-content",children:[e("div",{children:Array.isArray(d)?d.map((n,t)=>e("p",{className:"uil-modal-text",children:n},t)):e("p",{className:"uil-modal-text",children:d})}),t("div",{className:"uil-button-wrapper "+(m!==w.question?"uil-single":""),children:[m!==w.question&&e(a,{label:s,small:!0,onClick:()=>f(!1),type:"button"}),m==w.question&&l.confirm&&t(n,{children:[e(a,{label:u,theme:"#00416A",small:!0,onClick:()=>o,type:"button"}),e(a,{label:i,small:!0,onClick:()=>f(!1),type:"button"})]})]})]})]})}):e(n,{})}!function(e){e[e.error=0]="error",e[e.question=1]="question",e[e.success=2]="success"}(w||(w={}));const y=["isSuccess"];function L(n){const{isSuccess:t}=n,l=s(n,y);return e(N,i({type:t?w.success:w.error},l))}function $(n){const t=i({},(function(e){if(null==e)throw new TypeError("Cannot destructure "+e)}(n),n));return e(N,i({type:w.question},t))}export{a as CustomButton,d as CustomCheckBox,g as CustomInput,L as NotifyModal,C as PasswordInput,v as PasswordRuleTypes,$ as QuestionModal,h as SVG,b as useOutsideClick};
|
|
2
2
|
//# sourceMappingURL=index.modern.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.modern.mjs","sources":["../src/components/images/svgIcon.tsx","../src/components/input/baseInput.tsx","../src/components/input/textInput.tsx"],"sourcesContent":["import React, {CSSProperties} from 'react';\nimport './images.scss';\n\ninterface ISvgIcon {\n src: string;\n color?: string;\n height?: number;\n width?: number;\n}\n\nexport function SVG(props: ISvgIcon) {\n const {\n src,\n color,\n height,\n width\n } = props;\n\n if (!src.includes('.svg')) {\n throw new Error('Provided src is not an svg image')\n }\n\n const style: CSSProperties = {\n fill: color,\n height: `${height}px`,\n width: `${width}px`\n }\n\n return (\n <svg aria-hidden={true} className={'uil-svg'} style={style}>\n <use href={src}/>\n </svg>\n );\n}","import React, {ComponentPropsWithoutRef} from \"react\";\nimport {SVG} from \"../images/svgIcon\";\nimport './input.scss';\n\nexport interface IBaseInput extends ComponentPropsWithoutRef<'input'> {\n label : string;\n value : string;\n valueChanged: (value: string) => void;\n iconColor? : string;\n iconSrc? : string;\n inputColor? : string;\n}\n\nexport function BaseInput(props: IBaseInput) {\n const {\n label,\n valueChanged,\n iconColor,\n iconSrc,\n inputColor,\n ...inputProps\n } = props;\n\n return (\n <label className={'uil-input-wrapper'}>\n <input\n className={'uil-input'}\n onChange={(e) => valueChanged(e.target.value)}\n placeholder={label}\n style={{color: inputColor}}\n {...inputProps}\n />\n\n {iconSrc &&\n <div className={'uil-icon'}>\n <SVG src={iconSrc} width={24} height={24} color={iconColor}/>\n </div>\n }\n\n <span className={'uil-label'} style={{color: inputColor}}>{label}</span>\n </label>\n );\n}","import React, {useState} from 'react';\nimport {BaseInput, IBaseInput} from \"./baseInput\";\nimport {SVG} from '../images/svgIcon';\nimport './input.scss';\n\ninterface ITextInput extends IBaseInput {\n tooltipIcon?: string;\n tooltipText?: string;\n tooltipClose?: string\n}\n\nexport function TextInput(props: ITextInput) {\n const {\n tooltipIcon,\n tooltipText,\n tooltipClose,\n ...inputProps\n } = props;\n\n const [tooltipVisible, setTooltipVisible] = useState(false);\n\n function closeTooltip() {\n setTooltipVisible(false);\n }\n\n return (\n <>\n {tooltipIcon ?\n <div className={'uil-tooltip-wrapper'}>\n {tooltipVisible &&\n <div className={'uil-tooltip'} onClick={closeTooltip}>\n {tooltipClose &&\n <button className={'uil-tooltip-button'} onClick={closeTooltip}>\n {tooltipClose}\n </button>\n }\n\n <span>{tooltipText}</span>\n </div>\n }\n\n <div className={'uil-tooltip-icon'} onClick={() => setTooltipVisible(!tooltipVisible)}>\n <SVG src={tooltipIcon} height={16} width={16}/>\n </div>\n\n <BaseInput {...inputProps}/>\n </div> :\n\n <BaseInput {...inputProps}/>\n }\n </>\n );\n}"],"names":["SVG","props","src","color","height","width","includes","Error","_jsx","className","style","fill","children","href","BaseInput","label","valueChanged","iconColor","iconSrc","inputColor","inputProps","_objectWithoutPropertiesLoose","_excluded","_jsxs","onChange","e","target","value","placeholder","TextInput","tooltipIcon","tooltipText","tooltipClose","tooltipVisible","setTooltipVisible","useState","closeTooltip","_Fragment","onClick","_extends"],"mappings":"6cAUgBA,EAAIC,GAClB,MAAMC,IACJA,EAAGC,MACHA,EAAKC,OACLA,EAAMC,MACNA,GACEJ,EAEJ,IAAKC,EAAII,SAAS,QAChB,MAAU,IAAAC,MAAM,oCASlB,OACEC,EAAkB,MAAA,CAAA,eAAA,EAAMC,UAAW,UAAWC,MAPnB,CAC3BC,KAAMR,EACNC,OAAQ,GAAGA,MACXC,MAAO,GAAGA,OAIgDO,SACxDJ,SAAKK,KAAMX,KAGjB,8ECpBgBY,EAAUb,GACxB,MAAMc,MACJA,EAAKC,aACLA,EAAYC,UACZA,EAASC,QACTA,EAAOC,WACPA,GAEElB,EADCmB,EAAUC,EACXpB,EAAKqB,GAET,OACEC,EAAO,QAAA,CAAAd,UAAW,oBAAmBG,SAAA,CACnCJ,YACEC,CAAAA,UAAW,YACXe,SAAWC,GAAMT,EAAaS,EAAEC,OAAOC,OACvCC,YAAab,EACbL,MAAO,CAACP,MAAOgB,IACXC,IAGLF,GACCV,EAAA,MAAA,CAAKC,UAAW,oBACdD,EAACR,GAAIE,IAAKgB,EAASb,MAAO,GAAID,OAAQ,GAAID,MAAOc,MAIrDT,EAAA,OAAA,CAAMC,UAAW,YAAaC,MAAO,CAACP,MAAOgB,GAAWP,SAAGG,MAGjE,sDC/BgB,SAAAc,EAAU5B,GACxB,MAAM6B,YACJA,EAAWC,YACXA,EAAWC,aACXA,GAEE/B,EADCmB,EAAUC,EACXpB,EAAKqB,IAEFW,EAAgBC,GAAqBC,GAAS,GAErD,SAASC,IACPF,GAAkB,EACpB,CAEA,OACE1B,EAAA6B,EAAA,CAAAzB,SACGkB,EACCP,EAAA,MAAA,CAAKd,UAAW,sBAAqBG,SAAA,CAClCqB,GACCV,EAAK,MAAA,CAAAd,UAAW,cAAe6B,QAASF,YACrCJ,GACCxB,EAAQ,SAAA,CAAAC,UAAW,qBAAsB6B,QAASF,EAC/CxB,SAAAoB,IAILxB,EAAO,OAAA,CAAAI,SAAAmB,OAIXvB,EAAK,MAAA,CAAAC,UAAW,mBAAoB6B,QAASA,IAAMJ,GAAmBD,GACpErB,SAAAJ,EAACR,EAAG,CAACE,IAAK4B,EAAa1B,OAAQ,GAAIC,MAAO,OAG5CG,EAACM,EAASyB,EAAA,GAAKnB,OAGjBZ,EAACM,EAASyB,EAAA,CAAA,EAAKnB,KAIvB"}
|
|
1
|
+
{"version":3,"file":"index.modern.mjs","sources":["../src/components/button/customButton.tsx","../src/components/checkbox/customCheckBox.tsx","../src/components/images/svgIcon.tsx","../src/components/input/baseInput.tsx","../src/hooks/clickOutside.ts","../src/components/input/customInput.tsx","../src/enums/passwordRuleTypes.ts","../src/components/input/passwordInput.tsx","../src/enums/ModalType.ts","../src/components/modal/baseModal.tsx","../src/components/modal/notifyModal.tsx","../src/components/modal/questionModal.tsx"],"sourcesContent":["import React, {ComponentPropsWithoutRef, CSSProperties} from 'react';\nimport './button.scss';\n\ninterface ICustomButton extends ComponentPropsWithoutRef<'button'> {\n label : string;\n disabled?: boolean;\n small? : boolean;\n theme? : string;\n}\n\nexport function CustomButton(props: ICustomButton) {\n const {\n disabled = false,\n label,\n small = false,\n theme,\n ...buttonProps\n } = props;\n\n function setColor(bgColor: string) {\n if (!theme || disabled) return null;\n\n const color = (bgColor.charAt(0) === '#') ? bgColor.substring(1, 7) : bgColor;\n const uiColors = [\n parseInt(color.substring(0, 2), 16) / 255,\n parseInt(color.substring(2, 4), 16) / 255,\n parseInt(color.substring(4, 6), 16) / 255\n ];\n const c = uiColors.map(col => {\n return col <= 0.03928? (col / 12.92) : Math.pow((col + 0.055) / 1.055, 2.4);\n });\n const L = (0.2126 * c[0]) + (0.7152 * c[1]) + (0.0722 * c[2]);\n\n return L > 0.179 ? '#000000' : '#ffffff';\n }\n\n const style: CSSProperties = {\n color: setColor(theme),\n backgroundColor: disabled? null : theme,\n border: theme? 'none': null,\n }\n\n return (\n <button className={`uil-button ${disabled ? 'uil-disabled' : ''} ${small ? 'uil-small' : ''}`} style={style} disabled={disabled} {...buttonProps}>\n {label}\n </button>\n );\n}","import React, {ComponentPropsWithoutRef} from 'react';\nimport './checkbox.scss';\n\ninterface ICustomCheckbox extends ComponentPropsWithoutRef<'input'> {\n checked : boolean;\n label : string;\n onCheck : (value: boolean) => void;\n checkColor? : string;\n}\n\nexport function CustomCheckBox(props: ICustomCheckbox) {\n const {\n checkColor,\n checked,\n onCheck,\n label,\n ...checkProps\n } = props;\n\n return (\n <>\n <div className={'uil-check-wrapper'}>\n <label className={'uil-checkbox'}>\n <input type={'checkbox'} checked={checked} onChange={() => {onCheck(!checked)}} {...checkProps}/>\n <div className={'uil-checkmark'} style={{backgroundColor: checkColor}}/>\n </label>\n\n <span>{label}</span>\n </div>\n </>\n );\n}","import React, {CSSProperties} from 'react';\nimport './images.scss';\n\ninterface ISvgIcon {\n src : string;\n color? : string;\n height?: number;\n width? : number;\n}\n\nexport function SVG(props: ISvgIcon) {\n const {\n src,\n color,\n height,\n width\n } = props;\n\n if (!src.includes('.svg')) {\n throw new Error('Provided src is not an svg image');\n }\n\n const style: CSSProperties = {\n fill: color,\n height: `${height}px`,\n width: `${width}px`\n }\n\n return (\n <svg aria-hidden={true} className={'uil-svg'} style={style}>\n <use href={src}/>\n </svg>\n );\n}","import React, {ComponentPropsWithoutRef} from 'react';\nimport {SVG} from 'components/images/svgIcon';\nimport './input.scss';\n\nexport interface IBaseInput extends ComponentPropsWithoutRef<'input'> {\n label : string;\n value : string;\n valueChanged: (value: string) => void;\n iconColor? : string;\n iconSrc? : string;\n inputColor? : string;\n toggle? : () => void;\n}\n\nexport function BaseInput(props: IBaseInput) {\n const {\n iconColor,\n iconSrc,\n inputColor,\n label,\n toggle,\n valueChanged,\n ...inputProps\n } = props;\n\n return (\n <label className={'uil-input-wrapper'} htmlFor={inputProps.id}>\n <input\n className={'uil-input'}\n onChange={(e) => valueChanged(e.target.value)}\n placeholder={label}\n style={{color: inputColor}}\n {...inputProps}\n />\n\n {iconSrc &&\n <div className={'uil-icon'} onClick={toggle}>\n <SVG src={iconSrc} width={24} height={24} color={iconColor}/>\n </div>\n }\n\n <span className={'uil-label'} style={{color: inputColor}}>{label}</span>\n </label>\n );\n}","import {useEffect, useRef} from 'react';\n\nexport function useOutsideClick (callback: () => void) {\n const ref = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n function handleClickOutside (event: MouseEvent | TouchEvent) {\n if (ref.current && !ref.current.contains(event.target as Node)) {\n callback();\n }\n }\n\n document.addEventListener('click', handleClickOutside);\n document.addEventListener('touchend', handleClickOutside);\n\n\n return () => {\n document.removeEventListener('click', handleClickOutside);\n document.removeEventListener('touchend', handleClickOutside);\n };\n }, [callback]);\n\n return ref;\n}","import React, {useState} from 'react';\nimport {BaseInput, IBaseInput} from './baseInput';\nimport {SVG} from 'components/images/svgIcon';\nimport {useOutsideClick} from 'hooks/clickOutside';\nimport './input.scss';\n\nexport interface ICustomInput extends IBaseInput {\n tooltipClose?: string;\n tooltipIcon? : string;\n tooltipText? : string;\n}\n\nexport function CustomInput(props: ICustomInput) {\n const {\n tooltipClose,\n tooltipIcon,\n tooltipText,\n ...inputProps\n } = props;\n\n const [tooltipVisible, setTooltipVisible] = useState(false);\n const ref = useOutsideClick(closeTooltip);\n\n function closeTooltip() {\n setTooltipVisible(false);\n }\n\n return (\n <>\n {tooltipIcon ?\n <div className={'uil-tooltip-wrapper'}>\n {tooltipVisible &&\n <div className={'uil-tooltip'} ref={ref}>\n {tooltipClose &&\n <button className={'uil-tooltip-button'} onClick={closeTooltip}>\n {tooltipClose}\n </button>\n }\n\n <span>{tooltipText}</span>\n </div>\n }\n\n <div className={'uil-tooltip-icon'} onClick={() => setTooltipVisible(!tooltipVisible)}>\n <SVG src={tooltipIcon} height={16} width={16}/>\n </div>\n\n <BaseInput {...inputProps}/>\n </div> :\n\n <BaseInput {...inputProps}/>\n }\n </>\n );\n}","export enum PasswordRuleTypes {\n minLength,\n maxLength,\n letters,\n numbers,\n special,\n upper\n}","import React, {useEffect, useState} from 'react';\nimport {CustomInput, ICustomInput} from './customInput';\nimport {SVG} from 'components/images/svgIcon';\nimport {PasswordRuleTypes} from 'enums/passwordRuleTypes';\nimport './input.scss';\n\ninterface IPasswordInput extends ICustomInput {\n capsLockWarning: string;\n setFailedRules : (value: PasswordRule[]) => void;\n ruleChecked : string;\n rules : PasswordRule[];\n ruleUnchecked : string;\n}\n\nexport interface PasswordRule {\n count : number;\n label : string;\n type : PasswordRuleTypes | string;\n pattern?: string;\n}\n\nexport function PasswordInput(props: IPasswordInput) {\n const {\n capsLockWarning,\n rules,\n ruleChecked,\n ruleUnchecked,\n setFailedRules,\n ...inputProps\n } = props;\n\n const [capsLock, setCapsLock] = useState(false);\n\n useEffect(() => {\n validateInput();\n },[props.value]);\n\n useEffect(() => {\n function setCapsLockState(event: globalThis.KeyboardEvent) {\n setCapsLock(event.getModifierState && event.getModifierState('CapsLock'));\n }\n\n document.addEventListener('keydown', setCapsLockState);\n\n return () => {\n document.removeEventListener('keydown', setCapsLockState);\n };\n },[]);\n\n function validateInput() {\n const failedRules: PasswordRule[] = [];\n \n rules.forEach(rule => {\n if (!checkRule(rule)) {\n failedRules.push(rule);\n }\n });\n\n setFailedRules(failedRules);\n }\n\n function checkRule(rule: PasswordRule) {\n let pattern: string;\n\n switch (rule.type) {\n case PasswordRuleTypes.minLength:\n pattern = `[a-zA-Z0-9ßÄäÖöÜü._!\"\\`'#%&§,:;<>=@{}~\\\\$\\\\(\\\\)\\\\*\\\\+\\\\/\\\\\\\\\\\\?\\\\[\\\\]\\\\^\\\\|\\\\-]{${rule.count},}`;\n break;\n case PasswordRuleTypes.maxLength:\n pattern = `^[a-zA-Z0-9ßÄäÖöÜü._!\"\\`'#%&,:;<>=@{}~\\\\$\\\\(\\\\)\\\\*\\\\+\\\\/\\\\\\\\\\\\?\\\\[\\\\]\\\\^\\\\|\\\\-]{0,${rule.count}}$`;\n break;\n case PasswordRuleTypes.letters:\n pattern = `[a-zA-ZßÄäÖöÜü]{${rule.count},}`;\n break;\n case PasswordRuleTypes.numbers:\n pattern = `[0-9]{${rule.count},}`;\n break;\n case PasswordRuleTypes.special:\n pattern = `[._!\"\\`'#%&§,:;<>=@{}~\\\\$\\\\(\\\\)\\\\*\\\\+\\\\/\\\\\\\\\\\\?\\\\[\\\\]\\\\^\\\\|\\\\-]{${rule.count},}`;\n break;\n case PasswordRuleTypes.upper:\n pattern = `[A-ZÄÖÜ]{${rule.count},}`;\n break;\n default:\n rule.pattern? pattern = rule.pattern : pattern = '';\n }\n\n if (pattern === '') return false;\n\n const reg = new RegExp(pattern);\n return reg.test(props.value);\n }\n\n return (\n <>\n <div>\n <CustomInput {...inputProps}/>\n\n <div className={'uil-password-rules'}>\n {capsLock &&\n <div className={'uil-password-rule'}>{capsLockWarning}</div>\n }\n\n {rules.map((rule, idx) =>\n <div key={idx} className={'uil-password-rule'}>\n <SVG src={checkRule(rule)? ruleChecked : ruleUnchecked} height={12} width={12}/>\n\n <span>{rule.label}</span>\n </div>\n )}\n </div>\n </div>\n </>\n );\n}","export enum ModalType {\n error,\n question,\n success\n}","import React, {useEffect, useState} from 'react';\nimport {ModalType} from 'enums/ModalType';\nimport {CustomButton} from 'components/button';\nimport './modal.scss';\n\ninterface IBaseModal {\n message : string | string[];\n title : string;\n type : ModalType;\n cancelLabel? : string;\n closeLabel? : string;\n confirm? : () => void;\n confirmLabel?: string;\n timeout? : number;\n}\n\nexport function BaseModal(props: IBaseModal) {\n const {\n cancelLabel = '',\n closeLabel,\n confirm,\n confirmLabel = '',\n message,\n timeout,\n title,\n type\n } = props;\n\n const [visible, setVisible] = useState(true);\n\n useEffect(() => {\n if (!timeout) return;\n\n setTimeout(() => {\n setVisible(false);\n }, timeout);\n },[]);\n\n return visible ?\n <div className={'uil-modal-wrapper'}>\n <div className={'uil-modal'}>\n <div className={`uil-header ${type == ModalType.success ? 'uil-success' : ''} ${type == ModalType.error ? 'uil-error' : ''}`}>\n {title}\n </div>\n\n {timeout &&\n <div className={'uil-progress-wrapper'}>\n <div className={'uil-progress-bar'} style={{animationDuration: `${(props.timeout / 1000) + 1}s`}}/>\n </div>\n }\n\n <div className={'uil-content'}>\n <div>\n {Array.isArray(message) ?\n message.map((m, idx) =>\n <p key={idx} className={'uil-modal-text'}>{m}</p>\n ) : <p className={'uil-modal-text'}>{message}</p>\n }\n </div>\n\n <div className={`uil-button-wrapper ${type !== ModalType.question ? 'uil-single' : ''}`}>\n {type !== ModalType.question &&\n <CustomButton label={closeLabel} small={true} onClick={() => setVisible(false)} type={'button'}/>\n }\n\n {type == ModalType.question && props.confirm &&\n <>\n <CustomButton label={confirmLabel} theme={'#00416A'} small={true} onClick={() => confirm} type={'button'}/>\n <CustomButton label={cancelLabel} small={true} onClick={() => setVisible(false)} type={'button'}/>\n </>\n }\n </div>\n </div>\n </div>\n </div> : <></>;\n}","import React from 'react';\nimport {BaseModal} from './baseModal';\nimport {ModalType} from 'enums/ModalType';\n\nexport interface INotifyModal {\n closeLabel: string;\n isSuccess : boolean;\n message : string | string[];\n title : string;\n timeout? : number;\n}\n\nexport function NotifyModal(props: INotifyModal) {\n const {\n isSuccess,\n ...modalProps\n } = props;\n\n return (\n <BaseModal type={isSuccess? ModalType.success : ModalType.error} {...modalProps}/>\n );\n}","import React from 'react';\nimport {BaseModal} from './baseModal';\nimport {ModalType} from 'enums/ModalType';\n\nexport interface IQuestionModal {\n cancelLabel : string;\n confirm : () => void;\n confirmLabel: string;\n message : string | string[];\n title : string;\n timeout? : number;\n}\n\nexport function QuestionModal(props: IQuestionModal) {\n const {\n ...modalProps\n } = props;\n\n return (\n <BaseModal type={ModalType.question} {...modalProps}/>\n );\n}"],"names":["CustomButton","props","disabled","label","small","theme","buttonProps","_objectWithoutPropertiesLoose","_excluded","style","color","bgColor","charAt","substring","c","parseInt","map","col","Math","pow","setColor","backgroundColor","border","_jsx","_extends","className","CustomCheckBox","checkColor","checked","onCheck","checkProps","_Fragment","children","_jsxs","type","onChange","SVG","src","height","width","includes","Error","fill","href","BaseInput","iconColor","iconSrc","inputColor","toggle","valueChanged","inputProps","htmlFor","id","e","target","value","placeholder","onClick","useOutsideClick","callback","ref","useRef","useEffect","handleClickOutside","event","current","contains","document","addEventListener","removeEventListener","CustomInput","tooltipClose","tooltipIcon","tooltipText","tooltipVisible","setTooltipVisible","useState","closeTooltip","PasswordRuleTypes","PasswordInput","capsLockWarning","rules","ruleChecked","ruleUnchecked","setFailedRules","capsLock","setCapsLock","checkRule","rule","pattern","minLength","count","maxLength","letters","numbers","special","upper","RegExp","test","failedRules","forEach","push","validateInput","setCapsLockState","getModifierState","idx","ModalType","BaseModal","cancelLabel","closeLabel","confirm","confirmLabel","message","timeout","title","visible","setVisible","setTimeout","success","error","animationDuration","Array","isArray","m","question","NotifyModal","isSuccess","modalProps","QuestionModal","_objectDestructuringEmpty"],"mappings":"4gBAUM,SAAUA,EAAaC,GAC3B,MAAMC,SACJA,GAAW,EAAKC,MAChBA,EAAKC,MACLA,GAAQ,EAAKC,MACbA,GAEEJ,EADCK,EAAWC,EACZN,EAAKO,GAmBHC,EAAuB,CAC3BC,MAlBF,SAAkBC,GAChB,IAAKN,GAASH,EAAU,OAAW,KAEnC,MAAMQ,EAA+B,MAAtBC,EAAQC,OAAO,GAAcD,EAAQE,UAAU,EAAG,GAAKF,EAMhEG,EALW,CACfC,SAASL,EAAMG,UAAU,EAAG,GAAI,IAAM,IACtCE,SAASL,EAAMG,UAAU,EAAG,GAAI,IAAM,IACtCE,SAASL,EAAMG,UAAU,EAAG,GAAI,IAAM,KAErBG,IAAIC,GACdA,GAAO,OAAUA,EAAM,MAASC,KAAKC,KAAKF,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1,2 @@
|
|
|
1
|
-
!function(e,
|
|
1
|
+
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("react/jsx-runtime"),require("react")):"function"==typeof define&&define.amd?define(["exports","react/jsx-runtime","react"],n):n((e||self).uiLibrary={},e.jsxRuntime,e.react)}(this,function(e,n,s){function t(){return t=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var s=arguments[n];for(var t in s)({}).hasOwnProperty.call(s,t)&&(e[t]=s[t])}return e},t.apply(null,arguments)}function r(e,n){if(null==e)return{};var s={};for(var t in e)if({}.hasOwnProperty.call(e,t)){if(n.indexOf(t)>=0)continue;s[t]=e[t]}return s}var i=["disabled","label","small","theme"];function l(e){var s=e.disabled,l=void 0!==s&&s,c=e.label,o=e.small,a=void 0!==o&&o,u=e.theme,d=r(e,i),p={color:function(e){if(!u||l)return null;var n="#"===e.charAt(0)?e.substring(1,7):e,s=[parseInt(n.substring(0,2),16)/255,parseInt(n.substring(2,4),16)/255,parseInt(n.substring(4,6),16)/255].map(function(e){return e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4)});return.2126*s[0]+.7152*s[1]+.0722*s[2]>.179?"#000000":"#ffffff"}(u),backgroundColor:l?null:u,border:u?"none":null};return n.jsx("button",t({className:"uil-button "+(l?"uil-disabled":"")+" "+(a?"uil-small":""),style:p,disabled:l},d,{children:c}))}var c=["checkColor","checked","onCheck","label"];function o(e){var s=e.src,t=e.color,r=e.height,i=e.width;if(!s.includes(".svg"))throw new Error("Provided src is not an svg image");return n.jsx("svg",{"aria-hidden":!0,className:"uil-svg",style:{fill:t,height:r+"px",width:i+"px"},children:n.jsx("use",{href:s})})}var a=["iconColor","iconSrc","inputColor","label","toggle","valueChanged"];function u(e){var s=e.iconColor,i=e.iconSrc,l=e.inputColor,c=e.label,u=e.toggle,d=e.valueChanged,p=r(e,a);return n.jsxs("label",{className:"uil-input-wrapper",htmlFor:p.id,children:[n.jsx("input",t({className:"uil-input",onChange:function(e){return d(e.target.value)},placeholder:c,style:{color:l}},p)),i&&n.jsx("div",{className:"uil-icon",onClick:u,children:n.jsx(o,{src:i,width:24,height:24,color:s})}),n.jsx("span",{className:"uil-label",style:{color:l},children:c})]})}function d(e){var n=s.useRef(null);return s.useEffect(function(){function s(s){n.current&&!n.current.contains(s.target)&&e()}return document.addEventListener("click",s),document.addEventListener("touchend",s),function(){document.removeEventListener("click",s),document.removeEventListener("touchend",s)}},[e]),n}var p,h=["tooltipClose","tooltipIcon","tooltipText"];function f(e){var i=e.tooltipClose,l=e.tooltipIcon,c=e.tooltipText,a=r(e,h),p=s.useState(!1),f=p[0],m=p[1],x=d(v);function v(){m(!1)}return n.jsx(n.Fragment,{children:l?n.jsxs("div",{className:"uil-tooltip-wrapper",children:[f&&n.jsxs("div",{className:"uil-tooltip",ref:x,children:[i&&n.jsx("button",{className:"uil-tooltip-button",onClick:v,children:i}),n.jsx("span",{children:c})]}),n.jsx("div",{className:"uil-tooltip-icon",onClick:function(){return m(!f)},children:n.jsx(o,{src:l,height:16,width:16})}),n.jsx(u,t({},a))]}):n.jsx(u,t({},a))})}e.PasswordRuleTypes=void 0,(p=e.PasswordRuleTypes||(e.PasswordRuleTypes={}))[p.minLength=0]="minLength",p[p.maxLength=1]="maxLength",p[p.letters=2]="letters",p[p.numbers=3]="numbers",p[p.special=4]="special",p[p.upper=5]="upper";var m,x=["capsLockWarning","rules","ruleChecked","ruleUnchecked","setFailedRules"];function v(e){var t=e.cancelLabel,r=void 0===t?"":t,i=e.closeLabel,c=e.confirm,o=e.confirmLabel,a=void 0===o?"":o,u=e.message,d=e.timeout,p=e.title,h=e.type,f=s.useState(!0),x=f[0],v=f[1];return s.useEffect(function(){d&&setTimeout(function(){v(!1)},d)},[]),x?n.jsx("div",{className:"uil-modal-wrapper",children:n.jsxs("div",{className:"uil-modal",children:[n.jsx("div",{className:"uil-header "+(h==m.success?"uil-success":"")+" "+(h==m.error?"uil-error":""),children:p}),d&&n.jsx("div",{className:"uil-progress-wrapper",children:n.jsx("div",{className:"uil-progress-bar",style:{animationDuration:e.timeout/1e3+1+"s"}})}),n.jsxs("div",{className:"uil-content",children:[n.jsx("div",{children:Array.isArray(u)?u.map(function(e,s){return n.jsx("p",{className:"uil-modal-text",children:e},s)}):n.jsx("p",{className:"uil-modal-text",children:u})}),n.jsxs("div",{className:"uil-button-wrapper "+(h!==m.question?"uil-single":""),children:[h!==m.question&&n.jsx(l,{label:i,small:!0,onClick:function(){return v(!1)},type:"button"}),h==m.question&&e.confirm&&n.jsxs(n.Fragment,{children:[n.jsx(l,{label:a,theme:"#00416A",small:!0,onClick:function(){return c},type:"button"}),n.jsx(l,{label:r,small:!0,onClick:function(){return v(!1)},type:"button"})]})]})]})]})}):n.jsx(n.Fragment,{})}!function(e){e[e.error=0]="error",e[e.question=1]="question",e[e.success=2]="success"}(m||(m={}));var b=["isSuccess"];e.CustomButton=l,e.CustomCheckBox=function(e){var s=e.checkColor,i=e.checked,l=e.onCheck,o=e.label,a=r(e,c);return n.jsx(n.Fragment,{children:n.jsxs("div",{className:"uil-check-wrapper",children:[n.jsxs("label",{className:"uil-checkbox",children:[n.jsx("input",t({type:"checkbox",checked:i,onChange:function(){l(!i)}},a)),n.jsx("div",{className:"uil-checkmark",style:{backgroundColor:s}})]}),n.jsx("span",{children:o})]})})},e.CustomInput=f,e.NotifyModal=function(e){var s=e.isSuccess,i=r(e,b);return n.jsx(v,t({type:s?m.success:m.error},i))},e.PasswordInput=function(i){var l=i.capsLockWarning,c=i.rules,a=i.ruleChecked,u=i.ruleUnchecked,d=i.setFailedRules,p=r(i,x),h=s.useState(!1),m=h[0],v=h[1];function b(n){var s;switch(n.type){case e.PasswordRuleTypes.minLength:s="[a-zA-Z0-9ßÄäÖöÜü._!\"`'#%&§,:;<>=@{}~\\$\\(\\)\\*\\+\\/\\\\\\?\\[\\]\\^\\|\\-]{"+n.count+",}";break;case e.PasswordRuleTypes.maxLength:s="^[a-zA-Z0-9ßÄäÖöÜü._!\"`'#%&,:;<>=@{}~\\$\\(\\)\\*\\+\\/\\\\\\?\\[\\]\\^\\|\\-]{0,"+n.count+"}$";break;case e.PasswordRuleTypes.letters:s="[a-zA-ZßÄäÖöÜü]{"+n.count+",}";break;case e.PasswordRuleTypes.numbers:s="[0-9]{"+n.count+",}";break;case e.PasswordRuleTypes.special:s="[._!\"`'#%&§,:;<>=@{}~\\$\\(\\)\\*\\+\\/\\\\\\?\\[\\]\\^\\|\\-]{"+n.count+",}";break;case e.PasswordRuleTypes.upper:s="[A-ZÄÖÜ]{"+n.count+",}";break;default:s=n.pattern?n.pattern:""}return""!==s&&new RegExp(s).test(i.value)}return s.useEffect(function(){var e;e=[],c.forEach(function(n){b(n)||e.push(n)}),d(e)},[i.value]),s.useEffect(function(){function e(e){v(e.getModifierState&&e.getModifierState("CapsLock"))}return document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}},[]),n.jsx(n.Fragment,{children:n.jsxs("div",{children:[n.jsx(f,t({},p)),n.jsxs("div",{className:"uil-password-rules",children:[m&&n.jsx("div",{className:"uil-password-rule",children:l}),c.map(function(e,s){return n.jsxs("div",{className:"uil-password-rule",children:[n.jsx(o,{src:b(e)?a:u,height:12,width:12}),n.jsx("span",{children:e.label})]},s)})]})]})})},e.QuestionModal=function(e){var s=t({},(function(e){if(null==e)throw new TypeError("Cannot destructure "+e)}(e),e));return n.jsx(v,t({type:m.question},s))},e.SVG=o,e.useOutsideClick=d});
|
|
2
2
|
//# sourceMappingURL=index.umd.js.map
|
package/dist/index.umd.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.umd.js","sources":["../src/components/images/svgIcon.tsx","../src/components/input/baseInput.tsx","../src/components/input/textInput.tsx"],"sourcesContent":["import React, {CSSProperties} from 'react';\nimport './images.scss';\n\ninterface ISvgIcon {\n src: string;\n color?: string;\n height?: number;\n width?: number;\n}\n\nexport function SVG(props: ISvgIcon) {\n const {\n src,\n color,\n height,\n width\n } = props;\n\n if (!src.includes('.svg')) {\n throw new Error('Provided src is not an svg image')\n }\n\n const style: CSSProperties = {\n fill: color,\n height: `${height}px`,\n width: `${width}px`\n }\n\n return (\n <svg aria-hidden={true} className={'uil-svg'} style={style}>\n <use href={src}/>\n </svg>\n );\n}","import React, {ComponentPropsWithoutRef} from \"react\";\nimport {SVG} from \"../images/svgIcon\";\nimport './input.scss';\n\nexport interface IBaseInput extends ComponentPropsWithoutRef<'input'> {\n label : string;\n value : string;\n valueChanged: (value: string) => void;\n iconColor? : string;\n iconSrc? : string;\n inputColor? : string;\n}\n\nexport function BaseInput(props: IBaseInput) {\n const {\n label,\n valueChanged,\n iconColor,\n iconSrc,\n inputColor,\n ...inputProps\n } = props;\n\n return (\n <label className={'uil-input-wrapper'}>\n <input\n className={'uil-input'}\n onChange={(e) => valueChanged(e.target.value)}\n placeholder={label}\n style={{color: inputColor}}\n {...inputProps}\n />\n\n {iconSrc &&\n <div className={'uil-icon'}>\n <SVG src={iconSrc} width={24} height={24} color={iconColor}/>\n </div>\n }\n\n <span className={'uil-label'} style={{color: inputColor}}>{label}</span>\n </label>\n );\n}","import React, {useState} from 'react';\nimport {BaseInput, IBaseInput} from \"./baseInput\";\nimport {SVG} from '../images/svgIcon';\nimport './input.scss';\n\ninterface ITextInput extends IBaseInput {\n tooltipIcon?: string;\n tooltipText?: string;\n tooltipClose?: string\n}\n\nexport function TextInput(props: ITextInput) {\n const {\n tooltipIcon,\n tooltipText,\n tooltipClose,\n ...inputProps\n } = props;\n\n const [tooltipVisible, setTooltipVisible] = useState(false);\n\n function closeTooltip() {\n setTooltipVisible(false);\n }\n\n return (\n <>\n {tooltipIcon ?\n <div className={'uil-tooltip-wrapper'}>\n {tooltipVisible &&\n <div className={'uil-tooltip'} onClick={closeTooltip}>\n {tooltipClose &&\n <button className={'uil-tooltip-button'} onClick={closeTooltip}>\n {tooltipClose}\n </button>\n }\n\n <span>{tooltipText}</span>\n </div>\n }\n\n <div className={'uil-tooltip-icon'} onClick={() => setTooltipVisible(!tooltipVisible)}>\n <SVG src={tooltipIcon} height={16} width={16}/>\n </div>\n\n <BaseInput {...inputProps}/>\n </div> :\n\n <BaseInput {...inputProps}/>\n }\n </>\n );\n}"],"names":["SVG","props","src","color","height","width","includes","Error","_jsx","jsx","className","style","fill","children","href","BaseInput","label","valueChanged","iconColor","iconSrc","inputColor","inputProps","_objectWithoutPropertiesLoose","_excluded","_jsxs","onChange","e","target","value","placeholder","tooltipIcon","tooltipText","tooltipClose","_useState","useState","tooltipVisible","setTooltipVisible","closeTooltip","_Fragment","Fragment","jsxs","onClick","_extends"],"mappings":"yqBAUM,SAAUA,EAAIC,GAClB,IACEC,EAIED,EAJFC,IACAC,EAGEF,EAHFE,MACAC,EAEEH,EAFFG,OACAC,EACEJ,EADFI,MAGF,IAAKH,EAAII,SAAS,QAChB,MAAU,IAAAC,MAAM,oCASlB,OACEC,EAAkBC,IAAA,MAAA,CAAA,eAAA,EAAMC,UAAW,UAAWC,MAPnB,CAC3BC,KAAMT,EACNC,OAAWA,EAAU,KACrBC,MAAUA,EAAK,MAI2CQ,SACxDL,aAAKM,KAAMZ,KAGjB,4ECpBgBa,EAAUd,GACxB,IACEe,EAMEf,EANFe,MACAC,EAKEhB,EALFgB,aACAC,EAIEjB,EAJFiB,UACAC,EAGElB,EAHFkB,QACAC,EAEEnB,EAFFmB,WACGC,EAAUC,EACXrB,EAAKsB,GAET,OACEC,OAAO,QAAA,CAAAd,UAAW,oBAAmBG,SAAA,CACnCL,iBACEE,UAAW,YACXe,SAAU,SAACC,GAAC,OAAKT,EAAaS,EAAEC,OAAOC,MAAM,EAC7CC,YAAab,EACbL,MAAO,CAACR,MAAOiB,IACXC,IAGLF,GACCX,MAAA,MAAA,CAAKE,UAAW,oBACdF,EAAAA,IAACR,GAAIE,IAAKiB,EAASd,MAAO,GAAID,OAAQ,GAAID,MAAOe,MAIrDV,EAAAC,IAAA,OAAA,CAAMC,UAAW,YAAaC,MAAO,CAACR,MAAOiB,GAAWP,SAAGG,MAGjE,wEC/BM,SAAoBf,GACxB,IACE6B,EAIE7B,EAJF6B,YACAC,EAGE9B,EAHF8B,YACAC,EAEE/B,EAFF+B,aACGX,EAAUC,EACXrB,EAAKsB,GAETU,EAA4CC,YAAS,GAA9CC,EAAcF,EAAA,GAAEG,EAAiBH,EAAA,GAExC,SAASI,IACPD,GAAkB,EACpB,CAEA,OACE5B,EAAAC,IAAA6B,EAAAC,SAAA,CAAA1B,SACGiB,EACCN,EAAAgB,KAAA,MAAA,CAAK9B,UAAW,sBAAqBG,SAAA,CAClCsB,GACCX,EAAKgB,KAAA,MAAA,CAAA9B,UAAW,cAAe+B,QAASJ,YACrCL,GACCxB,EAAAA,IAAQ,SAAA,CAAAE,UAAW,qBAAsB+B,QAASJ,EAC/CxB,SAAAmB,IAILxB,EAAAA,IAAO,OAAA,CAAAK,SAAAkB,OAIXvB,EAAAA,IAAK,MAAA,CAAAE,UAAW,mBAAoB+B,QAAS,WAAA,OAAML,GAAmBD,EAAe,EACnFtB,SAAAL,MAACR,EAAG,CAACE,IAAK4B,EAAa1B,OAAQ,GAAIC,MAAO,OAG5CG,MAACO,EAAS2B,EAAKrB,CAAAA,EAAAA,OAGjBb,EAAAC,IAACM,EAAS2B,EAAA,CAAA,EAAKrB,KAIvB"}
|
|
1
|
+
{"version":3,"file":"index.umd.js","sources":["../src/components/button/customButton.tsx","../src/components/images/svgIcon.tsx","../src/components/input/baseInput.tsx","../src/hooks/clickOutside.ts","../src/enums/passwordRuleTypes.ts","../src/components/input/customInput.tsx","../src/enums/ModalType.ts","../src/components/modal/baseModal.tsx","../src/components/checkbox/customCheckBox.tsx","../src/components/modal/notifyModal.tsx","../src/components/input/passwordInput.tsx","../src/components/modal/questionModal.tsx"],"sourcesContent":["import React, {ComponentPropsWithoutRef, CSSProperties} from 'react';\nimport './button.scss';\n\ninterface ICustomButton extends ComponentPropsWithoutRef<'button'> {\n label : string;\n disabled?: boolean;\n small? : boolean;\n theme? : string;\n}\n\nexport function CustomButton(props: ICustomButton) {\n const {\n disabled = false,\n label,\n small = false,\n theme,\n ...buttonProps\n } = props;\n\n function setColor(bgColor: string) {\n if (!theme || disabled) return null;\n\n const color = (bgColor.charAt(0) === '#') ? bgColor.substring(1, 7) : bgColor;\n const uiColors = [\n parseInt(color.substring(0, 2), 16) / 255,\n parseInt(color.substring(2, 4), 16) / 255,\n parseInt(color.substring(4, 6), 16) / 255\n ];\n const c = uiColors.map(col => {\n return col <= 0.03928? (col / 12.92) : Math.pow((col + 0.055) / 1.055, 2.4);\n });\n const L = (0.2126 * c[0]) + (0.7152 * c[1]) + (0.0722 * c[2]);\n\n return L > 0.179 ? '#000000' : '#ffffff';\n }\n\n const style: CSSProperties = {\n color: setColor(theme),\n backgroundColor: disabled? null : theme,\n border: theme? 'none': null,\n }\n\n return (\n <button className={`uil-button ${disabled ? 'uil-disabled' : ''} ${small ? 'uil-small' : ''}`} style={style} disabled={disabled} {...buttonProps}>\n {label}\n </button>\n );\n}","import React, {CSSProperties} from 'react';\nimport './images.scss';\n\ninterface ISvgIcon {\n src : string;\n color? : string;\n height?: number;\n width? : number;\n}\n\nexport function SVG(props: ISvgIcon) {\n const {\n src,\n color,\n height,\n width\n } = props;\n\n if (!src.includes('.svg')) {\n throw new Error('Provided src is not an svg image');\n }\n\n const style: CSSProperties = {\n fill: color,\n height: `${height}px`,\n width: `${width}px`\n }\n\n return (\n <svg aria-hidden={true} className={'uil-svg'} style={style}>\n <use href={src}/>\n </svg>\n );\n}","import React, {ComponentPropsWithoutRef} from 'react';\nimport {SVG} from 'components/images/svgIcon';\nimport './input.scss';\n\nexport interface IBaseInput extends ComponentPropsWithoutRef<'input'> {\n label : string;\n value : string;\n valueChanged: (value: string) => void;\n iconColor? : string;\n iconSrc? : string;\n inputColor? : string;\n toggle? : () => void;\n}\n\nexport function BaseInput(props: IBaseInput) {\n const {\n iconColor,\n iconSrc,\n inputColor,\n label,\n toggle,\n valueChanged,\n ...inputProps\n } = props;\n\n return (\n <label className={'uil-input-wrapper'} htmlFor={inputProps.id}>\n <input\n className={'uil-input'}\n onChange={(e) => valueChanged(e.target.value)}\n placeholder={label}\n style={{color: inputColor}}\n {...inputProps}\n />\n\n {iconSrc &&\n <div className={'uil-icon'} onClick={toggle}>\n <SVG src={iconSrc} width={24} height={24} color={iconColor}/>\n </div>\n }\n\n <span className={'uil-label'} style={{color: inputColor}}>{label}</span>\n </label>\n );\n}","import {useEffect, useRef} from 'react';\n\nexport function useOutsideClick (callback: () => void) {\n const ref = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n function handleClickOutside (event: MouseEvent | TouchEvent) {\n if (ref.current && !ref.current.contains(event.target as Node)) {\n callback();\n }\n }\n\n document.addEventListener('click', handleClickOutside);\n document.addEventListener('touchend', handleClickOutside);\n\n\n return () => {\n document.removeEventListener('click', handleClickOutside);\n document.removeEventListener('touchend', handleClickOutside);\n };\n }, [callback]);\n\n return ref;\n}","export enum PasswordRuleTypes {\n minLength,\n maxLength,\n letters,\n numbers,\n special,\n upper\n}","import React, {useState} from 'react';\nimport {BaseInput, IBaseInput} from './baseInput';\nimport {SVG} from 'components/images/svgIcon';\nimport {useOutsideClick} from 'hooks/clickOutside';\nimport './input.scss';\n\nexport interface ICustomInput extends IBaseInput {\n tooltipClose?: string;\n tooltipIcon? : string;\n tooltipText? : string;\n}\n\nexport function CustomInput(props: ICustomInput) {\n const {\n tooltipClose,\n tooltipIcon,\n tooltipText,\n ...inputProps\n } = props;\n\n const [tooltipVisible, setTooltipVisible] = useState(false);\n const ref = useOutsideClick(closeTooltip);\n\n function closeTooltip() {\n setTooltipVisible(false);\n }\n\n return (\n <>\n {tooltipIcon ?\n <div className={'uil-tooltip-wrapper'}>\n {tooltipVisible &&\n <div className={'uil-tooltip'} ref={ref}>\n {tooltipClose &&\n <button className={'uil-tooltip-button'} onClick={closeTooltip}>\n {tooltipClose}\n </button>\n }\n\n <span>{tooltipText}</span>\n </div>\n }\n\n <div className={'uil-tooltip-icon'} onClick={() => setTooltipVisible(!tooltipVisible)}>\n <SVG src={tooltipIcon} height={16} width={16}/>\n </div>\n\n <BaseInput {...inputProps}/>\n </div> :\n\n <BaseInput {...inputProps}/>\n }\n </>\n );\n}","export enum ModalType {\n error,\n question,\n success\n}","import React, {useEffect, useState} from 'react';\nimport {ModalType} from 'enums/ModalType';\nimport {CustomButton} from 'components/button';\nimport './modal.scss';\n\ninterface IBaseModal {\n message : string | string[];\n title : string;\n type : ModalType;\n cancelLabel? : string;\n closeLabel? : string;\n confirm? : () => void;\n confirmLabel?: string;\n timeout? : number;\n}\n\nexport function BaseModal(props: IBaseModal) {\n const {\n cancelLabel = '',\n closeLabel,\n confirm,\n confirmLabel = '',\n message,\n timeout,\n title,\n type\n } = props;\n\n const [visible, setVisible] = useState(true);\n\n useEffect(() => {\n if (!timeout) return;\n\n setTimeout(() => {\n setVisible(false);\n }, timeout);\n },[]);\n\n return visible ?\n <div className={'uil-modal-wrapper'}>\n <div className={'uil-modal'}>\n <div className={`uil-header ${type == ModalType.success ? 'uil-success' : ''} ${type == ModalType.error ? 'uil-error' : ''}`}>\n {title}\n </div>\n\n {timeout &&\n <div className={'uil-progress-wrapper'}>\n <div className={'uil-progress-bar'} style={{animationDuration: `${(props.timeout / 1000) + 1}s`}}/>\n </div>\n }\n\n <div className={'uil-content'}>\n <div>\n {Array.isArray(message) ?\n message.map((m, idx) =>\n <p key={idx} className={'uil-modal-text'}>{m}</p>\n ) : <p className={'uil-modal-text'}>{message}</p>\n }\n </div>\n\n <div className={`uil-button-wrapper ${type !== ModalType.question ? 'uil-single' : ''}`}>\n {type !== ModalType.question &&\n <CustomButton label={closeLabel} small={true} onClick={() => setVisible(false)} type={'button'}/>\n }\n\n {type == ModalType.question && props.confirm &&\n <>\n <CustomButton label={confirmLabel} theme={'#00416A'} small={true} onClick={() => confirm} type={'button'}/>\n <CustomButton label={cancelLabel} small={true} onClick={() => setVisible(false)} type={'button'}/>\n </>\n }\n </div>\n </div>\n </div>\n </div> : <></>;\n}","import React, {ComponentPropsWithoutRef} from 'react';\nimport './checkbox.scss';\n\ninterface ICustomCheckbox extends ComponentPropsWithoutRef<'input'> {\n checked : boolean;\n label : string;\n onCheck : (value: boolean) => void;\n checkColor? : string;\n}\n\nexport function CustomCheckBox(props: ICustomCheckbox) {\n const {\n checkColor,\n checked,\n onCheck,\n label,\n ...checkProps\n } = props;\n\n return (\n <>\n <div className={'uil-check-wrapper'}>\n <label className={'uil-checkbox'}>\n <input type={'checkbox'} checked={checked} onChange={() => {onCheck(!checked)}} {...checkProps}/>\n <div className={'uil-checkmark'} style={{backgroundColor: checkColor}}/>\n </label>\n\n <span>{label}</span>\n </div>\n </>\n );\n}","import React from 'react';\nimport {BaseModal} from './baseModal';\nimport {ModalType} from 'enums/ModalType';\n\nexport interface INotifyModal {\n closeLabel: string;\n isSuccess : boolean;\n message : string | string[];\n title : string;\n timeout? : number;\n}\n\nexport function NotifyModal(props: INotifyModal) {\n const {\n isSuccess,\n ...modalProps\n } = props;\n\n return (\n <BaseModal type={isSuccess? ModalType.success : ModalType.error} {...modalProps}/>\n );\n}","import React, {useEffect, useState} from 'react';\nimport {CustomInput, ICustomInput} from './customInput';\nimport {SVG} from 'components/images/svgIcon';\nimport {PasswordRuleTypes} from 'enums/passwordRuleTypes';\nimport './input.scss';\n\ninterface IPasswordInput extends ICustomInput {\n capsLockWarning: string;\n setFailedRules : (value: PasswordRule[]) => void;\n ruleChecked : string;\n rules : PasswordRule[];\n ruleUnchecked : string;\n}\n\nexport interface PasswordRule {\n count : number;\n label : string;\n type : PasswordRuleTypes | string;\n pattern?: string;\n}\n\nexport function PasswordInput(props: IPasswordInput) {\n const {\n capsLockWarning,\n rules,\n ruleChecked,\n ruleUnchecked,\n setFailedRules,\n ...inputProps\n } = props;\n\n const [capsLock, setCapsLock] = useState(false);\n\n useEffect(() => {\n validateInput();\n },[props.value]);\n\n useEffect(() => {\n function setCapsLockState(event: globalThis.KeyboardEvent) {\n setCapsLock(event.getModifierState && event.getModifierState('CapsLock'));\n }\n\n document.addEventListener('keydown', setCapsLockState);\n\n return () => {\n document.removeEventListener('keydown', setCapsLockState);\n };\n },[]);\n\n function validateInput() {\n const failedRules: PasswordRule[] = [];\n \n rules.forEach(rule => {\n if (!checkRule(rule)) {\n failedRules.push(rule);\n }\n });\n\n setFailedRules(failedRules);\n }\n\n function checkRule(rule: PasswordRule) {\n let pattern: string;\n\n switch (rule.type) {\n case PasswordRuleTypes.minLength:\n pattern = `[a-zA-Z0-9ßÄäÖöÜü._!\"\\`'#%&§,:;<>=@{}~\\\\$\\\\(\\\\)\\\\*\\\\+\\\\/\\\\\\\\\\\\?\\\\[\\\\]\\\\^\\\\|\\\\-]{${rule.count},}`;\n break;\n case PasswordRuleTypes.maxLength:\n pattern = `^[a-zA-Z0-9ßÄäÖöÜü._!\"\\`'#%&,:;<>=@{}~\\\\$\\\\(\\\\)\\\\*\\\\+\\\\/\\\\\\\\\\\\?\\\\[\\\\]\\\\^\\\\|\\\\-]{0,${rule.count}}$`;\n break;\n case PasswordRuleTypes.letters:\n pattern = `[a-zA-ZßÄäÖöÜü]{${rule.count},}`;\n break;\n case PasswordRuleTypes.numbers:\n pattern = `[0-9]{${rule.count},}`;\n break;\n case PasswordRuleTypes.special:\n pattern = `[._!\"\\`'#%&§,:;<>=@{}~\\\\$\\\\(\\\\)\\\\*\\\\+\\\\/\\\\\\\\\\\\?\\\\[\\\\]\\\\^\\\\|\\\\-]{${rule.count},}`;\n break;\n case PasswordRuleTypes.upper:\n pattern = `[A-ZÄÖÜ]{${rule.count},}`;\n break;\n default:\n rule.pattern? pattern = rule.pattern : pattern = '';\n }\n\n if (pattern === '') return false;\n\n const reg = new RegExp(pattern);\n return reg.test(props.value);\n }\n\n return (\n <>\n <div>\n <CustomInput {...inputProps}/>\n\n <div className={'uil-password-rules'}>\n {capsLock &&\n <div className={'uil-password-rule'}>{capsLockWarning}</div>\n }\n\n {rules.map((rule, idx) =>\n <div key={idx} className={'uil-password-rule'}>\n <SVG src={checkRule(rule)? ruleChecked : ruleUnchecked} height={12} width={12}/>\n\n <span>{rule.label}</span>\n </div>\n )}\n </div>\n </div>\n </>\n );\n}","import React from 'react';\nimport {BaseModal} from './baseModal';\nimport {ModalType} from 'enums/ModalType';\n\nexport interface IQuestionModal {\n cancelLabel : string;\n confirm : () => void;\n confirmLabel: string;\n message : string | string[];\n title : string;\n timeout? : number;\n}\n\nexport function QuestionModal(props: IQuestionModal) {\n const {\n ...modalProps\n } = props;\n\n return (\n <BaseModal type={ModalType.question} {...modalProps}/>\n );\n}"],"names":["CustomButton","props","_props$disabled","disabled","label","_props$small","small","theme","buttonProps","_objectWithoutPropertiesLoose","_excluded","style","color","bgColor","charAt","substring","c","parseInt","map","col","Math","pow","setColor","backgroundColor","border","_jsx","jsx","_extends","className","SVG","src","height","width","includes","Error","fill","children","href","BaseInput","iconColor","iconSrc","inputColor","toggle","valueChanged","inputProps","_jsxs","htmlFor","id","onChange","e","target","value","placeholder","onClick","useOutsideClick","callback","ref","useRef","useEffect","handleClickOutside","event","current","contains","document","addEventListener","removeEventListener","PasswordRuleTypes","CustomInput","tooltipClose","tooltipIcon","tooltipText","_useState","useState","tooltipVisible","setTooltipVisible","closeTooltip","_Fragment","Fragment","jsxs","ModalType","BaseModal","_props$cancelLabel","cancelLabel","closeLabel","confirm","_props$confirmLabel","confirmLabel","message","timeout","title","type","visible","setVisible","setTimeout","success","error","animationDuration","Array","isArray","m","idx","question","checkColor","checked","onCheck","checkProps","isSuccess","modalProps","capsLockWarning","rules","ruleChecked","ruleUnchecked","setFailedRules","capsLock","setCapsLock","checkRule","rule","pattern","minLength","count","maxLength","letters","numbers","special","upper","RegExp","test","failedRules","forEach","push","setCapsLockState","getModifierState","_objectDestructuringEmpty"],"mappings":"otBAUM,SAAUA,EAAaC,GAC3B,IAAAC,EAMID,EALFE,SAAAA,WAAQD,GAAQA,EAChBE,EAIEH,EAJFG,MAAKC,EAIHJ,EAHFK,MAAAA,OAAQ,IAAHD,GAAQ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yG,CACXnI,GAAAA,IAEJ,OACEwB,EAAAC,IAACsD,EAASrD,EAAA,CAAC+D,KAAMX,EAAUsB,UAAcM,GAE7C"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"private": false,
|
|
3
3
|
"name": "@hbuesing/ui-library",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.3.1",
|
|
5
5
|
"description": "Collection of reusable ui components for react based applications",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"react",
|
|
@@ -38,12 +38,12 @@
|
|
|
38
38
|
"@eslint/js": "^9.4.0",
|
|
39
39
|
"@types/react": "^18.3.3",
|
|
40
40
|
"eslint": "^8.57.0",
|
|
41
|
-
"eslint-plugin-react": "^7.34.
|
|
42
|
-
"globals": "^15.
|
|
41
|
+
"eslint-plugin-react": "^7.34.3",
|
|
42
|
+
"globals": "^15.6.0",
|
|
43
43
|
"microbundle": "^0.15.1",
|
|
44
44
|
"react": "^18.3.1",
|
|
45
|
-
"sass": "^1.77.
|
|
46
|
-
"typescript": "^5.
|
|
47
|
-
"typescript-eslint": "^7.
|
|
45
|
+
"sass": "^1.77.6",
|
|
46
|
+
"typescript": "^5.5.2",
|
|
47
|
+
"typescript-eslint": "^7.13.1"
|
|
48
48
|
}
|
|
49
49
|
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { IBaseInput } from "./baseInput";
|
|
2
|
-
import './input.scss';
|
|
3
|
-
interface ITextInput extends IBaseInput {
|
|
4
|
-
tooltipIcon?: string;
|
|
5
|
-
tooltipText?: string;
|
|
6
|
-
tooltipClose?: string;
|
|
7
|
-
}
|
|
8
|
-
export declare function TextInput(props: ITextInput): import("react/jsx-runtime").JSX.Element;
|
|
9
|
-
export {};
|