@hbuesing/ui-library 2.0.0 → 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.
- package/README.md +3 -1
- package/package.json +10 -41
- package/src/components/button/button.scss +25 -0
- package/src/components/button/customButton.tsx +84 -0
- package/src/components/button/index.ts +1 -0
- package/src/components/checkbox/checkbox.scss +13 -0
- package/src/components/checkbox/customCheckBox.tsx +35 -0
- package/src/components/checkbox/index.ts +1 -0
- package/src/components/global.scss +60 -0
- package/src/components/images/images.scss +12 -0
- package/src/components/images/index.ts +1 -0
- package/src/components/images/svgIcon.tsx +39 -0
- package/src/components/input/baseInput.tsx +48 -0
- package/src/components/input/customInput.tsx +54 -0
- package/src/components/input/index.ts +2 -0
- package/src/components/input/input.scss +142 -0
- package/src/components/input/passwordInput.tsx +118 -0
- package/src/components/modal/baseModal.tsx +105 -0
- package/src/components/modal/index.ts +2 -0
- package/src/components/modal/modal.scss +125 -0
- package/src/components/modal/notifyModal.tsx +24 -0
- package/src/components/modal/questionModal.tsx +23 -0
- package/src/components/radio/customRadio.tsx +72 -0
- package/src/components/radio/index.ts +1 -0
- package/src/components/radio/radio.scss +28 -0
- package/src/components/variables.scss +61 -0
- package/src/enums/index.ts +1 -0
- package/src/enums/modalType.ts +6 -0
- package/src/enums/passwordRuleTypes.ts +8 -0
- package/src/hooks/clickOutside.ts +25 -0
- package/src/hooks/getColor.ts +16 -0
- package/{dist/hooks/index.d.ts → src/hooks/index.ts} +1 -0
- package/src/index.ts +9 -0
- package/src/utils/generateKey.ts +3 -0
- package/src/utils/styles.scss +7 -0
- package/src/utils/styles.scss.d.ts +2 -0
- package/src/utils/useInjectStyles.ts +19 -0
- package/tsconfig.json +24 -0
- package/LICENSE +0 -21
- package/dist/components/button/customButton.d.ts +0 -10
- package/dist/components/button/index.d.ts +0 -1
- package/dist/components/checkbox/customCheckBox.d.ts +0 -11
- package/dist/components/checkbox/index.d.ts +0 -1
- package/dist/components/images/index.d.ts +0 -1
- package/dist/components/images/svgIcon.d.ts +0 -10
- package/dist/components/input/baseInput.d.ts +0 -12
- package/dist/components/input/customInput.d.ts +0 -9
- package/dist/components/input/index.d.ts +0 -2
- package/dist/components/input/passwordInput.d.ts +0 -19
- package/dist/components/modal/baseModal.d.ts +0 -17
- package/dist/components/modal/index.d.ts +0 -2
- package/dist/components/modal/notifyModal.d.ts +0 -11
- package/dist/components/modal/questionModal.d.ts +0 -10
- package/dist/enums/ModalType.d.ts +0 -6
- package/dist/enums/index.d.ts +0 -1
- package/dist/enums/passwordRuleTypes.d.ts +0 -8
- package/dist/hooks/clickOutside.d.ts +0 -1
- package/dist/index.css +0 -2
- package/dist/index.css.map +0 -1
- package/dist/index.d.ts +0 -7
- package/dist/index.js +0 -2
- package/dist/index.js.map +0 -1
- package/dist/index.mjs +0 -2
- package/dist/index.mjs.map +0 -1
- package/dist/index.modern.mjs +0 -2
- package/dist/index.modern.mjs.map +0 -1
- package/dist/index.umd.js +0 -2
- package/dist/index.umd.js.map +0 -1
package/README.md
CHANGED
package/package.json
CHANGED
|
@@ -1,63 +1,32 @@
|
|
|
1
1
|
{
|
|
2
2
|
"private": false,
|
|
3
3
|
"name": "@hbuesing/ui-library",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "3.0.0",
|
|
5
5
|
"description": "Collection of reusable ui components for react based applications",
|
|
6
6
|
"source": "src/index.ts",
|
|
7
|
-
"
|
|
8
|
-
"module": "dist/index.mjs",
|
|
9
|
-
"types": "dist/index.d.ts",
|
|
10
|
-
"exports": {
|
|
11
|
-
".": {
|
|
12
|
-
"require": "./dist/index.js",
|
|
13
|
-
"types": "./dist/index.d.ts",
|
|
14
|
-
"default": "./dist/index.modern.mjs"
|
|
15
|
-
},
|
|
16
|
-
"./dist/*.css": {
|
|
17
|
-
"import": "./dist/index.css",
|
|
18
|
-
"require": "./dist/index.css"
|
|
19
|
-
}
|
|
20
|
-
},
|
|
21
|
-
"files": [
|
|
22
|
-
"dist/*"
|
|
23
|
-
],
|
|
7
|
+
"exports": "./dist/bundle.mjs",
|
|
24
8
|
"scripts": {
|
|
25
9
|
"clean": "rimraf ./dist && mkdir dist",
|
|
26
10
|
"lint": "eslint src",
|
|
27
|
-
"lint:
|
|
28
|
-
"build": "microbundle build --jsx react --globals react/jsx-runtime=jsxRuntime",
|
|
29
|
-
"
|
|
11
|
+
"lint:nw": "eslint src --max-warnings 0",
|
|
12
|
+
"build": "microbundle build --output ./dist/bundle.mjs --no-pkg-main --generateTypes true --format modern --jsx react --globals react/jsx-runtime=jsxRuntime --css inline",
|
|
13
|
+
"build:uil": "microbundle build --output ../website/src/uil-bundle/bundle.mjs --no-pkg-main --generateTypes true --format modern --jsx react --globals react/jsx-runtime=jsxRuntime --css inline",
|
|
14
|
+
"dev": "microbundle -w --output ./dist/bundle.mjs --no-pkg-main --generateTypes true --format modern --jsx react --globals react/jsx-runtime=jsxRuntime --css inline",
|
|
30
15
|
"stats": "microbundle --visualize"
|
|
31
16
|
},
|
|
32
|
-
"author": "Henrik Buesing",
|
|
33
17
|
"license": "MIT",
|
|
34
18
|
"homepage": "https://github.com/HenrikBuesing/ui-library/tree/main#README.md",
|
|
35
19
|
"bugs": "https://github.com/HenrikBuesing/ui-library/issues",
|
|
36
20
|
"repository": {
|
|
37
21
|
"type": "git",
|
|
38
|
-
"url": "https://github.com/HenrikBuesing/ui-library.git"
|
|
22
|
+
"url": "https://github.com/HenrikBuesing/ui-library.git",
|
|
23
|
+
"directory": "ui-library"
|
|
39
24
|
},
|
|
40
25
|
"peerDependencies": {
|
|
41
26
|
"react": "^18.0.0"
|
|
42
27
|
},
|
|
43
28
|
"devDependencies": {
|
|
44
|
-
"@eslint/compat": "^1.0.3",
|
|
45
|
-
"@eslint/js": "^9.5.0",
|
|
46
|
-
"@types/react": "^18.3.3",
|
|
47
|
-
"eslint": "^8.57.0",
|
|
48
|
-
"eslint-plugin-react": "^7.34.3",
|
|
49
|
-
"globals": "^15.6.0",
|
|
50
29
|
"microbundle": "^0.15.1",
|
|
51
|
-
"
|
|
52
|
-
|
|
53
|
-
"sass": "^1.77.6",
|
|
54
|
-
"typescript": "^5.5.2",
|
|
55
|
-
"typescript-eslint": "^7.14.1"
|
|
56
|
-
},
|
|
57
|
-
"keywords": [
|
|
58
|
-
"next",
|
|
59
|
-
"react",
|
|
60
|
-
"ui",
|
|
61
|
-
"ui-library"
|
|
62
|
-
]
|
|
30
|
+
"rimraf": "^6.0.1"
|
|
31
|
+
}
|
|
63
32
|
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
@use '../variables' as *;
|
|
2
|
+
|
|
3
|
+
.uil-button {
|
|
4
|
+
letter-spacing: 1px;
|
|
5
|
+
color: var(--uil-black);
|
|
6
|
+
background-color: var(--uil-white);
|
|
7
|
+
border: 1px solid var(--uil-black);
|
|
8
|
+
border-radius: 2px;
|
|
9
|
+
cursor: pointer;
|
|
10
|
+
padding: var(--uil-xs) var(--uil-s);
|
|
11
|
+
-webkit-box-shadow: 0 0 3px 0 var(--uil-black-alt);
|
|
12
|
+
box-shadow: 0 0 3px 0 var(--uil-black-alt);
|
|
13
|
+
|
|
14
|
+
&.uil-disabled {
|
|
15
|
+
background-color: var(--uil-grey-dark);
|
|
16
|
+
color: var(--uil-grey);
|
|
17
|
+
border: transparent;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
&.uil-small {
|
|
21
|
+
font-size: var(--uil-font-small);
|
|
22
|
+
line-height: var(--uil-font-small);
|
|
23
|
+
padding: var(--uil-xxs) var(--uil-xs);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import React, {ComponentPropsWithoutRef, CSSProperties, useRef} from 'react';
|
|
2
|
+
import useInjectStyleSheet from "utils/useInjectStyles";
|
|
3
|
+
import {useGetColor} from 'hooks/getColor';
|
|
4
|
+
|
|
5
|
+
type HEXColor = `#${string}`
|
|
6
|
+
|
|
7
|
+
interface ICustomButton extends ComponentPropsWithoutRef<'button'> {
|
|
8
|
+
label : string;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
small? : boolean;
|
|
11
|
+
theme? : HEXColor | 'success' | 'warning' | 'error';
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export function CustomButton(props: ICustomButton) {
|
|
15
|
+
const {
|
|
16
|
+
disabled = false,
|
|
17
|
+
label,
|
|
18
|
+
small = false,
|
|
19
|
+
theme,
|
|
20
|
+
...buttonProps
|
|
21
|
+
} = props;
|
|
22
|
+
|
|
23
|
+
const nodeRef = useRef<HTMLButtonElement>(null);
|
|
24
|
+
useInjectStyleSheet(nodeRef);
|
|
25
|
+
|
|
26
|
+
function getStyle(): CSSProperties | undefined {
|
|
27
|
+
if (disabled || !theme) return undefined;
|
|
28
|
+
|
|
29
|
+
if (theme.includes('#')) {
|
|
30
|
+
return {
|
|
31
|
+
color: useGetColor(theme),
|
|
32
|
+
backgroundColor: theme,
|
|
33
|
+
border: 'transparent'
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
switch (theme) {
|
|
38
|
+
case 'success':
|
|
39
|
+
return {
|
|
40
|
+
color: useGetColor('#006A4E'),
|
|
41
|
+
backgroundColor: '#006A4E',
|
|
42
|
+
border: 'transparent'
|
|
43
|
+
};
|
|
44
|
+
case 'warning':
|
|
45
|
+
return {
|
|
46
|
+
color: '#000000',
|
|
47
|
+
backgroundColor: '#FFD700',
|
|
48
|
+
border: 'transparent'
|
|
49
|
+
};
|
|
50
|
+
case 'error':
|
|
51
|
+
return {
|
|
52
|
+
color: useGetColor('#800020'),
|
|
53
|
+
backgroundColor: '#800020',
|
|
54
|
+
border: 'transparent'
|
|
55
|
+
};
|
|
56
|
+
default:
|
|
57
|
+
throw new Error('invalid theme provided')
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
function getClassName(): string {
|
|
62
|
+
const base = 'uil-button uil-fit'
|
|
63
|
+
|
|
64
|
+
if (disabled && !small) {
|
|
65
|
+
return `${base} uil-font-base uil-disabled`;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
if (disabled && small) {
|
|
69
|
+
return `${base} uil-disabled uil-small`;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
if (small) {
|
|
73
|
+
return `${base} uil-small`;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
return `${base} uil-font-base`;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
return (
|
|
80
|
+
<button className={getClassName()} style={getStyle()} disabled={disabled} {...buttonProps} ref={nodeRef}>
|
|
81
|
+
{label}
|
|
82
|
+
</button>
|
|
83
|
+
);
|
|
84
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './customButton'
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import React, {ComponentPropsWithoutRef, ReactNode, useRef} from 'react';
|
|
2
|
+
import useInjectStyleSheet from "utils/useInjectStyles";
|
|
3
|
+
|
|
4
|
+
interface ICustomCheckbox extends ComponentPropsWithoutRef<'input'> {
|
|
5
|
+
checked : boolean;
|
|
6
|
+
label? : string;
|
|
7
|
+
toggleCheck : (value: boolean) => void;
|
|
8
|
+
checkColor? : string;
|
|
9
|
+
children? : ReactNode;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export function CustomCheckBox(props: ICustomCheckbox) {
|
|
13
|
+
const {
|
|
14
|
+
checkColor,
|
|
15
|
+
checked,
|
|
16
|
+
toggleCheck,
|
|
17
|
+
label,
|
|
18
|
+
children,
|
|
19
|
+
...checkProps
|
|
20
|
+
} = props;
|
|
21
|
+
|
|
22
|
+
const nodeRef = useRef<HTMLDivElement>(null);
|
|
23
|
+
useInjectStyleSheet(nodeRef);
|
|
24
|
+
|
|
25
|
+
return (
|
|
26
|
+
<div className={'uil-check-wrapper'} ref={nodeRef}>
|
|
27
|
+
<label className={'uil-checkbox uil-check'}>
|
|
28
|
+
<input type={'checkbox'} checked={checked} onChange={() => {toggleCheck(!checked)}} {...checkProps}/>
|
|
29
|
+
<div className={'uil-checkmark'} style={{backgroundColor: checkColor}}/>
|
|
30
|
+
</label>
|
|
31
|
+
|
|
32
|
+
{children ? children : <span onClick={() => toggleCheck(!checked)} style={{cursor: 'pointer', userSelect: 'none'}}>{label}</span>}
|
|
33
|
+
</div>
|
|
34
|
+
);
|
|
35
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './customCheckBox';
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
@use "variables" as *;
|
|
2
|
+
|
|
3
|
+
.uil-fit {
|
|
4
|
+
height: fit-content;
|
|
5
|
+
width: fit-content;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.uil-font-base {
|
|
9
|
+
font-size: var(--uil-font-base);
|
|
10
|
+
line-height: var(--uil-font-base);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.uil-check {
|
|
14
|
+
position: relative;
|
|
15
|
+
display: block;
|
|
16
|
+
cursor: pointer;
|
|
17
|
+
font-size: var(--uil-font-small);
|
|
18
|
+
line-height: var(--uil-font-small);
|
|
19
|
+
min-height: var(--uil-l);
|
|
20
|
+
min-width: var(--uil-l);
|
|
21
|
+
user-select: none;
|
|
22
|
+
border: 2px solid var(--uil-black-alt);
|
|
23
|
+
box-sizing: border-box;
|
|
24
|
+
|
|
25
|
+
&:has(input:disabled) {
|
|
26
|
+
background-color: var(--uil-grey);
|
|
27
|
+
border-color: var(--uil-grey-dark);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
input {
|
|
31
|
+
position: absolute;
|
|
32
|
+
cursor: pointer;
|
|
33
|
+
height: 0;
|
|
34
|
+
width: 0;
|
|
35
|
+
opacity: 0;
|
|
36
|
+
|
|
37
|
+
&:checked {
|
|
38
|
+
~ .uil-checkmark {
|
|
39
|
+
transform: scale(1);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
&:disabled {
|
|
44
|
+
~ .uil-checkmark {
|
|
45
|
+
background-color: var(--uil-grey-dark);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.uil-checkmark {
|
|
51
|
+
position: absolute;
|
|
52
|
+
top: 25%;
|
|
53
|
+
left: 25%;
|
|
54
|
+
background-color: var(--uil-black-alt);
|
|
55
|
+
width: var(--uil-xs);
|
|
56
|
+
height: var(--uil-xs);
|
|
57
|
+
transform: scale(0);
|
|
58
|
+
transition: .1s ease;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './svgIcon';
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import React, {ComponentPropsWithoutRef, CSSProperties, useRef} from 'react';
|
|
2
|
+
import useInjectStyleSheet from "utils/useInjectStyles";
|
|
3
|
+
|
|
4
|
+
interface ISvgIcon extends ComponentPropsWithoutRef<'svg'>{
|
|
5
|
+
src : string;
|
|
6
|
+
color? : string | undefined;
|
|
7
|
+
height?: number;
|
|
8
|
+
width? : number;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export function SVG(props: ISvgIcon) {
|
|
12
|
+
const {
|
|
13
|
+
src,
|
|
14
|
+
color,
|
|
15
|
+
height,
|
|
16
|
+
width
|
|
17
|
+
} = props;
|
|
18
|
+
|
|
19
|
+
if (!src.includes('.svg')) {
|
|
20
|
+
throw new Error('Provided src is not an svg image');
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const nodeRef = useRef<HTMLDivElement>(null);
|
|
24
|
+
useInjectStyleSheet(nodeRef);
|
|
25
|
+
|
|
26
|
+
const style: CSSProperties = {
|
|
27
|
+
fill: color,
|
|
28
|
+
height: `${height}px`,
|
|
29
|
+
width: `${width}px`
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
return (
|
|
33
|
+
<div ref={nodeRef} className={'uil-svg-wrapper'}>
|
|
34
|
+
<svg aria-hidden={true} className={'uil-svg'} style={style}>
|
|
35
|
+
<use href={src}/>
|
|
36
|
+
</svg>
|
|
37
|
+
</div>
|
|
38
|
+
);
|
|
39
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import React, {ComponentPropsWithoutRef, useRef} from 'react';
|
|
2
|
+
import {SVG} from 'components/images/svgIcon';
|
|
3
|
+
import useInjectStyleSheet from "../../utils/useInjectStyles";
|
|
4
|
+
|
|
5
|
+
export interface IBaseInput extends ComponentPropsWithoutRef<'input'> {
|
|
6
|
+
label : string;
|
|
7
|
+
value : string;
|
|
8
|
+
valueChanged: (value: string) => void;
|
|
9
|
+
iconColor? : string;
|
|
10
|
+
iconSrc? : string;
|
|
11
|
+
inputColor? : string;
|
|
12
|
+
toggle? : () => void;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export function BaseInput(props: IBaseInput) {
|
|
16
|
+
const {
|
|
17
|
+
iconColor,
|
|
18
|
+
iconSrc,
|
|
19
|
+
inputColor,
|
|
20
|
+
label,
|
|
21
|
+
toggle,
|
|
22
|
+
valueChanged,
|
|
23
|
+
...inputProps
|
|
24
|
+
} = props;
|
|
25
|
+
|
|
26
|
+
const nodeRef = useRef<HTMLLabelElement>(null);
|
|
27
|
+
useInjectStyleSheet(nodeRef);
|
|
28
|
+
|
|
29
|
+
return (
|
|
30
|
+
<label className={'uil-input-wrapper'} htmlFor={inputProps.id} ref={nodeRef}>
|
|
31
|
+
<input
|
|
32
|
+
className={'uil-input uil-font-base'}
|
|
33
|
+
onChange={(e) => valueChanged(e.target.value)}
|
|
34
|
+
placeholder={label}
|
|
35
|
+
style={{color: inputColor}}
|
|
36
|
+
{...inputProps}
|
|
37
|
+
/>
|
|
38
|
+
|
|
39
|
+
{iconSrc &&
|
|
40
|
+
<div className={'uil-icon'} onClick={toggle}>
|
|
41
|
+
<SVG src={iconSrc} width={24} height={24} color={iconColor}/>
|
|
42
|
+
</div>
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
<span className={'uil-label uil-font-base'} style={{color: inputColor}}>{label}</span>
|
|
46
|
+
</label>
|
|
47
|
+
);
|
|
48
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import React, {useState} from 'react';
|
|
2
|
+
import {BaseInput, IBaseInput} from './baseInput';
|
|
3
|
+
import {SVG} from 'components/images/svgIcon';
|
|
4
|
+
import {useClickOutsideRef} from 'hooks/clickOutside';
|
|
5
|
+
|
|
6
|
+
export interface ICustomInput extends IBaseInput {
|
|
7
|
+
tooltipClose?: string;
|
|
8
|
+
tooltipIcon? : string;
|
|
9
|
+
tooltipText? : string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export function CustomInput(props: ICustomInput) {
|
|
13
|
+
const {
|
|
14
|
+
tooltipClose,
|
|
15
|
+
tooltipIcon,
|
|
16
|
+
tooltipText,
|
|
17
|
+
...inputProps
|
|
18
|
+
} = props;
|
|
19
|
+
|
|
20
|
+
const [tooltipVisible, setTooltipVisible] = useState(false);
|
|
21
|
+
const ref = useClickOutsideRef<HTMLDivElement>(closeTooltip);
|
|
22
|
+
|
|
23
|
+
function closeTooltip() {
|
|
24
|
+
setTooltipVisible(false);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
return (
|
|
28
|
+
<>
|
|
29
|
+
{tooltipIcon ?
|
|
30
|
+
<div className={'uil-tooltip-wrapper'} ref={ref}>
|
|
31
|
+
{tooltipVisible &&
|
|
32
|
+
<div className={'uil-tooltip'}>
|
|
33
|
+
{tooltipClose &&
|
|
34
|
+
<button className={'uil-tooltip-button uil-fit'} onClick={closeTooltip}>
|
|
35
|
+
{tooltipClose}
|
|
36
|
+
</button>
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
<span>{tooltipText}</span>
|
|
40
|
+
</div>
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
<div className={'uil-tooltip-icon uil-fit'} onClick={() => setTooltipVisible(!tooltipVisible)}>
|
|
44
|
+
<SVG src={tooltipIcon} height={16} width={16}/>
|
|
45
|
+
</div>
|
|
46
|
+
|
|
47
|
+
<BaseInput {...inputProps}/>
|
|
48
|
+
</div> :
|
|
49
|
+
|
|
50
|
+
<BaseInput {...inputProps}/>
|
|
51
|
+
}
|
|
52
|
+
</>
|
|
53
|
+
);
|
|
54
|
+
}
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
@use '../variables' as *;
|
|
2
|
+
|
|
3
|
+
.uil-input-wrapper {
|
|
4
|
+
position: relative;
|
|
5
|
+
display: block;
|
|
6
|
+
|
|
7
|
+
& .uil-label {
|
|
8
|
+
position: absolute;
|
|
9
|
+
top: 25%;
|
|
10
|
+
left: var(--uil-xxs);
|
|
11
|
+
cursor: text;
|
|
12
|
+
font-weight: bold;
|
|
13
|
+
color: var(--uil-black);
|
|
14
|
+
background: linear-gradient(0deg, var(--uil-white) 9px, rgba(0,0,0,0) 0%);
|
|
15
|
+
opacity: .6;
|
|
16
|
+
padding: 0 var(--uil-xxxs);
|
|
17
|
+
transition: top .25s ease-in-out;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
& .uil-input {
|
|
21
|
+
box-sizing: border-box;
|
|
22
|
+
width: 100%;
|
|
23
|
+
color: var(--uil-black);
|
|
24
|
+
background-color: var(--uil-white);
|
|
25
|
+
border: 1px solid var(--uil-black);
|
|
26
|
+
border-radius: 0;
|
|
27
|
+
padding: var(--uil-xs);
|
|
28
|
+
|
|
29
|
+
//hide placeholder as it is only needed for stylesheet rules
|
|
30
|
+
&::placeholder {
|
|
31
|
+
color: transparent;
|
|
32
|
+
width: 0;
|
|
33
|
+
height: 0;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
&:focus {
|
|
37
|
+
outline: 1px solid var(--uil-outline-focus);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
&:disabled {
|
|
41
|
+
cursor: not-allowed;
|
|
42
|
+
border: 2px solid var(--uil-outline-disabled);
|
|
43
|
+
background-color: var(--uil-grey);
|
|
44
|
+
color: var(--uil-grey-dark);
|
|
45
|
+
|
|
46
|
+
& ~ .uil-label {
|
|
47
|
+
cursor: not-allowed;
|
|
48
|
+
background: transparent;
|
|
49
|
+
color: var(--uil-grey-dark);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
& ~ .uil-icon {
|
|
53
|
+
cursor: not-allowed;
|
|
54
|
+
fill: var(--uil-grey-dark);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
&:not(:placeholder-shown) ~ .uil-label {
|
|
58
|
+
background: linear-gradient(0deg, var(--uil-grey) 8px, rgba(0,0,0,0) 0%);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
& .uil-icon {
|
|
64
|
+
position: absolute;
|
|
65
|
+
top: 50%;
|
|
66
|
+
right: var(--uil-xs);
|
|
67
|
+
transform: translate(0%, -50%);
|
|
68
|
+
display: flex;
|
|
69
|
+
align-items: center;
|
|
70
|
+
justify-content: center;
|
|
71
|
+
fill: var(--uil-black);
|
|
72
|
+
opacity: .5;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
& .uil-input:focus ~ .uil-label, .uil-input:not(:placeholder-shown) ~ .uil-label {
|
|
76
|
+
top: -30%;
|
|
77
|
+
opacity: 1;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
& .uil-input:focus ~ .uil-icon, .uil-input:not(:placeholder-shown) ~ .uil-icon {
|
|
81
|
+
opacity: 1;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.uil-tooltip-wrapper {
|
|
86
|
+
position: relative;
|
|
87
|
+
|
|
88
|
+
.uil-tooltip-icon {
|
|
89
|
+
cursor: pointer;
|
|
90
|
+
fill: var(--uil-black-alt);
|
|
91
|
+
margin-bottom: var(--uil-xxs);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
& .uil-tooltip-icon:has(~ .uil-input-wrapper > .uil-input:not(:placeholder-shown), ~ .uil-input-wrapper:focus-within) {
|
|
95
|
+
opacity: 0;
|
|
96
|
+
visibility: hidden;
|
|
97
|
+
transition: opacity .3s, visibility .3s;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.uil-tooltip {
|
|
101
|
+
position: absolute;
|
|
102
|
+
top: 0;
|
|
103
|
+
left: 0;
|
|
104
|
+
width: 100%;
|
|
105
|
+
box-sizing: border-box;
|
|
106
|
+
z-index: 1;
|
|
107
|
+
color: var(--uil-white);
|
|
108
|
+
background-color: rgba(34, 34, 34, .9);
|
|
109
|
+
padding: var(--uil-s);
|
|
110
|
+
border-radius: 3px;
|
|
111
|
+
font-size: var(--uil-font-small);
|
|
112
|
+
line-height: var(--uil-font-small);
|
|
113
|
+
|
|
114
|
+
.uil-tooltip-button {
|
|
115
|
+
display: block;
|
|
116
|
+
margin-left: auto;
|
|
117
|
+
margin-bottom: var(--uil-m);
|
|
118
|
+
color: var(--uil-white);
|
|
119
|
+
background-color: transparent;
|
|
120
|
+
border: none;
|
|
121
|
+
padding: 0;
|
|
122
|
+
border-bottom: 1px solid var(--uil-white);
|
|
123
|
+
cursor: pointer;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.uil-password-rules {
|
|
129
|
+
margin-top: var(--uil-m);
|
|
130
|
+
display: flex;
|
|
131
|
+
flex-direction: column;
|
|
132
|
+
gap: var(--uil-xs);
|
|
133
|
+
margin-left: var(--uil-xs);
|
|
134
|
+
|
|
135
|
+
.uil-password-rule {
|
|
136
|
+
display: flex;
|
|
137
|
+
align-items: center;
|
|
138
|
+
gap: var(--uil-xxs);
|
|
139
|
+
font-size: var(--uil-font-small);
|
|
140
|
+
line-height: var(--uil-font-small);
|
|
141
|
+
}
|
|
142
|
+
}
|