@luscii-healthtech/web-ui 40.3.3 → 40.3.5

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 (97) hide show
  1. package/dist/.storybook/constants.d.ts +24 -7
  2. package/dist/.storybook/decorators.d.ts +1 -1
  3. package/dist/index.development.js +42 -20
  4. package/dist/index.development.js.map +1 -1
  5. package/dist/index.js +1 -1
  6. package/dist/index.js.map +1 -1
  7. package/dist/src/components/SplitViewLayout/SplitViewLayout.d.ts +6 -2
  8. package/dist/stories/Accordion.stories.d.ts +2 -5
  9. package/dist/stories/AccordionList.stories.d.ts +8 -8
  10. package/dist/stories/AlertsWidget.stories.d.ts +1 -1
  11. package/dist/stories/AsideLayout.stories.d.ts +1 -1
  12. package/dist/stories/Avatar.stories.d.ts +1 -1
  13. package/dist/stories/Badge.stories.d.ts +1 -1
  14. package/dist/stories/BaseList.stories.d.ts +1 -1
  15. package/dist/stories/Box.stories.d.ts +1 -1
  16. package/dist/stories/Breadcrumbs.stories.d.ts +1 -1
  17. package/dist/stories/Button.stories.d.ts +2 -2
  18. package/dist/stories/CRUDPage.stories.d.ts +1 -1
  19. package/dist/stories/Card.stories.d.ts +1 -1
  20. package/dist/stories/CenteredHero.stories.d.ts +1 -1
  21. package/dist/stories/ChatBubble.stories.d.ts +2 -3
  22. package/dist/stories/CheckBoxListModal.stories.d.ts +1 -1
  23. package/dist/stories/Checkbox.stories.d.ts +1 -1
  24. package/dist/stories/CheckboxList.stories.d.ts +2 -5
  25. package/dist/stories/Chip.stories.d.ts +1 -1
  26. package/dist/stories/Collapse.stories.d.ts +2 -5
  27. package/dist/stories/ConfirmationDialog.stories.d.ts +1 -1
  28. package/dist/stories/DatePicker.stories.d.ts +2 -2
  29. package/dist/stories/DetailsDisclosure.stories.d.ts +21 -22
  30. package/dist/stories/Divider.stories.d.ts +1 -1
  31. package/dist/stories/DraggableAccordionList.stories.d.ts +1 -1
  32. package/dist/stories/DraggableList.stories.d.ts +1 -1
  33. package/dist/stories/Dropdown.stories.d.ts +2 -5
  34. package/dist/stories/Dropzone.stories.d.ts +1 -1
  35. package/dist/stories/FilePreview.stories.d.ts +2 -2
  36. package/dist/stories/FileUpload.stories.d.ts +1 -1
  37. package/dist/stories/FilterBar.stories.d.ts +1 -1
  38. package/dist/stories/FlexContainer.stories.d.ts +1 -1
  39. package/dist/stories/FlyOutMenu.stories.d.ts +1 -1
  40. package/dist/stories/FullPageModal.stories.d.ts +5 -5
  41. package/dist/stories/HoverCard.stories.d.ts +1 -1
  42. package/dist/stories/HoverIndicatorControl.stories.d.ts +1 -1
  43. package/dist/stories/Icon.stories.d.ts +1 -1
  44. package/dist/stories/InfoField.stories.d.ts +2 -5
  45. package/dist/stories/Input.stories.d.ts +1 -1
  46. package/dist/stories/LabeledDatePicker.stories.d.ts +2 -3
  47. package/dist/stories/LabeledInput.stories.d.ts +2 -3
  48. package/dist/stories/LabeledRadio.stories.d.ts +1 -1
  49. package/dist/stories/Link.stories.d.ts +2 -5
  50. package/dist/stories/LinkIcon.stories.d.ts +1 -1
  51. package/dist/stories/List.stories.d.ts +3 -3
  52. package/dist/stories/MediaPicker.stories.d.ts +1 -1
  53. package/dist/stories/Modal.stories.d.ts +8 -8
  54. package/dist/stories/ModalDialog.stories.d.ts +97 -98
  55. package/dist/stories/NavLayout.stories.d.ts +3 -3
  56. package/dist/stories/NotificationBanner.stories.d.ts +3 -3
  57. package/dist/stories/PageHeader.stories.d.ts +1 -1
  58. package/dist/stories/Pagination.stories.d.ts +1 -1
  59. package/dist/stories/PreviewPhone.stories.d.ts +1 -1
  60. package/dist/stories/PrimaryButton.stories.d.ts +2 -2
  61. package/dist/stories/PrimaryIconButton.stories.d.ts +2 -2
  62. package/dist/stories/SearchInput.stories.d.ts +2 -5
  63. package/dist/stories/SecondaryButton.stories.d.ts +2 -2
  64. package/dist/stories/SecondaryIconButton.stories.d.ts +2 -2
  65. package/dist/stories/Section.stories.d.ts +1 -1
  66. package/dist/stories/Select.stories.d.ts +10 -10
  67. package/dist/stories/SettingsMenuButton.stories.d.ts +4 -4
  68. package/dist/stories/Skeleton.stories.d.ts +1 -1
  69. package/dist/stories/SortableList.stories.d.ts +1 -1
  70. package/dist/stories/Spinner.stories.d.ts +2 -5
  71. package/dist/stories/SplitViewLayout.stories.d.ts +4 -5
  72. package/dist/stories/Stack.stories.d.ts +1 -1
  73. package/dist/stories/StatusIndicator.stories.d.ts +1 -1
  74. package/dist/stories/Switch.stories.d.ts +1 -1
  75. package/dist/stories/Switcher.stories.d.ts +3 -3
  76. package/dist/stories/Tabbar.stories.d.ts +1 -1
  77. package/dist/stories/Table.stories.d.ts +4 -4
  78. package/dist/stories/Tag.stories.d.ts +1 -1
  79. package/dist/stories/TertiaryButton.stories.d.ts +2 -2
  80. package/dist/stories/TertiaryIconButton.stories.d.ts +2 -2
  81. package/dist/stories/Text.stories.d.ts +1 -1
  82. package/dist/stories/TextColors.stories.d.ts +1 -1
  83. package/dist/stories/TextEditor.stories.d.ts +2 -2
  84. package/dist/stories/TextLink.stories.d.ts +2 -5
  85. package/dist/stories/Timeline.stories.d.ts +1 -1
  86. package/dist/stories/TimelineCard.stories.d.ts +1 -1
  87. package/dist/stories/TimelineCardLayout.stories.d.ts +1 -1
  88. package/dist/stories/Title.stories.d.ts +2 -5
  89. package/dist/stories/Toaster.stories.d.ts +1 -1
  90. package/dist/stories/Tooltip.stories.d.ts +1 -1
  91. package/dist/stories/UnorderedList.stories.d.ts +2 -3
  92. package/dist/stories/VerticalMenu.stories.d.ts +1 -1
  93. package/dist/stories/WeekdaysPicker.stories.d.ts +2 -3
  94. package/dist/web-ui-tailwind.css +6 -30
  95. package/dist/web-ui.esm.js +1 -1
  96. package/dist/web-ui.esm.js.map +1 -1
  97. package/package.json +12 -25
@@ -1,10 +1,26 @@
1
- export declare enum BADGES {
2
- NEEDS_REVISION = "needs-revision",
3
- DOCUMENTED = "documented",
4
- STABLE = "stable",
5
- NEW = "new",
6
- DEPRECATED = "deprecated"
7
- }
1
+ import { type Meta } from "@storybook/react-webpack5";
2
+ export declare const BADGES: {
3
+ readonly NEEDS_REVISION: "needs-revision";
4
+ readonly DOCUMENTED: "documented";
5
+ readonly STABLE: "stable";
6
+ readonly NEW: "new";
7
+ readonly DEPRECATED: "deprecated";
8
+ };
9
+ type TAGS = (typeof BADGES)[keyof typeof BADGES][];
10
+ /**
11
+ * A drop-in replacements for `"@storybook/react-webpack5"`'s Meta type which extends the type with web-ui's tags.
12
+ *
13
+ * @example
14
+ *
15
+ * const meta = {
16
+ * title: "Layout/SplitViewLayout",
17
+ * component: Component,
18
+ * tags: ["new"], // `tags` is now type-checked and auto-completes
19
+ * } satisfies MMeta<typeof Component>;
20
+ */
21
+ export type MMeta<T> = Meta<T> & {
22
+ tags: TAGS;
23
+ };
8
24
  /**
9
25
  * For stories specifically used in the Docs page that are not intended
10
26
  * to be used for snapshots. E.g. stories that are used to demonstrate
@@ -16,3 +32,4 @@ export declare const NO_SNAPSHOT_PARAMS: {
16
32
  disableSnapshot: boolean;
17
33
  };
18
34
  };
35
+ export {};
@@ -1,4 +1,4 @@
1
- import { Decorator } from "@storybook/react";
1
+ import { Decorator } from "@storybook/react-webpack5";
2
2
  import { ModalDialog } from "../src";
3
3
  import { ComponentProps, HTMLAttributes, ReactNode } from "react";
4
4
  export declare const LocaleDecorator: Decorator;
@@ -4954,12 +4954,12 @@ const FullPageModal = ({ children, dataTestId, isOpen = false, onCloseClick, pri
4954
4954
  FullPageModal.Actions = FullPageModalActions;
4955
4955
  FullPageModal.setAppElement = ReactModal__default.default.setAppElement;
4956
4956
 
4957
- const context$2 = React.createContext({ isOpen: false });
4957
+ const context$3 = React.createContext({ isOpen: false });
4958
4958
  const DetailsDisclosure = (_a) => {
4959
4959
  var { children, onToggleDetails, name, onToggle, openByDefault, open } = _a, rest = __rest(_a, ["children", "onToggleDetails", "name", "onToggle", "openByDefault", "open"]);
4960
4960
  const [internalIsOpen, setInternalIsOpen] = React.useState(openByDefault !== null && openByDefault !== void 0 ? openByDefault : false);
4961
4961
  const isOpen = open !== null && open !== void 0 ? open : internalIsOpen;
4962
- return jsxRuntime.jsx(context$2.Provider, { value: { isOpen }, children: jsxRuntime.jsx(Box, Object.assign({
4962
+ return jsxRuntime.jsx(context$3.Provider, { value: { isOpen }, children: jsxRuntime.jsx(Box, Object.assign({
4963
4963
  as: "details",
4964
4964
  /**
4965
4965
  * This "name" attribute triggers a type-error on "details" eventhough it should be valid
@@ -4981,18 +4981,18 @@ const DefaultOpenIndicator = ({ isOpen }) => {
4981
4981
  }) });
4982
4982
  };
4983
4983
  const OpenIndicator = ({ component: Component = DefaultOpenIndicator }) => {
4984
- const { isOpen } = React.useContext(context$2);
4984
+ const { isOpen } = React.useContext(context$3);
4985
4985
  return jsxRuntime.jsx(Component, { isOpen });
4986
4986
  };
4987
4987
  const Summary = (_a) => {
4988
4988
  var { children, omitOpenIndicator = false } = _a, rest = __rest(_a, ["children", "omitOpenIndicator"]);
4989
- const { isOpen } = React.useContext(context$2);
4989
+ const { isOpen } = React.useContext(context$3);
4990
4990
  return jsxRuntime.jsx(Stack, Object.assign({ as: "summary", pl: "s", hoverBackgroundColor: "blue", cursor: "pointer" }, rest, { children: jsxRuntime.jsx(Stack, { axis: "x", justify: "between", align: "center", width: "full", children: jsxRuntime.jsxs(Stack, { axis: "x", width: "full", align: "center", gap: "xxs", children: [!omitOpenIndicator && jsxRuntime.jsx(DefaultOpenIndicator, { isOpen }), jsxRuntime.jsx(Box, { width: "full", children })] }) }) }));
4991
4991
  };
4992
4992
  DetailsDisclosure.Summary = Summary;
4993
4993
  Summary.OpenIndicator = OpenIndicator;
4994
4994
 
4995
- const context$1 = React.createContext({
4995
+ const context$2 = React.createContext({
4996
4996
  variant: "primary"
4997
4997
  });
4998
4998
  const VerticalMenu = (props) => {
@@ -5001,7 +5001,7 @@ const VerticalMenu = (props) => {
5001
5001
  const isCollapsed = variant === "primary-collapsed";
5002
5002
  const shouldShowCollapseButton = localization && Boolean(onCollapseButtonClick);
5003
5003
  const hasHeaderContent = title || shouldShowCollapseButton;
5004
- return jsxRuntime.jsx(context$1.Provider, { value: { variant }, children: jsxRuntime.jsxs(Stack, Object.assign({ as: "div", px: "xxs", py: "m", align: "normal", className: classNames__default.default("ui:max-w-full ui:text-slate-800", className) }, rest, { children: [header && jsxRuntime.jsx("div", { children: header }), jsxRuntime.jsxs(Stack, { axis: "x", gap: "xxs", p: hasHeaderContent ? "m" : void 0, align: "start", justify: "between", width: "full", children: [title && jsxRuntime.jsx(Box, { children: jsxRuntime.jsx(Text, { variant: "lg-strong", children: title }) }), shouldShowCollapseButton && jsxRuntime.jsx(
5004
+ return jsxRuntime.jsx(context$2.Provider, { value: { variant }, children: jsxRuntime.jsxs(Stack, Object.assign({ as: "div", px: "xxs", py: "m", align: "normal", className: classNames__default.default("ui:max-w-full ui:text-slate-800", className) }, rest, { children: [header && jsxRuntime.jsx("div", { children: header }), jsxRuntime.jsxs(Stack, { axis: "x", gap: "xxs", p: hasHeaderContent ? "m" : void 0, align: "start", justify: "between", width: "full", children: [title && jsxRuntime.jsx(Box, { children: jsxRuntime.jsx(Text, { variant: "lg-strong", children: title }) }), shouldShowCollapseButton && jsxRuntime.jsx(
5005
5005
  Box,
5006
5006
  {
5007
5007
  /**
@@ -5036,11 +5036,11 @@ VerticalMenu.ItemPadding = MenuItemPadding;
5036
5036
  VerticalMenu.NotificationBubble = MenuItemNotificationBubble;
5037
5037
  VerticalMenu.ItemGroup = MenuItemGroup;
5038
5038
  function MenuItemText(props) {
5039
- const { variant: menuVariant } = React.useContext(context$1);
5039
+ const { variant: menuVariant } = React.useContext(context$2);
5040
5040
  return jsxRuntime.jsx(Text, Object.assign({ as: "span", color: "current", variant: menuVariant === "primary" ? "strong" : props.variant }, props, { className: classNames__default.default("ui:sm:leading-[24px]", props.className) }));
5041
5041
  }
5042
5042
  const useGetClassName = () => {
5043
- const { variant } = React.useContext(context$1);
5043
+ const { variant } = React.useContext(context$2);
5044
5044
  return React.useCallback(
5045
5045
  // eslint-disable-next-line consistent-return
5046
5046
  ({ isActive = false, classNameProp = "" } = {}) => {
@@ -5083,7 +5083,7 @@ function MenuItem(props) {
5083
5083
  return (_a = props.render) === null || _a === void 0 ? void 0 : _a.call(props, { getClassName });
5084
5084
  }
5085
5085
  function MenuItemLayout(props) {
5086
- const { variant } = React.useContext(context$1);
5086
+ const { variant } = React.useContext(context$2);
5087
5087
  const { icon, text, aside, notificationBubbleText, className, children } = props;
5088
5088
  const isCollapsed = variant === "primary-collapsed";
5089
5089
  if (children) {
@@ -5098,7 +5098,7 @@ function MenuItemLayout(props) {
5098
5098
  jsxRuntime.jsx("span", { "aria-label": itemIsTextOrNumber ? String(text) : void 0, children: icon }), text && !isCollapsed && jsxRuntime.jsx(MenuItemText, { children: text }), aside && jsxRuntime.jsx("span", { className: "ui:ml-auto", children: aside }), notificationBubbleText && !isCollapsed && jsxRuntime.jsx("span", { className: "ui:ml-auto", children: jsxRuntime.jsx(MenuItemNotificationBubble, { children: notificationBubbleText }) }), notificationBubbleText && isCollapsed && jsxRuntime.jsx("span", { "aria-label": notificationBubbleText, className: "ui:absolute ui:right-[-8px] ui:top-[-4px] ui:h-[8px] ui:w-[8px] ui:rounded-full ui:bg-red-500" })] });
5099
5099
  }
5100
5100
  function MenuItemPadding(props) {
5101
- const { variant } = React.useContext(context$1);
5101
+ const { variant } = React.useContext(context$2);
5102
5102
  const { children, className, paddingX = variant === "primary", paddingY = true } = props;
5103
5103
  return jsxRuntime.jsx("div", { className: classNames__default.default({
5104
5104
  "ui:px-m": paddingX,
@@ -5604,10 +5604,10 @@ const Collapse = (props) => {
5604
5604
  return jsxRuntime.jsx(jsxRuntime.Fragment, { children: jsxRuntime.jsxs("button", { className: buttonClassName, onClick, "aria-expanded": !isCollapsed, children: [jsxRuntime.jsx("div", { className: contentClassName, children }), isCollapsed && showMoreIndicator && moreIndicator] }) });
5605
5605
  };
5606
5606
 
5607
- const context = React.createContext({
5607
+ const context$1 = React.createContext({
5608
5608
  $dialog: null
5609
5609
  });
5610
- const useModalDialog = () => React.useContext(context);
5610
+ const useModalDialog = () => React.useContext(context$1);
5611
5611
  const ModalDialog = (_a) => {
5612
5612
  var { open, className, size, onClose, children, variant = "centered-dialog" } = _a, rest = __rest(_a, ["open", "className", "size", "onClose", "children", "variant"]);
5613
5613
  const dialog = React.useRef(null);
@@ -5639,7 +5639,7 @@ const ModalDialog = (_a) => {
5639
5639
  (_b = dialog.current) === null || _b === void 0 ? void 0 : _b.close();
5640
5640
  }
5641
5641
  }, [open, variant]);
5642
- return jsxRuntime.jsx(context.Provider, { value: { $dialog: dialog.current }, children: jsxRuntime.jsx("dialog", Object.assign({ ref: dialog, className: classes, onClose }, rest, { children: jsxRuntime.jsx(Stack, { width: "full", align: "stretch", backgroundColor: "surface", borderRadiusLeft: variant === "side-modal" ? "m" : "none", borderRadius: variant === "centered-dialog" ? "m" : "none", className: classNames__default.default({
5642
+ return jsxRuntime.jsx(context$1.Provider, { value: { $dialog: dialog.current }, children: jsxRuntime.jsx("dialog", Object.assign({ ref: dialog, className: classes, onClose }, rest, { children: jsxRuntime.jsx(Stack, { width: "full", align: "stretch", backgroundColor: "surface", borderRadiusLeft: variant === "side-modal" ? "m" : "none", borderRadius: variant === "centered-dialog" ? "m" : "none", className: classNames__default.default({
5643
5643
  "ui:max-h-[calc(100dvh-(var(--ui-spacing-xl))*2)]": variant === "centered-dialog",
5644
5644
  "ui:h-screen": variant === "side-modal" || variant === "full-screen",
5645
5645
  "ui:w-screen": variant === "full-screen"
@@ -5771,22 +5771,44 @@ const AlertWidget = (props) => {
5771
5771
  }), borderRadius: "xxs", px: "xxs", py: "xxxxs", axis: "x", gap: "xxs", align: "center", children: [jsxRuntime.jsx(IconComponent, {}), typeof props.content === "string" ? jsxRuntime.jsx(Text, { color: contentTextColor, variant: "strong", children: props.content }) : props.content] });
5772
5772
  };
5773
5773
 
5774
+ const context = React.createContext(false);
5774
5775
  const SplitViewLayout = (props) => {
5775
5776
  const { open = true, aside, children } = props, restProps = __rest(props, ["open", "aside", "children"]);
5776
- const classesMain = classNames__default.default("ui:transition-[max-width] ui:ease-in-out ui:duration-[300ms]", "ui:contain-size ui:h-full ui:absolute ui:left-0 ui:top-0", {
5777
+ const classesMain = classNames__default.default("ui:transition-[max-width] ui:ease-in-out ui:duration-[300ms]", "ui:contain-[strict] ui:h-full ui:absolute ui:left-0 ui:top-0", {
5777
5778
  "ui:max-w-[100vw] ui:lg:max-w-[calc(100vw-(--spacing(132)))] ui:w-full": open,
5778
5779
  "ui:max-w-[100vw] ui:w-full": !open
5779
5780
  });
5780
- const classesAside = classNames__default.default("ui:transition-[translate,opacity,display] ui:ease-in-out ui:duration-[300ms]", "ui:max-w-[100vw] ui:w-full ui:h-full", "ui:contain-strict ui:absolute ui:top-0 ui:right-0 ui:h-full ui:max-w-[--spacing(132)] ui:w-full ui:transition-discrete ui:starting:translate-x-[calc(100vw)] ui:starting:opacity-[0] ui:z-20", {
5781
- "ui:translate-x-[0]": open,
5782
- "ui:translate-x-[--spacing(132)] ui:opacity-0 ui:hidden": !open
5783
- });
5784
- const classNamesOverlay = classNames__default.default("ui:transition-[opacity,display] ui:ease-in-out ui:duration-[300ms] ui:transition-discrete ui:starting:opacity-0 ui:z-10", "ui:absolute ui:top-0 ui:left-0 ui:w-screen ui:h-screen ui:bg-black ui:lg:hidden", {
5781
+ const classNamesOverlay = classNames__default.default("ui:contain-[strict] ui:transition-[opacity,display] ui:ease-in-out ui:duration-[300ms] ui:transition-discrete ui:starting:opacity-0 ui:z-10", "ui:absolute ui:top-0 ui:left-0 ui:w-screen ui:h-screen ui:bg-black ui:lg:hidden", {
5785
5782
  "ui:hidden ui:opacity-0": !open,
5786
5783
  "ui:visible ui:lg:hidden ui:opacity-[0.2]": open
5787
5784
  });
5788
- return jsxRuntime.jsxs(Stack, Object.assign({ axis: "x", width: "full", className: "ui:h-full ui:w-full" }, restProps, { children: [jsxRuntime.jsx(Stack, { as: "main", className: classesMain, width: "full", align: "stretch", children }), jsxRuntime.jsx(Stack, { as: "aside", className: classesAside, hidden: !open, width: "full", align: "stretch", children: aside }), jsxRuntime.jsx(Box, { className: classNamesOverlay })] }));
5785
+ return jsxRuntime.jsx(context.Provider, { value: open, children: jsxRuntime.jsxs(Stack, Object.assign({ axis: "x", width: "full", className: "ui:h-100dvh" }, restProps, { children: [jsxRuntime.jsx(Box, { as: "main", className: classesMain, width: "full", children }), aside, jsxRuntime.jsx(Box, { className: classNamesOverlay })] })) });
5786
+ };
5787
+ const Aside = (props) => {
5788
+ const { children, className } = props, restProps = __rest(props, ["children", "className"]);
5789
+ const open = React.useContext(context);
5790
+ const classesAside = classNames__default.default("ui:inset-auto ui:w-full ui:flex ui:items-stretch ui:bg-transparent", "ui:contain-[layout_size] ui:transition-[translate,opacity,display] ui:ease-in-out ui:duration-[300ms]", "ui:w-full ui:h-full", "ui:absolute ui:top-0 ui:right-0 ui:h-full ui:max-w-[--spacing(132)] ui:w-full ui:transition-discrete ui:starting:translate-x-[calc(100vw)] ui:starting:opacity-[0] ui:z-20", {
5791
+ "ui:translate-x-[0]": open,
5792
+ "ui:translate-x-[--spacing(132)] ui:opacity-0 ui:hidden": !open
5793
+ }, className);
5794
+ const dialog = React.useRef(null);
5795
+ const focusDialog = (e) => {
5796
+ if (e.target instanceof HTMLDialogElement) {
5797
+ e.target.focus();
5798
+ }
5799
+ };
5800
+ React.useEffect(() => {
5801
+ if (dialog.current) {
5802
+ dialog.current.addEventListener("transitionend", focusDialog);
5803
+ }
5804
+ return () => {
5805
+ var _a;
5806
+ (_a = dialog.current) === null || _a === void 0 ? void 0 : _a.removeEventListener("transitionend", focusDialog);
5807
+ };
5808
+ }, [open]);
5809
+ return jsxRuntime.jsx("dialog", Object.assign({ open, ref: dialog, className: classesAside }, restProps, { children }));
5789
5810
  };
5811
+ SplitViewLayout.Aside = Aside;
5790
5812
 
5791
5813
  Object.defineProperty(exports, "Toaster", {
5792
5814
  enumerable: true,