@luscii-healthtech/web-ui 27.9.0 → 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";
@@ -4771,7 +4771,7 @@ function Section$1(_a) {
4771
4771
  var { title, buttons, footer, children, headerAside, className, isLoading = false, loadingIndicatorProps } = _a, restProps = __rest(_a, ["title", "buttons", "footer", "children", "headerAside", "className", "isLoading", "loadingIndicatorProps"]);
4772
4772
  return React__namespace.default.createElement(
4773
4773
  "section",
4774
- Object.assign({ title }, restProps, { className: classNames__default.default("cweb-section", "ui-flex ui-flex-col ui-items-start ui-justify-start", "ui-rounded-lg", "ui-mx-0 ui-my-4", "ui-bg-white", "ui-w-full", className) }),
4774
+ Object.assign({ "aria-label": title, title }, restProps, { className: classNames__default.default("cweb-section", "ui-flex ui-flex-col ui-items-start ui-justify-start", "ui-rounded-lg", "ui-mx-0 ui-my-4", "ui-bg-white", "ui-w-full", className) }),
4775
4775
  (title || buttons) && React__namespace.default.createElement(
4776
4776
  "header",
4777
4777
  { className: "cweb-section-header ui-flex ui-w-full ui-items-center ui-justify-between ui-gap-3 ui-p-4", "data-test-id": "section-header" },
@@ -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;