@luscii-healthtech/web-ui 46.4.4 → 47.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.
Files changed (38) hide show
  1. package/dist/index.development.js +58 -51
  2. package/dist/index.development.js.map +1 -1
  3. package/dist/index.js +1 -1
  4. package/dist/index.js.map +1 -1
  5. package/dist/src/components/Box/Box.d.ts +34 -4
  6. package/dist/src/components/Dropzone/Dropzone.d.ts +6 -5
  7. package/dist/src/components/Stack/Stack.d.ts +7 -1
  8. package/dist/src/generated/components/Box/Box.d.ts +34 -4
  9. package/dist/src/generated/components/Dropzone/Dropzone.d.ts +6 -5
  10. package/dist/src/generated/components/Stack/Stack.d.ts +7 -1
  11. package/dist/src/generated/index.d.ts +1 -1
  12. package/dist/src/generated/system/Sizes.d.ts +11 -0
  13. package/dist/src/index.d.ts +1 -1
  14. package/dist/src/system/Sizes.d.ts +11 -0
  15. package/dist/stories/AsideLayout.stories.d.ts +17 -2
  16. package/dist/stories/Box.stories.d.ts +1 -0
  17. package/dist/stories/DetailsDisclosure.stories.d.ts +945 -482
  18. package/dist/stories/Divider.stories.d.ts +38 -6
  19. package/dist/stories/DraggableList.stories.d.ts +0 -1
  20. package/dist/stories/Dropzone.stories.d.ts +9 -9
  21. package/dist/stories/HoverIndicatorControl.stories.d.ts +17 -2
  22. package/dist/stories/PageWithCenteredContentLayout.stories.d.ts +51 -6
  23. package/dist/stories/Section.stories.d.ts +17 -2
  24. package/dist/stories/SplitViewLayout.stories.d.ts +17 -2
  25. package/dist/stories/Stack.stories.d.ts +1 -0
  26. package/dist/stories/StyledOrderedList.stories.d.ts +1 -1
  27. package/dist/stories/StyledUnorderedList.stories.d.ts +1 -1
  28. package/dist/stories/Tabs.stories.d.ts +17 -2
  29. package/dist/stories/TimelineCardLayout.stories.d.ts +19 -3
  30. package/dist/stories/VerticalMenu.stories.d.ts +17 -2
  31. package/dist/web-ui-tailwind.css +470 -7
  32. package/dist/web-ui.esm.js +1 -1
  33. package/dist/web-ui.esm.js.map +1 -1
  34. package/package.json +1 -1
  35. package/dist/src/components/Dropzone/Dropzone.types.d.ts +0 -33
  36. package/dist/src/components/Dropzone/index.d.ts +0 -2
  37. package/dist/src/generated/components/Dropzone/Dropzone.types.d.ts +0 -33
  38. package/dist/src/generated/components/Dropzone/index.d.ts +0 -2
@@ -235,8 +235,8 @@ function styleInject(css, ref) {
235
235
  }
236
236
  }
237
237
 
238
- var css_248z$g = "/* https://stackoverflow.com/a/13924997 */\n.ui\\:text-two-lines-max {\n overflow: hidden;\n text-overflow: ellipsis;\n display: -webkit-box;\n /* number of lines to show */\n -webkit-line-clamp: 2;\n line-clamp: 2;\n -webkit-box-orient: vertical;\n}\n";
239
- styleInject(css_248z$g);
238
+ var css_248z$f = "/* https://stackoverflow.com/a/13924997 */\n.ui\\:text-two-lines-max {\n overflow: hidden;\n text-overflow: ellipsis;\n display: -webkit-box;\n /* number of lines to show */\n -webkit-line-clamp: 2;\n line-clamp: 2;\n -webkit-box-orient: vertical;\n}\n";
239
+ styleInject(css_248z$f);
240
240
 
241
241
  const newVariants = /* @__PURE__ */ new Set([
242
242
  "body-base-light",
@@ -1003,8 +1003,8 @@ toast.info = (message) => {
1003
1003
  showToaster({ message, type: "success", showIcon: true, title: "" });
1004
1004
  };
1005
1005
 
1006
- var css_248z$f = "/**\n * --- DEPRECATED ---\n * DON'T USE ANYTHING FROM THIS FILE IN FUTURE CHANGES. WE SHOULD BE\n * USING TAILWIND CLASSES DIRECTLY IN OUR COMPONENTS.\n */\n/** Load Avenir fonts for titles */\n@font-face {\n font-family: \"AvenirNextLTPro-Regular\";\n src: url(\"../../../public/fonts/avenir/3A0AF8_1_0.eot\");\n src: url(\"../../../public/fonts/avenir/3A0AF8_1_0.eot\") format(\"embedded-opentype\"), url(\"../../../public/fonts/avenir/3A0AF8_1_0.woff2\") format(\"woff2\"), url(\"../../../public/fonts/avenir/3A0AF8_1_0.woff\") format(\"woff\"), url(\"../../../public/fonts/avenir/3A0AF8_1_0.ttf\") format(\"truetype\");\n}\n@font-face {\n font-family: \"AvenirNextLTPro-Bold\";\n src: url(\"../../../public/fonts/avenir/3A0AF8_0_0.eot\");\n src: url(\"../../../public/fonts/avenir/3A0AF8_0_0.eot\") format(\"embedded-opentype\"), url(\"../../../public/fonts/avenir/3A0AF8_0_0.woff2\") format(\"woff2\"), url(\"../../../public/fonts/avenir/3A0AF8_0_0.woff\") format(\"woff\"), url(\"../../../public/fonts/avenir/3A0AF8_0_0.ttf\") format(\"truetype\");\n}\n.title-avenir {\n font-family: \"AvenirNextLTPro-Bold\", \"Roboto\", sans-serif;\n}\n\n.title-inter {\n font-family: \"Inter\", \"Roboto\", \"Helvetica\", sans-serif;\n}";
1007
- styleInject(css_248z$f);
1006
+ var css_248z$e = "/**\n * --- DEPRECATED ---\n * DON'T USE ANYTHING FROM THIS FILE IN FUTURE CHANGES. WE SHOULD BE\n * USING TAILWIND CLASSES DIRECTLY IN OUR COMPONENTS.\n */\n/** Load Avenir fonts for titles */\n@font-face {\n font-family: \"AvenirNextLTPro-Regular\";\n src: url(\"../../../public/fonts/avenir/3A0AF8_1_0.eot\");\n src: url(\"../../../public/fonts/avenir/3A0AF8_1_0.eot\") format(\"embedded-opentype\"), url(\"../../../public/fonts/avenir/3A0AF8_1_0.woff2\") format(\"woff2\"), url(\"../../../public/fonts/avenir/3A0AF8_1_0.woff\") format(\"woff\"), url(\"../../../public/fonts/avenir/3A0AF8_1_0.ttf\") format(\"truetype\");\n}\n@font-face {\n font-family: \"AvenirNextLTPro-Bold\";\n src: url(\"../../../public/fonts/avenir/3A0AF8_0_0.eot\");\n src: url(\"../../../public/fonts/avenir/3A0AF8_0_0.eot\") format(\"embedded-opentype\"), url(\"../../../public/fonts/avenir/3A0AF8_0_0.woff2\") format(\"woff2\"), url(\"../../../public/fonts/avenir/3A0AF8_0_0.woff\") format(\"woff\"), url(\"../../../public/fonts/avenir/3A0AF8_0_0.ttf\") format(\"truetype\");\n}\n.title-avenir {\n font-family: \"AvenirNextLTPro-Bold\", \"Roboto\", sans-serif;\n}\n\n.title-inter {\n font-family: \"Inter\", \"Roboto\", \"Helvetica\", sans-serif;\n}";
1007
+ styleInject(css_248z$e);
1008
1008
 
1009
1009
  const Title = (props) => {
1010
1010
  const { variant: variantFromProps = "base", type, className, text, children, color, level, ref } = props, rest = __rest(props, ["variant", "type", "className", "text", "children", "color", "level", "ref"]);
@@ -1080,8 +1080,8 @@ const isSubstring = (string, searchTerm, caseSensitive = false) => {
1080
1080
  return (stringToSearch === null || stringToSearch === void 0 ? void 0 : stringToSearch.indexOf(searchTermWithCase)) > -1;
1081
1081
  };
1082
1082
 
1083
- var css_248z$e = ".list-skeleton .skeleton-box {\n display: inline-block;\n height: 1em;\n position: relative;\n overflow: hidden;\n background-color: #cbd5e1;\n border-radius: 3px;\n}\n.list-skeleton .skeleton-box::after {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n transform: translateX(-100%);\n background-image: linear-gradient(90deg, rgba(255, 255, 255, 0) 0, rgba(255, 255, 255, 0.2) 20%, rgba(255, 255, 255, 0.5) 60%, rgba(255, 255, 255, 0));\n animation: shimmer 800ms infinite;\n content: \"\";\n}\n.list-skeleton .skeleton-box.is-circle {\n border-radius: 50%;\n}\n.list-skeleton .skeleton-box.is-button::after {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n transform: translateX(-100%);\n background-image: linear-gradient(90deg, rgba(221, 221, 221, 0) 0, rgba(221, 221, 221, 0.2) 20%, rgba(221, 221, 221, 0.5) 60%, rgba(221, 221, 221, 0));\n animation: shimmer 800ms infinite;\n content: \"\";\n}\n@keyframes shimmer {\n 100% {\n transform: translateX(100%);\n }\n}";
1084
- styleInject(css_248z$e);
1083
+ var css_248z$d = ".list-skeleton .skeleton-box {\n display: inline-block;\n height: 1em;\n position: relative;\n overflow: hidden;\n background-color: #cbd5e1;\n border-radius: 3px;\n}\n.list-skeleton .skeleton-box::after {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n transform: translateX(-100%);\n background-image: linear-gradient(90deg, rgba(255, 255, 255, 0) 0, rgba(255, 255, 255, 0.2) 20%, rgba(255, 255, 255, 0.5) 60%, rgba(255, 255, 255, 0));\n animation: shimmer 800ms infinite;\n content: \"\";\n}\n.list-skeleton .skeleton-box.is-circle {\n border-radius: 50%;\n}\n.list-skeleton .skeleton-box.is-button::after {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n transform: translateX(-100%);\n background-image: linear-gradient(90deg, rgba(221, 221, 221, 0) 0, rgba(221, 221, 221, 0.2) 20%, rgba(221, 221, 221, 0.5) 60%, rgba(221, 221, 221, 0));\n animation: shimmer 800ms infinite;\n content: \"\";\n}\n@keyframes shimmer {\n 100% {\n transform: translateX(100%);\n }\n}";
1084
+ styleInject(css_248z$d);
1085
1085
 
1086
1086
  const ListItemSkeleton = () => {
1087
1087
  return jsxRuntime.jsxs("div", { className: "ui:flex ui:flex-row ui:items-center ui:p-4", children: [jsxRuntime.jsx("div", { className: "skeleton-box is-circle ui:mr-2", style: { width: `${32}px`, height: `${32}px` } }), jsxRuntime.jsxs("div", { className: "ui:flex ui:flex-col", children: [jsxRuntime.jsx("div", { className: "skeleton-box ui:mb-1", style: { width: `${160}px`, height: `${14}px` } }), jsxRuntime.jsx("div", { className: "skeleton-box", style: { width: `${110}px`, height: `${14}px` } })] }), jsxRuntime.jsx("div", { className: "skeleton-box is-button ui:ml-auto ui:rounded-full", style: { width: `${24}px`, height: `${24}px` } })] });
@@ -1226,17 +1226,43 @@ const spacingKeys = [
1226
1226
  "mx",
1227
1227
  "my"
1228
1228
  ];
1229
- const createSpacingClassNames = (keys, spacingProps) => {
1230
- return keys.filter((key) => spacingProps[key]).map((key) => `ui:${key}-${spacingProps[key]}`).join(" ");
1229
+ const underscoredSpacingPropNames = [
1230
+ "_p",
1231
+ "_pt",
1232
+ "_pr",
1233
+ "_pb",
1234
+ "_pl",
1235
+ "_px",
1236
+ "_py",
1237
+ "_m",
1238
+ "_mt",
1239
+ "_mr",
1240
+ "_mb",
1241
+ "_ml",
1242
+ "_mx",
1243
+ "_my"
1244
+ ];
1245
+ const allSpacingPropNames = [
1246
+ ...spacingKeys,
1247
+ ...underscoredSpacingPropNames
1248
+ ];
1249
+ const createSpacingClassNames = (keys, spacingPropsArg) => {
1250
+ const underscoredPropKeys = [...underscoredSpacingPropNames];
1251
+ const current = keys.filter((key) => spacingPropsArg[key] && !underscoredPropKeys.includes(key)).map((key) => `ui:${key}-${spacingPropsArg[key]}`).join(" ");
1252
+ const underscored = keys.filter((key) => spacingPropsArg[key] && underscoredPropKeys.includes(key)).map((key) => `ui:${key.replace("_", "")}-f_${spacingPropsArg[key]}`).join(" ");
1253
+ return `${current} ${underscored}`;
1231
1254
  };
1232
1255
  const Box = (props) => {
1233
1256
  const { as: Element = "div", borderRadius, borderRadiusLeft, borderRadiusRight, className, elevation, width, backgroundColor, hoverBackgroundColor, cursor } = props, attributes = __rest(props, ["as", "borderRadius", "borderRadiusLeft", "borderRadiusRight", "className", "elevation", "width", "backgroundColor", "hoverBackgroundColor", "cursor"]);
1234
- const spacingClasses = createSpacingClassNames(spacingKeys, props);
1257
+ const spacingClasses = createSpacingClassNames(allSpacingPropNames, props);
1235
1258
  const shadowClassName = createShadowClassName(elevation);
1236
1259
  const borderRadiusClassName = createRadiusClassName(borderRadius);
1237
1260
  const borderRadiusLeftClassName = createRadiusLeftClassName(borderRadiusLeft);
1238
1261
  const borderRadiusRightClassName = createRadiusRightClassName(borderRadiusRight);
1239
- const attributesWithoutSpacingKeys = omit__default.default(attributes, spacingKeys);
1262
+ const attributesWithoutSpacingKeys = omit__default.default(attributes, [
1263
+ ...spacingKeys,
1264
+ ...underscoredSpacingPropNames
1265
+ ]);
1240
1266
  const boxClasses = classNames__default.default(spacingClasses, {
1241
1267
  "ui:bg-surface": backgroundColor === "surface",
1242
1268
  "ui:bg-background": backgroundColor === "background",
@@ -1283,13 +1309,17 @@ const Box = (props) => {
1283
1309
  };
1284
1310
 
1285
1311
  const Stack = (props) => {
1286
- const { children, gap, align = "start", justify = "normal", axis = "y", className, reverse, wrap = false, divider } = props, attributes = __rest(props, ["children", "gap", "align", "justify", "axis", "className", "reverse", "wrap", "divider"]);
1312
+ const { children, gap, _gap, align = "start", justify = "normal", axis = "y", className, reverse, wrap = false, divider } = props, attributes = __rest(props, ["children", "gap", "_gap", "align", "justify", "axis", "className", "reverse", "wrap", "divider"]);
1287
1313
  const stackClasses = classNames__default.default(`ui:flex`, {
1288
1314
  "ui:flex-row": axis === "x",
1289
1315
  "ui:flex-col": axis === "y",
1290
1316
  "ui:flex-row-reverse": axis === "x" && reverse,
1291
1317
  "ui:flex-col-reverse": axis === "y" && reverse,
1292
1318
  "ui:flex-wrap": wrap,
1319
+ /**
1320
+ * @deprecated
1321
+ * Old spacing system, to be removed in a future major release. Use the `_gap` prop instead.
1322
+ */
1293
1323
  "ui:gap-m": gap === "m",
1294
1324
  "ui:gap-none": gap === "none",
1295
1325
  "ui:gap-xxxxs": gap === "xxxxs",
@@ -1300,6 +1330,16 @@ const Stack = (props) => {
1300
1330
  "ui:gap-l": gap === "l",
1301
1331
  "ui:gap-xl": gap === "xl",
1302
1332
  "ui:gap-xxl": gap === "xxl",
1333
+ "ui:gap-f_none": _gap === "none",
1334
+ "ui:gap-f_xs": _gap === "xs",
1335
+ "ui:gap-f_s": _gap === "s",
1336
+ "ui:gap-f_base": _gap === "base",
1337
+ "ui:gap-f_m": _gap === "m",
1338
+ "ui:gap-f_l": _gap === "l",
1339
+ "ui:gap-f_xl": _gap === "xl",
1340
+ "ui:gap-f_2xl": _gap === "2xl",
1341
+ "ui:gap-f_3xl": _gap === "3xl",
1342
+ "ui:gap-f_4xl": _gap === "4xl",
1303
1343
  "ui:justify-center": justify === "center",
1304
1344
  "ui:justify-start": justify === "start",
1305
1345
  "ui:justify-end": justify === "end",
@@ -1506,47 +1546,14 @@ const DraggableBaseList = (_a) => {
1506
1546
  return jsxRuntime.jsx(BaseList, Object.assign({}, props, { items, itemComponent: DraggableBaseListItem }));
1507
1547
  };
1508
1548
 
1509
- var css_248z$d = ".dropzone-dashed-border {\n border-image: url(\"data:image/svg+xml,%3Csvg xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22 width%3D%2224%22 height%3D%2224%22 fill%3D%22none%22%3E %3Cpath fill%3D%22%230074DD%22 fill-rule%3D%22evenodd%22 d%3D%22M8 0v1h8V0H8Zm0 23v1h8v-1H8ZM0 8h1v8H0V8Zm24 0h-1v8h1V8ZM1 0h3v1H1v3H0V0h1ZM0 23v-3h1v3h3v1H0v-1Zm20 0v1h4v-4h-1v3h-3Zm0-22V0h4v4h-1V1h-3Z%22 clip-rule%3D%22evenodd%22 %2F%3E%3C%2Fsvg%3E\") 1 1 1 1;\n border-image-width: 4px;\n border-image-slice: 4 4 4 4;\n border-image-repeat: round;\n}";
1510
- styleInject(css_248z$d);
1511
-
1512
- const DefaultState = ({ icon, message, horizontal = false, alignMessage = "center" }) => {
1513
- if (!icon && !message) {
1514
- return null;
1515
- }
1516
- const alignLeft = horizontal || alignMessage === "left";
1517
- const className = classNames__default.default("ui:p-4 ui:flex ui:items-center", {
1518
- "ui:flex-col ui:justify-center": !alignLeft,
1519
- "ui:flex-row ui:w-full ": alignLeft
1520
- });
1521
- return jsxRuntime.jsxs("div", { className, children: [icon && jsxRuntime.jsx(Icon, { name: icon, className: classNames__default.default("ui:text-slate-500", {
1522
- "ui:mb-2": message && !alignLeft,
1523
- "ui:mr-2": alignLeft
1524
- }) }), message && jsxRuntime.jsx(Text, { type: "base", color: "slate-500", className: "ui:text-center", text: message })] });
1525
- };
1526
- const DropzonePresentation = React.forwardRef(({ message, icon, isHighlighted, isClickable, className, dataTestId, children, horizontal, alignMessage }, ref) => {
1527
- const classes = classNames__default.default("ui:border ui:flex ui:items-center ui:justify-center ui:border-primary", {
1528
- "dropzone-dashed-border": !isHighlighted,
1529
- "ui:bg-white": !isHighlighted,
1530
- "ui:bg-blue-50": isHighlighted,
1531
- "ui:border-dashed": !isHighlighted,
1532
- "ui:border-solid": isHighlighted,
1533
- "ui:hover:bg-blue-100 ui:transition-colors ui:ease-in-out ui:duration-300": isClickable
1549
+ const Dropzone = React.forwardRef((props, ref) => {
1550
+ const { isHighlighted = false, className, children } = props, rest = __rest(props, ["isHighlighted", "className", "children"]);
1551
+ const classes = classNames__default.default("ui:border ui:items-center ui:border-primary", {
1552
+ "ui:bg-surface ui:border-dashed": !isHighlighted,
1553
+ "ui:bg-primary-background ui:border-solid": isHighlighted
1534
1554
  }, className);
1535
- return jsxRuntime.jsx("div", { className: classes, ref, "data-test-id": dataTestId, children: children || jsxRuntime.jsx(DefaultState, { icon, message, horizontal, alignMessage }) });
1555
+ return jsxRuntime.jsx("div", Object.assign({ className: classes, ref }, rest, { children }));
1536
1556
  });
1537
- const Dropzone = (_a) => {
1538
- var { draggableIdentifier: identifier, disabled, data, dataTestId, onClick } = _a, props = __rest(_a, ["draggableIdentifier", "disabled", "data", "dataTestId", "onClick"]);
1539
- const { setNodeRef, isOver } = core.useDroppable({
1540
- id: identifier,
1541
- disabled,
1542
- data
1543
- });
1544
- const presentation = jsxRuntime.jsx(DropzonePresentation, Object.assign({ ref: setNodeRef, isHighlighted: isOver, isClickable: onClick && !disabled }, props, { dataTestId: dataTestId !== null && dataTestId !== void 0 ? dataTestId : `dropzone-${identifier}` }));
1545
- if (onClick) {
1546
- return jsxRuntime.jsx("button", { onClick, disabled, className: "ui:block ui:w-full ui:rounded ui:focus:outline-primary", children: presentation });
1547
- }
1548
- return presentation;
1549
- };
1550
1557
 
1551
1558
  const SortableBaseListItem = (_a) => {
1552
1559
  var { draggableData } = _a, props = __rest(_a, ["draggableData"]);
@@ -1560,7 +1567,7 @@ const SortableBaseListItem = (_a) => {
1560
1567
  });
1561
1568
  const styleTransform = utilities.CSS.Transform.toString(transform);
1562
1569
  if (isDragging) {
1563
- return jsxRuntime.jsxs("div", { style: { transform: styleTransform, position: "relative" }, children: [jsxRuntime.jsx(DropzonePresentation, { className: "ui:absolute ui:h-full ui:w-full" }), jsxRuntime.jsx("div", { className: "ui:invisible", children: jsxRuntime.jsx(BaseListItem, Object.assign({}, props, { ref: setNodeRef, htmlProps: { style: { transform: styleTransform } }, isDraggable: props.__isNested ? false : true, renderDragHandle: () => jsxRuntime.jsx(DragHandle, Object.assign({}, attributes, listeners, { disabled: !props.isDraggable, grabbing: isDragging })) })) })] });
1570
+ return jsxRuntime.jsxs("div", { style: { transform: styleTransform, position: "relative" }, children: [jsxRuntime.jsx(Dropzone, { className: "ui:absolute ui:h-full ui:w-full" }), jsxRuntime.jsx("div", { className: "ui:invisible", children: jsxRuntime.jsx(BaseListItem, Object.assign({}, props, { ref: setNodeRef, htmlProps: { style: { transform: styleTransform } }, isDraggable: props.__isNested ? false : true, renderDragHandle: () => jsxRuntime.jsx(DragHandle, Object.assign({}, attributes, listeners, { disabled: !props.isDraggable, grabbing: isDragging })) })) })] });
1564
1571
  }
1565
1572
  return jsxRuntime.jsx(BaseListItem, Object.assign({}, props, { ref: setNodeRef, htmlProps: { style: { transform: styleTransform } }, isDraggable: props.__isNested ? false : true, renderDragHandle: () => jsxRuntime.jsx(DragHandle, Object.assign({}, attributes, listeners, { disabled: !props.isDraggable, grabbing: isDragging })) }));
1566
1573
  };