@luscii-healthtech/web-ui 29.0.0 → 30.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.
@@ -33,7 +33,6 @@ type TitleAndMaybeActions = {
33
33
  export type Props<C extends React.ElementType> = React.ComponentPropsWithoutRef<C> & {
34
34
  as?: C;
35
35
  border?: boolean;
36
- borderRadius?: BoxProps<C>["borderRadius"];
37
36
  children: React.ReactNode;
38
37
  /**
39
38
  * Adds a box-shadow to the element based on the design system
@@ -43,7 +42,6 @@ export type Props<C extends React.ElementType> = React.ComponentPropsWithoutRef<
43
42
  * The elevation from the design system to apply when hovering over the card.
44
43
  */
45
44
  elevationOnHover?: BoxProps<C>["elevation"];
46
- indicatorOnHover?: boolean;
47
45
  /**
48
46
  * Whether or not to add the default padding to the card. Set this
49
47
  * to `false` if you want to render something full width inside of the
@@ -2089,7 +2089,26 @@ const createShadowClassName = (elevation, options) => {
2089
2089
  if (!elevation || !ELEVATION[elevation]) {
2090
2090
  return "";
2091
2091
  }
2092
- const { modifier } = options || {};
2092
+ const { modifier, transition } = options || {};
2093
+ let transitionClassName = "";
2094
+ if (transition) {
2095
+ transitionClassName = classNames__default.default({
2096
+ "hover:ui-transition-shadow ui-duration-300": modifier === "hover",
2097
+ "focus:ui-transition-shadow ui-duration-300": modifier === "focus",
2098
+ "active:ui-transition-shadow ui-duration-300": modifier === "active"
2099
+ });
2100
+ }
2101
+ if (!modifier) {
2102
+ return classNames__default.default({
2103
+ "ui-shadow-base": elevation === "base",
2104
+ "ui-shadow-small": elevation === "small",
2105
+ "ui-shadow-medium": elevation === "medium",
2106
+ "ui-shadow-large": elevation === "large",
2107
+ "ui-shadow-surface": elevation === "surface",
2108
+ "ui-shadow-extraLarge": elevation === "extraLarge",
2109
+ "ui-shadow-drag": elevation === "drag"
2110
+ }, transitionClassName);
2111
+ }
2093
2112
  if (modifier === "hover") {
2094
2113
  return classNames__default.default({
2095
2114
  "hover:ui-shadow-base": elevation === "base",
@@ -2099,7 +2118,7 @@ const createShadowClassName = (elevation, options) => {
2099
2118
  "hover:ui-shadow-surface": elevation === "surface",
2100
2119
  "hover:ui-shadow-extraLarge": elevation === "extraLarge",
2101
2120
  "hover:ui-shadow-drag": elevation === "drag"
2102
- });
2121
+ }, transitionClassName);
2103
2122
  }
2104
2123
  if (modifier === "focus") {
2105
2124
  return classNames__default.default({
@@ -2110,28 +2129,17 @@ const createShadowClassName = (elevation, options) => {
2110
2129
  "focus:ui-shadow-surface": elevation === "surface",
2111
2130
  "focus:ui-shadow-extraLarge": elevation === "extraLarge",
2112
2131
  "focus:ui-shadow-drag": elevation === "drag"
2113
- });
2114
- }
2115
- if (modifier === "active") {
2116
- return classNames__default.default({
2117
- "active:ui-shadow-base": elevation === "base",
2118
- "active:ui-shadow-small": elevation === "small",
2119
- "active:ui-shadow-medium": elevation === "medium",
2120
- "active:ui-shadow-large": elevation === "large",
2121
- "active:ui-shadow-surface": elevation === "surface",
2122
- "active:ui-shadow-extraLarge": elevation === "extraLarge",
2123
- "active:ui-shadow-drag": elevation === "drag"
2124
- });
2132
+ }, transitionClassName);
2125
2133
  }
2126
2134
  return classNames__default.default({
2127
- "ui-shadow-base": elevation === "base",
2128
- "ui-shadow-small": elevation === "small",
2129
- "ui-shadow-medium": elevation === "medium",
2130
- "ui-shadow-large": elevation === "large",
2131
- "ui-shadow-surface": elevation === "surface",
2132
- "ui-shadow-extraLarge": elevation === "extraLarge",
2133
- "ui-shadow-drag": elevation === "drag"
2134
- });
2135
+ "active:ui-shadow-base": elevation === "base",
2136
+ "active:ui-shadow-small": elevation === "small",
2137
+ "active:ui-shadow-medium": elevation === "medium",
2138
+ "active:ui-shadow-large": elevation === "large",
2139
+ "active:ui-shadow-surface": elevation === "surface",
2140
+ "active:ui-shadow-extraLarge": elevation === "extraLarge",
2141
+ "active:ui-shadow-drag": elevation === "drag"
2142
+ }, transitionClassName);
2135
2143
  };
2136
2144
 
2137
2145
  const SIZES = {
@@ -5054,7 +5062,7 @@ function Section$1(_a) {
5054
5062
  var { title, footer, children, headerAside, className, isLoading = false, headerTitle } = _a, restProps = __rest(_a, ["title", "footer", "children", "headerAside", "className", "isLoading", "headerTitle"]);
5055
5063
  return React__namespace.default.createElement(
5056
5064
  Stack,
5057
- Object.assign({ as: "section", "aria-label": title, title, width: "full", className: "ui-rounded-lg ui-bg-white" }, restProps),
5065
+ Object.assign({ as: "section", "aria-label": title, title, width: "full", className: classNames__default.default("ui-rounded-lg ui-bg-white", className) }, restProps),
5058
5066
  (title || headerAside || headerTitle) && React__namespace.default.createElement(SectionHeader, { title: headerTitle || title, aside: headerAside, isLoading }),
5059
5067
  React__namespace.default.createElement(Box, { width: "full", className: classNames__default.default({
5060
5068
  "ui-border-t-1 ui-border-t-slate-200": children
@@ -5903,38 +5911,26 @@ function TopBar(props) {
5903
5911
  }
5904
5912
  TopBar.Actions = Actions;
5905
5913
 
5906
- const HoverIndicator = (props) => {
5907
- const { borderRadius = "xxs", children } = props;
5908
- const boxClasses = classNames__default.default("ui-relative ui-border ui-border-l-[16px] ui-border-transparent ui-border-l-transparent hover:ui-border-l-primary", "before:ui-absolute before:ui-inset-[-1px] before:-ui-ml-[15px] before:ui-w-[16px] hover:before:ui-bg-primary", { [`before:ui-radius-l-${borderRadius}`]: borderRadius });
5909
- return React__namespace.default.createElement(
5910
- Box,
5911
- { borderRadius, className: boxClasses },
5912
- React__namespace.default.createElement(Box, { className: "-ui-ml-4" }, children)
5913
- );
5914
- };
5915
-
5916
5914
  function Card(props) {
5917
- const { actions: __, as: Element = "div", border, borderRadius = "xxs", children, className, elevation, elevationOnHover, indicatorOnHover, padding = true, title: _ } = props, rest = __rest(props, ["actions", "as", "border", "borderRadius", "children", "className", "elevation", "elevationOnHover", "indicatorOnHover", "padding", "title"]);
5918
- const cardContentClassName = classNames__default.default("ui-bg-white", {
5919
- "ui-ml-[16px]": indicatorOnHover
5920
- });
5915
+ const { actions: __, as: Element = "div", border, children, className, elevation, elevationOnHover, padding = true, title: _ } = props, rest = __rest(props, ["actions", "as", "border", "children", "className", "elevation", "elevationOnHover", "padding", "title"]);
5921
5916
  const hoverShadowClassName = createShadowClassName(elevationOnHover, {
5922
- modifier: "hover"
5917
+ modifier: "hover",
5918
+ transition: true
5923
5919
  });
5924
5920
  const CardContent = () => React__namespace.default.createElement(
5925
5921
  Box,
5926
- { className: cardContentClassName },
5922
+ { className: "ui-bg-white" },
5927
5923
  React__namespace.default.createElement(RenderTopBar, Object.assign({}, props)),
5928
5924
  padding ? React__namespace.default.createElement(Padding, null, children) : children
5929
5925
  );
5930
- const classes = classNames__default.default("ui-overflow-hidden", "ui-bg-white", className, hoverShadowClassName, {
5926
+ const classes = classNames__default.default("ui-overflow-hidden", "ui-bg-white", "ui-transition-colors ui-duration-300", className, hoverShadowClassName, {
5931
5927
  "ui-border ui-border-slate-300 hover:ui-border-slate-400": border
5932
5928
  });
5933
- return React__namespace.default.createElement(Box, Object.assign({ as: Element, elevation, borderRadius }, rest, { className: classes }), indicatorOnHover ? React__namespace.default.createElement(
5934
- HoverIndicator,
5935
- { borderRadius },
5929
+ return React__namespace.default.createElement(
5930
+ Box,
5931
+ Object.assign({ as: Element, elevation, borderRadius: "m" }, rest, { className: classes }),
5936
5932
  React__namespace.default.createElement(CardContent, null)
5937
- ) : React__namespace.default.createElement(CardContent, null));
5933
+ );
5938
5934
  }
5939
5935
  Card.Title = (props) => React__namespace.default.createElement(Title, Object.assign({ type: "sm" }, props));
5940
5936
  Card.TopBar = TopBar;