@hbuesing/ui-library 2.0.3 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. package/README.md +3 -1
  2. package/package.json +10 -41
  3. package/src/components/button/button.scss +25 -0
  4. package/src/components/button/customButton.tsx +84 -0
  5. package/src/components/button/index.ts +1 -0
  6. package/src/components/checkbox/checkbox.scss +13 -0
  7. package/src/components/checkbox/customCheckBox.tsx +35 -0
  8. package/src/components/checkbox/index.ts +1 -0
  9. package/src/components/global.scss +60 -0
  10. package/src/components/images/images.scss +12 -0
  11. package/src/components/images/index.ts +1 -0
  12. package/src/components/images/svgIcon.tsx +39 -0
  13. package/src/components/input/baseInput.tsx +48 -0
  14. package/src/components/input/customInput.tsx +54 -0
  15. package/src/components/input/index.ts +2 -0
  16. package/src/components/input/input.scss +142 -0
  17. package/src/components/input/passwordInput.tsx +118 -0
  18. package/src/components/modal/baseModal.tsx +105 -0
  19. package/src/components/modal/index.ts +2 -0
  20. package/src/components/modal/modal.scss +125 -0
  21. package/src/components/modal/notifyModal.tsx +24 -0
  22. package/src/components/modal/questionModal.tsx +23 -0
  23. package/src/components/radio/customRadio.tsx +72 -0
  24. package/src/components/radio/index.ts +1 -0
  25. package/src/components/radio/radio.scss +28 -0
  26. package/src/components/variables.scss +61 -0
  27. package/src/enums/index.ts +1 -0
  28. package/src/enums/modalType.ts +6 -0
  29. package/src/enums/passwordRuleTypes.ts +8 -0
  30. package/src/hooks/clickOutside.ts +25 -0
  31. package/src/hooks/getColor.ts +16 -0
  32. package/{dist/hooks/index.d.ts → src/hooks/index.ts} +1 -0
  33. package/src/index.ts +9 -0
  34. package/src/utils/generateKey.ts +3 -0
  35. package/src/utils/styles.scss +7 -0
  36. package/src/utils/styles.scss.d.ts +2 -0
  37. package/src/utils/useInjectStyles.ts +19 -0
  38. package/tsconfig.json +24 -0
  39. package/LICENSE +0 -21
  40. package/dist/components/button/customButton.d.ts +0 -10
  41. package/dist/components/button/index.d.ts +0 -1
  42. package/dist/components/checkbox/customCheckBox.d.ts +0 -11
  43. package/dist/components/checkbox/index.d.ts +0 -1
  44. package/dist/components/images/index.d.ts +0 -1
  45. package/dist/components/images/svgIcon.d.ts +0 -10
  46. package/dist/components/input/baseInput.d.ts +0 -12
  47. package/dist/components/input/customInput.d.ts +0 -9
  48. package/dist/components/input/index.d.ts +0 -2
  49. package/dist/components/input/passwordInput.d.ts +0 -19
  50. package/dist/components/modal/baseModal.d.ts +0 -17
  51. package/dist/components/modal/index.d.ts +0 -2
  52. package/dist/components/modal/notifyModal.d.ts +0 -11
  53. package/dist/components/modal/questionModal.d.ts +0 -10
  54. package/dist/enums/ModalType.d.ts +0 -6
  55. package/dist/enums/index.d.ts +0 -1
  56. package/dist/enums/passwordRuleTypes.d.ts +0 -8
  57. package/dist/hooks/clickOutside.d.ts +0 -1
  58. package/dist/index.css +0 -2
  59. package/dist/index.css.map +0 -1
  60. package/dist/index.d.ts +0 -7
  61. package/dist/index.js +0 -2
  62. package/dist/index.js.map +0 -1
  63. package/dist/index.mjs +0 -2
  64. package/dist/index.mjs.map +0 -1
  65. package/dist/index.modern.mjs +0 -2
  66. package/dist/index.modern.mjs.map +0 -1
  67. package/dist/index.umd.js +0 -2
  68. package/dist/index.umd.js.map +0 -1
package/tsconfig.json ADDED
@@ -0,0 +1,24 @@
1
+ {
2
+ "compilerOptions": {
3
+ "outDir": "./dist/",
4
+ "sourceMap": true,
5
+ "module": "ESNext",
6
+ "target": "ESNext",
7
+ "moduleResolution": "Node",
8
+ "jsx": "react",
9
+ "jsxFactory": "",
10
+ "jsxFragmentFactory": "",
11
+ "noImplicitAny": true,
12
+ "noImplicitReturns": true,
13
+ "noUnusedParameters": true,
14
+ "noFallthroughCasesInSwitch": true,
15
+ "allowSyntheticDefaultImports": true,
16
+ "strictNullChecks": true,
17
+ "exactOptionalPropertyTypes": true,
18
+ "declaration": true,
19
+ "baseUrl": "./src"
20
+ },
21
+ "include": [
22
+ "./src/**/*"
23
+ ]
24
+ }
package/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2024 - present Henrik Buesing
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
@@ -1,10 +0,0 @@
1
- import React, { 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): React.JSX.Element;
10
- export {};
@@ -1 +0,0 @@
1
- export * from './customButton';
@@ -1,11 +0,0 @@
1
- import React, { ComponentPropsWithoutRef, ReactNode } 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
- children?: ReactNode;
9
- }
10
- export declare function CustomCheckBox(props: ICustomCheckbox): React.JSX.Element;
11
- export {};
@@ -1 +0,0 @@
1
- export * from './customCheckBox';
@@ -1 +0,0 @@
1
- export * from './svgIcon';
@@ -1,10 +0,0 @@
1
- import React, { ComponentPropsWithoutRef } from 'react';
2
- import './images.scss';
3
- interface ISvgIcon extends ComponentPropsWithoutRef<'svg'> {
4
- src: string;
5
- color?: string | undefined;
6
- height?: number;
7
- width?: number;
8
- }
9
- export declare function SVG(props: ISvgIcon): React.JSX.Element;
10
- export {};
@@ -1,12 +0,0 @@
1
- import React, { ComponentPropsWithoutRef } from 'react';
2
- import './input.scss';
3
- export interface IBaseInput extends ComponentPropsWithoutRef<'input'> {
4
- label: string;
5
- value: string;
6
- valueChanged: (value: string) => void;
7
- iconColor?: string;
8
- iconSrc?: string;
9
- inputColor?: string;
10
- toggle?: () => void;
11
- }
12
- export declare function BaseInput(props: IBaseInput): React.JSX.Element;
@@ -1,9 +0,0 @@
1
- import React from 'react';
2
- import { IBaseInput } from './baseInput';
3
- import './input.scss';
4
- export interface ICustomInput extends IBaseInput {
5
- tooltipClose?: string;
6
- tooltipIcon?: string;
7
- tooltipText?: string;
8
- }
9
- export declare function CustomInput(props: ICustomInput): React.JSX.Element;
@@ -1,2 +0,0 @@
1
- export * from './customInput';
2
- export * from './passwordInput';
@@ -1,19 +0,0 @@
1
- import React from 'react';
2
- import { ICustomInput } from './customInput';
3
- import { PasswordRuleTypes } from 'enums/passwordRuleTypes';
4
- import './input.scss';
5
- interface IPasswordInput extends ICustomInput {
6
- capsLockWarning: string;
7
- setFailedRules: (value: PasswordRule[]) => void;
8
- ruleChecked: string;
9
- rules: PasswordRule[];
10
- ruleUnchecked: string;
11
- }
12
- export interface PasswordRule {
13
- count: number;
14
- label: string;
15
- type: PasswordRuleTypes | string;
16
- pattern?: string;
17
- }
18
- export declare function PasswordInput(props: IPasswordInput): React.JSX.Element;
19
- export {};
@@ -1,17 +0,0 @@
1
- import React from 'react';
2
- import { ModalType } from 'enums/ModalType';
3
- import './modal.scss';
4
- interface IBaseModal {
5
- close: () => void;
6
- message: string | string[];
7
- title: string;
8
- type: ModalType;
9
- callback?: (() => void) | undefined;
10
- cancelLabel?: string;
11
- closeLabel?: string;
12
- confirm?: () => void;
13
- confirmLabel?: string;
14
- timeout?: number;
15
- }
16
- export declare function BaseModal(props: IBaseModal): React.JSX.Element;
17
- export {};
@@ -1,2 +0,0 @@
1
- export * from './notifyModal';
2
- export * from './questionModal';
@@ -1,11 +0,0 @@
1
- import React from 'react';
2
- export interface INotifyModal {
3
- close: () => void;
4
- closeLabel: string;
5
- modalType: 'success' | 'warning' | 'error';
6
- message: string | string[];
7
- title: string;
8
- callback?: (() => void) | undefined;
9
- timeout?: number;
10
- }
11
- export declare function NotifyModal(props: INotifyModal): React.JSX.Element;
@@ -1,10 +0,0 @@
1
- import React from 'react';
2
- export interface IQuestionModal {
3
- cancel: () => void;
4
- cancelLabel: string;
5
- confirm: () => void;
6
- confirmLabel: string;
7
- message: string | string[];
8
- title: string;
9
- }
10
- export declare function QuestionModal(props: IQuestionModal): React.JSX.Element;
@@ -1,6 +0,0 @@
1
- export declare enum ModalType {
2
- error = "error",
3
- question = "question",
4
- success = "success",
5
- warning = "warning"
6
- }
@@ -1 +0,0 @@
1
- export * from './passwordRuleTypes';
@@ -1,8 +0,0 @@
1
- export declare enum PasswordRuleTypes {
2
- minLength = 0,
3
- maxLength = 1,
4
- letters = 2,
5
- numbers = 3,
6
- special = 4,
7
- upper = 5
8
- }
@@ -1 +0,0 @@
1
- export declare function useOutsideClick(callback: () => void): import("react").RefObject<HTMLDivElement>;
package/dist/index.css DELETED
@@ -1,2 +0,0 @@
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-warning:gold;--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%;z-index:99}.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%;z-index:999}@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-header.uil-warning{background-color:var(--uil-warning);color:var(--uil-black)}.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
- /*# sourceMappingURL=index.css.map */
@@ -1 +0,0 @@
1
- {"version":3,"sources":["button.scss","checkbox.scss","images.scss","input.scss","modal.scss"],"names":[],"mappings":"AA0BA,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,CC9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ACE,SACF,CACF,CACA,oDACE,oCACF,CACA,sEAEE,qBAAsB,CACtB,2BAAkC,CAClC,2BAA4B,CAH5B,qCAIF,CACA,wBACE,GACE,UACF,CACA,GACE,OACF,CACF,CACA,0CAEE,oCAAqC,CASrC,0BAA2B,CAC3B,2BAA4B,CAX5B,sBAAuB,CAEvB,YAAa,CAEb,uBAAwB,CAExB,eAAiB,CAHjB,6BAA8B,CAE9B,yBAA0B,CAG1B,QAAS,CADT,wBAAyB,CAEzB,qBAGF,CACA,0BACE,0CACE,wBAAyB,CACzB,0BAA2B,CAC3B,oBACF,CACF,CACA,sDACE,mCACF,CACA,oDACE,iCACF,CACA,sDAEE,mCAAoC,CADpC,sBAEF,CACA,2CACE,iCAAkC,CAElC,6BAA8B,CAC9B,8BAA+B,CAC/B,YAAa,CACb,qBAAsB,CACtB,gBAAiB,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-warning: #FFD700;\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-warning: #FFD700;\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-warning: #FFD700;\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-warning: #FFD700;\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-warning: #FFD700;\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 z-index: 99;\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 z-index: 999;\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-header.uil-warning {\n color: var(--uil-black);\n background-color: var(--uil-warning);\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 DELETED
@@ -1,7 +0,0 @@
1
- export { CustomButton } from './components/button/index';
2
- export { CustomCheckBox } from './components/checkbox/index';
3
- export { SVG } from './components/images/index';
4
- export { CustomInput, PasswordInput, PasswordRule } from './components/input/index';
5
- export { NotifyModal, QuestionModal } from './components/modal/index';
6
- export { useOutsideClick } from './hooks/index';
7
- export { PasswordRuleTypes } from './enums/index';
package/dist/index.js DELETED
@@ -1,2 +0,0 @@
1
- var e=require("react");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=/*#__PURE__*/t(e);function a(){return a=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var a in l)({}).hasOwnProperty.call(l,a)&&(e[a]=l[a])}return e},a.apply(null,arguments)}function n(e,t){if(null==e)return{};var l={};for(var a in e)if({}.hasOwnProperty.call(e,a)){if(t.indexOf(a)>=0)continue;l[a]=e[a]}return l}var r=["disabled","label","small","theme"];function u(e){var t=e.disabled,u=void 0!==t&&t,c=e.label,o=e.small,s=void 0!==o&&o,i=e.theme,d=n(e,r),f={color:function(){if(i&&!u){if("#"!==i.charAt(0))return"#ffffff";var e=i.substring(1,7),t=[parseInt(e.substring(0,2),16)/255,parseInt(e.substring(2,4),16)/255,parseInt(e.substring(4,6),16)/255].map(function(e){return e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4)});return.2126*t[0]+.7152*t[1]+.0722*t[2]>.179?"#000000":"#ffffff"}}(),backgroundColor:u?void 0:i,border:i?"none":void 0};return l.default.createElement("button",a({className:"uil-button "+(u?"uil-disabled":"")+" "+(s?"uil-small":""),style:f,disabled:u},d),c)}var c=["checkColor","checked","onCheck","label","children"];function o(e){var t=e.src,a=e.color,n=e.height,r=e.width;if(!t.includes(".svg"))throw new Error("Provided src is not an svg image");return l.default.createElement("svg",{"aria-hidden":!0,className:"uil-svg",style:{fill:a,height:n+"px",width:r+"px"}},l.default.createElement("use",{href:t}))}var s=["iconColor","iconSrc","inputColor","label","toggle","valueChanged"];function i(e){var t=e.iconColor,r=e.iconSrc,u=e.inputColor,c=e.label,i=e.toggle,d=e.valueChanged,f=n(e,s);return l.default.createElement("label",{className:"uil-input-wrapper",htmlFor:f.id},l.default.createElement("input",a({className:"uil-input",onChange:function(e){return d(e.target.value)},placeholder:c,style:{color:u}},f)),r&&l.default.createElement("div",{className:"uil-icon",onClick:i},l.default.createElement(o,{src:r,width:24,height:24,color:t})),l.default.createElement("span",{className:"uil-label",style:{color:u}},c))}function d(t){var l=e.useRef(null);return e.useEffect(function(){function e(e){l.current&&!l.current.contains(e.target)&&t()}return document.addEventListener("click",e),document.addEventListener("touchend",e),function(){document.removeEventListener("click",e),document.removeEventListener("touchend",e)}},[t]),l}var f,m=["tooltipClose","tooltipIcon","tooltipText"];function p(t){var r=t.tooltipClose,u=t.tooltipIcon,c=t.tooltipText,s=n(t,m),f=e.useState(!1),p=f[0],v=f[1],h=d(E);function E(){v(!1)}return l.default.createElement(l.default.Fragment,null,u?l.default.createElement("div",{className:"uil-tooltip-wrapper"},p&&l.default.createElement("div",{className:"uil-tooltip",ref:h},r&&l.default.createElement("button",{className:"uil-tooltip-button",onClick:E},r),l.default.createElement("span",null,c)),l.default.createElement("div",{className:"uil-tooltip-icon",onClick:function(){return v(!p)}},l.default.createElement(o,{src:u,height:16,width:16})),l.default.createElement(i,a({},s))):l.default.createElement(i,a({},s)))}exports.PasswordRuleTypes=void 0,(f=exports.PasswordRuleTypes||(exports.PasswordRuleTypes={}))[f.minLength=0]="minLength",f[f.maxLength=1]="maxLength",f[f.letters=2]="letters",f[f.numbers=3]="numbers",f[f.special=4]="special",f[f.upper=5]="upper";var v,h=["capsLockWarning","rules","ruleChecked","ruleUnchecked","setFailedRules"];function E(t){var a=t.callback,n=t.cancelLabel,r=void 0===n?"":n,c=t.close,o=t.closeLabel,s=t.confirm,i=t.confirmLabel,d=void 0===i?"":i,f=t.message,m=t.timeout,p=t.title,h=t.type;return e.useEffect(function(){if(m){var e=setTimeout(function(){a&&a(),c()},m);return function(){return clearTimeout(e)}}},[]),l.default.createElement("div",{className:"uil-modal-wrapper"},l.default.createElement("div",{className:"uil-modal"},l.default.createElement("div",{className:function(){switch(h){case v.error:return"uil-header uil-error";case v.success:return"uil-header uil-success";case v.warning:return"uil-header uil-warning";default:return"uil-header"}}()},p),m&&l.default.createElement("div",{className:"uil-progress-wrapper"},l.default.createElement("div",{className:"uil-progress-bar",style:{animationDuration:m/1e3+1+"s"}})),l.default.createElement("div",{className:"uil-content"},l.default.createElement("div",null,Array.isArray(f)?f.map(function(e,t){return l.default.createElement("p",{key:t,className:"uil-modal-text"},e)}):l.default.createElement("p",{className:"uil-modal-text"},f)),l.default.createElement("div",{className:"uil-button-wrapper "+(h!==v.question?"uil-single":"")},h!==v.question&&l.default.createElement(u,{label:null!=o?o:"",small:!0,onClick:c,type:"button"}),h==v.question&&t.confirm&&l.default.createElement(l.default.Fragment,null,l.default.createElement(u,{label:d,theme:"#00416A",small:!0,onClick:s,type:"button"}),l.default.createElement(u,{label:r,small:!0,onClick:c,type:"button"}))))))}!function(e){e.error="error",e.question="question",e.success="success",e.warning="warning"}(v||(v={}));var b=["callback","modalType"],g=["cancel"];exports.CustomButton=u,exports.CustomCheckBox=function(e){var t=e.checkColor,r=e.checked,u=e.onCheck,o=e.label,s=e.children,i=n(e,c);return l.default.createElement(l.default.Fragment,null,l.default.createElement("div",{className:"uil-check-wrapper"},l.default.createElement("label",{className:"uil-checkbox"},l.default.createElement("input",a({type:"checkbox",checked:r,onChange:function(){u(!r)}},i)),l.default.createElement("div",{className:"uil-checkmark",style:{backgroundColor:t}})),s||l.default.createElement("span",null,o)))},exports.CustomInput=p,exports.NotifyModal=function(e){var t=e.callback,r=e.modalType,u=n(e,b);return l.default.createElement(E,a({type:r},u,{callback:t}))},exports.PasswordInput=function(t){var r=t.capsLockWarning,u=t.rules,c=t.ruleChecked,s=t.ruleUnchecked,i=t.setFailedRules,d=n(t,h),f=e.useState(!1),m=f[0],v=f[1];function E(e){var l;switch(e.type){case exports.PasswordRuleTypes.minLength:l="[a-zA-Z0-9ßÄäÖöÜü._!\"`'#%&§,:;<>=@{}~\\$\\(\\)\\*\\+\\/\\\\\\?\\[\\]\\^\\|\\-]{"+e.count+",}";break;case exports.PasswordRuleTypes.maxLength:l="^[a-zA-Z0-9ßÄäÖöÜü._!\"`'#%&,:;<>=@{}~\\$\\(\\)\\*\\+\\/\\\\\\?\\[\\]\\^\\|\\-]{0,"+e.count+"}$";break;case exports.PasswordRuleTypes.letters:l="[a-zA-ZßÄäÖöÜü]{"+e.count+",}";break;case exports.PasswordRuleTypes.numbers:l="[0-9]{"+e.count+",}";break;case exports.PasswordRuleTypes.special:l="[._!\"`'#%&§,:;<>=@{}~\\$\\(\\)\\*\\+\\/\\\\\\?\\[\\]\\^\\|\\-]{"+e.count+",}";break;case exports.PasswordRuleTypes.upper:l="[A-ZÄÖÜ]{"+e.count+",}";break;default:l=e.pattern?e.pattern:""}if(""===l)throw new Error("pattern must not be an empty string. Checked rule: "+e);return new RegExp(l).test(t.value)}return e.useEffect(function(){var e;e=[],u.forEach(function(t){E(t)||e.push(t)}),i(e)},[t.value]),e.useEffect(function(){function e(e){v(e.getModifierState&&e.getModifierState("CapsLock"))}return document.addEventListener("keydown",e),function(){return document.removeEventListener("keydown",e)}},[]),l.default.createElement(l.default.Fragment,null,l.default.createElement("div",null,l.default.createElement(p,a({},d)),l.default.createElement("div",{className:"uil-password-rules"},m&&l.default.createElement("div",{className:"uil-password-rule"},r),u.map(function(e,t){return l.default.createElement("div",{key:t,className:"uil-password-rule"},l.default.createElement(o,{src:E(e)?c:s,height:12,width:12}),l.default.createElement("span",null,e.label))}))))},exports.QuestionModal=function(e){var t=e.cancel,r=n(e,g);return l.default.createElement(E,a({type:v.question,close:t},r))},exports.SVG=o,exports.useOutsideClick=d;
2
- //# sourceMappingURL=index.js.map
package/dist/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","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/modal/baseModal.tsx","../src/components/modal/notifyModal.tsx","../src/components/modal/questionModal.tsx","../src/components/input/passwordInput.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() {\n if (!theme || disabled) return undefined;\n if (theme.charAt(0) !== '#') return '#ffffff';\n\n const color = theme.substring(1, 7);\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(),\n backgroundColor: disabled? undefined : theme,\n border: theme? 'none': undefined,\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, ReactNode} 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 children? : ReactNode;\n}\n\nexport function CustomCheckBox(props: ICustomCheckbox) {\n const {\n checkColor,\n checked,\n onCheck,\n label,\n children,\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 {children ? children : <span>{label}</span>}\n </div>\n </>\n );\n}","import React, {ComponentPropsWithoutRef, CSSProperties} from 'react';\nimport './images.scss';\n\ninterface ISvgIcon extends ComponentPropsWithoutRef<'svg'>{\n src : string;\n color? : string | undefined;\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 = 'error',\n question = 'question',\n success = 'success',\n warning = 'warning',\n}","import React, {useEffect} from 'react';\nimport {ModalType} from 'enums/ModalType';\nimport {CustomButton} from 'components/button/customButton';\nimport './modal.scss';\n\ninterface IBaseModal {\n close : () => void;\n message : string | string[];\n title : string;\n type : ModalType;\n callback? : (() => void) | undefined;\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 callback,\n cancelLabel = '',\n close,\n closeLabel,\n confirm,\n confirmLabel = '',\n message,\n timeout,\n title,\n type\n } = props;\n\n useEffect(() => {\n if (!timeout) return;\n\n const t = setTimeout(() => {\n callback && callback();\n\n close();\n }, timeout);\n\n return () => clearTimeout(t);\n },[]);\n\n function setHeaderClass() {\n switch (type) {\n case ModalType.error:\n return 'uil-header uil-error';\n case ModalType.success:\n return 'uil-header uil-success';\n case ModalType.warning:\n return 'uil-header uil-warning';\n default:\n return 'uil-header';\n }\n }\n\n return (\n <div className={'uil-modal-wrapper'}>\n <div className={'uil-modal'}>\n <div className={setHeaderClass()}>\n {title}\n </div>\n\n {timeout &&\n <div className={'uil-progress-wrapper'}>\n <div className={'uil-progress-bar'} style={{animationDuration: `${(timeout / 1000) + 1}s`}}/>\n </div>\n }\n\n <div className={'uil-content'}>\n <div>\n {Array.isArray(message) ?\n message.map((m, idx) => <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={close} 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={close} type={'button'}/>\n </>\n }\n </div>\n </div>\n </div>\n </div>\n );\n}","import React from 'react';\nimport {BaseModal} from './baseModal';\nimport {ModalType} from 'enums/ModalType';\n\nexport interface INotifyModal {\n close : () => void;\n closeLabel: string;\n modalType : 'success' | 'warning' | 'error';\n message : string | string[];\n title : string;\n callback? : (() => void) | undefined;\n timeout? : number;\n}\n\nexport function NotifyModal(props: INotifyModal) {\n const {\n callback,\n modalType,\n ...modalProps\n } = props;\n\n return (\n <BaseModal type={modalType as ModalType} {...modalProps} callback={callback}/>\n );\n}","import React from 'react';\nimport {BaseModal} from './baseModal';\nimport {ModalType} from 'enums/ModalType';\n\nexport interface IQuestionModal {\n cancel : () => void;\n cancelLabel : string;\n confirm : () => void;\n confirmLabel: string;\n message : string | string[];\n title : string;\n}\n\nexport function QuestionModal(props: IQuestionModal) {\n const {\n cancel,\n ...modalProps\n } = props;\n\n return (\n <BaseModal type={ModalType.question} close={cancel} {...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 () => document.removeEventListener('keydown', setCapsLockState);\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): boolean {\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 === '') throw new Error(`pattern must not be an empty string. Checked rule: ${rule}`);\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}"],"names":["_excluded","CustomButton","props","_props$disabled","disabled","label","_props$small","small","theme","buttonProps","_objectWithoutPropertiesLoose","style","color","charAt","substring","c","parseInt","map","col","Math","pow","setColor","backgroundColor","undefined","border","React","createElement","_extends","className","SVG","src","height","width","includes","Error","fill","href","BaseInput","iconColor","iconSrc","inputColor","toggle","valueChanged","inputProps","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","ModalType","BaseModal","_props$cancelLabel","cancelLabel","close","closeLabel","confirm","_props$confirmLabel","confirmLabel","message","timeout","title","type","t","setTimeout","clearTimeout","error","success","warning","setHeaderClass","animationDuration","Array","isArray","m","idx","key","question","checkColor","checked","onCheck","children","checkProps","modalType","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","cancel"],"mappings":"0dAAA,IAAAA,EAAA,CAAA,WAAA,QAAA,QAAA,SAUgB,SAAAC,EAAaC,GAC3B,IAAAC,EAMID,EALFE,SAAAA,OAAQ,IAAAD,GAAQA,EAChBE,EAIEH,EAJFG,MAAKC,EAIHJ,EAHFK,MAAAA,WAAKD,GAAQA,EAC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AAI,SAACoG,EAAMlB,GAAG,OACnB1E,+BAAK2E,IAAKD,EAAKvE,UAAW,qBACxBH,EAAAA,QAACC,cAAAG,EAAI,CAAAC,IAAKsF,EAAUC,GAAON,EAAcC,EAAejF,OAAQ,GAAIC,MAAO,KAE3EP,EAAAA,QAAOC,cAAA,OAAA,KAAA2F,EAAKhH,OACR,KAMlB,wBDnGgB,SAAcH,GAC5B,IACEmI,EAEEnI,EAFFmI,OACGzB,EAAUlG,EACXR,EAAKF,GAET,OACEyB,EAAAA,QAACC,cAAAkD,EAASjD,EAAC4D,CAAAA,KAAMZ,EAAU0B,SAAUtB,MAAOsD,GAAYzB,GAE5D"}
package/dist/index.mjs DELETED
@@ -1,2 +0,0 @@
1
- import e,{useRef as t,useEffect as n,useState as r}from"react";function l(){return l=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},l.apply(null,arguments)}function a(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var c=["disabled","label","small","theme"];function i(t){var n=t.disabled,r=void 0!==n&&n,i=t.label,o=t.small,u=void 0!==o&&o,s=t.theme,m=a(t,c),d={color:function(){if(s&&!r){if("#"!==s.charAt(0))return"#ffffff";var e=s.substring(1,7),t=[parseInt(e.substring(0,2),16)/255,parseInt(e.substring(2,4),16)/255,parseInt(e.substring(4,6),16)/255].map(function(e){return e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4)});return.2126*t[0]+.7152*t[1]+.0722*t[2]>.179?"#000000":"#ffffff"}}(),backgroundColor:r?void 0:s,border:s?"none":void 0};return e.createElement("button",l({className:"uil-button "+(r?"uil-disabled":"")+" "+(u?"uil-small":""),style:d,disabled:r},m),i)}var o=["checkColor","checked","onCheck","label","children"];function u(t){var n=t.checkColor,r=t.checked,c=t.onCheck,i=t.label,u=t.children,s=a(t,o);return e.createElement(e.Fragment,null,e.createElement("div",{className:"uil-check-wrapper"},e.createElement("label",{className:"uil-checkbox"},e.createElement("input",l({type:"checkbox",checked:r,onChange:function(){c(!r)}},s)),e.createElement("div",{className:"uil-checkmark",style:{backgroundColor:n}})),u||e.createElement("span",null,i)))}function s(t){var n=t.src,r=t.color,l=t.height,a=t.width;if(!n.includes(".svg"))throw new Error("Provided src is not an svg image");return e.createElement("svg",{"aria-hidden":!0,className:"uil-svg",style:{fill:r,height:l+"px",width:a+"px"}},e.createElement("use",{href:n}))}var m=["iconColor","iconSrc","inputColor","label","toggle","valueChanged"];function d(t){var n=t.iconColor,r=t.iconSrc,c=t.inputColor,i=t.label,o=t.toggle,u=t.valueChanged,d=a(t,m);return e.createElement("label",{className:"uil-input-wrapper",htmlFor:d.id},e.createElement("input",l({className:"uil-input",onChange:function(e){return u(e.target.value)},placeholder:i,style:{color:c}},d)),r&&e.createElement("div",{className:"uil-icon",onClick:o},e.createElement(s,{src:r,width:24,height:24,color:n})),e.createElement("span",{className:"uil-label",style:{color:c}},i))}function p(e){var r=t(null);return n(function(){function t(t){r.current&&!r.current.contains(t.target)&&e()}return document.addEventListener("click",t),document.addEventListener("touchend",t),function(){document.removeEventListener("click",t),document.removeEventListener("touchend",t)}},[e]),r}var f,v=["tooltipClose","tooltipIcon","tooltipText"];function h(t){var n=t.tooltipClose,c=t.tooltipIcon,i=t.tooltipText,o=a(t,v),u=r(!1),m=u[0],f=u[1],h=p(E);function E(){f(!1)}return e.createElement(e.Fragment,null,c?e.createElement("div",{className:"uil-tooltip-wrapper"},m&&e.createElement("div",{className:"uil-tooltip",ref:h},n&&e.createElement("button",{className:"uil-tooltip-button",onClick:E},n),e.createElement("span",null,i)),e.createElement("div",{className:"uil-tooltip-icon",onClick:function(){return f(!m)}},e.createElement(s,{src:c,height:16,width:16})),e.createElement(d,l({},o))):e.createElement(d,l({},o)))}!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"}(f||(f={}));var E,b=["capsLockWarning","rules","ruleChecked","ruleUnchecked","setFailedRules"];function g(t){var c=t.capsLockWarning,i=t.rules,o=t.ruleChecked,u=t.ruleUnchecked,m=t.setFailedRules,d=a(t,b),p=r(!1),v=p[0],E=p[1];function g(e){var n;switch(e.type){case f.minLength:n="[a-zA-Z0-9ßÄäÖöÜü._!\"`'#%&§,:;<>=@{}~\\$\\(\\)\\*\\+\\/\\\\\\?\\[\\]\\^\\|\\-]{"+e.count+",}";break;case f.maxLength:n="^[a-zA-Z0-9ßÄäÖöÜü._!\"`'#%&,:;<>=@{}~\\$\\(\\)\\*\\+\\/\\\\\\?\\[\\]\\^\\|\\-]{0,"+e.count+"}$";break;case f.letters:n="[a-zA-ZßÄäÖöÜü]{"+e.count+",}";break;case f.numbers:n="[0-9]{"+e.count+",}";break;case f.special:n="[._!\"`'#%&§,:;<>=@{}~\\$\\(\\)\\*\\+\\/\\\\\\?\\[\\]\\^\\|\\-]{"+e.count+",}";break;case f.upper:n="[A-ZÄÖÜ]{"+e.count+",}";break;default:n=e.pattern?e.pattern:""}if(""===n)throw new Error("pattern must not be an empty string. Checked rule: "+e);return new RegExp(n).test(t.value)}return n(function(){var e;e=[],i.forEach(function(t){g(t)||e.push(t)}),m(e)},[t.value]),n(function(){function e(e){E(e.getModifierState&&e.getModifierState("CapsLock"))}return document.addEventListener("keydown",e),function(){return document.removeEventListener("keydown",e)}},[]),e.createElement(e.Fragment,null,e.createElement("div",null,e.createElement(h,l({},d)),e.createElement("div",{className:"uil-password-rules"},v&&e.createElement("div",{className:"uil-password-rule"},c),i.map(function(t,n){return e.createElement("div",{key:n,className:"uil-password-rule"},e.createElement(s,{src:g(t)?o:u,height:12,width:12}),e.createElement("span",null,t.label))}))))}function k(t){var r=t.callback,l=t.cancelLabel,a=void 0===l?"":l,c=t.close,o=t.closeLabel,u=t.confirm,s=t.confirmLabel,m=void 0===s?"":s,d=t.message,p=t.timeout,f=t.title,v=t.type;return n(function(){if(p){var e=setTimeout(function(){r&&r(),c()},p);return function(){return clearTimeout(e)}}},[]),e.createElement("div",{className:"uil-modal-wrapper"},e.createElement("div",{className:"uil-modal"},e.createElement("div",{className:function(){switch(v){case E.error:return"uil-header uil-error";case E.success:return"uil-header uil-success";case E.warning:return"uil-header uil-warning";default:return"uil-header"}}()},f),p&&e.createElement("div",{className:"uil-progress-wrapper"},e.createElement("div",{className:"uil-progress-bar",style:{animationDuration:p/1e3+1+"s"}})),e.createElement("div",{className:"uil-content"},e.createElement("div",null,Array.isArray(d)?d.map(function(t,n){return e.createElement("p",{key:n,className:"uil-modal-text"},t)}):e.createElement("p",{className:"uil-modal-text"},d)),e.createElement("div",{className:"uil-button-wrapper "+(v!==E.question?"uil-single":"")},v!==E.question&&e.createElement(i,{label:null!=o?o:"",small:!0,onClick:c,type:"button"}),v==E.question&&t.confirm&&e.createElement(e.Fragment,null,e.createElement(i,{label:m,theme:"#00416A",small:!0,onClick:u,type:"button"}),e.createElement(i,{label:a,small:!0,onClick:c,type:"button"}))))))}!function(e){e.error="error",e.question="question",e.success="success",e.warning="warning"}(E||(E={}));var w=["callback","modalType"];function y(t){var n=t.callback,r=t.modalType,c=a(t,w);return e.createElement(k,l({type:r},c,{callback:n}))}var C=["cancel"];function N(t){var n=t.cancel,r=a(t,C);return e.createElement(k,l({type:E.question,close:n},r))}export{i as CustomButton,u as CustomCheckBox,h as CustomInput,y as NotifyModal,g as PasswordInput,f as PasswordRuleTypes,N as QuestionModal,s as SVG,p as useOutsideClick};
2
- //# sourceMappingURL=index.mjs.map
@@ -1 +0,0 @@
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() {\n if (!theme || disabled) return undefined;\n if (theme.charAt(0) !== '#') return '#ffffff';\n\n const color = theme.substring(1, 7);\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(),\n backgroundColor: disabled? undefined : theme,\n border: theme? 'none': undefined,\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, ReactNode} 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 children? : ReactNode;\n}\n\nexport function CustomCheckBox(props: ICustomCheckbox) {\n const {\n checkColor,\n checked,\n onCheck,\n label,\n children,\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 {children ? children : <span>{label}</span>}\n </div>\n </>\n );\n}","import React, {ComponentPropsWithoutRef, CSSProperties} from 'react';\nimport './images.scss';\n\ninterface ISvgIcon extends ComponentPropsWithoutRef<'svg'>{\n src : string;\n color? : string | undefined;\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 = 'error',\n question = 'question',\n success = 'success',\n warning = 'warning',\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 () => document.removeEventListener('keydown', setCapsLockState);\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): boolean {\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 === '') throw new Error(`pattern must not be an empty string. Checked rule: ${rule}`);\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} from 'react';\nimport {ModalType} from 'enums/ModalType';\nimport {CustomButton} from 'components/button/customButton';\nimport './modal.scss';\n\ninterface IBaseModal {\n close : () => void;\n message : string | string[];\n title : string;\n type : ModalType;\n callback? : (() => void) | undefined;\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 callback,\n cancelLabel = '',\n close,\n closeLabel,\n confirm,\n confirmLabel = '',\n message,\n timeout,\n title,\n type\n } = props;\n\n useEffect(() => {\n if (!timeout) return;\n\n const t = setTimeout(() => {\n callback && callback();\n\n close();\n }, timeout);\n\n return () => clearTimeout(t);\n },[]);\n\n function setHeaderClass() {\n switch (type) {\n case ModalType.error:\n return 'uil-header uil-error';\n case ModalType.success:\n return 'uil-header uil-success';\n case ModalType.warning:\n return 'uil-header uil-warning';\n default:\n return 'uil-header';\n }\n }\n\n return (\n <div className={'uil-modal-wrapper'}>\n <div className={'uil-modal'}>\n <div className={setHeaderClass()}>\n {title}\n </div>\n\n {timeout &&\n <div className={'uil-progress-wrapper'}>\n <div className={'uil-progress-bar'} style={{animationDuration: `${(timeout / 1000) + 1}s`}}/>\n </div>\n }\n\n <div className={'uil-content'}>\n <div>\n {Array.isArray(message) ?\n message.map((m, idx) => <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={close} 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={close} type={'button'}/>\n </>\n }\n </div>\n </div>\n </div>\n </div>\n );\n}","import React from 'react';\nimport {BaseModal} from './baseModal';\nimport {ModalType} from 'enums/ModalType';\n\nexport interface INotifyModal {\n close : () => void;\n closeLabel: string;\n modalType : 'success' | 'warning' | 'error';\n message : string | string[];\n title : string;\n callback? : (() => void) | undefined;\n timeout? : number;\n}\n\nexport function NotifyModal(props: INotifyModal) {\n const {\n callback,\n modalType,\n ...modalProps\n } = props;\n\n return (\n <BaseModal type={modalType as ModalType} {...modalProps} callback={callback}/>\n );\n}","import React from 'react';\nimport {BaseModal} from './baseModal';\nimport {ModalType} from 'enums/ModalType';\n\nexport interface IQuestionModal {\n cancel : () => void;\n cancelLabel : string;\n confirm : () => void;\n confirmLabel: string;\n message : string | string[];\n title : string;\n}\n\nexport function QuestionModal(props: IQuestionModal) {\n const {\n cancel,\n ...modalProps\n } = props;\n\n return (\n <BaseModal type={ModalType.question} close={cancel} {...modalProps}/>\n );\n}"],"names":["_excluded","CustomButton","props","_props$disabled","disabled","label","_props$small","small","theme","buttonProps","_objectWithoutPropertiesLoose","style","color","charAt","substring","c","parseInt","map","col","Math","pow","setColor","backgroundColor","undefined","border","React","createElement","_extends","className","CustomCheckBox","checkColor","checked","onCheck","children","checkProps","Fragment","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","key","BaseModal","_props$cancelLabel","cancelLabel","close","closeLabel","confirm","_props$confirmLabel","confirmLabel","message","timeout","title","t","setTimeout","clearTimeout","error","success","warning","setHeaderClass","animationDuration","Array","isArray","m","question","NotifyModal","modalType","modalProps","QuestionModal","cancel"],"mappings":"kaAAA,IAAAA,EAAA,CAAA,WAAA,QAAA,QAAA,SAUgB,SAAAC,EAAaC,GAC3B,IAAAC,EAMID,EALFE,SAAAA,OAAQ,IAAAD,GAAQA,EAChBE,EAIEH,EAJFG,MAAKC,EAIHJ,EAHFK,MAAAA,WAAKD,GAAQA,EACbE,EAEEN,EAFFM,MACGC,EAAWC,EACZR,EAAKF,GAoBHW,EAAuB,CAC3BC,MAnBF,WACE,GAAKJ,IAASJ,EAAd,CACA,GAAwB,MAApBI,EAAMK,OAAO,GAAY,MAAO,UAEpC,IAAMD,EAAQJ,EAAMM,UAAU,EAAG,GAM3BC,EALW,CACfC,SAASJ,EAAME,UAAU,EAAG,GAAI,IAAM,IACtCE,SAASJ,EAAME,UAAU,EAAG,GAAI,IAAM,IACtCE,SAASJ,EAAME,UAAU,EAAG,GAAI,IAAM,KAErBG,IAAI,SAAAC,GACrB,OAAOA,GAAO,OAAUA,EAAM,MAASC,KAAKC,KAAKF,EAAM,MAAS,MAAO,IACzE,GAGA,MAFW,MAASH,EAAE,GAAO,MAASA,EAAE,GAAO,MAASA,EAAE,GAE/C,KAAQ,UAAY,SAdS,CAe1C,CAGSM,GACPC,gBAAiBlB,OAAUmB,EAAYf,EACvCgB,OAAQhB,EAAO,YAAQe,GAGzB,OACEE,EAAQC,cAAA,SAAAC,EAAAC,CAAAA,yBAAyB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M,WAC1FX,EAACC,cAAAzB,EAAa,CAAAI,MAAO2G,EAAazG,OAAO,EAAMoD,QAASsD,EAAO7E,KAAM,eAQrF,EF9FA,SAAY8C,GACVA,EAAA,MAAA,QACAA,EAAA,SAAA,WACAA,EAAA,QAAA,UACAA,EAAA,QAAA,SACD,CALD,CAAYA,IAAAA,EAKX,CAAA,IGLD,IAAAlF,EAAA,CAAA,WAAA,aAcM,SAAUqI,EAAYnI,GAC1B,IACE2D,EAGE3D,EAHF2D,SACAyE,EAEEpI,EAFFoI,UACGC,EAAU7H,EACXR,EAAKF,GAET,OACEyB,EAAAC,cAACoF,EAASnF,EAAA,CAACS,KAAMkG,GAA4BC,EAAU,CAAE1E,SAAUA,IAEvE,CCxBA,IAAA7D,EAAA,CAAA,UAagB,SAAAwI,EAActI,GAC5B,IACEuI,EAEEvI,EAFFuI,OACGF,EAAU7H,EACXR,EAAKF,GAET,OACEyB,EAACC,cAAAoF,EAASnF,EAACS,CAAAA,KAAM8C,EAAUkD,SAAUnB,MAAOwB,GAAYF,GAE5D"}
@@ -1,2 +0,0 @@
1
- import e,{useRef as t,useEffect as n,useState as l}from"react";function r(){return r=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var l in n)({}).hasOwnProperty.call(n,l)&&(e[l]=n[l])}return e},r.apply(null,arguments)}function a(e,t){if(null==e)return{};var n={};for(var l in e)if({}.hasOwnProperty.call(e,l)){if(t.indexOf(l)>=0)continue;n[l]=e[l]}return n}const c=["disabled","label","small","theme"];function o(t){const{disabled:n=!1,label:l,small:o=!1,theme:s}=t,i=a(t,c),u={color:function(){if(!s||n)return;if("#"!==s.charAt(0))return"#ffffff";const e=s.substring(1,7),t=[parseInt(e.substring(0,2),16)/255,parseInt(e.substring(2,4),16)/255,parseInt(e.substring(4,6),16)/255].map(e=>e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4));return.2126*t[0]+.7152*t[1]+.0722*t[2]>.179?"#000000":"#ffffff"}(),backgroundColor:n?void 0:s,border:s?"none":void 0};return e.createElement("button",r({className:`uil-button ${n?"uil-disabled":""} ${o?"uil-small":""}`,style:u,disabled:n},i),l)}const s=["checkColor","checked","onCheck","label","children"];function i(t){const{checkColor:n,checked:l,onCheck:c,label:o,children:i}=t,u=a(t,s);return e.createElement(e.Fragment,null,e.createElement("div",{className:"uil-check-wrapper"},e.createElement("label",{className:"uil-checkbox"},e.createElement("input",r({type:"checkbox",checked:l,onChange:()=>{c(!l)}},u)),e.createElement("div",{className:"uil-checkmark",style:{backgroundColor:n}})),i||e.createElement("span",null,o)))}function u(t){const{src:n,color:l,height:r,width:a}=t;if(!n.includes(".svg"))throw new Error("Provided src is not an svg image");return e.createElement("svg",{"aria-hidden":!0,className:"uil-svg",style:{fill:l,height:`${r}px`,width:`${a}px`}},e.createElement("use",{href:n}))}const m=["iconColor","iconSrc","inputColor","label","toggle","valueChanged"];function d(t){const{iconColor:n,iconSrc:l,inputColor:c,label:o,toggle:s,valueChanged:i}=t,d=a(t,m);return e.createElement("label",{className:"uil-input-wrapper",htmlFor:d.id},e.createElement("input",r({className:"uil-input",onChange:e=>i(e.target.value),placeholder:o,style:{color:c}},d)),l&&e.createElement("div",{className:"uil-icon",onClick:s},e.createElement(u,{src:l,width:24,height:24,color:n})),e.createElement("span",{className:"uil-label",style:{color:c}},o))}function p(e){const l=t(null);return n(()=>{function t(t){l.current&&!l.current.contains(t.target)&&e()}return document.addEventListener("click",t),document.addEventListener("touchend",t),()=>{document.removeEventListener("click",t),document.removeEventListener("touchend",t)}},[e]),l}const h=["tooltipClose","tooltipIcon","tooltipText"];function f(t){const{tooltipClose:n,tooltipIcon:c,tooltipText:o}=t,s=a(t,h),[i,m]=l(!1),f=p(E);function E(){m(!1)}return e.createElement(e.Fragment,null,c?e.createElement("div",{className:"uil-tooltip-wrapper"},i&&e.createElement("div",{className:"uil-tooltip",ref:f},n&&e.createElement("button",{className:"uil-tooltip-button",onClick:E},n),e.createElement("span",null,o)),e.createElement("div",{className:"uil-tooltip-icon",onClick:()=>m(!i)},e.createElement(u,{src:c,height:16,width:16})),e.createElement(d,r({},s))):e.createElement(d,r({},s)))}var E;!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"}(E||(E={}));const b=["capsLockWarning","rules","ruleChecked","ruleUnchecked","setFailedRules"];function g(t){const{capsLockWarning:c,rules:o,ruleChecked:s,ruleUnchecked:i,setFailedRules:m}=t,d=a(t,b),[p,h]=l(!1);function g(e){let n;switch(e.type){case E.minLength:n=`[a-zA-Z0-9ßÄäÖöÜü._!"\`'#%&§,:;<>=@{}~\\$\\(\\)\\*\\+\\/\\\\\\?\\[\\]\\^\\|\\-]{${e.count},}`;break;case E.maxLength:n=`^[a-zA-Z0-9ßÄäÖöÜü._!"\`'#%&,:;<>=@{}~\\$\\(\\)\\*\\+\\/\\\\\\?\\[\\]\\^\\|\\-]{0,${e.count}}$`;break;case E.letters:n=`[a-zA-ZßÄäÖöÜü]{${e.count},}`;break;case E.numbers:n=`[0-9]{${e.count},}`;break;case E.special:n=`[._!"\`'#%&§,:;<>=@{}~\\$\\(\\)\\*\\+\\/\\\\\\?\\[\\]\\^\\|\\-]{${e.count},}`;break;case E.upper:n=`[A-ZÄÖÜ]{${e.count},}`;break;default:n=e.pattern?e.pattern:""}if(""===n)throw new Error(`pattern must not be an empty string. Checked rule: ${e}`);return new RegExp(n).test(t.value)}return n(()=>{!function(){const e=[];o.forEach(t=>{g(t)||e.push(t)}),m(e)}()},[t.value]),n(()=>{function e(e){h(e.getModifierState&&e.getModifierState("CapsLock"))}return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[]),e.createElement(e.Fragment,null,e.createElement("div",null,e.createElement(f,r({},d)),e.createElement("div",{className:"uil-password-rules"},p&&e.createElement("div",{className:"uil-password-rule"},c),o.map((t,n)=>e.createElement("div",{key:n,className:"uil-password-rule"},e.createElement(u,{src:g(t)?s:i,height:12,width:12}),e.createElement("span",null,t.label))))))}var v;function k(t){const{callback:l,cancelLabel:r="",close:a,closeLabel:c,confirm:s,confirmLabel:i="",message:u,timeout:m,title:d,type:p}=t;return n(()=>{if(!m)return;const e=setTimeout(()=>{l&&l(),a()},m);return()=>clearTimeout(e)},[]),e.createElement("div",{className:"uil-modal-wrapper"},e.createElement("div",{className:"uil-modal"},e.createElement("div",{className:function(){switch(p){case v.error:return"uil-header uil-error";case v.success:return"uil-header uil-success";case v.warning:return"uil-header uil-warning";default:return"uil-header"}}()},d),m&&e.createElement("div",{className:"uil-progress-wrapper"},e.createElement("div",{className:"uil-progress-bar",style:{animationDuration:m/1e3+1+"s"}})),e.createElement("div",{className:"uil-content"},e.createElement("div",null,Array.isArray(u)?u.map((t,n)=>e.createElement("p",{key:n,className:"uil-modal-text"},t)):e.createElement("p",{className:"uil-modal-text"},u)),e.createElement("div",{className:"uil-button-wrapper "+(p!==v.question?"uil-single":"")},p!==v.question&&e.createElement(o,{label:null!=c?c:"",small:!0,onClick:a,type:"button"}),p==v.question&&t.confirm&&e.createElement(e.Fragment,null,e.createElement(o,{label:i,theme:"#00416A",small:!0,onClick:s,type:"button"}),e.createElement(o,{label:r,small:!0,onClick:a,type:"button"}))))))}!function(e){e.error="error",e.question="question",e.success="success",e.warning="warning"}(v||(v={}));const w=["callback","modalType"];function y(t){const{callback:n,modalType:l}=t,c=a(t,w);return e.createElement(k,r({type:l},c,{callback:n}))}const C=["cancel"];function N(t){const{cancel:n}=t,l=a(t,C);return e.createElement(k,r({type:v.question,close:n},l))}export{o as CustomButton,i as CustomCheckBox,f as CustomInput,y as NotifyModal,g as PasswordInput,E as PasswordRuleTypes,N as QuestionModal,u as SVG,p as useOutsideClick};
2
- //# sourceMappingURL=index.modern.mjs.map
@@ -1 +0,0 @@
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() {\n if (!theme || disabled) return undefined;\n if (theme.charAt(0) !== '#') return '#ffffff';\n\n const color = theme.substring(1, 7);\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(),\n backgroundColor: disabled? undefined : theme,\n border: theme? 'none': undefined,\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, ReactNode} 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 children? : ReactNode;\n}\n\nexport function CustomCheckBox(props: ICustomCheckbox) {\n const {\n checkColor,\n checked,\n onCheck,\n label,\n children,\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 {children ? children : <span>{label}</span>}\n </div>\n </>\n );\n}","import React, {ComponentPropsWithoutRef, CSSProperties} from 'react';\nimport './images.scss';\n\ninterface ISvgIcon extends ComponentPropsWithoutRef<'svg'>{\n src : string;\n color? : string | undefined;\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 () => document.removeEventListener('keydown', setCapsLockState);\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): boolean {\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 === '') throw new Error(`pattern must not be an empty string. Checked rule: ${rule}`);\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 = 'error',\n question = 'question',\n success = 'success',\n warning = 'warning',\n}","import React, {useEffect} from 'react';\nimport {ModalType} from 'enums/ModalType';\nimport {CustomButton} from 'components/button/customButton';\nimport './modal.scss';\n\ninterface IBaseModal {\n close : () => void;\n message : string | string[];\n title : string;\n type : ModalType;\n callback? : (() => void) | undefined;\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 callback,\n cancelLabel = '',\n close,\n closeLabel,\n confirm,\n confirmLabel = '',\n message,\n timeout,\n title,\n type\n } = props;\n\n useEffect(() => {\n if (!timeout) return;\n\n const t = setTimeout(() => {\n callback && callback();\n\n close();\n }, timeout);\n\n return () => clearTimeout(t);\n },[]);\n\n function setHeaderClass() {\n switch (type) {\n case ModalType.error:\n return 'uil-header uil-error';\n case ModalType.success:\n return 'uil-header uil-success';\n case ModalType.warning:\n return 'uil-header uil-warning';\n default:\n return 'uil-header';\n }\n }\n\n return (\n <div className={'uil-modal-wrapper'}>\n <div className={'uil-modal'}>\n <div className={setHeaderClass()}>\n {title}\n </div>\n\n {timeout &&\n <div className={'uil-progress-wrapper'}>\n <div className={'uil-progress-bar'} style={{animationDuration: `${(timeout / 1000) + 1}s`}}/>\n </div>\n }\n\n <div className={'uil-content'}>\n <div>\n {Array.isArray(message) ?\n message.map((m, idx) => <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={close} 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={close} type={'button'}/>\n </>\n }\n </div>\n </div>\n </div>\n </div>\n );\n}","import React from 'react';\nimport {BaseModal} from './baseModal';\nimport {ModalType} from 'enums/ModalType';\n\nexport interface INotifyModal {\n close : () => void;\n closeLabel: string;\n modalType : 'success' | 'warning' | 'error';\n message : string | string[];\n title : string;\n callback? : (() => void) | undefined;\n timeout? : number;\n}\n\nexport function NotifyModal(props: INotifyModal) {\n const {\n callback,\n modalType,\n ...modalProps\n } = props;\n\n return (\n <BaseModal type={modalType as ModalType} {...modalProps} callback={callback}/>\n );\n}","import React from 'react';\nimport {BaseModal} from './baseModal';\nimport {ModalType} from 'enums/ModalType';\n\nexport interface IQuestionModal {\n cancel : () => void;\n cancelLabel : string;\n confirm : () => void;\n confirmLabel: string;\n message : string | string[];\n title : string;\n}\n\nexport function QuestionModal(props: IQuestionModal) {\n const {\n cancel,\n ...modalProps\n } = props;\n\n return (\n <BaseModal type={ModalType.question} close={cancel} {...modalProps}/>\n );\n}"],"names":["_excluded","CustomButton","props","disabled","label","small","theme","buttonProps","_objectWithoutPropertiesLoose","style","color","charAt","substring","c","parseInt","map","col","Math","pow","setColor","backgroundColor","undefined","border","React","createElement","_extends","className","CustomCheckBox","checkColor","checked","onCheck","children","checkProps","Fragment","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","key","ModalType","BaseModal","cancelLabel","close","closeLabel","confirm","confirmLabel","message","timeout","title","t","setTimeout","clearTimeout","error","success","warning","setHeaderClass","animationDuration","Array","isArray","m","question","NotifyModal","modalType","modalProps","QuestionModal","cancel"],"mappings":"kaAAA,MAAAA,EAAA,CAAA,WAAA,QAAA,QAAA,SAUM,SAAUC,EAAaC,GAC3B,MAAMC,SACJA,GAAW,EAAKC,MAChBA,EAAKC,MACLA,GAAQ,EAAKC,MACbA,GAEEJ,EADCK,EAAWC,EACZN,EAAKF,GAoBHS,EAAuB,CAC3BC,MAnBF,WACE,IAAKJ,GAASH,EAAU,OACxB,GAAwB,MAApBG,EAAMK,OAAO,GAAY,MAAO,UAEpC,MAAMD,EAAQJ,EAAMM,UAAU,EAAG,GAM3BC,EALW,CACfC,SAASJ,EAAME,UAAU,EAAG,GAAI,IAAM,IACtCE,SAASJ,EAAME,UAAU,EAAG,GAAI,IAAM,IACtCE,SAASJ,EAAME,UAAU,EAAG,GAAI,IAAM,KAErBG,IAAIC,GACdA,GAAO,OAAUA,EAAM,MAASC,KAAKC,KAAKF,EAAM,MAAS,MAAO,MAIzE,MAFW,MAASH,EAAE,GAAO,MAASA,EAAE,GAAO,MAASA,EAAE,GAE/C,KAAQ,UAAY,SACjC,CAGSM,GACPC,gBAAiBjB,OAAUkB,EAAYf,EACvCgB,OAAQhB,EAAO,YAAQe,GAGzB,OACEE,EAAQC,cAAA,SAAAC,EAAA,CAAAC,UAAW,cAAcvB,EA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,GAC5B,MAAMmI,OACJA,GAEEnI,EADCiI,EAAU3H,EACXN,EAAKF,GAET,OACEuB,EAACC,cAAAoF,EAASnF,EAAA,CAACS,KAAMyE,EAAUqB,SAAUlB,MAAOuB,GAAYF,GAE5D"}
package/dist/index.umd.js DELETED
@@ -1,2 +0,0 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],t):t((e||self).uiLibrary={},e.react)}(this,function(e,t){function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a=/*#__PURE__*/l(t);function n(){return n=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var a in l)({}).hasOwnProperty.call(l,a)&&(e[a]=l[a])}return e},n.apply(null,arguments)}function r(e,t){if(null==e)return{};var l={};for(var a in e)if({}.hasOwnProperty.call(e,a)){if(t.indexOf(a)>=0)continue;l[a]=e[a]}return l}var u=["disabled","label","small","theme"];function c(e){var t=e.disabled,l=void 0!==t&&t,c=e.label,o=e.small,i=void 0!==o&&o,s=e.theme,d=r(e,u),f={color:function(){if(s&&!l){if("#"!==s.charAt(0))return"#ffffff";var e=s.substring(1,7),t=[parseInt(e.substring(0,2),16)/255,parseInt(e.substring(2,4),16)/255,parseInt(e.substring(4,6),16)/255].map(function(e){return e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4)});return.2126*t[0]+.7152*t[1]+.0722*t[2]>.179?"#000000":"#ffffff"}}(),backgroundColor:l?void 0:s,border:s?"none":void 0};return a.default.createElement("button",n({className:"uil-button "+(l?"uil-disabled":"")+" "+(i?"uil-small":""),style:f,disabled:l},d),c)}var o=["checkColor","checked","onCheck","label","children"];function i(e){var t=e.src,l=e.color,n=e.height,r=e.width;if(!t.includes(".svg"))throw new Error("Provided src is not an svg image");return a.default.createElement("svg",{"aria-hidden":!0,className:"uil-svg",style:{fill:l,height:n+"px",width:r+"px"}},a.default.createElement("use",{href:t}))}var s=["iconColor","iconSrc","inputColor","label","toggle","valueChanged"];function d(e){var t=e.iconColor,l=e.iconSrc,u=e.inputColor,c=e.label,o=e.toggle,d=e.valueChanged,f=r(e,s);return a.default.createElement("label",{className:"uil-input-wrapper",htmlFor:f.id},a.default.createElement("input",n({className:"uil-input",onChange:function(e){return d(e.target.value)},placeholder:c,style:{color:u}},f)),l&&a.default.createElement("div",{className:"uil-icon",onClick:o},a.default.createElement(i,{src:l,width:24,height:24,color:t})),a.default.createElement("span",{className:"uil-label",style:{color:u}},c))}function f(e){var l=t.useRef(null);return t.useEffect(function(){function t(t){l.current&&!l.current.contains(t.target)&&e()}return document.addEventListener("click",t),document.addEventListener("touchend",t),function(){document.removeEventListener("click",t),document.removeEventListener("touchend",t)}},[e]),l}var m,p=["tooltipClose","tooltipIcon","tooltipText"];function h(e){var l=e.tooltipClose,u=e.tooltipIcon,c=e.tooltipText,o=r(e,p),s=t.useState(!1),m=s[0],h=s[1],v=f(E);function E(){h(!1)}return a.default.createElement(a.default.Fragment,null,u?a.default.createElement("div",{className:"uil-tooltip-wrapper"},m&&a.default.createElement("div",{className:"uil-tooltip",ref:v},l&&a.default.createElement("button",{className:"uil-tooltip-button",onClick:E},l),a.default.createElement("span",null,c)),a.default.createElement("div",{className:"uil-tooltip-icon",onClick:function(){return h(!m)}},a.default.createElement(i,{src:u,height:16,width:16})),a.default.createElement(d,n({},o))):a.default.createElement(d,n({},o)))}e.PasswordRuleTypes=void 0,(m=e.PasswordRuleTypes||(e.PasswordRuleTypes={}))[m.minLength=0]="minLength",m[m.maxLength=1]="maxLength",m[m.letters=2]="letters",m[m.numbers=3]="numbers",m[m.special=4]="special",m[m.upper=5]="upper";var v,E=["capsLockWarning","rules","ruleChecked","ruleUnchecked","setFailedRules"];function b(e){var l=e.callback,n=e.cancelLabel,r=void 0===n?"":n,u=e.close,o=e.closeLabel,i=e.confirm,s=e.confirmLabel,d=void 0===s?"":s,f=e.message,m=e.timeout,p=e.title,h=e.type;return t.useEffect(function(){if(m){var e=setTimeout(function(){l&&l(),u()},m);return function(){return clearTimeout(e)}}},[]),a.default.createElement("div",{className:"uil-modal-wrapper"},a.default.createElement("div",{className:"uil-modal"},a.default.createElement("div",{className:function(){switch(h){case v.error:return"uil-header uil-error";case v.success:return"uil-header uil-success";case v.warning:return"uil-header uil-warning";default:return"uil-header"}}()},p),m&&a.default.createElement("div",{className:"uil-progress-wrapper"},a.default.createElement("div",{className:"uil-progress-bar",style:{animationDuration:m/1e3+1+"s"}})),a.default.createElement("div",{className:"uil-content"},a.default.createElement("div",null,Array.isArray(f)?f.map(function(e,t){return a.default.createElement("p",{key:t,className:"uil-modal-text"},e)}):a.default.createElement("p",{className:"uil-modal-text"},f)),a.default.createElement("div",{className:"uil-button-wrapper "+(h!==v.question?"uil-single":"")},h!==v.question&&a.default.createElement(c,{label:null!=o?o:"",small:!0,onClick:u,type:"button"}),h==v.question&&e.confirm&&a.default.createElement(a.default.Fragment,null,a.default.createElement(c,{label:d,theme:"#00416A",small:!0,onClick:i,type:"button"}),a.default.createElement(c,{label:r,small:!0,onClick:u,type:"button"}))))))}!function(e){e.error="error",e.question="question",e.success="success",e.warning="warning"}(v||(v={}));var g=["callback","modalType"],k=["cancel"];e.CustomButton=c,e.CustomCheckBox=function(e){var t=e.checkColor,l=e.checked,u=e.onCheck,c=e.label,i=e.children,s=r(e,o);return a.default.createElement(a.default.Fragment,null,a.default.createElement("div",{className:"uil-check-wrapper"},a.default.createElement("label",{className:"uil-checkbox"},a.default.createElement("input",n({type:"checkbox",checked:l,onChange:function(){u(!l)}},s)),a.default.createElement("div",{className:"uil-checkmark",style:{backgroundColor:t}})),i||a.default.createElement("span",null,c)))},e.CustomInput=h,e.NotifyModal=function(e){var t=e.callback,l=e.modalType,u=r(e,g);return a.default.createElement(b,n({type:l},u,{callback:t}))},e.PasswordInput=function(l){var u=l.capsLockWarning,c=l.rules,o=l.ruleChecked,s=l.ruleUnchecked,d=l.setFailedRules,f=r(l,E),m=t.useState(!1),p=m[0],v=m[1];function b(t){var a;switch(t.type){case e.PasswordRuleTypes.minLength:a="[a-zA-Z0-9ßÄäÖöÜü._!\"`'#%&§,:;<>=@{}~\\$\\(\\)\\*\\+\\/\\\\\\?\\[\\]\\^\\|\\-]{"+t.count+",}";break;case e.PasswordRuleTypes.maxLength:a="^[a-zA-Z0-9ßÄäÖöÜü._!\"`'#%&,:;<>=@{}~\\$\\(\\)\\*\\+\\/\\\\\\?\\[\\]\\^\\|\\-]{0,"+t.count+"}$";break;case e.PasswordRuleTypes.letters:a="[a-zA-ZßÄäÖöÜü]{"+t.count+",}";break;case e.PasswordRuleTypes.numbers:a="[0-9]{"+t.count+",}";break;case e.PasswordRuleTypes.special:a="[._!\"`'#%&§,:;<>=@{}~\\$\\(\\)\\*\\+\\/\\\\\\?\\[\\]\\^\\|\\-]{"+t.count+",}";break;case e.PasswordRuleTypes.upper:a="[A-ZÄÖÜ]{"+t.count+",}";break;default:a=t.pattern?t.pattern:""}if(""===a)throw new Error("pattern must not be an empty string. Checked rule: "+t);return new RegExp(a).test(l.value)}return t.useEffect(function(){var e;e=[],c.forEach(function(t){b(t)||e.push(t)}),d(e)},[l.value]),t.useEffect(function(){function e(e){v(e.getModifierState&&e.getModifierState("CapsLock"))}return document.addEventListener("keydown",e),function(){return document.removeEventListener("keydown",e)}},[]),a.default.createElement(a.default.Fragment,null,a.default.createElement("div",null,a.default.createElement(h,n({},f)),a.default.createElement("div",{className:"uil-password-rules"},p&&a.default.createElement("div",{className:"uil-password-rule"},u),c.map(function(e,t){return a.default.createElement("div",{key:t,className:"uil-password-rule"},a.default.createElement(i,{src:b(e)?o:s,height:12,width:12}),a.default.createElement("span",null,e.label))}))))},e.QuestionModal=function(e){var t=e.cancel,l=r(e,k);return a.default.createElement(b,n({type:v.question,close:t},l))},e.SVG=i,e.useOutsideClick=f});
2
- //# sourceMappingURL=index.umd.js.map