@luscii-healthtech/web-ui 58.2.5 → 58.4.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.
- package/dist/index.development.js +73 -11
- 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/ActionCard/ActionCard.d.ts +34 -0
- package/dist/src/components/InstrumentCard/InstrumentCard.d.ts +99 -0
- package/dist/src/generated/components/ActionCard/ActionCard.d.ts +34 -0
- package/dist/src/generated/components/InstrumentCard/InstrumentCard.d.ts +99 -0
- package/dist/src/generated/index.d.ts +2 -0
- package/dist/src/index.d.ts +2 -0
- package/dist/stories/ActionCard.stories.d.ts +51 -0
- package/dist/stories/InstrumentCard.stories.d.ts +43 -0
- package/dist/web-ui-tailwind.css +27 -0
- package/dist/web-ui.esm.js +1 -1
- package/dist/web-ui.esm.js.map +1 -1
- package/package.json +1 -1
|
@@ -5050,6 +5050,77 @@ const MediaPicker = React__namespace.default.forwardRef((props, ref) => {
|
|
|
5050
5050
|
|
|
5051
5051
|
const TagGroup = ({ children, tags, tagSize = "large", className }) => jsxRuntime.jsxs("div", { className: classNames__default.default("ui:flex ui:flex-row ui:flex-wrap ui:gap-2", className), children: [children, tags === null || tags === void 0 ? void 0 : tags.map((tag) => jsxRuntime.jsx(Tag, Object.assign({ _size: tagSize }, tag)))] });
|
|
5052
5052
|
|
|
5053
|
+
const typeIcons$1 = {
|
|
5054
|
+
info: BookOpenIcon,
|
|
5055
|
+
questionnaire: ClipboardListIcon,
|
|
5056
|
+
numeric: HashIcon,
|
|
5057
|
+
document: DocumentLinesIcon,
|
|
5058
|
+
contact: PersonIcon,
|
|
5059
|
+
other: CircleEllipsisIcon,
|
|
5060
|
+
scripted: SigmaSquareIcon,
|
|
5061
|
+
sum: SigmaSquareIcon
|
|
5062
|
+
};
|
|
5063
|
+
const InstrumentCard = ({ type, title, category, meta, id, count, variant = "compact", state = "default", errorMessage, className }) => {
|
|
5064
|
+
const isDetailed = variant === "detailed";
|
|
5065
|
+
const isError = state === "error";
|
|
5066
|
+
const TypeIcon = isError ? ExclamationMarkIcon : typeIcons$1[type];
|
|
5067
|
+
const textColor = isError ? "error" : "neutral";
|
|
5068
|
+
if (!isDetailed) {
|
|
5069
|
+
return jsxRuntime.jsxs(Stack, { axis: "x", align: "center", _gap: "base", _py: "base", _pl: "base", _pr: "m", className: classNames__default.default("ui:inline-flex ui:bg-background-neutral-primary-default ui:[border-radius:var(--ui-semantic-radius-m)]", className), children: [jsxRuntime.jsx(TypeIcon, { "aria-hidden": true, width: 14, height: 14, className: classNames__default.default("ui:shrink-0", {
|
|
5070
|
+
"ui:text-icon-error-primary-default": isError,
|
|
5071
|
+
"ui:text-icon-brand-primary-default": !isError
|
|
5072
|
+
}) }), jsxRuntime.jsx(Text, { variant: "body-small-regular", color: textColor, children: isError ? errorMessage : title })] });
|
|
5073
|
+
}
|
|
5074
|
+
return jsxRuntime.jsxs(Stack, { axis: "x", align: "start", justify: "between", width: "full", _py: "m", _pl: "m", _pr: "base", className: classNames__default.default("ui:bg-background-neutral-primary-default ui:[border-radius:var(--ui-semantic-radius-m)]", className), children: [jsxRuntime.jsxs(Stack, { axis: "x", _gap: "base", className: "ui:min-w-0 ui:flex-1", children: [jsxRuntime.jsx(Box, { _py: "xs", className: "ui:shrink-0", children: jsxRuntime.jsx(TypeIcon, { "aria-hidden": true, width: 16, height: 16, className: classNames__default.default({
|
|
5075
|
+
"ui:text-icon-error-primary-default": isError,
|
|
5076
|
+
"ui:text-icon-brand-primary-default": !isError
|
|
5077
|
+
}) }) }), jsxRuntime.jsxs(Stack, { _gap: "base", className: "ui:min-w-0 ui:flex-1", children: [jsxRuntime.jsx(Text, { variant: "body-medium-regular", color: textColor, truncate: true, className: "ui:min-w-0", children: title }), isError && jsxRuntime.jsx(Text, { variant: "body-small-regular", color: "error", children: errorMessage }), !isError && (category || meta) && jsxRuntime.jsxs(Stack, { axis: "x", align: "center", children: [category && jsxRuntime.jsx(Text, { variant: "body-small-regular", color: "neutral", children: category }), category && meta && jsxRuntime.jsx(Box, { _mx: "base", className: "ui:h-[12px] ui:w-px ui:shrink-0 ui:bg-border-neutral-primary-default" }), meta && jsxRuntime.jsx(Text, { variant: "body-small-regular", color: "neutral", children: meta })] }), id && jsxRuntime.jsx(Tag, { _size: "small", _variant: "bordered", _leadingIcon: jsxRuntime.jsx(CopyToClipboardIcon, { "aria-hidden": true }), children: id })] })] }), count !== void 0 && jsxRuntime.jsx(Tag, { _size: "small", _variant: "flat", _leadingIcon: jsxRuntime.jsx(CopyToClipboardIcon, { "aria-hidden": true }), className: "ui:shrink-0", children: jsxRuntime.jsx(Text, { variant: "body-small-bold", as: "span", children: count }) })] });
|
|
5078
|
+
};
|
|
5079
|
+
|
|
5080
|
+
const variantClasses = {
|
|
5081
|
+
h1: "ui-typo-h1 ui:text-text-brand-primary-default",
|
|
5082
|
+
h2: "ui-typo-h2 ui:text-text-neutral-primary-default",
|
|
5083
|
+
h3: "ui-typo-h3 ui:text-text-neutral-primary-default",
|
|
5084
|
+
h4: "ui-typo-h4 ui:text-text-neutral-primary-default"
|
|
5085
|
+
};
|
|
5086
|
+
const Heading = (_a) => {
|
|
5087
|
+
var { as: Element = "h2", variant = "h2", className, children } = _a, rest = __rest(_a, ["as", "variant", "className", "children"]);
|
|
5088
|
+
return jsxRuntime.jsx(Element, Object.assign({ className: classNames__default.default(variantClasses[variant], className) }, rest, { children }));
|
|
5089
|
+
};
|
|
5090
|
+
|
|
5091
|
+
const typeIcons = {
|
|
5092
|
+
information: ActionInformationColoredIcon,
|
|
5093
|
+
contact: ActionContactColoredIcon,
|
|
5094
|
+
lesson: ActionLessonColoredIcon,
|
|
5095
|
+
calculation: ActionCalculationColoredIcon,
|
|
5096
|
+
measurement: ActionBloodPressureColoredIcon
|
|
5097
|
+
};
|
|
5098
|
+
const ActionCard = ({ type, title, metadata, instruments, actions, draggable = false, titleAs = "h3", variant = "default", onClick, className }) => {
|
|
5099
|
+
const TypeIcon = typeIcons[type];
|
|
5100
|
+
const isCompact = variant === "compact";
|
|
5101
|
+
const isList = variant === "list";
|
|
5102
|
+
return jsxRuntime.jsx(Card, { borderRadius: "m", elevation: isList ? "surface" : "small", elevationOnHover: isList ? void 0 : "medium", padding: false, className: classNames__default.default("ui:w-full", className), children: jsxRuntime.jsxs(Stack, { axis: "x", align: "start", justify: "between", _gap: "base", _p: "l", children: [draggable && jsxRuntime.jsx(Box, { className: "ui:relative ui:z-[1] ui:shrink-0 ui:self-center", children: jsxRuntime.jsx(DragHandle, { grabbing: false }) }), jsxRuntime.jsxs(Stack, { _gap: isCompact ? "s" : "m", className: "ui:min-w-0 ui:flex-1", children: [jsxRuntime.jsxs(Stack, { axis: "x", align: "center", _gap: "base", children: [jsxRuntime.jsx(TypeIcon, { "aria-hidden": true, width: 20, height: 20, className: "ui:shrink-0" }), jsxRuntime.jsx(Heading, { as: titleAs, variant: "h4", className: "ui:min-w-0", children: onClick ? (
|
|
5103
|
+
/**
|
|
5104
|
+
* The whole card is the click target, but it cannot be a
|
|
5105
|
+
* `<button>` because the `actions` slot and the drag handle
|
|
5106
|
+
* are interactive themselves and nesting them inside a button
|
|
5107
|
+
* is invalid HTML. Instead a real button wraps the title and
|
|
5108
|
+
* stretches an `::after` overlay across the card, which keeps
|
|
5109
|
+
* the component keyboard accessible and gives it an
|
|
5110
|
+
* announceable name. Interactive slots opt out by sitting
|
|
5111
|
+
* above the overlay.
|
|
5112
|
+
*/
|
|
5113
|
+
jsxRuntime.jsx("button", { type: "button", onClick, className: "ui:cursor-pointer ui:text-left ui:after:absolute ui:after:inset-0 ui:after:content-[''] ui:focus:outline-primary", children: title })
|
|
5114
|
+
) : title })] }), metadata && metadata.length > 0 && jsxRuntime.jsx(Stack, { axis: "x", _gap: "base", wrap: !isCompact, children: metadata.map(({ label, bordered }, index) => jsxRuntime.jsx(
|
|
5115
|
+
Tag,
|
|
5116
|
+
{ _size: "small", _type: "neutral", _variant: bordered ? "bordered" : "flat", _truncate: isCompact, children: label },
|
|
5117
|
+
`${index}-${label}`
|
|
5118
|
+
)) }), !isCompact && instruments && instruments.length > 0 && jsxRuntime.jsx(Stack, { axis: "x", _gap: "base", wrap: true, children: instruments.map((instrument) => {
|
|
5119
|
+
var _a;
|
|
5120
|
+
return React.createElement(InstrumentCard, Object.assign({}, instrument, { variant: "compact", key: (_a = instrument.id) !== null && _a !== void 0 ? _a : `${instrument.type}-${instrument.title}` }));
|
|
5121
|
+
}) })] }), actions && jsxRuntime.jsx(Box, { className: "ui:relative ui:z-[1] ui:shrink-0 ui:self-center", children: actions })] }) });
|
|
5122
|
+
};
|
|
5123
|
+
|
|
5053
5124
|
var css_248z$1 = "/*! tailwindcss v4.1.12 | MIT License | https://tailwindcss.com */\n.cweb-textarea {\n resize: none;\n background-color: field;\n}\n.cweb-textarea.has-icon {\n background-size: 24px;\n background-position: 10px 10px;\n background-repeat: no-repeat;\n padding-left: 44px;\n}\n.cweb-textarea.resizable {\n resize: both;\n}\n.cweb-textarea.resizable-x {\n resize: horizontal;\n}\n.cweb-textarea.resizable-y {\n resize: vertical;\n}\n.cweb-textarea:focus {\n border-color: var(--color-primary);\n}\n.cweb-textarea:disabled {\n cursor: not-allowed;\n}\n.cweb-textarea.has-error {\n border: 1px solid #b91c1c;\n color: #991b1b;\n}";
|
|
5054
5125
|
styleInject(css_248z$1);
|
|
5055
5126
|
|
|
@@ -5614,17 +5685,6 @@ const TextLink = (props) => {
|
|
|
5614
5685
|
return jsxRuntime.jsx("a", { href: props.href, rel: props.rel, target: props.target, onClick: props.onClick, className: classNames__default.default(className, props.className), children: props.text });
|
|
5615
5686
|
};
|
|
5616
5687
|
|
|
5617
|
-
const variantClasses = {
|
|
5618
|
-
h1: "ui-typo-h1 ui:text-text-brand-primary-default",
|
|
5619
|
-
h2: "ui-typo-h2 ui:text-text-neutral-primary-default",
|
|
5620
|
-
h3: "ui-typo-h3 ui:text-text-neutral-primary-default",
|
|
5621
|
-
h4: "ui-typo-h4 ui:text-text-neutral-primary-default"
|
|
5622
|
-
};
|
|
5623
|
-
const Heading = (_a) => {
|
|
5624
|
-
var { as: Element = "h2", variant = "h2", className, children } = _a, rest = __rest(_a, ["as", "variant", "className", "children"]);
|
|
5625
|
-
return jsxRuntime.jsx(Element, Object.assign({ className: classNames__default.default(variantClasses[variant], className) }, rest, { children }));
|
|
5626
|
-
};
|
|
5627
|
-
|
|
5628
5688
|
const TimelineStep = React__namespace.default.forwardRef(({ content, type = "base", dataTestId, title }, ref) => {
|
|
5629
5689
|
const isWideStep = type === "wide";
|
|
5630
5690
|
const borderClassNames = "ui:ml-4 ui:pl-6 ui:border-primary ui:border-l-2";
|
|
@@ -7151,6 +7211,7 @@ exports.AccordionList = AccordionList;
|
|
|
7151
7211
|
exports.AccordionTemporary = Accordion;
|
|
7152
7212
|
exports.ActionBloodPressureColoredIcon = ActionBloodPressureColoredIcon;
|
|
7153
7213
|
exports.ActionCalculationColoredIcon = ActionCalculationColoredIcon;
|
|
7214
|
+
exports.ActionCard = ActionCard;
|
|
7154
7215
|
exports.ActionContactColoredIcon = ActionContactColoredIcon;
|
|
7155
7216
|
exports.ActionController = ActionController;
|
|
7156
7217
|
exports.ActionHeartRateColoredIcon = ActionHeartRateColoredIcon;
|
|
@@ -7288,6 +7349,7 @@ exports.InfoField = InfoField;
|
|
|
7288
7349
|
exports.InfoIcon = InfoIcon;
|
|
7289
7350
|
exports.Input = Input;
|
|
7290
7351
|
exports.InputSelect = InputSelectWithSubComponents;
|
|
7352
|
+
exports.InstrumentCard = InstrumentCard;
|
|
7291
7353
|
exports.LabelText = LabelText;
|
|
7292
7354
|
exports.LabeledCheckbox = LabeledCheckbox;
|
|
7293
7355
|
exports.LabeledCheckboxCard = LabeledCheckboxCard;
|