@yakad/ui 1.3.125 → 1.3.129
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/AppBar/AppBar.d.ts +1 -1
- package/dist/AppBar/AppBar.module.css +2 -2
- package/dist/Card/Card.d.ts +4 -2
- package/dist/Card/Card.js +2 -2
- package/dist/CheckBox/CheckBox.js +1 -1
- package/dist/CodeBox/CodeBox.js +1 -1
- package/dist/CodeField/CodeField.js +1 -1
- package/dist/Display/Display.d.ts +3 -1
- package/dist/Display/Display.js +3 -2
- package/dist/DisplayOnVisible/DisplayOnVisible.d.ts +9 -0
- package/dist/{RenderOnVisible/RenderOnVisible.js → DisplayOnVisible/DisplayOnVisible.js} +8 -6
- package/dist/DisplayOnVisible/DisplayOnVisible.module.css +3 -0
- package/dist/Footer/Footer.module.css +1 -1
- package/dist/Form/Form.d.ts +1 -0
- package/dist/Form/Form.js +2 -2
- package/dist/InputField/InputField.js +1 -1
- package/dist/List/List.js +1 -1
- package/dist/LoadingControl/LoadingControl.d.ts +12 -0
- package/dist/LoadingControl/LoadingControl.js +52 -0
- package/dist/Navigation/Navigation.module.css +6 -5
- package/dist/Popup/Popup.d.ts +0 -2
- package/dist/Popup/Popup.js +1 -1
- package/dist/Row/Row.d.ts +1 -0
- package/dist/Row/Row.js +2 -2
- package/dist/Select/Select.js +1 -1
- package/dist/Spacer/Spacer.d.ts +1 -3
- package/dist/Stack/Stack.d.ts +1 -0
- package/dist/Stack/Stack.js +2 -2
- package/dist/Table/Table.js +1 -1
- package/dist/Text/Text.d.ts +1 -0
- package/dist/Text/Text.js +45 -18
- package/dist/Text/Text.module.css +9 -0
- package/dist/Theme/Theme.module.css +0 -3
- package/dist/boxing.module.css +2 -2
- package/dist/index.d.ts +4 -4
- package/dist/index.js +5 -4
- package/package.json +1 -1
- package/dist/RenderOnVisible/RenderOnVisible.d.ts +0 -5
- package/dist/RenderOnVisible/RenderOnVisible.module.css +0 -3
- package/dist/WithDropdawn/WithDropdawn.d.ts +0 -11
- package/dist/WithDropdawn/WithDropdawn.js +0 -77
- package/dist/WithDropdawn/WithDropdawn.module.css +0 -47
- package/dist/boxing.d.ts +0 -7
- package/dist/boxing.js +0 -1
package/dist/AppBar/AppBar.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
export interface AppBarProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
3
3
|
align?: "start" | "space" | "center" | "end";
|
|
4
|
-
overflow?: "shrink" | "wrap" | "scroll";
|
|
5
4
|
position?: "initial" | "sticky" | "scroll";
|
|
5
|
+
overflow?: "shrink" | "wrap" | "scroll";
|
|
6
6
|
size?: "xs" | "sm" | "md" | "lg" | "xl";
|
|
7
7
|
blur?: boolean;
|
|
8
8
|
children?: React.ReactNode;
|
|
@@ -3,14 +3,14 @@
|
|
|
3
3
|
padding-left: 2rem;
|
|
4
4
|
padding-right: 2rem;
|
|
5
5
|
gap: 1rem;
|
|
6
|
-
box-shadow: 0 0.1rem 0 0 rgb(var(--
|
|
7
|
-
z-index: 2;
|
|
6
|
+
box-shadow: 0 0.1rem 0 0 rgb(var(--outlineColor, 121 116 126));
|
|
8
7
|
background: rgb(var(--surfaceContainerColor, 243 237 247));
|
|
9
8
|
color: rgb(var(--onSurfaceColor, 28 27 31));
|
|
10
9
|
fill: rgb(var(--onSurfaceColor, 28 27 31));
|
|
11
10
|
transition: transform 0.3s ease;
|
|
12
11
|
will-change: transform;
|
|
13
12
|
user-select: none;
|
|
13
|
+
z-index: 2;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
.xs {
|
package/dist/Card/Card.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import "./card.css";
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
export interface CardProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
align?: "start" | "space" | "center" | "end";
|
|
5
|
+
fullWidth?: boolean;
|
|
6
|
+
blur?: boolean;
|
|
5
7
|
level?: "low" | "mid" | "high";
|
|
6
8
|
}
|
|
7
9
|
export declare const Card: import("react").ForwardRefExoticComponent<CardProps & import("react").RefAttributes<HTMLDivElement>>;
|
package/dist/Card/Card.js
CHANGED
|
@@ -16,8 +16,8 @@ import boxingStyles from "../boxing.module.css";
|
|
|
16
16
|
import styles from "./Card.module.css";
|
|
17
17
|
import "./card.css";
|
|
18
18
|
export const Card = forwardRef(function Card(_a, ref) {
|
|
19
|
-
var { fullWidth = true,
|
|
20
|
-
const joinedClassNames = classNames(boxingStyles.flexColumnBox, { [boxingStyles[align]]: align }, {
|
|
19
|
+
var { align, fullWidth = true, blur, level, className, children } = _a, restProps = __rest(_a, ["align", "fullWidth", "blur", "level", "className", "children"]);
|
|
20
|
+
const joinedClassNames = classNames(boxingStyles.flexColumnBox, { [boxingStyles[align]]: align }, { fullWidth: fullWidth }, styles.card, { [styles.blur]: blur }, {
|
|
21
21
|
yakadCardAutoLevel: level === undefined,
|
|
22
22
|
yakadCardLowLevel: level === "low",
|
|
23
23
|
yakadCardMidLevel: level === "mid",
|
|
@@ -16,6 +16,6 @@ import { Symbol } from "@yakad/symbols";
|
|
|
16
16
|
import styles from "./CheckBox.module.css";
|
|
17
17
|
export const CheckBox = forwardRef(function CheckBox(_a, ref) {
|
|
18
18
|
var { label, className, style } = _a, restProps = __rest(_a, ["label", "className", "style"]);
|
|
19
|
-
const joinedClassNames = classNames({
|
|
19
|
+
const joinedClassNames = classNames({ fullWidth: label }, styles.label, { [styles.labeled]: label }, { [styles.disabled]: restProps.disabled }, className);
|
|
20
20
|
return (_jsxs("label", { className: joinedClassNames, style: style, children: [label, _jsx("input", Object.assign({ ref: ref }, restProps, { className: styles.input, type: "checkbox" })), _jsxs("div", { className: styles.symbolContainer, children: [_jsx(Symbol, { className: styles.symbolChecked, icon: "check_box" }), _jsx(Symbol, { className: styles.symbolUnChecked, icon: "check_box_outline_blank" })] })] }));
|
|
21
21
|
});
|
package/dist/CodeBox/CodeBox.js
CHANGED
|
@@ -17,6 +17,6 @@ import { Button, Card } from "..";
|
|
|
17
17
|
import styles from "./CodeBox.module.css";
|
|
18
18
|
export const CodeBox = forwardRef(function CodeBox(_a, ref) {
|
|
19
19
|
var { copyButton, className, children } = _a, restProps = __rest(_a, ["copyButton", "className", "children"]);
|
|
20
|
-
const joinedClassNames = classNames({
|
|
20
|
+
const joinedClassNames = classNames({ fullWidth: true }, styles.ZZZZZZZZZZ, className);
|
|
21
21
|
return (_jsxs(Card, Object.assign({ ref: ref }, restProps, { className: joinedClassNames, children: [_jsx("pre", { children: children }), copyButton && _jsx(Button, { icon: _jsx(Symbol, { icon: "copy_all" }) })] })));
|
|
22
22
|
});
|
|
@@ -32,7 +32,7 @@ function removeUnNumberChars(inputElement) {
|
|
|
32
32
|
}
|
|
33
33
|
export const CodeField = forwardRef(function CodeField(_a, ref) {
|
|
34
34
|
var { length = 6, onFilled, autoComplete, pattern, onInput, className, style } = _a, restProps = __rest(_a, ["length", "onFilled", "autoComplete", "pattern", "onInput", "className", "style"]);
|
|
35
|
-
const joinedClassNames = classNames({
|
|
35
|
+
const joinedClassNames = classNames({ fullWidth: true }, styles.input, className);
|
|
36
36
|
const joinedStyles = Object.assign(Object.assign({}, style), { width: `calc(1.5ch * ${length})` });
|
|
37
37
|
return (_jsx("input", Object.assign({ ref: ref }, restProps, { className: joinedClassNames, style: joinedStyles, type: "number", minLength: length, maxLength: length, autoComplete: autoComplete || "off", pattern: pattern || "[0-9]", onInput: (event) => {
|
|
38
38
|
isInputFilled(event, length) && onFilled;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
export interface DisplayProps extends React.HTMLAttributes<
|
|
2
|
+
export interface DisplayProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
align?: "start" | "space" | "center" | "end";
|
|
4
|
+
fullWidth?: boolean;
|
|
3
5
|
minWidth?: "xs" | "sm" | "md" | "lg" | "xl";
|
|
4
6
|
maxWidth?: "xs" | "sm" | "md" | "lg" | "xl";
|
|
5
7
|
children?: React.ReactNode;
|
package/dist/Display/Display.js
CHANGED
|
@@ -12,9 +12,10 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
13
|
import { forwardRef } from "react";
|
|
14
14
|
import classNames from "classnames";
|
|
15
|
+
import boxingStyles from "../boxing.module.css";
|
|
15
16
|
import styles from "./Display.module.css";
|
|
16
17
|
export const Display = forwardRef(function Display(_a, ref) {
|
|
17
|
-
var { minWidth, maxWidth, className, children } = _a, restProps = __rest(_a, ["minWidth", "maxWidth", "className", "children"]);
|
|
18
|
-
const joinedClassNames = classNames({
|
|
18
|
+
var { align, fullWidth = true, minWidth, maxWidth, className, children } = _a, restProps = __rest(_a, ["align", "fullWidth", "minWidth", "maxWidth", "className", "children"]);
|
|
19
|
+
const joinedClassNames = classNames(boxingStyles.flexColumnBox, { [boxingStyles[align]]: align }, { fullWidth: fullWidth }, { [styles[`${minWidth}MinWidth`]]: minWidth }, { [styles[`${maxWidth}MaxWidth`]]: maxWidth }, className);
|
|
19
20
|
return (_jsx("div", Object.assign({ ref: ref }, restProps, { className: joinedClassNames, children: children })));
|
|
20
21
|
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export interface DisplayOnVisibleProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
align?: "start" | "space" | "center" | "end";
|
|
4
|
+
fullWidth?: boolean;
|
|
5
|
+
onVisible?: () => void;
|
|
6
|
+
onHidden?: () => void;
|
|
7
|
+
children?: React.ReactNode;
|
|
8
|
+
}
|
|
9
|
+
export declare const DisplayOnVisible: import("react").ForwardRefExoticComponent<DisplayOnVisibleProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -14,10 +14,10 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
14
14
|
import { forwardRef, useImperativeHandle, useRef, useState } from "react";
|
|
15
15
|
import classNames from "classnames";
|
|
16
16
|
import boxingStyles from "../boxing.module.css";
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
export const
|
|
20
|
-
var { align,
|
|
17
|
+
import { WithInteractions } from "..";
|
|
18
|
+
import styles from "./DisplayOnVisible.module.css";
|
|
19
|
+
export const DisplayOnVisible = forwardRef(function DisplayOnVisible(_a, forwardedRef) {
|
|
20
|
+
var { align, fullWidth = true, onVisible, onHidden, className, style, children } = _a, restProps = __rest(_a, ["align", "fullWidth", "onVisible", "onHidden", "className", "style", "children"]);
|
|
21
21
|
const localRef = useRef(null);
|
|
22
22
|
// Let the parent access our DOM node
|
|
23
23
|
useImperativeHandle(forwardedRef, () => localRef.current);
|
|
@@ -25,13 +25,15 @@ export const RenderOnVisible = forwardRef(function RenderOnVisible(_a, forwarded
|
|
|
25
25
|
const isVisible = boxHeight === 0;
|
|
26
26
|
const handleOnVisible = () => {
|
|
27
27
|
setBoxHeight(0);
|
|
28
|
+
onVisible === null || onVisible === void 0 ? void 0 : onVisible();
|
|
28
29
|
};
|
|
29
30
|
const handleOnHidden = () => {
|
|
30
31
|
if (localRef.current) {
|
|
31
32
|
const boxRect = localRef.current.getBoundingClientRect();
|
|
32
33
|
setBoxHeight(boxRect.height);
|
|
33
34
|
}
|
|
35
|
+
onHidden === null || onHidden === void 0 ? void 0 : onHidden();
|
|
34
36
|
};
|
|
35
|
-
const joinedClassNames = classNames(boxingStyles.flexColumnBox, { [boxingStyles[align]]: align }, {
|
|
36
|
-
return (_jsx(WithInteractions, { onVisible: handleOnVisible, onHidden: handleOnHidden, children: _jsx("div", Object.assign({ ref: localRef }, restProps, { className: joinedClassNames, style: Object.assign({ height: boxHeight || "auto" }, style), children:
|
|
37
|
+
const joinedClassNames = classNames(boxingStyles.flexColumnBox, { [boxingStyles[align]]: align }, { fullWidth: fullWidth }, { [styles.notVisible]: !isVisible }, className);
|
|
38
|
+
return (_jsx(WithInteractions, { onVisible: handleOnVisible, onHidden: handleOnHidden, children: _jsx("div", Object.assign({ ref: localRef }, restProps, { className: joinedClassNames, style: Object.assign({ height: boxHeight || "auto" }, style), children: children })) }));
|
|
37
39
|
});
|
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
padding-left: 2rem;
|
|
4
4
|
padding-right: 2rem;
|
|
5
5
|
gap: 1rem;
|
|
6
|
-
z-index: 1;
|
|
7
6
|
background: rgb(var(--surfaceContainerColor, 243 237 247));
|
|
8
7
|
color: rgb(var(--onSurfaceColor, 28 27 31));
|
|
9
8
|
fill: rgb(var(--onSurfaceColor, 28 27 31));
|
|
10
9
|
transition: transform 0.3s ease;
|
|
11
10
|
will-change: transform;
|
|
12
11
|
user-select: none;
|
|
12
|
+
z-index: 1;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
.xs {
|
package/dist/Form/Form.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
export interface FormProps extends React.HTMLAttributes<HTMLFormElement> {
|
|
3
3
|
align?: "start" | "space" | "center" | "end";
|
|
4
|
+
fullWidth?: boolean;
|
|
4
5
|
children?: React.ReactNode;
|
|
5
6
|
}
|
|
6
7
|
export declare const Form: import("react").ForwardRefExoticComponent<FormProps & import("react").RefAttributes<HTMLFormElement>>;
|
package/dist/Form/Form.js
CHANGED
|
@@ -15,7 +15,7 @@ import classNames from "classnames";
|
|
|
15
15
|
import styles from "./Form.module.css";
|
|
16
16
|
import boxingStyles from "../boxing.module.css";
|
|
17
17
|
export const Form = forwardRef(function Form(_a, ref) {
|
|
18
|
-
var { align, className, children } = _a, restProps = __rest(_a, ["align", "className", "children"]);
|
|
19
|
-
const joinedClassNames = classNames(boxingStyles.flexColumnBox, { [boxingStyles[align]]: align }, {
|
|
18
|
+
var { align, fullWidth = true, className, children } = _a, restProps = __rest(_a, ["align", "fullWidth", "className", "children"]);
|
|
19
|
+
const joinedClassNames = classNames(boxingStyles.flexColumnBox, { [boxingStyles[align]]: align }, { fullWidth: fullWidth }, styles.form, className);
|
|
20
20
|
return (_jsx("form", Object.assign({ ref: ref }, restProps, { className: joinedClassNames, children: children })));
|
|
21
21
|
});
|
|
@@ -16,5 +16,5 @@ import styles from "./InputField.module.css";
|
|
|
16
16
|
export const InputField = forwardRef(function InputField(_a, ref) {
|
|
17
17
|
var { variant = "outlined", boxSize = "normal", placeholder, className } = _a, restProps = __rest(_a, ["variant", "boxSize", "placeholder", "className"]);
|
|
18
18
|
const joinedClassNames = classNames(styles.input, styles[variant], styles[boxSize], placeholder && styles.havePlaceHolder, className);
|
|
19
|
-
return (_jsxs("div", { className: classNames({
|
|
19
|
+
return (_jsxs("div", { className: classNames({ fullWidth: true }, styles.div), children: [_jsx("input", Object.assign({ ref: ref }, restProps, { className: joinedClassNames, placeholder: " " })), placeholder && (_jsx("label", { className: styles.label, children: placeholder }))] }));
|
|
20
20
|
});
|
package/dist/List/List.js
CHANGED
|
@@ -15,6 +15,6 @@ import classNames from "classnames";
|
|
|
15
15
|
import styles from "./List.module.css";
|
|
16
16
|
export const List = forwardRef(function List(_a, ref) {
|
|
17
17
|
var { direction = "row", collapsed, className, children } = _a, restProps = __rest(_a, ["direction", "collapsed", "className", "children"]);
|
|
18
|
-
const joinedClassNames = classNames({
|
|
18
|
+
const joinedClassNames = classNames({ fullWidth: true }, styles.list, styles[direction], { [styles.collapsed]: collapsed }, className);
|
|
19
19
|
return (_jsx("ul", Object.assign({ ref: ref }, restProps, { className: joinedClassNames, children: children })));
|
|
20
20
|
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
type LoadingControlChildren = React.ReactElement<{
|
|
3
|
+
index?: number;
|
|
4
|
+
}>;
|
|
5
|
+
export interface LoadingControlProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
6
|
+
align?: "start" | "space" | "center" | "end";
|
|
7
|
+
fullWidth?: boolean;
|
|
8
|
+
loadingLimit?: number;
|
|
9
|
+
children: LoadingControlChildren;
|
|
10
|
+
}
|
|
11
|
+
export declare const LoadingControl: React.ForwardRefExoticComponent<LoadingControlProps & React.RefAttributes<HTMLDivElement>>;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,52 @@
|
|
|
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 React, { forwardRef, useEffect, useState } from "react";
|
|
15
|
+
import classNames from "classnames";
|
|
16
|
+
import boxingStyles from "../boxing.module.css";
|
|
17
|
+
import { DisplayOnVisible } from "..";
|
|
18
|
+
export const LoadingControl = forwardRef(function LoadingControl(_a, ref) {
|
|
19
|
+
var { align, fullWidth = true, loadingLimit = 20, className, children } = _a, restProps = __rest(_a, ["align", "fullWidth", "loadingLimit", "className", "children"]);
|
|
20
|
+
const [maxLoadedItem, setMaxLoadedItem] = useState(0);
|
|
21
|
+
const [maxVisibledItem, setMaxVisibledItem] = useState(0);
|
|
22
|
+
const [loadedItems, setLoadedItems] = useState([
|
|
23
|
+
React.cloneElement(children, {
|
|
24
|
+
index: 0,
|
|
25
|
+
}),
|
|
26
|
+
]);
|
|
27
|
+
const handleOnVisible = (i) => {
|
|
28
|
+
if (i && maxVisibledItem < i)
|
|
29
|
+
setMaxVisibledItem(i);
|
|
30
|
+
};
|
|
31
|
+
useEffect(() => {
|
|
32
|
+
if (maxLoadedItem < maxVisibledItem + 5) {
|
|
33
|
+
const prevIndex = maxLoadedItem;
|
|
34
|
+
setMaxLoadedItem(prevIndex + 1);
|
|
35
|
+
setLoadedItems([
|
|
36
|
+
...loadedItems,
|
|
37
|
+
React.cloneElement(children, {
|
|
38
|
+
key: prevIndex + 1,
|
|
39
|
+
}),
|
|
40
|
+
].slice(loadedItems.length >= loadingLimit ? 1 : 0));
|
|
41
|
+
}
|
|
42
|
+
}, [
|
|
43
|
+
children,
|
|
44
|
+
loadingLimit,
|
|
45
|
+
loadedItems,
|
|
46
|
+
maxLoadedItem,
|
|
47
|
+
maxVisibledItem,
|
|
48
|
+
]);
|
|
49
|
+
console.log("loadedItems.length", loadedItems.length, "maxLoadedItem", maxLoadedItem, "maxVisibledItem", maxVisibledItem);
|
|
50
|
+
const joinedClassNames = classNames(boxingStyles.flexColumnBox, { [boxingStyles[align]]: align }, { fullWidth: fullWidth }, className);
|
|
51
|
+
return (_jsx("div", Object.assign({ ref: ref, className: joinedClassNames }, restProps, { children: loadedItems.map((item) => (_jsxs(DisplayOnVisible, { onVisible: () => handleOnVisible(item.props.index), children: [_jsx("h1", { children: item.props.index }), item] }, item.props.index))) })));
|
|
52
|
+
});
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
position: fixed;
|
|
3
3
|
max-width: 100%;
|
|
4
4
|
padding: 1rem 0;
|
|
5
|
-
z-index: 3;
|
|
6
5
|
background: rgb(var(--surfaceContainerColor, 243 237 247));
|
|
7
6
|
color: rgb(var(--onSurfaceColor, 28 27 31));
|
|
8
7
|
fill: rgb(var(--onSurfaceColor, 28 27 31));
|
|
9
8
|
transition: transform 0.3s;
|
|
10
9
|
overflow-y: auto;
|
|
10
|
+
z-index: 3;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
.auto,
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
width: 21.9rem;
|
|
18
18
|
height: calc(100% - 6rem);
|
|
19
19
|
max-height: 100%;
|
|
20
|
-
border-inline-end: 0.2rem solid
|
|
20
|
+
border-inline-end: 0.2rem solid rgb(var(--outlineColor, 121 116 126));
|
|
21
21
|
transform: translate(-100%, 0);
|
|
22
22
|
}
|
|
23
23
|
[dir="rtl"] .auto,
|
|
@@ -27,7 +27,8 @@
|
|
|
27
27
|
width: 21.9rem;
|
|
28
28
|
height: calc(100% - 6rem);
|
|
29
29
|
max-height: 100%;
|
|
30
|
-
border-inline-end: 0.2rem solid
|
|
30
|
+
border-inline-end: 0.2rem solid rgb(var(--outlineColor, 121 116 126));
|
|
31
|
+
|
|
31
32
|
transform: translate(100%, 0);
|
|
32
33
|
}
|
|
33
34
|
|
|
@@ -35,14 +36,14 @@
|
|
|
35
36
|
top: 0;
|
|
36
37
|
width: 100%;
|
|
37
38
|
height: auto;
|
|
38
|
-
border-bottom: 0.2rem solid
|
|
39
|
+
border-bottom: 0.2rem solid rgb(var(--outlineColor, 121 116 126));
|
|
39
40
|
transform: translate(0, -100%);
|
|
40
41
|
}
|
|
41
42
|
.bottom {
|
|
42
43
|
bottom: 0;
|
|
43
44
|
width: 100%;
|
|
44
45
|
height: auto;
|
|
45
|
-
border-top: 0.2rem solid
|
|
46
|
+
border-top: 0.2rem solid rgb(var(--outlineColor, 121 116 126));
|
|
46
47
|
transform: translate(0, 100%);
|
|
47
48
|
}
|
|
48
49
|
|
package/dist/Popup/Popup.d.ts
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { CardProps, OverlayProps } from "..";
|
|
3
3
|
export interface PopupProps extends CardProps, OverlayProps {
|
|
4
|
-
align?: "start" | "space" | "center" | "end";
|
|
5
4
|
heading?: string;
|
|
6
|
-
children?: React.ReactNode;
|
|
7
5
|
}
|
|
8
6
|
export declare const Popup: import("react").ForwardRefExoticComponent<PopupProps & import("react").RefAttributes<HTMLDivElement>>;
|
package/dist/Popup/Popup.js
CHANGED
|
@@ -17,6 +17,6 @@ import { Symbol } from "@yakad/symbols";
|
|
|
17
17
|
import { Button, Card, Row, Screen, Spacer, Stack, Text, WithInteractions, } from "..";
|
|
18
18
|
import styles from "./Popup.module.css";
|
|
19
19
|
export const Popup = forwardRef(function Popup(_a, ref) {
|
|
20
|
-
var { align,
|
|
20
|
+
var { align, onClose, heading, className, children } = _a, restProps = __rest(_a, ["align", "onClose", "heading", "className", "children"]);
|
|
21
21
|
return (_jsx(Screen, { align: "center", className: styles.popupscreen, children: _jsx(WithInteractions, { onOutsideClick: onClose, children: _jsxs(Card, Object.assign({ ref: ref }, 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(Symbol, { icon: "close" }), onClick: onClose })] }), _jsx(Stack, { align: align, style: { width: "100%", overflowY: "auto" }, children: children })] })) }) }));
|
|
22
22
|
});
|
package/dist/Row/Row.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
export interface RowProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
3
3
|
align?: "start" | "space" | "center" | "end";
|
|
4
|
+
fullWidth?: boolean;
|
|
4
5
|
overflow?: "shrink" | "wrap" | "scroll";
|
|
5
6
|
size?: "xs" | "sm" | "md" | "lg" | "xl";
|
|
6
7
|
children?: React.ReactNode;
|
package/dist/Row/Row.js
CHANGED
|
@@ -15,7 +15,7 @@ import classNames from "classnames";
|
|
|
15
15
|
import boxingStyles from "../boxing.module.css";
|
|
16
16
|
import styles from "./Row.module.css";
|
|
17
17
|
export const Row = forwardRef(function Row(_a, ref) {
|
|
18
|
-
var { align, overflow = "shrink", size = "xl", className, children } = _a, restProps = __rest(_a, ["align", "overflow", "size", "className", "children"]);
|
|
19
|
-
const joinedClassNames = classNames(boxingStyles.flexRowBox, { [boxingStyles[align]]: align }, boxingStyles[overflow], styles.row, {
|
|
18
|
+
var { align, fullWidth = true, overflow = "shrink", size = "xl", className, children } = _a, restProps = __rest(_a, ["align", "fullWidth", "overflow", "size", "className", "children"]);
|
|
19
|
+
const joinedClassNames = classNames(boxingStyles.flexRowBox, { [boxingStyles[align]]: align }, boxingStyles[overflow], styles.row, { fullWidth: fullWidth }, styles[size], className);
|
|
20
20
|
return (_jsx("div", Object.assign({ ref: ref }, restProps, { className: joinedClassNames, children: children })));
|
|
21
21
|
});
|
package/dist/Select/Select.js
CHANGED
|
@@ -17,5 +17,5 @@ import inputStyles from "../InputField/InputField.module.css";
|
|
|
17
17
|
export const Select = forwardRef(function Select(_a, ref) {
|
|
18
18
|
var { variant = "outlined", boxsize = "normal", placeholder, className, children } = _a, restProps = __rest(_a, ["variant", "boxsize", "placeholder", "className", "children"]);
|
|
19
19
|
const joinedClassNames = classNames(styles.select, inputStyles.input, inputStyles[variant], inputStyles[boxsize], { [inputStyles.havePlaceHolder]: placeholder }, className);
|
|
20
|
-
return (_jsxs("div", { className: classNames({
|
|
20
|
+
return (_jsxs("div", { className: classNames({ fullWidth: true }, inputStyles.div), children: [_jsx("select", Object.assign({ ref: ref }, restProps, { className: joinedClassNames, children: children })), placeholder ? (_jsx("label", { className: inputStyles.label, children: placeholder })) : null] }));
|
|
21
21
|
});
|
package/dist/Spacer/Spacer.d.ts
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
|
|
3
|
-
export interface SpacerProps extends Omit<React.HTMLAttributes<HTMLDivElement>, ExcludedTypes> {
|
|
2
|
+
export interface SpacerProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "children"> {
|
|
4
3
|
}
|
|
5
4
|
export declare const Spacer: import("react").ForwardRefExoticComponent<SpacerProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
6
|
-
export {};
|
package/dist/Stack/Stack.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
export interface StackProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
3
3
|
align?: "start" | "space" | "center" | "end";
|
|
4
|
+
fullWidth?: boolean;
|
|
4
5
|
children?: React.ReactNode;
|
|
5
6
|
}
|
|
6
7
|
export declare const Stack: import("react").ForwardRefExoticComponent<StackProps & import("react").RefAttributes<HTMLDivElement>>;
|
package/dist/Stack/Stack.js
CHANGED
|
@@ -15,7 +15,7 @@ import classNames from "classnames";
|
|
|
15
15
|
import boxingStyles from "../boxing.module.css";
|
|
16
16
|
import styles from "./Stack.module.css";
|
|
17
17
|
export const Stack = forwardRef(function Stack(_a, ref) {
|
|
18
|
-
var { align, className, children } = _a, restProps = __rest(_a, ["align", "className", "children"]);
|
|
19
|
-
const joinedClassNames = classNames(boxingStyles.flexColumnBox, { [boxingStyles[align]]: align }, {
|
|
18
|
+
var { align, fullWidth = true, className, children } = _a, restProps = __rest(_a, ["align", "fullWidth", "className", "children"]);
|
|
19
|
+
const joinedClassNames = classNames(boxingStyles.flexColumnBox, { [boxingStyles[align]]: align }, { fullWidth: fullWidth }, styles.stack, className);
|
|
20
20
|
return (_jsx("div", Object.assign({ ref: ref }, restProps, { className: joinedClassNames, children: children })));
|
|
21
21
|
});
|
package/dist/Table/Table.js
CHANGED
|
@@ -15,7 +15,7 @@ import classNames from "classnames";
|
|
|
15
15
|
import styles from "./Table.module.css";
|
|
16
16
|
export const Table = forwardRef(function Table(_a, ref) {
|
|
17
17
|
var { className, children } = _a, restProps = __rest(_a, ["className", "children"]);
|
|
18
|
-
const joinedClassNames = classNames({
|
|
18
|
+
const joinedClassNames = classNames({ fullWidth: true }, styles.table, className);
|
|
19
19
|
return (_jsx("table", Object.assign({ ref: ref }, restProps, { className: joinedClassNames, children: children })));
|
|
20
20
|
});
|
|
21
21
|
export const Thead = forwardRef(function Thead(_a, ref) {
|
package/dist/Text/Text.d.ts
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
type TextVariant = "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "body1" | "body2" | "body3" | "body4" | "body5" | "body6" | "caption" | "span";
|
|
3
3
|
export interface HeadingProps extends React.HTMLAttributes<HTMLHeadingElement> {
|
|
4
4
|
variant?: TextVariant;
|
|
5
|
+
color?: "onSurfaceColor" | "onSurfaceVariantColor";
|
|
5
6
|
children?: React.ReactNode;
|
|
6
7
|
}
|
|
7
8
|
export declare const H1: import("react").ForwardRefExoticComponent<HeadingProps & import("react").RefAttributes<HTMLHeadingElement>>;
|
package/dist/Text/Text.js
CHANGED
|
@@ -14,47 +14,74 @@ import { forwardRef } from "react";
|
|
|
14
14
|
import classNames from "classnames";
|
|
15
15
|
import styles from "./Text.module.css";
|
|
16
16
|
export const H1 = forwardRef(function H1(_a, ref) {
|
|
17
|
-
var { variant = "heading1", className, children } = _a, restProps = __rest(_a, ["variant", "className", "children"]);
|
|
18
|
-
const joinedClassNames = classNames(styles.text, styles[variant],
|
|
17
|
+
var { variant = "heading1", color, className, children } = _a, restProps = __rest(_a, ["variant", "color", "className", "children"]);
|
|
18
|
+
const joinedClassNames = classNames(styles.text, styles[variant], {
|
|
19
|
+
[styles.onSurfaceColor]: color === "onSurfaceColor",
|
|
20
|
+
[styles.onSurfaceVariantColor]: color === "onSurfaceVariantColor",
|
|
21
|
+
}, className);
|
|
19
22
|
return (_jsx("h1", Object.assign({ ref: ref }, restProps, { className: joinedClassNames, children: children })));
|
|
20
23
|
});
|
|
21
24
|
export const H2 = forwardRef(function H2(_a, ref) {
|
|
22
|
-
var { variant = "heading2", className, children } = _a, restProps = __rest(_a, ["variant", "className", "children"]);
|
|
23
|
-
const joinedClassNames = classNames(styles.text, styles[variant],
|
|
25
|
+
var { variant = "heading2", color, className, children } = _a, restProps = __rest(_a, ["variant", "color", "className", "children"]);
|
|
26
|
+
const joinedClassNames = classNames(styles.text, styles[variant], {
|
|
27
|
+
[styles.onSurfaceColor]: color === "onSurfaceColor",
|
|
28
|
+
[styles.onSurfaceVariantColor]: color === "onSurfaceVariantColor",
|
|
29
|
+
}, className);
|
|
24
30
|
return (_jsx("h2", Object.assign({ ref: ref }, restProps, { className: joinedClassNames, children: children })));
|
|
25
31
|
});
|
|
26
32
|
export const H3 = forwardRef(function H3(_a, ref) {
|
|
27
|
-
var { variant = "heading3", className, children } = _a, restProps = __rest(_a, ["variant", "className", "children"]);
|
|
28
|
-
const joinedClassNames = classNames(styles.text, styles[variant],
|
|
33
|
+
var { variant = "heading3", color, className, children } = _a, restProps = __rest(_a, ["variant", "color", "className", "children"]);
|
|
34
|
+
const joinedClassNames = classNames(styles.text, styles[variant], {
|
|
35
|
+
[styles.onSurfaceColor]: color === "onSurfaceColor",
|
|
36
|
+
[styles.onSurfaceVariantColor]: color === "onSurfaceVariantColor",
|
|
37
|
+
}, className);
|
|
29
38
|
return (_jsx("h3", Object.assign({ ref: ref }, restProps, { className: joinedClassNames, children: children })));
|
|
30
39
|
});
|
|
31
40
|
export const H4 = forwardRef(function H4(_a, ref) {
|
|
32
|
-
var { variant = "heading4", className, children } = _a, restProps = __rest(_a, ["variant", "className", "children"]);
|
|
33
|
-
const joinedClassNames = classNames(styles.text, styles[variant],
|
|
41
|
+
var { variant = "heading4", color, className, children } = _a, restProps = __rest(_a, ["variant", "color", "className", "children"]);
|
|
42
|
+
const joinedClassNames = classNames(styles.text, styles[variant], {
|
|
43
|
+
[styles.onSurfaceColor]: color === "onSurfaceColor",
|
|
44
|
+
[styles.onSurfaceVariantColor]: color === "onSurfaceVariantColor",
|
|
45
|
+
}, className);
|
|
34
46
|
return (_jsx("h4", Object.assign({ ref: ref }, restProps, { className: joinedClassNames, children: children })));
|
|
35
47
|
});
|
|
36
48
|
export const H5 = forwardRef(function H5(_a, ref) {
|
|
37
|
-
var { variant = "heading5", className, children } = _a, restProps = __rest(_a, ["variant", "className", "children"]);
|
|
38
|
-
const joinedClassNames = classNames(styles.text, styles[variant],
|
|
49
|
+
var { variant = "heading5", color, className, children } = _a, restProps = __rest(_a, ["variant", "color", "className", "children"]);
|
|
50
|
+
const joinedClassNames = classNames(styles.text, styles[variant], {
|
|
51
|
+
[styles.onSurfaceColor]: color === "onSurfaceColor",
|
|
52
|
+
[styles.onSurfaceVariantColor]: color === "onSurfaceVariantColor",
|
|
53
|
+
}, className);
|
|
39
54
|
return (_jsx("h5", Object.assign({ ref: ref }, restProps, { className: joinedClassNames, children: children })));
|
|
40
55
|
});
|
|
41
56
|
export const H6 = forwardRef(function H6(_a, ref) {
|
|
42
|
-
var { variant = "heading6", className, children } = _a, restProps = __rest(_a, ["variant", "className", "children"]);
|
|
43
|
-
const joinedClassNames = classNames(styles.text, styles[variant],
|
|
57
|
+
var { variant = "heading6", color, className, children } = _a, restProps = __rest(_a, ["variant", "color", "className", "children"]);
|
|
58
|
+
const joinedClassNames = classNames(styles.text, styles[variant], {
|
|
59
|
+
[styles.onSurfaceColor]: color === "onSurfaceColor",
|
|
60
|
+
[styles.onSurfaceVariantColor]: color === "onSurfaceVariantColor",
|
|
61
|
+
}, className);
|
|
44
62
|
return (_jsx("h6", Object.assign({ ref: ref }, restProps, { className: joinedClassNames, children: children })));
|
|
45
63
|
});
|
|
46
64
|
export const P = forwardRef(function P(_a, ref) {
|
|
47
|
-
var { variant = "body5", className, children } = _a, restProps = __rest(_a, ["variant", "className", "children"]);
|
|
48
|
-
const joinedClassNames = classNames(styles.text, styles[variant],
|
|
65
|
+
var { variant = "body5", color, className, children } = _a, restProps = __rest(_a, ["variant", "color", "className", "children"]);
|
|
66
|
+
const joinedClassNames = classNames(styles.text, styles[variant], {
|
|
67
|
+
[styles.onSurfaceColor]: color === "onSurfaceColor",
|
|
68
|
+
[styles.onSurfaceVariantColor]: color === "onSurfaceVariantColor",
|
|
69
|
+
}, className);
|
|
49
70
|
return (_jsx("p", Object.assign({ ref: ref }, restProps, { className: joinedClassNames, children: children })));
|
|
50
71
|
});
|
|
51
72
|
export const Span = forwardRef(function Span(_a, ref) {
|
|
52
|
-
var { variant = "span", className, children } = _a, restProps = __rest(_a, ["variant", "className", "children"]);
|
|
53
|
-
const joinedClassNames = classNames(styles.text, styles[variant],
|
|
73
|
+
var { variant = "span", color, className, children } = _a, restProps = __rest(_a, ["variant", "color", "className", "children"]);
|
|
74
|
+
const joinedClassNames = classNames(styles.text, styles[variant], {
|
|
75
|
+
[styles.onSurfaceColor]: color === "onSurfaceColor",
|
|
76
|
+
[styles.onSurfaceVariantColor]: color === "onSurfaceVariantColor",
|
|
77
|
+
}, className);
|
|
54
78
|
return (_jsx("span", Object.assign({ ref: ref }, restProps, { className: joinedClassNames, children: children })));
|
|
55
79
|
});
|
|
56
80
|
export const Text = forwardRef(function Text(_a, ref) {
|
|
57
|
-
var { variant = "body5", className, children } = _a, restProps = __rest(_a, ["variant", "className", "children"]);
|
|
58
|
-
const joinedClassNames = classNames(styles[variant],
|
|
81
|
+
var { variant = "body5", color, className, children } = _a, restProps = __rest(_a, ["variant", "color", "className", "children"]);
|
|
82
|
+
const joinedClassNames = classNames(styles[variant], {
|
|
83
|
+
[styles.onSurfaceColor]: color === "onSurfaceColor",
|
|
84
|
+
[styles.onSurfaceVariantColor]: color === "onSurfaceVariantColor",
|
|
85
|
+
}, className);
|
|
59
86
|
return (_jsx("div", Object.assign({ ref: ref }, restProps, { className: joinedClassNames, children: children })));
|
|
60
87
|
});
|
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
.onSurfaceColor {
|
|
2
|
+
color: rgb(var(--onSurfaceColor, 28 27 31));
|
|
3
|
+
fill: rgb(var(--onSurfaceColor, 28 27 31));
|
|
4
|
+
}
|
|
5
|
+
.onSurfaceVariantColor {
|
|
6
|
+
color: rgb(var(--onSurfaceVariantColor, 73 69 78));
|
|
7
|
+
fill: rgb(var(--onSurfaceVariantColor, 73 69 78));
|
|
8
|
+
}
|
|
9
|
+
|
|
1
10
|
.text {
|
|
2
11
|
margin: 0;
|
|
3
12
|
}
|
|
@@ -334,7 +334,6 @@
|
|
|
334
334
|
--surfaceContainerHighColor: var(--LightSurfaceContainerHighColor);
|
|
335
335
|
--surfaceContainerHighestColor: var(--LightSurfaceContainerHighestColor);
|
|
336
336
|
--onSurfaceColor: var(--LightOnSurfaceColor);
|
|
337
|
-
--onSurfaceRGBColor: var(--LightOnSurfaceRGBColor);
|
|
338
337
|
--onSurfaceVariantColor: var(--LightOnSurfaceVariantColor);
|
|
339
338
|
--outlineColor: var(--LightOutlineColor);
|
|
340
339
|
--outlineVariantColor: var(--LightOutlineVariantColor);
|
|
@@ -364,7 +363,6 @@
|
|
|
364
363
|
--surfaceContainerHighColor: var(--DarkSurfaceContainerHighColor);
|
|
365
364
|
--surfaceContainerHighestColor: var(--DarkSurfaceContainerHighestColor);
|
|
366
365
|
--onSurfaceColor: var(--DarkOnSurfaceColor);
|
|
367
|
-
--onSurfaceRGBColor: var(--DarkOnSurfaceRGBColor);
|
|
368
366
|
--onSurfaceVariantColor: var(--DarkOnSurfaceVariantColor);
|
|
369
367
|
--outlineColor: var(--DarkOutlineColor);
|
|
370
368
|
--outlineVariantColor: var(--DarkOutlineVariantColor);
|
|
@@ -395,7 +393,6 @@
|
|
|
395
393
|
--surfaceContainerHighColor: var(--DarkSurfaceContainerHighColor);
|
|
396
394
|
--surfaceContainerHighestColor: var(--DarkSurfaceContainerHighestColor);
|
|
397
395
|
--onSurfaceColor: var(--DarkOnSurfaceColor);
|
|
398
|
-
--onSurfaceRGBColor: var(--DarkOnSurfaceRGBColor);
|
|
399
396
|
--onSurfaceVariantColor: var(--DarkOnSurfaceVariantColor);
|
|
400
397
|
--outlineColor: var(--DarkOutlineColor);
|
|
401
398
|
--outlineVariantColor: var(--DarkOutlineVariantColor);
|
package/dist/boxing.module.css
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -12,8 +12,6 @@ export * from "./Card/Card";
|
|
|
12
12
|
export * from "./Theme/Theme";
|
|
13
13
|
export * from "./Spacer/Spacer";
|
|
14
14
|
export * from "./Hr/Hr";
|
|
15
|
-
export * from "./Dropdown/Dropdown";
|
|
16
|
-
export * from "./Popup/Popup";
|
|
17
15
|
export * from "./List/List";
|
|
18
16
|
export * from "./ListItem/ListItem";
|
|
19
17
|
export * from "./Table/Table";
|
|
@@ -30,7 +28,9 @@ export * from "./RadioGroup/RadioGroup";
|
|
|
30
28
|
export * from "./RadioButton/RadioButton";
|
|
31
29
|
export * from "./CodeBox/CodeBox";
|
|
32
30
|
export * from "./Display/Display";
|
|
31
|
+
export * from "./DisplayOnVisible/DisplayOnVisible";
|
|
33
32
|
export * from "./WithInteractions/WithInteractions";
|
|
34
|
-
export * from "./WithDropdawn/WithDropdawn";
|
|
35
33
|
export * from "./WithOverlay/WithOverlay";
|
|
36
|
-
export * from "./
|
|
34
|
+
export * from "./Dropdown/Dropdown";
|
|
35
|
+
export * from "./Popup/Popup";
|
|
36
|
+
export * from "./LoadingControl/LoadingControl";
|
package/dist/index.js
CHANGED
|
@@ -15,8 +15,6 @@ export * from "./Theme/Theme";
|
|
|
15
15
|
export * from "./Spacer/Spacer";
|
|
16
16
|
export * from "./Hr/Hr";
|
|
17
17
|
// UI Components
|
|
18
|
-
export * from "./Dropdown/Dropdown";
|
|
19
|
-
export * from "./Popup/Popup";
|
|
20
18
|
export * from "./List/List";
|
|
21
19
|
export * from "./ListItem/ListItem";
|
|
22
20
|
export * from "./Table/Table";
|
|
@@ -35,7 +33,10 @@ export * from "./RadioButton/RadioButton";
|
|
|
35
33
|
export * from "./CodeBox/CodeBox";
|
|
36
34
|
// Utilities
|
|
37
35
|
export * from "./Display/Display";
|
|
36
|
+
export * from "./DisplayOnVisible/DisplayOnVisible";
|
|
38
37
|
export * from "./WithInteractions/WithInteractions";
|
|
39
|
-
export * from "./WithDropdawn/WithDropdawn";
|
|
40
38
|
export * from "./WithOverlay/WithOverlay";
|
|
41
|
-
|
|
39
|
+
// Overlays
|
|
40
|
+
export * from "./Dropdown/Dropdown";
|
|
41
|
+
export * from "./Popup/Popup";
|
|
42
|
+
export * from "./LoadingControl/LoadingControl";
|
package/package.json
CHANGED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { BoxProps } from "../boxing";
|
|
3
|
-
export interface RenderOnVisibleProps extends BoxProps {
|
|
4
|
-
}
|
|
5
|
-
export declare const RenderOnVisible: import("react").ForwardRefExoticComponent<RenderOnVisibleProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
export interface WithDropdawnProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
3
|
-
align?: "start" | "space" | "center" | "end";
|
|
4
|
-
blur?: boolean;
|
|
5
|
-
trigger?: "onClick" | "onRightClick";
|
|
6
|
-
dropdawnChildren?: React.ReactElement;
|
|
7
|
-
children?: React.ReactElement<{
|
|
8
|
-
onClick?: (e: React.MouseEvent<HTMLElement>) => void;
|
|
9
|
-
}>;
|
|
10
|
-
}
|
|
11
|
-
export declare function WithDropdawn({ align, blur, trigger, dropdawnChildren, className, style, children, ...restProps }: WithDropdawnProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,77 +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 { useRef, useState, useEffect, cloneElement } from "react";
|
|
15
|
-
import classNames from "classnames";
|
|
16
|
-
import { WithInteractions } from "../";
|
|
17
|
-
import boxingStyles from "../boxing.module.css";
|
|
18
|
-
import styles from "./WithDropdawn.module.css";
|
|
19
|
-
export function WithDropdawn(_a) {
|
|
20
|
-
var { align, blur, trigger = "onClick", dropdawnChildren, className, style, children } = _a, restProps = __rest(_a, ["align", "blur", "trigger", "dropdawnChildren", "className", "style", "children"]);
|
|
21
|
-
const toggleElementRef = useRef(null);
|
|
22
|
-
const dropdawnRef = useRef(null);
|
|
23
|
-
const [showDropdawn, setShowDropdawn] = useState(false);
|
|
24
|
-
const [dropdawnOnTop, setDropdawnOnTop] = useState(false);
|
|
25
|
-
const [top, setTop] = useState(0);
|
|
26
|
-
const [dropdawnX, setDropdawnX] = useState(0);
|
|
27
|
-
const [arrowTop, setArrowTop] = useState(0);
|
|
28
|
-
const [arrowX, setArrowX] = useState(0);
|
|
29
|
-
const toggleShowDropdawn = () => setShowDropdawn((prev) => !prev);
|
|
30
|
-
useEffect(() => {
|
|
31
|
-
if (toggleElementRef.current && dropdawnRef.current) {
|
|
32
|
-
const buttonRect = toggleElementRef.current.getBoundingClientRect();
|
|
33
|
-
const dropdawnRect = dropdawnRef.current.getBoundingClientRect();
|
|
34
|
-
const padding = 10;
|
|
35
|
-
let dTop = buttonRect.bottom + padding;
|
|
36
|
-
let dX = buttonRect.x + buttonRect.width / 2;
|
|
37
|
-
let aTop = dTop;
|
|
38
|
-
const aX = dX;
|
|
39
|
-
// Prevent overflow bottom
|
|
40
|
-
if (dTop + dropdawnRect.height > window.innerHeight) {
|
|
41
|
-
dTop = buttonRect.top - dropdawnRect.height - padding;
|
|
42
|
-
aTop = buttonRect.top - padding;
|
|
43
|
-
setDropdawnOnTop(true);
|
|
44
|
-
}
|
|
45
|
-
else
|
|
46
|
-
setDropdawnOnTop(false);
|
|
47
|
-
// Prevent overflow right
|
|
48
|
-
if (dX + dropdawnRect.width / 2 > window.innerWidth - padding) {
|
|
49
|
-
dX = window.innerWidth - dropdawnRect.width / 2 - padding;
|
|
50
|
-
}
|
|
51
|
-
// Prevent overflow left
|
|
52
|
-
if (dX - dropdawnRect.width / 2 < padding) {
|
|
53
|
-
dX = dropdawnRect.width / 2 + padding;
|
|
54
|
-
}
|
|
55
|
-
setTop(dTop);
|
|
56
|
-
setDropdawnX(dX);
|
|
57
|
-
// Arrow Placing
|
|
58
|
-
setArrowTop(aTop);
|
|
59
|
-
setArrowX(aX);
|
|
60
|
-
}
|
|
61
|
-
}, [showDropdawn, dropdawnChildren]);
|
|
62
|
-
const joinedClassNames = classNames(boxingStyles.flexColumnBox, { [boxingStyles[align]]: align }, styles.dropdawnCard, { [styles.blur]: blur }, className);
|
|
63
|
-
return (_jsxs(_Fragment, { children: [_jsx(WithInteractions, { ref: toggleElementRef, onRightClick: () => trigger === "onRightClick" && setShowDropdawn(true), children: children &&
|
|
64
|
-
cloneElement(children, {
|
|
65
|
-
onClick: (e) => {
|
|
66
|
-
var _a, _b;
|
|
67
|
-
(_b = (_a = children.props).onClick) === null || _b === void 0 ? void 0 : _b.call(_a, e);
|
|
68
|
-
trigger === "onClick" && toggleShowDropdawn();
|
|
69
|
-
},
|
|
70
|
-
}) }), _jsx("span", { className: classNames(styles.arrow, {
|
|
71
|
-
[styles.dropdawnOnTop]: dropdawnOnTop,
|
|
72
|
-
}, { [styles.blur]: blur }), style: {
|
|
73
|
-
top: arrowTop,
|
|
74
|
-
left: arrowX,
|
|
75
|
-
visibility: showDropdawn ? "visible" : "hidden",
|
|
76
|
-
} }), _jsx(WithInteractions, { onOutsideClick: () => setShowDropdawn(false), children: _jsx("div", Object.assign({ ref: dropdawnRef }, restProps, { className: joinedClassNames, style: Object.assign({ top: top, left: dropdawnX, visibility: showDropdawn ? "visible" : "hidden" }, style), children: dropdawnChildren })) })] }));
|
|
77
|
-
}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
.dropdawnCard {
|
|
2
|
-
position: fixed;
|
|
3
|
-
min-width: 6rem;
|
|
4
|
-
min-height: 10rem;
|
|
5
|
-
max-width: calc(100% - 4rem);
|
|
6
|
-
max-height: min(50vh, 50rem);
|
|
7
|
-
padding: 2rem;
|
|
8
|
-
border-radius: 2rem;
|
|
9
|
-
box-shadow: 0px 3px 3px -2px rgb(0 0 0 / 20%),
|
|
10
|
-
0px 3px 4px 0px rgb(0 0 0 / 14%), 0px 1px 8px 0px rgb(0 0 0 / 12%);
|
|
11
|
-
background: rgb(var(--surfaceContainerHighestColor, 230 224 233));
|
|
12
|
-
color: rgb(var(--onSurfaceColor, 28 27 31));
|
|
13
|
-
fill: rgb(var(--onSurfaceColor, 28 27 31));
|
|
14
|
-
z-index: 2;
|
|
15
|
-
transform: translate(-50%, 0);
|
|
16
|
-
}
|
|
17
|
-
.dropdawnCard.blur {
|
|
18
|
-
background-color: color-mix(
|
|
19
|
-
in srgb,
|
|
20
|
-
rgb(var(--surfaceContainerHighestColor, 230 224 233)) 85%,
|
|
21
|
-
transparent
|
|
22
|
-
);
|
|
23
|
-
backdrop-filter: blur(0.5rem);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
/* Arrow */
|
|
27
|
-
.arrow {
|
|
28
|
-
position: fixed;
|
|
29
|
-
width: 0;
|
|
30
|
-
height: 0;
|
|
31
|
-
border-left: 0.6rem solid transparent;
|
|
32
|
-
border-right: 0.6rem solid transparent;
|
|
33
|
-
border-bottom: 0.8rem solid
|
|
34
|
-
rgb(var(--surfaceContainerHighestColor, 230 224 233));
|
|
35
|
-
transform: translate(-50%, -100%);
|
|
36
|
-
}
|
|
37
|
-
.arrow.blur {
|
|
38
|
-
border-bottom: 0.8rem solid
|
|
39
|
-
color-mix(
|
|
40
|
-
in srgb,
|
|
41
|
-
rgb(var(--surfaceContainerHighestColor, 230 224 233)) 85%,
|
|
42
|
-
transparent
|
|
43
|
-
);
|
|
44
|
-
}
|
|
45
|
-
.arrow.dropdawnOnTop {
|
|
46
|
-
transform: translate(-50%, 0) rotate(180deg);
|
|
47
|
-
}
|
package/dist/boxing.d.ts
DELETED
package/dist/boxing.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|