@yakad/ui 1.3.109 → 1.3.111
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/Card/Card.d.ts +1 -1
- package/dist/Container/Container.d.ts +1 -1
- package/dist/Footer/Footer.d.ts +1 -1
- package/dist/Form/Form.d.ts +1 -1
- package/dist/GridItem/GridItem.d.ts +1 -1
- package/dist/ListItem/ListItem.d.ts +1 -1
- package/dist/Main/Main.d.ts +1 -1
- package/dist/Navigation/Navigation.d.ts +1 -1
- package/dist/Row/Row.d.ts +1 -1
- package/dist/Screen/Screen.d.ts +1 -1
- package/dist/Stack/Stack.d.ts +1 -1
- package/dist/Theme/Theme.d.ts +1 -1
- package/dist/WithDropdawn/WithDropdawn.d.ts +1 -1
- package/dist/WithDropdawn/WithDropdawn.js +27 -13
- package/dist/WithDropdawn/WithDropdawn.module.css +12 -15
- package/dist/boxing.module.css +7 -0
- package/package.json +1 -1
package/dist/AppBar/AppBar.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
export interface AppBarProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
3
|
-
align?: "start" | "center" | "end";
|
|
3
|
+
align?: "start" | "space" | "center" | "end";
|
|
4
4
|
overflow?: "shrink" | "wrap" | "scroll";
|
|
5
5
|
position?: "initial" | "sticky" | "scroll";
|
|
6
6
|
size?: "xs" | "sm" | "md" | "lg" | "xl";
|
package/dist/Card/Card.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
export interface ContainerProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
3
|
-
align?: "start" | "center" | "end";
|
|
3
|
+
align?: "start" | "space" | "center" | "end";
|
|
4
4
|
size?: "xs" | "sm" | "md" | "lg" | "xl";
|
|
5
5
|
children?: React.ReactNode;
|
|
6
6
|
}
|
package/dist/Footer/Footer.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
export interface FooterProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
3
|
-
align?: "start" | "center" | "end";
|
|
3
|
+
align?: "start" | "space" | "center" | "end";
|
|
4
4
|
overflow?: "shrink" | "wrap" | "scroll";
|
|
5
5
|
position?: "initial" | "sticky" | "scroll";
|
|
6
6
|
size?: "xs" | "sm" | "md" | "lg" | "xl";
|
package/dist/Form/Form.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
export interface FormProps extends React.HTMLAttributes<HTMLFormElement> {
|
|
3
|
-
align?: "start" | "center" | "end";
|
|
3
|
+
align?: "start" | "space" | "center" | "end";
|
|
4
4
|
children?: React.ReactNode;
|
|
5
5
|
}
|
|
6
6
|
export declare const Form: import("react").ForwardRefExoticComponent<FormProps & import("react").RefAttributes<HTMLFormElement>>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
type GridColumn = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
|
|
3
3
|
export interface GridItemProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
4
|
-
align?: "start" | "center" | "end";
|
|
4
|
+
align?: "start" | "space" | "center" | "end";
|
|
5
5
|
xs?: GridColumn;
|
|
6
6
|
sm?: GridColumn;
|
|
7
7
|
md?: GridColumn;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
export interface ListItemProps extends React.HTMLAttributes<HTMLLIElement> {
|
|
3
|
-
align?: "start" | "center" | "end";
|
|
3
|
+
align?: "start" | "space" | "center" | "end";
|
|
4
4
|
}
|
|
5
5
|
export declare const ListItem: import("react").ForwardRefExoticComponent<ListItemProps & import("react").RefAttributes<HTMLLIElement>>;
|
package/dist/Main/Main.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
export interface NavigationProps extends React.HTMLAttributes<HTMLElement> {
|
|
3
|
-
align?: "start" | "center" | "end";
|
|
3
|
+
align?: "start" | "space" | "center" | "end";
|
|
4
4
|
anchor?: "left" | "right" | "top" | "bottom" | "auto";
|
|
5
5
|
open: boolean;
|
|
6
6
|
children?: React.ReactNode;
|
package/dist/Row/Row.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
export interface RowProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
3
|
-
align?: "start" | "center" | "end";
|
|
3
|
+
align?: "start" | "space" | "center" | "end";
|
|
4
4
|
overflow?: "shrink" | "wrap" | "scroll";
|
|
5
5
|
size?: "xs" | "sm" | "md" | "lg" | "xl";
|
|
6
6
|
children?: React.ReactNode;
|
package/dist/Screen/Screen.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
export interface ScreenProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
3
|
-
align?: "start" | "center" | "end";
|
|
3
|
+
align?: "start" | "space" | "center" | "end";
|
|
4
4
|
children?: React.ReactNode;
|
|
5
5
|
}
|
|
6
6
|
export declare const Screen: import("react").ForwardRefExoticComponent<ScreenProps & import("react").RefAttributes<HTMLDivElement>>;
|
package/dist/Stack/Stack.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
export interface StackProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
3
|
-
align?: "start" | "center" | "end";
|
|
3
|
+
align?: "start" | "space" | "center" | "end";
|
|
4
4
|
children?: React.ReactNode;
|
|
5
5
|
}
|
|
6
6
|
export declare const Stack: import("react").ForwardRefExoticComponent<StackProps & import("react").RefAttributes<HTMLDivElement>>;
|
package/dist/Theme/Theme.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import "./globals.css";
|
|
|
3
3
|
export type DarkStyle = "light" | "dark" | "system";
|
|
4
4
|
export type ThemeColor = "green" | "red" | "yellow" | "blue" | "purple";
|
|
5
5
|
export interface ThemeProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
6
|
-
align?: "start" | "center" | "end";
|
|
6
|
+
align?: "start" | "space" | "center" | "end";
|
|
7
7
|
darkstyle?: DarkStyle;
|
|
8
8
|
color?: ThemeColor;
|
|
9
9
|
zoom?: number;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
export interface WithDropdawnProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
3
|
-
align?: "start" | "center" | "end";
|
|
3
|
+
align?: "start" | "space" | "center" | "end";
|
|
4
4
|
blur?: boolean;
|
|
5
5
|
trigger?: "onClick" | "onRightClick";
|
|
6
6
|
dropdawnChildren?: React.ReactElement;
|
|
@@ -23,35 +23,43 @@ export const WithDropdawn = (_a) => {
|
|
|
23
23
|
const [showDropdawn, setShowDropdawn] = useState(false);
|
|
24
24
|
const [dropdawnOnTop, setDropdawnOnTop] = useState(false);
|
|
25
25
|
const [top, setTop] = useState(0);
|
|
26
|
-
const [
|
|
26
|
+
const [dropdawnX, setDropdawnX] = useState(0);
|
|
27
|
+
const [arrowTop, setArrowTop] = useState(0);
|
|
28
|
+
const [arrowX, setArrowX] = useState(0);
|
|
27
29
|
const toggleShowDropdawn = () => setShowDropdawn((prev) => !prev);
|
|
28
30
|
useEffect(() => {
|
|
29
31
|
if (toggleElementRef.current && dropdawnRef.current) {
|
|
30
32
|
const buttonRect = toggleElementRef.current.getBoundingClientRect();
|
|
31
33
|
const dropdawnRect = dropdawnRef.current.getBoundingClientRect();
|
|
32
34
|
const padding = 10;
|
|
33
|
-
let
|
|
34
|
-
let
|
|
35
|
+
let dTop = buttonRect.bottom + padding;
|
|
36
|
+
let dX = buttonRect.x + buttonRect.width / 2;
|
|
37
|
+
let aTop = top;
|
|
38
|
+
let aX = dX;
|
|
35
39
|
// Prevent overflow bottom
|
|
36
|
-
if (
|
|
37
|
-
|
|
40
|
+
if (dTop + dropdawnRect.height > window.innerHeight) {
|
|
41
|
+
dTop = buttonRect.top - dropdawnRect.height - padding;
|
|
42
|
+
aTop = buttonRect.top - padding;
|
|
38
43
|
setDropdawnOnTop(true);
|
|
39
44
|
}
|
|
40
45
|
else
|
|
41
46
|
setDropdawnOnTop(false);
|
|
42
47
|
// Prevent overflow right
|
|
43
|
-
if (
|
|
44
|
-
|
|
48
|
+
if (dX + dropdawnRect.width / 2 > window.innerWidth - padding) {
|
|
49
|
+
dX = window.innerWidth - dropdawnRect.width / 2 - padding;
|
|
45
50
|
}
|
|
46
51
|
// Prevent overflow left
|
|
47
|
-
if (
|
|
48
|
-
|
|
52
|
+
if (dX - dropdawnRect.width / 2 < padding) {
|
|
53
|
+
dX = dropdawnRect.width / 2 + padding;
|
|
49
54
|
}
|
|
50
|
-
setTop(
|
|
51
|
-
|
|
55
|
+
setTop(dTop);
|
|
56
|
+
setDropdawnX(dX);
|
|
57
|
+
// Arrow Placing
|
|
58
|
+
setArrowTop(aTop);
|
|
59
|
+
setArrowX(aX);
|
|
52
60
|
}
|
|
53
61
|
}, [showDropdawn, dropdawnChildren]);
|
|
54
|
-
const joinedClassNames = classNames(boxingStyles.flexColumnBox, { [boxingStyles[align]]: align }, styles.dropdawnCard, { [styles.
|
|
62
|
+
const joinedClassNames = classNames(boxingStyles.flexColumnBox, { [boxingStyles[align]]: align }, styles.dropdawnCard, { [styles.blur]: blur }, className);
|
|
55
63
|
return (_jsxs(_Fragment, { children: [_jsx(WithInteractions, { ref: toggleElementRef, onRightClick: () => trigger === "onRightClick" && setShowDropdawn(true), children: children &&
|
|
56
64
|
cloneElement(children, {
|
|
57
65
|
onClick: (e) => {
|
|
@@ -59,6 +67,12 @@ export const WithDropdawn = (_a) => {
|
|
|
59
67
|
(_b = (_a = children.props).onClick) === null || _b === void 0 ? void 0 : _b.call(_a, e);
|
|
60
68
|
trigger === "onClick" && toggleShowDropdawn();
|
|
61
69
|
},
|
|
62
|
-
}) }), _jsx(
|
|
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 })) })] }));
|
|
63
77
|
};
|
|
64
78
|
WithDropdawn.displayName = "WithDropdawn";
|
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
color: rgb(var(--onSurfaceColor, 28 27 31));
|
|
11
11
|
fill: rgb(var(--onSurfaceColor, 28 27 31));
|
|
12
12
|
z-index: 2;
|
|
13
|
+
transform: translate(-50%, 0);
|
|
13
14
|
}
|
|
14
|
-
|
|
15
15
|
.dropdawnCard.blur {
|
|
16
16
|
background-color: color-mix(
|
|
17
17
|
in srgb,
|
|
@@ -21,28 +21,25 @@
|
|
|
21
21
|
backdrop-filter: blur(0.5rem);
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
position:
|
|
27
|
-
top: -6px;
|
|
28
|
-
left: calc(50% - 6px);
|
|
24
|
+
/* Arrow */
|
|
25
|
+
.arrow {
|
|
26
|
+
position: fixed;
|
|
29
27
|
width: 0;
|
|
30
28
|
height: 0;
|
|
31
|
-
border-left:
|
|
32
|
-
border-right:
|
|
33
|
-
border-bottom:
|
|
29
|
+
border-left: 0.6rem solid transparent;
|
|
30
|
+
border-right: 0.6rem solid transparent;
|
|
31
|
+
border-bottom: 0.8rem solid
|
|
34
32
|
rgb(var(--surfaceContainerHighestColor, 230 224 233));
|
|
33
|
+
transform: translate(-50%, -100%);
|
|
35
34
|
}
|
|
36
|
-
.
|
|
37
|
-
border-bottom:
|
|
35
|
+
.arrow.blur {
|
|
36
|
+
border-bottom: 0.8rem solid
|
|
38
37
|
color-mix(
|
|
39
38
|
in srgb,
|
|
40
39
|
rgb(var(--surfaceContainerHighestColor, 230 224 233)) 85%,
|
|
41
40
|
transparent
|
|
42
41
|
);
|
|
43
42
|
}
|
|
44
|
-
.
|
|
45
|
-
|
|
46
|
-
bottom: -6px;
|
|
47
|
-
transform: scale(1, -1);
|
|
43
|
+
.arrow.dropdawnOnTop {
|
|
44
|
+
transform: translate(-50%, 0) rotate(180deg);
|
|
48
45
|
}
|
package/dist/boxing.module.css
CHANGED
|
@@ -10,6 +10,10 @@
|
|
|
10
10
|
align-items: flex-start;
|
|
11
11
|
}
|
|
12
12
|
.flexColumnBox.center {
|
|
13
|
+
justify-content: center;
|
|
14
|
+
align-items: center;
|
|
15
|
+
}
|
|
16
|
+
.flexColumnBox.space {
|
|
13
17
|
justify-content: space-evenly;
|
|
14
18
|
align-items: center;
|
|
15
19
|
}
|
|
@@ -37,6 +41,9 @@
|
|
|
37
41
|
.flexRowBox.center {
|
|
38
42
|
justify-content: center;
|
|
39
43
|
}
|
|
44
|
+
.flexRowBox.space {
|
|
45
|
+
justify-content: space-evenly;
|
|
46
|
+
}
|
|
40
47
|
.flexRowBox.end {
|
|
41
48
|
justify-content: flex-end;
|
|
42
49
|
}
|