@yakad/ui 2.0.1 → 2.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Avatar/Avatar.d.ts +14 -4
- package/dist/Avatar/Avatar.js +49 -8
- package/dist/Button/Button.d.ts +9 -13
- package/dist/Button/Button.js +28 -14
- package/dist/ButtonGroup/ButtonGroup.d.ts +12 -0
- package/dist/ButtonGroup/ButtonGroup.js +60 -0
- package/dist/Card/Card.d.ts +14 -9
- package/dist/Card/Card.js +41 -7
- package/dist/CheckBox/CheckBox.d.ts +12 -8
- package/dist/CheckBox/CheckBox.js +47 -10
- package/dist/Field/Field.d.ts +21 -0
- package/dist/Field/Field.js +154 -0
- package/dist/Label/Label.d.ts +8 -0
- package/dist/{Spacer/Spacer.js → Label/Label.js} +9 -6
- package/dist/Navigation/Navigation.d.ts +19 -9
- package/dist/Navigation/Navigation.js +158 -11
- package/dist/RadioGroup/RadioGroup.d.ts +19 -12
- package/dist/RadioGroup/RadioGroup.js +61 -14
- package/dist/Separator/Separator.d.ts +9 -0
- package/dist/Separator/Separator.js +24 -0
- package/dist/Table/Table.d.ts +18 -36
- package/dist/Table/Table.js +90 -38
- package/dist/index.d.ts +2 -8
- package/dist/index.js +2 -8
- package/package.json +12 -5
- package/dist/Avatar/Avatar.module.css +0 -32
- package/dist/Avatar/default-avatar.svg +0 -17
- package/dist/Button/Button.module.css +0 -190
- package/dist/Card/Card.module.css +0 -48
- package/dist/CheckBox/CheckBox.module.css +0 -50
- package/dist/CodeBox/CodeBox.d.ts +0 -7
- package/dist/CodeBox/CodeBox.js +0 -22
- package/dist/CodeBox/CodeBox.module.css +0 -0
- package/dist/CodeField/CodeField.d.ts +0 -10
- package/dist/CodeField/CodeField.js +0 -43
- package/dist/CodeField/CodeField.module.css +0 -27
- package/dist/Dropdown/Dropdown.d.ts +0 -8
- package/dist/Dropdown/Dropdown.js +0 -99
- package/dist/Dropdown/Dropdown.module.css +0 -39
- package/dist/Form/Form.d.ts +0 -9
- package/dist/Form/Form.js +0 -20
- package/dist/Form/Form.module.css +0 -3
- package/dist/Navigation/Navigation.module.css +0 -61
- package/dist/Popup/Popup.d.ts +0 -8
- package/dist/Popup/Popup.js +0 -40
- package/dist/Popup/Popup.module.css +0 -15
- package/dist/RadioButton/RadioButton.d.ts +0 -14
- package/dist/RadioButton/RadioButton.js +0 -31
- package/dist/RadioButton/RadioButton.module.css +0 -22
- package/dist/Spacer/Spacer.d.ts +0 -5
- package/dist/Spacer/Spacer.module.css +0 -5
- package/dist/Table/Table.module.css +0 -41
- package/dist/WithOverlay/WithOverlay.d.ts +0 -15
- package/dist/WithOverlay/WithOverlay.js +0 -40
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
.navigation {
|
|
2
|
-
position: fixed;
|
|
3
|
-
max-width: 100%;
|
|
4
|
-
padding: 1rem 0;
|
|
5
|
-
background: rgb(var(--surfaceContainerColor, 243 237 247));
|
|
6
|
-
color: rgb(var(--onSurfaceColor, 28 27 31));
|
|
7
|
-
fill: rgb(var(--onSurfaceColor, 28 27 31));
|
|
8
|
-
transition: transform 0.3s;
|
|
9
|
-
overflow-y: auto;
|
|
10
|
-
z-index: 3;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
.auto,
|
|
14
|
-
.left {
|
|
15
|
-
top: 6rem;
|
|
16
|
-
left: 0;
|
|
17
|
-
width: 21.9rem;
|
|
18
|
-
height: calc(100% - 6rem);
|
|
19
|
-
max-height: 100%;
|
|
20
|
-
border-inline-end: 0.2rem solid rgb(var(--outlineColor, 121 116 126));
|
|
21
|
-
transform: translate(-100%, 0);
|
|
22
|
-
}
|
|
23
|
-
[dir="rtl"] .auto,
|
|
24
|
-
.right {
|
|
25
|
-
right: 0;
|
|
26
|
-
top: 6rem;
|
|
27
|
-
width: 21.9rem;
|
|
28
|
-
height: calc(100% - 6rem);
|
|
29
|
-
max-height: 100%;
|
|
30
|
-
border-inline-end: 0.2rem solid rgb(var(--outlineColor, 121 116 126));
|
|
31
|
-
|
|
32
|
-
transform: translate(100%, 0);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
.top {
|
|
36
|
-
top: 0;
|
|
37
|
-
width: 100%;
|
|
38
|
-
height: auto;
|
|
39
|
-
border-bottom: 0.2rem solid rgb(var(--outlineColor, 121 116 126));
|
|
40
|
-
transform: translate(0, -100%);
|
|
41
|
-
}
|
|
42
|
-
.bottom {
|
|
43
|
-
bottom: 0;
|
|
44
|
-
width: 100%;
|
|
45
|
-
height: auto;
|
|
46
|
-
border-top: 0.2rem solid rgb(var(--outlineColor, 121 116 126));
|
|
47
|
-
transform: translate(0, 100%);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
.open {
|
|
51
|
-
transform: translate(0, 0);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
@media screen and (max-width: 1000px) {
|
|
55
|
-
.auto,
|
|
56
|
-
.left,
|
|
57
|
-
.right {
|
|
58
|
-
top: 0;
|
|
59
|
-
height: 100%;
|
|
60
|
-
}
|
|
61
|
-
}
|
package/dist/Popup/Popup.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { CardProps, OverlayProps } from "..";
|
|
3
|
-
export interface PopupProps extends CardProps, OverlayProps {
|
|
4
|
-
heading?: string;
|
|
5
|
-
teleport?: boolean;
|
|
6
|
-
ref?: React.Ref<HTMLDivElement>;
|
|
7
|
-
}
|
|
8
|
-
export declare function Popup({ align, onClose, heading, className, children, teleport, ref, ...restProps }: PopupProps): import("react").JSX.Element;
|
package/dist/Popup/Popup.js
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
-
var t = {};
|
|
4
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
-
t[p] = s[p];
|
|
6
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
-
t[p[i]] = s[p[i]];
|
|
10
|
-
}
|
|
11
|
-
return t;
|
|
12
|
-
};
|
|
13
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
|
-
import { useEffect, useImperativeHandle } from "react";
|
|
15
|
-
import classNames from "classnames";
|
|
16
|
-
import { Material } from "@yakad/symbols";
|
|
17
|
-
import { Button, Card, Row, Screen, Spacer, Stack, Text, } from "..";
|
|
18
|
-
import styles from "./Popup.module.css";
|
|
19
|
-
import { createPortal } from "react-dom";
|
|
20
|
-
import { useOnOutsideClick } from "@yakad/use-interactions";
|
|
21
|
-
export function Popup(_a) {
|
|
22
|
-
var { align, onClose, heading, className, children, teleport = false, ref } = _a, restProps = __rest(_a, ["align", "onClose", "heading", "className", "children", "teleport", "ref"]);
|
|
23
|
-
const localRef = useOnOutsideClick(() => {
|
|
24
|
-
onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
25
|
-
});
|
|
26
|
-
const doTeleport = () => {
|
|
27
|
-
const portalRoot = document.getElementsByClassName("portalRoot")[0] || document;
|
|
28
|
-
const t = portalRoot && createPortal(popup(), portalRoot);
|
|
29
|
-
return t;
|
|
30
|
-
};
|
|
31
|
-
useEffect(() => {
|
|
32
|
-
document.body.style.overflow = "hidden";
|
|
33
|
-
return () => {
|
|
34
|
-
document.body.style.overflow = "initial";
|
|
35
|
-
};
|
|
36
|
-
}, []);
|
|
37
|
-
useImperativeHandle(ref, () => localRef.current);
|
|
38
|
-
const popup = () => (_jsx(Screen, { align: "center", className: styles.popupscreen, children: _jsxs(Card, Object.assign({ ref: localRef }, restProps, { className: classNames(styles.popup, className), children: [_jsxs(Row, { style: { marginBottom: "2rem" }, children: [_jsx(Text, { variant: "heading4", children: heading }), _jsx(Spacer, {}), _jsx(Button, { title: "Close", icon: _jsx(Material, { icon: "close" }), onClick: onClose })] }), _jsx(Stack, { align: align, style: { width: "100%", overflowY: "auto" }, children: children })] })) }));
|
|
39
|
-
return teleport ? doTeleport() : popup();
|
|
40
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
.popupscreen {
|
|
2
|
-
position: fixed;
|
|
3
|
-
top: 0;
|
|
4
|
-
left: 0;
|
|
5
|
-
background-color: rgba(var(--surfaceContainerColor, 243 237 247), 0.2);
|
|
6
|
-
backdrop-filter: blur(0.2rem);
|
|
7
|
-
z-index: 4;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
.popup {
|
|
11
|
-
width: 90%;
|
|
12
|
-
max-width: 60rem;
|
|
13
|
-
min-height: 10rem;
|
|
14
|
-
max-height: 90vh;
|
|
15
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
type ExcludedTypes = "type" | "name" | "defaultValue" | "defaultChecked" | "checked";
|
|
3
|
-
export interface RadioButtonProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, ExcludedTypes> {
|
|
4
|
-
value: string | number;
|
|
5
|
-
label?: string;
|
|
6
|
-
dataFromRadioGroup?: {
|
|
7
|
-
name: string;
|
|
8
|
-
onSelect: () => void;
|
|
9
|
-
checked: boolean;
|
|
10
|
-
};
|
|
11
|
-
ref?: React.Ref<HTMLInputElement>;
|
|
12
|
-
}
|
|
13
|
-
export declare function RadioButton({ dataFromRadioGroup, label, onClick, className, ...restProps }: RadioButtonProps): import("react").JSX.Element;
|
|
14
|
-
export {};
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
-
var t = {};
|
|
4
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
-
t[p] = s[p];
|
|
6
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
-
t[p[i]] = s[p[i]];
|
|
10
|
-
}
|
|
11
|
-
return t;
|
|
12
|
-
};
|
|
13
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
|
-
import classNames from "classnames";
|
|
15
|
-
import { Material } from "@yakad/symbols";
|
|
16
|
-
import { Button } from "..";
|
|
17
|
-
import styles from "./RadioButton.module.css";
|
|
18
|
-
export function RadioButton(_a) {
|
|
19
|
-
var { dataFromRadioGroup, label, onClick, className } = _a, restProps = __rest(_a, ["dataFromRadioGroup", "label", "onClick", "className"]);
|
|
20
|
-
const joinedClassNames = classNames(styles.radiobutton, {
|
|
21
|
-
[styles.labeled]: label,
|
|
22
|
-
className,
|
|
23
|
-
});
|
|
24
|
-
const onClickRadioButtonHandler = () => {
|
|
25
|
-
dataFromRadioGroup === null || dataFromRadioGroup === void 0 ? void 0 : dataFromRadioGroup.onSelect();
|
|
26
|
-
onClick;
|
|
27
|
-
};
|
|
28
|
-
return (_jsxs("div", { className: joinedClassNames, children: [label && (_jsx("label", { className: styles.label, htmlFor: dataFromRadioGroup === null || dataFromRadioGroup === void 0 ? void 0 : dataFromRadioGroup.name, children: label })), _jsx(Button, { icon: _jsx(Material, { icon: (dataFromRadioGroup === null || dataFromRadioGroup === void 0 ? void 0 : dataFromRadioGroup.checked)
|
|
29
|
-
? "radio_button_checked"
|
|
30
|
-
: "radio_button_unchecked" }), onClick: onClickRadioButtonHandler, disabled: restProps.disabled }), _jsx("input", Object.assign({}, restProps, { className: styles.input, type: "radio", name: dataFromRadioGroup === null || dataFromRadioGroup === void 0 ? void 0 : dataFromRadioGroup.name, checked: dataFromRadioGroup === null || dataFromRadioGroup === void 0 ? void 0 : dataFromRadioGroup.checked }))] }));
|
|
31
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
.radiobutton {
|
|
2
|
-
display: flex;
|
|
3
|
-
flex-direction: row;
|
|
4
|
-
width: 4rem;
|
|
5
|
-
height: 4rem;
|
|
6
|
-
}
|
|
7
|
-
.radiobutton.labeled {
|
|
8
|
-
width: 100%;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
.input {
|
|
12
|
-
display: none;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
.label {
|
|
16
|
-
display: block;
|
|
17
|
-
width: auto;
|
|
18
|
-
margin: 0.9rem 1rem;
|
|
19
|
-
margin-inline-end: auto;
|
|
20
|
-
line-height: 2.2rem;
|
|
21
|
-
font-size: 2rem;
|
|
22
|
-
}
|
package/dist/Spacer/Spacer.d.ts
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
.table {
|
|
2
|
-
border-collapse: unset;
|
|
3
|
-
border-spacing: unset;
|
|
4
|
-
border-radius: 0.7rem;
|
|
5
|
-
overflow: hidden;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
.table .tbody .tr:nth-child(even) {
|
|
9
|
-
background-color: #7d7d7d20;
|
|
10
|
-
}
|
|
11
|
-
.table .tbody .tr:hover {
|
|
12
|
-
background-color: #7d7d7d30;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
.table .thead .tr .th,
|
|
16
|
-
.table .tfoot .tr .td {
|
|
17
|
-
padding: 1rem;
|
|
18
|
-
background-color: rgb(var(--surfaceContainerColor, 243 237 247));
|
|
19
|
-
border-inline-start: 0.1rem solid #7d7d7d15;
|
|
20
|
-
font-size: 1.5rem;
|
|
21
|
-
line-height: 3rem;
|
|
22
|
-
text-align: start;
|
|
23
|
-
}
|
|
24
|
-
.table .thead .tr .th {
|
|
25
|
-
border-bottom: 0.2rem solid #7d7d7d40;
|
|
26
|
-
}
|
|
27
|
-
.table .tfoot .tr .td {
|
|
28
|
-
border-top: 0.2rem solid #7d7d7d40;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
.table .tbody .tr .td {
|
|
32
|
-
padding: 0.5rem 1rem;
|
|
33
|
-
border-inline-start: 0.1rem solid #7d7d7d15;
|
|
34
|
-
font-size: 1.4rem;
|
|
35
|
-
line-height: 3rem;
|
|
36
|
-
}
|
|
37
|
-
.table .thead .tr .th:nth-child(1),
|
|
38
|
-
.table .tbody .tr .td:nth-child(1),
|
|
39
|
-
.table .tfoot .tr .td:nth-child(1) {
|
|
40
|
-
border-inline-start: initial;
|
|
41
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { RefObject } from "react";
|
|
2
|
-
import { Dropdown, DropdownProps, Popup, PopupProps, StackProps } from "..";
|
|
3
|
-
export interface OverlayProps {
|
|
4
|
-
triggerref?: RefObject<HTMLElement | null>;
|
|
5
|
-
onClose?: () => void;
|
|
6
|
-
}
|
|
7
|
-
type AllowedOverlays = React.ReactElement<PopupProps, typeof Popup> | React.ReactElement<DropdownProps, typeof Dropdown>;
|
|
8
|
-
export interface WithOverlayProps extends StackProps {
|
|
9
|
-
trigger?: "onClick" | "onRightClick";
|
|
10
|
-
overlay?: AllowedOverlays;
|
|
11
|
-
children?: React.ReactElement;
|
|
12
|
-
ref?: React.Ref<HTMLDivElement>;
|
|
13
|
-
}
|
|
14
|
-
export declare function WithOverlay({ trigger, overlay, children, onClick, ref, ...restProps }: WithOverlayProps): import("react").JSX.Element;
|
|
15
|
-
export {};
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
-
var t = {};
|
|
4
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
-
t[p] = s[p];
|
|
6
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
-
t[p[i]] = s[p[i]];
|
|
10
|
-
}
|
|
11
|
-
return t;
|
|
12
|
-
};
|
|
13
|
-
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
|
-
import { useState, useRef, useImperativeHandle, cloneElement, } from "react";
|
|
15
|
-
import { Stack, } from "..";
|
|
16
|
-
import { useOnRightClick } from "@yakad/use-interactions";
|
|
17
|
-
export function WithOverlay(_a) {
|
|
18
|
-
var { trigger = "onClick", overlay, children, onClick, ref } = _a, restProps = __rest(_a, ["trigger", "overlay", "children", "onClick", "ref"]);
|
|
19
|
-
// Get Triggers ref and send to Overlay
|
|
20
|
-
const localRef = useRef(null);
|
|
21
|
-
const [showOverlay, setShowOverlay] = useState(false);
|
|
22
|
-
useOnRightClick(() => {
|
|
23
|
-
setShowOverlay(true);
|
|
24
|
-
}, localRef);
|
|
25
|
-
const onClickHandler = (e) => {
|
|
26
|
-
trigger === "onClick" && setShowOverlay((prev) => !prev);
|
|
27
|
-
onClick === null || onClick === void 0 ? void 0 : onClick(e);
|
|
28
|
-
};
|
|
29
|
-
// Let the parent access our DOM node
|
|
30
|
-
useImperativeHandle(ref, () => localRef.current);
|
|
31
|
-
const clonedOverlay = cloneElement(overlay, {
|
|
32
|
-
triggerref: localRef,
|
|
33
|
-
onClose: () => {
|
|
34
|
-
var _a, _b;
|
|
35
|
-
(_b = overlay === null || overlay === void 0 ? void 0 : (_a = overlay.props).onClose) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
36
|
-
setShowOverlay(false);
|
|
37
|
-
},
|
|
38
|
-
});
|
|
39
|
-
return (_jsxs(_Fragment, { children: [_jsx(Stack, Object.assign({ ref: localRef }, restProps, { onClick: onClickHandler, children: children })), showOverlay && clonedOverlay] }));
|
|
40
|
-
}
|