@luscii-healthtech/web-ui 48.5.3 → 48.6.1
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/index.development.js +85 -0
- package/dist/index.development.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/src/components/ActionController/ActionController.d.ts +38 -0
- package/dist/src/generated/components/ActionController/ActionController.d.ts +38 -0
- package/dist/src/generated/index.d.ts +1 -0
- package/dist/src/generated/types/general.types.d.ts +6 -0
- package/dist/src/index.d.ts +1 -0
- package/dist/src/types/general.types.d.ts +6 -0
- package/dist/stories/ActionController.stories.d.ts +74 -0
- package/dist/web-ui-tailwind.css +164 -0
- package/dist/web-ui.esm.js +1 -1
- package/dist/web-ui.esm.js.map +1 -1
- package/package.json +1 -1
|
@@ -6426,6 +6426,90 @@ const Indicator = () => {
|
|
|
6426
6426
|
};
|
|
6427
6427
|
HoverIndicatorControl.Indicator = Indicator;
|
|
6428
6428
|
|
|
6429
|
+
const ActionControllerContext = React.createContext(null);
|
|
6430
|
+
const ActionController = (_a) => {
|
|
6431
|
+
var { action, className, as = "div", disabled = false, activeBackgroundColor, actionVisibility = "on-interaction", children } = _a, boxProps = __rest(_a, ["action", "className", "as", "disabled", "activeBackgroundColor", "actionVisibility", "children"]);
|
|
6432
|
+
const actionRef = React.useRef(null);
|
|
6433
|
+
const handleClick = (event) => {
|
|
6434
|
+
if (disabled || !actionRef.current) {
|
|
6435
|
+
return;
|
|
6436
|
+
}
|
|
6437
|
+
if (actionRef.current.contains(event.target)) {
|
|
6438
|
+
return;
|
|
6439
|
+
}
|
|
6440
|
+
const clickableElement = actionRef.current.querySelector("button, a");
|
|
6441
|
+
if (clickableElement) {
|
|
6442
|
+
clickableElement.click();
|
|
6443
|
+
}
|
|
6444
|
+
};
|
|
6445
|
+
return jsxRuntime.jsx(ActionControllerContext.Provider, { value: { action, disabled, actionRef, actionVisibility }, children: jsxRuntime.jsx(Box, Object.assign({ as, onClick: handleClick, className: classNames__default.default(
|
|
6446
|
+
className,
|
|
6447
|
+
"ui:group",
|
|
6448
|
+
// Cursor styles
|
|
6449
|
+
{
|
|
6450
|
+
"ui:cursor-default": disabled,
|
|
6451
|
+
"ui:cursor-pointer": !disabled
|
|
6452
|
+
},
|
|
6453
|
+
// Focus ring
|
|
6454
|
+
{
|
|
6455
|
+
"ui:focus-within:outline-2 ui:focus-within:outline-primary": !disabled
|
|
6456
|
+
},
|
|
6457
|
+
// Semantic background colors - neutral
|
|
6458
|
+
{
|
|
6459
|
+
"ui:hover:bg-background-neutral-primary-hovered ui:focus-within:bg-background-neutral-primary-hovered": activeBackgroundColor === "neutral-primary" && !disabled,
|
|
6460
|
+
"ui:hover:bg-background-neutral-secondary-hovered ui:focus-within:bg-background-neutral-secondary-hovered": activeBackgroundColor === "neutral-secondary" && !disabled
|
|
6461
|
+
},
|
|
6462
|
+
// Semantic background colors - brand
|
|
6463
|
+
{
|
|
6464
|
+
"ui:hover:bg-background-brand-primary-hovered ui:focus-within:bg-background-brand-primary-hovered": activeBackgroundColor === "brand-primary" && !disabled,
|
|
6465
|
+
"ui:hover:bg-background-brand-secondary-hovered ui:focus-within:bg-background-brand-secondary-hovered": activeBackgroundColor === "brand-secondary" && !disabled
|
|
6466
|
+
},
|
|
6467
|
+
// Semantic background colors - info
|
|
6468
|
+
{
|
|
6469
|
+
"ui:hover:bg-background-info-primary-hovered ui:focus-within:bg-background-info-primary-hovered": activeBackgroundColor === "info-primary" && !disabled,
|
|
6470
|
+
"ui:hover:bg-background-info-secondary-hovered ui:focus-within:bg-background-info-secondary-hovered": activeBackgroundColor === "info-secondary" && !disabled
|
|
6471
|
+
},
|
|
6472
|
+
// Semantic background colors - success
|
|
6473
|
+
{
|
|
6474
|
+
"ui:hover:bg-background-success-primary-hovered ui:focus-within:bg-background-success-primary-hovered": activeBackgroundColor === "success-primary" && !disabled,
|
|
6475
|
+
"ui:hover:bg-background-success-secondary-hovered ui:focus-within:bg-background-success-secondary-hovered": activeBackgroundColor === "success-secondary" && !disabled
|
|
6476
|
+
},
|
|
6477
|
+
// Semantic background colors - warning
|
|
6478
|
+
{
|
|
6479
|
+
"ui:hover:bg-background-warning-primary-hovered ui:focus-within:bg-background-warning-primary-hovered": activeBackgroundColor === "warning-primary" && !disabled,
|
|
6480
|
+
"ui:hover:bg-background-warning-secondary-hovered ui:focus-within:bg-background-warning-secondary-hovered": activeBackgroundColor === "warning-secondary" && !disabled
|
|
6481
|
+
},
|
|
6482
|
+
// Semantic background colors - error
|
|
6483
|
+
{
|
|
6484
|
+
"ui:hover:bg-background-error-primary-hovered ui:focus-within:bg-background-error-primary-hovered": activeBackgroundColor === "error-primary" && !disabled,
|
|
6485
|
+
"ui:hover:bg-background-error-secondary-hovered ui:focus-within:bg-background-error-secondary-hovered": activeBackgroundColor === "error-secondary" && !disabled
|
|
6486
|
+
},
|
|
6487
|
+
// Transitions
|
|
6488
|
+
{
|
|
6489
|
+
"ui:transition-colors ui:motion-reduce:transition-none": activeBackgroundColor !== void 0
|
|
6490
|
+
}
|
|
6491
|
+
) }, boxProps, { children })) });
|
|
6492
|
+
};
|
|
6493
|
+
const Action = () => {
|
|
6494
|
+
const context = React.useContext(ActionControllerContext);
|
|
6495
|
+
const isAlwaysVisible = (context === null || context === void 0 ? void 0 : context.actionVisibility) === "always";
|
|
6496
|
+
const isDisabled = (context === null || context === void 0 ? void 0 : context.disabled) === true;
|
|
6497
|
+
return jsxRuntime.jsx("div", { ref: context === null || context === void 0 ? void 0 : context.actionRef, className: classNames__default.default(
|
|
6498
|
+
// Base transitions
|
|
6499
|
+
"ui:transition-opacity ui:duration-200 ui:ease-in-out ui:motion-reduce:transition-none",
|
|
6500
|
+
// Visibility states
|
|
6501
|
+
{
|
|
6502
|
+
"ui:opacity-0": !isAlwaysVisible,
|
|
6503
|
+
"ui:opacity-100": isAlwaysVisible
|
|
6504
|
+
},
|
|
6505
|
+
// Interactive visibility (hover and focus)
|
|
6506
|
+
{
|
|
6507
|
+
"ui:group-hover:opacity-100 ui:group-focus-within:opacity-100": !isAlwaysVisible && !isDisabled
|
|
6508
|
+
}
|
|
6509
|
+
), children: context === null || context === void 0 ? void 0 : context.action });
|
|
6510
|
+
};
|
|
6511
|
+
ActionController.Action = Action;
|
|
6512
|
+
|
|
6429
6513
|
const Collapse = (props) => {
|
|
6430
6514
|
const { children, className, contentClassName: classNameFromProps, isCollapsed, onClick, moreIndicator = jsxRuntime.jsx(Text, { className: "ui:text-center", children: "..." }), showMoreIndicator = true } = props;
|
|
6431
6515
|
const contentClassName = classNames__default.default("w-full", classNameFromProps, {
|
|
@@ -6993,6 +7077,7 @@ Object.defineProperty(exports, "TooltipProvider", {
|
|
|
6993
7077
|
exports.AbsentIcon = AbsentIcon;
|
|
6994
7078
|
exports.AccordionList = AccordionList;
|
|
6995
7079
|
exports.AccordionTemporary = Accordion;
|
|
7080
|
+
exports.ActionController = ActionController;
|
|
6996
7081
|
exports.AddIcon = PlusIcon;
|
|
6997
7082
|
exports.AddNoteIcon = AddNoteIcon;
|
|
6998
7083
|
exports.AlarmClockIcon = AlarmClockIcon;
|