@yakad/ui 1.3.148 → 1.3.150

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.
@@ -1,9 +1,9 @@
1
1
  /// <reference types="react" />
2
+ import { StackProps } from "..";
2
3
  import "./card.css";
3
- export interface CardProps extends React.HTMLAttributes<HTMLDivElement> {
4
- align?: "start" | "space" | "center" | "end";
5
- fullWidthOnParentDemand?: boolean;
4
+ export interface CardProps extends StackProps {
6
5
  blur?: boolean;
7
6
  level?: "transparent" | "low" | "mid" | "high";
7
+ hoverEffect?: boolean;
8
8
  }
9
9
  export declare const Card: import("react").ForwardRefExoticComponent<CardProps & import("react").RefAttributes<HTMLDivElement>>;
package/dist/Card/Card.js CHANGED
@@ -12,16 +12,16 @@ 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
+ import { Stack } from "..";
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 { align, fullWidthOnParentDemand = true, blur, level, className, children } = _a, restProps = __rest(_a, ["align", "fullWidthOnParentDemand", "blur", "level", "className", "children"]);
20
- const joinedClassNames = classNames(boxingStyles.flexColumnBox, { [boxingStyles[align]]: align }, { demandChildsToBeFullWidth: true }, { fullWidthOnParentDemand: fullWidthOnParentDemand }, styles.card, { [styles.blur]: blur }, { [styles.elevated]: level !== "transparent" }, {
19
+ var { blur, level, hoverEffect, className, children } = _a, restProps = __rest(_a, ["blur", "level", "hoverEffect", "className", "children"]);
20
+ const joinedClassNames = classNames(styles.card, { [styles.blur]: blur }, { [styles.elevated]: level !== "transparent" }, {
21
21
  yakadCardAutoLevel: !level || level === "transparent",
22
22
  yakadCardLowLevel: level === "low",
23
23
  yakadCardMidLevel: level === "mid",
24
24
  yakadCardHighLevel: level === "high",
25
- }, className);
26
- return (_jsx("div", Object.assign({ ref: ref }, restProps, { className: joinedClassNames, children: children })));
25
+ }, { [styles.hoverEffect]: hoverEffect }, className);
26
+ return (_jsx(Stack, Object.assign({ ref: ref }, restProps, { className: joinedClassNames, children: children })));
27
27
  });
@@ -1,6 +1,7 @@
1
1
  .card {
2
2
  padding: 2rem;
3
3
  border-radius: 2rem;
4
+ transition: box-shadow 0.3s ease, background-color 0.3s ease;
4
5
  }
5
6
 
6
7
  .card.elevated {
@@ -11,6 +12,12 @@
11
12
  fill: rgb(var(--onSurfaceColor, 28 27 31));
12
13
  }
13
14
 
15
+ .card.hoverEffect:hover {
16
+ box-shadow: 0px 3px 3px -2px rgb(0 0 0 / 20%),
17
+ 0px 3px 4px 0px rgb(0 0 0 / 14%), 0px 1px 8px 0px rgb(0 0 0 / 12%);
18
+ background-color: rgb(var(--surfaceContainerHighestColor, 230 224 233));
19
+ }
20
+
14
21
  .card.blur {
15
22
  background-color: color-mix(
16
23
  in srgb,
@@ -1,12 +1,12 @@
1
1
  .yakadCardAutoLevel,
2
2
  .yakadCardLowLevel {
3
- --yakadCardBackgroundColor: var(--surfaceContainerColor);
3
+ --yakadCardBackgroundColor: var(--surfaceContainerLowColor);
4
4
  }
5
5
 
6
6
  .yakadCardAutoLevel .yakadCardAutoLevel,
7
7
  .yakadCardLowLevel .yakadCardAutoLevel,
8
8
  .yakadCardMidLevel {
9
- --yakadCardBackgroundColor: var(--surfaceContainerHighColor);
9
+ --yakadCardBackgroundColor: var(--surfaceContainerColor);
10
10
  }
11
11
 
12
12
  .yakadCardAutoLevel .yakadCardAutoLevel .yakadCardAutoLevel,
@@ -14,5 +14,5 @@
14
14
  .yakadCardMidLevel .yakadCardAutoLevel,
15
15
  .yakadCardHighLevel,
16
16
  .yakadCardHighLevel .yakadCardAutoLevel {
17
- --yakadCardBackgroundColor: var(--surfaceContainerHighestColor);
17
+ --yakadCardBackgroundColor: var(--surfaceContainerHighColor);
18
18
  }
@@ -16,7 +16,8 @@ import classNames from "classnames";
16
16
  import { Card, WithInteractions } from "..";
17
17
  import styles from "./Dropdown.module.css";
18
18
  export const Dropdown = forwardRef(function Dropdown(_a, forwardedRef) {
19
- var { level = "high", triggerref, onClose, className, style, children } = _a, restProps = __rest(_a, ["level", "triggerref", "onClose", "className", "style", "children"]);
19
+ var { fullWidthOnParentDemand = false, // Def in Card is True
20
+ blur, level = "high", triggerref, onClose, className, style, children } = _a, restProps = __rest(_a, ["fullWidthOnParentDemand", "blur", "level", "triggerref", "onClose", "className", "style", "children"]);
20
21
  const fallbackTriggerRef = useRef(null);
21
22
  const dropdownRef = useRef(null);
22
23
  const placementTargetRef = triggerref || fallbackTriggerRef;
@@ -71,7 +72,7 @@ export const Dropdown = forwardRef(function Dropdown(_a, forwardedRef) {
71
72
  setIsPlaced(true);
72
73
  }
73
74
  }, [children, placementTargetRef]);
74
- return (_jsxs(_Fragment, { children: [!triggerref && _jsx("div", { ref: fallbackTriggerRef }), _jsx(WithInteractions, { onOutsideClick: onClose, children: _jsx(Card, Object.assign({ ref: dropdownRef, level: level }, restProps, { className: classNames(styles.dropdownCard, { [styles.isPlacedAbove]: isPlacedAbove }, className), style: Object.assign({ top: dropdownPosition.top, left: dropdownPosition.left, visibility: isPlaced ? "visible" : "hidden" }, style), children: children })) }), _jsx("span", { className: classNames(styles.arrow, {
75
+ return (_jsxs(_Fragment, { children: [!triggerref && _jsx("div", { ref: fallbackTriggerRef }), _jsx(WithInteractions, { onOutsideClick: onClose, children: _jsx(Card, Object.assign({ ref: dropdownRef, fullWidthOnParentDemand: fullWidthOnParentDemand, blur: blur, level: level }, restProps, { className: classNames(styles.dropdownCard, { [styles.isPlacedAbove]: isPlacedAbove }, className), style: Object.assign({ top: dropdownPosition.top, left: dropdownPosition.left, visibility: isPlaced ? "visible" : "hidden" }, style), children: children })) }), _jsx("span", { className: classNames(styles.arrow, {
75
76
  [styles.isPlacedAbove]: isPlacedAbove,
76
77
  }, { [styles.blur]: blur }), style: {
77
78
  top: arrowPosition.top,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yakad/ui",
3
- "version": "1.3.148",
3
+ "version": "1.3.150",
4
4
  "private": false,
5
5
  "author": "Natiq",
6
6
  "description": "UI components for NextJS/React",