@luscii-healthtech/web-ui 27.9.1 → 27.10.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.
@@ -0,0 +1,24 @@
1
+ import { type FC, type ComponentProps, type ElementType, type ReactNode } from "react";
2
+ import { Box } from "../Box/Box";
3
+ type Props = {
4
+ /**
5
+ * The indicator to render on hover
6
+ */
7
+ indicator: ReactNode;
8
+ /**
9
+ * Disables the hover indicator
10
+ * @default false
11
+ */
12
+ disabled?: boolean;
13
+ /**
14
+ * Sets the element type, defaults to button
15
+ *
16
+ * @default 'button'
17
+ */
18
+ as?: ElementType;
19
+ children: ReactNode;
20
+ } & ComponentProps<typeof Box>;
21
+ export declare const HoverIndicatorControl: FC<Props> & {
22
+ Indicator: FC;
23
+ };
24
+ export {};
package/dist/index.d.ts CHANGED
@@ -98,3 +98,4 @@ export { TimelineCard } from "./components/TimelineCard/TimelineCard";
98
98
  export { TimelineCardLayout } from "./components/TimelineCardLayout/TimelineCardLayout";
99
99
  export { LocaleProvider } from "./context/LocaleContext";
100
100
  export { StyledUnorderedList } from "./components/StyledUnorderedList/StyledUnorderedList";
101
+ export { HoverIndicatorControl } from "./components/HoverIndicatorControl/HoverIndicatorControl";
@@ -6144,6 +6144,21 @@ const Item = (props) => {
6144
6144
  };
6145
6145
  StyledUnorderedList.Item = Item;
6146
6146
 
6147
+ const HoverIndicatorControlContext = React.createContext(null);
6148
+ const HoverIndicatorControl = (_a) => {
6149
+ var { indicator, className, as = "button", disabled = false } = _a, boxProps = __rest(_a, ["indicator", "className", "as", "disabled"]);
6150
+ return React__namespace.default.createElement(
6151
+ HoverIndicatorControlContext.Provider,
6152
+ { value: { indicator, disabled } },
6153
+ React__namespace.default.createElement(Box, Object.assign({ as, className: classNames__default.default(className, "ui-group") }, boxProps))
6154
+ );
6155
+ };
6156
+ const Indicator = () => {
6157
+ const context = React.useContext(HoverIndicatorControlContext);
6158
+ return React__namespace.default.createElement("div", { className: classNames__default.default({ "group-hover:ui-visible": (context === null || context === void 0 ? void 0 : context.disabled) === false }, "ui-invisible") }, context === null || context === void 0 ? void 0 : context.indicator);
6159
+ };
6160
+ HoverIndicatorControl.Indicator = Indicator;
6161
+
6147
6162
  Object.defineProperty(exports, 'Toaster', {
6148
6163
  enumerable: true,
6149
6164
  get: function () { return sonner.Toaster; }
@@ -6237,6 +6252,7 @@ exports.HamburgerIcon = HamburgerIcon;
6237
6252
  exports.HandshakeIcon = HandshakeIcon;
6238
6253
  exports.HeartIcon = HeartIcon;
6239
6254
  exports.HomeIcon = HomeIcon;
6255
+ exports.HoverIndicatorControl = HoverIndicatorControl;
6240
6256
  exports.Icon = Icon;
6241
6257
  exports.Image = Image$1;
6242
6258
  exports.ImageIcon = ImageIcon;